diff --git a/.clang-format b/.clang-format index a0cdb6fc60c..cb363900eb6 100644 --- a/.clang-format +++ b/.clang-format @@ -2,3 +2,4 @@ BasedOnStyle: Google PointerAlignment: Left DerivePointerAlignment: false ColumnLimit: 120 +SortIncludes: Never diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 00000000000..f752385dc08 --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,5 @@ +Checks: '-*,modernize-avoid-bind,modernize-deprecated-headers,modernize-deprecated-ios-base-aliases,modernize-macro-to-enum,modernize-pass-by-value,modernize-raw-string-literal,modernize-redundant-void-arg,modernize-replace-auto-ptr,modernize-replace-disallow-copy-and-assign-macro,modernize-replace-random-shuffle,modernize-return-braced-init-list,modernize-shrink-to-fit,modernize-unary-static-assert,modernize-use-auto,modernize-use-bool-literals,modernize-use-default-member-init,modernize-use-emplace,modernize-use-equals-default,modernize-use-equals-delete,modernize-use-noexcept,modernize-use-nullptr,modernize-use-override,modernize-use-transparent-functors,modernize-use-using,readability-const-return-type,readability-avoid-const-params-in-decls,readability-container-data-pointer,readability-container-size-empty,readability-delete-null-pointer,readability-duplicate-include,readability-non-const-parameter,readability-redundant-access-specifiers,readability-redundant-control-flow,readability-redundant-declaration,readability-redundant-function-ptr-dereference,readability-redundant-smartptr-get,readability-redundant-string-cstr,readability-redundant-string-init,readability-simplify-boolean-expr,readability-simplify-subscript-expr,readability-else-after-return,performance-*' +CheckOptions: + - {key: modernize-use-override.AllowOverrideAndFinal, value: 'true'} + - {key: performance-unnecessary-copy-initialization.AllowedTypes, value: 'su2double'} + - {key: performance-unnecessary-value-param.AllowedTypes, value: 'su2double'} diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 4f53a6d0449..13c3dd26f57 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -26,4 +26,3 @@ assignees: '' - C++ compiler and version: [e.g., g++ (GCC) 4.8.5] - MPI implementation and version: [e.g., OpenMPI 3.0.0] - SU2 Version: [e.g., v6.2.0] - diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 6aab0240f56..129fb1c1723 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,6 +1,6 @@ ## Proposed Changes *Give a brief overview of your contribution here in a few sentences.* - + ## Related Work @@ -14,5 +14,6 @@ - [ ] I am submitting my contribution to the develop branch. - [ ] My contribution generates no new compiler warnings (try with --warnlevel=3 when using meson). - [ ] My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/). +- [ ] I used the pre-commit hook to prevent dirty commits and used `pre-commit run --all` to format old commits. - [ ] I have added a test case that demonstrates my contribution, if necessary. - [ ] I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp), if necessary. diff --git a/.github/release.yml b/.github/release.yml index 4ec929fc17c..09557097401 100644 --- a/.github/release.yml +++ b/.github/release.yml @@ -17,4 +17,3 @@ changelog: - title: 'Other Changes' labels: - "*" - diff --git a/.github/workflows/change-version.yml b/.github/workflows/change-version.yml index 58752ea921c..012217a248f 100644 --- a/.github/workflows/change-version.yml +++ b/.github/workflows/change-version.yml @@ -16,7 +16,7 @@ jobs: id: extract_branch - name: Change the version number run: | - SU2_PY/change_version_number.py -v ${GITHUB_REF##*/release_v} -r Blackbird -y + SU2_PY/change_version_number.py -v ${GITHUB_REF##*/release_v} -r Harrier -y - name: Commit files run: | git config --local user.email "action@github.com" diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml new file mode 100644 index 00000000000..a0080f08981 --- /dev/null +++ b/.github/workflows/code-style.yml @@ -0,0 +1,30 @@ +name: Code Style +on: + pull_request: + paths: + - "**.[ch]pp" + - "**.[ch]" + - "**.cfg" + - "**.py" + +jobs: + formatting: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup python + uses: actions/setup-python@v4 + with: + python-version: '3.10' + check-latest: true + - name: Install pre-commit + run: pip install pre-commit + - name: Run checks + run: pre-commit run -a -v + - name: Git status + if: always() + run: git status + - name: Full diff + if: always() + run: git diff diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index e749e661e70..129913c82cf 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -26,13 +26,13 @@ jobs: config_set: [BaseMPI, ReverseMPI, ForwardMPI, BaseNoMPI, ReverseNoMPI, ForwardNoMPI, BaseOMP, ReverseOMP, ForwardOMP] include: - config_set: BaseMPI - flags: '-Denable-pywrapper=true -Denable-coolprop=true -Denable-tests=true --warnlevel=2 --werror' + flags: '-Denable-pywrapper=true -Denable-coolprop=true -Denable-mpp=true -Dinstall-mpp=true -Denable-mlpcpp=true -Denable-tests=true --warnlevel=2' - config_set: ReverseMPI flags: '-Denable-autodiff=true -Denable-normal=false -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror' - config_set: ForwardMPI flags: '-Denable-directdiff=true -Denable-normal=false -Denable-tests=true --warnlevel=3 --werror' - config_set: BaseNoMPI - flags: '-Denable-pywrapper=true -Denable-openblas=true -Dwith-mpi=disabled -Denable-tests=true --warnlevel=3 --werror' + flags: '-Denable-pywrapper=true -Denable-openblas=true -Dwith-mpi=disabled -Denable-mlpcpp=true -Denable-tests=true --warnlevel=3 --werror' - config_set: ReverseNoMPI flags: '-Denable-autodiff=true -Denable-normal=false -Dwith-mpi=disabled -Denable-pywrapper=true -Denable-tests=true --warnlevel=3 --werror' - config_set: ForwardNoMPI @@ -40,9 +40,9 @@ jobs: - config_set: BaseOMP flags: '-Dwith-omp=true -Denable-mixedprec=true -Denable-pywrapper=true -Denable-tecio=false --warnlevel=3 --werror' - config_set: ReverseOMP - flags: '-Denable-autodiff=true -Denable-normal=false -Dwith-omp=true -Denable-mixedprec=true -Denable-tecio=false --warnlevel=3 --werror' + flags: '-Denable-autodiff=true -Denable-normal=false -Dwith-omp=true -Denable-mixedprec=true -Denable-pywrapper=true -Denable-tecio=false --warnlevel=3 --werror' - config_set: ForwardOMP - flags: '-Denable-directdiff=true -Denable-normal=false -Dwith-omp=true -Denable-mixedprec=true -Denable-tecio=false --warnlevel=3 --werror' + flags: '-Denable-directdiff=true -Denable-normal=false -Dwith-omp=true -Denable-mixedprec=true -Denable-pywrapper=true -Denable-tecio=false --warnlevel=3 --werror' runs-on: ${{ inputs.runner || 'ubuntu-latest' }} steps: - name: Cache Object Files @@ -52,23 +52,66 @@ jobs: key: ${{ matrix.config_set }}-${{ github.sha }} restore-keys: ${{ matrix.config_set }} - name: Pre Cleanup - uses: docker://ghcr.io/su2code/su2/build-su2:221224-1158 + uses: docker://ghcr.io/su2code/su2/build-su2:230813-0103 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} - name: Build - uses: docker://ghcr.io/su2code/su2/build-su2:221224-1158 + uses: docker://ghcr.io/su2code/su2/build-su2:230813-0103 with: args: -b ${{github.ref}} -f "${{matrix.flags}}" - name: Compress binaries - run: tar -zcvf install_bin.tgz install/bin + run: tar -zcvf install_bin.tgz install/* - name: Upload Binaries uses: actions/upload-artifact@v3 with: name: ${{ matrix.config_set }} path: install_bin.tgz - name: Post Cleanup - uses: docker://ghcr.io/su2code/su2/build-su2:221224-1158 + uses: docker://ghcr.io/su2code/su2/build-su2:230813-0103 + with: + entrypoint: /bin/rm + args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} + build_tsan: + name: Build SU2 (tsan) + if: inputs.runner != 'ARM64' + strategy: + fail-fast: false + matrix: + config_set: [BaseOMP-tsan, ReverseOMP-tsan] #ForwardOMP-tsan + include: + - config_set: BaseOMP-tsan + flags: '--buildtype=debugoptimized -Dwith-omp=true -Denable-mixedprec=true -Denable-tecio=false --warnlevel=3' + - config_set: ReverseOMP-tsan + flags: '--buildtype=debugoptimized -Denable-autodiff=true -Denable-normal=false -Dwith-omp=true -Denable-mixedprec=true -Denable-tecio=false --warnlevel=3' + #- config_set: ForwardOMP-tsan + # flags: '--buildtype=debug -Denable-directdiff=true -Denable-normal=false -Dwith-omp=true -Denable-mixedprec=true -Denable-pywrapper=true -Denable-tecio=false --warnlevel=3 --werror' + runs-on: ${{ inputs.runner || 'ubuntu-latest' }} + steps: + - name: Cache Object Files + uses: actions/cache@v3 + with: + path: ccache + key: ${{ matrix.config_set }}-${{ github.sha }} + restore-keys: ${{ matrix.config_set }} + - name: Pre Cleanup + uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230813-0103 + with: + entrypoint: /bin/rm + args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} + - name: Build + uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230813-0103 + with: + args: -b ${{github.ref}} -f "${{matrix.flags}}" + - name: Compress binaries + run: tar -zcvf install_bin.tgz install/* + - name: Upload Binaries + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.config_set }} + path: install_bin.tgz + - name: Post Cleanup + uses: docker://ghcr.io/su2code/su2/build-su2-tsan:230813-0103 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} @@ -99,7 +142,7 @@ jobs: tag: OMP steps: - name: Pre Cleanup - uses: docker://ghcr.io/su2code/su2/test-su2:221224-1158 + uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} @@ -118,19 +161,65 @@ jobs: ls -lah tar -zxvf install_bin.tgz ls -lah install/bin/ - cp -r install/bin/* $BIN_FOLDER; + cp -r install/* $BIN_FOLDER/../ popd; fi done chmod a+x $BIN_FOLDER/* ls -lahR $BIN_FOLDER - name: Run Tests in Container - uses: docker://ghcr.io/su2code/su2/test-su2:221224-1158 + uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103 with: # -t -c args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} - name: Cleanup - uses: docker://ghcr.io/su2code/su2/test-su2:221224-1158 + uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103 + with: + entrypoint: /bin/rm + args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} + thread_sanitizer_tests: + if: inputs.runner != 'ARM64' + runs-on: ${{ inputs.runner || 'ubuntu-latest' }} + name: Thread Sanitizer Tests + needs: build_tsan + strategy: + fail-fast: false + matrix: + testscript: ['hybrid_regression.py', 'hybrid_regression_AD.py'] + steps: + - name: Pre Cleanup + uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230813-0103 + with: + entrypoint: /bin/rm + args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} + - name: Download All artifacts + uses: actions/download-artifact@v3 + - name: Uncompress and Move Binaries + run: | + BIN_FOLDER="$PWD/install/bin" + mkdir -p $BIN_FOLDER + ls -lah $BIN_FOLDER + for type in Base Reverse Forward; do + TYPE_FOLDER="${type}OMP-tsan" + echo "Processing '$TYPE_FOLDER' ..." + if [ -d $TYPE_FOLDER ]; then + pushd $TYPE_FOLDER + ls -lah + tar -zxvf install_bin.tgz + ls -lah install/bin/ + cp -r install/* $BIN_FOLDER/../ + popd; + fi + done + chmod a+x $BIN_FOLDER/* + ls -lahR $BIN_FOLDER + - name: Run Tests in Container + uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230813-0103 + with: + # -t -c + args: -b ${{github.ref}} -t develop -c develop -s ${{matrix.testscript}} -a "--tsan" + - name: Cleanup + uses: docker://ghcr.io/su2code/su2/test-su2-tsan:230813-0103 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} @@ -151,7 +240,7 @@ jobs: tag: MPI steps: - name: Pre Cleanup - uses: docker://ghcr.io/su2code/su2/test-su2:221224-1158 + uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} @@ -184,7 +273,7 @@ jobs: ls -lah tar -zxvf install_bin.tgz ls -laH install/bin/ - cp -r install/bin/* $BIN_FOLDER; + cp -r install/* $BIN_FOLDER/../ popd; else echo "$TYPE_FOLDER does not exist!" @@ -212,11 +301,11 @@ jobs: echo $PWD ls -lahR - name: Run Unit Tests - uses: docker://ghcr.io/su2code/su2/test-su2:221224-1158 + uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103 with: entrypoint: install/bin/${{matrix.testdriver}} - name: Post Cleanup - uses: docker://ghcr.io/su2code/su2/test-su2:221224-1158 + uses: docker://ghcr.io/su2code/su2/test-su2:230813-0103 with: entrypoint: /bin/rm args: -rf install install_bin.tgz src ccache ${{ matrix.config_set }} diff --git a/.github/workflows/release-management.yml b/.github/workflows/release-management.yml index 287ecdb517d..f0b680a6485 100644 --- a/.github/workflows/release-management.yml +++ b/.github/workflows/release-management.yml @@ -35,7 +35,7 @@ jobs: key: ${{ matrix.os_bin }}-${{ github.sha }} restore-keys: ${{ matrix.os_bin }} - name: Build - uses: docker://ghcr.io/su2code/su2/build-su2-cross:221224-1158 + uses: docker://ghcr.io/su2code/su2/build-su2-cross:230813-0103 with: args: -b ${{ github.sha }} -f "${{matrix.flags}}" - name: Create Archive @@ -65,4 +65,3 @@ jobs: asset_path: ${{matrix.os_bin}}.zip asset_name: SU2-${{ steps.update_release.outputs.tagname }}-${{matrix.os_bin}}.zip asset_content_type: application/zip - diff --git a/.github/workflows/require-labels.yml b/.github/workflows/require-labels.yml new file mode 100644 index 00000000000..5e00e21e4ef --- /dev/null +++ b/.github/workflows/require-labels.yml @@ -0,0 +1,13 @@ +name: Pull Request Labels +on: + pull_request: + types: [opened, labeled, unlabeled, synchronize] +jobs: + label: + runs-on: ubuntu-latest + steps: + - uses: mheap/github-action-required-labels@v3 + with: + mode: exactly + count: 1 + labels: "changelog:feature, changelog:fix, changelog:chore" diff --git a/.gitignore b/.gitignore index 484e0b6e38e..2177d44e12e 100644 --- a/.gitignore +++ b/.gitignore @@ -97,3 +97,9 @@ ninja # Ignore vscode folder .vscode/ + +# Ignore SU2 pre-configuration timestamp created by preconfigure.py +su2preconfig.timestamp + +# Clangd server files +.cache diff --git a/.gitmodules b/.gitmodules index c7e70424d90..2c655cb36da 100644 --- a/.gitmodules +++ b/.gitmodules @@ -24,3 +24,6 @@ [submodule "externals/mel"] path = externals/mel url = https://github.com/pcarruscag/MEL.git +[submodule "subprojects/MLPCpp"] + path = subprojects/MLPCpp + url = https://github.com/EvertBunschoten/MLPCpp.git diff --git a/.lgtm.yml b/.lgtm.yml deleted file mode 100644 index 8489adfaea0..00000000000 --- a/.lgtm.yml +++ /dev/null @@ -1,19 +0,0 @@ -extraction: - cpp: - prepare: - packages: - - libboost-all-dev - configure: - command: - - ./meson.py build --optimization=1 - index: - build_command: - - ./ninja -C build - -path_classifiers: - test: - - TestCases/* - library: - - externals/* - legacy: - - preconfigure.py diff --git a/.pep8 b/.pep8 new file mode 100644 index 00000000000..998b0179c80 --- /dev/null +++ b/.pep8 @@ -0,0 +1,6 @@ +[pycodestyle] +max_line_length = 120 +ignore = E402 +in-place = true +aggressive = 2 +recursive = true diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000000..1e55bb83a10 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,62 @@ +repos: + # Official repo for the clang-format hook + - repo: https://github.com/pre-commit/mirrors-clang-format + rev: "v15.0.7" + hooks: + - id: clang-format + exclude: | + (?x)^( + ^Common/include/CConfig.hpp| + ^Common/include/option_structure.hpp| + ^Common/src/CConfig.cpp| + ^SU2_CFD| + ^externals| + ^subprojects| + ^TestCases| + ^legacy + ) + types_or: [c++, c] + # black repo for python formatting + - repo: https://github.com/ambv/black + rev: 22.6.0 + hooks: + - id: black + exclude: | + (?x)^( + ^SU2_CFD| + ^externals| + ^subprojects| + ^TestCases| + ^legacy + ) + # Official repo for default hooks + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: "v4.4.0" + hooks: + - id: mixed-line-ending + exclude: | + (?x)^( + ^SU2_CFD| + ^externals| + ^subprojects| + ^TestCases| + ^legacy + ) + - id: trailing-whitespace + exclude: | + (?x)^( + ^SU2_CFD| + ^externals| + ^subprojects| + ^TestCases| + ^legacy + ) + - id: end-of-file-fixer + exclude: | + (?x)^( + ^SU2_CFD| + ^externals| + ^subprojects| + ^TestCases| + ^legacy + ) diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 28481849073..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,90 +0,0 @@ -# Continous Integration setup for SU2. -# Tests on the develop branch in both serial and parallel. - -dist: xenial -sudo: required - -language: c++ - -cache: - - ccache - - pip - - directories: - - $HOME/.pyenv_cache - -compiler: - - gcc - -notifications: - email: - recipients: - - su2code-dev@lists.stanford.edu - -branches: - only: - - develop - -virtualenv: - system_site_packages: true - -env: - matrix: - # Serial build and test - - CONFIGURE_COMMAND="./meson.py build --prefix=$TRAVIS_BUILD_DIR -Denable-pywrapper=true -Dwith-mpi=disabled" - TEST_SCRIPT=serial_regression.py - - # Parallel build and test - - CONFIGURE_COMMAND="./meson.py build --prefix=$TRAVIS_BUILD_DIR -Denable-pywrapper=true" - TEST_SCRIPT=parallel_regression.py - - # Hybrid-parallel build and test - - CONFIGURE_COMMAND="./meson.py build --prefix=$TRAVIS_BUILD_DIR -Dwith-omp=true -Denable-mixedprec=true -Denable-tecio=false" - TEST_SCRIPT=hybrid_regression.py - - # Serial build and test for AD - - CONFIGURE_COMMAND="./meson.py build --prefix=$TRAVIS_BUILD_DIR -Denable-pywrapper=true -Dwith-mpi=disabled -Denable-autodiff=true -Denable-directdiff=true" - TEST_SCRIPT=serial_regression_AD.py - - # Parallel build and test for AD - - CONFIGURE_COMMAND="./meson.py build --prefix=$TRAVIS_BUILD_DIR -Denable-pywrapper=true -Denable-autodiff=true" - TEST_SCRIPT=parallel_regression_AD.py - -before_install: - # Temporarily fixes Travis CI issue with paths for Python packages - - export PATH=/usr/bin:$PATH - - sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10 - # Install the necessary packages using apt-get with sudo - - sudo apt-get update -qq - - sudo apt-get install -qq build-essential python3-numpy python3-scipy libopenmpi-dev openmpi-bin swig python3-mpi4py - # to avoid interference with MPI - - test -n $CC && unset CC - - test -n $CXX && unset CXX - -install: - # build ninja - - echo $CONFIGURE_COMMAND - - $CONFIGURE_COMMAND - - ./meson.py build --reconfigure --optimization=2 - - ./meson.py build --reconfigure --warnlevel=2 - - ./ninja -C build install - - # Add environmental variables according to the configure step - - export SU2_RUN=$TRAVIS_BUILD_DIR/bin - - export SU2_HOME=$TRAVIS_BUILD_DIR - - export PATH=$PATH:$SU2_RUN - - export PYTHONPATH=$PYTHONPATH:$SU2_RUN - -before_script: - # Get the test cases - - git clone --depth=1 -b develop https://github.com/su2code/TestCases.git ./TestData - - cp -R ./TestData/* ./TestCases/ - - # Get the tutorial cases - - git clone --depth=1 -b develop https://github.com/su2code/su2code.github.io ./Tutorials - - # Enter the SU2/TestCases/ directory, which is now ready to run - - cd TestCases/ - -script: - # Run the tests via the Python scripts - - python $TEST_SCRIPT diff --git a/AUTHORS.md b/AUTHORS.md index 49ce6d21fe8..c4392afcab7 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -71,6 +71,7 @@ Eduardo Molina Edwin van der Weide Ethan Alan Hereth Florian Dittmann +Francesco Poli Francisco D. Palacios Gaurav Bansal Giacomo Baldan @@ -91,8 +92,10 @@ Jessie Lauzon João Loureiro Johannes Blühdorn JonathanSmith1936 +Joseph Signorelli Josy P. Pullockara Kedar Naik +Kürşat Yurt LaSerpe Lennaert Tol Lisa Kusch @@ -129,6 +132,7 @@ Thomas D. Economon Tim Albring TobiKattmann Trent Lukaczyk +Vinzenz Götz VivaanKhatri Wally Maier Y. Chandukrishna @@ -157,4 +161,3 @@ srcopela tobadavid vfrancesmolla ``` - diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 174a61f6120..c22c88372a9 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -28,7 +28,7 @@ Examples of unacceptable behavior by participants include: * Trolling, insulting/derogatory comments, and personal or political attacks. * Public or private harassment. * Publishing others' private information, such as a physical or electronic - address, without explicit permission. + address, without explicit permission. * Other conduct which could reasonably be considered inappropriate in a professional setting. @@ -67,7 +67,7 @@ faith may face temporary or permanent repercussions as determined by other members of the project's leadership. Consequences may include: -* Downgrade or removal of repository permissions such as admin and write +* Downgrade or removal of repository permissions such as admin and write permissions. * Removal from the su2code organization on Github. * Being blocked from the su2code repository. @@ -79,4 +79,3 @@ This Code of Conduct is adapted from the [Contributor Covenant][homepage], versi available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html [homepage]: https://www.contributor-covenant.org - diff --git a/COPYING b/COPYING index fe17b67bd4e..20fb9c7da21 100644 --- a/COPYING +++ b/COPYING @@ -55,7 +55,7 @@ modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. - + Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a @@ -111,7 +111,7 @@ modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. - + GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION @@ -158,7 +158,7 @@ Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. - + 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 @@ -216,7 +216,7 @@ instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. - + Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. @@ -267,7 +267,7 @@ Library will still fall under Section 6.) distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. - + 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work @@ -329,7 +329,7 @@ restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. - + 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined @@ -370,7 +370,7 @@ subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. - + 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or @@ -422,7 +422,7 @@ conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. - + 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is @@ -455,4 +455,4 @@ FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS \ No newline at end of file + END OF TERMS AND CONDITIONS diff --git a/Common/include/CConfig.hpp b/Common/include/CConfig.hpp index f3b1abd9876..563d477a696 100644 --- a/Common/include/CConfig.hpp +++ b/Common/include/CConfig.hpp @@ -3,7 +3,7 @@ * \brief All the information about the definition of the physical problem. * The subroutines and functions are in the CConfig.cpp file. * \author F. Palacios, T. Economon, B. Tracey - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -150,7 +150,6 @@ class CConfig { su2double CL_Target; /*!< \brief Fixed Cl mode Target Cl. */ su2double Confinement_Param; /*!< \brief Confinement paramenter for Vorticity Confinement method. */ TIME_MARCHING TimeMarching; /*!< \brief Steady or unsteady (time stepping or dual time stepping) computation. */ - unsigned short Dynamic_Analysis; /*!< \brief Static or dynamic structural analysis. */ su2double FixAzimuthalLine; /*!< \brief Fix an azimuthal line due to misalignments of the nearfield. */ su2double **DV_Value; /*!< \brief Previous value of the design variable. */ su2double Venkat_LimiterCoeff; /*!< \brief Limiter coefficient */ @@ -168,9 +167,6 @@ class CConfig { su2double HarmonicBalance_Period; /*!< \brief Period of oscillation to be used with harmonic balance computations. */ su2double Delta_UnstTime, /*!< \brief Time step for unsteady computations. */ Delta_UnstTimeND; /*!< \brief Time step for unsteady computations (non dimensional). */ - su2double Delta_DynTime, /*!< \brief Time step for dynamic structural computations. */ - Total_DynTime, /*!< \brief Total time for dynamic structural computations. */ - Current_DynTime; /*!< \brief Global time of the dynamic structural computations. */ su2double Total_UnstTime, /*!< \brief Total time for unsteady computations. */ Total_UnstTimeND; /*!< \brief Total time for unsteady computations (non dimensional). */ su2double Current_UnstTime, /*!< \brief Global time of the unsteady simulation. */ @@ -523,7 +519,12 @@ class CConfig { Kind_TimeIntScheme_AdjTurb, /*!< \brief Time integration for the adjoint turbulence model. */ Kind_TimeIntScheme_Species, /*!< \brief Time integration for the species model. */ Kind_TimeIntScheme_Heat, /*!< \brief Time integration for the wave equations. */ - Kind_TimeStep_Heat; /*!< \brief Time stepping method for the (fvm) heat equation. */ + Kind_TimeStep_Heat, /*!< \brief Time stepping method for the (fvm) heat equation. */ + n_Datadriven_files; + ENUM_DATADRIVEN_METHOD Kind_DataDriven_Method; /*!< \brief Method used for datset regression in data-driven fluid models. */ + + su2double DataDriven_Relaxation_Factor; /*!< \brief Relaxation factor for Newton solvers in data-driven fluid models. */ + STRUCT_TIME_INT Kind_TimeIntScheme_FEA; /*!< \brief Time integration for the FEA equations. */ STRUCT_SPACE_ITE Kind_SpaceIteScheme_FEA; /*!< \brief Iterative scheme for nonlinear structural analysis. */ unsigned short @@ -701,6 +702,7 @@ class CConfig { nMarker_PyCustom, /*!< \brief Number of markers that are customizable in Python. */ nMarker_DV, /*!< \brief Number of markers affected by the design variables. */ nMarker_WallFunctions, /*!< \brief Number of markers for which wall functions must be applied. */ + nMarker_StrongBC, /*!< \brief Number of markers for which a strong BC must be applied. */ nMarker_SobolevBC; /*!< \brief Number of markers treaded in the gradient problem. */ string *Marker_Monitoring, /*!< \brief Markers to monitor. */ *Marker_Designing, /*!< \brief Markers to design. */ @@ -712,6 +714,7 @@ class CConfig { *Marker_PyCustom, /*!< \brief Markers that are customizable in Python. */ *Marker_DV, /*!< \brief Markers affected by the design variables. */ *Marker_WallFunctions, /*!< \brief Markers for which wall functions must be applied. */ + *Marker_StrongBC, /*!< \brief Markers for which a strong BC must be applied. */ *Marker_SobolevBC; /*!< \brief Markers in the gradient solver */ unsigned short nConfig_Files; /*!< \brief Number of config files for multiphysics problems. */ @@ -802,7 +805,8 @@ class CConfig { SurfAdjCoeff_FileName, /*!< \brief Output file with the adjoint variables on the surface. */ SurfSens_FileName, /*!< \brief Output file for the sensitivity on the surface (discrete adjoint). */ VolSens_FileName, /*!< \brief Output file for the sensitivity in the volume (discrete adjoint). */ - ObjFunc_Hess_FileName; /*!< \brief Hessian approximation obtained by the Sobolev smoothing solver. */ + ObjFunc_Hess_FileName, /*!< \brief Hessian approximation obtained by the Sobolev smoothing solver. */ + *DataDriven_Method_FileNames; /*!< \brief Dataset information for data-driven fluid models. */ bool Wrt_Performance, /*!< \brief Write the performance summary at the end of a calculation. */ @@ -905,6 +909,7 @@ class CConfig { Tke_FreeStreamND, /*!< \brief Farfield kinetic energy (external flow). */ Omega_FreeStreamND, /*!< \brief Specific dissipation (external flow). */ Omega_FreeStream; /*!< \brief Specific dissipation (external flow). */ + bool Variable_Density; /*!< \brief Variable density for incompressible flow. */ unsigned short nElectric_Constant; /*!< \brief Number of different electric constants. */ su2double *Electric_Constant; /*!< \brief Dielectric constant modulus. */ su2double Knowles_B, /*!< \brief Knowles material model constant B. */ @@ -1147,7 +1152,6 @@ class CConfig { unsigned long *VolumeOutputFrequencies; /*!< \brief list containing the writing frequencies */ bool Multizone_Mesh; /*!< \brief Determines if the mesh contains multiple zones. */ - bool SinglezoneDriver; /*!< \brief Determines if the single-zone driver is used. (TEMPORARY) */ bool Wrt_ZoneConv; /*!< \brief Write the convergence history of each individual zone to screen. */ bool Wrt_ZoneHist; /*!< \brief Write the convergence history of each individual zone to file. */ bool SpecialOutput, /*!< \brief Determines if the special output is written. */ @@ -1184,7 +1188,7 @@ class CConfig { unsigned short maxBasisDim, /*!< \brief Maximum number of POD basis dimensions. */ rom_save_freq; /*!< \brief Frequency of unsteady time steps to save. */ - unsigned short nSpecies; /*!< \brief Number of transported species equations (for NEMO and species transport)*/ + unsigned short nSpecies = 0; /*!< \brief Number of transported species equations (for NEMO and species transport)*/ /* other NEMO configure options*/ unsigned short nSpecies_Cat_Wall, /*!< \brief No. of species for a catalytic wall. */ @@ -1215,6 +1219,24 @@ class CConfig { su2double* Species_Init; /*!< \brief Initial uniform value for scalar transport. */ unsigned short nSpecies_Init; /*!< \brief Number of entries of SPECIES_INIT */ + /*--- Additional flamelet solver options ---*/ + su2double flame_init[8]; /*!< \brief Initial solution parameters for flamelet solver.*/ + + /*--- lookup table ---*/ + unsigned short n_scalars = 0; /*!< \brief Number of transported scalars for flamelet LUT approach. */ + unsigned short n_lookups = 0; /*!< \brief Number of lookup variables, for visualization only. */ + unsigned short n_table_sources = 0; /*!< \brief Number of transported scalar source terms for LUT. */ + unsigned short n_user_scalars = 0; /*!< \brief Number of user defined (auxiliary) scalar transport equations. */ + unsigned short n_user_sources = 0; /*!< \brief Number of source terms for user defined (auxiliary) scalar transport equations. */ + unsigned short n_control_vars = 0; /*!< \brief Number of controlling variables (independent variables) for the LUT. */ + + string* controlling_variable_names; + string* cv_source_names; + vector table_scalar_names; /*!< \brief Names of transported scalar variables. */ + string* lookup_names; /*!< \brief Names of passive look-up variables. */ + string* user_scalar_names; /*!< \brief Names of the user defined (auxiliary) transported scalars .*/ + string* user_source_names; /*!< \brief Names of the source terms for the user defined transported scalars. */ + /*! * \brief Set the default values of config options not set in the config file using another config object. * \param config - Config object to use the default values from. @@ -1254,19 +1276,19 @@ class CConfig { /*!< \brief addDoubleOption creates a config file parser for an option with the given name whose value can be represented by a su2double.*/ - void addDoubleOption(const string name, su2double & option_field, su2double default_value); + void addDoubleOption(const string& name, su2double & option_field, su2double default_value); - void addStringOption(const string name, string & option_field, string default_value); + void addStringOption(const string& name, string & option_field, string default_value); - void addIntegerOption(const string name, int & option_field, int default_value); + void addIntegerOption(const string& name, int & option_field, int default_value); - void addUnsignedLongOption(const string name, unsigned long & option_field, unsigned long default_value); + void addUnsignedLongOption(const string& name, unsigned long & option_field, unsigned long default_value); - void addUnsignedShortOption(const string name, unsigned short & option_field, unsigned short default_value); + void addUnsignedShortOption(const string& name, unsigned short & option_field, unsigned short default_value); - void addLongOption(const string name, long & option_field, long default_value); + void addLongOption(const string& name, long & option_field, long default_value); - void addBoolOption(const string name, bool & option_field, bool default_value); + void addBoolOption(const string& name, bool & option_field, bool default_value); // enum types work differently than all of the others because there are a small number of valid // string entries for the type. One must also provide a list of all the valid strings of that type. @@ -1277,48 +1299,48 @@ class CConfig { template void addEnumListOption(const string name, unsigned short& input_size, Tfield*& option_field, const map& enum_map); - void addDoubleArrayOption(const string name, const int size, su2double* option_field); + void addDoubleArrayOption(const string& name, const int size, su2double* option_field); - void addUShortArrayOption(const string name, const int size, unsigned short* option_field); + void addUShortArrayOption(const string& name, const int size, unsigned short* option_field); - void addDoubleListOption(const string name, unsigned short & size, su2double * & option_field); + void addDoubleListOption(const string& name, unsigned short & size, su2double * & option_field); - void addShortListOption(const string name, unsigned short & size, short * & option_field); + void addShortListOption(const string& name, unsigned short & size, short * & option_field); - void addUShortListOption(const string name, unsigned short & size, unsigned short * & option_field); + void addUShortListOption(const string& name, unsigned short & size, unsigned short * & option_field); - void addULongListOption(const string name, unsigned short & size, unsigned long * & option_field); + void addULongListOption(const string& name, unsigned short & size, unsigned long * & option_field); - void addStringListOption(const string name, unsigned short & num_marker, string* & option_field); + void addStringListOption(const string& name, unsigned short & num_marker, string* & option_field); - void addConvectOption(const string name, unsigned short & space_field, CENTERED & centered_field, UPWIND & upwind_field); + void addConvectOption(const string& name, unsigned short & space_field, CENTERED & centered_field, UPWIND & upwind_field); - void addConvectFEMOption(const string name, unsigned short & space_field, unsigned short & fem_field); + void addConvectFEMOption(const string& name, unsigned short & space_field, unsigned short & fem_field); - void addMathProblemOption(const string name, bool & ContinuousAdjoint, const bool & ContinuousAdjoint_default, + void addMathProblemOption(const string& name, bool & ContinuousAdjoint, const bool & ContinuousAdjoint_default, bool & DiscreteAdjoint, const bool & DiscreteAdjoint_default, bool & Restart_Flow, const bool & Restart_Flow_default); - void addDVParamOption(const string name, unsigned short & nDV_field, su2double** & paramDV, string* & FFDTag, + void addDVParamOption(const string& name, unsigned short & nDV_field, su2double** & paramDV, string* & FFDTag, unsigned short* & design_variable); - void addDVValueOption(const string name, unsigned short* & nDVValue_field, su2double** & valueDV, unsigned short & nDV_field, su2double** & paramDV, + void addDVValueOption(const string& name, unsigned short* & nDVValue_field, su2double** & valueDV, unsigned short & nDV_field, su2double** & paramDV, unsigned short* & design_variable); - void addFFDDefOption(const string name, unsigned short & nFFD_field, su2double** & coordFFD, string* & FFDTag); + void addFFDDefOption(const string& name, unsigned short & nFFD_field, su2double** & coordFFD, string* & FFDTag); - void addFFDDegreeOption(const string name, unsigned short & nFFD_field, unsigned short** & degreeFFD); + void addFFDDegreeOption(const string& name, unsigned short & nFFD_field, unsigned short** & degreeFFD); - void addStringDoubleListOption(const string name, unsigned short & list_size, string * & string_field, + void addStringDoubleListOption(const string& name, unsigned short & list_size, string * & string_field, su2double* & double_field); - void addInletOption(const string name, unsigned short & nMarker_Inlet, string * & Marker_Inlet, + void addInletOption(const string& name, unsigned short & nMarker_Inlet, string * & Marker_Inlet, su2double* & Ttotal, su2double* & Ptotal, su2double** & FlowDir); - void addInletSpeciesOption(const string name, unsigned short & nMarker_Inlet_Species, string * & Marker_Inlet_Species, + void addInletSpeciesOption(const string& name, unsigned short & nMarker_Inlet_Species, string * & Marker_Inlet_Species, su2double** & inlet_species_val, unsigned short & nSpecies_per_Inlet); - void addInletTurbOption(const string name, unsigned short& nMarker_Inlet_Turb, string*& Marker_Inlet_Turb, + void addInletTurbOption(const string& name, unsigned short& nMarker_Inlet_Turb, string*& Marker_Inlet_Turb, su2double** & Turb_Properties, unsigned short & nTurb_Properties); template @@ -1329,7 +1351,7 @@ class CConfig { void addGilesOption(const string name, unsigned short & nMarker_Giles, string * & Marker_Giles, unsigned short* & option_field, const map & enum_map, su2double* & var1, su2double* & var2, su2double** & FlowDir, su2double* & relaxfactor1, su2double* & relaxfactor2); - void addExhaustOption(const string name, unsigned short & nMarker_Exhaust, string * & Marker_Exhaust, + void addExhaustOption(const string& name, unsigned short & nMarker_Exhaust, string * & Marker_Exhaust, su2double* & Ttotal, su2double* & Ptotal); void addPeriodicOption(const string & name, unsigned short & nMarker_PerBound, @@ -1347,7 +1369,7 @@ class CConfig { string* &string_field, WALL_FUNCTIONS* &val_Kind_WF, unsigned short** &val_IntInfo_WF, su2double** &val_DoubleInfo_WF); - void addPythonOption(const string name); + void addPythonOption(const string& name); public: @@ -1425,7 +1447,7 @@ class CConfig { * \param[in] val_format - Format of the file with the grid information. * \return Total number of zones in the grid file. */ - static unsigned short GetnZone(string val_mesh_filename, unsigned short val_format); + static unsigned short GetnZone(const string& val_mesh_filename, unsigned short val_format); /*! * \brief Gets the number of dimensions in the mesh file @@ -1433,7 +1455,7 @@ class CConfig { * \param[in] val_format - Format of the file with the grid information. * \return Total number of domains in the grid file. */ - static unsigned short GetnDim(string val_mesh_filename, unsigned short val_format); + static unsigned short GetnDim(const string& val_mesh_filename, unsigned short val_format); /*! * \brief Initializes pointers to null @@ -2106,6 +2128,70 @@ class CConfig { */ bool GetSpecies_StrongBC() const { return Species_StrongBC; } + /*! + * \brief Get the flame initialization. + * (x1,x2,x3) = flame offset. + * (x4,x5,x6) = flame normal, separating unburnt from burnt. + * (x7) = flame thickness, the length from unburnt to burnt conditions. + * (x8) = flame burnt thickness, the length to stay at burnt conditions. + * \return Flame initialization for the flamelet model. + */ + const su2double* GetFlameInit() const { return flame_init; } + + /*! + * \brief Get the number of control variables for flamelet model. + */ + unsigned short GetNControlVars() const { return n_control_vars; } + + /*! + * \brief Get the number of total transported scalars for flamelet model. + */ + unsigned short GetNScalars() const { return n_scalars; } + + /*! + * \brief Get the number of user scalars for flamelet model. + */ + unsigned short GetNUserScalars() const { return n_user_scalars; } + + /*! + * \brief Get the name of a specific controlling variable. + */ + const string& GetControllingVariableName(unsigned short i_cv) const { + return controlling_variable_names[i_cv]; + } + + /*! + * \brief Get the name of the source term variable for a specific controlling variable. + */ + const string& GetControllingVariableSourceName(unsigned short i_cv) const { + return cv_source_names[i_cv]; + } + /*! + * \brief Get the name of the user scalar. + */ + const string& GetUserScalarName(unsigned short i_user_scalar) const { + static const std::string none = "NONE"; + if (n_user_scalars > 0) return user_scalar_names[i_user_scalar]; else return none; + } + + /*! + * \brief Get the name of the user scalar source term. + */ + const string& GetUserSourceName(unsigned short i_user_source) const { + static const std::string none = "NONE"; + if (n_user_sources > 0) return user_source_names[i_user_source]; else return none; + } + + /*! + * \brief Get the number of transported scalars for combustion. + */ + unsigned short GetNLookups() const { return n_lookups; } + + /*! + * \brief Get the name of the variable that we want to retrieve from the lookup table. + */ + const string& GetLookupName(unsigned short i_lookup) const { return lookup_names[i_lookup]; } + /*! * \brief Get the Young's modulus of elasticity. * \return Value of the Young's modulus of elasticity. @@ -2113,17 +2199,11 @@ class CConfig { su2double GetElasticyMod(unsigned short id_val) const { return ElasticityMod[id_val]; } /*! - * \brief Decide whether to apply DE effects to the model. - * \return TRUE if the DE effects are to be applied, FALSE otherwise. - */ + * \brief Decide whether to apply DE effects to the model. + * \return TRUE if the DE effects are to be applied, FALSE otherwise. + */ bool GetDE_Effects(void) const { return DE_Effects; } - /*! - * \brief Decide whether to predict the DE effects for the next time step. - * \return TRUE if the DE effects are to be applied, FALSE otherwise. - */ - bool GetDE_Predicted(void); - /*! * \brief Get the number of different electric constants. * \return Value of the DE modulus. @@ -3779,6 +3859,29 @@ class CConfig { */ unsigned short GetKind_FluidModel(void) const { return Kind_FluidModel; } + /*! + * \brief Datadriven method for EoS evaluation. + */ + ENUM_DATADRIVEN_METHOD GetKind_DataDriven_Method(void) const { return Kind_DataDriven_Method; } + + /*! + * \brief Get name of the input file for the data-driven fluid model interpolation method. + * \return Name of the input file for the interpolation method. + */ + const string* GetDataDriven_FileNames(void) const { return DataDriven_Method_FileNames; } + + /*! + * \brief Get number of listed look-up table or multi-layer perceptron input files. + * \return Number of listed data-driven method input files. + */ + unsigned short GetNDataDriven_Files(void) const { return n_Datadriven_files; } + + /*! + * \brief Get Newton solver relaxation factor for data-driven fluid models. + * \return Newton solver relaxation factor. + */ + su2double GetRelaxation_DataDriven(void) const { return DataDriven_Relaxation_Factor; } + /*! * \brief Returns the name of the fluid we are using in CoolProp. */ @@ -3790,6 +3893,12 @@ class CConfig { */ INC_DENSITYMODEL GetKind_DensityModel() const { return Kind_DensityModel; } + /*! + * \brief Selection of variable density option for incompressible flows. + * \return Flag for variable density for incompressible flows. + */ + bool GetVariable_Density_Model() const { return Variable_Density; } + /*! * \brief Flag for whether to solve the energy equation for incompressible flows. * \return Flag for energy equation @@ -4912,7 +5021,7 @@ class CConfig { * \brief Get the type of incompressible inlet from the list. * \return Kind of the incompressible inlet. */ - INLET_TYPE GetKind_Inc_Inlet(string val_marker) const; + INLET_TYPE GetKind_Inc_Inlet(const string& val_marker) const; /*! * \brief Get the total number of types in Kind_Inc_Inlet list @@ -4930,7 +5039,7 @@ class CConfig { * \brief Get the type of incompressible outlet from the list. * \return Kind of the incompressible outlet. */ - INC_OUTLET_TYPE GetKind_Inc_Outlet(string val_marker) const; + INC_OUTLET_TYPE GetKind_Inc_Outlet(const string& val_marker) const; /*! * \brief Get the damping factor applied to velocity updates at incompressible pressure inlets. @@ -5485,7 +5594,7 @@ class CConfig { * \param[in] Iter - the current iteration * \return The new filename */ - string GetFilename(string filename, string ext, int Iter) const; + string GetFilename(string filename, const string& ext, int Iter) const; /*! * \brief Add steady iteration number to the filename (does not overwrite previous files) @@ -5500,7 +5609,7 @@ class CConfig { * \brief Append the zone index to the restart or the solution files. * \return Name of the restart file for the flow variables. */ - string GetMultizone_FileName(string val_filename, int val_iZone, string ext) const; + string GetMultizone_FileName(string val_filename, int val_iZone, const string& ext) const; /*! * \brief Append the zone index to the restart or the solution files. @@ -5509,7 +5618,7 @@ class CConfig { * \param[in] ext - the filename extension. * \return Name of the restart file for the flow variables. */ - string GetMultizone_HistoryFileName(string val_filename, int val_iZone, string ext) const; + string GetMultizone_HistoryFileName(string val_filename, int val_iZone, const string& ext) const; /*! * \brief Append the instance index to the restart or the solution files. @@ -5518,7 +5627,7 @@ class CConfig { * \param[in] ext - the filename extension. * \return Name of the restart file for the flow variables. */ - string GetMultiInstance_FileName(string val_filename, int val_iInst, string ext) const; + string GetMultiInstance_FileName(string val_filename, int val_iInst, const string& ext) const; /*! * \brief Append the instance index to the restart or the solution files. @@ -5589,7 +5698,7 @@ class CConfig { * \param[in] ext - the filename extension. * \return Name of the file with the iteration number for an unsteady solution file. */ - string GetUnsteady_FileName(string val_filename, int val_iter, string ext) const; + string GetUnsteady_FileName(string val_filename, int val_iter, const string& ext) const; /*! * \brief Append the input filename string with the appropriate objective function extension. @@ -5815,6 +5924,13 @@ class CConfig { */ su2double GetTranslation_Rate(unsigned short iDim) const { return Translation_Rate[iDim];} + /*! + * \brief Set the translational velocity of the mesh. + * \param[in] iDim - spatial component + * \return Translational velocity of the mesh. + */ + void SetTranslation_Rate(unsigned short iDim, su2double val) { Translation_Rate[iDim] = val;} + /*! * \brief Get the translational velocity of the marker. * \param[in] iMarkerMoving - Index of the moving marker (as specified in Marker_Moving) @@ -6147,7 +6263,7 @@ class CConfig { * \note When we read the config file, it stores the markers in a particular vector. * \return Index in the config information of the marker val_marker. */ - unsigned short GetMarker_CfgFile_TagBound(string val_marker) const; + unsigned short GetMarker_CfgFile_TagBound(const string& val_marker) const; /*! * \brief Get the name in the config information of the marker number val_marker. @@ -6160,115 +6276,115 @@ class CConfig { * \brief Get the boundary information (kind of boundary) in the config information of the marker val_marker. * \return Kind of boundary in the config information of the marker val_marker. */ - unsigned short GetMarker_CfgFile_KindBC(string val_marker) const; + unsigned short GetMarker_CfgFile_KindBC(const string& val_marker) const; /*! * \brief Get the monitoring information from the config definition for the marker val_marker. * \return Monitoring information of the boundary in the config information for the marker val_marker. */ - unsigned short GetMarker_CfgFile_Monitoring(string val_marker) const; + unsigned short GetMarker_CfgFile_Monitoring(const string& val_marker) const; /*! * \brief Get the monitoring information from the config definition for the marker val_marker. * \return Monitoring information of the boundary in the config information for the marker val_marker. */ - unsigned short GetMarker_CfgFile_GeoEval(string val_marker) const; + unsigned short GetMarker_CfgFile_GeoEval(const string& val_marker) const; /*! * \brief Get the monitoring information from the config definition for the marker val_marker. * \return Monitoring information of the boundary in the config information for the marker val_marker. */ - unsigned short GetMarker_CfgFile_Designing(string val_marker) const; + unsigned short GetMarker_CfgFile_Designing(const string& val_marker) const; /*! * \brief Get the plotting information from the config definition for the marker val_marker. * \return Plotting information of the boundary in the config information for the marker val_marker. */ - unsigned short GetMarker_CfgFile_Plotting(string val_marker) const; + unsigned short GetMarker_CfgFile_Plotting(const string& val_marker) const; /*! * \brief Get the plotting information from the config definition for the marker val_marker. * \return Plotting information of the boundary in the config information for the marker val_marker. */ - unsigned short GetMarker_CfgFile_Analyze(string val_marker) const; + unsigned short GetMarker_CfgFile_Analyze(const string& val_marker) const; /*! * \brief Get the multi-physics interface information from the config definition for the marker val_marker. * \return Plotting information of the boundary in the config information for the marker val_marker. */ - unsigned short GetMarker_CfgFile_ZoneInterface(string val_marker) const; + unsigned short GetMarker_CfgFile_ZoneInterface(const string& val_marker) const; /*! * \brief Get the TurboPerformance information from the config definition for the marker val_marker. * \return TurboPerformance information of the boundary in the config information for the marker val_marker. */ - unsigned short GetMarker_CfgFile_Turbomachinery(string val_marker) const; + unsigned short GetMarker_CfgFile_Turbomachinery(const string& val_marker) const; /*! * \brief Get the TurboPerformance flag information from the config definition for the marker val_marker. * \return TurboPerformance flag information of the boundary in the config information for the marker val_marker. */ - unsigned short GetMarker_CfgFile_TurbomachineryFlag(string val_marker) const; + unsigned short GetMarker_CfgFile_TurbomachineryFlag(const string& val_marker) const; /*! * \brief Get the MixingPlane interface information from the config definition for the marker val_marker. * \return Plotting information of the boundary in the config information for the marker val_marker. */ - unsigned short GetMarker_CfgFile_MixingPlaneInterface(string val_marker) const; + unsigned short GetMarker_CfgFile_MixingPlaneInterface(const string& val_marker) const; /*! * \brief Get the DV information from the config definition for the marker val_marker. * \return DV information of the boundary in the config information for the marker val_marker. */ - unsigned short GetMarker_CfgFile_DV(string val_marker) const; + unsigned short GetMarker_CfgFile_DV(const string& val_marker) const; /*! * \brief Get the motion information from the config definition for the marker val_marker. * \return Motion information of the boundary in the config information for the marker val_marker. */ - unsigned short GetMarker_CfgFile_Moving(string val_marker) const; + unsigned short GetMarker_CfgFile_Moving(const string& val_marker) const; /*! * \brief Get the gradient boundary information from the config definition for the marker val_marker. * \return Gradient boundary information of the boundary in the config information for the marker val_marker. */ - unsigned short GetMarker_CfgFile_SobolevBC(string val_marker) const; + unsigned short GetMarker_CfgFile_SobolevBC(const string& val_marker) const; /*! * \brief Get the DEFORM_MESH information from the config definition for the marker val_marker. * \return DEFORM_MESH information of the boundary in the config information for the marker val_marker. */ - unsigned short GetMarker_CfgFile_Deform_Mesh(string val_marker) const; + unsigned short GetMarker_CfgFile_Deform_Mesh(const string& val_marker) const; /*! * \brief Get the DEFORM_MESH_SYM_PLANE information from the config definition for the marker val_marker. * \return DEFORM_MESH_SYM_PLANE information of the boundary in the config information for the marker val_marker. */ - unsigned short GetMarker_CfgFile_Deform_Mesh_Sym_Plane(string val_marker) const; + unsigned short GetMarker_CfgFile_Deform_Mesh_Sym_Plane(const string& val_marker) const; /*! * \brief Get the Fluid_Load information from the config definition for the marker val_marker. * \return Fluid_Load information of the boundary in the config information for the marker val_marker. */ - unsigned short GetMarker_CfgFile_Fluid_Load(string val_marker) const; + unsigned short GetMarker_CfgFile_Fluid_Load(const string& val_marker) const; /*! * \brief Get the Python customization information from the config definition for the marker val_marker. * \return Python customization information of the boundary in the config information for the marker val_marker. */ - unsigned short GetMarker_CfgFile_PyCustom(string val_marker) const; + unsigned short GetMarker_CfgFile_PyCustom(const string& val_marker) const; /*! * \brief Get the periodic information from the config definition of the marker val_marker. * \return Periodic information of the boundary in the config information of the marker val_marker. */ - unsigned short GetMarker_CfgFile_PerBound(string val_marker) const; + unsigned short GetMarker_CfgFile_PerBound(const string& val_marker) const; /*! * \brief Get the name of the marker val_marker. * \return The interface which owns that marker val_marker. */ - unsigned short GetMarker_ZoneInterface(string val_marker) const; + unsigned short GetMarker_ZoneInterface(const string& val_marker) const; /*! * \brief Get the name of the marker val_iMarker. @@ -6458,17 +6574,17 @@ class CConfig { /*! * \brief Center of rotation for a rotational periodic boundary. */ - const su2double *GetPeriodicRotCenter(string val_marker) const; + const su2double *GetPeriodicRotCenter(const string& val_marker) const; /*! * \brief Angles of rotation for a rotational periodic boundary. */ - const su2double *GetPeriodicRotAngles(string val_marker) const; + const su2double *GetPeriodicRotAngles(const string& val_marker) const; /*! * \brief Translation vector for a translational periodic boundary. */ - const su2double *GetPeriodicTranslation(string val_marker) const; + const su2double *GetPeriodicTranslation(const string& val_marker) const; /*! * \brief Get the translation vector for a periodic transformation. @@ -6481,116 +6597,128 @@ class CConfig { * \brief Get the rotationally periodic donor marker for boundary val_marker. * \return Periodic donor marker from the config information for the marker val_marker. */ - unsigned short GetMarker_Periodic_Donor(string val_marker) const; + unsigned short GetMarker_Periodic_Donor(const string& val_marker) const; /*! * \brief Get the origin of the actuator disk. */ - su2double GetActDisk_NetThrust(string val_marker) const; + su2double GetActDisk_NetThrust(const string& val_marker) const; /*! * \brief Get the origin of the actuator disk. */ - su2double GetActDisk_Power(string val_marker) const; + su2double GetActDisk_Power(const string& val_marker) const; /*! * \brief Get the origin of the actuator disk. */ - su2double GetActDisk_MassFlow(string val_marker) const; + su2double GetActDisk_MassFlow(const string& val_marker) const; /*! * \brief Get the origin of the actuator disk. */ - su2double GetActDisk_Mach(string val_marker) const; + su2double GetActDisk_Mach(const string& val_marker) const; /*! * \brief Get the origin of the actuator disk. */ - su2double GetActDisk_Force(string val_marker) const; + su2double GetActDisk_Force(const string& val_marker) const; /*! * \brief Get the origin of the actuator disk. */ - su2double GetActDisk_BCThrust(string val_marker) const; + su2double GetActDisk_BCThrust(const string& val_marker) const; /*! * \brief Get the origin of the actuator disk. */ - su2double GetActDisk_BCThrust_Old(string val_marker) const; + su2double GetActDisk_BCThrust_Old(const string& val_marker) const; /*! * \brief Get the tip radius of th actuator disk. */ - su2double GetActDisk_Area(string val_marker) const; + su2double GetActDisk_Area(const string& val_marker) const; /*! * \brief Get the tip radius of th actuator disk. */ - su2double GetActDisk_ReverseMassFlow(string val_marker) const; + su2double GetActDisk_ReverseMassFlow(const string& val_marker) const; /*! * \brief Get the thrust corffient of the actuator disk. */ - su2double GetActDisk_PressJump(string val_marker, unsigned short val_index) const; + su2double GetActDisk_PressJump(const string& val_marker, unsigned short val_index) const; /*! * \brief Get the thrust corffient of the actuator disk. */ - su2double GetActDisk_TempJump(string val_marker, unsigned short val_index) const; + su2double GetActDisk_TempJump(const string& val_marker, unsigned short val_index) const; /*! * \brief Get the rev / min of the actuator disk. */ - su2double GetActDisk_Omega(string val_marker, unsigned short val_index) const; + su2double GetActDisk_Omega(const string& val_marker, unsigned short val_index) const; /*! * \brief Get Actuator Disk Outlet for boundary val_marker (actuator disk inlet). * \return Actuator Disk Outlet from the config information for the marker val_marker. */ - unsigned short GetMarker_CfgFile_ActDiskOutlet(string val_marker) const; + unsigned short GetMarker_CfgFile_ActDiskOutlet(const string& val_marker) const; /*! * \brief Get Actuator Disk Outlet for boundary val_marker (actuator disk inlet). * \return Actuator Disk Outlet from the config information for the marker val_marker. */ - unsigned short GetMarker_CfgFile_EngineExhaust(string val_marker) const; + unsigned short GetMarker_CfgFile_EngineExhaust(const string& val_marker) const; /*! * \brief Get the internal index for a moving boundary val_marker. * \return Internal index for a moving boundary val_marker. */ - unsigned short GetMarker_Moving(string val_marker) const; + unsigned short GetMarker_Moving(const string& val_marker) const; /*! - * \brief Get bool if marker is moving. val_marker. - * \param[in] val_marker - String of the marker to test. - * \return Bool if the marker is a moving boundary val_marker. + * \brief Get a bool for whether a marker is moving. val_marker. + * \param[in] val_marker - Name of the marker to test. + * \return True if the marker is a moving boundary val_marker. */ - bool GetMarker_Moving_Bool(string val_marker) const; + inline bool GetMarker_Moving_Bool(const string& val_marker) const { + return GetMarker_Moving(val_marker) < nMarker_Moving; + } /*! * \brief Get the internal index for a DEFORM_MESH boundary val_marker. * \return Internal index for a DEFORM_MESH boundary val_marker. */ - unsigned short GetMarker_Deform_Mesh(string val_marker) const; + unsigned short GetMarker_Deform_Mesh(const string& val_marker) const; /*! * \brief Get the internal index for a DEFORM_MESH_SYM_PLANE boundary val_marker. * \return Internal index for a DEFORM_MESH_SYM_PLANE boundary val_marker. */ - unsigned short GetMarker_Deform_Mesh_Sym_Plane(string val_marker) const; + unsigned short GetMarker_Deform_Mesh_Sym_Plane(const string& val_marker) const; + + /*! + * \brief Get a bool for whether the marker is deformed. val_marker. + * \param[in] val_marker - Name of the marker to test. + * \return True if the marker is a deforming boundary val_marker. + */ + inline bool GetMarker_Deform_Mesh_Bool(const string& val_marker) const { + return GetMarker_Deform_Mesh(val_marker) < nMarker_Deform_Mesh || + GetMarker_Deform_Mesh_Sym_Plane(val_marker) < nMarker_Deform_Mesh_Sym_Plane; + } /*! * \brief Get the internal index for a Fluid_Load boundary val_marker. * \return Internal index for a Fluid_Load boundary val_marker. */ - unsigned short GetMarker_Fluid_Load(string val_marker) const; + unsigned short GetMarker_Fluid_Load(const string& val_marker) const; /*! * \brief Get the internal index for a gradient boundary condition val_marker. * \return Internal index for a gradient boundary condition val_marker. */ - unsigned short GetMarker_SobolevBC(string val_marker) const; + unsigned short GetMarker_SobolevBC(const string& val_marker) const; /*! * \brief Get the name of the surface defined in the geometry file. @@ -6645,35 +6773,35 @@ class CConfig { * \param[in] val_index - Index corresponding to the inlet boundary. * \return The total temperature. */ - su2double GetExhaust_Temperature_Target(string val_index) const; + su2double GetExhaust_Temperature_Target(const string& val_index) const; /*! * \brief Get the total temperature at an inlet boundary. * \param[in] val_index - Index corresponding to the inlet boundary. * \return The total temperature. */ - su2double GetInlet_Ttotal(string val_index) const; + su2double GetInlet_Ttotal(const string& val_index) const; /*! * \brief Get the temperature at a supersonic inlet boundary. * \param[in] val_index - Index corresponding to the inlet boundary. * \return The inlet density. */ - su2double GetInlet_Temperature(string val_index) const; + su2double GetInlet_Temperature(const string& val_index) const; /*! * \brief Get the pressure at a supersonic inlet boundary. * \param[in] val_index - Index corresponding to the inlet boundary. * \return The inlet pressure. */ - su2double GetInlet_Pressure(string val_index) const; + su2double GetInlet_Pressure(const string& val_index) const; /*! * \brief Get the velocity vector at a supersonic inlet boundary. * \param[in] val_index - Index corresponding to the inlet boundary. * \return The inlet velocity vector. */ - const su2double* GetInlet_Velocity(string val_index) const; + const su2double* GetInlet_Velocity(const string& val_index) const; /*! * \brief Get the mass fraction vector for a NEMO inlet boundary. @@ -6694,35 +6822,35 @@ class CConfig { * \param[in] val_index - Index corresponding to the inlet boundary. * \return The total pressure. */ - su2double GetInlet_Ptotal(string val_index) const; + su2double GetInlet_Ptotal(const string& val_index) const; /*! * \brief Set the total pressure at an inlet boundary. * \param[in] val_pressure - Pressure value at the inlet boundary. * \param[in] val_index - Index corresponding to the inlet boundary. */ - void SetInlet_Ptotal(su2double val_pressure, string val_marker); + void SetInlet_Ptotal(su2double val_pressure, const string& val_marker); /*! * \brief Get the species values at an inlet boundary * \param[in] val_index - Index corresponding to the inlet boundary. * \return The inlet species values. */ - const su2double* GetInlet_SpeciesVal(string val_index) const; + const su2double* GetInlet_SpeciesVal(const string& val_index) const; /*! * \brief Get the turbulent properties values at an inlet boundary * \param[in] val_index - Index corresponding to the inlet boundary. * \return The inlet turbulent values. */ - const su2double* GetInlet_TurbVal(string val_index) const; + const su2double* GetInlet_TurbVal(const string& val_index) const; /*! * \brief Get the total pressure at an nacelle boundary. * \param[in] val_index - Index corresponding to the inlet boundary. * \return The total pressure. */ - su2double GetExhaust_Pressure_Target(string val_index) const; + su2double GetExhaust_Pressure_Target(const string& val_index) const; /*! * \brief Value of the CFL reduction in turbulence problems. @@ -6741,97 +6869,97 @@ class CConfig { * \param[in] val_index - Index corresponding to the inlet boundary. * \return The flow direction vector. */ - const su2double* GetInlet_FlowDir(string val_index) const; + const su2double* GetInlet_FlowDir(const string& val_index) const; /*! * \brief Get the back pressure (static) at an outlet boundary. * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetOutlet_Pressure(string val_index) const; + su2double GetOutlet_Pressure(const string& val_index) const; /*! * \brief Set the back pressure (static) at an outlet boundary. * \param[in] val_pressure - Pressure value at the outlet boundary. * \param[in] val_index - Index corresponding to the outlet boundary. */ - void SetOutlet_Pressure(su2double val_pressure, string val_marker); + void SetOutlet_Pressure(su2double val_pressure, const string& val_marker); /*! * \brief Get the var 1 at Riemann boundary. * \param[in] val_marker - Index corresponding to the Riemann boundary. * \return The var1 */ - su2double GetRiemann_Var1(string val_marker) const; + su2double GetRiemann_Var1(const string& val_marker) const; /*! * \brief Get the var 2 at Riemann boundary. * \param[in] val_marker - Index corresponding to the Riemann boundary. * \return The var2 */ - su2double GetRiemann_Var2(string val_marker) const; + su2double GetRiemann_Var2(const string& val_marker) const; /*! * \brief Get the Flowdir at Riemann boundary. * \param[in] val_marker - Index corresponding to the Riemann boundary. * \return The Flowdir */ - const su2double* GetRiemann_FlowDir(string val_marker) const; + const su2double* GetRiemann_FlowDir(const string& val_marker) const; /*! * \brief Get Kind Data of Riemann boundary. * \param[in] val_marker - Index corresponding to the Riemann boundary. * \return Kind data */ - unsigned short GetKind_Data_Riemann(string val_marker) const; + unsigned short GetKind_Data_Riemann(const string& val_marker) const; /*! * \brief Get the var 1 for the Giels BC. * \param[in] val_marker - Index corresponding to the Giles BC. * \return The var1 */ - su2double GetGiles_Var1(string val_marker) const; + su2double GetGiles_Var1(const string& val_marker) const; /*! * \brief Get the var 2 for the Giles boundary. * \param[in] val_marker - Index corresponding to the Giles BC. * \return The var2 */ - su2double GetGiles_Var2(string val_marker) const; + su2double GetGiles_Var2(const string& val_marker) const; /*! * \brief Get the Flowdir for the Giles BC. * \param[in] val_marker - Index corresponding to the Giles BC. * \return The Flowdir */ - const su2double* GetGiles_FlowDir(string val_marker) const; + const su2double* GetGiles_FlowDir(const string& val_marker) const; /*! * \brief Get Kind Data for the Giles BC. * \param[in] val_marker - Index corresponding to the Giles BC. * \return Kind data */ - unsigned short GetKind_Data_Giles(string val_marker) const; + unsigned short GetKind_Data_Giles(const string& val_marker) const; /*! * \brief Set the var 1 for Giles BC. * \param[in] val_marker - Index corresponding to the Giles BC. */ - void SetGiles_Var1(su2double newVar1, string val_marker); + void SetGiles_Var1(su2double newVar1, const string& val_marker); /*! * \brief Get the relax factor for the average component for the Giles BC. * \param[in] val_marker - Index corresponding to the Giles BC. * \return The relax factor for the average component */ - su2double GetGiles_RelaxFactorAverage(string val_marker) const; + su2double GetGiles_RelaxFactorAverage(const string& val_marker) const; /*! * \brief Get the relax factor for the fourier component for the Giles BC. * \param[in] val_marker - Index corresponding to the Giles BC. * \return The relax factor for the fourier component */ - su2double GetGiles_RelaxFactorFourier(string val_marker) const; + su2double GetGiles_RelaxFactorFourier(const string& val_marker) const; /*! * \brief Get the outlet pressure imposed as BC for internal flow. @@ -6910,35 +7038,35 @@ class CConfig { * \param[in] val_index - Index corresponding to the isothermal boundary. * \return The wall temperature. */ - su2double GetIsothermal_Temperature(string val_index) const; + su2double GetIsothermal_Temperature(const string& val_index) const; /*! * \brief Get the wall heat flux on a constant heat flux boundary. * \param[in] val_index - Index corresponding to the constant heat flux boundary. * \return The heat flux. */ - su2double GetWall_HeatFlux(string val_index) const; + su2double GetWall_HeatFlux(const string& val_index) const; /*! * \brief Get the heat transfer coefficient on a heat transfer boundary. * \param[in] val_index - Index corresponding to the heat transfer boundary. * \return The heat transfer coefficient. */ - su2double GetWall_HeatTransfer_Coefficient(string val_index) const; + su2double GetWall_HeatTransfer_Coefficient(const string& val_index) const; /*! * \brief Get the temperature at inifinty on a heat transfer boundary. * \param[in] val_index - Index corresponding to the heat transfer boundary. * \return The temperature at infinity. */ - su2double GetWall_HeatTransfer_Temperature(string val_index) const; + su2double GetWall_HeatTransfer_Temperature(const string& val_index) const; /*! * \brief Get the wall function treatment for the given boundary marker. * \param[in] val_marker - String of the viscous wall marker. * \return The type of wall function treatment. */ - WALL_FUNCTIONS GetWallFunction_Treatment(string val_marker) const; + WALL_FUNCTIONS GetWallFunction_Treatment(const string& val_marker) const; /*! * \brief Get the additional integer info for the wall function treatment @@ -6946,7 +7074,7 @@ class CConfig { * \param[in] val_marker - String of the viscous wall marker. * \return Pointer to the integer info for the given marker. */ - const unsigned short* GetWallFunction_IntInfo(string val_marker) const; + const unsigned short* GetWallFunction_IntInfo(const string& val_marker) const; /*! * \brief Get the additional double info for the wall function treatment @@ -6954,7 +7082,7 @@ class CConfig { * \param[in] val_marker - String of the viscous wall marker. * \return Pointer to the double info for the given marker. */ - const su2double* GetWallFunction_DoubleInfo(string val_marker) const; + const su2double* GetWallFunction_DoubleInfo(const string& val_marker) const; /*! * \brief Get the type of wall and roughness height on a wall boundary (Heatflux or Isothermal). @@ -6968,35 +7096,35 @@ class CConfig { * \param[in] val_index - Index corresponding to the engine inflow boundary. * \return Target (pressure, massflow, etc) . */ - su2double GetEngineInflow_Target(string val_marker) const; + su2double GetEngineInflow_Target(const string& val_marker) const; /*! * \brief Get the fan face Mach number at an engine inflow boundary. * \param[in] val_marker - Name of the boundary. * \return The fan face Mach number. */ - su2double GetInflow_Mach(string val_marker) const; + su2double GetInflow_Mach(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an engine inflow boundary. * \param[in] val_marker - Name of the boundary. * \return The engine inflow pressure. */ - su2double GetInflow_Pressure(string val_marker) const; + su2double GetInflow_Pressure(const string& val_marker) const; /*! * \brief Get the mass flow rate at an engine inflow boundary. * \param[in] val_marker - Name of the boundary. * \return The engine mass flow rate. */ - su2double GetInflow_MassFlow(string val_marker) const; + su2double GetInflow_MassFlow(const string& val_marker) const; /*! * \brief Get the percentage of reverse flow at an engine inflow boundary. * \param[in] val_marker - Name of the boundary. * \return The percentage of reverse flow. */ - su2double GetInflow_ReverseMassFlow(string val_marker) const; + su2double GetInflow_ReverseMassFlow(const string& val_marker) const; /*! * \brief Get the percentage of reverse flow at an engine inflow boundary. @@ -7010,98 +7138,98 @@ class CConfig { * \param[in] val_marker - Name of the boundary. * \return The total pressure. */ - su2double GetInflow_TotalPressure(string val_marker) const; + su2double GetInflow_TotalPressure(const string& val_marker) const; /*! * \brief Get the temperature (static) at an engine inflow boundary. * \param[in] val_marker - Name of the boundary. * \return The engine inflow temperature. */ - su2double GetInflow_Temperature(string val_marker) const; + su2double GetInflow_Temperature(const string& val_marker) const; /*! * \brief Get the total temperature at an engine inflow boundary. * \param[in] val_marker - Name of the boundary. * \return The engine inflow total temperature. */ - su2double GetInflow_TotalTemperature(string val_marker) const; + su2double GetInflow_TotalTemperature(const string& val_marker) const; /*! * \brief Get the ram drag at an engine inflow boundary. * \param[in] val_marker - Name of the boundary. * \return The engine inflow ram drag. */ - su2double GetInflow_RamDrag(string val_marker) const; + su2double GetInflow_RamDrag(const string& val_marker) const; /*! * \brief Get the force balance at an engine inflow boundary. * \param[in] val_marker - Name of the boundary. * \return The engine inflow force balance. */ - su2double GetInflow_Force(string val_marker) const; + su2double GetInflow_Force(const string& val_marker) const; /*! * \brief Get the power at an engine inflow boundary. * \param[in] val_marker - Name of the boundary. * \return The engine inflow power. */ - su2double GetInflow_Power(string val_marker) const; + su2double GetInflow_Power(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an engine exhaust boundary. * \param[in] val_marker - Name of the boundary. * \return The engine exhaust pressure. */ - su2double GetExhaust_Pressure(string val_marker) const; + su2double GetExhaust_Pressure(const string& val_marker) const; /*! * \brief Get the temperature (static) at an engine exhaust boundary. * \param[in] val_marker - Name of the boundary. * \return The engine exhaust temperature. */ - su2double GetExhaust_Temperature(string val_marker) const; + su2double GetExhaust_Temperature(const string& val_marker) const; /*! * \brief Get the massflow at an engine exhaust boundary. * \param[in] val_marker - Name of the boundary. * \return The engine exhaust massflow. */ - su2double GetExhaust_MassFlow(string val_marker) const; + su2double GetExhaust_MassFlow(const string& val_marker) const; /*! * \brief Get the total pressure at an engine exhaust boundary. * \param[in] val_marker - Name of the boundary. * \return The engine exhaust total pressure. */ - su2double GetExhaust_TotalPressure(string val_marker) const; + su2double GetExhaust_TotalPressure(const string& val_marker) const; /*! * \brief Get the total temperature at an engine exhaust boundary. * \param[in] val_marker - Name of the boundary. * \return The total temperature. */ - su2double GetExhaust_TotalTemperature(string val_marker) const; + su2double GetExhaust_TotalTemperature(const string& val_marker) const; /*! * \brief Get the gross thrust at an engine exhaust boundary. * \param[in] val_marker - Name of the boundary. * \return Gross thrust. */ - su2double GetExhaust_GrossThrust(string val_marker) const; + su2double GetExhaust_GrossThrust(const string& val_marker) const; /*! * \brief Get the force balance at an engine exhaust boundary. * \param[in] val_marker - Name of the boundary. * \return Force balance. */ - su2double GetExhaust_Force(string val_marker) const; + su2double GetExhaust_Force(const string& val_marker) const; /*! * \brief Get the power at an engine exhaust boundary. * \param[in] val_marker - Name of the boundary. * \return Power. */ - su2double GetExhaust_Power(string val_marker) const; + su2double GetExhaust_Power(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. @@ -7333,14 +7461,14 @@ class CConfig { * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetActDiskInlet_Temperature(string val_marker) const; + su2double GetActDiskInlet_Temperature(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetActDiskInlet_TotalTemperature(string val_marker) const; + su2double GetActDiskInlet_TotalTemperature(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. @@ -7361,21 +7489,21 @@ class CConfig { * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetActDiskOutlet_Temperature(string val_marker) const; + su2double GetActDiskOutlet_Temperature(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetActDiskOutlet_TotalTemperature(string val_marker) const; + su2double GetActDiskOutlet_TotalTemperature(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetActDiskInlet_MassFlow(string val_marker) const; + su2double GetActDiskInlet_MassFlow(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. @@ -7389,7 +7517,7 @@ class CConfig { * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetActDiskOutlet_MassFlow(string val_marker) const; + su2double GetActDiskOutlet_MassFlow(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. @@ -7403,14 +7531,14 @@ class CConfig { * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetActDiskInlet_Pressure(string val_marker) const; + su2double GetActDiskInlet_Pressure(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetActDiskInlet_TotalPressure(string val_marker) const; + su2double GetActDiskInlet_TotalPressure(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. @@ -7501,21 +7629,21 @@ class CConfig { * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetActDiskInlet_RamDrag(string val_marker) const; + su2double GetActDiskInlet_RamDrag(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetActDiskInlet_Force(string val_marker) const; + su2double GetActDiskInlet_Force(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetActDiskInlet_Power(string val_marker) const; + su2double GetActDiskInlet_Power(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. @@ -7571,7 +7699,7 @@ class CConfig { * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetOutlet_MassFlow(string val_marker) const; + su2double GetOutlet_MassFlow(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. @@ -7585,7 +7713,7 @@ class CConfig { * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetOutlet_Density(string val_marker) const; + su2double GetOutlet_Density(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. @@ -7599,7 +7727,7 @@ class CConfig { * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetOutlet_Area(string val_marker) const; + su2double GetOutlet_Area(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. @@ -7795,7 +7923,7 @@ class CConfig { * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - void SetActDisk_BCThrust(string val_marker, su2double val_actdisk_bcthrust); + void SetActDisk_BCThrust(const string& val_marker, su2double val_actdisk_bcthrust); /*! * \brief Get the back pressure (static) at an outlet boundary. @@ -7809,7 +7937,7 @@ class CConfig { * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - void SetActDisk_BCThrust_Old(string val_marker, su2double val_actdisk_bcthrust_old); + void SetActDisk_BCThrust_Old(const string& val_marker, su2double val_actdisk_bcthrust_old); /*! * \brief Get the back pressure (static) at an outlet boundary. @@ -8033,35 +8161,35 @@ class CConfig { * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetActDiskOutlet_Pressure(string val_marker) const; + su2double GetActDiskOutlet_Pressure(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetActDiskOutlet_TotalPressure(string val_marker) const; + su2double GetActDiskOutlet_TotalPressure(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetActDiskOutlet_GrossThrust(string val_marker) const; + su2double GetActDiskOutlet_GrossThrust(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetActDiskOutlet_Force(string val_marker) const; + su2double GetActDiskOutlet_Force(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. * \param[in] val_index - Index corresponding to the outlet boundary. * \return The outlet pressure. */ - su2double GetActDiskOutlet_Power(string val_marker) const; + su2double GetActDiskOutlet_Power(const string& val_marker) const; /*! * \brief Get the back pressure (static) at an outlet boundary. @@ -8103,91 +8231,91 @@ class CConfig { * \param[in] val_index - Index corresponding to the displacement boundary. * \return The displacement value. */ - su2double GetDispl_Value(string val_index) const; + su2double GetDispl_Value(const string& val_index) const; /*! * \brief Get the force value at an load boundary. * \param[in] val_index - Index corresponding to the load boundary. * \return The load value. */ - su2double GetLoad_Value(string val_index) const; + su2double GetLoad_Value(const string& val_index) const; /*! * \brief Get the constant value at a damper boundary. * \param[in] val_index - Index corresponding to the load boundary. * \return The damper constant. */ - su2double GetDamper_Constant(string val_index) const; + su2double GetDamper_Constant(const string& val_index) const; /*! * \brief Get the force value at a load boundary defined in cartesian coordinates. * \param[in] val_index - Index corresponding to the load boundary. * \return The load value. */ - su2double GetLoad_Dir_Value(string val_index) const; + su2double GetLoad_Dir_Value(const string& val_index) const; /*! * \brief Get the force multiplier at a load boundary in cartesian coordinates. * \param[in] val_index - Index corresponding to the load boundary. * \return The load multiplier. */ - su2double GetLoad_Dir_Multiplier(string val_index) const; + su2double GetLoad_Dir_Multiplier(const string& val_index) const; /*! * \brief Get the force value at a load boundary defined in cartesian coordinates. * \param[in] val_index - Index corresponding to the load boundary. * \return The load value. */ - su2double GetDisp_Dir_Value(string val_index) const; + su2double GetDisp_Dir_Value(const string& val_index) const; /*! * \brief Get the force multiplier at a load boundary in cartesian coordinates. * \param[in] val_index - Index corresponding to the load boundary. * \return The load multiplier. */ - su2double GetDisp_Dir_Multiplier(string val_index) const; + su2double GetDisp_Dir_Multiplier(const string& val_index) const; /*! * \brief Get the force direction at a loaded boundary in cartesian coordinates. * \param[in] val_index - Index corresponding to the load boundary. * \return The load direction. */ - const su2double* GetLoad_Dir(string val_index) const; + const su2double* GetLoad_Dir(const string& val_index) const; /*! * \brief Get the force direction at a loaded boundary in cartesian coordinates. * \param[in] val_index - Index corresponding to the load boundary. * \return The load direction. */ - const su2double* GetDisp_Dir(string val_index) const; + const su2double* GetDisp_Dir(const string& val_index) const; /*! * \brief Get the amplitude of the sine-wave at a load boundary defined in cartesian coordinates. * \param[in] val_index - Index corresponding to the load boundary. * \return The load value. */ - su2double GetLoad_Sine_Amplitude(string val_index) const; + su2double GetLoad_Sine_Amplitude(const string& val_index) const; /*! * \brief Get the frequency of the sine-wave at a load boundary in cartesian coordinates. * \param[in] val_index - Index corresponding to the load boundary. * \return The load frequency. */ - su2double GetLoad_Sine_Frequency(string val_index) const; + su2double GetLoad_Sine_Frequency(const string& val_index) const; /*! * \brief Get the force direction at a sine-wave loaded boundary in cartesian coordinates. * \param[in] val_index - Index corresponding to the load boundary. * \return The load direction. */ - const su2double* GetLoad_Sine_Dir(string val_index) const; + const su2double* GetLoad_Sine_Dir(const string& val_index) const; /*! * \brief Get the force value at an load boundary. * \param[in] val_index - Index corresponding to the load boundary. * \return The load value. */ - su2double GetFlowLoad_Value(string val_index) const; + su2double GetFlowLoad_Value(const string& val_index) const; /*! * \brief Cyclic pitch amplitude for rotor blades. @@ -8604,7 +8732,7 @@ class CConfig { * \param[in] val_function_name - string for the name of the profiled subroutine. * \param[in] val_group_id - string for the name of the profiled subroutine. */ - void Tock(double val_start_time, string val_function_name, int val_group_id); + void Tock(double val_start_time, const string& val_function_name, int val_group_id); /*! * \brief Write a CSV file containing the results of the profiling. @@ -8657,7 +8785,6 @@ class CConfig { unsigned short GetKind_Average(void) const { return Kind_Average; } /*! - * * \brief Get the direct differentation method. * \return direct differentiation method. */ @@ -8711,34 +8838,6 @@ class CConfig { */ bool GetSteadyRestart(void) const { return SteadyRestart; } - /*! - * \brief Provides information about the time integration of the structural analysis, and change the write in the output - * files information about the iteration. - * \return The kind of time integration: Static or dynamic analysis - */ - unsigned short GetDynamic_Analysis(void) const { return Dynamic_Analysis; } - - /*! - * \brief If we are prforming an unsteady simulation, there is only - * one value of the time step for the complete simulation. - * \return Value of the time step in an unsteady simulation (non dimensional). - */ - su2double GetDelta_DynTime(void) const { return Delta_DynTime; } - - /*! - * \brief If we are prforming an unsteady simulation, there is only - * one value of the time step for the complete simulation. - * \return Value of the time step in an unsteady simulation (non dimensional). - */ - su2double GetTotal_DynTime(void) const { return Total_DynTime; } - - /*! - * \brief If we are prforming an unsteady simulation, there is only - * one value of the time step for the complete simulation. - * \return Value of the time step in an unsteady simulation (non dimensional). - */ - su2double GetCurrent_DynTime(void) const { return Current_DynTime; } - /*! * \brief Get the current instance. * \return Current instance identifier. @@ -8770,22 +8869,10 @@ class CConfig { unsigned short GetnIntCoeffs(void) const { return nIntCoeffs; } /*! - * \brief Get the number of different values for the elasticity modulus. - * \return Number of different values for the elasticity modulus. - */ - unsigned short GetnElasticityMod(void) const { return nElasticityMod; } - - /*! - * \brief Get the number of different values for the Poisson ratio. - * \return Number of different values for the Poisson ratio. + * \brief Get the number of different materials for the elasticity solver. + * \return Number of different materials. */ - unsigned short GetnPoissonRatio(void) const { return nPoissonRatio; } - - /*! - * \brief Get the number of different values for the Material density. - * \return Number of different values for the Material density. - */ - unsigned short GetnMaterialDensity(void) const { return nMaterialDensity; } + unsigned short GetnElasticityMat(void) const { return nElasticityMod; } /*! * \brief Get the integration coefficients for the Generalized Alpha - Newmark integration integration scheme. @@ -9271,12 +9358,6 @@ class CConfig { */ void SetnTime_Iter(unsigned long val_iter) { nTimeIter = val_iter; } - /*! - * \brief Get the number of pseudo-time iterations - * \return Number of pseudo-time steps run for the single-zone problem - */ - unsigned long GetnIter(void) const { return nIter; } - /*! * \brief Get the restart iteration * \return Iteration for the restart of multizone problems @@ -9313,12 +9394,6 @@ class CConfig { */ bool GetMultizone_Residual(void) const { return Multizone_Residual; } - /*! - * \brief Check if the (new) single-zone driver is to be used (temporary) - * \return YES if the (new) single-zone driver is to be used. - */ - bool GetSinglezone_Driver(void) const { return SinglezoneDriver; } - /*! * \brief Get the Kind of Radiation model applied. * \return Kind of radiation model used. @@ -9348,7 +9423,14 @@ class CConfig { * \param[in] val_index - Index corresponding to the boundary. * \return The wall emissivity. */ - su2double GetWall_Emissivity(string val_index) const; + su2double GetWall_Emissivity(const string& val_index) const; + + /*! + * \brief Get if boundary is strong or weak. + * \param[in] val_index - Index corresponding to the boundary. + * \return true if strong BC. + */ + bool GetMarker_StrongBC(const string& val_index) const; /*! * \brief Get the value of the CFL condition for radiation solvers. diff --git a/Common/include/adt/CADTBaseClass.hpp b/Common/include/adt/CADTBaseClass.hpp index e1c95a5cc42..996a11a8edf 100644 --- a/Common/include/adt/CADTBaseClass.hpp +++ b/Common/include/adt/CADTBaseClass.hpp @@ -2,7 +2,7 @@ * \file CADTBaseClass.hpp * \brief Base class for storing an ADT in an arbitrary number of dimensions. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -43,10 +43,10 @@ using namespace std; * \author E. van der Weide */ class CADTBaseClass { -protected: - unsigned long nLeaves; /*!< \brief Number of leaves in the ADT. */ - unsigned short nDimADT; /*!< \brief Number of dimensions of the ADT. */ - bool isEmpty; /*!< \brief Whether or not the ADT is empty. */ + protected: + unsigned long nLeaves; /*!< \brief Number of leaves in the ADT. */ + unsigned short nDimADT; /*!< \brief Number of dimensions of the ADT. */ + bool isEmpty; /*!< \brief Whether or not the ADT is empty. */ vector leaves; /*!< \brief Vector, which contains all the leaves of the ADT. */ @@ -54,23 +54,23 @@ class CADTBaseClass { vector > FrontLeaves; /*!< \brief Vector used in the tree traversal. */ vector > FrontLeavesNew; /*!< \brief Vector used in the tree traversal. */ #else - array,1> FrontLeaves; - array,1> FrontLeavesNew; + array, 1> FrontLeaves; + array, 1> FrontLeavesNew; #endif -private: + private: vector coorMinLeaves; /*!< \brief Vector, which contains all the minimum coordinates of the leaves. */ vector coorMaxLeaves; /*!< \brief Vector, which contains all the maximum coordinates of the leaves. */ -protected: + protected: /*! * \brief Constructor of the class. Nothing to be done. */ CADTBaseClass() = default; /*--- Disable copy operations ---*/ - CADTBaseClass(const CADTBaseClass &) = delete; - CADTBaseClass& operator=(const CADTBaseClass &) = delete; + CADTBaseClass(const CADTBaseClass&) = delete; + CADTBaseClass& operator=(const CADTBaseClass&) = delete; /*! * \brief Function, which builds the ADT of the given coordinates. @@ -78,16 +78,12 @@ class CADTBaseClass { * \param[in] nPoints Number of points present in the ADT. * \param[in] coor Coordinates of the points. */ - void BuildADT(unsigned short nDim, - unsigned long nPoints, - const su2double *coor); - -public: + void BuildADT(unsigned short nDim, unsigned long nPoints, const su2double* coor); + public: /*! * \brief Function, which returns whether or not the ADT is empty. * \return Whether or not the ADT is empty. */ - inline bool IsEmpty(void) const { return isEmpty;} - + inline bool IsEmpty(void) const { return isEmpty; } }; diff --git a/Common/include/adt/CADTComparePointClass.hpp b/Common/include/adt/CADTComparePointClass.hpp index 542ab2612bc..ca6655f40f5 100644 --- a/Common/include/adt/CADTComparePointClass.hpp +++ b/Common/include/adt/CADTComparePointClass.hpp @@ -2,7 +2,7 @@ * \file CADTComparePointClass.hpp * \brief subroutines for comparing two points in an alternating digital tree (ADT). * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -35,35 +35,32 @@ * \author E. van der Weide */ class CADTComparePointClass { -private: - const su2double *pointCoor; /*!< \brief Pointer to the coordinates of the points. */ - const unsigned short splitDirection; /*!< \brief Split direction used in the sorting. */ - const unsigned short nDim; /*!< \brief Number of spatial dimensions stored in the coordinates. */ + private: + const su2double* pointCoor; /*!< \brief Pointer to the coordinates of the points. */ + const unsigned short splitDirection; /*!< \brief Split direction used in the sorting. */ + const unsigned short nDim; /*!< \brief Number of spatial dimensions stored in the coordinates. */ -public: + public: /*! * \brief Constructor of the class. The member variables are initialized. * \param[in] coor Pointer to the coordinates of the points. * \param[in] splitDir Direction that must be used to sort the coordinates. * \param[in] nDimADT Number of spatial dimensions of the ADT and coordinates. */ - CADTComparePointClass(const su2double *coor, - const unsigned short splitDir, - const unsigned short nDimADT) : pointCoor(coor), splitDirection(splitDir), nDim(nDimADT) {} + CADTComparePointClass(const su2double* coor, const unsigned short splitDir, const unsigned short nDimADT) + : pointCoor(coor), splitDirection(splitDir), nDim(nDimADT) {} /*! * \brief Operator used for the sorting of the points. * \param[in] p0 Index of the first point to be compared. * \param[in] p1 Index of the second point to be compared. */ - inline bool operator()(const unsigned long p0, - const unsigned long p1) const { - return pointCoor[nDim*p0+splitDirection] < pointCoor[nDim*p1+splitDirection]; + inline bool operator()(const unsigned long p0, const unsigned long p1) const { + return pointCoor[nDim * p0 + splitDirection] < pointCoor[nDim * p1 + splitDirection]; } /*! * \brief Default constructor of the class, disabled. */ CADTComparePointClass() = delete; - }; diff --git a/Common/include/adt/CADTElemClass.hpp b/Common/include/adt/CADTElemClass.hpp index 1537385ca51..2f8855aeb68 100644 --- a/Common/include/adt/CADTElemClass.hpp +++ b/Common/include/adt/CADTElemClass.hpp @@ -2,7 +2,7 @@ * \file CADTElemClass.hpp * \brief Class for storing an ADT of (linear) elements in an arbitrary number of dimensions. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -36,16 +36,16 @@ * \ingroup ADT * \brief Class for storing an ADT of (linear) elements in an arbitrary number of dimensions. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CADTElemClass : public CADTBaseClass { -private: + private: unsigned short nDim; /*!< \brief Number of spatial dimensions. */ - vector coorPoints; /*!< \brief Vector, which contains the coordinates - of the points in the ADT. */ - vector BBoxCoor; /*!< \brief Vector, which contains the coordinates - of the bounding boxes of the elements. */ + vector coorPoints; /*!< \brief Vector, which contains the coordinates + of the points in the ADT. */ + vector BBoxCoor; /*!< \brief Vector, which contains the coordinates + of the bounding boxes of the elements. */ vector elemVTK_Type; /*!< \brief Vector, which the type of the elements using the VTK convention. */ @@ -58,15 +58,15 @@ class CADTElemClass : public CADTBaseClass { of the elements in the ADT. */ vector localElemIDs; /*!< \brief Vector, which contains the local element ID's of the elements in the ADT. */ - vector ranksOfElems; /*!< \brief Vector, which contains the ranks + vector ranksOfElems; /*!< \brief Vector, which contains the ranks of the elements in the ADT. */ #ifdef HAVE_OMP - vector >BBoxTargets; /*!< \brief Vector, used to store possible bounding box - candidates during the nearest element search. */ + vector > BBoxTargets; /*!< \brief Vector, used to store possible bounding box + candidates during the nearest element search. */ #else - array,1> BBoxTargets; + array, 1> BBoxTargets; #endif -public: + public: /*! * \brief Constructor of the class. * \param[in] val_nDim Number of spatial dimensions of the problem. @@ -80,13 +80,9 @@ class CADTElemClass : public CADTBaseClass { * \param[in] globalTree Whether or not a global tree must be built. If false a local ADT is built. */ - CADTElemClass(unsigned short val_nDim, - vector &val_coor, - vector &val_connElem, - vector &val_VTKElem, - vector &val_markerID, - vector &val_elemID, - const bool globalTree); + CADTElemClass(unsigned short val_nDim, vector& val_coor, vector& val_connElem, + vector& val_VTKElem, vector& val_markerID, + vector& val_elemID, const bool globalTree); /*! * \brief Function, which determines the element that contains the given coordinate. @@ -102,15 +98,11 @@ class CADTElemClass : public CADTBaseClass { which contains the coordinate. * \return True if an element is found, false if not. */ - inline bool DetermineContainingElement(const su2double *coor, - unsigned short &markerID, - unsigned long &elemID, - int &rankID, - su2double *parCoor, - su2double *weightsInterpol) { + inline bool DetermineContainingElement(const su2double* coor, unsigned short& markerID, unsigned long& elemID, + int& rankID, su2double* parCoor, su2double* weightsInterpol) { const auto iThread = omp_get_thread_num(); - return DetermineContainingElement_impl(FrontLeaves[iThread], FrontLeavesNew[iThread], - coor, markerID, elemID, rankID, parCoor, weightsInterpol); + return DetermineContainingElement_impl(FrontLeaves[iThread], FrontLeavesNew[iThread], coor, markerID, elemID, + rankID, parCoor, weightsInterpol); } /*! @@ -123,42 +115,29 @@ class CADTElemClass : public CADTBaseClass { * \param[out] elemID Local element ID of the nearest element in the ADT. * \param[out] rankID Rank on which the nearest element in the ADT is stored. */ - inline void DetermineNearestElement(const su2double *coor, - su2double &dist, - unsigned short &markerID, - unsigned long &elemID, - int &rankID) { + inline void DetermineNearestElement(const su2double* coor, su2double& dist, unsigned short& markerID, + unsigned long& elemID, int& rankID) { const auto iThread = omp_get_thread_num(); - DetermineNearestElement_impl(BBoxTargets[iThread], FrontLeaves[iThread], - FrontLeavesNew[iThread], coor, dist, markerID, elemID, rankID); + DetermineNearestElement_impl(BBoxTargets[iThread], FrontLeaves[iThread], FrontLeavesNew[iThread], coor, dist, + markerID, elemID, rankID); } -private: + private: /*! * \brief Implementation of DetermineContainingElement. * \note Working variables (first two) passed explicitly for thread safety. */ - bool DetermineContainingElement_impl(vector& frontLeaves, - vector& frontLeavesNew, - const su2double *coor, - unsigned short &markerID, - unsigned long &elemID, - int &rankID, - su2double *parCoor, - su2double *weightsInterpol) const; + bool DetermineContainingElement_impl(vector& frontLeaves, vector& frontLeavesNew, + const su2double* coor, unsigned short& markerID, unsigned long& elemID, + int& rankID, su2double* parCoor, su2double* weightsInterpol) const; /*! * \brief Implementation of DetermineNearestElement. * \note Working variables (first three) passed explicitly for thread safety. */ - void DetermineNearestElement_impl(vector& BBoxTargets, - vector& frontLeaves, - vector& frontLeavesNew, - const su2double *coor, - su2double &dist, - unsigned short &markerID, - unsigned long &elemID, - int &rankID) const; + void DetermineNearestElement_impl(vector& BBoxTargets, vector& frontLeaves, + vector& frontLeavesNew, const su2double* coor, su2double& dist, + unsigned short& markerID, unsigned long& elemID, int& rankID) const; /*! * \brief Function, which checks whether or not the given coordinate is @@ -172,10 +151,8 @@ class CADTElemClass : public CADTBaseClass { given element. * \return True if coor is inside the element and false otherwise. */ - bool CoorInElement(const unsigned long elemID, - const su2double *coor, - su2double *parCoor, - su2double *weightsInterpol) const; + bool CoorInElement(const unsigned long elemID, const su2double* coor, su2double* parCoor, + su2double* weightsInterpol) const; /*! * \brief Function, which checks whether or not the given coordinate is @@ -189,10 +166,8 @@ class CADTElemClass : public CADTBaseClass { given quadrilateral. * \return True if coor is inside the quadrilateral and false otherwise. */ - bool CoorInQuadrilateral(const unsigned long elemID, - const su2double *coor, - su2double *parCoor, - su2double *weightsInterpol) const; + bool CoorInQuadrilateral(const unsigned long elemID, const su2double* coor, su2double* parCoor, + su2double* weightsInterpol) const; /*! * \brief Function, which checks whether or not the given coordinate is @@ -206,10 +181,8 @@ class CADTElemClass : public CADTBaseClass { given triangle. * \return True if coor is inside the triangle and false otherwise. */ - bool CoorInTriangle(const unsigned long elemID, - const su2double *coor, - su2double *parCoor, - su2double *weightsInterpol) const; + bool CoorInTriangle(const unsigned long elemID, const su2double* coor, su2double* parCoor, + su2double* weightsInterpol) const; /*! * \brief Function, which checks whether or not the given coordinate is @@ -223,10 +196,8 @@ class CADTElemClass : public CADTBaseClass { given hexahedron. * \return True if coor is inside the hexahedron and false otherwise. */ - bool CoorInHexahedron(const unsigned long elemID, - const su2double *coor, - su2double *parCoor, - su2double *weightsInterpol) const; + bool CoorInHexahedron(const unsigned long elemID, const su2double* coor, su2double* parCoor, + su2double* weightsInterpol) const; /*! * \brief Function, which checks whether or not the given coordinate is @@ -240,10 +211,8 @@ class CADTElemClass : public CADTBaseClass { given prism. * \return True if coor is inside the prism and false otherwise. */ - bool CoorInPrism(const unsigned long elemID, - const su2double *coor, - su2double *parCoor, - su2double *weightsInterpol) const; + bool CoorInPrism(const unsigned long elemID, const su2double* coor, su2double* parCoor, + su2double* weightsInterpol) const; /*! * \brief Function, which checks whether or not the given coordinate is @@ -257,10 +226,8 @@ class CADTElemClass : public CADTBaseClass { given pyramid. * \return True if coor is inside the pyramid and false otherwise. */ - bool CoorInPyramid(const unsigned long elemID, - const su2double *coor, - su2double *parCoor, - su2double *weightsInterpol) const; + bool CoorInPyramid(const unsigned long elemID, const su2double* coor, su2double* parCoor, + su2double* weightsInterpol) const; /*! * \brief Function, which checks whether or not the given coordinate is @@ -274,10 +241,8 @@ class CADTElemClass : public CADTBaseClass { given tetrahedron. * \return True if coor is inside the tetrahedron and false otherwise. */ - bool CoorInTetrahedron(const unsigned long elemID, - const su2double *coor, - su2double *parCoor, - su2double *weightsInterpol) const; + bool CoorInTetrahedron(const unsigned long elemID, const su2double* coor, su2double* parCoor, + su2double* weightsInterpol) const; /*! * \brief Function, which provides an initial guess for the parametric coordinates @@ -290,9 +255,8 @@ class CADTElemClass : public CADTBaseClass { * \return True if the initial guess is within the hexahedron and false otherwise. */ - bool InitialGuessContainmentHexahedron(const su2double xRelC[3], - const su2double xRel[8][3], - su2double *parCoor) const; + bool InitialGuessContainmentHexahedron(const su2double xRelC[3], const su2double xRel[8][3], + su2double* parCoor) const; /*! * \brief Function, which provides an initial guess for the parametric coordinates @@ -305,9 +269,7 @@ class CADTElemClass : public CADTBaseClass { * \return True if the initial guess is within the prism and false otherwise. */ - bool InitialGuessContainmentPrism(const su2double xRelC[3], - const su2double xRel[6][3], - su2double *parCoor) const; + bool InitialGuessContainmentPrism(const su2double xRelC[3], const su2double xRel[6][3], su2double* parCoor) const; /*! * \brief Function, which provides an initial guess for the parametric coordinates @@ -320,9 +282,7 @@ class CADTElemClass : public CADTBaseClass { * \return True if the initial guess is within the pyramid and false otherwise. */ - bool InitialGuessContainmentPyramid(const su2double xRelC[3], - const su2double xRel[5][3], - su2double *parCoor) const; + bool InitialGuessContainmentPyramid(const su2double xRelC[3], const su2double xRel[5][3], su2double* parCoor) const; /*! * \brief Function, which computes the distance squared of the given coordinate @@ -331,9 +291,7 @@ class CADTElemClass : public CADTBaseClass { * \param[in] coor Coordinate for which the distance to the element must be determined. * \param[out] dist2Elem Distance squared from the coordinate to the element. */ - void Dist2ToElement(const unsigned long elemID, - const su2double *coor, - su2double &dist2Elem) const; + void Dist2ToElement(const unsigned long elemID, const su2double* coor, su2double& dist2Elem) const; /*! * \brief Function, which computes the distance squared of the given coordinate to a linear line element. @@ -344,10 +302,7 @@ class CADTElemClass : public CADTBaseClass { * \param[in] coor Coordinate for which the distance to the line must be determined. * \param[out] dist2Line Distance squared from the coordinate to the line. */ - void Dist2ToLine(const unsigned long i0, - const unsigned long i1, - const su2double *coor, - su2double &dist2Line) const; + void Dist2ToLine(const unsigned long i0, const unsigned long i1, const su2double* coor, su2double& dist2Line) const; /*! * \brief Function, which computes the distance squared of the given coordinate to a linear quadrilateral element if the projection is inside the quad. @@ -366,14 +321,9 @@ class CADTElemClass : public CADTBaseClass { * \param[out] dist2Quad Distance squared from the coordinate to the quadrilateral. * \return True if the projection is inside the quadrilateral and false otherwise. */ - bool Dist2ToQuadrilateral(const unsigned long i0, - const unsigned long i1, - const unsigned long i2, - const unsigned long i3, - const su2double *coor, - su2double &r, - su2double &s, - su2double &dist2Quad) const; + bool Dist2ToQuadrilateral(const unsigned long i0, const unsigned long i1, const unsigned long i2, + const unsigned long i3, const su2double* coor, su2double& r, su2double& s, + su2double& dist2Quad) const; /*! * \brief Function, which computes the distance squared of the given coordinate to a linear triangular element if the projection is inside the triangle. @@ -389,16 +339,10 @@ class CADTElemClass : public CADTBaseClass { * \param[out] s Parametric coordinate of the projection. * \return True if the projection is inside the triangle and false otherwise. */ - bool Dist2ToTriangle(const unsigned long i0, - const unsigned long i1, - const unsigned long i2, - const su2double *coor, - su2double &dist2Tria, - su2double &r, - su2double &s) const; + bool Dist2ToTriangle(const unsigned long i0, const unsigned long i1, const unsigned long i2, const su2double* coor, + su2double& dist2Tria, su2double& r, su2double& s) const; /*! * \brief Default constructor of the class, disabled. */ CADTElemClass() = delete; - }; diff --git a/Common/include/adt/CADTNodeClass.hpp b/Common/include/adt/CADTNodeClass.hpp index d6f1a30bcf2..c09dda7799d 100644 --- a/Common/include/adt/CADTNodeClass.hpp +++ b/Common/include/adt/CADTNodeClass.hpp @@ -2,7 +2,7 @@ * \file CADTNodeClass.hpp * \brief Class for storing the information needed in a node of an ADT. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -35,15 +35,14 @@ * \author E. van der Weide */ struct CADTNodeClass { + bool childrenAreTerminal[2]; /*!< \brief Whether or not the child leaves are terminal. */ + unsigned long children[2]; /*!< \brief Child leaves. If childrenAreTerminal is true the children + contain the point ID's or bounding box ID's. Note that it + is allowed that one child is termimal and the other is not. */ + unsigned long centralNodeID; /*!< \brief ID of a node, which is near the center of the leaf. */ - bool childrenAreTerminal[2]; /*!< \brief Whether or not the child leaves are terminal. */ - unsigned long children[2]; /*!< \brief Child leaves. If childrenAreTerminal is true the children - contain the point ID's or bounding box ID's. Note that it - is allowed that one child is termimal and the other is not. */ - unsigned long centralNodeID; /*!< \brief ID of a node, which is near the center of the leaf. */ - - su2double *xMin; /*!< \brief The minimum coordinates of this leaf. It points to a position in the large - vector, which contains the coordinates of all leaves. */ - su2double *xMax; /*!< \brief The maximum coordinates of this leaf. It points to a position in the large - vector, which contains the coordinates of all leaves. */ + su2double* xMin; /*!< \brief The minimum coordinates of this leaf. It points to a position in the large + vector, which contains the coordinates of all leaves. */ + su2double* xMax; /*!< \brief The maximum coordinates of this leaf. It points to a position in the large + vector, which contains the coordinates of all leaves. */ }; diff --git a/Common/include/adt/CADTPointsOnlyClass.hpp b/Common/include/adt/CADTPointsOnlyClass.hpp index 68f7d3c26ed..721c09398b1 100644 --- a/Common/include/adt/CADTPointsOnlyClass.hpp +++ b/Common/include/adt/CADTPointsOnlyClass.hpp @@ -2,7 +2,7 @@ * \file CADTPointsOnlyClass.hpp * \brief Class for storing an ADT of only points in an arbitrary number of dimensions. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -35,14 +35,14 @@ * \author E. van der Weide */ class CADTPointsOnlyClass : public CADTBaseClass { -private: - vector coorPoints; /*!< \brief Vector, which contains the coordinates + private: + vector coorPoints; /*!< \brief Vector, which contains the coordinates of the points in the ADT. */ vector localPointIDs; /*!< \brief Vector, which contains the local point ID's of the points in the ADT. */ - vector ranksOfPoints; /*!< \brief Vector, which contains the ranks + vector ranksOfPoints; /*!< \brief Vector, which contains the ranks of the points in the ADT. */ -public: + public: /*! * \brief Constructor of the class. * \param[in] nDim Number of spatial dimensions of the problem. @@ -52,11 +52,8 @@ class CADTPointsOnlyClass : public CADTBaseClass { * \param[in] globalTree Whether or not a global tree must be built. If false a local ADT is built. */ - CADTPointsOnlyClass(unsigned short nDim, - unsigned long nPoints, - const su2double *coor, - const unsigned long *pointID, - const bool globalTree); + CADTPointsOnlyClass(unsigned short nDim, unsigned long nPoints, const su2double* coor, const unsigned long* pointID, + const bool globalTree); /*! * \brief Function, which determines the nearest node in the ADT for the given coordinate. @@ -67,13 +64,9 @@ class CADTPointsOnlyClass : public CADTBaseClass { * \param[out] pointID Local point ID of the nearest node in the ADT. * \param[out] rankID Rank on which the nearest node in the ADT is stored. */ - inline void DetermineNearestNode(const su2double *coor, - su2double &dist, - unsigned long &pointID, - int &rankID) { + inline void DetermineNearestNode(const su2double* coor, su2double& dist, unsigned long& pointID, int& rankID) { const auto iThread = omp_get_thread_num(); - DetermineNearestNode_impl(FrontLeaves[iThread], FrontLeavesNew[iThread], - coor, dist, pointID, rankID); + DetermineNearestNode_impl(FrontLeaves[iThread], FrontLeavesNew[iThread], coor, dist, pointID, rankID); } /*! @@ -81,15 +74,11 @@ class CADTPointsOnlyClass : public CADTBaseClass { */ CADTPointsOnlyClass() = delete; -private: + private: /*! * \brief Implementation of DetermineNearestNode. * \note Working variables (first two) passed explicitly for thread safety. */ - void DetermineNearestNode_impl(vector& frontLeaves, - vector& frontLeavesNew, - const su2double *coor, - su2double &dist, - unsigned long &pointID, - int &rankID) const; + void DetermineNearestNode_impl(vector& frontLeaves, vector& frontLeavesNew, + const su2double* coor, su2double& dist, unsigned long& pointID, int& rankID) const; }; diff --git a/Common/include/adt/CBBoxTargetClass.hpp b/Common/include/adt/CBBoxTargetClass.hpp index 1a7cf37d132..3ff32c169a2 100644 --- a/Common/include/adt/CBBoxTargetClass.hpp +++ b/Common/include/adt/CBBoxTargetClass.hpp @@ -3,7 +3,7 @@ * \brief Class for storing the information of a possible bounding box candidate during a minimum distance search. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -35,15 +35,14 @@ * \brief Class for storing the information of a possible bounding box candidate during a minimum distance search. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ struct CBBoxTargetClass { - - unsigned long boundingBoxID; /*!< \brief Corresponding bounding box ID. */ - su2double possibleMinDist2; /*!< \brief Possible minimimum distance squared to the - given coordinate. */ - su2double guaranteedMinDist2; /*!< \brief Guaranteed minimum distance squared to the - given coordinate. */ + unsigned long boundingBoxID; /*!< \brief Corresponding bounding box ID. */ + su2double possibleMinDist2; /*!< \brief Possible minimimum distance squared to the + given coordinate. */ + su2double guaranteedMinDist2; /*!< \brief Guaranteed minimum distance squared to the + given coordinate. */ /*! * \brief Constructor of the class. Nothing to be done. @@ -58,27 +57,21 @@ struct CBBoxTargetClass { * \param[in] val_guarDist2 - Guaranteed minimum distance squared to the target for this bounding box. */ - inline CBBoxTargetClass(const unsigned long val_BBoxID, - const su2double val_posDist2, - const su2double val_guarDist2) - : boundingBoxID(val_BBoxID), - possibleMinDist2(val_posDist2), - guaranteedMinDist2(val_guarDist2) {} + inline CBBoxTargetClass(const unsigned long val_BBoxID, const su2double val_posDist2, const su2double val_guarDist2) + : boundingBoxID(val_BBoxID), possibleMinDist2(val_posDist2), guaranteedMinDist2(val_guarDist2) {} /*! * \brief Less than operator. Needed for the sorting of the candidates. * \param[in] other Object to which the current object must be compared. */ - inline bool operator <(const CBBoxTargetClass &other) const{ - + inline bool operator<(const CBBoxTargetClass& other) const { /* Make sure that the bounding boxes with the smallest possible distances are stored first. */ - if(possibleMinDist2 < other.possibleMinDist2) return true; - if(possibleMinDist2 > other.possibleMinDist2) return false; - if(guaranteedMinDist2 < other.guaranteedMinDist2) return true; - if(guaranteedMinDist2 > other.guaranteedMinDist2) return false; - if(boundingBoxID < other.boundingBoxID) return true; + if (possibleMinDist2 < other.possibleMinDist2) return true; + if (possibleMinDist2 > other.possibleMinDist2) return false; + if (guaranteedMinDist2 < other.guaranteedMinDist2) return true; + if (guaranteedMinDist2 > other.guaranteedMinDist2) return false; + if (boundingBoxID < other.boundingBoxID) return true; return false; } - }; diff --git a/Common/include/basic_types/ad_structure.hpp b/Common/include/basic_types/ad_structure.hpp index 773c2526fd7..8cf72344258 100644 --- a/Common/include/basic_types/ad_structure.hpp +++ b/Common/include/basic_types/ad_structure.hpp @@ -2,7 +2,7 @@ * \file ad_structure.hpp * \brief Main routines for the algorithmic differentiation (AD) structure. * \author T. Albring, J. Blühdorn - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -36,555 +36,553 @@ * In case there is no reverse type configured, they have no effect at all, * and so the real versions of the routined are after #else. */ -namespace AD{ +namespace AD { #ifndef CODI_REVERSE_TYPE - /*! - * \brief Start the recording of the operations and involved variables. - * If called, the computational graph of all operations occuring after the call will be stored, - * starting with the variables registered with RegisterInput. - */ - inline void StartRecording() {} - - /*! - * \brief Stops the recording of the operations and variables. - */ - inline void StopRecording() {} - - /*! - * \brief Check if the tape is active - * \param[out] Boolean which determines whether the tape is active. - */ - inline bool TapeActive() {return false;} - - /*! - * \brief Prints out tape statistics. - */ - inline void PrintStatistics() {} - - /*! - * \brief Registers the variable as an input and saves internal data (indices). I.e. as a leaf of the computational graph. - * \param[in] data - The variable to be registered as input. - * \param[in] push_index - boolean whether we also want to push the index. - */ - inline void RegisterInput(su2double &data, bool push_index = true) {} - - /*! - * \brief Registers the variable as an output. I.e. as the root of the computational graph. - * \param[in] data - The variable to be registered as output. - */ - inline void RegisterOutput(su2double &data) {} - - /*! - * \brief Sets the adjoint value at index to val - * \param[in] index - Position in the adjoint vector. - * \param[in] val - adjoint value to be set. - */ - inline void SetDerivative(int index, const double val) {} - - /*! - * \brief Extracts the adjoint value at index - * \param[in] index - position in the adjoint vector where the derivative will be extracted. - * \return Derivative value. - */ - inline double GetDerivative(int index) {return 0.0;} - - /*! - * \brief Clears the currently stored adjoints but keeps the computational graph. - */ - inline void ClearAdjoints() {} - - /*! - * \brief Computes the adjoints, i.e. the derivatives of the output with respect to the input variables. - */ - inline void ComputeAdjoint() {} - - /*! - * \brief Computes the adjoints, i.e. the derivatives of the output with respect to the input variables. - * \param[in] enter - Position where we start evaluating the tape. - * \param[in] leave - Position where we stop evaluating the tape. - */ - inline void ComputeAdjoint(unsigned short enter, unsigned short leave) {} - - /*! - * \brief Computes the adjoints, i.e., the derivatives of the output with respect to the input variables, using forward tape evaluation. - */ - inline void ComputeAdjointForward() {} - - /*! - * \brief Reset the tape structure to be ready for a new recording. - */ - inline void Reset() {} - - /*! - * \brief Reset the variable (set index to zero). - * \param[in] data - the variable to be unregistered from the tape. - */ - inline void ResetInput(su2double &data) {} - - /*! - * \brief Sets the scalar inputs of a preaccumulation section. - * \param[in] data - the scalar input variables. - */ - template - inline void SetPreaccIn(Ts&&... data) {} - - /*! - * \brief Sets the input variables of a preaccumulation section using a 1D array. - * \param[in] data - the input 1D array. - * \param[in] size - size of the array. - */ - template - inline void SetPreaccIn(const T& data, const int size) {} - - /*! - * \brief Sets the input variables of a preaccumulation section using a 2D array. - * \param[in] data - the input 2D array. - * \param[in] size_x - size of the array in x dimension. - * \param[in] size_y - size of the array in y dimension. - */ - template - inline void SetPreaccIn(const T& data, const int size_x, const int size_y) {} - - /*! - * \brief Starts a new preaccumulation section and sets the input variables. - * - * The idea of preaccumulation is to store only the Jacobi matrix of a code section during - * the taping process instead of all operations. This decreases the tape size and reduces runtime. - * - * Input/Output of the section are set with several calls to SetPreaccIn()/SetPreaccOut(). - * - * Note: the call of this routine must be followed by a call of EndPreacc() and the end of the code section. - */ - inline void StartPreacc() {} - - /*! - * \brief Sets the scalar outputs of a preaccumulation section. - * \param[in] data - the scalar output variables. - */ - template - inline void SetPreaccOut(Ts&&... data) {} - - /*! - * \brief Sets the output variables of a preaccumulation section using a 1D array. - * \param[in] data - the output 1D array. - */ - template - inline void SetPreaccOut(T&& data, const int size) {} - - /*! - * \brief Sets the input variables of a preaccumulation section using a 2D array. - * \param[in] data - the output 1D array. - */ - template - inline void SetPreaccOut(T&& data, const int size_x, const int size_y) {} - - /*! - * \brief Ends a preaccumulation section and computes the local Jacobi matrix - * of a code section using the variables set with SetLocalInput(), SetLocalOutput() and pushes a statement - * for each output variable to the AD tape. - */ - inline void EndPreacc() {} - - /*! - * \brief Initializes an externally differentiated function. Input and output variables are set with SetExtFuncIn/SetExtFuncOut - * \param[in] storePrimalInput - Specifies whether the primal input values are stored for the reverse call of the external function. - * \param[in] storePrimalOutput - Specifies whether the primal output values are stored for the reverse call of the external function. - */ - inline void StartExtFunc(bool storePrimalInput, bool storePrimalOutput) {} - - /*! - * \brief Sets the scalar input of a externally differentiated function. - * \param[in] data - the scalar input variable. - */ - inline void SetExtFuncIn(su2double &data) {} - - /*! - * \brief Sets the input variables of a externally differentiated function using a 1D array. - * \param[in] data - the input 1D array. - * \param[in] size - number of rows. - */ - template - inline void SetExtFuncIn(const T& data, const int size) {} - - /*! - * \brief Sets the input variables of a externally differentiated function using a 2D array. - * \param[in] data - the input 2D array. - * \param[in] size_x - number of rows. - * \param[in] size_y - number of columns. - */ - template - inline void SetExtFuncIn(const T& data, const int size_x, const int size_y) {} - - /*! - * \brief Sets the scalar output of a externally differentiated function. - * \param[in] data - the scalar output variable. - */ - inline void SetExtFuncOut(su2double &data) {} - - /*! - * \brief Sets the output variables of a externally differentiated function using a 1D array. - * \param[in] data - the output 1D array. - * \param[in] size - number of rows. - */ - template - inline void SetExtFuncOut(T&& data, const int size) {} - - /*! - * \brief Sets the output variables of a externally differentiated function using a 2D array. - * \param[in] data - the output 2D array. - * \param[in] size_x - number of rows. - * \param[in] size_y - number of columns. - */ - template - inline void SetExtFuncOut(T&& data, const int size_x, const int size_y) {} - - /*! - * \brief Ends an external function section by deleting the structures. - */ - inline void EndExtFunc() {} - - /*! - * \brief Evaluates and saves gradient data from a variable. - * \param[in] data - variable whose gradient information will be extracted. - * \param[in] index - where obtained gradient information will be stored. - */ - inline void SetIndex(int &index, const su2double &data) {} - - /*! - * \brief Pushes back the current tape position to the tape position's vector. - */ - inline void Push_TapePosition() {} - - /*! - * \brief Start a passive region, i.e. stop recording. - * \return True if tape was active. - */ - inline bool BeginPassive() { return false; } - - /*! - * \brief End a passive region, i.e. start recording if we were recording before. - * \param[in] wasActive - Whether we were recording before entering the passive region. - */ - inline void EndPassive(bool wasActive) {} - - /*! - * \brief Pause the use of preaccumulation. - * \return True if preaccumulation was active. - */ - inline bool PausePreaccumulation() { return false; } - - /*! - * \brief Resume the use of preaccumulation. - * \param[in] wasActive - Whether preaccumulation was active before pausing. - */ - inline void ResumePreaccumulation(bool wasActive) {} - - /*! - * \brief Begin a hybrid parallel adjoint evaluation mode that assumes an inherently safe reverse path. - */ - inline void StartNoSharedReading() {} - - /*! - * \brief End the "no shared reading" adjoint evaluation mode. - */ - inline void EndNoSharedReading() {} +/*! + * \brief Start the recording of the operations and involved variables. + * If called, the computational graph of all operations occuring after the call will be stored, + * starting with the variables registered with RegisterInput. + */ +inline void StartRecording() {} + +/*! + * \brief Stops the recording of the operations and variables. + */ +inline void StopRecording() {} + +/*! + * \brief Check if the tape is active + * \param[out] Boolean which determines whether the tape is active. + */ +inline bool TapeActive() { return false; } + +/*! + * \brief Prints out tape statistics. + */ +inline void PrintStatistics() {} + +/*! + * \brief Registers the variable as an input. I.e. as a leaf of the computational graph. + * \param[in] data - The variable to be registered as input. + */ +inline void RegisterInput(su2double& data) {} + +/*! + * \brief Registers the variable as an output. I.e. as the root of the computational graph. + * \param[in] data - The variable to be registered as output. + */ +inline void RegisterOutput(su2double& data) {} + +/*! + * \brief Resize the adjoint vector, for subsequent access without bounds checking. + */ +inline void ResizeAdjoints() {} + +/*! + * \brief Sets the adjoint value at index to val + * \param[in] index - Position in the adjoint vector. + * \param[in] val - adjoint value to be set. + */ +inline void SetDerivative(int index, const double val) {} + +/*! + * \brief Extracts the adjoint value at index + * \param[in] index - position in the adjoint vector where the derivative will be extracted. + * \return Derivative value. + */ +inline double GetDerivative(int index) { return 0.0; } + +/*! + * \brief Clears the currently stored adjoints but keeps the computational graph. + */ +inline void ClearAdjoints() {} + +/*! + * \brief Computes the adjoints, i.e. the derivatives of the output with respect to the input variables. + */ +inline void ComputeAdjoint() {} + +/*! + * \brief Computes the adjoints, i.e. the derivatives of the output with respect to the input variables. + * \param[in] enter - Position where we start evaluating the tape. + * \param[in] leave - Position where we stop evaluating the tape. + */ +inline void ComputeAdjoint(unsigned short enter, unsigned short leave) {} + +/*! + * \brief Computes the adjoints, i.e., the derivatives of the output with respect to the input variables, using forward + * tape evaluation. + */ +inline void ComputeAdjointForward() {} + +/*! + * \brief Reset the tape structure to be ready for a new recording. + */ +inline void Reset() {} + +/*! + * \brief Reset the variable (set index to zero). + * \param[in] data - the variable to be unregistered from the tape. + */ +inline void ResetInput(su2double& data) {} + +/*! + * \brief Sets the scalar inputs of a preaccumulation section. + * \param[in] data - the scalar input variables. + */ +template +inline void SetPreaccIn(Ts&&... data) {} + +/*! + * \brief Sets the input variables of a preaccumulation section using a 1D array. + * \param[in] data - the input 1D array. + * \param[in] size - size of the array. + */ +template +inline void SetPreaccIn(const T& data, const int size) {} + +/*! + * \brief Sets the input variables of a preaccumulation section using a 2D array. + * \param[in] data - the input 2D array. + * \param[in] size_x - size of the array in x dimension. + * \param[in] size_y - size of the array in y dimension. + */ +template +inline void SetPreaccIn(const T& data, const int size_x, const int size_y) {} + +/*! + * \brief Starts a new preaccumulation section and sets the input variables. + * + * The idea of preaccumulation is to store only the Jacobi matrix of a code section during + * the taping process instead of all operations. This decreases the tape size and reduces runtime. + * + * Input/Output of the section are set with several calls to SetPreaccIn()/SetPreaccOut(). + * + * Note: the call of this routine must be followed by a call of EndPreacc() and the end of the code section. + */ +inline void StartPreacc() {} + +/*! + * \brief Sets the scalar outputs of a preaccumulation section. + * \param[in] data - the scalar output variables. + */ +template +inline void SetPreaccOut(Ts&&... data) {} + +/*! + * \brief Sets the output variables of a preaccumulation section using a 1D array. + * \param[in] data - the output 1D array. + */ +template +inline void SetPreaccOut(T&& data, const int size) {} + +/*! + * \brief Sets the input variables of a preaccumulation section using a 2D array. + * \param[in] data - the output 1D array. + */ +template +inline void SetPreaccOut(T&& data, const int size_x, const int size_y) {} + +/*! + * \brief Ends a preaccumulation section and computes the local Jacobi matrix + * of a code section using the variables set with SetLocalInput(), SetLocalOutput() and pushes a statement + * for each output variable to the AD tape. + */ +inline void EndPreacc() {} + +/*! + * \brief Sets the scalar input of a externally differentiated function. + * \param[in] data - the scalar input variable. + */ +inline void SetExtFuncIn(su2double& data) {} + +/*! + * \brief Sets the input variables of a externally differentiated function using a 1D array. + * \param[in] data - the input 1D array. + * \param[in] size - number of rows. + */ +template +inline void SetExtFuncIn(const T& data, const int size) {} + +/*! + * \brief Sets the input variables of a externally differentiated function using a 2D array. + * \param[in] data - the input 2D array. + * \param[in] size_x - number of rows. + * \param[in] size_y - number of columns. + */ +template +inline void SetExtFuncIn(const T& data, const int size_x, const int size_y) {} + +/*! + * \brief Sets the scalar output of a externally differentiated function. + * \param[in] data - the scalar output variable. + */ +inline void SetExtFuncOut(su2double& data) {} + +/*! + * \brief Sets the output variables of a externally differentiated function using a 1D array. + * \param[in] data - the output 1D array. + * \param[in] size - number of rows. + */ +template +inline void SetExtFuncOut(T&& data, const int size) {} + +/*! + * \brief Sets the output variables of a externally differentiated function using a 2D array. + * \param[in] data - the output 2D array. + * \param[in] size_x - number of rows. + * \param[in] size_y - number of columns. + */ +template +inline void SetExtFuncOut(T&& data, const int size_x, const int size_y) {} + +/*! + * \brief Evaluates and saves gradient data from a variable. + * \param[in] data - variable whose gradient information will be extracted. + * \param[in] index - where obtained gradient information will be stored. + */ +inline void SetIndex(int& index, const su2double& data) {} + +/*! + * \brief Pushes back the current tape position to the tape position's vector. + */ +inline void Push_TapePosition() {} + +/*! + * \brief Start a passive region, i.e. stop recording. + * \return True if tape was active. + */ +inline bool BeginPassive() { return false; } + +/*! + * \brief End a passive region, i.e. start recording if we were recording before. + * \param[in] wasActive - Whether we were recording before entering the passive region. + */ +inline void EndPassive(bool wasActive) {} + +/*! + * \brief Pause the use of preaccumulation. + * \return True if preaccumulation was active. + */ +inline bool PausePreaccumulation() { return false; } + +/*! + * \brief Resume the use of preaccumulation. + * \param[in] wasActive - Whether preaccumulation was active before pausing. + */ +inline void ResumePreaccumulation(bool wasActive) {} + +/*! + * \brief Begin a hybrid parallel adjoint evaluation mode that assumes an inherently safe reverse path. + */ +inline void StartNoSharedReading() {} + +/*! + * \brief End the "no shared reading" adjoint evaluation mode. + */ +inline void EndNoSharedReading() {} #else - using CheckpointHandler = codi::DataStore; +using CheckpointHandler = codi::ExternalFunctionUserData; - using Tape = su2double::TapeType; +using Tape = su2double::Tape; - using ExtFuncHelper = codi::ExternalFunctionHelper; +#ifdef HAVE_OPDI +using ExtFuncHelper = codi::OpenMPExternalFunctionHelper; +#else +using ExtFuncHelper = codi::ExternalFunctionHelper; +#endif - extern ExtFuncHelper* FuncHelper; +extern ExtFuncHelper FuncHelper; - extern bool PreaccActive; +extern bool PreaccActive; #ifdef HAVE_OPDI - SU2_OMP(threadprivate(PreaccActive)) +SU2_OMP(threadprivate(PreaccActive)) #endif - extern bool PreaccEnabled; +extern bool PreaccEnabled; #ifdef HAVE_OPDI - using CoDiTapePosition = su2double::TapeType::Position; - using OpDiState = void*; - using TapePosition = std::pair; +using CoDiTapePosition = Tape::Position; +using OpDiState = void*; +using TapePosition = std::pair; #else - using TapePosition = su2double::TapeType::Position; +using TapePosition = Tape::Position; #endif - extern TapePosition StartPosition, EndPosition; +extern TapePosition StartPosition, EndPosition; - extern std::vector TapePositions; +extern std::vector TapePositions; - extern codi::PreaccumulationHelper PreaccHelper; +extern codi::PreaccumulationHelper PreaccHelper; #ifdef HAVE_OPDI - SU2_OMP(threadprivate(PreaccHelper)) +SU2_OMP(threadprivate(PreaccHelper)) #endif - /*--- Reference to the tape. ---*/ +/*--- Reference to the tape. ---*/ - FORCEINLINE su2double::TapeType& getGlobalTape() {return su2double::getGlobalTape();} +FORCEINLINE Tape& getTape() { return su2double::getTape(); } - FORCEINLINE void RegisterInput(su2double &data) {AD::getGlobalTape().registerInput(data);} +FORCEINLINE void RegisterInput(su2double& data) { AD::getTape().registerInput(data); } - FORCEINLINE void RegisterOutput(su2double& data) {AD::getGlobalTape().registerOutput(data);} +FORCEINLINE void RegisterOutput(su2double& data) { AD::getTape().registerOutput(data); } - FORCEINLINE void ResetInput(su2double &data) {data = data.getValue();} +FORCEINLINE void ResetInput(su2double& data) { data = data.getValue(); } - FORCEINLINE void StartRecording() {AD::getGlobalTape().setActive();} +FORCEINLINE void StartRecording() { AD::getTape().setActive(); } - FORCEINLINE void StopRecording() {AD::getGlobalTape().setPassive();} +FORCEINLINE void StopRecording() { AD::getTape().setPassive(); } - FORCEINLINE bool TapeActive() { return AD::getGlobalTape().isActive(); } +FORCEINLINE bool TapeActive() { return AD::getTape().isActive(); } - FORCEINLINE void PrintStatistics() {AD::getGlobalTape().printStatistics();} +FORCEINLINE void PrintStatistics() { AD::getTape().printStatistics(); } - FORCEINLINE void ClearAdjoints() {AD::getGlobalTape().clearAdjoints(); } +FORCEINLINE void ClearAdjoints() { AD::getTape().clearAdjoints(); } - FORCEINLINE void ComputeAdjoint() { - #if defined(HAVE_OPDI) - opdi::logic->prepareEvaluate(); - #endif - AD::getGlobalTape().evaluate(); - } +FORCEINLINE void ComputeAdjoint() { +#if defined(HAVE_OPDI) + opdi::logic->prepareEvaluate(); +#endif + AD::getTape().evaluate(); +} - FORCEINLINE void ComputeAdjoint(unsigned short enter, unsigned short leave) { - #if defined(HAVE_OPDI) - opdi::logic->recoverState(TapePositions[enter].second); - opdi::logic->prepareEvaluate(); - AD::getGlobalTape().evaluate(TapePositions[enter].first, TapePositions[leave].first); - #else - AD::getGlobalTape().evaluate(TapePositions[enter], TapePositions[leave]); - #endif - } +FORCEINLINE void ComputeAdjoint(unsigned short enter, unsigned short leave) { +#if defined(HAVE_OPDI) + opdi::logic->recoverState(TapePositions[enter].second); + opdi::logic->prepareEvaluate(); + AD::getTape().evaluate(TapePositions[enter].first, TapePositions[leave].first); +#else + AD::getTape().evaluate(TapePositions[enter], TapePositions[leave]); +#endif +} - FORCEINLINE void ComputeAdjointForward() {AD::getGlobalTape().evaluateForward();} - - FORCEINLINE void Reset() { - AD::getGlobalTape().reset(); - #if defined(HAVE_OPDI) - opdi::logic->reset(); - #endif - if (TapePositions.size() != 0) { - #if defined(HAVE_OPDI) - for (TapePosition& pos : TapePositions) { - opdi::logic->freeState(pos.second); - } - #endif - TapePositions.clear(); +FORCEINLINE void ComputeAdjointForward() { AD::getTape().evaluateForward(); } + +FORCEINLINE void Reset() { + AD::getTape().reset(); +#if defined(HAVE_OPDI) + opdi::logic->reset(); +#endif + if (TapePositions.size() != 0) { +#if defined(HAVE_OPDI) + for (TapePosition& pos : TapePositions) { + opdi::logic->freeState(pos.second); } +#endif + TapePositions.clear(); } +} - FORCEINLINE void SetIndex(int &index, const su2double &data) { - index = data.getGradientData(); - } +FORCEINLINE void ResizeAdjoints() { AD::getTape().resizeAdjointVector(); } - FORCEINLINE void SetDerivative(int index, const double val) { - AD::getGlobalTape().setGradient(index, val); - } +FORCEINLINE void SetIndex(int& index, const su2double& data) { index = data.getIdentifier(); } - FORCEINLINE double GetDerivative(int index) { - return AD::getGlobalTape().getGradient(index); - } +// WARNING: For performance reasons, this method does not perform bounds checking. +// When using it, please ensure sufficient adjoint vector size by a call to AD::ResizeAdjoints(). +FORCEINLINE void SetDerivative(int index, const double val) { + if (index == 0) // Allow multiple threads to "set the derivative" of passive variables without causing data races. + return; - /*--- Base case for parameter pack expansion. ---*/ - FORCEINLINE void SetPreaccIn() {} + AD::getTape().setGradient(index, val, codi::AdjointsManagement::Manual); +} - template::value> = 0> - FORCEINLINE void SetPreaccIn(const T& data, Ts&&... moreData) { - if (!PreaccActive) return; - if (data.isActive()) - PreaccHelper.addInput(data); - SetPreaccIn(moreData...); - } +// WARNING: For performance reasons, this method does not perform bounds checking. +// If called after tape evaluations, the adjoints should exist. +// Otherwise, please ensure sufficient adjoint vector size by a call to AD::ResizeAdjoints(). +FORCEINLINE double GetDerivative(int index) { + return AD::getTape().getGradient(index, codi::AdjointsManagement::Manual); +} - template::value> = 0> - FORCEINLINE void SetPreaccIn(T&& data, Ts&&... moreData) { - static_assert(!std::is_same::value, "rvalues cannot be registered"); - } +FORCEINLINE bool IsIdentifierActive(su2double const& value) { + return getTape().isIdentifierActive(value.getIdentifier()); +} + +/*--- Base case for parameter pack expansion. ---*/ +FORCEINLINE void SetPreaccIn() {} + +template ::value> = 0> +FORCEINLINE void SetPreaccIn(const T& data, Ts&&... moreData) { + if (!PreaccActive) return; + if (IsIdentifierActive(data)) PreaccHelper.addInput(data); + SetPreaccIn(moreData...); +} + +template ::value> = 0> +FORCEINLINE void SetPreaccIn(T&& data, Ts&&... moreData) { + static_assert(!std::is_same::value, "rvalues cannot be registered"); +} - template - FORCEINLINE void SetPreaccIn(const T& data, const int size) { - if (PreaccActive) { - for (int i = 0; i < size; i++) { - if (data[i].isActive()) { - PreaccHelper.addInput(data[i]); - } +template +FORCEINLINE void SetPreaccIn(const T& data, const int size) { + if (PreaccActive) { + for (int i = 0; i < size; i++) { + if (IsIdentifierActive(data[i])) { + PreaccHelper.addInput(data[i]); } } } +} - template - FORCEINLINE void SetPreaccIn(const T& data, const int size_x, const int size_y) { - if (!PreaccActive) return; - for (int i = 0; i < size_x; i++) { - for (int j = 0; j < size_y; j++) { - if (data[i][j].isActive()) { - PreaccHelper.addInput(data[i][j]); - } +template +FORCEINLINE void SetPreaccIn(const T& data, const int size_x, const int size_y) { + if (!PreaccActive) return; + for (int i = 0; i < size_x; i++) { + for (int j = 0; j < size_y; j++) { + if (IsIdentifierActive(data[i][j])) { + PreaccHelper.addInput(data[i][j]); } } } +} - FORCEINLINE void StartPreacc() { - if (AD::getGlobalTape().isActive() && PreaccEnabled) { - PreaccHelper.start(); - PreaccActive = true; - } +FORCEINLINE void StartPreacc() { + if (AD::getTape().isActive() && PreaccEnabled) { + PreaccHelper.start(); + PreaccActive = true; } +} - /*--- Base case for parameter pack expansion. ---*/ - FORCEINLINE void SetPreaccOut() {} +/*--- Base case for parameter pack expansion. ---*/ +FORCEINLINE void SetPreaccOut() {} - template::value> = 0> - FORCEINLINE void SetPreaccOut(T& data, Ts&&... moreData) { - if (!PreaccActive) return; - if (data.isActive()) - PreaccHelper.addOutput(data); - SetPreaccOut(moreData...); - } +template ::value> = 0> +FORCEINLINE void SetPreaccOut(T& data, Ts&&... moreData) { + if (!PreaccActive) return; + if (IsIdentifierActive(data)) PreaccHelper.addOutput(data); + SetPreaccOut(moreData...); +} - template - FORCEINLINE void SetPreaccOut(T&& data, const int size) { - if (PreaccActive) { - for (int i = 0; i < size; i++) { - if (data[i].isActive()) { - PreaccHelper.addOutput(data[i]); - } +template +FORCEINLINE void SetPreaccOut(T&& data, const int size) { + if (PreaccActive) { + for (int i = 0; i < size; i++) { + if (IsIdentifierActive(data[i])) { + PreaccHelper.addOutput(data[i]); } } } +} - template - FORCEINLINE void SetPreaccOut(T&& data, const int size_x, const int size_y) { - if (!PreaccActive) return; - for (int i = 0; i < size_x; i++) { - for (int j = 0; j < size_y; j++) { - if (data[i][j].isActive()) { - PreaccHelper.addOutput(data[i][j]); - } +template +FORCEINLINE void SetPreaccOut(T&& data, const int size_x, const int size_y) { + if (!PreaccActive) return; + for (int i = 0; i < size_x; i++) { + for (int j = 0; j < size_y; j++) { + if (IsIdentifierActive(data[i][j])) { + PreaccHelper.addOutput(data[i][j]); } } } +} - FORCEINLINE void Push_TapePosition() { - #if defined(HAVE_OPDI) - TapePositions.push_back({AD::getGlobalTape().getPosition(), opdi::logic->exportState()}); - #else - TapePositions.push_back(AD::getGlobalTape().getPosition()); - #endif - } - - FORCEINLINE void EndPreacc(){ - if (PreaccActive) { - PreaccHelper.finish(false); - PreaccActive = false; - } - } +FORCEINLINE void Push_TapePosition() { +#if defined(HAVE_OPDI) + TapePositions.push_back({AD::getTape().getPosition(), opdi::logic->exportState()}); +#else + TapePositions.push_back(AD::getTape().getPosition()); +#endif +} - FORCEINLINE void StartExtFunc(bool storePrimalInput, bool storePrimalOutput){ - FuncHelper = new ExtFuncHelper(true); - if (!storePrimalInput){ - FuncHelper->disableInputPrimalStore(); - } - if (!storePrimalOutput){ - FuncHelper->disableOutputPrimalStore(); - } +FORCEINLINE void EndPreacc() { + if (PreaccActive) { + PreaccHelper.finish(false); + PreaccActive = false; } +} - FORCEINLINE void SetExtFuncIn(const su2double &data) { - FuncHelper->addInput(data); - } +FORCEINLINE void SetExtFuncIn(const su2double& data) { FuncHelper.addInput(data); } - template - FORCEINLINE void SetExtFuncIn(const T& data, const int size) { - for (int i = 0; i < size; i++) { - FuncHelper->addInput(data[i]); - } +template +FORCEINLINE void SetExtFuncIn(const T& data, const int size) { + for (int i = 0; i < size; i++) { + FuncHelper.addInput(data[i]); } +} - template - FORCEINLINE void SetExtFuncIn(const T& data, const int size_x, const int size_y) { - for (int i = 0; i < size_x; i++) { - for (int j = 0; j < size_y; j++) { - FuncHelper->addInput(data[i][j]); - } +template +FORCEINLINE void SetExtFuncIn(const T& data, const int size_x, const int size_y) { + for (int i = 0; i < size_x; i++) { + for (int j = 0; j < size_y; j++) { + FuncHelper.addInput(data[i][j]); } } +} - FORCEINLINE void SetExtFuncOut(su2double& data) { - if (AD::getGlobalTape().isActive()) { - FuncHelper->addOutput(data); - } +FORCEINLINE void SetExtFuncOut(su2double& data) { + if (AD::getTape().isActive()) { + FuncHelper.addOutput(data); } +} - template - FORCEINLINE void SetExtFuncOut(T&& data, const int size) { - for (int i = 0; i < size; i++) { - if (AD::getGlobalTape().isActive()) { - FuncHelper->addOutput(data[i]); - } +template +FORCEINLINE void SetExtFuncOut(T&& data, const int size) { + for (int i = 0; i < size; i++) { + if (AD::getTape().isActive()) { + FuncHelper.addOutput(data[i]); } } +} - template - FORCEINLINE void SetExtFuncOut(T&& data, const int size_x, const int size_y) { - for (int i = 0; i < size_x; i++) { - for (int j = 0; j < size_y; j++) { - if (AD::getGlobalTape().isActive()) { - FuncHelper->addOutput(data[i][j]); - } +template +FORCEINLINE void SetExtFuncOut(T&& data, const int size_x, const int size_y) { + for (int i = 0; i < size_x; i++) { + for (int j = 0; j < size_y; j++) { + if (AD::getTape().isActive()) { + FuncHelper.addOutput(data[i][j]); } } } +} - FORCEINLINE void delete_handler(void *handler) { - CheckpointHandler *checkpoint = static_cast(handler); - checkpoint->clear(); - } - - FORCEINLINE void EndExtFunc() { delete FuncHelper; } - - FORCEINLINE bool BeginPassive() { - if(AD::getGlobalTape().isActive()) { - StopRecording(); - return true; - } - return false; - } - - FORCEINLINE void EndPassive(bool wasActive) { if(wasActive) StartRecording(); } +FORCEINLINE void delete_handler(void* handler) { + CheckpointHandler* checkpoint = static_cast(handler); + checkpoint->clear(); +} - FORCEINLINE bool PausePreaccumulation() { - const auto current = PreaccEnabled; - if (!current) return false; - SU2_OMP_SAFE_GLOBAL_ACCESS(PreaccEnabled = false;) +FORCEINLINE bool BeginPassive() { + if (AD::getTape().isActive()) { + AD::getTape().setPassive(); return true; } + return false; +} - FORCEINLINE void ResumePreaccumulation(bool wasActive) { - if (!wasActive) return; - SU2_OMP_SAFE_GLOBAL_ACCESS(PreaccEnabled = true;) - } +FORCEINLINE void EndPassive(bool wasActive) { + if (wasActive) AD::getTape().setActive(); +} - FORCEINLINE void StartNoSharedReading() { +FORCEINLINE void StartNoSharedReading() { #ifdef HAVE_OPDI - opdi::logic->setAdjointAccessMode(opdi::LogicInterface::AdjointAccessMode::Classical); - opdi::logic->addReverseBarrier(); + opdi::logic->setAdjointAccessMode(opdi::LogicInterface::AdjointAccessMode::Classical); + opdi::logic->addReverseBarrier(); #endif - } +} - FORCEINLINE void EndNoSharedReading() { +FORCEINLINE void EndNoSharedReading() { #ifdef HAVE_OPDI - opdi::logic->setAdjointAccessMode(opdi::LogicInterface::AdjointAccessMode::Atomic); - opdi::logic->addReverseBarrier(); + opdi::logic->setAdjointAccessMode(opdi::LogicInterface::AdjointAccessMode::Atomic); + opdi::logic->addReverseBarrier(); #endif - } -#endif // CODI_REVERSE_TYPE +} + +FORCEINLINE bool PausePreaccumulation() { + const auto current = PreaccEnabled; + if (!current) return false; + SU2_OMP_SAFE_GLOBAL_ACCESS(PreaccEnabled = false;) + return true; +} + +FORCEINLINE void ResumePreaccumulation(bool wasActive) { + if (!wasActive) return; + SU2_OMP_SAFE_GLOBAL_ACCESS(PreaccEnabled = true;) +} -} // namespace AD +#endif // CODI_REVERSE_TYPE +void Initialize(); +void Finalize(); + +} // namespace AD /*--- If we compile under OSX we have to overload some of the operators for * complex numbers to avoid the use of the standard operators @@ -592,36 +590,28 @@ namespace AD{ #ifdef __APPLE__ -namespace std{ - - template<> - inline su2double abs(const complex& x){ - - return sqrt(x.real()*x.real() + x.imag()*x.imag()); - - } - - template<> - inline complex operator/(const complex& x, - const complex& y){ +namespace std { - su2double d = (y.real()*y.real() + y.imag()*y.imag()); - su2double real = (x.real()*y.real() + x.imag()*y.imag())/d; - su2double imag = (x.imag()*y.real() - x.real()*y.imag())/d; - - return complex(real, imag); - - } +template <> +inline su2double abs(const complex& x) { + return sqrt(x.real() * x.real() + x.imag() * x.imag()); +} - template<> - inline complex operator*(const complex& x, - const complex& y){ +template <> +inline complex operator/(const complex& x, const complex& y) { + su2double d = (y.real() * y.real() + y.imag() * y.imag()); + su2double real = (x.real() * y.real() + x.imag() * y.imag()) / d; + su2double imag = (x.imag() * y.real() - x.real() * y.imag()) / d; - su2double real = (x.real()*y.real() - x.imag()*y.imag()); - su2double imag = (x.imag()*y.real() + x.real()*y.imag()); + return complex(real, imag); +} - return complex(real, imag); +template <> +inline complex operator*(const complex& x, const complex& y) { + su2double real = (x.real() * y.real() - x.imag() * y.imag()); + su2double imag = (x.imag() * y.real() + x.real() * y.imag()); - } + return complex(real, imag); } +} // namespace std #endif diff --git a/Common/include/basic_types/datatype_structure.hpp b/Common/include/basic_types/datatype_structure.hpp index 1ee72ee70b7..54d8d5fbd64 100644 --- a/Common/include/basic_types/datatype_structure.hpp +++ b/Common/include/basic_types/datatype_structure.hpp @@ -2,7 +2,7 @@ * \file datatype_structure.hpp * \brief Headers for generalized datatypes, defines an interface for AD types. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -41,130 +41,132 @@ * \author T. Albring */ namespace SU2_TYPE { - /*! - * \brief Set the (primitive) value of the datatype (needs to be implemented for each new type). - * \param[in] data - The non-primitive datatype. - * \param[in] val - The primitive value. - */ - void SetValue(su2double& data, const passivedouble &val); - - /*! - * \brief Set the secondary value of the datatype (needs to be implemented for each new type). - * \param[in] data - The non-primitive datatype. - * \param[in] val - The primitive value. - */ - void SetSecondary(su2double& data, const passivedouble &val); - - /*! - * \brief Get the (primitive) value of the datatype (needs to be specialized for active types). - * \param[in] data - The non-primitive datatype. - * \return The primitive value. - */ - passivedouble GetValue(const su2double &data); - - /*! - * \brief Get the secondary value of the datatype (needs to be implemented for each new type). - * \param[in] data - The non-primitive datatype. - * \return The primitive value. - */ - passivedouble GetSecondary(const su2double &data); - - /*! - * \brief Get the derivative value of the datatype (needs to be implemented for each new type). - * \param[in] data - The non-primitive datatype. - * \return The derivative value. - */ - passivedouble GetDerivative(const su2double &data); - - /*! - * \brief Set the derivative value of the datatype (needs to be implemented for each new type). - * \param[in] data - The non-primitive datatype. - * \param[in] val - The value of the derivative. - */ - void SetDerivative(su2double &data, const passivedouble &val); - - /*--- Implementation of the above for the different types. ---*/ +/*! + * \brief Set the (primitive) value of the datatype (needs to be implemented for each new type). + * \param[in] data - The non-primitive datatype. + * \param[in] val - The primitive value. + */ +void SetValue(su2double& data, const passivedouble& val); + +/*! + * \brief Set the secondary value of the datatype (needs to be implemented for each new type). + * \param[in] data - The non-primitive datatype. + * \param[in] val - The primitive value. + */ +void SetSecondary(su2double& data, const passivedouble& val); + +/*! + * \brief Get the (primitive) value of the datatype (needs to be specialized for active types). + * \param[in] data - The non-primitive datatype. + * \return The primitive value. + */ +passivedouble GetValue(const su2double& data); + +/*! + * \brief Get the secondary value of the datatype (needs to be implemented for each new type). + * \param[in] data - The non-primitive datatype. + * \return The primitive value. + */ +passivedouble GetSecondary(const su2double& data); + +/*! + * \brief Get the derivative value of the datatype (needs to be implemented for each new type). + * \param[in] data - The non-primitive datatype. + * \return The derivative value. + */ +passivedouble GetDerivative(const su2double& data); + +/*! + * \brief Set the derivative value of the datatype (needs to be implemented for each new type). + * \param[in] data - The non-primitive datatype. + * \param[in] val - The value of the derivative. + */ +void SetDerivative(su2double& data, const passivedouble& val); + +/*--- Implementation of the above for the different types. ---*/ #if defined(CODI_REVERSE_TYPE) || defined(CODI_FORWARD_TYPE) - FORCEINLINE void SetValue(su2double& data, const passivedouble &val) {data.setValue(val);} +FORCEINLINE void SetValue(su2double& data, const passivedouble& val) { data.setValue(val); } - FORCEINLINE passivedouble GetValue(const su2double& data) {return data.getValue();} +FORCEINLINE passivedouble GetValue(const su2double& data) { return data.getValue(); } - FORCEINLINE void SetSecondary(su2double& data, const passivedouble &val) {data.setGradient(val);} +FORCEINLINE void SetSecondary(su2double& data, const passivedouble& val) { data.setGradient(val); } - FORCEINLINE void SetDerivative(su2double& data, const passivedouble &val) {data.setGradient(val);} +FORCEINLINE void SetDerivative(su2double& data, const passivedouble& val) { data.setGradient(val); } - FORCEINLINE passivedouble GetSecondary(const su2double& data) {return data.getGradient();} +FORCEINLINE passivedouble GetSecondary(const su2double& data) { return data.getGradient(); } - FORCEINLINE passivedouble GetDerivative(const su2double& data) {return data.getGradient();} +FORCEINLINE passivedouble GetDerivative(const su2double& data) { return data.getGradient(); } -#else // passive type, no AD +#else // passive type, no AD - FORCEINLINE void SetValue(su2double& data, const passivedouble &val) {data = val;} +FORCEINLINE void SetValue(su2double& data, const passivedouble& val) { data = val; } - FORCEINLINE passivedouble GetValue(const su2double& data) {return data;} +FORCEINLINE passivedouble GetValue(const su2double& data) { return data; } - FORCEINLINE void SetSecondary(su2double&, const passivedouble &) {} +FORCEINLINE void SetSecondary(su2double&, const passivedouble&) {} - FORCEINLINE passivedouble GetDerivative(const su2double&) {return 0.0;} +FORCEINLINE passivedouble GetDerivative(const su2double&) { return 0.0; } - FORCEINLINE passivedouble GetSecondary(const su2double&) {return 0.0;} +FORCEINLINE passivedouble GetSecondary(const su2double&) { return 0.0; } - FORCEINLINE void SetDerivative(su2double &, const passivedouble &) {} +FORCEINLINE void SetDerivative(su2double&, const passivedouble&) {} #endif - /*! - * \brief Get the passive value of any variable. For most types return directly, - * specialize for su2double to call GetValue. - * \note This is a struct instead of a function because the return type of the - * su2double specialization changes. - */ - template - struct Passive { - FORCEINLINE static T Value(const T& val) {return val;} - }; - template <> - struct Passive { - FORCEINLINE static passivedouble Value(const su2double& val) {return GetValue(val);} - }; - - /*! - * \brief Casts the primitive value to int (uses GetValue, already implemented for each type). - * \param[in] data - The non-primitive datatype. - * \return - The primary value casted to int. - */ - FORCEINLINE int Int(const su2double& data) {return static_cast(SU2_TYPE::GetValue(data));} - - /*! - * \brief Casts the primitive value to short (uses GetValue, already implemented for each type). - * \param[in] data - The non-primitive datatype. - * \return - The primary value casted to short. - */ - FORCEINLINE short Short(const su2double& data) {return static_cast(SU2_TYPE::GetValue(data));} - - /*--- Special handling of the sprintf routine for non-primitive types. ---*/ - /*--- Pass-through for built-in types. ---*/ - template::value> = 0> - FORCEINLINE const T& _printGetValue(const T& val) {return val;} - /*--- Overload for expressions of active types. ---*/ - template::value> = 0> - FORCEINLINE passivedouble _printGetValue(const T& val) { return val.getValue(); } - - /*! - * \brief Wrapper to sprintf to be able to print active types and AD expressions. - * \note This is for compatibility with old code, stringstreams should be the preferred way to build strings. - * \param[in] str - Target char buffer. - * \param[in] format - Format string. - * \param[in] args - Values to be printed to the string. - */ - template - FORCEINLINE void sprintf(char* str, const char* format, Ts&&... args) { - ::sprintf(str, format, SU2_TYPE::_printGetValue(args)...); - } - FORCEINLINE void sprintf(char* str, const char* literal) { - ::sprintf(str, "%s", literal); - } +/*! + * \brief Get the passive value of any variable. For most types return directly, + * specialize for su2double to call GetValue. + * \note This is a struct instead of a function because the return type of the + * su2double specialization changes. + */ +template +struct Passive { + FORCEINLINE static T Value(const T& val) { return val; } +}; +template <> +struct Passive { + FORCEINLINE static passivedouble Value(const su2double& val) { return GetValue(val); } +}; + +/*! + * \brief Casts the primitive value to int (uses GetValue, already implemented for each type). + * \param[in] data - The non-primitive datatype. + * \return - The primary value casted to int. + */ +FORCEINLINE int Int(const su2double& data) { return static_cast(SU2_TYPE::GetValue(data)); } + +/*! + * \brief Casts the primitive value to short (uses GetValue, already implemented for each type). + * \param[in] data - The non-primitive datatype. + * \return - The primary value casted to short. + */ +FORCEINLINE short Short(const su2double& data) { return static_cast(SU2_TYPE::GetValue(data)); } + +/*--- Special handling of the sprintf routine for non-primitive types. ---*/ +/*--- Pass-through for built-in types. ---*/ +template ::value> = 0> +FORCEINLINE const T& _printGetValue(const T& val) { + return val; +} +/*--- Overload for expressions of active types. ---*/ +template ::value> = 0> +FORCEINLINE passivedouble _printGetValue(const T& val) { + return val.getValue(); +} + +/*! + * \brief Wrapper to sprintf to be able to print active types and AD expressions. + * \note This is for compatibility with old code, stringstreams should be the preferred way to build strings. + * \param[in] str - Target char buffer. + * \param[in] format - Format string. + * \param[in] args - Values to be printed to the string. + */ +template +FORCEINLINE void sprintf(char* str, const char* format, Ts&&... args) { + ::sprintf(str, format, SU2_TYPE::_printGetValue(args)...); +} +FORCEINLINE void sprintf(char* str, const char* literal) { ::sprintf(str, "%s", literal); } #define SPRINTF SU2_TYPE::sprintf -} // namespace SU2_TYPE +} // namespace SU2_TYPE diff --git a/Common/include/code_config.hpp b/Common/include/code_config.hpp index f3aa1911a2e..447c1a5fb5f 100644 --- a/Common/include/code_config.hpp +++ b/Common/include/code_config.hpp @@ -2,7 +2,7 @@ * \file code_config.hpp * \brief Header file for collecting common macros, definitions and type configurations. * \author T. Albring, P. Gomes, J. Blühdorn - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -56,18 +56,24 @@ /*--- Convenience SFINAE typedef to conditionally * enable/disable function template overloads. ---*/ -template -using su2enable_if = typename std::enable_if::type; +template +using su2enable_if = typename std::enable_if::type; /*--- Compile-time type selection. ---*/ -template struct su2conditional { using type = T; }; -template struct su2conditional { using type = F; }; - -template -using su2conditional_t = typename su2conditional::type; +template +struct su2conditional { + using type = T; +}; +template +struct su2conditional { + using type = F; +}; + +template +using su2conditional_t = typename su2conditional::type; /*! \brief Static cast "In" to "Out", in debug builds a dynamic cast is used. */ -template +template FORCEINLINE Out su2staticcast_p(In ptr) { static_assert(std::is_pointer::value, "This expects a pointer"); #ifndef NDEBUG @@ -85,28 +91,38 @@ FORCEINLINE Out su2staticcast_p(In ptr) { /*--- Depending on the datatype defined during the configuration, * include the correct definition, and create the main typedef. ---*/ -#if defined(CODI_REVERSE_TYPE) // reverse mode AD +#if defined(CODI_REVERSE_TYPE) // reverse mode AD #include "codi.hpp" -#include "codi/tools/dataStore.hpp" +#include "codi/tools/data/externalFunctionUserData.hpp" #if defined(HAVE_OMP) -using su2double = codi::RealReverseIndexParallel; +using su2double = codi::RealReverseIndexOpenMPGen; #else -#if defined(CODI_INDEX_TAPE) +#if defined(CODI_JACOBIAN_LINEAR_TAPE) +using su2double = codi::RealReverse; +#elif defined(CODI_JACOBIAN_REUSE_TAPE) +using su2double = codi::RealReverseIndexGen >; +#elif defined(CODI_JACOBIAN_MULTIUSE_TAPE) using su2double = codi::RealReverseIndex; -//#elif defined(CODI_PRIMAL_TAPE) -//using su2double = codi::RealReversePrimal; -//#elif defined(CODI_PRIMAL_INDEX_TAPE) -//using su2double = codi::RealReversePrimalIndex; +#elif defined(CODI_PRIMAL_LINEAR_TAPE) +using su2double = codi::RealReversePrimal; +#elif defined(CODI_PRIMAL_REUSE_TAPE) +using su2double = codi::RealReversePrimalIndexGen >; +#elif defined(CODI_PRIMAL_MULTIUSE_TAPE) +using su2double = codi::RealReversePrimalIndex; #else -using su2double = codi::RealReverse; +#error "Please define a CoDiPack tape." #endif #endif -#elif defined(CODI_FORWARD_TYPE) // forward mode AD + +#if defined(HAVE_OMP) || defined(CODI_JACOBIAN_REUSE_TAPE) || defined(CODI_JACOBIAN_MULTIUSE_TAPE) || \ + defined(CODI_PRIMAL_REUSE_TAPE) || defined(CODI_PRIMAL_MULTIUSE_TAPE) +#define CODI_INDEX_REUSE +#endif +#elif defined(CODI_FORWARD_TYPE) // forward mode AD #include "codi.hpp" using su2double = codi::RealForward; - -#else // primal / direct / no AD +#else // primal / direct / no AD using su2double = double; #endif diff --git a/Common/include/containers/C2DContainer.hpp b/Common/include/containers/C2DContainer.hpp index 119eed0b55a..d53be8ddcd8 100644 --- a/Common/include/containers/C2DContainer.hpp +++ b/Common/include/containers/C2DContainer.hpp @@ -2,7 +2,7 @@ * \file C2DContainer.hpp * \brief A templated vector/matrix object. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -42,19 +42,17 @@ * \brief Supported ways to flatten a matrix into an array. * Contiguous rows or contiguous columns respectively. */ -enum class StorageType {RowMajor=0, ColumnMajor=1}; +enum class StorageType { RowMajor = 0, ColumnMajor = 1 }; /*! * \enum SizeType * \brief Special value "DynamicSize" to indicate a dynamic size. */ -enum SizeType : size_t {DynamicSize=0}; - +enum SizeType : size_t { DynamicSize = 0 }; /*--- Namespace to "hide" helper classes and functions used by the container class. ---*/ -namespace container_details -{ +namespace container_details { /*! * \class AccessorImpl * \brief Base accessor class and version of template for both sizes known at compile time. @@ -62,25 +60,24 @@ namespace container_details * The actual container inherits from this class, this is to reduce the number of * methods that need to be redefined with each size specialization. */ -template -class AccessorImpl -{ - static_assert(!(StaticRows==1 && Store==StorageType::ColumnMajor), - "Row vector should have row-major storage."); - static_assert(!(StaticCols==1 && Store==StorageType::RowMajor), +template +class AccessorImpl { + static_assert(!(StaticRows == 1 && Store == StorageType::ColumnMajor), "Row vector should have row-major storage."); + static_assert(!(StaticCols == 1 && Store == StorageType::RowMajor), "Column vector should have column-major storage."); -protected: + + protected: /*! * For static specializations AlignSize will force the alignment * specification of the entire class, not just the data. */ - alignas(AlignSize) Scalar_t m_data[StaticRows*StaticCols]; + alignas(AlignSize) Scalar_t m_data[StaticRows * StaticCols]; /*! * Static size specializations use this do-nothing allocation macro. */ -#define DUMMY_ALLOCATOR \ - void m_allocate(size_t sz, Index_t rows, Index_t cols) noexcept {}\ +#define DUMMY_ALLOCATOR \ + void m_allocate(size_t sz, Index_t rows, Index_t cols) noexcept {} \ void m_destroy() noexcept {} /*! @@ -92,26 +89,25 @@ class AccessorImpl * default construct the elements of non-trivial type. Such types also * need to be destructed explicitly before freeing the memory. */ -#define REAL_ALLOCATOR(EXTRA) \ - static_assert(MemoryAllocation::is_power_of_two(AlignSize), \ - "AlignSize is not a power of two."); \ - \ - void m_allocate(size_t sz, Index_t rows, Index_t cols) noexcept { \ - EXTRA; \ - m_data = MemoryAllocation::aligned_alloc(AlignSize,sz); \ - if (!std::is_trivial::value) \ - for (size_t i = 0; i < size(); ++i) new (m_data+i) Scalar_t(); \ - } \ - \ - void m_destroy() noexcept { \ - if (!std::is_trivial::value) \ - for (size_t i = 0; i < size(); ++i) m_data[i].~Scalar_t(); \ - MemoryAllocation::aligned_free(m_data); \ +#define REAL_ALLOCATOR(EXTRA) \ + static_assert(MemoryAllocation::is_power_of_two(AlignSize), "AlignSize is not a power of two."); \ + \ + void m_allocate(size_t sz, Index_t rows, Index_t cols) noexcept { \ + EXTRA; \ + m_data = MemoryAllocation::aligned_alloc(AlignSize, sz); \ + if (!std::is_trivial::value) \ + for (size_t i = 0; i < size(); ++i) new (m_data + i) Scalar_t(); \ + } \ + \ + void m_destroy() noexcept { \ + if (!std::is_trivial::value) \ + for (size_t i = 0; i < size(); ++i) m_data[i].~Scalar_t(); \ + MemoryAllocation::aligned_free(m_data); \ } DUMMY_ALLOCATOR -public: + public: /*! * Dynamic types need to manage internal data as the derived class would * not compile if it tried to set m_data to null on static specializations. @@ -120,241 +116,226 @@ class AccessorImpl * The default ctor needs to "INIT" some fields. The move ctor/assign need * to "MOVE" those fields, i.e. copy and set "other" appropriately. */ -#define CUSTOM_CTOR_AND_DTOR_BASE(INIT,MOVE) \ - AccessorImpl() noexcept : m_data(nullptr) {INIT;} \ - \ - AccessorImpl(AccessorImpl&& other) noexcept \ - { \ - MOVE; m_data=other.m_data; other.m_data=nullptr; \ - } \ - \ - AccessorImpl& operator= (AccessorImpl&& other) noexcept \ - { \ - m_destroy(); \ - MOVE; m_data=other.m_data; other.m_data=nullptr; \ - return *this; \ - } \ - \ - ~AccessorImpl() noexcept {m_destroy();} +#define CUSTOM_CTOR_AND_DTOR_BASE(INIT, MOVE) \ + AccessorImpl() noexcept : m_data(nullptr) { INIT; } \ + \ + AccessorImpl(AccessorImpl&& other) noexcept { \ + MOVE; \ + m_data = other.m_data; \ + other.m_data = nullptr; \ + } \ + \ + AccessorImpl& operator=(AccessorImpl&& other) noexcept { \ + m_destroy(); \ + MOVE; \ + m_data = other.m_data; \ + other.m_data = nullptr; \ + return *this; \ + } \ + \ + ~AccessorImpl() noexcept { m_destroy(); } /*! * Shorthand for when specialization has only one more member than m_data. */ -#define CUSTOM_CTOR_AND_DTOR(X) \ - CUSTOM_CTOR_AND_DTOR_BASE(X=0, X=other.X; other.X=0) +#define CUSTOM_CTOR_AND_DTOR(X) CUSTOM_CTOR_AND_DTOR_BASE(X = 0, X = other.X; other.X = 0) /*! * Universal accessors return a raw pointer to the data. */ -#define UNIV_ACCESSORS \ - bool empty() const noexcept {return size()==0;} \ - Scalar_t* data() noexcept {return m_data;} \ - const Scalar_t* data() const noexcept {return m_data;} \ - Scalar_t* begin() noexcept {return data();} \ - const Scalar_t* begin() const noexcept {return data();} \ - Scalar_t* end() noexcept {return data()+size();} \ - const Scalar_t* end() const noexcept {return data()+size();} +#define UNIV_ACCESSORS \ + bool empty() const noexcept { return size() == 0; } \ + Scalar_t* data() noexcept { return m_data; } \ + const Scalar_t* data() const noexcept { return m_data; } \ + Scalar_t* begin() noexcept { return data(); } \ + const Scalar_t* begin() const noexcept { return data(); } \ + Scalar_t* end() noexcept { return data() + size(); } \ + const Scalar_t* end() const noexcept { return data() + size(); } /*! * Operator (,) gives pointwise access, operator [] returns a pointer to the * first element of the row/column of a row/column-major matrix respectively. */ -#define MATRIX_ACCESSORS(M,N) \ - UNIV_ACCESSORS \ - Index_t rows() const noexcept {return M;} \ - Index_t cols() const noexcept {return N;} \ - size_t size() const noexcept {return M*N;} \ - \ - const Scalar_t& operator() (const Index_t i, \ - const Index_t j) const noexcept \ - { \ - assert(i>=0 && i=0 && j( const_this(i,j) ); \ - } \ - \ - const Scalar_t* operator[] (const Index_t k) const noexcept \ - { \ - if(Store == StorageType::RowMajor) { \ - assert(k>=0 && k=0 && k( const_this[k] ); \ +#define MATRIX_ACCESSORS(M, N) \ + UNIV_ACCESSORS \ + Index_t rows() const noexcept { return M; } \ + Index_t cols() const noexcept { return N; } \ + size_t size() const noexcept { return M * N; } \ + \ + const Scalar_t& operator()(const Index_t i, const Index_t j) const noexcept { \ + assert(i >= 0 && i < M && j >= 0 && j < N); \ + return m_data[(Store == StorageType::RowMajor) ? i * N + j : i + j * M]; \ + } \ + \ + Scalar_t& operator()(const Index_t i, const Index_t j) noexcept { \ + const AccessorImpl& const_this = *this; \ + return const_cast(const_this(i, j)); \ + } \ + \ + const Scalar_t* operator[](const Index_t k) const noexcept { \ + if (Store == StorageType::RowMajor) { \ + assert(k >= 0 && k < M); \ + return &m_data[k * N]; \ + } else { \ + assert(k >= 0 && k < N); \ + return &m_data[k * M]; \ + } \ + } \ + \ + Scalar_t* operator[](const Index_t k) noexcept { \ + const AccessorImpl& const_this = *this; \ + return const_cast(const_this[k]); \ } /*! * Vectors provide both [] and () with the same behavior. */ -#define VECTOR_ACCESSORS(M,ROWMAJOR) \ - UNIV_ACCESSORS \ - Index_t rows() const noexcept {return ROWMAJOR? 1 : M;} \ - Index_t cols() const noexcept {return ROWMAJOR? M : 1;} \ - size_t size() const noexcept {return M;} \ - \ - Scalar_t& operator() (const Index_t i) noexcept \ - { \ - assert(i>=0 && i=0 && i=0 && i=0 && i= 0 && i < M); \ + return m_data[i]; \ + } \ + \ + const Scalar_t& operator()(const Index_t i) const noexcept { \ + assert(i >= 0 && i < M); \ + return m_data[i]; \ + } \ + \ + Scalar_t& operator[](const Index_t i) noexcept { \ + assert(i >= 0 && i < M); \ + return m_data[i]; \ + } \ + \ + const Scalar_t& operator[](const Index_t i) const noexcept { \ + assert(i >= 0 && i < M); \ + return m_data[i]; \ } - MATRIX_ACCESSORS(StaticRows,StaticCols) + MATRIX_ACCESSORS(StaticRows, StaticCols) }; /*! * Specialization for compile-time number of columns. */ -template -class AccessorImpl -{ - static_assert(!(StaticCols==1 && Store==StorageType::RowMajor), +template +class AccessorImpl { + static_assert(!(StaticCols == 1 && Store == StorageType::RowMajor), "Column vector should have column-major storage."); -protected: + + protected: Index_t m_rows; Scalar_t* m_data; - REAL_ALLOCATOR(m_rows=rows) + REAL_ALLOCATOR(m_rows = rows) -public: + public: CUSTOM_CTOR_AND_DTOR(m_rows) - MATRIX_ACCESSORS(m_rows,StaticCols) + MATRIX_ACCESSORS(m_rows, StaticCols) }; /*! * Specialization for compile-time number of columns. */ -template -class AccessorImpl -{ - static_assert(!(StaticRows==1 && Store==StorageType::ColumnMajor), - "Row vector should have row-major storage."); -protected: +template +class AccessorImpl { + static_assert(!(StaticRows == 1 && Store == StorageType::ColumnMajor), "Row vector should have row-major storage."); + + protected: Index_t m_cols; Scalar_t* m_data; - REAL_ALLOCATOR(m_cols=cols) + REAL_ALLOCATOR(m_cols = cols) -public: + public: CUSTOM_CTOR_AND_DTOR(m_cols) - MATRIX_ACCESSORS(StaticRows,m_cols) + MATRIX_ACCESSORS(StaticRows, m_cols) }; /*! * Specialization for fully dynamic sizes (generic matrix). */ -template -class AccessorImpl -{ -protected: +template +class AccessorImpl { + protected: Index_t m_rows, m_cols; Scalar_t* m_data; - REAL_ALLOCATOR(m_rows=rows; m_cols=cols) + REAL_ALLOCATOR(m_rows = rows; m_cols = cols) -public: - CUSTOM_CTOR_AND_DTOR_BASE(m_rows = 0; m_cols = 0, - m_rows = other.m_rows; other.m_rows = 0; - m_cols = other.m_cols; other.m_cols = 0) + public: + CUSTOM_CTOR_AND_DTOR_BASE(m_rows = 0; m_cols = 0, m_rows = other.m_rows; other.m_rows = 0; m_cols = other.m_cols; + other.m_cols = 0) - MATRIX_ACCESSORS(m_rows,m_cols) + MATRIX_ACCESSORS(m_rows, m_cols) }; /*! * Specialization for static column-vector. */ -template -class AccessorImpl -{ -protected: +template +class AccessorImpl { + protected: alignas(AlignSize) Scalar_t m_data[StaticRows]; DUMMY_ALLOCATOR -public: - VECTOR_ACCESSORS(StaticRows,false) + public: + VECTOR_ACCESSORS(StaticRows, false) }; /*! * Specialization for dynamic column-vector. */ -template -class AccessorImpl -{ -protected: +template +class AccessorImpl { + protected: Index_t m_rows; Scalar_t* m_data; - REAL_ALLOCATOR(m_rows=rows) + REAL_ALLOCATOR(m_rows = rows) -public: + public: CUSTOM_CTOR_AND_DTOR(m_rows) - VECTOR_ACCESSORS(m_rows,false) + VECTOR_ACCESSORS(m_rows, false) }; /*! * Specialization for static row-vector. */ -template -class AccessorImpl -{ -protected: +template +class AccessorImpl { + protected: alignas(AlignSize) Scalar_t m_data[StaticCols]; DUMMY_ALLOCATOR -public: - VECTOR_ACCESSORS(StaticCols,true) + public: + VECTOR_ACCESSORS(StaticCols, true) }; /*! * Specialization for dynamic row-vector. */ -template -class AccessorImpl -{ -protected: +template +class AccessorImpl { + protected: Index_t m_cols; Scalar_t* m_data; - REAL_ALLOCATOR(m_cols=cols) + REAL_ALLOCATOR(m_cols = cols) -public: + public: CUSTOM_CTOR_AND_DTOR(m_cols) - VECTOR_ACCESSORS(m_cols,true) + VECTOR_ACCESSORS(m_cols, true) }; #undef CUSTOM_CTOR_AND_DTOR_BASE @@ -364,7 +345,7 @@ class AccessorImpl -class C2DContainer : - public container_details::AccessorImpl -{ - static_assert(std::is_integral::value,""); - -private: - using Base = container_details::AccessorImpl; - using Base::m_data; +template +class C2DContainer + : public container_details::AccessorImpl { + static_assert(std::is_integral::value, ""); + + private: + using Base = container_details::AccessorImpl; using Base::m_allocate; + using Base::m_data; using Base::m_destroy; -public: - using Base::size; - using Base::rows; + + public: using Base::cols; + using Base::rows; + using Base::size; using Index = Index_t; using Scalar = Scalar_t; static constexpr StorageType Storage = Store; - static constexpr bool IsVector = (StaticRows==1) || (StaticCols==1); - static constexpr bool IsRowMajor = (Store==StorageType::RowMajor); - static constexpr bool IsColumnMajor = (Store==StorageType::ColumnMajor); - static constexpr size_t StaticSize = StaticRows*StaticCols; + static constexpr bool IsVector = (StaticRows == 1) || (StaticCols == 1); + static constexpr bool IsRowMajor = (Store == StorageType::RowMajor); + static constexpr bool IsColumnMajor = (Store == StorageType::ColumnMajor); + static constexpr size_t StaticSize = StaticRows * StaticCols; /*! * \brief Scalar iterator to the inner dimension of the container, read-only. @@ -416,18 +397,18 @@ class C2DContainer : private: const Index m_increment; const Scalar* m_ptr; + public: CInnerIter() = delete; - FORCEINLINE CInnerIter(const Scalar* ptr, Index increment) noexcept : - m_increment(increment), - m_ptr(ptr) { - } + FORCEINLINE CInnerIter(const Scalar* ptr, Index increment) noexcept : m_increment(increment), m_ptr(ptr) {} - FORCEINLINE Scalar operator* () const noexcept { return *m_ptr; } + FORCEINLINE Scalar operator*() const noexcept { return *m_ptr; } FORCEINLINE CInnerIter operator++(int) noexcept { - auto ret = *this; m_ptr += m_increment; return ret; + auto ret = *this; + m_ptr += m_increment; + return ret; } }; @@ -435,71 +416,72 @@ class C2DContainer : * \brief SIMD iterator to the inner dimension of the container, * read-only, generic non-contiguous access. */ - template + template class CInnerIterGather { private: - static_assert(std::is_integral::value,""); - enum {Size = IndexSIMD_t::Size}; + static_assert(std::is_integral::value, ""); + enum { Size = IndexSIMD_t::Size }; IndexSIMD_t m_offsets; const Index m_increment; const Scalar* const m_data; + public: CInnerIterGather() = delete; - FORCEINLINE CInnerIterGather(const Scalar* data, Index increment, IndexSIMD_t offsets) noexcept : - m_offsets(offsets), - m_increment(increment), - m_data(data) { - } + FORCEINLINE CInnerIterGather(const Scalar* data, Index increment, IndexSIMD_t offsets) noexcept + : m_offsets(offsets), m_increment(increment), m_data(data) {} - FORCEINLINE simd::Array operator* () const noexcept { - return simd::Array(m_data, m_offsets); + FORCEINLINE simd::Array operator*() const noexcept { + return simd::Array(m_data, m_offsets); } FORCEINLINE CInnerIterGather operator++(int) noexcept { - auto ret = *this; m_offsets += m_increment; return ret; + auto ret = *this; + m_offsets += m_increment; + return ret; } }; -private: + private: /*! * \brief Logic to resize data according to arguments, a non DynamicSize cannot be changed. */ - size_t m_resize(Index_t rows, Index_t cols) noexcept - { + size_t m_resize(Index_t rows, Index_t cols) noexcept { /*--- fully static, no allocation needed ---*/ - if(StaticSize!=DynamicSize) return StaticSize; + if (StaticSize != DynamicSize) return StaticSize; /*--- dynamic row vector, swap size specification ---*/ - if(StaticRows==1 && IsVector) {cols = rows; rows = 1;} + if (StaticRows == 1 && IsVector) { + cols = rows; + rows = 1; + } /*--- assert a static size is not being asked to change ---*/ - if(StaticRows!=DynamicSize) assert(rows==StaticRows && "A static size was asked to change."); - if(StaticCols!=DynamicSize) assert(cols==StaticCols && "A static size was asked to change."); + if (StaticRows != DynamicSize) assert(rows == StaticRows && "A static size was asked to change."); + if (StaticCols != DynamicSize) assert(cols == StaticCols && "A static size was asked to change."); /*--- "rectify" sizes before continuing as asserts are usually dissabled ---*/ - rows = (StaticRows!=DynamicSize)? StaticRows : rows; - cols = (StaticCols!=DynamicSize)? StaticCols : cols; + rows = (StaticRows != DynamicSize) ? StaticRows : rows; + cols = (StaticCols != DynamicSize) ? StaticCols : cols; /*--- number of requested elements ---*/ - size_t reqSize = rows*cols; + size_t reqSize = rows * cols; /*--- compare with current dimensions to determine if deallocation is needed, also makes the container safe against self assignment no need to check for 0 size as the allocators handle that ---*/ - if(rows==this->rows() && cols==this->cols()) - return reqSize; + if (rows == this->rows() && cols == this->cols()) return reqSize; m_destroy(); /*--- request actual allocation to base class as it needs specialization ---*/ - size_t bytes = reqSize*sizeof(Scalar_t); - m_allocate(bytes,rows,cols); + size_t bytes = reqSize * sizeof(Scalar_t); + m_allocate(bytes, rows, cols); return reqSize; } -public: + public: /*! * \brief Default ctor. */ @@ -509,27 +491,22 @@ class C2DContainer : * \brief Sizing ctor (no initialization of data). * For matrices size1 is rows and size2 columns, for vectors size1 is lenght and size2 is ignored. */ - C2DContainer(const Index_t size1, const Index_t size2 = 1) noexcept : Base() - { - m_resize(size1,size2); - } + C2DContainer(const Index_t size1, const Index_t size2 = 1) noexcept : Base() { m_resize(size1, size2); } /*! * \brief Copy ctor. */ - C2DContainer(const C2DContainer& other) noexcept : Base() - { - size_t sz = m_resize(other.rows(),other.cols()); - for(size_t i=0; i - FORCEINLINE CInnerIterGather > innerIter(simd::Array row) const noexcept - { - return CInnerIterGather >(m_data, IsRowMajor? 1 : rows(), IsRowMajor? row*cols() : row); + template + FORCEINLINE CInnerIterGather > innerIter(simd::Array row) const noexcept { + return CInnerIterGather >(m_data, IsRowMajor ? 1 : rows(), IsRowMajor ? row * cols() : row); } /*! @@ -594,33 +566,31 @@ class C2DContainer : * \param[in] row - Row of the matrix. * \param[in] start - Starting column to copy the data (amount determined by container size). */ - template - FORCEINLINE StaticContainer get(Index_t row, Index_t start = 0) const noexcept - { + template + FORCEINLINE StaticContainer get(Index_t row, Index_t start = 0) const noexcept { constexpr size_t Size = StaticContainer::StaticSize; static_assert(Size, "This method requires a static output type."); - assert(Size <= cols()-start); + assert(Size <= cols() - start); StaticContainer ret; SU2_OMP_SIMD - for (size_t i=0; i - FORCEINLINE StaticContainer get(simd::Array row, Index_t start = 0) const noexcept - { + template + FORCEINLINE StaticContainer get(simd::Array row, Index_t start = 0) const noexcept { constexpr size_t Size = StaticContainer::StaticSize; static_assert(Size, "This method requires a static output type."); - assert(Size <= cols()-start); + assert(Size <= cols() - start); StaticContainer ret; - for (size_t k=0; k using su2vector = C2DContainer; -template using su2matrix = C2DContainer; -template using ColMajorMatrix = C2DContainer; +template +using su2vector = C2DContainer; +template +using su2matrix = C2DContainer; +template +using ColMajorMatrix = C2DContainer; using su2activevector = su2vector; using su2activematrix = su2matrix; @@ -639,4 +612,4 @@ using su2activematrix = su2matrix; using su2passivevector = su2vector; using su2passivematrix = su2matrix; -/// @} \ No newline at end of file +/// @} diff --git a/Common/include/containers/CFastFindAndEraseQueue.hpp b/Common/include/containers/CFastFindAndEraseQueue.hpp index 01b24044e60..cd4a528d883 100644 --- a/Common/include/containers/CFastFindAndEraseQueue.hpp +++ b/Common/include/containers/CFastFindAndEraseQueue.hpp @@ -3,7 +3,7 @@ * \brief A queue-type container (push back, pop front), but with * fast deletion of arbitrary items (possibly in the middle). * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -43,19 +43,18 @@ * \param[in] CleanupThreshold - Number of marked items that triggers full cleanup. * \note It would not be a good idea to use non-trivial item types. */ -template::max(), - size_t CleanupThreshold = 8192> +template ::max(), + size_t CleanupThreshold = 8192> class CFastFindAndEraseQueue { -public: - enum {ErasedValue = ErasedValue_}; + public: + enum { ErasedValue = ErasedValue_ }; using ItemType = ItemType_; using Iterator = typename std::vector::const_iterator; -private: + private: size_t erasedCounter = 0; /*!< \brief How many items have been marked since last cleanup. */ std::vector items; /*!< \brief The stored items. */ - std::unordered_map indexes; /*!< \brief Map items to their location. */ + std::unordered_map indexes; /*!< \brief Map items to their location. */ /*! * \brief Cleanup, shifts non-erased items forward, re-mapping them. @@ -74,7 +73,7 @@ class CFastFindAndEraseQueue { erasedCounter = 0; } -public: + public: /*! * \brief Default construct. */ @@ -85,7 +84,7 @@ class CFastFindAndEraseQueue { */ CFastFindAndEraseQueue(size_t N) { items.resize(N); - for (size_t i=0; isecond; assert(items[idx] != ErasedValue && "The item was already erased?!"); @@ -139,5 +139,4 @@ class CFastFindAndEraseQueue { return true; } - }; diff --git a/Common/include/containers/CFileReaderLUT.hpp b/Common/include/containers/CFileReaderLUT.hpp index f7cd028d2cd..bd1c64d2844 100644 --- a/Common/include/containers/CFileReaderLUT.hpp +++ b/Common/include/containers/CFileReaderLUT.hpp @@ -2,7 +2,7 @@ * \file CFileReaderLUT.hpp * \brief reading lookup table for tabulated fluid properties * \author D. Mayer, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -42,27 +42,28 @@ class CFileReaderLUT { protected: int rank; + unsigned short table_dim = 2; std::string version_lut; std::string version_reader; - unsigned long n_points; - unsigned long n_triangles; - unsigned long n_hull_points; + unsigned long n_levels = 1; + su2vector n_points, n_triangles, n_hull_points; + unsigned long n_variables; + su2vector table_levels; /*! \brief Holds the variable names stored in the table file. * Order is in sync with tableFlamelet. */ - std::vector names_var; + su2vector names_var; /*! \brief Holds all data stored in the table. * First index addresses the variable while second index addresses the point. */ - su2activematrix table_data; - - su2matrix triangles; + su2vector table_data; - std::vector hull; + su2vector> triangles; + su2vector> hull; /*! \brief Searches for the position of flag in file_stream and * sets the stream position of file_stream to that position. */ @@ -78,22 +79,74 @@ class CFileReaderLUT { bool GetStrippedLine(std::ifstream& file_stream, std::string& line) const; public: - CFileReaderLUT(){}; - + /*! \brief Get table version as listed in input file. + */ inline const std::string& GetVersionLUT() const { return version_lut; } + + /*! \brief Get table reader version. + */ inline const std::string& GetVersionReader() const { return version_reader; } - inline unsigned long GetNPoints() const { return n_points; } - inline unsigned long GetNTriangles() const { return n_triangles; } - inline unsigned long GetNHullPoints() const { return n_hull_points; } + + /*! \brief Get number of data points at specific table level. + * \param[in] i_level - table level index. + * \returns data point count at table level. + */ + inline unsigned long GetNPoints(std::size_t i_level = 0) const { return n_points[i_level]; } + + /*! \brief Get number of triangles at specific table level. + * \param[in] i_level - table level index. + * \returns triangle count at table level. + */ + inline unsigned long GetNTriangles(std::size_t i_level = 0) const { return n_triangles[i_level]; } + + /*! \brief Get number of hull points at specific table level. + * \param[in] i_level - table level index. + * \returns hull point count at table level. + */ + inline unsigned long GetNHullPoints(std::size_t i_level = 0) const { return n_hull_points[i_level]; } + + /*! \brief Get number of variables for which data is stored in the table + */ inline unsigned long GetNVariables() const { return n_variables; } - inline const std::vector& GetNamesVar() const { return names_var; } + /*! \brief Get number of table levels. + */ + inline unsigned long GetNLevels() const { return n_levels; } + + /*! \brief Get variable names for which data is stored in the table + */ + inline const su2vector& GetNamesVar() const { return names_var; } + + /*! \brief Get table data at a specific level. + * \param[in] i_level - table level index. + * \returns table data + */ + inline const su2activematrix& GetTableData(std::size_t i_level = 0) const { return table_data[i_level]; } + + /*! \brief Get table connectivity at a specific level. + * \param[in] i_level - table level index. + * \returns data connectivity + */ + inline const su2matrix& GetTriangles(std::size_t i_level = 0) const { return triangles[i_level]; } - inline const su2activematrix& GetTableData() const { return table_data; } + /*! \brief Get hull node information at a specific table level. + * \param[in] i_level - table level index. + * \returns hull node indices. + */ + inline const su2vector& GetHull(std::size_t i_level = 0) const { return hull[i_level]; } - inline const su2matrix& GetTriangles() const { return triangles; }; + /*! \brief Get table level value. + * \param[in] i_level - table level index. + * \returns value of the third controlling variable at table level. + */ + inline su2double GetTableLevel(std::size_t i_level) const { return table_levels[i_level]; } - inline const std::vector& GetHull() const { return hull; }; + /*! \brief Get table dimension + */ + inline unsigned short GetTableDim() const { return table_dim; } + /*! \brief Read LUT file and store information + * \param[in] file_name - LUT input file name. + */ void ReadRawLUT(const std::string& file_name); }; diff --git a/Common/include/containers/CLookUpTable.hpp b/Common/include/containers/CLookUpTable.hpp index aa0fe41cde0..102f69d1db1 100644 --- a/Common/include/containers/CLookUpTable.hpp +++ b/Common/include/containers/CLookUpTable.hpp @@ -2,7 +2,7 @@ * \file CLookupTable.hpp * \brief tabulation of fluid properties * \author D. Mayer, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,10 +27,10 @@ #pragma once +#include #include #include #include -#include #include "../../Common/include/option_structure.hpp" #include "CFileReaderLUT.hpp" @@ -44,51 +44,69 @@ class CLookUpTable { protected: int rank; /*!< \brief MPI Rank. */ - std::string file_name_lut; - std::string version_lut; - std::string version_reader; - unsigned long n_points; - unsigned long n_triangles; - unsigned long n_variables; - unsigned long n_hull_points; + std::string file_name_lut, /*!< \brief LUT file name.*/ + version_lut, /*!< \brief LUT version as specified in LUT file.*/ + version_reader, /*!< \brief Reader version (should be equal or above LUT version).*/ + name_CV1, /*!< \brief Name of controlling variable 1.*/ + name_CV2; /*!< \brief Name of xontrolling variable 2.*/ + + su2vector n_points, /*!< \brief Number of data poins per table level.*/ + n_triangles, /*!< \brief Number of triangles per table level.*/ + n_hull_points; /*!< \brief Number of outer boundary points per table level.*/ + + unsigned long n_variables, n_table_levels = 1; + su2vector z_values_levels; /*!< \brief Constant z-values of each table level.*/ + + unsigned short table_dim = 2; /*!< \brief Table dimension.*/ /*! - * \brief the lower and upper limits of the enthalpy and progress variable. + * \brief The lower and upper limits of the z, y and x variable for each table level. */ - su2double limits_table_enth[2]; - su2double limits_table_prog[2]; + std::pair limits_table_z; + su2vector> limits_table_y, limits_table_x; /*! \brief Holds the variable names stored in the table file. - * Order is in sync with data + * Order is in sync with data. */ - std::vector names_var; + su2vector names_var; /*! \brief * Holds all data stored in the table. First index addresses the variable * while second index addresses the point. */ - su2activematrix table_data; + su2vector table_data; - su2matrix triangles; + double memory_footprint_data = 0; /*!< \brief Memory footprint of the loaded table data. */ - /* we do not know this size in advance until we go through the entire lookup table */ - std::vector > edges; - std::vector > edge_to_triangle; + /*! \brief + * Holds all connectivity data stored in the table for each level. First index + * addresses the variable while second index addresses the point. + */ + su2vector> triangles; + + /*! \brief + * Edge information for each table level. + */ + su2vector>> edges; + su2vector>> edge_to_triangle; /*! \brief * The hull contains the boundary of the lookup table. */ - std::vector hull; + su2vector> hull; - CTrapezoidalMap trap_map_prog_enth; + /*! \brief + * Trapezoidal map objects for the table levels. + */ + su2vector trap_map_x_y; /*! \brief - * vector of all the weight factors for the interpolation. + * Vector of all the weight factors for the interpolation. */ - std::vector interp_mat_inv_prog_enth; + su2vector> interp_mat_inv_x_y; /*! \brief - * returns the index to the variable in the lookup table. + * Returns the index to the variable in the lookup table. */ inline unsigned int GetIndexOfVar(const std::string& nameVar) const { int index = find(names_var.begin(), names_var.end(), nameVar) - names_var.begin(); @@ -102,171 +120,257 @@ class CLookUpTable { return index; } + /*! \brief + * Returns true if the string is null or zero (ignores case). + */ + inline bool noSource(const std::string& name_var) const { + if (name_var.compare("NULL") == 0 || name_var.compare("Null") == 0 || name_var.compare("null") == 0 || + name_var.compare("ZERO") == 0 || name_var.compare("Zero") == 0 || name_var.compare("zero") == 0) { + return true; + } else { + return false; + } + } + /*! * \brief Get the pointer to the column data of the table (density, temperature, source terms, ...). - * \returns pointer to the column data. + * \returns Pointer to the column data. */ - inline const su2double* GetDataP(const std::string& name_var) const { - return table_data[GetIndexOfVar(name_var)]; + inline const su2double* GetDataP(const std::string& name_var, unsigned long i_level = 0) const { + return table_data[i_level][GetIndexOfVar(name_var)]; } /*! - * \brief find the table limits, i.e. the minimum and maximum values of the 2 independent. - * controlling variables (progress variable and enthalpy). We put the values in the variables. - * limits_table_prog[2] and limit_table_enth[2]. - * \param[in] name_prog - the string name for the first controlling variable. - * \param[in] name_enth - the string name of the second controlling variable. + * \brief Find the table limits, i.e. the minimum and maximum values of the 2 independent + * controlling variables. We put the values in the variables. + * limits_table_x[2] and limit_table_y[2]. + * \param[in] name_CV1 - The string name for the first controlling variable. + * \param[in] name_CV2 - The string name of the second controlling variable. */ - void FindTableLimits(const std::string& name_prog, const std::string& name_enth); + void FindTableLimits(const std::string& name_CV1, const std::string& name_CV2); /*! - * \brief construct a list of all the edges and a list of the pair of elements left and right of the edge. + * \brief Construct a list of all the edges and a list of the pair of elements left and right of the edge. */ void IdentifyUniqueEdges(); /*! - * \brief read the lookup table from file and store the data. + * \brief Read the lookup table from file and store the data. * \param[in] file_name_lut - the filename of the lookup table. - */ + */ void LoadTableRaw(const std::string& file_name_lut); /*! - * \brief compute vector of all (inverse) interpolation coefficients "interp_mat_inv_prog_enth" of all triangles. - * \param[in] name_prog - the string name of the first controlling variable (progress variable). - * \param[in] name_enth - the string name of the second controlling variable (enthalpy). - */ - void ComputeInterpCoeffs(const std::string& name_prog, const std::string& name_enth); + * \brief Compute vector of all (inverse) interpolation coefficients "interp_mat_inv_x_y" of all triangles. + */ + void ComputeInterpCoeffs(); /*! - * \brief compute the inverse matrix for interpolation. - * \param[in] vec_x - pointer to first coordinate (progress variable). - * \param[in] vec_y - pointer to second coordinate (enthalpy). - * \param[in] point_ids - single triangle data. - * \param[out] interp_mat_inv - inverse matrix for interpolation. - */ - void GetInterpMatInv(const su2double* vec_x, const su2double* vec_y, std::array& point_ids, + * \brief Compute the inverse matrix for interpolation. + * \param[in] vec_CV1 - Pointer to first coordinate (progress variable). + * \param[in] vec_CV2 - Pointer to second coordinate (enthalpy). + * \param[in] point_ids - Single triangle data. + * \param[out] interp_mat_inv - Inverse matrix for interpolation. + */ + void GetInterpMatInv(const su2double* vec_CV1, const su2double* vec_CV2, std::array& point_ids, su2activematrix& interp_mat_inv); /*! - * \brief compute the interpolation coefficients for the triangular interpolation. - * \param[in] val_x - value of first coordinate (progress variable). - * \param[in] val_y - value of second coordinate (enthalpy). - * \param[in] interp_mat_inv - inverse matrix for interpolation. - * \param[out] interp_coeffs - interpolation coefficients. - */ - void GetInterpCoeffs(su2double val_x, su2double val_y, su2activematrix& interp_mat_inv, - std::array& interp_coeffs); + * \brief Compute the interpolation coefficients for the triangular interpolation. + * \param[in] val_CV1 - Value of first coordinate (progress variable). + * \param[in] val_CV2 - Value of second coordinate (enthalpy). + * \param[in] interp_mat_inv - Inverse matrix for interpolation. + * \param[out] interp_coeffs - Interpolation coefficients. + */ + void GetInterpCoeffs(su2double val_CV1, su2double val_CV2, su2activematrix& interp_mat_inv, + std::array& interp_coeffs); /*! - * \brief compute interpolated value of a point P in the triangle. - * \param[in] val_samples - pointer to the variable data. + * \brief Compute interpolated value of a point P in the triangle. + * \param[in] val_samples - Pointer to the variable data. * \param[in] val_triangle - ID to the triangle. - * \param[in] val_interp_coeffs - interpolation coefficients using the point data in P. - * \returns resulting value of the interpolation. - */ - su2double Interpolate(const su2double* val_samples, std::array& val_triangle, - std::array& val_interp_coeffs); + * \param[in] val_interp_coeffs - Interpolation coefficients using the point data in P. + * \returns Resulting value of the interpolation. + */ + su2double Interpolate(const su2double* val_samples, std::array& val_triangle, + std::array& val_interp_coeffs); + + /*! + * \brief Perform linear interpolation between two table levels for a single variable. + * \param[in] val_CV3 - Value of the third controlling variable at the query point. + * \param[in] lower_level - Table level index of the table level directly below the query point. + * \param[in] upper_level - Table level index of the table level directly above the query point. + * \param[in] lower_value - Result from x-y interpolation on the lower table level. + * \param[in] upper_value - Result from x-y interpolation on the upper table level. + * \param[in] val_vars - Pointer to interpolation result. + */ + void Linear_Interpolation(const su2double val_CV3, const unsigned long lower_level, const unsigned long upper_level, + su2double& lower_value, su2double& upper_value, su2double*& var_vals) const; /*! - * \brief find the point on the hull (boundary of the table) that is closest to the point P(val_prog,val_enth). - * \param[in] val_x - first coordinate of point P(val_x,val_y) to check. - * \param[in] val_y - second coordinate of point P(val_x,val_y) to check. - * \param[in] name_prog - string name of the first controlling variable. - * \param[in] name_enth - string name of the second controlling variable. - * \returns point id of the nearest neighbor on the hull. + * \brief Perform linear interpolation between two table levels for a vector of variables. + * \param[in] val_CV3 - Value of the third controlling variable at the query point. + * \param[in] lower_level - Table level index of the table level directly below the query point. + * \param[in] upper_level - Table level index of the table level directly above the query point. + * \param[in] lower_values - Results from x-y interpolation on the lower table level. + * \param[in] upper_values - Results from x-y interpolation on the upper table level. + * \param[in] val_vars - Pointer to interpolation results for all interpolation variables. */ - unsigned long FindNearestNeighborOnHull(su2double val_prog, su2double val_enth, const std::string& name_prog, const std::string& name_enth); + void Linear_Interpolation(const su2double val_CV3, const unsigned long lower_level, const unsigned long upper_level, + std::vector& lower_values, std::vector& upper_values, + std::vector& var_vals) const; /*! - * \brief determine if a point P(val_x,val_y) is inside the triangle val_id_triangle. - * \param[in] val_x - first coordinate of point P(val_x,val_y) to check. - * \param[in] val_y - second coordinate of point P(val_x,val_y) to check. + * \brief Find the point on the hull (boundary of the table) that is closest to the point P(val_CV1,val_CV2). + * \param[in] val_CV1 - First coordinate of point P(val_CV1,val_CV2) to check. + * \param[in] val_CV2 - Second coordinate of point P(val_CV1,val_CV2) to check. + * \returns Point id of the nearest neighbor on the hull. + */ + unsigned long FindNearestNeighborOnHull(su2double val_CV1, su2double val_CV2, unsigned long i_level = 0); + + /*! + * \brief Interpolate data based on distance-weighted averaging on the nearest two table nodes. + * \param[in] val_CV1 - First coordinate of point P(val_CV1,val_CV2) to check. + * \param[in] val_CV2 - Second coordinate of point P(val_CV1,val_CV2) to check. + * \param[in] val_names_var - Vector of string names of the variables to look up. + * \param[out] val_vars - Pointer to the vector of stored values of the variables to look up. + */ + void InterpolateToNearestNeighbors(const su2double val_CV1, const su2double val_CV2, + const std::vector& names_var, std::vector& var_vals, + const unsigned long i_level = 0); + + /*! + * \brief Interpolate data based on distance-weighted averaging on the nearest two table nodes for a single variable. + * \param[in] val_CV1 - First coordinate of point P(val_CV1,val_CV2) to check. + * \param[in] val_CV2 - Second coordinate of point P(val_CV1,val_CV2) to check. + * \param[in] name_var - Variable name to look up. + * \param[out] var_val - Pointer to the to be interpolated variable. + */ + void InterpolateToNearestNeighbors(const su2double val_CV1, const su2double val_CV2, const std::string& name_var, + su2double* var_val, const unsigned long i_level = 0); + + /*! + * \brief Determine if a point P(val_CV1,val_CV2) is inside the triangle val_id_triangle. + * \param[in] val_CV1 - First coordinate of point P(val_CV1,val_CV2) to check. + * \param[in] val_CV2 - Second coordinate of point P(val_CV1,val_CV2) to check. * \param[in] val_id_triangle - ID of the triangle to check. - * \param[in] name_prog - string name of the first controlling variable. - * \param[in] name_enth - string name of the second controlling variable. - * \returns true if the point is in the triangle, false if it is outside. + * \returns True if the point is in the triangle, false if it is outside. */ - bool IsInTriangle(su2double val_x, su2double val_y, unsigned long val_id_triangle, const std::string& name_prog, - const std::string& name_enth); + bool IsInTriangle(su2double val_CV1, su2double val_CV2, unsigned long val_id_triangle, unsigned long i_level = 0); /*! - * \brief compute the area of a triangle given the 3 points of the triangle. - * \param[in] x1 - the coordinates of the points P1(x1,y1), P2(x2,y2) and P3(x3,y3). - * \param[in] y1 - the coordinates of the points P1(x1,y1), P2(x2,y2) and P3(x3,y3). - * \param[in] x2 - the coordinates of the points P1(x1,y1), P2(x2,y2) and P3(x3,y3). - * \param[in] y2 - the coordinates of the points P1(x1,y1), P2(x2,y2) and P3(x3,y3). - * \param[in] x3 - the coordinates of the points P1(x1,y1), P2(x2,y2) and P3(x3,y3). - * \param[in] y3 - the coordinates of the points P1(x1,y1), P2(x2,y2) and P3(x3,y3). - * \returns the absolute value of the area of the triangle. + * \brief Compute the area of a triangle given the 3 points of the triangle. + * \param[in] x1 - The coordinates of the points P1(x1,y1), P2(x2,y2) and P3(x3,y3). + * \param[in] y1 - The coordinates of the points P1(x1,y1), P2(x2,y2) and P3(x3,y3). + * \param[in] x2 - The coordinates of the points P1(x1,y1), P2(x2,y2) and P3(x3,y3). + * \param[in] y2 - The coordinates of the points P1(x1,y1), P2(x2,y2) and P3(x3,y3). + * \param[in] x3 - The coordinates of the points P1(x1,y1), P2(x2,y2) and P3(x3,y3). + * \param[in] y3 - The coordinates of the points P1(x1,y1), P2(x2,y2) and P3(x3,y3). + * \returns The absolute value of the area of the triangle. */ inline su2double TriArea(su2double x1, su2double y1, su2double x2, su2double y2, su2double x3, su2double y3) { return abs((x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2)) * 0.5); } - public: - CLookUpTable(const std::string& file_name_lut, const std::string& name_prog, const std::string& name_enth); + /*! + * \brief Compute the values of the first and second controlling variable based on normalized query coordinates + * \param[in] inclusion_levels - Pair containing lower(first) and upper(second) table inclusion level indices. + * \param[in] val_CV1 - First controlling variable value. + * \param[in] val_CV2 - Second controlling variable value. + * \param[in] val_CV3 - Third controlling variable value. + * \returns Array with first and second controlling variable values for the upper and lower table inclusion levels. + */ + std::array, 2> ComputeNormalizedXY(std::pair& inclusion_levels, + const su2double val_CV1, const su2double val_CV2, + const su2double val_CV3); + public: + CLookUpTable(const std::string& file_name_lut, std::string name_CV1_in, std::string name_CV2_in); /*! - * \brief print information to screen. + * \brief Print information to screen. */ void PrintTableInfo(); /*! - * \brief lookup 1 value of the single variable "val_name_var" using controlling variable values(val_prog,val_enth) - * whose controlling variable names are "name_prog" and "name_enth". - * \param[in] val_name_var - string name of the variable to look up. - * \param[out] val_var - the stored value of the variable to look up. - * \param[in] val_prog - value of controlling variable 1 (progress variable). - * \param[in] val_enth - value of controlling variable 2 (enthalpy). - * \param[in] name_prog - string name of controlling variable 1 (progress variable). - * \param[in] name_enth - string name of controlling variable 2 (enthalpy). + * \brief Lookup 1 value of the single variable "val_name_var" using controlling variable values(val_CV1,val_CV2). + * \param[in] val_name_var - String name of the variable to look up. + * \param[out] val_var - The stored value of the variable to look up. + * \param[in] val_CV1 - Value of controlling variable 1. + * \param[in] val_CV2 - Value of controlling variable 2. * \returns 1 if the lookup and subsequent interpolation was a success, 0 if not. */ - unsigned long LookUp_ProgEnth(const std::string& val_name_var, su2double* val_var, su2double val_prog, su2double val_enth, - const std::string& name_prog, const std::string& name_enth); + unsigned long LookUp_XY(const std::string& val_name_var, su2double* val_var, su2double val_CV1, su2double val_CV2, + unsigned long i_level = 0); /*! - * \brief lookup 1 value for each of the variables in "val_name_var" using controlling variable values(val_prog,val_enth) - * whose controlling variable names are "name_prog" and "name_enth". + * \brief Lookup 1 value for each of the variables in "val_name_var" using controlling variable + * values(val_CV1,val_CV2). * \param[in] val_names_var - vector of string names of the variables to look up. * \param[out] val_vars - pointer to the vector of stored values of the variables to look up. - * \param[in] val_prog - value of controlling variable 1 (progress variable). - * \param[in] val_enth - value of controlling variable 2 (enthalpy). - * \param[in] name_prog - string name of controlling variable 1 (progress variable). - * \param[in] name_enth - string name of controlling variable 2 (enthalpy). + * \param[in] val_CV1 - value of controlling variable 1. + * \param[in] val_CV2 - value of controlling variable 2. + * \returns 1 if the lookup and subsequent interpolation was a success, 0 if not. + */ + unsigned long LookUp_XY(const std::vector& val_names_var, std::vector& val_vars, + su2double val_CV1, su2double val_CV2, unsigned long i_level = 0); + + /*! + * \brief Lookup the value of the variable "val_name_var" using controlling variable values(val_CV1,val_CV2). + * \param[in] val_name_var - String name of the variable to look up. + * \param[out] val_var - The stored value of the variable to look up. + * \param[in] val_CV1 - Value of controlling variable 1. + * \param[in] val_CV2 - Value of controlling variable 2. + * \returns 1 if the lookup and subsequent interpolation was a success, 0 if not. + */ + unsigned long LookUp_XY(const std::vector& val_names_var, std::vector& val_vars, + su2double val_CV1, su2double val_CV2, unsigned long i_level = 0); + + /*! + * \brief Lookup the value of the variable "val_name_var" using controlling variable values(val_CV1,val_CV2,val_z). + * \param[in] val_name_var - String name of the variable to look up. + * \param[out] val_var - The stored value of the variable to look up. + * \param[in] val_CV1 - Value of controlling variable 1. + * \param[in] val_CV2 - Value of controlling variable 2. + * \param[in] val_CV3 - Value of controlling variable 3. * \returns 1 if the lookup and subsequent interpolation was a success, 0 if not. */ - unsigned long LookUp_ProgEnth(const std::vector& val_names_var, std::vector& val_vars, su2double val_prog, - su2double val_enth, const std::string& name_prog, const std::string& name_enth); + unsigned long LookUp_XYZ(const std::string& val_name_var, su2double* val_var, su2double val_CV1, su2double val_CV2, + su2double val_CV3); /*! - * \brief lookup the value of the variable "val_name_var" using controlling variable values(val_prog,val_enth) - * whose controlling variable names are "name_prog" and "name_enth". - * \param[in] val_name_var - string name of the variable to look up. - * \param[out] val_var - the stored value of the variable to look up. - * \param[in] val_prog - value of controlling variable 1 (progress variable). - * \param[in] val_enth - value of controlling variable 2 (enthalpy). - * \param[in] name_prog - string name of controlling variable 1 (progress variable). - * \param[in] name_enth - string name of controlling variable 2 (enthalpy). + * \brief Lookup the value of the variable "val_name_var" using controlling variable values(val_CV1,val_CV2,val_z). + * \param[in] val_name_var - String name of the variable to look up. + * \param[out] val_var - The stored value of the variable to look up. + * \param[in] val_CV1 - Value of controlling variable 1. + * \param[in] val_CV2 - Value of controlling variable 2. + * \param[in] val_CV3 - Value of controlling variable 3. * \returns 1 if the lookup and subsequent interpolation was a success, 0 if not. */ - unsigned long LookUp_ProgEnth(const std::vector& val_names_var, std::vector& val_vars, su2double val_prog, - su2double val_enth, const std::string& name_prog, const std::string& name_enth); + unsigned long LookUp_XYZ(const std::vector& val_names_var, std::vector& val_vars, + su2double val_CV1, su2double val_CV2, su2double val_CV3 = 0); + + /*! + * \brief Find the table levels with constant z-values directly above and below query val_z. + * \param[in] val_CV3 - Value of controlling variable 3. + * \param[in] within_limits - Whether query point lies within table bounds. + * \returns Pair of inclusion level indices (first = lower level index, second = upper level index). + */ + std::pair FindInclusionLevels(const su2double val_CV3); /*! - * \brief determine the minimum and maximum value of the enthalpy (controlling variable 2). - * \returns pair of minimum and maximum value of controlling variable 2. + * \brief Determine the minimum and maximum value of the second controlling variable. + * \returns Pair of minimum and maximum value of controlling variable 2. */ - inline std::pair GetTableLimitsEnth() const { - return std::make_pair(limits_table_enth[0], limits_table_enth[1]); + inline std::pair GetTableLimitsY(unsigned long i_level = 0) const { + return limits_table_y[i_level]; } /*! - * \brief determine the minimum and maximum value of the progress variable (controlling variable 1). - * \returns pair of minimum and maximum value of controlling variable 1. + * \brief Determine the minimum and maximum value of the first controlling variable. + * \returns Pair of minimum and maximum value of controlling variable 1. */ - inline std::pair GetTableLimitsProg() const { - return std::make_pair(limits_table_prog[0], limits_table_prog[1]); + inline std::pair GetTableLimitsX(unsigned long i_level = 0) const { + return limits_table_x[i_level]; } }; diff --git a/Common/include/containers/CPyWrapperMatrixView.hpp b/Common/include/containers/CPyWrapperMatrixView.hpp new file mode 100644 index 00000000000..67562065978 --- /dev/null +++ b/Common/include/containers/CPyWrapperMatrixView.hpp @@ -0,0 +1,165 @@ +/*! + * \file CPyWrapperMatrixView.hpp + * \brief Simple matrix views to use with the python wrapper. + * \author P. Gomes + * \version 8.0.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include +#include +#include + +#include "../geometry/dual_grid/CVertex.hpp" +#include "../parallelization/mpi_structure.hpp" +#include "C2DContainer.hpp" + +/*! + * \brief Python wrapper matrix interface + * The accessors in this macro provide a passive double interface to matrix of + * su2double. This can be extended to allow access to derivative information. + * Classes that use this macro encapsulate the access to the raw data (su2double) + * via the functions "Access(row, col) -> su2double&" (const and non-const versions). + * We use a macro because it is diffult to use modern C++ idioms (e.g. CRTP) with + * SWIG. In addition to "Access" classes must have member variables "rows_", "cols_", + * and "read_only_". + */ +#define PY_WRAPPER_MATRIX_INTERFACE \ + /*! \brief Returns the shape of the matrix. */ \ + std::pair Shape() const { return std::make_pair(rows_, cols_); } \ + \ + /*! \brief Returns whether the data is read-only [true] or if it can be modified [false]. */ \ + bool IsReadOnly() const { return read_only_; } \ + \ + /*! \brief Gets the value for a (row, column) pair. */ \ + passivedouble operator()(unsigned long row, unsigned long col) const { return Get(row, col); } \ + \ + /*! \brief Gets the value for a (row, column) pair. */ \ + passivedouble Get(unsigned long row, unsigned long col) const { return SU2_TYPE::GetValue(Access(row, col)); } \ + \ + /*! \brief Gets the values for a row of the matrix. */ \ + std::vector Get(unsigned long row) const { \ + std::vector vals(cols_); \ + for (unsigned long j = 0; j < cols_; ++j) vals[j] = Get(row, j); \ + return vals; \ + } \ + /*! \brief Sets the value for a (row, column) pair. This clears derivative information. */ \ + void Set(unsigned long row, unsigned long col, passivedouble val) { Access(row, col) = val; } \ + \ + /*! \brief Sets the values for a row of the matrix. */ \ + void Set(unsigned long row, std::vector vals) { \ + unsigned long j = 0; \ + for (const auto& val : vals) Set(row, j++, val); \ + } + +/*! + * \class CPyWrapperMatrixView + * \ingroup PySU2 + * \brief This class wraps su2activematrix for the python wrapper matrix interface. + * It is generaly used to wrap access to solver variables defined for the entire volume. + */ +class CPyWrapperMatrixView { + protected: + static_assert(su2activematrix::IsRowMajor, ""); + su2double* data_ = nullptr; + unsigned long rows_ = 0, cols_ = 0; + std::string name_; + bool read_only_ = false; + + /*--- Define the functions required by the interface macro. ---*/ + inline const su2double& Access(unsigned long row, unsigned long col) const { + if (row > rows_ || col > cols_) SU2_MPI::Error(name_ + " out of bounds", "CPyWrapperMatrixView"); + return data_[row * cols_ + col]; + } + inline su2double& Access(unsigned long row, unsigned long col) { + if (read_only_) SU2_MPI::Error(name_ + " is read-only", "CPyWrapperMatrixView"); + const auto& const_me = *this; + return const_cast(const_me.Access(row, col)); + } + + public: + CPyWrapperMatrixView() = default; + + /*! + * \brief Construct the view of the matrix. + * \note "name" should be set to the variable name being returned to give better information to users. + * \note "read_only" can be set to true to prevent the data from being modified. + */ + CPyWrapperMatrixView(su2activematrix& mat, const std::string& name, bool read_only) + : data_(mat.data()), rows_(mat.rows()), cols_(mat.cols()), name_(name), read_only_(read_only) {} + + /*--- Use the macro to generate the interface. ---*/ + PY_WRAPPER_MATRIX_INTERFACE +}; + +/*! + * \class CPyWrapperMarkerMatrixView + * \ingroup PySU2 + * \brief This class wraps su2activematrix for the python wrapper matrix interface restricting it + * to the vertices of a given marker. + */ +class CPyWrapperMarkerMatrixView { + private: + static_assert(su2activematrix::IsRowMajor, ""); + su2double* data_ = nullptr; + const CVertex* const* vertices_ = nullptr; + unsigned long rows_ = 0, cols_ = 0; + std::string name_; + bool read_only_ = false; + + /*--- Define the functions required by the interface macro. ---*/ + inline const su2double& Access(unsigned long row, unsigned long col) const { + if (row > rows_ || col > cols_) SU2_MPI::Error(name_ + " out of bounds", "CPyWrapperMarkerMatrixView"); + return data_[vertices_[row]->GetNode() * cols_ + col]; + } + inline su2double& Access(unsigned long row, unsigned long col) { + if (read_only_) SU2_MPI::Error(name_ + " is read-only", "CPyWrapperMarkerMatrixView"); + const auto& const_me = *this; + return const_cast(const_me.Access(row, col)); + } + + public: + CPyWrapperMarkerMatrixView() = default; + + /*! + * \brief Construct the view of the matrix. + * \note "name" should be set to the variable name being returned to give better information to users. + * \note "read_only" can be set to true to prevent the data from being modified. + */ + CPyWrapperMarkerMatrixView(su2activematrix& mat, const CVertex* const* vertices, unsigned long n_vertices, + const std::string& name, bool read_only) + : data_(mat.data()), + vertices_(vertices), + rows_(n_vertices), + cols_(mat.cols()), + name_(name), + read_only_(read_only) { + if (mat.rows() < n_vertices) { + SU2_MPI::Error(name + " has fewer rows than the number of vertices in the marker.", "CPyWrapperMarkerMatrixView"); + } + } + + /*--- Use the macro to generate the interface. ---*/ + PY_WRAPPER_MATRIX_INTERFACE +}; diff --git a/Common/include/containers/CTrapezoidalMap.hpp b/Common/include/containers/CTrapezoidalMap.hpp index 4add47457f8..c5f99f1bb3f 100644 --- a/Common/include/containers/CTrapezoidalMap.hpp +++ b/Common/include/containers/CTrapezoidalMap.hpp @@ -2,7 +2,7 @@ * \file CTrapezoidalMap.hpp * \brief Implementation of the trapezoidal map for tabulation and lookup of fluid properties * \author D. Mayer, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -38,32 +38,30 @@ * \ingroup LookUpInterp * \brief Construction of trapezoidal map for tabulated lookup * \author: D. Mayer, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ - class CTrapezoidalMap { +class CTrapezoidalMap { protected: - /* The unique values of x which exist in the data */ std::vector unique_bands_x; su2activematrix edge_limits_x; su2activematrix edge_limits_y; - std::vector > edge_to_triangle; + su2vector > edge_to_triangle; /* The value that each edge which intersects the band takes within that * same band. Used to sort the edges */ - std::vector > > y_edge_at_band_mid; + su2vector > > y_edge_at_band_mid; - public: + double memory_footprint = 0; + public: CTrapezoidalMap() = default; - CTrapezoidalMap(const su2double* samples_x, - const su2double* samples_y, - const unsigned long size, - const std::vector >& edges, - const std::vector >& edge_to_triangle); + CTrapezoidalMap(const su2double* samples_x, const su2double* samples_y, const unsigned long size, + const std::vector >& edges, + const su2vector >& edge_to_triangle, bool display = false); /*! * \brief return the index to the triangle that contains the coordinates (val_x,val_y) @@ -73,7 +71,6 @@ */ unsigned long GetTriangle(su2double val_x, su2double val_y); - /*! * \brief get the indices of the vertical coordinate band (xmin,xmax) in the 2D search space * that contains the coordinate val_x @@ -83,25 +80,29 @@ */ std::pair GetBand(su2double val_x); - - /*! - * \brief for a given coordinate (val_x,value), known to be in the band (xmin,xmax) with band index (i_low,i_up), - * find the edges in the band (these edges come from the triangulation) that enclose the coordinate - * \param[in] val_band - pair i_low,i_up - * \param[in] val_x - x-coordinate or first independent variable - * \param[in] val_y - y-coordinate or first independent variable - * \param[out] pair (edge_low,edge_up) - lower edge and upper edge of a triangle that encloses the coordinate - */ - std::pair GetEdges(std::pair val_band, - su2double val_x, + /*! + * \brief for a given coordinate (val_x,value), known to be in the band (xmin,xmax) with band index (i_low,i_up), + * find the edges in the band (these edges come from the triangulation) that enclose the coordinate + * \param[in] val_band - pair i_low,i_up + * \param[in] val_x - x-coordinate or first independent variable + * \param[in] val_y - y-coordinate or first independent variable + * \param[out] pair (edge_low,edge_up) - lower edge and upper edge of a triangle that encloses the coordinate + */ + std::pair GetEdges(std::pair val_band, su2double val_x, su2double val_y) const; - /*! - * \brief determine if the x-coordinate falls within the bounds xmin,xmax of the table - * \param[in] val_x - x-coordinate or first independent variable - * \param[out] bool - true if val_x is within (xmin,xmax) - */ + /*! + * \brief determine if the x-coordinate falls within the bounds xmin,xmax of the table + * \param[in] val_x - x-coordinate or first independent variable + * \param[out] bool - true if val_x is within (xmin,xmax) + */ inline bool IsInsideHullX(su2double val_x) { return (val_x >= unique_bands_x.front()) && (val_x <= unique_bands_x.back()); } + + /*! + * \brief get memory footprint of trapezoidal map. + * \return - memory footprint in mega bytes. + */ + double GetMemoryFootprint() const { return memory_footprint; } }; diff --git a/Common/include/containers/CVertexMap.hpp b/Common/include/containers/CVertexMap.hpp index a0152d22881..e02bf7a4a25 100644 --- a/Common/include/containers/CVertexMap.hpp +++ b/Common/include/containers/CVertexMap.hpp @@ -2,7 +2,7 @@ * \file CVertexMap.hpp * \brief An index to index lookup vector. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -49,15 +49,15 @@ * * \note For efficiency use the smallest type that can fit the maximum number of vertices. */ -template +template class CVertexMap { static_assert(std::is_unsigned::value && std::is_integral::value, "Vertex map requires an unsigned integral type (e.g. unsigned)."); private: - su2vector Map; /*!< \brief Map from range 0-(nPoint-1) to 1-nVertex. */ - bool isValid = false; /*!< \brief Set to true when it is safe to use the accessors. */ - T nVertex = 0; /*!< \brief Number of vertices. */ + su2vector Map; /*!< \brief Map from range 0-(nPoint-1) to 1-nVertex. */ + bool isValid = false; /*!< \brief Set to true when it is safe to use the accessors. */ + T nVertex = 0; /*!< \brief Number of vertices. */ public: /*! @@ -94,9 +94,7 @@ class CVertexMap { /*! * \brief Get wheter a point is marked as vertex. */ - inline bool GetIsVertex(unsigned long iPoint) const { - return (Map(iPoint) != 0); - } + inline bool GetIsVertex(unsigned long iPoint) const { return (Map(iPoint) != 0); } /*! * \brief Build the point to vertex map. @@ -108,8 +106,7 @@ class CVertexMap { nVertex = 0; for (unsigned long iPoint = 0; iPoint < Map.size(); ++iPoint) - if (Map(iPoint)!=0) - Map(iPoint) = ++nVertex; + if (Map(iPoint) != 0) Map(iPoint) = ++nVertex; isValid = true; } @@ -121,12 +118,11 @@ class CVertexMap { * \param[in,out] iVertex - On entry point index, on exit vertex index. * \return True if conversion is successful (i.e. point is vertex). */ - inline bool GetVertexIndex(unsigned long &iVertex) const { + inline bool GetVertexIndex(unsigned long& iVertex) const { assert(isValid && "Vertex map is not in valid state."); iVertex = Map(iVertex); - if(iVertex==0) return false; // not a vertex - iVertex--; // decrement for 0 based - return true; // is a vertex + if (iVertex == 0) return false; // not a vertex + iVertex--; // decrement for 0 based + return true; // is a vertex } - }; diff --git a/Common/include/containers/container_decorators.hpp b/Common/include/containers/container_decorators.hpp index 5484a7e873e..3bcbf705217 100644 --- a/Common/include/containers/container_decorators.hpp +++ b/Common/include/containers/container_decorators.hpp @@ -3,7 +3,7 @@ * \brief Collection of small classes that decorate C2DContainer to * augment its functionality, e.g. give it extra dimensions. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -36,49 +36,55 @@ /*! * \brief Class to represent a matrix (without owning the data, this just wraps a pointer). */ -template +template class CMatrixView { -public: + public: using Scalar = typename std::remove_const::type; using Index = unsigned long; -private: + private: T* m_ptr; Index m_cols; -public: + public: CMatrixView(T* ptr = nullptr, Index cols = 0) : m_ptr(ptr), m_cols(cols) {} - template friend class CMatrixView; - template + template + friend class CMatrixView; + template CMatrixView(const CMatrixView& other) : m_ptr(other.m_ptr), m_cols(other.m_cols) {} explicit CMatrixView(su2matrix& mat) : m_ptr(mat.data()), m_cols(mat.cols()) {} - template::value> = 0> + template ::value> = 0> explicit CMatrixView(const su2matrix& mat) : m_ptr(mat.data()), m_cols(mat.cols()) {} - const Scalar* operator[] (Index i) const noexcept { return &m_ptr[i*m_cols]; } - const Scalar& operator() (Index i, Index j) const noexcept { return m_ptr[i*m_cols + j]; } + const Scalar* operator[](Index i) const noexcept { return &m_ptr[i * m_cols]; } + const Scalar& operator()(Index i, Index j) const noexcept { return m_ptr[i * m_cols + j]; } - template::value> = 0> - Scalar* operator[] (Index i) noexcept { return &m_ptr[i*m_cols]; } + template ::value> = 0> + Scalar* operator[](Index i) noexcept { + return &m_ptr[i * m_cols]; + } - template::value> = 0> - Scalar& operator() (Index i, Index j) noexcept { return m_ptr[i*m_cols + j]; } + template ::value> = 0> + Scalar& operator()(Index i, Index j) noexcept { + return m_ptr[i * m_cols + j]; + } - friend CMatrixView operator+ (CMatrixView mv, Index incr) { return CMatrixView(mv[incr], mv.m_cols); } + friend CMatrixView operator+(CMatrixView mv, Index incr) { return CMatrixView(mv[incr], mv.m_cols); } }; /*! * \class C3DContainerDecorator * \brief Decorate a matrix type (Storage) with 3 dimensions. */ -template +template class C3DContainerDecorator { static_assert(!Storage::IsVector, "Storage type must be a matrix."); static_assert(Storage::IsRowMajor, "Storage type must be row major."); -public: + + public: using Scalar = typename Storage::Scalar; using Index = typename Storage::Index; static constexpr bool IsRowMajor = true; @@ -88,14 +94,14 @@ class C3DContainerDecorator { using ConstMatrix = CMatrixView; using CInnerIter = typename Storage::CInnerIter; - template - using CInnerIterGather = typename Storage::template CInnerIterGather >; + template + using CInnerIterGather = typename Storage::template CInnerIterGather >; -private: + private: Storage m_storage; Index m_innerSz; -public: + public: C3DContainerDecorator() = default; C3DContainerDecorator(Index length, Index rows, Index cols, Scalar value = 0) noexcept { @@ -104,7 +110,7 @@ class C3DContainerDecorator { void resize(Index length, Index rows, Index cols, Scalar value = 0) noexcept { m_innerSz = cols; - m_storage.resize(length, rows*cols) = value; + m_storage.resize(length, rows * cols) = value; } /*! @@ -118,34 +124,36 @@ class C3DContainerDecorator { /*! * \brief Element-wise access. */ - Scalar& operator() (Index i, Index j, Index k) noexcept { return m_storage(i, j*m_innerSz + k); } - const Scalar& operator() (Index i, Index j, Index k) const noexcept { return m_storage(i, j*m_innerSz + k); } + Scalar& operator()(Index i, Index j, Index k) noexcept { return m_storage(i, j * m_innerSz + k); } + const Scalar& operator()(Index i, Index j, Index k) const noexcept { return m_storage(i, j * m_innerSz + k); } /*! * \brief Matrix access. */ - Matrix operator[] (Index i) noexcept { return Matrix(m_storage[i], m_innerSz); } - ConstMatrix operator[] (Index i) const noexcept { return ConstMatrix(m_storage[i], m_innerSz); } + Matrix operator[](Index i) noexcept { return Matrix(m_storage[i], m_innerSz); } + ConstMatrix operator[](Index i) const noexcept { return ConstMatrix(m_storage[i], m_innerSz); } /*! * \brief Matrix access with an offset. */ - Matrix operator() (Index i, Index j) noexcept { return Matrix(m_storage[i]+j*m_innerSz, m_innerSz); } - ConstMatrix operator() (Index i, Index j) const noexcept { return ConstMatrix(m_storage[i]+j*m_innerSz, m_innerSz); } + Matrix operator()(Index i, Index j) noexcept { return Matrix(m_storage[i] + j * m_innerSz, m_innerSz); } + ConstMatrix operator()(Index i, Index j) const noexcept { + return ConstMatrix(m_storage[i] + j * m_innerSz, m_innerSz); + } /*! * \brief Get a scalar iterator to the inner-most dimension of the container. */ FORCEINLINE CInnerIter innerIter(Index i, Index j) const noexcept { - return CInnerIter(&m_storage(i, j*m_innerSz), 1); + return CInnerIter(&m_storage(i, j * m_innerSz), 1); } /*! * \brief Get a SIMD gather iterator to the inner-most dimension of the container. */ - template - FORCEINLINE CInnerIterGather innerIter(simd::Array i, Index j) const noexcept { - return CInnerIterGather(m_storage.data(), 1, i*m_storage.cols() + j*m_innerSz); + template + FORCEINLINE CInnerIterGather innerIter(simd::Array i, Index j) const noexcept { + return CInnerIterGather(m_storage.data(), 1, i * m_storage.cols() + j * m_innerSz); } /*! @@ -153,9 +161,9 @@ class C3DContainerDecorator { * \param[in] i - Outer index. * \param[in] j - Starting middle index for the copy (amount determined by container size). */ - template + template FORCEINLINE StaticContainer get(Int i, Index j = 0) const noexcept { - return m_storage.template get(i, j*m_innerSz); + return m_storage.template get(i, j * m_innerSz); } }; @@ -173,9 +181,8 @@ using CVectorOfMatrix = C3DDoubleMatrix; * \note The constness of the object is derived from the template type, but * we allways keep a reference, never a copy of the associated vector. */ -template -struct C2DDummyLastView -{ +template +struct C2DDummyLastView { static_assert(T::IsVector, "This class decorates vectors."); using Index = typename T::Index; using Scalar = typename T::Scalar; @@ -186,16 +193,12 @@ struct C2DDummyLastView C2DDummyLastView(T& ref) : data(ref) {} - template::value> = 0> - Scalar& operator() (Index i, Index) noexcept - { + template ::value> = 0> + Scalar& operator()(Index i, Index) noexcept { return data(i); } - const Scalar& operator() (Index i, Index) const noexcept - { - return data(i); - } + const Scalar& operator()(Index i, Index) const noexcept { return data(i); } }; /*! @@ -205,9 +208,8 @@ struct C2DDummyLastView * \note The constness of the object is derived from the template type, but * we allways keep a reference, never a copy of the associated matrix. */ -template -struct C3DDummyMiddleView -{ +template +struct C3DDummyMiddleView { static_assert(!T::IsVector, "This class decorates matrices."); using Index = typename T::Index; using Scalar = typename T::Scalar; @@ -218,16 +220,12 @@ struct C3DDummyMiddleView C3DDummyMiddleView(T& ref) : data(ref) {} - template::value> = 0> - Scalar& operator() (Index i, Index, Index k) noexcept - { - return data(i,k); + template ::value> = 0> + Scalar& operator()(Index i, Index, Index k) noexcept { + return data(i, k); } - const Scalar& operator() (Index i, Index, Index k) const noexcept - { - return data(i,k); - } + const Scalar& operator()(Index i, Index, Index k) const noexcept { return data(i, k); } }; /*--- Helper functions to allocate containers of containers. ---*/ @@ -241,10 +239,10 @@ struct C3DDummyMiddleView * \tparam IndexVector - type of N * \tparam VectorOfVector - type of X */ -template +template inline void AllocVectorOfVectors(size_t M, const IndexVector& N, VectorOfVector& X, Scalar val = 0) { X.resize(M); - for(size_t i = 0; i < M; ++i){ + for (size_t i = 0; i < M; ++i) { X[i].resize(N[i]); for (auto& x : X[i]) x = val; } @@ -253,7 +251,7 @@ inline void AllocVectorOfVectors(size_t M, const IndexVector& N, VectorOfVector& /*! * \overload Deduce outer size from index vector. */ -template +template inline void AllocVectorOfVectors(const IndexVector& N, VectorOfVector& X, Scalar val = 0) { auto M = N.size(); AllocVectorOfVectors(M, N, X, val); @@ -269,11 +267,11 @@ inline void AllocVectorOfVectors(const IndexVector& N, VectorOfVector& X, Scalar * \tparam IndexVector - type of N * \tparam VectorOfMatrix - type of X */ -template -inline void AllocVectorOfMatrices(size_t M, const IndexVector& N, size_t P, VectorOfMatrix& X, Scalar val=0) { +template +inline void AllocVectorOfMatrices(size_t M, const IndexVector& N, size_t P, VectorOfMatrix& X, Scalar val = 0) { X.resize(M); - for(size_t i = 0; i < M; ++i){ - X[i].resize(N[i],P); + for (size_t i = 0; i < M; ++i) { + X[i].resize(N[i], P); for (auto& x : X[i]) x = val; } } @@ -281,10 +279,10 @@ inline void AllocVectorOfMatrices(size_t M, const IndexVector& N, size_t P, Vect /*! * \overload Deduce outer size from index vector. */ -template -inline void AllocVectorOfMatrices(const IndexVector& N, size_t P, VectorOfMatrix& X, Scalar val=0) { +template +inline void AllocVectorOfMatrices(const IndexVector& N, size_t P, VectorOfMatrix& X, Scalar val = 0) { auto M = N.size(); AllocVectorOfMatrices(M, N, P, X, val); } -/// @} \ No newline at end of file +/// @} diff --git a/Common/include/fem/fem_cgns_elements.hpp b/Common/include/fem/fem_cgns_elements.hpp index 16af6f34ecc..43bcfb0b6fb 100644 --- a/Common/include/fem/fem_cgns_elements.hpp +++ b/Common/include/fem/fem_cgns_elements.hpp @@ -4,7 +4,7 @@ * with high order elements. * The functions are in the cgns_elements.cpp file. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -32,7 +32,7 @@ #include "../parallelization/mpi_structure.hpp" #ifdef HAVE_CGNS - #include "cgnslib.h" +#include "cgnslib.h" #endif #include "../geometry/primal_grid/CPrimalGridFEM.hpp" @@ -49,229 +49,148 @@ class CBoundaryFace; */ class CCGNSElementType { -public: - int connID; /*!< \brief CGNS connectivity ID of this connectivity. */ - ElementType_t elemType; /*!< \brief Element type according to the CGNS convention, - possibly MIXED. */ - cgsize_t indBeg; /*!< \brief Index of the first element in the CGNS connectivity. */ - cgsize_t indEnd; /*!< \brief Index of the last element in the CGNS connectivity. */ - cgsize_t nElem; /*!< \brief Number of elements present for this element type. */ + public: + int connID; /*!< \brief CGNS connectivity ID of this connectivity. */ + ElementType_t elemType; /*!< \brief Element type according to the CGNS convention, + possibly MIXED. */ + cgsize_t indBeg; /*!< \brief Index of the first element in the CGNS connectivity. */ + cgsize_t indEnd; /*!< \brief Index of the last element in the CGNS connectivity. */ + cgsize_t nElem; /*!< \brief Number of elements present for this element type. */ - std::string connName; /*!< \brief Name of this connectivity. */ + std::string connName; /*!< \brief Name of this connectivity. */ - bool volumeConn; /*!< \brief Whether or not this is a volume connectivity. */ - bool surfaceConn; /*!< \brief Whether or not this is a surface connectivity. */ + bool volumeConn; /*!< \brief Whether or not this is a volume connectivity. */ + bool surfaceConn; /*!< \brief Whether or not this is a surface connectivity. */ /* Standard constructor, nothing to be done. */ - CCGNSElementType(){} + CCGNSElementType() {} /* Destructor, nothing to be done. */ - ~CCGNSElementType(){} + ~CCGNSElementType() {} /*--- Member function, which determines the meta data for this element type. ---*/ - void DetermineMetaData(const unsigned short nDim, - const int fn, - const int iBase, - const int iZone, - const int iConn); + void DetermineMetaData(const unsigned short nDim, const int fn, const int iBase, const int iZone, const int iConn); /*--- Member function, which reads the required boundary connectivity range. ---*/ - void ReadBoundaryConnectivityRange(const int fn, - const int iBase, - const int iZone, - const unsigned long offsetRank, - const unsigned long nBoundElemRank, - const unsigned long startingBoundElemIDRank, - unsigned long &locBoundElemCount, - std::vector &boundElems); + void ReadBoundaryConnectivityRange(const int fn, const int iBase, const int iZone, const unsigned long offsetRank, + const unsigned long nBoundElemRank, const unsigned long startingBoundElemIDRank, + unsigned long& locBoundElemCount, std::vector& boundElems); /*--- Member function, which reads the required connectivity range. ---*/ - void ReadConnectivityRange(const int fn, - const int iBase, - const int iZone, - const unsigned long offsetRank, - const unsigned long nElemRank, - const unsigned long startingElemIDRank, - CPrimalGrid **&elem, - unsigned long &locElemCount, - unsigned long &nDOFsLoc); -private: + void ReadConnectivityRange(const int fn, const int iBase, const int iZone, const unsigned long offsetRank, + const unsigned long nElemRank, const unsigned long startingElemIDRank, CPrimalGrid**& elem, + unsigned long& locElemCount, unsigned long& nDOFsLoc); + + private: /*--- Member function, which creates the required data for the given element type. ---*/ - void CreateDataElementType(const ElementType_t typeElem, - unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); + void CreateDataElementType(const ElementType_t typeElem, unsigned short& VTK_Type, unsigned short& nPoly, + unsigned short& nDOFs, std::vector& SU2ToCGNS); /*--- Member function, which determines the element dimension, i.e. the number of parametric coordinates. ---*/ - unsigned short DetermineElementDimension(const int fn, - const int iBase, - const int iZone); + unsigned short DetermineElementDimension(const int fn, const int iBase, const int iZone); /*--- Member function, which determines the element dimension when the connectivity is mixed. ---*/ - unsigned short DetermineElementDimensionMixed(const int fn, - const int iBase, - const int iZone); + unsigned short DetermineElementDimensionMixed(const int fn, const int iBase, const int iZone); /*--- Member function, which determines the corresponding index of the given element in the stored types. If not present, a new index is created. ---*/ - unsigned short IndexInStoredTypes(const ElementType_t typeElem, - std::vector &CGNS_Type, - std::vector &VTK_Type, - std::vector &nPoly, - std::vector &nDOFs, - std::vector > &SU2ToCGNS); + unsigned short IndexInStoredTypes(const ElementType_t typeElem, std::vector& CGNS_Type, + std::vector& VTK_Type, std::vector& nPoly, + std::vector& nDOFs, + std::vector >& SU2ToCGNS); /*--- Functions to create the conversion data from CGNS format to SU2 format for all the supported CGNS elements. ---*/ - void CreateDataNODE(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataBAR_2(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataBAR_3(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataBAR_4(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataBAR_5(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataTRI_3(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataTRI_6(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataTRI_10(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataTRI_15(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataQUAD_4(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataQUAD_9(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataQUAD_16(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataQUAD_25(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataTETRA_4(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataTETRA_10(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataTETRA_20(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataTETRA_35(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataPYRA_5(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataPYRA_14(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataPYRA_30(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataPYRA_55(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataPENTA_6(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataPENTA_18(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataPENTA_40(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataPENTA_75(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataHEXA_8(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataHEXA_27(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataHEXA_64(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); - - void CreateDataHEXA_125(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - std::vector &SU2ToCGNS); + void CreateDataNODE(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataBAR_2(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataBAR_3(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataBAR_4(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataBAR_5(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataTRI_3(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataTRI_6(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataTRI_10(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataTRI_15(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataQUAD_4(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataQUAD_9(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataQUAD_16(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataQUAD_25(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataTETRA_4(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataTETRA_10(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataTETRA_20(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataTETRA_35(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataPYRA_5(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataPYRA_14(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataPYRA_30(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataPYRA_55(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataPENTA_6(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataPENTA_18(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataPENTA_40(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataPENTA_75(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataHEXA_8(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataHEXA_27(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataHEXA_64(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); + + void CreateDataHEXA_125(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + std::vector& SU2ToCGNS); }; #endif #endif diff --git a/Common/include/fem/fem_gauss_jacobi_quadrature.hpp b/Common/include/fem/fem_gauss_jacobi_quadrature.hpp index d6ccbe227e3..03ed52eab78 100644 --- a/Common/include/fem/fem_gauss_jacobi_quadrature.hpp +++ b/Common/include/fem/fem_gauss_jacobi_quadrature.hpp @@ -6,7 +6,7 @@ All the functions in this class are based on the program JACOBI_RULE of John Burkardt. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -95,10 +95,10 @@ using namespace std; * \brief Class used to determine the quadrature points of the Gauss Jacobi integration rules. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CGaussJacobiQuadrature { -public: + public: /*! * \brief Function, which serves as the API to compute the integration points and weights. @@ -111,30 +111,29 @@ class CGaussJacobiQuadrature { * \param[in,out] GJPoints Location of the Gauss-Jacobi integration points. * \param[in,out] GJWeights Weights of the Gauss-Jacobi integration points. */ - void GetQuadraturePoints(const passivedouble alpha, const passivedouble beta, - const passivedouble a, const passivedouble b, - vector &GJPoints, vector &GJWeights); -private: + void GetQuadraturePoints(const passivedouble alpha, const passivedouble beta, const passivedouble a, + const passivedouble b, vector& GJPoints, vector& GJWeights); + + private: /*! * \brief Function in the original implementation of John Burkardt to compute the integration points of the Gauss-Jacobi quadrature rule. */ - void cdgqf(int nt, int kind, passivedouble alpha, passivedouble beta, passivedouble t[], - passivedouble wts[]); + void cdgqf(int nt, int kind, passivedouble alpha, passivedouble beta, passivedouble t[], passivedouble wts[]); /*! * \brief Function in the original implementation of John Burkardt to compute the integration points of the Gauss-Jacobi quadrature rule. */ - void cgqf(int nt, int kind, passivedouble alpha, passivedouble beta, passivedouble a, - passivedouble b, passivedouble t[], passivedouble wts[]); + void cgqf(int nt, int kind, passivedouble alpha, passivedouble beta, passivedouble a, passivedouble b, + passivedouble t[], passivedouble wts[]); /*! * \brief Function in the original implementation of John Burkardt to compute the integration points of the Gauss-Jacobi quadrature rule. */ - passivedouble class_matrix(int kind, int m, passivedouble alpha, passivedouble beta, - passivedouble aj[], passivedouble bj[]); + passivedouble class_matrix(int kind, int m, passivedouble alpha, passivedouble beta, passivedouble aj[], + passivedouble bj[]); /*! * \brief Function in the original implementation of John Burkardt to compute @@ -165,8 +164,8 @@ class CGaussJacobiQuadrature { the integration points of the Gauss-Jacobi quadrature rule. */ void scqf(int nt, const passivedouble t[], const int mlt[], const passivedouble wts[], int nwts, int ndx[], - passivedouble swts[], passivedouble st[], int kind, passivedouble alpha, - passivedouble beta, passivedouble a, passivedouble b); + passivedouble swts[], passivedouble st[], int kind, passivedouble alpha, passivedouble beta, + passivedouble a, passivedouble b); /*! * \brief Function in the original implementation of John Burkardt to compute diff --git a/Common/include/fem/fem_geometry_structure.hpp b/Common/include/fem/fem_geometry_structure.hpp index 4974a6fbbc9..3ea11dedb01 100644 --- a/Common/include/fem/fem_geometry_structure.hpp +++ b/Common/include/fem/fem_geometry_structure.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for creating the geometrical structure for the FEM solver. * The subroutines and functions are in the fem_geometry_structure.cpp file. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -41,47 +41,48 @@ using namespace std; /*! * \class CLong3T * \brief Help class used to store three longs as one entity. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ struct CLong3T { - long long0 = 0; /*!< \brief First long to store in this class. */ - long long1 = 0; /*!< \brief Second long to store in this class. */ - long long2 = 0; /*!< \brief Third long to store in this class. */ + long long0 = 0; /*!< \brief First long to store in this class. */ + long long1 = 0; /*!< \brief Second long to store in this class. */ + long long2 = 0; /*!< \brief Third long to store in this class. */ CLong3T() = default; - CLong3T(const long a, const long b, const long c) {long0 = a; long1 = b; long2 = c;} + CLong3T(const long a, const long b, const long c) { + long0 = a; + long1 = b; + long2 = c; + } - bool operator<(const CLong3T &other) const; + bool operator<(const CLong3T& other) const; }; /*! * \class CReorderElements * \brief Class, used to reorder the owned elements after the partitioning. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CReorderElements { -private: - unsigned long globalElemID; /*!< \brief Global element ID of the element. */ - unsigned short timeLevel; /*!< \brief Time level of the element. Only relevant - for time accurate local time stepping. */ - bool commSolution; /*!< \brief Whether or not the solution must be - communicated to other ranks. */ - unsigned short elemType; /*!< \brief Short hand for the element type, Which - stored info of the VTK_Type, polynomial - degree of the solution and whether or - not the Jacobian is constant. */ -public: + private: + unsigned long globalElemID; /*!< \brief Global element ID of the element. */ + unsigned short timeLevel; /*!< \brief Time level of the element. Only relevant + for time accurate local time stepping. */ + bool commSolution; /*!< \brief Whether or not the solution must be + communicated to other ranks. */ + unsigned short elemType; /*!< \brief Short hand for the element type, Which + stored info of the VTK_Type, polynomial + degree of the solution and whether or + not the Jacobian is constant. */ + public: /*! * \brief Constructor of the class, set the member variables to the arguments. */ - CReorderElements(const unsigned long val_GlobalElemID, - const unsigned short val_TimeLevel, - const bool val_CommSolution, - const unsigned short val_VTK_Type, - const unsigned short val_nPolySol, - const bool val_JacConstant); + CReorderElements(const unsigned long val_GlobalElemID, const unsigned short val_TimeLevel, + const bool val_CommSolution, const unsigned short val_VTK_Type, const unsigned short val_nPolySol, + const bool val_JacConstant); /*! * \brief Default constructor of the class. Disabled. @@ -91,7 +92,7 @@ class CReorderElements { /*! * \brief Less than operator of the class. Needed for the sorting. */ - bool operator<(const CReorderElements &other) const; + bool operator<(const CReorderElements& other) const; /*! * \brief Function to make available the variable commSolution. @@ -123,7 +124,6 @@ class CReorderElements { * \param[in] val_CommSolution - value to which commSolution must be set. */ inline void SetCommSolution(const bool val_CommSolution) { commSolution = val_CommSolution; } - }; /*! @@ -131,23 +131,21 @@ class CReorderElements { * \brief Functor, used for a different sorting of the faces than the < operator * of CFaceOfElement. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ -class CVolumeElementFEM; // Forward declaration to avoid problems. +class CVolumeElementFEM; // Forward declaration to avoid problems. class CSortFaces { -private: + private: unsigned long nVolElemOwned; /*!< \brief Number of locally owned volume elements. */ unsigned long nVolElemTot; /*!< \brief Total number of local volume elements . */ - const CVolumeElementFEM *volElem; /*!< \brief The locally stored volume elements. */ + const CVolumeElementFEM* volElem; /*!< \brief The locally stored volume elements. */ -public: + public: /*! * \brief Constructor of the class. Set the values of the member variables. */ - CSortFaces(unsigned long val_nVolElemOwned, - unsigned long val_nVolElemTot, - const CVolumeElementFEM *val_volElem) { + CSortFaces(unsigned long val_nVolElemOwned, unsigned long val_nVolElemTot, const CVolumeElementFEM* val_volElem) { nVolElemOwned = val_nVolElemOwned; nVolElemTot = val_nVolElemTot; volElem = val_volElem; @@ -156,15 +154,14 @@ class CSortFaces { /*! * \brief Default constructor of the class. Disabled. */ - CSortFaces(void) = delete; + CSortFaces(void) = delete; - /*! - * \brief Operator used for the comparison. - * \param[in] f0 - First face in the comparison. - * \param[in] f1 - Second face in the comparison. - */ - bool operator()(const CFaceOfElement &f0, - const CFaceOfElement &f1); + /*! + * \brief Operator used for the comparison. + * \param[in] f0 - First face in the comparison. + * \param[in] f1 - Second face in the comparison. + */ + bool operator()(const CFaceOfElement& f0, const CFaceOfElement& f1); }; /*! @@ -172,52 +169,51 @@ class CSortFaces { * \brief Functor, used for a different sorting of the faces than the < operator * of CSurfaceElementFEM. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ -struct CSurfaceElementFEM; // Forward declaration to avoid problems. +struct CSurfaceElementFEM; // Forward declaration to avoid problems. struct CSortBoundaryFaces { - /*! - * \brief Operator used for the comparison. - * \param[in] f0 - First boundary face in the comparison. - * \param[in] f1 - Second boundary face in the comparison. - */ - bool operator()(const CSurfaceElementFEM &f0, - const CSurfaceElementFEM &f1); + /*! + * \brief Operator used for the comparison. + * \param[in] f0 - First boundary face in the comparison. + * \param[in] f1 - Second boundary face in the comparison. + */ + bool operator()(const CSurfaceElementFEM& f0, const CSurfaceElementFEM& f1); }; /*! * \class CVolumeElementFEM * \brief Class to store a volume element for the FEM solver. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CVolumeElementFEM { -public: + public: bool elemIsOwned; /*!< \brief Whether or not this is an owned element. */ bool JacIsConsideredConstant; /*!< \brief Whether or not the Jacobian of the transformation to the standard element is considered constant. */ - int rankOriginal; /*!< \brief The rank where the original volume is stored. For - the owned volumes, this is simply the current rank. */ + int rankOriginal; /*!< \brief The rank where the original volume is stored. For + the owned volumes, this is simply the current rank. */ - short periodIndexToDonor; /*!< \brief The index of the periodic transformation to the donor - element. Only for halo elements. A -1 indicates no periodic - transformation. */ + short periodIndexToDonor; /*!< \brief The index of the periodic transformation to the donor + element. Only for halo elements. A -1 indicates no periodic + transformation. */ - unsigned short VTK_Type; /*!< \brief Element type using the VTK convention. */ - unsigned short nPolyGrid; /*!< \brief Polynomial degree for the geometry of the element. */ - unsigned short nPolySol; /*!< \brief Polynomial degree for the solution of the element. */ - unsigned short nDOFsGrid; /*!< \brief Number of DOFs for the geometry of the element. */ - unsigned short nDOFsSol; /*!< \brief Number of DOFs for the solution of the element. */ - unsigned short nFaces; /*!< \brief Number of faces of the element. */ - unsigned short timeLevel; /*!< \brief Time level of the element when time accurate local - time stepping is employed. */ + unsigned short VTK_Type; /*!< \brief Element type using the VTK convention. */ + unsigned short nPolyGrid; /*!< \brief Polynomial degree for the geometry of the element. */ + unsigned short nPolySol; /*!< \brief Polynomial degree for the solution of the element. */ + unsigned short nDOFsGrid; /*!< \brief Number of DOFs for the geometry of the element. */ + unsigned short nDOFsSol; /*!< \brief Number of DOFs for the solution of the element. */ + unsigned short nFaces; /*!< \brief Number of faces of the element. */ + unsigned short timeLevel; /*!< \brief Time level of the element when time accurate local + time stepping is employed. */ unsigned short indStandardElement; /*!< \brief Index in the vector of standard elements. */ - unsigned int factTimeLevel; /*!< \brief Number of local time steps for this element - compared to the largest time step when time - accurate local time stepping is employed. */ + unsigned int factTimeLevel; /*!< \brief Number of local time steps for this element + compared to the largest time step when time + accurate local time stepping is employed. */ unsigned long elemIDGlobal; /*!< \brief Global element ID of this element. */ unsigned long offsetDOFsSolGlobal; /*!< \brief Global offset of the solution DOFs of this element. */ @@ -236,35 +232,34 @@ class CVolumeElementFEM { vector nodeIDsGrid; /*!< \brief Vector with the node IDs of the grid for this element. */ - su2double lenScale; /*!< \brief Length scale of the element. */ - - su2double shockSensorValue; /*!< \brief Value for sensing a shock */ - su2double shockArtificialViscosity; /*!< \brief Artificial viscosity for a shock */ - - - vector metricTerms; /*!< \brief Vector of the metric terms in the - integration points of this element. */ - vector metricTermsSolDOFs; /*!< \brief Vector of the metric terms in the - solution DOFs of this element. */ - vector metricTerms2ndDer; /*!< \brief Vector of the metric terms needed for the - computation of the 2nd derivatives in the - integration points. Only determined when - needed (ADER-DG with non-aliased predictor - for the Navier-Stokes equations). */ - vector gridVelocities; /*!< \brief Vector of the grid velocities in the - integration points of this element. */ - vector gridVelocitiesSolDOFs; /*!< \brief Vector of the grid velocities in the - solution DOFs of this element. */ - vector massMatrix; /*!< \brief Mass matrix for this element. */ - vector invMassMatrix; /*!< \brief Inverse mass matrix for this element. */ - vector lumpedMassMatrix; /*!< \brief Lumped mass matrix for this element. */ - - vector coorIntegrationPoints; /*!< \brief The coordinates of the integration points of this element. */ - vector coorSolDOFs; /*!< \brief The coordinates of the solution DOFs of this element. */ - vector wallDistance; /*!< \brief The wall distance to the viscous walls for - the integration points of this element. */ - vector wallDistanceSolDOFs; /*!< \brief The wall distance to the viscous walls for - the solution DOFs of this element. */ + su2double lenScale; /*!< \brief Length scale of the element. */ + + su2double shockSensorValue; /*!< \brief Value for sensing a shock */ + su2double shockArtificialViscosity; /*!< \brief Artificial viscosity for a shock */ + + vector metricTerms; /*!< \brief Vector of the metric terms in the + integration points of this element. */ + vector metricTermsSolDOFs; /*!< \brief Vector of the metric terms in the + solution DOFs of this element. */ + vector metricTerms2ndDer; /*!< \brief Vector of the metric terms needed for the + computation of the 2nd derivatives in the + integration points. Only determined when + needed (ADER-DG with non-aliased predictor + for the Navier-Stokes equations). */ + vector gridVelocities; /*!< \brief Vector of the grid velocities in the + integration points of this element. */ + vector gridVelocitiesSolDOFs; /*!< \brief Vector of the grid velocities in the + solution DOFs of this element. */ + vector massMatrix; /*!< \brief Mass matrix for this element. */ + vector invMassMatrix; /*!< \brief Inverse mass matrix for this element. */ + vector lumpedMassMatrix; /*!< \brief Lumped mass matrix for this element. */ + + vector coorIntegrationPoints; /*!< \brief The coordinates of the integration points of this element. */ + vector coorSolDOFs; /*!< \brief The coordinates of the solution DOFs of this element. */ + vector wallDistance; /*!< \brief The wall distance to the viscous walls for + the integration points of this element. */ + vector wallDistanceSolDOFs; /*!< \brief The wall distance to the viscous walls for + the solution DOFs of this element. */ /*! * \brief Get all the corner points of all the faces of this element. It must be made sure @@ -274,16 +269,14 @@ class CVolumeElementFEM { * \param[out] nPointsPerFace - Number of corner points for each of the faces. * \param[out] faceConn - Global IDs of the corner points of the faces. */ - void GetCornerPointsAllFaces(unsigned short &numFaces, - unsigned short nPointsPerFace[], - unsigned long faceConn[6][4]); + void GetCornerPointsAllFaces(unsigned short& numFaces, unsigned short nPointsPerFace[], unsigned long faceConn[6][4]); }; /*! * \class CPointFEM * \brief Class to a point for the FEM solver. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ struct CPointFEM { unsigned long globalID; /*!< \brief The global ID of this point in the grid. */ @@ -295,70 +288,68 @@ struct CPointFEM { /*! * \brief Less than operator of the class. Needed for the sorting. */ - bool operator<(const CPointFEM &other) const; + bool operator<(const CPointFEM& other) const; /*! * \brief Equal operator of the class. Needed for the removal of double entities. */ - bool operator==(const CPointFEM &other) const; - + bool operator==(const CPointFEM& other) const; }; /*! * \class CInternalFaceElementFEM * \brief Class to store an internal face for the FEM solver. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ struct CInternalFaceElementFEM { - unsigned short VTK_Type; /*!< \brief Element type using the VTK convention. */ + unsigned short VTK_Type; /*!< \brief Element type using the VTK convention. */ unsigned short indStandardElement; /*!< \brief Index in the vector of standard face elements. */ - unsigned long elemID0; /*!< \brief Element ID adjacent to side 0 of the face. */ - unsigned long elemID1; /*!< \brief Element ID adjacent to side 1 of the face. */ + unsigned long elemID0; /*!< \brief Element ID adjacent to side 0 of the face. */ + unsigned long elemID1; /*!< \brief Element ID adjacent to side 1 of the face. */ - vector DOFsGridFaceSide0; /*!< \brief Vector of the grid DOFs of side 0 of the face. */ - vector DOFsGridFaceSide1; /*!< \brief Vector of the grid DOFs of side 1 of the face. */ - vector DOFsSolFaceSide0; /*!< \brief Vector of the solution DOFs of side 0 of the face. */ - vector DOFsSolFaceSide1; /*!< \brief Vector of the solution DOFs of side 1 of the face. */ + vector DOFsGridFaceSide0; /*!< \brief Vector of the grid DOFs of side 0 of the face. */ + vector DOFsGridFaceSide1; /*!< \brief Vector of the grid DOFs of side 1 of the face. */ + vector DOFsSolFaceSide0; /*!< \brief Vector of the solution DOFs of side 0 of the face. */ + vector DOFsSolFaceSide1; /*!< \brief Vector of the solution DOFs of side 1 of the face. */ - vector DOFsGridElementSide0; /*!< \brief Vector of the grid DOFs of the element of side 0. */ - vector DOFsGridElementSide1; /*!< \brief Vector of the grid DOFs of the element of side 1. */ - vector DOFsSolElementSide0; /*!< \brief Vector of the solution DOFs of the element of side 0. */ - vector DOFsSolElementSide1; /*!< \brief Vector of the solution DOFs of the element of side 1. */ + vector DOFsGridElementSide0; /*!< \brief Vector of the grid DOFs of the element of side 0. */ + vector DOFsGridElementSide1; /*!< \brief Vector of the grid DOFs of the element of side 1. */ + vector DOFsSolElementSide0; /*!< \brief Vector of the solution DOFs of the element of side 0. */ + vector DOFsSolElementSide1; /*!< \brief Vector of the solution DOFs of the element of side 1. */ - vector metricNormalsFace; /*!< \brief The normals in the integration points of the face. - The normals point from side 0 to side 1. */ - vector metricCoorDerivFace0; /*!< \brief The terms drdx, dsdx, etc. of side 0 in the - integration points of the face. */ - vector metricCoorDerivFace1; /*!< \brief The terms dxdr, dydr, etc. of side 1 in the - integration points of the face. */ + vector metricNormalsFace; /*!< \brief The normals in the integration points of the face. + The normals point from side 0 to side 1. */ + vector metricCoorDerivFace0; /*!< \brief The terms drdx, dsdx, etc. of side 0 in the + integration points of the face. */ + vector metricCoorDerivFace1; /*!< \brief The terms dxdr, dydr, etc. of side 1 in the + integration points of the face. */ - vector coorIntegrationPoints; /*!< \brief Coordinates for the integration points of this face. */ - vector gridVelocities; /*!< \brief Grid velocities in the integration points of this face. */ - vector wallDistance; /*!< \brief The wall distance to the viscous walls for - the integration points of this face. */ + vector coorIntegrationPoints; /*!< \brief Coordinates for the integration points of this face. */ + vector gridVelocities; /*!< \brief Grid velocities in the integration points of this face. */ + vector wallDistance; /*!< \brief The wall distance to the viscous walls for + the integration points of this face. */ /*! * \brief Less than operator of the class. Needed for the sorting. The criterion for comparison are the standard element and adjacent volume ID's. */ - bool operator<(const CInternalFaceElementFEM &other) const; - + bool operator<(const CInternalFaceElementFEM& other) const; }; /*! * \class CSurfaceElementFEM * \brief Class to store a surface element for the FEM solver. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ struct CSurfaceElementFEM { - unsigned short VTK_Type; /*!< \brief Element type using the VTK convention. */ - unsigned short nPolyGrid; /*!< \brief Polynomial degree for the geometry of the element. */ - unsigned short nDOFsGrid; /*!< \brief Number of DOFs for the geometry of the element. */ + unsigned short VTK_Type; /*!< \brief Element type using the VTK convention. */ + unsigned short nPolyGrid; /*!< \brief Polynomial degree for the geometry of the element. */ + unsigned short nDOFsGrid; /*!< \brief Number of DOFs for the geometry of the element. */ unsigned short indStandardElement; /*!< \brief Index in the vector of standard elements. */ @@ -370,66 +361,65 @@ struct CSurfaceElementFEM { In this vector the original sequence of the grid file is stored. */ - vector DOFsGridFace; /*!< \brief Vector of the grid DOFs of the face. In principle - the same information as nodeIDsGrid, but the sequence - could be different. */ - vector DOFsSolFace; /*!< \brief Vector of the solution DOFs of the face. */ + vector DOFsGridFace; /*!< \brief Vector of the grid DOFs of the face. In principle + the same information as nodeIDsGrid, but the sequence + could be different. */ + vector DOFsSolFace; /*!< \brief Vector of the solution DOFs of the face. */ - vector DOFsGridElement; /*!< \brief Vector of the grid DOFs of the adjacent element. */ - vector DOFsSolElement; /*!< \brief Vector of the solution DOFs of the adjacent element. */ + vector DOFsGridElement; /*!< \brief Vector of the grid DOFs of the adjacent element. */ + vector DOFsSolElement; /*!< \brief Vector of the solution DOFs of the adjacent element. */ vector metricNormalsFace; /*!< \brief The normals in the integration points of the face. The normals point out of the adjacent element. */ vector metricCoorDerivFace; /*!< \brief The terms drdx, dsdx, etc. in the integration points of the face. */ vector coorIntegrationPoints; /*!< \brief The coordinates of the integration points of the face. */ - vector gridVelocities; /*!< \brief Grid velocities in the integration points of this face. */ + vector gridVelocities; /*!< \brief Grid velocities in the integration points of this face. */ vector wallDistance; /*!< \brief The wall distances of the integration points of the face. */ - vector donorsWallFunction; /*!< \brief Local element IDs of the donors for the wall - function treatment. These donors can be halo's. */ - vector nIntPerWallFunctionDonor; /*!< \brief The number of integration points per donor - element for the wall function treatment. */ - vector intPerWallFunctionDonor; /*!< \brief The integration points per donor element - for the wall function treatment. */ - vector > matWallFunctionDonor; /*!< \brief Matrices, which store the interpolation coefficients - for the donors of the integration points.*/ + vector donorsWallFunction; /*!< \brief Local element IDs of the donors for the wall + function treatment. These donors can be halo's. */ + vector nIntPerWallFunctionDonor; /*!< \brief The number of integration points per donor + element for the wall function treatment. */ + vector intPerWallFunctionDonor; /*!< \brief The integration points per donor element + for the wall function treatment. */ + vector > matWallFunctionDonor; /*!< \brief Matrices, which store the interpolation coefficients + for the donors of the integration points.*/ /*! * \brief Less than operator of the class. Needed for the sorting. The criterion for comparison is the corresponding (local) volume ID. */ - bool operator<(const CSurfaceElementFEM &other) const { return volElemID < other.volElemID; } + bool operator<(const CSurfaceElementFEM& other) const { return volElemID < other.volElemID; } /*! * \brief Function, which determines the corner points of this surface element. * \param[out] nPointsPerFace - Number of corner points of the face. * \param[out] faceConn - The corner points of the face. */ - void GetCornerPointsFace(unsigned short &nPointsPerFace, - unsigned long faceConn[]); + void GetCornerPointsFace(unsigned short& nPointsPerFace, unsigned long faceConn[]); }; /*! * \class CBoundaryFEM * \brief Class to store a boundary for the FEM solver. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ struct CBoundaryFEM { - string markerTag; /*!< \brief Marker tag of this boundary. */ + string markerTag; /*!< \brief Marker tag of this boundary. */ - bool periodicBoundary = false; /*!< \brief Whether or not this boundary is a periodic boundary. */ - bool haloInfoNeededForBC = false; /*!< \brief Whether or not information of halo elements - is needed to impose the boundary conditions. */ + bool periodicBoundary = false; /*!< \brief Whether or not this boundary is a periodic boundary. */ + bool haloInfoNeededForBC = false; /*!< \brief Whether or not information of halo elements + is needed to impose the boundary conditions. */ vector nSurfElem; /*!< \brief Number of surface elements per time level, cumulative storage format. */ vector surfElem; /*!< \brief Vector of the local surface elements. */ - CWallModel *wallModel = nullptr; /*!< \brief Wall model for LES. */ + CWallModel* wallModel = nullptr; /*!< \brief Wall model for LES. */ ~CBoundaryFEM(void) { delete wallModel; } }; @@ -438,207 +428,209 @@ struct CBoundaryFEM { * \class CMeshFEM * \brief Base class for the FEM solver. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ -class CMeshFEM: public CGeometry { -protected: - unsigned long nVolElemTot{0}; /*!< \brief Total number of local volume elements, including halos. */ - unsigned long nVolElemOwned{0}; /*!< \brief Number of owned local volume elements. */ +class CMeshFEM : public CGeometry { + protected: + unsigned long nVolElemTot{0}; /*!< \brief Total number of local volume elements, including halos. */ + unsigned long nVolElemOwned{0}; /*!< \brief Number of owned local volume elements. */ vector nVolElemOwnedPerTimeLevel; /*!< \brief Number of owned local volume elements per time level. Cumulative storage. */ vector nVolElemInternalPerTimeLevel; /*!< \brief Number of internal local volume elements per time level. Internal means that the solution data does not need to be communicated. */ - vector nVolElemHaloPerTimeLevel; /*!< \brief Number of local halo volume elements - per time level. Cumulative storage. */ + vector nVolElemHaloPerTimeLevel; /*!< \brief Number of local halo volume elements + per time level. Cumulative storage. */ vector > ownedElemAdjLowTimeLevel; /*!< \brief List of owned elements per time level that are adjacent to elements of the lower time level. */ - vector > haloElemAdjLowTimeLevel; /*!< \brief List of halo elements per time level that are - adjacent to elements of the lower time level. */ + vector > haloElemAdjLowTimeLevel; /*!< \brief List of halo elements per time level that are + adjacent to elements of the lower time level. */ vector volElem; /*!< \brief Vector of the local volume elements, including halos. */ - vector meshPoints; /*!< \brief Vector of the points of the FEM mesh. */ + vector meshPoints; /*!< \brief Vector of the points of the FEM mesh. */ - vector boundaries; /*!< \brief Vector of the boundaries of the FEM mesh. */ + vector boundaries; /*!< \brief Vector of the boundaries of the FEM mesh. */ - vector rotPerMarkers; /*!< \brief Vector, which contains the indices of the rotational - periodic markers. */ + vector rotPerMarkers; /*!< \brief Vector, which contains the indices of the rotational + periodic markers. */ vector > rotPerHalos; /*!< \brief Vector of vector, which contains the indices of the halo elements for which a rotationally periodic correction must be applied. */ - vector ranksRecv; /*!< \brief Vector of ranks, from which this rank will receive halo - information. Self communication is included. */ - vector ranksSend; /*!< \brief Vector of ranks, to which this rank will send halo - information. Self communication is included. */ + vector ranksRecv; /*!< \brief Vector of ranks, from which this rank will receive halo + information. Self communication is included. */ + vector ranksSend; /*!< \brief Vector of ranks, to which this rank will send halo + information. Self communication is included. */ - vector > entitiesSend; /*!< \brief Vector of vector, which contains the entities that - must be sent. Self communication is included. For DG - an entitity is an element, for regular FEM an entity - is a DOF. */ + vector > entitiesSend; /*!< \brief Vector of vector, which contains the entities that + must be sent. Self communication is included. For DG + an entitity is an element, for regular FEM an entity + is a DOF. */ vector > entitiesRecv; /*!< \brief Vector of vector, which contains the entities that must be received. Self communication is included. For DG an entity is an element, for regular FEM an entity is a DOF. */ - vector standardBoundaryFacesSol; /*!< \brief Vector that contains the standard boundary - faces used for the solution of the DG solver. */ - vector standardBoundaryFacesGrid; /*!< \brief Vector that contains the standard boundary - faces used for the geometry of the DG solver. */ + vector + standardBoundaryFacesSol; /*!< \brief Vector that contains the standard boundary + faces used for the solution of the DG solver. */ + vector + standardBoundaryFacesGrid; /*!< \brief Vector that contains the standard boundary + faces used for the geometry of the DG solver. */ - CBlasStructure *blasFunctions{nullptr}; /*!< \brief Pointer to the object to carry out the BLAS functionalities. */ + CBlasStructure* blasFunctions{nullptr}; /*!< \brief Pointer to the object to carry out the BLAS functionalities. */ -public: + public: /*! - * \brief Constructor of the class. - */ - CMeshFEM(void) : CGeometry() { } + * \brief Constructor of the class. + */ + CMeshFEM(void) : CGeometry() {} /*! - * \overload - * \brief Redistributes the grid over the ranks and creates the halo layer. - * \param[in] geometry - The linear distributed grid that must be redistributed. - * \param[in] config - Definition of the particular problem. - */ - CMeshFEM(CGeometry *geometry, CConfig *config); + * \overload + * \brief Redistributes the grid over the ranks and creates the halo layer. + * \param[in] geometry - The linear distributed grid that must be redistributed. + * \param[in] config - Definition of the particular problem. + */ + CMeshFEM(CGeometry* geometry, CConfig* config); /*! - * \brief Destructor of the class. - */ + * \brief Destructor of the class. + */ ~CMeshFEM(void) override { delete blasFunctions; } /*! - * \brief Function, which makes available the boundaries of the local FEM mesh. - * \return Pointer to the boundaries of the local FEM mesh. - */ - inline CBoundaryFEM* GetBoundaries(void) {return boundaries.data();} + * \brief Function, which makes available the boundaries of the local FEM mesh. + * \return Pointer to the boundaries of the local FEM mesh. + */ + inline CBoundaryFEM* GetBoundaries(void) { return boundaries.data(); } /*! - * \brief Function, which makes available the mesh points of the local FEM mesh. - * \return Pointer to the mesh points of the local FEM mesh. - */ - inline CPointFEM *GetMeshPoints(void) {return meshPoints.data();} + * \brief Function, which makes available the mesh points of the local FEM mesh. + * \return Pointer to the mesh points of the local FEM mesh. + */ + inline CPointFEM* GetMeshPoints(void) { return meshPoints.data(); } /*! - * \brief Function, which makes available the number of mesh points of the local FEM mesh. - * \return Number of mesh points of the local FEM mesh. - */ - inline unsigned long GetNMeshPoints(void) {return meshPoints.size();} + * \brief Function, which makes available the number of mesh points of the local FEM mesh. + * \return Number of mesh points of the local FEM mesh. + */ + inline unsigned long GetNMeshPoints(void) { return meshPoints.size(); } /*! - * \brief Function, which makes available the number of owned volume elements in the local FEM mesh. - * \return Number of owned volume elements of the local FEM mesh. - */ - inline unsigned long GetNVolElemOwned(void) const {return nVolElemOwned;} + * \brief Function, which makes available the number of owned volume elements in the local FEM mesh. + * \return Number of owned volume elements of the local FEM mesh. + */ + inline unsigned long GetNVolElemOwned(void) const { return nVolElemOwned; } /*! - * \brief Function, which makes available the total number of volume elements in the local FEM mesh. - * \return Total number of volume elements of the local FEM mesh. - */ - inline unsigned long GetNVolElemTot(void) const {return nVolElemTot;} + * \brief Function, which makes available the total number of volume elements in the local FEM mesh. + * \return Total number of volume elements of the local FEM mesh. + */ + inline unsigned long GetNVolElemTot(void) const { return nVolElemTot; } /*! - * \brief Function, which makes available the volume elements in the local FEM mesh. - * \return Pointer to the volume elements of the local FEM mesh. - */ - inline CVolumeElementFEM* GetVolElem(void) {return volElem.data();} + * \brief Function, which makes available the volume elements in the local FEM mesh. + * \return Pointer to the volume elements of the local FEM mesh. + */ + inline CVolumeElementFEM* GetVolElem(void) { return volElem.data(); } /*! - * \brief Function, which makes available the number of owned volume elements per time level. - * \return The pointer to the data of nVolElemOwnedPerTimeLevel. - */ - inline unsigned long* GetNVolElemOwnedPerTimeLevel(void) {return nVolElemOwnedPerTimeLevel.data();} + * \brief Function, which makes available the number of owned volume elements per time level. + * \return The pointer to the data of nVolElemOwnedPerTimeLevel. + */ + inline unsigned long* GetNVolElemOwnedPerTimeLevel(void) { return nVolElemOwnedPerTimeLevel.data(); } /*! - * \brief Function, which makes available the number of internal volume elements per time level. - * \return The pointer to the data of nVolElemInternalPerTimeLevel. - */ - inline unsigned long* GetNVolElemInternalPerTimeLevel(void) {return nVolElemInternalPerTimeLevel.data();} + * \brief Function, which makes available the number of internal volume elements per time level. + * \return The pointer to the data of nVolElemInternalPerTimeLevel. + */ + inline unsigned long* GetNVolElemInternalPerTimeLevel(void) { return nVolElemInternalPerTimeLevel.data(); } /*! - * \brief Function, which makes available the number of halo volume elements per time level. - * \return The pointer to the data of nVolElemHaloPerTimeLevel. - */ - inline unsigned long* GetNVolElemHaloPerTimeLevel(void) {return nVolElemHaloPerTimeLevel.data();} + * \brief Function, which makes available the number of halo volume elements per time level. + * \return The pointer to the data of nVolElemHaloPerTimeLevel. + */ + inline unsigned long* GetNVolElemHaloPerTimeLevel(void) { return nVolElemHaloPerTimeLevel.data(); } /*! * \brief Function, which makes available the vector of vectors containing the owned element IDs adjacent to elements of a lower time level. Note that a copy is made. * \return Copy of ownedElemAdjLowTimeLevel. */ - inline vector > GetOwnedElemAdjLowTimeLevel(void) {return ownedElemAdjLowTimeLevel;} + inline vector > GetOwnedElemAdjLowTimeLevel(void) { return ownedElemAdjLowTimeLevel; } /*! * \brief Function, which makes available the vector of vectors containing the halo element IDs adjacent to elements of a lower time level. Note that a copy is made. * \return Copy of haloElemAdjLowTimeLevel. */ - inline vector > GetHaloElemAdjLowTimeLevel(void) {return haloElemAdjLowTimeLevel;} + inline vector > GetHaloElemAdjLowTimeLevel(void) { return haloElemAdjLowTimeLevel; } /*! - * \brief Function, which makes available the number of standard boundary faces of the solution. - * \return Number of standard boundary faces of the solution. - */ - inline unsigned short GetNStandardBoundaryFacesSol(void) {return standardBoundaryFacesSol.size();} + * \brief Function, which makes available the number of standard boundary faces of the solution. + * \return Number of standard boundary faces of the solution. + */ + inline unsigned short GetNStandardBoundaryFacesSol(void) { return standardBoundaryFacesSol.size(); } /*! - * \brief Function, which makes available the standard boundary faces of the solution. - * \return Pointer to the standard boundary faces of the solution. - */ - inline CFEMStandardBoundaryFace* GetStandardBoundaryFacesSol(void) {return standardBoundaryFacesSol.data();} + * \brief Function, which makes available the standard boundary faces of the solution. + * \return Pointer to the standard boundary faces of the solution. + */ + inline CFEMStandardBoundaryFace* GetStandardBoundaryFacesSol(void) { return standardBoundaryFacesSol.data(); } /*! * \brief Function, which makes available the vector of receive ranks as a const reference. * \return Const reference to the vector of ranks. */ - inline const vector& GetRanksRecv(void) const {return ranksRecv;} + inline const vector& GetRanksRecv(void) const { return ranksRecv; } /*! * \brief Function, which makes available the vector of send ranks as a const reference. * \return Const reference to the vector of ranks. */ - inline const vector& GetRanksSend(void) const {return ranksSend;} + inline const vector& GetRanksSend(void) const { return ranksSend; } /*! * \brief Function, which makes available the vector of vectors containing the receive entities as a const reference. * \return Const reference to the vector of vectors of receive entities. */ - inline const vector >& GetEntitiesRecv(void) const {return entitiesRecv;} + inline const vector >& GetEntitiesRecv(void) const { return entitiesRecv; } /*! * \brief Function, which makes available the vector of vectors containing the send entities as a const reference. * \return Const reference to the vector of vectors of send entities. */ - inline const vector >& GetEntitiesSend(void) const {return entitiesSend;} + inline const vector >& GetEntitiesSend(void) const { return entitiesSend; } /*! * \brief Function, which makes available the vector of rotational periodic markers as a const reference. * \return Const reference to the vector with rotational periodic markers. */ - inline const vector& GetRotPerMarkers(void) const {return rotPerMarkers;} + inline const vector& GetRotPerMarkers(void) const { return rotPerMarkers; } /*! * \brief Function, which makes available the vector of vectors containing the rotational periodic halos as a const reference. * \return Const reference to the vector of vectors with rotational periodic halos. */ - inline const vector >& GetRotPerHalos(void) const {return rotPerHalos;} + inline const vector >& GetRotPerHalos(void) const { return rotPerHalos; } /*! - * \brief Compute surface area (positive z-direction) for force coefficient non-dimensionalization. - * \param[in] config - Definition of the particular problem. - */ - void SetPositive_ZArea(CConfig *config) override; + * \brief Compute surface area (positive z-direction) for force coefficient non-dimensionalization. + * \param[in] config - Definition of the particular problem. + */ + void SetPositive_ZArea(CConfig* config) override; -protected: + protected: /*! * \brief Function, which computes the gradients of the parametric coordinates w.r.t. the Cartesian coordinates in the integration points of a face, @@ -653,12 +645,9 @@ class CMeshFEM: public CGeometry { * \param[out] derivCoor - Storage for the derivatives of the coordinates. * \param[in] config - Definition of the particular problem. */ - void ComputeGradientsCoordinatesFace(const unsigned short nIntegration, - const unsigned short nDOFs, - const su2double *matDerBasisInt, - const unsigned long *DOFs, - su2double *derivCoor, - CConfig *config); + void ComputeGradientsCoordinatesFace(const unsigned short nIntegration, const unsigned short nDOFs, + const su2double* matDerBasisInt, const unsigned long* DOFs, su2double* derivCoor, + CConfig* config); /*! * \brief Function, which computes the gradients of the Cartesian coordinates w.r.t. the parametric coordinates in the given set of integration @@ -673,12 +662,9 @@ class CMeshFEM: public CGeometry { * \param[out] derivCoor - Storage for the derivatives of the coordinates. * \param[in] config - Definition of the particular problem. */ - void ComputeGradientsCoorWRTParam(const unsigned short nIntegration, - const unsigned short nDOFs, - const su2double *matDerBasisInt, - const unsigned long *DOFs, - su2double *derivCoor, - CConfig *config); + void ComputeGradientsCoorWRTParam(const unsigned short nIntegration, const unsigned short nDOFs, + const su2double* matDerBasisInt, const unsigned long* DOFs, su2double* derivCoor, + CConfig* config); /*! * \brief Function, which computes the information of the normals in the integration points of a face. @@ -690,12 +676,8 @@ class CMeshFEM: public CGeometry { * \param[in] DOFs - The DOFs of the grid associated with the face. * \param[out] normals - Storage for the normal information to be computed. */ - void ComputeNormalsFace(const unsigned short nIntegration, - const unsigned short nDOFs, - const su2double *dr, - const su2double *ds, - const unsigned long *DOFs, - su2double *normals); + void ComputeNormalsFace(const unsigned short nIntegration, const unsigned short nDOFs, const su2double* dr, + const su2double* ds, const unsigned long* DOFs, su2double* normals); /*! * \brief Function, which computes the metric terms of the faces of a @@ -704,18 +686,17 @@ class CMeshFEM: public CGeometry { terms must be computed. * \param[in] config - Definition of the particular problem. */ - void MetricTermsBoundaryFaces(CBoundaryFEM *boundary, - CConfig *config); + void MetricTermsBoundaryFaces(CBoundaryFEM* boundary, CConfig* config); }; /*! * \class CMeshFEM_DG * \brief Class which contains all the variables for the DG FEM solver. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ -class CMeshFEM_DG: public CMeshFEM { -protected: +class CMeshFEM_DG : public CMeshFEM { + protected: vector standardElementsSol; /*!< \brief Vector that contains the standard volume elements used for the solution of the DG solver. */ vector standardElementsGrid; /*!< \brief Vector that contains the standard volume elements @@ -728,159 +709,160 @@ class CMeshFEM_DG: public CMeshFEM { internal faces used for the geometry of the DG solver. */ - vector timeCoefADER_DG; /*!< \brief The time coefficients in the iteration matrix of - the ADER-DG predictor step. */ - vector timeInterpolDOFToIntegrationADER_DG; /*!< \brief The interpolation matrix between the time DOFs and - the time integration points for ADER-DG. */ - vector timeInterpolAdjDOFToIntegrationADER_DG; /*!< \brief The interpolation matrix between the time DOFs of adjacent - elements of a higher time level and the time integration - points for ADER-DG. */ + vector timeCoefADER_DG; /*!< \brief The time coefficients in the iteration matrix of + the ADER-DG predictor step. */ + vector timeInterpolDOFToIntegrationADER_DG; /*!< \brief The interpolation matrix between the time DOFs and + the time integration points for ADER-DG. */ + vector timeInterpolAdjDOFToIntegrationADER_DG; /*!< \brief The interpolation matrix between the time DOFs + of adjacent elements of a higher time level and the time + integration points for ADER-DG. */ - vector nMatchingFacesInternal; /*!< \brief Number of matching faces between between two owned elements - per time level. Cumulative storage format. */ - vector nMatchingFacesWithHaloElem; /*!< \brief Number of matching faces between an owned element and a halo - element per time level. Cumulative storage format. */ - vector matchingFaces; /*!< \brief Vector of the local matching internal faces. */ + vector nMatchingFacesInternal; /*!< \brief Number of matching faces between between two owned elements + per time level. Cumulative storage format. */ + vector nMatchingFacesWithHaloElem; /*!< \brief Number of matching faces between an owned element and a + halo element per time level. Cumulative storage format. */ + vector matchingFaces; /*!< \brief Vector of the local matching internal faces. */ map Global_to_Local_Point; /*!< \brief Global-local mapping for the DOFs. */ -public: + public: /*! * \brief Constructor of the class. */ CMeshFEM_DG(void) : CMeshFEM() {} /*! - * \overload - * \brief Redistributes the grid over the ranks and creates the halo layer. - * \param[in] geometry - The linear distributed grid that must be redistributed. - * \param[in] config - Definition of the particular problem. - */ - CMeshFEM_DG(CGeometry *geometry, CConfig *config); + * \overload + * \brief Redistributes the grid over the ranks and creates the halo layer. + * \param[in] geometry - The linear distributed grid that must be redistributed. + * \param[in] config - Definition of the particular problem. + */ + CMeshFEM_DG(CGeometry* geometry, CConfig* config); - /*! - * \brief Function to compute the coordinates of the integration points. - */ + /*! + * \brief Function to compute the coordinates of the integration points. + */ void CoordinatesIntegrationPoints(void); - /*! - * \brief Function to compute the coordinates of solution DOFs. - */ + /*! + * \brief Function to compute the coordinates of solution DOFs. + */ void CoordinatesSolDOFs(void); - /*! - * \brief Function to create the faces used in the DG formulation. - * \param[in] config - Definition of the particular problem. - */ - void CreateFaces(CConfig *config); + /*! + * \brief Function to create the faces used in the DG formulation. + * \param[in] config - Definition of the particular problem. + */ + void CreateFaces(CConfig* config); - /*! - * \brief Function to create the standard volume elements. - * \param[in] config - Definition of the particular problem. - */ - void CreateStandardVolumeElements(CConfig *config); + /*! + * \brief Function to create the standard volume elements. + * \param[in] config - Definition of the particular problem. + */ + void CreateStandardVolumeElements(CConfig* config); - /*! - * \brief Function, which makes available the time coefficients in the - iteration matrix of the ADER-DG predictor step. - * \return The time coefficients in the iteration matrix of ADER-DG. - */ - inline su2double* GetTimeCoefADER_DG(void) {return timeCoefADER_DG.data();} + /*! + * \brief Function, which makes available the time coefficients in the + iteration matrix of the ADER-DG predictor step. + * \return The time coefficients in the iteration matrix of ADER-DG. + */ + inline su2double* GetTimeCoefADER_DG(void) { return timeCoefADER_DG.data(); } - /*! - * \brief Function, which makes available the time interpolation matrix between - the time DOFs and time integration points for ADER-DG. - * \return The time interpolation matrix for ADER-DG. - */ - inline su2double* GetTimeInterpolDOFToIntegrationADER_DG(void) {return timeInterpolDOFToIntegrationADER_DG.data();} + /*! + * \brief Function, which makes available the time interpolation matrix between + the time DOFs and time integration points for ADER-DG. + * \return The time interpolation matrix for ADER-DG. + */ + inline su2double* GetTimeInterpolDOFToIntegrationADER_DG(void) { return timeInterpolDOFToIntegrationADER_DG.data(); } - /*! - * \brief Function, which makes available the time interpolation matrix between - the adjacent time DOFs of the next time level and the time - integration points for ADER-DG. - * \return The time interpolation matrix of adjacent time DOFs for ADER-DG. - */ - inline su2double* GetTimeInterpolAdjDOFToIntegrationADER_DG(void) {return timeInterpolAdjDOFToIntegrationADER_DG.data();} + /*! + * \brief Function, which makes available the time interpolation matrix between + the adjacent time DOFs of the next time level and the time + integration points for ADER-DG. + * \return The time interpolation matrix of adjacent time DOFs for ADER-DG. + */ + inline su2double* GetTimeInterpolAdjDOFToIntegrationADER_DG(void) { + return timeInterpolAdjDOFToIntegrationADER_DG.data(); + } - /*! - * \brief Function, which makes available the number of matching internal faces - between an owned element and a halo element per time level. - * \return The number of matching internal faces between these elements per time level. - */ - inline unsigned long *GetNMatchingFacesWithHaloElem(void) {return nMatchingFacesWithHaloElem.data();} + /*! + * \brief Function, which makes available the number of matching internal faces + between an owned element and a halo element per time level. + * \return The number of matching internal faces between these elements per time level. + */ + inline unsigned long* GetNMatchingFacesWithHaloElem(void) { return nMatchingFacesWithHaloElem.data(); } - /*! - * \brief Function, which makes available the number of matching internal faces - between two owned elements per time level. - * \return The number of matching internal faces per time level. - */ - inline unsigned long *GetNMatchingFacesInternal(void) {return nMatchingFacesInternal.data();} + /*! + * \brief Function, which makes available the number of matching internal faces + between two owned elements per time level. + * \return The number of matching internal faces per time level. + */ + inline unsigned long* GetNMatchingFacesInternal(void) { return nMatchingFacesInternal.data(); } - /*! - * \brief Function, which makes available the matching internal faces. - * \return Pointer to the matching internal faces. - */ - inline CInternalFaceElementFEM* GetMatchingFaces(void) {return matchingFaces.data();} + /*! + * \brief Function, which makes available the matching internal faces. + * \return Pointer to the matching internal faces. + */ + inline CInternalFaceElementFEM* GetMatchingFaces(void) { return matchingFaces.data(); } - /*! - * \brief Function to compute the grid velocities for static problems. - * \param[in] config - Definition of the particular problem. - * \param[in] Kind_Grid_Movement - The type of prescribed grid motion. - * \param[in] iZone - The currently active zone number. - */ - void InitStaticMeshMovement(const CConfig *config, - const unsigned short Kind_Grid_Movement, + /*! + * \brief Function to compute the grid velocities for static problems. + * \param[in] config - Definition of the particular problem. + * \param[in] Kind_Grid_Movement - The type of prescribed grid motion. + * \param[in] iZone - The currently active zone number. + */ + void InitStaticMeshMovement(const CConfig* config, const unsigned short Kind_Grid_Movement, const unsigned short iZone); - /*! - * \brief Function, which makes available the number of standard volume elements of the solution. - * \return Number of standard volume elements of the solution. - */ - inline unsigned short GetNStandardElementsSol(void) {return standardElementsSol.size();} + /*! + * \brief Function, which makes available the number of standard volume elements of the solution. + * \return Number of standard volume elements of the solution. + */ + inline unsigned short GetNStandardElementsSol(void) { return standardElementsSol.size(); } - /*! - * \brief Function, which makes available the standard volume elements of the solution. - * \return Pointer to the standard volume elements of the solution. - */ - inline CFEMStandardElement* GetStandardElementsSol(void) {return standardElementsSol.data();} + /*! + * \brief Function, which makes available the standard volume elements of the solution. + * \return Pointer to the standard volume elements of the solution. + */ + inline CFEMStandardElement* GetStandardElementsSol(void) { return standardElementsSol.data(); } - /*! - * \brief Function, which makes available the number of standard internal matching faces of the solution. - * \return Number of standard internal matching faces of the solution. - */ - inline unsigned short GetNStandardMatchingFacesSol(void) {return standardMatchingFacesSol.size();} + /*! + * \brief Function, which makes available the number of standard internal matching faces of the solution. + * \return Number of standard internal matching faces of the solution. + */ + inline unsigned short GetNStandardMatchingFacesSol(void) { return standardMatchingFacesSol.size(); } - /*! - * \brief Function, which makes available the standard internal matching faces of the solution. - * \return Pointer to the standard internal matching faces of the solution. - */ - inline CFEMStandardInternalFace* GetStandardMatchingFacesSol(void) {return standardMatchingFacesSol.data();} + /*! + * \brief Function, which makes available the standard internal matching faces of the solution. + * \return Pointer to the standard internal matching faces of the solution. + */ + inline CFEMStandardInternalFace* GetStandardMatchingFacesSol(void) { return standardMatchingFacesSol.data(); } - /*! - * \brief Function, which computes a length scale of the volume elements. - * \param[in] config - Definition of the particular problem. - */ + /*! + * \brief Function, which computes a length scale of the volume elements. + * \param[in] config - Definition of the particular problem. + */ void LengthScaleVolumeElements(void); - /*! - * \brief Function, which computes the metric terms of the surface - elements, both internal faces and physical boundary faces. - * \param[in] config - Definition of the particular problem. - */ - void MetricTermsSurfaceElements(CConfig *config); + /*! + * \brief Function, which computes the metric terms of the surface + elements, both internal faces and physical boundary faces. + * \param[in] config - Definition of the particular problem. + */ + void MetricTermsSurfaceElements(CConfig* config); - /*! - * \brief Function, which computes the metric terms of the - volume elements. - * \param[in] config - Definition of the particular problem. - */ - void MetricTermsVolumeElements(CConfig *config); + /*! + * \brief Function, which computes the metric terms of the + volume elements. + * \param[in] config - Definition of the particular problem. + */ + void MetricTermsVolumeElements(CConfig* config); - /*! - * \brief Set the send receive boundaries of the grid. - * \param[in] config - Definition of the particular problem. - */ - void SetSendReceive(const CConfig *config) override; + /*! + * \brief Set the send receive boundaries of the grid. + * \param[in] config - Definition of the particular problem. + */ + void SetSendReceive(const CConfig* config) override; /*! * \brief Set the local index that correspond with the global numbering index. @@ -894,8 +876,7 @@ class CMeshFEM_DG: public CMeshFEM { */ inline long GetGlobal_to_Local_Point(unsigned long val_ipoint) const override { auto it = Global_to_Local_Point.find(val_ipoint); - if (it != Global_to_Local_Point.cend()) - return it->second; + if (it != Global_to_Local_Point.cend()) return it->second; return -1; } @@ -903,44 +884,39 @@ class CMeshFEM_DG: public CMeshFEM { * \brief Function, which carries out the preprocessing tasks when wall functions are used. * \param[in] config - Definition of the particular problem. */ - void WallFunctionPreprocessing(CConfig *config); + void WallFunctionPreprocessing(CConfig* config); -protected: - /*! - * \brief Function, which computes the correct sequence of the connectivities - of a face, such that it matches the sequence of the given corner points. - * \param[in] VTK_TypeFace - Type of the face using the VTK convention. - * \param[in] cornerPointsFace - The corner points of the face in the desired - sequence. - * \param[in] VTK_TypeElem - Type of the element using the VTK convention. - * \param[in] nPolyGrid - Polynomial degree used in the grid definition - for the face and the element. - * \param[in] elemNodeIDsGrid - The node IDs of the grid DOFs of the element, - i.e. the element connectivity. - * \param[in] nPolyConn - Polynomial degree of the connectivities to - be modified. - * \param[in] connElem - Connectivity of the adjacent volume element. - * \param[out] swapFaceInElement - Whether or not the connectivity of the face must - be swapped compared to the face of the corresponding - standard element. Only relevant for triangular faces - of a pyramid and quadrilateral faces of a prism. - corresponds to the top point of the adjacent pyramid. - * \param[out] modConnFace - Connectivity of the face after the renumbering. - * \param[out] modConnElem - Connectivity of the element after the renumbering. - This renumbering is such that the face corresponds - to the appropriate face of the element used in the - standard faces and also the corner points match. - */ - void CreateConnectivitiesFace(const unsigned short VTK_TypeFace, - const unsigned long *cornerPointsFace, - const unsigned short VTK_TypeElem, - const unsigned short nPolyGrid, - const vector &elemNodeIDsGrid, - const unsigned short nPolyConn, - const unsigned long *connElem, - bool &swapFaceInElement, - unsigned long *modConnFace, - unsigned long *modConnElem); + protected: + /*! + * \brief Function, which computes the correct sequence of the connectivities + of a face, such that it matches the sequence of the given corner points. + * \param[in] VTK_TypeFace - Type of the face using the VTK convention. + * \param[in] cornerPointsFace - The corner points of the face in the desired + sequence. + * \param[in] VTK_TypeElem - Type of the element using the VTK convention. + * \param[in] nPolyGrid - Polynomial degree used in the grid definition + for the face and the element. + * \param[in] elemNodeIDsGrid - The node IDs of the grid DOFs of the element, + i.e. the element connectivity. + * \param[in] nPolyConn - Polynomial degree of the connectivities to + be modified. + * \param[in] connElem - Connectivity of the adjacent volume element. + * \param[out] swapFaceInElement - Whether or not the connectivity of the face must + be swapped compared to the face of the corresponding + standard element. Only relevant for triangular faces + of a pyramid and quadrilateral faces of a prism. + corresponds to the top point of the adjacent pyramid. + * \param[out] modConnFace - Connectivity of the face after the renumbering. + * \param[out] modConnElem - Connectivity of the element after the renumbering. + This renumbering is such that the face corresponds + to the appropriate face of the element used in the + standard faces and also the corner points match. + */ + void CreateConnectivitiesFace(const unsigned short VTK_TypeFace, const unsigned long* cornerPointsFace, + const unsigned short VTK_TypeElem, const unsigned short nPolyGrid, + const vector& elemNodeIDsGrid, const unsigned short nPolyConn, + const unsigned long* connElem, bool& swapFaceInElement, unsigned long* modConnFace, + unsigned long* modConnElem); /*! * \brief Function, which computes the correct sequence of the connectivities @@ -960,14 +936,11 @@ class CMeshFEM_DG: public CMeshFEM { renumbering. This renumbering is such that the line corresponds to face 0 of the quadrilateral. */ - void CreateConnectivitiesLineAdjacentQuadrilateral( - const unsigned long *cornerPointsLine, - const unsigned short nPolyGrid, - const vector &quadNodeIDsGrid, - const unsigned short nPolyConn, - const unsigned long *connQuad, - unsigned long *modConnLine, - unsigned long *modConnQuad); + void CreateConnectivitiesLineAdjacentQuadrilateral(const unsigned long* cornerPointsLine, + const unsigned short nPolyGrid, + const vector& quadNodeIDsGrid, + const unsigned short nPolyConn, const unsigned long* connQuad, + unsigned long* modConnLine, unsigned long* modConnQuad); /*! * \brief Function, which computes the correct sequence of the connectivities @@ -987,14 +960,10 @@ class CMeshFEM_DG: public CMeshFEM { renumbering. This renumbering is such that the line corresponds to face 0 of the triangle. */ - void CreateConnectivitiesLineAdjacentTriangle( - const unsigned long *cornerPointsLine, - const unsigned short nPolyGrid, - const vector &triaNodeIDsGrid, - const unsigned short nPolyConn, - const unsigned long *connTria, - unsigned long *modConnLine, - unsigned long *modConnTria); + void CreateConnectivitiesLineAdjacentTriangle(const unsigned long* cornerPointsLine, const unsigned short nPolyGrid, + const vector& triaNodeIDsGrid, + const unsigned short nPolyConn, const unsigned long* connTria, + unsigned long* modConnLine, unsigned long* modConnTria); /*! * \brief Function, which computes the correct sequence of the connectivities @@ -1014,14 +983,12 @@ class CMeshFEM_DG: public CMeshFEM { renumbering. This renumbering is such that the quad corresponds to face 0 of the hexahedron. */ - void CreateConnectivitiesQuadrilateralAdjacentHexahedron( - const unsigned long *cornerPointsQuad, - const unsigned short nPolyGrid, - const vector &hexaNodeIDsGrid, - const unsigned short nPolyConn, - const unsigned long *connHexa, - unsigned long *modConnQuad, - unsigned long *modConnHexa); + void CreateConnectivitiesQuadrilateralAdjacentHexahedron(const unsigned long* cornerPointsQuad, + const unsigned short nPolyGrid, + const vector& hexaNodeIDsGrid, + const unsigned short nPolyConn, + const unsigned long* connHexa, unsigned long* modConnQuad, + unsigned long* modConnHexa); /*! * \brief Function, which computes the correct sequence of the connectivities @@ -1044,15 +1011,12 @@ class CMeshFEM_DG: public CMeshFEM { renumbering. This renumbering is such that the quad corresponds to face 3 of the prism. */ - void CreateConnectivitiesQuadrilateralAdjacentPrism( - const unsigned long *cornerPointsQuad, - const unsigned short nPolyGrid, - const vector &prismNodeIDsGrid, - const unsigned short nPolyConn, - const unsigned long *connPrism, - bool &swapFaceInElement, - unsigned long *modConnQuad, - unsigned long *modConnPrism); + void CreateConnectivitiesQuadrilateralAdjacentPrism(const unsigned long* cornerPointsQuad, + const unsigned short nPolyGrid, + const vector& prismNodeIDsGrid, + const unsigned short nPolyConn, const unsigned long* connPrism, + bool& swapFaceInElement, unsigned long* modConnQuad, + unsigned long* modConnPrism); /*! * \brief Function, which computes the correct sequence of the connectivities @@ -1072,14 +1036,11 @@ class CMeshFEM_DG: public CMeshFEM { renumbering. This renumbering is such that the quad corresponds to face 0 of the pyramid. */ - void CreateConnectivitiesQuadrilateralAdjacentPyramid( - const unsigned long *cornerPointsQuad, - const unsigned short nPolyGrid, - const vector &pyraNodeIDsGrid, - const unsigned short nPolyConn, - const unsigned long *connPyra, - unsigned long *modConnQuad, - unsigned long *modConnPyra); + void CreateConnectivitiesQuadrilateralAdjacentPyramid(const unsigned long* cornerPointsQuad, + const unsigned short nPolyGrid, + const vector& pyraNodeIDsGrid, + const unsigned short nPolyConn, const unsigned long* connPyra, + unsigned long* modConnQuad, unsigned long* modConnPyra); /*! * \brief Function, which computes the correct sequence of the connectivities @@ -1099,14 +1060,10 @@ class CMeshFEM_DG: public CMeshFEM { renumbering. This renumbering is such that the triangle corresponds to face 0 of the prism. */ - void CreateConnectivitiesTriangleAdjacentPrism( - const unsigned long *cornerPointsTria, - const unsigned short nPolyGrid, - const vector &prismNodeIDsGrid, - const unsigned short nPolyConn, - const unsigned long *connPrism, - unsigned long *modConnTria, - unsigned long *modConnPrism); + void CreateConnectivitiesTriangleAdjacentPrism(const unsigned long* cornerPointsTria, const unsigned short nPolyGrid, + const vector& prismNodeIDsGrid, + const unsigned short nPolyConn, const unsigned long* connPrism, + unsigned long* modConnTria, unsigned long* modConnPrism); /*! * \brief Function, which computes the correct sequence of the connectivities @@ -1129,15 +1086,12 @@ class CMeshFEM_DG: public CMeshFEM { renumbering. This renumbering is such that the triangle corresponds to face 3 of the pyramid. */ - void CreateConnectivitiesTriangleAdjacentPyramid( - const unsigned long *cornerPointsTria, - const unsigned short nPolyGrid, - const vector &pyraNodeIDsGrid, - const unsigned short nPolyConn, - const unsigned long *connPyra, - bool &swapFaceInElement, - unsigned long *modConnTria, - unsigned long *modConnPyra); + void CreateConnectivitiesTriangleAdjacentPyramid(const unsigned long* cornerPointsTria, + const unsigned short nPolyGrid, + const vector& pyraNodeIDsGrid, + const unsigned short nPolyConn, const unsigned long* connPyra, + bool& swapFaceInElement, unsigned long* modConnTria, + unsigned long* modConnPyra); /*! * \brief Function, which computes the correct sequence of the connectivities @@ -1157,48 +1111,42 @@ class CMeshFEM_DG: public CMeshFEM { renumbering. This renumbering is such that the triangle corresponds to face 0 of the tetrahedron. */ - void CreateConnectivitiesTriangleAdjacentTetrahedron( - const unsigned long *cornerPointsTria, - const unsigned short nPolyGrid, - const vector &tetNodeIDsGrid, - const unsigned short nPolyConn, - const unsigned long *connTet, - unsigned long *modConnTria, - unsigned long *modConnTet); - - /*! - * \brief Function, which computes the parametric coordinates of the given - Cartesian coordinates inside the given parent element. - * \param[in] coor - Cartesian coordinates for which the parametric - coordinates must be determined. - * \param[in] parElem - The high order parent element which contains - the point. - * \param[in] subElem - Low order sub element inside the parent element - which contains the point. - * \param[in] weightsSubElem - Interpolation weights inside subElem for the - coordinates. Used for an initial guess. - * \param[out] parCoor - Parametric coordinates inside the high order - parent element for the given coordinates. - These parametric coordinates must be computed. - */ - void HighOrderContainmentSearch(const su2double *coor, - const unsigned long parElem, - const unsigned short subElem, - const su2double *weightsSubElem, - su2double *parCoor); + void CreateConnectivitiesTriangleAdjacentTetrahedron(const unsigned long* cornerPointsTria, + const unsigned short nPolyGrid, + const vector& tetNodeIDsGrid, + const unsigned short nPolyConn, const unsigned long* connTet, + unsigned long* modConnTria, unsigned long* modConnTet); + + /*! + * \brief Function, which computes the parametric coordinates of the given + Cartesian coordinates inside the given parent element. + * \param[in] coor - Cartesian coordinates for which the parametric + coordinates must be determined. + * \param[in] parElem - The high order parent element which contains + the point. + * \param[in] subElem - Low order sub element inside the parent element + which contains the point. + * \param[in] weightsSubElem - Interpolation weights inside subElem for the + coordinates. Used for an initial guess. + * \param[out] parCoor - Parametric coordinates inside the high order + parent element for the given coordinates. + These parametric coordinates must be computed. + */ + void HighOrderContainmentSearch(const su2double* coor, const unsigned long parElem, const unsigned short subElem, + const su2double* weightsSubElem, su2double* parCoor); /*! * \brief Function, which computes the metric terms for internal matching faces. * \param[in] config - Definition of the particular problem. */ - void MetricTermsMatchingFaces(CConfig *config); + void MetricTermsMatchingFaces(CConfig* config); /*! - * \brief Function, which computes the time coefficients for the ADER-DG predictor step. - * \param[in] config - Definition of the particular problem. - */ - void TimeCoefficientsPredictorADER_DG(CConfig *config); + * \brief Function, which computes the time coefficients for the ADER-DG predictor step. + * \param[in] config - Definition of the particular problem. + */ + void TimeCoefficientsPredictorADER_DG(CConfig* config); /*! * \brief Function, which computes the volume metric terms for the given @@ -1210,16 +1158,15 @@ class CMeshFEM_DG: public CMeshFEM { terms must be computed. * \param[out] metricTerms - Vector in which the metric terms must be stored. */ - void VolumeMetricTermsFromCoorGradients(const unsigned short nEntities, - const su2double *gradCoor, - vector &metricTerms); + void VolumeMetricTermsFromCoorGradients(const unsigned short nEntities, const su2double* gradCoor, + vector& metricTerms); /*! * \brief Compute an ADT including the coordinates of all viscous markers * \param[in] config - Definition of the particular problem. * \return pointer to the ADT */ - std::unique_ptr ComputeViscousWallADT(const CConfig *config) const override; + std::unique_ptr ComputeViscousWallADT(const CConfig* config) const override; /*! * \brief Set wall distances a specific value @@ -1245,12 +1192,10 @@ class CMeshFEM_DG: public CMeshFEM { * \author T. Albring */ class CDummyMeshFEM_DG : public CMeshFEM_DG { - -public: + public: /*! * \brief Constructor of the class * \param[in] config - Definition of the particular problem. */ - CDummyMeshFEM_DG(CConfig *config); - + CDummyMeshFEM_DG(CConfig* config); }; diff --git a/Common/include/fem/fem_standard_element.hpp b/Common/include/fem/fem_standard_element.hpp index 6d871b0bee0..7457fe715cf 100644 --- a/Common/include/fem/fem_standard_element.hpp +++ b/Common/include/fem/fem_standard_element.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main functions for the FEM standard elements. * The functions are in the fem_standard_element.cpp file. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -40,33 +40,35 @@ using namespace std; * \class CFEMStandardElementBase * \brief Base class for a FEM standard element. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CFEMStandardElementBase { -protected: + protected: unsigned short VTK_Type; /*!< \brief Element type using the VTK convention. */ unsigned short orderExact; /*!< \brief Polynomial order that must be integrated exactly by the integration rule. */ unsigned short nIntegration; /*!< \brief Number of points used in the numerical integration. */ - bool constJacobian; /*!< \brief Whether or not the element has a constant Jacobian. */ + bool constJacobian; /*!< \brief Whether or not the element has a constant Jacobian. */ vector rIntegration; /*!< \brief r-location of the integration points for this standard element. */ - vector sIntegration; /*!< \brief s-location of the integration points for this standard element, if needed. */ - vector tIntegration; /*!< \brief t-location of the integration points for this standard element, if needed. */ + vector + sIntegration; /*!< \brief s-location of the integration points for this standard element, if needed. */ + vector + tIntegration; /*!< \brief t-location of the integration points for this standard element, if needed. */ vector wIntegration; /*!< \brief The weights of the integration points for this standard element. */ -public: + public: /*! - * \brief Constructor. Nothing to be done. - */ + * \brief Constructor. Nothing to be done. + */ CFEMStandardElementBase() = default; /*! - * \brief Destructor. Nothing to be done, because the vectors are deleted automatically. - */ + * \brief Destructor. Nothing to be done, because the vectors are deleted automatically. + */ virtual ~CFEMStandardElementBase() = default; -protected: + protected: /*! * \brief Alternative constructor. * \param[in] val_VTK_Type - Type of the element using the VTK convention. @@ -78,24 +80,21 @@ class CFEMStandardElementBase { be determined from the polynomial degree and the parameters in config. */ - CFEMStandardElementBase(unsigned short val_VTK_Type, - unsigned short val_nPoly, - bool val_constJac, - CConfig *config, + CFEMStandardElementBase(unsigned short val_VTK_Type, unsigned short val_nPoly, bool val_constJac, CConfig* config, unsigned short val_orderExact); -public: + public: /*! - * \brief Function, which makes available the type of the element. - * \return The type of the element using the VTK convention. - */ - inline unsigned short GetVTK_Type(void) const {return VTK_Type;} + * \brief Function, which makes available the type of the element. + * \return The type of the element using the VTK convention. + */ + inline unsigned short GetVTK_Type(void) const { return VTK_Type; } /*! - * \brief Function, which makes available the weights in the integration points. - * \return The const pointer to data, which stores the weights in the integration points. - */ - inline const su2double* GetWeightsIntegration(void) const {return wIntegration.data();} + * \brief Function, which makes available the weights in the integration points. + * \return The const pointer to data, which stores the weights in the integration points. + */ + inline const su2double* GetWeightsIntegration(void) const { return wIntegration.data(); } /*! * \brief Static function, which makes available the number of DOFs for an element @@ -105,51 +104,45 @@ class CFEMStandardElementBase { * \param[in] typeErrorMessage - Default argument used to write a good error message. * \return The number of DOFs */ - static unsigned short GetNDOFsStatic(unsigned short VTK_Type, - unsigned short nPoly, - unsigned long typeErrorMessage = 0); + static unsigned short GetNDOFsStatic(unsigned short VTK_Type, unsigned short nPoly, + unsigned long typeErrorMessage = 0); /*! - * \brief Function, which makes available the number of integration points for this standard element. - * \return The number of integration points of this standard element. - */ - inline unsigned short GetNIntegration(void) const {return nIntegration;} + * \brief Function, which makes available the number of integration points for this standard element. + * \return The number of integration points of this standard element. + */ + inline unsigned short GetNIntegration(void) const { return nIntegration; } /*! - * \brief Function, which makes available the polynomial order that must be integrated exactly. - * \return The polynomial order that must be integrated exactly. - */ - inline unsigned short GetOrderExact(void) const {return orderExact;} + * \brief Function, which makes available the polynomial order that must be integrated exactly. + * \return The polynomial order that must be integrated exactly. + */ + inline unsigned short GetOrderExact(void) const { return orderExact; } /*! - * \brief Static function, which computes the inverse of the given square matrix. - * \param[in] n - Number of rows/columns of the square matrix A. - * \param[in,out] A - On input the square matrix to be inverted. On output the inverse. - */ - static void InverseMatrix(unsigned short n, - vector &A); + * \brief Static function, which computes the inverse of the given square matrix. + * \param[in] n - Number of rows/columns of the square matrix A. + * \param[in,out] A - On input the square matrix to be inverted. On output the inverse. + */ + static void InverseMatrix(unsigned short n, vector& A); /*! - * \brief Function, which computes the gradient of the Vandermonde matrix for a standard 1D edge. - * \param[in] nDOFs - Number of DOFs, which in 1D is the polynomial degree + 1. - * \param[in] r - Parametric coordinates for which the gradient of the Vandermonde matrix must be computed. - * \param[out] VDr - Matrix to store the gradient of the Vandermonde matrix in all r-locations. - */ - void GradVandermonde1D(unsigned short nDOFs, - const vector &r, - vector &VDr); + * \brief Function, which computes the gradient of the Vandermonde matrix for a standard 1D edge. + * \param[in] nDOFs - Number of DOFs, which in 1D is the polynomial degree + 1. + * \param[in] r - Parametric coordinates for which the gradient of the Vandermonde matrix must be computed. + * \param[out] VDr - Matrix to store the gradient of the Vandermonde matrix in all r-locations. + */ + void GradVandermonde1D(unsigned short nDOFs, const vector& r, vector& VDr); /*! - * \brief Function, which computes the Vandermonde matrix for a standard 1D edge. - * \param[in] nDOFs - Number of DOFs, which in 1D is the polynomial degree + 1. - * \param[in] r - Parametric coordinates for which the Vandermonde matrix must be computed. - * \param[out] V - Matrix to store the Vandermonde matrix in all r-locations. - */ - void Vandermonde1D(unsigned short nDOFs, - const vector &r, - vector &V); + * \brief Function, which computes the Vandermonde matrix for a standard 1D edge. + * \param[in] nDOFs - Number of DOFs, which in 1D is the polynomial degree + 1. + * \param[in] r - Parametric coordinates for which the Vandermonde matrix must be computed. + * \param[out] V - Matrix to store the Vandermonde matrix in all r-locations. + */ + void Vandermonde1D(unsigned short nDOFs, const vector& r, vector& V); -protected: + protected: /*! * \brief Function, which checks if the sum of the given derivatives of the Lagrangian interpolation functions is 0 in the points. @@ -158,9 +151,8 @@ class CFEMStandardElementBase { * \param[in] dLagBasisPoints - Values of the derivatives of the Lagrangian interpolation functions in the given points. */ - void CheckSumDerivativesLagrangianBasisFunctions(const unsigned short nPoints, - const unsigned short nDOFs, - const vector &dLagBasisPoints); + void CheckSumDerivativesLagrangianBasisFunctions(const unsigned short nPoints, const unsigned short nDOFs, + const vector& dLagBasisPoints); /*! * \brief Function, which checks if the sum of the given Lagrangian interpolation @@ -170,15 +162,14 @@ class CFEMStandardElementBase { * \param[in,out] lagBasisPoints - Values of the Lagrangian interpolation functions in the given points. */ - void CheckSumLagrangianBasisFunctions(const unsigned short nPoints, - const unsigned short nDOFs, - vector &lagBasisPoints); + void CheckSumLagrangianBasisFunctions(const unsigned short nPoints, const unsigned short nDOFs, + vector& lagBasisPoints); /*! - * \brief Function, which copies the data of the given object into the current object. - * \param[in] other - Object, whose data is copied. - */ - void Copy(const CFEMStandardElementBase &other); + * \brief Function, which copies the data of the given object into the current object. + * \param[in] other - Object, whose data is copied. + */ + void Copy(const CFEMStandardElementBase& other); /*! * \brief Function, which computes the values of the derivatives of the basis functions @@ -196,125 +187,101 @@ class CFEMStandardElementBase { * \param[out] dtLagBasisIntegration - t-derivatives of the basis functions in the integration points of the face. */ - void DerivativesBasisFunctionsAdjacentElement(unsigned short VTK_TypeElem, - unsigned short nPolyElem, - const bool swapFaceInElement, - unsigned short &nDOFsElem, - vector &drLagBasisIntegration, - vector &dsLagBasisIntegration, - vector &dtLagBasisIntegration); - - /*! - * \brief Function, which computes the gradients of the Vandermonde matrix for a standard triangle. - * \param[in] nPoly - Polynomial degree of the triangle. - * \param[in] nDOFs - Number of DOFs of the triangle. - * \param[in] r - Parametric coordinate in r-direction for which the gradient of the Vandermonde matrix must be computed. - * \param[in] s - Parametric coordinate in s-direction for which the gradient of the Vandermonde matrix must be computed. - * \param[out] VDr - Matrix to store the gradient in r-direction of the Vandermonde matrix in all r- and s-locations. - * \param[out] VDs - Matrix to store the gradient in s-direction of the Vandermonde matrix in all r- and s-locations. - */ - void GradVandermonde2D_Triangle(unsigned short nPoly, - unsigned short nDOFs, - const vector &r, - const vector &s, - vector &VDr, - vector &VDs); - - /*! - * \brief Function, which computes the gradients of the Vandermonde matrix for a standard quadrilateral. - * \param[in] nPoly - Polynomial degree of the quadrilateral. - * \param[in] nDOFs - Number of DOFs of the quadrilateral. - * \param[in] r - Parametric coordinate in r-direction for which the gradient of the Vandermonde matrix must be computed. - * \param[in] s - Parametric coordinate in s-direction for which the gradient of the Vandermonde matrix must be computed. - * \param[out] VDr - Matrix to store the gradient in r-direction of the Vandermonde matrix in all r- and s-locations. - * \param[out] VDs - Matrix to store the gradient in s-direction of the Vandermonde matrix in all r- and s-locations. - */ - void GradVandermonde2D_Quadrilateral(unsigned short nPoly, - unsigned short nDOFs, - const vector &r, - const vector &s, - vector &VDr, - vector &VDs); - - /*! - * \brief Function, which computes the gradients of the Vandermonde matrix for a standard tetrahedron. - * \param[in] nPoly - Polynomial degree of the tetrahedron. - * \param[in] nDOFs - Number of DOFs of the tetrahedron. - * \param[in] r - Parametric coordinate in r-direction for which the gradient of the Vandermonde matrix must be computed. - * \param[in] s - Parametric coordinate in s-direction for which the gradient of the Vandermonde matrix must be computed. - * \param[in] t - Parametric coordinate in t-direction for which the gradient of the Vandermonde matrix must be computed. - * \param[out] VDr - Matrix to store the gradient in r-direction of the Vandermonde matrix in all r-, s- and t-locations. - * \param[out] VDs - Matrix to store the gradient in s-direction of the Vandermonde matrix in all r-, s- and t-locations. - * \param[out] VDt - Matrix to store the gradient in t-direction of the Vandermonde matrix in all r-, s- and t-locations. - */ - void GradVandermonde3D_Tetrahedron(unsigned short nPoly, - unsigned short nDOFs, - const vector &r, - const vector &s, - const vector &t, - vector &VDr, - vector &VDs, - vector &VDt); - - /*! - * \brief Function, which computes the gradients of the Vandermonde matrix for a standard pyramid. - * \param[in] nPoly - Polynomial degree of the pyramid. - * \param[in] nDOFs - Number of DOFs of the pyramid. - * \param[in] r - Parametric coordinate in r-direction for which the gradient of the Vandermonde matrix must be computed. - * \param[in] s - Parametric coordinate in s-direction for which the gradient of the Vandermonde matrix must be computed. - * \param[in] t - Parametric coordinate in t-direction for which the gradient of the Vandermonde matrix must be computed. - * \param[out] VDr - Matrix to store the gradient in r-direction of the Vandermonde matrix in all r-, s- and t-locations. - * \param[out] VDs - Matrix to store the gradient in s-direction of the Vandermonde matrix in all r-, s- and t-locations. - * \param[out] VDt - Matrix to store the gradient in t-direction of the Vandermonde matrix in all r-, s- and t-locations. - */ - void GradVandermonde3D_Pyramid(unsigned short nPoly, - unsigned short nDOFs, - const vector &r, - const vector &s, - const vector &t, - vector &VDr, - vector &VDs, - vector &VDt); - - /*! - * \brief Function, which computes the gradients of the Vandermonde matrix for a standard prism. - * \param[in] nPoly - Polynomial degree of the prism. - * \param[in] nDOFs - Number of DOFs of the prism. - * \param[in] r - Parametric coordinate in r-direction for which the gradient of the Vandermonde matrix must be computed. - * \param[in] s - Parametric coordinate in s-direction for which the gradient of the Vandermonde matrix must be computed. - * \param[in] t - Parametric coordinate in t-direction for which the gradient of the Vandermonde matrix must be computed. - * \param[out] VDr - Matrix to store the gradient in r-direction of the Vandermonde matrix in all r-, s- and t-locations. - * \param[out] VDs - Matrix to store the gradient in s-direction of the Vandermonde matrix in all r-, s- and t-locations. - * \param[out] VDt - Matrix to store the gradient in t-direction of the Vandermonde matrix in all r-, s- and t-locations. - */ - void GradVandermonde3D_Prism(unsigned short nPoly, - unsigned short nDOFs, - const vector &r, - const vector &s, - const vector &t, - vector &VDr, - vector &VDs, - vector &VDt); - - /*! - * \brief Function, which computes the gradients of the Vandermonde matrix for a standard hexahedron. - * \param[in] nPoly - Polynomial degree of the hexahedron. - * \param[in] nDOFs - Number of DOFs of the hexahedron. - * \param[in] r - Parametric coordinate in r-direction for which the gradient of the Vandermonde matrix must be computed. - * \param[in] s - Parametric coordinate in s-direction for which the gradient of the Vandermonde matrix must be computed. - * \param[in] t - Parametric coordinate in t-direction for which the gradient of the Vandermonde matrix must be computed. - * \param[out] VDr - Matrix to store the gradient in r-direction of the Vandermonde matrix in all r-, s- and t-locations. - * \param[out] VDs - Matrix to store the gradient in s-direction of the Vandermonde matrix in all r-, s- and t-locations. - * \param[out] VDt - Matrix to store the gradient in t-direction of the Vandermonde matrix in all r-, s- and t-locations. - */ - void GradVandermonde3D_Hexahedron(unsigned short nPoly, - unsigned short nDOFs, - const vector &r, - const vector &s, - const vector &t, - vector &VDr, - vector &VDs, - vector &VDt); + void DerivativesBasisFunctionsAdjacentElement(unsigned short VTK_TypeElem, unsigned short nPolyElem, + const bool swapFaceInElement, unsigned short& nDOFsElem, + vector& drLagBasisIntegration, + vector& dsLagBasisIntegration, + vector& dtLagBasisIntegration); + + /*! + * \brief Function, which computes the gradients of the Vandermonde matrix for a standard triangle. + * \param[in] nPoly - Polynomial degree of the triangle. + * \param[in] nDOFs - Number of DOFs of the triangle. + * \param[in] r - Parametric coordinate in r-direction for which the gradient of the Vandermonde matrix must be + * computed. \param[in] s - Parametric coordinate in s-direction for which the gradient of the Vandermonde matrix + * must be computed. \param[out] VDr - Matrix to store the gradient in r-direction of the Vandermonde matrix in all + * r- and s-locations. \param[out] VDs - Matrix to store the gradient in s-direction of the Vandermonde matrix in + * all r- and s-locations. + */ + void GradVandermonde2D_Triangle(unsigned short nPoly, unsigned short nDOFs, const vector& r, + const vector& s, vector& VDr, vector& VDs); + + /*! + * \brief Function, which computes the gradients of the Vandermonde matrix for a standard quadrilateral. + * \param[in] nPoly - Polynomial degree of the quadrilateral. + * \param[in] nDOFs - Number of DOFs of the quadrilateral. + * \param[in] r - Parametric coordinate in r-direction for which the gradient of the Vandermonde matrix must be + * computed. \param[in] s - Parametric coordinate in s-direction for which the gradient of the Vandermonde matrix + * must be computed. \param[out] VDr - Matrix to store the gradient in r-direction of the Vandermonde matrix in all + * r- and s-locations. \param[out] VDs - Matrix to store the gradient in s-direction of the Vandermonde matrix in + * all r- and s-locations. + */ + void GradVandermonde2D_Quadrilateral(unsigned short nPoly, unsigned short nDOFs, const vector& r, + const vector& s, vector& VDr, vector& VDs); + + /*! + * \brief Function, which computes the gradients of the Vandermonde matrix for a standard tetrahedron. + * \param[in] nPoly - Polynomial degree of the tetrahedron. + * \param[in] nDOFs - Number of DOFs of the tetrahedron. + * \param[in] r - Parametric coordinate in r-direction for which the gradient of the Vandermonde matrix must be + * computed. \param[in] s - Parametric coordinate in s-direction for which the gradient of the Vandermonde matrix + * must be computed. \param[in] t - Parametric coordinate in t-direction for which the gradient of the + * Vandermonde matrix must be computed. \param[out] VDr - Matrix to store the gradient in r-direction of the + * Vandermonde matrix in all r-, s- and t-locations. \param[out] VDs - Matrix to store the gradient in s-direction + * of the Vandermonde matrix in all r-, s- and t-locations. \param[out] VDt - Matrix to store the gradient in + * t-direction of the Vandermonde matrix in all r-, s- and t-locations. + */ + void GradVandermonde3D_Tetrahedron(unsigned short nPoly, unsigned short nDOFs, const vector& r, + const vector& s, const vector& t, vector& VDr, + vector& VDs, vector& VDt); + + /*! + * \brief Function, which computes the gradients of the Vandermonde matrix for a standard pyramid. + * \param[in] nPoly - Polynomial degree of the pyramid. + * \param[in] nDOFs - Number of DOFs of the pyramid. + * \param[in] r - Parametric coordinate in r-direction for which the gradient of the Vandermonde matrix must be + * computed. \param[in] s - Parametric coordinate in s-direction for which the gradient of the Vandermonde matrix + * must be computed. \param[in] t - Parametric coordinate in t-direction for which the gradient of the + * Vandermonde matrix must be computed. \param[out] VDr - Matrix to store the gradient in r-direction of the + * Vandermonde matrix in all r-, s- and t-locations. \param[out] VDs - Matrix to store the gradient in s-direction + * of the Vandermonde matrix in all r-, s- and t-locations. \param[out] VDt - Matrix to store the gradient in + * t-direction of the Vandermonde matrix in all r-, s- and t-locations. + */ + void GradVandermonde3D_Pyramid(unsigned short nPoly, unsigned short nDOFs, const vector& r, + const vector& s, const vector& t, vector& VDr, + vector& VDs, vector& VDt); + + /*! + * \brief Function, which computes the gradients of the Vandermonde matrix for a standard prism. + * \param[in] nPoly - Polynomial degree of the prism. + * \param[in] nDOFs - Number of DOFs of the prism. + * \param[in] r - Parametric coordinate in r-direction for which the gradient of the Vandermonde matrix must be + * computed. \param[in] s - Parametric coordinate in s-direction for which the gradient of the Vandermonde matrix + * must be computed. \param[in] t - Parametric coordinate in t-direction for which the gradient of the + * Vandermonde matrix must be computed. \param[out] VDr - Matrix to store the gradient in r-direction of the + * Vandermonde matrix in all r-, s- and t-locations. \param[out] VDs - Matrix to store the gradient in s-direction + * of the Vandermonde matrix in all r-, s- and t-locations. \param[out] VDt - Matrix to store the gradient in + * t-direction of the Vandermonde matrix in all r-, s- and t-locations. + */ + void GradVandermonde3D_Prism(unsigned short nPoly, unsigned short nDOFs, const vector& r, + const vector& s, const vector& t, vector& VDr, + vector& VDs, vector& VDt); + + /*! + * \brief Function, which computes the gradients of the Vandermonde matrix for a standard hexahedron. + * \param[in] nPoly - Polynomial degree of the hexahedron. + * \param[in] nDOFs - Number of DOFs of the hexahedron. + * \param[in] r - Parametric coordinate in r-direction for which the gradient of the Vandermonde matrix must be + * computed. \param[in] s - Parametric coordinate in s-direction for which the gradient of the Vandermonde matrix + * must be computed. \param[in] t - Parametric coordinate in t-direction for which the gradient of the + * Vandermonde matrix must be computed. \param[out] VDr - Matrix to store the gradient in r-direction of the + * Vandermonde matrix in all r-, s- and t-locations. \param[out] VDs - Matrix to store the gradient in s-direction + * of the Vandermonde matrix in all r-, s- and t-locations. \param[out] VDt - Matrix to store the gradient in + * t-direction of the Vandermonde matrix in all r-, s- and t-locations. + */ + void GradVandermonde3D_Hexahedron(unsigned short nPoly, unsigned short nDOFs, const vector& r, + const vector& s, const vector& t, vector& VDr, + vector& VDs, vector& VDt); /*! * \brief Function, which determines the values of the Lagrangian interpolation @@ -330,13 +297,11 @@ class CFEMStandardElementBase { * \param[out] drLagBasisPoints - Values of the r-derivatives of the Lagrangian interpolation functions in the given points. */ - void LagrangianBasisFunctionAndDerivativesLine(const unsigned short nPoly, - const vector &rPoints, - unsigned short &nDOFs, - vector &rDOFs, - vector &matVandermondeInv, - vector &lagBasisPoints, - vector &drLagBasisPoints); + void LagrangianBasisFunctionAndDerivativesLine(const unsigned short nPoly, const vector& rPoints, + unsigned short& nDOFs, vector& rDOFs, + vector& matVandermondeInv, + vector& lagBasisPoints, + vector& drLagBasisPoints); /*! * \brief Function, which determines the values of the Lagrangian interpolation @@ -357,16 +322,10 @@ class CFEMStandardElementBase { * \param[out] dsLagBasisPoints - Values of the s-derivatives of the Lagrangian interpolation functions in the given points. */ - void LagrangianBasisFunctionAndDerivativesTriangle(const unsigned short nPoly, - const vector &rPoints, - const vector &sPoints, - unsigned short &nDOFs, - vector &rDOFs, - vector &sDOFs, - vector &matVandermondeInv, - vector &lagBasisPoints, - vector &drLagBasisPoints, - vector &dsLagBasisPoints); + void LagrangianBasisFunctionAndDerivativesTriangle( + const unsigned short nPoly, const vector& rPoints, const vector& sPoints, + unsigned short& nDOFs, vector& rDOFs, vector& sDOFs, vector& matVandermondeInv, + vector& lagBasisPoints, vector& drLagBasisPoints, vector& dsLagBasisPoints); /*! * \brief Function, which determines the values of the Lagrangian interpolation @@ -387,16 +346,10 @@ class CFEMStandardElementBase { * \param[out] dsLagBasisPoints - Values of the s-derivatives of the Lagrangian interpolation functions in the given points. */ - void LagrangianBasisFunctionAndDerivativesQuadrilateral(const unsigned short nPoly, - const vector &rPoints, - const vector &sPoints, - unsigned short &nDOFs, - vector &rDOFs, - vector &sDOFs, - vector &matVandermondeInv, - vector &lagBasisPoints, - vector &drLagBasisPoints, - vector &dsLagBasisPoints); + void LagrangianBasisFunctionAndDerivativesQuadrilateral( + const unsigned short nPoly, const vector& rPoints, const vector& sPoints, + unsigned short& nDOFs, vector& rDOFs, vector& sDOFs, vector& matVandermondeInv, + vector& lagBasisPoints, vector& drLagBasisPoints, vector& dsLagBasisPoints); /*! * \brief Function, which determines the values of the Lagrangian interpolation @@ -422,19 +375,11 @@ class CFEMStandardElementBase { * \param[out] dtLagBasisPoints - Values of the t-derivatives of the Lagrangian interpolation functions in the given points. */ - void LagrangianBasisFunctionAndDerivativesTetrahedron(const unsigned short nPoly, - const vector &rPoints, - const vector &sPoints, - const vector &tPoints, - unsigned short &nDOFs, - vector &rDOFs, - vector &sDOFs, - vector &tDOFs, - vector &matVandermondeInv, - vector &lagBasisPoints, - vector &drLagBasisPoints, - vector &dsLagBasisPoints, - vector &dtLagBasisPoints); + void LagrangianBasisFunctionAndDerivativesTetrahedron( + const unsigned short nPoly, const vector& rPoints, const vector& sPoints, + const vector& tPoints, unsigned short& nDOFs, vector& rDOFs, vector& sDOFs, + vector& tDOFs, vector& matVandermondeInv, vector& lagBasisPoints, + vector& drLagBasisPoints, vector& dsLagBasisPoints, vector& dtLagBasisPoints); /*! * \brief Function, which determines the values of the Lagrangian interpolation @@ -460,19 +405,11 @@ class CFEMStandardElementBase { * \param[out] dtLagBasisPoints - Values of the t-derivatives of the Lagrangian interpolation functions in the given points. */ - void LagrangianBasisFunctionAndDerivativesPyramid(const unsigned short nPoly, - const vector &rPoints, - const vector &sPoints, - const vector &tPoints, - unsigned short &nDOFs, - vector &rDOFs, - vector &sDOFs, - vector &tDOFs, - vector &matVandermondeInv, - vector &lagBasisPoints, - vector &drLagBasisPoints, - vector &dsLagBasisPoints, - vector &dtLagBasisPoints); + void LagrangianBasisFunctionAndDerivativesPyramid( + const unsigned short nPoly, const vector& rPoints, const vector& sPoints, + const vector& tPoints, unsigned short& nDOFs, vector& rDOFs, vector& sDOFs, + vector& tDOFs, vector& matVandermondeInv, vector& lagBasisPoints, + vector& drLagBasisPoints, vector& dsLagBasisPoints, vector& dtLagBasisPoints); /*! * \brief Function, which determines the values of the Lagrangian interpolation @@ -498,19 +435,11 @@ class CFEMStandardElementBase { * \param[out] dtLagBasisPoints - Values of the t-derivatives of the Lagrangian interpolation functions in the given points. */ - void LagrangianBasisFunctionAndDerivativesPrism(const unsigned short nPoly, - const vector &rPoints, - const vector &sPoints, - const vector &tPoints, - unsigned short &nDOFs, - vector &rDOFs, - vector &sDOFs, - vector &tDOFs, - vector &matVandermondeInv, - vector &lagBasisPoints, - vector &drLagBasisPoints, - vector &dsLagBasisPoints, - vector &dtLagBasisPoints); + void LagrangianBasisFunctionAndDerivativesPrism( + const unsigned short nPoly, const vector& rPoints, const vector& sPoints, + const vector& tPoints, unsigned short& nDOFs, vector& rDOFs, vector& sDOFs, + vector& tDOFs, vector& matVandermondeInv, vector& lagBasisPoints, + vector& drLagBasisPoints, vector& dsLagBasisPoints, vector& dtLagBasisPoints); /*! * \brief Function, which determines the values of the Lagrangian interpolation @@ -536,19 +465,11 @@ class CFEMStandardElementBase { * \param[out] dtLagBasisPoints - Values of the t-derivatives of the Lagrangian interpolation functions in the given points. */ - void LagrangianBasisFunctionAndDerivativesHexahedron(const unsigned short nPoly, - const vector &rPoints, - const vector &sPoints, - const vector &tPoints, - unsigned short &nDOFs, - vector &rDOFs, - vector &sDOFs, - vector &tDOFs, - vector &matVandermondeInv, - vector &lagBasisPoints, - vector &drLagBasisPoints, - vector &dsLagBasisPoints, - vector &dtLagBasisPoints); + void LagrangianBasisFunctionAndDerivativesHexahedron( + const unsigned short nPoly, const vector& rPoints, const vector& sPoints, + const vector& tPoints, unsigned short& nDOFs, vector& rDOFs, vector& sDOFs, + vector& tDOFs, vector& matVandermondeInv, vector& lagBasisPoints, + vector& drLagBasisPoints, vector& dsLagBasisPoints, vector& dtLagBasisPoints); /*! * \brief Function, which carries out a matrix matrix multiplication to obtain @@ -564,11 +485,8 @@ class CFEMStandardElementBase { * \param[out] C - Result of A*B, dimension nPoints X nDOFs. The result is stored in row major order */ - void MatMulRowMajor(const unsigned short nDOFs, - const unsigned short nPoints, - const vector &A, - const vector &B, - vector &C); + void MatMulRowMajor(const unsigned short nDOFs, const unsigned short nPoints, const vector& A, + const vector& B, vector& C); /*! * \brief Function, which computes the local connectivity of linear subelements of @@ -576,8 +494,7 @@ class CFEMStandardElementBase { * \param[in] nPoly - Polynomial degree of the line. * \param[out] subConn - The local subconnectivity of a line element. */ - void SubConnForPlottingLine(const unsigned short nPoly, - vector &subConn); + void SubConnForPlottingLine(const unsigned short nPoly, vector& subConn); /*! * \brief Function, which computes the local connectivity of linear subelements of @@ -585,8 +502,7 @@ class CFEMStandardElementBase { * \param[in] nPoly - Polynomial degree of the quadrilateral. * \param[out] subConn - The local subconnectivity of a triangle element. */ - void SubConnForPlottingQuadrilateral(const unsigned short nPoly, - vector &subConn); + void SubConnForPlottingQuadrilateral(const unsigned short nPoly, vector& subConn); /*! * \brief Function, which computes the local connectivity of linear subelements of @@ -594,8 +510,7 @@ class CFEMStandardElementBase { * \param[in] nPoly - Polynomial degree of the triangle. * \param[out] subConn - The local subconnectivity of a triangle element. */ - void SubConnForPlottingTriangle(const unsigned short nPoly, - vector &subConn); + void SubConnForPlottingTriangle(const unsigned short nPoly, vector& subConn); /*! * \brief Function, which computes the Vandermonde matrix for a standard triangle. @@ -604,12 +519,9 @@ class CFEMStandardElementBase { * \param[in] r - Parametric coordinates in r-direction for which the Vandermonde matrix must be computed. * \param[in] s - Parametric coordinates in s-direction for which the Vandermonde matrix must be computed. * \param[out] V - Matrix to store the Vandermonde matrix in all r- and s-locations. - */ - void Vandermonde2D_Triangle(unsigned short nPoly, - unsigned short nDOFs, - const vector &r, - const vector &s, - vector &V); + */ + void Vandermonde2D_Triangle(unsigned short nPoly, unsigned short nDOFs, const vector& r, + const vector& s, vector& V); /*! * \brief Function, which computes the Vandermonde matrix for a standard quadrilateral. @@ -618,12 +530,9 @@ class CFEMStandardElementBase { * \param[in] r - Parametric coordinates in r-direction for which the Vandermonde matrix must be computed. * \param[in] s - Parametric coordinates in s-direction for which the Vandermonde matrix must be computed. * \param[out] V - Matrix to store the Vandermonde matrix in all r- and s-locations. - */ - void Vandermonde2D_Quadrilateral(unsigned short nPoly, - unsigned short nDOFs, - const vector &r, - const vector &s, - vector &V); + */ + void Vandermonde2D_Quadrilateral(unsigned short nPoly, unsigned short nDOFs, const vector& r, + const vector& s, vector& V); /*! * \brief Function, which computes the Vandermonde matrix for a standard tetrahedron. @@ -633,13 +542,9 @@ class CFEMStandardElementBase { * \param[in] s - Parametric coordinates in s-direction for which the Vandermonde matrix must be computed. * \param[in] t - Parametric coordinates in t-direction for which the Vandermonde matrix must be computed. * \param[out] V - Matrix to store the Vandermonde matrix in all r-, s- and t-locations. - */ - void Vandermonde3D_Tetrahedron(unsigned short nPoly, - unsigned short nDOFs, - const vector &r, - const vector &s, - const vector &t, - vector &V); + */ + void Vandermonde3D_Tetrahedron(unsigned short nPoly, unsigned short nDOFs, const vector& r, + const vector& s, const vector& t, vector& V); /*! * \brief Function, which computes the Vandermonde matrix for a standard pyramid. @@ -649,13 +554,9 @@ class CFEMStandardElementBase { * \param[in] s - Parametric coordinates in s-direction for which the Vandermonde matrix must be computed. * \param[in] t - Parametric coordinates in t-direction for which the Vandermonde matrix must be computed. * \param[out] V - Matrix to store the Vandermonde matrix in all r-, s- and t-locations. - */ - void Vandermonde3D_Pyramid(unsigned short nPoly, - unsigned short nDOFs, - const vector &r, - const vector &s, - const vector &t, - vector &V); + */ + void Vandermonde3D_Pyramid(unsigned short nPoly, unsigned short nDOFs, const vector& r, + const vector& s, const vector& t, vector& V); /*! * \brief Function, which computes the Vandermonde matrix for a standard prism. @@ -665,13 +566,9 @@ class CFEMStandardElementBase { * \param[in] s - Parametric coordinates in s-direction for which the Vandermonde matrix must be computed. * \param[in] t - Parametric coordinates in t-direction for which the Vandermonde matrix must be computed. * \param[out] V - Matrix to store the Vandermonde matrix in all r-, s- and t-locations. - */ - void Vandermonde3D_Prism(unsigned short nPoly, - unsigned short nDOFs, - const vector &r, - const vector &s, - const vector &t, - vector &V); + */ + void Vandermonde3D_Prism(unsigned short nPoly, unsigned short nDOFs, const vector& r, + const vector& s, const vector& t, vector& V); /*! * \brief Function, which computes the Vandermonde matrix for a standard hexahedron. @@ -681,13 +578,9 @@ class CFEMStandardElementBase { * \param[in] s - Parametric coordinates in s-direction for which the Vandermonde matrix must be computed. * \param[in] t - Parametric coordinates in t-direction for which the Vandermonde matrix must be computed. * \param[out] V - Matrix to store the Vandermonde matrix in all r-, s- and t-locations. - */ - void Vandermonde3D_Hexahedron(unsigned short nPoly, - unsigned short nDOFs, - const vector &r, - const vector &s, - const vector &t, - vector &V); + */ + void Vandermonde3D_Hexahedron(unsigned short nPoly, unsigned short nDOFs, const vector& r, + const vector& s, const vector& t, vector& V); /*! * \brief Function, which computes the constant in the penalty terms for a @@ -697,29 +590,26 @@ class CFEMStandardElementBase { * \param[in] nPolyElem - The polynomial degree of the adjacent element. * \return The value of the viscous penalty parameter. */ - su2double ViscousPenaltyParameter(const unsigned short VTK_TypeElem, - const unsigned short nPolyElem) const; -private: + su2double ViscousPenaltyParameter(const unsigned short VTK_TypeElem, const unsigned short nPolyElem) const; + + private: /*! - * \brief Function, which determines the 1D Gauss Legendre integration points and weights. - * \param[in,out] GLPoints - The location of the Gauss-Legendre integration points. - * \param[in,out] GLWeights - The weights of the Gauss-Legendre integration points. - */ - void GaussLegendrePoints1D(vector &GLPoints, - vector &GLWeights); + * \brief Function, which determines the 1D Gauss Legendre integration points and weights. + * \param[in,out] GLPoints - The location of the Gauss-Legendre integration points. + * \param[in,out] GLWeights - The weights of the Gauss-Legendre integration points. + */ + void GaussLegendrePoints1D(vector& GLPoints, vector& GLWeights); /*! - * \brief Function, which computes the value of the gradient of the Jacobi polynomial for the given x-coordinate. - * \param[in] n - Order of the Jacobi polynomial. - * \param[in] alpha - Alpha coefficient of the Jacobi polynomial. - * \param[in] beta - Beta coefficient of the Jacobi polynomial. - * \param[in] x - Coordinate (-1 <= x <= 1) for which the gradient of the Jacobi polynomial must be evaluated. - * \return The value of the gradient of the normalized Jacobi polynomial f order n for the given value of x. - */ - su2double GradNormJacobi(unsigned short n, - unsigned short alpha, - unsigned short beta, - su2double x); + * \brief Function, which computes the value of the gradient of the Jacobi polynomial for the given x-coordinate. + * \param[in] n - Order of the Jacobi polynomial. + * \param[in] alpha - Alpha coefficient of the Jacobi polynomial. + * \param[in] beta - Beta coefficient of the Jacobi polynomial. + * \param[in] x - Coordinate (-1 <= x <= 1) for which the gradient of the Jacobi polynomial must be evaluated. + * \return The value of the gradient of the normalized Jacobi polynomial f order n for the given value of + * x. + */ + su2double GradNormJacobi(unsigned short n, unsigned short alpha, unsigned short beta, su2double x); /*! * \brief Function, which determines the integration points for a line @@ -764,70 +654,71 @@ class CFEMStandardElementBase { void IntegrationPointsHexahedron(void); /*! - * \brief Function, which computes the value of the Jacobi polynomial for the given x-coordinate. - * \param[in] n - Order of the Jacobi polynomial. - * \param[in] alpha - Alpha coefficient of the Jacobi polynomial. - * \param[in] beta - Beta coefficient of the Jacobi polynomial. - * \param[in] x - Coordinate (-1 <= x <= 1) for which the Jacobi polynomial must be evaluated. - * \return The value of the normalized Jacobi polynomial f order n for the given value of x. - */ - su2double NormJacobi(unsigned short n, - unsigned short alpha, - unsigned short beta, - su2double x); + * \brief Function, which computes the value of the Jacobi polynomial for the given x-coordinate. + * \param[in] n - Order of the Jacobi polynomial. + * \param[in] alpha - Alpha coefficient of the Jacobi polynomial. + * \param[in] beta - Beta coefficient of the Jacobi polynomial. + * \param[in] x - Coordinate (-1 <= x <= 1) for which the Jacobi polynomial must be evaluated. + * \return The value of the normalized Jacobi polynomial f order n for the given value of x. + */ + su2double NormJacobi(unsigned short n, unsigned short alpha, unsigned short beta, su2double x); }; /*! * \class CFEMStandardElement * \brief Class to define a FEM standard element. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CFEMStandardElement : public CFEMStandardElementBase { -private: - - unsigned short nPoly; /*!< \brief Polynomial degree of the element. */ - unsigned short nDOFs; /*!< \brief Number of DOFs of the element. */ - - unsigned short VTK_Type1; /*!< \brief VTK type for elements of type 1 in subConn1ForPlotting. */ - unsigned short VTK_Type2; /*!< \brief VTK type for elements of type 2 in subConn2ForPlotting. */ - - vector rDOFs; /*!< \brief r-location of the DOFs for this standard element. */ - vector sDOFs; /*!< \brief s-location of the DOFs for this standard element, if needed. */ - vector tDOFs; /*!< \brief t-location of the DOFs for this standard element, if needed. */ - - vector lagBasisIntegration; /*!< \brief Lagrangian basis functions in the integration points. */ - vector lagBasisIntegrationTrans; /*!< \brief Transpose of lagBasisIntegration. It is stored such that - in the ADER-DG predictor step the residual is obtained - by one matrix multiplication. */ - vector lagBasisSolDOFs; /*!< \brief Lagrangian basis functions in the solution DOFs. Only different - from 1 if the polynomial degree of the grid and solution differs. */ - - vector drLagBasisIntegration; /*!< \brief r-derivatives of the Lagrangian basis functions in the integration points. */ - vector dsLagBasisIntegration; /*!< \brief s-derivatives of the Lagrangian basis functions in the integration points. */ - vector dtLagBasisIntegration; /*!< \brief t-derivatives of the Lagrangian basis functions in the integration points. */ - - vector matVandermondeInv; /*!< \brief Inverse matrix of Vandermonde matrix in the DOFs for this standard element. - This data is needed for the computation of shock sensing. */ - - vector matBasisIntegration; /*!< \brief Matrix of lagBasisIntegration, drLagBasisIntegration, dsLagBasisIntegration - and dtLagBasisIntegration combined for efficiency when using BLAS routines. */ - vector matDerBasisIntTrans; /*!< \brief Matrix of the transpose of the derivative part of matBasisIntegration. It is - stored such that the volume residual can be computed in one matrix multiplication. */ - vector matDerBasisSolDOFs; /*!< \brief Matrix of the derivatives of the Lagrangian basis functions in the solution - DOFs. Needed to compute the metric terms in the solution DOFs. */ - vector matDerBasisOwnDOFs; /*!< \brief Matrix of the derivatives of the Lagrangian basis functions in the owned - DOFs. This differs from matDerBasisSolDOFs when the grid DOFs and the - solution DOFs do not coincide. This data is needed for the computation - of the derivatives of the metric terms. */ - vector mat2ndDerBasisInt; /*!< \brief Matrix which contains all possible second derivatives of the basis functions - in the integration points. As such second derivatives can be computed - using one call to the BLAS routines. */ - - vector connFace0; /*!< \brief Local connectivity of face 0 of the element. The numbering of the DOFs is - such that the element is to the left of the face. */ - vector connFace1; /*!< \brief Local connectivity of face 1 of the element. The numbering of the DOFs is - such that the element is to the left of the face. */ + private: + unsigned short nPoly; /*!< \brief Polynomial degree of the element. */ + unsigned short nDOFs; /*!< \brief Number of DOFs of the element. */ + + unsigned short VTK_Type1; /*!< \brief VTK type for elements of type 1 in subConn1ForPlotting. */ + unsigned short VTK_Type2; /*!< \brief VTK type for elements of type 2 in subConn2ForPlotting. */ + + vector rDOFs; /*!< \brief r-location of the DOFs for this standard element. */ + vector sDOFs; /*!< \brief s-location of the DOFs for this standard element, if needed. */ + vector tDOFs; /*!< \brief t-location of the DOFs for this standard element, if needed. */ + + vector lagBasisIntegration; /*!< \brief Lagrangian basis functions in the integration points. */ + vector lagBasisIntegrationTrans; /*!< \brief Transpose of lagBasisIntegration. It is stored such that + in the ADER-DG predictor step the residual is obtained + by one matrix multiplication. */ + vector lagBasisSolDOFs; /*!< \brief Lagrangian basis functions in the solution DOFs. Only different + from 1 if the polynomial degree of the grid and solution differs. */ + + vector + drLagBasisIntegration; /*!< \brief r-derivatives of the Lagrangian basis functions in the integration points. */ + vector + dsLagBasisIntegration; /*!< \brief s-derivatives of the Lagrangian basis functions in the integration points. */ + vector + dtLagBasisIntegration; /*!< \brief t-derivatives of the Lagrangian basis functions in the integration points. */ + + vector matVandermondeInv; /*!< \brief Inverse matrix of Vandermonde matrix in the DOFs for this standard + element. This data is needed for the computation of shock sensing. */ + + vector + matBasisIntegration; /*!< \brief Matrix of lagBasisIntegration, drLagBasisIntegration, dsLagBasisIntegration + and dtLagBasisIntegration combined for efficiency when using BLAS routines. */ + vector matDerBasisIntTrans; /*!< \brief Matrix of the transpose of the derivative part of + matBasisIntegration. It is stored such that the volume residual can be + computed in one matrix multiplication. */ + vector matDerBasisSolDOFs; /*!< \brief Matrix of the derivatives of the Lagrangian basis functions in the + solution DOFs. Needed to compute the metric terms in the solution DOFs. */ + vector matDerBasisOwnDOFs; /*!< \brief Matrix of the derivatives of the Lagrangian basis functions in the + owned DOFs. This differs from matDerBasisSolDOFs when the grid DOFs and the + solution DOFs do not coincide. This data is needed for the + computation of the derivatives of the metric terms. */ + vector mat2ndDerBasisInt; /*!< \brief Matrix which contains all possible second derivatives of the basis + functions in the integration points. As such second derivatives can be + computed using one call to the BLAS routines. */ + + vector connFace0; /*!< \brief Local connectivity of face 0 of the element. The numbering of the DOFs + is such that the element is to the left of the face. */ + vector connFace1; /*!< \brief Local connectivity of face 1 of the element. The numbering of the DOFs + is such that the element is to the left of the face. */ vector connFace2; /*!< \brief Local connectivity of face 2 of the element, if present. The numbering of the DOFs is such that the element is to the left of the face. */ vector connFace3; /*!< \brief Local connectivity of face 3 of the element, if present. The numbering @@ -837,11 +728,11 @@ class CFEMStandardElement : public CFEMStandardElementBase { vector connFace5; /*!< \brief Local connectivity of face 5 of the element, if present. The numbering of the DOFs is such that the element is to the left of the face. */ - vector subConn1ForPlotting; /*!< \brief Local subconnectivity of element type 1 of the high order element. - Used for plotting. */ - vector subConn2ForPlotting; /*!< \brief Local subconnectivity of element type 2 of the high order element. - Used for plotting. */ -public: + vector subConn1ForPlotting; /*!< \brief Local subconnectivity of element type 1 of the high order + element. Used for plotting. */ + vector subConn2ForPlotting; /*!< \brief Local subconnectivity of element type 2 of the high order + element. Used for plotting. */ + public: /*! * \brief Alternative constructor. * \param[in] val_VTK_Type - Type of the element using the VTK convention. @@ -858,26 +749,24 @@ class CFEMStandardElement : public CFEMStandardElementBase { * \param[in] tLocSolDOFs - Default argument. If specified, it contains the parametric t location of the solution DOFs. */ - CFEMStandardElement(unsigned short val_VTK_Type, - unsigned short val_nPoly, - bool val_constJac, - CConfig *config, - unsigned short val_orderExact = 0, - const vector *rLocSolDOFs = nullptr, - const vector *sLocSolDOFs = nullptr, - const vector *tLocSolDOFs = nullptr); + CFEMStandardElement(unsigned short val_VTK_Type, unsigned short val_nPoly, bool val_constJac, CConfig* config, + unsigned short val_orderExact = 0, const vector* rLocSolDOFs = nullptr, + const vector* sLocSolDOFs = nullptr, const vector* tLocSolDOFs = nullptr); /*! - * \brief Copy constructor. - * \param[in] other - Object, whose data must be copied. - */ - CFEMStandardElement(const CFEMStandardElement &other) : CFEMStandardElementBase(other) {Copy(other);} + * \brief Copy constructor. + * \param[in] other - Object, whose data must be copied. + */ + CFEMStandardElement(const CFEMStandardElement& other) : CFEMStandardElementBase(other) { Copy(other); } /*! - * \brief Assignment operator. - * \param[in] other - Object, to which this object must be assigned. - * \return The current object, after the member variables were assigned the correct value. - */ - CFEMStandardElement& operator=(const CFEMStandardElement &other){Copy(other); return (*this);} + * \brief Assignment operator. + * \param[in] other - Object, to which this object must be assigned. + * \return The current object, after the member variables were assigned the correct value. + */ + CFEMStandardElement& operator=(const CFEMStandardElement& other) { + Copy(other); + return (*this); + } /*! * \brief Function, which computes the Lagrangian basis functions for the @@ -886,8 +775,7 @@ class CFEMStandardElement : public CFEMStandardElementBase { and derivatives must be computed. * \param[out] lagBasis - The values of the Lagrangian basis functions in parCoor. */ - void BasisFunctionsInPoint(const su2double *parCoor, - vector &lagBasis); + void BasisFunctionsInPoint(const su2double* parCoor, vector& lagBasis); /*! * \brief Function, which computes the Lagrangian basis functions and its derivatives for the given parametric coordinates. @@ -897,166 +785,169 @@ class CFEMStandardElement : public CFEMStandardElementBase { * \param[out] dLagBasis - The values of the derivatives of the basis functions in parCoor. */ - void BasisFunctionsAndDerivativesInPoint(const su2double *parCoor, - vector &lagBasis, - vector > &dLagBasis); + void BasisFunctionsAndDerivativesInPoint(const su2double* parCoor, vector& lagBasis, + vector >& dLagBasis); /*! - * \brief Function, which makes available the values of the basis functions in the integration points. - * \return The pointer to data, which stores the basis functions in the integration points. - */ - inline su2double* GetBasisFunctionsIntegration(void){return lagBasisIntegration.data();} + * \brief Function, which makes available the values of the basis functions in the integration points. + * \return The pointer to data, which stores the basis functions in the integration points. + */ + inline su2double* GetBasisFunctionsIntegration(void) { return lagBasisIntegration.data(); } /*! - * \brief Function, which makes available the transpose of the basis functions in the integration points. - * \return The pointer to data, which stores the transpose matrix of the basis functions. - */ - inline const su2double* GetBasisFunctionsIntegrationTrans(void) const {return lagBasisIntegrationTrans.data();} + * \brief Function, which makes available the transpose of the basis functions in the integration points. + * \return The pointer to data, which stores the transpose matrix of the basis functions. + */ + inline const su2double* GetBasisFunctionsIntegrationTrans(void) const { return lagBasisIntegrationTrans.data(); } /*! - * \brief Function, which makes available the values of the basis functions in the solution DOFs. - * \return The pointer to data, which stores the basis functions in the solution DOFs. - */ - inline const su2double* GetBasisFunctionsSolDOFs(void) const {return lagBasisSolDOFs.data();} + * \brief Function, which makes available the values of the basis functions in the solution DOFs. + * \return The pointer to data, which stores the basis functions in the solution DOFs. + */ + inline const su2double* GetBasisFunctionsSolDOFs(void) const { return lagBasisSolDOFs.data(); } /*! - * \brief Function, which makes available the r-derivatives of the basis functions in the integration points. - * \return The pointer to data, which stores the r-derivatives of the basis functions. - */ - inline su2double* GetDrBasisFunctionsIntegration(void){return drLagBasisIntegration.data();} + * \brief Function, which makes available the r-derivatives of the basis functions in the integration points. + * \return The pointer to data, which stores the r-derivatives of the basis functions. + */ + inline su2double* GetDrBasisFunctionsIntegration(void) { return drLagBasisIntegration.data(); } /*! - * \brief Function, which makes available the s-derivatives of the basis functions in the integration points. - * \return The pointer to data, which stores the s-derivatives of the basis functions. - */ - inline su2double* GetDsBasisFunctionsIntegration(void){return dsLagBasisIntegration.data();} + * \brief Function, which makes available the s-derivatives of the basis functions in the integration points. + * \return The pointer to data, which stores the s-derivatives of the basis functions. + */ + inline su2double* GetDsBasisFunctionsIntegration(void) { return dsLagBasisIntegration.data(); } /*! - * \brief Function, which makes available the t-derivatives of the basis functions in the integration points. - * \return The pointer to data, which stores the t-derivatives of the basis functions. - */ - inline su2double* GetDtBasisFunctionsIntegration(void){return dtLagBasisIntegration.data();} + * \brief Function, which makes available the t-derivatives of the basis functions in the integration points. + * \return The pointer to data, which stores the t-derivatives of the basis functions. + */ + inline su2double* GetDtBasisFunctionsIntegration(void) { return dtLagBasisIntegration.data(); } /*! - * \brief Function, which makes available the matrix storage of the inverse of Vandermonde matrix of solution DOFs. - * \return The pointer to matVandermondeInv. - */ - inline const su2double* GetMatVandermondeInv(void) const {return matVandermondeInv.data();} + * \brief Function, which makes available the matrix storage of the inverse of Vandermonde matrix of solution DOFs. + * \return The pointer to matVandermondeInv. + */ + inline const su2double* GetMatVandermondeInv(void) const { return matVandermondeInv.data(); } /*! - * \brief Function, which makes available the matrix storage of the basis functions in the integration points. - * \return The pointer to matBasisIntegration. - */ - inline const su2double* GetMatBasisFunctionsIntegration(void) const {return matBasisIntegration.data();} + * \brief Function, which makes available the matrix storage of the basis functions in the integration points. + * \return The pointer to matBasisIntegration. + */ + inline const su2double* GetMatBasisFunctionsIntegration(void) const { return matBasisIntegration.data(); } /*! - * \brief Function, which makes available the transpose matrix of the derivative of the basis functions in the integration points. - * \return The pointer to matDerBasisIntTrans; - */ - inline const su2double* GetDerMatBasisFunctionsIntTrans(void) const {return matDerBasisIntTrans.data();} + * \brief Function, which makes available the transpose matrix of the derivative of the basis functions in the + * integration points. \return The pointer to matDerBasisIntTrans; + */ + inline const su2double* GetDerMatBasisFunctionsIntTrans(void) const { return matDerBasisIntTrans.data(); } /*! - * \brief Function, which makes available the matrix storage of the derivative of the basis functions in the own DOFs. - * \return The pointer to matDerBasisOwnDOFs. - */ - inline const su2double *GetMatDerBasisFunctionsOwnDOFs(void) const {return matDerBasisOwnDOFs.data();} + * \brief Function, which makes available the matrix storage of the derivative of the basis functions in the own DOFs. + * \return The pointer to matDerBasisOwnDOFs. + */ + inline const su2double* GetMatDerBasisFunctionsOwnDOFs(void) const { return matDerBasisOwnDOFs.data(); } /*! - * \brief Function, which makes available the matrix storage of the derivative of the basis functions in the solution DOFs. - * \return The pointer to matDerBasisSolDOFs. - */ - inline const su2double *GetMatDerBasisFunctionsSolDOFs(void) const {return matDerBasisSolDOFs.data();} + * \brief Function, which makes available the matrix storage of the derivative of the basis functions in the solution + * DOFs. \return The pointer to matDerBasisSolDOFs. + */ + inline const su2double* GetMatDerBasisFunctionsSolDOFs(void) const { return matDerBasisSolDOFs.data(); } /*! * \brief Function, which makes available the matrix storage of the second derivativex of the basis functions in the integration points. * \return The pointer to mat2ndDerBasisInt. */ - inline const su2double *GetMat2ndDerBasisFunctionsInt(void) const {return mat2ndDerBasisInt.data();} + inline const su2double* GetMat2ndDerBasisFunctionsInt(void) const { return mat2ndDerBasisInt.data(); } /*! - * \brief Function, which makes available the connectivity of face 0. - * \return The pointer to data, which stores the connectivity of face 0. - */ - inline unsigned short *GetConnFace0(void) {return connFace0.data();} + * \brief Function, which makes available the connectivity of face 0. + * \return The pointer to data, which stores the connectivity of face 0. + */ + inline unsigned short* GetConnFace0(void) { return connFace0.data(); } /*! - * \brief Function, which makes available the connectivity of face 1. - * \return The pointer to data, which stores the connectivity of face 1. - */ - inline unsigned short *GetConnFace1(void) {return connFace1.data();} + * \brief Function, which makes available the connectivity of face 1. + * \return The pointer to data, which stores the connectivity of face 1. + */ + inline unsigned short* GetConnFace1(void) { return connFace1.data(); } /*! - * \brief Function, which makes available the connectivity of face 2. - * \return The pointer to data, which stores the connectivity of face 2. - */ - inline unsigned short *GetConnFace2(void) {return connFace2.data();} + * \brief Function, which makes available the connectivity of face 2. + * \return The pointer to data, which stores the connectivity of face 2. + */ + inline unsigned short* GetConnFace2(void) { return connFace2.data(); } /*! - * \brief Function, which makes available the connectivity of face 3. - * \return The pointer to data, which stores the connectivity of face 3. - */ - inline unsigned short *GetConnFace3(void) {return connFace3.data();} + * \brief Function, which makes available the connectivity of face 3. + * \return The pointer to data, which stores the connectivity of face 3. + */ + inline unsigned short* GetConnFace3(void) { return connFace3.data(); } /*! - * \brief Function, which makes available the connectivity of face 4. - * \return The pointer to data, which stores the connectivity of face 4. - */ - inline unsigned short *GetConnFace4(void) {return connFace4.data();} + * \brief Function, which makes available the connectivity of face 4. + * \return The pointer to data, which stores the connectivity of face 4. + */ + inline unsigned short* GetConnFace4(void) { return connFace4.data(); } /*! - * \brief Function, which makes available the connectivity of face 5. - * \return The pointer to data, which stores the connectivity of face 5. - */ - inline unsigned short *GetConnFace5(void) {return connFace5.data();} + * \brief Function, which makes available the connectivity of face 5. + * \return The pointer to data, which stores the connectivity of face 5. + */ + inline unsigned short* GetConnFace5(void) { return connFace5.data(); } /*! - * \brief Function, which makes available the number of DOFs for this standard element. - * \return The number of DOFs of this standard element. - */ - inline unsigned short GetNDOFs(void) const {return nDOFs;} + * \brief Function, which makes available the number of DOFs for this standard element. + * \return The number of DOFs of this standard element. + */ + inline unsigned short GetNDOFs(void) const { return nDOFs; } /*! - * \brief Function, which makes available the polynomial degree for this standard element. - * \return The polynomial degree of this standard element. - */ - inline unsigned short GetNPoly(void) const {return nPoly;} + * \brief Function, which makes available the polynomial degree for this standard element. + * \return The polynomial degree of this standard element. + */ + inline unsigned short GetNPoly(void) const { return nPoly; } /*! * \brief Function, which makes available the type of the element in subConn1ForPlotting. * \return The type of the elements in subConn1ForPlotting using the VTK convention. */ - inline unsigned short GetVTK_Type1(void) const {return VTK_Type1;} + inline unsigned short GetVTK_Type1(void) const { return VTK_Type1; } /*! * \brief Function, which makes available the number of sub-elements of type 1 for plotting. * \return The number of sub-elements of type 1 for plotting. */ - inline unsigned short GetNSubElemsType1(void) const {return subConn1ForPlotting.size()/GetNDOFsPerSubElem(GetVTK_Type1());} + inline unsigned short GetNSubElemsType1(void) const { + return subConn1ForPlotting.size() / GetNDOFsPerSubElem(GetVTK_Type1()); + } /*! * \brief Function, which makes available the the connectivity of the linear elements of type 1 as a const pointer. * \return The pointer to the local connectivity of the linear elements of type 1. */ - inline const unsigned short *GetSubConnType1(void) const {return subConn1ForPlotting.data();} + inline const unsigned short* GetSubConnType1(void) const { return subConn1ForPlotting.data(); } /*! * \brief Function, which makes available the type of the element in subConn2ForPlotting. * \return The type of the elements in subConn2ForPlotting using the VTK convention. */ - inline unsigned short GetVTK_Type2(void) const {return VTK_Type2;} + inline unsigned short GetVTK_Type2(void) const { return VTK_Type2; } /*! * \brief Function, which makes available the number of sub-elements of type 2 for plotting. * \return The number of sub-elements of type 2 for plotting. */ - inline unsigned short GetNSubElemsType2(void) const {return subConn2ForPlotting.size()/GetNDOFsPerSubElem(GetVTK_Type2());} + inline unsigned short GetNSubElemsType2(void) const { + return subConn2ForPlotting.size() / GetNDOFsPerSubElem(GetVTK_Type2()); + } /*! * \brief Function, which makes available the the connectivity of the linear elements of type 2 as a const pointer. * \return The pointer to the local connectivity of the linear elements of type 2. */ - inline const unsigned short *GetSubConnType2(void) const {return subConn2ForPlotting.data();} + inline const unsigned short* GetSubConnType2(void) const { return subConn2ForPlotting.data(); } /*! * \brief Function, which makes available the number of DOFs of a linear element, used for plotting. @@ -1069,41 +960,39 @@ class CFEMStandardElement : public CFEMStandardElementBase { const pointer to the vector. * \return The address of the vector, which stores the r-location of the DOFs. */ - inline const vector *GetRDOFs(void) const {return &rDOFs;} + inline const vector* GetRDOFs(void) const { return &rDOFs; } /*! * \brief Function, which makes available the s-location of the DOFs as a const pointer to the vector. * \return The address of the vector, which stores the s-location of the DOFs. */ - inline const vector *GetSDOFs(void) const {return &sDOFs;} + inline const vector* GetSDOFs(void) const { return &sDOFs; } /*! * \brief Function, which makes available the t-location of the DOFs as a const pointer to the vector. * \return The address of the vector, which stores the t-location of the DOFs. */ - inline const vector *GetTDOFs(void) const {return &tDOFs;} + inline const vector* GetTDOFs(void) const { return &tDOFs; } /*! - * \brief Function, which checks if the function arguments correspond to this standard element. - * \param[in] val_VTK_Type - Type of the element using the VTK convention. - * \param[in] val_nPoly - Polynomial degree of the element. - * \param[in] val_constJac - Whether or not the Jacobians are constant. - * \return Whether or not the function arguments correspond to this standard element. - */ - bool SameStandardElement(unsigned short val_VTK_Type, - unsigned short val_nPoly, - bool val_constJac); + * \brief Function, which checks if the function arguments correspond to this standard element. + * \param[in] val_VTK_Type - Type of the element using the VTK convention. + * \param[in] val_nPoly - Polynomial degree of the element. + * \param[in] val_constJac - Whether or not the Jacobians are constant. + * \return Whether or not the function arguments correspond to this standard element. + */ + bool SameStandardElement(unsigned short val_VTK_Type, unsigned short val_nPoly, bool val_constJac); /*! * \brief Function, which estimates the amount of work for an element of this type. This information is used to determine a well balanced partition. * \param[in] config - Object, which contains the input parameters. */ - su2double WorkEstimateMetis(CConfig *config); + su2double WorkEstimateMetis(CConfig* config); -private: + private: /*! * \brief Function, which changes the given quadrilateral connectivity, such that the direction coincides with the direction corresponding to corner vertices vert0, vert1, vert2, vert3. @@ -1113,11 +1002,8 @@ class CFEMStandardElement : public CFEMStandardElementBase { * \param[in] vert2 - Corner vertex 2 of the desired sequence. * \param[in] vert3 - Corner vertex 3 of the desired sequence. */ - void ChangeDirectionQuadConn(vector &connQuad, - unsigned short vert0, - unsigned short vert1, - unsigned short vert2, - unsigned short vert3) const; + void ChangeDirectionQuadConn(vector& connQuad, unsigned short vert0, unsigned short vert1, + unsigned short vert2, unsigned short vert3) const; /*! * \brief Function, which changes the given triangular connectivity, such that the direction coincides @@ -1127,16 +1013,14 @@ class CFEMStandardElement : public CFEMStandardElementBase { * \param[in] vert1 - Corner vertex 1 of the desired sequence. * \param[in] vert2 - Corner vertex 2 of the desired sequence. */ - void ChangeDirectionTriangleConn(vector &connTriangle, - unsigned short vert0, - unsigned short vert1, - unsigned short vert2) const; + void ChangeDirectionTriangleConn(vector& connTriangle, unsigned short vert0, unsigned short vert1, + unsigned short vert2) const; /*! - * \brief Function, which copies the data of the given object into the current object. - * \param[in] other - Object, whose data is copied. - */ - void Copy(const CFEMStandardElement &other); + * \brief Function, which copies the data of the given object into the current object. + * \param[in] other - Object, whose data is copied. + */ + void Copy(const CFEMStandardElement& other); /*! * \brief Function, which creates the basis functions and the matrix containing @@ -1150,45 +1034,42 @@ class CFEMStandardElement : public CFEMStandardElementBase { * \param[out] matDerBasis - Matrix to store the derivatives of the basis functions. */ - void CreateBasisFunctionsAndMatrixDerivatives(const vector &rLoc, - const vector &sLoc, - const vector &tLoc, - vector &matVandermondeInv, - vector &lagBasis, - vector &matDerBasis); + void CreateBasisFunctionsAndMatrixDerivatives(const vector& rLoc, const vector& sLoc, + const vector& tLoc, vector& matVandermondeInv, + vector& lagBasis, vector& matDerBasis); /*! - * \brief Function, which creates all the data for a line element. - */ + * \brief Function, which creates all the data for a line element. + */ void DataStandardLine(void); /*! - * \brief Function, which creates all the data for a triangular element. - */ + * \brief Function, which creates all the data for a triangular element. + */ void DataStandardTriangle(void); /*! - * \brief Function, which creates all the data for a quadrilateral element. - */ + * \brief Function, which creates all the data for a quadrilateral element. + */ void DataStandardQuadrilateral(void); /*! - * \brief Function, which creates all the data for a tetrahedral element. - */ + * \brief Function, which creates all the data for a tetrahedral element. + */ void DataStandardTetrahedron(void); /*! - * \brief Function, which creates all the data for a pyramid element. - */ + * \brief Function, which creates all the data for a pyramid element. + */ void DataStandardPyramid(void); /*! - * \brief Function, which creates all the data for a prism element. - */ + * \brief Function, which creates all the data for a prism element. + */ void DataStandardPrism(void); /*! - * \brief Function, which creates all the data for a hexahedral element. - */ + * \brief Function, which creates all the data for a hexahedral element. + */ void DataStandardHexahedron(void); /*! @@ -1220,12 +1101,12 @@ class CFEMStandardElement : public CFEMStandardElementBase { * \class CFEMStandardInternalFace * \brief Class to define a FEM standard internal face. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CFEMStandardInternalFace : public CFEMStandardElementBase { -private: - unsigned short nDOFsFaceSide0; /*!< \brief Number of DOFs on side 0 of the face. */ - unsigned short nDOFsFaceSide1; /*!< \brief Number of DOFs on side 1 of the face. */ + private: + unsigned short nDOFsFaceSide0; /*!< \brief Number of DOFs on side 0 of the face. */ + unsigned short nDOFsFaceSide1; /*!< \brief Number of DOFs on side 1 of the face. */ unsigned short nPolyElemSide0; /*!< \brief Polynomial degree of the element on side 0 of the face. */ unsigned short nPolyElemSide1; /*!< \brief Polynomial degree of the element on side 1 of the face. */ @@ -1234,20 +1115,20 @@ class CFEMStandardInternalFace : public CFEMStandardElementBase { unsigned short VTK_TypeElemSide0; /*!< \brief Type of the element on side 0 of the face using the VTK convention. */ unsigned short VTK_TypeElemSide1; /*!< \brief Type of the element on side 1 of the face using the VTK convention. */ - bool swapFaceInElementSide0; /*!< \brief Whether or not the connectivity of the face must - be swapped compared to the face of the corresponding - standard element on side 0 of the face. */ - bool swapFaceInElementSide1; /*!< \brief Whether or not the connectivity of the face must - be swapped compared to the face of the corresponding - standard element on side 1 of the face. */ + bool swapFaceInElementSide0; /*!< \brief Whether or not the connectivity of the face must + be swapped compared to the face of the corresponding + standard element on side 0 of the face. */ + bool swapFaceInElementSide1; /*!< \brief Whether or not the connectivity of the face must + be swapped compared to the face of the corresponding + standard element on side 1 of the face. */ - su2double penaltyConstantFace; /*!< \brief The constant of the penalty parameter of the face, - which is used in the viscous discretization. */ + su2double penaltyConstantFace; /*!< \brief The constant of the penalty parameter of the face, + which is used in the viscous discretization. */ - vector rDOFsFaceSide0; /*!< \brief r-location of the DOFs on side 0 of the face. */ - vector rDOFsFaceSide1; /*!< \brief r-location of the DOFs on side 1 of the face. */ - vector sDOFsFaceSide0; /*!< \brief s-location of the DOFs on side 0 of the face, if needed. */ - vector sDOFsFaceSide1; /*!< \brief s-location of the DOFs on side 1 of the face, if needed. */ + vector rDOFsFaceSide0; /*!< \brief r-location of the DOFs on side 0 of the face. */ + vector rDOFsFaceSide1; /*!< \brief r-location of the DOFs on side 1 of the face. */ + vector sDOFsFaceSide0; /*!< \brief s-location of the DOFs on side 0 of the face, if needed. */ + vector sDOFsFaceSide1; /*!< \brief s-location of the DOFs on side 1 of the face, if needed. */ vector lagBasisFaceIntegrationSide0; /*!< \brief Lagrangian basis functions in the integration points of side0 of the face. */ @@ -1279,20 +1160,22 @@ class CFEMStandardInternalFace : public CFEMStandardElementBase { vector dtLagBasisElemIntegrationSide1; /*!< \brief t-derivatives of the element Lagrangian basis functions of side 1 in the integration points. */ - vector matDerBasisElemIntegrationSide0; /*!< \brief Matrix of drLagBasisElemIntegrationSide0, dsLagBasisElemIntegrationSide0 - and dtLagBasisElemIntegrationSide0 combined for efficiency - when using BLAS routines. */ - vector matDerBasisElemIntegrationSide1; /*!< \brief Matrix of drLagBasisElemIntegrationSide1, dsLagBasisElemIntegrationSide1 - and dtLagBasisElemIntegrationSide1 combined for efficiency - when using BLAS routines. */ - - vector matDerBasisElemIntegrationTransposeSide0; /*!< \brief Transpose of matDerBasisElemIntegrationSide0, such that - the residuals of the symmetrizing terms can be computed - with a single matrix multiplication. */ - vector matDerBasisElemIntegrationTransposeSide1; /*!< \brief Transpose of matDerBasisElemIntegrationSide1, such that - the residuals of the symmetrizing terms can be computed - with a single matrix multiplication. */ -public: + vector + matDerBasisElemIntegrationSide0; /*!< \brief Matrix of drLagBasisElemIntegrationSide0, + dsLagBasisElemIntegrationSide0 and dtLagBasisElemIntegrationSide0 combined for + efficiency when using BLAS routines. */ + vector + matDerBasisElemIntegrationSide1; /*!< \brief Matrix of drLagBasisElemIntegrationSide1, + dsLagBasisElemIntegrationSide1 and dtLagBasisElemIntegrationSide1 combined for + efficiency when using BLAS routines. */ + + vector matDerBasisElemIntegrationTransposeSide0; /*!< \brief Transpose of matDerBasisElemIntegrationSide0, + such that the residuals of the symmetrizing terms can + be computed with a single matrix multiplication. */ + vector matDerBasisElemIntegrationTransposeSide1; /*!< \brief Transpose of matDerBasisElemIntegrationSide1, + such that the residuals of the symmetrizing terms can + be computed with a single matrix multiplication. */ + public: /*! * \brief Alternative constructor. * \param[in] val_VTK_TypeFace - The type of the face using the VTK convention. @@ -1316,84 +1199,85 @@ class CFEMStandardInternalFace : public CFEMStandardElementBase { order of the polynomials that must be integrated exactly by the integration rule. */ - CFEMStandardInternalFace(unsigned short val_VTK_TypeFace, - unsigned short val_VTK_TypeSide0, - unsigned short val_nPolySide0, - unsigned short val_VTK_TypeSide1, - unsigned short val_nPolySide1, - bool val_constJac, - bool val_swapFaceInElementSide0, - bool val_swapFaceInElementSide1, - CConfig *config, - unsigned short val_orderExact = 0); + CFEMStandardInternalFace(unsigned short val_VTK_TypeFace, unsigned short val_VTK_TypeSide0, + unsigned short val_nPolySide0, unsigned short val_VTK_TypeSide1, + unsigned short val_nPolySide1, bool val_constJac, bool val_swapFaceInElementSide0, + bool val_swapFaceInElementSide1, CConfig* config, unsigned short val_orderExact = 0); /*! - * \brief Copy constructor. - * \param[in] other - Object, whose data must be copied. - */ - CFEMStandardInternalFace(const CFEMStandardInternalFace &other) : CFEMStandardElementBase(other) {Copy(other);} + * \brief Copy constructor. + * \param[in] other - Object, whose data must be copied. + */ + CFEMStandardInternalFace(const CFEMStandardInternalFace& other) : CFEMStandardElementBase(other) { Copy(other); } /*! - * \brief Assignment operator. - * \param[in] other - Object, to which this object must be assigned. - * \return The current object, after the member variables were assigned the correct value. - */ - CFEMStandardInternalFace& operator=(const CFEMStandardInternalFace &other){Copy(other); return (*this);} + * \brief Assignment operator. + * \param[in] other - Object, to which this object must be assigned. + * \return The current object, after the member variables were assigned the correct value. + */ + CFEMStandardInternalFace& operator=(const CFEMStandardInternalFace& other) { + Copy(other); + return (*this); + } /*! * \brief Function, which makes available the r-derivatives of the elements basis functions of side 0 in the integration points. * \return The pointer to data, which stores this information. */ - inline su2double *GetDrBasisElemIntegrationSide0(void) {return drLagBasisElemIntegrationSide0.data();} + inline su2double* GetDrBasisElemIntegrationSide0(void) { return drLagBasisElemIntegrationSide0.data(); } /*! * \brief Function, which makes available the r-derivatives of the elements basis functions of side 1 in the integration points. * \return The pointer to data, which stores this information. */ - inline su2double *GetDrBasisElemIntegrationSide1(void) {return drLagBasisElemIntegrationSide1.data();} + inline su2double* GetDrBasisElemIntegrationSide1(void) { return drLagBasisElemIntegrationSide1.data(); } /*! * \brief Function, which makes available the s-derivatives of the elements basis functions of side 0 in the integration points. * \return The pointer to data, which stores this information. */ - inline su2double *GetDsBasisElemIntegrationSide0(void) {return dsLagBasisElemIntegrationSide0.data();} + inline su2double* GetDsBasisElemIntegrationSide0(void) { return dsLagBasisElemIntegrationSide0.data(); } /*! * \brief Function, which makes available the s-derivatives of the elements basis functions of side 1 in the integration points. * \return The pointer to data, which stores this information. */ - inline su2double *GetDsBasisElemIntegrationSide1(void) {return dsLagBasisElemIntegrationSide1.data();} + inline su2double* GetDsBasisElemIntegrationSide1(void) { return dsLagBasisElemIntegrationSide1.data(); } /*! * \brief Function, which makes available the t-derivatives of the elements basis functions of side 0 in the integration points. * \return The pointer to data, which stores this information. */ - inline su2double *GetDtBasisElemIntegrationSide0(void) {return dtLagBasisElemIntegrationSide0.data();} + inline su2double* GetDtBasisElemIntegrationSide0(void) { return dtLagBasisElemIntegrationSide0.data(); } /*! * \brief Function, which makes available the t-derivatives of the elements basis functions of side 1 in the integration points. * \return The pointer to data, which stores this information. */ - inline su2double *GetDtBasisElemIntegrationSide1(void) {return dtLagBasisElemIntegrationSide1.data();} + inline su2double* GetDtBasisElemIntegrationSide1(void) { return dtLagBasisElemIntegrationSide1.data(); } /*! * \brief Function, which makes available the matrix with the derivatives of the element basis functions of side 0 in the integration points. * \return The const pointer to data, which stores this information. */ - inline const su2double* GetMatDerBasisElemIntegrationSide0(void) const {return matDerBasisElemIntegrationSide0.data();} + inline const su2double* GetMatDerBasisElemIntegrationSide0(void) const { + return matDerBasisElemIntegrationSide0.data(); + } /*! * \brief Function, which makes available the matrix with the derivatives of the element basis functions of side 1 in the integration points. * \return The const pointer to data, which stores this information. */ - inline const su2double* GetMatDerBasisElemIntegrationSide1(void) const {return matDerBasisElemIntegrationSide1.data();} + inline const su2double* GetMatDerBasisElemIntegrationSide1(void) const { + return matDerBasisElemIntegrationSide1.data(); + } /*! * \brief Function, which makes available the transpose of the matrix with @@ -1401,7 +1285,9 @@ class CFEMStandardInternalFace : public CFEMStandardElementBase { integration points. * \return The const pointer to data, which stores this information. */ - inline const su2double* GetMatDerBasisElemIntegrationTransposeSide0(void) const {return matDerBasisElemIntegrationTransposeSide0.data();} + inline const su2double* GetMatDerBasisElemIntegrationTransposeSide0(void) const { + return matDerBasisElemIntegrationTransposeSide0.data(); + } /*! * \brief Function, which makes available the transpose of the matrix with @@ -1409,95 +1295,101 @@ class CFEMStandardInternalFace : public CFEMStandardElementBase { integration points. * \return The const pointer to data, which stores this information. */ - inline const su2double* GetMatDerBasisElemIntegrationTransposeSide1(void) const {return matDerBasisElemIntegrationTransposeSide1.data();} + inline const su2double* GetMatDerBasisElemIntegrationTransposeSide1(void) const { + return matDerBasisElemIntegrationTransposeSide1.data(); + } /*! * \brief Function, which makes available the face basis functions of side 0 in the integration points. * \return The pointer to data, which stores this information. */ - inline const su2double* GetBasisFaceIntegrationSide0(void) const {return lagBasisFaceIntegrationSide0.data();} + inline const su2double* GetBasisFaceIntegrationSide0(void) const { return lagBasisFaceIntegrationSide0.data(); } /*! * \brief Function, which makes available the face basis functions of side 1 in the integration points. * \return The pointer to data, which stores this information. */ - inline const su2double* GetBasisFaceIntegrationSide1(void) const {return lagBasisFaceIntegrationSide1.data();} + inline const su2double* GetBasisFaceIntegrationSide1(void) const { return lagBasisFaceIntegrationSide1.data(); } /*! * \brief Function, which makes available transpose matrix of the face basis functions of side 0 in the integration points. * \return The pointer to data, which stores this information. */ - inline const su2double* GetBasisFaceIntegrationTransposeSide0(void) const {return lagBasisFaceIntegrationTransposeSide0.data();} + inline const su2double* GetBasisFaceIntegrationTransposeSide0(void) const { + return lagBasisFaceIntegrationTransposeSide0.data(); + } /*! * \brief Function, which makes available transpose matrix of the face basis functions of side 1 in the integration points. * \return The pointer to data, which stores this information. */ - inline const su2double* GetBasisFaceIntegrationTransposeSide1(void) const {return lagBasisFaceIntegrationTransposeSide1.data();} + inline const su2double* GetBasisFaceIntegrationTransposeSide1(void) const { + return lagBasisFaceIntegrationTransposeSide1.data(); + } /*! * \brief Function, which makes available the r-derivatives of the face basis functions of side 0 in the integration points. * \return The pointer to data, which stores this information. */ - inline su2double* GetDrBasisFaceIntegrationSide0(void) {return drLagBasisFaceIntegrationSide0.data();} + inline su2double* GetDrBasisFaceIntegrationSide0(void) { return drLagBasisFaceIntegrationSide0.data(); } /*! * \brief Function, which makes available the r-derivatives of the face basis functions of side 1 in the integration points. * \return The pointer to data, which stores this information. */ - inline su2double* GetDrBasisFaceIntegrationSide1(void) {return drLagBasisFaceIntegrationSide1.data();} + inline su2double* GetDrBasisFaceIntegrationSide1(void) { return drLagBasisFaceIntegrationSide1.data(); } /*! * \brief Function, which makes available the s-derivatives of the face basis functions of side 0 in the integration points. * \return The pointer to data, which stores this information. */ - inline su2double* GetDsBasisFaceIntegrationSide0(void) {return dsLagBasisFaceIntegrationSide0.data();} + inline su2double* GetDsBasisFaceIntegrationSide0(void) { return dsLagBasisFaceIntegrationSide0.data(); } /*! * \brief Function, which makes available the s-derivatives of the face basis functions of side 1 in the integration points. * \return The pointer to data, which stores this information. */ - inline su2double* GetDsBasisFaceIntegrationSide1(void) {return dsLagBasisFaceIntegrationSide1.data();} + inline su2double* GetDsBasisFaceIntegrationSide1(void) { return dsLagBasisFaceIntegrationSide1.data(); } /*! * \brief Function, which makes available the number of DOFs of the element on side 0 of the face. * \return The number of DOFs of the element on side 0. */ - inline unsigned short GetNDOFsElemSide0(void) const {return nDOFsElemSide0;} + inline unsigned short GetNDOFsElemSide0(void) const { return nDOFsElemSide0; } /*! * \brief Function, which makes available the number of DOFs of the element on side 1 of the face. * \return The number of DOFs on side 1. */ - inline unsigned short GetNDOFsElemSide1(void) const {return nDOFsElemSide1;} + inline unsigned short GetNDOFsElemSide1(void) const { return nDOFsElemSide1; } /*! - * \brief Function, which makes available the number of DOFs on side 0 of the face. - * \return The number of DOFs on side 0. - */ - inline unsigned short GetNDOFsFaceSide0(void) const {return nDOFsFaceSide0;} + * \brief Function, which makes available the number of DOFs on side 0 of the face. + * \return The number of DOFs on side 0. + */ + inline unsigned short GetNDOFsFaceSide0(void) const { return nDOFsFaceSide0; } /*! - * \brief Function, which makes available the number of DOFs on side 1 of the face. - * \return The number of DOFs on side 1. - */ - inline unsigned short GetNDOFsFaceSide1(void) const {return nDOFsFaceSide1;} + * \brief Function, which makes available the number of DOFs on side 1 of the face. + * \return The number of DOFs on side 1. + */ + inline unsigned short GetNDOFsFaceSide1(void) const { return nDOFsFaceSide1; } /*! - * \brief Function, which makes available the penalty constant for this standard face. - * \return The penalty constant. - */ - inline su2double GetPenaltyConstant(void) const {return penaltyConstantFace;} + * \brief Function, which makes available the penalty constant for this standard face. + * \return The penalty constant. + */ + inline su2double GetPenaltyConstant(void) const { return penaltyConstantFace; } /*! * \brief Function, which checks if the function arguments correspond to this standard face. @@ -1518,52 +1410,48 @@ class CFEMStandardInternalFace : public CFEMStandardElementBase { be swapped w.r.t. the connectivity of face of the element on side 1. */ - bool SameStandardMatchingFace(unsigned short val_VTK_TypeFace, - bool val_constJac, - unsigned short val_VTK_TypeSide0, - unsigned short val_nPolySide0, - unsigned short val_VTK_TypeSide1, - unsigned short val_nPolySide1, - bool val_swapFaceInElementSide0, - bool val_swapFaceInElementSide1); + bool SameStandardMatchingFace(unsigned short val_VTK_TypeFace, bool val_constJac, unsigned short val_VTK_TypeSide0, + unsigned short val_nPolySide0, unsigned short val_VTK_TypeSide1, + unsigned short val_nPolySide1, bool val_swapFaceInElementSide0, + bool val_swapFaceInElementSide1); /*! * \brief Function, which estimates the amount of work for an element of this type. This information is used to determine a well balanced partition. * \param[in] config - Object, which contains the input parameters. */ - su2double WorkEstimateMetis(CConfig *config); + su2double WorkEstimateMetis(CConfig* config); -private: + private: /*! - * \brief Function, which copies the data of the given object into the current object. - * \param[in] other - Object, whose data is copied. - */ - void Copy(const CFEMStandardInternalFace &other); + * \brief Function, which copies the data of the given object into the current object. + * \param[in] other - Object, whose data is copied. + */ + void Copy(const CFEMStandardInternalFace& other); }; /*! * \class CFEMStandardBoundaryFace * \brief Class to define a FEM standard boundary face. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CFEMStandardBoundaryFace : public CFEMStandardElementBase { -private: - unsigned short nDOFsFace; /*!< \brief Number of DOFs of the face. */ + private: + unsigned short nDOFsFace; /*!< \brief Number of DOFs of the face. */ unsigned short nPolyElem; /*!< \brief Polynomial degree of the element adjacent to the face. */ unsigned short nDOFsElem; /*!< \brief Number of DOFs of the element adjacent element to the face. */ unsigned short VTK_TypeElem; /*!< \brief Type of the element adjacent to the face using the VTK convention. */ - bool swapFaceInElement; /*!< \brief Whether or not the connectivity of the face must be swapped compared - to the face of the corresponding standard element adjacent to the face. */ + bool swapFaceInElement; /*!< \brief Whether or not the connectivity of the face must be swapped compared + to the face of the corresponding standard element adjacent to the face. */ - su2double penaltyConstantFace; /*!< \brief The constant of the penalty parameter of the face, - which is used in the viscous discretization. */ + su2double penaltyConstantFace; /*!< \brief The constant of the penalty parameter of the face, + which is used in the viscous discretization. */ - vector rDOFsFace; /*!< \brief r-location of the DOFs of the face. */ - vector sDOFsFace; /*!< \brief s-location of the DOFs of the face, if needed. */ + vector rDOFsFace; /*!< \brief r-location of the DOFs of the face. */ + vector sDOFsFace; /*!< \brief s-location of the DOFs of the face, if needed. */ vector lagBasisFaceIntegration; /*!< \brief Lagrangian basis functions in the integration points of the face. */ @@ -1581,18 +1469,17 @@ class CFEMStandardBoundaryFace : public CFEMStandardElementBase { vector dtLagBasisElemIntegration; /*!< \brief t-derivatives of the Lagrangian basis functions in the integration points of the element adjacent to the face. */ - vector matDerBasisElemIntegration; /*!< \brief Matrix of drLagBasisElemIntegration, dsLagBasisElemIntegration - and dtLagBasisElemIntegration combined for efficiency - when using BLAS routines. */ + vector matDerBasisElemIntegration; /*!< \brief Matrix of drLagBasisElemIntegration, + dsLagBasisElemIntegration and dtLagBasisElemIntegration combined for + efficiency when using BLAS routines. */ vector matDerBasisElemIntegrationTranspose; /*!< \brief Transpose of matDerBasisElemIntegration, such that - the residuals of the symmetrizing terms can be computed - with a single matrix multiplication. */ - + the residuals of the symmetrizing terms can be + computed with a single matrix multiplication. */ vector subConnForPlotting; /*!< \brief Local subconnectivity of the high order element. Used for plotting. */ -public: + public: /*! * \brief Alternative constructor. * \param[in] val_VTK_TypeFace - The type of the face using the VTK convention. @@ -1605,54 +1492,53 @@ class CFEMStandardBoundaryFace : public CFEMStandardElementBase { * \param[in] val_orderExact - Default argument. If specified, it contains the order of the polynomials that must be integrated exactly by the integration rule. */ - CFEMStandardBoundaryFace(unsigned short val_VTK_TypeFace, - unsigned short val_VTK_TypeElem, - unsigned short val_nPolyElem, - bool val_constJac, - bool val_swapFaceInElement, - CConfig *config, + CFEMStandardBoundaryFace(unsigned short val_VTK_TypeFace, unsigned short val_VTK_TypeElem, + unsigned short val_nPolyElem, bool val_constJac, bool val_swapFaceInElement, CConfig* config, unsigned short val_orderExact = 0); /*! - * \brief Copy constructor. - * \param[in] other - Object, whose data must be copied. - */ - CFEMStandardBoundaryFace(const CFEMStandardBoundaryFace &other) : CFEMStandardElementBase(other) {Copy(other);} + * \brief Copy constructor. + * \param[in] other - Object, whose data must be copied. + */ + CFEMStandardBoundaryFace(const CFEMStandardBoundaryFace& other) : CFEMStandardElementBase(other) { Copy(other); } /*! - * \brief Assignment operator. - * \param[in] other - Object, to which this object must be assigned. - * \return The current object, after the member variables were assigned the correct value. - */ - CFEMStandardBoundaryFace& operator=(const CFEMStandardBoundaryFace &other){Copy(other); return (*this);} + * \brief Assignment operator. + * \param[in] other - Object, to which this object must be assigned. + * \return The current object, after the member variables were assigned the correct value. + */ + CFEMStandardBoundaryFace& operator=(const CFEMStandardBoundaryFace& other) { + Copy(other); + return (*this); + } /*! * \brief Function, which makes available the r-derivatives of the element basis functions in the integration points. * \return The pointer to data, which stores this information. */ - inline const su2double* GetDrBasisElemIntegration(void) const {return drLagBasisElemIntegration.data();} + inline const su2double* GetDrBasisElemIntegration(void) const { return drLagBasisElemIntegration.data(); } /*! * \brief Function, which makes available the s-derivatives of the element basis functions in the integration points. * \return The pointer to data, which stores this information. */ - inline const su2double* GetDsBasisElemIntegration(void) const {return dsLagBasisElemIntegration.data();} + inline const su2double* GetDsBasisElemIntegration(void) const { return dsLagBasisElemIntegration.data(); } /*! * \brief Function, which makes available the t-derivatives of the element basis functions in the integration points. * \return The pointer to data, which stores this information. */ - inline const su2double* GetDtBasisElemIntegration(void) const {return dtLagBasisElemIntegration.data();} + inline const su2double* GetDtBasisElemIntegration(void) const { return dtLagBasisElemIntegration.data(); } /*! * \brief Function, which makes available the matrix with the derivatives of the element basis functions in the integration points. * \return The pointer to data, which stores this information. */ - inline const su2double* GetMatDerBasisElemIntegration(void) const {return matDerBasisElemIntegration.data();} + inline const su2double* GetMatDerBasisElemIntegration(void) const { return matDerBasisElemIntegration.data(); } /*! * \brief Function, which makes available the transpose of the matrix with @@ -1660,55 +1546,59 @@ class CFEMStandardBoundaryFace : public CFEMStandardElementBase { points. * \return The const pointer to data, which stores this information. */ - inline const su2double* GetMatDerBasisElemIntegrationTranspose(void) const {return matDerBasisElemIntegrationTranspose.data();} + inline const su2double* GetMatDerBasisElemIntegrationTranspose(void) const { + return matDerBasisElemIntegrationTranspose.data(); + } /*! * \brief Function, which makes available the face basis functions in the integration points. * \return The pointer to data, which stores this information. */ - inline const su2double* GetBasisFaceIntegration(void) const {return lagBasisFaceIntegration.data();} + inline const su2double* GetBasisFaceIntegration(void) const { return lagBasisFaceIntegration.data(); } /*! * \brief Function, which makes available transpose matrix of the face basis functions in the integration points. * \return The pointer to data, which stores this information. */ - inline const su2double* GetBasisFaceIntegrationTranspose(void) const {return lagBasisFaceIntegrationTranspose.data();} + inline const su2double* GetBasisFaceIntegrationTranspose(void) const { + return lagBasisFaceIntegrationTranspose.data(); + } /*! * \brief Function, which makes available the r-derivatives of the face basis functions in the integration points. * \return The pointer to data, which stores this information. */ - inline const su2double* GetDrBasisFaceIntegration(void) const {return drLagBasisFaceIntegration.data();} + inline const su2double* GetDrBasisFaceIntegration(void) const { return drLagBasisFaceIntegration.data(); } /*! * \brief Function, which makes available the s-derivatives of the face basis functions in the integration points. * \return The pointer to data, which stores this information. */ - inline const su2double* GetDsBasisFaceIntegration(void) const {return dsLagBasisFaceIntegration.data();} + inline const su2double* GetDsBasisFaceIntegration(void) const { return dsLagBasisFaceIntegration.data(); } /*! * \brief Function, which makes available the number of DOFs of the adjacent element. * \return The number of DOFs of the element. */ - inline unsigned short GetNDOFsElem(void) const {return nDOFsElem;} + inline unsigned short GetNDOFsElem(void) const { return nDOFsElem; } /*! - * \brief Function, which makes available the number of DOFs of the face. - * \return The number of DOFs of the face. - */ - inline unsigned short GetNDOFsFace(void) const {return nDOFsFace;} + * \brief Function, which makes available the number of DOFs of the face. + * \return The number of DOFs of the face. + */ + inline unsigned short GetNDOFsFace(void) const { return nDOFsFace; } /*! * \brief Function, which makes available the number of linear subfaces used for plotting, among others. * \return The number of linear subfaces of the face. */ - inline unsigned short GetNSubFaces(void) const {return subConnForPlotting.size()/GetNDOFsPerSubFace();} + inline unsigned short GetNSubFaces(void) const { return subConnForPlotting.size() / GetNDOFsPerSubFace(); } /*! * \brief Function, which makes available the number of DOFs of a linear subface, used @@ -1718,17 +1608,17 @@ class CFEMStandardBoundaryFace : public CFEMStandardElementBase { unsigned short GetNDOFsPerSubFace(void) const; /*! - * \brief Function, which makes available the penalty constant for this standard face. - * \return The penalty constant. - */ - inline su2double GetPenaltyConstant(void) const {return penaltyConstantFace;} + * \brief Function, which makes available the penalty constant for this standard face. + * \return The penalty constant. + */ + inline su2double GetPenaltyConstant(void) const { return penaltyConstantFace; } /*! * \brief Function, which makes available the the connectivity of the linear subfaces as a const pointer. * \return The pointer to the local connectivity of the linear subfaces. */ - inline const unsigned short* GetSubFaceConn(void) const {return subConnForPlotting.data();} + inline const unsigned short* GetSubFaceConn(void) const { return subConnForPlotting.data(); } /*! * \brief Function, which checks if the function arguments correspond to this standard face. @@ -1739,17 +1629,14 @@ class CFEMStandardBoundaryFace : public CFEMStandardElementBase { * \param[in] val_swapFaceInElem - Whether or not the connectivity of the face must be swapped w.r.t. the connectivity of face of the adjacent element. */ - bool SameStandardBoundaryFace(unsigned short val_VTK_TypeFace, - bool val_constJac, - unsigned short val_VTK_TypeElem, - unsigned short val_nPolyElem, - bool val_swapFaceInElem); + bool SameStandardBoundaryFace(unsigned short val_VTK_TypeFace, bool val_constJac, unsigned short val_VTK_TypeElem, + unsigned short val_nPolyElem, bool val_swapFaceInElem); /*! * \brief Function, which estimates the amount of work for an element of this type. This information is used to determine a well balanced partition. * \param[in] config - Object, which contains the input parameters. */ - su2double WorkEstimateMetis(CConfig *config); + su2double WorkEstimateMetis(CConfig* config); /*! * \brief Function, which estimates the additional amount of work for an element @@ -1758,13 +1645,12 @@ class CFEMStandardBoundaryFace : public CFEMStandardElementBase { * \param[in] config - Object, which contains the input parameters. * \param[in] nPointsWF - Number of points to discretize the wall model. */ - su2double WorkEstimateMetisWallFunctions(CConfig *config, - const unsigned short nPointsWF); + su2double WorkEstimateMetisWallFunctions(CConfig* config, const unsigned short nPointsWF); -private: + private: /*! - * \brief Function, which copies the data of the given object into the current object. - * \param[in] other - Object, whose data is copied. - */ - void Copy(const CFEMStandardBoundaryFace &other); + * \brief Function, which copies the data of the given object into the current object. + * \param[in] other - Object, whose data is copied. + */ + void Copy(const CFEMStandardBoundaryFace& other); }; diff --git a/Common/include/fem/geometry_structure_fem_part.hpp b/Common/include/fem/geometry_structure_fem_part.hpp index 332d66d3560..66471908d5a 100644 --- a/Common/include/fem/geometry_structure_fem_part.hpp +++ b/Common/include/fem/geometry_structure_fem_part.hpp @@ -2,7 +2,7 @@ * \file geometry_structure_fem_part.hpp * \brief Helper classes for the Fluid FEM solver. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -37,19 +37,17 @@ * \brief Helper struct used to store two integral types as one entity. */ struct CUnsignedLong2T { - - unsigned long long0; /*!< \brief First integer to store in this class. */ - unsigned long long1; /*!< \brief Second integer to store in this class. */ + unsigned long long0; /*!< \brief First integer to store in this class. */ + unsigned long long1; /*!< \brief Second integer to store in this class. */ CUnsignedLong2T(unsigned long a = 0, unsigned long b = 0) : long0(a), long1(b) {} - inline bool operator<(const CUnsignedLong2T &other) const { - if(long0 != other.long0) - return (long0 < other.long0); + inline bool operator<(const CUnsignedLong2T& other) const { + if (long0 != other.long0) return (long0 < other.long0); return (long1 < other.long1); } - inline bool operator==(const CUnsignedLong2T &other) const { + inline bool operator==(const CUnsignedLong2T& other) const { return (long0 == other.long0) && (long1 == other.long1); } }; @@ -59,19 +57,17 @@ struct CUnsignedLong2T { * \brief Help struct used to store two integral types as one entity. */ struct CUnsignedShort2T { - - unsigned short short0; /*!< \brief First integer to store in this class. */ - unsigned short short1; /*!< \brief Second integer to store in this class. */ + unsigned short short0; /*!< \brief First integer to store in this class. */ + unsigned short short1; /*!< \brief Second integer to store in this class. */ CUnsignedShort2T(unsigned short a = 0, unsigned short b = 0) : short0(a), short1(b) {} - inline bool operator<(const CUnsignedShort2T &other) const { - if(short0 != other.short0) - return (short0 < other.short0); + inline bool operator<(const CUnsignedShort2T& other) const { + if (short0 != other.short0) return (short0 < other.short0); return (short1 < other.short1); } - inline bool operator==(const CUnsignedShort2T &other) const { + inline bool operator==(const CUnsignedShort2T& other) const { return (short0 == other.short0) && (short1 == other.short1); } }; @@ -82,16 +78,16 @@ struct CUnsignedShort2T { the faces of DG. It stores a face of an element. */ class CFaceOfElement { -public: + public: unsigned short nCornerPoints; /*!< \brief Number of corner points of the face. */ - unsigned long cornerPoints[4]; /*!< \brief Global ID's of ther corner points. */ - unsigned long elemID0, elemID1; /*!< \brief Element ID's to the left and right. */ + unsigned long cornerPoints[4]; /*!< \brief Global ID's of ther corner points. */ + unsigned long elemID0, elemID1; /*!< \brief Element ID's to the left and right. */ unsigned short nPolyGrid0, nPolyGrid1; /*!< \brief Polynomial degrees of the grid of the elements to the left and right. */ - unsigned short nPolySol0, nPolySol1; /*!< \brief Polynomial degrees of the solution of the elements + unsigned short nPolySol0, nPolySol1; /*!< \brief Polynomial degrees of the solution of the elements to the left and right. */ unsigned short nDOFsElem0, nDOFsElem1; /*!< \brief Number of DOFs of the elements to the left and right. */ - unsigned short elemType0, elemType1; /*!< \brief Type of the elements to the left and right. */ + unsigned short elemType0, elemType1; /*!< \brief Type of the elements to the left and right. */ unsigned short faceID0, faceID1; /*!< \brief The local face ID in the corresponding elements to the left and right of the face. */ unsigned short periodicIndex; /*!< \brief Periodic indicator of the face. A value of 0 means no @@ -110,35 +106,36 @@ class CFaceOfElement { /* Standard constructor and destructor. */ CFaceOfElement(); - ~CFaceOfElement(){} + ~CFaceOfElement() {} /* Alternative constructor to set the corner points. */ - CFaceOfElement(const unsigned short VTK_Type, - const unsigned short nPoly, - const unsigned long *Nodes); + CFaceOfElement(const unsigned short VTK_Type, const unsigned short nPoly, const unsigned long* Nodes); /* Copy constructor and assignment operator. */ - inline CFaceOfElement(const CFaceOfElement &other) { Copy(other); } + inline CFaceOfElement(const CFaceOfElement& other) { Copy(other); } - inline CFaceOfElement& operator=(const CFaceOfElement &other) { Copy(other); return (*this); } + inline CFaceOfElement& operator=(const CFaceOfElement& other) { + Copy(other); + return (*this); + } /* Less than operator. Needed for the sorting and searching. */ - bool operator<(const CFaceOfElement &other) const; + bool operator<(const CFaceOfElement& other) const; /* Equal operator. Needed for removing double entities. */ - bool operator ==(const CFaceOfElement &other) const; + bool operator==(const CFaceOfElement& other) const; /*--- Member function, which creates a unique numbering for the corner points. A sort in increasing order is OK for this purpose. ---*/ - inline void CreateUniqueNumbering(void) { std::sort(cornerPoints, cornerPoints+nCornerPoints); } + inline void CreateUniqueNumbering(void) { std::sort(cornerPoints, cornerPoints + nCornerPoints); } /*--- Member function, which creates a unique numbering for the corner points while the orientation is taken into account. ---*/ void CreateUniqueNumberingWithOrientation(void); -private: + private: /*--- Copy function, which copies the data of the given object into the current object. ---*/ - void Copy(const CFaceOfElement &other); + void Copy(const CFaceOfElement& other); }; /*! @@ -147,28 +144,29 @@ class CFaceOfElement { It stores a boundary element. */ class CBoundaryFace { -public: + public: unsigned short VTK_Type, nPolyGrid, nDOFsGrid; - unsigned long globalBoundElemID, domainElementID; - std::vector Nodes; + unsigned long globalBoundElemID, domainElementID; + std::vector Nodes; /* Standard constructor and destructor. Nothing to be done. */ - CBoundaryFace(){} - ~CBoundaryFace(){} + CBoundaryFace() {} + ~CBoundaryFace() {} /* Copy constructor and assignment operator. */ - inline CBoundaryFace(const CBoundaryFace &other) { Copy(other); } + inline CBoundaryFace(const CBoundaryFace& other) { Copy(other); } - inline CBoundaryFace& operator=(const CBoundaryFace &other) { Copy(other); return (*this); } + inline CBoundaryFace& operator=(const CBoundaryFace& other) { + Copy(other); + return (*this); + } /* Less than operator. Needed for the sorting. */ - inline bool operator<(const CBoundaryFace &other) const { - return (globalBoundElemID < other.globalBoundElemID); - } + inline bool operator<(const CBoundaryFace& other) const { return (globalBoundElemID < other.globalBoundElemID); } -private: + private: /*--- Copy function, which copies the data of the given object into the current object. ---*/ - void Copy(const CBoundaryFace &other); + void Copy(const CBoundaryFace& other); }; /*! @@ -176,35 +174,37 @@ class CBoundaryFace { * \brief Help class used to determine whether or not (periodic) faces match. */ class CMatchingFace { -public: - unsigned short nCornerPoints; /*!< \brief Number of corner points of the face. */ - unsigned short nDim; /*!< \brief Number of spatial dimensions. */ - unsigned short nPoly; /*!< \brief Polynomial degree of the face. */ - unsigned short nDOFsElem; /*!< \brief Number of DOFs of the relevant adjacent element. */ - unsigned short elemType; /*!< \brief Type of the adjacent element. */ - unsigned long elemID; /*!< \brief The relevant adjacent element ID. */ - su2double cornerCoor[4][3]; /*!< \brief Coordinates of the corner points of the face. */ - su2double tolForMatching; /*!< \brief Tolerance for this face for matching points. */ + public: + unsigned short nCornerPoints; /*!< \brief Number of corner points of the face. */ + unsigned short nDim; /*!< \brief Number of spatial dimensions. */ + unsigned short nPoly; /*!< \brief Polynomial degree of the face. */ + unsigned short nDOFsElem; /*!< \brief Number of DOFs of the relevant adjacent element. */ + unsigned short elemType; /*!< \brief Type of the adjacent element. */ + unsigned long elemID; /*!< \brief The relevant adjacent element ID. */ + su2double cornerCoor[4][3]; /*!< \brief Coordinates of the corner points of the face. */ + su2double tolForMatching; /*!< \brief Tolerance for this face for matching points. */ /* Standard constructor. */ CMatchingFace(); /* Destructor, nothing to be done. */ - ~CMatchingFace(){} + ~CMatchingFace() {} /* Copy constructor and assignment operator. */ - inline CMatchingFace(const CMatchingFace &other) { Copy(other); } + inline CMatchingFace(const CMatchingFace& other) { Copy(other); } - inline CMatchingFace& operator=(const CMatchingFace &other) { Copy(other); return (*this); } + inline CMatchingFace& operator=(const CMatchingFace& other) { + Copy(other); + return (*this); + } /* Less than operator. Needed for the sorting and searching. */ - bool operator<(const CMatchingFace &other) const; + bool operator<(const CMatchingFace& other) const; /*--- Member function, which sorts the coordinates of the face. ---*/ void SortFaceCoordinates(void); -private: + private: /*--- Copy function, which copies the data of the given object into the current object. ---*/ - void Copy(const CMatchingFace &other); + void Copy(const CMatchingFace& other); }; - diff --git a/Common/include/geometry/CDummyGeometry.hpp b/Common/include/geometry/CDummyGeometry.hpp index e5ec401057e..a7dea357b68 100644 --- a/Common/include/geometry/CDummyGeometry.hpp +++ b/Common/include/geometry/CDummyGeometry.hpp @@ -2,7 +2,7 @@ * \file CDummyGeometry.hpp * \brief Headers of the dummy geometry class used in "dry run" mode. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -36,14 +36,11 @@ * going through the time-consuming mesh initialization and paritioning. * \author T. Albring */ -class CDummyGeometry final : public CGeometry{ - -public: +class CDummyGeometry final : public CGeometry { + public: /*! * \brief Constructor of the class * \param[in] config - Definition of the particular problem. */ - CDummyGeometry(CConfig *config); - + CDummyGeometry(CConfig* config); }; - diff --git a/Common/include/geometry/CGeometry.hpp b/Common/include/geometry/CGeometry.hpp index c4e5067245c..f8111060725 100644 --- a/Common/include/geometry/CGeometry.hpp +++ b/Common/include/geometry/CGeometry.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for creating the geometrical structure. * The subroutines and functions are in the CGeometry.cpp file. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -45,9 +45,9 @@ extern "C" { #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -74,125 +74,141 @@ using namespace std; */ class CGeometry { protected: - enum : size_t {OMP_MIN_SIZE = 32}; /*!< \brief Chunk size for small loops. */ - enum : size_t {MAXNDIM = 3}; - - const int size{SINGLE_NODE}; /*!< \brief MPI Size. */ - const int rank{MASTER_NODE}; /*!< \brief MPI Rank. */ - - unsigned long nPoint{0}, /*!< \brief Number of points of the mesh. */ - nPointDomain{0}, /*!< \brief Number of real points of the mesh. */ - nPointGhost{0}, /*!< \brief Number of ghost points of the mesh. */ - Global_nPoint{0}, /*!< \brief Total number of nodes in a simulation across all processors (including halos). */ - Global_nPointDomain{0}, /*!< \brief Total number of nodes in a simulation across all processors (excluding halos). */ - nElem{0}, /*!< \brief Number of elements of the mesh. */ - Global_nElem{0}, /*!< \brief Total number of elements in a simulation across all processors (all types). */ - Global_nElemDomain{0}, /*!< \brief Total number of elements in a simulation across all processors (excluding halos). */ - nEdge{0}, /*!< \brief Number of edges of the mesh. */ - nFace{0}, /*!< \brief Number of faces of the mesh. */ - nelem_edge{0}, /*!< \brief Number of edges in the mesh. */ - Global_nelem_edge{0}, /*!< \brief Total number of edges in the mesh across all processors. */ - nelem_triangle{0}, /*!< \brief Number of triangles in the mesh. */ - Global_nelem_triangle{0}, /*!< \brief Total number of triangles in the mesh across all processors. */ - nelem_quad{0}, /*!< \brief Number of quadrangles in the mesh. */ - Global_nelem_quad{0}, /*!< \brief Total number of quadrangles in the mesh across all processors. */ - nelem_tetra{0}, /*!< \brief Number of tetrahedra in the mesh. */ - Global_nelem_tetra{0}, /*!< \brief Total number of tetrahedra in the mesh across all processors. */ - nelem_hexa{0}, /*!< \brief Number of hexahedra in the mesh. */ - Global_nelem_hexa{0}, /*!< \brief Total number of hexahedra in the mesh across all processors. */ - nelem_prism{0}, /*!< \brief Number of prisms in the mesh. */ - Global_nelem_prism{0}, /*!< \brief Total number of prisms in the mesh across all processors. */ - nelem_pyramid{0}, /*!< \brief Number of pyramids in the mesh. */ - Global_nelem_pyramid{0}, /*!< \brief Total number of pyramids in the mesh across all processors. */ - nelem_edge_bound{0}, /*!< \brief Number of edges on the mesh boundaries. */ - Global_nelem_edge_bound{0}, /*!< \brief Total number of edges on the mesh boundaries across all processors. */ - nelem_triangle_bound{0}, /*!< \brief Number of triangles on the mesh boundaries. */ - Global_nelem_triangle_bound{0}, /*!< \brief Total number of triangles on the mesh boundaries across all processors. */ - nelem_quad_bound{0}, /*!< \brief Number of quads on the mesh boundaries. */ - Global_nelem_quad_bound{0}, /*!< \brief Total number of quads on the mesh boundaries across all processors. */ - nNonconvexElements{0}; /*!< \brief Number of nonconvex elements in the mesh. */ - - unsigned short nDim{0}; /*!< \brief Number of dimension of the problem. */ - unsigned short nZone{0}; /*!< \brief Number of zones in the problem. */ - unsigned short nMarker{0}; /*!< \brief Number of different markers of the mesh. */ - unsigned short nCommLevel{0}; /*!< \brief Number of non-blocking communication levels. */ + enum : size_t { OMP_MIN_SIZE = 32 }; /*!< \brief Chunk size for small loops. */ + enum : size_t { MAXNDIM = 3 }; + + const int size{SINGLE_NODE}; /*!< \brief MPI Size. */ + const int rank{MASTER_NODE}; /*!< \brief MPI Rank. */ + + unsigned long nPoint{0}, /*!< \brief Number of points of the mesh. */ + nPointDomain{0}, /*!< \brief Number of real points of the mesh. */ + nPointGhost{0}, /*!< \brief Number of ghost points of the mesh. */ + Global_nPoint{0}, /*!< \brief Total number of nodes in a simulation across all processors (including halos). */ + Global_nPointDomain{ + 0}, /*!< \brief Total number of nodes in a simulation across all processors (excluding halos). */ + nElem{0}, /*!< \brief Number of elements of the mesh. */ + Global_nElem{0}, /*!< \brief Total number of elements in a simulation across all processors (all types). */ + Global_nElemDomain{ + 0}, /*!< \brief Total number of elements in a simulation across all processors (excluding halos). */ + nEdge{0}, /*!< \brief Number of edges of the mesh. */ + nFace{0}, /*!< \brief Number of faces of the mesh. */ + nelem_edge{0}, /*!< \brief Number of edges in the mesh. */ + Global_nelem_edge{0}, /*!< \brief Total number of edges in the mesh across all processors. */ + nelem_triangle{0}, /*!< \brief Number of triangles in the mesh. */ + Global_nelem_triangle{0}, /*!< \brief Total number of triangles in the mesh across all processors. */ + nelem_quad{0}, /*!< \brief Number of quadrangles in the mesh. */ + Global_nelem_quad{0}, /*!< \brief Total number of quadrangles in the mesh across all processors. */ + nelem_tetra{0}, /*!< \brief Number of tetrahedra in the mesh. */ + Global_nelem_tetra{0}, /*!< \brief Total number of tetrahedra in the mesh across all processors. */ + nelem_hexa{0}, /*!< \brief Number of hexahedra in the mesh. */ + Global_nelem_hexa{0}, /*!< \brief Total number of hexahedra in the mesh across all processors. */ + nelem_prism{0}, /*!< \brief Number of prisms in the mesh. */ + Global_nelem_prism{0}, /*!< \brief Total number of prisms in the mesh across all processors. */ + nelem_pyramid{0}, /*!< \brief Number of pyramids in the mesh. */ + Global_nelem_pyramid{0}, /*!< \brief Total number of pyramids in the mesh across all processors. */ + nelem_edge_bound{0}, /*!< \brief Number of edges on the mesh boundaries. */ + Global_nelem_edge_bound{0}, /*!< \brief Total number of edges on the mesh boundaries across all processors. */ + nelem_triangle_bound{0}, /*!< \brief Number of triangles on the mesh boundaries. */ + Global_nelem_triangle_bound{ + 0}, /*!< \brief Total number of triangles on the mesh boundaries across all processors. */ + nelem_quad_bound{0}, /*!< \brief Number of quads on the mesh boundaries. */ + Global_nelem_quad_bound{0}, /*!< \brief Total number of quads on the mesh boundaries across all processors. */ + nNonconvexElements{0}; /*!< \brief Number of nonconvex elements in the mesh. */ + + unsigned short nDim{0}; /*!< \brief Number of dimension of the problem. */ + unsigned short nZone{0}; /*!< \brief Number of zones in the problem. */ + unsigned short nMarker{0}; /*!< \brief Number of different markers of the mesh. */ + unsigned short nCommLevel{0}; /*!< \brief Number of non-blocking communication levels. */ unsigned short MGLevel{0}; /*!< \brief The mesh level index for the current geometry container. */ unsigned long Max_GlobalPoint{0}; /*!< \brief Greater global point in the domain local structure. */ /*--- Boundary information. ---*/ - short *Marker_All_SendRecv{nullptr}; /*!< \brief MPI Marker. */ - su2double **CustomBoundaryTemperature{nullptr}; - su2double **CustomBoundaryHeatFlux{nullptr}; + short* Marker_All_SendRecv{nullptr}; /*!< \brief MPI Marker. */ + su2double** CustomBoundaryTemperature{nullptr}; + su2double** CustomBoundaryHeatFlux{nullptr}; /*--- Create vectors and distribute the values among the different planes queues ---*/ - vector > Xcoord_plane; /*!< \brief Vector containing x coordinates of new points appearing on a single plane */ - vector > Ycoord_plane; /*!< \brief Vector containing y coordinates of new points appearing on a single plane */ - vector > Zcoord_plane; /*!< \brief Vector containing z coordinates of new points appearing on a single plane */ - vector > FaceArea_plane; /*!< \brief Vector containing area/volume associated with new points appearing on a single plane */ - vector > Plane_points; /*!< \brief Vector containing points appearing on a single plane */ + vector> + Xcoord_plane; /*!< \brief Vector containing x coordinates of new points appearing on a single plane */ + vector> + Ycoord_plane; /*!< \brief Vector containing y coordinates of new points appearing on a single plane */ + vector> + Zcoord_plane; /*!< \brief Vector containing z coordinates of new points appearing on a single plane */ + vector> FaceArea_plane; /*!< \brief Vector containing area/volume associated with new points + appearing on a single plane */ + vector> Plane_points; /*!< \brief Vector containing points appearing on a single plane */ - vector XCoordList; /*!< \brief Vector containing points appearing on a single plane */ + vector XCoordList; /*!< \brief Vector containing points appearing on a single plane */ #if defined(HAVE_MPI) && defined(HAVE_PARMETIS) - vector > adj_nodes; /*!< \brief Vector of vectors holding each node's adjacency during preparation for ParMETIS. */ - vector adjacency; /*!< \brief Local adjacency array to be input into ParMETIS for partitioning (idx_t is a ParMETIS type defined in their headers). */ - vector xadj; /*!< \brief Index array that points to the start of each node's adjacency in CSR format (needed to interpret the adjacency array). */ + vector> + adj_nodes; /*!< \brief Vector of vectors holding each node's adjacency during preparation for ParMETIS. */ + vector adjacency; /*!< \brief Local adjacency array to be input into ParMETIS for partitioning (idx_t is a + ParMETIS type defined in their headers). */ + vector xadj; /*!< \brief Index array that points to the start of each node's adjacency in CSR format (needed to + interpret the adjacency array). */ #endif /*--- Turbomachinery variables ---*/ - unsigned short *nSpanWiseSections{nullptr}; /*!< \brief Number of Span wise section for each turbo marker, indexed by inflow/outflow */ - unsigned short *nSpanSectionsByMarker{nullptr}; /*!< \brief Number of Span wise section for each turbo marker, indexed by marker. Needed for deallocation.*/ + unsigned short* nSpanWiseSections{ + nullptr}; /*!< \brief Number of Span wise section for each turbo marker, indexed by inflow/outflow */ + unsigned short* nSpanSectionsByMarker{nullptr}; /*!< \brief Number of Span wise section for each turbo marker, indexed + by marker. Needed for deallocation.*/ unsigned short nTurboPerf{0}; /*!< \brief Number of Span wise section for each turbo marker. */ - su2double **SpanWiseValue{nullptr}; /*!< \brief Span wise values for each turbo marker. */ - long **nVertexSpan{nullptr}; /*!< \brief number of vertexes for span wise section for each marker. */ - unsigned long **nTotVertexSpan{nullptr}; /*!< \brief number of vertexes at each span wise section for each marker. */ - unsigned long nVertexSpanMax[3] = {0}; /*!< \brief max number of vertexes for each span section for each marker flag. */ - su2double ***AverageTurboNormal{nullptr}; /*!< \brief Average boundary normal at each span wise section for each marker in the turbomachinery frame of reference.*/ - su2double ***AverageNormal{nullptr}; /*!< \brief Average boundary normal at each span wise section for each marker.*/ - su2double ***AverageGridVel{nullptr}; /*!< \brief Average boundary grid velocity at each span wise section for each marker.*/ - su2double **AverageTangGridVel{nullptr}; /*!< \brief Average tangential rotational speed at each span wise section for each marker.*/ - su2double **SpanArea{nullptr}; /*!< \brief Area at each span wise section for each marker.*/ - su2double **MaxAngularCoord{nullptr}; /*!< \brief Max angular pitch at each span wise section for each marker.*/ - su2double **MinAngularCoord{nullptr}; /*!< \brief Max angular pitch at each span wise section for each marker.*/ - su2double **MinRelAngularCoord{nullptr}; /*!< \brief Min relative angular coord at each span wise section for each marker.*/ - su2double **TurboRadius{nullptr}; /*!< \brief Radius at each span wise section for each marker.*/ - su2double **TangGridVelIn{nullptr}; - su2double **TangGridVelOut{nullptr}; /*!< \brief Average tangential rotational speed at each span wise section for each turbomachinery marker.*/ - su2double **SpanAreaIn{nullptr}; - su2double **SpanAreaOut{nullptr}; /*!< \brief Area at each span wise section for each turbomachinery marker.*/ - su2double **TurboRadiusIn{nullptr}; - su2double **TurboRadiusOut{nullptr}; /*!< \brief Radius at each span wise section for each turbomachinery marker*/ + su2double** SpanWiseValue{nullptr}; /*!< \brief Span wise values for each turbo marker. */ + long** nVertexSpan{nullptr}; /*!< \brief number of vertexes for span wise section for each marker. */ + unsigned long** nTotVertexSpan{nullptr}; /*!< \brief number of vertexes at each span wise section for each marker. */ + unsigned long nVertexSpanMax[3] = { + 0}; /*!< \brief max number of vertexes for each span section for each marker flag. */ + su2double*** AverageTurboNormal{nullptr}; /*!< \brief Average boundary normal at each span wise section for each + marker in the turbomachinery frame of reference.*/ + su2double*** AverageNormal{nullptr}; /*!< \brief Average boundary normal at each span wise section for each marker.*/ + su2double*** AverageGridVel{ + nullptr}; /*!< \brief Average boundary grid velocity at each span wise section for each marker.*/ + su2double** AverageTangGridVel{ + nullptr}; /*!< \brief Average tangential rotational speed at each span wise section for each marker.*/ + su2double** SpanArea{nullptr}; /*!< \brief Area at each span wise section for each marker.*/ + su2double** MaxAngularCoord{nullptr}; /*!< \brief Max angular pitch at each span wise section for each marker.*/ + su2double** MinAngularCoord{nullptr}; /*!< \brief Max angular pitch at each span wise section for each marker.*/ + su2double** MinRelAngularCoord{ + nullptr}; /*!< \brief Min relative angular coord at each span wise section for each marker.*/ + su2double** TurboRadius{nullptr}; /*!< \brief Radius at each span wise section for each marker.*/ + su2double** TangGridVelIn{nullptr}; + su2double** TangGridVelOut{nullptr}; /*!< \brief Average tangential rotational speed at each span wise section for + each turbomachinery marker.*/ + su2double** SpanAreaIn{nullptr}; + su2double** SpanAreaOut{nullptr}; /*!< \brief Area at each span wise section for each turbomachinery marker.*/ + su2double** TurboRadiusIn{nullptr}; + su2double** TurboRadiusOut{nullptr}; /*!< \brief Radius at each span wise section for each turbomachinery marker*/ /*--- Sparsity patterns associated with the geometry. ---*/ - CCompressedSparsePatternUL - finiteVolumeCSRFill0, /*!< \brief 0-fill FVM sparsity. */ - finiteVolumeCSRFillN, /*!< \brief N-fill FVM sparsity (e.g. for ILUn preconditioner). */ - finiteElementCSRFill0, /*!< \brief 0-fill FEM sparsity. */ - finiteElementCSRFillN; /*!< \brief N-fill FEM sparsity (e.g. for ILUn preconditioner). */ + CCompressedSparsePatternUL finiteVolumeCSRFill0, /*!< \brief 0-fill FVM sparsity. */ + finiteVolumeCSRFillN, /*!< \brief N-fill FVM sparsity (e.g. for ILUn preconditioner). */ + finiteElementCSRFill0, /*!< \brief 0-fill FEM sparsity. */ + finiteElementCSRFillN; /*!< \brief N-fill FEM sparsity (e.g. for ILUn preconditioner). */ - CEdgeToNonZeroMapUL edgeToCSRMap; /*!< \brief Map edges to CSR entries referenced by them (i,j) and (j,i). */ + CEdgeToNonZeroMapUL edgeToCSRMap; /*!< \brief Map edges to CSR entries referenced by them (i,j) and (j,i). */ /*--- Edge and element colorings. ---*/ - CCompressedSparsePatternUL - edgeColoring, /*!< \brief Edge coloring structure for thread-based parallelization. */ - elemColoring; /*!< \brief Element coloring structure for thread-based parallelization. */ - unsigned long edgeColorGroupSize{1}; /*!< \brief Size of the edge groups within each color. */ - unsigned long elemColorGroupSize{1}; /*!< \brief Size of the element groups within each color. */ + CCompressedSparsePatternUL edgeColoring, /*!< \brief Edge coloring structure for thread-based parallelization. */ + elemColoring; /*!< \brief Element coloring structure for thread-based parallelization. */ + unsigned long edgeColorGroupSize{1}; /*!< \brief Size of the edge groups within each color. */ + unsigned long elemColorGroupSize{1}; /*!< \brief Size of the element groups within each color. */ - ColMajorMatrix CoarseGridColor_; /*!< \brief Coarse grid levels, colorized. */ + ColMajorMatrix CoarseGridColor_; /*!< \brief Coarse grid levels, colorized. */ public: /*!< \brief Linelets (mesh lines perpendicular to stretching direction). */ struct CLineletInfo { /*!< \brief Detect isotropic mesh region. */ static passivedouble ALPHA_ISOTROPIC() { return 0.8; } - enum : unsigned long {MAX_LINELET_POINTS = 32}; /*!< \brief Maximum points per linelet. */ + enum : unsigned long { MAX_LINELET_POINTS = 32 }; /*!< \brief Maximum points per linelet. */ std::vector> linelets; /*!< \brief Point indices for each linelet. */ @@ -200,90 +216,115 @@ class CGeometry { std::vector lineletIdx; /*!< \brief Signals that a point is not on a linelet. */ - enum : unsigned {NO_LINELET = std::numeric_limits::max()}; + enum : unsigned { NO_LINELET = std::numeric_limits::max() }; /*!< \brief Coloring for OpenMP parallelization, "linelets" is sorted by color. */ std::vector colorOffsets; - std::vector lineletColor; /*!< \brief Coloring transfered to points, for visualization. */ + std::vector lineletColor; /*!< \brief Coloring transfered to points, for visualization. */ }; + protected: mutable CLineletInfo lineletInfo; public: /*--- Main geometric elements of the grid. ---*/ - CPrimalGrid** elem{nullptr}; /*!< \brief Element vector (primal grid information). */ - CPrimalGrid*** bound{nullptr}; /*!< \brief Boundary vector (primal grid information). */ - CPoint* nodes{nullptr}; /*!< \brief Node vector (dual grid information). */ - CEdge* edges{nullptr}; /*!< \brief Edge vector (dual grid information). */ - CVertex*** vertex{nullptr}; /*!< \brief Boundary Vertex vector (dual grid information). */ - CTurboVertex**** turbovertex{nullptr}; /*!< \brief Boundary Vertex vector ordered for turbomachinery calculation(dual grid information). */ - unsigned long *nVertex{nullptr}; /*!< \brief Number of vertex for each marker. */ - unsigned long *nElem_Bound{nullptr}; /*!< \brief Number of elements of the boundary. */ - string *Tag_to_Marker{nullptr}; /*!< \brief Names of boundary markers. */ - vector bound_is_straight; /*!< \brief Bool if boundary-marker is straight(2D)/plane(3D) for each local marker. */ - vector SurfaceAreaCfgFile; /*!< \brief Total Surface area for all markers. */ + CPrimalGrid** elem{nullptr}; /*!< \brief Element vector (primal grid information). */ + CPrimalGrid*** bound{nullptr}; /*!< \brief Boundary vector (primal grid information). */ + CPoint* nodes{nullptr}; /*!< \brief Node vector (dual grid information). */ + CEdge* edges{nullptr}; /*!< \brief Edge vector (dual grid information). */ + CVertex*** vertex{nullptr}; /*!< \brief Boundary Vertex vector (dual grid information). */ + CTurboVertex**** turbovertex{ + nullptr}; /*!< \brief Boundary Vertex vector ordered for turbomachinery calculation(dual grid information). */ + unsigned long* nVertex{nullptr}; /*!< \brief Number of vertex for each marker. */ + unsigned long* nElem_Bound{nullptr}; /*!< \brief Number of elements of the boundary. */ + string* Tag_to_Marker{nullptr}; /*!< \brief Names of boundary markers. */ + vector + bound_is_straight; /*!< \brief Bool if boundary-marker is straight(2D)/plane(3D) for each local marker. */ + vector SurfaceAreaCfgFile; /*!< \brief Total Surface area for all markers. */ /*--- Partitioning-specific variables ---*/ - unordered_map Global_to_Local_Elem; /*!< \brief Mapping of global to local index for elements. */ - unsigned long *beg_node{nullptr}; /*!< \brief Array containing the first node on each rank due to a linear partitioning by global index. */ - unsigned long *end_node{nullptr}; /*!< \brief Array containing the last node on each rank due to a linear partitioning by global index. */ - unsigned long *nPointLinear{nullptr}; /*!< \brief Array containing the total number of nodes on each rank due to a linear partioning by global index. */ - unsigned long *nPointCumulative{nullptr}; /*!< \brief Cumulative storage array containing the total number of points on all prior ranks in the linear partitioning. */ + unordered_map + Global_to_Local_Elem; /*!< \brief Mapping of global to local index for elements. */ + unsigned long* beg_node{nullptr}; /*!< \brief Array containing the first node on each rank due to a linear + partitioning by global index. */ + unsigned long* end_node{ + nullptr}; /*!< \brief Array containing the last node on each rank due to a linear partitioning by global index. */ + unsigned long* nPointLinear{nullptr}; /*!< \brief Array containing the total number of nodes on each rank due to a + linear partioning by global index. */ + unsigned long* nPointCumulative{nullptr}; /*!< \brief Cumulative storage array containing the total number of points + on all prior ranks in the linear partitioning. */ /*--- Data structures for point-to-point MPI communications. ---*/ - int maxCountPerPoint{0}; /*!< \brief Maximum number of pieces of data sent per vertex in point-to-point comms. */ - int nP2PSend{0}; /*!< \brief Number of sends during point-to-point comms. */ - int nP2PRecv{0}; /*!< \brief Number of receives during point-to-point comms. */ - int *nPoint_P2PSend{nullptr}; /*!< \brief Data structure holding number of vertices for each send in point-to-point comms. */ - int *nPoint_P2PRecv{nullptr}; /*!< \brief Data structure holding number of vertices for each recv in point-to-point comms. */ - int *Neighbors_P2PSend{nullptr}; /*!< \brief Data structure holding the ranks of the neighbors for point-to-point send comms. */ - int *Neighbors_P2PRecv{nullptr}; /*!< \brief Data structure holding the ranks of the neighbors for point-to-point recv comms. */ - map P2PSend2Neighbor; /*!< \brief Data structure holding the reverse mapping of the ranks of the neighbors for point-to-point send comms. */ - map P2PRecv2Neighbor; /*!< \brief Data structure holding the reverse mapping of the ranks of the neighbors for point-to-point recv comms. */ - unsigned long - *Local_Point_P2PSend{nullptr}, /*!< \brief Data structure holding the local index of all vertices to be sent in point-to-point comms. */ - *Local_Point_P2PRecv{nullptr}; /*!< \brief Data structure holding the local index of all vertices to be received in point-to-point comms. */ - su2double *bufD_P2PRecv{nullptr}; /*!< \brief Data structure for su2double point-to-point receive. */ - su2double *bufD_P2PSend{nullptr}; /*!< \brief Data structure for su2double point-to-point send. */ - unsigned short *bufS_P2PRecv{nullptr}; /*!< \brief Data structure for unsigned long point-to-point receive. */ - unsigned short *bufS_P2PSend{nullptr}; /*!< \brief Data structure for unsigned long point-to-point send. */ - SU2_MPI::Request *req_P2PSend{nullptr}; /*!< \brief Data structure for point-to-point send requests. */ - SU2_MPI::Request *req_P2PRecv{nullptr}; /*!< \brief Data structure for point-to-point recv requests. */ + int maxCountPerPoint{0}; /*!< \brief Maximum number of pieces of data sent per vertex in point-to-point comms. */ + int nP2PSend{0}; /*!< \brief Number of sends during point-to-point comms. */ + int nP2PRecv{0}; /*!< \brief Number of receives during point-to-point comms. */ + int* nPoint_P2PSend{ + nullptr}; /*!< \brief Data structure holding number of vertices for each send in point-to-point comms. */ + int* nPoint_P2PRecv{ + nullptr}; /*!< \brief Data structure holding number of vertices for each recv in point-to-point comms. */ + int* Neighbors_P2PSend{ + nullptr}; /*!< \brief Data structure holding the ranks of the neighbors for point-to-point send comms. */ + int* Neighbors_P2PRecv{ + nullptr}; /*!< \brief Data structure holding the ranks of the neighbors for point-to-point recv comms. */ + map P2PSend2Neighbor; /*!< \brief Data structure holding the reverse mapping of the ranks of the neighbors + for point-to-point send comms. */ + map P2PRecv2Neighbor; /*!< \brief Data structure holding the reverse mapping of the ranks of the neighbors + for point-to-point recv comms. */ + unsigned long *Local_Point_P2PSend{nullptr}, /*!< \brief Data structure holding the local index of all vertices to be + sent in point-to-point comms. */ + *Local_Point_P2PRecv{nullptr}; /*!< \brief Data structure holding the local index of all vertices to be received + in point-to-point comms. */ + su2double* bufD_P2PRecv{nullptr}; /*!< \brief Data structure for su2double point-to-point receive. */ + su2double* bufD_P2PSend{nullptr}; /*!< \brief Data structure for su2double point-to-point send. */ + unsigned short* bufS_P2PRecv{nullptr}; /*!< \brief Data structure for unsigned long point-to-point receive. */ + unsigned short* bufS_P2PSend{nullptr}; /*!< \brief Data structure for unsigned long point-to-point send. */ + SU2_MPI::Request* req_P2PSend{nullptr}; /*!< \brief Data structure for point-to-point send requests. */ + SU2_MPI::Request* req_P2PRecv{nullptr}; /*!< \brief Data structure for point-to-point recv requests. */ /*--- Data structures for periodic communications. ---*/ - int maxCountPerPeriodicPoint{0}; /*!< \brief Maximum number of pieces of data sent per vertex in periodic comms. */ - int nPeriodicSend{0}; /*!< \brief Number of sends during periodic comms. */ - int nPeriodicRecv{0}; /*!< \brief Number of receives during periodic comms. */ - int *nPoint_PeriodicSend{nullptr}; /*!< \brief Data structure holding number of vertices for each send in periodic comms. */ - int *nPoint_PeriodicRecv{nullptr}; /*!< \brief Data structure holding number of vertices for each recv in periodic comms. */ - int *Neighbors_PeriodicSend{nullptr}; /*!< \brief Data structure holding the ranks of the neighbors for periodic send comms. */ - int *Neighbors_PeriodicRecv{nullptr}; /*!< \brief Data structure holding the ranks of the neighbors for periodic recv comms. */ - map PeriodicSend2Neighbor; /*!< \brief Data structure holding the reverse mapping of the ranks of the neighbors for periodic send comms. */ - map PeriodicRecv2Neighbor; /*!< \brief Data structure holding the reverse mapping of the ranks of the neighbors for periodic recv comms. */ - unsigned long - *Local_Point_PeriodicSend{nullptr}, /*!< \brief Data structure holding the local index of all vertices to be sent in periodic comms. */ - *Local_Point_PeriodicRecv{nullptr}, /*!< \brief Data structure holding the local index of all vertices to be received in periodic comms. */ - *Local_Marker_PeriodicSend{nullptr}, /*!< \brief Data structure holding the local index of the periodic marker for a particular vertex to be sent in periodic comms. */ - *Local_Marker_PeriodicRecv{nullptr}; /*!< \brief Data structure holding the local index of the periodic marker for a particular vertex to be received in periodic comms. */ - su2double *bufD_PeriodicRecv{nullptr}; /*!< \brief Data structure for su2double periodic receive. */ - su2double *bufD_PeriodicSend{nullptr}; /*!< \brief Data structure for su2double periodic send. */ - unsigned short *bufS_PeriodicRecv{nullptr}; /*!< \brief Data structure for unsigned long periodic receive. */ - unsigned short *bufS_PeriodicSend{nullptr}; /*!< \brief Data structure for unsigned long periodic send. */ - SU2_MPI::Request *req_PeriodicSend{nullptr}; /*!< \brief Data structure for periodic send requests. */ - SU2_MPI::Request *req_PeriodicRecv{nullptr}; /*!< \brief Data structure for periodic recv requests. */ + int maxCountPerPeriodicPoint{0}; /*!< \brief Maximum number of pieces of data sent per vertex in periodic comms. */ + int nPeriodicSend{0}; /*!< \brief Number of sends during periodic comms. */ + int nPeriodicRecv{0}; /*!< \brief Number of receives during periodic comms. */ + int* nPoint_PeriodicSend{ + nullptr}; /*!< \brief Data structure holding number of vertices for each send in periodic comms. */ + int* nPoint_PeriodicRecv{ + nullptr}; /*!< \brief Data structure holding number of vertices for each recv in periodic comms. */ + int* Neighbors_PeriodicSend{ + nullptr}; /*!< \brief Data structure holding the ranks of the neighbors for periodic send comms. */ + int* Neighbors_PeriodicRecv{ + nullptr}; /*!< \brief Data structure holding the ranks of the neighbors for periodic recv comms. */ + map PeriodicSend2Neighbor; /*!< \brief Data structure holding the reverse mapping of the ranks of the + neighbors for periodic send comms. */ + map PeriodicRecv2Neighbor; /*!< \brief Data structure holding the reverse mapping of the ranks of the + neighbors for periodic recv comms. */ + unsigned long *Local_Point_PeriodicSend{ + nullptr}, /*!< \brief Data structure holding the local index of all vertices to be sent in periodic comms. */ + *Local_Point_PeriodicRecv{nullptr}, /*!< \brief Data structure holding the local index of all vertices to be + received in periodic comms. */ + *Local_Marker_PeriodicSend{nullptr}, /*!< \brief Data structure holding the local index of the periodic marker for + a particular vertex to be sent in periodic comms. */ + *Local_Marker_PeriodicRecv{nullptr}; /*!< \brief Data structure holding the local index of the periodic marker for + a particular vertex to be received in periodic comms. */ + su2double* bufD_PeriodicRecv{nullptr}; /*!< \brief Data structure for su2double periodic receive. */ + su2double* bufD_PeriodicSend{nullptr}; /*!< \brief Data structure for su2double periodic send. */ + unsigned short* bufS_PeriodicRecv{nullptr}; /*!< \brief Data structure for unsigned long periodic receive. */ + unsigned short* bufS_PeriodicSend{nullptr}; /*!< \brief Data structure for unsigned long periodic send. */ + SU2_MPI::Request* req_PeriodicSend{nullptr}; /*!< \brief Data structure for periodic send requests. */ + SU2_MPI::Request* req_PeriodicRecv{nullptr}; /*!< \brief Data structure for periodic recv requests. */ /*--- Mesh quality metrics. ---*/ - vector Orthogonality; /*!< \brief Measure of dual CV orthogonality angle (0 to 90 deg., 90 being best). */ - vector Aspect_Ratio; /*!< \brief Measure of dual CV aspect ratio (max face area / min face area). */ - vector Volume_Ratio; /*!< \brief Measure of dual CV volume ratio (max sub-element volume / min sub-element volume). */ + vector Orthogonality; /*!< \brief Measure of dual CV orthogonality angle (0 to 90 deg., 90 being best). */ + vector Aspect_Ratio; /*!< \brief Measure of dual CV aspect ratio (max face area / min face area). */ + vector + Volume_Ratio; /*!< \brief Measure of dual CV volume ratio (max sub-element volume / min sub-element volume). */ - const ColMajorMatrix& CoarseGridColor = CoarseGridColor_; /*!< \brief Coarse grid levels, colorized. */ + const ColMajorMatrix& CoarseGridColor = CoarseGridColor_; /*!< \brief Coarse grid levels, colorized. */ /*! * \brief Constructor of the class. @@ -293,7 +334,7 @@ class CGeometry { /*! * \brief Constructor of the class. */ - CGeometry(CConfig *config, unsigned short nDim); + CGeometry(CConfig* config, unsigned short nDim); /*! * \brief Destructor of the class. @@ -307,11 +348,12 @@ class CGeometry { * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void PreprocessP2PComms(CGeometry *geometry, CConfig *config); + void PreprocessP2PComms(CGeometry* geometry, CConfig* config); /*! - * \brief Routine to allocate buffers for point-to-point MPI communications. Also called to dynamically reallocate if not enough memory is found for comms during runtime. - * \param[in] val_countPerPoint - Maximum count of the data type per vertex in point-to-point comms, e.g., nPrimvarGrad*nDim. + * \brief Routine to allocate buffers for point-to-point MPI communications. Also called to dynamically reallocate if + * not enough memory is found for comms during runtime. \param[in] val_countPerPoint - Maximum count of the data type + * per vertex in point-to-point comms, e.g., nPrimvarGrad*nDim. */ void AllocateP2PComms(unsigned short val_countPerPoint); @@ -324,8 +366,8 @@ class CGeometry { * \param[in] countPerPoint - Number of variables per point. * \param[in] val_reverse - Boolean controlling forward or reverse communication between neighbors. */ - void PostP2PRecvs(CGeometry *geometry, const CConfig *config, unsigned short commType, - unsigned short countPerPoint, bool val_reverse) const; + void PostP2PRecvs(CGeometry* geometry, const CConfig* config, unsigned short commType, unsigned short countPerPoint, + bool val_reverse) const; /*! * \brief Routine to launch a single non-blocking send once the buffer is loaded for a point-to-point commucation. @@ -337,19 +379,20 @@ class CGeometry { * \param[in] val_iMessage - Index of the message in the order they are stored. * \param[in] val_reverse - Boolean controlling forward or reverse communication between neighbors. */ - void PostP2PSends(CGeometry *geometry, const CConfig *config, unsigned short commType, - unsigned short countPerPoint, int val_iMessage, bool val_reverse) const; + void PostP2PSends(CGeometry* geometry, const CConfig* config, unsigned short commType, unsigned short countPerPoint, + int val_iMessage, bool val_reverse) const; /*! * \brief Routine to set up persistent data structures for periodic communications. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void PreprocessPeriodicComms(CGeometry *geometry, CConfig *config); + void PreprocessPeriodicComms(CGeometry* geometry, CConfig* config); /*! - * \brief Routine to allocate buffers for periodic communications. Also called to dynamically reallocate if not enough memory is found for comms during runtime. - * \param[in] val_countPerPeriodicPoint - Maximum count of the data type per vertex in periodic comms, e.g., nPrimvarGrad*nDim. + * \brief Routine to allocate buffers for periodic communications. Also called to dynamically reallocate if not enough + * memory is found for comms during runtime. \param[in] val_countPerPeriodicPoint - Maximum count of the data type per + * vertex in periodic comms, e.g., nPrimvarGrad*nDim. */ void AllocatePeriodicComms(unsigned short val_countPerPeriodicPoint); @@ -361,7 +404,7 @@ class CGeometry { * \param[in] commType - Enumerated type for the quantity to be communicated. * \param[in] countPerPeriodicPoint - Number of variables per point. */ - void PostPeriodicRecvs(CGeometry *geometry, const CConfig *config, unsigned short commType, + void PostPeriodicRecvs(CGeometry* geometry, const CConfig* config, unsigned short commType, unsigned short countPerPeriodicPoint); /*! @@ -373,7 +416,7 @@ class CGeometry { * \param[in] countPerPeriodicPoint - Number of variables per point. * \param[in] val_iMessage - Index of the message in the order they are stored. */ - void PostPeriodicSends(CGeometry *geometry, const CConfig *config, unsigned short commType, + void PostPeriodicSends(CGeometry* geometry, const CConfig* config, unsigned short commType, unsigned short countPerPeriodicPoint, int val_iMessage) const; /*! @@ -383,10 +426,8 @@ class CGeometry { * \param[out] COUNT_PER_POINT - Number of communicated variables per point. * \param[out] MPI_TYPE - Enumerated type for the datatype of the quantity to be communicated. */ - void GetCommCountAndType(const CConfig* config, - unsigned short commType, - unsigned short &COUNT_PER_POINT, - unsigned short &MPI_TYPE) const; + void GetCommCountAndType(const CConfig* config, unsigned short commType, unsigned short& COUNT_PER_POINT, + unsigned short& MPI_TYPE) const; /*! * \brief Routine to load a geometric quantity into the data structures for MPI point-to-point communication and to @@ -395,39 +436,38 @@ class CGeometry { * \param[in] config - Definition of the particular problem. * \param[in] commType - Enumerated type for the quantity to be communicated. */ - void InitiateComms(CGeometry *geometry, const CConfig *config, unsigned short commType) const; + void InitiateComms(CGeometry* geometry, const CConfig* config, unsigned short commType) const; /*! - * \brief Routine to complete the set of non-blocking communications launched by InitiateComms() and unpacking of the data into the geometry class. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] commType - Enumerated type for the quantity to be unpacked. + * \brief Routine to complete the set of non-blocking communications launched by InitiateComms() and unpacking of the + * data into the geometry class. \param[in] geometry - Geometrical definition of the problem. \param[in] config - + * Definition of the particular problem. \param[in] commType - Enumerated type for the quantity to be unpacked. */ - void CompleteComms(CGeometry *geometry, const CConfig *config, unsigned short commType); + void CompleteComms(CGeometry* geometry, const CConfig* config, unsigned short commType); /*! * \brief Get number of coordinates. * \return Number of coordinates. */ - inline unsigned short GetnDim() const {return nDim;} + inline unsigned short GetnDim() const { return nDim; } /*! * \brief Get number of zones. * \return Number of zones. */ - inline unsigned short GetnZone() const {return nZone;} + inline unsigned short GetnZone() const { return nZone; } /*! * \brief Get number of points. * \return Number of points. */ - inline unsigned long GetnPoint() const {return nPoint;} + inline unsigned long GetnPoint() const { return nPoint; } /*! * \brief Get number of real points (that belong to the domain). * \return Number of real points. */ - inline unsigned long GetnPointDomain() const {return nPointDomain;} + inline unsigned long GetnPointDomain() const { return nPointDomain; } /*! * \brief Retrieve total number of nodes in a simulation across all processors (including halos). @@ -445,26 +485,26 @@ class CGeometry { * \brief Get number of elements. * \return Number of elements. */ - inline unsigned long GetnElem() const {return nElem;} + inline unsigned long GetnElem() const { return nElem; } /*! * \brief Get number of edges. * \return Number of edges. */ - inline unsigned long GetnEdge() const {return nEdge;} + inline unsigned long GetnEdge() const { return nEdge; } /*! * \brief Get number of markers. * \return Number of markers. */ - inline unsigned short GetnMarker() const {return nMarker;} + inline unsigned short GetnMarker() const { return nMarker; } /*! * \brief Get number of vertices. * \param[in] val_marker - Marker of the boundary. * \return Number of vertices. */ - inline const su2double* GetSpanWiseValue(unsigned short val_marker) const { return SpanWiseValue[val_marker-1]; } + inline const su2double* GetSpanWiseValue(unsigned short val_marker) const { return SpanWiseValue[val_marker - 1]; } /*! * \brief Get number of vertices. @@ -478,21 +518,27 @@ class CGeometry { * \param[in] marker_flag - flag of the turbomachinery boundary. * \return Number of span wise section. */ - inline unsigned short GetnSpanWiseSections(unsigned short marker_flag) const { return nSpanWiseSections[marker_flag -1]; } + inline unsigned short GetnSpanWiseSections(unsigned short marker_flag) const { + return nSpanWiseSections[marker_flag - 1]; + } /*! * \brief Get number of vertices. * \param[in] val_marker - Marker of the boundary. * \return Number of vertices. */ - inline unsigned long GetnVertexSpan(unsigned short val_marker, unsigned short val_span) const { return nVertexSpan[val_marker][val_span]; } + inline unsigned long GetnVertexSpan(unsigned short val_marker, unsigned short val_span) const { + return nVertexSpan[val_marker][val_span]; + } /*! * \brief Get number of frequencies per span for NRBC. * \param[in] val_marker - Marker of the boundary. * \return Number of frequencies for NRBC. */ - inline unsigned long GetnFreqSpan(unsigned short val_marker, unsigned short val_span) const { return (nTotVertexSpan[val_marker][val_span]/2 -1); } + inline unsigned long GetnFreqSpan(unsigned short val_marker, unsigned short val_span) const { + return (nTotVertexSpan[val_marker][val_span] / 2 - 1); + } /*! * \brief Get number of vertices. @@ -506,14 +552,18 @@ class CGeometry { * \param[in] marker_flag - Marker of the boundary. * \return Number of frequencies. */ - inline unsigned long GetnFreqSpanMax(unsigned short marker_flag) const { return (nVertexSpanMax[marker_flag]/2 -1); } + inline unsigned long GetnFreqSpanMax(unsigned short marker_flag) const { + return (nVertexSpanMax[marker_flag] / 2 - 1); + } /*! * \brief Get number of vertices. * \param[in] val_marker - Marker of the boundary. * \return Number of vertices. */ - inline void SetnVertexSpanMax(unsigned short marker_flag, unsigned long nVertMax) {nVertexSpanMax[marker_flag] = nVertMax;} + inline void SetnVertexSpanMax(unsigned short marker_flag, unsigned long nVertMax) { + nVertexSpanMax[marker_flag] = nVertMax; + } /*! * \brief Get the edge index from using the nodes of the edge. @@ -545,16 +595,6 @@ class CGeometry { return FindEdge(first_point, second_point, false) >= 0; } - /*! - * \brief Get the distance between a plane (defined by three point) and a point. - * \param[in] Coord - Coordinates of the point. - * \param[in] iCoord - Coordinates of the first point that defines the plane. - * \param[in] jCoord - Coordinates of the second point that defines the plane. - * \param[in] kCoord - Coordinates of the third point that defines the plane. - * \return Signed distance. - */ - su2double Point2Plane_Distance(const su2double *Coord, const su2double *iCoord, const su2double *jCoord, const su2double *kCoord); - /*! * \brief Create a file for testing the geometry. */ @@ -584,7 +624,9 @@ class CGeometry { * \param[in] val_marker - Marker of the boundary. * \param[in] val_index - Index of the marker. */ - inline void SetMarker_Tag(unsigned short val_marker, string val_index) { Tag_to_Marker[val_marker] = std::move(val_index); } + inline void SetMarker_Tag(unsigned short val_marker, string val_index) { + Tag_to_Marker[val_marker] = std::move(val_index); + } /*! * \brief Set the number of boundary elements. @@ -592,7 +634,7 @@ class CGeometry { * \param[in] val_nelem_bound - Number of boundary elements. */ inline void SetnElem_Bound(unsigned short val_marker, unsigned long val_nelem_bound) { - nElem_Bound[val_marker]= val_nelem_bound; + nElem_Bound[val_marker] = val_nelem_bound; } /*! @@ -637,14 +679,16 @@ class CGeometry { * \param[in] face_first_elem - Index of the common face for the first element. * \param[in] face_second_elem - Index of the common face for the second element. */ - inline virtual bool FindFace(unsigned long first_elem, unsigned long second_elem, unsigned short &face_first_elem, - unsigned short &face_second_elem) {return false;} + inline virtual bool FindFace(unsigned long first_elem, unsigned long second_elem, unsigned short& face_first_elem, + unsigned short& face_second_elem) { + return false; + } /*! * \brief Sets area to be positive in Z direction. * \param[in] config - Definition of the particular problem. */ - inline virtual void SetPositive_ZArea(CConfig *config) {} + inline virtual void SetPositive_ZArea(CConfig* config) {} /*! * \brief Set connectivity between points. @@ -655,7 +699,7 @@ class CGeometry { * \brief Orders the RCM. * \param[in] config - Definition of the particular problem. */ - inline virtual void SetRCM_Ordering(CConfig *config) {} + inline virtual void SetRCM_Ordering(CConfig* config) {} /*! * \brief Connects elements . @@ -681,7 +725,7 @@ class CGeometry { * \brief Sets the vertices. * \param[in] config - Definition of the particular problem. */ - inline virtual void SetVertex(const CConfig *config) {} + inline virtual void SetVertex(const CConfig* config) {} /*! * \brief Computes the N span. @@ -690,7 +734,8 @@ class CGeometry { * \param[in] marker_flag - Marker being used * \param[in] allocate */ - inline virtual void ComputeNSpan(CConfig *config, unsigned short val_iZone, unsigned short marker_flag, bool allocate) {} + inline virtual void ComputeNSpan(CConfig* config, unsigned short val_iZone, unsigned short marker_flag, + bool allocate) {} /*! * \brief Set vertices for turbomachinery problems. @@ -699,7 +744,8 @@ class CGeometry { * \param[in] marker_flag - Marker being used * \param[in] allocate */ - inline virtual void SetTurboVertex(CConfig *config, unsigned short val_iZone, unsigned short marker_flag, bool allocate) {} + inline virtual void SetTurboVertex(CConfig* config, unsigned short val_iZone, unsigned short marker_flag, + bool allocate) {} /*! * \brief A virtual member. @@ -707,7 +753,7 @@ class CGeometry { * \param[in] val_iZone - Zone of the problem * \param[in] marker_flag - Marker being used */ - inline virtual void UpdateTurboVertex(CConfig *config, unsigned short val_iZone, unsigned short marker_flag) {} + inline virtual void UpdateTurboVertex(CConfig* config, unsigned short val_iZone, unsigned short marker_flag) {} /*! * \brief A virtual member. @@ -716,14 +762,15 @@ class CGeometry { * \param[in] marker_flag - Marker being used * \param[in] allocate */ - inline virtual void SetAvgTurboValue(CConfig *config, unsigned short val_iZone, unsigned short marker_flag, bool allocate) {} + inline virtual void SetAvgTurboValue(CConfig* config, unsigned short val_iZone, unsigned short marker_flag, + bool allocate) {} /*! * \brief A virtual member. * \param[in] config - Definition of the particular problem. * \param[in] allocate */ - inline virtual void GatherInOutAverageValues(CConfig *config, bool allocate) {} + inline virtual void GatherInOutAverageValues(CConfig* config, bool allocate) {} /*! * \brief Set max length. @@ -736,32 +783,32 @@ class CGeometry { * \param[in] config - Definition of the particular problem. * \param[in] action - Allocate or not the new elements. */ - inline virtual void SetControlVolume(CConfig *config, unsigned short action) {} + inline virtual void SetControlVolume(CConfig* config, unsigned short action) {} /*! * \brief A virtual member. * \param[in] config - Definition of the particular problem. */ - inline virtual void VisualizeControlVolume(const CConfig *config) const {} + inline virtual void VisualizeControlVolume(const CConfig* config) const {} /*! * \brief A virtual member. * \param[in] config - Definition of the particular problem. */ - inline virtual void MatchActuator_Disk(const CConfig *config) {} + inline virtual void MatchActuator_Disk(const CConfig* config) {} /*! * \brief A virtual member. * \param[in] config - Definition of the particular problem. */ - inline virtual void MatchPeriodic(const CConfig *config, unsigned short val_periodic) {} + inline virtual void MatchPeriodic(const CConfig* config, unsigned short val_periodic) {} /*! * \brief A virtual member. * \param[in] config - Definition of the particular problem. * \param[in] action - Allocate or not the new elements. */ - inline virtual void SetBoundControlVolume(const CConfig *config, unsigned short action) {} + inline virtual void SetBoundControlVolume(const CConfig* config, unsigned short action) {} /*! * \brief A virtual member. @@ -775,43 +822,43 @@ class CGeometry { * \param[in] new_file - Boolean to decide if aopen a new file or add to a old one * \param[in] config - Definition of the particular problem. */ - inline virtual void SetBoundTecPlot(char mesh_filename[MAX_STRING_SIZE], bool new_file, CConfig *config) {} + inline virtual void SetBoundTecPlot(char mesh_filename[MAX_STRING_SIZE], bool new_file, CConfig* config) {} /*! * \brief A virtual member. * \param[in] config - Definition of the particular problem. */ - inline virtual void Check_IntElem_Orientation(const CConfig *config) {} + inline virtual void Check_IntElem_Orientation(const CConfig* config) {} /*! * \brief A virtual member. * \param[in] config - Definition of the particular problem. */ - inline virtual void Check_BoundElem_Orientation(const CConfig *config) {} + inline virtual void Check_BoundElem_Orientation(const CConfig* config) {} /*! * \brief A virtual member. * \param[in] config - Definition of the particular problem. */ - inline virtual void SetColorGrid(CConfig *config) {} + inline virtual void SetColorGrid(CConfig* config) {} /*! * \brief A virtual member. * \param[in] config - Definition of the particular problem. */ - inline virtual void SetColorGrid_Parallel(const CConfig *config) {} + inline virtual void SetColorGrid_Parallel(const CConfig* config) {} /*! * \brief A virtual member. * \param[in] config - Definition of the particular problem. */ - inline virtual void SetColorFEMGrid_Parallel(CConfig *config) {} + inline virtual void SetColorFEMGrid_Parallel(CConfig* config) {} /*! * \brief A virtual member. * \param[in] config - Definition of the particular problem. */ - inline virtual void DivideConnectivity(CConfig *config, unsigned short Elem_Type) {} + inline virtual void DivideConnectivity(CConfig* config, unsigned short Elem_Type) {} /*! * \brief A virtual member. @@ -819,7 +866,7 @@ class CGeometry { * \param[in] config - Definition of the particular problem. * \param[in] val_domain - Number of domains for parallelization purposes. */ - inline virtual void SetSendReceive(const CConfig *config) {} + inline virtual void SetSendReceive(const CConfig* config) {} /*! * \brief A virtual member. @@ -827,27 +874,27 @@ class CGeometry { * \param[in] config - Definition of the particular problem. * \param[in] val_domain - Number of domains for parallelization purposes. */ - inline virtual void SetBoundaries(CConfig *config) {} + inline virtual void SetBoundaries(CConfig* config) {} /*! * \brief A virtual member. * \param[in] fine_grid - Geometrical definition of the problem. */ - inline virtual void SetCoord(const CGeometry *fine_grid) {} + inline virtual void SetCoord(const CGeometry* fine_grid) {} /*! * \brief A virtual member. * \param[in] fine_grid - Geometrical definition of the problem. * \param[in] val_marker - Index of the boundary marker. */ - inline virtual void SetMultiGridWallHeatFlux(const CGeometry *fine_grid, unsigned short val_marker) {} + inline virtual void SetMultiGridWallHeatFlux(const CGeometry* fine_grid, unsigned short val_marker) {} /*! * \brief A virtual member. * \param[in] fine_grid - Geometrical definition of the problem. * \param[in] val_marker - Index of the boundary marker. */ - inline virtual void SetMultiGridWallTemperature(const CGeometry *fine_grid, unsigned short val_marker) {} + inline virtual void SetMultiGridWallTemperature(const CGeometry* fine_grid, unsigned short val_marker) {} /*! * \brief A virtual member. @@ -855,99 +902,99 @@ class CGeometry { * \param[in] val_smooth_coeff - Relaxation factor. * \param[in] config - Definition of the particular problem. */ - inline virtual void SetCoord_Smoothing(unsigned short val_nSmooth, su2double val_smooth_coeff, CConfig *config) {} + inline virtual void SetCoord_Smoothing(unsigned short val_nSmooth, su2double val_smooth_coeff, CConfig* config) {} /*! * \brief A virtual member. * \param[in] fine_grid - Geometrical definition of the child grid (for multigrid). */ - inline virtual void SetPoint_Connectivity(const CGeometry *fine_grid) {} + inline virtual void SetPoint_Connectivity(const CGeometry* fine_grid) {} /*! * \brief A virtual member. * \param[in] fine_grid - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - inline virtual void SetVertex(const CGeometry *fine_grid, const CConfig *config) {} + inline virtual void SetVertex(const CGeometry* fine_grid, const CConfig* config) {} /*! * \brief A virtual member. * \param[in] fine_grid - Geometrical definition of the problem. * \param[in] action - Allocate or not the new elements. */ - inline virtual void SetControlVolume(const CGeometry *fine_grid, unsigned short action) {} + inline virtual void SetControlVolume(const CGeometry* fine_grid, unsigned short action) {} /*! * \brief A virtual member. * \param[in] fine_grid - Geometrical definition of the problem. * \param[in] action - Allocate or not the new elements. */ - inline virtual void SetBoundControlVolume(const CGeometry *fine_grid, unsigned short action) {} + inline virtual void SetBoundControlVolume(const CGeometry* fine_grid, unsigned short action) {} /*! * \brief A virtual member. * \param[in] config - Definition of the particular problem. */ - inline virtual void SetBoundSensitivity(CConfig *config) {} + inline virtual void SetBoundSensitivity(CConfig* config) {} /*! * \brief Set the data containers for customized boundary conditions. * \param[in] config - Definition of the particular problem. */ - void SetCustomBoundary(CConfig *config); + void SetCustomBoundary(CConfig* config); /*! * \brief Set cartesian grid velocity based on rotational speed and axis. * \param[in] config - Definition of the particular problem. * \param[in] print - Display information on screen. */ - void SetRotationalVelocity(const CConfig *config, bool print = false); + void SetRotationalVelocity(const CConfig* config, bool print = false); /*! * \brief Set the rotational velocity of the points on the shroud markers to 0. * \param[in] config - Definition of the particular problem. */ - void SetShroudVelocity(const CConfig *config); + void SetShroudVelocity(const CConfig* config); /*! * \brief Set the translational velocity at each node. * \param[in] config - Definition of the particular problem. * \param[in] print - Display information on screen. */ - void SetTranslationalVelocity(const CConfig *config, bool print = false); + void SetTranslationalVelocity(const CConfig* config, bool print = false); /*! * \brief Set the translational/rotational velocity for all moving walls. * \param[in] config - Definition of the particular problem. * \param[in] print - Display information on screen. */ - void SetWallVelocity(const CConfig *config, bool print = false); + void SetWallVelocity(const CConfig* config, bool print = false); /*! * \brief Set the grid velocity via finite differencing at each node. * \param[in] config - Definition of the particular problem. */ - void SetGridVelocity(const CConfig *config); + void SetGridVelocity(const CConfig* config); /*! * \brief A virtual member. * \param[in] fine_grid - Geometry of the fine mesh. */ - inline virtual void SetRestricted_GridVelocity(const CGeometry *fine_grid) {} + inline virtual void SetRestricted_GridVelocity(const CGeometry* fine_grid) {} /*! * \brief Compute the surface area of all global markers. * \param[in] config - Definition of the particular problem. */ - void ComputeSurfaceAreaCfgFile(const CConfig *config); + void ComputeSurfaceAreaCfgFile(const CConfig* config); /*! - * \brief Get global Surface Area to a local marker. - * \param[in] config - Definition of the particular problem. - * \param[in] val_marker - Local surface marker. - * \return Global Surface Area to the local marker - */ - su2double GetSurfaceArea(const CConfig *config, unsigned short val_marker) const; + * \brief Get global Surface Area to a local marker. + * \param[in] config - Definition of the particular problem. + * \param[in] val_marker - Local surface marker. + * \return Global Surface Area to the local marker + */ + su2double GetSurfaceArea(const CConfig* config, unsigned short val_marker) const; /*! * \brief Check if a boundary is straight(2D) / plane(3D) for EULER_WALL and SYMMETRY_PLANE @@ -956,147 +1003,172 @@ class CGeometry { * \param[in] config - Definition of the particular problem. * \param[in] print_on_screen - Boolean whether to print result on screen. */ - void ComputeSurf_Straightness(CConfig *config, bool print_on_screen); + void ComputeSurf_Straightness(CConfig* config, bool print_on_screen); /*! * \brief Find and store all vertices on a sharp corner in the geometry. * \param[in] config - Definition of the particular problem. */ - void ComputeSurf_Curvature(CConfig *config); + void ComputeSurf_Curvature(CConfig* config); /*! * \brief A virtual member. * \param[in] config - Definition of the particular problem. */ - void ComputeAirfoil_Section(su2double *Plane_P0, su2double *Plane_Normal, - su2double MinXCoord, su2double MaxXCoord, - su2double MinYCoord, su2double MaxYCoord, - su2double MinZCoord, su2double MaxZCoord, - const su2double *FlowVariable, - vector &Xcoord_Airfoil, vector &Ycoord_Airfoil, - vector &Zcoord_Airfoil, vector &Variable_Airfoil, - bool original_surface, CConfig *config); + void ComputeAirfoil_Section(su2double* Plane_P0, su2double* Plane_Normal, su2double MinXCoord, su2double MaxXCoord, + su2double MinYCoord, su2double MaxYCoord, su2double MinZCoord, su2double MaxZCoord, + const su2double* FlowVariable, vector& Xcoord_Airfoil, + vector& Ycoord_Airfoil, vector& Zcoord_Airfoil, + vector& Variable_Airfoil, bool original_surface, CConfig* config); /*! * \brief A virtual member. */ - virtual su2double Compute_MaxThickness(su2double *Plane_P0, su2double *Plane_Normal, CConfig *config, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) {return 0.0;} + virtual su2double Compute_MaxThickness(su2double* Plane_P0, su2double* Plane_Normal, CConfig* config, + vector& Xcoord_Airfoil, vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil) { + return 0.0; + } /*! * \brief A virtual member. */ - virtual su2double Compute_Twist(su2double *Plane_P0, su2double *Plane_Normal, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) {return 0.0;} + virtual su2double Compute_Twist(su2double* Plane_P0, su2double* Plane_Normal, vector& Xcoord_Airfoil, + vector& Ycoord_Airfoil, vector& Zcoord_Airfoil) { + return 0.0; + } /*! * \brief A virtual member. */ - virtual su2double Compute_Chord(su2double *Plane_P0, su2double *Plane_Normal, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) {return 0.0;} + virtual su2double Compute_Chord(su2double* Plane_P0, su2double* Plane_Normal, vector& Xcoord_Airfoil, + vector& Ycoord_Airfoil, vector& Zcoord_Airfoil) { + return 0.0; + } /*! * \brief A virtual member. */ - virtual su2double Compute_Width(su2double *Plane_P0, su2double *Plane_Normal, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) {return 0.0;} + virtual su2double Compute_Width(su2double* Plane_P0, su2double* Plane_Normal, vector& Xcoord_Airfoil, + vector& Ycoord_Airfoil, vector& Zcoord_Airfoil) { + return 0.0; + } /*! * \brief A virtual member. */ - virtual su2double Compute_WaterLineWidth(su2double *Plane_P0, su2double *Plane_Normal, CConfig *config, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) {return 0.0;} + virtual su2double Compute_WaterLineWidth(su2double* Plane_P0, su2double* Plane_Normal, CConfig* config, + vector& Xcoord_Airfoil, vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil) { + return 0.0; + } /*! * \brief A virtual member. */ - virtual su2double Compute_Height(su2double *Plane_P0, su2double *Plane_Normal, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) {return 0.0;} + virtual su2double Compute_Height(su2double* Plane_P0, su2double* Plane_Normal, vector& Xcoord_Airfoil, + vector& Ycoord_Airfoil, vector& Zcoord_Airfoil) { + return 0.0; + } /*! * \brief A virtual member. */ - virtual su2double Compute_LERadius(su2double *Plane_P0, su2double *Plane_Normal, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) {return 0.0;} + virtual su2double Compute_LERadius(su2double* Plane_P0, su2double* Plane_Normal, vector& Xcoord_Airfoil, + vector& Ycoord_Airfoil, vector& Zcoord_Airfoil) { + return 0.0; + } /*! * \brief A virtual member. */ - virtual su2double Compute_Thickness(su2double *Plane_P0, su2double *Plane_Normal, su2double Location, CConfig *config, - vector &Xcoord_Airfoil, vector &Ycoord_Airfoil, - vector &Zcoord_Airfoil, su2double &ZLoc) {return 0.0;} + virtual su2double Compute_Thickness(su2double* Plane_P0, su2double* Plane_Normal, su2double Location, CConfig* config, + vector& Xcoord_Airfoil, vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil, su2double& ZLoc) { + return 0.0; + } /*! * \brief A virtual member. */ - virtual su2double Compute_Area(su2double *Plane_P0, su2double *Plane_Normal, CConfig *config, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) {return 0.0;} + virtual su2double Compute_Area(su2double* Plane_P0, su2double* Plane_Normal, CConfig* config, + vector& Xcoord_Airfoil, vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil) { + return 0.0; + } /*! * \brief A virtual member. */ - virtual su2double Compute_Length(su2double *Plane_P0, su2double *Plane_Normal, CConfig *config, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) {return 0.0;} + virtual su2double Compute_Length(su2double* Plane_P0, su2double* Plane_Normal, CConfig* config, + vector& Xcoord_Airfoil, vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil) { + return 0.0; + } /*! * \brief A virtual member. */ - virtual void Compute_Wing_LeadingTrailing(su2double *LeadingEdge, su2double *TrailingEdge, su2double *Plane_P0, su2double *Plane_Normal, vector - &Xcoord_Airfoil, vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) {} + virtual void Compute_Wing_LeadingTrailing(su2double* LeadingEdge, su2double* TrailingEdge, su2double* Plane_P0, + su2double* Plane_Normal, vector& Xcoord_Airfoil, + vector& Ycoord_Airfoil, vector& Zcoord_Airfoil) {} /*! * \brief A virtual member. */ - virtual void Compute_Fuselage_LeadingTrailing(su2double *LeadingEdge, su2double *TrailingEdge, su2double *Plane_P0, su2double *Plane_Normal, vector - &Xcoord_Airfoil, vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) {} + virtual void Compute_Fuselage_LeadingTrailing(su2double* LeadingEdge, su2double* TrailingEdge, su2double* Plane_P0, + su2double* Plane_Normal, vector& Xcoord_Airfoil, + vector& Ycoord_Airfoil, vector& Zcoord_Airfoil) {} /*! * \brief A virtual member. */ - virtual su2double Compute_Dihedral(su2double *LeadingEdge_im1, su2double *TrailingEdge_im1, - su2double *LeadingEdge_i, su2double *TrailingEdge_i) {return 0.0;} + virtual su2double Compute_Dihedral(su2double* LeadingEdge_im1, su2double* TrailingEdge_im1, su2double* LeadingEdge_i, + su2double* TrailingEdge_i) { + return 0.0; + } /*! * \brief A virtual member. */ - virtual su2double Compute_Curvature(su2double *LeadingEdge_im1, su2double *TrailingEdge_im1, - su2double *LeadingEdge_i, su2double *TrailingEdge_i, - su2double *LeadingEdge_ip1, su2double *TrailingEdge_ip1) {return 0.0;} + virtual su2double Compute_Curvature(su2double* LeadingEdge_im1, su2double* TrailingEdge_im1, su2double* LeadingEdge_i, + su2double* TrailingEdge_i, su2double* LeadingEdge_ip1, + su2double* TrailingEdge_ip1) { + return 0.0; + } /*! * \brief A virtual member. */ - virtual void Compute_Wing(CConfig *config, bool original_surface, - su2double &Wing_Volume, su2double &Wing_MinMaxThickness, su2double &Wing_MaxMaxThickness, su2double &Wing_MinChord, su2double &Wing_MaxChord, - su2double &Wing_MinLERadius, su2double &Wing_MaxLERadius, - su2double &Wing_MinToC, su2double &Wing_MaxToC, su2double &Wing_ObjFun_MinToC, su2double &Wing_MaxTwist, su2double &Wing_MaxCurvature, - su2double &Wing_MaxDihedral) {} + virtual void Compute_Wing(CConfig* config, bool original_surface, su2double& Wing_Volume, + su2double& Wing_MinMaxThickness, su2double& Wing_MaxMaxThickness, su2double& Wing_MinChord, + su2double& Wing_MaxChord, su2double& Wing_MinLERadius, su2double& Wing_MaxLERadius, + su2double& Wing_MinToC, su2double& Wing_MaxToC, su2double& Wing_ObjFun_MinToC, + su2double& Wing_MaxTwist, su2double& Wing_MaxCurvature, su2double& Wing_MaxDihedral) {} /*! * \brief A virtual member. */ - virtual void Compute_Fuselage(CConfig *config, bool original_surface, - su2double &Fuselage_Volume, su2double &Fuselage_WettedArea, - su2double &Fuselage_MinWidth, su2double &Fuselage_MaxWidth, - su2double &Fuselage_MinWaterLineWidth, su2double &Fuselage_MaxWaterLineWidth, - su2double &Fuselage_MinHeight, su2double &Fuselage_MaxHeight, - su2double &Fuselage_MaxCurvature) {} + virtual void Compute_Fuselage(CConfig* config, bool original_surface, su2double& Fuselage_Volume, + su2double& Fuselage_WettedArea, su2double& Fuselage_MinWidth, + su2double& Fuselage_MaxWidth, su2double& Fuselage_MinWaterLineWidth, + su2double& Fuselage_MaxWaterLineWidth, su2double& Fuselage_MinHeight, + su2double& Fuselage_MaxHeight, su2double& Fuselage_MaxCurvature) {} /*! * \brief A virtual member. */ - virtual void Compute_Nacelle(CConfig *config, bool original_surface, - su2double &Nacelle_Volume, su2double &Nacelle_MinMaxThickness, su2double &Nacelle_MaxMaxThickness, - su2double &Nacelle_MinChord, su2double &Nacelle_MaxChord, - su2double &Nacelle_MinLERadius, su2double &Nacelle_MaxLERadius, - su2double &Nacelle_MinToC, su2double &Nacelle_MaxToC, - su2double &Nacelle_ObjFun_MinToC, su2double &Nacelle_MaxTwist) {} + virtual void Compute_Nacelle(CConfig* config, bool original_surface, su2double& Nacelle_Volume, + su2double& Nacelle_MinMaxThickness, su2double& Nacelle_MaxMaxThickness, + su2double& Nacelle_MinChord, su2double& Nacelle_MaxChord, su2double& Nacelle_MinLERadius, + su2double& Nacelle_MaxLERadius, su2double& Nacelle_MinToC, su2double& Nacelle_MaxToC, + su2double& Nacelle_ObjFun_MinToC, su2double& Nacelle_MaxTwist) {} /*! * \brief A virtual member. * \param[in] config - Definition of the particular problem. */ - inline virtual void FindNormal_Neighbor(const CConfig *config) {} + inline virtual void FindNormal_Neighbor(const CConfig* config) {} /*! * \brief A virtual member. @@ -1209,22 +1281,22 @@ class CGeometry { /*! * \brief Get x coords of geometrical planes in the mesh */ - inline vector > GetXCoord() const {return Xcoord_plane;} + inline vector> GetXCoord() const { return Xcoord_plane; } /*! * \brief Get y coords of geometrical planes in the mesh */ - inline vector > GetYCoord() const {return Ycoord_plane;} + inline vector> GetYCoord() const { return Ycoord_plane; } /*! * \brief Get z coords of geometrical planes in the mesh */ - inline vector > GetZCoord() const {return Zcoord_plane;} + inline vector> GetZCoord() const { return Zcoord_plane; } /*! * \brief Get all points on a geometrical plane in the mesh */ - inline vector > GetPlanarPoints() const {return Plane_points;} + inline vector> GetPlanarPoints() const { return Plane_points; } /*! * \brief Compute the intersection between a segment and a plane. @@ -1235,26 +1307,27 @@ class CGeometry { * \param[in] Intersection - Definition of the particular problem. * \return If the intersection has has been successful. */ - bool SegmentIntersectsPlane(const su2double *Segment_P0, const su2double *Segment_P1, su2double Variable_P0, su2double Variable_P1, - const su2double *Plane_P0, const su2double *Plane_Normal, su2double *Intersection, su2double &Variable_Interp); + bool SegmentIntersectsPlane(const su2double* Segment_P0, const su2double* Segment_P1, su2double Variable_P0, + su2double Variable_P1, const su2double* Plane_P0, const su2double* Plane_Normal, + su2double* Intersection, su2double& Variable_Interp); /*! * \brief Ray Intersects Triangle (Moller and Trumbore algorithm) */ - bool RayIntersectsTriangle(const su2double orig[3], const su2double dir[3], - const su2double vert0[3], const su2double vert1[3], const su2double vert2[3], - su2double *intersect); + bool RayIntersectsTriangle(const su2double orig[3], const su2double dir[3], const su2double vert0[3], + const su2double vert1[3], const su2double vert2[3], su2double* intersect); /*! * \brief Segment Intersects Triangle */ - bool SegmentIntersectsTriangle(su2double point0[3], const su2double point1[3], - su2double vert0[3], su2double vert1[3], su2double vert2[3]); + bool SegmentIntersectsTriangle(su2double point0[3], const su2double point1[3], su2double vert0[3], su2double vert1[3], + su2double vert2[3]); /*! * \brief Segment Intersects Line (for 2D FFD Intersection) */ - bool SegmentIntersectsLine(const su2double point0[2], const su2double point1[2], const su2double vert0[2], const su2double vert1[2]); + bool SegmentIntersectsLine(const su2double point0[2], const su2double point1[2], const su2double vert0[2], + const su2double vert1[2]); /*! * \brief Register the coordinates of the mesh nodes. @@ -1266,33 +1339,33 @@ class CGeometry { * \param geometry_container - Geometrical definition. * \param config - Config */ - static void UpdateGeometry(CGeometry **geometry_container, CConfig *config); + static void UpdateGeometry(CGeometry** geometry_container, CConfig* config); /*! * \brief Update the multi-grid structure for the customized boundary conditions * \param geometry_container - Geometrical definition. * \param config - Definition of the particular problem. */ - void UpdateCustomBoundaryConditions(CGeometry **geometry_container, CConfig *config); + void UpdateCustomBoundaryConditions(CGeometry** geometry_container, CConfig* config); /*! * \brief A virtual member. * \param config - Config */ - inline virtual void SetSensitivity(CConfig *config) {} + inline virtual void SetSensitivity(CConfig* config) {} /*! * \brief A virtual member. * \param config - Config */ - inline virtual void ReadUnorderedSensitivity(CConfig *config) {} + inline virtual void ReadUnorderedSensitivity(CConfig* config) {} /*! * \brief A virtual member. * \param iPoint - Point * \param iDim - Dimension */ - inline virtual su2double GetSensitivity(unsigned long iPoint, unsigned short iDim) const {return 0.0;} + inline virtual su2double GetSensitivity(unsigned long iPoint, unsigned short iDim) const { return 0.0; } /*! * \brief A virtual member. @@ -1515,7 +1588,7 @@ class CGeometry { * \brief A virtual member. * \param config - Config */ - inline virtual void Check_Periodicity(CConfig *config) {} + inline virtual void Check_Periodicity(CConfig* config) {} /*! * \brief Get the value of the customized temperature at a specified vertex on a specified marker. @@ -1532,7 +1605,8 @@ class CGeometry { * \param[in] val_vertex - Boundary vertex value * \param[in] val_customBoundaryTemperature - Value of the temperature. */ - inline void SetCustomBoundaryTemperature(unsigned short val_marker, unsigned long val_vertex, su2double val_customBoundaryTemperature) { + inline void SetCustomBoundaryTemperature(unsigned short val_marker, unsigned long val_vertex, + su2double val_customBoundaryTemperature) { CustomBoundaryTemperature[val_marker][val_vertex] = val_customBoundaryTemperature; } @@ -1551,7 +1625,8 @@ class CGeometry { * \param[in] val_vertex - Boundary vertex value * \param[in] val_customBoundaryHeatFlux - Value of the normal heat flux. */ - inline void SetCustomBoundaryHeatFlux(unsigned short val_marker, unsigned long val_vertex, su2double val_customBoundaryHeatFlux) { + inline void SetCustomBoundaryHeatFlux(unsigned short val_marker, unsigned long val_vertex, + su2double val_customBoundaryHeatFlux) { CustomBoundaryHeatFlux[val_marker][val_vertex] = val_customBoundaryHeatFlux; } @@ -1559,12 +1634,12 @@ class CGeometry { * \brief Filter values given at the element CG by performing a weighted average over a radial neighbourhood. * \param[in] filter_radius - Parameter defining the size of the neighbourhood. * \param[in] kernels - Kernel types and respective parameter, size of vector defines number of filter recursions. - * \param[in] search_limit - Max degree of neighborhood considered for neighbor search, avoids excessive work in fine regions. - * \param[in,out] values - On entry, the "raw" values, on exit, the filtered values. + * \param[in] search_limit - Max degree of neighborhood considered for neighbor search, avoids excessive work in fine + * regions. \param[in,out] values - On entry, the "raw" values, on exit, the filtered values. */ - void FilterValuesAtElementCG(const vector &filter_radius, - const vector > &kernels, - const unsigned short search_limit, su2double *values) const; + void FilterValuesAtElementCG(const vector& filter_radius, + const vector>& kernels, + const unsigned short search_limit, su2double* values) const; /*! * \brief Build the global (entire mesh!) adjacency matrix for the elements in compressed format. @@ -1573,23 +1648,21 @@ class CGeometry { * neighbours of global element "i". Size nElemDomain+1 * \param[out] neighbour_idx - Global index of the neighbours, mush be NULL on entry and free'd by calling function. */ - void GetGlobalElementAdjacencyMatrix(vector &neighbour_start, long *&neighbour_idx) const; + void GetGlobalElementAdjacencyMatrix(vector& neighbour_start, long*& neighbour_idx) const; /*! - * \brief Get the neighbours of the global element in the first position of "neighbours" that are within "radius" of it. - * \param[in] iElem_global - Element of interest. - * \param[in] radius - Parameter defining the size of the neighbourhood. - * \param[in] search_limit - Maximum "logical radius" to consider, limits cost in refined regions, use 0 for unlimited. - * \param[in] neighbour_start - See GetGlobalElementAdjacencyMatrix. - * \param[in] neighbour_idx - See GetGlobalElementAdjacencyMatrix. - * \param[in] cg_elem - Global element centroid coordinates in row major format {x0,y0,x1,y1,...}. Size nDim*nElemDomain. - * \param[in,out] neighbours - The neighbours of iElem_global. - * \param[in,out] is_neighbor - Working vector of size nElemGlobal, MUST be all false on entry (if so, on exit it will be the same). - * \return true if the search was successful, i.e. not limited. + * \brief Get the neighbours of the global element in the first position of "neighbours" that are within "radius" of + * it. \param[in] iElem_global - Element of interest. \param[in] radius - Parameter defining the size of the + * neighbourhood. \param[in] search_limit - Maximum "logical radius" to consider, limits cost in refined regions, use + * 0 for unlimited. \param[in] neighbour_start - See GetGlobalElementAdjacencyMatrix. \param[in] neighbour_idx - See + * GetGlobalElementAdjacencyMatrix. \param[in] cg_elem - Global element centroid coordinates in row major format + * {x0,y0,x1,y1,...}. Size nDim*nElemDomain. \param[in,out] neighbours - The neighbours of iElem_global. + * \param[in,out] is_neighbor - Working vector of size nElemGlobal, MUST be all false on entry (if so, on exit it will + * be the same). \return true if the search was successful, i.e. not limited. */ bool GetRadialNeighbourhood(const unsigned long iElem_global, const passivedouble radius, size_t search_limit, - const vector &neighbour_start, const long *neighbour_idx, - const su2double *cg_elem, vector &neighbours, vector &is_neighbor) const; + const vector& neighbour_start, const long* neighbour_idx, + const su2double* cg_elem, vector& neighbours, vector& is_neighbor) const; /*! * \brief Compute and store the volume of the primal elements. @@ -1612,7 +1685,7 @@ class CGeometry { * \brief A virtual member. * \param config - Config */ - inline virtual void ComputeMeshQualityStatistics(const CConfig *config) {} + inline virtual void ComputeMeshQualityStatistics(const CConfig* config) {} /*! * \brief Color multigrid levels for visualization. @@ -1692,7 +1765,7 @@ class CGeometry { * \param[in] config - Definition of the particular problem. * \return pointer to the ADT */ - virtual std::unique_ptr ComputeViscousWallADT(const CConfig *config) const { return nullptr; } + virtual std::unique_ptr ComputeViscousWallADT(const CConfig* config) const { return nullptr; } /*! * \brief Reduce the wall distance based on an previously constructed ADT. @@ -1702,7 +1775,8 @@ class CGeometry { * \param[in] config - Config of this geometry (not the ADT zone's geometry) * \param[in] iZone - Zone whose markers made the ADT */ - virtual void SetWallDistance(CADTElemClass* WallADT, const CConfig* config, unsigned short iZone = numeric_limits::max()) {} + virtual void SetWallDistance(CADTElemClass* WallADT, const CConfig* config, + unsigned short iZone = numeric_limits::max()) {} /*! * \brief Set wall distances a specific value @@ -1715,25 +1789,25 @@ class CGeometry { * \param[in] config_container - Definition of the particular problem. * \param[in] geometry_container - Geometrical definition of the problem. */ - static void ComputeWallDistance(const CConfig * const *config_container, CGeometry ****geometry_container); + static void ComputeWallDistance(const CConfig* const* config_container, CGeometry**** geometry_container); /*! * \brief Set the amount of nonconvex elements in the mesh. * \param[in] nonconvex_elems - amount of nonconvex elements in the mesh */ - void SetnNonconvexElements(unsigned long nonconvex_elems) {nNonconvexElements = nonconvex_elems;} + void SetnNonconvexElements(unsigned long nonconvex_elems) { nNonconvexElements = nonconvex_elems; } /*! * \brief Get the amount of nonconvex elements in the mesh. * \param[out] nNonconvexElements- amount of nonconvex elements in the mesh */ - unsigned long GetnNonconvexElements() const {return nNonconvexElements;} + unsigned long GetnNonconvexElements() const { return nNonconvexElements; } /*! * \brief For streamwise periodicity, find & store a unique reference node on the designated periodic inlet. * \param[in] config - Definition of the particular problem. */ - inline virtual void FindUniqueNode_PeriodicBound(const CConfig *config) {} + inline virtual void FindUniqueNode_PeriodicBound(const CConfig* config) {} /*! * \brief Get a pointer to the reference node coordinate vector. @@ -1741,4 +1815,3 @@ class CGeometry { */ inline virtual const su2double* GetStreamwise_Periodic_RefNode() const { return nullptr; } }; - diff --git a/Common/include/geometry/CMultiGridGeometry.hpp b/Common/include/geometry/CMultiGridGeometry.hpp index ab65300c5ca..8136859bf64 100644 --- a/Common/include/geometry/CMultiGridGeometry.hpp +++ b/Common/include/geometry/CMultiGridGeometry.hpp @@ -2,7 +2,7 @@ * \file CMultiGridGeometry.hpp * \brief Headers of the multigrid geometry class. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -36,7 +36,7 @@ * \author F. Palacios */ class CMultiGridGeometry final : public CGeometry { -private: + private: /*! * \brief Determine if a CVPoint van be agglomerated, if it have the same marker point as the seed. * \param[in] CVPoint - Control volume to be agglomerated. @@ -45,8 +45,8 @@ class CMultiGridGeometry final : public CGeometry { * \param[in] config - Definition of the particular problem. * \return TRUE or FALSE depending if the control volume can be agglomerated. */ - bool SetBoundAgglomeration(unsigned long CVPoint, short marker_seed, const CGeometry *fine_grid, - const CConfig *config) const; + bool SetBoundAgglomeration(unsigned long CVPoint, short marker_seed, const CGeometry* fine_grid, + const CConfig* config) const; /*! * \brief Determine if a can be agglomerated using geometrical criteria. @@ -54,7 +54,7 @@ class CMultiGridGeometry final : public CGeometry { * \param[in] fine_grid - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - bool GeometricalCheck(unsigned long iPoint, const CGeometry *fine_grid, const CConfig *config) const; + bool GeometricalCheck(unsigned long iPoint, const CGeometry* fine_grid, const CConfig* config) const; /*! * \brief Determine if a CVPoint van be agglomerated, if it have the same marker point as the seed. @@ -64,7 +64,7 @@ class CMultiGridGeometry final : public CGeometry { * \param[in] fine_grid - Geometrical definition of the problem. */ void SetSuitableNeighbors(vector& Suitable_Indirect_Neighbors, unsigned long iPoint, - unsigned long Index_CoarseCV, const CGeometry *fine_grid) const; + unsigned long Index_CoarseCV, const CGeometry* fine_grid) const; /*! * \brief Set a representative wall value of the agglomerated control volumes on a particular boundary marker. @@ -73,8 +73,7 @@ class CMultiGridGeometry final : public CGeometry { * \param[in] wall_quantity - Object with methods Get(iVertex_fine) and Set(iVertex_coarse, val). */ template - void SetMultiGridWallQuantity(const CGeometry *fine_grid, unsigned short val_marker, T& wall_quantity) { - + void SetMultiGridWallQuantity(const CGeometry* fine_grid, unsigned short val_marker, T& wall_quantity) { for (auto iVertex = 0ul; iVertex < nVertex[val_marker]; iVertex++) { const auto Point_Coarse = vertex[val_marker][iVertex]->GetNode(); @@ -85,8 +84,8 @@ class CMultiGridGeometry final : public CGeometry { /*--- Compute area parent by taking into account only volumes that are on the marker. ---*/ for (auto iChildren = 0u; iChildren < nodes->GetnChildren_CV(Point_Coarse); iChildren++) { const auto Point_Fine = nodes->GetChildren_CV(Point_Coarse, iChildren); - const auto isVertex = fine_grid->nodes->GetDomain(Point_Fine) && - (fine_grid->nodes->GetVertex(Point_Fine, val_marker) != -1); + const auto isVertex = + fine_grid->nodes->GetDomain(Point_Fine) && (fine_grid->nodes->GetVertex(Point_Fine, val_marker) != -1); if (isVertex) { Area_Parent += fine_grid->nodes->GetVolume(Point_Fine); } @@ -97,8 +96,8 @@ class CMultiGridGeometry final : public CGeometry { /*--- Loop again to average coarser value. ---*/ for (auto iChildren = 0u; iChildren < nodes->GetnChildren_CV(Point_Coarse); iChildren++) { const auto Point_Fine = nodes->GetChildren_CV(Point_Coarse, iChildren); - const auto isVertex = fine_grid->nodes->GetDomain(Point_Fine) && - (fine_grid->nodes->GetVertex(Point_Fine, val_marker) != -1); + const auto isVertex = + fine_grid->nodes->GetDomain(Point_Fine) && (fine_grid->nodes->GetVertex(Point_Fine, val_marker) != -1); if (isVertex) { const auto Vertex_Fine = fine_grid->nodes->GetVertex(Point_Fine, val_marker); const auto Area_Children = fine_grid->nodes->GetVolume(Point_Fine); @@ -109,15 +108,14 @@ class CMultiGridGeometry final : public CGeometry { /*--- Set the value at the coarse level. ---*/ wall_quantity.Set(iVertex, Quantity_Coarse); } - } -public: + public: /*--- This is to suppress Woverloaded-virtual, omitting it has no negative impact. ---*/ - using CGeometry::SetVertex; - using CGeometry::SetControlVolume; using CGeometry::SetBoundControlVolume; + using CGeometry::SetControlVolume; using CGeometry::SetPoint_Connectivity; + using CGeometry::SetVertex; /*! * \brief Constructor of the class. @@ -125,79 +123,78 @@ class CMultiGridGeometry final : public CGeometry { * \param[in] config - Definition of the particular problem. * \param[in] iMesh - Level of the multigrid. */ - CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, unsigned short iMesh); + CMultiGridGeometry(CGeometry* fine_grid, CConfig* config, unsigned short iMesh); /*! * \brief Set boundary vertex. * \param[in] fine_grid - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void SetVertex(const CGeometry *fine_grid, const CConfig *config) override; + void SetVertex(const CGeometry* fine_grid, const CConfig* config) override; /*! * \brief Set points which surround a point. * \param[in] fine_grid - Geometrical definition of the child grid. */ - void SetPoint_Connectivity(const CGeometry *fine_grid) override; + void SetPoint_Connectivity(const CGeometry* fine_grid) override; /*! * \brief Set the edge structure of the agglomerated control volume. * \param[in] fine_grid - Geometrical definition of the problem. * \param[in] action - Allocate or not the new elements. */ - void SetControlVolume(const CGeometry *fine_grid, unsigned short action) override; + void SetControlVolume(const CGeometry* fine_grid, unsigned short action) override; /*! * \brief Set boundary vertex structure of the agglomerated control volume. * \param[in] fine_grid - Geometrical definition of the problem. * \param[in] action - Allocate or not the new elements. */ - void SetBoundControlVolume(const CGeometry *fine_grid, unsigned short action) override; + void SetBoundControlVolume(const CGeometry* fine_grid, unsigned short action) override; /*! * \brief Set a representative coordinates of the agglomerated control volume. * \param[in] fine_grid - Geometrical definition of the problem. */ - void SetCoord(const CGeometry *fine_grid) override; + void SetCoord(const CGeometry* fine_grid) override; /*! * \brief Set the grid velocity at each node in the coarse mesh level based * on a restriction from a finer mesh. * \param[in] fine_grid - Geometry container for the finer mesh level. */ - void SetRestricted_GridVelocity(const CGeometry *fine_grid) override; + void SetRestricted_GridVelocity(const CGeometry* fine_grid) override; /*! * \brief Find and store the closest neighbor to a vertex. * \param[in] config - Definition of the particular problem. */ - void FindNormal_Neighbor(const CConfig *config) override; + void FindNormal_Neighbor(const CConfig* config) override; /*! * \brief Mach the near field boundary condition. * \param[in] config - Definition of the particular problem. */ - void MatchActuator_Disk(const CConfig *config) override; + void MatchActuator_Disk(const CConfig* config) override; /*! * \brief Mach the periodic boundary conditions. * \param[in] config - Definition of the particular problem. * \param[in] val_periodic - Index of the first periodic face in a pair. */ - void MatchPeriodic(const CConfig *config, unsigned short val_periodic) override; + void MatchPeriodic(const CConfig* config, unsigned short val_periodic) override; /*! - * \brief Set a representative wall normal heat flux of the agglomerated control volume on a particular boundary marker. - * \param[in] fine_grid - Geometrical definition of the problem. - * \param[in] val_marker - Index of the boundary marker. + * \brief Set a representative wall normal heat flux of the agglomerated control volume on a particular boundary + * marker. \param[in] fine_grid - Geometrical definition of the problem. \param[in] val_marker - Index of the boundary + * marker. */ - void SetMultiGridWallHeatFlux(const CGeometry *fine_grid, unsigned short val_marker) override; + void SetMultiGridWallHeatFlux(const CGeometry* fine_grid, unsigned short val_marker) override; /*! * \brief Set a representative wall temperature of the agglomerated control volume on a particular boundary marker. * \param[in] fine_grid - Geometrical definition of the problem. * \param[in] val_marker - Index of the boundary marker. */ - void SetMultiGridWallTemperature(const CGeometry *fine_grid, unsigned short val_marker) override; - + void SetMultiGridWallTemperature(const CGeometry* fine_grid, unsigned short val_marker) override; }; diff --git a/Common/include/geometry/CMultiGridQueue.hpp b/Common/include/geometry/CMultiGridQueue.hpp index 5865c36b687..11995b3492d 100644 --- a/Common/include/geometry/CMultiGridQueue.hpp +++ b/Common/include/geometry/CMultiGridQueue.hpp @@ -3,7 +3,7 @@ * \brief Header of the multigrid queue class for the FVM solver. * The subroutines and functions are in the CMultiGridQueue.cpp file. * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -40,19 +40,21 @@ using namespace std; * \author F. Palacios */ class CMultiGridQueue { -private: + private: using QueueType = CFastFindAndEraseQueue<>; - vector QueueCV; /*!< \brief Queue structure to choose the next control volume in the agglomeration process. */ - vector Priority; /*!< \brief The priority is based on the number of pre-agglomerated neighbors. */ - vector RightCV; /*!< \brief In the lowest priority there are some CV that can not be agglomerated, this is the way to identify them. */ - const unsigned long nPoint = 0; /*!< \brief Total number of points. */ + vector + QueueCV; /*!< \brief Queue structure to choose the next control volume in the agglomeration process. */ + vector Priority; /*!< \brief The priority is based on the number of pre-agglomerated neighbors. */ + vector RightCV; /*!< \brief In the lowest priority there are some CV that can not be agglomerated, this is the + way to identify them. */ + const unsigned long nPoint = 0; /*!< \brief Total number of points. */ /*! * \brief Throw error with error message that the point is not in the priority list. */ void ThrowPointNotInListError(unsigned long iPoint) const; -public: + public: /*! * \brief Constructor of the class. * \param[in] npoint - Number of control volumes. @@ -111,8 +113,10 @@ class CMultiGridQueue { * \return Index of the new control volume. */ inline long NextCV(void) const { - if (!QueueCV.empty()) return QueueCV.back().front(); - else return -1; + if (!QueueCV.empty()) + return QueueCV.back().front(); + else + return -1; } /*! @@ -133,6 +137,5 @@ class CMultiGridQueue { * \param[in] updatePoint - Index of the new point. * \param[in] fineGrid - Fine grid geometry. */ - void Update(unsigned long updatePoint, CGeometry *fineGrid); - + void Update(unsigned long updatePoint, CGeometry* fineGrid); }; diff --git a/Common/include/geometry/CPhysicalGeometry.hpp b/Common/include/geometry/CPhysicalGeometry.hpp index b69bc67da78..8e10bc2e685 100644 --- a/Common/include/geometry/CPhysicalGeometry.hpp +++ b/Common/include/geometry/CPhysicalGeometry.hpp @@ -2,7 +2,7 @@ * \file CPhysicalGeometry.hpp * \brief Headers of the physical geometry class used to read meshes from file. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -31,87 +31,71 @@ #include "meshreader/CMeshReaderFVM.hpp" #include "../containers/C2DContainer.hpp" - /*! * \class CPhysicalGeometry * \brief Class for reading a defining the primal grid which is read from the grid file in .su2 or .cgns format. * \author F. Palacios, T. Economon, J. Alonso */ class CPhysicalGeometry final : public CGeometry { - unordered_map - Global_to_Local_Point; /*!< \brief Global-local indexation for the points. */ - long *Local_to_Global_Point{nullptr}; /*!< \brief Local-global indexation for the points. */ - unsigned long *adj_counter{nullptr}; /*!< \brief Adjacency counter. */ - unsigned long **adjacent_elem{nullptr}; /*!< \brief Adjacency element list. */ - su2activematrix Sensitivity; /*!< \brief Matrix holding the sensitivities at each point. */ + Global_to_Local_Point; /*!< \brief Global-local indexation for the points. */ + long* Local_to_Global_Point{nullptr}; /*!< \brief Local-global indexation for the points. */ + unsigned long* adj_counter{nullptr}; /*!< \brief Adjacency counter. */ + unsigned long** adjacent_elem{nullptr}; /*!< \brief Adjacency element list. */ + su2activematrix Sensitivity; /*!< \brief Matrix holding the sensitivities at each point. */ vector > Neighbors; unordered_map Color_List; vector Marker_Tags; - unsigned long nLocal_Point{0}, - nLocal_PointDomain{0}, - nLocal_PointGhost{0}, - nLocal_PointPeriodic{0}, - nLocal_Elem{0}, - nLocal_Bound_Elem{0}, - nGlobal_Elem{0}, - nGlobal_Bound_Elem{0}, - nLocal_Line{0}, - nLocal_BoundTria{0}, - nLocal_BoundQuad{0}, - nLinear_Line{0}, - nLinear_BoundTria{0}, - nLinear_BoundQuad{0}, - nLocal_Tria{0}, - nLocal_Quad{0}, - nLocal_Tetr{0}, - nLocal_Hexa{0}, - nLocal_Pris{0}, - nLocal_Pyra{0}; + unsigned long nLocal_Point{0}, nLocal_PointDomain{0}, nLocal_PointGhost{0}, nLocal_PointPeriodic{0}, nLocal_Elem{0}, + nLocal_Bound_Elem{0}, nGlobal_Elem{0}, nGlobal_Bound_Elem{0}, nLocal_Line{0}, nLocal_BoundTria{0}, + nLocal_BoundQuad{0}, nLinear_Line{0}, nLinear_BoundTria{0}, nLinear_BoundQuad{0}, nLocal_Tria{0}, nLocal_Quad{0}, + nLocal_Tetr{0}, nLocal_Hexa{0}, nLocal_Pris{0}, nLocal_Pyra{0}; unsigned long nMarker_Global{0}; - su2double *Local_Coords{nullptr}; - unsigned long *Local_Points{nullptr}; - unsigned long *Local_Colors{nullptr}; - unsigned long *Conn_Line{nullptr}; - unsigned long *Conn_BoundTria{nullptr}; - unsigned long *Conn_BoundQuad{nullptr}; - unsigned long *Conn_Line_Linear{nullptr}; - unsigned long *Conn_BoundTria_Linear{nullptr}; - unsigned long *Conn_BoundQuad_Linear{nullptr}; - unsigned long *Conn_Tria{nullptr}; - unsigned long *Conn_Quad{nullptr}; - unsigned long *Conn_Tetr{nullptr}; - unsigned long *Conn_Hexa{nullptr}; - unsigned long *Conn_Pris{nullptr}; - unsigned long *Conn_Pyra{nullptr}; - unsigned long *ID_Line{nullptr}; - unsigned long *ID_BoundTria{nullptr}; - unsigned long *ID_BoundQuad{nullptr}; - unsigned long *ID_Line_Linear{nullptr}; - unsigned long *ID_BoundTria_Linear{nullptr}; - unsigned long *ID_BoundQuad_Linear{nullptr}; - unsigned long *ID_Tria{nullptr}; - unsigned long *ID_Quad{nullptr}; - unsigned long *ID_Tetr{nullptr}; - unsigned long *ID_Hexa{nullptr}; - unsigned long *ID_Pris{nullptr}; - unsigned long *ID_Pyra{nullptr}; - unsigned long *Elem_ID_Line{nullptr}; - unsigned long *Elem_ID_BoundTria{nullptr}; - unsigned long *Elem_ID_BoundQuad{nullptr}; - unsigned long *Elem_ID_Line_Linear{nullptr}; - unsigned long *Elem_ID_BoundTria_Linear{nullptr}; - unsigned long *Elem_ID_BoundQuad_Linear{nullptr}; - - su2double Streamwise_Periodic_RefNode[MAXNDIM] = {0}; /*!< \brief Coordinates of the reference node [m] on the receiving periodic marker, for recovered pressure/temperature computation only.*/ - -public: + su2double* Local_Coords{nullptr}; + unsigned long* Local_Points{nullptr}; + unsigned long* Local_Colors{nullptr}; + unsigned long* Conn_Line{nullptr}; + unsigned long* Conn_BoundTria{nullptr}; + unsigned long* Conn_BoundQuad{nullptr}; + unsigned long* Conn_Line_Linear{nullptr}; + unsigned long* Conn_BoundTria_Linear{nullptr}; + unsigned long* Conn_BoundQuad_Linear{nullptr}; + unsigned long* Conn_Tria{nullptr}; + unsigned long* Conn_Quad{nullptr}; + unsigned long* Conn_Tetr{nullptr}; + unsigned long* Conn_Hexa{nullptr}; + unsigned long* Conn_Pris{nullptr}; + unsigned long* Conn_Pyra{nullptr}; + unsigned long* ID_Line{nullptr}; + unsigned long* ID_BoundTria{nullptr}; + unsigned long* ID_BoundQuad{nullptr}; + unsigned long* ID_Line_Linear{nullptr}; + unsigned long* ID_BoundTria_Linear{nullptr}; + unsigned long* ID_BoundQuad_Linear{nullptr}; + unsigned long* ID_Tria{nullptr}; + unsigned long* ID_Quad{nullptr}; + unsigned long* ID_Tetr{nullptr}; + unsigned long* ID_Hexa{nullptr}; + unsigned long* ID_Pris{nullptr}; + unsigned long* ID_Pyra{nullptr}; + unsigned long* Elem_ID_Line{nullptr}; + unsigned long* Elem_ID_BoundTria{nullptr}; + unsigned long* Elem_ID_BoundQuad{nullptr}; + unsigned long* Elem_ID_Line_Linear{nullptr}; + unsigned long* Elem_ID_BoundTria_Linear{nullptr}; + unsigned long* Elem_ID_BoundQuad_Linear{nullptr}; + + su2double Streamwise_Periodic_RefNode[MAXNDIM] = { + 0}; /*!< \brief Coordinates of the reference node [m] on the receiving periodic marker, for recovered + pressure/temperature computation only.*/ + + public: /*--- This is to suppress Woverloaded-virtual, omitting it has no negative impact. ---*/ - using CGeometry::SetVertex; - using CGeometry::SetControlVolume; using CGeometry::SetBoundControlVolume; + using CGeometry::SetControlVolume; using CGeometry::SetPoint_Connectivity; + using CGeometry::SetVertex; /*! * \brief Constructor of the class. @@ -128,27 +112,27 @@ class CPhysicalGeometry final : public CGeometry { * \param[in] val_iZone - Domain to be read from the grid file. * \param[in] val_nZone - Total number of domains in the grid file. */ - CPhysicalGeometry(CConfig *config, unsigned short val_iZone, unsigned short val_nZone); + CPhysicalGeometry(CConfig* config, unsigned short val_iZone, unsigned short val_nZone); /*! * \overload * \brief Accepts a geometry container holding a linearly partitioned grid * with coloring performed by ParMETIS, and this routine distributes * the points and cells to all partitions based on the coloring. - * \param[in] geometry - Definition of the geometry container holding the initial linear partitions of the grid + coloring. - * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Definition of the geometry container holding the initial linear partitions of the grid + + * coloring. \param[in] config - Definition of the particular problem. */ - CPhysicalGeometry(CGeometry *geometry, CConfig *config); + CPhysicalGeometry(CGeometry* geometry, CConfig* config); /*! * \overload * \brief Accepts a geometry container holding a linearly partitioned grid * with coloring performed by ParMETIS, and this routine distributes * the points and cells to all partitions based on the coloring. - * \param[in] geometry - Definition of the geometry container holding the initial linear partitions of the grid + coloring. - * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Definition of the geometry container holding the initial linear partitions of the grid + + * coloring. \param[in] config - Definition of the particular problem. */ - CPhysicalGeometry(CGeometry *geometry, CConfig *config, bool val_flag); + CPhysicalGeometry(CGeometry* geometry, CConfig* config, bool val_flag); /*! * \brief Destructor of the class. @@ -156,18 +140,18 @@ class CPhysicalGeometry final : public CGeometry { ~CPhysicalGeometry(void) override; /*! - * \brief Distributes the coloring from ParMETIS so that each rank has complete information about the local grid points. - * \param[in] geometry - Definition of the geometry container holding the initial linear partitions of the grid + coloring. - * \param[in] config - Definition of the particular problem. + * \brief Distributes the coloring from ParMETIS so that each rank has complete information about the local grid + * points. \param[in] geometry - Definition of the geometry container holding the initial linear partitions of the + * grid + coloring. \param[in] config - Definition of the particular problem. */ - void DistributeColoring(const CConfig *config, CGeometry *geometry); + void DistributeColoring(const CConfig* config, CGeometry* geometry); /*! * \brief Distribute the grid points, including ghost points, across all ranks based on a ParMETIS coloring. * \param[in] config - Definition of the particular problem. * \param[in] geometry - Geometrical definition of the problem. */ - void DistributePoints(const CConfig *config, CGeometry *geometry); + void DistributePoints(const CConfig* config, CGeometry* geometry); /*! * \brief Distribute the connectivity for a single volume element type across all ranks based on a ParMETIS coloring. @@ -175,22 +159,21 @@ class CPhysicalGeometry final : public CGeometry { * \param[in] geometry - Geometrical definition of the problem. * \param[in] Elem_Type - VTK index of the element type being distributed. */ - void DistributeVolumeConnectivity(const CConfig *config, CGeometry *geometry, unsigned short Elem_Type); + void DistributeVolumeConnectivity(const CConfig* config, CGeometry* geometry, unsigned short Elem_Type); /*! - * \brief Distribute the connectivity for a single surface element type in all markers across all ranks based on a ParMETIS coloring. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] Elem_Type - VTK index of the element type being distributed. + * \brief Distribute the connectivity for a single surface element type in all markers across all ranks based on a + * ParMETIS coloring. \param[in] config - Definition of the particular problem. \param[in] geometry - Geometrical + * definition of the problem. \param[in] Elem_Type - VTK index of the element type being distributed. */ - void DistributeSurfaceConnectivity(CConfig *config, CGeometry *geometry, unsigned short Elem_Type); + void DistributeSurfaceConnectivity(CConfig* config, CGeometry* geometry, unsigned short Elem_Type); /*! * \brief Broadcast the marker tags for all boundaries from the master rank to all other ranks. * \param[in] config - Definition of the particular problem. * \param[in] geometry - Geometrical definition of the problem. */ - void DistributeMarkerTags(CConfig *config, CGeometry *geometry); + void DistributeMarkerTags(CConfig* config, CGeometry* geometry); /*! * \brief Partition the marker connectivity held on the master rank according to a linear partitioning. @@ -198,46 +181,40 @@ class CPhysicalGeometry final : public CGeometry { * \param[in] geometry - Geometrical definition of the problem. * \param[in] Elem_Type - VTK index of the element type being distributed. */ - void PartitionSurfaceConnectivity(CConfig *config, CGeometry *geometry, unsigned short Elem_Type); + void PartitionSurfaceConnectivity(CConfig* config, CGeometry* geometry, unsigned short Elem_Type); /*! * \brief Load the local grid points after partitioning (owned and ghost) into the geometry class objects. * \param[in] config - Definition of the particular problem. * \param[in] geometry - Geometrical definition of the problem. */ - void LoadPoints(CConfig *config, CGeometry *geometry); + void LoadPoints(CConfig* config, CGeometry* geometry); /*! * \brief Load the local volume elements after partitioning (owned and ghost) into the geometry class objects. * \param[in] config - Definition of the particular problem. * \param[in] geometry - Geometrical definition of the problem. */ - void LoadVolumeElements(CConfig *config, CGeometry *geometry); + void LoadVolumeElements(CConfig* config, CGeometry* geometry); /*! * \brief Load the local surface elements after partitioning (owned and ghost) into the geometry class objects. * \param[in] config - Definition of the particular problem. * \param[in] geometry - Geometrical definition of the problem. */ - void LoadSurfaceElements(CConfig *config, CGeometry *geometry); + void LoadSurfaceElements(CConfig* config, CGeometry* geometry); /*! * \brief Routine to launch non-blocking sends and recvs amongst all processors. * \param[in] bufSend - Buffer of data to be sent. - * \param[in] nElemSend - Array containing the number of elements to send to other processors in cumulative storage format. - * \param[in] sendReq - Array of MPI send requests. - * \param[in] bufRecv - Buffer of data to be received. - * \param[in] nElemSend - Array containing the number of elements to receive from other processors in cumulative storage format. - * \param[in] sendReq - Array of MPI recv requests. - * \param[in] countPerElem - Pieces of data per element communicated. - */ - void InitiateCommsAll(void *bufSend, - const int *nElemSend, - SU2_MPI::Request *sendReq, - void *bufRecv, - const int *nElemRecv, - SU2_MPI::Request *recvReq, - unsigned short countPerElem, + * \param[in] nElemSend - Array containing the number of elements to send to other processors in cumulative storage + * format. \param[in] sendReq - Array of MPI send requests. \param[in] bufRecv - Buffer of data to be received. + * \param[in] nElemSend - Array containing the number of elements to receive from other processors in cumulative + * storage format. \param[in] sendReq - Array of MPI recv requests. \param[in] countPerElem - Pieces of data per + * element communicated. + */ + void InitiateCommsAll(void* bufSend, const int* nElemSend, SU2_MPI::Request* sendReq, void* bufRecv, + const int* nElemRecv, SU2_MPI::Request* recvReq, unsigned short countPerElem, unsigned short commType); /*! @@ -247,10 +224,7 @@ class CPhysicalGeometry final : public CGeometry { * \param[in] nRecvs - Number of receives to be completed. * \param[in] sendReq - Array of MPI recv requests. */ - void CompleteCommsAll(int nSends, - SU2_MPI::Request *sendReq, - int nRecvs, - SU2_MPI::Request *recvReq); + void CompleteCommsAll(int nSends, SU2_MPI::Request* sendReq, int nRecvs, SU2_MPI::Request* recvReq); /*! * \brief Routine to compute the initial linear partitioning offset counts and store in persistent data structures. @@ -269,19 +243,19 @@ class CPhysicalGeometry final : public CGeometry { * \brief Routine to sort the adjacency for ParMETIS for graph partitioning in parallel. * \param[in] config - Definition of the particular problem. */ - void SortAdjacency(const CConfig *config); + void SortAdjacency(const CConfig* config); /*! * \brief Set the send receive boundaries of the grid. * \param[in] config - Definition of the particular problem. */ - void SetSendReceive(const CConfig *config) override; + void SetSendReceive(const CConfig* config) override; /*! * \brief Set the send receive boundaries of the grid. * \param[in] config - Definition of the particular problem. */ - void SetBoundaries(CConfig *config) override; + void SetBoundaries(CConfig* config) override; /*! * \brief Set the local index that correspond with the global numbering index. @@ -295,8 +269,7 @@ class CPhysicalGeometry final : public CGeometry { */ inline long GetGlobal_to_Local_Point(unsigned long val_ipoint) const override { auto it = Global_to_Local_Point.find(val_ipoint); - if (it != Global_to_Local_Point.cend()) - return it->second; + if (it != Global_to_Local_Point.cend()) return it->second; return -1; } @@ -309,7 +282,8 @@ class CPhysicalGeometry final : public CGeometry { * \param[in] val_iZone - Domain to be read from the grid file. * \param[in] val_nZone - Total number of domains in the grid file. */ - void Read_Mesh_FVM(CConfig *config, string val_mesh_filename, unsigned short val_iZone, unsigned short val_nZone); + void Read_Mesh_FVM(CConfig* config, const string& val_mesh_filename, unsigned short val_iZone, + unsigned short val_nZone); /*! * \brief Reads for the FEM solver the geometry of the grid and adjust the boundary @@ -319,7 +293,8 @@ class CPhysicalGeometry final : public CGeometry { * \param[in] val_iZone - Domain to be read from the grid file. * \param[in] val_nZone - Total number of domains in the grid file. */ - void Read_SU2_Format_Parallel_FEM(CConfig *config, string val_mesh_filename, unsigned short val_iZone, unsigned short val_nZone); + void Read_SU2_Format_Parallel_FEM(CConfig* config, const string& val_mesh_filename, unsigned short val_iZone, + unsigned short val_nZone); /*! * \brief Reads for the FEM solver the geometry of the grid and adjust the boundary @@ -329,34 +304,35 @@ class CPhysicalGeometry final : public CGeometry { * \param[in] val_iZone - Domain to be read from the grid file. * \param[in] val_nZone - Total number of domains in the grid file. */ - void Read_CGNS_Format_Parallel_FEM(CConfig *config, string val_mesh_filename, unsigned short val_iZone, unsigned short val_nZone); + void Read_CGNS_Format_Parallel_FEM(CConfig* config, const string& val_mesh_filename, unsigned short val_iZone, + unsigned short val_nZone); /*! * \brief Routine to load the CGNS grid points from a single zone into the proper SU2 data structures. * \param[in] config - definition of the particular problem. * \param[in] mesh - mesh reader object containing the current zone data. */ - void LoadLinearlyPartitionedPoints(CConfig *config, CMeshReaderFVM *mesh); + void LoadLinearlyPartitionedPoints(CConfig* config, CMeshReaderFVM* mesh); /*! * \brief Loads the interior volume elements from the mesh reader object into the primal element data structures. * \param[in] config - definition of the particular problem. * \param[in] mesh - mesh reader object containing the current zone data. */ - void LoadLinearlyPartitionedVolumeElements(CConfig *config, CMeshReaderFVM *mesh); + void LoadLinearlyPartitionedVolumeElements(CConfig* config, CMeshReaderFVM* mesh); /*! * \brief Loads the boundary elements (markers) from the mesh reader object into the primal element data structures. * \param[in] config - definition of the particular problem. * \param[in] mesh - mesh reader object containing the current zone data. */ - void LoadUnpartitionedSurfaceElements(CConfig *config, CMeshReaderFVM *mesh); + void LoadUnpartitionedSurfaceElements(CConfig* config, CMeshReaderFVM* mesh); /*! - * \brief Prepares the grid point adjacency based on a linearly partitioned mesh object needed by ParMETIS for graph partitioning in parallel. - * \param[in] config - Definition of the particular problem. + * \brief Prepares the grid point adjacency based on a linearly partitioned mesh object needed by ParMETIS for graph + * partitioning in parallel. \param[in] config - Definition of the particular problem. */ - void PrepareAdjacency(const CConfig *config); + void PrepareAdjacency(const CConfig* config); /*! * \brief Find repeated nodes between two elements to identify the common face. @@ -366,14 +342,14 @@ class CPhysicalGeometry final : public CGeometry { * \param[in] face_second_elem - Index of the common face for the second element. * \return It provides 0 or 1 depending if there is a common face or not. */ - bool FindFace(unsigned long first_elem, unsigned long second_elem, unsigned short &face_first_elem, - unsigned short &face_second_elem) override; + bool FindFace(unsigned long first_elem, unsigned long second_elem, unsigned short& face_first_elem, + unsigned short& face_second_elem) override; /*! * \brief Compute surface area (positive z-direction) for force coefficient non-dimensionalization. * \param[in] config - Definition of the particular problem. */ - void SetPositive_ZArea(CConfig *config) override; + void SetPositive_ZArea(CConfig* config) override; /*! * \brief Set points which surround a point. @@ -384,7 +360,7 @@ class CPhysicalGeometry final : public CGeometry { * \brief Set a renumbering using a Reverse Cuthill-McKee Algorithm * \param[in] config - Definition of the particular problem. */ - void SetRCM_Ordering(CConfig *config) override; + void SetRCM_Ordering(CConfig* config) override; /*! * \brief Set elements which surround an element. @@ -400,70 +376,70 @@ class CPhysicalGeometry final : public CGeometry { * \brief Set boundary vertex. * \param[in] config - Definition of the particular problem. */ - void SetVertex(const CConfig *config) override; + void SetVertex(const CConfig* config) override; /*! * \brief Set number of span wise level for turbomachinery computation. * \param[in] config - Definition of the particular problem. */ - void ComputeNSpan(CConfig *config, unsigned short val_iZone, unsigned short marker_flag, bool allocate) override; + void ComputeNSpan(CConfig* config, unsigned short val_iZone, unsigned short marker_flag, bool allocate) override; /*! * \brief Set turbo boundary vertex. * \param[in] config - Definition of the particular problem. */ - void SetTurboVertex(CConfig *config,unsigned short val_iZone, unsigned short marker_flag, bool allocate) override; + void SetTurboVertex(CConfig* config, unsigned short val_iZone, unsigned short marker_flag, bool allocate) override; /*! - * \brief update turbo boundary vertex. - * \param[in] config - Definition of the particular problem. - */ - void UpdateTurboVertex(CConfig *config,unsigned short val_iZone, unsigned short marker_flag) override; + * \brief update turbo boundary vertex. + * \param[in] config - Definition of the particular problem. + */ + void UpdateTurboVertex(CConfig* config, unsigned short val_iZone, unsigned short marker_flag) override; /*! * \brief Set turbo boundary vertex. * \param[in] config - Definition of the particular problem. */ - void SetAvgTurboValue(CConfig *config, unsigned short val_iZone, unsigned short marker_flag, bool allocate) override; + void SetAvgTurboValue(CConfig* config, unsigned short val_iZone, unsigned short marker_flag, bool allocate) override; /*! * \brief Set turbo boundary vertex. * \param[in] config - Definition of the particular problem. */ - void GatherInOutAverageValues(CConfig *config, bool allocate) override; + void GatherInOutAverageValues(CConfig* config, bool allocate) override; /*! * \brief Set the edge structure of the control volume. * \param[in] config - Definition of the particular problem. * \param[in] action - Allocate or not the new elements. */ - void SetControlVolume(CConfig *config, unsigned short action) override; + void SetControlVolume(CConfig* config, unsigned short action) override; /*! * \brief Visualize the structure of the control volume(s). * \param[in] config - Definition of the particular problem. */ - void VisualizeControlVolume(const CConfig *config) const override; + void VisualizeControlVolume(const CConfig* config) const override; /*! * \brief Mach the near field boundary condition. * \param[in] config - Definition of the particular problem. */ - void MatchActuator_Disk(const CConfig *config) override; + void MatchActuator_Disk(const CConfig* config) override; /*! * \brief Mach the periodic boundary conditions. * \param[in] config - Definition of the particular problem. * \param[in] val_periodic - Index of the first periodic face in a pair. */ - void MatchPeriodic(const CConfig *config, unsigned short val_periodic) override; + void MatchPeriodic(const CConfig* config, unsigned short val_periodic) override; /*! * \brief Set boundary vertex structure of the control volume. * \param[in] config - Definition of the particular problem. * \param[in] action - Allocate or not the new elements. */ - void SetBoundControlVolume(const CConfig *config, unsigned short action) override; + void SetBoundControlVolume(const CConfig* config, unsigned short action) override; /*! * \brief Set the maximum cell-center to cell-center distance for CVs. @@ -486,31 +462,31 @@ class CPhysicalGeometry final : public CGeometry { * information is going to be stored. * \param[in] new_file - Create a new file. */ - void SetBoundTecPlot(char mesh_filename[MAX_STRING_SIZE], bool new_file, CConfig *config) override; + void SetBoundTecPlot(char mesh_filename[MAX_STRING_SIZE], bool new_file, CConfig* config) override; /*! * \brief Check the volume element orientation. * \param[in] config - Definition of the particular problem. */ - void Check_IntElem_Orientation(const CConfig *config) override; + void Check_IntElem_Orientation(const CConfig* config) override; /*! * \brief Check the volume element orientation. * \param[in] config - Definition of the particular problem. */ - void Check_BoundElem_Orientation(const CConfig *config) override; + void Check_BoundElem_Orientation(const CConfig* config) override; /*! * \brief Set the domains for grid grid partitioning using ParMETIS. * \param[in] config - Definition of the particular problem. */ - void SetColorGrid_Parallel(const CConfig *config) override; + void SetColorGrid_Parallel(const CConfig* config) override; /*! * \brief Set the domains for FEM grid partitioning using ParMETIS. * \param[in] config - Definition of the particular problem. */ - void SetColorFEMGrid_Parallel(CConfig *config) override; + void SetColorFEMGrid_Parallel(CConfig* config) override; /*! * \brief Compute the weights of the FEM graph for ParMETIS. @@ -522,45 +498,41 @@ class CPhysicalGeometry final : public CGeometry { * \param[out] vwgt - Weights of the vertices of the graph, i.e. the elements. * \param[out] adjwgt - Weights of the edges of the graph. */ - void ComputeFEMGraphWeights( - CConfig *config, - const vector &localFaces, - const vector > &adjacency, - const map &mapExternalElemIDToTimeLevel, - vector &vwgt, - vector > &adjwgt); + void ComputeFEMGraphWeights(CConfig* config, const vector& localFaces, + const vector >& adjacency, + const map& mapExternalElemIDToTimeLevel, + vector& vwgt, vector >& adjwgt); /*! * \brief Determine the donor elements for the boundary elements on viscous wall boundaries when wall functions are used. * \param[in] config - Definition of the particular problem. */ - void DetermineDonorElementsWallFunctions(CConfig *config); + void DetermineDonorElementsWallFunctions(CConfig* config); /*! * \brief Determine whether or not the Jacobians of the elements and faces are constant and a length scale of the elements. * \param[in] config - Definition of the particular problem. */ - void DetermineFEMConstantJacobiansAndLenScale(CConfig *config); + void DetermineFEMConstantJacobiansAndLenScale(CConfig* config); /*! * \brief Determine the neighboring information for periodic faces of a FEM grid. * \param[in] config - Definition of the particular problem. * \param[in,out] localFaces - Vector, which contains the element faces of this rank. */ - void DeterminePeriodicFacesFEMGrid(CConfig *config, - vector &localFaces); + void DeterminePeriodicFacesFEMGrid(CConfig* config, vector& localFaces); /*! * \brief Determine the time level of the elements when time accurate local time stepping is employed. * \param[in] config - Definition of the particular problem. * \param[in] localFaces - Vector, which contains the element faces of this rank. - * \param[out] mapExternalElemIDToTimeLevel - Map from the external element ID's to their time level and number of DOFs. + * \param[out] mapExternalElemIDToTimeLevel - Map from the external element ID's to their time level and number of + * DOFs. */ - void DetermineTimeLevelElements(CConfig *config, - const vector &localFaces, - map &mapExternalElemIDToTimeLevel); + void DetermineTimeLevelElements(CConfig* config, const vector& localFaces, + map& mapExternalElemIDToTimeLevel); /*! * \brief Do an implicit smoothing of the grid coordinates. @@ -568,165 +540,166 @@ class CPhysicalGeometry final : public CGeometry { * \param[in] val_smooth_coeff - Relaxation factor. * \param[in] config - Definition of the particular problem. */ - void SetCoord_Smoothing(unsigned short val_nSmooth, su2double val_smooth_coeff, CConfig *config) override; + void SetCoord_Smoothing(unsigned short val_nSmooth, su2double val_smooth_coeff, CConfig* config) override; /*! * \brief Compute 3 grid quality metrics: orthogonality angle, dual cell aspect ratio, and dual cell volume ratio. * \param[in] config - Definition of the particular problem. */ - void ComputeMeshQualityStatistics(const CConfig *config) override; + void ComputeMeshQualityStatistics(const CConfig* config) override; /*! * \brief Find and store the closest neighbor to a vertex. * \param[in] config - Definition of the particular problem. */ - void FindNormal_Neighbor(const CConfig *config) override; + void FindNormal_Neighbor(const CConfig* config) override; /*! * \brief Read the sensitivity from an input file. * \param[in] config - Definition of the particular problem. */ - void SetBoundSensitivity(CConfig *config) override; + void SetBoundSensitivity(CConfig* config) override; /*! * \brief Compute the maximum thickness of an airfoil. * \return Maximum thickness at a particular seccion. */ - su2double Compute_MaxThickness(su2double *Plane_P0, su2double *Plane_Normal, CConfig *config, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) override; + su2double Compute_MaxThickness(su2double* Plane_P0, su2double* Plane_Normal, CConfig* config, + vector& Xcoord_Airfoil, vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil) override; /*! * \brief Compute the twist of an airfoil. * \return Twist at a particular seccion. */ - su2double Compute_Twist(su2double *Plane_P0, su2double *Plane_Normal, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) override; + su2double Compute_Twist(su2double* Plane_P0, su2double* Plane_Normal, vector& Xcoord_Airfoil, + vector& Ycoord_Airfoil, vector& Zcoord_Airfoil) override; /*! * \brief Compute the leading/trailing edge location of an airfoil. */ - void Compute_Wing_LeadingTrailing(su2double *LeadingEdge, su2double *TrailingEdge, su2double *Plane_P0, - su2double *Plane_Normal, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) override; + void Compute_Wing_LeadingTrailing(su2double* LeadingEdge, su2double* TrailingEdge, su2double* Plane_P0, + su2double* Plane_Normal, vector& Xcoord_Airfoil, + vector& Ycoord_Airfoil, vector& Zcoord_Airfoil) override; /*! - * \brief Compute the leading/trailing edge location of a fuselage. - */ - void Compute_Fuselage_LeadingTrailing(su2double *LeadingEdge, su2double *TrailingEdge, su2double *Plane_P0, - su2double *Plane_Normal, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) override; + * \brief Compute the leading/trailing edge location of a fuselage. + */ + void Compute_Fuselage_LeadingTrailing(su2double* LeadingEdge, su2double* TrailingEdge, su2double* Plane_P0, + su2double* Plane_Normal, vector& Xcoord_Airfoil, + vector& Ycoord_Airfoil, vector& Zcoord_Airfoil) override; /*! * \brief Compute the chord of an airfoil. * \return Chord of an airfoil. */ - su2double Compute_Chord(su2double *Plane_P0, su2double *Plane_Normal, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) override; + su2double Compute_Chord(su2double* Plane_P0, su2double* Plane_Normal, vector& Xcoord_Airfoil, + vector& Ycoord_Airfoil, vector& Zcoord_Airfoil) override; /*! * \brief Compute the chord of an airfoil. * \return Chord of an airfoil. */ - su2double Compute_Width(su2double *Plane_P0, su2double *Plane_Normal, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) override; + su2double Compute_Width(su2double* Plane_P0, su2double* Plane_Normal, vector& Xcoord_Airfoil, + vector& Ycoord_Airfoil, vector& Zcoord_Airfoil) override; /*! * \brief Compute the chord of an airfoil. * \return Chord of an airfoil. */ - su2double Compute_WaterLineWidth(su2double *Plane_P0, su2double *Plane_Normal, CConfig *config, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) override; + su2double Compute_WaterLineWidth(su2double* Plane_P0, su2double* Plane_Normal, CConfig* config, + vector& Xcoord_Airfoil, vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil) override; /*! * \brief Compute the chord of an airfoil. * \return Chord of an airfoil. */ - su2double Compute_Height(su2double *Plane_P0, su2double *Plane_Normal, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) override; + su2double Compute_Height(su2double* Plane_P0, su2double* Plane_Normal, vector& Xcoord_Airfoil, + vector& Ycoord_Airfoil, vector& Zcoord_Airfoil) override; /*! * \brief Compute the chord of an airfoil. * \return Chord of an airfoil. */ - su2double Compute_LERadius(su2double *Plane_P0, su2double *Plane_Normal, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) override; + su2double Compute_LERadius(su2double* Plane_P0, su2double* Plane_Normal, vector& Xcoord_Airfoil, + vector& Ycoord_Airfoil, vector& Zcoord_Airfoil) override; /*! * \brief Compute the thickness of an airfoil. */ - su2double Compute_Thickness(su2double *Plane_P0, su2double *Plane_Normal, su2double Location, CConfig *config, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil, su2double &ZLoc) override; + su2double Compute_Thickness(su2double* Plane_P0, su2double* Plane_Normal, su2double Location, CConfig* config, + vector& Xcoord_Airfoil, vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil, su2double& ZLoc) override; /*! * \brief Compute the area of an airfoil. * \return Area of an airfoil. */ - su2double Compute_Area(su2double *Plane_P0, su2double *Plane_Normal, CConfig *config, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) override; + su2double Compute_Area(su2double* Plane_P0, su2double* Plane_Normal, CConfig* config, + vector& Xcoord_Airfoil, vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil) override; /*! * \brief Compute the length of an airfoil. * \return Area of an airfoil. */ - su2double Compute_Length(su2double *Plane_P0, su2double *Plane_Normal, CConfig *config, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) override; + su2double Compute_Length(su2double* Plane_P0, su2double* Plane_Normal, CConfig* config, + vector& Xcoord_Airfoil, vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil) override; /*! * \brief Compute the dihedral of a wing. * \return Dihedral at a particular seccion. */ - su2double Compute_Dihedral(su2double *LeadingEdge_im1, su2double *TrailingEdge_im1, - su2double *LeadingEdge_i, su2double *TrailingEdge_i) override; + su2double Compute_Dihedral(su2double* LeadingEdge_im1, su2double* TrailingEdge_im1, su2double* LeadingEdge_i, + su2double* TrailingEdge_i) override; /*! * \brief Compute the curvature of a wing. */ - su2double Compute_Curvature(su2double *LeadingEdge_im1, su2double *TrailingEdge_im1, - su2double *LeadingEdge_i, su2double *TrailingEdge_i, - su2double *LeadingEdge_ip1, su2double *TrailingEdge_ip1) override; + su2double Compute_Curvature(su2double* LeadingEdge_im1, su2double* TrailingEdge_im1, su2double* LeadingEdge_i, + su2double* TrailingEdge_i, su2double* LeadingEdge_ip1, + su2double* TrailingEdge_ip1) override; /*! * \brief Evaluate geometrical parameters of a wing. */ - void Compute_Wing(CConfig *config, bool original_surface, - su2double &Wing_Volume, su2double &Wing_MinMaxThickness, su2double &Wing_MaxMaxThickness, - su2double &Wing_MinChord, su2double &Wing_MaxChord, - su2double &Wing_MinLERadius, su2double &Wing_MaxLERadius, - su2double &Wing_MinToC, su2double &Wing_MaxToC, - su2double &Wing_ObjFun_MinToC, su2double &Wing_MaxTwist, - su2double &Wing_MaxCurvature, su2double &Wing_MaxDihedral) override; + void Compute_Wing(CConfig* config, bool original_surface, su2double& Wing_Volume, su2double& Wing_MinMaxThickness, + su2double& Wing_MaxMaxThickness, su2double& Wing_MinChord, su2double& Wing_MaxChord, + su2double& Wing_MinLERadius, su2double& Wing_MaxLERadius, su2double& Wing_MinToC, + su2double& Wing_MaxToC, su2double& Wing_ObjFun_MinToC, su2double& Wing_MaxTwist, + su2double& Wing_MaxCurvature, su2double& Wing_MaxDihedral) override; /*! * \brief Evaluate geometrical parameters of a wing. */ - void Compute_Fuselage(CConfig *config, bool original_surface, - su2double &Fuselage_Volume, su2double &Fuselage_WettedArea, - su2double &Fuselage_MinWidth, su2double &Fuselage_MaxWidth, - su2double &Fuselage_MinWaterLineWidth, su2double &Fuselage_MaxWaterLineWidth, - su2double &Fuselage_MinHeight, su2double &Fuselage_MaxHeight, - su2double &Fuselage_MaxCurvature) override; + void Compute_Fuselage(CConfig* config, bool original_surface, su2double& Fuselage_Volume, + su2double& Fuselage_WettedArea, su2double& Fuselage_MinWidth, su2double& Fuselage_MaxWidth, + su2double& Fuselage_MinWaterLineWidth, su2double& Fuselage_MaxWaterLineWidth, + su2double& Fuselage_MinHeight, su2double& Fuselage_MaxHeight, + su2double& Fuselage_MaxCurvature) override; /*! * \brief Evaluate geometrical parameters of a wing. */ - void Compute_Nacelle(CConfig *config, bool original_surface, - su2double &Nacelle_Volume, su2double &Nacelle_MinMaxThickness, su2double &Nacelle_MaxMaxThickness, - su2double &Nacelle_MinChord, su2double &Nacelle_MaxChord, - su2double &Nacelle_MinLERadius, su2double &Nacelle_MaxLERadius, - su2double &Nacelle_MinToC, su2double &Nacelle_MaxToC, - su2double &Nacelle_ObjFun_MinToC, su2double &Nacelle_MaxTwist) override; + void Compute_Nacelle(CConfig* config, bool original_surface, su2double& Nacelle_Volume, + su2double& Nacelle_MinMaxThickness, su2double& Nacelle_MaxMaxThickness, + su2double& Nacelle_MinChord, su2double& Nacelle_MaxChord, su2double& Nacelle_MinLERadius, + su2double& Nacelle_MaxLERadius, su2double& Nacelle_MinToC, su2double& Nacelle_MaxToC, + su2double& Nacelle_ObjFun_MinToC, su2double& Nacelle_MaxTwist) override; /*! * \brief Read the sensitivity from adjoint solution file and store it. * \param[in] config - Definition of the particular problem. */ - void SetSensitivity(CConfig *config) override; + void SetSensitivity(CConfig* config) override; /*! * \brief Read the sensitivity from unordered ASCII adjoint solution file and store it. * \param[in] config - Definition of the particular problem. */ - void ReadUnorderedSensitivity(CConfig *config) override; + void ReadUnorderedSensitivity(CConfig* config) override; /*! * \brief Get the Sensitivity at a specific point. @@ -734,7 +707,9 @@ class CPhysicalGeometry final : public CGeometry { * \param[in] iDim - The component of the dim. vector. * \return The sensitivity at point iPoint and dim. iDim. */ - inline su2double GetSensitivity(unsigned long iPoint, unsigned short iDim) const override { return Sensitivity(iPoint,iDim); } + inline su2double GetSensitivity(unsigned long iPoint, unsigned short iDim) const override { + return Sensitivity(iPoint, iDim); + } /*! * \brief Set the Sensitivity at a specific point. @@ -742,20 +717,22 @@ class CPhysicalGeometry final : public CGeometry { * \param[in] iDim - The component of the dim. vector. * \param[in] val - Value of the sensitivity. */ - inline void SetSensitivity(unsigned long iPoint, unsigned short iDim, su2double val) override { Sensitivity(iPoint,iDim) = val; } + inline void SetSensitivity(unsigned long iPoint, unsigned short iDim, su2double val) override { + Sensitivity(iPoint, iDim) = val; + } /*! * \brief Check the mesh for periodicity and deactivate multigrid if periodicity is found. * \param[in] config - Definition of the particular problem. */ - void Check_Periodicity(CConfig *config) override; + void Check_Periodicity(CConfig* config) override; /*! * \brief Compute an ADT including the coordinates of all viscous markers * \param[in] config - Definition of the particular problem. * \return pointer to the ADT */ - std::unique_ptr ComputeViscousWallADT(const CConfig *config) const override; + std::unique_ptr ComputeViscousWallADT(const CConfig* config) const override; /*! * \brief Reduce the wall distance based on an previously constructed ADT. @@ -771,7 +748,7 @@ class CPhysicalGeometry final : public CGeometry { * \brief Set wall distances a specific value */ void SetWallDistance(su2double val) override { - for (unsigned long iPoint = 0; iPoint < GetnPoint(); iPoint++){ + for (unsigned long iPoint = 0; iPoint < GetnPoint(); iPoint++) { nodes->SetWall_Distance(iPoint, val); } } @@ -780,11 +757,11 @@ class CPhysicalGeometry final : public CGeometry { * \brief For streamwise periodicity, find & store a unique reference node on the designated periodic inlet. * \param[in] config - Definition of the particular problem. */ - void FindUniqueNode_PeriodicBound(const CConfig *config) final; + void FindUniqueNode_PeriodicBound(const CConfig* config) final; /*! * \brief Get a pointer to the reference node coordinate vector. * \return A pointer to the reference node coordinate vector. */ - inline const su2double* GetStreamwise_Periodic_RefNode(void) const final { return Streamwise_Periodic_RefNode;} + inline const su2double* GetStreamwise_Periodic_RefNode(void) const final { return Streamwise_Periodic_RefNode; } }; diff --git a/Common/include/geometry/dual_grid/CDualGrid.hpp b/Common/include/geometry/dual_grid/CDualGrid.hpp index b99e9d4a8e7..04b0f79dc10 100644 --- a/Common/include/geometry/dual_grid/CDualGrid.hpp +++ b/Common/include/geometry/dual_grid/CDualGrid.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for doing the complete dual grid structure. * The subroutines and functions are in the CDualGrid.cpp file. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -41,12 +41,11 @@ * three main elements: points, edges, and vertices. * \author F. Palacios */ -class CDualGrid{ -protected: +class CDualGrid { + protected: static unsigned short nDim; /*!< \brief Number of dimensions of the problem. */ -public: - + public: /*! * \brief Constructor of the class. * \param[in] val_nDim - Number of dimensions of the problem. @@ -61,13 +60,13 @@ class CDualGrid{ /*! * \brief A pure virtual member. */ - virtual su2double *GetCoord(void) = 0; + virtual su2double* GetCoord(void) = 0; /*! * \brief A pure virtual member. * \param[in] val_coord - Coordinate of the point. */ - virtual void SetCoord(const su2double *val_coord) = 0; + virtual void SetCoord(const su2double* val_coord) = 0; /*! * \brief A pure virtual member. @@ -75,32 +74,32 @@ class CDualGrid{ * \param[in] val_coord_FaceElem_CG - Coordinates of the centre of gravity of the face of an element. * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element. */ - virtual void SetNodes_Coord(const su2double *val_coord_Edge_CG, const su2double *val_coord_FaceElem_CG, - const su2double *val_coord_Elem_CG) = 0; + virtual void SetNodes_Coord(const su2double* val_coord_Edge_CG, const su2double* val_coord_FaceElem_CG, + const su2double* val_coord_Elem_CG) = 0; /*! * \overload * \param[in] val_coord_Edge_CG - Coordinates of the centre of gravity of the edge. * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element. */ - virtual void SetNodes_Coord(const su2double *val_coord_Edge_CG, const su2double *val_coord_Elem_CG) = 0; + virtual void SetNodes_Coord(const su2double* val_coord_Edge_CG, const su2double* val_coord_Elem_CG) = 0; /*! * \brief A pure virtual member. * \param[out] val_normal - Coordinates of the normal. */ - virtual void GetNormal(su2double *val_normal) const = 0; + virtual void GetNormal(su2double* val_normal) const = 0; /*! * \brief A pure virtual member. */ - virtual su2double *GetNormal(void) = 0; + virtual su2double* GetNormal(void) = 0; /*! * \brief A pure virtual member. * \param[in] val_face_normal - Coordinates of the normal. */ - virtual void SetNormal(const su2double *val_face_normal) = 0; + virtual void SetNormal(const su2double* val_face_normal) = 0; /*! * \brief A pure virtual member. @@ -116,5 +115,5 @@ class CDualGrid{ * \brief A pure virtual member. * \param[in] val_face_normal - Normal vector to be added. */ - virtual void AddNormal(const su2double *val_face_normal) = 0; + virtual void AddNormal(const su2double* val_face_normal) = 0; }; diff --git a/Common/include/geometry/dual_grid/CEdge.hpp b/Common/include/geometry/dual_grid/CEdge.hpp index 84bb425cbbb..ac40488c5f3 100644 --- a/Common/include/geometry/dual_grid/CEdge.hpp +++ b/Common/include/geometry/dual_grid/CEdge.hpp @@ -2,7 +2,7 @@ * \file CEdge.hpp * \brief Declaration of the edge class CEdge.cpp file. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -38,17 +38,18 @@ class CPhysicalGeometry; */ class CEdge { static_assert(su2activematrix::IsRowMajor, "Needed to return normal as pointer."); -private: + + private: using Index = unsigned long; using NodeArray = C2DContainer; - NodeArray Nodes; /*!< \brief Vector to store the node indices of the edge. */ - su2activematrix Normal; /*!< \brief Normal (area) of the edge. */ + NodeArray Nodes; /*!< \brief Vector to store the node indices of the edge. */ + su2activematrix Normal; /*!< \brief Normal (area) of the edge. */ const Index nEdge, nEdgeSIMD; friend class CPhysicalGeometry; -public: - enum NodePosition : unsigned long {LEFT = 0, RIGHT = 1}; + public: + enum NodePosition : unsigned long { LEFT = 0, RIGHT = 1 }; /*! * \brief Constructor of the class. @@ -68,14 +69,14 @@ class CEdge { * \param[in] iNode - Node index 0 or 1, LEFT or RIGHT. * \return Index of the node that composes the edge. */ - inline unsigned long GetNode(unsigned long iEdge, unsigned long iNode) const { return Nodes(iEdge,iNode); } + inline unsigned long GetNode(unsigned long iEdge, unsigned long iNode) const { return Nodes(iEdge, iNode); } /*! * \brief SIMD version of GetNode, iNode returned for contiguous iEdges. */ - template - FORCEINLINE simd::Array GetNode(simd::Array iEdge, unsigned long iNode) const { - return simd::Array(&Nodes(iEdge[0],iNode)); + template + FORCEINLINE simd::Array GetNode(simd::Array iEdge, unsigned long iNode) const { + return simd::Array(&Nodes(iEdge[0], iNode)); } /*! @@ -116,10 +117,8 @@ class CEdge { * \param[in] coord_Point - Coordinates of the point that form the control volume. * \return Local volume associated to the edge. */ - static su2double GetVolume(const su2double* coord_Edge_CG, - const su2double* coord_FaceElem_CG, - const su2double* coord_Elem_CG, - const su2double* coord_Point); + static su2double GetVolume(const su2double* coord_Edge_CG, const su2double* coord_FaceElem_CG, + const su2double* coord_Elem_CG, const su2double* coord_Point); /*! * \brief Compute the volume associated with an edge (2D version). @@ -128,8 +127,7 @@ class CEdge { * \param[in] coord_Point - Coordinates of the point that form the control volume. * \return Local volume associated to the edge. */ - static su2double GetVolume(const su2double* coord_Edge_CG, - const su2double* coord_Elem_CG, + static su2double GetVolume(const su2double* coord_Edge_CG, const su2double* coord_Elem_CG, const su2double* coord_Point); /*! @@ -141,9 +139,7 @@ class CEdge { * \param[in] config - Definition of the particular problem. * \return Compute the normal (dimensional) to the face that makes the control volume boundaries. */ - void SetNodes_Coord(unsigned long iEdge, - const su2double* coord_Edge_CG, - const su2double* coord_FaceElem_CG, + void SetNodes_Coord(unsigned long iEdge, const su2double* coord_Edge_CG, const su2double* coord_FaceElem_CG, const su2double* coord_Elem_CG); /*! @@ -154,19 +150,16 @@ class CEdge { * \param[in] config - Definition of the particular problem. * \return Compute the normal (dimensional) to the face that makes the contorl volume boundaries. */ - void SetNodes_Coord(unsigned long iEdge, - const su2double* coord_Edge_CG, - const su2double* coord_Elem_CG); + void SetNodes_Coord(unsigned long iEdge, const su2double* coord_Edge_CG, const su2double* coord_Elem_CG); /*! * \brief Copy the the normal vector of a face. * \param[in] iEdge - Edge index. * \param[out] normal - Object into which the normal (dimensional) will be copied. */ - template + template inline void GetNormal(unsigned long iEdge, T& normal) const { - for (auto iDim = 0ul; iDim < Normal.cols(); iDim++) - normal[iDim] = Normal(iEdge,iDim); + for (auto iDim = 0ul; iDim < Normal.cols(); iDim++) normal[iDim] = Normal(iEdge, iDim); } /*! @@ -192,10 +185,9 @@ class CEdge { * \param[in] normal - Vector to initialize the normal vector. * \return Value of the normal vector. */ - template + template void SetNormal(unsigned long iEdge, const T& normal) { - for (auto iDim = 0ul; iDim < Normal.cols(); ++iDim) - Normal(iEdge,iDim) = normal[iDim]; + for (auto iDim = 0ul; iDim < Normal.cols(); ++iDim) Normal(iEdge, iDim) = normal[iDim]; } /*! @@ -203,10 +195,9 @@ class CEdge { * \param[in] iEdge - Edge index. * \param[in] normal - Vector to add to the normal vector. */ - template + template void AddNormal(unsigned long iEdge, const T& normal) { - for (auto iDim = 0ul; iDim < Normal.cols(); ++iDim) - Normal(iEdge,iDim) += normal[iDim]; + for (auto iDim = 0ul; iDim < Normal.cols(); ++iDim) Normal(iEdge, iDim) += normal[iDim]; } /*! @@ -214,10 +205,8 @@ class CEdge { * \param[in] iEdge - Edge index. * \param[in] normal - Vector to add to the normal vector. */ - template + template void SubNormal(unsigned long iEdge, const T& normal) { - for (auto iDim = 0ul; iDim < Normal.cols(); ++iDim) - Normal(iEdge,iDim) -= normal[iDim]; + for (auto iDim = 0ul; iDim < Normal.cols(); ++iDim) Normal(iEdge, iDim) -= normal[iDim]; } - }; diff --git a/Common/include/geometry/dual_grid/CPoint.hpp b/Common/include/geometry/dual_grid/CPoint.hpp index 470dad563fd..a6f0ac73870 100644 --- a/Common/include/geometry/dual_grid/CPoint.hpp +++ b/Common/include/geometry/dual_grid/CPoint.hpp @@ -3,7 +3,7 @@ * \brief Declaration of the point class that stores geometric and adjacency * information for dual control volumes. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -45,73 +45,84 @@ class CPhysicalGeometry; * \author F. Palacios */ class CPoint { -private: + private: friend class CPhysicalGeometry; const unsigned long nDim = 0; - su2vector GlobalIndex; /*!< \brief Global index in the parallel simulation. */ - su2vector Color; /*!< \brief Color of the point in the partitioning strategy. */ - - CCompressedSparsePatternUL Point; /*!< \brief Points surrounding the central node of the control volume. */ - CCompressedSparsePatternL Edge; /*!< \brief Edges that set up a control volume (same sparse structure as Point). */ - CCompressedSparsePatternL Elem; /*!< \brief Elements that set up a control volume around a node. */ - vector > Vertex; /*!< \brief Index of the vertex that correspond which the control volume (we need one for each marker in the same node). */ - - su2activevector Volume; /*!< \brief Volume or Area of the control volume in 3D and 2D. */ - su2activevector Volume_n; /*!< \brief Volume at time n. */ - su2activevector Volume_nM1; /*!< \brief Volume at time n-1. */ - su2activevector Volume_Old; /*!< \brief Old containers for Volume. */ - su2activevector Volume_n_Old; /*!< \brief Old containers for Volume at time n. */ - su2activevector Volume_nM1_Old; /*!< \brief Old containers for Volume at time n-1. */ - su2activevector Periodic_Volume; /*!< \brief Missing component of volume or area of a control volume on a periodic marker in 3D and 2D. */ - - su2vector Domain; /*!< \brief Indicates if a point must be computed or belong to another boundary */ - su2vector Boundary; /*!< \brief To see if a point belong to the boundary (including MPI). */ - su2vector PhysicalBoundary; /*!< \brief To see if a point belong to the physical boundary (without includin MPI). */ - su2vector SolidBoundary; /*!< \brief To see if a point belong to the physical boundary (without includin MPI). */ - su2vector ViscousBoundary; /*!< \brief To see if a point belong to the physical boundary (without includin MPI). */ - su2vector PeriodicBoundary; /*!< \brief To see if a point belongs to a periodic boundary (without including MPI). */ - - su2activematrix Coord; /*!< \brief vector with the coordinates of the node. */ - su2activematrix Coord_Old; /*!< \brief Old coordinates vector for primal solution reloading for Disc.Adj. with dynamic grid. */ - su2activematrix Coord_Sum; /*!< \brief Sum of coordinates vector for geometry smoothing. */ - su2activematrix Coord_n; /*!< \brief Coordinates at time n for use with dynamic meshes. */ - su2activematrix Coord_n1; /*!< \brief Coordinates at time n-1 for use with dynamic meshes. */ - su2activematrix Coord_p1; /*!< \brief Coordinates at time n+1 for use with dynamic meshes. */ - - su2activematrix GridVel; /*!< \brief Velocity of the grid for dynamic mesh cases. */ - CVectorOfMatrix GridVel_Grad; /*!< \brief Gradient of the grid velocity for dynamic meshes. */ - - su2vector Parent_CV; /*!< \brief Index of the parent control volume in the agglomeration process. */ - su2vector nChildren_CV; /*!< \brief Number of children in the agglomeration process. */ - vector > Children_CV; /*!< \brief Index of the children control volumes in the agglomeration process. */ - su2vector Agglomerate_Indirect; /*!< \brief This flag indicates if the indirect points can be agglomerated. */ - su2vector Agglomerate; /*!< \brief This flag indicates if the element has been agglomerated. */ - - su2vector nNeighbor; /*!< \brief Number of neighbors, needed by some numerical methods. */ + su2vector GlobalIndex; /*!< \brief Global index in the parallel simulation. */ + su2vector Color; /*!< \brief Color of the point in the partitioning strategy. */ + + CCompressedSparsePatternUL Point; /*!< \brief Points surrounding the central node of the control volume. */ + CCompressedSparsePatternL Edge; /*!< \brief Edges that set up a control volume (same sparse structure as Point). */ + CCompressedSparsePatternL Elem; /*!< \brief Elements that set up a control volume around a node. */ + vector > Vertex; /*!< \brief Index of the vertex that correspond which the control volume (we need one + for each marker in the same node). */ + + su2activevector Volume; /*!< \brief Volume or Area of the control volume in 3D and 2D. */ + su2activevector Volume_n; /*!< \brief Volume at time n. */ + su2activevector Volume_nM1; /*!< \brief Volume at time n-1. */ + su2activevector Volume_Old; /*!< \brief Old containers for Volume. */ + su2activevector Volume_n_Old; /*!< \brief Old containers for Volume at time n. */ + su2activevector Volume_nM1_Old; /*!< \brief Old containers for Volume at time n-1. */ + su2activevector Periodic_Volume; /*!< \brief Missing component of volume or area of a control volume on a periodic + marker in 3D and 2D. */ + + su2vector Domain; /*!< \brief Indicates if a point must be computed or belong to another boundary */ + su2vector Boundary; /*!< \brief To see if a point belong to the boundary (including MPI). */ + su2vector + PhysicalBoundary; /*!< \brief To see if a point belong to the physical boundary (without includin MPI). */ + su2vector + SolidBoundary; /*!< \brief To see if a point belong to the physical boundary (without includin MPI). */ + su2vector + ViscousBoundary; /*!< \brief To see if a point belong to the physical boundary (without includin MPI). */ + su2vector + PeriodicBoundary; /*!< \brief To see if a point belongs to a periodic boundary (without including MPI). */ + + su2activematrix Coord; /*!< \brief vector with the coordinates of the node. */ + su2activematrix + Coord_Old; /*!< \brief Old coordinates vector for primal solution reloading for Disc.Adj. with dynamic grid. */ + su2activematrix Coord_Sum; /*!< \brief Sum of coordinates vector for geometry smoothing. */ + su2activematrix Coord_n; /*!< \brief Coordinates at time n for use with dynamic meshes. */ + su2activematrix Coord_n1; /*!< \brief Coordinates at time n-1 for use with dynamic meshes. */ + su2activematrix Coord_p1; /*!< \brief Coordinates at time n+1 for use with dynamic meshes. */ + + su2activematrix GridVel; /*!< \brief Velocity of the grid for dynamic mesh cases. */ + CVectorOfMatrix GridVel_Grad; /*!< \brief Gradient of the grid velocity for dynamic meshes. */ + + su2vector Parent_CV; /*!< \brief Index of the parent control volume in the agglomeration process. */ + su2vector nChildren_CV; /*!< \brief Number of children in the agglomeration process. */ + vector > + Children_CV; /*!< \brief Index of the children control volumes in the agglomeration process. */ + su2vector Agglomerate_Indirect; /*!< \brief This flag indicates if the indirect points can be agglomerated. */ + su2vector Agglomerate; /*!< \brief This flag indicates if the element has been agglomerated. */ + + su2vector nNeighbor; /*!< \brief Number of neighbors, needed by some numerical methods. */ /*--- Closest element on a viscous wall, and distance to it. ---*/ - su2activevector Wall_Distance; /*!< \brief Distance to the nearest wall. */ - su2vector ClosestWall_Rank; /*!< \brief Rank of process holding the closest wall element. */ + su2activevector Wall_Distance; /*!< \brief Distance to the nearest wall. */ + su2vector ClosestWall_Rank; /*!< \brief Rank of process holding the closest wall element. */ su2vector ClosestWall_Zone; /*!< \brief Zone index of closest wall element. */ - su2vector ClosestWall_Marker; /*!< \brief Marker index of closest wall element, for given rank and zone index. */ - su2vector ClosestWall_Elem; /*!< \brief Element index of closest wall element, for givenrank, zone and marker index. */ + su2vector + ClosestWall_Marker; /*!< \brief Marker index of closest wall element, for given rank and zone index. */ + su2vector + ClosestWall_Elem; /*!< \brief Element index of closest wall element, for givenrank, zone and marker index. */ - su2activevector SharpEdge_Distance; /*!< \brief Distance to a sharp edge. */ - su2activevector Curvature; /*!< \brief Value of the surface curvature (SU2_GEO). */ - su2activevector MaxLength; /*!< \brief The maximum cell-center to cell-center length. */ - su2activevector RoughnessHeight; /*!< \brief Roughness of the nearest wall. */ + su2activevector SharpEdge_Distance; /*!< \brief Distance to a sharp edge. */ + su2activevector Curvature; /*!< \brief Value of the surface curvature (SU2_GEO). */ + su2activevector MaxLength; /*!< \brief The maximum cell-center to cell-center length. */ + su2activevector RoughnessHeight; /*!< \brief Roughness of the nearest wall. */ - su2matrix AD_InputIndex; /*!< \brief Indices of Coord variables in the adjoint vector. */ - su2matrix AD_OutputIndex; /*!< \brief Indices of Coord variables in the adjoint vector after having been updated. */ + su2matrix AD_InputIndex; /*!< \brief Indices of Coord variables in the adjoint vector. */ + su2matrix + AD_OutputIndex; /*!< \brief Indices of Coord variables in the adjoint vector after having been updated. */ /*! * \brief Allocate fields required by the minimal constructor. */ void MinimalAllocation(unsigned long npoint); -public: + public: /*! * \brief "Full" constructor of the class. * \param[in] npoint - Number of points (dual volumes) in the problem. @@ -144,14 +155,14 @@ class CPoint { * \param[in] iDim - Number of dimensions of the problem. * \return Coordinate that correspond with iDim. */ - inline su2double GetCoord(unsigned long iPoint, unsigned long iDim) const { return Coord(iPoint,iDim); } + inline su2double GetCoord(unsigned long iPoint, unsigned long iDim) const { return Coord(iPoint, iDim); } /*! * \brief Get the coordinates of the control volume. * \param[in] iPoint - Index of the point. * \return pointer to the coordinate of the point. */ - inline su2double *GetCoord(unsigned long iPoint) { return Coord[iPoint]; } + inline su2double* GetCoord(unsigned long iPoint) { return Coord[iPoint]; } /*! * \brief Get the entire matrix of coordinates of the control volumes. @@ -164,7 +175,7 @@ class CPoint { * \param[in] iDim - Position to store the coordinate. * \param[in] coord - Coordinate for iDim. */ - inline void SetCoord(unsigned long iPoint, unsigned long iDim, su2double coord) { Coord(iPoint,iDim) = coord; } + inline void SetCoord(unsigned long iPoint, unsigned long iDim, su2double coord) { Coord(iPoint, iDim) = coord; } /*! * \brief Set the coordinates for the control volume. @@ -172,16 +183,15 @@ class CPoint { * \param[in] iDim - Position to store the coordinate. * \param[in] coord - Coordinate for iDim. */ - inline void AddCoord(unsigned long iPoint, unsigned long iDim, su2double coord) { Coord(iPoint,iDim) += coord; } + inline void AddCoord(unsigned long iPoint, unsigned long iDim, su2double coord) { Coord(iPoint, iDim) += coord; } /*! * \brief Set the point coordinates. * \param[in] iPoint - Index of the point. * \param[in] coord - Coordinate of the point. */ - inline void SetCoord(unsigned long iPoint, const su2double *coord) { - for (unsigned long iDim = 0; iDim < nDim; iDim++) - Coord(iPoint,iDim) = coord[iDim]; + inline void SetCoord(unsigned long iPoint, const su2double* coord) { + for (unsigned long iDim = 0; iDim < nDim; iDim++) Coord(iPoint, iDim) = coord[iDim]; } /*! @@ -208,12 +218,16 @@ class CPoint { * \param[in] nelem - Position where the element is stored. * \return Index of the element. */ - inline unsigned long GetElem(unsigned long iPoint, unsigned long nelem) const { return Elem.getInnerIdx(iPoint,nelem); } + inline unsigned long GetElem(unsigned long iPoint, unsigned long nelem) const { + return Elem.getInnerIdx(iPoint, nelem); + } /*! * \brief Get inner iterator to loop over neighbor elements. */ - inline CCompressedSparsePatternL::CInnerIter GetElems(unsigned long iPoint) const { return Elem.getInnerIter(iPoint); } + inline CCompressedSparsePatternL::CInnerIter GetElems(unsigned long iPoint) const { + return Elem.getInnerIter(iPoint); + } /*! * \brief Set the points that compose the control volume. @@ -229,7 +243,10 @@ class CPoint { /*! * \brief Reset the points that compose the control volume. */ - inline void ResetPoints() { Point = CCompressedSparsePatternUL(); Edge = CCompressedSparsePatternL(); } + inline void ResetPoints() { + Point = CCompressedSparsePatternUL(); + Edge = CCompressedSparsePatternL(); + } /*! * \brief Get the number of points that compose the control volume. @@ -244,12 +261,16 @@ class CPoint { * \param[in] point - Position where the point is stored. * \return Index of the point. */ - inline unsigned long GetPoint(unsigned long iPoint, unsigned long npoint) const { return Point.getInnerIdx(iPoint,npoint); } + inline unsigned long GetPoint(unsigned long iPoint, unsigned long npoint) const { + return Point.getInnerIdx(iPoint, npoint); + } /*! * \brief Get inner iterator to loop over neighbor points. */ - inline CCompressedSparsePatternUL::CInnerIter GetPoints(unsigned long iPoint) const { return Point.getInnerIter(iPoint); } + inline CCompressedSparsePatternUL::CInnerIter GetPoints(unsigned long iPoint) const { + return Point.getInnerIter(iPoint); + } /*! * \brief Set the edges that compose the control volume. @@ -257,7 +278,9 @@ class CPoint { * \param[in] iedge - Edge to be added. * \param[in] nedge - Position in which is going to be stored the edge for each control volume. */ - inline void SetEdge(unsigned long iPoint, long iedge, unsigned long nedge) { Edge.getInnerIdx(iPoint,nedge) = iedge; } + inline void SetEdge(unsigned long iPoint, long iedge, unsigned long nedge) { + Edge.getInnerIdx(iPoint, nedge) = iedge; + } /*! * \brief Get all the edges that compose the control volume. @@ -265,12 +288,14 @@ class CPoint { * \param[in] nedge - Position where the edge is stored. * \return Index of the edge. */ - inline long GetEdge(unsigned long iPoint, unsigned long nedge) const { return Edge.getInnerIdx(iPoint,nedge); } + inline long GetEdge(unsigned long iPoint, unsigned long nedge) const { return Edge.getInnerIdx(iPoint, nedge); } /*! * \brief Get inner iterator to loop over neighbor edges. */ - inline CCompressedSparsePatternL::CInnerIter GetEdges(unsigned long iPoint) const { return Edge.getInnerIter(iPoint); } + inline CCompressedSparsePatternL::CInnerIter GetEdges(unsigned long iPoint) const { + return Edge.getInnerIter(iPoint); + } /*! * \brief Set the boundary vertex that compose the control volume. @@ -289,8 +314,10 @@ class CPoint { * \return Index of the vertex. */ inline long GetVertex(unsigned long iPoint, unsigned long iMarker) const { - if (Boundary(iPoint)) return Vertex[iPoint][iMarker]; - else return -1; + if (Boundary(iPoint)) + return Vertex[iPoint][iMarker]; + else + return -1; } /*! @@ -300,7 +327,7 @@ class CPoint { * \param[in] nMarker - Max number of marker. */ inline void SetBoundary(unsigned long iPoint, unsigned short nMarker) { - if (!Boundary(iPoint)) Vertex[iPoint].resize(nMarker,-1); + if (!Boundary(iPoint)) Vertex[iPoint].resize(nMarker, -1); Boundary(iPoint) = true; } @@ -308,7 +335,10 @@ class CPoint { * \brief Reset the boundary of a control volume. * \param[in] iPoint - Index of the point. */ - inline void ResetBoundary(unsigned long iPoint) { Vertex[iPoint].clear(); Boundary(iPoint) = false; } + inline void ResetBoundary(unsigned long iPoint) { + Vertex[iPoint].clear(); + Boundary(iPoint) = false; + } /*! * \brief Mark the point as boundary. @@ -602,7 +632,7 @@ class CPoint { */ void SetVolume_n_Old(); - /*! + /*! * \brief Set the Volume_nM1 to Volume_nM1_Old. */ void SetVolume_nM1_Old(); @@ -613,7 +643,8 @@ class CPoint { * \param[in] parent_CV - Index of the parent control volume. */ inline void SetParent_CV(unsigned long iPoint, unsigned long parent_CV) { - Parent_CV(iPoint) = parent_CV; Agglomerate(iPoint) = true; + Parent_CV(iPoint) = parent_CV; + Agglomerate(iPoint) = true; } /*! @@ -623,7 +654,7 @@ class CPoint { * \param[in] children_CV - Index of the children control volume. */ inline void SetChildren_CV(unsigned long iPoint, unsigned long nchildren_CV, unsigned long children_CV) { - Children_CV[iPoint].resize(nchildren_CV+1); + Children_CV[iPoint].resize(nchildren_CV + 1); Children_CV[iPoint][nchildren_CV] = children_CV; } @@ -663,7 +694,9 @@ class CPoint { * \param[in] iPoint - Index of the point. * \param[in] agglomerate - The indirect neigbors can be agglomerated. */ - inline void SetAgglomerate_Indirect(unsigned long iPoint, bool agglomerate) { Agglomerate_Indirect(iPoint) = agglomerate; }; + inline void SetAgglomerate_Indirect(unsigned long iPoint, bool agglomerate) { + Agglomerate_Indirect(iPoint) = agglomerate; + }; /*! * \brief Get the number of children of an agglomerated control volume. @@ -677,28 +710,30 @@ class CPoint { * \param[in] iPoint - Index of the point. * \param[in] nchildren_CV - Number of children of the control volume. */ - inline void SetnChildren_CV(unsigned long iPoint, unsigned short nchildren_CV) { nChildren_CV(iPoint) = nchildren_CV; } + inline void SetnChildren_CV(unsigned long iPoint, unsigned short nchildren_CV) { + nChildren_CV(iPoint) = nchildren_CV; + } /*! * \brief Get the coordinates of the control volume at time n. * \param[in] iPoint - Index of the point. * \return Coordinates of the control volume at time n. */ - inline su2double *GetCoord_n(unsigned long iPoint) { return Coord_n[iPoint]; } + inline su2double* GetCoord_n(unsigned long iPoint) { return Coord_n[iPoint]; } /*! * \brief Get the coordinates of the control volume at time n-1. * \param[in] iPoint - Index of the point. * \return Volume of the control volume at time n-1 */ - inline su2double *GetCoord_n1(unsigned long iPoint) { return Coord_n1[iPoint]; } + inline su2double* GetCoord_n1(unsigned long iPoint) { return Coord_n1[iPoint]; } /*! * \brief Get the coordinates of the control volume at time n+1. * \param[in] iPoint - Index of the point. * \return Volume of the control volume at time n+1 */ - inline su2double *GetCoord_p1(unsigned long iPoint) { return Coord_p1[iPoint]; } + inline su2double* GetCoord_p1(unsigned long iPoint) { return Coord_p1[iPoint]; } /*! * \brief Set the coordinates of the control volume at time n to the ones in Coord. @@ -715,9 +750,8 @@ class CPoint { * \param[in] iPoint - Index of the point. * \param[in] coord - Value of the grid coordinates at time n. */ - inline void SetCoord_n(unsigned long iPoint, const su2double *coord) { - for (unsigned long iDim = 0; iDim < nDim; iDim++) - Coord_n(iPoint,iDim) = coord[iDim]; + inline void SetCoord_n(unsigned long iPoint, const su2double* coord) { + for (unsigned long iDim = 0; iDim < nDim; iDim++) Coord_n(iPoint, iDim) = coord[iDim]; } /*! @@ -725,9 +759,8 @@ class CPoint { * \param[in] iPoint - Index of the point. * \param[in] coord - Value of the grid coordinates at time n-1. */ - inline void SetCoord_n1(unsigned long iPoint, const su2double *coord) { - for (unsigned long iDim = 0; iDim < nDim; iDim++) - Coord_n1(iPoint,iDim) = coord[iDim]; + inline void SetCoord_n1(unsigned long iPoint, const su2double* coord) { + for (unsigned long iDim = 0; iDim < nDim; iDim++) Coord_n1(iPoint, iDim) = coord[iDim]; } /*! @@ -735,9 +768,8 @@ class CPoint { * \param[in] iPoint - Index of the point. * \param[in] coord - Value of the grid coordinates at time n+1. */ - inline void SetCoord_p1(unsigned long iPoint, const su2double *coord) { - for (unsigned long iDim = 0; iDim < nDim; iDim++) - Coord_p1(iPoint,iDim) = coord[iDim]; + inline void SetCoord_p1(unsigned long iPoint, const su2double* coord) { + for (unsigned long iDim = 0; iDim < nDim; iDim++) Coord_p1(iPoint, iDim) = coord[iDim]; } /*! @@ -745,16 +777,15 @@ class CPoint { * \param[in] iPoint - Index of the point. * \return Old coordinates at a point. */ - inline su2double *GetCoord_Old(unsigned long iPoint) { return Coord_Old[iPoint]; } + inline su2double* GetCoord_Old(unsigned long iPoint) { return Coord_Old[iPoint]; } /*! * \brief Set the value of the vector Coord_Old for implicit smoothing. * \param[in] iPoint - Index of the point. * \param[in] coord_old - Value of the coordinates. */ - inline void SetCoord_Old(unsigned long iPoint, const su2double *coord_old) { - for (unsigned long iDim = 0; iDim < nDim; iDim++) - Coord_Old(iPoint,iDim) = coord_old[iDim]; + inline void SetCoord_Old(unsigned long iPoint, const su2double* coord_old) { + for (unsigned long iDim = 0; iDim < nDim; iDim++) Coord_Old(iPoint, iDim) = coord_old[iDim]; } /*! @@ -767,16 +798,15 @@ class CPoint { * \param[in] iPoint - Index of the point. * \return Sum of coordinates at a point. */ - inline su2double *GetCoord_Sum(unsigned long iPoint) { return Coord_Sum[iPoint]; } + inline su2double* GetCoord_Sum(unsigned long iPoint) { return Coord_Sum[iPoint]; } /*! * \brief Add the value of the coordinates to the Coord_Sum vector for implicit smoothing. * \param[in] iPoint - Index of the point. * \param[in] coord_sum - Value of the coordinates to add. */ - inline void AddCoord_Sum(unsigned long iPoint, const su2double *coord_sum) { - for (unsigned long iDim = 0; iDim < nDim; iDim++) - Coord_Sum(iPoint,iDim) += coord_sum[iDim]; + inline void AddCoord_Sum(unsigned long iPoint, const su2double* coord_sum) { + for (unsigned long iDim = 0; iDim < nDim; iDim++) Coord_Sum(iPoint, iDim) += coord_sum[iDim]; } /*! @@ -789,7 +819,7 @@ class CPoint { * \param[in] iPoint - Index of the point. * \return Grid velocity at the point. */ - inline su2double *GetGridVel(unsigned long iPoint) { return GridVel[iPoint]; } + inline su2double* GetGridVel(unsigned long iPoint) { return GridVel[iPoint]; } /*! * \brief Get the grid velocity matrix for the entire domain. @@ -802,16 +832,17 @@ class CPoint { * \param[in] iDim - Index of the coordinate. * \param[in] gridvel - Value of the grid velocity. */ - inline void SetGridVel(unsigned long iPoint, unsigned long iDim, su2double gridvel) { GridVel(iPoint,iDim) = gridvel; } + inline void SetGridVel(unsigned long iPoint, unsigned long iDim, su2double gridvel) { + GridVel(iPoint, iDim) = gridvel; + } /*! * \brief Set the value of the grid velocity at the point. * \param[in] iPoint - Index of the point. * \param[in] gridvel - Value of the grid velocity. */ - inline void SetGridVel(unsigned long iPoint, const su2double *gridvel) { - for (unsigned long iDim = 0; iDim < nDim; iDim++) - GridVel(iPoint,iDim) = gridvel[iDim]; + inline void SetGridVel(unsigned long iPoint, const su2double* gridvel) { + for (unsigned long iDim = 0; iDim < nDim; iDim++) GridVel(iPoint, iDim) = gridvel[iDim]; } /*! @@ -831,9 +862,9 @@ class CPoint { * \param[in] iPoint - Index of the point. * \param[in] adj_sol - Adjoint values of the Coord variables. */ - inline void SetAdjointSolution(unsigned long iPoint, const su2double *adj_sol) { + inline void SetAdjointSolution(unsigned long iPoint, const su2double* adj_sol) { for (unsigned long iDim = 0; iDim < nDim; iDim++) - AD::SetDerivative(AD_OutputIndex(iPoint,iDim), SU2_TYPE::GetValue(adj_sol[iDim])); + AD::SetDerivative(AD_OutputIndex(iPoint, iDim), SU2_TYPE::GetValue(adj_sol[iDim])); } /*! @@ -842,7 +873,7 @@ class CPoint { * \param[in] iDim - Dimension. */ inline su2double GetAdjointSolution(unsigned long iPoint, unsigned long iDim) const { - return AD::GetDerivative(AD_InputIndex(iPoint,iDim)); + return AD::GetDerivative(AD_InputIndex(iPoint, iDim)); } /*! @@ -852,13 +883,12 @@ class CPoint { */ inline void RegisterCoordinates(unsigned long iPoint, bool input) { for (unsigned long iDim = 0; iDim < nDim; iDim++) { - if(input) { - AD::RegisterInput(Coord(iPoint,iDim)); - AD::SetIndex(AD_InputIndex(iPoint,iDim), Coord(iPoint,iDim)); - } - else { - AD::RegisterOutput(Coord(iPoint,iDim)); - AD::SetIndex(AD_OutputIndex(iPoint,iDim), Coord(iPoint,iDim)); + if (input) { + AD::RegisterInput(Coord(iPoint, iDim)); + AD::SetIndex(AD_InputIndex(iPoint, iDim), Coord(iPoint, iDim)); + } else { + AD::RegisterOutput(Coord(iPoint, iDim)); + AD::SetIndex(AD_OutputIndex(iPoint, iDim), Coord(iPoint, iDim)); } } } @@ -867,16 +897,15 @@ class CPoint { * \brief Set wall roughnesses according to stored closest wall information. * \param[in] roughness - Mapping [rank][zone][marker] -> roughness */ - template - void SetWallRoughness(Roughness_type const& roughness){ - for (unsigned long iPoint=0; iPoint + void SetWallRoughness(Roughness_type const& roughness) { + for (unsigned long iPoint = 0; iPoint < GlobalIndex.size(); ++iPoint) { auto rankID = ClosestWall_Rank[iPoint]; auto zoneID = ClosestWall_Zone[iPoint]; auto markerID = ClosestWall_Marker[iPoint]; - if(rankID >= 0){ + if (rankID >= 0) { SetRoughnessHeight(iPoint, roughness[rankID][zoneID][markerID]); } } } - }; diff --git a/Common/include/geometry/dual_grid/CTurboVertex.hpp b/Common/include/geometry/dual_grid/CTurboVertex.hpp index 6b65d208179..d14d451ea5e 100644 --- a/Common/include/geometry/dual_grid/CTurboVertex.hpp +++ b/Common/include/geometry/dual_grid/CTurboVertex.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for doing the complete dual grid structure. * The subroutines and functions are in the CTurboVertex.cpp file. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -36,19 +36,19 @@ * \author S. Vitale */ class CTurboVertex final : public CVertex { -private: - su2double *TurboNormal; /*!< \brief Normal for computing correct turbomachinery quantities. */ - su2double Area; /*!< \brief Value of the face area associated to the vertex */ + private: + su2double* TurboNormal; /*!< \brief Normal for computing correct turbomachinery quantities. */ + su2double Area; /*!< \brief Value of the face area associated to the vertex */ // su2double PitchCoord; /*!< \brief Value of the abscissa pitch wise */ - su2double AngularCoord; /*!< \brief Value of the angular coordinate */ - su2double DeltaAngularCoord; /*!< \brief Value of the angular coordinate w.r.t. the minimum pitch point */ - su2double RelAngularCoord; /*!< \brief Value of the angular coordinate w.r.t. the minimum pitch point */ + su2double AngularCoord; /*!< \brief Value of the angular coordinate */ + su2double DeltaAngularCoord; /*!< \brief Value of the angular coordinate w.r.t. the minimum pitch point */ + su2double RelAngularCoord; /*!< \brief Value of the angular coordinate w.r.t. the minimum pitch point */ - unsigned long OldVertex; /*!< \brief Value of the vertex numeration before the ordering */ - int GlobalIndex; /*!< \brief Value of the vertex numeration after the ordering and global with respect to MPI partinioning */ - -public: + unsigned long OldVertex; /*!< \brief Value of the vertex numeration before the ordering */ + int GlobalIndex; /*!< \brief Value of the vertex numeration after the ordering and global with respect to MPI + partinioning */ + public: /*! * \brief Constructor of the class. * \param[in] val_point - Node of the vertex. @@ -65,17 +65,16 @@ class CTurboVertex final : public CVertex { * \brief set Normal in the turbomachinery frame of reference. * \param[in] val_normal - normal vector. */ - inline void SetTurboNormal(const su2double *val_normal) { + inline void SetTurboNormal(const su2double* val_normal) { unsigned short iDim; - for(iDim= 0; iDim < nDim; iDim++) - TurboNormal[iDim] = val_normal[iDim]; + for (iDim = 0; iDim < nDim; iDim++) TurboNormal[iDim] = val_normal[iDim]; } /*! * \brief set face Area. * \param[in] val_area - value of the face area. */ - inline void SetArea(su2double val_area){Area = val_area;} + inline void SetArea(su2double val_area) { Area = val_area; } /*! * \brief get face Area associate to the vertex. @@ -86,22 +85,21 @@ class CTurboVertex final : public CVertex { * \brief Copy the the turbo normal vector of a face. * \param[in] val_normal - Vector where the subroutine is goint to copy the normal (dimensionaless). */ - inline void GetTurboNormal(su2double *val_normal) const { - for (unsigned short iDim = 0; iDim < nDim; iDim++) - val_normal[iDim] = TurboNormal[iDim]; + inline void GetTurboNormal(su2double* val_normal) const { + for (unsigned short iDim = 0; iDim < nDim; iDim++) val_normal[iDim] = TurboNormal[iDim]; } /*! * \brief Get the turbo normal to a face where turboperformance are computed . * \return Dimensionaless normal vector, the modulus is the area of the face. */ - inline su2double *GetTurboNormal(void) { return TurboNormal; } + inline su2double* GetTurboNormal(void) { return TurboNormal; } /*! * \brief set vertex value not ordered. * \param[in] val_vertex - value of the vertex before ordering. */ - inline void SetOldVertex(unsigned long val_vertex){OldVertex = val_vertex;} + inline void SetOldVertex(unsigned long val_vertex) { OldVertex = val_vertex; } /*! * \brief retrieve vertex value not ordered. @@ -111,17 +109,17 @@ class CTurboVertex final : public CVertex { /*! * \brief set global index for ordered span-wise turbovertex. */ - inline void SetGlobalVertexIndex(int globalindex) { GlobalIndex = globalindex;} + inline void SetGlobalVertexIndex(int globalindex) { GlobalIndex = globalindex; } /*! * \brief get global index for ordered span-wise turbovertex. */ - inline int GetGlobalVertexIndex(void) const {return GlobalIndex;} + inline int GetGlobalVertexIndex(void) const { return GlobalIndex; } /*! * \brief set angular coord. */ - inline void SetAngularCoord(su2double angCoord) {AngularCoord = angCoord;} + inline void SetAngularCoord(su2double angCoord) { AngularCoord = angCoord; } /*! * \brief get angular coord. @@ -131,7 +129,7 @@ class CTurboVertex final : public CVertex { /*! * \brief set angular coord. */ - inline void SetDeltaAngularCoord(su2double deltaAngCoord){DeltaAngularCoord = deltaAngCoord;} + inline void SetDeltaAngularCoord(su2double deltaAngCoord) { DeltaAngularCoord = deltaAngCoord; } /*! * \brief get angular coord. @@ -141,11 +139,10 @@ class CTurboVertex final : public CVertex { /*! * \brief set angular coord. */ - inline void SetRelAngularCoord(su2double minAngCoord) {RelAngularCoord = AngularCoord - minAngCoord;} + inline void SetRelAngularCoord(su2double minAngCoord) { RelAngularCoord = AngularCoord - minAngCoord; } /*! * \brief get angular coord. */ - inline su2double GetRelAngularCoord(void) const {return RelAngularCoord;} - + inline su2double GetRelAngularCoord(void) const { return RelAngularCoord; } }; diff --git a/Common/include/geometry/dual_grid/CVertex.hpp b/Common/include/geometry/dual_grid/CVertex.hpp index d2baf9c387b..268e8eb278e 100644 --- a/Common/include/geometry/dual_grid/CVertex.hpp +++ b/Common/include/geometry/dual_grid/CVertex.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for doing the complete dual grid structure. * The subroutines and functions are in the CVertex.cpp file. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -36,19 +36,19 @@ * \author F. Palacios */ class CVertex : public CDualGrid { -protected: - unsigned long Nodes[1]; /*!< \brief Vector to store the global nodes of an element. */ - su2double Normal[3] = {0.0}; /*!< \brief Normal coordinates of the element and its center of gravity. */ - su2double Aux_Var; /*!< \brief Auxiliar variable defined only on the surface. */ - su2double CartCoord[3] = {0.0}; /*!< \brief Vertex cartesians coordinates. */ - su2double VarCoord[3] = {0.0}; /*!< \brief Used for storing the coordinate variation due to a surface modification. */ - long PeriodicPoint[5] = {-1}; /*!< \brief Store the periodic point of a boundary (iProcessor, iPoint) */ - bool ActDisk_Perimeter = false; /*!< \brief Identify nodes at the perimeter of the actuator disk */ - short Rotation_Type; /*!< \brief Type of rotation associated with the vertex (MPI and periodic) */ - unsigned long Normal_Neighbor; /*!< \brief Index of the closest neighbor. */ - su2double Basis_Function[3] = {0.0}; /*!< \brief Basis function values for interpolation across zones. */ - -public: + protected: + unsigned long Nodes[1]; /*!< \brief Vector to store the global nodes of an element. */ + su2double Normal[3] = {0.0}; /*!< \brief Normal coordinates of the element and its center of gravity. */ + su2double Aux_Var; /*!< \brief Auxiliar variable defined only on the surface. */ + su2double CartCoord[3] = {0.0}; /*!< \brief Vertex cartesians coordinates. */ + su2double VarCoord[3] = {0.0}; /*!< \brief Used for storing the coordinate variation due to a surface modification. */ + long PeriodicPoint[5] = {-1}; /*!< \brief Store the periodic point of a boundary (iProcessor, iPoint) */ + bool ActDisk_Perimeter = false; /*!< \brief Identify nodes at the perimeter of the actuator disk */ + short Rotation_Type; /*!< \brief Type of rotation associated with the vertex (MPI and periodic) */ + unsigned long Normal_Neighbor; /*!< \brief Index of the closest neighbor. */ + su2double Basis_Function[3] = {0.0}; /*!< \brief Basis function values for interpolation across zones. */ + + public: /*! * \brief Constructor of the class. * \param[in] val_point - Node of the vertex. @@ -75,8 +75,8 @@ class CVertex : public CDualGrid { * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element. * \return Compute the normal (dimensional) to the face that makes the vertex. */ - void SetNodes_Coord(const su2double *val_coord_Edge_CG, const su2double *val_coord_FaceElem_CG, - const su2double *val_coord_Elem_CG) override; + void SetNodes_Coord(const su2double* val_coord_Edge_CG, const su2double* val_coord_FaceElem_CG, + const su2double* val_coord_Elem_CG) override; /*! * \overload @@ -84,22 +84,21 @@ class CVertex : public CDualGrid { * \param[in] val_coord_Elem_CG - Coordinates of the centre of gravity of the element. * \return Compute the normal (dimensional) to the face that makes the vertex. */ - void SetNodes_Coord(const su2double *val_coord_Edge_CG, const su2double *val_coord_Elem_CG) override; + void SetNodes_Coord(const su2double* val_coord_Edge_CG, const su2double* val_coord_Elem_CG) override; /*! * \brief Copy the the normal vector of a face. * \param[in] val_normal - Vector where the subroutine is goint to copy the normal (dimensional). */ - inline void GetNormal(su2double *val_normal) const override { - for (unsigned short iDim = 0; iDim < nDim; iDim++) - val_normal[iDim] = Normal[iDim]; + inline void GetNormal(su2double* val_normal) const override { + for (unsigned short iDim = 0; iDim < nDim; iDim++) val_normal[iDim] = Normal[iDim]; } /*! * \brief Get the normal to a face of the control volume asociated with a vertex. * \return Dimensional normal vector, the modulus is the area of the face. */ - inline su2double *GetNormal(void) override { return Normal; } + inline su2double* GetNormal(void) override { return Normal; } /*! * \brief Get the ith component of the normal. @@ -110,8 +109,7 @@ class CVertex : public CDualGrid { * \brief Initialize normal vector. */ inline void SetZeroValues(void) override { - for (unsigned short iDim = 0; iDim < nDim; iDim ++) - Normal[iDim] = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++) Normal[iDim] = 0.0; } /*! @@ -137,58 +135,53 @@ class CVertex : public CDualGrid { * \param[in] val_face_normal - Vector to initialize the normal vector. * \return Value of the normal vector. */ - inline void SetNormal(const su2double *val_face_normal) override { - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Normal[iDim]=val_face_normal[iDim]; + inline void SetNormal(const su2double* val_face_normal) override { + for (unsigned short iDim = 0; iDim < nDim; iDim++) Normal[iDim] = val_face_normal[iDim]; } /*! * \brief Add a vector to the normal vector. * \param[in] val_face_normal - Vector to add to the normal vector. */ - inline void AddNormal(const su2double *val_face_normal) override { - for(unsigned short iDim = 0; iDim < nDim; iDim++) - Normal[iDim] += val_face_normal[iDim]; + inline void AddNormal(const su2double* val_face_normal) override { + for (unsigned short iDim = 0; iDim < nDim; iDim++) Normal[iDim] += val_face_normal[iDim]; } /*! * \brief Set the value of the coordinate variation due to a surface modification. * \param[in] val_varcoord - Variation of the coordinate. */ - inline void SetVarCoord(const su2double *val_varcoord) { - for (unsigned short iDim = 0; iDim < nDim; iDim++) - VarCoord[iDim] = val_varcoord[iDim]; + inline void SetVarCoord(const su2double* val_varcoord) { + for (unsigned short iDim = 0; iDim < nDim; iDim++) VarCoord[iDim] = val_varcoord[iDim]; } /*! * \brief Add the value of the coordinate variation due to a surface modification. * \param[in] val_varcoord - Variation of the coordinate. */ - inline void AddVarCoord(const su2double *val_varcoord) { - for (unsigned short iDim = 0; iDim < nDim; iDim++) - VarCoord[iDim] += val_varcoord[iDim]; + inline void AddVarCoord(const su2double* val_varcoord) { + for (unsigned short iDim = 0; iDim < nDim; iDim++) VarCoord[iDim] += val_varcoord[iDim]; } /*! * \brief Get the value of the coordinate variation due to a surface modification. * \return Variation of the coordinate. */ - inline su2double *GetVarCoord(void) { return VarCoord; } + inline su2double* GetVarCoord(void) { return VarCoord; } /*! * \brief Set the value of the cartesian coordinate for the vertex. * \param[in] val_coord - Value of the cartesian coordinate. */ - inline void SetCoord(const su2double *val_coord) override { - for (unsigned short iDim = 0; iDim < nDim; iDim++) - CartCoord[iDim] = val_coord[iDim]; + inline void SetCoord(const su2double* val_coord) override { + for (unsigned short iDim = 0; iDim < nDim; iDim++) CartCoord[iDim] = val_coord[iDim]; } /*! * \brief Get the value of the cartesian coordinate for the vertex. * \return Value of the cartesian coordinate of the vertex. */ - inline su2double *GetCoord(void) override { return CartCoord; } + inline su2double* GetCoord(void) override { return CartCoord; } /*! * \brief Get the value of the cartesian coordinate for the vertex. @@ -293,7 +286,7 @@ class CVertex : public CDualGrid { * \brief Get the value of the periodic point of a vertex, and its somain * \return Value of the periodic point of a vertex, and the domain. */ - inline long *GetPeriodicPointDomain(void) { return PeriodicPoint; } + inline long* GetPeriodicPointDomain(void) { return PeriodicPoint; } /*! * \brief Get the value of the periodic point of a vertex, and its somain @@ -326,5 +319,4 @@ class CVertex : public CDualGrid { * \return Index of the closest neighbor. */ inline unsigned long GetNormal_Neighbor(void) const { return Normal_Neighbor; } - }; diff --git a/Common/include/geometry/elements/CElement.hpp b/Common/include/geometry/elements/CElement.hpp index e69e1e586e6..7c30c56ea97 100644 --- a/Common/include/geometry/elements/CElement.hpp +++ b/Common/include/geometry/elements/CElement.hpp @@ -3,7 +3,7 @@ * \brief Main header of the Finite Element structure declaring the abstract * interface and the available finite element types. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -56,39 +56,40 @@ * \author R. Sanchez */ class CElement { -protected: - enum : size_t {MAXNDIM = 3}; + protected: + enum : size_t { MAXNDIM = 3 }; - std::vector GaussPoint; /*!< \brief Vector of Gaussian Points. */ + std::vector GaussPoint; /*!< \brief Vector of Gaussian Points. */ - su2activematrix CurrentCoord; /*!< \brief Coordinates in the current frame. */ - su2activematrix RefCoord; /*!< \brief Coordinates in the reference frame. */ - su2activevector GaussWeight; /*!< \brief Weight of the Gaussian Points for the integration. */ - su2activematrix NodalExtrap; /*!< \brief Coordinates of the nodal points for Gaussian extrapolation. */ - su2activematrix NodalStress; /*!< \brief Stress at the nodes. */ + su2activematrix CurrentCoord; /*!< \brief Coordinates in the current frame. */ + su2activematrix RefCoord; /*!< \brief Coordinates in the reference frame. */ + su2activevector GaussWeight; /*!< \brief Weight of the Gaussian Points for the integration. */ + su2activematrix NodalExtrap; /*!< \brief Coordinates of the nodal points for Gaussian extrapolation. */ + su2activematrix NodalStress; /*!< \brief Stress at the nodes. */ /*--- Stiffness and load matrices. ---*/ - std::vector Kab; /*!< \brief Structure for the constitutive component of the tangent matrix. */ - su2activematrix Mab; /*!< \brief Structure for the nodal components of the mass matrix. */ - su2activematrix Ks_ab; /*!< \brief Structure for the stress component of the tangent matrix. */ - su2activematrix Kt_a; /*!< \brief Matrix of nodal stress terms for residual computation. */ - su2activematrix FDL_a; /*!< \brief Matrix of dead loads for residual computation. */ + std::vector Kab; /*!< \brief Structure for the constitutive component of the tangent matrix. */ + su2activematrix Mab; /*!< \brief Structure for the nodal components of the mass matrix. */ + su2activematrix Ks_ab; /*!< \brief Structure for the stress component of the tangent matrix. */ + su2activematrix Kt_a; /*!< \brief Matrix of nodal stress terms for residual computation. */ + su2activematrix FDL_a; /*!< \brief Matrix of dead loads for residual computation. */ - su2double el_Pressure = 0.0; /*!< \brief Pressure in the element. */ + su2double el_Pressure = 0.0; /*!< \brief Pressure in the element. */ - unsigned long iProp = 0; /*!< \brief ID of the Element Property. */ - unsigned long iDV = 0; /*!< \brief ID of the Design Variable (if it is element based). */ - unsigned long iDe = 0; /*!< \brief ID of the dielectric elastomer. */ + unsigned long iProp = 0; /*!< \brief ID of the Element Property. */ + unsigned long iDV = 0; /*!< \brief ID of the Design Variable (if it is element based). */ + unsigned long iDe = 0; /*!< \brief ID of the dielectric elastomer. */ - unsigned short nGaussPoints; /*!< \brief Number of gaussian points. */ - unsigned short nNodes; /*!< \brief Number of geometric points. */ - unsigned short nDim; /*!< \brief Number of dimension of the problem. */ + unsigned short nGaussPoints; /*!< \brief Number of gaussian points. */ + unsigned short nNodes; /*!< \brief Number of geometric points. */ + unsigned short nDim; /*!< \brief Number of dimension of the problem. */ - su2activematrix HiHj = 0.0; /*!< \brief Scalar product of 2 ansatz functions. */ - std::vector> DHiDHj; /*!< \brief Scalar product of the gradients of 2 ansatz functions. */ + su2activematrix HiHj = 0.0; /*!< \brief Scalar product of 2 ansatz functions. */ + std::vector> + DHiDHj; /*!< \brief Scalar product of the gradients of 2 ansatz functions. */ -public: - enum FrameType {REFERENCE=1, CURRENT=2}; /*!< \brief Type of nodal coordinates. */ + public: + enum FrameType { REFERENCE = 1, CURRENT = 2 }; /*!< \brief Type of nodal coordinates. */ /*! * \brief Default constructor of the class, deleted to make sure derived @@ -136,13 +137,13 @@ class CElement { * \brief Retrieve the number of nodes of the element. * \return Number of nodes of the element. */ - inline unsigned short GetnNodes(void) const {return nNodes;} + inline unsigned short GetnNodes(void) const { return nNodes; } /*! * \brief Retrieve the number of nodes of the element. * \return Number of Gaussian Points of the element. */ - inline unsigned short GetnGaussPoints(void) const {return nGaussPoints;} + inline unsigned short GetnGaussPoints(void) const { return nGaussPoints; } /*! * \brief Set the value of the coordinate of the nodes in the reference configuration. @@ -151,7 +152,7 @@ class CElement { * \param[in] val_CoordRef - Value of the coordinate. */ inline void SetRef_Coord(unsigned short iNode, unsigned short iDim, su2double val_CoordRef) { - RefCoord(iNode,iDim) = val_CoordRef; + RefCoord(iNode, iDim) = val_CoordRef; } /*! @@ -161,7 +162,7 @@ class CElement { * \param[in] val_CoordRef - Value of the coordinate. */ inline void SetCurr_Coord(unsigned short iNode, unsigned short iDim, su2double val_CoordCurr) { - CurrentCoord(iNode,iDim) = val_CoordCurr; + CurrentCoord(iNode, iDim) = val_CoordCurr; } /*! @@ -170,9 +171,7 @@ class CElement { * \param[in] iDim - Dimension. * \return Reference coordinate. */ - inline su2double GetRef_Coord(unsigned short iNode, unsigned short iDim) const { - return RefCoord(iNode,iDim); - } + inline su2double GetRef_Coord(unsigned short iNode, unsigned short iDim) const { return RefCoord(iNode, iDim); } /*! * \brief Get the value of the coordinate of the nodes in the current configuration. @@ -180,36 +179,28 @@ class CElement { * \param[in] iDim - Dimension. * \return Current coordinate. */ - inline su2double GetCurr_Coord(unsigned short iNode, unsigned short iDim) const { - return CurrentCoord(iNode,iDim); - } + inline su2double GetCurr_Coord(unsigned short iNode, unsigned short iDim) const { return CurrentCoord(iNode, iDim); } /*! * \brief Get the weight of the corresponding Gaussian Point. * \param[in] iGauss - index of the Gaussian point. * \return Weight. */ - inline su2double GetWeight(unsigned short iGauss) const { - return GaussWeight(iGauss); - } + inline su2double GetWeight(unsigned short iGauss) const { return GaussWeight(iGauss); } /*! * \brief Get the Jacobian respect to the reference configuration for the Gaussian Point iGauss. * \param[in] iGauss - index of the Gaussian point. * \return Jacobian. */ - inline su2double GetJ_X(unsigned short iGauss) const { - return GaussPoint[iGauss].GetJ_X(); - } + inline su2double GetJ_X(unsigned short iGauss) const { return GaussPoint[iGauss].GetJ_X(); } /*! * \brief Get the jacobian respect to the current configuration for the Gaussian Point iGauss. * \param[in] iGauss - index of the Gaussian point. * \return Jacobian. */ - inline su2double GetJ_x(unsigned short iGauss) const { - return GaussPoint[iGauss].GetJ_x(); - } + inline su2double GetJ_x(unsigned short iGauss) const { return GaussPoint[iGauss].GetJ_x(); } /*! * \brief Retrieve the value of the pressure in the element for incompressible materials. @@ -223,9 +214,7 @@ class CElement { * \param[in] nodeB - index of Node b. * \param[in] val_Ks_ab - value of the term that will constitute the diagonal of the stress contribution. */ - inline void Add_Mab(unsigned short nodeA, unsigned short nodeB, su2double val_Mab) { - Mab(nodeA,nodeB) += val_Mab; - } + inline void Add_Mab(unsigned short nodeA, unsigned short nodeB, su2double val_Mab) { Mab(nodeA, nodeB) += val_Mab; } /*! * \brief Add the value of a submatrix K relating nodes a and b, for the constitutive term. @@ -233,22 +222,19 @@ class CElement { * \param[in] nodeB - index of Node b. * \param[in] val_Kab - value of the matrix K. */ - inline void Add_Kab(unsigned short nodeA, unsigned short nodeB, su2double **val_Kab) { + inline void Add_Kab(unsigned short nodeA, unsigned short nodeB, su2double** val_Kab) { for (unsigned short iDim = 0; iDim < nDim; iDim++) - for (unsigned short jDim = 0; jDim < nDim; jDim++) - Kab[nodeA](nodeB, iDim*nDim+jDim) += val_Kab[iDim][jDim]; + for (unsigned short jDim = 0; jDim < nDim; jDim++) Kab[nodeA](nodeB, iDim * nDim + jDim) += val_Kab[iDim][jDim]; } /*! - * \brief Add the value of a submatrix K relating nodes a and b, for the constitutive term (symmetric terms need transpose) - * \param[in] nodeA - index of Node a. - * \param[in] nodeB - index of Node b. - * \param[in] val_Kab - value of the matrix K. + * \brief Add the value of a submatrix K relating nodes a and b, for the constitutive term (symmetric terms need + * transpose) \param[in] nodeA - index of Node a. \param[in] nodeB - index of Node b. \param[in] val_Kab - value of + * the matrix K. */ - inline void Add_Kab_T(unsigned short nodeA, unsigned short nodeB, su2double **val_Kab) { + inline void Add_Kab_T(unsigned short nodeA, unsigned short nodeB, su2double** val_Kab) { for (unsigned short iDim = 0; iDim < nDim; iDim++) - for (unsigned short jDim = 0; jDim < nDim; jDim++) - Kab[nodeA](nodeB, iDim*nDim+jDim) += val_Kab[jDim][iDim]; + for (unsigned short jDim = 0; jDim < nDim; jDim++) Kab[nodeA](nodeB, iDim * nDim + jDim) += val_Kab[jDim][iDim]; } /*! @@ -258,7 +244,7 @@ class CElement { * \param[in] val_Ks_ab - value of the term that will constitute the diagonal of the stress contribution. */ inline void Add_Ks_ab(unsigned short nodeA, unsigned short nodeB, su2double val_Ks_ab) { - Ks_ab(nodeA,nodeB) += val_Ks_ab; + Ks_ab(nodeA, nodeB) += val_Ks_ab; } /*! @@ -266,9 +252,8 @@ class CElement { * \param[in] nodeA - index of Node a. * \param[in] val_Kt_a - value of the term that will constitute the diagonal of the stress contribution. */ - inline void Add_Kt_a(unsigned short nodeA, const su2double *val_Kt_a) { - for(unsigned short iDim = 0; iDim < nDim; iDim++) - Kt_a(nodeA,iDim) += val_Kt_a[iDim]; + inline void Add_Kt_a(unsigned short nodeA, const su2double* val_Kt_a) { + for (unsigned short iDim = 0; iDim < nDim; iDim++) Kt_a(nodeA, iDim) += val_Kt_a[iDim]; } /*! @@ -276,15 +261,14 @@ class CElement { * \param[in] nodeA - index of Node a. * \param[in] val_FDL_a - value of the term that will constitute the diagonal of the stress contribution. */ - inline void Add_FDL_a(unsigned short nodeA, const su2double *val_FDL_a) { - for(unsigned short iDim = 0; iDim < nDim; iDim++) - FDL_a(nodeA,iDim) += val_FDL_a[iDim]; + inline void Add_FDL_a(unsigned short nodeA, const su2double* val_FDL_a) { + for (unsigned short iDim = 0; iDim < nDim; iDim++) FDL_a(nodeA, iDim) += val_FDL_a[iDim]; } /*! * \brief Restarts the values of stress in the element. */ - inline void ClearStress(void) {NodalStress.setConstant(0.0);} + inline void ClearStress(void) { NodalStress.setConstant(0.0); } /*! * \brief Return the value of the diagonal term for the mass matrix, relating nodes a and b. @@ -292,9 +276,7 @@ class CElement { * \param[in] nodeB - index of Node b. * \return Value of the diagonal term of Mab. */ - inline su2double Get_Mab(unsigned short nodeA, unsigned short nodeB) const { - return Mab(nodeA,nodeB); - } + inline su2double Get_Mab(unsigned short nodeA, unsigned short nodeB) const { return Mab(nodeA, nodeB); } /*! * \brief Return the value of the submatrix K relating nodes a and b. @@ -302,9 +284,7 @@ class CElement { * \param[in] nodeB - index of Node b. * \return Values of the matrix K. */ - inline const su2double *Get_Kab(unsigned short nodeA, unsigned short nodeB) const { - return Kab[nodeA][nodeB]; - } + inline const su2double* Get_Kab(unsigned short nodeA, unsigned short nodeB) const { return Kab[nodeA][nodeB]; } /*! * \brief Return the value of the diagonal term for the stress contribution, relating nodes a and b. @@ -312,27 +292,21 @@ class CElement { * \param[in] nodeB - index of Node b. * \return Value of the matrix Ks. */ - inline su2double Get_Ks_ab(unsigned short nodeA, unsigned short nodeB) const { - return Ks_ab(nodeA,nodeB); - } + inline su2double Get_Ks_ab(unsigned short nodeA, unsigned short nodeB) const { return Ks_ab(nodeA, nodeB); } /*! * \brief Return the values of the nodal stress components of the residual for node a. * \param[in] nodeA - index of Node a. * \return Values of the stress term. */ - inline const su2double *Get_Kt_a(unsigned short nodeA) const { - return Kt_a[nodeA]; - } + inline const su2double* Get_Kt_a(unsigned short nodeA) const { return Kt_a[nodeA]; } /*! * \brief Return the values of the dead load components of the residual for node a. * \param[in] nodeA - index of Node a. * \return Value of the dead loads. */ - inline const su2double *Get_FDL_a(unsigned short nodeA) const { - return FDL_a[nodeA]; - } + inline const su2double* Get_FDL_a(unsigned short nodeA) const { return FDL_a[nodeA]; } /*! * \brief Retrieve the value of the shape functions. @@ -340,9 +314,7 @@ class CElement { * \param[in] iGauss - Index of the Gaussian Point. * \return Gradient of the shape function related to node iNode and evaluated at Gaussian Point iGauss */ - inline su2double GetNi(unsigned short iNode, unsigned short iGauss) const { - return GaussPoint[iGauss].GetNi(iNode); - } + inline su2double GetNi(unsigned short iNode, unsigned short iGauss) const { return GaussPoint[iGauss].GetNi(iNode); } /*! * \brief Retrieve the value of the gradient of the shape functions respect to the reference configuration. @@ -352,7 +324,7 @@ class CElement { * \return Gradient of the shape function related to node iNode and evaluated at Gaussian Point iGauss */ inline su2double GetGradNi_X(unsigned short iNode, unsigned short iGauss, unsigned short iDim) const { - return GaussPoint[iGauss].GetGradNi_Xj(iNode,iDim); + return GaussPoint[iGauss].GetGradNi_Xj(iNode, iDim); } /*! @@ -363,7 +335,7 @@ class CElement { * \return Gradient of the shape function related to node iNode and evaluated at Gaussian Point iGauss */ inline su2double GetGradNi_x(unsigned short iNode, unsigned short iGauss, unsigned short iDim) const { - return GaussPoint[iGauss].GetGradNi_xj(iNode,iDim); + return GaussPoint[iGauss].GetGradNi_xj(iNode, iDim); } /*! @@ -373,7 +345,7 @@ class CElement { * \return Value of the shape function at the nodes for extrapolation purposes */ inline su2double GetNi_Extrap(unsigned short iNode, unsigned short iGauss) const { - return NodalExtrap(iNode,iGauss); + return NodalExtrap(iNode, iGauss); } /*! @@ -383,7 +355,7 @@ class CElement { * \param[in] val_Stress - Value of the stress added. */ inline void Add_NodalStress(unsigned short iNode, unsigned short iVar, su2double val_Stress) { - NodalStress(iNode,iVar) += val_Stress; + NodalStress(iNode, iVar) += val_Stress; } /*! @@ -392,76 +364,74 @@ class CElement { * \param[in] iVar - Variable index. * \return Value of the stress. */ - inline su2double Get_NodalStress(unsigned short iNode, unsigned short iVar) const { - return NodalStress(iNode,iVar); - } + inline su2double Get_NodalStress(unsigned short iNode, unsigned short iVar) const { return NodalStress(iNode, iVar); } /*! * \brief Store the values of the identifiers for element properties. * \param[in] element_property - element properties container. */ - inline void Set_ElProperties(const CProperty *element_property) { - iDV = element_property->GetDV(); + inline void Set_ElProperties(const CProperty* element_property) { + iDV = element_property->GetDV(); iProp = element_property->GetMat_Prop(); - iDe = element_property->GetElectric_Prop(); + iDe = element_property->GetElectric_Prop(); } /*! * \brief Store the value of the identifier for the Dielectric Elastomers. * \param[in] val_iDe - identifier of the DE property. */ - inline void Set_iDe(unsigned long val_iDe) {iDe = val_iDe;} + inline void Set_iDe(unsigned long val_iDe) { iDe = val_iDe; } /*! * \brief Return the value of the identifier for the Dielectric Elastomers. * \return Identifier of the DE property. */ - inline unsigned long Get_iDe(void) const {return iDe;} + inline unsigned long Get_iDe(void) const { return iDe; } /*! * \brief Return the value of the identifier for the Design Variable. * \return Identifier of the DV. */ - inline unsigned long Get_iDV(void) const {return iDV;} + inline unsigned long Get_iDV(void) const { return iDV; } /*! * \brief Return the value of the identifier for the Element Property. * \return Identifier of the property. */ - inline unsigned long Get_iProp(void) const {return iProp;} + inline unsigned long Get_iProp(void) const { return iProp; } /*! * \brief Compute the value of the length of the element. * \param[in] mode - Type of coordinates to consider in the computation. * \return Length of the (1D) element. */ - inline virtual su2double ComputeLength(const FrameType mode = REFERENCE) const {return 0.0;} + inline virtual su2double ComputeLength(const FrameType mode = REFERENCE) const { return 0.0; } /*! * \brief Compute the value of the area of the element. * \param[in] mode - Type of coordinates to consider in the computation. * \return Area of the (2D) element. */ - inline virtual su2double ComputeArea(const FrameType mode = REFERENCE) const {return 0.0;} + inline virtual su2double ComputeArea(const FrameType mode = REFERENCE) const { return 0.0; } /*! * \brief Compute the value of the volume of the element. * \param[in] mode - Type of coordinates to consider in the computation. * \return Volume of the (3D) element. */ - inline virtual su2double ComputeVolume(const FrameType mode = REFERENCE) const {return 0.0;} + inline virtual su2double ComputeVolume(const FrameType mode = REFERENCE) const { return 0.0; } /*! * \brief Compute the value of the area of the element in current coordinates (wrapper to ComputeArea(CURRENT)). * \return Current area of the (2D) element. */ - inline su2double ComputeCurrentArea(void) const {return ComputeArea(CURRENT);} + inline su2double ComputeCurrentArea(void) const { return ComputeArea(CURRENT); } /*! * \brief Compute the value of the volume of the element in current coordinates (wrapper to ComputeVolume(CURRENT)). * \return Current volume of the (3D) element. */ - inline su2double ComputeCurrentVolume(void) const {return ComputeVolume(CURRENT);} + inline su2double ComputeCurrentVolume(void) const { return ComputeVolume(CURRENT); } /*! * \brief Register the current and reference coordinates of the element as pre-accumulation inputs @@ -469,39 +439,32 @@ class CElement { * because inactive variables are ignored. */ inline void SetPreaccIn_Coords(bool nonlinear = true) { - AD::SetPreaccIn(RefCoord.data(), nNodes*MAXNDIM); - if (nonlinear) - AD::SetPreaccIn(CurrentCoord.data(), nNodes*MAXNDIM); + AD::SetPreaccIn(RefCoord.data(), nNodes * MAXNDIM); + if (nonlinear) AD::SetPreaccIn(CurrentCoord.data(), nNodes * MAXNDIM); } /*! * \brief Register the stress residual as a pre-accumulation output. When computing the element * stiffness matrix this is the only term that sees its way into the RHS of the system. */ - inline void SetPreaccOut_Kt_a(void) { - AD::SetPreaccOut(Kt_a.data(), nNodes*nDim); - } + inline void SetPreaccOut_Kt_a(void) { AD::SetPreaccOut(Kt_a.data(), nNodes * nDim); } /*! * \brief Register the mass matrix as a pre-accumulation output. */ - inline void SetPreaccOut_Mab(void) { - AD::SetPreaccOut(Mab.data(), nNodes*nNodes); - } + inline void SetPreaccOut_Mab(void) { AD::SetPreaccOut(Mab.data(), nNodes * nNodes); } /*! * \brief Register the dead load as a pre-accumulation output. */ - inline void SetPreaccOut_FDL_a(void) { - AD::SetPreaccOut(FDL_a.data(), nNodes*nDim); - } + inline void SetPreaccOut_FDL_a(void) { AD::SetPreaccOut(FDL_a.data(), nNodes * nDim); } - /*! - * \brief Add the scalar product of the shape functions to the tangent matrix. - * \param[in] nodeA - index of Node a. - * \param[in] nodeB - index of Node b. - * \param[in] val - value of the scalar product of ansatz function. - */ + /*! + * \brief Add the scalar product of the shape functions to the tangent matrix. + * \param[in] nodeA - index of Node a. + * \param[in] nodeB - index of Node b. + * \param[in] val - value of the scalar product of ansatz function. + */ inline void Add_HiHj(su2double val, unsigned short nodeA, unsigned short nodeB) { HiHj[nodeA][nodeB] += val; } /*! @@ -520,12 +483,12 @@ class CElement { } } - /*! - * \brief Add the transposed scalar product of the gradients of shape functions to the tangent matrix. - * \param[in] nodeA - index of Node a. - * \param[in] nodeB - index of Node b. - * \param[in] val - value of the term that will contribute. - */ + /*! + * \brief Add the transposed scalar product of the gradients of shape functions to the tangent matrix. + * \param[in] nodeA - index of Node a. + * \param[in] nodeB - index of Node b. + * \param[in] val - value of the term that will contribute. + */ template inline void Add_DHiDHj_T(const MatrixType& val, unsigned short nodeA, unsigned short nodeB) { unsigned short iDim, jDim; @@ -536,22 +499,21 @@ class CElement { } } - /*! - * \brief Get the scalar product of the shape functions to the tangent matrix. - * \param[in] nodeA - index of Node a. - * \param[in] nodeB - index of Node b. - * \param[out] val - value of the scalar product of ansatz function. - */ - inline su2double Get_HiHj(unsigned short nodeA, unsigned short nodeB) { return HiHj[nodeA][nodeB]; } - - /*! - * \brief Get the scalar product of the gradients of shape functions to the tangent matrix. - * \param[in] nodeA - index of Node a. - * \param[in] nodeB - index of Node b. - * \return val - value of the scalar product of gradients of ansatz function. - */ - inline su2activematrix& Get_DHiDHj(unsigned short nodeA, unsigned short nodeB) { return DHiDHj[nodeA][nodeB];} + /*! + * \brief Get the scalar product of the shape functions to the tangent matrix. + * \param[in] nodeA - index of Node a. + * \param[in] nodeB - index of Node b. + * \param[out] val - value of the scalar product of ansatz function. + */ + inline su2double Get_HiHj(unsigned short nodeA, unsigned short nodeB) { return HiHj[nodeA][nodeB]; } + /*! + * \brief Get the scalar product of the gradients of shape functions to the tangent matrix. + * \param[in] nodeA - index of Node a. + * \param[in] nodeB - index of Node b. + * \return val - value of the scalar product of gradients of ansatz function. + */ + inline su2activematrix& Get_DHiDHj(unsigned short nodeA, unsigned short nodeB) { return DHiDHj[nodeA][nodeB]; } }; /*! @@ -560,10 +522,9 @@ class CElement { * \brief Templated class to implement the computation of gradients for specific element sizes. * \author P. Gomes, R. Sanchez */ -template +template class CElementWithKnownSizes : public CElement { -private: - + private: FORCEINLINE static su2double JacobianAdjoint(const su2double Jacobian[][1], su2double ad[][1]) { /*--- Adjoint to Jacobian, we put 1.0 here so that ad/detJac is the inverse later ---*/ ad[0][0] = 1.0; @@ -572,28 +533,30 @@ class CElementWithKnownSizes : public CElement { } FORCEINLINE static su2double JacobianAdjoint(const su2double Jacobian[][2], su2double ad[][2]) { - ad[0][0] = Jacobian[1][1]; ad[0][1] = -Jacobian[0][1]; - ad[1][0] = -Jacobian[1][0]; ad[1][1] = Jacobian[0][0]; + ad[0][0] = Jacobian[1][1]; + ad[0][1] = -Jacobian[0][1]; + ad[1][0] = -Jacobian[1][0]; + ad[1][1] = Jacobian[0][0]; /*--- Determinant of Jacobian ---*/ - return ad[0][0]*ad[1][1]-ad[0][1]*ad[1][0]; + return ad[0][0] * ad[1][1] - ad[0][1] * ad[1][0]; } FORCEINLINE static su2double JacobianAdjoint(const su2double Jacobian[][3], su2double ad[][3]) { - ad[0][0] = Jacobian[1][1]*Jacobian[2][2]-Jacobian[1][2]*Jacobian[2][1]; - ad[0][1] = Jacobian[0][2]*Jacobian[2][1]-Jacobian[0][1]*Jacobian[2][2]; - ad[0][2] = Jacobian[0][1]*Jacobian[1][2]-Jacobian[0][2]*Jacobian[1][1]; - ad[1][0] = Jacobian[1][2]*Jacobian[2][0]-Jacobian[1][0]*Jacobian[2][2]; - ad[1][1] = Jacobian[0][0]*Jacobian[2][2]-Jacobian[0][2]*Jacobian[2][0]; - ad[1][2] = Jacobian[0][2]*Jacobian[1][0]-Jacobian[0][0]*Jacobian[1][2]; - ad[2][0] = Jacobian[1][0]*Jacobian[2][1]-Jacobian[1][1]*Jacobian[2][0]; - ad[2][1] = Jacobian[0][1]*Jacobian[2][0]-Jacobian[0][0]*Jacobian[2][1]; - ad[2][2] = Jacobian[0][0]*Jacobian[1][1]-Jacobian[0][1]*Jacobian[1][0]; + ad[0][0] = Jacobian[1][1] * Jacobian[2][2] - Jacobian[1][2] * Jacobian[2][1]; + ad[0][1] = Jacobian[0][2] * Jacobian[2][1] - Jacobian[0][1] * Jacobian[2][2]; + ad[0][2] = Jacobian[0][1] * Jacobian[1][2] - Jacobian[0][2] * Jacobian[1][1]; + ad[1][0] = Jacobian[1][2] * Jacobian[2][0] - Jacobian[1][0] * Jacobian[2][2]; + ad[1][1] = Jacobian[0][0] * Jacobian[2][2] - Jacobian[0][2] * Jacobian[2][0]; + ad[1][2] = Jacobian[0][2] * Jacobian[1][0] - Jacobian[0][0] * Jacobian[1][2]; + ad[2][0] = Jacobian[1][0] * Jacobian[2][1] - Jacobian[1][1] * Jacobian[2][0]; + ad[2][1] = Jacobian[0][1] * Jacobian[2][0] - Jacobian[0][0] * Jacobian[2][1]; + ad[2][2] = Jacobian[0][0] * Jacobian[1][1] - Jacobian[0][1] * Jacobian[1][0]; /*--- Determinant of Jacobian ---*/ - return Jacobian[0][0]*ad[0][0]+Jacobian[0][1]*ad[1][0]+Jacobian[0][2]*ad[2][0]; + return Jacobian[0][0] * ad[0][0] + Jacobian[0][1] * ad[1][0] + Jacobian[0][2] * ad[2][0]; } -protected: - static_assert(NDIM==1 || NDIM==2 || NDIM==3, "ComputeGrad_impl expects 1D, 2D or 3D"); + protected: + static_assert(NDIM == 1 || NDIM == 2 || NDIM == 3, "ComputeGrad_impl expects 1D, 2D or 3D"); su2double GaussCoord[NGAUSS][NDIM]; /*!< \brief Coordinates of the integration points. */ su2double dNiXj[NGAUSS][NNODE][NDIM]; /*!< \brief Shape function derivatives evaluated at the Gauss points. */ @@ -609,31 +572,27 @@ class CElementWithKnownSizes : public CElement { * \brief Implementation of gradient computation leveraging the static sizes. * \param[in] FRAME - template, REFERENCE or CURRENT coordinates. */ - template + template void ComputeGrad_impl(void) { - su2double Jacobian[NDIM][NDIM], ad[NDIM][NDIM]; unsigned short iNode, iDim, jDim, iGauss; /*--- Select the appropriate source for the nodal coordinates depending on the frame requested for the gradient computation, REFERENCE (undeformed) or CURRENT (deformed) ---*/ - const su2activematrix& Coord = (FRAME==REFERENCE) ? RefCoord : CurrentCoord; + const su2activematrix& Coord = (FRAME == REFERENCE) ? RefCoord : CurrentCoord; for (iGauss = 0; iGauss < NGAUSS; iGauss++) { - /*--- Jacobian transformation ---*/ /*--- This does dX/dXi transpose ---*/ for (iDim = 0; iDim < NDIM; iDim++) - for (jDim = 0; jDim < NDIM; jDim++) - Jacobian[iDim][jDim] = 0.0; + for (jDim = 0; jDim < NDIM; jDim++) Jacobian[iDim][jDim] = 0.0; for (iNode = 0; iNode < NNODE; iNode++) for (iDim = 0; iDim < NDIM; iDim++) - for (jDim = 0; jDim < NDIM; jDim++) - Jacobian[iDim][jDim] += Coord(iNode,jDim) * dNiXj[iGauss][iNode][iDim]; + for (jDim = 0; jDim < NDIM; jDim++) Jacobian[iDim][jDim] += Coord(iNode, jDim) * dNiXj[iGauss][iNode][iDim]; - if (NDIM==1) { + if (NDIM == 1) { /*--- Obviously the Jacobian is the slope of the line ---*/ Jacobian[0][0] = (Coord[1][0] - Coord[0][0]); } @@ -642,7 +601,7 @@ class CElementWithKnownSizes : public CElement { auto detJac = JacobianAdjoint(Jacobian, ad); - if (FRAME==REFERENCE) + if (FRAME == REFERENCE) GaussPoint[iGauss].SetJ_X(detJac); else GaussPoint[iGauss].SetJ_x(detJac); @@ -650,92 +609,84 @@ class CElementWithKnownSizes : public CElement { /*--- Jacobian inverse (it was already computed as transpose) ---*/ for (iDim = 0; iDim < NDIM; iDim++) - for (jDim = 0; jDim < NDIM; jDim++) - Jacobian[iDim][jDim] = ad[iDim][jDim]/detJac; + for (jDim = 0; jDim < NDIM; jDim++) Jacobian[iDim][jDim] = ad[iDim][jDim] / detJac; /*--- Derivatives with respect to global coordinates ---*/ for (iNode = 0; iNode < NNODE; iNode++) { for (iDim = 0; iDim < NDIM; iDim++) { su2double GradNi_Xj = 0.0; - for (jDim = 0; jDim < NDIM; jDim++) - GradNi_Xj += Jacobian[iDim][jDim] * dNiXj[iGauss][iNode][jDim]; + for (jDim = 0; jDim < NDIM; jDim++) GradNi_Xj += Jacobian[iDim][jDim] * dNiXj[iGauss][iNode][jDim]; - if (FRAME==REFERENCE) + if (FRAME == REFERENCE) GaussPoint[iGauss].SetGradNi_Xj(GradNi_Xj, iDim, iNode); else GaussPoint[iGauss].SetGradNi_xj(GradNi_Xj, iDim, iNode); } } - } - } - template + template void ComputeGrad_impl_surf_embedded() { - /*--- Select the appropriate source for the nodal coordinates depending on the frame requested for the gradient computation, REFERENCE (undeformed) or CURRENT (deformed) ---*/ - const su2activematrix& Coord = (FRAME==REFERENCE) ? RefCoord : CurrentCoord; + const su2activematrix& Coord = (FRAME == REFERENCE) ? RefCoord : CurrentCoord; - if (NDIM==1) { + if (NDIM == 1) { unsigned short iNode, iDim, iGauss; su2double Jacobian[2]; su2double val_grad; Jacobian[0] = (Coord[1][0] - Coord[0][0]); Jacobian[1] = (Coord[1][1] - Coord[0][1]); - const su2double JTJ = Jacobian[0]*Jacobian[0]+Jacobian[1]*Jacobian[1]; + const su2double JTJ = Jacobian[0] * Jacobian[0] + Jacobian[1] * Jacobian[1]; const su2double volJacobian = sqrt(JTJ); for (iGauss = 0; iGauss < NGAUSS; iGauss++) { - GaussPoint[iGauss].SetJ_X(volJacobian); for (iNode = 0; iNode < NNODE; iNode++) { - for (iDim=0; iDim(); } - }; /*! @@ -799,13 +748,13 @@ class CElementWithKnownSizes : public CElement { * \brief Tria element with 1 Gauss Points * \author R. Sanchez */ -class CTRIA1 final : public CElementWithKnownSizes<1,3,2> { -private: - enum : unsigned short {NGAUSS = 1}; - enum : unsigned short {NNODE = 3}; - enum : unsigned short {NDIM = 2}; +class CTRIA1 final : public CElementWithKnownSizes<1, 3, 2> { + private: + enum : unsigned short { NGAUSS = 1 }; + enum : unsigned short { NNODE = 3 }; + enum : unsigned short { NDIM = 2 }; -public: + public: /*! * \brief Constructor of the class. */ @@ -817,7 +766,6 @@ class CTRIA1 final : public CElementWithKnownSizes<1,3,2> { * \return Area of the element. */ su2double ComputeArea(const FrameType mode = REFERENCE) const override; - }; /*! @@ -826,13 +774,13 @@ class CTRIA1 final : public CElementWithKnownSizes<1,3,2> { * \brief Quadrilateral element with 4 Gauss Points * \author R. Sanchez */ -class CQUAD4 final : public CElementWithKnownSizes<4,4,2> { -private: - enum : unsigned short {NGAUSS = 4}; - enum : unsigned short {NNODE = 4}; - enum : unsigned short {NDIM = 2}; +class CQUAD4 final : public CElementWithKnownSizes<4, 4, 2> { + private: + enum : unsigned short { NGAUSS = 4 }; + enum : unsigned short { NNODE = 4 }; + enum : unsigned short { NDIM = 2 }; -public: + public: /*! * \brief Constructor of the class. */ @@ -842,20 +790,24 @@ class CQUAD4 final : public CElementWithKnownSizes<4,4,2> { * \brief Shape functions (Ni) evaluated at point Xi,Eta. */ inline static void ShapeFunctions(su2double Xi, su2double Eta, su2double* Ni) { - Ni[0] = 0.25*(1.0-Xi)*(1.0-Eta); - Ni[1] = 0.25*(1.0+Xi)*(1.0-Eta); - Ni[2] = 0.25*(1.0+Xi)*(1.0+Eta); - Ni[3] = 0.25*(1.0-Xi)*(1.0+Eta); + Ni[0] = 0.25 * (1.0 - Xi) * (1.0 - Eta); + Ni[1] = 0.25 * (1.0 + Xi) * (1.0 - Eta); + Ni[2] = 0.25 * (1.0 + Xi) * (1.0 + Eta); + Ni[3] = 0.25 * (1.0 - Xi) * (1.0 + Eta); } /*! * \brief Shape function Jacobian (dNi) evaluated at point Xi,Eta. */ inline static void ShapeFunctionJacobian(su2double Xi, su2double Eta, su2double dNi[][2]) { - dNi[0][0] = -0.25*(1.0-Eta); dNi[0][1] = -0.25*(1.0-Xi); - dNi[1][0] = 0.25*(1.0-Eta); dNi[1][1] = -0.25*(1.0+Xi); - dNi[2][0] = 0.25*(1.0+Eta); dNi[2][1] = 0.25*(1.0+Xi); - dNi[3][0] = -0.25*(1.0+Eta); dNi[3][1] = 0.25*(1.0-Xi); + dNi[0][0] = -0.25 * (1.0 - Eta); + dNi[0][1] = -0.25 * (1.0 - Xi); + dNi[1][0] = 0.25 * (1.0 - Eta); + dNi[1][1] = -0.25 * (1.0 + Xi); + dNi[2][0] = 0.25 * (1.0 + Eta); + dNi[2][1] = 0.25 * (1.0 + Xi); + dNi[3][0] = -0.25 * (1.0 + Eta); + dNi[3][1] = 0.25 * (1.0 - Xi); } /*! @@ -864,7 +816,6 @@ class CQUAD4 final : public CElementWithKnownSizes<4,4,2> { * \return Area of the element. */ su2double ComputeArea(const FrameType mode = REFERENCE) const override; - }; /*! @@ -873,13 +824,13 @@ class CQUAD4 final : public CElementWithKnownSizes<4,4,2> { * \brief Tetrahedral element with 1 Gauss Point * \author R. Sanchez */ -class CTETRA1 final : public CElementWithKnownSizes<1,4,3> { -private: - enum : unsigned short {NGAUSS = 1}; - enum : unsigned short {NNODE = 4}; - enum : unsigned short {NDIM = 3}; +class CTETRA1 final : public CElementWithKnownSizes<1, 4, 3> { + private: + enum : unsigned short { NGAUSS = 1 }; + enum : unsigned short { NNODE = 4 }; + enum : unsigned short { NDIM = 3 }; -public: + public: /*! * \brief Constructor of the class. */ @@ -890,7 +841,6 @@ class CTETRA1 final : public CElementWithKnownSizes<1,4,3> { * \return Volume of the element. */ su2double ComputeVolume(const FrameType mode = REFERENCE) const override; - }; /*! @@ -899,13 +849,13 @@ class CTETRA1 final : public CElementWithKnownSizes<1,4,3> { * \brief Hexahedral element with 8 Gauss Points * \author R. Sanchez */ -class CHEXA8 final : public CElementWithKnownSizes<8,8,3> { -private: - enum : unsigned short {NGAUSS = 8}; - enum : unsigned short {NNODE = 8}; - enum : unsigned short {NDIM = 3}; +class CHEXA8 final : public CElementWithKnownSizes<8, 8, 3> { + private: + enum : unsigned short { NGAUSS = 8 }; + enum : unsigned short { NNODE = 8 }; + enum : unsigned short { NDIM = 3 }; -public: + public: /*! * \brief Constructor of the class. */ @@ -917,7 +867,6 @@ class CHEXA8 final : public CElementWithKnownSizes<8,8,3> { * \return Volume of the element. */ su2double ComputeVolume(const FrameType mode = REFERENCE) const override; - }; /*! @@ -926,13 +875,13 @@ class CHEXA8 final : public CElementWithKnownSizes<8,8,3> { * \brief Pyramid element with 5 Gauss Points * \author R. Sanchez, F. Palacios, A. Bueno, T. Economon, S. Padron. */ -class CPYRAM5 final : public CElementWithKnownSizes<5,5,3> { -private: - enum : unsigned short {NGAUSS = 5}; - enum : unsigned short {NNODE = 5}; - enum : unsigned short {NDIM = 3}; +class CPYRAM5 final : public CElementWithKnownSizes<5, 5, 3> { + private: + enum : unsigned short { NGAUSS = 5 }; + enum : unsigned short { NNODE = 5 }; + enum : unsigned short { NDIM = 3 }; -public: + public: /*! * \brief Constructor of the class. */ @@ -944,7 +893,6 @@ class CPYRAM5 final : public CElementWithKnownSizes<5,5,3> { * \return Volume of the element. */ su2double ComputeVolume(const FrameType mode = REFERENCE) const override; - }; /*! @@ -952,15 +900,15 @@ class CPYRAM5 final : public CElementWithKnownSizes<5,5,3> { * \ingroup FemAlgos * \brief Prism element with 6 Gauss Points * \author R. Sanchez, F. Palacios, A. Bueno, T. Economon, S. Padron. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ -class CPRISM6 final : public CElementWithKnownSizes<6,6,3> { -private: - enum : unsigned short {NGAUSS = 6}; - enum : unsigned short {NNODE = 6}; - enum : unsigned short {NDIM = 3}; +class CPRISM6 final : public CElementWithKnownSizes<6, 6, 3> { + private: + enum : unsigned short { NGAUSS = 6 }; + enum : unsigned short { NNODE = 6 }; + enum : unsigned short { NDIM = 3 }; -public: + public: /*! * \brief Constructor of the class. */ @@ -972,7 +920,6 @@ class CPRISM6 final : public CElementWithKnownSizes<6,6,3> { * \return Volume of the element. */ su2double ComputeVolume(const FrameType mode = REFERENCE) const override; - }; /*! @@ -981,13 +928,13 @@ class CPRISM6 final : public CElementWithKnownSizes<6,6,3> { * \brief Tria element with 3 Gauss Points * \author T.Dick */ -class CTRIA3 final : public CElementWithKnownSizes<3,3,2> { -private: - enum : unsigned short {NGAUSS = 3}; - enum : unsigned short {NNODE = 3}; - enum : unsigned short {NDIM = 2}; +class CTRIA3 final : public CElementWithKnownSizes<3, 3, 2> { + private: + enum : unsigned short { NGAUSS = 3 }; + enum : unsigned short { NNODE = 3 }; + enum : unsigned short { NDIM = 2 }; -public: + public: /*! * \brief Constructor of the class. */ @@ -999,7 +946,6 @@ class CTRIA3 final : public CElementWithKnownSizes<3,3,2> { * \return Area of the element. */ su2double ComputeArea(const FrameType mode = REFERENCE) const override; - }; /*! @@ -1008,13 +954,13 @@ class CTRIA3 final : public CElementWithKnownSizes<3,3,2> { * \brief Tetrahedral element with 4 Gauss Points * \author T.Dick */ -class CTETRA4 final : public CElementWithKnownSizes<4,4,3> { -private: - enum : unsigned short {NGAUSS = 4}; - enum : unsigned short {NNODE = 4}; - enum : unsigned short {NDIM = 3}; +class CTETRA4 final : public CElementWithKnownSizes<4, 4, 3> { + private: + enum : unsigned short { NGAUSS = 4 }; + enum : unsigned short { NNODE = 4 }; + enum : unsigned short { NDIM = 3 }; -public: + public: /*! * \brief Constructor of the class. */ @@ -1026,7 +972,6 @@ class CTETRA4 final : public CElementWithKnownSizes<4,4,3> { * \return Area of the element. */ su2double ComputeVolume(const FrameType mode = REFERENCE) const override; - }; /*! @@ -1035,13 +980,13 @@ class CTETRA4 final : public CElementWithKnownSizes<4,4,3> { * \brief Pyramid element with 6 Gauss Points * \author T.Dick */ -class CPYRAM6 final : public CElementWithKnownSizes<6,5,3> { -private: - enum : unsigned short {NGAUSS = 6}; - enum : unsigned short {NNODE = 5}; - enum : unsigned short {NDIM = 3}; +class CPYRAM6 final : public CElementWithKnownSizes<6, 5, 3> { + private: + enum : unsigned short { NGAUSS = 6 }; + enum : unsigned short { NNODE = 5 }; + enum : unsigned short { NDIM = 3 }; -public: + public: /*! * \brief Constructor of the class. */ @@ -1053,7 +998,6 @@ class CPYRAM6 final : public CElementWithKnownSizes<6,5,3> { * \return Volume of the element. */ su2double ComputeVolume(const FrameType mode = REFERENCE) const override; - }; /*! @@ -1062,13 +1006,13 @@ class CPYRAM6 final : public CElementWithKnownSizes<6,5,3> { * \brief Line element with 2 Gauss Points * \author T.Dick */ -class CLINE final : public CElementWithKnownSizes<2,2,1> { -private: - enum : unsigned short {NGAUSS = 2}; - enum : unsigned short {NNODE = 2}; - enum : unsigned short {NDIM = 1}; +class CLINE final : public CElementWithKnownSizes<2, 2, 1> { + private: + enum : unsigned short { NGAUSS = 2 }; + enum : unsigned short { NNODE = 2 }; + enum : unsigned short { NDIM = 1 }; -public: + public: /*! * \brief Constructor of the class. */ @@ -1080,5 +1024,4 @@ class CLINE final : public CElementWithKnownSizes<2,2,1> { * \return Area of the element. */ su2double ComputeLength(const FrameType mode = REFERENCE) const override; - }; diff --git a/Common/include/geometry/elements/CElementProperty.hpp b/Common/include/geometry/elements/CElementProperty.hpp index 4646ba0a7ce..8fc195d964f 100644 --- a/Common/include/geometry/elements/CElementProperty.hpp +++ b/Common/include/geometry/elements/CElementProperty.hpp @@ -2,7 +2,7 @@ * \file CElementProperty.hpp * \brief Light classes to define finite element properties. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -32,14 +32,13 @@ * \ingroup Elasticity_Equations * \brief Base class for defining element properties. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CProperty { -protected: + protected: + unsigned long iMat_Prop = 0; /*!< \brief Index of the properties (E, Nu) for the structural model used. */ - unsigned long iMat_Prop = 0; /*!< \brief Index of the properties (E, Nu) for the structural model used. */ - -public: + public: /*! * \brief Constructor of the class. * \param[in] valMat_Prop - Index of the physical properties (E,nu,rho,rho_dead_load) assigned to the element. @@ -94,7 +93,7 @@ class CProperty { /*! * \brief Extract the derivative of the Design density. */ - inline virtual su2double GetAdjointDensity(void) const { return 0.0; } + inline virtual su2double GetAdjointDensity(void) { return 0.0; } /*! * \brief Register the Design density as an AD input variable. @@ -102,38 +101,38 @@ class CProperty { inline virtual void RegisterDensity(void) {} }; - /*! * \class CElementProperty * \ingroup Elasticity_Equations * \brief Class for defining element properties for the structural solver. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CElementProperty final : public CProperty { -private: - - unsigned long iMat_Mod = 0; /*!< \brief Index of the material model used. */ - unsigned long iElectric_Prop = 0; /*!< \brief Index of the electric properties (Em) for the structural model used. */ - unsigned long iDV = 0; /*!< \brief Index of the group of design variables to which the element belongs. */ - su2double design_rho = 1.0; /*!< \brief Value of the design density for material-based topology optimization. */ - su2double physical_rho = 1.0; /*!< \brief Value of the physical density for material-based topology optimization. */ - -public: + private: + unsigned long iMat_Mod = 0; /*!< \brief Index of the material model used. */ + unsigned long iElectric_Prop = 0; /*!< \brief Index of the electric properties (Em) for the structural model used. */ + unsigned long iDV = 0; /*!< \brief Index of the group of design variables to which the element belongs. */ + su2double design_rho = 1.0; /*!< \brief Value of the design density for material-based topology optimization. */ + su2double physical_rho = 1.0; /*!< \brief Value of the physical density for material-based topology optimization. */ + public: /*! * \brief Constructor of the class. - * \param[in] valMat_Model - Type of material model (i.e. numerics) for the element, see FEA_TERM etc. in option_structure.hpp. - * \param[in] valMat_Prop - Index of the physical properties (E,nu,rho,rho_dead_load) assigned to the element. - * \param[in] valElectric_Prop - Index of the electric properties. - * \param[in] valDV - Index of the design variable assigned to the element (bound to a material property by "DESIGN_VARIABLE_FEA"). - * \param[in] valDensity - Value for Design and Physical densities (topology optimization variables). - */ - CElementProperty(unsigned long valMat_Model, unsigned long valMat_Prop, - unsigned long valElectric_Prop, unsigned long valDV, - su2double valDensity = 1.0) : CProperty(valMat_Prop), - iMat_Mod(valMat_Model), iElectric_Prop(valElectric_Prop), - iDV(valDV), design_rho(valDensity), physical_rho(valDensity) {} + * \param[in] valMat_Model - Type of material model (i.e. numerics) for the element, see FEA_TERM etc. in + * option_structure.hpp. \param[in] valMat_Prop - Index of the physical properties (E,nu,rho,rho_dead_load) assigned + * to the element. \param[in] valElectric_Prop - Index of the electric properties. \param[in] valDV - Index of the + * design variable assigned to the element (bound to a material property by "DESIGN_VARIABLE_FEA"). \param[in] + * valDensity - Value for Design and Physical densities (topology optimization variables). + */ + CElementProperty(unsigned long valMat_Model, unsigned long valMat_Prop, unsigned long valElectric_Prop, + unsigned long valDV, su2double valDensity = 1.0) + : CProperty(valMat_Prop), + iMat_Mod(valMat_Model), + iElectric_Prop(valElectric_Prop), + iDV(valDV), + design_rho(valDensity), + physical_rho(valDensity) {} /*! * \brief Destructor of the class. @@ -178,7 +177,11 @@ class CElementProperty final : public CProperty { /*! * \brief Extract the derivative of the Design density. */ - inline su2double GetAdjointDensity(void) const override { return SU2_TYPE::GetDerivative(design_rho); } + inline su2double GetAdjointDensity(void) override { + su2double der = SU2_TYPE::GetDerivative(design_rho); + AD::ResetInput(design_rho); + return der; + } /*! * \brief Register the Design density as an AD input variable. diff --git a/Common/include/geometry/elements/CGaussVariable.hpp b/Common/include/geometry/elements/CGaussVariable.hpp index d547d2de6a1..78ebcb92683 100644 --- a/Common/include/geometry/elements/CGaussVariable.hpp +++ b/Common/include/geometry/elements/CGaussVariable.hpp @@ -2,7 +2,7 @@ * \file CGaussVariable.hpp * \brief Light-weight class to store Gaussian point information. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -33,19 +33,18 @@ * \class CGaussVariable * \ingroup FemAlgos * \brief Main class for defining the gaussian points. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CGaussVariable { -protected: - - su2activematrix GradNi_Xj; /*!< \brief Gradient of the shape functions N[i] wrt the reference configuration. */ - su2activematrix GradNi_xj; /*!< \brief Gradient of the shape functions N[i] wrt the current configuration. */ - su2activevector Ni; /*!< \brief Shape functions N[i] at the gaussian point. */ - su2double J_X = 0.0; /*!< \brief Element Jacobian evaluated at this Gauss Point wrt the reference configuration. */ - su2double J_x = 0.0; /*!< \brief Element Jacobian evaluated at this Gauss Point wrt the current configuration. */ + protected: + su2activematrix GradNi_Xj; /*!< \brief Gradient of the shape functions N[i] wrt the reference configuration. */ + su2activematrix GradNi_xj; /*!< \brief Gradient of the shape functions N[i] wrt the current configuration. */ + su2activevector Ni; /*!< \brief Shape functions N[i] at the gaussian point. */ + su2double J_X = 0.0; /*!< \brief Element Jacobian evaluated at this Gauss Point wrt the reference configuration. */ + su2double J_x = 0.0; /*!< \brief Element Jacobian evaluated at this Gauss Point wrt the current configuration. */ unsigned short iGaussPoint = 0; /*!< \brief Identifier of the Gauss point considered. */ -public: + public: /*! * \brief Deleted default constructor as this class does not allow resizing once created. */ @@ -58,13 +57,11 @@ class CGaussVariable { * \param[in] config - Definition of the particular problem. */ CGaussVariable(unsigned short val_iGauss, unsigned short val_nDim, unsigned short val_nNodes) - : J_X(0.0), J_x(0.0), iGaussPoint(val_iGauss) - { - + : J_X(0.0), J_x(0.0), iGaussPoint(val_iGauss) { /* --- For the structural mechanics solver the dimensions (nNodes x nDim) are sufficient. * For the Sobolev smoothing solver dimensions (nNodes x (nDim+1)) are necessary * when working on a curved design surface embedded in 3D. ---*/ - GradNi_Xj.resize(val_nNodes,val_nDim+1) = su2double(0.0); + GradNi_Xj.resize(val_nNodes, val_nDim + 1) = su2double(0.0); GradNi_xj = GradNi_Xj; Ni.resize(val_nNodes) = su2double(0.0); @@ -89,7 +86,6 @@ class CGaussVariable { inline void SetJ_x(su2double valJ_x) { J_x = valJ_x; } - inline su2double GetGradNi_Xj(unsigned short val_Ni, unsigned short val_iDim) const { return GradNi_Xj(val_Ni, val_iDim); } @@ -105,6 +101,4 @@ class CGaussVariable { inline su2double GetJ_x(void) const { return J_x; } inline unsigned short Get_iGauss(void) const { return iGaussPoint; } - }; - diff --git a/Common/include/geometry/meshreader/CBoxMeshReaderFVM.hpp b/Common/include/geometry/meshreader/CBoxMeshReaderFVM.hpp index a9863e424d9..1c99fe92da8 100644 --- a/Common/include/geometry/meshreader/CBoxMeshReaderFVM.hpp +++ b/Common/include/geometry/meshreader/CBoxMeshReaderFVM.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CBoxMeshReaderFVM. * The implementations are in the CBoxMeshReaderFVM.cpp file. * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -35,10 +35,8 @@ * \brief Reads a 3D box grid into linear partitions for the finite volume solver (FVM). * \author: T. Economon */ -class CBoxMeshReaderFVM: public CMeshReaderFVM { - -private: - +class CBoxMeshReaderFVM : public CMeshReaderFVM { + private: unsigned long nNode; /*!< \brief Number of grid nodes in the x-direction. */ unsigned long mNode; /*!< \brief Number of grid nodes in the y-direction. */ unsigned long pNode; /*!< \brief Number of grid nodes in the z-direction. */ @@ -69,18 +67,14 @@ class CBoxMeshReaderFVM: public CMeshReaderFVM { */ void ComputeBoxSurfaceConnectivity(); -public: - + public: /*! * \brief Constructor of the CBoxMeshReaderFVM class. */ - CBoxMeshReaderFVM(CConfig *val_config, - unsigned short val_iZone, - unsigned short val_nZone); + CBoxMeshReaderFVM(CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone); /*! * \brief Destructor of the CBoxMeshReaderFVM class. */ ~CBoxMeshReaderFVM(void); - }; diff --git a/Common/include/geometry/meshreader/CCGNSMeshReaderFVM.hpp b/Common/include/geometry/meshreader/CCGNSMeshReaderFVM.hpp index c5448dfa9a0..f655993208a 100644 --- a/Common/include/geometry/meshreader/CCGNSMeshReaderFVM.hpp +++ b/Common/include/geometry/meshreader/CCGNSMeshReaderFVM.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CCGNSMeshReaderFVM. * The implementations are in the CCGNSMeshReaderFVM.cpp file. * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -39,28 +39,31 @@ * \brief Reads a CGNS zone into linear partitions for the finite volume solver (FVM). * \author: T. Economon */ -class CCGNSMeshReaderFVM: public CMeshReaderFVM { - -private: - +class CCGNSMeshReaderFVM : public CMeshReaderFVM { + private: #ifdef HAVE_CGNS - int cgnsFileID; /*!< \brief CGNS file identifier. */ + int cgnsFileID; /*!< \brief CGNS file identifier. */ const int cgnsBase = 1; /*!< \brief CGNS database index (the CGNS reader currently assumes a single database). */ const int cgnsZone = 1; /*!< \brief CGNS zone index (and 1 zone in that database). */ - int nSections; /*!< \brief Total number of sections in the CGNS file. */ - - vector isInterior; /*!< \brief Vector of booleans to store whether each section in the CGNS file is an interior or boundary section. */ - vector nElems; /*!< \brief Vector containing the local number of elements found within each CGNS section. */ - vector elemOffset; /*!< \brief Global ID offset for each interior section (i.e., the total number of global elements that came before it). */ - vector > connElems; /*!< \brief Vector containing the local element connectivity found within each CGNS section. First index is the section, second contains the connectivity in format [globalID VTK n1 n2 n3 n4 n5 n6 n7 n8] for each element. */ + int nSections; /*!< \brief Total number of sections in the CGNS file. */ + + vector isInterior; /*!< \brief Vector of booleans to store whether each section in the CGNS file is an interior + or boundary section. */ + vector + nElems; /*!< \brief Vector containing the local number of elements found within each CGNS section. */ + vector elemOffset; /*!< \brief Global ID offset for each interior section (i.e., the total number of + global elements that came before it). */ + vector > connElems; /*!< \brief Vector containing the local element connectivity found within each + CGNS section. First index is the section, second contains the connectivity in + format [globalID VTK n1 n2 n3 n4 n5 n6 n7 n8] for each element. */ vector > sectionNames; /*!< \brief Vector for storing the names of each boundary section (marker). */ /*! * \brief Open the CGNS file and checks for errors. * \param[in] val_filename - string name of the CGNS file to be read. */ - void OpenCGNSFile(string val_filename); + void OpenCGNSFile(const string& val_filename); /*! * \brief Reads all CGNS database metadata and checks for errors. @@ -78,7 +81,8 @@ class CCGNSMeshReaderFVM: public CMeshReaderFVM { void ReadCGNSPointCoordinates(); /*! - * \brief Reads the metadata for each CGNS section in a zone and collect information, including the size and whether it is an interior or boundary section. + * \brief Reads the metadata for each CGNS section in a zone and collect information, including the size and whether + * it is an interior or boundary section. */ void ReadCGNSSectionMetadata(); @@ -89,8 +93,8 @@ class CCGNSMeshReaderFVM: public CMeshReaderFVM { void ReadCGNSVolumeSection(int val_section); /*! - * \brief Reads the surface (boundary) elements from the CGNS zone. Only the master rank currently reads and stores the connectivity, which is linearly partitioned later. - * \param[in] val_section - CGNS section index. + * \brief Reads the surface (boundary) elements from the CGNS zone. Only the master rank currently reads and stores + * the connectivity, which is linearly partitioned later. \param[in] val_section - CGNS section index. */ void ReadCGNSSurfaceSection(int val_section); @@ -110,27 +114,20 @@ class CCGNSMeshReaderFVM: public CMeshReaderFVM { * \param[out] val_vtk_type - VTK type identifier index. * \returns String containing the name of the element type. */ - string GetCGNSElementType(ElementType_t val_elem_type, - int &val_vtk_type); + string GetCGNSElementType(ElementType_t val_elem_type, int& val_vtk_type); #endif /*! * \brief Routine to launch non-blocking sends and recvs amongst all processors. * \param[in] bufSend - Buffer of data to be sent. - * \param[in] nElemSend - Array containing the number of elements to send to other processors in cumulative storage format. - * \param[in] sendReq - Array of MPI send requests. - * \param[in] bufRecv - Buffer of data to be received. - * \param[in] nElemSend - Array containing the number of elements to receive from other processors in cumulative storage format. - * \param[in] sendReq - Array of MPI recv requests. - * \param[in] countPerElem - Pieces of data per element communicated. + * \param[in] nElemSend - Array containing the number of elements to send to other processors in cumulative storage + * format. \param[in] sendReq - Array of MPI send requests. \param[in] bufRecv - Buffer of data to be received. + * \param[in] nElemSend - Array containing the number of elements to receive from other processors in cumulative + * storage format. \param[in] sendReq - Array of MPI recv requests. \param[in] countPerElem - Pieces of data per + * element communicated. */ - void InitiateCommsAll(void *bufSend, - const int *nElemSend, - SU2_MPI::Request *sendReq, - void *bufRecv, - const int *nElemRecv, - SU2_MPI::Request *recvReq, - unsigned short countPerElem, + void InitiateCommsAll(void* bufSend, const int* nElemSend, SU2_MPI::Request* sendReq, void* bufRecv, + const int* nElemRecv, SU2_MPI::Request* recvReq, unsigned short countPerElem, unsigned short commType); /*! @@ -140,24 +137,16 @@ class CCGNSMeshReaderFVM: public CMeshReaderFVM { * \param[in] nRecvs - Number of receives to be completed. * \param[in] sendReq - Array of MPI recv requests. */ - void CompleteCommsAll(int nSends, - SU2_MPI::Request *sendReq, - int nRecvs, - SU2_MPI::Request *recvReq); - - -public: + void CompleteCommsAll(int nSends, SU2_MPI::Request* sendReq, int nRecvs, SU2_MPI::Request* recvReq); + public: /*! * \brief Constructor of the CCGNSMeshReaderFVM class. */ - CCGNSMeshReaderFVM(CConfig *val_config, - unsigned short val_iZone, - unsigned short val_nZone); + CCGNSMeshReaderFVM(CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone); /*! * \brief Destructor of the CCGNSMeshReaderFVM class. */ ~CCGNSMeshReaderFVM(void); - }; diff --git a/Common/include/geometry/meshreader/CMeshReaderFVM.hpp b/Common/include/geometry/meshreader/CMeshReaderFVM.hpp index 000dd0cf1e8..d5b934c7de0 100644 --- a/Common/include/geometry/meshreader/CMeshReaderFVM.hpp +++ b/Common/include/geometry/meshreader/CMeshReaderFVM.hpp @@ -4,7 +4,7 @@ * \brief Header file for the class CMeshReaderFVM. * The implementations are in the CMeshReaderFVM.cpp file. * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -40,62 +40,60 @@ * \author T. Economon */ class CMeshReaderFVM { - -protected: - - const int rank; /*!< \brief MPI Rank. */ - const int size; /*!< \brief MPI Size. */ + protected: + const int rank; /*!< \brief MPI Rank. */ + const int size; /*!< \brief MPI Size. */ const CConfig* config = nullptr; /*!< \brief Local pointer to the config parameter object. */ unsigned short dimension = 0; /*!< \brief Dimension of the problem (2 or 3). */ - unsigned long numberOfLocalPoints = 0; /*!< \brief Number of local grid points within the linear partition on this rank. */ - unsigned long numberOfGlobalPoints = 0; /*!< \brief Number of global grid points within the mesh file. */ - vector > localPointCoordinates; /*!< \brief Vector holding the coordinates from the mesh file for the local grid points. First index is dimension, second is point index. */ + unsigned long numberOfLocalPoints = + 0; /*!< \brief Number of local grid points within the linear partition on this rank. */ + unsigned long numberOfGlobalPoints = 0; /*!< \brief Number of global grid points within the mesh file. */ + vector > + localPointCoordinates; /*!< \brief Vector holding the coordinates from the mesh file for the local grid points. + First index is dimension, second is point index. */ - unsigned long numberOfLocalElements = 0; /*!< \brief Number of local elements within the linear partition on this rank. */ + unsigned long numberOfLocalElements = + 0; /*!< \brief Number of local elements within the linear partition on this rank. */ unsigned long numberOfGlobalElements = 0; /*!< \brief Number of global elements within the mesh file. */ - vector localVolumeElementConnectivity; /*!< \brief Vector containing the element connectivity from the mesh file for the local elements. */ + vector localVolumeElementConnectivity; /*!< \brief Vector containing the element connectivity from the + mesh file for the local elements. */ - unsigned long numberOfMarkers = 0; /*!< \brief Total number of markers contained within the mesh file. */ - vector markerNames; /*!< \brief String names for all markers in the mesh file. */ - vector > surfaceElementConnectivity; /*!< \brief Vector containing the surface element connectivity from the mesh file on a per-marker basis. Only the master node reads and stores this connectivity. */ - -public: + unsigned long numberOfMarkers = 0; /*!< \brief Total number of markers contained within the mesh file. */ + vector markerNames; /*!< \brief String names for all markers in the mesh file. */ + vector > + surfaceElementConnectivity; /*!< \brief Vector containing the surface element connectivity from the mesh file on a + per-marker basis. Only the master node reads and stores this connectivity. */ + public: /*! * \brief Constructor of the CMeshReaderFVM class. * \param[in] val_config - config object for the current zone. * \param[in] val_iZone - Current zone index. * \param[in] val_nZone - Total number of zones. */ - CMeshReaderFVM(const CConfig *val_config, - unsigned short val_iZone, - unsigned short val_nZone); + CMeshReaderFVM(const CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone); /*! * \brief Get the physical dimension of the problem (2 or 3). * \returns Physical dimension of the problem. */ - inline unsigned short GetDimension() const { - return dimension; - } + inline unsigned short GetDimension() const { return dimension; } /*! * \brief Get the local point coordinates (linearly partitioned). * \returns Local point coordinates (linear partitioned). */ - inline const vector > &GetLocalPointCoordinates() const { - return localPointCoordinates; - } + inline const vector >& GetLocalPointCoordinates() const { return localPointCoordinates; } /*! - * \brief Get the surface element connectivity for the specified marker. Only the master node owns the surface connectivity. - * \param[in] val_iMarker - current marker index. - * \returns Surface element connecitivity for a marker from the master rank. + * \brief Get the surface element connectivity for the specified marker. Only the master node owns the surface + * connectivity. \param[in] val_iMarker - current marker index. \returns Surface element connecitivity for a marker + * from the master rank. */ - inline const vector &GetSurfaceElementConnectivityForMarker(int val_iMarker) const { + inline const vector& GetSurfaceElementConnectivityForMarker(int val_iMarker) const { return surfaceElementConnectivity[val_iMarker]; } @@ -105,14 +103,14 @@ class CMeshReaderFVM { * \returns Number of surface elements for a marker. */ inline unsigned long GetNumberOfSurfaceElementsForMarker(int val_iMarker) const { - return (unsigned long)surfaceElementConnectivity[val_iMarker].size()/SU2_CONN_SIZE; + return (unsigned long)surfaceElementConnectivity[val_iMarker].size() / SU2_CONN_SIZE; } /*! * \brief Get the local volume element connectivity (linearly partitioned). * \returns Local volume element connectivity (linearly partitioned). */ - inline const vector &GetLocalVolumeElementConnectivity() const { + inline const vector& GetLocalVolumeElementConnectivity() const { return localVolumeElementConnectivity; } @@ -120,48 +118,35 @@ class CMeshReaderFVM { * \brief Get the total number of markers in the mesh zone. * \returns Total number of markers in the mesh zone. */ - inline unsigned long GetNumberOfMarkers() const { - return numberOfMarkers; - } + inline unsigned long GetNumberOfMarkers() const { return numberOfMarkers; } /*! * \brief Get the vector of string names for all markers in the mesh zone. * \returns Vector of string names for all markers in the mesh zone. */ - inline const vector &GetMarkerNames() const { - return markerNames; - } + inline const vector& GetMarkerNames() const { return markerNames; } /*! * \brief Get the number of local grid points within the linear partition on this rank. * \returns Number of local grid points within the linear partition on this rank. */ - inline unsigned long GetNumberOfLocalPoints() const { - return numberOfLocalPoints; - } + inline unsigned long GetNumberOfLocalPoints() const { return numberOfLocalPoints; } /*! * \brief Get the number of global grid points within the mesh file. * \returns Number of global grid points within the mesh file. */ - inline unsigned long GetNumberOfGlobalPoints() const { - return numberOfGlobalPoints; - } + inline unsigned long GetNumberOfGlobalPoints() const { return numberOfGlobalPoints; } /*! * \brief Get the number of local elements within the linear partition on this rank. * \returns Number of local elements within the linear partition on this rank. */ - inline unsigned long GetNumberOfLocalElements() const { - return numberOfLocalElements; - } + inline unsigned long GetNumberOfLocalElements() const { return numberOfLocalElements; } /*! * \brief Get the number of global elements within the mesh file. * \returns Number of global elements within the mesh file. */ - inline unsigned long GetNumberOfGlobalElements() const { - return numberOfGlobalElements; - } - + inline unsigned long GetNumberOfGlobalElements() const { return numberOfGlobalElements; } }; diff --git a/Common/include/geometry/meshreader/CRectangularMeshReaderFVM.hpp b/Common/include/geometry/meshreader/CRectangularMeshReaderFVM.hpp index f20cf26a702..cda10fd6b32 100644 --- a/Common/include/geometry/meshreader/CRectangularMeshReaderFVM.hpp +++ b/Common/include/geometry/meshreader/CRectangularMeshReaderFVM.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CRectangularMeshReaderFVM. * The implementations are in the CRectangularMeshReaderFVM.cpp file. * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -35,10 +35,8 @@ * \brief Reads a 2D rectangular grid into linear partitions for the finite volume solver (FVM). * \author: T. Economon */ -class CRectangularMeshReaderFVM: public CMeshReaderFVM { - -private: - +class CRectangularMeshReaderFVM : public CMeshReaderFVM { + private: unsigned long nNode; /*!< \brief Number of grid nodes in the x-direction. */ unsigned long mNode; /*!< \brief Number of grid nodes in the y-direction. */ @@ -66,13 +64,9 @@ class CRectangularMeshReaderFVM: public CMeshReaderFVM { */ void ComputeRectangularSurfaceConnectivity(); -public: - + public: /*! * \brief Constructor of the CRectangularMeshReaderFVM class. */ - CRectangularMeshReaderFVM(const CConfig *val_config, - unsigned short val_iZone, - unsigned short val_nZone); - + CRectangularMeshReaderFVM(const CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone); }; diff --git a/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFVM.hpp b/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFVM.hpp index 6be7697534f..61a71be8493 100644 --- a/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFVM.hpp +++ b/Common/include/geometry/meshreader/CSU2ASCIIMeshReaderFVM.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CSU2ASCIIMeshReaderFVM. * The implementations are in the CSU2ASCIIMeshReaderFVM.cpp file. * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -37,9 +37,8 @@ * \brief Reads a native SU2 ASCII grid into linear partitions for the finite volume solver (FVM). * \author T. Economon */ -class CSU2ASCIIMeshReaderFVM: public CMeshReaderFVM { - -private: +class CSU2ASCIIMeshReaderFVM : public CMeshReaderFVM { + private: enum class FileSection { POINTS, ELEMENTS, MARKERS }; /*!< \brief Different sections of the file. */ std::array SectionOrder{}; /*!< \brief Order of the sections in the file. */ @@ -47,11 +46,12 @@ class CSU2ASCIIMeshReaderFVM: public CMeshReaderFVM { const unsigned short nZones; /*!< \brief Total number of zones in the SU2 file. */ const string meshFilename; /*!< \brief Name of the SU2 ASCII mesh file being read. */ - ifstream mesh_file; /*!< \brief File object for the SU2 ASCII mesh file. */ + ifstream mesh_file; /*!< \brief File object for the SU2 ASCII mesh file. */ bool actuator_disk; /*!< \brief Boolean for whether we have an actuator disk to split. */ - unsigned long ActDiskNewPoints = 0; /*!< \brief Total number of new grid points to add due to actuator disk splitting. */ + unsigned long ActDiskNewPoints = + 0; /*!< \brief Total number of new grid points to add due to actuator disk splitting. */ su2double Xloc = 0.0; /*!< \brief X-coordinate of the CG of the actuator disk surface. */ su2double Yloc = 0.0; /*!< \brief X-coordinate of the CG of the actuator disk surface. */ @@ -59,12 +59,17 @@ class CSU2ASCIIMeshReaderFVM: public CMeshReaderFVM { vector ActDisk_Bool; /*!< \brief Flag to identify the grid points on the actuator disk. */ - vector ActDiskPoint_Back; /*!< \brief Vector containing the global index for the new grid points added to the back of the actuator disk. */ - vector VolumePoint_Inv; /*!< \brief Vector containing the inverse mapping from the global index to the added point index for the actuator disk. */ + vector ActDiskPoint_Back; /*!< \brief Vector containing the global index for the new grid points added + to the back of the actuator disk. */ + vector VolumePoint_Inv; /*!< \brief Vector containing the inverse mapping from the global index to the + added point index for the actuator disk. */ - vector CoordXActDisk; /*!< \brief X-coordinates of the new grid points added by splitting the actuator disk (size = ActDiskNewPoints). */ - vector CoordYActDisk; /*!< \brief Y-coordinates of the new grid points added by splitting the actuator disk (size = ActDiskNewPoints). */ - vector CoordZActDisk; /*!< \brief Z-coordinates of the new grid points added by splitting the actuator disk (size = ActDiskNewPoints). */ + vector CoordXActDisk; /*!< \brief X-coordinates of the new grid points added by splitting the actuator disk + (size = ActDiskNewPoints). */ + vector CoordYActDisk; /*!< \brief Y-coordinates of the new grid points added by splitting the actuator disk + (size = ActDiskNewPoints). */ + vector CoordZActDisk; /*!< \brief Z-coordinates of the new grid points added by splitting the actuator disk + (size = ActDiskNewPoints). */ vector CoordXVolumePoint; /*!< \brief X-coordinates of the volume elements touching the actuator disk. */ vector CoordYVolumePoint; /*!< \brief Y-coordinates of the volume elements touching the actuator disk. */ @@ -72,11 +77,11 @@ class CSU2ASCIIMeshReaderFVM: public CMeshReaderFVM { /*! * \brief Reads all SU2 ASCII mesh metadata and checks for errors. - * \param[in] single_pass - Try to read the contents together with the metadata if the order allows (points before elements). - * \param[in,out] config - Problem configuration where some metadata is updated (e.g. AoA). - * \returns True if single_pass was successful. + * \param[in] single_pass - Try to read the contents together with the metadata if the order allows (points before + * elements). \param[in,out] config - Problem configuration where some metadata is updated (e.g. AoA). \returns True + * if single_pass was successful. */ - bool ReadMetadata(const bool single_pass, CConfig *config); + bool ReadMetadata(const bool single_pass, CConfig* config); /*! * \brief Splits a single surface actuator disk boundary into two separate markers (repeated points). @@ -103,13 +108,9 @@ class CSU2ASCIIMeshReaderFVM: public CMeshReaderFVM { */ void FastForwardToMyZone(); -public: - + public: /*! * \brief Constructor of the CSU2ASCIIMeshReaderFVM class. */ - CSU2ASCIIMeshReaderFVM(CConfig *val_config, - unsigned short val_iZone, - unsigned short val_nZone); - + CSU2ASCIIMeshReaderFVM(CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone); }; diff --git a/Common/include/geometry/primal_grid/CHexahedron.hpp b/Common/include/geometry/primal_grid/CHexahedron.hpp index b249559e683..f2bcc41cf27 100644 --- a/Common/include/geometry/primal_grid/CHexahedron.hpp +++ b/Common/include/geometry/primal_grid/CHexahedron.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the CHexahedron.cpp file. * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -39,10 +39,12 @@ struct CHexahedronConnectivity { enum { nFaces = N_FACES_HEXAHEDRON }; enum { maxNodesFace = N_POINTS_QUADRILATERAL }; enum { VTK_Type = HEXAHEDRON }; - static constexpr unsigned short nNodesFace[6] = {4,4,4,4,4,4}; - static constexpr unsigned short Faces[6][4] = {{0,1,5,4},{1,2,6,5},{2,3,7,6},{3,0,4,7},{0,3,2,1},{4,5,6,7}}; - static constexpr unsigned short nNeighbor_Nodes[8] = {3,3,3,3,3,3,3,3}; - static constexpr unsigned short Neighbor_Nodes[8][3] = {{1,3,4},{0,2,5},{1,3,6},{0,2,7},{0,5,7},{4,6,1},{2,5,7},{4,3,6}}; + static constexpr unsigned short nNodesFace[6] = {4, 4, 4, 4, 4, 4}; + static constexpr unsigned short Faces[6][4] = {{0, 1, 5, 4}, {1, 2, 6, 5}, {2, 3, 7, 6}, + {3, 0, 4, 7}, {0, 3, 2, 1}, {4, 5, 6, 7}}; + static constexpr unsigned short nNeighbor_Nodes[8] = {3, 3, 3, 3, 3, 3, 3, 3}; + static constexpr unsigned short Neighbor_Nodes[8][3] = {{1, 3, 4}, {0, 2, 5}, {1, 3, 6}, {0, 2, 7}, + {0, 5, 7}, {4, 6, 1}, {2, 5, 7}, {4, 3, 6}}; }; /*! @@ -51,7 +53,7 @@ struct CHexahedronConnectivity { * \author F. Palacios */ class CHexahedron : public CPrimalGridWithConnectivity { -public: + public: /*! * \brief Constructor using the nodes and index. * \param[in] val_point_0 - Index of the 1st point read from the grid file. @@ -63,9 +65,8 @@ class CHexahedron : public CPrimalGridWithConnectivity * \param[in] val_point_6 - Index of the 7th point read from the grid file. * \param[in] val_point_7 - Index of the 8th point read from the grid file. */ - CHexahedron(unsigned long val_point_0, unsigned long val_point_1, - unsigned long val_point_2, unsigned long val_point_3, - unsigned long val_point_4, unsigned long val_point_5, + CHexahedron(unsigned long val_point_0, unsigned long val_point_1, unsigned long val_point_2, + unsigned long val_point_3, unsigned long val_point_4, unsigned long val_point_5, unsigned long val_point_6, unsigned long val_point_7); /*! diff --git a/Common/include/geometry/primal_grid/CLine.hpp b/Common/include/geometry/primal_grid/CLine.hpp index 26c786e534b..bafd3e5ea59 100644 --- a/Common/include/geometry/primal_grid/CLine.hpp +++ b/Common/include/geometry/primal_grid/CLine.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the CLine.cpp file. * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -39,10 +39,10 @@ struct CLineConnectivity { enum { nFaces = N_FACES_LINE }; enum { maxNodesFace = N_POINTS_LINE }; enum { VTK_Type = LINE }; - static constexpr unsigned short nNodesFace[1]={2}; - static constexpr unsigned short Faces[1][2]={{0,1}}; - static constexpr unsigned short nNeighbor_Nodes[2]={1,1}; - static constexpr unsigned short Neighbor_Nodes[2][1]={{1},{0}}; + static constexpr unsigned short nNodesFace[1] = {2}; + static constexpr unsigned short Faces[1][2] = {{0, 1}}; + static constexpr unsigned short nNeighbor_Nodes[2] = {1, 1}; + static constexpr unsigned short Neighbor_Nodes[2][1] = {{1}, {0}}; }; /*! @@ -51,7 +51,7 @@ struct CLineConnectivity { * \author F. Palacios */ class CLine final : public CPrimalGridWithConnectivity { -public: + public: /*! * \brief Constructor using the nodes and index. * \param[in] val_point_0 - Index of the 1st triangle point read from the grid file. @@ -62,7 +62,5 @@ class CLine final : public CPrimalGridWithConnectivity { /*! * \brief Change the orientation of an element. */ - inline void Change_Orientation() override { - std::swap(Nodes[0], Nodes[1]); - } + inline void Change_Orientation() override { std::swap(Nodes[0], Nodes[1]); } }; diff --git a/Common/include/geometry/primal_grid/CPrimalGrid.hpp b/Common/include/geometry/primal_grid/CPrimalGrid.hpp index dfa2724c00d..2a27944b4d4 100644 --- a/Common/include/geometry/primal_grid/CPrimalGrid.hpp +++ b/Common/include/geometry/primal_grid/CPrimalGrid.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the primal_grid_structure.cpp file. * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -30,6 +30,7 @@ #include #include +#include #include #include #include @@ -42,29 +43,30 @@ * \author F. Palacios, T. Economon, M. Aehle. */ class CPrimalGrid { -protected: + protected: /* If this is a domain element, stores the global index. * If this is a boundary element, stores the index of the adjacent domain element. */ unsigned long GlobalIndex_DomainElement; - std::unique_ptr Nodes; /*!< \brief Global node indices of the element. */ - std::unique_ptr Neighbor_Elements; /*!< \brief Vector to store the elements surronding this element. */ + std::unique_ptr Nodes; /*!< \brief Global node indices of the element. */ + std::unique_ptr Neighbor_Elements; /*!< \brief Vector to store the elements surronding this element. */ - su2double Coord_CG[3] = {0.0}; /*!< \brief Coordinates of the center-of-gravity of the element. */ - su2double Volume; /*!< \brief Volume of the element. */ - su2double LenScale; /*!< \brief Length scale of the element. */ + su2double Coord_CG[3] = {0.0}; /*!< \brief Coordinates of the center-of-gravity of the element. */ + su2double Volume; /*!< \brief Volume of the element. */ + su2double LenScale; /*!< \brief Length scale of the element. */ unsigned short TimeLevel; /*!< \brief Time level of the element for time accurate local time stepping. */ - /*!< \brief Vector to store the periodic index of a neighbor, -1 indicates no periodic transformation to the neighbor. */ + /*!< \brief Vector to store the periodic index of a neighbor, -1 indicates no periodic transformation to the neighbor. + */ int8_t PeriodIndexNeighbors[N_FACES_MAXIMUM]; /*! \brief Whether or not the Jacobian of the faces can be considered * constant in the transformation to the standard element. */ bool JacobianFaceIsConstant[N_FACES_MAXIMUM]; - bool ElementOwnsFace[N_FACES_MAXIMUM]; /*!< \brief Whether or not the element owns each face. */ - const bool FEM; /*!< \brief Whether this is a FEM element. */ + bool ElementOwnsFace[N_FACES_MAXIMUM]; /*!< \brief Whether or not the element owns each face. */ + const bool FEM; /*!< \brief Whether this is a FEM element. */ -public: + public: CPrimalGrid() = delete; /*! @@ -109,7 +111,9 @@ class CPrimalGrid { * \param[in] val_elem - Global index of the element. * \param[in] val_face - Local index of the face. */ - inline void SetNeighbor_Elements(unsigned long val_elem, unsigned short val_face) { Neighbor_Elements[val_face] = val_elem; } + inline void SetNeighbor_Elements(unsigned long val_elem, unsigned short val_face) { + Neighbor_Elements[val_face] = val_elem; + } /*! * \brief Make available the length scale of the element. @@ -189,12 +193,12 @@ class CPrimalGrid { * \param[in] nDim - Number of dimensions (2 or 3). * \param[in] val_coord - Coordinates of the element. */ - template + template inline su2double* SetCoord_CG(unsigned short nDim, const T& val_coord) { for (unsigned short iDim = 0; iDim < nDim; iDim++) { Coord_CG[iDim] = 0.0; for (unsigned short iNode = 0; iNode < GetnNodes(); iNode++) - Coord_CG[iDim] += val_coord[iNode][iDim]/su2double(GetnNodes()); + Coord_CG[iDim] += val_coord[iNode][iDim] / su2double(GetnNodes()); } return Coord_CG; } @@ -237,7 +241,7 @@ class CPrimalGrid { * \brief A virtual member. * \param[in] val_color - New color of the element. */ - inline virtual void SetColor(unsigned long val_color) { } + inline virtual void SetColor(unsigned long val_color) {} /*! * \brief A virtual member. @@ -266,7 +270,7 @@ class CPrimalGrid { /*! * \brief Get the index of the domain element of which this boundary element is a face. */ - inline unsigned long GetDomainElement() const{ return GlobalIndex_DomainElement; } + inline unsigned long GetDomainElement() const { return GlobalIndex_DomainElement; } /*! * \brief A pure virtual member. @@ -277,13 +281,13 @@ class CPrimalGrid { * \brief A pure virtual member. * \return Type of the element using VTK nomenclature. */ - inline virtual unsigned short GetRotation_Type() const{ return 0; } + inline virtual unsigned short GetRotation_Type() const { return 0; } /*! * \brief A pure virtual member. * \param[in] val_rotation_type - Kind of rotation/traslation that must be applied. */ - inline virtual void SetRotation_Type(unsigned short val_rotation_type) { } + inline virtual void SetRotation_Type(unsigned short val_rotation_type) {} /*-- The following pure virtual functions are overridden in * CPrimalGridWithConnectivity, except for the FEM classes. --*/ @@ -350,9 +354,8 @@ class CPrimalGrid { * \param[out] nPointsPerFace - Number of corner points for each of the faces. * \param[out] faceConn - Global IDs of the corner points of the faces. */ - inline virtual void GetCornerPointsAllFaces(unsigned short &nFaces, - unsigned short nPointsPerFace[], - unsigned long faceConn[6][4]) const { } + inline virtual void GetCornerPointsAllFaces(unsigned short& nFaces, unsigned short nPointsPerFace[], + unsigned long faceConn[6][4]) const {} /*! * \brief Virtual function to make available the global ID of this element. @@ -376,7 +379,7 @@ class CPrimalGrid { * \brief Virtual function to make available the polynomial degree of the solution. * \return The polynomial degree of the solution. */ - inline virtual unsigned short GetNPolySol() const{ return 0; } + inline virtual unsigned short GetNPolySol() const { return 0; } /*! * \brief Virtual function to make available the number of DOFs of the grid in the element. @@ -418,21 +421,21 @@ class CPrimalGrid { * \brief Virtual function to make available the number of donor elements for the wall function treatment. * \return The number of donor elements. */ - inline virtual unsigned short GetNDonorsWallFunctions() const {return 0;} + inline virtual unsigned short GetNDonorsWallFunctions() const { return 0; } /*! * \brief Virtual function to make available the pointer to the vector for the donor elements for the wall function treatment. * \return The pointer to the data of donorElementsWallFunctions. */ - inline virtual unsigned long *GetDonorsWallFunctions() {return nullptr;} - inline virtual const unsigned long *GetDonorsWallFunctions() const {return nullptr;} + inline virtual unsigned long* GetDonorsWallFunctions() { return nullptr; } + inline virtual const unsigned long* GetDonorsWallFunctions() const { return nullptr; } /*! * \brief Virtual function to set the global ID's of the donor elements for the wall function treatment. * \param[in] donorElements - Vector, which contain the donor elements. */ - inline virtual void SetDonorsWallFunctions(const std::vector &donorElements) {} + inline virtual void SetDonorsWallFunctions(const std::vector& donorElements) {} /*! * \brief Virtual function to remove the multiple donors for the wall function treatment. @@ -461,28 +464,21 @@ class CPrimalGrid { * * \tparam Connectivity - class defining the connectivity structure */ -template +template class CPrimalGridWithConnectivity : public CPrimalGrid { -public: - + public: CPrimalGridWithConnectivity(bool FEM) : CPrimalGrid(FEM, Connectivity::nNodes, Connectivity::nFaces) {} - inline unsigned short GetnNodes() const final { - return Connectivity::nNodes; - } + inline unsigned short GetnNodes() const final { return Connectivity::nNodes; } - inline unsigned short GetnFaces() const final { - return Connectivity::nFaces; - } + inline unsigned short GetnFaces() const final { return Connectivity::nFaces; } inline unsigned short GetnNodesFace(unsigned short val_face) const final { assert(val_face < Connectivity::nFaces); return Connectivity::nNodesFace[val_face]; } - inline unsigned short GetMaxNodesFace() const final { - return Connectivity::maxNodesFace; - } + inline unsigned short GetMaxNodesFace() const final { return Connectivity::maxNodesFace; } inline unsigned short GetFaces(unsigned short val_face, unsigned short val_index) const final { assert(val_face < GetnFaces() && val_index < GetnNodesFace(val_face)); @@ -499,9 +495,5 @@ class CPrimalGridWithConnectivity : public CPrimalGrid { return Connectivity::Neighbor_Nodes[val_node][val_index]; } - inline unsigned short GetVTK_Type() const final { - return Connectivity::VTK_Type; - } - + inline unsigned short GetVTK_Type() const final { return Connectivity::VTK_Type; } }; - diff --git a/Common/include/geometry/primal_grid/CPrimalGridBoundFEM.hpp b/Common/include/geometry/primal_grid/CPrimalGridBoundFEM.hpp index 2356c8a442c..d08e921b016 100644 --- a/Common/include/geometry/primal_grid/CPrimalGridBoundFEM.hpp +++ b/Common/include/geometry/primal_grid/CPrimalGridBoundFEM.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the CPrimalGridBoundFEM.cpp file. * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -33,22 +33,22 @@ /*! * \class CPrimalGridBoundFEM * \brief Class to define primal grid boundary element for the FEM solver. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ -class CPrimalGridBoundFEM final: public CPrimalGrid { -private: - unsigned long boundElemIDGlobal; /*!< \brief Global boundary element ID of this element. */ +class CPrimalGridBoundFEM final : public CPrimalGrid { + private: + unsigned long boundElemIDGlobal; /*!< \brief Global boundary element ID of this element. */ std::vector donorElementsWallFunctions; /*!< \brief The global ID's of the donor elements for the wall function treatment. */ - unsigned short VTK_Type; /*!< \brief Element type using the VTK convention. */ - unsigned short nPolyGrid; /*!< \brief Polynomial degree for the geometry of the element. */ - unsigned short nDOFsGrid; /*!< \brief Number of DOFs for the geometry of the element. */ + unsigned short VTK_Type; /*!< \brief Element type using the VTK convention. */ + unsigned short nPolyGrid; /*!< \brief Polynomial degree for the geometry of the element. */ + unsigned short nDOFsGrid; /*!< \brief Number of DOFs for the geometry of the element. */ - bool JacobianConsideredConstant; /*!< \brief Whether or not the Jacobian of the transformation to - is (almost) constant. */ -public: + bool JacobianConsideredConstant; /*!< \brief Whether or not the Jacobian of the transformation to + is (almost) constant. */ + public: /*! * \brief Constructor using data to initialize the boundary element. * \param[in] val_elemGlobalID - Global boundary element ID of this element. @@ -58,19 +58,18 @@ class CPrimalGridBoundFEM final: public CPrimalGrid { * \param[in] val_nDOFsGrid - Number of DOFs used to describe the geometry of the element. * \param[in] val_nodes - Vector, which contains the global node IDs of the element. */ - CPrimalGridBoundFEM(unsigned long val_elemGlobalID, - unsigned long val_domainElementID, - unsigned short val_VTK_Type, - unsigned short val_nPolyGrid, - unsigned short val_nDOFsGrid, - std::vector &val_nodes); + CPrimalGridBoundFEM(unsigned long val_elemGlobalID, unsigned long val_domainElementID, unsigned short val_VTK_Type, + unsigned short val_nPolyGrid, unsigned short val_nDOFsGrid, + std::vector& val_nodes); /*! * \brief Get the number of nodes that composes a face of an element. * \param[in] val_face - Local index of the face. * \return Number of nodes that composes a face of an element. */ - inline unsigned short GetnNodesFace(unsigned short val_face) const override { return std::numeric_limits::max(); } + inline unsigned short GetnNodesFace(unsigned short val_face) const override { + return std::numeric_limits::max(); + } /*! * \brief Get the face index of an element. @@ -78,7 +77,9 @@ class CPrimalGridBoundFEM final: public CPrimalGrid { * \param[in] val_index - Local (to the face) index of the nodes that compose the face. * \return Local (to the element) index of the nodes that compose the face. */ - inline unsigned short GetFaces(unsigned short val_face, unsigned short val_index) const override { return std::numeric_limits::max(); } + inline unsigned short GetFaces(unsigned short val_face, unsigned short val_index) const override { + return std::numeric_limits::max(); + } /*! * \brief Get the local index of the neighbors to a node (given the local index). @@ -86,7 +87,9 @@ class CPrimalGridBoundFEM final: public CPrimalGrid { * \param[in] val_index - Local (to the neighbor nodes of val_node) index of the nodes that are neighbor to val_node. * \return Local (to the element) index of the nodes that are neighbor to val_node. */ - inline unsigned short GetNeighbor_Nodes(unsigned short val_node, unsigned short val_index) const override { return std::numeric_limits::max(); } + inline unsigned short GetNeighbor_Nodes(unsigned short val_node, unsigned short val_index) const override { + return std::numeric_limits::max(); + } /*! * \brief Get the number of nodes of an element. @@ -105,7 +108,9 @@ class CPrimalGridBoundFEM final: public CPrimalGrid { * \param[in] val_node - Local (to the element) index of a node. * \return Number if neighbors of a node val_node. */ - inline unsigned short GetnNeighbor_Nodes(unsigned short val_node) const override { return std::numeric_limits::max(); } + inline unsigned short GetnNeighbor_Nodes(unsigned short val_node) const override { + return std::numeric_limits::max(); + } /*! * \brief Change the orientation of an element. @@ -142,9 +147,8 @@ class CPrimalGridBoundFEM final: public CPrimalGrid { * \param[out] nPointsPerFace - Number of corner points for each of the faces. * \param[out] faceConn - Global IDs of the corner points of the faces. */ - void GetCornerPointsAllFaces(unsigned short &nFaces, - unsigned short nPointsPerFace[], - unsigned long faceConn[6][4]) const override; + void GetCornerPointsAllFaces(unsigned short& nFaces, unsigned short nPointsPerFace[], + unsigned long faceConn[6][4]) const override; /*! * \brief Static member function to get the local the corner points of all the face @@ -155,11 +159,8 @@ class CPrimalGridBoundFEM final: public CPrimalGrid { * \param[out] nPointsPerFace - Number of corner points of the face. * \param[out] faceConn - Global IDs of the corner points of the face. */ - static void GetLocalCornerPointsFace(unsigned short elementType, - unsigned short nPoly, - unsigned short nDOFs, - unsigned short &nPointsPerFace, - unsigned long faceConn[]); + static void GetLocalCornerPointsFace(unsigned short elementType, unsigned short nPoly, unsigned short nDOFs, + unsigned short& nPointsPerFace, unsigned long faceConn[]); /*! * \brief Make available the global ID of this element. @@ -171,39 +172,45 @@ class CPrimalGridBoundFEM final: public CPrimalGrid { * \brief Function to get whether or not the Jacobian is considered constant. * \return True if the Jacobian is (almost) constant and false otherwise. */ - inline bool GetJacobianConsideredConstant(void) const override {return JacobianConsideredConstant;} + inline bool GetJacobianConsideredConstant(void) const override { return JacobianConsideredConstant; } /*! * \brief Function to set the value of JacobianConsideredConstant. * \param[in] val_JacobianConsideredConstant - The value to be set for JacobianConsideredConstant. */ - inline void SetJacobianConsideredConstant(bool val_JacobianConsideredConstant) override {JacobianConsideredConstant = val_JacobianConsideredConstant;} + inline void SetJacobianConsideredConstant(bool val_JacobianConsideredConstant) override { + JacobianConsideredConstant = val_JacobianConsideredConstant; + } /*! * \brief Add the given donor ID to the donor elements for the wall function treatment. * \param[in] donorElement - Element to be added to donor elements. */ - inline void AddDonorWallFunctions(const unsigned long donorElement) override {donorElementsWallFunctions.push_back(donorElement);} + inline void AddDonorWallFunctions(const unsigned long donorElement) override { + donorElementsWallFunctions.push_back(donorElement); + } /*! * \brief Make available the number of donor elements for the wall function treatment. * \return The number of donor elements. */ - inline unsigned short GetNDonorsWallFunctions(void) const override {return donorElementsWallFunctions.size();} + inline unsigned short GetNDonorsWallFunctions(void) const override { return donorElementsWallFunctions.size(); } /*! * \brief Make available the pointer to the vector for the donor elements for the wall function treatment. * \return The pointer to the data of donorElementsWallFunctions. */ - inline unsigned long *GetDonorsWallFunctions(void) override {return donorElementsWallFunctions.data();} - inline const unsigned long *GetDonorsWallFunctions(void) const override {return donorElementsWallFunctions.data();} + inline unsigned long* GetDonorsWallFunctions(void) override { return donorElementsWallFunctions.data(); } + inline const unsigned long* GetDonorsWallFunctions(void) const override { return donorElementsWallFunctions.data(); } /*! * \brief Set the global ID's of the donor elements for the wall function treatment. * \param[in] donorElements - Vector, which contain the donor elements. */ - inline void SetDonorsWallFunctions(const std::vector &donorElements) override {donorElementsWallFunctions = donorElements;} + inline void SetDonorsWallFunctions(const std::vector& donorElements) override { + donorElementsWallFunctions = donorElements; + } /*! * \brief Function to remove the multiple donors for the wall function treatment. diff --git a/Common/include/geometry/primal_grid/CPrimalGridFEM.hpp b/Common/include/geometry/primal_grid/CPrimalGridFEM.hpp index 622e7915069..848ed24d890 100644 --- a/Common/include/geometry/primal_grid/CPrimalGridFEM.hpp +++ b/Common/include/geometry/primal_grid/CPrimalGridFEM.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the CPrimalGridFEM.cpp file. * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -34,25 +34,25 @@ /*! * \class CPrimalGridFEM * \brief Class to define primal grid element for the FEM solver. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ -class CPrimalGridFEM final: public CPrimalGrid { -private: +class CPrimalGridFEM final : public CPrimalGrid { + private: unsigned long elemIDGlobal; /*!< \brief Global element ID of this element. */ unsigned long offsetDOFsSolGlobal; /*!< \brief Global offset of the solution DOFs of this element. */ unsigned long color; /*!< \brief Color of the element in the partitioning strategy. */ - unsigned short VTK_Type; /*!< \brief Element type using the VTK convention. */ - unsigned short nPolyGrid; /*!< \brief Polynomial degree for the geometry of the element. */ - unsigned short nPolySol; /*!< \brief Polynomial degree for the solution of the element. */ - unsigned short nDOFsGrid; /*!< \brief Number of DOFs for the geometry of the element. */ - unsigned short nDOFsSol; /*!< \brief Number of DOFs for the solution of the element. */ - unsigned short nFaces; /*!< \brief Number of faces of the element. */ + unsigned short VTK_Type; /*!< \brief Element type using the VTK convention. */ + unsigned short nPolyGrid; /*!< \brief Polynomial degree for the geometry of the element. */ + unsigned short nPolySol; /*!< \brief Polynomial degree for the solution of the element. */ + unsigned short nDOFsGrid; /*!< \brief Number of DOFs for the geometry of the element. */ + unsigned short nDOFsSol; /*!< \brief Number of DOFs for the solution of the element. */ + unsigned short nFaces; /*!< \brief Number of faces of the element. */ - bool JacobianConsideredConstant; /*!< \brief Whether or not the Jacobian of the transformation to - is (almost) constant. */ + bool JacobianConsideredConstant; /*!< \brief Whether or not the Jacobian of the transformation to + is (almost) constant. */ -public: + public: /*! * \brief Constructor using data to initialize the element. * \param[in] val_elemGlobalID - Global element ID of this element. @@ -64,10 +64,9 @@ class CPrimalGridFEM final: public CPrimalGrid { * \param[in] val_offDOfsSol - Global offset of the solution DOFs of the element. * \param[in] elem_line - istringstream, which contains the grid node numbers of the element. */ - CPrimalGridFEM(unsigned long val_elemGlobalID, unsigned short val_VTK_Type, - unsigned short val_nPolyGrid, unsigned short val_nPolySol, - unsigned short val_nDOFsGrid, unsigned short val_nDOFsSol, - unsigned long val_offDOfsSol, std::istringstream &elem_line); + CPrimalGridFEM(unsigned long val_elemGlobalID, unsigned short val_VTK_Type, unsigned short val_nPolyGrid, + unsigned short val_nPolySol, unsigned short val_nDOFsGrid, unsigned short val_nDOFsSol, + unsigned long val_offDOfsSol, std::istringstream& elem_line); /*! * \brief Constructor using data to initialize the element. @@ -80,17 +79,18 @@ class CPrimalGridFEM final: public CPrimalGrid { * \param[in] val_offDOfsSol - Global offset of the solution DOFs of the element. * \param[in] connGrid - Array, which contains the grid node numbers of the element. */ - CPrimalGridFEM(unsigned long val_elemGlobalID, unsigned short val_VTK_Type, - unsigned short val_nPolyGrid, unsigned short val_nPolySol, - unsigned short val_nDOFsGrid, unsigned short val_nDOFsSol, - unsigned long val_offDOfsSol, const unsigned long *connGrid); + CPrimalGridFEM(unsigned long val_elemGlobalID, unsigned short val_VTK_Type, unsigned short val_nPolyGrid, + unsigned short val_nPolySol, unsigned short val_nDOFsGrid, unsigned short val_nDOFsSol, + unsigned long val_offDOfsSol, const unsigned long* connGrid); /*! * \brief Get the number of nodes that composes a face of an element. * \param[in] val_face - Local index of the face. * \return Number of nodes that composes a face of an element. */ - inline unsigned short GetnNodesFace(unsigned short val_face) const override { return std::numeric_limits::max(); } + inline unsigned short GetnNodesFace(unsigned short val_face) const override { + return std::numeric_limits::max(); + } /*! * \brief Get the face index of an element. @@ -98,7 +98,9 @@ class CPrimalGridFEM final: public CPrimalGrid { * \param[in] val_index - Local (to the face) index of the nodes that compose the face. * \return Local (to the element) index of the nodes that compose the face. */ - inline unsigned short GetFaces(unsigned short val_face, unsigned short val_index) const override { return std::numeric_limits::max(); } + inline unsigned short GetFaces(unsigned short val_face, unsigned short val_index) const override { + return std::numeric_limits::max(); + } /*! * \brief Get the local index of the neighbors to a node (given the local index). @@ -106,7 +108,9 @@ class CPrimalGridFEM final: public CPrimalGrid { * \param[in] val_index - Local (to the neighbor nodes of val_node) index of the nodes that are neighbor to val_node. * \return Local (to the element) index of the nodes that are neighbor to val_node. */ - inline unsigned short GetNeighbor_Nodes(unsigned short val_node, unsigned short val_index) const override { return std::numeric_limits::max(); } + inline unsigned short GetNeighbor_Nodes(unsigned short val_node, unsigned short val_index) const override { + return std::numeric_limits::max(); + } /*! * \brief Get the number of nodes of an element. @@ -125,7 +129,9 @@ class CPrimalGridFEM final: public CPrimalGrid { * \param[in] val_node - Local (to the element) index of a node. * \return Number if neighbors of a node val_node. */ - inline unsigned short GetnNeighbor_Nodes(unsigned short val_node) const override { return std::numeric_limits::max(); } + inline unsigned short GetnNeighbor_Nodes(unsigned short val_node) const override { + return std::numeric_limits::max(); + } /*! * \brief Change the orientation of an element. @@ -188,9 +194,8 @@ class CPrimalGridFEM final: public CPrimalGrid { * \param[out] nPointsPerFace - Number of corner points for each of the faces. * \param[out] faceConn - Global IDs of the corner points of the faces. */ - void GetCornerPointsAllFaces(unsigned short &numFaces, - unsigned short nPointsPerFace[], - unsigned long faceConn[6][4]) const override; + void GetCornerPointsAllFaces(unsigned short& numFaces, unsigned short nPointsPerFace[], + unsigned long faceConn[6][4]) const override; /*! * \brief Static member function to get the local the corner points of all the faces @@ -203,12 +208,9 @@ class CPrimalGridFEM final: public CPrimalGrid { * \param[out] nPointsPerFace - Number of corner points for each of the faces. * \param[out] faceConn - Global IDs of the corner points of the faces. */ - static void GetLocalCornerPointsAllFaces(unsigned short elementType, - unsigned short nPoly, - unsigned short nDOFs, - unsigned short &numFaces, - unsigned short nPointsPerFace[], - unsigned long faceConn[6][4]); + static void GetLocalCornerPointsAllFaces(unsigned short elementType, unsigned short nPoly, unsigned short nDOFs, + unsigned short& numFaces, unsigned short nPointsPerFace[], + unsigned long faceConn[6][4]); /*! * \brief Function to get whether or not the Jacobian is considered constant. * \return True if the Jacobian is (almost) constant and false otherwise. @@ -231,11 +233,15 @@ class CPrimalGridFEM final: public CPrimalGrid { * \brief Function to set the value of JacobianConsideredConstant. * \param[in] val_JacobianConsideredConstant - The value to be set for JacobianConsideredConstant. */ - inline void SetJacobianConsideredConstant(bool val_JacobianConsideredConstant) override {JacobianConsideredConstant = val_JacobianConsideredConstant;} + inline void SetJacobianConsideredConstant(bool val_JacobianConsideredConstant) override { + JacobianConsideredConstant = val_JacobianConsideredConstant; + } /*! * \brief Function to correct the offset of the global DOFs. * \param[in] val_offsetRank - The offset that must be added for this rank. */ - inline void AddOffsetGlobalDOFs(const unsigned long val_offsetRank) override {offsetDOFsSolGlobal += val_offsetRank;} + inline void AddOffsetGlobalDOFs(const unsigned long val_offsetRank) override { + offsetDOFsSolGlobal += val_offsetRank; + } }; diff --git a/Common/include/geometry/primal_grid/CPrism.hpp b/Common/include/geometry/primal_grid/CPrism.hpp index 1631aee0067..4466c12b468 100644 --- a/Common/include/geometry/primal_grid/CPrism.hpp +++ b/Common/include/geometry/primal_grid/CPrism.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the CPrism.cpp file. * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -39,10 +39,11 @@ struct CPrismConnectivity { enum { nFaces = N_FACES_PRISM }; enum { maxNodesFace = N_POINTS_QUADRILATERAL }; enum { VTK_Type = PRISM }; - static constexpr unsigned short nNodesFace[5] = {4,4,4,3,3}; - static constexpr unsigned short Faces[5][4] = {{3,4,1,0},{5,2,1,4},{2,5,3,0},{0,1,2,2},{5,4,3,3}}; - static constexpr unsigned short nNeighbor_Nodes[6] = {3,3,3,3,3,3}; - static constexpr unsigned short Neighbor_Nodes[6][3] = {{1,2,3},{0,2,4},{1,0,5},{0,4,5},{3,5,1},{4,3,2}}; + static constexpr unsigned short nNodesFace[5] = {4, 4, 4, 3, 3}; + static constexpr unsigned short Faces[5][4] = {{3, 4, 1, 0}, {5, 2, 1, 4}, {2, 5, 3, 0}, {0, 1, 2, 2}, {5, 4, 3, 3}}; + static constexpr unsigned short nNeighbor_Nodes[6] = {3, 3, 3, 3, 3, 3}; + static constexpr unsigned short Neighbor_Nodes[6][3] = {{1, 2, 3}, {0, 2, 4}, {1, 0, 5}, + {0, 4, 5}, {3, 5, 1}, {4, 3, 2}}; }; /*! @@ -50,8 +51,8 @@ struct CPrismConnectivity { * \brief Class for prism element definition. * \author F. Palacios */ -class CPrism final: public CPrimalGridWithConnectivity { -public: +class CPrism final : public CPrimalGridWithConnectivity { + public: /*! * \brief Constructor using the nodes and index. * \param[in] val_point_0 - Index of the 1st point read from the grid file. @@ -61,8 +62,7 @@ class CPrism final: public CPrimalGridWithConnectivity { * \param[in] val_point_4 - Index of the 5th point read from the grid file. * \param[in] val_point_5 - Index of the 6th point read from the grid file. */ - CPrism(unsigned long val_point_0, unsigned long val_point_1, - unsigned long val_point_2, unsigned long val_point_3, + CPrism(unsigned long val_point_0, unsigned long val_point_1, unsigned long val_point_2, unsigned long val_point_3, unsigned long val_point_4, unsigned long val_point_5); /*! diff --git a/Common/include/geometry/primal_grid/CPyramid.hpp b/Common/include/geometry/primal_grid/CPyramid.hpp index 64722e8dc3b..028136c4f2f 100644 --- a/Common/include/geometry/primal_grid/CPyramid.hpp +++ b/Common/include/geometry/primal_grid/CPyramid.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the CPyramid.cpp file. * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -39,10 +39,11 @@ struct CPyramidConnectivity { enum { nFaces = N_FACES_PYRAMID }; enum { maxNodesFace = N_POINTS_QUADRILATERAL }; enum { VTK_Type = PYRAMID }; - static constexpr unsigned short nNodesFace[5] = {4,3,3,3,3}; - static constexpr unsigned short Faces[5][4] = {{0,3,2,1},{4,3,0,0},{4,0,1,1},{2,4,1,1},{3,4,2,2}}; - static constexpr unsigned short nNeighbor_Nodes[5] = {3,3,3,3,4}; - static constexpr unsigned short Neighbor_Nodes[5][4] = {{1,3,4,4},{0,2,4,4},{1,3,4,4},{2,0,4,4},{0,1,2,3}}; + static constexpr unsigned short nNodesFace[5] = {4, 3, 3, 3, 3}; + static constexpr unsigned short Faces[5][4] = {{0, 3, 2, 1}, {4, 3, 0, 0}, {4, 0, 1, 1}, {2, 4, 1, 1}, {3, 4, 2, 2}}; + static constexpr unsigned short nNeighbor_Nodes[5] = {3, 3, 3, 3, 4}; + static constexpr unsigned short Neighbor_Nodes[5][4] = { + {1, 3, 4, 4}, {0, 2, 4, 4}, {1, 3, 4, 4}, {2, 0, 4, 4}, {0, 1, 2, 3}}; }; /*! @@ -50,22 +51,21 @@ struct CPyramidConnectivity { * \brief Class for pyramid element definition. * \author F. Palacios */ -class CPyramid final: public CPrimalGridWithConnectivity { -public: - /*! - * \brief Constructor using the nodes and index. - * \param[in] val_point_0 - Index of the 1st point read from the grid file. - * \param[in] val_point_1 - Index of the 2nd point read from the grid file. - * \param[in] val_point_2 - Index of the 3th point read from the grid file. - * \param[in] val_point_3 - Index of the 4th point read from the grid file. - * \param[in] val_point_4 - Index of the 5th point read from the grid file. - */ - CPyramid(unsigned long val_point_0, unsigned long val_point_1, - unsigned long val_point_2, unsigned long val_point_3, - unsigned long val_point_4); +class CPyramid final : public CPrimalGridWithConnectivity { + public: + /*! + * \brief Constructor using the nodes and index. + * \param[in] val_point_0 - Index of the 1st point read from the grid file. + * \param[in] val_point_1 - Index of the 2nd point read from the grid file. + * \param[in] val_point_2 - Index of the 3th point read from the grid file. + * \param[in] val_point_3 - Index of the 4th point read from the grid file. + * \param[in] val_point_4 - Index of the 5th point read from the grid file. + */ + CPyramid(unsigned long val_point_0, unsigned long val_point_1, unsigned long val_point_2, unsigned long val_point_3, + unsigned long val_point_4); - /*! - * \brief Change the orientation of an element. - */ - void Change_Orientation() override; + /*! + * \brief Change the orientation of an element. + */ + void Change_Orientation() override; }; diff --git a/Common/include/geometry/primal_grid/CQuadrilateral.hpp b/Common/include/geometry/primal_grid/CQuadrilateral.hpp index f87ff807ed8..435e46e64f2 100644 --- a/Common/include/geometry/primal_grid/CQuadrilateral.hpp +++ b/Common/include/geometry/primal_grid/CQuadrilateral.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the CQuadrilateral.cpp file. * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -39,10 +39,10 @@ struct CQuadrilateralConnectivity { enum { nFaces = N_FACES_QUADRILATERAL }; enum { maxNodesFace = N_POINTS_LINE }; enum { VTK_Type = QUADRILATERAL }; - static constexpr unsigned short nNodesFace[4] = {2,2,2,2}; - static constexpr unsigned short Faces[4][2] = {{0,1},{1,2},{2,3},{3,0}}; - static constexpr unsigned short nNeighbor_Nodes[4] = {2,2,2,2}; - static constexpr unsigned short Neighbor_Nodes[4][2] = {{1,3},{2,0},{3,1},{0,2}}; + static constexpr unsigned short nNodesFace[4] = {2, 2, 2, 2}; + static constexpr unsigned short Faces[4][2] = {{0, 1}, {1, 2}, {2, 3}, {3, 0}}; + static constexpr unsigned short nNeighbor_Nodes[4] = {2, 2, 2, 2}; + static constexpr unsigned short Neighbor_Nodes[4][2] = {{1, 3}, {2, 0}, {3, 1}, {0, 2}}; }; /*! @@ -50,8 +50,8 @@ struct CQuadrilateralConnectivity { * \brief Class for quadrilateral element definition. * \author F. Palacios */ -class CQuadrilateral final: public CPrimalGridWithConnectivity { -public: +class CQuadrilateral final : public CPrimalGridWithConnectivity { + public: /*! * \brief Constructor using the nodes and index. * \param[in] val_point_0 - Index of the 1st point read from the grid file. @@ -59,8 +59,8 @@ class CQuadrilateral final: public CPrimalGridWithConnectivityCTetrahedron.cpp file. * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -39,10 +39,10 @@ struct CTetrahedronConnectivity { enum { nFaces = N_FACES_TETRAHEDRON }; enum { maxNodesFace = N_POINTS_TRIANGLE }; enum { VTK_Type = TETRAHEDRON }; - static constexpr unsigned short nNodesFace[4]={3,3,3,3}; - static constexpr unsigned short Faces[4][3]={{0,2,1},{0,1,3},{0,3,2},{1,2,3}}; - static constexpr unsigned short nNeighbor_Nodes[4]={3,3,3,3}; - static constexpr unsigned short Neighbor_Nodes[4][3]={{1,2,3},{0,2,3},{0,1,3},{0,1,2}}; + static constexpr unsigned short nNodesFace[4] = {3, 3, 3, 3}; + static constexpr unsigned short Faces[4][3] = {{0, 2, 1}, {0, 1, 3}, {0, 3, 2}, {1, 2, 3}}; + static constexpr unsigned short nNeighbor_Nodes[4] = {3, 3, 3, 3}; + static constexpr unsigned short Neighbor_Nodes[4][3] = {{1, 2, 3}, {0, 2, 3}, {0, 1, 3}, {0, 1, 2}}; }; /*! @@ -50,8 +50,8 @@ struct CTetrahedronConnectivity { * \brief Class for tetrahedron element definition. * \author F. Palacios */ -class CTetrahedron final: public CPrimalGridWithConnectivity { -public: +class CTetrahedron final : public CPrimalGridWithConnectivity { + public: /*! * \brief Constructor using the nodes and index. * \param[in] val_point_0 - Index of the 1st point read from the grid file. @@ -59,8 +59,8 @@ class CTetrahedron final: public CPrimalGridWithConnectivityCTriangle.cpp file. * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -39,10 +39,10 @@ struct CTriangleConnectivity { enum { nFaces = N_POINTS_TRIANGLE }; enum { maxNodesFace = N_POINTS_LINE }; enum { VTK_Type = TRIANGLE }; - static constexpr unsigned short nNodesFace[3] = {2,2,2}; - static constexpr unsigned short Faces[3][2] = {{0,1},{1,2},{2,0}}; - static constexpr unsigned short nNeighbor_Nodes[3] = {2,2,2}; - static constexpr unsigned short Neighbor_Nodes[3][2] = {{1,2},{2,0},{0,1}}; + static constexpr unsigned short nNodesFace[3] = {2, 2, 2}; + static constexpr unsigned short Faces[3][2] = {{0, 1}, {1, 2}, {2, 0}}; + static constexpr unsigned short nNeighbor_Nodes[3] = {2, 2, 2}; + static constexpr unsigned short Neighbor_Nodes[3][2] = {{1, 2}, {2, 0}, {0, 1}}; }; /*! @@ -50,21 +50,18 @@ struct CTriangleConnectivity { * \brief Class for triangle element definition. * \author F. Palacios */ -class CTriangle final: public CPrimalGridWithConnectivity { -public: +class CTriangle final : public CPrimalGridWithConnectivity { + public: /*! * \brief Constructor using the nodes and index. * \param[in] val_point_0 - Index of the 1st triangle point read from the grid file. * \param[in] val_point_1 - Index of the 2nd triangle point read from the grid file. * \param[in] val_point_2 - Index of the 3th triangle point read from the grid file. */ - CTriangle(unsigned long val_point_0, unsigned long val_point_1, - unsigned long val_point_2); + CTriangle(unsigned long val_point_0, unsigned long val_point_1, unsigned long val_point_2); /*! * \brief Change the orientation of an element. */ - inline void Change_Orientation() override { - std::swap(Nodes[0], Nodes[2]); - } + inline void Change_Orientation() override { std::swap(Nodes[0], Nodes[2]); } }; diff --git a/Common/include/geometry/primal_grid/CVertexMPI.hpp b/Common/include/geometry/primal_grid/CVertexMPI.hpp index 4d3c1fc3df2..a61b2dc1f93 100644 --- a/Common/include/geometry/primal_grid/CVertexMPI.hpp +++ b/Common/include/geometry/primal_grid/CVertexMPI.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for storing the primal grid structure. * The subroutines and functions are in the primal_grid_structure.cpp file. * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -52,12 +52,12 @@ struct CVertexMPIConnectivity { * of element is used in the parallelization stuff. * \author F. Palacios */ -class CVertexMPI final: public CPrimalGridWithConnectivity { -private: +class CVertexMPI final : public CPrimalGridWithConnectivity { + private: /*! \brief Definition of the rotation, translation of the solution at the vertex. */ unsigned short Rotation_Type; -public: + public: /*! * \brief Constructor using the nodes and index. * \param[in] val_point - Index of the 1st triangle point read from the grid file. diff --git a/Common/include/graph_coloring_structure.hpp b/Common/include/graph_coloring_structure.hpp index 39810948ece..ae428f75554 100644 --- a/Common/include/graph_coloring_structure.hpp +++ b/Common/include/graph_coloring_structure.hpp @@ -4,7 +4,7 @@ * coloring of a given graph. The functions are in the * graph_coloring_structure.cpp file. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -41,10 +41,10 @@ using namespace std; * \ingroup Graph * \brief Class, which provides distributed graph coloring algorithms. * \author: E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CGraphColoringStructure { -public: + public: /*! * \brief Function, which determines the colors for the vertices of the given graph. * \param[in] config - Definition of the particular problem. @@ -55,9 +55,7 @@ class CGraphColoringStructure { * \param[out] nGlobalColors - Global number of colors in the graph. * \param[out] colorLocalVertices - The color of the local vertices of the graph. */ - void GraphVertexColoring(CConfig *config, - const vector &nVerticesPerRank, - const vector > &entriesVertices, - int &nGlobalColors, - vector &colorLocalVertices); + void GraphVertexColoring(CConfig* config, const vector& nVerticesPerRank, + const vector >& entriesVertices, int& nGlobalColors, + vector& colorLocalVertices); }; diff --git a/Common/include/grid_movement/CBSplineBlending.hpp b/Common/include/grid_movement/CBSplineBlending.hpp index c93607f3d0c..09e2408b430 100644 --- a/Common/include/grid_movement/CBSplineBlending.hpp +++ b/Common/include/grid_movement/CBSplineBlending.hpp @@ -3,7 +3,7 @@ * \brief Headers of the CBSplineBlending class. * Defines blending using uniform BSplines * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -38,15 +38,13 @@ using namespace std; * \brief Class that defines the blending using uniform BSplines. * \author T. Albring */ -class CBSplineBlending : public CFreeFormBlending{ - -private: - vector U; /*!< \brief The knot vector for uniform BSplines on the interval [0,1]. */ - vector > N; /*!< \brief The temporary matrix holding the j+p basis functions up to order p. */ - unsigned short KnotSize; /*!< \brief The size of the knot vector. */ - -public: +class CBSplineBlending : public CFreeFormBlending { + private: + vector U; /*!< \brief The knot vector for uniform BSplines on the interval [0,1]. */ + vector > N; /*!< \brief The temporary matrix holding the j+p basis functions up to order p. */ + unsigned short KnotSize; /*!< \brief The size of the knot vector. */ + public: /*! * \brief Constructor of the class. */ @@ -58,9 +56,9 @@ class CBSplineBlending : public CFreeFormBlending{ ~CBSplineBlending() override; /*! - * \brief Returns the value of the i-th basis function and stores the values of the i+p basis functions in the matrix N. - * \param[in] val_i - index of the basis function. - * \param[in] val_t - Point at which we want to evaluate the i-th basis. + * \brief Returns the value of the i-th basis function and stores the values of the i+p basis functions in the matrix + * N. \param[in] val_i - index of the basis function. \param[in] val_t - Point at which we want to evaluate the i-th + * basis. */ su2double GetBasis(short val_i, su2double val_t) override; @@ -78,5 +76,4 @@ class CBSplineBlending : public CFreeFormBlending{ * \param[in] n_controlpoints - the new number of control points. */ void SetOrder(short val_order, short n_controlpoints) override; - }; diff --git a/Common/include/grid_movement/CBezierBlending.hpp b/Common/include/grid_movement/CBezierBlending.hpp index 51c80d2233c..27a03064910 100644 --- a/Common/include/grid_movement/CBezierBlending.hpp +++ b/Common/include/grid_movement/CBezierBlending.hpp @@ -3,7 +3,7 @@ * \brief Headers of the CBezierBlending class. * Defines blending using Bernsteinpolynomials (Bezier Curves) * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -38,10 +38,8 @@ using namespace std; * \brief Class that defines the blending using Bernsteinpolynomials (Bezier Curves). * \author F. Palacios, T. Albring */ -class CBezierBlending : public CFreeFormBlending{ - -private: - +class CBezierBlending : public CFreeFormBlending { + private: vector binomial; /*!< \brief Temporary vector for the Bernstein evaluation. */ /*! @@ -70,8 +68,7 @@ class CBezierBlending : public CFreeFormBlending{ */ su2double Binomial(unsigned short n, unsigned short m); -public: - + public: /*! * \brief Constructor of the class. * \param[in] val_order - Max. order of the basis functions. @@ -85,9 +82,9 @@ class CBezierBlending : public CFreeFormBlending{ ~CBezierBlending() override; /*! - * \brief Returns the value of the i-th basis function and stores the values of the i+p basis functions in the matrix N. - * \param[in] val_i - index of the basis function. - * \param[in] val_t - Point at which we want to evaluate the i-th basis. + * \brief Returns the value of the i-th basis function and stores the values of the i+p basis functions in the matrix + * N. \param[in] val_i - index of the basis function. \param[in] val_t - Point at which we want to evaluate the i-th + * basis. */ su2double GetBasis(short val_i, su2double val_t) override; @@ -105,5 +102,4 @@ class CBezierBlending : public CFreeFormBlending{ * \param[in] n_controlpoints - the new number of control points. */ void SetOrder(short val_order, short n_controlpoints) override; - }; diff --git a/Common/include/grid_movement/CFreeFormBlending.hpp b/Common/include/grid_movement/CFreeFormBlending.hpp index 1cda93ff33b..7edd70c5724 100644 --- a/Common/include/grid_movement/CFreeFormBlending.hpp +++ b/Common/include/grid_movement/CFreeFormBlending.hpp @@ -3,7 +3,7 @@ * \brief Headers of the CFreeFormBlending class. * It is the parent class for the FFD blending function * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -37,14 +37,12 @@ #include "../basic_types/datatype_structure.hpp" class CFreeFormBlending { - -protected: + protected: unsigned short Order, /*!< \brief Order of the polynomial basis. */ - Degree, /*!< \brief Degree (Order - 1) of the polynomial basis. */ - nControl; /*!< \brief Number of control points. */ - -public: + Degree, /*!< \brief Degree (Order - 1) of the polynomial basis. */ + nControl; /*!< \brief Number of control points. */ + public: /*! * \brief Constructor of the class. */ @@ -60,7 +58,7 @@ class CFreeFormBlending { * \param[in] val_i - index of the basis function. * \param[in] val_t - Point at which we want to evaluate the i-th basis. */ - inline virtual su2double GetBasis(short val_i, su2double val_t){return 0.0;} + inline virtual su2double GetBasis(short val_i, su2double val_t) { return 0.0; } /*! * \brief A pure virtual member. @@ -68,22 +66,22 @@ class CFreeFormBlending { * \param[in] val_t - Point at which we want to evaluate the derivative of the i-th basis. * \param[in] val_order - Order of the derivative. */ - inline virtual su2double GetDerivative(short val_i, su2double val_t, short val_order){return 0.0;} + inline virtual su2double GetDerivative(short val_i, su2double val_t, short val_order) { return 0.0; } /*! * \brief A pure virtual member. * \param[in] val_order - The new order of the function. * \param[in] n_controlpoints - the new number of control points. */ - inline virtual void SetOrder(short val_order, short n_controlpoints) { } + inline virtual void SetOrder(short val_order, short n_controlpoints) {} /*! * \brief Returns the current order of the function. */ - inline su2double GetOrder() const{return Order;} + inline su2double GetOrder() const { return Order; } /*! * \brief Returns the current degree of the function. */ - inline su2double GetDegree() const{return Degree;} + inline su2double GetDegree() const { return Degree; } }; diff --git a/Common/include/grid_movement/CFreeFormDefBox.hpp b/Common/include/grid_movement/CFreeFormDefBox.hpp index 7bb489cc911..2513f067802 100644 --- a/Common/include/grid_movement/CFreeFormDefBox.hpp +++ b/Common/include/grid_movement/CFreeFormDefBox.hpp @@ -2,7 +2,7 @@ * \file CFreeFormDefBox.hpp * \brief Headers of the CFreeFormDefBox class. * \author F. Palacios & A. Galdran. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -36,48 +36,46 @@ * \author F. Palacios & A. Galdran. */ class CFreeFormDefBox : public CGridMovement { -public: - unsigned short nDim; /*!< \brief Number of dimensions of the problem. */ - unsigned short nCornerPoints, /*!< \brief Number of corner points of the FFDBox. */ - nControlPoints, nControlPoints_Copy; /*!< \brief Number of control points of the FFDBox. */ - su2double **Coord_Corner_Points, /*!< \brief Coordinates of the corner points. */ - ****Coord_Control_Points, /*!< \brief Coordinates of the control points. */ - ****ParCoord_Control_Points, /*!< \brief Coordinates of the control points. */ - ****Coord_Control_Points_Copy, /*!< \brief Coordinates of the control points (copy). */ - ****Coord_SupportCP{nullptr}; /*!< \brief Coordinates of the support control points. */ - unsigned short lOrder, lOrder_Copy, /*!< \brief Order of the FFDBox in the i direction. */ - mOrder, mOrder_Copy, /*!< \brief Order of the FFDBox in the j direction. */ - nOrder, nOrder_Copy; /*!< \brief Order of the FFDBox in the k direction. */ - unsigned short lDegree, lDegree_Copy, /*!< \brief Degree of the FFDBox in the i direction. (lOrder - 1)*/ - mDegree, mDegree_Copy, /*!< \brief Degree of the FFDBox in the j direction. (mOrder - 1)*/ - nDegree, nDegree_Copy; /*!< \brief Degree of the FFDBox in the k direction. (nOrder - 1)*/ - su2double *ParamCoord, *ParamCoord_, /*!< \brief Parametric coordinates of a point. */ - *cart_coord, *cart_coord_; /*!< \brief Cartesian coordinates of a point. */ - su2double ObjFunc; /*!< \brief Objective function of the point inversion process. */ - su2double *Gradient; /*!< \brief Gradient of the point inversion process. */ - su2double **Hessian; /*!< \brief Hessian of the point inversion process. */ - su2double MaxCoord[3]; /*!< \brief Maximum coordinates of the FFDBox. */ - su2double MinCoord[3]; /*!< \brief Minimum coordinates of the FFDBox. */ - string Tag; /*!< \brief Tag to identify the FFDBox. */ - unsigned short Level; /*!< \brief Nested level of the FFD box. */ + public: + unsigned short nDim; /*!< \brief Number of dimensions of the problem. */ + unsigned short nCornerPoints, /*!< \brief Number of corner points of the FFDBox. */ + nControlPoints, nControlPoints_Copy; /*!< \brief Number of control points of the FFDBox. */ + su2double **Coord_Corner_Points, /*!< \brief Coordinates of the corner points. */ + ****Coord_Control_Points, /*!< \brief Coordinates of the control points. */ + ****ParCoord_Control_Points, /*!< \brief Coordinates of the control points. */ + ****Coord_Control_Points_Copy, /*!< \brief Coordinates of the control points (copy). */ + ****Coord_SupportCP{nullptr}; /*!< \brief Coordinates of the support control points. */ + unsigned short lOrder, lOrder_Copy, /*!< \brief Order of the FFDBox in the i direction. */ + mOrder, mOrder_Copy, /*!< \brief Order of the FFDBox in the j direction. */ + nOrder, nOrder_Copy; /*!< \brief Order of the FFDBox in the k direction. */ + unsigned short lDegree, lDegree_Copy, /*!< \brief Degree of the FFDBox in the i direction. (lOrder - 1)*/ + mDegree, mDegree_Copy, /*!< \brief Degree of the FFDBox in the j direction. (mOrder - 1)*/ + nDegree, nDegree_Copy; /*!< \brief Degree of the FFDBox in the k direction. (nOrder - 1)*/ + su2double *ParamCoord, *ParamCoord_, /*!< \brief Parametric coordinates of a point. */ + *cart_coord, *cart_coord_; /*!< \brief Cartesian coordinates of a point. */ + su2double ObjFunc; /*!< \brief Objective function of the point inversion process. */ + su2double* Gradient; /*!< \brief Gradient of the point inversion process. */ + su2double** Hessian; /*!< \brief Hessian of the point inversion process. */ + su2double MaxCoord[3]; /*!< \brief Maximum coordinates of the FFDBox. */ + su2double MinCoord[3]; /*!< \brief Minimum coordinates of the FFDBox. */ + string Tag; /*!< \brief Tag to identify the FFDBox. */ + unsigned short Level; /*!< \brief Nested level of the FFD box. */ vector CartesianCoord[3]; /*!< \brief Vector with all the cartesian coordinates in the FFD FFDBox. */ vector ParametricCoord[3]; /*!< \brief Vector with all the parametrics coordinates in the FFD FFDBox. */ - vector MarkerIndex; /*!< \brief Vector with all markers in the FFD FFDBox. */ - vector VertexIndex; /*!< \brief Vector with all vertex index in the FFD FFDBox. */ - vector PointIndex; /*!< \brief Vector with all points index in the FFD FFDBox. */ - unsigned long nSurfacePoint; /*!< \brief Number of surfaces in the FFD FFDBox. */ - vector ParentFFDBox; /*!< \brief Vector with all the parent FFD FFDBox. */ - vector ChildFFDBox; /*!< \brief Vector with all the child FFD FFDBox. */ - vector Fix_IPlane; /*!< \brief Fix FFD I plane. */ - vector Fix_JPlane; /*!< \brief Fix FFD J plane. */ - vector Fix_KPlane; /*!< \brief Fix FFD K plane. */ + vector MarkerIndex; /*!< \brief Vector with all markers in the FFD FFDBox. */ + vector VertexIndex; /*!< \brief Vector with all vertex index in the FFD FFDBox. */ + vector PointIndex; /*!< \brief Vector with all points index in the FFD FFDBox. */ + unsigned long nSurfacePoint; /*!< \brief Number of surfaces in the FFD FFDBox. */ + vector ParentFFDBox; /*!< \brief Vector with all the parent FFD FFDBox. */ + vector ChildFFDBox; /*!< \brief Vector with all the child FFD FFDBox. */ + vector Fix_IPlane; /*!< \brief Fix FFD I plane. */ + vector Fix_JPlane; /*!< \brief Fix FFD J plane. */ + vector Fix_KPlane; /*!< \brief Fix FFD K plane. */ CFreeFormBlending** BlendingFunction; - -public: - + public: /*! * \brief Constructor of the class. */ @@ -172,29 +170,32 @@ class CFreeFormDefBox : public CGridMovement { * \brief Add to the vector of cartesian coordinates a new coordinate. * \param[in] val_coord - New coordinate inside the FFD box. */ - inline void Set_CartesianCoord(su2double *val_coord) { CartesianCoord[0].push_back(val_coord[0]); - CartesianCoord[1].push_back(val_coord[1]); - CartesianCoord[2].push_back(val_coord[2]); } - + inline void Set_CartesianCoord(su2double* val_coord) { + CartesianCoord[0].push_back(val_coord[0]); + CartesianCoord[1].push_back(val_coord[1]); + CartesianCoord[2].push_back(val_coord[2]); + } /*! * \brief Adds to the vector of cartesian coordinates. * \param[in] val_coord - New coord inside FFD box. * \param[in] val_iSurfacePoints - Surface points of FFD box. */ - inline void Set_CartesianCoord(const su2double *val_coord, unsigned long val_iSurfacePoints) { CartesianCoord[0][val_iSurfacePoints] = val_coord[0]; - CartesianCoord[1][val_iSurfacePoints] = val_coord[1]; - CartesianCoord[2][val_iSurfacePoints] = val_coord[2]; } - + inline void Set_CartesianCoord(const su2double* val_coord, unsigned long val_iSurfacePoints) { + CartesianCoord[0][val_iSurfacePoints] = val_coord[0]; + CartesianCoord[1][val_iSurfacePoints] = val_coord[1]; + CartesianCoord[2][val_iSurfacePoints] = val_coord[2]; + } /*! * \brief Add to the vector of parametric coordinates a new coordinate. * \param[in] val_coord - New coordinate inside the FFD box. */ - inline void Set_ParametricCoord(su2double *val_coord) { ParametricCoord[0].push_back(val_coord[0]); - ParametricCoord[1].push_back(val_coord[1]); - ParametricCoord[2].push_back(val_coord[2]); } - + inline void Set_ParametricCoord(su2double* val_coord) { + ParametricCoord[0].push_back(val_coord[0]); + ParametricCoord[1].push_back(val_coord[1]); + ParametricCoord[2].push_back(val_coord[2]); + } /*! * \brief Add to the vector of parent FFDBoxes a new FFD FFDBox. @@ -213,10 +214,11 @@ class CFreeFormDefBox : public CGridMovement { * \param[in] val_coord - New coord inside FFD box. * \param[in] val_iSurfacePoints - Surface points of FFD box. */ - inline void Set_ParametricCoord(const su2double *val_coord, unsigned long val_iSurfacePoints) { ParametricCoord[0][val_iSurfacePoints] = val_coord[0]; - ParametricCoord[1][val_iSurfacePoints] = val_coord[1]; - ParametricCoord[2][val_iSurfacePoints] = val_coord[2]; } - + inline void Set_ParametricCoord(const su2double* val_coord, unsigned long val_iSurfacePoints) { + ParametricCoord[0][val_iSurfacePoints] = val_coord[0]; + ParametricCoord[1][val_iSurfacePoints] = val_coord[1]; + ParametricCoord[2][val_iSurfacePoints] = val_coord[2]; + } /*! * \brief Get index of the marker. @@ -240,7 +242,7 @@ class CFreeFormDefBox : public CGridMovement { * \brief Get Cartesian coordinates. * \param[in] Get_VertexIndex - Surface points of FFD box. */ - inline su2double *Get_CartesianCoord(unsigned long val_iSurfacePoints) { + inline su2double* Get_CartesianCoord(unsigned long val_iSurfacePoints) { cart_coord_[0] = CartesianCoord[0][val_iSurfacePoints]; cart_coord_[1] = CartesianCoord[1][val_iSurfacePoints]; cart_coord_[2] = CartesianCoord[2][val_iSurfacePoints]; @@ -251,7 +253,7 @@ class CFreeFormDefBox : public CGridMovement { * \brief Get parametric coordinates. * \param[in] Get_VertexIndex - Surface points of FFD box. */ - inline su2double *Get_ParametricCoord(unsigned long val_iSurfacePoints) { + inline su2double* Get_ParametricCoord(unsigned long val_iSurfacePoints) { ParamCoord_[0] = ParametricCoord[0][val_iSurfacePoints]; ParamCoord_[1] = ParametricCoord[1][val_iSurfacePoints]; ParamCoord_[2] = ParametricCoord[2][val_iSurfacePoints]; @@ -265,7 +267,7 @@ class CFreeFormDefBox : public CGridMovement { /*! * \brief Get number of parent FFD boxes. - */ + */ inline unsigned short GetnParentFFDBox(void) const { return ParentFFDBox.size(); } /*! @@ -290,7 +292,7 @@ class CFreeFormDefBox : public CGridMovement { * and find the position of the control points for the FFDBox * \param[in] FFDBox - Original FFDBox where we want to compute the control points. */ - void SetSupportCPChange(CFreeFormDefBox *FFDBox); + void SetSupportCPChange(CFreeFormDefBox* FFDBox); /*! * \brief Set the number of corner points. @@ -314,7 +316,7 @@ class CFreeFormDefBox : public CGridMovement { * \brief Get the number of control points. * \return Number of control points. */ - inline void SetnControlPoints(void) { nControlPoints = lOrder*mOrder*nOrder; } + inline void SetnControlPoints(void) { nControlPoints = lOrder * mOrder * nOrder; } /*! * \brief Get the number of numerical points on the surface. @@ -332,12 +334,10 @@ class CFreeFormDefBox : public CGridMovement { * \param[in] val_coord - Coordinates of the corner point with index val_icornerpoints. * \param[in] val_icornerpoints - Index of the corner point. */ - inline void SetCoordCornerPoints(const su2double *val_coord, unsigned short val_icornerpoints) { - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Coord_Corner_Points[val_icornerpoints][iDim] = val_coord[iDim]; + inline void SetCoordCornerPoints(const su2double* val_coord, unsigned short val_icornerpoints) { + for (unsigned short iDim = 0; iDim < nDim; iDim++) Coord_Corner_Points[val_icornerpoints][iDim] = val_coord[iDim]; } - /*! * \overload * \param[in] val_xcoord - X coordinate of the corner point with index val_icornerpoints. @@ -345,13 +345,13 @@ class CFreeFormDefBox : public CGridMovement { * \param[in] val_zcoord - Z coordinate of the corner point with index val_icornerpoints. * \param[in] val_icornerpoints - Index of the corner point. */ - inline void SetCoordCornerPoints(su2double val_xcoord, su2double val_ycoord, su2double val_zcoord, unsigned short val_icornerpoints) { + inline void SetCoordCornerPoints(su2double val_xcoord, su2double val_ycoord, su2double val_zcoord, + unsigned short val_icornerpoints) { Coord_Corner_Points[val_icornerpoints][0] = val_xcoord; Coord_Corner_Points[val_icornerpoints][1] = val_ycoord; Coord_Corner_Points[val_icornerpoints][2] = val_zcoord; } - /*! * \brief Set the coordinates of the control points. * \param[in] val_coord - Coordinates of the control point. @@ -359,13 +359,13 @@ class CFreeFormDefBox : public CGridMovement { * \param[in] jDegree - Index of the FFDBox, j direction. * \param[in] kDegree - Index of the FFDBox, k direction. */ - inline void SetCoordControlPoints(const su2double *val_coord, unsigned short iDegree, unsigned short jDegree, unsigned short kDegree) { + inline void SetCoordControlPoints(const su2double* val_coord, unsigned short iDegree, unsigned short jDegree, + unsigned short kDegree) { for (unsigned short iDim = 0; iDim < nDim; iDim++) { Coord_Control_Points[iDegree][jDegree][kDegree][iDim] = val_coord[iDim]; } } - /*! * \brief Set the coordinates of the control points. * \param[in] val_coord - Coordinates of the control point. @@ -373,10 +373,11 @@ class CFreeFormDefBox : public CGridMovement { * \param[in] jDegree - Index of the FFDBox, j direction. * \param[in] kDegree - Index of the FFDBox, k direction. */ - inline void SetCoordControlPoints_Copy(const su2double *val_coord, unsigned short iDegree, unsigned short jDegree, unsigned short kDegree) { + inline void SetCoordControlPoints_Copy(const su2double* val_coord, unsigned short iDegree, unsigned short jDegree, + unsigned short kDegree) { for (unsigned short iDim = 0; iDim < nDim; iDim++) { - Coord_Control_Points_Copy[iDegree][jDegree][kDegree][iDim] = val_coord[iDim]; - } + Coord_Control_Points_Copy[iDegree][jDegree][kDegree][iDim] = val_coord[iDim]; + } } /*! @@ -386,9 +387,10 @@ class CFreeFormDefBox : public CGridMovement { * \param[in] jDegree - Index of the FFDBox, j direction. * \param[in] kDegree - Index of the FFDBox, k direction. */ - inline void SetParCoordControlPoints(const su2double *val_coord, unsigned short iDegree, unsigned short jDegree, unsigned short kDegree) { + inline void SetParCoordControlPoints(const su2double* val_coord, unsigned short iDegree, unsigned short jDegree, + unsigned short kDegree) { for (unsigned short iDim = 0; iDim < nDim; iDim++) - ParCoord_Control_Points[iDegree][jDegree][kDegree][iDim] = val_coord[iDim]; + ParCoord_Control_Points[iDegree][jDegree][kDegree][iDim] = val_coord[iDim]; } /*! @@ -397,14 +399,18 @@ class CFreeFormDefBox : public CGridMovement { * \param[in] val_icornerpoints - Index of the corner point. * \return Coordinate val_dim of the corner point val_icornerpoints. */ - inline su2double GetCoordCornerPoints(unsigned short val_dim, unsigned short val_icornerpoints) const { return Coord_Corner_Points[val_icornerpoints][val_dim]; } + inline su2double GetCoordCornerPoints(unsigned short val_dim, unsigned short val_icornerpoints) const { + return Coord_Corner_Points[val_icornerpoints][val_dim]; + } /*! * \brief Get the coordinates of the corner points. * \param[in] val_icornerpoints - Index of the corner point. * \return Pointer to the coordinate vector of the corner point val_icornerpoints. */ - inline su2double *GetCoordCornerPoints(unsigned short val_icornerpoints) const { return Coord_Corner_Points[val_icornerpoints]; } + inline su2double* GetCoordCornerPoints(unsigned short val_icornerpoints) const { + return Coord_Corner_Points[val_icornerpoints]; + } /*! * \brief Get the coordinates of the control point. @@ -413,7 +419,10 @@ class CFreeFormDefBox : public CGridMovement { * \param[in] val_kindex - Value of the local k index of the control point. * \return Pointer to the coordinate vector of the control point with local index (i, j, k). */ - inline su2double *GetCoordControlPoints(unsigned short val_iindex, unsigned short val_jindex, unsigned short val_kindex) const { return Coord_Control_Points[val_iindex][val_jindex][val_kindex]; } + inline su2double* GetCoordControlPoints(unsigned short val_iindex, unsigned short val_jindex, + unsigned short val_kindex) const { + return Coord_Control_Points[val_iindex][val_jindex][val_kindex]; + } /*! * \brief Get the parametric coordinates of the control point. @@ -422,7 +431,10 @@ class CFreeFormDefBox : public CGridMovement { * \param[in] val_kindex - Value of the local k index of the control point. * \return Pointer to the coordinate vector of the control point with local index (i, j, k). */ - inline su2double *GetParCoordControlPoints(unsigned short val_iindex, unsigned short val_jindex, unsigned short val_kindex) const { return ParCoord_Control_Points[val_iindex][val_jindex][val_kindex]; } + inline su2double* GetParCoordControlPoints(unsigned short val_iindex, unsigned short val_jindex, + unsigned short val_kindex) const { + return ParCoord_Control_Points[val_iindex][val_jindex][val_kindex]; + } /*! * \brief Set the control points in a parallelepiped (hexahedron). @@ -433,14 +445,14 @@ class CFreeFormDefBox : public CGridMovement { * \brief Set the control points of the final chuck in a unitary hexahedron free form. * \param[in] FFDBox - Original FFDBox where we want to compute the control points. */ - void SetSupportCP(CFreeFormDefBox *FFDBox); + void SetSupportCP(CFreeFormDefBox* FFDBox); /*! * \brief Set the new value of the coordinates of the control points. * \param[in] val_index - Local index (i, j, k) of the control point. * \param[in] movement - Movement of the control point. */ - inline void SetControlPoints(const unsigned short *val_index, const su2double *movement) { + inline void SetControlPoints(const unsigned short* val_index, const su2double* movement) { for (unsigned short iDim = 0; iDim < nDim; iDim++) Coord_Control_Points[val_index[0]][val_index[1]][val_index[2]][iDim] += movement[iDim]; } @@ -453,10 +465,15 @@ class CFreeFormDefBox : public CGridMovement { for (unsigned short jDegree = 0; jDegree <= mDegree_Copy; jDegree++) for (unsigned short kDegree = 0; kDegree <= nDegree_Copy; kDegree++) for (unsigned short iDim = 0; iDim < nDim; iDim++) - Coord_Control_Points[iDegree][jDegree][kDegree][iDim] = Coord_Control_Points_Copy[iDegree][jDegree][kDegree][iDim]; - - lDegree = lDegree_Copy; mDegree = mDegree_Copy; nDegree = nDegree_Copy; - lOrder = lOrder_Copy; mOrder = mOrder_Copy; nOrder = nOrder_Copy; + Coord_Control_Points[iDegree][jDegree][kDegree][iDim] = + Coord_Control_Points_Copy[iDegree][jDegree][kDegree][iDim]; + + lDegree = lDegree_Copy; + mDegree = mDegree_Copy; + nDegree = nDegree_Copy; + lOrder = lOrder_Copy; + mOrder = mOrder_Copy; + nOrder = nOrder_Copy; nControlPoints = nControlPoints_Copy; } @@ -465,69 +482,69 @@ class CFreeFormDefBox : public CGridMovement { * \param[in] iFFDBox - Index of the FFD box. * \param[in] original - Original box (before deformation). */ - void SetTecplot(CGeometry *geometry, unsigned short iFFDBox, bool original); + void SetTecplot(CGeometry* geometry, unsigned short iFFDBox, bool original); /*! * \brief Set the paraview file of the FFD chuck structure. * \param[in] iFFDBox - Index of the FFD box. * \param[in] original - Original box (before deformation). */ - void SetParaview(CGeometry *geometry, unsigned short iFFDBox, bool original); + void SetParaview(CGeometry* geometry, unsigned short iFFDBox, bool original); /*! * \brief Set the CGNS file of the FFD chuck structure. * \param[in] iFFDBox - Index of the FFD box. * \param[in] original - Original box (before deformation). */ - void SetCGNS(CGeometry *geometry, unsigned short iFFDBox, bool original); + void SetCGNS(CGeometry* geometry, unsigned short iFFDBox, bool original); /*! * \brief Set Cylindrical to Cartesians_ControlPoints. * \param[in] config - Definition of the particular problem. */ - void SetCyl2Cart_ControlPoints(CConfig *config); + void SetCyl2Cart_ControlPoints(CConfig* config); /*! * \brief Set Cartesians to Cylindrical ControlPoints. * \param[in] config - Definition of the particular problem. */ - void SetCart2Cyl_ControlPoints(CConfig *config); + void SetCart2Cyl_ControlPoints(CConfig* config); /*! * \brief Set Cylindrical to Cartesians_CornerPoints. * \param[in] config - Definition of the particular problem. */ - void SetCyl2Cart_CornerPoints(CConfig *config); + void SetCyl2Cart_CornerPoints(CConfig* config); /*! * \brief Set Cartesians to Cylindrical CornerPoints. * \param[in] config - Definition of the particular problem. */ - void SetCart2Cyl_CornerPoints(CConfig *config); + void SetCart2Cyl_CornerPoints(CConfig* config); /*! * \brief Set Spherical to Cartesians ControlPoints. * \param[in] config - Definition of the particular problem. */ - void SetSphe2Cart_ControlPoints(CConfig *config); + void SetSphe2Cart_ControlPoints(CConfig* config); /*! * \brief SetCartesians to Spherical ControlPoints. * \param[in] config - Definition of the particular problem. */ - void SetCart2Sphe_ControlPoints(CConfig *config); + void SetCart2Sphe_ControlPoints(CConfig* config); /*! * \brief Set Spherical to Cartesians_CornerPoints. * \param[in] config - Definition of the particular problem. */ - void SetSphe2Cart_CornerPoints(CConfig *config); + void SetSphe2Cart_CornerPoints(CConfig* config); /*! * \brief Set Cartesians to Spherical Corner Points. * \param[in] config - Definition of the particular problem. */ - void SetCart2Sphe_CornerPoints(CConfig *config); + void SetCart2Sphe_CornerPoints(CConfig* config); /*! * \brief Set the cartesian coords of a point in R^3 and convert them to the parametric coords of @@ -535,7 +552,7 @@ class CFreeFormDefBox : public CGridMovement { * \param[in] cart_coord - Cartesian coordinates of a point. * \return Pointer to the parametric coordinates of a point. */ - su2double *GetParametricCoord_Analytical(const su2double *cart_coord); + su2double* GetParametricCoord_Analytical(const su2double* cart_coord); /*! * \brief Iterative strategy for computing the parametric coordinates. @@ -545,7 +562,8 @@ class CFreeFormDefBox : public CGridMovement { * \param[in] it_max - Maximal number of iterations. * \return Parametric coordinates of the point. */ - su2double *GetParametricCoord_Iterative(unsigned long iPoint, su2double *xyz, const su2double *guess, CConfig *config); + su2double* GetParametricCoord_Iterative(unsigned long iPoint, su2double* xyz, const su2double* guess, + CConfig* config); /*! * \brief Compute the cross product. @@ -553,10 +571,10 @@ class CFreeFormDefBox : public CGridMovement { * \param[in] v2 - Second input vector. * \param[out] v3 - Output vector wuth the cross product. */ - inline void CrossProduct(const su2double *v1, const su2double *v2, su2double *v3) { - v3[0] = v1[1]*v2[2]-v1[2]*v2[1]; - v3[1] = v1[2]*v2[0]-v1[0]*v2[2]; - v3[2] = v1[0]*v2[1]-v1[1]*v2[0]; + inline void CrossProduct(const su2double* v1, const su2double* v2, su2double* v3) { + v3[0] = v1[1] * v2[2] - v1[2] * v2[1]; + v3[1] = v1[2] * v2[0] - v1[0] * v2[2]; + v3[2] = v1[0] * v2[1] - v1[1] * v2[0]; } /*! @@ -565,7 +583,10 @@ class CFreeFormDefBox : public CGridMovement { * \param[in] v2 - Sencond input vector. * \return Dot product between v1, and v2. */ - inline su2double DotProduct(const su2double *v1, const su2double *v2) { su2double scalar = v1[0]*v2[0]+v1[1]*v2[1]+v1[2]*v2[2]; return scalar; } + inline su2double DotProduct(const su2double* v1, const su2double* v2) { + su2double scalar = v1[0] * v2[0] + v1[1] * v2[1] + v1[2] * v2[2]; + return scalar; + } /*! * \brief Here we take the parametric coords of a point in the box and we convert them to the @@ -573,7 +594,7 @@ class CFreeFormDefBox : public CGridMovement { * \param[in] ParamCoord - Parametric coordinates of a point. * \return Pointer to the cartesian coordinates of a point. */ - su2double *EvalCartesianCoord(su2double *ParamCoord) const; + su2double* EvalCartesianCoord(su2double* ParamCoord) const; /*! * \brief Get the order in the l direction of the FFD FFDBox. @@ -597,27 +618,34 @@ class CFreeFormDefBox : public CGridMovement { * \brief Get the order in the l direction of the FFD FFDBox. * \return Order in the l direction of the FFD FFDBox. */ - inline void SetlOrder(unsigned short val_lOrder) { lOrder = val_lOrder; lDegree = lOrder-1; } + inline void SetlOrder(unsigned short val_lOrder) { + lOrder = val_lOrder; + lDegree = lOrder - 1; + } /*! * \brief Get the order in the m direction of the FFD FFDBox. * \return Order in the m direction of the FFD FFDBox. */ - inline void SetmOrder(unsigned short val_mOrder) { mOrder = val_mOrder; mDegree = mOrder-1; } + inline void SetmOrder(unsigned short val_mOrder) { + mOrder = val_mOrder; + mDegree = mOrder - 1; + } /*! * \brief Get the order in the n direction of the FFD FFDBox. * \return Order in the n direction of the FFD FFDBox. */ - inline void SetnOrder(unsigned short val_nOrder) { nOrder = val_nOrder; nDegree = nOrder-1;} + inline void SetnOrder(unsigned short val_nOrder) { + nOrder = val_nOrder; + nDegree = nOrder - 1; + } /*! - * \brief Set, at each vertex, the index of the free form FFDBox that contains the vertex. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] iFFDBox - Index of the FFDBox. + * \brief Returns true if the point is inside the FFD. + * \param[in] coord - Coordinate of the point to check. */ - bool GetPointFFD(CGeometry *geometry, CConfig *config, unsigned long iPoint) const; + bool CheckPointInsideFFD(const su2double* coord) const; /*! * \brief Set the zone of the computational domain that is going to be deformed. @@ -626,7 +654,7 @@ class CFreeFormDefBox : public CGridMovement { * \param[in] iFFDBox - Index of the FFDBox. */ // this routine is not used. We should consider deleting it. - void SetDeformationZone(CGeometry *geometry, CConfig *config, unsigned short iFFDBox) const; + void SetDeformationZone(CGeometry* geometry, CConfig* config, unsigned short iFFDBox) const; /*! * \brief The routine computes the gradient of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 evaluated at (u, v, w). @@ -635,7 +663,7 @@ class CFreeFormDefBox : public CGridMovement { * \param[in] analytical - Compute the analytical gradient. * \return Value of the analytical gradient. */ - su2double *GetFFDGradient(su2double *val_coord, su2double *xyz); + su2double* GetFFDGradient(su2double* val_coord, su2double* xyz); /*! * \brief The routine that computes the Hessian of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 evaluated at (u, v, w) @@ -645,35 +673,28 @@ class CFreeFormDefBox : public CGridMovement { * \param[in] xyz - Cartesians coordinates of the target point to compose the functional. * \param[in] val_Hessian - Value of the hessian. */ - void GetFFDHessian(su2double *uvw, su2double *xyz, su2double **val_Hessian); + void GetFFDHessian(su2double* uvw, su2double* xyz, su2double** val_Hessian); /*! * \brief An auxiliary routine to help us compute the gradient of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 = * (Sum_ijk^lmn P1_ijk Bi Bj Bk -x)^2+(Sum_ijk^lmn P2_ijk Bi Bj Bk -y)^2+(Sum_ijk^lmn P3_ijk Bi Bj Bk -z)^2 - * Input: val_t, val_diff (to identify the index of the Bernstein polynomail we differentiate), the i, j, k , l, m, n - * E.G.: val_diff=2 => we differentiate w.r.t. w (val_diff=0,1, or 2) Output: d [B_i^l*B_j^m *B_k^n] / d val_diff - * (val_u, val_v, val_w). - * \param[in] uvw - __________. - * \param[in] val_diff - __________. - * \param[in] ijk - __________. - * \param[in] lmn - Degree of the FFD box. - * \return __________. + * Input: val_t, val_diff (to identify the index of the Bernstein polynomail we differentiate), the i, j, k , + * l, m, n E.G.: val_diff=2 => we differentiate w.r.t. w (val_diff=0,1, or 2) Output: d [B_i^l*B_j^m *B_k^n] / d + * val_diff (val_u, val_v, val_w). \param[in] uvw - __________. \param[in] val_diff - __________. \param[in] ijk - + * __________. \param[in] lmn - Degree of the FFD box. \return __________. */ - su2double GetDerivative1(su2double *uvw, unsigned short val_diff, unsigned short *ijk, unsigned short *lmn) const; + su2double GetDerivative1(su2double* uvw, unsigned short val_diff, unsigned short* ijk, unsigned short* lmn) const; /*! * \brief An auxiliary routine to help us compute the gradient of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 = * (Sum_ijk^lmn P1_ijk Bi Bj Bk -x)^2+(Sum_ijk^lmn P2_ijk Bi Bj Bk -y)^2+(Sum_ijk^lmn P3_ijk Bi Bj Bk -z)^2 - * Input: (u, v, w), dim , xyz=(x, y, z), l, m, n E.G.: dim=2 => we use the third coordinate of the control points, - * and the z-coordinate of xyz (0<=dim<=2) Output: 2* ( (Sum_{i, j, k}^l, m, n P_{ijk}[dim] B_i^l[u] B_j^m[v] B_k^n[w]) - - * xyz[dim]). - * \param[in] uvw - __________. - * \param[in] dim - __________. - * \param[in] xyz - __________. + * Input: (u, v, w), dim , xyz=(x, y, z), l, m, n E.G.: dim=2 => we use the third coordinate of the control + * points, and the z-coordinate of xyz (0<=dim<=2) Output: 2* ( (Sum_{i, j, k}^l, m, n P_{ijk}[dim] B_i^l[u] B_j^m[v] + * B_k^n[w]) - xyz[dim]). \param[in] uvw - __________. \param[in] dim - __________. \param[in] xyz - __________. * \param[in] lmn - Degree of the FFD box. * \return __________. */ - su2double GetDerivative2(su2double *uvw, unsigned short dim, const su2double *xyz, const unsigned short *lmn) const; + su2double GetDerivative2(su2double* uvw, unsigned short dim, const su2double* xyz, const unsigned short* lmn) const; /*! * \brief An auxiliary routine to help us compute the gradient of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 = @@ -687,25 +708,20 @@ class CFreeFormDefBox : public CGridMovement { * which? diff_thiss will tell us ; E.G.: dim=2, diff_this=1 => we use the third coordinate of the control * points, and derivate de v-Bersntein polynomial (use m-1 when summing!!). */ - su2double GetDerivative3(su2double *uvw, unsigned short dim, unsigned short diff_this, - unsigned short *lmn); + su2double GetDerivative3(su2double* uvw, unsigned short dim, unsigned short diff_this, unsigned short* lmn) const; /*! * \brief An auxiliary routine to help us compute the Hessian of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 = * (Sum_ijk^lmn P1_ijk Bi Bj Bk -x)^2+(Sum_ijk^lmn P2_ijk Bi Bj Bk -y)+(Sum_ijk^lmn P3_ijk Bi Bj Bk -z) - * Input: val_t, val_diff, val_diff2 (to identify the index of the Bernstein polynomials we differentiate), the i, j, k , l, m, n - * E.G.: val_diff=1, val_diff2=2 => we differentiate w.r.t. v and w (val_diff=0,1, or 2) - * E.G.: val_diff=0, val_diff2=0 => we differentiate w.r.t. u two times - * Output: [d [B_i^l*B_j^m *B_k^n]/d val_diff *d [B_i^l*B_j^m *B_k^n]/d val_diff2] (val_u, val_v, val_w) . - * \param[in] uvw - __________. - * \param[in] val_diff - __________. - * \param[in] val_diff2 - __________. - * \param[in] ijk - __________. - * \param[in] lmn - Degree of the FFD box. + * Input: val_t, val_diff, val_diff2 (to identify the index of the Bernstein polynomials we differentiate), the + * i, j, k , l, m, n E.G.: val_diff=1, val_diff2=2 => we differentiate w.r.t. v and w (val_diff=0,1, or 2) E.G.: + * val_diff=0, val_diff2=0 => we differentiate w.r.t. u two times Output: [d [B_i^l*B_j^m *B_k^n]/d val_diff *d + * [B_i^l*B_j^m *B_k^n]/d val_diff2] (val_u, val_v, val_w) . \param[in] uvw - __________. \param[in] val_diff - + * __________. \param[in] val_diff2 - __________. \param[in] ijk - __________. \param[in] lmn - Degree of the FFD box. * \return __________. */ - su2double GetDerivative4(su2double *uvw, unsigned short val_diff, unsigned short val_diff2, - unsigned short *ijk, unsigned short *lmn) const; + su2double GetDerivative4(su2double* uvw, unsigned short val_diff, unsigned short val_diff2, unsigned short* ijk, + unsigned short* lmn) const; /*! * \brief An auxiliary routine to help us compute the Hessian of F(u, v, w) = ||X(u, v, w)-(x, y, z)||^2 = @@ -723,15 +739,18 @@ class CFreeFormDefBox : public CGridMovement { * \param[in] lmn - Degree of the FFD box. * \return __________. */ - su2double GetDerivative5(su2double *uvw, unsigned short dim, unsigned short diff_this, unsigned short diff_this_also, - unsigned short *lmn); + su2double GetDerivative5(su2double* uvw, unsigned short dim, unsigned short diff_this, unsigned short diff_this_also, + unsigned short* lmn) const; /*! * \brief Euclidean norm of a vector. * \param[in] a - _______. * \return __________. */ - inline su2double GetNorm(const su2double *a) { su2double norm = sqrt(a[0]*a[0] + a[1]*a[1]+ a[2]*a[2]); return norm; } + inline su2double GetNorm(const su2double* a) { + su2double norm = sqrt(a[0] * a[0] + a[1] * a[1] + a[2] * a[2]); + return norm; + } /*! * \brief Set the tag that identify a FFDBox. @@ -756,5 +775,4 @@ class CFreeFormDefBox : public CGridMovement { * \return Value of the nested level of the the FFDBox. */ inline unsigned short GetLevel() const { return Level; } - }; diff --git a/Common/include/grid_movement/CGridMovement.hpp b/Common/include/grid_movement/CGridMovement.hpp index a382b58fd0f..3429c10c6ce 100644 --- a/Common/include/grid_movement/CGridMovement.hpp +++ b/Common/include/grid_movement/CGridMovement.hpp @@ -2,7 +2,7 @@ * \file CGridMovement.hpp * \brief Headers of the CGridMovement class * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -37,13 +37,11 @@ * \author F. Palacios */ class CGridMovement { + protected: + int rank, /*!< \brief MPI Rank. */ + size; /*!< \brief MPI Size. */ -protected: - int rank, /*!< \brief MPI Rank. */ - size; /*!< \brief MPI Size. */ - -public: - + public: /*! * \brief Constructor of the class. */ @@ -60,7 +58,7 @@ class CGridMovement { * \param[in] config - Definition of the particular problem. * \return Total deformation applied, which may be less than target if intersection prevention is used. */ - inline virtual vector > SetSurface_Deformation(CGeometry *geometry, CConfig *config) { + inline virtual vector > SetSurface_Deformation(CGeometry* geometry, CConfig* config) { return vector >(); } }; diff --git a/Common/include/grid_movement/CSurfaceMovement.hpp b/Common/include/grid_movement/CSurfaceMovement.hpp index 5558783a4e9..0ef697e049d 100644 --- a/Common/include/grid_movement/CSurfaceMovement.hpp +++ b/Common/include/grid_movement/CSurfaceMovement.hpp @@ -2,7 +2,7 @@ * \file CSurfaceMovement.hpp * \brief Headers of the CSurfaceMovement class. * \author F. Palacios, T. Economon. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -36,13 +36,13 @@ * \author F. Palacios, T. Economon. */ class CSurfaceMovement : public CGridMovement { -protected: + protected: CFreeFormDefBox** FFDBox; /*!< \brief Definition of the Free Form Deformation Box. */ - unsigned short nFFDBox; /*!< \brief Number of FFD FFDBoxes. */ - unsigned short nLevel; /*!< \brief Level of the FFD FFDBoxes (parent/child). */ - bool FFDBoxDefinition; /*!< \brief If the FFD FFDBox has been defined in the input file. */ + unsigned short nFFDBox; /*!< \brief Number of FFD FFDBoxes. */ + unsigned short nLevel; /*!< \brief Level of the FFD FFDBoxes (parent/child). */ + bool FFDBoxDefinition; /*!< \brief If the FFD FFDBox has been defined in the input file. */ -public: + public: vector GlobalCoordX[MAX_NUMBER_FFD]; vector GlobalCoordY[MAX_NUMBER_FFD]; vector GlobalCoordZ[MAX_NUMBER_FFD]; @@ -66,7 +66,7 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iDV - Index of the design variable. * \param[in] ResetDef - Reset the deformation before starting a new one. */ - void SetHicksHenne(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef); + void SetHicksHenne(CGeometry* boundary, CConfig* config, unsigned short iDV, bool ResetDef); /*! * \brief Set a Hicks-Henne deformation bump functions on an airfoil. @@ -75,7 +75,7 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iDV - Index of the design variable. * \param[in] ResetDef - Reset the deformation before starting a new one. */ - void SetSurface_Bump(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef); + void SetSurface_Bump(CGeometry* boundary, CConfig* config, unsigned short iDV, bool ResetDef); /*! * \brief Set a Hicks-Henne deformation bump functions on an airfoil. @@ -84,7 +84,7 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iDV - Index of the design variable. * \param[in] ResetDef - Reset the deformation before starting a new one. */ - void SetAngleOfAttack(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef); + void SetAngleOfAttack(CGeometry* boundary, CConfig* config, unsigned short iDV, bool ResetDef); /*! * \brief Set a deformation based on a change in the Kulfan parameters for an airfoil. @@ -93,28 +93,28 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iDV - Index of the design variable. * \param[in] ResetDef - Reset the deformation before starting a new one. */ - void SetCST(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef); + void SetCST(CGeometry* boundary, CConfig* config, unsigned short iDV, bool ResetDef); /*! * \brief Set a NACA 4 digits airfoil family for airfoil deformation. * \param[in] boundary - Geometry of the boundary. * \param[in] config - Definition of the particular problem. */ - void SetNACA_4Digits(CGeometry *boundary, CConfig *config); + void SetNACA_4Digits(CGeometry* boundary, CConfig* config); /*! * \brief Set a parabolic family for airfoil deformation. * \param[in] boundary - Geometry of the boundary. * \param[in] config - Definition of the particular problem. */ - void SetParabolic(CGeometry *boundary, CConfig *config); + void SetParabolic(CGeometry* boundary, CConfig* config); /*! * \brief Set a obstacle in a channel. * \param[in] boundary - Geometry of the boundary. * \param[in] config - Definition of the particular problem. */ - void SetAirfoil(CGeometry *boundary, CConfig *config); + void SetAirfoil(CGeometry* boundary, CConfig* config); /*! * \brief Set a rotation for surface movement. @@ -123,7 +123,7 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iDV - Index of the design variable. * \param[in] ResetDef - Reset the deformation before starting a new one. */ - void SetRotation(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef); + void SetRotation(CGeometry* boundary, CConfig* config, unsigned short iDV, bool ResetDef); /*! * \brief Computes the displacement of a rotating surface for a dynamic mesh simulation. @@ -132,8 +132,7 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iter - Current physical time iteration. * \param[in] iZone - Zone number in the mesh. */ - void HTP_Rotation(CGeometry *geometry, CConfig *config, - unsigned long iter, unsigned short iZone); + void HTP_Rotation(CGeometry* geometry, CConfig* config, unsigned long iter, unsigned short iZone); /*! * \brief Unsteady aeroelastic grid movement by deforming the mesh. @@ -144,7 +143,8 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iMarker_Monitoring - Marker we are monitoring. * \param[in] displacements - solution of typical section wing model. */ - void AeroelasticDeform(CGeometry *geometry, CConfig *config, unsigned long TimeIter, unsigned short iMarker, unsigned short iMarker_Monitoring, vector& displacements); + void AeroelasticDeform(CGeometry* geometry, CConfig* config, unsigned long TimeIter, unsigned short iMarker, + unsigned short iMarker_Monitoring, vector& displacements); /*! * \brief Deforms a 3-D flutter/pitching surface during an unsteady simulation. @@ -153,15 +153,15 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iter - Current physical time iteration. * \param[in] iZone - Zone number in the mesh. */ - void SetBoundary_Flutter3D(CGeometry *geometry, CConfig *config, - CFreeFormDefBox **FFDBox, unsigned long iter, unsigned short iZone); + void SetBoundary_Flutter3D(CGeometry* geometry, CConfig* config, CFreeFormDefBox** FFDBox, unsigned long iter, + unsigned short iZone); /*! * \brief Set the collective pitch for a blade surface movement. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void SetCollective_Pitch(CGeometry *geometry, CConfig *config); + void SetCollective_Pitch(CGeometry* geometry, CConfig* config); /*! * \brief Set any surface deformationsbased on an input file. @@ -170,7 +170,7 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iZone - Zone number in the mesh. * \param[in] iter - Current physical time iteration. */ - void SetExternal_Deformation(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter); + void SetExternal_Deformation(CGeometry* geometry, CConfig* config, unsigned short iZone, unsigned long iter); /*! * \brief Set a displacement for surface movement. @@ -179,7 +179,7 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iDV - Index of the design variable. * \param[in] ResetDef - Reset the deformation before starting a new one. */ - void SetTranslation(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef); + void SetTranslation(CGeometry* boundary, CConfig* config, unsigned short iDV, bool ResetDef); /*! * \brief Set a displacement for surface movement. @@ -188,14 +188,14 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iDV - Index of the design variable. * \param[in] ResetDef - Reset the deformation before starting a new one. */ - void SetScale(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef); + void SetScale(CGeometry* boundary, CConfig* config, unsigned short iDV, bool ResetDef); /*! * \brief Copy the boundary coordinates to each vertex. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void CopyBoundary(CGeometry *geometry, CConfig *config); + void CopyBoundary(CGeometry* geometry, CConfig* config); /*! * \brief Set the surface/boundary deformation. @@ -203,7 +203,7 @@ class CSurfaceMovement : public CGridMovement { * \param[in] config - Definition of the particular problem. * \return Total deformation applied, which may be less than target if intersection prevention is used. */ - vector > SetSurface_Deformation(CGeometry *geometry, CConfig *config) override; + vector > SetSurface_Deformation(CGeometry* geometry, CConfig* config) override; /*! * \brief Compute the parametric coordinates of a grid point using a point inversion strategy @@ -212,7 +212,7 @@ class CSurfaceMovement : public CGridMovement { * \param[in] config - Definition of the particular problem. * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation. */ - void SetParametricCoord(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iFFDBox); + void SetParametricCoord(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, unsigned short iFFDBox); /*! * \brief Update the parametric coordinates of a grid point using a point inversion strategy @@ -222,7 +222,7 @@ class CSurfaceMovement : public CGridMovement { * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation. * \param[in] iFFDBox - Index of FFD box. */ - void UpdateParametricCoord(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iFFDBox); + void UpdateParametricCoord(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, unsigned short iFFDBox); /*! * \brief Check the intersections of the FFD with the surface @@ -231,7 +231,7 @@ class CSurfaceMovement : public CGridMovement { * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation. * \param[in] iFFDBox - Index of FFD box. */ - void CheckFFDIntersections(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iFFDBox); + void CheckFFDIntersections(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, unsigned short iFFDBox); /*! * \brief Check the intersections of the FFD with the surface @@ -240,7 +240,7 @@ class CSurfaceMovement : public CGridMovement { * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation. * \param[in] iFFDBox - Index of FFD box. */ - void CheckFFDDimension(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iFFDBox); + void CheckFFDDimension(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, unsigned short iFFDBox); /*! * \brief Set the Parametric coordinates. @@ -249,7 +249,8 @@ class CSurfaceMovement : public CGridMovement { * \param[in] FFDBoxParent - Array with parent FFDBoxes of the computation. * \param[in] FFDBoxChild - Array with child FFDBoxes of the computation. */ - void SetParametricCoordCP(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBoxParent, CFreeFormDefBox *FFDBoxChild); + void SetParametricCoordCP(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBoxParent, + CFreeFormDefBox* FFDBoxChild); /*! * \brief Get the cartes. @@ -258,7 +259,8 @@ class CSurfaceMovement : public CGridMovement { * \param[in] FFDBoxParent - Array with parent FFDBoxes of the computation. * \param[in] FFDBoxChild - Array with child FFDBoxes of the computation. */ - void GetCartesianCoordCP(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBoxParent, CFreeFormDefBox *FFDBoxChild); + void GetCartesianCoordCP(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBoxParent, + CFreeFormDefBox* FFDBoxChild); /*! * \brief Apply the design variables to the control point position @@ -267,7 +269,7 @@ class CSurfaceMovement : public CGridMovement { * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation. * \param[in] iFFDBox - Index of FFD box. */ - void ApplyDesignVariables(CGeometry *geometry, CConfig *config, CFreeFormDefBox **FFDBox, unsigned short iFFDBox); + void ApplyDesignVariables(CGeometry* geometry, CConfig* config, CFreeFormDefBox** FFDBox, unsigned short iFFDBox); /*! * \brief Recompute the cartesian coordinates using the control points position. @@ -276,7 +278,8 @@ class CSurfaceMovement : public CGridMovement { * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation. * \param[in] iFFDBox - Index of FFD box. */ - su2double SetCartesianCoord(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iFFDBox, bool ResetDef); + su2double SetCartesianCoord(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, unsigned short iFFDBox, + bool ResetDef); /*! * \brief Set the deformation of the Free From box using the control point position. @@ -286,7 +289,8 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iDV - Index of the design variable. * \param[in] ResetDef - Reset the deformation before starting a new one. */ - bool SetFFDCPChange_2D(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, unsigned short iDV, bool ResetDef) const; + bool SetFFDCPChange_2D(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, CFreeFormDefBox** ResetFFDBox, + unsigned short iDV, bool ResetDef) const; /*! * \brief Set the deformation of the Free From box using the control point position. @@ -296,7 +300,8 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iDV - Index of the design variable. * \param[in] ResetDef - Reset the deformation before starting a new one. */ - bool SetFFDCPChange(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, unsigned short iDV, bool ResetDef) const; + bool SetFFDCPChange(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, CFreeFormDefBox** ResetFFDBox, + unsigned short iDV, bool ResetDef) const; /*! * \brief Set the deformation of the Free From box using the control point position. @@ -306,7 +311,8 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iDV - Index of the design variable. * \param[in] ResetDef - Reset the deformation before starting a new one. */ - bool SetFFDGull(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, unsigned short iDV, bool ResetDef) const; + bool SetFFDGull(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, CFreeFormDefBox** ResetFFDBox, + unsigned short iDV, bool ResetDef) const; /*! * \brief Set the deformation of the Free From box using the control point position. @@ -316,7 +322,8 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iDV - Index of the design variable. * \param[in] ResetDef - Reset the deformation before starting a new one. */ - bool SetFFDNacelle(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, unsigned short iDV, bool ResetDef) const; + bool SetFFDNacelle(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, CFreeFormDefBox** ResetFFDBox, + unsigned short iDV, bool ResetDef) const; /*! * \brief Set a camber deformation of the Free From box using the control point position. @@ -326,17 +333,8 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iDV - Index of the design variable. * \param[in] ResetDef - Reset the deformation before starting a new one. */ - bool SetFFDCamber_2D(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, unsigned short iDV, bool ResetDef) const; - - /*! - * \brief Set a camber deformation of the Free From box using the control point position. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation. - * \param[in] iDV - Index of the design variable. - * \param[in] ResetDef - Reset the deformation before starting a new one. - */ - bool SetFFDTwist_2D(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, unsigned short iDV, bool ResetDef); + bool SetFFDCamber_2D(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, CFreeFormDefBox** ResetFFDBox, + unsigned short iDV, bool ResetDef) const; /*! * \brief Set a thickness deformation of the Free From box using the control point position. @@ -346,7 +344,8 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iDV - Index of the design variable. * \param[in] ResetDef - Reset the deformation before starting a new one. */ - bool SetFFDThickness_2D(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, unsigned short iDV, bool ResetDef) const; + bool SetFFDThickness_2D(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, CFreeFormDefBox** ResetFFDBox, + unsigned short iDV, bool ResetDef) const; /*! * \brief Set a camber deformation of the Free From box using the control point position. @@ -356,7 +355,8 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iDV - Index of the design variable. * \param[in] ResetDef - Reset the deformation before starting a new one. */ - bool SetFFDCamber(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, unsigned short iDV, bool ResetDef) const; + bool SetFFDCamber(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, CFreeFormDefBox** ResetFFDBox, + unsigned short iDV, bool ResetDef) const; /*! * \brief Set a thickness deformation of the Free From box using the control point position. @@ -366,7 +366,8 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iDV - Index of the design variable. * \param[in] ResetDef - Reset the deformation before starting a new one. */ - bool SetFFDThickness(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, unsigned short iDV, bool ResetDef) const; + bool SetFFDThickness(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, CFreeFormDefBox** ResetFFDBox, + unsigned short iDV, bool ResetDef) const; /*! * \brief Set a thickness deformation of the Free From box using the control point position. @@ -376,7 +377,8 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iDV - Index of the design variable. * \param[in] ResetDef - Reset the deformation before starting a new one. */ - void SetFFDAngleOfAttack(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, unsigned short iDV, bool ResetDef); + void SetFFDAngleOfAttack(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, CFreeFormDefBox** ResetFFDBox, + unsigned short iDV, bool ResetDef); /*! * \brief Set a twist angle deformation of the Free From box using the control point position. @@ -386,7 +388,8 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iDV - Index of the design variable. * \param[in] ResetDef - Reset the deformation before starting a new one. */ - bool SetFFDTwist(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, unsigned short iDV, bool ResetDef) const; + bool SetFFDTwist(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, CFreeFormDefBox** ResetFFDBox, + unsigned short iDV, bool ResetDef) const; /*! * \brief Set a rotation angle deformation of the Free From box using the control point position. @@ -396,7 +399,8 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iDV - Index of the design variable. * \param[in] ResetDef - Reset the deformation before starting a new one. */ - bool SetFFDRotation(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox,CFreeFormDefBox **ResetFFDBox, unsigned short iDV, bool ResetDef) const; + bool SetFFDRotation(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, CFreeFormDefBox** ResetFFDBox, + unsigned short iDV, bool ResetDef) const; /*! * \brief Set a rotation angle deformation in a control surface of the Free From box using the control point position. @@ -406,7 +410,8 @@ class CSurfaceMovement : public CGridMovement { * \param[in] iDV - Index of the design variable. * \param[in] ResetDef - Reset the deformation before starting a new one. */ - bool SetFFDControl_Surface(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, unsigned short iDV, bool ResetDef) const; + bool SetFFDControl_Surface(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, + CFreeFormDefBox** ResetFFDBox, unsigned short iDV, bool ResetDef) const; /*! * \brief Read the free form information from the grid input file. @@ -417,7 +422,7 @@ class CSurfaceMovement : public CGridMovement { * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation. * \param[in] val_mesh_filename - Name of the grid input file. */ - void ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFormDefBox **FFDBox, string val_mesh_filename); + void ReadFFDInfo(CGeometry* geometry, CConfig* config, CFreeFormDefBox** FFDBox, const string& val_mesh_filename); /*! * \brief Read the free form information from the grid input file. @@ -427,7 +432,7 @@ class CSurfaceMovement : public CGridMovement { * \param[in] geometry - Geometrical definition of the problem. * \param[in] FFDBox - Array with all the free forms FFDBoxes of the computation. */ - void ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFormDefBox **FFDBox); + void ReadFFDInfo(CGeometry* geometry, CConfig* config, CFreeFormDefBox** FFDBox); /*! * \brief Merge the Free Form information in the SU2 file. @@ -435,7 +440,7 @@ class CSurfaceMovement : public CGridMovement { * \param[in] geometry - Geometrical definition of the problem. * \param[in] val_mesh_filename - Name of the grid output file. */ - void MergeFFDInfo(CGeometry *geometry, CConfig *config); + void MergeFFDInfo(CGeometry* geometry, CConfig* config); /*! * \brief Write the Free Form information in the SU2 file. @@ -443,7 +448,7 @@ class CSurfaceMovement : public CGridMovement { * \param[in] geometry - Geometrical definition of the problem. * \param[in] val_mesh_filename - Name of the grid output file. */ - void WriteFFDInfo(CSurfaceMovement **surface_movement, CGeometry **geometry, CConfig **config); + void WriteFFDInfo(CSurfaceMovement** surface_movement, CGeometry**** geometry, CConfig** config); /*! * \brief Get information about if there is a complete FFDBox definition, or it is necessary to @@ -459,14 +464,15 @@ class CSurfaceMovement : public CGridMovement { * \return TRUE if the FFD box name referenced with DV_PARAM can be found in the FFD box definition; * otherwise FALSE. */ - inline bool CheckFFDBoxDefinition(CConfig *config, unsigned short iDV) { + inline bool CheckFFDBoxDefinition(CConfig* config, unsigned short iDV) { for (unsigned short iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { - if (FFDBox[iFFDBox]->GetTag() == config->GetFFDTag(iDV)) { return true;} + if (FFDBox[iFFDBox]->GetTag() == config->GetFFDTag(iDV)) { + return true; + } } return false; } - /*! * \brief Obtain the number of FFDBoxes. * \return Number of FFD FFDBoxes. @@ -484,7 +490,7 @@ class CSurfaceMovement : public CGridMovement { * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void SetSurface_Derivative(CGeometry *geometry, CConfig *config); + void SetSurface_Derivative(CGeometry* geometry, CConfig* config); /*! * \brief Calculate the determinant of the Jacobian matrix for the FFD problem. @@ -493,5 +499,5 @@ class CSurfaceMovement : public CGridMovement { * \param[in] FFDBox - Free form deformation box. * \return Number of points with negative Jacobian determinant. */ - unsigned long calculateJacobianDeterminant(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox) const; + unsigned long calculateJacobianDeterminant(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox) const; }; diff --git a/Common/include/grid_movement/CVolumetricMovement.hpp b/Common/include/grid_movement/CVolumetricMovement.hpp index 0a1503f6402..1520cb05829 100644 --- a/Common/include/grid_movement/CVolumetricMovement.hpp +++ b/Common/include/grid_movement/CVolumetricMovement.hpp @@ -2,7 +2,7 @@ * \file CVolumetricMovement.hpp * \brief Headers of the CVolumetricMovement class. * \author F. Palacios, A. Bueno, T. Economon, S. Padron. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -38,28 +38,26 @@ * \author F. Palacios, A. Bueno, T. Economon, S. Padron. */ class CVolumetricMovement : public CGridMovement { -protected: + protected: + unsigned short nDim; /*!< \brief Number of dimensions. */ + unsigned short nVar; /*!< \brief Number of variables. */ - unsigned short nDim; /*!< \brief Number of dimensions. */ - unsigned short nVar; /*!< \brief Number of variables. */ + unsigned long nPoint; /*!< \brief Number of points. */ + unsigned long nPointDomain; /*!< \brief Number of points in the domain. */ - unsigned long nPoint; /*!< \brief Number of points. */ - unsigned long nPointDomain; /*!< \brief Number of points in the domain. */ - - unsigned long nIterMesh; /*!< \brief Number of iterations in the mesh update. +*/ + unsigned long nIterMesh; /*!< \brief Number of iterations in the mesh update. +*/ #ifndef CODI_FORWARD_TYPE CSysMatrix StiffMatrix; /*!< \brief Stiffness matrix of the elasticity problem. */ - CSysSolve System; /*!< \brief Linear solver/smoother. */ + CSysSolve System; /*!< \brief Linear solver/smoother. */ #else CSysMatrix StiffMatrix; - CSysSolve System; + CSysSolve System; #endif CSysVector LinSysSol; CSysVector LinSysRes; -public: - + public: /*! * \brief Constructor of the class. */ @@ -68,7 +66,7 @@ class CVolumetricMovement : public CGridMovement { /*! * \brief Constructor of the class. */ - CVolumetricMovement(CGeometry *geometry, CConfig *config); + CVolumetricMovement(CGeometry* geometry, CConfig* config); /*! * \brief Destructor of the class. @@ -80,21 +78,21 @@ class CVolumetricMovement : public CGridMovement { * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void UpdateGridCoord(CGeometry *geometry, CConfig *config); + void UpdateGridCoord(CGeometry* geometry, CConfig* config); /*! * \brief Update the dual grid after the grid movement (edges and control volumes). * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void UpdateDualGrid(CGeometry *geometry, CConfig *config); + void UpdateDualGrid(CGeometry* geometry, CConfig* config); /*! * \brief Update the coarse multigrid levels after the grid movement. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void UpdateMultiGrid(CGeometry **geometry, CConfig *config); + void UpdateMultiGrid(CGeometry** geometry, CConfig* config); /*! * \brief Compute the stiffness matrix for grid deformation using spring analogy. @@ -102,7 +100,7 @@ class CVolumetricMovement : public CGridMovement { * \param[in] config - Definition of the particular problem. * \return Value of the length of the smallest edge of the grid. */ - su2double SetFEAMethodContributions_Elem(CGeometry *geometry, CConfig *config); + su2double SetFEAMethodContributions_Elem(CGeometry* geometry, CConfig* config); /*! * \brief Build the stiffness matrix for a 3-D hexahedron element. The result will be placed in StiffMatrix_Elem. @@ -114,8 +112,9 @@ class CVolumetricMovement : public CGridMovement { * \param[in] nNodes - Number of nodes defining the element. * \param[in] scale */ - void SetFEA_StiffMatrix3D(CGeometry *geometry, CConfig *config, su2double **StiffMatrix_Elem, unsigned long PointCorners[8], su2double CoordCorners[8][3], - unsigned short nNodes, su2double ElemVolume, su2double ElemDistance); + void SetFEA_StiffMatrix3D(CGeometry* geometry, CConfig* config, su2double** StiffMatrix_Elem, + unsigned long PointCorners[8], su2double CoordCorners[8][3], unsigned short nNodes, + su2double ElemVolume, su2double ElemDistance); /*! * \brief Build the stiffness matrix for a 3-D hexahedron element. The result will be placed in StiffMatrix_Elem. @@ -127,8 +126,9 @@ class CVolumetricMovement : public CGridMovement { * \param[in] nNodes - Number of nodes defining the element. * \param[in] scale */ - void SetFEA_StiffMatrix2D(CGeometry *geometry, CConfig *config, su2double **StiffMatrix_Elem, unsigned long PointCorners[8], su2double CoordCorners[8][3], - unsigned short nNodes, su2double ElemVolume, su2double ElemDistance); + void SetFEA_StiffMatrix2D(CGeometry* geometry, CConfig* config, su2double** StiffMatrix_Elem, + unsigned long PointCorners[8], su2double CoordCorners[8][3], unsigned short nNodes, + su2double ElemVolume, su2double ElemDistance); /*! * \brief Shape functions and derivative of the shape functions @@ -138,7 +138,8 @@ class CVolumetricMovement : public CGridMovement { * \param[in] CoordCorners - Coordiantes of the corners. * \param[in] DShapeFunction - Shape function information */ - su2double ShapeFunc_Hexa(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]); + su2double ShapeFunc_Hexa(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], + su2double DShapeFunction[8][4]); /*! * \brief Shape functions and derivative of the shape functions @@ -148,7 +149,8 @@ class CVolumetricMovement : public CGridMovement { * \param[in] CoordCorners - Coordiantes of the corners. * \param[in] DShapeFunction - Shape function information */ - su2double ShapeFunc_Tetra(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]); + su2double ShapeFunc_Tetra(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], + su2double DShapeFunction[8][4]); /*! * \brief Shape functions and derivative of the shape functions @@ -158,7 +160,8 @@ class CVolumetricMovement : public CGridMovement { * \param[in] CoordCorners - Coordiantes of the corners. * \param[in] DShapeFunction - Shape function information */ - su2double ShapeFunc_Pyram(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]); + su2double ShapeFunc_Pyram(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], + su2double DShapeFunction[8][4]); /*! * \brief Shape functions and derivative of the shape functions @@ -168,7 +171,8 @@ class CVolumetricMovement : public CGridMovement { * \param[in] CoordCorners - Coordiantes of the corners. * \param[in] DShapeFunction - Shape function information */ - su2double ShapeFunc_Prism(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]); + su2double ShapeFunc_Prism(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], + su2double DShapeFunction[8][4]); /*! * \brief Shape functions and derivative of the shape functions @@ -177,7 +181,8 @@ class CVolumetricMovement : public CGridMovement { * \param[in] CoordCorners - Coordiantes of the corners. * \param[in] DShapeFunction - Shape function information */ - su2double ShapeFunc_Triangle(su2double Xi, su2double Eta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]); + su2double ShapeFunc_Triangle(su2double Xi, su2double Eta, su2double CoordCorners[8][3], + su2double DShapeFunction[8][4]); /*! * \brief Shape functions and derivative of the shape functions @@ -186,7 +191,8 @@ class CVolumetricMovement : public CGridMovement { * \param[in] CoordCorners - Coordiantes of the corners. * \param[in] DShapeFunction - Shape function information */ - su2double ShapeFunc_Quadrilateral(su2double Xi, su2double Eta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]); + su2double ShapeFunc_Quadrilateral(su2double Xi, su2double Eta, su2double CoordCorners[8][3], + su2double DShapeFunction[8][4]); /*! * \brief Compute the shape functions for hexahedron @@ -225,49 +231,50 @@ class CVolumetricMovement : public CGridMovement { su2double GetQuadrilateral_Area(su2double CoordCorners[8][3]) const; /*! - * \brief Add the stiffness matrix for a 2-D triangular element to the global stiffness matrix for the entire mesh (node-based). - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] StiffMatrix_Elem - Element stiffness matrix to be filled. - * \param[in] PointCorners - Index values for element corners - * \param[in] nNodes - Number of nodes defining the element. + * \brief Add the stiffness matrix for a 2-D triangular element to the global stiffness matrix for the entire mesh + * (node-based). \param[in] geometry - Geometrical definition of the problem. \param[in] StiffMatrix_Elem - Element + * stiffness matrix to be filled. \param[in] PointCorners - Index values for element corners \param[in] nNodes - + * Number of nodes defining the element. */ - void AddFEA_StiffMatrix(CGeometry *geometry, su2double **StiffMatrix_Elem, unsigned long PointCorners[8], unsigned short nNodes); + void AddFEA_StiffMatrix(CGeometry* geometry, su2double** StiffMatrix_Elem, unsigned long PointCorners[8], + unsigned short nNodes); /*! * \brief Check for negative volumes (all elements) after performing grid deformation. * \param[in] geometry - Geometrical definition of the problem. * \param[in] Screen_Output - determines if text is written to screen */ - void ComputeDeforming_Element_Volume(CGeometry *geometry, su2double &MinVolume, su2double &MaxVolume, bool Screen_Output); + void ComputeDeforming_Element_Volume(CGeometry* geometry, su2double& MinVolume, su2double& MaxVolume, + bool Screen_Output); /*! * \brief Compute amount of nonconvex elements * \param[in] geometry - Geometrical definition of the problem. * \param[in] Screen_Output - determines if text is written to screen */ - void ComputenNonconvexElements(CGeometry *geometry, bool Screen_Output); - + void ComputenNonconvexElements(CGeometry* geometry, bool Screen_Output); /*! * \brief Compute the minimum distance to the nearest solid surface. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void ComputeSolid_Wall_Distance(CGeometry *geometry, CConfig *config, su2double &MinDistance, su2double &MaxDistance) const; + void ComputeSolid_Wall_Distance(CGeometry* geometry, CConfig* config, su2double& MinDistance, + su2double& MaxDistance) const; /*! * \brief Check the boundary vertex that are going to be moved. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void SetBoundaryDisplacements(CGeometry *geometry, CConfig *config); + void SetBoundaryDisplacements(CGeometry* geometry, CConfig* config); /*! * \brief Check the domain points vertex that are going to be moved. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void SetDomainDisplacements(CGeometry *geometry, CConfig *config); + void SetDomainDisplacements(CGeometry* geometry, CConfig* config); /*! * \brief Unsteady grid movement using rigid mesh rotation. @@ -276,7 +283,7 @@ class CVolumetricMovement : public CGridMovement { * \param[in] iZone - Zone number in the mesh. * \param[in] iter - Physical time iteration number. */ - void Rigid_Rotation(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter); + void Rigid_Rotation(CGeometry* geometry, CConfig* config, unsigned short iZone, unsigned long iter); /*! * \brief Unsteady pitching grid movement using rigid mesh motion. @@ -285,7 +292,7 @@ class CVolumetricMovement : public CGridMovement { * \param[in] iZone - Zone number in the mesh. * \param[in] iter - Physical time iteration number. */ - void Rigid_Pitching(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter); + void Rigid_Pitching(CGeometry* geometry, CConfig* config, unsigned short iZone, unsigned long iter); /*! * \brief Unsteady plunging grid movement using rigid mesh motion. @@ -294,7 +301,7 @@ class CVolumetricMovement : public CGridMovement { * \param[in] iZone - Zone number in the mesh. * \param[in] iter - Physical time iteration number. */ - void Rigid_Plunging(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter); + void Rigid_Plunging(CGeometry* geometry, CConfig* config, unsigned short iZone, unsigned long iter); /*! * \brief Unsteady translational grid movement using rigid mesh motion. @@ -303,7 +310,7 @@ class CVolumetricMovement : public CGridMovement { * \param[in] iZone - Zone number in the mesh. * \param[in] iter - Physical time iteration number. */ - void Rigid_Translation(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter); + void Rigid_Translation(CGeometry* geometry, CConfig* config, unsigned short iZone, unsigned long iter); /*! * \brief Scale the volume grid by a multiplicative factor. @@ -311,7 +318,7 @@ class CVolumetricMovement : public CGridMovement { * \param[in] config - Definition of the particular problem. * \param[in] UpdateGeo - Update geometry. */ - void SetVolume_Scaling(CGeometry *geometry, CConfig *config, bool UpdateGeo); + void SetVolume_Scaling(CGeometry* geometry, CConfig* config, bool UpdateGeo); /*! * \brief Translate the volume grid by a specified displacement vector. @@ -319,7 +326,7 @@ class CVolumetricMovement : public CGridMovement { * \param[in] config - Definition of the particular problem. * \param[in] UpdateGeo - Update geometry. */ - void SetVolume_Translation(CGeometry *geometry, CConfig *config, bool UpdateGeo); + void SetVolume_Translation(CGeometry* geometry, CConfig* config, bool UpdateGeo); /*! * \brief Rotate the volume grid around a specified axis and angle. @@ -327,7 +334,7 @@ class CVolumetricMovement : public CGridMovement { * \param[in] config - Definition of the particular problem. * \param[in] UpdateGeo - Update geometry. */ - void SetVolume_Rotation(CGeometry *geometry, CConfig *config, bool UpdateGeo); + void SetVolume_Rotation(CGeometry* geometry, CConfig* config, bool UpdateGeo); /*! * \brief Grid deformation using the spring analogy method. @@ -336,7 +343,8 @@ class CVolumetricMovement : public CGridMovement { * \param[in] UpdateGeo - Update geometry. * \param[in] Derivative - Compute the derivative (disabled by default). Does not actually deform the grid if enabled. */ - void SetVolume_Deformation(CGeometry *geometry, CConfig *config, bool UpdateGeo, bool Derivative = false, bool ForwardProjectionDerivative = false); + void SetVolume_Deformation(CGeometry* geometry, CConfig* config, bool UpdateGeo, bool Derivative = false, + bool ForwardProjectionDerivative = false); /*! * \brief Grid deformation using the spring analogy method. @@ -345,21 +353,22 @@ class CVolumetricMovement : public CGridMovement { * \param[in] UpdateGeo - Update geometry. * \param[in] Derivative - Compute the derivative (disabled by default). Does not actually deform the grid if enabled. */ - inline virtual void SetVolume_Deformation_Elas(CGeometry *geometry, CConfig *config, bool UpdateGeo, bool screen_output, bool Derivative = false) { } + inline virtual void SetVolume_Deformation_Elas(CGeometry* geometry, CConfig* config, bool UpdateGeo, + bool screen_output, bool Derivative = false) {} /*! * \brief Set the derivatives of the boundary nodes. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void SetBoundaryDerivatives(CGeometry *geometry, CConfig *config, bool ForwardProjectionDerivative); + void SetBoundaryDerivatives(CGeometry* geometry, CConfig* config, bool ForwardProjectionDerivative); /*! * \brief Update the derivatives of the coordinates after the grid movement. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void UpdateGridCoord_Derivatives(CGeometry *geometry, CConfig *config, bool ForwardProjectionDerivative); + void UpdateGridCoord_Derivatives(CGeometry* geometry, CConfig* config, bool ForwardProjectionDerivative); /*! * \brief Store the number of iterations when moving the mesh. @@ -378,5 +387,5 @@ class CVolumetricMovement : public CGridMovement { * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - inline virtual void Boundary_Dependencies(CGeometry **geometry, CConfig *config) { } + inline virtual void Boundary_Dependencies(CGeometry** geometry, CConfig* config) {} }; diff --git a/Common/include/interface_interpolation/CInterpolator.hpp b/Common/include/interface_interpolation/CInterpolator.hpp index 5d953f14255..2bbda6a2636 100644 --- a/Common/include/interface_interpolation/CInterpolator.hpp +++ b/Common/include/interface_interpolation/CInterpolator.hpp @@ -2,7 +2,7 @@ * \file CInterpolator.hpp * \brief Base class for multiphysics interpolation. * \author H. Kline - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -45,46 +45,47 @@ using namespace std; * \author H. Kline */ class CInterpolator { -protected: + protected: const int rank; /*!< \brief MPI Rank. */ const int size; /*!< \brief MPI Size. */ const unsigned donorZone; /*!< \brief Index of donor zone. */ const unsigned targetZone; /*!< \brief Index of target zone. */ - unsigned long - MaxLocalVertex_Donor, /*!< \brief Maximum vertices per processor. */ - Buffer_Send_nVertex_Donor[1], /*!< \brief Buffer to send number of vertices on the local processor. */ - *Buffer_Receive_nVertex_Donor; /*!< \brief Buffer to store the number of vertices per processor on the Donor domain. */ + unsigned long MaxLocalVertex_Donor, /*!< \brief Maximum vertices per processor. */ + Buffer_Send_nVertex_Donor[1], /*!< \brief Buffer to send number of vertices on the local processor. */ + *Buffer_Receive_nVertex_Donor; /*!< \brief Buffer to store the number of vertices per processor on the Donor + domain. */ - su2vector Buffer_Send_GlobalPoint; /*!< \brief Buffer to send global point indices. */ - su2vector Buffer_Receive_GlobalPoint; /*!< \brief Buffer to receive global point indices. */ + su2vector Buffer_Send_GlobalPoint; /*!< \brief Buffer to send global point indices. */ + su2vector Buffer_Receive_GlobalPoint; /*!< \brief Buffer to receive global point indices. */ - su2activematrix Buffer_Send_Coord; /*!< \brief Buffer to send coordinate values. */ - su2activematrix Buffer_Receive_Coord; /*!< \brief Buffer to receive coordinate values. */ + su2activematrix Buffer_Send_Coord; /*!< \brief Buffer to send coordinate values. */ + su2activematrix Buffer_Receive_Coord; /*!< \brief Buffer to receive coordinate values. */ /*! \brief Buffer to receive the number of surface-connected edges, for each vertex. */ su2vector Buffer_Receive_nLinkedNodes; - /*! \brief Buffer to receive the index of the Receive_LinkedNodes buffer where corresponding list of linked nodes begins. */ + /*! \brief Buffer to receive the index of the Receive_LinkedNodes buffer where corresponding list of linked nodes + * begins. */ su2vector Buffer_Receive_StartLinkedNodes; /*! \brief Buffer to receive the list of surface-connected nodes, for each vertex. - * \details The vertices are ordered as in Buffer_Receive_nLinkedNodes and Buffer_Receive_StartLinkedNodes, but for each*/ + * \details The vertices are ordered as in Buffer_Receive_nLinkedNodes and Buffer_Receive_StartLinkedNodes, but for + * each*/ su2vector Buffer_Receive_LinkedNodes; /*! \brief Buffer to receive the rank that owns the vertex. */ su2vector Buffer_Receive_Proc; - unsigned long - nGlobalVertex_Target, /*!< \brief Global number of vertex of the target boundary. */ - nLocalVertex_Target, /*!< \brief Number of vertex of the target boundary owned by the thread. */ - nGlobalVertex_Donor, /*!< \brief Global number of vertex of the donor boundary. */ - nLocalVertex_Donor, /*!< \brief Number of vertex of the donor boundary owned by the thread. */ - nGlobalVertex, /*!< \brief Dummy variable to temporarily store the global number of vertex of a boundary. */ - nLocalLinkedNodes; /*!< \brief Dummy variable to temporarily store the number of vertex of a boundary. */ + unsigned long nGlobalVertex_Target, /*!< \brief Global number of vertex of the target boundary. */ + nLocalVertex_Target, /*!< \brief Number of vertex of the target boundary owned by the thread. */ + nGlobalVertex_Donor, /*!< \brief Global number of vertex of the donor boundary. */ + nLocalVertex_Donor, /*!< \brief Number of vertex of the donor boundary owned by the thread. */ + nGlobalVertex, /*!< \brief Dummy variable to temporarily store the global number of vertex of a boundary. */ + nLocalLinkedNodes; /*!< \brief Dummy variable to temporarily store the number of vertex of a boundary. */ - CGeometry**** const Geometry; /*! \brief Vector which stores n zones of geometry. */ - CGeometry* const donor_geometry; /*! \brief Donor geometry. */ - CGeometry* const target_geometry; /*! \brief Target geometry. */ + CGeometry**** const Geometry; /*! \brief Vector which stores n zones of geometry. */ + CGeometry* const donor_geometry; /*! \brief Donor geometry. */ + CGeometry* const target_geometry; /*! \brief Target geometry. */ -public: + public: struct CDonorInfo { vector processor; vector globalPoint; @@ -107,8 +108,7 @@ class CInterpolator { * \param[in] iZone - index of the donor zone. * \param[in] jZone - index of the target zone. */ - CInterpolator(CGeometry ****geometry_container, const CConfig* const* config, - unsigned int iZone, unsigned int jZone); + CInterpolator(CGeometry**** geometry_container, const CConfig* const* config, unsigned int iZone, unsigned int jZone); /*! * \brief No default construction allowed to force zones and geometry to always be set. @@ -130,7 +130,7 @@ class CInterpolator { /*! * \brief Print information about the interpolation. */ - virtual void PrintStatistics(void) const { } + virtual void PrintStatistics(void) const {} /*! * \brief Check whether an interface should be processed or not, i.e. if it is part of the zones. @@ -146,7 +146,7 @@ class CInterpolator { */ static bool CheckZonesInterface(const CConfig* donor, const CConfig* target); -protected: + protected: /*! * \brief Reconstruct the boundary connectivity from parallel partitioning and broadcasts it to all threads. * \param[in] val_zone - index of the zone diff --git a/Common/include/interface_interpolation/CInterpolatorFactory.hpp b/Common/include/interface_interpolation/CInterpolatorFactory.hpp index a9749015ec1..e4ef5850e5e 100644 --- a/Common/include/interface_interpolation/CInterpolatorFactory.hpp +++ b/Common/include/interface_interpolation/CInterpolatorFactory.hpp @@ -1,7 +1,7 @@ /*! * \file CInterpolatorFactory.hpp * \brief Factory to generate interpolator objects. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -41,9 +41,7 @@ namespace CInterpolatorFactory { * \param[in] verbose - If true, print information to screen. * \return Pointer to interpolator on the heap, caller is responsible for deletion. */ -CInterpolator* CreateInterpolator(CGeometry ****geometry_container, - const CConfig* const* config, - const CInterpolator* transpInterpolator, - unsigned iZone, unsigned jZone, +CInterpolator* CreateInterpolator(CGeometry**** geometry_container, const CConfig* const* config, + const CInterpolator* transpInterpolator, unsigned iZone, unsigned jZone, bool verbose = true); -} +} // namespace CInterpolatorFactory diff --git a/Common/include/interface_interpolation/CIsoparametric.hpp b/Common/include/interface_interpolation/CIsoparametric.hpp index 7584e61c505..190cb0a1e4b 100644 --- a/Common/include/interface_interpolation/CIsoparametric.hpp +++ b/Common/include/interface_interpolation/CIsoparametric.hpp @@ -2,7 +2,7 @@ * \file CIsoparametric.hpp * \brief Isoparametric interpolation using FE shape functions. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -33,23 +33,23 @@ * \ingroup Interfaces */ class CIsoparametric final : public CInterpolator { -private: + private: /*--- Statistics. ---*/ su2double MaxDistance = 0.0, ErrorRate = 0.0; unsigned long ErrorCounter = 0; /*! \brief Helper struct to store information about candidate donor elements. */ struct DonorInfo { - su2double isoparams[4] = {0.0}; /*!< \brief Interpolation coefficients. */ - su2double distance = 0.0; /*!< \brief Distance from target to final mapped point on donor plane. */ - unsigned iElem = 0; /*!< \brief Identification of the element. */ - int error = 0; /*!< \brief If the mapped point is "outside" of the donor. */ + su2double isoparams[4] = {0.0}; /*!< \brief Interpolation coefficients. */ + su2double distance = 0.0; /*!< \brief Distance from target to final mapped point on donor plane. */ + unsigned iElem = 0; /*!< \brief Identification of the element. */ + int error = 0; /*!< \brief If the mapped point is "outside" of the donor. */ /*--- Best donor is one for which the mapped point is closest to target. ---*/ - bool operator< (const DonorInfo& other) const { return distance < other.distance; } + bool operator<(const DonorInfo& other) const { return distance < other.distance; } }; -public: + public: /*! * \brief Constructor of the class. * \param[in] geometry - Geometrical definition of the problem. @@ -57,8 +57,8 @@ class CIsoparametric final : public CInterpolator { * \param[in] iZone - index of the donor zone. * \param[in] jZone - index of the target zone. */ - CIsoparametric(CGeometry ****geometry_container, const CConfig* const* config, - unsigned int iZone, unsigned int jZone); + CIsoparametric(CGeometry**** geometry_container, const CConfig* const* config, unsigned int iZone, + unsigned int jZone); /*! * \brief Set up transfer matrix defining relation between two meshes @@ -71,7 +71,7 @@ class CIsoparametric final : public CInterpolator { */ void PrintStatistics(void) const override; -private: + private: /*! * \brief Compute the isoparametric interpolation coefficients for a 2D line element. * \param[in] X - Coordinate matrix defining the line. @@ -79,7 +79,7 @@ class CIsoparametric final : public CInterpolator { * \param[out] isoparams - Isoparametric coefficients. * \return 0 on success, 1 if xj is too far outside element bounds. */ - static int LineIsoparameters(const su2double X[][3], const su2double *xj, su2double* isoparams); + static int LineIsoparameters(const su2double X[][3], const su2double* xj, su2double* isoparams); /*! * \brief Compute the isoparametric interpolation coefficients for a 3D triangle element. @@ -88,7 +88,7 @@ class CIsoparametric final : public CInterpolator { * \param[out] isoparams - Isoparametric coefficients. * \return 0 on success, 1 if xj is too far outside element bounds. */ - static int TriangleIsoparameters(const su2double X[][3], const su2double *xj, su2double* isoparams); + static int TriangleIsoparameters(const su2double X[][3], const su2double* xj, su2double* isoparams); /*! * \brief Compute the isoparametric interpolation coefficients for a 3D quadrilateral element. @@ -97,6 +97,5 @@ class CIsoparametric final : public CInterpolator { * \param[out] isoparams - Isoparametric coefficients. * \return 0 on success, 1 if xj is too far outside element bounds. */ - static int QuadrilateralIsoparameters(const su2double X[][3], const su2double *xj, su2double* isoparams); - + static int QuadrilateralIsoparameters(const su2double X[][3], const su2double* xj, su2double* isoparams); }; diff --git a/Common/include/interface_interpolation/CMirror.hpp b/Common/include/interface_interpolation/CMirror.hpp index a23626b852f..46f7487629f 100644 --- a/Common/include/interface_interpolation/CMirror.hpp +++ b/Common/include/interface_interpolation/CMirror.hpp @@ -2,7 +2,7 @@ * \file CMirror.hpp * \brief Mirror interpolation for the conservative (work-wise) approach in FSI problems. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -34,10 +34,10 @@ * \ingroup Interfaces */ class CMirror final : public CInterpolator { -private: + private: const CInterpolator* const transpInterpolator; /*! \brief The transpose interpolator (from j to i). */ -public: + public: /*! * \brief Constructor of the class. * \note Data is set in geometry[targetZone]. @@ -47,13 +47,12 @@ class CMirror final : public CInterpolator { * \param[in] iZone - First zone * \param[in] jZone - Second zone */ - CMirror(CGeometry ****geometry_container, const CConfig* const* config, - const CInterpolator* interpolator, unsigned int iZone, unsigned int jZone); + CMirror(CGeometry**** geometry_container, const CConfig* const* config, const CInterpolator* interpolator, + unsigned int iZone, unsigned int jZone); /*! * \brief Set up transfer matrix defining relation between two meshes * \param[in] config - Definition of the particular problem. */ void SetTransferCoeff(const CConfig* const* config) override; - }; diff --git a/Common/include/interface_interpolation/CNearestNeighbor.hpp b/Common/include/interface_interpolation/CNearestNeighbor.hpp index be97794c60f..6977cf760a2 100644 --- a/Common/include/interface_interpolation/CNearestNeighbor.hpp +++ b/Common/include/interface_interpolation/CNearestNeighbor.hpp @@ -2,7 +2,7 @@ * \file CNearestNeighbor.hpp * \brief Nearest Neighbor interpolation class. * \author H. Kline - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -36,7 +36,7 @@ * \ingroup Interfaces */ class CNearestNeighbor final : public CInterpolator { -private: + private: su2double AvgDistance = 0.0, MaxDistance = 0.0; /*! \brief Helper struct to (partially) sort neighbours according to distance while @@ -45,10 +45,10 @@ class CNearestNeighbor final : public CInterpolator { su2double dist; unsigned pidx; int proc; - DonorInfo(su2double d = 0.0, unsigned i = 0, int p = 0) : dist(d), pidx(i), proc(p) { } + DonorInfo(su2double d = 0.0, unsigned i = 0, int p = 0) : dist(d), pidx(i), proc(p) {} }; -public: + public: /*! * \brief Constructor of the class. * \param[in] geometry - Geometrical definition of the problem. @@ -56,8 +56,8 @@ class CNearestNeighbor final : public CInterpolator { * \param[in] iZone - index of the donor zone. * \param[in] jZone - index of the target zone. */ - CNearestNeighbor(CGeometry ****geometry_container, const CConfig* const* config, - unsigned int iZone, unsigned int jZone); + CNearestNeighbor(CGeometry**** geometry_container, const CConfig* const* config, unsigned int iZone, + unsigned int jZone); /*! * \brief Set up transfer matrix defining relation between two meshes. @@ -69,5 +69,4 @@ class CNearestNeighbor final : public CInterpolator { * \brief Print interpolation statistics. */ void PrintStatistics(void) const override; - }; diff --git a/Common/include/interface_interpolation/CRadialBasisFunction.hpp b/Common/include/interface_interpolation/CRadialBasisFunction.hpp index 2c65cca5f18..9b25a800388 100644 --- a/Common/include/interface_interpolation/CRadialBasisFunction.hpp +++ b/Common/include/interface_interpolation/CRadialBasisFunction.hpp @@ -2,7 +2,7 @@ * \file CRadialBasisFunction.hpp * \brief Radial basis function interpolation. * \author Joel Ho, P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -36,11 +36,12 @@ */ class CRadialBasisFunction final : public CInterpolator { static_assert(su2passivematrix::IsRowMajor, "This class relies on row major storage throughout."); -private: + + private: unsigned long MinDonors = 0, AvgDonors = 0, MaxDonors = 0; passivedouble Density = 0.0, AvgCorrection = 0.0, MaxCorrection = 0.0; -public: + public: /*! * \brief Constructor of the class. * \param[in] geometry - Geometrical definition of the problem. @@ -48,8 +49,8 @@ class CRadialBasisFunction final : public CInterpolator { * \param[in] iZone - index of the donor zone. * \param[in] jZone - index of the target zone. */ - CRadialBasisFunction(CGeometry ****geometry_container, const CConfig* const* config, - unsigned int iZone, unsigned int jZone); + CRadialBasisFunction(CGeometry**** geometry_container, const CConfig* const* config, unsigned int iZone, + unsigned int jZone); /*! * \brief Set up transfer matrix defining relation between two meshes @@ -85,8 +86,8 @@ class CRadialBasisFunction final : public CInterpolator { * \param[out] C_inv_trunc - The generator matrix as described above. */ static void ComputeGeneratorMatrix(RADIAL_BASIS type, bool usePolynomial, su2double radius, - const su2activematrix& coords, int& nPolynomial, - vector& keepPolynomialRow, su2passivematrix& C_inv_trunc); + const su2activematrix& coords, int& nPolynomial, vector& keepPolynomialRow, + su2passivematrix& C_inv_trunc); /*! * \brief If the polynomial term is included in the interpolation, and the points lie on a plane, the matrix @@ -97,9 +98,9 @@ class CRadialBasisFunction final : public CInterpolator { * \param[in,out] P - Polynomial part of the interpolation matrix, one row may be eliminated. * \return n_polynomial - Size of the polynomial part on exit (in practice nDim or nDim-1). */ - static int CheckPolynomialTerms(su2double max_diff_tol, vector& keep_row, su2passivematrix &P); + static int CheckPolynomialTerms(su2double max_diff_tol, vector& keep_row, su2passivematrix& P); -private: + private: /*! * \brief Helper function, prunes (by setting to zero) small interpolation coefficients, * i.e. <= tolerance*max(abs(coeffs)). The vector is re-scaled such that sum(coeffs)==1. @@ -108,25 +109,24 @@ class CRadialBasisFunction final : public CInterpolator { * \param[in,out] coeffs - Iterator to start of vector of interpolation coefficients. * \return Number of non-zero coefficients after pruning and correction factor. */ - template - static pair PruneSmallCoefficients(Float tolerance, Int size, ForwardIt coeffs) { - + template + static pair PruneSmallCoefficients(Float tolerance, Int size, ForwardIt coeffs) { /*--- Determine the pruning threshold. ---*/ Float thresh = 0.0; auto end = coeffs; - for (Int i = 0; i < size; ++i) - thresh = max(thresh, fabs(*(end++))); + for (Int i = 0; i < size; ++i) thresh = max(thresh, fabs(*(end++))); thresh *= tolerance; /*--- Prune and count non-zeros. ---*/ Int numNonZeros = 0; Float coeffSum = 0.0; for (auto it = coeffs; it != end; ++it) { - if (fabs(*it) > thresh) { // keep + if (fabs(*it) > thresh) { // keep coeffSum += *it; ++numNonZeros; - } - else { *it = 0.0; } // prune + } else { + *it = 0.0; + } // prune } /*--- Correct remaining coefficients, sum must be 1 for conservation. ---*/ @@ -135,5 +135,4 @@ class CRadialBasisFunction final : public CInterpolator { return make_pair(numNonZeros, correction); } - }; diff --git a/Common/include/interface_interpolation/CSlidingMesh.hpp b/Common/include/interface_interpolation/CSlidingMesh.hpp index b07dcef36f4..fa9c26ecc8a 100644 --- a/Common/include/interface_interpolation/CSlidingMesh.hpp +++ b/Common/include/interface_interpolation/CSlidingMesh.hpp @@ -2,7 +2,7 @@ * \file CSlidingMesh.hpp * \brief Sliding mesh interpolation. * \author H. Kline - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -35,7 +35,7 @@ * \ingroup Interfaces */ class CSlidingMesh final : public CInterpolator { -public: + public: /*! * \brief Constructor of the class. * \param[in] geometry - Geometrical definition of the problem. @@ -43,8 +43,7 @@ class CSlidingMesh final : public CInterpolator { * \param[in] iZone - index of the donor zone. * \param[in] jZone - index of the target zone. */ - CSlidingMesh(CGeometry ****geometry_container, const CConfig* const* config, - unsigned int iZone, unsigned int jZone); + CSlidingMesh(CGeometry**** geometry_container, const CConfig* const* config, unsigned int iZone, unsigned int jZone); /*! * \brief Set up transfer matrix defining relation between two meshes @@ -52,7 +51,7 @@ class CSlidingMesh final : public CInterpolator { */ void SetTransferCoeff(const CConfig* const* config) override; -private: + private: /*! * \brief For 3-Dimensional grids, build the dual surface element * \param[in] map - array containing the index of the boundary points connected to the node @@ -125,6 +124,6 @@ class CSlidingMesh final : public CInterpolator { * \param[in] T2 - second point of triangle T * \param[in] T3 - third point of triangle T */ - static bool CheckPointInsideTriangle(const su2double* Point, const su2double* T1, - const su2double* T2, const su2double* T3); + static bool CheckPointInsideTriangle(const su2double* Point, const su2double* T1, const su2double* T2, + const su2double* T3); }; diff --git a/Common/include/linear_algebra/CMatrixVectorProduct.hpp b/Common/include/linear_algebra/CMatrixVectorProduct.hpp index cc48bb4670f..bb3561a242b 100644 --- a/Common/include/linear_algebra/CMatrixVectorProduct.hpp +++ b/Common/include/linear_algebra/CMatrixVectorProduct.hpp @@ -3,7 +3,7 @@ * \brief Headers for the classes related to sparse matrix-vector product wrappers. * The actual operations are currently implemented mostly by CSysMatrix. * \author F. Palacios, J. Hicken, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,7 +26,6 @@ * License along with SU2. If not, see . */ - #pragma once #include "../CConfig.hpp" @@ -52,40 +51,37 @@ * passed to a single implementation of the Krylov solvers. * This abstraction may also be used to define matrix-free products. */ -template +template class CMatrixVectorProduct { -public: + public: virtual ~CMatrixVectorProduct() = 0; - virtual void operator()(const CSysVector & u, CSysVector & v) const = 0; + virtual void operator()(const CSysVector& u, CSysVector& v) const = 0; }; -template +template CMatrixVectorProduct::~CMatrixVectorProduct() {} - /*! * \class CSysMatrixVectorProduct * \ingroup SpLinSys * \brief Specialization of matrix-vector product that uses CSysMatrix class */ -template +template class CSysMatrixVectorProduct final : public CMatrixVectorProduct { -private: - const CSysMatrix& matrix; /*!< \brief pointer to matrix that defines the product. */ - CGeometry* geometry; /*!< \brief geometry associated with the matrix. */ - const CConfig *config; /*!< \brief config of the problem. */ + private: + const CSysMatrix& matrix; /*!< \brief pointer to matrix that defines the product. */ + CGeometry* geometry; /*!< \brief geometry associated with the matrix. */ + const CConfig* config; /*!< \brief config of the problem. */ -public: + public: /*! * \brief constructor of the class * \param[in] matrix_ref - matrix reference that will be used to define the products * \param[in] geometry_ref - geometry associated with the problem * \param[in] config_ref - config of the problem */ - inline CSysMatrixVectorProduct(const CSysMatrix & matrix_ref, - CGeometry *geometry_ref, const CConfig *config_ref) : - matrix(matrix_ref), - geometry(geometry_ref), - config(config_ref) {} + inline CSysMatrixVectorProduct(const CSysMatrix& matrix_ref, CGeometry* geometry_ref, + const CConfig* config_ref) + : matrix(matrix_ref), geometry(geometry_ref), config(config_ref) {} /*! * \note This class cannot be default constructed as that would leave us with invalid pointers. @@ -97,7 +93,7 @@ class CSysMatrixVectorProduct final : public CMatrixVectorProduct { * \param[in] u - CSysVector that is being multiplied by the sparse matrix * \param[out] v - CSysVector that is the result of the product */ - inline void operator()(const CSysVector & u, CSysVector & v) const override { + inline void operator()(const CSysVector& u, CSysVector& v) const override { matrix.MatrixVectorProduct(u, v, geometry, config); } }; diff --git a/Common/include/linear_algebra/CPastixWrapper.hpp b/Common/include/linear_algebra/CPastixWrapper.hpp index 72ed9629e61..2f785315f39 100644 --- a/Common/include/linear_algebra/CPastixWrapper.hpp +++ b/Common/include/linear_algebra/CPastixWrapper.hpp @@ -3,7 +3,7 @@ * \brief An interface to the INRIA solver PaStiX * (http://pastix.gforge.inria.fr/files/README-txt.html) * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -31,14 +31,14 @@ #ifdef HAVE_PASTIX #ifdef CODI_FORWARD_TYPE - #error Cannot use PaStiX with forward mode AD +#error Cannot use PaStiX with forward mode AD #endif namespace PaStiX { extern "C" { #include } -} +} // namespace PaStiX #include using namespace std; @@ -52,33 +52,31 @@ class CGeometry; * \brief Wrapper class that converts between SU2 sparse format and PaStiX * format and simplifies calls to the external solver. */ -template -class CPastixWrapper -{ -private: - PaStiX::pastix_data_t *state; /*!< \brief Internal state of the solver. */ - PaStiX::pastix_int_t nCols; /*!< \brief Local number of columns. */ +template +class CPastixWrapper { + private: + PaStiX::pastix_data_t* state; /*!< \brief Internal state of the solver. */ + PaStiX::pastix_int_t nCols; /*!< \brief Local number of columns. */ vector colptr; /*!< \brief Equiv. to our "row_ptr". */ vector rowidx; /*!< \brief Equiv. to our "col_ind". */ - vector values; /*!< \brief Equiv. to our "matrix". */ + vector values; /*!< \brief Equiv. to our "matrix". */ vector loc2glb; /*!< \brief Global index of the columns held by this rank. */ vector perm; /*!< \brief Ordering computed by PaStiX. */ - vector workvec; /*!< \brief RHS vector which then becomes the solution. */ + vector workvec; /*!< \brief RHS vector which then becomes the solution. */ PaStiX::pastix_int_t iparm[PaStiX::IPARM_SIZE]; /*!< \brief Integer parameters for PaStiX. */ - passivedouble dparm[PaStiX::DPARM_SIZE]; /*!< \brief Floating point parameters for PaStiX. */ + passivedouble dparm[PaStiX::DPARM_SIZE]; /*!< \brief Floating point parameters for PaStiX. */ struct { unsigned long nVar = 0; unsigned long nPoint = 0; unsigned long nPointDomain = 0; - const unsigned long *rowptr = nullptr; - const unsigned long *colidx = nullptr; - const ScalarType *values = nullptr; + const unsigned long* rowptr = nullptr; + const unsigned long* colidx = nullptr; + const ScalarType* values = nullptr; - unsigned long size_rhs() const {return nPointDomain*nVar;} - } - matrix; /*!< \brief Pointers and sizes of the input matrix. */ + unsigned long size_rhs() const { return nPointDomain * nVar; } + } matrix; /*!< \brief Pointers and sizes of the input matrix. */ bool issetup; /*!< \brief Signals that the matrix data has been provided. */ bool isinitialized; /*!< \brief Signals that the sparsity pattern has been set. */ @@ -87,15 +85,15 @@ class CPastixWrapper unsigned short verb; /*!< \brief Verbosity level. */ const int mpi_size, mpi_rank; - vector sort_rows; /*!< \brief List of rows with halo points. */ + vector sort_rows; /*!< \brief List of rows with halo points. */ vector > sort_order; /*!< \brief How each of those rows needs to be sorted. */ /*! * \brief Run the external solver for the task it is currently setup to execute. */ void Run() { - dpastix(&state, SU2_MPI::GetComm(), nCols, colptr.data(), rowidx.data(), values.data(), - loc2glb.data(), perm.data(), NULL, workvec.data(), 1, iparm, dparm); + dpastix(&state, SU2_MPI::GetComm(), nCols, colptr.data(), rowidx.data(), values.data(), loc2glb.data(), perm.data(), + NULL, workvec.data(), 1, iparm, dparm); } /*! @@ -103,10 +101,10 @@ class CPastixWrapper */ void Clean() { using namespace PaStiX; - if(isfactorized) { + if (isfactorized) { iparm[IPARM_VERBOSE] = (verb > 0) ? API_VERBOSE_NO : API_VERBOSE_NOT; iparm[IPARM_START_TASK] = API_TASK_CLEAN; - iparm[IPARM_END_TASK] = API_TASK_CLEAN; + iparm[IPARM_END_TASK] = API_TASK_CLEAN; Run(); isfactorized = false; } @@ -115,22 +113,27 @@ class CPastixWrapper /*! * \brief Initialize the matrix format that PaStiX requires. */ - void Initialize(CGeometry *geometry, const CConfig *config); + void Initialize(CGeometry* geometry, const CConfig* config); -public: + public: /*! * \brief Class constructor. */ - CPastixWrapper() : state(nullptr), issetup(false), isinitialized(false), - isfactorized(false), iter(0), verb(0), - mpi_size(SU2_MPI::GetSize()), mpi_rank(SU2_MPI::GetRank()) { - } + CPastixWrapper() + : state(nullptr), + issetup(false), + isinitialized(false), + isfactorized(false), + iter(0), + verb(0), + mpi_size(SU2_MPI::GetSize()), + mpi_rank(SU2_MPI::GetRank()) {} /*--- Move or copy is not allowed. ---*/ CPastixWrapper(CPastixWrapper&&) = delete; CPastixWrapper(const CPastixWrapper&) = delete; - CPastixWrapper& operator= (CPastixWrapper&&) = delete; - CPastixWrapper& operator= (const CPastixWrapper&) = delete; + CPastixWrapper& operator=(CPastixWrapper&&) = delete; + CPastixWrapper& operator=(const CPastixWrapper&) = delete; /*! * \brief Class destructor. @@ -146,13 +149,8 @@ class CPastixWrapper * \param[in] colidx - Non zeros column indices. * \param[in] values - Matrix coefficients. */ - void SetMatrix(unsigned long nVar, - unsigned long nPoint, - unsigned long nPointDomain, - const unsigned long *rowptr, - const unsigned long *colidx, - const ScalarType *values) { - + void SetMatrix(unsigned long nVar, unsigned long nPoint, unsigned long nPointDomain, const unsigned long* rowptr, + const unsigned long* colidx, const ScalarType* values) { if (issetup) return; matrix.nVar = nVar; matrix.nPoint = nPoint; @@ -169,7 +167,7 @@ class CPastixWrapper * \param[in] config - Definition of the particular problem. * \param[in] kind_fact - Type of factorization. */ - void Factorize(CGeometry *geometry, const CConfig *config, unsigned short kind_fact); + void Factorize(CGeometry* geometry, const CConfig* config, unsigned short kind_fact); /*! * \brief Request solves with the transposed matrix. @@ -178,7 +176,7 @@ class CPastixWrapper void SetTransposedSolve(bool transposed = true) { using namespace PaStiX; if (iparm[IPARM_SYM] == API_SYM_NO) - iparm[IPARM_TRANSPOSE_SOLVE] = pastix_int_t(!transposed); // negated due to CSR to CSC copy + iparm[IPARM_TRANSPOSE_SOLVE] = pastix_int_t(!transposed); // negated due to CSR to CSC copy } /*! @@ -186,24 +184,22 @@ class CPastixWrapper * \param[in] rhs - Right hand side of the linear system. * \param[out] sol - Solution of the system. */ - template + template void Solve(const T& rhs, T& sol) { using namespace PaStiX; - if (!isfactorized) - SU2_MPI::Error("The factorization has not been computed yet.", CURRENT_FUNCTION); + if (!isfactorized) SU2_MPI::Error("The factorization has not been computed yet.", CURRENT_FUNCTION); unsigned long i; - for (i=0; i < matrix.size_rhs(); ++i) workvec[i] = rhs[i]; + for (i = 0; i < matrix.size_rhs(); ++i) workvec[i] = rhs[i]; - iparm[IPARM_VERBOSE] = API_VERBOSE_NOT; + iparm[IPARM_VERBOSE] = API_VERBOSE_NOT; iparm[IPARM_START_TASK] = API_TASK_SOLVE; - iparm[IPARM_END_TASK] = API_TASK_SOLVE; + iparm[IPARM_END_TASK] = API_TASK_SOLVE; Run(); - for (i=0; i < matrix.size_rhs(); ++i) sol[i] = workvec[i]; + for (i = 0; i < matrix.size_rhs(); ++i) sol[i] = workvec[i]; } - }; #endif diff --git a/Common/include/linear_algebra/CPreconditioner.hpp b/Common/include/linear_algebra/CPreconditioner.hpp index a2ebaf8ba39..415bc90cfa0 100644 --- a/Common/include/linear_algebra/CPreconditioner.hpp +++ b/Common/include/linear_algebra/CPreconditioner.hpp @@ -3,7 +3,7 @@ * \brief Classes related to linear preconditioner wrappers. * The actual operations are currently implemented mostly by CSysMatrix. * \author F. Palacios, J. Hicken, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -44,9 +44,9 @@ * See the remarks regarding the CMatrixVectorProduct class. The same * idea applies here to the preconditioning operation. */ -template +template class CPreconditioner { -public: + public: /*! * \brief Destructor of the class */ @@ -55,7 +55,7 @@ class CPreconditioner { /*! * \brief Overload of operator (), applies the preconditioner to "u" storing the result in "v". */ - virtual void operator()(const CSysVector & u, CSysVector & v) const = 0; + virtual void operator()(const CSysVector& u, CSysVector& v) const = 0; /*! * \brief Generic "preprocessing" hook derived classes may implement to build the preconditioner. @@ -70,36 +70,33 @@ class CPreconditioner { /*! * \brief Factory method. */ - static CPreconditioner* Create(ENUM_LINEAR_SOLVER_PREC kind, CSysMatrix& jacobian, - CGeometry* geometry, const CConfig* config); + static CPreconditioner* Create(ENUM_LINEAR_SOLVER_PREC kind, CSysMatrix& jacobian, CGeometry* geometry, + const CConfig* config); }; -template +template CPreconditioner::~CPreconditioner() {} - /*! * \class CJacobiPreconditioner * \brief Specialization of preconditioner that uses CSysMatrix class. */ -template +template class CJacobiPreconditioner final : public CPreconditioner { -private: + private: CSysMatrix& sparse_matrix; /*!< \brief Pointer to matrix that defines the preconditioner. */ CGeometry* geometry; /*!< \brief Pointer to geometry associated with the matrix. */ - const CConfig *config; /*!< \brief Pointer to problem configuration. */ + const CConfig* config; /*!< \brief Pointer to problem configuration. */ -public: + public: /*! * \brief Constructor of the class. * \param[in] matrix_ref - Matrix reference that will be used to define the preconditioner. * \param[in] geometry_ref - Geometry associated with the problem. * \param[in] config_ref - Config of the problem. */ - inline CJacobiPreconditioner(CSysMatrix & matrix_ref, - CGeometry *geometry_ref, const CConfig *config_ref) : - sparse_matrix(matrix_ref) - { - if((geometry_ref == nullptr) || (config_ref == nullptr)) + inline CJacobiPreconditioner(CSysMatrix& matrix_ref, CGeometry* geometry_ref, const CConfig* config_ref) + : sparse_matrix(matrix_ref) { + if ((geometry_ref == nullptr) || (config_ref == nullptr)) SU2_MPI::Error("Preconditioner needs to be built with valid references.", CURRENT_FUNCTION); geometry = geometry_ref; config = config_ref; @@ -115,42 +112,37 @@ class CJacobiPreconditioner final : public CPreconditioner { * \param[in] u - CSysVector that is being preconditioned * \param[out] v - CSysVector that is the result of the preconditioning */ - inline void operator()(const CSysVector & u, CSysVector & v) const override { + inline void operator()(const CSysVector& u, CSysVector& v) const override { sparse_matrix.ComputeJacobiPreconditioner(u, v, geometry, config); } /*! * \note Request the associated matrix to build the preconditioner. */ - inline void Build() override { - sparse_matrix.BuildJacobiPreconditioner(); - } + inline void Build() override { sparse_matrix.BuildJacobiPreconditioner(); } }; - /*! * \class CILUPreconditioner * \brief Specialization of preconditioner that uses CSysMatrix class */ -template +template class CILUPreconditioner final : public CPreconditioner { -private: + private: CSysMatrix& sparse_matrix; /*!< \brief Pointer to matrix that defines the preconditioner. */ CGeometry* geometry; /*!< \brief Pointer to geometry associated with the matrix. */ - const CConfig *config; /*!< \brief Pointer to problem configuration. */ + const CConfig* config; /*!< \brief Pointer to problem configuration. */ -public: + public: /*! * \brief Constructor of the class. * \param[in] matrix_ref - Matrix reference that will be used to define the preconditioner. * \param[in] geometry_ref - Geometry associated with the problem. * \param[in] config_ref - Config of the problem. */ - inline CILUPreconditioner(CSysMatrix & matrix_ref, - CGeometry *geometry_ref, const CConfig *config_ref) : - sparse_matrix(matrix_ref) - { - if((geometry_ref == nullptr) || (config_ref == nullptr)) + inline CILUPreconditioner(CSysMatrix& matrix_ref, CGeometry* geometry_ref, const CConfig* config_ref) + : sparse_matrix(matrix_ref) { + if ((geometry_ref == nullptr) || (config_ref == nullptr)) SU2_MPI::Error("Preconditioner needs to be built with valid references.", CURRENT_FUNCTION); geometry = geometry_ref; config = config_ref; @@ -166,43 +158,37 @@ class CILUPreconditioner final : public CPreconditioner { * \param[in] u - CSysVector that is being preconditioned. * \param[out] v - CSysVector that is the result of the preconditioning. */ - inline void operator()(const CSysVector & u, CSysVector & v) const override { + inline void operator()(const CSysVector& u, CSysVector& v) const override { sparse_matrix.ComputeILUPreconditioner(u, v, geometry, config); } /*! * \note Request the associated matrix to build the preconditioner. */ - inline void Build() override { - sparse_matrix.BuildILUPreconditioner(); - } + inline void Build() override { sparse_matrix.BuildILUPreconditioner(); } }; - /*! * \class CLU_SGSPreconditioner * \brief Specialization of preconditioner that uses CSysMatrix class. */ -template +template class CLU_SGSPreconditioner final : public CPreconditioner { -private: + private: CSysMatrix& sparse_matrix; /*!< \brief Pointer to matrix that defines the preconditioner. */ CGeometry* geometry; /*!< \brief Pointer to geometry associated with the matrix. */ - const CConfig *config; /*!< \brief Pointer to problem configuration. */ - -public: + const CConfig* config; /*!< \brief Pointer to problem configuration. */ + public: /*! * \brief Constructor of the class. * \param[in] matrix_ref - Matrix reference that will be used to define the preconditioner. * \param[in] geometry_ref - Geometry associated with the problem. * \param[in] config_ref - Config of the problem. */ - inline CLU_SGSPreconditioner(CSysMatrix & matrix_ref, - CGeometry *geometry_ref, const CConfig *config_ref) : - sparse_matrix(matrix_ref) - { - if((geometry_ref == nullptr) || (config_ref == nullptr)) + inline CLU_SGSPreconditioner(CSysMatrix& matrix_ref, CGeometry* geometry_ref, const CConfig* config_ref) + : sparse_matrix(matrix_ref) { + if ((geometry_ref == nullptr) || (config_ref == nullptr)) SU2_MPI::Error("Preconditioner needs to be built with valid references.", CURRENT_FUNCTION); geometry = geometry_ref; config = config_ref; @@ -218,35 +204,32 @@ class CLU_SGSPreconditioner final : public CPreconditioner { * \param[in] u - CSysVector that is being preconditioned. * \param[out] v - CSysVector that is the result of the preconditioning. */ - inline void operator()(const CSysVector & u, CSysVector & v) const override { + inline void operator()(const CSysVector& u, CSysVector& v) const override { sparse_matrix.ComputeLU_SGSPreconditioner(u, v, geometry, config); } }; - /*! * \class CLineletPreconditioner * \brief Specialization of preconditioner that uses CSysMatrix class. */ -template +template class CLineletPreconditioner final : public CPreconditioner { -private: + private: CSysMatrix& sparse_matrix; /*!< \brief Pointer to matrix that defines the preconditioner. */ CGeometry* geometry; /*!< \brief Pointer to geometry associated with the matrix. */ - const CConfig *config; /*!< \brief Pointer to problem configuration. */ + const CConfig* config; /*!< \brief Pointer to problem configuration. */ -public: + public: /*! * \brief Constructor of the class. * \param[in] matrix_ref - Matrix reference that will be used to define the preconditioner. * \param[in] geometry_ref - Geometry associated with the problem. * \param[in] config_ref - Config of the problem. */ - inline CLineletPreconditioner(CSysMatrix & matrix_ref, - CGeometry *geometry_ref, const CConfig *config_ref) : - sparse_matrix(matrix_ref) - { - if((geometry_ref == nullptr) || (config_ref == nullptr)) + inline CLineletPreconditioner(CSysMatrix& matrix_ref, CGeometry* geometry_ref, const CConfig* config_ref) + : sparse_matrix(matrix_ref) { + if ((geometry_ref == nullptr) || (config_ref == nullptr)) SU2_MPI::Error("Preconditioner needs to be built with valid references.", CURRENT_FUNCTION); geometry = geometry_ref; config = config_ref; @@ -262,32 +245,29 @@ class CLineletPreconditioner final : public CPreconditioner { * \param[in] u - CSysVector that is being preconditioned. * \param[out] v - CSysVector that is the result of the preconditioning. */ - inline void operator()(const CSysVector & u, CSysVector & v) const override { + inline void operator()(const CSysVector& u, CSysVector& v) const override { sparse_matrix.ComputeLineletPreconditioner(u, v, geometry, config); } /*! * \note Request the associated matrix to build the preconditioner. */ - inline void Build() override { - sparse_matrix.BuildLineletPreconditioner(geometry, config); - } + inline void Build() override { sparse_matrix.BuildLineletPreconditioner(geometry, config); } }; - /*! * \class CPastixPreconditioner * \brief Specialization of preconditioner that uses PaStiX to factorize a CSysMatrix. */ -template +template class CPastixPreconditioner final : public CPreconditioner { -private: + private: CSysMatrix& sparse_matrix; /*!< \brief Pointer to the matrix. */ CGeometry* geometry; /*!< \brief Geometry associated with the problem. */ - const CConfig *config; /*!< \brief Configuration of the problem. */ + const CConfig* config; /*!< \brief Configuration of the problem. */ unsigned short kind_fact; /*!< \brief The type of factorization desired. */ -public: + public: /*! * \brief Constructor of the class * \param[in] matrix_ref - Matrix reference that will be used to define the preconditioner. @@ -295,11 +275,10 @@ class CPastixPreconditioner final : public CPreconditioner { * \param[in] config_ref - Problem configuration. * \param[in] kind_factorization - Type of factorization required. */ - inline CPastixPreconditioner(CSysMatrix & matrix_ref, CGeometry *geometry_ref, - const CConfig *config_ref, unsigned short kind_factorization) : - sparse_matrix(matrix_ref) - { - if((geometry_ref == nullptr) || (config_ref == nullptr)) + inline CPastixPreconditioner(CSysMatrix& matrix_ref, CGeometry* geometry_ref, const CConfig* config_ref, + unsigned short kind_factorization) + : sparse_matrix(matrix_ref) { + if ((geometry_ref == nullptr) || (config_ref == nullptr)) SU2_MPI::Error("Preconditioner needs to be built with valid references.", CURRENT_FUNCTION); geometry = geometry_ref; config = config_ref; @@ -316,23 +295,19 @@ class CPastixPreconditioner final : public CPreconditioner { * \param[in] u - CSysVector that is being preconditioned. * \param[out] v - CSysVector that is the result of the preconditioning. */ - inline void operator()(const CSysVector & u, CSysVector & v) const override { + inline void operator()(const CSysVector& u, CSysVector& v) const override { sparse_matrix.ComputePastixPreconditioner(u, v, geometry, config); } /*! * \note Request the associated matrix to build the preconditioner. */ - inline void Build() override { - sparse_matrix.BuildPastixPreconditioner(geometry, config, kind_fact); - } + inline void Build() override { sparse_matrix.BuildPastixPreconditioner(geometry, config, kind_fact); } }; - -template +template CPreconditioner* CPreconditioner::Create(ENUM_LINEAR_SOLVER_PREC kind, - CSysMatrix& jacobian, - CGeometry* geometry, + CSysMatrix& jacobian, CGeometry* geometry, const CConfig* config) { CPreconditioner* prec = nullptr; @@ -349,7 +324,9 @@ CPreconditioner* CPreconditioner::Create(ENUM_LINEAR_SOL case ILU: prec = new CILUPreconditioner(jacobian, geometry, config); break; - case PASTIX_ILU: case PASTIX_LU_P: case PASTIX_LDLT_P: + case PASTIX_ILU: + case PASTIX_LU_P: + case PASTIX_LDLT_P: prec = new CPastixPreconditioner(jacobian, geometry, config, kind); break; } @@ -357,4 +334,4 @@ CPreconditioner* CPreconditioner::Create(ENUM_LINEAR_SOL return prec; } -/// @} \ No newline at end of file +/// @} diff --git a/Common/include/linear_algebra/CSysMatrix.hpp b/Common/include/linear_algebra/CSysMatrix.hpp index d140fc1e6a1..6c75b487596 100644 --- a/Common/include/linear_algebra/CSysMatrix.hpp +++ b/Common/include/linear_algebra/CSysMatrix.hpp @@ -3,7 +3,7 @@ * \brief Declaration of the block-sparse matrix class. * The implemtation is in CSysMatrix.cpp. * \author F. Palacios, A. Bueno, T. Economon, P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -40,7 +40,7 @@ #if defined(HAVE_MKL) && !defined(CODI_FORWARD_TYPE) #include "mkl.h" #ifndef __INTEL_MKL__ - #error Could not determine the MKL version +#error Could not determine the MKL version #endif /*--- JIT is only available since 2019. ---*/ #if __INTEL_MKL__ >= 2019 @@ -50,24 +50,28 @@ making "getrf" and "getrs" compatible with AD since they are not used as often as "gemm". ---*/ #if defined(__INTEL_COMPILER) && defined(MKL_DIRECT_CALL_SEQ) && !defined(CODI_REVERSE_TYPE) - #define USE_MKL_LAPACK +#define USE_MKL_LAPACK #endif -template +template struct mkl_jit_wrapper { using gemm_t = dgemm_jit_kernel_t; - template - static void create_gemm(Ts&&... args) { mkl_jit_create_dgemm(args...); } + template + static void create_gemm(Ts&&... args) { + mkl_jit_create_dgemm(args...); + } static gemm_t get_gemm(void* jitter) { return mkl_jit_get_dgemm_ptr(jitter); } }; -template<> +template <> struct mkl_jit_wrapper { using gemm_t = sgemm_jit_kernel_t; - template - static void create_gemm(Ts&&... args) { mkl_jit_create_sgemm(args...); } + template + static void create_gemm(Ts&&... args) { + mkl_jit_create_sgemm(args...); + } static gemm_t get_gemm(void* jitter) { return mkl_jit_get_sgemm_ptr(jitter); } }; #else - #warning The current version of MKL does not support JIT gemm kernels +#warning The current version of MKL does not support JIT gemm kernels #endif #endif @@ -86,8 +90,8 @@ struct CSysMatrixComms { * \param[in] config - Definition of the particular problem. * \param[in] commType - Enumerated type for the quantity to be communicated. */ - template - static void Initiate(const CSysVector& x, CGeometry *geometry, const CConfig *config, + template + static void Initiate(const CSysVector& x, CGeometry* geometry, const CConfig* config, unsigned short commType = SOLUTION_MATRIX); /*! @@ -98,8 +102,8 @@ struct CSysMatrixComms { * \param[in] config - Definition of the particular problem. * \param[in] commType - Enumerated type for the quantity to be unpacked. */ - template - static void Complete(CSysVector& x, CGeometry *geometry, const CConfig *config, + template + static void Complete(CSysVector& x, CGeometry* geometry, const CConfig* config, unsigned short commType = SOLUTION_MATRIX); }; @@ -108,60 +112,66 @@ struct CSysMatrixComms { * \ingroup SpLinSys * \brief Main class for defining block-compressed-row-storage sparse matrices. */ -template +template class CSysMatrix { -private: + private: friend struct CSysMatrixComms; - const int rank; /*!< \brief MPI Rank. */ - const int size; /*!< \brief MPI Size. */ - - enum : size_t { MAXNVAR = 20 }; /*!< \brief Maximum number of variables the matrix can handle. The static - size is needed for fast, per-thread, static memory allocation. */ - - enum { OMP_MAX_SIZE_L = 8192 }; /*!< \brief Max. chunk size used in light parallel for loops. */ - enum { OMP_MAX_SIZE_H = 512 }; /*!< \brief Max. chunk size used in heavy parallel for loops. */ - enum { OMP_MIN_SIZE = 32 }; /*!< \brief Chunk size for finer grain operations. */ - unsigned long omp_light_size; /*!< \brief Actual chunk size used in light loops (e.g. over non zeros). */ - unsigned long omp_heavy_size; /*!< \brief Actual chunk size used in heavy loops (e.g. over rows). */ - unsigned long omp_num_parts; /*!< \brief Number of threads used in thread-parallel LU_SGS and ILU. */ - unsigned long *omp_partitions; /*!< \brief Point indexes of LU_SGS and ILU thread-parallel sub partitioning. */ - - unsigned long nPoint; /*!< \brief Number of points in the grid. */ - unsigned long nPointDomain; /*!< \brief Number of points in the grid (excluding halos). */ - unsigned long nVar; /*!< \brief Number of variables (and rows of the blocks). */ - unsigned long nEqn; /*!< \brief Number of equations (and columns of the blocks). */ - - ScalarType *matrix; /*!< \brief Entries of the sparse matrix. */ - unsigned long nnz; /*!< \brief Number of possible nonzero entries in the matrix. */ - const unsigned long *row_ptr; /*!< \brief Pointers to the first element in each row. */ - const unsigned long *dia_ptr; /*!< \brief Pointers to the diagonal element in each row. */ - const unsigned long *col_ind; /*!< \brief Column index for each of the elements in val(). */ - const unsigned long *col_ptr; /*!< \brief The transpose of col_ind, pointer to blocks with the same column index. */ - - ScalarType *ILU_matrix; /*!< \brief Entries of the ILU sparse matrix. */ + const int rank; /*!< \brief MPI Rank. */ + const int size; /*!< \brief MPI Size. */ + + enum : size_t { + MAXNVAR = 20 + }; /*!< \brief Maximum number of variables the matrix can handle. The static + size is needed for fast, per-thread, static memory allocation. */ + + enum { OMP_MAX_SIZE_L = 8192 }; /*!< \brief Max. chunk size used in light parallel for loops. */ + enum { OMP_MAX_SIZE_H = 512 }; /*!< \brief Max. chunk size used in heavy parallel for loops. */ + enum { OMP_MIN_SIZE = 32 }; /*!< \brief Chunk size for finer grain operations. */ + unsigned long omp_light_size; /*!< \brief Actual chunk size used in light loops (e.g. over non zeros). */ + unsigned long omp_heavy_size; /*!< \brief Actual chunk size used in heavy loops (e.g. over rows). */ + unsigned long omp_num_parts; /*!< \brief Number of threads used in thread-parallel LU_SGS and ILU. */ + unsigned long* omp_partitions; /*!< \brief Point indexes of LU_SGS and ILU thread-parallel sub partitioning. */ + + unsigned long nPoint; /*!< \brief Number of points in the grid. */ + unsigned long nPointDomain; /*!< \brief Number of points in the grid (excluding halos). */ + unsigned long nVar; /*!< \brief Number of variables (and rows of the blocks). */ + unsigned long nEqn; /*!< \brief Number of equations (and columns of the blocks). */ + + ScalarType* matrix; /*!< \brief Entries of the sparse matrix. */ + unsigned long nnz; /*!< \brief Number of possible nonzero entries in the matrix. */ + const unsigned long* row_ptr; /*!< \brief Pointers to the first element in each row. */ + const unsigned long* dia_ptr; /*!< \brief Pointers to the diagonal element in each row. */ + const unsigned long* col_ind; /*!< \brief Column index for each of the elements in val(). */ + const unsigned long* col_ptr; /*!< \brief The transpose of col_ind, pointer to blocks with the same column index. */ + + ScalarType* ILU_matrix; /*!< \brief Entries of the ILU sparse matrix. */ unsigned long nnz_ilu; /*!< \brief Number of possible nonzero entries in the matrix (ILU). */ - const unsigned long *row_ptr_ilu; /*!< \brief Pointers to the first element in each row (ILU). */ - const unsigned long *dia_ptr_ilu; /*!< \brief Pointers to the diagonal element in each row (ILU). */ - const unsigned long *col_ind_ilu; /*!< \brief Column index for each of the elements in val() (ILU). */ + const unsigned long* row_ptr_ilu; /*!< \brief Pointers to the first element in each row (ILU). */ + const unsigned long* dia_ptr_ilu; /*!< \brief Pointers to the diagonal element in each row (ILU). */ + const unsigned long* col_ind_ilu; /*!< \brief Column index for each of the elements in val() (ILU). */ unsigned short ilu_fill_in; /*!< \brief Fill in level for the ILU preconditioner. */ - ScalarType *invM; /*!< \brief Inverse of (Jacobi) preconditioner, or diagonal of ILU. */ + ScalarType* invM; /*!< \brief Inverse of (Jacobi) preconditioner, or diagonal of ILU. */ /*--- Temporary (hence mutable) working memory used in the Linelet preconditioner, outer vector is for threads ---*/ - mutable vector > LineletUpper; /*!< \brief Pointers to the upper blocks of the tri-diag system (working memory). */ - mutable vector > LineletInvDiag; /*!< \brief Inverse of the diagonal blocks of the tri-diag system (working memory). */ - mutable vector > LineletVector; /*!< \brief Solution and RHS of the tri-diag system (working memory). */ + mutable vector > + LineletUpper; /*!< \brief Pointers to the upper blocks of the tri-diag system (working memory). */ + mutable vector > + LineletInvDiag; /*!< \brief Inverse of the diagonal blocks of the tri-diag system (working memory). */ + mutable vector > + LineletVector; /*!< \brief Solution and RHS of the tri-diag system (working memory). */ #ifdef USE_MKL using gemm_t = typename mkl_jit_wrapper::gemm_t; - void * MatrixMatrixProductJitter; /*!< \brief Jitter handle for MKL JIT based GEMM. */ + void* MatrixMatrixProductJitter; /*!< \brief Jitter handle for MKL JIT based GEMM. */ gemm_t MatrixMatrixProductKernel; /*!< \brief MKL JIT based GEMM kernel. */ - void * MatrixVectorProductJitterBetaZero; /*!< \brief Jitter handle for MKL JIT based GEMV. */ + void* MatrixVectorProductJitterBetaZero; /*!< \brief Jitter handle for MKL JIT based GEMV. */ gemm_t MatrixVectorProductKernelBetaZero; /*!< \brief MKL JIT based GEMV kernel. */ - void * MatrixVectorProductJitterBetaOne; /*!< \brief Jitter handle for MKL JIT based GEMV with BETA=1.0. */ + void* MatrixVectorProductJitterBetaOne; /*!< \brief Jitter handle for MKL JIT based GEMV with BETA=1.0. */ gemm_t MatrixVectorProductKernelBetaOne; /*!< \brief MKL JIT based GEMV kernel with BETA=1.0. */ - void * MatrixVectorProductJitterAlphaMinusOne; /*!< \brief Jitter handle for MKL JIT based GEMV with ALPHA=-1.0 and BETA=1.0. */ + void* MatrixVectorProductJitterAlphaMinusOne; /*!< \brief Jitter handle for MKL JIT based GEMV with ALPHA=-1.0 and + BETA=1.0. */ gemm_t MatrixVectorProductKernelAlphaMinusOne; /*!< \brief MKL JIT based GEMV kernel with ALPHA=-1.0 and BETA=1.0. */ #endif @@ -173,33 +183,38 @@ class CSysMatrix { * \brief Auxilary object to wrap the edge map pointer used in fast block updates, i.e. without linear searches. */ struct { - const unsigned long *ptr = nullptr; + const unsigned long* ptr = nullptr; unsigned long nEdge = 0; operator bool() { return nEdge != 0; } - inline unsigned long operator() (unsigned long edge, unsigned long node) const { - return ptr[2*edge+node]; - } - inline unsigned long ij(unsigned long edge) const { return ptr[2*edge]; } - inline unsigned long ji(unsigned long edge) const { return ptr[2*edge+1]; } + inline unsigned long operator()(unsigned long edge, unsigned long node) const { return ptr[2 * edge + node]; } + inline unsigned long ij(unsigned long edge) const { return ptr[2 * edge]; } + inline unsigned long ji(unsigned long edge) const { return ptr[2 * edge + 1]; } } edge_ptr; /*! - * \brief Handle type conversion for when we Set, Add, etc. blocks, preserving derivative information (if supported by types). + * \brief Handle type conversion for when we Set, Add, etc. blocks, preserving derivative information (if supported by + * types). */ - template::value> = 0> - FORCEINLINE static DstType ActiveAssign(const SrcType& val) { return SU2_TYPE::GetValue(val); } + template ::value> = 0> + FORCEINLINE static DstType ActiveAssign(const SrcType& val) { + return SU2_TYPE::GetValue(val); + } - template::value> = 0> - FORCEINLINE static DstType ActiveAssign(const SrcType& val) { return val; } + template ::value> = 0> + FORCEINLINE static DstType ActiveAssign(const SrcType& val) { + return val; + } /*! * \brief Handle type conversion for when we Set, Add, etc. blocks, discarding derivative information. */ - template - FORCEINLINE static ScalarType PassiveAssign(const SrcType& val) { return SU2_TYPE::GetValue(val); } + template + FORCEINLINE static ScalarType PassiveAssign(const SrcType& val) { + return SU2_TYPE::GetValue(val); + } /*! * \brief Calculates the matrix-vector product: product = matrix*vector @@ -207,7 +222,7 @@ class CSysMatrix { * \param[in] vector * \param[out] product */ - void MatrixVectorProduct(const ScalarType *matrix, const ScalarType *vector, ScalarType *product) const; + void MatrixVectorProduct(const ScalarType* matrix, const ScalarType* vector, ScalarType* product) const; /*! * \brief Calculates the matrix-vector product: product += matrix*vector @@ -215,7 +230,7 @@ class CSysMatrix { * \param[in] vector * \param[in,out] product */ - void MatrixVectorProductAdd(const ScalarType *matrix, const ScalarType *vector, ScalarType *product) const; + void MatrixVectorProductAdd(const ScalarType* matrix, const ScalarType* vector, ScalarType* product) const; /*! * \brief Calculates the matrix-vector product: product -= matrix*vector @@ -223,37 +238,34 @@ class CSysMatrix { * \param[in] vector * \param[in,out] product */ - void MatrixVectorProductSub(const ScalarType *matrix, const ScalarType *vector, ScalarType *product) const; + void MatrixVectorProductSub(const ScalarType* matrix, const ScalarType* vector, ScalarType* product) const; /*! * \brief Calculates the matrix-matrix product */ - void MatrixMatrixProduct(const ScalarType *matrix_a, const ScalarType *matrix_b, ScalarType *product) const; + void MatrixMatrixProduct(const ScalarType* matrix_a, const ScalarType* matrix_b, ScalarType* product) const; /*! * \brief Subtract b from a and store the result in c. */ - FORCEINLINE void VectorSubtraction(const ScalarType *a, const ScalarType *b, ScalarType *c) const { - for(unsigned long iVar = 0; iVar < nVar; iVar++) - c[iVar] = a[iVar] - b[iVar]; + FORCEINLINE void VectorSubtraction(const ScalarType* a, const ScalarType* b, ScalarType* c) const { + for (unsigned long iVar = 0; iVar < nVar; iVar++) c[iVar] = a[iVar] - b[iVar]; } /*! * \brief Subtract b from a and store the result in c. */ - FORCEINLINE void MatrixSubtraction(const ScalarType *a, const ScalarType *b, ScalarType *c) const { + FORCEINLINE void MatrixSubtraction(const ScalarType* a, const ScalarType* b, ScalarType* c) const { SU2_OMP_SIMD - for(unsigned long iVar = 0; iVar < nVar*nEqn; iVar++) - c[iVar] = a[iVar] - b[iVar]; + for (unsigned long iVar = 0; iVar < nVar * nEqn; iVar++) c[iVar] = a[iVar] - b[iVar]; } /*! * \brief Copy matrix src into dst, transpose if required. */ - FORCEINLINE void MatrixCopy(const ScalarType *src, ScalarType *dst) const { + FORCEINLINE void MatrixCopy(const ScalarType* src, ScalarType* dst) const { SU2_OMP_SIMD - for(auto iVar = 0ul; iVar < nVar*nEqn; ++iVar) - dst[iVar] = src[iVar]; + for (auto iVar = 0ul; iVar < nVar * nEqn; ++iVar) dst[iVar] = src[iVar]; } /*! @@ -268,7 +280,7 @@ class CSysMatrix { * \param[in,out] matrix - On entry the system matrix, on exit the factorized matrix. * \param[out] inverse - the matrix inverse. */ - void MatrixInverse(ScalarType *matrix, ScalarType *inverse) const; + void MatrixInverse(ScalarType* matrix, ScalarType* inverse) const; /*! * \brief Performs the Gauss Elimination algorithm to solve the linear subsystem of the (i,i) subblock and rhs. @@ -283,21 +295,21 @@ class CSysMatrix { * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure. * \param[out] invBlock - Inverse block. */ - inline void InverseDiagonalBlock(unsigned long block_i, ScalarType *invBlock) const; + inline void InverseDiagonalBlock(unsigned long block_i, ScalarType* invBlock) const; /*! * \brief Inverse diagonal block. * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure. * \param[out] invBlock - Inverse block. */ - inline void InverseDiagonalBlock_ILUMatrix(unsigned long block_i, ScalarType *invBlock) const; + inline void InverseDiagonalBlock_ILUMatrix(unsigned long block_i, ScalarType* invBlock) const; /*! * \brief Copies the block (i, j) of the matrix-by-blocks structure in the internal variable *block. * \param[in] block_i - Indexes of the block in the matrix-by-blocks structure. * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure. */ - inline ScalarType *GetBlock_ILUMatrix(unsigned long block_i, unsigned long block_j); + inline ScalarType* GetBlock_ILUMatrix(unsigned long block_i, unsigned long block_j); /*! * \brief Set the value of a block in the sparse matrix. @@ -305,7 +317,7 @@ class CSysMatrix { * \param[in] block_j - Indexes of the block in the matrix-by-blocks structure. * \param[in] **val_block - Block to set to A(i, j). */ - inline void SetBlock_ILUMatrix(unsigned long block_i, unsigned long block_j, ScalarType *val_block); + inline void SetBlock_ILUMatrix(unsigned long block_i, unsigned long block_j, ScalarType* val_block); /*! * \brief Performs the product of i-th row of the upper part of a sparse matrix by a vector. @@ -314,8 +326,8 @@ class CSysMatrix { * \param[in] col_ub - Exclusive upper bound for column indices considered in multiplication. * \param[out] prod - Result of the product U(A)*vec. */ - inline void UpperProduct(const CSysVector & vec, unsigned long row_i, - unsigned long col_ub, ScalarType *prod) const; + inline void UpperProduct(const CSysVector& vec, unsigned long row_i, unsigned long col_ub, + ScalarType* prod) const; /*! * \brief Performs the product of i-th row of the lower part of a sparse matrix by a vector. @@ -324,8 +336,8 @@ class CSysMatrix { * \param[in] col_lb - Inclusive lower bound for column indices considered in multiplication. * \param[out] prod - Result of the product L(A)*vec. */ - inline void LowerProduct(const CSysVector & vec, unsigned long row_i, - unsigned long col_lb, ScalarType *prod) const; + inline void LowerProduct(const CSysVector& vec, unsigned long row_i, unsigned long col_lb, + ScalarType* prod) const; /*! * \brief Performs the product of i-th row of the diagonal part of a sparse matrix by a vector. @@ -333,7 +345,7 @@ class CSysMatrix { * \param[in] row_i - Row of the matrix to be multiplied by vector vec. * \return prod Result of the product D(A)*vec (stored at *prod_row_vector). */ - inline void DiagonalProduct(const CSysVector & vec, unsigned long row_i, ScalarType *prod) const; + inline void DiagonalProduct(const CSysVector& vec, unsigned long row_i, ScalarType* prod) const; /*! * \brief Performs the product of i-th row of a sparse matrix by a vector. @@ -341,10 +353,9 @@ class CSysMatrix { * \param[in] row_i - Row of the matrix to be multiplied by vector vec. * \return Result of the product (stored at *prod_row_vector). */ - void RowProduct(const CSysVector & vec, unsigned long row_i, ScalarType *prod) const; - -public: + void RowProduct(const CSysVector& vec, unsigned long row_i, ScalarType* prod) const; + public: /*! * \brief Constructor of the class. */ @@ -366,10 +377,9 @@ class CSysMatrix { * \param[in] config - Definition of the particular problem. * \param[in] needTranspPtr - If "col_ptr" should be created, used for "SetDiagonalAsColumnSum". */ - void Initialize(unsigned long npoint, unsigned long npointdomain, - unsigned short nvar, unsigned short neqn, - bool EdgeConnect, CGeometry *geometry, - const CConfig *config, bool needTranspPtr = false, bool grad_mode = false); + void Initialize(unsigned long npoint, unsigned long npointdomain, unsigned short nvar, unsigned short neqn, + bool EdgeConnect, CGeometry* geometry, const CConfig* config, bool needTranspPtr = false, + bool grad_mode = false); /*! * \brief Sets to zero all the entries of the sparse matrix. @@ -387,21 +397,20 @@ class CSysMatrix { * \param[in] block_j - Column index. * \return Pointer to location in memory where the block starts. */ - FORCEINLINE const ScalarType *GetBlock(unsigned long block_i, unsigned long block_j) const { + FORCEINLINE const ScalarType* GetBlock(unsigned long block_i, unsigned long block_j) const { /*--- The position of the diagonal block is known which allows halving the search space. ---*/ - const auto end = (block_j( const_this.GetBlock(block_i, block_j) ); + return const_cast(const_this.GetBlock(block_i, block_j)); } /*! @@ -412,11 +421,11 @@ class CSysMatrix { * \param[in] jVar - Column of the block. * \return Value of the block entry. */ - FORCEINLINE ScalarType GetBlock(unsigned long block_i, unsigned long block_j, - unsigned short iVar, unsigned short jVar) const { + FORCEINLINE ScalarType GetBlock(unsigned long block_i, unsigned long block_j, unsigned short iVar, + unsigned short jVar) const { auto mat_ij = GetBlock(block_i, block_j); if (!mat_ij) return 0.0; - return mat_ij[iVar*nEqn+jVar]; + return mat_ij[iVar * nEqn + jVar]; } /*! @@ -427,16 +436,14 @@ class CSysMatrix { * \param[in] val_block - Block to set to A(i, j). * \param[in] alpha - Scale factor. */ - template::value> = 0> - inline void SetBlock(unsigned long block_i, unsigned long block_j, - const OtherType *val_block, OtherType alpha = 1.0) { - + template ::value> = 0> + inline void SetBlock(unsigned long block_i, unsigned long block_j, const OtherType* val_block, + OtherType alpha = 1.0) { auto mat_ij = GetBlock(block_i, block_j); if (!mat_ij) return; SU2_OMP_SIMD - for (auto iVar = 0ul; iVar < nVar*nEqn; ++iVar) { - mat_ij[iVar] = (Overwrite? ScalarType(0) : mat_ij[iVar]) + PassiveAssign(alpha * val_block[iVar]); + for (auto iVar = 0ul; iVar < nVar * nEqn; ++iVar) { + mat_ij[iVar] = (Overwrite ? ScalarType(0) : mat_ij[iVar]) + PassiveAssign(alpha * val_block[iVar]); } } @@ -447,10 +454,10 @@ class CSysMatrix { * \param[in] val_block - Block to set to A(i, j). * \param[in] alpha - Scale factor. */ - template::value> = 0> - inline void AddBlock(unsigned long block_i, unsigned long block_j, - const OtherType *val_block, OtherType alpha = 1.0) { - SetBlock(block_i, block_j, val_block, alpha); + template ::value> = 0> + inline void AddBlock(unsigned long block_i, unsigned long block_j, const OtherType* val_block, + OtherType alpha = 1.0) { + SetBlock(block_i, block_j, val_block, alpha); } /*! @@ -461,15 +468,14 @@ class CSysMatrix { * \param[in] val_block - Block to set to A(i, j). * \param[in] alpha - Scale factor. */ - template - inline void SetBlock(unsigned long block_i, unsigned long block_j, - const OtherType* const* val_block, OtherType alpha = 1.0) { - + template + inline void SetBlock(unsigned long block_i, unsigned long block_j, const OtherType* const* val_block, + OtherType alpha = 1.0) { auto mat_ij = GetBlock(block_i, block_j); if (!mat_ij) return; for (auto iVar = 0ul; iVar < nVar; ++iVar) { for (auto jVar = 0ul; jVar < nEqn; ++jVar) { - *mat_ij = (Overwrite? ScalarType(0) : *mat_ij) + PassiveAssign(alpha * val_block[iVar][jVar]); + *mat_ij = (Overwrite ? ScalarType(0) : *mat_ij) + PassiveAssign(alpha * val_block[iVar][jVar]); ++mat_ij; } } @@ -482,10 +488,10 @@ class CSysMatrix { * \param[in] val_block - Block to add to A(i, j). * \param[in] alpha - Scale factor. */ - template - inline void AddBlock(unsigned long block_i, unsigned long block_j, - const OtherType* const* val_block, OtherType alpha = 1.0) { - SetBlock(block_i, block_j, val_block, alpha); + template + inline void AddBlock(unsigned long block_i, unsigned long block_j, const OtherType* const* val_block, + OtherType alpha = 1.0) { + SetBlock(block_i, block_j, val_block, alpha); } /*! @@ -494,7 +500,7 @@ class CSysMatrix { * \param[in] block_j - Column index. * \param[in] val_block - Block to subtract to A(i, j). */ - template + template inline void SubtractBlock(unsigned long block_i, unsigned long block_j, const OtherType* const* val_block) { AddBlock(block_i, block_j, val_block, OtherType(-1)); } @@ -545,14 +551,13 @@ class CSysMatrix { * \param[in] block_j - Adds to ij, subs from jj. * \param[in] scale - Scale blocks during update (axpy type op). */ - template - inline void UpdateBlocks(unsigned long iEdge, unsigned long iPoint, unsigned long jPoint, - const MatrixType& block_i, const MatrixType& block_j, OtherType scale = 1) { - - ScalarType *bii = &matrix[dia_ptr[iPoint]*nVar*nEqn]; - ScalarType *bjj = &matrix[dia_ptr[jPoint]*nVar*nEqn]; - ScalarType *bij = &matrix[edge_ptr(iEdge,0)*nVar*nEqn]; - ScalarType *bji = &matrix[edge_ptr(iEdge,1)*nVar*nEqn]; + template + inline void UpdateBlocks(unsigned long iEdge, unsigned long iPoint, unsigned long jPoint, const MatrixType& block_i, + const MatrixType& block_j, OtherType scale = 1) { + ScalarType* bii = &matrix[dia_ptr[iPoint] * nVar * nEqn]; + ScalarType* bjj = &matrix[dia_ptr[jPoint] * nVar * nEqn]; + ScalarType* bij = &matrix[edge_ptr(iEdge, 0) * nVar * nEqn]; + ScalarType* bji = &matrix[edge_ptr(iEdge, 1) * nVar * nEqn]; unsigned long iVar, jVar, offset = 0; @@ -570,51 +575,50 @@ class CSysMatrix { /*! * \brief Short-hand for the "subtractive" version (sub from i* add to j*) of UpdateBlocks. */ - template + template inline void UpdateBlocksSub(unsigned long iEdge, unsigned long iPoint, unsigned long jPoint, const MatrixType& block_i, const MatrixType& block_j) { - UpdateBlocks(iEdge, iPoint, jPoint, block_i, block_j, -1); + UpdateBlocks(iEdge, iPoint, jPoint, block_i, block_j, -1); } /*! * \brief SIMD version, does the update for multiple edges and points. * \note Nothing is updated if the mask is 0. */ - template - FORCEINLINE void UpdateBlocks(simd::Array iEdge, simd::Array iPoint, simd::Array jPoint, - const MatTypeSIMD& block_i, const MatTypeSIMD& block_j, simd::Array mask = 1) { - + template + FORCEINLINE void UpdateBlocks(simd::Array iEdge, simd::Array iPoint, simd::Array jPoint, + const MatTypeSIMD& block_i, const MatTypeSIMD& block_j, simd::Array mask = 1) { static_assert(MatTypeSIMD::StaticSize, "This method requires static size blocks."); static_assert(MatTypeSIMD::IsRowMajor, "Block storage is not compatible with matrix."); constexpr size_t blkSz = MatTypeSIMD::StaticSize; - assert(blkSz == nVar*nEqn); + assert(blkSz == nVar * nEqn); /*--- "Transpose" the blocks, scale, and possibly convert types, * giving the compiler the chance to vectorize all of these. ---*/ ScalarType blk_i[N][blkSz], blk_j[N][blkSz]; - for (size_t i=0; i - inline void SetBlocks(unsigned long iEdge, const MatrixType& block_i, - const MatrixType& block_j, OtherType scale = 1) { - - ScalarType *bij = &matrix[edge_ptr(iEdge,0)*nVar*nEqn]; - ScalarType *bji = &matrix[edge_ptr(iEdge,1)*nVar*nEqn]; + template + inline void SetBlocks(unsigned long iEdge, const MatrixType& block_i, const MatrixType& block_j, + OtherType scale = 1) { + ScalarType* bij = &matrix[edge_ptr(iEdge, 0) * nVar * nEqn]; + ScalarType* bji = &matrix[edge_ptr(iEdge, 1) * nVar * nEqn]; unsigned long iVar, jVar, offset = 0; for (iVar = 0; iVar < nVar; iVar++) { for (jVar = 0; jVar < nEqn; jVar++) { - bij[offset] = (Overwrite? ScalarType(0) : bij[offset]) + PassiveAssign(block_j[iVar][jVar] * scale); - bji[offset] = (Overwrite? ScalarType(0) : bji[offset]) - PassiveAssign(block_i[iVar][jVar] * scale); + bij[offset] = (Overwrite ? ScalarType(0) : bij[offset]) + PassiveAssign(block_j[iVar][jVar] * scale); + bji[offset] = (Overwrite ? ScalarType(0) : bji[offset]) - PassiveAssign(block_i[iVar][jVar] * scale); ++offset; } } @@ -654,57 +657,56 @@ class CSysMatrix { /*! * \brief Short-hand for the "additive overwrite" version of SetBlocks. */ - template - inline void UpdateBlocks(unsigned long iEdge, const MatrixType& block_i, - const MatrixType& block_j, OtherType scale = 1) { - SetBlocks(iEdge, block_i, block_j, scale); + template + inline void UpdateBlocks(unsigned long iEdge, const MatrixType& block_i, const MatrixType& block_j, + OtherType scale = 1) { + SetBlocks(iEdge, block_i, block_j, scale); } /*! * \brief Short-hand for the "subtractive" version (sub from i* add to j*) of SetBlocks. */ - template + template inline void UpdateBlocksSub(unsigned long iEdge, const MatrixType& block_i, const MatrixType& block_j) { - SetBlocks(iEdge, block_i, block_j, -1); + SetBlocks(iEdge, block_i, block_j, -1); } /*! * \brief SIMD version, does the update for multiple edges. * \note Nothing is updated if the mask is 0. */ - template - FORCEINLINE void SetBlocks(simd::Array iEdge, const MatTypeSIMD& block_i, - const MatTypeSIMD& block_j, simd::Array mask = 1) { - + template + FORCEINLINE void SetBlocks(simd::Array iEdge, const MatTypeSIMD& block_i, const MatTypeSIMD& block_j, + simd::Array mask = 1) { static_assert(MatTypeSIMD::StaticSize, "This method requires static size blocks."); static_assert(MatTypeSIMD::IsRowMajor, "Block storage is not compatible with matrix."); constexpr size_t blkSz = MatTypeSIMD::StaticSize; - assert(blkSz == nVar*nEqn); + assert(blkSz == nVar * nEqn); /*--- "Transpose" the blocks, scale, and possibly convert types, * giving the compiler the chance to vectorize all of these. ---*/ ScalarType blk_i[N][blkSz], blk_j[N][blkSz]; - for (size_t i=0; i + template inline void SetBlock2Diag(unsigned long block_i, const OtherType& val_block, T alpha = 1.0) { - - auto mat_ii = &matrix[dia_ptr[block_i]*nVar*nEqn]; + auto mat_ii = &matrix[dia_ptr[block_i] * nVar * nEqn]; for (auto iVar = 0ul; iVar < nVar; iVar++) for (auto jVar = 0ul; jVar < nEqn; jVar++) { - *mat_ii = (Overwrite? ScalarType(0) : *mat_ii) + PassiveAssign(alpha * val_block[iVar][jVar]); + *mat_ii = (Overwrite ? ScalarType(0) : *mat_ii) + PassiveAssign(alpha * val_block[iVar][jVar]); ++mat_ii; } } @@ -734,15 +735,15 @@ class CSysMatrix { /*! * \brief Non overwrite version of SetBlock2Diag, also with scaling. */ - template + template inline void AddBlock2Diag(unsigned long block_i, const OtherType& val_block, T alpha = 1.0) { - SetBlock2Diag(block_i, val_block, alpha); + SetBlock2Diag(block_i, val_block, alpha); } /*! * \brief Short-hand to AddBlock2Diag with alpha = -1, i.e. subtracts from the current diagonal. */ - template + template inline void SubtractBlock2Diag(unsigned long block_i, const OtherType& val_block) { AddBlock2Diag(block_i, val_block, -1.0); } @@ -753,10 +754,10 @@ class CSysMatrix { * \param[in] block_i - Diagonal index. * \param[in] val_matrix - Value to add to the diagonal elements of A(i, i). */ - template + template inline void AddVal2Diag(unsigned long block_i, OtherType val_matrix) { for (auto iVar = 0ul; iVar < nVar; iVar++) - matrix[dia_ptr[block_i]*nVar*nVar + iVar*(nVar+1)] += PassiveAssign(val_matrix); + matrix[dia_ptr[block_i] * nVar * nVar + iVar * (nVar + 1)] += PassiveAssign(val_matrix); } /*! @@ -766,9 +767,9 @@ class CSysMatrix { * \param[in] iVar - Variable index. * \param[in] val - Value to add to the diagonal elements of A(i, i). */ - template + template inline void AddVal2Diag(unsigned long block_i, unsigned long iVar, OtherType val) { - matrix[dia_ptr[block_i]*nVar*nVar + iVar*(nVar+1)] += PassiveAssign(val); + matrix[dia_ptr[block_i] * nVar * nVar + iVar * (nVar + 1)] += PassiveAssign(val); } /*! @@ -777,18 +778,15 @@ class CSysMatrix { * \param[in] block_i - Diagonal index. * \param[in] val_matrix - Value to add to the diagonal elements of A(i, i). */ - template + template inline void SetVal2Diag(unsigned long block_i, OtherType val_matrix) { - - unsigned long iVar, index = dia_ptr[block_i]*nVar*nVar; + unsigned long iVar, index = dia_ptr[block_i] * nVar * nVar; /*--- Clear entire block before setting its diagonal. ---*/ SU2_OMP_SIMD - for (iVar = 0; iVar < nVar*nVar; iVar++) - matrix[index+iVar] = 0.0; + for (iVar = 0; iVar < nVar * nVar; iVar++) matrix[index + iVar] = 0.0; - for (iVar = 0; iVar < nVar; iVar++) - matrix[index+iVar*(nVar+1)] = PassiveAssign(val_matrix); + for (iVar = 0; iVar < nVar; iVar++) matrix[index + iVar * (nVar + 1)] = PassiveAssign(val_matrix); } /*! @@ -803,14 +801,14 @@ class CSysMatrix { * \param[in] x_i - Values to enforce (nVar sized). * \param[in,out] b - The rhs vector (b := b - A_{*,i} * x_i; b_i = x_i). */ - template - void EnforceSolutionAtNode(unsigned long node_i, const OtherType *x_i, CSysVector & b); + template + void EnforceSolutionAtNode(unsigned long node_i, const OtherType* x_i, CSysVector& b); /*! * \brief Version of EnforceSolutionAtNode for a single degree of freedom. */ - template - void EnforceSolutionAtDOF(unsigned long node_i, unsigned long iVar, OtherType x_i, CSysVector & b); + template + void EnforceSolutionAtDOF(unsigned long node_i, unsigned long iVar, OtherType x_i, CSysVector& b); /*! * \brief Sets the diagonal entries of the matrix as the sum of the blocks in the corresponding column. @@ -837,8 +835,8 @@ class CSysMatrix { * \param[in] config - Definition of the particular problem. * \param[out] prod - Result of the product. */ - void MatrixVectorProduct(const CSysVector & vec, CSysVector & prod, - CGeometry *geometry, const CConfig *config) const; + void MatrixVectorProduct(const CSysVector& vec, CSysVector& prod, CGeometry* geometry, + const CConfig* config) const; /*! * \brief Build the Jacobi preconditioner. @@ -852,8 +850,8 @@ class CSysMatrix { * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void ComputeJacobiPreconditioner(const CSysVector & vec, CSysVector & prod, - CGeometry *geometry, const CConfig *config) const; + void ComputeJacobiPreconditioner(const CSysVector& vec, CSysVector& prod, CGeometry* geometry, + const CConfig* config) const; /*! * \brief Build the ILU preconditioner. @@ -867,31 +865,31 @@ class CSysMatrix { * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void ComputeILUPreconditioner(const CSysVector & vec, CSysVector & prod, - CGeometry *geometry, const CConfig *config) const; + void ComputeILUPreconditioner(const CSysVector& vec, CSysVector& prod, CGeometry* geometry, + const CConfig* config) const; /*! * \brief Multiply CSysVector by the preconditioner * \param[in] vec - CSysVector to be multiplied by the preconditioner. * \param[out] prod - Result of the product A*vec. */ - void ComputeLU_SGSPreconditioner(const CSysVector & vec, CSysVector & prod, - CGeometry *geometry, const CConfig *config) const; + void ComputeLU_SGSPreconditioner(const CSysVector& vec, CSysVector& prod, CGeometry* geometry, + const CConfig* config) const; /*! * \brief Build the Linelet preconditioner. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void BuildLineletPreconditioner(const CGeometry *geometry, const CConfig *config); + void BuildLineletPreconditioner(const CGeometry* geometry, const CConfig* config); /*! * \brief Multiply CSysVector by the preconditioner * \param[in] vec - CSysVector to be multiplied by the preconditioner. * \param[out] prod - Result of the product A*vec. */ - void ComputeLineletPreconditioner(const CSysVector & vec, CSysVector & prod, - CGeometry *geometry, const CConfig *config) const; + void ComputeLineletPreconditioner(const CSysVector& vec, CSysVector& prod, + CGeometry* geometry, const CConfig* config) const; /*! * \brief Compute the linear residual. @@ -899,8 +897,8 @@ class CSysMatrix { * \param[in] f - Right hand side (b). * \param[out] res - Residual (Ax-b). */ - void ComputeResidual(const CSysVector & sol, const CSysVector & f, - CSysVector & res) const; + void ComputeResidual(const CSysVector& sol, const CSysVector& f, + CSysVector& res) const; /*! * \brief Factorize matrix using PaStiX. @@ -908,7 +906,7 @@ class CSysMatrix { * \param[in] config - Definition of the particular problem. * \param[in] kind_fact - Type of factorization. */ - void BuildPastixPreconditioner(CGeometry *geometry, const CConfig *config, unsigned short kind_fact); + void BuildPastixPreconditioner(CGeometry* geometry, const CConfig* config, unsigned short kind_fact); /*! * \brief Apply the PaStiX factorization to CSysVec. @@ -917,7 +915,6 @@ class CSysMatrix { * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void ComputePastixPreconditioner(const CSysVector & vec, CSysVector & prod, - CGeometry *geometry, const CConfig *config) const; - + void ComputePastixPreconditioner(const CSysVector& vec, CSysVector& prod, CGeometry* geometry, + const CConfig* config) const; }; diff --git a/Common/include/linear_algebra/CSysMatrix.inl b/Common/include/linear_algebra/CSysMatrix.inl index 139a6b0f45b..cbe4b18d6ff 100644 --- a/Common/include/linear_algebra/CSysMatrix.inl +++ b/Common/include/linear_algebra/CSysMatrix.inl @@ -5,7 +5,7 @@ * of the .cpp file and so they are hidden to avoid triggering * recompilation of other units when changes are made here. * \author F. Palacios, A. Bueno, T. Economon, P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -32,19 +32,18 @@ #include "CSysMatrix.hpp" -template -FORCEINLINE ScalarType *CSysMatrix::GetBlock_ILUMatrix(unsigned long block_i, unsigned long block_j) { +template +FORCEINLINE ScalarType* CSysMatrix::GetBlock_ILUMatrix(unsigned long block_i, unsigned long block_j) { /*--- The position of the diagonal block is known which allows halving the search space. ---*/ - const auto end = (block_j -FORCEINLINE void CSysMatrix::SetBlock_ILUMatrix(unsigned long block_i, unsigned long block_j, ScalarType *val_block) { - +template +FORCEINLINE void CSysMatrix::SetBlock_ILUMatrix(unsigned long block_i, unsigned long block_j, + ScalarType* val_block) { auto ilu_ij = GetBlock_ILUMatrix(block_i, block_j); if (!ilu_ij) return; MatrixCopy(val_block, ilu_ij); @@ -52,8 +51,8 @@ FORCEINLINE void CSysMatrix::SetBlock_ILUMatrix(unsigned long block_ namespace { -template -FORCEINLINE void gemv_impl(unsigned long n, unsigned long m, const T *a, const T *b, T *c) { +template +FORCEINLINE void gemv_impl(unsigned long n, unsigned long m, const T* a, const T* b, T* c) { /*--- This is a templated version of GEMV with the constants as boolean template parameters so that they can be optimized away at compilation. @@ -62,158 +61,151 @@ FORCEINLINE void gemv_impl(unsigned long n, unsigned long m, const T *a, const T if (!transp) { for (auto i = 0ul; i < n; i++) { if (!beta) c[i] = 0.0; - for (auto j = 0ul; j < m; j++) - c[i] += (alpha? 1 : -1) * a[i*m+j] * b[j]; + for (auto j = 0ul; j < m; j++) c[i] += (alpha ? 1 : -1) * a[i * m + j] * b[j]; } } else { - if (!beta) for (auto j = 0ul; j < m; j++) c[j] = 0.0; + if (!beta) + for (auto j = 0ul; j < m; j++) c[j] = 0.0; for (auto i = 0ul; i < n; i++) - for (auto j = 0ul; j < m; j++) - c[j] += (alpha? 1 : -1) * a[i*n+j] * b[i]; + for (auto j = 0ul; j < m; j++) c[j] += (alpha ? 1 : -1) * a[i * n + j] * b[i]; } } -template -FORCEINLINE void gemm_impl(unsigned long n, const T *a, const T *b, T *c) { +template +FORCEINLINE void gemm_impl(unsigned long n, const T* a, const T* b, T* c) { /*--- Same deal as for GEMV but here only the type is templated. ---*/ unsigned long i, j, k; for (i = 0; i < n; i++) { for (j = 0; j < n; j++) { - c[i*n+j] = 0.0; - for (k = 0; k < n; k++) - c[i*n+j] += a[i*n+k] * b[k*n+j]; + c[i * n + j] = 0.0; + for (k = 0; k < n; k++) c[i * n + j] += a[i * n + k] * b[k * n + j]; } } } -} // namespace +} // namespace -#define __MATVECPROD_SIGNATURE__(TYPE,NAME) \ -FORCEINLINE void CSysMatrix::NAME(const TYPE *matrix, const TYPE *vector, TYPE *product) const +#define __MATVECPROD_SIGNATURE__(TYPE, NAME) \ + FORCEINLINE void CSysMatrix::NAME(const TYPE* matrix, const TYPE* vector, TYPE* product) const -#define MATVECPROD_SIGNATURE(NAME) template __MATVECPROD_SIGNATURE__(ScalarType,NAME) +#define MATVECPROD_SIGNATURE(NAME) \ + template \ + __MATVECPROD_SIGNATURE__(ScalarType, NAME) #if !defined(USE_MKL) -MATVECPROD_SIGNATURE( MatrixVectorProduct ) { +MATVECPROD_SIGNATURE(MatrixVectorProduct) { /*--- Without MKL (default) picture copying the body of gemv_impl here and resolving the conditionals at compilation. ---*/ - gemv_impl(nVar, nEqn, matrix, vector, product); + gemv_impl(nVar, nEqn, matrix, vector, product); } -MATVECPROD_SIGNATURE( MatrixVectorProductAdd ) { - gemv_impl(nVar, nEqn, matrix, vector, product); +MATVECPROD_SIGNATURE(MatrixVectorProductAdd) { + gemv_impl(nVar, nEqn, matrix, vector, product); } -MATVECPROD_SIGNATURE( MatrixVectorProductSub ) { - gemv_impl(nVar, nEqn, matrix, vector, product); +MATVECPROD_SIGNATURE(MatrixVectorProductSub) { + gemv_impl(nVar, nEqn, matrix, vector, product); } -template -FORCEINLINE void CSysMatrix::MatrixMatrixProduct(const ScalarType *matrix_a, - const ScalarType *matrix_b, ScalarType *product) const { +template +FORCEINLINE void CSysMatrix::MatrixMatrixProduct(const ScalarType* matrix_a, const ScalarType* matrix_b, + ScalarType* product) const { gemm_impl(nVar, matrix_a, matrix_b, product); } #else -MATVECPROD_SIGNATURE( MatrixVectorProduct ) { +MATVECPROD_SIGNATURE(MatrixVectorProduct) { /*--- With MKL we use the just-in-time kernels instead of the naive implementation. ---*/ MatrixVectorProductKernelBetaZero(MatrixVectorProductJitterBetaZero, const_cast(vector), - const_cast(matrix), product ); + const_cast(matrix), product); } -MATVECPROD_SIGNATURE( MatrixVectorProductAdd ) { +MATVECPROD_SIGNATURE(MatrixVectorProductAdd) { MatrixVectorProductKernelBetaOne(MatrixVectorProductJitterBetaOne, const_cast(vector), - const_cast(matrix), product ); + const_cast(matrix), product); } -MATVECPROD_SIGNATURE( MatrixVectorProductSub ) { +MATVECPROD_SIGNATURE(MatrixVectorProductSub) { MatrixVectorProductKernelAlphaMinusOne(MatrixVectorProductJitterAlphaMinusOne, const_cast(vector), - const_cast(matrix), product ); + const_cast(matrix), product); } -template -FORCEINLINE void CSysMatrix::MatrixMatrixProduct(const ScalarType *matrix_a, - const ScalarType *matrix_b, ScalarType *product) const { +template +FORCEINLINE void CSysMatrix::MatrixMatrixProduct(const ScalarType* matrix_a, const ScalarType* matrix_b, + ScalarType* product) const { MatrixMatrixProductKernel(MatrixMatrixProductJitter, const_cast(matrix_a), - const_cast(matrix_b), product ); + const_cast(matrix_b), product); } #endif #undef MATVECPROD_SIGNATURE #undef __MATVECPROD_SIGNATURE__ -template +template FORCEINLINE void CSysMatrix::Gauss_Elimination(unsigned long block_i, ScalarType* rhs) const { - /*--- Copy block, as the algorithm modifies the matrix ---*/ - ScalarType block[MAXNVAR*MAXNVAR]; - MatrixCopy(&matrix[dia_ptr[block_i]*nVar*nVar], block); + ScalarType block[MAXNVAR * MAXNVAR]; + MatrixCopy(&matrix[dia_ptr[block_i] * nVar * nVar], block); Gauss_Elimination(block, rhs); } -template -FORCEINLINE void CSysMatrix::InverseDiagonalBlock(unsigned long block_i, ScalarType *invBlock) const { - +template +FORCEINLINE void CSysMatrix::InverseDiagonalBlock(unsigned long block_i, ScalarType* invBlock) const { /*--- Copy block, as the algorithm modifies the matrix ---*/ - ScalarType block[MAXNVAR*MAXNVAR]; - MatrixCopy(&matrix[dia_ptr[block_i]*nVar*nVar], block); + ScalarType block[MAXNVAR * MAXNVAR]; + MatrixCopy(&matrix[dia_ptr[block_i] * nVar * nVar], block); MatrixInverse(block, invBlock); } -template -FORCEINLINE void CSysMatrix::InverseDiagonalBlock_ILUMatrix(unsigned long block_i, ScalarType *invBlock) const { - +template +FORCEINLINE void CSysMatrix::InverseDiagonalBlock_ILUMatrix(unsigned long block_i, + ScalarType* invBlock) const { /*--- Copy block, as the algorithm modifies the matrix ---*/ - ScalarType block[MAXNVAR*MAXNVAR]; - MatrixCopy(&ILU_matrix[dia_ptr_ilu[block_i]*nVar*nVar], block); + ScalarType block[MAXNVAR * MAXNVAR]; + MatrixCopy(&ILU_matrix[dia_ptr_ilu[block_i] * nVar * nVar], block); MatrixInverse(block, invBlock); } -template -FORCEINLINE void CSysMatrix::RowProduct(const CSysVector & vec, - unsigned long row_i, ScalarType *prod) const { - for (auto iVar = 0ul; iVar < nVar; iVar++) - prod[iVar] = 0.0; +template +FORCEINLINE void CSysMatrix::RowProduct(const CSysVector& vec, unsigned long row_i, + ScalarType* prod) const { + for (auto iVar = 0ul; iVar < nVar; iVar++) prod[iVar] = 0.0; - for (auto index = row_ptr[row_i]; index < row_ptr[row_i+1]; index++) { + for (auto index = row_ptr[row_i]; index < row_ptr[row_i + 1]; index++) { auto col_j = col_ind[index]; - MatrixVectorProductAdd(&matrix[index*nVar*nEqn], &vec[col_j*nEqn], prod); + MatrixVectorProductAdd(&matrix[index * nVar * nEqn], &vec[col_j * nEqn], prod); } } -template -FORCEINLINE void CSysMatrix::UpperProduct(const CSysVector & vec, unsigned long row_i, - unsigned long col_ub, ScalarType *prod) const { - for (auto iVar = 0ul; iVar < nVar; iVar++) - prod[iVar] = 0.0; +template +FORCEINLINE void CSysMatrix::UpperProduct(const CSysVector& vec, unsigned long row_i, + unsigned long col_ub, ScalarType* prod) const { + for (auto iVar = 0ul; iVar < nVar; iVar++) prod[iVar] = 0.0; - for (auto index = dia_ptr[row_i]+1; index < row_ptr[row_i+1]; index++) { + for (auto index = dia_ptr[row_i] + 1; index < row_ptr[row_i + 1]; index++) { auto col_j = col_ind[index]; /*--- Always include halos. ---*/ if (col_j < col_ub || col_j >= nPointDomain) - MatrixVectorProductAdd(&matrix[index*nVar*nEqn], &vec[col_j*nEqn], prod); + MatrixVectorProductAdd(&matrix[index * nVar * nEqn], &vec[col_j * nEqn], prod); } } -template -FORCEINLINE void CSysMatrix::LowerProduct(const CSysVector & vec, unsigned long row_i, - unsigned long col_lb, ScalarType *prod) const { - for (auto iVar = 0ul; iVar < nVar; iVar++) - prod[iVar] = 0.0; +template +FORCEINLINE void CSysMatrix::LowerProduct(const CSysVector& vec, unsigned long row_i, + unsigned long col_lb, ScalarType* prod) const { + for (auto iVar = 0ul; iVar < nVar; iVar++) prod[iVar] = 0.0; for (auto index = row_ptr[row_i]; index < dia_ptr[row_i]; index++) { auto col_j = col_ind[index]; - if (col_j >= col_lb) - MatrixVectorProductAdd(&matrix[index*nVar*nEqn], &vec[col_j*nEqn], prod); + if (col_j >= col_lb) MatrixVectorProductAdd(&matrix[index * nVar * nEqn], &vec[col_j * nEqn], prod); } } -template -FORCEINLINE void CSysMatrix::DiagonalProduct(const CSysVector & vec, - unsigned long row_i, ScalarType *prod) const { - - MatrixVectorProduct(&matrix[dia_ptr[row_i]*nVar*nEqn], &vec[row_i*nEqn], prod); +template +FORCEINLINE void CSysMatrix::DiagonalProduct(const CSysVector& vec, unsigned long row_i, + ScalarType* prod) const { + MatrixVectorProduct(&matrix[dia_ptr[row_i] * nVar * nEqn], &vec[row_i * nEqn], prod); } diff --git a/Common/include/linear_algebra/CSysSolve.hpp b/Common/include/linear_algebra/CSysSolve.hpp index 6c214ee4b29..6df8fafa0b4 100644 --- a/Common/include/linear_algebra/CSysSolve.hpp +++ b/Common/include/linear_algebra/CSysSolve.hpp @@ -3,7 +3,7 @@ * \brief Headers for the classes related to linear solvers (CG, FGMRES, etc) * The subroutines and functions are in the CSysSolve.cpp file. * \author J. Hicken, F. Palacios, T. Economon, P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -42,13 +42,16 @@ class CConfig; class CGeometry; -template class CSysMatrix; -template class CMatrixVectorProduct; -template class CPreconditioner; +template +class CSysMatrix; +template +class CMatrixVectorProduct; +template +class CPreconditioner; /*--- Relative tolerance, target residual is tol*||b-Ax||, * Absolute tolerance, target residual is tol*||b||. ---*/ -enum class LinearToleranceType {RELATIVE, ABSOLUTE}; +enum class LinearToleranceType { RELATIVE, ABSOLUTE }; /*! * \class CSysSolve @@ -64,10 +67,9 @@ enum class LinearToleranceType {RELATIVE, ABSOLUTE}; * Beware of writes to class member variables, for example "Residual" should only * be modified by one thread. */ -template +template class CSysSolve { - -public: + public: /*--- Some aliases for simplicity. ---*/ using Scalar = ScalarType; using VectorType = CSysVector; @@ -75,37 +77,43 @@ class CSysSolve { using ProductType = CMatrixVectorProduct; using PrecondType = CPreconditioner; -private: - const ScalarType eps; /*!< \brief Machine epsilon used in this class. */ - ScalarType Residual=1e-20; /*!< \brief Residual at the end of a call to Solve or Solve_b. */ - unsigned long Iterations=0;/*!< \brief Iterations done in Solve or Solve_b. */ + private: + const ScalarType eps; /*!< \brief Machine epsilon used in this class. */ + ScalarType Residual = 1e-20; /*!< \brief Residual at the end of a call to Solve or Solve_b. */ + unsigned long Iterations = 0; /*!< \brief Iterations done in Solve or Solve_b. */ - LINEAR_SOLVER_MODE lin_sol_mode; /*!< \brief Type of operation for the linear system solver, changes the source of solver options. */ + LINEAR_SOLVER_MODE + lin_sol_mode; /*!< \brief Type of operation for the linear system solver, changes the source of solver options. */ mutable bool cg_ready; /*!< \brief Indicate if memory used by CG is allocated. */ mutable bool bcg_ready; /*!< \brief Indicate if memory used by BCGSTAB is allocated. */ mutable bool smooth_ready; /*!< \brief Indicate if memory used by SMOOTHER is allocated. */ - mutable VectorType r; /*!< \brief Residual in CG and BCGSTAB. */ - mutable VectorType A_x; /*!< \brief Result of matrix-vector product in CG and BCGSTAB. */ - mutable VectorType p; /*!< \brief Direction in CG and BCGSTAB. */ - mutable VectorType z; /*!< \brief Preconditioned residual/direction in CG/BCGSTAB. */ + mutable VectorType r; /*!< \brief Residual in CG and BCGSTAB. */ + mutable VectorType A_x; /*!< \brief Result of matrix-vector product in CG and BCGSTAB. */ + mutable VectorType p; /*!< \brief Direction in CG and BCGSTAB. */ + mutable VectorType z; /*!< \brief Preconditioned residual/direction in CG/BCGSTAB. */ - mutable VectorType r_0; /*!< \brief The "arbitrary" vector in BCGSTAB. */ - mutable VectorType v; /*!< \brief BCGSTAB "v" vector (v = A * M^-1 * p). */ + mutable VectorType r_0; /*!< \brief The "arbitrary" vector in BCGSTAB. */ + mutable VectorType v; /*!< \brief BCGSTAB "v" vector (v = A * M^-1 * p). */ - mutable std::vector W; /*!< \brief Large matrix used by FGMRES, w^i+1 = A * z^i. */ - mutable std::vector Z; /*!< \brief Large matrix used by FGMRES, preconditioned W. */ + mutable std::vector W; /*!< \brief Large matrix used by FGMRES, w^i+1 = A * z^i. */ + mutable std::vector Z; /*!< \brief Large matrix used by FGMRES, preconditioned W. */ - VectorType LinSysSol_tmp; /*!< \brief Temporary used when it is necessary to interface between active and passive types. */ - VectorType LinSysRes_tmp; /*!< \brief Temporary used when it is necessary to interface between active and passive types. */ - VectorType* LinSysSol_ptr; /*!< \brief Pointer to appropriate LinSysSol (set to original or temporary in call to Solve). */ - const VectorType* LinSysRes_ptr; /*!< \brief Pointer to appropriate LinSysRes (set to original or temporary in call to Solve). */ + VectorType + LinSysSol_tmp; /*!< \brief Temporary used when it is necessary to interface between active and passive types. */ + VectorType + LinSysRes_tmp; /*!< \brief Temporary used when it is necessary to interface between active and passive types. */ + VectorType* + LinSysSol_ptr; /*!< \brief Pointer to appropriate LinSysSol (set to original or temporary in call to Solve). */ + const VectorType* + LinSysRes_ptr; /*!< \brief Pointer to appropriate LinSysRes (set to original or temporary in call to Solve). */ - LinearToleranceType tol_type = LinearToleranceType::ABSOLUTE; /*!< \brief How the linear solvers interpret the tolerance. */ - bool xIsZero = false; /*!< \brief If true assume the initial solution is always 0. */ - bool recomputeRes = false; /*!< \brief Recompute the residual after inner iterations, if monitoring. */ - unsigned long monitorFreq = 10; /*!< \brief Monitoring frequency. */ + LinearToleranceType tol_type = + LinearToleranceType::ABSOLUTE; /*!< \brief How the linear solvers interpret the tolerance. */ + bool xIsZero = false; /*!< \brief If true assume the initial solution is always 0. */ + bool recomputeRes = false; /*!< \brief Recompute the residual after inner iterations, if monitoring. */ + unsigned long monitorFreq = 10; /*!< \brief Monitoring frequency. */ /*! * \brief sign transfer function @@ -128,7 +136,7 @@ class CSysSolve { * \param[in,out] h1 - first element of 2x1 vector being transformed * \param[in,out] h2 - second element of 2x1 vector being transformed */ - void ApplyGivens(ScalarType s, ScalarType c, ScalarType & h1, ScalarType & h2) const; + void ApplyGivens(ScalarType s, ScalarType c, ScalarType& h1, ScalarType& h2) const; /*! * \brief generates the Givens rotation matrix for a given 2-vector @@ -140,7 +148,7 @@ class CSysSolve { * Based on givens() of SPARSKIT, which is based on p.202 of * "Matrix Computations" by Golub and van Loan. */ - void GenerateGivens(ScalarType & dx, ScalarType & dy, ScalarType & s, ScalarType & c) const; + void GenerateGivens(ScalarType& dx, ScalarType& dy, ScalarType& s, ScalarType& c) const; /*! * \brief finds the solution of the upper triangular system Hsbg*x = rhs @@ -153,13 +161,14 @@ class CSysSolve { * \pre the upper Hessenberg matrix has been transformed into a * triangular matrix. */ - void SolveReduced(int n, const su2matrix& Hsbg, - const su2vector& rhs, su2vector& x) const; + void SolveReduced(int n, const su2matrix& Hsbg, const su2vector& rhs, + su2vector& x) const; /*! * \brief Modified Gram-Schmidt orthogonalization * \author Based on Kesheng John Wu's mgsro subroutine in Saad's SPARSKIT * + * \param[in] shared_hsbg - if the Hessenberg matrix is shared by multiple threads * \param[in] i - index indicating which vector in w is being orthogonalized * \param[in,out] Hsbg - the upper Hessenberg begin updated * \param[in,out] w - the (i+1)th vector of w is orthogonalized against the @@ -173,7 +182,7 @@ class CSysSolve { * vector is kept in nrm0 and updated after operating with each vector * */ - void ModGramSchmidt(int i, su2matrix& Hsbg, std::vector & w) const; + void ModGramSchmidt(bool shared_hsbg, int i, su2matrix& Hsbg, std::vector& w) const; /*! * \brief writes header information for a CSysSolve residual history @@ -183,7 +192,7 @@ class CSysSolve { * * \pre the ostream object os should be open */ - void WriteHeader(std::string solver, ScalarType restol, ScalarType resinit) const; + void WriteHeader(const std::string& solver, ScalarType restol, ScalarType resinit) const; /*! * \brief writes residual convergence data for one iteration to a stream @@ -200,7 +209,7 @@ class CSysSolve { * \param[in] iter - current iteration * \param[in] res - the residual norm */ - void WriteFinalResidual(std::string solver, unsigned long iter, ScalarType res) const; + void WriteFinalResidual(const std::string& solver, unsigned long iter, ScalarType res) const; /*! * \brief writes the convergence warning @@ -216,9 +225,8 @@ class CSysSolve { * \param[in] LinSysRes - Linear system residual * \param[in,out] LinSysSol - Linear system solution */ - template::value> = 0> + template ::value> = 0> void HandleTemporariesIn(const CSysVector& LinSysRes, CSysVector& LinSysSol) { - /*--- Set the pointers. ---*/ BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS { LinSysRes_ptr = &LinSysRes; @@ -233,9 +241,8 @@ class CSysSolve { * \param[in] LinSysRes - Linear system residual * \param[in,out] LinSysSol - Linear system solution */ - template::value> = 0> + template ::value> = 0> void HandleTemporariesIn(const CSysVector& LinSysRes, CSysVector& LinSysSol) { - /*--- Copy data, the solution is also copied as it serves as initial condition. ---*/ LinSysRes_tmp.PassiveCopy(LinSysRes); LinSysSol_tmp.PassiveCopy(LinSysSol); @@ -253,9 +260,8 @@ class CSysSolve { * \note Same type specialization, temporary variables are not required. * \param[out] LinSysSol - Linear system solution */ - template::value> = 0> + template ::value> = 0> void HandleTemporariesOut(CSysVector& LinSysSol) { - /*--- Reset the pointers. ---*/ BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS { LinSysRes_ptr = nullptr; @@ -269,9 +275,8 @@ class CSysSolve { * \note Different type specialization, copy data from the temporary solution vector. * \param[out] LinSysSol - Linear system solution */ - template::value> = 0> + template ::value> = 0> void HandleTemporariesOut(CSysVector& LinSysSol) { - /*--- Copy data, only the temporary solution needs to be copied. ---*/ LinSysSol.PassiveCopy(LinSysSol_tmp); @@ -283,8 +288,7 @@ class CSysSolve { END_SU2_OMP_SAFE_GLOBAL_ACCESS } -public: - + public: /*! * \brief default constructor of the class. * \param[in] linear_solver_mode - enum, to let CSysSolve know in what context it is @@ -302,9 +306,9 @@ class CSysSolve { * \param[in] monitoring - turn on priting residuals from solver to screen. * \param[in] config - Definition of the particular problem. */ - unsigned long CG_LinSolver(const VectorType & b, VectorType & x, const ProductType & mat_vec, - const PrecondType & precond, ScalarType tol, unsigned long m, - ScalarType & residual, bool monitoring, const CConfig *config) const; + unsigned long CG_LinSolver(const VectorType& b, VectorType& x, const ProductType& mat_vec, const PrecondType& precond, + ScalarType tol, unsigned long m, ScalarType& residual, bool monitoring, + const CConfig* config) const; /*! * \brief Flexible Generalized Minimal Residual method @@ -318,16 +322,16 @@ class CSysSolve { * \param[in] monitoring - turn on priting residuals from solver to screen. * \param[in] config - Definition of the particular problem. */ - unsigned long FGMRES_LinSolver(const VectorType & b, VectorType & x, const ProductType & mat_vec, - const PrecondType & precond, ScalarType tol, unsigned long m, - ScalarType & residual, bool monitoring, const CConfig *config) const; + unsigned long FGMRES_LinSolver(const VectorType& b, VectorType& x, const ProductType& mat_vec, + const PrecondType& precond, ScalarType tol, unsigned long m, ScalarType& residual, + bool monitoring, const CConfig* config) const; /*! * \brief Flexible Generalized Minimal Residual method with restarts (frequency comes from config). */ - unsigned long RFGMRES_LinSolver(const VectorType & b, VectorType & x, const ProductType & mat_vec, - const PrecondType & precond, ScalarType tol, unsigned long m, - ScalarType & residual, bool monitoring, const CConfig *config); + unsigned long RFGMRES_LinSolver(const VectorType& b, VectorType& x, const ProductType& mat_vec, + const PrecondType& precond, ScalarType tol, unsigned long m, ScalarType& residual, + bool monitoring, const CConfig* config); /*! * \brief Biconjugate Gradient Stabilized Method (BCGSTAB) @@ -341,9 +345,9 @@ class CSysSolve { * \param[in] monitoring - turn on priting residuals from solver to screen. * \param[in] config - Definition of the particular problem. */ - unsigned long BCGSTAB_LinSolver(const VectorType & b, VectorType & x, const ProductType & mat_vec, - const PrecondType & precond, ScalarType tol, unsigned long m, - ScalarType & residual, bool monitoring, const CConfig *config) const; + unsigned long BCGSTAB_LinSolver(const VectorType& b, VectorType& x, const ProductType& mat_vec, + const PrecondType& precond, ScalarType tol, unsigned long m, ScalarType& residual, + bool monitoring, const CConfig* config) const; /*! * \brief Generic smoother (modified Richardson iteration with preconditioner) @@ -357,9 +361,9 @@ class CSysSolve { * \param[in] monitoring - turn on priting residuals from solver to screen. * \param[in] config - Definition of the particular problem. */ - unsigned long Smoother_LinSolver(const VectorType & b, VectorType & x, const ProductType & mat_vec, - const PrecondType & precond, ScalarType tol, unsigned long m, - ScalarType & residual, bool monitoring, const CConfig *config) const; + unsigned long Smoother_LinSolver(const VectorType& b, VectorType& x, const ProductType& mat_vec, + const PrecondType& precond, ScalarType tol, unsigned long m, ScalarType& residual, + bool monitoring, const CConfig* config) const; /*! * \brief Solve the linear system using a Krylov subspace method @@ -369,8 +373,8 @@ class CSysSolve { * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - unsigned long Solve(MatrixType & Jacobian, const CSysVector & LinSysRes, CSysVector & LinSysSol, - CGeometry *geometry, const CConfig *config); + unsigned long Solve(MatrixType& Jacobian, const CSysVector& LinSysRes, CSysVector& LinSysSol, + CGeometry* geometry, const CConfig* config); /*! * \brief Solve the adjoint linear system using a Krylov subspace method @@ -381,8 +385,8 @@ class CSysSolve { * \param[in] config - Definition of the particular problem. * \param[in] directCall - If this method is called directly, or in AD context. */ - unsigned long Solve_b(MatrixType & Jacobian, const CSysVector & LinSysRes, CSysVector & LinSysSol, - CGeometry *geometry, const CConfig *config, const bool directCall = true); + unsigned long Solve_b(MatrixType& Jacobian, const CSysVector& LinSysRes, CSysVector& LinSysSol, + CGeometry* geometry, const CConfig* config, const bool directCall = true); /*! * \brief Get the number of iterations. @@ -399,21 +403,20 @@ class CSysSolve { /*! * \brief Set the type of the tolerance for stoping the linear solvers (RELATIVE or ABSOLUTE). */ - inline void SetToleranceType(LinearToleranceType type) {tol_type = type;} + inline void SetToleranceType(LinearToleranceType type) { tol_type = type; } /*! * \brief Assume the initial solution is 0 to save one product, or don't. */ - inline void SetxIsZero(bool isZero) {xIsZero = isZero;} + inline void SetxIsZero(bool isZero) { xIsZero = isZero; } /*! * \brief Set whether to recompute residuals at the end (while monitoring only). */ - inline void SetRecomputeResidual(bool recompRes) {recomputeRes = recompRes;} + inline void SetRecomputeResidual(bool recompRes) { recomputeRes = recompRes; } /*! * \brief Set the screen output frequency during monitoring. */ - inline void SetMonitoringFrequency(bool frequency) {monitorFreq = frequency;} - + inline void SetMonitoringFrequency(bool frequency) { monitorFreq = frequency; } }; diff --git a/Common/include/linear_algebra/CSysSolve_b.hpp b/Common/include/linear_algebra/CSysSolve_b.hpp index 47e235f49ce..4abbf8c1ab2 100644 --- a/Common/include/linear_algebra/CSysSolve_b.hpp +++ b/Common/include/linear_algebra/CSysSolve_b.hpp @@ -2,7 +2,7 @@ * \file CSysSolve_b.hpp * \brief Routines for the linear solver used in the reverse sweep of AD. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -30,10 +30,9 @@ #include "../basic_types/datatype_structure.hpp" #ifdef CODI_REVERSE_TYPE -template +template struct CSysSolve_b { - static void Solve_b(const su2double::Real* x, su2double::Real* x_b, size_t m, - const su2double::Real* y, const su2double::Real* y_b, size_t n, - codi::DataStore* d); + static void Solve_b(const su2double::Real* x, su2double::Real* x_b, size_t m, const su2double::Real* y, + const su2double::Real* y_b, size_t n, codi::ExternalFunctionUserData* d); }; #endif diff --git a/Common/include/linear_algebra/CSysVector.hpp b/Common/include/linear_algebra/CSysVector.hpp index ea6755adeae..412f11c4427 100644 --- a/Common/include/linear_algebra/CSysVector.hpp +++ b/Common/include/linear_algebra/CSysVector.hpp @@ -3,7 +3,7 @@ * \brief Declararion and inlines of the vector class used in the * solution of large, distributed, sparse linear systems. * \author P. Gomes, F. Palacios, J. Hicken, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -45,9 +45,9 @@ */ #ifdef HAVE_OMP #ifdef HAVE_OMP_SIMD -#define CSYSVEC_PARFOR SU2_OMP_FOR_(simd schedule(static,omp_chunk_size) SU2_NOWAIT) +#define CSYSVEC_PARFOR SU2_OMP_FOR_(simd schedule(static, omp_chunk_size) SU2_NOWAIT) #else -#define CSYSVEC_PARFOR SU2_OMP_FOR_(schedule(static,omp_chunk_size) SU2_NOWAIT) +#define CSYSVEC_PARFOR SU2_OMP_FOR_(schedule(static, omp_chunk_size) SU2_NOWAIT) #endif #define END_CSYSVEC_PARFOR END_SU2_OMP_FOR #else @@ -67,9 +67,9 @@ class CSysVector : public VecExpr::CVecExpr, ScalarType> unsigned long omp_chunk_size = OMP_MAX_SIZE; /*!< \brief Static chunk size used in loops. */ ScalarType* vec_val = nullptr; /*!< \brief Storage, 64 byte aligned (do not use normal new/delete). */ - unsigned long nElm = 0; /*!< \brief Total number of elements (or number elements on this processor). */ - unsigned long nElmDomain = 0; /*!< \brief Total number of elements without Ghost cells. */ - unsigned long nVar = 1; /*!< \brief Number of elements in a block. */ + unsigned long nElm = 0; /*!< \brief Total number of elements (or number elements on this processor). */ + unsigned long nElmDomain = 0; /*!< \brief Total number of elements without Ghost cells. */ + unsigned long nVar = 1; /*!< \brief Number of elements in a block. */ /*! * \brief Generic initialization from a scalar or array. @@ -187,7 +187,8 @@ class CSysVector : public VecExpr::CVecExpr, ScalarType> /*--- check if self-assignment, otherwise perform deep copy ---*/ if ((const void*)this == (const void*)&other) return; - SU2_OMP_SAFE_GLOBAL_ACCESS(Initialize(other.GetNBlk(), other.GetNBlkDomain(), other.GetNVar(), nullptr, true, false);) + SU2_OMP_SAFE_GLOBAL_ACCESS( + Initialize(other.GetNBlk(), other.GetNBlkDomain(), other.GetNVar(), nullptr, true, false);) CSYSVEC_PARFOR for (auto i = 0ul; i < nElm; i++) vec_val[i] = SU2_TYPE::GetValue(other[i]); diff --git a/Common/include/linear_algebra/blas_structure.hpp b/Common/include/linear_algebra/blas_structure.hpp index 48358bc2ee2..6e53f304767 100644 --- a/Common/include/linear_algebra/blas_structure.hpp +++ b/Common/include/linear_algebra/blas_structure.hpp @@ -4,7 +4,7 @@ operations, which are typically found in the BLAS libraries. The functions are in the blass_structure.cpp file. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -41,10 +41,10 @@ class CConfig; * \ingroup BLAS * \brief Class, which serves as an interface to the BLAS functionalities needed. * \author: E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CBlasStructure { -public: + public: /*! * \brief Constructor of the class. Initialize the constant member variables. */ @@ -60,9 +60,8 @@ class CBlasStructure { * \param[in] B - Input matrix in the multiplication. * \param[out] C - Result of the matrix product A*B. */ - void gemm(const int M, const int N, const int K, - const su2double *A, const su2double *B, su2double *C, - const CConfig *config); + void gemm(const int M, const int N, const int K, const su2double* A, const su2double* B, su2double* C, + const CConfig* config); /*! * \brief Function, which carries out a dense matrix vector product @@ -73,8 +72,7 @@ class CBlasStructure { * \param[in] x - Input vector in the multiplication. * \param[out] y - Result of the product A x. */ - void gemv(const int M, const int N, const su2double *A, - const su2double *x, su2double *y); + void gemv(const int M, const int N, const su2double* A, const su2double* x, su2double* y); /*! * \brief Function, to carry out the axpy operation, i.e y += a*x. @@ -87,55 +85,53 @@ class CBlasStructure { at least 1 + (n-1)*abs(incy). * param[in] incy - Specifies the increment of y. */ - void axpy(const int n, const su2double a, const su2double *x, - const int incx, su2double *y, const int incy); + void axpy(const int n, const su2double a, const su2double* x, const int incx, su2double* y, const int incy); /*! * \brief Invert a square matrix. * \param[in] M - Size. * \param[in,out] mat - Matrix, and inverse on exit. */ - template + template static void inverse(const int M, Mat& mat) { using Scalar = typename Mat::Scalar; /*--- Copy the data from A into the augmented matrix and initialize mat with the identity. ---*/ Mat aug = mat; mat = Scalar(0); - for(int j=0; j valMax){ + Scalar valMax = fabs(aug(j, j)); + for (int i = j + 1; i < M; ++i) { + Scalar val = fabs(aug(i, j)); + if (val > valMax) { jj = i; valMax = val; } } /*--- Swap the rows j and jj, if needed. ---*/ - if(jj > j) { - for(int k=j; k j) { + for (int k = j; k < M; ++k) std::swap(aug(j, k), aug(jj, k)); + for (int k = 0; k < M; ++k) std::swap(mat(j, k), mat(jj, k)); } /*--- Performing row operations to form required identity matrix out of the input matrix. ---*/ - for(int i=0; i + template static void tred2(Mat& V, Vec& d, W& e, int n) { using Scalar = typename std::decay::type; - int i,j,k; + int i, j, k; for (j = 0; j < n; j++) { - d[j] = V[n-1][j]; + d[j] = V[n - 1][j]; } /* Householder reduction to tridiagonal form. */ - for (i = n-1; i > 0; i--) { - + for (i = n - 1; i > 0; i--) { /* Scale to avoid under/overflow. */ Scalar scale = 0.0; @@ -196,29 +191,27 @@ class CBlasStructure { scale = scale + fabs(d[k]); } if (scale == 0.0) { - e[i] = d[i-1]; + e[i] = d[i - 1]; for (j = 0; j < i; j++) { - d[j] = V[i-1][j]; + d[j] = V[i - 1][j]; V[i][j] = 0.0; V[j][i] = 0.0; } - } - else { - + } else { /* Generate Householder vector. */ for (k = 0; k < i; k++) { d[k] /= scale; h += d[k] * d[k]; } - Scalar f = d[i-1]; + Scalar f = d[i - 1]; Scalar g = sqrt(h); if (f > 0) { g = -g; } e[i] = scale * g; h = h - f * g; - d[i-1] = f - g; + d[i - 1] = f - g; for (j = 0; j < i; j++) { e[j] = 0.0; } @@ -229,7 +222,7 @@ class CBlasStructure { f = d[j]; V[j][i] = f; g = e[j] + V[j][j] * f; - for (k = j+1; k <= i-1; k++) { + for (k = j + 1; k <= i - 1; k++) { g += V[k][j] * d[k]; e[k] += V[k][j] * f; } @@ -247,10 +240,10 @@ class CBlasStructure { for (j = 0; j < i; j++) { f = d[j]; g = e[j]; - for (k = j; k <= i-1; k++) { - V[k][j] -= (f * e[k] + g * d[k]); + for (k = j; k <= i - 1; k++) { + V[k][j] -= (f * e[k] + g * d[k]); } - d[j] = V[i-1][j]; + d[j] = V[i - 1][j]; V[i][j] = 0.0; } } @@ -259,18 +252,18 @@ class CBlasStructure { /* Accumulate transformations. */ - for (i = 0; i < n-1; i++) { - V[n-1][i] = V[i][i]; + for (i = 0; i < n - 1; i++) { + V[n - 1][i] = V[i][i]; V[i][i] = 1.0; - Scalar h = d[i+1]; + Scalar h = d[i + 1]; if (h != 0.0) { for (k = 0; k <= i; k++) { - d[k] = V[k][i+1] / h; + d[k] = V[k][i + 1] / h; } for (j = 0; j <= i; j++) { Scalar g = 0.0; for (k = 0; k <= i; k++) { - g += V[k][i+1] * V[k][j]; + g += V[k][i + 1] * V[k][j]; } for (k = 0; k <= i; k++) { V[k][j] -= g * d[k]; @@ -278,14 +271,14 @@ class CBlasStructure { } } for (k = 0; k <= i; k++) { - V[k][i+1] = 0.0; + V[k][i + 1] = 0.0; } } for (j = 0; j < n; j++) { - d[j] = V[n-1][j]; - V[n-1][j] = 0.0; + d[j] = V[n - 1][j]; + V[n - 1][j] = 0.0; } - V[n-1][n-1] = 1.0; + V[n - 1][n - 1] = 1.0; e[0] = 0.0; } @@ -324,27 +317,26 @@ class CBlasStructure { * \param[in,out] e: work vector * \param[in] n: order of matrix V */ - template + template static void tql2(Mat& V, Vec& d, W& e, int n) { using Scalar = typename std::decay::type; - int i,j,k,l; + int i, j, k, l; for (i = 1; i < n; i++) { - e[i-1] = e[i]; + e[i - 1] = e[i]; } - e[n-1] = 0.0; + e[n - 1] = 0.0; Scalar f = 0.0; Scalar tst1 = 0.0; - Scalar eps = pow(2.0,-52.0); + Scalar eps = pow(2.0, -52.0); for (l = 0; l < n; l++) { - /* Find small subdiagonal element */ - tst1 = max(tst1,(fabs(d[l]) + fabs(e[l]))); + tst1 = max(tst1, (fabs(d[l]) + fabs(e[l]))); int m = l; while (m < n) { - if (fabs(e[m]) <= eps*tst1) { + if (fabs(e[m]) <= eps * tst1) { break; } m++; @@ -356,21 +348,21 @@ class CBlasStructure { if (m > l) { int iter = 0; do { - iter = iter + 1; /* (Could check iteration count here.) */ + iter = iter + 1; /* (Could check iteration count here.) */ /* Compute implicit shift */ Scalar g = d[l]; - Scalar p = (d[l+1] - g) / (2.0 * e[l]); - Scalar r = sqrt(p*p+1.0); + Scalar p = (d[l + 1] - g) / (2.0 * e[l]); + Scalar r = sqrt(p * p + 1.0); if (p < 0) { r = -r; } d[l] = e[l] / (p + r); - d[l+1] = e[l] * (p + r); - Scalar dl1 = d[l+1]; + d[l + 1] = e[l] * (p + r); + Scalar dl1 = d[l + 1]; Scalar h = g - d[l]; - for (i = l+2; i < n; i++) { + for (i = l + 2; i < n; i++) { d[i] -= h; } f = f + h; @@ -381,27 +373,27 @@ class CBlasStructure { Scalar c = 1.0; Scalar c2 = c; Scalar c3 = c; - Scalar el1 = e[l+1]; + Scalar el1 = e[l + 1]; Scalar s = 0.0; Scalar s2 = 0.0; - for (i = m-1; i >= l; i--) { + for (i = m - 1; i >= l; i--) { c3 = c2; c2 = c; s2 = s; g = c * e[i]; h = c * p; - r = sqrt(p*p+e[i]*e[i]); - e[i+1] = s * r; + r = sqrt(p * p + e[i] * e[i]); + e[i + 1] = s * r; s = e[i] / r; c = p / r; p = c * d[i] - s * g; - d[i+1] = h + s * (c * g + s * d[i]); + d[i + 1] = h + s * (c * g + s * d[i]); /* Accumulate transformation. */ for (k = 0; k < n; k++) { - h = V[k][i+1]; - V[k][i+1] = s * V[k][i] + c * h; + h = V[k][i + 1]; + V[k][i + 1] = s * V[k][i] + c * h; V[k][i] = c * V[k][i] - s * h; } } @@ -411,7 +403,7 @@ class CBlasStructure { /* Check for convergence. */ - } while (fabs(e[l]) > eps*tst1); + } while (fabs(e[l]) > eps * tst1); } d[l] = d[l] + f; e[l] = 0.0; @@ -419,10 +411,10 @@ class CBlasStructure { /* Sort eigenvalues and corresponding vectors. */ - for (i = 0; i < n-1; i++) { + for (i = 0; i < n - 1; i++) { k = i; Scalar p = d[i]; - for (j = i+1; j < n; j++) { + for (j = i + 1; j < n; j++) { if (d[j] < p) { k = j; p = d[j]; @@ -448,11 +440,11 @@ class CBlasStructure { * \param[in] n: order of matrix A_ij * \param[in,out] e: work vector */ - template + template static void EigenDecomposition(const Mat& A_ij, Mat& Eig_Vec, Vec& Eig_Val, int n, W& e) { - for (int iDim = 0; iDim < n; iDim++){ + for (int iDim = 0; iDim < n; iDim++) { e[iDim] = 0.0; - for (int jDim = 0; jDim < n; jDim++){ + for (int jDim = 0; jDim < n; jDim++) { Eig_Vec[iDim][jDim] = A_ij[iDim][jDim]; } } @@ -467,13 +459,12 @@ class CBlasStructure { * \param[in] Eig_Val: eigenvalues * \param[in] n: order of matrix A_ij */ - template + template static void EigenRecomposition(Mat& A_ij, const Mat& Eig_Vec, const Vec& Eig_Val, int n) { - for (int i = 0; i < n; i++){ - for (int j = 0; j < n; j++){ + for (int i = 0; i < n; i++) { + for (int j = 0; j < n; j++) { A_ij[i][j] = 0.0; - for (int k = 0; k < n; k++) - A_ij[i][j] += Eig_Vec[i][k] * Eig_Val[k] * Eig_Vec[j][k]; + for (int k = 0; k < n; k++) A_ij[i][j] += Eig_Vec[i][k] * Eig_Val[k] * Eig_Vec[j][k]; } } } @@ -486,29 +477,28 @@ class CBlasStructure { * \param[in,out] rhs - right hand side on entry, solution on exit * \note Same size for all vectors. Use row index for lower and upper vector (e.g. lower[0] does not matter). */ - template + template static void tdma(const Vec& lower, const Vec& main, Vec& upper, Vec& rhs) { const int N = main.size(); upper[0] /= main[0]; rhs[0] /= main[0]; - for (int i=1; i=0; i--) - rhs[i] -= upper[i]*rhs[i+1]; + for (int i = N - 2; i >= 0; i--) rhs[i] -= upper[i] * rhs[i + 1]; } -private: - -#if !(defined(HAVE_LIBXSMM) || defined(HAVE_BLAS) || defined(HAVE_MKL)) || (defined(CODI_REVERSE_TYPE) || defined(CODI_FORWARD_TYPE)) - /* Blocking parameters for the outer kernel. We multiply mc x kc blocks of - the matrix A with kc x nc panels of the matrix B (this approach is referred - to as `gebp` in the literature). */ + private: +#if !(defined(HAVE_LIBXSMM) || defined(HAVE_BLAS) || defined(HAVE_MKL)) || \ + (defined(CODI_REVERSE_TYPE) || defined(CODI_FORWARD_TYPE)) + /* Blocking parameters for the outer kernel. We multiply mc x kc blocks of + the matrix A with kc x nc panels of the matrix B (this approach is referred + to as `gebp` in the literature). */ const int mc; const int kc; const int nc; @@ -522,8 +512,7 @@ class CBlasStructure { * \param[in] b - Input matrix in the multiplication. * \param[out] c - Result of the matrix product a*b. */ - void gemm_imp(const int m, const int n, const int k, - const su2double *a, const su2double *b, su2double *c); + void gemm_imp(const int m, const int n, const int k, const su2double* a, const su2double* b, su2double* c); /*! * \brief Compute a portion of the c matrix one block at a time. @@ -538,8 +527,7 @@ class CBlasStructure { * \param[out] c - Result of the matrix product a*b. * \param[in] ldc - Leading dimension of the matrix c. */ - void gemm_inner(int m, int n, int k, const su2double *a, int lda, - const su2double *b, int ldb, su2double *c, int ldc); + void gemm_inner(int m, int n, int k, const su2double* a, int lda, const su2double* b, int ldb, su2double* c, int ldc); /*! * \brief Naive gemm implementation to handle arbitrary sized matrices. @@ -553,7 +541,7 @@ class CBlasStructure { * \param[out] c - Result of the matrix product a*b. * \param[in] ldc - Leading dimension of the matrix c. */ - void gemm_arbitrary(int m, int n, int k, const su2double *a, int lda, - const su2double *b, int ldb, su2double *c, int ldc); + void gemm_arbitrary(int m, int n, int k, const su2double* a, int lda, const su2double* b, int ldb, su2double* c, + int ldc); #endif }; diff --git a/Common/include/linear_algebra/vector_expressions.hpp b/Common/include/linear_algebra/vector_expressions.hpp index 6164d019982..5f0aa103547 100644 --- a/Common/include/linear_algebra/vector_expressions.hpp +++ b/Common/include/linear_algebra/vector_expressions.hpp @@ -2,7 +2,7 @@ * \file vector_expressions.hpp * \brief Expression templates for vector types with coefficient-wise operations. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -53,9 +53,9 @@ namespace VecExpr { * Vector classes should be stored by reference to avoid copies, especially if they * allocate memory dynamically. */ -template +template class CVecExpr { -public: + public: /*! * \brief Cast the expression to Derived, usually to allow evaluation via operator[]. */ @@ -63,35 +63,45 @@ class CVecExpr { // Allowed from C++14, allows nested expression propagation without // manually calling derived() on the expression being evaluated. - //FORCEINLINE auto operator[] (size_t i) const { return derived()[i]; } + // FORCEINLINE auto operator[] (size_t i) const { return derived()[i]; } }; /*! * \brief Expression class to broadcast a scalar value. Allows implementing * "vector-scalar" operations re-using "vector-vector" expressions. */ -template +template class Bcast : public CVecExpr, Scalar> { Scalar x; -public: + + public: static constexpr bool StoreAsRef = false; FORCEINLINE Bcast(const Scalar& x_) : x(x_) {} - FORCEINLINE const Scalar& operator[] (size_t) const { return x; } + FORCEINLINE const Scalar& operator[](size_t) const { return x; } }; /*! * \brief std::decay_t from C++14, used to allow implicit conversions * between scalar types, e.g. "CVecExpr" + "int/double/etc.". */ -template using decay_t = typename std::decay::type; +template +using decay_t = typename std::decay::type; /*! \brief std::remove_reference_t from C++14, removes references from some type. */ -template using remove_reference_t = typename std::remove_reference::type; +template +using remove_reference_t = typename std::remove_reference::type; /*! \brief Mechanism to conditionally (based on "StoreAsRef") add lvalue reference to a type. */ -template struct add_lref_if { using type = remove_reference_t; }; -template struct add_lref_if { using type = remove_reference_t &; }; -template using store_t = typename add_lref_if::type; +template +struct add_lref_if { + using type = remove_reference_t; +}; +template +struct add_lref_if { + using type = remove_reference_t&; +}; +template +using store_t = typename add_lref_if::type; /*--- Namespace from which the math function implementations come. ---*/ @@ -104,26 +114,28 @@ namespace math = ::std; /*--- Macro to simplify auto return type deduction in C++11, operator[] needs * it to allow inner expressions to propagate as the outer is evaluated. ---*/ -#define RETURNS(...) ->decltype(__VA_ARGS__) { return __VA_ARGS__; } +#define RETURNS(...) \ + ->decltype(__VA_ARGS__) { return __VA_ARGS__; } /*--- Macro to create expression classes (EXPR) and overloads (FUN) for unary * functions, based on their coefficient-wise implementation (IMPL). ---*/ -#define MAKE_UNARY_FUN(FUN, EXPR, IMPL) \ -/*!--- Expression class. ---*/ \ -template \ -class EXPR : public CVecExpr, Scalar> { \ - store_t u; \ -public: \ - static constexpr bool StoreAsRef = false; \ - FORCEINLINE EXPR(const U& u_) : u(u_) {} \ - FORCEINLINE auto operator[] (size_t i) const RETURNS( IMPL(u[i]) ) \ -}; \ -/*!--- Function overload, returns an expression object. ---*/ \ -template \ -FORCEINLINE auto FUN(const CVecExpr& u) RETURNS( EXPR(u.derived()) ) - -#define sign_impl(x) Scalar(1-2*(x<0)) +#define MAKE_UNARY_FUN(FUN, EXPR, IMPL) \ + /*!--- Expression class. ---*/ \ + template \ + class EXPR : public CVecExpr, Scalar> { \ + store_t u; \ + \ + public: \ + static constexpr bool StoreAsRef = false; \ + FORCEINLINE EXPR(const U& u_) : u(u_) {} \ + FORCEINLINE auto operator[](size_t i) const RETURNS(IMPL(u[i])) \ + }; \ + /*!--- Function overload, returns an expression object. ---*/ \ + template \ + FORCEINLINE auto FUN(const CVecExpr& u) RETURNS(EXPR(u.derived())) + +#define sign_impl(x) Scalar(1 - 2 * (x < 0)) MAKE_UNARY_FUN(operator-, minus_, -) MAKE_UNARY_FUN(abs, abs_, math::abs) MAKE_UNARY_FUN(sqrt, sqrt_, math::sqrt) @@ -134,32 +146,30 @@ MAKE_UNARY_FUN(sign, sign_, sign_impl) /*--- Macro to create expressions and overloads for binary functions. ---*/ -#define MAKE_BINARY_FUN(FUN, EXPR, IMPL) \ -/*!--- Expression class. ---*/ \ -template \ -class EXPR : public CVecExpr, Scalar> { \ - store_t u; \ - store_t v; \ -public: \ - static constexpr bool StoreAsRef = false; \ - FORCEINLINE EXPR(const U& u_, const V& v_) : u(u_), v(v_) {} \ - FORCEINLINE auto operator[] (size_t i) const RETURNS( IMPL(u[i], v[i]) ) \ -}; \ -/*!--- Vector with vector function overload. ---*/ \ -template \ -FORCEINLINE auto FUN(const CVecExpr& u, const CVecExpr& v) \ - RETURNS( EXPR(u.derived(), v.derived()) \ -) \ -/*!--- Vector with scalar function overload. ---*/ \ -template \ -FORCEINLINE auto FUN(const CVecExpr& u, decay_t v) \ - RETURNS( EXPR,S>(u.derived(), Bcast(v)) \ -) \ -/*!--- Scalar with vector function overload. ---*/ \ -template \ -FORCEINLINE auto FUN(decay_t u, const CVecExpr& v) \ - RETURNS( EXPR,V,S>(Bcast(u), v.derived()) \ -) \ +// clang-format off +#define MAKE_BINARY_FUN(FUN, EXPR, IMPL) \ + /*!--- Expression class. ---*/ \ + template \ + class EXPR : public CVecExpr, Scalar> { \ + store_t u; \ + store_t v; \ + \ + public: \ + static constexpr bool StoreAsRef = false; \ + FORCEINLINE EXPR(const U& u_, const V& v_) : u(u_), v(v_) {} \ + FORCEINLINE auto operator[](size_t i) const RETURNS(IMPL(u[i], v[i])) \ + }; \ + /*!--- Vector with vector function overload. ---*/ \ + template \ + FORCEINLINE auto FUN(const CVecExpr& u, const CVecExpr& v) \ + RETURNS(EXPR(u.derived(), v.derived())) \ + /*!--- Vector with scalar function overload. ---*/ \ + template \ + FORCEINLINE auto FUN(const CVecExpr& u, decay_t v) RETURNS(EXPR, S>(u.derived(), Bcast(v))) \ + /*!--- Scalar with vector function overload. ---*/ \ + template \ + FORCEINLINE auto FUN(decay_t u, const CVecExpr& v) RETURNS(EXPR, V, S>(Bcast(u), v.derived())) +// clang-format on /*--- std::max/min have issues (because they return by reference). * fmin and fmax return by value and thus are fine, but they would force @@ -167,9 +177,9 @@ FORCEINLINE auto FUN(decay_t u, const CVecExpr& v) \ * We use int32/64 instead of int/long to avoid issues with Windows, * where long is 32 bits (instead of 64 bits). ---*/ -#define MAKE_FMINMAX_OVERLOADS(TYPE) \ -FORCEINLINE TYPE fmax(TYPE a, TYPE b) { return a::Value(IMPL) -#define le_impl(a,b) TO_PASSIVE(a<=b) -#define ge_impl(a,b) TO_PASSIVE(a>=b) -#define eq_impl(a,b) TO_PASSIVE(a==b) -#define ne_impl(a,b) TO_PASSIVE(a!=b) -#define lt_impl(a,b) TO_PASSIVE(ab) +#define le_impl(a, b) TO_PASSIVE(a <= b) +#define ge_impl(a, b) TO_PASSIVE(a >= b) +#define eq_impl(a, b) TO_PASSIVE(a == b) +#define ne_impl(a, b) TO_PASSIVE(a != b) +#define lt_impl(a, b) TO_PASSIVE(a < b) +#define gt_impl(a, b) TO_PASSIVE(a > b) MAKE_BINARY_FUN(operator<=, le_, le_impl) MAKE_BINARY_FUN(operator>=, ge_, ge_impl) MAKE_BINARY_FUN(operator==, eq_, eq_impl) @@ -230,4 +240,4 @@ MAKE_BINARY_FUN(operator>, gt_, gt_impl) #undef MAKE_BINARY_FUN /// @} -} // end namespace +} // namespace VecExpr diff --git a/Common/include/option_structure.hpp b/Common/include/option_structure.hpp index 72347466647..c8181a3a13f 100644 --- a/Common/include/option_structure.hpp +++ b/Common/include/option_structure.hpp @@ -2,7 +2,7 @@ * \file option_structure.hpp * \brief Defines classes for referencing options for easy input in CConfig * \author J. Hicken, B. Tracey - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -74,7 +74,7 @@ const unsigned int EXIT_DIVERGENCE = 2; /*!< \brief Exit code (divergence). */ const unsigned int MAX_PARAMETERS = 10; /*!< \brief Maximum number of parameters for a design variable definition. */ const unsigned int MAX_NUMBER_PERIODIC = 10; /*!< \brief Maximum number of periodic boundary conditions. */ -const unsigned int MAX_STRING_SIZE = 200; /*!< \brief Maximum number of domains. */ +const unsigned int MAX_STRING_SIZE = 400; /*!< \brief Maximum size of a generic string. */ const unsigned int MAX_NUMBER_FFD = 15; /*!< \brief Maximum number of FFDBoxes for the FFD. */ enum: unsigned int{MAX_SOLS = 13}; /*!< \brief Maximum number of solutions at the same time (dimension of solution container array). */ const unsigned int MAX_TERMS = 7; /*!< \brief Maximum number of terms in the numerical equations (dimension of solver container array). */ @@ -94,6 +94,7 @@ const su2double STANDARD_GRAVITY = 9.80665; /*!< \brief Acceleration d const su2double UNIVERSAL_GAS_CONSTANT = 8.3144598; /*!< \brief Universal gas constant in J/(mol*K) */ const su2double BOLTZMANN_CONSTANT = 1.3806503E-23; /*!< \brief Boltzmann's constant [J K^-1] */ const su2double AVOGAD_CONSTANT = 6.0221415E26; /*!< \brief Avogadro's constant, number of particles in one kmole. */ +const su2double FUND_ELEC_CHARGE_CGS = 4.8032047E-10; /*!< \brief Fundamental electric charge in CGS units, cm^(3/2) g^(1/2) s^(-1). */ const su2double EPS = 1.0E-16; /*!< \brief Error scale. */ const su2double TURB_EPS = 1.0E-16; /*!< \brief Turbulent Error scale. */ @@ -471,28 +472,24 @@ enum RUNTIME_TYPE { RUNTIME_ADJSPECIES_SYS = 26,/*!< \brief One-physics case, the code is solving the adjoint species model. */ }; -const int FLOW_SOL = 0; /*!< \brief Position of the mean flow solution in the solver container array. */ -const int ADJFLOW_SOL = 1; /*!< \brief Position of the continuous adjoint flow solution in the solver container array. */ - -const int TURB_SOL = 2; /*!< \brief Position of the turbulence model solution in the solver container array. */ -const int ADJTURB_SOL = 3; /*!< \brief Position of the continuous adjoint turbulence solution in the solver container array. */ - -const int TRANS_SOL = 4; /*!< \brief Position of the transition model solution in the solver container array. */ -const int HEAT_SOL = 5; /*!< \brief Position of the heat equation in the solution solver array. */ -const int ADJHEAT_SOL = 6; /*!< \brief Position of the adjoint heat equation in the solution solver array. */ -const int RAD_SOL = 7; /*!< \brief Position of the radiation equation in the solution solver array. */ -const int ADJRAD_SOL = 8; /*!< \brief Position of the continuous adjoint turbulence solution in the solver container array. */ - -const int MESH_SOL = 9; /*!< \brief Position of the mesh solver. */ -const int ADJMESH_SOL = 10; /*!< \brief Position of the adjoint of the mesh solver. */ - -const int SPECIES_SOL = 11; /*!< \brief Position of the species solver. */ -const int ADJSPECIES_SOL = 12; /*!< \brief Position of the adjoint of the species solver. */ - -const int FEA_SOL = 0; /*!< \brief Position of the FEA equation in the solution solver array. */ -const int ADJFEA_SOL = 1; /*!< \brief Position of the FEA adjoint equation in the solution solver array. */ - -const int TEMPLATE_SOL = 0; /*!< \brief Position of the template solution. */ + enum SOLVER_TYPE : const int { + FLOW_SOL=0, /*!< \brief Position of the mean flow solution in the solver container array. */ + ADJFLOW_SOL=1, /*!< \brief Position of the continuous adjoint flow solution in the solver container array. */ + TURB_SOL=2, /*!< \brief Position of the turbulence model solution in the solver container array. */ + ADJTURB_SOL=3, /*!< \brief Position of the continuous adjoint turbulence solution in the solver container array. */ + TRANS_SOL=4, /*!< \brief Position of the transition model solution in the solver container array. */ + HEAT_SOL=5, /*!< \brief Position of the heat equation in the solution solver array. */ + ADJHEAT_SOL=6, /*!< \brief Position of the adjoint heat equation in the solution solver array. */ + RAD_SOL=7, /*!< \brief Position of the radiation equation in the solution solver array. */ + ADJRAD_SOL=8, /*!< \brief Position of the continuous adjoint turbulence solution in the solver container array. */ + MESH_SOL=9, /*!< \brief Position of the mesh solver. */ + ADJMESH_SOL=10, /*!< \brief Position of the adjoint of the mesh solver. */ + SPECIES_SOL=11, /*!< \brief Position of the species solver. */ + ADJSPECIES_SOL=12, /*!< \brief Position of the adjoint of the species solver. */ + FEA_SOL=0, /*!< \brief Position of the Finite Element flow solution in the solver container array. */ + ADJFEA_SOL=1, /*!< \brief Position of the continuous adjoint Finite Element flow solution in the solver container array. */ + TEMPLATE_SOL=0, /*!< \brief Position of the template solution. */ + }; const int CONV_TERM = 0; /*!< \brief Position of the convective terms in the numerics container array. */ const int VISC_TERM = 1; /*!< \brief Position of the viscous terms in the numerics container array. */ @@ -550,6 +547,8 @@ enum ENUM_FLUIDMODEL { SU2_NONEQ = 8, /*!< \brief User defined gas model for nonequilibrium flow. */ FLUID_MIXTURE = 9, /*!< \brief Species mixture model. */ COOLPROP = 10, /*!< \brief Thermodynamics library. */ + FLUID_FLAMELET = 11, /*!< \brief lookup table (LUT) method for premixed flamelets. */ + DATADRIVEN_FLUID = 12, /*!< \brief multi-layer perceptron driven fluid model. */ }; static const MapType FluidModel_Map = { MakePair("STANDARD_AIR", STANDARD_AIR) @@ -563,6 +562,8 @@ static const MapType FluidModel_Map = { MakePair("SU2_NONEQ", SU2_NONEQ) MakePair("FLUID_MIXTURE", FLUID_MIXTURE) MakePair("COOLPROP", COOLPROP) + MakePair("DATADRIVEN_FLUID", DATADRIVEN_FLUID) + MakePair("FLUID_FLAMELET", FLUID_FLAMELET) }; /*! @@ -591,6 +592,19 @@ MakePair("ARGON-SID",ARGON_SID) MakePair("ONESPECIES", ONESPECIES) }; +/*! +* \brief Types of interpolation methods for data-driven fluid models. +*/ +enum class ENUM_DATADRIVEN_METHOD { + LUT = 0, + MLP = 1 +}; + +static const MapType DataDrivenMethod_Map = { + MakePair("LUT", ENUM_DATADRIVEN_METHOD::LUT) + MakePair("MLP", ENUM_DATADRIVEN_METHOD::MLP) +}; + /*! * \brief types of coefficient transport model */ @@ -614,11 +628,13 @@ enum class INC_DENSITYMODEL { CONSTANT, /*!< \brief Constant density. */ BOUSSINESQ, /*!< \brief Boussinesq density model. */ VARIABLE, /*!< \brief Variable density model. */ + FLAMELET, /*!< \brief Density according to flamelet manifold. */ }; static const MapType DensityModel_Map = { MakePair("CONSTANT", INC_DENSITYMODEL::CONSTANT) MakePair("BOUSSINESQ", INC_DENSITYMODEL::BOUSSINESQ) MakePair("VARIABLE", INC_DENSITYMODEL::VARIABLE) + MakePair("FLAMELET", INC_DENSITYMODEL::FLAMELET) }; /*! @@ -652,12 +668,14 @@ enum class VISCOSITYMODEL { CONSTANT, /*!< \brief Constant viscosity. */ SUTHERLAND, /*!< \brief Sutherlands Law viscosity. */ POLYNOMIAL, /*!< \brief Polynomial viscosity. */ + FLAMELET, /*!< \brief LUT method for flamelets */ COOLPROP, /*!< \brief CoolProp viscosity. */ }; static const MapType ViscosityModel_Map = { MakePair("CONSTANT_VISCOSITY", VISCOSITYMODEL::CONSTANT) MakePair("SUTHERLAND", VISCOSITYMODEL::SUTHERLAND) MakePair("POLYNOMIAL_VISCOSITY", VISCOSITYMODEL::POLYNOMIAL) + MakePair("FLAMELET", VISCOSITYMODEL::FLAMELET) MakePair("COOLPROP", VISCOSITYMODEL::COOLPROP) }; @@ -680,12 +698,14 @@ enum class CONDUCTIVITYMODEL { CONSTANT, /*!< \brief Constant thermal conductivity. */ CONSTANT_PRANDTL, /*!< \brief Constant Prandtl number. */ POLYNOMIAL, /*!< \brief Polynomial thermal conductivity. */ + FLAMELET, /*!< \brief LUT method for flamelets */ COOLPROP, /*!< \brief COOLPROP thermal conductivity. */ }; static const MapType ConductivityModel_Map = { MakePair("CONSTANT_CONDUCTIVITY", CONDUCTIVITYMODEL::CONSTANT) MakePair("CONSTANT_PRANDTL", CONDUCTIVITYMODEL::CONSTANT_PRANDTL) MakePair("POLYNOMIAL_CONDUCTIVITY", CONDUCTIVITYMODEL::POLYNOMIAL) + MakePair("FLAMELET", CONDUCTIVITYMODEL::FLAMELET) MakePair("COOLPROP", CONDUCTIVITYMODEL::COOLPROP) }; @@ -709,6 +729,7 @@ enum class DIFFUSIVITYMODEL { CONSTANT_SCHMIDT, /*!< \brief Constant Schmidt number for mass diffusion in scalar transport. */ UNITY_LEWIS, /*!< \brief Unity Lewis model for mass diffusion in scalar transport. */ CONSTANT_LEWIS, /*!< \brief Different Lewis number model for mass diffusion in scalar transport. */ + FLAMELET, /*!< \brief flamelet model for tabulated chemistry, diffusivity from lookup table */ }; static const MapType Diffusivity_Model_Map = { @@ -716,6 +737,7 @@ static const MapType Diffusivity_Model_Map = { MakePair("CONSTANT_SCHMIDT", DIFFUSIVITYMODEL::CONSTANT_SCHMIDT) MakePair("UNITY_LEWIS", DIFFUSIVITYMODEL::UNITY_LEWIS) MakePair("CONSTANT_LEWIS", DIFFUSIVITYMODEL::CONSTANT_LEWIS) + MakePair("FLAMELET", DIFFUSIVITYMODEL::FLAMELET) }; /*! @@ -778,11 +800,13 @@ static const MapType Gust_Type_Map = { */ enum ENUM_GUST_DIR { X_DIR = 0, /*!< \brief Gust direction-X. */ - Y_DIR = 1 /*!< \brief Gust direction-Y. */ + Y_DIR = 1, /*!< \brief Gust direction-Y. */ + Z_DIR = 2 /*!< \brief Gust direction-Z. */ }; static const MapType Gust_Dir_Map = { MakePair("X_DIR", X_DIR) MakePair("Y_DIR", Y_DIR) + MakePair("Z_DIR", Z_DIR) }; // If you add to ENUM_CENTERED, you must also add the option to ENUM_CONVECTIVE @@ -819,7 +843,6 @@ enum class UPWIND { MSW, /*!< \brief Modified Steger-Warming method. */ TURKEL, /*!< \brief Roe-Turkel's upwind numerical method. */ SLAU, /*!< \brief Simple Low-Dissipation AUSM numerical method. */ - CUSP, /*!< \brief Convective upwind and split pressure numerical method. */ CONVECTIVE_TEMPLATE, /*!< \brief Template for new numerical method . */ L2ROE, /*!< \brief L2ROE numerical method . */ LMROE, /*!< \brief Rieper's Low Mach ROE numerical method . */ @@ -843,7 +866,6 @@ static const MapType Upwind_Map = { MakePair("HLLC", UPWIND::HLLC) MakePair("SW", UPWIND::SW) MakePair("MSW", UPWIND::MSW) - MakePair("CUSP", UPWIND::CUSP) MakePair("SCALAR_UPWIND", UPWIND::SCALAR_UPWIND) MakePair("BOUNDED_SCALAR", UPWIND::BOUNDED_SCALAR) MakePair("CONVECTIVE_TEMPLATE", UPWIND::CONVECTIVE_TEMPLATE) @@ -896,6 +918,9 @@ static const MapType MatrixColoring_Map = { enum class LIMITER { NONE , /*!< \brief No limiter. */ VENKATAKRISHNAN , /*!< \brief Slope limiter using Venkatakrisnan method (stencil formulation). */ + NISHIKAWA_R3 , /*!< \brief Slope limiter using Nishikawa's R3 method (stencil formulation). */ + NISHIKAWA_R4 , /*!< \brief Slope limiter using Nishikawa's R4 method (stencil formulation). */ + NISHIKAWA_R5 , /*!< \brief Slope limiter using Nishikawa's R5 method (stencil formulation). */ VENKATAKRISHNAN_WANG , /*!< \brief Slope limiter using Venkatakrisnan method, eps based on solution (stencil formulation). */ BARTH_JESPERSEN , /*!< \brief Slope limiter using Barth-Jespersen method (stencil formulation). */ VAN_ALBADA_EDGE , /*!< \brief Slope limiter using Van Albada method (edge formulation). */ @@ -905,6 +930,9 @@ enum class LIMITER { static const MapType Limiter_Map = { MakePair("NONE", LIMITER::NONE) MakePair("VENKATAKRISHNAN", LIMITER::VENKATAKRISHNAN) + MakePair("NISHIKAWA_R3", LIMITER::NISHIKAWA_R3) + MakePair("NISHIKAWA_R4", LIMITER::NISHIKAWA_R4) + MakePair("NISHIKAWA_R5", LIMITER::NISHIKAWA_R5) MakePair("VENKATAKRISHNAN_WANG", LIMITER::VENKATAKRISHNAN_WANG) MakePair("BARTH_JESPERSEN", LIMITER::BARTH_JESPERSEN) MakePair("VAN_ALBADA_EDGE", LIMITER::VAN_ALBADA_EDGE) @@ -1009,8 +1037,9 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne const bool default_version = !found_1994 && !found_1994m && !found_2003 && !found_2003m; - const bool sst_1994 = found_1994 || found_1994m || default_version; - const bool sst_2003 = found_2003 || found_2003m; + const bool sst_1994 = found_1994 || found_1994m; + /*--- Default version since v8. ---*/ + const bool sst_2003 = found_2003 || found_2003m || default_version; /*--- When V2003m or V1994m is selected, we automatically select sst_m. ---*/ const bool sst_m = found_1994m || found_2003m || default_version; @@ -1026,12 +1055,6 @@ inline SST_ParsedOptions ParseSSTOptions(const SST_OPTIONS *SST_Options, unsigne SSTParsedOptions.version = SST_OPTIONS::V2003; } else { SSTParsedOptions.version = SST_OPTIONS::V1994; - - if (rank==MASTER_NODE) { - std::cout << - "WARNING: The current SST-1994m model is inconsistent with literature. We recommend using the SST-2003m model.\n" - "In SU2 v8 the 2003m model will become default, and the inconsistency will be fixed." << std::endl; - } } // Parse production modifications @@ -1280,11 +1303,39 @@ inline LM_ParsedOptions ParseLMOptions(const LM_OPTIONS *LM_Options, unsigned sh */ enum class SPECIES_MODEL { NONE, /*!< \brief No scalar transport model. */ - SPECIES_TRANSPORT, /*!< \brief Passive scalar transport model. */ + SPECIES_TRANSPORT, /*!< \brief species transport model. */ + FLAMELET, /*!< \brief flamelet model. */ }; static const MapType Species_Model_Map = { MakePair("NONE", SPECIES_MODEL::NONE) MakePair("SPECIES_TRANSPORT", SPECIES_MODEL::SPECIES_TRANSPORT) + MakePair("FLAMELET", SPECIES_MODEL::FLAMELET) +}; + +/*! + * \brief Progress variable and enthalpy are the first and second entries in the lookup table. + * \note The order matters. + */ +enum FLAMELET_SCALAR_VARIABLES { + I_PROGVAR, + I_ENTH, + I_MIXFRAC, +}; + +/*! + * \brief the source terms for the flamelet method. At the moment only progress variable + */ +enum FLAMELET_SCALAR_SOURCES { + I_SRC_TOT_PROGVAR +}; + +/*! + * \brief Look-up operations for the flamelet scalar solver. + */ +enum FLAMELET_LOOKUP_OPS { + TD, /*!< \brief Thermochemical properties (temperature, density, diffusivity, etc.). */ + SOURCES, /*!< \brief Scalar source terms (controlling variables, passive species).*/ + LOOKUP, /*!< \brief Passive look-up variables specified in config. */ }; /*! @@ -1429,14 +1480,12 @@ static const MapType Heat_TimeStep_Map = { * \brief Type of time integration schemes */ enum class STRUCT_TIME_INT { - CD_EXPLICIT, /*!< \brief Support for implementing an explicit method. */ NEWMARK_IMPLICIT, /*!< \brief Implicit Newmark integration definition. */ GENERALIZED_ALPHA, /*!< \brief Support for implementing another implicit method. */ }; static const MapType Time_Int_Map_FEA = { - MakePair("CD_EXPLICIT", STRUCT_TIME_INT::CD_EXPLICIT) MakePair("NEWMARK_IMPLICIT", STRUCT_TIME_INT::NEWMARK_IMPLICIT) - MakePair("GENERALIZED_ALPHA", STRUCT_TIME_INT::GENERALIZED_ALPHA) + // MakePair("GENERALIZED_ALPHA", STRUCT_TIME_INT::GENERALIZED_ALPHA) Not fully implemented. }; /*! @@ -1870,9 +1919,6 @@ enum ENUM_OBJECTIVE { SURFACE_SPECIES_0 = 58, /*!< \brief Surface Avg. Species_0 objective function definition. */ SURFACE_SPECIES_VARIANCE = 59,/*!< \brief Species Variance objective function definition. */ CUSTOM_OBJFUNC = 31, /*!< \brief Custom objective function definition. */ - FLOW_ANGLE_OUT = 46, - MASS_FLOW_IN = 47, - ENTROPY_GENERATION = 50, REFERENCE_GEOMETRY = 60, /*!< \brief Norm of displacements with respect to target geometry. */ REFERENCE_NODE = 61, /*!< \brief Objective function defined as the difference of a particular node respect to a reference position. */ VOLUME_FRACTION = 62, /*!< \brief Volume average physical density, for material-based topology optimization applications. */ @@ -1915,9 +1961,6 @@ static const MapType Objective_Map = { MakePair("SURFACE_SPECIES_0", SURFACE_SPECIES_0) MakePair("SURFACE_SPECIES_VARIANCE", SURFACE_SPECIES_VARIANCE) MakePair("CUSTOM_OBJFUNC", CUSTOM_OBJFUNC) - MakePair("FLOW_ANGLE_OUT", FLOW_ANGLE_OUT) - MakePair("MASS_FLOW_IN", MASS_FLOW_IN) - MakePair("ENTROPY_GENERATION", ENTROPY_GENERATION) MakePair("REFERENCE_GEOMETRY", REFERENCE_GEOMETRY) MakePair("REFERENCE_NODE", REFERENCE_NODE) MakePair("VOLUME_FRACTION", VOLUME_FRACTION) @@ -2093,7 +2136,6 @@ enum ENUM_PARAM { FFD_CONTROL_POINT_2D = 19, /*!< \brief Free form deformation for 2D design (change a control point). */ FFD_CAMBER_2D = 20, /*!< \brief Free form deformation for 3D design (camber change). */ FFD_THICKNESS_2D = 21, /*!< \brief Free form deformation for 3D design (thickness change). */ - FFD_TWIST_2D = 22, /*!< \brief Free form deformation for 3D design (camber change). */ FFD_CONTROL_SURFACE = 23, /*!< \brief Free form deformation for 3D design (control surface). */ FFD_ANGLE_OF_ATTACK = 24, /*!< \brief Angle of attack for FFD problem. */ HICKS_HENNE = 30, /*!< \brief Hicks-Henne bump function for airfoil deformation. */ @@ -2116,7 +2158,6 @@ enum ENUM_PARAM { static const MapType Param_Map = { MakePair("FFD_SETTING", FFD_SETTING) MakePair("FFD_CONTROL_POINT_2D", FFD_CONTROL_POINT_2D) - MakePair("FFD_TWIST_2D", FFD_TWIST_2D) MakePair("FFD_ANGLE_OF_ATTACK", FFD_ANGLE_OF_ATTACK) MakePair("FFD_CAMBER_2D", FFD_CAMBER_2D) MakePair("FFD_THICKNESS_2D", FFD_THICKNESS_2D) @@ -2369,18 +2410,6 @@ enum class RECORDING { SOLUTION_AND_MESH, }; -/*! - * \brief Types of schemes for dynamic structural computations - */ -enum ENUM_DYNAMIC { - STATIC = 0, /*!< \brief A static structural computation. */ - DYNAMIC = 1 /*!< \brief Use a time stepping strategy for dynamic computations. */ -}; -static const MapType Dynamic_Map = { - MakePair("NO", STATIC) - MakePair("YES", DYNAMIC) -}; - /*! * \brief Types of input file formats */ diff --git a/Common/include/option_structure.inl b/Common/include/option_structure.inl index 758033da153..ce94055fca5 100644 --- a/Common/include/option_structure.inl +++ b/Common/include/option_structure.inl @@ -3,7 +3,7 @@ * \brief Template derived classes from COption, defined here as we * only include them where needed to reduce compilation time. * \author J. Hicken, B. Tracey - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -31,21 +31,16 @@ using namespace std; template class COptionEnum final : public COptionBase { - const map& m; - TField& field; // Reference to the fieldname - const Tenum def; // Default value - const string name; // identifier for the option + TField& field; // Reference to the fieldname + const Tenum def; // Default value + const string name; // identifier for the option -public: + public: COptionEnum() = delete; - COptionEnum(string option_field_name, const map& m_, TField& option_field, Tenum default_value) : - m(m_), - field(option_field), - def(default_value), - name(std::move(option_field_name)) { - } + COptionEnum(string option_field_name, const map& m_, TField& option_field, Tenum default_value) + : m(m_), field(option_field), def(default_value), name(std::move(option_field_name)) {} string SetValue(const vector& option_value) override { COptionBase::SetValue(option_value); @@ -73,26 +68,19 @@ public: void SetDefault() override { field = def; } }; -template +template class COptionScalar : public COptionBase { -protected: - Scalar& field; // Reference to the fieldname - const Scalar def; // Default value - const string name; // identifier for the option - const string typeName; // name for the scalar type + protected: + Scalar& field; // Reference to the fieldname + const Scalar def; // Default value + const string name; // identifier for the option + const string typeName; // name for the scalar type -public: + public: COptionScalar() = delete; - COptionScalar(const string& type_name, - const string& option_field_name, - Scalar& option_field, - Scalar default_value) : - field(option_field), - def(default_value), - name(option_field_name), - typeName(type_name) { - } + COptionScalar(const string& type_name, const string& option_field_name, Scalar& option_field, Scalar default_value) + : field(option_field), def(default_value), name(option_field_name), typeName(type_name) {} string SetValue(const vector& option_value) override { COptionBase::SetValue(option_value); @@ -106,63 +94,49 @@ public: return badValue(typeName, name); } - void SetDefault() final { - field = def; - } + void SetDefault() final { field = def; } }; class COptionDouble final : public COptionScalar { -public: - template - COptionDouble(Ts&&... args) : - COptionScalar("su2double", args...) { - } + public: + template + COptionDouble(Ts&&... args) : COptionScalar("su2double", args...) {} }; class COptionInt final : public COptionScalar { -public: - template - COptionInt(Ts&&... args) : - COptionScalar("int", args...) { - } + public: + template + COptionInt(Ts&&... args) : COptionScalar("int", args...) {} }; class COptionULong final : public COptionScalar { -public: - template - COptionULong(Ts&&... args) : - COptionScalar("unsigned long", args...) { - } + public: + template + COptionULong(Ts&&... args) : COptionScalar("unsigned long", args...) {} }; class COptionUShort final : public COptionScalar { -public: - template - COptionUShort(Ts&&... args) : - COptionScalar("unsigned short", args...) { - } + public: + template + COptionUShort(Ts&&... args) : COptionScalar("unsigned short", args...) {} }; class COptionLong final : public COptionScalar { -public: - template - COptionLong(Ts&&... args) : - COptionScalar("long", args...) { - } + public: + template + COptionLong(Ts&&... args) : COptionScalar("long", args...) {} }; class COptionBool final : public COptionScalar { -public: - template - COptionBool(Ts&&... args) : - COptionScalar("bool", args...) { - } + public: + template + COptionBool(Ts&&... args) : COptionScalar("bool", args...) {} string SetValue(const vector& option_value) override { COptionBase::SetValue(option_value); string result; - auto msg = COptionScalar("bool",name,result,"").SetValue(option_value); + auto msg = COptionScalar("bool", name, result, "").SetValue(option_value); if (!msg.empty()) return msg; @@ -180,21 +154,16 @@ public: }; class COptionString final : public COptionBase { -protected: - string& field; // Reference to the fieldname - const string def; // Default value - const string name; // identifier for the option + protected: + string& field; // Reference to the fieldname + const string def; // Default value + const string name; // identifier for the option -public: + public: COptionString() = delete; - COptionString(const string& option_field_name, - string& option_field, - string default_value) : - field(option_field), - def(default_value), - name(option_field_name) { - } + COptionString(const string& option_field_name, string& option_field, string default_value) + : field(option_field), def(default_value), name(option_field_name) {} string SetValue(const vector& option_value) override { COptionBase::SetValue(option_value); @@ -206,32 +175,27 @@ public: return ""; } - void SetDefault() override { - field = def; - } + void SetDefault() override { field = def; } }; template class COptionEnumList final : public COptionBase { - const map& m; TField*& field; unsigned short& mySize; const string name; -public: + public: COptionEnumList() = delete; - COptionEnumList(string option_field_name, const map& m_, TField*& option_field, unsigned short& list_size) : - m(m_), - field(option_field), - mySize(list_size), - name(option_field_name) { + COptionEnumList(string option_field_name, const map& m_, TField*& option_field, + unsigned short& list_size) + : m(m_), field(option_field), mySize(list_size), name(option_field_name) { field = nullptr; } ~COptionEnumList() { - delete [] field; + delete[] field; field = nullptr; } @@ -266,18 +230,15 @@ public: void SetDefault() override { mySize = 0; } }; -template +template class COptionArray final : public COptionBase { - string name; // Identifier for the option - const int size; // Number of elements - Type* field; // Reference to the field - -public: - COptionArray(string option_field_name, const int list_size, Type* option_field) : - name(option_field_name), - size(list_size), - field(option_field) { - } + string name; // Identifier for the option + const int size; // Number of elements + Type* field; // Reference to the field + + public: + COptionArray(string option_field_name, const int list_size, Type* option_field) + : name(option_field_name), size(list_size), field(option_field) {} string SetValue(const vector& option_value) override { COptionBase::SetValue(option_value); @@ -296,7 +257,7 @@ public: newstring.append(" found"); return newstring; } - for (int i = 0; i < this->size; i++) { + for (int i = 0; i < this->size; i++) { istringstream is(option_value[i]); if (!(is >> field[i])) { return badValue(" array", this->name); @@ -308,29 +269,24 @@ public: void SetDefault() override {} }; -template +template class COptionScalarList : public COptionBase { - Scalar*& field; // reference to the field - const string name; // identifier for the option - unsigned short& mySize; // size of the list - const string typeName; // name of the scalar type + Scalar*& field; // reference to the field + const string name; // identifier for the option + unsigned short& mySize; // size of the list + const string typeName; // name of the scalar type -public: + public: COptionScalarList() = delete; - COptionScalarList(const string& type_name, - const string& option_field_name, - unsigned short& list_size, - Scalar*& option_field) : - field(option_field), - name(option_field_name), - mySize(list_size), - typeName(type_name) { + COptionScalarList(const string& type_name, const string& option_field_name, unsigned short& list_size, + Scalar*& option_field) + : field(option_field), name(option_field_name), mySize(list_size), typeName(type_name) { field = nullptr; } ~COptionScalarList() { - delete [] field; + delete[] field; // prevent double free field = nullptr; } @@ -351,7 +307,7 @@ public: istringstream is(option_value[i]); Scalar val; if (!(is >> val)) { - return badValue(typeName+" list", name); + return badValue(typeName + " list", name); } field[i] = std::move(val); } @@ -359,59 +315,49 @@ public: } void SetDefault() final { - mySize = 0; // There is no default value for list + mySize = 0; // There is no default value for list } }; class COptionDoubleList final : public COptionScalarList { -public: - template - COptionDoubleList(Ts&&... args) : - COptionScalarList("su2double", args...) { - } + public: + template + COptionDoubleList(Ts&&... args) : COptionScalarList("su2double", args...) {} }; class COptionShortList final : public COptionScalarList { -public: - template - COptionShortList(Ts&&... args) : - COptionScalarList("short", args...) { - } + public: + template + COptionShortList(Ts&&... args) : COptionScalarList("short", args...) {} }; class COptionUShortList final : public COptionScalarList { -public: - template - COptionUShortList(Ts&&... args) : - COptionScalarList("unsigned short", args...) { - } + public: + template + COptionUShortList(Ts&&... args) : COptionScalarList("unsigned short", args...) {} }; class COptionULongList final : public COptionScalarList { -public: - template - COptionULongList(Ts&&... args) : - COptionScalarList("unsigned long", args...) { - } + public: + template + COptionULongList(Ts&&... args) : COptionScalarList("unsigned long", args...) {} }; class COptionStringList final : public COptionScalarList { -public: - template - COptionStringList(Ts&&... args) : - COptionScalarList("string", args...) { - } + public: + template + COptionStringList(Ts&&... args) : COptionScalarList("string", args...) {} }; class COptionConvect : public COptionBase { - string name; // identifier for the option - unsigned short & space; - CENTERED & centered; - UPWIND & upwind; + string name; // identifier for the option + unsigned short& space; + CENTERED& centered; + UPWIND& upwind; -public: - COptionConvect(string option_field_name, unsigned short & space_field, CENTERED & centered_field, UPWIND & upwind_field) - : name(option_field_name), space(space_field), centered(centered_field), upwind(upwind_field) { } + public: + COptionConvect(string option_field_name, unsigned short& space_field, CENTERED& centered_field, UPWIND& upwind_field) + : name(option_field_name), space(space_field), centered(centered_field), upwind(upwind_field) {} string SetValue(const vector& option_value) override { COptionBase::SetValue(option_value); @@ -436,7 +382,6 @@ public: // Make them defined in case something weird happens SetDefault(); return badValue("convect", this->name); - } void SetDefault() override { @@ -446,17 +391,18 @@ public: } }; -class COptionFEMConvect : public COptionBase{ - string name; // identifier for the option - unsigned short & space; - unsigned short & fem; +class COptionFEMConvect : public COptionBase { + string name; // identifier for the option + unsigned short& space; + unsigned short& fem; -public: - COptionFEMConvect(string option_field_name, unsigned short & space_field, unsigned short & fem_field) : space(space_field), fem(fem_field) { + public: + COptionFEMConvect(string option_field_name, unsigned short& space_field, unsigned short& fem_field) + : space(space_field), fem(fem_field) { this->name = option_field_name; } - ~COptionFEMConvect() override {}; + ~COptionFEMConvect() override{}; string SetValue(const vector& option_value) override { COptionBase::SetValue(option_value); @@ -474,56 +420,51 @@ public: // Make them defined in case something weird happens this->fem = NO_FEM; return badValue("convect", this->name); - } - void SetDefault() override { - this->fem = NO_FEM; - } + void SetDefault() override { this->fem = NO_FEM; } }; class COptionMathProblem : public COptionBase { - string name; // identifier for the option - bool & cont_adjoint; + string name; // identifier for the option + bool& cont_adjoint; bool cont_adjoint_def; - bool & disc_adjoint; + bool& disc_adjoint; bool disc_adjoint_def; - bool & restart; + bool& restart; bool restart_def; -public: - COptionMathProblem(string option_field_name, bool & cont_adjoint_field, bool cont_adjoint_default, bool & disc_adjoint_field, bool disc_adjoint_default, bool & restart_field, bool restart_default) : cont_adjoint(cont_adjoint_field), disc_adjoint(disc_adjoint_field), restart(restart_field) { + public: + COptionMathProblem(string option_field_name, bool& cont_adjoint_field, bool cont_adjoint_default, + bool& disc_adjoint_field, bool disc_adjoint_default, bool& restart_field, bool restart_default) + : cont_adjoint(cont_adjoint_field), disc_adjoint(disc_adjoint_field), restart(restart_field) { name = option_field_name; cont_adjoint_def = cont_adjoint_default; disc_adjoint_def = disc_adjoint_default; restart_def = restart_default; } - ~COptionMathProblem() override {}; + ~COptionMathProblem() override{}; string SetValue(const vector& option_value) override { COptionBase::SetValue(option_value); string out = optionCheckMultipleValues(option_value, "unsigned short", name); if (out.compare("") != 0) { return out; - } - else if (option_value[0] == "ADJOINT") { + } else if (option_value[0] == "ADJOINT") { return badValue("math problem (try CONTINUOUS_ADJOINT)", name); - } - else if (option_value[0] == "DIRECT") { + } else if (option_value[0] == "DIRECT") { cont_adjoint = false; disc_adjoint = false; restart = false; return ""; - } - else if (option_value[0] == "CONTINUOUS_ADJOINT") { - cont_adjoint= true; + } else if (option_value[0] == "CONTINUOUS_ADJOINT") { + cont_adjoint = true; disc_adjoint = false; - restart= true; + restart = true; return ""; - } - else if (option_value[0] == "DISCRETE_ADJOINT") { + } else if (option_value[0] == "DISCRETE_ADJOINT") { disc_adjoint = true; - cont_adjoint= false; + cont_adjoint = false; restart = true; return ""; } @@ -535,22 +476,23 @@ public: disc_adjoint = disc_adjoint_def; restart = restart_def; } - }; class COptionDVParam : public COptionBase { - string name; // identifier for the option - unsigned short & nDV; - su2double ** & paramDV; - string * & FFDTag; - unsigned short* & design_variable; - -public: - COptionDVParam(string option_field_name, unsigned short & nDV_field, su2double** & paramDV_field, string* & FFDTag_field, unsigned short * & design_variable_field) : nDV(nDV_field), paramDV(paramDV_field), FFDTag(FFDTag_field), design_variable(design_variable_field) { + string name; // identifier for the option + unsigned short& nDV; + su2double**& paramDV; + string*& FFDTag; + unsigned short*& design_variable; + + public: + COptionDVParam(string option_field_name, unsigned short& nDV_field, su2double**& paramDV_field, string*& FFDTag_field, + unsigned short*& design_variable_field) + : nDV(nDV_field), paramDV(paramDV_field), FFDTag(FFDTag_field), design_variable(design_variable_field) { this->name = option_field_name; } - ~COptionDVParam() override {}; + ~COptionDVParam() override{}; string SetValue(const vector& option_value) override { COptionBase::SetValue(option_value); @@ -566,18 +508,17 @@ public: newstring.append(": may not have beginning semicolon"); return newstring; } - if (option_value[option_value.size()-1].compare(";") == 0) { + if (option_value[option_value.size() - 1].compare(";") == 0) { string newstring; newstring.append(this->name); newstring.append(": may not have ending semicolon"); return newstring; } - // use the ";" token to determine the number of design variables // This works because semicolon is not one of the delimiters in tokenize string this->nDV = 0; - //unsigned int num_semi = 0; + // unsigned int num_semi = 0; for (unsigned int i = 0; i < static_cast(option_value.size()); i++) { if (option_value[i].compare(";") == 0) { this->nDV++; @@ -588,10 +529,12 @@ public: // One more design variable than semicolon this->nDV++; - if ( (this->nDV > 0) && (this->design_variable == nullptr) ) { + if ((this->nDV > 0) && (this->design_variable == nullptr)) { string newstring; newstring.append(this->name); - newstring.append(": Design_Variable array has not been allocated. Check that DV_KIND appears before DV_PARAM in configuration file."); + newstring.append( + ": Design_Variable array has not been allocated. Check that DV_KIND appears before DV_PARAM in configuration " + "file."); return newstring; } @@ -602,48 +545,113 @@ public: this->FFDTag = new string[this->nDV]; - vector nParamDV(nDV, 0); - unsigned short totalnParamDV = 0; - stringstream ss; - unsigned int i = 0; + vector nParamDV(nDV, 0); + unsigned short totalnParamDV = 0; + stringstream ss; + unsigned int i = 0; for (unsigned short iDV = 0; iDV < this->nDV; iDV++) { switch (this->design_variable[iDV]) { - case NO_DEFORMATION: nParamDV[iDV] = 0; break; - case FFD_SETTING: nParamDV[iDV] = 0; break; - case FFD_CONTROL_POINT_2D: nParamDV[iDV] = 5; break; - case FFD_CAMBER_2D: nParamDV[iDV] = 2; break; - case FFD_THICKNESS_2D: nParamDV[iDV] = 2; break; - case FFD_TWIST_2D: nParamDV[iDV] = 3; break; - case HICKS_HENNE: nParamDV[iDV] = 2; break; - case SURFACE_BUMP: nParamDV[iDV] = 3; break; - case CST: nParamDV[iDV] = 3; break; - case ANGLE_OF_ATTACK: nParamDV[iDV] = 1; break; - case SCALE: nParamDV[iDV] = 0; break; - case TRANSLATION: nParamDV[iDV] = 3; break; - case ROTATION: nParamDV[iDV] = 6; break; - case NACA_4DIGITS: nParamDV[iDV] = 3; break; - case PARABOLIC: nParamDV[iDV] = 2; break; - case AIRFOIL: nParamDV[iDV] = 2; break; - case FFD_CONTROL_POINT: nParamDV[iDV] = 7; break; - case FFD_NACELLE: nParamDV[iDV] = 6; break; - case FFD_GULL: nParamDV[iDV] = 2; break; - case FFD_TWIST: nParamDV[iDV] = 8; break; - case FFD_ROTATION: nParamDV[iDV] = 7; break; - case FFD_CONTROL_SURFACE: nParamDV[iDV] = 7; break; - case FFD_CAMBER: nParamDV[iDV] = 3; break; - case FFD_THICKNESS: nParamDV[iDV] = 3; break; - case FFD_ANGLE_OF_ATTACK: nParamDV[iDV] = 2; break; - case SURFACE_FILE: nParamDV[iDV] = 0; break; - case DV_EFIELD: nParamDV[iDV] = 2; break; - case DV_YOUNG: nParamDV[iDV] = 0; break; - case DV_POISSON: nParamDV[iDV] = 0; break; - case DV_RHO: nParamDV[iDV] = 0; break; - case DV_RHO_DL: nParamDV[iDV] = 0; break; - case SCALE_GRID: nParamDV[iDV] = 0; break; - case TRANSLATE_GRID: nParamDV[iDV] = 3; break; - case ROTATE_GRID: nParamDV[iDV] = 6; break; - default : { + case NO_DEFORMATION: + nParamDV[iDV] = 0; + break; + case FFD_SETTING: + nParamDV[iDV] = 0; + break; + case FFD_CONTROL_POINT_2D: + nParamDV[iDV] = 5; + break; + case FFD_CAMBER_2D: + nParamDV[iDV] = 2; + break; + case FFD_THICKNESS_2D: + nParamDV[iDV] = 2; + break; + case HICKS_HENNE: + nParamDV[iDV] = 2; + break; + case SURFACE_BUMP: + nParamDV[iDV] = 3; + break; + case CST: + nParamDV[iDV] = 3; + break; + case ANGLE_OF_ATTACK: + nParamDV[iDV] = 1; + break; + case SCALE: + nParamDV[iDV] = 0; + break; + case TRANSLATION: + nParamDV[iDV] = 3; + break; + case ROTATION: + nParamDV[iDV] = 6; + break; + case NACA_4DIGITS: + nParamDV[iDV] = 3; + break; + case PARABOLIC: + nParamDV[iDV] = 2; + break; + case AIRFOIL: + nParamDV[iDV] = 2; + break; + case FFD_CONTROL_POINT: + nParamDV[iDV] = 7; + break; + case FFD_NACELLE: + nParamDV[iDV] = 6; + break; + case FFD_GULL: + nParamDV[iDV] = 2; + break; + case FFD_TWIST: + nParamDV[iDV] = 8; + break; + case FFD_ROTATION: + nParamDV[iDV] = 7; + break; + case FFD_CONTROL_SURFACE: + nParamDV[iDV] = 7; + break; + case FFD_CAMBER: + nParamDV[iDV] = 3; + break; + case FFD_THICKNESS: + nParamDV[iDV] = 3; + break; + case FFD_ANGLE_OF_ATTACK: + nParamDV[iDV] = 2; + break; + case SURFACE_FILE: + nParamDV[iDV] = 0; + break; + case DV_EFIELD: + nParamDV[iDV] = 2; + break; + case DV_YOUNG: + nParamDV[iDV] = 0; + break; + case DV_POISSON: + nParamDV[iDV] = 0; + break; + case DV_RHO: + nParamDV[iDV] = 0; + break; + case DV_RHO_DL: + nParamDV[iDV] = 0; + break; + case SCALE_GRID: + nParamDV[iDV] = 0; + break; + case TRANSLATE_GRID: + nParamDV[iDV] = 3; + break; + case ROTATE_GRID: + nParamDV[iDV] = 6; + break; + default: { string newstring; newstring.append(this->name); newstring.append(": undefined design variable type found in configuration file."); @@ -653,40 +661,31 @@ public: totalnParamDV += nParamDV[iDV]; } - if (totalnParamDV > option_value.size()){ + if (totalnParamDV > option_value.size()) { SU2_MPI::Error("Wrong number of arguments for DV_PARAM!", CURRENT_FUNCTION); } for (unsigned short iDV = 0; iDV < this->nDV; iDV++) { for (unsigned short iParamDV = 0; iParamDV < nParamDV[iDV]; iParamDV++) { - ss << option_value[i] << " "; if ((iParamDV == 0) && - ((this->design_variable[iDV] == NO_DEFORMATION) || - (this->design_variable[iDV] == FFD_SETTING) || - (this->design_variable[iDV] == FFD_ANGLE_OF_ATTACK)|| - (this->design_variable[iDV] == FFD_CONTROL_POINT_2D) || - (this->design_variable[iDV] == FFD_CAMBER_2D) || - (this->design_variable[iDV] == FFD_TWIST_2D) || - (this->design_variable[iDV] == FFD_THICKNESS_2D) || - (this->design_variable[iDV] == FFD_CONTROL_POINT) || - (this->design_variable[iDV] == FFD_NACELLE) || - (this->design_variable[iDV] == FFD_GULL) || - (this->design_variable[iDV] == FFD_TWIST) || - (this->design_variable[iDV] == FFD_ROTATION) || - (this->design_variable[iDV] == FFD_CONTROL_SURFACE) || - (this->design_variable[iDV] == FFD_CAMBER) || + ((this->design_variable[iDV] == NO_DEFORMATION) || (this->design_variable[iDV] == FFD_SETTING) || + (this->design_variable[iDV] == FFD_ANGLE_OF_ATTACK) || + (this->design_variable[iDV] == FFD_CONTROL_POINT_2D) || (this->design_variable[iDV] == FFD_CAMBER_2D) || + (this->design_variable[iDV] == FFD_THICKNESS_2D) || (this->design_variable[iDV] == FFD_CONTROL_POINT) || + (this->design_variable[iDV] == FFD_NACELLE) || (this->design_variable[iDV] == FFD_GULL) || + (this->design_variable[iDV] == FFD_TWIST) || (this->design_variable[iDV] == FFD_ROTATION) || + (this->design_variable[iDV] == FFD_CONTROL_SURFACE) || (this->design_variable[iDV] == FFD_CAMBER) || (this->design_variable[iDV] == FFD_THICKNESS))) { - ss >> this->FFDTag[iDV]; - this->paramDV[iDV][iParamDV] = 0; - } - else + ss >> this->FFDTag[iDV]; + this->paramDV[iDV][iParamDV] = 0; + } else ss >> this->paramDV[iDV][iParamDV]; i++; } - if (iDV < (this->nDV-1)) { + if (iDV < (this->nDV - 1)) { if (option_value[i].compare(";") != 0) { string newstring; newstring.append(this->name); @@ -710,19 +709,25 @@ public: }; class COptionDVValue : public COptionBase { - string name; // identifier for the option - unsigned short* & nDV_Value; - su2double ** & valueDV; - unsigned short & nDV; - su2double ** & paramDV; - unsigned short* & design_variable; - -public: - COptionDVValue(string option_field_name, unsigned short* & nDVValue_field, su2double** & valueDV_field, unsigned short & nDV_field, su2double** & paramDV_field, unsigned short * & design_variable_field) : nDV_Value(nDVValue_field), valueDV(valueDV_field), nDV(nDV_field), paramDV(paramDV_field), design_variable(design_variable_field) { + string name; // identifier for the option + unsigned short*& nDV_Value; + su2double**& valueDV; + unsigned short& nDV; + su2double**& paramDV; + unsigned short*& design_variable; + + public: + COptionDVValue(string option_field_name, unsigned short*& nDVValue_field, su2double**& valueDV_field, + unsigned short& nDV_field, su2double**& paramDV_field, unsigned short*& design_variable_field) + : nDV_Value(nDVValue_field), + valueDV(valueDV_field), + nDV(nDV_field), + paramDV(paramDV_field), + design_variable(design_variable_field) { this->name = option_field_name; } - ~COptionDVValue() override {}; + ~COptionDVValue() override{}; string SetValue(const vector& option_value) override { COptionBase::SetValue(option_value); @@ -731,16 +736,20 @@ public: return ""; } - if ( (this->nDV > 0) && (this->design_variable == nullptr) ) { + if ((this->nDV > 0) && (this->design_variable == nullptr)) { string newstring; newstring.append(this->name); - newstring.append(": Design_Variable array has not been allocated. Check that DV_KIND appears before DV_VALUE in configuration file."); + newstring.append( + ": Design_Variable array has not been allocated. Check that DV_KIND appears before DV_VALUE in configuration " + "file."); return newstring; } - if ( (this->nDV > 0) && (this->paramDV == nullptr) ) { + if ((this->nDV > 0) && (this->paramDV == nullptr)) { string newstring; newstring.append(this->name); - newstring.append(": Design_Parameter array has not been allocated. Check that DV_PARAM appears before DV_VALUE in configuration file."); + newstring.append( + ": Design_Parameter array has not been allocated. Check that DV_PARAM appears before DV_VALUE in " + "configuration file."); return newstring; } @@ -758,23 +767,20 @@ public: for (unsigned short iDV = 0; iDV < this->nDV; iDV++) { switch (this->design_variable[iDV]) { case FFD_CONTROL_POINT: - if((this->paramDV[iDV][4] == 0) && - (this->paramDV[iDV][5] == 0) && - (this->paramDV[iDV][6] == 0)) { + if ((this->paramDV[iDV][4] == 0) && (this->paramDV[iDV][5] == 0) && (this->paramDV[iDV][6] == 0)) { nValueDV = 3; } else { nValueDV = 1; } break; case FFD_CONTROL_POINT_2D: - if((this->paramDV[iDV][3] == 0) && - (this->paramDV[iDV][4] == 0)) { + if ((this->paramDV[iDV][3] == 0) && (this->paramDV[iDV][4] == 0)) { nValueDV = 2; } else { nValueDV = 1; } break; - default : + default: nValueDV = 1; } @@ -783,7 +789,6 @@ public: totalnValueDV += nValueDV; for (unsigned short iValueDV = 0; iValueDV < nValueDV; iValueDV++) { - if (i >= option_value.size()) { string newstring; newstring.append(this->name); @@ -823,12 +828,10 @@ class COptionFFDDef : public COptionBase { su2double**& CoordFFD; string*& FFDTag; -public: - COptionFFDDef(string option_field_name, unsigned short& nFFD_field, su2double**& coordFFD_field, string*& FFDTag_field) - : name(option_field_name), - nFFD(nFFD_field), - CoordFFD(coordFFD_field), - FFDTag(FFDTag_field) { + public: + COptionFFDDef(string option_field_name, unsigned short& nFFD_field, su2double**& coordFFD_field, + string*& FFDTag_field) + : name(option_field_name), nFFD(nFFD_field), CoordFFD(coordFFD_field), FFDTag(FFDTag_field) { nFFD = 0; CoordFFD = nullptr; FFDTag = nullptr; @@ -853,11 +856,10 @@ public: if (option_value[0].compare(";") == 0) { return name + ": may not have beginning semicolon"; } - if (option_value[option_value.size()-1].compare(";") == 0) { + if (option_value[option_value.size() - 1].compare(";") == 0) { return name + ": may not have ending semicolon"; } - // use the ";" token to determine the number of design variables // This works because semicolon is not one of the delimiters in tokenize string this->nFFD = 0; @@ -882,20 +884,20 @@ public: unsigned int i = 0; for (unsigned short iFFD = 0; iFFD < this->nFFD; iFFD++) { - nCoordFFD = 25; for (unsigned short iCoordFFD = 0; iCoordFFD < nCoordFFD; iCoordFFD++) { - ss << option_value[i] << " "; - if (iCoordFFD == 0) ss >> this->FFDTag[iFFD]; - else ss >> this->CoordFFD[iFFD][iCoordFFD-1]; + if (iCoordFFD == 0) + ss >> this->FFDTag[iFFD]; + else + ss >> this->CoordFFD[iFFD][iCoordFFD - 1]; i++; } - if (iFFD < (this->nFFD-1)) { + if (iFFD < (this->nFFD - 1)) { if (option_value[i].compare(";") != 0) { string newstring; newstring.append(this->name); @@ -904,7 +906,6 @@ public: } i++; } - } // Need to return something... @@ -919,11 +920,9 @@ class COptionFFDDegree : public COptionBase { unsigned short& nFFD; unsigned short**& DegreeFFD; -public: + public: COptionFFDDegree(string option_field_name, unsigned short& nFFD_field, unsigned short**& degreeFFD_field) - : name(option_field_name), - nFFD(nFFD_field), - DegreeFFD(degreeFFD_field) { + : name(option_field_name), nFFD(nFFD_field), DegreeFFD(degreeFFD_field) { nFFD = 0; DegreeFFD = nullptr; } @@ -945,11 +944,10 @@ public: if (option_value[0].compare(";") == 0) { return name + ": may not have beginning semicolon"; } - if (option_value[option_value.size()-1].compare(";") == 0) { + if (option_value[option_value.size() - 1].compare(";") == 0) { return name + ": may not have ending semicolon"; } - // use the ";" token to determine the number of design variables // This works because semicolon is not one of the delimiters in tokenize string this->nFFD = 0; @@ -972,7 +970,6 @@ public: unsigned int i = 0; for (unsigned short iFFD = 0; iFFD < this->nFFD; iFFD++) { - nDegreeFFD = 3; for (unsigned short iDegreeFFD = 0; iDegreeFFD < nDegreeFFD; iDegreeFFD++) { @@ -981,7 +978,7 @@ public: i++; } - if (iFFD < (this->nFFD-1)) { + if (iFFD < (this->nFFD - 1)) { if (option_value[i].compare(";") != 0) { string newstring; newstring.append(this->name); @@ -990,7 +987,6 @@ public: } i++; } - } // Need to return something... @@ -1001,22 +997,22 @@ public: }; class COptionInlet : public COptionBase { - string name; // identifier for the option + string name; // identifier for the option unsigned short& size; string*& marker; su2double*& ttotal; su2double*& ptotal; su2double**& flowdir; -public: + public: COptionInlet(string option_field_name, unsigned short& nMarker_Inlet, string*& Marker_Inlet, su2double*& Ttotal, su2double*& Ptotal, su2double**& FlowDir) - : name(option_field_name), - size(nMarker_Inlet), - marker(Marker_Inlet), - ttotal(Ttotal), - ptotal(Ptotal), - flowdir(FlowDir) { + : name(option_field_name), + size(nMarker_Inlet), + marker(Marker_Inlet), + ttotal(Ttotal), + ptotal(Ptotal), + flowdir(FlowDir) { size = 0; marker = nullptr; ttotal = nullptr; @@ -1061,14 +1057,14 @@ public: bool err = false; auto getval = [&](unsigned short i, unsigned short j) { - istringstream ss(option_value[6*i + j]); + istringstream ss(option_value[6 * i + j]); su2double val; if (!(ss >> val)) err = true; return val; }; for (unsigned short i = 0; i < nVals; i++) { - marker[i].assign(option_value[6*i]); + marker[i].assign(option_value[6 * i]); ttotal[i] = getval(i, 1); ptotal[i] = getval(i, 2); flowdir[i][0] = getval(i, 3); @@ -1096,40 +1092,40 @@ template struct CStringValuesListHelper { static T* resize(unsigned short n) { return new T[n]; } static T& access(T* ptr, unsigned short i) { return ptr[i]; } - static void clear(T* ptr) { delete [] ptr; } + static void clear(T* ptr) { delete[] ptr; } }; // Class where the option is represented by (string, N * "some type", string, N * "some type", ...) template class COptionStringValuesList final : public COptionBase { - const string name; // identifier for the option - unsigned short& size; // number of string-value pairs - string*& strings; // the strings in the option - Type*& values; // the values per string - unsigned short& num_vals; // how many values per string - unsigned short optional_num_vals = 0; // num_vals points to this when it is not provided in the ctor. - -public: - COptionStringValuesList(string name_, unsigned short& size_, string*& strings_, - Type*& values_, unsigned short& num_vals_) : - name(name_), size(size_), strings(strings_), values(values_), num_vals(num_vals_) { + const string name; // identifier for the option + unsigned short& size; // number of string-value pairs + string*& strings; // the strings in the option + Type*& values; // the values per string + unsigned short& num_vals; // how many values per string + unsigned short optional_num_vals = 0; // num_vals points to this when it is not provided in the ctor. + + public: + COptionStringValuesList(string name_, unsigned short& size_, string*& strings_, Type*& values_, + unsigned short& num_vals_) + : name(name_), size(size_), strings(strings_), values(values_), num_vals(num_vals_) { strings = nullptr; values = nullptr; } - COptionStringValuesList(string name_, unsigned short& size_, string*& strings_, Type*& values_) : - name(name_), size(size_), strings(strings_), values(values_), num_vals(optional_num_vals) { + COptionStringValuesList(string name_, unsigned short& size_, string*& strings_, Type*& values_) + : name(name_), size(size_), strings(strings_), values(values_), num_vals(optional_num_vals) { strings = nullptr; values = nullptr; } ~COptionStringValuesList() { - delete [] strings; + delete[] strings; strings = nullptr; for (unsigned short i = 0; i < size; ++i) { CStringValuesListHelper::clear(values[i]); } - delete [] values; + delete[] values; values = nullptr; } @@ -1188,32 +1184,32 @@ public: } void SetDefault() override { - size = 0; // There is no default value for lists + size = 0; // There is no default value for lists num_vals = 0; } }; - template class COptionRiemann : public COptionBase { - -protected: + protected: map m; - string name; // identifier for the option - unsigned short & size; - string * & marker; - unsigned short* & field; // Reference to the field name - su2double * & var1; - su2double * & var2; - su2double ** & flowdir; - -public: - COptionRiemann(string option_field_name, unsigned short & nMarker_Riemann, string* & Marker_Riemann, unsigned short* & option_field, const map m, su2double* & var1, su2double* & var2, su2double** & FlowDir) : size(nMarker_Riemann), - marker(Marker_Riemann), field(option_field), var1(var1), var2(var2), flowdir(FlowDir) { + string name; // identifier for the option + unsigned short& size; + string*& marker; + unsigned short*& field; // Reference to the field name + su2double*& var1; + su2double*& var2; + su2double**& flowdir; + + public: + COptionRiemann(string option_field_name, unsigned short& nMarker_Riemann, string*& Marker_Riemann, + unsigned short*& option_field, const map m, su2double*& var1, su2double*& var2, + su2double**& FlowDir) + : size(nMarker_Riemann), marker(Marker_Riemann), field(option_field), var1(var1), var2(var2), flowdir(FlowDir) { this->name = option_field_name; this->m = m; } - ~COptionRiemann() override {}; + ~COptionRiemann() override{}; string SetValue(const vector& option_value) override { COptionBase::SetValue(option_value); @@ -1254,36 +1250,36 @@ public: } for (unsigned long i = 0; i < nVals; i++) { - this->marker[i].assign(option_value[7*i]); - // Check to see if the enum value is in the map - if (this->m.find(option_value[7*i + 1]) == m.end()) { - string str; - str.append(this->name); - str.append(": invalid option value "); - str.append(option_value[0]); - str.append(". Check current SU2 options in config_template.cfg."); - return str; - } - Tenum val = this->m[option_value[7*i + 1]]; + this->marker[i].assign(option_value[7 * i]); + // Check to see if the enum value is in the map + if (this->m.find(option_value[7 * i + 1]) == m.end()) { + string str; + str.append(this->name); + str.append(": invalid option value "); + str.append(option_value[0]); + str.append(". Check current SU2 options in config_template.cfg."); + return str; + } + Tenum val = this->m[option_value[7 * i + 1]]; this->field[i] = val; - istringstream ss_1st(option_value[7*i + 2]); + istringstream ss_1st(option_value[7 * i + 2]); if (!(ss_1st >> this->var1[i])) { return badValue("Riemann", this->name); } - istringstream ss_2nd(option_value[7*i + 3]); + istringstream ss_2nd(option_value[7 * i + 3]); if (!(ss_2nd >> this->var2[i])) { return badValue("Riemann", this->name); } - istringstream ss_3rd(option_value[7*i + 4]); + istringstream ss_3rd(option_value[7 * i + 4]); if (!(ss_3rd >> this->flowdir[i][0])) { return badValue("Riemann", this->name); } - istringstream ss_4th(option_value[7*i + 5]); + istringstream ss_4th(option_value[7 * i + 5]); if (!(ss_4th >> this->flowdir[i][1])) { return badValue("Riemann", this->name); } - istringstream ss_5th(option_value[7*i + 6]); + istringstream ss_5th(option_value[7 * i + 6]); if (!(ss_5th >> this->flowdir[i][2])) { return badValue("Riemann", this->name); } @@ -1297,31 +1293,39 @@ public: this->var1 = nullptr; this->var2 = nullptr; this->flowdir = nullptr; - this->size = 0; // There is no default value for list + this->size = 0; // There is no default value for list } }; template -class COptionGiles : public COptionBase{ - +class COptionGiles : public COptionBase { map m; - unsigned short & size; - string * & marker; - unsigned short* & field; // Reference to the fieldname - string name; // identifier for the option - su2double * & var1; - su2double * & var2; - su2double ** & flowdir; - su2double * & relfac1; - su2double * & relfac2; - -public: - COptionGiles(string option_field_name, unsigned short & nMarker_Giles, string* & Marker_Giles, unsigned short* & option_field, const map m, su2double* & var1, su2double* & var2, su2double** & FlowDir, su2double* & relfac1, su2double* & relfac2) : size(nMarker_Giles), - marker(Marker_Giles), field(option_field), var1(var1), var2(var2), flowdir(FlowDir), relfac1(relfac1), relfac2(relfac2) { + unsigned short& size; + string*& marker; + unsigned short*& field; // Reference to the fieldname + string name; // identifier for the option + su2double*& var1; + su2double*& var2; + su2double**& flowdir; + su2double*& relfac1; + su2double*& relfac2; + + public: + COptionGiles(string option_field_name, unsigned short& nMarker_Giles, string*& Marker_Giles, + unsigned short*& option_field, const map m, su2double*& var1, su2double*& var2, + su2double**& FlowDir, su2double*& relfac1, su2double*& relfac2) + : size(nMarker_Giles), + marker(Marker_Giles), + field(option_field), + var1(var1), + var2(var2), + flowdir(FlowDir), + relfac1(relfac1), + relfac2(relfac2) { this->name = option_field_name; this->m = m; } - ~COptionGiles() override {}; + ~COptionGiles() override{}; string SetValue(const vector& option_value) override { COptionBase::SetValue(option_value); @@ -1368,44 +1372,44 @@ public: } for (unsigned int i = 0; i < nVals; i++) { - this->marker[i].assign(option_value[9*i]); - // Check to see if the enum value is in the map - if (this->m.find(option_value[9*i + 1]) == m.end()) { - string str; - str.append(this->name); - str.append(": invalid option value "); - str.append(option_value[0]); - str.append(". Check current SU2 options in config_template.cfg."); - return str; - } - Tenum val = this->m[option_value[9*i + 1]]; + this->marker[i].assign(option_value[9 * i]); + // Check to see if the enum value is in the map + if (this->m.find(option_value[9 * i + 1]) == m.end()) { + string str; + str.append(this->name); + str.append(": invalid option value "); + str.append(option_value[0]); + str.append(". Check current SU2 options in config_template.cfg."); + return str; + } + Tenum val = this->m[option_value[9 * i + 1]]; this->field[i] = val; - istringstream ss_1st(option_value[9*i + 2]); + istringstream ss_1st(option_value[9 * i + 2]); if (!(ss_1st >> this->var1[i])) { return badValue("Giles BC", this->name); } - istringstream ss_2nd(option_value[9*i + 3]); + istringstream ss_2nd(option_value[9 * i + 3]); if (!(ss_2nd >> this->var2[i])) { return badValue("Giles BC", this->name); } - istringstream ss_3rd(option_value[9*i + 4]); + istringstream ss_3rd(option_value[9 * i + 4]); if (!(ss_3rd >> this->flowdir[i][0])) { return badValue("Giles BC", this->name); } - istringstream ss_4th(option_value[9*i + 5]); + istringstream ss_4th(option_value[9 * i + 5]); if (!(ss_4th >> this->flowdir[i][1])) { return badValue("Giles BC", this->name); } - istringstream ss_5th(option_value[9*i + 6]); + istringstream ss_5th(option_value[9 * i + 6]); if (!(ss_5th >> this->flowdir[i][2])) { return badValue("Giles BC", this->name); } - istringstream ss_6th(option_value[9*i + 7]); + istringstream ss_6th(option_value[9 * i + 7]); if (!(ss_6th >> this->relfac1[i])) { return badValue("Giles BC", this->name); } - istringstream ss_7th(option_value[9*i + 8]); + istringstream ss_7th(option_value[9 * i + 8]); if (!(ss_7th >> this->relfac2[i])) { return badValue("Giles BC", this->name); } @@ -1421,25 +1425,21 @@ public: this->relfac1 = nullptr; this->relfac2 = nullptr; this->flowdir = nullptr; - this->size = 0; // There is no default value for list + this->size = 0; // There is no default value for list } }; class COptionExhaust : public COptionBase { - string name; // identifier for the option + string name; // identifier for the option unsigned short& size; string*& marker; su2double*& ttotal; su2double*& ptotal; -public: - COptionExhaust(string option_field_name, unsigned short& nMarker_Exhaust, string*& Marker_Exhaust, - su2double*& Ttotal, su2double*& Ptotal) - : name(option_field_name), - size(nMarker_Exhaust), - marker(Marker_Exhaust), - ttotal(Ttotal), - ptotal(Ptotal) { + public: + COptionExhaust(string option_field_name, unsigned short& nMarker_Exhaust, string*& Marker_Exhaust, su2double*& Ttotal, + su2double*& Ptotal) + : name(option_field_name), size(nMarker_Exhaust), marker(Marker_Exhaust), ttotal(Ttotal), ptotal(Ptotal) { size = 0; marker = nullptr; ttotal = nullptr; @@ -1472,12 +1472,12 @@ public: ptotal = new su2double[nVals]; for (unsigned short i = 0; i < nVals; i++) { - this->marker[i].assign(option_value[3*i]); + this->marker[i].assign(option_value[3 * i]); - istringstream ss_1st(option_value[3*i + 1]); + istringstream ss_1st(option_value[3 * i + 1]); if (!(ss_1st >> ttotal[i])) return badValue("exhaust fixed", name); - istringstream ss_2nd(option_value[3*i + 2]); + istringstream ss_2nd(option_value[3 * i + 2]); if (!(ss_2nd >> ptotal[i])) return badValue("exhaust fixed", name); } return ""; @@ -1487,7 +1487,7 @@ public: }; class COptionPeriodic : public COptionBase { - string name; // identifier for the option + string name; // identifier for the option unsigned short& size; string*& marker_bound; string*& marker_donor; @@ -1495,16 +1495,16 @@ class COptionPeriodic : public COptionBase { su2double**& rot_angles; su2double**& translation; -public: + public: COptionPeriodic(const string option_field_name, unsigned short& nMarker_PerBound, string*& Marker_PerBound, string*& Marker_PerDonor, su2double**& RotCenter, su2double**& RotAngles, su2double**& Translation) - : name(option_field_name), - size(nMarker_PerBound), - marker_bound(Marker_PerBound), - marker_donor(Marker_PerDonor), - rot_center(RotCenter), - rot_angles(RotAngles), - translation(Translation) { + : name(option_field_name), + size(nMarker_PerBound), + marker_bound(Marker_PerBound), + marker_donor(Marker_PerDonor), + rot_center(RotCenter), + rot_angles(RotAngles), + translation(Translation) { size = 0; COptionPeriodic::SetDefault(); } @@ -1535,7 +1535,7 @@ public: return name + ": must have a number of entries divisible by 11"; } - const unsigned short nVals = 2 * (totalVals / mod_num); // "2" to account for periodic and donor + const unsigned short nVals = 2 * (totalVals / mod_num); // "2" to account for periodic and donor size = nVals; marker_bound = new string[nVals]; marker_donor = new string[nVals]; @@ -1548,43 +1548,43 @@ public: translation[i] = new su2double[3]; } - const su2double deg2rad = PI_NUMBER/180.0; + const su2double deg2rad = PI_NUMBER / 180.0; bool err = false; auto getval = [&](unsigned short i, unsigned short j) { - istringstream ss(option_value[mod_num*i + j]); + istringstream ss(option_value[mod_num * i + j]); su2double val; if (!(ss >> val)) err = true; return val; }; for (unsigned short i = 0; i < nVals / 2; i++) { - marker_bound[i].assign(option_value[mod_num*i]); - marker_donor[i].assign(option_value[mod_num*i+1]); + marker_bound[i].assign(option_value[mod_num * i]); + marker_donor[i].assign(option_value[mod_num * i + 1]); /*--- Mirror the connection between markers. ---*/ - marker_bound[i+nVals/2] = marker_donor[i]; - marker_donor[i+nVals/2] = marker_bound[i]; + marker_bound[i + nVals / 2] = marker_donor[i]; + marker_donor[i + nVals / 2] = marker_bound[i]; - rot_center[i][0] = rot_center[i+nVals/2][0] = getval(i, 2); - rot_center[i][1] = rot_center[i+nVals/2][1] = getval(i, 3); - rot_center[i][2] = rot_center[i+nVals/2][2] = getval(i, 4); + rot_center[i][0] = rot_center[i + nVals / 2][0] = getval(i, 2); + rot_center[i][1] = rot_center[i + nVals / 2][1] = getval(i, 3); + rot_center[i][2] = rot_center[i + nVals / 2][2] = getval(i, 4); - rot_angles[i][0] = rot_angles[i+nVals/2][0] = getval(i, 5) * deg2rad; - rot_angles[i][1] = rot_angles[i+nVals/2][1] = getval(i, 6) * deg2rad; - rot_angles[i][2] = rot_angles[i+nVals/2][2] = getval(i, 7) * deg2rad; + rot_angles[i][0] = rot_angles[i + nVals / 2][0] = getval(i, 5) * deg2rad; + rot_angles[i][1] = rot_angles[i + nVals / 2][1] = getval(i, 6) * deg2rad; + rot_angles[i][2] = rot_angles[i + nVals / 2][2] = getval(i, 7) * deg2rad; - translation[i][0] = translation[i+nVals/2][0] = getval(i, 8); - translation[i][1] = translation[i+nVals/2][1] = getval(i, 9); - translation[i][2] = translation[i+nVals/2][2] = getval(i, 10); + translation[i][0] = translation[i + nVals / 2][0] = getval(i, 8); + translation[i][1] = translation[i + nVals / 2][1] = getval(i, 9); + translation[i][2] = translation[i + nVals / 2][2] = getval(i, 10); /*--- Mirror the rotational angles and translation vector (rotational center does not need to move). ---*/ - rot_angles[i+nVals/2][0] *= -1; - rot_angles[i+nVals/2][1] *= -1; - rot_angles[i+nVals/2][2] *= -1; - translation[i+nVals/2][0] *= -1; - translation[i+nVals/2][1] *= -1; - translation[i+nVals/2][2] *= -1; + rot_angles[i + nVals / 2][0] *= -1; + rot_angles[i + nVals / 2][1] *= -1; + rot_angles[i + nVals / 2][2] *= -1; + translation[i + nVals / 2][0] *= -1; + translation[i + nVals / 2][1] *= -1; + translation[i + nVals / 2][2] *= -1; if (err) return badValue("periodic", name); } @@ -1602,18 +1602,19 @@ public: }; class COptionTurboPerformance : public COptionBase { - string name; // identifier for the option - unsigned short & size; - string * & marker_turboIn; - string * & marker_turboOut; - -public: - COptionTurboPerformance(const string option_field_name, unsigned short & nMarker_TurboPerf, - string* & Marker_TurboBoundIn, string* & Marker_TurboBoundOut) : size(nMarker_TurboPerf), marker_turboIn(Marker_TurboBoundIn), marker_turboOut(Marker_TurboBoundOut){ + string name; // identifier for the option + unsigned short& size; + string*& marker_turboIn; + string*& marker_turboOut; + + public: + COptionTurboPerformance(const string option_field_name, unsigned short& nMarker_TurboPerf, + string*& Marker_TurboBoundIn, string*& Marker_TurboBoundOut) + : size(nMarker_TurboPerf), marker_turboIn(Marker_TurboBoundIn), marker_turboOut(Marker_TurboBoundOut) { this->name = option_field_name; } - ~COptionTurboPerformance() override {}; + ~COptionTurboPerformance() override{}; string SetValue(const vector& option_value) override { COptionBase::SetValue(option_value); const int mod_num = 2; @@ -1621,7 +1622,7 @@ public: unsigned long totalVals = option_value.size(); if ((totalVals == 1) && (option_value[0].compare("NONE") == 0)) { this->size = 0; - this->marker_turboIn= nullptr; + this->marker_turboIn = nullptr; this->marker_turboOut = nullptr; return ""; } @@ -1631,8 +1632,9 @@ public: newstring.append(this->name); newstring.append(": must have a number of entries divisible by 2"); this->size = 0; - this->marker_turboIn= nullptr; - this->marker_turboOut = nullptr;; + this->marker_turboIn = nullptr; + this->marker_turboOut = nullptr; + ; return newstring; } @@ -1641,59 +1643,60 @@ public: this->marker_turboIn = new string[nVals]; this->marker_turboOut = new string[nVals]; for (unsigned long i = 0; i < nVals; i++) { - this->marker_turboIn[i].assign(option_value[mod_num*i]); - this->marker_turboOut[i].assign(option_value[mod_num*i+1]); - } - + this->marker_turboIn[i].assign(option_value[mod_num * i]); + this->marker_turboOut[i].assign(option_value[mod_num * i + 1]); + } return ""; } void SetDefault() override { this->size = 0; - this->marker_turboIn= nullptr; + this->marker_turboIn = nullptr; this->marker_turboOut = nullptr; } }; class COptionPython : public COptionBase { string name; -public: - COptionPython(const string name) { - this->name = name; - } - ~COptionPython() override {}; + + public: + COptionPython(const string name) { this->name = name; } + ~COptionPython() override{}; // No checking happens with python options string SetValue(const vector& option_value) override { COptionBase::SetValue(option_value); return ""; } // No defaults with python options - void SetDefault() override { - return; - }; + void SetDefault() override { return; }; }; class COptionActDisk : public COptionBase { - string name; // identifier for the option - unsigned short & inlet_size; - unsigned short & outlet_size; - string * & marker_inlet; - string * & marker_outlet; - su2double ** & press_jump; - su2double ** & temp_jump; - su2double ** & omega; - -public: - COptionActDisk(const string name, - unsigned short & nMarker_ActDiskInlet, unsigned short & nMarker_ActDiskOutlet, string * & Marker_ActDiskInlet, string * & Marker_ActDiskOutlet, - su2double ** & ActDisk_PressJump, su2double ** & ActDisk_TempJump, su2double ** & ActDisk_Omega) : - inlet_size(nMarker_ActDiskInlet), outlet_size(nMarker_ActDiskOutlet), marker_inlet(Marker_ActDiskInlet), marker_outlet(Marker_ActDiskOutlet), - press_jump(ActDisk_PressJump), temp_jump(ActDisk_TempJump), omega(ActDisk_Omega) { + string name; // identifier for the option + unsigned short& inlet_size; + unsigned short& outlet_size; + string*& marker_inlet; + string*& marker_outlet; + su2double**& press_jump; + su2double**& temp_jump; + su2double**& omega; + + public: + COptionActDisk(const string name, unsigned short& nMarker_ActDiskInlet, unsigned short& nMarker_ActDiskOutlet, + string*& Marker_ActDiskInlet, string*& Marker_ActDiskOutlet, su2double**& ActDisk_PressJump, + su2double**& ActDisk_TempJump, su2double**& ActDisk_Omega) + : inlet_size(nMarker_ActDiskInlet), + outlet_size(nMarker_ActDiskOutlet), + marker_inlet(Marker_ActDiskInlet), + marker_outlet(Marker_ActDiskOutlet), + press_jump(ActDisk_PressJump), + temp_jump(ActDisk_TempJump), + omega(ActDisk_Omega) { this->name = name; } - ~COptionActDisk() override {}; + ~COptionActDisk() override{}; string SetValue(const vector& option_value) override { COptionBase::SetValue(option_value); const int mod_num = 8; @@ -1729,29 +1732,29 @@ public: string tname = "actuator disk"; for (int i = 0; i < this->inlet_size; i++) { - this->marker_inlet[i].assign(option_value[mod_num*i]); - this->marker_outlet[i].assign(option_value[mod_num*i+1]); - istringstream ss_1st(option_value[mod_num*i + 2]); + this->marker_inlet[i].assign(option_value[mod_num * i]); + this->marker_outlet[i].assign(option_value[mod_num * i + 1]); + istringstream ss_1st(option_value[mod_num * i + 2]); if (!(ss_1st >> this->press_jump[i][0])) { return badValue(tname, this->name); } - istringstream ss_2nd(option_value[mod_num*i + 3]); + istringstream ss_2nd(option_value[mod_num * i + 3]); if (!(ss_2nd >> this->temp_jump[i][0])) { return badValue(tname, this->name); } - istringstream ss_3rd(option_value[mod_num*i + 4]); + istringstream ss_3rd(option_value[mod_num * i + 4]); if (!(ss_3rd >> this->omega[i][0])) { return badValue(tname, this->name); } - istringstream ss_4th(option_value[mod_num*i + 5]); + istringstream ss_4th(option_value[mod_num * i + 5]); if (!(ss_4th >> this->press_jump[i][1])) { return badValue(tname, this->name); } - istringstream ss_5th(option_value[mod_num*i + 6]); + istringstream ss_5th(option_value[mod_num * i + 6]); if (!(ss_5th >> this->temp_jump[i][1])) { return badValue(tname, this->name); } - istringstream ss_6th(option_value[mod_num*i + 7]); + istringstream ss_6th(option_value[mod_num * i + 7]); if (!(ss_6th >> this->omega[i][1])) { return badValue(tname, this->name); } @@ -1770,22 +1773,22 @@ public: }; class COptionWallFunction : public COptionBase { - string name; // identifier for the option + string name; // identifier for the option unsigned short& nMarkers; string*& markers; WALL_FUNCTIONS*& walltype; unsigned short**& intInfo; su2double**& doubleInfo; -public: + public: COptionWallFunction(const string name_WF, unsigned short& nMarker_WF, string*& Marker_WF, WALL_FUNCTIONS*& type_WF, unsigned short**& intInfo_WF, su2double**& doubleInfo_WF) - : name(name_WF), - nMarkers(nMarker_WF), - markers(Marker_WF), - walltype(type_WF), - intInfo(intInfo_WF), - doubleInfo(doubleInfo_WF) { + : name(name_WF), + nMarkers(nMarker_WF), + markers(Marker_WF), + walltype(type_WF), + intInfo(intInfo_WF), + doubleInfo(doubleInfo_WF) { nMarkers = 0; COptionWallFunction::SetDefault(); } @@ -1813,8 +1816,7 @@ public: /*--- Determine the number of markers, for which a wall function treatment has been specified. ---*/ unsigned short counter = 0, nVals = 0; - while (counter < totalSize ) { - + while (counter < totalSize) { /* Update the counter for the number of markers specified and store the current index for possible error messages. */ ++nVals; @@ -1826,17 +1828,18 @@ public: const unsigned short indWallType = counter; auto typeWF = WALL_FUNCTIONS::NONE; bool validWF = true; - if (counter == totalSize) validWF = false; + if (counter == totalSize) + validWF = false; else { map::const_iterator it; it = Wall_Functions_Map.find(option_value[counter]); - if(it == Wall_Functions_Map.end()) + if (it == Wall_Functions_Map.end()) validWF = false; else - typeWF = it->second; + typeWF = it->second; } - if (!validWF ) { + if (!validWF) { string newstring; newstring.append(this->name); newstring.append(": Invalid wall function type, "); @@ -1852,11 +1855,18 @@ public: /*--- For some wall function types some additional info must be specified. Hence the counter must be updated accordingly. ---*/ - switch( typeWF ) { - case WALL_FUNCTIONS::EQUILIBRIUM_MODEL: counter += 3; break; - case WALL_FUNCTIONS::NONEQUILIBRIUM_MODEL: counter += 2; break; - case WALL_FUNCTIONS::LOGARITHMIC_MODEL: counter += 3; break; - default: break; + switch (typeWF) { + case WALL_FUNCTIONS::EQUILIBRIUM_MODEL: + counter += 3; + break; + case WALL_FUNCTIONS::NONEQUILIBRIUM_MODEL: + counter += 2; + break; + case WALL_FUNCTIONS::LOGARITHMIC_MODEL: + counter += 3; + break; + default: + break; } /* In case the counter is larger than totalSize, the data for @@ -1874,17 +1884,16 @@ public: } /* Allocate the memory to store the data for the wall function markers. */ - this->nMarkers = nVals; - this->markers = new string[nVals]; - this->walltype = new WALL_FUNCTIONS[nVals]; - this->intInfo = new unsigned short*[nVals](); + this->nMarkers = nVals; + this->markers = new string[nVals]; + this->walltype = new WALL_FUNCTIONS[nVals]; + this->intInfo = new unsigned short*[nVals](); this->doubleInfo = new su2double*[nVals](); /*--- Loop over the wall markers and store the info in the appropriate arrays. ---*/ counter = 0; - for (unsigned short i=0; imarkers[i].assign(option_value[counter++]); @@ -1897,13 +1906,11 @@ public: /*--- For some wall function types, some additional info is needed, which is extracted from option_value. ---*/ - switch( this->walltype[i] ) { - + switch (this->walltype[i]) { case WALL_FUNCTIONS::EQUILIBRIUM_MODEL: { - /* LES equilibrium wall model. The exchange distance, stretching factor and number of points in the wall model must be specified. */ - this->intInfo[i] = new unsigned short[1]; + this->intInfo[i] = new unsigned short[1]; this->doubleInfo[i] = new su2double[2]; istringstream ss_1st(option_value[counter++]); @@ -1925,24 +1932,23 @@ public: } case WALL_FUNCTIONS::NONEQUILIBRIUM_MODEL: { - /* LES non-equilibrium model. The RANS turbulence model and the exchange distance need to be specified. */ - this->intInfo[i] = new unsigned short[1]; + this->intInfo[i] = new unsigned short[1]; this->doubleInfo[i] = new su2double[1]; /* Check for a valid RANS turbulence model. */ map::const_iterator iit; iit = Turb_Model_Map.find(option_value[counter++]); - if(iit == Turb_Model_Map.end()) { + if (iit == Turb_Model_Map.end()) { string newstring; newstring.append(this->name); newstring.append(", marker "); newstring.append(this->markers[i]); newstring.append(", wall function type "); - newstring.append(option_value[counter-2]); + newstring.append(option_value[counter - 2]); newstring.append(": Invalid RANS turbulence model, "); - newstring.append(option_value[counter-1]); + newstring.append(option_value[counter - 1]); newstring.append(", specified"); return newstring; } @@ -1956,10 +1962,9 @@ public: break; } case WALL_FUNCTIONS::LOGARITHMIC_MODEL: { - /* LES Logarithmic law-of-the-wall model. The exchange distance, stretching factor and number of points in the wall model must be specified. */ - this->intInfo[i] = new unsigned short[1]; + this->intInfo[i] = new unsigned short[1]; this->doubleInfo[i] = new su2double[2]; istringstream ss_1st(option_value[counter++]); @@ -1980,7 +1985,7 @@ public: break; } - default: // Just to avoid a compiler warning. + default: // Just to avoid a compiler warning. break; } } diff --git a/Common/include/parallelization/mpi_structure.cpp b/Common/include/parallelization/mpi_structure.cpp index cd8eae4d5f0..bdb92c65db2 100644 --- a/Common/include/parallelization/mpi_structure.cpp +++ b/Common/include/parallelization/mpi_structure.cpp @@ -2,7 +2,7 @@ * \file mpi_structure.cpp * \brief Main subroutines for the mpi structures. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,8 +26,7 @@ */ #include "mpi_structure.hpp" -#include // memcpy - +#include // memcpy /* Initialise the MPI Communicator Rank and Size */ int CBaseMPIWrapper::Rank = 0; @@ -41,12 +40,11 @@ CBaseMPIWrapper::Comm CBaseMPIWrapper::currentComm = 0; // dummy value #endif #ifdef HAVE_MPI -int CBaseMPIWrapper::MinRankError; +int CBaseMPIWrapper::MinRankError; bool CBaseMPIWrapper::winMinRankErrorInUse = false; CBaseMPIWrapper::Win CBaseMPIWrapper::winMinRankError; -void CBaseMPIWrapper::Error(std::string ErrorMsg, std::string FunctionName){ - +void CBaseMPIWrapper::Error(const std::string& ErrorMsg, const std::string& FunctionName) { /* Set MinRankError to Rank, as the error message is called on this rank. */ MinRankError = Rank; int flag = 0; @@ -58,13 +56,12 @@ void CBaseMPIWrapper::Error(std::string ErrorMsg, std::string FunctionName){ /* Try to complete the non-blocking barrier call for a second. */ double startTime = SU2_MPI::Wtime(); - while( true ) { - + while (true) { MPI_Test(&barrierRequest, &flag, MPI_STATUS_IGNORE); - if( flag ) break; + if (flag) break; double currentTime = SU2_MPI::Wtime(); - if(currentTime > startTime + 1.0) break; + if (currentTime > startTime + 1.0) break; } #else /* MPI_Ibarrier function is not supported. Simply wait for one @@ -76,23 +73,21 @@ void CBaseMPIWrapper::Error(std::string ErrorMsg, std::string FunctionName){ #endif #endif - if( flag ) { + if (flag) { /* The barrier is completed and hence the error call is collective. Set MinRankError to 0. */ MinRankError = 0; - } - else { + } else { /* The error call is not collective and the minimum rank must be determined by one sided communication. Loop over the lower numbered ranks to check if they participate in the error message. */ - for(int i=0; i(recvbuf)[i+recvshift] = static_cast(sendbuf)[i+sendshift]; + static_cast(recvbuf)[i + recvshift] = static_cast(sendbuf)[i + sendshift]; } } else { int scalarsize; MPI_Type_size(datatype, &scalarsize); - const char* src = static_cast(sendbuf) + sendshift*static_cast(scalarsize); - char* dest = static_cast(recvbuf) + recvshift*static_cast(scalarsize); - std::memcpy(static_cast(dest), static_cast(src), size*static_cast(scalarsize)); + const char* src = static_cast(sendbuf) + sendshift * static_cast(scalarsize); + char* dest = static_cast(recvbuf) + recvshift * static_cast(scalarsize); + std::memcpy(static_cast(dest), static_cast(src), size * static_cast(scalarsize)); } } -#else // HAVE_MPI +#else // HAVE_MPI -void CBaseMPIWrapper::Error(std::string ErrorMsg, std::string FunctionName){ - if (Rank == 0){ +void CBaseMPIWrapper::Error(std::string ErrorMsg, std::string FunctionName) { + if (Rank == 0) { std::cout << std::endl << std::endl; std::cout << "Error in \"" << FunctionName << "\": " << std::endl; - std::cout << "-------------------------------------------------------------------------" << std::endl; + std::cout << "-------------------------------------------------------------------------" << std::endl; std::cout << ErrorMsg << std::endl; - std::cout << "------------------------------ Error Exit -------------------------------" << std::endl; + std::cout << "------------------------------ Error Exit -------------------------------" << std::endl; std::cout << std::endl << std::endl; } Abort(currentComm, 0); } -void CBaseMPIWrapper::CopyData(const void* sendbuf, void* recvbuf, int size, Datatype datatype, int recvshift, int sendshift) { +void CBaseMPIWrapper::CopyData(const void* sendbuf, void* recvbuf, int size, Datatype datatype, int recvshift, + int sendshift) { switch (datatype) { case MPI_DOUBLE: for (int i = 0; i < size; i++) { - static_cast(recvbuf)[i+recvshift] = static_cast(sendbuf)[i+sendshift]; + static_cast(recvbuf)[i + recvshift] = static_cast(sendbuf)[i + sendshift]; } break; case MPI_UNSIGNED_LONG: for (int i = 0; i < size; i++) { - static_cast(recvbuf)[i+recvshift] = static_cast(sendbuf)[i+sendshift]; + static_cast(recvbuf)[i + recvshift] = static_cast(sendbuf)[i + sendshift]; } break; case MPI_LONG: for (int i = 0; i < size; i++) { - static_cast(recvbuf)[i+recvshift] = static_cast(sendbuf)[i+sendshift]; + static_cast(recvbuf)[i + recvshift] = static_cast(sendbuf)[i + sendshift]; } break; case MPI_UNSIGNED_SHORT: for (int i = 0; i < size; i++) { - static_cast(recvbuf)[i+recvshift] = static_cast(sendbuf)[i+sendshift]; + static_cast(recvbuf)[i + recvshift] = + static_cast(sendbuf)[i + sendshift]; } break; case MPI_CHAR: for (int i = 0; i < size; i++) { - static_cast(recvbuf)[i+recvshift] = static_cast(sendbuf)[i+sendshift]; + static_cast(recvbuf)[i + recvshift] = static_cast(sendbuf)[i + sendshift]; } break; case MPI_SHORT: for (int i = 0; i < size; i++) { - static_cast(recvbuf)[i+recvshift] = static_cast(sendbuf)[i+sendshift]; + static_cast(recvbuf)[i + recvshift] = static_cast(sendbuf)[i + sendshift]; } break; case MPI_INT: for (int i = 0; i < size; i++) { - static_cast(recvbuf)[i+recvshift] = static_cast(sendbuf)[i+sendshift]; + static_cast(recvbuf)[i + recvshift] = static_cast(sendbuf)[i + sendshift]; } break; default: @@ -186,6 +184,6 @@ void CBaseMPIWrapper::CopyData(const void* sendbuf, void* recvbuf, int size, Dat #if defined CODI_REVERSE_TYPE || defined CODI_FORWARD_TYPE MediTypes* mediTypes; #include -#endif // defined CODI_REVERSE_TYPE || defined CODI_FORWARD_TYPE +#endif // defined CODI_REVERSE_TYPE || defined CODI_FORWARD_TYPE -#endif // HAVE_MPI +#endif // HAVE_MPI diff --git a/Common/include/parallelization/mpi_structure.hpp b/Common/include/parallelization/mpi_structure.hpp index 462c3c74980..6bce34788b4 100644 --- a/Common/include/parallelization/mpi_structure.hpp +++ b/Common/include/parallelization/mpi_structure.hpp @@ -3,7 +3,7 @@ * \brief Headers of the mpi interface for generalized datatypes. * The subroutines and functions are in the mpi_structure.cpp file. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -68,12 +68,12 @@ #include using namespace medi; -#include +#include class CMediMPIWrapper; typedef CMediMPIWrapper SU2_MPI; -typedef CoDiMpiTypes MediTypes; +typedef codi::CoDiMpiTypes MediTypes; typedef MediTypes::Tool MediTool; extern MediTypes* mediTypes; @@ -105,9 +105,10 @@ class CBaseMPIWrapper { static Win winMinRankError; public: - static void CopyData(const void* sendbuf, void* recvbuf, int size, Datatype datatype, int recvshift=0, int sendshift=0); + static void CopyData(const void* sendbuf, void* recvbuf, int size, Datatype datatype, int recvshift = 0, + int sendshift = 0); - static void Error(std::string ErrorMsg, std::string FunctionName); + static void Error(const std::string& ErrorMsg, const std::string& FunctionName); static inline int GetRank() { return Rank; } @@ -174,7 +175,7 @@ class CBaseMPIWrapper { static inline void Wait(Request* request, Status* status) { MPI_Wait(request, status); } - static inline int Request_free(Request *request) { return MPI_Request_free(request); } + static inline int Request_free(Request* request) { return MPI_Request_free(request); } static inline void Testall(int count, Request* array_of_requests, int* flag, Status* array_of_statuses) { MPI_Testall(count, array_of_requests, flag, array_of_statuses); @@ -377,7 +378,7 @@ class CMediMPIWrapper : public CBaseMPIWrapper { static inline void Wait(SU2_MPI::Request* request, Status* status) { AMPI_Wait(request, status); } - static inline int Request_free(Request *request) { return AMPI_Request_free(request); } + static inline int Request_free(Request* request) { return AMPI_Request_free(request); } static inline void Testall(int count, Request* array_of_requests, int* flag, Status* array_of_statuses) { AMPI_Testall(count, array_of_requests, flag, array_of_statuses); @@ -506,7 +507,8 @@ class CBaseMPIWrapper { static Comm currentComm; public: - static void CopyData(const void* sendbuf, void* recvbuf, int size, Datatype datatype, int recvshift=0, int sendshift=0); + static void CopyData(const void* sendbuf, void* recvbuf, int size, Datatype datatype, int recvshift = 0, + int sendshift = 0); static void Error(std::string ErrorMsg, std::string FunctionName); @@ -539,7 +541,7 @@ class CBaseMPIWrapper { static inline void Wait(Request* request, Status* status) {} - static inline int Request_free(Request *request) { return 0; } + static inline int Request_free(Request* request) { return 0; } static inline void Waitall(int nrequests, Request* request, Status* status) {} diff --git a/Common/include/parallelization/omp_structure.cpp b/Common/include/parallelization/omp_structure.cpp index 2732eb91ab3..6e5161ea426 100644 --- a/Common/include/parallelization/omp_structure.cpp +++ b/Common/include/parallelization/omp_structure.cpp @@ -3,7 +3,7 @@ * \brief Source file counterpart for omp_structure.hpp. * \note Contains OpDiLib initialization, finalization and includes the OpDiLib source file. * \author J. Blühdorn - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -36,8 +36,7 @@ void omp_initialize() { #endif opdi::logic = new opdi::OmpLogic; opdi::logic->init(); - su2double::getGlobalTape().initialize(); - opdi::tool = new CoDiOpDiTool; + opdi::tool = new CoDiOpDiLibTool; opdi::tool->init(); #endif } @@ -45,7 +44,6 @@ void omp_initialize() { void omp_finalize() { #ifdef HAVE_OPDI opdi::tool->finalize(); - su2double::getGlobalTape().finalize(); opdi::logic->finalize(); opdi::backend->finalize(); delete opdi::tool; diff --git a/Common/include/parallelization/omp_structure.hpp b/Common/include/parallelization/omp_structure.hpp index 78d92858052..2ba94e99e2a 100644 --- a/Common/include/parallelization/omp_structure.hpp +++ b/Common/include/parallelization/omp_structure.hpp @@ -13,7 +13,7 @@ * defined here with suitable fallback versions to limit the spread of * compiler tricks in other areas of the code. * \author P. Gomes, J. Blühdorn - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -57,14 +57,13 @@ #else #include "opdi/backend/macro/macroBackend.hpp" #endif -#include "codi/externals/codiOpdiTool.hpp" #include "opdi.hpp" #endif /*--- The generic start of OpenMP constructs. ---*/ #define SU2_OMP(ARGS) PRAGMIZE(omp ARGS) -#else // Compile without OpenMP +#else // Compile without OpenMP #include /*--- Disable pragmas to quiet compilation warnings. ---*/ @@ -73,32 +72,32 @@ /*! * \brief Maximum number of threads available. */ -inline constexpr int omp_get_max_threads() {return 1;} +inline constexpr int omp_get_max_threads() { return 1; } /*! * \brief Number of threads in current team. */ -inline constexpr int omp_get_num_threads() {return 1;} +inline constexpr int omp_get_num_threads() { return 1; } /*! * \brief Set the maximum number of threads. */ -inline void omp_set_num_threads(int) { } +inline void omp_set_num_threads(int) {} /*! * \brief Index of current thread, akin to MPI rank. */ -inline constexpr int omp_get_thread_num() {return 0;} +inline constexpr int omp_get_thread_num() { return 0; } /*! * \brief Returns true if inside a parallel section. */ -inline constexpr bool omp_in_parallel() {return false;} +inline constexpr bool omp_in_parallel() { return false; } /*! * \brief Return the wall time. */ -inline passivedouble omp_get_wtime() {return passivedouble(clock()) / CLOCKS_PER_SEC;} +inline passivedouble omp_get_wtime() { return passivedouble(clock()) / CLOCKS_PER_SEC; } /*! * \brief Dummy lock type and associated functions. @@ -106,14 +105,14 @@ inline passivedouble omp_get_wtime() {return passivedouble(clock()) / CLOCKS_PER struct omp_lock_t {}; struct DummyVectorOfLocks { omp_lock_t l; - inline omp_lock_t& operator[](int) {return l;} + inline omp_lock_t& operator[](int) { return l; } }; -inline void omp_init_lock(omp_lock_t*){} -inline void omp_set_lock(omp_lock_t*){} -inline void omp_unset_lock(omp_lock_t*){} -inline void omp_destroy_lock(omp_lock_t*){} +inline void omp_init_lock(omp_lock_t*) {} +inline void omp_set_lock(omp_lock_t*) {} +inline void omp_unset_lock(omp_lock_t*) {} +inline void omp_destroy_lock(omp_lock_t*) {} -#endif // end OpenMP detection +#endif // end OpenMP detection /*--- Initialization and finalization ---*/ @@ -173,8 +172,8 @@ void omp_finalize(); #define SU2_OMP_PARALLEL_ON(NTHREADS) OPDI_PARALLEL(num_threads(NTHREADS)) #define SU2_OMP_FOR_(ARGS) OPDI_FOR(ARGS) -#define SU2_OMP_FOR_DYN(CHUNK) OPDI_FOR(schedule(dynamic,CHUNK)) -#define SU2_OMP_FOR_STAT(CHUNK) OPDI_FOR(schedule(static,CHUNK)) +#define SU2_OMP_FOR_DYN(CHUNK) OPDI_FOR(schedule(dynamic, CHUNK)) +#define SU2_OMP_FOR_STAT(CHUNK) OPDI_FOR(schedule(static, CHUNK)) #define SU2_NOWAIT OPDI_NOWAIT @@ -189,36 +188,31 @@ void omp_finalize(); * thread, with all threads and memory views synchronized both beforehand and afterwards. */ -#define BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS \ - SU2_OMP_BARRIER \ +#define BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS \ + SU2_OMP_BARRIER \ + if (omp_in_parallel()) AD::StartNoSharedReading(); \ SU2_OMP_MASTER -#define END_SU2_OMP_SAFE_GLOBAL_ACCESS \ - END_SU2_OMP_MASTER \ +#define END_SU2_OMP_SAFE_GLOBAL_ACCESS \ + END_SU2_OMP_MASTER \ + if (omp_in_parallel()) AD::EndNoSharedReading(); \ SU2_OMP_BARRIER -#define SU2_OMP_SAFE_GLOBAL_ACCESS(...) \ - BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS \ - { \ - __VA_ARGS__ \ - } \ - END_SU2_OMP_SAFE_GLOBAL_ACCESS +#define SU2_OMP_SAFE_GLOBAL_ACCESS(...) BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS{__VA_ARGS__} END_SU2_OMP_SAFE_GLOBAL_ACCESS /*--- Convenience functions (e.g. to compute chunk sizes). ---*/ /*! * \brief Integer division rounding up. */ -inline constexpr size_t roundUpDiv(size_t numerator, size_t denominator) -{ - return (numerator+denominator-1)/denominator; +inline constexpr size_t roundUpDiv(size_t numerator, size_t denominator) { + return (numerator + denominator - 1) / denominator; } /*! * \brief Round up to next multiple. */ -inline constexpr size_t nextMultiple(size_t argument, size_t multiple) -{ +inline constexpr size_t nextMultiple(size_t argument, size_t multiple) { return roundUpDiv(argument, multiple) * multiple; } @@ -230,11 +224,8 @@ inline constexpr size_t nextMultiple(size_t argument, size_t multiple) * \param[in] maxChunkSize - Upper bound for chunk size. * \return The chunkSize. */ -inline size_t computeStaticChunkSize(size_t totalWork, - size_t numThreads, - size_t maxChunkSize) -{ - if(!totalWork) return maxChunkSize; +inline size_t computeStaticChunkSize(size_t totalWork, size_t numThreads, size_t maxChunkSize) { + if (!totalWork) return maxChunkSize; size_t workPerThread = roundUpDiv(totalWork, numThreads); size_t chunksPerThread = roundUpDiv(workPerThread, maxChunkSize); return roundUpDiv(workPerThread, chunksPerThread); @@ -246,11 +237,10 @@ inline size_t computeStaticChunkSize(size_t totalWork, * \param[in] src - Source array. * \param[in] dst - Destination array. */ -template -void parallelCopy(size_t size, const T* src, U* dst) -{ +template +void parallelCopy(size_t size, const T* src, U* dst) { SU2_OMP_FOR_STAT(2048) - for(size_t i=0; i -void parallelSet(size_t size, T val, U* dst) -{ +template +void parallelSet(size_t size, T val, U* dst) { SU2_OMP_FOR_STAT(2048) - for(size_t i=0; i::value> = 0> -inline void atomicAdd(T rhs, T& lhs) -{ +template ::value> = 0> +inline void atomicAdd(T rhs, T& lhs) { SU2_OMP_CRITICAL lhs += rhs; END_SU2_OMP_CRITICAL } -template::value> = 0> -inline void atomicAdd(T rhs, T& lhs) -{ +template ::value> = 0> +inline void atomicAdd(T rhs, T& lhs) { SU2_OMP_ATOMIC lhs += rhs; } diff --git a/Common/include/parallelization/special_vectorization.hpp b/Common/include/parallelization/special_vectorization.hpp index 5ab1830dd9e..722b6cd1346 100644 --- a/Common/include/parallelization/special_vectorization.hpp +++ b/Common/include/parallelization/special_vectorization.hpp @@ -2,7 +2,7 @@ * \file special_vectorization.hpp * \brief Code generator header to create specializations of simd::Array. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -42,16 +42,19 @@ * overload resolution will do the rest. The first four symbols are * undefined once we are done using them. */ -template<> +template <> class ARRAY_T { -#define FOREACH SU2_OMP_SIMD for(size_t k=0; k - FORCEINLINE static S second(F, S s) { return s; } -public: +#define FOREACH SU2_OMP_SIMD for (size_t k = 0; k < Size; ++k) + template + FORCEINLINE static S second(F, S s) { + return s; + } + + public: using Scalar = SCALAR_T; using Register = REGISTER_T; - enum : size_t {Align = alignof(Register)}; - enum : size_t {Size = sizeof(Register) / sizeof(Scalar)}; + enum : size_t { Align = alignof(Register) }; + enum : size_t { Size = sizeof(Register) / sizeof(Scalar) }; /*--- The infamous union "hack", sue me. ---*/ union { @@ -76,14 +79,22 @@ class ARRAY_T { FORCEINLINE void store(Scalar* ptr) const { storeu_p(ptr, reg); } FORCEINLINE void storea(Scalar* ptr) const { store_p(ptr, reg); } FORCEINLINE void stream(Scalar* ptr) const { stream_p(ptr, reg); } - template - FORCEINLINE void gather(const Scalar* begin, const T& offsets) { FOREACH x_[k] = begin[offsets[k]]; } + template + FORCEINLINE void gather(const Scalar* begin, const T& offsets) { + FOREACH x_[k] = begin[offsets[k]]; + } /*--- Compound assignement operators. ---*/ -#define MAKE_COMPOUND(OP,IMPL)\ - FORCEINLINE Array& operator OP (Scalar x) { reg = IMPL(reg, set1_p(SIZE_TAG, x)); return *this; }\ - FORCEINLINE Array& operator OP (const Array& other) noexcept { reg = IMPL(reg, other.reg); return *this; } +#define MAKE_COMPOUND(OP, IMPL) \ + FORCEINLINE Array& operator OP(Scalar x) { \ + reg = IMPL(reg, set1_p(SIZE_TAG, x)); \ + return *this; \ + } \ + FORCEINLINE Array& operator OP(const Array& other) noexcept { \ + reg = IMPL(reg, other.reg); \ + return *this; \ + } MAKE_COMPOUND(=, second) MAKE_COMPOUND(+=, add_p) MAKE_COMPOUND(-=, sub_p) @@ -98,8 +109,8 @@ class ARRAY_T { * SIMD overloads, NAME is the operator or function, * IMPL the intrinsic function that implements it. */ -#define MAKE_UNARY_FUN(NAME,IMPL)\ -FORCEINLINE ARRAY_T NAME(const ARRAY_T& x) {return IMPL(x.reg);} +#define MAKE_UNARY_FUN(NAME, IMPL) \ + FORCEINLINE ARRAY_T NAME(const ARRAY_T& x) { return IMPL(x.reg); } MAKE_UNARY_FUN(operator-, neg_p) MAKE_UNARY_FUN(sqrt, sqrt_p) @@ -108,16 +119,10 @@ MAKE_UNARY_FUN(sign, sign_p) #undef MAKE_UNARY_FUN -#define MAKE_BINARY_FUN(NAME,IMPL) \ -FORCEINLINE ARRAY_T NAME (const ARRAY_T& a, const ARRAY_T& b) { \ - return IMPL(a.reg, b.reg); \ -} \ -FORCEINLINE ARRAY_T NAME (const ARRAY_T& a, SCALAR_T b) { \ - return IMPL(a.reg, set1_p(SIZE_TAG, b)); \ -} \ -FORCEINLINE ARRAY_T NAME (SCALAR_T b, const ARRAY_T& a) { \ - return IMPL(set1_p(SIZE_TAG, b), a.reg); \ -} +#define MAKE_BINARY_FUN(NAME, IMPL) \ + FORCEINLINE ARRAY_T NAME(const ARRAY_T& a, const ARRAY_T& b) { return IMPL(a.reg, b.reg); } \ + FORCEINLINE ARRAY_T NAME(const ARRAY_T& a, SCALAR_T b) { return IMPL(a.reg, set1_p(SIZE_TAG, b)); } \ + FORCEINLINE ARRAY_T NAME(SCALAR_T b, const ARRAY_T& a) { return IMPL(set1_p(SIZE_TAG, b), a.reg); } MAKE_BINARY_FUN(operator+, add_p) MAKE_BINARY_FUN(operator-, sub_p) @@ -137,29 +142,37 @@ MAKE_BINARY_FUN(fmin, min_p) /*! * Compatibility mode overloads, element-wise implementation. */ -#define FOREACH SU2_OMP_SIMD for(size_t k=0; k -constexpr size_t preferredLen() { return PREFERRED_SIZE / sizeof(T); } +template +constexpr size_t preferredLen() { + return PREFERRED_SIZE / sizeof(T); +} -template<> +template <> constexpr size_t preferredLen() { #ifdef CODI_REVERSE_TYPE /*--- Use a SIMD size of 1 for reverse AD, larger sizes increase @@ -80,54 +82,72 @@ constexpr size_t preferredLen() { * specializations do not use expression templates, IF YOU NEED A NEW FUNCTION, * define it both in vector_expressions.hpp and in special_vectorization.hpp. */ -template()> -class Array : public CVecExpr, Scalar_t> { -#define FOREACH for(size_t k=0; k()> +class Array : public CVecExpr, Scalar_t> { +#define FOREACH for (size_t k = 0; k < N; ++k) static_assert(N > 0, "Invalid SIMD size"); -public: + + public: using Scalar = Scalar_t; - enum : size_t {Size = N}; - enum : size_t {Align = Size*sizeof(Scalar)}; + enum : size_t { Size = N }; + enum : size_t { Align = Size * sizeof(Scalar) }; static constexpr bool StoreAsRef = true; -private: - alignas(Size*sizeof(Scalar)) Scalar x_[N]; - -public: -#define ARRAY_BOILERPLATE \ - /*!--- Access elements ---*/ \ - FORCEINLINE Scalar& operator[] (size_t k) { return x_[k]; } \ - FORCEINLINE const Scalar& operator[] (size_t k) const { return x_[k]; } \ - /*!--- Constructors ---*/ \ - FORCEINLINE Array() = default; \ - FORCEINLINE Array(Scalar x) { bcast(x); } \ - FORCEINLINE Array(std::initializer_list vals) { \ - auto it = vals.begin(); FOREACH { x_[k] = *it; ++it; } \ - } \ - FORCEINLINE Array(Scalar x0, Scalar dx) { FOREACH x_[k] = x0 + k*dx; } \ - FORCEINLINE Array(const Scalar* ptr) { load(ptr); } \ - template \ - FORCEINLINE Array(const Scalar* beg, const T& off) { gather(beg,off); } \ - /*!--- Reduction operations ---*/ \ - FORCEINLINE Scalar sum() const { Scalar s(0); FOREACH { s+=x_[k]; } return s; } \ - FORCEINLINE Scalar dot(const Array& other) const { \ - Scalar s(0); FOREACH { s += x_[k] * other[k]; } return s; \ + private: + alignas(Size * sizeof(Scalar)) Scalar x_[N]; + + public: +#define ARRAY_BOILERPLATE \ + /*!--- Access elements ---*/ \ + FORCEINLINE Scalar& operator[](size_t k) { return x_[k]; } \ + FORCEINLINE const Scalar& operator[](size_t k) const { return x_[k]; } \ + /*!--- Constructors ---*/ \ + FORCEINLINE Array() = default; \ + FORCEINLINE Array(Scalar x) { bcast(x); } \ + FORCEINLINE Array(std::initializer_list vals) { \ + auto it = vals.begin(); \ + FOREACH { \ + x_[k] = *it; \ + ++it; \ + } \ + } \ + FORCEINLINE Array(Scalar x0, Scalar dx) { FOREACH x_[k] = x0 + k * dx; } \ + FORCEINLINE Array(const Scalar* ptr) { load(ptr); } \ + template \ + FORCEINLINE Array(const Scalar* beg, const T& off) { \ + gather(beg, off); \ + } \ + /*!--- Reduction operations ---*/ \ + FORCEINLINE Scalar sum() const { \ + Scalar s(0); \ + FOREACH { s += x_[k]; } \ + return s; \ + } \ + FORCEINLINE Scalar dot(const Array& other) const { \ + Scalar s(0); \ + FOREACH { s += x_[k] * other[k]; } \ + return s; \ } #if defined(CODI_REVERSE_TYPE) || defined(CODI_FORWARD_TYPE) /*--- These are not very nice but without them it would not be * possible to assign literals to Arrays of active types. ---*/ - template::value> = 0> - FORCEINLINE Array(passivedouble x) { bcast(x); } - template::value> = 0> - FORCEINLINE Array& operator= (passivedouble x) { bcast(x); return *this; } + template ::value> = 0> + FORCEINLINE Array(passivedouble x) { + bcast(x); + } + template ::value> = 0> + FORCEINLINE Array& operator=(passivedouble x) { + bcast(x); + return *this; + } #endif ARRAY_BOILERPLATE /*! \brief Copy construct from expression. */ - template - FORCEINLINE Array(const CVecExpr& expr) { + template + FORCEINLINE Array(const CVecExpr& expr) { FOREACH x_[k] = expr.derived()[k]; } @@ -139,16 +159,22 @@ class Array : public CVecExpr, Scalar_t> { FORCEINLINE void store(Scalar* ptr) const { FOREACH ptr[k] = x_[k]; } FORCEINLINE void storea(Scalar* ptr) const { store(ptr); } FORCEINLINE void stream(Scalar* ptr) const { store(ptr); } - template - FORCEINLINE void gather(const Scalar* begin, const T& offsets) { FOREACH x_[k] = begin[offsets[k]]; } + template + FORCEINLINE void gather(const Scalar* begin, const T& offsets) { + FOREACH x_[k] = begin[offsets[k]]; + } /*--- Compound assignment operators. ---*/ -#define MAKE_COMPOUND(OP) \ - FORCEINLINE Array& operator OP (Scalar x) { FOREACH { x_[k] OP x; } return *this; } \ - template \ - FORCEINLINE Array& operator OP (const CVecExpr& expr) { \ - FOREACH { x_[k] OP expr.derived()[k]; } return *this; \ +#define MAKE_COMPOUND(OP) \ + FORCEINLINE Array& operator OP(Scalar x) { \ + FOREACH { x_[k] OP x; } \ + return *this; \ + } \ + template \ + FORCEINLINE Array& operator OP(const CVecExpr& expr) { \ + FOREACH { x_[k] OP expr.derived()[k]; } \ + return *this; \ } MAKE_COMPOUND(=) MAKE_COMPOUND(+=) @@ -166,11 +192,11 @@ class Array : public CVecExpr, Scalar_t> { /*--- Size tags for overload resolution of some wrapper functions. ---*/ namespace SizeTag { - struct TWO {}; - struct FOUR {}; - struct EIGHT {}; - struct SIXTEEN {}; -} +struct TWO {}; +struct FOUR {}; +struct EIGHT {}; +struct SIXTEEN {}; +} // namespace SizeTag /*--- Constants for bitwise implementations. ---*/ /*--- abs forces the sign bit to 0 ("x" & 0b0111...). ---*/ @@ -182,7 +208,7 @@ constexpr auto sign_mask_d = 0x8000000000000000L; /*! * Create specialization for array of 2 doubles (this should be always available). */ -#define ARRAY_T Array +#define ARRAY_T Array #define SCALAR_T double #define REGISTER_T __m128d #define SIZE_TAG SizeTag::TWO() @@ -194,23 +220,23 @@ static const __m128d ones_2d = _mm_set1_pd(1); FORCEINLINE __m128d set1_p(SizeTag::TWO, double p) { return _mm_set1_pd(p); } FORCEINLINE __m128d load_p(SizeTag::TWO, const double* p) { return _mm_load_pd(p); } FORCEINLINE __m128d loadu_p(SizeTag::TWO, const double* p) { return _mm_loadu_pd(p); } -FORCEINLINE void store_p(double* p, __m128d x) { _mm_store_pd(p,x); } -FORCEINLINE void storeu_p(double* p, __m128d x) { _mm_storeu_pd(p,x); } -FORCEINLINE void stream_p(double* p, __m128d x) { _mm_stream_pd(p,x); } - -FORCEINLINE __m128d add_p(__m128d a, __m128d b) { return _mm_add_pd(a,b); } -FORCEINLINE __m128d sub_p(__m128d a, __m128d b) { return _mm_sub_pd(a,b); } -FORCEINLINE __m128d mul_p(__m128d a, __m128d b) { return _mm_mul_pd(a,b); } -FORCEINLINE __m128d div_p(__m128d a, __m128d b) { return _mm_div_pd(a,b); } -FORCEINLINE __m128d max_p(__m128d a, __m128d b) { return _mm_max_pd(a,b); } -FORCEINLINE __m128d min_p(__m128d a, __m128d b) { return _mm_min_pd(a,b); } - -FORCEINLINE __m128d eq_p(__m128d a, __m128d b) { return _mm_and_pd(ones_2d, _mm_cmpeq_pd(a,b)); } -FORCEINLINE __m128d lt_p(__m128d a, __m128d b) { return _mm_and_pd(ones_2d, _mm_cmplt_pd(a,b)); } -FORCEINLINE __m128d le_p(__m128d a, __m128d b) { return _mm_and_pd(ones_2d, _mm_cmple_pd(a,b)); } -FORCEINLINE __m128d ne_p(__m128d a, __m128d b) { return _mm_and_pd(ones_2d, _mm_cmpneq_pd(a,b)); } -FORCEINLINE __m128d ge_p(__m128d a, __m128d b) { return _mm_and_pd(ones_2d, _mm_cmpge_pd(a,b)); } -FORCEINLINE __m128d gt_p(__m128d a, __m128d b) { return _mm_and_pd(ones_2d, _mm_cmpgt_pd(a,b)); } +FORCEINLINE void store_p(double* p, __m128d x) { _mm_store_pd(p, x); } +FORCEINLINE void storeu_p(double* p, __m128d x) { _mm_storeu_pd(p, x); } +FORCEINLINE void stream_p(double* p, __m128d x) { _mm_stream_pd(p, x); } + +FORCEINLINE __m128d add_p(__m128d a, __m128d b) { return _mm_add_pd(a, b); } +FORCEINLINE __m128d sub_p(__m128d a, __m128d b) { return _mm_sub_pd(a, b); } +FORCEINLINE __m128d mul_p(__m128d a, __m128d b) { return _mm_mul_pd(a, b); } +FORCEINLINE __m128d div_p(__m128d a, __m128d b) { return _mm_div_pd(a, b); } +FORCEINLINE __m128d max_p(__m128d a, __m128d b) { return _mm_max_pd(a, b); } +FORCEINLINE __m128d min_p(__m128d a, __m128d b) { return _mm_min_pd(a, b); } + +FORCEINLINE __m128d eq_p(__m128d a, __m128d b) { return _mm_and_pd(ones_2d, _mm_cmpeq_pd(a, b)); } +FORCEINLINE __m128d lt_p(__m128d a, __m128d b) { return _mm_and_pd(ones_2d, _mm_cmplt_pd(a, b)); } +FORCEINLINE __m128d le_p(__m128d a, __m128d b) { return _mm_and_pd(ones_2d, _mm_cmple_pd(a, b)); } +FORCEINLINE __m128d ne_p(__m128d a, __m128d b) { return _mm_and_pd(ones_2d, _mm_cmpneq_pd(a, b)); } +FORCEINLINE __m128d ge_p(__m128d a, __m128d b) { return _mm_and_pd(ones_2d, _mm_cmpge_pd(a, b)); } +FORCEINLINE __m128d gt_p(__m128d a, __m128d b) { return _mm_and_pd(ones_2d, _mm_cmpgt_pd(a, b)); } FORCEINLINE __m128d sqrt_p(__m128d x) { return _mm_sqrt_pd(x); } FORCEINLINE __m128d abs_p(__m128d x) { return _mm_and_pd(x, abs_mask_2d); } @@ -222,13 +248,13 @@ FORCEINLINE __m128d sign_p(__m128d x) { return _mm_or_pd(ones_2d, _mm_and_pd(x, #include "special_vectorization.hpp" -#endif // __SSE2__ +#endif // __SSE2__ #ifdef __AVX__ /*! * Create specialization for array of 4 doubles. */ -#define ARRAY_T Array +#define ARRAY_T Array #define SCALAR_T double #define REGISTER_T __m256d #define SIZE_TAG SizeTag::FOUR() @@ -240,23 +266,23 @@ static const __m256d ones_4d = _mm256_set1_pd(1); FORCEINLINE __m256d set1_p(SizeTag::FOUR, double p) { return _mm256_set1_pd(p); } FORCEINLINE __m256d load_p(SizeTag::FOUR, const double* p) { return _mm256_load_pd(p); } FORCEINLINE __m256d loadu_p(SizeTag::FOUR, const double* p) { return _mm256_loadu_pd(p); } -FORCEINLINE void store_p(double* p, __m256d x) { _mm256_store_pd(p,x); } -FORCEINLINE void storeu_p(double* p, __m256d x) { _mm256_storeu_pd(p,x); } -FORCEINLINE void stream_p(double* p, __m256d x) { _mm256_stream_pd(p,x); } - -FORCEINLINE __m256d add_p(__m256d a, __m256d b) { return _mm256_add_pd(a,b); } -FORCEINLINE __m256d sub_p(__m256d a, __m256d b) { return _mm256_sub_pd(a,b); } -FORCEINLINE __m256d mul_p(__m256d a, __m256d b) { return _mm256_mul_pd(a,b); } -FORCEINLINE __m256d div_p(__m256d a, __m256d b) { return _mm256_div_pd(a,b); } -FORCEINLINE __m256d max_p(__m256d a, __m256d b) { return _mm256_max_pd(a,b); } -FORCEINLINE __m256d min_p(__m256d a, __m256d b) { return _mm256_min_pd(a,b); } - -FORCEINLINE __m256d eq_p(__m256d a, __m256d b) { return _mm256_and_pd(ones_4d, _mm256_cmp_pd(a,b,0)); } -FORCEINLINE __m256d lt_p(__m256d a, __m256d b) { return _mm256_and_pd(ones_4d, _mm256_cmp_pd(a,b,1)); } -FORCEINLINE __m256d le_p(__m256d a, __m256d b) { return _mm256_and_pd(ones_4d, _mm256_cmp_pd(a,b,2)); } -FORCEINLINE __m256d ne_p(__m256d a, __m256d b) { return _mm256_and_pd(ones_4d, _mm256_cmp_pd(a,b,4)); } -FORCEINLINE __m256d ge_p(__m256d a, __m256d b) { return _mm256_and_pd(ones_4d, _mm256_cmp_pd(a,b,13)); } -FORCEINLINE __m256d gt_p(__m256d a, __m256d b) { return _mm256_and_pd(ones_4d, _mm256_cmp_pd(a,b,14)); } +FORCEINLINE void store_p(double* p, __m256d x) { _mm256_store_pd(p, x); } +FORCEINLINE void storeu_p(double* p, __m256d x) { _mm256_storeu_pd(p, x); } +FORCEINLINE void stream_p(double* p, __m256d x) { _mm256_stream_pd(p, x); } + +FORCEINLINE __m256d add_p(__m256d a, __m256d b) { return _mm256_add_pd(a, b); } +FORCEINLINE __m256d sub_p(__m256d a, __m256d b) { return _mm256_sub_pd(a, b); } +FORCEINLINE __m256d mul_p(__m256d a, __m256d b) { return _mm256_mul_pd(a, b); } +FORCEINLINE __m256d div_p(__m256d a, __m256d b) { return _mm256_div_pd(a, b); } +FORCEINLINE __m256d max_p(__m256d a, __m256d b) { return _mm256_max_pd(a, b); } +FORCEINLINE __m256d min_p(__m256d a, __m256d b) { return _mm256_min_pd(a, b); } + +FORCEINLINE __m256d eq_p(__m256d a, __m256d b) { return _mm256_and_pd(ones_4d, _mm256_cmp_pd(a, b, 0)); } +FORCEINLINE __m256d lt_p(__m256d a, __m256d b) { return _mm256_and_pd(ones_4d, _mm256_cmp_pd(a, b, 1)); } +FORCEINLINE __m256d le_p(__m256d a, __m256d b) { return _mm256_and_pd(ones_4d, _mm256_cmp_pd(a, b, 2)); } +FORCEINLINE __m256d ne_p(__m256d a, __m256d b) { return _mm256_and_pd(ones_4d, _mm256_cmp_pd(a, b, 4)); } +FORCEINLINE __m256d ge_p(__m256d a, __m256d b) { return _mm256_and_pd(ones_4d, _mm256_cmp_pd(a, b, 13)); } +FORCEINLINE __m256d gt_p(__m256d a, __m256d b) { return _mm256_and_pd(ones_4d, _mm256_cmp_pd(a, b, 14)); } FORCEINLINE __m256d sqrt_p(__m256d x) { return _mm256_sqrt_pd(x); } FORCEINLINE __m256d abs_p(__m256d x) { return _mm256_and_pd(x, abs_mask_4d); } @@ -265,13 +291,13 @@ FORCEINLINE __m256d sign_p(__m256d x) { return _mm256_or_pd(ones_4d, _mm256_and_ #include "special_vectorization.hpp" -#endif // __AVX__ +#endif // __AVX__ #ifdef __AVX512F__ /*! * Create specialization for array of 8 doubles. */ -#define ARRAY_T Array +#define ARRAY_T Array #define SCALAR_T double #define REGISTER_T __m512d #define SIZE_TAG SizeTag::EIGHT() @@ -283,27 +309,27 @@ static const __m512d ones_8d = _mm512_set1_pd(1); FORCEINLINE __m512d set1_p(SizeTag::EIGHT, double p) { return _mm512_set1_pd(p); } FORCEINLINE __m512d load_p(SizeTag::EIGHT, const double* p) { return _mm512_load_pd(p); } FORCEINLINE __m512d loadu_p(SizeTag::EIGHT, const double* p) { return _mm512_loadu_pd(p); } -FORCEINLINE void store_p(double* p, __m512d x) { _mm512_store_pd(p,x); } -FORCEINLINE void storeu_p(double* p, __m512d x) { _mm512_storeu_pd(p,x); } -FORCEINLINE void stream_p(double* p, __m512d x) { _mm512_stream_pd(p,x); } - -FORCEINLINE __m512d add_p(__m512d a, __m512d b) { return _mm512_add_pd(a,b); } -FORCEINLINE __m512d sub_p(__m512d a, __m512d b) { return _mm512_sub_pd(a,b); } -FORCEINLINE __m512d mul_p(__m512d a, __m512d b) { return _mm512_mul_pd(a,b); } -FORCEINLINE __m512d div_p(__m512d a, __m512d b) { return _mm512_div_pd(a,b); } -FORCEINLINE __m512d max_p(__m512d a, __m512d b) { return _mm512_max_pd(a,b); } -FORCEINLINE __m512d min_p(__m512d a, __m512d b) { return _mm512_min_pd(a,b); } - -template +FORCEINLINE void store_p(double* p, __m512d x) { _mm512_store_pd(p, x); } +FORCEINLINE void storeu_p(double* p, __m512d x) { _mm512_storeu_pd(p, x); } +FORCEINLINE void stream_p(double* p, __m512d x) { _mm512_stream_pd(p, x); } + +FORCEINLINE __m512d add_p(__m512d a, __m512d b) { return _mm512_add_pd(a, b); } +FORCEINLINE __m512d sub_p(__m512d a, __m512d b) { return _mm512_sub_pd(a, b); } +FORCEINLINE __m512d mul_p(__m512d a, __m512d b) { return _mm512_mul_pd(a, b); } +FORCEINLINE __m512d div_p(__m512d a, __m512d b) { return _mm512_div_pd(a, b); } +FORCEINLINE __m512d max_p(__m512d a, __m512d b) { return _mm512_max_pd(a, b); } +FORCEINLINE __m512d min_p(__m512d a, __m512d b) { return _mm512_min_pd(a, b); } + +template FORCEINLINE __m512d cmp_p(__m512d a, __m512d b) { - return _mm512_mask_blend_pd(_mm512_cmp_pd_mask(a,b,opCode), _mm512_setzero_pd(), ones_8d); + return _mm512_mask_blend_pd(_mm512_cmp_pd_mask(a, b, opCode), _mm512_setzero_pd(), ones_8d); } -FORCEINLINE __m512d eq_p(__m512d a, __m512d b) { return cmp_p<0>(a,b); } -FORCEINLINE __m512d lt_p(__m512d a, __m512d b) { return cmp_p<1>(a,b); } -FORCEINLINE __m512d le_p(__m512d a, __m512d b) { return cmp_p<2>(a,b); } -FORCEINLINE __m512d ne_p(__m512d a, __m512d b) { return cmp_p<4>(a,b); } -FORCEINLINE __m512d ge_p(__m512d a, __m512d b) { return cmp_p<13>(a,b); } -FORCEINLINE __m512d gt_p(__m512d a, __m512d b) { return cmp_p<14>(a,b); } +FORCEINLINE __m512d eq_p(__m512d a, __m512d b) { return cmp_p<0>(a, b); } +FORCEINLINE __m512d lt_p(__m512d a, __m512d b) { return cmp_p<1>(a, b); } +FORCEINLINE __m512d le_p(__m512d a, __m512d b) { return cmp_p<2>(a, b); } +FORCEINLINE __m512d ne_p(__m512d a, __m512d b) { return cmp_p<4>(a, b); } +FORCEINLINE __m512d ge_p(__m512d a, __m512d b) { return cmp_p<13>(a, b); } +FORCEINLINE __m512d gt_p(__m512d a, __m512d b) { return cmp_p<14>(a, b); } FORCEINLINE __m512d sqrt_p(__m512d x) { return _mm512_sqrt_pd(x); } FORCEINLINE __m512d abs_p(__m512d x) { return _mm512_and_pd(x, abs_mask_8d); } @@ -312,9 +338,9 @@ FORCEINLINE __m512d sign_p(__m512d x) { return _mm512_or_pd(ones_8d, _mm512_and_ #include "special_vectorization.hpp" -#endif // __AVX512F__ +#endif // __AVX512F__ #undef ARRAY_BOILERPLATE /// @} -} // namespace +} // namespace simd diff --git a/Common/include/toolboxes/C1DInterpolation.hpp b/Common/include/toolboxes/C1DInterpolation.hpp index 2b627f68cb2..8ca4d5c1b18 100644 --- a/Common/include/toolboxes/C1DInterpolation.hpp +++ b/Common/include/toolboxes/C1DInterpolation.hpp @@ -2,7 +2,7 @@ * \file C1DInterpolation.hpp * \brief Classes for 1D interpolation. * \author Aman Baig, P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -37,8 +37,8 @@ * \ingroup LookUpInterp */ class C1DInterpolation { -protected: - std::vector x, y; /*!< \brief Data points. */ + protected: + std::vector x, y; /*!< \brief Data points. */ /*! * \brief Find containing interval. @@ -46,20 +46,19 @@ class C1DInterpolation { * \return The start index of the interval, or the size if the coordinate is out of bounds. */ inline size_t lower_bound(su2double xi) const { - if (xi <= x.front() || xi >= x.back()) return x.size(); - size_t lb = 0, ub = x.size()-1; + size_t lb = 0, ub = x.size() - 1; - while (ub-lb > 1) { - size_t mid = (lb+ub)/2; - auto& change = (xi < x[mid])? ub : lb; + while (ub - lb > 1) { + size_t mid = (lb + ub) / 2; + auto& change = (xi < x[mid]) ? ub : lb; change = mid; } return lb; } -public: + public: /*! * \brief Virtual destructor of the C1DInterpolation class. */ @@ -70,7 +69,7 @@ class C1DInterpolation { * \param[in] X - the x values. * \param[in] Data - the f(x) values. */ - virtual void SetSpline(const std::vector &X, const std::vector &Data) { + virtual void SetSpline(const std::vector& X, const std::vector& Data) { assert(X.size() == Data.size()); x = X; y = Data; @@ -80,19 +79,18 @@ class C1DInterpolation { * \brief Evaluate the value of the spline at a point. */ virtual su2double EvaluateSpline(su2double Point_Interp) const = 0; - inline su2double operator() (su2double Point_Interp) const { return EvaluateSpline(Point_Interp); } - + inline su2double operator()(su2double Point_Interp) const { return EvaluateSpline(Point_Interp); } }; /*! * \brief Akima 1D interpolation. * \ingroup LookUpInterp */ -class CAkimaInterpolation: public C1DInterpolation{ -protected: - std::vector b,c,d; /*!< \brief local variables for Akima spline cooefficients */ +class CAkimaInterpolation : public C1DInterpolation { + protected: + std::vector b, c, d; /*!< \brief local variables for Akima spline cooefficients */ -public: + public: CAkimaInterpolation() = default; /*! @@ -100,14 +98,14 @@ class CAkimaInterpolation: public C1DInterpolation{ * \param[in] X - the x values (sorted low to high). * \param[in] Data - the f(x) values. */ - CAkimaInterpolation(const std::vector &X, const std::vector &Data) { - CAkimaInterpolation::SetSpline(X,Data); + CAkimaInterpolation(const std::vector& X, const std::vector& Data) { + CAkimaInterpolation::SetSpline(X, Data); } /*! * \brief Build the spline. */ - void SetSpline(const std::vector &X, const std::vector &Data) override; + void SetSpline(const std::vector& X, const std::vector& Data) override; /*! * \brief Evaluate the value of the spline at a point. @@ -119,15 +117,15 @@ class CAkimaInterpolation: public C1DInterpolation{ * \brief Cubic spline interpolation. * \ingroup LookUpInterp */ -class CCubicSpline final: public CAkimaInterpolation { -public: - enum END_TYPE {SECOND, FIRST}; +class CCubicSpline final : public CAkimaInterpolation { + public: + enum END_TYPE { SECOND, FIRST }; -private: + private: const su2double startVal, endVal; /*!< \brief "boundary" values. */ const END_TYPE startDer, endDer; /*!< \brief 1st or 2nd derivative "boundary" conditions. */ -public: + public: CCubicSpline() = default; /*! @@ -139,28 +137,24 @@ class CCubicSpline final: public CAkimaInterpolation { * \param[in] endCondition - 1st or 2nd derivative imposed at the end. * \param[in] endValue - value of the derivative imposed at the end. */ - CCubicSpline(const std::vector &X, const std::vector &Data, - END_TYPE startCondition = SECOND, su2double startValue = 0.0, - END_TYPE endCondition = SECOND, su2double endValue = 0.0) : - startVal(startValue), - endVal(endValue), - startDer(startCondition), - endDer(endCondition) { - SetSpline(X,Data); + CCubicSpline(const std::vector& X, const std::vector& Data, END_TYPE startCondition = SECOND, + su2double startValue = 0.0, END_TYPE endCondition = SECOND, su2double endValue = 0.0) + : startVal(startValue), endVal(endValue), startDer(startCondition), endDer(endCondition) { + SetSpline(X, Data); } /*! * \brief Build the spline. */ - void SetSpline(const std::vector &X, const std::vector &Data) override; + void SetSpline(const std::vector& X, const std::vector& Data) override; }; /*! * \brief Linear interpolation. * \ingroup LookUpInterp */ -class CLinearInterpolation final: public C1DInterpolation { -public: +class CLinearInterpolation final : public C1DInterpolation { + public: CLinearInterpolation() = default; /*! @@ -168,9 +162,7 @@ class CLinearInterpolation final: public C1DInterpolation { * \param[in] X - the x values (sorted low to high). * \param[in] Data - the f(x) values. */ - CLinearInterpolation(const std::vector &X, const std::vector &Data) { - SetSpline(X,Data); - } + CLinearInterpolation(const std::vector& X, const std::vector& Data) { SetSpline(X, Data); } /*! * \brief Evaluate the value of the spline at a point. @@ -188,12 +180,9 @@ class CLinearInterpolation final: public C1DInterpolation { * \param[in] ENUM_INLET_INTERPOLATIONTYPE - enum of the interpolation type to be done * \returns the corrected Inlet Interpolated Data. */ -std::vector CorrectedInletValues(const std::vector &Inlet_Interpolated, - su2double Theta , - unsigned short nDim, - const su2double *Coord, - unsigned short nVar_Turb, - INLET_INTERP_TYPE Interpolation_Type); +std::vector CorrectedInletValues(const std::vector& Inlet_Interpolated, su2double Theta, + unsigned short nDim, const su2double* Coord, unsigned short nVar_Turb, + INLET_INTERP_TYPE Interpolation_Type); /*! * \brief Prints the Inlet Interpolated Data @@ -203,5 +192,5 @@ std::vector CorrectedInletValues(const std::vector &Inlet_ * \param[in] nDim - the dimensions of the problem. * \param[in] nColumns - the number of columns in the final interpolated data */ -void PrintInletInterpolatedData(const std::vector& Inlet_Data_Interpolated, std::string Marker, +void PrintInletInterpolatedData(const std::vector& Inlet_Data_Interpolated, const std::string& Marker, unsigned long nVertex, unsigned short nDim, unsigned short nColumns); diff --git a/Common/include/toolboxes/CLinearPartitioner.hpp b/Common/include/toolboxes/CLinearPartitioner.hpp index ec9ee4e6470..0ebfb516aae 100644 --- a/Common/include/toolboxes/CLinearPartitioner.hpp +++ b/Common/include/toolboxes/CLinearPartitioner.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CLinearPartitioner. * The implementations are in the CLinearPartitioner.cpp file. * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -41,25 +41,25 @@ using namespace std; * \author T. Economon */ class CLinearPartitioner { - -protected: - - int size; /*!< \brief MPI Size. */ - - vector firstIndex; /*!< \brief Vector containing the first index on each rank due to a linear partitioning by global count. */ - vector lastIndex; /*!< \brief Vector containing the last index on each rank due to a linear partitioning by global count. */ - vector sizeOnRank; /*!< \brief Vector containing the total size of the current rank's linear partition. */ - vector cumulativeSizeBeforeRank; /*!< \brief Vector containing the cumulative size of all linear partitions before the current rank. */ - -public: + protected: + int size; /*!< \brief MPI Size. */ + + vector firstIndex; /*!< \brief Vector containing the first index on each rank due to a linear + partitioning by global count. */ + vector lastIndex; /*!< \brief Vector containing the last index on each rank due to a linear + partitioning by global count. */ + vector + sizeOnRank; /*!< \brief Vector containing the total size of the current rank's linear partition. */ + vector cumulativeSizeBeforeRank; /*!< \brief Vector containing the cumulative size of all linear + partitions before the current rank. */ + + public: CLinearPartitioner() = default; /*! * \brief Constructor of the CLinearPartitioner class, see Initialize. */ - CLinearPartitioner(unsigned long global_count, - unsigned long offset, - bool isDisjoint = false) { + CLinearPartitioner(unsigned long global_count, unsigned long offset, bool isDisjoint = false) { Initialize(global_count, offset, isDisjoint); } @@ -69,9 +69,7 @@ class CLinearPartitioner { * \param[in] offset - offset from 0 for the first index on rank 0 (typically 0). * \param[in] isDisjoint - boolean controlling whether the linear partitions should be disjoint (default is false). */ - void Initialize(unsigned long global_count, - unsigned long offset, - bool isDisjoint = false); + void Initialize(unsigned long global_count, unsigned long offset, bool isDisjoint = false); /*! * \brief Get the rank that owns the index based on the linear partitioning. @@ -85,36 +83,28 @@ class CLinearPartitioner { * \param[in] rank - MPI rank identifier. * \returns First index of the current rank's linear partition. */ - inline unsigned long GetFirstIndexOnRank(int rank) const { - return firstIndex[rank]; - } + inline unsigned long GetFirstIndexOnRank(int rank) const { return firstIndex[rank]; } /*! * \brief Get the last index of the current rank's linear partition. * \param[in] rank - MPI rank identifier. * \returns Last index of the current rank's linear partition. */ - inline unsigned long GetLastIndexOnRank(int rank) const { - return lastIndex[rank]; - } + inline unsigned long GetLastIndexOnRank(int rank) const { return lastIndex[rank]; } /*! * \brief Get the total size of the current rank's linear partition. * \param[in] rank - MPI rank identifier. * \returns Size of the current rank's linear partition. */ - inline unsigned long GetSizeOnRank(int rank) const { - return sizeOnRank[rank]; - } + inline unsigned long GetSizeOnRank(int rank) const { return sizeOnRank[rank]; } /*! * \brief Get the cumulative size of all linear partitions before the current rank. * \param[in] rank - MPI rank identifier. * \returns Cumulative size of all linear partitions before the current rank. */ - inline unsigned long GetCumulativeSizeBeforeRank(int rank) const { - return cumulativeSizeBeforeRank[rank]; - } + inline unsigned long GetCumulativeSizeBeforeRank(int rank) const { return cumulativeSizeBeforeRank[rank]; } /*! * \brief Checks if an index belongs to a rank. @@ -123,7 +113,6 @@ class CLinearPartitioner { * \returns True if index is owned by rank. */ bool IndexBelongsToRank(unsigned long index, int rank) const { - return index >= cumulativeSizeBeforeRank[rank] && index < cumulativeSizeBeforeRank[rank+1]; + return index >= cumulativeSizeBeforeRank[rank] && index < cumulativeSizeBeforeRank[rank + 1]; } - }; diff --git a/Common/include/toolboxes/CQuasiNewtonInvLeastSquares.hpp b/Common/include/toolboxes/CQuasiNewtonInvLeastSquares.hpp index e481d77935b..e881f4c95bb 100644 --- a/Common/include/toolboxes/CQuasiNewtonInvLeastSquares.hpp +++ b/Common/include/toolboxes/CQuasiNewtonInvLeastSquares.hpp @@ -7,7 +7,7 @@ * \note Based on the IQN-ILS method, see DOI 10.1007/s11831-013-9085-5 and * references therein. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -46,17 +46,17 @@ * as the new input of the FP, run the FP, etc. * \ingroup BLAS */ -template +template class CQuasiNewtonInvLeastSquares { -public: + public: using Scalar = Scalar_t; using Index = typename su2matrix::Index; - static_assert(std::is_floating_point::value,""); + static_assert(std::is_floating_point::value, ""); -private: + private: using MPI_Wrapper = typename SelectMPIWrapper::W; - enum: size_t {BLOCK_SIZE = 1024}; /*!< \brief Loop tiling parameter. */ + enum : size_t { BLOCK_SIZE = 1024 }; /*!< \brief Loop tiling parameter. */ std::vector > X, R; /*!< \brief Input and residual history of the FP. */ su2matrix work; /*!< \brief Work matrix (FP result, correction, and approx solution). */ su2vector mat, rhs, sol; /*!< \brief Matrix, rhs, and solution of the normal equations. */ @@ -67,67 +67,63 @@ class CQuasiNewtonInvLeastSquares { for (Index i = 1; i < X.size(); ++i) { /*--- Swap instead of moving to re-use the memory of the first sample. * This is why X and R are not stored as contiguous blocks of mem. ---*/ - std::swap(X[i-1], X[i]); - std::swap(R[i-1], R[i]); + std::swap(X[i - 1], X[i]); + std::swap(R[i - 1], R[i]); } } void computeNormalEquations() { /*--- Size for the dot products. ---*/ - const auto end = std::min(nPtDomain,work.rows())*work.cols(); + const auto end = std::min(nPtDomain, work.rows()) * work.cols(); - mat = Scalar(0); rhs = Scalar(0); + mat = Scalar(0); + rhs = Scalar(0); /*--- Tiled part of the loop. ---*/ Index begin = 0; - while (end-begin >= BLOCK_SIZE) { + while (end - begin >= BLOCK_SIZE) { computeNormalEquations(mat, rhs, begin); begin += BLOCK_SIZE; } /*--- Remainder of the loop. ---*/ if (begin != end) { - computeNormalEquations<0>(mat, rhs, begin, end-begin); + computeNormalEquations<0>(mat, rhs, begin, end - begin); } /*--- MPI reduction of the dot products. ---*/ if (WithMPI) { - const auto type = (sizeof(Scalar) < sizeof(double))? MPI_FLOAT : MPI_DOUBLE; + const auto type = (sizeof(Scalar) < sizeof(double)) ? MPI_FLOAT : MPI_DOUBLE; su2vector tmp(mat.size()); - MPI_Wrapper::Allreduce(mat.data(), tmp.data(), iSample*(iSample+1)/2, - type, MPI_SUM, SU2_MPI::GetComm()); + MPI_Wrapper::Allreduce(mat.data(), tmp.data(), iSample * (iSample + 1) / 2, type, MPI_SUM, SU2_MPI::GetComm()); mat = std::move(tmp); - MPI_Wrapper::Allreduce(rhs.data(), sol.data(), iSample, - type, MPI_SUM, SU2_MPI::GetComm()); + MPI_Wrapper::Allreduce(rhs.data(), sol.data(), iSample, type, MPI_SUM, SU2_MPI::GetComm()); std::swap(rhs, sol); } } - template - void computeNormalEquations(su2vector& mat, - su2vector& vec, - Index start, - Index dynSize = 0) const { + template + void computeNormalEquations(su2vector& mat, su2vector& vec, Index start, Index dynSize = 0) const { /*--- Select either the static or dynamic size, optimizes inner loop. ---*/ - const auto blkSize = StaticSize? StaticSize : dynSize; + const auto blkSize = StaticSize ? StaticSize : dynSize; for (Index i = 0; i < iSample; ++i) { - const auto ri1 = R[i+1].data() + start; + const auto ri1 = R[i + 1].data() + start; const auto ri0 = R[i].data() + start; /*--- Off-diagonal coefficients. ---*/ for (Index j = 0; j < i; ++j) { - const auto rj1 = R[j+1].data() + start; + const auto rj1 = R[j + 1].data() + start; const auto rj0 = R[j].data() + start; /*--- Sum of partial sums to reduce trunc. error. ---*/ Scalar sum = 0; SU2_OMP_SIMD for (Index k = 0; k < blkSize; ++k) { - sum += (ri1[k]-ri0[k]) * (rj1[k]-rj0[k]); + sum += (ri1[k] - ri0[k]) * (rj1[k] - rj0[k]); } /*--- 1D index of (i,j) in lower triangular storage. ---*/ - const auto iCoeff = i*(i+1)/2 + j; + const auto iCoeff = i * (i + 1) / 2 + j; mat(iCoeff) += sum; } /*--- Diagonal coeff and residual fused. ---*/ @@ -135,15 +131,15 @@ class CQuasiNewtonInvLeastSquares { const auto r = R[iSample].data() + start; SU2_OMP_SIMD for (Index k = 0; k < blkSize; ++k) { - diag += pow(ri1[k]-ri0[k], 2); - res += (ri1[k]-ri0[k]) * r[k]; + diag += pow(ri1[k] - ri0[k], 2); + res += (ri1[k] - ri0[k]) * r[k]; } - mat(i*(i+3)/2) += diag; + mat(i * (i + 3) / 2) += diag; vec(i) -= res; } } -public: + public: /*! \brief Default construction without allocation. */ CQuasiNewtonInvLeastSquares() = default; @@ -160,29 +156,31 @@ class CQuasiNewtonInvLeastSquares { * \param[in] nptdomain - Local size (<= npt), if 0 it defaults to npt. */ void resize(Index nsample, Index npt, Index nvar, Index nptdomain = 0) { - if (nptdomain > npt || nsample < 2) - SU2_MPI::Error("Invalid quasi-Newton parameters", CURRENT_FUNCTION); + if (nptdomain > npt || nsample < 2) SU2_MPI::Error("Invalid quasi-Newton parameters", CURRENT_FUNCTION); iSample = 0; - nPtDomain = nptdomain? nptdomain : npt; - work.resize(npt,nvar); + nPtDomain = nptdomain ? nptdomain : npt; + work.resize(npt, nvar); X.clear(); R.clear(); for (Index i = 0; i < nsample; ++i) { - X.emplace_back(npt,nvar); - R.emplace_back(npt,nvar); + X.emplace_back(npt, nvar); + R.emplace_back(npt, nvar); } X[0] = Scalar(0); /*--- Lower triangular packed storage. ---*/ - mat.resize(nsample*(nsample-1)/2); - rhs.resize(nsample-1); - sol.resize(nsample-1); + mat.resize(nsample * (nsample - 1) / 2); + rhs.resize(nsample - 1); + sol.resize(nsample - 1); } /*! \brief Size of the object, the number of samples. */ Index size() const { return X.size(); } /*! \brief Discard all history, keeping the current solution. */ - void reset() { std::swap(X[0], X[iSample]); iSample = 0; } + void reset() { + std::swap(X[0], X[iSample]); + iSample = 0; + } /*! * \brief Access the current fixed-point result. @@ -190,8 +188,8 @@ class CQuasiNewtonInvLeastSquares { */ su2matrix& FPresult() { return work; } const su2matrix& FPresult() const { return work; } - Scalar& FPresult(Index iPt, Index iVar) { return work(iPt,iVar); } - const Scalar& FPresult(Index iPt, Index iVar) const { return work(iPt,iVar); } + Scalar& FPresult(Index iPt, Index iVar) { return work(iPt, iVar); } + const Scalar& FPresult(Index iPt, Index iVar) const { return work(iPt, iVar); } /*! * \brief Access the current solution approximation. @@ -199,8 +197,8 @@ class CQuasiNewtonInvLeastSquares { */ su2matrix& solution() { return X[iSample]; } const su2matrix& solution() const { return X[iSample]; } - Scalar& operator() (Index iPt, Index iVar) { return X[iSample](iPt,iVar); } - const Scalar& operator() (Index iPt, Index iVar) const { return X[iSample](iPt,iVar); } + Scalar& operator()(Index iPt, Index iVar) { return X[iSample](iPt, iVar); } + const Scalar& operator()(Index iPt, Index iVar) const { return X[iSample](iPt, iVar); } /*! * \brief Compute and return a new approximation. @@ -219,35 +217,33 @@ class CQuasiNewtonInvLeastSquares { computeNormalEquations(); CSymmetricMatrix pseudoInv(iSample); for (Index i = 0, k = 0; i < iSample; ++i) - for (Index j = 0; j <= i; ++j) - pseudoInv(i,j) = mat(k++); + for (Index j = 0; j <= i; ++j) pseudoInv(i, j) = mat(k++); pseudoInv.Invert(true); pseudoInv.MatVecMult(rhs.data(), sol.data()); /*--- Compute correction, cleared before for less trunc. error. ---*/ for (Index k = 0; k < iSample; ++k) { - const auto x1 = X[k+1].data(); - const auto r1 = R[k+1].data(); + const auto x1 = X[k + 1].data(); + const auto r1 = R[k + 1].data(); const auto x0 = X[k].data(); const auto r0 = R[k].data(); SU2_OMP_SIMD for (Index i = 0; i < work.size(); ++i) { - Scalar dy = r1[i]-r0[i] + x1[i]-x0[i]; + Scalar dy = r1[i] - r0[i] + x1[i] - x0[i]; work.data()[i] += sol(k) * dy; } } } /*--- Check for need to shift left. ---*/ - if (iSample+1 == X.size()) { + if (iSample + 1 == X.size()) { shiftHistoryLeft(); iSample--; } /*--- Set new solution. ---*/ SU2_OMP_SIMD - for (Index i = 0; i < work.size(); ++i) - work.data()[i] += R[iSample].data()[i] + X[iSample].data()[i]; + for (Index i = 0; i < work.size(); ++i) work.data()[i] += R[iSample].data()[i] + X[iSample].data()[i]; std::swap(X[++iSample], work); return solution(); diff --git a/Common/include/toolboxes/CSquareMatrixCM.hpp b/Common/include/toolboxes/CSquareMatrixCM.hpp index 35dd27e15f3..2ba3f60de7c 100644 --- a/Common/include/toolboxes/CSquareMatrixCM.hpp +++ b/Common/include/toolboxes/CSquareMatrixCM.hpp @@ -3,7 +3,7 @@ * \brief Dense general square matrix, used for example in DG standard elements * in Column Major order storage. * \author Edwin van der Weide, Pedro Gomes. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -39,11 +39,11 @@ class CSquareMatrixCM { static_assert(ColMajorMatrix::Storage == StorageType::ColumnMajor, "Column major storage is assumed for LAPACK."); -private: - ColMajorMatrix mat; /*!< \brief Storage of the actual matrix. */ -public: + private: + ColMajorMatrix mat; /*!< \brief Storage of the actual matrix. */ + public: /*! * \brief Default constructor. Nothing to be done. */ @@ -55,7 +55,7 @@ class CSquareMatrixCM { * the matrix. * \param[in] N - Number of rows and colums of the matrix. */ - CSquareMatrixCM(int N) {Initialize(N);} + CSquareMatrixCM(int N) { Initialize(N); } /*! * \brief Operator, which makes available the given matrix element as a reference. @@ -63,7 +63,7 @@ class CSquareMatrixCM { * \param[in] j - Column index of the matrix element. * \return Reference to element (i,j). */ - inline passivedouble& operator() (int i, int j) {return mat(i,j);} + inline passivedouble& operator()(int i, int j) { return mat(i, j); } /*! * \brief Operator, which makes available the given matrix element as a const reference. @@ -71,31 +71,31 @@ class CSquareMatrixCM { * \param[in] j - Column index of the matrix element. * \return Constant reference to element (i,j). */ - inline const passivedouble& operator() (int i, int j) const {return mat(i,j);} + inline const passivedouble& operator()(int i, int j) const { return mat(i, j); } /*! * \brief Function, which makes available a reference to the actual matrix. * \return A reference to mat. */ - inline ColMajorMatrix& GetMat() {return mat;} + inline ColMajorMatrix& GetMat() { return mat; } /*! * \brief Function, which makes available a const reference to the actual matrix. * \return A const reference to mat. */ - inline const ColMajorMatrix& GetMat() const {return mat;} + inline const ColMajorMatrix& GetMat() const { return mat; } /*! * \brief Function, which allocates the memory for the matrix. * \param[in] N - Number of rows and colums of the matrix. */ - inline void Initialize(int N) {mat.resize(N,N);} + inline void Initialize(int N) { mat.resize(N, N); } /*! * \brief Function, which makes available the size of the matrix. * \return The number of rows, columns of the matrix. */ - inline int Size() const {return mat.rows();} + inline int Size() const { return mat.rows(); } /*! * \brief Function, which carries out the matrix produc of the current matrix @@ -104,21 +104,18 @@ class CSquareMatrixCM { * \param[in] mat_in - Matrix to be multiplied by the current matrix. * \param[out] mat_out - Matrix to store the result of the multiplication. */ - void MatMatMult(const char side, - const ColMajorMatrix &mat_in, - ColMajorMatrix &mat_out) const; + void MatMatMult(const char side, const ColMajorMatrix& mat_in, + ColMajorMatrix& mat_out) const; /*! * \brief Naive matrix-vector multiplication with general type. */ - template - void MatVecMult(ForwardIt vec_in, ForwardIt vec_out) const - { + template + void MatVecMult(ForwardIt vec_in, ForwardIt vec_out) const { for (int i = 0; i < Size(); ++i) { *vec_out = 0.0; auto vec = vec_in; - for (int k = 0; k < Size(); ++k) - *vec_out += *(vec++) * mat(i,k); + for (int k = 0; k < Size(); ++k) *vec_out += *(vec++) * mat(i, k); ++vec_out; } } @@ -132,5 +129,4 @@ class CSquareMatrixCM { * \brief Function, which transposes the matrix in-place. */ void Transpose(); - }; diff --git a/Common/include/toolboxes/CSymmetricMatrix.hpp b/Common/include/toolboxes/CSymmetricMatrix.hpp index 717b7a45259..8b229a4b526 100644 --- a/Common/include/toolboxes/CSymmetricMatrix.hpp +++ b/Common/include/toolboxes/CSymmetricMatrix.hpp @@ -2,7 +2,7 @@ * \file CSymmetricMatrix.hpp * \brief Dense symmetric matrix, used for example in RBF interpolation. * \author Joel Ho, P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -37,7 +37,8 @@ */ class CSymmetricMatrix { static_assert(su2passivematrix::IsRowMajor, "Row major storage is assumed for LAPACK."); -private: + + private: su2passivematrix mat; // Not optimized dense matrix factorization and inversion for portability. @@ -47,30 +48,28 @@ class CSymmetricMatrix { void CalcInv_sytri(); void CalcInv_potri(); -public: + public: CSymmetricMatrix() = default; - CSymmetricMatrix(int N) {Initialize(N);} + CSymmetricMatrix(int N) { Initialize(N); } void Initialize(int N); inline int Size() const { return mat.rows(); } - inline passivedouble Get(int i, int j) const { return mat(std::min(i,j),std::max(i,j)); } + inline passivedouble Get(int i, int j) const { return mat(std::min(i, j), std::max(i, j)); } - inline void Set(int i, int j, passivedouble val) { mat(std::min(i,j),std::max(i,j)) = val; } + inline void Set(int i, int j, passivedouble val) { mat(std::min(i, j), std::max(i, j)) = val; } - inline passivedouble& operator() (int i, int j) { return mat(std::min(i,j),std::max(i,j)); } + inline passivedouble& operator()(int i, int j) { return mat(std::min(i, j), std::max(i, j)); } - inline const passivedouble& operator() (int i, int j) const { return mat(std::min(i,j),std::max(i,j)); } + inline const passivedouble& operator()(int i, int j) const { return mat(std::min(i, j), std::max(i, j)); } - template - void MatVecMult(ForwardIt vec_in, ForwardIt vec_out) const - { + template + void MatVecMult(ForwardIt vec_in, ForwardIt vec_out) const { for (int i = 0; i < Size(); ++i) { *vec_out = 0.0; auto vec = vec_in; - for (int k = 0; k < Size(); ++k) - *vec_out += *(vec++) * Get(i,k); + for (int k = 0; k < Size(); ++k) *vec_out += *(vec++) * Get(i, k); ++vec_out; } } @@ -80,5 +79,4 @@ class CSymmetricMatrix { void Invert(bool is_spd = false); su2passivematrix StealData(); - }; diff --git a/Common/include/toolboxes/MMS/CIncTGVSolution.hpp b/Common/include/toolboxes/MMS/CIncTGVSolution.hpp index 972b6d4075c..677f78448e9 100644 --- a/Common/include/toolboxes/MMS/CIncTGVSolution.hpp +++ b/Common/include/toolboxes/MMS/CIncTGVSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CIncTGVSolution. * The implementations are in the CIncTGVSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,7 +26,6 @@ * License along with SU2. If not, see . */ - #pragma once #include @@ -37,10 +36,8 @@ * \brief Class to define the required data for the incompressible Taylor Green Vortex. * \author T. Economon, E. van der Weide */ -class CIncTGVSolution final: public CVerificationSolution { - -protected: - +class CIncTGVSolution final : public CVerificationSolution { + protected: /*--- TGV specific conditions. ---*/ su2double tgvLength; /*!< \brief Taylor-Green length scale. */ @@ -48,10 +45,9 @@ class CIncTGVSolution final: public CVerificationSolution { su2double tgvDensity; /*!< \brief Taylor-Green density. */ su2double tgvViscosity; /*!< \brief Taylor-Green viscosity. */ - su2double Temperature; /*!< \brief Temperature, just to be safe. */ - -public: + su2double Temperature; /*!< \brief Temperature, just to be safe. */ + public: /*! * \brief Constructor of the class. */ @@ -64,10 +60,7 @@ class CIncTGVSolution final: public CVerificationSolution { * \param[in] val_iMesh - Multigrid level of the solver. * \param[in] config - Configuration of the particular problem. */ - CIncTGVSolution(unsigned short val_nDim, - unsigned short val_nvar, - unsigned short val_iMesh, - CConfig* config); + CIncTGVSolution(unsigned short val_nDim, unsigned short val_nvar, unsigned short val_iMesh, CConfig* config); /*! * \brief Destructor of the class. @@ -80,9 +73,7 @@ class CIncTGVSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetSolution(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; /*! * \brief Get the boundary conditions state for an exact solution. @@ -90,7 +81,5 @@ class CIncTGVSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetBCState(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; }; diff --git a/Common/include/toolboxes/MMS/CInviscidVortexSolution.hpp b/Common/include/toolboxes/MMS/CInviscidVortexSolution.hpp index 4e2b733eeeb..e9aaa812e28 100644 --- a/Common/include/toolboxes/MMS/CInviscidVortexSolution.hpp +++ b/Common/include/toolboxes/MMS/CInviscidVortexSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CInviscidVortexSolution. * The implementations are in the CInviscidVortexSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,7 +26,6 @@ * License along with SU2. If not, see . */ - #pragma once #include @@ -37,26 +36,23 @@ * \brief Class to define the required data for the Inviscid Vortex. * \author E. van der Weide, T. Economon */ -class CInviscidVortexSolution final: public CVerificationSolution { - -protected: - +class CInviscidVortexSolution final : public CVerificationSolution { + protected: /*--- Specific conditions for the inviscid vortex. ---*/ - su2double MachVortex; /*!< \brief Mach number of the undisturbed flow. */ - su2double x0Vortex; /*!< \brief Initial x-coordinate of the vortex center. */ - su2double y0Vortex; /*!< \brief Initial y-coordinate of the vortex center. */ - su2double RVortex; /*!< \brief Radius of the vortex. */ - su2double epsVortex; /*!< \brief Strength of the vortex. */ - su2double thetaVortex; /*!< \brief Advection angle (in degrees) of the vortex. */ + su2double MachVortex; /*!< \brief Mach number of the undisturbed flow. */ + su2double x0Vortex; /*!< \brief Initial x-coordinate of the vortex center. */ + su2double y0Vortex; /*!< \brief Initial y-coordinate of the vortex center. */ + su2double RVortex; /*!< \brief Radius of the vortex. */ + su2double epsVortex; /*!< \brief Strength of the vortex. */ + su2double thetaVortex; /*!< \brief Advection angle (in degrees) of the vortex. */ /*--- Variables involving gamma. */ - su2double Gamma; /*!< \brief Gamma */ - su2double Gm1; /*!< \brief Gamma minus 1 */ - su2double ovGm1; /*!< \brief 1 over Gamma minus 1 */ - su2double gamOvGm1; /*!< \brief Gamma over Gamma minus 1 */ - -public: + su2double Gamma; /*!< \brief Gamma */ + su2double Gm1; /*!< \brief Gamma minus 1 */ + su2double ovGm1; /*!< \brief 1 over Gamma minus 1 */ + su2double gamOvGm1; /*!< \brief Gamma over Gamma minus 1 */ + public: /*! * \brief Constructor of the class. */ @@ -69,10 +65,7 @@ class CInviscidVortexSolution final: public CVerificationSolution { * \param[in] val_iMesh - Multigrid level of the solver. * \param[in] config - Configuration of the particular problem. */ - CInviscidVortexSolution(unsigned short val_nDim, - unsigned short val_nvar, - unsigned short val_iMesh, - CConfig* config); + CInviscidVortexSolution(unsigned short val_nDim, unsigned short val_nvar, unsigned short val_iMesh, CConfig* config); /*! * \brief Destructor of the class. @@ -85,9 +78,7 @@ class CInviscidVortexSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetSolution(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; /*! * \brief Get the boundary conditions state for an exact solution. @@ -95,7 +86,5 @@ class CInviscidVortexSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetBCState(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; }; diff --git a/Common/include/toolboxes/MMS/CMMSIncEulerSolution.hpp b/Common/include/toolboxes/MMS/CMMSIncEulerSolution.hpp index 0af37d51bd6..69f8906b808 100644 --- a/Common/include/toolboxes/MMS/CMMSIncEulerSolution.hpp +++ b/Common/include/toolboxes/MMS/CMMSIncEulerSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CMMSIncEulerSolution. * The implementations are in the CMMSIncEulerSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,7 +26,6 @@ * License along with SU2. If not, see . */ - #pragma once #include @@ -38,13 +37,11 @@ * incompressible Euler equations. * \author T. Economon, E. van der Weide */ -class CMMSIncEulerSolution final: public CVerificationSolution { - -protected: - +class CMMSIncEulerSolution final : public CVerificationSolution { + protected: /*--- Variables that define the solution and MMS source term. ---*/ - su2double Density; /*!< \brief Density, must be constant. */ - su2double Temperature; /*!< \brief Temperature, just to be safe. */ + su2double Density; /*!< \brief Density, must be constant. */ + su2double Temperature; /*!< \brief Temperature, just to be safe. */ /*--- Constants, which describe this manufactured solution. This is a solution where the primitive variables vary as a combination @@ -52,13 +49,12 @@ class CMMSIncEulerSolution final: public CVerificationSolution { Knupp P, "Code verification by the method of manufactured solutions," SAND 2000-1444, Sandia National Laboratories, Albuquerque, NM, 2000. ---*/ - su2double P_0; /*!< \brief Parameter for the pressure solution. */ - su2double u_0; /*!< \brief Parameter for the x-velocity solution. */ - su2double v_0; /*!< \brief Parameter for the y-velocity solution. */ - su2double epsilon; /*!< \brief Parameter for the velocity solutions. */ - -public: + su2double P_0; /*!< \brief Parameter for the pressure solution. */ + su2double u_0; /*!< \brief Parameter for the x-velocity solution. */ + su2double v_0; /*!< \brief Parameter for the y-velocity solution. */ + su2double epsilon; /*!< \brief Parameter for the velocity solutions. */ + public: /*! * \brief Constructor of the class. */ @@ -71,10 +67,7 @@ class CMMSIncEulerSolution final: public CVerificationSolution { * \param[in] val_iMesh - Multigrid level of the solver. * \param[in] config - Configuration of the particular problem. */ - CMMSIncEulerSolution(unsigned short val_nDim, - unsigned short val_nvar, - unsigned short val_iMesh, - CConfig* config); + CMMSIncEulerSolution(unsigned short val_nDim, unsigned short val_nvar, unsigned short val_iMesh, CConfig* config); /*! * \brief Destructor of the class. @@ -87,9 +80,7 @@ class CMMSIncEulerSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetSolution(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; /*! * \brief Get the boundary conditions state for an exact solution. @@ -97,9 +88,7 @@ class CMMSIncEulerSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetBCState(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; /*! * \brief Get the source term for the manufactured solution (MMS). @@ -107,9 +96,7 @@ class CMMSIncEulerSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetMMSSourceTerm(const su2double *val_coords, - const su2double val_t, - su2double *val_source) const override; + void GetMMSSourceTerm(const su2double* val_coords, const su2double val_t, su2double* val_source) const override; /*! * \brief Whether or not this verification solution is a manufactured solution. diff --git a/Common/include/toolboxes/MMS/CMMSIncNSSolution.hpp b/Common/include/toolboxes/MMS/CMMSIncNSSolution.hpp index 19f58034a49..3626b9ac6f4 100644 --- a/Common/include/toolboxes/MMS/CMMSIncNSSolution.hpp +++ b/Common/include/toolboxes/MMS/CMMSIncNSSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CMMSIncNSSolution. * The implementations are in the CMMSIncNSSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,7 +26,6 @@ * License along with SU2. If not, see . */ - #pragma once #include @@ -38,14 +37,12 @@ * laminar incompressible Navier-Stokes equations. * \author T. Economon, E. van der Weide */ -class CMMSIncNSSolution final: public CVerificationSolution { - -protected: - +class CMMSIncNSSolution final : public CVerificationSolution { + protected: /*--- Variables that define the solution and MMS source term. ---*/ - su2double Viscosity; /*!< \brief Viscosity, must be constant. */ - su2double Density; /*!< \brief Density, must be constant. */ - su2double Temperature; /*!< \brief Temperature, just to be safe. */ + su2double Viscosity; /*!< \brief Viscosity, must be constant. */ + su2double Density; /*!< \brief Density, must be constant. */ + su2double Temperature; /*!< \brief Temperature, just to be safe. */ /*--- Constants, which describe this manufactured solution. This is a viscous solution where the primitive variables vary as a combination @@ -53,13 +50,12 @@ class CMMSIncNSSolution final: public CVerificationSolution { Knupp P, "Code verification by the method of manufactured solutions," SAND 2000-1444, Sandia National Laboratories, Albuquerque, NM, 2000. ---*/ - su2double P_0; /*!< \brief Parameter for the pressure solution. */ - su2double u_0; /*!< \brief Parameter for the x-velocity solution. */ - su2double v_0; /*!< \brief Parameter for the y-velocity solution. */ - su2double epsilon; /*!< \brief Parameter for the velocity solutions. */ - -public: + su2double P_0; /*!< \brief Parameter for the pressure solution. */ + su2double u_0; /*!< \brief Parameter for the x-velocity solution. */ + su2double v_0; /*!< \brief Parameter for the y-velocity solution. */ + su2double epsilon; /*!< \brief Parameter for the velocity solutions. */ + public: /*! * \brief Constructor of the class. */ @@ -72,10 +68,7 @@ class CMMSIncNSSolution final: public CVerificationSolution { * \param[in] val_iMesh - Multigrid level of the solver. * \param[in] config - Configuration of the particular problem. */ - CMMSIncNSSolution(unsigned short val_nDim, - unsigned short val_nvar, - unsigned short val_iMesh, - CConfig* config); + CMMSIncNSSolution(unsigned short val_nDim, unsigned short val_nvar, unsigned short val_iMesh, CConfig* config); /*! * \brief Destructor of the class. @@ -88,9 +81,7 @@ class CMMSIncNSSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetSolution(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; /*! * \brief Get the boundary conditions state for an exact solution. @@ -98,9 +89,7 @@ class CMMSIncNSSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetBCState(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; /*! * \brief Get the source term for the manufactured solution (MMS). @@ -108,9 +97,7 @@ class CMMSIncNSSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetMMSSourceTerm(const su2double *val_coords, - const su2double val_t, - su2double *val_source) const override; + void GetMMSSourceTerm(const su2double* val_coords, const su2double val_t, su2double* val_source) const override; /*! * \brief Whether or not this verification solution is a manufactured solution. diff --git a/Common/include/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.hpp b/Common/include/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.hpp index 3977986f43b..f8b5599a193 100644 --- a/Common/include/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.hpp +++ b/Common/include/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CMMSNSTwoHalfCirclesSolution. * The implementations are in the CMMSNSTwoHalfCirclesSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,7 +26,6 @@ * License along with SU2. If not, see . */ - #pragma once #include @@ -38,33 +37,31 @@ laminar Navier-Stokes equations on the domain between two half circles. * \author E. van der Weide, T. Economon */ -class CMMSNSTwoHalfCirclesSolution final: public CVerificationSolution { - -protected: +class CMMSNSTwoHalfCirclesSolution final : public CVerificationSolution { + protected: /*--- Variables that define the solution and MMS source term. ---*/ - su2double Gamma; /*!< \brief Specific heat ratio. */ - su2double RGas; /*!< \brief Gas constant. */ - su2double Viscosity; /*!< \brief Constant viscosity. */ - su2double Conductivity; /*!< \brief Constant thermal conductivity. */ - su2double TWall; /*!< \brief Prescribed wall temperature at the outer wall. */ + su2double Gamma; /*!< \brief Specific heat ratio. */ + su2double RGas; /*!< \brief Gas constant. */ + su2double Viscosity; /*!< \brief Constant viscosity. */ + su2double Conductivity; /*!< \brief Constant thermal conductivity. */ + su2double TWall; /*!< \brief Prescribed wall temperature at the outer wall. */ - su2double Pressure_Ref; /*!< \brief Reference pressure for non-dimensionalization. */ - su2double Density_Ref; /*!< \brief Reference density for non-dimensionalization. */ - su2double Velocity_Ref; /*!< \brief Reference velocity for non-dimensionalization. */ + su2double Pressure_Ref; /*!< \brief Reference pressure for non-dimensionalization. */ + su2double Density_Ref; /*!< \brief Reference density for non-dimensionalization. */ + su2double Velocity_Ref; /*!< \brief Reference velocity for non-dimensionalization. */ /*--- Constants, which describe this manufactured solution. The primitive variables rho, T, u, v and w are described by analytical functions in such a way that the inner wall is an adiabatic no-slip wall and the outer wall is an isothermal no-slip wall. ---*/ - su2double rho_0; /*!< \brief Constant density. */ - su2double u_0; /*!< \brief Maximum x-velocity in the domain. */ - su2double v_0; /*!< \brief Maximum y-velocity in the domain. */ - - su2double a_T1; /*!< \brief Parameter for the temperature solution. */ - su2double a_T2; /*!< \brief Parameter for the temperature solution. */ + su2double rho_0; /*!< \brief Constant density. */ + su2double u_0; /*!< \brief Maximum x-velocity in the domain. */ + su2double v_0; /*!< \brief Maximum y-velocity in the domain. */ -public: + su2double a_T1; /*!< \brief Parameter for the temperature solution. */ + su2double a_T2; /*!< \brief Parameter for the temperature solution. */ + public: /*! * \brief Constructor of the class. */ @@ -77,10 +74,8 @@ class CMMSNSTwoHalfCirclesSolution final: public CVerificationSolution { * \param[in] val_iMesh - Multigrid level of the solver. * \param[in] config - Configuration of the particular problem. */ - CMMSNSTwoHalfCirclesSolution(unsigned short val_nDim, - unsigned short val_nvar, - unsigned short val_iMesh, - CConfig* config); + CMMSNSTwoHalfCirclesSolution(unsigned short val_nDim, unsigned short val_nvar, unsigned short val_iMesh, + CConfig* config); /*! * \brief Destructor of the class. @@ -93,9 +88,7 @@ class CMMSNSTwoHalfCirclesSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetSolution(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; /*! * \brief Get the boundary conditions state for an exact solution. @@ -103,9 +96,7 @@ class CMMSNSTwoHalfCirclesSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetBCState(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; /*! * \brief Get the source term for the manufactured solution (MMS). @@ -113,9 +104,7 @@ class CMMSNSTwoHalfCirclesSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetMMSSourceTerm(const su2double *val_coords, - const su2double val_t, - su2double *val_source) const override; + void GetMMSSourceTerm(const su2double* val_coords, const su2double val_t, su2double* val_source) const override; /*! * \brief Whether or not this verification solution is a manufactured solution. diff --git a/Common/include/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.hpp b/Common/include/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.hpp index 5ae529d2251..92d03efbe5b 100644 --- a/Common/include/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.hpp +++ b/Common/include/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CMMSNSTwoHalfSpheresSolution. * The implementations are in the CMMSNSTwoHalfSpheresSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,7 +26,6 @@ * License along with SU2. If not, see . */ - #pragma once #include @@ -38,34 +37,32 @@ laminar Navier-Stokes equations on the domain between two half spheres. * \author E. van der Weide, T. Economon */ -class CMMSNSTwoHalfSpheresSolution final: public CVerificationSolution { - -protected: +class CMMSNSTwoHalfSpheresSolution final : public CVerificationSolution { + protected: /*--- Variables that define the solution and MMS source term. ---*/ - su2double Gamma; /*!< \brief Specific heat ratio. */ - su2double RGas; /*!< \brief Gas constant. */ - su2double Viscosity; /*!< \brief Constant viscosity. */ - su2double Conductivity; /*!< \brief Constant thermal conductivity. */ - su2double TWall; /*!< \brief Prescribed wall temperature at the outer wall. */ + su2double Gamma; /*!< \brief Specific heat ratio. */ + su2double RGas; /*!< \brief Gas constant. */ + su2double Viscosity; /*!< \brief Constant viscosity. */ + su2double Conductivity; /*!< \brief Constant thermal conductivity. */ + su2double TWall; /*!< \brief Prescribed wall temperature at the outer wall. */ - su2double Pressure_Ref; /*!< \brief Reference pressure for non-dimensionalization. */ - su2double Density_Ref; /*!< \brief Reference density for non-dimensionalization. */ - su2double Velocity_Ref; /*!< \brief Reference velocity for non-dimensionalization. */ + su2double Pressure_Ref; /*!< \brief Reference pressure for non-dimensionalization. */ + su2double Density_Ref; /*!< \brief Reference density for non-dimensionalization. */ + su2double Velocity_Ref; /*!< \brief Reference velocity for non-dimensionalization. */ /*--- Constants, which describe this manufactured solution. The primitive variables rho, T, u, v and w are described by analytical functions in such a way that the inner wall is an adiabatic no-slip wall and the outer wall is an isothermal no-slip wall. ---*/ - su2double rho_0; /*!< \brief Constant density. */ - su2double u_0; /*!< \brief Maximum x-velocity in the domain. */ - su2double v_0; /*!< \brief Maximum y-velocity in the domain. */ - su2double w_0; /*!< \brief Maximum z-velocity in the domain. */ - - su2double a_T1; /*!< \brief Parameter for the temperature solution. */ - su2double a_T2; /*!< \brief Parameter for the temperature solution. */ + su2double rho_0; /*!< \brief Constant density. */ + su2double u_0; /*!< \brief Maximum x-velocity in the domain. */ + su2double v_0; /*!< \brief Maximum y-velocity in the domain. */ + su2double w_0; /*!< \brief Maximum z-velocity in the domain. */ -public: + su2double a_T1; /*!< \brief Parameter for the temperature solution. */ + su2double a_T2; /*!< \brief Parameter for the temperature solution. */ + public: /*! * \brief Constructor of the class. */ @@ -78,10 +75,8 @@ class CMMSNSTwoHalfSpheresSolution final: public CVerificationSolution { * \param[in] val_iMesh - Multigrid level of the solver. * \param[in] config - Configuration of the particular problem. */ - CMMSNSTwoHalfSpheresSolution(unsigned short val_nDim, - unsigned short val_nvar, - unsigned short val_iMesh, - CConfig* config); + CMMSNSTwoHalfSpheresSolution(unsigned short val_nDim, unsigned short val_nvar, unsigned short val_iMesh, + CConfig* config); /*! * \brief Destructor of the class. @@ -94,9 +89,7 @@ class CMMSNSTwoHalfSpheresSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetSolution(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; /*! * \brief Get the boundary conditions state for an exact solution. @@ -104,9 +97,7 @@ class CMMSNSTwoHalfSpheresSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetBCState(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; /*! * \brief Get the source term for the manufactured solution (MMS). @@ -114,9 +105,7 @@ class CMMSNSTwoHalfSpheresSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetMMSSourceTerm(const su2double *val_coords, - const su2double val_t, - su2double *val_source) const override; + void GetMMSSourceTerm(const su2double* val_coords, const su2double val_t, su2double* val_source) const override; /*! * \brief Whether or not this verification solution is a manufactured solution. diff --git a/Common/include/toolboxes/MMS/CMMSNSUnitQuadSolution.hpp b/Common/include/toolboxes/MMS/CMMSNSUnitQuadSolution.hpp index c74ec885101..fbdc6a8f82e 100644 --- a/Common/include/toolboxes/MMS/CMMSNSUnitQuadSolution.hpp +++ b/Common/include/toolboxes/MMS/CMMSNSUnitQuadSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CMMSNSUnitQuadSolution. * The implementations are in the CMMSNSUnitQuadSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,7 +26,6 @@ * License along with SU2. If not, see . */ - #pragma once #include @@ -38,10 +37,8 @@ laminar Navier-Stokes equations on a unit quad. * \author E. van der Weide, T. Economon */ -class CMMSNSUnitQuadSolution final: public CVerificationSolution { - -protected: - +class CMMSNSUnitQuadSolution final : public CVerificationSolution { + protected: /*--- Variables that define the solution and MMS source term. ---*/ su2double Gamma; /*!< \brief Specific heat ratio. */ su2double RGas; /*!< \brief Gas constant. */ @@ -53,38 +50,37 @@ class CMMSNSUnitQuadSolution final: public CVerificationSolution { combination of sine and cosine functions. The unit quad is probably not necessary, and an arbitrary domain should work as well. ---*/ - su2double L; /*!< \brief Length scale. */ - su2double a_Px; /*!< \brief Parameter for the pressure solution. */ - su2double a_Pxy; /*!< \brief Parameter for the pressure solution. */ - su2double a_Py; /*!< \brief Parameter for the pressure solution. */ - su2double a_rhox; /*!< \brief Parameter for the density solution. */ - su2double a_rhoxy; /*!< \brief Parameter for the density solution. */ - su2double a_rhoy; /*!< \brief Parameter for the density solution. */ - su2double a_ux; /*!< \brief Parameter for the x-velocity solution. */ - su2double a_uxy; /*!< \brief Parameter for the x-velocity solution. */ - su2double a_uy; /*!< \brief Parameter for the x-velocity solution. */ - su2double a_vx; /*!< \brief Parameter for the y-velocity solution. */ - su2double a_vxy; /*!< \brief Parameter for the y-velocity solution. */ - su2double a_vy; /*!< \brief Parameter for the y-velocity solution. */ - su2double P_0; /*!< \brief Parameter for the pressure solution. */ - su2double P_x; /*!< \brief Parameter for the pressure solution. */ - su2double P_xy; /*!< \brief Parameter for the pressure solution. */ - su2double P_y; /*!< \brief Parameter for the pressure solution. */ - su2double rho_0; /*!< \brief Parameter for the density solution. */ - su2double rho_x; /*!< \brief Parameter for the density solution. */ - su2double rho_xy; /*!< \brief Parameter for the density solution. */ - su2double rho_y; /*!< \brief Parameter for the density solution. */ - su2double u_0; /*!< \brief Parameter for the x-velocity solution. */ - su2double u_x; /*!< \brief Parameter for the x-velocity solution. */ - su2double u_xy; /*!< \brief Parameter for the x-velocity solution. */ - su2double u_y; /*!< \brief Parameter for the x-velocity solution. */ - su2double v_0; /*!< \brief Parameter for the y-velocity solution. */ - su2double v_x; /*!< \brief Parameter for the y-velocity solution. */ - su2double v_xy; /*!< \brief Parameter for the y-velocity solution. */ - su2double v_y; /*!< \brief Parameter for the y-velocity solution. */ - -public: - + su2double L; /*!< \brief Length scale. */ + su2double a_Px; /*!< \brief Parameter for the pressure solution. */ + su2double a_Pxy; /*!< \brief Parameter for the pressure solution. */ + su2double a_Py; /*!< \brief Parameter for the pressure solution. */ + su2double a_rhox; /*!< \brief Parameter for the density solution. */ + su2double a_rhoxy; /*!< \brief Parameter for the density solution. */ + su2double a_rhoy; /*!< \brief Parameter for the density solution. */ + su2double a_ux; /*!< \brief Parameter for the x-velocity solution. */ + su2double a_uxy; /*!< \brief Parameter for the x-velocity solution. */ + su2double a_uy; /*!< \brief Parameter for the x-velocity solution. */ + su2double a_vx; /*!< \brief Parameter for the y-velocity solution. */ + su2double a_vxy; /*!< \brief Parameter for the y-velocity solution. */ + su2double a_vy; /*!< \brief Parameter for the y-velocity solution. */ + su2double P_0; /*!< \brief Parameter for the pressure solution. */ + su2double P_x; /*!< \brief Parameter for the pressure solution. */ + su2double P_xy; /*!< \brief Parameter for the pressure solution. */ + su2double P_y; /*!< \brief Parameter for the pressure solution. */ + su2double rho_0; /*!< \brief Parameter for the density solution. */ + su2double rho_x; /*!< \brief Parameter for the density solution. */ + su2double rho_xy; /*!< \brief Parameter for the density solution. */ + su2double rho_y; /*!< \brief Parameter for the density solution. */ + su2double u_0; /*!< \brief Parameter for the x-velocity solution. */ + su2double u_x; /*!< \brief Parameter for the x-velocity solution. */ + su2double u_xy; /*!< \brief Parameter for the x-velocity solution. */ + su2double u_y; /*!< \brief Parameter for the x-velocity solution. */ + su2double v_0; /*!< \brief Parameter for the y-velocity solution. */ + su2double v_x; /*!< \brief Parameter for the y-velocity solution. */ + su2double v_xy; /*!< \brief Parameter for the y-velocity solution. */ + su2double v_y; /*!< \brief Parameter for the y-velocity solution. */ + + public: /*! * \brief Constructor of the class. */ @@ -97,10 +93,7 @@ class CMMSNSUnitQuadSolution final: public CVerificationSolution { * \param[in] val_iMesh - Multigrid level of the solver. * \param[in] config - Configuration of the particular problem. */ - CMMSNSUnitQuadSolution(unsigned short val_nDim, - unsigned short val_nvar, - unsigned short val_iMesh, - CConfig* config); + CMMSNSUnitQuadSolution(unsigned short val_nDim, unsigned short val_nvar, unsigned short val_iMesh, CConfig* config); /*! * \brief Destructor of the class. @@ -113,9 +106,7 @@ class CMMSNSUnitQuadSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetSolution(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; /*! * \brief Get the boundary conditions state for an exact solution. @@ -123,9 +114,7 @@ class CMMSNSUnitQuadSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetBCState(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; /*! * \brief Get the source term for the manufactured solution (MMS). @@ -133,9 +122,7 @@ class CMMSNSUnitQuadSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetMMSSourceTerm(const su2double *val_coords, - const su2double val_t, - su2double *val_source) const override; + void GetMMSSourceTerm(const su2double* val_coords, const su2double val_t, su2double* val_source) const override; /*! * \brief Whether or not this verification solution is a manufactured solution. diff --git a/Common/include/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.hpp b/Common/include/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.hpp index 5aa25502f09..c3b5a3e508c 100644 --- a/Common/include/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.hpp +++ b/Common/include/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CMMSNSUnitQuadSolutionWallBC. * The implementations are in the CMMSNSUnitQuadSolutionWallBC.cpp file. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,7 +26,6 @@ * License along with SU2. If not, see . */ - #pragma once #include @@ -38,10 +37,8 @@ laminar Navier-Stokes equations on a unit quad with wall boundary conditions. * \author E. van der Weide, T. Economon */ -class CMMSNSUnitQuadSolutionWallBC final: public CVerificationSolution { - -protected: - +class CMMSNSUnitQuadSolutionWallBC final : public CVerificationSolution { + protected: /*--- Variables that define the solution and MMS source term. ---*/ su2double Gamma; /*!< \brief Specific heat ratio. */ su2double RGas; /*!< \brief Gas constant. */ @@ -49,23 +46,22 @@ class CMMSNSUnitQuadSolutionWallBC final: public CVerificationSolution { su2double Conductivity; /*!< \brief Thermal conductivity, must be constant. */ su2double TWall; /*!< \brief Prescribed wall temperature at the upper wall. */ - su2double Pressure_Ref; /*!< \brief Reference pressure for non-dimensionalization. */ - su2double Density_Ref; /*!< \brief Reference density for non-dimensionalization. */ - su2double Velocity_Ref; /*!< \brief Reference velocity for non-dimensionalization. */ + su2double Pressure_Ref; /*!< \brief Reference pressure for non-dimensionalization. */ + su2double Density_Ref; /*!< \brief Reference density for non-dimensionalization. */ + su2double Velocity_Ref; /*!< \brief Reference velocity for non-dimensionalization. */ /*--- Constants, which describe this manufactured solution. The primitive variables rho, T, u and v are described by analytical functions in such a way that the lower wall is an adiabatic no-slip wall and the upper wall is an isothermal no-slip wall. ---*/ - su2double rho_0; /*!< \brief Constant density. */ - su2double u_0; /*!< \brief Maximum x-velocity in the domain. */ - su2double v_0; /*!< \brief Maximum y-velocity in the domain. */ - - su2double a_T1; /*!< \brief Parameter for the temperature solution. */ - su2double a_T2; /*!< \brief Parameter for the temperature solution. */ + su2double rho_0; /*!< \brief Constant density. */ + su2double u_0; /*!< \brief Maximum x-velocity in the domain. */ + su2double v_0; /*!< \brief Maximum y-velocity in the domain. */ -public: + su2double a_T1; /*!< \brief Parameter for the temperature solution. */ + su2double a_T2; /*!< \brief Parameter for the temperature solution. */ + public: /*! * \brief Constructor of the class. */ @@ -78,10 +74,8 @@ class CMMSNSUnitQuadSolutionWallBC final: public CVerificationSolution { * \param[in] val_iMesh - Multigrid level of the solver. * \param[in] config - Configuration of the particular problem. */ - CMMSNSUnitQuadSolutionWallBC(unsigned short val_nDim, - unsigned short val_nvar, - unsigned short val_iMesh, - CConfig* config); + CMMSNSUnitQuadSolutionWallBC(unsigned short val_nDim, unsigned short val_nvar, unsigned short val_iMesh, + CConfig* config); /*! * \brief Destructor of the class. @@ -94,9 +88,7 @@ class CMMSNSUnitQuadSolutionWallBC final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetSolution(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; /*! * \brief Get the boundary conditions state for an exact solution. @@ -104,9 +96,7 @@ class CMMSNSUnitQuadSolutionWallBC final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetBCState(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; /*! * \brief Get the source term for the manufactured solution (MMS). @@ -114,9 +104,7 @@ class CMMSNSUnitQuadSolutionWallBC final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetMMSSourceTerm(const su2double *val_coords, - const su2double val_t, - su2double *val_source) const override; + void GetMMSSourceTerm(const su2double* val_coords, const su2double val_t, su2double* val_source) const override; /*! * \brief Whether or not this verification solution is a manufactured solution. diff --git a/Common/include/toolboxes/MMS/CNSUnitQuadSolution.hpp b/Common/include/toolboxes/MMS/CNSUnitQuadSolution.hpp index 5bd57b60045..32f9f2d4263 100644 --- a/Common/include/toolboxes/MMS/CNSUnitQuadSolution.hpp +++ b/Common/include/toolboxes/MMS/CNSUnitQuadSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CNSUnitQuadSolution.hpp. * The implementations are in the CNSUnitQuadSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,7 +26,6 @@ * License along with SU2. If not, see . */ - #pragma once #include @@ -38,17 +37,14 @@ on a unit quad, heat conduction is neglected. * \author E. van der Weide, T. Economon */ -class CNSUnitQuadSolution final: public CVerificationSolution { - -protected: - +class CNSUnitQuadSolution final : public CVerificationSolution { + protected: /*--- Variables that define the soltion. ---*/ - su2double Gm1; /*!< \brief Gamma minus 1 */ - su2double flowAngle; /*!< \brief Angle of the velocity vector in radians. */ - su2double Viscosity; /*!< \brief Viscosity, must be constant. */ - -public: + su2double Gm1; /*!< \brief Gamma minus 1 */ + su2double flowAngle; /*!< \brief Angle of the velocity vector in radians. */ + su2double Viscosity; /*!< \brief Viscosity, must be constant. */ + public: /*! * \brief Constructor of the class. */ @@ -61,10 +57,7 @@ class CNSUnitQuadSolution final: public CVerificationSolution { * \param[in] val_iMesh - Multigrid level of the solver. * \param[in] config - Configuration of the particular problem. */ - CNSUnitQuadSolution(unsigned short val_nDim, - unsigned short val_nvar, - unsigned short val_iMesh, - CConfig* config); + CNSUnitQuadSolution(unsigned short val_nDim, unsigned short val_nvar, unsigned short val_iMesh, CConfig* config); /*! * \brief Destructor of the class. @@ -77,9 +70,7 @@ class CNSUnitQuadSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetSolution(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; /*! * \brief Get the boundary conditions state for an exact solution. @@ -87,7 +78,5 @@ class CNSUnitQuadSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetBCState(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; }; diff --git a/Common/include/toolboxes/MMS/CRinglebSolution.hpp b/Common/include/toolboxes/MMS/CRinglebSolution.hpp index ff9a63fd62f..2c1ede87c0a 100644 --- a/Common/include/toolboxes/MMS/CRinglebSolution.hpp +++ b/Common/include/toolboxes/MMS/CRinglebSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CRinglebSolution.hpp. * The implementations are in the CRinglebSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,7 +26,6 @@ * License along with SU2. If not, see . */ - #pragma once #include @@ -37,18 +36,15 @@ * \brief Class to define the required data for the Ringleb flow. * \author E. van der Weide, T. Economon */ -class CRinglebSolution final: public CVerificationSolution { - -protected: - +class CRinglebSolution final : public CVerificationSolution { + protected: /*--- Variables involving gamma. ---*/ - su2double Gamma; /*!< \brief Gamma */ - su2double Gm1; /*!< \brief Gamma minus 1 */ - su2double tovGm1; /*!< \brief 2 over Gamma minus 1 */ - su2double tGamOvGm1; /*!< \brief 2 Gamma over Gamma minus 1 */ - -public: + su2double Gamma; /*!< \brief Gamma */ + su2double Gm1; /*!< \brief Gamma minus 1 */ + su2double tovGm1; /*!< \brief 2 over Gamma minus 1 */ + su2double tGamOvGm1; /*!< \brief 2 Gamma over Gamma minus 1 */ + public: /*! * \brief Constructor of the class. */ @@ -61,10 +57,7 @@ class CRinglebSolution final: public CVerificationSolution { * \param[in] val_iMesh - Multigrid level of the solver. * \param[in] config - Configuration of the particular problem. */ - CRinglebSolution(unsigned short val_nDim, - unsigned short val_nvar, - unsigned short val_iMesh, - CConfig* config); + CRinglebSolution(unsigned short val_nDim, unsigned short val_nvar, unsigned short val_iMesh, CConfig* config); /*! * \brief Destructor of the class. @@ -77,9 +70,7 @@ class CRinglebSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetSolution(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; /*! * \brief Get the boundary conditions state for an exact solution. @@ -87,7 +78,5 @@ class CRinglebSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetBCState(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; }; diff --git a/Common/include/toolboxes/MMS/CTGVSolution.hpp b/Common/include/toolboxes/MMS/CTGVSolution.hpp index de8537a8846..914b34a5e1c 100644 --- a/Common/include/toolboxes/MMS/CTGVSolution.hpp +++ b/Common/include/toolboxes/MMS/CTGVSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CTGVSolution. * The implementations are in the CTGVSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,7 +26,6 @@ * License along with SU2. If not, see . */ - #pragma once #include @@ -37,20 +36,17 @@ * \brief Class to define the required data for the Taylor Green Vortex. * \author E. van der Weide, T. Economon */ -class CTGVSolution final: public CVerificationSolution { - -protected: - +class CTGVSolution final : public CVerificationSolution { + protected: /*--- TGV specific conditions. ---*/ - su2double tgvLength; /*!< \brief Taylor-Green length scale. */ - su2double tgvVelocity; /*!< \brief Taylor-Green velocity. */ - su2double tgvDensity; /*!< \brief Taylor-Green density. */ - su2double tgvPressure; /*!< \brief Taylor-Green pressure. */ - su2double ovGm1; /*!< \brief 1 over Gamma minus 1 */ - -public: + su2double tgvLength; /*!< \brief Taylor-Green length scale. */ + su2double tgvVelocity; /*!< \brief Taylor-Green velocity. */ + su2double tgvDensity; /*!< \brief Taylor-Green density. */ + su2double tgvPressure; /*!< \brief Taylor-Green pressure. */ + su2double ovGm1; /*!< \brief 1 over Gamma minus 1 */ + public: /*! * \brief Constructor of the class. */ @@ -63,10 +59,7 @@ class CTGVSolution final: public CVerificationSolution { * \param[in] val_iMesh - Multigrid level of the solver. * \param[in] config - Configuration of the particular problem. */ - CTGVSolution(unsigned short val_nDim, - unsigned short val_nvar, - unsigned short val_iMesh, - CConfig* config); + CTGVSolution(unsigned short val_nDim, unsigned short val_nvar, unsigned short val_iMesh, CConfig* config); /*! * \brief Destructor of the class. @@ -79,9 +72,7 @@ class CTGVSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetSolution(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; /*! * \brief Whether or not the exact solution is known for this verification solution. diff --git a/Common/include/toolboxes/MMS/CUserDefinedSolution.hpp b/Common/include/toolboxes/MMS/CUserDefinedSolution.hpp index b6c2d1be6f5..7a6d7c74ecc 100644 --- a/Common/include/toolboxes/MMS/CUserDefinedSolution.hpp +++ b/Common/include/toolboxes/MMS/CUserDefinedSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CUserDefinedSolution. * The implementations are in the CUserDefinedSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -36,10 +36,8 @@ * \brief Class to define the required data for a user defined solution. * \author E. van der Weide, T. Economon */ -class CUserDefinedSolution final: public CVerificationSolution { - -public: - +class CUserDefinedSolution final : public CVerificationSolution { + public: /*! * \brief Constructor of the class. */ @@ -52,10 +50,7 @@ class CUserDefinedSolution final: public CVerificationSolution { * \param[in] val_iMesh - Multigrid level of the solver. * \param[in] config - Configuration of the particular problem. */ - CUserDefinedSolution(unsigned short val_nDim, - unsigned short val_nvar, - unsigned short val_iMesh, - CConfig* config); + CUserDefinedSolution(unsigned short val_nDim, unsigned short val_nvar, unsigned short val_iMesh, CConfig* config); /*! * \brief Destructor of the class. @@ -68,9 +63,7 @@ class CUserDefinedSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetSolution(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; /*! * \brief Get the boundary conditions state for an exact solution. @@ -78,9 +71,7 @@ class CUserDefinedSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const override; + void GetBCState(const su2double* val_coords, const su2double val_t, su2double* val_solution) const override; /*! * \brief Get the source term for the manufactured solution (MMS). @@ -88,9 +79,7 @@ class CUserDefinedSolution final: public CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetMMSSourceTerm(const su2double *val_coords, - const su2double val_t, - su2double *val_source) const override; + void GetMMSSourceTerm(const su2double* val_coords, const su2double val_t, su2double* val_source) const override; /*! * \brief Whether or not this verification solution is a manufactured solution. diff --git a/Common/include/toolboxes/MMS/CVerificationSolution.hpp b/Common/include/toolboxes/MMS/CVerificationSolution.hpp index c3308307b37..6fe6f849274 100644 --- a/Common/include/toolboxes/MMS/CVerificationSolution.hpp +++ b/Common/include/toolboxes/MMS/CVerificationSolution.hpp @@ -3,7 +3,7 @@ * \brief Header file for the base class CVerificationSolution. * The implementations are in the CVerificationSolution.cpp file. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -38,25 +38,22 @@ * \author T. Economon, E. van der Weide */ class CVerificationSolution { + protected: + int rank; /*!< \brief MPI Rank. */ + int size; /*!< \brief MPI Size. */ -protected: - int rank; /*!< \brief MPI Rank. */ - int size; /*!< \brief MPI Size. */ + unsigned short nDim; /*!< \brief Number of dimension of the problem. */ + unsigned short nVar; /*!< \brief Number of variables of the problem */ - unsigned short nDim; /*!< \brief Number of dimension of the problem. */ - unsigned short nVar; /*!< \brief Number of variables of the problem */ + MAIN_SOLVER Kind_Solver; /*!< \brief The kind of solver we are running. */ - MAIN_SOLVER Kind_Solver; /*!< \brief The kind of solver we are running. */ - -private: - - su2double *Error_RMS; /*!< \brief Vector with the global RMS error for each variable in a verification case. */ - su2double *Error_Max; /*!< \brief Vector with the global max error for each variable in a verification case. */ - unsigned long *Error_Point_Max; /*!< \brief Global index for the node with the max error in a verification case. */ - su2double **Error_Point_Max_Coord; /*!< \brief Coordinates for the node with the max error in a verification case. */ - -public: + private: + su2double* Error_RMS; /*!< \brief Vector with the global RMS error for each variable in a verification case. */ + su2double* Error_Max; /*!< \brief Vector with the global max error for each variable in a verification case. */ + unsigned long* Error_Point_Max; /*!< \brief Global index for the node with the max error in a verification case. */ + su2double** Error_Point_Max_Coord; /*!< \brief Coordinates for the node with the max error in a verification case. */ + public: /*! * \brief Constructor of the class. */ @@ -69,10 +66,7 @@ class CVerificationSolution { * \param[in] val_iMesh - Multigrid level of the solver. * \param[in] config - Definition of the particular problem. */ - CVerificationSolution(unsigned short val_nDim, - unsigned short val_nvar, - unsigned short val_iMesh, - CConfig *config); + CVerificationSolution(unsigned short val_nDim, unsigned short val_nvar, unsigned short val_iMesh, CConfig* config); /*! * \brief Destructor of the class. @@ -85,17 +79,14 @@ class CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - virtual void GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const; + virtual void GetSolution(const su2double* val_coords, const su2double val_t, su2double* val_solution) const; /*! * \brief Get the exact solution at the current position and t = 0. * \param[in] val_coords - Cartesian coordinates of the current position. * \param[in] val_solution - Array where the exact solution is stored. */ - void GetInitialCondition(const su2double *val_coords, - su2double *val_solution) const; + void GetInitialCondition(const su2double* val_coords, su2double* val_solution) const; /*! * \brief Get the boundary conditions state for an exact solution. @@ -103,9 +94,7 @@ class CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - virtual void GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const; + virtual void GetBCState(const su2double* val_coords, const su2double val_t, su2double* val_solution) const; /*! * \brief Get the source term for the manufactured solution (MMS). @@ -113,9 +102,7 @@ class CVerificationSolution { * \param[in] val_t - Current physical time. * \param[in] val_solution - Array where the exact solution is stored. */ - virtual void GetMMSSourceTerm(const su2double *val_coords, - const su2double val_t, - su2double *val_source) const; + virtual void GetMMSSourceTerm(const su2double* val_coords, const su2double val_t, su2double* val_source) const; /*! * \brief Whether or not this verification solution is a manufactured solution. @@ -137,10 +124,8 @@ class CVerificationSolution { * \param[in] val_solution - Array where the exact solution is stored. * \param[out] val_error - Array where the local error is stored. */ - void GetLocalError(const su2double *val_coords, - const su2double val_t, - const su2double *GetLocalErrorval_solution, - su2double *val_error) const; + void GetLocalError(const su2double* val_coords, const su2double val_t, const su2double* GetLocalErrorval_solution, + su2double* val_error) const; /*! * \brief Set the global RMS error for verification cases. @@ -169,7 +154,7 @@ class CVerificationSolution { * \param[in] val_error - Value of the maximum error to store in the position val_var. */ void SetError_Max(unsigned short val_var, su2double val_error, unsigned long val_point) { - Error_Max[val_var] = val_error; + Error_Max[val_var] = val_error; Error_Point_Max[val_var] = val_point; } @@ -184,8 +169,7 @@ class CVerificationSolution { if (val_error > Error_Max[val_var]) { Error_Max[val_var] = val_error; Error_Point_Max[val_var] = val_point; - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Error_Point_Max_Coord[val_var][iDim] = val_coord[iDim]; + for (unsigned short iDim = 0; iDim < nDim; iDim++) Error_Point_Max_Coord[val_var][iDim] = val_coord[iDim]; } } @@ -215,6 +199,5 @@ class CVerificationSolution { * \param[in] nDOFsGlobal - Global number of degrees of freedom for the current problem. * \param[in] config - Definition of the particular problem. */ - void SetVerificationError(unsigned long nDOFsGlobal, - CConfig *config); + void SetVerificationError(unsigned long nDOFsGlobal, CConfig* config); }; diff --git a/Common/include/toolboxes/allocation_toolbox.hpp b/Common/include/toolboxes/allocation_toolbox.hpp index ce02fd8f857..5f88eb3098b 100644 --- a/Common/include/toolboxes/allocation_toolbox.hpp +++ b/Common/include/toolboxes/allocation_toolbox.hpp @@ -5,7 +5,7 @@ * \note These are "kernel" functions, only to be used with good reason, * always try to use higher level container classes. * \author P. Gomes, D. Kavolis - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -40,18 +40,11 @@ #include -namespace MemoryAllocation -{ +namespace MemoryAllocation { -inline constexpr bool is_power_of_two(size_t x) -{ - return x && !(x & (x-1)); -} +inline constexpr bool is_power_of_two(size_t x) { return x && !(x & (x - 1)); } -inline constexpr size_t round_up(size_t multiple, size_t x) -{ - return ((x+multiple-1)/multiple)*multiple; -} +inline constexpr size_t round_up(size_t multiple, size_t x) { return ((x + multiple - 1) / multiple) * multiple; } /*! * \brief Aligned memory allocation compatible across platforms. @@ -60,20 +53,18 @@ inline constexpr size_t round_up(size_t multiple, size_t x) * \tparam ZeroInit, initialize memory to 0. * \return Pointer to memory, always use su2::aligned_free to deallocate. */ -template -inline T* aligned_alloc(size_t alignment, size_t size) noexcept -{ +template +inline T* aligned_alloc(size_t alignment, size_t size) noexcept { assert(is_power_of_two(alignment)); - if(alignment < alignof(void*)) alignment = alignof(void*); + if (alignment < alignof(void*)) alignment = alignof(void*); size = round_up(alignment, size); void* ptr = nullptr; #if defined(__APPLE__) - if(::posix_memalign(&ptr, alignment, size) != 0) - { + if (::posix_memalign(&ptr, alignment, size) != 0) { ptr = nullptr; } #elif defined(_WIN32) @@ -89,9 +80,8 @@ inline T* aligned_alloc(size_t alignment, size_t size) noexcept * \brief Free memory allocated with su2::aligned_alloc. * \param[in] ptr, pointer to memory we want to release. */ -template -inline void aligned_free(T* ptr) noexcept -{ +template +inline void aligned_free(T* ptr) noexcept { #if defined(_WIN32) _aligned_free(ptr); #else @@ -99,5 +89,4 @@ inline void aligned_free(T* ptr) noexcept #endif } -} // namespace - +} // namespace MemoryAllocation diff --git a/Common/include/toolboxes/geometry_toolbox.hpp b/Common/include/toolboxes/geometry_toolbox.hpp index 430bc62a39d..05cfdbc62fb 100644 --- a/Common/include/toolboxes/geometry_toolbox.hpp +++ b/Common/include/toolboxes/geometry_toolbox.hpp @@ -1,7 +1,7 @@ /*! * \file geometry_toolbox.hpp * \brief Collection of common lightweight geometry-oriented methods. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -33,58 +33,58 @@ namespace GeometryToolbox { /// @{ /*! \return ||a-b||^2 */ -template +template inline T SquaredDistance(Int nDim, const T* a, const U* b) { T d(0); - for(Int i = 0; i < nDim; i++) d += pow(a[i]-b[i], 2); + for (Int i = 0; i < nDim; i++) d += pow(a[i] - b[i], 2); return d; } /*! \return ||a-b|| */ -template +template inline T Distance(Int nDim, const T* a, const U* b) { return sqrt(SquaredDistance(nDim, a, b)); } /*! \brief d = a-b */ -template +template inline void Distance(Int nDim, const T* a, const T* b, T* d) { - for(Int i = 0; i < nDim; i++) d[i] = a[i] - b[i]; + for (Int i = 0; i < nDim; i++) d[i] = a[i] - b[i]; } /*! \brief Reflect a at b: c = 2*b - a */ -template -inline void PointPointReflect(Int nDim, const T* a, const T* b, T* d){ - for(Int i = 0; i < nDim; i++) d[i] = 2 * b[i] - a[i]; +template +inline void PointPointReflect(Int nDim, const T* a, const T* b, T* d) { + for (Int i = 0; i < nDim; i++) d[i] = 2 * b[i] - a[i]; } /*! \return a.b */ -template +template inline T DotProduct(Int nDim, const T* a, const T* b) { T d(0); - for (Int i = 0; i < nDim; ++i) d += a[i]*b[i]; + for (Int i = 0; i < nDim; ++i) d += a[i] * b[i]; return d; } /*! \return ||a||^2 */ -template +template inline T SquaredNorm(Int nDim, const T* a) { return DotProduct(nDim, a, a); } /*! \return ||a|| */ -template +template inline T Norm(Int nDim, const T* a) { return sqrt(SquaredNorm(nDim, a)); } /*! \brief c = a x b */ -template +template inline void CrossProduct(const T* a, const T* b, T* c) { - c[0] = a[1]*b[2] - a[2]*b[1]; - c[1] = a[2]*b[0] - a[0]*b[2]; - c[2] = a[0]*b[1] - a[1]*b[0]; + c[0] = a[1] * b[2] - a[2] * b[1]; + c[1] = a[2] * b[0] - a[0] * b[2]; + c[2] = a[0] * b[1] - a[1] * b[0]; } /*! @@ -92,14 +92,13 @@ inline void CrossProduct(const T* a, const T* b, T* c) { * direction d intersects the plane defined by point p0 and normal n. * \return The intersection distance. */ -template +template inline T LinePlaneIntersection(const T* l0, const T* d, const T* p0, const T* n, T* c) { T dist[nDim] = {0.0}; Distance(nDim, p0, l0, dist); T alpha = DotProduct(nDim, dist, n) / DotProduct(nDim, d, n); - for (int iDim = 0; iDim < nDim; ++iDim) - c[iDim] = l0[iDim] + alpha * d[iDim]; - return fabs(alpha) * Norm(nDim,d); + for (int iDim = 0; iDim < nDim; ++iDim) c[iDim] = l0[iDim] + alpha * d[iDim]; + return fabs(alpha) * Norm(nDim, d); } /*! @@ -107,22 +106,21 @@ inline T LinePlaneIntersection(const T* l0, const T* d, const T* p0, const T* n, * by point p0 and normal n if projected perpendicular to it. * \return The normal distance. */ -template +template inline T PointPlaneProjection(const T* p1, const T* p0, const T* n, T* c) { - return LinePlaneIntersection(p1, n, p0, n, c); + return LinePlaneIntersection(p1, n, p0, n, c); } /*! \brief Set U as the normal to a 2D line defined by coords[iPoint][iDim]. */ -template +template inline void LineNormal(const T& coords, U* normal) { normal[0] = coords[0][1] - coords[1][1]; normal[1] = coords[1][0] - coords[0][0]; } /*! \brief Normal vector of a triangle, cross product of two sides. */ -template +template inline void TriangleNormal(const T& coords, U* normal) { - U a[3], b[3]; for (int iDim = 0; iDim < 3; iDim++) { @@ -131,13 +129,14 @@ inline void TriangleNormal(const T& coords, U* normal) { } CrossProduct(a, b, normal); - normal[0] *= 0.5; normal[1] *= 0.5; normal[2] *= 0.5; + normal[0] *= 0.5; + normal[1] *= 0.5; + normal[2] *= 0.5; } /*! \brief Normal vector of a quadrilateral, cross product of the two diagonals. */ -template +template inline void QuadrilateralNormal(const T& coords, U* normal) { - U a[3], b[3]; for (int iDim = 0; iDim < 3; iDim++) { @@ -146,48 +145,62 @@ inline void QuadrilateralNormal(const T& coords, U* normal) { } CrossProduct(a, b, normal); - normal[0] *= 0.5; normal[1] *= 0.5; normal[2] *= 0.5; + normal[0] *= 0.5; + normal[1] *= 0.5; + normal[2] *= 0.5; +} + +/*! \brief Signed distance from a point to a plane defined by 3 coordinates. */ +template +inline U PointToPlaneDistance(const T& coords, const U* point) { + U normal[3], distance[3]; + TriangleNormal(coords, normal); + Distance(3, point, coords[0], distance); + return DotProduct(3, distance, normal) / Norm(3, normal); } /*! * \brief Compute a 3D rotation matrix. * \note The implicit ordering is rotation about the x, y, and then z axis. */ -template +template inline void RotationMatrix(Scalar theta, Scalar phi, Scalar psi, Matrix& mat) { + Scalar cosTheta = cos(theta); + Scalar cosPhi = cos(phi); + Scalar cosPsi = cos(psi); + Scalar sinTheta = sin(theta); + Scalar sinPhi = sin(phi); + Scalar sinPsi = sin(psi); - Scalar cosTheta = cos(theta); Scalar cosPhi = cos(phi); Scalar cosPsi = cos(psi); - Scalar sinTheta = sin(theta); Scalar sinPhi = sin(phi); Scalar sinPsi = sin(psi); - - mat[0][0] = cosPhi*cosPsi; - mat[1][0] = cosPhi*sinPsi; + mat[0][0] = cosPhi * cosPsi; + mat[1][0] = cosPhi * sinPsi; mat[2][0] = -sinPhi; - mat[0][1] = sinTheta*sinPhi*cosPsi - cosTheta*sinPsi; - mat[1][1] = sinTheta*sinPhi*sinPsi + cosTheta*cosPsi; - mat[2][1] = sinTheta*cosPhi; + mat[0][1] = sinTheta * sinPhi * cosPsi - cosTheta * sinPsi; + mat[1][1] = sinTheta * sinPhi * sinPsi + cosTheta * cosPsi; + mat[2][1] = sinTheta * cosPhi; - mat[0][2] = cosTheta*sinPhi*cosPsi + sinTheta*sinPsi; - mat[1][2] = cosTheta*sinPhi*sinPsi - sinTheta*cosPsi; - mat[2][2] = cosTheta*cosPhi; + mat[0][2] = cosTheta * sinPhi * cosPsi + sinTheta * sinPsi; + mat[1][2] = cosTheta * sinPhi * sinPsi - sinTheta * cosPsi; + mat[2][2] = cosTheta * cosPhi; } /*! \brief Compute a 2D rotation matrix. */ -template +template inline void RotationMatrix(Scalar psi, Matrix& mat) { - Scalar cosPsi = cos(psi); Scalar sinPsi = sin(psi); - mat[0][0] = cosPsi; mat[0][1] =-sinPsi; - mat[1][0] = sinPsi; mat[1][1] = cosPsi; + mat[0][0] = cosPsi; + mat[0][1] = -sinPsi; + mat[1][0] = sinPsi; + mat[1][1] = cosPsi; } /*! \brief Apply a rotation matrix (R) about origin (O) to a point at * distance (d) from it to obtain new coordinate (c). */ -template +template inline void Rotate(const Scalar R[][nDim], const Scalar* O, const Scalar* d, Scalar* c) { - for (int iDim = 0; iDim < nDim; ++iDim) { c[iDim] = O[iDim]; for (int k = 0; k < nDim; ++k) c[iDim] += R[iDim][k] * d[k]; @@ -195,16 +208,13 @@ inline void Rotate(const Scalar R[][nDim], const Scalar* O, const Scalar* d, Sca } /*! \brief Tangent projection */ -template +template inline void TangentProjection(Int nDim, const Mat& tensor, const Scalar* vector, Scalar* proj) { - - for (Int iDim = 0; iDim < nDim; iDim++) - proj[iDim] = DotProduct(nDim, tensor[iDim], vector); + for (Int iDim = 0; iDim < nDim; iDim++) proj[iDim] = DotProduct(nDim, tensor[iDim], vector); auto normalProj = DotProduct(nDim, proj, vector); - for (Int iDim = 0; iDim < nDim; iDim++) - proj[iDim] -= normalProj * vector[iDim]; + for (Int iDim = 0; iDim < nDim; iDim++) proj[iDim] -= normalProj * vector[iDim]; } /// @} -} +} // namespace GeometryToolbox diff --git a/Common/include/toolboxes/graph_toolbox.hpp b/Common/include/toolboxes/graph_toolbox.hpp index ef39ffaf80a..c5929e8f8da 100644 --- a/Common/include/toolboxes/graph_toolbox.hpp +++ b/Common/include/toolboxes/graph_toolbox.hpp @@ -2,7 +2,7 @@ * \file graph_toolbox.hpp * \brief Functions and classes to build/represent sparse graphs or sparse patterns. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -45,8 +45,7 @@ * \brief In FVM points are connected by the edges (faces) of the grid. * In FEM, two points are connected if they have an element in common. */ -enum class ConnectivityType {FiniteVolume=0, FiniteElement=1}; - +enum class ConnectivityType { FiniteVolume = 0, FiniteElement = 1 }; /*! * \class CCompressedSparsePattern @@ -55,17 +54,17 @@ enum class ConnectivityType {FiniteVolume=0, FiniteElement=1}; * If built for row-major storage the inner indices are column indices * and the pattern should be used as (row,icol), otherwise as (col,irow). */ -template +template class CCompressedSparsePattern { - static_assert(std::is_integral::value,""); + static_assert(std::is_integral::value, ""); -private: - su2vector m_outerPtr; /*!< \brief Start positions of the inner indices for each outer index. */ - su2vector m_innerIdx; /*!< \brief Inner indices of the non zero entries. */ - su2vector m_diagPtr; /*!< \brief Position of the diagonal entry. */ + private: + su2vector m_outerPtr; /*!< \brief Start positions of the inner indices for each outer index. */ + su2vector m_innerIdx; /*!< \brief Inner indices of the non zero entries. */ + su2vector m_diagPtr; /*!< \brief Position of the diagonal entry. */ su2vector m_innerIdxTransp; /*!< \brief Position of the transpose non zero entries, requires symmetry. */ -public: + public: using IndexType = Index_t; /*! @@ -74,9 +73,7 @@ class CCompressedSparsePattern { struct CInnerIter { const IndexType* const m_first = nullptr; const IndexType* const m_last = nullptr; - CInnerIter(const IndexType* first, const IndexType* last) : - m_first(first), m_last(last) { - } + CInnerIter(const IndexType* first, const IndexType* last) : m_first(first), m_last(last) {} const IndexType* begin() const { return m_first; } const IndexType* end() const { return m_last; } }; @@ -92,16 +89,14 @@ class CCompressedSparsePattern { * \param[in] outerPtrEnd - End of outer pointers. * \param[in] defaultInnerIdx - Default value for inner indices. */ - template - CCompressedSparsePattern(Iterator outerPtrBegin, Iterator outerPtrEnd, Index_t defaultInnerIdx) - { + template + CCompressedSparsePattern(Iterator outerPtrBegin, Iterator outerPtrEnd, Index_t defaultInnerIdx) { const auto size = outerPtrEnd - outerPtrBegin; m_outerPtr.resize(size); Index_t k = 0; - for(auto it = outerPtrBegin; it != outerPtrEnd; ++it) - m_outerPtr(k++) = *it; + for (auto it = outerPtrBegin; it != outerPtrEnd; ++it) m_outerPtr(k++) = *it; - m_innerIdx.resize(m_outerPtr(size-1)) = defaultInnerIdx; + m_innerIdx.resize(m_outerPtr(size - 1)) = defaultInnerIdx; } /*! @@ -110,12 +105,10 @@ class CCompressedSparsePattern { * \param[in] outerPtr - Outer index pointers. * \param[in] innerIdx - Inner indices. */ - CCompressedSparsePattern(su2vector&& outerPtr, - su2vector&& innerIdx) : - m_outerPtr(outerPtr), m_innerIdx(innerIdx) - { + CCompressedSparsePattern(su2vector&& outerPtr, su2vector&& innerIdx) + : m_outerPtr(outerPtr), m_innerIdx(innerIdx) { /*--- perform a basic sanity check ---*/ - assert(m_innerIdx.size() == m_outerPtr(m_outerPtr.size()-1)); + assert(m_innerIdx.size() == m_outerPtr(m_outerPtr.size() - 1)); } /*! @@ -124,51 +117,44 @@ class CCompressedSparsePattern { * \param[in] outerPtr - Outer index pointers. * \param[in] innerIdx - Inner indices. */ - template - CCompressedSparsePattern(const T& outerPtr, const T& innerIdx) - { + template + CCompressedSparsePattern(const T& outerPtr, const T& innerIdx) { m_outerPtr.resize(outerPtr.size()); - for(Index_t i=0; i >. */ - template - CCompressedSparsePattern(const T& lil) - { - m_outerPtr.resize(lil.size()+1); + template + CCompressedSparsePattern(const T& lil) { + m_outerPtr.resize(lil.size() + 1); m_outerPtr(0) = 0; - for(Index_t i=1; i < Index_t(m_outerPtr.size()); ++i) - m_outerPtr(i) = m_outerPtr(i-1) + lil[i-1].size(); + for (Index_t i = 1; i < Index_t(m_outerPtr.size()); ++i) m_outerPtr(i) = m_outerPtr(i - 1) + lil[i - 1].size(); m_innerIdx.resize(m_outerPtr(lil.size())); Index_t k = 0; - for(Index_t i=0; i < Index_t(lil.size()); ++i) - for(Index_t j=0; j < Index_t(lil[i].size()); ++j) - m_innerIdx(k++) = lil[i][j]; + for (Index_t i = 0; i < Index_t(lil.size()); ++i) + for (Index_t j = 0; j < Index_t(lil[i].size()); ++j) m_innerIdx(k++) = lil[i][j]; } /*! * \brief Build a list of pointers to the diagonal entries of the pattern. */ void buildDiagPtr() { - if(!m_diagPtr.empty()) return; + if (!m_diagPtr.empty()) return; m_diagPtr.resize(getOuterSize()); SU2_OMP_PARALLEL_(for schedule(static,roundUpDiv(getOuterSize(),omp_get_max_threads()))) - for(Index_t k = 0; k < getOuterSize(); ++k) - m_diagPtr(k) = findInnerIdx(k,k); + for (Index_t k = 0; k < getOuterSize(); ++k) m_diagPtr(k) = findInnerIdx(k, k); END_SU2_OMP_PARALLEL } @@ -176,15 +162,15 @@ class CCompressedSparsePattern { * \brief Build a list of pointers to the transpose entries of the pattern, requires symmetry. */ void buildTransposePtr() { - if(!m_innerIdxTransp.empty()) return; + if (!m_innerIdxTransp.empty()) return; m_innerIdxTransp.resize(getNumNonZeros()); SU2_OMP_PARALLEL_(for schedule(static,roundUpDiv(getOuterSize(),omp_get_max_threads()))) - for(Index_t i = 0; i < getOuterSize(); ++i) { - for(Index_t k = m_outerPtr(i); k < m_outerPtr(i+1); ++k) { + for (Index_t i = 0; i < getOuterSize(); ++i) { + for (Index_t k = m_outerPtr(i); k < m_outerPtr(i + 1); ++k) { auto j = m_innerIdx(k); - m_innerIdxTransp(k) = findInnerIdx(j,i); + m_innerIdxTransp(k) = findInnerIdx(j, i); assert(m_innerIdxTransp(k) != m_innerIdx.size() && "The pattern is not symmetric."); } } @@ -194,31 +180,23 @@ class CCompressedSparsePattern { /*! * \return True if the pattern is empty, i.e. has not been built yet. */ - inline bool empty() const { - return m_outerPtr.empty() || m_innerIdx.empty(); - } + inline bool empty() const { return m_outerPtr.empty() || m_innerIdx.empty(); } /*! * \return Number of rows/columns. */ - inline Index_t getOuterSize() const { - return m_outerPtr.size()-1; - } + inline Index_t getOuterSize() const { return m_outerPtr.size() - 1; } /*! * \return Number of non zero entries. */ - inline Index_t getNumNonZeros() const { - return m_innerIdx.size(); - } + inline Index_t getNumNonZeros() const { return m_innerIdx.size(); } /*! * \param[in] iOuterIdx - Outer index. * \return Number of inner indices associated with the outer index. */ - inline Index_t getNumNonZeros(Index_t iOuterIdx) const { - return m_outerPtr(iOuterIdx+1) - m_outerPtr(iOuterIdx); - } + inline Index_t getNumNonZeros(Index_t iOuterIdx) const { return m_outerPtr(iOuterIdx + 1) - m_outerPtr(iOuterIdx); } /*! * \param[in] iOuterIdx - Outer index. @@ -245,8 +223,7 @@ class CCompressedSparsePattern { * \return Iterator to inner dimension to use in range for loops. */ inline CInnerIter getInnerIter(Index_t iOuterIdx) const { - return CInnerIter(m_innerIdx.data()+m_outerPtr(iOuterIdx), - m_innerIdx.data()+m_outerPtr(iOuterIdx+1)); + return CInnerIter(m_innerIdx.data() + m_outerPtr(iOuterIdx), m_innerIdx.data() + m_outerPtr(iOuterIdx + 1)); } /*! @@ -256,8 +233,8 @@ class CCompressedSparsePattern { * or NNZ if position does not belong to the pattern. */ inline Index_t findInnerIdx(Index_t iOuterIdx, Index_t iInnerIdx) const { - for(Index_t k = m_outerPtr(iOuterIdx); k < m_outerPtr(iOuterIdx+1); ++k) - if(m_innerIdx(k) == iInnerIdx) return k; + for (Index_t k = m_outerPtr(iOuterIdx); k < m_outerPtr(iOuterIdx + 1); ++k) + if (m_innerIdx(k) == iInnerIdx) return k; return m_innerIdx.size(); } @@ -279,7 +256,7 @@ class CCompressedSparsePattern { inline Index_t quickFindInnerIdx(Index_t iOuterIdx, Index_t iInnerIdx) const { assert(isNonZero(iOuterIdx, iInnerIdx) && "Error, j does not belong to NZ(i)."); Index_t k = m_outerPtr(iOuterIdx); - while(m_innerIdx(k) != iInnerIdx) ++k; + while (m_innerIdx(k) != iInnerIdx) ++k; return k; } @@ -287,9 +264,7 @@ class CCompressedSparsePattern { * \param[in] iDiagIdx - Diagonal index (row == col). * \return Absolute position of the diagonal entry. */ - inline Index_t getDiagPtr(Index_t iDiagIdx) const { - return m_diagPtr(iDiagIdx); - } + inline Index_t getDiagPtr(Index_t iDiagIdx) const { return m_diagPtr(iDiagIdx); } /*! * \return Raw pointer to the outer pointer vector. @@ -336,8 +311,7 @@ class CCompressedSparsePattern { */ Index_t getMinInnerIdx() const { Index_t idx = std::numeric_limits::max(); - for(Index_t k=0; k::min(); - for(Index_t k=0; k +template using CEdgeToNonZeroMap = C2DContainer; - using CCompressedSparsePatternUL = CCompressedSparsePattern; using CCompressedSparsePatternL = CCompressedSparsePattern; using CEdgeToNonZeroMapUL = CEdgeToNonZeroMap; - /*! * \brief Build a sparse pattern from geometry information, of type FVM or FEM, * for a given fill-level. At fill-level N, the immediate neighbors of the @@ -379,19 +350,15 @@ using CEdgeToNonZeroMapUL = CEdgeToNonZeroMap; * \param[in] fillLvl - Target degree of neighborhood (immediate neighbors always added). * \return Compressed-Storage-Row sparse pattern. */ -template -CCompressedSparsePattern buildCSRPattern(Geometry_t& geometry, - ConnectivityType type, - Index_t fillLvl) -{ +template +CCompressedSparsePattern buildCSRPattern(Geometry_t& geometry, ConnectivityType type, Index_t fillLvl) { Index_t nPoint = geometry.GetnPoint(); - std::vector outerPtr(nPoint+1); + std::vector outerPtr(nPoint + 1); std::vector innerIdx; - innerIdx.reserve(nPoint); // at least this much space is needed + innerIdx.reserve(nPoint); // at least this much space is needed - for(Index_t iPoint = 0; iPoint < nPoint; ++iPoint) - { + for (Index_t iPoint = 0; iPoint < nPoint; ++iPoint) { /*--- Inner indices for iPoint start here. ---*/ outerPtr[iPoint] = innerIdx.size(); @@ -404,34 +371,28 @@ CCompressedSparsePattern buildCSRPattern(Geometry_t& geometry, /*--- Neighbors added in previous level. ---*/ std::set addedNeighbors(neighbors); - for(Index_t iLevel = 0; ; ++iLevel) - { + for (Index_t iLevel = 0;; ++iLevel) { /*--- New points added in this level. ---*/ std::set newNeighbors; /*--- For each point previously added, add its level 0 * neighbors, not duplicating any existing neighbor. ---*/ - for(auto jPoint : addedNeighbors) - { - if(type == ConnectivityType::FiniteVolume) - { + for (auto jPoint : addedNeighbors) { + if (type == ConnectivityType::FiniteVolume) { /*--- For FVM we know the neighbors of point j directly. ---*/ - for(Index_t kPoint : geometry.nodes->GetPoints(jPoint)) - if(neighbors.count(kPoint) == 0) // no duplication + for (Index_t kPoint : geometry.nodes->GetPoints(jPoint)) + if (neighbors.count(kPoint) == 0) // no duplication newNeighbors.insert(kPoint); - } - else // FiniteElement + } else // FiniteElement { /*--- For FEM we need the nodes of all elements that contain point j. ---*/ - for(auto iElem : geometry.nodes->GetElems(jPoint)) - { + for (auto iElem : geometry.nodes->GetElems(jPoint)) { auto elem = geometry.elem[iElem]; - for(unsigned short iNode = 0; iNode < elem->GetnNodes(); ++iNode) - { + for (unsigned short iNode = 0; iNode < elem->GetnNodes(); ++iNode) { Index_t kPoint = elem->GetNode(iNode); - if(neighbors.count(kPoint) == 0) // no duplication + if (neighbors.count(kPoint) == 0) // no duplication newNeighbors.insert(kPoint); } } @@ -440,7 +401,7 @@ CCompressedSparsePattern buildCSRPattern(Geometry_t& geometry, neighbors.insert(newNeighbors.begin(), newNeighbors.end()); - if(iLevel >= fillLvl) break; + if (iLevel >= fillLvl) break; /*--- For the next level we get the neighbours of the new points. ---*/ addedNeighbors = newNeighbors; @@ -455,7 +416,6 @@ CCompressedSparsePattern buildCSRPattern(Geometry_t& geometry, return CCompressedSparsePattern(outerPtr, innerIdx); } - /*! * \brief Build a lookup table of the absolute positions of the non zero entries * of a compressed sparse pattern, accessed when visiting the FVM edges @@ -465,27 +425,24 @@ CCompressedSparsePattern buildCSRPattern(Geometry_t& geometry, * \param[in] pattern - Sparse pattern. * \return nEdge by 2 matrix. */ -template +template CEdgeToNonZeroMap mapEdgesToSparsePattern(Geometry_t& geometry, - const CCompressedSparsePattern& pattern) -{ + const CCompressedSparsePattern& pattern) { assert(!pattern.empty()); - CEdgeToNonZeroMap edgeMap(geometry.GetnEdge(),2); + CEdgeToNonZeroMap edgeMap(geometry.GetnEdge(), 2); - for(Index_t iEdge = 0; iEdge < geometry.GetnEdge(); ++iEdge) - { - Index_t iPoint = geometry.edges->GetNode(iEdge,0); - Index_t jPoint = geometry.edges->GetNode(iEdge,1); + for (Index_t iEdge = 0; iEdge < geometry.GetnEdge(); ++iEdge) { + Index_t iPoint = geometry.edges->GetNode(iEdge, 0); + Index_t jPoint = geometry.edges->GetNode(iEdge, 1); - edgeMap(iEdge,0) = pattern.quickFindInnerIdx(iPoint,jPoint); - edgeMap(iEdge,1) = pattern.quickFindInnerIdx(jPoint,iPoint); + edgeMap(iEdge, 0) = pattern.quickFindInnerIdx(iPoint, jPoint); + edgeMap(iEdge, 1) = pattern.quickFindInnerIdx(jPoint, iPoint); } return edgeMap; } - /*! * \brief Create the natural coloring (equivalent to the normal sequential loop * order) for a given number of inner indexes. @@ -493,10 +450,8 @@ CEdgeToNonZeroMap mapEdgesToSparsePattern(Geometry_t& geometry, * \param[in] numInnerIndexes - Number of indexes that are to be colored. * \return Natural (sequential) coloring of the inner indices. */ -template -T createNaturalColoring(Index_t numInnerIndexes) -{ +template +T createNaturalColoring(Index_t numInnerIndexes) { /*--- One color. ---*/ su2vector outerPtr(2); outerPtr(0) = 0; @@ -504,12 +459,11 @@ T createNaturalColoring(Index_t numInnerIndexes) /*--- Containing all indexes in ascending order. ---*/ su2vector innerIdx(numInnerIndexes); - std::iota(innerIdx.data(), innerIdx.data()+numInnerIndexes, 0); + std::iota(innerIdx.data(), innerIdx.data() + numInnerIndexes, 0); return T(std::move(outerPtr), std::move(innerIdx)); } - /*! * \brief Color contiguous groups of outer indices of a sparse pattern such that * within each color, any two groups do not have inner indices in common. @@ -530,12 +484,11 @@ T createNaturalColoring(Index_t numInnerIndexes) * \param[out] indexColor - Optional, vector with colors given to the outer indices. * \return Coloring in the same type of the input pattern. */ -template +template T colorSparsePattern(const T& pattern, size_t groupSize = 1, bool balanceColors = false, - std::vector* indexColor = nullptr) -{ - static_assert(std::is_integral::value,""); - static_assert(std::numeric_limits::max() >= MaxColors,""); + std::vector* indexColor = nullptr) { + static_assert(std::is_integral::value, ""); + static_assert(std::numeric_limits::max() >= MaxColors, ""); using Index_t = typename T::IndexType; @@ -543,171 +496,161 @@ T colorSparsePattern(const T& pattern, size_t groupSize = 1, bool balanceColors const Index_t nOuter = pattern.getOuterSize(); /*--- Trivial case. ---*/ - if(groupSize >= nOuter) return createNaturalColoring(nOuter); + if (groupSize >= nOuter) return createNaturalColoring(nOuter); const Index_t minIdx = pattern.getMinInnerIdx(); - const Index_t nInner = pattern.getMaxInnerIdx()+1-minIdx; + const Index_t nInner = pattern.getMaxInnerIdx() + 1 - minIdx; /*--- Check the max memory condition (<< 23 is to count bits). ---*/ - if(size_t(nInner) > (MaxMB << 23)) return T(); + if (size_t(nInner) > (MaxMB << 23)) return T(); /*--- Vector with the color given to each outer index. ---*/ std::vector idxColor(nOuter); /*--- Start with one color, with no indices assigned. ---*/ - std::vector colorSize(1,0); + std::vector colorSize(1, 0); Color_t nColor = 1; { - /*--- For each color keep track of the inner indices that are in it. ---*/ - std::vector > innerInColor; - innerInColor.emplace_back(nInner, false); + /*--- For each color keep track of the inner indices that are in it. ---*/ + std::vector > innerInColor; + innerInColor.emplace_back(nInner, false); - /*--- Order in which we look for space in the colors to insert a new group. ---*/ - std::vector searchOrder(MaxColors); + /*--- Order in which we look for space in the colors to insert a new group. ---*/ + std::vector searchOrder(MaxColors); - auto outerPtr = pattern.outerPtr(); - auto innerIdx = pattern.innerIdx(); + auto outerPtr = pattern.outerPtr(); + auto innerIdx = pattern.innerIdx(); - for(Index_t iOuter = 0; iOuter < nOuter; iOuter += grpSz) - { - Index_t grpEnd = std::min(iOuter+grpSz, nOuter); + for (Index_t iOuter = 0; iOuter < nOuter; iOuter += grpSz) { + Index_t grpEnd = std::min(iOuter + grpSz, nOuter); - searchOrder.resize(nColor); - std::iota(searchOrder.begin(), searchOrder.end(), 0); + searchOrder.resize(nColor); + std::iota(searchOrder.begin(), searchOrder.end(), 0); - /*--- Balance sizes by looking for space in smaller colors first. ---*/ - if(balanceColors) { - std::sort(searchOrder.begin(), searchOrder.end(), - [&colorSize](Color_t a, Color_t b){return colorSize[a] < colorSize[b];}); - } + /*--- Balance sizes by looking for space in smaller colors first. ---*/ + if (balanceColors) { + std::sort(searchOrder.begin(), searchOrder.end(), + [&colorSize](Color_t a, Color_t b) { return colorSize[a] < colorSize[b]; }); + } - auto it = searchOrder.begin(); + auto it = searchOrder.begin(); - for(; it != searchOrder.end(); ++it) - { - bool free = true; - /*--- Traverse entire group as a large outer index. ---*/ - for(Index_t k = outerPtr[iOuter]; k < outerPtr[grpEnd] && free; ++k) - { - free = !innerInColor[*it][innerIdx[k]-minIdx]; + for (; it != searchOrder.end(); ++it) { + bool free = true; + /*--- Traverse entire group as a large outer index. ---*/ + for (Index_t k = outerPtr[iOuter]; k < outerPtr[grpEnd] && free; ++k) { + free = !innerInColor[*it][innerIdx[k] - minIdx]; + } + /*--- If none of the inner indices in the group appears in + * this color yet, it is assigned to the group. ---*/ + if (free) break; } - /*--- If none of the inner indices in the group appears in - * this color yet, it is assigned to the group. ---*/ - if(free) break; - } - Color_t color; + Color_t color; + + if (it != searchOrder.end()) { + /*--- Found a free color. ---*/ + color = *it; + } else { + /*--- No color was free, make space for a new one. ---*/ + color = nColor++; + if (nColor == MaxColors) return T(); + colorSize.push_back(0); + innerInColor.emplace_back(nInner, false); + } - if(it != searchOrder.end()) - { - /*--- Found a free color. ---*/ - color = *it; - } - else { - /*--- No color was free, make space for a new one. ---*/ - color = nColor++; - if(nColor == MaxColors) return T(); - colorSize.push_back(0); - innerInColor.emplace_back(nInner, false); - } + /*--- Assign color to group. ---*/ + for (Index_t k = iOuter; k < grpEnd; ++k) idxColor[k] = color; - /*--- Assign color to group. ---*/ - for(Index_t k = iOuter; k < grpEnd; ++k) idxColor[k] = color; + /*--- Mark the inner indices of the group as belonging to the color. ---*/ + for (Index_t k = outerPtr[iOuter]; k < outerPtr[grpEnd]; ++k) { + innerInColor[color][innerIdx[k] - minIdx] = true; + } - /*--- Mark the inner indices of the group as belonging to the color. ---*/ - for(Index_t k = outerPtr[iOuter]; k < outerPtr[grpEnd]; ++k) - { - innerInColor[color][innerIdx[k]-minIdx] = true; + /*--- Update count for the assigned color. ---*/ + colorSize[color] += grpEnd - iOuter; } - - /*--- Update count for the assigned color. ---*/ - colorSize[color] += grpEnd - iOuter; - } - } // matrix of bools goes out of scope - + } // matrix of bools goes out of scope /*--- Compress the coloring information. ---*/ - su2vector colorPtr(nColor+1); colorPtr(0) = 0; + su2vector colorPtr(nColor + 1); + colorPtr(0) = 0; su2vector outerIdx(nOuter); Index_t k = 0; - for(Color_t color = 0; color < nColor; ++color) - { - colorPtr(color+1) = colorPtr(color)+colorSize[color]; + for (Color_t color = 0; color < nColor; ++color) { + colorPtr(color + 1) = colorPtr(color) + colorSize[color]; - for(Index_t iOuter = 0; iOuter < nOuter; ++iOuter) - if(idxColor[iOuter] == color) - outerIdx(k++) = iOuter; + for (Index_t iOuter = 0; iOuter < nOuter; ++iOuter) + if (idxColor[iOuter] == color) outerIdx(k++) = iOuter; } /*--- Optional return of the direct color information. ---*/ - if(indexColor) *indexColor = std::move(idxColor); + if (indexColor) *indexColor = std::move(idxColor); /*--- Move compressed coloring into result pattern instance. ---*/ return T(std::move(colorPtr), std::move(outerIdx)); } - /*! * \brief A way to represent one grid color that allows range-for syntax. */ -template -struct GridColor -{ - static_assert(std::is_integral::value,""); +template +struct GridColor { + static_assert(std::is_integral::value, ""); const T size; T groupSize; const T* const indices; - GridColor(const T* idx = nullptr, T sz = 0, T grp = 0) : - size(sz), groupSize(grp), indices(idx) { } + GridColor(const T* idx = nullptr, T sz = 0, T grp = 0) : size(sz), groupSize(grp), indices(idx) {} - inline const T* begin() const {return indices;} - inline const T* end() const {return indices+size;} + inline const T* begin() const { return indices; } + inline const T* end() const { return indices + size; } }; - /*! * \brief A way to represent natural coloring {0,1,2,...,size-1} with zero * overhead (behaves like looping with an integer index, after optimization...). */ -template -struct DummyGridColor -{ - static_assert(std::is_integral::value,""); +template +struct DummyGridColor { + static_assert(std::is_integral::value, ""); T size; struct { - inline T operator[] (T i) const {return i;} - } - indices; + inline T operator[](T i) const { return i; } + } indices; - DummyGridColor(T sz = 0) : size(sz) { } + DummyGridColor(T sz = 0) : size(sz) {} struct IteratorLikeInt { T i; inline IteratorLikeInt(T pos = 0) : i(pos) {} - inline IteratorLikeInt& operator++ () {++i; return *this;} - inline IteratorLikeInt operator++ (int) {auto j=i++; return IteratorLikeInt(j);} - inline T operator* () const {return i;} - inline T operator-> () const {return i;} - inline bool operator==(const IteratorLikeInt& other) const {return i==other.i;} - inline bool operator!=(const IteratorLikeInt& other) const {return i!=other.i;} + inline IteratorLikeInt& operator++() { + ++i; + return *this; + } + inline IteratorLikeInt operator++(int) { + auto j = i++; + return IteratorLikeInt(j); + } + inline T operator*() const { return i; } + inline T operator->() const { return i; } + inline bool operator==(const IteratorLikeInt& other) const { return i == other.i; } + inline bool operator!=(const IteratorLikeInt& other) const { return i != other.i; } }; - inline IteratorLikeInt begin() const {return IteratorLikeInt(0);} - inline IteratorLikeInt end() const {return IteratorLikeInt(size);} + inline IteratorLikeInt begin() const { return IteratorLikeInt(0); } + inline IteratorLikeInt end() const { return IteratorLikeInt(size); } }; - /*! * \brief Computes the efficiency of a grid coloring for given number of threads and chunk size. */ -template -su2double coloringEfficiency(const SparsePattern& coloring, int numThreads, int chunkSize) -{ +template +su2double coloringEfficiency(const SparsePattern& coloring, int numThreads, int chunkSize) { using Index_t = typename SparsePattern::IndexType; /*--- Ideally compute time is proportional to total work over number of threads. ---*/ @@ -715,10 +658,10 @@ su2double coloringEfficiency(const SparsePattern& coloring, int numThreads, int /*--- In practice the total work is quantized first by colors and then by chunks. ---*/ Index_t real = 0; - for(Index_t color = 0; color < coloring.getOuterSize(); ++color) + for (Index_t color = 0; color < coloring.getOuterSize(); ++color) real += chunkSize * roundUpDiv(roundUpDiv(coloring.getNumNonZeros(color), chunkSize), numThreads); return ideal / real; } -/// @} \ No newline at end of file +/// @} diff --git a/Common/include/toolboxes/ndflattener.hpp b/Common/include/toolboxes/ndflattener.hpp index d6c3f5c28e4..16d5b1f02e9 100644 --- a/Common/include/toolboxes/ndflattener.hpp +++ b/Common/include/toolboxes/ndflattener.hpp @@ -2,7 +2,7 @@ * \file ndflattener.hpp * \brief Flatten pointer-to-pointer-... arrays for MPI communication * \author M. Aehle - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -212,8 +212,9 @@ class NdFlattener; * Introducing this was necessary because MPICH's Allgatherv behaved unexpectedly if there * is only one MPI rank (seemingly ignoring displs[0] != 0). */ -static inline void SU2_MPI_Allgatherv_safe(const void* sendbuf, int sendcount, SU2_MPI::Datatype sendtype, void* recvbuf, - const int* recvcounts, const int* displs, SU2_MPI::Datatype recvtype, SU2_MPI::Comm comm) { +static inline void SU2_MPI_Allgatherv_safe(const void* sendbuf, int sendcount, SU2_MPI::Datatype sendtype, + void* recvbuf, const int* recvcounts, const int* displs, + SU2_MPI::Datatype recvtype, SU2_MPI::Comm comm) { if (SU2_MPI::GetSize() == 1) { SU2_MPI::CopyData(sendbuf, recvbuf, sendcount, sendtype, displs[0]); } else { @@ -242,8 +243,7 @@ struct Nd_MPI_Environment { const int rank; const int size; - Nd_MPI_Environment(MPI_Datatype_t mpi_data = MPI_DOUBLE, - MPI_Datatype_t mpi_index = MPI_UNSIGNED_LONG, + Nd_MPI_Environment(MPI_Datatype_t mpi_data = MPI_DOUBLE, MPI_Datatype_t mpi_index = MPI_UNSIGNED_LONG, MPI_Communicator_t comm = SU2_MPI::GetComm(), MPI_Allgather_t MPI_Allgather_fun = &(SU2_MPI::Allgather), MPI_Allgatherv_t MPI_Allgatherv_fun = &(SU2_MPI_Allgatherv_safe)) @@ -311,19 +311,15 @@ class IndexAccumulator : public IndexAccumulator_Base { /*! The Base of NdFlattener is NdFlattener, but do also preserve constness. */ - using Nd_Base_t = su2conditional_t< - std::is_const::value, - const typename Nd_t::Base, - typename Nd_t::Base - >; + using Nd_Base_t = su2conditional_t::value, const typename Nd_t::Base, typename Nd_t::Base>; /*! Return type of operator[]. */ using LookupType = IndexAccumulator; /*! Return type of operator[] const. */ using LookupType_const = IndexAccumulator; + using Base::CheckBound; using Base::nd; using Base::offset; using Base::size; - using Base::CheckBound; /*! \brief Read one more index, checking whether it is in the range dictated by the NdFlattener and * previous indices. Non-const version. @@ -359,16 +355,12 @@ class IndexAccumulator<1, Nd_t_, Check> : public IndexAccumulator_Base<1, Nd_t_, /*! Return type of operator[]. * \details Data type of NdFlattener, but do also preserve constness. */ - using LookupType = su2conditional_t< - std::is_const::value, - const typename Nd_t::Data_t, - typename Nd_t::Data_t - >; + using LookupType = su2conditional_t::value, const typename Nd_t::Data_t, typename Nd_t::Data_t>; using LookupType_const = const typename Nd_t::Data_t; + using Base::CheckBound; using Base::nd; using Base::offset; using Base::size; - using Base::CheckBound; /*! \brief Return (possibly const) reference to the corresponding data element, checking if the index is in its range. * Non-const version. @@ -672,7 +664,7 @@ class NdFlattener : public NdFlattener { void set_g(Nd_MPI_Environment const& mpi_env, su2matrix const& Nodes_all, CurrentLayer const& local_version) { std::vector Nodes_all_K_as_int(mpi_env.size); - std::vector Nodes_all_k_cumulated( mpi_env.size + 1); + std::vector Nodes_all_k_cumulated(mpi_env.size + 1); //< [r] is the number of nodes in the current layer, summed over all processes with rank below r, **plus one**. // Used as displacements in Allgatherv, as we do not want to transfer the initial zeros, but we want to transfer the // last element of indices, which is the local nNodes of the layer below. Note that MPI needs indices of type 'int'. diff --git a/Common/include/toolboxes/printing_toolbox.hpp b/Common/include/toolboxes/printing_toolbox.hpp index 7461f0465de..5ede8972166 100644 --- a/Common/include/toolboxes/printing_toolbox.hpp +++ b/Common/include/toolboxes/printing_toolbox.hpp @@ -2,7 +2,7 @@ * \file printing_toolbox.hpp * \brief Header file for the printing toolbox. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -68,15 +69,11 @@ namespace PrintingToolbox { * * \author T. Albring */ -class CTablePrinter{ -public: - CTablePrinter(std::ostream * output, const std::string & separator = "|"); +class CTablePrinter { + public: + CTablePrinter(std::ostream* output, const std::string& separator = "|"); - enum alignment { - CENTER, - LEFT, - RIGHT - }; + enum alignment { CENTER, LEFT, RIGHT }; /*! * \brief Get number of columns of the table @@ -94,13 +91,13 @@ class CTablePrinter{ * \brief Set the separator between columns (outer decoration) * \param[in] separator - The separation character. */ - void SetSeparator(const std::string & separator); + void SetSeparator(const std::string& separator); /*! * \brief Set the separator between columns (inner decoration) * \param[in] separator - The separation character. */ - void SetInnerSeparator(const std::string & inner_separator); + void SetInnerSeparator(const std::string& inner_separator); /*! * \brief Set the alignment of the table entries (CENTER only works for the header at the moment). @@ -120,13 +117,12 @@ class CTablePrinter{ */ void SetPrintHeaderTopLine(bool print); - /*! * \brief Add a column to the table by specifiying the header name and the width. * \param[in] header_name - The name printed in the header. * \param[in] column_width - The width of the column. */ - void AddColumn(const std::string & header_name, int column_width); + void AddColumn(const std::string& header_name, int column_width); /*! * \brief Print the header. @@ -143,160 +139,152 @@ class CTablePrinter{ */ void SetPrecision(int precision); - template CTablePrinter& operator<<(T input){ - + template + CTablePrinter& operator<<(T input) { int indent = 0; /* --- Set the left separator --- */ - if (j_ == 0) - *out_stream_ << separator_; + if (j_ == 0) *out_stream_ << separator_; /* --- Determine and set the current alignment in the stream --- */ - if(align_ == LEFT) + if (align_ == LEFT) *out_stream_ << std::left; else if (align_ == RIGHT || align_ == CENTER) *out_stream_ << std::right; /*--- Print the current column value to the stream --- */ - *out_stream_ << std::setw(column_widths_.at(j_) - indent) - << std::setprecision(precision_) << input; + *out_stream_ << std::setw(column_widths_.at(j_) - indent) << std::setprecision(precision_) << input; /*--- Reset the column counter and if it is the last column, * add also a line break ---*/ - if (j_ == GetNumColumns()-1){ - *out_stream_ << std::setw(indent+1+(int)separator_.size()) << separator_ + "\n"; + if (j_ == GetNumColumns() - 1) { + *out_stream_ << std::setw(indent + 1 + (int)separator_.size()) << separator_ + "\n"; i_ = i_ + 1; j_ = 0; } else { - *out_stream_ << std::setw(indent+(int)inner_separator_.size()) << inner_separator_; + *out_stream_ << std::setw(indent + (int)inner_separator_.size()) << inner_separator_; j_ = j_ + 1; } return *this; } -private: - + private: /*! * \brief Print a horizontal line. */ void PrintHorizontalLine(); - std::ostream * out_stream_; /*< \brief The output stream. */ + std::ostream* out_stream_; /*< \brief The output stream. */ std::vector column_headers_; /*< \brief Vector of column header names. */ std::vector column_widths_; /*< \brief Vector of column widths. */ std::string separator_; /*< \brief Column separator char. */ std::string inner_separator_; /*< \brief Inner column separator char. */ - int precision_; /*< \brief Floating point precision */ + int precision_; /*< \brief Floating point precision */ int i_; /*< \brief Index of the current row. */ int j_; /*< \brief Index of the current column. */ - int table_width_; /*< \brief The total width of the table. */ - int align_; /*< \brief The current alignment. */ - bool print_header_top_line_, /*< \brief Printing the header top line. */ - print_header_bottom_line_; /*< \brief Printing the header bottom line. */ + int table_width_; /*< \brief The total width of the table. */ + int align_; /*< \brief The current alignment. */ + bool print_header_top_line_, /*< \brief Printing the header top line. */ + print_header_bottom_line_; /*< \brief Printing the header bottom line. */ }; - - -inline void PrintScreenFixed(std::ostream &stream, su2double val, unsigned short field_width) { - stream.precision(6); stream.setf(std::ios::fixed, std::ios::floatfield); stream.width(field_width); +inline void PrintScreenFixed(std::ostream& stream, su2double val, unsigned short field_width) { + stream.precision(6); + stream.setf(std::ios::fixed, std::ios::floatfield); + stream.width(field_width); stream << std::right << val; stream.unsetf(std::ios::fixed); } -inline void PrintScreenScientific(std::ostream &stream, su2double val, unsigned short field_width) { - stream.precision(4); stream.setf(std::ios::scientific, std::ios::floatfield); stream.width(field_width); +inline void PrintScreenScientific(std::ostream& stream, su2double val, unsigned short field_width) { + stream.precision(4); + stream.setf(std::ios::scientific, std::ios::floatfield); + stream.width(field_width); stream << std::right << val; stream.unsetf(std::ios::scientific); } -inline void PrintScreenInteger(std::ostream &stream, unsigned long val, unsigned short field_width){ +inline void PrintScreenInteger(std::ostream& stream, unsigned long val, unsigned short field_width) { stream.width(field_width); stream << std::right << val; } -inline void PrintScreenPercent(std::ostream &stream, su2double val, unsigned short field_width){ - stream.precision(2); stream.setf(std::ios::fixed, std::ios::floatfield); stream.width(field_width-1); +inline void PrintScreenPercent(std::ostream& stream, su2double val, unsigned short field_width) { + stream.precision(2); + stream.setf(std::ios::fixed, std::ios::floatfield); + stream.width(field_width - 1); stream << std::right << val << "%"; stream.unsetf(std::ios::fixed); } - -inline std::vector split(const std::string& s, char delimiter) -{ +inline std::vector split(const std::string& s, char delimiter) { std::vector tokens; std::string token; std::istringstream tokenStream(s); - while (std::getline(tokenStream, token, delimiter)) - { + while (std::getline(tokenStream, token, delimiter)) { tokens.push_back(token); } return tokens; } -inline int stoi(const std::string s){ +inline int stoi(const std::string s) { std::istringstream ss(s); int number; ss >> number; return number; } -inline su2double stod(const std::string s){ +inline su2double stod(const std::string s) { std::istringstream ss(s); su2double number; ss >> number; return number; } -inline std::string to_string(const su2double number){ - +inline std::string to_string(const su2double number) { std::stringstream ss; ss << number; return ss.str(); - } const static char* ws = " \t\n\r\f\v"; // trim from end of string (right) -inline std::string& rtrim(std::string& s, const char* t = ws){ +inline std::string& rtrim(std::string& s, const char* t = ws) { s.erase(s.find_last_not_of(t) + 1); return s; } // trim from beginning of string (left) -inline std::string& ltrim(std::string& s, const char* t = ws){ +inline std::string& ltrim(std::string& s, const char* t = ws) { s.erase(0, s.find_first_not_of(t)); return s; } // trim from both ends of string (right then left) -inline std::string& trim(std::string& s, const char* t = ws){ - return ltrim(rtrim(s, t), t); -} +inline std::string& trim(std::string& s, const char* t = ws) { return ltrim(rtrim(s, t), t); } /*! * \brief utility function for converting strings to uppercase * \param[in,out] str - string we want to convert */ -inline void StringToUpperCase(std::string & str) { - std::transform(str.begin(), str.end(), str.begin(), ::toupper); -} +inline void StringToUpperCase(std::string& str) { std::transform(str.begin(), str.end(), str.begin(), ::toupper); } /*! * \brief utility function for converting strings to uppercase * \param[in] str - string we want a copy of converted to uppercase * \return a copy of str in uppercase */ -inline std::string StringToUpperCase(const std::string & str) { +inline std::string StringToUpperCase(const std::string& str) { std::string upp_str(str); std::transform(upp_str.begin(), upp_str.end(), upp_str.begin(), ::toupper); return upp_str; } -} +} // namespace PrintingToolbox diff --git a/Common/include/wall_model.hpp b/Common/include/wall_model.hpp index 6369c970b11..4d7a73224c3 100644 --- a/Common/include/wall_model.hpp +++ b/Common/include/wall_model.hpp @@ -2,7 +2,7 @@ * \file wall_model.hpp * \brief Headers for the wall model functions for large eddy simulations. * \author E. van der Weide, T. Economon, P. Urbanczyk - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -42,17 +42,15 @@ class CFluidModel; * \class CWallModel * \brief Base class for defining the LES wall model. * \author: E. van der Weide, T. Economon, P. Urbanczyk - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CWallModel { - -public: - + public: /*! * \brief Constructor of the class. * \param[in] config - Definition of the particular problem. */ - CWallModel(CConfig *config); + CWallModel(CConfig* config); /*! * \brief Destructor of the class. @@ -77,27 +75,20 @@ class CWallModel { * \param[out] OverCvWall - Thermal conductivity divided by Cv at the wall, to be computed. */ - virtual void WallShearStressAndHeatFlux(const su2double tExchange, - const su2double velExchange, - const su2double muExchange, - const su2double pExchange, - const su2double Wall_HeatFlux, - const bool HeatFlux_Prescribed, - const su2double TWall, - const bool Temperature_Prescribed, - CFluidModel *FluidModel, - su2double &tauWall, - su2double &qWall, - su2double &ViscosityWall, - su2double &kOverCvWall); -protected: - + virtual void WallShearStressAndHeatFlux(const su2double tExchange, const su2double velExchange, + const su2double muExchange, const su2double pExchange, + const su2double Wall_HeatFlux, const bool HeatFlux_Prescribed, + const su2double TWall, const bool Temperature_Prescribed, + CFluidModel* FluidModel, su2double& tauWall, su2double& qWall, + su2double& ViscosityWall, su2double& kOverCvWall); + + protected: su2double h_wm; /*!< \brief The thickness of the wall model. This is also basically the exchange location */ su2double Pr_lam; /*!< \brief Laminar Prandtl number. */ su2double Pr_turb; /*!< \brief Turbulent Prandtl number. */ su2double karman; /*!< \brief von Karman constant. */ -private: + private: /*! * \brief Default constructor of the class, disabled. */ @@ -105,17 +96,14 @@ class CWallModel { }; class CWallModel1DEQ : public CWallModel { - -public: - + public: /*! * \brief Constructor of the class. * \param[in] config - Definition of the particular problem. * \param[in] Marker_Tag - String, which identifies the boundary marker for which the wall model is used. */ - CWallModel1DEQ(CConfig *config, - const string &Marker_Tag); + CWallModel1DEQ(CConfig* config, const string& Marker_Tag); /*! * \brief Function, which computes the wall shear stress and heat flux @@ -135,27 +123,18 @@ class CWallModel1DEQ : public CWallModel { * \param[out] kOverCvWall - Thermal conductivity divided by Cv at the wall, to be computed. */ - void WallShearStressAndHeatFlux(const su2double tExchange, - const su2double velExchange, - const su2double muExchange, - const su2double pExchange, - const su2double Wall_HeatFlux, - const bool HeatFlux_Prescribed, - const su2double Wall_Temperature, - const bool Temperature_Prescribed, - CFluidModel *FluidModel, - su2double &tauWall, - su2double &qWall, - su2double &ViscosityWall, - su2double &kOverCvWall) override; - -private: - - su2double expansionRatio; /*!< \brief Stretching factor used for the wall model grid. */ - int numPoints; /*!< \brief Number of points used in the wall model grid. */ - - vector y_cv; /*!< \brief The coordinates in normal direction of the wall model grid (control volumes). */ - vector y_fa; /*!< \brief The coordinates in normal direction of the wall model grid (faces of CV). */ + void WallShearStressAndHeatFlux(const su2double tExchange, const su2double velExchange, const su2double muExchange, + const su2double pExchange, const su2double Wall_HeatFlux, + const bool HeatFlux_Prescribed, const su2double Wall_Temperature, + const bool Temperature_Prescribed, CFluidModel* FluidModel, su2double& tauWall, + su2double& qWall, su2double& ViscosityWall, su2double& kOverCvWall) override; + + private: + su2double expansionRatio; /*!< \brief Stretching factor used for the wall model grid. */ + int numPoints; /*!< \brief Number of points used in the wall model grid. */ + + vector y_cv; /*!< \brief The coordinates in normal direction of the wall model grid (control volumes). */ + vector y_fa; /*!< \brief The coordinates in normal direction of the wall model grid (faces of CV). */ /*! * \brief Default constructor of the class, disabled. @@ -164,17 +143,14 @@ class CWallModel1DEQ : public CWallModel { }; class CWallModelLogLaw : public CWallModel { - -public: - + public: /*! * \brief Constructor of the class, which initializes the object. * \param[in] config - Definition of the particular problem. * \param[in] Marker_Tag - String, which identifies the boundary marker for which the wall model is used. */ - CWallModelLogLaw(CConfig *config, - const string &Marker_Tag); + CWallModelLogLaw(CConfig* config, const string& Marker_Tag); /*! * \brief Function, which computes the wall shear stress and heat flux @@ -194,23 +170,14 @@ class CWallModelLogLaw : public CWallModel { * \param[out] kOverCvWall - Thermal conductivity divided by Cv at the wall, to be computed. */ - void WallShearStressAndHeatFlux(const su2double tExchange, - const su2double velExchange, - const su2double muExchange, - const su2double pExchange, - const su2double Wall_HeatFlux, - const bool HeatFlux_Prescribed, - const su2double Wall_Temperature, - const bool Temperature_Prescribed, - CFluidModel *FluidModel, - su2double &tauWall, - su2double &qWall, - su2double &ViscosityWall, - su2double &kOverCvWall) override; - -private: - - su2double C; /*!< \brief Constant to match the Reichardt BL profile. */ + void WallShearStressAndHeatFlux(const su2double tExchange, const su2double velExchange, const su2double muExchange, + const su2double pExchange, const su2double Wall_HeatFlux, + const bool HeatFlux_Prescribed, const su2double Wall_Temperature, + const bool Temperature_Prescribed, CFluidModel* FluidModel, su2double& tauWall, + su2double& qWall, su2double& ViscosityWall, su2double& kOverCvWall) override; + + private: + su2double C; /*!< \brief Constant to match the Reichardt BL profile. */ /*! * \brief Default constructor of the class, disabled. diff --git a/Common/lib/Makefile.am b/Common/lib/Makefile.am deleted file mode 100644 index 4323382ceea..00000000000 --- a/Common/lib/Makefile.am +++ /dev/null @@ -1,169 +0,0 @@ -################################################################################ -# -# \file Makefile.am -# \brief Makefile for the SU2 common library -# \author M. Colonno, T. Economon, F. Palacios -# \version 7.5.1 "Blackbird" -# -# SU2 Project Website: https://su2code.github.io -# -# The SU2 Project is maintained by the SU2 Foundation -# (http://su2foundation.org) -# -# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) -# -# SU2 is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# SU2 is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with SU2. If not, see . -# -################################################################################ - -AUTOMAKE_OPTIONS = subdir-objects -ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} - -noinst_LIBRARIES = - -if BUILD_NORMAL -noinst_LIBRARIES += libSU2.a -endif - -if BUILD_DIRECTDIFF -noinst_LIBRARIES += libSU2_DIRECTDIFF.a -endif - -if BUILD_REVERSE -noinst_LIBRARIES += libSU2_AD.a -endif - -lib_sources = \ - ../src/fem/fem_cgns_elements.cpp \ - ../src/CConfig.cpp \ - ../src/linear_algebra/blas_structure.cpp \ - ../src/fem/fem_geometry_structure.cpp \ - ../src/fem/fem_integration_rules.cpp \ - ../src/fem/fem_standard_element.cpp \ - ../src/fem/fem_wall_distance.cpp \ - ../src/fem/fem_work_estimate_metis.cpp \ - ../src/fem/geometry_structure_fem_part.cpp \ - ../src/graph_coloring_structure.cpp \ - ../src/grid_movement/CGridMovement.cpp \ - ../src/grid_movement/CFreeFormBlending.cpp \ - ../src/grid_movement/CBSplineBlending.cpp \ - ../src/grid_movement/CBezierBlending.cpp \ - ../src/grid_movement/CFreeFormDefBox.cpp \ - ../src/grid_movement/CVolumetricMovement.cpp \ - ../src/grid_movement/CSurfaceMovement.cpp \ - ../include/parallelization/mpi_structure.cpp \ - ../include/parallelization/omp_structure.cpp \ - ../src/basic_types/ad_structure.cpp \ - ../src/fem/fem_gauss_jacobi_quadrature.cpp \ - ../src/geometry/CGeometry.cpp \ - ../src/geometry/CPhysicalGeometry.cpp \ - ../src/geometry/CMultiGridGeometry.cpp \ - ../src/geometry/CMultiGridQueue.cpp \ - ../src/geometry/CDummyGeometry.cpp \ - ../src/geometry/elements/CElement.cpp \ - ../src/geometry/elements/CTRIA1.cpp \ - ../src/geometry/elements/CQUAD4.cpp \ - ../src/geometry/elements/CTETRA1.cpp \ - ../src/geometry/elements/CPYRAM5.cpp \ - ../src/geometry/elements/CPRISM6.cpp \ - ../src/geometry/elements/CHEXA8.cpp \ - ../src/geometry/meshreader/CMeshReaderFVM.cpp \ - ../src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp \ - ../src/geometry/meshreader/CCGNSMeshReaderFVM.cpp \ - ../src/geometry/meshreader/CRectangularMeshReaderFVM.cpp \ - ../src/geometry/meshreader/CBoxMeshReaderFVM.cpp \ - ../src/geometry/dual_grid/CDualGrid.cpp \ - ../src/geometry/dual_grid/CEdge.cpp \ - ../src/geometry/dual_grid/CPoint.cpp \ - ../src/geometry/dual_grid/CVertex.cpp \ - ../src/geometry/dual_grid/CTurboVertex.cpp \ - ../src/geometry/primal_grid/CPrimalGrid.cpp \ - ../src/geometry/primal_grid/CPrimalGridFEM.cpp \ - ../src/geometry/primal_grid/CPrimalGridBoundFEM.cpp \ - ../src/geometry/primal_grid/CLine.cpp \ - ../src/geometry/primal_grid/CTriangle.cpp \ - ../src/geometry/primal_grid/CPrism.cpp \ - ../src/geometry/primal_grid/CPyramid.cpp \ - ../src/geometry/primal_grid/CHexahedron.cpp \ - ../src/geometry/primal_grid/CTetrahedron.cpp \ - ../src/geometry/primal_grid/CQuadrilateral.cpp \ - ../src/geometry/primal_grid/CVertexMPI.cpp \ - ../src/interface_interpolation/CInterpolatorFactory.cpp \ - ../src/interface_interpolation/CInterpolator.cpp \ - ../src/interface_interpolation/CMirror.cpp \ - ../src/interface_interpolation/CSlidingMesh.cpp \ - ../src/interface_interpolation/CIsoparametric.cpp \ - ../src/interface_interpolation/CNearestNeighbor.cpp \ - ../src/interface_interpolation/CRadialBasisFunction.cpp \ - ../src/adt/CADTBaseClass.cpp \ - ../src/adt/CADTPointsOnlyClass.cpp \ - ../src/adt/CADTElemClass.cpp \ - ../src/wall_model.cpp \ - ../src/toolboxes/printing_toolbox.cpp \ - ../src/toolboxes/CLinearPartitioner.cpp \ - ../src/toolboxes/C1DInterpolation.cpp \ - ../src/toolboxes/CSymmetricMatrix.cpp \ - ../src/toolboxes/CSquareMatrixCM.cpp \ - ../src/toolboxes/MMS/CVerificationSolution.cpp \ - ../src/toolboxes/MMS/CIncTGVSolution.cpp \ - ../src/toolboxes/MMS/CInviscidVortexSolution.cpp \ - ../src/toolboxes/MMS/CMMSIncEulerSolution.cpp \ - ../src/toolboxes/MMS/CMMSIncNSSolution.cpp \ - ../src/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.cpp \ - ../src/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.cpp \ - ../src/toolboxes/MMS/CMMSNSUnitQuadSolution.cpp \ - ../src/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.cpp \ - ../src/toolboxes/MMS/CNSUnitQuadSolution.cpp \ - ../src/toolboxes/MMS/CRinglebSolution.cpp \ - ../src/toolboxes/MMS/CTGVSolution.cpp \ - ../src/toolboxes/MMS/CUserDefinedSolution.cpp \ - ../src/linear_algebra/CSysVector.cpp \ - ../src/linear_algebra/CSysMatrix.cpp \ - ../src/linear_algebra/CSysSolve.cpp \ - ../src/linear_algebra/CSysSolve_b.cpp \ - ../src/linear_algebra/CPastixWrapper.cpp \ - ../src/containers/CLookUpTable.cpp \ - ../src/containers/CTrapezoidalMap.cpp \ - ../src/containers/CFileReaderLUT.cpp - -lib_cxxflags = -fPIC -std=c++11 -lib_ldadd = - -# always link to built dependencies from ./externals -lib_cxxflags += @su2_externals_INCLUDES@ -lib_ldadd += @su2_externals_LIBS@ - -# if BUILD_MUTATIONPP -lib_cxxflags += @MUTATIONPP_CXX@ -lib_ldadd += @MUTATIONPP_LD@ -# endif - -if BUILD_NORMAL -libSU2_a_SOURCES = $(lib_sources) -libSU2_a_CXXFLAGS = ${lib_cxxflags} -libSU2_a_LIBADD = ${lib_ldadd} -endif - -if BUILD_DIRECTDIFF -libSU2_DIRECTDIFF_a_SOURCES = $(lib_sources) -libSU2_DIRECTDIFF_a_CXXFLAGS = @DIRECTDIFF_CXX@ ${lib_cxxflags} -libSU2_DIRECTDIFF_a_LIBADD = ${lib_ldadd} -endif - -if BUILD_REVERSE -libSU2_AD_a_SOURCES = $(lib_sources) -libSU2_AD_a_CXXFLAGS = @REVERSE_CXX@ ${lib_cxxflags} -libSU2_AD_a_LIBADD = ${lib_ldadd} -endif - diff --git a/Common/src/CConfig.cpp b/Common/src/CConfig.cpp index f0c0d8ea91a..f660ec5633d 100644 --- a/Common/src/CConfig.cpp +++ b/Common/src/CConfig.cpp @@ -2,7 +2,7 @@ * \file CConfig.cpp * \brief Main file for managing the config file * \author F. Palacios, T. Economon, B. Tracey, H. Kline - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,6 +26,8 @@ */ #define ENABLE_MAPS +#include + #include "../include/CConfig.hpp" #undef ENABLE_MAPS @@ -282,7 +284,7 @@ void CConfig::SetMPICommunicator(SU2_MPI::Comm Communicator) { } -void CConfig::addDoubleOption(const string name, su2double & option_field, su2double default_value) { +void CConfig::addDoubleOption(const string& name, su2double & option_field, su2double default_value) { // Check if the key is already in the map. If this fails, it is coder error // and not user error, so throw. assert(option_map.find(name) == option_map.end()); @@ -301,43 +303,43 @@ void CConfig::addDoubleOption(const string name, su2double & option_field, su2do option_map.insert(pair(name, val)); } -void CConfig::addStringOption(const string name, string & option_field, string default_value) { +void CConfig::addStringOption(const string& name, string & option_field, string default_value) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); - COptionBase* val = new COptionString(name, option_field, default_value); + COptionBase* val = new COptionString(name, option_field, std::move(default_value)); option_map.insert(pair(name, val)); } -void CConfig::addIntegerOption(const string name, int & option_field, int default_value) { +void CConfig::addIntegerOption(const string& name, int & option_field, int default_value) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionInt(name, option_field, default_value); option_map.insert(pair(name, val)); } -void CConfig::addUnsignedLongOption(const string name, unsigned long & option_field, unsigned long default_value) { +void CConfig::addUnsignedLongOption(const string& name, unsigned long & option_field, unsigned long default_value) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionULong(name, option_field, default_value); option_map.insert(pair(name, val)); } -void CConfig::addUnsignedShortOption(const string name, unsigned short & option_field, unsigned short default_value) { +void CConfig::addUnsignedShortOption(const string& name, unsigned short & option_field, unsigned short default_value) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionUShort(name, option_field, default_value); option_map.insert(pair(name, val)); } -void CConfig::addLongOption(const string name, long & option_field, long default_value) { +void CConfig::addLongOption(const string& name, long & option_field, long default_value) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionLong(name, option_field, default_value); option_map.insert(pair(name, val)); } -void CConfig::addBoolOption(const string name, bool & option_field, bool default_value) { +void CConfig::addBoolOption(const string& name, bool & option_field, bool default_value) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionBool(name, option_field, default_value); @@ -352,7 +354,6 @@ void CConfig::addEnumOption(const string name, TField& option_field, const map(name, true)); COptionBase* val = new COptionEnum(name, enum_map, option_field, default_value); option_map.insert(pair(name, val)); - return; } // input_size is the number of options read in from the config file @@ -365,70 +366,70 @@ void CConfig::addEnumListOption(const string name, unsigned short& input_size, T option_map.insert( pair(name, val) ); } -void CConfig::addDoubleArrayOption(const string name, const int size, su2double* option_field) { +void CConfig::addDoubleArrayOption(const string& name, const int size, su2double* option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionArray(name, size, option_field); option_map.insert(pair(name, val)); } -void CConfig::addUShortArrayOption(const string name, const int size, unsigned short* option_field) { +void CConfig::addUShortArrayOption(const string& name, const int size, unsigned short* option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionArray(name, size, option_field); option_map.insert(pair(name, val)); } -void CConfig::addDoubleListOption(const string name, unsigned short & size, su2double * & option_field) { +void CConfig::addDoubleListOption(const string& name, unsigned short & size, su2double * & option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionDoubleList(name, size, option_field); option_map.insert(pair(name, val)); } -void CConfig::addShortListOption(const string name, unsigned short & size, short * & option_field) { +void CConfig::addShortListOption(const string& name, unsigned short & size, short * & option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionShortList(name, size, option_field); option_map.insert(pair(name, val)); } -void CConfig::addUShortListOption(const string name, unsigned short & size, unsigned short * & option_field) { +void CConfig::addUShortListOption(const string& name, unsigned short & size, unsigned short * & option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionUShortList(name, size, option_field); option_map.insert(pair(name, val)); } -void CConfig::addULongListOption(const string name, unsigned short & size, unsigned long * & option_field) { +void CConfig::addULongListOption(const string& name, unsigned short & size, unsigned long * & option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionULongList(name, size, option_field); option_map.insert(pair(name, val)); } -void CConfig::addStringListOption(const string name, unsigned short & num_marker, string* & option_field) { +void CConfig::addStringListOption(const string& name, unsigned short & num_marker, string* & option_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionStringList(name, num_marker, option_field); option_map.insert(pair(name, val)); } -void CConfig::addConvectOption(const string name, unsigned short & space_field, CENTERED & centered_field, UPWIND & upwind_field) { +void CConfig::addConvectOption(const string& name, unsigned short & space_field, CENTERED & centered_field, UPWIND & upwind_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionConvect(name, space_field, centered_field, upwind_field); option_map.insert(pair(name, val)); } -void CConfig::addConvectFEMOption(const string name, unsigned short & space_field, unsigned short & fem_field) { +void CConfig::addConvectFEMOption(const string& name, unsigned short & space_field, unsigned short & fem_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionFEMConvect(name, space_field, fem_field); option_map.insert(pair(name, val)); } -void CConfig::addMathProblemOption(const string name, bool & ContinuousAdjoint, const bool & ContinuousAdjoint_default, +void CConfig::addMathProblemOption(const string& name, bool & ContinuousAdjoint, const bool & ContinuousAdjoint_default, bool & DiscreteAdjoint, const bool & DiscreteAdjoint_default, bool & Restart_Flow, const bool & Restart_Flow_default) { assert(option_map.find(name) == option_map.end()); @@ -437,7 +438,7 @@ void CConfig::addMathProblemOption(const string name, bool & ContinuousAdjoint, option_map.insert(pair(name, val)); } -void CConfig::addDVParamOption(const string name, unsigned short & nDV_field, su2double** & paramDV, string* & FFDTag, +void CConfig::addDVParamOption(const string& name, unsigned short & nDV_field, su2double** & paramDV, string* & FFDTag, unsigned short* & design_variable) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); @@ -445,7 +446,7 @@ void CConfig::addDVParamOption(const string name, unsigned short & nDV_field, su option_map.insert(pair(name, val)); } -void CConfig::addDVValueOption(const string name, unsigned short* & nDVValue_field, su2double** & valueDV, unsigned short & nDV_field, su2double** & paramDV, +void CConfig::addDVValueOption(const string& name, unsigned short* & nDVValue_field, su2double** & valueDV, unsigned short & nDV_field, su2double** & paramDV, unsigned short* & design_variable) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); @@ -453,21 +454,21 @@ void CConfig::addDVValueOption(const string name, unsigned short* & nDVValue_fie option_map.insert(pair(name, val)); } -void CConfig::addFFDDefOption(const string name, unsigned short & nFFD_field, su2double** & coordFFD, string* & FFDTag) { +void CConfig::addFFDDefOption(const string& name, unsigned short & nFFD_field, su2double** & coordFFD, string* & FFDTag) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionFFDDef(name, nFFD_field, coordFFD, FFDTag); option_map.insert(pair(name, val)); } -void CConfig::addFFDDegreeOption(const string name, unsigned short & nFFD_field, unsigned short** & degreeFFD) { +void CConfig::addFFDDegreeOption(const string& name, unsigned short & nFFD_field, unsigned short** & degreeFFD) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionFFDDegree(name, nFFD_field, degreeFFD); option_map.insert(pair(name, val)); } -void CConfig::addStringDoubleListOption(const string name, unsigned short & list_size, string * & string_field, +void CConfig::addStringDoubleListOption(const string& name, unsigned short & list_size, string * & string_field, su2double* & double_field) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); @@ -475,7 +476,7 @@ void CConfig::addStringDoubleListOption(const string name, unsigned short & list option_map.insert(pair(name, val)); } -void CConfig::addInletOption(const string name, unsigned short & nMarker_Inlet, string * & Marker_Inlet, +void CConfig::addInletOption(const string& name, unsigned short & nMarker_Inlet, string * & Marker_Inlet, su2double* & Ttotal, su2double* & Ptotal, su2double** & FlowDir) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); @@ -483,7 +484,7 @@ void CConfig::addInletOption(const string name, unsigned short & nMarker_Inlet, option_map.insert(pair(name, val)); } -void CConfig::addInletSpeciesOption(const string name, unsigned short & nMarker_Inlet_Species, +void CConfig::addInletSpeciesOption(const string& name, unsigned short & nMarker_Inlet_Species, string * & Marker_Inlet_Species, su2double** & inlet_species_val, unsigned short & nSpecies_per_Inlet) { assert(option_map.find(name) == option_map.end()); @@ -493,7 +494,7 @@ void CConfig::addInletSpeciesOption(const string name, unsigned short & nMarker_ option_map.insert(pair(name, val)); } -void CConfig::addInletTurbOption(const string name, unsigned short& nMarker_Inlet_Turb, string*& Marker_Inlet_Turb, +void CConfig::addInletTurbOption(const string& name, unsigned short& nMarker_Inlet_Turb, string*& Marker_Inlet_Turb, su2double**& Turb_Properties_val, unsigned short& nTurb_Properties) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); @@ -520,7 +521,7 @@ void CConfig::addGilesOption(const string name, unsigned short & nMarker_Giles, option_map.insert(pair(name, val)); } -void CConfig::addExhaustOption(const string name, unsigned short & nMarker_Exhaust, string * & Marker_Exhaust, +void CConfig::addExhaustOption(const string& name, unsigned short & nMarker_Exhaust, string * & Marker_Exhaust, su2double* & Ttotal, su2double* & Ptotal) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); @@ -566,14 +567,14 @@ void CConfig::addWallFunctionOption(const string &name, unsigned short &list_siz option_map.insert(pair(name, val)); } -void CConfig::addPythonOption(const string name) { +void CConfig::addPythonOption(const string& name) { assert(option_map.find(name) == option_map.end()); all_options.insert(pair(name, true)); COptionBase* val = new COptionPython(name); option_map.insert(pair(name, val)); } -unsigned short CConfig::GetnZone(string val_mesh_filename, unsigned short val_format) { +unsigned short CConfig::GetnZone(const string& val_mesh_filename, unsigned short val_format) { int nZone = 1; /* Default value if nothing is specified. */ @@ -695,7 +696,7 @@ unsigned short CConfig::GetnZone(string val_mesh_filename, unsigned short val_fo } -unsigned short CConfig::GetnDim(string val_mesh_filename, unsigned short val_format) { +unsigned short CConfig::GetnDim(const string& val_mesh_filename, unsigned short val_format) { short nDim = -1; @@ -807,7 +808,7 @@ unsigned short CConfig::GetnDim(string val_mesh_filename, unsigned short val_for return (unsigned short) nDim; } -void CConfig::SetPointersNull(void) { +void CConfig::SetPointersNull() { Marker_CfgFile_GeoEval = nullptr; Marker_All_GeoEval = nullptr; Marker_CfgFile_Monitoring = nullptr; Marker_All_Monitoring = nullptr; @@ -836,6 +837,7 @@ void CConfig::SetPointersNull(void) { Marker_Designing = nullptr; Marker_GeoEval = nullptr; Marker_Plotting = nullptr; Marker_Analyze = nullptr; Marker_PyCustom = nullptr; Marker_WallFunctions = nullptr; Marker_CfgFile_KindBC = nullptr; Marker_All_KindBC = nullptr; Marker_SobolevBC = nullptr; + Marker_StrongBC = nullptr; Kind_WallFunctions = nullptr; IntInfo_WallFunctions = nullptr; @@ -1167,6 +1169,14 @@ void CConfig::SetConfig_Options() { /*!\brief FLUID_NAME \n DESCRIPTION: Fluid name \n OPTIONS: see coolprop homepage \n DEFAULT: nitrogen \ingroup Config*/ addStringOption("FLUID_NAME", FluidName, string("nitrogen")); + /*!\par CONFIG_CATEGORY: Data-driven fluid model parameters \ingroup Config*/ + /*!\brief INTERPOLATION_METHOD \n DESCRIPTION: Interpolation method used to determine the thermodynamic state of the fluid. \n OPTIONS: See \link DataDrivenMethod_Map \endlink DEFAULT: MLP \ingroup Config*/ + addEnumOption("INTERPOLATION_METHOD",Kind_DataDriven_Method, DataDrivenMethod_Map, ENUM_DATADRIVEN_METHOD::LUT); + /*!\brief FILENAME_INTERPOLATOR \n DESCRIPTION: Input file for the interpolation method. \n \ingroup Config*/ + addStringListOption("FILENAMES_INTERPOLATOR", n_Datadriven_files, DataDriven_Method_FileNames); + /*!\brief DATADRIVEN_NEWTON_RELAXATION \n DESCRIPTION: Relaxation factor for Newton solvers in data-driven fluid model. \n \ingroup Config*/ + addDoubleOption("DATADRIVEN_NEWTON_RELAXATION", DataDriven_Relaxation_Factor, 0.05); + /*!\brief CONFINEMENT_PARAM \n DESCRIPTION: Input Confinement Parameter for Vorticity Confinement*/ addDoubleOption("CONFINEMENT_PARAM", Confinement_Param, 0.0); @@ -1350,8 +1360,15 @@ void CConfig::SetConfig_Options() { addDoubleListOption("SPECIES_CLIPPING_MAX", nSpecies_Clipping_Max, Species_Clipping_Max); /*!\brief SPECIES_CLIPPING_MIN \n DESCRIPTION: Minimum values for scalar clipping \ingroup Config*/ addDoubleListOption("SPECIES_CLIPPING_MIN", nSpecies_Clipping_Min, Species_Clipping_Min); - /*!\brief SPECIES_CLIPPING \n DESCRIPTION: Use strong inlet and outlet BC in the species solver \n DEFAULT: false \ingroup Config*/ - addBoolOption("SPECIES_USE_STRONG_BC", Species_StrongBC, false); + + /*!\brief FLAME_INIT \n DESCRIPTION: flame initialization using the flamelet model \ingroup Config*/ + /*--- flame offset (x,y,z) ---*/ + flame_init[0] = 0.0; flame_init[1] = 0.0; flame_init[2] = 0.0; + /*--- flame normal (nx, ny, nz) ---*/ + flame_init[3] = 1.0; flame_init[4] = 0.0; flame_init[5] = 0.0; + /*--- flame thickness (x) and flame burnt thickness (after this thickness, we have unburnt conditions again) ---*/ + flame_init[6] = 0.5e-3; flame_init[7] = 1.0; + addDoubleArrayOption("FLAME_INIT", 8,flame_init); /*--- Options related to mass diffusivity and thereby the species solver. ---*/ @@ -1495,6 +1512,9 @@ void CConfig::SetConfig_Options() { addWallFunctionOption("MARKER_WALL_FUNCTIONS", nMarker_WallFunctions, Marker_WallFunctions, Kind_WallFunctions, IntInfo_WallFunctions, DoubleInfo_WallFunctions); + /*!\brief MARKER_STRONG_BC\n DESCRIPTION: Markers where a strong BC must be applied.*/ + addStringListOption("MARKER_SPECIES_STRONG_BC", nMarker_StrongBC, Marker_StrongBC); + /*!\brief ACTDISK_TYPE \n DESCRIPTION: Actuator Disk boundary type \n OPTIONS: see \link ActDisk_Map \endlink \n Default: VARIABLES_JUMP \ingroup Config*/ addEnumOption("ACTDISK_TYPE", Kind_ActDisk, ActDisk_Map, VARIABLES_JUMP); @@ -1909,7 +1929,7 @@ void CConfig::SetConfig_Options() { * \n DESCRIPTION: Convective numerical method for the adjoint solver. * \n OPTIONS: See \link Upwind_Map \endlink , \link Centered_Map \endlink. Note: not all methods are guaranteed to be implemented for the adjoint solver. \ingroup Config */ addConvectOption("CONV_NUM_METHOD_ADJFLOW", Kind_ConvNumScheme_AdjFlow, Kind_Centered_AdjFlow, Kind_Upwind_AdjFlow); - /*!\brief MUSCL_FLOW \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/ + /*!\brief MUSCL_ADJFLOW \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/ addBoolOption("MUSCL_ADJFLOW", MUSCL_AdjFlow, true); /*!\brief SLOPE_LIMITER_ADJFLOW * DESCRIPTION: Slope limiter for the adjoint solution. \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config*/ @@ -1920,7 +1940,7 @@ void CConfig::SetConfig_Options() { /*!\brief LAX_SENSOR_COEFF \n DESCRIPTION: 1st order artificial dissipation coefficients for the adjoint Lax-Friedrichs method. \ingroup Config*/ addDoubleOption("ADJ_LAX_SENSOR_COEFF", Kappa_1st_AdjFlow, 0.15); - /*!\brief MUSCL_FLOW \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/ + /*!\brief MUSCL_TURB \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/ addBoolOption("MUSCL_TURB", MUSCL_Turb, false); /*!\brief SLOPE_LIMITER_TURB * \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config*/ @@ -1929,7 +1949,7 @@ void CConfig::SetConfig_Options() { * \n DESCRIPTION: Convective numerical method \ingroup Config*/ addConvectOption("CONV_NUM_METHOD_TURB", Kind_ConvNumScheme_Turb, Kind_Centered_Turb, Kind_Upwind_Turb); - /*!\brief MUSCL_FLOW \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/ + /*!\brief MUSCL_ADJTURB \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/ addBoolOption("MUSCL_ADJTURB", MUSCL_AdjTurb, false); /*!\brief SLOPE_LIMITER_ADJTURB * \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT VENKATAKRISHNAN \ingroup Config */ @@ -1944,7 +1964,7 @@ void CConfig::SetConfig_Options() { /*!\brief CONV_NUM_METHOD_SPECIES \n DESCRIPTION: Convective numerical method for species transport \ingroup Config*/ addConvectOption("CONV_NUM_METHOD_SPECIES", Kind_ConvNumScheme_Species, Kind_Centered_Species, Kind_Upwind_Species); - /*!\brief MUSCL_FLOW \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/ + /*!\brief MUSCL_HEAT \n DESCRIPTION: Check if the MUSCL scheme should be used \ingroup Config*/ addBoolOption("MUSCL_HEAT", MUSCL_Heat, false); /*!\brief SLOPE_LIMITER_HEAT \n DESCRIPTION: Slope limiter \n OPTIONS: See \link Limiter_Map \endlink \n DEFAULT NONE \ingroup Config*/ addEnumOption("SLOPE_LIMITER_HEAT", Kind_SlopeLimit_Heat, Limiter_Map, LIMITER::NONE); @@ -2081,6 +2101,21 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Determine if we need to allocate memory to store the multizone residual. \n DEFAULT: true (temporarily) */ addBoolOption("MULTIZONE_RESIDUAL", Multizone_Residual, false); + /* !\brief CONTROLLING_VARIABLE_NAMES \n DESCRIPTION: Names of the variables used as inputs for the data regression method in flamelet or data-driven fluid models. */ + addStringListOption("CONTROLLING_VARIABLE_NAMES", n_control_vars, controlling_variable_names); + + /* !\brief CONTROLLING_VARIABLE_SOURCE_NAMES \n DESCRIPTION: Names of the variables in the flamelet manifold corresponding to the source terms of the controlling variables. */ + addStringListOption("CONTROLLING_VARIABLE_SOURCE_NAMES", n_control_vars, cv_source_names); + + /* DESCRIPTION: Names of the passive lookup variables for flamelet LUT */ + addStringListOption("LOOKUP_NAMES", n_lookups, lookup_names); + + /* DESCRIPTION: Names of the user transport equations solved in the flamelet problem. */ + addStringListOption("USER_SCALAR_NAMES", n_user_scalars, user_scalar_names); + + /* DESCRIPTION: Names of the user scalar source terms. */ + addStringListOption("USER_SOURCE_NAMES", n_user_sources, user_source_names); + /*!\brief CONV_FILENAME \n DESCRIPTION: Output file convergence history (w/o extension) \n DEFAULT: history \ingroup Config*/ addStringOption("CONV_FILENAME", Conv_FileName, string("history")); /*!\brief BREAKDOWN_FILENAME \n DESCRIPTION: Output file forces breakdown \ingroup Config*/ @@ -2270,7 +2305,6 @@ void CConfig::SetConfig_Options() { - SPHERICAL ( ControlPoint_Index, Theta_Disp, R_Disp ) - FFD_CONTROL_POINT ( FFDBox ID, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp ) - FFD_TWIST ( FFDBox ID, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) - - FFD_TWIST_2D ( FFDBox ID, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) - FFD_ROTATION ( FFDBox ID, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) - FFD_CONTROL_SURFACE ( FFDBox ID, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) - FFD_CAMBER ( FFDBox ID, i_Ind, j_Ind ) @@ -2434,12 +2468,6 @@ void CConfig::SetConfig_Options() { /* DESCRIPTION: Temporary: pseudo static analysis (no density in dynamic analysis) * Options: NO, YES \ingroup Config */ addBoolOption("PSEUDO_STATIC", PseudoStatic, false); - /* DESCRIPTION: Dynamic or static structural analysis */ - addEnumOption("DYNAMIC_ANALYSIS", Dynamic_Analysis, Dynamic_Map, STATIC); - /* DESCRIPTION: Time Step for dynamic analysis (s) */ - addDoubleOption("DYN_TIMESTEP", Delta_DynTime, 0.0); - /* DESCRIPTION: Total Physical Time for dual time stepping simulations (s) */ - addDoubleOption("DYN_TIME", Total_DynTime, 1.0); /* DESCRIPTION: Parameter alpha for Newmark scheme (s) */ addDoubleOption("NEWMARK_BETA", Newmark_beta, 0.25); /* DESCRIPTION: Parameter delta for Newmark scheme (s) */ @@ -2512,8 +2540,6 @@ void CConfig::SetConfig_Options() { addDoubleOption("TIME_STEP", Time_Step, 0.0); /* DESCRIPTION: Total Physical Time for time-domain problems (s) */ addDoubleOption("MAX_TIME", Max_Time, 1.0); - /* DESCRIPTION: Determines if the single-zone driver is used. (TEMPORARY) */ - addBoolOption("SINGLEZONE_DRIVER", SinglezoneDriver, true); /* DESCRIPTION: Determines if the special output is written out */ addBoolOption("SPECIAL_OUTPUT", SpecialOutput, false); @@ -2960,7 +2986,7 @@ void CConfig::SetConfig_Parsing(istream& config_buffer){ * If there is a statement after a cont. char * throw an error. ---*/ - if (text_line.size() && (text_line.front() != '%')){ + if (!text_line.empty() && (text_line.front() != '%')){ while (text_line.back() == '\\' || (PrintingToolbox::split(text_line, '\\').size() > 1)){ string tmp; @@ -2986,52 +3012,16 @@ void CConfig::SetConfig_Parsing(istream& config_buffer){ newString.append(": invalid option name"); newString.append(". Check current SU2 options in config_template.cfg."); newString.append("\n"); - if (!option_name.compare("RELAXATION_FACTOR_ADJFLOW")) - newString.append("Option RELAXATION_FACTOR_ADJFLOW is now RELAXATION_FACTOR_ADJOINT, " - "and it also applies to discrete adjoint problems.\n\n"); - else if (!option_name.compare("WRT_MESH_QUALITY")) - newString.append("WRT_MESH_QUALITY is deprecated. Use VOLUME_OUTPUT= (MESH_QUALITY, ...) instead.\n\n"); - else if (!option_name.compare("VISUALIZE_SURFACE_DEF")) - newString.append("VISUALIZE_SURFACE_DEF is deprecated. Simply add a surface format to OUTPUT_FILES.\n\n"); - else if (!option_name.compare("VISUALIZE_VOLUME_DEF")) - newString.append("VISUALIZE_VOLUME_DEF is deprecated. Simply add a volume format to OUTPUT_FILES.\n\n"); - else if (!option_name.compare("WRT_BINARY_RESTART")) - newString.append("WRT_BINARY_RESTART is deprecated. The type of restart is determined from the OUTPUT_FILES list.\n\n"); - else if (!option_name.compare("WRT_RESIDUALS")) - newString.append("WRT_RESIDUALS is deprecated. Use VOLUME_OUTPUT= ( RESIDUAL, ... ) instead.\n\n"); - else if (!option_name.compare("WRT_LIMITERS")) - newString.append("WRT_LIMITERS is deprecated. Use VOLUME_OUTPUT= ( LIMITER, ... ) instead.\n\n"); - else if (!option_name.compare("WRT_CON_FREQ")) - newString.append("WRT_CON_FREQ is deprecated. Use SCREEN_WRT_FREQ_INNER or SCREEN_WRT_FREQ_OUTER for multizone cases instead.\n\n"); - else if (!option_name.compare("WRT_CON_FREQ_DUALTIME")) - newString.append("WRT_CON_FREQ_DUALTIME is deprecated. Use SCREEN_WRT_FREQ_TIME instead.\n\n"); - else if (!option_name.compare("WRT_SRF_SOL")) - newString.append("WRT_SRF_SOL is deprecated. Simply add a surface format to OUTPUT_FILES.\n\n"); - else if (!option_name.compare("WRT_CSV_SOL")) - newString.append("WRT_CSV_SOL is deprecated. Simply add a CSV format to OUTPUT_FILES.\n\n"); - else if (!option_name.compare("WRT_SOL_FREQ")) - newString.append("WRT_SOL_FREQ is deprecated. Use OUTPUT_WRT_FREQ instead.\n\n"); - else if (!option_name.compare("WRT_SOL_FREQ_DUALTIME")) - newString.append("WRT_SOL_FREQ_DUALTIME is deprecated. Use OUTPUT_WRT_FREQ instead.\n\n"); - else if (!option_name.compare("UNST_RESTART_ITER")) - newString.append("UNST_RESTART_ITER is deprecated. Use RESTART_ITER instead.\n\n"); - else if (!option_name.compare("DYN_RESTART_ITER")) - newString.append("DYN_RESTART_ITER is deprecated. Use RESTART_ITER instead.\n\n"); - else if (!option_name.compare("CONV_CRITERIA")) - newString.append("CONV_CRITERIA is deprecated. SU2 will choose the criteria automatically based on the CONV_FIELD.\n" - "RESIDUAL for any RMS_* BGS_* value. CAUCHY for coefficients like DRAG etc.\n\n"); - else if (!option_name.compare("THERMAL_DIFFUSIVITY")) - newString.append("THERMAL_DIFFUSIVITY is deprecated. See the INC_ENERGY_EQUATION options instead.\n\n"); - else if (!option_name.compare("THERMAL_DIFFUSIVITY_SOLID")) - newString.append("THERMAL_DIFFUSIVITY_SOLID is deprecated. Set THERMAL_CONDUCTIVITY_CONSTANT, MATERIAL_DENSITY and SPECIFIC_HEAT_CP instead.\n\n"); - else if (!option_name.compare("SOLID_THERMAL_CONDUCTIVITY")) - newString.append("SOLID_THERMAL_CONDUCTIVITY is deprecated. Use THERMAL_CONDUCTIVITY_CONSTANT instead.\n\n"); - else if (!option_name.compare("SOLID_DENSITY")) - newString.append("SOLID_DENSITY is deprecated. Use MATERIAL_DENSITY instead.\n\n"); - else if (!option_name.compare("SOLID_TEMPERATURE_INIT")) - newString.append("SOLID_TEMPERATURE_INIT is deprecated. Use FREESTREAM_TEMPERATURE instead.\n\n"); - else if (!option_name.compare("SA_QCR")) - newString.append("SA_QCR is deprecated. Use SA_OPTIONS=QCR2000 instead.\n\n"); + if (!option_name.compare("SINGLEZONE_DRIVER")) + newString.append("Option SINGLEZONE_DRIVER is deprecated, it does not have a replacement.\n\n"); + else if (!option_name.compare("DYN_TIMESTEP")) + newString.append("DYN_TIMESTEP is deprecated. Use TIME_STEP instead.\n\n"); + else if (!option_name.compare("DYN_TIME")) + newString.append("DYN_TIME is deprecated. Use MAX_TIME instead.\n\n"); + else if (!option_name.compare("DYNAMIC_ANALYSIS")) + newString.append("DYNAMIC_ANALYSIS is deprecated. Use TIME_DOMAIN instead.\n\n"); + else if (!option_name.compare("SPECIES_USE_STRONG_BC")) + newString.append("SPECIES_USE_STRONG_BC is deprecated. Use MARKER_SPECIES_STRONG_BC= (marker1, ...) instead.\n\n"); else { /*--- Find the most likely candidate for the unrecognized option, based on the length of start and end character sequences shared by candidates and the option. ---*/ @@ -3115,7 +3105,7 @@ void CConfig::SetConfig_Parsing(istream& config_buffer){ /*--- See if there were any errors parsing the config file ---*/ - if (errorString.size() != 0) { + if (!errorString.empty()) { SU2_MPI::Error(errorString, CURRENT_FUNCTION); } } @@ -3128,7 +3118,7 @@ void CConfig::SetDefaultFromConfig(CConfig *config){ while (iter != all_options.end()){ curr_iter = iter++; - if (config->option_map[curr_iter->first]->GetValue().size() > 0 && !noInheritance[curr_iter->first]){ + if (!config->option_map[curr_iter->first]->GetValue().empty() && !noInheritance[curr_iter->first]){ option_map[curr_iter->first]->SetValue(config->option_map[curr_iter->first]->GetValue()); all_options.erase(curr_iter); } @@ -3139,8 +3129,8 @@ void CConfig::SetDefault(){ /*--- Set the default values for all of the options that weren't set ---*/ - for (map::iterator iter = all_options.begin(); iter != all_options.end(); ++iter) { - if (option_map[iter->first]->GetValue().size() == 0) + for (auto iter = all_options.begin(); iter != all_options.end(); ++iter) { + if (option_map[iter->first]->GetValue().empty()) option_map[iter->first]->SetDefault(); } } @@ -3218,13 +3208,13 @@ bool CConfig::SetRunTime_Parsing(char case_filename[MAX_STRING_SIZE]) { /*--- Set the default values for all of the options that weren't set ---*/ - for (map::iterator iter = all_options.begin(); iter != all_options.end(); ++iter) { + for (auto iter = all_options.begin(); iter != all_options.end(); ++iter) { option_map[iter->first]->SetDefault(); } /*--- See if there were any errors parsing the runtime file ---*/ - if (errorString.size() != 0) { + if (!errorString.empty()) { SU2_MPI::Error(errorString, CURRENT_FUNCTION); } @@ -3236,41 +3226,41 @@ bool CConfig::SetRunTime_Parsing(char case_filename[MAX_STRING_SIZE]) { void CConfig::SetHeader(SU2_COMPONENT val_software) const{ - if ((iZone == 0) && (rank == MASTER_NODE)){ - cout << endl << "-------------------------------------------------------------------------" << endl; - cout << "| ___ _ _ ___ |" << endl; - cout << "| / __| | | |_ ) Release 7.5.1 \"Blackbird\" |" << endl; - cout << "| \\__ \\ |_| |/ / |" << endl; + if ((iZone == 0) && (rank == MASTER_NODE)) { + cout << "\n"; + cout << "-------------------------------------------------------------------------\n"; + cout << "| ___ _ _ ___ |\n"; + cout << "| / __| | | |_ ) Release 8.0.0 \"Harrier\" |\n"; + cout << "| \\__ \\ |_| |/ / |\n"; switch (val_software) { - case SU2_COMPONENT::SU2_CFD: cout << "| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |" << endl; break; - case SU2_COMPONENT::SU2_DEF: cout << "| |___/\\___//___| Suite (Mesh Deformation Code) |" << endl; break; - case SU2_COMPONENT::SU2_DOT: cout << "| |___/\\___//___| Suite (Gradient Projection Code) |" << endl; break; - case SU2_COMPONENT::SU2_GEO: cout << "| |___/\\___//___| Suite (Geometry Definition Code) |" << endl; break; - case SU2_COMPONENT::SU2_SOL: cout << "| |___/\\___//___| Suite (Solution Exporting Code) |" << endl; break; - } - - cout << "| |" << endl; - cout <<"-------------------------------------------------------------------------" << endl; - cout << "| SU2 Project Website: https://su2code.github.io |" << endl; - cout << "| |" << endl; - cout << "| The SU2 Project is maintained by the SU2 Foundation |" << endl; - cout << "| (http://su2foundation.org) |" << endl; - cout <<"-------------------------------------------------------------------------" << endl; - cout << "| Copyright 2012-2023, SU2 Contributors |" << endl; - cout << "| |" << endl; - cout << "| SU2 is free software; you can redistribute it and/or |" << endl; - cout << "| modify it under the terms of the GNU Lesser General Public |" << endl; - cout << "| License as published by the Free Software Foundation; either |" << endl; - cout << "| version 2.1 of the License, or (at your option) any later version. |" << endl; - cout << "| |" << endl; - cout << "| SU2 is distributed in the hope that it will be useful, |" << endl; - cout << "| but WITHOUT ANY WARRANTY; without even the implied warranty of |" << endl; - cout << "| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |" << endl; - cout << "| Lesser General Public License for more details. |" << endl; - cout << "| |" << endl; - cout << "| You should have received a copy of the GNU Lesser General Public |" << endl; - cout << "| License along with SU2. If not, see . |" << endl; - cout <<"-------------------------------------------------------------------------" << endl; + case SU2_COMPONENT::SU2_CFD: cout << "| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |\n"; break; + case SU2_COMPONENT::SU2_DEF: cout << "| |___/\\___//___| Suite (Mesh Deformation Code) |\n"; break; + case SU2_COMPONENT::SU2_DOT: cout << "| |___/\\___//___| Suite (Gradient Projection Code) |\n"; break; + case SU2_COMPONENT::SU2_GEO: cout << "| |___/\\___//___| Suite (Geometry Definition Code) |\n"; break; + case SU2_COMPONENT::SU2_SOL: cout << "| |___/\\___//___| Suite (Solution Exporting Code) |\n"; break; + } + cout << "| |\n"; + cout << "-------------------------------------------------------------------------\n"; + cout << "| SU2 Project Website: https://su2code.github.io |\n"; + cout << "| |\n"; + cout << "| The SU2 Project is maintained by the SU2 Foundation |\n"; + cout << "| (http://su2foundation.org) |\n"; + cout << "-------------------------------------------------------------------------\n"; + cout << "| Copyright 2012-2023, SU2 Contributors |\n"; + cout << "| |\n"; + cout << "| SU2 is free software; you can redistribute it and/or |\n"; + cout << "| modify it under the terms of the GNU Lesser General Public |\n"; + cout << "| License as published by the Free Software Foundation; either |\n"; + cout << "| version 2.1 of the License, or (at your option) any later version. |\n"; + cout << "| |\n"; + cout << "| SU2 is distributed in the hope that it will be useful, |\n"; + cout << "| but WITHOUT ANY WARRANTY; without even the implied warranty of |\n"; + cout << "| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |\n"; + cout << "| Lesser General Public License for more details. |\n"; + cout << "| |\n"; + cout << "| You should have received a copy of the GNU Lesser General Public |\n"; + cout << "| License along with SU2. If not, see . |\n"; + cout << "-------------------------------------------------------------------------" << endl; } } @@ -3298,8 +3288,6 @@ void CConfig::SetnZone(){ SU2_MPI::Error("Number of markers in MARKER_ZONE_INTERFACE must be a multiple of 2", CURRENT_FUNCTION); } - SinglezoneDriver = NO; - if (Multizone_Mesh){ /*--- Get the number of zones from the mesh file --- */ @@ -3344,6 +3332,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i (Kind_FluidModel == IDEAL_GAS) || (Kind_FluidModel == INC_IDEAL_GAS) || (Kind_FluidModel == FLUID_MIXTURE) || + (Kind_FluidModel == FLUID_FLAMELET) || (Kind_FluidModel == INC_IDEAL_GAS_POLY) || (Kind_FluidModel == CONSTANT_DENSITY)); bool noneq_gas = ((Kind_FluidModel == MUTATIONPP) || @@ -3489,7 +3478,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i SU2_MPI::Error(string("For RANS problems, use NONE, STANDARD_WALL_FUNCTION or EQUILIBRIUM_WALL_MODEL.\n"), CURRENT_FUNCTION); if (Kind_WallFunctions[iMarker] == WALL_FUNCTIONS::STANDARD_FUNCTION) { - if (!((Kind_Solver == MAIN_SOLVER::RANS) || (Kind_Solver == MAIN_SOLVER::INC_RANS))) + if ((Kind_Solver != MAIN_SOLVER::RANS) && (Kind_Solver != MAIN_SOLVER::INC_RANS)) SU2_MPI::Error(string("Wall model STANDARD_FUNCTION only available for RANS or INC_RANS.\n"), CURRENT_FUNCTION); if (nRough_Wall != 0) SU2_MPI::Error(string("Wall model STANDARD_FUNCTION and WALL_ROUGHNESS migh not be compatible. Checking required!\n"), CURRENT_FUNCTION); @@ -3560,6 +3549,21 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i SetScalarDefaults(MUSCL_Heat, Kind_ConvNumScheme_Heat, Kind_Upwind_Heat, Kind_SlopeLimit_Heat); SetScalarDefaults(MUSCL_Species, Kind_ConvNumScheme_Species, Kind_Upwind_Species, Kind_SlopeLimit_Species); + if (MUSCL_Flow && (Kind_ConvNumScheme_Flow == SPACE_CENTERED)) { + if (OptionIsSet("MUSCL_FLOW")) { + SU2_MPI::Error("Centered schemes do not use MUSCL reconstruction (use MUSCL_FLOW= NO).", CURRENT_FUNCTION); + } else { + MUSCL_Flow = false; + } + } + if (MUSCL_AdjFlow && (Kind_ConvNumScheme_AdjFlow == SPACE_CENTERED)) { + if (OptionIsSet("MUSCL_ADJFLOW")) { + SU2_MPI::Error("Centered schemes do not use MUSCL reconstruction (use MUSCL_ADJFLOW= NO).", CURRENT_FUNCTION); + } else { + MUSCL_AdjFlow = false; + } + } + if (!MUSCL_Flow || (Kind_ConvNumScheme_Flow == SPACE_CENTERED)) Kind_SlopeLimit_Flow = LIMITER::NONE; if (!MUSCL_AdjFlow || (Kind_ConvNumScheme_AdjFlow == SPACE_CENTERED)) Kind_SlopeLimit_AdjFlow = LIMITER::NONE; if (!MUSCL_AdjTurb || (Kind_ConvNumScheme_AdjTurb == SPACE_CENTERED)) Kind_SlopeLimit_AdjTurb = LIMITER::NONE; @@ -3676,9 +3680,11 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } } - if (Kind_ObjFunc[0] == CUSTOM_OBJFUNC && CustomObjFunc.empty() && !Multizone_Problem) { - SU2_MPI::Error("The expression for the custom objective function was not set.\n" - "For example, CUSTOM_OBJFUNC= LIFT/DRAG", CURRENT_FUNCTION); + if (nObj > 0){ + if (Kind_ObjFunc[0] == CUSTOM_OBJFUNC && CustomObjFunc.empty() && !Multizone_Problem) { + SU2_MPI::Error("The expression for the custom objective function was not set.\n" + "For example, CUSTOM_OBJFUNC= LIFT/DRAG", CURRENT_FUNCTION); + } } /*--- Check for unsteady problem ---*/ @@ -3692,7 +3698,6 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i if (Time_Domain){ Delta_UnstTime = Time_Step; - Delta_DynTime = Time_Step; if (TimeMarching == TIME_MARCHING::TIME_STEPPING){ InnerIter = 1; } @@ -3838,6 +3843,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i SetDefaultIfEmpty(Prandtl_Turb, nPrandtl_Turb, Prandtl_Turb_Default); SetDefaultIfEmpty(Constant_Lewis_Number, nConstant_Lewis_Number, Lewis_Number_Default); + Variable_Density = ((Kind_DensityModel == INC_DENSITYMODEL::VARIABLE) || (Kind_DensityModel == INC_DENSITYMODEL::FLAMELET)); + /*--- Check whether inputs for FLUID_MIXTURE are correctly specified. ---*/ if (Kind_FluidModel == FLUID_MIXTURE) { @@ -3878,7 +3885,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } break; default: - if (nSpecies_Init + 1 != 1) SU2_MPI::Error("Viscosity model not available.", CURRENT_FUNCTION); + if (nSpecies_Init + 1 != 1) SU2_MPI::Error("Fluid mixture: viscosity model not available.", CURRENT_FUNCTION); break; } @@ -3925,22 +3932,66 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } } + + if (Kind_Species_Model == SPECIES_MODEL::FLAMELET) { + + if (Kind_FluidModel != FLUID_FLAMELET) { + SU2_MPI::Error("The use of SCALAR_MODEL= FLAMELET requires the FLUID_MODEL option to be FLUID_FLAMELET", + CURRENT_FUNCTION); + } + + if (!Variable_Density) { + SU2_MPI::Error("The use of FLUID_FLAMELET requires the INC_DENSITY_MODEL option to be VARIABLE or FLAMELET", + CURRENT_FUNCTION); + } + + if (Kind_ConductivityModel != CONDUCTIVITYMODEL::FLAMELET) { + SU2_MPI::Error("The use of FLUID_FLAMELET requires the CONDUCTIVITY_MODEL option to be FLAMELET", + CURRENT_FUNCTION); + } + + if (Kind_Diffusivity_Model != DIFFUSIVITYMODEL::FLAMELET) { + SU2_MPI::Error("The use of FLUID_FLAMELET requires the DIFFUSIVITY_MODEL option to be FLAMELET", + CURRENT_FUNCTION); + } + + if (Kind_ViscosityModel != VISCOSITYMODEL::FLAMELET) { + SU2_MPI::Error("The use of FLUID_FLAMELET requires the VISCOSITY_MODEL option to be FLAMELET", + CURRENT_FUNCTION); + } + + if (Weakly_Coupled_Heat) { + SU2_MPI::Error("The use of FLUID_FLAMELET is incompatible with WEAKLY_COUPLED_HEAT in the same zone.", + CURRENT_FUNCTION); + } + } + /*--- Check for Measurement System ---*/ if (SystemMeasurements == US && !standard_air) { SU2_MPI::Error("Only STANDARD_AIR fluid model can be used with US Measurement System", CURRENT_FUNCTION); } - if (Kind_FluidModel == SU2_NONEQ && (Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::SUTHERLAND) ) { - SU2_MPI::Error("Only WILKE and SUTHERLAND transport models are stable for the NEMO solver using SU2TClib. Use Mutation++ instead.", CURRENT_FUNCTION); + /* --- Check for NEMO compatibility issues ---*/ + if (Kind_FluidModel == SU2_NONEQ && (Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::SUTHERLAND && Kind_TransCoeffModel != TRANSCOEFFMODEL::GUPTAYOS) ) { + SU2_MPI::Error("Transport model not available for NEMO solver using SU2TCLIB. Please use the WILKE, SUTHERLAND or GUPTAYOS transport model instead.", CURRENT_FUNCTION); + } + + if (Kind_Solver == MAIN_SOLVER::NEMO_NAVIER_STOKES) { + if (Kind_FluidModel == SU2_NONEQ && GasModel == "AIR-7" && Kind_TransCoeffModel != TRANSCOEFFMODEL::GUPTAYOS) { + SU2_MPI::Error("Only Gupta-Yos transport model available for ionized flows using SU2TCLIB.", CURRENT_FUNCTION); + } } - if (Kind_FluidModel == MUTATIONPP && - (Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::CHAPMANN_ENSKOG)) { - SU2_MPI::Error("Only WILKE and Chapmann-Enskog transport model can be used with Mutation++ at the moment.", + if (Kind_FluidModel == MUTATIONPP && (Kind_TransCoeffModel == TRANSCOEFFMODEL::SUTHERLAND)) { + SU2_MPI::Error("Transport model not available for NEMO solver using MUTATIONPP. Please use the WILKE, GUPTAYOS, or CHAPMANN_ENSKOG transport model instead.", CURRENT_FUNCTION); } + if (Kind_FluidModel == SU2_NONEQ && GasModel == "AIR-7" && nWall_Catalytic != 0) { + SU2_MPI::Error("Catalytic wall recombination is not yet available for ionized flows in SU2_NEMO.", CURRENT_FUNCTION); + } + if (!ideal_gas && !nemo) { if (Kind_Upwind_Flow != UPWIND::ROE && Kind_Upwind_Flow != UPWIND::HLLC && Kind_Centered_Flow != CENTERED::JST) { SU2_MPI::Error("Only ROE Upwind, HLLC Upwind scheme, and JST scheme can be used for Non-Ideal Compressible Fluids", CURRENT_FUNCTION); @@ -4334,8 +4385,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Set the boolean flag if we are carrying out an aeroelastic simulation. ---*/ - if (GetGrid_Movement() && (GetSurface_Movement(AEROELASTIC) || GetSurface_Movement(AEROELASTIC_RIGID_MOTION))) Aeroelastic_Simulation = true; - else Aeroelastic_Simulation = false; + Aeroelastic_Simulation = GetGrid_Movement() && (GetSurface_Movement(AEROELASTIC) || GetSurface_Movement(AEROELASTIC_RIGID_MOTION)); /*--- Initializing the size for the solutions of the Aeroelastic problem. ---*/ @@ -4397,7 +4447,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Make the MG_PreSmooth, MG_PostSmooth, and MG_CorrecSmooth arrays consistent with nMGLevels ---*/ - unsigned short * tmp_smooth = new unsigned short[nMGLevels+1]; + auto * tmp_smooth = new unsigned short[nMGLevels+1]; if ((nMG_PreSmooth != nMGLevels+1) && (nMG_PreSmooth != 0)) { if (nMG_PreSmooth > nMGLevels+1) { @@ -4671,6 +4721,11 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i MaterialDensity = new su2double[1]; MaterialDensity[0] = 7854; } + if (nElasticityMod != nPoissonRatio || nElasticityMod != nMaterialDensity) { + SU2_MPI::Error("ELASTICITY_MODULUS, POISSON_RATIO, and MATERIAL_DENSITY need to have the same number " + "of entries (the number of materials).", CURRENT_FUNCTION); + } + if (nElectric_Constant == 0) { nElectric_Constant = 1; Electric_Constant = new su2double[1]; Electric_Constant[0] = 0.0; @@ -4865,7 +4920,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i if (Kind_Solver == MAIN_SOLVER::INC_EULER) { /*--- Force inviscid problems to use constant density and disable energy. ---*/ - if (Kind_DensityModel != INC_DENSITYMODEL::CONSTANT || Energy_Equation == true) { + if (Kind_DensityModel != INC_DENSITYMODEL::CONSTANT || Energy_Equation) { SU2_MPI::Error("Inviscid incompressible problems must be constant density (no energy eqn.).\n Use DENSITY_MODEL= CONSTANT and ENERGY_EQUATION= NO.", CURRENT_FUNCTION); } } @@ -4877,9 +4932,9 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i Kind_FluidModel = CONSTANT_DENSITY; } - /*--- Energy equation must be active for any fluid models other than constant density. ---*/ - if ((Kind_DensityModel != INC_DENSITYMODEL::CONSTANT) && (Kind_Species_Model==SPECIES_MODEL::NONE)) Energy_Equation = true; + /*--- For the flamelet combustion model, energy equation is a passive field, we lookup T and write it to the field ---*/ + if (Kind_Species_Model == SPECIES_MODEL::FLAMELET ) Energy_Equation = false; if (Kind_DensityModel == INC_DENSITYMODEL::BOUSSINESQ) { Energy_Equation = true; @@ -4889,7 +4944,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } if (Kind_DensityModel == INC_DENSITYMODEL::VARIABLE) { - if (Kind_FluidModel != INC_IDEAL_GAS && Kind_FluidModel != INC_IDEAL_GAS_POLY && Kind_FluidModel != FLUID_MIXTURE) { + if (Kind_FluidModel != INC_IDEAL_GAS && Kind_FluidModel != INC_IDEAL_GAS_POLY && Kind_FluidModel != FLUID_MIXTURE && Kind_FluidModel != FLUID_FLAMELET) { SU2_MPI::Error("Variable density incompressible solver limited to ideal gases.\n Check the fluid model options (use INC_IDEAL_GAS, INC_IDEAL_GAS_POLY).", CURRENT_FUNCTION); } } @@ -4928,6 +4983,11 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i } } + /*--- Data-driven fluid model is currently only supported for compressible flow problems. ---*/ + if ((Kind_Solver == MAIN_SOLVER::INC_EULER || Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES || Kind_Solver == MAIN_SOLVER::INC_RANS) && (Kind_FluidModel == DATADRIVEN_FLUID)) { + SU2_MPI::Error("Data-driven fluid model can only be used for compressible flows.", CURRENT_FUNCTION); + } + if ((Kind_Solver == MAIN_SOLVER::INC_EULER || Kind_Solver == MAIN_SOLVER::INC_NAVIER_STOKES || Kind_Solver == MAIN_SOLVER::INC_RANS) && (Kind_FluidModel == INC_IDEAL_GAS_POLY)) { su2double sum = 0.0; for (unsigned short iVar = 0; iVar < N_POLY_COEFFS; iVar++) { @@ -5131,8 +5191,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i Mesh_Box_Size[1] = 33; Mesh_Box_Size[2] = 33; } else if (nMesh_Box_Size != 3) { - SU2_MPI::Error(string("MESH_BOX_SIZE specified without 3 values.\n"), - CURRENT_FUNCTION); + SU2_MPI::Error("MESH_BOX_SIZE specified without 3 values.\n", CURRENT_FUNCTION); } /* Force the lowest memory preconditioner when direct solvers are used. */ @@ -5149,8 +5208,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i if (DiscreteAdjoint) { #if !defined CODI_REVERSE_TYPE if (Kind_SU2 == SU2_COMPONENT::SU2_CFD) { - SU2_MPI::Error(string("SU2_CFD: Config option MATH_PROBLEM= DISCRETE_ADJOINT requires AD support!\n") + - string("Please use SU2_CFD_AD (configuration/compilation is done using the preconfigure.py script)."), + SU2_MPI::Error("SU2_CFD: Config option MATH_PROBLEM= DISCRETE_ADJOINT requires AD support!\n" + "Please use SU2_CFD_AD (configuration/compilation is done using the preconfigure.py script).", CURRENT_FUNCTION); } #endif @@ -5164,8 +5223,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i Restart_Flow = false; if (Unst_AdjointIter- long(nTimeIter) < 0){ - SU2_MPI::Error(string("Invalid iteration number requested for unsteady adjoint.\n" ) + - string("Make sure EXT_ITER is larger or equal than UNST_ADJOINT_ITER."), + SU2_MPI::Error("Invalid iteration number requested for unsteady adjoint.\n" + "Make sure EXT_ITER is larger or equal than UNST_ADJOINT_ITER.", CURRENT_FUNCTION); } @@ -5224,8 +5283,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i turbulence model. */ if (MUSCL_AdjTurb) { - SU2_MPI::Error(string("MUSCL_ADJTURB= YES not currently supported.\n") + - string("Please select MUSCL_ADJTURB= NO (first-order)."), + SU2_MPI::Error("MUSCL_ADJTURB= YES not currently supported.\nPlease select MUSCL_ADJTURB= NO (first-order).", CURRENT_FUNCTION); } @@ -5246,9 +5304,11 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i we also want to avoid recomputation. */ ReconstructionGradientRequired = false; - Kind_Gradient_Method_Recon = Kind_Gradient_Method; + Kind_Gradient_Method_Recon = Kind_Gradient_Method; } + } else { + ReconstructionGradientRequired = false; } if (ReconstructionGradientRequired && GetFluidProblem() && Kind_ConvNumScheme_Flow == SPACE_CENTERED) @@ -5305,8 +5365,7 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Specifying a deforming surface requires a mesh deformation solver. ---*/ if (GetSurface_Movement(DEFORMING)) Deform_Mesh = true; - if (GetGasModel() == "ARGON") {monoatomic = true;} - else {monoatomic = false;} + monoatomic = GetGasModel() == "ARGON"; /*--- Set number of Turbulence Variables. ---*/ switch (TurbModelFamily(Kind_Turb_Model)) { @@ -5325,9 +5384,14 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i "The use of MARKER_INLET_TURBULENT requires the number of entries when SST Model is used \n" "to be equal to 2 : Turbulent intensity and ratio turbulent to laminar viscosity", CURRENT_FUNCTION); + if (Marker_Inlet_Turb != nullptr && Kind_Turb_Model == TURB_MODEL::SA && nTurb_Properties != 1) + SU2_MPI::Error( + "The use of MARKER_INLET_TURBULENT requires the number of entries when SA Model is used \n" + "to be equal to 1 : ratio turbulent to laminar viscosity", + CURRENT_FUNCTION); /*--- Checks for additional species transport. ---*/ - if (Kind_Species_Model == SPECIES_MODEL::SPECIES_TRANSPORT) { + if ((Kind_Species_Model == SPECIES_MODEL::SPECIES_TRANSPORT) || (Kind_Species_Model == SPECIES_MODEL::FLAMELET)) { if (Kind_Solver != MAIN_SOLVER::INC_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::INC_RANS && Kind_Solver != MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES && @@ -5366,14 +5430,14 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i /*--- Check whether the number of entries of the constant Lewis number equals the number of transported scalar equations solved. nConstant_Lewis_Number is used because it is required for the diffusivity fluid mixing models--- */ - if (Kind_Diffusivity_Model == DIFFUSIVITYMODEL::CONSTANT_LEWIS && nConstant_Lewis_Number != nSpecies_Init) + if (Kind_Diffusivity_Model == DIFFUSIVITYMODEL::CONSTANT_LEWIS && nConstant_Lewis_Number != nSpecies_Init + 1) SU2_MPI::Error( "The use of CONSTANT_LEWIS requires the number of entries for CONSTANT_LEWIS_NUMBER ,\n" - "to be equal to the number of entries of SPECIES_INIT", + "to be equal to the number of entries of SPECIES_INIT +1", CURRENT_FUNCTION); // Helper function that checks scalar variable bounds, - auto checkScalarBounds = [&](su2double scalar, string name, su2double lowerBound, su2double upperBound) { + auto checkScalarBounds = [&](su2double scalar, const string& name, su2double lowerBound, su2double upperBound) { if (scalar < lowerBound || scalar > upperBound) SU2_MPI::Error(string("Variable: ") + name + string(", is out of bounds."), CURRENT_FUNCTION); }; @@ -5397,24 +5461,37 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i nSpecies = nSpecies_Init; /*--- Check whether some variables (or their sums) are in physical bounds. [0,1] for species related quantities. ---*/ - su2double Species_Init_Sum = 0.0; - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) { - checkScalarBounds(Species_Init[iSpecies], "SPECIES_INIT individual", 0.0, 1.0); - Species_Init_Sum += Species_Init[iSpecies]; - } - checkScalarBounds(Species_Init_Sum, "SPECIES_INIT sum", 0.0, 1.0); - - for (unsigned short iMarker = 0; iMarker < nMarker_Inlet_Species; iMarker++) { - su2double Inlet_SpeciesVal_Sum = 0.0; + /*--- Note, only for species transport, not for flamelet model ---*/ + if (Kind_Species_Model == SPECIES_MODEL::SPECIES_TRANSPORT) { + su2double Species_Init_Sum = 0.0; for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) { - checkScalarBounds(Inlet_SpeciesVal[iMarker][iSpecies], "MARKER_INLET_SPECIES individual", 0.0, 1.0); - Inlet_SpeciesVal_Sum += Inlet_SpeciesVal[iMarker][iSpecies]; + checkScalarBounds(Species_Init[iSpecies], "SPECIES_INIT individual", 0.0, 1.0); + Species_Init_Sum += Species_Init[iSpecies]; + } + checkScalarBounds(Species_Init_Sum, "SPECIES_INIT sum", 0.0, 1.0); + + for (iMarker = 0; iMarker < nMarker_Inlet_Species; iMarker++) { + su2double Inlet_SpeciesVal_Sum = 0.0; + for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + checkScalarBounds(Inlet_SpeciesVal[iMarker][iSpecies], "MARKER_INLET_SPECIES individual", 0.0, 1.0); + Inlet_SpeciesVal_Sum += Inlet_SpeciesVal[iMarker][iSpecies]; + } + checkScalarBounds(Inlet_SpeciesVal_Sum, "MARKER_INLET_SPECIES sum", 0.0, 1.0); } - checkScalarBounds(Inlet_SpeciesVal_Sum, "MARKER_INLET_SPECIES sum", 0.0, 1.0); } } // species transport checks + /*--- Define some variables for flamelet model. ---*/ + if (Kind_Species_Model == SPECIES_MODEL::FLAMELET) { + /*--- The controlling variables are progress variable, total enthalpy, and optionally mixture fraction ---*/ + //n_control_vars = nSpecies - n_user_scalars; + if (n_control_vars != (nSpecies - n_user_scalars)) + SU2_MPI::Error("Number of initial species incompatbile with number of controlling variables and user scalars.", CURRENT_FUNCTION); + /*--- We can have additional user defined transported scalars ---*/ + n_scalars = n_control_vars + n_user_scalars; + } + if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE && GetBounded_Scalar()) { SU2_MPI::Error("BOUNDED_SCALAR discretization can only be used for incompressible problems.", CURRENT_FUNCTION); } @@ -5960,7 +6037,7 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { iMarker_Designing, iMarker_GeoEval, iMarker_Plotting, iMarker_Analyze, iMarker_DV, iDV_Value, iMarker_ZoneInterface, iMarker_PyCustom, iMarker_Load_Dir, iMarker_Disp_Dir, iMarker_Load_Sine, iMarker_Clamped, iMarker_Moving, iMarker_Supersonic_Inlet, iMarker_Supersonic_Outlet, iMarker_ActDiskInlet, - iMarker_Emissivity, + iMarker_Emissivity, iMarker_StrongBC, iMarker_ActDiskOutlet, iMarker_MixingPlaneInterface, iMarker_SobolevBC; @@ -6086,14 +6163,14 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE) cout << "Compressible two-temperature thermochemical non-equilibrium Euler equations." << endl; if (Kind_FluidModel == SU2_NONEQ){ if ((GasModel != "N2") && (GasModel != "AIR-5") && (GasModel != "AIR-7") && (GasModel != "ARGON")) - SU2_MPI::Error("The GAS_MODEL given as input is not valid. Choose one of the options: N2, AIR-5, AIR-7, ARGON.", CURRENT_FUNCTION); + SU2_MPI::Error("The GAS_MODEL given is unavailable using CSU2TCLIB. Choose one of the options: N2, AIR-5, AIR-7, or ARGON.", CURRENT_FUNCTION); } break; case MAIN_SOLVER::NEMO_NAVIER_STOKES: if (Kind_Regime == ENUM_REGIME::COMPRESSIBLE) cout << "Compressible two-temperature thermochemical non-equilibrium Navier-Stokes equations." << endl; if (Kind_FluidModel == SU2_NONEQ){ - if ((GasModel != "N2") && (GasModel != "AIR-5") && (GasModel != "ARGON")) - SU2_MPI::Error("The GAS_MODEL given as input is not valid. Choose one of the options: N2, AIR-5, ARGON.", CURRENT_FUNCTION); + if ((GasModel != "N2") && (GasModel != "AIR-5") && (GasModel != "AIR-7") && (GasModel != "ARGON")) + SU2_MPI::Error("The GAS_MODEL given is unavailable using CSU2TCLIB. Choose one of the options: N2, AIR-5, AIR-7, or ARGON.", CURRENT_FUNCTION); } break; case MAIN_SOLVER::FEM_LES: @@ -6362,7 +6439,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { case FFD_CONTROL_POINT_2D: cout << "FFD 2D (control point) <-> "; break; case FFD_CAMBER_2D: cout << "FFD 2D (camber) <-> "; break; case FFD_THICKNESS_2D: cout << "FFD 2D (thickness) <-> "; break; - case FFD_TWIST_2D: cout << "FFD 2D (twist) <-> "; break; case HICKS_HENNE: cout << "Hicks Henne <-> " ; break; case SURFACE_BUMP: cout << "Surface bump <-> " ; break; case ANGLE_OF_ATTACK: cout << "Angle of attack <-> " ; break; @@ -6412,7 +6488,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { (Design_Variable[iDV] == CST) || (Design_Variable[iDV] == SURFACE_BUMP) || (Design_Variable[iDV] == FFD_CAMBER) || - (Design_Variable[iDV] == FFD_TWIST_2D) || (Design_Variable[iDV] == FFD_THICKNESS) ) nParamDV = 3; if (Design_Variable[iDV] == FFD_CONTROL_POINT_2D) nParamDV = 5; if (Design_Variable[iDV] == ROTATION) nParamDV = 6; @@ -6432,7 +6507,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { (Design_Variable[iDV] == FFD_CONTROL_POINT_2D) || (Design_Variable[iDV] == FFD_CAMBER_2D) || (Design_Variable[iDV] == FFD_THICKNESS_2D) || - (Design_Variable[iDV] == FFD_TWIST_2D) || (Design_Variable[iDV] == FFD_CONTROL_POINT) || (Design_Variable[iDV] == FFD_NACELLE) || (Design_Variable[iDV] == FFD_GULL) || @@ -6572,6 +6646,18 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { cout << "Venkatakrishnan slope-limiting method, with constant: " << Venkat_LimiterCoeff << ".\n"; cout << "The reference element size is: " << RefElemLength << ". " << endl; break; + case LIMITER::NISHIKAWA_R3: + cout << "Nishikawa's R3 slope-limiting method, with constant: " << Venkat_LimiterCoeff << ".\n"; + cout << "The reference element size is: " << RefElemLength << ". " << endl; + break; + case LIMITER::NISHIKAWA_R4: + cout << "Nishikawa's R4 slope-limiting method, with constant: " << Venkat_LimiterCoeff << ".\n"; + cout << "The reference element size is: " << RefElemLength << ". " << endl; + break; + case LIMITER::NISHIKAWA_R5: + cout << "Nishikawa's R5 slope-limiting method, with constant: " << Venkat_LimiterCoeff << ".\n"; + cout << "The reference element size is: " << RefElemLength << ". " << endl; + break; case LIMITER::VENKATAKRISHNAN_WANG: cout << "Venkatakrishnan-Wang slope-limiting method, with constant: " << Venkat_LimiterCoeff << "." << endl; break; @@ -6626,7 +6712,6 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { if (Kind_Upwind_Flow == UPWIND::HLLC) cout << "HLLC solver for the flow inviscid terms."<< endl; if (Kind_Upwind_Flow == UPWIND::SW) cout << "Steger-Warming solver for the flow inviscid terms."<< endl; if (Kind_Upwind_Flow == UPWIND::MSW) cout << "Modified Steger-Warming solver for the flow inviscid terms."<< endl; - if (Kind_Upwind_Flow == UPWIND::CUSP) cout << "CUSP solver for the flow inviscid terms."<< endl; if (Kind_Upwind_Flow == UPWIND::L2ROE) cout << "L2ROE Low Mach ROE solver for the flow inviscid terms."<< endl; if (Kind_Upwind_Flow == UPWIND::LMROE) cout << "Rieper Low Mach ROE solver for the flow inviscid terms."<< endl; if (Kind_Upwind_Flow == UPWIND::SLAU) cout << "Simple Low-Dissipation AUSM solver for the flow inviscid terms."<< endl; @@ -6810,7 +6895,7 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { else { if (Time_Domain) { cout << "Dynamic structural analysis."<< endl; - cout << "Time step provided by the user for the dynamic analysis(s): "<< Delta_DynTime << "." << endl; + cout << "Time step provided by the user for the dynamic analysis(s): "<< Time_Step << "." << endl; } else { cout << "Static structural analysis." << endl; } @@ -6878,14 +6963,11 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { if (fea) { switch (Kind_TimeIntScheme_FEA) { - case STRUCT_TIME_INT::CD_EXPLICIT: - cout << "Explicit time integration (NOT IMPLEMENTED YET)." << endl; - break; case STRUCT_TIME_INT::GENERALIZED_ALPHA: cout << "Generalized-alpha method." << endl; break; case STRUCT_TIME_INT::NEWMARK_IMPLICIT: - if (Dynamic_Analysis) cout << "Newmark implicit method for the structural time integration." << endl; + if (Time_Domain) cout << "Newmark implicit method for the structural time integration." << endl; switch (Kind_Linear_Solver) { case BCGSTAB: cout << "BCGSTAB is used for solving the linear system." << endl; @@ -7464,6 +7546,15 @@ void CConfig::SetOutput(SU2_COMPONENT val_software, unsigned short val_izone) { BoundaryTable.PrintFooter(); } + if (nMarker_StrongBC != 0) { + BoundaryTable << "Strong boundary"; + for (iMarker_StrongBC = 0; iMarker_StrongBC < nMarker_StrongBC; iMarker_StrongBC++) { + BoundaryTable << Marker_StrongBC[iMarker_StrongBC]; + if (iMarker_StrongBC < nMarker_StrongBC-1) BoundaryTable << " "; + } + BoundaryTable.PrintFooter(); + } + if (nMarker_Custom != 0) { BoundaryTable << "Custom boundary"; for (iMarker_Custom = 0; iMarker_Custom < nMarker_Custom; iMarker_Custom++) { @@ -7514,7 +7605,7 @@ bool CConfig::TokenizeString(string & str, string & option_name, const string delimiters(" (){}:,\t\n\v\f\r"); // check for comments or empty string string::size_type pos, last_pos; - pos = str.find_first_of("%"); + pos = str.find_first_of('%'); if ( (str.length() == 0) || (pos == 0) ) { // str is empty or a comment line, so no option here return false; @@ -7532,7 +7623,7 @@ bool CConfig::TokenizeString(string & str, string & option_name, // find the equals sign and split string string name_part, value_part; - pos = str.find("="); + pos = str.find('='); if (pos == string::npos) { cerr << "Error in TokenizeString(): " << "line in the configuration file with no \"=\" sign." @@ -7588,7 +7679,7 @@ bool CConfig::TokenizeString(string & str, string & option_name, // find next "non-delimiter" pos = value_part.find_first_of(delimiters, last_pos); } - if (option_value.size() == 0) { + if (option_value.empty()) { cerr << "Error in TokenizeString(): " << "option " << option_name << " in configuration file with no value assigned." << endl; @@ -7623,16 +7714,15 @@ bool CConfig::TokenizeString(string & str, string & option_name, *it = before_semi; it++; vector to_insert; - to_insert.push_back(";"); + to_insert.emplace_back(";"); if (!after_semi.empty()) to_insert.push_back(after_semi); option_value.insert(it, to_insert.begin(), to_insert.end()); } it = option_value.begin(); // go back to beginning; not efficient continue; - } else { - it++; - } + } it++; + } #if 0 cout << "option value(s) = "; @@ -7652,11 +7742,7 @@ bool CConfig::TokenizeString(string & str, string & option_name, continue; } } - if (it->compare(";") == 0) { - semi_at_prev = true; - } else { - semi_at_prev = false; - } + semi_at_prev = it->compare(";") == 0; it++; } @@ -7669,7 +7755,7 @@ bool CConfig::TokenizeString(string & str, string & option_name, return true; } -unsigned short CConfig::GetMarker_CfgFile_TagBound(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_TagBound(const string& val_marker) const { unsigned short iMarker_CfgFile; @@ -7685,133 +7771,133 @@ string CConfig::GetMarker_CfgFile_TagBound(unsigned short val_marker) const { return Marker_CfgFile_TagBound[val_marker]; } -unsigned short CConfig::GetMarker_CfgFile_KindBC(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_KindBC(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_KindBC[iMarker_CfgFile]; } -unsigned short CConfig::GetMarker_CfgFile_Monitoring(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_Monitoring(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_Monitoring[iMarker_CfgFile]; } -unsigned short CConfig::GetMarker_CfgFile_GeoEval(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_GeoEval(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_GeoEval[iMarker_CfgFile]; } -unsigned short CConfig::GetMarker_CfgFile_Designing(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_Designing(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_Designing[iMarker_CfgFile]; } -unsigned short CConfig::GetMarker_CfgFile_Plotting(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_Plotting(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_Plotting[iMarker_CfgFile]; } -unsigned short CConfig::GetMarker_CfgFile_Analyze(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_Analyze(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_Analyze[iMarker_CfgFile]; } -unsigned short CConfig::GetMarker_CfgFile_ZoneInterface(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_ZoneInterface(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_ZoneInterface[iMarker_CfgFile]; } -unsigned short CConfig::GetMarker_CfgFile_Turbomachinery(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_Turbomachinery(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_Turbomachinery[iMarker_CfgFile]; } -unsigned short CConfig::GetMarker_CfgFile_TurbomachineryFlag(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_TurbomachineryFlag(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_TurbomachineryFlag[iMarker_CfgFile]; } -unsigned short CConfig::GetMarker_CfgFile_MixingPlaneInterface(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_MixingPlaneInterface(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_MixingPlaneInterface[iMarker_CfgFile]; } -unsigned short CConfig::GetMarker_CfgFile_DV(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_DV(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_DV[iMarker_CfgFile]; } -unsigned short CConfig::GetMarker_CfgFile_Moving(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_Moving(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_Moving[iMarker_CfgFile]; } -unsigned short CConfig::GetMarker_CfgFile_Deform_Mesh(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_Deform_Mesh(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_Deform_Mesh[iMarker_CfgFile]; } -unsigned short CConfig::GetMarker_CfgFile_Deform_Mesh_Sym_Plane(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_Deform_Mesh_Sym_Plane(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_Deform_Mesh_Sym_Plane[iMarker_CfgFile]; } -unsigned short CConfig::GetMarker_CfgFile_Fluid_Load(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_Fluid_Load(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_Fluid_Load[iMarker_CfgFile]; } -unsigned short CConfig::GetMarker_CfgFile_PyCustom(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_PyCustom(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile=0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_PyCustom[iMarker_CfgFile]; } -unsigned short CConfig::GetMarker_CfgFile_PerBound(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_PerBound(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_PerBound[iMarker_CfgFile]; } -unsigned short CConfig::GetMarker_ZoneInterface(string val_marker) const { +unsigned short CConfig::GetMarker_ZoneInterface(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; return Marker_CfgFile_ZoneInterface[iMarker_CfgFile]; } -unsigned short CConfig::GetMarker_CfgFile_SobolevBC(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_SobolevBC(const string& val_marker) const { unsigned short iMarker_CfgFile; for (iMarker_CfgFile = 0; iMarker_CfgFile < nMarker_CfgFile; iMarker_CfgFile++) if (Marker_CfgFile_TagBound[iMarker_CfgFile] == val_marker) break; @@ -7846,8 +7932,8 @@ bool CConfig::GetSolid_Wall(unsigned short iMarker) const { void CConfig::SetSurface_Movement(unsigned short iMarker, unsigned short kind_movement) { - unsigned short* new_surface_movement = new unsigned short[nMarker_Moving + 1]; - string* new_marker_moving = new string[nMarker_Moving+1]; + auto* new_surface_movement = new unsigned short[nMarker_Moving + 1]; + auto* new_marker_moving = new string[nMarker_Moving+1]; for (unsigned short iMarker_Moving = 0; iMarker_Moving < nMarker_Moving; iMarker_Moving++){ new_surface_movement[iMarker_Moving] = Kind_SurfaceMovement[iMarker_Moving]; @@ -7876,7 +7962,7 @@ CConfig::~CConfig() { /*--- Delete all of the option objects in the global option map ---*/ - for(map::iterator itr = option_map.begin(); itr != option_map.end(); itr++) { + for(auto itr = option_map.begin(); itr != option_map.end(); itr++) { delete itr->second; } @@ -8086,11 +8172,11 @@ CConfig::~CConfig() { delete [] FreeStreamTurboNormal; } -string CConfig::GetFilename(string filename, string ext, int timeIter) const { +string CConfig::GetFilename(string filename, const string& ext, int timeIter) const { /*--- Remove any extension --- */ - unsigned short lastindex = filename.find_last_of("."); + unsigned short lastindex = filename.find_last_of('.'); filename = filename.substr(0, lastindex); /*--- Add the extension --- */ @@ -8120,9 +8206,9 @@ string CConfig::GetFilename_Iter(const string& filename_iter, unsigned long curI return iter_ss.str(); } -string CConfig::GetUnsteady_FileName(string val_filename, int val_iter, string ext) const { +string CConfig::GetUnsteady_FileName(string val_filename, int val_iter, const string& ext) const { - string UnstExt="", UnstFilename = val_filename; + string UnstExt, UnstFilename = std::move(val_filename); char buffer[50]; /*--- Check that a positive value iteration is requested (for now). ---*/ @@ -8131,7 +8217,7 @@ string CConfig::GetUnsteady_FileName(string val_filename, int val_iter, string e SU2_MPI::Error("Requesting a negative iteration number for the restart file!!", CURRENT_FUNCTION); } - unsigned short lastindex = UnstFilename.find_last_of("."); + unsigned short lastindex = UnstFilename.find_last_of('.'); UnstFilename = UnstFilename.substr(0, lastindex); /*--- Append iteration number for unsteady cases ---*/ @@ -8151,12 +8237,12 @@ string CConfig::GetUnsteady_FileName(string val_filename, int val_iter, string e return UnstFilename; } -string CConfig::GetMultizone_FileName(string val_filename, int val_iZone, string ext) const { +string CConfig::GetMultizone_FileName(string val_filename, int val_iZone, const string& ext) const { - string multizone_filename = val_filename; + string multizone_filename = std::move(val_filename); char buffer[50]; - unsigned short lastindex = multizone_filename.find_last_of("."); + unsigned short lastindex = multizone_filename.find_last_of('.'); multizone_filename = multizone_filename.substr(0, lastindex); if (Multizone_Problem) { @@ -8168,11 +8254,11 @@ string CConfig::GetMultizone_FileName(string val_filename, int val_iZone, string return multizone_filename; } -string CConfig::GetMultizone_HistoryFileName(string val_filename, int val_iZone, string ext) const { +string CConfig::GetMultizone_HistoryFileName(string val_filename, int val_iZone, const string& ext) const { - string multizone_filename = val_filename; + string multizone_filename = std::move(val_filename); char buffer[50]; - unsigned short lastindex = multizone_filename.find_last_of("."); + unsigned short lastindex = multizone_filename.find_last_of('.'); multizone_filename = multizone_filename.substr(0, lastindex); if (Multizone_Problem) { SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iZone)); @@ -8182,12 +8268,12 @@ string CConfig::GetMultizone_HistoryFileName(string val_filename, int val_iZone, return multizone_filename; } -string CConfig::GetMultiInstance_FileName(string val_filename, int val_iInst, string ext) const { +string CConfig::GetMultiInstance_FileName(string val_filename, int val_iInst, const string& ext) const { - string multizone_filename = val_filename; + string multizone_filename = std::move(val_filename); char buffer[50]; - unsigned short lastindex = multizone_filename.find_last_of("."); + unsigned short lastindex = multizone_filename.find_last_of('.'); multizone_filename = multizone_filename.substr(0, lastindex); SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iInst)); multizone_filename.append(string(buffer)); @@ -8197,10 +8283,10 @@ string CConfig::GetMultiInstance_FileName(string val_filename, int val_iInst, st string CConfig::GetMultiInstance_HistoryFileName(string val_filename, int val_iInst) const { - string multizone_filename = val_filename; + string multizone_filename = std::move(val_filename); char buffer[50]; - unsigned short lastindex = multizone_filename.find_last_of("."); + unsigned short lastindex = multizone_filename.find_last_of('.'); multizone_filename = multizone_filename.substr(0, lastindex); SPRINTF (buffer, "_%d", SU2_TYPE::Int(val_iInst)); multizone_filename.append(string(buffer)); @@ -8210,13 +8296,13 @@ string CConfig::GetMultiInstance_HistoryFileName(string val_filename, int val_iI string CConfig::GetObjFunc_Extension(string val_filename) const { - string AdjExt, Filename = val_filename; + string AdjExt, Filename = std::move(val_filename); if (ContinuousAdjoint || DiscreteAdjoint) { /*--- Remove filename extension (.dat) ---*/ - unsigned short lastindex = Filename.find_last_of("."); + unsigned short lastindex = Filename.find_last_of('.'); Filename = Filename.substr(0, lastindex); if (nObj==1) { @@ -8255,9 +8341,6 @@ string CConfig::GetObjFunc_Extension(string val_filename) const { case SURFACE_SPECIES_VARIANCE: AdjExt = "_specvar"; break; case SURFACE_MACH: AdjExt = "_mach"; break; case CUSTOM_OBJFUNC: AdjExt = "_custom"; break; - case FLOW_ANGLE_OUT: AdjExt = "_fao"; break; - case MASS_FLOW_IN: AdjExt = "_mfi"; break; - case ENTROPY_GENERATION: AdjExt = "_entg"; break; case REFERENCE_GEOMETRY: AdjExt = "_refgeom"; break; case REFERENCE_NODE: AdjExt = "_refnode"; break; case VOLUME_FRACTION: AdjExt = "_volfrac"; break; @@ -8431,9 +8514,6 @@ void CConfig::SetGlobalParam(MAIN_SOLVER val_solver, case MAIN_SOLVER::FEM_ELASTICITY: case MAIN_SOLVER::DISC_ADJ_FEM: - - Current_DynTime = static_cast(TimeIter)*Delta_DynTime; - if (val_system == RUNTIME_FEA_SYS) { SetKind_ConvNumScheme(NONE, CENTERED::NONE, UPWIND::NONE, LIMITER::NONE, NONE, NONE); SetKind_TimeIntScheme(NONE); @@ -8445,28 +8525,28 @@ void CConfig::SetGlobalParam(MAIN_SOLVER val_solver, } } -const su2double* CConfig::GetPeriodicRotCenter(string val_marker) const { +const su2double* CConfig::GetPeriodicRotCenter(const string& val_marker) const { unsigned short iMarker_PerBound; for (iMarker_PerBound = 0; iMarker_PerBound < nMarker_PerBound; iMarker_PerBound++) if (Marker_PerBound[iMarker_PerBound] == val_marker) break; return Periodic_RotCenter[iMarker_PerBound]; } -const su2double* CConfig::GetPeriodicRotAngles(string val_marker) const { +const su2double* CConfig::GetPeriodicRotAngles(const string& val_marker) const { unsigned short iMarker_PerBound; for (iMarker_PerBound = 0; iMarker_PerBound < nMarker_PerBound; iMarker_PerBound++) if (Marker_PerBound[iMarker_PerBound] == val_marker) break; return Periodic_RotAngles[iMarker_PerBound]; } -const su2double* CConfig::GetPeriodicTranslation(string val_marker) const { +const su2double* CConfig::GetPeriodicTranslation(const string& val_marker) const { unsigned short iMarker_PerBound; for (iMarker_PerBound = 0; iMarker_PerBound < nMarker_PerBound; iMarker_PerBound++) if (Marker_PerBound[iMarker_PerBound] == val_marker) break; return Periodic_Translation[iMarker_PerBound]; } -unsigned short CConfig::GetMarker_Periodic_Donor(string val_marker) const { +unsigned short CConfig::GetMarker_Periodic_Donor(const string& val_marker) const { unsigned short iMarker_PerBound, jMarker_PerBound, kMarker_All; /*--- Find the marker for this periodic boundary. ---*/ @@ -8484,7 +8564,7 @@ unsigned short CConfig::GetMarker_Periodic_Donor(string val_marker) const { return kMarker_All; } -su2double CConfig::GetActDisk_NetThrust(string val_marker) const { +su2double CConfig::GetActDisk_NetThrust(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || @@ -8492,7 +8572,7 @@ su2double CConfig::GetActDisk_NetThrust(string val_marker) const { return ActDisk_NetThrust[iMarker_ActDisk]; } -su2double CConfig::GetActDisk_Power(string val_marker) const { +su2double CConfig::GetActDisk_Power(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || @@ -8500,7 +8580,7 @@ su2double CConfig::GetActDisk_Power(string val_marker) const { return ActDisk_Power[iMarker_ActDisk]; } -su2double CConfig::GetActDisk_MassFlow(string val_marker) const { +su2double CConfig::GetActDisk_MassFlow(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || @@ -8508,7 +8588,7 @@ su2double CConfig::GetActDisk_MassFlow(string val_marker) const { return ActDisk_MassFlow[iMarker_ActDisk]; } -su2double CConfig::GetActDisk_Mach(string val_marker) const { +su2double CConfig::GetActDisk_Mach(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || @@ -8516,7 +8596,7 @@ su2double CConfig::GetActDisk_Mach(string val_marker) const { return ActDisk_Mach[iMarker_ActDisk]; } -su2double CConfig::GetActDisk_Force(string val_marker) const { +su2double CConfig::GetActDisk_Force(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || @@ -8524,7 +8604,7 @@ su2double CConfig::GetActDisk_Force(string val_marker) const { return ActDisk_Force[iMarker_ActDisk]; } -su2double CConfig::GetActDisk_BCThrust(string val_marker) const { +su2double CConfig::GetActDisk_BCThrust(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || @@ -8532,7 +8612,7 @@ su2double CConfig::GetActDisk_BCThrust(string val_marker) const { return ActDisk_BCThrust[iMarker_ActDisk]; } -su2double CConfig::GetActDisk_BCThrust_Old(string val_marker) const { +su2double CConfig::GetActDisk_BCThrust_Old(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || @@ -8540,7 +8620,7 @@ su2double CConfig::GetActDisk_BCThrust_Old(string val_marker) const { return ActDisk_BCThrust_Old[iMarker_ActDisk]; } -void CConfig::SetActDisk_BCThrust(string val_marker, su2double val_actdisk_bcthrust) { +void CConfig::SetActDisk_BCThrust(const string& val_marker, su2double val_actdisk_bcthrust) { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || @@ -8548,7 +8628,7 @@ void CConfig::SetActDisk_BCThrust(string val_marker, su2double val_actdisk_bcthr ActDisk_BCThrust[iMarker_ActDisk] = val_actdisk_bcthrust; } -void CConfig::SetActDisk_BCThrust_Old(string val_marker, su2double val_actdisk_bcthrust_old) { +void CConfig::SetActDisk_BCThrust_Old(const string& val_marker, su2double val_actdisk_bcthrust_old) { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || @@ -8556,7 +8636,7 @@ void CConfig::SetActDisk_BCThrust_Old(string val_marker, su2double val_actdisk_b ActDisk_BCThrust_Old[iMarker_ActDisk] = val_actdisk_bcthrust_old; } -su2double CConfig::GetActDisk_Area(string val_marker) const { +su2double CConfig::GetActDisk_Area(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || @@ -8564,7 +8644,7 @@ su2double CConfig::GetActDisk_Area(string val_marker) const { return ActDisk_Area[iMarker_ActDisk]; } -su2double CConfig::GetActDisk_ReverseMassFlow(string val_marker) const { +su2double CConfig::GetActDisk_ReverseMassFlow(const string& val_marker) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || @@ -8572,7 +8652,7 @@ su2double CConfig::GetActDisk_ReverseMassFlow(string val_marker) const { return ActDisk_ReverseMassFlow[iMarker_ActDisk]; } -su2double CConfig::GetActDisk_PressJump(string val_marker, unsigned short val_value) const { +su2double CConfig::GetActDisk_PressJump(const string& val_marker, unsigned short val_value) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || @@ -8580,7 +8660,7 @@ su2double CConfig::GetActDisk_PressJump(string val_marker, unsigned short val_va return ActDisk_PressJump[iMarker_ActDisk][val_value]; } -su2double CConfig::GetActDisk_TempJump(string val_marker, unsigned short val_value) const { +su2double CConfig::GetActDisk_TempJump(const string& val_marker, unsigned short val_value) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || @@ -8588,7 +8668,7 @@ su2double CConfig::GetActDisk_TempJump(string val_marker, unsigned short val_val return ActDisk_TempJump[iMarker_ActDisk][val_value];; } -su2double CConfig::GetActDisk_Omega(string val_marker, unsigned short val_value) const { +su2double CConfig::GetActDisk_Omega(const string& val_marker, unsigned short val_value) const { unsigned short iMarker_ActDisk; for (iMarker_ActDisk = 0; iMarker_ActDisk < nMarker_ActDiskInlet; iMarker_ActDisk++) if ((Marker_ActDiskInlet[iMarker_ActDisk] == val_marker) || @@ -8596,28 +8676,28 @@ su2double CConfig::GetActDisk_Omega(string val_marker, unsigned short val_value) return ActDisk_Omega[iMarker_ActDisk][val_value];; } -su2double CConfig::GetOutlet_MassFlow(string val_marker) const { +su2double CConfig::GetOutlet_MassFlow(const string& val_marker) const { unsigned short iMarker_Outlet; for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) if ((Marker_Outlet[iMarker_Outlet] == val_marker)) break; return Outlet_MassFlow[iMarker_Outlet]; } -su2double CConfig::GetOutlet_Density(string val_marker) const { +su2double CConfig::GetOutlet_Density(const string& val_marker) const { unsigned short iMarker_Outlet; for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) if ((Marker_Outlet[iMarker_Outlet] == val_marker)) break; return Outlet_Density[iMarker_Outlet]; } -su2double CConfig::GetOutlet_Area(string val_marker) const { +su2double CConfig::GetOutlet_Area(const string& val_marker) const { unsigned short iMarker_Outlet; for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) if ((Marker_Outlet[iMarker_Outlet] == val_marker)) break; return Outlet_Area[iMarker_Outlet]; } -unsigned short CConfig::GetMarker_CfgFile_ActDiskOutlet(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_ActDiskOutlet(const string& val_marker) const { unsigned short iMarker_ActDisk, kMarker_All; /*--- Find the marker for this actuator disk inlet. ---*/ @@ -8633,7 +8713,7 @@ unsigned short CConfig::GetMarker_CfgFile_ActDiskOutlet(string val_marker) const return kMarker_All; } -unsigned short CConfig::GetMarker_CfgFile_EngineExhaust(string val_marker) const { +unsigned short CConfig::GetMarker_CfgFile_EngineExhaust(const string& val_marker) const { unsigned short iMarker_Engine, kMarker_All; /*--- Find the marker for this engine inflow. ---*/ @@ -8676,47 +8756,37 @@ bool CConfig::GetSurface_Movement(unsigned short kind_movement) const { return false; } -unsigned short CConfig::GetMarker_Moving(string val_marker) const { - unsigned short iMarker_Moving; +unsigned short CConfig::GetMarker_Moving(const string& val_marker) const { + unsigned short iMarker; /*--- Find the marker for this moving boundary. ---*/ - for (iMarker_Moving = 0; iMarker_Moving < nMarker_Moving; iMarker_Moving++) - if (Marker_Moving[iMarker_Moving] == val_marker) break; + for (iMarker = 0; iMarker < nMarker_Moving; iMarker++) + if (Marker_Moving[iMarker] == val_marker) break; - return iMarker_Moving; + return iMarker; } -bool CConfig::GetMarker_Moving_Bool(string val_marker) const { - unsigned short iMarker_Moving; - - /*--- Find the marker for this moving boundary, if it exists. ---*/ - for (iMarker_Moving = 0; iMarker_Moving < nMarker_Moving; iMarker_Moving++) - if (Marker_Moving[iMarker_Moving] == val_marker) return true; - - return false; -} - -unsigned short CConfig::GetMarker_Deform_Mesh(string val_marker) const { - unsigned short iMarker_Deform_Mesh; +unsigned short CConfig::GetMarker_Deform_Mesh(const string& val_marker) const { + unsigned short iMarker; /*--- Find the marker for this interface boundary. ---*/ - for (iMarker_Deform_Mesh = 0; iMarker_Deform_Mesh < nMarker_Deform_Mesh; iMarker_Deform_Mesh++) - if (Marker_Deform_Mesh[iMarker_Deform_Mesh] == val_marker) break; + for (iMarker = 0; iMarker < nMarker_Deform_Mesh; iMarker++) + if (Marker_Deform_Mesh[iMarker] == val_marker) break; - return iMarker_Deform_Mesh; + return iMarker; } -unsigned short CConfig::GetMarker_Deform_Mesh_Sym_Plane(string val_marker) const { - unsigned short iMarker_Deform_Mesh_Sym_Plane; +unsigned short CConfig::GetMarker_Deform_Mesh_Sym_Plane(const string& val_marker) const { + unsigned short iMarker; /*--- Find the marker for this interface boundary. ---*/ - for (iMarker_Deform_Mesh_Sym_Plane = 0; iMarker_Deform_Mesh_Sym_Plane < nMarker_Deform_Mesh_Sym_Plane; iMarker_Deform_Mesh_Sym_Plane++) - if (Marker_Deform_Mesh_Sym_Plane[iMarker_Deform_Mesh_Sym_Plane] == val_marker) break; + for (iMarker = 0; iMarker < nMarker_Deform_Mesh_Sym_Plane; iMarker++) + if (Marker_Deform_Mesh_Sym_Plane[iMarker] == val_marker) break; - return iMarker_Deform_Mesh_Sym_Plane; + return iMarker; } -unsigned short CConfig::GetMarker_Fluid_Load(string val_marker) const { +unsigned short CConfig::GetMarker_Fluid_Load(const string& val_marker) const { unsigned short iMarker_Fluid_Load; /*--- Find the marker for this interface boundary. ---*/ @@ -8726,7 +8796,7 @@ unsigned short CConfig::GetMarker_Fluid_Load(string val_marker) const { return iMarker_Fluid_Load; } -unsigned short CConfig::GetMarker_SobolevBC(string val_marker) const { +unsigned short CConfig::GetMarker_SobolevBC(const string& val_marker) const { unsigned short iMarker_Sobolev; /*--- Find the marker for this moving boundary. ---*/ @@ -8736,183 +8806,186 @@ unsigned short CConfig::GetMarker_SobolevBC(string val_marker) const { return iMarker_Sobolev; } -su2double CConfig::GetExhaust_Temperature_Target(string val_marker) const { +su2double CConfig::GetExhaust_Temperature_Target(const string& val_marker) const { unsigned short iMarker_EngineExhaust; for (iMarker_EngineExhaust = 0; iMarker_EngineExhaust < nMarker_EngineExhaust; iMarker_EngineExhaust++) if (Marker_EngineExhaust[iMarker_EngineExhaust] == val_marker) break; return Exhaust_Temperature_Target[iMarker_EngineExhaust]; } -su2double CConfig::GetExhaust_Pressure_Target(string val_marker) const { +su2double CConfig::GetExhaust_Pressure_Target(const string& val_marker) const { unsigned short iMarker_EngineExhaust; for (iMarker_EngineExhaust = 0; iMarker_EngineExhaust < nMarker_EngineExhaust; iMarker_EngineExhaust++) if (Marker_EngineExhaust[iMarker_EngineExhaust] == val_marker) break; return Exhaust_Pressure_Target[iMarker_EngineExhaust]; } -INLET_TYPE CConfig::GetKind_Inc_Inlet(string val_marker) const { +INLET_TYPE CConfig::GetKind_Inc_Inlet(const string& val_marker) const { unsigned short iMarker_Inlet; for (iMarker_Inlet = 0; iMarker_Inlet < nMarker_Inlet; iMarker_Inlet++) if (Marker_Inlet[iMarker_Inlet] == val_marker) break; return Kind_Inc_Inlet[iMarker_Inlet]; } -INC_OUTLET_TYPE CConfig::GetKind_Inc_Outlet(string val_marker) const { +INC_OUTLET_TYPE CConfig::GetKind_Inc_Outlet(const string& val_marker) const { unsigned short iMarker_Outlet; for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) if (Marker_Outlet[iMarker_Outlet] == val_marker) break; return Kind_Inc_Outlet[iMarker_Outlet]; } -su2double CConfig::GetInlet_Ttotal(string val_marker) const { +su2double CConfig::GetInlet_Ttotal(const string& val_marker) const { unsigned short iMarker_Inlet; for (iMarker_Inlet = 0; iMarker_Inlet < nMarker_Inlet; iMarker_Inlet++) if (Marker_Inlet[iMarker_Inlet] == val_marker) break; return Inlet_Ttotal[iMarker_Inlet]; } -su2double CConfig::GetInlet_Ptotal(string val_marker) const { +su2double CConfig::GetInlet_Ptotal(const string& val_marker) const { unsigned short iMarker_Inlet; for (iMarker_Inlet = 0; iMarker_Inlet < nMarker_Inlet; iMarker_Inlet++) if (Marker_Inlet[iMarker_Inlet] == val_marker) break; return Inlet_Ptotal[iMarker_Inlet]; } -void CConfig::SetInlet_Ptotal(su2double val_pressure, string val_marker) { +void CConfig::SetInlet_Ptotal(su2double val_pressure, const string& val_marker) { unsigned short iMarker_Inlet; for (iMarker_Inlet = 0; iMarker_Inlet < nMarker_Inlet; iMarker_Inlet++) if (Marker_Inlet[iMarker_Inlet] == val_marker) Inlet_Ptotal[iMarker_Inlet] = val_pressure; } -const su2double* CConfig::GetInlet_FlowDir(string val_marker) const { +const su2double* CConfig::GetInlet_FlowDir(const string& val_marker) const { unsigned short iMarker_Inlet; for (iMarker_Inlet = 0; iMarker_Inlet < nMarker_Inlet; iMarker_Inlet++) if (Marker_Inlet[iMarker_Inlet] == val_marker) break; return Inlet_FlowDir[iMarker_Inlet]; } -su2double CConfig::GetInlet_Temperature(string val_marker) const { +su2double CConfig::GetInlet_Temperature(const string& val_marker) const { unsigned short iMarker_Supersonic_Inlet; for (iMarker_Supersonic_Inlet = 0; iMarker_Supersonic_Inlet < nMarker_Supersonic_Inlet; iMarker_Supersonic_Inlet++) if (Marker_Supersonic_Inlet[iMarker_Supersonic_Inlet] == val_marker) break; return Inlet_Temperature[iMarker_Supersonic_Inlet]; } -su2double CConfig::GetInlet_Pressure(string val_marker) const { +su2double CConfig::GetInlet_Pressure(const string& val_marker) const { unsigned short iMarker_Supersonic_Inlet; for (iMarker_Supersonic_Inlet = 0; iMarker_Supersonic_Inlet < nMarker_Supersonic_Inlet; iMarker_Supersonic_Inlet++) if (Marker_Supersonic_Inlet[iMarker_Supersonic_Inlet] == val_marker) break; return Inlet_Pressure[iMarker_Supersonic_Inlet]; } -const su2double* CConfig::GetInlet_Velocity(string val_marker) const { +const su2double* CConfig::GetInlet_Velocity(const string& val_marker) const { unsigned short iMarker_Supersonic_Inlet; for (iMarker_Supersonic_Inlet = 0; iMarker_Supersonic_Inlet < nMarker_Supersonic_Inlet; iMarker_Supersonic_Inlet++) if (Marker_Supersonic_Inlet[iMarker_Supersonic_Inlet] == val_marker) break; return Inlet_Velocity[iMarker_Supersonic_Inlet]; } -const su2double* CConfig::GetInlet_SpeciesVal(string val_marker) const { +const su2double* CConfig::GetInlet_SpeciesVal(const string& val_marker) const { unsigned short iMarker_Inlet_Species; for (iMarker_Inlet_Species = 0; iMarker_Inlet_Species < nMarker_Inlet_Species; iMarker_Inlet_Species++) if (Marker_Inlet_Species[iMarker_Inlet_Species] == val_marker) break; return Inlet_SpeciesVal[iMarker_Inlet_Species]; } -const su2double* CConfig::GetInlet_TurbVal(string val_marker) const { +const su2double* CConfig::GetInlet_TurbVal(const string& val_marker) const { /*--- If Turbulent Inlet is not provided for the marker, return free stream values. ---*/ for (auto iMarker = 0u; iMarker < nMarker_Inlet_Turb; iMarker++) { if (Marker_Inlet_Turb[iMarker] == val_marker) return Inlet_TurbVal[iMarker]; } - return TurbIntensityAndViscRatioFreeStream; + if (Kind_Turb_Model == TURB_MODEL::SST) { + return TurbIntensityAndViscRatioFreeStream; + } + return &NuFactor_FreeStream; } -su2double CConfig::GetOutlet_Pressure(string val_marker) const { +su2double CConfig::GetOutlet_Pressure(const string& val_marker) const { unsigned short iMarker_Outlet; for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) if (Marker_Outlet[iMarker_Outlet] == val_marker) break; return Outlet_Pressure[iMarker_Outlet]; } -void CConfig::SetOutlet_Pressure(su2double val_pressure, string val_marker) { +void CConfig::SetOutlet_Pressure(su2double val_pressure, const string& val_marker) { unsigned short iMarker_Outlet; for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) if (Marker_Outlet[iMarker_Outlet] == val_marker) Outlet_Pressure[iMarker_Outlet] = val_pressure; } -su2double CConfig::GetRiemann_Var1(string val_marker) const { +su2double CConfig::GetRiemann_Var1(const string& val_marker) const { unsigned short iMarker_Riemann; for (iMarker_Riemann = 0; iMarker_Riemann < nMarker_Riemann; iMarker_Riemann++) if (Marker_Riemann[iMarker_Riemann] == val_marker) break; return Riemann_Var1[iMarker_Riemann]; } -su2double CConfig::GetRiemann_Var2(string val_marker) const { +su2double CConfig::GetRiemann_Var2(const string& val_marker) const { unsigned short iMarker_Riemann; for (iMarker_Riemann = 0; iMarker_Riemann < nMarker_Riemann; iMarker_Riemann++) if (Marker_Riemann[iMarker_Riemann] == val_marker) break; return Riemann_Var2[iMarker_Riemann]; } -const su2double* CConfig::GetRiemann_FlowDir(string val_marker) const { +const su2double* CConfig::GetRiemann_FlowDir(const string& val_marker) const { unsigned short iMarker_Riemann; for (iMarker_Riemann = 0; iMarker_Riemann < nMarker_Riemann; iMarker_Riemann++) if (Marker_Riemann[iMarker_Riemann] == val_marker) break; return Riemann_FlowDir[iMarker_Riemann]; } -unsigned short CConfig::GetKind_Data_Riemann(string val_marker) const { +unsigned short CConfig::GetKind_Data_Riemann(const string& val_marker) const { unsigned short iMarker_Riemann; for (iMarker_Riemann = 0; iMarker_Riemann < nMarker_Riemann; iMarker_Riemann++) if (Marker_Riemann[iMarker_Riemann] == val_marker) break; return Kind_Data_Riemann[iMarker_Riemann]; } -su2double CConfig::GetGiles_Var1(string val_marker) const { +su2double CConfig::GetGiles_Var1(const string& val_marker) const { unsigned short iMarker_Giles; for (iMarker_Giles = 0; iMarker_Giles < nMarker_Giles; iMarker_Giles++) if (Marker_Giles[iMarker_Giles] == val_marker) break; return Giles_Var1[iMarker_Giles]; } -void CConfig::SetGiles_Var1(su2double newVar1, string val_marker) { +void CConfig::SetGiles_Var1(su2double newVar1, const string& val_marker) { unsigned short iMarker_Giles; for (iMarker_Giles = 0; iMarker_Giles < nMarker_Giles; iMarker_Giles++) if (Marker_Giles[iMarker_Giles] == val_marker) break; Giles_Var1[iMarker_Giles] = newVar1; } -su2double CConfig::GetGiles_Var2(string val_marker) const { +su2double CConfig::GetGiles_Var2(const string& val_marker) const { unsigned short iMarker_Giles; for (iMarker_Giles = 0; iMarker_Giles < nMarker_Giles; iMarker_Giles++) if (Marker_Giles[iMarker_Giles] == val_marker) break; return Giles_Var2[iMarker_Giles]; } -su2double CConfig::GetGiles_RelaxFactorAverage(string val_marker) const { +su2double CConfig::GetGiles_RelaxFactorAverage(const string& val_marker) const { unsigned short iMarker_Giles; for (iMarker_Giles = 0; iMarker_Giles < nMarker_Giles; iMarker_Giles++) if (Marker_Giles[iMarker_Giles] == val_marker) break; return RelaxFactorAverage[iMarker_Giles]; } -su2double CConfig::GetGiles_RelaxFactorFourier(string val_marker) const { +su2double CConfig::GetGiles_RelaxFactorFourier(const string& val_marker) const { unsigned short iMarker_Giles; for (iMarker_Giles = 0; iMarker_Giles < nMarker_Giles; iMarker_Giles++) if (Marker_Giles[iMarker_Giles] == val_marker) break; return RelaxFactorFourier[iMarker_Giles]; } -const su2double* CConfig::GetGiles_FlowDir(string val_marker) const { +const su2double* CConfig::GetGiles_FlowDir(const string& val_marker) const { unsigned short iMarker_Giles; for (iMarker_Giles = 0; iMarker_Giles < nMarker_Giles; iMarker_Giles++) if (Marker_Giles[iMarker_Giles] == val_marker) break; return Giles_FlowDir[iMarker_Giles]; } -unsigned short CConfig::GetKind_Data_Giles(string val_marker) const { +unsigned short CConfig::GetKind_Data_Giles(const string& val_marker) const { unsigned short iMarker_Giles; for (iMarker_Giles = 0; iMarker_Giles < nMarker_Giles; iMarker_Giles++) if (Marker_Giles[iMarker_Giles] == val_marker) break; @@ -9089,7 +9162,7 @@ void CConfig::SetIncPressureOut_BC(su2double val_pressure) { } -su2double CConfig::GetIsothermal_Temperature(string val_marker) const { +su2double CConfig::GetIsothermal_Temperature(const string& val_marker) const { for (unsigned short iMarker_Isothermal = 0; iMarker_Isothermal < nMarker_Isothermal; iMarker_Isothermal++) if (Marker_Isothermal[iMarker_Isothermal] == val_marker) @@ -9098,7 +9171,7 @@ su2double CConfig::GetIsothermal_Temperature(string val_marker) const { return Isothermal_Temperature[0]; } -su2double CConfig::GetWall_HeatFlux(string val_marker) const { +su2double CConfig::GetWall_HeatFlux(const string& val_marker) const { for (unsigned short iMarker_HeatFlux = 0; iMarker_HeatFlux < nMarker_HeatFlux; iMarker_HeatFlux++) if (Marker_HeatFlux[iMarker_HeatFlux] == val_marker) @@ -9107,7 +9180,7 @@ su2double CConfig::GetWall_HeatFlux(string val_marker) const { return Heat_Flux[0]; } -su2double CConfig::GetWall_HeatTransfer_Coefficient(string val_marker) const { +su2double CConfig::GetWall_HeatTransfer_Coefficient(const string& val_marker) const { for (unsigned short iMarker_HeatTransfer = 0; iMarker_HeatTransfer < nMarker_HeatTransfer; iMarker_HeatTransfer++) if (Marker_HeatTransfer[iMarker_HeatTransfer] == val_marker) @@ -9116,7 +9189,7 @@ su2double CConfig::GetWall_HeatTransfer_Coefficient(string val_marker) const { return HeatTransfer_Coeff[0]; } -su2double CConfig::GetWall_HeatTransfer_Temperature(string val_marker) const { +su2double CConfig::GetWall_HeatTransfer_Temperature(const string& val_marker) const { for (unsigned short iMarker_HeatTransfer = 0; iMarker_HeatTransfer < nMarker_HeatTransfer; iMarker_HeatTransfer++) if (Marker_HeatTransfer[iMarker_HeatTransfer] == val_marker) @@ -9136,7 +9209,7 @@ pair CConfig::GetWallRoughnessProperties(const string& val return make_pair(roughness > 0 ? WALL_TYPE::ROUGH : WALL_TYPE::SMOOTH, roughness); } -WALL_FUNCTIONS CConfig::GetWallFunction_Treatment(string val_marker) const { +WALL_FUNCTIONS CConfig::GetWallFunction_Treatment(const string& val_marker) const { WALL_FUNCTIONS WallFunction = WALL_FUNCTIONS::NONE; @@ -9150,7 +9223,7 @@ WALL_FUNCTIONS CConfig::GetWallFunction_Treatment(string val_marker) const { return WallFunction; } -const unsigned short* CConfig::GetWallFunction_IntInfo(string val_marker) const { +const unsigned short* CConfig::GetWallFunction_IntInfo(const string& val_marker) const { unsigned short *intInfo = nullptr; for(unsigned short iMarker=0; iMarkerGetMultizone_Mesh() != GetMultizone_Mesh()){ SU2_MPI::Error("Option MULTIZONE_MESH must be the same in all zones.", CURRENT_FUNCTION); } - if(config_container[iZone]->GetWnd_Cauchy_Crit() == true){ + if(config_container[iZone]->GetWnd_Cauchy_Crit()){ SU2_MPI::Error("Option WINDOW_CAUCHY_CRIT must be deactivated for multizone problems.", CURRENT_FUNCTION); } } - if(driver_config->GetWnd_Cauchy_Crit() == true){ + if(driver_config->GetWnd_Cauchy_Crit()){ SU2_MPI::Error("Option WINDOW_CAUCHY_CRIT must be deactivated for multizone problems.", CURRENT_FUNCTION); } @@ -10016,7 +10098,6 @@ void CConfig::SetMultizone(const CConfig *driver_config, const CConfig* const* c /*--- Fix the Time Step for all subdomains, for the case of time-dependent problems ---*/ if (driver_config->GetTime_Domain()){ Delta_UnstTime = driver_config->GetTime_Step(); - Delta_DynTime = driver_config->GetTime_Step(); Time_Domain = true; } diff --git a/Common/src/adt/CADTBaseClass.cpp b/Common/src/adt/CADTBaseClass.cpp index 6be2c3f6769..8af4742badf 100644 --- a/Common/src/adt/CADTBaseClass.cpp +++ b/Common/src/adt/CADTBaseClass.cpp @@ -2,7 +2,7 @@ * \file CADTBaseClass.cpp * \brief Base class for storing an ADT in an arbitrary number of dimensions. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -31,32 +31,32 @@ #include -void CADTBaseClass::BuildADT(unsigned short nDim, - unsigned long nPoints, - const su2double *coor) { - +void CADTBaseClass::BuildADT(unsigned short nDim, unsigned long nPoints, const su2double* coor) { /*--- Determine the number of leaves. It can be proved that nLeaves equals nPoints-1 for an optimally balanced tree. Take the exceptional case of nPoints == 1 into account and return if the tree is empty. ---*/ nDimADT = nDim; isEmpty = false; - nLeaves = nPoints -1; - if(nPoints <= 1) ++nLeaves; - if(nLeaves == 0) {isEmpty = true; return;} + nLeaves = nPoints - 1; + if (nPoints <= 1) ++nLeaves; + if (nLeaves == 0) { + isEmpty = true; + return; + } /*--- Allocate the memory for the leaves of the ADT and the minimum and maximum coordinates of the leaves. Note that these coordinates are stored in one vector, rather than that memory is allocated for the individual leaves. ---*/ leaves.resize(nLeaves); - coorMinLeaves.resize(nDim*nLeaves); - coorMaxLeaves.resize(nDim*nLeaves); + coorMinLeaves.resize(nDim * nLeaves); + coorMaxLeaves.resize(nDim * nLeaves); /*--- Define the vectors, which control the subdivision of the leaves. ---*/ - unsigned long nn = (nPoints+1)/2; + unsigned long nn = (nPoints + 1) / 2; vector pointIDs(nPoints), pointIDsNew(nPoints); - vector nPointIDs(nn+1), nPointIDsNew(nn+1); - vector curLeaf(nn), curLeafNew(nn); + vector nPointIDs(nn + 1), nPointIDsNew(nn + 1); + vector curLeaf(nn), curLeafNew(nn); /*--------------------------------------------------------------------------*/ /*--- Building of the actual ADT ---*/ @@ -65,47 +65,45 @@ void CADTBaseClass::BuildADT(unsigned short nDim, /*--- Initialize the arrays pointIDs, nPointIDs and curLeaf such that all points belong to the root leaf. Also set the counters nLeavesToDivide and nLeavesTot. ---*/ - nPointIDs[0] = 0; nPointIDs[1] = nPoints; + nPointIDs[0] = 0; + nPointIDs[1] = nPoints; curLeaf[0] = 0; - for(unsigned long i=0; i distMax) {distMax = dist; splitDir = l;} + if (dist > distMax) { + distMax = dist; + splitDir = l; + } } /* Sort the points of the current leaf in increasing order. The sorting is based on the coordinate in the split direction, for which the functor CADTComparePointClass is used. */ - sort(pointIDs.data() + nPointIDs[i], pointIDs.data() + nPointIDs[i+1], + sort(pointIDs.data() + nPointIDs[i], pointIDs.data() + nPointIDs[i + 1], CADTComparePointClass(coor, splitDir, nDim)); /* Determine the index of the node, which is approximately central in this leave. */ - leaves[mm].centralNodeID = pointIDs[nPointIDs[i] + nn/2]; + leaves[mm].centralNodeID = pointIDs[nPointIDs[i] + nn / 2]; /*--- Determine the situation of the leaf. It is either a terminal leaf or a leaf that must be subdivided. ---*/ - if(nn <= 2) { - + if (nn <= 2) { /* Terminal leaf. Store the ID's of the points as children and indicate that the children are terminal. */ leaves[mm].children[0] = pointIDs[nPointIDs[i]]; - leaves[mm].children[1] = pointIDs[nPointIDs[i+1]-1]; + leaves[mm].children[1] = pointIDs[nPointIDs[i + 1] - 1]; leaves[mm].childrenAreTerminal[0] = true; leaves[mm].childrenAreTerminal[1] = true; - } - else { - + } else { /* The leaf must be divided. Determine the number of points in the left leaf. This number is at least 2. The actual number stored in kk is this number plus an offset. Also initialize the counter nfl, which is used to store the bounding boxes in the arrays for the new round. */ - unsigned long kk = (nn+1)/2 + nPointIDs[i]; + unsigned long kk = (nn + 1) / 2 + nPointIDs[i]; unsigned long nfl = nPointIDsNew[nLeavesToDivideNew]; /* Copy the ID's of the left points into pointIDsNew. Also update the corresponding entry in nPointIDsNew. */ - for(unsigned long k=nPointIDs[i]; k &val_coor, - vector &val_connElem, - vector &val_VTKElem, - vector &val_markerID, - vector &val_elemID, - const bool globalTree) { +const su2double paramUpperBound = 1.0 + tolInsideElem; +CADTElemClass::CADTElemClass(unsigned short val_nDim, vector& val_coor, vector& val_connElem, + vector& val_VTKElem, vector& val_markerID, + vector& val_elemID, const bool globalTree) { /* Copy the dimension of the problem into nDim. */ nDim = val_nDim; @@ -66,8 +61,7 @@ CADTElemClass::CADTElemClass(unsigned short val_nDim, #ifdef HAVE_MPI /* Parallel mode. Check whether a global or a local tree must be built. */ - if( globalTree ) { - + if (globalTree) { /*--- The local grids are gathered on all ranks. For very large cases this could become a serious memory bottleneck and a parallel version may be needed. ---*/ @@ -79,35 +73,32 @@ CADTElemClass::CADTElemClass(unsigned short val_nDim, SU2_MPI::Comm_size(SU2_MPI::GetComm(), &size); vector recvCounts(size), displs(size); - int sizeLocal = (int) val_coor.size(); + int sizeLocal = (int)val_coor.size(); - SU2_MPI::Allgather(&sizeLocal, 1, MPI_INT, recvCounts.data(), 1, - MPI_INT, SU2_MPI::GetComm()); + SU2_MPI::Allgather(&sizeLocal, 1, MPI_INT, recvCounts.data(), 1, MPI_INT, SU2_MPI::GetComm()); displs[0] = 0; - for(int i=1; i& frontLeaves, - vector& frontLeavesNew, - const su2double *coor, - unsigned short &markerID, - unsigned long &elemID, - int &rankID, - su2double *parCoor, - su2double *weightsInterpol) const { - + vector& frontLeavesNew, const su2double* coor, + unsigned short& markerID, unsigned long& elemID, int& rankID, + su2double* parCoor, su2double* weightsInterpol) const { /* Start at the root leaf of the ADT, i.e. initialize frontLeaves such that it only contains the root leaf. Make sure to wipe out any data from a previous search. */ @@ -278,61 +271,54 @@ bool CADTElemClass::DetermineContainingElement_impl(vector& front frontLeaves.push_back(0); /* Infinite loop of the tree traversal. */ - for(;;) { - + for (;;) { /* Initialize the new front, i.e. the front for the next round, to empty. */ frontLeavesNew.clear(); /* Loop over the leaves of the current front. */ - for(unsigned long i=0; i coorBBMax[k]) coorIsInside = false; + for (unsigned short k = 0; k < nDim; ++k) { + if (coor[k] < coorBBMin[k]) coorIsInside = false; + if (coor[k] > coorBBMax[k]) coorIsInside = false; } - if( coorIsInside ) { - + if (coorIsInside) { /* Coordinate is inside the bounding box. Check if it is also inside the corresponding element. If so, set the required information and return true. */ - if( CoorInElement(kk, coor, parCoor, weightsInterpol) ) { + if (CoorInElement(kk, coor, parCoor, weightsInterpol)) { markerID = localMarkers[kk]; - elemID = localElemIDs[kk]; - rankID = ranksOfElems[kk]; + elemID = localElemIDs[kk]; + rankID = ranksOfElems[kk]; return true; } } - } - else { - + } else { /* Child contains a leaf. If the coordinate is inside the leaf store the leaf for the next round. */ - const su2double *coorBBMin = leaves[kk].xMin; - const su2double *coorBBMax = leaves[kk].xMax + nDim; + const su2double* coorBBMin = leaves[kk].xMin; + const su2double* coorBBMax = leaves[kk].xMax + nDim; bool coorIsInside = true; - for(unsigned short k=0; k coorBBMax[k]) coorIsInside = false; + for (unsigned short k = 0; k < nDim; ++k) { + if (coor[k] < coorBBMin[k]) coorIsInside = false; + if (coor[k] > coorBBMax[k]) coorIsInside = false; } - if( coorIsInside ) frontLeavesNew.push_back(kk); + if (coorIsInside) frontLeavesNew.push_back(kk); } } } @@ -342,7 +328,7 @@ bool CADTElemClass::DetermineContainingElement_impl(vector& front is empty the entire tree has been traversed and a break can be made from the infinite loop. ---*/ frontLeaves = frontLeavesNew; - if(frontLeaves.size() == 0) break; + if (frontLeaves.empty()) break; } /* If this point is reached, no element is found that contains the coordinate @@ -352,13 +338,9 @@ bool CADTElemClass::DetermineContainingElement_impl(vector& front void CADTElemClass::DetermineNearestElement_impl(vector& BBoxTargets, vector& frontLeaves, - vector& frontLeavesNew, - const su2double *coor, - su2double &dist, - unsigned short &markerID, - unsigned long &elemID, - int &rankID) const { - + vector& frontLeavesNew, const su2double* coor, + su2double& dist, unsigned short& markerID, unsigned long& elemID, + int& rankID) const { const bool wasActive = AD::BeginPassive(); /*----------------------------------------------------------------------------*/ @@ -367,16 +349,20 @@ void CADTElemClass::DetermineNearestElement_impl(vector& BBoxT /*----------------------------------------------------------------------------*/ unsigned long kk = leaves[0].centralNodeID; - const su2double *coorBBMin = BBoxCoor.data() + nDimADT*kk; - const su2double *coorBBMax = coorBBMin + nDim; + const su2double* coorBBMin = BBoxCoor.data() + nDimADT * kk; + const su2double* coorBBMax = coorBBMin + nDim; unsigned long jj = 0; dist = 0.0; su2double ds; - ds = max(fabs(coor[0]-coorBBMin[0]), fabs(coor[0]-coorBBMax[0])); dist += ds*ds; - ds = max(fabs(coor[1]-coorBBMin[1]), fabs(coor[1]-coorBBMax[1])); dist += ds*ds; - if(nDim==3) { - ds = max(fabs(coor[2]-coorBBMin[2]), fabs(coor[2]-coorBBMax[2])); dist += ds*ds;} + ds = max(fabs(coor[0] - coorBBMin[0]), fabs(coor[0] - coorBBMax[0])); + dist += ds * ds; + ds = max(fabs(coor[1] - coorBBMin[1]), fabs(coor[1] - coorBBMax[1])); + dist += ds * ds; + if (nDim == 3) { + ds = max(fabs(coor[2] - coorBBMin[2]), fabs(coor[2] - coorBBMax[2])); + dist += ds * ds; + } /*----------------------------------------------------------------------------*/ /*--- Step 2: Traverse the tree and store the bounding boxes for which the ---*/ @@ -393,83 +379,92 @@ void CADTElemClass::DetermineNearestElement_impl(vector& BBoxT frontLeaves.push_back(0); /* Infinite loop of the tree traversal. */ - for(;;) { - + for (;;) { /* Initialize the new front, i.e. the front for the next round, to empty. */ frontLeavesNew.clear(); /* Loop over the leaves of the current front. */ - for(unsigned long i=0; i& BBoxT is empty the entire tree has been traversed and a break can be made from the infinite loop. ---*/ frontLeaves = frontLeavesNew; - if(frontLeaves.size() == 0) break; + if (frontLeaves.empty()) break; } /*----------------------------------------------------------------------------*/ @@ -496,14 +491,13 @@ void CADTElemClass::DetermineNearestElement_impl(vector& BBoxT sort(BBoxTargets.begin(), BBoxTargets.end()); /* Loop over the candidate bounding boxes. */ - for(unsigned long i=0; i dist) break; + if (BBoxTargets[i].possibleMinDist2 > dist) break; /*--- Compute the distance squared to the element that corresponds to the current bounding box. If this distance is less than or equal to @@ -513,12 +507,12 @@ void CADTElemClass::DetermineNearestElement_impl(vector& BBoxT su2double dist2Elem; Dist2ToElement(ii, coor, dist2Elem); - if(dist2Elem <= dist) { - jj = ii; - dist = dist2Elem; + if (dist2Elem <= dist) { + jj = ii; + dist = dist2Elem; markerID = localMarkers[ii]; - elemID = localElemIDs[ii]; - rankID = ranksOfElems[ii]; + elemID = localElemIDs[ii]; + rankID = ranksOfElems[ii]; } } @@ -530,20 +524,22 @@ void CADTElemClass::DetermineNearestElement_impl(vector& BBoxT dist = sqrt(dist); } -bool CADTElemClass::CoorInElement(const unsigned long elemID, - const su2double *coor, - su2double *parCoor, - su2double *weightsInterpol) const { - +bool CADTElemClass::CoorInElement(const unsigned long elemID, const su2double* coor, su2double* parCoor, + su2double* weightsInterpol) const { /*--- Make a distinction between the element types. ---*/ - switch( elemVTK_Type[elemID] ) { - - case TRIANGLE: return CoorInTriangle(elemID, coor, parCoor, weightsInterpol); - case QUADRILATERAL: return CoorInQuadrilateral(elemID, coor, parCoor, weightsInterpol); - case TETRAHEDRON: return CoorInTetrahedron(elemID, coor, parCoor, weightsInterpol); - case PYRAMID: return CoorInPyramid(elemID, coor, parCoor, weightsInterpol); - case PRISM: return CoorInPrism(elemID, coor, parCoor, weightsInterpol); - case HEXAHEDRON: return CoorInHexahedron(elemID, coor, parCoor, weightsInterpol); + switch (elemVTK_Type[elemID]) { + case TRIANGLE: + return CoorInTriangle(elemID, coor, parCoor, weightsInterpol); + case QUADRILATERAL: + return CoorInQuadrilateral(elemID, coor, parCoor, weightsInterpol); + case TETRAHEDRON: + return CoorInTetrahedron(elemID, coor, parCoor, weightsInterpol); + case PYRAMID: + return CoorInPyramid(elemID, coor, parCoor, weightsInterpol); + case PRISM: + return CoorInPrism(elemID, coor, parCoor, weightsInterpol); + case HEXAHEDRON: + return CoorInHexahedron(elemID, coor, parCoor, weightsInterpol); default: /* This should not happen. */ @@ -552,21 +548,17 @@ bool CADTElemClass::CoorInElement(const unsigned long elemID, } } -void CADTElemClass::Dist2ToElement(const unsigned long elemID, - const su2double *coor, - su2double &dist2Elem) const { - +void CADTElemClass::Dist2ToElement(const unsigned long elemID, const su2double* coor, su2double& dist2Elem) const { /*--- Make a distinction between the element types. ---*/ - switch( elemVTK_Type[elemID] ) { - + switch (elemVTK_Type[elemID]) { case LINE: { - /*--- Element is a line. The number of space dimensions can be either 1, 2 or 3. Store the indices where the coordinates of the vertices are stored in i0 and i1. ---*/ unsigned long i0 = nDOFsPerElem[elemID]; unsigned long i1 = i0 + 1; - i0 = nDim*elemConns[i0]; i1 = nDim*elemConns[i1]; + i0 = nDim * elemConns[i0]; + i1 = nDim * elemConns[i1]; /*--- Call the function Dist2ToLine to do the actual work. ---*/ Dist2ToLine(i0, i1, coor, dist2Elem); @@ -574,16 +566,17 @@ void CADTElemClass::Dist2ToElement(const unsigned long elemID, break; } - /*------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ case TRIANGLE: { - /*--- Element is a triangle. The number of space dimensions can be either 2 or 3. Store the indices where the coordinates of the vertices are stored in i0, i1 and i2. ---*/ unsigned long i0 = nDOFsPerElem[elemID]; unsigned long i1 = i0 + 1, i2 = i0 + 2; - i0 = nDim*elemConns[i0]; i1 = nDim*elemConns[i1]; i2 = nDim*elemConns[i2]; + i0 = nDim * elemConns[i0]; + i1 = nDim * elemConns[i1]; + i2 = nDim * elemConns[i2]; /*--- Call the function Dist2ToTriangle to compute the distance to the triangle if the projection is inside the triangle. In that case the @@ -591,28 +584,31 @@ void CADTElemClass::Dist2ToElement(const unsigned long elemID, false is returned and the distance to each of the lines of the triangle is computed and the minimum is taken. ---*/ su2double r, s; - if( !Dist2ToTriangle(i0, i1, i2, coor, dist2Elem, r, s) ) { + if (!Dist2ToTriangle(i0, i1, i2, coor, dist2Elem, r, s)) { Dist2ToLine(i0, i1, coor, dist2Elem); su2double dist2Line; - Dist2ToLine(i1, i2, coor, dist2Line); dist2Elem = min(dist2Elem, dist2Line); - Dist2ToLine(i2, i0, coor, dist2Line); dist2Elem = min(dist2Elem, dist2Line); + Dist2ToLine(i1, i2, coor, dist2Line); + dist2Elem = min(dist2Elem, dist2Line); + Dist2ToLine(i2, i0, coor, dist2Line); + dist2Elem = min(dist2Elem, dist2Line); } break; } - /*------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ case QUADRILATERAL: { - /*--- Element is a quadrilateral. The number of space dimensions can be either 2 or 3. Store the indices where the coordinates of the vertices are stored in i0, i1, i2 and i3. ---*/ unsigned long i0 = nDOFsPerElem[elemID]; unsigned long i1 = i0 + 1, i2 = i0 + 2, i3 = i0 + 3; - i0 = nDim*elemConns[i0]; i1 = nDim*elemConns[i1]; - i2 = nDim*elemConns[i2]; i3 = nDim*elemConns[i3]; + i0 = nDim * elemConns[i0]; + i1 = nDim * elemConns[i1]; + i2 = nDim * elemConns[i2]; + i3 = nDim * elemConns[i3]; /*--- Call the function Dist2ToQuadrilateral to compute the distance to the quadrilateral if the projection is inside the quadrilateral. In that @@ -620,19 +616,22 @@ void CADTElemClass::Dist2ToElement(const unsigned long elemID, quadrilateral, false is returned and the distance to each of the lines of the quadrilateral is computed and the minimum is taken. ---*/ su2double r, s; - if( !Dist2ToQuadrilateral(i0, i1, i2, i3, coor, r, s, dist2Elem) ) { + if (!Dist2ToQuadrilateral(i0, i1, i2, i3, coor, r, s, dist2Elem)) { Dist2ToLine(i0, i1, coor, dist2Elem); su2double dist2Line; - Dist2ToLine(i1, i2, coor, dist2Line); dist2Elem = min(dist2Elem, dist2Line); - Dist2ToLine(i2, i3, coor, dist2Line); dist2Elem = min(dist2Elem, dist2Line); - Dist2ToLine(i3, i0, coor, dist2Line); dist2Elem = min(dist2Elem, dist2Line); + Dist2ToLine(i1, i2, coor, dist2Line); + dist2Elem = min(dist2Elem, dist2Line); + Dist2ToLine(i2, i3, coor, dist2Line); + dist2Elem = min(dist2Elem, dist2Line); + Dist2ToLine(i3, i0, coor, dist2Line); + dist2Elem = min(dist2Elem, dist2Line); } break; } - /*------------------------------------------------------------------------*/ + /*------------------------------------------------------------------------*/ case TETRAHEDRON: case PYRAMID: @@ -643,83 +642,81 @@ void CADTElemClass::Dist2ToElement(const unsigned long elemID, } } -bool CADTElemClass::CoorInTriangle(const unsigned long elemID, - const su2double *coor, - su2double *parCoor, - su2double *weightsInterpol) const { - +bool CADTElemClass::CoorInTriangle(const unsigned long elemID, const su2double* coor, su2double* parCoor, + su2double* weightsInterpol) const { /* Determine the indices of the three vertices of the triangle, multiplied by nDim (which is 2). This gives the position in the coordinate array where the coordinates of these points are stored. */ unsigned long i0 = nDOFsPerElem[elemID]; unsigned long i1 = i0 + 1, i2 = i0 + 2; - i0 = nDim*elemConns[i0]; i1 = nDim*elemConns[i1]; i2 = nDim*elemConns[i2]; + i0 = nDim * elemConns[i0]; + i1 = nDim * elemConns[i1]; + i2 = nDim * elemConns[i2]; /* Determine the coordinates relative to the vertex 0. */ const su2double xc = coor[0] - coorPoints[i0]; - const su2double yc = coor[1] - coorPoints[i0+1]; + const su2double yc = coor[1] - coorPoints[i0 + 1]; - const su2double x1 = coorPoints[i1] - coorPoints[i0]; - const su2double y1 = coorPoints[i1+1] - coorPoints[i0+1]; + const su2double x1 = coorPoints[i1] - coorPoints[i0]; + const su2double y1 = coorPoints[i1 + 1] - coorPoints[i0 + 1]; - const su2double x2 = coorPoints[i2] - coorPoints[i0]; - const su2double y2 = coorPoints[i2+1] - coorPoints[i0+1]; + const su2double x2 = coorPoints[i2] - coorPoints[i0]; + const su2double y2 = coorPoints[i2 + 1] - coorPoints[i0 + 1]; /* The triangle is parametrized by X-X0 = (r+1)*(X1-X0)/2 + (s+1)*(X2-X0)/2, r, s >= -1, r+s <= 0. As this is a containment search, the number of dimesions is 2. As a consequence, the parametric coordinates r and s can be solved easily. Note that X0 is 0 in the above expression, because the coordinates are relative to node 0. */ - const su2double detInv = 2.0/(x1*y2 - x2*y1); - parCoor[0] = detInv*(xc*y2 - yc*x2) - 1.0; - parCoor[1] = detInv*(yc*x1 - xc*y1) - 1.0; + const su2double detInv = 2.0 / (x1 * y2 - x2 * y1); + parCoor[0] = detInv * (xc * y2 - yc * x2) - 1.0; + parCoor[1] = detInv * (yc * x1 - xc * y1) - 1.0; /* Check if the point resides within the triangle and compute the interpolation weights if it is. */ bool coorIsInside = false; - if((parCoor[0] >= paramLowerBound) && (parCoor[1] >= paramLowerBound) && - ((parCoor[0]+parCoor[1]) <= tolInsideElem)) { + if ((parCoor[0] >= paramLowerBound) && (parCoor[1] >= paramLowerBound) && + ((parCoor[0] + parCoor[1]) <= tolInsideElem)) { coorIsInside = true; - weightsInterpol[0] = -0.5*(parCoor[0] + parCoor[1]); - weightsInterpol[1] = 0.5*(parCoor[0] + 1.0); - weightsInterpol[2] = 0.5*(parCoor[1] + 1.0); + weightsInterpol[0] = -0.5 * (parCoor[0] + parCoor[1]); + weightsInterpol[1] = 0.5 * (parCoor[0] + 1.0); + weightsInterpol[2] = 0.5 * (parCoor[1] + 1.0); } /* Return the value of coorIsInside. */ return coorIsInside; } -bool CADTElemClass::CoorInQuadrilateral(const unsigned long elemID, - const su2double *coor, - su2double *parCoor, - su2double *weightsInterpol) const { - +bool CADTElemClass::CoorInQuadrilateral(const unsigned long elemID, const su2double* coor, su2double* parCoor, + su2double* weightsInterpol) const { /* Definition of the maximum number of iterations in the Newton solver and the tolerance level. */ const unsigned short maxIt = 50; - const su2double tolNewton = 1.e-10; + const su2double tolNewton = 1.e-10; /* Determine the indices of the four vertices of the quadrilatral, multiplied by nDim (which is 2). This gives the position in the coordinate array where the coordinates of these points are stored. */ unsigned long i0 = nDOFsPerElem[elemID]; - unsigned long i1 = i0 + 1, i2 = i0 + 2, i3 = i0+3; - i0 = nDim*elemConns[i0]; i1 = nDim*elemConns[i1]; - i2 = nDim*elemConns[i2]; i3 = nDim*elemConns[i3]; + unsigned long i1 = i0 + 1, i2 = i0 + 2, i3 = i0 + 3; + i0 = nDim * elemConns[i0]; + i1 = nDim * elemConns[i1]; + i2 = nDim * elemConns[i2]; + i3 = nDim * elemConns[i3]; /* Determine the coordinates relative to the vertex 0. */ const su2double xc = coor[0] - coorPoints[i0]; - const su2double yc = coor[1] - coorPoints[i0+1]; + const su2double yc = coor[1] - coorPoints[i0 + 1]; - const su2double x1 = coorPoints[i1] - coorPoints[i0]; - const su2double y1 = coorPoints[i1+1] - coorPoints[i0+1]; + const su2double x1 = coorPoints[i1] - coorPoints[i0]; + const su2double y1 = coorPoints[i1 + 1] - coorPoints[i0 + 1]; - const su2double x2 = coorPoints[i2] - coorPoints[i0]; - const su2double y2 = coorPoints[i2+1] - coorPoints[i0+1]; + const su2double x2 = coorPoints[i2] - coorPoints[i0]; + const su2double y2 = coorPoints[i2 + 1] - coorPoints[i0 + 1]; - const su2double x3 = coorPoints[i3] - coorPoints[i0]; - const su2double y3 = coorPoints[i3+1] - coorPoints[i0+1]; + const su2double x3 = coorPoints[i3] - coorPoints[i0]; + const su2double y3 = coorPoints[i3 + 1] - coorPoints[i0 + 1]; /* The parametrization of the quadrilatral is nonlinear, which requires an iterative algorithm. Especially for highly skewed quadrilaterals, this @@ -727,29 +724,30 @@ bool CADTElemClass::CoorInQuadrilateral(const unsigned long elemID, linear triangles to check if the point is actually within the quad. First check the triangle i0-i1-i3. See CoorInTriangle for more details on this test. */ - su2double detInv = 2.0/(x1*y3 - x3*y1); - parCoor[0] = detInv*(xc*y3 - yc*x3) - 1.0; - parCoor[1] = detInv*(yc*x1 - xc*y1) - 1.0; + su2double detInv = 2.0 / (x1 * y3 - x3 * y1); + parCoor[0] = detInv * (xc * y3 - yc * x3) - 1.0; + parCoor[1] = detInv * (yc * x1 - xc * y1) - 1.0; bool coorIsInside = false; - if((parCoor[0] >= paramLowerBound) && (parCoor[1] >= paramLowerBound) && - ((parCoor[0]+parCoor[1]) <= tolInsideElem)) coorIsInside = true; + if ((parCoor[0] >= paramLowerBound) && (parCoor[1] >= paramLowerBound) && + ((parCoor[0] + parCoor[1]) <= tolInsideElem)) + coorIsInside = true; /* Check triangle i2-i3-i1 if the coordinate is not inside i0-i1-i3. */ - if( !coorIsInside ) { - + if (!coorIsInside) { /* Define the coordinates w.r.t. vertex 2 using the numbering i2-i3-i1. */ const su2double xxc = xc - x2, yyc = yc - y2; const su2double xx1 = x3 - x2, yy1 = y3 - y2; const su2double xx3 = x1 - x2, yy3 = y1 - y2; /* Check if the coordinate is inside this triangle. */ - detInv = 2.0/(xx1*yy3 - xx3*yy1); - parCoor[0] = detInv*(xxc*yy3 - yyc*xx3) - 1.0; - parCoor[1] = detInv*(yyc*xx1 - xxc*yy1) - 1.0; + detInv = 2.0 / (xx1 * yy3 - xx3 * yy1); + parCoor[0] = detInv * (xxc * yy3 - yyc * xx3) - 1.0; + parCoor[1] = detInv * (yyc * xx1 - xxc * yy1) - 1.0; - if((parCoor[0] >= paramLowerBound) && (parCoor[1] >= paramLowerBound) && - ((parCoor[0]+parCoor[1]) <= tolInsideElem)) coorIsInside = true; + if ((parCoor[0] >= paramLowerBound) && (parCoor[1] >= paramLowerBound) && + ((parCoor[0] + parCoor[1]) <= tolInsideElem)) + coorIsInside = true; /* Convert the parametric coordinates to the ones used by the quadrilatral i0-i1-i2-i3. They serve as initial guess below. */ @@ -758,7 +756,7 @@ bool CADTElemClass::CoorInQuadrilateral(const unsigned long elemID, } /* If the coordinate is in neither triangle, return false. */ - if( !coorIsInside ) return false; + if (!coorIsInside) return false; /* The coordinate is inside the quadrilatral and an initial guess has been obtained by splitting the quad into two triangles. Carry out a Newton @@ -770,27 +768,26 @@ bool CADTElemClass::CoorInQuadrilateral(const unsigned long elemID, V0 - r*V1 - s*V2 - r*s*V3 = 0, where V0 = xc - (x1+x2+x3)/4, V1 = (x1+x2-x3)/4, V2 = (x2+x3-X1)/4, V3 = (x2-x1-x3)/4. First construct the vectors V0, V1, V2 and V3. */ - const su2double V0x = xc - 0.25*(x1+x2+x3), V0y = yc - 0.25*(y1+y2+y3); - const su2double V1x = 0.25*(x1+x2-x3), V1y = 0.25*(y1+y2-y3); - const su2double V2x = 0.25*(x2+x3-x1), V2y = 0.25*(y2+y3-y1); - const su2double V3x = 0.25*(x2-x1-x3), V3y = 0.25*(y2-y1-y3); + const su2double V0x = xc - 0.25 * (x1 + x2 + x3), V0y = yc - 0.25 * (y1 + y2 + y3); + const su2double V1x = 0.25 * (x1 + x2 - x3), V1y = 0.25 * (y1 + y2 - y3); + const su2double V2x = 0.25 * (x2 + x3 - x1), V2y = 0.25 * (y2 + y3 - y1); + const su2double V3x = 0.25 * (x2 - x1 - x3), V3y = 0.25 * (y2 - y1 - y3); /* Loop over the maximum number of iterations. */ unsigned short itCount; - for(itCount=0; itCount paramUpperBound || - parCoor[1] < paramLowerBound || parCoor[1] > paramUpperBound) + if (parCoor[0] < paramLowerBound || parCoor[0] > paramUpperBound || parCoor[1] < paramLowerBound || + parCoor[1] > paramUpperBound) SU2_MPI::Error("Point not inside the quadrilateral.", CURRENT_FUNCTION); /* Compute the interpolation weights. */ - const su2double omr = 0.5*(1.0-parCoor[0]), opr = 0.5*(1.0+parCoor[0]); - const su2double oms = 0.5*(1.0-parCoor[1]), ops = 0.5*(1.0+parCoor[1]); + const su2double omr = 0.5 * (1.0 - parCoor[0]), opr = 0.5 * (1.0 + parCoor[0]); + const su2double oms = 0.5 * (1.0 - parCoor[1]), ops = 0.5 * (1.0 + parCoor[1]); - weightsInterpol[0] = omr*oms; - weightsInterpol[1] = opr*oms; - weightsInterpol[2] = opr*ops; - weightsInterpol[3] = omr*ops; + weightsInterpol[0] = omr * oms; + weightsInterpol[1] = opr * oms; + weightsInterpol[2] = opr * ops; + weightsInterpol[3] = omr * ops; /* Return true, because the search was successful. */ return true; } -bool CADTElemClass::CoorInTetrahedron(const unsigned long elemID, - const su2double *coor, - su2double *parCoor, - su2double *weightsInterpol) const { - +bool CADTElemClass::CoorInTetrahedron(const unsigned long elemID, const su2double* coor, su2double* parCoor, + su2double* weightsInterpol) const { /* Determine the indices of the four vertices of the tetrahedron, multiplied by nDim (which is 3). This gives the position in the coordinate array where the coordinates of these points are stored. */ unsigned long i0 = nDOFsPerElem[elemID]; - unsigned long i1 = i0 + 1, i2 = i0 + 2, i3 = i0+3; - i0 = nDim*elemConns[i0]; i1 = nDim*elemConns[i1]; - i2 = nDim*elemConns[i2]; i3 = nDim*elemConns[i3]; + unsigned long i1 = i0 + 1, i2 = i0 + 2, i3 = i0 + 3; + i0 = nDim * elemConns[i0]; + i1 = nDim * elemConns[i1]; + i2 = nDim * elemConns[i2]; + i3 = nDim * elemConns[i3]; /* Determine the coordinates relative to the vertex 0. */ const su2double xc = coor[0] - coorPoints[i0]; - const su2double yc = coor[1] - coorPoints[i0+1]; - const su2double zc = coor[2] - coorPoints[i0+2]; + const su2double yc = coor[1] - coorPoints[i0 + 1]; + const su2double zc = coor[2] - coorPoints[i0 + 2]; - const su2double x1 = coorPoints[i1] - coorPoints[i0]; - const su2double y1 = coorPoints[i1+1] - coorPoints[i0+1]; - const su2double z1 = coorPoints[i1+2] - coorPoints[i0+2]; + const su2double x1 = coorPoints[i1] - coorPoints[i0]; + const su2double y1 = coorPoints[i1 + 1] - coorPoints[i0 + 1]; + const su2double z1 = coorPoints[i1 + 2] - coorPoints[i0 + 2]; - const su2double x2 = coorPoints[i2] - coorPoints[i0]; - const su2double y2 = coorPoints[i2+1] - coorPoints[i0+1]; - const su2double z2 = coorPoints[i2+2] - coorPoints[i0+2]; + const su2double x2 = coorPoints[i2] - coorPoints[i0]; + const su2double y2 = coorPoints[i2 + 1] - coorPoints[i0 + 1]; + const su2double z2 = coorPoints[i2 + 2] - coorPoints[i0 + 2]; - const su2double x3 = coorPoints[i3] - coorPoints[i0]; - const su2double y3 = coorPoints[i3+1] - coorPoints[i0+1]; - const su2double z3 = coorPoints[i3+2] - coorPoints[i0+2]; + const su2double x3 = coorPoints[i3] - coorPoints[i0]; + const su2double y3 = coorPoints[i3 + 1] - coorPoints[i0 + 1]; + const su2double z3 = coorPoints[i3 + 2] - coorPoints[i0 + 2]; /* The tetrahedron is parametrized by X-X0 = (r+1)*(X1-X0)/2 + (s+1)*(X2-X0)/2 + (t+1)*(X3-X0)/2, r, s, t >= -1, r+s+t <= -1. As a consequence, the parametric coordinates r, s and t can be solved easily. Note that X0 is 0 in the above expression, because the coordinates are relative to node 0. */ - const su2double detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - parCoor[0] = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - parCoor[1] = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - parCoor[2] = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + const su2double detInv = + 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + parCoor[0] = detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + parCoor[1] = + -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + parCoor[2] = detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* Check if the point resides within the tetrahedron and compute the interpolation weights if it is. */ bool coorIsInside = false; - if((parCoor[0] >= paramLowerBound) && (parCoor[1] >= paramLowerBound) && - (parCoor[2] >= paramLowerBound) && - ((parCoor[0]+parCoor[1]+parCoor[2]) <= paramLowerBound)) { + if ((parCoor[0] >= paramLowerBound) && (parCoor[1] >= paramLowerBound) && (parCoor[2] >= paramLowerBound) && + ((parCoor[0] + parCoor[1] + parCoor[2]) <= paramLowerBound)) { coorIsInside = true; - weightsInterpol[0] = -0.5*(parCoor[0] + parCoor[1] + parCoor[2] + 1.0); - weightsInterpol[1] = 0.5*(parCoor[0] + 1.0); - weightsInterpol[2] = 0.5*(parCoor[1] + 1.0); - weightsInterpol[3] = 0.5*(parCoor[2] + 1.0); + weightsInterpol[0] = -0.5 * (parCoor[0] + parCoor[1] + parCoor[2] + 1.0); + weightsInterpol[1] = 0.5 * (parCoor[0] + 1.0); + weightsInterpol[2] = 0.5 * (parCoor[1] + 1.0); + weightsInterpol[3] = 0.5 * (parCoor[2] + 1.0); } /* Return the value of coorIsInside. */ return coorIsInside; } -bool CADTElemClass::CoorInPyramid(const unsigned long elemID, - const su2double *coor, - su2double *parCoor, - su2double *weightsInterpol) const { - +bool CADTElemClass::CoorInPyramid(const unsigned long elemID, const su2double* coor, su2double* parCoor, + su2double* weightsInterpol) const { /* Definition of the maximum number of iterations in the Newton solver and the tolerance level. */ const unsigned short maxIt = 50; - const su2double tolNewton = 1.e-10; + const su2double tolNewton = 1.e-10; /* Determine the indices of the five vertices of the pyramid, multiplied by nDim (which is 3). This gives the position in the coordinate array where the coordinates of these points are stored. */ unsigned long i0 = nDOFsPerElem[elemID]; - unsigned long i1 = i0 + 1, i2 = i0 + 2, i3 = i0+3, i4 = i0+4; - i0 = nDim*elemConns[i0]; i1 = nDim*elemConns[i1]; - i2 = nDim*elemConns[i2]; i3 = nDim*elemConns[i3]; - i4 = nDim*elemConns[i4]; + unsigned long i1 = i0 + 1, i2 = i0 + 2, i3 = i0 + 3, i4 = i0 + 4; + i0 = nDim * elemConns[i0]; + i1 = nDim * elemConns[i1]; + i2 = nDim * elemConns[i2]; + i3 = nDim * elemConns[i3]; + i4 = nDim * elemConns[i4]; /* Determine the coordinates relative to the vertex 0. */ su2double xRel[5][3], xc[3]; xc[0] = coor[0] - coorPoints[i0]; - xc[1] = coor[1] - coorPoints[i0+1]; - xc[2] = coor[2] - coorPoints[i0+2]; + xc[1] = coor[1] - coorPoints[i0 + 1]; + xc[2] = coor[2] - coorPoints[i0 + 2]; xRel[0][0] = xRel[0][1] = xRel[0][2] = 0.0; - xRel[1][0] = coorPoints[i1] - coorPoints[i0]; - xRel[1][1] = coorPoints[i1+1] - coorPoints[i0+1]; - xRel[1][2] = coorPoints[i1+2] - coorPoints[i0+2]; + xRel[1][0] = coorPoints[i1] - coorPoints[i0]; + xRel[1][1] = coorPoints[i1 + 1] - coorPoints[i0 + 1]; + xRel[1][2] = coorPoints[i1 + 2] - coorPoints[i0 + 2]; - xRel[2][0] = coorPoints[i2] - coorPoints[i0]; - xRel[2][1] = coorPoints[i2+1] - coorPoints[i0+1]; - xRel[2][2] = coorPoints[i2+2] - coorPoints[i0+2]; + xRel[2][0] = coorPoints[i2] - coorPoints[i0]; + xRel[2][1] = coorPoints[i2 + 1] - coorPoints[i0 + 1]; + xRel[2][2] = coorPoints[i2 + 2] - coorPoints[i0 + 2]; - xRel[3][0] = coorPoints[i3] - coorPoints[i0]; - xRel[3][1] = coorPoints[i3+1] - coorPoints[i0+1]; - xRel[3][2] = coorPoints[i3+2] - coorPoints[i0+2]; + xRel[3][0] = coorPoints[i3] - coorPoints[i0]; + xRel[3][1] = coorPoints[i3 + 1] - coorPoints[i0 + 1]; + xRel[3][2] = coorPoints[i3 + 2] - coorPoints[i0 + 2]; - xRel[4][0] = coorPoints[i4] - coorPoints[i0]; - xRel[4][1] = coorPoints[i4+1] - coorPoints[i0+1]; - xRel[4][2] = coorPoints[i4+2] - coorPoints[i0+2]; + xRel[4][0] = coorPoints[i4] - coorPoints[i0]; + xRel[4][1] = coorPoints[i4 + 1] - coorPoints[i0 + 1]; + xRel[4][2] = coorPoints[i4 + 2] - coorPoints[i0 + 2]; /* Obtain an initial guess of the parametric coordinates by splitting the pyramid into tetrahedra. If this approach is not successful, this means that the point is not inside the true pyramid and false can be returned. */ - if( !InitialGuessContainmentPyramid(xc, xRel, parCoor) ) return false; + if (!InitialGuessContainmentPyramid(xc, xRel, parCoor)) return false; /* The pyramid is parametrized by X-X0 = (Xi-X0)*li, where the sum runs over i = 0..4, although i = 0 does not give a contribution. The Lagrangian @@ -943,67 +938,68 @@ bool CADTElemClass::CoorInPyramid(const unsigned long elemID, V0 - V1*r - V2*s - V3*t - V4*r*s/(1-t) = 0, where V0 = xc - (4*x4+x1+x2+x3)/8, V1 = (x1+x2-x3)/4, V2 = (x2+x3-X1)/4, V3 = (4*X4-x1-x2-x3)/8, V4 = (x2-x1-x3)/2. First construct these vectors. */ - const su2double V0x = xc[0] - 0.5*xRel[4][0] - 0.125*(xRel[1][0]+xRel[2][0]+xRel[3][0]); - const su2double V0y = xc[1] - 0.5*xRel[4][1] - 0.125*(xRel[1][1]+xRel[2][1]+xRel[3][1]); - const su2double V0z = xc[2] - 0.5*xRel[4][2] - 0.125*(xRel[1][2]+xRel[2][2]+xRel[3][2]); + const su2double V0x = xc[0] - 0.5 * xRel[4][0] - 0.125 * (xRel[1][0] + xRel[2][0] + xRel[3][0]); + const su2double V0y = xc[1] - 0.5 * xRel[4][1] - 0.125 * (xRel[1][1] + xRel[2][1] + xRel[3][1]); + const su2double V0z = xc[2] - 0.5 * xRel[4][2] - 0.125 * (xRel[1][2] + xRel[2][2] + xRel[3][2]); - const su2double V1x = 0.25*(xRel[1][0]+xRel[2][0]-xRel[3][0]); - const su2double V1y = 0.25*(xRel[1][1]+xRel[2][1]-xRel[3][1]); - const su2double V1z = 0.25*(xRel[1][2]+xRel[2][2]-xRel[3][2]); + const su2double V1x = 0.25 * (xRel[1][0] + xRel[2][0] - xRel[3][0]); + const su2double V1y = 0.25 * (xRel[1][1] + xRel[2][1] - xRel[3][1]); + const su2double V1z = 0.25 * (xRel[1][2] + xRel[2][2] - xRel[3][2]); - const su2double V2x = 0.25*(xRel[2][0]+xRel[3][0]-xRel[1][0]); - const su2double V2y = 0.25*(xRel[2][1]+xRel[3][1]-xRel[1][1]); - const su2double V2z = 0.25*(xRel[2][2]+xRel[3][2]-xRel[1][2]); + const su2double V2x = 0.25 * (xRel[2][0] + xRel[3][0] - xRel[1][0]); + const su2double V2y = 0.25 * (xRel[2][1] + xRel[3][1] - xRel[1][1]); + const su2double V2z = 0.25 * (xRel[2][2] + xRel[3][2] - xRel[1][2]); - const su2double V3x = 0.5*xRel[4][0] - 0.125*(xRel[1][0]+xRel[2][0]+xRel[3][0]); - const su2double V3y = 0.5*xRel[4][1] - 0.125*(xRel[1][1]+xRel[2][1]+xRel[3][1]); - const su2double V3z = 0.5*xRel[4][2] - 0.125*(xRel[1][2]+xRel[2][2]+xRel[3][2]); + const su2double V3x = 0.5 * xRel[4][0] - 0.125 * (xRel[1][0] + xRel[2][0] + xRel[3][0]); + const su2double V3y = 0.5 * xRel[4][1] - 0.125 * (xRel[1][1] + xRel[2][1] + xRel[3][1]); + const su2double V3z = 0.5 * xRel[4][2] - 0.125 * (xRel[1][2] + xRel[2][2] + xRel[3][2]); - const su2double V4x = 0.5*(xRel[2][0]-xRel[1][0]-xRel[3][0]); - const su2double V4y = 0.5*(xRel[2][1]-xRel[1][1]-xRel[3][1]); - const su2double V4z = 0.5*(xRel[2][2]-xRel[1][2]-xRel[3][2]); + const su2double V4x = 0.5 * (xRel[2][0] - xRel[1][0] - xRel[3][0]); + const su2double V4y = 0.5 * (xRel[2][1] - xRel[1][1] - xRel[3][1]); + const su2double V4z = 0.5 * (xRel[2][2] - xRel[1][2] - xRel[3][2]); /* Loop over the maximum number of iterations. */ unsigned short itCount; - for(itCount=0; itCount= paramLowerBound) && (parCoor[2] <= paramUpperBound)) { - const su2double lowRSBound = 0.5*(parCoor[2]-1.0) - tolInsideElem; + if ((parCoor[2] >= paramLowerBound) && (parCoor[2] <= paramUpperBound)) { + const su2double lowRSBound = 0.5 * (parCoor[2] - 1.0) - tolInsideElem; const su2double uppRSBound = -lowRSBound; - if((parCoor[0] >= lowRSBound) && (parCoor[0] <= uppRSBound) && - (parCoor[1] >= lowRSBound) && (parCoor[1] <= uppRSBound)) { + if ((parCoor[0] >= lowRSBound) && (parCoor[0] <= uppRSBound) && (parCoor[1] >= lowRSBound) && + (parCoor[1] <= uppRSBound)) { coorIsInside = true; su2double oneMinT = 1.0 - parCoor[2]; - if(fabs(oneMinT) < 1.e-10) { - if(oneMinT < 0.0) oneMinT = -1.e-10; - else oneMinT = 1.e-10; + if (fabs(oneMinT) < 1.e-10) { + if (oneMinT < 0.0) + oneMinT = -1.e-10; + else + oneMinT = 1.e-10; } - const su2double oneMinTInv = 1.0/oneMinT; - - const su2double omr = (1.0-parCoor[2]-2.0*parCoor[0]); - const su2double opr = (1.0-parCoor[2]+2.0*parCoor[0]); - const su2double oms = (1.0-parCoor[2]-2.0*parCoor[1]); - const su2double ops = (1.0-parCoor[2]+2.0*parCoor[1]); - - weightsInterpol[0] = 0.125*oneMinTInv*omr*oms; - weightsInterpol[1] = 0.125*oneMinTInv*opr*oms; - weightsInterpol[2] = 0.125*oneMinTInv*opr*ops; - weightsInterpol[3] = 0.125*oneMinTInv*omr*ops; - weightsInterpol[4] = 0.5*(1.0+parCoor[2]); + const su2double oneMinTInv = 1.0 / oneMinT; + + const su2double omr = (1.0 - parCoor[2] - 2.0 * parCoor[0]); + const su2double opr = (1.0 - parCoor[2] + 2.0 * parCoor[0]); + const su2double oms = (1.0 - parCoor[2] - 2.0 * parCoor[1]); + const su2double ops = (1.0 - parCoor[2] + 2.0 * parCoor[1]); + + weightsInterpol[0] = 0.125 * oneMinTInv * omr * oms; + weightsInterpol[1] = 0.125 * oneMinTInv * opr * oms; + weightsInterpol[2] = 0.125 * oneMinTInv * opr * ops; + weightsInterpol[3] = 0.125 * oneMinTInv * omr * ops; + weightsInterpol[4] = 0.5 * (1.0 + parCoor[2]); } } @@ -1054,9 +1051,8 @@ bool CADTElemClass::CoorInPyramid(const unsigned long elemID, return coorIsInside; } -bool CADTElemClass::InitialGuessContainmentPyramid(const su2double xRelC[3], - const su2double xRel[5][3], - su2double *parCoor) const { +bool CADTElemClass::InitialGuessContainmentPyramid(const su2double xRelC[3], const su2double xRel[5][3], + su2double* parCoor) const { /* Tetrahedron, 0-1-3-4. Create the coordinates of the tetrahedron and of the point. */ su2double x1 = xRel[1][0], y1 = xRel[1][1], z1 = xRel[1][2]; @@ -1066,35 +1062,44 @@ bool CADTElemClass::InitialGuessContainmentPyramid(const su2double xRelC[3], su2double xc = xRelC[0], yc = xRelC[1], zc = xRelC[2]; /* Determine the parametric coordinates inside this tetrahedron. */ - su2double detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - parCoor[0] = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - parCoor[1] = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - parCoor[2] = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + su2double detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + parCoor[0] = detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + parCoor[1] = + -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + parCoor[2] = detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, return true. */ - if((parCoor[0] >= paramLowerBound) && (parCoor[1] >= paramLowerBound) && - (parCoor[2] >= paramLowerBound) && - ((parCoor[0]+parCoor[1]+parCoor[2]) <= paramLowerBound)) return true; + if ((parCoor[0] >= paramLowerBound) && (parCoor[1] >= paramLowerBound) && (parCoor[2] >= paramLowerBound) && + ((parCoor[0] + parCoor[1] + parCoor[2]) <= paramLowerBound)) + return true; /* Tetrahedron, 2-3-1-4. Create the coordinates of the tetrahedron and of the point. */ - x1 = xRel[3][0]-xRel[2][0]; y1 = xRel[3][1]-xRel[2][1]; z1 = xRel[3][2]-xRel[2][2]; - x2 = xRel[1][0]-xRel[2][0]; y2 = xRel[1][1]-xRel[2][1]; z2 = xRel[1][2]-xRel[2][2]; - x3 = xRel[4][0]-xRel[2][0]; y3 = xRel[4][1]-xRel[2][1]; z3 = xRel[4][2]-xRel[2][2]; - - xc = xRelC[0]-xRel[2][0]; yc = xRelC[1]-xRel[2][1]; zc = xRelC[2]-xRel[2][2]; + x1 = xRel[3][0] - xRel[2][0]; + y1 = xRel[3][1] - xRel[2][1]; + z1 = xRel[3][2] - xRel[2][2]; + x2 = xRel[1][0] - xRel[2][0]; + y2 = xRel[1][1] - xRel[2][1]; + z2 = xRel[1][2] - xRel[2][2]; + x3 = xRel[4][0] - xRel[2][0]; + y3 = xRel[4][1] - xRel[2][1]; + z3 = xRel[4][2] - xRel[2][2]; + + xc = xRelC[0] - xRel[2][0]; + yc = xRelC[1] - xRel[2][1]; + zc = xRelC[2] - xRel[2][2]; /* Determine the parametric coordinates inside this tetrahedron. */ - detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - parCoor[0] = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - parCoor[1] = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - parCoor[2] = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + parCoor[0] = detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + parCoor[1] = + -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + parCoor[2] = detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, adapt the parametric coordinates to the real pyramid and return true. */ - if((parCoor[0] >= paramLowerBound) && (parCoor[1] >= paramLowerBound) && - (parCoor[2] >= paramLowerBound) && - ((parCoor[0]+parCoor[1]+parCoor[2]) <= paramLowerBound)) { + if ((parCoor[0] >= paramLowerBound) && (parCoor[1] >= paramLowerBound) && (parCoor[2] >= paramLowerBound) && + ((parCoor[0] + parCoor[1] + parCoor[2]) <= paramLowerBound)) { parCoor[0] = 1.0 - parCoor[0]; parCoor[1] = 1.0 - parCoor[1]; return true; @@ -1102,23 +1107,31 @@ bool CADTElemClass::InitialGuessContainmentPyramid(const su2double xRelC[3], /* Tetrahedron, 1-2-0-4. Create the coordinates of the tetrahedron and of the point. */ - x1 = xRel[2][0]-xRel[1][0]; y1 = xRel[2][1]-xRel[1][1]; z1 = xRel[2][2]-xRel[1][2]; - x2 = xRel[0][0]-xRel[1][0]; y2 = xRel[0][1]-xRel[1][1]; z2 = xRel[0][2]-xRel[1][2]; - x3 = xRel[4][0]-xRel[1][0]; y3 = xRel[4][1]-xRel[1][1]; z3 = xRel[4][2]-xRel[1][2]; - - xc = xRelC[0]-xRel[1][0]; yc = xRelC[1]-xRel[1][1]; zc = xRelC[2]-xRel[1][2]; + x1 = xRel[2][0] - xRel[1][0]; + y1 = xRel[2][1] - xRel[1][1]; + z1 = xRel[2][2] - xRel[1][2]; + x2 = xRel[0][0] - xRel[1][0]; + y2 = xRel[0][1] - xRel[1][1]; + z2 = xRel[0][2] - xRel[1][2]; + x3 = xRel[4][0] - xRel[1][0]; + y3 = xRel[4][1] - xRel[1][1]; + z3 = xRel[4][2] - xRel[1][2]; + + xc = xRelC[0] - xRel[1][0]; + yc = xRelC[1] - xRel[1][1]; + zc = xRelC[2] - xRel[1][2]; /* Determine the parametric coordinates inside this tetrahedron. */ - detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - parCoor[0] = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - parCoor[1] = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - parCoor[2] = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + parCoor[0] = detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + parCoor[1] = + -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + parCoor[2] = detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, adapt the parametric coordinates to the real pyramid and return true. */ - if((parCoor[0] >= paramLowerBound) && (parCoor[1] >= paramLowerBound) && - (parCoor[2] >= paramLowerBound) && - ((parCoor[0]+parCoor[1]+parCoor[2]) <= paramLowerBound)) { + if ((parCoor[0] >= paramLowerBound) && (parCoor[1] >= paramLowerBound) && (parCoor[2] >= paramLowerBound) && + ((parCoor[0] + parCoor[1] + parCoor[2]) <= paramLowerBound)) { const su2double r = parCoor[0]; parCoor[0] = 1.0 - parCoor[1]; parCoor[1] = r; @@ -1127,23 +1140,31 @@ bool CADTElemClass::InitialGuessContainmentPyramid(const su2double xRelC[3], /* Tetrahedron, 3-0-2-4. Create the coordinates of the tetrahedron and of the point. */ - x1 = xRel[0][0]-xRel[3][0]; y1 = xRel[0][1]-xRel[3][1]; z1 = xRel[0][2]-xRel[3][2]; - x2 = xRel[2][0]-xRel[3][0]; y2 = xRel[2][1]-xRel[3][1]; z2 = xRel[2][2]-xRel[3][2]; - x3 = xRel[4][0]-xRel[3][0]; y3 = xRel[4][1]-xRel[3][1]; z3 = xRel[4][2]-xRel[3][2]; - - xc = xRelC[0]-xRel[3][0]; yc = xRelC[1]-xRel[3][1]; zc = xRelC[2]-xRel[3][2]; + x1 = xRel[0][0] - xRel[3][0]; + y1 = xRel[0][1] - xRel[3][1]; + z1 = xRel[0][2] - xRel[3][2]; + x2 = xRel[2][0] - xRel[3][0]; + y2 = xRel[2][1] - xRel[3][1]; + z2 = xRel[2][2] - xRel[3][2]; + x3 = xRel[4][0] - xRel[3][0]; + y3 = xRel[4][1] - xRel[3][1]; + z3 = xRel[4][2] - xRel[3][2]; + + xc = xRelC[0] - xRel[3][0]; + yc = xRelC[1] - xRel[3][1]; + zc = xRelC[2] - xRel[3][2]; /* Determine the parametric coordinates inside this tetrahedron. */ - detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - parCoor[0] = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - parCoor[1] = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - parCoor[2] = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + parCoor[0] = detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + parCoor[1] = + -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + parCoor[2] = detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, adapt the parametric coordinates to the real pyramid and return true. */ - if((parCoor[0] >= paramLowerBound) && (parCoor[1] >= paramLowerBound) && - (parCoor[2] >= paramLowerBound) && - ((parCoor[0]+parCoor[1]+parCoor[2]) <= paramLowerBound)) { + if ((parCoor[0] >= paramLowerBound) && (parCoor[1] >= paramLowerBound) && (parCoor[2] >= paramLowerBound) && + ((parCoor[0] + parCoor[1] + parCoor[2]) <= paramLowerBound)) { const su2double r = parCoor[0]; parCoor[0] = parCoor[1]; parCoor[1] = 1.0 - r; @@ -1156,57 +1177,57 @@ bool CADTElemClass::InitialGuessContainmentPyramid(const su2double xRelC[3], return false; } -bool CADTElemClass::CoorInPrism(const unsigned long elemID, - const su2double *coor, - su2double *parCoor, - su2double *weightsInterpol) const { - +bool CADTElemClass::CoorInPrism(const unsigned long elemID, const su2double* coor, su2double* parCoor, + su2double* weightsInterpol) const { /* Definition of the maximum number of iterations in the Newton solver and the tolerance level. */ const unsigned short maxIt = 50; - const su2double tolNewton = 1.e-10; + const su2double tolNewton = 1.e-10; /* Determine the indices of the six vertices of the prism, multiplied by nDim (which is 3). This gives the position in the coordinate array where the coordinates of these points are stored. */ unsigned long i0 = nDOFsPerElem[elemID]; - unsigned long i1 = i0 + 1, i2 = i0 + 2, i3 = i0+3, i4 = i0+4, i5 = i0+5; - i0 = nDim*elemConns[i0]; i1 = nDim*elemConns[i1]; - i2 = nDim*elemConns[i2]; i3 = nDim*elemConns[i3]; - i4 = nDim*elemConns[i4]; i5 = nDim*elemConns[i5]; + unsigned long i1 = i0 + 1, i2 = i0 + 2, i3 = i0 + 3, i4 = i0 + 4, i5 = i0 + 5; + i0 = nDim * elemConns[i0]; + i1 = nDim * elemConns[i1]; + i2 = nDim * elemConns[i2]; + i3 = nDim * elemConns[i3]; + i4 = nDim * elemConns[i4]; + i5 = nDim * elemConns[i5]; /* Determine the coordinates relative to the vertex 0. */ su2double xRel[6][3], xc[3]; xc[0] = coor[0] - coorPoints[i0]; - xc[1] = coor[1] - coorPoints[i0+1]; - xc[2] = coor[2] - coorPoints[i0+2]; + xc[1] = coor[1] - coorPoints[i0 + 1]; + xc[2] = coor[2] - coorPoints[i0 + 2]; xRel[0][0] = xRel[0][1] = xRel[0][2] = 0.0; - xRel[1][0] = coorPoints[i1] - coorPoints[i0]; - xRel[1][1] = coorPoints[i1+1] - coorPoints[i0+1]; - xRel[1][2] = coorPoints[i1+2] - coorPoints[i0+2]; + xRel[1][0] = coorPoints[i1] - coorPoints[i0]; + xRel[1][1] = coorPoints[i1 + 1] - coorPoints[i0 + 1]; + xRel[1][2] = coorPoints[i1 + 2] - coorPoints[i0 + 2]; - xRel[2][0] = coorPoints[i2] - coorPoints[i0]; - xRel[2][1] = coorPoints[i2+1] - coorPoints[i0+1]; - xRel[2][2] = coorPoints[i2+2] - coorPoints[i0+2]; + xRel[2][0] = coorPoints[i2] - coorPoints[i0]; + xRel[2][1] = coorPoints[i2 + 1] - coorPoints[i0 + 1]; + xRel[2][2] = coorPoints[i2 + 2] - coorPoints[i0 + 2]; - xRel[3][0] = coorPoints[i3] - coorPoints[i0]; - xRel[3][1] = coorPoints[i3+1] - coorPoints[i0+1]; - xRel[3][2] = coorPoints[i3+2] - coorPoints[i0+2]; + xRel[3][0] = coorPoints[i3] - coorPoints[i0]; + xRel[3][1] = coorPoints[i3 + 1] - coorPoints[i0 + 1]; + xRel[3][2] = coorPoints[i3 + 2] - coorPoints[i0 + 2]; - xRel[4][0] = coorPoints[i4] - coorPoints[i0]; - xRel[4][1] = coorPoints[i4+1] - coorPoints[i0+1]; - xRel[4][2] = coorPoints[i4+2] - coorPoints[i0+2]; + xRel[4][0] = coorPoints[i4] - coorPoints[i0]; + xRel[4][1] = coorPoints[i4 + 1] - coorPoints[i0 + 1]; + xRel[4][2] = coorPoints[i4 + 2] - coorPoints[i0 + 2]; - xRel[5][0] = coorPoints[i5] - coorPoints[i0]; - xRel[5][1] = coorPoints[i5+1] - coorPoints[i0+1]; - xRel[5][2] = coorPoints[i5+2] - coorPoints[i0+2]; + xRel[5][0] = coorPoints[i5] - coorPoints[i0]; + xRel[5][1] = coorPoints[i5 + 1] - coorPoints[i0 + 1]; + xRel[5][2] = coorPoints[i5 + 2] - coorPoints[i0 + 2]; /* Obtain an initial guess of the parametric coordinates by splitting the prism into tetrahedra. If this approach is not successful, this means that the point is not inside the true prism and false can be returned. */ - if( !InitialGuessContainmentPrism(xc, xRel, parCoor) ) return false; + if (!InitialGuessContainmentPrism(xc, xRel, parCoor)) return false; /* The prism is parametrized by X-X0 = (Xi-X0)*li, where the sum runs over i = 0..5, although i = 0 does not give a contribution. The Lagrangian @@ -1220,63 +1241,62 @@ bool CADTElemClass::CoorInPrism(const unsigned long elemID, V0 = xc - (x1+x2+x4+x5)/4, V1 = (x1+x4-x3)/4, V2 = (x2+x5-x3)/4, V3 = (x4+x5-x1-x2)/4, V4 = (x4-x1-x3)/4, V5 = (x5-x2-x3)/4. First construct these vectors. */ - const su2double V0x = xc[0] - 0.25*(xRel[1][0]+xRel[2][0]+xRel[4][0]+xRel[5][0]); - const su2double V0y = xc[1] - 0.25*(xRel[1][1]+xRel[2][1]+xRel[4][1]+xRel[5][1]); - const su2double V0z = xc[2] - 0.25*(xRel[1][2]+xRel[2][2]+xRel[4][2]+xRel[5][2]); + const su2double V0x = xc[0] - 0.25 * (xRel[1][0] + xRel[2][0] + xRel[4][0] + xRel[5][0]); + const su2double V0y = xc[1] - 0.25 * (xRel[1][1] + xRel[2][1] + xRel[4][1] + xRel[5][1]); + const su2double V0z = xc[2] - 0.25 * (xRel[1][2] + xRel[2][2] + xRel[4][2] + xRel[5][2]); - const su2double V1x = 0.25*(xRel[1][0]+xRel[4][0]-xRel[3][0]); - const su2double V1y = 0.25*(xRel[1][1]+xRel[4][1]-xRel[3][1]); - const su2double V1z = 0.25*(xRel[1][2]+xRel[4][2]-xRel[3][2]); + const su2double V1x = 0.25 * (xRel[1][0] + xRel[4][0] - xRel[3][0]); + const su2double V1y = 0.25 * (xRel[1][1] + xRel[4][1] - xRel[3][1]); + const su2double V1z = 0.25 * (xRel[1][2] + xRel[4][2] - xRel[3][2]); - const su2double V2x = 0.25*(xRel[2][0]+xRel[5][0]-xRel[3][0]); - const su2double V2y = 0.25*(xRel[2][1]+xRel[5][1]-xRel[3][1]); - const su2double V2z = 0.25*(xRel[2][2]+xRel[5][2]-xRel[3][2]); + const su2double V2x = 0.25 * (xRel[2][0] + xRel[5][0] - xRel[3][0]); + const su2double V2y = 0.25 * (xRel[2][1] + xRel[5][1] - xRel[3][1]); + const su2double V2z = 0.25 * (xRel[2][2] + xRel[5][2] - xRel[3][2]); - const su2double V3x = 0.25*(xRel[4][0]+xRel[5][0]-xRel[1][0]-xRel[2][0]); - const su2double V3y = 0.25*(xRel[4][1]+xRel[5][1]-xRel[1][1]-xRel[2][1]); - const su2double V3z = 0.25*(xRel[4][2]+xRel[5][2]-xRel[1][2]-xRel[2][2]); + const su2double V3x = 0.25 * (xRel[4][0] + xRel[5][0] - xRel[1][0] - xRel[2][0]); + const su2double V3y = 0.25 * (xRel[4][1] + xRel[5][1] - xRel[1][1] - xRel[2][1]); + const su2double V3z = 0.25 * (xRel[4][2] + xRel[5][2] - xRel[1][2] - xRel[2][2]); - const su2double V4x = 0.25*(xRel[4][0]-xRel[1][0]-xRel[3][0]); - const su2double V4y = 0.25*(xRel[4][1]-xRel[1][1]-xRel[3][1]); - const su2double V4z = 0.25*(xRel[4][2]-xRel[1][2]-xRel[3][2]); + const su2double V4x = 0.25 * (xRel[4][0] - xRel[1][0] - xRel[3][0]); + const su2double V4y = 0.25 * (xRel[4][1] - xRel[1][1] - xRel[3][1]); + const su2double V4z = 0.25 * (xRel[4][2] - xRel[1][2] - xRel[3][2]); - const su2double V5x = 0.25*(xRel[5][0]-xRel[2][0]-xRel[3][0]); - const su2double V5y = 0.25*(xRel[5][1]-xRel[2][1]-xRel[3][1]); - const su2double V5z = 0.25*(xRel[5][2]-xRel[2][2]-xRel[3][2]); + const su2double V5x = 0.25 * (xRel[5][0] - xRel[2][0] - xRel[3][0]); + const su2double V5y = 0.25 * (xRel[5][1] - xRel[2][1] - xRel[3][1]); + const su2double V5z = 0.25 * (xRel[5][2] - xRel[2][2] - xRel[3][2]); /* Loop over the maximum number of iterations. */ unsigned short itCount; - for(itCount=0; itCount= paramLowerBound) && (parCoor[1] >= paramLowerBound) && - ((parCoor[0]+parCoor[1]) <= tolInsideElem) && - (parCoor[2] >= paramLowerBound) && (parCoor[2] <= paramUpperBound)) { + if ((parCoor[0] >= paramLowerBound) && (parCoor[1] >= paramLowerBound) && + ((parCoor[0] + parCoor[1]) <= tolInsideElem) && (parCoor[2] >= paramLowerBound) && + (parCoor[2] <= paramUpperBound)) { coorIsInside = true; - const su2double omt = 0.25*(1.0-parCoor[2]), opt = 0.25*(1.0+parCoor[2]); + const su2double omt = 0.25 * (1.0 - parCoor[2]), opt = 0.25 * (1.0 + parCoor[2]); - weightsInterpol[0] = -omt*(parCoor[0]+parCoor[1]); - weightsInterpol[1] = omt*(parCoor[0]+1.0); - weightsInterpol[2] = omt*(parCoor[1]+1.0); - weightsInterpol[3] = -opt*(parCoor[0]+parCoor[1]); - weightsInterpol[4] = opt*(parCoor[0]+1.0); - weightsInterpol[5] = opt*(parCoor[1]+1.0); + weightsInterpol[0] = -omt * (parCoor[0] + parCoor[1]); + weightsInterpol[1] = omt * (parCoor[0] + 1.0); + weightsInterpol[2] = omt * (parCoor[1] + 1.0); + weightsInterpol[3] = -opt * (parCoor[0] + parCoor[1]); + weightsInterpol[4] = opt * (parCoor[0] + 1.0); + weightsInterpol[5] = opt * (parCoor[1] + 1.0); } /* Return the value of coorIsInside. */ return coorIsInside; } -bool CADTElemClass::InitialGuessContainmentPrism(const su2double xRelC[3], - const su2double xRel[6][3], - su2double *parCoor) const { - +bool CADTElemClass::InitialGuessContainmentPrism(const su2double xRelC[3], const su2double xRel[6][3], + su2double* parCoor) const { /* Tetrahedron, 0-1-2-3. Create the coordinates of the tetrahedron and of the point. */ su2double x1 = xRel[1][0], y1 = xRel[1][1], z1 = xRel[1][2]; @@ -1327,126 +1344,175 @@ bool CADTElemClass::InitialGuessContainmentPrism(const su2double xRelC[3], su2double xc = xRelC[0], yc = xRelC[1], zc = xRelC[2]; /* Determine the parametric coordinates inside this tetrahedron. */ - su2double detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - su2double r = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - su2double s = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - su2double t = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + su2double detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + su2double r = + detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + su2double s = + -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + su2double t = + detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, set the parametric coordinates for the real prism and return true. */ - if((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && - ((r+s+t) <= paramLowerBound)) { - parCoor[0] = r; parCoor[1] = s; parCoor[2] = t; + if ((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && ((r + s + t) <= paramLowerBound)) { + parCoor[0] = r; + parCoor[1] = s; + parCoor[2] = t; return true; } /* Tetrahedron, 4-1-3-2. Create the coordinates of the tetrahedron and of the point. */ - x1 = xRel[1][0]-xRel[4][0]; y1 = xRel[1][1]-xRel[4][1]; z1 = xRel[1][2]-xRel[4][2]; - x2 = xRel[3][0]-xRel[4][0]; y2 = xRel[3][1]-xRel[4][1]; z2 = xRel[3][2]-xRel[4][2]; - x3 = xRel[2][0]-xRel[4][0]; y3 = xRel[2][1]-xRel[4][1]; z3 = xRel[2][2]-xRel[4][2]; - - xc = xRelC[0]-xRel[4][0]; yc = xRelC[1]-xRel[4][1]; zc = xRelC[2]-xRel[4][2]; + x1 = xRel[1][0] - xRel[4][0]; + y1 = xRel[1][1] - xRel[4][1]; + z1 = xRel[1][2] - xRel[4][2]; + x2 = xRel[3][0] - xRel[4][0]; + y2 = xRel[3][1] - xRel[4][1]; + z2 = xRel[3][2] - xRel[4][2]; + x3 = xRel[2][0] - xRel[4][0]; + y3 = xRel[2][1] - xRel[4][1]; + z3 = xRel[2][2] - xRel[4][2]; + + xc = xRelC[0] - xRel[4][0]; + yc = xRelC[1] - xRel[4][1]; + zc = xRelC[2] - xRel[4][2]; /* Determine the parametric coordinates inside this tetrahedron. */ - detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - r = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - s = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - t = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + r = detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + s = -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + t = detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, set the parametric coordinates for the real prism and return true. */ - if((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && - ((r+s+t) <= paramLowerBound)) { - parCoor[0] = 1.0 - s; parCoor[1] = t; parCoor[2] = 1.0 - r; + if ((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && ((r + s + t) <= paramLowerBound)) { + parCoor[0] = 1.0 - s; + parCoor[1] = t; + parCoor[2] = 1.0 - r; return true; } /* Tetrahedron, 3-5-4-2. Create the coordinates of the tetrahedron and of the point. */ - x1 = xRel[5][0]-xRel[3][0]; y1 = xRel[5][1]-xRel[3][1]; z1 = xRel[5][2]-xRel[3][2]; - x2 = xRel[4][0]-xRel[3][0]; y2 = xRel[4][1]-xRel[3][1]; z2 = xRel[4][2]-xRel[3][2]; - x3 = xRel[2][0]-xRel[3][0]; y3 = xRel[2][1]-xRel[3][1]; z3 = xRel[2][2]-xRel[3][2]; - - xc = xRelC[0]-xRel[3][0]; yc = xRelC[1]-xRel[3][1]; zc = xRelC[2]-xRel[3][2]; + x1 = xRel[5][0] - xRel[3][0]; + y1 = xRel[5][1] - xRel[3][1]; + z1 = xRel[5][2] - xRel[3][2]; + x2 = xRel[4][0] - xRel[3][0]; + y2 = xRel[4][1] - xRel[3][1]; + z2 = xRel[4][2] - xRel[3][2]; + x3 = xRel[2][0] - xRel[3][0]; + y3 = xRel[2][1] - xRel[3][1]; + z3 = xRel[2][2] - xRel[3][2]; + + xc = xRelC[0] - xRel[3][0]; + yc = xRelC[1] - xRel[3][1]; + zc = xRelC[2] - xRel[3][2]; /* Determine the parametric coordinates inside this tetrahedron. */ - detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - r = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - s = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - t = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + r = detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + s = -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + t = detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, set the parametric coordinates for the real prism and return true. */ - if((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && - ((r+s+t) <= paramLowerBound)) { - parCoor[0] = s; parCoor[1] = r; parCoor[2] = 1.0 - t; + if ((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && ((r + s + t) <= paramLowerBound)) { + parCoor[0] = s; + parCoor[1] = r; + parCoor[2] = 1.0 - t; return true; } /* Tetrahedron, 3-5-4-0. Create the coordinates of the tetrahedron and of the point. */ - x1 = xRel[5][0]-xRel[3][0]; y1 = xRel[5][1]-xRel[3][1]; z1 = xRel[5][2]-xRel[3][2]; - x2 = xRel[4][0]-xRel[3][0]; y2 = xRel[4][1]-xRel[3][1]; z2 = xRel[4][2]-xRel[3][2]; - x3 = xRel[0][0]-xRel[3][0]; y3 = xRel[0][1]-xRel[3][1]; z3 = xRel[0][2]-xRel[3][2]; - - xc = xRelC[0]-xRel[3][0]; yc = xRelC[1]-xRel[3][1]; zc = xRelC[2]-xRel[3][2]; + x1 = xRel[5][0] - xRel[3][0]; + y1 = xRel[5][1] - xRel[3][1]; + z1 = xRel[5][2] - xRel[3][2]; + x2 = xRel[4][0] - xRel[3][0]; + y2 = xRel[4][1] - xRel[3][1]; + z2 = xRel[4][2] - xRel[3][2]; + x3 = xRel[0][0] - xRel[3][0]; + y3 = xRel[0][1] - xRel[3][1]; + z3 = xRel[0][2] - xRel[3][2]; + + xc = xRelC[0] - xRel[3][0]; + yc = xRelC[1] - xRel[3][1]; + zc = xRelC[2] - xRel[3][2]; /* Determine the parametric coordinates inside this tetrahedron. */ - detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - r = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - s = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - t = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + r = detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + s = -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + t = detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, set the parametric coordinates for the real prism and return true. */ - if((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && - ((r+s+t) <= paramLowerBound)) { - parCoor[0] = s; parCoor[1] = r; parCoor[2] = 1.0 - t; + if ((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && ((r + s + t) <= paramLowerBound)) { + parCoor[0] = s; + parCoor[1] = r; + parCoor[2] = 1.0 - t; return true; } /* Tetrahedron, 1-0-4-5. Create the coordinates of the tetrahedron and of the point. */ - x1 = xRel[0][0]-xRel[1][0]; y1 = xRel[0][1]-xRel[1][1]; z1 = xRel[0][2]-xRel[1][2]; - x2 = xRel[4][0]-xRel[1][0]; y2 = xRel[4][1]-xRel[1][1]; z2 = xRel[4][2]-xRel[1][2]; - x3 = xRel[5][0]-xRel[1][0]; y3 = xRel[5][1]-xRel[1][1]; z3 = xRel[5][2]-xRel[1][2]; - - xc = xRelC[0]-xRel[1][0]; yc = xRelC[1]-xRel[1][1]; zc = xRelC[2]-xRel[1][2]; + x1 = xRel[0][0] - xRel[1][0]; + y1 = xRel[0][1] - xRel[1][1]; + z1 = xRel[0][2] - xRel[1][2]; + x2 = xRel[4][0] - xRel[1][0]; + y2 = xRel[4][1] - xRel[1][1]; + z2 = xRel[4][2] - xRel[1][2]; + x3 = xRel[5][0] - xRel[1][0]; + y3 = xRel[5][1] - xRel[1][1]; + z3 = xRel[5][2] - xRel[1][2]; + + xc = xRelC[0] - xRel[1][0]; + yc = xRelC[1] - xRel[1][1]; + zc = xRelC[2] - xRel[1][2]; /* Determine the parametric coordinates inside this tetrahedron. */ - detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - r = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - s = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - t = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + r = detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + s = -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + t = detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, set the parametric coordinates for the real prism and return true. */ - if((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && - ((r+s+t) <= paramLowerBound)) { - parCoor[0] = 1.0 - r; parCoor[1] = t; parCoor[2] = s; + if ((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && ((r + s + t) <= paramLowerBound)) { + parCoor[0] = 1.0 - r; + parCoor[1] = t; + parCoor[2] = s; return true; } /* Tetrahedron, 0-1-2-5. Create the coordinates of the tetrahedron and of the point. */ - x1 = xRel[1][0]; y1 = xRel[1][1]; z1 = xRel[1][2]; - x2 = xRel[2][0]; y2 = xRel[2][1]; z2 = xRel[2][2]; - x3 = xRel[5][0]; y3 = xRel[5][1]; z3 = xRel[5][2]; - - xc = xRelC[0]; yc = xRelC[1]; zc = xRelC[2]; + x1 = xRel[1][0]; + y1 = xRel[1][1]; + z1 = xRel[1][2]; + x2 = xRel[2][0]; + y2 = xRel[2][1]; + z2 = xRel[2][2]; + x3 = xRel[5][0]; + y3 = xRel[5][1]; + z3 = xRel[5][2]; + + xc = xRelC[0]; + yc = xRelC[1]; + zc = xRelC[2]; /* Determine the parametric coordinates inside this tetrahedron. */ - detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - r = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - s = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - t = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + r = detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + s = -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + t = detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, set the parametric coordinates for the real prism and return true. */ - if((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && - ((r+s+t) <= paramLowerBound)) { - parCoor[0] = r; parCoor[1] = s; parCoor[2] = t; + if ((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && ((r + s + t) <= paramLowerBound)) { + parCoor[0] = r; + parCoor[1] = s; + parCoor[2] = t; return true; } @@ -1456,66 +1522,67 @@ bool CADTElemClass::InitialGuessContainmentPrism(const su2double xRelC[3], return false; } -bool CADTElemClass::CoorInHexahedron(const unsigned long elemID, - const su2double *coor, - su2double *parCoor, - su2double *weightsInterpol) const { - +bool CADTElemClass::CoorInHexahedron(const unsigned long elemID, const su2double* coor, su2double* parCoor, + su2double* weightsInterpol) const { /* Definition of the maximum number of iterations in the Newton solver and the tolerance level. */ const unsigned short maxIt = 50; - const su2double tolNewton = 1.e-10; + const su2double tolNewton = 1.e-10; /* Determine the indices of the eight vertices of the hexahedron, multiplied by nDim (which is 3). This gives the position in the coordinate array where the coordinates of these points are stored. */ unsigned long i0 = nDOFsPerElem[elemID]; - unsigned long i1 = i0 + 1, i2 = i0 + 2, i3 = i0+3, i4 = i0+4, i5 = i0+5, i6 = i0+6, i7 = i0+7; - i0 = nDim*elemConns[i0]; i1 = nDim*elemConns[i1]; - i2 = nDim*elemConns[i2]; i3 = nDim*elemConns[i3]; - i4 = nDim*elemConns[i4]; i5 = nDim*elemConns[i5]; - i6 = nDim*elemConns[i6]; i7 = nDim*elemConns[i7]; + unsigned long i1 = i0 + 1, i2 = i0 + 2, i3 = i0 + 3, i4 = i0 + 4, i5 = i0 + 5, i6 = i0 + 6, i7 = i0 + 7; + i0 = nDim * elemConns[i0]; + i1 = nDim * elemConns[i1]; + i2 = nDim * elemConns[i2]; + i3 = nDim * elemConns[i3]; + i4 = nDim * elemConns[i4]; + i5 = nDim * elemConns[i5]; + i6 = nDim * elemConns[i6]; + i7 = nDim * elemConns[i7]; /* Determine the coordinates relative to the vertex 0. */ su2double xRel[8][3], xc[3]; xc[0] = coor[0] - coorPoints[i0]; - xc[1] = coor[1] - coorPoints[i0+1]; - xc[2] = coor[2] - coorPoints[i0+2]; + xc[1] = coor[1] - coorPoints[i0 + 1]; + xc[2] = coor[2] - coorPoints[i0 + 2]; xRel[0][0] = xRel[0][1] = xRel[0][2] = 0.0; - xRel[1][0] = coorPoints[i1] - coorPoints[i0]; - xRel[1][1] = coorPoints[i1+1] - coorPoints[i0+1]; - xRel[1][2] = coorPoints[i1+2] - coorPoints[i0+2]; + xRel[1][0] = coorPoints[i1] - coorPoints[i0]; + xRel[1][1] = coorPoints[i1 + 1] - coorPoints[i0 + 1]; + xRel[1][2] = coorPoints[i1 + 2] - coorPoints[i0 + 2]; - xRel[2][0] = coorPoints[i2] - coorPoints[i0]; - xRel[2][1] = coorPoints[i2+1] - coorPoints[i0+1]; - xRel[2][2] = coorPoints[i2+2] - coorPoints[i0+2]; + xRel[2][0] = coorPoints[i2] - coorPoints[i0]; + xRel[2][1] = coorPoints[i2 + 1] - coorPoints[i0 + 1]; + xRel[2][2] = coorPoints[i2 + 2] - coorPoints[i0 + 2]; - xRel[3][0] = coorPoints[i3] - coorPoints[i0]; - xRel[3][1] = coorPoints[i3+1] - coorPoints[i0+1]; - xRel[3][2] = coorPoints[i3+2] - coorPoints[i0+2]; + xRel[3][0] = coorPoints[i3] - coorPoints[i0]; + xRel[3][1] = coorPoints[i3 + 1] - coorPoints[i0 + 1]; + xRel[3][2] = coorPoints[i3 + 2] - coorPoints[i0 + 2]; - xRel[4][0] = coorPoints[i4] - coorPoints[i0]; - xRel[4][1] = coorPoints[i4+1] - coorPoints[i0+1]; - xRel[4][2] = coorPoints[i4+2] - coorPoints[i0+2]; + xRel[4][0] = coorPoints[i4] - coorPoints[i0]; + xRel[4][1] = coorPoints[i4 + 1] - coorPoints[i0 + 1]; + xRel[4][2] = coorPoints[i4 + 2] - coorPoints[i0 + 2]; - xRel[5][0] = coorPoints[i5] - coorPoints[i0]; - xRel[5][1] = coorPoints[i5+1] - coorPoints[i0+1]; - xRel[5][2] = coorPoints[i5+2] - coorPoints[i0+2]; + xRel[5][0] = coorPoints[i5] - coorPoints[i0]; + xRel[5][1] = coorPoints[i5 + 1] - coorPoints[i0 + 1]; + xRel[5][2] = coorPoints[i5 + 2] - coorPoints[i0 + 2]; - xRel[6][0] = coorPoints[i6] - coorPoints[i0]; - xRel[6][1] = coorPoints[i6+1] - coorPoints[i0+1]; - xRel[6][2] = coorPoints[i6+2] - coorPoints[i0+2]; + xRel[6][0] = coorPoints[i6] - coorPoints[i0]; + xRel[6][1] = coorPoints[i6 + 1] - coorPoints[i0 + 1]; + xRel[6][2] = coorPoints[i6 + 2] - coorPoints[i0 + 2]; - xRel[7][0] = coorPoints[i7] - coorPoints[i0]; - xRel[7][1] = coorPoints[i7+1] - coorPoints[i0+1]; - xRel[7][2] = coorPoints[i7+2] - coorPoints[i0+2]; + xRel[7][0] = coorPoints[i7] - coorPoints[i0]; + xRel[7][1] = coorPoints[i7 + 1] - coorPoints[i0 + 1]; + xRel[7][2] = coorPoints[i7 + 2] - coorPoints[i0 + 2]; /* Obtain an initial guess of the parametric coordinates by splitting the hexahedron into tetrahedra. If this approach is not successful, this means that the point is not inside the true hexahedron and false can be returned. */ - if( !InitialGuessContainmentHexahedron(xc, xRel, parCoor) ) return false; + if (!InitialGuessContainmentHexahedron(xc, xRel, parCoor)) return false; /* The hexahedron is parametrized by X-X0 = (Xi-X0)*li, where the sum runs over i = 0..7, although i = 0 does not give a contribution. The Lagrangian @@ -1533,74 +1600,97 @@ bool CADTElemClass::CoorInHexahedron(const unsigned long elemID, V4 = (x2+x4+x6-x1-x3-x5-x7)/8, V5 = (x3+x5+x6-x1-x2-x4-x7)/8, V6 = (x1+x6+x7-x2-x3-x4-x5)/8, V7 = (x1+x3+x4+x6-x2-x5-x7)/8. First construct these vectors. */ - const su2double V0x = xc[0] - 0.125*(xRel[1][0]+xRel[2][0]+xRel[3][0]+xRel[4][0]+xRel[5][0]+xRel[6][0]+xRel[7][0]); - const su2double V0y = xc[1] - 0.125*(xRel[1][1]+xRel[2][1]+xRel[3][1]+xRel[4][1]+xRel[5][1]+xRel[6][1]+xRel[7][1]); - const su2double V0z = xc[2] - 0.125*(xRel[1][2]+xRel[2][2]+xRel[3][2]+xRel[4][2]+xRel[5][2]+xRel[6][2]+xRel[7][2]); - - const su2double V1x = 0.125*(xRel[1][0]+xRel[2][0]-xRel[3][0]-xRel[4][0]+xRel[5][0]+xRel[6][0]-xRel[7][0]); - const su2double V1y = 0.125*(xRel[1][1]+xRel[2][1]-xRel[3][1]-xRel[4][1]+xRel[5][1]+xRel[6][1]-xRel[7][1]); - const su2double V1z = 0.125*(xRel[1][2]+xRel[2][2]-xRel[3][2]-xRel[4][2]+xRel[5][2]+xRel[6][2]-xRel[7][2]); - - const su2double V2x = 0.125*(xRel[2][0]+xRel[3][0]-xRel[1][0]-xRel[4][0]-xRel[5][0]+xRel[6][0]+xRel[7][0]); - const su2double V2y = 0.125*(xRel[2][1]+xRel[3][1]-xRel[1][1]-xRel[4][1]-xRel[5][1]+xRel[6][1]+xRel[7][1]); - const su2double V2z = 0.125*(xRel[2][2]+xRel[3][2]-xRel[1][2]-xRel[4][2]-xRel[5][2]+xRel[6][2]+xRel[7][2]); - - const su2double V3x = 0.125*(xRel[4][0]+xRel[5][0]+xRel[6][0]+xRel[7][0]-xRel[1][0]-xRel[2][0]-xRel[3][0]); - const su2double V3y = 0.125*(xRel[4][1]+xRel[5][1]+xRel[6][1]+xRel[7][1]-xRel[1][1]-xRel[2][1]-xRel[3][1]); - const su2double V3z = 0.125*(xRel[4][2]+xRel[5][2]+xRel[6][2]+xRel[7][2]-xRel[1][2]-xRel[2][2]-xRel[3][2]); - - const su2double V4x = 0.125*(xRel[2][0]+xRel[4][0]+xRel[6][0]-xRel[1][0]-xRel[3][0]-xRel[5][0]-xRel[7][0]); - const su2double V4y = 0.125*(xRel[2][1]+xRel[4][1]+xRel[6][1]-xRel[1][1]-xRel[3][1]-xRel[5][1]-xRel[7][1]); - const su2double V4z = 0.125*(xRel[2][2]+xRel[4][2]+xRel[6][2]-xRel[1][2]-xRel[3][2]-xRel[5][2]-xRel[7][2]); - - const su2double V5x = 0.125*(xRel[3][0]+xRel[5][0]+xRel[6][0]-xRel[1][0]-xRel[2][0]-xRel[4][0]-xRel[7][0]); - const su2double V5y = 0.125*(xRel[3][1]+xRel[5][1]+xRel[6][1]-xRel[1][1]-xRel[2][1]-xRel[4][1]-xRel[7][1]); - const su2double V5z = 0.125*(xRel[3][2]+xRel[5][2]+xRel[6][2]-xRel[1][2]-xRel[2][2]-xRel[4][2]-xRel[7][2]); - - const su2double V6x = 0.125*(xRel[1][0]+xRel[6][0]+xRel[7][0]-xRel[2][0]-xRel[3][0]-xRel[4][0]-xRel[5][0]); - const su2double V6y = 0.125*(xRel[1][1]+xRel[6][1]+xRel[7][1]-xRel[2][1]-xRel[3][1]-xRel[4][1]-xRel[5][1]); - const su2double V6z = 0.125*(xRel[1][2]+xRel[6][2]+xRel[7][2]-xRel[2][2]-xRel[3][2]-xRel[4][2]-xRel[5][2]); - - const su2double V7x = 0.125*(xRel[1][0]+xRel[3][0]+xRel[4][0]+xRel[6][0]-xRel[2][0]-xRel[5][0]-xRel[7][0]); - const su2double V7y = 0.125*(xRel[1][1]+xRel[3][1]+xRel[4][1]+xRel[6][1]-xRel[2][1]-xRel[5][1]-xRel[7][1]); - const su2double V7z = 0.125*(xRel[1][2]+xRel[3][2]+xRel[4][2]+xRel[6][2]-xRel[2][2]-xRel[5][2]-xRel[7][2]); + const su2double V0x = + xc[0] - 0.125 * (xRel[1][0] + xRel[2][0] + xRel[3][0] + xRel[4][0] + xRel[5][0] + xRel[6][0] + xRel[7][0]); + const su2double V0y = + xc[1] - 0.125 * (xRel[1][1] + xRel[2][1] + xRel[3][1] + xRel[4][1] + xRel[5][1] + xRel[6][1] + xRel[7][1]); + const su2double V0z = + xc[2] - 0.125 * (xRel[1][2] + xRel[2][2] + xRel[3][2] + xRel[4][2] + xRel[5][2] + xRel[6][2] + xRel[7][2]); + + const su2double V1x = + 0.125 * (xRel[1][0] + xRel[2][0] - xRel[3][0] - xRel[4][0] + xRel[5][0] + xRel[6][0] - xRel[7][0]); + const su2double V1y = + 0.125 * (xRel[1][1] + xRel[2][1] - xRel[3][1] - xRel[4][1] + xRel[5][1] + xRel[6][1] - xRel[7][1]); + const su2double V1z = + 0.125 * (xRel[1][2] + xRel[2][2] - xRel[3][2] - xRel[4][2] + xRel[5][2] + xRel[6][2] - xRel[7][2]); + + const su2double V2x = + 0.125 * (xRel[2][0] + xRel[3][0] - xRel[1][0] - xRel[4][0] - xRel[5][0] + xRel[6][0] + xRel[7][0]); + const su2double V2y = + 0.125 * (xRel[2][1] + xRel[3][1] - xRel[1][1] - xRel[4][1] - xRel[5][1] + xRel[6][1] + xRel[7][1]); + const su2double V2z = + 0.125 * (xRel[2][2] + xRel[3][2] - xRel[1][2] - xRel[4][2] - xRel[5][2] + xRel[6][2] + xRel[7][2]); + + const su2double V3x = + 0.125 * (xRel[4][0] + xRel[5][0] + xRel[6][0] + xRel[7][0] - xRel[1][0] - xRel[2][0] - xRel[3][0]); + const su2double V3y = + 0.125 * (xRel[4][1] + xRel[5][1] + xRel[6][1] + xRel[7][1] - xRel[1][1] - xRel[2][1] - xRel[3][1]); + const su2double V3z = + 0.125 * (xRel[4][2] + xRel[5][2] + xRel[6][2] + xRel[7][2] - xRel[1][2] - xRel[2][2] - xRel[3][2]); + + const su2double V4x = + 0.125 * (xRel[2][0] + xRel[4][0] + xRel[6][0] - xRel[1][0] - xRel[3][0] - xRel[5][0] - xRel[7][0]); + const su2double V4y = + 0.125 * (xRel[2][1] + xRel[4][1] + xRel[6][1] - xRel[1][1] - xRel[3][1] - xRel[5][1] - xRel[7][1]); + const su2double V4z = + 0.125 * (xRel[2][2] + xRel[4][2] + xRel[6][2] - xRel[1][2] - xRel[3][2] - xRel[5][2] - xRel[7][2]); + + const su2double V5x = + 0.125 * (xRel[3][0] + xRel[5][0] + xRel[6][0] - xRel[1][0] - xRel[2][0] - xRel[4][0] - xRel[7][0]); + const su2double V5y = + 0.125 * (xRel[3][1] + xRel[5][1] + xRel[6][1] - xRel[1][1] - xRel[2][1] - xRel[4][1] - xRel[7][1]); + const su2double V5z = + 0.125 * (xRel[3][2] + xRel[5][2] + xRel[6][2] - xRel[1][2] - xRel[2][2] - xRel[4][2] - xRel[7][2]); + + const su2double V6x = + 0.125 * (xRel[1][0] + xRel[6][0] + xRel[7][0] - xRel[2][0] - xRel[3][0] - xRel[4][0] - xRel[5][0]); + const su2double V6y = + 0.125 * (xRel[1][1] + xRel[6][1] + xRel[7][1] - xRel[2][1] - xRel[3][1] - xRel[4][1] - xRel[5][1]); + const su2double V6z = + 0.125 * (xRel[1][2] + xRel[6][2] + xRel[7][2] - xRel[2][2] - xRel[3][2] - xRel[4][2] - xRel[5][2]); + + const su2double V7x = + 0.125 * (xRel[1][0] + xRel[3][0] + xRel[4][0] + xRel[6][0] - xRel[2][0] - xRel[5][0] - xRel[7][0]); + const su2double V7y = + 0.125 * (xRel[1][1] + xRel[3][1] + xRel[4][1] + xRel[6][1] - xRel[2][1] - xRel[5][1] - xRel[7][1]); + const su2double V7z = + 0.125 * (xRel[1][2] + xRel[3][2] + xRel[4][2] + xRel[6][2] - xRel[2][2] - xRel[5][2] - xRel[7][2]); /* Loop over the maximum number of iterations. */ unsigned short itCount; - for(itCount=0; itCount= paramLowerBound) && (parCoor[0] <= paramUpperBound) && - (parCoor[1] >= paramLowerBound) && (parCoor[1] <= paramUpperBound) && - (parCoor[2] >= paramLowerBound) && (parCoor[2] <= paramUpperBound)) { + if ((parCoor[0] >= paramLowerBound) && (parCoor[0] <= paramUpperBound) && (parCoor[1] >= paramLowerBound) && + (parCoor[1] <= paramUpperBound) && (parCoor[2] >= paramLowerBound) && (parCoor[2] <= paramUpperBound)) { coorIsInside = true; - const su2double omr = 0.5*(1.0-parCoor[0]), opr = 0.5*(1.0+parCoor[0]); - const su2double oms = 0.5*(1.0-parCoor[1]), ops = 0.5*(1.0+parCoor[1]); - const su2double omt = 0.5*(1.0-parCoor[2]), opt = 0.5*(1.0+parCoor[2]); - - weightsInterpol[0] = omr*oms*omt; - weightsInterpol[1] = opr*oms*omt; - weightsInterpol[2] = opr*ops*omt; - weightsInterpol[3] = omr*ops*omt; - weightsInterpol[4] = omr*oms*opt; - weightsInterpol[5] = opr*oms*opt; - weightsInterpol[6] = opr*ops*opt; - weightsInterpol[7] = omr*ops*opt; + const su2double omr = 0.5 * (1.0 - parCoor[0]), opr = 0.5 * (1.0 + parCoor[0]); + const su2double oms = 0.5 * (1.0 - parCoor[1]), ops = 0.5 * (1.0 + parCoor[1]); + const su2double omt = 0.5 * (1.0 - parCoor[2]), opt = 0.5 * (1.0 + parCoor[2]); + + weightsInterpol[0] = omr * oms * omt; + weightsInterpol[1] = opr * oms * omt; + weightsInterpol[2] = opr * ops * omt; + weightsInterpol[3] = omr * ops * omt; + weightsInterpol[4] = omr * oms * opt; + weightsInterpol[5] = opr * oms * opt; + weightsInterpol[6] = opr * ops * opt; + weightsInterpol[7] = omr * ops * opt; } /* Return the value of coorIsInside. */ return coorIsInside; } -bool CADTElemClass::InitialGuessContainmentHexahedron(const su2double xRelC[3], - const su2double xRel[8][3], - su2double *parCoor) const { +bool CADTElemClass::InitialGuessContainmentHexahedron(const su2double xRelC[3], const su2double xRel[8][3], + su2double* parCoor) const { /* Tetrahedron, 0-1-2-5. Create the coordinates of the tetrahedron and of the point. */ su2double x1 = xRel[1][0], y1 = xRel[1][1], z1 = xRel[1][2]; @@ -1654,214 +1741,299 @@ bool CADTElemClass::InitialGuessContainmentHexahedron(const su2double xRelC[3], su2double xc = xRelC[0], yc = xRelC[1], zc = xRelC[2]; /* Determine the parametric coordinates inside this tetrahedron. */ - su2double detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - su2double r = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - su2double s = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - su2double t = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + su2double detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + su2double r = + detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + su2double s = + -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + su2double t = + detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, set the parametric coordinates for the real hexahedron and return true. */ - if((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && - ((r+s+t) <= paramLowerBound)) { - parCoor[0] = r; parCoor[1] = s; parCoor[2] = t; + if ((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && ((r + s + t) <= paramLowerBound)) { + parCoor[0] = r; + parCoor[1] = s; + parCoor[2] = t; return true; } /* Tetrahedron, 4-7-5-0. Create the coordinates of the tetrahedron and of the point. */ - x1 = xRel[7][0]-xRel[4][0]; y1 = xRel[7][1]-xRel[4][1]; z1 = xRel[7][2]-xRel[4][2]; - x2 = xRel[5][0]-xRel[4][0]; y2 = xRel[5][1]-xRel[4][1]; z2 = xRel[5][2]-xRel[4][2]; - x3 = xRel[0][0]-xRel[4][0]; y3 = xRel[0][1]-xRel[4][1]; z3 = xRel[0][2]-xRel[4][2]; - - xc = xRelC[0]-xRel[4][0]; yc = xRelC[1]-xRel[4][1]; zc = xRelC[2]-xRel[4][2]; + x1 = xRel[7][0] - xRel[4][0]; + y1 = xRel[7][1] - xRel[4][1]; + z1 = xRel[7][2] - xRel[4][2]; + x2 = xRel[5][0] - xRel[4][0]; + y2 = xRel[5][1] - xRel[4][1]; + z2 = xRel[5][2] - xRel[4][2]; + x3 = xRel[0][0] - xRel[4][0]; + y3 = xRel[0][1] - xRel[4][1]; + z3 = xRel[0][2] - xRel[4][2]; + + xc = xRelC[0] - xRel[4][0]; + yc = xRelC[1] - xRel[4][1]; + zc = xRelC[2] - xRel[4][2]; /* Determine the parametric coordinates inside this tetrahedron. */ - detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - r = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - s = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - t = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + r = detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + s = -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + t = detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, set the parametric coordinates for the real hexahedron and return true. */ - if((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && - ((r+s+t) <= paramLowerBound)) { - parCoor[0] = s; parCoor[1] = r; parCoor[2] = 1.0 - t; + if ((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && ((r + s + t) <= paramLowerBound)) { + parCoor[0] = s; + parCoor[1] = r; + parCoor[2] = 1.0 - t; return true; } /* Tetrahedron, 6-7-5-2. Create the coordinates of the tetrahedron and of the point. */ - x1 = xRel[7][0]-xRel[6][0]; y1 = xRel[7][1]-xRel[6][1]; z1 = xRel[7][2]-xRel[6][2]; - x2 = xRel[5][0]-xRel[6][0]; y2 = xRel[5][1]-xRel[6][1]; z2 = xRel[5][2]-xRel[6][2]; - x3 = xRel[2][0]-xRel[6][0]; y3 = xRel[2][1]-xRel[6][1]; z3 = xRel[2][2]-xRel[6][2]; - - xc = xRelC[0]-xRel[6][0]; yc = xRelC[1]-xRel[6][1]; zc = xRelC[2]-xRel[6][2]; + x1 = xRel[7][0] - xRel[6][0]; + y1 = xRel[7][1] - xRel[6][1]; + z1 = xRel[7][2] - xRel[6][2]; + x2 = xRel[5][0] - xRel[6][0]; + y2 = xRel[5][1] - xRel[6][1]; + z2 = xRel[5][2] - xRel[6][2]; + x3 = xRel[2][0] - xRel[6][0]; + y3 = xRel[2][1] - xRel[6][1]; + z3 = xRel[2][2] - xRel[6][2]; + + xc = xRelC[0] - xRel[6][0]; + yc = xRelC[1] - xRel[6][1]; + zc = xRelC[2] - xRel[6][2]; /* Determine the parametric coordinates inside this tetrahedron. */ - detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - r = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - s = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - t = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + r = detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + s = -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + t = detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, set the parametric coordinates for the real hexahedron and return true. */ - if((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && - ((r+s+t) <= paramLowerBound)) { - parCoor[0] = 1.0 - s; parCoor[1] = 1.0 - r; parCoor[2] = 1.0 - t; + if ((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && ((r + s + t) <= paramLowerBound)) { + parCoor[0] = 1.0 - s; + parCoor[1] = 1.0 - r; + parCoor[2] = 1.0 - t; return true; } /* Tetrahedron, 3-0-2-7. Create the coordinates of the tetrahedron and of the point. */ - x1 = xRel[0][0]-xRel[3][0]; y1 = xRel[0][1]-xRel[3][1]; z1 = xRel[0][2]-xRel[3][2]; - x2 = xRel[2][0]-xRel[3][0]; y2 = xRel[2][1]-xRel[3][1]; z2 = xRel[2][2]-xRel[3][2]; - x3 = xRel[7][0]-xRel[3][0]; y3 = xRel[7][1]-xRel[3][1]; z3 = xRel[7][2]-xRel[3][2]; - - xc = xRelC[0]-xRel[3][0]; yc = xRelC[1]-xRel[3][1]; zc = xRelC[2]-xRel[3][2]; + x1 = xRel[0][0] - xRel[3][0]; + y1 = xRel[0][1] - xRel[3][1]; + z1 = xRel[0][2] - xRel[3][2]; + x2 = xRel[2][0] - xRel[3][0]; + y2 = xRel[2][1] - xRel[3][1]; + z2 = xRel[2][2] - xRel[3][2]; + x3 = xRel[7][0] - xRel[3][0]; + y3 = xRel[7][1] - xRel[3][1]; + z3 = xRel[7][2] - xRel[3][2]; + + xc = xRelC[0] - xRel[3][0]; + yc = xRelC[1] - xRel[3][1]; + zc = xRelC[2] - xRel[3][2]; /* Determine the parametric coordinates inside this tetrahedron. */ - detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - r = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - s = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - t = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + r = detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + s = -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + t = detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, set the parametric coordinates for the real hexahedron and return true. */ - if((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && - ((r+s+t) <= paramLowerBound)) { - parCoor[0] = 1.0 - s; parCoor[1] = r; parCoor[2] = 1.0 - t; + if ((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && ((r + s + t) <= paramLowerBound)) { + parCoor[0] = 1.0 - s; + parCoor[1] = r; + parCoor[2] = 1.0 - t; return true; } /* Tetrahedron, 0-5-2-7. Create the coordinates of the tetrahedron and of the point. */ - x1 = xRel[5][0]; y1 = xRel[5][1]; z1 = xRel[5][2]; - x2 = xRel[2][0]; y2 = xRel[2][1]; z2 = xRel[2][2]; - x3 = xRel[7][0]; y3 = xRel[7][1]; z3 = xRel[7][2]; - - xc = xRelC[0]; yc = xRelC[1]; zc = xRelC[2]; + x1 = xRel[5][0]; + y1 = xRel[5][1]; + z1 = xRel[5][2]; + x2 = xRel[2][0]; + y2 = xRel[2][1]; + z2 = xRel[2][2]; + x3 = xRel[7][0]; + y3 = xRel[7][1]; + z3 = xRel[7][2]; + + xc = xRelC[0]; + yc = xRelC[1]; + zc = xRelC[2]; /* Determine the parametric coordinates inside this tetrahedron. */ - detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - r = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - s = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - t = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + r = detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + s = -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + t = detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, set the parametric coordinates for the real hexahedron and return true. */ - if((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && - ((r+s+t) <= paramLowerBound)) { - parCoor[0] = 1.0+r+s; parCoor[1] = 1.0+s+t; parCoor[2] = 1.0+r+t; + if ((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && ((r + s + t) <= paramLowerBound)) { + parCoor[0] = 1.0 + r + s; + parCoor[1] = 1.0 + s + t; + parCoor[2] = 1.0 + r + t; return true; } /* Tetrahedron, 0-1-3-4. Create the coordinates of the tetrahedron and of the point. */ - x1 = xRel[1][0]; y1 = xRel[1][1]; z1 = xRel[1][2]; - x2 = xRel[3][0]; y2 = xRel[3][1]; z2 = xRel[3][2]; - x3 = xRel[4][0]; y3 = xRel[4][1]; z3 = xRel[4][2]; - - xc = xRelC[0]; yc = xRelC[1]; zc = xRelC[2]; + x1 = xRel[1][0]; + y1 = xRel[1][1]; + z1 = xRel[1][2]; + x2 = xRel[3][0]; + y2 = xRel[3][1]; + z2 = xRel[3][2]; + x3 = xRel[4][0]; + y3 = xRel[4][1]; + z3 = xRel[4][2]; + + xc = xRelC[0]; + yc = xRelC[1]; + zc = xRelC[2]; /* Determine the parametric coordinates inside this tetrahedron. */ - detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - r = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - s = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - t = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + r = detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + s = -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + t = detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, set the parametric coordinates for the real hexahedron and return true. */ - if((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && - ((r+s+t) <= paramLowerBound)) { - parCoor[0] = r; parCoor[1] = s; parCoor[2] = t; + if ((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && ((r + s + t) <= paramLowerBound)) { + parCoor[0] = r; + parCoor[1] = s; + parCoor[2] = t; return true; } /* Tetrahedron, 7-6-4-3. Create the coordinates of the tetrahedron and of the point. */ - x1 = xRel[6][0]-xRel[7][0]; y1 = xRel[6][1]-xRel[7][1]; z1 = xRel[6][2]-xRel[7][2]; - x2 = xRel[4][0]-xRel[7][0]; y2 = xRel[4][1]-xRel[7][1]; z2 = xRel[4][2]-xRel[7][2]; - x3 = xRel[3][0]-xRel[7][0]; y3 = xRel[3][1]-xRel[7][1]; z3 = xRel[3][2]-xRel[7][2]; - - xc = xRelC[0]-xRel[7][0]; yc = xRelC[1]-xRel[7][1]; zc = xRelC[2]-xRel[7][2]; + x1 = xRel[6][0] - xRel[7][0]; + y1 = xRel[6][1] - xRel[7][1]; + z1 = xRel[6][2] - xRel[7][2]; + x2 = xRel[4][0] - xRel[7][0]; + y2 = xRel[4][1] - xRel[7][1]; + z2 = xRel[4][2] - xRel[7][2]; + x3 = xRel[3][0] - xRel[7][0]; + y3 = xRel[3][1] - xRel[7][1]; + z3 = xRel[3][2] - xRel[7][2]; + + xc = xRelC[0] - xRel[7][0]; + yc = xRelC[1] - xRel[7][1]; + zc = xRelC[2] - xRel[7][2]; /* Determine the parametric coordinates inside this tetrahedron. */ - detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - r = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - s = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - t = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + r = detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + s = -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + t = detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, set the parametric coordinates for the real hexahedron and return true. */ - if((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && - ((r+s+t) <= paramLowerBound)) { - parCoor[0] = r; parCoor[1] = 1.0 - s; parCoor[2] = 1.0 - t; + if ((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && ((r + s + t) <= paramLowerBound)) { + parCoor[0] = r; + parCoor[1] = 1.0 - s; + parCoor[2] = 1.0 - t; return true; } /* Tetrahedron, 5-4-6-1. Create the coordinates of the tetrahedron and of the point. */ - x1 = xRel[4][0]-xRel[5][0]; y1 = xRel[4][1]-xRel[5][1]; z1 = xRel[4][2]-xRel[5][2]; - x2 = xRel[6][0]-xRel[5][0]; y2 = xRel[6][1]-xRel[5][1]; z2 = xRel[6][2]-xRel[5][2]; - x3 = xRel[1][0]-xRel[5][0]; y3 = xRel[1][1]-xRel[5][1]; z3 = xRel[1][2]-xRel[5][2]; - - xc = xRelC[0]-xRel[5][0]; yc = xRelC[1]-xRel[5][1]; zc = xRelC[2]-xRel[5][2]; + x1 = xRel[4][0] - xRel[5][0]; + y1 = xRel[4][1] - xRel[5][1]; + z1 = xRel[4][2] - xRel[5][2]; + x2 = xRel[6][0] - xRel[5][0]; + y2 = xRel[6][1] - xRel[5][1]; + z2 = xRel[6][2] - xRel[5][2]; + x3 = xRel[1][0] - xRel[5][0]; + y3 = xRel[1][1] - xRel[5][1]; + z3 = xRel[1][2] - xRel[5][2]; + + xc = xRelC[0] - xRel[5][0]; + yc = xRelC[1] - xRel[5][1]; + zc = xRelC[2] - xRel[5][2]; /* Determine the parametric coordinates inside this tetrahedron. */ - detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - r = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - s = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - t = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + r = detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + s = -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + t = detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, set the parametric coordinates for the real hexahedron and return true. */ - if((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && - ((r+s+t) <= paramLowerBound)) { - parCoor[0] = 1.0 - r; parCoor[1] = s; parCoor[2] = 1.0 - t; + if ((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && ((r + s + t) <= paramLowerBound)) { + parCoor[0] = 1.0 - r; + parCoor[1] = s; + parCoor[2] = 1.0 - t; return true; } /* Tetrahedron, 2-3-1-6. Create the coordinates of the tetrahedron and of the point. */ - x1 = xRel[3][0]-xRel[2][0]; y1 = xRel[3][1]-xRel[2][1]; z1 = xRel[3][2]-xRel[2][2]; - x2 = xRel[1][0]-xRel[2][0]; y2 = xRel[1][1]-xRel[2][1]; z2 = xRel[1][2]-xRel[2][2]; - x3 = xRel[6][0]-xRel[2][0]; y3 = xRel[6][1]-xRel[2][1]; z3 = xRel[6][2]-xRel[2][2]; - - xc = xRelC[0]-xRel[2][0]; yc = xRelC[1]-xRel[2][1]; zc = xRelC[2]-xRel[2][2]; + x1 = xRel[3][0] - xRel[2][0]; + y1 = xRel[3][1] - xRel[2][1]; + z1 = xRel[3][2] - xRel[2][2]; + x2 = xRel[1][0] - xRel[2][0]; + y2 = xRel[1][1] - xRel[2][1]; + z2 = xRel[1][2] - xRel[2][2]; + x3 = xRel[6][0] - xRel[2][0]; + y3 = xRel[6][1] - xRel[2][1]; + z3 = xRel[6][2] - xRel[2][2]; + + xc = xRelC[0] - xRel[2][0]; + yc = xRelC[1] - xRel[2][1]; + zc = xRelC[2] - xRel[2][2]; /* Determine the parametric coordinates inside this tetrahedron. */ - detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - r = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - s = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - t = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + r = detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + s = -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + t = detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, set the parametric coordinates for the real hexahedron and return true. */ - if((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && - ((r+s+t) <= paramLowerBound)) { - parCoor[0] = 1.0 - r; parCoor[1] = 1.0 - s; parCoor[2] = t; + if ((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && ((r + s + t) <= paramLowerBound)) { + parCoor[0] = 1.0 - r; + parCoor[1] = 1.0 - s; + parCoor[2] = t; return true; } /* Tetrahedron, 3-4-1-6. Create the coordinates of the tetrahedron and of the point. */ - x1 = xRel[4][0]-xRel[3][0]; y1 = xRel[4][1]-xRel[3][1]; z1 = xRel[4][2]-xRel[3][2]; - x2 = xRel[1][0]-xRel[3][0]; y2 = xRel[1][1]-xRel[3][1]; z2 = xRel[1][2]-xRel[3][2]; - x3 = xRel[6][0]-xRel[3][0]; y3 = xRel[6][1]-xRel[3][1]; z3 = xRel[6][2]-xRel[3][2]; - - xc = xRelC[0]-xRel[3][0]; yc = xRelC[1]-xRel[3][1]; zc = xRelC[2]-xRel[3][2]; + x1 = xRel[4][0] - xRel[3][0]; + y1 = xRel[4][1] - xRel[3][1]; + z1 = xRel[4][2] - xRel[3][2]; + x2 = xRel[1][0] - xRel[3][0]; + y2 = xRel[1][1] - xRel[3][1]; + z2 = xRel[1][2] - xRel[3][2]; + x3 = xRel[6][0] - xRel[3][0]; + y3 = xRel[6][1] - xRel[3][1]; + z3 = xRel[6][2] - xRel[3][2]; + + xc = xRelC[0] - xRel[3][0]; + yc = xRelC[1] - xRel[3][1]; + zc = xRelC[2] - xRel[3][2]; /* Determine the parametric coordinates inside this tetrahedron. */ - detInv = 2.0/(x1*y2*z3 - x1*y3*z2 - x2*y1*z3 + x2*y3*z1 + x3*y1*z2 - x3*y2*z1); - r = detInv*(x2*y3*zc - x2*yc*z3 - x3*y2*zc + x3*yc*z2 + xc*y2*z3 - xc*y3*z2) - 1.0; - s = -detInv*(x1*y3*zc - x1*yc*z3 - x3*y1*zc + x3*yc*z1 + xc*y1*z3 - xc*y3*z1) - 1.0; - t = detInv*(x1*y2*zc - x1*yc*z2 - x2*y1*zc + x2*yc*z1 + xc*y1*z2 - xc*y2*z1) - 1.0; + detInv = 2.0 / (x1 * y2 * z3 - x1 * y3 * z2 - x2 * y1 * z3 + x2 * y3 * z1 + x3 * y1 * z2 - x3 * y2 * z1); + r = detInv * (x2 * y3 * zc - x2 * yc * z3 - x3 * y2 * zc + x3 * yc * z2 + xc * y2 * z3 - xc * y3 * z2) - 1.0; + s = -detInv * (x1 * y3 * zc - x1 * yc * z3 - x3 * y1 * zc + x3 * yc * z1 + xc * y1 * z3 - xc * y3 * z1) - 1.0; + t = detInv * (x1 * y2 * zc - x1 * yc * z2 - x2 * y1 * zc + x2 * yc * z1 + xc * y1 * z2 - xc * y2 * z1) - 1.0; /* If the point is inside this tetrahedron, set the parametric coordinates for the real hexahedron and return true. */ - if((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && - ((r+s+t) <= paramLowerBound)) { - parCoor[0] = 1.0+s+t; parCoor[1] = -1.0-r-s; parCoor[2] = 1.0+r+t; + if ((r >= paramLowerBound) && (s >= paramLowerBound) && (t >= paramLowerBound) && ((r + s + t) <= paramLowerBound)) { + parCoor[0] = 1.0 + s + t; + parCoor[1] = -1.0 - r - s; + parCoor[2] = 1.0 + r + t; return true; } @@ -1871,20 +2043,17 @@ bool CADTElemClass::InitialGuessContainmentHexahedron(const su2double xRelC[3], return false; } -void CADTElemClass::Dist2ToLine(const unsigned long i0, - const unsigned long i1, - const su2double *coor, - su2double &dist2Line) const { - +void CADTElemClass::Dist2ToLine(const unsigned long i0, const unsigned long i1, const su2double* coor, + su2double& dist2Line) const { /*--- The line is parametrized by X = X0 + (r+1)*(X1-X0)/2, -1 <= r <= 1. As a consequence the minimum distance is found where the expression |V0 - r*V1| has a minimum, where the vectors V0 and V1 are defined as: V0 = coor - (X1+X0)/2, V1 = (X1-X0)/2. First construct the vectors V0 and V1. ---*/ su2double V0[3], V1[3]; - for(unsigned short k=0; k= -1, r+s <= 0. As a consequence the minimum distance is found where @@ -1923,38 +2086,37 @@ bool CADTElemClass::Dist2ToTriangle(const unsigned long i0, and V2 are defined as: V0 = coor - (X1+X2)/2, V1 = (X1-X0)/2, V2 = (X2-X0)/2. First construct the vectors V0, V1 and V2. ---*/ su2double V0[3], V1[3], V2[3]; - for(unsigned short k=0; k= paramLowerBound) && (s >= paramLowerBound) && ((r+s) <= tolInsideElem)) { - + if ((r >= paramLowerBound) && (s >= paramLowerBound) && ((r + s) <= tolInsideElem)) { /*--- The projection of the coordinate is inside the triangle. Compute the minimum distance squared and return true. ---*/ dist2Tria = 0.0; - for(unsigned short k=0; k 10) return false; + if (itCount > 10) return false; /* Newtons algorithm did not converge, but there is a root. Do a crude approximation of the root using bisection. */ - s -= 0.5*ds; + s -= 0.5 * ds; } /* Check if s is inside the quadrilateral. If not, return false. */ - if(s < paramLowerBound || s > paramUpperBound) return false; + if (s < paramLowerBound || s > paramUpperBound) return false; /* Compute the corresponding value of r and check if it is inside the quadrilateral. If not return false. */ - const su2double s2 = s*s; + const su2double s2 = s * s; - r = (V0V1 + (V0V3-V1V2)*s - V2V3*s2)/(V1V1 + 2.0*V1V3*s + V3V3*s2); - if(r < paramLowerBound || r > paramUpperBound) return false; + r = (V0V1 + (V0V3 - V1V2) * s - V2V3 * s2) / (V1V1 + 2.0 * V1V3 * s + V3V3 * s2); + if (r < paramLowerBound || r > paramUpperBound) return false; /*--- The projection is inside the quadrilateral. Determine the minimum distance squared and return true to indicate that the projection is inside. ---*/ dist2Quad = 0.0; - for(unsigned short k=0; k recvCounts(size), displs(size); - int sizeLocal = (int) nPoints; + int sizeLocal = (int)nPoints; - SU2_MPI::Allgather(&sizeLocal, 1, MPI_INT, recvCounts.data(), 1, - MPI_INT, SU2_MPI::GetComm()); + SU2_MPI::Allgather(&sizeLocal, 1, MPI_INT, recvCounts.data(), 1, MPI_INT, SU2_MPI::GetComm()); displs[0] = 0; - for(int i=1; i rankLocal(sizeLocal, rank); - SU2_MPI::Allgatherv(rankLocal.data(), sizeLocal, MPI_INT, ranksOfPoints.data(), - recvCounts.data(), displs.data(), MPI_INT, SU2_MPI::GetComm()); + SU2_MPI::Allgatherv(rankLocal.data(), sizeLocal, MPI_INT, ranksOfPoints.data(), recvCounts.data(), displs.data(), + MPI_INT, SU2_MPI::GetComm()); /*--- Gather the coordinates of the points on all ranks. ---*/ - for(int i=0; i& frontLeaves, - vector& frontLeavesNew, - const su2double *coor, - su2double &dist, - unsigned long &pointID, - int &rankID) const { - + vector& frontLeavesNew, const su2double* coor, + su2double& dist, unsigned long& pointID, int& rankID) const { const bool wasActive = AD::BeginPassive(); /*--------------------------------------------------------------------------*/ @@ -130,15 +120,15 @@ void CADTPointsOnlyClass::DetermineNearestNode_impl(vector& front /*--------------------------------------------------------------------------*/ unsigned long kk = leaves[0].centralNodeID, minIndex; - const su2double *coorTarget = coorPoints.data() + nDimADT*kk; + const su2double* coorTarget = coorPoints.data() + nDimADT * kk; - pointID = localPointIDs[kk]; - rankID = ranksOfPoints[kk]; + pointID = localPointIDs[kk]; + rankID = ranksOfPoints[kk]; minIndex = kk; dist = 0.0; - for(unsigned short l=0; l& front frontLeaves.push_back(0); /* Infinite loop of the tree traversal. */ - for(;;) { - + for (;;) { /* Initialize the new front, i.e. the front for the next round, to empty. */ frontLeavesNew.clear(); /* Loop over the leaves of the current front. */ - for(unsigned long i=0; i leaves[kk].xMax[l]) ds = coor[l] - leaves[kk].xMax[l]; + if (coor[l] < leaves[kk].xMin[l]) + ds = coor[l] - leaves[kk].xMin[l]; + else if (coor[l] > leaves[kk].xMax[l]) + ds = coor[l] - leaves[kk].xMax[l]; - posDist += ds*ds; + posDist += ds * ds; } /*--- Check if the possible minimum distance is less than the currently stored minimum distance. If so this leaf must be stored for the next round. In that case the distance squared to the central node is determined, which is used to update the currently stored value. ---*/ - if(posDist < dist) { + if (posDist < dist) { frontLeavesNew.push_back(kk); const unsigned long jj = leaves[kk].centralNodeID; - coorTarget = coorPoints.data() + nDimADT*jj; + coorTarget = coorPoints.data() + nDimADT * jj; su2double distTarget = 0; - for(unsigned short l=0; l& front is empty the entire tree has been traversed and a break can be made from the infinite loop. ---*/ frontLeaves = frontLeavesNew; - if(frontLeaves.size() == 0) break; + if (frontLeaves.empty()) break; } AD::EndPassive(wasActive); /* Recompute the distance to get the correct dependency if we use AD */ - coorTarget = coorPoints.data() + nDimADT*minIndex; + coorTarget = coorPoints.data() + nDimADT * minIndex; dist = 0.0; - for(unsigned short l=0; l TapePositions; +TapePosition StartPosition, EndPosition; +std::vector TapePositions; - bool PreaccActive = false; +bool PreaccActive = false; #ifdef HAVE_OPDI - SU2_OMP(threadprivate(PreaccActive)) +SU2_OMP(threadprivate(PreaccActive)) #endif - bool PreaccEnabled = true; +bool PreaccEnabled = true; - codi::PreaccumulationHelper PreaccHelper; +codi::PreaccumulationHelper PreaccHelper; #ifdef HAVE_OPDI - SU2_OMP(threadprivate(PreaccHelper)) +SU2_OMP(threadprivate(PreaccHelper)) #endif - ExtFuncHelper* FuncHelper; +ExtFuncHelper FuncHelper; #endif + +void Initialize() { +#ifdef CODI_REVERSE_TYPE + FuncHelper.disableInputPrimalStore(); + FuncHelper.disableOutputPrimalStore(); +#endif } + +void Finalize() {} +} // namespace AD diff --git a/Common/src/containers/CFileReaderLUT.cpp b/Common/src/containers/CFileReaderLUT.cpp index fc0393086cc..0e1b6d569c0 100644 --- a/Common/src/containers/CFileReaderLUT.cpp +++ b/Common/src/containers/CFileReaderLUT.cpp @@ -1,8 +1,8 @@ /*! - * \file CFileReaderLUT.hpp + * \file CFileReaderLUT.cpp * \brief reading lookup table for tabulated fluid properties * \author D. Mayer, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,15 +26,16 @@ */ #include "../../Common/include/containers/CFileReaderLUT.hpp" -#include "../../Common/include/option_structure.hpp" -#include "../../Common/include/parallelization/mpi_structure.hpp" + #include "../../../Common/include/linear_algebra/blas_structure.hpp" #include "../../../Common/include/toolboxes/CSquareMatrixCM.hpp" +#include "../../Common/include/option_structure.hpp" +#include "../../Common/include/parallelization/mpi_structure.hpp" using namespace std; void CFileReaderLUT::ReadRawLUT(const string& file_name) { - version_reader = "1.0.1"; + version_reader = "1.1.0"; /*--- Store MPI rank. ---*/ rank = SU2_MPI::GetRank(); @@ -59,31 +60,82 @@ void CFileReaderLUT::ReadRawLUT(const string& file_name) { /*--- Read header ---*/ SkipToFlag(file_stream, line, "
"); - + table_dim = 2; + bool found_level_count = false; while (GetNextNonEmptyLine(file_stream, line) && !eoHeader) { - - /*--- number of points in LUT ---*/ + /*--- check version_lut ---*/ if (line.compare("[Version]") == 0) { GetNextNonEmptyLine(file_stream, line); version_lut = line; + + if (version_lut.compare("1.0.1") == 0) { + table_dim = 2; + n_levels = 1; + found_level_count = true; + n_points.resize(n_levels); + n_triangles.resize(n_levels); + n_hull_points.resize(n_levels); + } else if (version_lut.compare("1.1.0") == 0) { + table_dim = 3; + } else { + SU2_MPI::Error("Version conflict between LUT reader and LUT library file.", CURRENT_FUNCTION); + } + } + + if (line.compare("[Number of table levels]") == 0) { + found_level_count = true; + GetNextNonEmptyLine(file_stream, line); + n_levels = stoul(line); + + n_points.resize(n_levels); + n_triangles.resize(n_levels); + n_hull_points.resize(n_levels); + table_levels.resize(n_levels); } /*--- number of points in LUT ---*/ if (line.compare("[Number of points]") == 0) { - GetNextNonEmptyLine(file_stream, line); - n_points = stoi(line); + if (!found_level_count) + SU2_MPI::Error("Number of points provided before specifying level count.", CURRENT_FUNCTION); + for (unsigned long i_level = 0; i_level < n_levels; i_level++) { + GetNextNonEmptyLine(file_stream, line); + n_points[i_level] = stoi(line); + } } /*--- number of triangles in LUT ---*/ if (line.compare("[Number of triangles]") == 0) { - GetNextNonEmptyLine(file_stream, line); - n_triangles = stoi(line); + if (!found_level_count) + SU2_MPI::Error("Number of triangles provided before specifying level count.", CURRENT_FUNCTION); + for (unsigned long i_level = 0; i_level < n_levels; i_level++) { + GetNextNonEmptyLine(file_stream, line); + n_triangles[i_level] = stoi(line); + } } /*--- number of points on the hull ---*/ if (line.compare("[Number of hull points]") == 0) { - GetNextNonEmptyLine(file_stream, line); - n_hull_points = stoi(line); + if (!found_level_count) + SU2_MPI::Error("Number of hull points provided before specifying level count.", CURRENT_FUNCTION); + for (unsigned long i_level = 0; i_level < n_levels; i_level++) { + GetNextNonEmptyLine(file_stream, line); + n_hull_points[i_level] = stoi(line); + } + } + + if (line.compare("[Table levels]") == 0) { + for (unsigned long i_level = 0; i_level < n_levels; i_level++) { + GetNextNonEmptyLine(file_stream, line); + table_levels[i_level] = stod(line); + } + + /*--- Checking whether table levels are ordered and appearance of duplicates ---*/ + for (auto i_level = 0u; i_level < n_levels - 1; i_level++) { + if (table_levels[i_level] > table_levels[i_level + 1]) + SU2_MPI::Error("Table levels are not provided in ascending order.", CURRENT_FUNCTION); + } + auto duplicate = adjacent_find(table_levels.begin(), table_levels.end()) != table_levels.end(); + if (duplicate) SU2_MPI::Error("Duplicate table levels are present in LUT file", CURRENT_FUNCTION); } /*--- number of variables in LUT ---*/ @@ -94,12 +146,11 @@ void CFileReaderLUT::ReadRawLUT(const string& file_name) { /*--- variable names ---*/ if (line.compare("[Variable names]") == 0) { - - for (unsigned long i = 0; i < n_variables; i++){ - + names_var.resize(n_variables); + for (unsigned long i = 0; i < n_variables; i++) { /*--- grab a single line ---*/ GetNextNonEmptyLine(file_stream, line); - names_var.push_back(line.substr(line.find(":")+1)); + names_var[i] = line.substr(line.find(':') + 1); } } @@ -107,16 +158,14 @@ void CFileReaderLUT::ReadRawLUT(const string& file_name) { if (line.compare("
") == 0) eoHeader = true; } - /*--- check version_lut ---*/ - if (version_lut.compare(version_reader) != 0) - SU2_MPI::Error("Version conflict between LUT reader and LUT library file.", CURRENT_FUNCTION); - /*--- check header quantities ---*/ - if (n_points == 0 || n_triangles == 0 || n_variables == 0 || n_hull_points == 0) - SU2_MPI::Error( - "Number of points, triangles, hull points, or variables in lookup table " - "library header is zero.", - CURRENT_FUNCTION); + for (unsigned long i_level = 0; i_level < n_levels; i_level++) { + if (n_points[i_level] == 0 || n_triangles[i_level] == 0 || n_variables == 0 || n_hull_points[i_level] == 0) + SU2_MPI::Error( + "Number of points, triangles, hull points, or variables in lookup table " + "library header is zero.", + CURRENT_FUNCTION); + } /*--- check if number of variables is consistent ---*/ if (n_variables != names_var.size()) @@ -127,14 +176,19 @@ void CFileReaderLUT::ReadRawLUT(const string& file_name) { CURRENT_FUNCTION); /*--- now that n_variables, n_points, n_hull_points and n_variables are available, allocate memory ---*/ - if (rank == MASTER_NODE) cout << "allocating memory for the data, size = ( " << GetNVariables() << " , " << GetNPoints() << " )" << endl; - table_data.resize(GetNVariables(), GetNPoints()); + if (rank == MASTER_NODE) + cout << "allocating memory for the data, size = ( " << GetNVariables() << " , " << GetNPoints() << " )" << endl; + table_data.resize(n_levels); + for (unsigned long i_level = 0; i_level < n_levels; i_level++) + table_data[i_level].resize(GetNVariables(), GetNPoints(i_level)); - if (rank == MASTER_NODE) cout << "allocating memory for the triangles, size = "<< GetNTriangles() << endl; - triangles.resize(GetNTriangles(), 3); + if (rank == MASTER_NODE) cout << "allocating memory for the triangles, size = " << GetNTriangles() << endl; + triangles.resize(n_levels); + for (unsigned long i_level = 0; i_level < n_levels; i_level++) triangles[i_level].resize(GetNTriangles(i_level), 3); if (rank == MASTER_NODE) cout << "allocating memory for the hull points, size = " << GetNHullPoints() << endl; - hull.resize(GetNHullPoints()); + hull.resize(n_levels); + for (unsigned long i_level = 0; i_level < n_levels; i_level++) hull[i_level].resize(GetNHullPoints(i_level)); /*--- flush any cout ---*/ if (rank == MASTER_NODE) cout << endl; @@ -143,105 +197,135 @@ void CFileReaderLUT::ReadRawLUT(const string& file_name) { if (rank == MASTER_NODE) cout << "loading data block" << endl; SkipToFlag(file_stream, line, ""); - + bool eoLevel = true; unsigned long pointCounter = 0; + unsigned long levelCounter = 0; while (GetNextNonEmptyLine(file_stream, line) && !eoData) { - /*--- check if end of data is reached ---*/ if (line.compare("") == 0) eoData = true; if (!eoData) { - /*--- one line contains values for one point for all variables ---*/ - istringstream streamDataLine(line); - - /*--- add next line to table array ---*/ - for (unsigned long iVar = 0; iVar < n_variables; iVar++) { - streamDataLine >> word; - passivedouble tmp = stod(word); - table_data[iVar][pointCounter] = (su2double)tmp; + if (line.compare("") == 0) { + eoLevel = false; + pointCounter = 0; + GetNextNonEmptyLine(file_stream, line); + } + if (line.compare("") == 0) { + eoLevel = true; + if (n_points[levelCounter] != pointCounter) + SU2_MPI::Error("Number of read points on level " + std::to_string(levelCounter) + + " does not match number of points " + "specified in lookup table library header.", + CURRENT_FUNCTION); + levelCounter++; + } + if (!eoLevel || (table_dim == 2)) { + /*--- one line contains values for one point for all variables ---*/ + istringstream streamDataLine(line); + + /*--- add next line to table array ---*/ + for (unsigned long iVar = 0; iVar < n_variables; iVar++) { + streamDataLine >> word; + passivedouble tmp = stod(word); + table_data[levelCounter][iVar][pointCounter] = (su2double)tmp; + } + pointCounter++; } } - pointCounter++; } - if (n_points != pointCounter - 1) - SU2_MPI::Error( - "Number of read points does not match number of points " - "specified in lookup table library header.", - CURRENT_FUNCTION); - /*--- read connectivity ---*/ if (rank == MASTER_NODE) cout << "loading connectivity block" << endl; SkipToFlag(file_stream, line, ""); - unsigned long triCounter = 0; + eoLevel = true; + levelCounter = 0; while (GetNextNonEmptyLine(file_stream, line) && !eoConnectivity) { - if (!line.empty() && (line[line.length()-1] == '\n' || line[line.length()-1] == '\r' )) { - line.erase(line.length()-1); + if (!line.empty() && (line[line.length() - 1] == '\n' || line[line.length() - 1] == '\r')) { + line.erase(line.length() - 1); } /*--- check if end of data is reached ---*/ if (line.compare("") == 0) eoConnectivity = true; if (!eoConnectivity) { - /*--- one line contains values for one triangle (3 points) ---*/ - istringstream streamTriLine(line); - - /*--- add next line to triangles ---*/ - for (int iPoint = 0; iPoint < 3; iPoint++) { - - streamTriLine >> word; - - /*--- lookup table index starts with 1, convert to c++ indexing starting with 0: ---*/ - triangles[triCounter][iPoint] = stol(word) - 1; + if (line.compare("") == 0) { + eoLevel = false; + triCounter = 0; + GetNextNonEmptyLine(file_stream, line); + } + if (line.compare("") == 0) { + eoLevel = true; + if (n_triangles[levelCounter] != triCounter) + SU2_MPI::Error("Number of read triangles on level " + std::to_string(levelCounter) + + " does not match number of triangles " + "specified in lookup table library header.", + CURRENT_FUNCTION); + levelCounter++; + } + if (!eoLevel || (table_dim == 2)) { + /*--- one line contains values for one triangle (3 points) ---*/ + istringstream streamTriLine(line); + + /*--- add next line to triangles ---*/ + for (int iPoint = 0; iPoint < 3; iPoint++) { + streamTriLine >> word; + + /*--- lookup table index starts with 1, convert to c++ indexing starting with 0: ---*/ + triangles[levelCounter][triCounter][iPoint] = stol(word) - 1; + } + triCounter++; } } - triCounter++; } - if (n_triangles != triCounter - 1) - SU2_MPI::Error( - "Number of read triangles does not match number of points " - "specified in lookup table library header.", - CURRENT_FUNCTION); - /*--- read hull points ---*/ if (rank == MASTER_NODE) cout << "loading hull block" << endl; SkipToFlag(file_stream, line, ""); - unsigned long hullCounter = 0; + eoLevel = true; + levelCounter = 0; while (GetNextNonEmptyLine(file_stream, line) && !eoHull) { - if (!line.empty() && (line[line.length()-1] == '\n' || line[line.length()-1] == '\r' )) { - line.erase(line.length()-1); + if (!line.empty() && (line[line.length() - 1] == '\n' || line[line.length() - 1] == '\r')) { + line.erase(line.length() - 1); } /*--- check if end of data is reached ---*/ if (line.compare("") == 0) eoHull = true; if (!eoHull) { - /*--- one line contains one point ID for one point on the hull ---*/ - istringstream streamHullLine(line); + if (line.compare("") == 0) { + eoLevel = false; + hullCounter = 0; + GetNextNonEmptyLine(file_stream, line); + } + if (line.compare("") == 0) { + eoLevel = true; + if (n_hull_points[levelCounter] != hullCounter) + SU2_MPI::Error("Number of read hull nodes on level " + std::to_string(levelCounter) + + " does not match number of hull nodes " + "specified in lookup table library header.", + CURRENT_FUNCTION); + levelCounter++; + } + if (!eoLevel || (table_dim == 2)) { + /*--- one line contains one point ID for one point on the hull ---*/ + istringstream streamHullLine(line); - streamHullLine >> word; + streamHullLine >> word; - /*--- Lookup table indices start with 1, convert to c++ indexing starting with 0: ---*/ - hull[hullCounter] = stol(word) - 1; + /*--- Lookup table indices start with 1, convert to c++ indexing starting with 0: ---*/ + hull[levelCounter][hullCounter] = stol(word) - 1; + hullCounter++; + } } - hullCounter++; } - if (n_hull_points != hullCounter - 1) - SU2_MPI::Error( - "Number of read hull points does not match number of points " - "specified in lookup table library header.", - CURRENT_FUNCTION); - file_stream.close(); - } void CFileReaderLUT::SkipToFlag(ifstream& file_stream, const string& current_line, const string& flag) const { - string next_line = ""; + string next_line; /*--- compare current line to flag and return if equal ---*/ if (current_line.compare(flag) == 0) return; @@ -256,12 +340,11 @@ void CFileReaderLUT::SkipToFlag(ifstream& file_stream, const string& current_lin } bool CFileReaderLUT::GetNextNonEmptyLine(ifstream& file_stream, string& line) const { - /*--- get next line and save return value ---*/ bool return_value = GetStrippedLine(file_stream, line); /*--- skip empty lines ---*/ - while (line.empty() && !(file_stream).eof()){ + while (line.empty() && !(file_stream).eof()) { return_value = GetStrippedLine(file_stream, line); } @@ -270,16 +353,15 @@ bool CFileReaderLUT::GetNextNonEmptyLine(ifstream& file_stream, string& line) co } bool CFileReaderLUT::GetStrippedLine(ifstream& file_stream, string& line) const { + /*--- get next line and save return value ---*/ + getline(file_stream, line); - /*--- get next line and save return value ---*/ - getline(file_stream, line); - - /*--- find last non-control-character character ---*/ - size_t end = line.find_last_not_of(" \n\r\t\f\v"); + /*--- find last non-control-character character ---*/ + size_t end = line.find_last_not_of(" \n\r\t\f\v"); - /*--- clean up line ---*/ - line = (end == string::npos) ? "" : line.substr(0, end + 1); + /*--- clean up line ---*/ + line = (end == string::npos) ? "" : line.substr(0, end + 1); - /*--- return true if line is not empty, else return false ---*/ - return !line.empty(); - } \ No newline at end of file + /*--- return true if line is not empty, else return false ---*/ + return !line.empty(); +} diff --git a/Common/src/containers/CLookUpTable.cpp b/Common/src/containers/CLookUpTable.cpp index 453c7dbf123..6ec0ff247f5 100644 --- a/Common/src/containers/CLookUpTable.cpp +++ b/Common/src/containers/CLookUpTable.cpp @@ -2,7 +2,7 @@ * \file CLookupTable.cpp * \brief tabulation of fluid properties * \author D. Mayer, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -25,20 +25,22 @@ * License along with SU2. If not, see . */ +#include + #include "../../../Common/include/containers/CLookUpTable.hpp" + #include "../../../Common/include/linear_algebra/blas_structure.hpp" #include "../../../Common/include/toolboxes/CSquareMatrixCM.hpp" using namespace std; -CLookUpTable::CLookUpTable(const string& var_file_name_lut, const string& name_prog, const string& name_enth) { - file_name_lut = var_file_name_lut; - +CLookUpTable::CLookUpTable(const string& var_file_name_lut, string name_CV1_in, string name_CV2_in) + : file_name_lut{var_file_name_lut}, name_CV1{std::move(name_CV1_in)}, name_CV2{std::move(name_CV2_in)} { rank = SU2_MPI::GetRank(); LoadTableRaw(var_file_name_lut); - FindTableLimits(name_prog, name_enth); + FindTableLimits(name_CV1, name_CV2); if (rank == MASTER_NODE) cout << "Detecting all unique edges and setting edge to triangle connectivity " @@ -47,64 +49,131 @@ CLookUpTable::CLookUpTable(const string& var_file_name_lut, const string& name_p IdentifyUniqueEdges(); - if (rank == MASTER_NODE) - cout << " done." << endl; + if (rank == MASTER_NODE) cout << " done." << endl; PrintTableInfo(); - if (rank == MASTER_NODE) - cout << "Building a trapezoidal map for the (progress variable, enthalpy) " - "space ..." - << endl; - - trap_map_prog_enth = CTrapezoidalMap(GetDataP(name_prog), GetDataP(name_enth), table_data.cols(), edges, edge_to_triangle); - - if (rank == MASTER_NODE) - cout << " done." << endl; + if (rank == MASTER_NODE) switch (table_dim) { + case 2: + cout << "Building a trapezoidal map for the (" + name_CV1 + ", " + name_CV2 + + ") " + "space ..." + << endl; + break; + case 3: + cout << "Building trapezoidal map stack for the (" + name_CV1 + ", " + name_CV2 + + ") " + "space ..." + << endl; + break; + default: + break; + } - if (rank == MASTER_NODE) - cout << "Precomputing interpolation coefficients..." << endl; + trap_map_x_y.resize(n_table_levels); + su2double startTime = SU2_MPI::Wtime(); + unsigned short barwidth = 65; + bool display_map_info = (n_table_levels < 2); + double tmap_memory_footprint = 0; + for (auto i_level = 0ul; i_level < n_table_levels; i_level++) { + trap_map_x_y[i_level] = + CTrapezoidalMap(GetDataP(name_CV1, i_level), GetDataP(name_CV2, i_level), table_data[i_level].cols(), + edges[i_level], edge_to_triangle[i_level], display_map_info); + tmap_memory_footprint += trap_map_x_y[i_level].GetMemoryFootprint(); + /* Display a progress bar to monitor table generation process */ + if (rank == MASTER_NODE) { + su2double progress = su2double(i_level) / n_table_levels; + auto completed = floor(progress * barwidth); + auto to_do = barwidth - completed; + cout << "[" << setfill('=') << setw(completed); + cout << '>'; + cout << setfill(' ') << setw(to_do) << std::right << "] " << 100 * progress << "%\r"; + cout.flush(); + } + } + su2double stopTime = SU2_MPI::Wtime(); + if (rank == MASTER_NODE) { + switch (table_dim) { + case 2: + cout << "\nConstruction of trapezoidal map took " << stopTime - startTime << " seconds\n" << endl; + break; + case 3: + cout << "\nConstruction of trapezoidal map stack took " << stopTime - startTime << " seconds\n" << endl; + break; + default: + break; + } + cout << "Trapezoidal map memory footprint: " << tmap_memory_footprint << " MB\n"; + cout << "Table data memory footprint: " << memory_footprint_data << " MB\n" << endl; + } - ComputeInterpCoeffs(name_prog, name_enth); + ComputeInterpCoeffs(); - if (rank == MASTER_NODE) - cout << "LUT fluid model ready for use" << endl; + if (rank == MASTER_NODE) cout << "LUT fluid model ready for use" << endl; } void CLookUpTable::LoadTableRaw(const string& var_file_name_lut) { CFileReaderLUT file_reader; - if (rank == MASTER_NODE) - cout << "Loading lookup table, filename = " << var_file_name_lut << " ..." << endl; + if (rank == MASTER_NODE) cout << "Loading lookup table, filename = " << var_file_name_lut << " ..." << endl; file_reader.ReadRawLUT(var_file_name_lut); + table_dim = file_reader.GetTableDim(); + n_table_levels = file_reader.GetNLevels(); + + n_points.resize(n_table_levels); + n_triangles.resize(n_table_levels); + n_hull_points.resize(n_table_levels); + table_data.resize(n_table_levels); + hull.resize(n_table_levels); + triangles.resize(n_table_levels); + interp_mat_inv_x_y.resize(n_table_levels); + edges.resize(n_table_levels); + edge_to_triangle.resize(n_table_levels); + + for (unsigned long i_level = 0; i_level < n_table_levels; i_level++) { + n_points[i_level] = file_reader.GetNPoints(i_level); + n_triangles[i_level] = file_reader.GetNTriangles(i_level); + n_hull_points[i_level] = file_reader.GetNHullPoints(i_level); + table_data[i_level] = file_reader.GetTableData(i_level); + triangles[i_level] = file_reader.GetTriangles(i_level); + hull[i_level] = file_reader.GetHull(i_level); + memory_footprint_data += n_points[i_level] * sizeof(su2double); + } + memory_footprint_data /= 1e6; - n_points = file_reader.GetNPoints(); - n_triangles = file_reader.GetNTriangles(); n_variables = file_reader.GetNVariables(); - n_hull_points = file_reader.GetNHullPoints(); version_lut = file_reader.GetVersionLUT(); version_reader = file_reader.GetVersionReader(); names_var = file_reader.GetNamesVar(); - table_data = file_reader.GetTableData(); - triangles = file_reader.GetTriangles(); - hull = file_reader.GetHull(); - if (rank == MASTER_NODE) - cout << " done." << endl; + if (table_dim == 3) { + z_values_levels.resize(n_table_levels); + for (unsigned long i_level = 0; i_level < n_table_levels; i_level++) { + z_values_levels[i_level] = file_reader.GetTableLevel(i_level); + } + } + if (rank == MASTER_NODE) cout << " done." << endl; } -void CLookUpTable::FindTableLimits(const string& name_prog, const string& name_enth) { - int ixEnth = GetIndexOfVar(name_enth); - int ixProg = GetIndexOfVar(name_prog); - - /* we find the lowest and highest value of enthalpy and progress variable in the table */ - limits_table_enth[0] = *min_element(&table_data[ixEnth][0], &table_data[ixEnth][0]+table_data.cols()); - limits_table_enth[1] = *max_element(&table_data[ixEnth][0], &table_data[ixEnth][0]+table_data.cols()); - limits_table_prog[0] = *min_element(&table_data[ixProg][0], &table_data[ixProg][0]+table_data.cols()); - limits_table_prog[1] = *max_element(&table_data[ixProg][0], &table_data[ixProg][0]+table_data.cols()); +void CLookUpTable::FindTableLimits(const string& name_cv1, const string& name_cv2) { + int idx_CV1 = GetIndexOfVar(name_cv1); + int idx_CV2 = GetIndexOfVar(name_cv2); + limits_table_x.resize(n_table_levels); + limits_table_y.resize(n_table_levels); + + /* we find the lowest and highest value of y and x in the table */ + for (auto i_level = 0u; i_level < n_table_levels; i_level++) { + limits_table_y[i_level] = + minmax_element(table_data[i_level][idx_CV2], table_data[i_level][idx_CV2] + table_data[i_level].cols()); + limits_table_x[i_level] = + minmax_element(table_data[i_level][idx_CV1], table_data[i_level][idx_CV1] + table_data[i_level].cols()); + } + if (table_dim == 3) { + limits_table_z = minmax_element(z_values_levels.data(), z_values_levels.data() + z_values_levels.size()); + } } void CLookUpTable::PrintTableInfo() { @@ -117,156 +186,200 @@ void CLookUpTable::PrintTableInfo() { cout << "| File name:" << setw(54) << right << file_name_lut << " |" << endl; cout << "| Table version:" << setw(50) << right << version_lut << " |" << endl; cout << "| Table reader version:" << setw(43) << right << version_reader << " |" << endl; + cout << "| Table dimension:" << setw(48) << right << table_dim << " |" << endl; cout << "| Number of variables:" << setw(44) << right << n_variables << " |" << endl; - cout << "| Number of points:" << setw(47) << right << n_points << " |" << endl; - cout << "| Number of triangles:" << setw(44) << right << n_triangles << " |" << endl; - cout << "| Number of edges:" << setw(48) << right << edges.size() << " |" << endl; - cout << "+------------------------------------------------------------------+" << endl; - cout << "| Minimum enthalpy:" << setw(47) << right << limits_table_enth[0] << " |" << endl; - cout << "| Maximum enthalpy:" << setw(47) << right << limits_table_enth[1] << " |" << endl; - cout << "| Minimum progress variable:" << setw(38) << right << limits_table_prog[0] << " |" << endl; - cout << "| Maximum progress variable:" << setw(38) << right << limits_table_prog[1] << " |" << endl; - cout << "+------------------------------------------------------------------+" << endl; - cout << "| Variable names: |" << endl; - cout << "| |" << endl; - - for (unsigned long i_var = 0; i_var < names_var.size(); i_var++) - cout << "| " << right << setw(3) << i_var << ": " << left << setw(59) << names_var[i_var] << " |" << endl; - cout << "+------------------------------------------------------------------+" << endl; - - cout << endl; + su2double n_points_av = 0, n_tria_av = 0, n_edges_av = 0, min_x = 1 / EPS, max_x = -1 / EPS, min_y = 1 / EPS, + max_y = -1 / EPS; + for (auto i_level = 0ul; i_level < n_table_levels; i_level++) { + n_points_av += n_points[i_level] / n_table_levels; + n_tria_av += n_triangles[i_level] / n_table_levels; + n_edges_av += edges[i_level].size() / n_table_levels; + min_x = min(min_x, *limits_table_x[i_level].first); + min_y = min(min_y, *limits_table_y[i_level].first); + max_x = max(max_x, *limits_table_x[i_level].second); + max_y = max(max_y, *limits_table_y[i_level].second); + } + switch (table_dim) { + case 2: + cout << "| Number of points:" << setw(47) << right << n_points_av << " |" << endl; + cout << "| Number of triangles:" << setw(44) << right << n_tria_av << " |" << endl; + cout << "| Number of edges:" << setw(48) << right << n_edges_av << " |" << endl; + cout << "+------------------------------------------------------------------+" << endl; + cout << "| Minimum Y:" << setw(54) << right << min_y << " |" << endl; + cout << "| Maximum Y:" << setw(54) << right << max_y << " |" << endl; + cout << "| Minimum X:" << setw(54) << right << min_x << " |" << endl; + cout << "| Maximum X:" << setw(54) << right << max_x << " |" << endl; + cout << "+------------------------------------------------------------------+" << endl; + cout << "| Variable names: |" << endl; + cout << "| |" << endl; + + for (unsigned long i_var = 0; i_var < names_var.size(); i_var++) + cout << "| " << right << setw(3) << i_var << ": " << left << setw(59) << names_var[i_var] << " |" << endl; + + cout << "+------------------------------------------------------------------+" << endl; + + cout << endl; + break; + case 3: + + cout << "| Number of table levels:" << setw(41) << right << n_table_levels << " |" << endl; + cout << "| Average number of points:" << setw(39) << right << floor(n_points_av) << " |" << endl; + cout << "| Average number of triangles:" << setw(36) << right << floor(n_tria_av) << " |" << endl; + cout << "| Average number of edges:" << setw(40) << right << floor(n_edges_av) << " |" << endl; + cout << "+------------------------------------------------------------------+" << endl; + cout << "| Minimum Z:" << setw(54) << right << *limits_table_z.first << " |" << endl; + cout << "| Maximum Z:" << setw(54) << right << *limits_table_z.second << " |" << endl; + cout << "| Minimum Y:" << setw(54) << right << min_y << " |" << endl; + cout << "| Maximum Y:" << setw(54) << right << max_y << " |" << endl; + cout << "| Minimum X:" << setw(54) << right << min_x << " |" << endl; + cout << "| Maximum X:" << setw(54) << right << max_x << " |" << endl; + cout << "+------------------------------------------------------------------+" << endl; + cout << "| Variable names: |" << endl; + cout << "| |" << endl; + + for (unsigned long i_var = 0; i_var < names_var.size(); i_var++) + cout << "| " << right << setw(3) << i_var << ": " << left << setw(59) << names_var[i_var] << " |" << endl; + + cout << "+------------------------------------------------------------------+" << endl; + break; + default: + break; + } } } void CLookUpTable::IdentifyUniqueEdges() { + for (auto i_level = 0u; i_level < n_table_levels; i_level++) { + /* loop through elements and store the vector of element IDs (neighbors) + for each of the points in the table */ - /* loop through elements and store the vector of element IDs (neighbors) - for each of the points in the table */ + vector > neighborElemsOfPoint; - vector > neighborElemsOfPoint; - - neighborElemsOfPoint.resize(n_points); - for (unsigned long iElem = 0; iElem < n_triangles; iElem++) { - /* loop over 3 points per triangle */ - for (unsigned long iPoint = 0; iPoint < N_POINTS_TRIANGLE; iPoint++) { - /* get the global ID of the current point */ - const unsigned long GlobalIndex = triangles[iElem][iPoint]; + neighborElemsOfPoint.resize(n_points[i_level]); + for (unsigned long iElem = 0; iElem < n_triangles[i_level]; iElem++) { + /* loop over 3 points per triangle */ + for (unsigned long iPoint = 0; iPoint < N_POINTS_TRIANGLE; iPoint++) { + /* get the global ID of the current point */ + const unsigned long GlobalIndex = triangles[i_level][iElem][iPoint]; - /* add the current element ID to the neighbor list for this point */ - neighborElemsOfPoint[GlobalIndex].push_back(iElem); + /* add the current element ID to the neighbor list for this point */ + neighborElemsOfPoint[GlobalIndex].push_back(iElem); + } } - } - /* remove duplicates from the neighboring element lists*/ - vector::iterator vecIt; - for (unsigned long iPoint = 0; iPoint < n_points; iPoint++) { - /* sort neighboring elements for each point */ - sort(neighborElemsOfPoint[iPoint].begin(), neighborElemsOfPoint[iPoint].end()); + /* remove duplicates from the neighboring element lists*/ + vector::iterator vecIt; + for (unsigned long iPoint = 0; iPoint < n_points[i_level]; iPoint++) { + /* sort neighboring elements for each point */ + sort(neighborElemsOfPoint[iPoint].begin(), neighborElemsOfPoint[iPoint].end()); - /* uniquify list of neighboring elements */ - vecIt = unique(neighborElemsOfPoint[iPoint].begin(), neighborElemsOfPoint[iPoint].end()); + /* uniquify list of neighboring elements */ + vecIt = unique(neighborElemsOfPoint[iPoint].begin(), neighborElemsOfPoint[iPoint].end()); - /* adjust size of vector */ - neighborElemsOfPoint[iPoint].resize(vecIt - neighborElemsOfPoint[iPoint].begin()); - } - - /* loop through all neighboring elements of each point and store - the point IDs that are neighboring points */ - vector > neighborPointsOfPoint; - neighborPointsOfPoint.resize(n_points); - for (unsigned long iPoint = 0; iPoint < n_points; iPoint++) { - for (unsigned long iElem = 0; iElem < neighborElemsOfPoint[iPoint].size(); iElem++) { - /* loop over element points */ - for (unsigned long jPoint = 0; jPoint < N_POINTS_TRIANGLE; jPoint++) { - /* get the global ID of the current point */ - const unsigned long GlobalIndex = triangles[neighborElemsOfPoint[iPoint][iElem]][jPoint]; + /* adjust size of vector */ + neighborElemsOfPoint[iPoint].resize(vecIt - neighborElemsOfPoint[iPoint].begin()); + } - /* add the current element ID to the neighbor list for this point */ - if (GlobalIndex != iPoint) neighborPointsOfPoint[iPoint].push_back(GlobalIndex); + /* loop through all neighboring elements of each point and store + the point IDs that are neighboring points */ + vector > neighborPointsOfPoint; + neighborPointsOfPoint.resize(n_points[i_level]); + for (unsigned long iPoint = 0; iPoint < n_points[i_level]; iPoint++) { + for (unsigned long iElem = 0; iElem < neighborElemsOfPoint[iPoint].size(); iElem++) { + /* loop over element points */ + for (unsigned long jPoint = 0; jPoint < N_POINTS_TRIANGLE; jPoint++) { + /* get the global ID of the current point */ + const unsigned long GlobalIndex = triangles[i_level][neighborElemsOfPoint[iPoint][iElem]][jPoint]; + + /* add the current element ID to the neighbor list for this point */ + if (GlobalIndex != iPoint) neighborPointsOfPoint[iPoint].push_back(GlobalIndex); + } } } - } - /* remove duplicates from the neighboring points lists */ - for (unsigned long iPoint = 0; iPoint < n_points; iPoint++) { - /* sort neighboring points for each point */ - sort(neighborPointsOfPoint[iPoint].begin(), neighborPointsOfPoint[iPoint].end()); + /* remove duplicates from the neighboring points lists */ + for (unsigned long iPoint = 0; iPoint < n_points[i_level]; iPoint++) { + /* sort neighboring points for each point */ + sort(neighborPointsOfPoint[iPoint].begin(), neighborPointsOfPoint[iPoint].end()); - /* uniquify list of neighboring elements */ - vecIt = unique(neighborPointsOfPoint[iPoint].begin(), neighborPointsOfPoint[iPoint].end()); + /* uniquify list of neighboring elements */ + vecIt = unique(neighborPointsOfPoint[iPoint].begin(), neighborPointsOfPoint[iPoint].end()); - /* adjust size of vector */ - neighborPointsOfPoint[iPoint].resize(vecIt - neighborPointsOfPoint[iPoint].begin()); - } + /* adjust size of vector */ + neighborPointsOfPoint[iPoint].resize(vecIt - neighborPointsOfPoint[iPoint].begin()); + } - /* loop through our point neighbors and fill the vector of the unique - point pairs making up each edge in the grid. We impose a requirement - that the smaller global index is in the first position and the larger - is in the second to make for a unique set, so there's no need to - remove duplicates. */ - for (unsigned long iPoint = 0; iPoint < n_points; iPoint++) { - for (unsigned long jPoint = 0; jPoint < neighborPointsOfPoint[iPoint].size(); jPoint++) { - /* Store the neighbor index more clearly. */ - const unsigned long GlobalIndex = neighborPointsOfPoint[iPoint][jPoint]; - - /* Store the edge so that the lower index of the pair is always first. */ - if (iPoint < GlobalIndex) { - vector edge(2); - edge[0] = iPoint; - edge[1] = GlobalIndex; - edges.push_back(edge); + /* loop through our point neighbors and fill the vector of the unique + point pairs making up each edge in the grid. We impose a requirement + that the smaller global index is in the first position and the larger + is in the second to make for a unique set, so there's no need to + remove duplicates. */ + for (unsigned long iPoint = 0; iPoint < n_points[i_level]; iPoint++) { + for (unsigned long jPoint = 0; jPoint < neighborPointsOfPoint[iPoint].size(); jPoint++) { + /* Store the neighbor index more clearly. */ + const unsigned long GlobalIndex = neighborPointsOfPoint[iPoint][jPoint]; + + /* Store the edge so that the lower index of the pair is always first. */ + if (iPoint < GlobalIndex) { + std::array edge; + edge[0] = iPoint; + edge[1] = GlobalIndex; + edges[i_level].push_back(edge); + } } } - } - - /* Loop over our edges data structure. For the first point in each - pair, loop through the neighboring elements and store the two - elements that contain the second point in the edge ('left' and 'right' of the edge). */ - edge_to_triangle.resize(edges.size()); - for (unsigned long iEdge = 0; iEdge < edges.size(); iEdge++) { - /* Store the two points of the edge more clearly. */ - const unsigned long iPoint = edges[iEdge][0]; - const unsigned long jPoint = edges[iEdge][1]; - - /* Loop over all neighboring elements to iPoint. */ - for (unsigned long iElem = 0; iElem < neighborElemsOfPoint[iPoint].size(); iElem++) { - /* loop over 3 points per triangle */ - for (unsigned long kPoint = 0; kPoint < N_POINTS_TRIANGLE; kPoint++) { - /* Get the global ID of the current point. */ - const unsigned long GlobalIndex = triangles[neighborElemsOfPoint[iPoint][iElem]][kPoint]; - /* Add the current element ID to the neighbor list for this point. */ - if (GlobalIndex == jPoint) edge_to_triangle[iEdge].push_back(neighborElemsOfPoint[iPoint][iElem]); + /* Loop over our edges data structure. For the first point in each + pair, loop through the neighboring elements and store the two + elements that contain the second point in the edge ('left' and 'right' of the edge). */ + edge_to_triangle[i_level].resize(edges[i_level].size()); + for (unsigned long iEdge = 0; iEdge < edges[i_level].size(); iEdge++) { + /* Store the two points of the edge more clearly. */ + const unsigned long iPoint = edges[i_level][iEdge][0]; + const unsigned long jPoint = edges[i_level][iEdge][1]; + + /* Loop over all neighboring elements to iPoint. */ + for (unsigned long iElem = 0; iElem < neighborElemsOfPoint[iPoint].size(); iElem++) { + /* loop over 3 points per triangle */ + for (unsigned long kPoint = 0; kPoint < N_POINTS_TRIANGLE; kPoint++) { + /* Get the global ID of the current point. */ + const unsigned long GlobalIndex = triangles[i_level][neighborElemsOfPoint[iPoint][iElem]][kPoint]; + + /* Add the current element ID to the neighbor list for this point. */ + if (GlobalIndex == jPoint) edge_to_triangle[i_level][iEdge].push_back(neighborElemsOfPoint[iPoint][iElem]); + } } } } } -void CLookUpTable::ComputeInterpCoeffs(const string& name_prog, const string& name_enth) { - /* build KD tree for enthalpy, progress variable space */ +void CLookUpTable::ComputeInterpCoeffs() { + for (auto i_level = 0ul; i_level < n_table_levels; i_level++) { + /* build KD tree for y, x space */ - std::array next_triangle; + std::array next_triangle; - const su2double* prog = GetDataP(name_prog); - const su2double* enth = GetDataP(name_enth); + const su2double* val_CV1 = GetDataP(name_CV1, i_level); + const su2double* val_CV2 = GetDataP(name_CV2, i_level); - /* calculate weights for each triangle (basically a distance function) and - * build inverse interpolation matrices */ - for (unsigned long i_triangle = 0; i_triangle < n_triangles; i_triangle++) { + /* calculate weights for each triangle (basically a distance function) and + * build inverse interpolation matrices */ + interp_mat_inv_x_y[i_level].resize(n_triangles[i_level]); + for (unsigned long i_triangle = 0; i_triangle < n_triangles[i_level]; i_triangle++) { + for (int p = 0; p < 3; p++) { + next_triangle[p] = triangles[i_level][i_triangle][p]; + } - for (int p = 0; p < 3; p++) { - next_triangle[p] = triangles[i_triangle][p]; + su2activematrix x_interp_mat_inv(3, 3); + GetInterpMatInv(val_CV1, val_CV2, next_triangle, x_interp_mat_inv); + interp_mat_inv_x_y[i_level][i_triangle] = x_interp_mat_inv; } - - su2activematrix prog_interp_mat_inv(3, 3); - GetInterpMatInv(prog, enth, next_triangle, prog_interp_mat_inv); - interp_mat_inv_prog_enth.push_back(prog_interp_mat_inv); } } void CLookUpTable::GetInterpMatInv(const su2double* vec_x, const su2double* vec_y, - std::array& point_ids, su2activematrix& interp_mat_inv) { + std::array& point_ids, su2activematrix& interp_mat_inv) { const unsigned int M = 3; CSquareMatrixCM global_M(3); @@ -275,140 +388,291 @@ void CLookUpTable::GetInterpMatInv(const su2double* vec_x, const su2double* vec_ su2double x = vec_x[point_ids[i_point]]; su2double y = vec_y[point_ids[i_point]]; - global_M(i_point,0) = SU2_TYPE::GetValue(1.0); - global_M(i_point,1) = SU2_TYPE::GetValue(x); - global_M(i_point,2) = SU2_TYPE::GetValue(y); + global_M(i_point, 0) = SU2_TYPE::GetValue(1.0); + global_M(i_point, 1) = SU2_TYPE::GetValue(x); + global_M(i_point, 2) = SU2_TYPE::GetValue(y); } global_M.Invert(); global_M.Transpose(); - for (unsigned int i=0; i CLookUpTable::FindInclusionLevels(const su2double val_CV3) { + /*--- Find the table levels with constant z-values directly below and above the query value val_CV3 ---*/ + + /* Check if val_CV3 lies outside table bounds */ + if (val_CV3 >= *limits_table_z.second) { + return std::make_pair(n_table_levels - 1, n_table_levels - 1); + } else if (val_CV3 <= *limits_table_z.first) { + return std::make_pair(0, 0); + } else { + std::pair inclusion_levels; + /* Loop over table levels to find the levels directly above and below the query value */ + for (auto i_level = 0ul; i_level < n_table_levels - 1; i_level++) { + if ((val_CV3 >= z_values_levels[i_level]) && (val_CV3 < z_values_levels[i_level + 1])) { + inclusion_levels = std::make_pair(i_level, i_level + 1); + } } + return inclusion_levels; } +} + +unsigned long CLookUpTable::LookUp_XYZ(const std::string& val_name_var, su2double* val_var, su2double val_CV1, + su2double val_CV2, su2double val_CV3) { + /*--- Perform quasi-3D interpolation for a single variable named val_name_var on a query point + with coordinates val_CV1, val_CV2, and val_CV3 ---*/ + + /* 1: Find table levels directly above and below the query point (the levels that sandwhich val_CV3) */ + std::pair inclusion_levels = FindInclusionLevels(val_CV3); + bool within_z_limits = (inclusion_levels.first != inclusion_levels.second); + + if (within_z_limits) { + /* 2: Determine val_CV1 and val_CV2 for the inclusion table levels. */ + std::array, 2> lower_upper_CV1_2 = + ComputeNormalizedXY(inclusion_levels, val_CV1, val_CV2, val_CV3); + su2double val_CV1_lower = lower_upper_CV1_2[0][0], val_CV2_lower = lower_upper_CV1_2[0][1], + val_CV1_upper = lower_upper_CV1_2[1][0], val_CV2_upper = lower_upper_CV1_2[1][1]; + + /* 3: Perform 2D interpolations on upper and lower inclusion levels */ + unsigned long lower_level = inclusion_levels.first; + unsigned long upper_level = inclusion_levels.second; + + su2double val_var_lower, val_var_upper; + unsigned long exit_code_lower = LookUp_XY(val_name_var, &val_var_lower, val_CV1_lower, val_CV2_lower, lower_level); + unsigned long exit_code_upper = LookUp_XY(val_name_var, &val_var_upper, val_CV1_upper, val_CV2_upper, upper_level); + /* 4: Perform linear interpolation along the z-direction using the x-y interpolation results + from upper and lower trapezoidal maps */ + Linear_Interpolation(val_CV3, lower_level, upper_level, val_var_lower, val_var_upper, val_var); + + return max(exit_code_lower, exit_code_upper); + } else { + /* Perform single, 2D interpolation when val_CV3 lies outside table bounds */ + unsigned long bound_level = inclusion_levels.first; + LookUp_XY(val_name_var, val_var, val_CV1, val_CV2, bound_level); + return 1; + } } +unsigned long CLookUpTable::LookUp_XYZ(const std::vector& val_names_var, std::vector& val_vars, + su2double val_CV1, su2double val_CV2, su2double val_CV3) { + /*--- Perform quasi-3D interpolation for a vector of variables with names val_names_var + on a query point with coordinates val_CV1, val_CV2, and val_CV3 ---*/ + + /* 1: Find table levels directly above and below the query point (the levels that sandwhich val_CV3) */ + std::pair inclusion_levels = FindInclusionLevels(val_CV3); + bool within_z_limits = (inclusion_levels.first != inclusion_levels.second); + + if (within_z_limits) { + /* 2: Determine val_CV1 and val_CV2 for the inclusion table levels. */ + std::array, 2> lower_upper_CV1_2 = + ComputeNormalizedXY(inclusion_levels, val_CV1, val_CV2, val_CV3); + su2double val_CV1_lower = lower_upper_CV1_2[0][0], val_CV2_lower = lower_upper_CV1_2[0][1], + val_CV1_upper = lower_upper_CV1_2[1][0], val_CV2_upper = lower_upper_CV1_2[1][1]; + + /* 3: Perform 2D interpolations on upper and lower inclusion levels */ + unsigned long lower_level = inclusion_levels.first; + unsigned long upper_level = inclusion_levels.second; + + std::vector val_vars_lower, val_vars_upper; + val_vars_lower.resize(val_vars.size()); + val_vars_upper.resize(val_vars.size()); + unsigned long exit_code_lower = LookUp_XY(val_names_var, val_vars_lower, val_CV1_lower, val_CV2_lower, lower_level); + unsigned long exit_code_upper = LookUp_XY(val_names_var, val_vars_upper, val_CV1_upper, val_CV2_upper, upper_level); + + /* 4: Perform linear interpolation along the z-direction using the x-y interpolation results + from upper and lower trapezoidal maps */ + Linear_Interpolation(val_CV3, lower_level, upper_level, val_vars_lower, val_vars_upper, val_vars); + + return max(exit_code_lower, exit_code_upper); + } else { + /* Perform single, 2D interpolation when val_CV3 lies outside table bounds */ + unsigned long bound_level = inclusion_levels.first; + LookUp_XY(val_names_var, val_vars, val_CV1, val_CV2, bound_level); + return 1; + } +} + +void CLookUpTable::Linear_Interpolation(const su2double val_CV3, const unsigned long lower_level, + const unsigned long upper_level, su2double& lower_value, su2double& upper_value, + su2double*& var_val) const { + /* Perform linear interpolation along the z-direction of the table for a single variable */ -unsigned long CLookUpTable::LookUp_ProgEnth(const string& val_name_var, su2double *val_var, su2double val_prog, - su2double val_enth, const string& name_prog, const string& name_enth) { - unsigned long exit_code = 0; + /* Retrieve constant z-values of inclusion levels */ + su2double val_z_lower = z_values_levels[lower_level]; + su2double val_z_upper = z_values_levels[upper_level]; - if (val_name_var.compare("NULL") == 0) { + /* Compute linear interpolation coefficients */ + su2double factor_upper = (val_CV3 - val_z_lower) / (val_z_upper - val_z_lower); + su2double factor_lower = (val_z_upper - val_CV3) / (val_z_upper - val_z_lower); + + /* Perform linear interpolation */ + *var_val = lower_value * factor_lower + upper_value * factor_upper; +} + +void CLookUpTable::Linear_Interpolation(const su2double val_CV3, const unsigned long lower_level, + const unsigned long upper_level, std::vector& lower_values, + std::vector& upper_values, std::vector& var_vals) const { + /* Perform linear interpolation along the z-direction of the table for multiple variables */ + + /* Retrieve constant z-values of inclusion levels */ + su2double val_z_lower = z_values_levels[lower_level]; + su2double val_z_upper = z_values_levels[upper_level]; + + /* Compute linear interpolation coefficients */ + su2double factor_upper = (val_CV3 - val_z_lower) / (val_z_upper - val_z_lower); + su2double factor_lower = (val_z_upper - val_CV3) / (val_z_upper - val_z_lower); + + /* Perform linear interpolation */ + for (size_t iVar = 0; iVar < var_vals.size(); iVar++) { + var_vals[iVar] = lower_values[iVar] * factor_lower + upper_values[iVar] * factor_upper; + } +} + +std::array, 2> CLookUpTable::ComputeNormalizedXY( + std::pair& inclusion_levels, const su2double val_CV1, const su2double val_CV2, + const su2double val_CV3) { + /* Determine the values of the controlling variables of the upper and lower table levels corresponding to the + normalized query point coordinates. */ + + unsigned long lower_level = inclusion_levels.first; + unsigned long upper_level = inclusion_levels.second; + + /* Get the upper and lower limits of the first and second controlling variables on the inclusion levels. */ + su2double x_min_lower = *limits_table_x[lower_level].first, x_max_lower = *limits_table_x[lower_level].second; + su2double x_min_upper = *limits_table_x[upper_level].first, x_max_upper = *limits_table_x[upper_level].second; + su2double y_min_lower = *limits_table_y[lower_level].first, y_max_lower = *limits_table_y[lower_level].second; + su2double y_min_upper = *limits_table_y[upper_level].first, y_max_upper = *limits_table_y[upper_level].second; + + /* Interpolate the table limits to the query point coordinates. */ + su2double x_min_q = x_min_lower + (x_min_upper - x_min_lower) * (val_CV3 - z_values_levels[lower_level]) / + (z_values_levels[upper_level] - z_values_levels[lower_level] + EPS); + su2double x_max_q = x_max_lower + (x_max_upper - x_max_lower) * (val_CV3 - z_values_levels[lower_level]) / + (z_values_levels[upper_level] - z_values_levels[lower_level] + EPS); + su2double y_min_q = y_min_lower + (y_min_upper - y_min_lower) * (val_CV3 - z_values_levels[lower_level]) / + (z_values_levels[upper_level] - z_values_levels[lower_level] + EPS); + su2double y_max_q = y_max_lower + (y_max_upper - y_max_lower) * (val_CV3 - z_values_levels[lower_level]) / + (z_values_levels[upper_level] - z_values_levels[lower_level] + EPS); + + /* Compute the normalized first and second controlling variable values. */ + su2double x_norm_q = (val_CV1 - x_min_q) / (x_max_q - x_min_q); + su2double y_norm_q = (val_CV2 - y_min_q) / (y_max_q - y_min_q); + + /* De-normalize the normalized coordinates for the upper and lower table levels. */ + su2double val_CV1_upper = x_min_upper + (x_max_upper - x_min_upper) * x_norm_q; + su2double val_CV2_upper = y_min_upper + (y_max_upper - y_min_upper) * y_norm_q; + su2double val_CV1_lower = x_min_lower + (x_max_lower - x_min_lower) * x_norm_q; + su2double val_CV2_lower = y_min_lower + (y_max_lower - y_min_lower) * y_norm_q; + + /* Store coordinates in output */ + std::array, 2> lower_upper_CVs; + lower_upper_CVs[0][0] = val_CV1_lower; + lower_upper_CVs[0][1] = val_CV2_lower; + lower_upper_CVs[1][0] = val_CV1_upper; + lower_upper_CVs[1][1] = val_CV2_upper; + + return lower_upper_CVs; +} + +unsigned long CLookUpTable::LookUp_XY(const string& val_name_var, su2double* val_var, su2double val_CV1, + su2double val_CV2, unsigned long i_level) { + unsigned long exit_code = 1; + + if (noSource(val_name_var)) { *val_var = 0.0; exit_code = 0; return exit_code; } - /* check if progress variable and enthalpy value is in table range */ - if ((val_prog >= limits_table_prog[0] && val_prog <= limits_table_prog[1]) && - (val_enth >= limits_table_enth[0] && val_enth <= limits_table_enth[1])){ - - /* find the triangle that holds the (prog, enth) point */ - unsigned long id_triangle = trap_map_prog_enth.GetTriangle(val_prog, val_enth); + /* check if x and y value is in table range */ + if ((val_CV1 >= *limits_table_x[i_level].first && val_CV1 <= *limits_table_x[i_level].second) && + (val_CV2 >= *limits_table_y[i_level].first && val_CV2 <= *limits_table_y[i_level].second)) { + /* find the triangle that holds the (x, y) point */ + unsigned long id_triangle = trap_map_x_y[i_level].GetTriangle(val_CV1, val_CV2); - if (IsInTriangle(val_prog, val_enth, id_triangle, name_prog, name_enth)) { + if (IsInTriangle(val_CV1, val_CV2, id_triangle, i_level)) { /* get interpolation coefficients for point on triangle */ - std::array interp_coeffs{0}; - GetInterpCoeffs(val_prog, val_enth, interp_mat_inv_prog_enth[id_triangle], interp_coeffs); + std::array interp_coeffs{0}; + GetInterpCoeffs(val_CV1, val_CV2, interp_mat_inv_x_y[i_level][id_triangle], interp_coeffs); /* first, copy the single triangle from the large triangle list*/ - std::array triangle{0}; - for (int p = 0; p < 3; p++) - triangle[p] = triangles[id_triangle][p]; + std::array triangle{0}; + for (int p = 0; p < 3; p++) triangle[p] = triangles[i_level][id_triangle][p]; - *val_var = Interpolate(GetDataP(val_name_var), triangle, interp_coeffs); + *val_var = Interpolate(GetDataP(val_name_var, i_level), triangle, interp_coeffs); exit_code = 0; - } else { - /* in bounding box but outside of table */ - unsigned long nearest_neighbor = FindNearestNeighborOnHull(val_prog, val_enth, name_prog, name_enth); - *val_var = GetDataP(val_name_var)[nearest_neighbor]; - exit_code = 1; } - } else { - /* lookup is outside of table bounding box */ - unsigned long nearest_neighbor = FindNearestNeighborOnHull(val_prog, val_enth, name_prog, name_enth); - *val_var = GetDataP(val_name_var)[nearest_neighbor]; - exit_code = 1; } + if (exit_code == 1) InterpolateToNearestNeighbors(val_CV1, val_CV2, val_name_var, val_var, i_level); + return exit_code; } -unsigned long CLookUpTable::LookUp_ProgEnth(const vector& val_names_var, vector& val_vars, - su2double val_prog, su2double val_enth, const string& name_prog, - const string& name_enth) { - vector look_up_data; +unsigned long CLookUpTable::LookUp_XY(const vector& val_names_var, vector& val_vars, + su2double val_CV1, su2double val_CV2, unsigned long i_level) { + vector look_up_data(val_names_var.size()); for (long unsigned int i_var = 0; i_var < val_vars.size(); ++i_var) { - look_up_data.push_back(&val_vars[i_var]); + look_up_data[i_var] = &val_vars[i_var]; } - unsigned long exit_code = LookUp_ProgEnth(val_names_var, look_up_data, val_prog, val_enth, name_prog, name_enth); + unsigned long exit_code = LookUp_XY(val_names_var, look_up_data, val_CV1, val_CV2, i_level); return exit_code; } -unsigned long CLookUpTable::LookUp_ProgEnth(const vector& val_names_var, vector& val_vars, - su2double val_prog, su2double val_enth, const string& name_prog, - const string& name_enth) { - unsigned long exit_code = 0; - unsigned long nearest_neighbor = 0; - unsigned long id_triangle; - std::array interp_coeffs{0}; - std::array triangle{0}; - - /* check if progress variable value is in progress variable table range - * and if enthalpy is in enthalpy table range */ - if (val_prog >= limits_table_prog[0] && val_prog <= limits_table_prog[1] && val_enth >= limits_table_enth[0] && - val_enth <= limits_table_enth[1]) { +unsigned long CLookUpTable::LookUp_XY(const vector& val_names_var, vector& val_vars, + su2double val_CV1, su2double val_CV2, unsigned long i_level) { + unsigned long exit_code = 1; + unsigned long id_triangle = 0; + std::array interp_coeffs{0}; + std::array triangle{0}; + + /* check if x value is in table x-dimension range + * and if y is in table y-dimension table range */ + if ((val_CV1 >= *limits_table_x[i_level].first && val_CV1 <= *limits_table_x[i_level].second) && + (val_CV2 >= *limits_table_y[i_level].first && val_CV2 <= *limits_table_y[i_level].second)) { /* if so, try to find the triangle that holds the (prog, enth) point */ - id_triangle = trap_map_prog_enth.GetTriangle(val_prog, val_enth); + id_triangle = trap_map_x_y[i_level].GetTriangle(val_CV1, val_CV2); /* check if point is inside a triangle (if table domain is non-rectangular, * the previous range check might be true but the point could still be outside of the domain) */ - if (IsInTriangle(val_prog, val_enth, id_triangle, name_prog, name_enth)) { + if (IsInTriangle(val_CV1, val_CV2, id_triangle, i_level)) { /* if so, get interpolation coefficients for point in the triangle */ - GetInterpCoeffs(val_prog, val_enth, interp_mat_inv_prog_enth[id_triangle], interp_coeffs); + GetInterpCoeffs(val_CV1, val_CV2, interp_mat_inv_x_y[i_level][id_triangle], interp_coeffs); /* exit_code 0 means point was in triangle */ exit_code = 0; - - } else { - /* if point is not inside a triangle (outside table domain) search nearest neighbor */ - nearest_neighbor = FindNearestNeighborOnHull(val_prog, val_enth, name_prog, name_enth); - exit_code = 1; } - - } else { - /* if point is outside of table ranges, find nearest neighbor */ - nearest_neighbor = FindNearestNeighborOnHull(val_prog, val_enth, name_prog, name_enth); - exit_code = 1; } /* loop over variable names and interpolate / get values */ for (long unsigned int i_var = 0; i_var < val_names_var.size(); ++i_var) { - if (val_names_var[i_var].compare("NULL") == 0) { + if (noSource(val_names_var[i_var])) { *val_vars[i_var] = 0.0; + exit_code = 0; } else { - if (exit_code == 0){ - + if (exit_code == 0) { /* first, copy the single triangle from the large triangle list*/ - for (int p = 0; p < 3; p++) - triangle[p] = triangles[id_triangle][p]; - *val_vars[i_var] = Interpolate(GetDataP(val_names_var[i_var]), triangle, interp_coeffs); + for (int p = 0; p < 3; p++) triangle[p] = triangles[i_level][id_triangle][p]; + *val_vars[i_var] = Interpolate(GetDataP(val_names_var[i_var], i_level), triangle, interp_coeffs); + } else { + InterpolateToNearestNeighbors(val_CV1, val_CV2, val_names_var[i_var], val_vars[i_var], i_level); } - else - *val_vars[i_var] = GetDataP(val_names_var[i_var])[nearest_neighbor]; } } + return exit_code; } -void CLookUpTable::GetInterpCoeffs(su2double val_x, su2double val_y, su2activematrix& interp_mat_inv, - std::array& interp_coeffs) { - - std::array query_vector = {1,val_x,val_y}; +void CLookUpTable::GetInterpCoeffs(su2double val_CV1, su2double val_CV2, su2activematrix& interp_mat_inv, + std::array& interp_coeffs) { + std::array query_vector = {1, val_CV1, val_CV2}; su2double d; for (int i = 0; i < 3; i++) { @@ -420,8 +684,8 @@ void CLookUpTable::GetInterpCoeffs(su2double val_x, su2double val_y, su2activema } } -su2double CLookUpTable::Interpolate(const su2double* val_samples, std::array& val_triangle, - std::array& val_interp_coeffs) { +su2double CLookUpTable::Interpolate(const su2double* val_samples, std::array& val_triangle, + std::array& val_interp_coeffs) { su2double result = 0; su2double z = 0; @@ -433,52 +697,106 @@ su2double CLookUpTable::Interpolate(const su2double* val_samples, std::array& names_var, + std::vector& var_vals, const unsigned long i_level) { + /* Interpolate data using distance-weighted averaging on the two nearest table nodes. */ + + su2double min_distance = 1e99, second_distance = 1e99; + su2double norm_coeff_x = 1. / (*limits_table_x[i_level].second - *limits_table_x[i_level].first); + su2double norm_coeff_y = 1. / (*limits_table_y[i_level].second - *limits_table_y[i_level].first); + su2double val_CV1_norm = val_CV1 / (*limits_table_x[i_level].second - *limits_table_x[i_level].first); + su2double val_CV2_norm = val_CV2 / (*limits_table_y[i_level].second - *limits_table_y[i_level].first); + + const su2double* x_table = GetDataP(name_CV1, i_level); + const su2double* y_table = GetDataP(name_CV2, i_level); + unsigned long i_nearest = 0, i_second_nearest = 0; + + for (unsigned long i_point = 0; i_point < n_hull_points[i_level]; ++i_point) { + su2double next_x_norm = x_table[hull[i_level][i_point]] * norm_coeff_x; + su2double next_y_norm = y_table[hull[i_level][i_point]] * norm_coeff_y; + + su2double next_distance = pow(val_CV1_norm - next_x_norm, 2) + pow(val_CV2_norm - next_y_norm, 2); + + /* Check if distance to node is lower than current nearest or second nearest node. */ + if (next_distance < min_distance) { + second_distance = min_distance; + min_distance = next_distance; + + i_second_nearest = i_nearest; + i_nearest = hull[i_level][i_point]; + } else if ((next_distance > min_distance) && (next_distance < second_distance)) { + i_second_nearest = hull[i_level][i_point]; + + second_distance = next_distance; + } + } + + min_distance = sqrt(min_distance); + second_distance = sqrt(second_distance); + + /* Interpolate data using distance-weighted averaging */ + su2double delimiter = (1.0 / min_distance) + (1.0 / second_distance); + for (auto iVar = 0u; iVar < var_vals.size(); iVar++) { + su2double data_nearest = GetDataP(names_var[iVar], i_level)[i_nearest], + data_second_nearest = GetDataP(names_var[iVar], i_level)[i_second_nearest]; + *var_vals[iVar] = (data_nearest * (1.0 / min_distance) + data_second_nearest * (1.0 / second_distance)) / delimiter; + } +} + +void CLookUpTable::InterpolateToNearestNeighbors(const su2double val_CV1, const su2double val_CV2, + const std::string& name_var, su2double* var_vals, + const unsigned long i_level) { + std::vector names_var = {name_var}; + std::vector val_names_var = {var_vals}; + InterpolateToNearestNeighbors(val_CV1, val_CV2, names_var, val_names_var, i_level); +} + +bool CLookUpTable::IsInTriangle(su2double val_CV1, su2double val_CV2, unsigned long val_id_triangle, + unsigned long i_level) { + su2double tri_x_0 = GetDataP(name_CV1, i_level)[triangles[i_level][val_id_triangle][0]]; + su2double tri_y_0 = GetDataP(name_CV2, i_level)[triangles[i_level][val_id_triangle][0]]; - su2double tri_prog_1 = GetDataP(name_prog)[triangles[val_id_triangle][1]]; - su2double tri_enth_1 = GetDataP(name_enth)[triangles[val_id_triangle][1]]; + su2double tri_x_1 = GetDataP(name_CV1, i_level)[triangles[i_level][val_id_triangle][1]]; + su2double tri_y_1 = GetDataP(name_CV2, i_level)[triangles[i_level][val_id_triangle][1]]; - su2double tri_prog_2 = GetDataP(name_prog)[triangles[val_id_triangle][2]]; - su2double tri_enth_2 = GetDataP(name_enth)[triangles[val_id_triangle][2]]; + su2double tri_x_2 = GetDataP(name_CV1, i_level)[triangles[i_level][val_id_triangle][2]]; + su2double tri_y_2 = GetDataP(name_CV2, i_level)[triangles[i_level][val_id_triangle][2]]; - su2double area_tri = TriArea(tri_prog_0, tri_enth_0, tri_prog_1, tri_enth_1, tri_prog_2, tri_enth_2); + su2double area_tri = TriArea(tri_x_0, tri_y_0, tri_x_1, tri_y_1, tri_x_2, tri_y_2); - su2double area_0 = TriArea(val_prog, val_enth, tri_prog_1, tri_enth_1, tri_prog_2, tri_enth_2); - su2double area_1 = TriArea(tri_prog_0, tri_enth_0, val_prog, val_enth, tri_prog_2, tri_enth_2); - su2double area_2 = TriArea(tri_prog_0, tri_enth_0, tri_prog_1, tri_enth_1, val_prog, val_enth); + su2double area_0 = TriArea(val_CV1, val_CV2, tri_x_1, tri_y_1, tri_x_2, tri_y_2); + su2double area_1 = TriArea(tri_x_0, tri_y_0, val_CV1, val_CV2, tri_x_2, tri_y_2); + su2double area_2 = TriArea(tri_x_0, tri_y_0, tri_x_1, tri_y_1, val_CV1, val_CV2); return (abs(area_tri - (area_0 + area_1 + area_2)) < area_tri * 1e-10); } diff --git a/Common/src/containers/CTrapezoidalMap.cpp b/Common/src/containers/CTrapezoidalMap.cpp index a7087467ccd..0f964030748 100644 --- a/Common/src/containers/CTrapezoidalMap.cpp +++ b/Common/src/containers/CTrapezoidalMap.cpp @@ -2,7 +2,7 @@ * \file CTrapezoidalMap.cpp * \brief Implementation of the trapezoidal map for tabulation and lookup of fluid properties * \author D. Mayer, T. Economon, N. Beishuizen - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,6 +26,7 @@ */ #include +#include #include "../../Common/include/option_structure.hpp" #include "../../Common/include/containers/CTrapezoidalMap.hpp" @@ -38,14 +39,14 @@ using namespace std; * NOTE: the current implementation is actually the simpler 'slab' approach. */ CTrapezoidalMap::CTrapezoidalMap(const su2double* samples_x, const su2double* samples_y, const unsigned long size, - vector > const& edges, - vector > const& val_edge_to_triangle) { + vector > const& edges, + su2vector > const& val_edge_to_triangle, bool display) { int rank = SU2_MPI::GetRank(); su2double startTime = SU2_MPI::Wtime(); - edge_to_triangle = vector >(val_edge_to_triangle); + edge_to_triangle = su2vector >(val_edge_to_triangle); - unique_bands_x.assign(samples_x,samples_x+size); + unique_bands_x.assign(samples_x, samples_x + size); /* sort x_bands and make them unique */ sort(unique_bands_x.begin(), unique_bands_x.end()); @@ -74,6 +75,7 @@ CTrapezoidalMap::CTrapezoidalMap(const su2double* samples_x, const su2double* sa unsigned long n_edges = edges.size(); /* edge index */ unsigned long i_edge = 0; + unsigned long j_edge = 0; /* counter for edges intersects */ unsigned long n_intersects = 0; /* lower and upper x value of each band */ @@ -102,7 +104,7 @@ CTrapezoidalMap::CTrapezoidalMap(const su2double* samples_x, const su2double* sa * (vertical edges are automatically discarded) */ if (((edge_limits_x[i_edge][0] <= band_lower_x) and (edge_limits_x[i_edge][1] >= band_upper_x)) or ((edge_limits_x[i_edge][1] <= band_lower_x) and (edge_limits_x[i_edge][0] >= band_upper_x))) { - y_edge_at_band_mid[i_band].push_back(make_pair(0.0, 0)); + y_edge_at_band_mid[i_band].emplace_back(0.0, 0); x_0 = edge_limits_x[i_edge][0]; y_0 = edge_limits_y[i_edge][0]; @@ -131,36 +133,79 @@ CTrapezoidalMap::CTrapezoidalMap(const su2double* samples_x, const su2double* sa su2double stopTime = SU2_MPI::Wtime(); - if (rank == MASTER_NODE) cout << "Construction of trapezoidal map took " << stopTime-startTime << " seconds\n" << endl; + /* calculate size of trapezoidal map components */ + double size_unique_bands = sizeof(su2double) * unique_bands_x.size() / 1e6; + double size_edge_limits_x = sizeof(su2double) * edge_limits_x.size() * 2 / 1e6; + double size_edge_limits_y = sizeof(su2double) * edge_limits_y.size() * 2 / 1e6; + + double size_edge_to_triangle = 0; + for (i_edge = 0; i_edge < edge_to_triangle.size(); i_edge++) + for (j_edge = 0; j_edge < edge_to_triangle[i_edge].size(); j_edge++) + size_edge_to_triangle += sizeof(unsigned long) / 1e6; + + double size_y_edge_at_band_mid = 0; + for (unsigned long i_y = 0; i_y < y_edge_at_band_mid.size(); i_y++) + for (unsigned long j_y = 0; j_y < y_edge_at_band_mid[i_y].size(); j_y++) + size_y_edge_at_band_mid += sizeof(su2double) / 1e6 + sizeof(unsigned long) / 1e6; + + memory_footprint = + size_unique_bands + size_edge_limits_x + size_edge_limits_y + size_edge_to_triangle + size_y_edge_at_band_mid; + + /* print size of trapezoidal map components to screen */ + if ((rank == MASTER_NODE) && display) { + cout << setfill(' '); + cout << "\n" << endl; + cout << "+------------------------------------------------------------------+\n"; + cout << "| Trapezoidal map info |\n"; + cout << "+------------------------------------------------------------------+" << endl; + + cout << "| Time to construct trapezoidal map: " << setw(22) << right << stopTime - startTime << " sec" + << " |" << endl; + cout << "| Size of unique_bands in memory: " << setw(22) << size_unique_bands << " MB " + << " |" << endl; + cout << "| Size of edge_limits_x in memory: " << setw(22) << size_edge_limits_x << " MB " + << " |" << endl; + cout << "| Size of edge_limits_y in memory: " << setw(22) << size_edge_limits_y << " MB " + << " |" << endl; + cout << "| Size of edge_to_triangle in memory: " << setw(22) << size_edge_to_triangle << " MB " + << " |" << endl; + cout << "| Size of y_edge_at_band_mid in memory: " << setw(22) << size_y_edge_at_band_mid << " MB " + << " |" << endl; + cout << "| Total: " << setw(22) << memory_footprint << " MB " + << " |" << endl; + cout << "+------------------------------------------------------------------+" << endl; + cout << "\n" << endl; + } } - unsigned long CTrapezoidalMap::GetTriangle(su2double val_x, su2double val_y) { -//unsigned long CTrapezoidalMap::GetTriangle(su2double val_x, su2double val_y) const { /* find x band in which val_x sits */ pair band = GetBand(val_x); /* within that band, find edges which enclose the (val_x, val_y) point */ pair edges = GetEdges(band, val_x, val_y); - /* identify the triangle using the two edges */ + /* identify the adjacent triangles using the two edges */ std::array triangles_edge_low; - - for (int i=0;i<2;i++) - triangles_edge_low[i] = edge_to_triangle[edges.first][i]; + for (unsigned long i = 0; i < edge_to_triangle[edges.first].size(); i++) + triangles_edge_low[i] = edge_to_triangle[edges.first][i]; std::array triangles_edge_up; - for (int i=0;i<2;i++) - triangles_edge_up[i] = edge_to_triangle[edges.second][i]; + for (unsigned long i = 0; i < edge_to_triangle[edges.second].size(); i++) + triangles_edge_up[i] = edge_to_triangle[edges.second][i]; sort(triangles_edge_low.begin(), triangles_edge_low.end()); sort(triangles_edge_up.begin(), triangles_edge_up.end()); - // The intersection of the faces to which upper or lower belongs is - // the face that both belong to. - vector triangle(1); + /* The intersection of the faces to which upper or lower belongs is the face that both belong to. */ + vector triangle; set_intersection(triangles_edge_up.begin(), triangles_edge_up.end(), triangles_edge_low.begin(), - triangles_edge_low.end(), triangle.begin()); + triangles_edge_low.end(), std::back_inserter(triangle)); + + /*--- We failed to find an intersection, so take the lower triangle inside the band enclosing the point---*/ + if (triangle.size() < 1) { + triangle.resize(1, triangles_edge_low[0]); + } return triangle[0]; } @@ -173,18 +218,18 @@ pair CTrapezoidalMap::GetBand(su2double val_x) { if (val_x < unique_bands_x.front()) val_x = unique_bands_x.front(); if (val_x > unique_bands_x.back()) val_x = unique_bands_x.back(); - std::pair::iterator,std::vector::iterator> bounds; - bounds = std::equal_range (unique_bands_x.begin(), unique_bands_x.end(), val_x); + std::pair::iterator, std::vector::iterator> bounds; + bounds = std::equal_range(unique_bands_x.begin(), unique_bands_x.end(), val_x); /*--- if upper bound = 0, then use the range [0,1] ---*/ - i_up = max(1, bounds.first - unique_bands_x.begin()); - i_low = i_up-1; + i_up = max(1, bounds.first - unique_bands_x.begin()); + i_low = i_up - 1; return make_pair(i_low, i_up); } pair CTrapezoidalMap::GetEdges(pair val_band, - su2double val_x, su2double val_y) const{ + su2double val_x, su2double val_y) const { su2double next_y; su2double y_edge_low; su2double y_edge_up; diff --git a/Common/src/containers/meson.build b/Common/src/containers/meson.build index 9a0fdd1a1ae..4c8d4fe618a 100644 --- a/Common/src/containers/meson.build +++ b/Common/src/containers/meson.build @@ -1,3 +1,3 @@ common_src += files(['CTrapezoidalMap.cpp', - 'CFileReaderLUT.cpp', + 'CFileReaderLUT.cpp', 'CLookUpTable.cpp']) diff --git a/Common/src/fem/fem_cgns_elements.cpp b/Common/src/fem/fem_cgns_elements.cpp index 15f1e49256f..746830ad1c6 100644 --- a/Common/src/fem/fem_cgns_elements.cpp +++ b/Common/src/fem/fem_cgns_elements.cpp @@ -2,7 +2,7 @@ * \file fem_cgns_elements.cpp * \brief CGNS element definitions and conversions to the SU2 standard. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -38,20 +38,16 @@ using namespace std; #if CGNS_VERSION >= 3300 -void CCGNSElementType::DetermineMetaData(const unsigned short nDim, - const int fn, - const int iBase, - const int iZone, - const int iConn) { - +void CCGNSElementType::DetermineMetaData(const unsigned short nDim, const int fn, const int iBase, const int iZone, + const int iConn) { /* Store the connectivity ID. */ connID = iConn; /* Read the element type and range from the CGNS file. */ char cgnsname[CGNS_STRING_SIZE]; int nBndry, parentFlag; - if(cg_section_read(fn, iBase, iZone, iConn, cgnsname, &elemType, - &indBeg, &indEnd, &nBndry, &parentFlag) != CG_OK) cg_error_exit(); + if (cg_section_read(fn, iBase, iZone, iConn, cgnsname, &elemType, &indBeg, &indEnd, &nBndry, &parentFlag) != CG_OK) + cg_error_exit(); /* Store the name of this connectivity. */ connName = cgnsname; @@ -65,46 +61,40 @@ void CCGNSElementType::DetermineMetaData(const unsigned short nDim, e.g. line elements for 3D. This information is not needed for the DG flow solver and is therefore ignored. */ const unsigned short nDimElem = DetermineElementDimension(fn, iBase, iZone); - volumeConn = (nDimElem == nDim); - surfaceConn = (nDimElem == nDim-1); + volumeConn = (nDimElem == nDim); + surfaceConn = (nDimElem == nDim - 1); } -void CCGNSElementType::ReadBoundaryConnectivityRange( - const int fn, - const int iBase, - const int iZone, - const unsigned long offsetRank, - const unsigned long nBoundElemRank, - const unsigned long startingBoundElemIDRank, - unsigned long &locBoundElemCount, - vector &boundElems) { - +void CCGNSElementType::ReadBoundaryConnectivityRange(const int fn, const int iBase, const int iZone, + const unsigned long offsetRank, const unsigned long nBoundElemRank, + const unsigned long startingBoundElemIDRank, + unsigned long& locBoundElemCount, + vector& boundElems) { /* Determine the index range to be read for this rank. */ const cgsize_t iBeg = indBeg + offsetRank; - const cgsize_t iEnd = iBeg + nBoundElemRank -1; + const cgsize_t iEnd = iBeg + nBoundElemRank - 1; /* Determine the size of the vector needed to read the connectivity data from the CGNS file. */ cgsize_t sizeNeeded; - if(cg_ElementPartialSize(fn, iBase, iZone, connID, iBeg, iEnd, - &sizeNeeded) != CG_OK) cg_error_exit(); + if (cg_ElementPartialSize(fn, iBase, iZone, connID, iBeg, iEnd, &sizeNeeded) != CG_OK) cg_error_exit(); /* Allocate the memory for the connectivity and read the data. */ vector connCGNSVec(sizeNeeded); - if(elemType == MIXED){ - vector connCGNSOffsetVec(iEnd-iBeg+2); - if(cg_poly_elements_partial_read(fn, iBase, iZone, connID, iBeg, iEnd, - connCGNSVec.data(), connCGNSOffsetVec.data(), NULL) != CG_OK) + if (elemType == MIXED) { + vector connCGNSOffsetVec(iEnd - iBeg + 2); + if (cg_poly_elements_partial_read(fn, iBase, iZone, connID, iBeg, iEnd, connCGNSVec.data(), + connCGNSOffsetVec.data(), nullptr) != CG_OK) cg_error_exit(); } else { - if(cg_elements_partial_read(fn, iBase, iZone, connID, iBeg, iEnd, - connCGNSVec.data(), NULL) != CG_OK) cg_error_exit(); + if (cg_elements_partial_read(fn, iBase, iZone, connID, iBeg, iEnd, connCGNSVec.data(), nullptr) != CG_OK) + cg_error_exit(); } /* Define the variables needed to convert the connectivities from CGNS to SU2 format. Note that the vectors are needed to support a connectivity section with mixed element types. */ - vector CGNS_Type; + vector CGNS_Type; vector VTK_Type; vector nPoly; vector nDOFs; @@ -112,25 +102,23 @@ void CCGNSElementType::ReadBoundaryConnectivityRange( vector > SU2ToCGNS; /* Definition of variables used in the loop below. */ - cgsize_t *connCGNS = connCGNSVec.data(); + cgsize_t* connCGNS = connCGNSVec.data(); ElementType_t typeElem = elemType; vector connSU2; /* Loop over the elements just read. */ - for(unsigned long i=0; i connCGNSVec(sizeNeeded); if (elemType == MIXED) { - vector connCGNSOffsetVec(iEnd-iBeg+2); - if(cg_poly_elements_partial_read(fn, iBase, iZone, connID, iBeg, iEnd, - connCGNSVec.data(), connCGNSOffsetVec.data(), NULL) != CG_OK) + vector connCGNSOffsetVec(iEnd - iBeg + 2); + if (cg_poly_elements_partial_read(fn, iBase, iZone, connID, iBeg, iEnd, connCGNSVec.data(), + connCGNSOffsetVec.data(), nullptr) != CG_OK) cg_error_exit(); } else { - if(cg_elements_partial_read(fn, iBase, iZone, connID, iBeg, iEnd, - connCGNSVec.data(), NULL) != CG_OK) cg_error_exit(); + if (cg_elements_partial_read(fn, iBase, iZone, connID, iBeg, iEnd, connCGNSVec.data(), nullptr) != CG_OK) + cg_error_exit(); } /* Define the variables needed to convert the connectivities from CGNS to SU2 format. Note that the vectors are needed to support a connectivity section with mixed element types. */ - vector CGNS_Type; + vector CGNS_Type; vector VTK_Type; vector nPoly; vector nDOFs; @@ -207,25 +186,23 @@ void CCGNSElementType::ReadConnectivityRange(const int fn, vector > SU2ToCGNS; /* Definition of variables used in the loop below. */ - cgsize_t *connCGNS = connCGNSVec.data(); + cgsize_t* connCGNS = connCGNSVec.data(); ElementType_t typeElem = elemType; vector connSU2; /* Loop over the elements just read. */ - for(unsigned long i=0; i buf(sizeNeeded); vector buf_offset(2, 0); - if(cg_poly_elements_partial_read(fn, iBase, iZone, connID, indBeg, indBeg, - buf.data(), buf_offset.data(), NULL) != CG_OK) cg_error_exit(); + if (cg_poly_elements_partial_read(fn, iBase, iZone, connID, indBeg, indBeg, buf.data(), buf_offset.data(), nullptr) != + CG_OK) + cg_error_exit(); /* The first entry of buf contains the element type. Copy this value temporarily into the member variable elemType and determine the element dimension of this element. */ - elemType = (ElementType_t) buf[0]; + elemType = (ElementType_t)buf[0]; unsigned short nDimElem = DetermineElementDimension(fn, iBase, iZone); @@ -329,24 +336,19 @@ unsigned short CCGNSElementType::DetermineElementDimensionMixed(const int fn, return nDimElem; } -unsigned short CCGNSElementType::IndexInStoredTypes( - const ElementType_t typeElem, - vector &CGNS_Type, - vector &VTK_Type, - vector &nPoly, - vector &nDOFs, - vector > &SU2ToCGNS) { - +unsigned short CCGNSElementType::IndexInStoredTypes(const ElementType_t typeElem, vector& CGNS_Type, + vector& VTK_Type, vector& nPoly, + vector& nDOFs, + vector >& SU2ToCGNS) { /* Loop over the available types and check if the current type is present. If so, break the loop, such that the correct index is stored. */ unsigned short ind; - for(ind=0; ind SU2ToCGNSElem; CreateDataElementType(typeElem, VTKElem, nPolyElem, nDOFsElem, SU2ToCGNSElem); @@ -362,46 +364,99 @@ unsigned short CCGNSElementType::IndexInStoredTypes( return ind; } -void CCGNSElementType::CreateDataElementType( - const ElementType_t typeElem, - unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataElementType(const ElementType_t typeElem, unsigned short& VTK_Type, + unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /*--- Determine the element type and call the corresponding function to determine the actual data. ---*/ - switch( typeElem ) { - - case NODE: CreateDataNODE(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case BAR_2: CreateDataBAR_2(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case BAR_3: CreateDataBAR_3(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case BAR_4: CreateDataBAR_4(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case BAR_5: CreateDataBAR_5(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case TRI_3: CreateDataTRI_3(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case TRI_6: CreateDataTRI_6(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case TRI_10: CreateDataTRI_10(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case TRI_15: CreateDataTRI_15(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case QUAD_4: CreateDataQUAD_4(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case QUAD_9: CreateDataQUAD_9(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case QUAD_16: CreateDataQUAD_16(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case QUAD_25: CreateDataQUAD_25(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case TETRA_4: CreateDataTETRA_4(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case TETRA_10: CreateDataTETRA_10(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case TETRA_20: CreateDataTETRA_20(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case TETRA_35: CreateDataTETRA_35(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case PYRA_5: CreateDataPYRA_5(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case PYRA_14: CreateDataPYRA_14(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case PYRA_30: CreateDataPYRA_30(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case PYRA_55: CreateDataPYRA_55(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case PENTA_6: CreateDataPENTA_6(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case PENTA_18: CreateDataPENTA_18(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case PENTA_40: CreateDataPENTA_40(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case PENTA_75: CreateDataPENTA_75(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case HEXA_8: CreateDataHEXA_8(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case HEXA_27: CreateDataHEXA_27(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case HEXA_64: CreateDataHEXA_64(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; - case HEXA_125: CreateDataHEXA_125(VTK_Type, nPoly, nDOFs, SU2ToCGNS); break; + switch (typeElem) { + case NODE: + CreateDataNODE(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case BAR_2: + CreateDataBAR_2(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case BAR_3: + CreateDataBAR_3(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case BAR_4: + CreateDataBAR_4(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case BAR_5: + CreateDataBAR_5(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case TRI_3: + CreateDataTRI_3(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case TRI_6: + CreateDataTRI_6(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case TRI_10: + CreateDataTRI_10(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case TRI_15: + CreateDataTRI_15(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case QUAD_4: + CreateDataQUAD_4(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case QUAD_9: + CreateDataQUAD_9(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case QUAD_16: + CreateDataQUAD_16(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case QUAD_25: + CreateDataQUAD_25(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case TETRA_4: + CreateDataTETRA_4(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case TETRA_10: + CreateDataTETRA_10(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case TETRA_20: + CreateDataTETRA_20(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case TETRA_35: + CreateDataTETRA_35(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case PYRA_5: + CreateDataPYRA_5(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case PYRA_14: + CreateDataPYRA_14(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case PYRA_30: + CreateDataPYRA_30(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case PYRA_55: + CreateDataPYRA_55(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case PENTA_6: + CreateDataPENTA_6(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case PENTA_18: + CreateDataPENTA_18(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case PENTA_40: + CreateDataPENTA_40(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case PENTA_75: + CreateDataPENTA_75(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case HEXA_8: + CreateDataHEXA_8(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case HEXA_27: + CreateDataHEXA_27(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case HEXA_64: + CreateDataHEXA_64(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; + case HEXA_125: + CreateDataHEXA_125(VTK_Type, nPoly, nDOFs, SU2ToCGNS); + break; default: /* Print an error message that this element type is not supported and exit. */ @@ -416,102 +471,92 @@ void CCGNSElementType::CreateDataElementType( /*--- CGNS and SU2 format for the specific elements. ---*/ /*------------------------------------------------------------------------*/ -void CCGNSElementType::CreateDataNODE(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataNODE(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* Set the required data for a NODE. */ VTK_Type = VERTEX; - nPoly = 0; - nDOFs = 1; + nPoly = 0; + nDOFs = 1; SU2ToCGNS.push_back(0); } -void CCGNSElementType::CreateDataBAR_2(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataBAR_2(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The BAR_2 element is a linear element. The numbering of the nodes is the same for CGNS and SU2. */ VTK_Type = LINE; - nPoly = 1; - nDOFs = 2; + nPoly = 1; + nDOFs = 2; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 1; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 1; } -void CCGNSElementType::CreateDataBAR_3(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataBAR_3(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The BAR_3 element is a quadratic element. SU2 numbers to nodes with increasing parametric value, while in CGNS the internal node is numbered last. */ VTK_Type = LINE; - nPoly = 2; - nDOFs = 3; + nPoly = 2; + nDOFs = 3; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 2; SU2ToCGNS[2] = 1; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 2; + SU2ToCGNS[2] = 1; } -void CCGNSElementType::CreateDataBAR_4(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataBAR_4(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The BAR_4 element is a cubic element. SU2 numbers to nodes with increasing parametric value, while in CGNS the internal nodes are numbered last. */ VTK_Type = LINE; - nPoly = 3; - nDOFs = 4; + nPoly = 3; + nDOFs = 4; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 2; SU2ToCGNS[2] = 3; SU2ToCGNS[3] = 1; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 2; + SU2ToCGNS[2] = 3; + SU2ToCGNS[3] = 1; } -void CCGNSElementType::CreateDataBAR_5(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataBAR_5(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The BAR_5 element is a quartic element. SU2 numbers to nodes with increasing parametric value, while in CGNS the internal nodes are numbered last. */ VTK_Type = LINE; - nPoly = 4; - nDOFs = 5; + nPoly = 4; + nDOFs = 5; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 2; SU2ToCGNS[2] = 3; - SU2ToCGNS[3] = 4; SU2ToCGNS[4] = 1; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 2; + SU2ToCGNS[2] = 3; + SU2ToCGNS[3] = 4; + SU2ToCGNS[4] = 1; } -void CCGNSElementType::CreateDataTRI_3(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataTRI_3(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The TRI_3 element is a linear triangle. The node numbering is the same in SU2 and CGNS. */ VTK_Type = TRIANGLE; - nPoly = 1; - nDOFs = 3; + nPoly = 1; + nDOFs = 3; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 1; SU2ToCGNS[2] = 2; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 1; + SU2ToCGNS[2] = 2; } -void CCGNSElementType::CreateDataTRI_6(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataTRI_6(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The TRI_6 element is a quadratic triangle. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -520,19 +565,20 @@ void CCGNSElementType::CreateDataTRI_6(unsigned short &VTK_Type, where the i-direction is defined from node 0 to 1 and the j-direction from node 0 along the other edge. */ VTK_Type = TRIANGLE; - nPoly = 2; - nDOFs = 6; + nPoly = 2; + nDOFs = 6; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 3; SU2ToCGNS[2] = 1; - SU2ToCGNS[3] = 5; SU2ToCGNS[4] = 4; SU2ToCGNS[5] = 2; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 3; + SU2ToCGNS[2] = 1; + SU2ToCGNS[3] = 5; + SU2ToCGNS[4] = 4; + SU2ToCGNS[5] = 2; } -void CCGNSElementType::CreateDataTRI_10(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataTRI_10(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The TRI_10 element is a cubic triangle. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -541,20 +587,24 @@ void CCGNSElementType::CreateDataTRI_10(unsigned short &VTK_Type, where the i-direction is defined from node 0 to 1 and the j-direction from node 0 along the other edge. */ VTK_Type = TRIANGLE; - nPoly = 3; - nDOFs = 10; + nPoly = 3; + nDOFs = 10; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 3; SU2ToCGNS[2] = 4; SU2ToCGNS[3] = 1; - SU2ToCGNS[4] = 8; SU2ToCGNS[5] = 9; SU2ToCGNS[6] = 5; SU2ToCGNS[7] = 7; - SU2ToCGNS[8] = 6; SU2ToCGNS[9] = 2; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 3; + SU2ToCGNS[2] = 4; + SU2ToCGNS[3] = 1; + SU2ToCGNS[4] = 8; + SU2ToCGNS[5] = 9; + SU2ToCGNS[6] = 5; + SU2ToCGNS[7] = 7; + SU2ToCGNS[8] = 6; + SU2ToCGNS[9] = 2; } -void CCGNSElementType::CreateDataTRI_15(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataTRI_15(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The TRI_15 element is a quartic triangle. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -566,21 +616,29 @@ void CCGNSElementType::CreateDataTRI_15(unsigned short &VTK_Type, the location for uniform spacing. This effect is currently ignored, i.e. it is assumed that the spacing in parameter space is uniform. */ VTK_Type = TRIANGLE; - nPoly = 4; - nDOFs = 15; + nPoly = 4; + nDOFs = 15; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 3; SU2ToCGNS[2] = 4; SU2ToCGNS[3] = 5; - SU2ToCGNS[4] = 1; SU2ToCGNS[5] = 11; SU2ToCGNS[6] = 12; SU2ToCGNS[7] = 13; - SU2ToCGNS[8] = 6; SU2ToCGNS[9] = 10; SU2ToCGNS[10] = 14; SU2ToCGNS[11] = 7; - SU2ToCGNS[12] = 9; SU2ToCGNS[13] = 8; SU2ToCGNS[14] = 2; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 3; + SU2ToCGNS[2] = 4; + SU2ToCGNS[3] = 5; + SU2ToCGNS[4] = 1; + SU2ToCGNS[5] = 11; + SU2ToCGNS[6] = 12; + SU2ToCGNS[7] = 13; + SU2ToCGNS[8] = 6; + SU2ToCGNS[9] = 10; + SU2ToCGNS[10] = 14; + SU2ToCGNS[11] = 7; + SU2ToCGNS[12] = 9; + SU2ToCGNS[13] = 8; + SU2ToCGNS[14] = 2; } -void CCGNSElementType::CreateDataQUAD_4(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataQUAD_4(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The QUAD_4 element is a linear quadrilateral. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes (not present for QUAD_4). @@ -589,18 +647,18 @@ void CCGNSElementType::CreateDataQUAD_4(unsigned short &VTK_Type, where the i-direction is defined from node 0 to 1 and the j-direction from node 0 along the other edge. */ VTK_Type = QUADRILATERAL; - nPoly = 1; - nDOFs = 4; + nPoly = 1; + nDOFs = 4; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 1; SU2ToCGNS[2] = 3; SU2ToCGNS[3] = 2; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 1; + SU2ToCGNS[2] = 3; + SU2ToCGNS[3] = 2; } -void CCGNSElementType::CreateDataQUAD_9(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataQUAD_9(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The QUAD_9 element is a quadratic quadrilateral. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -609,20 +667,23 @@ void CCGNSElementType::CreateDataQUAD_9(unsigned short &VTK_Type, where the i-direction is defined from node 0 to 1 and the j-direction from node 0 along the other edge. */ VTK_Type = QUADRILATERAL; - nPoly = 2; - nDOFs = 9; + nPoly = 2; + nDOFs = 9; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 4; SU2ToCGNS[2] = 1; SU2ToCGNS[3] = 7; - SU2ToCGNS[4] = 8; SU2ToCGNS[5] = 5; SU2ToCGNS[6] = 3; SU2ToCGNS[7] = 6; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 4; + SU2ToCGNS[2] = 1; + SU2ToCGNS[3] = 7; + SU2ToCGNS[4] = 8; + SU2ToCGNS[5] = 5; + SU2ToCGNS[6] = 3; + SU2ToCGNS[7] = 6; SU2ToCGNS[8] = 2; } -void CCGNSElementType::CreateDataQUAD_16(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataQUAD_16(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The QUAD_16 element is a cubic quadrilateral. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -631,21 +692,30 @@ void CCGNSElementType::CreateDataQUAD_16(unsigned short &VTK_Type, where the i-direction is defined from node 0 to 1 and the j-direction from node 0 along the other edge. */ VTK_Type = QUADRILATERAL; - nPoly = 3; - nDOFs = 16; + nPoly = 3; + nDOFs = 16; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 4; SU2ToCGNS[2] = 5; SU2ToCGNS[3] = 1; - SU2ToCGNS[4] = 11; SU2ToCGNS[5] = 12; SU2ToCGNS[6] = 13; SU2ToCGNS[7] = 6; - SU2ToCGNS[8] = 10; SU2ToCGNS[9] = 15; SU2ToCGNS[10] = 14; SU2ToCGNS[11] = 7; - SU2ToCGNS[12] = 3; SU2ToCGNS[13] = 9; SU2ToCGNS[14] = 8; SU2ToCGNS[15] = 2; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 4; + SU2ToCGNS[2] = 5; + SU2ToCGNS[3] = 1; + SU2ToCGNS[4] = 11; + SU2ToCGNS[5] = 12; + SU2ToCGNS[6] = 13; + SU2ToCGNS[7] = 6; + SU2ToCGNS[8] = 10; + SU2ToCGNS[9] = 15; + SU2ToCGNS[10] = 14; + SU2ToCGNS[11] = 7; + SU2ToCGNS[12] = 3; + SU2ToCGNS[13] = 9; + SU2ToCGNS[14] = 8; + SU2ToCGNS[15] = 2; } -void CCGNSElementType::CreateDataQUAD_25(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataQUAD_25(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The QUAD_25 element is a quartic quadrilateral. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -654,39 +724,54 @@ void CCGNSElementType::CreateDataQUAD_25(unsigned short &VTK_Type, where the i-direction is defined from node 0 to 1 and the j-direction from node 0 along the other edge. */ VTK_Type = QUADRILATERAL; - nPoly = 4; - nDOFs = 25; + nPoly = 4; + nDOFs = 25; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 4; SU2ToCGNS[2] = 5; SU2ToCGNS[3] = 6; - SU2ToCGNS[4] = 1; SU2ToCGNS[5] = 15; SU2ToCGNS[6] = 16; SU2ToCGNS[7] = 17; - SU2ToCGNS[8] = 18; SU2ToCGNS[9] = 7; SU2ToCGNS[10] = 14; SU2ToCGNS[11] = 23; - SU2ToCGNS[12] = 24; SU2ToCGNS[13] = 19; SU2ToCGNS[14] = 8; SU2ToCGNS[15] = 13; - SU2ToCGNS[16] = 22; SU2ToCGNS[17] = 21; SU2ToCGNS[18] = 20; SU2ToCGNS[19] = 9; - SU2ToCGNS[20] = 3; SU2ToCGNS[21] = 12; SU2ToCGNS[22] = 11; SU2ToCGNS[23] = 10; - SU2ToCGNS[24] = 2; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 4; + SU2ToCGNS[2] = 5; + SU2ToCGNS[3] = 6; + SU2ToCGNS[4] = 1; + SU2ToCGNS[5] = 15; + SU2ToCGNS[6] = 16; + SU2ToCGNS[7] = 17; + SU2ToCGNS[8] = 18; + SU2ToCGNS[9] = 7; + SU2ToCGNS[10] = 14; + SU2ToCGNS[11] = 23; + SU2ToCGNS[12] = 24; + SU2ToCGNS[13] = 19; + SU2ToCGNS[14] = 8; + SU2ToCGNS[15] = 13; + SU2ToCGNS[16] = 22; + SU2ToCGNS[17] = 21; + SU2ToCGNS[18] = 20; + SU2ToCGNS[19] = 9; + SU2ToCGNS[20] = 3; + SU2ToCGNS[21] = 12; + SU2ToCGNS[22] = 11; + SU2ToCGNS[23] = 10; + SU2ToCGNS[24] = 2; } -void CCGNSElementType::CreateDataTETRA_4(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataTETRA_4(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The TETRA_4 element is a linear tetrahedron. The node numbering is the same in SU2 and CGNS. */ VTK_Type = TETRAHEDRON; - nPoly = 1; - nDOFs = 4; + nPoly = 1; + nDOFs = 4; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 1; SU2ToCGNS[2] = 2; SU2ToCGNS[3] = 3; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 1; + SU2ToCGNS[2] = 2; + SU2ToCGNS[3] = 3; } -void CCGNSElementType::CreateDataTETRA_10(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataTETRA_10(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The TETRA_10 element is a quadratic tetrahedron. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -697,20 +782,24 @@ void CCGNSElementType::CreateDataTETRA_10(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = TETRAHEDRON; - nPoly = 2; - nDOFs = 10; + nPoly = 2; + nDOFs = 10; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 4; SU2ToCGNS[2] = 1; SU2ToCGNS[3] = 6; - SU2ToCGNS[4] = 5; SU2ToCGNS[5] = 2; SU2ToCGNS[6] = 7; SU2ToCGNS[7] = 8; - SU2ToCGNS[8] = 9; SU2ToCGNS[9] = 3; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 4; + SU2ToCGNS[2] = 1; + SU2ToCGNS[3] = 6; + SU2ToCGNS[4] = 5; + SU2ToCGNS[5] = 2; + SU2ToCGNS[6] = 7; + SU2ToCGNS[7] = 8; + SU2ToCGNS[8] = 9; + SU2ToCGNS[9] = 3; } -void CCGNSElementType::CreateDataTETRA_20(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataTETRA_20(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The TETRA_20 element is a cubic tetrahedron. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -721,22 +810,34 @@ void CCGNSElementType::CreateDataTETRA_20(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = TETRAHEDRON; - nPoly = 3; - nDOFs = 20; + nPoly = 3; + nDOFs = 20; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 4; SU2ToCGNS[2] = 5; SU2ToCGNS[3] = 1; - SU2ToCGNS[4] = 9; SU2ToCGNS[5] = 16; SU2ToCGNS[6] = 6; SU2ToCGNS[7] = 8; - SU2ToCGNS[8] = 7; SU2ToCGNS[9] = 2; SU2ToCGNS[10] = 10; SU2ToCGNS[11] = 17; - SU2ToCGNS[12] = 12; SU2ToCGNS[13] = 19; SU2ToCGNS[14] = 18; SU2ToCGNS[15] = 14; - SU2ToCGNS[16] = 11; SU2ToCGNS[17] = 13; SU2ToCGNS[18] = 15; SU2ToCGNS[19] = 3; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 4; + SU2ToCGNS[2] = 5; + SU2ToCGNS[3] = 1; + SU2ToCGNS[4] = 9; + SU2ToCGNS[5] = 16; + SU2ToCGNS[6] = 6; + SU2ToCGNS[7] = 8; + SU2ToCGNS[8] = 7; + SU2ToCGNS[9] = 2; + SU2ToCGNS[10] = 10; + SU2ToCGNS[11] = 17; + SU2ToCGNS[12] = 12; + SU2ToCGNS[13] = 19; + SU2ToCGNS[14] = 18; + SU2ToCGNS[15] = 14; + SU2ToCGNS[16] = 11; + SU2ToCGNS[17] = 13; + SU2ToCGNS[18] = 15; + SU2ToCGNS[19] = 3; } -void CCGNSElementType::CreateDataTETRA_35(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataTETRA_35(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The TETRA_35 element is a quartic tetrahedron. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -750,26 +851,49 @@ void CCGNSElementType::CreateDataTETRA_35(unsigned short &VTK_Type, currently ignored, i.e. it is assumed that the spacing in parameter space is uniform. */ VTK_Type = TETRAHEDRON; - nPoly = 4; - nDOFs = 35; + nPoly = 4; + nDOFs = 35; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 4; SU2ToCGNS[2] = 5; SU2ToCGNS[3] = 6; - SU2ToCGNS[4] = 1; SU2ToCGNS[5] = 12; SU2ToCGNS[6] = 22; SU2ToCGNS[7] = 23; - SU2ToCGNS[8] = 7; SU2ToCGNS[9] = 11; SU2ToCGNS[10] = 24; SU2ToCGNS[11] = 8; - SU2ToCGNS[12] = 10; SU2ToCGNS[13] = 9; SU2ToCGNS[14] = 2; SU2ToCGNS[15] = 13; - SU2ToCGNS[16] = 25; SU2ToCGNS[17] = 26; SU2ToCGNS[18] = 16; SU2ToCGNS[19] = 32; - SU2ToCGNS[20] = 34; SU2ToCGNS[21] = 28; SU2ToCGNS[22] = 31; SU2ToCGNS[23] = 29; - SU2ToCGNS[24] = 19; SU2ToCGNS[25] = 14; SU2ToCGNS[26] = 27; SU2ToCGNS[27] = 17; - SU2ToCGNS[28] = 33; SU2ToCGNS[29] = 30; SU2ToCGNS[30] = 20; SU2ToCGNS[31] = 15; - SU2ToCGNS[32] = 18; SU2ToCGNS[33] = 21; SU2ToCGNS[34] = 3; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 4; + SU2ToCGNS[2] = 5; + SU2ToCGNS[3] = 6; + SU2ToCGNS[4] = 1; + SU2ToCGNS[5] = 12; + SU2ToCGNS[6] = 22; + SU2ToCGNS[7] = 23; + SU2ToCGNS[8] = 7; + SU2ToCGNS[9] = 11; + SU2ToCGNS[10] = 24; + SU2ToCGNS[11] = 8; + SU2ToCGNS[12] = 10; + SU2ToCGNS[13] = 9; + SU2ToCGNS[14] = 2; + SU2ToCGNS[15] = 13; + SU2ToCGNS[16] = 25; + SU2ToCGNS[17] = 26; + SU2ToCGNS[18] = 16; + SU2ToCGNS[19] = 32; + SU2ToCGNS[20] = 34; + SU2ToCGNS[21] = 28; + SU2ToCGNS[22] = 31; + SU2ToCGNS[23] = 29; + SU2ToCGNS[24] = 19; + SU2ToCGNS[25] = 14; + SU2ToCGNS[26] = 27; + SU2ToCGNS[27] = 17; + SU2ToCGNS[28] = 33; + SU2ToCGNS[29] = 30; + SU2ToCGNS[30] = 20; + SU2ToCGNS[31] = 15; + SU2ToCGNS[32] = 18; + SU2ToCGNS[33] = 21; + SU2ToCGNS[34] = 3; } -void CCGNSElementType::CreateDataPYRA_5(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataPYRA_5(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The PYRA_5 element is a linear pyramid. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes (not present in PYRA_5). @@ -780,19 +904,19 @@ void CCGNSElementType::CreateDataPYRA_5(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = PYRAMID; - nPoly = 1; - nDOFs = 5; + nPoly = 1; + nDOFs = 5; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 1; SU2ToCGNS[2] = 3; SU2ToCGNS[3] = 2; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 1; + SU2ToCGNS[2] = 3; + SU2ToCGNS[3] = 2; SU2ToCGNS[4] = 4; } -void CCGNSElementType::CreateDataPYRA_14(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataPYRA_14(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The PYRA_14 element is a quadratic pyramid. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -803,21 +927,28 @@ void CCGNSElementType::CreateDataPYRA_14(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = PYRAMID; - nPoly = 2; - nDOFs = 14; + nPoly = 2; + nDOFs = 14; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 5; SU2ToCGNS[2] = 1; SU2ToCGNS[3] = 8; - SU2ToCGNS[4] = 13; SU2ToCGNS[5] = 6; SU2ToCGNS[6] = 3; SU2ToCGNS[7] = 7; - SU2ToCGNS[8] = 2; SU2ToCGNS[9] = 9; SU2ToCGNS[10] = 10; SU2ToCGNS[11] = 12; - SU2ToCGNS[12] = 11; SU2ToCGNS[13] = 4; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 5; + SU2ToCGNS[2] = 1; + SU2ToCGNS[3] = 8; + SU2ToCGNS[4] = 13; + SU2ToCGNS[5] = 6; + SU2ToCGNS[6] = 3; + SU2ToCGNS[7] = 7; + SU2ToCGNS[8] = 2; + SU2ToCGNS[9] = 9; + SU2ToCGNS[10] = 10; + SU2ToCGNS[11] = 12; + SU2ToCGNS[12] = 11; + SU2ToCGNS[13] = 4; } -void CCGNSElementType::CreateDataPYRA_30(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataPYRA_30(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The PYRA_30 element is a cubic pyramid. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -828,25 +959,44 @@ void CCGNSElementType::CreateDataPYRA_30(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = PYRAMID; - nPoly = 3; - nDOFs = 30; + nPoly = 3; + nDOFs = 30; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 5; SU2ToCGNS[2] = 6; SU2ToCGNS[3] = 1; - SU2ToCGNS[4] = 12; SU2ToCGNS[5] = 21; SU2ToCGNS[6] = 22; SU2ToCGNS[7] = 7; - SU2ToCGNS[8] = 11; SU2ToCGNS[9] = 24; SU2ToCGNS[10] = 23; SU2ToCGNS[11] = 8; - SU2ToCGNS[12] = 3; SU2ToCGNS[13] = 20; SU2ToCGNS[14] = 9; SU2ToCGNS[15] = 3; - SU2ToCGNS[16] = 13; SU2ToCGNS[17] = 25; SU2ToCGNS[18] = 15; SU2ToCGNS[19] = 28; - SU2ToCGNS[20] = 29; SU2ToCGNS[21] = 26; SU2ToCGNS[22] = 19; SU2ToCGNS[23] = 27; - SU2ToCGNS[24] = 17; SU2ToCGNS[25] = 14; SU2ToCGNS[26] = 16; SU2ToCGNS[27] = 20; - SU2ToCGNS[28] = 18; SU2ToCGNS[29] = 4; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 5; + SU2ToCGNS[2] = 6; + SU2ToCGNS[3] = 1; + SU2ToCGNS[4] = 12; + SU2ToCGNS[5] = 21; + SU2ToCGNS[6] = 22; + SU2ToCGNS[7] = 7; + SU2ToCGNS[8] = 11; + SU2ToCGNS[9] = 24; + SU2ToCGNS[10] = 23; + SU2ToCGNS[11] = 8; + SU2ToCGNS[12] = 3; + SU2ToCGNS[13] = 20; + SU2ToCGNS[14] = 9; + SU2ToCGNS[15] = 3; + SU2ToCGNS[16] = 13; + SU2ToCGNS[17] = 25; + SU2ToCGNS[18] = 15; + SU2ToCGNS[19] = 28; + SU2ToCGNS[20] = 29; + SU2ToCGNS[21] = 26; + SU2ToCGNS[22] = 19; + SU2ToCGNS[23] = 27; + SU2ToCGNS[24] = 17; + SU2ToCGNS[25] = 14; + SU2ToCGNS[26] = 16; + SU2ToCGNS[27] = 20; + SU2ToCGNS[28] = 18; + SU2ToCGNS[29] = 4; } -void CCGNSElementType::CreateDataPYRA_55(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataPYRA_55(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The PYRA_55 element is a quartic pyramid. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -860,47 +1010,86 @@ void CCGNSElementType::CreateDataPYRA_55(unsigned short &VTK_Type, effect is currently ignored, i.e. it is assumed that the spacing in parameter space is uniform.*/ VTK_Type = PYRAMID; - nPoly = 4; - nDOFs = 55; + nPoly = 4; + nDOFs = 55; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 5; SU2ToCGNS[2] = 6; SU2ToCGNS[3] = 7; - SU2ToCGNS[4] = 1; SU2ToCGNS[5] = 16; SU2ToCGNS[6] = 29; SU2ToCGNS[7] = 30; - SU2ToCGNS[8] = 31; SU2ToCGNS[9] = 8; SU2ToCGNS[10] = 15; SU2ToCGNS[11] = 36; - SU2ToCGNS[12] = 37; SU2ToCGNS[13] = 32; SU2ToCGNS[14] = 9; SU2ToCGNS[15] = 14; - SU2ToCGNS[16] = 35; SU2ToCGNS[17] = 34; SU2ToCGNS[18] = 33; SU2ToCGNS[19] = 10; - SU2ToCGNS[20] = 3; SU2ToCGNS[21] = 13; SU2ToCGNS[22] = 12; SU2ToCGNS[23] = 11; - SU2ToCGNS[24] = 2; SU2ToCGNS[25] = 17; SU2ToCGNS[26] = 38; SU2ToCGNS[27] = 39; - SU2ToCGNS[28] = 20; SU2ToCGNS[29] = 48; SU2ToCGNS[30] = 50; SU2ToCGNS[31] = 51; - SU2ToCGNS[32] = 41; SU2ToCGNS[33] = 47; SU2ToCGNS[34] = 53; SU2ToCGNS[35] = 52; - SU2ToCGNS[36] = 42; SU2ToCGNS[37] = 26; SU2ToCGNS[38] = 45; SU2ToCGNS[39] = 44; - SU2ToCGNS[40] = 23; SU2ToCGNS[41] = 18; SU2ToCGNS[42] = 40; SU2ToCGNS[43] = 21; - SU2ToCGNS[44] = 49; SU2ToCGNS[45] = 54; SU2ToCGNS[46] = 43; SU2ToCGNS[47] = 27; - SU2ToCGNS[48] = 46; SU2ToCGNS[49] = 24; SU2ToCGNS[50] = 19; SU2ToCGNS[51] = 22; - SU2ToCGNS[52] = 28; SU2ToCGNS[53] = 25; SU2ToCGNS[54] = 4; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 5; + SU2ToCGNS[2] = 6; + SU2ToCGNS[3] = 7; + SU2ToCGNS[4] = 1; + SU2ToCGNS[5] = 16; + SU2ToCGNS[6] = 29; + SU2ToCGNS[7] = 30; + SU2ToCGNS[8] = 31; + SU2ToCGNS[9] = 8; + SU2ToCGNS[10] = 15; + SU2ToCGNS[11] = 36; + SU2ToCGNS[12] = 37; + SU2ToCGNS[13] = 32; + SU2ToCGNS[14] = 9; + SU2ToCGNS[15] = 14; + SU2ToCGNS[16] = 35; + SU2ToCGNS[17] = 34; + SU2ToCGNS[18] = 33; + SU2ToCGNS[19] = 10; + SU2ToCGNS[20] = 3; + SU2ToCGNS[21] = 13; + SU2ToCGNS[22] = 12; + SU2ToCGNS[23] = 11; + SU2ToCGNS[24] = 2; + SU2ToCGNS[25] = 17; + SU2ToCGNS[26] = 38; + SU2ToCGNS[27] = 39; + SU2ToCGNS[28] = 20; + SU2ToCGNS[29] = 48; + SU2ToCGNS[30] = 50; + SU2ToCGNS[31] = 51; + SU2ToCGNS[32] = 41; + SU2ToCGNS[33] = 47; + SU2ToCGNS[34] = 53; + SU2ToCGNS[35] = 52; + SU2ToCGNS[36] = 42; + SU2ToCGNS[37] = 26; + SU2ToCGNS[38] = 45; + SU2ToCGNS[39] = 44; + SU2ToCGNS[40] = 23; + SU2ToCGNS[41] = 18; + SU2ToCGNS[42] = 40; + SU2ToCGNS[43] = 21; + SU2ToCGNS[44] = 49; + SU2ToCGNS[45] = 54; + SU2ToCGNS[46] = 43; + SU2ToCGNS[47] = 27; + SU2ToCGNS[48] = 46; + SU2ToCGNS[49] = 24; + SU2ToCGNS[50] = 19; + SU2ToCGNS[51] = 22; + SU2ToCGNS[52] = 28; + SU2ToCGNS[53] = 25; + SU2ToCGNS[54] = 4; } -void CCGNSElementType::CreateDataPENTA_6(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataPENTA_6(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The PENTA_6 element is a linear prism. The node numbering is the same in SU2 and CGNS. */ VTK_Type = PRISM; - nPoly = 1; - nDOFs = 6; + nPoly = 1; + nDOFs = 6; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 1; SU2ToCGNS[2] = 2; - SU2ToCGNS[3] = 3; SU2ToCGNS[4] = 4; SU2ToCGNS[5] = 5; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 1; + SU2ToCGNS[2] = 2; + SU2ToCGNS[3] = 3; + SU2ToCGNS[4] = 4; + SU2ToCGNS[5] = 5; } -void CCGNSElementType::CreateDataPENTA_18(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataPENTA_18(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The PENTA_18 element is a quadratic prism. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -911,22 +1100,32 @@ void CCGNSElementType::CreateDataPENTA_18(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = PRISM; - nPoly = 2; - nDOFs = 18; + nPoly = 2; + nDOFs = 18; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 6; SU2ToCGNS[2] = 1; SU2ToCGNS[3] = 8; - SU2ToCGNS[4] = 7; SU2ToCGNS[5] = 2; SU2ToCGNS[6] = 9; SU2ToCGNS[7] = 15; - SU2ToCGNS[8] = 10; SU2ToCGNS[9] = 17; SU2ToCGNS[10] = 16; SU2ToCGNS[11] = 11; - SU2ToCGNS[12] = 3; SU2ToCGNS[13] = 12; SU2ToCGNS[14] = 4; SU2ToCGNS[15] = 14; - SU2ToCGNS[16] = 13; SU2ToCGNS[17] = 5; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 6; + SU2ToCGNS[2] = 1; + SU2ToCGNS[3] = 8; + SU2ToCGNS[4] = 7; + SU2ToCGNS[5] = 2; + SU2ToCGNS[6] = 9; + SU2ToCGNS[7] = 15; + SU2ToCGNS[8] = 10; + SU2ToCGNS[9] = 17; + SU2ToCGNS[10] = 16; + SU2ToCGNS[11] = 11; + SU2ToCGNS[12] = 3; + SU2ToCGNS[13] = 12; + SU2ToCGNS[14] = 4; + SU2ToCGNS[15] = 14; + SU2ToCGNS[16] = 13; + SU2ToCGNS[17] = 5; } -void CCGNSElementType::CreateDataPENTA_40(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataPENTA_40(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The PENTA_40 element is a cubic prism. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -937,27 +1136,54 @@ void CCGNSElementType::CreateDataPENTA_40(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = PRISM; - nPoly = 3; - nDOFs = 40; + nPoly = 3; + nDOFs = 40; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 6; SU2ToCGNS[2] = 7; SU2ToCGNS[3] = 1; - SU2ToCGNS[4] = 11; SU2ToCGNS[5] = 24; SU2ToCGNS[6] = 8; SU2ToCGNS[7] = 10; - SU2ToCGNS[8] = 9; SU2ToCGNS[9] = 2; SU2ToCGNS[10] = 12; SU2ToCGNS[11] = 25; - SU2ToCGNS[12] = 26; SU2ToCGNS[13] = 14; SU2ToCGNS[14] = 34; SU2ToCGNS[15] = 38; - SU2ToCGNS[16] = 29; SU2ToCGNS[17] = 33; SU2ToCGNS[18] = 30; SU2ToCGNS[19] = 16; - SU2ToCGNS[20] = 13; SU2ToCGNS[21] = 28; SU2ToCGNS[22] = 27; SU2ToCGNS[23] = 15; - SU2ToCGNS[24] = 35; SU2ToCGNS[25] = 39; SU2ToCGNS[26] = 32; SU2ToCGNS[27] = 36; - SU2ToCGNS[28] = 31; SU2ToCGNS[29] = 17; SU2ToCGNS[30] = 3; SU2ToCGNS[31] = 18; - SU2ToCGNS[32] = 19; SU2ToCGNS[33] = 4; SU2ToCGNS[34] = 23; SU2ToCGNS[35] = 37; - SU2ToCGNS[36] = 20; SU2ToCGNS[37] = 22; SU2ToCGNS[38] = 21; SU2ToCGNS[39] = 5; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 6; + SU2ToCGNS[2] = 7; + SU2ToCGNS[3] = 1; + SU2ToCGNS[4] = 11; + SU2ToCGNS[5] = 24; + SU2ToCGNS[6] = 8; + SU2ToCGNS[7] = 10; + SU2ToCGNS[8] = 9; + SU2ToCGNS[9] = 2; + SU2ToCGNS[10] = 12; + SU2ToCGNS[11] = 25; + SU2ToCGNS[12] = 26; + SU2ToCGNS[13] = 14; + SU2ToCGNS[14] = 34; + SU2ToCGNS[15] = 38; + SU2ToCGNS[16] = 29; + SU2ToCGNS[17] = 33; + SU2ToCGNS[18] = 30; + SU2ToCGNS[19] = 16; + SU2ToCGNS[20] = 13; + SU2ToCGNS[21] = 28; + SU2ToCGNS[22] = 27; + SU2ToCGNS[23] = 15; + SU2ToCGNS[24] = 35; + SU2ToCGNS[25] = 39; + SU2ToCGNS[26] = 32; + SU2ToCGNS[27] = 36; + SU2ToCGNS[28] = 31; + SU2ToCGNS[29] = 17; + SU2ToCGNS[30] = 3; + SU2ToCGNS[31] = 18; + SU2ToCGNS[32] = 19; + SU2ToCGNS[33] = 4; + SU2ToCGNS[34] = 23; + SU2ToCGNS[35] = 37; + SU2ToCGNS[36] = 20; + SU2ToCGNS[37] = 22; + SU2ToCGNS[38] = 21; + SU2ToCGNS[39] = 5; } -void CCGNSElementType::CreateDataPENTA_75(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataPENTA_75(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The PENTA_75 element is a quartic prism. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -971,36 +1197,89 @@ void CCGNSElementType::CreateDataPENTA_75(unsigned short &VTK_Type, effect is currently ignored, i.e. it is assumed that the spacing in parameter space is uniform. */ VTK_Type = PRISM; - nPoly = 4; - nDOFs = 75; + nPoly = 4; + nDOFs = 75; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 6; SU2ToCGNS[2] = 7; SU2ToCGNS[3] = 8; - SU2ToCGNS[4] = 1; SU2ToCGNS[5] = 14; SU2ToCGNS[6] = 33; SU2ToCGNS[7] = 34; - SU2ToCGNS[8] = 9; SU2ToCGNS[9] = 13; SU2ToCGNS[10] = 35; SU2ToCGNS[11] = 10; - SU2ToCGNS[12] = 12; SU2ToCGNS[13] = 11; SU2ToCGNS[14] = 2; SU2ToCGNS[15] = 15; - SU2ToCGNS[16] = 36; SU2ToCGNS[17] = 37; SU2ToCGNS[18] = 38; SU2ToCGNS[19] = 18; - SU2ToCGNS[20] = 56; SU2ToCGNS[21] = 66; SU2ToCGNS[22] = 67; SU2ToCGNS[23] = 45; - SU2ToCGNS[24] = 55; SU2ToCGNS[25] = 68; SU2ToCGNS[26] = 46; SU2ToCGNS[27] = 54; - SU2ToCGNS[28] = 47; SU2ToCGNS[29] = 21; SU2ToCGNS[30] = 16; SU2ToCGNS[31] = 43; - SU2ToCGNS[32] = 44; SU2ToCGNS[33] = 39; SU2ToCGNS[34] = 19; SU2ToCGNS[35] = 57; - SU2ToCGNS[36] = 69; SU2ToCGNS[37] = 70; SU2ToCGNS[38] = 52; SU2ToCGNS[39] = 62; - SU2ToCGNS[40] = 71; SU2ToCGNS[41] = 53; SU2ToCGNS[42] = 61; SU2ToCGNS[43] = 48; - SU2ToCGNS[44] = 22; SU2ToCGNS[45] = 17; SU2ToCGNS[46] = 42; SU2ToCGNS[47] = 41; - SU2ToCGNS[48] = 40; SU2ToCGNS[49] = 20; SU2ToCGNS[50] = 58; SU2ToCGNS[51] = 72; - SU2ToCGNS[52] = 73; SU2ToCGNS[53] = 51; SU2ToCGNS[54] = 59; SU2ToCGNS[55] = 74; - SU2ToCGNS[56] = 50; SU2ToCGNS[57] = 60; SU2ToCGNS[58] = 49; SU2ToCGNS[59] = 23; - SU2ToCGNS[60] = 3; SU2ToCGNS[61] = 24; SU2ToCGNS[62] = 25; SU2ToCGNS[63] = 26; - SU2ToCGNS[64] = 4; SU2ToCGNS[65] = 32; SU2ToCGNS[66] = 63; SU2ToCGNS[67] = 64; - SU2ToCGNS[68] = 27; SU2ToCGNS[69] = 31; SU2ToCGNS[70] = 65; SU2ToCGNS[71] = 28; - SU2ToCGNS[72] = 30; SU2ToCGNS[73] = 29; SU2ToCGNS[74] = 5; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 6; + SU2ToCGNS[2] = 7; + SU2ToCGNS[3] = 8; + SU2ToCGNS[4] = 1; + SU2ToCGNS[5] = 14; + SU2ToCGNS[6] = 33; + SU2ToCGNS[7] = 34; + SU2ToCGNS[8] = 9; + SU2ToCGNS[9] = 13; + SU2ToCGNS[10] = 35; + SU2ToCGNS[11] = 10; + SU2ToCGNS[12] = 12; + SU2ToCGNS[13] = 11; + SU2ToCGNS[14] = 2; + SU2ToCGNS[15] = 15; + SU2ToCGNS[16] = 36; + SU2ToCGNS[17] = 37; + SU2ToCGNS[18] = 38; + SU2ToCGNS[19] = 18; + SU2ToCGNS[20] = 56; + SU2ToCGNS[21] = 66; + SU2ToCGNS[22] = 67; + SU2ToCGNS[23] = 45; + SU2ToCGNS[24] = 55; + SU2ToCGNS[25] = 68; + SU2ToCGNS[26] = 46; + SU2ToCGNS[27] = 54; + SU2ToCGNS[28] = 47; + SU2ToCGNS[29] = 21; + SU2ToCGNS[30] = 16; + SU2ToCGNS[31] = 43; + SU2ToCGNS[32] = 44; + SU2ToCGNS[33] = 39; + SU2ToCGNS[34] = 19; + SU2ToCGNS[35] = 57; + SU2ToCGNS[36] = 69; + SU2ToCGNS[37] = 70; + SU2ToCGNS[38] = 52; + SU2ToCGNS[39] = 62; + SU2ToCGNS[40] = 71; + SU2ToCGNS[41] = 53; + SU2ToCGNS[42] = 61; + SU2ToCGNS[43] = 48; + SU2ToCGNS[44] = 22; + SU2ToCGNS[45] = 17; + SU2ToCGNS[46] = 42; + SU2ToCGNS[47] = 41; + SU2ToCGNS[48] = 40; + SU2ToCGNS[49] = 20; + SU2ToCGNS[50] = 58; + SU2ToCGNS[51] = 72; + SU2ToCGNS[52] = 73; + SU2ToCGNS[53] = 51; + SU2ToCGNS[54] = 59; + SU2ToCGNS[55] = 74; + SU2ToCGNS[56] = 50; + SU2ToCGNS[57] = 60; + SU2ToCGNS[58] = 49; + SU2ToCGNS[59] = 23; + SU2ToCGNS[60] = 3; + SU2ToCGNS[61] = 24; + SU2ToCGNS[62] = 25; + SU2ToCGNS[63] = 26; + SU2ToCGNS[64] = 4; + SU2ToCGNS[65] = 32; + SU2ToCGNS[66] = 63; + SU2ToCGNS[67] = 64; + SU2ToCGNS[68] = 27; + SU2ToCGNS[69] = 31; + SU2ToCGNS[70] = 65; + SU2ToCGNS[71] = 28; + SU2ToCGNS[72] = 30; + SU2ToCGNS[73] = 29; + SU2ToCGNS[74] = 5; } -void CCGNSElementType::CreateDataHEXA_8(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataHEXA_8(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The HEXA_8 element is a linear hexahedron. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes (not present in HEXA_8). @@ -1011,19 +1290,22 @@ void CCGNSElementType::CreateDataHEXA_8(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = HEXAHEDRON; - nPoly = 1; - nDOFs = 8; + nPoly = 1; + nDOFs = 8; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 1; SU2ToCGNS[2] = 3; SU2ToCGNS[3] = 2; - SU2ToCGNS[4] = 4; SU2ToCGNS[5] = 5; SU2ToCGNS[6] = 7; SU2ToCGNS[7] = 6; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 1; + SU2ToCGNS[2] = 3; + SU2ToCGNS[3] = 2; + SU2ToCGNS[4] = 4; + SU2ToCGNS[5] = 5; + SU2ToCGNS[6] = 7; + SU2ToCGNS[7] = 6; } -void CCGNSElementType::CreateDataHEXA_27(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataHEXA_27(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The HEXA_27 element is a quadratic hexahedron. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -1034,24 +1316,41 @@ void CCGNSElementType::CreateDataHEXA_27(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = HEXAHEDRON; - nPoly = 2; - nDOFs = 27; + nPoly = 2; + nDOFs = 27; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 8; SU2ToCGNS[2] = 1; SU2ToCGNS[3] = 11; - SU2ToCGNS[4] = 20; SU2ToCGNS[5] = 9; SU2ToCGNS[6] = 3; SU2ToCGNS[7] = 10; - SU2ToCGNS[8] = 2; SU2ToCGNS[9] = 12; SU2ToCGNS[10] = 21; SU2ToCGNS[11] = 13; - SU2ToCGNS[12] = 24; SU2ToCGNS[13] = 26; SU2ToCGNS[14] = 22; SU2ToCGNS[15] = 15; - SU2ToCGNS[16] = 23; SU2ToCGNS[17] = 14; SU2ToCGNS[18] = 4; SU2ToCGNS[19] = 16; - SU2ToCGNS[20] = 5; SU2ToCGNS[21] = 19; SU2ToCGNS[22] = 25; SU2ToCGNS[23] = 17; - SU2ToCGNS[24] = 7; SU2ToCGNS[25] = 18; SU2ToCGNS[26] = 6; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 8; + SU2ToCGNS[2] = 1; + SU2ToCGNS[3] = 11; + SU2ToCGNS[4] = 20; + SU2ToCGNS[5] = 9; + SU2ToCGNS[6] = 3; + SU2ToCGNS[7] = 10; + SU2ToCGNS[8] = 2; + SU2ToCGNS[9] = 12; + SU2ToCGNS[10] = 21; + SU2ToCGNS[11] = 13; + SU2ToCGNS[12] = 24; + SU2ToCGNS[13] = 26; + SU2ToCGNS[14] = 22; + SU2ToCGNS[15] = 15; + SU2ToCGNS[16] = 23; + SU2ToCGNS[17] = 14; + SU2ToCGNS[18] = 4; + SU2ToCGNS[19] = 16; + SU2ToCGNS[20] = 5; + SU2ToCGNS[21] = 19; + SU2ToCGNS[22] = 25; + SU2ToCGNS[23] = 17; + SU2ToCGNS[24] = 7; + SU2ToCGNS[25] = 18; + SU2ToCGNS[26] = 6; } -void CCGNSElementType::CreateDataHEXA_64(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataHEXA_64(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The HEXA_64 element is a cubic hexahedron. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -1062,33 +1361,78 @@ void CCGNSElementType::CreateDataHEXA_64(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = HEXAHEDRON; - nPoly = 3; - nDOFs = 64; + nPoly = 3; + nDOFs = 64; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 8; SU2ToCGNS[2] = 9; SU2ToCGNS[3] = 1; - SU2ToCGNS[4] = 15; SU2ToCGNS[5] = 32; SU2ToCGNS[6] = 33; SU2ToCGNS[7] = 10; - SU2ToCGNS[8] = 14; SU2ToCGNS[9] = 35; SU2ToCGNS[10] = 34; SU2ToCGNS[11] = 11; - SU2ToCGNS[12] = 3; SU2ToCGNS[13] = 13; SU2ToCGNS[14] = 12; SU2ToCGNS[15] = 2; - SU2ToCGNS[16] = 16; SU2ToCGNS[17] = 36; SU2ToCGNS[18] = 37; SU2ToCGNS[19] = 18; - SU2ToCGNS[20] = 49; SU2ToCGNS[21] = 56; SU2ToCGNS[22] = 57; SU2ToCGNS[23] = 40; - SU2ToCGNS[24] = 48; SU2ToCGNS[25] = 59; SU2ToCGNS[26] = 58; SU2ToCGNS[27] = 41; - SU2ToCGNS[28] = 22; SU2ToCGNS[29] = 45; SU2ToCGNS[30] = 44; SU2ToCGNS[31] = 20; - SU2ToCGNS[32] = 17; SU2ToCGNS[33] = 39; SU2ToCGNS[34] = 38; SU2ToCGNS[35] = 19; - SU2ToCGNS[36] = 50; SU2ToCGNS[37] = 60; SU2ToCGNS[38] = 61; SU2ToCGNS[39] = 43; - SU2ToCGNS[40] = 51; SU2ToCGNS[41] = 63; SU2ToCGNS[42] = 62; SU2ToCGNS[43] = 42; - SU2ToCGNS[44] = 23; SU2ToCGNS[45] = 46; SU2ToCGNS[46] = 47; SU2ToCGNS[47] = 21; - SU2ToCGNS[48] = 4; SU2ToCGNS[49] = 24; SU2ToCGNS[50] = 25; SU2ToCGNS[51] = 5; - SU2ToCGNS[52] = 31; SU2ToCGNS[53] = 52; SU2ToCGNS[54] = 53; SU2ToCGNS[55] = 26; - SU2ToCGNS[56] = 30; SU2ToCGNS[57] = 55; SU2ToCGNS[58] = 54; SU2ToCGNS[59] = 27; - SU2ToCGNS[60] = 7; SU2ToCGNS[61] = 29; SU2ToCGNS[62] = 28; SU2ToCGNS[63] = 6; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 8; + SU2ToCGNS[2] = 9; + SU2ToCGNS[3] = 1; + SU2ToCGNS[4] = 15; + SU2ToCGNS[5] = 32; + SU2ToCGNS[6] = 33; + SU2ToCGNS[7] = 10; + SU2ToCGNS[8] = 14; + SU2ToCGNS[9] = 35; + SU2ToCGNS[10] = 34; + SU2ToCGNS[11] = 11; + SU2ToCGNS[12] = 3; + SU2ToCGNS[13] = 13; + SU2ToCGNS[14] = 12; + SU2ToCGNS[15] = 2; + SU2ToCGNS[16] = 16; + SU2ToCGNS[17] = 36; + SU2ToCGNS[18] = 37; + SU2ToCGNS[19] = 18; + SU2ToCGNS[20] = 49; + SU2ToCGNS[21] = 56; + SU2ToCGNS[22] = 57; + SU2ToCGNS[23] = 40; + SU2ToCGNS[24] = 48; + SU2ToCGNS[25] = 59; + SU2ToCGNS[26] = 58; + SU2ToCGNS[27] = 41; + SU2ToCGNS[28] = 22; + SU2ToCGNS[29] = 45; + SU2ToCGNS[30] = 44; + SU2ToCGNS[31] = 20; + SU2ToCGNS[32] = 17; + SU2ToCGNS[33] = 39; + SU2ToCGNS[34] = 38; + SU2ToCGNS[35] = 19; + SU2ToCGNS[36] = 50; + SU2ToCGNS[37] = 60; + SU2ToCGNS[38] = 61; + SU2ToCGNS[39] = 43; + SU2ToCGNS[40] = 51; + SU2ToCGNS[41] = 63; + SU2ToCGNS[42] = 62; + SU2ToCGNS[43] = 42; + SU2ToCGNS[44] = 23; + SU2ToCGNS[45] = 46; + SU2ToCGNS[46] = 47; + SU2ToCGNS[47] = 21; + SU2ToCGNS[48] = 4; + SU2ToCGNS[49] = 24; + SU2ToCGNS[50] = 25; + SU2ToCGNS[51] = 5; + SU2ToCGNS[52] = 31; + SU2ToCGNS[53] = 52; + SU2ToCGNS[54] = 53; + SU2ToCGNS[55] = 26; + SU2ToCGNS[56] = 30; + SU2ToCGNS[57] = 55; + SU2ToCGNS[58] = 54; + SU2ToCGNS[59] = 27; + SU2ToCGNS[60] = 7; + SU2ToCGNS[61] = 29; + SU2ToCGNS[62] = 28; + SU2ToCGNS[63] = 6; } -void CCGNSElementType::CreateDataHEXA_125(unsigned short &VTK_Type, - unsigned short &nPoly, - unsigned short &nDOFs, - vector &SU2ToCGNS) { - +void CCGNSElementType::CreateDataHEXA_125(unsigned short& VTK_Type, unsigned short& nPoly, unsigned short& nDOFs, + vector& SU2ToCGNS) { /* The HEXA_125 element is a quartic hexahedron. In CGNS the nodes are numbered as follows: - First the vertex nodes. - Second the edge nodes. @@ -1099,35 +1443,135 @@ void CCGNSElementType::CreateDataHEXA_125(unsigned short &VTK_Type, from node 0 along the second edge and the k-direction from node 0 along the third edge. */ VTK_Type = HEXAHEDRON; - nPoly = 4; - nDOFs = 125; + nPoly = 4; + nDOFs = 125; SU2ToCGNS.resize(nDOFs); - SU2ToCGNS[0] = 0; SU2ToCGNS[1] = 8; SU2ToCGNS[2] = 9; SU2ToCGNS[3] = 10; SU2ToCGNS[4] = 1; - SU2ToCGNS[5] = 19; SU2ToCGNS[6] = 44; SU2ToCGNS[7] = 45; SU2ToCGNS[8] = 46; SU2ToCGNS[9] = 11; - SU2ToCGNS[10] = 18; SU2ToCGNS[11] = 51; SU2ToCGNS[12] = 52; SU2ToCGNS[13] = 47; SU2ToCGNS[14] = 12; - SU2ToCGNS[15] = 17; SU2ToCGNS[16] = 50; SU2ToCGNS[17] = 49; SU2ToCGNS[18] = 48; SU2ToCGNS[19] = 13; - SU2ToCGNS[20] = 3; SU2ToCGNS[21] = 16; SU2ToCGNS[22] = 15; SU2ToCGNS[23] = 14; SU2ToCGNS[24] = 2; - SU2ToCGNS[25] = 20; SU2ToCGNS[26] = 53; SU2ToCGNS[27] = 54; SU2ToCGNS[28] = 55; SU2ToCGNS[29] = 23; - SU2ToCGNS[30] = 82; SU2ToCGNS[31] = 98; SU2ToCGNS[32] = 99; SU2ToCGNS[33] = 100; SU2ToCGNS[34] = 62; - SU2ToCGNS[35] = 81; SU2ToCGNS[36] = 105; SU2ToCGNS[37] = 106; SU2ToCGNS[38] = 101; SU2ToCGNS[39] = 63; - SU2ToCGNS[40] = 80; SU2ToCGNS[41] = 104; SU2ToCGNS[42] = 103; SU2ToCGNS[43] = 102; SU2ToCGNS[44] = 64; - SU2ToCGNS[45] = 29; SU2ToCGNS[46] = 73; SU2ToCGNS[47] = 72; SU2ToCGNS[48] = 71; SU2ToCGNS[49] = 26; - SU2ToCGNS[50] = 21; SU2ToCGNS[51] = 60; SU2ToCGNS[52] = 61; SU2ToCGNS[53] = 56; SU2ToCGNS[54] = 24; - SU2ToCGNS[55] = 83; SU2ToCGNS[56] = 107; SU2ToCGNS[57] = 108; SU2ToCGNS[58] = 109; SU2ToCGNS[59] = 69; - SU2ToCGNS[60] = 88; SU2ToCGNS[61] = 114; SU2ToCGNS[62] = 115; SU2ToCGNS[63] = 110; SU2ToCGNS[64] = 70; - SU2ToCGNS[65] = 87; SU2ToCGNS[66] = 113; SU2ToCGNS[67] = 112; SU2ToCGNS[68] = 111; SU2ToCGNS[69] = 65; - SU2ToCGNS[70] = 30; SU2ToCGNS[71] = 74; SU2ToCGNS[72] = 79; SU2ToCGNS[73] = 78; SU2ToCGNS[74] = 27; - SU2ToCGNS[75] = 22; SU2ToCGNS[76] = 59; SU2ToCGNS[77] = 58; SU2ToCGNS[78] = 57; SU2ToCGNS[79] = 25; - SU2ToCGNS[80] = 84; SU2ToCGNS[81] = 116; SU2ToCGNS[82] = 117; SU2ToCGNS[83] = 118; SU2ToCGNS[84] = 68; - SU2ToCGNS[85] = 85; SU2ToCGNS[86] = 123; SU2ToCGNS[87] = 124; SU2ToCGNS[88] = 119; SU2ToCGNS[89] = 67; - SU2ToCGNS[90] = 86; SU2ToCGNS[91] = 122; SU2ToCGNS[92] = 121; SU2ToCGNS[93] = 120; SU2ToCGNS[94] = 66; - SU2ToCGNS[95] = 31; SU2ToCGNS[96] = 75; SU2ToCGNS[97] = 76; SU2ToCGNS[98] = 77; SU2ToCGNS[99] = 28; - SU2ToCGNS[100] = 4; SU2ToCGNS[101] = 32; SU2ToCGNS[102] = 33; SU2ToCGNS[103] = 34; SU2ToCGNS[104] = 5; - SU2ToCGNS[105] = 43; SU2ToCGNS[106] = 89; SU2ToCGNS[107] = 90; SU2ToCGNS[108] = 91; SU2ToCGNS[109] = 35; - SU2ToCGNS[110] = 42; SU2ToCGNS[111] = 96; SU2ToCGNS[112] = 97; SU2ToCGNS[113] = 92; SU2ToCGNS[114] = 36; - SU2ToCGNS[115] = 41; SU2ToCGNS[116] = 95; SU2ToCGNS[117] = 94; SU2ToCGNS[118] = 93; SU2ToCGNS[119] = 37; - SU2ToCGNS[120] = 7; SU2ToCGNS[121] = 40; SU2ToCGNS[122] = 39; SU2ToCGNS[123] = 38; SU2ToCGNS[124] = 6; + SU2ToCGNS[0] = 0; + SU2ToCGNS[1] = 8; + SU2ToCGNS[2] = 9; + SU2ToCGNS[3] = 10; + SU2ToCGNS[4] = 1; + SU2ToCGNS[5] = 19; + SU2ToCGNS[6] = 44; + SU2ToCGNS[7] = 45; + SU2ToCGNS[8] = 46; + SU2ToCGNS[9] = 11; + SU2ToCGNS[10] = 18; + SU2ToCGNS[11] = 51; + SU2ToCGNS[12] = 52; + SU2ToCGNS[13] = 47; + SU2ToCGNS[14] = 12; + SU2ToCGNS[15] = 17; + SU2ToCGNS[16] = 50; + SU2ToCGNS[17] = 49; + SU2ToCGNS[18] = 48; + SU2ToCGNS[19] = 13; + SU2ToCGNS[20] = 3; + SU2ToCGNS[21] = 16; + SU2ToCGNS[22] = 15; + SU2ToCGNS[23] = 14; + SU2ToCGNS[24] = 2; + SU2ToCGNS[25] = 20; + SU2ToCGNS[26] = 53; + SU2ToCGNS[27] = 54; + SU2ToCGNS[28] = 55; + SU2ToCGNS[29] = 23; + SU2ToCGNS[30] = 82; + SU2ToCGNS[31] = 98; + SU2ToCGNS[32] = 99; + SU2ToCGNS[33] = 100; + SU2ToCGNS[34] = 62; + SU2ToCGNS[35] = 81; + SU2ToCGNS[36] = 105; + SU2ToCGNS[37] = 106; + SU2ToCGNS[38] = 101; + SU2ToCGNS[39] = 63; + SU2ToCGNS[40] = 80; + SU2ToCGNS[41] = 104; + SU2ToCGNS[42] = 103; + SU2ToCGNS[43] = 102; + SU2ToCGNS[44] = 64; + SU2ToCGNS[45] = 29; + SU2ToCGNS[46] = 73; + SU2ToCGNS[47] = 72; + SU2ToCGNS[48] = 71; + SU2ToCGNS[49] = 26; + SU2ToCGNS[50] = 21; + SU2ToCGNS[51] = 60; + SU2ToCGNS[52] = 61; + SU2ToCGNS[53] = 56; + SU2ToCGNS[54] = 24; + SU2ToCGNS[55] = 83; + SU2ToCGNS[56] = 107; + SU2ToCGNS[57] = 108; + SU2ToCGNS[58] = 109; + SU2ToCGNS[59] = 69; + SU2ToCGNS[60] = 88; + SU2ToCGNS[61] = 114; + SU2ToCGNS[62] = 115; + SU2ToCGNS[63] = 110; + SU2ToCGNS[64] = 70; + SU2ToCGNS[65] = 87; + SU2ToCGNS[66] = 113; + SU2ToCGNS[67] = 112; + SU2ToCGNS[68] = 111; + SU2ToCGNS[69] = 65; + SU2ToCGNS[70] = 30; + SU2ToCGNS[71] = 74; + SU2ToCGNS[72] = 79; + SU2ToCGNS[73] = 78; + SU2ToCGNS[74] = 27; + SU2ToCGNS[75] = 22; + SU2ToCGNS[76] = 59; + SU2ToCGNS[77] = 58; + SU2ToCGNS[78] = 57; + SU2ToCGNS[79] = 25; + SU2ToCGNS[80] = 84; + SU2ToCGNS[81] = 116; + SU2ToCGNS[82] = 117; + SU2ToCGNS[83] = 118; + SU2ToCGNS[84] = 68; + SU2ToCGNS[85] = 85; + SU2ToCGNS[86] = 123; + SU2ToCGNS[87] = 124; + SU2ToCGNS[88] = 119; + SU2ToCGNS[89] = 67; + SU2ToCGNS[90] = 86; + SU2ToCGNS[91] = 122; + SU2ToCGNS[92] = 121; + SU2ToCGNS[93] = 120; + SU2ToCGNS[94] = 66; + SU2ToCGNS[95] = 31; + SU2ToCGNS[96] = 75; + SU2ToCGNS[97] = 76; + SU2ToCGNS[98] = 77; + SU2ToCGNS[99] = 28; + SU2ToCGNS[100] = 4; + SU2ToCGNS[101] = 32; + SU2ToCGNS[102] = 33; + SU2ToCGNS[103] = 34; + SU2ToCGNS[104] = 5; + SU2ToCGNS[105] = 43; + SU2ToCGNS[106] = 89; + SU2ToCGNS[107] = 90; + SU2ToCGNS[108] = 91; + SU2ToCGNS[109] = 35; + SU2ToCGNS[110] = 42; + SU2ToCGNS[111] = 96; + SU2ToCGNS[112] = 97; + SU2ToCGNS[113] = 92; + SU2ToCGNS[114] = 36; + SU2ToCGNS[115] = 41; + SU2ToCGNS[116] = 95; + SU2ToCGNS[117] = 94; + SU2ToCGNS[118] = 93; + SU2ToCGNS[119] = 37; + SU2ToCGNS[120] = 7; + SU2ToCGNS[121] = 40; + SU2ToCGNS[122] = 39; + SU2ToCGNS[123] = 38; + SU2ToCGNS[124] = 6; } #endif diff --git a/Common/src/fem/fem_gauss_jacobi_quadrature.cpp b/Common/src/fem/fem_gauss_jacobi_quadrature.cpp index 47492b728e9..f8c1054ea30 100644 --- a/Common/src/fem/fem_gauss_jacobi_quadrature.cpp +++ b/Common/src/fem/fem_gauss_jacobi_quadrature.cpp @@ -4,7 +4,7 @@ quadrature rules. All the functions in this file are based on the program JACOBI_RULE of John Burkardt. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -79,13 +79,12 @@ Tom #include "../../include/fem/fem_gauss_jacobi_quadrature.hpp" -void CGaussJacobiQuadrature::GetQuadraturePoints(const passivedouble alpha, const passivedouble beta, - const passivedouble a, const passivedouble b, - vector &GJPoints, vector &GJWeights) { - +void CGaussJacobiQuadrature::GetQuadraturePoints(const passivedouble alpha, const passivedouble beta, + const passivedouble a, const passivedouble b, + vector& GJPoints, vector& GJWeights) { /*--- Determine the number of integration points. Check if the number makes sense. ---*/ - unsigned int nIntPoints = (unsigned int)GJPoints.size(); - if(nIntPoints < 1 || nIntPoints > 100) + auto nIntPoints = (unsigned int)GJPoints.size(); + if (nIntPoints < 1 || nIntPoints > 100) SU2_MPI::Error("Invalid number of Gauss Jacobi integration points", CURRENT_FUNCTION); /*--- Call the function cgqf to do the actual work. ---*/ @@ -95,8 +94,8 @@ void CGaussJacobiQuadrature::GetQuadraturePoints(const passivedouble alpha, //****************************************************************************80 -void CGaussJacobiQuadrature::cdgqf(int nt, int kind, passivedouble alpha, passivedouble beta, - passivedouble t[], passivedouble wts[]) +void CGaussJacobiQuadrature::cdgqf(int nt, int kind, passivedouble alpha, passivedouble beta, passivedouble t[], + passivedouble wts[]) //****************************************************************************80 // @@ -158,32 +157,30 @@ void CGaussJacobiQuadrature::cdgqf(int nt, int kind, passivedouble alpha, passiv // Output, passivedouble WTS[NT], the weights. // { - passivedouble *aj; - passivedouble *bj; + passivedouble* aj; + passivedouble* bj; passivedouble zemu; - parchk ( kind, 2 * nt, alpha, beta ); -// -// Get the Jacobi matrix and zero-th moment. -// + parchk(kind, 2 * nt, alpha, beta); + // + // Get the Jacobi matrix and zero-th moment. + // aj = new passivedouble[nt]; bj = new passivedouble[nt]; - zemu = class_matrix ( kind, nt, alpha, beta, aj, bj ); -// -// Compute the knots and weights. -// - sgqf ( nt, aj, bj, zemu, t, wts ); - - delete [] aj; - delete [] bj; + zemu = class_matrix(kind, nt, alpha, beta, aj, bj); + // + // Compute the knots and weights. + // + sgqf(nt, aj, bj, zemu, t, wts); - return; + delete[] aj; + delete[] bj; } //****************************************************************************80 -void CGaussJacobiQuadrature::cgqf(int nt, int kind, passivedouble alpha, passivedouble beta, - passivedouble a, passivedouble b, passivedouble t[], passivedouble wts[]) +void CGaussJacobiQuadrature::cgqf(int nt, int kind, passivedouble alpha, passivedouble beta, passivedouble a, + passivedouble b, passivedouble t[], passivedouble wts[]) //****************************************************************************80 // @@ -248,38 +245,33 @@ void CGaussJacobiQuadrature::cgqf(int nt, int kind, passivedouble alpha, passive // { int i; - int *mlt; - int *ndx; -// -// Compute the Gauss quadrature formula for default values of A and B. -// - cdgqf ( nt, kind, alpha, beta, t, wts ); -// -// Prepare to scale the quadrature formula to other weight function with -// valid A and B. -// + int* mlt; + int* ndx; + // + // Compute the Gauss quadrature formula for default values of A and B. + // + cdgqf(nt, kind, alpha, beta, t, wts); + // + // Prepare to scale the quadrature formula to other weight function with + // valid A and B. + // mlt = new int[nt]; - for ( i = 0; i < nt; i++ ) - { + for (i = 0; i < nt; i++) { mlt[i] = 1; } ndx = new int[nt]; - for ( i = 0; i < nt; i++ ) - { + for (i = 0; i < nt; i++) { ndx[i] = i + 1; } - scqf ( nt, t, mlt, wts, nt, ndx, wts, t, kind, alpha, beta, a, b ); - - delete [] mlt; - delete [] ndx; + scqf(nt, t, mlt, wts, nt, ndx, wts, t, kind, alpha, beta, a, b); - return; + delete[] mlt; + delete[] ndx; } //****************************************************************************80 -passivedouble CGaussJacobiQuadrature::class_matrix(int kind, int m, passivedouble alpha, - passivedouble beta, passivedouble aj[], - passivedouble bj[]) +passivedouble CGaussJacobiQuadrature::class_matrix(int kind, int m, passivedouble alpha, passivedouble beta, + passivedouble aj[], passivedouble bj[]) //****************************************************************************80 // @@ -358,157 +350,121 @@ passivedouble CGaussJacobiQuadrature::class_matrix(int kind, int m, passivedoubl passivedouble temp2; passivedouble zemu; - temp = r8_epsilon ( ); + temp = r8_epsilon(); - parchk ( kind, 2 * m - 1, alpha, beta ); + parchk(kind, 2 * m - 1, alpha, beta); temp2 = 0.5; - if ( 500.0 * temp < fabs ( pow ( tgamma ( temp2 ), 2 ) - pi ) ) - { + if (500.0 * temp < fabs(pow(tgamma(temp2), 2) - pi)) { cout << "\n"; cout << "CLASS_MATRIX - Fatal error!\n"; cout << " Gamma function does not match machine parameters.\n"; - exit ( 1 ); + exit(1); } - if ( kind == 1 ) - { + if (kind == 1) { ab = 0.0; - zemu = 2.0 / ( ab + 1.0 ); + zemu = 2.0 / (ab + 1.0); - for ( i = 0; i < m; i++ ) - { + for (i = 0; i < m; i++) { aj[i] = 0.0; } - for ( i = 1; i <= m; i++ ) - { - abi = i + ab * ( i % 2 ); + for (i = 1; i <= m; i++) { + abi = i + ab * (i % 2); abj = 2 * i + ab; - bj[i-1] = sqrt ( abi * abi / ( abj * abj - 1.0 ) ); + bj[i - 1] = sqrt(abi * abi / (abj * abj - 1.0)); } - } - else if ( kind == 2 ) - { + } else if (kind == 2) { zemu = pi; - for ( i = 0; i < m; i++ ) - { + for (i = 0; i < m; i++) { aj[i] = 0.0; } - bj[0] = sqrt ( 0.5 ); - for ( i = 1; i < m; i++ ) - { + bj[0] = sqrt(0.5); + for (i = 1; i < m; i++) { bj[i] = 0.5; } - } - else if ( kind == 3 ) - { + } else if (kind == 3) { ab = alpha * 2.0; - zemu = pow ( 2.0, ab + 1.0 ) * pow ( tgamma ( alpha + 1.0 ), 2 ) - / tgamma ( ab + 2.0 ); + zemu = pow(2.0, ab + 1.0) * pow(tgamma(alpha + 1.0), 2) / tgamma(ab + 2.0); - for ( i = 0; i < m; i++ ) - { + for (i = 0; i < m; i++) { aj[i] = 0.0; } - bj[0] = sqrt ( 1.0 / ( 2.0 * alpha + 3.0 ) ); - for ( i = 2; i <= m; i++ ) - { - bj[i-1] = sqrt ( i * ( i + ab ) / ( 4.0 * pow ( i + alpha, 2 ) - 1.0 ) ); + bj[0] = sqrt(1.0 / (2.0 * alpha + 3.0)); + for (i = 2; i <= m; i++) { + bj[i - 1] = sqrt(i * (i + ab) / (4.0 * pow(i + alpha, 2) - 1.0)); } - } - else if ( kind == 4 ) - { + } else if (kind == 4) { ab = alpha + beta; abi = 2.0 + ab; - zemu = pow ( 2.0, ab + 1.0 ) * tgamma ( alpha + 1.0 ) - * tgamma ( beta + 1.0 ) / tgamma ( abi ); - aj[0] = ( beta - alpha ) / abi; - bj[0] = sqrt ( 4.0 * ( 1.0 + alpha ) * ( 1.0 + beta ) - / ( ( abi + 1.0 ) * abi * abi ) ); + zemu = pow(2.0, ab + 1.0) * tgamma(alpha + 1.0) * tgamma(beta + 1.0) / tgamma(abi); + aj[0] = (beta - alpha) / abi; + bj[0] = sqrt(4.0 * (1.0 + alpha) * (1.0 + beta) / ((abi + 1.0) * abi * abi)); a2b2 = beta * beta - alpha * alpha; - for ( i = 2; i <= m; i++ ) - { + for (i = 2; i <= m; i++) { abi = 2.0 * i + ab; - aj[i-1] = a2b2 / ( ( abi - 2.0 ) * abi ); + aj[i - 1] = a2b2 / ((abi - 2.0) * abi); abi = abi * abi; - bj[i-1] = sqrt ( 4.0 * i * ( i + alpha ) * ( i + beta ) * ( i + ab ) - / ( ( abi - 1.0 ) * abi ) ); + bj[i - 1] = sqrt(4.0 * i * (i + alpha) * (i + beta) * (i + ab) / ((abi - 1.0) * abi)); } - } - else if ( kind == 5 ) - { - zemu = tgamma ( alpha + 1.0 ); + } else if (kind == 5) { + zemu = tgamma(alpha + 1.0); - for ( i = 1; i <= m; i++ ) - { - aj[i-1] = 2.0 * i - 1.0 + alpha; - bj[i-1] = sqrt ( i * ( i + alpha ) ); + for (i = 1; i <= m; i++) { + aj[i - 1] = 2.0 * i - 1.0 + alpha; + bj[i - 1] = sqrt(i * (i + alpha)); } - } - else if ( kind == 6 ) - { - zemu = tgamma ( ( alpha + 1.0 ) / 2.0 ); + } else if (kind == 6) { + zemu = tgamma((alpha + 1.0) / 2.0); - for ( i = 0; i < m; i++ ) - { + for (i = 0; i < m; i++) { aj[i] = 0.0; } - for ( i = 1; i <= m; i++ ) - { - bj[i-1] = sqrt ( ( i + alpha * ( i % 2 ) ) / 2.0 ); + for (i = 1; i <= m; i++) { + bj[i - 1] = sqrt((i + alpha * (i % 2)) / 2.0); } - } - else if ( kind == 7 ) - { + } else if (kind == 7) { ab = alpha; - zemu = 2.0 / ( ab + 1.0 ); + zemu = 2.0 / (ab + 1.0); - for ( i = 0; i < m; i++ ) - { + for (i = 0; i < m; i++) { aj[i] = 0.0; } - for ( i = 1; i <= m; i++ ) - { - abi = i + ab * ( i % 2 ); + for (i = 1; i <= m; i++) { + abi = i + ab * (i % 2); abj = 2 * i + ab; - bj[i-1] = sqrt ( abi * abi / ( abj * abj - 1.0 ) ); + bj[i - 1] = sqrt(abi * abi / (abj * abj - 1.0)); } - } - else // if ( kind == 8 ) + } else // if ( kind == 8 ) { ab = alpha + beta; - zemu = tgamma ( alpha + 1.0 ) * tgamma ( - ( ab + 1.0 ) ) - / tgamma ( - beta ); + zemu = tgamma(alpha + 1.0) * tgamma(-(ab + 1.0)) / tgamma(-beta); apone = alpha + 1.0; aba = ab * apone; - aj[0] = - apone / ( ab + 2.0 ); - bj[0] = - aj[0] * ( beta + 1.0 ) / ( ab + 2.0 ) / ( ab + 3.0 ); - for ( i = 2; i <= m; i++ ) - { + aj[0] = -apone / (ab + 2.0); + bj[0] = -aj[0] * (beta + 1.0) / (ab + 2.0) / (ab + 3.0); + for (i = 2; i <= m; i++) { abti = ab + 2.0 * i; - aj[i-1] = aba + 2.0 * ( ab + i ) * ( i - 1 ); - aj[i-1] = - aj[i-1] / abti / ( abti - 2.0 ); + aj[i - 1] = aba + 2.0 * (ab + i) * (i - 1); + aj[i - 1] = -aj[i - 1] / abti / (abti - 2.0); } - for ( i = 2; i <= m - 1; i++ ) - { + for (i = 2; i <= m - 1; i++) { abti = ab + 2.0 * i; - bj[i-1] = i * ( alpha + i ) / ( abti - 1.0 ) * ( beta + i ) - / ( abti * abti ) * ( ab + i ) / ( abti + 1.0 ); + bj[i - 1] = i * (alpha + i) / (abti - 1.0) * (beta + i) / (abti * abti) * (ab + i) / (abti + 1.0); } - bj[m-1] = 0.0; - for ( i = 0; i < m; i++ ) - { - bj[i] = sqrt ( bj[i] ); + bj[m - 1] = 0.0; + for (i = 0; i < m; i++) { + bj[i] = sqrt(bj[i]); } } @@ -596,117 +552,100 @@ void CGaussJacobiQuadrature::imtqlx(int n, passivedouble d[], passivedouble e[], passivedouble r; passivedouble s; - prec = r8_epsilon ( ); + prec = r8_epsilon(); - if ( n == 1 ) - { + if (n == 1) { return; } - e[n-1] = 0.0; + e[n - 1] = 0.0; - for ( l = 1; l <= n; l++ ) - { + for (l = 1; l <= n; l++) { j = 0; - for ( ; ; ) - { - for ( m = l; m <= n; m++ ) - { - if ( m == n ) - { + for (;;) { + for (m = l; m <= n; m++) { + if (m == n) { break; } - if ( fabs ( e[m-1] ) <= prec * ( fabs ( d[m-1] ) + fabs ( d[m] ) ) ) - { + if (fabs(e[m - 1]) <= prec * (fabs(d[m - 1]) + fabs(d[m]))) { break; } } - p = d[l-1]; - if ( m == l ) - { + p = d[l - 1]; + if (m == l) { break; } - if ( itn <= j ) - { + if (itn <= j) { cout << "\n"; cout << "IMTQLX - Fatal error!\n"; cout << " Iteration limit exceeded\n"; - exit ( 1 ); + exit(1); } j = j + 1; - g = ( d[l] - p ) / ( 2.0 * e[l-1] ); - r = sqrt ( g * g + 1.0 ); - g = d[m-1] - p + e[l-1] / ( g + fabs ( r ) * r8_sign ( g ) ); + g = (d[l] - p) / (2.0 * e[l - 1]); + r = sqrt(g * g + 1.0); + g = d[m - 1] - p + e[l - 1] / (g + fabs(r) * r8_sign(g)); s = 1.0; c = 1.0; p = 0.0; mml = m - l; - for ( ii = 1; ii <= mml; ii++ ) - { + for (ii = 1; ii <= mml; ii++) { i = m - ii; - f = s * e[i-1]; - b = c * e[i-1]; + f = s * e[i - 1]; + b = c * e[i - 1]; - if ( fabs ( g ) <= fabs ( f ) ) - { + if (fabs(g) <= fabs(f)) { c = g / f; - r = sqrt ( c * c + 1.0 ); + r = sqrt(c * c + 1.0); e[i] = f * r; s = 1.0 / r; c = c * s; - } - else - { + } else { s = f / g; - r = sqrt ( s * s + 1.0 ); + r = sqrt(s * s + 1.0); e[i] = g * r; c = 1.0 / r; s = s * c; } g = d[i] - p; - r = ( d[i-1] - g ) * s + 2.0 * c * b; + r = (d[i - 1] - g) * s + 2.0 * c * b; p = s * r; d[i] = g + p; g = c * r - b; f = z[i]; - z[i] = s * z[i-1] + c * f; - z[i-1] = c * z[i-1] - s * f; + z[i] = s * z[i - 1] + c * f; + z[i - 1] = c * z[i - 1] - s * f; } - d[l-1] = d[l-1] - p; - e[l-1] = g; - e[m-1] = 0.0; + d[l - 1] = d[l - 1] - p; + e[l - 1] = g; + e[m - 1] = 0.0; } } -// -// Sorting. -// - for ( ii = 2; ii <= m; ii++ ) - { + // + // Sorting. + // + for (ii = 2; ii <= m; ii++) { i = ii - 1; k = i; - p = d[i-1]; - - for ( j = ii; j <= n; j++ ) - { - if ( d[j-1] < p ) - { - k = j; - p = d[j-1]; + p = d[i - 1]; + + for (j = ii; j <= n; j++) { + if (d[j - 1] < p) { + k = j; + p = d[j - 1]; } } - if ( k != i ) - { - d[k-1] = d[i-1]; - d[i-1] = p; - p = z[i-1]; - z[i-1] = z[k-1]; - z[k-1] = p; + if (k != i) { + d[k - 1] = d[i - 1]; + d[i - 1] = p; + p = z[i - 1]; + z[i - 1] = z[k - 1]; + z[k - 1] = p; } } - return; } //****************************************************************************80 @@ -760,52 +699,46 @@ void CGaussJacobiQuadrature::parchk(int kind, int m, passivedouble alpha, passiv { passivedouble tmp; - if ( kind <= 0 ) - { + if (kind <= 0) { cout << "\n"; cout << "PARCHK - Fatal error!\n"; cout << " KIND <= 0.\n"; - exit ( 1 ); + exit(1); } -// -// Check ALPHA for Gegenbauer, Jacobi, Laguerre, Hermite, Exponential. -// - if ( 3 <= kind && alpha <= -1.0 ) - { + // + // Check ALPHA for Gegenbauer, Jacobi, Laguerre, Hermite, Exponential. + // + if (3 <= kind && alpha <= -1.0) { cout << "\n"; cout << "PARCHK - Fatal error!\n"; cout << " 3 <= KIND and ALPHA <= -1.\n"; - exit ( 1 ); + exit(1); } -// -// Check BETA for Jacobi. -// - if ( kind == 4 && beta <= -1.0 ) - { + // + // Check BETA for Jacobi. + // + if (kind == 4 && beta <= -1.0) { cout << "\n"; cout << "PARCHK - Fatal error!\n"; cout << " KIND == 4 and BETA <= -1.0.\n"; - exit ( 1 ); + exit(1); } -// -// Check ALPHA and BETA for rational. -// - if ( kind == 8 ) - { + // + // Check ALPHA and BETA for rational. + // + if (kind == 8) { tmp = alpha + beta + m + 1.0; - if ( 0.0 <= tmp || tmp <= beta ) - { + if (0.0 <= tmp || tmp <= beta) { cout << "\n"; cout << "PARCHK - Fatal error!\n"; cout << " KIND == 8 but condition on ALPHA and BETA fails.\n"; - exit ( 1 ); + exit(1); } } - return; } //****************************************************************************80 -passivedouble CGaussJacobiQuadrature::r8_epsilon( ) +passivedouble CGaussJacobiQuadrature::r8_epsilon() //****************************************************************************80 // @@ -873,22 +806,18 @@ passivedouble CGaussJacobiQuadrature::r8_sign(passivedouble x) { passivedouble value; - if ( x < 0.0 ) - { + if (x < 0.0) { value = -1.0; - } - else - { + } else { value = 1.0; } return value; } //****************************************************************************80 -void CGaussJacobiQuadrature::scqf(int nt, const passivedouble t[], const int mlt[], const passivedouble wts[], - int nwts, int ndx[], passivedouble swts[], passivedouble st[], - int kind, passivedouble alpha, passivedouble beta, passivedouble a, - passivedouble b) +void CGaussJacobiQuadrature::scqf(int nt, const passivedouble t[], const int mlt[], const passivedouble wts[], int nwts, + int ndx[], passivedouble swts[], passivedouble st[], int kind, passivedouble alpha, + passivedouble beta, passivedouble a, passivedouble b) //****************************************************************************80 // @@ -971,161 +900,132 @@ void CGaussJacobiQuadrature::scqf(int nt, const passivedouble t[], const int mlt passivedouble temp; passivedouble tmp; - temp = r8_epsilon ( ); + temp = r8_epsilon(); - parchk ( kind, 1, alpha, beta ); + parchk(kind, 1, alpha, beta); - if ( kind == 1 ) - { + if (kind == 1) { al = 0.0; be = 0.0; - if ( fabs ( b - a ) <= temp ) - { + if (fabs(b - a) <= temp) { cout << "\n"; cout << "SCQF - Fatal error!\n"; cout << " |B - A| too small.\n"; - exit ( 1 ); + exit(1); } - shft = ( a + b ) / 2.0; - slp = ( b - a ) / 2.0; - } - else if ( kind == 2 ) - { + shft = (a + b) / 2.0; + slp = (b - a) / 2.0; + } else if (kind == 2) { al = -0.5; be = -0.5; - if ( fabs ( b - a ) <= temp ) - { + if (fabs(b - a) <= temp) { cout << "\n"; cout << "SCQF - Fatal error!\n"; cout << " |B - A| too small.\n"; - exit ( 1 ); + exit(1); } - shft = ( a + b ) / 2.0; - slp = ( b - a ) / 2.0; - } - else if ( kind == 3 ) - { + shft = (a + b) / 2.0; + slp = (b - a) / 2.0; + } else if (kind == 3) { al = alpha; be = alpha; - if ( fabs ( b - a ) <= temp ) - { + if (fabs(b - a) <= temp) { cout << "\n"; cout << "SCQF - Fatal error!\n"; cout << " |B - A| too small.\n"; - exit ( 1 ); + exit(1); } - shft = ( a + b ) / 2.0; - slp = ( b - a ) / 2.0; - } - else if ( kind == 4 ) - { + shft = (a + b) / 2.0; + slp = (b - a) / 2.0; + } else if (kind == 4) { al = alpha; be = beta; - if ( fabs ( b - a ) <= temp ) - { + if (fabs(b - a) <= temp) { cout << "\n"; cout << "SCQF - Fatal error!\n"; cout << " |B - A| too small.\n"; - exit ( 1 ); + exit(1); } - shft = ( a + b ) / 2.0; - slp = ( b - a ) / 2.0; - } - else if ( kind == 5 ) - { - if ( b <= 0.0 ) - { + shft = (a + b) / 2.0; + slp = (b - a) / 2.0; + } else if (kind == 5) { + if (b <= 0.0) { cout << "\n"; cout << "SCQF - Fatal error!\n"; cout << " B <= 0\n"; - exit ( 1 ); + exit(1); } shft = a; slp = 1.0 / b; al = alpha; be = 0.0; - } - else if ( kind == 6 ) - { - if ( b <= 0.0 ) - { + } else if (kind == 6) { + if (b <= 0.0) { cout << "\n"; cout << "SCQF - Fatal error!\n"; cout << " B <= 0.\n"; - exit ( 1 ); + exit(1); } shft = a; - slp = 1.0 / sqrt ( b ); + slp = 1.0 / sqrt(b); al = alpha; be = 0.0; - } - else if ( kind == 7 ) - { + } else if (kind == 7) { al = alpha; be = 0.0; - if ( fabs ( b - a ) <= temp ) - { + if (fabs(b - a) <= temp) { cout << "\n"; cout << "SCQF - Fatal error!\n"; cout << " |B - A| too small.\n"; - exit ( 1 ); + exit(1); } - shft = ( a + b ) / 2.0; - slp = ( b - a ) / 2.0; - } - else if ( kind == 8 ) - { - if ( a + b <= 0.0 ) - { + shft = (a + b) / 2.0; + slp = (b - a) / 2.0; + } else if (kind == 8) { + if (a + b <= 0.0) { cout << "\n"; cout << "SCQF - Fatal error!\n"; cout << " A + B <= 0.\n"; - exit ( 1 ); + exit(1); } shft = a; slp = a + b; al = alpha; be = beta; - } - else // if ( kind == 9 ) + } else // if ( kind == 9 ) { al = 0.5; be = 0.5; - if ( fabs ( b - a ) <= temp ) - { + if (fabs(b - a) <= temp) { cout << "\n"; cout << "SCQF - Fatal error!\n"; cout << " |B - A| too small.\n"; - exit ( 1 ); + exit(1); } - shft = ( a + b ) / 2.0; - slp = ( b - a ) / 2.0; + shft = (a + b) / 2.0; + slp = (b - a) / 2.0; } - p = pow ( slp, al + be + 1.0 ); + p = pow(slp, al + be + 1.0); - for ( k = 0; k < nt; k++ ) - { + for (k = 0; k < nt; k++) { st[k] = shft + slp * t[k]; - l = abs ( ndx[k] ); + l = abs(ndx[k]); - if ( l != 0 ) - { + if (l != 0) { tmp = p; - for ( i = l - 1; i <= l - 1 + mlt[k] - 1; i++ ) - { + for (i = l - 1; i <= l - 1 + mlt[k] - 1; i++) { swts[i] = wts[i] * tmp; tmp = tmp * slp; } } } - return; } //****************************************************************************80 -void CGaussJacobiQuadrature::sgqf(int nt, const passivedouble aj[], passivedouble bj[], - passivedouble zemu, passivedouble t[], passivedouble wts[]) +void CGaussJacobiQuadrature::sgqf(int nt, const passivedouble aj[], passivedouble bj[], passivedouble zemu, + passivedouble t[], passivedouble wts[]) //****************************************************************************80 // @@ -1177,37 +1077,31 @@ void CGaussJacobiQuadrature::sgqf(int nt, const passivedouble aj[], passivedoubl // { int i; -// -// Exit if the zero-th moment is not positive. -// - if ( zemu <= 0.0 ) - { + // + // Exit if the zero-th moment is not positive. + // + if (zemu <= 0.0) { cout << "\n"; cout << "SGQF - Fatal error!\n"; cout << " ZEMU <= 0.\n"; - exit ( 1 ); + exit(1); } -// -// Set up vectors for IMTQLX. -// - for ( i = 0; i < nt; i++ ) - { + // + // Set up vectors for IMTQLX. + // + for (i = 0; i < nt; i++) { t[i] = aj[i]; } - wts[0] = sqrt ( zemu ); - for ( i = 1; i < nt; i++ ) - { + wts[0] = sqrt(zemu); + for (i = 1; i < nt; i++) { wts[i] = 0.0; } -// -// Diagonalize the Jacobi matrix. -// - imtqlx ( nt, t, bj, wts ); + // + // Diagonalize the Jacobi matrix. + // + imtqlx(nt, t, bj, wts); - for ( i = 0; i < nt; i++ ) - { + for (i = 0; i < nt; i++) { wts[i] = wts[i] * wts[i]; } - - return; } diff --git a/Common/src/fem/fem_geometry_structure.cpp b/Common/src/fem/fem_geometry_structure.cpp index b274989268c..a9b92bf0a6d 100644 --- a/Common/src/fem/fem_geometry_structure.cpp +++ b/Common/src/fem/fem_geometry_structure.cpp @@ -2,7 +2,7 @@ * \file fem_geometry_structure.cpp * \brief Functions for creating the primal grid for the FEM solver. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -32,30 +32,26 @@ #include "../../include/adt/CADTPointsOnlyClass.hpp" /* Prototypes for Lapack functions, if MKL or LAPACK is used. */ -#if defined (HAVE_MKL) || defined(HAVE_LAPACK) -extern "C" void dpotrf_(char *, int*, passivedouble*, int*, int*); -extern "C" void dpotri_(char *, int*, passivedouble*, int*, int*); +#if defined(HAVE_MKL) || defined(HAVE_LAPACK) +extern "C" void dpotrf_(char*, int*, passivedouble*, int*, int*); +extern "C" void dpotri_(char*, int*, passivedouble*, int*, int*); #endif -bool CLong3T::operator<(const CLong3T &other) const { - if(long0 != other.long0) return (long0 < other.long0); - if(long1 != other.long1) return (long1 < other.long1); - if(long2 != other.long2) return (long2 < other.long2); +bool CLong3T::operator<(const CLong3T& other) const { + if (long0 != other.long0) return (long0 < other.long0); + if (long1 != other.long1) return (long1 < other.long1); + if (long2 != other.long2) return (long2 < other.long2); return false; } -CReorderElements::CReorderElements(const unsigned long val_GlobalElemID, - const unsigned short val_TimeLevel, - const bool val_CommSolution, - const unsigned short val_VTK_Type, - const unsigned short val_nPolySol, - const bool val_JacConstant) { - +CReorderElements::CReorderElements(const unsigned long val_GlobalElemID, const unsigned short val_TimeLevel, + const bool val_CommSolution, const unsigned short val_VTK_Type, + const unsigned short val_nPolySol, const bool val_JacConstant) { /* Copy the global elment ID, time level and whether or not this element must be communicated. */ globalElemID = val_GlobalElemID; - timeLevel = val_TimeLevel; + timeLevel = val_TimeLevel; commSolution = val_CommSolution; /* Create the element type used in this class, which stores information of @@ -63,38 +59,34 @@ CReorderElements::CReorderElements(const unsigned long val_GlobalElemID, Jacobian of the transformation is constant. As it is possible that the polynomial degree of the solution is zero, this convention is different from the convention used in the SU2 grid file. */ - elemType = val_VTK_Type + 100*val_nPolySol; - if( !val_JacConstant ) elemType += 50; + elemType = val_VTK_Type + 100 * val_nPolySol; + if (!val_JacConstant) elemType += 50; } -bool CReorderElements::operator< (const CReorderElements &other) const { - +bool CReorderElements::operator<(const CReorderElements& other) const { /* Elements with the lowest time level are stored first. */ - if(timeLevel != other.timeLevel) return timeLevel < other.timeLevel; + if (timeLevel != other.timeLevel) return timeLevel < other.timeLevel; /* Next comparison is whether or not the element must communicate its solution data to other ranks. Elements which do not need to do this are stored first. */ - if(commSolution != other.commSolution) return other.commSolution; + if (commSolution != other.commSolution) return other.commSolution; /* Elements of the same element type must be stored as contiguously as possible to allow for the simultaneous treatment of elements in the matrix multiplications. */ - if(elemType != other.elemType) return elemType < other.elemType; + if (elemType != other.elemType) return elemType < other.elemType; /* The final comparison is based on the global element ID. */ return globalElemID < other.globalElemID; } -bool CSortFaces::operator()(const CFaceOfElement &f0, - const CFaceOfElement &f1) { - +bool CSortFaces::operator()(const CFaceOfElement& f0, const CFaceOfElement& f1) { /*--- Comparison in case both faces are boundary faces. ---*/ - if(f0.faceIndicator >= 0 && f1.faceIndicator >= 0) { - + if (f0.faceIndicator >= 0 && f1.faceIndicator >= 0) { /* Both faces are boundary faces. The first comparison is the boundary marker, which is stored in faceIndicator. */ - if(f0.faceIndicator != f1.faceIndicator) return f0.faceIndicator < f1.faceIndicator; + if (f0.faceIndicator != f1.faceIndicator) return f0.faceIndicator < f1.faceIndicator; /* Both faces belong to the same boundary marker. The second comparison is based on the on the local volume ID's of the adjacent elements. As the @@ -107,8 +99,7 @@ bool CSortFaces::operator()(const CFaceOfElement &f0, } /*--- Comparison in case both faces are internal faces. ---*/ - if(f0.faceIndicator == -1 && f1.faceIndicator == -1) { - + if (f0.faceIndicator == -1 && f1.faceIndicator == -1) { /* Both faces are internal faces. First determine the minimum and maximum ID of its adjacent elements. */ unsigned long elemIDMin0 = min(f0.elemID0, f0.elemID1); @@ -118,8 +109,7 @@ bool CSortFaces::operator()(const CFaceOfElement &f0, unsigned long elemIDMax1 = max(f1.elemID0, f1.elemID1); /* Determine the situation. */ - if(elemIDMax0 < nVolElemTot && elemIDMax1 < nVolElemTot) { - + if (elemIDMax0 < nVolElemTot && elemIDMax1 < nVolElemTot) { /* Both faces are matching internal faces. Determine whether or not these faces are local faces, i.e. faces between locally owned elements. */ const bool face0IsLocal = elemIDMax0 < nVolElemOwned; @@ -127,45 +117,34 @@ bool CSortFaces::operator()(const CFaceOfElement &f0, /* Check if both faces have the same status, i.e. either local or not local. */ - if(face0IsLocal == face1IsLocal) { - + if (face0IsLocal == face1IsLocal) { /* Both faces are either local or not local. Determine the time level of the faces, which is the minimum value of the adjacent volume elements. */ - const unsigned short timeLevel0 = min(volElem[elemIDMin0].timeLevel, - volElem[elemIDMax0].timeLevel); - const unsigned short timeLevel1 = min(volElem[elemIDMin1].timeLevel, - volElem[elemIDMax1].timeLevel); + const unsigned short timeLevel0 = min(volElem[elemIDMin0].timeLevel, volElem[elemIDMax0].timeLevel); + const unsigned short timeLevel1 = min(volElem[elemIDMin1].timeLevel, volElem[elemIDMax1].timeLevel); /* Internal faces with the same status are first sorted according to their time level. Faces with the smallest time level are numbered first. Note this is only relevant for time accurate local time stepping. */ - if(timeLevel0 != timeLevel1) return timeLevel0 < timeLevel1; + if (timeLevel0 != timeLevel1) return timeLevel0 < timeLevel1; /* The faces belong to the same time level. They are sorted according to their element ID's in order to increase cache performance. */ - if(elemIDMin0 != elemIDMin1) return elemIDMin0 < elemIDMin1; + if (elemIDMin0 != elemIDMin1) return elemIDMin0 < elemIDMin1; return elemIDMax0 < elemIDMax1; - } - else { - - /* One face is a local face and the other is not. Make sure that - the local faces are numbered first. */ - if( face0IsLocal ) return true; - else return false; - } - } - else if(elemIDMax0 >= nVolElemTot && elemIDMax1 >= nVolElemTot) { + } /* One face is a local face and the other is not. Make sure that + the local faces are numbered first. */ + return face0IsLocal; + } else if (elemIDMax0 >= nVolElemTot && elemIDMax1 >= nVolElemTot) { /* Both faces are non-matching internal faces. Sort them according to their relevant element ID. The time level is not taken into account yet, because non-matching faces are not possible at the moment with time accurate local time stepping. */ return elemIDMin0 < elemIDMin1; - } - else { - + } else { /* One face is a matching internal face and the other face is a non-matching internal face. Make sure that the non-matching face is numbered after the matching face. This is accomplished by comparing @@ -180,84 +159,70 @@ bool CSortFaces::operator()(const CFaceOfElement &f0, return f0.faceIndicator > f1.faceIndicator; } -bool CSortBoundaryFaces::operator()(const CSurfaceElementFEM &f0, - const CSurfaceElementFEM &f1) { - +bool CSortBoundaryFaces::operator()(const CSurfaceElementFEM& f0, const CSurfaceElementFEM& f1) { /* First sorting criterion is the index of the standard element. The boundary faces should be sorted per standard element. Note that the time level is not taken into account here, because it is assumed that the surface elements to be sorted belong to one time level. */ - if(f0.indStandardElement != f1.indStandardElement) - return f0.indStandardElement < f1.indStandardElement; + if (f0.indStandardElement != f1.indStandardElement) return f0.indStandardElement < f1.indStandardElement; /* The standard elements are the same. The second criterion is the corresponding volume IDs of the surface elements. */ return f0.volElemID < f1.volElemID; } -bool CPointFEM::operator< (const CPointFEM &other) const { - if(periodIndexToDonor != other.periodIndexToDonor) - return periodIndexToDonor < other.periodIndexToDonor; +bool CPointFEM::operator<(const CPointFEM& other) const { + if (periodIndexToDonor != other.periodIndexToDonor) return periodIndexToDonor < other.periodIndexToDonor; return globalID < other.globalID; - } - -bool CPointFEM::operator==(const CPointFEM &other) const { - return (globalID == other.globalID && - periodIndexToDonor == other.periodIndexToDonor); } -void CVolumeElementFEM::GetCornerPointsAllFaces(unsigned short &numFaces, - unsigned short nPointsPerFace[], - unsigned long faceConn[6][4]) { +bool CPointFEM::operator==(const CPointFEM& other) const { + return (globalID == other.globalID && periodIndexToDonor == other.periodIndexToDonor); +} +void CVolumeElementFEM::GetCornerPointsAllFaces(unsigned short& numFaces, unsigned short nPointsPerFace[], + unsigned long faceConn[6][4]) { /*--- Get the corner connectivities of the faces, local to the element. ---*/ - CPrimalGridFEM::GetLocalCornerPointsAllFaces(VTK_Type, nPolyGrid, nDOFsGrid, - numFaces, nPointsPerFace, faceConn); + CPrimalGridFEM::GetLocalCornerPointsAllFaces(VTK_Type, nPolyGrid, nDOFsGrid, numFaces, nPointsPerFace, faceConn); /*--- Convert the local values of faceConn to global values. ---*/ - for(unsigned short i=0; iGetnDim(); + nDim = geometry->GetnDim(); nZone = geometry->GetnZone(); /*--- Determine the number of variables stored per DOF. ---*/ @@ -267,18 +232,19 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /*--- for this purpose. ---*/ MAIN_SOLVER Kind_Solver = config->GetKind_Solver(); const bool compressible = (Kind_Solver == MAIN_SOLVER::FEM_EULER) || - (Kind_Solver == MAIN_SOLVER::FEM_NAVIER_STOKES) || - (Kind_Solver == MAIN_SOLVER::FEM_RANS) || + (Kind_Solver == MAIN_SOLVER::FEM_NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::FEM_RANS) || (Kind_Solver == MAIN_SOLVER::FEM_LES); unsigned short nVar; - if( compressible ) nVar = nDim + 2; - else nVar = nDim + 1; + if (compressible) + nVar = nDim + 2; + else + nVar = nDim + 1; /*--- Determine a mapping from the global point ID to the local index of the points. ---*/ - map globalPointIDToLocalInd; - for(unsigned long i=0; iGetnPoint(); ++i) + map globalPointIDToLocalInd; + for (unsigned long i = 0; i < geometry->GetnPoint(); ++i) globalPointIDToLocalInd[geometry->nodes->GetGlobalIndex(i)] = i; /*----------------------------------------------------------------------------*/ @@ -289,13 +255,13 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /*--- Determine the ranks to which I have to send my elements. ---*/ vector sendToRank(size, 0); - for(unsigned long i=0; iGetnElem(); ++i) { + for (unsigned long i = 0; i < geometry->GetnElem(); ++i) { sendToRank[geometry->elem[i]->GetColor()] = 1; } - map rankToIndCommBuf; - for(int i=0; i rankToIndCommBuf; + for (int i = 0; i < size; ++i) { + if (sendToRank[i]) { int ind = (int)rankToIndCommBuf.size(); rankToIndCommBuf[i] = ind; } @@ -304,13 +270,13 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /*--- Definition of the communication buffers, used to send the element data to the correct ranks. ---*/ int nRankSend = (int)rankToIndCommBuf.size(); - vector > shortSendBuf(nRankSend, vector(0)); - vector > longSendBuf(nRankSend, vector(0)); + vector > shortSendBuf(nRankSend, vector(0)); + vector > longSendBuf(nRankSend, vector(0)); vector > doubleSendBuf(nRankSend, vector(0)); /*--- The first element of longSendBuf will contain the number of elements, which are stored in the communication buffers. Initialize this value to 0. ---*/ - for(int i=0; i sizeRecv(size, 1); - SU2_MPI::Reduce_scatter(sendToRank.data(), &nRankRecv, sizeRecv.data(), - MPI_INT, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Reduce_scatter(sendToRank.data(), &nRankRecv, sizeRecv.data(), MPI_INT, MPI_SUM, SU2_MPI::GetComm()); #endif /*--- Loop over the local elements to fill the communication buffers with element data. ---*/ - for(unsigned long i=0; iGetnElem(); ++i) { + for (unsigned long i = 0; i < geometry->GetnElem(); ++i) { int ind = (int)geometry->elem[i]->GetColor(); - map::const_iterator MI = rankToIndCommBuf.find(ind); + map::const_iterator MI = rankToIndCommBuf.find(ind); ind = MI->second; - ++longSendBuf[ind][0]; /* The number of elements in the buffers must be incremented. */ + ++longSendBuf[ind][0]; /* The number of elements in the buffers must be incremented. */ shortSendBuf[ind].push_back(geometry->elem[i]->GetVTK_Type()); shortSendBuf[ind].push_back(geometry->elem[i]->GetNPolyGrid()); @@ -337,21 +302,21 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { shortSendBuf[ind].push_back(geometry->elem[i]->GetNDOFsSol()); shortSendBuf[ind].push_back(geometry->elem[i]->GetnFaces()); shortSendBuf[ind].push_back(geometry->elem[i]->GetTimeLevel()); - shortSendBuf[ind].push_back( (short) geometry->elem[i]->GetJacobianConsideredConstant()); + shortSendBuf[ind].push_back((short)geometry->elem[i]->GetJacobianConsideredConstant()); longSendBuf[ind].push_back(geometry->elem[i]->GetGlobalElemID()); longSendBuf[ind].push_back(geometry->elem[i]->GetGlobalOffsetDOFsSol()); - for(unsigned short j=0; jelem[i]->GetNDOFsGrid(); ++j) + for (unsigned short j = 0; j < geometry->elem[i]->GetNDOFsGrid(); ++j) longSendBuf[ind].push_back(geometry->elem[i]->GetNode(j)); - for(unsigned short j=0; jelem[i]->GetnFaces(); ++j) + for (unsigned short j = 0; j < geometry->elem[i]->GetnFaces(); ++j) longSendBuf[ind].push_back(geometry->elem[i]->GetNeighbor_Elements(j)); - for(unsigned short j=0; jelem[i]->GetnFaces(); ++j) { + for (unsigned short j = 0; j < geometry->elem[i]->GetnFaces(); ++j) { shortSendBuf[ind].push_back(geometry->elem[i]->GetPeriodicIndex(j)); - shortSendBuf[ind].push_back( (short) geometry->elem[i]->GetJacobianConstantFace(j)); - shortSendBuf[ind].push_back( (short) geometry->elem[i]->GetOwnerFace(j)); + shortSendBuf[ind].push_back((short)geometry->elem[i]->GetJacobianConstantFace(j)); + shortSendBuf[ind].push_back((short)geometry->elem[i]->GetOwnerFace(j)); } doubleSendBuf[ind].push_back(geometry->elem[i]->GetLengthScale()); @@ -359,26 +324,24 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /*--- Determine for each rank to which I have to send elements the data of the corresponding nodes. ---*/ - for(int i=0; i nodeIDs; unsigned long indL = 3; unsigned long indS = 3; - for(long j=0; j::iterator lastNodeID = unique(nodeIDs.begin(), nodeIDs.end()); + auto lastNodeID = unique(nodeIDs.begin(), nodeIDs.end()); nodeIDs.erase(lastNodeID, nodeIDs.end()); /*--- Add the number of node IDs and the node IDs itself to longSendBuf[i]. ---*/ @@ -386,50 +349,45 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { longSendBuf[i].insert(longSendBuf[i].end(), nodeIDs.begin(), nodeIDs.end()); /*--- Copy the coordinates to doubleSendBuf. ---*/ - for(unsigned long j=0; j::const_iterator LMI; + for (unsigned long j = 0; j < nodeIDs.size(); ++j) { + map::const_iterator LMI; LMI = globalPointIDToLocalInd.find(nodeIDs[j]); - if(LMI == globalPointIDToLocalInd.end()) - SU2_MPI::Error("Entry not found in map", CURRENT_FUNCTION); + if (LMI == globalPointIDToLocalInd.end()) SU2_MPI::Error("Entry not found in map", CURRENT_FUNCTION); unsigned long ind = LMI->second; - for(unsigned short l=0; lnodes->GetCoord(ind, l)); + for (unsigned short l = 0; l < nDim; ++l) doubleSendBuf[i].push_back(geometry->nodes->GetCoord(ind, l)); } } /*--- Loop over the boundaries to send the boundary data to the appropriate rank. ---*/ nMarker = geometry->GetnMarker(); - for(unsigned short iMarker=0; iMarker indLongBuf(nRankSend); - for(int i=0; iGetnElem_Bound(iMarker); ++i) { - + for (unsigned long i = 0; i < geometry->GetnElem_Bound(iMarker); ++i) { /* Determine the local ID of the corresponding domain element. */ - unsigned long elemID = geometry->bound[iMarker][i]->GetDomainElement() - - geometry->beg_node[rank]; + unsigned long elemID = geometry->bound[iMarker][i]->GetDomainElement() - geometry->beg_node[rank]; /* Determine to which rank this boundary element must be sent. That is the same as its corresponding domain element. Update the corresponding index in longSendBuf. */ int ind = (int)geometry->elem[elemID]->GetColor(); - map::const_iterator MI = rankToIndCommBuf.find(ind); + map::const_iterator MI = rankToIndCommBuf.find(ind); ind = MI->second; ++longSendBuf[ind][indLongBuf[ind]]; /* Get the donor information for the wall function treatment. */ const unsigned short nDonors = geometry->bound[iMarker][i]->GetNDonorsWallFunctions(); - const unsigned long *donors = geometry->bound[iMarker][i]->GetDonorsWallFunctions(); + const unsigned long* donors = geometry->bound[iMarker][i]->GetDonorsWallFunctions(); /* Store the data for this boundary element in the communication buffers. */ shortSendBuf[ind].push_back(geometry->bound[iMarker][i]->GetVTK_Type()); @@ -440,44 +398,41 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { longSendBuf[ind].push_back(geometry->bound[iMarker][i]->GetDomainElement()); longSendBuf[ind].push_back(geometry->bound[iMarker][i]->GetGlobalElemID()); - for(unsigned short j=0; jbound[iMarker][i]->GetNDOFsGrid(); ++j) + for (unsigned short j = 0; j < geometry->bound[iMarker][i]->GetNDOFsGrid(); ++j) longSendBuf[ind].push_back(geometry->bound[iMarker][i]->GetNode(j)); - for(unsigned short j=0; j > shortRecvBuf(nRankRecv, vector(0)); - vector > longRecvBuf(nRankRecv, vector(0)); + vector > shortRecvBuf(nRankRecv, vector(0)); + vector > longRecvBuf(nRankRecv, vector(0)); vector > doubleRecvBuf(nRankRecv, vector(0)); /*--- Communicate the data to the correct ranks. Make a distinction between parallel and sequential mode. ---*/ - map::const_iterator MI; + map::const_iterator MI; #ifdef HAVE_MPI /*--- Parallel mode. Send all the data using non-blocking sends. ---*/ - vector commReqs(3*nRankSend); + vector commReqs(3 * nRankSend); MI = rankToIndCommBuf.begin(); - for(int i=0; ifirst; - SU2_MPI::Isend(shortSendBuf[i].data(), shortSendBuf[i].size(), MPI_SHORT, - dest, dest, SU2_MPI::GetComm(), &commReqs[3*i]); - SU2_MPI::Isend(longSendBuf[i].data(), longSendBuf[i].size(), MPI_LONG, - dest, dest+1, SU2_MPI::GetComm(), &commReqs[3*i+1]); - SU2_MPI::Isend(doubleSendBuf[i].data(), doubleSendBuf[i].size(), MPI_DOUBLE, - dest, dest+2, SU2_MPI::GetComm(), &commReqs[3*i+2]); + SU2_MPI::Isend(shortSendBuf[i].data(), shortSendBuf[i].size(), MPI_SHORT, dest, dest, SU2_MPI::GetComm(), + &commReqs[3 * i]); + SU2_MPI::Isend(longSendBuf[i].data(), longSendBuf[i].size(), MPI_LONG, dest, dest + 1, SU2_MPI::GetComm(), + &commReqs[3 * i + 1]); + SU2_MPI::Isend(doubleSendBuf[i].data(), doubleSendBuf[i].size(), MPI_DOUBLE, dest, dest + 2, SU2_MPI::GetComm(), + &commReqs[3 * i + 2]); } /* Loop over the number of ranks from which I receive data. */ - for(int i=0; i().swap(shortSendBuf[i]); vector().swap(longSendBuf[i]); vector().swap(doubleSendBuf[i]); @@ -537,41 +489,41 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /*--- Allocate the memory for the number of elements for every boundary marker and initialize them to zero. ---*/ nElem_Bound = new unsigned long[nMarker]; - for(unsigned short i=0; i globalElemID; globalElemID.reserve(nElem); - for(int i=0; i haloElements; + vector haloElements; vector ownedElements; unsigned short maxTimeLevelLoc = 0; - for(int i=0; iGetQuadrature_Factor_Straight()); - const unsigned short orderExactCurved = - (unsigned short) ceil(nPolySol*config->GetQuadrature_Factor_Curved()); - if(orderExactStraight == orderExactCurved) JacConstant = false; + if (JacConstant) { + const auto orderExactStraight = (unsigned short)ceil(nPolySol * config->GetQuadrature_Factor_Straight()); + const auto orderExactCurved = (unsigned short)ceil(nPolySol * config->GetQuadrature_Factor_Curved()); + if (orderExactStraight == orderExactCurved) JacConstant = false; } /* Update the local value of the maximum time level. */ @@ -622,32 +572,27 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { and the information needed to reorder the owned elements. ---*/ indS += 8; indL += nDOFsGrid + 2; - for(unsigned short k=0; k::iterator lastHalo = unique(haloElements.begin(), haloElements.end()); + auto lastHalo = unique(haloElements.begin(), haloElements.end()); haloElements.erase(lastHalo, haloElements.end()); /* Determine the maximum global time level and possibly reset the number @@ -700,11 +643,10 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { unsigned short maxTimeLevelGlob = maxTimeLevelLoc; #ifdef HAVE_MPI - SU2_MPI::Allreduce(&maxTimeLevelLoc, &maxTimeLevelGlob, - 1, MPI_UNSIGNED_SHORT, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&maxTimeLevelLoc, &maxTimeLevelGlob, 1, MPI_UNSIGNED_SHORT, MPI_MAX, SU2_MPI::GetComm()); #endif - const unsigned short nTimeLevels = maxTimeLevelGlob+1; + const unsigned short nTimeLevels = maxTimeLevelGlob + 1; config->SetnLevels_TimeAccurateLTS(nTimeLevels); /*----------------------------------------------------------------------------*/ @@ -714,40 +656,37 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /* Determine the number of owned elements and the total number of elements stored on this rank. */ nVolElemOwned = globalElemID.size(); - nVolElemTot = nVolElemOwned + haloElements.size(); + nVolElemTot = nVolElemOwned + haloElements.size(); /* Determine the map from the global element ID to the current storage sequence of ownedElements. */ map mapGlobalElemIDToInd; - for(unsigned long i=0; i nElemPerRankOr(size+1); + vector nElemPerRankOr(size + 1); - for(int i=0; ibeg_node[i]; - nElemPerRankOr[size] = geometry->end_node[size-1]; + for (int i = 0; i < size; ++i) nElemPerRankOr[i] = geometry->beg_node[i]; + nElemPerRankOr[size] = geometry->end_node[size - 1]; /* Determine to which ranks I have to send messages to find out the information of the halos stored on this rank. */ sendToRank.assign(size, 0); - for(unsigned long i=0; i::iterator low; - low = lower_bound(nElemPerRankOr.begin(), nElemPerRankOr.end(), - haloElements[i].long0); + low = lower_bound(nElemPerRankOr.begin(), nElemPerRankOr.end(), haloElements[i].long0); unsigned long rankHalo = low - nElemPerRankOr.begin(); - if(*low > haloElements[i].long0) --rankHalo; + if (*low > haloElements[i].long0) --rankHalo; sendToRank[rankHalo] = 1; } rankToIndCommBuf.clear(); - for(int i=0; i::iterator low; - low = lower_bound(nElemPerRankOr.begin(), nElemPerRankOr.end(), - haloElements[i].long0); + low = lower_bound(nElemPerRankOr.begin(), nElemPerRankOr.end(), haloElements[i].long0); unsigned long ind = low - nElemPerRankOr.begin(); - if(*low > haloElements[i].long0) --ind; + if (*low > haloElements[i].long0) --ind; /* Convert this rank to the index in the send buffer. */ MI = rankToIndCommBuf.find((int)ind); @@ -784,7 +720,7 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { The subtraction of 1 is there to obtain the correct periodic index. In haloElements a +1 is added, because this variable is of unsigned long, which cannot handle negative numbers. */ - long perIndex = haloElements[i].long1 -1; + long perIndex = haloElements[i].long1 - 1; longSendBuf[ind].push_back(haloElements[i].long0); longSendBuf[ind].push_back(perIndex); @@ -805,15 +741,14 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { commReqs.resize(nRankSend); MI = rankToIndCommBuf.begin(); - for(int i=0; ifirst; - SU2_MPI::Isend(longSendBuf[i].data(), longSendBuf[i].size(), MPI_LONG, - dest, dest, SU2_MPI::GetComm(), &commReqs[i]); + SU2_MPI::Isend(longSendBuf[i].data(), longSendBuf[i].size(), MPI_LONG, dest, dest, SU2_MPI::GetComm(), + &commReqs[i]); } /* Loop over the number of ranks from which I receive data. */ - for(int i=0; i().swap(longSendBuf[i]); } @@ -856,24 +789,22 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { #endif /*--- Loop over the receive buffers to fill and send the send buffers again. ---*/ - for(int i=0; ibeg_node[rank]; - if(localID < 0 || localID >= (long) geometry->nPointLinear[rank]) { + if (localID < 0 || localID >= (long)geometry->nPointLinear[rank]) { ostringstream message; message << localID << " " << geometry->nPointLinear[rank] << endl; message << "Invalid local element ID"; @@ -887,15 +818,15 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { longSendBuf[i].push_back(geometry->elem[localID]->GetColor()); } - /* Release the memory of this receive buffer. */ + /* Release the memory of this receive buffer. */ vector().swap(longSecondRecvBuf[i]); /*--- Send the send buffer back to the calling rank. Only in parallel mode of course. ---*/ #ifdef HAVE_MPI int dest = sourceRank[i]; - SU2_MPI::Isend(longSendBuf[i].data(), longSendBuf[i].size(), MPI_LONG, - dest, dest+1, SU2_MPI::GetComm(), &commReqs[i]); + SU2_MPI::Isend(longSendBuf[i].data(), longSendBuf[i].size(), MPI_LONG, dest, dest + 1, SU2_MPI::GetComm(), + &commReqs[i]); #endif } @@ -909,12 +840,11 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /* Parallel mode. Loop over the number of ranks from which I receive data in the return communication, i.e. nRankSend. */ - for(int i=0; i().swap(longSendBuf[i]); + for (int i = 0; i < nRankRecv; ++i) vector().swap(longSendBuf[i]); /* Copy the data from the receive buffers into a class of CLong3T, such that it can be sorted in increasing order. Note that the rank of the element is stored first, followed by its global ID and last the periodic index. */ vector haloData; - for(int i=0; i nHaloElemPerRank(size+1, 0); - for(unsigned long i=0; i nHaloElemPerRank(size + 1, 0); + for (unsigned long i = 0; i < haloData.size(); ++i) ++nHaloElemPerRank[haloData[i].long0 + 1]; nHaloElemPerRank[0] = nVolElemOwned; - for(int i=0; i nHaloElemPerRank[i]) { + for (int i = 0; i < size; ++i) { + if (nHaloElemPerRank[i + 1] > nHaloElemPerRank[i]) { sendToRank[i] = 1; int ind = (int)rankToIndCommBuf.size(); rankToIndCommBuf[i] = ind; @@ -999,17 +922,16 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { nRankRecv = nRankSend; #ifdef HAVE_MPI - SU2_MPI::Reduce_scatter(sendToRank.data(), &nRankRecv, sizeRecv.data(), - MPI_INT, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Reduce_scatter(sendToRank.data(), &nRankRecv, sizeRecv.data(), MPI_INT, MPI_SUM, SU2_MPI::GetComm()); #endif /* Copy the data to be sent to the send buffers. */ longSendBuf.resize(nRankSend); MI = rankToIndCommBuf.begin(); - for(int i=0; ifirst; - for(unsigned long j=nHaloElemPerRank[dest]; jfirst; - SU2_MPI::Isend(longSendBuf[i].data(), longSendBuf[i].size(), MPI_LONG, - dest, dest, SU2_MPI::GetComm(), &commReqs[i]); + SU2_MPI::Isend(longSendBuf[i].data(), longSendBuf[i].size(), MPI_LONG, dest, dest, SU2_MPI::GetComm(), + &commReqs[i]); } /* Resize the vector to store the ranks from which the message came. */ sourceRank.resize(nRankRecv); /* Loop over the number of ranks from which I receive data. */ - for(int i=0; i().swap(longSendBuf[i]); } @@ -1077,14 +996,13 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { do this when ownedElements are constructed, elements that are donors for the wall function treatment and are not direct neighbors may have been missed. ---*/ - for(int i=0; i::iterator MMI = mapGlobalElemIDToInd.find(elemID); - if(MMI == mapGlobalElemIDToInd.end()) + auto MMI = mapGlobalElemIDToInd.find(elemID); + if (MMI == mapGlobalElemIDToInd.end()) SU2_MPI::Error("Entry not found in mapGlobalElemIDToInd", CURRENT_FUNCTION); ownedElements[MMI->second].SetCommSolution(true); @@ -1121,15 +1039,14 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /* Determine the number of elements/faces that are treated simultaneously */ /* in the matrix products to obtain good gemm performance. */ - const unsigned short nElemSimul = config->GetSizeMatMulPadding()/nVar; + const unsigned short nElemSimul = config->GetSizeMatMulPadding() / nVar; /* Determine the number of different element types present. */ map mapElemTypeToInd; - for(vector::iterator OEI =ownedElements.begin(); - OEI!=ownedElements.end(); ++OEI) { + for (auto OEI = ownedElements.begin(); OEI != ownedElements.end(); ++OEI) { const unsigned short elType = OEI->GetElemType(); - if(mapElemTypeToInd.find(elType) == mapElemTypeToInd.end()) { + if (mapElemTypeToInd.find(elType) == mapElemTypeToInd.end()) { const unsigned short ind = mapElemTypeToInd.size(); mapElemTypeToInd[elType] = ind; } @@ -1140,25 +1057,21 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { communicated) and elements that are communicated. Later on these vectors will be put in cumulative storage format, which explains the +1 for the second index. */ - vector > nInternalElem(nTimeLevels, - vector(mapElemTypeToInd.size()+1)); - vector > nCommElem(nTimeLevels, - vector(mapElemTypeToInd.size()+1)); - for(unsigned short i=0; i > nInternalElem(nTimeLevels, vector(mapElemTypeToInd.size() + 1)); + vector > nCommElem(nTimeLevels, vector(mapElemTypeToInd.size() + 1)); + for (unsigned short i = 0; i < nTimeLevels; ++i) { + for (unsigned long j = 0; j <= mapElemTypeToInd.size(); ++j) { nInternalElem[i][j] = 0; nCommElem[i][j] = 0; } } - for(vector::iterator OEI =ownedElements.begin(); - OEI!=ownedElements.end(); ++OEI) { + for (auto OEI = ownedElements.begin(); OEI != ownedElements.end(); ++OEI) { const unsigned short elType = OEI->GetElemType(); map::const_iterator MI = mapElemTypeToInd.find(elType); - unsigned short ind = MI->second +1; + unsigned short ind = MI->second + 1; - if( OEI->GetCommSolution() ) + if (OEI->GetCommSolution()) ++nCommElem[OEI->GetTimeLevel()][ind]; else ++nInternalElem[OEI->GetTimeLevel()][ind]; @@ -1167,24 +1080,21 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /* Loop again over the owned elements and check if elements, which do not have to send their solution, should be flagged as such in order to improve the gemm performance. */ - for(vector::iterator OEI =ownedElements.begin(); - OEI!=ownedElements.end(); ++OEI) { - + for (auto OEI = ownedElements.begin(); OEI != ownedElements.end(); ++OEI) { /* Check for an internal element, i.e. an element for which the solution does not need to be communicated. */ - if( !OEI->GetCommSolution() ) { - + if (!OEI->GetCommSolution()) { /* Determine the time level and the index of the element type. */ const unsigned short tLev = OEI->GetTimeLevel(); const unsigned short elType = OEI->GetElemType(); map::const_iterator MI = mapElemTypeToInd.find(elType); - const unsigned short ind = MI->second +1; + const unsigned short ind = MI->second + 1; /* Determine whether or not this element must be moved from internal to comm elements to improve performance. Change the appropriate data when this must happen. */ - if(nInternalElem[tLev][ind]%nElemSimul && nCommElem[tLev][ind]%nElemSimul) { + if (nInternalElem[tLev][ind] % nElemSimul && nCommElem[tLev][ind] % nElemSimul) { OEI->SetCommSolution(true); --nInternalElem[tLev][ind]; ++nCommElem[tLev][ind]; @@ -1195,30 +1105,30 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /* Check whether there are enough elements in every partition for every time level to guarantee a good gemm performance. */ unsigned long nFullChunks = 0, nPartialChunks = 0; - for(unsigned short tLev=0; tLev= (nPartialChunks+nFullChunks)) tooManyPartChunksLoc = 1; + if (5 * nPartialChunks >= (nPartialChunks + nFullChunks)) tooManyPartChunksLoc = 1; /* Determine the number of ranks which contain too many partial chunks. The result only needs to be known on the master node. */ unsigned long nRanksTooManyPartChunks = tooManyPartChunksLoc; #ifdef HAVE_MPI - SU2_MPI::Reduce(&tooManyPartChunksLoc, &nRanksTooManyPartChunks, 1, - MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Reduce(&tooManyPartChunksLoc, &nRanksTooManyPartChunks, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, + SU2_MPI::GetComm()); #endif - if((rank == MASTER_NODE) && (nRanksTooManyPartChunks != 0) && (size > 1)) { + if ((rank == MASTER_NODE) && (nRanksTooManyPartChunks != 0) && (size > 1)) { cout << endl << " WARNING" << endl; cout << "There are " << nRanksTooManyPartChunks << " partitions for which " << " the simultaneous treatment of volume elements is not optimal." << endl; @@ -1226,14 +1136,12 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { } /* Put nInternalElem and nCommElem in cumulative storage format. */ - for(unsigned short tLev=0; tLev > neighElem(nVolElemOwned, vector(0)); - nRankRecv = (int) longRecvBuf.size(); - for(int i=0; i::iterator MMI = mapGlobalElemIDToInd.find(globalID); + auto MMI = mapGlobalElemIDToInd.find(globalID); unsigned long ind = MMI->second; indS += 8; indL += nDOFsGrid + 2; - for(unsigned short k=0; ksecond); + if (MMI != mapGlobalElemIDToInd.end()) neighElem[ind].push_back(MMI->second); } } } } /* Sort the neighbors of each element in increasing order. */ - for(unsigned long i=0; i::const_iterator MI = mapElemTypeToInd.find(elType); unsigned short ind = MI->second; unsigned long indEnd; - if( ownedElements[indBeg].GetCommSolution() ) - indEnd = nCommElem[timeLevel][ind+1]; + if (ownedElements[indBeg].GetCommSolution()) + indEnd = nCommElem[timeLevel][ind + 1]; else - indEnd = nInternalElem[timeLevel][ind+1]; + indEnd = nInternalElem[timeLevel][ind + 1]; /* Determine the element in the range [indBeg,indEnd) with the least number of neighbors that has not been renumbered yet. This is the starting element for the current renumbering round. */ - for(unsigned long i=(indBeg+1); i frontElements(1, indBeg); - while( frontElements.size() ) { - + while (!frontElements.empty()) { /* Vector, which stores the front for the next round. */ vector frontElementsNew; /* Loop over the elements of the current front. */ - for(unsigned long i=0; isecond; - if( ownedElements[iFront].GetCommSolution() ) + if (ownedElements[iFront].GetCommSolution()) oldElemToNewElem[iFront] = nCommElem[timeLevel][ind]++; else oldElemToNewElem[iFront] = nInternalElem[timeLevel][ind]++; @@ -1362,8 +1263,8 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /* Store the neighbors that have not been renumbered yet in the front for the next round. Set its index to -2 to indicate that the element is already on the new front. */ - for(unsigned long j=0; jGetMarker_All_TagBound(iMarker); + for (unsigned short iMarker = 0; iMarker < nMarker; ++iMarker) { + boundaries[iMarker].markerTag = config->GetMarker_All_TagBound(iMarker); boundaries[iMarker].periodicBoundary = config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY; boundaries[iMarker].surfElem.reserve(nElem_Bound[iMarker]); } /*--- Copy the data from the communication buffers. ---*/ - for(int i=0; i::iterator MMI = mapGlobalElemIDToInd.find(elemID); + auto MMI = mapGlobalElemIDToInd.find(elemID); unsigned long ind = MMI->second; /* Store the data. */ - volElem[ind].elemIsOwned = true; - volElem[ind].rankOriginal = rank; + volElem[ind].elemIsOwned = true; + volElem[ind].rankOriginal = rank; volElem[ind].periodIndexToDonor = -1; - volElem[ind].VTK_Type = shortRecvBuf[i][indS++]; + volElem[ind].VTK_Type = shortRecvBuf[i][indS++]; volElem[ind].nPolyGrid = shortRecvBuf[i][indS++]; - volElem[ind].nPolySol = shortRecvBuf[i][indS++]; + volElem[ind].nPolySol = shortRecvBuf[i][indS++]; volElem[ind].nDOFsGrid = shortRecvBuf[i][indS++]; - volElem[ind].nDOFsSol = shortRecvBuf[i][indS++]; - volElem[ind].nFaces = shortRecvBuf[i][indS++]; + volElem[ind].nDOFsSol = shortRecvBuf[i][indS++]; + volElem[ind].nFaces = shortRecvBuf[i][indS++]; volElem[ind].timeLevel = shortRecvBuf[i][indS++]; - volElem[ind].JacIsConsideredConstant = (bool) shortRecvBuf[i][indS++]; + volElem[ind].JacIsConsideredConstant = (bool)shortRecvBuf[i][indS++]; - volElem[ind].elemIDGlobal = elemID; + volElem[ind].elemIDGlobal = elemID; volElem[ind].offsetDOFsSolGlobal = longRecvBuf[i][indL++]; volElem[ind].nodeIDsGrid.resize(volElem[ind].nDOFsGrid); volElem[ind].JacFacesIsConsideredConstant.resize(volElem[ind].nFaces); volElem[ind].ElementOwnsFaces.resize(volElem[ind].nFaces); - for(unsigned short k=0; k::iterator lastPoint = unique(meshPoints.begin(), meshPoints.end()); + auto lastPoint = unique(meshPoints.begin(), meshPoints.end()); meshPoints.erase(lastPoint, meshPoints.end()); /* Clear the contents of the map globalPointIDToLocalInd and fill it with the information present in meshPoints. */ globalPointIDToLocalInd.clear(); - for(unsigned long i=0; i().swap(shortRecvBuf[i]); vector().swap(longRecvBuf[i]); vector().swap(doubleRecvBuf[i]); } /*--- Sort the surface elements of the boundaries in increasing order. ---*/ - for(unsigned short iMarker=0; iMarker elemBuf(nElemBuf); - for(unsigned long j=0; j::iterator MMI = mapGlobalElemIDToInd.find(elemID); - if(MMI == mapGlobalElemIDToInd.end()) + auto MMI = mapGlobalElemIDToInd.find(elemID); + if (MMI == mapGlobalElemIDToInd.end()) SU2_MPI::Error("Entry not found in mapGlobalElemIDToInd", CURRENT_FUNCTION); elemBuf[j].long0 = MMI->second; - elemBuf[j].long1 = longSecondRecvBuf[i][j2+1] + 1; + elemBuf[j].long1 = longSecondRecvBuf[i][j2 + 1] + 1; } /* Release the memory of the long receive buffer via the swap function @@ -1604,15 +1496,14 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { vector nodeIDs; /* Loop over the elements to fill the send buffers. */ - for(unsigned long j=0; j::iterator lastNodeID = unique(nodeIDs.begin(), nodeIDs.end()); + auto lastNodeID = unique(nodeIDs.begin(), nodeIDs.end()); nodeIDs.erase(lastNodeID, nodeIDs.end()); /* Add the number of node IDs and the node IDs itself to longSendBuf[i] @@ -1648,34 +1538,32 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { periodic index, because an unsigned long cannot represent -1, the value for the periodic index when no peridicity is present. */ longSendBuf[i].push_back(nodeIDs.size()); - for(unsigned long j=0; j::const_iterator LMI; + for (unsigned long j = 0; j < nodeIDs.size(); ++j) { + map::const_iterator LMI; LMI = globalPointIDToLocalInd.find(nodeIDs[j].long0); - if(LMI == globalPointIDToLocalInd.end()) - SU2_MPI::Error("Entry not found in map", CURRENT_FUNCTION); + if (LMI == globalPointIDToLocalInd.end()) SU2_MPI::Error("Entry not found in map", CURRENT_FUNCTION); unsigned long ind = LMI->second; - for(unsigned short l=0; l().swap(shortSendBuf[i]); vector().swap(longSendBuf[i]); vector().swap(doubleSendBuf[i]); @@ -1768,12 +1652,12 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { vector haloElemInfo; haloElemInfo.reserve(nVolElemTot - nVolElemOwned); - for(int i=0; i haloPoints; - for(int i=0; i::iterator low; low = lower_bound(haloElemInfo.begin(), haloElemInfo.end(), thisElem); @@ -1806,27 +1688,27 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { volElem[indV].rankOriginal = sourceRank[i]; volElem[indV].periodIndexToDonor = shortRecvBuf[i][indS++]; - volElem[indV].VTK_Type = shortRecvBuf[i][indS++]; - volElem[indV].nPolyGrid = shortRecvBuf[i][indS++]; - volElem[indV].nPolySol = shortRecvBuf[i][indS++]; - volElem[indV].nDOFsGrid = shortRecvBuf[i][indS++]; - volElem[indV].nDOFsSol = shortRecvBuf[i][indS++]; - volElem[indV].nFaces = shortRecvBuf[i][indS++]; - volElem[indV].timeLevel = shortRecvBuf[i][indS++]; + volElem[indV].VTK_Type = shortRecvBuf[i][indS++]; + volElem[indV].nPolyGrid = shortRecvBuf[i][indS++]; + volElem[indV].nPolySol = shortRecvBuf[i][indS++]; + volElem[indV].nDOFsGrid = shortRecvBuf[i][indS++]; + volElem[indV].nDOFsSol = shortRecvBuf[i][indS++]; + volElem[indV].nFaces = shortRecvBuf[i][indS++]; + volElem[indV].timeLevel = shortRecvBuf[i][indS++]; volElem[indV].nodeIDsGrid.resize(volElem[indV].nDOFsGrid); - for(unsigned short k=0; kGetGlobal_nPoint(); unsigned long InvalidPointID = Global_nPoint + 10; - short InvalidPerInd = SHRT_MAX; + short InvalidPerInd = SHRT_MAX; /*--- Search for the nonperiodic halo points in the local points to see if these points are already stored on this rank. If this is the case invalidate this halo and decrease the number of halo points. Afterwards remove the invalid halos from the vector. ---*/ unsigned long nHaloPoints = haloPoints.size(); - for(unsigned long i=0; i mapGlobalPointIDToInd; - for(unsigned long i=0; i::const_iterator LLMI; LLMI = mapGlobalPointIDToInd.find(searchItem); @@ -1924,53 +1804,46 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /*--- The only halo points that must be added to meshPoints are the periodic halo points. It must be checked whether or not the periodic points in haloPoints match with points in meshPoints. This is done below. ---*/ - for(unsigned long iLow=0; iLow &surfElem = boundaries[perIndex].surfElem; + vector& surfElem = boundaries[perIndex].surfElem; /*--- In the loop below the coordinates of the points of this local periodic boundary as well as a matching tolerance are determined. A vector of point ID's is also created, which is needed later on when it is checked whether or not a matching point is already stored in meshPoints. ---*/ - vector indInPoints(meshPoints.size(), -1); + vector indInPoints(meshPoints.size(), -1); vector IDsPoints; - vector coordPoints; - vector tolPoints; - - for(unsigned long j=0; j coordPoints; + vector tolPoints; + for (unsigned long j = 0; j < surfElem.size(); ++j) { /* Determine the tolerance for equal points, which is a small value times the length scale of the adjacent volume element. */ - const su2double tolElem = 1.e-2*volElem[surfElem[j].volElemID].lenScale; + const su2double tolElem = 1.e-2 * volElem[surfElem[j].volElemID].lenScale; /* Loop over the nodes of this surface grid and update the points on this periodic boundary. */ - for(unsigned short k=0; kGetPeriodicRotCenter(config->GetMarker_All_TagBound(perIndex)); auto angles = config->GetPeriodicRotAngles(config->GetMarker_All_TagBound(perIndex)); - auto trans = config->GetPeriodicTranslation(config->GetMarker_All_TagBound(perIndex)); + auto trans = config->GetPeriodicTranslation(config->GetMarker_All_TagBound(perIndex)); /*--- Compute the rotation matrix and translation vector for the transformation from the donor. This is the transpose of the transformation to the donor. ---*/ /* Store (center-trans) as it is constant and will be added on. */ - su2double translation[] = {center[0] - trans[0], - center[1] - trans[1], - center[2] - trans[2]}; + su2double translation[] = {center[0] - trans[0], center[1] - trans[1], center[2] - trans[2]}; /* Store angles separately for clarity. Compute sines/cosines. */ su2double theta = angles[0]; - su2double phi = angles[1]; - su2double psi = angles[2]; + su2double phi = angles[1]; + su2double psi = angles[2]; su2double cosTheta = cos(theta), cosPhi = cos(phi), cosPsi = cos(psi); su2double sinTheta = sin(theta), sinPhi = sin(phi), sinPsi = sin(psi); @@ -2007,65 +1877,57 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /* Compute the rotation matrix. Note that the implicit ordering is rotation about the x-axis, y-axis, then z-axis. */ su2double rotMatrix[3][3]; - rotMatrix[0][0] = cosPhi*cosPsi; - rotMatrix[0][1] = cosPhi*sinPsi; + rotMatrix[0][0] = cosPhi * cosPsi; + rotMatrix[0][1] = cosPhi * sinPsi; rotMatrix[0][2] = -sinPhi; - rotMatrix[1][0] = sinTheta*sinPhi*cosPsi - cosTheta*sinPsi; - rotMatrix[1][1] = sinTheta*sinPhi*sinPsi + cosTheta*cosPsi; - rotMatrix[1][2] = sinTheta*cosPhi; + rotMatrix[1][0] = sinTheta * sinPhi * cosPsi - cosTheta * sinPsi; + rotMatrix[1][1] = sinTheta * sinPhi * sinPsi + cosTheta * cosPsi; + rotMatrix[1][2] = sinTheta * cosPhi; - rotMatrix[2][0] = cosTheta*sinPhi*cosPsi + sinTheta*sinPsi; - rotMatrix[2][1] = cosTheta*sinPhi*sinPsi - sinTheta*cosPsi; - rotMatrix[2][2] = cosTheta*cosPhi; + rotMatrix[2][0] = cosTheta * sinPhi * cosPsi + sinTheta * sinPsi; + rotMatrix[2][1] = cosTheta * sinPhi * sinPsi - sinTheta * cosPsi; + rotMatrix[2][2] = cosTheta * cosPhi; /* Loop over the halo points for this periodic transformation. */ - for(unsigned long i=iLow; i::const_iterator LLMI; LLMI = mapGlobalPointIDToInd.find(searchItem); volElem[i].nodeIDsGrid[j] = LLMI->second; @@ -2097,91 +1959,83 @@ CMeshFEM::CMeshFEM(CGeometry *geometry, CConfig *config) { /* Determine the number of halo elements per time level in cumulative storage format. */ - nVolElemHaloPerTimeLevel.assign(nTimeLevels+1, 0); - for(unsigned long i=nVolElemOwned; i helpDxdrVec(nIntegration*nDim*nDim); - su2double *dxdrVec = helpDxdrVec.data(); + vector helpDxdrVec(nIntegration * nDim * nDim); + su2double* dxdrVec = helpDxdrVec.data(); /* Determine the gradients of the Cartesian coordinates w.r.t. the parametric coordinates. */ - ComputeGradientsCoorWRTParam(nIntegration, nDOFs, matDerBasisInt, DOFs, - dxdrVec, config); + ComputeGradientsCoorWRTParam(nIntegration, nDOFs, matDerBasisInt, DOFs, dxdrVec, config); /* Make a distinction between 2D and 3D to compute the derivatives drdx, drdy, etc. */ - switch( nDim ) { + switch (nDim) { case 2: { /* 2D computation. Store the offset between the r and s derivatives. */ - const unsigned short off = 2*nIntegration; + const unsigned short off = 2 * nIntegration; /* Loop over the integration points. */ unsigned short ii = 0; - for(unsigned short j=0; j vecRHS(nDOFs*nDim); + vector vecRHS(nDOFs * nDim); /* Loop over the grid DOFs of the element and copy the coordinates in vecRHS in row major order. */ unsigned long ic = 0; - for(unsigned short j=0; jgemm(nDim*nIntegration, nDim, nDOFs, matDerBasisInt, - vecRHS.data(), derivCoor, nullptr); + blasFunctions->gemm(nDim * nIntegration, nDim, nDOFs, matDerBasisInt, vecRHS.data(), derivCoor, nullptr); } -void CMeshFEM::ComputeNormalsFace(const unsigned short nIntegration, - const unsigned short nDOFs, - const su2double *dr, - const su2double *ds, - const unsigned long *DOFs, - su2double *normals) { - +void CMeshFEM::ComputeNormalsFace(const unsigned short nIntegration, const unsigned short nDOFs, const su2double* dr, + const su2double* ds, const unsigned long* DOFs, su2double* normals) { /* Initialize the counter ii to 0. ii is the index in normals where the information is stored. */ unsigned int ii = 0; /* Make a distinction between 2D and 3D. */ - switch( nDim ) { + switch (nDim) { case 2: { /* 2D computation. Loop over the integration points of the face. */ - for(unsigned short j=0; jGetKind_Solver() != MAIN_SOLVER::FEM_EULER && config->GetKind_Solver() != MAIN_SOLVER::DISC_ADJ_FEM_EULER); + const bool viscousTerms = (config->GetKind_Solver() != MAIN_SOLVER::FEM_EULER && + config->GetKind_Solver() != MAIN_SOLVER::DISC_ADJ_FEM_EULER); /*--- Loop over the boundary faces stored on this rank. ---*/ - for(unsigned long i=0; isurfElem.size(); ++i) { - + for (unsigned long i = 0; i < boundary->surfElem.size(); ++i) { /*--------------------------------------------------------------------------*/ /*--- Step 1: Allocate the memory for the face metric terms. ---*/ /*--- Depending on the case, not all of this memory is needed. ---*/ @@ -2323,18 +2161,17 @@ void CMeshFEM::MetricTermsBoundaryFaces(CBoundaryFEM *boundary, /* Determine the corresponding standard face element and get the relevant information from it. */ - const unsigned short ind = boundary->surfElem[i].indStandardElement; + const unsigned short ind = boundary->surfElem[i].indStandardElement; const unsigned short nInt = standardBoundaryFacesSol[ind].GetNIntegration(); /*--- Allocate the several metric terms. ---*/ - boundary->surfElem[i].metricNormalsFace.resize(nInt*(nDim+1)); + boundary->surfElem[i].metricNormalsFace.resize(nInt * (nDim + 1)); - if( viscousTerms ) - boundary->surfElem[i].metricCoorDerivFace.resize(nInt*nDim*nDim); + if (viscousTerms) boundary->surfElem[i].metricCoorDerivFace.resize(nInt * nDim * nDim); /* Allocate the memory for the grid velocities and initialize them to the default value of zero. */ - boundary->surfElem[i].gridVelocities.assign(nInt*nDim, 0.0); + boundary->surfElem[i].gridVelocities.assign(nInt * nDim, 0.0); /*--------------------------------------------------------------------------*/ /*--- Step 2: Determine the actual metric data in the integration points ---*/ @@ -2344,8 +2181,8 @@ void CMeshFEM::MetricTermsBoundaryFaces(CBoundaryFEM *boundary, /* Call the function ComputeNormalsFace to compute the unit normals and its corresponding area in the integration points. */ unsigned short nDOFs = standardBoundaryFacesGrid[ind].GetNDOFsFace(); - const su2double *dr = standardBoundaryFacesGrid[ind].GetDrBasisFaceIntegration(); - const su2double *ds = standardBoundaryFacesGrid[ind].GetDsBasisFaceIntegration(); + const su2double* dr = standardBoundaryFacesGrid[ind].GetDrBasisFaceIntegration(); + const su2double* ds = standardBoundaryFacesGrid[ind].GetDsBasisFaceIntegration(); ComputeNormalsFace(nInt, nDOFs, dr, ds, boundary->surfElem[i].DOFsGridFace.data(), boundary->surfElem[i].metricNormalsFace.data()); @@ -2353,61 +2190,51 @@ void CMeshFEM::MetricTermsBoundaryFaces(CBoundaryFEM *boundary, /* Compute the derivatives of the parametric coordinates w.r.t. the Cartesian coordinates, i.e. drdx, drdy, etc. in the integration points of the face, if needed. */ - if( viscousTerms ) { + if (viscousTerms) { nDOFs = standardBoundaryFacesGrid[ind].GetNDOFsElem(); - dr = standardBoundaryFacesGrid[ind].GetMatDerBasisElemIntegration(); + dr = standardBoundaryFacesGrid[ind].GetMatDerBasisElemIntegration(); - ComputeGradientsCoordinatesFace(nInt, nDOFs, dr, - boundary->surfElem[i].DOFsGridElement.data(), - boundary->surfElem[i].metricCoorDerivFace.data(), - config); + ComputeGradientsCoordinatesFace(nInt, nDOFs, dr, boundary->surfElem[i].DOFsGridElement.data(), + boundary->surfElem[i].metricCoorDerivFace.data(), config); } } } -void CMeshFEM::SetPositive_ZArea(CConfig *config) { - +void CMeshFEM::SetPositive_ZArea(CConfig* config) { /*---------------------------------------------------------------------------*/ /*--- Step 1: Determine the local contribution to the positive z area. ---*/ /*---------------------------------------------------------------------------*/ /* Loop over the boundary markers. */ su2double PositiveZArea = 0.0; - for(unsigned short iMarker=0; iMarkerGetMarker_All_KindBC(iMarker); + const unsigned short Boundary = config->GetMarker_All_KindBC(iMarker); const unsigned short Monitoring = config->GetMarker_All_Monitoring(iMarker); - if( ((Boundary == EULER_WALL) || - (Boundary == HEAT_FLUX) || - (Boundary == ISOTHERMAL) || - (Boundary == LOAD_BOUNDARY) || - (Boundary == DISPLACEMENT_BOUNDARY)) && (Monitoring == YES) ) { - + if (((Boundary == EULER_WALL) || (Boundary == HEAT_FLUX) || (Boundary == ISOTHERMAL) || + (Boundary == LOAD_BOUNDARY) || (Boundary == DISPLACEMENT_BOUNDARY)) && + (Monitoring == YES)) { /* Easier storage of the surface elements for this marker. */ - const vector &surfElem = boundaries[iMarker].surfElem; + const vector& surfElem = boundaries[iMarker].surfElem; /* Loop over the surface elements. */ - for(unsigned long i=0; iGetRefArea() == 0.0) - config->SetRefArea(PositiveZArea); + if (config->GetRefArea() == 0.0) config->SetRefArea(PositiveZArea); if (rank == MASTER_NODE) { - if (nDim == 2) cout << "Area projection in the y-plane = "<< PositiveZArea << "." << endl; - else cout << "Area projection in the z-plane = "<< PositiveZArea << "." << endl; + if (nDim == 2) + cout << "Area projection in the y-plane = " << PositiveZArea << "." << endl; + else + cout << "Area projection in the z-plane = " << PositiveZArea << "." << endl; } } -CMeshFEM_DG::CMeshFEM_DG(CGeometry *geometry, CConfig *config) - : CMeshFEM(geometry, config) { -} +CMeshFEM_DG::CMeshFEM_DG(CGeometry* geometry, CConfig* config) : CMeshFEM(geometry, config) {} -void CMeshFEM_DG::SetGlobal_to_Local_Point(void) { +void CMeshFEM_DG::SetGlobal_to_Local_Point() { Global_to_Local_Point.clear(); unsigned long ii = 0; - for(unsigned long i=0; i &surfElem = boundaries[iMarker].surfElem; + vector& surfElem = boundaries[iMarker].surfElem; /* Loop over the boundary faces and determine the coordinates in the integration points. */ - for(unsigned long l=0; l localFaces; - for(unsigned long k=0; kGetQuadrature_Factor_Straight()); - unsigned short orderExactCurved = - (unsigned short) ceil(thisFace.nPolyGrid0*config->GetQuadrature_Factor_Curved()); - - if(orderExactStraight == orderExactCurved) { - orderExactStraight = - (unsigned short) ceil(thisFace.nPolySol0*config->GetQuadrature_Factor_Straight()); - orderExactCurved = - (unsigned short) ceil(thisFace.nPolySol0*config->GetQuadrature_Factor_Curved()); - if(orderExactStraight == orderExactCurved) - thisFace.JacFaceIsConsideredConstant = false; + if (thisFace.JacFaceIsConsideredConstant) { + auto orderExactStraight = (unsigned short)ceil(thisFace.nPolyGrid0 * config->GetQuadrature_Factor_Straight()); + auto orderExactCurved = (unsigned short)ceil(thisFace.nPolyGrid0 * config->GetQuadrature_Factor_Curved()); + + if (orderExactStraight == orderExactCurved) { + orderExactStraight = (unsigned short)ceil(thisFace.nPolySol0 * config->GetQuadrature_Factor_Straight()); + orderExactCurved = (unsigned short)ceil(thisFace.nPolySol0 * config->GetQuadrature_Factor_Curved()); + if (orderExactStraight == orderExactCurved) thisFace.JacFaceIsConsideredConstant = false; } } @@ -2672,47 +2474,42 @@ void CMeshFEM_DG::CreateFaces(CConfig *config) { sort(localFaces.begin(), localFaces.end()); /*--- Loop over the faces to merge the matching faces. ---*/ - for(unsigned long i=1; ifaceIndicator = iMarker; /* A few additional checks. */ bool side0IsBoundary = low->elemID0 < nVolElemTot; - unsigned long elemID = side0IsBoundary ? low->elemID0 : low->elemID1; + unsigned long elemID = side0IsBoundary ? low->elemID0 : low->elemID1; unsigned short nPoly = side0IsBoundary ? low->nPolyGrid0 : low->nPolyGrid1; - if(elemID != boundaries[iMarker].surfElem[k].volElemID || - nPoly != boundaries[iMarker].surfElem[k].nPolyGrid) + if (elemID != boundaries[iMarker].surfElem[k].volElemID || nPoly != boundaries[iMarker].surfElem[k].nPolyGrid) SU2_MPI::Error(string("Element ID and/or polynomial degree do not match ") + - string("for this boundary element. This should not happen."), + string("for this boundary element. This should not happen."), CURRENT_FUNCTION); - } - else - SU2_MPI::Error("Boundary face not found in localFaces. This should not happen.", - CURRENT_FUNCTION); + } else + SU2_MPI::Error("Boundary face not found in localFaces. This should not happen.", CURRENT_FUNCTION); } } } @@ -2773,9 +2564,8 @@ void CMeshFEM_DG::CreateFaces(CConfig *config) { These faces are indicated by an owned face and a faceIndicator of -2. To avoid that these faces are removed afterwards, set their faceIndicator to -1. ---*/ - for(unsigned long i=0; i= nVolElemOwned || - localFaces[i].elemID1 >= nVolElemOwned) { - + if (localFaces[i].elemID0 >= nVolElemOwned || localFaces[i].elemID1 >= nVolElemOwned) { /* One of the element is not owned. Make sure that the owned element is on side 0. */ swapElements = localFaces[i].elemID0 > localFaces[i].elemID1; - } - else if(localFaces[i].elemType0 == localFaces[i].elemType1) { - + } else if (localFaces[i].elemType0 == localFaces[i].elemType1) { /* The same element type on both sides. Make sure that the element with the smallest ID is stored on side 0 of the face. */ swapElements = localFaces[i].elemID0 > localFaces[i].elemID1; - } - else { + } else { /* Different element types. Make sure that the lowest element type will be stored on side 0 of the face. */ swapElements = localFaces[i].elemType0 > localFaces[i].elemType1; } - } - else { - + } else { /* Either a boundary face or a non-matching face. It must be swapped if the element is currently on side 1 of the face. */ swapElements = localFaces[i].elemID1 < nVolElemTot; @@ -2862,15 +2641,15 @@ void CMeshFEM_DG::CreateFaces(CConfig *config) { /* Swap the adjacent elements of the face, if needed. Note that also the sequence of the corner points must be altered in order to obey the right hand rule. */ - if( swapElements ) { - swap(localFaces[i].elemID0, localFaces[i].elemID1); + if (swapElements) { + swap(localFaces[i].elemID0, localFaces[i].elemID1); swap(localFaces[i].nPolyGrid0, localFaces[i].nPolyGrid1); - swap(localFaces[i].nPolySol0, localFaces[i].nPolySol1); + swap(localFaces[i].nPolySol0, localFaces[i].nPolySol1); swap(localFaces[i].nDOFsElem0, localFaces[i].nDOFsElem1); - swap(localFaces[i].elemType0, localFaces[i].elemType1); - swap(localFaces[i].faceID0, localFaces[i].faceID1); + swap(localFaces[i].elemType0, localFaces[i].elemType1); + swap(localFaces[i].faceID0, localFaces[i].faceID1); - if(localFaces[i].nCornerPoints == 2) + if (localFaces[i].nCornerPoints == 2) swap(localFaces[i].cornerPoints[0], localFaces[i].cornerPoints[1]); else swap(localFaces[i].cornerPoints[0], localFaces[i].cornerPoints[2]); @@ -2883,64 +2662,54 @@ void CMeshFEM_DG::CreateFaces(CConfig *config) { made sure that the first corner point does not coincide with the top of the pyramid. Otherwise it is impossible to carry the transformation to the standard pyramid element. ---*/ - for(unsigned long i=0; iGetnLevels_TimeAccurateLTS(); - nMatchingFacesInternal.assign(nTimeLevels+1, 0); - nMatchingFacesWithHaloElem.assign(nTimeLevels+1, 0); + nMatchingFacesInternal.assign(nTimeLevels + 1, 0); + nMatchingFacesWithHaloElem.assign(nTimeLevels + 1, 0); unsigned long nNonMatchingFaces = 0; - for(unsigned long i=0; i elemAdjLowTimeLevel(nVolElemTot, false); - for(unsigned long i=0; i volElem[e1].timeLevel) elemAdjLowTimeLevel[e0] = true; - if(volElem[e1].timeLevel > volElem[e0].timeLevel) elemAdjLowTimeLevel[e1] = true; + if (volElem[e0].timeLevel > volElem[e1].timeLevel) elemAdjLowTimeLevel[e0] = true; + if (volElem[e1].timeLevel > volElem[e0].timeLevel) elemAdjLowTimeLevel[e1] = true; } /* Determine the list of elements per time level, which share one or more @@ -3205,14 +2935,12 @@ void CMeshFEM_DG::CreateFaces(CConfig *config) { ownedElemAdjLowTimeLevel.resize(nTimeLevels); haloElemAdjLowTimeLevel.resize(nTimeLevels); - for(unsigned long i=0; i counterDOFs(nTimeLevels, 0); - for(unsigned long i=0; i &surfElem = boundaries[iMarker].surfElem; + vector& surfElem = boundaries[iMarker].surfElem; /*--- Loop over range in localFaces for this boundary marker and create the connectivity information, which is stored in surfElem. ---*/ - for(unsigned long i=indBegMarker; i recvFromRank(size, 0); - for(unsigned long i=nVolElemOwned; i rankToIndRecvBuf; - for(int i=0; i rankToIndRecvBuf; + for (int i = 0; i < size; ++i) { + if (recvFromRank[i]) { int ind = (int)rankToIndRecvBuf.size(); rankToIndRecvBuf[i] = ind; } } ranksRecv.resize(rankToIndRecvBuf.size()); - map::const_iterator MI = rankToIndRecvBuf.begin(); - for(unsigned long i=0; ifirst; + map::const_iterator MI = rankToIndRecvBuf.begin(); + for (unsigned long i = 0; i < rankToIndRecvBuf.size(); ++i, ++MI) ranksRecv[i] = MI->first; /* Define and determine the buffers to send the global indices of my halo elements to the appropriate ranks and the vectors which store the @@ -3484,7 +3171,7 @@ void CMeshFEM_DG::SetSendReceive(const CConfig *config) { vector > longBuf(rankToIndRecvBuf.size(), vector(0)); entitiesRecv.resize(rankToIndRecvBuf.size()); - for(unsigned long i=nVolElemOwned; isecond].push_back(volElem[i].elemIDGlobal); @@ -3492,9 +3179,8 @@ void CMeshFEM_DG::SetSendReceive(const CConfig *config) { } /* Determine the mapping from global element ID to local owned element ID. */ - map globalElemIDToLocalInd; - for(unsigned long i=0; i globalElemIDToLocalInd; + for (unsigned long i = 0; i < nVolElemOwned; ++i) globalElemIDToLocalInd[volElem[i].elemIDGlobal] = i; #ifdef HAVE_MPI @@ -3503,8 +3189,7 @@ void CMeshFEM_DG::SetSendReceive(const CConfig *config) { int nRankSend; vector sizeReduce(size, 1); - SU2_MPI::Reduce_scatter(recvFromRank.data(), &nRankSend, sizeReduce.data(), - MPI_INT, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Reduce_scatter(recvFromRank.data(), &nRankSend, sizeReduce.data(), MPI_INT, MPI_SUM, SU2_MPI::GetComm()); /* Resize ranksSend and the first index of entitiesSend to the number of ranks to which this rank has to send data. */ @@ -3514,16 +3199,15 @@ void CMeshFEM_DG::SetSendReceive(const CConfig *config) { /*--- Send all the data using non-blocking sends. ---*/ vector commReqs(ranksRecv.size()); - for(unsigned long i=0; i::const_iterator LMI; + for (int j = 0; j < sizeMess; ++j) { + map::const_iterator LMI; LMI = globalElemIDToLocalInd.find(entitiesSend[i][j]); - if(LMI == globalElemIDToLocalInd.end()) - SU2_MPI::Error("This should not happen", CURRENT_FUNCTION); + if (LMI == globalElemIDToLocalInd.end()) SU2_MPI::Error("This should not happen", CURRENT_FUNCTION); entitiesSend[i][j] = LMI->second; } @@ -3566,16 +3248,14 @@ void CMeshFEM_DG::SetSendReceive(const CConfig *config) { /* Convert the global element ID's of longBuf to local indices, which are stored in entitiesSend[0]. Note that an additional test for longBuf.size() is necessary to avoid problems. */ - if( longBuf.size() ) { - + if (longBuf.size()) { entitiesSend[0].resize(longBuf[0].size()); - for(unsigned long i=0; i::const_iterator LMI; + for (unsigned long i = 0; i < longBuf[0].size(); ++i) { + map::const_iterator LMI; LMI = globalElemIDToLocalInd.find(longBuf[0][i]); - if(LMI == globalElemIDToLocalInd.end()) - SU2_MPI::Error("This should not happen", CURRENT_FUNCTION); + if (LMI == globalElemIDToLocalInd.end()) SU2_MPI::Error("This should not happen", CURRENT_FUNCTION); entitiesSend[0][i] = LMI->second; } @@ -3591,14 +3271,12 @@ void CMeshFEM_DG::SetSendReceive(const CConfig *config) { /*--- Loop over the markers and determine the mapping for the rotationally periodic transformations. The mapping is from the marker to the first index in the vectors to store the rotationally periodic halo elements. ---*/ - map mapRotationalPeriodicToInd; - - for(unsigned short iMarker=0; iMarkerGetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { + map mapRotationalPeriodicToInd; + for (unsigned short iMarker = 0; iMarker < nMarker; ++iMarker) { + if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { auto angles = config->GetPeriodicRotAngles(config->GetMarker_All_TagBound(iMarker)); - if(fabs(angles[0]) > 1.e-5 || fabs(angles[1]) > 1.e-5 || fabs(angles[2]) > 1.e-5) { - + if (fabs(angles[0]) > 1.e-5 || fabs(angles[1]) > 1.e-5 || fabs(angles[2]) > 1.e-5) { unsigned short curSize = mapRotationalPeriodicToInd.size(); mapRotationalPeriodicToInd[iMarker] = curSize; } @@ -3607,8 +3285,7 @@ void CMeshFEM_DG::SetSendReceive(const CConfig *config) { /* Store the rotationally periodic indices in rotPerMarkers. */ rotPerMarkers.reserve(mapRotationalPeriodicToInd.size()); - for(map::iterator SMI =mapRotationalPeriodicToInd.begin(); - SMI!=mapRotationalPeriodicToInd.end(); ++SMI) + for (auto SMI = mapRotationalPeriodicToInd.begin(); SMI != mapRotationalPeriodicToInd.end(); ++SMI) rotPerMarkers.push_back(SMI->first); /* Resize the first index of rotPerHalos to the correct size. */ @@ -3616,29 +3293,21 @@ void CMeshFEM_DG::SetSendReceive(const CConfig *config) { /*--- Loop over the volume elements and store the indices of the rotationally periodic halo elements in rotPerHalos. ---*/ - for(unsigned long i=nVolElemOwned; i -1) { - map::const_iterator SMI; + for (unsigned long i = nVolElemOwned; i < nVolElemTot; ++i) { + if (volElem[i].periodIndexToDonor > -1) { + map::const_iterator SMI; SMI = mapRotationalPeriodicToInd.find(volElem[i].periodIndexToDonor); - if(SMI != mapRotationalPeriodicToInd.end()) - rotPerHalos[SMI->second].push_back(i); + if (SMI != mapRotationalPeriodicToInd.end()) rotPerHalos[SMI->second].push_back(i); } } } -void CMeshFEM_DG::CreateConnectivitiesFace( - const unsigned short VTK_TypeFace, - const unsigned long *cornerPointsFace, - const unsigned short VTK_TypeElem, - const unsigned short nPolyGrid, - const vector &elemNodeIDsGrid, - const unsigned short nPolyConn, - const unsigned long *connElem, - bool &swapFaceInElement, - unsigned long *modConnFace, - unsigned long *modConnElem) { - +void CMeshFEM_DG::CreateConnectivitiesFace(const unsigned short VTK_TypeFace, const unsigned long* cornerPointsFace, + const unsigned short VTK_TypeElem, const unsigned short nPolyGrid, + const vector& elemNodeIDsGrid, const unsigned short nPolyConn, + const unsigned long* connElem, bool& swapFaceInElement, + unsigned long* modConnFace, unsigned long* modConnElem) { /*--- Set swapFaceInElement to false. This variable is only relevant for triangular faces of a pyramid and quadrilateral faces of a prism. Only for these situations this variable will be passed to the @@ -3647,42 +3316,32 @@ void CMeshFEM_DG::CreateConnectivitiesFace( /*--- Make a distinction between the types of the volume element and call the appropriate function to do the actual job. ---*/ - switch( VTK_TypeElem ) { + switch (VTK_TypeElem) { case TRIANGLE: - CreateConnectivitiesLineAdjacentTriangle(cornerPointsFace, nPolyGrid, - elemNodeIDsGrid, nPolyConn, - connElem, modConnFace, - modConnElem); + CreateConnectivitiesLineAdjacentTriangle(cornerPointsFace, nPolyGrid, elemNodeIDsGrid, nPolyConn, connElem, + modConnFace, modConnElem); break; case QUADRILATERAL: - CreateConnectivitiesLineAdjacentQuadrilateral(cornerPointsFace, nPolyGrid, - elemNodeIDsGrid, nPolyConn, - connElem, modConnFace, - modConnElem); + CreateConnectivitiesLineAdjacentQuadrilateral(cornerPointsFace, nPolyGrid, elemNodeIDsGrid, nPolyConn, connElem, + modConnFace, modConnElem); break; case TETRAHEDRON: - CreateConnectivitiesTriangleAdjacentTetrahedron(cornerPointsFace, nPolyGrid, - elemNodeIDsGrid, nPolyConn, - connElem, modConnFace, - modConnElem); + CreateConnectivitiesTriangleAdjacentTetrahedron(cornerPointsFace, nPolyGrid, elemNodeIDsGrid, nPolyConn, connElem, + modConnFace, modConnElem); break; case PYRAMID: { - switch( VTK_TypeFace ) { + switch (VTK_TypeFace) { case TRIANGLE: - CreateConnectivitiesTriangleAdjacentPyramid(cornerPointsFace, nPolyGrid, - elemNodeIDsGrid, nPolyConn, - connElem, swapFaceInElement, - modConnFace, modConnElem); + CreateConnectivitiesTriangleAdjacentPyramid(cornerPointsFace, nPolyGrid, elemNodeIDsGrid, nPolyConn, connElem, + swapFaceInElement, modConnFace, modConnElem); break; case QUADRILATERAL: - CreateConnectivitiesQuadrilateralAdjacentPyramid(cornerPointsFace, nPolyGrid, - elemNodeIDsGrid, nPolyConn, - connElem, modConnFace, - modConnElem); + CreateConnectivitiesQuadrilateralAdjacentPyramid(cornerPointsFace, nPolyGrid, elemNodeIDsGrid, nPolyConn, + connElem, modConnFace, modConnElem); break; } @@ -3690,19 +3349,15 @@ void CMeshFEM_DG::CreateConnectivitiesFace( } case PRISM: { - switch( VTK_TypeFace ) { + switch (VTK_TypeFace) { case TRIANGLE: - CreateConnectivitiesTriangleAdjacentPrism(cornerPointsFace, nPolyGrid, - elemNodeIDsGrid, nPolyConn, - connElem, modConnFace, - modConnElem); + CreateConnectivitiesTriangleAdjacentPrism(cornerPointsFace, nPolyGrid, elemNodeIDsGrid, nPolyConn, connElem, + modConnFace, modConnElem); break; case QUADRILATERAL: - CreateConnectivitiesQuadrilateralAdjacentPrism(cornerPointsFace, nPolyGrid, - elemNodeIDsGrid, nPolyConn, - connElem, swapFaceInElement, - modConnFace, modConnElem); + CreateConnectivitiesQuadrilateralAdjacentPrism(cornerPointsFace, nPolyGrid, elemNodeIDsGrid, nPolyConn, + connElem, swapFaceInElement, modConnFace, modConnElem); break; } @@ -3710,27 +3365,20 @@ void CMeshFEM_DG::CreateConnectivitiesFace( } case HEXAHEDRON: - CreateConnectivitiesQuadrilateralAdjacentHexahedron(cornerPointsFace, nPolyGrid, - elemNodeIDsGrid, nPolyConn, - connElem, modConnFace, - modConnElem); + CreateConnectivitiesQuadrilateralAdjacentHexahedron(cornerPointsFace, nPolyGrid, elemNodeIDsGrid, nPolyConn, + connElem, modConnFace, modConnElem); break; } } void CMeshFEM_DG::CreateConnectivitiesLineAdjacentQuadrilateral( - const unsigned long *cornerPointsLine, - const unsigned short nPolyGrid, - const vector &quadNodeIDsGrid, - const unsigned short nPolyConn, - const unsigned long *connQuad, - unsigned long *modConnLine, - unsigned long *modConnQuad) { - + const unsigned long* cornerPointsLine, const unsigned short nPolyGrid, const vector& quadNodeIDsGrid, + const unsigned short nPolyConn, const unsigned long* connQuad, unsigned long* modConnLine, + unsigned long* modConnQuad) { /* Determine the indices of the four corner points of the quadrilateral. */ const unsigned short ind0 = 0; const unsigned short ind1 = nPolyGrid; - const unsigned short ind2 = (nPolyGrid+1)*(nPolyGrid+1) -1; + const unsigned short ind2 = (nPolyGrid + 1) * (nPolyGrid + 1) - 1; const unsigned short ind3 = ind2 - nPolyGrid; /* Easier storage of the two corner points of the line in the new numbering. */ @@ -3746,96 +3394,106 @@ void CMeshFEM_DG::CreateConnectivitiesLineAdjacentQuadrilateral( of the quad. This is determined below. The bool verticesDontMatch is there to check if vertices do not match. This should not happen, but it is checked for security. ---*/ - signed short a=0, b=0, c=0, d=0, e=0, f=0; + signed short a = 0, b = 0, c = 0, d = 0, e = 0, f = 0; bool verticesDontMatch = false; - if(vert0 == quadNodeIDsGrid[ind0]) { + if (vert0 == quadNodeIDsGrid[ind0]) { /* Vert0 coincides with vertex 0 of the quad connectivity. Determine the situation for vert1. */ - if(vert1 == quadNodeIDsGrid[ind1]){ + if (vert1 == quadNodeIDsGrid[ind1]) { /* The new numbering is the same as the original numbering. */ - a = d = 0; b = f = 1; c = e = 0; - } - else if(vert1 == quadNodeIDsGrid[ind3]) { + a = d = 0; + b = f = 1; + c = e = 0; + } else if (vert1 == quadNodeIDsGrid[ind3]) { /* The i and j numbering are swapped. This is a left handed transformation. */ - a = d = 0; b = f = 0; c = e = 1; - } - else { + a = d = 0; + b = f = 0; + c = e = 1; + } else { verticesDontMatch = true; // Vert1 does not match with a neigbor. } - } - else if(vert0 == quadNodeIDsGrid[ind1]) { + } else if (vert0 == quadNodeIDsGrid[ind1]) { /* Vert0 coincides with vertex 1 of the quad connectivity. Determine the situation for vert1. */ - if(vert1 == quadNodeIDsGrid[ind2]){ + if (vert1 == quadNodeIDsGrid[ind2]) { /* The i-direction of the new numbering corresponds to the j-direction of the original numbering, while the new j-direction is the negative i-direction of the original numbering. */ - a = 0; d = nPolyConn; b = f = 0; c = 1; e = -1; - } - else if(vert1 == quadNodeIDsGrid[ind0]) { + a = 0; + d = nPolyConn; + b = f = 0; + c = 1; + e = -1; + } else if (vert1 == quadNodeIDsGrid[ind0]) { /* The i-direction is negated, while the j-direction coincides. This is a left handed transformation. */ - a = nPolyConn; d = 0; b = -1; f = 1; c = e = 0; - } - else { + a = nPolyConn; + d = 0; + b = -1; + f = 1; + c = e = 0; + } else { verticesDontMatch = true; // Vert1 does not match with a neigbor. } - } - else if(vert0 == quadNodeIDsGrid[ind2]) { + } else if (vert0 == quadNodeIDsGrid[ind2]) { /* Vert0 coincides with vertex 2 of the quad connectivity. Determine the situation for vert1. */ - if(vert1 == quadNodeIDsGrid[ind3]){ + if (vert1 == quadNodeIDsGrid[ind3]) { /* Both the i- and j-direction are negated. */ - a = d = nPolyConn; b = f = -1; c = e = 0; - } - else if(vert1 == quadNodeIDsGrid[ind1]) { + a = d = nPolyConn; + b = f = -1; + c = e = 0; + } else if (vert1 == quadNodeIDsGrid[ind1]) { /* The new i-direction is the original negative j-direction, while the new j-direction is the original negative i-direction. This is a left handed transformation. */ - a = d = nPolyConn; b = f = 0; c = e = -1; - } - else { + a = d = nPolyConn; + b = f = 0; + c = e = -1; + } else { verticesDontMatch = true; // Vert1 does not match with a neigbor. } - } - else if(vert0 == quadNodeIDsGrid[ind3]) { + } else if (vert0 == quadNodeIDsGrid[ind3]) { /* Vert0 coincides with vertex 3 of the quad connectivity. Determine the situation for vert1. */ - if(vert1 == quadNodeIDsGrid[ind0]){ + if (vert1 == quadNodeIDsGrid[ind0]) { /* The new i-direction is the original negative j-direction, while the new j-direction is the original i-direction. */ - a = nPolyConn; d = 0; b = f = 0; c = -1; e = 1; - } - else if(vert1 == quadNodeIDsGrid[ind2]){ + a = nPolyConn; + d = 0; + b = f = 0; + c = -1; + e = 1; + } else if (vert1 == quadNodeIDsGrid[ind2]) { /* The i-directions coincide while the j-direction is negated. This is a left handed transformation. */ - a = 0; d = nPolyConn; b = 1; f = -1; c = e = 0; - } - else { + a = 0; + d = nPolyConn; + b = 1; + f = -1; + c = e = 0; + } else { verticesDontMatch = true; // Vert1 does not match with a neigbor. } - } - else { + } else { /* Vert0 does not match with any of the corner vertices of the quad. */ verticesDontMatch = true; } /*--- If non-matching vertices have been found, terminate with an error message. ---*/ - if( verticesDontMatch ) - SU2_MPI::Error("Corner vertices do not match. This should not happen.", CURRENT_FUNCTION); + if (verticesDontMatch) SU2_MPI::Error("Corner vertices do not match. This should not happen.", CURRENT_FUNCTION); /*--- Loop over the DOFs of the original quad to create the connectivity of the quad that corresponds to the new numbering. ---*/ unsigned short ind = 0; - for(unsigned short j=0; j<=nPolyConn; ++j) { - for(unsigned short i=0; i<=nPolyConn; ++i, ++ind) { - + for (unsigned short j = 0; j <= nPolyConn; ++j) { + for (unsigned short i = 0; i <= nPolyConn; ++i, ++ind) { /*--- Determine the ii and jj indices of the new numbering, convert it to a 1D index and shore the modified index in modConnQuad. ---*/ - unsigned short ii = a + i*b + j*c; - unsigned short jj = d + i*e + j*f; - unsigned short iind = jj*(nPolyConn+1) + ii; + unsigned short ii = a + i * b + j * c; + unsigned short jj = d + i * e + j * f; + unsigned short iind = jj * (nPolyConn + 1) + ii; modConnQuad[iind] = connQuad[ind]; } @@ -3844,23 +3502,19 @@ void CMeshFEM_DG::CreateConnectivitiesLineAdjacentQuadrilateral( /*--- The line corresponds to face 0 of the quadrilateral. Hence the first nPolyConn+1 entries in modConnQuad are the DOFs of the line. Copy these entries from modConnQuad. ---*/ - for(unsigned short i=0; i<=nPolyConn; ++i) - modConnLine[i] = modConnQuad[i]; + for (unsigned short i = 0; i <= nPolyConn; ++i) modConnLine[i] = modConnQuad[i]; } -void CMeshFEM_DG::CreateConnectivitiesLineAdjacentTriangle( - const unsigned long *cornerPointsLine, - const unsigned short nPolyGrid, - const vector &triaNodeIDsGrid, - const unsigned short nPolyConn, - const unsigned long *connTria, - unsigned long *modConnLine, - unsigned long *modConnTria) { - +void CMeshFEM_DG::CreateConnectivitiesLineAdjacentTriangle(const unsigned long* cornerPointsLine, + const unsigned short nPolyGrid, + const vector& triaNodeIDsGrid, + const unsigned short nPolyConn, + const unsigned long* connTria, unsigned long* modConnLine, + unsigned long* modConnTria) { /* Determine the indices of the 3 corner vertices of the triangle. */ const unsigned short ind0 = 0; const unsigned short ind1 = nPolyGrid; - const unsigned short ind2 = (nPolyGrid+1)*(nPolyGrid+2)/2 -1; + const unsigned short ind2 = (nPolyGrid + 1) * (nPolyGrid + 2) / 2 - 1; /* Easier storage of the two corner points of the line in the new numbering. */ const unsigned long vert0 = cornerPointsLine[0]; @@ -3875,81 +3529,101 @@ void CMeshFEM_DG::CreateConnectivitiesLineAdjacentTriangle( of the triangle. This is determined below. The bool verticesDontMatch is there to check if vertices do not match. This should not happen, but it is checked for security. ---*/ - signed short a=0, b=0, c=0, d=0, e=0, f=0; + signed short a = 0, b = 0, c = 0, d = 0, e = 0, f = 0; bool verticesDontMatch = false; - if(vert0 == triaNodeIDsGrid[ind0]) { + if (vert0 == triaNodeIDsGrid[ind0]) { /* Vert0 coincides with vertex 0 of the triangle connectivity. Determine the situation for vert1. */ - if(vert1 == triaNodeIDsGrid[ind1]){ + if (vert1 == triaNodeIDsGrid[ind1]) { /* The new numbering is the same as the original numbering. */ - a = 0; b = 1; c = 0; d = 0; e = 0; f = 1; - } - else if(vert1 == triaNodeIDsGrid[ind2]) { + a = 0; + b = 1; + c = 0; + d = 0; + e = 0; + f = 1; + } else if (vert1 == triaNodeIDsGrid[ind2]) { /* The i and j numbering are swapped. This is a left handed transformation. */ - a = 0; b = 0; c = 1; d = 0; e = 1; f = 0; - } - else { + a = 0; + b = 0; + c = 1; + d = 0; + e = 1; + f = 0; + } else { verticesDontMatch = true; // Vert1 does not match with a neigbor. } - } - else if(vert0 == triaNodeIDsGrid[ind1]) { + } else if (vert0 == triaNodeIDsGrid[ind1]) { /* Vert0 coincides with vertex 1 of the triangle connectivity. Determine the situation for vert1. */ - if(vert1 == triaNodeIDsGrid[ind2]){ + if (vert1 == triaNodeIDsGrid[ind2]) { /* The i-direction of the new numbering corresponds to the j-direction of the original numbering, while the new j-direction corresponds to a combination of the original i- and j-direction. */ - a = 0; b = 0; c = 1; d = nPolyConn; e = -1; f = -1; - } - else if(vert1 == triaNodeIDsGrid[ind0]) { + a = 0; + b = 0; + c = 1; + d = nPolyConn; + e = -1; + f = -1; + } else if (vert1 == triaNodeIDsGrid[ind0]) { /* The i-direction of the new numbering corresponds to a combination of the original i- and j-direction, while the new j-direction corresponds to the j-direction of the original numbering. This is a left handed transformation. */ - a = nPolyConn; b = -1; c = -1; d = 0; e = 0; f = 1; - } - else { + a = nPolyConn; + b = -1; + c = -1; + d = 0; + e = 0; + f = 1; + } else { verticesDontMatch = true; // Vert1 does not match with a neigbor. } - } - else if(vert0 == triaNodeIDsGrid[ind2]) { + } else if (vert0 == triaNodeIDsGrid[ind2]) { /* Vert0 coincides with vertex 2 of the triangle connectivity. Determine the situation for vert1. */ - if(vert1 == triaNodeIDsGrid[ind0]){ + if (vert1 == triaNodeIDsGrid[ind0]) { /* The i-direction of the new numbering corresponds to a combination of the original i- and j-direction, while the new j-direction corresponds to the i-direction of the original numbering. */ - a = nPolyConn; b = -1; c = -1; d = 0; e = 1; f = 0; - } - else if(vert1 == triaNodeIDsGrid[ind1]) { + a = nPolyConn; + b = -1; + c = -1; + d = 0; + e = 1; + f = 0; + } else if (vert1 == triaNodeIDsGrid[ind1]) { /* The i-direction of the new numbering corresponds to the i-direction of the original numbering, while the new j-direction corresponds to a combination of the original i- and j-direction. This is a left handed transformation. */ - a = 0; b = 1; c = 0; d = nPolyConn; e = -1; f = -1; - } - else { + a = 0; + b = 1; + c = 0; + d = nPolyConn; + e = -1; + f = -1; + } else { verticesDontMatch = true; // Vert1 does not match with a neigbor. } } /*--- If non-matching vertices have been found, terminate with an error message. ---*/ - if( verticesDontMatch ) - SU2_MPI::Error("Corner vertices do not match. This should not happen.", CURRENT_FUNCTION); + if (verticesDontMatch) SU2_MPI::Error("Corner vertices do not match. This should not happen.", CURRENT_FUNCTION); /*--- Loop over the DOFs of the original triangle to create the connectivity of the triangle that corresponds to the new numbering. ---*/ unsigned short ind = 0; - for(unsigned short j=0; j<=nPolyConn; ++j) { - for(unsigned short i=0; i<=(nPolyConn-j); ++i, ++ind) { - + for (unsigned short j = 0; j <= nPolyConn; ++j) { + for (unsigned short i = 0; i <= (nPolyConn - j); ++i, ++ind) { /*--- Determine the ii and jj indices of the new numbering, convert it to a 1D index and shore the modified index in modConnTria. ---*/ - unsigned short ii = a + i*b + j*c; - unsigned short jj = d + i*e + j*f; + unsigned short ii = a + i * b + j * c; + unsigned short jj = d + i * e + j * f; - unsigned short iind = jj*(nPolyConn+1) + ii - jj*(jj-1)/2; + unsigned short iind = jj * (nPolyConn + 1) + ii - jj * (jj - 1) / 2; modConnTria[iind] = connTria[ind]; } @@ -3958,25 +3632,19 @@ void CMeshFEM_DG::CreateConnectivitiesLineAdjacentTriangle( /*--- The line corresponds to face 0 of the triangle. Hence the first nPolyConn+1 entries in modConnTria are the DOFs of the line. Copy these entries from modConnTria. ---*/ - for(unsigned short i=0; i<=nPolyConn; ++i) - modConnLine[i] = modConnTria[i]; + for (unsigned short i = 0; i <= nPolyConn; ++i) modConnLine[i] = modConnTria[i]; } void CMeshFEM_DG::CreateConnectivitiesQuadrilateralAdjacentHexahedron( - const unsigned long *cornerPointsQuad, - const unsigned short nPolyGrid, - const vector &hexaNodeIDsGrid, - const unsigned short nPolyConn, - const unsigned long *connHexa, - unsigned long *modConnQuad, - unsigned long *modConnHexa) { - + const unsigned long* cornerPointsQuad, const unsigned short nPolyGrid, const vector& hexaNodeIDsGrid, + const unsigned short nPolyConn, const unsigned long* connHexa, unsigned long* modConnQuad, + unsigned long* modConnHexa) { /* Determine the indices of the eight corner points of the hexahedron. */ const unsigned short ind0 = 0; const unsigned short ind1 = nPolyGrid; - const unsigned short ind2 = (nPolyGrid+1)*(nPolyGrid+1) -1; + const unsigned short ind2 = (nPolyGrid + 1) * (nPolyGrid + 1) - 1; const unsigned short ind3 = ind2 - nPolyGrid; - const unsigned short ind4 = (nPolyGrid+1)*(nPolyGrid+1)*nPolyGrid; + const unsigned short ind4 = (nPolyGrid + 1) * (nPolyGrid + 1) * nPolyGrid; const unsigned short ind5 = ind1 + ind4; const unsigned short ind6 = ind2 + ind4; const unsigned short ind7 = ind3 + ind4; @@ -3997,208 +3665,245 @@ void CMeshFEM_DG::CreateConnectivitiesQuadrilateralAdjacentHexahedron( of the hexahedron. This is determined below. The bool verticesDontMatch is there to check if vertices do not match. This should not happen, but it is checked for security. ---*/ - signed short a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, - l = 0, m = 0, n = 0, o = 0; + signed short a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, l = 0, m = 0, n = 0, o = 0; bool verticesDontMatch = false; - if(vert0 == hexaNodeIDsGrid[ind0] && vert1 == hexaNodeIDsGrid[ind1] && // ii = i. - vert2 == hexaNodeIDsGrid[ind2] && vert3 == hexaNodeIDsGrid[ind3]) { // jj = j. - b = g = o = 1; // kk = k. - } - else if(vert0 == hexaNodeIDsGrid[ind0] && vert1 == hexaNodeIDsGrid[ind3] && // ii = j. - vert2 == hexaNodeIDsGrid[ind2] && vert3 == hexaNodeIDsGrid[ind1]) { // jj = i. - c = f = o = 1; // kk = k. - } - else if(vert0 == hexaNodeIDsGrid[ind0] && vert1 == hexaNodeIDsGrid[ind1] && // ii = i. - vert2 == hexaNodeIDsGrid[ind5] && vert3 == hexaNodeIDsGrid[ind4]) { // jj = k. - b = h = n = 1; // kk = j. - } - else if(vert0 == hexaNodeIDsGrid[ind0] && vert1 == hexaNodeIDsGrid[ind4] && // ii = k. - vert2 == hexaNodeIDsGrid[ind5] && vert3 == hexaNodeIDsGrid[ind1]) { // jj = i. - d = f = n = 1; // kk = j. - } - else if(vert0 == hexaNodeIDsGrid[ind0] && vert1 == hexaNodeIDsGrid[ind3] && // ii = j. - vert2 == hexaNodeIDsGrid[ind7] && vert3 == hexaNodeIDsGrid[ind4]) { // jj = k. - c = h = m = 1; // kk = i. - } - else if(vert0 == hexaNodeIDsGrid[ind0] && vert1 == hexaNodeIDsGrid[ind4] && // ii = k. - vert2 == hexaNodeIDsGrid[ind7] && vert3 == hexaNodeIDsGrid[ind3]) { // jj = j. - d = g = m = 1; // kk = i. - } - - else if(vert0 == hexaNodeIDsGrid[ind1] && vert1 == hexaNodeIDsGrid[ind0] && // ii = nPoly-i. - vert2 == hexaNodeIDsGrid[ind3] && vert3 == hexaNodeIDsGrid[ind2]) { // jj = j. - a = nPolyConn; b = -1; g = o = 1; // kk = k. - } - else if(vert0 == hexaNodeIDsGrid[ind1] && vert1 == hexaNodeIDsGrid[ind2] && // ii = j. - vert2 == hexaNodeIDsGrid[ind3] && vert3 == hexaNodeIDsGrid[ind0]) { // jj = nPoly-i. - e = nPolyConn; f = -1; c = o = 1; // kk = k. - } - else if(vert0 == hexaNodeIDsGrid[ind1] && vert1 == hexaNodeIDsGrid[ind0] && // ii = nPoly-i. - vert2 == hexaNodeIDsGrid[ind4] && vert3 == hexaNodeIDsGrid[ind5]) { // jj = k. - a = nPolyConn; b = -1; h = n = 1; // kk = j. - } - else if(vert0 == hexaNodeIDsGrid[ind1] && vert1 == hexaNodeIDsGrid[ind5] && // ii = k. - vert2 == hexaNodeIDsGrid[ind4] && vert3 == hexaNodeIDsGrid[ind0]) { // jj = nPoly-i. - e = nPolyConn; f = -1; d = n = 1; // kk = j. - } - else if(vert0 == hexaNodeIDsGrid[ind1] && vert1 == hexaNodeIDsGrid[ind2] && // ii = j. - vert2 == hexaNodeIDsGrid[ind6] && vert3 == hexaNodeIDsGrid[ind5]) { // jj = k. - l = nPolyConn; m = -1; c = h = 1; // kk = nPoly-i. - } - else if(vert0 == hexaNodeIDsGrid[ind1] && vert1 == hexaNodeIDsGrid[ind5] && // ii = k. - vert2 == hexaNodeIDsGrid[ind6] && vert3 == hexaNodeIDsGrid[ind2]) { // jj = j. - l = nPolyConn; m = -1; d = g = 1; // kk = nPoly-i. - } - - else if(vert0 == hexaNodeIDsGrid[ind2] && vert1 == hexaNodeIDsGrid[ind1] && // ii = nPoly-j. - vert2 == hexaNodeIDsGrid[ind0] && vert3 == hexaNodeIDsGrid[ind3]) { // jj = nPoly-i. - a = e = nPolyConn; c = f = -1; o = 1; // kk = k. - } - else if(vert0 == hexaNodeIDsGrid[ind2] && vert1 == hexaNodeIDsGrid[ind3] && // ii = nPoly-i. - vert2 == hexaNodeIDsGrid[ind0] && vert3 == hexaNodeIDsGrid[ind1]) { // jj = nPoly-j. - a = e = nPolyConn; b = g = -1; o = 1; // kk = k. - } - else if(vert0 == hexaNodeIDsGrid[ind2] && vert1 == hexaNodeIDsGrid[ind1] && // ii = nPoly-j. - vert2 == hexaNodeIDsGrid[ind5] && vert3 == hexaNodeIDsGrid[ind6]) { // jj = k. - a = l = nPolyConn; c = m = -1; h = 1; // kk = nPoly-i. - } - else if(vert0 == hexaNodeIDsGrid[ind2] && vert1 == hexaNodeIDsGrid[ind6] && // ii = k. - vert2 == hexaNodeIDsGrid[ind5] && vert3 == hexaNodeIDsGrid[ind1]) { // jj = nPoly-j. - e = l = nPolyConn; g = m = -1; d = 1; // kk = nPoly-i. - } - else if(vert0 == hexaNodeIDsGrid[ind2] && vert1 == hexaNodeIDsGrid[ind3] && // ii = nPoly-i. - vert2 == hexaNodeIDsGrid[ind7] && vert3 == hexaNodeIDsGrid[ind6]) { // jj = k. - a = l = nPolyConn; b = n = -1; h = 1; // kk = nPoly-j. - } - else if(vert0 == hexaNodeIDsGrid[ind2] && vert1 == hexaNodeIDsGrid[ind6] && // ii = k. - vert2 == hexaNodeIDsGrid[ind7] && vert3 == hexaNodeIDsGrid[ind3]) { // jj = nPoly-i. - e = l = nPolyConn; f = n = -1; d = 1; // kk = nPoly-j. - } - - else if(vert0 == hexaNodeIDsGrid[ind3] && vert1 == hexaNodeIDsGrid[ind0] && // ii = nPoly-j. - vert2 == hexaNodeIDsGrid[ind1] && vert3 == hexaNodeIDsGrid[ind2]) { // jj = i. - a = nPolyConn; c = -1; f = o = 1; // kk = k. - } - else if(vert0 == hexaNodeIDsGrid[ind3] && vert1 == hexaNodeIDsGrid[ind2] && // ii = i. - vert2 == hexaNodeIDsGrid[ind1] && vert3 == hexaNodeIDsGrid[ind0]) { // jj = nPoly-j. - e = nPolyConn; g = -1; b = o = 1; // kk = k. - } - else if(vert0 == hexaNodeIDsGrid[ind3] && vert1 == hexaNodeIDsGrid[ind0] && // ii = nPoly-j. - vert2 == hexaNodeIDsGrid[ind4] && vert3 == hexaNodeIDsGrid[ind7]) { // jj = k. - a = nPolyConn; c = -1; h = m = 1; // kk = i. - } - else if(vert0 == hexaNodeIDsGrid[ind3] && vert1 == hexaNodeIDsGrid[ind7] && // ii = k. - vert2 == hexaNodeIDsGrid[ind4] && vert3 == hexaNodeIDsGrid[ind0]) { // jj = nPoly-j. - e = nPolyConn; g = -1; d = m = 1; // kk = i. - } - else if(vert0 == hexaNodeIDsGrid[ind3] && vert1 == hexaNodeIDsGrid[ind2] && // ii = i. - vert2 == hexaNodeIDsGrid[ind6] && vert3 == hexaNodeIDsGrid[ind7]) { // jj = k. - l = nPolyConn; n = -1; b = h = 1; // kk = nPoly-j. - } - else if(vert0 == hexaNodeIDsGrid[ind3] && vert1 == hexaNodeIDsGrid[ind7] && // ii = k. - vert2 == hexaNodeIDsGrid[ind6] && vert3 == hexaNodeIDsGrid[ind2]) { // jj = i. - l = nPolyConn; n = -1; d = f = 1; // kk = nPoly-j. - } - - else if(vert0 == hexaNodeIDsGrid[ind4] && vert1 == hexaNodeIDsGrid[ind5] && // ii = i. - vert2 == hexaNodeIDsGrid[ind6] && vert3 == hexaNodeIDsGrid[ind7]) { // jj = j. - l = nPolyConn; o = -1; b = g = 1; // kk = nPoly-k. - } - else if(vert0 == hexaNodeIDsGrid[ind4] && vert1 == hexaNodeIDsGrid[ind7] && // ii = j. - vert2 == hexaNodeIDsGrid[ind6] && vert3 == hexaNodeIDsGrid[ind5]) { // jj = i. - l = nPolyConn; o = -1; c = f = 1; // kk = nPoly-k. - } - else if(vert0 == hexaNodeIDsGrid[ind4] && vert1 == hexaNodeIDsGrid[ind5] && // ii = i. - vert2 == hexaNodeIDsGrid[ind1] && vert3 == hexaNodeIDsGrid[ind0]) { // jj = nPoly-k. - e = nPolyConn; h = -1; b = n = 1; // kk = j. - } - else if(vert0 == hexaNodeIDsGrid[ind4] && vert1 == hexaNodeIDsGrid[ind0] && // ii = nPoly-k. - vert2 == hexaNodeIDsGrid[ind1] && vert3 == hexaNodeIDsGrid[ind5]) { // jj = i. - a = nPolyConn; d = -1; f = n = 1; // kk = j. - } - else if(vert0 == hexaNodeIDsGrid[ind4] && vert1 == hexaNodeIDsGrid[ind7] && // ii = j. - vert2 == hexaNodeIDsGrid[ind3] && vert3 == hexaNodeIDsGrid[ind0]) { // jj = nPoly-k. - e = nPolyConn; h = -1; c = m = 1; // kk = i. - } - else if(vert0 == hexaNodeIDsGrid[ind4] && vert1 == hexaNodeIDsGrid[ind0] && // ii = nPoly-k. - vert2 == hexaNodeIDsGrid[ind3] && vert3 == hexaNodeIDsGrid[ind7]) { // jj = j. - a = nPolyConn; d = -1; g = m = 1; // kk = i. - } - - else if(vert0 == hexaNodeIDsGrid[ind5] && vert1 == hexaNodeIDsGrid[ind6] && // ii = j. - vert2 == hexaNodeIDsGrid[ind7] && vert3 == hexaNodeIDsGrid[ind4]) { // jj = nPoly-i. - e = l = nPolyConn; f = o = -1; c = 1; // kk = nPoly-k. - } - else if(vert0 == hexaNodeIDsGrid[ind5] && vert1 == hexaNodeIDsGrid[ind4] && // ii = nPoly-i. - vert2 == hexaNodeIDsGrid[ind7] && vert3 == hexaNodeIDsGrid[ind6]) { // jj = j. - a = l = nPolyConn; b = o = -1; g = 1; // kk = nPoly-k. - } - else if(vert0 == hexaNodeIDsGrid[ind5] && vert1 == hexaNodeIDsGrid[ind6] && // ii = j. - vert2 == hexaNodeIDsGrid[ind2] && vert3 == hexaNodeIDsGrid[ind1]) { // jj = nPoly-k. - e = l = nPolyConn; h = m = -1; c = 1; // kk = nPoly-i. - } - else if(vert0 == hexaNodeIDsGrid[ind5] && vert1 == hexaNodeIDsGrid[ind1] && // ii = nPoly-k. - vert2 == hexaNodeIDsGrid[ind2] && vert3 == hexaNodeIDsGrid[ind6]) { // jj = j. - a = l = nPolyConn; d = m = -1; g = 1; // kk = nPoly-i. - } - else if(vert0 == hexaNodeIDsGrid[ind5] && vert1 == hexaNodeIDsGrid[ind1] && // ii = nPoly-k. - vert2 == hexaNodeIDsGrid[ind0] && vert3 == hexaNodeIDsGrid[ind4]) { // jj = nPoly-i. - a = e = nPolyConn; d = f = -1; n = 1; // kk = j. - } - else if(vert0 == hexaNodeIDsGrid[ind5] && vert1 == hexaNodeIDsGrid[ind4] && // ii = nPoly-i. - vert2 == hexaNodeIDsGrid[ind0] && vert3 == hexaNodeIDsGrid[ind1]) { // jj = nPoly-k. - a = e = nPolyConn; b = h = -1; n = 1; // kk = j. - } - - else if(vert0 == hexaNodeIDsGrid[ind6] && vert1 == hexaNodeIDsGrid[ind7] && // ii = nPoly-i. - vert2 == hexaNodeIDsGrid[ind4] && vert3 == hexaNodeIDsGrid[ind5]) { // jj = nPoly-j. - a = e = l = nPolyConn; b = g = o = -1; // kk = nPoly-k. - } - else if(vert0 == hexaNodeIDsGrid[ind6] && vert1 == hexaNodeIDsGrid[ind5] && // ii = nPoly-j. - vert2 == hexaNodeIDsGrid[ind4] && vert3 == hexaNodeIDsGrid[ind7]) { // jj = nPoly-i. - a = e = l = nPolyConn; c = f = o = -1; // kk = nPoly-k. - } - else if(vert0 == hexaNodeIDsGrid[ind6] && vert1 == hexaNodeIDsGrid[ind7] && // ii = nPoly-i. - vert2 == hexaNodeIDsGrid[ind3] && vert3 == hexaNodeIDsGrid[ind2]) { // jj = nPoly-k. - a = e = l = nPolyConn; b = h = n = -1; // kk = nPoly-j. - } - else if(vert0 == hexaNodeIDsGrid[ind6] && vert1 == hexaNodeIDsGrid[ind2] && // ii = nPoly-k. - vert2 == hexaNodeIDsGrid[ind3] && vert3 == hexaNodeIDsGrid[ind7]) { // jj = nPoly-i. - a = e = l = nPolyConn; d = f = n = -1; // kk = nPoly-j. - } - else if(vert0 == hexaNodeIDsGrid[ind6] && vert1 == hexaNodeIDsGrid[ind2] && // ii = nPoly-k. - vert2 == hexaNodeIDsGrid[ind1] && vert3 == hexaNodeIDsGrid[ind5]) { // jj = nPoly-j. - a = e = l = nPolyConn; d = g = m = -1; // kk = nPoly-i. - } - else if(vert0 == hexaNodeIDsGrid[ind6] && vert1 == hexaNodeIDsGrid[ind5] && // ii = nPoly-j. - vert2 == hexaNodeIDsGrid[ind1] && vert3 == hexaNodeIDsGrid[ind2]) { // jj = nPoly-k. - a = e = l = nPolyConn; c = h = m = -1; // kk = nPoly-i. - } - - else if(vert0 == hexaNodeIDsGrid[ind7] && vert1 == hexaNodeIDsGrid[ind4] && // ii = nPoly-j. - vert2 == hexaNodeIDsGrid[ind5] && vert3 == hexaNodeIDsGrid[ind6]) { // jj = i. - a = l = nPolyConn; c = o = -1; f = 1; // kk = nPoly-k. - } - else if(vert0 == hexaNodeIDsGrid[ind7] && vert1 == hexaNodeIDsGrid[ind6] && // ii = i. - vert2 == hexaNodeIDsGrid[ind5] && vert3 == hexaNodeIDsGrid[ind4]) { // jj = nPoly-j. - e = l = nPolyConn; g = o = -1; b = 1; // kk = nPoly-k. - } - else if(vert0 == hexaNodeIDsGrid[ind7] && vert1 == hexaNodeIDsGrid[ind4] && // ii = nPoly-j. - vert2 == hexaNodeIDsGrid[ind0] && vert3 == hexaNodeIDsGrid[ind3]) { // jj = nPoly-k. - a = e = nPolyConn; c = h = -1; m = 1; // kk = i. - } - else if(vert0 == hexaNodeIDsGrid[ind7] && vert1 == hexaNodeIDsGrid[ind3] && // ii = nPoly-k. - vert2 == hexaNodeIDsGrid[ind0] && vert3 == hexaNodeIDsGrid[ind4]) { // jj = nPoly-j. - a = e = nPolyConn; d = g = -1; m = 1; // kk = i. - } - else if(vert0 == hexaNodeIDsGrid[ind7] && vert1 == hexaNodeIDsGrid[ind6] && // ii = i. - vert2 == hexaNodeIDsGrid[ind2] && vert3 == hexaNodeIDsGrid[ind3]) { // jj = nPoly-k. - e = l = nPolyConn; h = n = -1; b = 1; // kk = nPoly-j. - } - else if(vert0 == hexaNodeIDsGrid[ind7] && vert1 == hexaNodeIDsGrid[ind3] && // ii = nPoly-k. - vert2 == hexaNodeIDsGrid[ind2] && vert3 == hexaNodeIDsGrid[ind6]) { // jj = i. - a = l = nPolyConn; d = n = -1; f = 1; // kk = nPoly-j. + if (vert0 == hexaNodeIDsGrid[ind0] && vert1 == hexaNodeIDsGrid[ind1] && // ii = i. + vert2 == hexaNodeIDsGrid[ind2] && vert3 == hexaNodeIDsGrid[ind3]) { // jj = j. + b = g = o = 1; // kk = k. + } else if (vert0 == hexaNodeIDsGrid[ind0] && vert1 == hexaNodeIDsGrid[ind3] && // ii = j. + vert2 == hexaNodeIDsGrid[ind2] && vert3 == hexaNodeIDsGrid[ind1]) { // jj = i. + c = f = o = 1; // kk = k. + } else if (vert0 == hexaNodeIDsGrid[ind0] && vert1 == hexaNodeIDsGrid[ind1] && // ii = i. + vert2 == hexaNodeIDsGrid[ind5] && vert3 == hexaNodeIDsGrid[ind4]) { // jj = k. + b = h = n = 1; // kk = j. + } else if (vert0 == hexaNodeIDsGrid[ind0] && vert1 == hexaNodeIDsGrid[ind4] && // ii = k. + vert2 == hexaNodeIDsGrid[ind5] && vert3 == hexaNodeIDsGrid[ind1]) { // jj = i. + d = f = n = 1; // kk = j. + } else if (vert0 == hexaNodeIDsGrid[ind0] && vert1 == hexaNodeIDsGrid[ind3] && // ii = j. + vert2 == hexaNodeIDsGrid[ind7] && vert3 == hexaNodeIDsGrid[ind4]) { // jj = k. + c = h = m = 1; // kk = i. + } else if (vert0 == hexaNodeIDsGrid[ind0] && vert1 == hexaNodeIDsGrid[ind4] && // ii = k. + vert2 == hexaNodeIDsGrid[ind7] && vert3 == hexaNodeIDsGrid[ind3]) { // jj = j. + d = g = m = 1; // kk = i. + } + + else if (vert0 == hexaNodeIDsGrid[ind1] && vert1 == hexaNodeIDsGrid[ind0] && // ii = nPoly-i. + vert2 == hexaNodeIDsGrid[ind3] && vert3 == hexaNodeIDsGrid[ind2]) { // jj = j. + a = nPolyConn; + b = -1; + g = o = 1; // kk = k. + } else if (vert0 == hexaNodeIDsGrid[ind1] && vert1 == hexaNodeIDsGrid[ind2] && // ii = j. + vert2 == hexaNodeIDsGrid[ind3] && vert3 == hexaNodeIDsGrid[ind0]) { // jj = nPoly-i. + e = nPolyConn; + f = -1; + c = o = 1; // kk = k. + } else if (vert0 == hexaNodeIDsGrid[ind1] && vert1 == hexaNodeIDsGrid[ind0] && // ii = nPoly-i. + vert2 == hexaNodeIDsGrid[ind4] && vert3 == hexaNodeIDsGrid[ind5]) { // jj = k. + a = nPolyConn; + b = -1; + h = n = 1; // kk = j. + } else if (vert0 == hexaNodeIDsGrid[ind1] && vert1 == hexaNodeIDsGrid[ind5] && // ii = k. + vert2 == hexaNodeIDsGrid[ind4] && vert3 == hexaNodeIDsGrid[ind0]) { // jj = nPoly-i. + e = nPolyConn; + f = -1; + d = n = 1; // kk = j. + } else if (vert0 == hexaNodeIDsGrid[ind1] && vert1 == hexaNodeIDsGrid[ind2] && // ii = j. + vert2 == hexaNodeIDsGrid[ind6] && vert3 == hexaNodeIDsGrid[ind5]) { // jj = k. + l = nPolyConn; + m = -1; + c = h = 1; // kk = nPoly-i. + } else if (vert0 == hexaNodeIDsGrid[ind1] && vert1 == hexaNodeIDsGrid[ind5] && // ii = k. + vert2 == hexaNodeIDsGrid[ind6] && vert3 == hexaNodeIDsGrid[ind2]) { // jj = j. + l = nPolyConn; + m = -1; + d = g = 1; // kk = nPoly-i. + } + + else if (vert0 == hexaNodeIDsGrid[ind2] && vert1 == hexaNodeIDsGrid[ind1] && // ii = nPoly-j. + vert2 == hexaNodeIDsGrid[ind0] && vert3 == hexaNodeIDsGrid[ind3]) { // jj = nPoly-i. + a = e = nPolyConn; + c = f = -1; + o = 1; // kk = k. + } else if (vert0 == hexaNodeIDsGrid[ind2] && vert1 == hexaNodeIDsGrid[ind3] && // ii = nPoly-i. + vert2 == hexaNodeIDsGrid[ind0] && vert3 == hexaNodeIDsGrid[ind1]) { // jj = nPoly-j. + a = e = nPolyConn; + b = g = -1; + o = 1; // kk = k. + } else if (vert0 == hexaNodeIDsGrid[ind2] && vert1 == hexaNodeIDsGrid[ind1] && // ii = nPoly-j. + vert2 == hexaNodeIDsGrid[ind5] && vert3 == hexaNodeIDsGrid[ind6]) { // jj = k. + a = l = nPolyConn; + c = m = -1; + h = 1; // kk = nPoly-i. + } else if (vert0 == hexaNodeIDsGrid[ind2] && vert1 == hexaNodeIDsGrid[ind6] && // ii = k. + vert2 == hexaNodeIDsGrid[ind5] && vert3 == hexaNodeIDsGrid[ind1]) { // jj = nPoly-j. + e = l = nPolyConn; + g = m = -1; + d = 1; // kk = nPoly-i. + } else if (vert0 == hexaNodeIDsGrid[ind2] && vert1 == hexaNodeIDsGrid[ind3] && // ii = nPoly-i. + vert2 == hexaNodeIDsGrid[ind7] && vert3 == hexaNodeIDsGrid[ind6]) { // jj = k. + a = l = nPolyConn; + b = n = -1; + h = 1; // kk = nPoly-j. + } else if (vert0 == hexaNodeIDsGrid[ind2] && vert1 == hexaNodeIDsGrid[ind6] && // ii = k. + vert2 == hexaNodeIDsGrid[ind7] && vert3 == hexaNodeIDsGrid[ind3]) { // jj = nPoly-i. + e = l = nPolyConn; + f = n = -1; + d = 1; // kk = nPoly-j. + } + + else if (vert0 == hexaNodeIDsGrid[ind3] && vert1 == hexaNodeIDsGrid[ind0] && // ii = nPoly-j. + vert2 == hexaNodeIDsGrid[ind1] && vert3 == hexaNodeIDsGrid[ind2]) { // jj = i. + a = nPolyConn; + c = -1; + f = o = 1; // kk = k. + } else if (vert0 == hexaNodeIDsGrid[ind3] && vert1 == hexaNodeIDsGrid[ind2] && // ii = i. + vert2 == hexaNodeIDsGrid[ind1] && vert3 == hexaNodeIDsGrid[ind0]) { // jj = nPoly-j. + e = nPolyConn; + g = -1; + b = o = 1; // kk = k. + } else if (vert0 == hexaNodeIDsGrid[ind3] && vert1 == hexaNodeIDsGrid[ind0] && // ii = nPoly-j. + vert2 == hexaNodeIDsGrid[ind4] && vert3 == hexaNodeIDsGrid[ind7]) { // jj = k. + a = nPolyConn; + c = -1; + h = m = 1; // kk = i. + } else if (vert0 == hexaNodeIDsGrid[ind3] && vert1 == hexaNodeIDsGrid[ind7] && // ii = k. + vert2 == hexaNodeIDsGrid[ind4] && vert3 == hexaNodeIDsGrid[ind0]) { // jj = nPoly-j. + e = nPolyConn; + g = -1; + d = m = 1; // kk = i. + } else if (vert0 == hexaNodeIDsGrid[ind3] && vert1 == hexaNodeIDsGrid[ind2] && // ii = i. + vert2 == hexaNodeIDsGrid[ind6] && vert3 == hexaNodeIDsGrid[ind7]) { // jj = k. + l = nPolyConn; + n = -1; + b = h = 1; // kk = nPoly-j. + } else if (vert0 == hexaNodeIDsGrid[ind3] && vert1 == hexaNodeIDsGrid[ind7] && // ii = k. + vert2 == hexaNodeIDsGrid[ind6] && vert3 == hexaNodeIDsGrid[ind2]) { // jj = i. + l = nPolyConn; + n = -1; + d = f = 1; // kk = nPoly-j. + } + + else if (vert0 == hexaNodeIDsGrid[ind4] && vert1 == hexaNodeIDsGrid[ind5] && // ii = i. + vert2 == hexaNodeIDsGrid[ind6] && vert3 == hexaNodeIDsGrid[ind7]) { // jj = j. + l = nPolyConn; + o = -1; + b = g = 1; // kk = nPoly-k. + } else if (vert0 == hexaNodeIDsGrid[ind4] && vert1 == hexaNodeIDsGrid[ind7] && // ii = j. + vert2 == hexaNodeIDsGrid[ind6] && vert3 == hexaNodeIDsGrid[ind5]) { // jj = i. + l = nPolyConn; + o = -1; + c = f = 1; // kk = nPoly-k. + } else if (vert0 == hexaNodeIDsGrid[ind4] && vert1 == hexaNodeIDsGrid[ind5] && // ii = i. + vert2 == hexaNodeIDsGrid[ind1] && vert3 == hexaNodeIDsGrid[ind0]) { // jj = nPoly-k. + e = nPolyConn; + h = -1; + b = n = 1; // kk = j. + } else if (vert0 == hexaNodeIDsGrid[ind4] && vert1 == hexaNodeIDsGrid[ind0] && // ii = nPoly-k. + vert2 == hexaNodeIDsGrid[ind1] && vert3 == hexaNodeIDsGrid[ind5]) { // jj = i. + a = nPolyConn; + d = -1; + f = n = 1; // kk = j. + } else if (vert0 == hexaNodeIDsGrid[ind4] && vert1 == hexaNodeIDsGrid[ind7] && // ii = j. + vert2 == hexaNodeIDsGrid[ind3] && vert3 == hexaNodeIDsGrid[ind0]) { // jj = nPoly-k. + e = nPolyConn; + h = -1; + c = m = 1; // kk = i. + } else if (vert0 == hexaNodeIDsGrid[ind4] && vert1 == hexaNodeIDsGrid[ind0] && // ii = nPoly-k. + vert2 == hexaNodeIDsGrid[ind3] && vert3 == hexaNodeIDsGrid[ind7]) { // jj = j. + a = nPolyConn; + d = -1; + g = m = 1; // kk = i. + } + + else if (vert0 == hexaNodeIDsGrid[ind5] && vert1 == hexaNodeIDsGrid[ind6] && // ii = j. + vert2 == hexaNodeIDsGrid[ind7] && vert3 == hexaNodeIDsGrid[ind4]) { // jj = nPoly-i. + e = l = nPolyConn; + f = o = -1; + c = 1; // kk = nPoly-k. + } else if (vert0 == hexaNodeIDsGrid[ind5] && vert1 == hexaNodeIDsGrid[ind4] && // ii = nPoly-i. + vert2 == hexaNodeIDsGrid[ind7] && vert3 == hexaNodeIDsGrid[ind6]) { // jj = j. + a = l = nPolyConn; + b = o = -1; + g = 1; // kk = nPoly-k. + } else if (vert0 == hexaNodeIDsGrid[ind5] && vert1 == hexaNodeIDsGrid[ind6] && // ii = j. + vert2 == hexaNodeIDsGrid[ind2] && vert3 == hexaNodeIDsGrid[ind1]) { // jj = nPoly-k. + e = l = nPolyConn; + h = m = -1; + c = 1; // kk = nPoly-i. + } else if (vert0 == hexaNodeIDsGrid[ind5] && vert1 == hexaNodeIDsGrid[ind1] && // ii = nPoly-k. + vert2 == hexaNodeIDsGrid[ind2] && vert3 == hexaNodeIDsGrid[ind6]) { // jj = j. + a = l = nPolyConn; + d = m = -1; + g = 1; // kk = nPoly-i. + } else if (vert0 == hexaNodeIDsGrid[ind5] && vert1 == hexaNodeIDsGrid[ind1] && // ii = nPoly-k. + vert2 == hexaNodeIDsGrid[ind0] && vert3 == hexaNodeIDsGrid[ind4]) { // jj = nPoly-i. + a = e = nPolyConn; + d = f = -1; + n = 1; // kk = j. + } else if (vert0 == hexaNodeIDsGrid[ind5] && vert1 == hexaNodeIDsGrid[ind4] && // ii = nPoly-i. + vert2 == hexaNodeIDsGrid[ind0] && vert3 == hexaNodeIDsGrid[ind1]) { // jj = nPoly-k. + a = e = nPolyConn; + b = h = -1; + n = 1; // kk = j. + } + + else if (vert0 == hexaNodeIDsGrid[ind6] && vert1 == hexaNodeIDsGrid[ind7] && // ii = nPoly-i. + vert2 == hexaNodeIDsGrid[ind4] && vert3 == hexaNodeIDsGrid[ind5]) { // jj = nPoly-j. + a = e = l = nPolyConn; + b = g = o = -1; // kk = nPoly-k. + } else if (vert0 == hexaNodeIDsGrid[ind6] && vert1 == hexaNodeIDsGrid[ind5] && // ii = nPoly-j. + vert2 == hexaNodeIDsGrid[ind4] && vert3 == hexaNodeIDsGrid[ind7]) { // jj = nPoly-i. + a = e = l = nPolyConn; + c = f = o = -1; // kk = nPoly-k. + } else if (vert0 == hexaNodeIDsGrid[ind6] && vert1 == hexaNodeIDsGrid[ind7] && // ii = nPoly-i. + vert2 == hexaNodeIDsGrid[ind3] && vert3 == hexaNodeIDsGrid[ind2]) { // jj = nPoly-k. + a = e = l = nPolyConn; + b = h = n = -1; // kk = nPoly-j. + } else if (vert0 == hexaNodeIDsGrid[ind6] && vert1 == hexaNodeIDsGrid[ind2] && // ii = nPoly-k. + vert2 == hexaNodeIDsGrid[ind3] && vert3 == hexaNodeIDsGrid[ind7]) { // jj = nPoly-i. + a = e = l = nPolyConn; + d = f = n = -1; // kk = nPoly-j. + } else if (vert0 == hexaNodeIDsGrid[ind6] && vert1 == hexaNodeIDsGrid[ind2] && // ii = nPoly-k. + vert2 == hexaNodeIDsGrid[ind1] && vert3 == hexaNodeIDsGrid[ind5]) { // jj = nPoly-j. + a = e = l = nPolyConn; + d = g = m = -1; // kk = nPoly-i. + } else if (vert0 == hexaNodeIDsGrid[ind6] && vert1 == hexaNodeIDsGrid[ind5] && // ii = nPoly-j. + vert2 == hexaNodeIDsGrid[ind1] && vert3 == hexaNodeIDsGrid[ind2]) { // jj = nPoly-k. + a = e = l = nPolyConn; + c = h = m = -1; // kk = nPoly-i. + } + + else if (vert0 == hexaNodeIDsGrid[ind7] && vert1 == hexaNodeIDsGrid[ind4] && // ii = nPoly-j. + vert2 == hexaNodeIDsGrid[ind5] && vert3 == hexaNodeIDsGrid[ind6]) { // jj = i. + a = l = nPolyConn; + c = o = -1; + f = 1; // kk = nPoly-k. + } else if (vert0 == hexaNodeIDsGrid[ind7] && vert1 == hexaNodeIDsGrid[ind6] && // ii = i. + vert2 == hexaNodeIDsGrid[ind5] && vert3 == hexaNodeIDsGrid[ind4]) { // jj = nPoly-j. + e = l = nPolyConn; + g = o = -1; + b = 1; // kk = nPoly-k. + } else if (vert0 == hexaNodeIDsGrid[ind7] && vert1 == hexaNodeIDsGrid[ind4] && // ii = nPoly-j. + vert2 == hexaNodeIDsGrid[ind0] && vert3 == hexaNodeIDsGrid[ind3]) { // jj = nPoly-k. + a = e = nPolyConn; + c = h = -1; + m = 1; // kk = i. + } else if (vert0 == hexaNodeIDsGrid[ind7] && vert1 == hexaNodeIDsGrid[ind3] && // ii = nPoly-k. + vert2 == hexaNodeIDsGrid[ind0] && vert3 == hexaNodeIDsGrid[ind4]) { // jj = nPoly-j. + a = e = nPolyConn; + d = g = -1; + m = 1; // kk = i. + } else if (vert0 == hexaNodeIDsGrid[ind7] && vert1 == hexaNodeIDsGrid[ind6] && // ii = i. + vert2 == hexaNodeIDsGrid[ind2] && vert3 == hexaNodeIDsGrid[ind3]) { // jj = nPoly-k. + e = l = nPolyConn; + h = n = -1; + b = 1; // kk = nPoly-j. + } else if (vert0 == hexaNodeIDsGrid[ind7] && vert1 == hexaNodeIDsGrid[ind3] && // ii = nPoly-k. + vert2 == hexaNodeIDsGrid[ind2] && vert3 == hexaNodeIDsGrid[ind6]) { // jj = i. + a = l = nPolyConn; + d = n = -1; + f = 1; // kk = nPoly-j. } else { @@ -4206,23 +3911,21 @@ void CMeshFEM_DG::CreateConnectivitiesQuadrilateralAdjacentHexahedron( } /*--- If non-matching vertices have been found, terminate with an error message. ---*/ - if( verticesDontMatch ) - SU2_MPI::Error("Corner vertices do not match. This should not happen.", CURRENT_FUNCTION); + if (verticesDontMatch) SU2_MPI::Error("Corner vertices do not match. This should not happen.", CURRENT_FUNCTION); /*--- Loop over the DOFs of the original hexahedron to create the connectivity of the hexahedron that corresponds to the new numbering. ---*/ - const unsigned short nn2 = (nPolyConn+1)*(nPolyConn+1); + const unsigned short nn2 = (nPolyConn + 1) * (nPolyConn + 1); unsigned short ind = 0; - for(unsigned short k=0; k<=nPolyConn; ++k) { - for(unsigned short j=0; j<=nPolyConn; ++j) { - for(unsigned short i=0; i<=nPolyConn; ++i, ++ind) { - + for (unsigned short k = 0; k <= nPolyConn; ++k) { + for (unsigned short j = 0; j <= nPolyConn; ++j) { + for (unsigned short i = 0; i <= nPolyConn; ++i, ++ind) { /*--- Determine the ii, jj and kk indices of the new numbering, convert it to a 1D index and shore the modified index in modConnHexa. ---*/ - unsigned short ii = a + i*b + j*c + k*d; - unsigned short jj = e + i*f + j*g + k*h; - unsigned short kk = l + i*m + j*n + k*o; - unsigned short iind = kk*nn2 + jj*(nPolyConn+1) + ii; + unsigned short ii = a + i * b + j * c + k * d; + unsigned short jj = e + i * f + j * g + k * h; + unsigned short kk = l + i * m + j * n + k * o; + unsigned short iind = kk * nn2 + jj * (nPolyConn + 1) + ii; modConnHexa[iind] = connHexa[ind]; } @@ -4232,25 +3935,18 @@ void CMeshFEM_DG::CreateConnectivitiesQuadrilateralAdjacentHexahedron( /*--- The quad corresponds to face 0 of the hexahedron. Hence the first nn2 entries in modConnHexa are the DOFs of the quad. Copy these entries from modConnHexa. ---*/ - for(unsigned short i=0; i &prismNodeIDsGrid, - const unsigned short nPolyConn, - const unsigned long *connPrism, - bool &swapFaceInElement, - unsigned long *modConnQuad, - unsigned long *modConnPrism) { - + const unsigned long* cornerPointsQuad, const unsigned short nPolyGrid, + const vector& prismNodeIDsGrid, const unsigned short nPolyConn, const unsigned long* connPrism, + bool& swapFaceInElement, unsigned long* modConnQuad, unsigned long* modConnPrism) { /* Determine the indices of the six corner points of the prism. */ const unsigned short ind0 = 0; const unsigned short ind1 = nPolyGrid; - const unsigned short ind2 = (nPolyGrid+1)*(nPolyGrid+2)/2 -1; - const unsigned short ind3 = (nPolyGrid+1)*(nPolyGrid+2)*nPolyGrid/2; + const unsigned short ind2 = (nPolyGrid + 1) * (nPolyGrid + 2) / 2 - 1; + const unsigned short ind3 = (nPolyGrid + 1) * (nPolyGrid + 2) * nPolyGrid / 2; const unsigned short ind4 = ind1 + ind3; const unsigned short ind5 = ind2 + ind3; @@ -4276,106 +3972,152 @@ void CMeshFEM_DG::CreateConnectivitiesQuadrilateralAdjacentPrism( signed short a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0; bool verticesDontMatch = false; - if(vert0 == prismNodeIDsGrid[ind0] && vert1 == prismNodeIDsGrid[ind1] && // ii = i. - vert2 == prismNodeIDsGrid[ind4] && vert3 == prismNodeIDsGrid[ind3]) { // jj = j. - b = f = h = 1; swapFaceInElement = false; // kk = k. - } - else if(vert0 == prismNodeIDsGrid[ind0] && vert1 == prismNodeIDsGrid[ind3] && // ii = i. - vert2 == prismNodeIDsGrid[ind4] && vert3 == prismNodeIDsGrid[ind1]) { // jj = j. - b = f = h = 1; swapFaceInElement = true; // kk = k. Plus swap. - } - else if(vert0 == prismNodeIDsGrid[ind0] && vert1 == prismNodeIDsGrid[ind2] && // ii = j. - vert2 == prismNodeIDsGrid[ind5] && vert3 == prismNodeIDsGrid[ind3]) { // jj = i. - c = e = h = 1; swapFaceInElement = false; // kk = k. - } - else if(vert0 == prismNodeIDsGrid[ind0] && vert1 == prismNodeIDsGrid[ind3] && // ii = j. - vert2 == prismNodeIDsGrid[ind5] && vert3 == prismNodeIDsGrid[ind2]) { // jj = i. - c = e = h = 1; swapFaceInElement = true; // kk = k. Plus swap. - } - - else if(vert0 == prismNodeIDsGrid[ind1] && vert1 == prismNodeIDsGrid[ind0] && // ii = nPoly-i-j. - vert2 == prismNodeIDsGrid[ind3] && vert3 == prismNodeIDsGrid[ind4]) { // jj = j. - a = nPolyConn; b = c = -1; f = h = 1; swapFaceInElement = false; // kk = k. - } - else if(vert0 == prismNodeIDsGrid[ind1] && vert1 == prismNodeIDsGrid[ind4] && // ii = nPoly-i-j. - vert2 == prismNodeIDsGrid[ind3] && vert3 == prismNodeIDsGrid[ind0]) { // jj = j. - a = nPolyConn; b = c = -1; f = h = 1; swapFaceInElement = true; // kk = k. Plus swap. - } - else if(vert0 == prismNodeIDsGrid[ind1] && vert1 == prismNodeIDsGrid[ind2] && // ii = j. - vert2 == prismNodeIDsGrid[ind5] && vert3 == prismNodeIDsGrid[ind4]) { // jj = nPoly-i-j. - d = nPolyConn; e = f = -1; c = h = 1; swapFaceInElement = false; // kk = k. - } - else if(vert0 == prismNodeIDsGrid[ind1] && vert1 == prismNodeIDsGrid[ind4] && // ii = j. - vert2 == prismNodeIDsGrid[ind5] && vert3 == prismNodeIDsGrid[ind2]) { // jj = nPoly-i-j. - d = nPolyConn; e = f = -1; c = h = 1; swapFaceInElement = true; // kk = k. Plus swap. - } - - else if(vert0 == prismNodeIDsGrid[ind2] && vert1 == prismNodeIDsGrid[ind0] && // ii = nPoly-i-j. - vert2 == prismNodeIDsGrid[ind3] && vert3 == prismNodeIDsGrid[ind5]) { // jj = i. - a = nPolyConn; b = c = -1; e = h = 1; swapFaceInElement = false; // kk = k. - } - else if(vert0 == prismNodeIDsGrid[ind2] && vert1 == prismNodeIDsGrid[ind5] && // ii = nPoly-i-j. - vert2 == prismNodeIDsGrid[ind3] && vert3 == prismNodeIDsGrid[ind0]) { // jj = i. - a = nPolyConn; b = c = -1; e = h = 1; swapFaceInElement = true; // kk = k. Plus swap. - } - else if(vert0 == prismNodeIDsGrid[ind2] && vert1 == prismNodeIDsGrid[ind1] && // ii = i. - vert2 == prismNodeIDsGrid[ind4] && vert3 == prismNodeIDsGrid[ind5]) { // jj = nPoly-i-j. - d = nPolyConn; e = f = -1; b = h = 1; swapFaceInElement = false; // kk = k. - } - else if(vert0 == prismNodeIDsGrid[ind2] && vert1 == prismNodeIDsGrid[ind5] && // ii = i. - vert2 == prismNodeIDsGrid[ind4] && vert3 == prismNodeIDsGrid[ind1]) { // jj = nPoly-i-j. - d = nPolyConn; e = f = -1; b = h = 1; swapFaceInElement = true; // kk = k. Plus swap. - } - - else if(vert0 == prismNodeIDsGrid[ind3] && vert1 == prismNodeIDsGrid[ind4] && // ii = i. - vert2 == prismNodeIDsGrid[ind1] && vert3 == prismNodeIDsGrid[ind0]) { // jj = j. - g = nPolyConn; b = f = 1; h = -1; swapFaceInElement = false; // kk = nPoly-k. - } - else if(vert0 == prismNodeIDsGrid[ind3] && vert1 == prismNodeIDsGrid[ind0] && // ii = i. - vert2 == prismNodeIDsGrid[ind1] && vert3 == prismNodeIDsGrid[ind4]) { // jj = j. - g = nPolyConn; b = f = 1; h = -1; swapFaceInElement = true; // kk = nPoly-k. Plus swap. - } - else if(vert0 == prismNodeIDsGrid[ind3] && vert1 == prismNodeIDsGrid[ind5] && // ii = j. - vert2 == prismNodeIDsGrid[ind2] && vert3 == prismNodeIDsGrid[ind0]) { // jj = i. - g = nPolyConn; c = e = 1; h = -1; swapFaceInElement = false; // kk = nPoly-k. - } - else if(vert0 == prismNodeIDsGrid[ind3] && vert1 == prismNodeIDsGrid[ind0] && // ii = j. - vert2 == prismNodeIDsGrid[ind2] && vert3 == prismNodeIDsGrid[ind5]) { // jj = i. - g = nPolyConn; c = e = 1; h = -1; swapFaceInElement = true; // kk = nPoly-k. Plus swap. - } - - else if(vert0 == prismNodeIDsGrid[ind4] && vert1 == prismNodeIDsGrid[ind3] && // ii = nPoly-i-j. - vert2 == prismNodeIDsGrid[ind0] && vert3 == prismNodeIDsGrid[ind1]) { // jj = j. - a = g = nPolyConn; b = c = h = -1; f = 1; swapFaceInElement = false; // kk = nPoly-k. - } - else if(vert0 == prismNodeIDsGrid[ind4] && vert1 == prismNodeIDsGrid[ind1] && // ii = nPoly-i-j. - vert2 == prismNodeIDsGrid[ind0] && vert3 == prismNodeIDsGrid[ind3]) { // jj = j. - a = g = nPolyConn; b = c = h = -1; f = 1; swapFaceInElement = true; // kk = nPoly-k. Plus swap. - } - else if(vert0 == prismNodeIDsGrid[ind4] && vert1 == prismNodeIDsGrid[ind5] && // ii = j. - vert2 == prismNodeIDsGrid[ind2] && vert3 == prismNodeIDsGrid[ind1]) { // jj = nPoly-i-j. - d = g = nPolyConn; e = f = h = -1; c = 1; swapFaceInElement = false; // kk = nPoly-k. - } - else if(vert0 == prismNodeIDsGrid[ind4] && vert1 == prismNodeIDsGrid[ind1] && // ii = j. - vert2 == prismNodeIDsGrid[ind2] && vert3 == prismNodeIDsGrid[ind5]) { // jj = nPoly-i-j. - d = g = nPolyConn; e = f = h = -1; c = 1; swapFaceInElement = true; // kk = nPoly-k. Plus swap. - } - - else if(vert0 == prismNodeIDsGrid[ind5] && vert1 == prismNodeIDsGrid[ind3] && // ii = nPoly-i-j. - vert2 == prismNodeIDsGrid[ind0] && vert3 == prismNodeIDsGrid[ind2]) { // jj = i. - a = g = nPolyConn; b = c = h = -1; e = 1; swapFaceInElement = false; // kk = nPoly-k. - } - else if(vert0 == prismNodeIDsGrid[ind5] && vert1 == prismNodeIDsGrid[ind2] && // ii = nPoly-i-j. - vert2 == prismNodeIDsGrid[ind0] && vert3 == prismNodeIDsGrid[ind3]) { // jj = i. - a = g = nPolyConn; b = c = h = -1; e = 1; swapFaceInElement = true; // kk = nPoly-k. Plus swap. - } - else if(vert0 == prismNodeIDsGrid[ind5] && vert1 == prismNodeIDsGrid[ind4] && // ii = i. - vert2 == prismNodeIDsGrid[ind1] && vert3 == prismNodeIDsGrid[ind2]) { // jj = nPoly-i-j. - d = g = nPolyConn; e = f = h = -1; b = 1; swapFaceInElement = false; // kk = nPoly-k. - } - else if(vert0 == prismNodeIDsGrid[ind5] && vert1 == prismNodeIDsGrid[ind2] && // ii = i. - vert2 == prismNodeIDsGrid[ind1] && vert3 == prismNodeIDsGrid[ind4]) { // jj = nPoly-i-j. - d = g = nPolyConn; e = f = h = -1; b = 1; swapFaceInElement = true; // kk = nPoly-k. Plus swap. + if (vert0 == prismNodeIDsGrid[ind0] && vert1 == prismNodeIDsGrid[ind1] && // ii = i. + vert2 == prismNodeIDsGrid[ind4] && vert3 == prismNodeIDsGrid[ind3]) { // jj = j. + b = f = h = 1; + swapFaceInElement = false; // kk = k. + } else if (vert0 == prismNodeIDsGrid[ind0] && vert1 == prismNodeIDsGrid[ind3] && // ii = i. + vert2 == prismNodeIDsGrid[ind4] && vert3 == prismNodeIDsGrid[ind1]) { // jj = j. + b = f = h = 1; + swapFaceInElement = true; // kk = k. Plus swap. + } else if (vert0 == prismNodeIDsGrid[ind0] && vert1 == prismNodeIDsGrid[ind2] && // ii = j. + vert2 == prismNodeIDsGrid[ind5] && vert3 == prismNodeIDsGrid[ind3]) { // jj = i. + c = e = h = 1; + swapFaceInElement = false; // kk = k. + } else if (vert0 == prismNodeIDsGrid[ind0] && vert1 == prismNodeIDsGrid[ind3] && // ii = j. + vert2 == prismNodeIDsGrid[ind5] && vert3 == prismNodeIDsGrid[ind2]) { // jj = i. + c = e = h = 1; + swapFaceInElement = true; // kk = k. Plus swap. + } + + else if (vert0 == prismNodeIDsGrid[ind1] && vert1 == prismNodeIDsGrid[ind0] && // ii = nPoly-i-j. + vert2 == prismNodeIDsGrid[ind3] && vert3 == prismNodeIDsGrid[ind4]) { // jj = j. + a = nPolyConn; + b = c = -1; + f = h = 1; + swapFaceInElement = false; // kk = k. + } else if (vert0 == prismNodeIDsGrid[ind1] && vert1 == prismNodeIDsGrid[ind4] && // ii = nPoly-i-j. + vert2 == prismNodeIDsGrid[ind3] && vert3 == prismNodeIDsGrid[ind0]) { // jj = j. + a = nPolyConn; + b = c = -1; + f = h = 1; + swapFaceInElement = true; // kk = k. Plus swap. + } else if (vert0 == prismNodeIDsGrid[ind1] && vert1 == prismNodeIDsGrid[ind2] && // ii = j. + vert2 == prismNodeIDsGrid[ind5] && vert3 == prismNodeIDsGrid[ind4]) { // jj = nPoly-i-j. + d = nPolyConn; + e = f = -1; + c = h = 1; + swapFaceInElement = false; // kk = k. + } else if (vert0 == prismNodeIDsGrid[ind1] && vert1 == prismNodeIDsGrid[ind4] && // ii = j. + vert2 == prismNodeIDsGrid[ind5] && vert3 == prismNodeIDsGrid[ind2]) { // jj = nPoly-i-j. + d = nPolyConn; + e = f = -1; + c = h = 1; + swapFaceInElement = true; // kk = k. Plus swap. + } + + else if (vert0 == prismNodeIDsGrid[ind2] && vert1 == prismNodeIDsGrid[ind0] && // ii = nPoly-i-j. + vert2 == prismNodeIDsGrid[ind3] && vert3 == prismNodeIDsGrid[ind5]) { // jj = i. + a = nPolyConn; + b = c = -1; + e = h = 1; + swapFaceInElement = false; // kk = k. + } else if (vert0 == prismNodeIDsGrid[ind2] && vert1 == prismNodeIDsGrid[ind5] && // ii = nPoly-i-j. + vert2 == prismNodeIDsGrid[ind3] && vert3 == prismNodeIDsGrid[ind0]) { // jj = i. + a = nPolyConn; + b = c = -1; + e = h = 1; + swapFaceInElement = true; // kk = k. Plus swap. + } else if (vert0 == prismNodeIDsGrid[ind2] && vert1 == prismNodeIDsGrid[ind1] && // ii = i. + vert2 == prismNodeIDsGrid[ind4] && vert3 == prismNodeIDsGrid[ind5]) { // jj = nPoly-i-j. + d = nPolyConn; + e = f = -1; + b = h = 1; + swapFaceInElement = false; // kk = k. + } else if (vert0 == prismNodeIDsGrid[ind2] && vert1 == prismNodeIDsGrid[ind5] && // ii = i. + vert2 == prismNodeIDsGrid[ind4] && vert3 == prismNodeIDsGrid[ind1]) { // jj = nPoly-i-j. + d = nPolyConn; + e = f = -1; + b = h = 1; + swapFaceInElement = true; // kk = k. Plus swap. + } + + else if (vert0 == prismNodeIDsGrid[ind3] && vert1 == prismNodeIDsGrid[ind4] && // ii = i. + vert2 == prismNodeIDsGrid[ind1] && vert3 == prismNodeIDsGrid[ind0]) { // jj = j. + g = nPolyConn; + b = f = 1; + h = -1; + swapFaceInElement = false; // kk = nPoly-k. + } else if (vert0 == prismNodeIDsGrid[ind3] && vert1 == prismNodeIDsGrid[ind0] && // ii = i. + vert2 == prismNodeIDsGrid[ind1] && vert3 == prismNodeIDsGrid[ind4]) { // jj = j. + g = nPolyConn; + b = f = 1; + h = -1; + swapFaceInElement = true; // kk = nPoly-k. Plus swap. + } else if (vert0 == prismNodeIDsGrid[ind3] && vert1 == prismNodeIDsGrid[ind5] && // ii = j. + vert2 == prismNodeIDsGrid[ind2] && vert3 == prismNodeIDsGrid[ind0]) { // jj = i. + g = nPolyConn; + c = e = 1; + h = -1; + swapFaceInElement = false; // kk = nPoly-k. + } else if (vert0 == prismNodeIDsGrid[ind3] && vert1 == prismNodeIDsGrid[ind0] && // ii = j. + vert2 == prismNodeIDsGrid[ind2] && vert3 == prismNodeIDsGrid[ind5]) { // jj = i. + g = nPolyConn; + c = e = 1; + h = -1; + swapFaceInElement = true; // kk = nPoly-k. Plus swap. + } + + else if (vert0 == prismNodeIDsGrid[ind4] && vert1 == prismNodeIDsGrid[ind3] && // ii = nPoly-i-j. + vert2 == prismNodeIDsGrid[ind0] && vert3 == prismNodeIDsGrid[ind1]) { // jj = j. + a = g = nPolyConn; + b = c = h = -1; + f = 1; + swapFaceInElement = false; // kk = nPoly-k. + } else if (vert0 == prismNodeIDsGrid[ind4] && vert1 == prismNodeIDsGrid[ind1] && // ii = nPoly-i-j. + vert2 == prismNodeIDsGrid[ind0] && vert3 == prismNodeIDsGrid[ind3]) { // jj = j. + a = g = nPolyConn; + b = c = h = -1; + f = 1; + swapFaceInElement = true; // kk = nPoly-k. Plus swap. + } else if (vert0 == prismNodeIDsGrid[ind4] && vert1 == prismNodeIDsGrid[ind5] && // ii = j. + vert2 == prismNodeIDsGrid[ind2] && vert3 == prismNodeIDsGrid[ind1]) { // jj = nPoly-i-j. + d = g = nPolyConn; + e = f = h = -1; + c = 1; + swapFaceInElement = false; // kk = nPoly-k. + } else if (vert0 == prismNodeIDsGrid[ind4] && vert1 == prismNodeIDsGrid[ind1] && // ii = j. + vert2 == prismNodeIDsGrid[ind2] && vert3 == prismNodeIDsGrid[ind5]) { // jj = nPoly-i-j. + d = g = nPolyConn; + e = f = h = -1; + c = 1; + swapFaceInElement = true; // kk = nPoly-k. Plus swap. + } + + else if (vert0 == prismNodeIDsGrid[ind5] && vert1 == prismNodeIDsGrid[ind3] && // ii = nPoly-i-j. + vert2 == prismNodeIDsGrid[ind0] && vert3 == prismNodeIDsGrid[ind2]) { // jj = i. + a = g = nPolyConn; + b = c = h = -1; + e = 1; + swapFaceInElement = false; // kk = nPoly-k. + } else if (vert0 == prismNodeIDsGrid[ind5] && vert1 == prismNodeIDsGrid[ind2] && // ii = nPoly-i-j. + vert2 == prismNodeIDsGrid[ind0] && vert3 == prismNodeIDsGrid[ind3]) { // jj = i. + a = g = nPolyConn; + b = c = h = -1; + e = 1; + swapFaceInElement = true; // kk = nPoly-k. Plus swap. + } else if (vert0 == prismNodeIDsGrid[ind5] && vert1 == prismNodeIDsGrid[ind4] && // ii = i. + vert2 == prismNodeIDsGrid[ind1] && vert3 == prismNodeIDsGrid[ind2]) { // jj = nPoly-i-j. + d = g = nPolyConn; + e = f = h = -1; + b = 1; + swapFaceInElement = false; // kk = nPoly-k. + } else if (vert0 == prismNodeIDsGrid[ind5] && vert1 == prismNodeIDsGrid[ind2] && // ii = i. + vert2 == prismNodeIDsGrid[ind1] && vert3 == prismNodeIDsGrid[ind4]) { // jj = nPoly-i-j. + d = g = nPolyConn; + e = f = h = -1; + b = 1; + swapFaceInElement = true; // kk = nPoly-k. Plus swap. } else { @@ -4383,24 +4125,22 @@ void CMeshFEM_DG::CreateConnectivitiesQuadrilateralAdjacentPrism( } /*--- If non-matching vertices have been found, terminate with an error message. ---*/ - if( verticesDontMatch ) - SU2_MPI::Error("Corner vertices do not match. This should not happen.", CURRENT_FUNCTION); + if (verticesDontMatch) SU2_MPI::Error("Corner vertices do not match. This should not happen.", CURRENT_FUNCTION); /*--- Loop over the DOFs of the original prism to create the connectivity of the prism that corresponds to the new numbering. ---*/ - const unsigned short kOff = (nPolyConn+1)*(nPolyConn+2)/2; + const unsigned short kOff = (nPolyConn + 1) * (nPolyConn + 2) / 2; unsigned short ind = 0; - for(unsigned short k=0; k<=nPolyConn; ++k) { - for(unsigned short j=0; j<=nPolyConn; ++j) { + for (unsigned short k = 0; k <= nPolyConn; ++k) { + for (unsigned short j = 0; j <= nPolyConn; ++j) { unsigned short uppBoundI = nPolyConn - j; - for(unsigned short i=0; i<=uppBoundI; ++i, ++ind) { - + for (unsigned short i = 0; i <= uppBoundI; ++i, ++ind) { /*--- Determine the ii, jj and kk indices of the new numbering, convert it to a 1D index and shore the modified index in modConnPrism. ---*/ - unsigned short ii = a + i*b + j*c; - unsigned short jj = d + i*e + j*f; - unsigned short kk = g + h*k; - unsigned short iind = kk*kOff + jj*(nPolyConn+1) + ii - jj*(jj-1)/2; + unsigned short ii = a + i * b + j * c; + unsigned short jj = d + i * e + j * f; + unsigned short kk = g + h * k; + unsigned short iind = kk * kOff + jj * (nPolyConn + 1) + ii - jj * (jj - 1) / 2; modConnPrism[iind] = connPrism[ind]; } @@ -4408,49 +4148,42 @@ void CMeshFEM_DG::CreateConnectivitiesQuadrilateralAdjacentPrism( } /*--- Determine the connectivity of the quadrilateral face. ---*/ - if( swapFaceInElement ) { - + if (swapFaceInElement) { /*--- The parametric coordinates r and s of the quad must be swapped w.r.t. to the parametric coordinates of the face of the prism. This means that the coordinate r of the quad runs from the base triangle to the top triangle of the prism. This corresponds to the k-direction of the prism. Hence the s-direction of the quad corresponds to the i-direction of the prism. ---*/ - for(unsigned short k=0; k<=nPolyConn; ++k) { - for(unsigned short i=0; i<=nPolyConn; ++i) { - const unsigned short iind = i*(nPolyConn+1) + k; - modConnQuad[iind] = modConnPrism[k*kOff+i]; + for (unsigned short k = 0; k <= nPolyConn; ++k) { + for (unsigned short i = 0; i <= nPolyConn; ++i) { + const unsigned short iind = i * (nPolyConn + 1) + k; + modConnQuad[iind] = modConnPrism[k * kOff + i]; } } - } - else { + } else { /*--- The parametric coordinates r and s of the quad correspond to the parametric coordinates in i- and k-direction of the face of the prism. So an easy copy can be made. ---*/ unsigned short iind = 0; - for(unsigned short k=0; k<=nPolyConn; ++k) { - for(unsigned short i=0; i<=nPolyConn; ++i, ++iind) { - modConnQuad[iind] = modConnPrism[k*kOff+i]; + for (unsigned short k = 0; k <= nPolyConn; ++k) { + for (unsigned short i = 0; i <= nPolyConn; ++i, ++iind) { + modConnQuad[iind] = modConnPrism[k * kOff + i]; } } } } void CMeshFEM_DG::CreateConnectivitiesQuadrilateralAdjacentPyramid( - const unsigned long *cornerPointsQuad, - const unsigned short nPolyGrid, - const vector &pyraNodeIDsGrid, - const unsigned short nPolyConn, - const unsigned long *connPyra, - unsigned long *modConnQuad, - unsigned long *modConnPyra) { - + const unsigned long* cornerPointsQuad, const unsigned short nPolyGrid, const vector& pyraNodeIDsGrid, + const unsigned short nPolyConn, const unsigned long* connPyra, unsigned long* modConnQuad, + unsigned long* modConnPyra) { /* Determine the indices of the four corner points of the quadrilateral base of the pyramid. Note that the top of the pyramid is not needed in the comparison, because only triangular faces are attached to it. */ const unsigned short ind0 = 0; const unsigned short ind1 = nPolyGrid; - const unsigned short ind2 = (nPolyGrid+1)*(nPolyGrid+1) -1; + const unsigned short ind2 = (nPolyGrid + 1) * (nPolyGrid + 1) - 1; const unsigned short ind3 = ind2 - nPolyGrid; /* Easier storage of the four corner points of the quad in the new numbering. */ @@ -4474,40 +4207,46 @@ void CMeshFEM_DG::CreateConnectivitiesQuadrilateralAdjacentPyramid( signed short a = 0, b = 0, c = 0, d = 0, e = 0, f = 0; bool verticesDontMatch = false; - if(vert0 == pyraNodeIDsGrid[ind0] && vert1 == pyraNodeIDsGrid[ind1] && // ii = i. - vert2 == pyraNodeIDsGrid[ind2] && vert3 == pyraNodeIDsGrid[ind3]) { // jj = j. + if (vert0 == pyraNodeIDsGrid[ind0] && vert1 == pyraNodeIDsGrid[ind1] && // ii = i. + vert2 == pyraNodeIDsGrid[ind2] && vert3 == pyraNodeIDsGrid[ind3]) { // jj = j. b = f = 1; - } - else if(vert0 == pyraNodeIDsGrid[ind0] && vert1 == pyraNodeIDsGrid[ind3] && // ii = j. - vert2 == pyraNodeIDsGrid[ind2] && vert3 == pyraNodeIDsGrid[ind1]) { // jj = i. + } else if (vert0 == pyraNodeIDsGrid[ind0] && vert1 == pyraNodeIDsGrid[ind3] && // ii = j. + vert2 == pyraNodeIDsGrid[ind2] && vert3 == pyraNodeIDsGrid[ind1]) { // jj = i. c = e = 1; } - else if(vert0 == pyraNodeIDsGrid[ind1] && vert1 == pyraNodeIDsGrid[ind2] && // ii = j. - vert2 == pyraNodeIDsGrid[ind3] && vert3 == pyraNodeIDsGrid[ind0]) { // jj = nPoly-i. - d = nPolyConn; c = 1; e = -1; - } - else if(vert0 == pyraNodeIDsGrid[ind1] && vert1 == pyraNodeIDsGrid[ind0] && // ii = nPoly-i. - vert2 == pyraNodeIDsGrid[ind3] && vert3 == pyraNodeIDsGrid[ind2]) { // jj = j. - a = nPolyConn; b = -1; f = 1; - } - - else if(vert0 == pyraNodeIDsGrid[ind2] && vert1 == pyraNodeIDsGrid[ind3] && // ii = nPoly-i. - vert2 == pyraNodeIDsGrid[ind0] && vert3 == pyraNodeIDsGrid[ind1]) { // jj = nPoly-j. - a = d = nPolyConn; b = f = -1; - } - else if(vert0 == pyraNodeIDsGrid[ind2] && vert1 == pyraNodeIDsGrid[ind1] && // ii = nPoly-j. - vert2 == pyraNodeIDsGrid[ind0] && vert3 == pyraNodeIDsGrid[ind3]) { // jj = nPoly-i. - a = d = nPolyConn; c = e = -1; - } - - else if(vert0 == pyraNodeIDsGrid[ind3] && vert1 == pyraNodeIDsGrid[ind0] && // ii = nPoly-j. - vert2 == pyraNodeIDsGrid[ind1] && vert3 == pyraNodeIDsGrid[ind2]) { // jj = i. - a = nPolyConn; c = -1; e = 1; - } - else if(vert0 == pyraNodeIDsGrid[ind3] && vert1 == pyraNodeIDsGrid[ind2] && // ii = i. - vert2 == pyraNodeIDsGrid[ind1] && vert3 == pyraNodeIDsGrid[ind0]) { // jj = nPoly-j. - d = nPolyConn; b = 1; f = -1; + else if (vert0 == pyraNodeIDsGrid[ind1] && vert1 == pyraNodeIDsGrid[ind2] && // ii = j. + vert2 == pyraNodeIDsGrid[ind3] && vert3 == pyraNodeIDsGrid[ind0]) { // jj = nPoly-i. + d = nPolyConn; + c = 1; + e = -1; + } else if (vert0 == pyraNodeIDsGrid[ind1] && vert1 == pyraNodeIDsGrid[ind0] && // ii = nPoly-i. + vert2 == pyraNodeIDsGrid[ind3] && vert3 == pyraNodeIDsGrid[ind2]) { // jj = j. + a = nPolyConn; + b = -1; + f = 1; + } + + else if (vert0 == pyraNodeIDsGrid[ind2] && vert1 == pyraNodeIDsGrid[ind3] && // ii = nPoly-i. + vert2 == pyraNodeIDsGrid[ind0] && vert3 == pyraNodeIDsGrid[ind1]) { // jj = nPoly-j. + a = d = nPolyConn; + b = f = -1; + } else if (vert0 == pyraNodeIDsGrid[ind2] && vert1 == pyraNodeIDsGrid[ind1] && // ii = nPoly-j. + vert2 == pyraNodeIDsGrid[ind0] && vert3 == pyraNodeIDsGrid[ind3]) { // jj = nPoly-i. + a = d = nPolyConn; + c = e = -1; + } + + else if (vert0 == pyraNodeIDsGrid[ind3] && vert1 == pyraNodeIDsGrid[ind0] && // ii = nPoly-j. + vert2 == pyraNodeIDsGrid[ind1] && vert3 == pyraNodeIDsGrid[ind2]) { // jj = i. + a = nPolyConn; + c = -1; + e = 1; + } else if (vert0 == pyraNodeIDsGrid[ind3] && vert1 == pyraNodeIDsGrid[ind2] && // ii = i. + vert2 == pyraNodeIDsGrid[ind1] && vert3 == pyraNodeIDsGrid[ind0]) { // jj = nPoly-j. + d = nPolyConn; + b = 1; + f = -1; } else { @@ -4515,16 +4254,15 @@ void CMeshFEM_DG::CreateConnectivitiesQuadrilateralAdjacentPyramid( } /*--- If non-matching vertices have been found, terminate with an error message. ---*/ - if( verticesDontMatch ) - SU2_MPI::Error("Corner vertices do not match. This should not happen.", CURRENT_FUNCTION); + if (verticesDontMatch) SU2_MPI::Error("Corner vertices do not match. This should not happen.", CURRENT_FUNCTION); /*--- Loop over the DOFs of the original pyramid to create the connectivity of the pyramid that corresponds to the new numbering. Note that the outer k-loop is the same for both numberings. ---*/ - unsigned short mPoly = nPolyConn; + unsigned short mPoly = nPolyConn; unsigned short offLevel = 0; - for(unsigned short k=0; k<=nPolyConn; ++k, --mPoly) { + for (unsigned short k = 0; k <= nPolyConn; ++k, --mPoly) { unsigned short ind = offLevel; /* The variables of a and d in the transformation are actually flexible. */ @@ -4533,45 +4271,40 @@ void CMeshFEM_DG::CreateConnectivitiesQuadrilateralAdjacentPyramid( const signed short dd = d ? mPoly : 0; /* Loop over the DOFs of the current quadrilateral. */ - for(unsigned short j=0; j<=mPoly; ++j) { - for(unsigned short i=0; i<=mPoly; ++i, ++ind) { - + for (unsigned short j = 0; j <= mPoly; ++j) { + for (unsigned short i = 0; i <= mPoly; ++i, ++ind) { /*--- Determine the ii and jj indices of the new numbering, convert it to a 1D index and shore the modified index in modConnPyra. ---*/ - unsigned short ii = aa + i*b + j*c; - unsigned short jj = dd + i*e + j*f; - unsigned short iind = offLevel + jj*(mPoly+1) + ii; + unsigned short ii = aa + i * b + j * c; + unsigned short jj = dd + i * e + j * f; + unsigned short iind = offLevel + jj * (mPoly + 1) + ii; modConnPyra[iind] = connPyra[ind]; } } /* Update offLevel for the next quadrilateral level of the pyramid. */ - offLevel += (mPoly+1)*(mPoly+1); + offLevel += (mPoly + 1) * (mPoly + 1); } /*--- The quad corresponds to face 0 of the pyramid. Hence the first nn2 entries in modConnPyra are the DOFs of the quad. Copy these entries from modConnPyra. ---*/ - const unsigned short nn2 = (nPolyConn+1)*(nPolyConn+1); - for(unsigned short i=0; i &prismNodeIDsGrid, - const unsigned short nPolyConn, - const unsigned long *connPrism, - unsigned long *modConnTria, - unsigned long *modConnPrism) { - +void CMeshFEM_DG::CreateConnectivitiesTriangleAdjacentPrism(const unsigned long* cornerPointsTria, + const unsigned short nPolyGrid, + const vector& prismNodeIDsGrid, + const unsigned short nPolyConn, + const unsigned long* connPrism, unsigned long* modConnTria, + unsigned long* modConnPrism) { /* Determine the indices of the six corner points of the prism. */ const unsigned short ind0 = 0; const unsigned short ind1 = nPolyGrid; - const unsigned short ind2 = (nPolyGrid+1)*(nPolyGrid+2)/2 -1; - const unsigned short ind3 = (nPolyGrid+1)*(nPolyGrid+2)*nPolyGrid/2; + const unsigned short ind2 = (nPolyGrid + 1) * (nPolyGrid + 2) / 2 - 1; + const unsigned short ind3 = (nPolyGrid + 1) * (nPolyGrid + 2) * nPolyGrid / 2; const unsigned short ind4 = ind1 + ind3; const unsigned short ind5 = ind2 + ind3; @@ -4594,58 +4327,72 @@ void CMeshFEM_DG::CreateConnectivitiesTriangleAdjacentPrism( signed short a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0; bool verticesDontMatch = false; - if(vert0 == prismNodeIDsGrid[ind0] && vert1 == prismNodeIDsGrid[ind1] && // ii = i. - vert2 == prismNodeIDsGrid[ind2]) { // jj = j. - b = f = h = 1; // kk = k. - } - else if(vert0 == prismNodeIDsGrid[ind0] && vert1 == prismNodeIDsGrid[ind2] && // ii = j. - vert2 == prismNodeIDsGrid[ind1]) { // jj = i. - c = e = h = 1; // kk = k. - } - - else if(vert0 == prismNodeIDsGrid[ind1] && vert1 == prismNodeIDsGrid[ind0] && // ii = nPoly-i-j. - vert2 == prismNodeIDsGrid[ind2]) { // jj = j. - a = nPolyConn; b = c = -1; f = h = 1; // kk = k. - } - else if(vert0 == prismNodeIDsGrid[ind1] && vert1 == prismNodeIDsGrid[ind2] && // ii = j. - vert2 == prismNodeIDsGrid[ind0]) { // jj = nPoly-i-j. - d = nPolyConn; e = f = -1; c = h = 1; // kk = k. - } - - else if(vert0 == prismNodeIDsGrid[ind2] && vert1 == prismNodeIDsGrid[ind0] && // ii = nPoly-i-j. - vert2 == prismNodeIDsGrid[ind1]) { // jj = i. - a = nPolyConn; b = c = -1; e = h = 1; // kk = k. - } - else if(vert0 == prismNodeIDsGrid[ind2] && vert1 == prismNodeIDsGrid[ind1] && // ii = i. - vert2 == prismNodeIDsGrid[ind0]) { // jj = nPoly-i-j. - d = nPolyConn; e = f = -1; b = h = 1; // kk = k. - } - - else if(vert0 == prismNodeIDsGrid[ind3] && vert1 == prismNodeIDsGrid[ind4] && // ii = i. - vert2 == prismNodeIDsGrid[ind5]) { // jj = j. - g = nPolyConn; b = f = 1; h = -1; // kk = nPoly-k. - } - else if(vert0 == prismNodeIDsGrid[ind3] && vert1 == prismNodeIDsGrid[ind5] && // ii = j. - vert2 == prismNodeIDsGrid[ind4]) { // jj = i. - g = nPolyConn; c = e = 1; h = -1; // kk = nPoly-k. + if (vert0 == prismNodeIDsGrid[ind0] && vert1 == prismNodeIDsGrid[ind1] && // ii = i. + vert2 == prismNodeIDsGrid[ind2]) { // jj = j. + b = f = h = 1; // kk = k. + } else if (vert0 == prismNodeIDsGrid[ind0] && vert1 == prismNodeIDsGrid[ind2] && // ii = j. + vert2 == prismNodeIDsGrid[ind1]) { // jj = i. + c = e = h = 1; // kk = k. + } + + else if (vert0 == prismNodeIDsGrid[ind1] && vert1 == prismNodeIDsGrid[ind0] && // ii = nPoly-i-j. + vert2 == prismNodeIDsGrid[ind2]) { // jj = j. + a = nPolyConn; + b = c = -1; + f = h = 1; // kk = k. + } else if (vert0 == prismNodeIDsGrid[ind1] && vert1 == prismNodeIDsGrid[ind2] && // ii = j. + vert2 == prismNodeIDsGrid[ind0]) { // jj = nPoly-i-j. + d = nPolyConn; + e = f = -1; + c = h = 1; // kk = k. + } + + else if (vert0 == prismNodeIDsGrid[ind2] && vert1 == prismNodeIDsGrid[ind0] && // ii = nPoly-i-j. + vert2 == prismNodeIDsGrid[ind1]) { // jj = i. + a = nPolyConn; + b = c = -1; + e = h = 1; // kk = k. + } else if (vert0 == prismNodeIDsGrid[ind2] && vert1 == prismNodeIDsGrid[ind1] && // ii = i. + vert2 == prismNodeIDsGrid[ind0]) { // jj = nPoly-i-j. + d = nPolyConn; + e = f = -1; + b = h = 1; // kk = k. + } + + else if (vert0 == prismNodeIDsGrid[ind3] && vert1 == prismNodeIDsGrid[ind4] && // ii = i. + vert2 == prismNodeIDsGrid[ind5]) { // jj = j. + g = nPolyConn; + b = f = 1; + h = -1; // kk = nPoly-k. + } else if (vert0 == prismNodeIDsGrid[ind3] && vert1 == prismNodeIDsGrid[ind5] && // ii = j. + vert2 == prismNodeIDsGrid[ind4]) { // jj = i. + g = nPolyConn; + c = e = 1; + h = -1; // kk = nPoly-k. } - else if(vert0 == prismNodeIDsGrid[ind4] && vert1 == prismNodeIDsGrid[ind3] && // ii = nPoly-i-j. - vert2 == prismNodeIDsGrid[ind5]) { // jj = j. - a = g = nPolyConn; b = c = h = -1; f = 1; // kk = nPoly-k. - } - else if(vert0 == prismNodeIDsGrid[ind4] && vert1 == prismNodeIDsGrid[ind5] && // ii = j. - vert2 == prismNodeIDsGrid[ind3]) { // jj = nPoly-i-j. - d = g = nPolyConn; e = f = h = -1; c = 1; // kk = nPoly-k. + else if (vert0 == prismNodeIDsGrid[ind4] && vert1 == prismNodeIDsGrid[ind3] && // ii = nPoly-i-j. + vert2 == prismNodeIDsGrid[ind5]) { // jj = j. + a = g = nPolyConn; + b = c = h = -1; + f = 1; // kk = nPoly-k. + } else if (vert0 == prismNodeIDsGrid[ind4] && vert1 == prismNodeIDsGrid[ind5] && // ii = j. + vert2 == prismNodeIDsGrid[ind3]) { // jj = nPoly-i-j. + d = g = nPolyConn; + e = f = h = -1; + c = 1; // kk = nPoly-k. } - else if(vert0 == prismNodeIDsGrid[ind5] && vert1 == prismNodeIDsGrid[ind3] && // ii = nPoly-i-j. - vert2 == prismNodeIDsGrid[ind4]) { // jj = i. - a = g = nPolyConn; b = c = h = -1; e = 1; // kk = nPoly-k. - } - else if(vert0 == prismNodeIDsGrid[ind5] && vert1 == prismNodeIDsGrid[ind4] && // ii = i. - vert2 == prismNodeIDsGrid[ind3]) { // jj = nPoly-i-j. - d = g = nPolyConn; e = f = h = -1; b = 1; // kk = nPoly-k. + else if (vert0 == prismNodeIDsGrid[ind5] && vert1 == prismNodeIDsGrid[ind3] && // ii = nPoly-i-j. + vert2 == prismNodeIDsGrid[ind4]) { // jj = i. + a = g = nPolyConn; + b = c = h = -1; + e = 1; // kk = nPoly-k. + } else if (vert0 == prismNodeIDsGrid[ind5] && vert1 == prismNodeIDsGrid[ind4] && // ii = i. + vert2 == prismNodeIDsGrid[ind3]) { // jj = nPoly-i-j. + d = g = nPolyConn; + e = f = h = -1; + b = 1; // kk = nPoly-k. } else { @@ -4653,24 +4400,22 @@ void CMeshFEM_DG::CreateConnectivitiesTriangleAdjacentPrism( } /*--- If non-matching vertices have been found, terminate with an error message. ---*/ - if( verticesDontMatch ) - SU2_MPI::Error("Corner vertices do not match. This should not happen.", CURRENT_FUNCTION); + if (verticesDontMatch) SU2_MPI::Error("Corner vertices do not match. This should not happen.", CURRENT_FUNCTION); /*--- Loop over the DOFs of the original prism to create the connectivity of the prism that corresponds to the new numbering. ---*/ - const unsigned short kOff = (nPolyConn+1)*(nPolyConn+2)/2; + const unsigned short kOff = (nPolyConn + 1) * (nPolyConn + 2) / 2; unsigned short ind = 0; - for(unsigned short k=0; k<=nPolyConn; ++k) { - for(unsigned short j=0; j<=nPolyConn; ++j) { + for (unsigned short k = 0; k <= nPolyConn; ++k) { + for (unsigned short j = 0; j <= nPolyConn; ++j) { unsigned short uppBoundI = nPolyConn - j; - for(unsigned short i=0; i<=uppBoundI; ++i, ++ind) { - + for (unsigned short i = 0; i <= uppBoundI; ++i, ++ind) { /*--- Determine the ii, jj and kk indices of the new numbering, convert it to a 1D index and shore the modified index in modConnPrism. ---*/ - unsigned short ii = a + i*b + j*c; - unsigned short jj = d + i*e + j*f; - unsigned short kk = g + h*k; - unsigned short iind = kk*kOff + jj*(nPolyConn+1) + ii - jj*(jj-1)/2; + unsigned short ii = a + i * b + j * c; + unsigned short jj = d + i * e + j * f; + unsigned short kk = g + h * k; + unsigned short iind = kk * kOff + jj * (nPolyConn + 1) + ii - jj * (jj - 1) / 2; modConnPrism[iind] = connPrism[ind]; } @@ -4680,34 +4425,32 @@ void CMeshFEM_DG::CreateConnectivitiesTriangleAdjacentPrism( /*--- The triangle corresponds to face 0 of the prism. Hence the first kOff entries in modConnPrism are the DOFs of the triangle. Copy these entries from modConnPrism. ---*/ - for(unsigned short i=0; i &pyraNodeIDsGrid, - const unsigned short nPolyConn, - const unsigned long *connPyra, - bool &swapFaceInElement, - unsigned long *modConnTria, - unsigned long *modConnPyra) { - +void CMeshFEM_DG::CreateConnectivitiesTriangleAdjacentPyramid(const unsigned long* cornerPointsTria, + const unsigned short nPolyGrid, + const vector& pyraNodeIDsGrid, + const unsigned short nPolyConn, + const unsigned long* connPyra, bool& swapFaceInElement, + unsigned long* modConnTria, unsigned long* modConnPyra) { /* Determine the indices of the five corner points of the pyramid. */ const unsigned short ind0 = 0; const unsigned short ind1 = nPolyGrid; - const unsigned short ind2 = (nPolyGrid+1)*(nPolyGrid+1) -1; + const unsigned short ind2 = (nPolyGrid + 1) * (nPolyGrid + 1) - 1; const unsigned short ind3 = ind2 - nPolyGrid; - const unsigned short ind4 = (nPolyGrid+1)*(nPolyGrid+2)*(2*nPolyGrid+3)/6 -1; + const unsigned short ind4 = (nPolyGrid + 1) * (nPolyGrid + 2) * (2 * nPolyGrid + 3) / 6 - 1; /* Check if the top of the pyramid coincides with either corner point 1 or corner point 2 of the triangle. Set swapFaceInElement accordingly. */ - if( cornerPointsTria[1] == pyraNodeIDsGrid[ind4]) swapFaceInElement = true; - else if(cornerPointsTria[2] == pyraNodeIDsGrid[ind4]) swapFaceInElement = false; + if (cornerPointsTria[1] == pyraNodeIDsGrid[ind4]) + swapFaceInElement = true; + else if (cornerPointsTria[2] == pyraNodeIDsGrid[ind4]) + swapFaceInElement = false; else SU2_MPI::Error(string("Top of the pyramid does not coincide with either corner point 1 or 2.\n") + - string("This should not happen"), CURRENT_FUNCTION); + string("This should not happen"), + CURRENT_FUNCTION); /* Easier storage of the two other corner points of the triangle in the new numbering. vert0 always corresponds to cornerPointsTria[0], while vert1 contains the other @@ -4728,32 +4471,38 @@ void CMeshFEM_DG::CreateConnectivitiesTriangleAdjacentPyramid( signed short a = 0, b = 0, c = 0, d = 0, e = 0, f = 0; bool verticesDontMatch = false; - if(vert0 == pyraNodeIDsGrid[ind0] && vert1 == pyraNodeIDsGrid[ind1]) { // ii = i. - b = f = 1; // jj = j. - } - else if(vert0 == pyraNodeIDsGrid[ind0] && vert1 == pyraNodeIDsGrid[ind3]) { // ii = j. - c = e = 1; // jj = i. + if (vert0 == pyraNodeIDsGrid[ind0] && vert1 == pyraNodeIDsGrid[ind1]) { // ii = i. + b = f = 1; // jj = j. + } else if (vert0 == pyraNodeIDsGrid[ind0] && vert1 == pyraNodeIDsGrid[ind3]) { // ii = j. + c = e = 1; // jj = i. } - else if(vert0 == pyraNodeIDsGrid[ind1] && vert1 == pyraNodeIDsGrid[ind2]) { // ii = j. - d = nPolyConn; c = 1; e = -1; // jj = nPoly-i. - } - else if(vert0 == pyraNodeIDsGrid[ind1] && vert1 == pyraNodeIDsGrid[ind0]) { // ii = nPoly-i. - a = nPolyConn; b = -1; f = 1; // jj = j. + else if (vert0 == pyraNodeIDsGrid[ind1] && vert1 == pyraNodeIDsGrid[ind2]) { // ii = j. + d = nPolyConn; + c = 1; + e = -1; // jj = nPoly-i. + } else if (vert0 == pyraNodeIDsGrid[ind1] && vert1 == pyraNodeIDsGrid[ind0]) { // ii = nPoly-i. + a = nPolyConn; + b = -1; + f = 1; // jj = j. } - else if(vert0 == pyraNodeIDsGrid[ind2] && vert1 == pyraNodeIDsGrid[ind3]) { // ii = nPoly-i. - a = d = nPolyConn; b = f = -1; // jj = nPoly-j. - } - else if(vert0 == pyraNodeIDsGrid[ind2] && vert1 == pyraNodeIDsGrid[ind1]) { // ii = nPoly-j. - a = d = nPolyConn; c = e = -1; // jj = nPoly-i. + else if (vert0 == pyraNodeIDsGrid[ind2] && vert1 == pyraNodeIDsGrid[ind3]) { // ii = nPoly-i. + a = d = nPolyConn; + b = f = -1; // jj = nPoly-j. + } else if (vert0 == pyraNodeIDsGrid[ind2] && vert1 == pyraNodeIDsGrid[ind1]) { // ii = nPoly-j. + a = d = nPolyConn; + c = e = -1; // jj = nPoly-i. } - else if(vert0 == pyraNodeIDsGrid[ind3] && vert1 == pyraNodeIDsGrid[ind0]) { // ii = nPoly-j. - a = nPolyConn; c = -1; e = 1; // jj = i. - } - else if(vert0 == pyraNodeIDsGrid[ind3] && vert1 == pyraNodeIDsGrid[ind2]) { // ii = i. - d = nPolyConn; b = 1; f = -1; // jj = nPoly-j. + else if (vert0 == pyraNodeIDsGrid[ind3] && vert1 == pyraNodeIDsGrid[ind0]) { // ii = nPoly-j. + a = nPolyConn; + c = -1; + e = 1; // jj = i. + } else if (vert0 == pyraNodeIDsGrid[ind3] && vert1 == pyraNodeIDsGrid[ind2]) { // ii = i. + d = nPolyConn; + b = 1; + f = -1; // jj = nPoly-j. } else { @@ -4761,16 +4510,15 @@ void CMeshFEM_DG::CreateConnectivitiesTriangleAdjacentPyramid( } /*--- If non-matching vertices have been found, terminate with an error message. ---*/ - if( verticesDontMatch ) - SU2_MPI::Error("Corner vertices do not match. This should not happen.", CURRENT_FUNCTION); + if (verticesDontMatch) SU2_MPI::Error("Corner vertices do not match. This should not happen.", CURRENT_FUNCTION); /*--- Loop over the DOFs of the original pyramid to create the connectivity of the pyramid that corresponds to the new numbering. Note that the outer k-loop is the same for both numberings. ---*/ - unsigned short mPoly = nPolyConn; + unsigned short mPoly = nPolyConn; unsigned short offLevel = 0; - for(unsigned short k=0; k<=nPolyConn; ++k, --mPoly) { + for (unsigned short k = 0; k <= nPolyConn; ++k, --mPoly) { unsigned short ind = offLevel; /* The variables of a and d in the transformation are actually flexible. */ @@ -4779,72 +4527,64 @@ void CMeshFEM_DG::CreateConnectivitiesTriangleAdjacentPyramid( const signed short dd = d ? mPoly : 0; /* Loop over the DOFs of the current quadrilateral. */ - for(unsigned short j=0; j<=mPoly; ++j) { - for(unsigned short i=0; i<=mPoly; ++i, ++ind) { - + for (unsigned short j = 0; j <= mPoly; ++j) { + for (unsigned short i = 0; i <= mPoly; ++i, ++ind) { /*--- Determine the ii and jj indices of the new numbering, convert it to a 1D index and shore the modified index in modConnPyra. ---*/ - unsigned short ii = aa + i*b + j*c; - unsigned short jj = dd + i*e + j*f; - unsigned short iind = offLevel + jj*(mPoly+1) + ii; + unsigned short ii = aa + i * b + j * c; + unsigned short jj = dd + i * e + j * f; + unsigned short iind = offLevel + jj * (mPoly + 1) + ii; modConnPyra[iind] = connPyra[ind]; } } /* Update offLevel for the next quadrilateral level of the pyramid. */ - offLevel += (mPoly+1)*(mPoly+1); + offLevel += (mPoly + 1) * (mPoly + 1); } /*--- Determine the connectivity of the triangular face. ---*/ - if( swapFaceInElement ) { - + if (swapFaceInElement) { /*--- The parametric coordinates r and s of the triangle must be swapped w.r.t. to the parametric coordinates of the face of the pyramid. This means that the coordinate r of the triangle runs from the base to the top of the pyramid. This corresponds to the k-direction of the pyramid. Hence the s-direction of the triangle corresponds to the i-direction of the pyramid. ---*/ - mPoly = nPolyConn; + mPoly = nPolyConn; offLevel = 0; - for(unsigned short k=0; k<=nPolyConn; ++k, --mPoly) { - for(unsigned short i=0; i<=mPoly; ++i) { - unsigned short iind = i*(nPolyConn+1) + k - i*(i-1)/2; - modConnTria[iind] = modConnPyra[offLevel+i]; + for (unsigned short k = 0; k <= nPolyConn; ++k, --mPoly) { + for (unsigned short i = 0; i <= mPoly; ++i) { + unsigned short iind = i * (nPolyConn + 1) + k - i * (i - 1) / 2; + modConnTria[iind] = modConnPyra[offLevel + i]; } - offLevel += (mPoly+1)*(mPoly+1); + offLevel += (mPoly + 1) * (mPoly + 1); } - } - else { + } else { /*--- The parametric coordinates r and s of the triangle correspond to the parametric coordinates in i- and k-direction of the face of the pyramid. So an easy copy can be made. ---*/ - mPoly = nPolyConn; + mPoly = nPolyConn; offLevel = 0; unsigned short iind = 0; - for(unsigned short k=0; k<=nPolyConn; ++k, --mPoly) { - for(unsigned short i=0; i<=mPoly; ++i, ++iind) { - modConnTria[iind] = modConnPyra[offLevel+i]; + for (unsigned short k = 0; k <= nPolyConn; ++k, --mPoly) { + for (unsigned short i = 0; i <= mPoly; ++i, ++iind) { + modConnTria[iind] = modConnPyra[offLevel + i]; } - offLevel += (mPoly+1)*(mPoly+1); + offLevel += (mPoly + 1) * (mPoly + 1); } } } void CMeshFEM_DG::CreateConnectivitiesTriangleAdjacentTetrahedron( - const unsigned long *cornerPointsTria, - const unsigned short nPolyGrid, - const vector &tetNodeIDsGrid, - const unsigned short nPolyConn, - const unsigned long *connTet, - unsigned long *modConnTria, - unsigned long *modConnTet) { - + const unsigned long* cornerPointsTria, const unsigned short nPolyGrid, const vector& tetNodeIDsGrid, + const unsigned short nPolyConn, const unsigned long* connTet, unsigned long* modConnTria, + unsigned long* modConnTet) { /* Determine the indices of the four corner points of the tetrahedron. */ const unsigned short ind0 = 0; const unsigned short ind1 = nPolyGrid; - const unsigned short ind2 = (nPolyGrid+1)*(nPolyGrid+2)/2 -1; - const unsigned short ind3 = (nPolyGrid+1)*(nPolyGrid+2)*(nPolyGrid+3)/6 -1; + const unsigned short ind2 = (nPolyGrid + 1) * (nPolyGrid + 2) / 2 - 1; + const unsigned short ind3 = (nPolyGrid + 1) * (nPolyGrid + 2) * (nPolyGrid + 3) / 6 - 1; /* Easier storage of the three corner points of the triangle in the new numbering. */ const unsigned long vert0 = cornerPointsTria[0]; @@ -4861,112 +4601,128 @@ void CMeshFEM_DG::CreateConnectivitiesTriangleAdjacentTetrahedron( of the tetrahedron. This is determined below. The bool verticesDontMatch is there to check if vertices do not match. This should not happen, but it is checked for security. ---*/ - signed short a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, - l = 0, m = 0, n = 0, o = 0; + signed short a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, l = 0, m = 0, n = 0, o = 0; bool verticesDontMatch = false; - if(vert0 == tetNodeIDsGrid[ind0] && vert1 == tetNodeIDsGrid[ind1] && // ii = i. - vert2 == tetNodeIDsGrid[ind2]) { // jj = j. - b = g = o = 1; // kk = k. - } - else if(vert0 == tetNodeIDsGrid[ind0] && vert1 == tetNodeIDsGrid[ind2] && // ii = j. - vert2 == tetNodeIDsGrid[ind1]) { // jj = i. - c = f = o = 1; // kk = k. - } - else if(vert0 == tetNodeIDsGrid[ind0] && vert1 == tetNodeIDsGrid[ind1] && // ii = i. - vert2 == tetNodeIDsGrid[ind3]) { // jj = k. - b = h = n = 1; // kk = j. - } - else if(vert0 == tetNodeIDsGrid[ind0] && vert1 == tetNodeIDsGrid[ind3] && // ii = k. - vert2 == tetNodeIDsGrid[ind1]) { // jj = i. - d = f = n = 1; // kk = j. - } - else if(vert0 == tetNodeIDsGrid[ind0] && vert1 == tetNodeIDsGrid[ind2] && // ii = j. - vert2 == tetNodeIDsGrid[ind3]) { // jj = k. - c = h = m = 1; // kk = i. - } - else if(vert0 == tetNodeIDsGrid[ind0] && vert1 == tetNodeIDsGrid[ind3] && // ii = k. - vert2 == tetNodeIDsGrid[ind2]) { // jj = j. - d = g = m = 1; // kk = i. - } - - else if(vert0 == tetNodeIDsGrid[ind1] && vert1 == tetNodeIDsGrid[ind0] && // ii = nPoly-i-j-k. - vert2 == tetNodeIDsGrid[ind2]) { // jj = j. - a = nPolyConn; b = c = d = -1; g = o = 1; // kk = k. - } - else if(vert0 == tetNodeIDsGrid[ind1] && vert1 == tetNodeIDsGrid[ind2] && // ii = j. - vert2 == tetNodeIDsGrid[ind0]) { // jj = nPoly-i-j-k. - e = nPolyConn; f = g = h = -1; c = o = 1; // kk = k. - } - else if(vert0 == tetNodeIDsGrid[ind1] && vert1 == tetNodeIDsGrid[ind0] && // ii = nPoly-i-j-k. - vert2 == tetNodeIDsGrid[ind3]) { // jj = k. - a = nPolyConn; b = c = d = -1; h = n = 1; // kk = j. - } - else if(vert0 == tetNodeIDsGrid[ind1] && vert1 == tetNodeIDsGrid[ind3] && // ii = k. - vert2 == tetNodeIDsGrid[ind0]) { // jj = nPoly-i-j-k. - e = nPolyConn; f = g = h = -1; d = n = 1; // kk = j. - } - else if(vert0 == tetNodeIDsGrid[ind1] && vert1 == tetNodeIDsGrid[ind2] && // ii = j. - vert2 == tetNodeIDsGrid[ind3]) { // jj = k. - l = nPolyConn; m = n = o = -1; c = h = 1; // kk = nPoly-i-j-k. - } - else if(vert0 == tetNodeIDsGrid[ind1] && vert1 == tetNodeIDsGrid[ind3] && // ii = k. - vert2 == tetNodeIDsGrid[ind2]) { // jj = j. - l = nPolyConn; m = n = o = -1; d = g = 1; // kk = nPoly-i-j-k. - } - - else if(vert0 == tetNodeIDsGrid[ind2] && vert1 == tetNodeIDsGrid[ind0] && // ii = nPoly-i-j-k. - vert2 == tetNodeIDsGrid[ind1]) { // jj = i. - a = nPolyConn; b = c = d = -1; f = o = 1; // kk = k. - } - else if(vert0 == tetNodeIDsGrid[ind2] && vert1 == tetNodeIDsGrid[ind1] && // ii = i. - vert2 == tetNodeIDsGrid[ind0]) { // jj = nPoly-i-j-k. - e = nPolyConn; f = g = h = -1; b = o = 1; // kk = k. - } - else if(vert0 == tetNodeIDsGrid[ind2] && vert1 == tetNodeIDsGrid[ind0] && // ii = nPoly-i-j-k. - vert2 == tetNodeIDsGrid[ind3]) { // jj = k. - a = nPolyConn; b = c = d = -1; h = m = 1; // kk = i. - } - else if(vert0 == tetNodeIDsGrid[ind2] && vert1 == tetNodeIDsGrid[ind3] && // ii = k. - vert2 == tetNodeIDsGrid[ind0]) { // jj = nPoly-i-j-k. - e = nPolyConn; f = g = h = -1; d = m = 1; // kk = i. - } - else if(vert0 == tetNodeIDsGrid[ind2] && vert1 == tetNodeIDsGrid[ind0] && // ii = nPoly-i-j-k. - vert2 == tetNodeIDsGrid[ind3]) { // jj = k. - a = nPolyConn; b = c = d = -1; h = m = 1; // kk = i. - } - else if(vert0 == tetNodeIDsGrid[ind2] && vert1 == tetNodeIDsGrid[ind1] && // ii = i. - vert2 == tetNodeIDsGrid[ind3]) { // jj = k. - l = nPolyConn; m = n = o = -1; b = h = 1; // kk = nPoly-i-j-k. - } - else if(vert0 == tetNodeIDsGrid[ind2] && vert1 == tetNodeIDsGrid[ind3] && // ii = k. - vert2 == tetNodeIDsGrid[ind1]) { // jj = i. - l = nPolyConn; m = n = o = -1; d = f = 1; // kk = nPoly-i-j-k. - } - - else if(vert0 == tetNodeIDsGrid[ind3] && vert1 == tetNodeIDsGrid[ind0] && // ii = nPoly-i-j-k. - vert2 == tetNodeIDsGrid[ind1]) { // jj = i. - a = nPolyConn; b = c = d = -1; f = n = 1; // kk = j. - } - else if(vert0 == tetNodeIDsGrid[ind3] && vert1 == tetNodeIDsGrid[ind1] && // ii = i. - vert2 == tetNodeIDsGrid[ind0]) { // jj = nPoly-i-j-k. - e = nPolyConn; f = g = h = -1; b = n = 1; // kk = j. - } - else if(vert0 == tetNodeIDsGrid[ind3] && vert1 == tetNodeIDsGrid[ind0] && // ii = nPoly-i-j-k. - vert2 == tetNodeIDsGrid[ind2]) { // jj = j. - a = nPolyConn; b = c = d = -1; g = m = 1; // kk = i. - } - else if(vert0 == tetNodeIDsGrid[ind3] && vert1 == tetNodeIDsGrid[ind2] && // ii = j. - vert2 == tetNodeIDsGrid[ind0]) { // jj = nPoly-i-j-k. - e = nPolyConn; f = g = h = -1; c = m = 1; // kk = i. - } - else if(vert0 == tetNodeIDsGrid[ind3] && vert1 == tetNodeIDsGrid[ind1] && // ii = i. - vert2 == tetNodeIDsGrid[ind2]) { // jj = j. - l = nPolyConn; m = n = o = -1; b = g = 1; // kk = nPoly-i-j-k. - } - else if(vert0 == tetNodeIDsGrid[ind3] && vert1 == tetNodeIDsGrid[ind2] && // ii = j. - vert2 == tetNodeIDsGrid[ind1]) { // jj = i. - l = nPolyConn; m = n = o = -1; c = f = 1; // kk = nPoly-i-j-k. + if (vert0 == tetNodeIDsGrid[ind0] && vert1 == tetNodeIDsGrid[ind1] && // ii = i. + vert2 == tetNodeIDsGrid[ind2]) { // jj = j. + b = g = o = 1; // kk = k. + } else if (vert0 == tetNodeIDsGrid[ind0] && vert1 == tetNodeIDsGrid[ind2] && // ii = j. + vert2 == tetNodeIDsGrid[ind1]) { // jj = i. + c = f = o = 1; // kk = k. + } else if (vert0 == tetNodeIDsGrid[ind0] && vert1 == tetNodeIDsGrid[ind1] && // ii = i. + vert2 == tetNodeIDsGrid[ind3]) { // jj = k. + b = h = n = 1; // kk = j. + } else if (vert0 == tetNodeIDsGrid[ind0] && vert1 == tetNodeIDsGrid[ind3] && // ii = k. + vert2 == tetNodeIDsGrid[ind1]) { // jj = i. + d = f = n = 1; // kk = j. + } else if (vert0 == tetNodeIDsGrid[ind0] && vert1 == tetNodeIDsGrid[ind2] && // ii = j. + vert2 == tetNodeIDsGrid[ind3]) { // jj = k. + c = h = m = 1; // kk = i. + } else if (vert0 == tetNodeIDsGrid[ind0] && vert1 == tetNodeIDsGrid[ind3] && // ii = k. + vert2 == tetNodeIDsGrid[ind2]) { // jj = j. + d = g = m = 1; // kk = i. + } + + else if (vert0 == tetNodeIDsGrid[ind1] && vert1 == tetNodeIDsGrid[ind0] && // ii = nPoly-i-j-k. + vert2 == tetNodeIDsGrid[ind2]) { // jj = j. + a = nPolyConn; + b = c = d = -1; + g = o = 1; // kk = k. + } else if (vert0 == tetNodeIDsGrid[ind1] && vert1 == tetNodeIDsGrid[ind2] && // ii = j. + vert2 == tetNodeIDsGrid[ind0]) { // jj = nPoly-i-j-k. + e = nPolyConn; + f = g = h = -1; + c = o = 1; // kk = k. + } else if (vert0 == tetNodeIDsGrid[ind1] && vert1 == tetNodeIDsGrid[ind0] && // ii = nPoly-i-j-k. + vert2 == tetNodeIDsGrid[ind3]) { // jj = k. + a = nPolyConn; + b = c = d = -1; + h = n = 1; // kk = j. + } else if (vert0 == tetNodeIDsGrid[ind1] && vert1 == tetNodeIDsGrid[ind3] && // ii = k. + vert2 == tetNodeIDsGrid[ind0]) { // jj = nPoly-i-j-k. + e = nPolyConn; + f = g = h = -1; + d = n = 1; // kk = j. + } else if (vert0 == tetNodeIDsGrid[ind1] && vert1 == tetNodeIDsGrid[ind2] && // ii = j. + vert2 == tetNodeIDsGrid[ind3]) { // jj = k. + l = nPolyConn; + m = n = o = -1; + c = h = 1; // kk = nPoly-i-j-k. + } else if (vert0 == tetNodeIDsGrid[ind1] && vert1 == tetNodeIDsGrid[ind3] && // ii = k. + vert2 == tetNodeIDsGrid[ind2]) { // jj = j. + l = nPolyConn; + m = n = o = -1; + d = g = 1; // kk = nPoly-i-j-k. + } + + else if (vert0 == tetNodeIDsGrid[ind2] && vert1 == tetNodeIDsGrid[ind0] && // ii = nPoly-i-j-k. + vert2 == tetNodeIDsGrid[ind1]) { // jj = i. + a = nPolyConn; + b = c = d = -1; + f = o = 1; // kk = k. + } else if (vert0 == tetNodeIDsGrid[ind2] && vert1 == tetNodeIDsGrid[ind1] && // ii = i. + vert2 == tetNodeIDsGrid[ind0]) { // jj = nPoly-i-j-k. + e = nPolyConn; + f = g = h = -1; + b = o = 1; // kk = k. + } else if (vert0 == tetNodeIDsGrid[ind2] && vert1 == tetNodeIDsGrid[ind0] && // ii = nPoly-i-j-k. + vert2 == tetNodeIDsGrid[ind3]) { // jj = k. + a = nPolyConn; + b = c = d = -1; + h = m = 1; // kk = i. + } else if (vert0 == tetNodeIDsGrid[ind2] && vert1 == tetNodeIDsGrid[ind3] && // ii = k. + vert2 == tetNodeIDsGrid[ind0]) { // jj = nPoly-i-j-k. + e = nPolyConn; + f = g = h = -1; + d = m = 1; // kk = i. + } else if (vert0 == tetNodeIDsGrid[ind2] && vert1 == tetNodeIDsGrid[ind0] && // ii = nPoly-i-j-k. + vert2 == tetNodeIDsGrid[ind3]) { // jj = k. + a = nPolyConn; + b = c = d = -1; + h = m = 1; // kk = i. + } else if (vert0 == tetNodeIDsGrid[ind2] && vert1 == tetNodeIDsGrid[ind1] && // ii = i. + vert2 == tetNodeIDsGrid[ind3]) { // jj = k. + l = nPolyConn; + m = n = o = -1; + b = h = 1; // kk = nPoly-i-j-k. + } else if (vert0 == tetNodeIDsGrid[ind2] && vert1 == tetNodeIDsGrid[ind3] && // ii = k. + vert2 == tetNodeIDsGrid[ind1]) { // jj = i. + l = nPolyConn; + m = n = o = -1; + d = f = 1; // kk = nPoly-i-j-k. + } + + else if (vert0 == tetNodeIDsGrid[ind3] && vert1 == tetNodeIDsGrid[ind0] && // ii = nPoly-i-j-k. + vert2 == tetNodeIDsGrid[ind1]) { // jj = i. + a = nPolyConn; + b = c = d = -1; + f = n = 1; // kk = j. + } else if (vert0 == tetNodeIDsGrid[ind3] && vert1 == tetNodeIDsGrid[ind1] && // ii = i. + vert2 == tetNodeIDsGrid[ind0]) { // jj = nPoly-i-j-k. + e = nPolyConn; + f = g = h = -1; + b = n = 1; // kk = j. + } else if (vert0 == tetNodeIDsGrid[ind3] && vert1 == tetNodeIDsGrid[ind0] && // ii = nPoly-i-j-k. + vert2 == tetNodeIDsGrid[ind2]) { // jj = j. + a = nPolyConn; + b = c = d = -1; + g = m = 1; // kk = i. + } else if (vert0 == tetNodeIDsGrid[ind3] && vert1 == tetNodeIDsGrid[ind2] && // ii = j. + vert2 == tetNodeIDsGrid[ind0]) { // jj = nPoly-i-j-k. + e = nPolyConn; + f = g = h = -1; + c = m = 1; // kk = i. + } else if (vert0 == tetNodeIDsGrid[ind3] && vert1 == tetNodeIDsGrid[ind1] && // ii = i. + vert2 == tetNodeIDsGrid[ind2]) { // jj = j. + l = nPolyConn; + m = n = o = -1; + b = g = 1; // kk = nPoly-i-j-k. + } else if (vert0 == tetNodeIDsGrid[ind3] && vert1 == tetNodeIDsGrid[ind2] && // ii = j. + vert2 == tetNodeIDsGrid[ind1]) { // jj = i. + l = nPolyConn; + m = n = o = -1; + c = f = 1; // kk = nPoly-i-j-k. } else { @@ -4974,30 +4730,28 @@ void CMeshFEM_DG::CreateConnectivitiesTriangleAdjacentTetrahedron( } /*--- If non-matching vertices have been found, terminate with an error message. ---*/ - if( verticesDontMatch ) - SU2_MPI::Error("Corner vertices do not match. This should not happen.", CURRENT_FUNCTION); + if (verticesDontMatch) SU2_MPI::Error("Corner vertices do not match. This should not happen.", CURRENT_FUNCTION); /*--- Some constants to convert the (ii,jj,kk) indices to a 1D index. ---*/ - const unsigned short abv1 = (11 + 12*nPolyConn + 3*nPolyConn*nPolyConn); - const unsigned short abv2 = (2*nPolyConn + 3)*3; - const unsigned short abv3 = (nPolyConn + 2)*3; + const unsigned short abv1 = (11 + 12 * nPolyConn + 3 * nPolyConn * nPolyConn); + const unsigned short abv2 = (2 * nPolyConn + 3) * 3; + const unsigned short abv3 = (nPolyConn + 2) * 3; /*--- Loop over the DOFs of the original tetrahedron to create the connectivity of the tetrahedron that corresponds to the new numbering. ---*/ unsigned short ind = 0; - for(unsigned short k=0; k<=nPolyConn; ++k) { + for (unsigned short k = 0; k <= nPolyConn; ++k) { unsigned short uppBoundJ = nPolyConn - k; - for(unsigned short j=0; j<=uppBoundJ; ++j) { + for (unsigned short j = 0; j <= uppBoundJ; ++j) { unsigned short uppBoundI = nPolyConn - k - j; - for(unsigned short i=0; i<=uppBoundI; ++i, ++ind) { - + for (unsigned short i = 0; i <= uppBoundI; ++i, ++ind) { /*--- Determine the ii, jj and kk indices of the new numbering, convert it to a 1D index and shore the modified index in modConnTet. ---*/ - unsigned short ii = a + i*b + j*c + k*d; - unsigned short jj = e + i*f + j*g + k*h; - unsigned short kk = l + i*m + j*n + k*o; - unsigned short iind = (abv1*kk + abv2*jj + 6*ii - abv3*kk*kk - - 6*kk*jj - 3*jj*jj + kk*kk*kk)/6; + unsigned short ii = a + i * b + j * c + k * d; + unsigned short jj = e + i * f + j * g + k * h; + unsigned short kk = l + i * m + j * n + k * o; + unsigned short iind = + (abv1 * kk + abv2 * jj + 6 * ii - abv3 * kk * kk - 6 * kk * jj - 3 * jj * jj + kk * kk * kk) / 6; modConnTet[iind] = connTet[ind]; } @@ -5007,19 +4761,17 @@ void CMeshFEM_DG::CreateConnectivitiesTriangleAdjacentTetrahedron( /*--- The triangle corresponds to face 0 of the tetrahedron. Hence the first nn2 entries in modConnTet are the DOFs of the triangle. Copy these entries from modConnTet. ---*/ - const unsigned short nn2 = (nPolyConn+1)*(nPolyConn+2)/2; - for(unsigned short i=0; iGetKind_Solver() != MAIN_SOLVER::FEM_EULER && config->GetKind_Solver() != MAIN_SOLVER::DISC_ADJ_FEM_EULER); + bool viscousTerms = (config->GetKind_Solver() != MAIN_SOLVER::FEM_EULER && + config->GetKind_Solver() != MAIN_SOLVER::DISC_ADJ_FEM_EULER); /* Loop over the internal matching faces. */ - for(unsigned long i=0; iGetUse_Lumped_MassMatrix_DGFEM(); - bool FullMassMatrix = false, FullInverseMassMatrix = false; + bool FullMassMatrix = false, FullInverseMassMatrix = false; bool LumpedMassMatrix = false, DerMetricTerms = false; - if(config->GetTime_Marching() == TIME_MARCHING::STEADY || - config->GetTime_Marching() == TIME_MARCHING::ROTATIONAL_FRAME) { - if( UseLumpedMassMatrix) LumpedMassMatrix = true; - else FullInverseMassMatrix = true; - } - else if(config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST || - config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND || - config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE) { - if( UseLumpedMassMatrix ) FullMassMatrix = LumpedMassMatrix = true; - else FullInverseMassMatrix = true; - } - else { - + if (config->GetTime_Marching() == TIME_MARCHING::STEADY || + config->GetTime_Marching() == TIME_MARCHING::ROTATIONAL_FRAME) { + if (UseLumpedMassMatrix) + LumpedMassMatrix = true; + else + FullInverseMassMatrix = true; + } else if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST || + config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND || + config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE) { + if (UseLumpedMassMatrix) + FullMassMatrix = LumpedMassMatrix = true; + else + FullInverseMassMatrix = true; + } else { /* Time accurate explicit time integration scheme. */ - FullMassMatrix = LumpedMassMatrix = false; + FullMassMatrix = LumpedMassMatrix = false; FullInverseMassMatrix = true; /* For ADER-DG, check if the derivative of the metric terms are needed. */ - if(config->GetKind_TimeIntScheme_Flow() == ADER_DG) { + if (config->GetKind_TimeIntScheme_Flow() == ADER_DG) { MAIN_SOLVER solver = config->GetKind_Solver(); - if(solver == MAIN_SOLVER::FEM_NAVIER_STOKES || solver == MAIN_SOLVER::FEM_RANS || solver == MAIN_SOLVER::FEM_LES) { - if(config->GetKind_ADER_Predictor() == ADER_NON_ALIASED_PREDICTOR) - DerMetricTerms = true; + if (solver == MAIN_SOLVER::FEM_NAVIER_STOKES || solver == MAIN_SOLVER::FEM_RANS || + solver == MAIN_SOLVER::FEM_LES) { + if (config->GetKind_ADER_Predictor() == ADER_NON_ALIASED_PREDICTOR) DerMetricTerms = true; } } } @@ -5401,8 +5128,8 @@ void CMeshFEM_DG::MetricTermsVolumeElements(CConfig *config) { This depends on the number of spatial dimensions of the problem. Also determine the additional number of metric terms per integration point for the computation of the second derivatives. */ - const unsigned short nMetricPerPoint = nDim*nDim + 1; - const unsigned short nMetric2ndDerPerPoint = nDim*(nDim + nDim*(nDim-1)/2); + const unsigned short nMetricPerPoint = nDim * nDim + 1; + const unsigned short nMetric2ndDerPerPoint = nDim * (nDim + nDim * (nDim - 1) / 2); /*--------------------------------------------------------------------------*/ /*--- Step 1: Determine the metric terms, drdx, drdy, drdz, dsdx, etc. ---*/ @@ -5411,75 +5138,68 @@ void CMeshFEM_DG::MetricTermsVolumeElements(CConfig *config) { /*--------------------------------------------------------------------------*/ /* Loop over the owned volume elements. */ - for(unsigned long i=0; i helpVecResultInt(nInt*nDim*nDim); - vector helpVecResultDOFsSol(nDOFsSol*nDim*nDim); - su2double *vecResultInt = helpVecResultInt.data(); - su2double *vecResultDOFsSol = helpVecResultDOFsSol.data(); + vector helpVecResultInt(nInt * nDim * nDim); + vector helpVecResultDOFsSol(nDOFsSol * nDim * nDim); + su2double* vecResultInt = helpVecResultInt.data(); + su2double* vecResultDOFsSol = helpVecResultDOFsSol.data(); /* Compute the gradient of the coordinates w.r.t. the parametric coordinates for this element in the integration points. */ - ComputeGradientsCoorWRTParam(nInt, nDOFsGrid, matDerBasisInt, - volElem[i].nodeIDsGrid.data(), - vecResultInt, config); + ComputeGradientsCoorWRTParam(nInt, nDOFsGrid, matDerBasisInt, volElem[i].nodeIDsGrid.data(), vecResultInt, config); /* Compute the gradient of the coordinates w.r.t. the parametric coordinates for this element in the solution DOFs. */ - ComputeGradientsCoorWRTParam(nDOFsSol, nDOFsGrid, matDerBasisSolDOFs, - volElem[i].nodeIDsGrid.data(), + ComputeGradientsCoorWRTParam(nDOFsSol, nDOFsGrid, matDerBasisSolDOFs, volElem[i].nodeIDsGrid.data(), vecResultDOFsSol, config); /* Convert the values of dxdr, dydr, etc. to the required metric terms for both the integration points and the solution DOFs. */ - VolumeMetricTermsFromCoorGradients(nInt, vecResultInt, - volElem[i].metricTerms); + VolumeMetricTermsFromCoorGradients(nInt, vecResultInt, volElem[i].metricTerms); - VolumeMetricTermsFromCoorGradients(nDOFsSol, vecResultDOFsSol, - volElem[i].metricTermsSolDOFs); + VolumeMetricTermsFromCoorGradients(nDOFsSol, vecResultDOFsSol, volElem[i].metricTermsSolDOFs); /* Check for negative Jacobians in the integrations points and at the location of the solution DOFs. */ bool negJacobian = false; - for(unsigned short j=0; j helpVecResultGridDOFs(nDOFsGrid*nDim*nDim); - su2double *vecResultGridDOFs = helpVecResultGridDOFs.data(); + vector helpVecResultGridDOFs(nDOFsGrid * nDim * nDim); + su2double* vecResultGridDOFs = helpVecResultGridDOFs.data(); - ComputeGradientsCoorWRTParam(nDOFsGrid, nDOFsGrid, matDerBasisGridDOFs, - volElem[i].nodeIDsGrid.data(), + ComputeGradientsCoorWRTParam(nDOFsGrid, nDOFsGrid, matDerBasisGridDOFs, volElem[i].nodeIDsGrid.data(), vecResultGridDOFs, config); /* Convert the values of dxdr, dydr, etc. to the required metric terms in the grid DOFs. */ - vector metricGridDOFs(nDOFsGrid*nMetricPerPoint); - VolumeMetricTermsFromCoorGradients(nDOFsGrid, vecResultGridDOFs, - metricGridDOFs); + vector metricGridDOFs(nDOFsGrid * nMetricPerPoint); + VolumeMetricTermsFromCoorGradients(nDOFsGrid, vecResultGridDOFs, metricGridDOFs); /*--- The metric terms currently stored in metricGridDOFs are scaled with the Jacobian and also the Jacobian is part of the metric terms. For the derivatives of the metric terms, the Jacobian is not needed, but the original unscaled terms are needed. This is done in the loop below. ---*/ - for(unsigned short j=0; j helpVecDerMetrics(nDim*nInt*(nMetricPerPoint-1)); - su2double *vecDerMetrics = helpVecDerMetrics.data(); + vector helpVecDerMetrics(nDim * nInt * (nMetricPerPoint - 1)); + su2double* vecDerMetrics = helpVecDerMetrics.data(); /* Carry out the matrix multiplication. The last argument is NULL, such that this gemm call is ignored in the profiling. Replace by config if it should be included. */ - blasFunctions->gemm(nDim*nInt, nMetricPerPoint-1, nDOFsGrid, matDerBasisInt, - metricGridDOFs.data(), vecDerMetrics, nullptr); + blasFunctions->gemm(nDim * nInt, nMetricPerPoint - 1, nDOFsGrid, matDerBasisInt, metricGridDOFs.data(), + vecDerMetrics, nullptr); /* Allocate the memory for the additional metric terms needed to compute the second derivatives. */ - volElem[i].metricTerms2ndDer.resize(nInt*nMetric2ndDerPerPoint); + volElem[i].metricTerms2ndDer.resize(nInt * nMetric2ndDerPerPoint); /*--- Loop over the integration points to compute the additional metric terms needed for the second derivatives. This is a combination of the original metric terms and derivatives of these terms. Make a distinction between 2D and 3D. ---*/ - switch( nDim ) { + switch (nDim) { case 2: { - /* 2D computation. Loop over the integration points. */ - for(unsigned short j=0; jGetKind_TimeIntScheme_Flow() == ADER_DG) - TimeCoefficientsPredictorADER_DG(config); + if (config->GetKind_TimeIntScheme_Flow() == ADER_DG) TimeCoefficientsPredictorADER_DG(config); /* Define the double vector to define the values of the mass matrix contributions of the standard element in the integration points. */ @@ -5697,44 +5401,41 @@ void CMeshFEM_DG::MetricTermsVolumeElements(CConfig *config) { valMMInt.resize(standardElementsSol.size()); /* Loop over the different standard elements. */ - for(unsigned long i=0; i JacVec(nInt); - su2double *Jac = JacVec.data(); + su2double* Jac = JacVec.data(); - for(unsigned short l=0; lgemv(nDOFs2, nInt, valInt, Jac, massMat.data()); /* Store the full mass matrix in volElem[i], if needed. */ - if( FullMassMatrix ) volElem[i].massMatrix = massMat; + if (FullMassMatrix) volElem[i].massMatrix = massMat; /*--- Check if the lumped mass matrix is needed. ---*/ - if( LumpedMassMatrix ) { - + if (LumpedMassMatrix) { /* Allocate the memory for the lumped mass matrix and initialize them to zero.. */ volElem[i].lumpedMassMatrix.assign(nDOFs, 0.0); /* Loop over the DOFs to compute the elements of the local lumped mass matrix. It is the sum of the absolute values of the row. */ - for(unsigned short j=0; jGetnTimeDOFsADER_DG(); - const su2double *TimeDOFs = config->GetTimeDOFsADER_DG(); + const su2double* TimeDOFs = config->GetTimeDOFsADER_DG(); /* Compute the Vandermonde matrix and its inverse in the time DOFs. */ vector rTimeDOFs(nTimeDOFs); - for(unsigned short i=0; i V(nTimeDOFs*nTimeDOFs); + vector V(nTimeDOFs * nTimeDOFs); CFEMStandardElementBase timeElement; timeElement.Vandermonde1D(nTimeDOFs, rTimeDOFs, V); @@ -5850,75 +5543,71 @@ void CMeshFEM_DG::TimeCoefficientsPredictorADER_DG(CConfig *config) { timeElement.InverseMatrix(nTimeDOFs, VInv); /* Compute the Vandermonde matrix for r = 1, i.e. the end of the interval. */ - vector rEnd(1); rEnd[0] = 1.0; + vector rEnd(1); + rEnd[0] = 1.0; vector VEnd(nTimeDOFs); timeElement.Vandermonde1D(nTimeDOFs, rEnd, VEnd); /*--- Determine the matrix products VEnd*VInv to get the correct expression for the values of the Lagrangian interpolation functions for r = 1. ---*/ vector lEnd(nTimeDOFs, 0.0); - for(unsigned short j=0; j 1.e-6) - SU2_MPI::Error( "Difference is too large to be caused by roundoff", CURRENT_FUNCTION); + if (fabs(val - 1.0) > 1.e-6) SU2_MPI::Error("Difference is too large to be caused by roundoff", CURRENT_FUNCTION); - val = 1.0/val; - for(unsigned short j=0; j MassTime(nTimeDOFs*nTimeDOFs, 0.0); - for(unsigned short j=0; j MassTime(nTimeDOFs * nTimeDOFs, 0.0); + for (unsigned short j = 0; j < nTimeDOFs; ++j) { + for (unsigned short i = 0; i < nTimeDOFs; ++i) { + const unsigned short ji = j * nTimeDOFs + i; + for (unsigned short k = 0; k < nTimeDOFs; ++k) MassTime[ji] += V[k * nTimeDOFs + j] * V[k * nTimeDOFs + i]; } } timeElement.InverseMatrix(nTimeDOFs, MassTime); /* Compute the gradient of the Vandermonde matrix in the time DOFs. */ - vector VDr(nTimeDOFs*nTimeDOFs); + vector VDr(nTimeDOFs * nTimeDOFs); timeElement.GradVandermonde1D(nTimeDOFs, rTimeDOFs, VDr); /* Compute the product VDr VInv. Store the result in V. Note that in both matrices the transpose is stored compared to the definition of Hesthaven. */ - for(unsigned short j=0; j S(nTimeDOFs*nTimeDOFs, 0.0); - for(unsigned short j=0; j S(nTimeDOFs * nTimeDOFs, 0.0); + for (unsigned short j = 0; j < nTimeDOFs; ++j) { + for (unsigned short i = 0; i < nTimeDOFs; ++i) { + const unsigned short ji = j * nTimeDOFs + i; + for (unsigned short k = 0; k < nTimeDOFs; ++k) S[ji] += MassTime[j * nTimeDOFs + k] * V[k * nTimeDOFs + i]; } } /* Compute the time coefficients of the iteration matrix in the predictor step. */ - timeCoefADER_DG.assign(nTimeDOFs*nTimeDOFs, 0.0); - for(unsigned short j=0; jGetnTimeIntegrationADER_DG(); - const su2double *TimeIntegrationPoints = config->GetTimeIntegrationADER_DG(); + unsigned short nTimeIntegrationPoints = config->GetnTimeIntegrationADER_DG(); + const su2double* TimeIntegrationPoints = config->GetTimeIntegrationADER_DG(); /* Compute the Vandermonde matrix for the time integration points. */ vector rTimeIntPoints(nTimeIntegrationPoints); - for(unsigned short i=0; i 1.e-6) - SU2_MPI::Error( "Difference is too large to be caused by roundoff", CURRENT_FUNCTION); + if (fabs(val - 1.0) > 1.e-6) SU2_MPI::Error("Difference is too large to be caused by roundoff", CURRENT_FUNCTION); - val = 1.0/val; - for(unsigned short i=0; i 1.e-6) - SU2_MPI::Error( "Difference is too large to be caused by roundoff", CURRENT_FUNCTION); + if (fabs(val - 1.0) > 1.e-6) SU2_MPI::Error("Difference is too large to be caused by roundoff", CURRENT_FUNCTION); - val = 1.0/val; - for(unsigned short i=0; i &metricTerms) { - +void CMeshFEM_DG::VolumeMetricTermsFromCoorGradients(const unsigned short nEntities, const su2double* gradCoor, + vector& metricTerms) { /*--- Convert the dxdr, dydr, etc., stored in coorGradients, to the required metric terms. Make a distinction between 2D and 3D. ---*/ - switch( nDim ) { + switch (nDim) { case 2: { - /* 2D computation. Store the offset between the r and s derivatives. */ - const unsigned short off = 2*nEntities; + const unsigned short off = 2 * nEntities; /* Loop over the entities and store the metric terms. */ unsigned short ii = 0; - for(unsigned short j=0; jGetMarker_All_KindBC(iMarker)) { case ISOTHERMAL: case HEAT_FLUX: { const string Marker_Tag = config->GetMarker_All_TagBound(iMarker); - if(config->GetWallFunction_Treatment(Marker_Tag) != WALL_FUNCTIONS::NONE) - wallFunctions = true; + if (config->GetWallFunction_Treatment(Marker_Tag) != WALL_FUNCTIONS::NONE) wallFunctions = true; break; } - default: /* Just to avoid a compiler warning. */ + default: /* Just to avoid a compiler warning. */ break; } } /* If no wall functions are used, nothing needs to be done and a return can be made. */ - if( !wallFunctions ) return; + if (!wallFunctions) return; /*--------------------------------------------------------------------------*/ /*--- Step 2. Build the local ADT of the volume elements. The halo ---*/ @@ -6153,66 +5829,61 @@ void CMeshFEM_DG::WallFunctionPreprocessing(CConfig *config) { /* Define the vectors, which store the mapping from the subelement to the parent element, subelement ID within the parent element, the element type and the connectivity of the subelements. */ - vector parentElement; + vector parentElement; vector subElementIDInParent; vector VTK_TypeElem; - vector elemConn; + vector elemConn; /* Loop over the locally stored volume elements (including halo elements) to create the connectivity of the subelements. */ - for(unsigned long l=0; l volCoor; - volCoor.reserve(nDim*meshPoints.size()); + volCoor.reserve(nDim * meshPoints.size()); - for(unsigned long l=0; lGetMarker_All_KindBC(iMarker)) { case ISOTHERMAL: case HEAT_FLUX: { const string Marker_Tag = config->GetMarker_All_TagBound(iMarker); - if(config->GetWallFunction_Treatment(Marker_Tag) != WALL_FUNCTIONS::NONE) { - + if (config->GetWallFunction_Treatment(Marker_Tag) != WALL_FUNCTIONS::NONE) { /* An LES wall model is used for this boundary marker. Determine which wall model and allocate the memory for the member variable. */ - switch (config->GetWallFunction_Treatment(Marker_Tag) ) { + switch (config->GetWallFunction_Treatment(Marker_Tag)) { case WALL_FUNCTIONS::EQUILIBRIUM_MODEL: { - if(rank == MASTER_NODE) - cout << "Marker " << Marker_Tag << " uses an Equilibrium Wall Model." << endl; + if (rank == MASTER_NODE) cout << "Marker " << Marker_Tag << " uses an Equilibrium Wall Model." << endl; boundaries[iMarker].wallModel = new CWallModel1DEQ(config, Marker_Tag); break; } case WALL_FUNCTIONS::LOGARITHMIC_MODEL: { - if(rank == MASTER_NODE) - cout << "Marker " << Marker_Tag << " uses the Reichardt and Kader analytical laws for the Wall Model." << endl; + if (rank == MASTER_NODE) + cout << "Marker " << Marker_Tag << " uses the Reichardt and Kader analytical laws for the Wall Model." + << endl; boundaries[iMarker].wallModel = new CWallModelLogLaw(config, Marker_Tag); break; @@ -6261,68 +5930,57 @@ void CMeshFEM_DG::WallFunctionPreprocessing(CConfig *config) { /* Retrieve the double information for this wall model. The height of the exchange location is the first element of this array. */ - const su2double *doubleInfo = config->GetWallFunction_DoubleInfo(Marker_Tag); + const su2double* doubleInfo = config->GetWallFunction_DoubleInfo(Marker_Tag); /* Easier storage of the surface elements and loop over them. */ - vector &surfElem = boundaries[iMarker].surfElem; - for(unsigned long l=0; l& surfElem = boundaries[iMarker].surfElem; + for (unsigned long l = 0; l < surfElem.size(); ++l) { /* Determine the corresponding standard face element and get the relevant information from it. Note that the standard element of the solution must be taken and not of the grid. */ - const unsigned short ind = surfElem[l].indStandardElement; + const unsigned short ind = surfElem[l].indStandardElement; const unsigned short nInt = standardBoundaryFacesSol[ind].GetNIntegration(); /* Allocate the memory for the memory to store the donors and the parametric weights. The donor elements are stored in an CUnsignedLong2T, such that they can be sorted. */ vector donorElements(nInt); - vector parCoorInDonor(nInt*nDim); + vector parCoorInDonor(nInt * nDim); /* Loop over the integration points. */ - for(unsigned short i=0; i= nVolElemOwned) - boundaries[iMarker].haloInfoNeededForBC = true; + if (surfElem[l].donorsWallFunction.back() >= nVolElemOwned) boundaries[iMarker].haloInfoNeededForBC = true; /* Allocate the memory of the first index of the interpolation matrices for the donordata. */ surfElem[l].matWallFunctionDonor.resize(surfElem[l].donorsWallFunction.size()); /* Loop over the different donors for the wall function data. */ - for(unsigned long j=0; j &matDonor = surfElem[l].matWallFunctionDonor[j]; + const unsigned long donor = surfElem[l].donorsWallFunction[j]; + vector& matDonor = surfElem[l].matWallFunctionDonor[j]; /* Determine the number of DOFs in the donor element. Note that the standard element of the solution must be used for this purpose. */ - const unsigned short ind = volElem[donor].indStandardElement; + const unsigned short ind = volElem[donor].indStandardElement; const unsigned short nDOFs = standardElementsSol[ind].GetNDOFs(); /* Allocate the memory for the vector used to compute the Lagrangian interpolation functions in the parametric coordinates, i.e. the interpolation weights, and for matDonor, which stores all these weights. */ - const unsigned short nIntThisDonor = surfElem[l].nIntPerWallFunctionDonor[j+1] - - surfElem[l].nIntPerWallFunctionDonor[j]; + const unsigned short nIntThisDonor = + surfElem[l].nIntPerWallFunctionDonor[j + 1] - surfElem[l].nIntPerWallFunctionDonor[j]; vector lagBasis(nDOFs); - matDonor.reserve(nIntThisDonor*nDOFs); + matDonor.reserve(nIntThisDonor * nDOFs); /* Loop over the integration points for this donor element. */ - for(unsigned short i=surfElem[l].nIntPerWallFunctionDonor[j]; - i *locDOFs[] = {standardElementsGrid[ind].GetRDOFs(), - standardElementsGrid[ind].GetSDOFs(), + const vector* locDOFs[] = {standardElementsGrid[ind].GetRDOFs(), standardElementsGrid[ind].GetSDOFs(), standardElementsGrid[ind].GetTDOFs()}; /* Create the initial guess of the parametric coordinates by interpolation in the sub-element. */ - for(unsigned short iDim=0; iDimdata(); - for(unsigned short i=0; idata(); + for (unsigned short i = 0; i < nDOFsPerSubElem; ++i) parCoor[iDim] += weightsSubElem[i] * coorDOFs[connSubElems[i]]; } /*--------------------------------------------------------------------------*/ @@ -6495,47 +6166,48 @@ void CMeshFEM_DG::HighOrderContainmentSearch(const su2double *coor, vector > dLagBasis(nDim, vector(nDOFs)); /* Abbreviate the grid DOFs of this element a bit easier. */ - const unsigned long *DOFs = volElem[parElem].nodeIDsGrid.data(); + const unsigned long* DOFs = volElem[parElem].nodeIDsGrid.data(); /* Loop over the maximum number of iterations. */ unsigned short itCount; - for(itCount=0; itCountGetLength_Ref(); + const su2double L_Ref = config->GetLength_Ref(); const su2double Omega_Ref = config->GetOmega_Ref(); - const su2double Vel_Ref = config->GetVelocity_Ref(); + const su2double Vel_Ref = config->GetVelocity_Ref(); /*--- Make a distinction between the possibilities. ---*/ - switch( Kind_Grid_Movement ) { - - /*-------------------------------------------------------------------------------------*/ + switch (Kind_Grid_Movement) { + /*-------------------------------------------------------------------------------------*/ case ROTATING_FRAME: { - /* Get the rotation rate and rotation center from config. */ - const su2double Center[] = {config->GetMotion_Origin(0), - config->GetMotion_Origin(1), - config->GetMotion_Origin(2)}; - const su2double Omega[] = {config->GetRotation_Rate(0)/Omega_Ref, - config->GetRotation_Rate(1)/Omega_Ref, - config->GetRotation_Rate(2)/Omega_Ref}; + const su2double Center[] = {config->GetMotion_Origin(0), config->GetMotion_Origin(1), + config->GetMotion_Origin(2)}; + const su2double Omega[] = {config->GetRotation_Rate(0) / Omega_Ref, config->GetRotation_Rate(1) / Omega_Ref, + config->GetRotation_Rate(2) / Omega_Ref}; /* Array used to store the distance to the rotation center. */ su2double dist[] = {0.0, 0.0, 0.0}; /* Loop over the owned volume elements. */ - for(unsigned long l=0; l &surfElem = boundaries[iMarker].surfElem; + vector& surfElem = boundaries[iMarker].surfElem; /* Check if this is a shroud boundary. */ bool shroudBoundary = false; - for(unsigned short iShroud=0; iShroudGetnMarker_Shroud(); ++iShroud) { - if(boundaries[iMarker].markerTag == config->GetMarker_Shroud(iShroud)) { + for (unsigned short iShroud = 0; iShroud < config->GetnMarker_Shroud(); ++iShroud) { + if (boundaries[iMarker].markerTag == config->GetMarker_Shroud(iShroud)) { shroudBoundary = true; break; } } /* Loop over the boundary faces of this marker. */ - for(unsigned long l=0; lGetTranslation_Rate(0)/Vel_Ref, - config->GetTranslation_Rate(1)/Vel_Ref, - config->GetTranslation_Rate(2)/Vel_Ref}; + const su2double vTrans[] = {config->GetTranslation_Rate(0) / Vel_Ref, config->GetTranslation_Rate(1) / Vel_Ref, + config->GetTranslation_Rate(2) / Vel_Ref}; /* Loop over the owned volume elements. */ - for(unsigned long l=0; l &surfElem = boundaries[iMarker].surfElem; + vector& surfElem = boundaries[iMarker].surfElem; /* Loop over the boundary faces of this marker. */ - for(unsigned long l=0; lGetSurface_Movement(MOVING_WALL)){ + if (config->GetSurface_Movement(MOVING_WALL)) { /*--- Loop over the physical boundaries. Skip the periodic boundaries. ---*/ - for(unsigned short i=0; iGetMarker_All_Moving(i) == YES) { - /* Determine the prescribed translation velocity, rotation rate and rotation center. */ - const su2double Center[] = {config->GetMotion_Origin(0), - config->GetMotion_Origin(1), + const su2double Center[] = {config->GetMotion_Origin(0), config->GetMotion_Origin(1), config->GetMotion_Origin(2)}; - const su2double Omega[] = {config->GetRotation_Rate(0)/Omega_Ref, - config->GetRotation_Rate(1)/Omega_Ref, - config->GetRotation_Rate(2)/Omega_Ref}; - const su2double vTrans[] = {config->GetTranslation_Rate(0)/Vel_Ref, - config->GetTranslation_Rate(1)/Vel_Ref, - config->GetTranslation_Rate(2)/Vel_Ref}; + const su2double Omega[] = {config->GetRotation_Rate(0) / Omega_Ref, config->GetRotation_Rate(1) / Omega_Ref, + config->GetRotation_Rate(2) / Omega_Ref}; + const su2double vTrans[] = {config->GetTranslation_Rate(0) / Vel_Ref, + config->GetTranslation_Rate(1) / Vel_Ref, + config->GetTranslation_Rate(2) / Vel_Ref}; /* Easier storage of the surface elements and loop over them. */ - vector &surfElem = boundaries[i].surfElem; - - for(unsigned long l=0; l& surfElem = boundaries[i].surfElem; + for (unsigned long l = 0; l < surfElem.size(); ++l) { /* Determine the corresponding standard face element and get the relevant information from it. Note that the standard element of the solution must be taken and not of the grid. */ - const unsigned short ind = surfElem[l].indStandardElement; + const unsigned short ind = surfElem[l].indStandardElement; const unsigned short nInt = standardBoundaryFacesSol[ind].GetNIntegration(); /* Loop over the number of integration points. */ - for(unsigned short j=0; jGetnZone(); - nPoint_P2PSend = new int[size] (); - nPoint_P2PRecv = new int[size] (); + nPoint_P2PSend = new int[size](); + nPoint_P2PRecv = new int[size](); - nVertex = new unsigned long[config->GetnMarker_All()] (); + nVertex = new unsigned long[config->GetnMarker_All()](); Tag_to_Marker = new string[config->GetnMarker_All()]; - for (unsigned short i=0; i <= config->GetnLevels_TimeAccurateLTS(); i++){ + for (unsigned short i = 0; i <= config->GetnLevels_TimeAccurateLTS(); i++) { nMatchingFacesWithHaloElem.push_back(0); } boundaries.resize(config->GetnMarker_All()); nDim = CConfig::GetnDim(config->GetMesh_FileName(), config->GetMesh_FileFormat()); - } diff --git a/Common/src/fem/fem_integration_rules.cpp b/Common/src/fem/fem_integration_rules.cpp index 6f80ee16bf7..ff8bdf19a25 100644 --- a/Common/src/fem/fem_integration_rules.cpp +++ b/Common/src/fem/fem_integration_rules.cpp @@ -2,7 +2,7 @@ * \file fem_integration_rules.cpp * \brief FEM integration rules for the standard elements. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -32,51 +32,48 @@ /* Private member functions of CFEMStandardElementBase. */ /*----------------------------------------------------------------------------------*/ -void CFEMStandardElementBase::IntegrationPointsLine(void) { - +void CFEMStandardElementBase::IntegrationPointsLine() { /*--- Allocate the memory for the integration points and weights and determine them. ---*/ - nIntegration = orderExact/2 + 1; + nIntegration = orderExact / 2 + 1; rIntegration.resize(nIntegration); wIntegration.resize(nIntegration); GaussLegendrePoints1D(rIntegration, wIntegration); } -void CFEMStandardElementBase::IntegrationPointsQuadrilateral(void) { - +void CFEMStandardElementBase::IntegrationPointsQuadrilateral() { /*--- The 2D quadrature rule is a tensor product of the 1D Gauss-Legendre quadrature rule. First determine the number of integration points in 1D, which is stored in M, and determine them. ---*/ - unsigned short M = orderExact/2 + 1; + unsigned short M = orderExact / 2 + 1; vector GLPoints(M), GLWeights(M); GaussLegendrePoints1D(GLPoints, GLWeights); /*--- Allocate the memory for the integration points and weights and determine them. ---*/ - nIntegration = M*M; + nIntegration = M * M; rIntegration.resize(nIntegration); sIntegration.resize(nIntegration); wIntegration.resize(nIntegration); unsigned int ii = 0; - for(unsigned short j=0; j GLPoints(M), GLWeights(M); GaussLegendrePoints1D(GLPoints, GLWeights); @@ -84,95 +81,147 @@ void CFEMStandardElementBase::IntegrationPointsPrism(void) { /*--- Also determine the integration rule for a triangle. ---*/ IntegrationPointsTriangle(); - unsigned short nIntTriangle = nIntegration; - vector rTriangle = rIntegration; - vector sTriangle = sIntegration; - vector wTriangle = wIntegration; + unsigned short nIntTriangle = nIntegration; + vector rTriangle = rIntegration; + vector sTriangle = sIntegration; + vector wTriangle = wIntegration; /*--- Allocate the memory for the integration points and weights of the prism and determine them. ---*/ - nIntegration = M*nIntTriangle; + nIntegration = M * nIntTriangle; rIntegration.resize(nIntegration); sIntegration.resize(nIntegration); tIntegration.resize(nIntegration); wIntegration.resize(nIntegration); unsigned int ii = 0; - for(unsigned short k=0; k GLPoints(M), GLWeights(M); GaussLegendrePoints1D(GLPoints, GLWeights); /*--- Allocate the memory for the integration points and weights of the hexahedron and determine them. ---*/ - nIntegration = M*M*M; + nIntegration = M * M * M; rIntegration.resize(nIntegration); sIntegration.resize(nIntegration); tIntegration.resize(nIntegration); wIntegration.resize(nIntegration); unsigned int ii = 0; - for(unsigned short k=0; k GLPoints(M), GLWeights(M); GaussLegendrePoints1D(GLPoints, GLWeights); @@ -3305,23 +10279,23 @@ void CFEMStandardElementBase::IntegrationPointsPyramid(void) { /*--- Allocate the memory for the integration points and weights of the pyramid and determine them. ---*/ - nIntegration = M*M*M; + nIntegration = M * M * M; rIntegration.resize(nIntegration); sIntegration.resize(nIntegration); tIntegration.resize(nIntegration); wIntegration.resize(nIntegration); unsigned int ii = 0; - for(unsigned short k=0; k &A) { - - /*--- Check the dimensions of A. ---*/ - unsigned long nEntities = n*n; - if(A.size() != nEntities) - SU2_MPI::Error("Wrong size of the A matrix in InverseMatrix", CURRENT_FUNCTION); +void CFEMStandardElementBase::InverseMatrix(unsigned short n, vector& A) { + /*--- Check the dimensions of A. ---*/ + unsigned long nEntities = n * n; + if (A.size() != nEntities) SU2_MPI::Error("Wrong size of the A matrix in InverseMatrix", CURRENT_FUNCTION); /*--- Create a local matrix to carry out the actual inversion. ---*/ - vector > augmentedmatrix(n, vector(2*n)); + vector > augmentedmatrix(n, vector(2 * n)); /*--- Copy the data from A into the first part of augmentedmatrix. Note that A is stored in column major order, such that also Lapack routines can be used to invert the matrix. ---*/ unsigned int ii = 0; - for(unsigned short j=0; j valMax){ + if (val > valMax) { jj = i; valMax = val; } } /* Swap the rows j and jj, if needed. */ - if(jj > j) { - for(unsigned short k=j; k<2*n; ++k) { - su2double valTmp = augmentedmatrix[j][k]; - augmentedmatrix[j][k] = augmentedmatrix[jj][k]; + if (jj > j) { + for (unsigned short k = j; k < 2 * n; ++k) { + su2double valTmp = augmentedmatrix[j][k]; + augmentedmatrix[j][k] = augmentedmatrix[jj][k]; augmentedmatrix[jj][k] = valTmp; } } /*--- Performing row operations to form required identity matrix out of the input matrix. ---*/ - for(unsigned short i=0; i &r, - vector &V) { - +void CFEMStandardElementBase::Vandermonde1D(unsigned short nDOFs, const vector& r, vector& V) { /*--- Determine the number or rows of the Vandermonde matrix and check if the dimension of V is correct. ---*/ unsigned short nRows = r.size(); - unsigned long nEntities = nRows*nDOFs; - if(V.size() != nEntities) - SU2_MPI::Error("Wrong size of the V matrix", CURRENT_FUNCTION); + unsigned long nEntities = nRows * nDOFs; + if (V.size() != nEntities) SU2_MPI::Error("Wrong size of the V matrix", CURRENT_FUNCTION); /*--- Compute the Vandermonde matrix. ---*/ unsigned int ii = 0; - for(unsigned short i=0; i &r, - vector &VDr) { - +void CFEMStandardElementBase::GradVandermonde1D(unsigned short nDOFs, const vector& r, + vector& VDr) { /*--- Determine the number or rows of the gradient of the Vandermonde matrix and check if the dimension of VDr is correct. ---*/ unsigned short nRows = r.size(); - unsigned long nEntities = nRows*nDOFs; - if(VDr.size() != nEntities) - SU2_MPI::Error("Wrong size of the VDr matrix", CURRENT_FUNCTION); + unsigned long nEntities = nRows * nDOFs; + if (VDr.size() != nEntities) SU2_MPI::Error("Wrong size of the VDr matrix", CURRENT_FUNCTION); /*--- Compute the gradient of the Vandermonde matrix. ---*/ unsigned int ii = 0; - for(unsigned short i=0; i 0) { + if (val_orderExact > 0) { orderExact = val_orderExact; - } - else { - if( constJacobian ) - orderExact = (unsigned short) ceil(val_nPoly*config->GetQuadrature_Factor_Straight()); + } else { + if (constJacobian) + orderExact = (unsigned short)ceil(val_nPoly * config->GetQuadrature_Factor_Straight()); else - orderExact = (unsigned short) ceil(val_nPoly*config->GetQuadrature_Factor_Curved()); + orderExact = (unsigned short)ceil(val_nPoly * config->GetQuadrature_Factor_Curved()); } /*--- Determine the integration points. This depends on the element type. ---*/ - switch( VTK_Type ) { - case LINE: IntegrationPointsLine(); break; - case TRIANGLE: IntegrationPointsTriangle(); break; - case QUADRILATERAL: IntegrationPointsQuadrilateral(); break; - case TETRAHEDRON: IntegrationPointsTetrahedron(); break; - case PYRAMID: IntegrationPointsPyramid(); break; - case PRISM: IntegrationPointsPrism(); break; - case HEXAHEDRON: IntegrationPointsHexahedron(); break; + switch (VTK_Type) { + case LINE: + IntegrationPointsLine(); + break; + case TRIANGLE: + IntegrationPointsTriangle(); + break; + case QUADRILATERAL: + IntegrationPointsQuadrilateral(); + break; + case TETRAHEDRON: + IntegrationPointsTetrahedron(); + break; + case PYRAMID: + IntegrationPointsPyramid(); + break; + case PRISM: + IntegrationPointsPrism(); + break; + case HEXAHEDRON: + IntegrationPointsHexahedron(); + break; } } -void CFEMStandardElementBase::CheckSumDerivativesLagrangianBasisFunctions( - const unsigned short nPoints, - const unsigned short nDOFs, - const vector &dLagBasisPoints) { - +void CFEMStandardElementBase::CheckSumDerivativesLagrangianBasisFunctions(const unsigned short nPoints, + const unsigned short nDOFs, + const vector& dLagBasisPoints) { /*--- Check for a zero sum of the derivatives in the given points. ---*/ - for(unsigned short j=0; j 1.e-6) - SU2_MPI::Error("Difference is too large to be caused by roundoff", CURRENT_FUNCTION); + if (fabs(val) > 1.e-6) SU2_MPI::Error("Difference is too large to be caused by roundoff", CURRENT_FUNCTION); } } -void CFEMStandardElementBase::CheckSumLagrangianBasisFunctions( - const unsigned short nPoints, - const unsigned short nDOFs, - vector &lagBasisPoints) { - +void CFEMStandardElementBase::CheckSumLagrangianBasisFunctions(const unsigned short nPoints, const unsigned short nDOFs, + vector& lagBasisPoints) { /*--- To reduce the error due to round off in the Lagrangian basis functions, make sure that the row sum is 1. Also check if the difference is not too large to be solely caused by roundoff. ---*/ - for(unsigned short j=0; j 1.e-6) - SU2_MPI::Error("Difference is too large to be caused by roundoff", CURRENT_FUNCTION); + if (fabs(val - 1.0) > 1.e-6) SU2_MPI::Error("Difference is too large to be caused by roundoff", CURRENT_FUNCTION); - val = 1.0/val; - for(unsigned short i=0; i &drLagBasisIntegration, - vector &dsLagBasisIntegration, - vector &dtLagBasisIntegration) { - + unsigned short VTK_TypeElem, unsigned short nPolyElem, const bool swapFaceInElement, unsigned short& nDOFsElem, + vector& drLagBasisIntegration, vector& dsLagBasisIntegration, + vector& dtLagBasisIntegration) { /*--- Define a number of dummy variables, such that the general functions to compute the gradients of the basis functions can be used. ---*/ vector rDOFsDummy, sDOFsDummy, tDOFsDummy, matVandermondeInvDummy, lagBasisPointsDummy; /*--- Determine the type of the face. ---*/ - switch( VTK_Type ) { - + switch (VTK_Type) { case LINE: { - /*--- The face element is a line. The adjacent element can be either a triangle or a quadrilateral. In order to use the member functions LagrangianBasisFunctionAndDerivativesTriangle and @@ -308,25 +279,17 @@ void CFEMStandardElementBase::DerivativesBasisFunctionsAdjacentElement( face is face 0 of standard element, which corresponds to s = -1. ---*/ vector sInt(nIntegration, -1.0); - switch( VTK_TypeElem ) { + switch (VTK_TypeElem) { case TRIANGLE: - LagrangianBasisFunctionAndDerivativesTriangle(nPolyElem, rIntegration, - sInt, nDOFsElem, - rDOFsDummy, sDOFsDummy, - matVandermondeInvDummy, - lagBasisPointsDummy, - drLagBasisIntegration, - dsLagBasisIntegration); + LagrangianBasisFunctionAndDerivativesTriangle(nPolyElem, rIntegration, sInt, nDOFsElem, rDOFsDummy, + sDOFsDummy, matVandermondeInvDummy, lagBasisPointsDummy, + drLagBasisIntegration, dsLagBasisIntegration); break; case QUADRILATERAL: - LagrangianBasisFunctionAndDerivativesQuadrilateral(nPolyElem, rIntegration, - sInt, nDOFsElem, - rDOFsDummy, sDOFsDummy, - matVandermondeInvDummy, - lagBasisPointsDummy, - drLagBasisIntegration, - dsLagBasisIntegration); + LagrangianBasisFunctionAndDerivativesQuadrilateral(nPolyElem, rIntegration, sInt, nDOFsElem, rDOFsDummy, + sDOFsDummy, matVandermondeInvDummy, lagBasisPointsDummy, + drLagBasisIntegration, dsLagBasisIntegration); break; } @@ -334,7 +297,6 @@ void CFEMStandardElementBase::DerivativesBasisFunctionsAdjacentElement( } case TRIANGLE: { - /*---- The face element is a triangle. The adjacent element can be a tetrahedron, a pyramid or a prism. For the tetrahedron and the prism the convention is that the face is face 0 of these elements, which corresponds to a @@ -345,64 +307,46 @@ void CFEMStandardElementBase::DerivativesBasisFunctionsAdjacentElement( case, also the parametric coordinates of the integration points must be swapped in order to get the correct behavior. ---*/ - switch( VTK_TypeElem ) { - + switch (VTK_TypeElem) { case TETRAHEDRON: { vector tInt(nIntegration, -1.0); - LagrangianBasisFunctionAndDerivativesTetrahedron(nPolyElem, rIntegration, - sIntegration, tInt, - nDOFsElem, rDOFsDummy, - sDOFsDummy, tDOFsDummy, - matVandermondeInvDummy, - lagBasisPointsDummy, - drLagBasisIntegration, - dsLagBasisIntegration, - dtLagBasisIntegration); + LagrangianBasisFunctionAndDerivativesTetrahedron(nPolyElem, rIntegration, sIntegration, tInt, nDOFsElem, + rDOFsDummy, sDOFsDummy, tDOFsDummy, matVandermondeInvDummy, + lagBasisPointsDummy, drLagBasisIntegration, + dsLagBasisIntegration, dtLagBasisIntegration); break; } case PRISM: { vector tInt(nIntegration, -1.0); - LagrangianBasisFunctionAndDerivativesPrism(nPolyElem, rIntegration, - sIntegration, tInt, - nDOFsElem, rDOFsDummy, - sDOFsDummy, tDOFsDummy, - matVandermondeInvDummy, - lagBasisPointsDummy, - drLagBasisIntegration, - dsLagBasisIntegration, + LagrangianBasisFunctionAndDerivativesPrism(nPolyElem, rIntegration, sIntegration, tInt, nDOFsElem, rDOFsDummy, + sDOFsDummy, tDOFsDummy, matVandermondeInvDummy, + lagBasisPointsDummy, drLagBasisIntegration, dsLagBasisIntegration, dtLagBasisIntegration); break; } case PYRAMID: { vector rInt(nIntegration), sInt(nIntegration), tInt(nIntegration); - if( swapFaceInElement ) { - for(unsigned short i=0; i tInt(nIntegration, -1.0); - LagrangianBasisFunctionAndDerivativesHexahedron(nPolyElem, rIntegration, - sIntegration, tInt, - nDOFsElem, rDOFsDummy, - sDOFsDummy, tDOFsDummy, - matVandermondeInvDummy, - lagBasisPointsDummy, - drLagBasisIntegration, - dsLagBasisIntegration, - dtLagBasisIntegration); + LagrangianBasisFunctionAndDerivativesHexahedron(nPolyElem, rIntegration, sIntegration, tInt, nDOFsElem, + rDOFsDummy, sDOFsDummy, tDOFsDummy, matVandermondeInvDummy, + lagBasisPointsDummy, drLagBasisIntegration, + dsLagBasisIntegration, dtLagBasisIntegration); break; } case PRISM: { vector sInt(nIntegration, -1.0), rInt, tInt; - if( swapFaceInElement ) {rInt = sIntegration; tInt = rIntegration;} - else {rInt = rIntegration; tInt = sIntegration;} - - LagrangianBasisFunctionAndDerivativesPrism(nPolyElem, rInt, - sInt, tInt, - nDOFsElem, rDOFsDummy, - sDOFsDummy, tDOFsDummy, - matVandermondeInvDummy, - lagBasisPointsDummy, - drLagBasisIntegration, - dsLagBasisIntegration, - dtLagBasisIntegration); + if (swapFaceInElement) { + rInt = sIntegration; + tInt = rIntegration; + } else { + rInt = rIntegration; + tInt = sIntegration; + } + + LagrangianBasisFunctionAndDerivativesPrism( + nPolyElem, rInt, sInt, tInt, nDOFsElem, rDOFsDummy, sDOFsDummy, tDOFsDummy, matVandermondeInvDummy, + lagBasisPointsDummy, drLagBasisIntegration, dsLagBasisIntegration, dtLagBasisIntegration); break; } case PYRAMID: { vector tInt(nIntegration, -1.0); - LagrangianBasisFunctionAndDerivativesPyramid(nPolyElem, rIntegration, - sIntegration, tInt, - nDOFsElem, rDOFsDummy, - sDOFsDummy, tDOFsDummy, - matVandermondeInvDummy, - lagBasisPointsDummy, - drLagBasisIntegration, - dsLagBasisIntegration, - dtLagBasisIntegration); + LagrangianBasisFunctionAndDerivativesPyramid(nPolyElem, rIntegration, sIntegration, tInt, nDOFsElem, + rDOFsDummy, sDOFsDummy, tDOFsDummy, matVandermondeInvDummy, + lagBasisPointsDummy, drLagBasisIntegration, + dsLagBasisIntegration, dtLagBasisIntegration); break; } } @@ -479,14 +410,8 @@ void CFEMStandardElementBase::DerivativesBasisFunctionsAdjacentElement( } void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesLine( - const unsigned short nPoly, - const vector &rPoints, - unsigned short &nDOFs, - vector &rDOFs, - vector &matVandermondeInv, - vector &lagBasisPoints, - vector &drLagBasisPoints) { - + const unsigned short nPoly, const vector& rPoints, unsigned short& nDOFs, vector& rDOFs, + vector& matVandermondeInv, vector& lagBasisPoints, vector& drLagBasisPoints) { /*--- Determine the number of points in which the functions must be determined. ---*/ const unsigned short nPoints = rPoints.size(); @@ -495,14 +420,13 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesLine( nDOFs = nPoly + 1; rDOFs.resize(nDOFs); - su2double dh = 2.0/nPoly; - for(unsigned i=0; i V(nDOFs*nPoints); - matVandermondeInv.resize(nDOFs*nDOFs); + vector V(nDOFs * nPoints); + matVandermondeInv.resize(nDOFs * nDOFs); Vandermonde1D(nDOFs, rDOFs, matVandermondeInv); InverseMatrix(nDOFs, matVandermondeInv); @@ -515,7 +439,7 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesLine( obtained from the matrix product V*Vinv. Note that the result is stored in row major order, because in this way the interpolation data for a point is contiguous in memory. ---*/ - lagBasisPoints.resize(nDOFs*nPoints); + lagBasisPoints.resize(nDOFs * nPoints); MatMulRowMajor(nDOFs, nPoints, V, matVandermondeInv, lagBasisPoints); /*--- Compute the gradients of the 1D Vandermonde matrix in the @@ -528,48 +452,40 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesLine( obtained from the matrix product V*Vinv. Note that the result is stored in row major order, because in this way the gradient data for a point is contiguous in memory. ---*/ - drLagBasisPoints.resize(nDOFs*nPoints); + drLagBasisPoints.resize(nDOFs * nPoints); MatMulRowMajor(nDOFs, nPoints, V, matVandermondeInv, drLagBasisPoints); } void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesTriangle( - const unsigned short nPoly, - const vector &rPoints, - const vector &sPoints, - unsigned short &nDOFs, - vector &rDOFs, - vector &sDOFs, - vector &matVandermondeInv, - vector &lagBasisPoints, - vector &drLagBasisPoints, - vector &dsLagBasisPoints) { - + const unsigned short nPoly, const vector& rPoints, const vector& sPoints, + unsigned short& nDOFs, vector& rDOFs, vector& sDOFs, vector& matVandermondeInv, + vector& lagBasisPoints, vector& drLagBasisPoints, vector& dsLagBasisPoints) { /*--- Determine the number of points in which the functions must be determined. ---*/ const unsigned short nPoints = rPoints.size(); /*--- Determine the location of the DOFs of the standard triangle. ---*/ - nDOFs = (nPoly+1)*(nPoly+2)/2; + nDOFs = (nPoly + 1) * (nPoly + 2) / 2; rDOFs.resize(nDOFs); sDOFs.resize(nDOFs); - su2double dh = 2.0/nPoly; + su2double dh = 2.0 / nPoly; unsigned int ii = 0; - for(unsigned short j=0; j<=nPoly; ++j) { - su2double s = -1.0 + j*dh; + for (unsigned short j = 0; j <= nPoly; ++j) { + su2double s = -1.0 + j * dh; unsigned short uppBoundI = nPoly - j; - for(unsigned short i=0; i<=uppBoundI; ++i, ++ii) { - su2double r = -1.0 + i*dh; - rDOFs[ii] = r; - sDOFs[ii] = s; + for (unsigned short i = 0; i <= uppBoundI; ++i, ++ii) { + su2double r = -1.0 + i * dh; + rDOFs[ii] = r; + sDOFs[ii] = s; } } /*--- Compute the inverse of the Vandermonde matrix in the DOFs and compute the Vandermonde matrix in the points. ---*/ - vector V(nDOFs*nPoints); - matVandermondeInv.resize(nDOFs*nDOFs); + vector V(nDOFs * nPoints); + matVandermondeInv.resize(nDOFs * nDOFs); Vandermonde2D_Triangle(nPoly, nDOFs, rDOFs, sDOFs, matVandermondeInv); InverseMatrix(nDOFs, matVandermondeInv); @@ -581,11 +497,11 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesTriangle( coefficients from the DOFs to the points and are obtained from the matrix product V*Vinv. Note that the result is stored in row major order, because in this way the interpolation data for a point is contiguous in memory. ---*/ - lagBasisPoints.resize(nDOFs*nPoints); + lagBasisPoints.resize(nDOFs * nPoints); MatMulRowMajor(nDOFs, nPoints, V, matVandermondeInv, lagBasisPoints); /*--- Compute the gradients of the 2D Vandermonde matrix in the points. ---*/ - vector VDr(nDOFs*nPoints), VDs(nDOFs*nPoints); + vector VDr(nDOFs * nPoints), VDs(nDOFs * nPoints); GradVandermonde2D_Triangle(nPoly, nDOFs, rPoints, sPoints, VDr, VDs); /*--- Allocate the memory to store the derivatives in r- and s-direction of the @@ -594,52 +510,42 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesTriangle( product VDr*Vinv and VDs*Vinv. Note that the result is stored in row major order, because in this way the gradient data for a point is contiguous in memory. ---*/ - drLagBasisPoints.resize(nDOFs*nPoints); - dsLagBasisPoints.resize(nDOFs*nPoints); + drLagBasisPoints.resize(nDOFs * nPoints); + dsLagBasisPoints.resize(nDOFs * nPoints); MatMulRowMajor(nDOFs, nPoints, VDr, matVandermondeInv, drLagBasisPoints); MatMulRowMajor(nDOFs, nPoints, VDs, matVandermondeInv, dsLagBasisPoints); } void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesQuadrilateral( - const unsigned short nPoly, - const vector &rPoints, - const vector &sPoints, - unsigned short &nDOFs, - vector &rDOFs, - vector &sDOFs, - vector &matVandermondeInv, - vector &lagBasisPoints, - vector &drLagBasisPoints, - vector &dsLagBasisPoints) { - + const unsigned short nPoly, const vector& rPoints, const vector& sPoints, + unsigned short& nDOFs, vector& rDOFs, vector& sDOFs, vector& matVandermondeInv, + vector& lagBasisPoints, vector& drLagBasisPoints, vector& dsLagBasisPoints) { /*--- Determine the number of points in which the functions must be determined. ---*/ const unsigned short nPoints = rPoints.size(); /*--- Determine the location of the DOFs of the standard quadrilateral. ---*/ - nDOFs = (nPoly+1)*(nPoly+1); + nDOFs = (nPoly + 1) * (nPoly + 1); rDOFs.resize(nDOFs); sDOFs.resize(nDOFs); - su2double dh = 2.0/nPoly; + su2double dh = 2.0 / nPoly; unsigned int ii = 0; - for(unsigned short j=0; j<=nPoly; ++j) - { - su2double s = -1.0 + j*dh; - for(unsigned short i=0; i<=nPoly; ++i, ++ii) - { - su2double r = -1.0 + i*dh; - rDOFs[ii] = r; - sDOFs[ii] = s; + for (unsigned short j = 0; j <= nPoly; ++j) { + su2double s = -1.0 + j * dh; + for (unsigned short i = 0; i <= nPoly; ++i, ++ii) { + su2double r = -1.0 + i * dh; + rDOFs[ii] = r; + sDOFs[ii] = s; } } /*--- Compute the inverse of the Vandermonde matrix in the DOFs and compute the Vandermonde matrix in the points. ---*/ - vector V(nDOFs*nPoints); - matVandermondeInv.resize(nDOFs*nDOFs); + vector V(nDOFs * nPoints); + matVandermondeInv.resize(nDOFs * nDOFs); Vandermonde2D_Quadrilateral(nPoly, nDOFs, rDOFs, sDOFs, matVandermondeInv); InverseMatrix(nDOFs, matVandermondeInv); @@ -651,11 +557,11 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesQuadrilateral coefficients from the DOFs to the points and are obtained from the matrix product V*Vinv. Note that the result is stored in row major order, because in this way the interpolation data for a point is contiguous in memory. ---*/ - lagBasisPoints.resize(nDOFs*nPoints); + lagBasisPoints.resize(nDOFs * nPoints); MatMulRowMajor(nDOFs, nPoints, V, matVandermondeInv, lagBasisPoints); /*--- Compute the gradients of the 2D Vandermonde matrix in the points. ---*/ - vector VDr(nDOFs*nPoints), VDs(nDOFs*nPoints); + vector VDr(nDOFs * nPoints), VDs(nDOFs * nPoints); GradVandermonde2D_Quadrilateral(nPoly, nDOFs, rPoints, sPoints, VDr, VDs); /*--- Allocate the memory to store the derivatives in r- and s-direction of the @@ -664,49 +570,39 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesQuadrilateral product VDr*Vinv and VDr*Vinv. Note that the result is stored in row major order, because in this way the gradient data for a point is contiguous in memory. ---*/ - drLagBasisPoints.resize(nDOFs*nPoints); - dsLagBasisPoints.resize(nDOFs*nPoints); + drLagBasisPoints.resize(nDOFs * nPoints); + dsLagBasisPoints.resize(nDOFs * nPoints); MatMulRowMajor(nDOFs, nPoints, VDr, matVandermondeInv, drLagBasisPoints); MatMulRowMajor(nDOFs, nPoints, VDs, matVandermondeInv, dsLagBasisPoints); } void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesTetrahedron( - const unsigned short nPoly, - const vector &rPoints, - const vector &sPoints, - const vector &tPoints, - unsigned short &nDOFs, - vector &rDOFs, - vector &sDOFs, - vector &tDOFs, - vector &matVandermondeInv, - vector &lagBasisPoints, - vector &drLagBasisPoints, - vector &dsLagBasisPoints, - vector &dtLagBasisPoints) -{ + const unsigned short nPoly, const vector& rPoints, const vector& sPoints, + const vector& tPoints, unsigned short& nDOFs, vector& rDOFs, vector& sDOFs, + vector& tDOFs, vector& matVandermondeInv, vector& lagBasisPoints, + vector& drLagBasisPoints, vector& dsLagBasisPoints, vector& dtLagBasisPoints) { /*--- Determine the number of points in which the functions must be determined. ---*/ const unsigned short nPoints = rPoints.size(); /*--- Determine the location of the DOFs of the standard tetrahedron. ---*/ - nDOFs = (nPoly+1)*(nPoly+2)*(nPoly+3)/6; + nDOFs = (nPoly + 1) * (nPoly + 2) * (nPoly + 3) / 6; rDOFs.resize(nDOFs); sDOFs.resize(nDOFs); tDOFs.resize(nDOFs); - su2double dh = 2.0/nPoly; + su2double dh = 2.0 / nPoly; unsigned int ii = 0; - for(unsigned short k=0; k<=nPoly; ++k) { - su2double t = -1.0 + k*dh; + for (unsigned short k = 0; k <= nPoly; ++k) { + su2double t = -1.0 + k * dh; unsigned short uppBoundJ = nPoly - k; - for(unsigned short j=0; j<=uppBoundJ; ++j) { - su2double s = -1.0 + j*dh; + for (unsigned short j = 0; j <= uppBoundJ; ++j) { + su2double s = -1.0 + j * dh; unsigned short uppBoundI = nPoly - k - j; - for(unsigned short i=0; i<=uppBoundI; ++i, ++ii) { - su2double r = -1.0 + i*dh; + for (unsigned short i = 0; i <= uppBoundI; ++i, ++ii) { + su2double r = -1.0 + i * dh; rDOFs[ii] = r; sDOFs[ii] = s; tDOFs[ii] = t; @@ -716,10 +612,10 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesTetrahedron( /*--- Compute the inverse of the Vandermonde matrix in the DOFs and compute the Vandermonde matrix in the points. ---*/ - vector V(nDOFs*nPoints); - matVandermondeInv.resize(nDOFs*nDOFs); + vector V(nDOFs * nPoints); + matVandermondeInv.resize(nDOFs * nDOFs); - Vandermonde3D_Tetrahedron(nPoly, nDOFs, rDOFs, sDOFs, tDOFs, matVandermondeInv ); + Vandermonde3D_Tetrahedron(nPoly, nDOFs, rDOFs, sDOFs, tDOFs, matVandermondeInv); InverseMatrix(nDOFs, matVandermondeInv); Vandermonde3D_Tetrahedron(nPoly, nDOFs, rPoints, sPoints, tPoints, V); @@ -729,13 +625,12 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesTetrahedron( coefficients from the DOFs to the points and are obtained from the matrix product V*Vinv. Note that the result is stored in row major order, because in this way the interpolation data for a point is contiguous in memory. ---*/ - lagBasisPoints.resize(nDOFs*nPoints); + lagBasisPoints.resize(nDOFs * nPoints); MatMulRowMajor(nDOFs, nPoints, V, matVandermondeInv, lagBasisPoints); /*--- Compute the gradients of the 3D Vandermonde matrix in the points. ---*/ - vector VDr(nDOFs*nPoints), VDs(nDOFs*nPoints), VDt(nDOFs*nPoints); - GradVandermonde3D_Tetrahedron(nPoly, nDOFs, rPoints, sPoints, - tPoints, VDr, VDs, VDt); + vector VDr(nDOFs * nPoints), VDs(nDOFs * nPoints), VDt(nDOFs * nPoints); + GradVandermonde3D_Tetrahedron(nPoly, nDOFs, rPoints, sPoints, tPoints, VDr, VDs, VDt); /*--- Allocate the memory to store the derivatives in r-, s- and t-direction of the Lagrange basis functions in the points and determine them. The @@ -743,9 +638,9 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesTetrahedron( from the matrix product VDr*Vinv, VDr*Vinv and VDt*Vinv. Note that the result is stored in row major order, because in this way the gradient data for a point is contiguous in memory. ---*/ - drLagBasisPoints.resize(nDOFs*nPoints); - dsLagBasisPoints.resize(nDOFs*nPoints); - dtLagBasisPoints.resize(nDOFs*nPoints); + drLagBasisPoints.resize(nDOFs * nPoints); + dsLagBasisPoints.resize(nDOFs * nPoints); + dtLagBasisPoints.resize(nDOFs * nPoints); MatMulRowMajor(nDOFs, nPoints, VDr, matVandermondeInv, drLagBasisPoints); MatMulRowMajor(nDOFs, nPoints, VDs, matVandermondeInv, dsLagBasisPoints); @@ -753,54 +648,43 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesTetrahedron( } void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesPyramid( - const unsigned short nPoly, - const vector &rPoints, - const vector &sPoints, - const vector &tPoints, - unsigned short &nDOFs, - vector &rDOFs, - vector &sDOFs, - vector &tDOFs, - vector &matVandermondeInv, - vector &lagBasisPoints, - vector &drLagBasisPoints, - vector &dsLagBasisPoints, - vector &dtLagBasisPoints) -{ + const unsigned short nPoly, const vector& rPoints, const vector& sPoints, + const vector& tPoints, unsigned short& nDOFs, vector& rDOFs, vector& sDOFs, + vector& tDOFs, vector& matVandermondeInv, vector& lagBasisPoints, + vector& drLagBasisPoints, vector& dsLagBasisPoints, vector& dtLagBasisPoints) { /*--- Determine the number of points in which the functions must be determined. ---*/ const unsigned short nPoints = rPoints.size(); /*--- Allocate the memory for the DOFs of the standard pyramid. ---*/ - unsigned short nDOFsEdge = nPoly+1; - nDOFs = nDOFsEdge*(nDOFsEdge+1)*(2*nDOFsEdge+1)/6; + unsigned short nDOFsEdge = nPoly + 1; + nDOFs = nDOFsEdge * (nDOFsEdge + 1) * (2 * nDOFsEdge + 1) / 6; rDOFs.resize(nDOFs); sDOFs.resize(nDOFs); tDOFs.resize(nDOFs); /*--- Determine the location of the DOFs of the standard pyramid. The outer loop is in the k-direction, which is from base to top. ---*/ - su2double dt = 2.0/nPoly; + su2double dt = 2.0 / nPoly; unsigned short mPoly = nPoly; - unsigned int ii = 0; - - for(unsigned short k=0; k<=nPoly; ++k, --mPoly) { + unsigned int ii = 0; + for (unsigned short k = 0; k <= nPoly; ++k, --mPoly) { /*--- Determine the minimum and maximum value for r and s for this t-value. ---*/ - su2double t = -1.0 + k*dt; - su2double rsMin = 0.5*(t-1.0); + su2double t = -1.0 + k * dt; + su2double rsMin = 0.5 * (t - 1.0); su2double rsMax = -rsMin; /*--- Determine the step size along the edges of the current quad. Take the exceptional situation mPoly == 0 into account to avoid a division by zero. ---*/ - su2double dh = mPoly ? (rsMax-rsMin)/mPoly : su2double(0.0); + su2double dh = mPoly ? (rsMax - rsMin) / mPoly : su2double(0.0); /*--- Loop over the vertices of the current quadrilateral. ---*/ - for(unsigned short j=0; j<=mPoly; ++j) { - su2double s = rsMin + j*dh; - for(unsigned short i=0; i<=mPoly; ++i, ++ii) { - su2double r = rsMin + i*dh; + for (unsigned short j = 0; j <= mPoly; ++j) { + su2double s = rsMin + j * dh; + for (unsigned short i = 0; i <= mPoly; ++i, ++ii) { + su2double r = rsMin + i * dh; rDOFs[ii] = r; sDOFs[ii] = s; tDOFs[ii] = t; @@ -810,8 +694,8 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesPyramid( /*--- Compute the inverse of the Vandermonde matrix in the DOFs and compute the Vandermonde matrix in the points. ---*/ - vector V(nDOFs*nPoints); - matVandermondeInv.resize(nDOFs*nDOFs); + vector V(nDOFs * nPoints); + matVandermondeInv.resize(nDOFs * nDOFs); Vandermonde3D_Pyramid(nPoly, nDOFs, rDOFs, sDOFs, tDOFs, matVandermondeInv); InverseMatrix(nDOFs, matVandermondeInv); @@ -823,11 +707,11 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesPyramid( coefficients from the DOFs to the points and are obtained from the matrix product V*Vinv. Note that the result is stored in row major order, because in this way the interpolation data for a point is contiguous in memory. ---*/ - lagBasisPoints.resize(nDOFs*nPoints); + lagBasisPoints.resize(nDOFs * nPoints); MatMulRowMajor(nDOFs, nPoints, V, matVandermondeInv, lagBasisPoints); /*--- Compute the gradients of the 3D Vandermonde matrix in the points. ---*/ - vector VDr(nDOFs*nPoints), VDs(nDOFs*nPoints), VDt(nDOFs*nPoints); + vector VDr(nDOFs * nPoints), VDs(nDOFs * nPoints), VDt(nDOFs * nPoints); GradVandermonde3D_Pyramid(nPoly, nDOFs, rPoints, sPoints, tPoints, VDr, VDs, VDt); /*--- Allocate the memory to store the derivatives in r-, s- and t-direction @@ -836,9 +720,9 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesPyramid( from the matrix product VDr*Vinv, VDr*Vinv and VDt*Vinv. Note that the result is stored in row major order, because in this way the gradient data for a point is contiguous in memory. ---*/ - drLagBasisPoints.resize(nDOFs*nPoints); - dsLagBasisPoints.resize(nDOFs*nPoints); - dtLagBasisPoints.resize(nDOFs*nPoints); + drLagBasisPoints.resize(nDOFs * nPoints); + dsLagBasisPoints.resize(nDOFs * nPoints); + dtLagBasisPoints.resize(nDOFs * nPoints); MatMulRowMajor(nDOFs, nPoints, VDr, matVandermondeInv, drLagBasisPoints); MatMulRowMajor(nDOFs, nPoints, VDs, matVandermondeInv, dsLagBasisPoints); @@ -846,43 +730,33 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesPyramid( } void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesPrism( - const unsigned short nPoly, - const vector &rPoints, - const vector &sPoints, - const vector &tPoints, - unsigned short &nDOFs, - vector &rDOFs, - vector &sDOFs, - vector &tDOFs, - vector &matVandermondeInv, - vector &lagBasisPoints, - vector &drLagBasisPoints, - vector &dsLagBasisPoints, - vector &dtLagBasisPoints) -{ + const unsigned short nPoly, const vector& rPoints, const vector& sPoints, + const vector& tPoints, unsigned short& nDOFs, vector& rDOFs, vector& sDOFs, + vector& tDOFs, vector& matVandermondeInv, vector& lagBasisPoints, + vector& drLagBasisPoints, vector& dsLagBasisPoints, vector& dtLagBasisPoints) { /*--- Determine the number of points in which the functions must be determined. ---*/ const unsigned short nPoints = rPoints.size(); /*--- Allocate the memory for the DOFs of the standard prism and determine its locations. ---*/ - unsigned short nDOFsEdge = nPoly+1; - nDOFs = nDOFsEdge*nDOFsEdge*(nDOFsEdge+1)/2; + unsigned short nDOFsEdge = nPoly + 1; + nDOFs = nDOFsEdge * nDOFsEdge * (nDOFsEdge + 1) / 2; rDOFs.resize(nDOFs); sDOFs.resize(nDOFs); tDOFs.resize(nDOFs); - su2double dh = 2.0/nPoly; + su2double dh = 2.0 / nPoly; unsigned short ii = 0; - for(unsigned short k=0; k<=nPoly; ++k) { - const su2double t = -1.0 + k*dh; + for (unsigned short k = 0; k <= nPoly; ++k) { + const su2double t = -1.0 + k * dh; - for(unsigned short j=0; j<=nPoly; ++j) { - su2double s = -1.0 + j*dh; + for (unsigned short j = 0; j <= nPoly; ++j) { + su2double s = -1.0 + j * dh; unsigned short uppBoundI = nPoly - j; - for(unsigned short i=0; i<=uppBoundI; ++i, ++ii) { - su2double r = -1.0 + i*dh; + for (unsigned short i = 0; i <= uppBoundI; ++i, ++ii) { + su2double r = -1.0 + i * dh; rDOFs[ii] = r; sDOFs[ii] = s; tDOFs[ii] = t; @@ -892,8 +766,8 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesPrism( /*--- Compute the inverse of the Vandermonde matrix in the DOFs and compute the Vandermonde matrix in the points. ---*/ - vector V(nDOFs*nPoints); - matVandermondeInv.resize(nDOFs*nDOFs); + vector V(nDOFs * nPoints); + matVandermondeInv.resize(nDOFs * nDOFs); Vandermonde3D_Prism(nPoly, nDOFs, rDOFs, sDOFs, tDOFs, matVandermondeInv); InverseMatrix(nDOFs, matVandermondeInv); @@ -905,12 +779,12 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesPrism( coefficients from the DOFs to the points and are obtained from the matrix product V*Vinv. Note that the result is stored in row major order, because in this way the interpolation data for a point is contiguous in memory. ---*/ - lagBasisPoints.resize(nDOFs*nPoints); + lagBasisPoints.resize(nDOFs * nPoints); MatMulRowMajor(nDOFs, nPoints, V, matVandermondeInv, lagBasisPoints); /*--- Compute the gradients of the 3D Vandermonde matrix in the points. ---*/ - vector VDr(nDOFs*nPoints), VDs(nDOFs*nPoints), VDt(nDOFs*nPoints); - GradVandermonde3D_Prism(nPoly, nDOFs,rPoints, sPoints, tPoints, VDr, VDs, VDt); + vector VDr(nDOFs * nPoints), VDs(nDOFs * nPoints), VDt(nDOFs * nPoints); + GradVandermonde3D_Prism(nPoly, nDOFs, rPoints, sPoints, tPoints, VDr, VDs, VDt); /*--- Allocate the memory to store the derivatives in r-, s- and t-direction of the Lagrange basis functions in the points and determine them. The @@ -918,9 +792,9 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesPrism( from the matrix product VDr*Vinv, VDr*Vinv and VDt*Vinv. Note that the the result is stored in row major order, because in this way the gradient data for a point is contiguous in memory. ---*/ - drLagBasisPoints.resize(nDOFs*nPoints); - dsLagBasisPoints.resize(nDOFs*nPoints); - dtLagBasisPoints.resize(nDOFs*nPoints); + drLagBasisPoints.resize(nDOFs * nPoints); + dsLagBasisPoints.resize(nDOFs * nPoints); + dtLagBasisPoints.resize(nDOFs * nPoints); MatMulRowMajor(nDOFs, nPoints, VDr, matVandermondeInv, drLagBasisPoints); MatMulRowMajor(nDOFs, nPoints, VDs, matVandermondeInv, dsLagBasisPoints); @@ -928,41 +802,31 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesPrism( } void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesHexahedron( - const unsigned short nPoly, - const vector &rPoints, - const vector &sPoints, - const vector &tPoints, - unsigned short &nDOFs, - vector &rDOFs, - vector &sDOFs, - vector &tDOFs, - vector &matVandermondeInv, - vector &lagBasisPoints, - vector &drLagBasisPoints, - vector &dsLagBasisPoints, - vector &dtLagBasisPoints) -{ + const unsigned short nPoly, const vector& rPoints, const vector& sPoints, + const vector& tPoints, unsigned short& nDOFs, vector& rDOFs, vector& sDOFs, + vector& tDOFs, vector& matVandermondeInv, vector& lagBasisPoints, + vector& drLagBasisPoints, vector& dsLagBasisPoints, vector& dtLagBasisPoints) { /*--- Determine the number of points in which the functions must be determined. ---*/ const unsigned short nPoints = rPoints.size(); /*--- Allocate the memory for the DOFs of the standard hexahedron and determine its locations. ---*/ - unsigned short nDOFsEdge = nPoly+1; - nDOFs = nDOFsEdge*nDOFsEdge*nDOFsEdge; + unsigned short nDOFsEdge = nPoly + 1; + nDOFs = nDOFsEdge * nDOFsEdge * nDOFsEdge; rDOFs.resize(nDOFs); sDOFs.resize(nDOFs); tDOFs.resize(nDOFs); - su2double dh = 2.0/nPoly; + su2double dh = 2.0 / nPoly; unsigned short ii = 0; - for(unsigned short k=0; k<=nPoly; ++k) { - su2double t = -1.0 + k*dh; - for(unsigned short j=0; j<=nPoly; ++j) { - su2double s = -1.0 + j*dh; - for(unsigned short i=0; i<=nPoly; ++i, ++ii) { - su2double r = -1.0 + i*dh; + for (unsigned short k = 0; k <= nPoly; ++k) { + su2double t = -1.0 + k * dh; + for (unsigned short j = 0; j <= nPoly; ++j) { + su2double s = -1.0 + j * dh; + for (unsigned short i = 0; i <= nPoly; ++i, ++ii) { + su2double r = -1.0 + i * dh; rDOFs[ii] = r; sDOFs[ii] = s; tDOFs[ii] = t; @@ -972,8 +836,8 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesHexahedron( /*--- Compute the inverse of the Vandermonde matrix in the DOFs and compute the Vandermonde matrix in the points. ---*/ - vector V(nDOFs*nPoints); - matVandermondeInv.resize(nDOFs*nDOFs); + vector V(nDOFs * nPoints); + matVandermondeInv.resize(nDOFs * nDOFs); Vandermonde3D_Hexahedron(nPoly, nDOFs, rDOFs, sDOFs, tDOFs, matVandermondeInv); InverseMatrix(nDOFs, matVandermondeInv); @@ -985,11 +849,11 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesHexahedron( coefficients from the DOFs to the points and are obtained from the matrix product V*Vinv. Note that the result is stored in row major order, because in this way the interpolation data for a point is contiguous in memory. ---*/ - lagBasisPoints.resize(nDOFs*nPoints); + lagBasisPoints.resize(nDOFs * nPoints); MatMulRowMajor(nDOFs, nPoints, V, matVandermondeInv, lagBasisPoints); /*--- Compute the gradients of the 3D Vandermonde matrix in the points. ---*/ - vector VDr(nDOFs*nPoints), VDs(nDOFs*nPoints), VDt(nDOFs*nPoints); + vector VDr(nDOFs * nPoints), VDs(nDOFs * nPoints), VDt(nDOFs * nPoints); GradVandermonde3D_Hexahedron(nPoly, nDOFs, rPoints, sPoints, tPoints, VDr, VDs, VDt); /*--- Allocate the memory to store the derivatives in r-, s- and t-direction @@ -998,97 +862,88 @@ void CFEMStandardElementBase::LagrangianBasisFunctionAndDerivativesHexahedron( from the matrix product VDr*Vinv, VDr*Vinv and VDt*Vinv. Note that the the result is stored in row major order, because in this way the gradient data for a point is contiguous in memory. ---*/ - drLagBasisPoints.resize(nDOFs*nPoints); - dsLagBasisPoints.resize(nDOFs*nPoints); - dtLagBasisPoints.resize(nDOFs*nPoints); + drLagBasisPoints.resize(nDOFs * nPoints); + dsLagBasisPoints.resize(nDOFs * nPoints); + dtLagBasisPoints.resize(nDOFs * nPoints); MatMulRowMajor(nDOFs, nPoints, VDr, matVandermondeInv, drLagBasisPoints); MatMulRowMajor(nDOFs, nPoints, VDs, matVandermondeInv, dsLagBasisPoints); MatMulRowMajor(nDOFs, nPoints, VDt, matVandermondeInv, dtLagBasisPoints); } -void CFEMStandardElementBase::MatMulRowMajor(const unsigned short nDOFs, - const unsigned short nPoints, - const vector &A, - const vector &B, - vector &C) { - +void CFEMStandardElementBase::MatMulRowMajor(const unsigned short nDOFs, const unsigned short nPoints, + const vector& A, const vector& B, + vector& C) { /*--- Check if the dimensions of the matrices correspond to the assumptions made in this function. ---*/ - const unsigned int dimA = nDOFs*nPoints; - const unsigned int dimB = nDOFs*nDOFs; + const unsigned int dimA = nDOFs * nPoints; + const unsigned int dimB = nDOFs * nDOFs; - if(A.size() != dimA || B.size() != dimB || C.size() != dimA) + if (A.size() != dimA || B.size() != dimB || C.size() != dimA) SU2_MPI::Error("Unexpected size of the matrices", CURRENT_FUNCTION); /*--- Carry out the actual matrix matrix multiplication and store the result in row major order (the matrices A and B are in column major order). ---*/ - for(unsigned short j=0; j &subConn) { - +void CFEMStandardElementBase::SubConnForPlottingLine(const unsigned short nPoly, vector& subConn) { /*--- Determine the local subconnectivity of the line element used for plotting purposes. This is rather trivial, because the line element is subdivided into nPoly linear line elements. ---*/ - unsigned short nnPoly = max(nPoly,(unsigned short) 1); - for(unsigned short i=0; i &subConn) { - +void CFEMStandardElementBase::SubConnForPlottingQuadrilateral(const unsigned short nPoly, + vector& subConn) { /*--- Determine the local subconnectivity of the quadrilateral element used for plotting purposes. Note that the connectivity of the linear subelements obey the VTK connectivity rule of a quadrilateral, which is different from the connectivity for the high order quadrilateral. ---*/ - unsigned short nnPoly = max(nPoly,(unsigned short) 1); - for(unsigned short j=0; j &subConn) { - +void CFEMStandardElementBase::SubConnForPlottingTriangle(const unsigned short nPoly, vector& subConn) { /*--- Determine the local subconnectivity of the triangular element used for plotting purposes. ---*/ unsigned short jj = 0; /*--- Loop over subedges of the left boundary of the standard triangle. ---*/ - for(unsigned short j=0; j &r, - const vector &s, - vector &V) { - +void CFEMStandardElementBase::Vandermonde2D_Triangle(unsigned short nPoly, unsigned short nDOFs, + const vector& r, const vector& s, + vector& V) { /*--- Determine the number or rows of the Vandermonde matrix and check if the dimension of V is correct. ---*/ unsigned short nRows = r.size(); - unsigned long nEntities = nRows*nDOFs; - if(V.size() != nEntities) - SU2_MPI::Error("Wrong size of the V matrix", CURRENT_FUNCTION); + unsigned long nEntities = nRows * nDOFs; + if (V.size() != nEntities) SU2_MPI::Error("Wrong size of the V matrix", CURRENT_FUNCTION); /*--- For a triangle the orthogonal basis for the reference element is obtained by a combination of a Jacobi polynomial and a Legendre polynomial. This is the result of the orthonormalization of the monomial basis. ---*/ unsigned int ii = 0; - for(unsigned short i=0; i<=nPoly; ++i) { - for(unsigned short j=0; j<=(nPoly-i); ++j) { - for(unsigned short k=0; k &r, - const vector &s, - vector &VDr, - vector &VDs) { - +void CFEMStandardElementBase::GradVandermonde2D_Triangle(unsigned short nPoly, unsigned short nDOFs, + const vector& r, const vector& s, + vector& VDr, vector& VDs) { /*--- Determine the number or rows of the gradient of the Vandermonde matrix and check if the dimensions of VDr and VDs are correct. ---*/ unsigned short nRows = r.size(); - unsigned long nEntities = nRows*nDOFs; - if(VDr.size() != nEntities || VDs.size() != nEntities) + unsigned long nEntities = nRows * nDOFs; + if (VDr.size() != nEntities || VDs.size() != nEntities) SU2_MPI::Error("Wrong size of the VDr and/or VDs matrices", CURRENT_FUNCTION); /*--- For a triangle the orthogonal basis for the reference element is obtained by a combination of a Jacobi polynomial and a Legendre polynomial. This is the result of the orthonormalization of the monomial basis. ---*/ unsigned int ii = 0; - for(unsigned short i=0; i<=nPoly; ++i) { - for(unsigned short j=0; j<=(nPoly-i); ++j) { - for(unsigned k=0; k 0) - { + if (i > 0) { su2double tmp = 1.0; - if( i-1 ) tmp = pow((1.0-b), (i-1)); + if (i - 1) tmp = pow((1.0 - b), (i - 1)); - VDr[ii] = 2.0*tmp*VDr[ii]; - VDs[ii] = (a+1.0)*tmp*VDs[ii] - i*tmp*sqrt(2.0)*fa*gb; + VDr[ii] = 2.0 * tmp * VDr[ii]; + VDs[ii] = (a + 1.0) * tmp * VDs[ii] - i * tmp * sqrt(2.0) * fa * gb; } su2double tmp = 1.0; - if( i ) tmp = pow((1.0-b), i); - VDs[ii] += sqrt(2.0)*fa*dgb*tmp; + if (i) tmp = pow((1.0 - b), i); + VDs[ii] += sqrt(2.0) * fa * dgb * tmp; } } } } -void CFEMStandardElementBase::Vandermonde2D_Quadrilateral(unsigned short nPoly, - unsigned short nDOFs, - const vector &r, - const vector &s, - vector &V) { - +void CFEMStandardElementBase::Vandermonde2D_Quadrilateral(unsigned short nPoly, unsigned short nDOFs, + const vector& r, const vector& s, + vector& V) { /*--- Determine the number or rows of the Vandermonde matrix and check if the dimension of V is correct. ---*/ unsigned short nRows = r.size(); - unsigned long nEntities = nRows*nDOFs; - if(V.size() != nEntities) - SU2_MPI::Error("Wrong size of the V matrix", CURRENT_FUNCTION); + unsigned long nEntities = nRows * nDOFs; + if (V.size() != nEntities) SU2_MPI::Error("Wrong size of the V matrix", CURRENT_FUNCTION); /*--- For a quadrilateral the basis functions are the product of the 1D basis functions, which are the normalized Legendre polynomials. The Legendre polynomials are implemented via Jacobi polynomials. ---*/ unsigned int ii = 0; - for(unsigned short i=0; i<=nPoly; ++i) { - for(unsigned short j=0; j<=nPoly; ++j) { - for(unsigned short k=0; k &r, - const vector &s, - vector &VDr, - vector &VDs) { - +void CFEMStandardElementBase::GradVandermonde2D_Quadrilateral(unsigned short nPoly, unsigned short nDOFs, + const vector& r, const vector& s, + vector& VDr, vector& VDs) { /*--- Determine the number or rows of the gradient of the Vandermonde matrix and check if the dimensions of VDr and VDs are correct. ---*/ unsigned short nRows = r.size(); - unsigned long nEntities = nRows*nDOFs; - if(VDr.size() != nEntities || VDs.size() != nEntities) + unsigned long nEntities = nRows * nDOFs; + if (VDr.size() != nEntities || VDs.size() != nEntities) SU2_MPI::Error("Wrong size of the VDr and/or VDs matrices", CURRENT_FUNCTION); /*--- For a quadrilateral the basis functions are the product of the 1D @@ -1260,80 +1099,73 @@ void CFEMStandardElementBase::GradVandermonde2D_Quadrilateral(unsigned short The Legendre polynomials are implemented via Jacobi polynomials. Hence the derivatives in r- and s-direction can be computed easily. ---*/ unsigned int ii = 0; - for(unsigned short i=0; i<=nPoly; ++i) { - for(unsigned short j=0; j<=nPoly; ++j) { - for(unsigned short k=0; k &r, - const vector &s, - const vector &t, - vector &V) { - +void CFEMStandardElementBase::Vandermonde3D_Tetrahedron(unsigned short nPoly, unsigned short nDOFs, + const vector& r, const vector& s, + const vector& t, vector& V) { /*--- Determine the number or rows of the Vandermonde matrix and check if the dimension of V is correct. ---*/ unsigned short nRows = r.size(); - unsigned long nEntities = nRows*nDOFs; - if(V.size() != nEntities) - SU2_MPI::Error("Wrong size of the V matrix", CURRENT_FUNCTION); + unsigned long nEntities = nRows * nDOFs; + if (V.size() != nEntities) SU2_MPI::Error("Wrong size of the V matrix", CURRENT_FUNCTION); /*--- For a tetrahedron the orthogonal basis for the reference element is obtained by a combination of Jacobi polynomials (of which the Legendre polynomials is a special case). This is the result of the orthonormalization of the monomial basis. ---*/ unsigned int ii = 0; - for(unsigned short i=0; i<=nPoly; ++i) { - for(unsigned short j=0; j<=(nPoly-i); ++j) { - for(unsigned short k=0; k<=(nPoly-i-j); ++k) { - for(unsigned short l=0; l &r, - const vector &s, - const vector &t, - vector &VDr, - vector &VDs, - vector &VDt) { - +void CFEMStandardElementBase::GradVandermonde3D_Tetrahedron(unsigned short nPoly, unsigned short nDOFs, + const vector& r, const vector& s, + const vector& t, vector& VDr, + vector& VDs, vector& VDt) { /*--- Determine the number or rows of the gradient of the Vandermonde matrix and check if the dimensions of VDr, VDs and VDt are correct. ---*/ unsigned short nRows = r.size(); - unsigned long nEntities = nRows*nDOFs; - if(VDr.size() != nEntities || VDs.size() != nEntities || VDt.size() != nEntities) + unsigned long nEntities = nRows * nDOFs; + if (VDr.size() != nEntities || VDs.size() != nEntities || VDt.size() != nEntities) SU2_MPI::Error("Wrong size of the VDr, VDs and VDt matrices", CURRENT_FUNCTION); /*--- For a tetrahedron the orthogonal basis for the reference element is obtained by a @@ -1342,43 +1174,46 @@ void CFEMStandardElementBase::GradVandermonde3D_Tetrahedron(unsigned short Note that the sequence of the i, j and k loop must be identical to the evaluation of the Vandermonde matrix itself. ---*/ unsigned int ii = 0; - for(unsigned short i=0; i<=nPoly; ++i) { - for(unsigned short j=0; j<=(nPoly-i); ++j) { - for(unsigned short k=0; k<=(nPoly-i-j); ++k) { - for(unsigned short l=0; l 0) { + VDr[ii] = sqrt(8.0) * dfa * gb * hc; + if (i > 0) { VDr[ii] *= 4.0; - if(i > 1 ) VDr[ii] *= pow((1.0-b), (i-1)); + if (i > 1) VDr[ii] *= pow((1.0 - b), (i - 1)); } - if(i+j > 1) VDr[ii] *= pow((1.0-c), (i+j-1)); + if (i + j > 1) VDr[ii] *= pow((1.0 - c), (i + j - 1)); /*--- Compute the derivative of the basis function w.r.t. s. As s is present in both the parameters a and b, both variables must be taken into account when the @@ -1387,24 +1222,24 @@ void CFEMStandardElementBase::GradVandermonde3D_Tetrahedron(unsigned short of the basis function w.r.t. b multiplied by dbds. This value is stored, because it is needed later on to compute the derivative w.r.t. t. ---*/ VDs[ii] = dgb; - if( i ) VDs[ii] *= pow((1.0-b), i); + if (i) VDs[ii] *= pow((1.0 - b), i); - if(i > 0) { - tmp = i*gb; - if(i > 1) tmp *= pow((1.0-b), (i-1)); + if (i > 0) { + tmp = i * gb; + if (i > 1) tmp *= pow((1.0 - b), (i - 1)); VDs[ii] -= tmp; } - if(i+j > 0) { - VDs[ii] *= 2.0*sqrt(8.0)*fa*hc; - if(i+j > 1) VDs[ii] *= pow((1.0-c), (i+j-1)); + if (i + j > 0) { + VDs[ii] *= 2.0 * sqrt(8.0) * fa * hc; + if (i + j > 1) VDs[ii] *= pow((1.0 - c), (i + j - 1)); } su2double dPsidbXdbds = VDs[ii]; /*--- Add the contribution from the derivative of the basis function w.r.t. a multiplied by dads. ---*/ - VDs[ii] += 0.5*(a+1.0)*VDr[ii]; + VDs[ii] += 0.5 * (a + 1.0) * VDr[ii]; /*--- Compute the derivative of the basis function w.r.t. t. As t is present in a, b and c, all parameters must be taken into account when the derivative is computed. Note that @@ -1412,60 +1247,55 @@ void CFEMStandardElementBase::GradVandermonde3D_Tetrahedron(unsigned short expression. The first part is the derivative of the basis function w.r.t. c, which is equal to t. ---*/ VDt[ii] = dhc; - if(i+j > 0) { - VDt[ii] *= pow((1.0-c), (i+j)); + if (i + j > 0) { + VDt[ii] *= pow((1.0 - c), (i + j)); - tmp = (i+j)*hc; - if(i+j > 1) tmp *= pow((1.0-c), (i+j-1)); + tmp = (i + j) * hc; + if (i + j > 1) tmp *= pow((1.0 - c), (i + j - 1)); VDt[ii] -= tmp; } - VDt[ii] *= sqrt(8.0)*fa*gb; - if( i) VDt[ii] *= pow((1.0-b), i); + VDt[ii] *= sqrt(8.0) * fa * gb; + if (i) VDt[ii] *= pow((1.0 - b), i); /*--- Add the contribution from the derivative of the basis function w.r.t. a multiplied by dadt and the derivative w.r.t. b multiplied by dbdt. ---*/ - VDt[ii] += 0.5*(a+1.0)*VDr[ii] + 0.5*(b+1.0)*dPsidbXdbds; + VDt[ii] += 0.5 * (a + 1.0) * VDr[ii] + 0.5 * (b + 1.0) * dPsidbXdbds; } } } } } -void CFEMStandardElementBase::Vandermonde3D_Pyramid(unsigned short nPoly, - unsigned short nDOFs, - const vector &r, - const vector &s, - const vector &t, - vector &V) { - +void CFEMStandardElementBase::Vandermonde3D_Pyramid(unsigned short nPoly, unsigned short nDOFs, + const vector& r, const vector& s, + const vector& t, vector& V) { /*--- Determine the number or rows of the Vandermonde matrix and check if the dimension of V is correct. ---*/ unsigned short nRows = r.size(); - unsigned long nEntities = nRows*nDOFs; - if(V.size() != nEntities) - SU2_MPI::Error("Wrong size of the V matrix", CURRENT_FUNCTION); + unsigned long nEntities = nRows * nDOFs; + if (V.size() != nEntities) SU2_MPI::Error("Wrong size of the V matrix", CURRENT_FUNCTION); /*--- For a pyramid the orthogonal basis for the reference element is obtained by a combination of Jacobi polynomials (of which the Legendre polynomials is a special case). This is the result of the orthonormalization of the monomial basis. ---*/ unsigned int ii = 0; - for(unsigned short i=0; i<=nPoly; ++i) { - for(unsigned short j=0; j<=nPoly; ++j) { - unsigned short muij = max(i,j); - const su2double scaleFact = pow(2,muij+1); - for(unsigned short k=0; k<=(nPoly-muij); ++k) { - for(unsigned short l=0; l &r, - const vector &s, - const vector &t, - vector &VDr, - vector &VDs, - vector &VDt) { - +void CFEMStandardElementBase::GradVandermonde3D_Pyramid(unsigned short nPoly, unsigned short nDOFs, + const vector& r, const vector& s, + const vector& t, vector& VDr, + vector& VDs, vector& VDt) { /*--- Determine the number or rows of the gradient of the Vandermonde matrix and check if the dimensions of VDr, VDs and VDt are correct. ---*/ unsigned short nRows = r.size(); - unsigned long nEntities = nRows*nDOFs; - if(VDr.size() != nEntities || VDs.size() != nEntities || VDt.size() != nEntities) + unsigned long nEntities = nRows * nDOFs; + if (VDr.size() != nEntities || VDs.size() != nEntities || VDt.size() != nEntities) SU2_MPI::Error("Wrong size of the VDr, VDs and VDt matrices", CURRENT_FUNCTION); /*--- For a pyramid the orthogonal basis for the reference element is @@ -1508,20 +1333,20 @@ void CFEMStandardElementBase::GradVandermonde3D_Pyramid(unsigned short Note that the sequence of the i, j and k loop must be identical to the evaluation of the Vandermonde matrix itself. ---*/ unsigned int ii = 0; - for(unsigned short i=0; i<=nPoly; ++i) { - for(unsigned short j=0; j<=nPoly; ++j) { - unsigned short muij = max(i,j); - const su2double scaleFact = pow(2,muij+1); - for(unsigned short k=0; k<=(nPoly-muij); ++k) { - for(unsigned short l=0; l 1) - { - su2double tmpt = pow(tmp, (muij-1)); + VDr[ii] = dfa * gb * hc; + VDs[ii] = fa * dgb * hc; + if (muij > 1) { + su2double tmpt = pow(tmp, (muij - 1)); VDr[ii] *= tmpt; VDs[ii] *= tmpt; } @@ -1559,20 +1383,20 @@ void CFEMStandardElementBase::GradVandermonde3D_Pyramid(unsigned short The first part is the derivative of the basis function w.r.t. c, which is equal to t. --*/ VDt[ii] = dhc; - if(muij > 0) VDt[ii] *= pow(tmp, muij); + if (muij > 0) VDt[ii] *= pow(tmp, muij); - if(muij > 0) { - su2double tmpt = 0.5*muij*hc; - if(muij > 1) tmpt *= pow(tmp, (muij-1)); + if (muij > 0) { + su2double tmpt = 0.5 * muij * hc; + if (muij > 1) tmpt *= pow(tmp, (muij - 1)); VDt[ii] -= tmpt; } - VDt[ii] *= fa*gb; + VDt[ii] *= fa * gb; /*--- Add the contribution from the derivative of the basis function w.r.t. a multiplied by dadt and the derivative w.r.t. b multiplied by dbdt. ---*/ - VDt[ii] += 0.5*a*VDr[ii] + 0.5*b*VDs[ii]; + VDt[ii] += 0.5 * a * VDr[ii] + 0.5 * b * VDs[ii]; /*--- Multiply the three derivatives with the scale factor to obtain the correct answers. See Vandermonde3D_Pyramid for @@ -1586,19 +1410,14 @@ void CFEMStandardElementBase::GradVandermonde3D_Pyramid(unsigned short } } -void CFEMStandardElementBase::Vandermonde3D_Prism(unsigned short nPoly, - unsigned short nDOFs, - const vector &r, - const vector &s, - const vector &t, - vector &V) { - +void CFEMStandardElementBase::Vandermonde3D_Prism(unsigned short nPoly, unsigned short nDOFs, + const vector& r, const vector& s, + const vector& t, vector& V) { /*--- Determine the number or rows of the Vandermonde matrix and check if the dimension of V is correct. ---*/ unsigned short nRows = r.size(); - unsigned long nEntities = nRows*nDOFs; - if(V.size() != nEntities) - SU2_MPI::Error("Wrong size of the V matrix", CURRENT_FUNCTION); + unsigned long nEntities = nRows * nDOFs; + if (V.size() != nEntities) SU2_MPI::Error("Wrong size of the V matrix", CURRENT_FUNCTION); /*--- For a prism the orthogonal basis for the reference element is a tensor product of the 1D basis functions in the structured direction of the prism @@ -1607,44 +1426,39 @@ void CFEMStandardElementBase::Vandermonde3D_Prism(unsigned short nPoly, polynomial. This is the result of the orthonormalization of the monomial basis. ---*/ unsigned int ii = 0; - for(unsigned short i=0; i<=nPoly; ++i) { - for(unsigned short j=0; j<=(nPoly-i); ++j) { - for(unsigned short k=0; k<=nPoly; ++k) { - for(unsigned short l=0; l &r, - const vector &s, - const vector &t, - vector &VDr, - vector &VDs, - vector &VDt) { - +void CFEMStandardElementBase::GradVandermonde3D_Prism(unsigned short nPoly, unsigned short nDOFs, + const vector& r, const vector& s, + const vector& t, vector& VDr, + vector& VDs, vector& VDt) { /*--- Determine the number or rows of the gradient of the Vandermonde matrix and check if the dimensions of VDr, VDs and VDt are correct. ---*/ unsigned short nRows = r.size(); - unsigned long nEntities = nRows*nDOFs; - if(VDr.size() != nEntities || VDs.size() != nEntities || VDt.size() != nEntities) + unsigned long nEntities = nRows * nDOFs; + if (VDr.size() != nEntities || VDs.size() != nEntities || VDt.size() != nEntities) SU2_MPI::Error("Wrong size of the VDr, VDs and VDt matrices", CURRENT_FUNCTION); /*--- For a prism the orthogonal basis for the reference element is a tensor @@ -1654,103 +1468,92 @@ void CFEMStandardElementBase::GradVandermonde3D_Prism(unsigned short nP Note that the sequence of the i, j and k loop must be identical to the evaluation of the Vandermonde matrix itself. ---*/ unsigned int ii = 0; - for(unsigned short i=0; i<=nPoly; ++i) { - for(unsigned short j=0; j<=(nPoly-i); ++j) { - for(unsigned short k=0; k<=nPoly; ++k) { - for(unsigned short l=0; l 0) - { + if (i > 0) { su2double tmp = 1.0; - if(i > 1) tmp = pow((1.0-b), (i-1)); + if (i > 1) tmp = pow((1.0 - b), (i - 1)); - VDr[ii] = 2.0*tmp*VDr[ii]; - VDs[ii] = (a+1.0)*tmp*VDs[ii] - i*tmp*sqrt(2.0)*fa*gb; + VDr[ii] = 2.0 * tmp * VDr[ii]; + VDs[ii] = (a + 1.0) * tmp * VDs[ii] - i * tmp * sqrt(2.0) * fa * gb; } su2double tmp = 1.0; - if(i > 0) tmp = pow((1.0-b), i); + if (i > 0) tmp = pow((1.0 - b), i); - VDs[ii] += sqrt(2.0)*fa*dgb*tmp; + VDs[ii] += sqrt(2.0) * fa * dgb * tmp; /*--- Multiply VDr and VDs with the contribution from the structured direction of the prism. ---*/ - VDr[ii] *= NormJacobi(k,0,0,t[l]); - VDs[ii] *= NormJacobi(k,0,0,t[l]); + VDr[ii] *= NormJacobi(k, 0, 0, t[l]); + VDs[ii] *= NormJacobi(k, 0, 0, t[l]); /*--- Compute the derivative of the basis function in the t-direction, which is the structured direction. ---*/ - VDt[ii] = sqrt(2.0)*tmp*fa*gb*GradNormJacobi(k,0,0,t[l]); + VDt[ii] = sqrt(2.0) * tmp * fa * gb * GradNormJacobi(k, 0, 0, t[l]); } } } } } -void CFEMStandardElementBase::Vandermonde3D_Hexahedron(unsigned short nPoly, - unsigned short nDOFs, - const vector &r, - const vector &s, - const vector &t, - vector &V) { - +void CFEMStandardElementBase::Vandermonde3D_Hexahedron(unsigned short nPoly, unsigned short nDOFs, + const vector& r, const vector& s, + const vector& t, vector& V) { /*--- Determine the number or rows of the Vandermonde matrix and check if the dimension of V is correct. ---*/ unsigned short nRows = r.size(); - unsigned long nEntities = nRows*nDOFs; - if(V.size() != nEntities) - SU2_MPI::Error("Wrong size of the V matrix", CURRENT_FUNCTION); + unsigned long nEntities = nRows * nDOFs; + if (V.size() != nEntities) SU2_MPI::Error("Wrong size of the V matrix", CURRENT_FUNCTION); /*--- For a hexahedron the basis functions are the tensor product of the 1D basis functions, which are the normalized Legendre polynomials. Note that the Legendre polynomials are a special kind of Jacobi polynomials. ---*/ unsigned int ii = 0; - for(unsigned short i=0; i<=nPoly; ++i) { - for(unsigned short j=0; j<=nPoly; ++j) { - for(unsigned short k=0; k<=nPoly; ++k) { - for(unsigned short l=0; l &r, - const vector &s, - const vector &t, - vector &VDr, - vector &VDs, - vector &VDt) { - +void CFEMStandardElementBase::GradVandermonde3D_Hexahedron(unsigned short nPoly, unsigned short nDOFs, + const vector& r, const vector& s, + const vector& t, vector& VDr, + vector& VDs, vector& VDt) { /*--- Determine the number or rows of the gradient of the Vandermonde matrix and check if the dimensions of VDr, VDs and VDt are correct. ---*/ unsigned short nRows = r.size(); - unsigned long nEntities = nRows*nDOFs; - if(VDr.size() != nEntities || VDs.size() != nEntities || VDt.size() != nEntities) + unsigned long nEntities = nRows * nDOFs; + if (VDr.size() != nEntities || VDs.size() != nEntities || VDt.size() != nEntities) SU2_MPI::Error("Wrong size of the VDr, VDs and VDt matrices", CURRENT_FUNCTION); /*--- For a hexahedron the basis functions are the tensor product of the 1D @@ -1760,50 +1563,49 @@ void CFEMStandardElementBase::GradVandermonde3D_Hexahedron(unsigned short Also note that the sequence of the i, j and k loop must be identical to the evaluation of the Vandermonde matrix itself. ---*/ unsigned int ii = 0; - for(unsigned short i=0; i<=nPoly; ++i) { - for(unsigned short j=0; j<=nPoly; ++j) { - for(unsigned short k=0; k<=nPoly; ++k) { - for(unsigned short l=0; l &GLPoints, - vector &GLWeights) { - +void CFEMStandardElementBase::GaussLegendrePoints1D(vector& GLPoints, vector& GLWeights) { /* The class used to determine the integration points operate on passivedoubles. Allocate the memory for the help vectors. */ vector GLPointsPas(GLPoints.size()); @@ -1829,61 +1629,56 @@ void CFEMStandardElementBase::GaussLegendrePoints1D(vector &GLPoints, GaussJacobi.GetQuadraturePoints(0.0, 0.0, -1.0, 1.0, GLPointsPas, GLWeightsPas); /* Copy the data back into GLPoints and GLWeights. */ - for(unsigned long i=0; i 0. For n == 0 the derivative is zero, because the polynomial itself is constant. ---*/ su2double grad; - if(n == 0) grad = 0.0; - else - { - su2double tmp = n*(n+alpha+beta+1.0); - grad = sqrt(tmp)*NormJacobi(n-1, alpha+1, beta+1, x); + if (n == 0) + grad = 0.0; + else { + su2double tmp = n * (n + alpha + beta + 1.0); + grad = sqrt(tmp) * NormJacobi(n - 1, alpha + 1, beta + 1, x); } /*--- Return the gradient. ---*/ @@ -1914,30 +1706,38 @@ su2double CFEMStandardElementBase::GradNormJacobi(unsigned short n, /* Public member functions of CFEMStandardElement. */ /*----------------------------------------------------------------------------------*/ -CFEMStandardElement::CFEMStandardElement(unsigned short val_VTK_Type, - unsigned short val_nPoly, - bool val_constJac, - CConfig *config, - unsigned short val_orderExact, - const vector *rLocSolDOFs, - const vector *sLocSolDOFs, - const vector *tLocSolDOFs) - - : CFEMStandardElementBase(val_VTK_Type, val_nPoly, val_constJac, - config, val_orderExact) { +CFEMStandardElement::CFEMStandardElement(unsigned short val_VTK_Type, unsigned short val_nPoly, bool val_constJac, + CConfig* config, unsigned short val_orderExact, + const vector* rLocSolDOFs, const vector* sLocSolDOFs, + const vector* tLocSolDOFs) + : CFEMStandardElementBase(val_VTK_Type, val_nPoly, val_constJac, config, val_orderExact) { /*--- Copy the function arguments to the member variables. ---*/ nPoly = val_nPoly; /*--- Determine the element type and compute the other member variables. ---*/ - switch( VTK_Type ) { - case LINE: DataStandardLine(); break; - case TRIANGLE: DataStandardTriangle(); break; - case QUADRILATERAL: DataStandardQuadrilateral(); break; - case TETRAHEDRON: DataStandardTetrahedron(); break; - case PYRAMID: DataStandardPyramid(); break; - case PRISM: DataStandardPrism(); break; - case HEXAHEDRON: DataStandardHexahedron(); break; + switch (VTK_Type) { + case LINE: + DataStandardLine(); + break; + case TRIANGLE: + DataStandardTriangle(); + break; + case QUADRILATERAL: + DataStandardQuadrilateral(); + break; + case TETRAHEDRON: + DataStandardTetrahedron(); + break; + case PYRAMID: + DataStandardPyramid(); + break; + case PRISM: + DataStandardPrism(); + break; + case HEXAHEDRON: + DataStandardHexahedron(); + break; } /*--------------------------------------------------------------------------*/ @@ -1949,24 +1749,21 @@ CFEMStandardElement::CFEMStandardElement(unsigned short val_VTK_Type, CheckSumLagrangianBasisFunctions(nIntegration, nDOFs, lagBasisIntegration); /*--- Check the sum of the derivatives of the Lagrangian basis functions. ---*/ - if( !drLagBasisIntegration.empty() ) - CheckSumDerivativesLagrangianBasisFunctions(nIntegration, nDOFs, - drLagBasisIntegration); - if( !dsLagBasisIntegration.empty() ) - CheckSumDerivativesLagrangianBasisFunctions(nIntegration, nDOFs, - dsLagBasisIntegration); - if( !dtLagBasisIntegration.empty() ) - CheckSumDerivativesLagrangianBasisFunctions(nIntegration, nDOFs, - dtLagBasisIntegration); + if (!drLagBasisIntegration.empty()) + CheckSumDerivativesLagrangianBasisFunctions(nIntegration, nDOFs, drLagBasisIntegration); + if (!dsLagBasisIntegration.empty()) + CheckSumDerivativesLagrangianBasisFunctions(nIntegration, nDOFs, dsLagBasisIntegration); + if (!dtLagBasisIntegration.empty()) + CheckSumDerivativesLagrangianBasisFunctions(nIntegration, nDOFs, dtLagBasisIntegration); /*--- Create the transpose of lagBasisIntegration. This is needed for the efficient residual computation for the ADER-DG predictor step. ---*/ lagBasisIntegrationTrans.resize(lagBasisIntegration.size()); unsigned int ii = 0; - for(unsigned short j=0; j dummyLagBasis; vector dummyMatVandermondeInv; - CreateBasisFunctionsAndMatrixDerivatives(rDOFs, sDOFs, tDOFs, - dummyMatVandermondeInv, dummyLagBasis, + CreateBasisFunctionsAndMatrixDerivatives(rDOFs, sDOFs, tDOFs, dummyMatVandermondeInv, dummyLagBasis, matDerBasisOwnDOFs); /*--------------------------------------------------------------------------*/ @@ -2056,19 +1853,18 @@ CFEMStandardElement::CFEMStandardElement(unsigned short val_VTK_Type, /* Easier storage of the offset between the derivatives for matBasisIntegration and matDerBasisSolDOFs. */ - const unsigned long offsetDerInt = nDOFs*nIntegration; - const unsigned long offsetDerDOFs = nDOFs*nDOFs; + const unsigned long offsetDerInt = nDOFs * nIntegration; + const unsigned long offsetDerDOFs = nDOFs * nDOFs; /* Determine the size of the vector to store the second derivatives of the basis functions in the integration points. */ - const unsigned long sizeMat2ndDer = offsetDerInt*nDim*(nDim+1)/2; + const unsigned long sizeMat2ndDer = offsetDerInt * nDim * (nDim + 1) / 2; mat2ndDerBasisInt.resize(sizeMat2ndDer); /* Loop over the number of dimensions to carry out the matrix multiplications. */ - const su2double *matDerBasisInt = matBasisIntegration.data(); - su2double *mat2ndDerBasisIntPoint = mat2ndDerBasisInt.data(); - for(unsigned short jDim=0; jDim &lagBasis) { - +void CFEMStandardElement::BasisFunctionsInPoint(const su2double* parCoor, vector& lagBasis) { /* Determine the number of parametric dimensions, depending on the element type. */ unsigned short nDimPar = 0; - switch(VTK_Type) { - case LINE: nDimPar = 1; break; + switch (VTK_Type) { + case LINE: + nDimPar = 1; + break; case TRIANGLE: - case QUADRILATERAL: nDimPar = 2; break; + case QUADRILATERAL: + nDimPar = 2; + break; case TETRAHEDRON: case PYRAMID: case PRISM: - case HEXAHEDRON: nDimPar = 3; break; + case HEXAHEDRON: + nDimPar = 3; + break; } /* Allocate the memory for the help vectors for computing the Vandermonde @@ -2115,12 +1913,11 @@ void CFEMStandardElement::BasisFunctionsInPoint(const su2double *parCoor, /* Copy the parametric coordinates in rPoints, such that the functions to compute the Vandermonde matrices can be used. */ - for(unsigned long i=0; i &lagBasis, - vector > &dLagBasis) { - +void CFEMStandardElement::BasisFunctionsAndDerivativesInPoint(const su2double* parCoor, vector& lagBasis, + vector >& dLagBasis) { /* Allocate the memory for the help vectors for computing the Vandermonde matrices and its derivatives. */ vector > rPoints(dLagBasis.size(), vector(1)); @@ -2169,12 +1963,11 @@ void CFEMStandardElement::BasisFunctionsAndDerivativesInPoint( /* Copy the parametric coordinates in rPoints, such that the functions to compute the Vandermonde matrices can be used. */ - for(unsigned long i=0; i &rLoc, - const vector &sLoc, - const vector &tLoc, - vector &matVandermondeInv, - vector &lagBasis, - vector &matDerBasis) { - + const vector& rLoc, const vector& sLoc, const vector& tLoc, + vector& matVandermondeInv, vector& lagBasis, vector& matDerBasis) { /* Define the variables, such that the general functions to compute the gradients of the basis functions can be used. Note that some of these variables are dummy variables. */ - unsigned short nDOFsDummy; + unsigned short nDOFsDummy; vector rDOFsDummy, sDOFsDummy, tDOFsDummy; vector drLagBasisLoc, dsLagBasisLoc, dtLagBasisLoc; /*--- Determine the element type and compute the basis functions and the gradients of the basis functions in the given DOFs. ---*/ - switch( VTK_Type ) { + switch (VTK_Type) { case LINE: - LagrangianBasisFunctionAndDerivativesLine(nPoly, rLoc, - nDOFsDummy, rDOFsDummy, - matVandermondeInv, - lagBasis, drLagBasisLoc); + LagrangianBasisFunctionAndDerivativesLine(nPoly, rLoc, nDOFsDummy, rDOFsDummy, matVandermondeInv, lagBasis, + drLagBasisLoc); break; case TRIANGLE: - LagrangianBasisFunctionAndDerivativesTriangle(nPoly, rLoc, - sLoc, nDOFsDummy, - rDOFsDummy, sDOFsDummy, - matVandermondeInv, - lagBasis, drLagBasisLoc, - dsLagBasisLoc); + LagrangianBasisFunctionAndDerivativesTriangle(nPoly, rLoc, sLoc, nDOFsDummy, rDOFsDummy, sDOFsDummy, + matVandermondeInv, lagBasis, drLagBasisLoc, dsLagBasisLoc); break; case QUADRILATERAL: - LagrangianBasisFunctionAndDerivativesQuadrilateral(nPoly, rLoc, - sLoc, nDOFsDummy, - rDOFsDummy, sDOFsDummy, - matVandermondeInv, - lagBasis, drLagBasisLoc, - dsLagBasisLoc); + LagrangianBasisFunctionAndDerivativesQuadrilateral(nPoly, rLoc, sLoc, nDOFsDummy, rDOFsDummy, sDOFsDummy, + matVandermondeInv, lagBasis, drLagBasisLoc, dsLagBasisLoc); break; case TETRAHEDRON: - LagrangianBasisFunctionAndDerivativesTetrahedron(nPoly, rLoc, - sLoc, tLoc, - nDOFsDummy, rDOFsDummy, - sDOFsDummy, tDOFsDummy, - matVandermondeInv, - lagBasis, drLagBasisLoc, - dsLagBasisLoc, - dtLagBasisLoc); + LagrangianBasisFunctionAndDerivativesTetrahedron(nPoly, rLoc, sLoc, tLoc, nDOFsDummy, rDOFsDummy, sDOFsDummy, + tDOFsDummy, matVandermondeInv, lagBasis, drLagBasisLoc, + dsLagBasisLoc, dtLagBasisLoc); break; case PYRAMID: - LagrangianBasisFunctionAndDerivativesPyramid(nPoly, rLoc, - sLoc, tLoc, - nDOFsDummy, rDOFsDummy, - sDOFsDummy, tDOFsDummy, - matVandermondeInv, - lagBasis, drLagBasisLoc, - dsLagBasisLoc, - dtLagBasisLoc); + LagrangianBasisFunctionAndDerivativesPyramid(nPoly, rLoc, sLoc, tLoc, nDOFsDummy, rDOFsDummy, sDOFsDummy, + tDOFsDummy, matVandermondeInv, lagBasis, drLagBasisLoc, + dsLagBasisLoc, dtLagBasisLoc); break; case PRISM: - LagrangianBasisFunctionAndDerivativesPrism(nPoly, rLoc, - sLoc, tLoc, - nDOFsDummy, rDOFsDummy, - sDOFsDummy, tDOFsDummy, - matVandermondeInv, - lagBasis, drLagBasisLoc, - dsLagBasisLoc, + LagrangianBasisFunctionAndDerivativesPrism(nPoly, rLoc, sLoc, tLoc, nDOFsDummy, rDOFsDummy, sDOFsDummy, + tDOFsDummy, matVandermondeInv, lagBasis, drLagBasisLoc, dsLagBasisLoc, dtLagBasisLoc); break; case HEXAHEDRON: - LagrangianBasisFunctionAndDerivativesHexahedron(nPoly, rLoc, - sLoc, tLoc, - nDOFsDummy, rDOFsDummy, - sDOFsDummy, tDOFsDummy, - matVandermondeInv, - lagBasis, drLagBasisLoc, - dsLagBasisLoc, - dtLagBasisLoc); + LagrangianBasisFunctionAndDerivativesHexahedron(nPoly, rLoc, sLoc, tLoc, nDOFsDummy, rDOFsDummy, sDOFsDummy, + tDOFsDummy, matVandermondeInv, lagBasis, drLagBasisLoc, + dsLagBasisLoc, dtLagBasisLoc); break; } @@ -2371,48 +2123,37 @@ void CFEMStandardElement::CreateBasisFunctionsAndMatrixDerivatives( CheckSumLagrangianBasisFunctions(nLoc, nDOFs, lagBasis); - if( !drLagBasisLoc.empty() ) - CheckSumDerivativesLagrangianBasisFunctions(nLoc, nDOFs, - drLagBasisLoc); - if( !dsLagBasisLoc.empty() ) - CheckSumDerivativesLagrangianBasisFunctions(nLoc, nDOFs, - dsLagBasisLoc); - if( !dtLagBasisLoc.empty() ) - CheckSumDerivativesLagrangianBasisFunctions(nLoc, nDOFs, - dtLagBasisLoc); + if (!drLagBasisLoc.empty()) CheckSumDerivativesLagrangianBasisFunctions(nLoc, nDOFs, drLagBasisLoc); + if (!dsLagBasisLoc.empty()) CheckSumDerivativesLagrangianBasisFunctions(nLoc, nDOFs, dsLagBasisLoc); + if (!dtLagBasisLoc.empty()) CheckSumDerivativesLagrangianBasisFunctions(nLoc, nDOFs, dtLagBasisLoc); /*--- For efficiency reasons drLagBasisLoc, dsLagBasisLoc and dtLagBasisLoc are stored in matDerBasis. ---*/ - const unsigned long sizeDerMat = drLagBasisLoc.size() + dsLagBasisLoc.size() - + dtLagBasisLoc.size(); + const unsigned long sizeDerMat = drLagBasisLoc.size() + dsLagBasisLoc.size() + dtLagBasisLoc.size(); matDerBasis.resize(sizeDerMat); unsigned int ii = 0; - for(unsigned long i=0; i matVandermondeInvDummy; - LagrangianBasisFunctionAndDerivativesLine(nPoly, rIntegration, nDOFs, rDOFs, - matVandermondeInvDummy, - lagBasisIntegration, - drLagBasisIntegration); + LagrangianBasisFunctionAndDerivativesLine(nPoly, rIntegration, nDOFs, rDOFs, matVandermondeInvDummy, + lagBasisIntegration, drLagBasisIntegration); /*--- Determine the local connectivity of the two "faces" of the line element. For a line element the faces are just points. ---*/ - connFace0.reserve(1); connFace0.push_back(0); - connFace1.reserve(1); connFace1.push_back(nPoly); + connFace0.reserve(1); + connFace0.push_back(0); + connFace1.reserve(1); + connFace1.push_back(nPoly); /*--- Determine the local subconnectivity used for plotting purposes. ---*/ SubConnForPlottingLine(nPoly, subConn1ForPlotting); @@ -2422,26 +2163,24 @@ void CFEMStandardElement::DataStandardLine(void) { VTK_Type2 = NONE; } -void CFEMStandardElement::DataStandardTriangle(void) { - +void CFEMStandardElement::DataStandardTriangle() { /*--- Determine the Lagrangian basis functions and its derivatives in the integration points. ---*/ vector matVandermondeInvDummy; - LagrangianBasisFunctionAndDerivativesTriangle(nPoly, rIntegration, sIntegration, - nDOFs, rDOFs, sDOFs, - matVandermondeInvDummy, - lagBasisIntegration, - drLagBasisIntegration, + LagrangianBasisFunctionAndDerivativesTriangle(nPoly, rIntegration, sIntegration, nDOFs, rDOFs, sDOFs, + matVandermondeInvDummy, lagBasisIntegration, drLagBasisIntegration, dsLagBasisIntegration); /*--- Determine the local connectivity of the three "faces" of the triangle. For a triangular element the faces are just lines. Make sure that the element is to the left of the face. ---*/ - connFace0.reserve(nPoly+1); connFace1.reserve(nPoly+1); connFace2.reserve(nPoly+1); + connFace0.reserve(nPoly + 1); + connFace1.reserve(nPoly + 1); + connFace2.reserve(nPoly + 1); - for(signed short i=0; i<=nPoly; ++i) connFace0.push_back(i); - for(signed short i=0; i<=nPoly; ++i) connFace1.push_back((i+1)*(nPoly+1) - i*(i+1)/2 -1); - for(signed short i=nPoly; i>=0; --i) connFace2.push_back(i*(nPoly+1) - i*(i-1)/2); + for (signed short i = 0; i <= nPoly; ++i) connFace0.push_back(i); + for (signed short i = 0; i <= nPoly; ++i) connFace1.push_back((i + 1) * (nPoly + 1) - i * (i + 1) / 2 - 1); + for (signed short i = nPoly; i >= 0; --i) connFace2.push_back(i * (nPoly + 1) - i * (i - 1) / 2); /*--- Determine the local subconnectivity of the triangular element used for plotting purposes. ---*/ @@ -2452,31 +2191,28 @@ void CFEMStandardElement::DataStandardTriangle(void) { VTK_Type2 = NONE; } -void CFEMStandardElement::DataStandardQuadrilateral(void) { - +void CFEMStandardElement::DataStandardQuadrilateral() { /*--- Determine the Lagrangian basis functions and its derivatives in the integration points. ---*/ vector matVandermondeInvDummy; - LagrangianBasisFunctionAndDerivativesQuadrilateral(nPoly, rIntegration, - sIntegration, - nDOFs, rDOFs, sDOFs, - matVandermondeInvDummy, - lagBasisIntegration, - drLagBasisIntegration, + LagrangianBasisFunctionAndDerivativesQuadrilateral(nPoly, rIntegration, sIntegration, nDOFs, rDOFs, sDOFs, + matVandermondeInvDummy, lagBasisIntegration, drLagBasisIntegration, dsLagBasisIntegration); /*--- Determine the local connectivity of the four "faces" of the quad element. For a quad element the faces are just lines. Make sure that the element is to the left of the face. ---*/ - connFace0.reserve(nPoly+1); connFace1.reserve(nPoly+1); - connFace2.reserve(nPoly+1); connFace3.reserve(nPoly+1); + connFace0.reserve(nPoly + 1); + connFace1.reserve(nPoly + 1); + connFace2.reserve(nPoly + 1); + connFace3.reserve(nPoly + 1); - unsigned short n0 = 0, n1 = nPoly, n2 = nDOFs-1, n3 = nPoly*(nPoly+1); + unsigned short n0 = 0, n1 = nPoly, n2 = nDOFs - 1, n3 = nPoly * (nPoly + 1); - for(signed short i=n0; i<=n1; ++i) connFace0.push_back(i); - for(signed short i=n1; i<=n2; i+=(nPoly+1)) connFace1.push_back(i); - for(signed short i=n2; i>=n3; --i) connFace2.push_back(i); - for(signed short i=n3; i>=n0; i-=(nPoly+1)) connFace3.push_back(i); + for (signed short i = n0; i <= n1; ++i) connFace0.push_back(i); + for (signed short i = n1; i <= n2; i += (nPoly + 1)) connFace1.push_back(i); + for (signed short i = n2; i >= n3; --i) connFace2.push_back(i); + for (signed short i = n3; i >= n0; i -= (nPoly + 1)) connFace3.push_back(i); /*--- Determine the local subconnectivity of the quadrilateral element used for plotting purposes. ---*/ @@ -2487,36 +2223,32 @@ void CFEMStandardElement::DataStandardQuadrilateral(void) { VTK_Type2 = NONE; } -void CFEMStandardElement::DataStandardTetrahedron(void) { - +void CFEMStandardElement::DataStandardTetrahedron() { /*--- Determine the Lagrangian basis functions and its derivatives in the integration points. ---*/ vector matVandermondeInvDummy; - LagrangianBasisFunctionAndDerivativesTetrahedron(nPoly, rIntegration, - sIntegration, tIntegration, - nDOFs, rDOFs, sDOFs, tDOFs, - matVandermondeInvDummy, - lagBasisIntegration, - drLagBasisIntegration, - dsLagBasisIntegration, - dtLagBasisIntegration); + LagrangianBasisFunctionAndDerivativesTetrahedron(nPoly, rIntegration, sIntegration, tIntegration, nDOFs, rDOFs, sDOFs, + tDOFs, matVandermondeInvDummy, lagBasisIntegration, + drLagBasisIntegration, dsLagBasisIntegration, dtLagBasisIntegration); /*--- Determine the local connectivity of the four faces of the tetrahedron. For a tetrahedron the faces are triangles. ---*/ - unsigned short nDOFsTriangle = (nPoly+1)*(nPoly+2)/2; - connFace0.reserve(nDOFsTriangle); connFace1.reserve(nDOFsTriangle); - connFace2.reserve(nDOFsTriangle); connFace3.reserve(nDOFsTriangle); + unsigned short nDOFsTriangle = (nPoly + 1) * (nPoly + 2) / 2; + connFace0.reserve(nDOFsTriangle); + connFace1.reserve(nDOFsTriangle); + connFace2.reserve(nDOFsTriangle); + connFace3.reserve(nDOFsTriangle); unsigned int ii = 0; - for(unsigned short k=0; k<=nPoly; ++k) { + for (unsigned short k = 0; k <= nPoly; ++k) { unsigned short uppBoundJ = nPoly - k; - for(unsigned short j=0; j<=uppBoundJ; ++j) { + for (unsigned short j = 0; j <= uppBoundJ; ++j) { unsigned short uppBoundI = nPoly - k - j; - for(unsigned short i=0; i<=uppBoundI; ++i, ++ii) { - if(k == 0) connFace0.push_back(ii); - if(j == 0) connFace1.push_back(ii); - if(i == 0) connFace2.push_back(ii); - if((i+j+k) == nPoly) connFace3.push_back(ii); + for (unsigned short i = 0; i <= uppBoundI; ++i, ++ii) { + if (k == 0) connFace0.push_back(ii); + if (j == 0) connFace1.push_back(ii); + if (i == 0) connFace2.push_back(ii); + if ((i + j + k) == nPoly) connFace3.push_back(ii); } } } @@ -2524,8 +2256,8 @@ void CFEMStandardElement::DataStandardTetrahedron(void) { /*--- Make sure that the element is to the left of the faces. ---*/ unsigned short n0 = 0; unsigned short n1 = nPoly; - unsigned short n2 = nDOFsTriangle -1; - unsigned short n3 = nDOFs -1; + unsigned short n2 = nDOFsTriangle - 1; + unsigned short n3 = nDOFs - 1; ChangeDirectionTriangleConn(connFace0, n0, n1, n2); ChangeDirectionTriangleConn(connFace1, n0, n3, n1); @@ -2542,24 +2274,18 @@ void CFEMStandardElement::DataStandardTetrahedron(void) { VTK_Type2 = NONE; } -void CFEMStandardElement::DataStandardPyramid(void) { - +void CFEMStandardElement::DataStandardPyramid() { /*--- Determine the Lagrangian basis functions and its derivatives in the integration points. ---*/ vector matVandermondeInvDummy; - LagrangianBasisFunctionAndDerivativesPyramid(nPoly, rIntegration, - sIntegration, tIntegration, - nDOFs, rDOFs, sDOFs, tDOFs, - matVandermondeInvDummy, - lagBasisIntegration, - drLagBasisIntegration, - dsLagBasisIntegration, - dtLagBasisIntegration); + LagrangianBasisFunctionAndDerivativesPyramid(nPoly, rIntegration, sIntegration, tIntegration, nDOFs, rDOFs, sDOFs, + tDOFs, matVandermondeInvDummy, lagBasisIntegration, + drLagBasisIntegration, dsLagBasisIntegration, dtLagBasisIntegration); /*--- Determine the local connectivity of the five faces of the pyramid. For a pyramid there are four triangular faces and one quadrilateral face. ---*/ - unsigned short nDOFsQuad = (nPoly+1)*(nPoly+1); - unsigned short nDOFsTriangle = (nPoly+1)*(nPoly+2)/2; + unsigned short nDOFsQuad = (nPoly + 1) * (nPoly + 1); + unsigned short nDOFsTriangle = (nPoly + 1) * (nPoly + 2) / 2; connFace0.reserve(nDOFsQuad); connFace1.reserve(nDOFsTriangle); @@ -2569,14 +2295,14 @@ void CFEMStandardElement::DataStandardPyramid(void) { unsigned short mPoly = nPoly; unsigned int ii = 0; - for(unsigned short k=0; k<=nPoly; ++k, --mPoly) { - for(unsigned short j=0; j<=mPoly; ++j) { - for(unsigned short i=0; i<=mPoly; ++i, ++ii) { - if(k == 0) connFace0.push_back(ii); - if(j == 0) connFace1.push_back(ii); - if(j == mPoly) connFace2.push_back(ii); - if(i == 0) connFace3.push_back(ii); - if(i == mPoly) connFace4.push_back(ii); + for (unsigned short k = 0; k <= nPoly; ++k, --mPoly) { + for (unsigned short j = 0; j <= mPoly; ++j) { + for (unsigned short i = 0; i <= mPoly; ++i, ++ii) { + if (k == 0) connFace0.push_back(ii); + if (j == 0) connFace1.push_back(ii); + if (j == mPoly) connFace2.push_back(ii); + if (i == 0) connFace3.push_back(ii); + if (i == mPoly) connFace4.push_back(ii); } } } @@ -2584,9 +2310,9 @@ void CFEMStandardElement::DataStandardPyramid(void) { /*--- Make sure that the element is to the left of the faces. ---*/ unsigned short n0 = 0; unsigned short n1 = nPoly; - unsigned short n2 = nDOFsQuad -1; + unsigned short n2 = nDOFsQuad - 1; unsigned short n3 = n2 - nPoly; - unsigned short n4 = nDOFs -1; + unsigned short n4 = nDOFs - 1; ChangeDirectionQuadConn(connFace0, n0, n1, n2, n3); ChangeDirectionTriangleConn(connFace1, n0, n4, n1); @@ -2604,24 +2330,18 @@ void CFEMStandardElement::DataStandardPyramid(void) { VTK_Type2 = TETRAHEDRON; } -void CFEMStandardElement::DataStandardPrism(void) { - +void CFEMStandardElement::DataStandardPrism() { /*--- Determine the Lagrangian basis functions and its derivatives in the integration points. ---*/ vector matVandermondeInvDummy; - LagrangianBasisFunctionAndDerivativesPrism(nPoly, rIntegration, - sIntegration, tIntegration, - nDOFs, rDOFs, sDOFs, tDOFs, - matVandermondeInvDummy, - lagBasisIntegration, - drLagBasisIntegration, - dsLagBasisIntegration, - dtLagBasisIntegration); + LagrangianBasisFunctionAndDerivativesPrism(nPoly, rIntegration, sIntegration, tIntegration, nDOFs, rDOFs, sDOFs, + tDOFs, matVandermondeInvDummy, lagBasisIntegration, drLagBasisIntegration, + dsLagBasisIntegration, dtLagBasisIntegration); /*--- Determine the local connectivity of the five faces of the prism. For a prism there are two triangular faces and three quadrilateral faces. ---*/ - unsigned short nDOFsQuad = (nPoly+1)*(nPoly+1); - unsigned short nDOFsTriangle = (nPoly+1)*(nPoly+2)/2; + unsigned short nDOFsQuad = (nPoly + 1) * (nPoly + 1); + unsigned short nDOFsTriangle = (nPoly + 1) * (nPoly + 2) / 2; connFace0.reserve(nDOFsTriangle); connFace1.reserve(nDOFsTriangle); @@ -2630,15 +2350,15 @@ void CFEMStandardElement::DataStandardPrism(void) { connFace4.reserve(nDOFsQuad); unsigned int ii = 0; - for(unsigned short k=0; k<=nPoly; ++k) { - for(unsigned short j=0; j<=nPoly; ++j) { + for (unsigned short k = 0; k <= nPoly; ++k) { + for (unsigned short j = 0; j <= nPoly; ++j) { unsigned short uppBoundI = nPoly - j; - for(unsigned short i=0; i<=uppBoundI; ++i, ++ii) { - if(k == 0) connFace0.push_back(ii); - if(k == nPoly) connFace1.push_back(ii); - if(j == 0) connFace2.push_back(ii); - if(i == 0) connFace3.push_back(ii); - if((i+j) == nPoly) connFace4.push_back(ii); + for (unsigned short i = 0; i <= uppBoundI; ++i, ++ii) { + if (k == 0) connFace0.push_back(ii); + if (k == nPoly) connFace1.push_back(ii); + if (j == 0) connFace2.push_back(ii); + if (i == 0) connFace3.push_back(ii); + if ((i + j) == nPoly) connFace4.push_back(ii); } } } @@ -2646,10 +2366,10 @@ void CFEMStandardElement::DataStandardPrism(void) { /*--- Make sure that the element is to the left of the faces. ---*/ unsigned short n0 = 0; unsigned short n1 = nPoly; - unsigned short n2 = nDOFsTriangle -1; - unsigned short n3 = n0 + nDOFsTriangle*nPoly; - unsigned short n4 = n1 + nDOFsTriangle*nPoly; - unsigned short n5 = n2 + nDOFsTriangle*nPoly; + unsigned short n2 = nDOFsTriangle - 1; + unsigned short n3 = n0 + nDOFsTriangle * nPoly; + unsigned short n4 = n1 + nDOFsTriangle * nPoly; + unsigned short n5 = n2 + nDOFsTriangle * nPoly; ChangeDirectionTriangleConn(connFace0, n0, n1, n2); ChangeDirectionTriangleConn(connFace1, n3, n5, n4); @@ -2667,23 +2387,17 @@ void CFEMStandardElement::DataStandardPrism(void) { VTK_Type2 = NONE; } -void CFEMStandardElement::DataStandardHexahedron(void) { - +void CFEMStandardElement::DataStandardHexahedron() { /*--- Determine the Lagrangian basis functions and its derivatives in the integration points. ---*/ vector matVandermondeInvDummy; - LagrangianBasisFunctionAndDerivativesHexahedron(nPoly, rIntegration, - sIntegration, tIntegration, - nDOFs, rDOFs, sDOFs, tDOFs, - matVandermondeInvDummy, - lagBasisIntegration, - drLagBasisIntegration, - dsLagBasisIntegration, - dtLagBasisIntegration); + LagrangianBasisFunctionAndDerivativesHexahedron(nPoly, rIntegration, sIntegration, tIntegration, nDOFs, rDOFs, sDOFs, + tDOFs, matVandermondeInvDummy, lagBasisIntegration, + drLagBasisIntegration, dsLagBasisIntegration, dtLagBasisIntegration); /*--- Determine the local connectivity of the six faces of the hexahedron. For a hexahedron the faces are all quadrilateral faces. ---*/ - unsigned short nDOFsQuad = (nPoly+1)*(nPoly+1); + unsigned short nDOFsQuad = (nPoly + 1) * (nPoly + 1); connFace0.reserve(nDOFsQuad); connFace1.reserve(nDOFsQuad); @@ -2693,15 +2407,15 @@ void CFEMStandardElement::DataStandardHexahedron(void) { connFace5.reserve(nDOFsQuad); unsigned int ii = 0; - for(unsigned short k=0; k<=nPoly; ++k) { - for(unsigned short j=0; j<=nPoly; ++j) { - for(unsigned short i=0; i<=nPoly; ++i, ++ii) { - if(k == 0) connFace0.push_back(ii); - if(k == nPoly) connFace1.push_back(ii); - if(j == 0) connFace2.push_back(ii); - if(j == nPoly) connFace3.push_back(ii); - if(i == 0) connFace4.push_back(ii); - if(i == nPoly) connFace5.push_back(ii); + for (unsigned short k = 0; k <= nPoly; ++k) { + for (unsigned short j = 0; j <= nPoly; ++j) { + for (unsigned short i = 0; i <= nPoly; ++i, ++ii) { + if (k == 0) connFace0.push_back(ii); + if (k == nPoly) connFace1.push_back(ii); + if (j == 0) connFace2.push_back(ii); + if (j == nPoly) connFace3.push_back(ii); + if (i == 0) connFace4.push_back(ii); + if (i == nPoly) connFace5.push_back(ii); } } } @@ -2709,12 +2423,12 @@ void CFEMStandardElement::DataStandardHexahedron(void) { /*--- Make sure that the element is to the left of the faces. ---*/ unsigned short n0 = 0; unsigned short n1 = nPoly; - unsigned short n2 = nDOFsQuad -1; + unsigned short n2 = nDOFsQuad - 1; unsigned short n3 = n2 - nPoly; - unsigned short n4 = n0 + nDOFsQuad*nPoly; - unsigned short n5 = n1 + nDOFsQuad*nPoly; - unsigned short n6 = n2 + nDOFsQuad*nPoly; - unsigned short n7 = n3 + nDOFsQuad*nPoly; + unsigned short n4 = n0 + nDOFsQuad * nPoly; + unsigned short n5 = n1 + nDOFsQuad * nPoly; + unsigned short n6 = n2 + nDOFsQuad * nPoly; + unsigned short n7 = n3 + nDOFsQuad * nPoly; ChangeDirectionQuadConn(connFace0, n0, n1, n2, n3); ChangeDirectionQuadConn(connFace1, n4, n7, n6, n5); @@ -2733,21 +2447,18 @@ void CFEMStandardElement::DataStandardHexahedron(void) { VTK_Type2 = NONE; } -void CFEMStandardElement::SubConnTetrahedron(void) { - +void CFEMStandardElement::SubConnTetrahedron() { /*--- Initialize the number of DOFs for the current edges to the number of DOFs of the edges present in the tetrahedron. Also initialize the current k offset to zero. ---*/ unsigned short nDOFsCurrentEdges = nPoly + 1; - unsigned short offCurrentK = 0; + unsigned short offCurrentK = 0; /*--- Loop in the k-direction of the tetrahedron, which is along the edge from the first vertex to the last vertex of the tet. ---*/ - for(unsigned short k=0; k &connQuad, - unsigned short vert0, - unsigned short vert1, - unsigned short vert2, - unsigned short vert3) const { - +void CFEMStandardElement::ChangeDirectionQuadConn(vector& connQuad, unsigned short vert0, + unsigned short vert1, unsigned short vert2, + unsigned short vert3) const { /*--- Determine the indices of the 4 corner vertices of the quad. ---*/ unsigned short ind0 = 0; unsigned short ind1 = nPoly; - unsigned short ind2 = (nPoly+1)*(nPoly+1) -1; + unsigned short ind2 = (nPoly + 1) * (nPoly + 1) - 1; unsigned short ind3 = ind2 - nPoly; /*--- There exists a linear mapping from the indices of the numbering used in the @@ -3247,125 +2951,113 @@ void CFEMStandardElement::ChangeDirectionQuadConn(vector &connQu determined below. The bool verticesDontMatch is there to check if vertices do not match. This should not happen, but it is checked for security. ---*/ - signed short a=0, b=0, c=0, d=0, e=0, f=0; // Initialization to avoid a compiler warning. + signed short a = 0, b = 0, c = 0, d = 0, e = 0, f = 0; // Initialization to avoid a compiler warning. bool verticesDontMatch = false; - if(vert0 == connQuad[ind0]) { - + if (vert0 == connQuad[ind0]) { /*--- Vert0 coincides with the first vertex of the face connectivity. Set the coefficients a and d accordingly. ---*/ a = d = 0; - if(vert2 != connQuad[ind2]) verticesDontMatch = true; + if (vert2 != connQuad[ind2]) verticesDontMatch = true; /*--- Check the situation for the neighboring vertices. ---*/ - if(vert1 == connQuad[ind1]) { - + if (vert1 == connQuad[ind1]) { /*--- The vertex numbering is the same for both faces. ---*/ - if(vert3 != connQuad[ind3]) verticesDontMatch = true; - - b = f = 1; c = e = 0; - } - else if(vert1 == connQuad[ind3]) { + if (vert3 != connQuad[ind3]) verticesDontMatch = true; + b = f = 1; + c = e = 0; + } else if (vert1 == connQuad[ind3]) { /*--- The i and j numbering are swapped. ---*/ - if(vert3 != connQuad[ind1]) verticesDontMatch = true; + if (vert3 != connQuad[ind1]) verticesDontMatch = true; - b = f = 0; c = e = 1; - } - else { + b = f = 0; + c = e = 1; + } else { verticesDontMatch = true; } - } - else if(vert1 == connQuad[ind0]) { - + } else if (vert1 == connQuad[ind0]) { /*--- Vert1 coincides with the first vertex of the face connectivity. Set the coefficients a and d accordingly. ---*/ - a = nPoly; d = 0; - if(vert3 != connQuad[ind2]) verticesDontMatch = true; + a = nPoly; + d = 0; + if (vert3 != connQuad[ind2]) verticesDontMatch = true; /*--- Check the situation for the neighboring vertices. ---*/ - if(vert0 == connQuad[ind1]) { - + if (vert0 == connQuad[ind1]) { /*--- The i-direction is negated while the j-direction coincides. ---*/ - if(vert2 != connQuad[ind3]) verticesDontMatch = true; - - b = -1; f = 1; c = e = 0; - } - else if(vert0 == connQuad[ind3]) { + if (vert2 != connQuad[ind3]) verticesDontMatch = true; + b = -1; + f = 1; + c = e = 0; + } else if (vert0 == connQuad[ind3]) { /*--- The j-direction of the current face corresponds with the negative i-direction of the target, while the i-direction coincides with the j-direction of the target. ---*/ - if(vert2 != connQuad[ind1]) verticesDontMatch = true; + if (vert2 != connQuad[ind1]) verticesDontMatch = true; - b = f = 0; c = -1; e = 1; - } - else { + b = f = 0; + c = -1; + e = 1; + } else { verticesDontMatch = true; } - } - else if(vert2 == connQuad[ind0]) { - + } else if (vert2 == connQuad[ind0]) { /*--- Vert2 coincides with the first vertex of the face connectivity. Set the coefficients a and d accordingly. ---*/ a = d = nPoly; - if(vert0 != connQuad[ind2]) verticesDontMatch = true; + if (vert0 != connQuad[ind2]) verticesDontMatch = true; /*--- Check the situation for the neighboring vertices. ---*/ - if(vert1 == connQuad[ind3]) { - + if (vert1 == connQuad[ind3]) { /*--- Both the i and j-direction are negated. ---*/ - if(vert3 != connQuad[ind1]) verticesDontMatch = true; - - b = f = -1; c = e = 0; - } - else if(vert1 == connQuad[ind1]) { + if (vert3 != connQuad[ind1]) verticesDontMatch = true; + b = f = -1; + c = e = 0; + } else if (vert1 == connQuad[ind1]) { /*--- The i and j-direction are negated and swapped. ---*/ - if(vert3 != connQuad[ind3]) verticesDontMatch = true; + if (vert3 != connQuad[ind3]) verticesDontMatch = true; - b = f = 0; c = e = -1; - } - else { + b = f = 0; + c = e = -1; + } else { verticesDontMatch = true; } - } - else if(vert3 == connQuad[ind0]) { - + } else if (vert3 == connQuad[ind0]) { /*--- Vert3 coincides with the first vertex of the face connectivity. Set the coefficients a and d accordingly. ---*/ - a = 0; d = nPoly; - if(vert1 != connQuad[ind2]) verticesDontMatch = true; + a = 0; + d = nPoly; + if (vert1 != connQuad[ind2]) verticesDontMatch = true; /*--- Check the situation for the neighboring vertices. ---*/ - if(vert0 == connQuad[ind3]) { - + if (vert0 == connQuad[ind3]) { /*--- The i-direction coincides while the j-direction is negated. ---*/ - if(vert2 != connQuad[ind1]) verticesDontMatch = true; - - b = 1; f = -1; c = e = 0; - } - else if(vert0 == connQuad[ind1]) { + if (vert2 != connQuad[ind1]) verticesDontMatch = true; + b = 1; + f = -1; + c = e = 0; + } else if (vert0 == connQuad[ind1]) { /*--- The j-direction of the current face corresponds with the i-direction of the target, while the i-direction coincides with the negative j-direction of the target. ---*/ - if(vert2 != connQuad[ind3]) verticesDontMatch = true; + if (vert2 != connQuad[ind3]) verticesDontMatch = true; - b = f = 0; c = 1; e = -1; - } - else { + b = f = 0; + c = 1; + e = -1; + } else { verticesDontMatch = true; } - } - else { + } else { verticesDontMatch = true; } /*--- If non-matching vertices have been found, terminate with an error message. ---*/ - if( verticesDontMatch ) - SU2_MPI::Error("Corner vertices do not match. This should not happen.", - CURRENT_FUNCTION); + if (verticesDontMatch) SU2_MPI::Error("Corner vertices do not match. This should not happen.", CURRENT_FUNCTION); /*--- Copy the connectivity, such that things works out correctly when carrying out the renumbering. ---*/ @@ -3373,30 +3065,26 @@ void CFEMStandardElement::ChangeDirectionQuadConn(vector &connQu /*--- Loop over the vertices of the original face to copy the connectivity data. ---*/ unsigned short ind = 0; - for(unsigned short j=0; j<=nPoly; ++j) { - for(unsigned short i=0; i<=nPoly; ++i, ++ind) { - + for (unsigned short j = 0; j <= nPoly; ++j) { + for (unsigned short i = 0; i <= nPoly; ++i, ++ind) { /*--- Determine the ii and jj indices of the target, convert it to a 1D index and shore the modified index in connQuad. ---*/ - unsigned short ii = a + i*b + j*c; - unsigned short jj = d + i*e + j*f; + unsigned short ii = a + i * b + j * c; + unsigned short jj = d + i * e + j * f; - unsigned short iind = jj*(nPoly+1) + ii; + unsigned short iind = jj * (nPoly + 1) + ii; connQuad[iind] = connQuadOr[ind]; } } } -void CFEMStandardElement::ChangeDirectionTriangleConn(vector &connTriangle, - unsigned short vert0, - unsigned short vert1, - unsigned short vert2) const { - +void CFEMStandardElement::ChangeDirectionTriangleConn(vector& connTriangle, unsigned short vert0, + unsigned short vert1, unsigned short vert2) const { /*--- Determine the indices of the 3 corner vertices of the triangle. ---*/ unsigned short ind0 = 0; unsigned short ind1 = nPoly; - unsigned short ind2 = (nPoly+1)*(nPoly+2)/2 -1; + unsigned short ind2 = (nPoly + 1) * (nPoly + 2) / 2 - 1; /*--- There exists a linear mapping from the indices of the numbering used in the connectivity of this face to the indices of the target numbering. This @@ -3406,88 +3094,98 @@ void CFEMStandardElement::ChangeDirectionTriangleConn(vector &co depend on how the corner points coincide with each other. This is determined below. The bool verticesDontMatch is there to check if vertices do not match. This should not happen, but it is checked for security. ---*/ - signed short a=0, b=0, c=0, d=0, e=0, f=0; + signed short a = 0, b = 0, c = 0, d = 0, e = 0, f = 0; bool verticesDontMatch = false; - if(vert0 == connTriangle[ind0]) { - + if (vert0 == connTriangle[ind0]) { /*--- Vert0 coincides with the first vertex of the face connectivity. Check the situation for the neighboring vertices. ---*/ - if(vert1 == connTriangle[ind1]) { - + if (vert1 == connTriangle[ind1]) { /*--- The vertex numbering is the same for both faces. ---*/ - if(vert2 != connTriangle[ind2]) verticesDontMatch = true; - - a = 0; b = 1; c = 0; d = 0; e = 0; f = 1; - } - else if(vert1 == connTriangle[ind2]) { - + if (vert2 != connTriangle[ind2]) verticesDontMatch = true; + + a = 0; + b = 1; + c = 0; + d = 0; + e = 0; + f = 1; + } else if (vert1 == connTriangle[ind2]) { /*--- The ii-index corresponds to the j-index and the jj-index corresponds to i-index. ---*/ - if(vert2 != connTriangle[ind1]) verticesDontMatch = true; - - a = 0; b = 0; c = 1; d = 0; e = 1; f = 0; - } - else { + if (vert2 != connTriangle[ind1]) verticesDontMatch = true; + + a = 0; + b = 0; + c = 1; + d = 0; + e = 1; + f = 0; + } else { verticesDontMatch = true; } - } - else if(vert0 == connTriangle[ind1]) { - + } else if (vert0 == connTriangle[ind1]) { /*--- Vert0 coincides with the second vertex of the face connectivity. Check the situation for the neighboring vertices. ---*/ - if(vert1 == connTriangle[ind0]) { - + if (vert1 == connTriangle[ind0]) { /*--- The ii-index corresponds to a combination of the i and j index and the jj-index corresponds to the j-index. ---*/ - if(vert2 != connTriangle[ind2]) verticesDontMatch = true; - - a = nPoly; b = -1; c = -1; d = 0; e = 0; f = 1; - } - else if(vert1 == connTriangle[ind2]) { - + if (vert2 != connTriangle[ind2]) verticesDontMatch = true; + + a = nPoly; + b = -1; + c = -1; + d = 0; + e = 0; + f = 1; + } else if (vert1 == connTriangle[ind2]) { /*--- The jj-index corresponds to a combination of the i and j index and the ii-index corresponds to the j-index. ---*/ - if(vert2 != connTriangle[ind0]) verticesDontMatch = true; - - a = 0; b = 0; c = 1; d = nPoly; e = -1; f = -1; - } - else { + if (vert2 != connTriangle[ind0]) verticesDontMatch = true; + + a = 0; + b = 0; + c = 1; + d = nPoly; + e = -1; + f = -1; + } else { verticesDontMatch = true; } - } - else if(vert0 == connTriangle[ind2]) { - + } else if (vert0 == connTriangle[ind2]) { /*--- Vert0 coincides with the third vertex of the face connectivity. Check the situation for the neighboring vertices. ---*/ - if(vert1 == connTriangle[ind0]) { - + if (vert1 == connTriangle[ind0]) { /*--- The ii-index corresponds to a combination of the i and j index and the jj-index corresponds with the i-index. ---*/ - if(vert2 != connTriangle[ind1]) verticesDontMatch = true; - - a = nPoly; b = -1; c = -1; d = 0; e = 1; f = 0; - } - else if(vert1 == connTriangle[ind1]) { - + if (vert2 != connTriangle[ind1]) verticesDontMatch = true; + + a = nPoly; + b = -1; + c = -1; + d = 0; + e = 1; + f = 0; + } else if (vert1 == connTriangle[ind1]) { /*--- The jj-index corresponds to a combination of the i and j index and the ii-index corresponds with the i-index. ---*/ - if(vert2 != connTriangle[ind0]) verticesDontMatch = true; - - a = 0; b = 1; c = 0; d = nPoly; e = -1; f = -1; - } - else { + if (vert2 != connTriangle[ind0]) verticesDontMatch = true; + + a = 0; + b = 1; + c = 0; + d = nPoly; + e = -1; + f = -1; + } else { verticesDontMatch = true; } - } - else { + } else { verticesDontMatch = true; } /*--- If non-matching vertices have been found, terminate with an error message. ---*/ - if( verticesDontMatch ) - SU2_MPI::Error("Corner vertices do not match. This should not happen.", - CURRENT_FUNCTION); + if (verticesDontMatch) SU2_MPI::Error("Corner vertices do not match. This should not happen.", CURRENT_FUNCTION); /*--- Copy the connectivity, such that things works out correctly when carrying out the renumbering. ---*/ @@ -3495,15 +3193,14 @@ void CFEMStandardElement::ChangeDirectionTriangleConn(vector &co /*--- Loop over the vertices of the original face to copy the connectivity data. ---*/ unsigned short ind = 0; - for(unsigned short j=0; j<=nPoly; ++j) { - for(unsigned short i=0; i<=(nPoly-j); ++i, ++ind) { - + for (unsigned short j = 0; j <= nPoly; ++j) { + for (unsigned short i = 0; i <= (nPoly - j); ++i, ++ind) { /*--- Determine the ii and jj indices of the target, convert it to a 1D index and shore the modified index in connTriangle. ---*/ - unsigned short ii = a + i*b + j*c; - unsigned short jj = d + i*e + j*f; + unsigned short ii = a + i * b + j * c; + unsigned short jj = d + i * e + j * f; - unsigned short iind = jj*(nPoly+1) + ii - jj*(jj-1)/2; + unsigned short iind = jj * (nPoly + 1) + ii - jj * (jj - 1) / 2; connTriangle[iind] = connTriangleOr[ind]; } @@ -3514,25 +3211,19 @@ void CFEMStandardElement::ChangeDirectionTriangleConn(vector &co /* Public member functions of CFEMStandardInternalFace. */ /*----------------------------------------------------------------------------------*/ -CFEMStandardInternalFace::CFEMStandardInternalFace(unsigned short val_VTK_TypeFace, - unsigned short val_VTK_TypeSide0, - unsigned short val_nPolySide0, - unsigned short val_VTK_TypeSide1, - unsigned short val_nPolySide1, - bool val_constJac, - bool val_swapFaceInElementSide0, - bool val_swapFaceInElementSide1, - CConfig *config, - unsigned short val_orderExact) - - : CFEMStandardElementBase(val_VTK_TypeFace, max(val_nPolySide0, val_nPolySide1), - val_constJac, config, val_orderExact) { +CFEMStandardInternalFace::CFEMStandardInternalFace(unsigned short val_VTK_TypeFace, unsigned short val_VTK_TypeSide0, + unsigned short val_nPolySide0, unsigned short val_VTK_TypeSide1, + unsigned short val_nPolySide1, bool val_constJac, + bool val_swapFaceInElementSide0, bool val_swapFaceInElementSide1, + CConfig* config, unsigned short val_orderExact) + : CFEMStandardElementBase(val_VTK_TypeFace, max(val_nPolySide0, val_nPolySide1), val_constJac, config, + val_orderExact) { /*--- Copy the function arguments to the member variables. ---*/ - nPolyElemSide0 = val_nPolySide0; - VTK_TypeElemSide0 = val_VTK_TypeSide0; - nPolyElemSide1 = val_nPolySide1; - VTK_TypeElemSide1 = val_VTK_TypeSide1; + nPolyElemSide0 = val_nPolySide0; + VTK_TypeElemSide0 = val_VTK_TypeSide0; + nPolyElemSide1 = val_nPolySide1; + VTK_TypeElemSide1 = val_VTK_TypeSide1; swapFaceInElementSide0 = val_swapFaceInElementSide0; swapFaceInElementSide1 = val_swapFaceInElementSide1; @@ -3549,49 +3240,35 @@ CFEMStandardInternalFace::CFEMStandardInternalFace(unsigned short val_VTK_TypeFa /*--- Determine the Lagrangian basis functions and its gradients in the integration points for both sides of the face. ---*/ - switch( VTK_Type ) { + switch (VTK_Type) { case LINE: - LagrangianBasisFunctionAndDerivativesLine(nPolyElemSide0, rIntegration, nDOFsFaceSide0, - rDOFsFaceSide0, matVandermondeInvDummy, - lagBasisFaceIntegrationSide0, + LagrangianBasisFunctionAndDerivativesLine(nPolyElemSide0, rIntegration, nDOFsFaceSide0, rDOFsFaceSide0, + matVandermondeInvDummy, lagBasisFaceIntegrationSide0, drLagBasisFaceIntegrationSide0); - LagrangianBasisFunctionAndDerivativesLine(nPolyElemSide1, rIntegration, nDOFsFaceSide1, - rDOFsFaceSide1, matVandermondeInvDummy, - lagBasisFaceIntegrationSide1, + LagrangianBasisFunctionAndDerivativesLine(nPolyElemSide1, rIntegration, nDOFsFaceSide1, rDOFsFaceSide1, + matVandermondeInvDummy, lagBasisFaceIntegrationSide1, drLagBasisFaceIntegrationSide1); break; case TRIANGLE: - LagrangianBasisFunctionAndDerivativesTriangle(nPolyElemSide0, rIntegration, - sIntegration, nDOFsFaceSide0, - rDOFsFaceSide0, sDOFsFaceSide0, - matVandermondeInvDummy, - lagBasisFaceIntegrationSide0, - drLagBasisFaceIntegrationSide0, + LagrangianBasisFunctionAndDerivativesTriangle(nPolyElemSide0, rIntegration, sIntegration, nDOFsFaceSide0, + rDOFsFaceSide0, sDOFsFaceSide0, matVandermondeInvDummy, + lagBasisFaceIntegrationSide0, drLagBasisFaceIntegrationSide0, dsLagBasisFaceIntegrationSide0); - LagrangianBasisFunctionAndDerivativesTriangle(nPolyElemSide1, rIntegration, - sIntegration, nDOFsFaceSide1, - rDOFsFaceSide1, sDOFsFaceSide1, - matVandermondeInvDummy, - lagBasisFaceIntegrationSide1, - drLagBasisFaceIntegrationSide1, + LagrangianBasisFunctionAndDerivativesTriangle(nPolyElemSide1, rIntegration, sIntegration, nDOFsFaceSide1, + rDOFsFaceSide1, sDOFsFaceSide1, matVandermondeInvDummy, + lagBasisFaceIntegrationSide1, drLagBasisFaceIntegrationSide1, dsLagBasisFaceIntegrationSide1); break; case QUADRILATERAL: - LagrangianBasisFunctionAndDerivativesQuadrilateral(nPolyElemSide0, rIntegration, - sIntegration, nDOFsFaceSide0, - rDOFsFaceSide0, sDOFsFaceSide0, - matVandermondeInvDummy, - lagBasisFaceIntegrationSide0, - drLagBasisFaceIntegrationSide0, + LagrangianBasisFunctionAndDerivativesQuadrilateral(nPolyElemSide0, rIntegration, sIntegration, nDOFsFaceSide0, + rDOFsFaceSide0, sDOFsFaceSide0, matVandermondeInvDummy, + lagBasisFaceIntegrationSide0, drLagBasisFaceIntegrationSide0, dsLagBasisFaceIntegrationSide0); - LagrangianBasisFunctionAndDerivativesQuadrilateral(nPolyElemSide1, rIntegration, - sIntegration, nDOFsFaceSide1, - rDOFsFaceSide0, sDOFsFaceSide1, - matVandermondeInvDummy, - lagBasisFaceIntegrationSide1, - drLagBasisFaceIntegrationSide1, + LagrangianBasisFunctionAndDerivativesQuadrilateral(nPolyElemSide1, rIntegration, sIntegration, nDOFsFaceSide1, + rDOFsFaceSide0, sDOFsFaceSide1, matVandermondeInvDummy, + lagBasisFaceIntegrationSide1, drLagBasisFaceIntegrationSide1, dsLagBasisFaceIntegrationSide1); break; } @@ -3603,85 +3280,67 @@ CFEMStandardInternalFace::CFEMStandardInternalFace(unsigned short val_VTK_TypeFa /*--- Create the transpose versions of lagBasisFaceIntegrationSide0 and lagBasisFaceIntegrationSide1. These are needed for an efficient computation of the residual of the faces. ---*/ - lagBasisFaceIntegrationTransposeSide0.resize(nIntegration*nDOFsFaceSide0); - lagBasisFaceIntegrationTransposeSide1.resize(nIntegration*nDOFsFaceSide1); + lagBasisFaceIntegrationTransposeSide0.resize(nIntegration * nDOFsFaceSide0); + lagBasisFaceIntegrationTransposeSide1.resize(nIntegration * nDOFsFaceSide1); unsigned int ii = 0; - for(unsigned short j=0; j CMeshFEM_DG::ComputeViscousWallADT(const CConfig *config) const { - +std::unique_ptr CMeshFEM_DG::ComputeViscousWallADT(const CConfig* config) const { /*--------------------------------------------------------------------------*/ /*--- Step 1: Create the coordinates and connectivity of the linear ---*/ /*--- subelements of the local boundaries that must be taken ---*/ @@ -50,38 +49,34 @@ std::unique_ptr CMeshFEM_DG::ComputeViscousWallADT(const CConfig vector markerIDs; /* Loop over the boundary markers. */ - for(unsigned short iMarker=0; iMarkerGetMarker_All_KindBC(iMarker) == HEAT_FLUX) || - (config->GetMarker_All_KindBC(iMarker) == ISOTHERMAL) ) { - + if ((config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX) || + (config->GetMarker_All_KindBC(iMarker) == ISOTHERMAL)) { /* Loop over the surface elements of this marker. */ - const vector &surfElem = boundaries[iMarker].surfElem; - for(unsigned long i=0; i& surfElem = boundaries[iMarker].surfElem; + for (unsigned long i = 0; i < surfElem.size(); ++i) { /* Set the flag of the mesh points on this surface to true. */ - for(unsigned short j=0; j CMeshFEM_DG::ComputeViscousWallADT(const CConfig vector surfaceCoor; unsigned long nVertex_SolidWall = 0; - for(unsigned long i=0; i CMeshFEM_DG::ComputeViscousWallADT(const CConfig /*--------------------------------------------------------------------------*/ /* Build the ADT. */ - std::unique_ptr WallADT(new CADTElemClass(nDim, surfaceCoor, surfaceConn, VTK_TypeElem, - markerIDs, elemIDs, true)); + std::unique_ptr WallADT( + new CADTElemClass(nDim, surfaceCoor, surfaceConn, VTK_TypeElem, markerIDs, elemIDs, true)); return WallADT; - } /*! * \brief Set wall distances a specific value */ -void CMeshFEM_DG::SetWallDistance(su2double val){ - - for(unsigned long l=0; l &surfElem = boundaries[iMarker].surfElem; - for(unsigned long l=0; l& surfElem = boundaries[iMarker].surfElem; + for (unsigned long l = 0; l < surfElem.size(); ++l) { /* Get the required data from the corresponding standard element. */ - const unsigned short ind = surfElem[l].indStandardElement; - const unsigned short nInt = standardBoundaryFacesGrid[ind].GetNIntegration(); + const unsigned short ind = surfElem[l].indStandardElement; + const unsigned short nInt = standardBoundaryFacesGrid[ind].GetNIntegration(); /* Allocate the memory for the wall distance for this boundary face. */ surfElem[l].wallDistance.resize(nInt, val); @@ -172,8 +159,7 @@ void CMeshFEM_DG::SetWallDistance(su2double val){ } } -void CMeshFEM_DG::SetWallDistance(CADTElemClass *WallADT, const CConfig* config, unsigned short iZone){ - +void CMeshFEM_DG::SetWallDistance(CADTElemClass* WallADT, const CConfig* config, unsigned short iZone) { /*--------------------------------------------------------------------------*/ /*--- Step 3: Determine the wall distance of the integration points of ---*/ /*--- locally owned volume elements. ---*/ @@ -181,26 +167,23 @@ void CMeshFEM_DG::SetWallDistance(CADTElemClass *WallADT, const CConfig* config, /*--- Loop over the owned elements to compute the wall distance in the integration points. ---*/ - for(unsigned long l=0; lIsEmpty() ) { - + if (!WallADT->IsEmpty()) { /*--- The tree is not empty. Loop over the integration points and determine the wall distance. ---*/ - for(unsigned short i=0; iDetermineNearestElement(coor, dist, markerID, elemID, rankID); volElem[l].wallDistance[i] = dist; @@ -215,25 +198,22 @@ void CMeshFEM_DG::SetWallDistance(CADTElemClass *WallADT, const CConfig* config, /*--- Loop over the owned elements to compute the wall distance in the integration points. ---*/ - for(unsigned long l=0; lIsEmpty() ) { - + if (!WallADT->IsEmpty()) { /*--- The tree is not empty. Loop over the solution DOFs and determine the wall distance. ---*/ - for(unsigned short i=0; iDetermineNearestElement(coor, dist, markerID, elemID, rankID); volElem[l].wallDistanceSolDOFs[i] = dist; @@ -246,27 +226,23 @@ void CMeshFEM_DG::SetWallDistance(CADTElemClass *WallADT, const CConfig* config, /*--- the internal matching faces. ---*/ /*--------------------------------------------------------------------------*/ - for(unsigned long l=0; lIsEmpty() ) { - + if (!WallADT->IsEmpty()) { /*--- The tree is not empty. Loop over the integration points and determine the wall distance. */ - for(unsigned short i=0; iDetermineNearestElement(coor, dist, markerID, elemID, rankID); matchingFaces[l].wallDistance[i] = dist; @@ -281,44 +257,38 @@ void CMeshFEM_DG::SetWallDistance(CADTElemClass *WallADT, const CConfig* config, /*--- Loop over the boundary markers. Make sure to exclude the periodic boundaries, because these are not physical. ---*/ - for(unsigned short iMarker=0; iMarkerGetMarker_All_KindBC(iMarker) == HEAT_FLUX || - config->GetMarker_All_KindBC(iMarker) == ISOTHERMAL; + const bool viscousWall = + config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX || config->GetMarker_All_KindBC(iMarker) == ISOTHERMAL; /* Loop over the boundary faces and determine the wall distances in the integration points. */ - vector &surfElem = boundaries[iMarker].surfElem; - for(unsigned long l=0; l& surfElem = boundaries[iMarker].surfElem; + for (unsigned long l = 0; l < surfElem.size(); ++l) { /* Get the required data from the corresponding standard element. */ - const unsigned short ind = surfElem[l].indStandardElement; - const unsigned short nInt = standardBoundaryFacesGrid[ind].GetNIntegration(); + const unsigned short ind = surfElem[l].indStandardElement; + const unsigned short nInt = standardBoundaryFacesGrid[ind].GetNIntegration(); /* Allocate the memory for the wall distance for this boundary face. */ surfElem[l].wallDistance.resize(nInt); /* Check for an empty tree or a viscous wall. In those case the wall distance is set to zero. */ - if(viscousWall) { - + if (viscousWall) { /* Wall distance must be set to zero. */ - for(unsigned short i=0; iIsEmpty() ) { + for (unsigned short i = 0; i < nInt; ++i) surfElem[l].wallDistance[i] = 0.0; + } else if (!WallADT->IsEmpty()) { /*--- Not a viscous wall boundary, while viscous walls are present. The distance must be computed. Loop over the integration points and do so. ---*/ - for(unsigned short i=0; iDetermineNearestElement(coor, dist, markerID, elemID, rankID); surfElem[l].wallDistance[i] = dist; diff --git a/Common/src/fem/fem_work_estimate_metis.cpp b/Common/src/fem/fem_work_estimate_metis.cpp index 9476452d252..50d50db4d80 100644 --- a/Common/src/fem/fem_work_estimate_metis.cpp +++ b/Common/src/fem/fem_work_estimate_metis.cpp @@ -3,7 +3,7 @@ * \brief This file contains the implementation of the member functions WorkEstimateMetis for the FEM standard elements. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -28,28 +28,22 @@ #include "../../include/fem/fem_standard_element.hpp" -su2double CFEMStandardElement::WorkEstimateMetis(CConfig *config) { - +su2double CFEMStandardElement::WorkEstimateMetis(CConfig* config) { /* TEMPORARY IMPLEMENTATION. */ - return nIntegration + 0.1*nDOFs; + return nIntegration + 0.1 * nDOFs; } -su2double CFEMStandardInternalFace::WorkEstimateMetis(CConfig *config) { - +su2double CFEMStandardInternalFace::WorkEstimateMetis(CConfig* config) { /* TEMPORARY IMPLEMENTATION. */ - return 2.0*nIntegration + 0.05*(nDOFsFaceSide0 + nDOFsFaceSide1); + return 2.0 * nIntegration + 0.05 * (nDOFsFaceSide0 + nDOFsFaceSide1); } -su2double CFEMStandardBoundaryFace::WorkEstimateMetis(CConfig *config) { - +su2double CFEMStandardBoundaryFace::WorkEstimateMetis(CConfig* config) { /* TEMPORARY IMPLEMENTATION. */ - return nIntegration + 0.05*nDOFsFace; + return nIntegration + 0.05 * nDOFsFace; } -su2double CFEMStandardBoundaryFace::WorkEstimateMetisWallFunctions( - CConfig *config, - const unsigned short nPointsWF) { - +su2double CFEMStandardBoundaryFace::WorkEstimateMetisWallFunctions(CConfig* config, const unsigned short nPointsWF) { /* TEMPORARY IMPLEMENTATION. */ - return 0.25*nIntegration*nPointsWF; + return 0.25 * nIntegration * nPointsWF; } diff --git a/Common/src/fem/geometry_structure_fem_part.cpp b/Common/src/fem/geometry_structure_fem_part.cpp index d6871e9c863..ce4fbfa9621 100644 --- a/Common/src/fem/geometry_structure_fem_part.cpp +++ b/Common/src/fem/geometry_structure_fem_part.cpp @@ -2,7 +2,7 @@ * \file geometry_structure_fem_part.cpp * \brief Main subroutines for distributin the grid for the Fluid FEM solver. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -41,54 +41,50 @@ #include /*--- Epsilon definition ---*/ - CFaceOfElement::CFaceOfElement() { - nCornerPoints = 0; + nCornerPoints = 0; cornerPoints[0] = cornerPoints[1] = cornerPoints[2] = cornerPoints[3] = ULONG_MAX; - elemID0 = elemID1 = ULONG_MAX; - nPolyGrid0 = nPolyGrid1 = 0; - nPolySol0 = nPolySol1 = 0; - nDOFsElem0 = nDOFsElem1 = 0; - elemType0 = elemType1 = 0; - faceID0 = faceID1 = 0; - periodicIndex = periodicIndexDonor = 0; - faceIndicator = 0; + elemID0 = elemID1 = ULONG_MAX; + nPolyGrid0 = nPolyGrid1 = 0; + nPolySol0 = nPolySol1 = 0; + nDOFsElem0 = nDOFsElem1 = 0; + elemType0 = elemType1 = 0; + faceID0 = faceID1 = 0; + periodicIndex = periodicIndexDonor = 0; + faceIndicator = 0; JacFaceIsConsideredConstant = false; - elem0IsOwner = false; + elem0IsOwner = false; } -CFaceOfElement::CFaceOfElement(const unsigned short VTK_Type, - const unsigned short nPoly, - const unsigned long *Nodes) { - +CFaceOfElement::CFaceOfElement(const unsigned short VTK_Type, const unsigned short nPoly, const unsigned long* Nodes) { /* Set the default values of the member variables. */ - nCornerPoints = 0; + nCornerPoints = 0; cornerPoints[0] = cornerPoints[1] = cornerPoints[2] = cornerPoints[3] = ULONG_MAX; - elemID0 = elemID1 = ULONG_MAX; - nPolyGrid0 = nPolyGrid1 = 0; - nPolySol0 = nPolySol1 = 0; - nDOFsElem0 = nDOFsElem1 = 0; - elemType0 = elemType1 = 0; - faceID0 = faceID1 = 0; - periodicIndex = periodicIndexDonor = 0; - faceIndicator = 0; + elemID0 = elemID1 = ULONG_MAX; + nPolyGrid0 = nPolyGrid1 = 0; + nPolySol0 = nPolySol1 = 0; + nDOFsElem0 = nDOFsElem1 = 0; + elemType0 = elemType1 = 0; + faceID0 = faceID1 = 0; + periodicIndex = periodicIndexDonor = 0; + faceIndicator = 0; JacFaceIsConsideredConstant = false; - elem0IsOwner = false; + elem0IsOwner = false; /* Determine the face element type and set the corner points accordingly. */ - switch( VTK_Type ) { + switch (VTK_Type) { case LINE: { - nCornerPoints = 2; + nCornerPoints = 2; cornerPoints[0] = Nodes[0]; cornerPoints[1] = Nodes[nPoly]; break; } case TRIANGLE: { - const unsigned short ind2 = (nPoly+1)*(nPoly+2)/2 -1; - nCornerPoints = 3; + const unsigned short ind2 = (nPoly + 1) * (nPoly + 2) / 2 - 1; + nCornerPoints = 3; cornerPoints[0] = Nodes[0]; cornerPoints[1] = Nodes[nPoly]; cornerPoints[2] = Nodes[ind2]; @@ -96,9 +92,9 @@ CFaceOfElement::CFaceOfElement(const unsigned short VTK_Type, } case QUADRILATERAL: { - const unsigned short ind2 = nPoly*(nPoly+1); - const unsigned short ind3 = (nPoly+1)*(nPoly+1) -1; - nCornerPoints = 4; + const unsigned short ind2 = nPoly * (nPoly + 1); + const unsigned short ind3 = (nPoly + 1) * (nPoly + 1) - 1; + nCornerPoints = 4; cornerPoints[0] = Nodes[0]; cornerPoints[1] = Nodes[nPoly]; cornerPoints[2] = Nodes[ind2]; @@ -114,62 +110,60 @@ CFaceOfElement::CFaceOfElement(const unsigned short VTK_Type, } } -bool CFaceOfElement::operator<(const CFaceOfElement &other) const { - if(nCornerPoints != other.nCornerPoints) return nCornerPoints < other.nCornerPoints; +bool CFaceOfElement::operator<(const CFaceOfElement& other) const { + if (nCornerPoints != other.nCornerPoints) return nCornerPoints < other.nCornerPoints; - for(unsigned short i=0; i=2 ? ind - 2 : ind + 2; // Opposite index. + if (nn[1] < nn[ind]) ind = 1; + if (nn[2] < nn[ind]) ind = 2; + if (nn[3] < nn[ind]) ind = 3; - if(nn[indp1] < nn[indm1]) { + unsigned short indm1 = ind == 0 ? 3 : ind - 1; // Next lower index. + unsigned short indp1 = ind == 3 ? 0 : ind + 1; // Next upper index. + unsigned short indp2 = ind >= 2 ? ind - 2 : ind + 2; // Opposite index. + if (nn[indp1] < nn[indm1]) { /* The orientation of the quadrilateral remains the same. Store the new sorted node numbering. */ cornerPoints[0] = nn[ind]; cornerPoints[1] = nn[indp1]; cornerPoints[2] = nn[indp2]; cornerPoints[3] = nn[indm1]; - } - else { - + } else { /* The orientation of the quadrilateral changes. Store the new sorted node numbering and set swapElements to true. */ cornerPoints[0] = nn[ind]; cornerPoints[1] = nn[indm1]; cornerPoints[2] = nn[indp2]; cornerPoints[3] = nn[indp1]; - swapElements = true; + swapElements = true; } break; @@ -252,39 +239,38 @@ void CFaceOfElement::CreateUniqueNumberingWithOrientation(void) { default: { ostringstream message; - message << "Unknown surface element type with " << nCornerPoints - << " corners." << endl; + message << "Unknown surface element type with " << nCornerPoints << " corners." << endl; SU2_MPI::Error(message.str(), CURRENT_FUNCTION); } } /* Swap the element information, if needed. */ - if( swapElements ) { - swap(elemID0, elemID1); + if (swapElements) { + swap(elemID0, elemID1); swap(nPolyGrid0, nPolyGrid1); - swap(nPolySol0, nPolySol1); + swap(nPolySol0, nPolySol1); swap(nDOFsElem0, nDOFsElem1); - swap(elemType0, elemType1); - swap(faceID0, faceID1); + swap(elemType0, elemType1); + swap(faceID0, faceID1); } } -void CBoundaryFace::Copy(const CBoundaryFace &other) { - VTK_Type = other.VTK_Type; - nPolyGrid = other.nPolyGrid; - nDOFsGrid = other.nDOFsGrid; +void CBoundaryFace::Copy(const CBoundaryFace& other) { + VTK_Type = other.VTK_Type; + nPolyGrid = other.nPolyGrid; + nDOFsGrid = other.nDOFsGrid; globalBoundElemID = other.globalBoundElemID; - domainElementID = other.domainElementID; - Nodes = other.Nodes; + domainElementID = other.domainElementID; + Nodes = other.Nodes; } CMatchingFace::CMatchingFace() { nCornerPoints = 0; - nDim = 0; - nPoly = 0; - nDOFsElem = 0; - elemType = 0; - elemID = 0; + nDim = 0; + nPoly = 0; + nDOFsElem = 0; + elemType = 0; + elemID = 0; cornerCoor[0][0] = cornerCoor[0][1] = cornerCoor[0][2] = 0.0; cornerCoor[1][0] = cornerCoor[1][1] = cornerCoor[1][2] = 0.0; @@ -294,10 +280,9 @@ CMatchingFace::CMatchingFace() { tolForMatching = 0.0; } -bool CMatchingFace::operator<(const CMatchingFace &other) const { - +bool CMatchingFace::operator<(const CMatchingFace& other) const { /* First compare the number of corner points. ---*/ - if(nCornerPoints != other.nCornerPoints) return nCornerPoints < other.nCornerPoints; + if (nCornerPoints != other.nCornerPoints) return nCornerPoints < other.nCornerPoints; /*--- Determine the tolerance for comparing both objects. ---*/ const su2double tol = min(tolForMatching, other.tolForMatching); @@ -305,10 +290,9 @@ bool CMatchingFace::operator<(const CMatchingFace &other) const { /*--- Loop over the number of corner points and dimensions and compare the coordinates. If considered different, return true if the current face is considered smaller and false otherwise. ---*/ - for(unsigned short k=0; k tol) - return cornerCoor[k][l] < other.cornerCoor[k][l]; + for (unsigned short k = 0; k < nCornerPoints; ++k) { + for (unsigned short l = 0; l < nDim; ++l) { + if (fabs(cornerCoor[k][l] - other.cornerCoor[k][l]) > tol) return cornerCoor[k][l] < other.cornerCoor[k][l]; } } @@ -316,22 +300,23 @@ bool CMatchingFace::operator<(const CMatchingFace &other) const { return false; } -void CMatchingFace::SortFaceCoordinates(void) { - +void CMatchingFace::SortFaceCoordinates() { /*--- Determine the tolerance for a matching point for this face. This is accomplished by computing the minimum distance between the points of the face, multiplied by a relative tolerance. ---*/ - for(unsigned short k=0; k0; --j) { - + for (unsigned short k = 1; k < nCornerPoints; ++k) { + for (unsigned short j = k; j > 0; --j) { /* Check if cornerCoor[j] is considered less than cornerCoor[j-1]. */ bool lessThan = false; - for(unsigned short l=0; l tolForMatching) { - lessThan = cornerCoor[j][l] < cornerCoor[j-1][l]; + for (unsigned short l = 0; l < nDim; ++l) { + if (fabs(cornerCoor[j][l] - cornerCoor[j - 1][l]) > tolForMatching) { + lessThan = cornerCoor[j][l] < cornerCoor[j - 1][l]; break; } } /* If cornerCoor[j] is less than cornerCoor[j-1] they must be swapped. Otherwise an exit can be made from the j-loop. */ - if( lessThan ) { - for(unsigned short l=0; lGetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE; unsigned short nMarker_Max = config->GetnMarker_Max(); nZone = val_nZone; /*--- Initialize counters for local/global points & elements ---*/ - Global_nPoint = 0; Global_nPointDomain = 0; Global_nElem = 0; - nelem_edge = 0; Global_nelem_edge = 0; - nelem_triangle = 0; Global_nelem_triangle = 0; - nelem_quad = 0; Global_nelem_quad = 0; - nelem_tetra = 0; Global_nelem_tetra = 0; - nelem_hexa = 0; Global_nelem_hexa = 0; - nelem_prism = 0; Global_nelem_prism = 0; - nelem_pyramid = 0; Global_nelem_pyramid = 0; + Global_nPoint = 0; + Global_nPointDomain = 0; + Global_nElem = 0; + nelem_edge = 0; + Global_nelem_edge = 0; + nelem_triangle = 0; + Global_nelem_triangle = 0; + nelem_quad = 0; + Global_nelem_quad = 0; + nelem_tetra = 0; + Global_nelem_tetra = 0; + nelem_hexa = 0; + Global_nelem_hexa = 0; + nelem_prism = 0; + Global_nelem_prism = 0; + nelem_pyramid = 0; + Global_nelem_pyramid = 0; /*--- Allocate memory for the linear partition of the elements of the mesh. These arrays are the size of the number of ranks. ---*/ beg_node = new unsigned long[size]; end_node = new unsigned long[size]; - nPointLinear = new unsigned long[size]; + nPointLinear = new unsigned long[size]; /*--- Open grid file ---*/ @@ -417,23 +407,22 @@ void CPhysicalGeometry::Read_SU2_Format_Parallel_FEM(CConfig *config, /*--- Check the grid ---*/ if (mesh_file.fail()) - SU2_MPI::Error(string("There is no mesh file (CPhysicalGeometry)!! ") + val_mesh_filename, - CURRENT_FUNCTION); + SU2_MPI::Error(string("There is no mesh file (CPhysicalGeometry)!! ") + val_mesh_filename, CURRENT_FUNCTION); /*--- If more than one, find the zone in the mesh file ---*/ if (val_nZone > 1 || time_spectral) { if (time_spectral) { - if (rank == MASTER_NODE) cout << "Reading time spectral instance " << val_iZone+1 << ":" << endl; + if (rank == MASTER_NODE) cout << "Reading time spectral instance " << val_iZone + 1 << ":" << endl; } else { - while (getline (mesh_file,text_line)) { + while (getline(mesh_file, text_line)) { /*--- Search for the current domain ---*/ - position = text_line.find ("IZONE=",0); + position = text_line.find("IZONE=", 0); if (position != string::npos) { - text_line.erase (0,6); + text_line.erase(0, 6); unsigned short jDomain = atoi(text_line.c_str()); - if (jDomain == val_iZone+1) { - if (rank == MASTER_NODE) cout << "Reading zone " << val_iZone+1 << " points:" << endl; + if (jDomain == val_iZone + 1) { + if (rank == MASTER_NODE) cout << "Reading zone " << val_iZone + 1 << " points:" << endl; break; } } @@ -443,27 +432,29 @@ void CPhysicalGeometry::Read_SU2_Format_Parallel_FEM(CConfig *config, /*--- Read grid file with format SU2 ---*/ - while (getline (mesh_file, text_line)) { - + while (getline(mesh_file, text_line)) { /*--- Read the dimension of the problem ---*/ - position = text_line.find ("NDIME=",0); + position = text_line.find("NDIME=", 0); if (position != string::npos) { - if (domain_flag == false) { - text_line.erase (0,6); nDim = atoi(text_line.c_str()); + if (!domain_flag) { + text_line.erase(0, 6); + nDim = atoi(text_line.c_str()); if (rank == MASTER_NODE) { if (nDim == 2) cout << "Two dimensional problem." << endl; if (nDim == 3) cout << "Three dimensional problem." << endl; } domain_flag = true; - } else { break; } + } else { + break; + } } /*--- Read the information about inner elements ---*/ - position = text_line.find ("NELEM=",0); + position = text_line.find("NELEM=", 0); if (position != string::npos) { - text_line.erase (0,6); + text_line.erase(0, 6); stringstream stream_line(text_line); stream_line >> Global_nElem; @@ -473,8 +464,8 @@ void CPhysicalGeometry::Read_SU2_Format_Parallel_FEM(CConfig *config, /*--- Check if the number of cores used is larger than the number of elements. Terminate if this is the case, because it does not make sense to do this. ---*/ - unsigned long nCores = size; // Correct for the number of cores per rank. - if(nCores > Global_nElem) { + unsigned long nCores = size; // Correct for the number of cores per rank. + if (nCores > Global_nElem) { ostringstream message; message << "The number of cores, " << nCores; message << ", is larger than the number of elements, " << Global_nElem << "." << endl; @@ -488,14 +479,14 @@ void CPhysicalGeometry::Read_SU2_Format_Parallel_FEM(CConfig *config, This is a linear partitioning with the addition of a simple load balancing for any remainder elements. ---*/ unsigned long total_elem_accounted = 0; - for(unsigned long i = 0; i < (unsigned long)size; i++) { - nPointLinear[i] = Global_nElem/size; + for (unsigned long i = 0; i < (unsigned long)size; i++) { + nPointLinear[i] = Global_nElem / size; total_elem_accounted = total_elem_accounted + nPointLinear[i]; } /*--- Get the number of remainder elements after the even division ---*/ unsigned long rem_elem = Global_nElem - total_elem_accounted; - for (unsigned long i = 0; i> typeRead; + unsigned long typeRead; + elem_line >> typeRead; unsigned long typeReadErrorMessage = typeRead; unsigned short nPolySol, nPolyGrid; - if(typeRead > 10000) { - nPolySol = typeRead/10000 -1; - typeRead = typeRead%10000; - nPolyGrid = typeRead/100 + 1; - } - else { - nPolyGrid = typeRead/100 + 1; - nPolySol = nPolyGrid; + if (typeRead > 10000) { + nPolySol = typeRead / 10000 - 1; + typeRead = typeRead % 10000; + nPolyGrid = typeRead / 100 + 1; + } else { + nPolyGrid = typeRead / 100 + 1; + nPolySol = nPolyGrid; } - unsigned short VTK_Type = typeRead%100; + unsigned short VTK_Type = typeRead % 100; - unsigned short nDOFsGrid = CFEMStandardElementBase::GetNDOFsStatic(VTK_Type, nPolyGrid, - typeReadErrorMessage); - unsigned short nDOFsSol = CFEMStandardElementBase::GetNDOFsStatic(VTK_Type, nPolySol, - typeReadErrorMessage); + unsigned short nDOFsGrid = CFEMStandardElementBase::GetNDOFsStatic(VTK_Type, nPolyGrid, typeReadErrorMessage); + unsigned short nDOFsSol = CFEMStandardElementBase::GetNDOFsStatic(VTK_Type, nPolySol, typeReadErrorMessage); /*--- Allocate the memory for a new primary grid FEM element if this element must be stored on this rank. ---*/ if ((i >= beg_node[rank]) && (i < end_node[rank])) { - - elem[loc_element_count] = new CPrimalGridFEM(i, VTK_Type, nPolyGrid, nPolySol, - nDOFsGrid, nDOFsSol, nDOFs_tot, - elem_line); + elem[loc_element_count] = + new CPrimalGridFEM(i, VTK_Type, nPolyGrid, nPolySol, nDOFsGrid, nDOFsSol, nDOFs_tot, elem_line); nDOFsGrid_Local += nDOFsGrid; loc_element_count++; } @@ -569,11 +555,9 @@ void CPhysicalGeometry::Read_SU2_Format_Parallel_FEM(CConfig *config, /*--- Create a vector, which contains the global node IDs of the local elements. ---*/ vector nodeIDsElemLoc; nodeIDsElemLoc.reserve(nDOFsGrid_Local); - for(unsigned long i=0; iGetnNodes(); - for(unsigned short j=0; jGetNode(j)); + for (unsigned short j = 0; j < nDOFsElem; ++j) nodeIDsElemLoc.push_back(elem[i]->GetNode(j)); } sort(nodeIDsElemLoc.begin(), nodeIDsElemLoc.end()); @@ -582,7 +566,7 @@ void CPhysicalGeometry::Read_SU2_Format_Parallel_FEM(CConfig *config, nodeIDsElemLoc.erase(lastNode, nodeIDsElemLoc.end()); /*--- Allocate the memory for the coordinates to be stored on this rank. ---*/ - nPoint = nodeIDsElemLoc.size(); + nPoint = nodeIDsElemLoc.size(); nodes = new CPoint(nPoint, nDim); /*--- Open the grid file again and go to the position where @@ -590,37 +574,36 @@ void CPhysicalGeometry::Read_SU2_Format_Parallel_FEM(CConfig *config, mesh_file.open(val_mesh_filename.c_str(), ios::in); if (val_nZone > 1 && !time_spectral) { - while (getline (mesh_file,text_line)) { - position = text_line.find ("IZONE=",0); + while (getline(mesh_file, text_line)) { + position = text_line.find("IZONE=", 0); if (position != string::npos) { - text_line.erase (0,6); + text_line.erase(0, 6); unsigned short jDomain = atoi(text_line.c_str()); - if (jDomain == val_iZone+1) break; + if (jDomain == val_iZone + 1) break; } } } /*--- While loop to read the point information. ---*/ - while (getline (mesh_file, text_line)) { - - position = text_line.find ("NPOIN=",0); + while (getline(mesh_file, text_line)) { + position = text_line.find("NPOIN=", 0); if (position != string::npos) { - text_line.erase (0,6); + text_line.erase(0, 6); stringstream stream_line(text_line); stream_line >> Global_nPoint; /*--- Loop over the global number of points and store the ones that are needed on this processor. ---*/ unsigned long ii = 0; - for(unsigned long i=0; i> Coord[0]; point_line >> Coord[1]; - if (nDim==3) point_line >> Coord[2]; + if (nDim == 3) point_line >> Coord[2]; nodes->SetCoord(ii, Coord); nodes->SetGlobalIndex(ii, i); ++ii; @@ -635,21 +618,19 @@ void CPhysicalGeometry::Read_SU2_Format_Parallel_FEM(CConfig *config, /*--- Determine the faces of the local elements. --- */ vector localFaces; - for(unsigned long k=0; kGetCornerPointsAllFaces(nFaces, nPointsPerFace, faceConn); /*--- Loop over the faces and add them to localFaces. ---*/ - for(unsigned short i=0; i 1 && !time_spectral) { - while (getline (mesh_file,text_line)) { - position = text_line.find ("IZONE=",0); + while (getline(mesh_file, text_line)) { + position = text_line.find("IZONE=", 0); if (position != string::npos) { - text_line.erase (0,6); + text_line.erase(0, 6); unsigned short jDomain = atoi(text_line.c_str()); - if (jDomain == val_iZone+1) break; + if (jDomain == val_iZone + 1) break; } } } /*--- While loop to read the boundary information. ---*/ - while (getline (mesh_file, text_line)) { + while (getline(mesh_file, text_line)) { /*--- Read number of markers ---*/ - position = text_line.find ("NMARK=",0); + position = text_line.find("NMARK=", 0); if (position != string::npos) { - text_line.erase (0,6); + text_line.erase(0, 6); istringstream stream_line(text_line); stream_line >> nMarker; if (rank == MASTER_NODE) cout << nMarker << " surface markers." << endl; config->SetnMarker_All(nMarker); bound = new CPrimalGrid**[nMarker]; - nElem_Bound = new unsigned long [nMarker]; - Tag_to_Marker = new string [nMarker_Max]; + nElem_Bound = new unsigned long[nMarker]; + Tag_to_Marker = new string[nMarker_Max]; - for(unsigned short iMarker = 0 ; iMarker < nMarker; iMarker++) { - getline (mesh_file, text_line); - text_line.erase (0,11); - text_line.erase (remove(text_line.begin(), text_line.end(), ' '), text_line.end()); - text_line.erase (remove(text_line.begin(), text_line.end(), '\r'), text_line.end()); - text_line.erase (remove(text_line.begin(), text_line.end(), '\n'), text_line.end()); + for (unsigned short iMarker = 0; iMarker < nMarker; iMarker++) { + getline(mesh_file, text_line); + text_line.erase(0, 11); + text_line.erase(remove(text_line.begin(), text_line.end(), ' '), text_line.end()); + text_line.erase(remove(text_line.begin(), text_line.end(), '\r'), text_line.end()); + text_line.erase(remove(text_line.begin(), text_line.end(), '\n'), text_line.end()); - Marker_Tag = text_line.c_str(); + Marker_Tag = text_line; /*--- Read the number of elements for this marker. ---*/ - getline (mesh_file, text_line); - text_line.erase (0,13); istringstream nmark_line(text_line); + getline(mesh_file, text_line); + text_line.erase(0, 13); + istringstream nmark_line(text_line); unsigned long nElem_Bound_Global; nmark_line >> nElem_Bound_Global; if (rank == MASTER_NODE) - cout << nElem_Bound_Global << " boundary elements in index "<< iMarker - <<" (Marker = " < boundElems; /*--- Loop over the global boundary faces. ---*/ - for(unsigned long i=0; i> typeRead; - unsigned short nPolyGrid = typeRead/100 + 1; - unsigned short VTK_Type = typeRead%100; + unsigned long typeRead; + bound_line >> typeRead; + unsigned short nPolyGrid = typeRead / 100 + 1; + unsigned short VTK_Type = typeRead % 100; unsigned short nDOFEdgeGrid = nPolyGrid + 1; unsigned short nDOFsGrid = 0; CFaceOfElement thisFace; - thisFace.cornerPoints[0] = 0; thisFace.cornerPoints[1] = nPolyGrid; - switch( VTK_Type ) { + thisFace.cornerPoints[0] = 0; + thisFace.cornerPoints[1] = nPolyGrid; + switch (VTK_Type) { case LINE: nDOFsGrid = nDOFEdgeGrid; thisFace.nCornerPoints = 2; break; case TRIANGLE: - nDOFsGrid = nDOFEdgeGrid*(nDOFEdgeGrid+1)/2; + nDOFsGrid = nDOFEdgeGrid * (nDOFEdgeGrid + 1) / 2; thisFace.nCornerPoints = 3; - thisFace.cornerPoints[2] = nDOFsGrid -1; + thisFace.cornerPoints[2] = nDOFsGrid - 1; break; case QUADRILATERAL: - nDOFsGrid = nDOFEdgeGrid*nDOFEdgeGrid; + nDOFsGrid = nDOFEdgeGrid * nDOFEdgeGrid; thisFace.nCornerPoints = 4; - thisFace.cornerPoints[2] = nPolyGrid*nDOFEdgeGrid; - thisFace.cornerPoints[3] = nDOFsGrid -1; + thisFace.cornerPoints[2] = nPolyGrid * nDOFEdgeGrid; + thisFace.cornerPoints[3] = nDOFsGrid - 1; break; default: ostringstream message; - message << "Unknown FEM boundary element value, " << typeRead - << ", in " << val_mesh_filename; + message << "Unknown FEM boundary element value, " << typeRead << ", in " << val_mesh_filename; SU2_MPI::Error(message.str(), CURRENT_FUNCTION); } vector nodeIDs(nDOFsGrid); - for(unsigned short j=0; j> nodeIDs[j]; + for (unsigned short j = 0; j < nDOFsGrid; ++j) bound_line >> nodeIDs[j]; /*--- Convert the local numbering of thisFace to global numbering and create a unique numbering of these nodes. ---*/ - for(unsigned short j=0; j::iterator low; low = lower_bound(localFaces.begin(), localFaces.end(), thisFace); - if(low != localFaces.end()) { - if( !(thisFace < *low) ) { - + if (low != localFaces.end()) { + if (!(thisFace < *low)) { CBoundaryFace thisBoundFace; - thisBoundFace.VTK_Type = VTK_Type; - thisBoundFace.nPolyGrid = nPolyGrid; - thisBoundFace.nDOFsGrid = nDOFsGrid; + thisBoundFace.VTK_Type = VTK_Type; + thisBoundFace.nPolyGrid = nPolyGrid; + thisBoundFace.nDOFsGrid = nDOFsGrid; thisBoundFace.globalBoundElemID = i; - thisBoundFace.domainElementID = low->elemID0; - thisBoundFace.Nodes = nodeIDs; + thisBoundFace.domainElementID = low->elemID0; + thisBoundFace.Nodes = nodeIDs; boundElems.push_back(thisBoundFace); } @@ -790,15 +771,12 @@ void CPhysicalGeometry::Read_SU2_Format_Parallel_FEM(CConfig *config, /*--- Allocate space for the boundary elements and store the ones whose parent element is stored on this rank. ---*/ nElem_Bound[iMarker] = boundElems.size(); - bound[iMarker] = new CPrimalGrid* [nElem_Bound[iMarker]]; + bound[iMarker] = new CPrimalGrid*[nElem_Bound[iMarker]]; - for(unsigned long i=0; iGetMarker_CfgFile_TagBound(Marker_Tag)] = Marker_Tag; @@ -824,10 +802,8 @@ void CPhysicalGeometry::Read_SU2_Format_Parallel_FEM(CConfig *config, mesh_file.close(); } -void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, - string val_mesh_filename, - unsigned short val_iZone, - unsigned short val_nZone) { +void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig* config, const string& val_mesh_filename, + unsigned short val_iZone, unsigned short val_nZone) { #ifdef HAVE_CGNS /*--- For proper support of the high order elements, at least version 3.3 @@ -837,18 +813,26 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, /*--- Check whether the supplied file is truly a CGNS file. ---*/ int file_type; if (cg_is_cgns(val_mesh_filename.c_str(), &file_type) != CG_OK) - SU2_MPI::Error(val_mesh_filename + string(" is not a CGNS file that can be read."), - CURRENT_FUNCTION); + SU2_MPI::Error(val_mesh_filename + string(" is not a CGNS file that can be read."), CURRENT_FUNCTION); /*--- Initialize counters for local/global points & elements ---*/ - Global_nPoint = 0; Global_nPointDomain = 0; Global_nElem = 0; - nelem_edge = 0; Global_nelem_edge = 0; - nelem_triangle = 0; Global_nelem_triangle = 0; - nelem_quad = 0; Global_nelem_quad = 0; - nelem_tetra = 0; Global_nelem_tetra = 0; - nelem_hexa = 0; Global_nelem_hexa = 0; - nelem_prism = 0; Global_nelem_prism = 0; - nelem_pyramid = 0; Global_nelem_pyramid = 0; + Global_nPoint = 0; + Global_nPointDomain = 0; + Global_nElem = 0; + nelem_edge = 0; + Global_nelem_edge = 0; + nelem_triangle = 0; + Global_nelem_triangle = 0; + nelem_quad = 0; + Global_nelem_quad = 0; + nelem_tetra = 0; + Global_nelem_tetra = 0; + nelem_hexa = 0; + Global_nelem_hexa = 0; + nelem_prism = 0; + Global_nelem_prism = 0; + nelem_pyramid = 0; + Global_nelem_pyramid = 0; /*--------------------------------------------------------------------------*/ /*--- Checking of the file, determine the dimensions, etc. ---*/ @@ -858,20 +842,20 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, These arrays are the size of the number of ranks. ---*/ beg_node = new unsigned long[size]; end_node = new unsigned long[size]; - nPointLinear = new unsigned long[size]; + nPointLinear = new unsigned long[size]; /* Open the CGNS file for reading and check if it went OK. */ int fn; - if(cg_open(val_mesh_filename.c_str(), CG_MODE_READ, &fn) != CG_OK) cg_error_exit(); - if(rank == MASTER_NODE) { + if (cg_open(val_mesh_filename.c_str(), CG_MODE_READ, &fn) != CG_OK) cg_error_exit(); + if (rank == MASTER_NODE) { cout << "Reading the CGNS file: " << val_mesh_filename << "." << endl; } /* Get the number of databases. This is the highest node in the CGNS heirarchy. The current implementation assumes that there is only one database. */ int nbases; - if(cg_nbases(fn, &nbases) != CG_OK) cg_error_exit(); - if(nbases > 1) { + if (cg_nbases(fn, &nbases) != CG_OK) cg_error_exit(); + if (nbases > 1) { ostringstream message; message << "CGNS file contains " << nbases << " databases." << endl; message << "CGNS reader can handle only 1 at the moment." << endl; @@ -881,22 +865,22 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, /* Read the information of the base, especially the number of dimensions. */ char cgnsname[CGNS_STRING_SIZE]; - int cellDim, physDim; + int cellDim, physDim; const int iBase = 1; - if(cg_base_read(fn, iBase, cgnsname, &cellDim, &physDim)) cg_error_exit(); + if (cg_base_read(fn, iBase, cgnsname, &cellDim, &physDim)) cg_error_exit(); nDim = physDim; - if(cellDim != physDim) { + if (cellDim != physDim) { ostringstream message; - message << "The element dimension, " << cellDim - << ", differs from the physical dimension, " << physDim << "." << endl; + message << "The element dimension, " << cellDim << ", differs from the physical dimension, " << physDim << "." + << endl; message << "These should be the same for the DG-FEM solver." << endl; SU2_MPI::Error(message.str(), CURRENT_FUNCTION); } /* Write the info about the number of dimensions. */ - if(rank == MASTER_NODE) { + if (rank == MASTER_NODE) { if (nDim == 2) cout << "Two dimensional problem." << endl; if (nDim == 3) cout << "Three dimensional problem." << endl; } @@ -906,11 +890,11 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, const int iZone = val_iZone + 1; int nzones; - if(cg_nzones(fn, iBase, &nzones) != CG_OK) cg_error_exit(); - if(iZone < 1 || iZone > nzones) { + if (cg_nzones(fn, iBase, &nzones) != CG_OK) cg_error_exit(); + if (iZone < 1 || iZone > nzones) { ostringstream message; - message << "Zone " << iZone << " requested for reading, but there are only " - << nzones << " zones present in the CGNS file." << endl; + message << "Zone " << iZone << " requested for reading, but there are only " << nzones + << " zones present in the CGNS file." << endl; SU2_MPI::Error(message.str(), CURRENT_FUNCTION); } @@ -918,14 +902,13 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, /* Determine the zone type for the requested zone and check if it is unstructured. */ ZoneType_t zoneType; - if(cg_zone_type(fn, iBase, iZone, &zoneType) != CG_OK) cg_error_exit(); - if(zoneType != Unstructured) - SU2_MPI::Error("Structured CGNS zone found while unstructured expected.", - CURRENT_FUNCTION); + if (cg_zone_type(fn, iBase, iZone, &zoneType) != CG_OK) cg_error_exit(); + if (zoneType != Unstructured) + SU2_MPI::Error("Structured CGNS zone found while unstructured expected.", CURRENT_FUNCTION); /* Determine the number of sections for the connectivities in this zone. */ int nsections; - if(cg_nsections(fn, iBase, iZone, &nsections) != CG_OK) cg_error_exit(); + if (cg_nsections(fn, iBase, iZone, &nsections) != CG_OK) cg_error_exit(); /*--------------------------------------------------------------------------*/ /*--- Reading and distributing the volume elements. ---*/ @@ -936,20 +919,19 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, Note that the indices start at 1 in CGNS. */ vector CGNSElemTypes(nsections); - for(int iConn=1; iConn<=nsections; ++iConn) { - CGNSElemTypes[iConn-1].DetermineMetaData(nDim, fn, iBase, iZone, iConn); - if( CGNSElemTypes[iConn-1].volumeConn ) - Global_nElem += CGNSElemTypes[iConn-1].nElem; + for (int iConn = 1; iConn <= nsections; ++iConn) { + CGNSElemTypes[iConn - 1].DetermineMetaData(nDim, fn, iBase, iZone, iConn); + if (CGNSElemTypes[iConn - 1].volumeConn) Global_nElem += CGNSElemTypes[iConn - 1].nElem; } - if((rank == MASTER_NODE) && (size > SINGLE_NODE)) + if ((rank == MASTER_NODE) && (size > SINGLE_NODE)) cout << Global_nElem << " interior elements before parallel partitioning." << endl; /*--- Check if the number of cores used is larger than the number of elements. Terminate if this is the case, because it does not make sense to do this. ---*/ - unsigned long nCores = size; // Correct for the number of cores per rank. - if(nCores > Global_nElem) { + unsigned long nCores = size; // Correct for the number of cores per rank. + if (nCores > Global_nElem) { ostringstream message; message << "The number of cores, " << nCores; message << ", is larger than the number of elements, " << Global_nElem << "." << endl; @@ -963,37 +945,36 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, This is a linear partitioning with the addition of a simple load balancing for any remainder elements. ---*/ unsigned long total_elem_accounted = 0; - for(unsigned long i = 0; i < (unsigned long)size; i++) { - nPointLinear[i] = Global_nElem/size; + for (unsigned long i = 0; i < (unsigned long)size; i++) { + nPointLinear[i] = Global_nElem / size; total_elem_accounted = total_elem_accounted + nPointLinear[i]; } /*--- Get the number of remainder elements after the even division ---*/ const unsigned long rem_elem = Global_nElem - total_elem_accounted; - for (unsigned long i = 0; i indBegOverlap) { - + if (indEndOverlap > indBegOverlap) { /* This rank must read element data from this connectivity section. Determine the offset relative to the start of this section and the number of elements to be read by this rank. */ const unsigned long offsetRank = indBegOverlap - elemCountOld; - const unsigned long nElemRank = indEndOverlap - indBegOverlap; + const unsigned long nElemRank = indEndOverlap - indBegOverlap; /* Read the connectivity range determined above. */ - CGNSElemTypes[iConn].ReadConnectivityRange(fn, iBase, iZone, offsetRank, - nElemRank, beg_node[rank], - elem, locElemCount, nDOFsLoc); + CGNSElemTypes[iConn].ReadConnectivityRange(fn, iBase, iZone, offsetRank, nElemRank, beg_node[rank], elem, + locElemCount, nDOFsLoc); } } } @@ -1022,17 +1001,14 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, /* The global offset of the DOFs must be corrected when running in parallel. Therefore gather the number of DOFs of all the ranks. */ vector nDOFsPerRank(size); - SU2_MPI::Allgather(&nDOFsLoc, 1, MPI_UNSIGNED_LONG, nDOFsPerRank.data(), 1, - MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allgather(&nDOFsLoc, 1, MPI_UNSIGNED_LONG, nDOFsPerRank.data(), 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); /* Determine the offset for the DOFs on this rank. */ unsigned long offsetRank = 0; - for(int i=0; iAddOffsetGlobalDOFs(offsetRank); + for (unsigned long i = 0; i < nElem; ++i) elem[i]->AddOffsetGlobalDOFs(offsetRank); #endif /*--------------------------------------------------------------------------*/ @@ -1042,7 +1018,7 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, /* Determine the global number of vertices in the requested zone. The other size information is not used. */ cgsize_t sizes[3]; - if(cg_zone_read(fn, iBase, iZone, cgnsname, sizes) != CG_OK) cg_error_exit(); + if (cg_zone_read(fn, iBase, iZone, cgnsname, sizes) != CG_OK) cg_error_exit(); Global_nPoint = sizes[0]; /*--- Determine the number of points per rank in cumulative storage format. @@ -1050,71 +1026,69 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, The required coordinates for each rank are later obtained via communication. ---*/ unsigned long totalPointsAccounted = 0; - vector nPointsPerRank(size+1); - for(int i=1; i<=size; ++i) { - nPointsPerRank[i] = Global_nPoint/size; + vector nPointsPerRank(size + 1); + for (int i = 1; i <= size; ++i) { + nPointsPerRank[i] = Global_nPoint / size; totalPointsAccounted += nPointsPerRank[i]; } const unsigned long nPointsRem = Global_nPoint - totalPointsAccounted; - for(unsigned long i=1; i<=nPointsRem; ++i) ++nPointsPerRank[i]; + for (unsigned long i = 1; i <= nPointsRem; ++i) ++nPointsPerRank[i]; nPointsPerRank[0] = 0; - for(int i=0; i > coorBuf(nDim, vector(nPointsRead)); /* Loop over the number of dimensions to read the coordinates. Note that the loop starts at 1 and ends at nDim because CGNS requires this. */ - for(unsigned short iDim=1; iDim<=nDim; ++iDim) { - + for (unsigned short iDim = 1; iDim <= nDim; ++iDim) { /* Determine the data type and name of the coordinate. Copy the name of the coordinate in a string for easier comparison. */ DataType_t datatype; - if(cg_coord_info(fn, iBase, iZone, iDim, &datatype, cgnsname) != CG_OK) - cg_error_exit(); + if (cg_coord_info(fn, iBase, iZone, iDim, &datatype, cgnsname) != CG_OK) cg_error_exit(); string coorname = cgnsname; /* Check the name of the coordinate and determine the index in coorBuf where to store this coordinate. Normally this should be iDim-1. */ unsigned short indC = 0; - if( coorname == "CoordinateX") indC = 0; - else if(coorname == "CoordinateY") indC = 1; - else if(coorname == "CoordinateZ") indC = 2; + if (coorname == "CoordinateX") + indC = 0; + else if (coorname == "CoordinateY") + indC = 1; + else if (coorname == "CoordinateZ") + indC = 2; else - SU2_MPI::Error(string("Unknown coordinate name, ") + coorname + - string(", encountered in the CGNS file."), CURRENT_FUNCTION); + SU2_MPI::Error(string("Unknown coordinate name, ") + coorname + string(", encountered in the CGNS file."), + CURRENT_FUNCTION); /* Easier storage of the range in the CGNS file. */ cgsize_t range_min = nPointsPerRank[rank] + 1; - cgsize_t range_max = nPointsPerRank[rank+1]; + cgsize_t range_max = nPointsPerRank[rank + 1]; /*--- Read the coordinate with the required precision and copy this data to the correct index in coorBuf. ---*/ - switch( datatype ) { + switch (datatype) { case RealSingle: { /* Single precision used. */ vector buf(nPointsRead); - if(cg_coord_read(fn, iBase, iZone, cgnsname, datatype, &range_min, - &range_max, buf.data()) != CG_OK) cg_error_exit(); + if (cg_coord_read(fn, iBase, iZone, cgnsname, datatype, &range_min, &range_max, buf.data()) != CG_OK) + cg_error_exit(); - for(cgsize_t i=0; i buf(nPointsRead); - if(cg_coord_read(fn, iBase, iZone, cgnsname, datatype, &range_min, - &range_max, buf.data()) != CG_OK) cg_error_exit(); + if (cg_coord_read(fn, iBase, iZone, cgnsname, datatype, &range_min, &range_max, buf.data()) != CG_OK) + cg_error_exit(); - for(cgsize_t i=0; i nodeIDsElemLoc; nodeIDsElemLoc.reserve(nDOFsLoc); - for(unsigned long i=0; iGetnNodes(); - for(unsigned short j=0; jGetNode(j)); + for (unsigned short j = 0; j < nDOFsElem; ++j) nodeIDsElemLoc.push_back(elem[i]->GetNode(j)); } sort(nodeIDsElemLoc.begin(), nodeIDsElemLoc.end()); @@ -1145,18 +1118,18 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, nodeIDsElemLoc.erase(lastNode, nodeIDsElemLoc.end()); /*--- Allocate the memory for the coordinates to be stored on this rank. ---*/ - nPoint = nodeIDsElemLoc.size(); + nPoint = nodeIDsElemLoc.size(); nodes = new CPoint(nPoint, nDim); /*--- Store the global ID's of the nodes in such a way that they can be sent to the rank that actually stores the coordinates.. ---*/ vector > nodeBuf(size, vector(0)); - for(unsigned long i=0; i::iterator low; low = lower_bound(nPointsPerRank.begin(), nPointsPerRank.end(), nodeID); cgsize_t rankNode = low - nPointsPerRank.begin(); - if(*low > nodeID) --rankNode; + if (*low > nodeID) --rankNode; nodeBuf[rankNode].push_back(nodeIDsElemLoc[i]); } @@ -1168,13 +1141,13 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, node. ---*/ int nRankSend = 0; vector sendToRank(size, 0); - vector startingIndRanksInNode(size+1); + vector startingIndRanksInNode(size + 1); startingIndRanksInNode[0] = 0; - for(int i=0; i sizeRecv(size, 1); - SU2_MPI::Reduce_scatter(sendToRank.data(), &nRankRecv, sizeRecv.data(), - MPI_INT, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Reduce_scatter(sendToRank.data(), &nRankRecv, sizeRecv.data(), MPI_INT, MPI_SUM, SU2_MPI::GetComm()); /*--- Send out the messages with the global node numbers. Use nonblocking sends to avoid deadlock. ---*/ vector sendReqs(nRankSend); nRankSend = 0; - for(int i=0; i nodeRecvBuf(sizeMess); - coorReturnBuf[i].resize(nDim*sizeMess); + coorReturnBuf[i].resize(nDim * sizeMess); /* Receive the message using a blocking receive. */ - SU2_MPI::Recv(nodeRecvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, - source, rank, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(nodeRecvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, source, rank, SU2_MPI::GetComm(), &status); /*--- Loop over the nodes just received and fill the return communication buffer with the coordinates of the requested nodes. ---*/ - for(int j=0; j= nPointsRead) + if (kk < 0 || kk >= nPointsRead) SU2_MPI::Error("Invalid point requested. This should not happen.", CURRENT_FUNCTION); - for(unsigned short k=0; k coorRecvBuf(nDim*nodeBuf[source].size()); + vector coorRecvBuf(nDim * nodeBuf[source].size()); /* Receive the message using a blocking receive. */ - SU2_MPI::Recv(coorRecvBuf.data(), coorRecvBuf.size(), MPI_DOUBLE, - source, rank+1, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(coorRecvBuf.data(), coorRecvBuf.size(), MPI_DOUBLE, source, rank + 1, SU2_MPI::GetComm(), &status); /*--- Make a distinction between 2D and 3D to store the data of the nodes. This data is created by taking the offset of the source rank into account. In this way the nodes are numbered with increading global node ID. ---*/ - for(unsigned long j=0; jSetCoord(kk, &coorRecvBuf[jj]); @@ -1281,12 +1248,11 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, #else /*--- Sequential mode. Create the data for the points. The global number of points equals the local number of points. ---*/ - nPoint = Global_nPoint; + nPoint = Global_nPoint; nodes = new CPoint(nPoint, nDim); - for(unsigned long i=0; iSetCoord(i, iDim, coorBuf[iDim][i]); + for (unsigned long i = 0; i < nPoint; ++i) { + for (unsigned short iDim = 0; iDim < nDim; ++iDim) nodes->SetCoord(i, iDim, coorBuf[iDim][i]); nodes->SetGlobalIndex(i, i); } @@ -1301,23 +1267,21 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, /*--- Determine the faces of the local elements. --- */ vector localFaces; - for(unsigned long k=0; kGetCornerPointsAllFaces(nFaces, nPointsPerFace, faceConn); /*--- Loop over the faces and add them to localFaces. For consistency between sequential and parallel mode the rank is stored at the position for the second element ID. ---*/ - for(unsigned short i=0; i > faceBuf(size, vector(0)); - for(unsigned long i=0; i::iterator low; low = lower_bound(nPointsPerRank.begin(), nPointsPerRank.end(), nodeID); cgsize_t rankNode = low - nPointsPerRank.begin(); - if(*low > nodeID) --rankNode; + if (*low > nodeID) --rankNode; faceBuf[rankNode].push_back(localFaces[i].nCornerPoints); - for(unsigned short j=0; j faceRecvBuf(sizeMess); - SU2_MPI::Recv(faceRecvBuf.data(), faceRecvBuf.size(), MPI_UNSIGNED_LONG, - source, rank+4, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(faceRecvBuf.data(), faceRecvBuf.size(), MPI_UNSIGNED_LONG, source, rank + 4, SU2_MPI::GetComm(), + &status); /* Loop to extract the data from the receive buffer. */ int ii = 0; - while(ii < sizeMess) { - + while (ii < sizeMess) { /* Store the data for this face in localFaces. The rank where the corresponding element is physically present is stored in the second element ID. Note that it is not necessary to create a unique numbering anymore, because this has already been done before the communication buffer was created. */ CFaceOfElement thisFace; - thisFace.nCornerPoints = (unsigned short) faceRecvBuf[ii++]; - for(unsigned short j=0; j familyNames(nFamilies); - for(int i=1; i<=nFamilies; ++i) { + for (int i = 1; i <= nFamilies; ++i) { int nFamBC, nGeo; - if(cg_family_read(fn, iBase, i, cgnsname, &nFamBC, &nGeo) != CG_OK) cg_error_exit(); - familyNames[i-1] = cgnsname; + if (cg_family_read(fn, iBase, i, cgnsname, &nFamBC, &nGeo) != CG_OK) cg_error_exit(); + familyNames[i - 1] = cgnsname; } /* Determine the number of boundary conditions for this zone. */ int nBCs; - if(cg_nbocos(fn, iBase, iZone, &nBCs) != CG_OK) cg_error_exit(); + if (cg_nbocos(fn, iBase, iZone, &nBCs) != CG_OK) cg_error_exit(); /* Read the names of the boundary conditions and determine their family names. If not family name is specified for a boundary condition, the family name is set to the name of the boundary condition. */ vector BCNames(nBCs), BCFamilyNames(nBCs); - for(int i=1; i<=nBCs; ++i) { - + for (int i = 1; i <= nBCs; ++i) { /* Read the info for this boundary condition. */ BCType_t BCType; PointSetType_t ptsetType; cgsize_t npnts, NormalListSize; int NormalIndex, nDataSet; DataType_t NormalDataType; - if(cg_boco_info(fn, iBase, iZone, i, cgnsname, &BCType, &ptsetType, - &npnts, &NormalIndex, &NormalListSize, &NormalDataType, - &nDataSet) != CG_OK) cg_error_exit(); - BCNames[i-1] = cgnsname; + if (cg_boco_info(fn, iBase, iZone, i, cgnsname, &BCType, &ptsetType, &npnts, &NormalIndex, &NormalListSize, + &NormalDataType, &nDataSet) != CG_OK) + cg_error_exit(); + BCNames[i - 1] = cgnsname; /* Read the possibly family name and set it. If not present, it is equal to BCName. */ - if(cg_goto(fn, iBase, "Zone_t", iZone, "ZoneBC_t", 1, - "BC_t", i, "end") != CG_OK) cg_error_exit(); + if (cg_goto(fn, iBase, "Zone_t", iZone, "ZoneBC_t", 1, "BC_t", i, "end") != CG_OK) cg_error_exit(); int ierr = cg_famname_read(cgnsname); - if(ierr == CG_ERROR) cg_error_exit(); - else if(ierr == CG_OK) BCFamilyNames[i-1] = cgnsname; - else BCFamilyNames[i-1] = BCNames[i-1]; + if (ierr == CG_ERROR) + cg_error_exit(); + else if (ierr == CG_OK) + BCFamilyNames[i - 1] = cgnsname; + else + BCFamilyNames[i - 1] = BCNames[i - 1]; } /*--- Determine the number of different surface connectivities. It is @@ -1491,9 +1451,8 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, vector surfaceNames; vector > surfaceConnIDs; - for(int i=0; i thisSurfaceConn(1, i); surfaceConnIDs.push_back(thisSurfaceConn); @@ -1547,7 +1507,7 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, /* Write a message about the number of surface markers and allocate the memory for the data structures to store the required information. */ nMarker = surfaceNames.size(); - if(rank == MASTER_NODE) cout << nMarker << " surface markers." << endl; + if (rank == MASTER_NODE) cout << nMarker << " surface markers." << endl; config->SetnMarker_All(nMarker); unsigned short nMarker_Max = config->GetnMarker_Max(); @@ -1557,42 +1517,39 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, Tag_to_Marker = new string[nMarker_Max]; /* Loop over the number of markers to read and distribute the connectivities. */ - for(unsigned short iMarker = 0 ; iMarker < nMarker; ++iMarker) { - + for (unsigned short iMarker = 0; iMarker < nMarker; ++iMarker) { /* Easier storage of the entries in CGNSElemTypes that contribute to this boundary marker. */ const int nEntries = surfaceConnIDs[iMarker].size(); - const int *entries = surfaceConnIDs[iMarker].data(); + const int* entries = surfaceConnIDs[iMarker].data(); /* Determine the global number of elements for this boundary marker. */ cgsize_t nElem_Bound_Global = 0; - for(int iConn=0; iConn nBoundElemPerRank(size+1); - for(int i=1; i<=size; ++i) { - nBoundElemPerRank[i] = nElem_Bound_Global/size; + vector nBoundElemPerRank(size + 1); + for (int i = 1; i <= size; ++i) { + nBoundElemPerRank[i] = nElem_Bound_Global / size; totalBoundElemAccounted += nBoundElemPerRank[i]; } const unsigned long nBoundElemRem = nElem_Bound_Global - totalBoundElemAccounted; - for(unsigned long i=1; i<=nBoundElemRem; ++i) ++nBoundElemPerRank[i]; + for (unsigned long i = 1; i <= nBoundElemRem; ++i) ++nBoundElemPerRank[i]; nBoundElemPerRank[0] = 0; - for(int i=0; i indBegOverlap) { + const unsigned long indEndOverlap = min(elemCount, nBoundElemPerRank[rank + 1]); + if (indEndOverlap > indBegOverlap) { /* This rank must read boundary element data from this connectivity section. Determine the offset relative to the start of this section and the number of elements to be read by this rank. */ const unsigned long offsetRank = indBegOverlap - elemCountOld; - const unsigned long nElemRank = indEndOverlap - indBegOverlap; + const unsigned long nElemRank = indEndOverlap - indBegOverlap; /* Read the connectivity range determined above. */ - CGNSElemTypes[entries[iConn]].ReadBoundaryConnectivityRange(fn, iBase, iZone, offsetRank, - nElemRank, nBoundElemPerRank[rank], - locElemCount, boundElems); + CGNSElemTypes[entries[iConn]].ReadBoundaryConnectivityRange(fn, iBase, iZone, offsetRank, nElemRank, + nBoundElemPerRank[rank], locElemCount, boundElems); } } @@ -1631,18 +1585,15 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, communicated to find out where it must be stored. First clear the contents of the faceBuf, such that it can be used again to send data to the appropiate rank. ---*/ - for(int i=0; i::iterator low; low = lower_bound(nPointsPerRank.begin(), nPointsPerRank.end(), nodeID); cgsize_t rankNode = low - nPointsPerRank.begin(); - if(*low > nodeID) --rankNode; + if (*low > nodeID) --rankNode; /*--- Copy the relevant data of this boundary element into faceBuf. ---*/ faceBuf[rankNode].push_back(boundElems[i].VTK_Type); faceBuf[rankNode].push_back(boundElems[i].nPolyGrid); faceBuf[rankNode].push_back(boundElems[i].nDOFsGrid); faceBuf[rankNode].push_back(boundElems[i].globalBoundElemID); - faceBuf[rankNode].insert(faceBuf[rankNode].end(), - boundElems[i].Nodes.begin(), - boundElems[i].Nodes.end()); + faceBuf[rankNode].insert(faceBuf[rankNode].end(), boundElems[i].Nodes.begin(), boundElems[i].Nodes.end()); } /* The contents of boundElems is copied into faceBuf, so it can @@ -1668,42 +1617,39 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, /*--- Determine the number of messages this rank will send and receive. ---*/ nRankSend = 0; - for(int i=0; i boundElemRecvBuf(sizeMess); - SU2_MPI::Recv(boundElemRecvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, - source, rank+5, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(boundElemRecvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, source, rank + 5, SU2_MPI::GetComm(), + &status); /* Loop to extract the data from the receive buffer. */ int ii = 0; - while(ii < sizeMess) { - + while (ii < sizeMess) { /* Store the data for this boundary element. */ - const unsigned short VTK_Type = (unsigned short) boundElemRecvBuf[ii++]; - const unsigned short nPolyGrid = (unsigned short) boundElemRecvBuf[ii++]; - const unsigned short nDOFsGrid = (unsigned short) boundElemRecvBuf[ii++]; + const auto VTK_Type = (unsigned short)boundElemRecvBuf[ii++]; + const auto nPolyGrid = (unsigned short)boundElemRecvBuf[ii++]; + const auto nDOFsGrid = (unsigned short)boundElemRecvBuf[ii++]; const unsigned long globalBoundElemID = boundElemRecvBuf[ii++]; - const unsigned long *Nodes = boundElemRecvBuf.data() + ii; + const unsigned long* Nodes = boundElemRecvBuf.data() + ii; ii += nDOFsGrid; /* Determine the corner nodes and store them in an object of @@ -1739,18 +1684,17 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, low = lower_bound(localFaces.begin(), localFaces.end(), thisFace); bool thisFaceFound = false; - if(low != localFaces.end()) { - if( !(thisFace < *low) ) thisFaceFound = true; + if (low != localFaces.end()) { + if (!(thisFace < *low)) thisFaceFound = true; } - if( !thisFaceFound ) - SU2_MPI::Error("Boundary element not found in list of faces. This is a bug.", - CURRENT_FUNCTION); + if (!thisFaceFound) + SU2_MPI::Error("Boundary element not found in list of faces. This is a bug.", CURRENT_FUNCTION); /* Determine the domain element and the rank where this boundary element should be sent to.. */ const unsigned long domainElementID = low->elemID0; - const int rankBoundElem = (int) low->elemID1; + const int rankBoundElem = (int)low->elemID1; /*--- Store the data for this element in the communication buffer for rankBoundElem. ---*/ @@ -1760,8 +1704,7 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, nodeBuf[rankBoundElem].push_back(globalBoundElemID); nodeBuf[rankBoundElem].push_back(domainElementID); - for(unsigned short j=0; j boundElemRecvBuf(sizeMess); - SU2_MPI::Recv(boundElemRecvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, - source, rank+6, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(boundElemRecvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, source, rank + 6, SU2_MPI::GetComm(), + &status); /* Loop to extract the data from the receive buffer. */ int ii = 0; - while(ii < sizeMess) { - + while (ii < sizeMess) { /* Store the data for this boundary element. */ - const unsigned short VTK_Type = (unsigned short) boundElemRecvBuf[ii++]; - const unsigned short nPolyGrid = (unsigned short) boundElemRecvBuf[ii++]; - const unsigned short nDOFsGrid = (unsigned short) boundElemRecvBuf[ii++]; + const auto VTK_Type = (unsigned short)boundElemRecvBuf[ii++]; + const auto nPolyGrid = (unsigned short)boundElemRecvBuf[ii++]; + const auto nDOFsGrid = (unsigned short)boundElemRecvBuf[ii++]; const unsigned long globalBoundElemID = boundElemRecvBuf[ii++]; - const unsigned long domainElementID = boundElemRecvBuf[ii++]; - const unsigned long *Nodes = boundElemRecvBuf.data() + ii; + const unsigned long domainElementID = boundElemRecvBuf[ii++]; + const unsigned long* Nodes = boundElemRecvBuf.data() + ii; ii += nDOFsGrid; /* Create an object of CBoundaryFace and store it in boundElems. */ CBoundaryFace thisBoundFace; - thisBoundFace.VTK_Type = VTK_Type; - thisBoundFace.nPolyGrid = nPolyGrid; - thisBoundFace.nDOFsGrid = nDOFsGrid; + thisBoundFace.VTK_Type = VTK_Type; + thisBoundFace.nPolyGrid = nPolyGrid; + thisBoundFace.nDOFsGrid = nDOFsGrid; thisBoundFace.globalBoundElemID = globalBoundElemID; - thisBoundFace.domainElementID = domainElementID; + thisBoundFace.domainElementID = domainElementID; thisBoundFace.Nodes.resize(nDOFsGrid); - for(unsigned short j=0; jelemID0; @@ -1888,15 +1822,12 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, /*--- Allocate space for the local boundary elements and copy the data from boundElems into bound. ---*/ nElem_Bound[iMarker] = boundElems.size(); - bound[iMarker] = new CPrimalGrid* [nElem_Bound[iMarker]]; + bound[iMarker] = new CPrimalGrid*[nElem_Bound[iMarker]]; - for(unsigned long i=0; iGetMarker_CfgFile_TagBound(Marker_Tag)] = Marker_Tag; @@ -1916,52 +1847,45 @@ void CPhysicalGeometry::Read_CGNS_Format_Parallel_FEM(CConfig *config, } /* Close the CGNS file again. */ - if(cg_close(fn) != CG_OK) cg_error_exit(); - if(rank == MASTER_NODE) - cout << "Successfully closed the CGNS file." << endl; + if (cg_close(fn) != CG_OK) cg_error_exit(); + if (rank == MASTER_NODE) cout << "Successfully closed the CGNS file." << endl; -#else /* CGNS_VERSION >= 3300 */ +#else /* CGNS_VERSION >= 3300 */ - SU2_MPI::Error("CGNS version 3.3 or higher is necessary for the DG FEM solver", - CURRENT_FUNCTION); + SU2_MPI::Error("CGNS version 3.3 or higher is necessary for the DG FEM solver", CURRENT_FUNCTION); #endif /* CGNS_VERSION >= 3300 */ -#else /* HAVE_CGNS. */ +#else /* HAVE_CGNS. */ - SU2_MPI::Error("SU2 built without CGNS support!!\nTo use CGNS, build SU2 accordingly.", - CURRENT_FUNCTION); + SU2_MPI::Error("SU2 built without CGNS support!!\nTo use CGNS, build SU2 accordingly.", CURRENT_FUNCTION); -#endif /* HAVE_CGNS. */ +#endif /* HAVE_CGNS. */ } -void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { - +void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig* config) { /*--- Initialize the color vector of the elements. ---*/ - for(unsigned long i=0; iSetColor(0); + for (unsigned long i = 0; i < nElem; ++i) elem[i]->SetColor(0); /*--- Determine the faces of the elements. ---*/ vector localFaces; - for(unsigned long k=0; kGetCornerPointsAllFaces(nFaces, nPointsPerFace, faceConn); /*--- Loop over the faces and add them to localFaces. ---*/ - for(unsigned short i=0; iGetNPolySol(); + for (unsigned short j = 0; j < nPointsPerFace[i]; ++j) thisFace.cornerPoints[j] = faceConn[i][j]; + thisFace.elemID0 = beg_node[rank] + k; + thisFace.nPolySol0 = elem[k]->GetNPolySol(); thisFace.nDOFsElem0 = elem[k]->GetNDOFsSol(); - thisFace.elemType0 = elem[k]->GetVTK_Type(); + thisFace.elemType0 = elem[k]->GetVTK_Type(); thisFace.CreateUniqueNumbering(); localFaces.push_back(thisFace); @@ -1976,19 +1900,17 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { overloaded function GetCornerPointsAllFaces, which explains the dimensions of the variables used in the function call. Also note that the periodic boundaries are excluded, because they are not physical. ---*/ - for(unsigned short iMarker=0; iMarkerGetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY) { - for(unsigned long k=0; kGetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY) { + for (unsigned long k = 0; k < nElem_Bound[iMarker]; ++k) { unsigned short nFaces; unsigned short nPointsPerFace[6]; - unsigned long faceConn[6][4]; + unsigned long faceConn[6][4]; bound[iMarker][k]->GetCornerPointsAllFaces(nFaces, nPointsPerFace, faceConn); CFaceOfElement thisFace; thisFace.nCornerPoints = nPointsPerFace[0]; - for(unsigned short j=0; j::iterator low; @@ -2006,13 +1928,13 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { found, the elemID from the second entry is copied to the first entry, the polynomial degree is updated, and the second entry is invalidated. ---*/ unsigned long nFacesLoc = localFaces.size(); - for(unsigned long i=1; i Global_nElem) { + for (unsigned long i = 0; i < nFacesLocOr; ++i) { + if (localFaces[i].elemID0 > Global_nElem) { localFaces[i].nCornerPoints = 4; localFaces[i].cornerPoints[0] = Global_nPoint; localFaces[i].cornerPoints[1] = Global_nPoint; @@ -2045,98 +1967,94 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { was found. For these faces the other neighbor might be stored on a different rank (unless there are non-matching interfaces). ---*/ vector localFacesComm; - for(unsigned long i=0; i Global_nElem) localFacesComm.push_back(localFaces[i]); + for (unsigned long i = 0; i < nFacesLoc; ++i) + if (localFaces[i].elemID1 > Global_nElem) localFacesComm.push_back(localFaces[i]); /*--- Determine the maximum global point ID that occurs in localFacesComm of all ranks. Note that only the first point is taken into account, because this point determines the rank where the face is sent to. ---*/ unsigned long nFacesLocComm = localFacesComm.size(); unsigned long maxPointIDLoc = 0; - for(unsigned long i=0; i facePointsProc(size+1, 0); + vector facePointsProc(size + 1, 0); unsigned long total_point_accounted = 0; - for(unsigned long i=1; i<=(unsigned long)size; ++i) { - facePointsProc[i] = maxPointID/size; - total_point_accounted += facePointsProc[i]; + for (unsigned long i = 1; i <= (unsigned long)size; ++i) { + facePointsProc[i] = maxPointID / size; + total_point_accounted += facePointsProc[i]; } unsigned long rem_point = maxPointID - total_point_accounted; - for(unsigned long i=1; i<=rem_point; ++i) - ++facePointsProc[i]; + for (unsigned long i = 1; i <= rem_point; ++i) ++facePointsProc[i]; - for(unsigned long i=0; i<(unsigned long)size; ++i) - facePointsProc[i+1] += facePointsProc[i]; + for (unsigned long i = 0; i < (unsigned long)size; ++i) facePointsProc[i + 1] += facePointsProc[i]; /*--- Determine the number of faces that has to be sent to each rank. Note that the rank is stored in elemID1, such that the search does not have to be repeated below. ---*/ vector nFacesComm(size, 0); - for(unsigned long i=0; i::iterator low; - low = lower_bound(facePointsProc.begin(), facePointsProc.end(), - localFacesComm[i].cornerPoints[0]); + low = lower_bound(facePointsProc.begin(), facePointsProc.end(), localFacesComm[i].cornerPoints[0]); unsigned long rankFace = low - facePointsProc.begin(); - if(*low > localFacesComm[i].cornerPoints[0]) --rankFace; + if (*low > localFacesComm[i].cornerPoints[0]) --rankFace; ++nFacesComm[rankFace]; localFacesComm[i].elemID1 = rankFace; } /*--- Create the send buffer for the faces to be communicated. ---*/ - vector sendBufFace(9*nFacesLocComm); + vector sendBufFace(9 * nFacesLocComm); vector counter(size); counter[0] = 0; - for(unsigned long i=1; i<(unsigned long)size; ++i) - counter[i] = counter[i-1] + 9*nFacesComm[i-1]; + for (unsigned long i = 1; i < (unsigned long)size; ++i) counter[i] = counter[i - 1] + 9 * nFacesComm[i - 1]; - for(unsigned long i=0; i sizeRecv(size, 1); unsigned long nMessRecv; - SU2_MPI::Reduce_scatter(counter.data(), &nMessRecv, sizeRecv.data(), - MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Reduce_scatter(counter.data(), &nMessRecv, sizeRecv.data(), MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); /*--- Send the data using nonblocking sends. ---*/ - vector commReqs(max(nMessSend,nMessRecv)); + vector commReqs(max(nMessSend, nMessRecv)); nMessSend = 0; unsigned long indSend = 0; - for(unsigned long i=0; i<(unsigned long)size; ++i) { - if( nFacesComm[i] ) { - unsigned long count = 9*nFacesComm[i]; - SU2_MPI::Isend(&sendBufFace[indSend], count, MPI_UNSIGNED_LONG, i, i, - SU2_MPI::GetComm(), &commReqs[nMessSend]); + for (unsigned long i = 0; i < (unsigned long)size; ++i) { + if (nFacesComm[i]) { + unsigned long count = 9 * nFacesComm[i]; + SU2_MPI::Isend(&sendBufFace[indSend], count, MPI_UNSIGNED_LONG, i, i, SU2_MPI::GetComm(), &commReqs[nMessSend]); ++nMessSend; indSend += count; } @@ -2145,10 +2063,10 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { /*--- Loop over the number of ranks from which faces are received. Receive the messages and store them in facesRecv. ---*/ vector facesRecv; - vector nFacesRecv(nMessRecv+1); - vector rankRecv(nMessRecv); + vector nFacesRecv(nMessRecv + 1); + vector rankRecv(nMessRecv); nFacesRecv[0] = 0; - for(unsigned long i=0; i recvBuf(sizeMess); - SU2_MPI::Recv(recvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, - rankRecv[i], rank, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(recvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, rankRecv[i], rank, SU2_MPI::GetComm(), &status); - nFacesRecv[i+1] = nFacesRecv[i] + sizeMess/9; - facesRecv.resize(nFacesRecv[i+1]); + nFacesRecv[i + 1] = nFacesRecv[i] + sizeMess / 9; + facesRecv.resize(nFacesRecv[i + 1]); unsigned long ii = 0; - for(unsigned long j=nFacesRecv[i]; j::iterator low; - low = lower_bound(localFacesComm.begin(), localFacesComm.end(), - facesRecv[j]); - if(facesRecv[j].elemID0 == low->elemID0) { - sendBufFace[ii+5] = low->elemID1; - sendBufFace[ii+6] = low->nPolySol1; - sendBufFace[ii+7] = low->nDOFsElem1; - sendBufFace[ii+8] = low->elemType1; - } - else { - sendBufFace[ii+5] = low->elemID0; - sendBufFace[ii+6] = low->nPolySol0; - sendBufFace[ii+7] = low->nDOFsElem0; - sendBufFace[ii+8] = low->elemType0; + low = lower_bound(localFacesComm.begin(), localFacesComm.end(), facesRecv[j]); + if (facesRecv[j].elemID0 == low->elemID0) { + sendBufFace[ii + 5] = low->elemID1; + sendBufFace[ii + 6] = low->nPolySol1; + sendBufFace[ii + 7] = low->nDOFsElem1; + sendBufFace[ii + 8] = low->elemType1; + } else { + sendBufFace[ii + 5] = low->elemID0; + sendBufFace[ii + 6] = low->nPolySol0; + sendBufFace[ii + 7] = low->nDOFsElem0; + sendBufFace[ii + 8] = low->elemType0; } } unsigned long count = ii - indSend; - SU2_MPI::Isend(&sendBufFace[indSend], count, MPI_UNSIGNED_LONG, rankRecv[i], - rankRecv[i]+1, SU2_MPI::GetComm(), &commReqs[i]); + SU2_MPI::Isend(&sendBufFace[indSend], count, MPI_UNSIGNED_LONG, rankRecv[i], rankRecv[i] + 1, SU2_MPI::GetComm(), + &commReqs[i]); indSend = ii; } - /*--- Loop over the ranks to which I originally sent my face data. The return data contains information about the neighboring element. ---*/ - for(unsigned long i=0; i recvBuf(sizeMess); - SU2_MPI::Recv(recvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, - status.MPI_SOURCE, rank+1, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(recvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, status.MPI_SOURCE, rank + 1, SU2_MPI::GetComm(), + &status); sizeMess /= 9; unsigned long jj = 0; - for(unsigned long j=0; j<(unsigned long) sizeMess; ++j, jj+=9) { + for (unsigned long j = 0; j < (unsigned long)sizeMess; ++j, jj += 9) { CFaceOfElement thisFace; - thisFace.nCornerPoints = recvBuf[jj]; - thisFace.cornerPoints[0] = recvBuf[jj+1]; - thisFace.cornerPoints[1] = recvBuf[jj+2]; - thisFace.cornerPoints[2] = recvBuf[jj+3]; - thisFace.cornerPoints[3] = recvBuf[jj+4]; + thisFace.nCornerPoints = recvBuf[jj]; + thisFace.cornerPoints[0] = recvBuf[jj + 1]; + thisFace.cornerPoints[1] = recvBuf[jj + 2]; + thisFace.cornerPoints[2] = recvBuf[jj + 3]; + thisFace.cornerPoints[3] = recvBuf[jj + 4]; vector::iterator low; low = lower_bound(localFaces.begin(), localFaces.end(), thisFace); - low->elemID1 = recvBuf[jj+5]; - low->nPolySol1 = recvBuf[jj+6]; - low->nDOFsElem1 = recvBuf[jj+7]; - low->elemType1 = recvBuf[jj+8]; + low->elemID1 = recvBuf[jj + 5]; + low->nPolySol1 = recvBuf[jj + 6]; + low->nDOFsElem1 = recvBuf[jj + 7]; + low->elemType1 = recvBuf[jj + 8]; } } @@ -2286,10 +2200,10 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { DeterminePeriodicFacesFEMGrid(config, localFaces); /*--- Determine the total number of non-matching faces in the grid. ---*/ - nFacesLoc = localFaces.size(); + nFacesLoc = localFaces.size(); nFacesLocOr = nFacesLoc; - for(unsigned long i=0; i Global_nElem) { + for (unsigned long i = 0; i < nFacesLocOr; ++i) { + if (localFaces[i].elemID1 > Global_nElem) { localFaces[i].nCornerPoints = 4; localFaces[i].cornerPoints[0] = Global_nPoint; localFaces[i].cornerPoints[1] = Global_nPoint; @@ -2300,7 +2214,7 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { } nFacesLocOr -= nFacesLoc; - if( nFacesLocOr ) { + if (nFacesLocOr) { sort(localFaces.begin(), localFaces.end()); localFaces.resize(nFacesLoc); } @@ -2308,10 +2222,9 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { unsigned long nNonMatchingFaces = nFacesLocOr; #ifdef HAVE_MPI - SU2_MPI::Reduce(&nFacesLocOr, &nNonMatchingFaces, 1, MPI_UNSIGNED_LONG, - MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Reduce(&nFacesLocOr, &nNonMatchingFaces, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); #endif - if(rank == MASTER_NODE && nNonMatchingFaces) { + if (rank == MASTER_NODE && nNonMatchingFaces) { cout << "There are " << nNonMatchingFaces << " non-matching faces in the grid. " << "These are ignored in the partitioning." << endl; } @@ -2330,65 +2243,51 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { /*--- Determine the ownership of the internal faces, i.e. which adjacent element is responsible for computing the fluxes through the face. ---*/ - for(unsigned long i=0; iGetTimeLevel(); unsigned short timeLevel1; - if(localFaces[i].elemID1 >= beg_node[rank] && - localFaces[i].elemID1 < beg_node[rank]+nElem) { - + if (localFaces[i].elemID1 >= beg_node[rank] && localFaces[i].elemID1 < beg_node[rank] + nElem) { unsigned long elemID1 = localFaces[i].elemID1 - beg_node[rank]; timeLevel1 = elem[elemID1]->GetTimeLevel(); - } - else { - - map::const_iterator MI; + } else { + map::const_iterator MI; MI = mapExternalElemIDToTimeLevel.find(localFaces[i].elemID1); - if(MI == mapExternalElemIDToTimeLevel.end()) + if (MI == mapExternalElemIDToTimeLevel.end()) SU2_MPI::Error("Entry not found in mapExternalElemIDToTimeLevel", CURRENT_FUNCTION); timeLevel1 = MI->second.short0; } /* Check if both elements have the same time level. */ - if(timeLevel0 == timeLevel1) { - + if (timeLevel0 == timeLevel1) { /* Same time level, hence both elements can own the face. First check whether elemID0 == elemID1 (which happens for periodic problems with only one element in the periodic direction), because this is a special case. */ - if(localFaces[i].elemID0 == localFaces[i].elemID1) { - + if (localFaces[i].elemID0 == localFaces[i].elemID1) { /* This face occurs twice, but should be owned only once. Base this decision on the periodic index. */ localFaces[i].elem0IsOwner = localFaces[i].periodicIndex < localFaces[i].periodicIndexDonor; - } - else { - + } else { /* Different elements on both sides of the face. The ownership decision below makes an attempt to spread the workload evenly. */ const unsigned long sumElemID = localFaces[i].elemID0 + localFaces[i].elemID1; - if( sumElemID%2 ) + if (sumElemID % 2) localFaces[i].elem0IsOwner = localFaces[i].elemID0 < localFaces[i].elemID1; else localFaces[i].elem0IsOwner = localFaces[i].elemID0 > localFaces[i].elemID1; } - } - else { - + } else { /* The time level of both elements differ. The element with the smallest time level must be the owner of the element. */ localFaces[i].elem0IsOwner = timeLevel0 < timeLevel1; } - } - else { - + } else { /* Non-matching face. Give the ownership to element 0. */ localFaces[i].elem0IsOwner = true; } @@ -2397,21 +2296,20 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { /*--- All the matching face information is known now, including periodic faces. Store the information of the neighbors in the data structure for the local elements. ---*/ - for(unsigned long k=0; kGetCornerPointsAllFaces(nFaces, nPointsPerFace, faceConn); elem[k]->InitializeNeighbors(nFaces); - for(unsigned short i=0; iGetNPolySol(); + for (unsigned short j = 0; j < nPointsPerFace[i]; ++j) thisFace.cornerPoints[j] = faceConn[i][j]; + thisFace.elemID0 = beg_node[rank] + k; + thisFace.nPolySol0 = elem[k]->GetNPolySol(); thisFace.nDOFsElem0 = elem[k]->GetNDOFsSol(); thisFace.CreateUniqueNumbering(); @@ -2419,19 +2317,17 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { vector::iterator low; low = lower_bound(localFaces.begin(), localFaces.end(), thisFace); - if(low != localFaces.end() ) { - if( !(thisFace < *low) ) { - if(low->elemID0 == thisFace.elemID0) { + if (low != localFaces.end()) { + if (!(thisFace < *low)) { + if (low->elemID0 == thisFace.elemID0) { elem[k]->SetNeighbor_Elements(low->elemID1, i); elem[k]->SetOwnerFace(low->elem0IsOwner, i); - } - else { + } else { elem[k]->SetNeighbor_Elements(low->elemID0, i); elem[k]->SetOwnerFace(!(low->elem0IsOwner), i); } - if(low->periodicIndex > 0) - elem[k]->SetPeriodicIndex(low->periodicIndex-1, i); + if (low->periodicIndex > 0) elem[k]->SetPeriodicIndex(low->periodicIndex - 1, i); } } } @@ -2440,21 +2336,20 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { /*--- Create the vector of vectors that describe the connectivity of the graph. First the faces. ---*/ vector > adjacency(nElem, vector(0)); - for(unsigned long i=0; i= 0 && ii < (long) nElem) - adjacency[ii].push_back(localFaces[i].elemID0); + if (ii >= 0 && ii < (long)nElem) adjacency[ii].push_back(localFaces[i].elemID0); } } /* It is possible that some neighbors appear multiple times due to e.g. periodic boundary conditions. ParMETIS is not able to deal with this situation, hence these multiple entries must be removed. */ - for(unsigned long i=0; i::iterator lastEntry; lastEntry = unique(adjacency[i].begin(), adjacency[i].end()); @@ -2464,12 +2359,12 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { /* Due to periodic boundary conditions it is also possible that self entries are present. ParMETIS is not able to deal with self entries, hence they must be removed as well. */ - for(unsigned long i=0; i additionalExternalEntriesGraph; - for(unsigned short iMarker=0; iMarkerGetDomainElement(); - const unsigned long elemID = globalElemID - beg_node[rank]; + const unsigned long elemID = globalElemID - beg_node[rank]; /* Get the number of donor elements for the wall function treatment and the pointer to the array which stores this info. */ const unsigned short nDonors = bound[iMarker][l]->GetNDonorsWallFunctions(); - const unsigned long *donors = bound[iMarker][l]->GetDonorsWallFunctions(); + const unsigned long* donors = bound[iMarker][l]->GetDonorsWallFunctions(); /* Loop over the number of donors and add the entry in the graph, if not already present. */ - for(unsigned short i=0; i= beg_node[rank] && - donors[i] < beg_node[rank]+nElem) { - + if (donors[i] >= beg_node[rank] && donors[i] < beg_node[rank] + nElem) { /* Donor is stored locally. Add the entry to the graph and sort it afterwards. */ const unsigned long localDonorID = donors[i] - beg_node[rank]; adjacency[localDonorID].push_back(globalElemID); sort(adjacency[localDonorID].begin(), adjacency[localDonorID].end()); - } - else { - + } else { /* Donor is stored externally. Store the graph entry in additionalExternalEntriesGraph. */ additionalExternalEntriesGraph.push_back(donors[i]); @@ -2538,50 +2425,47 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { vector > sendBufsGraphData(size, vector(0)); vector sendToRank(size, 0); - for(unsigned long i=0; i= beg_node[size-1]) rankElem = size-1; + if (elemID >= beg_node[size - 1]) + rankElem = size - 1; else { - const unsigned long *low; - low = lower_bound(beg_node, beg_node+size, elemID); + const unsigned long* low; + low = lower_bound(beg_node, beg_node + size, elemID); rankElem = low - beg_node; - if(*low > elemID) --rankElem; + if (*low > elemID) --rankElem; } sendBufsGraphData[rankElem].push_back(additionalExternalEntriesGraph[i]); - sendBufsGraphData[rankElem].push_back(additionalExternalEntriesGraph[i+1]); + sendBufsGraphData[rankElem].push_back(additionalExternalEntriesGraph[i + 1]); sendToRank[rankElem] = 1; } /*-- Determine to how many ranks this rank will send data and from how many ranks it will receive data. ---*/ int nRankSend = 0; - for(int i=0; i sizeSend(size, 1); - SU2_MPI::Reduce_scatter(sendToRank.data(), &nRankRecv, sizeSend.data(), - MPI_INT, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Reduce_scatter(sendToRank.data(), &nRankRecv, sizeSend.data(), MPI_INT, MPI_SUM, SU2_MPI::GetComm()); /* Send the data using non-blocking sends. */ vector sendReqs(nRankSend); nRankSend = 0; - for(int i=0; i recvBuf(sizeMess); - SU2_MPI::Recv(recvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, - source, rank, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(recvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, source, rank, SU2_MPI::GetComm(), &status); /* Loop over the contents of the receive buffer and update the graph accordingly. */ - for(int j=0; j vwgt(2*nElem); + vector vwgt(2 * nElem); vector > adjwgt(nElem, vector(0)); - for(unsigned long i=0; i SINGLE_NODE) - { + if (size > SINGLE_NODE) { /*--- The scalar variables and the options array for the call to ParMETIS. ---*/ - idx_t wgtflag = 3; // Weights on both the vertices and edges. - idx_t numflag = 0; // C-numbering. - idx_t ncon = 2; // Number of constraints. - real_t ubvec[] = {1.05, 1.05}; // Tolerances for the vertex weights, recommended value is 1.05. - idx_t nparts = (idx_t)size; // Number of subdomains. Must be number of MPI ranks. - idx_t options[METIS_NOPTIONS]; // Just use the default options. + idx_t wgtflag = 3; // Weights on both the vertices and edges. + idx_t numflag = 0; // C-numbering. + idx_t ncon = 2; // Number of constraints. + real_t ubvec[] = {1.05, 1.05}; // Tolerances for the vertex weights, recommended value is 1.05. + auto nparts = (idx_t)size; // Number of subdomains. Must be number of MPI ranks. + idx_t options[METIS_NOPTIONS]; // Just use the default options. METIS_SetDefaultOptions(options); options[1] = 0; /*--- Determine the array, which stores the distribution of the graph nodes over the ranks. ---*/ - vector vtxdist(size+1); + vector vtxdist(size + 1); vtxdist[0] = 0; - for(int i=0; i xadjPar(nElem+1); + vector xadjPar(nElem + 1); xadjPar[0] = 0; - for(unsigned long i=0; i adjacencyPar(xadjPar[nElem]); unsigned long ii = 0; - for(unsigned long i=0; i vwgtPar(nElem*ncon); - for(unsigned long i=0; i vwgtPar(nElem * ncon); + for (unsigned long i = 0; i < nElem * ncon; ++i) vwgtPar[i] = (idx_t)ceil(vwgt[i]); /* Create the adjacency weight in ParMETIS format. */ vector adjwgtPar(xadjPar[nElem]); ii = 0; - for(unsigned long i=0; i tpwgts(size*ncon, 1.0/((real_t)size)); + vector tpwgts(size * ncon, 1.0 / ((real_t)size)); /*--- Calling ParMETIS ---*/ vector part(nElem); @@ -2687,24 +2562,21 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { idx_t edgecut; MPI_Comm comm = SU2_MPI::GetComm(); - ParMETIS_V3_PartKway(vtxdist.data(), xadjPar.data(), adjacencyPar.data(), - vwgtPar.data(), adjwgtPar.data(), &wgtflag, &numflag, - &ncon, &nparts, tpwgts.data(), ubvec, options, - &edgecut, part.data(), &comm); + ParMETIS_V3_PartKway(vtxdist.data(), xadjPar.data(), adjacencyPar.data(), vwgtPar.data(), adjwgtPar.data(), + &wgtflag, &numflag, &ncon, &nparts, tpwgts.data(), ubvec, options, &edgecut, part.data(), + &comm); if (rank == MASTER_NODE) { cout << " graph partitioning complete ("; cout << edgecut << " edge cuts)." << endl; } /*--- Set the color of the elements to the outcome of ParMETIS. ---*/ - for(unsigned long i=0; iSetColor(part[i]); + for (unsigned long i = 0; i < nElem; ++i) elem[i]->SetColor(part[i]); } -#else /* HAVE_PARMETIS */ +#else /* HAVE_PARMETIS */ - if(size > SINGLE_NODE) - { + if (size > SINGLE_NODE) { if (rank == MASTER_NODE) { cout << endl; cout << "--------------------- WARNING -------------------------------" << endl; @@ -2715,46 +2587,40 @@ void CPhysicalGeometry::SetColorFEMGrid_Parallel(CConfig *config) { } /* Set the color to the current rank. */ - for(unsigned long i=0; iSetColor(rank); + for (unsigned long i = 0; i < nElem; ++i) elem[i]->SetColor(rank); } -#endif /* HAVE_PARMETIS */ +#endif /* HAVE_PARMETIS */ -#endif /* HAVE_MPI */ +#endif /* HAVE_MPI */ } -void CPhysicalGeometry::DeterminePeriodicFacesFEMGrid(CConfig *config, - vector &localFaces) { - +void CPhysicalGeometry::DeterminePeriodicFacesFEMGrid(CConfig* config, vector& localFaces) { /*--- Determine a mapping from the global point ID to the local index of the points. ---*/ - map globalPointIDToLocalInd; - for(unsigned i=0; i globalPointIDToLocalInd; + for (unsigned i = 0; i < nPoint; ++i) { globalPointIDToLocalInd[nodes->GetGlobalIndex(i)] = i; } /*--- Loop over the number of markers present in the grid and check for a periodic one. ---*/ - for(unsigned short iMarker=0; iMarkerGetnMarker_All(); ++iMarker) { - if(config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { - + for (unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); ++iMarker) { + if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { /*--- Determine the donor marker and the transformation from the current marker to the donor marker. ---*/ unsigned short jMarker = config->GetMarker_Periodic_Donor(config->GetMarker_All_TagBound(iMarker)); auto center = config->GetPeriodicRotCenter(config->GetMarker_All_TagBound(iMarker)); auto angles = config->GetPeriodicRotAngles(config->GetMarker_All_TagBound(iMarker)); - auto trans = config->GetPeriodicTranslation(config->GetMarker_All_TagBound(iMarker)); + auto trans = config->GetPeriodicTranslation(config->GetMarker_All_TagBound(iMarker)); /*--- Store (center+trans) as it is constant and will be added on. ---*/ - su2double translation[] = {center[0] + trans[0], - center[1] + trans[1], - center[2] + trans[2]}; + su2double translation[] = {center[0] + trans[0], center[1] + trans[1], center[2] + trans[2]}; /*--- Store angles separately for clarity. Compute sines/cosines. ---*/ su2double theta = angles[0]; - su2double phi = angles[1]; - su2double psi = angles[2]; + su2double phi = angles[1]; + su2double psi = angles[2]; su2double cosTheta = cos(theta), cosPhi = cos(phi), cosPsi = cos(psi); su2double sinTheta = sin(theta), sinPhi = sin(phi), sinPsi = sin(psi); @@ -2762,17 +2628,17 @@ void CPhysicalGeometry::DeterminePeriodicFacesFEMGrid(CConfig *co /*--- Compute the rotation matrix. Note that the implicit ordering is rotation about the x-axis, y-axis, then z-axis. ---*/ su2double rotMatrix[3][3]; - rotMatrix[0][0] = cosPhi*cosPsi; - rotMatrix[1][0] = cosPhi*sinPsi; + rotMatrix[0][0] = cosPhi * cosPsi; + rotMatrix[1][0] = cosPhi * sinPsi; rotMatrix[2][0] = -sinPhi; - rotMatrix[0][1] = sinTheta*sinPhi*cosPsi - cosTheta*sinPsi; - rotMatrix[1][1] = sinTheta*sinPhi*sinPsi + cosTheta*cosPsi; - rotMatrix[2][1] = sinTheta*cosPhi; + rotMatrix[0][1] = sinTheta * sinPhi * cosPsi - cosTheta * sinPsi; + rotMatrix[1][1] = sinTheta * sinPhi * sinPsi + cosTheta * cosPsi; + rotMatrix[2][1] = sinTheta * cosPhi; - rotMatrix[0][2] = cosTheta*sinPhi*cosPsi + sinTheta*sinPsi; - rotMatrix[1][2] = cosTheta*sinPhi*sinPsi - sinTheta*cosPsi; - rotMatrix[2][2] = cosTheta*cosPhi; + rotMatrix[0][2] = cosTheta * sinPhi * cosPsi + sinTheta * sinPsi; + rotMatrix[1][2] = cosTheta * sinPhi * sinPsi - sinTheta * cosPsi; + rotMatrix[2][2] = cosTheta * cosPhi; /*--- Define the vector to store the faces of the donor. Initialize its size to the number of local donor faces. ---*/ @@ -2784,41 +2650,38 @@ void CPhysicalGeometry::DeterminePeriodicFacesFEMGrid(CConfig *co /*------------------------------------------------------------------*/ /*--- Loop over the local elements of the donor marker. ---*/ - for(unsigned long k=0; kGetCornerPointsAllFaces(nFaces, nPointsPerFace, faceConn); /*--- Search for this face in localFaces. It must be present. ---*/ CFaceOfElement thisFace; thisFace.nCornerPoints = nPointsPerFace[0]; - for(unsigned short j=0; j::iterator low; low = lower_bound(localFaces.begin(), localFaces.end(), thisFace); /*--- Store the relevant data in facesDonor. ---*/ - facesDonor[k].nDim = nDim; + facesDonor[k].nDim = nDim; facesDonor[k].nCornerPoints = nPointsPerFace[0]; - facesDonor[k].elemID = low->elemID0; - facesDonor[k].nPoly = low->nPolySol0; - facesDonor[k].nDOFsElem = low->nDOFsElem0; - facesDonor[k].elemType = low->elemType0; + facesDonor[k].elemID = low->elemID0; + facesDonor[k].nPoly = low->nPolySol0; + facesDonor[k].nDOFsElem = low->nDOFsElem0; + facesDonor[k].elemType = low->elemType0; - for(unsigned short j=0; j::const_iterator MI; + for (unsigned short j = 0; j < nPointsPerFace[0]; ++j) { + map::const_iterator MI; MI = globalPointIDToLocalInd.find(faceConn[0][j]); unsigned long ind = MI->second; - for(unsigned l=0; lGetCoord(ind, l); + for (unsigned l = 0; l < nDim; ++l) facesDonor[k].cornerCoor[j][l] = nodes->GetCoord(ind, l); } /*--- Create the tolerance for this face and sort the coordinates. ---*/ @@ -2833,21 +2696,19 @@ void CPhysicalGeometry::DeterminePeriodicFacesFEMGrid(CConfig *co #ifdef HAVE_MPI /*--- Check if this is indeed a parallel simulation. ---*/ - if(size > 1) { - + if (size > 1) { /*--- Allocate the memory for the size arrays in Allgatherv. ---*/ vector recvCounts(size), displs(size); /*--- Create the values of recvCounts for the gather of the facesDonor. ---*/ int sizeLocal = facesDonor.size(); - SU2_MPI::Allgather(&sizeLocal, 1, MPI_INT, recvCounts.data(), 1, - MPI_INT, SU2_MPI::GetComm()); + SU2_MPI::Allgather(&sizeLocal, 1, MPI_INT, recvCounts.data(), 1, MPI_INT, SU2_MPI::GetComm()); /*--- Create the data for the vector displs from the known values of recvCounts. Also determine the total size of the data. ---*/ displs[0] = 0; - for(int i=1; i shortLocBuf(5*sizeLocal); - vector longLocBuf(sizeLocal); - vector doubleLocBuf(13*sizeLocal); + vector shortLocBuf(5 * sizeLocal); + vector longLocBuf(sizeLocal); + vector doubleLocBuf(13 * sizeLocal); - unsigned long cS=0, cL=0, cD=0; - for(vector::const_iterator fIt =facesDonor.begin(); - fIt!=facesDonor.end(); ++fIt) { + unsigned long cS = 0, cL = 0, cD = 0; + for (vector::const_iterator fIt = facesDonor.begin(); fIt != facesDonor.end(); ++fIt) { shortLocBuf[cS++] = fIt->nCornerPoints; shortLocBuf[cS++] = fIt->nDim; shortLocBuf[cS++] = fIt->nPoly; @@ -2891,43 +2751,42 @@ void CPhysicalGeometry::DeterminePeriodicFacesFEMGrid(CConfig *co /*--- Gather the faces from all ranks to all ranks. Use Allgatherv for this purpose. ---*/ - vector shortGlobBuf(5*sizeGlobal); - vector longGlobBuf(sizeGlobal); - vector doubleGlobBuf(13*sizeGlobal); + vector shortGlobBuf(5 * sizeGlobal); + vector longGlobBuf(sizeGlobal); + vector doubleGlobBuf(13 * sizeGlobal); - SU2_MPI::Allgatherv(longLocBuf.data(), longLocBuf.size(), MPI_UNSIGNED_LONG, - longGlobBuf.data(), recvCounts.data(), displs.data(), - MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allgatherv(longLocBuf.data(), longLocBuf.size(), MPI_UNSIGNED_LONG, longGlobBuf.data(), + recvCounts.data(), displs.data(), MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); - for(int i=0; i::iterator fIt =facesDonor.begin(); - fIt!=facesDonor.end(); ++fIt) { + for (auto fIt = facesDonor.begin(); fIt != facesDonor.end(); ++fIt) { fIt->nCornerPoints = shortGlobBuf[cS++]; - fIt->nDim = shortGlobBuf[cS++]; - fIt->nPoly = shortGlobBuf[cS++]; - fIt->nDOFsElem = shortGlobBuf[cS++]; - fIt->elemType = shortGlobBuf[cS++]; + fIt->nDim = shortGlobBuf[cS++]; + fIt->nPoly = shortGlobBuf[cS++]; + fIt->nDOFsElem = shortGlobBuf[cS++]; + fIt->elemType = shortGlobBuf[cS++]; fIt->elemID = longGlobBuf[cL++]; @@ -2961,21 +2820,19 @@ void CPhysicalGeometry::DeterminePeriodicFacesFEMGrid(CConfig *co /*------------------------------------------------------------------*/ /*--- Loop over the local faces of this boundary marker. ---*/ - for(unsigned long k=0; kGetCornerPointsAllFaces(nFaces, nPointsPerFace, faceConn); /*--- Search for this face in localFaces. It must be present. ---*/ CFaceOfElement thisFace; thisFace.nCornerPoints = nPointsPerFace[0]; - for(unsigned short j=0; j::iterator low; @@ -2989,29 +2846,29 @@ void CPhysicalGeometry::DeterminePeriodicFacesFEMGrid(CConfig *co such that a search can be carried out in donorFaces. Note that the periodic transformation must be applied to the coordinates. ---*/ CMatchingFace thisMatchingFace; - thisMatchingFace.nDim = nDim; + thisMatchingFace.nDim = nDim; thisMatchingFace.nCornerPoints = nPointsPerFace[0]; - thisMatchingFace.elemID = low->elemID0; - thisMatchingFace.nPoly = low->nPolySol0; - thisMatchingFace.nDOFsElem = low->nDOFsElem0; - thisMatchingFace.elemType = low->elemType0; + thisMatchingFace.elemID = low->elemID0; + thisMatchingFace.nPoly = low->nPolySol0; + thisMatchingFace.nDOFsElem = low->nDOFsElem0; + thisMatchingFace.elemType = low->elemType0; - for(unsigned short j=0; j::const_iterator MI; + for (unsigned short j = 0; j < nPointsPerFace[0]; ++j) { + map::const_iterator MI; MI = globalPointIDToLocalInd.find(faceConn[0][j]); unsigned long ind = MI->second; - const su2double *coor = nodes->GetCoord(ind); + const su2double* coor = nodes->GetCoord(ind); - const su2double dx = coor[0] - center[0]; - const su2double dy = coor[1] - center[1]; + const su2double dx = coor[0] - center[0]; + const su2double dy = coor[1] - center[1]; const su2double dz = nDim == 3 ? coor[2] - center[2] : su2double(0.0); - thisMatchingFace.cornerCoor[j][0] = rotMatrix[0][0]*dx + rotMatrix[0][1]*dy - + rotMatrix[0][2]*dz + translation[0]; - thisMatchingFace.cornerCoor[j][1] = rotMatrix[1][0]*dx + rotMatrix[1][1]*dy - + rotMatrix[1][2]*dz + translation[1]; - thisMatchingFace.cornerCoor[j][2] = rotMatrix[2][0]*dx + rotMatrix[2][1]*dy - + rotMatrix[2][2]*dz + translation[2]; + thisMatchingFace.cornerCoor[j][0] = + rotMatrix[0][0] * dx + rotMatrix[0][1] * dy + rotMatrix[0][2] * dz + translation[0]; + thisMatchingFace.cornerCoor[j][1] = + rotMatrix[1][0] * dx + rotMatrix[1][1] * dy + rotMatrix[1][2] * dz + translation[1]; + thisMatchingFace.cornerCoor[j][2] = + rotMatrix[2][0] * dx + rotMatrix[2][1] * dy + rotMatrix[2][2] * dz + translation[2]; } /*--- Create the tolerance for this face and sort the coordinates. ---*/ @@ -3022,12 +2879,12 @@ void CPhysicalGeometry::DeterminePeriodicFacesFEMGrid(CConfig *co vector::const_iterator donorLow; donorLow = lower_bound(facesDonor.begin(), facesDonor.end(), thisMatchingFace); - if(donorLow != facesDonor.end()) { - if( !(thisMatchingFace < *donorLow) ) { - low->elemID1 = donorLow->elemID; - low->nPolySol1 = donorLow->nPoly; - low->nDOFsElem1 = donorLow->nDOFsElem; - low->elemType1 = donorLow->elemType; + if (donorLow != facesDonor.end()) { + if (!(thisMatchingFace < *donorLow)) { + low->elemID1 = donorLow->elemID; + low->nPolySol1 = donorLow->nPoly; + low->nDOFsElem1 = donorLow->nDOFsElem; + low->elemType1 = donorLow->elemType; low->periodicIndexDonor = jMarker + 1; } } @@ -3036,15 +2893,14 @@ void CPhysicalGeometry::DeterminePeriodicFacesFEMGrid(CConfig *co } } -void CPhysicalGeometry::DetermineFEMConstantJacobiansAndLenScale(CConfig *config) { - +void CPhysicalGeometry::DetermineFEMConstantJacobiansAndLenScale(CConfig* config) { /* Definition of the object that is used to carry out the BLAS calls. */ CBlasStructure blasFunctions; /*--- Determine a mapping from the global point ID to the local index of the points. ---*/ - map globalPointIDToLocalInd; - for(unsigned long i=0; i globalPointIDToLocalInd; + for (unsigned long i = 0; i < nPoint; ++i) { globalPointIDToLocalInd[nodes->GetGlobalIndex(i)] = i; } @@ -3054,8 +2910,7 @@ void CPhysicalGeometry::DetermineFEMConstantJacobiansAndLenScale(CConfig *config vector standardVolumeElements, standardFaceElements; /*--- Loop over the local volume elements. ---*/ - for(unsigned long i=0; iGetVTK_Type(); + unsigned short VTK_Type = elem[i]->GetVTK_Type(); unsigned short nPolyGrid = elem[i]->GetNPolyGrid(); unsigned long ii; - for(ii=0; ii vecResult(sizeResult), vecRHS(sizeRHS); /* Store the coordinates in vecRHS. */ unsigned long jj = 0; - for(unsigned short j=0; jGetNode(j); - map::const_iterator MI = globalPointIDToLocalInd.find(nodeID); + map::const_iterator MI = globalPointIDToLocalInd.find(nodeID); unsigned long ind = MI->second; - for(unsigned short k=0; kGetCoord(ind, k); + for (unsigned short k = 0; k < nDim; ++k, ++jj) vecRHS[jj] = nodes->GetCoord(ind, k); } /*--- Get the pointer to the matrix storage of the basis functions and its derivatives. The first nDOFs*nIntegration entries of this matrix correspond to the interpolation data to the integration points and are not needed. Hence this part is skipped. ---*/ - const su2double *matBasisInt = standardVolumeElements[ii].GetMatBasisFunctionsIntegration(); - const su2double *matDerBasisInt = &matBasisInt[nDOFs*nIntegration]; + const su2double* matBasisInt = standardVolumeElements[ii].GetMatBasisFunctionsIntegration(); + const su2double* matDerBasisInt = &matBasisInt[nDOFs * nIntegration]; /* Carry out the matrix matrix product. The last argument is NULL, such that this gemm call is ignored in the profiling. Replace by config if if should be included. */ - blasFunctions.gemm(nDim*nIntegration, nDim, nDOFs, matDerBasisInt, - vecRHS.data(), vecResult.data(), nullptr); + blasFunctions.gemm(nDim * nIntegration, nDim, nDOFs, matDerBasisInt, vecRHS.data(), vecResult.data(), nullptr); /*--- Compute the Jacobians in the integration points and determine the minimum and maximum values. Make a distinction between a 2D and 3D element. ---*/ su2double jacMin = 1.e+25, jacMax = -1.e+25; - switch( nDim ) { + switch (nDim) { case 2: { - /* 2D computation. Store the offset between the r and s derivatives. */ - const unsigned int off = 2*nIntegration; + const unsigned int off = 2 * nIntegration; /*--- Loop over the integration points to compute the Jacobians. ---*/ - for(unsigned short j=0; jSetJacobianConsideredConstant(constJacobian); /*------------------------------------------------------------------------*/ @@ -3180,7 +3030,7 @@ void CPhysicalGeometry::DetermineFEMConstantJacobiansAndLenScale(CConfig *config of this element. ---*/ unsigned short nFaces; unsigned short nPointsPerFace[6]; - unsigned long faceConn[6][4]; + unsigned long faceConn[6][4]; elem[i]->GetCornerPointsAllFaces(nFaces, nPointsPerFace, faceConn); @@ -3190,99 +3040,111 @@ void CPhysicalGeometry::DetermineFEMConstantJacobiansAndLenScale(CConfig *config /*--- Loop over the number of faces of this element. ---*/ su2double jacFaceMax = 0.0; - for(unsigned short j=0; j normalsFace((nDim+1)*nIntegration); + vector normalsFace((nDim + 1) * nIntegration); /*--- Compute the unit normals in the integration points. Make a distinction between two and three dimensions. ---*/ - switch( nDim ) { + switch (nDim) { case 2: { - /*--- Two dimensional case, for which the faces are edges. The normal is the vector normal to the tangent vector of the edge. Loop over the integration points. ---*/ - for(unsigned short k=0; k= 0.999999 && - maxRatioLenFaceNormals <= 1.000001; + constJacobian = minCosAngleFaceNormals >= 0.999999 && maxRatioLenFaceNormals <= 1.000001; elem[i]->SetJacobianConstantFace(constJacobian, j); @@ -3336,36 +3196,33 @@ void CPhysicalGeometry::DetermineFEMConstantJacobiansAndLenScale(CConfig *config /*--- of all the reference elements used in this code. ---*/ /*------------------------------------------------------------------------*/ - const su2double lenScale = 2.0*jacMin/jacFaceMax; + const su2double lenScale = 2.0 * jacMin / jacFaceMax; elem[i]->SetLengthScale(lenScale); } } -void CPhysicalGeometry::DetermineDonorElementsWallFunctions(CConfig *config) { - +void CPhysicalGeometry::DetermineDonorElementsWallFunctions(CConfig* config) { /*--------------------------------------------------------------------------*/ /*--- Step 1: Check whether wall functions are used at all. ---*/ /*--------------------------------------------------------------------------*/ bool wallFunctions = false; - for(unsigned short iMarker=0; iMarkerGetMarker_All_KindBC(iMarker)) { case ISOTHERMAL: case HEAT_FLUX: { const string Marker_Tag = config->GetMarker_All_TagBound(iMarker); - if(config->GetWallFunction_Treatment(Marker_Tag) != WALL_FUNCTIONS::NONE) - wallFunctions = true; + if (config->GetWallFunction_Treatment(Marker_Tag) != WALL_FUNCTIONS::NONE) wallFunctions = true; break; } - default: /* Just to avoid a compiler warning. */ + default: /* Just to avoid a compiler warning. */ break; } } /* If no wall functions are used, nothing needs to be done and a return can be made. */ - if( !wallFunctions ) return; + if (!wallFunctions) return; /*--------------------------------------------------------------------------*/ /*--- Step 2: Build the ADT of the linear sub-elements of the locally ---*/ @@ -3374,8 +3231,8 @@ void CPhysicalGeometry::DetermineDonorElementsWallFunctions(CConfig *config) { /* Determine a mapping from the global point ID to the local index of the points. */ - map globalPointIDToLocalInd; - for(unsigned long i=0; i globalPointIDToLocalInd; + for (unsigned long i = 0; i < nPoint; ++i) { globalPointIDToLocalInd[nodes->GetGlobalIndex(i)] = i; } @@ -3385,65 +3242,60 @@ void CPhysicalGeometry::DetermineDonorElementsWallFunctions(CConfig *config) { /* Define the vectors, which store the mapping from the subelement to the parent element, subelement ID within the parent element, the element type and the connectivity of the subelements. */ - vector parentElement; + vector parentElement; vector subElementIDInParent; vector VTK_TypeElem; - vector elemConn; + vector elemConn; /* Loop over the local volume elements to create the connectivity of the linear sub-elements. */ - for(unsigned long l=0; lGetVTK_Type(); - unsigned short nPolyGrid = elem[l]->GetNPolyGrid(); + unsigned short nPolyGrid = elem[l]->GetNPolyGrid(); unsigned long ii; - for(ii=0; iiGetGlobalElemID()); subElementIDInParent.push_back(jj); VTK_TypeElem.push_back(VTK_Type[i]); - for(unsigned short k=0; kGetNode(connSubElems[i][kk]); - map::const_iterator MI; + map::const_iterator MI; MI = globalPointIDToLocalInd.find(nodeID); elemConn.push_back(MI->second); @@ -3454,17 +3306,15 @@ void CPhysicalGeometry::DetermineDonorElementsWallFunctions(CConfig *config) { /* Store the coordinates of the locally stored nodes in the format expected by the ADT. */ - vector volCoor(nDim*nPoint); + vector volCoor(nDim * nPoint); unsigned long jj = 0; - for(unsigned long l=0; lGetCoord(l, k); + for (unsigned long l = 0; l < nPoint; ++l) { + for (unsigned short k = 0; k < nDim; ++k, ++jj) volCoor[jj] = nodes->GetCoord(l, k); } /* Build the local ADT. */ - CADTElemClass localVolumeADT(nDim, volCoor, elemConn, VTK_TypeElem, - subElementIDInParent, parentElement, false); + CADTElemClass localVolumeADT(nDim, volCoor, elemConn, VTK_TypeElem, subElementIDInParent, parentElement, false); /* Release the memory of the vectors used to build the ADT. To make sure that all the memory is deleted, the swap function is used. */ @@ -3483,53 +3333,46 @@ void CPhysicalGeometry::DetermineDonorElementsWallFunctions(CConfig *config) { and exchange coordinates for the integration points for which no donor element was found in the locally stored volume elements. */ vector markerIDGlobalSearch; - vector boundaryElemIDGlobalSearch; - vector coorExGlobalSearch; - + vector boundaryElemIDGlobalSearch; + vector coorExGlobalSearch; /* Define the standard boundary faces for the solution and the grid. */ - vector standardBoundaryFacesSol, - standardBoundaryFacesGrid; + vector standardBoundaryFacesSol, standardBoundaryFacesGrid; /* Loop over the markers and select the ones for which a wall function treatment must be carried out. */ - for(unsigned short iMarker=0; iMarkerGetMarker_All_KindBC(iMarker)) { case ISOTHERMAL: case HEAT_FLUX: { const string Marker_Tag = config->GetMarker_All_TagBound(iMarker); - if(config->GetWallFunction_Treatment(Marker_Tag) != WALL_FUNCTIONS::NONE) { - + if (config->GetWallFunction_Treatment(Marker_Tag) != WALL_FUNCTIONS::NONE) { /* Retrieve the floating point information for this boundary marker. The exchange location is the first element of this array. */ - const su2double *doubleInfo = config->GetWallFunction_DoubleInfo(Marker_Tag); + const su2double* doubleInfo = config->GetWallFunction_DoubleInfo(Marker_Tag); /* Loop over the local boundary elements for this marker. */ - for(unsigned long l=0; lGetVTK_Type(); - const unsigned long elemID = bound[iMarker][l]->GetDomainElement() - - beg_node[rank]; + const unsigned short VTK_Type = bound[iMarker][l]->GetVTK_Type(); + const unsigned long elemID = bound[iMarker][l]->GetDomainElement() - beg_node[rank]; const unsigned short nPolyGrid = bound[iMarker][l]->GetNPolyGrid(); - const unsigned short nPolySol = elem[elemID]->GetNPolySol(); - const unsigned short VTK_Elem = elem[elemID]->GetVTK_Type(); + const unsigned short nPolySol = elem[elemID]->GetNPolySol(); + const unsigned short VTK_Elem = elem[elemID]->GetVTK_Type(); /* Get the corner points of the boundary element. Note that this is an overloaded function, hence the arguments that allow for multiple faces. */ unsigned short nFaces; unsigned short nPointsPerFace[6]; - unsigned long faceConn[6][4]; + unsigned long faceConn[6][4]; bound[iMarker][l]->GetCornerPointsAllFaces(nFaces, nPointsPerFace, faceConn); /* Create an object of CFaceOfElement to store the information. */ CFaceOfElement boundaryFace; boundaryFace.nCornerPoints = nPointsPerFace[0]; - for(unsigned short i=0; i coorBoundFace(nDim*nDOFs); + vector coorBoundFace(nDim * nDOFs); ii = 0; - for(unsigned short j=0; jGetNode(j); - map::const_iterator MI; + map::const_iterator MI; MI = globalPointIDToLocalInd.find(nodeID); nodeID = MI->second; - for(unsigned short k=0; kGetCoord(nodeID, k); + for (unsigned short k = 0; k < nDim; ++k, ++ii) coorBoundFace[ii] = nodes->GetCoord(nodeID, k); } /* Set the multiplication factor for the normal, such that @@ -3630,39 +3461,40 @@ void CPhysicalGeometry::DetermineDonorElementsWallFunctions(CConfig *config) { /* Allocate the memory for the exchange locations corresponding to the integration points of this face. */ - vector coorExchange(nDim*nInt); + vector coorExchange(nDim * nInt); /* Make a distinction between 2D and 3D to compute the actual coordinates of the exchange locations. */ - switch(nDim) { + switch (nDim) { case 2: { /* Two dimensional computation. Loop over the integration points to compute the corresponding exchange coordinates. */ - for(unsigned short i=0; i donorElementsFace; - for(unsigned short i=0; i recvCounts(size), displs(size); - int nLocalSearchPoints = (int) markerIDGlobalSearch.size(); + int nLocalSearchPoints = (int)markerIDGlobalSearch.size(); - SU2_MPI::Allgather(&nLocalSearchPoints, 1, MPI_INT, recvCounts.data(), 1, - MPI_INT, SU2_MPI::GetComm()); + SU2_MPI::Allgather(&nLocalSearchPoints, 1, MPI_INT, recvCounts.data(), 1, MPI_INT, SU2_MPI::GetComm()); displs[0] = 0; - for(int i=1; i 0) { - + if (nGlobalSearchPoints > 0) { /* Create a cumulative storage version of recvCounts. */ - vector nSearchPerRank(size+1); + vector nSearchPerRank(size + 1); nSearchPerRank[0] = 0; - for(int i=0; i bufMarkerIDGlobalSearch(nGlobalSearchPoints); - SU2_MPI::Allgatherv(markerIDGlobalSearch.data(), nLocalSearchPoints, - MPI_UNSIGNED_SHORT, bufMarkerIDGlobalSearch.data(), - recvCounts.data(), displs.data(), MPI_UNSIGNED_SHORT, + SU2_MPI::Allgatherv(markerIDGlobalSearch.data(), nLocalSearchPoints, MPI_UNSIGNED_SHORT, + bufMarkerIDGlobalSearch.data(), recvCounts.data(), displs.data(), MPI_UNSIGNED_SHORT, SU2_MPI::GetComm()); - vector bufBoundaryElemIDGlobalSearch(nGlobalSearchPoints); - SU2_MPI::Allgatherv(boundaryElemIDGlobalSearch.data(), nLocalSearchPoints, - MPI_UNSIGNED_LONG, bufBoundaryElemIDGlobalSearch.data(), - recvCounts.data(), displs.data(), MPI_UNSIGNED_LONG, + SU2_MPI::Allgatherv(boundaryElemIDGlobalSearch.data(), nLocalSearchPoints, MPI_UNSIGNED_LONG, + bufBoundaryElemIDGlobalSearch.data(), recvCounts.data(), displs.data(), MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); - for(int i=0; i bufCoorExGlobalSearch(nDim*nGlobalSearchPoints); - SU2_MPI::Allgatherv(coorExGlobalSearch.data(), nDim*nLocalSearchPoints, - MPI_DOUBLE, bufCoorExGlobalSearch.data(), - recvCounts.data(), displs.data(), MPI_DOUBLE, - SU2_MPI::GetComm()); + for (int i = 0; i < size; ++i) { + recvCounts[i] *= nDim; + displs[i] *= nDim; + } + vector bufCoorExGlobalSearch(nDim * nGlobalSearchPoints); + SU2_MPI::Allgatherv(coorExGlobalSearch.data(), nDim * nLocalSearchPoints, MPI_DOUBLE, bufCoorExGlobalSearch.data(), + recvCounts.data(), displs.data(), MPI_DOUBLE, SU2_MPI::GetComm()); /* Buffers to store the return information. */ vector markerIDReturn; - vector boundaryElemIDReturn; - vector volElemIDDonorReturn; + vector boundaryElemIDReturn; + vector volElemIDDonorReturn; /* Loop over the number of global search points to check if these points are contained in the volume elements of this rank. The loop is carried @@ -3838,21 +3663,18 @@ void CPhysicalGeometry::DetermineDonorElementsWallFunctions(CConfig *config) { that were not found earlier on this rank. The vector recvCounts is used as storage for the number of search items that must be returned to the other ranks. */ - for(int rankID=0; rankID commReqs(3*nRankSend); + vector commReqs(3 * nRankSend); nRankSend = 0; - for(int i=0; i bufMarkerIDReturn(sizeMess); - vector bufBoundaryElemIDReturn(sizeMess); - vector bufVolElemIDDonorReturn(sizeMess); + vector bufBoundaryElemIDReturn(sizeMess); + vector bufVolElemIDDonorReturn(sizeMess); /* Receive the three messages using blocking receives. */ - SU2_MPI::Recv(bufMarkerIDReturn.data(), sizeMess, MPI_UNSIGNED_SHORT, - source, rank, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(bufMarkerIDReturn.data(), sizeMess, MPI_UNSIGNED_SHORT, source, rank, SU2_MPI::GetComm(), &status); - SU2_MPI::Recv(bufBoundaryElemIDReturn.data(), sizeMess, MPI_UNSIGNED_LONG, - source, rank+1, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(bufBoundaryElemIDReturn.data(), sizeMess, MPI_UNSIGNED_LONG, source, rank + 1, SU2_MPI::GetComm(), + &status); - SU2_MPI::Recv(bufVolElemIDDonorReturn.data(), sizeMess, MPI_UNSIGNED_LONG, - source, rank+2, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(bufVolElemIDDonorReturn.data(), sizeMess, MPI_UNSIGNED_LONG, source, rank + 2, SU2_MPI::GetComm(), + &status); /* Loop over the data just received and add it to the wall function donor information of the corresponding boundary element. */ - for(int j=0; jAddDonorWallFunctions(volID); } @@ -3945,22 +3763,20 @@ void CPhysicalGeometry::DetermineDonorElementsWallFunctions(CConfig *config) { /* Loop again over the boundary elements of the marker for which a wall function treatment must be used and make remove the multiple entries of the donor information. */ - for(unsigned short iMarker=0; iMarkerGetMarker_All_KindBC(iMarker)) { case ISOTHERMAL: case HEAT_FLUX: { const string Marker_Tag = config->GetMarker_All_TagBound(iMarker); - if(config->GetWallFunction_Treatment(Marker_Tag) != WALL_FUNCTIONS::NONE) { - - for(unsigned long l=0; lGetWallFunction_Treatment(Marker_Tag) != WALL_FUNCTIONS::NONE) { + for (unsigned long l = 0; l < nElem_Bound[iMarker]; ++l) bound[iMarker][l]->RemoveMultipleDonorsWallFunctions(); } break; } - default: /* Just to avoid a compiler warning. */ + default: /* Just to avoid a compiler warning. */ break; } } @@ -3969,30 +3785,24 @@ void CPhysicalGeometry::DetermineDonorElementsWallFunctions(CConfig *config) { #endif } -void CPhysicalGeometry::DetermineTimeLevelElements( - CConfig *config, - const vector &localFaces, - map &mapExternalElemIDToTimeLevel) { - +void CPhysicalGeometry::DetermineTimeLevelElements(CConfig* config, const vector& localFaces, + map& mapExternalElemIDToTimeLevel) { /*--------------------------------------------------------------------------*/ /*--- Step 1: Initialize the map mapExternalElemIDToTimeLevel. ---*/ /*--------------------------------------------------------------------------*/ /*--- Initialize the time level of external elements to zero. First the externals from the faces. ---*/ - for(vector::const_iterator FI =localFaces.begin(); - FI!=localFaces.end(); ++FI) { - if(FI->elemID1 < Global_nElem) { // Safeguard against non-matching faces. - - if(FI->elemID1 < beg_node[rank] || - FI->elemID1 >= beg_node[rank]+nElem) { + for (auto FI = localFaces.begin(); FI != localFaces.end(); ++FI) { + if (FI->elemID1 < Global_nElem) { // Safeguard against non-matching faces. + if (FI->elemID1 < beg_node[rank] || FI->elemID1 >= beg_node[rank] + nElem) { /* This element is an external element. Store it in the map mapExternalElemIDToTimeLevel if not already done so. */ - map::iterator MI; + map::iterator MI; MI = mapExternalElemIDToTimeLevel.find(FI->elemID1); - if(MI == mapExternalElemIDToTimeLevel.end()) - mapExternalElemIDToTimeLevel[FI->elemID1] = CUnsignedShort2T(0,0); + if (MI == mapExternalElemIDToTimeLevel.end()) + mapExternalElemIDToTimeLevel[FI->elemID1] = CUnsignedShort2T(0, 0); } } } @@ -4006,40 +3816,36 @@ void CPhysicalGeometry::DetermineTimeLevelElements( /*--- Add the externals from the wall function donors. Loop over the boundary elements of all markers. ---*/ - for(unsigned short iMarker=0; iMarkerGetNDonorsWallFunctions(); - const unsigned long *donors = bound[iMarker][l]->GetDonorsWallFunctions(); + const unsigned long* donors = bound[iMarker][l]->GetDonorsWallFunctions(); /* Loop over the number of donors and add the externals to mapExternalElemIDToTimeLevel, if not already present. */ - for(unsigned short i=0; i= beg_node[rank]+nElem) { - - map::iterator MI; + for (unsigned short i = 0; i < nDonors; ++i) { + if (donors[i] < beg_node[rank] || donors[i] >= beg_node[rank] + nElem) { + map::iterator MI; MI = mapExternalElemIDToTimeLevel.find(donors[i]); - if(MI == mapExternalElemIDToTimeLevel.end()) { - + if (MI == mapExternalElemIDToTimeLevel.end()) { /* Element not present in external. Add it. */ - mapExternalElemIDToTimeLevel[donors[i]] = CUnsignedShort2T(0,0); + mapExternalElemIDToTimeLevel[donors[i]] = CUnsignedShort2T(0, 0); } /* The reverse connection may not be present either. Store the global ID of this element in the send buffers for the additional externals. */ int rankDonor; - if(donors[i] >= beg_node[size-1]) rankDonor = size-1; + if (donors[i] >= beg_node[size - 1]) + rankDonor = size - 1; else { - const unsigned long *low; - low = lower_bound(beg_node, beg_node+size, donors[i]); + const unsigned long* low; + low = lower_bound(beg_node, beg_node + size, donors[i]); rankDonor = (int)(low - beg_node); - if(*low > donors[i]) --rankDonor; + if (*low > donors[i]) --rankDonor; } sendBufAddExternals[rankDonor].push_back(bound[iMarker][l]->GetDomainElement()); @@ -4055,33 +3861,29 @@ void CPhysicalGeometry::DetermineTimeLevelElements( externals to be stored. */ int nRankRecv; vector sizeSend(size, 1); - SU2_MPI::Reduce_scatter(recvFromRank.data(), &nRankRecv, sizeSend.data(), - MPI_INT, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Reduce_scatter(recvFromRank.data(), &nRankRecv, sizeSend.data(), MPI_INT, MPI_SUM, SU2_MPI::GetComm()); /* Determine the number of messages this rank will send. */ int nRankSend = 0; - for(int i=0; i sendReqs(nRankSend); nRankSend = 0; - for(int i=0; i::iterator lastElem = unique(sendBufAddExternals[i].begin(), - sendBufAddExternals[i].end()); + auto lastElem = unique(sendBufAddExternals[i].begin(), sendBufAddExternals[i].end()); sendBufAddExternals[i].erase(lastElem, sendBufAddExternals[i].end()); - SU2_MPI::Isend(sendBufAddExternals[i].data(), sendBufAddExternals[i].size(), - MPI_UNSIGNED_LONG, i, i, SU2_MPI::GetComm(), &sendReqs[nRankSend++]); + SU2_MPI::Isend(sendBufAddExternals[i].data(), sendBufAddExternals[i].size(), MPI_UNSIGNED_LONG, i, i, + SU2_MPI::GetComm(), &sendReqs[nRankSend++]); } } /* Loop over the number of ranks from which this rank will receive data to be stored in mapExternalElemIDToTimeLevel. */ - for(int i=0; i recvBuf(sizeMess); - SU2_MPI::Recv(recvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, - source, rank, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(recvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, source, rank, SU2_MPI::GetComm(), &status); /* Loop over the entries of recvBuf and add them to mapExternalElemIDToTimeLevel, if not present already. */ - for(int j=0; j::iterator MI; + for (int j = 0; j < sizeMess; ++j) { + map::iterator MI; MI = mapExternalElemIDToTimeLevel.find(recvBuf[j]); - if(MI == mapExternalElemIDToTimeLevel.end()) - mapExternalElemIDToTimeLevel[recvBuf[j]] = CUnsignedShort2T(0,0); + if (MI == mapExternalElemIDToTimeLevel.end()) mapExternalElemIDToTimeLevel[recvBuf[j]] = CUnsignedShort2T(0, 0); } } @@ -4120,64 +3920,57 @@ void CPhysicalGeometry::DetermineTimeLevelElements( time accurate local time stepping is used. ---*/ const unsigned short nTimeLevels = config->GetnLevels_TimeAccurateLTS(); - if(nTimeLevels == 1) { - + if (nTimeLevels == 1) { /*--- No time accurate local time stepping. Set the time level of all elements to zero. ---*/ - for(unsigned long i=0; iSetTimeLevel(0); - } - else { - + for (unsigned long i = 0; i < nElem; ++i) elem[i]->SetTimeLevel(0); + } else { /*--- Time accurate local time stepping is used. The estimate of the time step is based on free stream values at the moment, but this is easy to change, if needed. ---*/ - const su2double Gamma = config->GetGamma(); + const su2double Gamma = config->GetGamma(); const su2double Prandtl = config->GetPrandtl_Lam(); - const su2double Density = config->GetDensity_FreeStreamND(); - const su2double *Vel = config->GetVelocity_FreeStreamND(); + const su2double Density = config->GetDensity_FreeStreamND(); + const su2double* Vel = config->GetVelocity_FreeStreamND(); const su2double Viscosity = config->GetViscosity_FreeStreamND(); su2double VelMag = 0.0; - for(unsigned short iDim=0; iDimGetMach(); + const su2double SoundSpeed = VelMag / config->GetMach(); /* In the estimate of the time step the spectral radius of the inviscid terms is needed. As the current estimate is based on the free stream, the value of this spectral radius can be computed beforehand. Note that this is a rather conservative estimate. */ su2double charVel2 = 0.0; - for(unsigned short iDim=0; iDim timeStepElements(nElem); - for(unsigned long i=0; iGetNPolySol(); - if(nPoly == 0) nPoly = 1; - const su2double lenScaleInv = nPoly/elem[i]->GetLengthScale(); - const su2double lenScale = 1.0/lenScaleInv; + if (nPoly == 0) nPoly = 1; + const su2double lenScaleInv = nPoly / elem[i]->GetLengthScale(); + const su2double lenScale = 1.0 / lenScaleInv; - timeStepElements[i] = lenScale/(charVel + lenScaleInv*radVisc); - minDeltaT = min(minDeltaT, timeStepElements[i]); + timeStepElements[i] = lenScale / (charVel + lenScaleInv * radVisc); + minDeltaT = min(minDeltaT, timeStepElements[i]); } /* Determine the minimum value of all elements in the grid. @@ -4188,12 +3981,12 @@ void CPhysicalGeometry::DetermineTimeLevelElements( #endif /* Initial estimate of the time level of the owned elements. */ - for(unsigned long i=0; iSetTimeLevel(timeLevel); @@ -4205,35 +3998,34 @@ void CPhysicalGeometry::DetermineTimeLevelElements( /*--- of the external element data. ---*/ /*--------------------------------------------------------------------------*/ - map::iterator MI; + map::iterator MI; #ifdef HAVE_MPI /*--- Determine the ranks from which I receive element data during the actual exchange. ---*/ recvFromRank.assign(size, 0); - for(MI =mapExternalElemIDToTimeLevel.begin(); - MI!=mapExternalElemIDToTimeLevel.end(); ++MI) { - + for (MI = mapExternalElemIDToTimeLevel.begin(); MI != mapExternalElemIDToTimeLevel.end(); ++MI) { /* Determine the rank where this external is stored. */ const unsigned long elemID = MI->first; int rankElem; - if(elemID >= beg_node[size-1]) rankElem = size-1; + if (elemID >= beg_node[size - 1]) + rankElem = size - 1; else { - const unsigned long *low; - low = lower_bound(beg_node, beg_node+size, elemID); + const unsigned long* low; + low = lower_bound(beg_node, beg_node + size, elemID); rankElem = low - beg_node; - if(*low > elemID) --rankElem; + if (*low > elemID) --rankElem; } /* Set the corresponding index of recvFromRank to 1. */ recvFromRank[rankElem] = 1; } - map mapRankToIndRecv; - for(int i=0; i mapRankToIndRecv; + for (int i = 0; i < size; ++i) { + if (recvFromRank[i]) { int ind = mapRankToIndRecv.size(); mapRankToIndRecv[i] = ind; } @@ -4242,28 +4034,26 @@ void CPhysicalGeometry::DetermineTimeLevelElements( /* Determine the number of ranks from which I will receive data and to which I will send data. */ nRankRecv = mapRankToIndRecv.size(); - SU2_MPI::Reduce_scatter(recvFromRank.data(), &nRankSend, sizeSend.data(), - MPI_INT, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Reduce_scatter(recvFromRank.data(), &nRankSend, sizeSend.data(), MPI_INT, MPI_SUM, SU2_MPI::GetComm()); /*--- Create the vector of vectors of the global element ID's that will be received from other ranks. ---*/ vector > recvElem(nRankRecv, vector(0)); - for(MI =mapExternalElemIDToTimeLevel.begin(); - MI!=mapExternalElemIDToTimeLevel.end(); ++MI) { - + for (MI = mapExternalElemIDToTimeLevel.begin(); MI != mapExternalElemIDToTimeLevel.end(); ++MI) { const unsigned long elemID = MI->first; int rankElem; - if(elemID >= beg_node[size-1]) rankElem = size-1; + if (elemID >= beg_node[size - 1]) + rankElem = size - 1; else { - const unsigned long *low; - low = lower_bound(beg_node, beg_node+size, elemID); + const unsigned long* low; + low = lower_bound(beg_node, beg_node + size, elemID); rankElem = low - beg_node; - if(*low > elemID) --rankElem; + if (*low > elemID) --rankElem; } - map::const_iterator MRI = mapRankToIndRecv.find(rankElem); + map::const_iterator MRI = mapRankToIndRecv.find(rankElem); recvElem[MRI->second].push_back(elemID); } @@ -4271,17 +4061,15 @@ void CPhysicalGeometry::DetermineTimeLevelElements( exchange and send over the global element ID's. In order to avoid unnecessary communication, multiple entries are filtered out. ---*/ sendReqs.resize(nRankRecv); - map::const_iterator MRI = mapRankToIndRecv.begin(); - - for(int i=0; i::const_iterator MRI = mapRankToIndRecv.begin(); + for (int i = 0; i < nRankRecv; ++i, ++MRI) { sort(recvElem[i].begin(), recvElem[i].end()); - vector::iterator lastElem = unique(recvElem[i].begin(), - recvElem[i].end()); + auto lastElem = unique(recvElem[i].begin(), recvElem[i].end()); recvElem[i].erase(lastElem, recvElem[i].end()); - SU2_MPI::Isend(recvElem[i].data(), recvElem[i].size(), MPI_UNSIGNED_LONG, - MRI->first, MRI->first, SU2_MPI::GetComm(), &sendReqs[i]); + SU2_MPI::Isend(recvElem[i].data(), recvElem[i].size(), MPI_UNSIGNED_LONG, MRI->first, MRI->first, + SU2_MPI::GetComm(), &sendReqs[i]); } /*--- Receive the messages in arbitrary sequence and store the requested @@ -4290,8 +4078,7 @@ void CPhysicalGeometry::DetermineTimeLevelElements( vector > sendElem(nRankSend, vector(0)); vector sendRank(nRankSend); - for(int i=0; iGetTimeLevel(); - sendBuf[i][2*j+1] = elem[sendElem[i][j]]->GetNDOFsSol(); + for (int i = 0; i < nRankSend; ++i) { + sendBuf[i].resize(2 * sendElem[i].size()); + for (unsigned long j = 0; j < sendElem[i].size(); ++j) { + sendBuf[i][2 * j] = elem[sendElem[i][j]]->GetTimeLevel(); + sendBuf[i][2 * j + 1] = elem[sendElem[i][j]]->GetNDOFsSol(); } - SU2_MPI::Isend(sendBuf[i].data(), sendBuf[i].size(), MPI_UNSIGNED_SHORT, - sendRank[i], sendRank[i], SU2_MPI::GetComm(), &sendReqs[i]); + SU2_MPI::Isend(sendBuf[i].data(), sendBuf[i].size(), MPI_UNSIGNED_SHORT, sendRank[i], sendRank[i], + SU2_MPI::GetComm(), &sendReqs[i]); } /*--- Receive the data for the externals. As this data is needed immediately, @@ -4348,19 +4132,18 @@ void CPhysicalGeometry::DetermineTimeLevelElements( of the externals is stored in the second entry of the mapExternalElemIDToTimeLevel, which is set accordingly. ---*/ MRI = mapRankToIndRecv.begin(); - for(int i=0; ifirst, rank, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(returnBuf[i].data(), returnBuf[i].size(), MPI_UNSIGNED_SHORT, MRI->first, rank, SU2_MPI::GetComm(), + &status); - for(unsigned long j=0; jsecond.short0 = returnBuf[i][2*j]; - MI->second.short1 = returnBuf[i][2*j+1]; + MI->second.short0 = returnBuf[i][2 * j]; + MI->second.short1 = returnBuf[i][2 * j + 1]; } } @@ -4382,11 +4165,9 @@ void CPhysicalGeometry::DetermineTimeLevelElements( /*--------------------------------------------------------------------------*/ /* Test for time accurate local time stepping. */ - if(nTimeLevels > 1) { - + if (nTimeLevels > 1) { /* Infinite loop for the iterative algorithm. */ - for(;;) { - + for (;;) { /* Variable to indicate whether the local situation has changed. */ unsigned short localSituationChanged = 0; @@ -4396,66 +4177,58 @@ void CPhysicalGeometry::DetermineTimeLevelElements( restriction, because in the vast majority of cases, the donor element is this adjacent element itself. Requiring it to be the same makes the implementation of the wall functions easier. ---*/ - for(unsigned short iMarker=0; iMarkerGetDomainElement() - - beg_node[rank]; + const unsigned long elemID = bound[iMarker][l]->GetDomainElement() - beg_node[rank]; /* Get the number of donor elements for the wall function treatment and the pointer to the array which stores this info. */ const unsigned short nDonors = bound[iMarker][l]->GetNDonorsWallFunctions(); - const unsigned long *donors = bound[iMarker][l]->GetDonorsWallFunctions(); + const unsigned long* donors = bound[iMarker][l]->GetDonorsWallFunctions(); /* Loop over the number of donors and check the time levels. */ - for(unsigned short i=0; i= beg_node[rank] && - donors[i] < beg_node[rank]+nElem) { - + if (donors[i] >= beg_node[rank] && donors[i] < beg_node[rank] + nElem) { /* Donor is stored locally. Determine its local ID and get the time levels of both elements. */ - const unsigned long donorID = donors[i] - beg_node[rank]; + const unsigned long donorID = donors[i] - beg_node[rank]; const unsigned short timeLevelB = elem[elemID]->GetTimeLevel(); const unsigned short timeLevelD = elem[donorID]->GetTimeLevel(); - const unsigned short timeLevel = min(timeLevelB, timeLevelD); + const unsigned short timeLevel = min(timeLevelB, timeLevelD); /* If the time level of either element is larger than timeLevel, adapt the time levels and indicate that the local situation has changed. */ - if(timeLevelB > timeLevel) { + if (timeLevelB > timeLevel) { elem[elemID]->SetTimeLevel(timeLevel); localSituationChanged = 1; } - if(timeLevelD > timeLevel) { + if (timeLevelD > timeLevel) { elem[donorID]->SetTimeLevel(timeLevel); localSituationChanged = 1; } - } - else { - + } else { /* The donor element is stored on a different processor. Retrieve its time level from mapExternalElemIDToTimeLevel and determine the minimum time level. */ const unsigned short timeLevelB = elem[elemID]->GetTimeLevel(); MI = mapExternalElemIDToTimeLevel.find(donors[i]); - if(MI == mapExternalElemIDToTimeLevel.end()) - SU2_MPI::Error("Entry not found in mapExternalElemIDToTimeLevel", - CURRENT_FUNCTION); + if (MI == mapExternalElemIDToTimeLevel.end()) + SU2_MPI::Error("Entry not found in mapExternalElemIDToTimeLevel", CURRENT_FUNCTION); const unsigned short timeLevel = min(timeLevelB, MI->second.short0); /* If the time level of either element is larger than timeLevel, adapt the time levels and indicate that the local situation has changed. */ - if(timeLevelB > timeLevel) { + if (timeLevelB > timeLevel) { elem[elemID]->SetTimeLevel(timeLevel); localSituationChanged = 1; } - if(MI->second.short0 > timeLevel) { + if (MI->second.short0 > timeLevel) { MI->second.short0 = timeLevel; localSituationChanged = 1; } @@ -4466,61 +4239,54 @@ void CPhysicalGeometry::DetermineTimeLevelElements( /*--- Loop over the matching faces and update the time levels of the adjacent elements, if needed. ---*/ - for(vector::const_iterator FI =localFaces.begin(); - FI!=localFaces.end(); ++FI) { + for (auto FI = localFaces.begin(); FI != localFaces.end(); ++FI) { /* Safeguard against non-matching faces. */ - if(FI->elemID1 < Global_nElem) { - + if (FI->elemID1 < Global_nElem) { /* Local element ID of the first element. Per definition this is always a locally stored element. Also store its time level. */ - const unsigned long elemID0 = FI->elemID0 - beg_node[rank]; + const unsigned long elemID0 = FI->elemID0 - beg_node[rank]; const unsigned short timeLevel0 = elem[elemID0]->GetTimeLevel(); /* Determine the status of the second element. */ - if(FI->elemID1 >= beg_node[rank] && - FI->elemID1 < beg_node[rank]+nElem) { - + if (FI->elemID1 >= beg_node[rank] && FI->elemID1 < beg_node[rank] + nElem) { /* Both elements are stored locally. Determine the local element of the second element and determine the minimum time level. */ - const unsigned long elemID1 = FI->elemID1 - beg_node[rank]; + const unsigned long elemID1 = FI->elemID1 - beg_node[rank]; const unsigned short timeLevel1 = elem[elemID1]->GetTimeLevel(); - const unsigned short timeLevel = min(timeLevel0, timeLevel1); + const unsigned short timeLevel = min(timeLevel0, timeLevel1); /* If the time level of either element is larger than timeLevel+1, adapt the time levels and indicate that the local situation has changed. */ - if(timeLevel0 > timeLevel+1) { - elem[elemID0]->SetTimeLevel(timeLevel+1); + if (timeLevel0 > timeLevel + 1) { + elem[elemID0]->SetTimeLevel(timeLevel + 1); localSituationChanged = 1; } - if(timeLevel1 > timeLevel+1) { - elem[elemID1]->SetTimeLevel(timeLevel+1); + if (timeLevel1 > timeLevel + 1) { + elem[elemID1]->SetTimeLevel(timeLevel + 1); localSituationChanged = 1; } - } - else { - + } else { /* The second element is stored on a different processor. Retrieve its time level from mapExternalElemIDToTimeLevel and determine the minimum time level. */ MI = mapExternalElemIDToTimeLevel.find(FI->elemID1); - if(MI == mapExternalElemIDToTimeLevel.end()) - SU2_MPI::Error("Entry not found in mapExternalElemIDToTimeLevel", - CURRENT_FUNCTION); + if (MI == mapExternalElemIDToTimeLevel.end()) + SU2_MPI::Error("Entry not found in mapExternalElemIDToTimeLevel", CURRENT_FUNCTION); const unsigned short timeLevel = min(timeLevel0, MI->second.short0); /* If the time level of either element is larger than timeLevel+1, adapt the time levels and indicate that the local situation has changed. */ - if(timeLevel0 > timeLevel+1) { - elem[elemID0]->SetTimeLevel(timeLevel+1); + if (timeLevel0 > timeLevel + 1) { + elem[elemID0]->SetTimeLevel(timeLevel + 1); localSituationChanged = 1; } - if(MI->second.short0 > timeLevel+1) { - MI->second.short0 = timeLevel+1; + if (MI->second.short0 > timeLevel + 1) { + MI->second.short0 = timeLevel + 1; localSituationChanged = 1; } } @@ -4532,25 +4298,23 @@ void CPhysicalGeometry::DetermineTimeLevelElements( unsigned short globalSituationChanged = localSituationChanged; #ifdef HAVE_MPI - SU2_MPI::Allreduce(&localSituationChanged, &globalSituationChanged, - 1, MPI_UNSIGNED_SHORT, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&localSituationChanged, &globalSituationChanged, 1, MPI_UNSIGNED_SHORT, MPI_MAX, + SU2_MPI::GetComm()); #endif - if( !globalSituationChanged ) break; + if (!globalSituationChanged) break; - /*--- Communicate the information of the externals, if needed. ---*/ + /*--- Communicate the information of the externals, if needed. ---*/ #ifdef HAVE_MPI /*--- Copy the information of the time level into the send buffers and send the data using non-blocking sends. Note that the size of sendElem is used and not sendBuf, because the size of sendBuf is twice the size, see step 4. ---*/ - for(int i=0; iGetTimeLevel(); - for(unsigned long j=0; jGetTimeLevel(); - - SU2_MPI::Isend(sendBuf[i].data(), sendElem[i].size(), MPI_UNSIGNED_SHORT, - sendRank[i], sendRank[i], SU2_MPI::GetComm(), &sendReqs[i]); + SU2_MPI::Isend(sendBuf[i].data(), sendElem[i].size(), MPI_UNSIGNED_SHORT, sendRank[i], sendRank[i], + SU2_MPI::GetComm(), &sendReqs[i]); } /*--- Receive the data for the externals. As this data is needed @@ -4563,22 +4327,21 @@ void CPhysicalGeometry::DetermineTimeLevelElements( of recvElem is used and not returnBuf, because the latter is twice as large, see step 4. ---*/ MRI = mapRankToIndRecv.begin(); - for(int i=0; ifirst, rank, SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(returnBuf[i].data(), recvElem[i].size(), MPI_UNSIGNED_SHORT, MRI->first, rank, SU2_MPI::GetComm(), + &status); - for(unsigned long j=0; jsecond.short0 = min(returnBuf[i][j], MI->second.short0); - returnBuf[i][j] = MI->second.short0; + returnBuf[i][j] = MI->second.short0; } - SU2_MPI::Isend(returnBuf[i].data(), recvElem[i].size(), MPI_UNSIGNED_SHORT, - MRI->first, MRI->first+1, SU2_MPI::GetComm(), &returnReqs[i]); + SU2_MPI::Isend(returnBuf[i].data(), recvElem[i].size(), MPI_UNSIGNED_SHORT, MRI->first, MRI->first + 1, + SU2_MPI::GetComm(), &returnReqs[i]); } /* Complete the first round of nonblocking sends, such that the @@ -4589,14 +4352,12 @@ void CPhysicalGeometry::DetermineTimeLevelElements( /* Loop again over the original sending processors to receive the updated time level of elements that may have been updated on other ranks. */ - for(int i=0; iSetTimeLevel(sendBuf[i][j]); + for (unsigned long j = 0; j < sendElem[i].size(); ++j) elem[sendElem[i][j]]->SetTimeLevel(sendBuf[i][j]); } /* Complete the second round of nonblocking sends. */ @@ -4609,52 +4370,43 @@ void CPhysicalGeometry::DetermineTimeLevelElements( /*--- time level. ---*/ /*------------------------------------------------------------------------*/ - if(rank == MASTER_NODE) - cout << endl <<"------- Element distribution for time accurate local time stepping ------" << endl; + if (rank == MASTER_NODE) + cout << endl << "------- Element distribution for time accurate local time stepping ------" << endl; /* Determine the local number of elements per time level. */ vector nLocalElemPerLevel(nTimeLevels, 0); - for(unsigned long i=0; iGetTimeLevel()]; + for (unsigned long i = 0; i < nElem; ++i) ++nLocalElemPerLevel[elem[i]->GetTimeLevel()]; /* Determine the global version of nLocalElemPerLevel. This only needs to be known on the master node. */ vector nGlobalElemPerLevel = nLocalElemPerLevel; #ifdef HAVE_MPI - SU2_MPI::Reduce(nLocalElemPerLevel.data(), nGlobalElemPerLevel.data(), - nTimeLevels, MPI_UNSIGNED_LONG, MPI_SUM, - MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Reduce(nLocalElemPerLevel.data(), nGlobalElemPerLevel.data(), nTimeLevels, MPI_UNSIGNED_LONG, MPI_SUM, + MASTER_NODE, SU2_MPI::GetComm()); #endif /* Write the output. */ - if(rank == MASTER_NODE) { - for(unsigned short i=0; i &localFaces, - const vector > &adjacency, - const map &mapExternalElemIDToTimeLevel, - vector &vwgt, - vector > &adjwgt) { - +void CPhysicalGeometry::ComputeFEMGraphWeights(CConfig* config, const vector& localFaces, + const vector >& adjacency, + const map& mapExternalElemIDToTimeLevel, + vector& vwgt, vector >& adjwgt) { /*--- Determine the maximum time level that occurs in the grid. ---*/ unsigned short maxTimeLevel = 0; - for(unsigned long i=0; iGetTimeLevel()); + for (unsigned long i = 0; i < nElem; ++i) maxTimeLevel = max(maxTimeLevel, elem[i]->GetTimeLevel()); #ifdef HAVE_MPI unsigned short maxTimeLevelLocal = maxTimeLevel; - SU2_MPI::Allreduce(&maxTimeLevelLocal, &maxTimeLevel, 1, - MPI_UNSIGNED_SHORT, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&maxTimeLevelLocal, &maxTimeLevel, 1, MPI_UNSIGNED_SHORT, MPI_MAX, SU2_MPI::GetComm()); #endif /*--------------------------------------------------------------------------*/ @@ -4667,7 +4419,7 @@ void CPhysicalGeometry::ComputeFEMGraphWeights( /*--- Define the standard elements for the volume elements, the boundary faces and the matching internal faces. ---*/ - vector standardElements; + vector standardElements; vector standardBoundaryFaces; vector standardMatchingFaces; @@ -4676,32 +4428,28 @@ void CPhysicalGeometry::ComputeFEMGraphWeights( surface integral to allow for Discontinuous and Continuous Galerkin schemes. For the latter the contribution of the surface integral will be negligible to the total amount of work. ---*/ - for(unsigned long i=0; iGetVTK_Type(); unsigned short nPolySol = elem[i]->GetNPolySol(); - bool JacIsConstant = elem[i]->GetJacobianConsideredConstant(); + bool JacIsConstant = elem[i]->GetJacobianConsideredConstant(); unsigned long ii; - for(ii=0; iiGetCornerPointsAllFaces(nFaces, nPointsPerFace, faceConn); /*--- Loop over the number of faces of this element. ---*/ - for(unsigned short j=0; j::const_iterator low; low = lower_bound(localFaces.begin(), localFaces.end(), thisFace); bool thisFaceFound = false; - if(low != localFaces.end()) { - if( !(thisFace < *low) ) thisFaceFound = true; + if (low != localFaces.end()) { + if (!(thisFace < *low)) thisFaceFound = true; } - if( thisFaceFound ) { - + if (thisFaceFound) { /* Check if this internal matching face is owned by this element. */ bool faceIsOwned; - if(elemID == low->elemID0) faceIsOwned = low->elem0IsOwner; - else faceIsOwned = !low->elem0IsOwner; - - if( faceIsOwned ) { + if (elemID == low->elemID0) + faceIsOwned = low->elem0IsOwner; + else + faceIsOwned = !low->elem0IsOwner; + if (faceIsOwned) { /*--- Determine the index of the corresponding standard matching face. If it does not exist, create it. ---*/ - for(ii=0; iielemType0, low->nPolySol0, - low->elemType1, low->nPolySol1, - false, false) ) + for (ii = 0; ii < standardMatchingFaces.size(); ++ii) { + if (standardMatchingFaces[ii].SameStandardMatchingFace(VTK_Type_Face, JacIsConstant, low->elemType0, + low->nPolySol0, low->elemType1, low->nPolySol1, + false, false)) break; } - if(ii == standardMatchingFaces.size()) - standardMatchingFaces.push_back(CFEMStandardInternalFace(VTK_Type_Face, - low->elemType0, low->nPolySol0, - low->elemType1, low->nPolySol1, - JacIsConstant, false, false, - config)); + if (ii == standardMatchingFaces.size()) + standardMatchingFaces.emplace_back(VTK_Type_Face, low->elemType0, low->nPolySol0, low->elemType1, + low->nPolySol1, JacIsConstant, false, false, config); /* Update the computational work for this element, i.e. the 1st vertex weight. */ vwgt[ind0] += standardMatchingFaces[ii].WorkEstimateMetis(config); } - } - else { - + } else { /*--- This is a boundary face, which is owned by definition. Determine the index of the corresponding standard boundary face. If it does not exist, create it. ---*/ - for(ii=0; iiGetMarker_All_KindBC(iMarker)) { case ISOTHERMAL: case HEAT_FLUX: { const string Marker_Tag = config->GetMarker_All_TagBound(iMarker); - if(config->GetWallFunction_Treatment(Marker_Tag) != WALL_FUNCTIONS::NONE) { - + if (config->GetWallFunction_Treatment(Marker_Tag) != WALL_FUNCTIONS::NONE) { /* Retrieve the integer information for this boundary marker. The number of points in normal direction for the wall function treatment is the first element of this array. */ - const unsigned short *shortInfo = config->GetWallFunction_IntInfo(Marker_Tag); + const unsigned short* shortInfo = config->GetWallFunction_IntInfo(Marker_Tag); /* Loop over the local boundary elements for this marker. */ - for(unsigned long l=0; lGetVTK_Type(); - const unsigned long elemID = bound[iMarker][l]->GetDomainElement() - - beg_node[rank]; - const unsigned short nPolySol = elem[elemID]->GetNPolySol(); + const unsigned long elemID = bound[iMarker][l]->GetDomainElement() - beg_node[rank]; + const unsigned short nPolySol = elem[elemID]->GetNPolySol(); const unsigned short VTK_Type_Elem = elem[elemID]->GetVTK_Type(); - const bool JacIsConstant = bound[iMarker][l]->GetJacobianConsideredConstant(); + const bool JacIsConstant = bound[iMarker][l]->GetJacobianConsideredConstant(); /* Determine the corresponding entry in the standard elements for boundary faces. This entry must be found. */ unsigned long ii; - for(ii=0; iiGetTimeLevel(); - vwgt[2*i] *= pow(2, diffLevel); + vwgt[2 * i] *= pow(2, diffLevel); } /*--- Determine the minimum of the workload of the elements, i.e. 1st vertex weight, over the entire domain. ---*/ su2double minvwgt = vwgt[0]; - for(unsigned long i=0; iGetTimeLevel(); - const unsigned short nDOFs0 = elem[i]->GetNDOFsSol(); + const unsigned short nDOFs0 = elem[i]->GetNDOFsSol(); /* Loop over the number of entries in the graph for this element. */ - for(unsigned long j=0; j= beg_node[rank] && - adjacency[i][j] < beg_node[rank]+nElem) { - + if (adjacency[i][j] >= beg_node[rank] && adjacency[i][j] < beg_node[rank] + nElem) { /* Locally stored element. Determine its local ID and set the time level and number of solution DOFs. */ unsigned long elemID1 = adjacency[i][j] - beg_node[rank]; timeLevel1 = elem[elemID1]->GetTimeLevel(); - nDOFs1 = elem[elemID1]->GetNDOFsSol(); - } - else { - + nDOFs1 = elem[elemID1]->GetNDOFsSol(); + } else { /* The neighbor is an external element. Find it in mapExternalElemIDToTimeLevel and set the time level and number of solution DOFs accordingly. */ - map::const_iterator MI; + map::const_iterator MI; MI = mapExternalElemIDToTimeLevel.find(adjacency[i][j]); - if(MI == mapExternalElemIDToTimeLevel.end()) + if (MI == mapExternalElemIDToTimeLevel.end()) SU2_MPI::Error("Entry not found in mapExternalElemIDToTimeLevel", CURRENT_FUNCTION); timeLevel1 = MI->second.short0; - nDOFs1 = MI->second.short1; + nDOFs1 = MI->second.short1; } /* Determine the difference of the maximum time level that occurs and @@ -4954,7 +4687,7 @@ void CPhysicalGeometry::ComputeFEMGraphWeights( /* Set the edge weight. As ParMetis expects an undirected graph, set the edge weight to the sum of the number of DOFs on both sides, multiplied by the weight factor to account for different time levels. */ - adjwgt[i][j] = pow(2, diffLevel) *(nDOFs0 + nDOFs1); + adjwgt[i][j] = pow(2, diffLevel) * (nDOFs0 + nDOFs1); } } } diff --git a/Common/src/geometry/CDummyGeometry.cpp b/Common/src/geometry/CDummyGeometry.cpp index 433eefa5b0a..1fba711ee64 100644 --- a/Common/src/geometry/CDummyGeometry.cpp +++ b/Common/src/geometry/CDummyGeometry.cpp @@ -2,7 +2,7 @@ * \file CDummyGeometry.hpp * \brief Implementation of the dummy geometry class used in "dry run" mode. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,15 +27,13 @@ #include "../../include/geometry/CDummyGeometry.hpp" - -CDummyGeometry::CDummyGeometry(CConfig *config) : CGeometry() { - +CDummyGeometry::CDummyGeometry(CConfig* config) : CGeometry() { nZone = config->GetnZone(); - nPoint_P2PSend = new int[size] (); - nPoint_P2PRecv = new int[size] (); + nPoint_P2PSend = new int[size](); + nPoint_P2PRecv = new int[size](); - nVertex = new unsigned long[config->GetnMarker_All()] (); + nVertex = new unsigned long[config->GetnMarker_All()](); Tag_to_Marker = new string[config->GetnMarker_All()]; diff --git a/Common/src/geometry/CGeometry.cpp b/Common/src/geometry/CGeometry.cpp index bc1e91b1682..9ed1804186a 100644 --- a/Common/src/geometry/CGeometry.cpp +++ b/Common/src/geometry/CGeometry.cpp @@ -2,7 +2,7 @@ * \file CGeometry.cpp * \brief Implementation of the base geometry class. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -33,20 +33,14 @@ #include "../../include/toolboxes/geometry_toolbox.hpp" #include "../../include/toolboxes/ndflattener.hpp" -CGeometry::CGeometry(void) : - size(SU2_MPI::GetSize()), - rank(SU2_MPI::GetRank()) { - -} - -CGeometry::~CGeometry(void) { +CGeometry::CGeometry() : size(SU2_MPI::GetSize()), rank(SU2_MPI::GetRank()) {} +CGeometry::~CGeometry() { unsigned long iElem, iElem_Bound, iVertex; unsigned short iMarker; if (elem != nullptr) { - for (iElem = 0; iElem < nElem; iElem++) - delete elem[iElem]; + for (iElem = 0; iElem < nElem; iElem++) delete elem[iElem]; delete[] elem; } @@ -55,9 +49,9 @@ CGeometry::~CGeometry(void) { for (iElem_Bound = 0; iElem_Bound < nElem_Bound[iMarker]; iElem_Bound++) { delete bound[iMarker][iElem_Bound]; } - delete [] bound[iMarker]; + delete[] bound[iMarker]; } - delete [] bound; + delete[] bound; } delete nodes; @@ -69,83 +63,80 @@ CGeometry::~CGeometry(void) { for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { delete vertex[iMarker][iVertex]; } - delete [] vertex[iMarker]; + delete[] vertex[iMarker]; } - delete [] vertex; + delete[] vertex; } - delete [] nElem_Bound; - delete [] nVertex; - delete [] Marker_All_SendRecv; - delete [] Tag_to_Marker; + delete[] nElem_Bound; + delete[] nVertex; + delete[] Marker_All_SendRecv; + delete[] Tag_to_Marker; - delete [] beg_node; - delete [] end_node; - delete [] nPointLinear; - delete [] nPointCumulative; + delete[] beg_node; + delete[] end_node; + delete[] nPointLinear; + delete[] nPointCumulative; - if(CustomBoundaryHeatFlux != nullptr){ - for(iMarker=0; iMarker < nMarker; iMarker++){ - delete [] CustomBoundaryHeatFlux[iMarker]; + if (CustomBoundaryHeatFlux != nullptr) { + for (iMarker = 0; iMarker < nMarker; iMarker++) { + delete[] CustomBoundaryHeatFlux[iMarker]; } - delete [] CustomBoundaryHeatFlux; + delete[] CustomBoundaryHeatFlux; } - if(CustomBoundaryTemperature != nullptr){ - for(iMarker=0; iMarker < nMarker; iMarker++){ - delete [] CustomBoundaryTemperature[iMarker]; + if (CustomBoundaryTemperature != nullptr) { + for (iMarker = 0; iMarker < nMarker; iMarker++) { + delete[] CustomBoundaryTemperature[iMarker]; } - delete [] CustomBoundaryTemperature; + delete[] CustomBoundaryTemperature; } /*--- Delete structures for MPI point-to-point communication. ---*/ - delete [] bufD_P2PRecv; - delete [] bufD_P2PSend; + delete[] bufD_P2PRecv; + delete[] bufD_P2PSend; - delete [] bufS_P2PRecv; - delete [] bufS_P2PSend; + delete[] bufS_P2PRecv; + delete[] bufS_P2PSend; - delete [] req_P2PSend; - delete [] req_P2PRecv; + delete[] req_P2PSend; + delete[] req_P2PRecv; - delete [] nPoint_P2PRecv; - delete [] nPoint_P2PSend; + delete[] nPoint_P2PRecv; + delete[] nPoint_P2PSend; - delete [] Neighbors_P2PSend; - delete [] Neighbors_P2PRecv; + delete[] Neighbors_P2PSend; + delete[] Neighbors_P2PRecv; - delete [] Local_Point_P2PSend; - delete [] Local_Point_P2PRecv; + delete[] Local_Point_P2PSend; + delete[] Local_Point_P2PRecv; /*--- Delete structures for MPI periodic communication. ---*/ - delete [] bufD_PeriodicRecv; - delete [] bufD_PeriodicSend; - - delete [] bufS_PeriodicRecv; - delete [] bufS_PeriodicSend; + delete[] bufD_PeriodicRecv; + delete[] bufD_PeriodicSend; - delete [] req_PeriodicSend; - delete [] req_PeriodicRecv; + delete[] bufS_PeriodicRecv; + delete[] bufS_PeriodicSend; - delete [] nPoint_PeriodicRecv; - delete [] nPoint_PeriodicSend; + delete[] req_PeriodicSend; + delete[] req_PeriodicRecv; - delete [] Neighbors_PeriodicSend; - delete [] Neighbors_PeriodicRecv; + delete[] nPoint_PeriodicRecv; + delete[] nPoint_PeriodicSend; - delete [] Local_Point_PeriodicSend; - delete [] Local_Point_PeriodicRecv; + delete[] Neighbors_PeriodicSend; + delete[] Neighbors_PeriodicRecv; - delete [] Local_Marker_PeriodicSend; - delete [] Local_Marker_PeriodicRecv; + delete[] Local_Point_PeriodicSend; + delete[] Local_Point_PeriodicRecv; + delete[] Local_Marker_PeriodicSend; + delete[] Local_Marker_PeriodicRecv; } -void CGeometry::PreprocessP2PComms(CGeometry *geometry, - CConfig *config) { - +void CGeometry::PreprocessP2PComms(CGeometry* geometry, CConfig* config) { /*--- We start with the send and receive lists already available in the form of SEND_RECEIVE boundary markers. We will loop through these markers and establish the neighboring ranks and number of @@ -159,91 +150,94 @@ void CGeometry::PreprocessP2PComms(CGeometry *geometry, /*--- Local variables. ---*/ unsigned short iMarker; - unsigned long nVertexS, nVertexR, iVertex, MarkerS, MarkerR; + unsigned long nVertexS, nVertexR, iVertex, MarkerS, MarkerR; int iRank, iSend, iRecv, count; /*--- Create some temporary structures for tracking sends/recvs. ---*/ - int *nPoint_Send_All = new int[size+1]; nPoint_Send_All[0] = 0; - int *nPoint_Recv_All = new int[size+1]; nPoint_Recv_All[0] = 0; - int *nPoint_Flag = new int[size]; + int* nPoint_Send_All = new int[size + 1]; + nPoint_Send_All[0] = 0; + int* nPoint_Recv_All = new int[size + 1]; + nPoint_Recv_All[0] = 0; + int* nPoint_Flag = new int[size]; for (iRank = 0; iRank < size; iRank++) { - nPoint_Send_All[iRank] = 0; nPoint_Recv_All[iRank] = 0; nPoint_Flag[iRank]= -1; + nPoint_Send_All[iRank] = 0; + nPoint_Recv_All[iRank] = 0; + nPoint_Flag[iRank] = -1; } - nPoint_Send_All[size] = 0; nPoint_Recv_All[size] = 0; + nPoint_Send_All[size] = 0; + nPoint_Recv_All[size] = 0; /*--- Loop through all of our SEND_RECEIVE markers and track our sends with each rank. ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) == SEND_RECEIVE) && - (config->GetMarker_All_SendRecv(iMarker) > 0)) { - + if ((config->GetMarker_All_KindBC(iMarker) == SEND_RECEIVE) && (config->GetMarker_All_SendRecv(iMarker) > 0)) { /*--- Get the destination rank and number of points to send. ---*/ - iRank = config->GetMarker_All_SendRecv(iMarker)-1; + iRank = config->GetMarker_All_SendRecv(iMarker) - 1; nVertexS = geometry->nVertex[iMarker]; /*--- If we have not visited this element yet, increment our number of elements that must be sent to a particular proc. ---*/ if ((nPoint_Flag[iRank] != (int)iMarker)) { - nPoint_Flag[iRank] = (int)iMarker; - nPoint_Send_All[iRank+1] += nVertexS; + nPoint_Flag[iRank] = (int)iMarker; + nPoint_Send_All[iRank + 1] += nVertexS; } - } } - delete [] nPoint_Flag; + delete[] nPoint_Flag; /*--- Communicate the number of points to be sent/recv'd amongst all processors. After this communication, each proc knows how many cells it will receive from each other processor. ---*/ - SU2_MPI::Alltoall(&(nPoint_Send_All[1]), 1, MPI_INT, - &(nPoint_Recv_All[1]), 1, MPI_INT, SU2_MPI::GetComm()); + SU2_MPI::Alltoall(&(nPoint_Send_All[1]), 1, MPI_INT, &(nPoint_Recv_All[1]), 1, MPI_INT, SU2_MPI::GetComm()); /*--- Prepare to send connectivities. First check how many messages we will be sending and receiving. Here we also put the counters into cumulative storage format to make the communications simpler. ---*/ - nP2PSend = 0; nP2PRecv = 0; + nP2PSend = 0; + nP2PRecv = 0; for (iRank = 0; iRank < size; iRank++) { - if ((iRank != rank) && (nPoint_Send_All[iRank+1] > 0)) nP2PSend++; - if ((iRank != rank) && (nPoint_Recv_All[iRank+1] > 0)) nP2PRecv++; + if ((iRank != rank) && (nPoint_Send_All[iRank + 1] > 0)) nP2PSend++; + if ((iRank != rank) && (nPoint_Recv_All[iRank + 1] > 0)) nP2PRecv++; - nPoint_Send_All[iRank+1] += nPoint_Send_All[iRank]; - nPoint_Recv_All[iRank+1] += nPoint_Recv_All[iRank]; + nPoint_Send_All[iRank + 1] += nPoint_Send_All[iRank]; + nPoint_Recv_All[iRank + 1] += nPoint_Recv_All[iRank]; } /*--- Allocate only as much memory as we need for the P2P neighbors. ---*/ - nPoint_P2PSend = new int[nP2PSend+1]; nPoint_P2PSend[0] = 0; - nPoint_P2PRecv = new int[nP2PRecv+1]; nPoint_P2PRecv[0] = 0; + nPoint_P2PSend = new int[nP2PSend + 1]; + nPoint_P2PSend[0] = 0; + nPoint_P2PRecv = new int[nP2PRecv + 1]; + nPoint_P2PRecv[0] = 0; Neighbors_P2PSend = new int[nP2PSend]; Neighbors_P2PRecv = new int[nP2PRecv]; - iSend = 0; iRecv = 0; + iSend = 0; + iRecv = 0; for (iRank = 0; iRank < size; iRank++) { - - if ((nPoint_Send_All[iRank+1] > nPoint_Send_All[iRank]) && (iRank != rank)) { + if ((nPoint_Send_All[iRank + 1] > nPoint_Send_All[iRank]) && (iRank != rank)) { Neighbors_P2PSend[iSend] = iRank; - nPoint_P2PSend[iSend+1] = nPoint_Send_All[iRank+1]; + nPoint_P2PSend[iSend + 1] = nPoint_Send_All[iRank + 1]; iSend++; } - if ((nPoint_Recv_All[iRank+1] > nPoint_Recv_All[iRank]) && (iRank != rank)) { + if ((nPoint_Recv_All[iRank + 1] > nPoint_Recv_All[iRank]) && (iRank != rank)) { Neighbors_P2PRecv[iRecv] = iRank; - nPoint_P2PRecv[iRecv+1] = nPoint_Recv_All[iRank+1]; + nPoint_P2PRecv[iRecv + 1] = nPoint_Recv_All[iRank + 1]; iRecv++; } - } /*--- Create a reverse mapping of the message to the rank so that we @@ -251,15 +245,13 @@ void CGeometry::PreprocessP2PComms(CGeometry *geometry, messages dynamically. ---*/ P2PSend2Neighbor.clear(); - for (iSend = 0; iSend < nP2PSend; iSend++) - P2PSend2Neighbor[Neighbors_P2PSend[iSend]] = iSend; + for (iSend = 0; iSend < nP2PSend; iSend++) P2PSend2Neighbor[Neighbors_P2PSend[iSend]] = iSend; P2PRecv2Neighbor.clear(); - for (iRecv = 0; iRecv < nP2PRecv; iRecv++) - P2PRecv2Neighbor[Neighbors_P2PRecv[iRecv]] = iRecv; + for (iRecv = 0; iRecv < nP2PRecv; iRecv++) P2PRecv2Neighbor[Neighbors_P2PRecv[iRecv]] = iRecv; - delete [] nPoint_Send_All; - delete [] nPoint_Recv_All; + delete[] nPoint_Send_All; + delete[] nPoint_Recv_All; /*--- Allocate the memory that we need for receiving the conn values and then cue up the non-blocking receives. Note that @@ -268,13 +260,11 @@ void CGeometry::PreprocessP2PComms(CGeometry *geometry, Local_Point_P2PSend = nullptr; Local_Point_P2PSend = new unsigned long[nPoint_P2PSend[nP2PSend]]; - for (iSend = 0; iSend < nPoint_P2PSend[nP2PSend]; iSend++) - Local_Point_P2PSend[iSend] = 0; + for (iSend = 0; iSend < nPoint_P2PSend[nP2PSend]; iSend++) Local_Point_P2PSend[iSend] = 0; Local_Point_P2PRecv = nullptr; Local_Point_P2PRecv = new unsigned long[nPoint_P2PRecv[nP2PRecv]]; - for (iRecv = 0; iRecv < nPoint_P2PRecv[nP2PRecv]; iRecv++) - Local_Point_P2PRecv[iRecv] = 0; + for (iRecv = 0; iRecv < nPoint_P2PRecv[nP2PRecv]; iRecv++) Local_Point_P2PRecv[iRecv] = 0; /*--- We allocate the memory for communicating values in a later step once we know the maximum packet size that we need to communicate. This @@ -290,10 +280,10 @@ void CGeometry::PreprocessP2PComms(CGeometry *geometry, /*--- Allocate memory for the MPI requests if we need to communicate. ---*/ if (nP2PSend > 0) { - req_P2PSend = new SU2_MPI::Request[nP2PSend]; + req_P2PSend = new SU2_MPI::Request[nP2PSend]; } if (nP2PRecv > 0) { - req_P2PRecv = new SU2_MPI::Request[nP2PRecv]; + req_P2PRecv = new SU2_MPI::Request[nP2PRecv]; } /*--- Build lists of local index values for send. ---*/ @@ -301,12 +291,10 @@ void CGeometry::PreprocessP2PComms(CGeometry *geometry, count = 0; for (iSend = 0; iSend < nP2PSend; iSend++) { for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) == SEND_RECEIVE) && - (config->GetMarker_All_SendRecv(iMarker) > 0)) { - - MarkerS = iMarker; + if ((config->GetMarker_All_KindBC(iMarker) == SEND_RECEIVE) && (config->GetMarker_All_SendRecv(iMarker) > 0)) { + MarkerS = iMarker; nVertexS = geometry->nVertex[MarkerS]; - iRank = config->GetMarker_All_SendRecv(MarkerS)-1; + iRank = config->GetMarker_All_SendRecv(MarkerS) - 1; if (iRank == Neighbors_P2PSend[iSend]) { for (iVertex = 0; iVertex < nVertexS; iVertex++) { @@ -314,7 +302,6 @@ void CGeometry::PreprocessP2PComms(CGeometry *geometry, count++; } } - } } } @@ -324,12 +311,10 @@ void CGeometry::PreprocessP2PComms(CGeometry *geometry, count = 0; for (iRecv = 0; iRecv < nP2PRecv; iRecv++) { for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) == SEND_RECEIVE) && - (config->GetMarker_All_SendRecv(iMarker) > 0)) { - - MarkerR = iMarker+1; + if ((config->GetMarker_All_KindBC(iMarker) == SEND_RECEIVE) && (config->GetMarker_All_SendRecv(iMarker) > 0)) { + MarkerR = iMarker + 1; nVertexR = geometry->nVertex[MarkerR]; - iRank = abs(config->GetMarker_All_SendRecv(MarkerR))-1; + iRank = abs(config->GetMarker_All_SendRecv(MarkerR)) - 1; if (iRank == Neighbors_P2PRecv[iRecv]) { for (iVertex = 0; iVertex < nVertexR; iVertex++) { @@ -337,7 +322,6 @@ void CGeometry::PreprocessP2PComms(CGeometry *geometry, count++; } } - } } } @@ -345,11 +329,9 @@ void CGeometry::PreprocessP2PComms(CGeometry *geometry, /*--- In the future, some additional data structures could be created here to separate the interior and boundary nodes in order to help further overlap computation and communication. ---*/ - } void CGeometry::AllocateP2PComms(unsigned short countPerPoint) { - /*--- This routine is activated whenever we attempt to perform a point-to-point MPI communication with our neighbors but the memory buffer allocated is not large enough for the packet size. @@ -360,36 +342,29 @@ void CGeometry::AllocateP2PComms(unsigned short countPerPoint) { if (countPerPoint <= maxCountPerPoint) return; BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS { + /*--- Store the larger packet size to the class data. ---*/ - /*--- Store the larger packet size to the class data. ---*/ - - maxCountPerPoint = countPerPoint; - - /*-- Deallocate and reallocate our su2double cummunication memory. ---*/ + maxCountPerPoint = countPerPoint; - delete [] bufD_P2PSend; - bufD_P2PSend = new su2double[maxCountPerPoint*nPoint_P2PSend[nP2PSend]] (); + /*-- Deallocate and reallocate our su2double cummunication memory. ---*/ - delete [] bufD_P2PRecv; - bufD_P2PRecv = new su2double[maxCountPerPoint*nPoint_P2PRecv[nP2PRecv]] (); + delete[] bufD_P2PSend; + bufD_P2PSend = new su2double[maxCountPerPoint * nPoint_P2PSend[nP2PSend]](); - delete [] bufS_P2PSend; - bufS_P2PSend = new unsigned short[maxCountPerPoint*nPoint_P2PSend[nP2PSend]] (); + delete[] bufD_P2PRecv; + bufD_P2PRecv = new su2double[maxCountPerPoint * nPoint_P2PRecv[nP2PRecv]](); - delete [] bufS_P2PRecv; - bufS_P2PRecv = new unsigned short[maxCountPerPoint*nPoint_P2PRecv[nP2PRecv]] (); + delete[] bufS_P2PSend; + bufS_P2PSend = new unsigned short[maxCountPerPoint * nPoint_P2PSend[nP2PSend]](); + delete[] bufS_P2PRecv; + bufS_P2PRecv = new unsigned short[maxCountPerPoint * nPoint_P2PRecv[nP2PRecv]](); } END_SU2_OMP_SAFE_GLOBAL_ACCESS - } -void CGeometry::PostP2PRecvs(CGeometry *geometry, - const CConfig *config, - unsigned short commType, - unsigned short countPerPoint, - bool val_reverse) const { - +void CGeometry::PostP2PRecvs(CGeometry* geometry, const CConfig* config, unsigned short commType, + unsigned short countPerPoint, bool val_reverse) const { /*--- Launch the non-blocking recv's first. Note that we have stored the counts and sources, so we can launch these before we even load the data and send from the neighbor ranks. ---*/ @@ -403,21 +378,20 @@ void CGeometry::PostP2PRecvs(CGeometry *geometry, send nodes become the recv nodes and vice-versa. ---*/ if (val_reverse) { - /*--- Compute our location in the buffer using the send data structure since we are reversing the comms. ---*/ - auto offset = countPerPoint*nPoint_P2PSend[iRecv]; + auto offset = countPerPoint * nPoint_P2PSend[iRecv]; /*--- Take advantage of cumulative storage format to get the number of elems that we need to recv. Note again that we select the send points here as the recv points. ---*/ - auto nPointP2P = nPoint_P2PSend[iRecv+1] - nPoint_P2PSend[iRecv]; + auto nPointP2P = nPoint_P2PSend[iRecv + 1] - nPoint_P2PSend[iRecv]; /*--- Total count can include multiple pieces of data per element. ---*/ - auto count = countPerPoint*nPointP2P; + auto count = countPerPoint * nPointP2P; /*--- Get the rank from which we receive the message. Note again that we use the send rank as the source instead of the recv rank. ---*/ @@ -431,33 +405,31 @@ void CGeometry::PostP2PRecvs(CGeometry *geometry, switch (commType) { case COMM_TYPE_DOUBLE: - SU2_MPI::Irecv(&(bufD_P2PSend[offset]), count, MPI_DOUBLE, - source, tag, SU2_MPI::GetComm(), &(req_P2PRecv[iRecv])); + SU2_MPI::Irecv(&(bufD_P2PSend[offset]), count, MPI_DOUBLE, source, tag, SU2_MPI::GetComm(), + &(req_P2PRecv[iRecv])); break; case COMM_TYPE_UNSIGNED_SHORT: - SU2_MPI::Irecv(&(bufS_P2PSend[offset]), count, MPI_UNSIGNED_SHORT, - source, tag, SU2_MPI::GetComm(), &(req_P2PRecv[iRecv])); + SU2_MPI::Irecv(&(bufS_P2PSend[offset]), count, MPI_UNSIGNED_SHORT, source, tag, SU2_MPI::GetComm(), + &(req_P2PRecv[iRecv])); break; default: - SU2_MPI::Error("Unrecognized data type for point-to-point MPI comms.", - CURRENT_FUNCTION); + SU2_MPI::Error("Unrecognized data type for point-to-point MPI comms.", CURRENT_FUNCTION); break; } } else { - /*--- Compute our location in the recv buffer. ---*/ - auto offset = countPerPoint*nPoint_P2PRecv[iRecv]; + auto offset = countPerPoint * nPoint_P2PRecv[iRecv]; /*--- Take advantage of cumulative storage format to get the number of elems that we need to recv. ---*/ - auto nPointP2P = nPoint_P2PRecv[iRecv+1] - nPoint_P2PRecv[iRecv]; + auto nPointP2P = nPoint_P2PRecv[iRecv + 1] - nPoint_P2PRecv[iRecv]; /*--- Total count can include multiple pieces of data per element. ---*/ - auto count = countPerPoint*nPointP2P; + auto count = countPerPoint * nPointP2P; /*--- Get the rank from which we receive the message. ---*/ @@ -468,33 +440,24 @@ void CGeometry::PostP2PRecvs(CGeometry *geometry, switch (commType) { case COMM_TYPE_DOUBLE: - SU2_MPI::Irecv(&(bufD_P2PRecv[offset]), count, MPI_DOUBLE, - source, tag, SU2_MPI::GetComm(), &(req_P2PRecv[iMessage])); + SU2_MPI::Irecv(&(bufD_P2PRecv[offset]), count, MPI_DOUBLE, source, tag, SU2_MPI::GetComm(), + &(req_P2PRecv[iMessage])); break; case COMM_TYPE_UNSIGNED_SHORT: - SU2_MPI::Irecv(&(bufS_P2PRecv[offset]), count, MPI_UNSIGNED_SHORT, - source, tag, SU2_MPI::GetComm(), &(req_P2PRecv[iMessage])); + SU2_MPI::Irecv(&(bufS_P2PRecv[offset]), count, MPI_UNSIGNED_SHORT, source, tag, SU2_MPI::GetComm(), + &(req_P2PRecv[iMessage])); break; default: - SU2_MPI::Error("Unrecognized data type for point-to-point MPI comms.", - CURRENT_FUNCTION); + SU2_MPI::Error("Unrecognized data type for point-to-point MPI comms.", CURRENT_FUNCTION); break; } - } - } END_SU2_OMP_MASTER - } -void CGeometry::PostP2PSends(CGeometry *geometry, - const CConfig *config, - unsigned short commType, - unsigned short countPerPoint, - int val_iSend, - bool val_reverse) const { - +void CGeometry::PostP2PSends(CGeometry* geometry, const CConfig* config, unsigned short commType, + unsigned short countPerPoint, int val_iSend, bool val_reverse) const { /*--- Post the non-blocking send as soon as the buffer is loaded. ---*/ /*--- In some instances related to the adjoint solver, we need @@ -503,21 +466,20 @@ void CGeometry::PostP2PSends(CGeometry *geometry, SU2_OMP_MASTER if (val_reverse) { - /*--- Compute our location in the buffer using the recv data structure since we are reversing the comms. ---*/ - auto offset = countPerPoint*nPoint_P2PRecv[val_iSend]; + auto offset = countPerPoint * nPoint_P2PRecv[val_iSend]; /*--- Take advantage of cumulative storage format to get the number of points that we need to send. Note again that we select the recv points here as the send points. ---*/ - auto nPointP2P = nPoint_P2PRecv[val_iSend+1] - nPoint_P2PRecv[val_iSend]; + auto nPointP2P = nPoint_P2PRecv[val_iSend + 1] - nPoint_P2PRecv[val_iSend]; /*--- Total count can include multiple pieces of data per element. ---*/ - auto count = countPerPoint*nPointP2P; + auto count = countPerPoint * nPointP2P; /*--- Get the rank to which we send the message. Note again that we use the recv rank as the dest instead of the send rank. ---*/ @@ -531,33 +493,31 @@ void CGeometry::PostP2PSends(CGeometry *geometry, switch (commType) { case COMM_TYPE_DOUBLE: - SU2_MPI::Isend(&(bufD_P2PRecv[offset]), count, MPI_DOUBLE, - dest, tag, SU2_MPI::GetComm(), &(req_P2PSend[val_iSend])); + SU2_MPI::Isend(&(bufD_P2PRecv[offset]), count, MPI_DOUBLE, dest, tag, SU2_MPI::GetComm(), + &(req_P2PSend[val_iSend])); break; case COMM_TYPE_UNSIGNED_SHORT: - SU2_MPI::Isend(&(bufS_P2PRecv[offset]), count, MPI_UNSIGNED_SHORT, - dest, tag, SU2_MPI::GetComm(), &(req_P2PSend[val_iSend])); + SU2_MPI::Isend(&(bufS_P2PRecv[offset]), count, MPI_UNSIGNED_SHORT, dest, tag, SU2_MPI::GetComm(), + &(req_P2PSend[val_iSend])); break; default: - SU2_MPI::Error("Unrecognized data type for point-to-point MPI comms.", - CURRENT_FUNCTION); + SU2_MPI::Error("Unrecognized data type for point-to-point MPI comms.", CURRENT_FUNCTION); break; } } else { - /*--- Compute our location in the send buffer. ---*/ - auto offset = countPerPoint*nPoint_P2PSend[val_iSend]; + auto offset = countPerPoint * nPoint_P2PSend[val_iSend]; /*--- Take advantage of cumulative storage format to get the number of points that we need to send. ---*/ - auto nPointP2P = nPoint_P2PSend[val_iSend+1] - nPoint_P2PSend[val_iSend]; + auto nPointP2P = nPoint_P2PSend[val_iSend + 1] - nPoint_P2PSend[val_iSend]; /*--- Total count can include multiple pieces of data per element. ---*/ - auto count = countPerPoint*nPointP2P; + auto count = countPerPoint * nPointP2P; /*--- Get the rank to which we send the message. ---*/ @@ -568,70 +528,61 @@ void CGeometry::PostP2PSends(CGeometry *geometry, switch (commType) { case COMM_TYPE_DOUBLE: - SU2_MPI::Isend(&(bufD_P2PSend[offset]), count, MPI_DOUBLE, - dest, tag, SU2_MPI::GetComm(), &(req_P2PSend[val_iSend])); + SU2_MPI::Isend(&(bufD_P2PSend[offset]), count, MPI_DOUBLE, dest, tag, SU2_MPI::GetComm(), + &(req_P2PSend[val_iSend])); break; case COMM_TYPE_UNSIGNED_SHORT: - SU2_MPI::Isend(&(bufS_P2PSend[offset]), count, MPI_UNSIGNED_SHORT, - dest, tag, SU2_MPI::GetComm(), &(req_P2PSend[val_iSend])); + SU2_MPI::Isend(&(bufS_P2PSend[offset]), count, MPI_UNSIGNED_SHORT, dest, tag, SU2_MPI::GetComm(), + &(req_P2PSend[val_iSend])); break; default: - SU2_MPI::Error("Unrecognized data type for point-to-point MPI comms.", - CURRENT_FUNCTION); + SU2_MPI::Error("Unrecognized data type for point-to-point MPI comms.", CURRENT_FUNCTION); break; } - } END_SU2_OMP_MASTER - } -void CGeometry::GetCommCountAndType(const CConfig* config, - unsigned short commType, - unsigned short &COUNT_PER_POINT, - unsigned short &MPI_TYPE) const { +void CGeometry::GetCommCountAndType(const CConfig* config, unsigned short commType, unsigned short& COUNT_PER_POINT, + unsigned short& MPI_TYPE) const { switch (commType) { case COORDINATES: - COUNT_PER_POINT = nDim; - MPI_TYPE = COMM_TYPE_DOUBLE; + COUNT_PER_POINT = nDim; + MPI_TYPE = COMM_TYPE_DOUBLE; break; case GRID_VELOCITY: - COUNT_PER_POINT = nDim; - MPI_TYPE = COMM_TYPE_DOUBLE; + COUNT_PER_POINT = nDim; + MPI_TYPE = COMM_TYPE_DOUBLE; break; case COORDINATES_OLD: if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND) - COUNT_PER_POINT = nDim*2; + COUNT_PER_POINT = nDim * 2; else - COUNT_PER_POINT = nDim; - MPI_TYPE = COMM_TYPE_DOUBLE; + COUNT_PER_POINT = nDim; + MPI_TYPE = COMM_TYPE_DOUBLE; break; case MAX_LENGTH: - COUNT_PER_POINT = 1; - MPI_TYPE = COMM_TYPE_DOUBLE; + COUNT_PER_POINT = 1; + MPI_TYPE = COMM_TYPE_DOUBLE; break; case NEIGHBORS: - COUNT_PER_POINT = 1; - MPI_TYPE = COMM_TYPE_UNSIGNED_SHORT; + COUNT_PER_POINT = 1; + MPI_TYPE = COMM_TYPE_UNSIGNED_SHORT; break; default: - SU2_MPI::Error("Unrecognized quantity for point-to-point MPI comms.", - CURRENT_FUNCTION); + SU2_MPI::Error("Unrecognized quantity for point-to-point MPI comms.", CURRENT_FUNCTION); break; } } -void CGeometry::InitiateComms(CGeometry *geometry, - const CConfig *config, - unsigned short commType) const { - +void CGeometry::InitiateComms(CGeometry* geometry, const CConfig* config, unsigned short commType) const { if (nP2PSend == 0) return; /*--- Local variables ---*/ unsigned short iDim; unsigned short COUNT_PER_POINT = 0; - unsigned short MPI_TYPE = 0; + unsigned short MPI_TYPE = 0; unsigned long iPoint, msg_offset, buf_offset; @@ -650,10 +601,10 @@ void CGeometry::InitiateComms(CGeometry *geometry, /*--- Set some local pointers to make access simpler. ---*/ - su2double *bufDSend = geometry->bufD_P2PSend; - unsigned short *bufSSend = geometry->bufS_P2PSend; + su2double* bufDSend = geometry->bufD_P2PSend; + unsigned short* bufSSend = geometry->bufS_P2PSend; - su2double *vector = nullptr; + su2double* vector = nullptr; /*--- Load the specified quantity from the solver into the generic communication buffer in the geometry class. ---*/ @@ -663,46 +614,42 @@ void CGeometry::InitiateComms(CGeometry *geometry, geometry->PostP2PRecvs(geometry, config, MPI_TYPE, COUNT_PER_POINT, false); for (iMessage = 0; iMessage < nP2PSend; iMessage++) { - /*--- Get the offset in the buffer for the start of this message. ---*/ msg_offset = nPoint_P2PSend[iMessage]; /*--- Total count can include multiple pieces of data per element. ---*/ - nSend = (nPoint_P2PSend[iMessage+1] - nPoint_P2PSend[iMessage]); + nSend = (nPoint_P2PSend[iMessage + 1] - nPoint_P2PSend[iMessage]); SU2_OMP_FOR_STAT(OMP_MIN_SIZE) for (iSend = 0; iSend < nSend; iSend++) { - /*--- Get the local index for this communicated data. ---*/ iPoint = geometry->Local_Point_P2PSend[msg_offset + iSend]; /*--- Compute the offset in the recv buffer for this point. ---*/ - buf_offset = (msg_offset + iSend)*COUNT_PER_POINT; + buf_offset = (msg_offset + iSend) * COUNT_PER_POINT; switch (commType) { case COORDINATES: vector = nodes->GetCoord(iPoint); - for (iDim = 0; iDim < nDim; iDim++) - bufDSend[buf_offset+iDim] = vector[iDim]; + for (iDim = 0; iDim < nDim; iDim++) bufDSend[buf_offset + iDim] = vector[iDim]; break; case GRID_VELOCITY: vector = nodes->GetGridVel(iPoint); - for (iDim = 0; iDim < nDim; iDim++) - bufDSend[buf_offset+iDim] = vector[iDim]; + for (iDim = 0; iDim < nDim; iDim++) bufDSend[buf_offset + iDim] = vector[iDim]; break; case COORDINATES_OLD: vector = nodes->GetCoord_n(iPoint); for (iDim = 0; iDim < nDim; iDim++) { - bufDSend[buf_offset+iDim] = vector[iDim]; + bufDSend[buf_offset + iDim] = vector[iDim]; } if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND) { vector = nodes->GetCoord_n1(iPoint); for (iDim = 0; iDim < nDim; iDim++) { - bufDSend[buf_offset+nDim+iDim] = vector[iDim]; + bufDSend[buf_offset + nDim + iDim] = vector[iDim]; } } break; @@ -713,8 +660,7 @@ void CGeometry::InitiateComms(CGeometry *geometry, bufSSend[buf_offset] = geometry->nodes->GetnNeighbor(iPoint); break; default: - SU2_MPI::Error("Unrecognized quantity for point-to-point MPI comms.", - CURRENT_FUNCTION); + SU2_MPI::Error("Unrecognized quantity for point-to-point MPI comms.", CURRENT_FUNCTION); break; } } @@ -723,15 +669,10 @@ void CGeometry::InitiateComms(CGeometry *geometry, /*--- Launch the point-to-point MPI send for this message. ---*/ geometry->PostP2PSends(geometry, config, MPI_TYPE, COUNT_PER_POINT, iMessage, false); - } - } -void CGeometry::CompleteComms(CGeometry *geometry, - const CConfig *config, - unsigned short commType) { - +void CGeometry::CompleteComms(CGeometry* geometry, const CConfig* config, unsigned short commType) { if (nP2PRecv == 0) return; /*--- Local variables ---*/ @@ -750,8 +691,8 @@ void CGeometry::CompleteComms(CGeometry *geometry, /*--- Set some local pointers to make access simpler. ---*/ - const su2double *bufDRecv = geometry->bufD_P2PRecv; - const unsigned short *bufSRecv = geometry->bufS_P2PRecv; + const su2double* bufDRecv = geometry->bufD_P2PRecv; + const unsigned short* bufSRecv = geometry->bufS_P2PRecv; /*--- Store the data that was communicated into the appropriate location within the local class data structures. Note that we @@ -759,7 +700,6 @@ void CGeometry::CompleteComms(CGeometry *geometry, non-blocking comms. ---*/ for (iMessage = 0; iMessage < nP2PRecv; iMessage++) { - /*--- For efficiency, recv the messages dynamically based on the order they arrive. ---*/ @@ -779,34 +719,31 @@ void CGeometry::CompleteComms(CGeometry *geometry, /*--- Get the number of packets to be received in this message. ---*/ - nRecv = nPoint_P2PRecv[jRecv+1] - nPoint_P2PRecv[jRecv]; + nRecv = nPoint_P2PRecv[jRecv + 1] - nPoint_P2PRecv[jRecv]; SU2_OMP_FOR_STAT(OMP_MIN_SIZE) for (iRecv = 0; iRecv < nRecv; iRecv++) { - /*--- Get the local index for this communicated data. ---*/ iPoint = geometry->Local_Point_P2PRecv[msg_offset + iRecv]; /*--- Compute the total offset in the recv buffer for this point. ---*/ - buf_offset = (msg_offset + iRecv)*COUNT_PER_POINT; + buf_offset = (msg_offset + iRecv) * COUNT_PER_POINT; /*--- Store the data correctly depending on the quantity. ---*/ switch (commType) { case COORDINATES: - for (iDim = 0; iDim < nDim; iDim++) - nodes->SetCoord(iPoint, iDim, bufDRecv[buf_offset+iDim]); + for (iDim = 0; iDim < nDim; iDim++) nodes->SetCoord(iPoint, iDim, bufDRecv[buf_offset + iDim]); break; case GRID_VELOCITY: - for (iDim = 0; iDim < nDim; iDim++) - nodes->SetGridVel(iPoint, iDim, bufDRecv[buf_offset+iDim]); + for (iDim = 0; iDim < nDim; iDim++) nodes->SetGridVel(iPoint, iDim, bufDRecv[buf_offset + iDim]); break; case COORDINATES_OLD: nodes->SetCoord_n(iPoint, &bufDRecv[buf_offset]); if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND) - nodes->SetCoord_n1(iPoint, &bufDRecv[buf_offset+nDim]); + nodes->SetCoord_n1(iPoint, &bufDRecv[buf_offset + nDim]); break; case MAX_LENGTH: nodes->SetMaxLength(iPoint, bufDRecv[buf_offset]); @@ -815,8 +752,7 @@ void CGeometry::CompleteComms(CGeometry *geometry, nodes->SetnNeighbor(iPoint, bufSRecv[buf_offset]); break; default: - SU2_MPI::Error("Unrecognized quantity for point-to-point MPI comms.", - CURRENT_FUNCTION); + SU2_MPI::Error("Unrecognized quantity for point-to-point MPI comms.", CURRENT_FUNCTION); break; } } @@ -832,9 +768,7 @@ void CGeometry::CompleteComms(CGeometry *geometry, #endif } -void CGeometry::PreprocessPeriodicComms(CGeometry *geometry, - CConfig *config) { - +void CGeometry::PreprocessPeriodicComms(CGeometry* geometry, CConfig* config) { /*--- We start with the send and receive lists already available in the form of stored periodic point-donor pairs. We will loop through these markers and establish the neighboring ranks and number of @@ -854,16 +788,19 @@ void CGeometry::PreprocessPeriodicComms(CGeometry *geometry, /*--- Create some temporary structures for tracking sends/recvs. ---*/ - int *nPoint_Send_All = new int[size+1]; nPoint_Send_All[0] = 0; - int *nPoint_Recv_All = new int[size+1]; nPoint_Recv_All[0] = 0; - int *nPoint_Flag = new int[size]; + int* nPoint_Send_All = new int[size + 1]; + nPoint_Send_All[0] = 0; + int* nPoint_Recv_All = new int[size + 1]; + nPoint_Recv_All[0] = 0; + int* nPoint_Flag = new int[size]; for (iRank = 0; iRank < size; iRank++) { nPoint_Send_All[iRank] = 0; nPoint_Recv_All[iRank] = 0; - nPoint_Flag[iRank]= -1; + nPoint_Flag[iRank] = -1; } - nPoint_Send_All[size] = 0; nPoint_Recv_All[size] = 0; + nPoint_Send_All[size] = 0; + nPoint_Recv_All[size] = 0; /*--- Loop through all of our periodic markers and track our sends with each rank. ---*/ @@ -872,7 +809,6 @@ void CGeometry::PreprocessPeriodicComms(CGeometry *geometry, if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { iPeriodic = config->GetMarker_All_PerBound(iMarker); for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - /*--- Get the current periodic point index. We only communicate the owned nodes on a rank, as the MPI comms will take care of the halos after completing the periodic comms. ---*/ @@ -880,7 +816,6 @@ void CGeometry::PreprocessPeriodicComms(CGeometry *geometry, iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); if (geometry->nodes->GetDomain(iPoint)) { - /*--- Get the rank that holds the matching periodic point on the other marker in the periodic pair. ---*/ @@ -890,23 +825,21 @@ void CGeometry::PreprocessPeriodicComms(CGeometry *geometry, number of points that must be sent to a particular proc. ---*/ if ((nPoint_Flag[iRank] != (int)iPoint)) { - nPoint_Flag[iRank] = (int)iPoint; - nPoint_Send_All[iRank+1] += 1; + nPoint_Flag[iRank] = (int)iPoint; + nPoint_Send_All[iRank + 1] += 1; } - } } } } - delete [] nPoint_Flag; + delete[] nPoint_Flag; /*--- Communicate the number of points to be sent/recv'd amongst all processors. After this communication, each proc knows how many periodic points it will receive from each other processor. ---*/ - SU2_MPI::Alltoall(&(nPoint_Send_All[1]), 1, MPI_INT, - &(nPoint_Recv_All[1]), 1, MPI_INT, SU2_MPI::GetComm()); + SU2_MPI::Alltoall(&(nPoint_Send_All[1]), 1, MPI_INT, &(nPoint_Recv_All[1]), 1, MPI_INT, SU2_MPI::GetComm()); /*--- Check how many messages we will be sending and receiving. Here we also put the counters into cumulative storage format to @@ -914,34 +847,38 @@ void CGeometry::PreprocessPeriodicComms(CGeometry *geometry, rank to communicate to themselves in these counters, although it will not be done through MPI. ---*/ - nPeriodicSend = 0; nPeriodicRecv = 0; + nPeriodicSend = 0; + nPeriodicRecv = 0; for (iRank = 0; iRank < size; iRank++) { - if ((nPoint_Send_All[iRank+1] > 0)) nPeriodicSend++; - if ((nPoint_Recv_All[iRank+1] > 0)) nPeriodicRecv++; + if ((nPoint_Send_All[iRank + 1] > 0)) nPeriodicSend++; + if ((nPoint_Recv_All[iRank + 1] > 0)) nPeriodicRecv++; - nPoint_Send_All[iRank+1] += nPoint_Send_All[iRank]; - nPoint_Recv_All[iRank+1] += nPoint_Recv_All[iRank]; + nPoint_Send_All[iRank + 1] += nPoint_Send_All[iRank]; + nPoint_Recv_All[iRank + 1] += nPoint_Recv_All[iRank]; } /*--- Allocate only as much memory as needed for the periodic neighbors. ---*/ - nPoint_PeriodicSend = new int[nPeriodicSend+1]; nPoint_PeriodicSend[0] = 0; - nPoint_PeriodicRecv = new int[nPeriodicRecv+1]; nPoint_PeriodicRecv[0] = 0; + nPoint_PeriodicSend = new int[nPeriodicSend + 1]; + nPoint_PeriodicSend[0] = 0; + nPoint_PeriodicRecv = new int[nPeriodicRecv + 1]; + nPoint_PeriodicRecv[0] = 0; Neighbors_PeriodicSend = new int[nPeriodicSend]; Neighbors_PeriodicRecv = new int[nPeriodicRecv]; - iSend = 0; iRecv = 0; + iSend = 0; + iRecv = 0; for (iRank = 0; iRank < size; iRank++) { - if ((nPoint_Send_All[iRank+1] > nPoint_Send_All[iRank])) { + if ((nPoint_Send_All[iRank + 1] > nPoint_Send_All[iRank])) { Neighbors_PeriodicSend[iSend] = iRank; - nPoint_PeriodicSend[iSend+1] = nPoint_Send_All[iRank+1]; + nPoint_PeriodicSend[iSend + 1] = nPoint_Send_All[iRank + 1]; iSend++; } - if ((nPoint_Recv_All[iRank+1] > nPoint_Recv_All[iRank])) { + if ((nPoint_Recv_All[iRank + 1] > nPoint_Recv_All[iRank])) { Neighbors_PeriodicRecv[iRecv] = iRank; - nPoint_PeriodicRecv[iRecv+1] = nPoint_Recv_All[iRank+1]; + nPoint_PeriodicRecv[iRecv + 1] = nPoint_Recv_All[iRank + 1]; iRecv++; } } @@ -951,38 +888,32 @@ void CGeometry::PreprocessPeriodicComms(CGeometry *geometry, messages dynamically later during the iterations. ---*/ PeriodicSend2Neighbor.clear(); - for (iSend = 0; iSend < nPeriodicSend; iSend++) - PeriodicSend2Neighbor[Neighbors_PeriodicSend[iSend]] = iSend; + for (iSend = 0; iSend < nPeriodicSend; iSend++) PeriodicSend2Neighbor[Neighbors_PeriodicSend[iSend]] = iSend; PeriodicRecv2Neighbor.clear(); - for (iRecv = 0; iRecv < nPeriodicRecv; iRecv++) - PeriodicRecv2Neighbor[Neighbors_PeriodicRecv[iRecv]] = iRecv; + for (iRecv = 0; iRecv < nPeriodicRecv; iRecv++) PeriodicRecv2Neighbor[Neighbors_PeriodicRecv[iRecv]] = iRecv; - delete [] nPoint_Send_All; - delete [] nPoint_Recv_All; + delete[] nPoint_Send_All; + delete[] nPoint_Recv_All; /*--- Allocate the memory to store the local index values for both the send and receive periodic points and periodic index. ---*/ Local_Point_PeriodicSend = nullptr; Local_Point_PeriodicSend = new unsigned long[nPoint_PeriodicSend[nPeriodicSend]]; - for (iSend = 0; iSend < nPoint_PeriodicSend[nPeriodicSend]; iSend++) - Local_Point_PeriodicSend[iSend] = 0; + for (iSend = 0; iSend < nPoint_PeriodicSend[nPeriodicSend]; iSend++) Local_Point_PeriodicSend[iSend] = 0; Local_Marker_PeriodicSend = nullptr; Local_Marker_PeriodicSend = new unsigned long[nPoint_PeriodicSend[nPeriodicSend]]; - for (iSend = 0; iSend < nPoint_PeriodicSend[nPeriodicSend]; iSend++) - Local_Marker_PeriodicSend[iSend] = 0; + for (iSend = 0; iSend < nPoint_PeriodicSend[nPeriodicSend]; iSend++) Local_Marker_PeriodicSend[iSend] = 0; Local_Point_PeriodicRecv = nullptr; Local_Point_PeriodicRecv = new unsigned long[nPoint_PeriodicRecv[nPeriodicRecv]]; - for (iRecv = 0; iRecv < nPoint_PeriodicRecv[nPeriodicRecv]; iRecv++) - Local_Point_PeriodicRecv[iRecv] = 0; + for (iRecv = 0; iRecv < nPoint_PeriodicRecv[nPeriodicRecv]; iRecv++) Local_Point_PeriodicRecv[iRecv] = 0; Local_Marker_PeriodicRecv = nullptr; Local_Marker_PeriodicRecv = new unsigned long[nPoint_PeriodicRecv[nPeriodicRecv]]; - for (iRecv = 0; iRecv < nPoint_PeriodicRecv[nPeriodicRecv]; iRecv++) - Local_Marker_PeriodicRecv[iRecv] = 0; + for (iRecv = 0; iRecv < nPoint_PeriodicRecv[nPeriodicRecv]; iRecv++) Local_Marker_PeriodicRecv[iRecv] = 0; /*--- We allocate the buffers for communicating values in a later step once we know the maximum packet size that we need to communicate. This @@ -998,10 +929,10 @@ void CGeometry::PreprocessPeriodicComms(CGeometry *geometry, /*--- Allocate memory for the MPI requests if we need to communicate. ---*/ if (nPeriodicSend > 0) { - req_PeriodicSend = new SU2_MPI::Request[nPeriodicSend]; + req_PeriodicSend = new SU2_MPI::Request[nPeriodicSend]; } if (nPeriodicRecv > 0) { - req_PeriodicRecv = new SU2_MPI::Request[nPeriodicRecv]; + req_PeriodicRecv = new SU2_MPI::Request[nPeriodicRecv]; } /*--- Allocate arrays for sending the periodic point index and marker @@ -1009,19 +940,18 @@ void CGeometry::PreprocessPeriodicComms(CGeometry *geometry, the recv rank can quickly loop through the buffers to unpack the data. ---*/ unsigned short nPackets = 2; - unsigned long *idSend = new unsigned long[nPoint_PeriodicSend[nPeriodicSend]*nPackets]; - for (iSend = 0; iSend < nPoint_PeriodicSend[nPeriodicSend]*nPackets; iSend++) - idSend[iSend] = 0; + auto* idSend = new unsigned long[nPoint_PeriodicSend[nPeriodicSend] * nPackets]; + for (iSend = 0; iSend < nPoint_PeriodicSend[nPeriodicSend] * nPackets; iSend++) idSend[iSend] = 0; /*--- Build the lists of local index and periodic marker index values. ---*/ - ii = 0; jj = 0; + ii = 0; + jj = 0; for (iSend = 0; iSend < nPeriodicSend; iSend++) { for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { iPeriodic = config->GetMarker_All_PerBound(iMarker); for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - /*--- Get the current periodic point index. We only communicate the owned nodes on a rank, as the MPI comms will take care of the halos after completing the periodic comms. ---*/ @@ -1029,7 +959,6 @@ void CGeometry::PreprocessPeriodicComms(CGeometry *geometry, iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); if (geometry->nodes->GetDomain(iPoint)) { - /*--- Get the rank that holds the matching periodic point on the other marker in the periodic pair. ---*/ @@ -1041,15 +970,14 @@ void CGeometry::PreprocessPeriodicComms(CGeometry *geometry, index to be communicated to the recv rank. ---*/ if (iRank == Neighbors_PeriodicSend[iSend]) { - Local_Point_PeriodicSend[ii] = iPoint; + Local_Point_PeriodicSend[ii] = iPoint; Local_Marker_PeriodicSend[ii] = (unsigned long)iMarker; - jj = ii*nPackets; + jj = ii * nPackets; idSend[jj] = geometry->vertex[iMarker][iVertex]->GetDonorPoint(); jj++; idSend[jj] = (unsigned long)iPeriodic; ii++; } - } } } @@ -1059,9 +987,8 @@ void CGeometry::PreprocessPeriodicComms(CGeometry *geometry, /*--- Allocate arrays for receiving the periodic point index and marker index to the recv rank so that it can store the local values. ---*/ - unsigned long *idRecv = new unsigned long[nPoint_PeriodicRecv[nPeriodicRecv]*nPackets]; - for (iRecv = 0; iRecv < nPoint_PeriodicRecv[nPeriodicRecv]*nPackets; iRecv++) - idRecv[iRecv] = 0; + auto* idRecv = new unsigned long[nPoint_PeriodicRecv[nPeriodicRecv] * nPackets]; + for (iRecv = 0; iRecv < nPoint_PeriodicRecv[nPeriodicRecv] * nPackets; iRecv++) idRecv[iRecv] = 0; #ifdef HAVE_MPI @@ -1073,62 +1000,56 @@ void CGeometry::PreprocessPeriodicComms(CGeometry *geometry, iMessage = 0; for (iRecv = 0; iRecv < nPeriodicRecv; iRecv++) { - /*--- Compute our location in the recv buffer. ---*/ - offset = nPackets*nPoint_PeriodicRecv[iRecv]; + offset = nPackets * nPoint_PeriodicRecv[iRecv]; /*--- Take advantage of cumulative storage format to get the number of elems that we need to recv. ---*/ - count = nPackets*(nPoint_PeriodicRecv[iRecv+1] - nPoint_PeriodicRecv[iRecv]); + count = nPackets * (nPoint_PeriodicRecv[iRecv + 1] - nPoint_PeriodicRecv[iRecv]); /*--- Get the rank from which we receive the message. ---*/ source = Neighbors_PeriodicRecv[iRecv]; - tag = source + 1; + tag = source + 1; /*--- Post non-blocking recv for this proc. ---*/ - SU2_MPI::Irecv(&(static_cast(idRecv)[offset]), - count, MPI_UNSIGNED_LONG, source, tag, SU2_MPI::GetComm(), - &(req_PeriodicRecv[iMessage])); + SU2_MPI::Irecv(&(static_cast(idRecv)[offset]), count, MPI_UNSIGNED_LONG, source, tag, + SU2_MPI::GetComm(), &(req_PeriodicRecv[iMessage])); /*--- Increment message counter. ---*/ iMessage++; - } /*--- Post the non-blocking sends. ---*/ iMessage = 0; for (iSend = 0; iSend < nPeriodicSend; iSend++) { - /*--- Compute our location in the send buffer. ---*/ - offset = nPackets*nPoint_PeriodicSend[iSend]; + offset = nPackets * nPoint_PeriodicSend[iSend]; /*--- Take advantage of cumulative storage format to get the number of points that we need to send. ---*/ - count = nPackets*(nPoint_PeriodicSend[iSend+1] - nPoint_PeriodicSend[iSend]); + count = nPackets * (nPoint_PeriodicSend[iSend + 1] - nPoint_PeriodicSend[iSend]); /*--- Get the rank to which we send the message. ---*/ dest = Neighbors_PeriodicSend[iSend]; - tag = rank + 1; + tag = rank + 1; /*--- Post non-blocking send for this proc. ---*/ - SU2_MPI::Isend(&(static_cast(idSend)[offset]), - count, MPI_UNSIGNED_LONG, dest, tag, SU2_MPI::GetComm(), - &(req_PeriodicSend[iMessage])); + SU2_MPI::Isend(&(static_cast(idSend)[offset]), count, MPI_UNSIGNED_LONG, dest, tag, + SU2_MPI::GetComm(), &(req_PeriodicSend[iMessage])); /*--- Increment message counter. ---*/ iMessage++; - } /*--- Wait for the non-blocking comms to complete. ---*/ @@ -1142,10 +1063,10 @@ void CGeometry::PreprocessPeriodicComms(CGeometry *geometry, int myStart, myFinal; for (int val_iSend = 0; val_iSend < nPeriodicSend; val_iSend++) { - iRank = geometry->PeriodicRecv2Neighbor[rank]; - iRecv = geometry->nPoint_PeriodicRecv[iRank]*nPackets; - myStart = nPoint_PeriodicSend[val_iSend]*nPackets; - myFinal = nPoint_PeriodicSend[val_iSend+1]*nPackets; + iRank = geometry->PeriodicRecv2Neighbor[rank]; + iRecv = geometry->nPoint_PeriodicRecv[iRank] * nPackets; + myStart = nPoint_PeriodicSend[val_iSend] * nPackets; + myFinal = nPoint_PeriodicSend[val_iSend + 1] * nPackets; for (iSend = myStart; iSend < myFinal; iSend++) { idRecv[iRecv] = idSend[iSend]; iRecv++; @@ -1159,17 +1080,17 @@ void CGeometry::PreprocessPeriodicComms(CGeometry *geometry, ii = 0; for (iRecv = 0; iRecv < nPoint_PeriodicRecv[nPeriodicRecv]; iRecv++) { - Local_Point_PeriodicRecv[iRecv] = idRecv[ii]; ii++; - Local_Marker_PeriodicRecv[iRecv] = idRecv[ii]; ii++; + Local_Point_PeriodicRecv[iRecv] = idRecv[ii]; + ii++; + Local_Marker_PeriodicRecv[iRecv] = idRecv[ii]; + ii++; } - delete [] idSend; - delete [] idRecv; - + delete[] idSend; + delete[] idRecv; } void CGeometry::AllocatePeriodicComms(unsigned short countPerPeriodicPoint) { - /*--- This routine is activated whenever we attempt to perform a periodic MPI communication with our neighbors but the memory buffer allocated is not large enough for the packet size. @@ -1180,39 +1101,34 @@ void CGeometry::AllocatePeriodicComms(unsigned short countPerPeriodicPoint) { if (countPerPeriodicPoint <= maxCountPerPeriodicPoint) return; BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS { + /*--- Store the larger packet size to the class data. ---*/ - /*--- Store the larger packet size to the class data. ---*/ + maxCountPerPeriodicPoint = countPerPeriodicPoint; - maxCountPerPeriodicPoint = countPerPeriodicPoint; + /*--- Store the total size of the send/recv arrays for clarity. ---*/ - /*--- Store the total size of the send/recv arrays for clarity. ---*/ + auto nSend = countPerPeriodicPoint * nPoint_PeriodicSend[nPeriodicSend]; + auto nRecv = countPerPeriodicPoint * nPoint_PeriodicRecv[nPeriodicRecv]; - auto nSend = countPerPeriodicPoint*nPoint_PeriodicSend[nPeriodicSend]; - auto nRecv = countPerPeriodicPoint*nPoint_PeriodicRecv[nPeriodicRecv]; + /*-- Deallocate and reallocate our cummunication memory. ---*/ - /*-- Deallocate and reallocate our cummunication memory. ---*/ + delete[] bufD_PeriodicSend; + bufD_PeriodicSend = new su2double[nSend](); - delete [] bufD_PeriodicSend; - bufD_PeriodicSend = new su2double[nSend] (); + delete[] bufD_PeriodicRecv; + bufD_PeriodicRecv = new su2double[nRecv](); - delete [] bufD_PeriodicRecv; - bufD_PeriodicRecv = new su2double[nRecv] (); - - delete [] bufS_PeriodicSend; - bufS_PeriodicSend = new unsigned short[nSend] (); - - delete [] bufS_PeriodicRecv; - bufS_PeriodicRecv = new unsigned short[nRecv] (); + delete[] bufS_PeriodicSend; + bufS_PeriodicSend = new unsigned short[nSend](); + delete[] bufS_PeriodicRecv; + bufS_PeriodicRecv = new unsigned short[nRecv](); } END_SU2_OMP_SAFE_GLOBAL_ACCESS } -void CGeometry::PostPeriodicRecvs(CGeometry *geometry, - const CConfig *config, - unsigned short commType, +void CGeometry::PostPeriodicRecvs(CGeometry* geometry, const CConfig* config, unsigned short commType, unsigned short countPerPeriodicPoint) { - /*--- In parallel, communicate the data with non-blocking send/recv. ---*/ #ifdef HAVE_MPI @@ -1223,19 +1139,18 @@ void CGeometry::PostPeriodicRecvs(CGeometry *geometry, SU2_OMP_MASTER for (int iRecv = 0; iRecv < nPeriodicRecv; iRecv++) { - /*--- Compute our location in the recv buffer. ---*/ - auto offset = countPerPeriodicPoint*nPoint_PeriodicRecv[iRecv]; + auto offset = countPerPeriodicPoint * nPoint_PeriodicRecv[iRecv]; /*--- Take advantage of cumulative storage format to get the number of elems that we need to recv. ---*/ - auto nPointPeriodic = nPoint_PeriodicRecv[iRecv+1] - nPoint_PeriodicRecv[iRecv]; + auto nPointPeriodic = nPoint_PeriodicRecv[iRecv + 1] - nPoint_PeriodicRecv[iRecv]; /*--- Total count can include multiple pieces of data per element. ---*/ - auto count = countPerPeriodicPoint*nPointPeriodic; + auto count = countPerPeriodicPoint * nPointPeriodic; /*--- Get the rank from which we receive the message. ---*/ @@ -1246,77 +1161,64 @@ void CGeometry::PostPeriodicRecvs(CGeometry *geometry, switch (commType) { case COMM_TYPE_DOUBLE: - SU2_MPI::Irecv(&(static_cast(bufD_PeriodicRecv)[offset]), - count, MPI_DOUBLE, source, tag, SU2_MPI::GetComm(), - &(req_PeriodicRecv[iRecv])); + SU2_MPI::Irecv(&(static_cast(bufD_PeriodicRecv)[offset]), count, MPI_DOUBLE, source, tag, + SU2_MPI::GetComm(), &(req_PeriodicRecv[iRecv])); break; case COMM_TYPE_UNSIGNED_SHORT: - SU2_MPI::Irecv(&(static_cast(bufS_PeriodicRecv)[offset]), - count, MPI_UNSIGNED_SHORT, source, tag, SU2_MPI::GetComm(), - &(req_PeriodicRecv[iRecv])); + SU2_MPI::Irecv(&(static_cast(bufS_PeriodicRecv)[offset]), count, MPI_UNSIGNED_SHORT, source, + tag, SU2_MPI::GetComm(), &(req_PeriodicRecv[iRecv])); break; default: - SU2_MPI::Error("Unrecognized data type for periodic MPI comms.", - CURRENT_FUNCTION); + SU2_MPI::Error("Unrecognized data type for periodic MPI comms.", CURRENT_FUNCTION); break; } - } END_SU2_OMP_MASTER #endif - } -void CGeometry::PostPeriodicSends(CGeometry *geometry, - const CConfig *config, - unsigned short commType, - unsigned short countPerPeriodicPoint, - int val_iSend) const { - +void CGeometry::PostPeriodicSends(CGeometry* geometry, const CConfig* config, unsigned short commType, + unsigned short countPerPeriodicPoint, int val_iSend) const { /*--- In parallel, communicate the data with non-blocking send/recv. ---*/ #ifdef HAVE_MPI SU2_OMP_MASTER { - /*--- Post the non-blocking send as soon as the buffer is loaded. ---*/ + /*--- Post the non-blocking send as soon as the buffer is loaded. ---*/ - /*--- Compute our location in the send buffer. ---*/ + /*--- Compute our location in the send buffer. ---*/ - auto offset = countPerPeriodicPoint*nPoint_PeriodicSend[val_iSend]; + auto offset = countPerPeriodicPoint * nPoint_PeriodicSend[val_iSend]; - /*--- Take advantage of cumulative storage format to get the number - of points that we need to send. ---*/ + /*--- Take advantage of cumulative storage format to get the number + of points that we need to send. ---*/ - auto nPointPeriodic = (nPoint_PeriodicSend[val_iSend+1] - - nPoint_PeriodicSend[val_iSend]); + auto nPointPeriodic = (nPoint_PeriodicSend[val_iSend + 1] - nPoint_PeriodicSend[val_iSend]); - /*--- Total count can include multiple pieces of data per element. ---*/ + /*--- Total count can include multiple pieces of data per element. ---*/ - auto count = countPerPeriodicPoint*nPointPeriodic; + auto count = countPerPeriodicPoint * nPointPeriodic; - /*--- Get the rank to which we send the message. ---*/ + /*--- Get the rank to which we send the message. ---*/ - auto dest = Neighbors_PeriodicSend[val_iSend]; - auto tag = rank + 1; + auto dest = Neighbors_PeriodicSend[val_iSend]; + auto tag = rank + 1; - /*--- Post non-blocking send for this proc. ---*/ + /*--- Post non-blocking send for this proc. ---*/ - switch (commType) { - case COMM_TYPE_DOUBLE: - SU2_MPI::Isend(&(static_cast(bufD_PeriodicSend)[offset]), - count, MPI_DOUBLE, dest, tag, SU2_MPI::GetComm(), - &(req_PeriodicSend[val_iSend])); - break; - case COMM_TYPE_UNSIGNED_SHORT: - SU2_MPI::Isend(&(static_cast(bufS_PeriodicSend)[offset]), - count, MPI_UNSIGNED_SHORT, dest, tag, SU2_MPI::GetComm(), - &(req_PeriodicSend[val_iSend])); - break; - default: - SU2_MPI::Error("Unrecognized data type for periodic MPI comms.", - CURRENT_FUNCTION); - break; - } + switch (commType) { + case COMM_TYPE_DOUBLE: + SU2_MPI::Isend(&(static_cast(bufD_PeriodicSend)[offset]), count, MPI_DOUBLE, dest, tag, + SU2_MPI::GetComm(), &(req_PeriodicSend[val_iSend])); + break; + case COMM_TYPE_UNSIGNED_SHORT: + SU2_MPI::Isend(&(static_cast(bufS_PeriodicSend)[offset]), count, MPI_UNSIGNED_SHORT, dest, tag, + SU2_MPI::GetComm(), &(req_PeriodicSend[val_iSend])); + break; + default: + SU2_MPI::Error("Unrecognized data type for periodic MPI comms.", CURRENT_FUNCTION); + break; + } } END_SU2_OMP_MASTER #else @@ -1324,54 +1226,27 @@ void CGeometry::PostPeriodicSends(CGeometry *geometry, /*--- Copy my own rank's data into the recv buffer directly in serial. ---*/ int myStart, myFinal, iRecv, iRank; - iRank = geometry->PeriodicRecv2Neighbor[rank]; - iRecv = geometry->nPoint_PeriodicRecv[iRank]*countPerPeriodicPoint; - myStart = nPoint_PeriodicSend[val_iSend]*countPerPeriodicPoint; - myFinal = nPoint_PeriodicSend[val_iSend+1]*countPerPeriodicPoint; + iRank = geometry->PeriodicRecv2Neighbor[rank]; + iRecv = geometry->nPoint_PeriodicRecv[iRank] * countPerPeriodicPoint; + myStart = nPoint_PeriodicSend[val_iSend] * countPerPeriodicPoint; + myFinal = nPoint_PeriodicSend[val_iSend + 1] * countPerPeriodicPoint; switch (commType) { case COMM_TYPE_DOUBLE: - parallelCopy(myFinal-myStart, &bufD_PeriodicSend[myStart], &bufD_PeriodicRecv[iRecv]); + parallelCopy(myFinal - myStart, &bufD_PeriodicSend[myStart], &bufD_PeriodicRecv[iRecv]); break; case COMM_TYPE_UNSIGNED_SHORT: - parallelCopy(myFinal-myStart, &bufS_PeriodicSend[myStart], &bufS_PeriodicRecv[iRecv]); + parallelCopy(myFinal - myStart, &bufS_PeriodicSend[myStart], &bufS_PeriodicRecv[iRecv]); break; default: - SU2_MPI::Error("Unrecognized data type for periodic MPI comms.", - CURRENT_FUNCTION); + SU2_MPI::Error("Unrecognized data type for periodic MPI comms.", CURRENT_FUNCTION); break; } #endif - -} - -su2double CGeometry::Point2Plane_Distance(const su2double *Coord, const su2double *iCoord, const su2double *jCoord, const su2double *kCoord) { - su2double CrossProduct[3], iVector[3], jVector[3], distance, modulus; - unsigned short iDim; - - for (iDim = 0; iDim < 3; iDim ++) { - iVector[iDim] = jCoord[iDim] - iCoord[iDim]; - jVector[iDim] = kCoord[iDim] - iCoord[iDim]; - } - - CrossProduct[0] = iVector[1]*jVector[2] - iVector[2]*jVector[1]; - CrossProduct[1] = iVector[2]*jVector[0] - iVector[0]*jVector[2]; - CrossProduct[2] = iVector[0]*jVector[1] - iVector[1]*jVector[0]; - - modulus = sqrt(CrossProduct[0]*CrossProduct[0]+CrossProduct[1]*CrossProduct[1]+CrossProduct[2]*CrossProduct[2]); - - distance = 0.0; - for (iDim = 0; iDim < 3; iDim ++) - distance += CrossProduct[iDim]*(Coord[iDim]-iCoord[iDim]); - distance /= modulus; - - return distance; - } -void CGeometry::SetEdges(void) { - +void CGeometry::SetEdges() { nEdge = 0; for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { for (auto iNode = 0u; iNode < nodes->GetnPoint(iPoint); iNode++) { @@ -1390,7 +1265,7 @@ void CGeometry::SetEdges(void) { } } - edges = new CEdge(nEdge,nDim); + edges = new CEdge(nEdge, nDim); for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { for (auto jPoint : nodes->GetPoints(iPoint)) { @@ -1403,7 +1278,7 @@ void CGeometry::SetEdges(void) { edges->SetPaddingNodes(); } -void CGeometry::SetFaces(void) { +void CGeometry::SetFaces() { // unsigned long iPoint, jPoint, iFace; // unsigned short jNode, iNode; // long TestFace = 0; @@ -1434,21 +1309,19 @@ void CGeometry::SetFaces(void) { // } } -void CGeometry::TestGeometry(void) const { - +void CGeometry::TestGeometry() const { ofstream para_file; para_file.open("test_geometry.dat", ios::out); - su2double *Normal = new su2double[nDim]; + auto* Normal = new su2double[nDim]; for (unsigned long iEdge = 0; iEdge < nEdge; iEdge++) { para_file << "Edge index: " << iEdge << endl; - para_file << " Point index: " << edges->GetNode(iEdge,0) << "\t" << edges->GetNode(iEdge,1) << endl; - edges->GetNormal(iEdge,Normal); + para_file << " Point index: " << edges->GetNode(iEdge, 0) << "\t" << edges->GetNode(iEdge, 1) << endl; + edges->GetNormal(iEdge, Normal); para_file << " Face normal : "; - for (unsigned short iDim = 0; iDim < nDim; iDim++) - para_file << Normal[iDim] << "\t"; + for (unsigned short iDim = 0; iDim < nDim; iDim++) para_file << Normal[iDim] << "\t"; para_file << endl; } @@ -1457,52 +1330,53 @@ void CGeometry::TestGeometry(void) const { para_file << endl; para_file << endl; - for (unsigned short iMarker =0; iMarker < nMarker; iMarker++) { + for (unsigned short iMarker = 0; iMarker < nMarker; iMarker++) { para_file << "Marker index: " << iMarker << endl; for (unsigned long iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { para_file << " Vertex index: " << iVertex << endl; para_file << " Point index: " << vertex[iMarker][iVertex]->GetNode() << endl; para_file << " Point coordinates : "; for (unsigned short iDim = 0; iDim < nDim; iDim++) { - para_file << nodes->GetCoord(vertex[iMarker][iVertex]->GetNode(), iDim) << "\t";} + para_file << nodes->GetCoord(vertex[iMarker][iVertex]->GetNode(), iDim) << "\t"; + } para_file << endl; vertex[iMarker][iVertex]->GetNormal(Normal); para_file << " Face normal : "; - for (unsigned short iDim = 0; iDim < nDim; iDim++) - para_file << Normal[iDim] << "\t"; + for (unsigned short iDim = 0; iDim < nDim; iDim++) para_file << Normal[iDim] << "\t"; para_file << endl; } } - delete [] Normal; - + delete[] Normal; } -bool CGeometry::SegmentIntersectsPlane(const su2double *Segment_P0, const su2double *Segment_P1, su2double Variable_P0, su2double Variable_P1, - const su2double *Plane_P0, const su2double *Plane_Normal, su2double *Intersection, su2double &Variable_Interp) { +bool CGeometry::SegmentIntersectsPlane(const su2double* Segment_P0, const su2double* Segment_P1, su2double Variable_P0, + su2double Variable_P1, const su2double* Plane_P0, const su2double* Plane_Normal, + su2double* Intersection, su2double& Variable_Interp) { su2double u[3], v[3], Denominator, Numerator, Aux, ModU; - su2double epsilon = 1E-6; // An epsilon is added to eliminate, as much as possible, the posibility of a line that intersects a point + su2double epsilon = + 1E-6; // An epsilon is added to eliminate, as much as possible, the posibility of a line that intersects a point unsigned short iDim; for (iDim = 0; iDim < 3; iDim++) { u[iDim] = Segment_P1[iDim] - Segment_P0[iDim]; - v[iDim] = (Plane_P0[iDim]+epsilon) - Segment_P0[iDim]; + v[iDim] = (Plane_P0[iDim] + epsilon) - Segment_P0[iDim]; } - ModU = sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2]); + ModU = sqrt(u[0] * u[0] + u[1] * u[1] + u[2] * u[2]); - Numerator = (Plane_Normal[0]+epsilon)*v[0] + (Plane_Normal[1]+epsilon)*v[1] + (Plane_Normal[2]+epsilon)*v[2]; - Denominator = (Plane_Normal[0]+epsilon)*u[0] + (Plane_Normal[1]+epsilon)*u[1] + (Plane_Normal[2]+epsilon)*u[2]; + Numerator = + (Plane_Normal[0] + epsilon) * v[0] + (Plane_Normal[1] + epsilon) * v[1] + (Plane_Normal[2] + epsilon) * v[2]; + Denominator = + (Plane_Normal[0] + epsilon) * u[0] + (Plane_Normal[1] + epsilon) * u[1] + (Plane_Normal[2] + epsilon) * u[2]; - if (fabs(Denominator) <= 0.0) return (false); // No intersection. + if (fabs(Denominator) <= 0.0) return (false); // No intersection. Aux = Numerator / Denominator; - if (Aux < 0.0 || Aux > 1.0) return (false); // No intersection. - - for (iDim = 0; iDim < 3; iDim++) - Intersection[iDim] = Segment_P0[iDim] + Aux * u[iDim]; + if (Aux < 0.0 || Aux > 1.0) return (false); // No intersection. + for (iDim = 0; iDim < 3; iDim++) Intersection[iDim] = Segment_P0[iDim] + Aux * u[iDim]; /*--- Check that the intersection is in the segment ---*/ @@ -1511,23 +1385,22 @@ bool CGeometry::SegmentIntersectsPlane(const su2double *Segment_P0, const su2dou v[iDim] = Segment_P1[iDim] - Intersection[iDim]; } - Variable_Interp = Variable_P0 + (Variable_P1 - Variable_P0)*sqrt(u[0]*u[0]+u[1]*u[1]+u[2]*u[2])/ModU; + Variable_Interp = Variable_P0 + (Variable_P1 - Variable_P0) * sqrt(u[0] * u[0] + u[1] * u[1] + u[2] * u[2]) / ModU; - Denominator = (Plane_Normal[0]+epsilon)*u[0] + (Plane_Normal[1]+epsilon)*u[1] + (Plane_Normal[2]+epsilon)*u[2]; - Numerator = (Plane_Normal[0]+epsilon)*v[0] + (Plane_Normal[1]+epsilon)*v[1] + (Plane_Normal[2]+epsilon)*v[2]; + Denominator = + (Plane_Normal[0] + epsilon) * u[0] + (Plane_Normal[1] + epsilon) * u[1] + (Plane_Normal[2] + epsilon) * u[2]; + Numerator = + (Plane_Normal[0] + epsilon) * v[0] + (Plane_Normal[1] + epsilon) * v[1] + (Plane_Normal[2] + epsilon) * v[2]; Aux = Numerator * Denominator; - if (Aux > 0.0) return (false); // Intersection outside the segment. + if (Aux > 0.0) return (false); // Intersection outside the segment. return (true); - } -bool CGeometry::RayIntersectsTriangle(const su2double orig[3], const su2double dir[3], - const su2double vert0[3], const su2double vert1[3], const su2double vert2[3], - su2double *intersect) { - +bool CGeometry::RayIntersectsTriangle(const su2double orig[3], const su2double dir[3], const su2double vert0[3], + const su2double vert1[3], const su2double vert2[3], su2double* intersect) { const passivedouble epsilon = 0.000001; su2double edge1[3], edge2[3], tvec[3], pvec[3], qvec[3]; su2double det, inv_det, t, u, v; @@ -1545,8 +1418,7 @@ bool CGeometry::RayIntersectsTriangle(const su2double orig[3], const su2double d det = GeometryToolbox::DotProduct(3, edge1, pvec); - - if (fabs(det) < epsilon) return(false); + if (fabs(det) < epsilon) return (false); inv_det = 1.0 / det; @@ -1558,7 +1430,7 @@ bool CGeometry::RayIntersectsTriangle(const su2double orig[3], const su2double d u = inv_det * GeometryToolbox::DotProduct(3, tvec, pvec); - if (u < 0.0 || u > 1.0) return(false); + if (u < 0.0 || u > 1.0) return (false); /*--- prepare to test V parameter ---*/ @@ -1568,7 +1440,7 @@ bool CGeometry::RayIntersectsTriangle(const su2double orig[3], const su2double d v = inv_det * GeometryToolbox::DotProduct(3, dir, qvec); - if (v < 0.0 || u + v > 1.0) return(false); + if (v < 0.0 || u + v > 1.0) return (false); /*--- Calculate t, ray intersects triangle ---*/ @@ -1581,11 +1453,10 @@ bool CGeometry::RayIntersectsTriangle(const su2double orig[3], const su2double d intersect[2] = orig[2] + (t * dir[2]); return (true); - } -bool CGeometry::SegmentIntersectsLine(const su2double point0[2], const su2double point1[2], const su2double vert0[2], const su2double vert1[2]) { - +bool CGeometry::SegmentIntersectsLine(const su2double point0[2], const su2double point1[2], const su2double vert0[2], + const su2double vert1[2]) { su2double det, diff0_A, diff0_B, diff1_A, diff1_B, intersect[2]; diff0_A = point0[0] - point1[0]; @@ -1594,48 +1465,42 @@ bool CGeometry::SegmentIntersectsLine(const su2double point0[2], const su2double diff0_B = vert0[0] - vert1[0]; diff1_B = vert0[1] - vert1[1]; - det = (diff0_A)*(diff1_B) - (diff1_A)*(diff0_B); + det = (diff0_A) * (diff1_B) - (diff1_A) * (diff0_B); if (det == 0) return false; /*--- Compute point of intersection ---*/ - intersect[0] = ((point0[0]*point1[1] - point0[1]*point1[0])*diff0_B - -(vert0[0]* vert1[1] - vert0[1]* vert1[0])*diff0_A)/det; - - intersect[1] = ((point0[0]*point1[1] - point0[1]*point1[0])*diff1_B - -(vert0[0]* vert1[1] - vert0[1]* vert1[0])*diff1_A)/det; + intersect[0] = ((point0[0] * point1[1] - point0[1] * point1[0]) * diff0_B - + (vert0[0] * vert1[1] - vert0[1] * vert1[0]) * diff0_A) / + det; + intersect[1] = ((point0[0] * point1[1] - point0[1] * point1[0]) * diff1_B - + (vert0[0] * vert1[1] - vert0[1] * vert1[0]) * diff1_A) / + det; /*--- Check that the point is between the two surface points ---*/ su2double dist0, dist1, length; - dist0 = (intersect[0] - point0[0])*(intersect[0] - point0[0]) - +(intersect[1] - point0[1])*(intersect[1] - point0[1]); - - dist1 = (intersect[0] - point1[0])*(intersect[0] - point1[0]) - +(intersect[1] - point1[1])*(intersect[1] - point1[1]); + dist0 = + (intersect[0] - point0[0]) * (intersect[0] - point0[0]) + (intersect[1] - point0[1]) * (intersect[1] - point0[1]); - length = diff0_A*diff0_A - +diff1_A*diff1_A; + dist1 = + (intersect[0] - point1[0]) * (intersect[0] - point1[0]) + (intersect[1] - point1[1]) * (intersect[1] - point1[1]); - if ( (dist0 > length) || (dist1 > length) ) { - return false; - } + length = diff0_A * diff0_A + diff1_A * diff1_A; - return true; + return (dist0 <= length) && (dist1 <= length); } -bool CGeometry::SegmentIntersectsTriangle(su2double point0[3], const su2double point1[3], - su2double vert0[3], su2double vert1[3], su2double vert2[3]) { - +bool CGeometry::SegmentIntersectsTriangle(su2double point0[3], const su2double point1[3], su2double vert0[3], + su2double vert1[3], su2double vert2[3]) { su2double dir[3], intersect[3], u[3], v[3], edge1[3], edge2[3], Plane_Normal[3], Denominator, Numerator, Aux; GeometryToolbox::Distance(3, point1, point0, dir); if (RayIntersectsTriangle(point0, dir, vert0, vert1, vert2, intersect)) { - /*--- Check that the intersection is in the segment ---*/ GeometryToolbox::Distance(3, point0, intersect, u); @@ -1654,45 +1519,41 @@ bool CGeometry::SegmentIntersectsTriangle(su2double point0[3], const su2double p if (Aux > 0.0) return (false); - } - else { - + } else { /*--- No intersection with the ray ---*/ return (false); - } /*--- Intersection inside the segment ---*/ return (true); - } -void CGeometry::ComputeAirfoil_Section(su2double *Plane_P0, su2double *Plane_Normal, - su2double MinXCoord, su2double MaxXCoord, - su2double MinYCoord, su2double MaxYCoord, - su2double MinZCoord, su2double MaxZCoord, - const su2double *FlowVariable, - vector &Xcoord_Airfoil, vector &Ycoord_Airfoil, - vector &Zcoord_Airfoil, vector &Variable_Airfoil, - bool original_surface, CConfig *config) { - +void CGeometry::ComputeAirfoil_Section(su2double* Plane_P0, su2double* Plane_Normal, su2double MinXCoord, + su2double MaxXCoord, su2double MinYCoord, su2double MaxYCoord, + su2double MinZCoord, su2double MaxZCoord, const su2double* FlowVariable, + vector& Xcoord_Airfoil, vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil, vector& Variable_Airfoil, + bool original_surface, CConfig* config) { const bool wasActive = AD::BeginPassive(); unsigned short iMarker, iNode, jNode, iDim, Index = 0; bool intersect; long Next_Edge = 0; unsigned long iPoint, jPoint, iElem, Trailing_Point, Airfoil_Point, iVertex, iEdge, PointIndex, jEdge; - su2double Segment_P0[3] = {0.0, 0.0, 0.0}, Segment_P1[3] = {0.0, 0.0, 0.0}, Variable_P0 = 0.0, Variable_P1 = 0.0, Intersection[3] = {0.0, 0.0, 0.0}, Trailing_Coord, - *VarCoord = nullptr, Variable_Interp, v1[3] = {0.0, 0.0, 0.0}, v3[3] = {0.0, 0.0, 0.0}, CrossProduct = 1.0; + su2double Segment_P0[3] = {0.0, 0.0, 0.0}, Segment_P1[3] = {0.0, 0.0, 0.0}, Variable_P0 = 0.0, Variable_P1 = 0.0, + Intersection[3] = {0.0, 0.0, 0.0}, Trailing_Coord, *VarCoord = nullptr, Variable_Interp, + v1[3] = {0.0, 0.0, 0.0}, v3[3] = {0.0, 0.0, 0.0}, CrossProduct = 1.0; bool Found_Edge; passivedouble Dist_Value; - vector Xcoord_Index0, Ycoord_Index0, Zcoord_Index0, Variable_Index0, Xcoord_Index1, Ycoord_Index1, Zcoord_Index1, Variable_Index1; - vector IGlobalID_Index0, JGlobalID_Index0, IGlobalID_Index1, JGlobalID_Index1, IGlobalID_Airfoil, JGlobalID_Airfoil; + vector Xcoord_Index0, Ycoord_Index0, Zcoord_Index0, Variable_Index0, Xcoord_Index1, Ycoord_Index1, + Zcoord_Index1, Variable_Index1; + vector IGlobalID_Index0, JGlobalID_Index0, IGlobalID_Index1, JGlobalID_Index1, IGlobalID_Airfoil, + JGlobalID_Airfoil; vector Conection_Index0, Conection_Index1; vector Duplicate; - su2double **Coord_Variation = nullptr; + su2double** Coord_Variation = nullptr; vector XcoordExtra, YcoordExtra, ZcoordExtra, VariableExtra; vector IGlobalIDExtra, JGlobalIDExtra; vector AddExtra; @@ -1700,7 +1561,8 @@ void CGeometry::ComputeAirfoil_Section(su2double *Plane_P0, su2double *Plane_Nor bool FoundEdge; #ifdef HAVE_MPI - unsigned long nLocalEdge, MaxLocalEdge, *Buffer_Send_nEdge, *Buffer_Receive_nEdge, nBuffer_Coord, nBuffer_Variable, nBuffer_GlobalID; + unsigned long nLocalEdge, MaxLocalEdge, *Buffer_Send_nEdge, *Buffer_Receive_nEdge, nBuffer_Coord, nBuffer_Variable, + nBuffer_GlobalID; int nProcessor, iProcessor; su2double *Buffer_Send_Coord, *Buffer_Receive_Coord; su2double *Buffer_Send_Variable, *Buffer_Receive_Variable; @@ -1717,39 +1579,36 @@ void CGeometry::ComputeAirfoil_Section(su2double *Plane_P0, su2double *Plane_Nor /*--- Set the right plane in 2D (note the change in Y-Z plane) ---*/ if (nDim == 2) { - Plane_P0[0] = 0.0; Plane_P0[1] = 0.0; Plane_P0[2] = 0.0; - Plane_Normal[0] = 0.0; Plane_Normal[1] = 1.0; Plane_Normal[2] = 0.0; + Plane_P0[0] = 0.0; + Plane_P0[1] = 0.0; + Plane_P0[2] = 0.0; + Plane_Normal[0] = 0.0; + Plane_Normal[1] = 1.0; + Plane_Normal[2] = 0.0; } /*--- Grid movement is stored using a vertices information, we should go from vertex to points ---*/ - if (original_surface == false) { - - Coord_Variation = new su2double *[nPoint]; - for (iPoint = 0; iPoint < nPoint; iPoint++) - Coord_Variation[iPoint] = new su2double [nDim]; + if (!original_surface) { + Coord_Variation = new su2double*[nPoint]; + for (iPoint = 0; iPoint < nPoint; iPoint++) Coord_Variation[iPoint] = new su2double[nDim]; for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if (config->GetMarker_All_GeoEval(iMarker) == YES) { for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { VarCoord = vertex[iMarker][iVertex]->GetVarCoord(); iPoint = vertex[iMarker][iVertex]->GetNode(); - for (iDim = 0; iDim < nDim; iDim++) - Coord_Variation[iPoint][iDim] = VarCoord[iDim]; + for (iDim = 0; iDim < nDim; iDim++) Coord_Variation[iPoint][iDim] = VarCoord[iDim]; } } } - } for (iMarker = 0; iMarker < nMarker; iMarker++) { - if (config->GetMarker_All_GeoEval(iMarker) == YES) { - for (iElem = 0; iElem < nElem_Bound[iMarker]; iElem++) { - - PointIndex=0; + PointIndex = 0; /*--- To decide if an element is going to be used or not should be done element based, The first step is to compute and average coordinate for the element ---*/ @@ -1776,9 +1635,8 @@ void CGeometry::ComputeAirfoil_Section(su2double *Plane_P0, su2double *Plane_Nor CrossProduct = 1.0; if (config->GetGeo_Description() == NACELLE) { - - su2double Tilt_Angle = config->GetNacelleLocation(3)*PI_NUMBER/180; - su2double Toe_Angle = config->GetNacelleLocation(4)*PI_NUMBER/180; + su2double Tilt_Angle = config->GetNacelleLocation(3) * PI_NUMBER / 180; + su2double Toe_Angle = config->GetNacelleLocation(4) * PI_NUMBER / 180; /*--- Translate to the origin ---*/ @@ -1788,57 +1646,58 @@ void CGeometry::ComputeAirfoil_Section(su2double *Plane_P0, su2double *Plane_Nor /*--- Apply tilt angle ---*/ - su2double XCoord_Trans_Tilt = XCoord_Trans*cos(Tilt_Angle) + ZCoord_Trans*sin(Tilt_Angle); + su2double XCoord_Trans_Tilt = XCoord_Trans * cos(Tilt_Angle) + ZCoord_Trans * sin(Tilt_Angle); su2double YCoord_Trans_Tilt = YCoord_Trans; - su2double ZCoord_Trans_Tilt = ZCoord_Trans*cos(Tilt_Angle) - XCoord_Trans*sin(Tilt_Angle); + su2double ZCoord_Trans_Tilt = ZCoord_Trans * cos(Tilt_Angle) - XCoord_Trans * sin(Tilt_Angle); /*--- Apply toe angle ---*/ - su2double YCoord_Trans_Tilt_Toe = XCoord_Trans_Tilt*sin(Toe_Angle) + YCoord_Trans_Tilt*cos(Toe_Angle); + su2double YCoord_Trans_Tilt_Toe = XCoord_Trans_Tilt * sin(Toe_Angle) + YCoord_Trans_Tilt * cos(Toe_Angle); su2double ZCoord_Trans_Tilt_Toe = ZCoord_Trans_Tilt; /*--- Undo plane rotation, we have already rotated the nacelle ---*/ /*--- Undo tilt angle ---*/ - su2double XPlane_Normal_Tilt = Plane_Normal[0]*cos(-Tilt_Angle) + Plane_Normal[2]*sin(-Tilt_Angle); + su2double XPlane_Normal_Tilt = Plane_Normal[0] * cos(-Tilt_Angle) + Plane_Normal[2] * sin(-Tilt_Angle); su2double YPlane_Normal_Tilt = Plane_Normal[1]; - su2double ZPlane_Normal_Tilt = Plane_Normal[2]*cos(-Tilt_Angle) - Plane_Normal[0]*sin(-Tilt_Angle); + su2double ZPlane_Normal_Tilt = Plane_Normal[2] * cos(-Tilt_Angle) - Plane_Normal[0] * sin(-Tilt_Angle); /*--- Undo toe angle ---*/ - su2double YPlane_Normal_Tilt_Toe = XPlane_Normal_Tilt*sin(-Toe_Angle) + YPlane_Normal_Tilt*cos(-Toe_Angle); + su2double YPlane_Normal_Tilt_Toe = + XPlane_Normal_Tilt * sin(-Toe_Angle) + YPlane_Normal_Tilt * cos(-Toe_Angle); su2double ZPlane_Normal_Tilt_Toe = ZPlane_Normal_Tilt; - v1[1] = YCoord_Trans_Tilt_Toe - 0.0; v1[2] = ZCoord_Trans_Tilt_Toe - 0.0; - v3[0] = v1[1]*ZPlane_Normal_Tilt_Toe-v1[2]*YPlane_Normal_Tilt_Toe; + v3[0] = v1[1] * ZPlane_Normal_Tilt_Toe - v1[2] * YPlane_Normal_Tilt_Toe; CrossProduct = v3[0] * 1.0; - } - for (unsigned short iFace = 0; iFace < bound[iMarker][iElem]->GetnFaces(); iFace++){ - iNode = bound[iMarker][iElem]->GetFaces(iFace,0); - jNode = bound[iMarker][iElem]->GetFaces(iFace,1); + for (unsigned short iFace = 0; iFace < bound[iMarker][iElem]->GetnFaces(); iFace++) { + iNode = bound[iMarker][iElem]->GetFaces(iFace, 0); + jNode = bound[iMarker][iElem]->GetFaces(iFace, 1); iPoint = bound[iMarker][iElem]->GetNode(iNode); jPoint = bound[iMarker][iElem]->GetNode(jNode); - if ((CrossProduct >= 0.0) - && ((AveXCoord > MinXCoord) && (AveXCoord < MaxXCoord)) - && ((AveYCoord > MinYCoord) && (AveYCoord < MaxYCoord)) - && ((AveZCoord > MinZCoord) && (AveZCoord < MaxZCoord))) { - - Segment_P0[0] = 0.0; Segment_P0[1] = 0.0; Segment_P0[2] = 0.0; Variable_P0 = 0.0; - Segment_P1[0] = 0.0; Segment_P1[1] = 0.0; Segment_P1[2] = 0.0; Variable_P1 = 0.0; - + if ((CrossProduct >= 0.0) && ((AveXCoord > MinXCoord) && (AveXCoord < MaxXCoord)) && + ((AveYCoord > MinYCoord) && (AveYCoord < MaxYCoord)) && + ((AveZCoord > MinZCoord) && (AveZCoord < MaxZCoord))) { + Segment_P0[0] = 0.0; + Segment_P0[1] = 0.0; + Segment_P0[2] = 0.0; + Variable_P0 = 0.0; + Segment_P1[0] = 0.0; + Segment_P1[1] = 0.0; + Segment_P1[2] = 0.0; + Variable_P1 = 0.0; for (iDim = 0; iDim < nDim; iDim++) { - if (original_surface == true) { + if (original_surface) { Segment_P0[iDim] = nodes->GetCoord(iPoint, iDim); Segment_P1[iDim] = nodes->GetCoord(jPoint, iDim); - } - else { + } else { Segment_P0[iDim] = nodes->GetCoord(iPoint, iDim) + Coord_Variation[iPoint][iDim]; Segment_P1[iDim] = nodes->GetCoord(jPoint, iDim) + Coord_Variation[jPoint][iDim]; } @@ -1852,20 +1711,27 @@ void CGeometry::ComputeAirfoil_Section(su2double *Plane_P0, su2double *Plane_Nor /*--- In 2D add the points directly (note the change between Y and Z coordinate) ---*/ if (nDim == 2) { - Xcoord_Index0.push_back(Segment_P0[0]); Xcoord_Index1.push_back(Segment_P1[0]); - Ycoord_Index0.push_back(Segment_P0[2]); Ycoord_Index1.push_back(Segment_P1[2]); - Zcoord_Index0.push_back(Segment_P0[1]); Zcoord_Index1.push_back(Segment_P1[1]); - Variable_Index0.push_back(Variable_P0); Variable_Index1.push_back(Variable_P1); - IGlobalID_Index0.push_back(nodes->GetGlobalIndex(iPoint)); IGlobalID_Index1.push_back(nodes->GetGlobalIndex(jPoint)); - JGlobalID_Index0.push_back(nodes->GetGlobalIndex(iPoint)); JGlobalID_Index1.push_back(nodes->GetGlobalIndex(jPoint)); + Xcoord_Index0.push_back(Segment_P0[0]); + Xcoord_Index1.push_back(Segment_P1[0]); + Ycoord_Index0.push_back(Segment_P0[2]); + Ycoord_Index1.push_back(Segment_P1[2]); + Zcoord_Index0.push_back(Segment_P0[1]); + Zcoord_Index1.push_back(Segment_P1[1]); + Variable_Index0.push_back(Variable_P0); + Variable_Index1.push_back(Variable_P1); + IGlobalID_Index0.push_back(nodes->GetGlobalIndex(iPoint)); + IGlobalID_Index1.push_back(nodes->GetGlobalIndex(jPoint)); + JGlobalID_Index0.push_back(nodes->GetGlobalIndex(iPoint)); + JGlobalID_Index1.push_back(nodes->GetGlobalIndex(jPoint)); PointIndex++; } /*--- In 3D compute the intersection ---*/ else if (nDim == 3) { - intersect = SegmentIntersectsPlane(Segment_P0, Segment_P1, Variable_P0, Variable_P1, Plane_P0, Plane_Normal, Intersection, Variable_Interp); - if (intersect == true) { + intersect = SegmentIntersectsPlane(Segment_P0, Segment_P1, Variable_P0, Variable_P1, Plane_P0, + Plane_Normal, Intersection, Variable_Interp); + if (intersect) { if (PointIndex == 0) { Xcoord_Index0.push_back(Intersection[0]); Ycoord_Index0.push_back(Intersection[1]); @@ -1891,10 +1757,9 @@ void CGeometry::ComputeAirfoil_Section(su2double *Plane_P0, su2double *Plane_Nor } } - if (original_surface == false) { - for (iPoint = 0; iPoint < nPoint; iPoint++) - delete [] Coord_Variation[iPoint]; - delete [] Coord_Variation; + if (!original_surface) { + for (iPoint = 0; iPoint < nPoint; iPoint++) delete[] Coord_Variation[iPoint]; + delete[] Coord_Variation; } #ifdef HAVE_MPI @@ -1904,216 +1769,237 @@ void CGeometry::ComputeAirfoil_Section(su2double *Plane_P0, su2double *Plane_Nor nLocalEdge = 0, MaxLocalEdge = 0; nProcessor = size; - Buffer_Send_nEdge = new unsigned long [1]; - Buffer_Receive_nEdge = new unsigned long [nProcessor]; + Buffer_Send_nEdge = new unsigned long[1]; + Buffer_Receive_nEdge = new unsigned long[nProcessor]; nLocalEdge = Xcoord_Index0.size(); Buffer_Send_nEdge[0] = nLocalEdge; SU2_MPI::Allreduce(&nLocalEdge, &MaxLocalEdge, 1, MPI_UNSIGNED_LONG, MPI_MAX, SU2_MPI::GetComm()); - SU2_MPI::Allgather(Buffer_Send_nEdge, 1, MPI_UNSIGNED_LONG, Buffer_Receive_nEdge, 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_nEdge, 1, MPI_UNSIGNED_LONG, Buffer_Receive_nEdge, 1, MPI_UNSIGNED_LONG, + SU2_MPI::GetComm()); - Buffer_Send_Coord = new su2double [MaxLocalEdge*6]; - Buffer_Receive_Coord = new su2double [nProcessor*MaxLocalEdge*6]; + Buffer_Send_Coord = new su2double[MaxLocalEdge * 6]; + Buffer_Receive_Coord = new su2double[nProcessor * MaxLocalEdge * 6]; - Buffer_Send_Variable = new su2double [MaxLocalEdge*2]; - Buffer_Receive_Variable = new su2double [nProcessor*MaxLocalEdge*2]; + Buffer_Send_Variable = new su2double[MaxLocalEdge * 2]; + Buffer_Receive_Variable = new su2double[nProcessor * MaxLocalEdge * 2]; - Buffer_Send_GlobalID = new unsigned long [MaxLocalEdge*4]; - Buffer_Receive_GlobalID = new unsigned long [nProcessor*MaxLocalEdge*4]; + Buffer_Send_GlobalID = new unsigned long[MaxLocalEdge * 4]; + Buffer_Receive_GlobalID = new unsigned long[nProcessor * MaxLocalEdge * 4]; - nBuffer_Coord = MaxLocalEdge*6; - nBuffer_Variable = MaxLocalEdge*2; - nBuffer_GlobalID = MaxLocalEdge*4; + nBuffer_Coord = MaxLocalEdge * 6; + nBuffer_Variable = MaxLocalEdge * 2; + nBuffer_GlobalID = MaxLocalEdge * 4; for (iEdge = 0; iEdge < nLocalEdge; iEdge++) { - Buffer_Send_Coord[iEdge*6 + 0] = Xcoord_Index0[iEdge]; - Buffer_Send_Coord[iEdge*6 + 1] = Ycoord_Index0[iEdge]; - Buffer_Send_Coord[iEdge*6 + 2] = Zcoord_Index0[iEdge]; - Buffer_Send_Coord[iEdge*6 + 3] = Xcoord_Index1[iEdge]; - Buffer_Send_Coord[iEdge*6 + 4] = Ycoord_Index1[iEdge]; - Buffer_Send_Coord[iEdge*6 + 5] = Zcoord_Index1[iEdge]; - - Buffer_Send_Variable[iEdge*2 + 0] = Variable_Index0[iEdge]; - Buffer_Send_Variable[iEdge*2 + 1] = Variable_Index1[iEdge]; - - Buffer_Send_GlobalID[iEdge*4 + 0] = IGlobalID_Index0[iEdge]; - Buffer_Send_GlobalID[iEdge*4 + 1] = JGlobalID_Index0[iEdge]; - Buffer_Send_GlobalID[iEdge*4 + 2] = IGlobalID_Index1[iEdge]; - Buffer_Send_GlobalID[iEdge*4 + 3] = JGlobalID_Index1[iEdge]; + Buffer_Send_Coord[iEdge * 6 + 0] = Xcoord_Index0[iEdge]; + Buffer_Send_Coord[iEdge * 6 + 1] = Ycoord_Index0[iEdge]; + Buffer_Send_Coord[iEdge * 6 + 2] = Zcoord_Index0[iEdge]; + Buffer_Send_Coord[iEdge * 6 + 3] = Xcoord_Index1[iEdge]; + Buffer_Send_Coord[iEdge * 6 + 4] = Ycoord_Index1[iEdge]; + Buffer_Send_Coord[iEdge * 6 + 5] = Zcoord_Index1[iEdge]; + + Buffer_Send_Variable[iEdge * 2 + 0] = Variable_Index0[iEdge]; + Buffer_Send_Variable[iEdge * 2 + 1] = Variable_Index1[iEdge]; + + Buffer_Send_GlobalID[iEdge * 4 + 0] = IGlobalID_Index0[iEdge]; + Buffer_Send_GlobalID[iEdge * 4 + 1] = JGlobalID_Index0[iEdge]; + Buffer_Send_GlobalID[iEdge * 4 + 2] = IGlobalID_Index1[iEdge]; + Buffer_Send_GlobalID[iEdge * 4 + 3] = JGlobalID_Index1[iEdge]; } - SU2_MPI::Allgather(Buffer_Send_Coord, nBuffer_Coord, MPI_DOUBLE, Buffer_Receive_Coord, nBuffer_Coord, MPI_DOUBLE, SU2_MPI::GetComm()); - SU2_MPI::Allgather(Buffer_Send_Variable, nBuffer_Variable, MPI_DOUBLE, Buffer_Receive_Variable, nBuffer_Variable, MPI_DOUBLE, SU2_MPI::GetComm()); - SU2_MPI::Allgather(Buffer_Send_GlobalID, nBuffer_GlobalID, MPI_UNSIGNED_LONG, Buffer_Receive_GlobalID, nBuffer_GlobalID, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_Coord, nBuffer_Coord, MPI_DOUBLE, Buffer_Receive_Coord, nBuffer_Coord, MPI_DOUBLE, + SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_Variable, nBuffer_Variable, MPI_DOUBLE, Buffer_Receive_Variable, nBuffer_Variable, + MPI_DOUBLE, SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_GlobalID, nBuffer_GlobalID, MPI_UNSIGNED_LONG, Buffer_Receive_GlobalID, + nBuffer_GlobalID, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); /*--- Clean the vectors before adding the new vertices only to the master node ---*/ - Xcoord_Index0.clear(); Xcoord_Index1.clear(); - Ycoord_Index0.clear(); Ycoord_Index1.clear(); - Zcoord_Index0.clear(); Zcoord_Index1.clear(); - Variable_Index0.clear(); Variable_Index1.clear(); - IGlobalID_Index0.clear(); IGlobalID_Index1.clear(); - JGlobalID_Index0.clear(); JGlobalID_Index1.clear(); + Xcoord_Index0.clear(); + Xcoord_Index1.clear(); + Ycoord_Index0.clear(); + Ycoord_Index1.clear(); + Zcoord_Index0.clear(); + Zcoord_Index1.clear(); + Variable_Index0.clear(); + Variable_Index1.clear(); + IGlobalID_Index0.clear(); + IGlobalID_Index1.clear(); + JGlobalID_Index0.clear(); + JGlobalID_Index1.clear(); /*--- Copy the boundary to the master node vectors ---*/ if (rank == MASTER_NODE) { for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) { for (iEdge = 0; iEdge < Buffer_Receive_nEdge[iProcessor]; iEdge++) { - Xcoord_Index0.push_back( Buffer_Receive_Coord[ iProcessor*MaxLocalEdge*6 + iEdge*6 + 0] ); - Ycoord_Index0.push_back( Buffer_Receive_Coord[ iProcessor*MaxLocalEdge*6 + iEdge*6 + 1] ); - Zcoord_Index0.push_back( Buffer_Receive_Coord[ iProcessor*MaxLocalEdge*6 + iEdge*6 + 2] ); - Xcoord_Index1.push_back( Buffer_Receive_Coord[ iProcessor*MaxLocalEdge*6 + iEdge*6 + 3] ); - Ycoord_Index1.push_back( Buffer_Receive_Coord[ iProcessor*MaxLocalEdge*6 + iEdge*6 + 4] ); - Zcoord_Index1.push_back( Buffer_Receive_Coord[ iProcessor*MaxLocalEdge*6 + iEdge*6 + 5] ); - - Variable_Index0.push_back( Buffer_Receive_Variable[ iProcessor*MaxLocalEdge*2 + iEdge*2 + 0] ); - Variable_Index1.push_back( Buffer_Receive_Variable[ iProcessor*MaxLocalEdge*2 + iEdge*2 + 1] ); - - IGlobalID_Index0.push_back( Buffer_Receive_GlobalID[ iProcessor*MaxLocalEdge*4 + iEdge*4 + 0] ); - JGlobalID_Index0.push_back( Buffer_Receive_GlobalID[ iProcessor*MaxLocalEdge*4 + iEdge*4 + 1] ); - IGlobalID_Index1.push_back( Buffer_Receive_GlobalID[ iProcessor*MaxLocalEdge*4 + iEdge*4 + 2] ); - JGlobalID_Index1.push_back( Buffer_Receive_GlobalID[ iProcessor*MaxLocalEdge*4 + iEdge*4 + 3] ); - + Xcoord_Index0.push_back(Buffer_Receive_Coord[iProcessor * MaxLocalEdge * 6 + iEdge * 6 + 0]); + Ycoord_Index0.push_back(Buffer_Receive_Coord[iProcessor * MaxLocalEdge * 6 + iEdge * 6 + 1]); + Zcoord_Index0.push_back(Buffer_Receive_Coord[iProcessor * MaxLocalEdge * 6 + iEdge * 6 + 2]); + Xcoord_Index1.push_back(Buffer_Receive_Coord[iProcessor * MaxLocalEdge * 6 + iEdge * 6 + 3]); + Ycoord_Index1.push_back(Buffer_Receive_Coord[iProcessor * MaxLocalEdge * 6 + iEdge * 6 + 4]); + Zcoord_Index1.push_back(Buffer_Receive_Coord[iProcessor * MaxLocalEdge * 6 + iEdge * 6 + 5]); + + Variable_Index0.push_back(Buffer_Receive_Variable[iProcessor * MaxLocalEdge * 2 + iEdge * 2 + 0]); + Variable_Index1.push_back(Buffer_Receive_Variable[iProcessor * MaxLocalEdge * 2 + iEdge * 2 + 1]); + + IGlobalID_Index0.push_back(Buffer_Receive_GlobalID[iProcessor * MaxLocalEdge * 4 + iEdge * 4 + 0]); + JGlobalID_Index0.push_back(Buffer_Receive_GlobalID[iProcessor * MaxLocalEdge * 4 + iEdge * 4 + 1]); + IGlobalID_Index1.push_back(Buffer_Receive_GlobalID[iProcessor * MaxLocalEdge * 4 + iEdge * 4 + 2]); + JGlobalID_Index1.push_back(Buffer_Receive_GlobalID[iProcessor * MaxLocalEdge * 4 + iEdge * 4 + 3]); } } } - delete[] Buffer_Send_Coord; delete[] Buffer_Receive_Coord; - delete[] Buffer_Send_Variable; delete[] Buffer_Receive_Variable; - delete[] Buffer_Send_GlobalID; delete[] Buffer_Receive_GlobalID; - delete[] Buffer_Send_nEdge; delete[] Buffer_Receive_nEdge; + delete[] Buffer_Send_Coord; + delete[] Buffer_Receive_Coord; + delete[] Buffer_Send_Variable; + delete[] Buffer_Receive_Variable; + delete[] Buffer_Send_GlobalID; + delete[] Buffer_Receive_GlobalID; + delete[] Buffer_Send_nEdge; + delete[] Buffer_Receive_nEdge; #endif - if ((rank == MASTER_NODE) && (Xcoord_Index0.size() != 0)) { - + if ((rank == MASTER_NODE) && (!Xcoord_Index0.empty())) { /*--- Remove singular edges ---*/ bool Remove; - do { Remove = false; + do { + Remove = false; for (iEdge = 0; iEdge < Xcoord_Index0.size(); iEdge++) { - - if (((IGlobalID_Index0[iEdge] == IGlobalID_Index1[iEdge]) && (JGlobalID_Index0[iEdge] == JGlobalID_Index1[iEdge])) || - ((IGlobalID_Index0[iEdge] == JGlobalID_Index1[iEdge]) && (JGlobalID_Index0[iEdge] == IGlobalID_Index1[iEdge]))) { - - Xcoord_Index0.erase (Xcoord_Index0.begin() + iEdge); - Ycoord_Index0.erase (Ycoord_Index0.begin() + iEdge); - Zcoord_Index0.erase (Zcoord_Index0.begin() + iEdge); - Variable_Index0.erase (Variable_Index0.begin() + iEdge); - IGlobalID_Index0.erase (IGlobalID_Index0.begin() + iEdge); - JGlobalID_Index0.erase (JGlobalID_Index0.begin() + iEdge); - - Xcoord_Index1.erase (Xcoord_Index1.begin() + iEdge); - Ycoord_Index1.erase (Ycoord_Index1.begin() + iEdge); - Zcoord_Index1.erase (Zcoord_Index1.begin() + iEdge); - Variable_Index1.erase (Variable_Index1.begin() + iEdge); - IGlobalID_Index1.erase (IGlobalID_Index1.begin() + iEdge); - JGlobalID_Index1.erase (JGlobalID_Index1.begin() + iEdge); - - Remove = true; break; + if (((IGlobalID_Index0[iEdge] == IGlobalID_Index1[iEdge]) && + (JGlobalID_Index0[iEdge] == JGlobalID_Index1[iEdge])) || + ((IGlobalID_Index0[iEdge] == JGlobalID_Index1[iEdge]) && + (JGlobalID_Index0[iEdge] == IGlobalID_Index1[iEdge]))) { + Xcoord_Index0.erase(Xcoord_Index0.begin() + iEdge); + Ycoord_Index0.erase(Ycoord_Index0.begin() + iEdge); + Zcoord_Index0.erase(Zcoord_Index0.begin() + iEdge); + Variable_Index0.erase(Variable_Index0.begin() + iEdge); + IGlobalID_Index0.erase(IGlobalID_Index0.begin() + iEdge); + JGlobalID_Index0.erase(JGlobalID_Index0.begin() + iEdge); + + Xcoord_Index1.erase(Xcoord_Index1.begin() + iEdge); + Ycoord_Index1.erase(Ycoord_Index1.begin() + iEdge); + Zcoord_Index1.erase(Zcoord_Index1.begin() + iEdge); + Variable_Index1.erase(Variable_Index1.begin() + iEdge); + IGlobalID_Index1.erase(IGlobalID_Index1.begin() + iEdge); + JGlobalID_Index1.erase(JGlobalID_Index1.begin() + iEdge); + + Remove = true; + break; } if (Remove) break; } - } while (Remove == true); + } while (Remove); /*--- Remove repeated edges computing distance, this could happend because the MPI ---*/ - do { Remove = false; - for (iEdge = 0; iEdge < Xcoord_Index0.size()-1; iEdge++) { - for (jEdge = iEdge+1; jEdge < Xcoord_Index0.size(); jEdge++) { - + do { + Remove = false; + for (iEdge = 0; iEdge < Xcoord_Index0.size() - 1; iEdge++) { + for (jEdge = iEdge + 1; jEdge < Xcoord_Index0.size(); jEdge++) { /*--- Edges with the same orientation ---*/ - if ((((IGlobalID_Index0[iEdge] == IGlobalID_Index0[jEdge]) && (JGlobalID_Index0[iEdge] == JGlobalID_Index0[jEdge])) || - ((IGlobalID_Index0[iEdge] == JGlobalID_Index0[jEdge]) && (JGlobalID_Index0[iEdge] == IGlobalID_Index0[jEdge]))) && - (((IGlobalID_Index1[iEdge] == IGlobalID_Index1[jEdge]) && (JGlobalID_Index1[iEdge] == JGlobalID_Index1[jEdge])) || - ((IGlobalID_Index1[iEdge] == JGlobalID_Index1[jEdge]) && (JGlobalID_Index1[iEdge] == IGlobalID_Index1[jEdge])))) { - - Xcoord_Index0.erase (Xcoord_Index0.begin() + jEdge); - Ycoord_Index0.erase (Ycoord_Index0.begin() + jEdge); - Zcoord_Index0.erase (Zcoord_Index0.begin() + jEdge); - Variable_Index0.erase (Variable_Index0.begin() + jEdge); - IGlobalID_Index0.erase (IGlobalID_Index0.begin() + jEdge); - JGlobalID_Index0.erase (JGlobalID_Index0.begin() + jEdge); - - Xcoord_Index1.erase (Xcoord_Index1.begin() + jEdge); - Ycoord_Index1.erase (Ycoord_Index1.begin() + jEdge); - Zcoord_Index1.erase (Zcoord_Index1.begin() + jEdge); - Variable_Index1.erase (Variable_Index1.begin() + jEdge); - IGlobalID_Index1.erase (IGlobalID_Index1.begin() + jEdge); - JGlobalID_Index1.erase (JGlobalID_Index1.begin() + jEdge); - - Remove = true; break; - - } + if ((((IGlobalID_Index0[iEdge] == IGlobalID_Index0[jEdge]) && + (JGlobalID_Index0[iEdge] == JGlobalID_Index0[jEdge])) || + ((IGlobalID_Index0[iEdge] == JGlobalID_Index0[jEdge]) && + (JGlobalID_Index0[iEdge] == IGlobalID_Index0[jEdge]))) && + (((IGlobalID_Index1[iEdge] == IGlobalID_Index1[jEdge]) && + (JGlobalID_Index1[iEdge] == JGlobalID_Index1[jEdge])) || + ((IGlobalID_Index1[iEdge] == JGlobalID_Index1[jEdge]) && + (JGlobalID_Index1[iEdge] == IGlobalID_Index1[jEdge])))) { + Xcoord_Index0.erase(Xcoord_Index0.begin() + jEdge); + Ycoord_Index0.erase(Ycoord_Index0.begin() + jEdge); + Zcoord_Index0.erase(Zcoord_Index0.begin() + jEdge); + Variable_Index0.erase(Variable_Index0.begin() + jEdge); + IGlobalID_Index0.erase(IGlobalID_Index0.begin() + jEdge); + JGlobalID_Index0.erase(JGlobalID_Index0.begin() + jEdge); + + Xcoord_Index1.erase(Xcoord_Index1.begin() + jEdge); + Ycoord_Index1.erase(Ycoord_Index1.begin() + jEdge); + Zcoord_Index1.erase(Zcoord_Index1.begin() + jEdge); + Variable_Index1.erase(Variable_Index1.begin() + jEdge); + IGlobalID_Index1.erase(IGlobalID_Index1.begin() + jEdge); + JGlobalID_Index1.erase(JGlobalID_Index1.begin() + jEdge); + + Remove = true; + break; + } /*--- Edges with oposite orientation ---*/ - if ((((IGlobalID_Index0[iEdge] == IGlobalID_Index1[jEdge]) && (JGlobalID_Index0[iEdge] == JGlobalID_Index1[jEdge])) || - ((IGlobalID_Index0[iEdge] == JGlobalID_Index1[jEdge]) && (JGlobalID_Index0[iEdge] == IGlobalID_Index1[jEdge]))) && - (((IGlobalID_Index1[iEdge] == IGlobalID_Index0[jEdge]) && (JGlobalID_Index1[iEdge] == JGlobalID_Index0[jEdge])) || - ((IGlobalID_Index1[iEdge] == JGlobalID_Index0[jEdge]) && (JGlobalID_Index1[iEdge] == IGlobalID_Index0[jEdge])))) { - - Xcoord_Index0.erase (Xcoord_Index0.begin() + jEdge); - Ycoord_Index0.erase (Ycoord_Index0.begin() + jEdge); - Zcoord_Index0.erase (Zcoord_Index0.begin() + jEdge); - Variable_Index0.erase (Variable_Index0.begin() + jEdge); - IGlobalID_Index0.erase (IGlobalID_Index0.begin() + jEdge); - JGlobalID_Index0.erase (JGlobalID_Index0.begin() + jEdge); - - Xcoord_Index1.erase (Xcoord_Index1.begin() + jEdge); - Ycoord_Index1.erase (Ycoord_Index1.begin() + jEdge); - Zcoord_Index1.erase (Zcoord_Index1.begin() + jEdge); - Variable_Index1.erase (Variable_Index1.begin() + jEdge); - IGlobalID_Index1.erase (IGlobalID_Index1.begin() + jEdge); - JGlobalID_Index1.erase (JGlobalID_Index1.begin() + jEdge); - - Remove = true; break; - } + if ((((IGlobalID_Index0[iEdge] == IGlobalID_Index1[jEdge]) && + (JGlobalID_Index0[iEdge] == JGlobalID_Index1[jEdge])) || + ((IGlobalID_Index0[iEdge] == JGlobalID_Index1[jEdge]) && + (JGlobalID_Index0[iEdge] == IGlobalID_Index1[jEdge]))) && + (((IGlobalID_Index1[iEdge] == IGlobalID_Index0[jEdge]) && + (JGlobalID_Index1[iEdge] == JGlobalID_Index0[jEdge])) || + ((IGlobalID_Index1[iEdge] == JGlobalID_Index0[jEdge]) && + (JGlobalID_Index1[iEdge] == IGlobalID_Index0[jEdge])))) { + Xcoord_Index0.erase(Xcoord_Index0.begin() + jEdge); + Ycoord_Index0.erase(Ycoord_Index0.begin() + jEdge); + Zcoord_Index0.erase(Zcoord_Index0.begin() + jEdge); + Variable_Index0.erase(Variable_Index0.begin() + jEdge); + IGlobalID_Index0.erase(IGlobalID_Index0.begin() + jEdge); + JGlobalID_Index0.erase(JGlobalID_Index0.begin() + jEdge); + + Xcoord_Index1.erase(Xcoord_Index1.begin() + jEdge); + Ycoord_Index1.erase(Ycoord_Index1.begin() + jEdge); + Zcoord_Index1.erase(Zcoord_Index1.begin() + jEdge); + Variable_Index1.erase(Variable_Index1.begin() + jEdge); + IGlobalID_Index1.erase(IGlobalID_Index1.begin() + jEdge); + JGlobalID_Index1.erase(JGlobalID_Index1.begin() + jEdge); + + Remove = true; + break; + } if (Remove) break; } if (Remove) break; } - } while (Remove == true); + } while (Remove); if (Xcoord_Index0.size() != 1) { - /*--- Rotate from the Y-Z plane to the X-Z plane to reuse the rest of subroutines ---*/ if (config->GetGeo_Description() == FUSELAGE) { - su2double Angle = -0.5*PI_NUMBER; + su2double Angle = -0.5 * PI_NUMBER; for (iEdge = 0; iEdge < Xcoord_Index0.size(); iEdge++) { - su2double XCoord = Xcoord_Index0[iEdge]*cos(Angle) - Ycoord_Index0[iEdge]*sin(Angle); - su2double YCoord = Ycoord_Index0[iEdge]*cos(Angle) + Xcoord_Index0[iEdge]*sin(Angle); + su2double XCoord = Xcoord_Index0[iEdge] * cos(Angle) - Ycoord_Index0[iEdge] * sin(Angle); + su2double YCoord = Ycoord_Index0[iEdge] * cos(Angle) + Xcoord_Index0[iEdge] * sin(Angle); su2double ZCoord = Zcoord_Index0[iEdge]; - Xcoord_Index0[iEdge] = XCoord; Ycoord_Index0[iEdge] = YCoord; Zcoord_Index0[iEdge] = ZCoord; - XCoord = Xcoord_Index1[iEdge]*cos(Angle) - Ycoord_Index1[iEdge]*sin(Angle); - YCoord = Ycoord_Index1[iEdge]*cos(Angle) + Xcoord_Index1[iEdge]*sin(Angle); + Xcoord_Index0[iEdge] = XCoord; + Ycoord_Index0[iEdge] = YCoord; + Zcoord_Index0[iEdge] = ZCoord; + XCoord = Xcoord_Index1[iEdge] * cos(Angle) - Ycoord_Index1[iEdge] * sin(Angle); + YCoord = Ycoord_Index1[iEdge] * cos(Angle) + Xcoord_Index1[iEdge] * sin(Angle); ZCoord = Zcoord_Index1[iEdge]; - Xcoord_Index1[iEdge] = XCoord; Ycoord_Index1[iEdge] = YCoord; Zcoord_Index1[iEdge] = ZCoord; + Xcoord_Index1[iEdge] = XCoord; + Ycoord_Index1[iEdge] = YCoord; + Zcoord_Index1[iEdge] = ZCoord; } } /*--- Rotate nacelle secction to a X-Z plane to reuse the rest of subroutines ---*/ - if (config->GetGeo_Description() == NACELLE) { - - su2double Tilt_Angle = config->GetNacelleLocation(3)*PI_NUMBER/180; - su2double Toe_Angle = config->GetNacelleLocation(4)*PI_NUMBER/180; - su2double Theta_deg = atan2(Plane_Normal[1],-Plane_Normal[2])/PI_NUMBER*180 + 180; - su2double Roll_Angle = 0.5*PI_NUMBER - Theta_deg*PI_NUMBER/180; + su2double Tilt_Angle = config->GetNacelleLocation(3) * PI_NUMBER / 180; + su2double Toe_Angle = config->GetNacelleLocation(4) * PI_NUMBER / 180; + su2double Theta_deg = atan2(Plane_Normal[1], -Plane_Normal[2]) / PI_NUMBER * 180 + 180; + su2double Roll_Angle = 0.5 * PI_NUMBER - Theta_deg * PI_NUMBER / 180; su2double XCoord_Trans, YCoord_Trans, ZCoord_Trans, XCoord_Trans_Tilt, YCoord_Trans_Tilt, ZCoord_Trans_Tilt, - XCoord_Trans_Tilt_Toe, YCoord_Trans_Tilt_Toe, ZCoord_Trans_Tilt_Toe, XCoord, YCoord, ZCoord; + XCoord_Trans_Tilt_Toe, YCoord_Trans_Tilt_Toe, ZCoord_Trans_Tilt_Toe, XCoord, YCoord, ZCoord; for (iEdge = 0; iEdge < Xcoord_Index0.size(); iEdge++) { - /*--- First point of the edge ---*/ /*--- Translate to the origin ---*/ @@ -2124,25 +2010,27 @@ void CGeometry::ComputeAirfoil_Section(su2double *Plane_P0, su2double *Plane_Nor /*--- Apply tilt angle ---*/ - XCoord_Trans_Tilt = XCoord_Trans*cos(Tilt_Angle) + ZCoord_Trans*sin(Tilt_Angle); + XCoord_Trans_Tilt = XCoord_Trans * cos(Tilt_Angle) + ZCoord_Trans * sin(Tilt_Angle); YCoord_Trans_Tilt = YCoord_Trans; - ZCoord_Trans_Tilt = ZCoord_Trans*cos(Tilt_Angle) - XCoord_Trans*sin(Tilt_Angle); + ZCoord_Trans_Tilt = ZCoord_Trans * cos(Tilt_Angle) - XCoord_Trans * sin(Tilt_Angle); /*--- Apply toe angle ---*/ - XCoord_Trans_Tilt_Toe = XCoord_Trans_Tilt*cos(Toe_Angle) - YCoord_Trans_Tilt*sin(Toe_Angle); - YCoord_Trans_Tilt_Toe = XCoord_Trans_Tilt*sin(Toe_Angle) + YCoord_Trans_Tilt*cos(Toe_Angle); + XCoord_Trans_Tilt_Toe = XCoord_Trans_Tilt * cos(Toe_Angle) - YCoord_Trans_Tilt * sin(Toe_Angle); + YCoord_Trans_Tilt_Toe = XCoord_Trans_Tilt * sin(Toe_Angle) + YCoord_Trans_Tilt * cos(Toe_Angle); ZCoord_Trans_Tilt_Toe = ZCoord_Trans_Tilt; /*--- Rotate to X-Z plane (roll) ---*/ XCoord = XCoord_Trans_Tilt_Toe; - YCoord = YCoord_Trans_Tilt_Toe*cos(Roll_Angle) - ZCoord_Trans_Tilt_Toe*sin(Roll_Angle); - ZCoord = YCoord_Trans_Tilt_Toe*sin(Roll_Angle) + ZCoord_Trans_Tilt_Toe*cos(Roll_Angle); + YCoord = YCoord_Trans_Tilt_Toe * cos(Roll_Angle) - ZCoord_Trans_Tilt_Toe * sin(Roll_Angle); + ZCoord = YCoord_Trans_Tilt_Toe * sin(Roll_Angle) + ZCoord_Trans_Tilt_Toe * cos(Roll_Angle); /*--- Update coordinates ---*/ - Xcoord_Index0[iEdge] = XCoord; Ycoord_Index0[iEdge] = YCoord; Zcoord_Index0[iEdge] = ZCoord; + Xcoord_Index0[iEdge] = XCoord; + Ycoord_Index0[iEdge] = YCoord; + Zcoord_Index0[iEdge] = ZCoord; /*--- Second point of the edge ---*/ @@ -2154,59 +2042,73 @@ void CGeometry::ComputeAirfoil_Section(su2double *Plane_P0, su2double *Plane_Nor /*--- Apply tilt angle ---*/ - XCoord_Trans_Tilt = XCoord_Trans*cos(Tilt_Angle) + ZCoord_Trans*sin(Tilt_Angle); + XCoord_Trans_Tilt = XCoord_Trans * cos(Tilt_Angle) + ZCoord_Trans * sin(Tilt_Angle); YCoord_Trans_Tilt = YCoord_Trans; - ZCoord_Trans_Tilt = ZCoord_Trans*cos(Tilt_Angle) - XCoord_Trans*sin(Tilt_Angle); + ZCoord_Trans_Tilt = ZCoord_Trans * cos(Tilt_Angle) - XCoord_Trans * sin(Tilt_Angle); /*--- Apply toe angle ---*/ - XCoord_Trans_Tilt_Toe = XCoord_Trans_Tilt*cos(Toe_Angle) - YCoord_Trans_Tilt*sin(Toe_Angle); - YCoord_Trans_Tilt_Toe = XCoord_Trans_Tilt*sin(Toe_Angle) + YCoord_Trans_Tilt*cos(Toe_Angle); + XCoord_Trans_Tilt_Toe = XCoord_Trans_Tilt * cos(Toe_Angle) - YCoord_Trans_Tilt * sin(Toe_Angle); + YCoord_Trans_Tilt_Toe = XCoord_Trans_Tilt * sin(Toe_Angle) + YCoord_Trans_Tilt * cos(Toe_Angle); ZCoord_Trans_Tilt_Toe = ZCoord_Trans_Tilt; /*--- Rotate to X-Z plane (roll) ---*/ XCoord = XCoord_Trans_Tilt_Toe; - YCoord = YCoord_Trans_Tilt_Toe*cos(Roll_Angle) - ZCoord_Trans_Tilt_Toe*sin(Roll_Angle); - ZCoord = YCoord_Trans_Tilt_Toe*sin(Roll_Angle) + ZCoord_Trans_Tilt_Toe*cos(Roll_Angle); + YCoord = YCoord_Trans_Tilt_Toe * cos(Roll_Angle) - ZCoord_Trans_Tilt_Toe * sin(Roll_Angle); + ZCoord = YCoord_Trans_Tilt_Toe * sin(Roll_Angle) + ZCoord_Trans_Tilt_Toe * cos(Roll_Angle); /*--- Update coordinates ---*/ - Xcoord_Index1[iEdge] = XCoord; Ycoord_Index1[iEdge] = YCoord; Zcoord_Index1[iEdge] = ZCoord; - + Xcoord_Index1[iEdge] = XCoord; + Ycoord_Index1[iEdge] = YCoord; + Zcoord_Index1[iEdge] = ZCoord; } } - /*--- Identify the extreme of the curve and close it ---*/ - Conection_Index0.reserve(Xcoord_Index0.size()+1); - Conection_Index1.reserve(Xcoord_Index0.size()+1); + Conection_Index0.reserve(Xcoord_Index0.size() + 1); + Conection_Index1.reserve(Xcoord_Index0.size() + 1); for (iEdge = 0; iEdge < Xcoord_Index0.size(); iEdge++) { Conection_Index0[iEdge] = 0; Conection_Index1[iEdge] = 0; } - for (iEdge = 0; iEdge < Xcoord_Index0.size()-1; iEdge++) { - for (jEdge = iEdge+1; jEdge < Xcoord_Index0.size(); jEdge++) { - - if (((IGlobalID_Index0[iEdge] == IGlobalID_Index0[jEdge]) && (JGlobalID_Index0[iEdge] == JGlobalID_Index0[jEdge])) || - ((IGlobalID_Index0[iEdge] == JGlobalID_Index0[jEdge]) && (JGlobalID_Index0[iEdge] == IGlobalID_Index0[jEdge]))) - { Conection_Index0[iEdge]++; Conection_Index0[jEdge]++; } - - if (((IGlobalID_Index0[iEdge] == IGlobalID_Index1[jEdge]) && (JGlobalID_Index0[iEdge] == JGlobalID_Index1[jEdge])) || - ((IGlobalID_Index0[iEdge] == JGlobalID_Index1[jEdge]) && (JGlobalID_Index0[iEdge] == IGlobalID_Index1[jEdge]))) - { Conection_Index0[iEdge]++; Conection_Index1[jEdge]++; } + for (iEdge = 0; iEdge < Xcoord_Index0.size() - 1; iEdge++) { + for (jEdge = iEdge + 1; jEdge < Xcoord_Index0.size(); jEdge++) { + if (((IGlobalID_Index0[iEdge] == IGlobalID_Index0[jEdge]) && + (JGlobalID_Index0[iEdge] == JGlobalID_Index0[jEdge])) || + ((IGlobalID_Index0[iEdge] == JGlobalID_Index0[jEdge]) && + (JGlobalID_Index0[iEdge] == IGlobalID_Index0[jEdge]))) { + Conection_Index0[iEdge]++; + Conection_Index0[jEdge]++; + } - if (((IGlobalID_Index1[iEdge] == IGlobalID_Index0[jEdge]) && (JGlobalID_Index1[iEdge] == JGlobalID_Index0[jEdge])) || - ((IGlobalID_Index1[iEdge] == JGlobalID_Index0[jEdge]) && (JGlobalID_Index1[iEdge] == IGlobalID_Index0[jEdge]))) - { Conection_Index1[iEdge]++; Conection_Index0[jEdge]++; } + if (((IGlobalID_Index0[iEdge] == IGlobalID_Index1[jEdge]) && + (JGlobalID_Index0[iEdge] == JGlobalID_Index1[jEdge])) || + ((IGlobalID_Index0[iEdge] == JGlobalID_Index1[jEdge]) && + (JGlobalID_Index0[iEdge] == IGlobalID_Index1[jEdge]))) { + Conection_Index0[iEdge]++; + Conection_Index1[jEdge]++; + } - if (((IGlobalID_Index1[iEdge] == IGlobalID_Index1[jEdge]) && (JGlobalID_Index1[iEdge] == JGlobalID_Index1[jEdge])) || - ((IGlobalID_Index1[iEdge] == JGlobalID_Index1[jEdge]) && (JGlobalID_Index1[iEdge] == IGlobalID_Index1[jEdge]))) - { Conection_Index1[iEdge]++; Conection_Index1[jEdge]++; } + if (((IGlobalID_Index1[iEdge] == IGlobalID_Index0[jEdge]) && + (JGlobalID_Index1[iEdge] == JGlobalID_Index0[jEdge])) || + ((IGlobalID_Index1[iEdge] == JGlobalID_Index0[jEdge]) && + (JGlobalID_Index1[iEdge] == IGlobalID_Index0[jEdge]))) { + Conection_Index1[iEdge]++; + Conection_Index0[jEdge]++; + } + if (((IGlobalID_Index1[iEdge] == IGlobalID_Index1[jEdge]) && + (JGlobalID_Index1[iEdge] == JGlobalID_Index1[jEdge])) || + ((IGlobalID_Index1[iEdge] == JGlobalID_Index1[jEdge]) && + (JGlobalID_Index1[iEdge] == IGlobalID_Index1[jEdge]))) { + Conection_Index1[iEdge]++; + Conection_Index1[jEdge]++; + } } } @@ -2238,56 +2140,57 @@ void CGeometry::ComputeAirfoil_Section(su2double *Plane_P0, su2double *Plane_Nor /*--- Second, if it is an open curve then find the closest point to an extreme to close it ---*/ if (XcoordExtra.size() > 1) { - - for (iEdge = 0; iEdge < XcoordExtra.size()-1; iEdge++) { - - su2double MinDist = 1E6; FoundEdge = false; EdgeDonor = 0; - for (jEdge = iEdge+1; jEdge < XcoordExtra.size(); jEdge++) { - Dist_Value = sqrt(pow(SU2_TYPE::GetValue(XcoordExtra[iEdge])-SU2_TYPE::GetValue(XcoordExtra[jEdge]), 2.0)); + for (iEdge = 0; iEdge < XcoordExtra.size() - 1; iEdge++) { + su2double MinDist = 1E6; + FoundEdge = false; + EdgeDonor = 0; + for (jEdge = iEdge + 1; jEdge < XcoordExtra.size(); jEdge++) { + Dist_Value = + sqrt(pow(SU2_TYPE::GetValue(XcoordExtra[iEdge]) - SU2_TYPE::GetValue(XcoordExtra[jEdge]), 2.0)); if ((Dist_Value < MinDist) && (AddExtra[iEdge]) && (AddExtra[jEdge])) { - EdgeDonor = jEdge; FoundEdge = true; + EdgeDonor = jEdge; + FoundEdge = true; } } if (FoundEdge) { - /*--- Add first point of the new edge ---*/ - Xcoord_Index0.push_back (XcoordExtra[iEdge]); - Ycoord_Index0.push_back (YcoordExtra[iEdge]); - Zcoord_Index0.push_back (ZcoordExtra[iEdge]); - Variable_Index0.push_back (VariableExtra[iEdge]); - IGlobalID_Index0.push_back (IGlobalIDExtra[iEdge]); - JGlobalID_Index0.push_back (JGlobalIDExtra[iEdge]); + Xcoord_Index0.push_back(XcoordExtra[iEdge]); + Ycoord_Index0.push_back(YcoordExtra[iEdge]); + Zcoord_Index0.push_back(ZcoordExtra[iEdge]); + Variable_Index0.push_back(VariableExtra[iEdge]); + IGlobalID_Index0.push_back(IGlobalIDExtra[iEdge]); + JGlobalID_Index0.push_back(JGlobalIDExtra[iEdge]); AddExtra[iEdge] = false; /*--- Add second (closest) point of the new edge ---*/ - Xcoord_Index1.push_back (XcoordExtra[EdgeDonor]); - Ycoord_Index1.push_back (YcoordExtra[EdgeDonor]); - Zcoord_Index1.push_back (ZcoordExtra[EdgeDonor]); - Variable_Index1.push_back (VariableExtra[EdgeDonor]); - IGlobalID_Index1.push_back (IGlobalIDExtra[EdgeDonor]); - JGlobalID_Index1.push_back (JGlobalIDExtra[EdgeDonor]); + Xcoord_Index1.push_back(XcoordExtra[EdgeDonor]); + Ycoord_Index1.push_back(YcoordExtra[EdgeDonor]); + Zcoord_Index1.push_back(ZcoordExtra[EdgeDonor]); + Variable_Index1.push_back(VariableExtra[EdgeDonor]); + IGlobalID_Index1.push_back(IGlobalIDExtra[EdgeDonor]); + JGlobalID_Index1.push_back(JGlobalIDExtra[EdgeDonor]); AddExtra[EdgeDonor] = false; - } - } } else if (XcoordExtra.size() == 1) { - cout <<"There cutting system has failed, there is an incomplete curve (not used)." << endl; + cout << "There cutting system has failed, there is an incomplete curve (not used)." << endl; } /*--- Find and add the trailing edge to to the list and the contect the first point to the trailing edge ---*/ - Trailing_Point = 0; Trailing_Coord = Xcoord_Index0[0]; + Trailing_Point = 0; + Trailing_Coord = Xcoord_Index0[0]; for (iEdge = 1; iEdge < Xcoord_Index0.size(); iEdge++) { if (Xcoord_Index0[iEdge] > Trailing_Coord) { - Trailing_Point = iEdge; Trailing_Coord = Xcoord_Index0[iEdge]; + Trailing_Point = iEdge; + Trailing_Coord = Xcoord_Index0[iEdge]; } } @@ -2305,25 +2208,23 @@ void CGeometry::ComputeAirfoil_Section(su2double *Plane_P0, su2double *Plane_Nor IGlobalID_Airfoil.push_back(IGlobalID_Index1[Trailing_Point]); JGlobalID_Airfoil.push_back(JGlobalID_Index1[Trailing_Point]); - Xcoord_Index0.erase (Xcoord_Index0.begin() + Trailing_Point); - Ycoord_Index0.erase (Ycoord_Index0.begin() + Trailing_Point); - Zcoord_Index0.erase (Zcoord_Index0.begin() + Trailing_Point); - Variable_Index0.erase (Variable_Index0.begin() + Trailing_Point); - IGlobalID_Index0.erase (IGlobalID_Index0.begin() + Trailing_Point); - JGlobalID_Index0.erase (JGlobalID_Index0.begin() + Trailing_Point); - - Xcoord_Index1.erase (Xcoord_Index1.begin() + Trailing_Point); - Ycoord_Index1.erase (Ycoord_Index1.begin() + Trailing_Point); - Zcoord_Index1.erase (Zcoord_Index1.begin() + Trailing_Point); - Variable_Index1.erase (Variable_Index1.begin() + Trailing_Point); - IGlobalID_Index1.erase (IGlobalID_Index1.begin() + Trailing_Point); - JGlobalID_Index1.erase (JGlobalID_Index1.begin() + Trailing_Point); + Xcoord_Index0.erase(Xcoord_Index0.begin() + Trailing_Point); + Ycoord_Index0.erase(Ycoord_Index0.begin() + Trailing_Point); + Zcoord_Index0.erase(Zcoord_Index0.begin() + Trailing_Point); + Variable_Index0.erase(Variable_Index0.begin() + Trailing_Point); + IGlobalID_Index0.erase(IGlobalID_Index0.begin() + Trailing_Point); + JGlobalID_Index0.erase(JGlobalID_Index0.begin() + Trailing_Point); + Xcoord_Index1.erase(Xcoord_Index1.begin() + Trailing_Point); + Ycoord_Index1.erase(Ycoord_Index1.begin() + Trailing_Point); + Zcoord_Index1.erase(Zcoord_Index1.begin() + Trailing_Point); + Variable_Index1.erase(Variable_Index1.begin() + Trailing_Point); + IGlobalID_Index1.erase(IGlobalID_Index1.begin() + Trailing_Point); + JGlobalID_Index1.erase(JGlobalID_Index1.begin() + Trailing_Point); /*--- Algorithm for adding the rest of the points ---*/ do { - /*--- Last added point in the list ---*/ Airfoil_Point = Xcoord_Airfoil.size() - 1; @@ -2333,23 +2234,30 @@ void CGeometry::ComputeAirfoil_Section(su2double *Plane_P0, su2double *Plane_Nor Found_Edge = false; for (iEdge = 0; iEdge < Xcoord_Index0.size(); iEdge++) { - - if (((IGlobalID_Index0[iEdge] == IGlobalID_Airfoil[Airfoil_Point]) && (JGlobalID_Index0[iEdge] == JGlobalID_Airfoil[Airfoil_Point])) || - ((IGlobalID_Index0[iEdge] == JGlobalID_Airfoil[Airfoil_Point]) && (JGlobalID_Index0[iEdge] == IGlobalID_Airfoil[Airfoil_Point]))) { - Next_Edge = iEdge; Found_Edge = true; Index = 0; break; + if (((IGlobalID_Index0[iEdge] == IGlobalID_Airfoil[Airfoil_Point]) && + (JGlobalID_Index0[iEdge] == JGlobalID_Airfoil[Airfoil_Point])) || + ((IGlobalID_Index0[iEdge] == JGlobalID_Airfoil[Airfoil_Point]) && + (JGlobalID_Index0[iEdge] == IGlobalID_Airfoil[Airfoil_Point]))) { + Next_Edge = iEdge; + Found_Edge = true; + Index = 0; + break; } - if (((IGlobalID_Index1[iEdge] == IGlobalID_Airfoil[Airfoil_Point]) && (JGlobalID_Index1[iEdge] == JGlobalID_Airfoil[Airfoil_Point])) || - ((IGlobalID_Index1[iEdge] == JGlobalID_Airfoil[Airfoil_Point]) && (JGlobalID_Index1[iEdge] == IGlobalID_Airfoil[Airfoil_Point]))) { - Next_Edge = iEdge; Found_Edge = true; Index = 1; break; + if (((IGlobalID_Index1[iEdge] == IGlobalID_Airfoil[Airfoil_Point]) && + (JGlobalID_Index1[iEdge] == JGlobalID_Airfoil[Airfoil_Point])) || + ((IGlobalID_Index1[iEdge] == JGlobalID_Airfoil[Airfoil_Point]) && + (JGlobalID_Index1[iEdge] == IGlobalID_Airfoil[Airfoil_Point]))) { + Next_Edge = iEdge; + Found_Edge = true; + Index = 1; + break; } - } /*--- Add and remove the next point to the list and the next point in the edge ---*/ if (Found_Edge) { - if (Index == 0) { Xcoord_Airfoil.push_back(Xcoord_Index1[Next_Edge]); Ycoord_Airfoil.push_back(Ycoord_Index1[Next_Edge]); @@ -2382,36 +2290,43 @@ void CGeometry::ComputeAirfoil_Section(su2double *Plane_P0, su2double *Plane_Nor IGlobalID_Index1.erase(IGlobalID_Index1.begin() + Next_Edge); JGlobalID_Index1.erase(JGlobalID_Index1.begin() + Next_Edge); + } else { + break; } - else { break; } - } while (Xcoord_Index0.size() != 0); + } while (!Xcoord_Index0.empty()); /*--- Clean the vector before using them again for storing the upper or the lower side ---*/ - Xcoord_Index0.clear(); Ycoord_Index0.clear(); Zcoord_Index0.clear(); Variable_Index0.clear(); IGlobalID_Index0.clear(); JGlobalID_Index0.clear(); - Xcoord_Index1.clear(); Ycoord_Index1.clear(); Zcoord_Index1.clear(); Variable_Index1.clear(); IGlobalID_Index1.clear(); JGlobalID_Index1.clear(); - + Xcoord_Index0.clear(); + Ycoord_Index0.clear(); + Zcoord_Index0.clear(); + Variable_Index0.clear(); + IGlobalID_Index0.clear(); + JGlobalID_Index0.clear(); + Xcoord_Index1.clear(); + Ycoord_Index1.clear(); + Zcoord_Index1.clear(); + Variable_Index1.clear(); + IGlobalID_Index1.clear(); + JGlobalID_Index1.clear(); } - } AD::EndPassive(wasActive); - } void CGeometry::RegisterCoordinates() const { const bool input = true; - SU2_OMP_FOR_STAT(roundUpDiv(nPoint,omp_get_num_threads())) + SU2_OMP_FOR_STAT(roundUpDiv(nPoint, omp_get_num_threads())) for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { nodes->RegisterCoordinates(iPoint, input); } END_SU2_OMP_FOR } -void CGeometry::UpdateGeometry(CGeometry **geometry_container, CConfig *config) { - +void CGeometry::UpdateGeometry(CGeometry** geometry_container, CConfig* config) { geometry_container[MESH_0]->InitiateComms(geometry_container[MESH_0], config, COORDINATES); geometry_container[MESH_0]->CompleteComms(geometry_container[MESH_0], config, COORDINATES); @@ -2422,18 +2337,16 @@ void CGeometry::UpdateGeometry(CGeometry **geometry_container, CConfig *config) for (unsigned short iMesh = 1; iMesh <= config->GetnMGLevels(); iMesh++) { /*--- Update the control volume structures ---*/ - geometry_container[iMesh]->SetControlVolume(geometry_container[iMesh-1], UPDATE); - geometry_container[iMesh]->SetBoundControlVolume(geometry_container[iMesh-1], UPDATE); - geometry_container[iMesh]->SetCoord(geometry_container[iMesh-1]); - + geometry_container[iMesh]->SetControlVolume(geometry_container[iMesh - 1], UPDATE); + geometry_container[iMesh]->SetBoundControlVolume(geometry_container[iMesh - 1], UPDATE); + geometry_container[iMesh]->SetCoord(geometry_container[iMesh - 1]); } /*--- Compute the global surface areas for all markers. ---*/ geometry_container[MESH_0]->ComputeSurfaceAreaCfgFile(config); } -void CGeometry::SetCustomBoundary(CConfig *config) { - +void CGeometry::SetCustomBoundary(CConfig* config) { unsigned short iMarker; unsigned long iVertex; string Marker_Tag; @@ -2443,21 +2356,21 @@ void CGeometry::SetCustomBoundary(CConfig *config) { CustomBoundaryTemperature = new su2double*[nMarker]; CustomBoundaryHeatFlux = new su2double*[nMarker]; - for(iMarker=0; iMarker < nMarker; iMarker++){ + for (iMarker = 0; iMarker < nMarker; iMarker++) { Marker_Tag = config->GetMarker_All_TagBound(iMarker); CustomBoundaryHeatFlux[iMarker] = nullptr; CustomBoundaryTemperature[iMarker] = nullptr; - if(config->GetMarker_All_PyCustom(iMarker)){ - switch(config->GetMarker_All_KindBC(iMarker)){ + if (config->GetMarker_All_PyCustom(iMarker)) { + switch (config->GetMarker_All_KindBC(iMarker)) { case HEAT_FLUX: CustomBoundaryHeatFlux[iMarker] = new su2double[nVertex[iMarker]]; - for(iVertex=0; iVertex < nVertex[iMarker]; iVertex++){ + for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { CustomBoundaryHeatFlux[iMarker][iVertex] = config->GetWall_HeatFlux(Marker_Tag); } break; case ISOTHERMAL: CustomBoundaryTemperature[iMarker] = new su2double[nVertex[iMarker]]; - for(iVertex=0; iVertex < nVertex[iMarker]; iVertex++){ + for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { CustomBoundaryTemperature[iMarker][iVertex] = config->GetIsothermal_Temperature(Marker_Tag); } break; @@ -2470,19 +2383,17 @@ void CGeometry::SetCustomBoundary(CConfig *config) { } } } - } -void CGeometry::UpdateCustomBoundaryConditions(CGeometry **geometry_container, CConfig *config){ - +void CGeometry::UpdateCustomBoundaryConditions(CGeometry** geometry_container, CConfig* config) { unsigned short iMGfine, iMGlevel, nMGlevel, iMarker; nMGlevel = config->GetnMGLevels(); - for (iMGlevel=1; iMGlevel <= nMGlevel; iMGlevel++){ - iMGfine = iMGlevel-1; - for(iMarker = 0; iMarker< config->GetnMarker_All(); iMarker++){ - if(config->GetMarker_All_PyCustom(iMarker)){ - switch(config->GetMarker_All_KindBC(iMarker)){ + for (iMGlevel = 1; iMGlevel <= nMGlevel; iMGlevel++) { + iMGfine = iMGlevel - 1; + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + if (config->GetMarker_All_PyCustom(iMarker)) { + switch (config->GetMarker_All_KindBC(iMarker)) { case HEAT_FLUX: geometry_container[iMGlevel]->SetMultiGridWallHeatFlux(geometry_container[iMGfine], iMarker); break; @@ -2490,85 +2401,71 @@ void CGeometry::UpdateCustomBoundaryConditions(CGeometry **geometry_container, C geometry_container[iMGlevel]->SetMultiGridWallTemperature(geometry_container[iMGfine], iMarker); break; // Inlet flow handled in solver class. - default: break; + default: + break; } } } } } -void CGeometry::ComputeSurfaceAreaCfgFile(const CConfig *config) { - SU2_OMP_MASTER - { - const auto nMarker_Global = config->GetnMarker_CfgFile(); - SurfaceAreaCfgFile.resize(nMarker_Global); - vector LocalSurfaceArea(nMarker_Global, 0.0); - - /*--- Loop over all local markers ---*/ - for (unsigned short iMarker = 0; iMarker < nMarker; iMarker++) { +void CGeometry::ComputeSurfaceAreaCfgFile(const CConfig* config){ + SU2_OMP_MASTER{const auto nMarker_Global = config->GetnMarker_CfgFile(); +SurfaceAreaCfgFile.resize(nMarker_Global); +vector LocalSurfaceArea(nMarker_Global, 0.0); - const auto Local_TagBound = config->GetMarker_All_TagBound(iMarker); - - /*--- Loop over all global markers, and find the local-global pair via - matching unique string tags. ---*/ - for (unsigned short iMarker_Global = 0; iMarker_Global < nMarker_Global; iMarker_Global++) { +/*--- Loop over all local markers ---*/ +for (unsigned short iMarker = 0; iMarker < nMarker; iMarker++) { + const auto Local_TagBound = config->GetMarker_All_TagBound(iMarker); - const auto Global_TagBound = config->GetMarker_CfgFile_TagBound(iMarker_Global); - if (Local_TagBound == Global_TagBound) { - - for(auto iVertex = 0ul; iVertex < nVertex[iMarker]; iVertex++ ) { - - const auto iPoint = vertex[iMarker][iVertex]->GetNode(); + /*--- Loop over all global markers, and find the local-global pair via + matching unique string tags. ---*/ + for (unsigned short iMarker_Global = 0; iMarker_Global < nMarker_Global; iMarker_Global++) { + const auto Global_TagBound = config->GetMarker_CfgFile_TagBound(iMarker_Global); + if (Local_TagBound == Global_TagBound) { + for (auto iVertex = 0ul; iVertex < nVertex[iMarker]; iVertex++) { + const auto iPoint = vertex[iMarker][iVertex]->GetNode(); - if(!nodes->GetDomain(iPoint)) continue; + if (!nodes->GetDomain(iPoint)) continue; - const auto AreaNormal = vertex[iMarker][iVertex]->GetNormal(); - const auto Area = GeometryToolbox::Norm(nDim, AreaNormal); + const auto AreaNormal = vertex[iMarker][iVertex]->GetNormal(); + const auto Area = GeometryToolbox::Norm(nDim, AreaNormal); - LocalSurfaceArea[iMarker_Global] += Area; - }// for iVertex - }//if Local == Global - }//for iMarker_Global - }//for iMarker + LocalSurfaceArea[iMarker_Global] += Area; + } // for iVertex + } // if Local == Global + } // for iMarker_Global +} // for iMarker - SU2_MPI::Allreduce(LocalSurfaceArea.data(), SurfaceAreaCfgFile.data(), SurfaceAreaCfgFile.size(), MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - } END_SU2_OMP_MASTER +SU2_MPI::Allreduce(LocalSurfaceArea.data(), SurfaceAreaCfgFile.data(), SurfaceAreaCfgFile.size(), MPI_DOUBLE, MPI_SUM, + SU2_MPI::GetComm()); +} +END_SU2_OMP_MASTER } -su2double CGeometry::GetSurfaceArea(const CConfig *config, unsigned short val_marker) const { +su2double CGeometry::GetSurfaceArea(const CConfig* config, unsigned short val_marker) const { /*---Find the precomputed marker surface area by local-global string-matching. ---*/ const auto Marker_Tag = config->GetMarker_All_TagBound(val_marker); for (unsigned short iMarker_Global = 0; iMarker_Global < config->GetnMarker_CfgFile(); iMarker_Global++) { - const auto Global_TagBound = config->GetMarker_CfgFile_TagBound(iMarker_Global); - if (Marker_Tag == Global_TagBound) - return SurfaceAreaCfgFile[iMarker_Global]; - + if (Marker_Tag == Global_TagBound) return SurfaceAreaCfgFile[iMarker_Global]; } SU2_MPI::Error("Unable to match local-marker with cfg-marker for Surface Area.", CURRENT_FUNCTION); return 0.0; } -void CGeometry::ComputeSurf_Straightness(CConfig *config, - bool print_on_screen) { - +void CGeometry::ComputeSurf_Straightness(CConfig* config, bool print_on_screen) { bool RefUnitNormal_defined; - unsigned short iDim, - iMarker, - iMarker_Global, - nMarker_Global = config->GetnMarker_CfgFile(); + unsigned short iDim, iMarker, iMarker_Global, nMarker_Global = config->GetnMarker_CfgFile(); unsigned long iVertex; constexpr passivedouble epsilon = 1.0e-6; su2double Area; - string Local_TagBound, - Global_TagBound; + string Local_TagBound, Global_TagBound; - vector Normal(nDim), - UnitNormal(nDim), - RefUnitNormal(nDim); + vector Normal(nDim), UnitNormal(nDim), RefUnitNormal(nDim); /*--- Assume now that this boundary marker is straight. As soon as one AreaElement is found that is not aligend with a Reference then it is @@ -2584,7 +2481,6 @@ void CGeometry::ComputeSurf_Straightness(CConfig *config, /*--- Loop over all local markers ---*/ for (iMarker = 0; iMarker < nMarker; iMarker++) { - Local_TagBound = config->GetMarker_All_TagBound(iMarker); /*--- Marker has to be Symmetry or Euler. Additionally marker can't be a @@ -2592,61 +2488,53 @@ void CGeometry::ComputeSurf_Straightness(CConfig *config, other GridMovements are rigid. ---*/ if ((config->GetMarker_All_KindBC(iMarker) == SYMMETRY_PLANE || config->GetMarker_All_KindBC(iMarker) == EULER_WALL) && - !config->GetMarker_Moving_Bool(Local_TagBound)) { - + !config->GetMarker_Moving_Bool(Local_TagBound) && !config->GetMarker_Deform_Mesh_Bool(Local_TagBound)) { /*--- Loop over all global markers, and find the local-global pair via matching unique string tags. ---*/ for (iMarker_Global = 0; iMarker_Global < nMarker_Global; iMarker_Global++) { - Global_TagBound = config->GetMarker_CfgFile_TagBound(iMarker_Global); if (Local_TagBound == Global_TagBound) { - RefUnitNormal_defined = false; iVertex = 0; - while(bound_is_straight[iMarker] == true && - iVertex < nVertex[iMarker]) { - + while (bound_is_straight[iMarker] && iVertex < nVertex[iMarker]) { vertex[iMarker][iVertex]->GetNormal(Normal.data()); UnitNormal = Normal; /*--- Compute unit normal. ---*/ Area = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - Area += Normal[iDim]*Normal[iDim]; + for (iDim = 0; iDim < nDim; iDim++) Area += Normal[iDim] * Normal[iDim]; Area = sqrt(Area); /*--- Negate for outward convention. ---*/ - for (iDim = 0; iDim < nDim; iDim++) - UnitNormal[iDim] /= -Area; + for (iDim = 0; iDim < nDim; iDim++) UnitNormal[iDim] /= -Area; /*--- Check if unit normal is within tolerance of the Reference unit normal. Reference unit normal = first unit normal found. ---*/ - if(RefUnitNormal_defined) { + if (RefUnitNormal_defined) { for (iDim = 0; iDim < nDim; iDim++) { - if( abs(RefUnitNormal[iDim] - UnitNormal[iDim]) > epsilon ) { + if (abs(RefUnitNormal[iDim] - UnitNormal[iDim]) > epsilon) { bound_is_straight[iMarker] = false; break; } } } else { - RefUnitNormal = UnitNormal; //deep copy of values + RefUnitNormal = UnitNormal; // deep copy of values RefUnitNormal_defined = true; } - iVertex++; - }//while iVertex - }//if Local == Global - }//for iMarker_Global + iVertex++; + } // while iVertex + } // if Local == Global + } // for iMarker_Global } else { /*--- Enforce default value: false ---*/ bound_is_straight[iMarker] = false; - }//if sym or euler ... - }//for iMarker + } // if sym or euler ... + } // for iMarker /*--- Communicate results and print on screen. ---*/ - if(print_on_screen) { - + if (print_on_screen) { /*--- Additional vector which can later be MPI::Allreduce(d) to pring the results on screen as nMarker (local) can vary across ranks. Default 'true' as it can happen that a local rank does not contain an element of each surface marker. ---*/ @@ -2657,65 +2545,60 @@ void CGeometry::ComputeSurf_Straightness(CConfig *config, for (iMarker_Global = 0; iMarker_Global < nMarker_Global; iMarker_Global++) { Global_TagBound = config->GetMarker_CfgFile_TagBound(iMarker_Global); - if(Local_TagBound == Global_TagBound) - bound_is_straight_Global[iMarker_Global] = bound_is_straight[iMarker]; + if (Local_TagBound == Global_TagBound) bound_is_straight_Global[iMarker_Global] = bound_is_straight[iMarker]; - }//for iMarker_Global - }//for iMarker + } // for iMarker_Global + } // for iMarker - vector Buff_Send_isStraight(nMarker_Global), - Buff_Recv_isStraight(nMarker_Global); + vector Buff_Send_isStraight(nMarker_Global), Buff_Recv_isStraight(nMarker_Global); /*--- Cast to int as std::vector can be a special construct. MPI handling using is more straight-forward. ---*/ for (iMarker_Global = 0; iMarker_Global < nMarker_Global; iMarker_Global++) - Buff_Send_isStraight[iMarker_Global] = static_cast (bound_is_straight_Global[iMarker_Global]); + Buff_Send_isStraight[iMarker_Global] = static_cast(bound_is_straight_Global[iMarker_Global]); /*--- Product of type (bool) is equivalnt to a 'logical and' ---*/ - SU2_MPI::Allreduce(Buff_Send_isStraight.data(), Buff_Recv_isStraight.data(), - nMarker_Global, MPI_INT, MPI_PROD, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(Buff_Send_isStraight.data(), Buff_Recv_isStraight.data(), nMarker_Global, MPI_INT, MPI_PROD, + SU2_MPI::GetComm()); /*--- Print results on screen. ---*/ - if(rank == MASTER_NODE) { + if (rank == MASTER_NODE) { for (iMarker_Global = 0; iMarker_Global < nMarker_Global; iMarker_Global++) { if (config->GetMarker_CfgFile_KindBC(config->GetMarker_CfgFile_TagBound(iMarker_Global)) == SYMMETRY_PLANE || - config->GetMarker_CfgFile_KindBC(config->GetMarker_CfgFile_TagBound(iMarker_Global)) == EULER_WALL) { - + config->GetMarker_CfgFile_KindBC(config->GetMarker_CfgFile_TagBound(iMarker_Global)) == EULER_WALL) { cout << "Boundary marker " << config->GetMarker_CfgFile_TagBound(iMarker_Global) << " is"; - if(Buff_Recv_isStraight[iMarker_Global] == false) cout << " NOT"; - if(nDim == 2) cout << " a single straight." << endl; - if(nDim == 3) cout << " a single plane." << endl; - }//if sym or euler - }//for iMarker_Global - }//if rank==MASTER - }//if print_on_scren - + if (!static_cast(Buff_Recv_isStraight[iMarker_Global])) cout << " NOT"; + if (nDim == 2) cout << " a single straight." << endl; + if (nDim == 3) cout << " a single plane." << endl; + } // if sym or euler + } // for iMarker_Global + } // if rank==MASTER + } // if print_on_scren } - -void CGeometry::ComputeSurf_Curvature(CConfig *config) { - +void CGeometry::ComputeSurf_Curvature(CConfig* config) { unsigned short iMarker, iNeigh_Point, iDim, iNode, iNeighbor_Nodes, Neighbor_Node; - unsigned long Neighbor_Point, iVertex, iPoint, jPoint, iElem_Bound, iEdge, nLocalVertex, MaxLocalVertex , *Buffer_Send_nVertex, *Buffer_Receive_nVertex, TotalnPointDomain; + unsigned long Neighbor_Point, iVertex, iPoint, jPoint, iElem_Bound, iEdge, nLocalVertex, MaxLocalVertex, + *Buffer_Send_nVertex, *Buffer_Receive_nVertex, TotalnPointDomain; vector Point_NeighborList, Elem_NeighborList, Point_Triangle, Point_Edge, Point_Critical; - su2double U[3] = {0.0}, V[3] = {0.0}, W[3] = {0.0}, Length_U, Length_V, Length_W, CosValue, Angle_Value, *K, *Angle_Defect, *Area_Vertex, *Angle_Alpha, *Angle_Beta, **NormalMeanK, MeanK, GaussK, MaxPrinK, cot_alpha, cot_beta, delta, X1, X2, X3, Y1, Y2, Y3, radius, *Buffer_Send_Coord, *Buffer_Receive_Coord, *Coord, Dist, MinDist, MaxK, MinK, SigmaK; - bool *Check_Edge; + su2double U[3] = {0.0}, V[3] = {0.0}, W[3] = {0.0}, Length_U, Length_V, Length_W, CosValue, Angle_Value, *K, + *Angle_Defect, *Area_Vertex, *Angle_Alpha, *Angle_Beta, **NormalMeanK, MeanK, GaussK, MaxPrinK, cot_alpha, + cot_beta, delta, X1, X2, X3, Y1, Y2, Y3, radius, *Buffer_Send_Coord, *Buffer_Receive_Coord, *Coord, Dist, + MinDist, MaxK, MinK, SigmaK; + bool* Check_Edge; /*--- Allocate surface curvature ---*/ - K = new su2double [nPoint]; + K = new su2double[nPoint]; for (iPoint = 0; iPoint < nPoint; iPoint++) K[iPoint] = 0.0; if (nDim == 2) { - /*--- Loop over all the markers ---*/ for (iMarker = 0; iMarker < nMarker; iMarker++) { - if (config->GetMarker_All_KindBC(iMarker) != SEND_RECEIVE) { - /*--- Loop through all marker vertices again, this time also finding the neighbors of each node.---*/ for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - iPoint = vertex[iMarker][iVertex]->GetNode(); + iPoint = vertex[iMarker][iVertex]->GetNode(); if (nodes->GetDomain(iPoint)) { /*--- Loop through neighbors. In 2-D, there should be 2 nodes on either @@ -2730,11 +2613,9 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { if (nodes->GetPhysicalBoundary(Neighbor_Point)) { Point_Edge.push_back(Neighbor_Point); } - } if (Point_Edge.size() == 2) { - /*--- Compute the curvature using three points ---*/ X1 = nodes->GetCoord(iPoint, 0); X2 = nodes->GetCoord(Point_Edge[0], 0); @@ -2743,46 +2624,41 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { Y2 = nodes->GetCoord(Point_Edge[0], 1); Y3 = nodes->GetCoord(Point_Edge[1], 1); - radius = sqrt(((X2-X1)*(X2-X1) + (Y2-Y1)*(Y2-Y1))* - ((X2-X3)*(X2-X3) + (Y2-Y3)*(Y2-Y3))* - ((X3-X1)*(X3-X1) + (Y3-Y1)*(Y3-Y1)))/ - (2.0*fabs(X1*Y2+X2*Y3+X3*Y1-X1*Y3-X2*Y1-X3*Y2)+EPS); + radius = sqrt(((X2 - X1) * (X2 - X1) + (Y2 - Y1) * (Y2 - Y1)) * + ((X2 - X3) * (X2 - X3) + (Y2 - Y3) * (Y2 - Y3)) * + ((X3 - X1) * (X3 - X1) + (Y3 - Y1) * (Y3 - Y1))) / + (2.0 * fabs(X1 * Y2 + X2 * Y3 + X3 * Y1 - X1 * Y3 - X2 * Y1 - X3 * Y2) + EPS); - K[iPoint] = 1.0/radius; + K[iPoint] = 1.0 / radius; nodes->SetCurvature(iPoint, K[iPoint]); } - } - } - } - } } else { - - Angle_Defect = new su2double [nPoint]; - Area_Vertex = new su2double [nPoint]; + Angle_Defect = new su2double[nPoint]; + Area_Vertex = new su2double[nPoint]; for (iPoint = 0; iPoint < nPoint; iPoint++) { - Angle_Defect[iPoint] = 2*PI_NUMBER; + Angle_Defect[iPoint] = 2 * PI_NUMBER; Area_Vertex[iPoint] = 0.0; } - Angle_Alpha = new su2double [nEdge]; - Angle_Beta = new su2double [nEdge]; - Check_Edge = new bool [nEdge]; + Angle_Alpha = new su2double[nEdge]; + Angle_Beta = new su2double[nEdge]; + Check_Edge = new bool[nEdge]; for (iEdge = 0; iEdge < nEdge; iEdge++) { Angle_Alpha[iEdge] = 0.0; Angle_Beta[iEdge] = 0.0; Check_Edge[iEdge] = true; } - NormalMeanK = new su2double *[nPoint]; + NormalMeanK = new su2double*[nPoint]; for (iPoint = 0; iPoint < nPoint; iPoint++) { - NormalMeanK[iPoint] = new su2double [nDim]; + NormalMeanK[iPoint] = new su2double[nDim]; for (iDim = 0; iDim < nDim; iDim++) { NormalMeanK[iPoint][iDim] = 0.0; } @@ -2790,23 +2666,19 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { /*--- Loop over all the markers ---*/ for (iMarker = 0; iMarker < nMarker; iMarker++) { - if (config->GetMarker_All_KindBC(iMarker) != SEND_RECEIVE) { - /*--- Loop over all the boundary elements ---*/ for (iElem_Bound = 0; iElem_Bound < nElem_Bound[iMarker]; iElem_Bound++) { - /*--- Only triangles ---*/ if (bound[iMarker][iElem_Bound]->GetVTK_Type() == TRIANGLE) { - /*--- Loop over all the nodes of the boundary element ---*/ for (iNode = 0; iNode < bound[iMarker][iElem_Bound]->GetnNodes(); iNode++) { - iPoint = bound[iMarker][iElem_Bound]->GetNode(iNode); Point_Triangle.clear(); - for (iNeighbor_Nodes = 0; iNeighbor_Nodes < bound[iMarker][iElem_Bound]->GetnNeighbor_Nodes(iNode); iNeighbor_Nodes++) { + for (iNeighbor_Nodes = 0; iNeighbor_Nodes < bound[iMarker][iElem_Bound]->GetnNeighbor_Nodes(iNode); + iNeighbor_Nodes++) { Neighbor_Node = bound[iMarker][iElem_Bound]->GetNeighbor_Nodes(iNode, iNeighbor_Nodes); Neighbor_Point = bound[iMarker][iElem_Bound]->GetNode(Neighbor_Node); Point_Triangle.push_back(Neighbor_Point); @@ -2819,21 +2691,37 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { V[iDim] = nodes->GetCoord(Point_Triangle[1], iDim) - nodes->GetCoord(iPoint, iDim); } - W[0] = 0.5*(U[1]*V[2]-U[2]*V[1]); W[1] = -0.5*(U[0]*V[2]-U[2]*V[0]); W[2] = 0.5*(U[0]*V[1]-U[1]*V[0]); + W[0] = 0.5 * (U[1] * V[2] - U[2] * V[1]); + W[1] = -0.5 * (U[0] * V[2] - U[2] * V[0]); + W[2] = 0.5 * (U[0] * V[1] - U[1] * V[0]); - Length_U = 0.0; Length_V = 0.0; Length_W = 0.0; CosValue = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { Length_U += U[iDim]*U[iDim]; Length_V += V[iDim]*V[iDim]; Length_W += W[iDim]*W[iDim]; } - Length_U = sqrt(Length_U); Length_V = sqrt(Length_V); Length_W = sqrt(Length_W); - for (iDim = 0; iDim < nDim; iDim++) { U[iDim] /= Length_U; V[iDim] /= Length_V; CosValue += U[iDim]*V[iDim]; } + Length_U = 0.0; + Length_V = 0.0; + Length_W = 0.0; + CosValue = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + Length_U += U[iDim] * U[iDim]; + Length_V += V[iDim] * V[iDim]; + Length_W += W[iDim] * W[iDim]; + } + Length_U = sqrt(Length_U); + Length_V = sqrt(Length_V); + Length_W = sqrt(Length_W); + for (iDim = 0; iDim < nDim; iDim++) { + U[iDim] /= Length_U; + V[iDim] /= Length_V; + CosValue += U[iDim] * V[iDim]; + } if (CosValue >= 1.0) CosValue = 1.0; if (CosValue <= -1.0) CosValue = -1.0; Angle_Value = acos(CosValue); Area_Vertex[iPoint] += Length_W; Angle_Defect[iPoint] -= Angle_Value; - if (Angle_Alpha[iEdge] == 0.0) Angle_Alpha[iEdge] = Angle_Value; - else Angle_Beta[iEdge] = Angle_Value; - + if (Angle_Alpha[iEdge] == 0.0) + Angle_Alpha[iEdge] = Angle_Value; + else + Angle_Beta[iEdge] = Angle_Value; } } } @@ -2848,26 +2736,37 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { for (iNode = 0; iNode < bound[iMarker][iElem_Bound]->GetnNodes(); iNode++) { iPoint = bound[iMarker][iElem_Bound]->GetNode(iNode); - for (iNeighbor_Nodes = 0; iNeighbor_Nodes < bound[iMarker][iElem_Bound]->GetnNeighbor_Nodes(iNode); iNeighbor_Nodes++) { + for (iNeighbor_Nodes = 0; iNeighbor_Nodes < bound[iMarker][iElem_Bound]->GetnNeighbor_Nodes(iNode); + iNeighbor_Nodes++) { Neighbor_Node = bound[iMarker][iElem_Bound]->GetNeighbor_Nodes(iNode, iNeighbor_Nodes); jPoint = bound[iMarker][iElem_Bound]->GetNode(Neighbor_Node); iEdge = FindEdge(iPoint, jPoint); if (Check_Edge[iEdge]) { - Check_Edge[iEdge] = false; - if (tan(Angle_Alpha[iEdge]) != 0.0) cot_alpha = 1.0/tan(Angle_Alpha[iEdge]); else cot_alpha = 0.0; - if (tan(Angle_Beta[iEdge]) != 0.0) cot_beta = 1.0/tan(Angle_Beta[iEdge]); else cot_beta = 0.0; + if (tan(Angle_Alpha[iEdge]) != 0.0) + cot_alpha = 1.0 / tan(Angle_Alpha[iEdge]); + else + cot_alpha = 0.0; + if (tan(Angle_Beta[iEdge]) != 0.0) + cot_beta = 1.0 / tan(Angle_Beta[iEdge]); + else + cot_beta = 0.0; /*--- iPoint, and jPoint ---*/ for (iDim = 0; iDim < nDim; iDim++) { - if (Area_Vertex[iPoint] != 0.0) NormalMeanK[iPoint][iDim] += 3.0 * (cot_alpha + cot_beta) * (nodes->GetCoord(iPoint, iDim) - nodes->GetCoord(jPoint, iDim)) / Area_Vertex[iPoint]; - if (Area_Vertex[jPoint] != 0.0) NormalMeanK[jPoint][iDim] += 3.0 * (cot_alpha + cot_beta) * (nodes->GetCoord(jPoint, iDim) - nodes->GetCoord(iPoint, iDim)) / Area_Vertex[jPoint]; + if (Area_Vertex[iPoint] != 0.0) + NormalMeanK[iPoint][iDim] += 3.0 * (cot_alpha + cot_beta) * + (nodes->GetCoord(iPoint, iDim) - nodes->GetCoord(jPoint, iDim)) / + Area_Vertex[iPoint]; + if (Area_Vertex[jPoint] != 0.0) + NormalMeanK[jPoint][iDim] += 3.0 * (cot_alpha + cot_beta) * + (nodes->GetCoord(jPoint, iDim) - nodes->GetCoord(iPoint, iDim)) / + Area_Vertex[jPoint]; } } - } } } @@ -2881,19 +2780,19 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { for (iMarker = 0; iMarker < nMarker; iMarker++) { if (config->GetMarker_All_KindBC(iMarker) != SEND_RECEIVE) { for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - iPoint = vertex[iMarker][iVertex]->GetNode(); + iPoint = vertex[iMarker][iVertex]->GetNode(); if (nodes->GetDomain(iPoint)) { - - if (Area_Vertex[iPoint] != 0.0) GaussK = 3.0*Angle_Defect[iPoint]/Area_Vertex[iPoint]; - else GaussK = 0.0; + if (Area_Vertex[iPoint] != 0.0) + GaussK = 3.0 * Angle_Defect[iPoint] / Area_Vertex[iPoint]; + else + GaussK = 0.0; MeanK = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - MeanK += NormalMeanK[iPoint][iDim]*NormalMeanK[iPoint][iDim]; + for (iDim = 0; iDim < nDim; iDim++) MeanK += NormalMeanK[iPoint][iDim] * NormalMeanK[iPoint][iDim]; MeanK = sqrt(MeanK); - delta = max((MeanK*MeanK - GaussK), 0.0); + delta = max((MeanK * MeanK - GaussK), 0.0); MaxPrinK = MeanK + sqrt(delta); @@ -2901,31 +2800,31 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { K[iPoint] = MaxPrinK; nodes->SetCurvature(iPoint, K[iPoint]); } - } } } - delete [] Angle_Defect; - delete [] Area_Vertex; - delete [] Angle_Alpha; - delete [] Angle_Beta; - delete [] Check_Edge; - - for (iPoint = 0; iPoint < nPoint; iPoint++) - delete [] NormalMeanK[iPoint]; - delete [] NormalMeanK; + delete[] Angle_Defect; + delete[] Area_Vertex; + delete[] Angle_Alpha; + delete[] Angle_Beta; + delete[] Check_Edge; + for (iPoint = 0; iPoint < nPoint; iPoint++) delete[] NormalMeanK[iPoint]; + delete[] NormalMeanK; } /*--- Sharp edge detection is based in the statistical distribution of the curvature ---*/ - MaxK = K[0]; MinK = K[0]; MeanK = 0.0; TotalnPointDomain = 0; + MaxK = K[0]; + MinK = K[0]; + MeanK = 0.0; + TotalnPointDomain = 0; for (iMarker = 0; iMarker < nMarker; iMarker++) { if (config->GetMarker_All_KindBC(iMarker) != SEND_RECEIVE) { for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - iPoint = vertex[iMarker][iVertex]->GetNode(); + iPoint = vertex[iMarker][iVertex]->GetNode(); if (nodes->GetDomain(iPoint)) { MaxK = max(MaxK, fabs(K[iPoint])); MinK = min(MinK, fabs(K[iPoint])); @@ -2936,9 +2835,12 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { } } - su2double MyMeanK = MeanK; MeanK = 0.0; - su2double MyMaxK = MaxK; MaxK = 0.0; - unsigned long MynPointDomain = TotalnPointDomain; TotalnPointDomain = 0; + su2double MyMeanK = MeanK; + MeanK = 0.0; + su2double MyMaxK = MaxK; + MaxK = 0.0; + unsigned long MynPointDomain = TotalnPointDomain; + TotalnPointDomain = 0; SU2_MPI::Allreduce(&MyMeanK, &MeanK, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&MyMaxK, &MaxK, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&MynPointDomain, &TotalnPointDomain, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); @@ -2951,7 +2853,7 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { for (iMarker = 0; iMarker < nMarker; iMarker++) { if (config->GetMarker_All_KindBC(iMarker) != SEND_RECEIVE) { for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - iPoint = vertex[iMarker][iVertex]->GetNode(); + iPoint = vertex[iMarker][iVertex]->GetNode(); if (nodes->GetDomain(iPoint)) { SigmaK += (fabs(K[iPoint]) - MeanK) * (fabs(K[iPoint]) - MeanK); } @@ -2959,10 +2861,11 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { } } - su2double MySigmaK = SigmaK; SigmaK = 0.0; + su2double MySigmaK = SigmaK; + SigmaK = 0.0; SU2_MPI::Allreduce(&MySigmaK, &SigmaK, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SigmaK = sqrt(SigmaK/su2double(TotalnPointDomain)); + SigmaK = sqrt(SigmaK / su2double(TotalnPointDomain)); if (rank == MASTER_NODE) cout << "Max K: " << MaxK << ". Mean K: " << MeanK << ". Standard deviation K: " << SigmaK << "." << endl; @@ -2972,9 +2875,9 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { for (iMarker = 0; iMarker < nMarker; iMarker++) { if (config->GetMarker_All_KindBC(iMarker) != SEND_RECEIVE) { for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - iPoint = vertex[iMarker][iVertex]->GetNode(); + iPoint = vertex[iMarker][iVertex]->GetNode(); if (nodes->GetDomain(iPoint)) { - if (fabs(K[iPoint]) > MeanK + config->GetRefSharpEdges()*SigmaK) { + if (fabs(K[iPoint]) > MeanK + config->GetRefSharpEdges() * SigmaK) { Point_Critical.push_back(iPoint); } } @@ -2984,8 +2887,8 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { /*--- Variables and buffers needed for MPI ---*/ - Buffer_Send_nVertex = new unsigned long [1]; - Buffer_Receive_nVertex = new unsigned long [size]; + Buffer_Send_nVertex = new unsigned long[1]; + Buffer_Receive_nVertex = new unsigned long[size]; /*--- Count the total number of critical edge nodes. ---*/ @@ -2996,25 +2899,26 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { MaxLocalVertex = 0; SU2_MPI::Allreduce(&nLocalVertex, &MaxLocalVertex, 1, MPI_UNSIGNED_LONG, MPI_MAX, SU2_MPI::GetComm()); - SU2_MPI::Allgather(Buffer_Send_nVertex, 1, MPI_UNSIGNED_LONG, Buffer_Receive_nVertex, 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_nVertex, 1, MPI_UNSIGNED_LONG, Buffer_Receive_nVertex, 1, MPI_UNSIGNED_LONG, + SU2_MPI::GetComm()); /*--- Create and initialize to zero some buffers to hold the coordinates of the boundary nodes that are communicated from each partition (all-to-all). ---*/ - const unsigned long nBuffer = MaxLocalVertex*nDim; - Buffer_Send_Coord = new su2double [nBuffer] (); - Buffer_Receive_Coord = new su2double [size*nBuffer]; + const unsigned long nBuffer = MaxLocalVertex * nDim; + Buffer_Send_Coord = new su2double[nBuffer](); + Buffer_Receive_Coord = new su2double[size * nBuffer]; /*--- Retrieve and store the coordinates of the sharp edges boundary nodes on the local partition and broadcast them to all partitions. ---*/ for (iVertex = 0; iVertex < Point_Critical.size(); iVertex++) { iPoint = Point_Critical[iVertex]; - for (iDim = 0; iDim < nDim; iDim++) - Buffer_Send_Coord[iVertex*nDim+iDim] = nodes->GetCoord(iPoint, iDim); + for (iDim = 0; iDim < nDim; iDim++) Buffer_Send_Coord[iVertex * nDim + iDim] = nodes->GetCoord(iPoint, iDim); } - SU2_MPI::Allgather(Buffer_Send_Coord, nBuffer, MPI_DOUBLE, Buffer_Receive_Coord, nBuffer, MPI_DOUBLE, SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_Coord, nBuffer, MPI_DOUBLE, Buffer_Receive_Coord, nBuffer, MPI_DOUBLE, + SU2_MPI::GetComm()); /*--- Loop over all interior mesh nodes on the local partition and compute the distances to each of the no-slip boundary nodes in the entire mesh. @@ -3028,11 +2932,13 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { for (iVertex = 0; iVertex < Buffer_Receive_nVertex[iProcessor]; iVertex++) { Dist = 0.0; for (iDim = 0; iDim < nDim; iDim++) { - Dist += (Coord[iDim]-Buffer_Receive_Coord[(iProcessor*MaxLocalVertex+iVertex)*nDim+iDim])* - (Coord[iDim]-Buffer_Receive_Coord[(iProcessor*MaxLocalVertex+iVertex)*nDim+iDim]); + Dist += (Coord[iDim] - Buffer_Receive_Coord[(iProcessor * MaxLocalVertex + iVertex) * nDim + iDim]) * + (Coord[iDim] - Buffer_Receive_Coord[(iProcessor * MaxLocalVertex + iVertex) * nDim + iDim]); } - if (Dist!=0.0) Dist = sqrt(Dist); - else Dist = 0.0; + if (Dist != 0.0) + Dist = sqrt(Dist); + else + Dist = 0.0; if (Dist < MinDist) MinDist = Dist; } } @@ -3047,14 +2953,11 @@ void CGeometry::ComputeSurf_Curvature(CConfig *config) { delete[] Buffer_Receive_Coord; delete[] Buffer_Send_nVertex; delete[] Buffer_Receive_nVertex; - } -void CGeometry::FilterValuesAtElementCG(const vector &filter_radius, - const vector > &kernels, - const unsigned short search_limit, - su2double *values) const -{ +void CGeometry::FilterValuesAtElementCG(const vector& filter_radius, + const vector>& kernels, + const unsigned short search_limit, su2double* values) const { /*--- Apply a filter to "input_values". The filter is an averaging process over the neighbourhood of each element, which is a circle in 2D and a sphere in 3D of radius "filter_radius". The filter is characterized by its kernel, i.e. how the weights are computed. Multiple kernels @@ -3062,246 +2965,239 @@ void CGeometry::FilterValuesAtElementCG(const vector &filter_radius, output values of the previous filter. ---*/ /*--- Check if we need to do any work. ---*/ - if ( kernels.empty() ) return; - + if (kernels.empty()) return; /*--- FIRST: Gather the adjacency matrix, element centroids, volumes, and values on every processor, this is required because the filter reaches far into adjacent partitions. ---*/ /*--- Adjacency matrix ---*/ vector neighbour_start; - long *neighbour_idx = nullptr; - GetGlobalElementAdjacencyMatrix(neighbour_start,neighbour_idx); + long* neighbour_idx = nullptr; + GetGlobalElementAdjacencyMatrix(neighbour_start, neighbour_idx); /*--- Element centroids and volumes. ---*/ - su2double *cg_elem = new su2double [Global_nElemDomain*nDim], - *vol_elem = new su2double [Global_nElemDomain]; + auto *cg_elem = new su2double[Global_nElemDomain * nDim], *vol_elem = new su2double[Global_nElemDomain]; #ifdef HAVE_MPI /*--- Number of subdomain each point is part of. ---*/ vector halo_detect(Global_nElemDomain); #endif /*--- Inputs of a filter stage, like with CG and volumes, each processor needs to see everything. ---*/ - su2double *work_values = new su2double [Global_nElemDomain]; + auto* work_values = new su2double[Global_nElemDomain]; /*--- When gathering the neighborhood of each element we use a vector of booleans to indicate whether an element is already added to the list of neighbors (one vector per thread). ---*/ - vector > is_neighbor(omp_get_max_threads()); + vector> is_neighbor(omp_get_max_threads()); /*--- Begin OpenMP parallel section, count total number of searches for which the recursion limit is reached and the full neighborhood is not considered. ---*/ unsigned long limited_searches = 0; - SU2_OMP_PARALLEL_(reduction(+:limited_searches)) - { - - /*--- Initialize ---*/ - SU2_OMP_FOR_STAT(256) - for(auto iElem=0ul; iElemGetGlobalIndex(); - for(unsigned short iDim=0; iDimGetCG(iDim); - vol_elem[iElem_global] = elem[iElem]->GetVolume(); - } - END_SU2_OMP_FOR - -#ifdef HAVE_MPI - /*--- Account for the duplication introduced by the halo elements and the - reduction using MPI_SUM, which is required to maintain differentiabillity. ---*/ - SU2_OMP_FOR_STAT(256) - for(auto iElem=0ul; iElemGetGlobalIndex()] = 1; - END_SU2_OMP_FOR - - /*--- Share with all processors ---*/ - BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS - { - su2double* dbl_buffer = new su2double [Global_nElemDomain*nDim]; - SU2_MPI::Allreduce(cg_elem,dbl_buffer,Global_nElemDomain*nDim,MPI_DOUBLE,MPI_SUM,SU2_MPI::GetComm()); - swap(dbl_buffer, cg_elem); delete [] dbl_buffer; - - dbl_buffer = new su2double [Global_nElemDomain]; - SU2_MPI::Allreduce(vol_elem,dbl_buffer,Global_nElemDomain,MPI_DOUBLE,MPI_SUM,SU2_MPI::GetComm()); - swap(dbl_buffer, vol_elem); delete [] dbl_buffer; - - vector char_buffer(Global_nElemDomain); - MPI_Allreduce(halo_detect.data(),char_buffer.data(),Global_nElemDomain,MPI_CHAR,MPI_SUM,SU2_MPI::GetComm()); - halo_detect.swap(char_buffer); - } - END_SU2_OMP_SAFE_GLOBAL_ACCESS - - SU2_OMP_FOR_STAT(256) - for(auto iElem=0ul; iElemGetGlobalIndex()] = values[iElem]; + for (auto iElem = 0ul; iElem < nElem; ++iElem) { + auto iElem_global = elem[iElem]->GetGlobalIndex(); + for (unsigned short iDim = 0; iDim < nDim; ++iDim) cg_elem[nDim * iElem_global + iDim] = elem[iElem]->GetCG(iDim); + vol_elem[iElem_global] = elem[iElem]->GetVolume(); + } END_SU2_OMP_FOR #ifdef HAVE_MPI + /*--- Account for the duplication introduced by the halo elements and the + reduction using MPI_SUM, which is required to maintain differentiabillity. ---*/ + SU2_OMP_FOR_STAT(256) + for (auto iElem = 0ul; iElem < Global_nElemDomain; ++iElem) halo_detect[iElem] = 0; + END_SU2_OMP_FOR + + SU2_OMP_FOR_STAT(256) + for (auto iElem = 0ul; iElem < nElem; ++iElem) halo_detect[elem[iElem]->GetGlobalIndex()] = 1; + END_SU2_OMP_FOR + /*--- Share with all processors ---*/ - BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS - { - su2double *buffer = new su2double [Global_nElemDomain]; - SU2_MPI::Allreduce(work_values,buffer,Global_nElemDomain,MPI_DOUBLE,MPI_SUM,SU2_MPI::GetComm()); - swap(buffer, work_values); delete [] buffer; + BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS { + auto* dbl_buffer = new su2double[Global_nElemDomain * nDim]; + SU2_MPI::Allreduce(cg_elem, dbl_buffer, Global_nElemDomain * nDim, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + swap(dbl_buffer, cg_elem); + delete[] dbl_buffer; + + dbl_buffer = new su2double[Global_nElemDomain]; + SU2_MPI::Allreduce(vol_elem, dbl_buffer, Global_nElemDomain, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + swap(dbl_buffer, vol_elem); + delete[] dbl_buffer; + + vector char_buffer(Global_nElemDomain); + MPI_Allreduce(halo_detect.data(), char_buffer.data(), Global_nElemDomain, MPI_CHAR, MPI_SUM, SU2_MPI::GetComm()); + halo_detect.swap(char_buffer); } END_SU2_OMP_SAFE_GLOBAL_ACCESS - /*--- Account for duplication ---*/ SU2_OMP_FOR_STAT(256) - for(auto iElem=0ul; iElemGetGlobalIndex(); + is_neighbor[omp_get_thread_num()].resize(Global_nElemDomain, false); + + for (unsigned long iKernel = 0; iKernel < kernels.size(); ++iKernel) { + auto kernel_type = kernels[iKernel].first; + su2double kernel_param = kernels[iKernel].second; + su2double kernel_radius = filter_radius[iKernel]; + + /*--- Synchronize work values ---*/ + /*--- Initialize ---*/ + SU2_OMP_FOR_STAT(256) + for (auto iElem = 0ul; iElem < Global_nElemDomain; ++iElem) work_values[iElem] = 0.0; + END_SU2_OMP_FOR + + /*--- Populate ---*/ + SU2_OMP_FOR_STAT(256) + for (auto iElem = 0ul; iElem < nElem; ++iElem) work_values[elem[iElem]->GetGlobalIndex()] = values[iElem]; + END_SU2_OMP_FOR - /*--- Find the neighbours of iElem ---*/ - vector neighbours; - limited_searches += !GetRadialNeighbourhood(iElem_global, SU2_TYPE::GetValue(kernel_radius), - search_limit, neighbour_start, neighbour_idx, - cg_elem, neighbours, is_neighbor[thread]); - /*--- Apply the kernel ---*/ - su2double weight = 0.0, numerator = 0.0, denominator = 0.0; - - switch ( kernel_type ) { - /*--- distance-based kernels (weighted averages) ---*/ - case ENUM_FILTER_KERNEL::CONSTANT_WEIGHT: - case ENUM_FILTER_KERNEL::CONICAL_WEIGHT: - case ENUM_FILTER_KERNEL::GAUSSIAN_WEIGHT: - - for (auto idx : neighbours) - { - su2double distance = 0.0; - for (unsigned short iDim=0; iDimGetGlobalIndex(); + + /*--- Find the neighbours of iElem ---*/ + vector neighbours; + limited_searches += + !GetRadialNeighbourhood(iElem_global, SU2_TYPE::GetValue(kernel_radius), search_limit, neighbour_start, + neighbour_idx, cg_elem, neighbours, is_neighbor[thread]); + /*--- Apply the kernel ---*/ + su2double weight = 0.0, numerator = 0.0, denominator = 0.0; + + switch (kernel_type) { + /*--- distance-based kernels (weighted averages) ---*/ + case ENUM_FILTER_KERNEL::CONSTANT_WEIGHT: + case ENUM_FILTER_KERNEL::CONICAL_WEIGHT: + case ENUM_FILTER_KERNEL::GAUSSIAN_WEIGHT: + + for (auto idx : neighbours) { + su2double distance = 0.0; + for (unsigned short iDim = 0; iDim < nDim; ++iDim) + distance += pow(cg_elem[nDim * iElem_global + iDim] - cg_elem[nDim * idx + iDim], 2); + distance = sqrt(distance); + + switch (kernel_type) { + case ENUM_FILTER_KERNEL::CONSTANT_WEIGHT: + weight = 1.0; + break; + case ENUM_FILTER_KERNEL::CONICAL_WEIGHT: + weight = kernel_radius - distance; + break; + case ENUM_FILTER_KERNEL::GAUSSIAN_WEIGHT: + weight = exp(-0.5 * pow(distance / kernel_param, 2)); + break; + default: + break; + } + weight *= vol_elem[idx]; + numerator += weight * work_values[idx]; + denominator += weight; } - weight *= vol_elem[idx]; - numerator += weight*work_values[idx]; - denominator += weight; - } - values[iElem] = numerator/denominator; - break; + values[iElem] = numerator / denominator; + break; - /*--- morphology kernels (image processing) ---*/ - case ENUM_FILTER_KERNEL::DILATE_MORPH: - case ENUM_FILTER_KERNEL::ERODE_MORPH: + /*--- morphology kernels (image processing) ---*/ + case ENUM_FILTER_KERNEL::DILATE_MORPH: + case ENUM_FILTER_KERNEL::ERODE_MORPH: - for (auto idx : neighbours) - { - switch ( kernel_type ) { - case ENUM_FILTER_KERNEL::DILATE_MORPH: numerator += exp(kernel_param*work_values[idx]); break; - case ENUM_FILTER_KERNEL::ERODE_MORPH: numerator += exp(kernel_param*(1.0-work_values[idx])); break; - default: break; + for (auto idx : neighbours) { + switch (kernel_type) { + case ENUM_FILTER_KERNEL::DILATE_MORPH: + numerator += exp(kernel_param * work_values[idx]); + break; + case ENUM_FILTER_KERNEL::ERODE_MORPH: + numerator += exp(kernel_param * (1.0 - work_values[idx])); + break; + default: + break; + } + denominator += 1.0; } - denominator += 1.0; - } - values[iElem] = log(numerator/denominator)/kernel_param; - if ( kernel_type==ENUM_FILTER_KERNEL::ERODE_MORPH ) values[iElem] = 1.0-values[iElem]; - break; + values[iElem] = log(numerator / denominator) / kernel_param; + if (kernel_type == ENUM_FILTER_KERNEL::ERODE_MORPH) values[iElem] = 1.0 - values[iElem]; + break; - default: - SU2_MPI::Error("Unknown type of filter kernel",CURRENT_FUNCTION); + default: + SU2_MPI::Error("Unknown type of filter kernel", CURRENT_FUNCTION); + } } + END_SU2_OMP_FOR } - END_SU2_OMP_FOR - } - } END_SU2_OMP_PARALLEL limited_searches /= kernels.size(); unsigned long tmp = limited_searches; - SU2_MPI::Reduce(&tmp,&limited_searches,1,MPI_UNSIGNED_LONG,MPI_SUM,MASTER_NODE,SU2_MPI::GetComm()); + SU2_MPI::Reduce(&tmp, &limited_searches, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); - if (rank==MASTER_NODE && limited_searches>0) - cout << "Warning: The filter radius was limited for " << limited_searches - << " elements (" << limited_searches/(0.01*Global_nElemDomain) << "%).\n"; + if (rank == MASTER_NODE && limited_searches > 0) + cout << "Warning: The filter radius was limited for " << limited_searches << " elements (" + << limited_searches / (0.01 * Global_nElemDomain) << "%).\n"; - delete [] neighbour_idx; - delete [] cg_elem; - delete [] vol_elem; - delete [] work_values; + delete[] neighbour_idx; + delete[] cg_elem; + delete[] vol_elem; + delete[] work_values; } -void CGeometry::GetGlobalElementAdjacencyMatrix(vector &neighbour_start, - long *&neighbour_idx) const -{ - if ( neighbour_idx != nullptr ) - SU2_MPI::Error("neighbour_idx is expected to be NULL, stopping to avoid a potential memory leak",CURRENT_FUNCTION); +void CGeometry::GetGlobalElementAdjacencyMatrix(vector& neighbour_start, long*& neighbour_idx) const { + if (neighbour_idx != nullptr) + SU2_MPI::Error("neighbour_idx is expected to be NULL, stopping to avoid a potential memory leak", CURRENT_FUNCTION); /*--- Determine how much space we need for the adjacency matrix by counting the neighbours of each element, i.e. its number of faces---*/ - unsigned short *nFaces_elem = new unsigned short [Global_nElemDomain]; + auto* nFaces_elem = new unsigned short[Global_nElemDomain]; - SU2_OMP_PARALLEL - { + SU2_OMP_PARALLEL { SU2_OMP_FOR_STAT(256) - for(auto iElem=0ul; iElemGetGlobalIndex(); nFaces_elem[iElem_global] = elem[iElem]->GetnFaces(); } @@ -3311,47 +3207,45 @@ void CGeometry::GetGlobalElementAdjacencyMatrix(vector &neighbour #ifdef HAVE_MPI /*--- Share with all processors ---*/ { - unsigned short *buffer = new unsigned short [Global_nElemDomain]; - MPI_Allreduce(nFaces_elem,buffer,Global_nElemDomain,MPI_UNSIGNED_SHORT,MPI_MAX,SU2_MPI::GetComm()); + auto* buffer = new unsigned short[Global_nElemDomain]; + MPI_Allreduce(nFaces_elem, buffer, Global_nElemDomain, MPI_UNSIGNED_SHORT, MPI_MAX, SU2_MPI::GetComm()); /*--- swap pointers and delete old data to keep the same variable name after reduction ---*/ - swap(buffer, nFaces_elem); delete [] buffer; + swap(buffer, nFaces_elem); + delete[] buffer; } #endif /*--- Vector with the addresses of the start of the neighbours of a given element. This is generated by a cumulative sum of the neighbour count. ---*/ - neighbour_start.resize(Global_nElemDomain+1); + neighbour_start.resize(Global_nElemDomain + 1); neighbour_start[0] = 0; - for(auto iElem=0ul; iElemGetGlobalIndex(); auto start_pos = neighbour_start[iElem_global]; - for(unsigned short iFace=0; iFaceGetnFaces(); ++iFace) - { + for (unsigned short iFace = 0; iFace < elem[iElem]->GetnFaces(); ++iFace) { long neighbour = elem[iElem]->GetNeighbor_Elements(iFace); - if ( neighbour>=0 ) { - neighbour_idx[start_pos+iFace] = elem[neighbour]->GetGlobalIndex(); + if (neighbour >= 0) { + neighbour_idx[start_pos + iFace] = elem[neighbour]->GetGlobalIndex(); } } } @@ -3361,25 +3255,20 @@ void CGeometry::GetGlobalElementAdjacencyMatrix(vector &neighbour #ifdef HAVE_MPI /*--- Share with all processors ---*/ { - long *buffer = new long [matrix_size]; - MPI_Allreduce(neighbour_idx,buffer,matrix_size,MPI_LONG,MPI_MAX,SU2_MPI::GetComm()); - swap(buffer, neighbour_idx); delete [] buffer; + long* buffer = new long[matrix_size]; + MPI_Allreduce(neighbour_idx, buffer, matrix_size, MPI_LONG, MPI_MAX, SU2_MPI::GetComm()); + swap(buffer, neighbour_idx); + delete[] buffer; } #endif } -bool CGeometry::GetRadialNeighbourhood(const unsigned long iElem_global, - const passivedouble radius, - size_t search_limit, - const vector &neighbour_start, - const long *neighbour_idx, - const su2double *cg_elem, - vector &neighbours, - vector &is_neighbor) const -{ +bool CGeometry::GetRadialNeighbourhood(const unsigned long iElem_global, const passivedouble radius, + size_t search_limit, const vector& neighbour_start, + const long* neighbour_idx, const su2double* cg_elem, vector& neighbours, + vector& is_neighbor) const { /*--- Validate inputs if we are debugging. ---*/ - assert(neighbour_start.size() == Global_nElemDomain+1 && - neighbour_idx != nullptr && cg_elem != nullptr && + assert(neighbour_start.size() == Global_nElemDomain + 1 && neighbour_idx != nullptr && cg_elem != nullptr && is_neighbor.size() == Global_nElemDomain && "invalid inputs"); /*--- 0 search_limit means "unlimited" (it will probably @@ -3392,26 +3281,25 @@ bool CGeometry::GetRadialNeighbourhood(const unsigned long iElem_global, is_neighbor[iElem_global] = true; passivedouble X0[3] = {0.0, 0.0, 0.0}; - for (unsigned short iDim=0; iDim candidates; - for (auto it = neighbours.begin()+start; it!=neighbours.end(); ++it) { + for (auto it = neighbours.begin() + start; it != neighbours.end(); ++it) { /*--- scan row of the adjacency matrix of element *it ---*/ - for (auto i = neighbour_start[*it]; i < neighbour_start[(*it)+1]; ++i) { + for (auto i = neighbour_start[*it]; i < neighbour_start[(*it) + 1]; ++i) { auto idx = neighbour_idx[i]; - if (idx>=0) if (!is_neighbor[idx]) { - candidates.push_back(idx); - /*--- mark as neighbour for now to avoid duplicate candidates. ---*/ - is_neighbor[idx] = true; - } + if (idx >= 0) + if (!is_neighbor[idx]) { + candidates.push_back(idx); + /*--- mark as neighbour for now to avoid duplicate candidates. ---*/ + is_neighbor[idx] = true; + } } } /*--- update start position to fetch next degree candidates. ---*/ @@ -3419,100 +3307,108 @@ bool CGeometry::GetRadialNeighbourhood(const unsigned long iElem_global, /*--- Add candidates within "radius" of X0, if none qualifies we are "finished". ---*/ finished = true; - for (auto idx : candidates) - { + for (auto idx : candidates) { /*--- passivedouble as we only need to compare "distance". ---*/ passivedouble distance = 0.0; - for (unsigned short iDim=0; iDimGetVTK_Type()) { - case TRIANGLE: element = elements[0]; break; - case QUADRILATERAL: element = elements[1]; break; - case TETRAHEDRON: element = elements[0]; break; - case PYRAMID: element = elements[1]; break; - case PRISM: element = elements[2]; break; - case HEXAHEDRON: element = elements[3]; break; - default: - SU2_MPI::Error("Cannot compute the area/volume of a 1D element.",CURRENT_FUNCTION); + if (nDim == 2) { + elements[0] = new CTRIA1(); + elements[1] = new CQUAD4(); + } else { + elements[0] = new CTETRA1(); + elements[1] = new CPYRAM5(); + elements[2] = new CPRISM6(); + elements[3] = new CHEXA8(); } - /*--- Set the nodal coordinates of the element. ---*/ - for (unsigned short iNode=0; iNodeGetnNodes(); ++iNode) { - unsigned long node_idx = elem[iElem]->GetNode(iNode); - for (unsigned short iDim=0; iDimGetCoord(node_idx, iDim); - element->SetRef_Coord(iNode, iDim, coord); + + /*--- Compute and store the volume of each "elem". ---*/ + SU2_OMP_FOR_DYN(128) + for (unsigned long iElem = 0; iElem < nElem; ++iElem) { + /*--- Get the appropriate type of element. ---*/ + CElement* element = nullptr; + switch (elem[iElem]->GetVTK_Type()) { + case TRIANGLE: + element = elements[0]; + break; + case QUADRILATERAL: + element = elements[1]; + break; + case TETRAHEDRON: + element = elements[0]; + break; + case PYRAMID: + element = elements[1]; + break; + case PRISM: + element = elements[2]; + break; + case HEXAHEDRON: + element = elements[3]; + break; + default: + SU2_MPI::Error("Cannot compute the area/volume of a 1D element.", CURRENT_FUNCTION); + } + /*--- Set the nodal coordinates of the element. ---*/ + for (unsigned short iNode = 0; iNode < elem[iElem]->GetnNodes(); ++iNode) { + unsigned long node_idx = elem[iElem]->GetNode(iNode); + for (unsigned short iDim = 0; iDim < nDim; ++iDim) { + su2double coord = nodes->GetCoord(node_idx, iDim); + element->SetRef_Coord(iNode, iDim, coord); + } } + /*--- Compute ---*/ + if (nDim == 2) + elem[iElem]->SetVolume(element->ComputeArea()); + else + elem[iElem]->SetVolume(element->ComputeVolume()); } - /*--- Compute ---*/ - if(nDim==2) elem[iElem]->SetVolume(element->ComputeArea()); - else elem[iElem]->SetVolume(element->ComputeVolume()); - } - END_SU2_OMP_FOR - - delete elements[0]; - delete elements[1]; - if (nDim==3) { - delete elements[2]; - delete elements[3]; - } + END_SU2_OMP_FOR + delete elements[0]; + delete elements[1]; + if (nDim == 3) { + delete elements[2]; + delete elements[3]; + } } END_SU2_OMP_PARALLEL } -void CGeometry::SetRotationalVelocity(const CConfig *config, bool print) { - +void CGeometry::SetRotationalVelocity(const CConfig* config, bool print) { unsigned long iPoint; unsigned short iDim; - su2double GridVel[3] = {0.0,0.0,0.0}, Distance[3] = {0.0,0.0,0.0}, - Center[3] = {0.0,0.0,0.0}, Omega[3] = {0.0,0.0,0.0}, - xDot[3] = {0.0,0.0,0.0}; + su2double GridVel[3] = {0.0, 0.0, 0.0}, Distance[3] = {0.0, 0.0, 0.0}, Center[3] = {0.0, 0.0, 0.0}, + Omega[3] = {0.0, 0.0, 0.0}, xDot[3] = {0.0, 0.0, 0.0}; /*--- Center of rotation & angular velocity vector from config ---*/ for (iDim = 0; iDim < 3; iDim++) { Center[iDim] = config->GetMotion_Origin(iDim); - Omega[iDim] = config->GetRotation_Rate(iDim)/config->GetOmega_Ref(); - xDot[iDim] = config->GetTranslation_Rate(iDim)/config->GetVelocity_Ref(); + Omega[iDim] = config->GetRotation_Rate(iDim) / config->GetOmega_Ref(); + xDot[iDim] = config->GetTranslation_Rate(iDim) / config->GetVelocity_Ref(); } su2double L_Ref = config->GetLength_Ref(); @@ -3524,48 +3420,43 @@ void CGeometry::SetRotationalVelocity(const CConfig *config, bool print) { cout << ", " << Center[2] << " )\n"; cout << " Angular velocity about x, y, z axes: ( " << Omega[0] << ", "; cout << Omega[1] << ", " << Omega[2] << " ) rad/s" << endl; - cout << " Translational velocity in x, y, z direction: (" - << xDot[0] << ", " << xDot[1] << ", " << xDot[2] << ")." << endl; + cout << " Translational velocity in x, y, z direction: (" << xDot[0] << ", " << xDot[1] << ", " << xDot[2] << ")." + << endl; } /*--- Loop over all nodes and set the rotational and translational velocity ---*/ for (iPoint = 0; iPoint < nPoint; iPoint++) { - /*--- Get the coordinates of the current node ---*/ const su2double* Coord = nodes->GetCoord(iPoint); /*--- Calculate the non-dim. distance from the rotation center ---*/ - for (iDim = 0; iDim < nDim; iDim++) - Distance[iDim] = (Coord[iDim]-Center[iDim])/L_Ref; + for (iDim = 0; iDim < nDim; iDim++) Distance[iDim] = (Coord[iDim] - Center[iDim]) / L_Ref; /*--- Calculate the angular velocity as omega X r and add translational velocity ---*/ - GridVel[0] = Omega[1]*(Distance[2]) - Omega[2]*(Distance[1]) + xDot[0]; - GridVel[1] = Omega[2]*(Distance[0]) - Omega[0]*(Distance[2]) + xDot[1]; - GridVel[2] = Omega[0]*(Distance[1]) - Omega[1]*(Distance[0]) + xDot[2]; + GridVel[0] = Omega[1] * (Distance[2]) - Omega[2] * (Distance[1]) + xDot[0]; + GridVel[1] = Omega[2] * (Distance[0]) - Omega[0] * (Distance[2]) + xDot[1]; + GridVel[2] = Omega[0] * (Distance[1]) - Omega[1] * (Distance[0]) + xDot[2]; /*--- Store the grid velocity at this node ---*/ nodes->SetGridVel(iPoint, GridVel); - } - } -void CGeometry::SetShroudVelocity(const CConfig *config) { - +void CGeometry::SetShroudVelocity(const CConfig* config) { unsigned long iPoint, iVertex; unsigned short iMarker, iMarkerShroud; - su2double RotVel[3] = {0.0,0.0,0.0}; + su2double RotVel[3] = {0.0, 0.0, 0.0}; /*--- Loop over all vertex in the shroud marker and set the rotational velocity to 0.0 ---*/ - for (iMarker = 0; iMarker < nMarker; iMarker++){ - for(iMarkerShroud=0; iMarkerShroud < config->GetnMarker_Shroud(); iMarkerShroud++){ - if(config->GetMarker_Shroud(iMarkerShroud) == config->GetMarker_All_TagBound(iMarker)){ - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { + for (iMarker = 0; iMarker < nMarker; iMarker++) { + for (iMarkerShroud = 0; iMarkerShroud < config->GetnMarker_Shroud(); iMarkerShroud++) { + if (config->GetMarker_Shroud(iMarkerShroud) == config->GetMarker_All_TagBound(iMarker)) { + for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { iPoint = vertex[iMarker][iVertex]->GetNode(); nodes->SetGridVel(iPoint, RotVel); } @@ -3574,30 +3465,26 @@ void CGeometry::SetShroudVelocity(const CConfig *config) { } } -void CGeometry::SetTranslationalVelocity(const CConfig *config, bool print) { - - su2double xDot[3] = {0.0,0.0,0.0}; +void CGeometry::SetTranslationalVelocity(const CConfig* config, bool print) { + su2double xDot[3] = {0.0, 0.0, 0.0}; /*--- Get the translational velocity vector from config ---*/ for (unsigned short iDim = 0; iDim < nDim; iDim++) - xDot[iDim] = config->GetTranslation_Rate(iDim)/config->GetVelocity_Ref(); + xDot[iDim] = config->GetTranslation_Rate(iDim) / config->GetVelocity_Ref(); /*--- Print some information to the console ---*/ if (rank == MASTER_NODE && print) { - cout << " Non-dim. translational velocity: (" - << xDot[0] << ", " << xDot[1] << ", " << xDot[2] << ")." << endl; + cout << " Non-dim. translational velocity: (" << xDot[0] << ", " << xDot[1] << ", " << xDot[2] << ")." << endl; } /*--- Loop over all nodes and set the translational velocity ---*/ - for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) - nodes->SetGridVel(iPoint, xDot); + for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) nodes->SetGridVel(iPoint, xDot); } -void CGeometry::SetWallVelocity(const CConfig *config, bool print) { - +void CGeometry::SetWallVelocity(const CConfig* config, bool print) { const su2double L_Ref = config->GetLength_Ref(); const su2double Omega_Ref = config->GetOmega_Ref(); const su2double Vel_Ref = config->GetVelocity_Ref(); @@ -3616,7 +3503,7 @@ void CGeometry::SetWallVelocity(const CConfig *config, bool print) { su2double xDot[MAXNDIM], Center[MAXNDIM], Omega[MAXNDIM]; - for (auto iDim = 0u; iDim < MAXNDIM; iDim++){ + for (auto iDim = 0u; iDim < MAXNDIM; iDim++) { Center[iDim] = config->GetMarkerMotion_Origin(jMarker, iDim); Omega[iDim] = config->GetMarkerRotationRate(jMarker, iDim) / Omega_Ref; xDot[iDim] = config->GetMarkerTranslationRate(jMarker, iDim) / Vel_Ref; @@ -3625,10 +3512,13 @@ void CGeometry::SetWallVelocity(const CConfig *config, bool print) { if (rank == MASTER_NODE && print) { cout << " Storing grid velocity for marker: "; cout << Marker_Tag << ".\n"; - cout << " Translational velocity: (" << xDot[0]*config->GetVelocity_Ref() << ", " << xDot[1]*config->GetVelocity_Ref(); - cout << ", " << xDot[2]*config->GetVelocity_Ref(); - if (config->GetSystemMeasurements() == SI) cout << ") m/s.\n"; - else cout << ") ft/s.\n"; + cout << " Translational velocity: (" << xDot[0] * config->GetVelocity_Ref() << ", " + << xDot[1] * config->GetVelocity_Ref(); + cout << ", " << xDot[2] * config->GetVelocity_Ref(); + if (config->GetSystemMeasurements() == SI) + cout << ") m/s.\n"; + else + cout << ") ft/s.\n"; cout << " Angular velocity: (" << Omega[0] << ", " << Omega[1]; cout << ", " << Omega[2] << ") rad/s about origin: (" << Center[0]; cout << ", " << Center[1] << ", " << Center[2] << ")." << endl; @@ -3639,8 +3529,7 @@ void CGeometry::SetWallVelocity(const CConfig *config, bool print) { /*--- Calculate non-dim. position from rotation center ---*/ su2double r[MAXNDIM] = {0.0}; - for (auto iDim = 0u; iDim < nDim; iDim++) - r[iDim] = (nodes->GetCoord(iPoint,iDim) - Center[iDim]) / L_Ref; + for (auto iDim = 0u; iDim < nDim; iDim++) r[iDim] = (nodes->GetCoord(iPoint, iDim) - Center[iDim]) / L_Ref; /*--- Cross Product of angular velocity and distance from center to get the rotational velocity. Note that we are adding on the velocity @@ -3649,14 +3538,12 @@ void CGeometry::SetWallVelocity(const CConfig *config, bool print) { su2double GridVel[MAXNDIM]; GeometryToolbox::CrossProduct(Omega, r, GridVel); - for (auto iDim = 0u; iDim < nDim; iDim++) - nodes->SetGridVel(iPoint, iDim, xDot[iDim]+GridVel[iDim]); + for (auto iDim = 0u; iDim < nDim; iDim++) nodes->SetGridVel(iPoint, iDim, xDot[iDim] + GridVel[iDim]); } } } -void CGeometry::SetGridVelocity(const CConfig *config) { - +void CGeometry::SetGridVelocity(const CConfig* config) { /*--- Get timestep and whether to use 1st or 2nd order backward finite differences ---*/ bool FirstOrder = (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST); @@ -3667,41 +3554,35 @@ void CGeometry::SetGridVelocity(const CConfig *config) { /*--- Compute the velocity of each node in the volume mesh ---*/ for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) { - /*--- Coordinates of the current point at n+1, n, & n-1 time levels ---*/ - const su2double *Coord_nM1 = nodes->GetCoord_n1(iPoint); - const su2double *Coord_n = nodes->GetCoord_n(iPoint); - const su2double *Coord_nP1 = nodes->GetCoord(iPoint); + const su2double* Coord_nM1 = nodes->GetCoord_n1(iPoint); + const su2double* Coord_n = nodes->GetCoord_n(iPoint); + const su2double* Coord_nP1 = nodes->GetCoord(iPoint); /*--- Compute and store mesh velocity with 1st or 2nd-order approximation ---*/ for (unsigned short iDim = 0; iDim < nDim; iDim++) { - su2double GridVel = 0.0; - if (FirstOrder) - GridVel = (Coord_nP1[iDim] - Coord_n[iDim]) / TimeStep; + if (FirstOrder) GridVel = (Coord_nP1[iDim] - Coord_n[iDim]) / TimeStep; - if (SecondOrder) - GridVel = (1.5*Coord_nP1[iDim] - 2.0*Coord_n[iDim] + 0.5*Coord_nM1[iDim]) / TimeStep; + if (SecondOrder) GridVel = (1.5 * Coord_nP1[iDim] - 2.0 * Coord_n[iDim] + 0.5 * Coord_nM1[iDim]) / TimeStep; nodes->SetGridVel(iPoint, iDim, GridVel); } } - } -const CCompressedSparsePatternUL& CGeometry::GetSparsePattern(ConnectivityType type, unsigned long fillLvl) -{ +const CCompressedSparsePatternUL& CGeometry::GetSparsePattern(ConnectivityType type, unsigned long fillLvl) { bool fvm = (type == ConnectivityType::FiniteVolume); CCompressedSparsePatternUL* pattern = nullptr; if (fillLvl == 0) - pattern = fvm? &finiteVolumeCSRFill0 : &finiteElementCSRFill0; + pattern = fvm ? &finiteVolumeCSRFill0 : &finiteElementCSRFill0; else - pattern = fvm? &finiteVolumeCSRFillN : &finiteElementCSRFillN; + pattern = fvm ? &finiteVolumeCSRFillN : &finiteElementCSRFillN; if (pattern->empty()) { *pattern = buildCSRPattern(*this, type, fillLvl); @@ -3711,8 +3592,7 @@ const CCompressedSparsePatternUL& CGeometry::GetSparsePattern(ConnectivityType t return *pattern; } -const CEdgeToNonZeroMapUL& CGeometry::GetEdgeToSparsePatternMap(void) -{ +const CEdgeToNonZeroMapUL& CGeometry::GetEdgeToSparsePatternMap() { if (edgeToCSRMap.empty()) { if (finiteVolumeCSRFill0.empty()) { finiteVolumeCSRFill0 = buildCSRPattern(*this, ConnectivityType::FiniteVolume, 0ul); @@ -3722,39 +3602,36 @@ const CEdgeToNonZeroMapUL& CGeometry::GetEdgeToSparsePatternMap(void) return edgeToCSRMap; } -const su2vector& CGeometry::GetTransposeSparsePatternMap(ConnectivityType type) -{ +const su2vector& CGeometry::GetTransposeSparsePatternMap(ConnectivityType type) { /*--- Yes the const cast is weird but it is still better than repeating code. ---*/ auto& pattern = const_cast(GetSparsePattern(type)); pattern.buildTransposePtr(); return pattern.transposePtr(); } -const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficiency) -{ +const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficiency) { /*--- Check for dry run mode with dummy geometry. ---*/ - if (nEdge==0) return edgeColoring; + if (nEdge == 0) return edgeColoring; /*--- Build if required. ---*/ if (edgeColoring.empty()) { - /*--- When not using threading use the natural coloring to reduce overhead. ---*/ if (omp_get_max_threads() == 1) { SetNaturalEdgeColoring(); - if (efficiency != nullptr) *efficiency = 1.0; // by definition + if (efficiency != nullptr) *efficiency = 1.0; // by definition return edgeColoring; } /*--- Create a temporary sparse pattern from the edges. ---*/ - su2vector outerPtr(nEdge+1); - su2vector innerIdx(nEdge*2); + su2vector outerPtr(nEdge + 1); + su2vector innerIdx(nEdge * 2); for (unsigned long iEdge = 0; iEdge < nEdge; ++iEdge) { - outerPtr(iEdge) = 2*iEdge; - innerIdx(iEdge*2+0) = edges->GetNode(iEdge,0); - innerIdx(iEdge*2+1) = edges->GetNode(iEdge,1); + outerPtr(iEdge) = 2 * iEdge; + innerIdx(iEdge * 2 + 0) = edges->GetNode(iEdge, 0); + innerIdx(iEdge * 2 + 1) = edges->GetNode(iEdge, 1); } - outerPtr(nEdge) = 2*nEdge; + outerPtr(nEdge) = 2 * nEdge; CCompressedSparsePatternUL pattern(move(outerPtr), move(innerIdx)); @@ -3774,32 +3651,30 @@ const CCompressedSparsePatternUL& CGeometry::GetEdgeColoring(su2double* efficien return edgeColoring; } -void CGeometry::SetNaturalEdgeColoring() -{ +void CGeometry::SetNaturalEdgeColoring() { if (nEdge == 0) return; edgeColoring = createNaturalColoring(nEdge); /*--- In parallel, set the group size to nEdge to protect client code. ---*/ if (omp_get_max_threads() > 1) edgeColorGroupSize = nEdge; } -const CCompressedSparsePatternUL& CGeometry::GetElementColoring(su2double* efficiency) -{ +const CCompressedSparsePatternUL& CGeometry::GetElementColoring(su2double* efficiency) { /*--- Check for dry run mode with dummy geometry. ---*/ - if (nElem==0) return elemColoring; + if (nElem == 0) return elemColoring; /*--- Build if required. ---*/ if (elemColoring.empty()) { - /*--- When not using threading use the natural coloring. ---*/ if (omp_get_max_threads() == 1) { SetNaturalElementColoring(); - if (efficiency != nullptr) *efficiency = 1.0; // by definition + if (efficiency != nullptr) *efficiency = 1.0; // by definition return elemColoring; } /*--- Create a temporary sparse pattern from the elements. ---*/ - vector outerPtr(nElem+1); - vector innerIdx; innerIdx.reserve(nElem); + vector outerPtr(nElem + 1); + vector innerIdx; + innerIdx.reserve(nElem); for (unsigned long iElem = 0; iElem < nElem; ++iElem) { outerPtr[iElem] = innerIdx.size(); @@ -3826,8 +3701,7 @@ const CCompressedSparsePatternUL& CGeometry::GetElementColoring(su2double* effic return elemColoring; } -void CGeometry::SetNaturalElementColoring() -{ +void CGeometry::SetNaturalElementColoring() { if (nElem == 0) return; elemColoring = createNaturalColoring(nElem); /*--- In parallel, set the group size to nElem to protect client code. ---*/ @@ -3835,28 +3709,26 @@ void CGeometry::SetNaturalElementColoring() } void CGeometry::ColorMGLevels(unsigned short nMGLevels, const CGeometry* const* geometry) { - using tColor = uint8_t; constexpr auto nColor = numeric_limits::max(); - if (nMGLevels) CoarseGridColor_.resize(nPoint,nMGLevels) = 0; + if (nMGLevels) CoarseGridColor_.resize(nPoint, nMGLevels) = 0; for (auto iMesh = nMGLevels; iMesh >= 1; --iMesh) { /*--- Color the coarse points. ---*/ vector color; const auto& adjacency = geometry[iMesh]->nodes->GetPoints(); - if (colorSparsePattern(adjacency, 1, false, &color).empty()) - continue; + if (colorSparsePattern(adjacency, 1, false, &color).empty()) continue; /*--- Propagate colors to fine mesh. ---*/ for (auto step = 0u; step < iMesh; ++step) { - auto coarseMesh = geometry[iMesh-1-step]; + auto coarseMesh = geometry[iMesh - 1 - step]; if (step) for (auto iPoint = 0ul; iPoint < coarseMesh->GetnPoint(); ++iPoint) - CoarseGridColor_(iPoint,step) = CoarseGridColor_(coarseMesh->nodes->GetParent_CV(iPoint), step-1); + CoarseGridColor_(iPoint, step) = CoarseGridColor_(coarseMesh->nodes->GetParent_CV(iPoint), step - 1); else for (auto iPoint = 0ul; iPoint < coarseMesh->GetnPoint(); ++iPoint) - CoarseGridColor_(iPoint,step) = color[coarseMesh->nodes->GetParent_CV(iPoint)]; + CoarseGridColor_(iPoint, step) = color[coarseMesh->nodes->GetParent_CV(iPoint)]; } } } @@ -3992,8 +3864,8 @@ const CGeometry::CLineletInfo& CGeometry::GetLineletInfo(const CConfig* config) } } - const auto coloring = colorSparsePattern::max()>( - CCompressedSparsePatternUL(adjacency), 1, true); + const auto coloring = + colorSparsePattern::max()>(CCompressedSparsePatternUL(adjacency), 1, true); const auto nColors = coloring.getOuterSize(); /*--- Sort linelets by color. ---*/ @@ -4033,43 +3905,38 @@ const CGeometry::CLineletInfo& CGeometry::GetLineletInfo(const CConfig* config) return li; } -void CGeometry::ComputeWallDistance(const CConfig* const* config_container, CGeometry ****geometry_container){ - +void CGeometry::ComputeWallDistance(const CConfig* const* config_container, CGeometry**** geometry_container) { int nZone = config_container[ZONE_0]->GetnZone(); bool allEmpty = true; vector wallDistanceNeeded(nZone, false); - for (int iInst = 0; iInst < config_container[ZONE_0]->GetnTimeInstances(); iInst++){ - for (int iZone = 0; iZone < nZone; iZone++){ - + for (int iInst = 0; iInst < config_container[ZONE_0]->GetnTimeInstances(); iInst++) { + for (int iZone = 0; iZone < nZone; iZone++) { /*--- Check if a zone needs the wall distance and store a boolean ---*/ MAIN_SOLVER kindSolver = config_container[iZone]->GetKind_Solver(); - if (kindSolver == MAIN_SOLVER::RANS || - kindSolver == MAIN_SOLVER::INC_RANS || - kindSolver == MAIN_SOLVER::DISC_ADJ_RANS || - kindSolver == MAIN_SOLVER::DISC_ADJ_INC_RANS || - kindSolver == MAIN_SOLVER::FEM_LES || - kindSolver == MAIN_SOLVER::FEM_RANS){ + if (kindSolver == MAIN_SOLVER::RANS || kindSolver == MAIN_SOLVER::INC_RANS || + kindSolver == MAIN_SOLVER::DISC_ADJ_RANS || kindSolver == MAIN_SOLVER::DISC_ADJ_INC_RANS || + kindSolver == MAIN_SOLVER::FEM_LES || kindSolver == MAIN_SOLVER::FEM_RANS) { wallDistanceNeeded[iZone] = true; } /*--- Set the wall distances in all zones to the numerical limit. - * This is necessary, because before a computed distance is set, it will be checked - * whether the new distance is smaller than the currently stored one. ---*/ - CGeometry *geometry = geometry_container[iZone][iInst][MESH_0]; - if (wallDistanceNeeded[iZone]) - geometry->SetWallDistance(numeric_limits::max()); + * This is necessary, because before a computed distance is set, it will be checked + * whether the new distance is smaller than the currently stored one. ---*/ + CGeometry* geometry = geometry_container[iZone][iInst][MESH_0]; + if (wallDistanceNeeded[iZone]) geometry->SetWallDistance(numeric_limits::max()); } /*--- Loop over all zones and compute the ADT based on the viscous walls in that zone ---*/ - for (int iZone = 0; iZone < nZone; iZone++){ - unique_ptr WallADT = geometry_container[iZone][iInst][MESH_0]->ComputeViscousWallADT(config_container[iZone]); - if (WallADT && !WallADT->IsEmpty()){ + for (int iZone = 0; iZone < nZone; iZone++) { + unique_ptr WallADT = + geometry_container[iZone][iInst][MESH_0]->ComputeViscousWallADT(config_container[iZone]); + if (WallADT && !WallADT->IsEmpty()) { allEmpty = false; /*--- Inner loop over all zones to update the wall distances. - * It might happen that there is a closer viscous wall in zone iZone for points in zone jZone. ---*/ - for (int jZone = 0; jZone < nZone; jZone++){ + * It might happen that there is a closer viscous wall in zone iZone for points in zone jZone. ---*/ + for (int jZone = 0; jZone < nZone; jZone++) { if (wallDistanceNeeded[jZone]) geometry_container[jZone][iInst][MESH_0]->SetWallDistance(WallADT.get(), config_container[jZone], iZone); } @@ -4077,31 +3944,30 @@ void CGeometry::ComputeWallDistance(const CConfig* const* config_container, CGeo } /*--- If there are no viscous walls in the entire domain, set distances to zero ---*/ - if (allEmpty){ - for (int iZone = 0; iZone < nZone; iZone++){ - CGeometry *geometry = geometry_container[iZone][iInst][MESH_0]; + if (allEmpty) { + for (int iZone = 0; iZone < nZone; iZone++) { + CGeometry* geometry = geometry_container[iZone][iInst][MESH_0]; geometry->SetWallDistance(0.0); } } /*--- Otherwise, set wall roughnesses. ---*/ - if(!allEmpty){ + if (!allEmpty) { /*--- Store all wall roughnesses in a common data structure. ---*/ // [iZone][iMarker] -> roughness, for this rank - auto roughness_f = - make_pair( nZone, [config_container,geometry_container,iInst](unsigned long iZone){ - const CConfig* config = config_container[iZone]; - const auto nMarker = geometry_container[iZone][iInst][MESH_0]->GetnMarker(); - - return make_pair( nMarker, [config](unsigned long iMarker){ - return config->GetWallRoughnessProperties(config->GetMarker_All_TagBound(iMarker)).second; - }); + auto roughness_f = make_pair(nZone, [config_container, geometry_container, iInst](unsigned long iZone) { + const CConfig* config = config_container[iZone]; + const auto nMarker = geometry_container[iZone][iInst][MESH_0]->GetnMarker(); + + return make_pair(nMarker, [config](unsigned long iMarker) { + return config->GetWallRoughnessProperties(config->GetMarker_All_TagBound(iMarker)).second; }); + }); NdFlattener<2> roughness_local(roughness_f); // [rank][iZone][iMarker] -> roughness NdFlattener<3> roughness_global(Nd_MPI_Environment(), roughness_local); // use it to update roughnesses - for(int jZone=0; jZoneGetnRoughWall()>0){ + for (int jZone = 0; jZone < nZone; jZone++) { + if (wallDistanceNeeded[jZone] && config_container[jZone]->GetnRoughWall() > 0) { geometry_container[jZone][iInst][MESH_0]->nodes->SetWallRoughness(roughness_global); } } diff --git a/Common/src/geometry/CMultiGridGeometry.cpp b/Common/src/geometry/CMultiGridGeometry.cpp index f28716fb795..37b1bd175ba 100644 --- a/Common/src/geometry/CMultiGridGeometry.cpp +++ b/Common/src/geometry/CMultiGridGeometry.cpp @@ -2,7 +2,7 @@ * \file CMultiGridGeometry.cpp * \brief Implementation of the multigrid geometry class. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -30,9 +30,8 @@ #include "../../include/toolboxes/printing_toolbox.hpp" #include "../../../Common/include/toolboxes/geometry_toolbox.hpp" -CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, unsigned short iMesh) : CGeometry() { - - nDim = fine_grid->GetnDim(); // Write the number of dimensions of the coarse grid. +CMultiGridGeometry::CMultiGridGeometry(CGeometry* fine_grid, CConfig* config, unsigned short iMesh) : CGeometry() { + nDim = fine_grid->GetnDim(); // Write the number of dimensions of the coarse grid. /*--- Create a queue system to do the agglomeration 1st) More than two markers ---> Vertices (never agglomerate) @@ -45,8 +44,7 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un For other levels this information is propagated down during their construction. ---*/ if (iMesh == MESH_1) { - - for (auto iPoint = 0ul; iPoint < fine_grid->GetnPoint(); iPoint ++) + for (auto iPoint = 0ul; iPoint < fine_grid->GetnPoint(); iPoint++) fine_grid->nodes->SetAgglomerate_Indirect(iPoint, false); for (auto iElem = 0ul; iElem < fine_grid->GetnElem(); iElem++) { @@ -58,7 +56,6 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un } } } - } /*--- Create the coarse grid structure using as baseline the fine grid ---*/ @@ -73,7 +70,6 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un /*--- The first step is the boundary agglomeration. ---*/ for (auto iMarker = 0u; iMarker < fine_grid->GetnMarker(); iMarker++) { - for (auto iVertex = 0ul; iVertex < fine_grid->GetnVertex(iMarker); iVertex++) { const auto iPoint = fine_grid->vertex[iMarker][iVertex]->GetNode(); @@ -81,10 +77,8 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un belongs to this physical domain, and it meets the geometrical criteria, the agglomeration is studied. ---*/ - if ((fine_grid->nodes->GetAgglomerate(iPoint) == false) && - (fine_grid->nodes->GetDomain(iPoint)) && + if ((!fine_grid->nodes->GetAgglomerate(iPoint)) && (fine_grid->nodes->GetDomain(iPoint)) && (GeometricalCheck(iPoint, fine_grid, config))) { - unsigned short nChildren = 1; /*--- We set an index for the parent control volume, this @@ -103,7 +97,7 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un /*--- For a particular point in the fine grid we save all the markers that are in that point ---*/ - for (auto jMarker = 0u; jMarker < fine_grid->GetnMarker() && counter < 3; jMarker ++) { + for (auto jMarker = 0u; jMarker < fine_grid->GetnMarker() && counter < 3; jMarker++) { if (fine_grid->nodes->GetVertex(iPoint, jMarker) != -1) { copy_marker[counter] = jMarker; counter++; @@ -120,13 +114,8 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un markers is SEND_RECEIVE ---*/ if (counter == 2) { - if ((config->GetMarker_All_KindBC(copy_marker[0]) == SEND_RECEIVE) || - (config->GetMarker_All_KindBC(copy_marker[1]) == SEND_RECEIVE)) { - agglomerate_seed = true; - } - else { - agglomerate_seed = false; - } + agglomerate_seed = (config->GetMarker_All_KindBC(copy_marker[0]) == SEND_RECEIVE) || + (config->GetMarker_All_KindBC(copy_marker[1]) == SEND_RECEIVE); } /*--- If there are more than 2 markers, the aglomeration will be discarted ---*/ @@ -136,15 +125,12 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un /*--- If the seed can be agglomerated, we try to agglomerate more points ---*/ if (agglomerate_seed) { - /*--- Now we do a sweep over all the nodes that surround the seed point ---*/ for (auto CVPoint : fine_grid->nodes->GetPoints(iPoint)) { - /*--- The new point can be agglomerated ---*/ if (SetBoundAgglomeration(CVPoint, marker_seed, fine_grid, config)) { - /*--- We set the value of the parent ---*/ fine_grid->nodes->SetParent_CV(CVPoint, Index_CoarseCV); @@ -154,7 +140,6 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un nodes->SetChildren_CV(Index_CoarseCV, nChildren, CVPoint); nChildren++; } - } Suitable_Indirect_Neighbors.clear(); @@ -165,11 +150,9 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un /*--- Now we do a sweep over all the indirect nodes that can be added ---*/ for (auto CVPoint : Suitable_Indirect_Neighbors) { - /*--- The new point can be agglomerated ---*/ if (SetBoundAgglomeration(CVPoint, marker_seed, fine_grid, config)) { - /*--- We set the value of the parent ---*/ fine_grid->nodes->SetParent_CV(CVPoint, Index_CoarseCV); @@ -186,7 +169,6 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un nChildren++; } } - } /*--- Update the number of children of the coarse control volume. ---*/ @@ -204,8 +186,7 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un for (auto iVertex = 0ul; iVertex < fine_grid->GetnVertex(iMarker); iVertex++) { const auto iPoint = fine_grid->vertex[iMarker][iVertex]->GetNode(); - if ((fine_grid->nodes->GetAgglomerate(iPoint) == false) && - (fine_grid->nodes->GetDomain(iPoint))) { + if ((!fine_grid->nodes->GetAgglomerate(iPoint)) && (fine_grid->nodes->GetDomain(iPoint))) { fine_grid->nodes->SetParent_CV(iPoint, Index_CoarseCV); nodes->SetChildren_CV(Index_CoarseCV, 0, iPoint); nodes->SetnChildren_CV(Index_CoarseCV, 1); @@ -216,14 +197,11 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un /*--- Update the queue with the results from the boundary agglomeration ---*/ - for (auto iPoint = 0ul; iPoint < fine_grid->GetnPoint(); iPoint ++) { - + for (auto iPoint = 0ul; iPoint < fine_grid->GetnPoint(); iPoint++) { if (fine_grid->nodes->GetAgglomerate(iPoint)) { - MGQueue_InnerCV.RemoveCV(iPoint); - } - else { + } else { /*--- Count the number of agglomerated neighbors, and modify the queue, Points with more agglomerated neighbors are processed first. ---*/ @@ -239,17 +217,14 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un auto iteration = 0ul; while (!MGQueue_InnerCV.EmptyQueue() && (iteration < fine_grid->GetnPoint())) { - const auto iPoint = MGQueue_InnerCV.NextCV(); iteration++; /*--- If the element has not being previously agglomerated, belongs to the physical domain, and satisfies several geometrical criteria then the seed CV is accepted for agglomeration. ---*/ - if ((fine_grid->nodes->GetAgglomerate(iPoint) == false) && - (fine_grid->nodes->GetDomain(iPoint)) && + if ((!fine_grid->nodes->GetAgglomerate(iPoint)) && (fine_grid->nodes->GetDomain(iPoint)) && (GeometricalCheck(iPoint, fine_grid, config))) { - unsigned short nChildren = 1; /*--- We set an index for the parent control volume ---*/ @@ -268,13 +243,10 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un /*--- Now we do a sweep over all the nodes that surround the seed point ---*/ for (auto CVPoint : fine_grid->nodes->GetPoints(iPoint)) { - /*--- Determine if the CVPoint can be agglomerated ---*/ - if ((fine_grid->nodes->GetAgglomerate(CVPoint) == false) && - (fine_grid->nodes->GetDomain(CVPoint)) && + if ((!fine_grid->nodes->GetAgglomerate(CVPoint)) && (fine_grid->nodes->GetDomain(CVPoint)) && (GeometricalCheck(CVPoint, fine_grid, config))) { - /*--- We set the value of the parent ---*/ fine_grid->nodes->SetParent_CV(CVPoint, Index_CoarseCV); @@ -288,9 +260,7 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un increase the priority of its neighbors) ---*/ MGQueue_InnerCV.Update(CVPoint, fine_grid); - } - } /*--- Identify the indirect neighbors ---*/ @@ -302,20 +272,16 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un /*--- Now we do a sweep over all the indirect nodes that can be added ---*/ for (auto CVPoint : Suitable_Indirect_Neighbors) { - /*--- The new point can be agglomerated ---*/ - if ((fine_grid->nodes->GetAgglomerate(CVPoint) == false) && - (fine_grid->nodes->GetDomain(CVPoint))) { - + if ((!fine_grid->nodes->GetAgglomerate(CVPoint)) && (fine_grid->nodes->GetDomain(CVPoint))) { /*--- We set the value of the parent ---*/ fine_grid->nodes->SetParent_CV(CVPoint, Index_CoarseCV); /*--- We set the indirect agglomeration information ---*/ - if (fine_grid->nodes->GetAgglomerate_Indirect(CVPoint)) - nodes->SetAgglomerate_Indirect(Index_CoarseCV, true); + if (fine_grid->nodes->GetAgglomerate_Indirect(CVPoint)) nodes->SetAgglomerate_Indirect(Index_CoarseCV, true); /*--- We set the value of the child ---*/ @@ -326,7 +292,6 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un increase the priority of the neighbors) ---*/ MGQueue_InnerCV.Update(CVPoint, fine_grid); - } } @@ -334,26 +299,20 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un nodes->SetnChildren_CV(Index_CoarseCV, nChildren); Index_CoarseCV++; - } - else { - + } else { /*--- The seed point can not be agglomerated because of size, domain, streching, etc. move the point to the lowest priority ---*/ MGQueue_InnerCV.MoveCV(iPoint, -1); } - } /*--- Convert any point that was not agglomerated into a coarse point. ---*/ for (auto iPoint = 0ul; iPoint < fine_grid->GetnPoint(); iPoint++) { - if ((fine_grid->nodes->GetAgglomerate(iPoint) == false) && - (fine_grid->nodes->GetDomain(iPoint))) { - + if ((!fine_grid->nodes->GetAgglomerate(iPoint)) && (fine_grid->nodes->GetDomain(iPoint))) { fine_grid->nodes->SetParent_CV(iPoint, Index_CoarseCV); - if (fine_grid->nodes->GetAgglomerate_Indirect(iPoint)) - nodes->SetAgglomerate_Indirect(Index_CoarseCV, true); + if (fine_grid->nodes->GetAgglomerate_Indirect(iPoint)) nodes->SetAgglomerate_Indirect(Index_CoarseCV, true); nodes->SetChildren_CV(Index_CoarseCV, 0, iPoint); nodes->SetnChildren_CV(Index_CoarseCV, 1); Index_CoarseCV++; @@ -369,9 +328,7 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un SetPoint_Connectivity(fine_grid); for (auto iCoarsePoint = 0ul; iCoarsePoint < nPointDomain; iCoarsePoint++) { - if (nodes->GetnPoint(iCoarsePoint) == 1) { - /*--- Find the neighbor of the isolated point. This neighbor is the right control volume ---*/ const auto iCoarsePoint_Complete = nodes->GetPoint(iCoarsePoint, 0); @@ -395,7 +352,6 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un nodes->SetnChildren_CV(iCoarsePoint_Complete, nChildren); nodes->SetnChildren_CV(iCoarsePoint, 0); } - } /*--- Reset the neighbor information. ---*/ @@ -409,10 +365,7 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un they are domain points. ---*/ for (auto iMarker = 0u; iMarker < config->GetnMarker_All(); iMarker++) { - - if ((config->GetMarker_All_KindBC(iMarker) == SEND_RECEIVE) && - (config->GetMarker_All_SendRecv(iMarker) > 0)) { - + if ((config->GetMarker_All_KindBC(iMarker) == SEND_RECEIVE) && (config->GetMarker_All_SendRecv(iMarker) > 0)) { const auto MarkerS = iMarker; const auto MarkerR = iMarker + 1; @@ -444,8 +397,8 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un Buffer_Receive_Children.data(), nVertexR, MPI_UNSIGNED_LONG, receive_from, 0, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); SU2_MPI::Sendrecv(Buffer_Send_Parent.data(), nVertexS, MPI_UNSIGNED_LONG, send_to, 1, - Buffer_Receive_Parent.data(), nVertexR, MPI_UNSIGNED_LONG, receive_from, 1, - SU2_MPI::GetComm(), MPI_STATUS_IGNORE); + Buffer_Receive_Parent.data(), nVertexR, MPI_UNSIGNED_LONG, receive_from, 1, SU2_MPI::GetComm(), + MPI_STATUS_IGNORE); /*--- Create a list of the parent nodes without duplicates. ---*/ @@ -462,7 +415,6 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un vector Children_Local(nVertexR); for (auto iVertex = 0ul; iVertex < nVertexR; iVertex++) { - /*--- We use the same sorting as in the donor domain, i.e. the local parents are numbered according to their order in the remote rank. ---*/ @@ -493,11 +445,9 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un nodes->SetnChildren_CV(iPoint_Coarse, nChildren_MPI[iPoint_Coarse]); nodes->SetDomain(iPoint_Coarse, false); } - } - } -#endif // HAVE_MPI +#endif // HAVE_MPI /*--- Update the number of points after the MPI agglomeration ---*/ @@ -516,17 +466,15 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un if (iMesh != MESH_0) { const su2double factor = 1.5; const su2double Coeff = pow(su2double(Global_nPointFine) / Global_nPointCoarse, 1.0 / nDim); - const su2double CFL = factor * config->GetCFL(iMesh-1) / Coeff; + const su2double CFL = factor * config->GetCFL(iMesh - 1) / Coeff; config->SetCFL(iMesh, CFL); } const su2double ratio = su2double(Global_nPointFine) / su2double(Global_nPointCoarse); - if (((nDim == 2) && (ratio < 2.5)) || - ((nDim == 3) && (ratio < 2.5))) { - config->SetMGLevels(iMesh-1); - } - else if (rank == MASTER_NODE) { + if (((nDim == 2) && (ratio < 2.5)) || ((nDim == 3) && (ratio < 2.5))) { + config->SetMGLevels(iMesh - 1); + } else if (rank == MASTER_NODE) { PrintingToolbox::CTablePrinter MGTable(&std::cout); MGTable.AddColumn("MG Level", 10); MGTable.AddColumn("CVs", 10); @@ -534,37 +482,33 @@ CMultiGridGeometry::CMultiGridGeometry(CGeometry *fine_grid, CConfig *config, un MGTable.AddColumn("CFL", 10); MGTable.SetAlign(PrintingToolbox::CTablePrinter::RIGHT); - if (iMesh == MESH_1){ + if (iMesh == MESH_1) { MGTable.PrintHeader(); - MGTable << iMesh - 1 << Global_nPointFine << "1/1.00" << config->GetCFL(iMesh -1); + MGTable << iMesh - 1 << Global_nPointFine << "1/1.00" << config->GetCFL(iMesh - 1); } stringstream ss; ss << "1/" << std::setprecision(3) << ratio; MGTable << iMesh << Global_nPointCoarse << ss.str() << config->GetCFL(iMesh); - if (iMesh == config->GetnMGLevels()){ + if (iMesh == config->GetnMGLevels()) { MGTable.PrintFooter(); } } edgeColorGroupSize = config->GetEdgeColoringGroupSize(); - } -bool CMultiGridGeometry::SetBoundAgglomeration(unsigned long CVPoint, short marker_seed, - const CGeometry *fine_grid, const CConfig *config) const { +bool CMultiGridGeometry::SetBoundAgglomeration(unsigned long CVPoint, short marker_seed, const CGeometry* fine_grid, + const CConfig* config) const { bool agglomerate_CV = false; /*--- Basic condition, the point has not being previously agglomerated, it belongs to the domain, and has passed some basic geometrical checks. ---*/ - if ((fine_grid->nodes->GetAgglomerate(CVPoint) == false) && - (fine_grid->nodes->GetDomain(CVPoint)) && + if ((!fine_grid->nodes->GetAgglomerate(CVPoint)) && (fine_grid->nodes->GetDomain(CVPoint)) && (GeometricalCheck(CVPoint, fine_grid, config))) { - /*--- If the point belongs to a boundary, its type must be compatible with the seed marker. ---*/ if (fine_grid->nodes->GetBoundary(CVPoint)) { - /*--- Identify the markers of the vertex that we want to agglomerate ---*/ int counter = 0; @@ -582,58 +526,51 @@ bool CMultiGridGeometry::SetBoundAgglomeration(unsigned long CVPoint, short mark /*--- Only one marker in the vertex that is going to be aglomerated ---*/ if (counter == 1) { - /*--- We agglomerate if there is only a marker and is the same marker as the seed marker ---*/ - if (copy_marker[0] == marker_seed) - agglomerate_CV = true; + if (copy_marker[0] == marker_seed) agglomerate_CV = true; /*--- If there is only one marker, but the marker is the SEND_RECEIVE ---*/ - if (config->GetMarker_All_KindBC(copy_marker[0]) == SEND_RECEIVE) - agglomerate_CV = true; - + if (config->GetMarker_All_KindBC(copy_marker[0]) == SEND_RECEIVE) agglomerate_CV = true; } /*--- If there are two markers in the vertex that is going to be aglomerated ---*/ if (counter == 2) { - /*--- First we verify that the seed is a physical boundary ---*/ if (config->GetMarker_All_KindBC(marker_seed) != SEND_RECEIVE) { - /*--- Then we check that one of the marker is equal to the seed marker, and the other is send/receive ---*/ if (((copy_marker[0] == marker_seed) && (config->GetMarker_All_KindBC(copy_marker[1]) == SEND_RECEIVE)) || ((config->GetMarker_All_KindBC(copy_marker[0]) == SEND_RECEIVE) && (copy_marker[1] == marker_seed))) agglomerate_CV = true; } - } } /*--- If the element belongs to the domain, it is allways aglomerated. ---*/ - else { agglomerate_CV = true; } - + else { + agglomerate_CV = true; + } } return agglomerate_CV; } - -bool CMultiGridGeometry::GeometricalCheck(unsigned long iPoint, const CGeometry *fine_grid, const CConfig *config) const { - +bool CMultiGridGeometry::GeometricalCheck(unsigned long iPoint, const CGeometry* fine_grid, + const CConfig* config) const { su2double max_dimension = 1.2; /*--- Evaluate the total size of the element ---*/ bool Volume = true; - su2double ratio = pow(fine_grid->nodes->GetVolume(iPoint), 1.0/su2double(nDim))*max_dimension; - su2double limit = pow(config->GetDomainVolume(), 1.0/su2double(nDim)); - if ( ratio > limit ) Volume = false; + su2double ratio = pow(fine_grid->nodes->GetVolume(iPoint), 1.0 / su2double(nDim)) * max_dimension; + su2double limit = pow(config->GetDomainVolume(), 1.0 / su2double(nDim)); + if (ratio > limit) Volume = false; /*--- Evaluate the stretching of the element ---*/ @@ -656,27 +593,22 @@ bool CMultiGridGeometry::GeometricalCheck(unsigned long iPoint, const CGeometry if ( max_dist/min_dist > 100.0 ) Stretching = false;*/ return (Stretching && Volume); - } void CMultiGridGeometry::SetSuitableNeighbors(vector& Suitable_Indirect_Neighbors, unsigned long iPoint, - unsigned long Index_CoarseCV, const CGeometry *fine_grid) const { - + unsigned long Index_CoarseCV, const CGeometry* fine_grid) const { /*--- Create a list with the first neighbors, including the seed. ---*/ vector First_Neighbor_Points; First_Neighbor_Points.push_back(iPoint); - for (auto jPoint : fine_grid->nodes->GetPoints(iPoint)) - First_Neighbor_Points.push_back(jPoint); + for (auto jPoint : fine_grid->nodes->GetPoints(iPoint)) First_Neighbor_Points.push_back(jPoint); /*--- Create a list with the second neighbors, without first, and seed neighbors. ---*/ vector Second_Neighbor_Points, Second_Origin_Points, Suitable_Second_Neighbors; for (auto jPoint : fine_grid->nodes->GetPoints(iPoint)) { - for (auto kPoint : fine_grid->nodes->GetPoints(jPoint)) { - /*--- Check that the second neighbor does not belong to the first neighbors or the seed. ---*/ auto end = First_Neighbor_Points.end(); @@ -692,21 +624,17 @@ void CMultiGridGeometry::SetSuitableNeighbors(vector& Suitable_In neighbors, and for hexs it produces a 27-point stencil. ---*/ for (auto iNeighbor = 0ul; iNeighbor < Second_Neighbor_Points.size(); iNeighbor++) { - - for (auto jNeighbor = iNeighbor+1; jNeighbor < Second_Neighbor_Points.size(); jNeighbor++) { - + for (auto jNeighbor = iNeighbor + 1; jNeighbor < Second_Neighbor_Points.size(); jNeighbor++) { /*--- Repeated second neighbor with different origin ---*/ if ((Second_Neighbor_Points[iNeighbor] == Second_Neighbor_Points[jNeighbor]) && (Second_Origin_Points[iNeighbor] != Second_Origin_Points[jNeighbor])) { - Suitable_Indirect_Neighbors.push_back(Second_Neighbor_Points[iNeighbor]); /*--- Create a list of suitable second neighbors, that we will use to compute the third neighbors. --*/ Suitable_Second_Neighbors.push_back(Second_Neighbor_Points[iNeighbor]); - } } } @@ -725,7 +653,6 @@ void CMultiGridGeometry::SetSuitableNeighbors(vector& Suitable_In for (auto kPoint : Suitable_Second_Neighbors) { for (auto lPoint : fine_grid->nodes->GetPoints(kPoint)) { - /*--- Check that the third neighbor does not belong to the first neighbors or the seed ---*/ auto end1 = First_Neighbor_Points.end(); @@ -743,14 +670,12 @@ void CMultiGridGeometry::SetSuitableNeighbors(vector& Suitable_In /*--- Identify those third neighbors that are repeated (candidate to be added). ---*/ - for (auto iNeighbor = 0ul; iNeighbor < Third_Neighbor_Points.size(); iNeighbor ++) { - for (auto jNeighbor = iNeighbor+1; jNeighbor < Third_Neighbor_Points.size(); jNeighbor ++) { - + for (auto iNeighbor = 0ul; iNeighbor < Third_Neighbor_Points.size(); iNeighbor++) { + for (auto jNeighbor = iNeighbor + 1; jNeighbor < Third_Neighbor_Points.size(); jNeighbor++) { /*--- Repeated third neighbor with different origin ---*/ if ((Third_Neighbor_Points[iNeighbor] == Third_Neighbor_Points[jNeighbor]) && (Third_Origin_Points[iNeighbor] != Third_Origin_Points[jNeighbor])) { - Suitable_Indirect_Neighbors.push_back(Third_Neighbor_Points[iNeighbor]); } } @@ -761,11 +686,9 @@ void CMultiGridGeometry::SetSuitableNeighbors(vector& Suitable_In sort(Suitable_Indirect_Neighbors.begin(), Suitable_Indirect_Neighbors.end()); auto it2 = unique(Suitable_Indirect_Neighbors.begin(), Suitable_Indirect_Neighbors.end()); Suitable_Indirect_Neighbors.resize(it2 - Suitable_Indirect_Neighbors.begin()); - } -void CMultiGridGeometry::SetPoint_Connectivity(const CGeometry *fine_grid) { - +void CMultiGridGeometry::SetPoint_Connectivity(const CGeometry* fine_grid) { /*--- Temporary, CPoint (nodes) then compresses this structure. ---*/ vector > points(nPoint); @@ -780,8 +703,7 @@ void CMultiGridGeometry::SetPoint_Connectivity(const CGeometry *fine_grid) { if (iParent != iCoarsePoint) { /*--- Avoid duplicates. ---*/ auto End = points[iCoarsePoint].end(); - if (find(points[iCoarsePoint].begin(), End, iParent) == End) - points[iCoarsePoint].push_back(iParent); + if (find(points[iCoarsePoint].begin(), End, iParent) == End) points[iCoarsePoint].push_back(iParent); } } } @@ -792,11 +714,10 @@ void CMultiGridGeometry::SetPoint_Connectivity(const CGeometry *fine_grid) { } nodes->SetPoints(points); - } -void CMultiGridGeometry::SetVertex(const CGeometry *fine_grid, const CConfig *config) { - unsigned long iVertex, iFinePoint, iCoarsePoint; +void CMultiGridGeometry::SetVertex(const CGeometry* fine_grid, const CConfig* config) { + unsigned long iVertex, iFinePoint, iCoarsePoint; unsigned short iMarker, iMarker_Tag, iChildren; nMarker = fine_grid->GetnMarker(); @@ -804,8 +725,8 @@ void CMultiGridGeometry::SetVertex(const CGeometry *fine_grid, const CConfig *co /*--- If any children node belong to the boundary then the entire control volume will belong to the boundary ---*/ - for (iCoarsePoint = 0; iCoarsePoint < nPoint; iCoarsePoint ++) - for (iChildren = 0; iChildren < nodes->GetnChildren_CV(iCoarsePoint); iChildren ++) { + for (iCoarsePoint = 0; iCoarsePoint < nPoint; iCoarsePoint++) + for (iChildren = 0; iChildren < nodes->GetnChildren_CV(iCoarsePoint); iChildren++) { iFinePoint = nodes->GetChildren_CV(iCoarsePoint, iChildren); if (fine_grid->nodes->GetBoundary(iFinePoint)) { nodes->SetBoundary(iCoarsePoint, nMarker); @@ -814,22 +735,22 @@ void CMultiGridGeometry::SetVertex(const CGeometry *fine_grid, const CConfig *co } vertex = new CVertex**[nMarker]; - nVertex = new unsigned long [nMarker]; + nVertex = new unsigned long[nMarker]; - Tag_to_Marker = new string [nMarker_Max]; + Tag_to_Marker = new string[nMarker_Max]; for (iMarker_Tag = 0; iMarker_Tag < nMarker_Max; iMarker_Tag++) Tag_to_Marker[iMarker_Tag] = fine_grid->GetMarker_Tag(iMarker_Tag); /*--- Compute the number of vertices to do the dimensionalization ---*/ for (iMarker = 0; iMarker < nMarker; iMarker++) nVertex[iMarker] = 0; - - for (iCoarsePoint = 0; iCoarsePoint < nPoint; iCoarsePoint ++) { + for (iCoarsePoint = 0; iCoarsePoint < nPoint; iCoarsePoint++) { if (nodes->GetBoundary(iCoarsePoint)) { - for (iChildren = 0; iChildren < nodes->GetnChildren_CV(iCoarsePoint); iChildren ++) { + for (iChildren = 0; iChildren < nodes->GetnChildren_CV(iCoarsePoint); iChildren++) { iFinePoint = nodes->GetChildren_CV(iCoarsePoint, iChildren); - for (iMarker = 0; iMarker < nMarker; iMarker ++) { - if ((fine_grid->nodes->GetVertex(iFinePoint, iMarker) != -1) && (nodes->GetVertex(iCoarsePoint, iMarker) == -1)) { + for (iMarker = 0; iMarker < nMarker; iMarker++) { + if ((fine_grid->nodes->GetVertex(iFinePoint, iMarker) != -1) && + (nodes->GetVertex(iCoarsePoint, iMarker) == -1)) { iVertex = nVertex[iMarker]; nodes->SetVertex(iCoarsePoint, iVertex, iMarker); nVertex[iMarker]++; @@ -840,23 +761,23 @@ void CMultiGridGeometry::SetVertex(const CGeometry *fine_grid, const CConfig *co } for (iMarker = 0; iMarker < nMarker; iMarker++) { - vertex[iMarker] = new CVertex* [fine_grid->GetnVertex(iMarker)+1]; + vertex[iMarker] = new CVertex*[fine_grid->GetnVertex(iMarker) + 1]; nVertex[iMarker] = 0; } - for (iCoarsePoint = 0; iCoarsePoint < nPoint; iCoarsePoint ++) + for (iCoarsePoint = 0; iCoarsePoint < nPoint; iCoarsePoint++) if (nodes->GetBoundary(iCoarsePoint)) - for (iMarker = 0; iMarker < nMarker; iMarker ++) - nodes->SetVertex(iCoarsePoint, -1, iMarker); + for (iMarker = 0; iMarker < nMarker; iMarker++) nodes->SetVertex(iCoarsePoint, -1, iMarker); for (iMarker = 0; iMarker < nMarker; iMarker++) nVertex[iMarker] = 0; - for (iCoarsePoint = 0; iCoarsePoint < nPoint; iCoarsePoint ++) { + for (iCoarsePoint = 0; iCoarsePoint < nPoint; iCoarsePoint++) { if (nodes->GetBoundary(iCoarsePoint)) { - for (iChildren = 0; iChildren < nodes->GetnChildren_CV(iCoarsePoint); iChildren ++) { + for (iChildren = 0; iChildren < nodes->GetnChildren_CV(iCoarsePoint); iChildren++) { iFinePoint = nodes->GetChildren_CV(iCoarsePoint, iChildren); - for (iMarker = 0; iMarker < fine_grid->GetnMarker(); iMarker ++) { - if ((fine_grid->nodes->GetVertex(iFinePoint, iMarker) != -1) && (nodes->GetVertex(iCoarsePoint, iMarker) == -1)) { + for (iMarker = 0; iMarker < fine_grid->GetnMarker(); iMarker++) { + if ((fine_grid->nodes->GetVertex(iFinePoint, iMarker) != -1) && + (nodes->GetVertex(iCoarsePoint, iMarker) == -1)) { iVertex = nVertex[iMarker]; vertex[iMarker][iVertex] = new CVertex(iCoarsePoint, nDim); nodes->SetVertex(iCoarsePoint, iVertex, iMarker); @@ -873,8 +794,7 @@ void CMultiGridGeometry::SetVertex(const CGeometry *fine_grid, const CConfig *co } } -void CMultiGridGeometry::MatchActuator_Disk(const CConfig *config) { - +void CMultiGridGeometry::MatchActuator_Disk(const CConfig* config) { unsigned short iMarker; unsigned long iVertex, iPoint; int iProcessor = size; @@ -890,11 +810,9 @@ void CMultiGridGeometry::MatchActuator_Disk(const CConfig *config) { } } } - } -void CMultiGridGeometry::MatchPeriodic(const CConfig *config, unsigned short val_periodic) { - +void CMultiGridGeometry::MatchPeriodic(const CConfig* config, unsigned short val_periodic) { unsigned short iMarker, iPeriodic, nPeriodic; unsigned long iVertex, iPoint; int iProcessor = rank; @@ -906,133 +824,123 @@ void CMultiGridGeometry::MatchPeriodic(const CConfig *config, unsigned short val for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { iPeriodic = config->GetMarker_All_PerBound(iMarker); - if ((iPeriodic == val_periodic) || - (iPeriodic == val_periodic + nPeriodic/2)) { + if ((iPeriodic == val_periodic) || (iPeriodic == val_periodic + nPeriodic / 2)) { for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { iPoint = vertex[iMarker][iVertex]->GetNode(); if (nodes->GetDomain(iPoint)) { - vertex[iMarker][iVertex]->SetDonorPoint(iPoint, nodes->GetGlobalIndex(iPoint), iVertex, iMarker, iProcessor); + vertex[iMarker][iVertex]->SetDonorPoint(iPoint, nodes->GetGlobalIndex(iPoint), iVertex, iMarker, + iProcessor); } } } } } - } -void CMultiGridGeometry::SetControlVolume(const CGeometry *fine_grid, unsigned short action) { - +void CMultiGridGeometry::SetControlVolume(const CGeometry* fine_grid, unsigned short action) { BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS { - - unsigned long iFinePoint, iCoarsePoint, iEdge, iParent; - long FineEdge, CoarseEdge; - unsigned short iChildren; - bool change_face_orientation; - su2double Coarse_Volume, Area; - - /*--- Compute the area of the coarse volume ---*/ - for (iCoarsePoint = 0; iCoarsePoint < nPoint; iCoarsePoint ++) { - nodes->SetVolume(iCoarsePoint, 0.0); - Coarse_Volume = 0.0; - for (iChildren = 0; iChildren < nodes->GetnChildren_CV(iCoarsePoint); iChildren ++) { - iFinePoint = nodes->GetChildren_CV(iCoarsePoint, iChildren); - Coarse_Volume += fine_grid->nodes->GetVolume(iFinePoint); + unsigned long iFinePoint, iCoarsePoint, iEdge, iParent; + long FineEdge, CoarseEdge; + unsigned short iChildren; + bool change_face_orientation; + su2double Coarse_Volume, Area; + + /*--- Compute the area of the coarse volume ---*/ + for (iCoarsePoint = 0; iCoarsePoint < nPoint; iCoarsePoint++) { + nodes->SetVolume(iCoarsePoint, 0.0); + Coarse_Volume = 0.0; + for (iChildren = 0; iChildren < nodes->GetnChildren_CV(iCoarsePoint); iChildren++) { + iFinePoint = nodes->GetChildren_CV(iCoarsePoint, iChildren); + Coarse_Volume += fine_grid->nodes->GetVolume(iFinePoint); + } + nodes->SetVolume(iCoarsePoint, Coarse_Volume); } - nodes->SetVolume(iCoarsePoint, Coarse_Volume); - } - - /*--- Update or not the values of faces at the edge ---*/ - if (action != ALLOCATE) { - edges->SetZeroValues(); - } - for (iCoarsePoint = 0; iCoarsePoint < nPoint; iCoarsePoint ++) - for (iChildren = 0; iChildren < nodes->GetnChildren_CV(iCoarsePoint); iChildren ++) { - iFinePoint = nodes->GetChildren_CV(iCoarsePoint, iChildren); + /*--- Update or not the values of faces at the edge ---*/ + if (action != ALLOCATE) { + edges->SetZeroValues(); + } - for (auto iFinePoint_Neighbor : fine_grid->nodes->GetPoints(iFinePoint)) { - iParent = fine_grid->nodes->GetParent_CV(iFinePoint_Neighbor); - if ((iParent != iCoarsePoint) && (iParent < iCoarsePoint)) { + for (iCoarsePoint = 0; iCoarsePoint < nPoint; iCoarsePoint++) + for (iChildren = 0; iChildren < nodes->GetnChildren_CV(iCoarsePoint); iChildren++) { + iFinePoint = nodes->GetChildren_CV(iCoarsePoint, iChildren); - FineEdge = fine_grid->FindEdge(iFinePoint, iFinePoint_Neighbor); + for (auto iFinePoint_Neighbor : fine_grid->nodes->GetPoints(iFinePoint)) { + iParent = fine_grid->nodes->GetParent_CV(iFinePoint_Neighbor); + if ((iParent != iCoarsePoint) && (iParent < iCoarsePoint)) { + FineEdge = fine_grid->FindEdge(iFinePoint, iFinePoint_Neighbor); - change_face_orientation = false; - if (iFinePoint < iFinePoint_Neighbor) change_face_orientation = true; + change_face_orientation = false; + if (iFinePoint < iFinePoint_Neighbor) change_face_orientation = true; - CoarseEdge = FindEdge(iParent, iCoarsePoint); + CoarseEdge = FindEdge(iParent, iCoarsePoint); - const auto Normal = fine_grid->edges->GetNormal(FineEdge); + const auto Normal = fine_grid->edges->GetNormal(FineEdge); - if (change_face_orientation) { - edges->SubNormal(CoarseEdge,Normal); - } - else { - edges->AddNormal(CoarseEdge,Normal); + if (change_face_orientation) { + edges->SubNormal(CoarseEdge, Normal); + } else { + edges->AddNormal(CoarseEdge, Normal); + } } } } - } - /*--- Check if there is a normal with null area ---*/ + /*--- Check if there is a normal with null area ---*/ - for (iEdge = 0; iEdge < nEdge; iEdge++) { - const auto NormalFace = edges->GetNormal(iEdge); - Area = GeometryToolbox::Norm(nDim, NormalFace); - if (Area == 0.0) { - su2double DefaultNormal[3] = {EPS*EPS}; - edges->SetNormal(iEdge, DefaultNormal); + for (iEdge = 0; iEdge < nEdge; iEdge++) { + const auto NormalFace = edges->GetNormal(iEdge); + Area = GeometryToolbox::Norm(nDim, NormalFace); + if (Area == 0.0) { + su2double DefaultNormal[3] = {EPS * EPS}; + edges->SetNormal(iEdge, DefaultNormal); + } } } - - } END_SU2_OMP_SAFE_GLOBAL_ACCESS } -void CMultiGridGeometry::SetBoundControlVolume(const CGeometry *fine_grid, unsigned short action) { - +void CMultiGridGeometry::SetBoundControlVolume(const CGeometry* fine_grid, unsigned short action) { BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS { + unsigned long iCoarsePoint, iFinePoint, FineVertex, iVertex; + unsigned short iMarker, iChildren, iDim; + su2double *Normal, Area, *NormalFace = nullptr; - unsigned long iCoarsePoint, iFinePoint, FineVertex, iVertex; - unsigned short iMarker, iChildren, iDim; - su2double *Normal, Area, *NormalFace = nullptr; + Normal = new su2double[nDim]; - Normal = new su2double [nDim]; + if (action != ALLOCATE) { + for (iMarker = 0; iMarker < nMarker; iMarker++) + for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) vertex[iMarker][iVertex]->SetZeroValues(); + } - if (action != ALLOCATE) { for (iMarker = 0; iMarker < nMarker; iMarker++) - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) - vertex[iMarker][iVertex]->SetZeroValues(); - } - - for (iMarker = 0; iMarker < nMarker; iMarker ++) - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - iCoarsePoint = vertex[iMarker][iVertex]->GetNode(); - for (iChildren = 0; iChildren < nodes->GetnChildren_CV(iCoarsePoint); iChildren ++) { - iFinePoint = nodes->GetChildren_CV(iCoarsePoint, iChildren); - if (fine_grid->nodes->GetVertex(iFinePoint, iMarker)!=-1) { - FineVertex = fine_grid->nodes->GetVertex(iFinePoint, iMarker); - fine_grid->vertex[iMarker][FineVertex]->GetNormal(Normal); - vertex[iMarker][iVertex]->AddNormal(Normal); + for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { + iCoarsePoint = vertex[iMarker][iVertex]->GetNode(); + for (iChildren = 0; iChildren < nodes->GetnChildren_CV(iCoarsePoint); iChildren++) { + iFinePoint = nodes->GetChildren_CV(iCoarsePoint, iChildren); + if (fine_grid->nodes->GetVertex(iFinePoint, iMarker) != -1) { + FineVertex = fine_grid->nodes->GetVertex(iFinePoint, iMarker); + fine_grid->vertex[iMarker][FineVertex]->GetNormal(Normal); + vertex[iMarker][iVertex]->AddNormal(Normal); + } } } - } - delete[] Normal; - - /*--- Check if there is a normal with null area ---*/ - for (iMarker = 0; iMarker < nMarker; iMarker ++) - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - NormalFace = vertex[iMarker][iVertex]->GetNormal(); - Area = GeometryToolbox::Norm(nDim, NormalFace); - if (Area == 0.0) for (iDim = 0; iDim < nDim; iDim++) NormalFace[iDim] = EPS*EPS; - } + delete[] Normal; + /*--- Check if there is a normal with null area ---*/ + for (iMarker = 0; iMarker < nMarker; iMarker++) + for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { + NormalFace = vertex[iMarker][iVertex]->GetNormal(); + Area = GeometryToolbox::Norm(nDim, NormalFace); + if (Area == 0.0) + for (iDim = 0; iDim < nDim; iDim++) NormalFace[iDim] = EPS * EPS; + } } END_SU2_OMP_SAFE_GLOBAL_ACCESS } -void CMultiGridGeometry::SetCoord(const CGeometry *fine_grid) { - +void CMultiGridGeometry::SetCoord(const CGeometry* fine_grid) { SU2_OMP_FOR_STAT(roundUpDiv(nPoint, omp_get_max_threads())) for (auto Point_Coarse = 0ul; Point_Coarse < nPoint; Point_Coarse++) { auto Area_Parent = nodes->GetVolume(Point_Coarse); @@ -1042,22 +950,21 @@ void CMultiGridGeometry::SetCoord(const CGeometry *fine_grid) { auto Area_Children = fine_grid->nodes->GetVolume(Point_Fine); auto Coordinates_Fine = fine_grid->nodes->GetCoord(Point_Fine); for (auto iDim = 0u; iDim < nDim; iDim++) - Coordinates[iDim] += Coordinates_Fine[iDim]*Area_Children/Area_Parent; + Coordinates[iDim] += Coordinates_Fine[iDim] * Area_Children / Area_Parent; } nodes->SetCoord(Point_Coarse, Coordinates); } END_SU2_OMP_FOR } -void CMultiGridGeometry::SetMultiGridWallHeatFlux(const CGeometry *fine_grid, unsigned short val_marker) { - +void CMultiGridGeometry::SetMultiGridWallHeatFlux(const CGeometry* fine_grid, unsigned short val_marker) { struct { const CGeometry* fine_grid; unsigned short marker; su2double* target; - su2double Get(unsigned long iVertex) { return fine_grid->GetCustomBoundaryHeatFlux(marker, iVertex); } - void Set(unsigned long iVertex, const su2double& val) { target[iVertex] = val; } + su2double Get(unsigned long iVertex) const { return fine_grid->GetCustomBoundaryHeatFlux(marker, iVertex); } + void Set(unsigned long iVertex, const su2double& val) const { target[iVertex] = val; } } wall_heat_flux; @@ -1068,15 +975,14 @@ void CMultiGridGeometry::SetMultiGridWallHeatFlux(const CGeometry *fine_grid, un SetMultiGridWallQuantity(fine_grid, val_marker, wall_heat_flux); } -void CMultiGridGeometry::SetMultiGridWallTemperature(const CGeometry *fine_grid, unsigned short val_marker){ - +void CMultiGridGeometry::SetMultiGridWallTemperature(const CGeometry* fine_grid, unsigned short val_marker) { struct { const CGeometry* fine_grid; unsigned short marker; su2double* target; - su2double Get(unsigned long iVertex) { return fine_grid->GetCustomBoundaryTemperature(marker, iVertex); } - void Set(unsigned long iVertex, const su2double& val) { target[iVertex] = val; } + su2double Get(unsigned long iVertex) const { return fine_grid->GetCustomBoundaryTemperature(marker, iVertex); } + void Set(unsigned long iVertex, const su2double& val) const { target[iVertex] = val; } } wall_temperature; @@ -1087,10 +993,9 @@ void CMultiGridGeometry::SetMultiGridWallTemperature(const CGeometry *fine_grid, SetMultiGridWallQuantity(fine_grid, val_marker, wall_temperature); } -void CMultiGridGeometry::SetRestricted_GridVelocity(const CGeometry *fine_grid) { - +void CMultiGridGeometry::SetRestricted_GridVelocity(const CGeometry* fine_grid) { /*--- Loop over all coarse mesh points. ---*/ - SU2_OMP_FOR_STAT(roundUpDiv(nPoint,omp_get_max_threads())) + SU2_OMP_FOR_STAT(roundUpDiv(nPoint, omp_get_max_threads())) for (unsigned long Point_Coarse = 0; Point_Coarse < nPoint; Point_Coarse++) { su2double Area_Parent = nodes->GetVolume(Point_Coarse); @@ -1100,55 +1005,50 @@ void CMultiGridGeometry::SetRestricted_GridVelocity(const CGeometry *fine_grid) /*--- Loop over all of the children for this coarse CV and compute a grid velocity based on the values in the child CVs (fine mesh). ---*/ for (unsigned short iChild = 0; iChild < nodes->GetnChildren_CV(Point_Coarse); iChild++) { - unsigned long Point_Fine = nodes->GetChildren_CV(Point_Coarse, iChild); - su2double Area_Child = fine_grid->nodes->GetVolume(Point_Fine); + unsigned long Point_Fine = nodes->GetChildren_CV(Point_Coarse, iChild); + su2double Area_Child = fine_grid->nodes->GetVolume(Point_Fine); const su2double* Grid_Vel_Fine = fine_grid->nodes->GetGridVel(Point_Fine); for (unsigned short iDim = 0; iDim < nDim; iDim++) - Grid_Vel[iDim] += Grid_Vel_Fine[iDim]*Area_Child/Area_Parent; + Grid_Vel[iDim] += Grid_Vel_Fine[iDim] * Area_Child / Area_Parent; } /*--- Set the grid velocity for this coarse node. ---*/ - for (unsigned short iDim = 0; iDim < nDim; iDim++) - nodes->SetGridVel(Point_Coarse, iDim, Grid_Vel[iDim]); + for (unsigned short iDim = 0; iDim < nDim; iDim++) nodes->SetGridVel(Point_Coarse, iDim, Grid_Vel[iDim]); } END_SU2_OMP_FOR } - -void CMultiGridGeometry::FindNormal_Neighbor(const CConfig *config) { - +void CMultiGridGeometry::FindNormal_Neighbor(const CConfig* config) { unsigned short iMarker, iDim; unsigned long iPoint, iVertex; for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if (config->GetMarker_All_KindBC(iMarker) != SEND_RECEIVE && config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY && - config->GetMarker_All_KindBC(iMarker) != NEARFIELD_BOUNDARY ) { - + config->GetMarker_All_KindBC(iMarker) != NEARFIELD_BOUNDARY) { for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - iPoint = vertex[iMarker][iVertex]->GetNode(); /*--- If the node belong to the domain ---*/ if (nodes->GetDomain(iPoint)) { - /*--- Compute closest normal neighbor ---*/ su2double cos_max, scalar_prod, norm_vect, norm_Normal, cos_alpha, diff_coord; unsigned long Point_Normal = 0; - su2double *Normal = vertex[iMarker][iVertex]->GetNormal(); + su2double* Normal = vertex[iMarker][iVertex]->GetNormal(); cos_max = -1.0; for (auto jPoint : nodes->GetPoints(iPoint)) { - scalar_prod = 0.0; norm_vect = 0.0; norm_Normal = 0.0; + scalar_prod = 0.0; + norm_vect = 0.0; + norm_Normal = 0.0; for (iDim = 0; iDim < nDim; iDim++) { - diff_coord = nodes->GetCoord(jPoint, iDim)-nodes->GetCoord(iPoint, iDim); - scalar_prod += diff_coord*Normal[iDim]; - norm_vect += diff_coord*diff_coord; - norm_Normal += Normal[iDim]*Normal[iDim]; + diff_coord = nodes->GetCoord(jPoint, iDim) - nodes->GetCoord(iPoint, iDim); + scalar_prod += diff_coord * Normal[iDim]; + norm_vect += diff_coord * diff_coord; + norm_Normal += Normal[iDim] * Normal[iDim]; } norm_vect = sqrt(norm_vect); norm_Normal = sqrt(norm_Normal); - cos_alpha = scalar_prod/(norm_vect*norm_Normal); + cos_alpha = scalar_prod / (norm_vect * norm_Normal); /*--- Get maximum cosine (not minimum because normals are oriented inwards) ---*/ if (cos_alpha >= cos_max) { @@ -1162,4 +1062,3 @@ void CMultiGridGeometry::FindNormal_Neighbor(const CConfig *config) { } } } - diff --git a/Common/src/geometry/CMultiGridQueue.cpp b/Common/src/geometry/CMultiGridQueue.cpp index 3d670b05455..7ae01c60af3 100644 --- a/Common/src/geometry/CMultiGridQueue.cpp +++ b/Common/src/geometry/CMultiGridQueue.cpp @@ -2,7 +2,7 @@ * \file CMultiGridQueue.cpp * \brief Implementation of the multigrid queue class for the FVM solver. * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -28,14 +28,9 @@ #include "../../include/geometry/CMultiGridQueue.hpp" #include -CMultiGridQueue::CMultiGridQueue(unsigned long npoint) : - Priority(npoint,0), - RightCV(npoint,true), - nPoint(npoint) { - +CMultiGridQueue::CMultiGridQueue(unsigned long npoint) : Priority(npoint, 0), RightCV(npoint, true), nPoint(npoint) { /*--- Queue initialization with all the points in the fine grid. ---*/ QueueCV.emplace_back(nPoint); - } void CMultiGridQueue::ThrowPointNotInListError(unsigned long iPoint) const { @@ -45,8 +40,7 @@ void CMultiGridQueue::ThrowPointNotInListError(unsigned long iPoint) const { } void CMultiGridQueue::AddCV(unsigned long newPoint, short numberNeighbors) { - - const short maxNeighbors = QueueCV.size()-1; + const short maxNeighbors = QueueCV.size() - 1; /*--- Basic check ---*/ if (newPoint >= nPoint) { @@ -55,9 +49,8 @@ void CMultiGridQueue::AddCV(unsigned long newPoint, short numberNeighbors) { /*--- Resize the list ---*/ if (numberNeighbors > maxNeighbors) { - const size_t newSize = numberNeighbors+1; - if (QueueCV.capacity() < newSize) - QueueCV.reserve(2*newSize); + const size_t newSize = numberNeighbors + 1; + if (QueueCV.capacity() < newSize) QueueCV.reserve(2 * newSize); QueueCV.resize(newSize); } @@ -69,11 +62,9 @@ void CMultiGridQueue::AddCV(unsigned long newPoint, short numberNeighbors) { QueueCV[numberNeighbors].push_back(newPoint); Priority[newPoint] = numberNeighbors; } - } void CMultiGridQueue::RemoveCV(unsigned long removePoint) { - /*--- Basic check ---*/ if (removePoint >= nPoint) { SU2_MPI::Error("The index of the CV is greater than the size of the priority list.", CURRENT_FUNCTION); @@ -94,25 +85,21 @@ void CMultiGridQueue::RemoveCV(unsigned long removePoint) { while (sizeQueueCV > 0) { if (!QueueCV[--sizeQueueCV].empty()) break; } - QueueCV.resize(sizeQueueCV+1); - + QueueCV.resize(sizeQueueCV + 1); } void CMultiGridQueue::MoveCV(unsigned long movePoint, short numberNeighbors) { - RightCV[movePoint] = (numberNeighbors >= 0); - numberNeighbors = max(numberNeighbors,0); + numberNeighbors = max(numberNeighbors, 0); /*--- Remove the control volume ---*/ RemoveCV(movePoint); /*--- Add a new control volume ---*/ AddCV(movePoint, numberNeighbors); - } void CMultiGridQueue::IncrPriorityCV(unsigned long incrPoint) { - /*--- Find the priority list ---*/ const short numberNeighbors = Priority[incrPoint]; @@ -120,12 +107,10 @@ void CMultiGridQueue::IncrPriorityCV(unsigned long incrPoint) { RemoveCV(incrPoint); /*--- Increase the priority ---*/ - AddCV(incrPoint, numberNeighbors+1); - + AddCV(incrPoint, numberNeighbors + 1); } void CMultiGridQueue::RedPriorityCV(unsigned long redPoint) { - /*--- Find the priority list ---*/ const short numberNeighbors = Priority[redPoint]; if (numberNeighbors == 0) return; @@ -134,59 +119,50 @@ void CMultiGridQueue::RedPriorityCV(unsigned long redPoint) { RemoveCV(redPoint); /*--- Decrease the priority ---*/ - AddCV(redPoint, numberNeighbors-1); - + AddCV(redPoint, numberNeighbors - 1); } -void CMultiGridQueue::VisualizeQueue(void) const { - +void CMultiGridQueue::VisualizeQueue() const { cout << endl; unsigned short iQ = 0; for (const auto& Q : QueueCV) { cout << "Number of neighbors " << iQ << ": "; for (auto iPoint : Q) - if (iPoint != QueueType::ErasedValue) - cout << iPoint << " "; + if (iPoint != QueueType::ErasedValue) cout << iPoint << " "; cout << endl; iQ++; } } -void CMultiGridQueue::VisualizePriority(void) const { - +void CMultiGridQueue::VisualizePriority() const { for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) { cout << "Control Volume: " << iPoint << " Priority: " << Priority[iPoint] << endl; } } -bool CMultiGridQueue::EmptyQueue(void) const { - +bool CMultiGridQueue::EmptyQueue() const { /*--- In case there is only the no agglomerated elements (size 1), check * if they can be agglomerated or if we have already finished. ---*/ if (QueueCV.size() == 1) { for (auto iPoint : QueueCV[0]) - if ((iPoint != QueueType::ErasedValue) && RightCV[iPoint]) - return false; - } - else { + if ((iPoint != QueueType::ErasedValue) && RightCV[iPoint]) return false; + } else { for (size_t iQ = 1; iQ < QueueCV.size(); ++iQ) if (!QueueCV[iQ].empty()) return false; } return true; } -unsigned long CMultiGridQueue::TotalCV(void) const { +unsigned long CMultiGridQueue::TotalCV() const { unsigned long TotalCV = 0; for (const auto& Q : QueueCV) TotalCV += Q.size(); return TotalCV; } -void CMultiGridQueue::Update(unsigned long updatePoint, CGeometry *fineGrid) { - +void CMultiGridQueue::Update(unsigned long updatePoint, CGeometry* fineGrid) { RemoveCV(updatePoint); for (auto jPoint : fineGrid->nodes->GetPoints(updatePoint)) - if (!fineGrid->nodes->GetAgglomerate(jPoint)) - IncrPriorityCV(jPoint); + if (!fineGrid->nodes->GetAgglomerate(jPoint)) IncrPriorityCV(jPoint); } diff --git a/Common/src/geometry/CPhysicalGeometry.cpp b/Common/src/geometry/CPhysicalGeometry.cpp index 5d097a75daa..54d667e0fbd 100644 --- a/Common/src/geometry/CPhysicalGeometry.cpp +++ b/Common/src/geometry/CPhysicalGeometry.cpp @@ -2,7 +2,7 @@ * \file CPhysicalGeometry.cpp * \brief Implementation of the physical geometry class. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -55,11 +55,10 @@ #include #endif +CPhysicalGeometry::CPhysicalGeometry() : CGeometry() {} -CPhysicalGeometry::CPhysicalGeometry() : CGeometry() { } - -CPhysicalGeometry::CPhysicalGeometry(CConfig *config, unsigned short val_iZone, unsigned short val_nZone) : CGeometry() { - +CPhysicalGeometry::CPhysicalGeometry(CConfig* config, unsigned short val_iZone, unsigned short val_nZone) + : CGeometry() { edgeColorGroupSize = config->GetEdgeColoringGroupSize(); string text_line, Marker_Tag; @@ -70,7 +69,7 @@ CPhysicalGeometry::CPhysicalGeometry(CConfig *config, unsigned short val_iZone, ofstream boundary_file; string Grid_Marker; - string val_mesh_filename = config->GetMesh_FileName(); + string val_mesh_filename = config->GetMesh_FileName(); unsigned short val_format = config->GetMesh_FileFormat(); /*--- Determine whether or not a FEM discretization is used ---*/ @@ -79,7 +78,7 @@ CPhysicalGeometry::CPhysicalGeometry(CConfig *config, unsigned short val_iZone, /*--- Initialize counters for local/global points & elements ---*/ - if( fem_solver ) { + if (fem_solver) { switch (val_format) { case SU2: Read_SU2_Format_Parallel_FEM(config, val_mesh_filename, val_iZone, val_nZone); @@ -93,11 +92,12 @@ CPhysicalGeometry::CPhysicalGeometry(CConfig *config, unsigned short val_iZone, SU2_MPI::Error("Unrecognized mesh format specified for the FEM solver!", CURRENT_FUNCTION); break; } - } - else { - + } else { switch (val_format) { - case SU2: case CGNS_GRID: case RECTANGLE: case BOX: + case SU2: + case CGNS_GRID: + case RECTANGLE: + case BOX: Read_Mesh_FVM(config, val_mesh_filename, val_iZone, val_nZone); break; default: @@ -113,23 +113,20 @@ CPhysicalGeometry::CPhysicalGeometry(CConfig *config, unsigned short val_iZone, /*--- Loop over the points element to re-scale the mesh, and plot it (only SU2_CFD) ---*/ if (config->GetKind_SU2() == SU2_COMPONENT::SU2_CFD) { - /*--- The US system uses feet, but SU2 assumes that the grid is in inches ---*/ if (config->GetSystemMeasurements() == US) { for (iPoint = 0; iPoint < nPoint; iPoint++) { for (iDim = 0; iDim < nDim; iDim++) { - nodes->SetCoord(iPoint, iDim, nodes->GetCoord(iPoint, iDim)/12.0); + nodes->SetCoord(iPoint, iDim, nodes->GetCoord(iPoint, iDim) / 12.0); } } } - } /*--- If SU2_DEF then write a file with the boundary information ---*/ if ((config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF) && (rank == MASTER_NODE)) { - string str = "boundary.dat"; str = config->GetMultizone_FileName(str, val_iZone, ".dat"); @@ -143,16 +140,15 @@ CPhysicalGeometry::CPhysicalGeometry(CConfig *config, unsigned short val_iZone, boundary_file << "NMARK= " << nMarker << endl; for (iMarker = 0; iMarker < nMarker; iMarker++) { - Grid_Marker = config->GetMarker_All_TagBound(iMarker); boundary_file << "MARKER_TAG= " << Grid_Marker << endl; - boundary_file << "MARKER_ELEMS= " << nElem_Bound[iMarker]<< endl; + boundary_file << "MARKER_ELEMS= " << nElem_Bound[iMarker] << endl; boundary_file << "SEND_TO= " << config->GetMarker_All_SendRecv(iMarker) << endl; if (nDim == 2) { for (iElem_Bound = 0; iElem_Bound < nElem_Bound[iMarker]; iElem_Bound++) { - boundary_file << bound[iMarker][iElem_Bound]->GetVTK_Type() << "\t" ; + boundary_file << bound[iMarker][iElem_Bound]->GetVTK_Type() << "\t"; for (iNodes = 0; iNodes < bound[iMarker][iElem_Bound]->GetnNodes(); iNodes++) - boundary_file << bound[iMarker][iElem_Bound]->GetNode(iNodes) << "\t" ; + boundary_file << bound[iMarker][iElem_Bound]->GetNode(iNodes) << "\t"; if (bound[iMarker][iElem_Bound]->GetVTK_Type() == VERTEX) { boundary_file << bound[iMarker][iElem_Bound]->GetRotation_Type() << "\t"; @@ -163,9 +159,9 @@ CPhysicalGeometry::CPhysicalGeometry(CConfig *config, unsigned short val_iZone, if (nDim == 3) { for (iElem_Bound = 0; iElem_Bound < nElem_Bound[iMarker]; iElem_Bound++) { - boundary_file << bound[iMarker][iElem_Bound]->GetVTK_Type() << "\t" ; + boundary_file << bound[iMarker][iElem_Bound]->GetVTK_Type() << "\t"; for (iNodes = 0; iNodes < bound[iMarker][iElem_Bound]->GetnNodes(); iNodes++) - boundary_file << bound[iMarker][iElem_Bound]->GetNode(iNodes) << "\t" ; + boundary_file << bound[iMarker][iElem_Bound]->GetNode(iNodes) << "\t"; if (bound[iMarker][iElem_Bound]->GetVTK_Type() == VERTEX) { boundary_file << bound[iMarker][iElem_Bound]->GetRotation_Type() << "\t"; @@ -173,28 +169,23 @@ CPhysicalGeometry::CPhysicalGeometry(CConfig *config, unsigned short val_iZone, boundary_file << iElem_Bound << endl; } } - } boundary_file.close(); - } /*--- If the gradient smoothing solver is active, allocate space for the sensitivity and initialize. ---*/ if (config->GetSmoothGradient()) { - Sensitivity.resize(nPoint,nDim) = su2double(0.0); + Sensitivity.resize(nPoint, nDim) = su2double(0.0); } - } -CPhysicalGeometry::CPhysicalGeometry(CGeometry *geometry, - CConfig *config) : CGeometry() { - +CPhysicalGeometry::CPhysicalGeometry(CGeometry* geometry, CConfig* config) : CGeometry() { edgeColorGroupSize = config->GetEdgeColoringGroupSize(); /*--- The new geometry class has the same problem dimension/zone. ---*/ - nDim = geometry->GetnDim(); + nDim = geometry->GetnDim(); nZone = geometry->GetnZone(); /*--- Recompute the linear partitioning offsets. ---*/ @@ -204,34 +195,30 @@ CPhysicalGeometry::CPhysicalGeometry(CGeometry *geometry, /*--- Communicate the coloring data so that each rank has a complete set of colors for all points that reside on it, including repeats. ---*/ - if ((rank == MASTER_NODE) && (size != SINGLE_NODE)) - cout <<"Distributing ParMETIS coloring." << endl; + if ((rank == MASTER_NODE) && (size != SINGLE_NODE)) cout << "Distributing ParMETIS coloring." << endl; DistributeColoring(config, geometry); /*--- Redistribute the points to all ranks based on the coloring. ---*/ - if ((rank == MASTER_NODE) && (size != SINGLE_NODE)) - cout <<"Rebalancing vertices." << endl; + if ((rank == MASTER_NODE) && (size != SINGLE_NODE)) cout << "Rebalancing vertices." << endl; DistributePoints(config, geometry); /*--- Distribute the element information to all ranks based on coloring. ---*/ - if ((rank == MASTER_NODE) && (size != SINGLE_NODE)) - cout <<"Rebalancing volume element connectivity." << endl; + if ((rank == MASTER_NODE) && (size != SINGLE_NODE)) cout << "Rebalancing volume element connectivity." << endl; - DistributeVolumeConnectivity(config, geometry, TRIANGLE ); + DistributeVolumeConnectivity(config, geometry, TRIANGLE); DistributeVolumeConnectivity(config, geometry, QUADRILATERAL); - DistributeVolumeConnectivity(config, geometry, TETRAHEDRON ); - DistributeVolumeConnectivity(config, geometry, HEXAHEDRON ); - DistributeVolumeConnectivity(config, geometry, PRISM ); - DistributeVolumeConnectivity(config, geometry, PYRAMID ); + DistributeVolumeConnectivity(config, geometry, TETRAHEDRON); + DistributeVolumeConnectivity(config, geometry, HEXAHEDRON); + DistributeVolumeConnectivity(config, geometry, PRISM); + DistributeVolumeConnectivity(config, geometry, PYRAMID); /*--- Distribute the marker information to all ranks based on coloring. ---*/ - if ((rank == MASTER_NODE) && (size != SINGLE_NODE)) - cout <<"Rebalancing markers and surface elements." << endl; + if ((rank == MASTER_NODE) && (size != SINGLE_NODE)) cout << "Rebalancing markers and surface elements." << endl; /*--- First, perform a linear partitioning of the marker information, as the grid readers currently store all boundary information on the master @@ -239,32 +226,25 @@ CPhysicalGeometry::CPhysicalGeometry(CGeometry *geometry, reader to avoid reading the markers to the master rank alone at first. ---*/ DistributeMarkerTags(config, geometry); - PartitionSurfaceConnectivity(config, geometry, LINE ); - PartitionSurfaceConnectivity(config, geometry, TRIANGLE ); + PartitionSurfaceConnectivity(config, geometry, LINE); + PartitionSurfaceConnectivity(config, geometry, TRIANGLE); PartitionSurfaceConnectivity(config, geometry, QUADRILATERAL); /*--- Once the markers are distributed according to the linear partitioning of the grid points, we can use similar techniques as above for distributing the surface element connectivity. ---*/ - DistributeSurfaceConnectivity(config, geometry, LINE ); - DistributeSurfaceConnectivity(config, geometry, TRIANGLE ); + DistributeSurfaceConnectivity(config, geometry, LINE); + DistributeSurfaceConnectivity(config, geometry, TRIANGLE); DistributeSurfaceConnectivity(config, geometry, QUADRILATERAL); /*--- Reduce the total number of elements that we have on each rank. ---*/ - nLocal_Elem = (nLocal_Tria + - nLocal_Quad + - nLocal_Tetr + - nLocal_Hexa + - nLocal_Pris + - nLocal_Pyra); + nLocal_Elem = (nLocal_Tria + nLocal_Quad + nLocal_Tetr + nLocal_Hexa + nLocal_Pris + nLocal_Pyra); nLocal_Bound_Elem = nLocal_Line + nLocal_BoundTria + nLocal_BoundQuad; - SU2_MPI::Allreduce(&nLocal_Elem, &nGlobal_Elem, 1, - MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(&nLocal_Bound_Elem, &nGlobal_Bound_Elem, 1, - MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&nLocal_Elem, &nGlobal_Elem, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&nLocal_Bound_Elem, &nGlobal_Bound_Elem, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); /*--- With the distribution of all points, elements, and markers based on the ParMETIS coloring complete, as a final step, load this data into @@ -276,7 +256,7 @@ CPhysicalGeometry::CPhysicalGeometry(CGeometry *geometry, /*--- If the gradient smoothing solver is active, allocate space for the sensitivity and initialize. ---*/ if (config->GetSmoothGradient()) { - Sensitivity.resize(nPoint,nDim) = su2double(0.0); + Sensitivity.resize(nPoint, nDim) = su2double(0.0); } /*--- Free memory associated with the partitioning of points and elems. ---*/ @@ -284,83 +264,81 @@ CPhysicalGeometry::CPhysicalGeometry(CGeometry *geometry, decltype(Neighbors)().swap(Neighbors); decltype(Color_List)().swap(Color_List); - delete [] Local_Points; - delete [] Local_Colors; - delete [] Local_Coords; - - delete [] Conn_Line_Linear; - delete [] Conn_BoundTria_Linear; - delete [] Conn_BoundQuad_Linear; - - delete [] Conn_Line; - delete [] Conn_BoundTria; - delete [] Conn_BoundQuad; - delete [] Conn_Tria; - delete [] Conn_Quad; - delete [] Conn_Tetr; - delete [] Conn_Hexa; - delete [] Conn_Pris; - delete [] Conn_Pyra; - - delete [] ID_Line; - delete [] ID_BoundTria; - delete [] ID_BoundQuad; - delete [] ID_Line_Linear; - delete [] ID_BoundTria_Linear; - delete [] ID_BoundQuad_Linear; - - delete [] ID_Tria; - delete [] ID_Quad; - delete [] ID_Tetr; - delete [] ID_Hexa; - delete [] ID_Pris; - delete [] ID_Pyra; - - delete [] Elem_ID_Line; - delete [] Elem_ID_BoundTria; - delete [] Elem_ID_BoundQuad; - delete [] Elem_ID_Line_Linear; - delete [] Elem_ID_BoundTria_Linear; - delete [] Elem_ID_BoundQuad_Linear; - + delete[] Local_Points; + delete[] Local_Colors; + delete[] Local_Coords; + + delete[] Conn_Line_Linear; + delete[] Conn_BoundTria_Linear; + delete[] Conn_BoundQuad_Linear; + + delete[] Conn_Line; + delete[] Conn_BoundTria; + delete[] Conn_BoundQuad; + delete[] Conn_Tria; + delete[] Conn_Quad; + delete[] Conn_Tetr; + delete[] Conn_Hexa; + delete[] Conn_Pris; + delete[] Conn_Pyra; + + delete[] ID_Line; + delete[] ID_BoundTria; + delete[] ID_BoundQuad; + delete[] ID_Line_Linear; + delete[] ID_BoundTria_Linear; + delete[] ID_BoundQuad_Linear; + + delete[] ID_Tria; + delete[] ID_Quad; + delete[] ID_Tetr; + delete[] ID_Hexa; + delete[] ID_Pris; + delete[] ID_Pyra; + + delete[] Elem_ID_Line; + delete[] Elem_ID_BoundTria; + delete[] Elem_ID_BoundQuad; + delete[] Elem_ID_Line_Linear; + delete[] Elem_ID_BoundTria_Linear; + delete[] Elem_ID_BoundQuad_Linear; } -CPhysicalGeometry::~CPhysicalGeometry(void) { - - delete [] Local_to_Global_Point; +CPhysicalGeometry::~CPhysicalGeometry() { + delete[] Local_to_Global_Point; /*--- Free up memory from turbomachinery performance computation ---*/ unsigned short iMarker; if (TangGridVelIn != nullptr) { for (iMarker = 0; iMarker < nTurboPerf; iMarker++) - if (TangGridVelIn[iMarker] != nullptr) delete [] TangGridVelIn[iMarker]; - delete [] TangGridVelIn; + if (TangGridVelIn[iMarker] != nullptr) delete[] TangGridVelIn[iMarker]; + delete[] TangGridVelIn; } if (SpanAreaIn != nullptr) { for (iMarker = 0; iMarker < nTurboPerf; iMarker++) - if (SpanAreaIn[iMarker] != nullptr) delete [] SpanAreaIn[iMarker]; - delete [] SpanAreaIn; + if (SpanAreaIn[iMarker] != nullptr) delete[] SpanAreaIn[iMarker]; + delete[] SpanAreaIn; } if (TurboRadiusIn != nullptr) { for (iMarker = 0; iMarker < nTurboPerf; iMarker++) - if (TurboRadiusIn[iMarker] != nullptr) delete [] TurboRadiusIn[iMarker]; - delete [] TurboRadiusIn; + if (TurboRadiusIn[iMarker] != nullptr) delete[] TurboRadiusIn[iMarker]; + delete[] TurboRadiusIn; } if (TangGridVelOut != nullptr) { for (iMarker = 0; iMarker < nTurboPerf; iMarker++) - if (TangGridVelOut[iMarker] != nullptr) delete [] TangGridVelOut[iMarker]; - delete [] TangGridVelOut; + if (TangGridVelOut[iMarker] != nullptr) delete[] TangGridVelOut[iMarker]; + delete[] TangGridVelOut; } if (SpanAreaOut != nullptr) { for (iMarker = 0; iMarker < nTurboPerf; iMarker++) - if (SpanAreaOut[iMarker] != nullptr) delete [] SpanAreaOut[iMarker]; - delete [] SpanAreaOut; + if (SpanAreaOut[iMarker] != nullptr) delete[] SpanAreaOut[iMarker]; + delete[] SpanAreaOut; } if (TurboRadiusOut != nullptr) { for (iMarker = 0; iMarker < nTurboPerf; iMarker++) - if (TurboRadiusOut[iMarker] != nullptr) delete [] TurboRadiusOut[iMarker]; - delete [] TurboRadiusOut; + if (TurboRadiusOut[iMarker] != nullptr) delete[] TurboRadiusOut[iMarker]; + delete[] TurboRadiusOut; } /*--- Free up memory from turbomachinery computations @@ -372,120 +350,107 @@ CPhysicalGeometry::~CPhysicalGeometry(void) { if (turbovertex != nullptr) { for (iMarker = 0; iMarker < nMarker; iMarker++) { if (Marker_All_SendRecv[iMarker] == 0 && turbovertex[iMarker] != nullptr) { - for (iSpan= 0; iSpan < nSpanSectionsByMarker[iMarker]; iSpan++) { + for (iSpan = 0; iSpan < nSpanSectionsByMarker[iMarker]; iSpan++) { if (turbovertex[iMarker][iSpan] != nullptr) { for (iVertex = 0; iVertex < nVertexSpan[iMarker][iSpan]; iVertex++) - if (turbovertex[iMarker][iSpan][iVertex] != nullptr) - delete turbovertex[iMarker][iSpan][iVertex]; - delete [] turbovertex[iMarker][iSpan]; + if (turbovertex[iMarker][iSpan][iVertex] != nullptr) delete turbovertex[iMarker][iSpan][iVertex]; + delete[] turbovertex[iMarker][iSpan]; } } - delete [] turbovertex[iMarker]; + delete[] turbovertex[iMarker]; } } - delete [] turbovertex; + delete[] turbovertex; } if (AverageTurboNormal != nullptr) { for (iMarker = 0; iMarker < nMarker; iMarker++) { if (Marker_All_SendRecv[iMarker] == 0 && AverageTurboNormal[iMarker] != nullptr) { - for (iSpan= 0; iSpan < nSpanSectionsByMarker[iMarker]+1; iSpan++) - delete [] AverageTurboNormal[iMarker][iSpan]; - delete [] AverageTurboNormal[iMarker]; + for (iSpan = 0; iSpan < nSpanSectionsByMarker[iMarker] + 1; iSpan++) + delete[] AverageTurboNormal[iMarker][iSpan]; + delete[] AverageTurboNormal[iMarker]; } } - delete [] AverageTurboNormal; + delete[] AverageTurboNormal; } if (AverageNormal != nullptr) { for (iMarker = 0; iMarker < nMarker; iMarker++) { if (Marker_All_SendRecv[iMarker] == 0 && AverageNormal[iMarker] != nullptr) { - for (iSpan= 0; iSpan < nSpanSectionsByMarker[iMarker]+1; iSpan++) - delete [] AverageNormal[iMarker][iSpan]; - delete [] AverageNormal[iMarker]; + for (iSpan = 0; iSpan < nSpanSectionsByMarker[iMarker] + 1; iSpan++) delete[] AverageNormal[iMarker][iSpan]; + delete[] AverageNormal[iMarker]; } } - delete [] AverageNormal; + delete[] AverageNormal; } if (AverageGridVel != nullptr) { for (iMarker = 0; iMarker < nMarker; iMarker++) { if (Marker_All_SendRecv[iMarker] == 0 && AverageGridVel[iMarker] != nullptr) { - for (iSpan= 0; iSpan < nSpanSectionsByMarker[iMarker]+1; iSpan++) - delete [] AverageGridVel[iMarker][iSpan]; - delete [] AverageGridVel[iMarker]; + for (iSpan = 0; iSpan < nSpanSectionsByMarker[iMarker] + 1; iSpan++) delete[] AverageGridVel[iMarker][iSpan]; + delete[] AverageGridVel[iMarker]; } } - delete [] AverageGridVel; + delete[] AverageGridVel; } if (AverageTangGridVel != nullptr) { for (iMarker = 0; iMarker < nMarker; iMarker++) if (Marker_All_SendRecv[iMarker] == 0 && AverageTangGridVel[iMarker] != nullptr) - delete [] AverageTangGridVel[iMarker]; - delete [] AverageTangGridVel; + delete[] AverageTangGridVel[iMarker]; + delete[] AverageTangGridVel; } if (SpanArea != nullptr) { for (iMarker = 0; iMarker < nMarker; iMarker++) - if (Marker_All_SendRecv[iMarker] == 0 && SpanArea[iMarker] != nullptr) - delete [] SpanArea[iMarker]; - delete [] SpanArea; + if (Marker_All_SendRecv[iMarker] == 0 && SpanArea[iMarker] != nullptr) delete[] SpanArea[iMarker]; + delete[] SpanArea; } if (TurboRadius != nullptr) { for (iMarker = 0; iMarker < nMarker; iMarker++) - if (Marker_All_SendRecv[iMarker] == 0 && TurboRadius[iMarker] != nullptr) - delete [] TurboRadius[iMarker]; - delete [] TurboRadius; + if (Marker_All_SendRecv[iMarker] == 0 && TurboRadius[iMarker] != nullptr) delete[] TurboRadius[iMarker]; + delete[] TurboRadius; } if (MaxAngularCoord != nullptr) { for (iMarker = 0; iMarker < nMarker; iMarker++) - if (Marker_All_SendRecv[iMarker] == 0 && MaxAngularCoord[iMarker] != nullptr) - delete [] MaxAngularCoord[iMarker]; - delete [] MaxAngularCoord; + if (Marker_All_SendRecv[iMarker] == 0 && MaxAngularCoord[iMarker] != nullptr) delete[] MaxAngularCoord[iMarker]; + delete[] MaxAngularCoord; } if (MinAngularCoord != nullptr) { for (iMarker = 0; iMarker < nMarker; iMarker++) - if (Marker_All_SendRecv[iMarker] == 0 && MinAngularCoord[iMarker] != nullptr) - delete [] MinAngularCoord[iMarker]; - delete [] MinAngularCoord; + if (Marker_All_SendRecv[iMarker] == 0 && MinAngularCoord[iMarker] != nullptr) delete[] MinAngularCoord[iMarker]; + delete[] MinAngularCoord; } if (MinRelAngularCoord != nullptr) { for (iMarker = 0; iMarker < nMarker; iMarker++) if (Marker_All_SendRecv[iMarker] == 0 && MinRelAngularCoord[iMarker] != nullptr) - delete [] MinRelAngularCoord[iMarker]; - delete [] MinRelAngularCoord; + delete[] MinRelAngularCoord[iMarker]; + delete[] MinRelAngularCoord; } - delete [] nSpanWiseSections; - delete [] nSpanSectionsByMarker; + delete[] nSpanWiseSections; + delete[] nSpanSectionsByMarker; if (SpanWiseValue != nullptr) { for (iMarker = 0; iMarker < 2; iMarker++) - if (Marker_All_SendRecv[iMarker] == 0 && SpanWiseValue[iMarker] != nullptr) - delete [] SpanWiseValue[iMarker]; - delete [] SpanWiseValue; + if (Marker_All_SendRecv[iMarker] == 0 && SpanWiseValue[iMarker] != nullptr) delete[] SpanWiseValue[iMarker]; + delete[] SpanWiseValue; } if (nVertexSpan != nullptr) { for (iMarker = 0; iMarker < nMarker; iMarker++) - if (Marker_All_SendRecv[iMarker] == 0 && nVertexSpan[iMarker] != nullptr) - delete [] nVertexSpan[iMarker]; - delete [] nVertexSpan; + if (Marker_All_SendRecv[iMarker] == 0 && nVertexSpan[iMarker] != nullptr) delete[] nVertexSpan[iMarker]; + delete[] nVertexSpan; } if (nTotVertexSpan != nullptr) { for (iMarker = 0; iMarker < nMarker; iMarker++) - if (Marker_All_SendRecv[iMarker] == 0 && nTotVertexSpan[iMarker] != nullptr) - delete [] nTotVertexSpan[iMarker]; - delete [] nTotVertexSpan; + if (Marker_All_SendRecv[iMarker] == 0 && nTotVertexSpan[iMarker] != nullptr) delete[] nTotVertexSpan[iMarker]; + delete[] nTotVertexSpan; } - } -void CPhysicalGeometry::SetGlobal_to_Local_Point(void) { +void CPhysicalGeometry::SetGlobal_to_Local_Point() { Global_to_Local_Point.clear(); for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { Global_to_Local_Point[nodes->GetGlobalIndex(iPoint)] = iPoint; } } -void CPhysicalGeometry::DistributeColoring(const CConfig *config, - CGeometry *geometry) { - +void CPhysicalGeometry::DistributeColoring(const CConfig* config, CGeometry* geometry) { /*--- To start, each linear partition carries the color only for the owned nodes (nPoint), but we have repeated elems on each linear partition. We need to complete the coloring information such that the repeated @@ -502,7 +467,7 @@ void CPhysicalGeometry::DistributeColoring(const CConfig *config, /*--- Get a linear partitioner to track the partition counts. ---*/ - CLinearPartitioner pointPartitioner(geometry->GetGlobal_nPoint(),0); + CLinearPartitioner pointPartitioner(geometry->GetGlobal_nPoint(), 0); /*--- First, create a complete map of the points on this rank (excluding repeats) and their neighbors so that we can efficiently loop through the @@ -519,9 +484,8 @@ void CPhysicalGeometry::DistributeColoring(const CConfig *config, rank matches the number in the mesh file (in serial). ---*/ if ((size == SINGLE_NODE) && (Point_Map.size() < geometry->GetnPoint())) { - SU2_MPI::Error( string("Mismatch between NPOIN and number of points") - +string(" listed in mesh file.\n") - +string("Please check the mesh file for correctness.\n"), + SU2_MPI::Error(string("Mismatch between NPOIN and number of points") + string(" listed in mesh file.\n") + + string("Please check the mesh file for correctness.\n"), CURRENT_FUNCTION); } @@ -536,8 +500,8 @@ void CPhysicalGeometry::DistributeColoring(const CConfig *config, jPoint = geometry->GetnPoint(); for (auto iPoint : Point_Map) { - if ((iPoint < pointPartitioner.GetFirstIndexOnRank(rank)) || - (iPoint >= pointPartitioner.GetLastIndexOnRank(rank))){ + if ((iPoint < pointPartitioner.GetFirstIndexOnRank(rank)) || + (iPoint >= pointPartitioner.GetLastIndexOnRank(rank))) { Global2Local[iPoint] = jPoint; jPoint++; } @@ -567,14 +531,19 @@ void CPhysicalGeometry::DistributeColoring(const CConfig *config, /*--- Prepare structures for communication. ---*/ - int *nPoint_Send = new int[size+1]; nPoint_Send[0] = 0; - int *nPoint_Recv = new int[size+1]; nPoint_Recv[0] = 0; - int *nPoint_Flag = new int[size]; + int* nPoint_Send = new int[size + 1]; + nPoint_Send[0] = 0; + int* nPoint_Recv = new int[size + 1]; + nPoint_Recv[0] = 0; + int* nPoint_Flag = new int[size]; for (iProc = 0; iProc < size; iProc++) { - nPoint_Send[iProc] = 0; nPoint_Recv[iProc] = 0; nPoint_Flag[iProc]= -1; + nPoint_Send[iProc] = 0; + nPoint_Recv[iProc] = 0; + nPoint_Flag[iProc] = -1; } - nPoint_Send[size] = 0; nPoint_Recv[size] = 0; + nPoint_Send[size] = 0; + nPoint_Recv[size] = 0; /*--- Loop over the owned points and check all the neighbors for unowned points. The colors of all owned points will be communicated to any ranks @@ -583,7 +552,6 @@ void CPhysicalGeometry::DistributeColoring(const CConfig *config, for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) { for (iNeighbor = 0; iNeighbor < Neighbors[iPoint].size(); iNeighbor++) { - /*--- Global ID of the neighbor ---*/ jPoint = Neighbors[iPoint][iNeighbor]; @@ -597,9 +565,8 @@ void CPhysicalGeometry::DistributeColoring(const CConfig *config, if (nPoint_Flag[iProcessor] != (int)iPoint) { nPoint_Flag[iProcessor] = (int)iPoint; - nPoint_Send[iProcessor+1]++; + nPoint_Send[iProcessor + 1]++; } - } } @@ -607,8 +574,7 @@ void CPhysicalGeometry::DistributeColoring(const CConfig *config, all processors. After this communication, each proc knows how many points it will receive from each other processor. ---*/ - SU2_MPI::Alltoall(&(nPoint_Send[1]), 1, MPI_INT, - &(nPoint_Recv[1]), 1, MPI_INT, SU2_MPI::GetComm()); + SU2_MPI::Alltoall(&(nPoint_Send[1]), 1, MPI_INT, &(nPoint_Recv[1]), 1, MPI_INT, SU2_MPI::GetComm()); /*--- Prepare to send colors. First check how many messages we will be sending and receiving. Here we also put @@ -619,34 +585,33 @@ void CPhysicalGeometry::DistributeColoring(const CConfig *config, for (iProc = 0; iProc < size; iProc++) nPoint_Flag[iProc] = -1; for (iProc = 0; iProc < size; iProc++) { - if ((iProc != rank) && (nPoint_Send[iProc+1] > 0)) nSends++; - if ((iProc != rank) && (nPoint_Recv[iProc+1] > 0)) nRecvs++; + if ((iProc != rank) && (nPoint_Send[iProc + 1] > 0)) nSends++; + if ((iProc != rank) && (nPoint_Recv[iProc + 1] > 0)) nRecvs++; - nPoint_Send[iProc+1] += nPoint_Send[iProc]; - nPoint_Recv[iProc+1] += nPoint_Recv[iProc]; + nPoint_Send[iProc + 1] += nPoint_Send[iProc]; + nPoint_Recv[iProc + 1] += nPoint_Recv[iProc]; } /*--- Allocate arrays for sending the global ID. ---*/ - unsigned long *idSend = new unsigned long[nPoint_Send[size]]; + auto* idSend = new unsigned long[nPoint_Send[size]]; for (iSend = 0; iSend < nPoint_Send[size]; iSend++) idSend[iSend] = 0; /*--- Allocate memory to hold the colors that we are sending. ---*/ - unsigned long *colorSend = new unsigned long[nPoint_Send[size]]; + auto* colorSend = new unsigned long[nPoint_Send[size]]; for (iSend = 0; iSend < nPoint_Send[size]; iSend++) colorSend[iSend] = 0; /*--- Create an index variable to keep track of our index positions as we load up the send buffer. ---*/ - unsigned long *index = new unsigned long[size]; + auto* index = new unsigned long[size]; for (iProc = 0; iProc < size; iProc++) index[iProc] = nPoint_Send[iProc]; /*--- Now load up our buffers with the Global IDs and colors. ---*/ for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) { for (iNeighbor = 0; iNeighbor < Neighbors[iPoint].size(); iNeighbor++) { - /*--- Global ID of the neighbor ---*/ jPoint = Neighbors[iPoint][iNeighbor]; @@ -659,76 +624,69 @@ void CPhysicalGeometry::DistributeColoring(const CConfig *config, counters and load up the global ID and color. ---*/ if (nPoint_Flag[iProcessor] != (int)iPoint) { - nPoint_Flag[iProcessor] = (int)iPoint; unsigned long nn = index[iProcessor]; /*--- Load the data values. ---*/ - idSend[nn] = geometry->nodes->GetGlobalIndex(iPoint); + idSend[nn] = geometry->nodes->GetGlobalIndex(iPoint); colorSend[nn] = geometry->nodes->GetColor(iPoint); /*--- Increment the index by the message length ---*/ index[iProcessor]++; - } } } /*--- Free memory after loading up the send buffer. ---*/ - delete [] index; + delete[] index; /*--- Allocate the memory that we need for receiving the conn values and then cue up the non-blocking receives. Note that we do not include our own rank in the communications. We will directly copy our own data later. ---*/ - unsigned long *colorRecv = new unsigned long[nPoint_Recv[size]]; - for (iRecv = 0; iRecv < nPoint_Recv[size]; iRecv++) - colorRecv[iRecv] = 0; + auto* colorRecv = new unsigned long[nPoint_Recv[size]]; + for (iRecv = 0; iRecv < nPoint_Recv[size]; iRecv++) colorRecv[iRecv] = 0; - unsigned long *idRecv = new unsigned long[nPoint_Recv[size]]; - for (iRecv = 0; iRecv < nPoint_Recv[size]; iRecv++) - idRecv[iRecv] = 0; + auto* idRecv = new unsigned long[nPoint_Recv[size]]; + for (iRecv = 0; iRecv < nPoint_Recv[size]; iRecv++) idRecv[iRecv] = 0; /*--- Allocate memory for the MPI requests if we need to communicate. ---*/ if (nSends > 0) { colorSendReq = new SU2_MPI::Request[nSends]; - idSendReq = new SU2_MPI::Request[nSends]; + idSendReq = new SU2_MPI::Request[nSends]; } if (nRecvs > 0) { colorRecvReq = new SU2_MPI::Request[nRecvs]; - idRecvReq = new SU2_MPI::Request[nRecvs]; + idRecvReq = new SU2_MPI::Request[nRecvs]; } /*--- Launch the non-blocking sends and receives. ---*/ - InitiateCommsAll(colorSend, nPoint_Send, colorSendReq, - colorRecv, nPoint_Recv, colorRecvReq, - 1, COMM_TYPE_UNSIGNED_LONG); + InitiateCommsAll(colorSend, nPoint_Send, colorSendReq, colorRecv, nPoint_Recv, colorRecvReq, 1, + COMM_TYPE_UNSIGNED_LONG); - InitiateCommsAll(idSend, nPoint_Send, idSendReq, - idRecv, nPoint_Recv, idRecvReq, - 1, COMM_TYPE_UNSIGNED_LONG); + InitiateCommsAll(idSend, nPoint_Send, idSendReq, idRecv, nPoint_Recv, idRecvReq, 1, COMM_TYPE_UNSIGNED_LONG); /*--- Copy my own rank's data into the recv buffer directly. ---*/ - iRecv = nPoint_Recv[rank]; + iRecv = nPoint_Recv[rank]; myStart = nPoint_Send[rank]; - myFinal = nPoint_Send[rank+1]; + myFinal = nPoint_Send[rank + 1]; for (iSend = myStart; iSend < myFinal; iSend++) { colorRecv[iRecv] = colorSend[iSend]; - idRecv[iRecv] = idSend[iSend]; + idRecv[iRecv] = idSend[iSend]; iRecv++; } /*--- Complete the non-blocking communications. ---*/ CompleteCommsAll(nSends, colorSendReq, nRecvs, colorRecvReq); - CompleteCommsAll(nSends, idSendReq, nRecvs, idRecvReq); + CompleteCommsAll(nSends, idSendReq, nRecvs, idRecvReq); /*--- Store the complete color map for this rank in class data. Now, each rank has a color value for all owned nodes as well as any repeated @@ -742,32 +700,29 @@ void CPhysicalGeometry::DistributeColoring(const CConfig *config, /*--- Free temporary memory from communications ---*/ - delete [] colorSendReq; - delete [] idSendReq; - - delete [] colorRecvReq; - delete [] idRecvReq; + delete[] colorSendReq; + delete[] idSendReq; - delete [] colorSend; - delete [] colorRecv; - delete [] idSend; - delete [] idRecv; - delete [] nPoint_Recv; - delete [] nPoint_Send; - delete [] nPoint_Flag; + delete[] colorRecvReq; + delete[] idRecvReq; + delete[] colorSend; + delete[] colorRecv; + delete[] idSend; + delete[] idRecv; + delete[] nPoint_Recv; + delete[] nPoint_Send; + delete[] nPoint_Flag; } -void CPhysicalGeometry::DistributeVolumeConnectivity(const CConfig *config, - CGeometry *geometry, +void CPhysicalGeometry::DistributeVolumeConnectivity(const CConfig* config, CGeometry* geometry, unsigned short Elem_Type) { - unsigned short NODES_PER_ELEMENT = 0; unsigned long iProcessor; unsigned long iElem, iNode, jNode, nElem_Total = 0, Global_Index; - unsigned long *Conn_Elem = nullptr; - unsigned long *ID_Elems = nullptr; + unsigned long* Conn_Elem = nullptr; + unsigned long* ID_Elems = nullptr; SU2_MPI::Request *connSendReq = nullptr, *idSendReq = nullptr; SU2_MPI::Request *connRecvReq = nullptr, *idRecvReq = nullptr; @@ -813,19 +768,23 @@ void CPhysicalGeometry::DistributeVolumeConnectivity(const CConfig *config, and decide how many elements we must send to each other rank in order to have all elements distributed according to the ParMETIS coloring. ---*/ - int *nElem_Send = new int[size+1]; nElem_Send[0] = 0; - int *nElem_Recv = new int[size+1]; nElem_Recv[0] = 0; - int *nElem_Flag = new int[size]; + int* nElem_Send = new int[size + 1]; + nElem_Send[0] = 0; + int* nElem_Recv = new int[size + 1]; + nElem_Recv[0] = 0; + int* nElem_Flag = new int[size]; for (iProc = 0; iProc < size; iProc++) { - nElem_Send[iProc] = 0; nElem_Recv[iProc] = 0; nElem_Flag[iProc]= -1; + nElem_Send[iProc] = 0; + nElem_Recv[iProc] = 0; + nElem_Flag[iProc] = -1; } - nElem_Send[size] = 0; nElem_Recv[size] = 0; + nElem_Send[size] = 0; + nElem_Recv[size] = 0; - for (iElem = 0; iElem < geometry->GetnElem(); iElem++ ) { + for (iElem = 0; iElem < geometry->GetnElem(); iElem++) { if (geometry->elem[iElem]->GetVTK_Type() == Elem_Type) { - for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++ ) { - + for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++) { /*--- Get the index of the current point. ---*/ Global_Index = geometry->elem[iElem]->GetNode(iNode); @@ -839,9 +798,8 @@ void CPhysicalGeometry::DistributeVolumeConnectivity(const CConfig *config, if ((nElem_Flag[iProcessor] != (int)iElem)) { nElem_Flag[iProcessor] = (int)iElem; - nElem_Send[iProcessor+1]++; + nElem_Send[iProcessor + 1]++; } - } } } @@ -850,8 +808,7 @@ void CPhysicalGeometry::DistributeVolumeConnectivity(const CConfig *config, all processors. After this communication, each proc knows how many cells it will receive from each other processor. ---*/ - SU2_MPI::Alltoall(&(nElem_Send[1]), 1, MPI_INT, - &(nElem_Recv[1]), 1, MPI_INT, SU2_MPI::GetComm()); + SU2_MPI::Alltoall(&(nElem_Send[1]), 1, MPI_INT, &(nElem_Recv[1]), 1, MPI_INT, SU2_MPI::GetComm()); /*--- Prepare to send connectivities. First check how many messages we will be sending and receiving. Here we also put @@ -862,44 +819,40 @@ void CPhysicalGeometry::DistributeVolumeConnectivity(const CConfig *config, for (iProc = 0; iProc < size; iProc++) nElem_Flag[iProc] = -1; for (iProc = 0; iProc < size; iProc++) { - if ((iProc != rank) && (nElem_Send[iProc+1] > 0)) nSends++; - if ((iProc != rank) && (nElem_Recv[iProc+1] > 0)) nRecvs++; + if ((iProc != rank) && (nElem_Send[iProc + 1] > 0)) nSends++; + if ((iProc != rank) && (nElem_Recv[iProc + 1] > 0)) nRecvs++; - nElem_Send[iProc+1] += nElem_Send[iProc]; - nElem_Recv[iProc+1] += nElem_Recv[iProc]; + nElem_Send[iProc + 1] += nElem_Send[iProc]; + nElem_Recv[iProc + 1] += nElem_Recv[iProc]; } /*--- Allocate memory to hold the connectivity and element IDs that we are sending. ---*/ - unsigned long *connSend = nullptr; - connSend = new unsigned long[NODES_PER_ELEMENT*nElem_Send[size]]; - for (iSend = 0; iSend < NODES_PER_ELEMENT*nElem_Send[size]; iSend++) - connSend[iSend] = 0; + unsigned long* connSend = nullptr; + connSend = new unsigned long[NODES_PER_ELEMENT * nElem_Send[size]]; + for (iSend = 0; iSend < NODES_PER_ELEMENT * nElem_Send[size]; iSend++) connSend[iSend] = 0; /*--- Allocate arrays for storing element global index. ---*/ - unsigned long *idSend = new unsigned long[nElem_Send[size]]; + auto* idSend = new unsigned long[nElem_Send[size]]; for (iSend = 0; iSend < nElem_Send[size]; iSend++) idSend[iSend] = 0; /*--- Create an index variable to keep track of our index position as we load up the send buffer. ---*/ - unsigned long *index = new unsigned long[size]; - for (iProc = 0; iProc < size; iProc++) - index[iProc] = NODES_PER_ELEMENT*nElem_Send[iProc]; + auto* index = new unsigned long[size]; + for (iProc = 0; iProc < size; iProc++) index[iProc] = NODES_PER_ELEMENT * nElem_Send[iProc]; - unsigned long *idIndex = new unsigned long[size]; - for (iProc = 0; iProc < size; iProc++) - idIndex[iProc] = nElem_Send[iProc]; + auto* idIndex = new unsigned long[size]; + for (iProc = 0; iProc < size; iProc++) idIndex[iProc] = nElem_Send[iProc]; /*--- Loop through our elements and load the elems and their additional data that we will send to the other procs. ---*/ for (iElem = 0; iElem < geometry->GetnElem(); iElem++) { if (geometry->elem[iElem]->GetVTK_Type() == Elem_Type) { - for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++ ) { - + for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++) { /*--- Get the index of the current point. ---*/ Global_Index = geometry->elem[iElem]->GetNode(iNode); @@ -911,7 +864,6 @@ void CPhysicalGeometry::DistributeVolumeConnectivity(const CConfig *config, /*--- Load connectivity and IDs into the buffer for sending ---*/ if (nElem_Flag[iProcessor] != (int)iElem) { - nElem_Flag[iProcessor] = (int)iElem; unsigned long nn = index[iProcessor]; unsigned long mm = idIndex[iProcessor]; @@ -920,7 +872,8 @@ void CPhysicalGeometry::DistributeVolumeConnectivity(const CConfig *config, stored directly based on their global index for the nodes.---*/ for (jNode = 0; jNode < NODES_PER_ELEMENT; jNode++) { - connSend[nn] = geometry->elem[iElem]->GetNode(jNode); nn++; + connSend[nn] = geometry->elem[iElem]->GetNode(jNode); + nn++; } /*--- Global ID for this element. ---*/ @@ -931,7 +884,6 @@ void CPhysicalGeometry::DistributeVolumeConnectivity(const CConfig *config, index[iProcessor] += NODES_PER_ELEMENT; idIndex[iProcessor]++; - } } } @@ -939,56 +891,52 @@ void CPhysicalGeometry::DistributeVolumeConnectivity(const CConfig *config, /*--- Free memory after loading up the send buffer. ---*/ - delete [] index; - delete [] idIndex; + delete[] index; + delete[] idIndex; /*--- Allocate the memory that we need for receiving the values and then cue up the non-blocking receives. Note that we do not include our own rank in the communications. We will directly copy our own data later. ---*/ - unsigned long *connRecv = nullptr; - connRecv = new unsigned long[NODES_PER_ELEMENT*nElem_Recv[size]]; - for (iRecv = 0; iRecv < NODES_PER_ELEMENT*nElem_Recv[size]; iRecv++) - connRecv[iRecv] = 0; + unsigned long* connRecv = nullptr; + connRecv = new unsigned long[NODES_PER_ELEMENT * nElem_Recv[size]]; + for (iRecv = 0; iRecv < NODES_PER_ELEMENT * nElem_Recv[size]; iRecv++) connRecv[iRecv] = 0; - unsigned long *idRecv = new unsigned long[nElem_Recv[size]]; + auto* idRecv = new unsigned long[nElem_Recv[size]]; for (iRecv = 0; iRecv < nElem_Recv[size]; iRecv++) idRecv[iRecv] = 0; /*--- Allocate memory for the MPI requests if we need to communicate. ---*/ if (nSends > 0) { connSendReq = new SU2_MPI::Request[nSends]; - idSendReq = new SU2_MPI::Request[nSends]; + idSendReq = new SU2_MPI::Request[nSends]; } if (nRecvs > 0) { connRecvReq = new SU2_MPI::Request[nRecvs]; - idRecvReq = new SU2_MPI::Request[nRecvs]; + idRecvReq = new SU2_MPI::Request[nRecvs]; } /*--- Launch the non-blocking sends and receives. ---*/ - InitiateCommsAll(connSend, nElem_Send, connSendReq, - connRecv, nElem_Recv, connRecvReq, - NODES_PER_ELEMENT, COMM_TYPE_UNSIGNED_LONG); + InitiateCommsAll(connSend, nElem_Send, connSendReq, connRecv, nElem_Recv, connRecvReq, NODES_PER_ELEMENT, + COMM_TYPE_UNSIGNED_LONG); - InitiateCommsAll(idSend, nElem_Send, idSendReq, - idRecv, nElem_Recv, idRecvReq, - 1, COMM_TYPE_UNSIGNED_LONG); + InitiateCommsAll(idSend, nElem_Send, idSendReq, idRecv, nElem_Recv, idRecvReq, 1, COMM_TYPE_UNSIGNED_LONG); /*--- Copy my own rank's data into the recv buffer directly. ---*/ - iRecv = NODES_PER_ELEMENT*nElem_Recv[rank]; - myStart = NODES_PER_ELEMENT*nElem_Send[rank]; - myFinal = NODES_PER_ELEMENT*nElem_Send[rank+1]; + iRecv = NODES_PER_ELEMENT * nElem_Recv[rank]; + myStart = NODES_PER_ELEMENT * nElem_Send[rank]; + myFinal = NODES_PER_ELEMENT * nElem_Send[rank + 1]; for (iSend = myStart; iSend < myFinal; iSend++) { connRecv[iRecv] = connSend[iSend]; iRecv++; } - iRecv = nElem_Recv[rank]; + iRecv = nElem_Recv[rank]; myStart = nElem_Send[rank]; - myFinal = nElem_Send[rank+1]; + myFinal = nElem_Send[rank + 1]; for (iSend = myStart; iSend < myFinal; iSend++) { idRecv[iRecv] = idSend[iSend]; iRecv++; @@ -997,18 +945,19 @@ void CPhysicalGeometry::DistributeVolumeConnectivity(const CConfig *config, /*--- Complete the non-blocking communications. ---*/ CompleteCommsAll(nSends, connSendReq, nRecvs, connRecvReq); - CompleteCommsAll(nSends, idSendReq, nRecvs, idRecvReq); + CompleteCommsAll(nSends, idSendReq, nRecvs, idRecvReq); /*--- Store the connectivity for this rank in the proper structure It will be loaded into the geometry objects in a later step. ---*/ if (nElem_Recv[size] > 0) { - Conn_Elem = new unsigned long[NODES_PER_ELEMENT*nElem_Recv[size]]; - int count = 0; nElem_Total = 0; + Conn_Elem = new unsigned long[NODES_PER_ELEMENT * nElem_Recv[size]]; + int count = 0; + nElem_Total = 0; for (iRecv = 0; iRecv < nElem_Recv[size]; iRecv++) { nElem_Total++; for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++) { - Conn_Elem[count] = connRecv[iRecv*NODES_PER_ELEMENT+iNode]; + Conn_Elem[count] = connRecv[iRecv * NODES_PER_ELEMENT + iNode]; count++; } } @@ -1031,42 +980,42 @@ void CPhysicalGeometry::DistributeVolumeConnectivity(const CConfig *config, nLocal_Tria = nElem_Total; if (nLocal_Tria > 0) { Conn_Tria = Conn_Elem; - ID_Tria = ID_Elems; + ID_Tria = ID_Elems; } break; case QUADRILATERAL: nLocal_Quad = nElem_Total; if (nLocal_Quad > 0) { Conn_Quad = Conn_Elem; - ID_Quad = ID_Elems; + ID_Quad = ID_Elems; } break; case TETRAHEDRON: nLocal_Tetr = nElem_Total; if (nLocal_Tetr > 0) { Conn_Tetr = Conn_Elem; - ID_Tetr = ID_Elems; + ID_Tetr = ID_Elems; } break; case HEXAHEDRON: nLocal_Hexa = nElem_Total; if (nLocal_Hexa > 0) { Conn_Hexa = Conn_Elem; - ID_Hexa = ID_Elems; + ID_Hexa = ID_Elems; } break; case PRISM: nLocal_Pris = nElem_Total; if (nLocal_Pris > 0) { Conn_Pris = Conn_Elem; - ID_Pris = ID_Elems; + ID_Pris = ID_Elems; } break; case PYRAMID: nLocal_Pyra = nElem_Total; if (nLocal_Pyra > 0) { Conn_Pyra = Conn_Elem; - ID_Pyra = ID_Elems; + ID_Pyra = ID_Elems; } break; default: @@ -1076,24 +1025,22 @@ void CPhysicalGeometry::DistributeVolumeConnectivity(const CConfig *config, /*--- Free temporary memory from communications ---*/ - delete [] connSendReq; - delete [] idSendReq; - - delete [] connRecvReq; - delete [] idRecvReq; + delete[] connSendReq; + delete[] idSendReq; - delete [] connSend; - delete [] connRecv; - delete [] idSend; - delete [] idRecv; - delete [] nElem_Recv; - delete [] nElem_Send; - delete [] nElem_Flag; + delete[] connRecvReq; + delete[] idRecvReq; + delete[] connSend; + delete[] connRecv; + delete[] idSend; + delete[] idRecv; + delete[] nElem_Recv; + delete[] nElem_Send; + delete[] nElem_Flag; } -void CPhysicalGeometry::DistributePoints(const CConfig *config, CGeometry *geometry) { - +void CPhysicalGeometry::DistributePoints(const CConfig* config, CGeometry* geometry) { /*--- We now know all of the coloring for our local points and neighbors. From this, we can communicate the owned nodes in our linear partitioning to all other ranks, including coordinates and coloring info, so that the @@ -1108,14 +1055,19 @@ void CPhysicalGeometry::DistributePoints(const CConfig *config, CGeometry *geome /*--- Prepare structures for communication. ---*/ - int *nPoint_Send = new int[size+1]; nPoint_Send[0] = 0; - int *nPoint_Recv = new int[size+1]; nPoint_Recv[0] = 0; - int *nPoint_Flag = new int[size]; + int* nPoint_Send = new int[size + 1]; + nPoint_Send[0] = 0; + int* nPoint_Recv = new int[size + 1]; + nPoint_Recv[0] = 0; + int* nPoint_Flag = new int[size]; for (iProc = 0; iProc < size; iProc++) { - nPoint_Send[iProc] = 0; nPoint_Recv[iProc] = 0; nPoint_Flag[iProc]= -1; + nPoint_Send[iProc] = 0; + nPoint_Recv[iProc] = 0; + nPoint_Flag[iProc] = -1; } - nPoint_Send[size] = 0; nPoint_Recv[size] = 0; + nPoint_Send[size] = 0; + nPoint_Recv[size] = 0; /*--- Loop over the owned points and check all the neighbors for unowned points. The colors of all owned points will be communicated to any ranks @@ -1124,7 +1076,6 @@ void CPhysicalGeometry::DistributePoints(const CConfig *config, CGeometry *geome for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) { for (iNeighbor = 0; iNeighbor < Neighbors[iPoint].size(); iNeighbor++) { - /*--- Global ID of the neighbor ---*/ jPoint = Neighbors[iPoint][iNeighbor]; @@ -1138,7 +1089,7 @@ void CPhysicalGeometry::DistributePoints(const CConfig *config, CGeometry *geome if (nPoint_Flag[iProcessor] != (int)iPoint) { nPoint_Flag[iProcessor] = (int)iPoint; - nPoint_Send[iProcessor+1]++; + nPoint_Send[iProcessor + 1]++; } } } @@ -1147,8 +1098,7 @@ void CPhysicalGeometry::DistributePoints(const CConfig *config, CGeometry *geome all processors. After this communication, each proc knows how many points it will receive from each other processor. ---*/ - SU2_MPI::Alltoall(&(nPoint_Send[1]), 1, MPI_INT, - &(nPoint_Recv[1]), 1, MPI_INT, SU2_MPI::GetComm()); + SU2_MPI::Alltoall(&(nPoint_Send[1]), 1, MPI_INT, &(nPoint_Recv[1]), 1, MPI_INT, SU2_MPI::GetComm()); /*--- Prepare to send colors, ids, and coords. First check how many messages we will be sending and receiving. Here we also put @@ -1159,46 +1109,42 @@ void CPhysicalGeometry::DistributePoints(const CConfig *config, CGeometry *geome for (iProc = 0; iProc < size; iProc++) nPoint_Flag[iProc] = -1; for (iProc = 0; iProc < size; iProc++) { - if ((iProc != rank) && (nPoint_Send[iProc+1] > 0)) nSends++; - if ((iProc != rank) && (nPoint_Recv[iProc+1] > 0)) nRecvs++; + if ((iProc != rank) && (nPoint_Send[iProc + 1] > 0)) nSends++; + if ((iProc != rank) && (nPoint_Recv[iProc + 1] > 0)) nRecvs++; - nPoint_Send[iProc+1] += nPoint_Send[iProc]; - nPoint_Recv[iProc+1] += nPoint_Recv[iProc]; + nPoint_Send[iProc + 1] += nPoint_Send[iProc]; + nPoint_Recv[iProc + 1] += nPoint_Recv[iProc]; } /*--- Allocate arrays for sending the global ID. ---*/ - unsigned long *idSend = new unsigned long[nPoint_Send[size]]; + auto* idSend = new unsigned long[nPoint_Send[size]]; for (iSend = 0; iSend < nPoint_Send[size]; iSend++) idSend[iSend] = 0; /*--- Allocate memory to hold the colors that we are sending. ---*/ - unsigned long *colorSend = new unsigned long[nPoint_Send[size]]; + auto* colorSend = new unsigned long[nPoint_Send[size]]; for (iSend = 0; iSend < nPoint_Send[size]; iSend++) colorSend[iSend] = 0; /*--- Allocate memory to hold the coordinates that we are sending. ---*/ - su2double *coordSend = nullptr; - coordSend = new su2double[nDim*nPoint_Send[size]]; - for (iSend = 0; iSend < nDim*nPoint_Send[size]; iSend++) - coordSend[iSend] = 0; + su2double* coordSend = nullptr; + coordSend = new su2double[nDim * nPoint_Send[size]]; + for (iSend = 0; iSend < nDim * nPoint_Send[size]; iSend++) coordSend[iSend] = 0; /*--- Create index variables to keep track of our index positions as we load up the send buffer. ---*/ - unsigned long *index = new unsigned long[size]; - for (iProc = 0; iProc < size; iProc++) - index[iProc] = nPoint_Send[iProc]; + auto* index = new unsigned long[size]; + for (iProc = 0; iProc < size; iProc++) index[iProc] = nPoint_Send[iProc]; - unsigned long *coordIndex = new unsigned long[size]; - for (iProc = 0; iProc < size; iProc++) - coordIndex[iProc] = nDim*nPoint_Send[iProc]; + auto* coordIndex = new unsigned long[size]; + for (iProc = 0; iProc < size; iProc++) coordIndex[iProc] = nDim * nPoint_Send[iProc]; /*--- Now load up our buffers with the colors, ids, and coords. ---*/ for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) { for (iNeighbor = 0; iNeighbor < Neighbors[iPoint].size(); iNeighbor++) { - /*--- Global ID of the neighbor ---*/ jPoint = Neighbors[iPoint][iNeighbor]; @@ -1211,94 +1157,84 @@ void CPhysicalGeometry::DistributePoints(const CConfig *config, CGeometry *geome counters and load up the colors, ids, and coords. ---*/ if (nPoint_Flag[iProcessor] != (int)iPoint) { - nPoint_Flag[iProcessor] = (int)iPoint; unsigned long nn = index[iProcessor]; /*--- Load the global ID, color, and coordinate values. ---*/ - idSend[nn] = geometry->nodes->GetGlobalIndex(iPoint); + idSend[nn] = geometry->nodes->GetGlobalIndex(iPoint); colorSend[nn] = geometry->nodes->GetColor(iPoint); nn = coordIndex[iProcessor]; - for (iDim = 0; iDim < nDim; iDim++) { - coordSend[nn] = geometry->nodes->GetCoord(iPoint, iDim); nn++; + for (iDim = 0; iDim < nDim; iDim++) { + coordSend[nn] = geometry->nodes->GetCoord(iPoint, iDim); + nn++; } /*--- Increment the index by the message length ---*/ coordIndex[iProcessor] += nDim; index[iProcessor]++; - } } } /*--- Free memory after loading up the send buffer. ---*/ - delete [] index; - delete [] coordIndex; + delete[] index; + delete[] coordIndex; /*--- Allocate the memory that we need for receiving the values and then cue up the non-blocking receives. Note that we do not include our own rank in the communications. We will directly copy our own data later. ---*/ - unsigned long *colorRecv = new unsigned long[nPoint_Recv[size]]; - for (iRecv = 0; iRecv < nPoint_Recv[size]; iRecv++) - colorRecv[iRecv] = 0; + auto* colorRecv = new unsigned long[nPoint_Recv[size]]; + for (iRecv = 0; iRecv < nPoint_Recv[size]; iRecv++) colorRecv[iRecv] = 0; - unsigned long *idRecv = new unsigned long[nPoint_Recv[size]]; - for (iRecv = 0; iRecv < nPoint_Recv[size]; iRecv++) - idRecv[iRecv] = 0; + auto* idRecv = new unsigned long[nPoint_Recv[size]]; + for (iRecv = 0; iRecv < nPoint_Recv[size]; iRecv++) idRecv[iRecv] = 0; - su2double *coordRecv = nullptr; - coordRecv = new su2double[nDim*nPoint_Recv[size]]; - for (iRecv = 0; iRecv < nDim*nPoint_Recv[size]; iRecv++) - coordRecv[iRecv] = 0; + su2double* coordRecv = nullptr; + coordRecv = new su2double[nDim * nPoint_Recv[size]]; + for (iRecv = 0; iRecv < nDim * nPoint_Recv[size]; iRecv++) coordRecv[iRecv] = 0; /*--- Allocate memory for the MPI requests if we need to communicate. ---*/ if (nSends > 0) { colorSendReq = new SU2_MPI::Request[nSends]; - idSendReq = new SU2_MPI::Request[nSends]; + idSendReq = new SU2_MPI::Request[nSends]; coordSendReq = new SU2_MPI::Request[nSends]; - } if (nRecvs > 0) { colorRecvReq = new SU2_MPI::Request[nRecvs]; - idRecvReq = new SU2_MPI::Request[nRecvs]; + idRecvReq = new SU2_MPI::Request[nRecvs]; coordRecvReq = new SU2_MPI::Request[nRecvs]; } /*--- Launch the non-blocking sends and receives. ---*/ - InitiateCommsAll(colorSend, nPoint_Send, colorSendReq, - colorRecv, nPoint_Recv, colorRecvReq, - 1, COMM_TYPE_UNSIGNED_LONG); + InitiateCommsAll(colorSend, nPoint_Send, colorSendReq, colorRecv, nPoint_Recv, colorRecvReq, 1, + COMM_TYPE_UNSIGNED_LONG); - InitiateCommsAll(idSend, nPoint_Send, idSendReq, - idRecv, nPoint_Recv, idRecvReq, - 1, COMM_TYPE_UNSIGNED_LONG); + InitiateCommsAll(idSend, nPoint_Send, idSendReq, idRecv, nPoint_Recv, idRecvReq, 1, COMM_TYPE_UNSIGNED_LONG); - InitiateCommsAll(coordSend, nPoint_Send, coordSendReq, - coordRecv, nPoint_Recv, coordRecvReq, - nDim, COMM_TYPE_DOUBLE); + InitiateCommsAll(coordSend, nPoint_Send, coordSendReq, coordRecv, nPoint_Recv, coordRecvReq, nDim, COMM_TYPE_DOUBLE); /*--- Copy my own rank's data into the recv buffer directly. ---*/ - iRecv = nPoint_Recv[rank]; + iRecv = nPoint_Recv[rank]; myStart = nPoint_Send[rank]; - myFinal = nPoint_Send[rank+1]; + myFinal = nPoint_Send[rank + 1]; for (iSend = myStart; iSend < myFinal; iSend++) { colorRecv[iRecv] = colorSend[iSend]; - idRecv[iRecv] = idSend[iSend]; + idRecv[iRecv] = idSend[iSend]; iRecv++; } - iRecv = nDim*nPoint_Recv[rank]; - myStart = nDim*nPoint_Send[rank]; - myFinal = nDim*nPoint_Send[rank+1]; + iRecv = nDim * nPoint_Recv[rank]; + myStart = nDim * nPoint_Send[rank]; + myFinal = nDim * nPoint_Send[rank + 1]; for (iSend = myStart; iSend < myFinal; iSend++) { coordRecv[iRecv] = coordSend[iSend]; iRecv++; @@ -1307,7 +1243,7 @@ void CPhysicalGeometry::DistributePoints(const CConfig *config, CGeometry *geome /*--- Complete the non-blocking communications. ---*/ CompleteCommsAll(nSends, colorSendReq, nRecvs, colorRecvReq); - CompleteCommsAll(nSends, idSendReq, nRecvs, idRecvReq); + CompleteCommsAll(nSends, idSendReq, nRecvs, idRecvReq); CompleteCommsAll(nSends, coordSendReq, nRecvs, coordRecvReq); /*--- Store the total number of local points my rank has for @@ -1320,44 +1256,42 @@ void CPhysicalGeometry::DistributePoints(const CConfig *config, CGeometry *geome Local_Points = new unsigned long[nPoint_Recv[size]]; Local_Colors = new unsigned long[nPoint_Recv[size]]; - Local_Coords = new su2double[nDim*nPoint_Recv[size]]; + Local_Coords = new su2double[nDim * nPoint_Recv[size]]; - nLocal_PointDomain = 0; nLocal_PointGhost = 0; + nLocal_PointDomain = 0; + nLocal_PointGhost = 0; for (iRecv = 0; iRecv < nPoint_Recv[size]; iRecv++) { Local_Points[iRecv] = idRecv[iRecv]; Local_Colors[iRecv] = colorRecv[iRecv]; - for (iDim = 0; iDim < nDim; iDim++) - Local_Coords[iRecv*nDim+iDim] = coordRecv[iRecv*nDim+iDim]; - if (Local_Colors[iRecv] == (unsigned long)rank) nLocal_PointDomain++; - else nLocal_PointGhost++; + for (iDim = 0; iDim < nDim; iDim++) Local_Coords[iRecv * nDim + iDim] = coordRecv[iRecv * nDim + iDim]; + if (Local_Colors[iRecv] == (unsigned long)rank) + nLocal_PointDomain++; + else + nLocal_PointGhost++; } /*--- Free temporary memory from communications ---*/ - delete [] colorSendReq; - delete [] idSendReq; - delete [] coordSendReq; - - delete [] colorRecvReq; - delete [] idRecvReq; - delete [] coordRecvReq; - - delete [] colorSend; - delete [] colorRecv; - delete [] idSend; - delete [] idRecv; - delete [] coordSend; - delete [] coordRecv; - delete [] nPoint_Recv; - delete [] nPoint_Send; - delete [] nPoint_Flag; - + delete[] colorSendReq; + delete[] idSendReq; + delete[] coordSendReq; + + delete[] colorRecvReq; + delete[] idRecvReq; + delete[] coordRecvReq; + + delete[] colorSend; + delete[] colorRecv; + delete[] idSend; + delete[] idRecv; + delete[] coordSend; + delete[] coordRecv; + delete[] nPoint_Recv; + delete[] nPoint_Send; + delete[] nPoint_Flag; } -void CPhysicalGeometry::PartitionSurfaceConnectivity(CConfig *config, - CGeometry *geometry, - unsigned short Elem_Type) { - +void CPhysicalGeometry::PartitionSurfaceConnectivity(CConfig* config, CGeometry* geometry, unsigned short Elem_Type) { /*--- We begin with all marker information residing on the master rank, as the master currently stores all marker info when reading the grid. We first check and communicate basic information that each rank will @@ -1374,9 +1308,9 @@ void CPhysicalGeometry::PartitionSurfaceConnectivity(CConfig *config, unsigned long iMarker, iProcessor, iElem, iNode, jNode; unsigned long nElem_Total = 0, Global_Index, Global_Elem_Index; - unsigned long *Conn_Elem = nullptr; - unsigned long *Linear_Markers = nullptr; - unsigned long *ID_SurfElem = nullptr; + unsigned long* Conn_Elem = nullptr; + unsigned long* Linear_Markers = nullptr; + unsigned long* ID_SurfElem = nullptr; SU2_MPI::Request *connSendReq = nullptr, *markerSendReq = nullptr, *idSendReq = nullptr; SU2_MPI::Request *connRecvReq = nullptr, *markerRecvReq = nullptr, *idRecvReq = nullptr; @@ -1402,33 +1336,34 @@ void CPhysicalGeometry::PartitionSurfaceConnectivity(CConfig *config, break; } - int *nElem_Send = new int[size+1]; nElem_Send[0] = 0; - int *nElem_Recv = new int[size+1]; nElem_Recv[0] = 0; - int *nElem_Flag = new int[size]; + int* nElem_Send = new int[size + 1]; + nElem_Send[0] = 0; + int* nElem_Recv = new int[size + 1]; + nElem_Recv[0] = 0; + int* nElem_Flag = new int[size]; for (iProc = 0; iProc < size; iProc++) { - nElem_Send[iProc] = 0; nElem_Recv[iProc] = 0; nElem_Flag[iProc]= -1; + nElem_Send[iProc] = 0; + nElem_Recv[iProc] = 0; + nElem_Flag[iProc] = -1; } - nElem_Send[size] = 0; nElem_Recv[size] = 0; + nElem_Send[size] = 0; + nElem_Recv[size] = 0; /*--- We know that the master owns all of the info and will be the only rank sending anything, although all ranks might receive something. ---*/ if (rank == MASTER_NODE) { for (iMarker = 0; iMarker < geometry->GetnMarker(); iMarker++) { - /*--- Reset the flag in between markers, just to ensure that we don't miss some elements on different markers with the same local index. ---*/ - for (iProc = 0; iProc < size; iProc++) nElem_Flag[iProc]= -1; + for (iProc = 0; iProc < size; iProc++) nElem_Flag[iProc] = -1; for (iElem = 0; iElem < geometry->GetnElem_Bound(iMarker); iElem++) { - if (geometry->bound[iMarker][iElem]->GetVTK_Type() == Elem_Type) { - - for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++ ) { - + for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++) { /*--- Get the index of the current point (stored as global). ---*/ Global_Index = geometry->bound[iMarker][iElem]->GetNode(iNode); @@ -1442,7 +1377,7 @@ void CPhysicalGeometry::PartitionSurfaceConnectivity(CConfig *config, if ((nElem_Flag[iProcessor] != (int)iElem)) { nElem_Flag[iProcessor] = (int)iElem; - nElem_Send[iProcessor+1]++; + nElem_Send[iProcessor + 1]++; } } } @@ -1454,8 +1389,7 @@ void CPhysicalGeometry::PartitionSurfaceConnectivity(CConfig *config, all processors. After this communication, each proc knows how many cells it will receive from each other processor. ---*/ - SU2_MPI::Scatter(&(nElem_Send[1]), 1, MPI_INT, - &(nElem_Recv[1]), 1, MPI_INT, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Scatter(&(nElem_Send[1]), 1, MPI_INT, &(nElem_Recv[1]), 1, MPI_INT, MASTER_NODE, SU2_MPI::GetComm()); /*--- Prepare to send connectivities. First check how many messages we will be sending and receiving. Here we also put @@ -1466,60 +1400,52 @@ void CPhysicalGeometry::PartitionSurfaceConnectivity(CConfig *config, for (iProc = 0; iProc < size; iProc++) nElem_Flag[iProc] = -1; for (iProc = 0; iProc < size; iProc++) { - if ((iProc != rank) && (nElem_Send[iProc+1] > 0)) nSends++; - if ((iProc != rank) && (nElem_Recv[iProc+1] > 0)) nRecvs++; + if ((iProc != rank) && (nElem_Send[iProc + 1] > 0)) nSends++; + if ((iProc != rank) && (nElem_Recv[iProc + 1] > 0)) nRecvs++; - nElem_Send[iProc+1] += nElem_Send[iProc]; - nElem_Recv[iProc+1] += nElem_Recv[iProc]; + nElem_Send[iProc + 1] += nElem_Send[iProc]; + nElem_Recv[iProc + 1] += nElem_Recv[iProc]; } /*--- Allocate memory to hold the connectivity that we are sending. ---*/ - unsigned long *connSend = nullptr; - unsigned long *markerSend = nullptr; - unsigned long *idSend = nullptr; + unsigned long* connSend = nullptr; + unsigned long* markerSend = nullptr; + unsigned long* idSend = nullptr; if (rank == MASTER_NODE) { - - connSend = new unsigned long[NODES_PER_ELEMENT*nElem_Send[size]]; - for (iSend = 0; iSend < NODES_PER_ELEMENT*nElem_Send[size]; iSend++) - connSend[iSend] = 0; + connSend = new unsigned long[NODES_PER_ELEMENT * nElem_Send[size]]; + for (iSend = 0; iSend < NODES_PER_ELEMENT * nElem_Send[size]; iSend++) connSend[iSend] = 0; markerSend = new unsigned long[nElem_Send[size]]; - for (iSend = 0; iSend < nElem_Send[size]; iSend++) - markerSend[iSend] = 0; + for (iSend = 0; iSend < nElem_Send[size]; iSend++) markerSend[iSend] = 0; idSend = new unsigned long[nElem_Send[size]]; - for (iSend = 0; iSend < nElem_Send[size]; iSend++) - idSend[iSend] = 0; + for (iSend = 0; iSend < nElem_Send[size]; iSend++) idSend[iSend] = 0; /*--- Create an index variable to keep track of our index position as we load up the send buffer. ---*/ - unsigned long *index = new unsigned long[size]; - for (iProc = 0; iProc < size; iProc++) - index[iProc] = NODES_PER_ELEMENT*nElem_Send[iProc]; + auto* index = new unsigned long[size]; + for (iProc = 0; iProc < size; iProc++) index[iProc] = NODES_PER_ELEMENT * nElem_Send[iProc]; - unsigned long *markerIndex = new unsigned long[size]; - for (iProc = 0; iProc < size; iProc++) - markerIndex[iProc] = nElem_Send[iProc]; + auto* markerIndex = new unsigned long[size]; + for (iProc = 0; iProc < size; iProc++) markerIndex[iProc] = nElem_Send[iProc]; /*--- Loop through our elements and load the elems and their additional data that we will send to the other procs. ---*/ Global_Elem_Index = 0; for (iMarker = 0; iMarker < geometry->GetnMarker(); iMarker++) { - /*--- Reset the flag in between markers, just to ensure that we don't miss some elements on different markers with the same local index. ---*/ - for (iProc = 0; iProc < size; iProc++) nElem_Flag[iProc]= -1; + for (iProc = 0; iProc < size; iProc++) nElem_Flag[iProc] = -1; for (iElem = 0; iElem < geometry->GetnElem_Bound(iMarker); iElem++) { if (geometry->bound[iMarker][iElem]->GetVTK_Type() == Elem_Type) { - for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++ ) { - + for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++) { /*--- Get the index of the current point. ---*/ Global_Index = geometry->bound[iMarker][iElem]->GetNode(iNode); @@ -1531,7 +1457,6 @@ void CPhysicalGeometry::PartitionSurfaceConnectivity(CConfig *config, /*--- Load connectivity into the buffer for sending ---*/ if ((nElem_Flag[iProcessor] != (int)iElem)) { - nElem_Flag[iProcessor] = (int)iElem; unsigned long nn = index[iProcessor]; unsigned long mm = markerIndex[iProcessor]; @@ -1546,27 +1471,24 @@ void CPhysicalGeometry::PartitionSurfaceConnectivity(CConfig *config, /*--- Store the marker index and surface elem global ID ---*/ markerSend[mm] = iMarker; - idSend[mm] = Global_Elem_Index; + idSend[mm] = Global_Elem_Index; /*--- Increment the index by the message length ---*/ index[iProcessor] += NODES_PER_ELEMENT; markerIndex[iProcessor]++; } - } } Global_Elem_Index++; - } } /*--- Free memory after loading up the send buffer. ---*/ - delete [] index; - delete [] markerIndex; - + delete[] index; + delete[] markerIndex; } /*--- Allocate the memory that we need for receiving the conn @@ -1574,86 +1496,78 @@ void CPhysicalGeometry::PartitionSurfaceConnectivity(CConfig *config, we do not include our own rank in the communications. We will directly copy our own data later. ---*/ - unsigned long *connRecv = nullptr; - connRecv = new unsigned long[NODES_PER_ELEMENT*nElem_Recv[size]]; - for (iRecv = 0; iRecv < NODES_PER_ELEMENT*nElem_Recv[size]; iRecv++) - connRecv[iRecv] = 0; + unsigned long* connRecv = nullptr; + connRecv = new unsigned long[NODES_PER_ELEMENT * nElem_Recv[size]]; + for (iRecv = 0; iRecv < NODES_PER_ELEMENT * nElem_Recv[size]; iRecv++) connRecv[iRecv] = 0; - unsigned long *markerRecv = new unsigned long[nElem_Recv[size]]; - for (iRecv = 0; iRecv < nElem_Recv[size]; iRecv++) - markerRecv[iRecv] = 0; + auto* markerRecv = new unsigned long[nElem_Recv[size]]; + for (iRecv = 0; iRecv < nElem_Recv[size]; iRecv++) markerRecv[iRecv] = 0; - unsigned long *idRecv = new unsigned long[nElem_Recv[size]]; - for (iRecv = 0; iRecv < nElem_Recv[size]; iRecv++) - idRecv[iRecv] = 0; + auto* idRecv = new unsigned long[nElem_Recv[size]]; + for (iRecv = 0; iRecv < nElem_Recv[size]; iRecv++) idRecv[iRecv] = 0; /*--- Allocate memory for the MPI requests if we need to communicate. ---*/ if (nSends > 0) { - connSendReq = new SU2_MPI::Request[nSends]; + connSendReq = new SU2_MPI::Request[nSends]; markerSendReq = new SU2_MPI::Request[nSends]; - idSendReq = new SU2_MPI::Request[nSends]; + idSendReq = new SU2_MPI::Request[nSends]; } if (nRecvs > 0) { - connRecvReq = new SU2_MPI::Request[nRecvs]; + connRecvReq = new SU2_MPI::Request[nRecvs]; markerRecvReq = new SU2_MPI::Request[nRecvs]; - idRecvReq = new SU2_MPI::Request[nRecvs]; + idRecvReq = new SU2_MPI::Request[nRecvs]; } /*--- Launch the non-blocking sends and receives. ---*/ - InitiateCommsAll(connSend, nElem_Send, connSendReq, - connRecv, nElem_Recv, connRecvReq, - NODES_PER_ELEMENT, COMM_TYPE_UNSIGNED_LONG); + InitiateCommsAll(connSend, nElem_Send, connSendReq, connRecv, nElem_Recv, connRecvReq, NODES_PER_ELEMENT, + COMM_TYPE_UNSIGNED_LONG); - InitiateCommsAll(markerSend, nElem_Send, markerSendReq, - markerRecv, nElem_Recv, markerRecvReq, - 1, COMM_TYPE_UNSIGNED_LONG); + InitiateCommsAll(markerSend, nElem_Send, markerSendReq, markerRecv, nElem_Recv, markerRecvReq, 1, + COMM_TYPE_UNSIGNED_LONG); - InitiateCommsAll(idSend, nElem_Send, idSendReq, - idRecv, nElem_Recv, idRecvReq, - 1, COMM_TYPE_UNSIGNED_LONG); + InitiateCommsAll(idSend, nElem_Send, idSendReq, idRecv, nElem_Recv, idRecvReq, 1, COMM_TYPE_UNSIGNED_LONG); /*--- Copy my own rank's data into the recv buffer directly. ---*/ if (rank == MASTER_NODE) { - - iRecv = NODES_PER_ELEMENT*nElem_Recv[rank]; - myStart = NODES_PER_ELEMENT*nElem_Send[rank]; - myFinal = NODES_PER_ELEMENT*nElem_Send[rank+1]; + iRecv = NODES_PER_ELEMENT * nElem_Recv[rank]; + myStart = NODES_PER_ELEMENT * nElem_Send[rank]; + myFinal = NODES_PER_ELEMENT * nElem_Send[rank + 1]; for (iSend = myStart; iSend < myFinal; iSend++) { connRecv[iRecv] = connSend[iSend]; iRecv++; } - iRecv = nElem_Recv[rank]; + iRecv = nElem_Recv[rank]; myStart = nElem_Send[rank]; - myFinal = nElem_Send[rank+1]; + myFinal = nElem_Send[rank + 1]; for (iSend = myStart; iSend < myFinal; iSend++) { markerRecv[iRecv] = markerSend[iSend]; - idRecv[iRecv] = idSend[iSend]; + idRecv[iRecv] = idSend[iSend]; iRecv++; } - } /*--- Complete the non-blocking communications. ---*/ - CompleteCommsAll(nSends, connSendReq, nRecvs, connRecvReq); + CompleteCommsAll(nSends, connSendReq, nRecvs, connRecvReq); CompleteCommsAll(nSends, markerSendReq, nRecvs, markerRecvReq); - CompleteCommsAll(nSends, idSendReq, nRecvs, idRecvReq); + CompleteCommsAll(nSends, idSendReq, nRecvs, idRecvReq); /*--- Store the connectivity for this rank in the proper data structure before post-processing below. First, allocate appropriate amount of memory for this section. ---*/ if (nElem_Recv[size] > 0) { - Conn_Elem = new unsigned long[NODES_PER_ELEMENT*nElem_Recv[size]]; - int count = 0; nElem_Total = 0; + Conn_Elem = new unsigned long[NODES_PER_ELEMENT * nElem_Recv[size]]; + int count = 0; + nElem_Total = 0; for (iRecv = 0; iRecv < nElem_Recv[size]; iRecv++) { nElem_Total++; for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++) { - Conn_Elem[count] = connRecv[iRecv*NODES_PER_ELEMENT+iNode]; + Conn_Elem[count] = connRecv[iRecv * NODES_PER_ELEMENT + iNode]; count++; } } @@ -1684,24 +1598,24 @@ void CPhysicalGeometry::PartitionSurfaceConnectivity(CConfig *config, case LINE: nLinear_Line = nElem_Total; if (nLinear_Line > 0) { - Conn_Line_Linear = Conn_Elem; - ID_Line_Linear = Linear_Markers; + Conn_Line_Linear = Conn_Elem; + ID_Line_Linear = Linear_Markers; Elem_ID_Line_Linear = ID_SurfElem; } break; case TRIANGLE: nLinear_BoundTria = nElem_Total; if (nLinear_BoundTria > 0) { - Conn_BoundTria_Linear = Conn_Elem; - ID_BoundTria_Linear = Linear_Markers; + Conn_BoundTria_Linear = Conn_Elem; + ID_BoundTria_Linear = Linear_Markers; Elem_ID_BoundTria_Linear = ID_SurfElem; } break; case QUADRILATERAL: nLinear_BoundQuad = nElem_Total; if (nLinear_BoundQuad > 0) { - Conn_BoundQuad_Linear = Conn_Elem; - ID_BoundQuad_Linear = Linear_Markers; + Conn_BoundQuad_Linear = Conn_Elem; + ID_BoundQuad_Linear = Linear_Markers; Elem_ID_BoundQuad_Linear = ID_SurfElem; } break; @@ -1712,46 +1626,42 @@ void CPhysicalGeometry::PartitionSurfaceConnectivity(CConfig *config, /*--- Free temporary memory from communications ---*/ - delete [] connSendReq; - delete [] markerSendReq; - delete [] idSendReq; - - delete [] connRecvReq; - delete [] markerRecvReq; - delete [] idRecvReq; + delete[] connSendReq; + delete[] markerSendReq; + delete[] idSendReq; - delete [] connSend; - delete [] markerSend; - delete [] idSend; + delete[] connRecvReq; + delete[] markerRecvReq; + delete[] idRecvReq; - delete [] connRecv; - delete [] markerRecv; - delete [] idRecv; + delete[] connSend; + delete[] markerSend; + delete[] idSend; - delete [] nElem_Recv; - delete [] nElem_Send; - delete [] nElem_Flag; + delete[] connRecv; + delete[] markerRecv; + delete[] idRecv; + delete[] nElem_Recv; + delete[] nElem_Send; + delete[] nElem_Flag; } -void CPhysicalGeometry::DistributeSurfaceConnectivity(CConfig *config, - CGeometry *geometry, - unsigned short Elem_Type) { - +void CPhysicalGeometry::DistributeSurfaceConnectivity(CConfig* config, CGeometry* geometry, unsigned short Elem_Type) { unsigned short NODES_PER_ELEMENT = 0; unsigned long iProcessor, NELEM = 0; unsigned long iElem, iNode, jNode, nElem_Total = 0, Global_Index; - unsigned long *Conn_Linear = nullptr; - unsigned long *Conn_Elem = nullptr; - unsigned long *Linear_Markers = nullptr; - unsigned long *ID_SurfElem_Linear = nullptr; - unsigned long *Local_Markers = nullptr; - unsigned long *ID_SurfElem = nullptr; + unsigned long* Conn_Linear = nullptr; + unsigned long* Conn_Elem = nullptr; + unsigned long* Linear_Markers = nullptr; + unsigned long* ID_SurfElem_Linear = nullptr; + unsigned long* Local_Markers = nullptr; + unsigned long* ID_SurfElem = nullptr; - SU2_MPI::Request *connSendReq = nullptr,*markerSendReq = nullptr,*idSendReq = nullptr; - SU2_MPI::Request *connRecvReq = nullptr,*markerRecvReq = nullptr,*idRecvReq = nullptr; + SU2_MPI::Request *connSendReq = nullptr, *markerSendReq = nullptr, *idSendReq = nullptr; + SU2_MPI::Request *connRecvReq = nullptr, *markerRecvReq = nullptr, *idRecvReq = nullptr; int iProc, iSend, iRecv, myStart, myFinal; /*--- Store the local number of this element type and the number of nodes @@ -1761,24 +1671,24 @@ void CPhysicalGeometry::DistributeSurfaceConnectivity(CConfig *config, switch (Elem_Type) { case LINE: - NELEM = nLinear_Line; - NODES_PER_ELEMENT = N_POINTS_LINE; - Conn_Linear = Conn_Line_Linear; - Linear_Markers = ID_Line_Linear; + NELEM = nLinear_Line; + NODES_PER_ELEMENT = N_POINTS_LINE; + Conn_Linear = Conn_Line_Linear; + Linear_Markers = ID_Line_Linear; ID_SurfElem_Linear = Elem_ID_Line_Linear; break; case TRIANGLE: - NELEM = nLinear_BoundTria; - NODES_PER_ELEMENT = N_POINTS_TRIANGLE; - Conn_Linear = Conn_BoundTria_Linear; - Linear_Markers = ID_BoundTria_Linear; + NELEM = nLinear_BoundTria; + NODES_PER_ELEMENT = N_POINTS_TRIANGLE; + Conn_Linear = Conn_BoundTria_Linear; + Linear_Markers = ID_BoundTria_Linear; ID_SurfElem_Linear = Elem_ID_BoundTria_Linear; break; case QUADRILATERAL: - NELEM = nLinear_BoundQuad; - NODES_PER_ELEMENT = N_POINTS_QUADRILATERAL; - Conn_Linear = Conn_BoundQuad_Linear; - Linear_Markers = ID_BoundQuad_Linear; + NELEM = nLinear_BoundQuad; + NODES_PER_ELEMENT = N_POINTS_QUADRILATERAL; + Conn_Linear = Conn_BoundQuad_Linear; + Linear_Markers = ID_BoundQuad_Linear; ID_SurfElem_Linear = Elem_ID_BoundQuad_Linear; break; default: @@ -1791,21 +1701,25 @@ void CPhysicalGeometry::DistributeSurfaceConnectivity(CConfig *config, and decide how many elements we must send to each other rank in order to have all elements distributed according to the ParMETIS coloring. ---*/ - int *nElem_Send = new int[size+1]; nElem_Send[0] = 0; - int *nElem_Recv = new int[size+1]; nElem_Recv[0] = 0; - int *nElem_Flag = new int[size]; + int* nElem_Send = new int[size + 1]; + nElem_Send[0] = 0; + int* nElem_Recv = new int[size + 1]; + nElem_Recv[0] = 0; + int* nElem_Flag = new int[size]; for (iProc = 0; iProc < size; iProc++) { - nElem_Send[iProc] = 0; nElem_Recv[iProc] = 0; nElem_Flag[iProc]= -1; + nElem_Send[iProc] = 0; + nElem_Recv[iProc] = 0; + nElem_Flag[iProc] = -1; } - nElem_Send[size] = 0; nElem_Recv[size] = 0; + nElem_Send[size] = 0; + nElem_Recv[size] = 0; for (iElem = 0; iElem < NELEM; iElem++) { for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++) { - /*--- Get the index of the current point. ---*/ - Global_Index = Conn_Linear[iElem*NODES_PER_ELEMENT+iNode]; + Global_Index = Conn_Linear[iElem * NODES_PER_ELEMENT + iNode]; /*--- We have the color stored in a map for all local points. ---*/ @@ -1816,9 +1730,8 @@ void CPhysicalGeometry::DistributeSurfaceConnectivity(CConfig *config, if ((nElem_Flag[iProcessor] != (int)iElem)) { nElem_Flag[iProcessor] = (int)iElem; - nElem_Send[iProcessor+1]++; + nElem_Send[iProcessor + 1]++; } - } } @@ -1826,8 +1739,7 @@ void CPhysicalGeometry::DistributeSurfaceConnectivity(CConfig *config, all processors. After this communication, each proc knows how many cells it will receive from each other processor. ---*/ - SU2_MPI::Alltoall(&(nElem_Send[1]), 1, MPI_INT, - &(nElem_Recv[1]), 1, MPI_INT, SU2_MPI::GetComm()); + SU2_MPI::Alltoall(&(nElem_Send[1]), 1, MPI_INT, &(nElem_Recv[1]), 1, MPI_INT, SU2_MPI::GetComm()); /*--- Prepare to send connectivities. First check how many messages we will be sending and receiving. Here we also put @@ -1838,49 +1750,45 @@ void CPhysicalGeometry::DistributeSurfaceConnectivity(CConfig *config, for (iProc = 0; iProc < size; iProc++) nElem_Flag[iProc] = -1; for (iProc = 0; iProc < size; iProc++) { - if ((iProc != rank) && (nElem_Send[iProc+1] > 0)) nSends++; - if ((iProc != rank) && (nElem_Recv[iProc+1] > 0)) nRecvs++; + if ((iProc != rank) && (nElem_Send[iProc + 1] > 0)) nSends++; + if ((iProc != rank) && (nElem_Recv[iProc + 1] > 0)) nRecvs++; - nElem_Send[iProc+1] += nElem_Send[iProc]; - nElem_Recv[iProc+1] += nElem_Recv[iProc]; + nElem_Send[iProc + 1] += nElem_Send[iProc]; + nElem_Recv[iProc + 1] += nElem_Recv[iProc]; } /*--- Allocate memory to hold the connectivity that we are sending. ---*/ - unsigned long *connSend = nullptr; - connSend = new unsigned long[NODES_PER_ELEMENT*nElem_Send[size]]; - for (iSend = 0; iSend < NODES_PER_ELEMENT*nElem_Send[size]; iSend++) - connSend[iSend] = 0; + unsigned long* connSend = nullptr; + connSend = new unsigned long[NODES_PER_ELEMENT * nElem_Send[size]]; + for (iSend = 0; iSend < NODES_PER_ELEMENT * nElem_Send[size]; iSend++) connSend[iSend] = 0; /*--- Allocate arrays for storing the marker global index. ---*/ - unsigned long *markerSend = new unsigned long[nElem_Send[size]]; + auto* markerSend = new unsigned long[nElem_Send[size]]; for (iSend = 0; iSend < nElem_Send[size]; iSend++) markerSend[iSend] = 0; - unsigned long *idSend = new unsigned long[nElem_Send[size]]; + auto* idSend = new unsigned long[nElem_Send[size]]; for (iSend = 0; iSend < nElem_Send[size]; iSend++) idSend[iSend] = 0; /*--- Create an index variable to keep track of our index position as we load up the send buffer. ---*/ - unsigned long *index = new unsigned long[size]; - for (iProc = 0; iProc < size; iProc++) - index[iProc] = NODES_PER_ELEMENT*nElem_Send[iProc]; + auto* index = new unsigned long[size]; + for (iProc = 0; iProc < size; iProc++) index[iProc] = NODES_PER_ELEMENT * nElem_Send[iProc]; - unsigned long *markerIndex = new unsigned long[size]; - for (iProc = 0; iProc < size; iProc++) - markerIndex[iProc] = nElem_Send[iProc]; + auto* markerIndex = new unsigned long[size]; + for (iProc = 0; iProc < size; iProc++) markerIndex[iProc] = nElem_Send[iProc]; /*--- Loop through our elements and load the elems and their additional data that we will send to the other procs. ---*/ for (iElem = 0; iElem < NELEM; iElem++) { for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++) { - /*--- Get the index of the current point. ---*/ - Global_Index = Conn_Linear[iElem*NODES_PER_ELEMENT+iNode]; + Global_Index = Conn_Linear[iElem * NODES_PER_ELEMENT + iNode]; /*--- We have the color stored in a map for all local points. ---*/ @@ -1890,7 +1798,6 @@ void CPhysicalGeometry::DistributeSurfaceConnectivity(CConfig *config, for sending. ---*/ if (nElem_Flag[iProcessor] != (int)iElem) { - nElem_Flag[iProcessor] = (int)iElem; unsigned long nn = index[iProcessor]; unsigned long mm = markerIndex[iProcessor]; @@ -1898,111 +1805,105 @@ void CPhysicalGeometry::DistributeSurfaceConnectivity(CConfig *config, /*--- Load the connectivity values. ---*/ for (jNode = 0; jNode < NODES_PER_ELEMENT; jNode++) { - /*--- Note that elements are already stored directly based on their global index for the nodes. ---*/ - connSend[nn] = Conn_Linear[iElem*NODES_PER_ELEMENT+jNode]; nn++; - + connSend[nn] = Conn_Linear[iElem * NODES_PER_ELEMENT + jNode]; + nn++; } /*--- Global marker ID for this element. ---*/ markerSend[mm] = Linear_Markers[iElem]; - idSend[mm] = ID_SurfElem_Linear[iElem]; + idSend[mm] = ID_SurfElem_Linear[iElem]; /*--- Increment the index by the message length ---*/ index[iProcessor] += NODES_PER_ELEMENT; markerIndex[iProcessor]++; - } } } /*--- Free memory after loading up the send buffer. ---*/ - delete [] index; - delete [] markerIndex; + delete[] index; + delete[] markerIndex; /*--- Allocate the memory that we need for receiving the conn values and then cue up the non-blocking receives. Note that we do not include our own rank in the communications. We will directly copy our own data later. ---*/ - unsigned long *connRecv = nullptr; - connRecv = new unsigned long[NODES_PER_ELEMENT*nElem_Recv[size]]; - for (iRecv = 0; iRecv < NODES_PER_ELEMENT*nElem_Recv[size]; iRecv++) - connRecv[iRecv] = 0; + unsigned long* connRecv = nullptr; + connRecv = new unsigned long[NODES_PER_ELEMENT * nElem_Recv[size]]; + for (iRecv = 0; iRecv < NODES_PER_ELEMENT * nElem_Recv[size]; iRecv++) connRecv[iRecv] = 0; - unsigned long *markerRecv = new unsigned long[nElem_Recv[size]]; + auto* markerRecv = new unsigned long[nElem_Recv[size]]; for (iRecv = 0; iRecv < nElem_Recv[size]; iRecv++) markerRecv[iRecv] = 0; - unsigned long *idRecv = new unsigned long[nElem_Recv[size]]; + auto* idRecv = new unsigned long[nElem_Recv[size]]; for (iRecv = 0; iRecv < nElem_Recv[size]; iRecv++) idRecv[iRecv] = 0; /*--- Allocate memory for the MPI requests if we need to communicate. ---*/ if (nSends > 0) { - connSendReq = new SU2_MPI::Request[nSends]; + connSendReq = new SU2_MPI::Request[nSends]; markerSendReq = new SU2_MPI::Request[nSends]; - idSendReq = new SU2_MPI::Request[nSends]; + idSendReq = new SU2_MPI::Request[nSends]; } if (nRecvs > 0) { - connRecvReq = new SU2_MPI::Request[nRecvs]; + connRecvReq = new SU2_MPI::Request[nRecvs]; markerRecvReq = new SU2_MPI::Request[nRecvs]; - idRecvReq = new SU2_MPI::Request[nRecvs]; + idRecvReq = new SU2_MPI::Request[nRecvs]; } /*--- Launch the non-blocking sends and receives. ---*/ - InitiateCommsAll(connSend, nElem_Send, connSendReq, - connRecv, nElem_Recv, connRecvReq, - NODES_PER_ELEMENT, COMM_TYPE_UNSIGNED_LONG); + InitiateCommsAll(connSend, nElem_Send, connSendReq, connRecv, nElem_Recv, connRecvReq, NODES_PER_ELEMENT, + COMM_TYPE_UNSIGNED_LONG); - InitiateCommsAll(markerSend, nElem_Send, markerSendReq, - markerRecv, nElem_Recv, markerRecvReq, - 1, COMM_TYPE_UNSIGNED_LONG); + InitiateCommsAll(markerSend, nElem_Send, markerSendReq, markerRecv, nElem_Recv, markerRecvReq, 1, + COMM_TYPE_UNSIGNED_LONG); - InitiateCommsAll(idSend, nElem_Send, idSendReq, - idRecv, nElem_Recv, idRecvReq, - 1, COMM_TYPE_UNSIGNED_LONG); + InitiateCommsAll(idSend, nElem_Send, idSendReq, idRecv, nElem_Recv, idRecvReq, 1, COMM_TYPE_UNSIGNED_LONG); /*--- Copy my own rank's data into the recv buffer directly. ---*/ - iRecv = NODES_PER_ELEMENT*nElem_Recv[rank]; - myStart = NODES_PER_ELEMENT*nElem_Send[rank]; - myFinal = NODES_PER_ELEMENT*nElem_Send[rank+1]; + iRecv = NODES_PER_ELEMENT * nElem_Recv[rank]; + myStart = NODES_PER_ELEMENT * nElem_Send[rank]; + myFinal = NODES_PER_ELEMENT * nElem_Send[rank + 1]; for (iSend = myStart; iSend < myFinal; iSend++) { connRecv[iRecv] = connSend[iSend]; iRecv++; } - iRecv = nElem_Recv[rank]; + iRecv = nElem_Recv[rank]; myStart = nElem_Send[rank]; - myFinal = nElem_Send[rank+1]; + myFinal = nElem_Send[rank + 1]; for (iSend = myStart; iSend < myFinal; iSend++) { markerRecv[iRecv] = markerSend[iSend]; - idRecv[iRecv] = idSend[iSend]; + idRecv[iRecv] = idSend[iSend]; iRecv++; } /*--- Complete the non-blocking communications. ---*/ - CompleteCommsAll(nSends, connSendReq, nRecvs, connRecvReq); + CompleteCommsAll(nSends, connSendReq, nRecvs, connRecvReq); CompleteCommsAll(nSends, markerSendReq, nRecvs, markerRecvReq); - CompleteCommsAll(nSends, idSendReq, nRecvs, idRecvReq); + CompleteCommsAll(nSends, idSendReq, nRecvs, idRecvReq); /*--- Store the connectivity for this rank in the proper data structure. It will be loaded into the geometry objects in a later step. ---*/ if (nElem_Recv[size] > 0) { - Conn_Elem = new unsigned long[NODES_PER_ELEMENT*nElem_Recv[size]]; - int count = 0; nElem_Total = 0; + Conn_Elem = new unsigned long[NODES_PER_ELEMENT * nElem_Recv[size]]; + int count = 0; + nElem_Total = 0; for (iRecv = 0; iRecv < nElem_Recv[size]; iRecv++) { nElem_Total++; for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++) { - Conn_Elem[count] = connRecv[iRecv*NODES_PER_ELEMENT+iNode]; + Conn_Elem[count] = connRecv[iRecv * NODES_PER_ELEMENT + iNode]; count++; } } @@ -2033,24 +1934,24 @@ void CPhysicalGeometry::DistributeSurfaceConnectivity(CConfig *config, case LINE: nLocal_Line = nElem_Total; if (nLocal_Line > 0) { - Conn_Line = Conn_Elem; - ID_Line = Local_Markers; + Conn_Line = Conn_Elem; + ID_Line = Local_Markers; Elem_ID_Line = ID_SurfElem; } break; case TRIANGLE: nLocal_BoundTria = nElem_Total; if (nLocal_BoundTria > 0) { - Conn_BoundTria = Conn_Elem; - ID_BoundTria = Local_Markers; + Conn_BoundTria = Conn_Elem; + ID_BoundTria = Local_Markers; Elem_ID_BoundTria = ID_SurfElem; } break; case QUADRILATERAL: nLocal_BoundQuad = nElem_Total; if (nLocal_BoundQuad > 0) { - Conn_BoundQuad = Conn_Elem; - ID_BoundQuad = Local_Markers; + Conn_BoundQuad = Conn_Elem; + ID_BoundQuad = Local_Markers; Elem_ID_BoundQuad = ID_SurfElem; } break; @@ -2061,28 +1962,26 @@ void CPhysicalGeometry::DistributeSurfaceConnectivity(CConfig *config, /*--- Free temporary memory from communications ---*/ - delete [] connSendReq; - delete [] markerSendReq; - delete [] idSendReq; - - delete [] connRecvReq; - delete [] markerRecvReq; - delete [] idRecvReq; - - delete [] connSend; - delete [] connRecv; - delete [] markerSend; - delete [] markerRecv; - delete [] idSend; - delete [] idRecv; - delete [] nElem_Recv; - delete [] nElem_Send; - delete [] nElem_Flag; - + delete[] connSendReq; + delete[] markerSendReq; + delete[] idSendReq; + + delete[] connRecvReq; + delete[] markerRecvReq; + delete[] idRecvReq; + + delete[] connSend; + delete[] connRecv; + delete[] markerSend; + delete[] markerRecv; + delete[] idSend; + delete[] idRecv; + delete[] nElem_Recv; + delete[] nElem_Send; + delete[] nElem_Flag; } -void CPhysicalGeometry::DistributeMarkerTags(CConfig *config, CGeometry *geometry) { - +void CPhysicalGeometry::DistributeMarkerTags(CConfig* config, CGeometry* geometry) { unsigned long iMarker, index, iChar; char str_buf[MAX_STRING_SIZE]; @@ -2096,48 +1995,43 @@ void CPhysicalGeometry::DistributeMarkerTags(CConfig *config, CGeometry *geometr /*--- Broadcast the global number of markers in the mesh. ---*/ - SU2_MPI::Bcast(&nMarker_Global, 1, MPI_UNSIGNED_LONG, - MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Bcast(&nMarker_Global, 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); - char *mpi_str_buf = new char[nMarker_Global*MAX_STRING_SIZE](); + char* mpi_str_buf = new char[nMarker_Global * MAX_STRING_SIZE](); if (rank == MASTER_NODE) { for (iMarker = 0; iMarker < nMarker_Global; iMarker++) { - SPRINTF(&mpi_str_buf[iMarker*MAX_STRING_SIZE], "%s", - config->GetMarker_All_TagBound(iMarker).c_str()); + SPRINTF(&mpi_str_buf[iMarker * MAX_STRING_SIZE], "%s", config->GetMarker_All_TagBound(iMarker).c_str()); } } /*--- Broadcast the string names of the variables. ---*/ - SU2_MPI::Bcast(mpi_str_buf, (int)nMarker_Global*MAX_STRING_SIZE, MPI_CHAR, - MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Bcast(mpi_str_buf, (int)nMarker_Global * MAX_STRING_SIZE, MPI_CHAR, MASTER_NODE, SU2_MPI::GetComm()); /*--- Now parse the string names and load into our marker tag vector. We also need to set the values of all markers into the config. ---*/ for (iMarker = 0; iMarker < nMarker_Global; iMarker++) { - index = iMarker*MAX_STRING_SIZE; + index = iMarker * MAX_STRING_SIZE; for (iChar = 0; iChar < MAX_STRING_SIZE; iChar++) { str_buf[iChar] = mpi_str_buf[index + iChar]; } - Marker_Tags.push_back(str_buf); - config->SetMarker_All_TagBound(iMarker,str_buf); - config->SetMarker_All_SendRecv(iMarker,NO); + Marker_Tags.emplace_back(str_buf); + config->SetMarker_All_TagBound(iMarker, str_buf); + config->SetMarker_All_SendRecv(iMarker, NO); } /*--- Free string buffer memory. ---*/ - delete [] mpi_str_buf; - + delete[] mpi_str_buf; } -void CPhysicalGeometry::LoadPoints(CConfig *config, CGeometry *geometry) { - +void CPhysicalGeometry::LoadPoints(CConfig* config, CGeometry* geometry) { unsigned long iPoint, jPoint, iOwned, iPeriodic, iGhost; /*--- Create the basic point structures before storing the points. ---*/ - nPoint = nLocal_Point; + nPoint = nLocal_Point; nPointDomain = nLocal_PointDomain; nodes = new CPoint(nPoint, nDim, MESH_0, config); @@ -2153,22 +2047,22 @@ void CPhysicalGeometry::LoadPoints(CConfig *config, CGeometry *geometry) { /*--- Set our counters correctly based on the number of owned and ghost nodes that we counted during the partitioning. ---*/ - jPoint = 0; - iOwned = 0; + jPoint = 0; + iOwned = 0; iPeriodic = nLocal_PointDomain; - iGhost = nLocal_PointDomain + nLocal_PointPeriodic; + iGhost = nLocal_PointDomain + nLocal_PointPeriodic; /*--- Loop over all of the points that we have recv'd and store the coordinates, global index, and colors ---*/ for (iPoint = 0; iPoint < nPoint; iPoint++) { - /*--- Set the starting point to the correct counter for this point. ---*/ if (Local_Colors[iPoint] == (unsigned long)rank) { if (Local_Points[iPoint] < geometry->GetGlobal_nPointDomain()) jPoint = iOwned; - else jPoint = iPeriodic; + else + jPoint = iPeriodic; } else { jPoint = iGhost; } @@ -2179,7 +2073,7 @@ void CPhysicalGeometry::LoadPoints(CConfig *config, CGeometry *geometry) { /*--- Allocating the Point object ---*/ - nodes->SetCoord(jPoint, &Local_Coords[iPoint*nDim]); + nodes->SetCoord(jPoint, &Local_Coords[iPoint * nDim]); nodes->SetGlobalIndex(jPoint, Local_to_Global_Point[jPoint]); /*--- Set the color ---*/ @@ -2191,7 +2085,8 @@ void CPhysicalGeometry::LoadPoints(CConfig *config, CGeometry *geometry) { if (Local_Colors[iPoint] == (unsigned long)rank) { if (Local_Points[iPoint] < geometry->GetGlobal_nPointDomain()) iOwned++; - else iPeriodic++; + else + iPeriodic++; } else { iGhost++; } @@ -2200,8 +2095,7 @@ void CPhysicalGeometry::LoadPoints(CConfig *config, CGeometry *geometry) { /*--- Create the global to local mapping, which will be useful for loading the elements and boundaries in subsequent steps. ---*/ - for (iPoint = 0; iPoint < nPoint; iPoint++) - Global_to_Local_Point[Local_to_Global_Point[iPoint]] = iPoint; + for (iPoint = 0; iPoint < nPoint; iPoint++) Global_to_Local_Point[Local_to_Global_Point[iPoint]] = iPoint; /*--- Set the value of Global_nPoint and Global_nPointDomain ---*/ @@ -2209,10 +2103,8 @@ void CPhysicalGeometry::LoadPoints(CConfig *config, CGeometry *geometry) { unsigned long Local_nPointDomain = nPointDomain; #ifdef HAVE_MPI - SU2_MPI::Allreduce(&Local_nPoint, &Global_nPoint, 1, - MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(&Local_nPointDomain, &Global_nPointDomain, 1, - MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_nPoint, &Global_nPoint, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_nPointDomain, &Global_nPointDomain, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); #else Global_nPoint = Local_nPoint; Global_nPointDomain = Local_nPointDomain; @@ -2220,11 +2112,9 @@ void CPhysicalGeometry::LoadPoints(CConfig *config, CGeometry *geometry) { if ((rank == MASTER_NODE) && (size > SINGLE_NODE)) cout << Global_nPoint << " vertices including ghost points. " << endl; - } -void CPhysicalGeometry::LoadVolumeElements(CConfig *config, CGeometry *geometry) { - +void CPhysicalGeometry::LoadVolumeElements(CConfig* config, CGeometry* geometry) { unsigned short NODES_PER_ELEMENT; unsigned long iElem, jElem, kElem, iNode, Local_Elem, iGlobal_Index; @@ -2253,37 +2143,37 @@ void CPhysicalGeometry::LoadVolumeElements(CConfig *config, CGeometry *geometry) overwriting the duplicate entries. ---*/ jElem = 0; - for (iElem=0; iElem < nLocal_Tria; iElem++) { + for (iElem = 0; iElem < nLocal_Tria; iElem++) { Tria_List[ID_Tria[iElem]] = iElem; } nTria = Tria_List.size(); jElem = 0; - for (iElem=0; iElem < nLocal_Quad; iElem++) { + for (iElem = 0; iElem < nLocal_Quad; iElem++) { Quad_List[ID_Quad[iElem]] = iElem; } nQuad = Quad_List.size(); jElem = 0; - for (iElem=0; iElem < nLocal_Tetr; iElem++) { + for (iElem = 0; iElem < nLocal_Tetr; iElem++) { Tetr_List[ID_Tetr[iElem]] = iElem; } nTetr = Tetr_List.size(); jElem = 0; - for (iElem=0; iElem < nLocal_Hexa; iElem++) { + for (iElem = 0; iElem < nLocal_Hexa; iElem++) { Hexa_List[ID_Hexa[iElem]] = iElem; } nHexa = Hexa_List.size(); jElem = 0; - for (iElem=0; iElem < nLocal_Pris; iElem++) { + for (iElem = 0; iElem < nLocal_Pris; iElem++) { Pris_List[ID_Pris[iElem]] = iElem; } nPris = Pris_List.size(); jElem = 0; - for (iElem=0; iElem < nLocal_Pyra; iElem++) { + for (iElem = 0; iElem < nLocal_Pyra; iElem++) { Pyra_List[ID_Pyra[iElem]] = iElem; } nPyra = Pyra_List.size(); @@ -2296,12 +2186,11 @@ void CPhysicalGeometry::LoadVolumeElements(CConfig *config, CGeometry *geometry) jElem = 0; nElem = Local_Elem; - elem = new CPrimalGrid*[nElem] (); + elem = new CPrimalGrid*[nElem](); /*--- Store the elements of each type in the proper containers. ---*/ for (it = Tria_List.begin(); it != Tria_List.end(); it++) { - kElem = it->first; iElem = it->second; @@ -2310,22 +2199,20 @@ void CPhysicalGeometry::LoadVolumeElements(CConfig *config, CGeometry *geometry) NODES_PER_ELEMENT = N_POINTS_TRIANGLE; for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++) { - iGlobal_Index = Conn_Tria[iElem*NODES_PER_ELEMENT+iNode]; + iGlobal_Index = Conn_Tria[iElem * NODES_PER_ELEMENT + iNode]; Local_Nodes[iNode] = Global_to_Local_Point[iGlobal_Index]; } /*--- Create the element object. ---*/ - elem[jElem] = new CTriangle(Local_Nodes[0], - Local_Nodes[1], - Local_Nodes[2]); + elem[jElem] = new CTriangle(Local_Nodes[0], Local_Nodes[1], Local_Nodes[2]); elem[jElem]->SetGlobalIndex(kElem); /*--- Increment our local counters. ---*/ - jElem++; iElemTria++; - + jElem++; + iElemTria++; } /*--- Free memory as we go. ---*/ @@ -2333,7 +2220,6 @@ void CPhysicalGeometry::LoadVolumeElements(CConfig *config, CGeometry *geometry) Tria_List.clear(); for (it = Quad_List.begin(); it != Quad_List.end(); it++) { - kElem = it->first; iElem = it->second; @@ -2342,23 +2228,20 @@ void CPhysicalGeometry::LoadVolumeElements(CConfig *config, CGeometry *geometry) NODES_PER_ELEMENT = N_POINTS_QUADRILATERAL; for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++) { - iGlobal_Index = Conn_Quad[iElem*NODES_PER_ELEMENT+iNode]; + iGlobal_Index = Conn_Quad[iElem * NODES_PER_ELEMENT + iNode]; Local_Nodes[iNode] = Global_to_Local_Point[iGlobal_Index]; } /*--- Create the element object. ---*/ - elem[jElem] = new CQuadrilateral(Local_Nodes[0], - Local_Nodes[1], - Local_Nodes[2], - Local_Nodes[3]); + elem[jElem] = new CQuadrilateral(Local_Nodes[0], Local_Nodes[1], Local_Nodes[2], Local_Nodes[3]); elem[jElem]->SetGlobalIndex(kElem); /*--- Increment our local counters. ---*/ - jElem++; iElemQuad++; - + jElem++; + iElemQuad++; } /*--- Free memory as we go. ---*/ @@ -2366,7 +2249,6 @@ void CPhysicalGeometry::LoadVolumeElements(CConfig *config, CGeometry *geometry) Quad_List.clear(); for (it = Tetr_List.begin(); it != Tetr_List.end(); it++) { - kElem = it->first; iElem = it->second; @@ -2375,23 +2257,20 @@ void CPhysicalGeometry::LoadVolumeElements(CConfig *config, CGeometry *geometry) NODES_PER_ELEMENT = N_POINTS_TETRAHEDRON; for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++) { - iGlobal_Index = Conn_Tetr[iElem*NODES_PER_ELEMENT+iNode]; + iGlobal_Index = Conn_Tetr[iElem * NODES_PER_ELEMENT + iNode]; Local_Nodes[iNode] = Global_to_Local_Point[iGlobal_Index]; } /*--- Create the element object. ---*/ - elem[jElem] = new CTetrahedron(Local_Nodes[0], - Local_Nodes[1], - Local_Nodes[2], - Local_Nodes[3]); + elem[jElem] = new CTetrahedron(Local_Nodes[0], Local_Nodes[1], Local_Nodes[2], Local_Nodes[3]); elem[jElem]->SetGlobalIndex(kElem); /*--- Increment our local counters. ---*/ - jElem++; iElemTetr++; - + jElem++; + iElemTetr++; } /*--- Free memory as we go. ---*/ @@ -2399,7 +2278,6 @@ void CPhysicalGeometry::LoadVolumeElements(CConfig *config, CGeometry *geometry) Tetr_List.clear(); for (it = Hexa_List.begin(); it != Hexa_List.end(); it++) { - kElem = it->first; iElem = it->second; @@ -2408,27 +2286,21 @@ void CPhysicalGeometry::LoadVolumeElements(CConfig *config, CGeometry *geometry) NODES_PER_ELEMENT = N_POINTS_HEXAHEDRON; for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++) { - iGlobal_Index = Conn_Hexa[iElem*NODES_PER_ELEMENT+iNode]; + iGlobal_Index = Conn_Hexa[iElem * NODES_PER_ELEMENT + iNode]; Local_Nodes[iNode] = Global_to_Local_Point[iGlobal_Index]; } /*--- Create the element object. ---*/ - elem[jElem] = new CHexahedron(Local_Nodes[0], - Local_Nodes[1], - Local_Nodes[2], - Local_Nodes[3], - Local_Nodes[4], - Local_Nodes[5], - Local_Nodes[6], - Local_Nodes[7]); + elem[jElem] = new CHexahedron(Local_Nodes[0], Local_Nodes[1], Local_Nodes[2], Local_Nodes[3], Local_Nodes[4], + Local_Nodes[5], Local_Nodes[6], Local_Nodes[7]); elem[jElem]->SetGlobalIndex(kElem); /*--- Increment our local counters. ---*/ - jElem++; iElemHexa++; - + jElem++; + iElemHexa++; } /*--- Free memory as we go. ---*/ @@ -2436,7 +2308,6 @@ void CPhysicalGeometry::LoadVolumeElements(CConfig *config, CGeometry *geometry) Hexa_List.clear(); for (it = Pris_List.begin(); it != Pris_List.end(); it++) { - kElem = it->first; iElem = it->second; @@ -2445,25 +2316,21 @@ void CPhysicalGeometry::LoadVolumeElements(CConfig *config, CGeometry *geometry) NODES_PER_ELEMENT = N_POINTS_PRISM; for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++) { - iGlobal_Index = Conn_Pris[iElem*NODES_PER_ELEMENT+iNode]; + iGlobal_Index = Conn_Pris[iElem * NODES_PER_ELEMENT + iNode]; Local_Nodes[iNode] = Global_to_Local_Point[iGlobal_Index]; } /*--- Create the element object. ---*/ - elem[jElem] = new CPrism(Local_Nodes[0], - Local_Nodes[1], - Local_Nodes[2], - Local_Nodes[3], - Local_Nodes[4], - Local_Nodes[5]); + elem[jElem] = + new CPrism(Local_Nodes[0], Local_Nodes[1], Local_Nodes[2], Local_Nodes[3], Local_Nodes[4], Local_Nodes[5]); elem[jElem]->SetGlobalIndex(kElem); /*--- Increment our local counters. ---*/ - jElem++; iElemPris++; - + jElem++; + iElemPris++; } /*--- Free memory as we go. ---*/ @@ -2471,7 +2338,6 @@ void CPhysicalGeometry::LoadVolumeElements(CConfig *config, CGeometry *geometry) Pris_List.clear(); for (it = Pyra_List.begin(); it != Pyra_List.end(); it++) { - kElem = it->first; iElem = it->second; @@ -2480,24 +2346,20 @@ void CPhysicalGeometry::LoadVolumeElements(CConfig *config, CGeometry *geometry) NODES_PER_ELEMENT = N_POINTS_PYRAMID; for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++) { - iGlobal_Index = Conn_Pyra[iElem*NODES_PER_ELEMENT+iNode]; + iGlobal_Index = Conn_Pyra[iElem * NODES_PER_ELEMENT + iNode]; Local_Nodes[iNode] = Global_to_Local_Point[iGlobal_Index]; } /*--- Create the element object. ---*/ - elem[jElem] = new CPyramid(Local_Nodes[0], - Local_Nodes[1], - Local_Nodes[2], - Local_Nodes[3], - Local_Nodes[4]); + elem[jElem] = new CPyramid(Local_Nodes[0], Local_Nodes[1], Local_Nodes[2], Local_Nodes[3], Local_Nodes[4]); elem[jElem]->SetGlobalIndex(kElem); /*--- Increment our local counters. ---*/ - jElem++; iElemPyra++; - + jElem++; + iElemPyra++; } /*--- Free memory as we go. ---*/ @@ -2507,8 +2369,7 @@ void CPhysicalGeometry::LoadVolumeElements(CConfig *config, CGeometry *geometry) /*--- Communicate the number of each element type to all processors. These values are important for merging and writing output later. ---*/ - SU2_MPI::Allreduce(&Local_Elem, &Global_nElem, 1, - MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_Elem, &Global_nElem, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); if ((rank == MASTER_NODE) && (size > SINGLE_NODE)) cout << Global_nElem << " interior elements including halo cells. " << endl; @@ -2522,62 +2383,48 @@ void CPhysicalGeometry::LoadVolumeElements(CConfig *config, CGeometry *geometry) counters in the recv loop above (to make sure there aren't repeats). ---*/ nelem_triangle = iElemTria; - nelem_quad = iElemQuad; - nelem_tetra = iElemTetr; - nelem_hexa = iElemHexa; - nelem_prism = iElemPris; - nelem_pyramid = iElemPyra; + nelem_quad = iElemQuad; + nelem_tetra = iElemTetr; + nelem_hexa = iElemHexa; + nelem_prism = iElemPris; + nelem_pyramid = iElemPyra; #ifdef HAVE_MPI - unsigned long Local_nElemTri = nelem_triangle; - unsigned long Local_nElemQuad = nelem_quad; - unsigned long Local_nElemTet = nelem_tetra; - unsigned long Local_nElemHex = nelem_hexa; - unsigned long Local_nElemPrism = nelem_prism; + unsigned long Local_nElemTri = nelem_triangle; + unsigned long Local_nElemQuad = nelem_quad; + unsigned long Local_nElemTet = nelem_tetra; + unsigned long Local_nElemHex = nelem_hexa; + unsigned long Local_nElemPrism = nelem_prism; unsigned long Local_nElemPyramid = nelem_pyramid; - SU2_MPI::Allreduce(&Local_nElemTri, &Global_nelem_triangle, 1, - MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(&Local_nElemQuad, &Global_nelem_quad, 1, - MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(&Local_nElemTet, &Global_nelem_tetra, 1, - MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(&Local_nElemHex, &Global_nelem_hexa, 1, - MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(&Local_nElemPrism, &Global_nelem_prism, 1, - MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(&Local_nElemPyramid, &Global_nelem_pyramid, 1, - MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_nElemTri, &Global_nelem_triangle, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_nElemQuad, &Global_nelem_quad, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_nElemTet, &Global_nelem_tetra, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_nElemHex, &Global_nelem_hexa, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_nElemPrism, &Global_nelem_prism, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&Local_nElemPyramid, &Global_nelem_pyramid, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); #else Global_nelem_triangle = nelem_triangle; - Global_nelem_quad = nelem_quad; - Global_nelem_tetra = nelem_tetra; - Global_nelem_hexa = nelem_hexa; - Global_nelem_prism = nelem_prism; - Global_nelem_pyramid = nelem_pyramid; + Global_nelem_quad = nelem_quad; + Global_nelem_tetra = nelem_tetra; + Global_nelem_hexa = nelem_hexa; + Global_nelem_prism = nelem_prism; + Global_nelem_pyramid = nelem_pyramid; #endif /*--- Print information about the elements to the console ---*/ if (rank == MASTER_NODE) { - if (Global_nelem_triangle > 0) - cout << Global_nelem_triangle << " triangles." << endl; - if (Global_nelem_quad > 0) - cout << Global_nelem_quad << " quadrilaterals." << endl; - if (Global_nelem_tetra > 0) - cout << Global_nelem_tetra << " tetrahedra." << endl; - if (Global_nelem_hexa > 0) - cout << Global_nelem_hexa << " hexahedra." << endl; - if (Global_nelem_prism > 0) - cout << Global_nelem_prism << " prisms." << endl; - if (Global_nelem_pyramid > 0) - cout << Global_nelem_pyramid << " pyramids." << endl; + if (Global_nelem_triangle > 0) cout << Global_nelem_triangle << " triangles." << endl; + if (Global_nelem_quad > 0) cout << Global_nelem_quad << " quadrilaterals." << endl; + if (Global_nelem_tetra > 0) cout << Global_nelem_tetra << " tetrahedra." << endl; + if (Global_nelem_hexa > 0) cout << Global_nelem_hexa << " hexahedra." << endl; + if (Global_nelem_prism > 0) cout << Global_nelem_prism << " prisms." << endl; + if (Global_nelem_pyramid > 0) cout << Global_nelem_pyramid << " pyramids." << endl; } - } -void CPhysicalGeometry::LoadSurfaceElements(CConfig *config, CGeometry *geometry) { - +void CPhysicalGeometry::LoadSurfaceElements(CConfig* config, CGeometry* geometry) { unsigned short NODES_PER_ELEMENT; unsigned short iNode, nMarker_Max = config->GetnMarker_Max(); @@ -2600,22 +2447,19 @@ void CPhysicalGeometry::LoadSurfaceElements(CConfig *config, CGeometry *geometry counting the unique set. ---*/ for (iElem = 0; iElem < nLocal_Line; iElem++) { - if (find(Marker_Local.begin(), Marker_Local.end(), - ID_Line[iElem]) == Marker_Local.end()) { + if (find(Marker_Local.begin(), Marker_Local.end(), ID_Line[iElem]) == Marker_Local.end()) { Marker_Local.push_back(ID_Line[iElem]); } } for (iElem = 0; iElem < nLocal_BoundTria; iElem++) { - if (find(Marker_Local.begin(), Marker_Local.end(), - ID_BoundTria[iElem]) == Marker_Local.end()) { + if (find(Marker_Local.begin(), Marker_Local.end(), ID_BoundTria[iElem]) == Marker_Local.end()) { Marker_Local.push_back(ID_BoundTria[iElem]); } } for (iElem = 0; iElem < nLocal_BoundQuad; iElem++) { - if (find(Marker_Local.begin(), Marker_Local.end(), - ID_BoundQuad[iElem]) == Marker_Local.end()) { + if (find(Marker_Local.begin(), Marker_Local.end(), ID_BoundQuad[iElem]) == Marker_Local.end()) { Marker_Local.push_back(ID_BoundQuad[iElem]); } } @@ -2642,13 +2486,11 @@ void CPhysicalGeometry::LoadSurfaceElements(CConfig *config, CGeometry *geometry vector nElemBound_Local; nElemBound_Local.resize(Marker_Local.size()); - for (iMarker = 0; iMarker < Marker_Local.size(); iMarker++) - nElemBound_Local[iMarker] = 0; + for (iMarker = 0; iMarker < Marker_Local.size(); iMarker++) nElemBound_Local[iMarker] = 0; for (iElem = 0; iElem < nLocal_Line; iElem++) { iMarker = Marker_Global_to_Local[ID_Line[iElem]]; - if (find(Line_List[iMarker].begin(), Line_List[iMarker].end(), - Elem_ID_Line[iElem]) == Line_List[iMarker].end()) { + if (find(Line_List[iMarker].begin(), Line_List[iMarker].end(), Elem_ID_Line[iElem]) == Line_List[iMarker].end()) { nElemBound_Local[iMarker]++; Line_List[iMarker].push_back(Elem_ID_Line[iElem]); } @@ -2656,8 +2498,8 @@ void CPhysicalGeometry::LoadSurfaceElements(CConfig *config, CGeometry *geometry for (iElem = 0; iElem < nLocal_BoundTria; iElem++) { iMarker = Marker_Global_to_Local[ID_BoundTria[iElem]]; - if (find(BoundTria_List[iMarker].begin(), BoundTria_List[iMarker].end(), - Elem_ID_BoundTria[iElem]) == BoundTria_List[iMarker].end()) { + if (find(BoundTria_List[iMarker].begin(), BoundTria_List[iMarker].end(), Elem_ID_BoundTria[iElem]) == + BoundTria_List[iMarker].end()) { nElemBound_Local[iMarker]++; BoundTria_List[iMarker].push_back(Elem_ID_BoundTria[iElem]); } @@ -2665,8 +2507,8 @@ void CPhysicalGeometry::LoadSurfaceElements(CConfig *config, CGeometry *geometry for (iElem = 0; iElem < nLocal_BoundQuad; iElem++) { iMarker = Marker_Global_to_Local[ID_BoundQuad[iElem]]; - if (find(BoundQuad_List[iMarker].begin(), BoundQuad_List[iMarker].end(), - Elem_ID_BoundQuad[iElem]) == BoundQuad_List[iMarker].end()) { + if (find(BoundQuad_List[iMarker].begin(), BoundQuad_List[iMarker].end(), Elem_ID_BoundQuad[iElem]) == + BoundQuad_List[iMarker].end()) { nElemBound_Local[iMarker]++; BoundQuad_List[iMarker].push_back(Elem_ID_BoundQuad[iElem]); } @@ -2676,22 +2518,19 @@ void CPhysicalGeometry::LoadSurfaceElements(CConfig *config, CGeometry *geometry with nMarkerMax here, but come back and compute size we need. Same for OVERHEAD - this can precomputed. ---*/ - nMarker = Marker_Local.size(); - nElem_Bound = new unsigned long[nMarker_Max]; - Tag_to_Marker = new string[nMarker_Max]; + nMarker = Marker_Local.size(); + nElem_Bound = new unsigned long[nMarker_Max]; + Tag_to_Marker = new string[nMarker_Max]; Marker_All_SendRecv = new short[nMarker_Max]; /*--- Allocate space for the elements on each marker ---*/ - for (iMarker = 0; iMarker < nMarker; iMarker++) - nElem_Bound[iMarker] = nElemBound_Local[iMarker]; + for (iMarker = 0; iMarker < nMarker; iMarker++) nElem_Bound[iMarker] = nElemBound_Local[iMarker]; - bound = new CPrimalGrid**[nMarker+(OVERHEAD*size)]; - for (iMarker = 0; iMarker < nMarker+(OVERHEAD*size); iMarker++) - bound[iMarker] = nullptr; + bound = new CPrimalGrid**[nMarker + (OVERHEAD * size)]; + for (iMarker = 0; iMarker < nMarker + (OVERHEAD * size); iMarker++) bound[iMarker] = nullptr; - for (iMarker = 0; iMarker < nMarker; iMarker++) - bound[iMarker] = new CPrimalGrid*[nElem_Bound[iMarker]]; + for (iMarker = 0; iMarker < nMarker; iMarker++) bound[iMarker] = new CPrimalGrid*[nElem_Bound[iMarker]]; /*--- Initialize boundary element counters ---*/ @@ -2699,134 +2538,123 @@ void CPhysicalGeometry::LoadSurfaceElements(CConfig *config, CGeometry *geometry iElem_Tria = 0; iElem_Quad = 0; - Line_List.clear(); Line_List.resize(Marker_Local.size()); - BoundTria_List.clear(); BoundTria_List.resize(Marker_Local.size()); - BoundQuad_List.clear(); BoundQuad_List.resize(Marker_Local.size()); + Line_List.clear(); + Line_List.resize(Marker_Local.size()); + BoundTria_List.clear(); + BoundTria_List.resize(Marker_Local.size()); + BoundQuad_List.clear(); + BoundQuad_List.resize(Marker_Local.size()); /*--- Reset our element counter on a marker-basis. ---*/ - for (iMarker = 0; iMarker < nMarker; iMarker++) - nElemBound_Local[iMarker] = 0; + for (iMarker = 0; iMarker < nMarker; iMarker++) nElemBound_Local[iMarker] = 0; /*--- Store the boundary element connectivity. Note here that we have communicated the global index values for the elements, so we need to convert this to the local index when instantiating the element. ---*/ for (iElem = 0; iElem < nLocal_Line; iElem++) { - iMarker = Marker_Global_to_Local[ID_Line[iElem]]; /*--- Avoid duplicates on this marker. ---*/ - if (find(Line_List[iMarker].begin(), Line_List[iMarker].end(), - Elem_ID_Line[iElem]) == Line_List[iMarker].end()) { - + if (find(Line_List[iMarker].begin(), Line_List[iMarker].end(), Elem_ID_Line[iElem]) == Line_List[iMarker].end()) { /*--- Transform the stored connectivity for this element from global to local values on this rank. ---*/ NODES_PER_ELEMENT = N_POINTS_LINE; for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++) { - iGlobal_Index = Conn_Line[iElem*NODES_PER_ELEMENT+iNode]; + iGlobal_Index = Conn_Line[iElem * NODES_PER_ELEMENT + iNode]; Local_Nodes[iNode] = Global_to_Local_Point[iGlobal_Index]; } /*--- Create the geometry object for this element. ---*/ - bound[iMarker][nElemBound_Local[iMarker]] = new CLine(Local_Nodes[0], - Local_Nodes[1]); + bound[iMarker][nElemBound_Local[iMarker]] = new CLine(Local_Nodes[0], Local_Nodes[1]); /*--- Increment our counters for this marker and element type. ---*/ - nElemBound_Local[iMarker]++; iElem_Line++; + nElemBound_Local[iMarker]++; + iElem_Line++; Line_List[iMarker].push_back(Elem_ID_Line[iElem]); - } } for (iElem = 0; iElem < nLocal_BoundTria; iElem++) { - iMarker = Marker_Global_to_Local[ID_BoundTria[iElem]]; /*--- Avoid duplicates on this marker. ---*/ - if (find(BoundTria_List[iMarker].begin(), BoundTria_List[iMarker].end(), - Elem_ID_BoundTria[iElem]) == BoundTria_List[iMarker].end()) { - + if (find(BoundTria_List[iMarker].begin(), BoundTria_List[iMarker].end(), Elem_ID_BoundTria[iElem]) == + BoundTria_List[iMarker].end()) { /*--- Transform the stored connectivity for this element from global to local values on this rank. ---*/ NODES_PER_ELEMENT = N_POINTS_TRIANGLE; for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++) { - iGlobal_Index = Conn_BoundTria[iElem*NODES_PER_ELEMENT+iNode]; + iGlobal_Index = Conn_BoundTria[iElem * NODES_PER_ELEMENT + iNode]; Local_Nodes[iNode] = Global_to_Local_Point[iGlobal_Index]; } /*--- Create the geometry object for this element. ---*/ - bound[iMarker][nElemBound_Local[iMarker]] = new CTriangle(Local_Nodes[0], - Local_Nodes[1], - Local_Nodes[2]); + bound[iMarker][nElemBound_Local[iMarker]] = new CTriangle(Local_Nodes[0], Local_Nodes[1], Local_Nodes[2]); /*--- Increment our counters for this marker and element type. ---*/ - nElemBound_Local[iMarker]++; iElem_Tria++; + nElemBound_Local[iMarker]++; + iElem_Tria++; BoundTria_List[iMarker].push_back(Elem_ID_BoundTria[iElem]); - } } for (iElem = 0; iElem < nLocal_BoundQuad; iElem++) { - iMarker = Marker_Global_to_Local[ID_BoundQuad[iElem]]; /*--- Avoid duplicates on this marker. ---*/ - if (find(BoundQuad_List[iMarker].begin(), BoundQuad_List[iMarker].end(), - Elem_ID_BoundQuad[iElem]) == BoundQuad_List[iMarker].end()) { - + if (find(BoundQuad_List[iMarker].begin(), BoundQuad_List[iMarker].end(), Elem_ID_BoundQuad[iElem]) == + BoundQuad_List[iMarker].end()) { /*--- Transform the stored connectivity for this element from global to local values on this rank. ---*/ NODES_PER_ELEMENT = N_POINTS_QUADRILATERAL; for (iNode = 0; iNode < NODES_PER_ELEMENT; iNode++) { - iGlobal_Index = Conn_BoundQuad[iElem*NODES_PER_ELEMENT+iNode]; + iGlobal_Index = Conn_BoundQuad[iElem * NODES_PER_ELEMENT + iNode]; Local_Nodes[iNode] = Global_to_Local_Point[iGlobal_Index]; } /*--- Create the geometry object for this element. ---*/ - bound[iMarker][nElemBound_Local[iMarker]] = new CQuadrilateral(Local_Nodes[0], - Local_Nodes[1], - Local_Nodes[2], - Local_Nodes[3]); + bound[iMarker][nElemBound_Local[iMarker]] = + new CQuadrilateral(Local_Nodes[0], Local_Nodes[1], Local_Nodes[2], Local_Nodes[3]); /*--- Increment our counters for this marker and element type. ---*/ - nElemBound_Local[iMarker]++; iElem_Quad++; + nElemBound_Local[iMarker]++; + iElem_Quad++; BoundQuad_List[iMarker].push_back(Elem_ID_BoundQuad[iElem]); - } } /*--- Store total number of each boundary element type ---*/ - nelem_edge_bound = iElem_Line; + nelem_edge_bound = iElem_Line; nelem_triangle_bound = iElem_Tria; - nelem_quad_bound = iElem_Quad; + nelem_quad_bound = iElem_Quad; /*--- Set some auxiliary information on a per-marker basis. ---*/ for (iMarker = 0; iMarker < nMarker; iMarker++) { - Global_Marker = Marker_Local_to_Global[iMarker]; /*--- Now each domain has the right information ---*/ string Grid_Marker = config->GetMarker_All_TagBound(Global_Marker); - short SendRecv = config->GetMarker_All_SendRecv(Global_Marker); + short SendRecv = config->GetMarker_All_SendRecv(Global_Marker); Tag_to_Marker[iMarker] = Marker_Tags[Global_Marker]; Marker_All_SendRecv[iMarker] = SendRecv; @@ -2835,49 +2663,41 @@ void CPhysicalGeometry::LoadSurfaceElements(CConfig *config, CGeometry *geometry config->SetMarker_All_TagBound(iMarker, Tag_to_Marker[iMarker]); config->SetMarker_All_SendRecv(iMarker, Marker_All_SendRecv[iMarker]); - } /*--- Initialize pointers for turbomachinery computations ---*/ - nSpanWiseSections = new unsigned short[2] (); - SpanWiseValue = new su2double*[2] (); - - nSpanSectionsByMarker = new unsigned short[nMarker] (); - nVertexSpan = new long* [nMarker] (); - nTotVertexSpan = new unsigned long* [nMarker] (); - turbovertex = new CTurboVertex***[nMarker] (); - AverageTurboNormal = new su2double**[nMarker] (); - AverageNormal = new su2double**[nMarker] (); - AverageGridVel = new su2double**[nMarker] (); - AverageTangGridVel = new su2double*[nMarker] (); - SpanArea = new su2double*[nMarker] (); - TurboRadius = new su2double*[nMarker] (); - MaxAngularCoord = new su2double*[nMarker] (); - MinAngularCoord = new su2double*[nMarker] (); - MinRelAngularCoord = new su2double*[nMarker] (); + nSpanWiseSections = new unsigned short[2](); + SpanWiseValue = new su2double*[2](); + + nSpanSectionsByMarker = new unsigned short[nMarker](); + nVertexSpan = new long*[nMarker](); + nTotVertexSpan = new unsigned long*[nMarker](); + turbovertex = new CTurboVertex***[nMarker](); + AverageTurboNormal = new su2double**[nMarker](); + AverageNormal = new su2double**[nMarker](); + AverageGridVel = new su2double**[nMarker](); + AverageTangGridVel = new su2double*[nMarker](); + SpanArea = new su2double*[nMarker](); + TurboRadius = new su2double*[nMarker](); + MaxAngularCoord = new su2double*[nMarker](); + MinAngularCoord = new su2double*[nMarker](); + MinRelAngularCoord = new su2double*[nMarker](); /*--- Initialize pointers for turbomachinery performance computation ---*/ - nTurboPerf = config->GetnMarker_TurboPerformance(); - TangGridVelIn = new su2double*[nTurboPerf] (); - SpanAreaIn = new su2double*[nTurboPerf] (); - TurboRadiusIn = new su2double*[nTurboPerf] (); - TangGridVelOut = new su2double*[nTurboPerf] (); - SpanAreaOut = new su2double*[nTurboPerf] (); - TurboRadiusOut = new su2double*[nTurboPerf] (); - + nTurboPerf = config->GetnMarker_TurboPerformance(); + TangGridVelIn = new su2double*[nTurboPerf](); + SpanAreaIn = new su2double*[nTurboPerf](); + TurboRadiusIn = new su2double*[nTurboPerf](); + TangGridVelOut = new su2double*[nTurboPerf](); + SpanAreaOut = new su2double*[nTurboPerf](); + TurboRadiusOut = new su2double*[nTurboPerf](); } -void CPhysicalGeometry::InitiateCommsAll(void *bufSend, - const int *nElemSend, - SU2_MPI::Request *sendReq, - void *bufRecv, - const int *nElemRecv, - SU2_MPI::Request *recvReq, - unsigned short countPerElem, +void CPhysicalGeometry::InitiateCommsAll(void* bufSend, const int* nElemSend, SU2_MPI::Request* sendReq, void* bufRecv, + const int* nElemRecv, SU2_MPI::Request* recvReq, unsigned short countPerElem, unsigned short commType) { - /*--- Local variables ---*/ int iMessage, iProc, offset, nElem, count, source, dest, tag; @@ -2886,64 +2706,56 @@ void CPhysicalGeometry::InitiateCommsAll(void *bufSend, iMessage = 0; for (iProc = 0; iProc < size; iProc++) { - /*--- Post recv's only if another proc is sending us data. We do not communicate with ourselves or post recv's for zero length messages to keep overhead down. ---*/ - if ((nElemRecv[iProc+1] > nElemRecv[iProc]) && (iProc != rank)) { - + if ((nElemRecv[iProc + 1] > nElemRecv[iProc]) && (iProc != rank)) { /*--- Compute our location in the recv buffer. ---*/ - offset = countPerElem*nElemRecv[iProc]; + offset = countPerElem * nElemRecv[iProc]; /*--- Take advantage of cumulative storage format to get the number of elems that we need to recv. ---*/ - nElem = nElemRecv[iProc+1] - nElemRecv[iProc]; + nElem = nElemRecv[iProc + 1] - nElemRecv[iProc]; /*--- Total count can include multiple pieces of data per element. ---*/ - count = countPerElem*nElem; + count = countPerElem * nElem; /*--- Post non-blocking recv for this proc. ---*/ - source = iProc; tag = iProc + 1; + source = iProc; + tag = iProc + 1; switch (commType) { case COMM_TYPE_DOUBLE: - SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_DOUBLE, source, tag, SU2_MPI::GetComm(), - &(recvReq[iMessage])); + SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), count, MPI_DOUBLE, source, tag, + SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_UNSIGNED_LONG: - SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_UNSIGNED_LONG, source, tag, SU2_MPI::GetComm(), - &(recvReq[iMessage])); + SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), count, MPI_UNSIGNED_LONG, source, tag, + SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_LONG: - SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_LONG, source, tag, SU2_MPI::GetComm(), + SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), count, MPI_LONG, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_UNSIGNED_SHORT: - SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_UNSIGNED_SHORT, source, tag, SU2_MPI::GetComm(), - &(recvReq[iMessage])); + SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), count, MPI_UNSIGNED_SHORT, source, tag, + SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_CHAR: - SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_CHAR, source, tag, SU2_MPI::GetComm(), + SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), count, MPI_CHAR, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_SHORT: - SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_SHORT, source, tag, SU2_MPI::GetComm(), + SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), count, MPI_SHORT, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_INT: - SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_INT, source, tag, SU2_MPI::GetComm(), + SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), count, MPI_INT, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; default: @@ -2953,7 +2765,6 @@ void CPhysicalGeometry::InitiateCommsAll(void *bufSend, /*--- Increment message counter. ---*/ iMessage++; - } } @@ -2961,64 +2772,56 @@ void CPhysicalGeometry::InitiateCommsAll(void *bufSend, iMessage = 0; for (iProc = 0; iProc < size; iProc++) { - /*--- Post sends only if we are sending another proc data. We do not communicate with ourselves or post sends for zero length messages to keep overhead down. ---*/ - if ((nElemSend[iProc+1] > nElemSend[iProc]) && (iProc != rank)) { - + if ((nElemSend[iProc + 1] > nElemSend[iProc]) && (iProc != rank)) { /*--- Compute our location in the send buffer. ---*/ - offset = countPerElem*nElemSend[iProc]; + offset = countPerElem * nElemSend[iProc]; /*--- Take advantage of cumulative storage format to get the number of elems that we need to send. ---*/ - nElem = nElemSend[iProc+1] - nElemSend[iProc]; + nElem = nElemSend[iProc + 1] - nElemSend[iProc]; /*--- Total count can include multiple pieces of data per element. ---*/ - count = countPerElem*nElem; + count = countPerElem * nElem; /*--- Post non-blocking send for this proc. ---*/ - dest = iProc; tag = rank + 1; + dest = iProc; + tag = rank + 1; switch (commType) { case COMM_TYPE_DOUBLE: - SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_DOUBLE, dest, tag, SU2_MPI::GetComm(), + SU2_MPI::Isend(&(static_cast(bufSend)[offset]), count, MPI_DOUBLE, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_UNSIGNED_LONG: - SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_UNSIGNED_LONG, dest, tag, SU2_MPI::GetComm(), - &(sendReq[iMessage])); + SU2_MPI::Isend(&(static_cast(bufSend)[offset]), count, MPI_UNSIGNED_LONG, dest, tag, + SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_LONG: - SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_LONG, dest, tag, SU2_MPI::GetComm(), + SU2_MPI::Isend(&(static_cast(bufSend)[offset]), count, MPI_LONG, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_UNSIGNED_SHORT: - SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_UNSIGNED_SHORT, dest, tag, SU2_MPI::GetComm(), - &(sendReq[iMessage])); + SU2_MPI::Isend(&(static_cast(bufSend)[offset]), count, MPI_UNSIGNED_SHORT, dest, tag, + SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_CHAR: - SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_CHAR, dest, tag, SU2_MPI::GetComm(), + SU2_MPI::Isend(&(static_cast(bufSend)[offset]), count, MPI_CHAR, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_SHORT: - SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_SHORT, dest, tag, SU2_MPI::GetComm(), + SU2_MPI::Isend(&(static_cast(bufSend)[offset]), count, MPI_SHORT, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_INT: - SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_INT, dest, tag, SU2_MPI::GetComm(), + SU2_MPI::Isend(&(static_cast(bufSend)[offset]), count, MPI_INT, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; default: @@ -3028,17 +2831,11 @@ void CPhysicalGeometry::InitiateCommsAll(void *bufSend, /*--- Increment message counter. ---*/ iMessage++; - } } - } -void CPhysicalGeometry::CompleteCommsAll(int nSends, - SU2_MPI::Request *sendReq, - int nRecvs, - SU2_MPI::Request *recvReq) { - +void CPhysicalGeometry::CompleteCommsAll(int nSends, SU2_MPI::Request* sendReq, int nRecvs, SU2_MPI::Request* recvReq) { /*--- Local variables ---*/ int ind, iSend, iRecv; @@ -3046,18 +2843,14 @@ void CPhysicalGeometry::CompleteCommsAll(int nSends, /*--- Wait for the non-blocking sends to complete. ---*/ - for (iSend = 0; iSend < nSends; iSend++) - SU2_MPI::Waitany(nSends, sendReq, &ind, &status); + for (iSend = 0; iSend < nSends; iSend++) SU2_MPI::Waitany(nSends, sendReq, &ind, &status); /*--- Wait for the non-blocking recvs to complete. ---*/ - for (iRecv = 0; iRecv < nRecvs; iRecv++) - SU2_MPI::Waitany(nRecvs, recvReq, &ind, &status); - + for (iRecv = 0; iRecv < nRecvs; iRecv++) SU2_MPI::Waitany(nRecvs, recvReq, &ind, &status); } void CPhysicalGeometry::PrepareOffsets(unsigned long val_npoint_global) { - /*--- Compute the number of points that will be on each processor. This is a linear partitioning with the addition of a simple load balancing for any remainder points. ---*/ @@ -3065,11 +2858,11 @@ void CPhysicalGeometry::PrepareOffsets(unsigned long val_npoint_global) { if (beg_node == nullptr) beg_node = new unsigned long[size]; if (end_node == nullptr) end_node = new unsigned long[size]; - if (nPointLinear == nullptr) nPointLinear = new unsigned long[size]; - if (nPointCumulative == nullptr) nPointCumulative = new unsigned long[size+1]; + if (nPointLinear == nullptr) nPointLinear = new unsigned long[size]; + if (nPointCumulative == nullptr) nPointCumulative = new unsigned long[size + 1]; - unsigned long quotient = val_npoint_global/size; - int remainder = int(val_npoint_global%size); + unsigned long quotient = val_npoint_global / size; + int remainder = int(val_npoint_global % size); for (int ii = 0; ii < size; ii++) { nPointLinear[ii] = quotient + int(ii < remainder); } @@ -3082,63 +2875,54 @@ void CPhysicalGeometry::PrepareOffsets(unsigned long val_npoint_global) { end_node[0] = beg_node[0] + nPointLinear[0]; nPointCumulative[0] = 0; for (int iProc = 1; iProc < size; iProc++) { - beg_node[iProc] = end_node[iProc-1]; + beg_node[iProc] = end_node[iProc - 1]; end_node[iProc] = beg_node[iProc] + nPointLinear[iProc]; - nPointCumulative[iProc] = nPointCumulative[iProc-1] + nPointLinear[iProc-1]; + nPointCumulative[iProc] = nPointCumulative[iProc - 1] + nPointLinear[iProc - 1]; } nPointCumulative[size] = val_npoint_global; - } unsigned long CPhysicalGeometry::GetLinearPartition(unsigned long val_global_index) { - unsigned long iProcessor = 0; /*--- Initial guess ---*/ - iProcessor = val_global_index/nPointLinear[0]; + iProcessor = val_global_index / nPointLinear[0]; /*--- Guard against going over size. ---*/ - if (iProcessor >= (unsigned long)size) - iProcessor = (unsigned long)size-1; + if (iProcessor >= (unsigned long)size) iProcessor = (unsigned long)size - 1; /*--- Move up or down until we find the processor. ---*/ if (val_global_index >= nPointCumulative[iProcessor]) - while(val_global_index >= nPointCumulative[iProcessor+1]) - iProcessor++; + while (val_global_index >= nPointCumulative[iProcessor + 1]) iProcessor++; else - while(val_global_index < nPointCumulative[iProcessor]) - iProcessor--; + while (val_global_index < nPointCumulative[iProcessor]) iProcessor--; return iProcessor; - } -void CPhysicalGeometry::SortAdjacency(const CConfig *config) { - +void CPhysicalGeometry::SortAdjacency(const CConfig* config) { #ifdef HAVE_MPI #ifdef HAVE_PARMETIS - if ((rank == MASTER_NODE) && (size > SINGLE_NODE)) - cout << "Executing the partitioning functions." << endl; + if ((rank == MASTER_NODE) && (size > SINGLE_NODE)) cout << "Executing the partitioning functions." << endl; /*--- Post process the adjacency information in order to get it into the CSR format before sending the data to ParMETIS. We need to remove repeats and adjust the size of the array for each local node. ---*/ - if ((rank == MASTER_NODE) && (size > SINGLE_NODE)) - cout << "Building the graph adjacency structure." << endl; + if ((rank == MASTER_NODE) && (size > SINGLE_NODE)) cout << "Building the graph adjacency structure." << endl; /*--- Create a partitioner object so we can transform the global index values stored in the elements to a local index. ---*/ - CLinearPartitioner pointPartitioner(Global_nPointDomain,0); + CLinearPartitioner pointPartitioner(Global_nPointDomain, 0); /*--- We can already create the array that indexes the adjacency. ---*/ - xadj.resize(pointPartitioner.GetSizeOnRank(rank)+1); + xadj.resize(pointPartitioner.GetSizeOnRank(rank) + 1); xadj[0] = 0; /*--- Here, we transfer the adjacency information from a multi-dim vector @@ -3172,7 +2956,7 @@ void CPhysicalGeometry::SortAdjacency(const CConfig *config) { for (auto jPoint : neighbors) adjacency.push_back(jPoint); /*--- Increment the starting index for the next point (CSR). ---*/ - xadj[iPoint+1] = xadj[iPoint] + neighbors.size(); + xadj[iPoint + 1] = xadj[iPoint] + neighbors.size(); ++iPoint; } @@ -3182,28 +2966,29 @@ void CPhysicalGeometry::SortAdjacency(const CConfig *config) { #endif #endif - } -void CPhysicalGeometry::SetSendReceive(const CConfig *config) { - +void CPhysicalGeometry::SetSendReceive(const CConfig* config) { unsigned short Counter_Send, Counter_Receive, iMarkerSend, iMarkerReceive; unsigned long iVertex, LocalNode; unsigned short nMarker_Max = config->GetnMarker_Max(); - unsigned long iPoint, jPoint, iElem, nDomain, iDomain, jDomain; - unsigned long *nVertexDomain = new unsigned long[nMarker_Max]; + unsigned long iPoint, jPoint, iElem, nDomain, iDomain, jDomain; + auto* nVertexDomain = new unsigned long[nMarker_Max]; unsigned short iNode, jNode; vector::iterator it; - vector > SendTransfLocal; /*!< \brief Vector to store the type of transformation for this send point. */ - vector > ReceivedTransfLocal; /*!< \brief Vector to store the type of transformation for this received point. */ - vector > SendDomainLocal; /*!< \brief SendDomain[from domain][to domain] and return the point index of the node that must me sended. */ - vector > ReceivedDomainLocal; /*!< \brief SendDomain[from domain][to domain] and return the point index of the node that must me sended. */ + vector > + SendTransfLocal; /*!< \brief Vector to store the type of transformation for this send point. */ + vector > + ReceivedTransfLocal; /*!< \brief Vector to store the type of transformation for this received point. */ + vector > SendDomainLocal; /*!< \brief SendDomain[from domain][to domain] and return the point + index of the node that must me sended. */ + vector > ReceivedDomainLocal; /*!< \brief SendDomain[from domain][to domain] and return the + point index of the node that must me sended. */ unordered_map::const_iterator MI; - if (rank == MASTER_NODE && size > SINGLE_NODE) - cout << "Establishing MPI communication patterns." << endl; + if (rank == MASTER_NODE && size > SINGLE_NODE) cout << "Establishing MPI communication patterns." << endl; nDomain = size; @@ -3218,21 +3003,18 @@ void CPhysicalGeometry::SetSendReceive(const CConfig *config) { for (iElem = 0; iElem < nElem; iElem++) { for (iNode = 0; iNode < elem[iElem]->GetnNodes(); iNode++) { - - iPoint = elem[iElem]->GetNode(iNode); + iPoint = elem[iElem]->GetNode(iNode); iDomain = nodes->GetColor(iPoint); - if (iDomain == (unsigned long) rank) { + if (iDomain == (unsigned long)rank) { for (jNode = 0; jNode < elem[iElem]->GetnNodes(); jNode++) { - - jPoint = elem[iElem]->GetNode(jNode); + jPoint = elem[iElem]->GetNode(jNode); jDomain = nodes->GetColor(jPoint); /*--- If one of the neighbors is a different color and connected by an edge, then we add them to the list. ---*/ if (iDomain != jDomain) { - /*--- We send from iDomain to jDomain the value of iPoint, we save the global value becuase we need to sort the lists. ---*/ @@ -3242,7 +3024,6 @@ void CPhysicalGeometry::SetSendReceive(const CConfig *config) { we save the global value becuase we need to sort the lists. ---*/ ReceivedDomainLocal[jDomain].push_back(Local_to_Global_Point[jPoint]); - } } } @@ -3263,7 +3044,7 @@ void CPhysicalGeometry::SetSendReceive(const CConfig *config) { for (iDomain = 0; iDomain < nDomain; iDomain++) { sort(ReceivedDomainLocal[iDomain].begin(), ReceivedDomainLocal[iDomain].end()); - it = unique( ReceivedDomainLocal[iDomain].begin(), ReceivedDomainLocal[iDomain].end()); + it = unique(ReceivedDomainLocal[iDomain].begin(), ReceivedDomainLocal[iDomain].end()); ReceivedDomainLocal[iDomain].resize(it - ReceivedDomainLocal[iDomain].begin()); } @@ -3271,26 +3052,24 @@ void CPhysicalGeometry::SetSendReceive(const CConfig *config) { number of points in the simulation ---*/ Max_GlobalPoint = 0; for (iPoint = 0; iPoint < nPoint; iPoint++) { - if (Local_to_Global_Point[iPoint] > (long)Max_GlobalPoint) - Max_GlobalPoint = Local_to_Global_Point[iPoint]; + if (Local_to_Global_Point[iPoint] > (long)Max_GlobalPoint) Max_GlobalPoint = Local_to_Global_Point[iPoint]; } /*--- Set the value of some of the points ---*/ - for (iPoint = 0; iPoint < nPoint; iPoint++) - Global_to_Local_Point[Local_to_Global_Point[iPoint]] = iPoint; + for (iPoint = 0; iPoint < nPoint; iPoint++) Global_to_Local_Point[Local_to_Global_Point[iPoint]] = iPoint; /*--- Add the new MPI send boundaries, reset the transformation, and save the local value. ---*/ for (iDomain = 0; iDomain < nDomain; iDomain++) { - if (SendDomainLocal[iDomain].size() != 0) { + if (!SendDomainLocal[iDomain].empty()) { nVertexDomain[nMarker] = SendDomainLocal[iDomain].size(); for (iVertex = 0; iVertex < nVertexDomain[nMarker]; iVertex++) { - MI = Global_to_Local_Point.find(SendDomainLocal[iDomain][iVertex]); if (MI != Global_to_Local_Point.end()) iPoint = Global_to_Local_Point[SendDomainLocal[iDomain][iVertex]]; - else iPoint = std::numeric_limits::max(); + else + iPoint = std::numeric_limits::max(); SendDomainLocal[iDomain][iVertex] = iPoint; SendTransfLocal[iDomain].push_back(0); @@ -3303,14 +3082,14 @@ void CPhysicalGeometry::SetSendReceive(const CConfig *config) { /*--- Add the new MPI receive boundaries, reset the transformation, and save the local value ---*/ for (iDomain = 0; iDomain < nDomain; iDomain++) { - if (ReceivedDomainLocal[iDomain].size() != 0) { + if (!ReceivedDomainLocal[iDomain].empty()) { nVertexDomain[nMarker] = ReceivedDomainLocal[iDomain].size(); for (iVertex = 0; iVertex < nVertexDomain[nMarker]; iVertex++) { - MI = Global_to_Local_Point.find(ReceivedDomainLocal[iDomain][iVertex]); if (MI != Global_to_Local_Point.end()) iPoint = Global_to_Local_Point[ReceivedDomainLocal[iDomain][iVertex]]; - else iPoint = std::numeric_limits::max(); + else + iPoint = std::numeric_limits::max(); ReceivedDomainLocal[iDomain][iVertex] = iPoint; ReceivedTransfLocal[iDomain].push_back(0); @@ -3322,59 +3101,59 @@ void CPhysicalGeometry::SetSendReceive(const CConfig *config) { } /*--- First compute the Send/Receive boundaries ---*/ - Counter_Send = 0; Counter_Receive = 0; + Counter_Send = 0; + Counter_Receive = 0; for (iDomain = 0; iDomain < nDomain; iDomain++) - if (SendDomainLocal[iDomain].size() != 0) Counter_Send++; + if (!SendDomainLocal[iDomain].empty()) Counter_Send++; for (iDomain = 0; iDomain < nDomain; iDomain++) - if (ReceivedDomainLocal[iDomain].size() != 0) Counter_Receive++; + if (!ReceivedDomainLocal[iDomain].empty()) Counter_Receive++; - iMarkerSend = nMarker - Counter_Send - Counter_Receive; + iMarkerSend = nMarker - Counter_Send - Counter_Receive; iMarkerReceive = nMarker - Counter_Receive; /*--- First we do the send ---*/ for (iDomain = 0; iDomain < nDomain; iDomain++) { - if (SendDomainLocal[iDomain].size() != 0) { + if (!SendDomainLocal[iDomain].empty()) { for (iVertex = 0; iVertex < GetnElem_Bound(iMarkerSend); iVertex++) { LocalNode = SendDomainLocal[iDomain][iVertex]; bound[iMarkerSend][iVertex] = new CVertexMPI(LocalNode); bound[iMarkerSend][iVertex]->SetRotation_Type(SendTransfLocal[iDomain][iVertex]); } - Marker_All_SendRecv[iMarkerSend] = iDomain+1; + Marker_All_SendRecv[iMarkerSend] = iDomain + 1; iMarkerSend++; } } /*--- Second we do the receive ---*/ for (iDomain = 0; iDomain < nDomain; iDomain++) { - if (ReceivedDomainLocal[iDomain].size() != 0) { + if (!ReceivedDomainLocal[iDomain].empty()) { for (iVertex = 0; iVertex < GetnElem_Bound(iMarkerReceive); iVertex++) { LocalNode = ReceivedDomainLocal[iDomain][iVertex]; bound[iMarkerReceive][iVertex] = new CVertexMPI(LocalNode); bound[iMarkerReceive][iVertex]->SetRotation_Type(ReceivedTransfLocal[iDomain][iVertex]); } - Marker_All_SendRecv[iMarkerReceive] = -(iDomain+1); + Marker_All_SendRecv[iMarkerReceive] = -(iDomain + 1); iMarkerReceive++; } } /*--- Free memory ---*/ - delete [] nVertexDomain; - + delete[] nVertexDomain; } -void CPhysicalGeometry::SetBoundaries(CConfig *config) { - +void CPhysicalGeometry::SetBoundaries(CConfig* config) { unsigned long iElem_Bound, TotalElem, *nElem_Bound_Copy, iVertex_; string Grid_Marker; - unsigned short iDomain, nDomain, iMarkersDomain, iLoop, *DomainCount, nMarker_Physical, Duplicate_SendReceive, *DomainSendCount, - **DomainSendMarkers, *DomainReceiveCount, **DomainReceiveMarkers, nMarker_SendRecv, iMarker, iMarker_; + unsigned short iDomain, nDomain, iMarkersDomain, iLoop, *DomainCount, nMarker_Physical, Duplicate_SendReceive, + *DomainSendCount, **DomainSendMarkers, *DomainReceiveCount, **DomainReceiveMarkers, nMarker_SendRecv, iMarker, + iMarker_; CPrimalGrid*** bound_Copy; - short *Marker_All_SendRecv_Copy; + short* Marker_All_SendRecv_Copy; bool CheckStart; - nDomain = size+1; + nDomain = size + 1; /*--- Count the number of physical markers in the boundaries ---*/ @@ -3391,19 +3170,16 @@ void CPhysicalGeometry::SetBoundaries(CConfig *config) { Duplicate_SendReceive = 0; for (iLoop = 0; iLoop < 2; iLoop++) { + DomainCount = new unsigned short[nDomain]; - DomainCount = new unsigned short [nDomain]; - - for (iDomain = 0; iDomain < nDomain; iDomain++) - DomainCount[iDomain] = 0; + for (iDomain = 0; iDomain < nDomain; iDomain++) DomainCount[iDomain] = 0; if (iLoop == 0) { for (iDomain = 0; iDomain < nDomain; iDomain++) for (iMarker = 0; iMarker < nMarker; iMarker++) if (bound[iMarker][0]->GetVTK_Type() == VERTEX) if (Marker_All_SendRecv[iMarker] == iDomain) DomainCount[iDomain]++; - } - else { + } else { for (iDomain = 0; iDomain < nDomain; iDomain++) for (iMarker = 0; iMarker < nMarker; iMarker++) if (bound[iMarker][0]->GetVTK_Type() == VERTEX) @@ -3413,21 +3189,20 @@ void CPhysicalGeometry::SetBoundaries(CConfig *config) { for (iDomain = 0; iDomain < nDomain; iDomain++) if (DomainCount[iDomain] > 1) Duplicate_SendReceive++; - delete [] DomainCount; - + delete[] DomainCount; } - DomainSendCount = new unsigned short [nDomain]; - DomainSendMarkers = new unsigned short *[nDomain]; - DomainReceiveCount = new unsigned short [nDomain]; - DomainReceiveMarkers = new unsigned short *[nDomain]; + DomainSendCount = new unsigned short[nDomain]; + DomainSendMarkers = new unsigned short*[nDomain]; + DomainReceiveCount = new unsigned short[nDomain]; + DomainReceiveMarkers = new unsigned short*[nDomain]; for (iDomain = 0; iDomain < nDomain; iDomain++) { DomainSendCount[iDomain] = 0; - DomainSendMarkers[iDomain] = new unsigned short [nMarker]; + DomainSendMarkers[iDomain] = new unsigned short[nMarker]; DomainReceiveCount[iDomain] = 0; - DomainReceiveMarkers[iDomain] = new unsigned short [nMarker]; + DomainReceiveMarkers[iDomain] = new unsigned short[nMarker]; } for (iDomain = 0; iDomain < nDomain; iDomain++) { @@ -3450,8 +3225,8 @@ void CPhysicalGeometry::SetBoundaries(CConfig *config) { nMarker_SendRecv = nMarker - nMarker_Physical - Duplicate_SendReceive; bound_Copy = new CPrimalGrid**[nMarker_Physical + nMarker_SendRecv]; - nElem_Bound_Copy = new unsigned long [nMarker_Physical + nMarker_SendRecv]; - Marker_All_SendRecv_Copy = new short [nMarker_Physical + nMarker_SendRecv]; + nElem_Bound_Copy = new unsigned long[nMarker_Physical + nMarker_SendRecv]; + Marker_All_SendRecv_Copy = new short[nMarker_Physical + nMarker_SendRecv]; iMarker_ = nMarker_Physical; iVertex_ = 0; CheckStart = false; @@ -3460,31 +3235,27 @@ void CPhysicalGeometry::SetBoundaries(CConfig *config) { for (iMarker = 0; iMarker < nMarker; iMarker++) { if (bound[iMarker][0]->GetVTK_Type() != VERTEX) { - nElem_Bound_Copy[iMarker] = nElem_Bound[iMarker]; - bound_Copy[iMarker] = new CPrimalGrid* [nElem_Bound[iMarker]]; + bound_Copy[iMarker] = new CPrimalGrid*[nElem_Bound[iMarker]]; for (iElem_Bound = 0; iElem_Bound < nElem_Bound[iMarker]; iElem_Bound++) { if (bound[iMarker][iElem_Bound]->GetVTK_Type() == LINE) - bound_Copy[iMarker][iElem_Bound] = new CLine(bound[iMarker][iElem_Bound]->GetNode(0), - bound[iMarker][iElem_Bound]->GetNode(1)); + bound_Copy[iMarker][iElem_Bound] = + new CLine(bound[iMarker][iElem_Bound]->GetNode(0), bound[iMarker][iElem_Bound]->GetNode(1)); if (bound[iMarker][iElem_Bound]->GetVTK_Type() == TRIANGLE) - bound_Copy[iMarker][iElem_Bound] = new CTriangle(bound[iMarker][iElem_Bound]->GetNode(0), - bound[iMarker][iElem_Bound]->GetNode(1), - bound[iMarker][iElem_Bound]->GetNode(2)); + bound_Copy[iMarker][iElem_Bound] = + new CTriangle(bound[iMarker][iElem_Bound]->GetNode(0), bound[iMarker][iElem_Bound]->GetNode(1), + bound[iMarker][iElem_Bound]->GetNode(2)); if (bound[iMarker][iElem_Bound]->GetVTK_Type() == QUADRILATERAL) - bound_Copy[iMarker][iElem_Bound] = new CQuadrilateral(bound[iMarker][iElem_Bound]->GetNode(0), - bound[iMarker][iElem_Bound]->GetNode(1), - bound[iMarker][iElem_Bound]->GetNode(2), - bound[iMarker][iElem_Bound]->GetNode(3)); + bound_Copy[iMarker][iElem_Bound] = + new CQuadrilateral(bound[iMarker][iElem_Bound]->GetNode(0), bound[iMarker][iElem_Bound]->GetNode(1), + bound[iMarker][iElem_Bound]->GetNode(2), bound[iMarker][iElem_Bound]->GetNode(3)); } } } - for (iDomain = 0; iDomain < nDomain; iDomain++) { - /*--- Compute the total number of elements (adding all the boundaries with the same Send/Receive ---*/ @@ -3510,7 +3281,6 @@ void CPhysicalGeometry::SetBoundaries(CConfig *config) { bound_Copy[iMarker_][iVertex_]->SetRotation_Type(bound[iMarker][iElem_Bound]->GetRotation_Type()); iVertex_++; } - } /*--- Compute the total number of elements (adding all the @@ -3527,7 +3297,6 @@ void CPhysicalGeometry::SetBoundaries(CConfig *config) { iVertex_ = 0; nElem_Bound_Copy[iMarker_] = TotalElem; bound_Copy[iMarker_] = new CPrimalGrid*[TotalElem]; - } for (iMarkersDomain = 0; iMarkersDomain < DomainReceiveCount[iDomain]; iMarkersDomain++) { @@ -3539,29 +3308,25 @@ void CPhysicalGeometry::SetBoundaries(CConfig *config) { bound_Copy[iMarker_][iVertex_]->SetRotation_Type(bound[iMarker][iElem_Bound]->GetRotation_Type()); iVertex_++; } - } - } - delete [] DomainSendCount; - for (iDomain = 0; iDomain < nDomain; iDomain++) - delete [] DomainSendMarkers[iDomain]; + delete[] DomainSendCount; + for (iDomain = 0; iDomain < nDomain; iDomain++) delete[] DomainSendMarkers[iDomain]; delete[] DomainSendMarkers; - delete [] DomainReceiveCount; - for (iDomain = 0; iDomain < nDomain; iDomain++) - delete [] DomainReceiveMarkers[iDomain]; + delete[] DomainReceiveCount; + for (iDomain = 0; iDomain < nDomain; iDomain++) delete[] DomainReceiveMarkers[iDomain]; delete[] DomainReceiveMarkers; - /*--- Deallocate the bound variables ---*/ + /*--- Deallocate the bound variables ---*/ for (iMarker = 0; iMarker < nMarker; iMarker++) { - for (iElem_Bound = 0; iElem_Bound < nElem_Bound[iMarker]; iElem_Bound++) - if (bound[iMarker][iElem_Bound] != nullptr) delete bound[iMarker][iElem_Bound]; - if (bound[iMarker] != nullptr) delete [] bound[iMarker]; + for (iElem_Bound = 0; iElem_Bound < nElem_Bound[iMarker]; iElem_Bound++) + if (bound[iMarker][iElem_Bound] != nullptr) delete bound[iMarker][iElem_Bound]; + if (bound[iMarker] != nullptr) delete[] bound[iMarker]; } - delete [] bound; + delete[] bound; /*--- Allocate the new bound variables, and set the number of markers ---*/ @@ -3582,12 +3347,10 @@ void CPhysicalGeometry::SetBoundaries(CConfig *config) { /*--- Update config information storing the boundary information in the right place ---*/ - for (iMarker = 0 ; iMarker < nMarker; iMarker++) { - + for (iMarker = 0; iMarker < nMarker; iMarker++) { string Marker_Tag = config->GetMarker_All_TagBound(iMarker); if (Marker_Tag != "SEND_RECEIVE") { - /*--- Update config information storing the boundary information in the right place ---*/ Tag_to_Marker[config->GetMarker_CfgFile_TagBound(Marker_Tag)] = Marker_Tag; @@ -3615,7 +3378,6 @@ void CPhysicalGeometry::SetBoundaries(CConfig *config) { /*--- Send-Receive boundaries definition ---*/ else { - config->SetMarker_All_KindBC(iMarker, SEND_RECEIVE); config->SetMarker_All_Monitoring(iMarker, NO); config->SetMarker_All_GeoEval(iMarker, NO); @@ -3639,7 +3401,6 @@ void CPhysicalGeometry::SetBoundaries(CConfig *config) { if (config->GetMarker_All_SendRecv(iMarker) < 0) nodes->SetDomain(bound[iMarker][iElem_Bound]->GetNode(0), false); } - } /*--- Loop over the surface element to set the boundaries ---*/ @@ -3657,39 +3418,41 @@ void CPhysicalGeometry::SetBoundaries(CConfig *config) { config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY) nodes->SetPhysicalBoundary(Point_Surface, true); - if (config->GetSolid_Wall(iMarker)) - nodes->SetSolidBoundary(Point_Surface, true); + if (config->GetSolid_Wall(iMarker)) nodes->SetSolidBoundary(Point_Surface, true); - if (config->GetViscous_Wall(iMarker)) - nodes->SetViscousBoundary(Point_Surface, true); + if (config->GetViscous_Wall(iMarker)) nodes->SetViscousBoundary(Point_Surface, true); - if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) - nodes->SetPeriodicBoundary(Point_Surface, true); + if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) nodes->SetPeriodicBoundary(Point_Surface, true); } } - } - delete [] Marker_All_SendRecv_Copy; - delete [] nElem_Bound_Copy; + delete[] Marker_All_SendRecv_Copy; + delete[] nElem_Bound_Copy; } -void CPhysicalGeometry::Read_Mesh_FVM(CConfig *config, - string val_mesh_filename, - unsigned short val_iZone, +void CPhysicalGeometry::Read_Mesh_FVM(CConfig* config, const string& val_mesh_filename, unsigned short val_iZone, unsigned short val_nZone) { - /*--- Initialize counters for local/global points & elements ---*/ - Global_nPoint = 0; Global_nPointDomain = 0; - Global_nElem = 0; Global_nElemDomain = 0; - nelem_edge = 0; Global_nelem_edge = 0; - nelem_triangle = 0; Global_nelem_triangle = 0; - nelem_quad = 0; Global_nelem_quad = 0; - nelem_tetra = 0; Global_nelem_tetra = 0; - nelem_hexa = 0; Global_nelem_hexa = 0; - nelem_prism = 0; Global_nelem_prism = 0; - nelem_pyramid = 0; Global_nelem_pyramid = 0; + Global_nPoint = 0; + Global_nPointDomain = 0; + Global_nElem = 0; + Global_nElemDomain = 0; + nelem_edge = 0; + Global_nelem_edge = 0; + nelem_triangle = 0; + Global_nelem_triangle = 0; + nelem_quad = 0; + Global_nelem_quad = 0; + nelem_tetra = 0; + Global_nelem_tetra = 0; + nelem_hexa = 0; + Global_nelem_hexa = 0; + nelem_prism = 0; + Global_nelem_prism = 0; + nelem_pyramid = 0; + Global_nelem_pyramid = 0; /*--- Set the zone number from the input value. ---*/ @@ -3699,7 +3462,7 @@ void CPhysicalGeometry::Read_Mesh_FVM(CConfig *config, unsigned short val_format = config->GetMesh_FileFormat(); - CMeshReaderFVM *MeshFVM = nullptr; + CMeshReaderFVM* MeshFVM = nullptr; switch (val_format) { case SU2: MeshFVM = new CSU2ASCIIMeshReaderFVM(config, val_iZone, val_nZone); @@ -3728,9 +3491,9 @@ void CPhysicalGeometry::Read_Mesh_FVM(CConfig *config, /*--- Store the local and global number of nodes for this rank. ---*/ - nPoint = MeshFVM->GetNumberOfLocalPoints(); - nPointDomain = MeshFVM->GetNumberOfLocalPoints(); - Global_nPoint = MeshFVM->GetNumberOfGlobalPoints(); + nPoint = MeshFVM->GetNumberOfLocalPoints(); + nPointDomain = MeshFVM->GetNumberOfLocalPoints(); + Global_nPoint = MeshFVM->GetNumberOfGlobalPoints(); Global_nPointDomain = MeshFVM->GetNumberOfGlobalPoints(); if ((rank == MASTER_NODE) && (size > SINGLE_NODE)) { @@ -3741,8 +3504,8 @@ void CPhysicalGeometry::Read_Mesh_FVM(CConfig *config, /*--- Store the local and global number of interior elements. ---*/ - nElem = MeshFVM->GetNumberOfLocalElements(); - Global_nElem = MeshFVM->GetNumberOfGlobalElements(); + nElem = MeshFVM->GetNumberOfLocalElements(); + Global_nElem = MeshFVM->GetNumberOfGlobalElements(); Global_nElemDomain = MeshFVM->GetNumberOfGlobalElements(); if ((rank == MASTER_NODE) && (size > SINGLE_NODE)) { @@ -3754,9 +3517,9 @@ void CPhysicalGeometry::Read_Mesh_FVM(CConfig *config, /*--- Load the grid points, volume elements, and surface elements from the mesh object into the proper SU2 data structures. ---*/ - LoadLinearlyPartitionedPoints(config, MeshFVM); + LoadLinearlyPartitionedPoints(config, MeshFVM); LoadLinearlyPartitionedVolumeElements(config, MeshFVM); - LoadUnpartitionedSurfaceElements(config, MeshFVM); + LoadUnpartitionedSurfaceElements(config, MeshFVM); /*--- Prepare the nodal adjacency structures for ParMETIS. ---*/ @@ -3766,12 +3529,9 @@ void CPhysicalGeometry::Read_Mesh_FVM(CConfig *config, delete the mesh reader object. ---*/ delete MeshFVM; - } -void CPhysicalGeometry::LoadLinearlyPartitionedPoints(CConfig *config, - CMeshReaderFVM *mesh) { - +void CPhysicalGeometry::LoadLinearlyPartitionedPoints(CConfig* config, CMeshReaderFVM* mesh) { /*--- Get the linearly partitioned coordinates from the mesh object. ---*/ const auto& gridCoords = mesh->GetLocalPointCoordinates(); @@ -3785,20 +3545,16 @@ void CPhysicalGeometry::LoadLinearlyPartitionedPoints(CConfig *config, of the grid nodes, we can simply initialize the global index to the first node that lies on our rank and increment. ---*/ - CLinearPartitioner pointPartitioner(Global_nPointDomain,0); + CLinearPartitioner pointPartitioner(Global_nPointDomain, 0); unsigned long GlobalIndex = pointPartitioner.GetFirstIndexOnRank(rank); for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) { - for (unsigned short iDim = 0; iDim < nDim; ++iDim) - nodes->SetCoord(iPoint, iDim, gridCoords[iDim][iPoint]); + for (unsigned short iDim = 0; iDim < nDim; ++iDim) nodes->SetCoord(iPoint, iDim, gridCoords[iDim][iPoint]); nodes->SetGlobalIndex(iPoint, GlobalIndex); ++GlobalIndex; } - } -void CPhysicalGeometry::LoadLinearlyPartitionedVolumeElements(CConfig *config, - CMeshReaderFVM *mesh) { - +void CPhysicalGeometry::LoadLinearlyPartitionedVolumeElements(CConfig* config, CMeshReaderFVM* mesh) { /*--- Reset the global to local element mapping. ---*/ Global_to_Local_Elem.clear(); @@ -3810,82 +3566,58 @@ void CPhysicalGeometry::LoadLinearlyPartitionedVolumeElements(CConfig *co /*--- Allocate space for the CGNS interior elements in our SU2 data structure. Note that we only instantiate our rank's local set. ---*/ - elem = new CPrimalGrid*[nElem] (); + elem = new CPrimalGrid*[nElem](); /*--- Loop over all of the internal, local volumetric elements. ---*/ for (unsigned long iElem = 0; iElem < nElem; iElem++) { - /*--- Get the global ID for this element. This is stored in the first entry of our connectivity stucture. ---*/ - const auto Global_Index_Elem = connElems[iElem*SU2_CONN_SIZE + 0]; + const auto Global_Index_Elem = connElems[iElem * SU2_CONN_SIZE + 0]; Global_to_Local_Elem[Global_Index_Elem] = iElem; /*--- Get the VTK type for this element. This is stored in the second entry of the connectivity structure. ---*/ - const auto vtk_type = static_cast(connElems[iElem*SU2_CONN_SIZE + 1]); + const auto vtk_type = static_cast(connElems[iElem * SU2_CONN_SIZE + 1]); /*--- Instantiate this element in the proper SU2 data structure. During this loop, we also set the global to local element map for later use and increment the element counts for all types. ---*/ - auto connectivity = &connElems[iElem*SU2_CONN_SIZE + SU2_CONN_SKIP]; - - switch(vtk_type) { + auto connectivity = &connElems[iElem * SU2_CONN_SIZE + SU2_CONN_SKIP]; + switch (vtk_type) { case TRIANGLE: - elem[iElem] = new CTriangle(connectivity[0], - connectivity[1], - connectivity[2]); + elem[iElem] = new CTriangle(connectivity[0], connectivity[1], connectivity[2]); nelem_triangle++; break; case QUADRILATERAL: - elem[iElem] = new CQuadrilateral(connectivity[0], - connectivity[1], - connectivity[2], - connectivity[3]); + elem[iElem] = new CQuadrilateral(connectivity[0], connectivity[1], connectivity[2], connectivity[3]); nelem_quad++; break; case TETRAHEDRON: - elem[iElem] = new CTetrahedron(connectivity[0], - connectivity[1], - connectivity[2], - connectivity[3]); + elem[iElem] = new CTetrahedron(connectivity[0], connectivity[1], connectivity[2], connectivity[3]); nelem_tetra++; break; case HEXAHEDRON: - elem[iElem] = new CHexahedron(connectivity[0], - connectivity[1], - connectivity[2], - connectivity[3], - connectivity[4], - connectivity[5], - connectivity[6], - connectivity[7]); + elem[iElem] = new CHexahedron(connectivity[0], connectivity[1], connectivity[2], connectivity[3], + connectivity[4], connectivity[5], connectivity[6], connectivity[7]); nelem_hexa++; break; case PRISM: - elem[iElem] = new CPrism(connectivity[0], - connectivity[1], - connectivity[2], - connectivity[3], - connectivity[4], + elem[iElem] = new CPrism(connectivity[0], connectivity[1], connectivity[2], connectivity[3], connectivity[4], connectivity[5]); nelem_prism++; break; case PYRAMID: - elem[iElem] = new CPyramid(connectivity[0], - connectivity[1], - connectivity[2], - connectivity[3], - connectivity[4]); + elem[iElem] = new CPyramid(connectivity[0], connectivity[1], connectivity[2], connectivity[3], connectivity[4]); nelem_pyramid++; break; @@ -3907,20 +3639,16 @@ void CPhysicalGeometry::LoadLinearlyPartitionedVolumeElements(CConfig *co reduce(nelem_tetra, Global_nelem_tetra); reduce(nelem_prism, Global_nelem_prism); reduce(nelem_pyramid, Global_nelem_pyramid); - } -void CPhysicalGeometry::LoadUnpartitionedSurfaceElements(CConfig *config, - CMeshReaderFVM *mesh) { - +void CPhysicalGeometry::LoadUnpartitionedSurfaceElements(CConfig* config, CMeshReaderFVM* mesh) { /*--- The master node takes care of loading all markers and surface elements from the file. This information is later put into linear partitions to make its redistribution easier after we call ParMETIS. ---*/ if (rank == MASTER_NODE) { - - const vector §ionNames = mesh->GetMarkerNames(); + const vector& sectionNames = mesh->GetMarkerNames(); /*--- Store the number of markers and print to the screen. ---*/ @@ -3930,9 +3658,9 @@ void CPhysicalGeometry::LoadUnpartitionedSurfaceElements(CConfig *config, /*--- Create the data structure for boundary elements. ---*/ - bound = new CPrimalGrid**[nMarker]; - nElem_Bound = new unsigned long [nMarker]; - Tag_to_Marker = new string [config->GetnMarker_Max()]; + bound = new CPrimalGrid**[nMarker]; + nElem_Bound = new unsigned long[nMarker]; + Tag_to_Marker = new string[config->GetnMarker_Max()]; /*--- Set some temporaries for the loop below. ---*/ @@ -3945,23 +3673,22 @@ void CPhysicalGeometry::LoadUnpartitionedSurfaceElements(CConfig *config, store those elements into our SU2 data structures. ---*/ for (int iMarker = 0; iMarker < nMarker; iMarker++) { - /*--- Initialize some counter variables ---*/ - nelem_edge_bound = 0; nelem_triangle_bound = 0; - nelem_quad_bound = 0; iElem = 0; + nelem_edge_bound = 0; + nelem_triangle_bound = 0; + nelem_quad_bound = 0; + iElem = 0; /*--- Get the string name for this marker. ---*/ - string Marker_Tag = sectionNames[iMarker]; + const string& Marker_Tag = sectionNames[iMarker]; /* Get the marker info and surface connectivity from the mesh object. */ - const unsigned long surfElems = - mesh->GetNumberOfSurfaceElementsForMarker(iMarker); + const unsigned long surfElems = mesh->GetNumberOfSurfaceElementsForMarker(iMarker); - const vector &connElems = - mesh->GetSurfaceElementConnectivityForMarker(iMarker); + const vector& connElems = mesh->GetSurfaceElementConnectivityForMarker(iMarker); /*--- Set the number of boundary elements in this marker. ---*/ @@ -3969,51 +3696,50 @@ void CPhysicalGeometry::LoadUnpartitionedSurfaceElements(CConfig *config, /*--- Report the number and name of the marker to the console. ---*/ - cout << nElem_Bound[iMarker] << " boundary elements in index "; - cout << iMarker <<" (Marker = " <SetMarker_All_TurbomachineryFlag(iMarker, config->GetMarker_CfgFile_TurbomachineryFlag(Marker_Tag)); config->SetMarker_All_MixingPlaneInterface(iMarker, config->GetMarker_CfgFile_MixingPlaneInterface(Marker_Tag)); config->SetMarker_All_SobolevBC(iMarker, config->GetMarker_CfgFile_SobolevBC(Marker_Tag)); - } } - } -void CPhysicalGeometry::PrepareAdjacency(const CConfig *config) { - +void CPhysicalGeometry::PrepareAdjacency(const CConfig* config) { #ifdef HAVE_MPI #ifdef HAVE_PARMETIS @@ -4059,13 +3782,12 @@ void CPhysicalGeometry::PrepareAdjacency(const CConfig *config) { /*--- Create a partitioner object so we can transform the global index values stored in the elements to a local index. ---*/ - CLinearPartitioner pointPartitioner(Global_nPointDomain,0); + CLinearPartitioner pointPartitioner(Global_nPointDomain, 0); const unsigned long firstIndex = pointPartitioner.GetFirstIndexOnRank(rank); /*--- Loop over all elements that are now loaded and store adjacency. ---*/ for (unsigned long iElem = 0; iElem < nElem; iElem++) { - /*--- Store the connectivity for this element more easily. ---*/ unsigned long connectivity[8] = {0}; for (unsigned long iNode = 0; iNode < elem[iElem]->GetnNodes(); iNode++) { @@ -4074,8 +3796,7 @@ void CPhysicalGeometry::PrepareAdjacency(const CConfig *config) { /*--- Instantiate this element and build adjacency structure. ---*/ - switch(elem[iElem]->GetVTK_Type()) { - + switch (elem[iElem]->GetVTK_Type()) { case TRIANGLE: /*--- Decide whether we need to store the adjacency for any nodes @@ -4083,20 +3804,16 @@ void CPhysicalGeometry::PrepareAdjacency(const CConfig *config) { global index value within the range of our linear partitioning. ---*/ for (unsigned long iNode = 0; iNode < N_POINTS_TRIANGLE; iNode++) { - - const long local_index = connectivity[iNode]-firstIndex; + const long local_index = connectivity[iNode] - firstIndex; if ((local_index >= 0) && (local_index < (long)nPoint)) { - /*--- This node is within our linear partition. Add the neighboring nodes to this nodes' adjacency list. ---*/ for (unsigned long jNode = 0; jNode < N_POINTS_TRIANGLE; jNode++) { - /*--- Build adjacency assuming the VTK connectivity ---*/ - if (iNode != jNode) - adj_nodes[local_index].push_back(connectivity[jNode]); + if (iNode != jNode) adj_nodes[local_index].push_back(connectivity[jNode]); } } } @@ -4110,18 +3827,16 @@ void CPhysicalGeometry::PrepareAdjacency(const CConfig *config) { global index value within the range of our linear partitioning. ---*/ for (unsigned long iNode = 0; iNode < N_POINTS_QUADRILATERAL; iNode++) { - - const long local_index = connectivity[iNode]-firstIndex; + const long local_index = connectivity[iNode] - firstIndex; if ((local_index >= 0) && (local_index < (long)nPoint)) { - /*--- This node is within our linear partition. Add the neighboring nodes to this nodes' adjacency list. ---*/ /*--- Build adjacency assuming the VTK connectivity ---*/ - adj_nodes[local_index].push_back(connectivity[(iNode+1)%4]); - adj_nodes[local_index].push_back(connectivity[(iNode+3)%4]); + adj_nodes[local_index].push_back(connectivity[(iNode + 1) % 4]); + adj_nodes[local_index].push_back(connectivity[(iNode + 3) % 4]); } } @@ -4134,20 +3849,16 @@ void CPhysicalGeometry::PrepareAdjacency(const CConfig *config) { global index value within the range of our linear partitioning. ---*/ for (unsigned long iNode = 0; iNode < N_POINTS_TETRAHEDRON; iNode++) { - - const long local_index = connectivity[iNode]-firstIndex; + const long local_index = connectivity[iNode] - firstIndex; if ((local_index >= 0) && (local_index < (long)nPoint)) { - /*--- This node is within our linear partition. Add the neighboring nodes to this nodes' adjacency list. ---*/ for (unsigned long jNode = 0; jNode < N_POINTS_TETRAHEDRON; jNode++) { - /*--- Build adjacency assuming the VTK connectivity ---*/ - if (iNode != jNode) - adj_nodes[local_index].push_back(connectivity[jNode]); + if (iNode != jNode) adj_nodes[local_index].push_back(connectivity[jNode]); } } } @@ -4161,24 +3872,22 @@ void CPhysicalGeometry::PrepareAdjacency(const CConfig *config) { global index value within the range of our linear partitioning. ---*/ for (unsigned long iNode = 0; iNode < N_POINTS_HEXAHEDRON; iNode++) { - - const long local_index = connectivity[iNode]-firstIndex; + const long local_index = connectivity[iNode] - firstIndex; if ((local_index >= 0) && (local_index < (long)nPoint)) { - /*--- This node is within our linear partition. Add the neighboring nodes to this nodes' adjacency list. ---*/ /*--- Build adjacency assuming the VTK connectivity ---*/ if (iNode < 4) { - adj_nodes[local_index].push_back(connectivity[(iNode+1)%4]); - adj_nodes[local_index].push_back(connectivity[(iNode+3)%4]); + adj_nodes[local_index].push_back(connectivity[(iNode + 1) % 4]); + adj_nodes[local_index].push_back(connectivity[(iNode + 3) % 4]); } else { - adj_nodes[local_index].push_back(connectivity[(iNode-3)%4+4]); - adj_nodes[local_index].push_back(connectivity[(iNode-1)%4+4]); + adj_nodes[local_index].push_back(connectivity[(iNode - 3) % 4 + 4]); + adj_nodes[local_index].push_back(connectivity[(iNode - 1) % 4 + 4]); } - adj_nodes[local_index].push_back(connectivity[(iNode+4)%8]); + adj_nodes[local_index].push_back(connectivity[(iNode + 4) % 8]); } } @@ -4191,24 +3900,22 @@ void CPhysicalGeometry::PrepareAdjacency(const CConfig *config) { global index value within the range of our linear partitioning. ---*/ for (unsigned long iNode = 0; iNode < N_POINTS_PRISM; iNode++) { - - const long local_index = connectivity[iNode]-firstIndex; + const long local_index = connectivity[iNode] - firstIndex; if ((local_index >= 0) && (local_index < (long)nPoint)) { - /*--- This node is within our linear partition. Add the neighboring nodes to this nodes' adjacency list. ---*/ /*--- Build adjacency assuming the VTK connectivity ---*/ if (iNode < 3) { - adj_nodes[local_index].push_back(connectivity[(iNode+1)%3]); - adj_nodes[local_index].push_back(connectivity[(iNode+2)%3]); + adj_nodes[local_index].push_back(connectivity[(iNode + 1) % 3]); + adj_nodes[local_index].push_back(connectivity[(iNode + 2) % 3]); } else { - adj_nodes[local_index].push_back(connectivity[(iNode-2)%3+3]); - adj_nodes[local_index].push_back(connectivity[(iNode-1)%3+3]); + adj_nodes[local_index].push_back(connectivity[(iNode - 2) % 3 + 3]); + adj_nodes[local_index].push_back(connectivity[(iNode - 1) % 3 + 3]); } - adj_nodes[local_index].push_back(connectivity[(iNode+3)%6]); + adj_nodes[local_index].push_back(connectivity[(iNode + 3) % 6]); } } @@ -4221,19 +3928,17 @@ void CPhysicalGeometry::PrepareAdjacency(const CConfig *config) { global index value within the range of our linear partitioning. ---*/ for (unsigned long iNode = 0; iNode < N_POINTS_PYRAMID; iNode++) { - - const long local_index = connectivity[iNode]-firstIndex; + const long local_index = connectivity[iNode] - firstIndex; if ((local_index >= 0) && (local_index < (long)nPoint)) { - /*--- This node is within our linear partition. Add the neighboring nodes to this nodes' adjacency list. ---*/ /*--- Build adjacency assuming the VTK connectivity ---*/ if (iNode < 4) { - adj_nodes[local_index].push_back(connectivity[(iNode+1)%4]); - adj_nodes[local_index].push_back(connectivity[(iNode+3)%4]); + adj_nodes[local_index].push_back(connectivity[(iNode + 1) % 4]); + adj_nodes[local_index].push_back(connectivity[(iNode + 3) % 4]); adj_nodes[local_index].push_back(connectivity[4]); } else { adj_nodes[local_index].push_back(connectivity[0]); @@ -4259,140 +3964,125 @@ void CPhysicalGeometry::PrepareAdjacency(const CConfig *config) { #endif #endif - } -void CPhysicalGeometry::Check_IntElem_Orientation(const CConfig *config) { - - unsigned long tria_flip=0, quad_flip=0, tet_flip=0, prism_flip=0, hexa_flip=0, pyram_flip=0; - unsigned long quad_error=0, prism_error=0, hexa_error=0, pyram_error=0; - - SU2_OMP_PARALLEL_(reduction(+:tria_flip,quad_flip,tet_flip,prism_flip,hexa_flip,pyram_flip)) { - - /*--- Lambda to test triangles. Normal should be positive in the z direction (right hand rule). ---*/ - auto checkTria = [this](unsigned long iElem, int Node_1, int Node_2, int Node_3) { - const auto Coord_1 = nodes->GetCoord(elem[iElem]->GetNode(Node_1)); - const auto Coord_2 = nodes->GetCoord(elem[iElem]->GetNode(Node_2)); - const auto Coord_3 = nodes->GetCoord(elem[iElem]->GetNode(Node_3)); - constexpr int nDim = 2; - su2double a[nDim]={0.0}, b[nDim]={0.0}; - GeometryToolbox::Distance(nDim, Coord_2, Coord_1, a); - GeometryToolbox::Distance(nDim, Coord_3, Coord_1, b); - return a[0]*b[1]-a[1]*b[0] < 0.0; - }; - - /*--- Lambda to test tetrahedrons, volume must be positive, - * the normal of any face must point towards the other point. ---*/ - auto checkTetra = [this](unsigned long iElem, int Node_1, int Node_2, int Node_3, int Node_4) { - const auto Coord_1 = nodes->GetCoord(elem[iElem]->GetNode(Node_1)); - const auto Coord_2 = nodes->GetCoord(elem[iElem]->GetNode(Node_2)); - const auto Coord_3 = nodes->GetCoord(elem[iElem]->GetNode(Node_3)); - const auto Coord_4 = nodes->GetCoord(elem[iElem]->GetNode(Node_4)); - constexpr int nDim = 3; - su2double a[nDim]={0.0}, b[nDim]={0.0}, c[nDim]={0.0}, n[nDim]={0.0}; - GeometryToolbox::Distance(nDim, Coord_2, Coord_1, a); - GeometryToolbox::Distance(nDim, Coord_3, Coord_1, b); - GeometryToolbox::Distance(nDim, Coord_4, Coord_1, c); - GeometryToolbox::CrossProduct(a,b,n); - return GeometryToolbox::DotProduct(nDim,n,c) < 0.0; - }; - - /*--- Loop over all the elements. ---*/ - - SU2_OMP_FOR_DYN(roundUpDiv(nElem, 2*omp_get_max_threads())) - for (auto iElem = 0ul; iElem < nElem; iElem++) { +void CPhysicalGeometry::Check_IntElem_Orientation(const CConfig* config) { + unsigned long tria_flip = 0, quad_flip = 0, tet_flip = 0, prism_flip = 0, hexa_flip = 0, pyram_flip = 0; + unsigned long quad_error = 0, prism_error = 0, hexa_error = 0, pyram_error = 0; + + SU2_OMP_PARALLEL_(reduction(+ : tria_flip, quad_flip, tet_flip, prism_flip, hexa_flip, pyram_flip)) { + /*--- Lambda to test triangles. Normal should be positive in the z direction (right hand rule). ---*/ + auto checkTria = [this](unsigned long iElem, int Node_1, int Node_2, int Node_3) { + const auto Coord_1 = nodes->GetCoord(elem[iElem]->GetNode(Node_1)); + const auto Coord_2 = nodes->GetCoord(elem[iElem]->GetNode(Node_2)); + const auto Coord_3 = nodes->GetCoord(elem[iElem]->GetNode(Node_3)); + constexpr int nDim = 2; + su2double a[nDim] = {0.0}, b[nDim] = {0.0}; + GeometryToolbox::Distance(nDim, Coord_2, Coord_1, a); + GeometryToolbox::Distance(nDim, Coord_3, Coord_1, b); + return a[0] * b[1] - a[1] * b[0] < 0.0; + }; + + /*--- Lambda to test tetrahedrons, volume must be positive, + * the normal of any face must point towards the other point. ---*/ + auto checkTetra = [this](unsigned long iElem, int Node_1, int Node_2, int Node_3, int Node_4) { + const auto Coord_1 = nodes->GetCoord(elem[iElem]->GetNode(Node_1)); + const auto Coord_2 = nodes->GetCoord(elem[iElem]->GetNode(Node_2)); + const auto Coord_3 = nodes->GetCoord(elem[iElem]->GetNode(Node_3)); + const auto Coord_4 = nodes->GetCoord(elem[iElem]->GetNode(Node_4)); + constexpr int nDim = 3; + su2double a[nDim] = {0.0}, b[nDim] = {0.0}, c[nDim] = {0.0}, n[nDim] = {0.0}; + GeometryToolbox::Distance(nDim, Coord_2, Coord_1, a); + GeometryToolbox::Distance(nDim, Coord_3, Coord_1, b); + GeometryToolbox::Distance(nDim, Coord_4, Coord_1, c); + GeometryToolbox::CrossProduct(a, b, n); + return GeometryToolbox::DotProduct(nDim, n, c) < 0.0; + }; + + /*--- Loop over all the elements. ---*/ + + SU2_OMP_FOR_DYN(roundUpDiv(nElem, 2 * omp_get_max_threads())) + for (auto iElem = 0ul; iElem < nElem; iElem++) { + /*--- 2D grid. ---*/ - /*--- 2D grid. ---*/ + if (elem[iElem]->GetVTK_Type() == TRIANGLE) { + if (checkTria(iElem, 0, 1, 2)) { + elem[iElem]->Change_Orientation(); + tria_flip++; + } + } - if (elem[iElem]->GetVTK_Type() == TRIANGLE) { + if (elem[iElem]->GetVTK_Type() == QUADRILATERAL) { + /*--- Two triangles. ---*/ + bool test_1 = checkTria(iElem, 0, 1, 2); + bool test_2 = checkTria(iElem, 0, 2, 3); - if (checkTria(iElem,0,1,2)) { - elem[iElem]->Change_Orientation(); - tria_flip++; + if (test_1 && test_2) { + elem[iElem]->Change_Orientation(); + quad_flip++; + } else if (test_1 || test_2) { + /*--- If one test fails and the other passes the + * element probably has serious problems. ---*/ + SU2_OMP_ATOMIC + quad_error++; + } } - } - if (elem[iElem]->GetVTK_Type() == QUADRILATERAL) { - - /*--- Two triangles. ---*/ - bool test_1 = checkTria(iElem,0,1,2); - bool test_2 = checkTria(iElem,0,2,3); + /*--- 3D grid. ---*/ - if (test_1 && test_2) { - elem[iElem]->Change_Orientation(); - quad_flip++; - } - else if (test_1 || test_2) { - /*--- If one test fails and the other passes the - * element probably has serious problems. ---*/ - SU2_OMP_ATOMIC - quad_error++; + if (elem[iElem]->GetVTK_Type() == TETRAHEDRON) { + if (checkTetra(iElem, 0, 1, 2, 3)) { + elem[iElem]->Change_Orientation(); + tet_flip++; + } } - } - /*--- 3D grid. ---*/ - - if (elem[iElem]->GetVTK_Type() == TETRAHEDRON) { + if (elem[iElem]->GetVTK_Type() == PYRAMID) { + /*--- Slice across top vertex into 2 tets. ---*/ + bool test_1 = checkTetra(iElem, 0, 1, 2, 4); + bool test_2 = checkTetra(iElem, 2, 3, 0, 4); - if (checkTetra(iElem,0,1,2,3)) { - elem[iElem]->Change_Orientation(); - tet_flip++; + if (test_1 && test_2) { + elem[iElem]->Change_Orientation(); + pyram_flip++; + } else if (test_1 || test_2) { + SU2_OMP_ATOMIC + pyram_error++; + } } - } - - if (elem[iElem]->GetVTK_Type() == PYRAMID) { - /*--- Slice across top vertex into 2 tets. ---*/ - bool test_1 = checkTetra(iElem,0,1,2,4); - bool test_2 = checkTetra(iElem,2,3,0,4); + if (elem[iElem]->GetVTK_Type() == PRISM) { + /*--- The triangular faces should point at each other. ---*/ + bool test_1 = checkTetra(iElem, 0, 2, 1, 3); + bool test_2 = checkTetra(iElem, 3, 4, 5, 2); - if (test_1 && test_2) { - elem[iElem]->Change_Orientation(); - pyram_flip++; + if (test_1 && test_2) { + elem[iElem]->Change_Orientation(); + prism_flip++; + } else if (test_1 || test_2) { + SU2_OMP_ATOMIC + prism_error++; + } } - else if (test_1 || test_2) { - SU2_OMP_ATOMIC - pyram_error++; + + if (elem[iElem]->GetVTK_Type() == HEXAHEDRON) { + /*--- The base points at the top. ---*/ + bool test_1 = checkTetra(iElem, 0, 1, 2, 5); + bool test_2 = checkTetra(iElem, 0, 2, 3, 7); + /*--- The top points at the base. ---*/ + bool test_3 = checkTetra(iElem, 4, 6, 5, 1); + bool test_4 = checkTetra(iElem, 4, 7, 6, 3); + + if (test_1 && test_2 && test_3 && test_4) { + elem[iElem]->Change_Orientation(); + hexa_flip++; + } else if (test_1 || test_2 || test_3 || test_4) { + SU2_OMP_ATOMIC + hexa_error++; + } } } - - if (elem[iElem]->GetVTK_Type() == PRISM) { - - /*--- The triangular faces should point at each other. ---*/ - bool test_1 = checkTetra(iElem,0,2,1,3); - bool test_2 = checkTetra(iElem,3,4,5,2); - - if (test_1 && test_2) { - elem[iElem]->Change_Orientation(); - prism_flip++; - } - else if (test_1 || test_2) { - SU2_OMP_ATOMIC - prism_error++; - } - } - - if (elem[iElem]->GetVTK_Type() == HEXAHEDRON) { - - /*--- The base points at the top. ---*/ - bool test_1 = checkTetra(iElem,0,1,2,5); - bool test_2 = checkTetra(iElem,0,2,3,7); - /*--- The top points at the base. ---*/ - bool test_3 = checkTetra(iElem,4,6,5,1); - bool test_4 = checkTetra(iElem,4,7,6,3); - - if (test_1 && test_2 && test_3 && test_4) { - elem[iElem]->Change_Orientation(); - hexa_flip++; - } - else if (test_1 || test_2 || test_3 || test_4) { - SU2_OMP_ATOMIC - hexa_error++; - } - } - - } - END_SU2_OMP_FOR + END_SU2_OMP_FOR } END_SU2_OMP_PARALLEL @@ -4400,11 +4090,16 @@ void CPhysicalGeometry::Check_IntElem_Orientation(const CConfig *config) { unsigned long tmp = val; SU2_MPI::Allreduce(&tmp, &val, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); }; - reduce(tria_flip); reduce(quad_flip); - reduce(tet_flip); reduce(pyram_flip); - reduce(prism_flip); reduce(hexa_flip); - reduce(quad_error); reduce(pyram_error); - reduce(prism_error); reduce(hexa_error); + reduce(tria_flip); + reduce(quad_flip); + reduce(tet_flip); + reduce(pyram_flip); + reduce(prism_flip); + reduce(hexa_flip); + reduce(quad_error); + reduce(pyram_error); + reduce(prism_error); + reduce(hexa_error); if (rank == MASTER_NODE) { string start("There has been a re-orientation of "); @@ -4415,134 +4110,130 @@ void CPhysicalGeometry::Check_IntElem_Orientation(const CConfig *config) { if (pyram_flip) cout << start << pyram_flip << " PYRAMID volume elements." << endl; if (prism_flip) cout << start << prism_flip << " PRISM volume elements." << endl; - if (quad_error+pyram_error+prism_error+hexa_error) { + if (quad_error + pyram_error + prism_error + hexa_error) { cout << ">>> WARNING: "; if (quad_error) cout << quad_error << " QUADRILATERAL, "; if (pyram_error) cout << pyram_error << " PYRAMID, "; if (prism_error) cout << prism_error << " PRISM, "; if (hexa_error) cout << hexa_error << " HEXAHEDRON, "; cout << "volume elements are distorted.\n It was not possible " - "to determine if their orientation is correct." << endl; + "to determine if their orientation is correct." + << endl; } - if (tria_flip+quad_flip+tet_flip+hexa_flip+pyram_flip+prism_flip+ - quad_error+pyram_error+prism_error+hexa_error == 0) { + if (tria_flip + quad_flip + tet_flip + hexa_flip + pyram_flip + prism_flip + quad_error + pyram_error + + prism_error + hexa_error == + 0) { cout << "All volume elements are correctly orientend." << endl; } } - } -void CPhysicalGeometry::Check_BoundElem_Orientation(const CConfig *config) { - +void CPhysicalGeometry::Check_BoundElem_Orientation(const CConfig* config) { unsigned long line_flip = 0, tria_flip = 0, quad_flip = 0, quad_error = 0; - SU2_OMP_PARALLEL_(reduction(+:line_flip,tria_flip,quad_flip,quad_error)) { - - /*--- Lambda to test tetrahedrons. ---*/ - auto checkTetra = [this](unsigned long Point_1, unsigned long Point_2, - unsigned long Point_3, unsigned long Point_4) { - const auto Coord_1 = nodes->GetCoord(Point_1); - const auto Coord_2 = nodes->GetCoord(Point_2); - const auto Coord_3 = nodes->GetCoord(Point_3); - const auto Coord_4 = nodes->GetCoord(Point_4); - constexpr int nDim = 3; - su2double a[nDim]={0.0}, b[nDim]={0.0}, c[nDim]={0.0}, n[nDim]={0.0}; - GeometryToolbox::Distance(nDim, Coord_2, Coord_1, a); - GeometryToolbox::Distance(nDim, Coord_3, Coord_1, b); - GeometryToolbox::Distance(nDim, Coord_4, Coord_1, c); - GeometryToolbox::CrossProduct(a,b,n); - return GeometryToolbox::DotProduct(nDim,n,c) < 0.0; - }; - - for (auto iMarker = 0u; iMarker < nMarker; iMarker++) { - - if (config->GetMarker_All_KindBC(iMarker) == INTERNAL_BOUNDARY) continue; - - SU2_OMP_FOR_DYN(OMP_MIN_SIZE) - for (auto iElem_Surface = 0ul; iElem_Surface < nElem_Bound[iMarker]; iElem_Surface++) { - - /*--- Pick a reference point inside the domain that is not part of the surface element. ---*/ - const auto iElem_Domain = bound[iMarker][iElem_Surface]->GetDomainElement(); - unsigned long Point_Domain = 0; - - for (auto iNode_Domain = 0u; iNode_Domain < elem[iElem_Domain]->GetnNodes(); iNode_Domain++) { - Point_Domain = elem[iElem_Domain]->GetNode(iNode_Domain); - bool find = false; - for (auto iNode_Surface = 0u; iNode_Surface < bound[iMarker][iElem_Surface]->GetnNodes(); iNode_Surface++) { - auto Point_Surface = bound[iMarker][iElem_Surface]->GetNode(iNode_Surface); - if (Point_Surface == Point_Domain) {find = true; break;} + SU2_OMP_PARALLEL_(reduction(+ : line_flip, tria_flip, quad_flip, quad_error)) { + /*--- Lambda to test tetrahedrons. ---*/ + auto checkTetra = [this](unsigned long Point_1, unsigned long Point_2, unsigned long Point_3, + unsigned long Point_4) { + const auto Coord_1 = nodes->GetCoord(Point_1); + const auto Coord_2 = nodes->GetCoord(Point_2); + const auto Coord_3 = nodes->GetCoord(Point_3); + const auto Coord_4 = nodes->GetCoord(Point_4); + constexpr int nDim = 3; + su2double a[nDim] = {0.0}, b[nDim] = {0.0}, c[nDim] = {0.0}, n[nDim] = {0.0}; + GeometryToolbox::Distance(nDim, Coord_2, Coord_1, a); + GeometryToolbox::Distance(nDim, Coord_3, Coord_1, b); + GeometryToolbox::Distance(nDim, Coord_4, Coord_1, c); + GeometryToolbox::CrossProduct(a, b, n); + return GeometryToolbox::DotProduct(nDim, n, c) < 0.0; + }; + + for (auto iMarker = 0u; iMarker < nMarker; iMarker++) { + if (config->GetMarker_All_KindBC(iMarker) == INTERNAL_BOUNDARY) continue; + + SU2_OMP_FOR_DYN(OMP_MIN_SIZE) + for (auto iElem_Surface = 0ul; iElem_Surface < nElem_Bound[iMarker]; iElem_Surface++) { + /*--- Pick a reference point inside the domain that is not part of the surface element. ---*/ + const auto iElem_Domain = bound[iMarker][iElem_Surface]->GetDomainElement(); + unsigned long Point_Domain = 0; + + for (auto iNode_Domain = 0u; iNode_Domain < elem[iElem_Domain]->GetnNodes(); iNode_Domain++) { + Point_Domain = elem[iElem_Domain]->GetNode(iNode_Domain); + bool find = false; + for (auto iNode_Surface = 0u; iNode_Surface < bound[iMarker][iElem_Surface]->GetnNodes(); iNode_Surface++) { + auto Point_Surface = bound[iMarker][iElem_Surface]->GetNode(iNode_Surface); + if (Point_Surface == Point_Domain) { + find = true; + break; + } + } + if (!find) break; } - if (!find) break; - } - /*--- 2D grid. ---*/ - - if (bound[iMarker][iElem_Surface]->GetVTK_Type() == LINE) { - - auto Point_1_Surface = bound[iMarker][iElem_Surface]->GetNode(0); - auto Point_2_Surface = bound[iMarker][iElem_Surface]->GetNode(1); - const auto Coord_1 = nodes->GetCoord(Point_1_Surface); - const auto Coord_2 = nodes->GetCoord(Point_2_Surface); - const auto Coord_3 = nodes->GetCoord(Point_Domain); - - /*--- The normal of the triangle formed by the line and domain - * point should point in the positive z direction. ---*/ - constexpr int nDim = 2; - su2double a[nDim]={0.0}, b[nDim]={0.0}; - GeometryToolbox::Distance(nDim, Coord_2, Coord_1, a); - GeometryToolbox::Distance(nDim, Coord_3, Coord_1, b); - bool test = a[0]*b[1]-a[1]*b[0] < 0.0; - - if (test) { - bound[iMarker][iElem_Surface]->Change_Orientation(); - line_flip++; + /*--- 2D grid. ---*/ + + if (bound[iMarker][iElem_Surface]->GetVTK_Type() == LINE) { + auto Point_1_Surface = bound[iMarker][iElem_Surface]->GetNode(0); + auto Point_2_Surface = bound[iMarker][iElem_Surface]->GetNode(1); + const auto Coord_1 = nodes->GetCoord(Point_1_Surface); + const auto Coord_2 = nodes->GetCoord(Point_2_Surface); + const auto Coord_3 = nodes->GetCoord(Point_Domain); + + /*--- The normal of the triangle formed by the line and domain + * point should point in the positive z direction. ---*/ + constexpr int nDim = 2; + su2double a[nDim] = {0.0}, b[nDim] = {0.0}; + GeometryToolbox::Distance(nDim, Coord_2, Coord_1, a); + GeometryToolbox::Distance(nDim, Coord_3, Coord_1, b); + bool test = a[0] * b[1] - a[1] * b[0] < 0.0; + + if (test) { + bound[iMarker][iElem_Surface]->Change_Orientation(); + line_flip++; + } } - } - /*--- 3D grid. ---*/ - - if (bound[iMarker][iElem_Surface]->GetVTK_Type() == TRIANGLE) { + /*--- 3D grid. ---*/ - auto Point_1_Surface = bound[iMarker][iElem_Surface]->GetNode(0); - auto Point_2_Surface = bound[iMarker][iElem_Surface]->GetNode(1); - auto Point_3_Surface = bound[iMarker][iElem_Surface]->GetNode(2); + if (bound[iMarker][iElem_Surface]->GetVTK_Type() == TRIANGLE) { + auto Point_1_Surface = bound[iMarker][iElem_Surface]->GetNode(0); + auto Point_2_Surface = bound[iMarker][iElem_Surface]->GetNode(1); + auto Point_3_Surface = bound[iMarker][iElem_Surface]->GetNode(2); - /*--- The normal of the triangle should point into the domain, - * resulting in a tetrahedron with positive volume. ---*/ - if (checkTetra(Point_1_Surface, Point_2_Surface, Point_3_Surface, Point_Domain)) { - bound[iMarker][iElem_Surface]->Change_Orientation(); - tria_flip++; + /*--- The normal of the triangle should point into the domain, + * resulting in a tetrahedron with positive volume. ---*/ + if (checkTetra(Point_1_Surface, Point_2_Surface, Point_3_Surface, Point_Domain)) { + bound[iMarker][iElem_Surface]->Change_Orientation(); + tria_flip++; + } } - } - - if (bound[iMarker][iElem_Surface]->GetVTK_Type() == QUADRILATERAL) { - - auto Point_1_Surface = bound[iMarker][iElem_Surface]->GetNode(0); - auto Point_2_Surface = bound[iMarker][iElem_Surface]->GetNode(1); - auto Point_3_Surface = bound[iMarker][iElem_Surface]->GetNode(2); - auto Point_4_Surface = bound[iMarker][iElem_Surface]->GetNode(3); - - /*--- Divide quadrilateral/pyramid into triangles/tetrahedrons. ---*/ - int test_1 = checkTetra(Point_1_Surface, Point_2_Surface, Point_3_Surface, Point_Domain); - int test_2 = checkTetra(Point_2_Surface, Point_3_Surface, Point_4_Surface, Point_Domain); - int test_3 = checkTetra(Point_3_Surface, Point_4_Surface, Point_1_Surface, Point_Domain); - int test_4 = checkTetra(Point_4_Surface, Point_1_Surface, Point_2_Surface, Point_Domain); - if (test_1+test_2+test_3+test_4 >= 3) { - /*--- If 3 or 4 tests fail there is > 75% chance flipping is the right choice. ---*/ - bound[iMarker][iElem_Surface]->Change_Orientation(); - quad_flip++; - } - else if (test_1+test_2+test_3+test_4 == 2) { - /*--- If 50/50 we cannot be sure of what to do -> report to user. - * If only one test fails it is probably (75%) due to skewness or warping. ---*/ - quad_error++; + if (bound[iMarker][iElem_Surface]->GetVTK_Type() == QUADRILATERAL) { + auto Point_1_Surface = bound[iMarker][iElem_Surface]->GetNode(0); + auto Point_2_Surface = bound[iMarker][iElem_Surface]->GetNode(1); + auto Point_3_Surface = bound[iMarker][iElem_Surface]->GetNode(2); + auto Point_4_Surface = bound[iMarker][iElem_Surface]->GetNode(3); + + /*--- Divide quadrilateral/pyramid into triangles/tetrahedrons. ---*/ + int test_1 = checkTetra(Point_1_Surface, Point_2_Surface, Point_3_Surface, Point_Domain); + int test_2 = checkTetra(Point_2_Surface, Point_3_Surface, Point_4_Surface, Point_Domain); + int test_3 = checkTetra(Point_3_Surface, Point_4_Surface, Point_1_Surface, Point_Domain); + int test_4 = checkTetra(Point_4_Surface, Point_1_Surface, Point_2_Surface, Point_Domain); + + if (test_1 + test_2 + test_3 + test_4 >= 3) { + /*--- If 3 or 4 tests fail there is > 75% chance flipping is the right choice. ---*/ + bound[iMarker][iElem_Surface]->Change_Orientation(); + quad_flip++; + } else if (test_1 + test_2 + test_3 + test_4 == 2) { + /*--- If 50/50 we cannot be sure of what to do -> report to user. + * If only one test fails it is probably (75%) due to skewness or warping. ---*/ + quad_error++; + } } } + END_SU2_OMP_FOR } - END_SU2_OMP_FOR - } } END_SU2_OMP_PARALLEL @@ -4550,8 +4241,10 @@ void CPhysicalGeometry::Check_BoundElem_Orientation(const CConfig *config) { unsigned long tmp = val; SU2_MPI::Allreduce(&tmp, &val, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); }; - reduce(line_flip); reduce(tria_flip); - reduce(quad_flip); reduce(quad_error); + reduce(line_flip); + reduce(tria_flip); + reduce(quad_flip); + reduce(quad_error); if (rank == MASTER_NODE) { string start("There has been a re-orientation of "); @@ -4560,24 +4253,27 @@ void CPhysicalGeometry::Check_BoundElem_Orientation(const CConfig *config) { if (quad_flip) cout << start << quad_flip << " QUADRILATERAL surface elements." << endl; if (quad_error) { - cout << ">>> WARNING: " << quad_error << " QUADRILATERAL surface elements are distorted.\n" - " It was not possible to determine if their orientation is correct." << endl; + cout << ">>> WARNING: " << quad_error + << " QUADRILATERAL surface elements are distorted.\n" + " It was not possible to determine if their orientation is correct." + << endl; } - if (line_flip+tria_flip+quad_flip+quad_error == 0) { + if (line_flip + tria_flip + quad_flip + quad_error == 0) { cout << "All surface elements are correctly orientend." << endl; } } - } -void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) { +void CPhysicalGeometry::SetPositive_ZArea(CConfig* config) { unsigned short iMarker, Boundary, Monitoring; unsigned long iVertex, iPoint; - su2double *Normal, PositiveXArea, PositiveYArea, PositiveZArea, WettedArea, CoordX = 0.0, CoordY = 0.0, CoordZ = 0.0, MinCoordX = 1E10, MinCoordY = 1E10, - MinCoordZ = 1E10, MaxCoordX = -1E10, MaxCoordY = -1E10, MaxCoordZ = -1E10, TotalMinCoordX = 1E10, TotalMinCoordY = 1E10, - TotalMinCoordZ = 1E10, TotalMaxCoordX = -1E10, TotalMaxCoordY = -1E10, TotalMaxCoordZ = -1E10; - su2double TotalPositiveXArea = 0.0, TotalPositiveYArea = 0.0, TotalPositiveZArea = 0.0, TotalWettedArea = 0.0, AxiFactor; + su2double *Normal, PositiveXArea, PositiveYArea, PositiveZArea, WettedArea, + CoordX = 0.0, CoordY = 0.0, CoordZ = 0.0, MinCoordX = 1E10, MinCoordY = 1E10, MinCoordZ = 1E10, MaxCoordX = -1E10, + MaxCoordY = -1E10, MaxCoordZ = -1E10, TotalMinCoordX = 1E10, TotalMinCoordY = 1E10, TotalMinCoordZ = 1E10, + TotalMaxCoordX = -1E10, TotalMaxCoordY = -1E10, TotalMaxCoordZ = -1E10; + su2double TotalPositiveXArea = 0.0, TotalPositiveYArea = 0.0, TotalPositiveZArea = 0.0, TotalWettedArea = 0.0, + AxiFactor; const bool axisymmetric = config->GetAxisymmetric(); const bool fea = config->GetStructuralProblem(); @@ -4591,9 +4287,9 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) { Boundary = config->GetMarker_All_KindBC(iMarker); Monitoring = config->GetMarker_All_Monitoring(iMarker); - if (((config->GetSolid_Wall(iMarker) || Boundary == LOAD_BOUNDARY || - Boundary == DISPLACEMENT_BOUNDARY) && Monitoring == YES) || fea) { - + if (((config->GetSolid_Wall(iMarker) || Boundary == LOAD_BOUNDARY || Boundary == DISPLACEMENT_BOUNDARY) && + Monitoring == YES) || + fea) { for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { iPoint = vertex[iMarker][iVertex]->GetNode(); @@ -4603,8 +4299,10 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) { CoordY = nodes->GetCoord(iPoint, 1); if (nDim == 3) CoordZ = nodes->GetCoord(iPoint, 2); - if (axisymmetric) AxiFactor = 2.0*PI_NUMBER*nodes->GetCoord(iPoint, 1); - else AxiFactor = 1.0; + if (axisymmetric) + AxiFactor = 2.0 * PI_NUMBER * nodes->GetCoord(iPoint, 1); + else + AxiFactor = 1.0; WettedArea += AxiFactor * GeometryToolbox::Norm(nDim, Normal); @@ -4643,131 +4341,126 @@ void CPhysicalGeometry::SetPositive_ZArea(CConfig *config) { /*--- Set a reference area if no value is provided ---*/ - const string L = (config->GetSystemMeasurements() == SI)? " m" : " ft"; - const string A = (config->GetSystemMeasurements() == SI)? " m^2" : " ft^2"; + const string L = (config->GetSystemMeasurements() == SI) ? " m" : " ft"; + const string A = (config->GetSystemMeasurements() == SI) ? " m^2" : " ft^2"; const bool D3 = (nDim == 3); if (config->GetRefArea() == 0.0) { - - if (D3) config->SetRefArea(TotalPositiveZArea); - else config->SetRefArea(TotalPositiveYArea); + if (D3) + config->SetRefArea(TotalPositiveZArea); + else + config->SetRefArea(TotalPositiveYArea); if (rank == MASTER_NODE) { - if (D3) cout << "Reference area = "<< TotalPositiveZArea << A << ".\n"; - else cout << "Reference length = "<< TotalPositiveYArea << L << ".\n"; + if (D3) + cout << "Reference area = " << TotalPositiveZArea << A << ".\n"; + else + cout << "Reference length = " << TotalPositiveYArea << L << ".\n"; } } /*--- Set a semi-span value if no value is provided ---*/ if (config->GetSemiSpan() == 0.0) { - - if (D3) config->SetSemiSpan(fabs(TotalMaxCoordY)); - else config->SetSemiSpan(1.0); + if (D3) + config->SetSemiSpan(fabs(TotalMaxCoordY)); + else + config->SetSemiSpan(1.0); if (D3 && (rank == MASTER_NODE)) { - cout << "Semi-span length = "<< TotalMaxCoordY << L << ".\n"; + cout << "Semi-span length = " << TotalMaxCoordY << L << ".\n"; } } if (rank == MASTER_NODE) { + if (fea) + cout << "Surface area = " << TotalWettedArea; + else + cout << "Wetted area = " << TotalWettedArea; + if (D3 || axisymmetric) + cout << A << ".\n"; + else + cout << L << ".\n"; - if (fea) cout << "Surface area = "<< TotalWettedArea; - else cout << "Wetted area = "<< TotalWettedArea; - if (D3 || axisymmetric) cout << A << ".\n"; - else cout << L << ".\n"; - - cout << "Area projection in the x-plane = "<< TotalPositiveXArea << (D3? A : L); - cout << ", y-plane = "<< TotalPositiveYArea << (D3? A : L); - if (D3) cout << ", z-plane = "<< TotalPositiveZArea << A; + cout << "Area projection in the x-plane = " << TotalPositiveXArea << (D3 ? A : L); + cout << ", y-plane = " << TotalPositiveYArea << (D3 ? A : L); + if (D3) cout << ", z-plane = " << TotalPositiveZArea << A; cout << ".\n"; - cout << "Max. coordinate in the x-direction = "<< TotalMaxCoordX << L; - cout << ", y-direction = "<< TotalMaxCoordY << L; - if (D3) cout << ", z-direction = "<< TotalMaxCoordZ << L; + cout << "Max. coordinate in the x-direction = " << TotalMaxCoordX << L; + cout << ", y-direction = " << TotalMaxCoordY << L; + if (D3) cout << ", z-direction = " << TotalMaxCoordZ << L; cout << ".\n"; - cout << "Min. coordinate in the x-direction = "<< TotalMinCoordX << L; - cout << ", y-direction = "<< TotalMinCoordY << L; - if (D3) cout << ", z-direction = "<< TotalMinCoordZ << L; + cout << "Min. coordinate in the x-direction = " << TotalMinCoordX << L; + cout << ", y-direction = " << TotalMinCoordY << L; + if (D3) cout << ", z-direction = " << TotalMinCoordZ << L; cout << "." << endl; - } - } void CPhysicalGeometry::SetPoint_Connectivity() { - vector > points(nPoint); - SU2_OMP_PARALLEL - { - unsigned short Node_Neighbor, iNode, iNeighbor; - unsigned long jElem, Point_Neighbor, iPoint, iElem; - - /*--- Loop over all the elements ---*/ - BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS - { - vector > elems(nPoint); + SU2_OMP_PARALLEL { + unsigned short Node_Neighbor, iNode, iNeighbor; + unsigned long jElem, Point_Neighbor, iPoint, iElem; - for (iElem = 0; iElem < nElem; iElem++) { + /*--- Loop over all the elements ---*/ + BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS { + vector > elems(nPoint); - /*--- Loop over all the nodes of an element ---*/ - for (iNode = 0; iNode < elem[iElem]->GetnNodes(); iNode++) { - iPoint = elem[iElem]->GetNode(iNode); - elems[iPoint].push_back(iElem); + for (iElem = 0; iElem < nElem; iElem++) { + /*--- Loop over all the nodes of an element ---*/ + for (iNode = 0; iNode < elem[iElem]->GetnNodes(); iNode++) { + iPoint = elem[iElem]->GetNode(iNode); + elems[iPoint].push_back(iElem); + } } + nodes->SetElems(elems); } - nodes->SetElems(elems); - } - END_SU2_OMP_SAFE_GLOBAL_ACCESS + END_SU2_OMP_SAFE_GLOBAL_ACCESS - /*--- Loop over all the points ---*/ + /*--- Loop over all the points ---*/ - SU2_OMP_FOR_DYN(roundUpDiv(nPoint,2*omp_get_max_threads())) - for (iPoint = 0; iPoint < nPoint; iPoint++) { - - /*--- Loop over all elements shared by the point ---*/ - - for (iElem = 0; iElem < nodes->GetnElem(iPoint); iElem++) { - - jElem = nodes->GetElem(iPoint, iElem); + SU2_OMP_FOR_DYN(roundUpDiv(nPoint, 2 * omp_get_max_threads())) + for (iPoint = 0; iPoint < nPoint; iPoint++) { + /*--- Loop over all elements shared by the point ---*/ - /*--- If we find the point iPoint in the surrounding element ---*/ + for (iElem = 0; iElem < nodes->GetnElem(iPoint); iElem++) { + jElem = nodes->GetElem(iPoint, iElem); - for (iNode = 0; iNode < elem[jElem]->GetnNodes(); iNode++) { + /*--- If we find the point iPoint in the surrounding element ---*/ - if (elem[jElem]->GetNode(iNode) != iPoint) continue; + for (iNode = 0; iNode < elem[jElem]->GetnNodes(); iNode++) { + if (elem[jElem]->GetNode(iNode) != iPoint) continue; - /*--- Localize the local index of the neighbor of iPoint in the element ---*/ + /*--- Localize the local index of the neighbor of iPoint in the element ---*/ - for (iNeighbor = 0; iNeighbor < elem[jElem]->GetnNeighbor_Nodes(iNode); iNeighbor++) { - Node_Neighbor = elem[jElem]->GetNeighbor_Nodes(iNode, iNeighbor); - Point_Neighbor = elem[jElem]->GetNode(Node_Neighbor); + for (iNeighbor = 0; iNeighbor < elem[jElem]->GetnNeighbor_Nodes(iNode); iNeighbor++) { + Node_Neighbor = elem[jElem]->GetNeighbor_Nodes(iNode, iNeighbor); + Point_Neighbor = elem[jElem]->GetNode(Node_Neighbor); - /*--- Store the point into the point, if it is new ---*/ - auto End = points[iPoint].end(); - if (find(points[iPoint].begin(), End, Point_Neighbor) == End) - points[iPoint].push_back(Point_Neighbor); + /*--- Store the point into the point, if it is new ---*/ + auto End = points[iPoint].end(); + if (find(points[iPoint].begin(), End, Point_Neighbor) == End) points[iPoint].push_back(Point_Neighbor); + } } } - } - /*--- Set the number of neighbors variable, this is important for JST and multigrid in parallel. ---*/ - nodes->SetnNeighbor(iPoint, points[iPoint].size()); - } - END_SU2_OMP_FOR - - SU2_OMP_MASTER - nodes->SetPoints(points); - END_SU2_OMP_MASTER + /*--- Set the number of neighbors variable, this is important for JST and multigrid in parallel. ---*/ + nodes->SetnNeighbor(iPoint, points[iPoint].size()); + } + END_SU2_OMP_FOR + SU2_OMP_MASTER + nodes->SetPoints(points); + END_SU2_OMP_MASTER } END_SU2_OMP_PARALLEL } -void CPhysicalGeometry::SetRCM_Ordering(CConfig *config) { - +void CPhysicalGeometry::SetRCM_Ordering(CConfig* config) { /*--- The result is the RCM ordering, during the process it is also used as * the queue of new points considered by the algorithm. This is possible * because points move from the front of the queue to the back of the result, @@ -4785,7 +4478,6 @@ void CPhysicalGeometry::SetRCM_Ordering(CConfig *config) { /*--- Repeat as many times as necessary to handle disconnected graphs. ---*/ while (Result.size() < nPointDomain) { - /*--- Select the node with the lowest degree in the grid. ---*/ auto AddPoint = nPoint; auto MinDegree = std::numeric_limits::max(); @@ -4807,7 +4499,6 @@ void CPhysicalGeometry::SetRCM_Ordering(CConfig *config) { /*--- Loop until reorganizing all nodes connected to AddPoint. This will * also terminate early once the ordering + queue include all points. ---*/ while (QueueStart < Result.size() && Result.size() < nPointDomain) { - /*--- Move the start of the queue, equivalent to taking from the front of * the queue and inserting at the end of the result. ---*/ AddPoint = Result[QueueStart]; @@ -4826,11 +4517,9 @@ void CPhysicalGeometry::SetRCM_Ordering(CConfig *config) { if (AuxQueue.empty()) continue; /*--- Sort the auxiliar queue based on the number of neighbors (degree). ---*/ - stable_sort(AuxQueue.begin(), AuxQueue.end(), - [&](unsigned long iPoint, unsigned long jPoint) { - return nodes->GetnPoint(iPoint) < nodes->GetnPoint(jPoint); - } - ); + stable_sort(AuxQueue.begin(), AuxQueue.end(), [&](unsigned long iPoint, unsigned long jPoint) { + return nodes->GetnPoint(iPoint) < nodes->GetnPoint(jPoint); + }); Result.insert(Result.end(), AuxQueue.begin(), AuxQueue.end()); } } @@ -4868,7 +4557,7 @@ void CPhysicalGeometry::SetRCM_Ordering(CConfig *config) { for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { AuxGlobalIndex[iPoint] = nodes->GetGlobalIndex(iPoint); for (auto iDim = 0u; iDim < nDim; iDim++) { - AuxCoord(iPoint,iDim) = nodes->GetCoord(iPoint, iDim); + AuxCoord(iPoint, iDim) = nodes->GetCoord(iPoint, iDim); } } @@ -4879,7 +4568,7 @@ void CPhysicalGeometry::SetRCM_Ordering(CConfig *config) { /*--- Set the new conectivities ---*/ - auto& InvResult = AuxGlobalIndex; // alias to re-use storage + auto& InvResult = AuxGlobalIndex; // alias to re-use storage for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { InvResult[Result[iPoint]] = iPoint; } @@ -4893,9 +4582,7 @@ void CPhysicalGeometry::SetRCM_Ordering(CConfig *config) { for (auto iMarker = 0u; iMarker < nMarker; iMarker++) { for (auto iElem = 0ul; iElem < nElem_Bound[iMarker]; iElem++) { - - if (config->GetMarker_All_KindBC(iMarker) == SEND_RECEIVE && - config->GetMarker_All_SendRecv(iMarker) < 0) { + if (config->GetMarker_All_KindBC(iMarker) == SEND_RECEIVE && config->GetMarker_All_SendRecv(iMarker) < 0) { nodes->SetDomain(bound[iMarker][iElem]->GetNode(0), false); } @@ -4909,21 +4596,18 @@ void CPhysicalGeometry::SetRCM_Ordering(CConfig *config) { config->GetMarker_All_KindBC(iMarker) != PERIODIC_BOUNDARY) nodes->SetPhysicalBoundary(InvResult[iPoint], true); - if (config->GetSolid_Wall(iMarker)) - nodes->SetSolidBoundary(InvResult[iPoint], true); + if (config->GetSolid_Wall(iMarker)) nodes->SetSolidBoundary(InvResult[iPoint], true); - if (config->GetViscous_Wall(iMarker) ) - nodes->SetViscousBoundary(InvResult[iPoint], true); + if (config->GetViscous_Wall(iMarker)) nodes->SetViscousBoundary(InvResult[iPoint], true); if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) nodes->SetPeriodicBoundary(InvResult[iPoint], true); } } } - } -void CPhysicalGeometry::SetElement_Connectivity(void) { +void CPhysicalGeometry::SetElement_Connectivity() { unsigned short first_elem_face, second_elem_face, iFace, iNode, jElem; unsigned long face_point, Test_Elem, iElem; @@ -4943,7 +4627,6 @@ void CPhysicalGeometry::SetElement_Connectivity(void) { if ((elem[iElem]->GetNeighbor_Elements(iFace) == -1) && (iElem < Test_Elem) && FindFace(iElem, Test_Elem, first_elem_face, second_elem_face)) { - /*--- Localice which faces are sharing both elements ---*/ elem[iElem]->SetNeighbor_Elements(Test_Elem, first_elem_face); @@ -4951,27 +4634,26 @@ void CPhysicalGeometry::SetElement_Connectivity(void) { /*--- Store the element for both elements ---*/ elem[Test_Elem]->SetNeighbor_Elements(iElem, second_elem_face); - } } } } -void CPhysicalGeometry::SetBoundVolume(void) { +void CPhysicalGeometry::SetBoundVolume() { unsigned short cont, iMarker, iElem, iNode_Domain, iNode_Surface; unsigned long Point_Domain, Point_Surface, Point, iElem_Surface, iElem_Domain; bool CheckVol; for (iMarker = 0; iMarker < nMarker; iMarker++) for (iElem_Surface = 0; iElem_Surface < nElem_Bound[iMarker]; iElem_Surface++) { - /*--- Choose and arbitrary point from the surface --*/ Point = bound[iMarker][iElem_Surface]->GetNode(0); CheckVol = false; for (iElem = 0; iElem < nodes->GetnElem(Point); iElem++) { /*--- Look for elements surronding that point --*/ - cont = 0; iElem_Domain = nodes->GetElem(Point, iElem); + cont = 0; + iElem_Domain = nodes->GetElem(Point, iElem); for (iNode_Domain = 0; iNode_Domain < elem[iElem_Domain]->GetnNodes(); iNode_Domain++) { Point_Domain = elem[iElem_Domain]->GetNode(iNode_Domain); for (iNode_Surface = 0; iNode_Surface < bound[iMarker][iElem_Surface]->GetnNodes(); iNode_Surface++) { @@ -4990,27 +4672,25 @@ void CPhysicalGeometry::SetBoundVolume(void) { } if (!CheckVol) { char buf[100]; - SPRINTF(buf,"The surface element (%u, %lu) doesn't have an associated volume element", iMarker, iElem_Surface ); + SPRINTF(buf, "The surface element (%u, %lu) doesn't have an associated volume element", iMarker, iElem_Surface); SU2_MPI::Error(buf, CURRENT_FUNCTION); } } } -void CPhysicalGeometry::SetVertex(const CConfig *config) { - unsigned long iPoint, iVertex, iElem; +void CPhysicalGeometry::SetVertex(const CConfig* config) { + unsigned long iPoint, iVertex, iElem; unsigned short iMarker, iNode; /*--- Initialize the Vertex vector for each node of the grid ---*/ for (iPoint = 0; iPoint < nPoint; iPoint++) - for (iMarker = 0; iMarker < nMarker; iMarker++) - nodes->SetVertex(iPoint, -1, iMarker); + for (iMarker = 0; iMarker < nMarker; iMarker++) nodes->SetVertex(iPoint, -1, iMarker); /*--- Create and compute the vector with the number of vertex per marker ---*/ - nVertex = new unsigned long [nMarker]; + nVertex = new unsigned long[nMarker]; for (iMarker = 0; iMarker < nMarker; iMarker++) { - /*--- Initialize the number of Bound Vertex for each Marker ---*/ nVertex[iMarker] = 0; @@ -5030,15 +4710,14 @@ void CPhysicalGeometry::SetVertex(const CConfig *config) { /*--- Initialize the Vertex vector for each node, the previous result is deleted ---*/ for (iPoint = 0; iPoint < nPoint; iPoint++) - for (iMarker = 0; iMarker < nMarker; iMarker++) - nodes->SetVertex(iPoint, -1, iMarker); + for (iMarker = 0; iMarker < nMarker; iMarker++) nodes->SetVertex(iPoint, -1, iMarker); /*--- Create the bound vertex structure, note that the order is the same as in the input file, this is important for Send/Receive part ---*/ vertex = new CVertex**[nMarker]; for (iMarker = 0; iMarker < nMarker; iMarker++) { - vertex[iMarker] = new CVertex* [nVertex[iMarker]]; + vertex[iMarker] = new CVertex*[nVertex[iMarker]]; nVertex[iMarker] = 0; /*--- Initialize the number of Bound Vertex for each Marker ---*/ @@ -5063,7 +4742,8 @@ void CPhysicalGeometry::SetVertex(const CConfig *config) { } } -void CPhysicalGeometry::ComputeNSpan(CConfig *config, unsigned short val_iZone, unsigned short marker_flag, bool allocate) { +void CPhysicalGeometry::ComputeNSpan(CConfig* config, unsigned short val_iZone, unsigned short marker_flag, + bool allocate) { unsigned short iMarker, jMarker, iMarkerTP, iSpan, jSpan; unsigned long iPoint, iVertex; long jVertex; @@ -5078,40 +4758,37 @@ void CPhysicalGeometry::ComputeNSpan(CConfig *config, unsigned short val_iZone, nSpan = 0; nSpan_loc = 0; - if (nDim == 2){ - nSpanWiseSections[marker_flag-1] = 1; - //TODO (turbo) make it more genral - if(marker_flag == OUTFLOW) config->SetnSpanWiseSections(1); + if (nDim == 2) { + nSpanWiseSections[marker_flag - 1] = 1; + // TODO (turbo) make it more genral + if (marker_flag == OUTFLOW) config->SetnSpanWiseSections(1); /*---Initilize the vector of span-wise values that will be ordered ---*/ - SpanWiseValue[marker_flag -1] = new su2double[1]; - for (iSpan = 0; iSpan < 1; iSpan++){ - SpanWiseValue[marker_flag -1][iSpan] = 0; + SpanWiseValue[marker_flag - 1] = new su2double[1]; + for (iSpan = 0; iSpan < 1; iSpan++) { + SpanWiseValue[marker_flag - 1][iSpan] = 0; } - } - else{ - if(SpanWise_Kind == AUTOMATIC){ + } else { + if (SpanWise_Kind == AUTOMATIC) { /*--- loop to find inflow of outflow marker---*/ - for (iMarker = 0; iMarker < nMarker; iMarker++){ - for (iMarkerTP=1; iMarkerTP < config->GetnMarker_Turbomachinery()+1; iMarkerTP++){ - + for (iMarker = 0; iMarker < nMarker; iMarker++) { + for (iMarkerTP = 1; iMarkerTP < config->GetnMarker_Turbomachinery() + 1; iMarkerTP++) { if (config->GetMarker_All_Turbomachinery(iMarker) != iMarkerTP) continue; if (config->GetMarker_All_TurbomachineryFlag(iMarker) != marker_flag) continue; /*--- loop to find the vertex that ar both of inflow or outflow marker and on the periodic * in order to caount the number of Span ---*/ - for (jMarker = 0; jMarker < nMarker; jMarker++){ + for (jMarker = 0; jMarker < nMarker; jMarker++) { if (config->GetMarker_All_KindBC(jMarker) != PERIODIC_BOUNDARY) continue; for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - iPoint = vertex[iMarker][iVertex]->GetNode(); if (!nodes->GetDomain(iPoint)) continue; PeriodicBoundary = config->GetMarker_All_PerBound(jMarker); jVertex = nodes->GetVertex(iPoint, jMarker); - if ((jVertex != -1) && (PeriodicBoundary == (val_iZone + 1))){ + if ((jVertex != -1) && (PeriodicBoundary == (val_iZone + 1))) { nSpan++; } } @@ -5125,61 +4802,57 @@ void CPhysicalGeometry::ComputeNSpan(CConfig *config, unsigned short val_iZone, SU2_MPI::Allreduce(&nSpan_loc, &nSpan_max, 1, MPI_INT, MPI_MAX, SU2_MPI::GetComm()); /*--- initialize the vector that will contain the disordered values span-wise ---*/ - nSpanWiseSections[marker_flag -1] = nSpan; + nSpanWiseSections[marker_flag - 1] = nSpan; valueSpan = new su2double[nSpan]; - for (iSpan = 0; iSpan < nSpan; iSpan ++ ){ + for (iSpan = 0; iSpan < nSpan; iSpan++) { valueSpan[iSpan] = -1001.0; } /*--- store the local span-wise value for each processor ---*/ nSpan_loc = 0; - for (iMarker = 0; iMarker < nMarker; iMarker++){ - for (iMarkerTP=1; iMarkerTP < config->GetnMarker_Turbomachinery()+1; iMarkerTP++){ - + for (iMarker = 0; iMarker < nMarker; iMarker++) { + for (iMarkerTP = 1; iMarkerTP < config->GetnMarker_Turbomachinery() + 1; iMarkerTP++) { if (config->GetMarker_All_Turbomachinery(iMarker) != iMarkerTP) continue; if (config->GetMarker_All_TurbomachineryFlag(iMarker) != marker_flag) continue; - for (jMarker = 0; jMarker < nMarker; jMarker++){ + for (jMarker = 0; jMarker < nMarker; jMarker++) { if (config->GetMarker_All_KindBC(jMarker) != PERIODIC_BOUNDARY) continue; for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - iPoint = vertex[iMarker][iVertex]->GetNode(); if (!nodes->GetDomain(iPoint)) continue; PeriodicBoundary = config->GetMarker_All_PerBound(jMarker); jVertex = nodes->GetVertex(iPoint, jMarker); - if ((jVertex != -1) && (PeriodicBoundary == (val_iZone + 1))){ + if ((jVertex != -1) && (PeriodicBoundary == (val_iZone + 1))) { coord = nodes->GetCoord(iPoint); - radius = sqrt(coord[0]*coord[0]+coord[1]*coord[1]); - switch (config->GetKind_TurboMachinery(val_iZone)){ - case CENTRIFUGAL: - valueSpan[nSpan_loc] = coord[2]; - break; - case CENTRIPETAL: - valueSpan[nSpan_loc] = coord[2]; - break; - case AXIAL: - valueSpan[nSpan_loc] = radius; - break; - case CENTRIPETAL_AXIAL: - if (marker_flag == OUTFLOW){ - valueSpan[nSpan_loc] = radius; - } - else{ + radius = sqrt(coord[0] * coord[0] + coord[1] * coord[1]); + switch (config->GetKind_TurboMachinery(val_iZone)) { + case CENTRIFUGAL: valueSpan[nSpan_loc] = coord[2]; - } - break; - case AXIAL_CENTRIFUGAL: - if (marker_flag == INFLOW){ - valueSpan[nSpan_loc] = radius; - } - else{ + break; + case CENTRIPETAL: valueSpan[nSpan_loc] = coord[2]; - } - break; + break; + case AXIAL: + valueSpan[nSpan_loc] = radius; + break; + case CENTRIPETAL_AXIAL: + if (marker_flag == OUTFLOW) { + valueSpan[nSpan_loc] = radius; + } else { + valueSpan[nSpan_loc] = coord[2]; + } + break; + case AXIAL_CENTRIFUGAL: + if (marker_flag == INFLOW) { + valueSpan[nSpan_loc] = radius; + } else { + valueSpan[nSpan_loc] = coord[2]; + } + break; } nSpan_loc++; } @@ -5190,96 +4863,92 @@ void CPhysicalGeometry::ComputeNSpan(CConfig *config, unsigned short val_iZone, /*--- Gather the span-wise values on all the processor ---*/ - vector MyTotValueSpan(nSpan_max*size, -1001.0); + vector MyTotValueSpan(nSpan_max * size, -1001.0); vector MyValueSpan(nSpan_max, -1001.0); vector My_nSpan_loc(size); - for(iSpan = 0; iSpanGet_nSpanWiseSections_User(); - SpanWiseValue[marker_flag -1] = new su2double[config->Get_nSpanWiseSections_User()]; - for (iSpan = 0; iSpan < config->Get_nSpanWiseSections_User(); iSpan++){ - SpanWiseValue[marker_flag -1][iSpan] = 0; + nSpanWiseSections[marker_flag - 1] = config->Get_nSpanWiseSections_User(); + SpanWiseValue[marker_flag - 1] = new su2double[config->Get_nSpanWiseSections_User()]; + for (iSpan = 0; iSpan < config->Get_nSpanWiseSections_User(); iSpan++) { + SpanWiseValue[marker_flag - 1][iSpan] = 0; } /*--- Compute maximum and minimum value span-wise---*/ min = 1E+07; - max =-1E+07; - for (iMarker = 0; iMarker < nMarker; iMarker++){ - for (iMarkerTP=1; iMarkerTP < config->GetnMarker_Turbomachinery()+1; iMarkerTP++){ - + max = -1E+07; + for (iMarker = 0; iMarker < nMarker; iMarker++) { + for (iMarkerTP = 1; iMarkerTP < config->GetnMarker_Turbomachinery() + 1; iMarkerTP++) { if (config->GetMarker_All_Turbomachinery(iMarker) != iMarkerTP) continue; if (config->GetMarker_All_TurbomachineryFlag(iMarker) != marker_flag) continue; - for (jMarker = 0; jMarker < nMarker; jMarker++){ + for (jMarker = 0; jMarker < nMarker; jMarker++) { if (config->GetMarker_All_KindBC(jMarker) != PERIODIC_BOUNDARY) continue; for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - iPoint = vertex[iMarker][iVertex]->GetNode(); if (!nodes->GetDomain(iPoint)) continue; PeriodicBoundary = config->GetMarker_All_PerBound(jMarker); jVertex = nodes->GetVertex(iPoint, jMarker); - if ((jVertex != -1) && (PeriodicBoundary == (val_iZone + 1))){ - + if ((jVertex != -1) && (PeriodicBoundary == (val_iZone + 1))) { coord = nodes->GetCoord(iPoint); - radius = sqrt(coord[0]*coord[0]+coord[1]*coord[1]); - switch (config->GetKind_TurboMachinery(val_iZone)){ - case CENTRIFUGAL: - case CENTRIPETAL: - if (coord[2] < min) min = coord[2]; - if (coord[2] > max) max = coord[2]; - break; - case AXIAL: - if (radius < min) min = radius; - if (radius > max) max = radius; - break; - case CENTRIPETAL_AXIAL: - if (marker_flag == OUTFLOW){ - if (radius < min) min = radius; - if (radius > max) max = radius; - } - else{ + radius = sqrt(coord[0] * coord[0] + coord[1] * coord[1]); + switch (config->GetKind_TurboMachinery(val_iZone)) { + case CENTRIFUGAL: + case CENTRIPETAL: if (coord[2] < min) min = coord[2]; if (coord[2] > max) max = coord[2]; - } - break; - case AXIAL_CENTRIFUGAL: - if (marker_flag == INFLOW){ + break; + case AXIAL: if (radius < min) min = radius; if (radius > max) max = radius; - } - else{ - if (coord[2] < min) min = coord[2]; - if (coord[2] > max) max = coord[2]; - } - break; + break; + case CENTRIPETAL_AXIAL: + if (marker_flag == OUTFLOW) { + if (radius < min) min = radius; + if (radius > max) max = radius; + } else { + if (coord[2] < min) min = coord[2]; + if (coord[2] > max) max = coord[2]; + } + break; + case AXIAL_CENTRIFUGAL: + if (marker_flag == INFLOW) { + if (radius < min) min = radius; + if (radius > max) max = radius; + } else { + if (coord[2] < min) min = coord[2]; + if (coord[2] > max) max = coord[2]; + } + break; } } } @@ -5287,115 +4956,120 @@ void CPhysicalGeometry::ComputeNSpan(CConfig *config, unsigned short val_iZone, } } /*--- compute global minimum and maximum value on span-wise ---*/ - MyMin= min; min = 0; - MyMax= max; max = 0; + MyMin = min; + min = 0; + MyMax = max; + max = 0; SU2_MPI::Allreduce(&MyMin, &min, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&MyMax, &max, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); /*--- compute height value for each spanwise section---*/ - delta = (max - min)/(nSpanWiseSections[marker_flag-1] -1); - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - SpanWiseValue[marker_flag - 1][iSpan]= min + delta*iSpan; + delta = (max - min) / (nSpanWiseSections[marker_flag - 1] - 1); + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + SpanWiseValue[marker_flag - 1][iSpan] = min + delta * iSpan; } } - if(marker_flag == OUTFLOW){ - if(nSpanWiseSections[INFLOW -1] != nSpanWiseSections[OUTFLOW - 1]){ + if (marker_flag == OUTFLOW) { + if (nSpanWiseSections[INFLOW - 1] != nSpanWiseSections[OUTFLOW - 1]) { char buf[100]; - SPRINTF(buf, "nSpan inflow %u, nSpan outflow %u", nSpanWiseSections[INFLOW-1], nSpanWiseSections[OUTFLOW-1]); - SU2_MPI::Error(string(" At the moment only turbomachinery with the same amount of span-wise section can be simulated\n") + buf, CURRENT_FUNCTION); - } - else{ - config->SetnSpanWiseSections(nSpanWiseSections[OUTFLOW -1]); + SPRINTF(buf, "nSpan inflow %u, nSpan outflow %u", nSpanWiseSections[INFLOW - 1], + nSpanWiseSections[OUTFLOW - 1]); + SU2_MPI::Error( + string(" At the moment only turbomachinery with the same amount of span-wise section can be simulated\n") + + buf, + CURRENT_FUNCTION); + } else { + config->SetnSpanWiseSections(nSpanWiseSections[OUTFLOW - 1]); } } - } - } -void CPhysicalGeometry::SetTurboVertex(CConfig *config, unsigned short val_iZone, unsigned short marker_flag, bool allocate) { - unsigned long iPoint, **ordered, **disordered, **oldVertex3D, iInternalVertex; +void CPhysicalGeometry::SetTurboVertex(CConfig* config, unsigned short val_iZone, unsigned short marker_flag, + bool allocate) { + unsigned long iPoint, **ordered, **disordered, **oldVertex3D, iInternalVertex; unsigned long nVert, nVertMax; unsigned short iMarker, iMarkerTP, iSpan, jSpan, iDim; - su2double min, minInt, max, *coord, dist, Normal2, *TurboNormal, *NormalArea, target = 0.0, **area, ***unitnormal, Area = 0.0; - bool **checkAssign; - min = 10.0E+06; - minInt = 10.0E+06; - max = -10.0E+06; + su2double min, minInt, max, *coord, dist, Normal2, *TurboNormal, *NormalArea, target = 0.0, **area, ***unitnormal, + Area = 0.0; + bool** checkAssign; + min = 10.0E+06; + minInt = 10.0E+06; + max = -10.0E+06; su2double radius; long iVertex, iSpanVertex, jSpanVertex, kSpanVertex = 0; int *nTotVertex_gb, *nVertexSpanHalo; - su2double **x_loc, **y_loc, **z_loc, **angCoord_loc, **deltaAngCoord_loc, **angPitch, **deltaAngPitch, *minIntAngPitch, - *minAngPitch, *maxAngPitch; - int **rank_loc; + su2double **x_loc, **y_loc, **z_loc, **angCoord_loc, **deltaAngCoord_loc, **angPitch, **deltaAngPitch, + *minIntAngPitch, *minAngPitch, *maxAngPitch; + int** rank_loc; #ifdef HAVE_MPI unsigned short iSize, kSize = 0, jSize; - su2double MyMin,MyIntMin, MyMax; - su2double *x_gb = NULL, *y_gb = NULL, *z_gb = NULL, *angCoord_gb = NULL, *deltaAngCoord_gb = NULL; - bool *checkAssign_gb =NULL; + su2double MyMin, MyIntMin, MyMax; + su2double *x_gb = nullptr, *y_gb = nullptr, *z_gb = nullptr, *angCoord_gb = nullptr, *deltaAngCoord_gb = nullptr; + bool* checkAssign_gb = nullptr; unsigned long My_nVert; #endif string multizone_filename; - x_loc = new su2double*[nSpanWiseSections[marker_flag-1]]; - y_loc = new su2double*[nSpanWiseSections[marker_flag-1]]; - z_loc = new su2double*[nSpanWiseSections[marker_flag-1]]; - angCoord_loc = new su2double*[nSpanWiseSections[marker_flag-1]]; - deltaAngCoord_loc = new su2double*[nSpanWiseSections[marker_flag-1]]; - angPitch = new su2double*[nSpanWiseSections[marker_flag-1]]; - deltaAngPitch = new su2double*[nSpanWiseSections[marker_flag-1]]; - rank_loc = new int*[nSpanWiseSections[marker_flag-1]]; - minAngPitch = new su2double[nSpanWiseSections[marker_flag-1]]; - minIntAngPitch = new su2double[nSpanWiseSections[marker_flag-1]]; - maxAngPitch = new su2double[nSpanWiseSections[marker_flag-1]]; - - nTotVertex_gb = new int[nSpanWiseSections[marker_flag-1]]; - nVertexSpanHalo = new int[nSpanWiseSections[marker_flag-1]]; - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - nTotVertex_gb[iSpan] = -1; + x_loc = new su2double*[nSpanWiseSections[marker_flag - 1]]; + y_loc = new su2double*[nSpanWiseSections[marker_flag - 1]]; + z_loc = new su2double*[nSpanWiseSections[marker_flag - 1]]; + angCoord_loc = new su2double*[nSpanWiseSections[marker_flag - 1]]; + deltaAngCoord_loc = new su2double*[nSpanWiseSections[marker_flag - 1]]; + angPitch = new su2double*[nSpanWiseSections[marker_flag - 1]]; + deltaAngPitch = new su2double*[nSpanWiseSections[marker_flag - 1]]; + rank_loc = new int*[nSpanWiseSections[marker_flag - 1]]; + minAngPitch = new su2double[nSpanWiseSections[marker_flag - 1]]; + minIntAngPitch = new su2double[nSpanWiseSections[marker_flag - 1]]; + maxAngPitch = new su2double[nSpanWiseSections[marker_flag - 1]]; + + nTotVertex_gb = new int[nSpanWiseSections[marker_flag - 1]]; + nVertexSpanHalo = new int[nSpanWiseSections[marker_flag - 1]]; + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + nTotVertex_gb[iSpan] = -1; nVertexSpanHalo[iSpan] = 0; - minAngPitch[iSpan] = 10.0E+06; - minIntAngPitch[iSpan] = 10.0E+06; - maxAngPitch[iSpan] = -10.0E+06; + minAngPitch[iSpan] = 10.0E+06; + minIntAngPitch[iSpan] = 10.0E+06; + maxAngPitch[iSpan] = -10.0E+06; } /*--- Initialize auxiliary pointers ---*/ - TurboNormal = new su2double[3]; - NormalArea = new su2double[3]; - ordered = new unsigned long* [nSpanWiseSections[marker_flag-1]]; - disordered = new unsigned long* [nSpanWiseSections[marker_flag-1]]; - oldVertex3D = new unsigned long* [nSpanWiseSections[marker_flag-1]]; - area = new su2double* [nSpanWiseSections[marker_flag-1]]; - unitnormal = new su2double** [nSpanWiseSections[marker_flag-1]]; - checkAssign = new bool* [nSpanWiseSections[marker_flag-1]]; + TurboNormal = new su2double[3]; + NormalArea = new su2double[3]; + ordered = new unsigned long*[nSpanWiseSections[marker_flag - 1]]; + disordered = new unsigned long*[nSpanWiseSections[marker_flag - 1]]; + oldVertex3D = new unsigned long*[nSpanWiseSections[marker_flag - 1]]; + area = new su2double*[nSpanWiseSections[marker_flag - 1]]; + unitnormal = new su2double**[nSpanWiseSections[marker_flag - 1]]; + checkAssign = new bool*[nSpanWiseSections[marker_flag - 1]]; /*--- Initialize the new Vertex structure. The if statement ensures that these vectors are initialized * only once even if the routine is called more than once.---*/ - if (allocate){ - for (iMarker = 0; iMarker < nMarker; iMarker++){ - for (iMarkerTP=1; iMarkerTP < config->GetnMarker_Turbomachinery()+1; iMarkerTP++){ - if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP){ - if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag){ - nSpanSectionsByMarker[iMarker] = nSpanWiseSections[marker_flag-1]; - nVertexSpan[iMarker] = new long[nSpanWiseSections[marker_flag-1]]; - turbovertex[iMarker] = new CTurboVertex** [nSpanWiseSections[marker_flag-1]]; - nTotVertexSpan[iMarker] = new unsigned long [nSpanWiseSections[marker_flag-1] +1]; - MaxAngularCoord[iMarker] = new su2double [nSpanWiseSections[marker_flag-1]]; - MinAngularCoord[iMarker] = new su2double [nSpanWiseSections[marker_flag-1]]; - MinRelAngularCoord[iMarker] = new su2double [nSpanWiseSections[marker_flag-1]]; - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - nVertexSpan[iMarker][iSpan] = 0; - turbovertex[iMarker][iSpan] = nullptr; - MinAngularCoord[iMarker][iSpan] = 10.0E+06; - MaxAngularCoord[iMarker][iSpan] = -10.0E+06; + if (allocate) { + for (iMarker = 0; iMarker < nMarker; iMarker++) { + for (iMarkerTP = 1; iMarkerTP < config->GetnMarker_Turbomachinery() + 1; iMarkerTP++) { + if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP) { + if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag) { + nSpanSectionsByMarker[iMarker] = nSpanWiseSections[marker_flag - 1]; + nVertexSpan[iMarker] = new long[nSpanWiseSections[marker_flag - 1]]; + turbovertex[iMarker] = new CTurboVertex**[nSpanWiseSections[marker_flag - 1]]; + nTotVertexSpan[iMarker] = new unsigned long[nSpanWiseSections[marker_flag - 1] + 1]; + MaxAngularCoord[iMarker] = new su2double[nSpanWiseSections[marker_flag - 1]]; + MinAngularCoord[iMarker] = new su2double[nSpanWiseSections[marker_flag - 1]]; + MinRelAngularCoord[iMarker] = new su2double[nSpanWiseSections[marker_flag - 1]]; + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + nVertexSpan[iMarker][iSpan] = 0; + turbovertex[iMarker][iSpan] = nullptr; + MinAngularCoord[iMarker][iSpan] = 10.0E+06; + MaxAngularCoord[iMarker][iSpan] = -10.0E+06; MinRelAngularCoord[iMarker][iSpan] = 10.0E+06; } - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1] +1; iSpan++){ - nTotVertexSpan[iMarker][iSpan] = 0; + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1] + 1; iSpan++) { + nTotVertexSpan[iMarker][iSpan] = 0; } } } @@ -5403,330 +5077,324 @@ void CPhysicalGeometry::SetTurboVertex(CConfig *config, unsigned short val_iZone } } - //this works only for turbomachinery rotating around the Z-Axes. - // the reordering algorithm pitch-wise assumes that X-coordinate of each boundary vertex is positive so that reordering can be based on the Y-coordinate. - for (iMarker = 0; iMarker < nMarker; iMarker++){ - for (iMarkerTP=1; iMarkerTP < config->GetnMarker_Turbomachinery()+1; iMarkerTP++){ - if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP){ - if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag){ - - /*--- compute the amount of vertexes for each span-wise section to initialize the CTurboVertex pointers and auxiliary pointers ---*/ - for (iVertex = 0; (unsigned long)iVertex < nVertex[iMarker]; iVertex++) { - iPoint = vertex[iMarker][iVertex]->GetNode(); - if (nDim == 3){ - dist = 10E+06; - jSpan = std::numeric_limits::max(); - coord = nodes->GetCoord(iPoint); + // this works only for turbomachinery rotating around the Z-Axes. + // the reordering algorithm pitch-wise assumes that X-coordinate of each boundary vertex is positive so that + // reordering can be based on the Y-coordinate. + for (iMarker = 0; iMarker < nMarker; iMarker++) { + for (iMarkerTP = 1; iMarkerTP < config->GetnMarker_Turbomachinery() + 1; iMarkerTP++) { + if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP) { + if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag) { + /*--- compute the amount of vertexes for each span-wise section to initialize the CTurboVertex pointers and + * auxiliary pointers ---*/ + for (iVertex = 0; (unsigned long)iVertex < nVertex[iMarker]; iVertex++) { + iPoint = vertex[iMarker][iVertex]->GetNode(); + if (nDim == 3) { + dist = 10E+06; + jSpan = std::numeric_limits::max(); + coord = nodes->GetCoord(iPoint); - switch (config->GetKind_TurboMachinery(val_iZone)){ - case CENTRIFUGAL: case CENTRIPETAL: - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - if (dist > (abs(coord[2]-SpanWiseValue[marker_flag-1][iSpan]))){ - dist= abs(coord[2]-SpanWiseValue[marker_flag-1][iSpan]); - jSpan=iSpan; + switch (config->GetKind_TurboMachinery(val_iZone)) { + case CENTRIFUGAL: + case CENTRIPETAL: + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + if (dist > (abs(coord[2] - SpanWiseValue[marker_flag - 1][iSpan]))) { + dist = abs(coord[2] - SpanWiseValue[marker_flag - 1][iSpan]); + jSpan = iSpan; } } break; case AXIAL: - radius = sqrt(coord[0]*coord[0]+coord[1]*coord[1]); - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - if (dist > (abs(radius - SpanWiseValue[marker_flag-1][iSpan]))){ - dist= abs(radius-SpanWiseValue[marker_flag-1][iSpan]); - jSpan=iSpan; + radius = sqrt(coord[0] * coord[0] + coord[1] * coord[1]); + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + if (dist > (abs(radius - SpanWiseValue[marker_flag - 1][iSpan]))) { + dist = abs(radius - SpanWiseValue[marker_flag - 1][iSpan]); + jSpan = iSpan; } } break; case CENTRIPETAL_AXIAL: - if (marker_flag == OUTFLOW){ - radius = sqrt(coord[0]*coord[0]+coord[1]*coord[1]); - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - if (dist > (abs(radius - SpanWiseValue[marker_flag-1][iSpan]))){ - dist= abs(radius-SpanWiseValue[marker_flag-1][iSpan]); - jSpan=iSpan; + if (marker_flag == OUTFLOW) { + radius = sqrt(coord[0] * coord[0] + coord[1] * coord[1]); + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + if (dist > (abs(radius - SpanWiseValue[marker_flag - 1][iSpan]))) { + dist = abs(radius - SpanWiseValue[marker_flag - 1][iSpan]); + jSpan = iSpan; } } - } - else{ - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - if (dist > (abs(coord[2]-SpanWiseValue[marker_flag-1][iSpan]))){ - dist= abs(coord[2]-SpanWiseValue[marker_flag-1][iSpan]); - jSpan=iSpan; + } else { + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + if (dist > (abs(coord[2] - SpanWiseValue[marker_flag - 1][iSpan]))) { + dist = abs(coord[2] - SpanWiseValue[marker_flag - 1][iSpan]); + jSpan = iSpan; } } } break; case AXIAL_CENTRIFUGAL: - if (marker_flag == INFLOW){ - radius = sqrt(coord[0]*coord[0]+coord[1]*coord[1]); - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - if (dist > (abs(radius - SpanWiseValue[marker_flag-1][iSpan]))){ - dist= abs(radius-SpanWiseValue[marker_flag-1][iSpan]); - jSpan=iSpan; + if (marker_flag == INFLOW) { + radius = sqrt(coord[0] * coord[0] + coord[1] * coord[1]); + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + if (dist > (abs(radius - SpanWiseValue[marker_flag - 1][iSpan]))) { + dist = abs(radius - SpanWiseValue[marker_flag - 1][iSpan]); + jSpan = iSpan; } } - } - else{ - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - if (dist > (abs(coord[2]-SpanWiseValue[marker_flag-1][iSpan]))){ - dist= abs(coord[2]-SpanWiseValue[marker_flag-1][iSpan]); - jSpan=iSpan; + } else { + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + if (dist > (abs(coord[2] - SpanWiseValue[marker_flag - 1][iSpan]))) { + dist = abs(coord[2] - SpanWiseValue[marker_flag - 1][iSpan]); + jSpan = iSpan; } } } break; - } } + } - /*--- 2D problem do not need span-wise separation---*/ - else{ - jSpan = 0; - } + /*--- 2D problem do not need span-wise separation---*/ + else { + jSpan = 0; + } - if(nodes->GetDomain(iPoint)){ - nVertexSpan[iMarker][jSpan]++; - } - nVertexSpanHalo[jSpan]++; + if (nodes->GetDomain(iPoint)) { + nVertexSpan[iMarker][jSpan]++; } + nVertexSpanHalo[jSpan]++; + } - /*--- initialize the CTurboVertex pointers and auxiliary pointers ---*/ - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - if (allocate){ - turbovertex[iMarker][iSpan] = new CTurboVertex* [nVertexSpan[iMarker][iSpan]]; - for (iVertex = 0; iVertex < nVertexSpan[iMarker][iSpan]; iVertex++){ - turbovertex[iMarker][iSpan][iVertex] = nullptr; - } - } - ordered[iSpan] = new unsigned long [nVertexSpanHalo[iSpan]]; - disordered[iSpan] = new unsigned long [nVertexSpanHalo[iSpan]]; - oldVertex3D[iSpan] = new unsigned long [nVertexSpanHalo[iSpan]]; - checkAssign[iSpan] = new bool [nVertexSpanHalo[iSpan]]; - area[iSpan] = new su2double [nVertexSpanHalo[iSpan]]; - unitnormal[iSpan] = new su2double* [nVertexSpanHalo[iSpan]]; - for (iVertex = 0; iVertex < nVertexSpanHalo[iSpan]; iVertex++){ - unitnormal[iSpan][iVertex] = new su2double [nDim]; + /*--- initialize the CTurboVertex pointers and auxiliary pointers ---*/ + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + if (allocate) { + turbovertex[iMarker][iSpan] = new CTurboVertex*[nVertexSpan[iMarker][iSpan]]; + for (iVertex = 0; iVertex < nVertexSpan[iMarker][iSpan]; iVertex++) { + turbovertex[iMarker][iSpan][iVertex] = nullptr; } - angPitch[iSpan] = new su2double [nVertexSpanHalo[iSpan]]; - deltaAngPitch[iSpan] = new su2double [nVertexSpanHalo[iSpan]]; - nVertexSpanHalo[iSpan] = 0; } + ordered[iSpan] = new unsigned long[nVertexSpanHalo[iSpan]]; + disordered[iSpan] = new unsigned long[nVertexSpanHalo[iSpan]]; + oldVertex3D[iSpan] = new unsigned long[nVertexSpanHalo[iSpan]]; + checkAssign[iSpan] = new bool[nVertexSpanHalo[iSpan]]; + area[iSpan] = new su2double[nVertexSpanHalo[iSpan]]; + unitnormal[iSpan] = new su2double*[nVertexSpanHalo[iSpan]]; + for (iVertex = 0; iVertex < nVertexSpanHalo[iSpan]; iVertex++) { + unitnormal[iSpan][iVertex] = new su2double[nDim]; + } + angPitch[iSpan] = new su2double[nVertexSpanHalo[iSpan]]; + deltaAngPitch[iSpan] = new su2double[nVertexSpanHalo[iSpan]]; + nVertexSpanHalo[iSpan] = 0; + } - /*--- store the vertexes in a ordered manner in span-wise directions but not yet ordered pitch-wise ---*/ - for (iVertex = 0; (unsigned long)iVertex < nVertex[iMarker]; iVertex++) { - iPoint = vertex[iMarker][iVertex]->GetNode(); - if(nDim == 3){ - dist = 10E+06; - jSpan = std::numeric_limits::max(); + /*--- store the vertexes in a ordered manner in span-wise directions but not yet ordered pitch-wise ---*/ + for (iVertex = 0; (unsigned long)iVertex < nVertex[iMarker]; iVertex++) { + iPoint = vertex[iMarker][iVertex]->GetNode(); + if (nDim == 3) { + dist = 10E+06; + jSpan = std::numeric_limits::max(); - coord = nodes->GetCoord(iPoint); - switch (config->GetKind_TurboMachinery(val_iZone)){ - case CENTRIFUGAL: case CENTRIPETAL: - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - if (dist > (abs(coord[2]-SpanWiseValue[marker_flag-1][iSpan]))){ - dist= abs(coord[2]-SpanWiseValue[marker_flag-1][iSpan]); - jSpan=iSpan; + coord = nodes->GetCoord(iPoint); + switch (config->GetKind_TurboMachinery(val_iZone)) { + case CENTRIFUGAL: + case CENTRIPETAL: + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + if (dist > (abs(coord[2] - SpanWiseValue[marker_flag - 1][iSpan]))) { + dist = abs(coord[2] - SpanWiseValue[marker_flag - 1][iSpan]); + jSpan = iSpan; } } break; case AXIAL: - radius = sqrt(coord[0]*coord[0]+coord[1]*coord[1]); - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - if (dist > (abs(radius - SpanWiseValue[marker_flag-1][iSpan]))){ - dist= abs(radius-SpanWiseValue[marker_flag-1][iSpan]); - jSpan=iSpan; + radius = sqrt(coord[0] * coord[0] + coord[1] * coord[1]); + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + if (dist > (abs(radius - SpanWiseValue[marker_flag - 1][iSpan]))) { + dist = abs(radius - SpanWiseValue[marker_flag - 1][iSpan]); + jSpan = iSpan; } } break; case CENTRIPETAL_AXIAL: - if(marker_flag == OUTFLOW){ - radius = sqrt(coord[0]*coord[0]+coord[1]*coord[1]); - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - if (dist > (abs(radius - SpanWiseValue[marker_flag-1][iSpan]))){ - dist= abs(radius-SpanWiseValue[marker_flag-1][iSpan]); - jSpan=iSpan; + if (marker_flag == OUTFLOW) { + radius = sqrt(coord[0] * coord[0] + coord[1] * coord[1]); + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + if (dist > (abs(radius - SpanWiseValue[marker_flag - 1][iSpan]))) { + dist = abs(radius - SpanWiseValue[marker_flag - 1][iSpan]); + jSpan = iSpan; } } - }else{ - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - if (dist > (abs(coord[2]-SpanWiseValue[marker_flag-1][iSpan]))){ - dist= abs(coord[2]-SpanWiseValue[marker_flag-1][iSpan]); - jSpan=iSpan; + } else { + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + if (dist > (abs(coord[2] - SpanWiseValue[marker_flag - 1][iSpan]))) { + dist = abs(coord[2] - SpanWiseValue[marker_flag - 1][iSpan]); + jSpan = iSpan; } } } break; case AXIAL_CENTRIFUGAL: - if(marker_flag == INFLOW){ - radius = sqrt(coord[0]*coord[0]+coord[1]*coord[1]); - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - if (dist > (abs(radius - SpanWiseValue[marker_flag-1][iSpan]))){ - dist= abs(radius-SpanWiseValue[marker_flag-1][iSpan]); - jSpan=iSpan; + if (marker_flag == INFLOW) { + radius = sqrt(coord[0] * coord[0] + coord[1] * coord[1]); + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + if (dist > (abs(radius - SpanWiseValue[marker_flag - 1][iSpan]))) { + dist = abs(radius - SpanWiseValue[marker_flag - 1][iSpan]); + jSpan = iSpan; } } - }else{ - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - if (dist > (abs(coord[2]-SpanWiseValue[marker_flag-1][iSpan]))){ - dist= abs(coord[2]-SpanWiseValue[marker_flag-1][iSpan]); - jSpan=iSpan; + } else { + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + if (dist > (abs(coord[2] - SpanWiseValue[marker_flag - 1][iSpan]))) { + dist = abs(coord[2] - SpanWiseValue[marker_flag - 1][iSpan]); + jSpan = iSpan; } } } break; - } } - /*--- 2D problem do not need span-wise separation---*/ - else{ - jSpan = 0; - } - /*--- compute the face area associated with the vertex ---*/ - vertex[iMarker][iVertex]->GetNormal(NormalArea); - for (iDim = 0; iDim < nDim; iDim++) NormalArea[iDim] = -NormalArea[iDim]; - Area = GeometryToolbox::Norm(nDim, NormalArea); - - for (iDim = 0; iDim < nDim; iDim++) NormalArea[iDim] /= Area; - /*--- store all the all the info into the auxiliary containers ---*/ - disordered[jSpan][nVertexSpanHalo[jSpan]] = iPoint; - oldVertex3D[jSpan][nVertexSpanHalo[jSpan]] = iVertex; - area[jSpan][nVertexSpanHalo[jSpan]] = Area; - for (iDim = 0; iDim < nDim; iDim++){ - unitnormal[jSpan][nVertexSpanHalo[jSpan]][iDim] = NormalArea[iDim]; - } - checkAssign[jSpan][nVertexSpanHalo[jSpan]] = false; - nVertexSpanHalo[jSpan]++; } + /*--- 2D problem do not need span-wise separation---*/ + else { + jSpan = 0; + } + /*--- compute the face area associated with the vertex ---*/ + vertex[iMarker][iVertex]->GetNormal(NormalArea); + for (iDim = 0; iDim < nDim; iDim++) NormalArea[iDim] = -NormalArea[iDim]; + Area = GeometryToolbox::Norm(nDim, NormalArea); + + for (iDim = 0; iDim < nDim; iDim++) NormalArea[iDim] /= Area; + /*--- store all the all the info into the auxiliary containers ---*/ + disordered[jSpan][nVertexSpanHalo[jSpan]] = iPoint; + oldVertex3D[jSpan][nVertexSpanHalo[jSpan]] = iVertex; + area[jSpan][nVertexSpanHalo[jSpan]] = Area; + for (iDim = 0; iDim < nDim; iDim++) { + unitnormal[jSpan][nVertexSpanHalo[jSpan]][iDim] = NormalArea[iDim]; + } + checkAssign[jSpan][nVertexSpanHalo[jSpan]] = false; + nVertexSpanHalo[jSpan]++; + } - /*--- using the auxiliary container reordered the vertexes pitch-wise direction at each span ---*/ - // the reordering algorithm can be based on the Y-coordinate. - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - - /*--- find the local minimum and maximum pitch-wise for each processor---*/ - min = 10E+06; - minInt = 10E+06; - max = -10E+06; - for(iSpanVertex = 0; iSpanVertex < nVertexSpanHalo[iSpan]; iSpanVertex++){ - iPoint = disordered[iSpan][iSpanVertex]; - coord = nodes->GetCoord(iPoint); - /*--- find nodes at minimum pitch among all nodes---*/ - if (coord[1]GetKind_TurboMachinery(val_iZone) == AXIAL){ - MinAngularCoord[iMarker][iSpan] = coord[1]; - } - else{ - MinAngularCoord[iMarker][iSpan] = atan(coord[1]/coord[0]); - } - minAngPitch[iSpan]= MinAngularCoord[iMarker][iSpan]; - kSpanVertex =iSpanVertex; + /*--- using the auxiliary container reordered the vertexes pitch-wise direction at each span ---*/ + // the reordering algorithm can be based on the Y-coordinate. + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + /*--- find the local minimum and maximum pitch-wise for each processor---*/ + min = 10E+06; + minInt = 10E+06; + max = -10E+06; + for (iSpanVertex = 0; iSpanVertex < nVertexSpanHalo[iSpan]; iSpanVertex++) { + iPoint = disordered[iSpan][iSpanVertex]; + coord = nodes->GetCoord(iPoint); + /*--- find nodes at minimum pitch among all nodes---*/ + if (coord[1] < min) { + min = coord[1]; + if (nDim == 2 && config->GetKind_TurboMachinery(val_iZone) == AXIAL) { + MinAngularCoord[iMarker][iSpan] = coord[1]; + } else { + MinAngularCoord[iMarker][iSpan] = atan(coord[1] / coord[0]); } + minAngPitch[iSpan] = MinAngularCoord[iMarker][iSpan]; + kSpanVertex = iSpanVertex; + } - /*--- find nodes at minimum pitch among the internal nodes---*/ - if (coord[1]GetDomain(iPoint)){ - minInt = coord[1]; - if (nDim == 2 && config->GetKind_TurboMachinery(val_iZone) == AXIAL){ - minIntAngPitch[iSpan] = coord[1]; - } - else{ - minIntAngPitch[iSpan] = atan(coord[1]/coord[0]); - } + /*--- find nodes at minimum pitch among the internal nodes---*/ + if (coord[1] < minInt) { + if (nodes->GetDomain(iPoint)) { + minInt = coord[1]; + if (nDim == 2 && config->GetKind_TurboMachinery(val_iZone) == AXIAL) { + minIntAngPitch[iSpan] = coord[1]; + } else { + minIntAngPitch[iSpan] = atan(coord[1] / coord[0]); } } + } - /*--- find nodes at maximum pitch among the internal nodes---*/ - if (coord[1]>max){ - if(nodes->GetDomain(iPoint)){ - max =coord[1]; - if (nDim == 2 && config->GetKind_TurboMachinery(val_iZone) == AXIAL){ - MaxAngularCoord[iMarker][iSpan] = coord[1]; - } - else{ - MaxAngularCoord[iMarker][iSpan] = atan(coord[1]/coord[0]); - } - maxAngPitch[iSpan]= MaxAngularCoord[iMarker][iSpan]; + /*--- find nodes at maximum pitch among the internal nodes---*/ + if (coord[1] > max) { + if (nodes->GetDomain(iPoint)) { + max = coord[1]; + if (nDim == 2 && config->GetKind_TurboMachinery(val_iZone) == AXIAL) { + MaxAngularCoord[iMarker][iSpan] = coord[1]; + } else { + MaxAngularCoord[iMarker][iSpan] = atan(coord[1] / coord[0]); } + maxAngPitch[iSpan] = MaxAngularCoord[iMarker][iSpan]; } } + } - iInternalVertex = 0; - - /*--- reordering the vertex pitch-wise, store the ordered vertexes span-wise and pitch-wise---*/ - for(iSpanVertex = 0; iSpanVertexGetCoord(ordered[iSpan][iSpanVertex]); - target = coord[1]; - if (nDim == 2 && config->GetKind_TurboMachinery(val_iZone) == AXIAL){ - angPitch[iSpan][iSpanVertex]=coord[1]; - } - else{ - angPitch[iSpan][iSpanVertex]=atan(coord[1]/coord[0]); - } - if(iSpanVertex == 0){ - deltaAngPitch[iSpan][iSpanVertex]=0.0; - } - else{ - deltaAngPitch[iSpan][iSpanVertex]= angPitch[iSpan][iSpanVertex] - angPitch[iSpan][iSpanVertex - 1]; + iInternalVertex = 0; + + /*--- reordering the vertex pitch-wise, store the ordered vertexes span-wise and pitch-wise---*/ + for (iSpanVertex = 0; iSpanVertex < nVertexSpanHalo[iSpan]; iSpanVertex++) { + dist = 10E+06; + ordered[iSpan][iSpanVertex] = disordered[iSpan][kSpanVertex]; + checkAssign[iSpan][kSpanVertex] = true; + coord = nodes->GetCoord(ordered[iSpan][iSpanVertex]); + target = coord[1]; + if (nDim == 2 && config->GetKind_TurboMachinery(val_iZone) == AXIAL) { + angPitch[iSpan][iSpanVertex] = coord[1]; + } else { + angPitch[iSpan][iSpanVertex] = atan(coord[1] / coord[0]); + } + if (iSpanVertex == 0) { + deltaAngPitch[iSpan][iSpanVertex] = 0.0; + } else { + deltaAngPitch[iSpan][iSpanVertex] = angPitch[iSpan][iSpanVertex] - angPitch[iSpan][iSpanVertex - 1]; + } + /*---create turbovertex structure only for the internal nodes---*/ + if (nodes->GetDomain(ordered[iSpan][iSpanVertex])) { + if (allocate) { + turbovertex[iMarker][iSpan][iInternalVertex] = new CTurboVertex(ordered[iSpan][iSpanVertex], nDim); } - /*---create turbovertex structure only for the internal nodes---*/ - if(nodes->GetDomain(ordered[iSpan][iSpanVertex])){ - if (allocate){ - turbovertex[iMarker][iSpan][iInternalVertex] = new CTurboVertex(ordered[iSpan][iSpanVertex], nDim); - } - turbovertex[iMarker][iSpan][iInternalVertex]->SetArea(area[iSpan][kSpanVertex]); - turbovertex[iMarker][iSpan][iInternalVertex]->SetNormal(unitnormal[iSpan][kSpanVertex]); - turbovertex[iMarker][iSpan][iInternalVertex]->SetOldVertex(oldVertex3D[iSpan][kSpanVertex]); - turbovertex[iMarker][iSpan][iInternalVertex]->SetAngularCoord(angPitch[iSpan][iSpanVertex]); - turbovertex[iMarker][iSpan][iInternalVertex]->SetDeltaAngularCoord(deltaAngPitch[iSpan][iSpanVertex]); - switch (config->GetKind_TurboMachinery(val_iZone)){ + turbovertex[iMarker][iSpan][iInternalVertex]->SetArea(area[iSpan][kSpanVertex]); + turbovertex[iMarker][iSpan][iInternalVertex]->SetNormal(unitnormal[iSpan][kSpanVertex]); + turbovertex[iMarker][iSpan][iInternalVertex]->SetOldVertex(oldVertex3D[iSpan][kSpanVertex]); + turbovertex[iMarker][iSpan][iInternalVertex]->SetAngularCoord(angPitch[iSpan][iSpanVertex]); + turbovertex[iMarker][iSpan][iInternalVertex]->SetDeltaAngularCoord(deltaAngPitch[iSpan][iSpanVertex]); + switch (config->GetKind_TurboMachinery(val_iZone)) { case CENTRIFUGAL: Normal2 = 0.0; - for(iDim = 0; iDim < 2; iDim++) Normal2 +=coord[iDim]*coord[iDim]; - if (marker_flag == INFLOW){ - TurboNormal[0] = -coord[0]/sqrt(Normal2); - TurboNormal[1] = -coord[1]/sqrt(Normal2); + for (iDim = 0; iDim < 2; iDim++) Normal2 += coord[iDim] * coord[iDim]; + if (marker_flag == INFLOW) { + TurboNormal[0] = -coord[0] / sqrt(Normal2); + TurboNormal[1] = -coord[1] / sqrt(Normal2); TurboNormal[2] = 0.0; - }else{ - TurboNormal[0] = coord[0]/sqrt(Normal2); - TurboNormal[1] = coord[1]/sqrt(Normal2); + } else { + TurboNormal[0] = coord[0] / sqrt(Normal2); + TurboNormal[1] = coord[1] / sqrt(Normal2); TurboNormal[2] = 0.0; } break; case CENTRIPETAL: Normal2 = 0.0; - for(iDim = 0; iDim < 2; iDim++) Normal2 +=coord[iDim]*coord[iDim]; - if (marker_flag == OUTFLOW){ - TurboNormal[0] = -coord[0]/sqrt(Normal2); - TurboNormal[1] = -coord[1]/sqrt(Normal2); + for (iDim = 0; iDim < 2; iDim++) Normal2 += coord[iDim] * coord[iDim]; + if (marker_flag == OUTFLOW) { + TurboNormal[0] = -coord[0] / sqrt(Normal2); + TurboNormal[1] = -coord[1] / sqrt(Normal2); TurboNormal[2] = 0.0; - }else{ - TurboNormal[0] = coord[0]/sqrt(Normal2); - TurboNormal[1] = coord[1]/sqrt(Normal2); + } else { + TurboNormal[0] = coord[0] / sqrt(Normal2); + TurboNormal[1] = coord[1] / sqrt(Normal2); TurboNormal[2] = 0.0; } break; case AXIAL: Normal2 = 0.0; - for(iDim = 0; iDim < 2; iDim++) Normal2 +=coord[iDim]*coord[iDim]; - if(nDim == 3){ - if (marker_flag == INFLOW){ - TurboNormal[0] = coord[0]/sqrt(Normal2); - TurboNormal[1] = coord[1]/sqrt(Normal2); + for (iDim = 0; iDim < 2; iDim++) Normal2 += coord[iDim] * coord[iDim]; + if (nDim == 3) { + if (marker_flag == INFLOW) { + TurboNormal[0] = coord[0] / sqrt(Normal2); + TurboNormal[1] = coord[1] / sqrt(Normal2); TurboNormal[2] = 0.0; - }else{ - TurboNormal[0] = coord[0]/sqrt(Normal2); - TurboNormal[1] = coord[1]/sqrt(Normal2); + } else { + TurboNormal[0] = coord[0] / sqrt(Normal2); + TurboNormal[1] = coord[1] / sqrt(Normal2); TurboNormal[2] = 0.0; } - } - else{ - if (marker_flag == INFLOW){ + } else { + if (marker_flag == INFLOW) { TurboNormal[0] = -1.0; TurboNormal[1] = 0.0; TurboNormal[2] = 0.0; - }else{ + } else { TurboNormal[0] = 1.0; TurboNormal[1] = 0.0; TurboNormal[2] = 0.0; @@ -5736,167 +5404,164 @@ void CPhysicalGeometry::SetTurboVertex(CConfig *config, unsigned short val_iZone break; case CENTRIPETAL_AXIAL: Normal2 = 0.0; - for(iDim = 0; iDim < 2; iDim++) Normal2 +=coord[iDim]*coord[iDim]; - if (marker_flag == INFLOW){ - TurboNormal[0] = coord[0]/sqrt(Normal2); - TurboNormal[1] = coord[1]/sqrt(Normal2); + for (iDim = 0; iDim < 2; iDim++) Normal2 += coord[iDim] * coord[iDim]; + if (marker_flag == INFLOW) { + TurboNormal[0] = coord[0] / sqrt(Normal2); + TurboNormal[1] = coord[1] / sqrt(Normal2); TurboNormal[2] = 0.0; - }else{ - TurboNormal[0] = coord[0]/sqrt(Normal2); - TurboNormal[1] = coord[1]/sqrt(Normal2); + } else { + TurboNormal[0] = coord[0] / sqrt(Normal2); + TurboNormal[1] = coord[1] / sqrt(Normal2); TurboNormal[2] = 0.0; } break; case AXIAL_CENTRIFUGAL: Normal2 = 0.0; - for(iDim = 0; iDim < 2; iDim++) Normal2 +=coord[iDim]*coord[iDim]; - if (marker_flag == INFLOW){ - TurboNormal[0] = coord[0]/sqrt(Normal2); - TurboNormal[1] = coord[1]/sqrt(Normal2); + for (iDim = 0; iDim < 2; iDim++) Normal2 += coord[iDim] * coord[iDim]; + if (marker_flag == INFLOW) { + TurboNormal[0] = coord[0] / sqrt(Normal2); + TurboNormal[1] = coord[1] / sqrt(Normal2); TurboNormal[2] = 0.0; - }else{ - TurboNormal[0] = coord[0]/sqrt(Normal2); - TurboNormal[1] = coord[1]/sqrt(Normal2); + } else { + TurboNormal[0] = coord[0] / sqrt(Normal2); + TurboNormal[1] = coord[1] / sqrt(Normal2); TurboNormal[2] = 0.0; } break; - - } - turbovertex[iMarker][iSpan][iInternalVertex]->SetTurboNormal(TurboNormal); - iInternalVertex++; } + turbovertex[iMarker][iSpan][iInternalVertex]->SetTurboNormal(TurboNormal); + iInternalVertex++; + } - - for(jSpanVertex = 0; jSpanVertexGetCoord(disordered[iSpan][jSpanVertex]); - if(dist >= (coord[1] - target) && !checkAssign[iSpan][jSpanVertex] && (coord[1] - target) >= 0.0){ - dist= coord[1] - target; - kSpanVertex =jSpanVertex; - } + for (jSpanVertex = 0; jSpanVertex < nVertexSpanHalo[iSpan]; jSpanVertex++) { + coord = nodes->GetCoord(disordered[iSpan][jSpanVertex]); + if (dist >= (coord[1] - target) && !checkAssign[iSpan][jSpanVertex] && (coord[1] - target) >= 0.0) { + dist = coord[1] - target; + kSpanVertex = jSpanVertex; } } } + } - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - - delete [] ordered[iSpan]; - delete [] disordered[iSpan]; - delete [] oldVertex3D[iSpan]; - delete [] checkAssign[iSpan]; - delete [] area[iSpan]; - delete [] angPitch[iSpan]; - delete [] deltaAngPitch[iSpan]; - - for(iVertex=0; iVertex < nVertexSpanHalo[iSpan]; iVertex++){ - delete [] unitnormal[iSpan][iVertex]; - } - delete [] unitnormal[iSpan]; + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + delete[] ordered[iSpan]; + delete[] disordered[iSpan]; + delete[] oldVertex3D[iSpan]; + delete[] checkAssign[iSpan]; + delete[] area[iSpan]; + delete[] angPitch[iSpan]; + delete[] deltaAngPitch[iSpan]; + + for (iVertex = 0; iVertex < nVertexSpanHalo[iSpan]; iVertex++) { + delete[] unitnormal[iSpan][iVertex]; } + delete[] unitnormal[iSpan]; } } } } + } /*--- to be set for all the processor to initialize an appropriate number of frequency for the NR BC ---*/ nVertMax = 0; /*--- compute global max and min pitch per span ---*/ - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - nVert = 0; + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + nVert = 0; #ifdef HAVE_MPI - MyMin = minAngPitch[iSpan]; minAngPitch[iSpan] = 10.0E+6; - MyIntMin = minIntAngPitch[iSpan]; minIntAngPitch[iSpan] = 10.0E+6; - MyMax = maxAngPitch[iSpan]; maxAngPitch[iSpan] = -10.0E+6; + MyMin = minAngPitch[iSpan]; + minAngPitch[iSpan] = 10.0E+6; + MyIntMin = minIntAngPitch[iSpan]; + minIntAngPitch[iSpan] = 10.0E+6; + MyMax = maxAngPitch[iSpan]; + maxAngPitch[iSpan] = -10.0E+6; SU2_MPI::Allreduce(&MyMin, &minAngPitch[iSpan], 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&MyIntMin, &minIntAngPitch[iSpan], 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&MyMax, &maxAngPitch[iSpan], 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); #endif - /*--- compute the relative angular pitch with respect to the minimum value ---*/ - for (iMarker = 0; iMarker < nMarker; iMarker++){ - for (iMarkerTP=1; iMarkerTP < config->GetnMarker_Turbomachinery()+1; iMarkerTP++){ - if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP){ - if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag){ + for (iMarker = 0; iMarker < nMarker; iMarker++) { + for (iMarkerTP = 1; iMarkerTP < config->GetnMarker_Turbomachinery() + 1; iMarkerTP++) { + if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP) { + if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag) { nVert = nVertexSpan[iMarker][iSpan]; - MinAngularCoord[iMarker][iSpan] = minAngPitch[iSpan]; - MaxAngularCoord[iMarker][iSpan] = maxAngPitch[iSpan]; + MinAngularCoord[iMarker][iSpan] = minAngPitch[iSpan]; + MaxAngularCoord[iMarker][iSpan] = maxAngPitch[iSpan]; MinRelAngularCoord[iMarker][iSpan] = minIntAngPitch[iSpan] - minAngPitch[iSpan]; - for(iSpanVertex = 0; iSpanVertex< nVertexSpan[iMarker][iSpan]; iSpanVertex++){ - turbovertex[iMarker][iSpan][iSpanVertex]->SetRelAngularCoord(MinAngularCoord[iMarker][iSpan]); + for (iSpanVertex = 0; iSpanVertex < nVertexSpan[iMarker][iSpan]; iSpanVertex++) { + turbovertex[iMarker][iSpan][iSpanVertex]->SetRelAngularCoord(MinAngularCoord[iMarker][iSpan]); } } } } } - #ifdef HAVE_MPI - My_nVert = nVert;nVert = 0; + My_nVert = nVert; + nVert = 0; SU2_MPI::Allreduce(&My_nVert, &nVert, 1, MPI_INT, MPI_SUM, SU2_MPI::GetComm()); #endif /*--- to be set for all the processor to initialize an appropriate number of frequency for the NR BC ---*/ - if(nVert > nVertMax){ - SetnVertexSpanMax(marker_flag,nVert); + if (nVert > nVertMax) { + SetnVertexSpanMax(marker_flag, nVert); } /*--- for all the processor should be known the amount of total turbovertex per span ---*/ - nTotVertex_gb[iSpan]= (int)nVert; - - for (iMarker = 0; iMarker < nMarker; iMarker++){ - for (iMarkerTP=1; iMarkerTP < config->GetnMarker_Turbomachinery()+1; iMarkerTP++){ - if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP){ - if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag){ - nTotVertexSpan[iMarker][iSpan]= nVert; - nTotVertexSpan[iMarker][nSpanWiseSections[marker_flag-1]]+= nVert; + nTotVertex_gb[iSpan] = (int)nVert; + + for (iMarker = 0; iMarker < nMarker; iMarker++) { + for (iMarkerTP = 1; iMarkerTP < config->GetnMarker_Turbomachinery() + 1; iMarkerTP++) { + if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP) { + if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag) { + nTotVertexSpan[iMarker][iSpan] = nVert; + nTotVertexSpan[iMarker][nSpanWiseSections[marker_flag - 1]] += nVert; } } } } } - /*--- Printing Tec file to check the global ordering of the turbovertex pitch-wise ---*/ /*--- Send all the info to the MASTERNODE ---*/ - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - x_loc[iSpan] = new su2double[nTotVertex_gb[iSpan]]; - y_loc[iSpan] = new su2double[nTotVertex_gb[iSpan]]; - z_loc[iSpan] = new su2double[nTotVertex_gb[iSpan]]; - angCoord_loc[iSpan] = new su2double[nTotVertex_gb[iSpan]]; + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + x_loc[iSpan] = new su2double[nTotVertex_gb[iSpan]]; + y_loc[iSpan] = new su2double[nTotVertex_gb[iSpan]]; + z_loc[iSpan] = new su2double[nTotVertex_gb[iSpan]]; + angCoord_loc[iSpan] = new su2double[nTotVertex_gb[iSpan]]; deltaAngCoord_loc[iSpan] = new su2double[nTotVertex_gb[iSpan]]; - rank_loc[iSpan] = new int[nTotVertex_gb[iSpan]]; - for(iSpanVertex = 0; iSpanVertexGetnMarker_Turbomachinery()+1; iMarkerTP++){ - if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP){ - if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag){ - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - for(iSpanVertex = 0; iSpanVertexGetnMarker_Turbomachinery() + 1; iMarkerTP++) { + if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP) { + if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag) { + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + for (iSpanVertex = 0; iSpanVertex < nVertexSpan[iMarker][iSpan]; iSpanVertex++) { iPoint = turbovertex[iMarker][iSpan][iSpanVertex]->GetNode(); - coord = nodes->GetCoord(iPoint); - x_loc[iSpan][iSpanVertex] = coord[0]; - y_loc[iSpan][iSpanVertex] = coord[1]; - if (nDim == 3){ + coord = nodes->GetCoord(iPoint); + x_loc[iSpan][iSpanVertex] = coord[0]; + y_loc[iSpan][iSpanVertex] = coord[1]; + if (nDim == 3) { z_loc[iSpan][iSpanVertex] = coord[2]; - } - else{ + } else { z_loc[iSpan][iSpanVertex] = 0.0; } - angCoord_loc[iSpan][iSpanVertex] = turbovertex[iMarker][iSpan][iSpanVertex]->GetRelAngularCoord(); + angCoord_loc[iSpan][iSpanVertex] = turbovertex[iMarker][iSpan][iSpanVertex]->GetRelAngularCoord(); deltaAngCoord_loc[iSpan][iSpanVertex] = turbovertex[iMarker][iSpan][iSpanVertex]->GetDeltaAngularCoord(); } } @@ -5907,283 +5572,301 @@ void CPhysicalGeometry::SetTurboVertex(CConfig *config, unsigned short val_iZone #ifdef HAVE_MPI - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - if (rank == MASTER_NODE){ - x_gb = new su2double[nTotVertex_gb[iSpan]*size]; - y_gb = new su2double[nTotVertex_gb[iSpan]*size]; - z_gb = new su2double[nTotVertex_gb[iSpan]*size]; - angCoord_gb = new su2double[nTotVertex_gb[iSpan]*size]; - deltaAngCoord_gb = new su2double[nTotVertex_gb[iSpan]*size]; - checkAssign_gb = new bool[nTotVertex_gb[iSpan]*size]; - - for(iSize= 0; iSize < size; iSize++){ - for(iSpanVertex = 0; iSpanVertex < nTotVertex_gb[iSpan]; iSpanVertex++){ - checkAssign_gb[iSize*nTotVertex_gb[iSpan] + iSpanVertex] = false; - } - } - } - SU2_MPI::Gather(y_loc[iSpan], nTotVertex_gb[iSpan] , MPI_DOUBLE, y_gb, nTotVertex_gb[iSpan], MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(x_loc[iSpan], nTotVertex_gb[iSpan] , MPI_DOUBLE, x_gb, nTotVertex_gb[iSpan], MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(z_loc[iSpan], nTotVertex_gb[iSpan] , MPI_DOUBLE, z_gb, nTotVertex_gb[iSpan], MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(angCoord_loc[iSpan], nTotVertex_gb[iSpan] , MPI_DOUBLE, angCoord_gb, nTotVertex_gb[iSpan], MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(deltaAngCoord_loc[iSpan], nTotVertex_gb[iSpan] , MPI_DOUBLE, deltaAngCoord_gb, nTotVertex_gb[iSpan], MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - - if (rank == MASTER_NODE){ - for(iSpanVertex = 0; iSpanVertex= 0.0){ + for (iSize = 0; iSize < size; iSize++) { + if (angCoord_gb[iSize * nTotVertex_gb[iSpan]] < min && angCoord_gb[iSize * nTotVertex_gb[iSpan]] >= 0.0) { kSize = iSize; - min = angCoord_gb[iSize*nTotVertex_gb[iSpan]]; + min = angCoord_gb[iSize * nTotVertex_gb[iSpan]]; } } kSpanVertex = 0; - for(iSpanVertex = 0; iSpanVertex < nTotVertex_gb[iSpan]; iSpanVertex++){ - x_loc[iSpan][iSpanVertex] = x_gb[kSize*nTotVertex_gb[iSpan] + kSpanVertex]; - y_loc[iSpan][iSpanVertex] = y_gb[kSize*nTotVertex_gb[iSpan] + kSpanVertex]; - z_loc[iSpan][iSpanVertex] = z_gb[kSize*nTotVertex_gb[iSpan] + kSpanVertex]; - angCoord_loc[iSpan][iSpanVertex] = angCoord_gb[kSize*nTotVertex_gb[iSpan] + kSpanVertex]; - deltaAngCoord_loc[iSpan][iSpanVertex] = deltaAngCoord_gb[kSize*nTotVertex_gb[iSpan] + kSpanVertex]; - rank_loc[iSpan][iSpanVertex] = kSize; + for (iSpanVertex = 0; iSpanVertex < nTotVertex_gb[iSpan]; iSpanVertex++) { + x_loc[iSpan][iSpanVertex] = x_gb[kSize * nTotVertex_gb[iSpan] + kSpanVertex]; + y_loc[iSpan][iSpanVertex] = y_gb[kSize * nTotVertex_gb[iSpan] + kSpanVertex]; + z_loc[iSpan][iSpanVertex] = z_gb[kSize * nTotVertex_gb[iSpan] + kSpanVertex]; + angCoord_loc[iSpan][iSpanVertex] = angCoord_gb[kSize * nTotVertex_gb[iSpan] + kSpanVertex]; + deltaAngCoord_loc[iSpan][iSpanVertex] = deltaAngCoord_gb[kSize * nTotVertex_gb[iSpan] + kSpanVertex]; + rank_loc[iSpan][iSpanVertex] = kSize; target = angCoord_loc[iSpan][iSpanVertex]; - checkAssign_gb[kSize*nTotVertex_gb[iSpan] + kSpanVertex] = true; + checkAssign_gb[kSize * nTotVertex_gb[iSpan] + kSpanVertex] = true; min = 10.0E+06; - for(jSize= 0; jSize < size; jSize++){ - for(jSpanVertex = 0; jSpanVertex < nTotVertex_gb[iSpan]; jSpanVertex++){ - if ((angCoord_gb[jSize*nTotVertex_gb[iSpan] + jSpanVertex] < min) && - (angCoord_gb[jSize*nTotVertex_gb[iSpan] + jSpanVertex] >= target) && - !checkAssign_gb[jSize*nTotVertex_gb[iSpan] + jSpanVertex]) { + for (jSize = 0; jSize < size; jSize++) { + for (jSpanVertex = 0; jSpanVertex < nTotVertex_gb[iSpan]; jSpanVertex++) { + if ((angCoord_gb[jSize * nTotVertex_gb[iSpan] + jSpanVertex] < min) && + (angCoord_gb[jSize * nTotVertex_gb[iSpan] + jSpanVertex] >= target) && + !checkAssign_gb[jSize * nTotVertex_gb[iSpan] + jSpanVertex]) { kSize = jSize; kSpanVertex = jSpanVertex; - min = angCoord_gb[jSize*nTotVertex_gb[iSpan] + jSpanVertex]; + min = angCoord_gb[jSize * nTotVertex_gb[iSpan] + jSpanVertex]; } } } } - delete [] x_gb; delete [] y_gb; delete [] z_gb; delete [] angCoord_gb; delete [] deltaAngCoord_gb; delete[] checkAssign_gb; - + delete[] x_gb; + delete[] y_gb; + delete[] z_gb; + delete[] angCoord_gb; + delete[] deltaAngCoord_gb; + delete[] checkAssign_gb; } } #endif - if (rank == MASTER_NODE){ - if (marker_flag == INFLOW && val_iZone ==0){ + if (rank == MASTER_NODE) { + if (marker_flag == INFLOW && val_iZone == 0) { std::string sPath = "TURBOMACHINERY"; int nError = 0; #if defined(_WIN32) #ifdef __MINGW32__ nError = mkdir(sPath.c_str()); // MINGW on Windows #else - nError = _mkdir(sPath.c_str()); // can be used on Windows + nError = _mkdir(sPath.c_str()); // can be used on Windows #endif #else - mode_t nMode = 0733; // UNIX style permissions - nError = mkdir(sPath.c_str(),nMode); // can be used on non-Windows + mode_t nMode = 0733; // UNIX style permissions + nError = mkdir(sPath.c_str(), nMode); // can be used on non-Windows #endif if (nError != 0) { - cout << "TURBOMACHINERY folder creation failed." < 1){ - unsigned short lastindex = multizone_filename.find_last_of("."); + if (GetnZone() > 1) { + unsigned short lastindex = multizone_filename.find_last_of('.'); multizone_filename = multizone_filename.substr(0, lastindex); - SPRINTF (buffer, "_%d.dat", SU2_TYPE::Int(val_iZone)); + SPRINTF(buffer, "_%d.dat", SU2_TYPE::Int(val_iZone)); multizone_filename.append(string(buffer)); } // File to print the vector x_loc, y_loc, z_loc, globIdx_loc to check vertex ordering ofstream myfile; - myfile.open (multizone_filename.data(), ios::out | ios::trunc); + myfile.open(multizone_filename.data(), ios::out | ios::trunc); myfile.setf(ios::uppercase | ios::scientific); myfile.precision(8); myfile << "TITLE = \"Global index visualization file\"" << endl; myfile << "VARIABLES =" << endl; - myfile.width(10); myfile << "\"iSpan\""; - myfile.width(20); myfile << "\"x_coord\"" ; - myfile.width(20); myfile << "\"y_coord\"" ; - myfile.width(20); myfile << "\"z_coord\"" ; - myfile.width(20); myfile << "\"radius\"" ; - myfile.width(20); myfile << "\"Relative Angular Coord \"" ; - myfile.width(20); myfile << "\"Delta Angular Coord \"" ; - myfile.width(20); myfile << "\"processor\"" <GetKind_TurboMachinery(val_iZone)){ - myfile.width(20); myfile << angCoord_loc[iSpan][iSpanVertex]; - myfile.width(20); myfile << deltaAngCoord_loc[iSpan][iSpanVertex]; - } - else{ - myfile.width(20); myfile << angCoord_loc[iSpan][iSpanVertex]*180.0/PI_NUMBER; - myfile.width(20); myfile << deltaAngCoord_loc[iSpan][iSpanVertex]*180.0/PI_NUMBER; + myfile.width(10); + myfile << "\"iSpan\""; + myfile.width(20); + myfile << "\"x_coord\""; + myfile.width(20); + myfile << "\"y_coord\""; + myfile.width(20); + myfile << "\"z_coord\""; + myfile.width(20); + myfile << "\"radius\""; + myfile.width(20); + myfile << "\"Relative Angular Coord \""; + myfile.width(20); + myfile << "\"Delta Angular Coord \""; + myfile.width(20); + myfile << "\"processor\"" << endl; + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + for (iSpanVertex = 0; iSpanVertex < nTotVertex_gb[iSpan]; iSpanVertex++) { + radius = sqrt(x_loc[iSpan][iSpanVertex] * x_loc[iSpan][iSpanVertex] + + y_loc[iSpan][iSpanVertex] * y_loc[iSpan][iSpanVertex]); + myfile.width(10); + myfile << iSpan; + myfile.width(20); + myfile << x_loc[iSpan][iSpanVertex]; + myfile.width(20); + myfile << y_loc[iSpan][iSpanVertex]; + myfile.width(20); + myfile << z_loc[iSpan][iSpanVertex]; + myfile.width(20); + myfile << radius; + if (nDim == 2 && config->GetKind_TurboMachinery(val_iZone)) { + myfile.width(20); + myfile << angCoord_loc[iSpan][iSpanVertex]; + myfile.width(20); + myfile << deltaAngCoord_loc[iSpan][iSpanVertex]; + } else { + myfile.width(20); + myfile << angCoord_loc[iSpan][iSpanVertex] * 180.0 / PI_NUMBER; + myfile.width(20); + myfile << deltaAngCoord_loc[iSpan][iSpanVertex] * 180.0 / PI_NUMBER; } - myfile.width(20); myfile << rank_loc[iSpan][iSpanVertex]<GetnMarker_Turbomachinery()+1; iMarkerTP++){ - if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP){ - if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag){ - for(iSpan = 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - for(iSpanVertex = 0; iSpanVertexGetnMarker_Turbomachinery() + 1; iMarkerTP++) { + if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP) { + if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag) { + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { + for (iSpanVertex = 0; iSpanVertex < nVertexSpan[iMarker][iSpan]; iSpanVertex++) { iPoint = turbovertex[iMarker][iSpan][iSpanVertex]->GetNode(); - coord = nodes->GetCoord(iPoint); + coord = nodes->GetCoord(iPoint); /*--- compute appropriate turbo normal ---*/ - switch (config->GetKind_TurboMachinery(val_iZone)){ - case CENTRIFUGAL: - Normal2 = 0.0; - for(iDim = 0; iDim < 2; iDim++) Normal2 +=coord[iDim]*coord[iDim]; - if (marker_flag == INFLOW){ - TurboNormal[0] = -coord[0]/sqrt(Normal2); - TurboNormal[1] = -coord[1]/sqrt(Normal2); - TurboNormal[2] = 0.0; - }else{ - TurboNormal[0] = coord[0]/sqrt(Normal2); - TurboNormal[1] = coord[1]/sqrt(Normal2); - TurboNormal[2] = 0.0; - } - break; - case CENTRIPETAL: - Normal2 = 0.0; - for(iDim = 0; iDim < 2; iDim++) Normal2 +=coord[iDim]*coord[iDim]; - if (marker_flag == OUTFLOW){ - TurboNormal[0] = -coord[0]/sqrt(Normal2); - TurboNormal[1] = -coord[1]/sqrt(Normal2); - TurboNormal[2] = 0.0; - }else{ - TurboNormal[0] = coord[0]/sqrt(Normal2); - TurboNormal[1] = coord[1]/sqrt(Normal2); - TurboNormal[2] = 0.0; - } - break; - case AXIAL: - Normal2 = 0.0; - for(iDim = 0; iDim < 2; iDim++) Normal2 +=coord[iDim]*coord[iDim]; - if(nDim == 3){ - if (marker_flag == INFLOW){ - TurboNormal[0] = coord[0]/sqrt(Normal2); - TurboNormal[1] = coord[1]/sqrt(Normal2); + switch (config->GetKind_TurboMachinery(val_iZone)) { + case CENTRIFUGAL: + Normal2 = 0.0; + for (iDim = 0; iDim < 2; iDim++) Normal2 += coord[iDim] * coord[iDim]; + if (marker_flag == INFLOW) { + TurboNormal[0] = -coord[0] / sqrt(Normal2); + TurboNormal[1] = -coord[1] / sqrt(Normal2); TurboNormal[2] = 0.0; - }else{ - TurboNormal[0] = coord[0]/sqrt(Normal2); - TurboNormal[1] = coord[1]/sqrt(Normal2); + } else { + TurboNormal[0] = coord[0] / sqrt(Normal2); + TurboNormal[1] = coord[1] / sqrt(Normal2); TurboNormal[2] = 0.0; } - } - else{ - if (marker_flag == INFLOW){ - TurboNormal[0] = -1.0; - TurboNormal[1] = 0.0; + break; + case CENTRIPETAL: + Normal2 = 0.0; + for (iDim = 0; iDim < 2; iDim++) Normal2 += coord[iDim] * coord[iDim]; + if (marker_flag == OUTFLOW) { + TurboNormal[0] = -coord[0] / sqrt(Normal2); + TurboNormal[1] = -coord[1] / sqrt(Normal2); TurboNormal[2] = 0.0; - }else{ - TurboNormal[0] = 1.0; - TurboNormal[1] = 0.0; + } else { + TurboNormal[0] = coord[0] / sqrt(Normal2); + TurboNormal[1] = coord[1] / sqrt(Normal2); TurboNormal[2] = 0.0; } - } + break; + case AXIAL: + Normal2 = 0.0; + for (iDim = 0; iDim < 2; iDim++) Normal2 += coord[iDim] * coord[iDim]; + if (nDim == 3) { + if (marker_flag == INFLOW) { + TurboNormal[0] = coord[0] / sqrt(Normal2); + TurboNormal[1] = coord[1] / sqrt(Normal2); + TurboNormal[2] = 0.0; + } else { + TurboNormal[0] = coord[0] / sqrt(Normal2); + TurboNormal[1] = coord[1] / sqrt(Normal2); + TurboNormal[2] = 0.0; + } + } else { + if (marker_flag == INFLOW) { + TurboNormal[0] = -1.0; + TurboNormal[1] = 0.0; + TurboNormal[2] = 0.0; + } else { + TurboNormal[0] = 1.0; + TurboNormal[1] = 0.0; + TurboNormal[2] = 0.0; + } + } - break; - case CENTRIPETAL_AXIAL: - Normal2 = 0.0; - for(iDim = 0; iDim < 2; iDim++) Normal2 +=coord[iDim]*coord[iDim]; - if (marker_flag == INFLOW){ - TurboNormal[0] = coord[0]/sqrt(Normal2); - TurboNormal[1] = coord[1]/sqrt(Normal2); - TurboNormal[2] = 0.0; - }else{ - TurboNormal[0] = coord[0]/sqrt(Normal2); - TurboNormal[1] = coord[1]/sqrt(Normal2); - TurboNormal[2] = 0.0; - } - break; - - case AXIAL_CENTRIFUGAL: - Normal2 = 0.0; - for(iDim = 0; iDim < 2; iDim++) Normal2 +=coord[iDim]*coord[iDim]; - if (marker_flag == INFLOW){ - TurboNormal[0] = coord[0]/sqrt(Normal2); - TurboNormal[1] = coord[1]/sqrt(Normal2); - TurboNormal[2] = 0.0; - }else{ - TurboNormal[0] = coord[0]/sqrt(Normal2); - TurboNormal[1] = coord[1]/sqrt(Normal2); - TurboNormal[2] = 0.0; - } - break; + break; + case CENTRIPETAL_AXIAL: + Normal2 = 0.0; + for (iDim = 0; iDim < 2; iDim++) Normal2 += coord[iDim] * coord[iDim]; + if (marker_flag == INFLOW) { + TurboNormal[0] = coord[0] / sqrt(Normal2); + TurboNormal[1] = coord[1] / sqrt(Normal2); + TurboNormal[2] = 0.0; + } else { + TurboNormal[0] = coord[0] / sqrt(Normal2); + TurboNormal[1] = coord[1] / sqrt(Normal2); + TurboNormal[2] = 0.0; + } + break; + + case AXIAL_CENTRIFUGAL: + Normal2 = 0.0; + for (iDim = 0; iDim < 2; iDim++) Normal2 += coord[iDim] * coord[iDim]; + if (marker_flag == INFLOW) { + TurboNormal[0] = coord[0] / sqrt(Normal2); + TurboNormal[1] = coord[1] / sqrt(Normal2); + TurboNormal[2] = 0.0; + } else { + TurboNormal[0] = coord[0] / sqrt(Normal2); + TurboNormal[1] = coord[1] / sqrt(Normal2); + TurboNormal[2] = 0.0; + } + break; } /*--- store the new turbo normal ---*/ @@ -6195,54 +5878,55 @@ void CPhysicalGeometry::UpdateTurboVertex(CConfig *config, unsigned short val_iZ } } - delete [] TurboNormal; + delete[] TurboNormal; } -void CPhysicalGeometry::SetAvgTurboValue(CConfig *config, unsigned short val_iZone, unsigned short marker_flag, bool allocate) { - +void CPhysicalGeometry::SetAvgTurboValue(CConfig* config, unsigned short val_iZone, unsigned short marker_flag, + bool allocate) { unsigned short iMarker, iMarkerTP, iSpan, iDim; unsigned long iPoint; - su2double *TurboNormal,*coord, *Normal, turboNormal2, Normal2, *gridVel, TotalArea, TotalRadius, radius; - su2double *TotalTurboNormal,*TotalNormal, *TotalGridVel, Area; + su2double *TurboNormal, *coord, *Normal, turboNormal2, Normal2, *gridVel, TotalArea, TotalRadius, radius; + su2double *TotalTurboNormal, *TotalNormal, *TotalGridVel, Area; long iVertex; /*-- Variables declaration and allocation ---*/ TotalTurboNormal = new su2double[nDim]; - TotalNormal = new su2double[nDim]; - TurboNormal = new su2double[nDim]; - TotalGridVel = new su2double[nDim]; - Normal = new su2double[nDim]; + TotalNormal = new su2double[nDim]; + TurboNormal = new su2double[nDim]; + TotalGridVel = new su2double[nDim]; + Normal = new su2double[nDim]; - bool grid_movement = config->GetGrid_Movement(); + bool grid_movement = config->GetGrid_Movement(); #ifdef HAVE_MPI - su2double MyTotalArea, MyTotalRadius, *MyTotalTurboNormal= NULL, *MyTotalNormal= NULL, *MyTotalGridVel= NULL; + su2double MyTotalArea, MyTotalRadius, *MyTotalTurboNormal = nullptr, *MyTotalNormal = nullptr, + *MyTotalGridVel = nullptr; #endif /*--- Intialization of the vector for the interested boundary ---*/ - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++){ - for (iMarkerTP=1; iMarkerTP < config->GetnMarker_Turbomachinery()+1; iMarkerTP++){ - if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP){ - if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag){ - if(allocate){ - AverageTurboNormal[iMarker] = new su2double *[nSpanWiseSections[marker_flag-1] + 1]; - AverageNormal[iMarker] = new su2double *[nSpanWiseSections[marker_flag-1] + 1]; - AverageGridVel[iMarker] = new su2double *[nSpanWiseSections[marker_flag-1] + 1]; - AverageTangGridVel[iMarker] = new su2double [nSpanWiseSections[marker_flag-1] + 1]; - SpanArea[iMarker] = new su2double [nSpanWiseSections[marker_flag-1] + 1]; - TurboRadius[iMarker] = new su2double [nSpanWiseSections[marker_flag-1] + 1]; - for (iSpan= 0; iSpan < nSpanWiseSections[marker_flag-1] + 1; iSpan++){ - AverageTurboNormal[iMarker][iSpan] = new su2double [nDim]; - AverageNormal[iMarker][iSpan] = new su2double [nDim]; - AverageGridVel[iMarker][iSpan] = new su2double [nDim]; + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + for (iMarkerTP = 1; iMarkerTP < config->GetnMarker_Turbomachinery() + 1; iMarkerTP++) { + if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP) { + if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag) { + if (allocate) { + AverageTurboNormal[iMarker] = new su2double*[nSpanWiseSections[marker_flag - 1] + 1]; + AverageNormal[iMarker] = new su2double*[nSpanWiseSections[marker_flag - 1] + 1]; + AverageGridVel[iMarker] = new su2double*[nSpanWiseSections[marker_flag - 1] + 1]; + AverageTangGridVel[iMarker] = new su2double[nSpanWiseSections[marker_flag - 1] + 1]; + SpanArea[iMarker] = new su2double[nSpanWiseSections[marker_flag - 1] + 1]; + TurboRadius[iMarker] = new su2double[nSpanWiseSections[marker_flag - 1] + 1]; + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1] + 1; iSpan++) { + AverageTurboNormal[iMarker][iSpan] = new su2double[nDim]; + AverageNormal[iMarker][iSpan] = new su2double[nDim]; + AverageGridVel[iMarker][iSpan] = new su2double[nDim]; } } - for (iSpan= 0; iSpan < nSpanWiseSections[marker_flag-1] + 1; iSpan++){ - AverageTangGridVel[iMarker][iSpan] = 0.0; - SpanArea[iMarker][iSpan] = 0.0; - TurboRadius[iMarker][iSpan] = 0.0; - for(iDim=0; iDim < nDim; iDim++){ - AverageTurboNormal[iMarker][iSpan][iDim] = 0.0; - AverageNormal[iMarker][iSpan][iDim] = 0.0; - AverageGridVel[iMarker][iSpan][iDim] = 0.0; + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1] + 1; iSpan++) { + AverageTangGridVel[iMarker][iSpan] = 0.0; + SpanArea[iMarker][iSpan] = 0.0; + TurboRadius[iMarker][iSpan] = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + AverageTurboNormal[iMarker][iSpan][iDim] = 0.0; + AverageNormal[iMarker][iSpan][iDim] = 0.0; + AverageGridVel[iMarker][iSpan][iDim] = 0.0; } } } @@ -6250,45 +5934,41 @@ void CPhysicalGeometry::SetAvgTurboValue(CConfig *config, unsigned short val_iZo } } - - /*--- start computing the average quantities span wise --- */ - for (iSpan= 0; iSpan < nSpanWiseSections[marker_flag-1]; iSpan++){ - + for (iSpan = 0; iSpan < nSpanWiseSections[marker_flag - 1]; iSpan++) { /*--- Forces initialization for contenitors to zero ---*/ - for (iDim=0; iDimGetnMarker_All(); iMarker++){ - for (iMarkerTP=1; iMarkerTP < config->GetnMarker_Turbomachinery()+1; iMarkerTP++){ - if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP){ - if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag){ - for(iVertex = 0; iVertex < nVertexSpan[iMarker][iSpan]; iVertex++){ + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + for (iMarkerTP = 1; iMarkerTP < config->GetnMarker_Turbomachinery() + 1; iMarkerTP++) { + if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP) { + if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag) { + for (iVertex = 0; iVertex < nVertexSpan[iMarker][iSpan]; iVertex++) { iPoint = turbovertex[iMarker][iSpan][iVertex]->GetNode(); turbovertex[iMarker][iSpan][iVertex]->GetTurboNormal(TurboNormal); turbovertex[iMarker][iSpan][iVertex]->GetNormal(Normal); - coord = nodes->GetCoord(iPoint); + coord = nodes->GetCoord(iPoint); - if (nDim == 3){ - radius = sqrt(coord[0]*coord[0] + coord[1]*coord[1]); - } - else{ + if (nDim == 3) { + radius = sqrt(coord[0] * coord[0] + coord[1] * coord[1]); + } else { radius = 0.0; } Area = turbovertex[iMarker][iSpan][iVertex]->GetArea(); - TotalArea += Area; + TotalArea += Area; TotalRadius += radius; for (iDim = 0; iDim < nDim; iDim++) { - TotalTurboNormal[iDim] +=TurboNormal[iDim]; - TotalNormal[iDim] +=Normal[iDim]; + TotalTurboNormal[iDim] += TurboNormal[iDim]; + TotalNormal[iDim] += Normal[iDim]; } - if (grid_movement){ + if (grid_movement) { gridVel = nodes->GetGridVel(iPoint); - for (iDim = 0; iDim < nDim; iDim++) TotalGridVel[iDim] +=gridVel[iDim]; + for (iDim = 0; iDim < nDim; iDim++) TotalGridVel[iDim] += gridVel[iDim]; } } } @@ -6298,104 +5978,120 @@ void CPhysicalGeometry::SetAvgTurboValue(CConfig *config, unsigned short val_iZo #ifdef HAVE_MPI - MyTotalArea = TotalArea; TotalArea = 0; - MyTotalRadius = TotalRadius; TotalRadius = 0; + MyTotalArea = TotalArea; + TotalArea = 0; + MyTotalRadius = TotalRadius; + TotalRadius = 0; SU2_MPI::Allreduce(&MyTotalArea, &TotalArea, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&MyTotalRadius, &TotalRadius, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - MyTotalTurboNormal = new su2double[nDim]; - MyTotalNormal = new su2double[nDim]; - MyTotalGridVel = new su2double[nDim]; + MyTotalTurboNormal = new su2double[nDim]; + MyTotalNormal = new su2double[nDim]; + MyTotalGridVel = new su2double[nDim]; for (iDim = 0; iDim < nDim; iDim++) { - MyTotalTurboNormal[iDim] = TotalTurboNormal[iDim]; - TotalTurboNormal[iDim] = 0.0; - MyTotalNormal[iDim] = TotalNormal[iDim]; - TotalNormal[iDim] = 0.0; - MyTotalGridVel[iDim] = TotalGridVel[iDim]; - TotalGridVel[iDim] = 0.0; + MyTotalTurboNormal[iDim] = TotalTurboNormal[iDim]; + TotalTurboNormal[iDim] = 0.0; + MyTotalNormal[iDim] = TotalNormal[iDim]; + TotalNormal[iDim] = 0.0; + MyTotalGridVel[iDim] = TotalGridVel[iDim]; + TotalGridVel[iDim] = 0.0; } SU2_MPI::Allreduce(MyTotalTurboNormal, TotalTurboNormal, nDim, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(MyTotalNormal, TotalNormal, nDim, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(MyTotalGridVel, TotalGridVel, nDim, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - delete [] MyTotalTurboNormal;delete [] MyTotalNormal; delete [] MyTotalGridVel; + delete[] MyTotalTurboNormal; + delete[] MyTotalNormal; + delete[] MyTotalGridVel; #endif - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++){ - for (iMarkerTP=1; iMarkerTP < config->GetnMarker_Turbomachinery()+1; iMarkerTP++){ - if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP){ - if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag){ - - - SpanArea[iMarker][iSpan] = TotalArea; - TurboRadius[iMarker][iSpan] = TotalRadius/nTotVertexSpan[iMarker][iSpan]; - - turboNormal2 = 0.0; - Normal2 = 0.0; - for (iDim = 0; iDim < nDim; iDim++){ - turboNormal2 += TotalTurboNormal[iDim]*TotalTurboNormal[iDim]; - Normal2 += TotalNormal[iDim]*TotalNormal[iDim]; + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + for (iMarkerTP = 1; iMarkerTP < config->GetnMarker_Turbomachinery() + 1; iMarkerTP++) { + if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP) { + if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag) { + SpanArea[iMarker][iSpan] = TotalArea; + TurboRadius[iMarker][iSpan] = TotalRadius / nTotVertexSpan[iMarker][iSpan]; + + turboNormal2 = 0.0; + Normal2 = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + turboNormal2 += TotalTurboNormal[iDim] * TotalTurboNormal[iDim]; + Normal2 += TotalNormal[iDim] * TotalNormal[iDim]; } - for (iDim = 0; iDim < nDim; iDim++){ - AverageTurboNormal[iMarker][iSpan][iDim] = TotalTurboNormal[iDim]/sqrt(turboNormal2); - AverageNormal[iMarker][iSpan][iDim] = TotalNormal[iDim]/sqrt(Normal2); + for (iDim = 0; iDim < nDim; iDim++) { + AverageTurboNormal[iMarker][iSpan][iDim] = TotalTurboNormal[iDim] / sqrt(turboNormal2); + AverageNormal[iMarker][iSpan][iDim] = TotalNormal[iDim] / sqrt(Normal2); } - if (grid_movement){ - for (iDim = 0; iDim < nDim; iDim++){ - AverageGridVel[iMarker][iSpan][iDim] =TotalGridVel[iDim]/nTotVertexSpan[iMarker][iSpan]; + if (grid_movement) { + for (iDim = 0; iDim < nDim; iDim++) { + AverageGridVel[iMarker][iSpan][iDim] = TotalGridVel[iDim] / nTotVertexSpan[iMarker][iSpan]; } - switch (config->GetKind_TurboMachinery(val_iZone)){ - case CENTRIFUGAL:case CENTRIPETAL: - if (marker_flag == INFLOW ){ - AverageTangGridVel[iMarker][iSpan]= -(AverageTurboNormal[iMarker][iSpan][0]*AverageGridVel[iMarker][iSpan][1]-AverageTurboNormal[iMarker][iSpan][1]*AverageGridVel[iMarker][iSpan][0]); - } - else{ - AverageTangGridVel[iMarker][iSpan]= AverageTurboNormal[iMarker][iSpan][0]*AverageGridVel[iMarker][iSpan][1]-AverageTurboNormal[iMarker][iSpan][1]*AverageGridVel[iMarker][iSpan][0]; - } - break; - case AXIAL: - if (marker_flag == INFLOW && nDim == 2){ - AverageTangGridVel[iMarker][iSpan]= -AverageTurboNormal[iMarker][iSpan][0]*AverageGridVel[iMarker][iSpan][1] + AverageTurboNormal[iMarker][iSpan][1]*AverageGridVel[iMarker][iSpan][0]; - } - else{ - AverageTangGridVel[iMarker][iSpan]= AverageTurboNormal[iMarker][iSpan][0]*AverageGridVel[iMarker][iSpan][1]-AverageTurboNormal[iMarker][iSpan][1]*AverageGridVel[iMarker][iSpan][0]; - } + switch (config->GetKind_TurboMachinery(val_iZone)) { + case CENTRIFUGAL: + case CENTRIPETAL: + if (marker_flag == INFLOW) { + AverageTangGridVel[iMarker][iSpan] = + -(AverageTurboNormal[iMarker][iSpan][0] * AverageGridVel[iMarker][iSpan][1] - + AverageTurboNormal[iMarker][iSpan][1] * AverageGridVel[iMarker][iSpan][0]); + } else { + AverageTangGridVel[iMarker][iSpan] = + AverageTurboNormal[iMarker][iSpan][0] * AverageGridVel[iMarker][iSpan][1] - + AverageTurboNormal[iMarker][iSpan][1] * AverageGridVel[iMarker][iSpan][0]; + } + break; + case AXIAL: + if (marker_flag == INFLOW && nDim == 2) { + AverageTangGridVel[iMarker][iSpan] = + -AverageTurboNormal[iMarker][iSpan][0] * AverageGridVel[iMarker][iSpan][1] + + AverageTurboNormal[iMarker][iSpan][1] * AverageGridVel[iMarker][iSpan][0]; + } else { + AverageTangGridVel[iMarker][iSpan] = + AverageTurboNormal[iMarker][iSpan][0] * AverageGridVel[iMarker][iSpan][1] - + AverageTurboNormal[iMarker][iSpan][1] * AverageGridVel[iMarker][iSpan][0]; + } + break; + case CENTRIPETAL_AXIAL: + if (marker_flag == OUTFLOW) { + AverageTangGridVel[iMarker][iSpan] = + (AverageTurboNormal[iMarker][iSpan][0] * AverageGridVel[iMarker][iSpan][1] - + AverageTurboNormal[iMarker][iSpan][1] * AverageGridVel[iMarker][iSpan][0]); + } else { + AverageTangGridVel[iMarker][iSpan] = + -(AverageTurboNormal[iMarker][iSpan][0] * AverageGridVel[iMarker][iSpan][1] - + AverageTurboNormal[iMarker][iSpan][1] * AverageGridVel[iMarker][iSpan][0]); + } + break; + case AXIAL_CENTRIFUGAL: + if (marker_flag == INFLOW) { + AverageTangGridVel[iMarker][iSpan] = + AverageTurboNormal[iMarker][iSpan][0] * AverageGridVel[iMarker][iSpan][1] - + AverageTurboNormal[iMarker][iSpan][1] * AverageGridVel[iMarker][iSpan][0]; + } else { + AverageTangGridVel[iMarker][iSpan] = + AverageTurboNormal[iMarker][iSpan][0] * AverageGridVel[iMarker][iSpan][1] - + AverageTurboNormal[iMarker][iSpan][1] * AverageGridVel[iMarker][iSpan][0]; + } break; - case CENTRIPETAL_AXIAL: - if (marker_flag == OUTFLOW){ - AverageTangGridVel[iMarker][iSpan]= (AverageTurboNormal[iMarker][iSpan][0]*AverageGridVel[iMarker][iSpan][1]-AverageTurboNormal[iMarker][iSpan][1]*AverageGridVel[iMarker][iSpan][0]); - } - else{ - AverageTangGridVel[iMarker][iSpan]= -(AverageTurboNormal[iMarker][iSpan][0]*AverageGridVel[iMarker][iSpan][1]-AverageTurboNormal[iMarker][iSpan][1]*AverageGridVel[iMarker][iSpan][0]); - } - break; - case AXIAL_CENTRIFUGAL: - if (marker_flag == INFLOW) - { - AverageTangGridVel[iMarker][iSpan]= AverageTurboNormal[iMarker][iSpan][0]*AverageGridVel[iMarker][iSpan][1]-AverageTurboNormal[iMarker][iSpan][1]*AverageGridVel[iMarker][iSpan][0]; - }else - { - AverageTangGridVel[iMarker][iSpan]= AverageTurboNormal[iMarker][iSpan][0]*AverageGridVel[iMarker][iSpan][1]-AverageTurboNormal[iMarker][iSpan][1]*AverageGridVel[iMarker][iSpan][0]; - } - break; - default: + default: SU2_MPI::Error("Tang grid velocity NOT IMPLEMENTED YET for this configuration", CURRENT_FUNCTION); - break; + break; } } /*--- Compute the 1D average values ---*/ - AverageTangGridVel[iMarker][nSpanWiseSections[marker_flag-1]] += AverageTangGridVel[iMarker][iSpan]/nSpanWiseSections[marker_flag-1]; - SpanArea[iMarker][nSpanWiseSections[marker_flag-1]] += SpanArea[iMarker][iSpan]; - for(iDim=0; iDim < nDim; iDim++){ - AverageTurboNormal[iMarker][nSpanWiseSections[marker_flag-1]][iDim] += AverageTurboNormal[iMarker][iSpan][iDim]; - AverageNormal[iMarker][nSpanWiseSections[marker_flag-1]][iDim] += AverageNormal[iMarker][iSpan][iDim]; - AverageGridVel[iMarker][nSpanWiseSections[marker_flag-1]][iDim] += AverageGridVel[iMarker][iSpan][iDim]/nSpanWiseSections[marker_flag-1]; - + AverageTangGridVel[iMarker][nSpanWiseSections[marker_flag - 1]] += + AverageTangGridVel[iMarker][iSpan] / nSpanWiseSections[marker_flag - 1]; + SpanArea[iMarker][nSpanWiseSections[marker_flag - 1]] += SpanArea[iMarker][iSpan]; + for (iDim = 0; iDim < nDim; iDim++) { + AverageTurboNormal[iMarker][nSpanWiseSections[marker_flag - 1]][iDim] += + AverageTurboNormal[iMarker][iSpan][iDim]; + AverageNormal[iMarker][nSpanWiseSections[marker_flag - 1]][iDim] += AverageNormal[iMarker][iSpan][iDim]; + AverageGridVel[iMarker][nSpanWiseSections[marker_flag - 1]][iDim] += + AverageGridVel[iMarker][iSpan][iDim] / nSpanWiseSections[marker_flag - 1]; } } } @@ -6404,38 +6100,36 @@ void CPhysicalGeometry::SetAvgTurboValue(CConfig *config, unsigned short val_iZo } /*--- Normalize 1D normals---*/ - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++){ - for (iMarkerTP=1; iMarkerTP < config->GetnMarker_Turbomachinery()+1; iMarkerTP++){ - if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP){ - if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag){ + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + for (iMarkerTP = 1; iMarkerTP < config->GetnMarker_Turbomachinery() + 1; iMarkerTP++) { + if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP) { + if (config->GetMarker_All_TurbomachineryFlag(iMarker) == marker_flag) { turboNormal2 = 0.0; - Normal2 = 0.0; + Normal2 = 0.0; - for (iDim = 0; iDim < nDim; iDim++){ - turboNormal2 += AverageTurboNormal[iMarker][nSpanWiseSections[marker_flag-1]][iDim]*AverageTurboNormal[iMarker][nSpanWiseSections[marker_flag-1]][iDim]; - Normal2 += AverageNormal[iMarker][nSpanWiseSections[marker_flag-1]][iDim]*AverageNormal[iMarker][nSpanWiseSections[marker_flag-1]][iDim]; + for (iDim = 0; iDim < nDim; iDim++) { + turboNormal2 += AverageTurboNormal[iMarker][nSpanWiseSections[marker_flag - 1]][iDim] * + AverageTurboNormal[iMarker][nSpanWiseSections[marker_flag - 1]][iDim]; + Normal2 += AverageNormal[iMarker][nSpanWiseSections[marker_flag - 1]][iDim] * + AverageNormal[iMarker][nSpanWiseSections[marker_flag - 1]][iDim]; } - for (iDim = 0; iDim < nDim; iDim++){ - AverageTurboNormal[iMarker][nSpanWiseSections[marker_flag-1]][iDim] /=sqrt(turboNormal2); - AverageNormal[iMarker][nSpanWiseSections[marker_flag-1]][iDim] /=sqrt(Normal2); + for (iDim = 0; iDim < nDim; iDim++) { + AverageTurboNormal[iMarker][nSpanWiseSections[marker_flag - 1]][iDim] /= sqrt(turboNormal2); + AverageNormal[iMarker][nSpanWiseSections[marker_flag - 1]][iDim] /= sqrt(Normal2); } } } } } - - delete [] TotalTurboNormal; - delete [] TotalNormal; - delete [] TotalGridVel; - delete [] TurboNormal; - delete [] Normal; - + delete[] TotalTurboNormal; + delete[] TotalNormal; + delete[] TotalGridVel; + delete[] TurboNormal; + delete[] Normal; } - -void CPhysicalGeometry::GatherInOutAverageValues(CConfig *config, bool allocate){ - +void CPhysicalGeometry::GatherInOutAverageValues(CConfig* config, bool allocate) { unsigned short iMarker, iMarkerTP; unsigned short iSpan, iDim; int markerTP; @@ -6449,97 +6143,92 @@ void CPhysicalGeometry::GatherInOutAverageValues(CConfig *config, bool allocate) turboNormal = new su2double[nDim]; Pitch = 0.0; - if(allocate){ - for (iMarkerTP=0; iMarkerTP < config->GetnMarker_TurboPerformance(); iMarkerTP++){ - SpanAreaIn[iMarkerTP] = new su2double[config->GetnSpanMaxAllZones() +1]; - TangGridVelIn[iMarkerTP] = new su2double[config->GetnSpanMaxAllZones() +1]; - TurboRadiusIn[iMarkerTP] = new su2double[config->GetnSpanMaxAllZones() +1]; - SpanAreaOut[iMarkerTP] = new su2double[config->GetnSpanMaxAllZones() +1]; - TangGridVelOut[iMarkerTP] = new su2double[config->GetnSpanMaxAllZones() +1]; - TurboRadiusOut[iMarkerTP] = new su2double[config->GetnSpanMaxAllZones() +1]; + if (allocate) { + for (iMarkerTP = 0; iMarkerTP < config->GetnMarker_TurboPerformance(); iMarkerTP++) { + SpanAreaIn[iMarkerTP] = new su2double[config->GetnSpanMaxAllZones() + 1]; + TangGridVelIn[iMarkerTP] = new su2double[config->GetnSpanMaxAllZones() + 1]; + TurboRadiusIn[iMarkerTP] = new su2double[config->GetnSpanMaxAllZones() + 1]; + SpanAreaOut[iMarkerTP] = new su2double[config->GetnSpanMaxAllZones() + 1]; + TangGridVelOut[iMarkerTP] = new su2double[config->GetnSpanMaxAllZones() + 1]; + TurboRadiusOut[iMarkerTP] = new su2double[config->GetnSpanMaxAllZones() + 1]; - for (iSpan= 0; iSpan < config->GetnSpanMaxAllZones() + 1 ; iSpan++){ - SpanAreaIn[iMarkerTP][iSpan] = 0.0; - TangGridVelIn[iMarkerTP][iSpan] = 0.0; - TurboRadiusIn[iMarkerTP][iSpan] = 0.0; - SpanAreaOut[iMarkerTP][iSpan] = 0.0; - TangGridVelOut[iMarkerTP][iSpan] = 0.0; - TurboRadiusOut[iMarkerTP][iSpan] = 0.0; + for (iSpan = 0; iSpan < config->GetnSpanMaxAllZones() + 1; iSpan++) { + SpanAreaIn[iMarkerTP][iSpan] = 0.0; + TangGridVelIn[iMarkerTP][iSpan] = 0.0; + TurboRadiusIn[iMarkerTP][iSpan] = 0.0; + SpanAreaOut[iMarkerTP][iSpan] = 0.0; + TangGridVelOut[iMarkerTP][iSpan] = 0.0; + TurboRadiusOut[iMarkerTP][iSpan] = 0.0; } } } - - - for (iSpan= 0; iSpan < nSpanWiseSections + 1 ; iSpan++){ + for (iSpan = 0; iSpan < nSpanWiseSections + 1; iSpan++) { #ifdef HAVE_MPI - unsigned short i, n1, n2, n1t,n2t; - su2double *TurbGeoIn= NULL,*TurbGeoOut= NULL; - su2double *TotTurbGeoIn = NULL,*TotTurbGeoOut = NULL; - int *TotMarkerTP; - - n1 = 6; - n2 = 3; - n1t = n1*size; - n2t = n2*size; - TurbGeoIn = new su2double[n1]; + unsigned short i, n1, n2, n1t, n2t; + su2double *TurbGeoIn = nullptr, *TurbGeoOut = nullptr; + su2double *TotTurbGeoIn = nullptr, *TotTurbGeoOut = nullptr; + int* TotMarkerTP; + + n1 = 6; + n2 = 3; + n1t = n1 * size; + n2t = n2 * size; + TurbGeoIn = new su2double[n1]; TurbGeoOut = new su2double[n2]; - for (i=0;iGetnMarker_All(); iMarker++){ - for (iMarkerTP = 1; iMarkerTP < config->GetnMarker_Turbomachinery()+1; iMarkerTP++){ - if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP){ - if (config->GetMarker_All_TurbomachineryFlag(iMarker) == INFLOW){ - markerTP = iMarkerTP; - if (iSpan < nSpanWiseSections){ - pitchIn = MaxAngularCoord[iMarker][iSpan] - MinAngularCoord[iMarker][iSpan]; + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + for (iMarkerTP = 1; iMarkerTP < config->GetnMarker_Turbomachinery() + 1; iMarkerTP++) { + if (config->GetMarker_All_Turbomachinery(iMarker) == iMarkerTP) { + if (config->GetMarker_All_TurbomachineryFlag(iMarker) == INFLOW) { + markerTP = iMarkerTP; + if (iSpan < nSpanWiseSections) { + pitchIn = MaxAngularCoord[iMarker][iSpan] - MinAngularCoord[iMarker][iSpan]; } - areaIn = SpanArea[iMarker][iSpan]; - tangGridVelIn = AverageTangGridVel[iMarker][iSpan]; - radiusIn = TurboRadius[iMarker][iSpan]; - for(iDim = 0; iDim < nDim; iDim++) turboNormal[iDim] = AverageTurboNormal[iMarker][iSpan][iDim]; - + areaIn = SpanArea[iMarker][iSpan]; + tangGridVelIn = AverageTangGridVel[iMarker][iSpan]; + radiusIn = TurboRadius[iMarker][iSpan]; + for (iDim = 0; iDim < nDim; iDim++) turboNormal[iDim] = AverageTurboNormal[iMarker][iSpan][iDim]; #ifdef HAVE_MPI - TurbGeoIn[0] = areaIn; - TurbGeoIn[1] = tangGridVelIn; - TurbGeoIn[2] = radiusIn; - TurbGeoIn[3] = turboNormal[0]; - TurbGeoIn[4] = turboNormal[1]; - TurbGeoIn[5] = pitchIn; + TurbGeoIn[0] = areaIn; + TurbGeoIn[1] = tangGridVelIn; + TurbGeoIn[2] = radiusIn; + TurbGeoIn[3] = turboNormal[0]; + TurbGeoIn[4] = turboNormal[1]; + TurbGeoIn[5] = pitchIn; #endif } /*--- retrieve outlet information ---*/ - if (config->GetMarker_All_TurbomachineryFlag(iMarker) == OUTFLOW){ - if (iSpan < nSpanWiseSections){ - pitchIn = MaxAngularCoord[iMarker][iSpan] - MinAngularCoord[iMarker][iSpan]; + if (config->GetMarker_All_TurbomachineryFlag(iMarker) == OUTFLOW) { + if (iSpan < nSpanWiseSections) { + pitchIn = MaxAngularCoord[iMarker][iSpan] - MinAngularCoord[iMarker][iSpan]; } - areaOut = SpanArea[iMarker][iSpan]; - tangGridVelOut = AverageTangGridVel[iMarker][iSpan]; - radiusOut = TurboRadius[iMarker][iSpan]; + areaOut = SpanArea[iMarker][iSpan]; + tangGridVelOut = AverageTangGridVel[iMarker][iSpan]; + radiusOut = TurboRadius[iMarker][iSpan]; #ifdef HAVE_MPI - TurbGeoOut[0] = areaOut; - TurbGeoOut[1] = tangGridVelOut; - TurbGeoOut[2] = radiusOut; + TurbGeoOut[0] = areaOut; + TurbGeoOut[1] = tangGridVelOut; + TurbGeoOut[2] = radiusOut; #endif } } @@ -6547,89 +6236,83 @@ void CPhysicalGeometry::GatherInOutAverageValues(CConfig *config, bool allocate) } #ifdef HAVE_MPI - TotTurbGeoIn = new su2double[n1t]; - TotTurbGeoOut = new su2double[n2t]; - for (i=0;i 0.0) { + areaIn = 0.0; + areaIn = TotTurbGeoIn[n1 * i]; + tangGridVelIn = 0.0; + tangGridVelIn = TotTurbGeoIn[n1 * i + 1]; + radiusIn = 0.0; + radiusIn = TotTurbGeoIn[n1 * i + 2]; + turboNormal[0] = 0.0; + turboNormal[0] = TotTurbGeoIn[n1 * i + 3]; + turboNormal[1] = 0.0; + turboNormal[1] = TotTurbGeoIn[n1 * i + 4]; + pitchIn = 0.0; + pitchIn = TotTurbGeoIn[n1 * i + 5]; - for (i=0;i 0.0){ - areaIn = 0.0; - areaIn = TotTurbGeoIn[n1*i]; - tangGridVelIn = 0.0; - tangGridVelIn = TotTurbGeoIn[n1*i+1]; - radiusIn = 0.0; - radiusIn = TotTurbGeoIn[n1*i+2]; - turboNormal[0] = 0.0; - turboNormal[0] = TotTurbGeoIn[n1*i+3]; - turboNormal[1] = 0.0; - turboNormal[1] = TotTurbGeoIn[n1*i+4]; - pitchIn = 0.0; - pitchIn = TotTurbGeoIn[n1*i+5]; - - markerTP = -1; - markerTP = TotMarkerTP[i]; + markerTP = -1; + markerTP = TotMarkerTP[i]; } - if(TotTurbGeoOut[n2*i] > 0.0){ - areaOut = 0.0; - areaOut = TotTurbGeoOut[n2*i]; - tangGridVelOut = 0.0; - tangGridVelOut = TotTurbGeoOut[n2*i+1]; - radiusOut = 0.0; - radiusOut = TotTurbGeoOut[n2*i+2]; + if (TotTurbGeoOut[n2 * i] > 0.0) { + areaOut = 0.0; + areaOut = TotTurbGeoOut[n2 * i]; + tangGridVelOut = 0.0; + tangGridVelOut = TotTurbGeoOut[n2 * i + 1]; + radiusOut = 0.0; + radiusOut = TotTurbGeoOut[n2 * i + 2]; } } - delete [] TotTurbGeoIn, delete [] TotTurbGeoOut; delete [] TotMarkerTP; - + delete[] TotTurbGeoIn, delete[] TotTurbGeoOut; + delete[] TotMarkerTP; #endif - Pitch +=pitchIn/nSpanWiseSections; + Pitch += pitchIn / nSpanWiseSections; if (iSpan == nSpanWiseSections) { config->SetFreeStreamTurboNormal(turboNormal); - if (config->GetKind_TurboMachinery(config->GetiZone()) == AXIAL && nDim == 2){ - nBlades = 1/Pitch; - } - else{ - nBlades = 2*PI_NUMBER/Pitch; + if (config->GetKind_TurboMachinery(config->GetiZone()) == AXIAL && nDim == 2) { + nBlades = 1 / Pitch; + } else { + nBlades = 2 * PI_NUMBER / Pitch; } config->SetnBlades(config->GetiZone(), nBlades); } - if (rank == MASTER_NODE){ + if (rank == MASTER_NODE) { /*----Quantities needed for computing the turbomachinery performance -----*/ - SpanAreaIn[markerTP -1][iSpan] = areaIn; - TangGridVelIn[markerTP -1][iSpan] = tangGridVelIn; - TurboRadiusIn[markerTP -1][iSpan] = radiusIn; + SpanAreaIn[markerTP - 1][iSpan] = areaIn; + TangGridVelIn[markerTP - 1][iSpan] = tangGridVelIn; + TurboRadiusIn[markerTP - 1][iSpan] = radiusIn; - SpanAreaOut[markerTP -1][iSpan] = areaOut; - TangGridVelOut[markerTP -1][iSpan] = tangGridVelOut; - TurboRadiusOut[markerTP -1][iSpan] = radiusOut; + SpanAreaOut[markerTP - 1][iSpan] = areaOut; + TangGridVelOut[markerTP - 1][iSpan] = tangGridVelOut; + TurboRadiusOut[markerTP - 1][iSpan] = radiusOut; } } - delete [] turboNormal; - + delete[] turboNormal; } void CPhysicalGeometry::SetMaxLength(CConfig* config) { - - SU2_OMP_FOR_STAT(roundUpDiv(nPointDomain,omp_get_max_threads())) + SU2_OMP_FOR_STAT(roundUpDiv(nPointDomain, omp_get_max_threads())) for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { const su2double* Coord_i = nodes->GetCoord(iPoint); @@ -6639,13 +6322,12 @@ void CPhysicalGeometry::SetMaxLength(CConfig* config) { const bool wasActive = AD::BeginPassive(); - su2double max_delta=0; + su2double max_delta = 0; auto max_neighbor = iPoint; for (unsigned short iNeigh = 0; iNeigh < nodes->GetnPoint(iPoint); iNeigh++) { - /*-- Calculate the cell-center to cell-center length ---*/ - const unsigned long jPoint = nodes->GetPoint(iPoint, iNeigh); + const unsigned long jPoint = nodes->GetPoint(iPoint, iNeigh); const su2double* Coord_j = nodes->GetCoord(jPoint); su2double delta = GeometryToolbox::SquaredDistance(nDim, Coord_i, Coord_j); @@ -6669,19 +6351,17 @@ void CPhysicalGeometry::SetMaxLength(CConfig* config) { InitiateComms(this, config, MAX_LENGTH); CompleteComms(this, config, MAX_LENGTH); - } -void CPhysicalGeometry::MatchActuator_Disk(const CConfig *config) { - +void CPhysicalGeometry::MatchActuator_Disk(const CConfig* config) { su2double epsilon = 1e-1; unsigned short nMarker_ActDiskInlet = config->GetnMarker_ActDiskInlet(); if (nMarker_ActDiskInlet != 0) { - unsigned short iMarker, iDim; - unsigned long iVertex, iPoint, iPointGlobal, pPoint = 0, pPointGlobal = 0, pVertex = 0, pMarker = 0, jVertex, jVertex_, jPoint, jPointGlobal, jMarker; + unsigned long iVertex, iPoint, iPointGlobal, pPoint = 0, pPointGlobal = 0, pVertex = 0, pMarker = 0, jVertex, + jVertex_, jPoint, jPointGlobal, jMarker; su2double *Coord_i, Coord_j[3], dist = 0.0, mindist, maxdist_local = 0.0, maxdist_global = 0.0; int iProcessor, pProcessor = 0; unsigned long nLocalVertex_ActDisk = 0, MaxLocalVertex_ActDisk = 0; @@ -6690,12 +6370,17 @@ void CPhysicalGeometry::MatchActuator_Disk(const CConfig *config) { bool Perimeter; for (iBC = 0; iBC < 2; iBC++) { + if (iBC == 0) { + Beneficiary = ACTDISK_INLET; + Donor = ACTDISK_OUTLET; + } + if (iBC == 1) { + Beneficiary = ACTDISK_OUTLET; + Donor = ACTDISK_INLET; + } - if (iBC == 0) { Beneficiary = ACTDISK_INLET; Donor = ACTDISK_OUTLET; } - if (iBC == 1) { Beneficiary = ACTDISK_OUTLET; Donor = ACTDISK_INLET; } - - unsigned long *Buffer_Send_nVertex = new unsigned long [1]; - unsigned long *Buffer_Receive_nVertex = new unsigned long [nProcessor]; + auto* Buffer_Send_nVertex = new unsigned long[1]; + auto* Buffer_Receive_nVertex = new unsigned long[nProcessor]; if ((iBC == 0) && (rank == MASTER_NODE)) cout << "Set Actuator Disk inlet boundary conditions." << endl; if ((iBC == 1) && (rank == MASTER_NODE)) cout << "Set Actuator Disk outlet boundary conditions." << endl; @@ -6708,7 +6393,7 @@ void CPhysicalGeometry::MatchActuator_Disk(const CConfig *config) { if (config->GetMarker_All_KindBC(iMarker) == Donor) { for (iVertex = 0; iVertex < GetnVertex(iMarker); iVertex++) { iPoint = vertex[iMarker][iVertex]->GetNode(); - if (nodes->GetDomain(iPoint)) nLocalVertex_ActDisk ++; + if (nodes->GetDomain(iPoint)) nLocalVertex_ActDisk++; } } } @@ -6717,24 +6402,26 @@ void CPhysicalGeometry::MatchActuator_Disk(const CConfig *config) { /*--- Send actuator disk vertex information --*/ - SU2_MPI::Allreduce(&nLocalVertex_ActDisk, &MaxLocalVertex_ActDisk, 1, MPI_UNSIGNED_LONG, MPI_MAX, SU2_MPI::GetComm()); - SU2_MPI::Allgather(Buffer_Send_nVertex, 1, MPI_UNSIGNED_LONG, Buffer_Receive_nVertex, 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&nLocalVertex_ActDisk, &MaxLocalVertex_ActDisk, 1, MPI_UNSIGNED_LONG, MPI_MAX, + SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_nVertex, 1, MPI_UNSIGNED_LONG, Buffer_Receive_nVertex, 1, MPI_UNSIGNED_LONG, + SU2_MPI::GetComm()); /*--- Array dimensionalization --*/ - su2double *Buffer_Send_Coord = new su2double [MaxLocalVertex_ActDisk*nDim]; - unsigned long *Buffer_Send_Point = new unsigned long [MaxLocalVertex_ActDisk]; - unsigned long *Buffer_Send_GlobalIndex = new unsigned long [MaxLocalVertex_ActDisk]; - unsigned long *Buffer_Send_Vertex = new unsigned long [MaxLocalVertex_ActDisk]; - unsigned long *Buffer_Send_Marker = new unsigned long [MaxLocalVertex_ActDisk]; + auto* Buffer_Send_Coord = new su2double[MaxLocalVertex_ActDisk * nDim]; + auto* Buffer_Send_Point = new unsigned long[MaxLocalVertex_ActDisk]; + auto* Buffer_Send_GlobalIndex = new unsigned long[MaxLocalVertex_ActDisk]; + auto* Buffer_Send_Vertex = new unsigned long[MaxLocalVertex_ActDisk]; + auto* Buffer_Send_Marker = new unsigned long[MaxLocalVertex_ActDisk]; - su2double *Buffer_Receive_Coord = new su2double [nProcessor*MaxLocalVertex_ActDisk*nDim]; - unsigned long *Buffer_Receive_Point = new unsigned long [nProcessor*MaxLocalVertex_ActDisk]; - unsigned long *Buffer_Receive_GlobalIndex = new unsigned long [nProcessor*MaxLocalVertex_ActDisk]; - unsigned long *Buffer_Receive_Vertex = new unsigned long [nProcessor*MaxLocalVertex_ActDisk]; - unsigned long *Buffer_Receive_Marker = new unsigned long [nProcessor*MaxLocalVertex_ActDisk]; + auto* Buffer_Receive_Coord = new su2double[nProcessor * MaxLocalVertex_ActDisk * nDim]; + auto* Buffer_Receive_Point = new unsigned long[nProcessor * MaxLocalVertex_ActDisk]; + auto* Buffer_Receive_GlobalIndex = new unsigned long[nProcessor * MaxLocalVertex_ActDisk]; + auto* Buffer_Receive_Vertex = new unsigned long[nProcessor * MaxLocalVertex_ActDisk]; + auto* Buffer_Receive_Marker = new unsigned long[nProcessor * MaxLocalVertex_ActDisk]; - unsigned long nBuffer_Coord = MaxLocalVertex_ActDisk*nDim; + unsigned long nBuffer_Coord = MaxLocalVertex_ActDisk * nDim; unsigned long nBuffer_Point = MaxLocalVertex_ActDisk; unsigned long nBuffer_GlobalIndex = MaxLocalVertex_ActDisk; unsigned long nBuffer_Vertex = MaxLocalVertex_ActDisk; @@ -6745,8 +6432,7 @@ void CPhysicalGeometry::MatchActuator_Disk(const CConfig *config) { Buffer_Send_GlobalIndex[iVertex] = 0; Buffer_Send_Vertex[iVertex] = 0; Buffer_Send_Marker[iVertex] = 0; - for (iDim = 0; iDim < nDim; iDim++) - Buffer_Send_Coord[iVertex*nDim+iDim] = 0.0; + for (iDim = 0; iDim < nDim; iDim++) Buffer_Send_Coord[iVertex * nDim + iDim] = 0.0; } /*--- Copy coordinates and point to the auxiliar vector --*/ @@ -6763,18 +6449,23 @@ void CPhysicalGeometry::MatchActuator_Disk(const CConfig *config) { Buffer_Send_Vertex[nLocalVertex_ActDisk] = iVertex; Buffer_Send_Marker[nLocalVertex_ActDisk] = iMarker; for (iDim = 0; iDim < nDim; iDim++) - Buffer_Send_Coord[nLocalVertex_ActDisk*nDim+iDim] = nodes->GetCoord(iPoint, iDim); + Buffer_Send_Coord[nLocalVertex_ActDisk * nDim + iDim] = nodes->GetCoord(iPoint, iDim); nLocalVertex_ActDisk++; } } } } - SU2_MPI::Allgather(Buffer_Send_Coord, nBuffer_Coord, MPI_DOUBLE, Buffer_Receive_Coord, nBuffer_Coord, MPI_DOUBLE, SU2_MPI::GetComm()); - SU2_MPI::Allgather(Buffer_Send_Point, nBuffer_Point, MPI_UNSIGNED_LONG, Buffer_Receive_Point, nBuffer_Point, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); - SU2_MPI::Allgather(Buffer_Send_GlobalIndex, nBuffer_GlobalIndex, MPI_UNSIGNED_LONG, Buffer_Receive_GlobalIndex, nBuffer_GlobalIndex, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); - SU2_MPI::Allgather(Buffer_Send_Vertex, nBuffer_Vertex, MPI_UNSIGNED_LONG, Buffer_Receive_Vertex, nBuffer_Vertex, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); - SU2_MPI::Allgather(Buffer_Send_Marker, nBuffer_Marker, MPI_UNSIGNED_LONG, Buffer_Receive_Marker, nBuffer_Marker, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_Coord, nBuffer_Coord, MPI_DOUBLE, Buffer_Receive_Coord, nBuffer_Coord, MPI_DOUBLE, + SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_Point, nBuffer_Point, MPI_UNSIGNED_LONG, Buffer_Receive_Point, nBuffer_Point, + MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_GlobalIndex, nBuffer_GlobalIndex, MPI_UNSIGNED_LONG, Buffer_Receive_GlobalIndex, + nBuffer_GlobalIndex, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_Vertex, nBuffer_Vertex, MPI_UNSIGNED_LONG, Buffer_Receive_Vertex, nBuffer_Vertex, + MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_Marker, nBuffer_Marker, MPI_UNSIGNED_LONG, Buffer_Receive_Marker, nBuffer_Marker, + MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); /*--- Compute the closest point to an actuator disk inlet point ---*/ @@ -6782,17 +6473,17 @@ void CPhysicalGeometry::MatchActuator_Disk(const CConfig *config) { for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if (config->GetMarker_All_KindBC(iMarker) == Beneficiary) { - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { iPoint = vertex[iMarker][iVertex]->GetNode(); iPointGlobal = nodes->GetGlobalIndex(iPoint); - if (nodes->GetDomain(iPoint)) { - /*--- Coordinates of the boundary point ---*/ - Coord_i = nodes->GetCoord(iPoint); mindist = 1E6; pProcessor = 0; pPoint = 0; + Coord_i = nodes->GetCoord(iPoint); + mindist = 1E6; + pProcessor = 0; + pPoint = 0; /*--- Loop over all the boundaries to find the pair ---*/ @@ -6800,32 +6491,36 @@ void CPhysicalGeometry::MatchActuator_Disk(const CConfig *config) { for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) { for (jVertex = 0; jVertex < Buffer_Receive_nVertex[iProcessor]; jVertex++) { - jPoint = Buffer_Receive_Point[iProcessor*MaxLocalVertex_ActDisk+jVertex]; - jPointGlobal = Buffer_Receive_GlobalIndex[iProcessor*MaxLocalVertex_ActDisk+jVertex]; - jVertex_ = Buffer_Receive_Vertex[iProcessor*MaxLocalVertex_ActDisk+jVertex]; - jMarker = Buffer_Receive_Marker[iProcessor*MaxLocalVertex_ActDisk+jVertex]; + jPoint = Buffer_Receive_Point[iProcessor * MaxLocalVertex_ActDisk + jVertex]; + jPointGlobal = Buffer_Receive_GlobalIndex[iProcessor * MaxLocalVertex_ActDisk + jVertex]; + jVertex_ = Buffer_Receive_Vertex[iProcessor * MaxLocalVertex_ActDisk + jVertex]; + jMarker = Buffer_Receive_Marker[iProcessor * MaxLocalVertex_ActDisk + jVertex]; - // if (jPointGlobal != iPointGlobal) { - // ActDisk_Perimeter + // if (jPointGlobal != iPointGlobal) { + // ActDisk_Perimeter - /*--- Compute the distance ---*/ + /*--- Compute the distance ---*/ - dist = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - Coord_j[iDim] = Buffer_Receive_Coord[(iProcessor*MaxLocalVertex_ActDisk+jVertex)*nDim+iDim]; - dist += pow(Coord_j[iDim]-Coord_i[iDim], 2.0); - } - dist = sqrt(dist); - - if (dist < mindist) { - mindist = dist; pProcessor = iProcessor; pPoint = jPoint; pPointGlobal = jPointGlobal; - pVertex = jVertex_; pMarker = jMarker; - if (dist == 0.0) break; - } + dist = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + Coord_j[iDim] = Buffer_Receive_Coord[(iProcessor * MaxLocalVertex_ActDisk + jVertex) * nDim + iDim]; + dist += pow(Coord_j[iDim] - Coord_i[iDim], 2.0); + } + dist = sqrt(dist); + + if (dist < mindist) { + mindist = dist; + pProcessor = iProcessor; + pPoint = jPoint; + pPointGlobal = jPointGlobal; + pVertex = jVertex_; + pMarker = jMarker; + if (dist == 0.0) break; + } -// } -// else { Perimeter = true; mindist = 0.0; dist = 0.0; break; } - } + // } + // else { Perimeter = true; mindist = 0.0; dist = 0.0; break; } + } } /*--- Store the value of the pair ---*/ @@ -6842,16 +6537,14 @@ void CPhysicalGeometry::MatchActuator_Disk(const CConfig *config) { vertex[iMarker][iVertex]->SetDonorPoint(iPoint, iPointGlobal, pVertex, pMarker, pProcessor); maxdist_local = min(maxdist_local, 0.0); } - } } - } } SU2_MPI::Reduce(&maxdist_local, &maxdist_global, 1, MPI_DOUBLE, MPI_MAX, MASTER_NODE, SU2_MPI::GetComm()); - if (rank == MASTER_NODE) cout <<"The max distance between points is: " << maxdist_global <<"."<< endl; + if (rank == MASTER_NODE) cout << "The max distance between points is: " << maxdist_global << "." << endl; delete[] Buffer_Send_Coord; delete[] Buffer_Send_Point; @@ -6862,22 +6555,18 @@ void CPhysicalGeometry::MatchActuator_Disk(const CConfig *config) { delete[] Buffer_Send_nVertex; delete[] Buffer_Receive_nVertex; - delete [] Buffer_Send_GlobalIndex; - delete [] Buffer_Send_Vertex; - delete [] Buffer_Send_Marker; - - delete [] Buffer_Receive_GlobalIndex; - delete [] Buffer_Receive_Vertex; - delete [] Buffer_Receive_Marker; + delete[] Buffer_Send_GlobalIndex; + delete[] Buffer_Send_Vertex; + delete[] Buffer_Send_Marker; + delete[] Buffer_Receive_GlobalIndex; + delete[] Buffer_Receive_Vertex; + delete[] Buffer_Receive_Marker; } } - } -void CPhysicalGeometry::MatchPeriodic(const CConfig *config, - unsigned short val_periodic) { - +void CPhysicalGeometry::MatchPeriodic(const CConfig* config, unsigned short val_periodic) { unsigned short iMarker, iDim, jMarker, pMarker = 0; unsigned short iPeriodic, nPeriodic; @@ -6895,8 +6584,8 @@ void CPhysicalGeometry::MatchPeriodic(const CConfig *config, su2double *Coord_i, Coord_j[3], dist, mindist, maxdist_local, maxdist_global; const su2double *center, *angles, *trans; - su2double translation[3]={0.0,0.0,0.0}, dx, dy, dz; - su2double rotMatrix[3][3] = {{1.0,0.0,0.0},{0.0,1.0,0.0},{0.0,0.0,1.0}}; + su2double translation[3] = {0.0, 0.0, 0.0}, dx, dy, dz; + su2double rotMatrix[3][3] = {{1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}}; su2double Theta, Phi, Psi, cosTheta, sinTheta, cosPhi, sinPhi, cosPsi, sinPsi; su2double rotCoord[3] = {0.0, 0.0, 0.0}; @@ -6928,8 +6617,7 @@ void CPhysicalGeometry::MatchPeriodic(const CConfig *config, for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { iPeriodic = config->GetMarker_All_PerBound(iMarker); - if ((iPeriodic == val_periodic) || - (iPeriodic == val_periodic + nPeriodic/2)) { + if ((iPeriodic == val_periodic) || (iPeriodic == val_periodic + nPeriodic / 2)) { for (iVertex = 0; iVertex < GetnVertex(iMarker); iVertex++) { iPoint = vertex[iMarker][iVertex]->GetNode(); if (nodes->GetDomain(iPoint)) nLocalVertex_Periodic++; @@ -6941,46 +6629,45 @@ void CPhysicalGeometry::MatchPeriodic(const CConfig *config, /*--- Communicate our local periodic point count globally and receive the counts of periodic points from all other ranks.---*/ - unsigned long *Buffer_Send_nVertex = new unsigned long [1]; - unsigned long *Buffer_Recv_nVertex = new unsigned long [nProcessor]; + auto* Buffer_Send_nVertex = new unsigned long[1]; + auto* Buffer_Recv_nVertex = new unsigned long[nProcessor]; Buffer_Send_nVertex[0] = nLocalVertex_Periodic; /*--- Copy our own count in serial or use collective comms with MPI. ---*/ - SU2_MPI::Allreduce(&nLocalVertex_Periodic, &MaxLocalVertex_Periodic, 1, - MPI_UNSIGNED_LONG, MPI_MAX, SU2_MPI::GetComm()); - SU2_MPI::Allgather(Buffer_Send_nVertex, 1, MPI_UNSIGNED_LONG, - Buffer_Recv_nVertex, 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&nLocalVertex_Periodic, &MaxLocalVertex_Periodic, 1, MPI_UNSIGNED_LONG, MPI_MAX, + SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_nVertex, 1, MPI_UNSIGNED_LONG, Buffer_Recv_nVertex, 1, MPI_UNSIGNED_LONG, + SU2_MPI::GetComm()); /*--- Prepare buffers to send the information for each periodic point to all ranks so that we can match pairs. ---*/ - su2double *Buffer_Send_Coord = new su2double [MaxLocalVertex_Periodic*nDim]; - unsigned long *Buffer_Send_Point = new unsigned long [MaxLocalVertex_Periodic]; - unsigned long *Buffer_Send_GlobalIndex = new unsigned long [MaxLocalVertex_Periodic]; - unsigned long *Buffer_Send_Vertex = new unsigned long [MaxLocalVertex_Periodic]; - unsigned long *Buffer_Send_Marker = new unsigned long [MaxLocalVertex_Periodic]; + auto* Buffer_Send_Coord = new su2double[MaxLocalVertex_Periodic * nDim]; + auto* Buffer_Send_Point = new unsigned long[MaxLocalVertex_Periodic]; + auto* Buffer_Send_GlobalIndex = new unsigned long[MaxLocalVertex_Periodic]; + auto* Buffer_Send_Vertex = new unsigned long[MaxLocalVertex_Periodic]; + auto* Buffer_Send_Marker = new unsigned long[MaxLocalVertex_Periodic]; - su2double *Buffer_Recv_Coord = new su2double [nProcessor*MaxLocalVertex_Periodic*nDim]; - unsigned long *Buffer_Recv_Point = new unsigned long [nProcessor*MaxLocalVertex_Periodic]; - unsigned long *Buffer_Recv_GlobalIndex = new unsigned long [nProcessor*MaxLocalVertex_Periodic]; - unsigned long *Buffer_Recv_Vertex = new unsigned long [nProcessor*MaxLocalVertex_Periodic]; - unsigned long *Buffer_Recv_Marker = new unsigned long [nProcessor*MaxLocalVertex_Periodic]; + auto* Buffer_Recv_Coord = new su2double[nProcessor * MaxLocalVertex_Periodic * nDim]; + auto* Buffer_Recv_Point = new unsigned long[nProcessor * MaxLocalVertex_Periodic]; + auto* Buffer_Recv_GlobalIndex = new unsigned long[nProcessor * MaxLocalVertex_Periodic]; + auto* Buffer_Recv_Vertex = new unsigned long[nProcessor * MaxLocalVertex_Periodic]; + auto* Buffer_Recv_Marker = new unsigned long[nProcessor * MaxLocalVertex_Periodic]; - unsigned long nBuffer_Coord = MaxLocalVertex_Periodic*nDim; - unsigned long nBuffer_Point = MaxLocalVertex_Periodic; + unsigned long nBuffer_Coord = MaxLocalVertex_Periodic * nDim; + unsigned long nBuffer_Point = MaxLocalVertex_Periodic; unsigned long nBuffer_GlobalIndex = MaxLocalVertex_Periodic; - unsigned long nBuffer_Vertex = MaxLocalVertex_Periodic; - unsigned long nBuffer_Marker = MaxLocalVertex_Periodic; + unsigned long nBuffer_Vertex = MaxLocalVertex_Periodic; + unsigned long nBuffer_Marker = MaxLocalVertex_Periodic; for (iVertex = 0; iVertex < MaxLocalVertex_Periodic; iVertex++) { - Buffer_Send_Point[iVertex] = 0; + Buffer_Send_Point[iVertex] = 0; Buffer_Send_GlobalIndex[iVertex] = 0; - Buffer_Send_Vertex[iVertex] = 0; - Buffer_Send_Marker[iVertex] = 0; - for (iDim = 0; iDim < nDim; iDim++) - Buffer_Send_Coord[iVertex*nDim+iDim] = 0.0; + Buffer_Send_Vertex[iVertex] = 0; + Buffer_Send_Marker[iVertex] = 0; + for (iDim = 0; iDim < nDim; iDim++) Buffer_Send_Coord[iVertex * nDim + iDim] = 0.0; } /*--- Store the local index, global index, local boundary index, @@ -6992,8 +6679,7 @@ void CPhysicalGeometry::MatchPeriodic(const CConfig *config, for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { iPeriodic = config->GetMarker_All_PerBound(iMarker); - if ((iPeriodic == val_periodic) || - (iPeriodic == val_periodic + nPeriodic/2)) { + if ((iPeriodic == val_periodic) || (iPeriodic == val_periodic + nPeriodic / 2)) { for (iVertex = 0; iVertex < GetnVertex(iMarker); iVertex++) { iPoint = vertex[iMarker][iVertex]->GetNode(); iPointGlobal = nodes->GetGlobalIndex(iPoint); @@ -7003,7 +6689,7 @@ void CPhysicalGeometry::MatchPeriodic(const CConfig *config, Buffer_Send_Vertex[nLocalVertex_Periodic] = iVertex; Buffer_Send_Marker[nLocalVertex_Periodic] = iMarker; for (iDim = 0; iDim < nDim; iDim++) - Buffer_Send_Coord[nLocalVertex_Periodic*nDim+iDim] = nodes->GetCoord(iPoint, iDim); + Buffer_Send_Coord[nLocalVertex_Periodic * nDim + iDim] = nodes->GetCoord(iPoint, iDim); nLocalVertex_Periodic++; } } @@ -7017,16 +6703,16 @@ void CPhysicalGeometry::MatchPeriodic(const CConfig *config, and we are only storing one periodic marker pair at a time, repeating the data for each pair on all ranks should be manageable. ---*/ - SU2_MPI::Allgather(Buffer_Send_Coord, nBuffer_Coord, MPI_DOUBLE, - Buffer_Recv_Coord, nBuffer_Coord, MPI_DOUBLE, SU2_MPI::GetComm()); - SU2_MPI::Allgather(Buffer_Send_Point, nBuffer_Point, MPI_UNSIGNED_LONG, - Buffer_Recv_Point, nBuffer_Point, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); - SU2_MPI::Allgather(Buffer_Send_GlobalIndex, nBuffer_GlobalIndex, MPI_UNSIGNED_LONG, - Buffer_Recv_GlobalIndex, nBuffer_GlobalIndex, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); - SU2_MPI::Allgather(Buffer_Send_Vertex, nBuffer_Vertex, MPI_UNSIGNED_LONG, - Buffer_Recv_Vertex, nBuffer_Vertex, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); - SU2_MPI::Allgather(Buffer_Send_Marker, nBuffer_Marker, MPI_UNSIGNED_LONG, - Buffer_Recv_Marker, nBuffer_Marker, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_Coord, nBuffer_Coord, MPI_DOUBLE, Buffer_Recv_Coord, nBuffer_Coord, MPI_DOUBLE, + SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_Point, nBuffer_Point, MPI_UNSIGNED_LONG, Buffer_Recv_Point, nBuffer_Point, + MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_GlobalIndex, nBuffer_GlobalIndex, MPI_UNSIGNED_LONG, Buffer_Recv_GlobalIndex, + nBuffer_GlobalIndex, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_Vertex, nBuffer_Vertex, MPI_UNSIGNED_LONG, Buffer_Recv_Vertex, nBuffer_Vertex, + MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_Marker, nBuffer_Marker, MPI_UNSIGNED_LONG, Buffer_Recv_Marker, nBuffer_Marker, + MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); /*--- Now that all ranks have the data for all periodic points for this pair of periodic markers, we match the individual points @@ -7035,17 +6721,14 @@ void CPhysicalGeometry::MatchPeriodic(const CConfig *config, maxdist_local = 0.0; for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { - iPeriodic = config->GetMarker_All_PerBound(iMarker); - if ((iPeriodic == val_periodic) || - (iPeriodic == val_periodic + nPeriodic/2)) { - + if ((iPeriodic == val_periodic) || (iPeriodic == val_periodic + nPeriodic / 2)) { /*--- Retrieve the supplied periodic information. ---*/ Marker_Tag = config->GetMarker_All_TagBound(iMarker); - center = config->GetPeriodicRotCenter(Marker_Tag); - angles = config->GetPeriodicRotAngles(Marker_Tag); - trans = config->GetPeriodicTranslation(Marker_Tag); + center = config->GetPeriodicRotCenter(Marker_Tag); + angles = config->GetPeriodicRotAngles(Marker_Tag); + trans = config->GetPeriodicTranslation(Marker_Tag); /*--- Store (center+trans) as it is constant and will be added. ---*/ @@ -7055,39 +6738,43 @@ void CPhysicalGeometry::MatchPeriodic(const CConfig *config, /*--- Store angles separately for clarity. Compute sines/cosines. ---*/ - Theta = angles[0]; Phi = angles[1]; Psi = angles[2]; - cosTheta = cos(Theta); cosPhi = cos(Phi); cosPsi = cos(Psi); - sinTheta = sin(Theta); sinPhi = sin(Phi); sinPsi = sin(Psi); + Theta = angles[0]; + Phi = angles[1]; + Psi = angles[2]; + cosTheta = cos(Theta); + cosPhi = cos(Phi); + cosPsi = cos(Psi); + sinTheta = sin(Theta); + sinPhi = sin(Phi); + sinPsi = sin(Psi); /*--- Compute the rotation matrix. Note that the implicit ordering is rotation about the x-axis, y-axis, then z-axis. ---*/ - rotMatrix[0][0] = cosPhi*cosPsi; - rotMatrix[1][0] = cosPhi*sinPsi; + rotMatrix[0][0] = cosPhi * cosPsi; + rotMatrix[1][0] = cosPhi * sinPsi; rotMatrix[2][0] = -sinPhi; - rotMatrix[0][1] = sinTheta*sinPhi*cosPsi - cosTheta*sinPsi; - rotMatrix[1][1] = sinTheta*sinPhi*sinPsi + cosTheta*cosPsi; - rotMatrix[2][1] = sinTheta*cosPhi; + rotMatrix[0][1] = sinTheta * sinPhi * cosPsi - cosTheta * sinPsi; + rotMatrix[1][1] = sinTheta * sinPhi * sinPsi + cosTheta * cosPsi; + rotMatrix[2][1] = sinTheta * cosPhi; - rotMatrix[0][2] = cosTheta*sinPhi*cosPsi + sinTheta*sinPsi; - rotMatrix[1][2] = cosTheta*sinPhi*sinPsi - sinTheta*cosPsi; - rotMatrix[2][2] = cosTheta*cosPhi; + rotMatrix[0][2] = cosTheta * sinPhi * cosPsi + sinTheta * sinPsi; + rotMatrix[1][2] = cosTheta * sinPhi * sinPsi - sinTheta * cosPsi; + rotMatrix[2][2] = cosTheta * cosPhi; /*--- Loop over each point on the periodic marker that this rank holds locally and find the matching point from the donor marker. ---*/ for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - /*--- Local and global index for the owned periodic point. ---*/ - iPoint = vertex[iMarker][iVertex]->GetNode(); + iPoint = vertex[iMarker][iVertex]->GetNode(); iPointGlobal = nodes->GetGlobalIndex(iPoint); /*--- If this is not a ghost, find the periodic match. ---*/ if (nodes->GetDomain(iPoint)) { - /*--- Coordinates of the current boundary point ---*/ Coord_i = nodes->GetCoord(iPoint); @@ -7096,22 +6783,18 @@ void CPhysicalGeometry::MatchPeriodic(const CConfig *config, dx = Coord_i[0] - center[0]; dy = Coord_i[1] - center[1]; - if (nDim == 3) dz = Coord_i[2] - center[2]; - else dz = 0.0; + if (nDim == 3) + dz = Coord_i[2] - center[2]; + else + dz = 0.0; /*--- Compute transformed point coordinates. ---*/ - rotCoord[0] = (rotMatrix[0][0]*dx + - rotMatrix[0][1]*dy + - rotMatrix[0][2]*dz + translation[0]); + rotCoord[0] = (rotMatrix[0][0] * dx + rotMatrix[0][1] * dy + rotMatrix[0][2] * dz + translation[0]); - rotCoord[1] = (rotMatrix[1][0]*dx + - rotMatrix[1][1]*dy + - rotMatrix[1][2]*dz + translation[1]); + rotCoord[1] = (rotMatrix[1][0] * dx + rotMatrix[1][1] * dy + rotMatrix[1][2] * dz + translation[1]); - rotCoord[2] = (rotMatrix[2][0]*dx + - rotMatrix[2][1]*dy + - rotMatrix[2][2]*dz + translation[2]); + rotCoord[2] = (rotMatrix[2][0] * dx + rotMatrix[2][1] * dy + rotMatrix[2][2] * dz + translation[2]); /*--- Check if the point lies on the axis of rotation. If it does, the rotated coordinate and the original coordinate are the same. ---*/ @@ -7119,7 +6802,7 @@ void CPhysicalGeometry::MatchPeriodic(const CConfig *config, pointOnAxis = false; distToAxis = 0.0; for (iDim = 0; iDim < nDim; iDim++) - distToAxis = (rotCoord[iDim] - Coord_i[iDim])*(rotCoord[iDim] - Coord_i[iDim]); + distToAxis = (rotCoord[iDim] - Coord_i[iDim]) * (rotCoord[iDim] - Coord_i[iDim]); distToAxis = sqrt(distToAxis); if (distToAxis < epsilon) pointOnAxis = true; @@ -7127,70 +6810,66 @@ void CPhysicalGeometry::MatchPeriodic(const CConfig *config, /*--- Our search is based on the minimum distance, so we initialize the distance to a large value. ---*/ - mindist = 1E6; pProcessor = 0; pPoint = 0; + mindist = 1E6; + pProcessor = 0; + pPoint = 0; /*--- Loop over all of the periodic data that was gathered from all ranks in order to find the matching periodic point. ---*/ for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) - for (jVertex = 0; jVertex < Buffer_Recv_nVertex[iProcessor]; jVertex++) { - - /*--- Store the loop index more easily. ---*/ + for (jVertex = 0; jVertex < Buffer_Recv_nVertex[iProcessor]; jVertex++) { + /*--- Store the loop index more easily. ---*/ - index = iProcessor*MaxLocalVertex_Periodic + jVertex; + index = iProcessor * MaxLocalVertex_Periodic + jVertex; - /*--- For each candidate, we have the local and global index, - along with the boundary vertex and marker index. ---*/ + /*--- For each candidate, we have the local and global index, + along with the boundary vertex and marker index. ---*/ - jPoint = Buffer_Recv_Point[index]; - jPointGlobal = Buffer_Recv_GlobalIndex[index]; - jVertex_ = Buffer_Recv_Vertex[index]; - jMarker = Buffer_Recv_Marker[index]; + jPoint = Buffer_Recv_Point[index]; + jPointGlobal = Buffer_Recv_GlobalIndex[index]; + jVertex_ = Buffer_Recv_Vertex[index]; + jMarker = Buffer_Recv_Marker[index]; - /*--- The gathered data will also include the current - "owned" periodic point that we are matching, so first make - sure that we avoid the original point by checking that the - global index values are not the same. ---*/ + /*--- The gathered data will also include the current + "owned" periodic point that we are matching, so first make + sure that we avoid the original point by checking that the + global index values are not the same. ---*/ - if ((jPointGlobal != iPointGlobal) || (pointOnAxis)) { - - /*--- Compute the distance between the candidate periodic - point and the transformed coordinates of the owned point. ---*/ - - dist = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - Coord_j[iDim] = Buffer_Recv_Coord[index*nDim + iDim]; - dist += pow(Coord_j[iDim]-rotCoord[iDim],2.0); - } - dist = sqrt(dist); - - /*--- Compare the distance against the existing minimum - and also perform checks just to be sure that this is an - independent periodic point (even if on the same rank), - unless it lies on the axis of rotation. ---*/ - - chkSamePoint = false; - chkSamePoint = (((dist < mindist) && (iProcessor != rank)) || - ((dist < mindist) && (iProcessor == rank) && - (jPoint != iPoint))); - - if (chkSamePoint || ((dist < mindist) && (pointOnAxis))) { - - /*--- We have found an intermediate match. Store the - data for this point before continuing the search. ---*/ - - mindist = dist; - pProcessor = iProcessor; - pPoint = jPoint; - pPointGlobal = jPointGlobal; - pVertex = jVertex_; - pMarker = jMarker; + if ((jPointGlobal != iPointGlobal) || (pointOnAxis)) { + /*--- Compute the distance between the candidate periodic + point and the transformed coordinates of the owned point. ---*/ + dist = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + Coord_j[iDim] = Buffer_Recv_Coord[index * nDim + iDim]; + dist += pow(Coord_j[iDim] - rotCoord[iDim], 2.0); + } + dist = sqrt(dist); + + /*--- Compare the distance against the existing minimum + and also perform checks just to be sure that this is an + independent periodic point (even if on the same rank), + unless it lies on the axis of rotation. ---*/ + + chkSamePoint = false; + chkSamePoint = (((dist < mindist) && (iProcessor != rank)) || + ((dist < mindist) && (iProcessor == rank) && (jPoint != iPoint))); + + if (chkSamePoint || ((dist < mindist) && (pointOnAxis))) { + /*--- We have found an intermediate match. Store the + data for this point before continuing the search. ---*/ + + mindist = dist; + pProcessor = iProcessor; + pPoint = jPoint; + pPointGlobal = jPointGlobal; + pVertex = jVertex_; + pMarker = jMarker; + } } } - } - /*--- Store the data for the best match found for the owned periodic point. ---*/ @@ -7209,7 +6888,6 @@ void CPhysicalGeometry::MatchPeriodic(const CConfig *config, maxdist_local = min(maxdist_local, 0.0); isBadMatch = true; } - } } } @@ -7221,19 +6899,17 @@ void CPhysicalGeometry::MatchPeriodic(const CConfig *config, pairs of points. ---*/ unsigned long nPointMatch_Local = nPointMatch; - SU2_MPI::Reduce(&nPointMatch_Local, &nPointMatch, 1, MPI_UNSIGNED_LONG, - MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Reduce(&maxdist_local, &maxdist_global, 1, MPI_DOUBLE, - MPI_MAX, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Reduce(&nPointMatch_Local, &nPointMatch, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Reduce(&maxdist_local, &maxdist_global, 1, MPI_DOUBLE, MPI_MAX, MASTER_NODE, SU2_MPI::GetComm()); /*--- Output some information about the matching process. ---*/ if (rank == MASTER_NODE) { if (nPointMatch > 0) { - cout <<" Matched " << nPointMatch << " points with a max distance of: "; - cout << maxdist_global <<"."<< endl; + cout << " Matched " << nPointMatch << " points with a max distance of: "; + cout << maxdist_global << "." << endl; } else { - cout <<" No matching points for periodic marker pair "; + cout << " No matching points for periodic marker pair "; cout << val_periodic << " in current zone." << endl; } @@ -7257,17 +6933,16 @@ void CPhysicalGeometry::MatchPeriodic(const CConfig *config, delete[] Buffer_Send_nVertex; delete[] Buffer_Recv_nVertex; - delete [] Buffer_Send_GlobalIndex; - delete [] Buffer_Send_Vertex; - delete [] Buffer_Send_Marker; + delete[] Buffer_Send_GlobalIndex; + delete[] Buffer_Send_Vertex; + delete[] Buffer_Send_Marker; - delete [] Buffer_Recv_GlobalIndex; - delete [] Buffer_Recv_Vertex; - delete [] Buffer_Recv_Marker; + delete[] Buffer_Recv_GlobalIndex; + delete[] Buffer_Recv_Vertex; + delete[] Buffer_Recv_Marker; } -void CPhysicalGeometry::FindUniqueNode_PeriodicBound(const CConfig *config) { - +void CPhysicalGeometry::FindUniqueNode_PeriodicBound(const CConfig* config) { /*-------------------------------------------------------------------------------------------*/ /*--- Find reference node on the 'inlet' streamwise periodic marker for the computation ---*/ /*--- of recovered pressure/temperature, such that this found node is independent of the ---*/ @@ -7284,9 +6959,9 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(const CConfig *config) { su2double min_norm = numeric_limits::max(); /*--- Communicate Coordinates plus the minimum distance, therefor the nDim+1 ---*/ - vector Buffer_Send_RefNode(nDim+1, numeric_limits::max()); - su2activematrix Buffer_Recv_RefNode(size,nDim+1); - unsigned long iPointMin = 0; // Initialisaton, otherwise 'may be uninitialized` warning' + vector Buffer_Send_RefNode(nDim + 1, numeric_limits::max()); + su2activematrix Buffer_Recv_RefNode(size, nDim + 1); + unsigned long iPointMin = 0; // Initialisaton, otherwise 'may be uninitialized` warning' /*-------------------------------------------------------------------------------------------*/ /*--- Step 1: Find a unique reference node on each rank and communicate them such that ---*/ @@ -7297,16 +6972,14 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(const CConfig *config) { for (unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if (config->GetMarker_All_KindBC(iMarker) == PERIODIC_BOUNDARY) { - /*--- 1 is the receiver/'inlet', 2 is the donor/'outlet', 0 if no PBC at all. ---*/ auto iPeriodic = config->GetMarker_All_PerBound(iMarker); if (iPeriodic == 1) { - for (auto iVertex = 0ul; iVertex < GetnVertex(iMarker); iVertex++) { - auto iPoint = vertex[iMarker][iVertex]->GetNode(); - /*--- Get the squared norm of the current point. sqrt is a monotonic function in [0,R+) so for comparison we dont need Norm. ---*/ + /*--- Get the squared norm of the current point. sqrt is a monotonic function in [0,R+) so for comparison we + * dont need Norm. ---*/ auto norm = GeometryToolbox::SquaredNorm(nDim, nodes->GetCoord(iPoint)); /*--- Check if new unique reference node is found and store Point ID. ---*/ @@ -7314,21 +6987,21 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(const CConfig *config) { min_norm = norm; iPointMin = iPoint; } - /*--- The theoretical case, that multiple inlet points with the same distance to the origin exists, remains. ---*/ + /*--- The theoretical case, that multiple inlet points with the same distance to the origin exists, remains. + * ---*/ } - break; // Actually no more than one streamwise periodic marker pair is allowed - } // receiver conditional - } // periodic conditional - } // marker loop + break; // Actually no more than one streamwise periodic marker pair is allowed + } // receiver conditional + } // periodic conditional + } // marker loop /*--- Copy the Coordinates and norm into send buffer. ---*/ - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Buffer_Send_RefNode[iDim] = nodes->GetCoord(iPointMin,iDim); + for (unsigned short iDim = 0; iDim < nDim; iDim++) Buffer_Send_RefNode[iDim] = nodes->GetCoord(iPointMin, iDim); Buffer_Send_RefNode[nDim] = min_norm; /*--- Communicate unique nodes to all processes. In case of serial mode nothing happens. ---*/ - SU2_MPI::Allgather(Buffer_Send_RefNode.data(), nDim+1, MPI_DOUBLE, - Buffer_Recv_RefNode.data(), nDim+1, MPI_DOUBLE, SU2_MPI::GetComm()); + SU2_MPI::Allgather(Buffer_Send_RefNode.data(), nDim + 1, MPI_DOUBLE, Buffer_Recv_RefNode.data(), nDim + 1, MPI_DOUBLE, + SU2_MPI::GetComm()); /*-------------------------------------------------------------------------------------------*/ /*--- Step 2: Amongst all local nodes with the smallest distance to the origin, find the ---*/ @@ -7339,176 +7012,164 @@ void CPhysicalGeometry::FindUniqueNode_PeriodicBound(const CConfig *config) { min_norm = numeric_limits::max(); for (int iRank = 0; iRank < size; iRank++) { - - auto norm = Buffer_Recv_RefNode(iRank,nDim); + auto norm = Buffer_Recv_RefNode(iRank, nDim); /*--- Check if new unique reference node is found. ---*/ if (norm < min_norm) { min_norm = norm; for (unsigned short iDim = 0; iDim < nDim; iDim++) - Streamwise_Periodic_RefNode[iDim] = Buffer_Recv_RefNode(iRank,iDim); + Streamwise_Periodic_RefNode[iDim] = Buffer_Recv_RefNode(iRank, iDim); } } /*--- Print the reference node to screen. ---*/ if (rank == MASTER_NODE) { cout << "Streamwise Periodic Reference Node: ["; - for (unsigned short iDim = 0; iDim < nDim; iDim++) - cout << " " << Streamwise_Periodic_RefNode[iDim]; + for (unsigned short iDim = 0; iDim < nDim; iDim++) cout << " " << Streamwise_Periodic_RefNode[iDim]; cout << " ]" << endl; } - } -void CPhysicalGeometry::SetControlVolume(CConfig *config, unsigned short action) { - +void CPhysicalGeometry::SetControlVolume(CConfig* config, unsigned short action) { /*--- Update values of faces of the edge ---*/ if (action != ALLOCATE) { su2double ZeroArea[MAXNDIM] = {0.0}; SU2_OMP_FOR_STAT(1024) - for (auto iEdge = 0ul; iEdge < nEdge; iEdge++) - edges->SetNormal(iEdge, ZeroArea); + for (auto iEdge = 0ul; iEdge < nEdge; iEdge++) edges->SetNormal(iEdge, ZeroArea); END_SU2_OMP_FOR SU2_OMP_FOR_STAT(1024) - for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) - nodes->SetVolume(iPoint, 0.0); + for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) nodes->SetVolume(iPoint, 0.0); END_SU2_OMP_FOR } BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS { /*--- The following is difficult to parallelize with threads. ---*/ - su2double my_DomainVolume = 0.0; - for (auto iElem = 0ul; iElem < nElem; iElem++) { + su2double my_DomainVolume = 0.0; + for (auto iElem = 0ul; iElem < nElem; iElem++) { + const auto nNodes = elem[iElem]->GetnNodes(); - const auto nNodes = elem[iElem]->GetnNodes(); + /*--- To make preaccumulation more effective, use as few inputs + as possible, recomputing intermediate quantities as needed. ---*/ + AD::StartPreacc(); - /*--- To make preaccumulation more effective, use as few inputs - as possible, recomputing intermediate quantities as needed. ---*/ - AD::StartPreacc(); - - /*--- Get pointers to the coordinates of all the element nodes ---*/ - array Coord; + /*--- Get pointers to the coordinates of all the element nodes ---*/ + array Coord; - for (unsigned short iNode = 0; iNode < nNodes; iNode++) { - auto iPoint = elem[iElem]->GetNode(iNode); - Coord[iNode] = nodes->GetCoord(iPoint); + for (unsigned short iNode = 0; iNode < nNodes; iNode++) { + auto iPoint = elem[iElem]->GetNode(iNode); + Coord[iNode] = nodes->GetCoord(iPoint); #ifdef CODI_REVERSE_TYPE - /*--- The same points and edges will be referenced multiple times as they are common - to many of the element's faces, therefore they are "registered" here only once. ---*/ - AD::SetPreaccIn(nodes->Volume(iPoint)); - for (unsigned short jNode = iNode+1; jNode < nNodes; jNode++) { - auto jPoint = elem[iElem]->GetNode(jNode); - auto iEdge = FindEdge(iPoint, jPoint, false); - if (iEdge >= 0) AD::SetPreaccIn(edges->Normal[iEdge], nDim); - } + /*--- The same points and edges will be referenced multiple times as they are common + to many of the element's faces, therefore they are "registered" here only once. ---*/ + AD::SetPreaccIn(nodes->Volume(iPoint)); + for (unsigned short jNode = iNode + 1; jNode < nNodes; jNode++) { + auto jPoint = elem[iElem]->GetNode(jNode); + auto iEdge = FindEdge(iPoint, jPoint, false); + if (iEdge >= 0) AD::SetPreaccIn(edges->Normal[iEdge], nDim); + } #endif - } - AD::SetPreaccIn(Coord, nNodes, nDim); + } + AD::SetPreaccIn(Coord, nNodes, nDim); - /*--- Compute the element median CG coordinates ---*/ - auto Coord_Elem_CG = elem[iElem]->SetCoord_CG(nDim, Coord); - AD::SetPreaccOut(Coord_Elem_CG, nDim); + /*--- Compute the element median CG coordinates ---*/ + auto Coord_Elem_CG = elem[iElem]->SetCoord_CG(nDim, Coord); + AD::SetPreaccOut(Coord_Elem_CG, nDim); - for (unsigned short iFace = 0; iFace < elem[iElem]->GetnFaces(); iFace++) { + for (unsigned short iFace = 0; iFace < elem[iElem]->GetnFaces(); iFace++) { + /*--- In 2D all the faces have only one edge ---*/ + unsigned short nEdgesFace = 1; - /*--- In 2D all the faces have only one edge ---*/ - unsigned short nEdgesFace = 1; + /*--- In 3D the number of edges per face is the same as the number of point + per face and the median CG of the face is needed. ---*/ + su2double Coord_FaceElem_CG[MAXNDIM] = {0.0}; + if (nDim == 3) { + nEdgesFace = elem[iElem]->GetnNodesFace(iFace); - /*--- In 3D the number of edges per face is the same as the number of point - per face and the median CG of the face is needed. ---*/ - su2double Coord_FaceElem_CG[MAXNDIM] = {0.0}; - if (nDim == 3) { - nEdgesFace = elem[iElem]->GetnNodesFace(iFace); - - for (unsigned short iNode = 0; iNode < nEdgesFace; iNode++) { - auto NodeFace = elem[iElem]->GetFaces(iFace, iNode); - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Coord_FaceElem_CG[iDim] += Coord[NodeFace][iDim]/nEdgesFace; + for (unsigned short iNode = 0; iNode < nEdgesFace; iNode++) { + auto NodeFace = elem[iElem]->GetFaces(iFace, iNode); + for (unsigned short iDim = 0; iDim < nDim; iDim++) + Coord_FaceElem_CG[iDim] += Coord[NodeFace][iDim] / nEdgesFace; + } } - } - /*-- Loop over the edges of a face ---*/ - for (unsigned short iEdgesFace = 0; iEdgesFace < nEdgesFace; iEdgesFace++) { + /*-- Loop over the edges of a face ---*/ + for (unsigned short iEdgesFace = 0; iEdgesFace < nEdgesFace; iEdgesFace++) { + const auto face_iNode = elem[iElem]->GetFaces(iFace, iEdgesFace); + unsigned short face_jNode; - const auto face_iNode = elem[iElem]->GetFaces(iFace,iEdgesFace); - unsigned short face_jNode; - - if (nDim == 2) { - /*--- In 2D only one edge (two points) per edge ---*/ - face_jNode = elem[iElem]->GetFaces(iFace,1); - } - else { - /*--- In 3D we "circle around" the face ---*/ - face_jNode = elem[iElem]->GetFaces(iFace, (iEdgesFace+1)%nEdgesFace); - } + if (nDim == 2) { + /*--- In 2D only one edge (two points) per edge ---*/ + face_jNode = elem[iElem]->GetFaces(iFace, 1); + } else { + /*--- In 3D we "circle around" the face ---*/ + face_jNode = elem[iElem]->GetFaces(iFace, (iEdgesFace + 1) % nEdgesFace); + } - const auto face_iPoint = elem[iElem]->GetNode(face_iNode); - const auto face_jPoint = elem[iElem]->GetNode(face_jNode); + const auto face_iPoint = elem[iElem]->GetNode(face_iNode); + const auto face_jPoint = elem[iElem]->GetNode(face_jNode); - /*--- We define a direction (from the smalest index to the greatest) --*/ - const bool change_face_orientation = (face_iPoint > face_jPoint); - const auto iEdge = FindEdge(face_iPoint, face_jPoint); + /*--- We define a direction (from the smalest index to the greatest) --*/ + const bool change_face_orientation = (face_iPoint > face_jPoint); + const auto iEdge = FindEdge(face_iPoint, face_jPoint); - su2double Coord_Edge_CG[MAXNDIM] = {0.0}; - for (unsigned short iDim = 0; iDim < nDim; iDim++) { - Coord_Edge_CG[iDim] = 0.5 * (Coord[face_iNode][iDim] + Coord[face_jNode][iDim]); - } + su2double Coord_Edge_CG[MAXNDIM] = {0.0}; + for (unsigned short iDim = 0; iDim < nDim; iDim++) { + Coord_Edge_CG[iDim] = 0.5 * (Coord[face_iNode][iDim] + Coord[face_jNode][iDim]); + } - su2double Volume_i, Volume_j; + su2double Volume_i, Volume_j; - if (nDim == 2) { - /*--- Two dimensional problem ---*/ - if (change_face_orientation) - edges->SetNodes_Coord(iEdge, Coord_Elem_CG, Coord_Edge_CG); - else - edges->SetNodes_Coord(iEdge, Coord_Edge_CG, Coord_Elem_CG); + if (nDim == 2) { + /*--- Two dimensional problem ---*/ + if (change_face_orientation) + edges->SetNodes_Coord(iEdge, Coord_Elem_CG, Coord_Edge_CG); + else + edges->SetNodes_Coord(iEdge, Coord_Edge_CG, Coord_Elem_CG); + + Volume_i = CEdge::GetVolume(Coord[face_iNode], Coord_Edge_CG, Coord_Elem_CG); + Volume_j = CEdge::GetVolume(Coord[face_jNode], Coord_Edge_CG, Coord_Elem_CG); + } else { + /*--- Three dimensional problem ---*/ + if (change_face_orientation) + edges->SetNodes_Coord(iEdge, Coord_FaceElem_CG, Coord_Edge_CG, Coord_Elem_CG); + else + edges->SetNodes_Coord(iEdge, Coord_Edge_CG, Coord_FaceElem_CG, Coord_Elem_CG); + + Volume_i = CEdge::GetVolume(Coord[face_iNode], Coord_Edge_CG, Coord_FaceElem_CG, Coord_Elem_CG); + Volume_j = CEdge::GetVolume(Coord[face_jNode], Coord_Edge_CG, Coord_FaceElem_CG, Coord_Elem_CG); + } - Volume_i = CEdge::GetVolume(Coord[face_iNode], Coord_Edge_CG, Coord_Elem_CG); - Volume_j = CEdge::GetVolume(Coord[face_jNode], Coord_Edge_CG, Coord_Elem_CG); - } - else { - /*--- Three dimensional problem ---*/ - if (change_face_orientation) - edges->SetNodes_Coord(iEdge, Coord_FaceElem_CG, Coord_Edge_CG, Coord_Elem_CG); - else - edges->SetNodes_Coord(iEdge, Coord_Edge_CG, Coord_FaceElem_CG, Coord_Elem_CG); + nodes->AddVolume(face_iPoint, Volume_i); + nodes->AddVolume(face_jPoint, Volume_j); - Volume_i = CEdge::GetVolume(Coord[face_iNode], Coord_Edge_CG, Coord_FaceElem_CG, Coord_Elem_CG); - Volume_j = CEdge::GetVolume(Coord[face_jNode], Coord_Edge_CG, Coord_FaceElem_CG, Coord_Elem_CG); + my_DomainVolume += Volume_i + Volume_j; } - - nodes->AddVolume(face_iPoint, Volume_i); - nodes->AddVolume(face_jPoint, Volume_j); - - my_DomainVolume += Volume_i+Volume_j; } - } #ifdef CODI_REVERSE_TYPE - for (unsigned short iNode = 0; iNode < nNodes; iNode++) { - auto iPoint = elem[iElem]->GetNode(iNode); - AD::SetPreaccOut(nodes->Volume(iPoint)); - for (unsigned short jNode = iNode+1; jNode < nNodes; jNode++) { - auto jPoint = elem[iElem]->GetNode(jNode); - auto iEdge = FindEdge(iPoint, jPoint, false); - if (iEdge >= 0) AD::SetPreaccOut(edges->Normal[iEdge], nDim); + for (unsigned short iNode = 0; iNode < nNodes; iNode++) { + auto iPoint = elem[iElem]->GetNode(iNode); + AD::SetPreaccOut(nodes->Volume(iPoint)); + for (unsigned short jNode = iNode + 1; jNode < nNodes; jNode++) { + auto jPoint = elem[iElem]->GetNode(jNode); + auto iEdge = FindEdge(iPoint, jPoint, false); + if (iEdge >= 0) AD::SetPreaccOut(edges->Normal[iEdge], nDim); + } } - } #endif - AD::EndPreacc(); - } + AD::EndPreacc(); + } - su2double DomainVolume; - SU2_MPI::Allreduce(&my_DomainVolume, &DomainVolume, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - config->SetDomainVolume(DomainVolume); - - if ((rank == MASTER_NODE) && (action == ALLOCATE)) { - if (nDim == 2) cout <<"Area of the computational grid: "<< DomainVolume <<"."<< endl; - if (nDim == 3) cout <<"Volume of the computational grid: "<< DomainVolume <<"."<< endl; - } + su2double DomainVolume; + SU2_MPI::Allreduce(&my_DomainVolume, &DomainVolume, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + config->SetDomainVolume(DomainVolume); + if ((rank == MASTER_NODE) && (action == ALLOCATE)) { + if (nDim == 2) cout << "Area of the computational grid: " << DomainVolume << "." << endl; + if (nDim == 3) cout << "Volume of the computational grid: " << DomainVolume << "." << endl; + } } END_SU2_OMP_SAFE_GLOBAL_ACCESS @@ -7516,21 +7177,19 @@ void CPhysicalGeometry::SetControlVolume(CConfig *config, unsigned short action) SU2_OMP_FOR_STAT(1024) for (auto iEdge = 0ul; iEdge < nEdge; iEdge++) { const auto Area2 = GeometryToolbox::SquaredNorm(nDim, edges->GetNormal(iEdge)); - su2double DefaultArea[MAXNDIM] = {EPS*EPS}; + su2double DefaultArea[MAXNDIM] = {EPS * EPS}; if (Area2 == 0.0) edges->SetNormal(iEdge, DefaultArea); } END_SU2_OMP_FOR } -void CPhysicalGeometry::SetBoundControlVolume(const CConfig *config, unsigned short action) { - +void CPhysicalGeometry::SetBoundControlVolume(const CConfig* config, unsigned short action) { /*--- Clear normals ---*/ if (action != ALLOCATE) { SU2_OMP_FOR_DYN(1) for (unsigned short iMarker = 0; iMarker < nMarker; iMarker++) - for (unsigned long iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) - vertex[iMarker][iVertex]->SetZeroValues(); + for (unsigned long iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) vertex[iMarker][iVertex]->SetZeroValues(); END_SU2_OMP_FOR } @@ -7539,7 +7198,6 @@ void CPhysicalGeometry::SetBoundControlVolume(const CConfig *config, unsigned sh SU2_OMP_FOR_DYN(1) for (unsigned short iMarker = 0; iMarker < nMarker; iMarker++) { for (unsigned long iElem = 0; iElem < nElem_Bound[iMarker]; iElem++) { - const auto nNodes = bound[iMarker][iElem]->GetnNodes(); /*--- Cannot preaccumulate if hybrid parallel due to shared reading. ---*/ @@ -7574,8 +7232,7 @@ void CPhysicalGeometry::SetBoundControlVolume(const CConfig *config, unsigned sh /*--- Store the 2D face ---*/ if (iNode == 0) vertex[iMarker][iVertex]->SetNodes_Coord(Coord_Elem_CG, Coord_Vertex); if (iNode == 1) vertex[iMarker][iVertex]->SetNodes_Coord(Coord_Vertex, Coord_Elem_CG); - } - else { + } else { const auto Neighbor_Node = bound[iMarker][iElem]->GetNeighbor_Nodes(iNode, iNeighbor); auto Neighbor_Coord = Coord[Neighbor_Node]; @@ -7603,18 +7260,17 @@ void CPhysicalGeometry::SetBoundControlVolume(const CConfig *config, unsigned sh /*--- Check if there is a normal with null area ---*/ SU2_OMP_FOR_DYN(1) - for (unsigned short iMarker = 0; iMarker < nMarker; iMarker ++) { + for (unsigned short iMarker = 0; iMarker < nMarker; iMarker++) { for (unsigned long iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { auto Area2 = GeometryToolbox::SquaredNorm(nDim, vertex[iMarker][iVertex]->GetNormal()); - su2double DefaultArea[MAXNDIM] = {EPS*EPS}; + su2double DefaultArea[MAXNDIM] = {EPS * EPS}; if (Area2 == 0.0) vertex[iMarker][iVertex]->SetNormal(DefaultArea); } } END_SU2_OMP_FOR } -void CPhysicalGeometry::VisualizeControlVolume(const CConfig *config) const { - +void CPhysicalGeometry::VisualizeControlVolume(const CConfig* config) const { /*--- Access the point number for control volume we want to vizualize ---*/ auto iPoint = GetGlobal_to_Local_Point(config->GetVisualize_CV()); @@ -7627,7 +7283,6 @@ void CPhysicalGeometry::VisualizeControlVolume(const CConfig *config) const { /*--- Loop over each face of each element ---*/ for (auto iElem = 0ul; iElem < nElem; iElem++) { - /*--- Get pointers to the coordinates of all the element nodes ---*/ array Coord; @@ -7637,7 +7292,6 @@ void CPhysicalGeometry::VisualizeControlVolume(const CConfig *config) const { } for (unsigned short iFace = 0; iFace < elem[iElem]->GetnFaces(); iFace++) { - /*--- In 2D all the faces have only one edge ---*/ unsigned short nEdgesFace = 1; @@ -7650,30 +7304,27 @@ void CPhysicalGeometry::VisualizeControlVolume(const CConfig *config) const { for (unsigned short iNode = 0; iNode < nEdgesFace; iNode++) { auto NodeFace = elem[iElem]->GetFaces(iFace, iNode); for (unsigned short iDim = 0; iDim < nDim; iDim++) - Coord_FaceElem_CG[iDim] += Coord[NodeFace][iDim]/nEdgesFace; + Coord_FaceElem_CG[iDim] += Coord[NodeFace][iDim] / nEdgesFace; } } /*-- Loop over the edges of a face ---*/ for (unsigned short iEdgesFace = 0; iEdgesFace < nEdgesFace; iEdgesFace++) { - - const auto face_iPoint = elem[iElem]->GetNode(elem[iElem]->GetFaces(iFace,iEdgesFace)); + const auto face_iPoint = elem[iElem]->GetNode(elem[iElem]->GetFaces(iFace, iEdgesFace)); unsigned long face_jPoint; if (nDim == 2) { /*--- In 2D only one edge (two points) per edge ---*/ - face_jPoint = elem[iElem]->GetNode(elem[iElem]->GetFaces(iFace,1)); - } - else { + face_jPoint = elem[iElem]->GetNode(elem[iElem]->GetFaces(iFace, 1)); + } else { /*--- In 3D we "circle around" the face ---*/ - face_jPoint = elem[iElem]->GetNode(elem[iElem]->GetFaces(iFace, (iEdgesFace+1)%nEdgesFace)); + face_jPoint = elem[iElem]->GetNode(elem[iElem]->GetFaces(iFace, (iEdgesFace + 1) % nEdgesFace)); } /*--- Print out the coordinates for a set of triangles making up a single dual control volume for visualization. ---*/ if (face_iPoint == iPoint_Viz || face_jPoint == iPoint_Viz) { - const su2double* Coord_FaceiPoint = nodes->GetCoord(face_iPoint); const su2double* Coord_FacejPoint = nodes->GetCoord(face_jPoint); const su2double* Coord_Elem_CG = elem[iElem]->GetCG(); @@ -7684,12 +7335,20 @@ void CPhysicalGeometry::VisualizeControlVolume(const CConfig *config) const { } if (nDim == 2) { - X.push_back(Coord_Elem_CG[0]); X.push_back(Coord_Edge_CG[0]); - Y.push_back(Coord_Elem_CG[1]); Y.push_back(Coord_Edge_CG[1]); + X.push_back(Coord_Elem_CG[0]); + X.push_back(Coord_Edge_CG[0]); + Y.push_back(Coord_Elem_CG[1]); + Y.push_back(Coord_Edge_CG[1]); } else { - X.push_back(Coord_FaceElem_CG[0]); X.push_back(Coord_Edge_CG[0]); X.push_back(Coord_Elem_CG[0]); - Y.push_back(Coord_FaceElem_CG[1]); Y.push_back(Coord_Edge_CG[1]); Y.push_back(Coord_Elem_CG[1]); - Z.push_back(Coord_FaceElem_CG[2]); Z.push_back(Coord_Edge_CG[2]); Z.push_back(Coord_Elem_CG[2]); + X.push_back(Coord_FaceElem_CG[0]); + X.push_back(Coord_Edge_CG[0]); + X.push_back(Coord_Elem_CG[0]); + Y.push_back(Coord_FaceElem_CG[1]); + Y.push_back(Coord_Edge_CG[1]); + Y.push_back(Coord_Elem_CG[1]); + Z.push_back(Coord_FaceElem_CG[2]); + Z.push_back(Coord_Edge_CG[2]); + Z.push_back(Coord_Elem_CG[2]); } counter++; } @@ -7706,13 +7365,13 @@ void CPhysicalGeometry::VisualizeControlVolume(const CConfig *config) const { Tecplot_File << "TITLE= \"Visualization of the control volume\"" << endl; if (nDim == 2) { - Tecplot_File << "VARIABLES = \"x\",\"y\" " << endl; - Tecplot_File << "ZONE NODES= "<< counter*2 <<", ELEMENTS= "; - Tecplot_File << counter <<", DATAPACKING=POINT, ZONETYPE=FEQUADRILATERAL"<< endl; + Tecplot_File << R"(VARIABLES = "x","y" )" << endl; + Tecplot_File << "ZONE NODES= " << counter * 2 << ", ELEMENTS= "; + Tecplot_File << counter << ", DATAPACKING=POINT, ZONETYPE=FEQUADRILATERAL" << endl; } else { - Tecplot_File << "VARIABLES = \"x\",\"y\",\"z\" " << endl; - Tecplot_File << "ZONE NODES= "<< counter*3 <<", ELEMENTS= "; - Tecplot_File << counter <<", DATAPACKING=POINT, ZONETYPE=FEBRICK"<< endl; + Tecplot_File << R"(VARIABLES = "x","y","z" )" << endl; + Tecplot_File << "ZONE NODES= " << counter * 3 << ", ELEMENTS= "; + Tecplot_File << counter << ", DATAPACKING=POINT, ZONETYPE=FEBRICK" << endl; } /*--- Write coordinates for the nodes in the order that they were found @@ -7728,44 +7387,42 @@ void CPhysicalGeometry::VisualizeControlVolume(const CConfig *config) const { for (int i = 0, j; i < counter; i++) { if (nDim == 2) { - j = i*2; - Tecplot_File << j+1 <<"\t"<SetCoord_Old(); /*--- Jacobi iterations ---*/ for (iSmooth = 0; iSmooth < val_nSmooth; iSmooth++) { - nodes->SetCoord_SumZero(); /*--- Loop over Interior edges ---*/ for (iEdge = 0; iEdge < nEdge; iEdge++) { - iPoint = edges->GetNode(iEdge,0); + iPoint = edges->GetNode(iEdge, 0); Coord_i = nodes->GetCoord(iPoint); - jPoint = edges->GetNode(iEdge,1); + jPoint = edges->GetNode(iEdge, 1); Coord_j = nodes->GetCoord(jPoint); /*--- Accumulate nearest neighbor Coord to Res_sum for each variable ---*/ nodes->AddCoord_Sum(iPoint, Coord_j); nodes->AddCoord_Sum(jPoint, Coord_i); - } /*--- Loop over all mesh points (Update Coords with averaged sum) ---*/ @@ -7775,17 +7432,17 @@ void CPhysicalGeometry::SetCoord_Smoothing (unsigned short val_nSmooth, su2doubl Coord_Old = nodes->GetCoord_Old(iPoint); if (nDim == 2) { - Coord[0] =(Coord_Old[0] + val_smooth_coeff*Coord_Sum[0]) /(1.0 + val_smooth_coeff*su2double(nneigh)); - Coord[1] =(Coord_Old[1] + val_smooth_coeff*Coord_Sum[1]) /(1.0 + val_smooth_coeff*su2double(nneigh)); - if ((NearField) && ((Coord_Old[1] > Position_Plane-eps) && (Coord_Old[1] < Position_Plane+eps))) + Coord[0] = (Coord_Old[0] + val_smooth_coeff * Coord_Sum[0]) / (1.0 + val_smooth_coeff * su2double(nneigh)); + Coord[1] = (Coord_Old[1] + val_smooth_coeff * Coord_Sum[1]) / (1.0 + val_smooth_coeff * su2double(nneigh)); + if ((NearField) && ((Coord_Old[1] > Position_Plane - eps) && (Coord_Old[1] < Position_Plane + eps))) Coord[1] = Coord_Old[1]; } if (nDim == 3) { - Coord[0] =(Coord_Old[0] + val_smooth_coeff*Coord_Sum[0]) /(1.0 + val_smooth_coeff*su2double(nneigh)); - Coord[1] =(Coord_Old[1] + val_smooth_coeff*Coord_Sum[1]) /(1.0 + val_smooth_coeff*su2double(nneigh)); - Coord[2] =(Coord_Old[2] + val_smooth_coeff*Coord_Sum[2]) /(1.0 + val_smooth_coeff*su2double(nneigh)); - if ((NearField) && ((Coord_Old[2] > Position_Plane-eps) && (Coord_Old[2] < Position_Plane+eps))) + Coord[0] = (Coord_Old[0] + val_smooth_coeff * Coord_Sum[0]) / (1.0 + val_smooth_coeff * su2double(nneigh)); + Coord[1] = (Coord_Old[1] + val_smooth_coeff * Coord_Sum[1]) / (1.0 + val_smooth_coeff * su2double(nneigh)); + Coord[2] = (Coord_Old[2] + val_smooth_coeff * Coord_Sum[2]) / (1.0 + val_smooth_coeff * su2double(nneigh)); + if ((NearField) && ((Coord_Old[2] > Position_Plane - eps) && (Coord_Old[2] < Position_Plane + eps))) Coord[2] = Coord_Old[2]; } @@ -7804,9 +7461,8 @@ void CPhysicalGeometry::SetCoord_Smoothing (unsigned short val_nSmooth, su2doubl delete[] Coord; } -bool CPhysicalGeometry::FindFace(unsigned long first_elem, unsigned long second_elem, unsigned short &face_first_elem, - unsigned short &face_second_elem) { - +bool CPhysicalGeometry::FindFace(unsigned long first_elem, unsigned long second_elem, unsigned short& face_first_elem, + unsigned short& face_second_elem) { if (first_elem == second_elem) return false; /*--- Find repeated nodes between two elements to identify the common face. ---*/ @@ -7827,7 +7483,7 @@ bool CPhysicalGeometry::FindFace(unsigned long first_elem, unsigned long second_ } /*--- Sort point in face and check that the list is unique ---*/ - sort(CommonPoints, CommonPoints+numCommonPoints); + sort(CommonPoints, CommonPoints + numCommonPoints); /*--- In 2D, the two elements must share two points that make up an edge, as all "faces" are edges in 2D. In 3D, we need to find @@ -7838,9 +7494,8 @@ bool CPhysicalGeometry::FindFace(unsigned long first_elem, unsigned long second_ /*--- Find the faces with the CommonPoint sequence in the first and second elements ---*/ for (auto iElem = 0ul; iElem < 2; ++iElem) { - - const auto idxElem = (iElem==0)? first_elem : second_elem; - auto& idxFaceOut = (iElem==0)? face_first_elem : face_second_elem; + const auto idxElem = (iElem == 0) ? first_elem : second_elem; + auto& idxFaceOut = (iElem == 0) ? face_first_elem : face_second_elem; bool faceFound = false; for (auto iFace = 0u; iFace < elem[idxElem]->GetnFaces(); iFace++) { @@ -7856,7 +7511,7 @@ bool CPhysicalGeometry::FindFace(unsigned long first_elem, unsigned long second_ } /*--- Sort face_poin to perform comparison ---*/ - const auto PointsFaceEnd = PointsFace+nNodesFace; + const auto PointsFaceEnd = PointsFace + nNodesFace; sort(PointsFace, PointsFaceEnd); /*--- List comparison ---*/ @@ -7876,7 +7531,6 @@ bool CPhysicalGeometry::FindFace(unsigned long first_elem, unsigned long second_ } void CPhysicalGeometry::SetTecPlot(char mesh_filename[MAX_STRING_SIZE], bool new_file) { - unsigned long iElem, iPoint; unsigned short iDim; ofstream Tecplot_File; @@ -7886,23 +7540,24 @@ void CPhysicalGeometry::SetTecPlot(char mesh_filename[MAX_STRING_SIZE], bool new if (new_file) { Tecplot_File.open(mesh_filename, ios::out); Tecplot_File << "TITLE= \"Visualization of the volumetric grid\"" << endl; - if (nDim == 2) Tecplot_File << "VARIABLES = \"x\",\"y\" " << endl; - if (nDim == 3) Tecplot_File << "VARIABLES = \"x\",\"y\",\"z\" " << endl; - } - else Tecplot_File.open(mesh_filename, ios::out | ios::app); + if (nDim == 2) Tecplot_File << R"(VARIABLES = "x","y" )" << endl; + if (nDim == 3) Tecplot_File << R"(VARIABLES = "x","y","z" )" << endl; + } else + Tecplot_File.open(mesh_filename, ios::out | ios::app); Tecplot_File << "ZONE T= "; - if (new_file) Tecplot_File << "\"Original grid\", C=BLACK, "; - else Tecplot_File << "\"Deformed grid\", C=RED, "; - Tecplot_File << "NODES= "<< nPoint <<", ELEMENTS= "<< nElem <<", DATAPACKING= POINT"; - if (nDim == 2) Tecplot_File << ", ZONETYPE= FEQUADRILATERAL"<< endl; - if (nDim == 3) Tecplot_File << ", ZONETYPE= FEBRICK"<< endl; + if (new_file) + Tecplot_File << "\"Original grid\", C=BLACK, "; + else + Tecplot_File << "\"Deformed grid\", C=RED, "; + Tecplot_File << "NODES= " << nPoint << ", ELEMENTS= " << nElem << ", DATAPACKING= POINT"; + if (nDim == 2) Tecplot_File << ", ZONETYPE= FEQUADRILATERAL" << endl; + if (nDim == 3) Tecplot_File << ", ZONETYPE= FEBRICK" << endl; /*--- Adding coordinates ---*/ for (iPoint = 0; iPoint < nPoint; iPoint++) { - for (iDim = 0; iDim < nDim; iDim++) - Tecplot_File << scientific << nodes->GetCoord(iPoint, iDim) << "\t"; + for (iDim = 0; iDim < nDim; iDim++) Tecplot_File << scientific << nodes->GetCoord(iPoint, iDim) << "\t"; Tecplot_File << "\n"; } @@ -7910,50 +7565,43 @@ void CPhysicalGeometry::SetTecPlot(char mesh_filename[MAX_STRING_SIZE], bool new for (iElem = 0; iElem < nElem; iElem++) { if (elem[iElem]->GetVTK_Type() == TRIANGLE) { - Tecplot_File << - elem[iElem]->GetNode(0)+1 <<" "<< elem[iElem]->GetNode(1)+1 <<" "<< - elem[iElem]->GetNode(2)+1 <<" "<< elem[iElem]->GetNode(2)+1 << endl; + Tecplot_File << elem[iElem]->GetNode(0) + 1 << " " << elem[iElem]->GetNode(1) + 1 << " " + << elem[iElem]->GetNode(2) + 1 << " " << elem[iElem]->GetNode(2) + 1 << endl; } if (elem[iElem]->GetVTK_Type() == QUADRILATERAL) { - Tecplot_File << - elem[iElem]->GetNode(0)+1 <<" "<< elem[iElem]->GetNode(1)+1 <<" "<< - elem[iElem]->GetNode(2)+1 <<" "<< elem[iElem]->GetNode(3)+1 << endl; + Tecplot_File << elem[iElem]->GetNode(0) + 1 << " " << elem[iElem]->GetNode(1) + 1 << " " + << elem[iElem]->GetNode(2) + 1 << " " << elem[iElem]->GetNode(3) + 1 << endl; } if (elem[iElem]->GetVTK_Type() == TETRAHEDRON) { - Tecplot_File << - elem[iElem]->GetNode(0)+1 <<" "<< elem[iElem]->GetNode(1)+1 <<" "<< - elem[iElem]->GetNode(2)+1 <<" "<< elem[iElem]->GetNode(2)+1 <<" "<< - elem[iElem]->GetNode(3)+1 <<" "<< elem[iElem]->GetNode(3)+1 <<" "<< - elem[iElem]->GetNode(3)+1 <<" "<< elem[iElem]->GetNode(3)+1 << endl; + Tecplot_File << elem[iElem]->GetNode(0) + 1 << " " << elem[iElem]->GetNode(1) + 1 << " " + << elem[iElem]->GetNode(2) + 1 << " " << elem[iElem]->GetNode(2) + 1 << " " + << elem[iElem]->GetNode(3) + 1 << " " << elem[iElem]->GetNode(3) + 1 << " " + << elem[iElem]->GetNode(3) + 1 << " " << elem[iElem]->GetNode(3) + 1 << endl; } if (elem[iElem]->GetVTK_Type() == HEXAHEDRON) { - Tecplot_File << - elem[iElem]->GetNode(0)+1 <<" "<< elem[iElem]->GetNode(1)+1 <<" "<< - elem[iElem]->GetNode(2)+1 <<" "<< elem[iElem]->GetNode(3)+1 <<" "<< - elem[iElem]->GetNode(4)+1 <<" "<< elem[iElem]->GetNode(5)+1 <<" "<< - elem[iElem]->GetNode(6)+1 <<" "<< elem[iElem]->GetNode(7)+1 << endl; + Tecplot_File << elem[iElem]->GetNode(0) + 1 << " " << elem[iElem]->GetNode(1) + 1 << " " + << elem[iElem]->GetNode(2) + 1 << " " << elem[iElem]->GetNode(3) + 1 << " " + << elem[iElem]->GetNode(4) + 1 << " " << elem[iElem]->GetNode(5) + 1 << " " + << elem[iElem]->GetNode(6) + 1 << " " << elem[iElem]->GetNode(7) + 1 << endl; } if (elem[iElem]->GetVTK_Type() == PYRAMID) { - Tecplot_File << - elem[iElem]->GetNode(0)+1 <<" "<< elem[iElem]->GetNode(1)+1 <<" "<< - elem[iElem]->GetNode(2)+1 <<" "<< elem[iElem]->GetNode(3)+1 <<" "<< - elem[iElem]->GetNode(4)+1 <<" "<< elem[iElem]->GetNode(4)+1 <<" "<< - elem[iElem]->GetNode(4)+1 <<" "<< elem[iElem]->GetNode(4)+1 << endl; + Tecplot_File << elem[iElem]->GetNode(0) + 1 << " " << elem[iElem]->GetNode(1) + 1 << " " + << elem[iElem]->GetNode(2) + 1 << " " << elem[iElem]->GetNode(3) + 1 << " " + << elem[iElem]->GetNode(4) + 1 << " " << elem[iElem]->GetNode(4) + 1 << " " + << elem[iElem]->GetNode(4) + 1 << " " << elem[iElem]->GetNode(4) + 1 << endl; } if (elem[iElem]->GetVTK_Type() == PRISM) { - Tecplot_File << - elem[iElem]->GetNode(0)+1 <<" "<< elem[iElem]->GetNode(1)+1 <<" "<< - elem[iElem]->GetNode(1)+1 <<" "<< elem[iElem]->GetNode(2)+1 <<" "<< - elem[iElem]->GetNode(3)+1 <<" "<< elem[iElem]->GetNode(4)+1 <<" "<< - elem[iElem]->GetNode(4)+1 <<" "<< elem[iElem]->GetNode(5)+1 << endl; + Tecplot_File << elem[iElem]->GetNode(0) + 1 << " " << elem[iElem]->GetNode(1) + 1 << " " + << elem[iElem]->GetNode(1) + 1 << " " << elem[iElem]->GetNode(2) + 1 << " " + << elem[iElem]->GetNode(3) + 1 << " " << elem[iElem]->GetNode(4) + 1 << " " + << elem[iElem]->GetNode(4) + 1 << " " << elem[iElem]->GetNode(5) + 1 << endl; } } Tecplot_File.close(); } -void CPhysicalGeometry::SetBoundTecPlot(char mesh_filename[MAX_STRING_SIZE], bool new_file, CConfig *config) { - +void CPhysicalGeometry::SetBoundTecPlot(char mesh_filename[MAX_STRING_SIZE], bool new_file, CConfig* config) { ofstream Tecplot_File; unsigned long iPoint, Total_nElem_Bound, iElem, *PointSurface = nullptr, nPointSurface = 0; unsigned short Coord_i, iMarker; @@ -7982,37 +7630,35 @@ void CPhysicalGeometry::SetBoundTecPlot(char mesh_filename[MAX_STRING_SIZE], boo if (new_file) { Tecplot_File.open(mesh_filename, ios::out); Tecplot_File << "TITLE= \"Visualization of the surface grid\"" << endl; - if (nDim == 2) Tecplot_File << "VARIABLES = \"x\",\"y\" " << endl; - if (nDim == 3) Tecplot_File << "VARIABLES = \"x\",\"y\",\"z\" " << endl; - } - else Tecplot_File.open(mesh_filename, ios::out | ios::app); + if (nDim == 2) Tecplot_File << R"(VARIABLES = "x","y" )" << endl; + if (nDim == 3) Tecplot_File << R"(VARIABLES = "x","y","z" )" << endl; + } else + Tecplot_File.open(mesh_filename, ios::out | ios::app); if (Total_nElem_Bound != 0) { - /*--- Write the header of the file ---*/ Tecplot_File << "ZONE T= "; - if (new_file) Tecplot_File << "\"Original grid\", C=BLACK, "; - else Tecplot_File << "\"Deformed grid\", C=RED, "; - Tecplot_File << "NODES= "<< nPointSurface <<", ELEMENTS= "<< Total_nElem_Bound <<", DATAPACKING= POINT"; - if (nDim == 2) Tecplot_File << ", ZONETYPE= FELINESEG"<< endl; - if (nDim == 3) Tecplot_File << ", ZONETYPE= FEQUADRILATERAL"<< endl; + if (new_file) + Tecplot_File << "\"Original grid\", C=BLACK, "; + else + Tecplot_File << "\"Deformed grid\", C=RED, "; + Tecplot_File << "NODES= " << nPointSurface << ", ELEMENTS= " << Total_nElem_Bound << ", DATAPACKING= POINT"; + if (nDim == 2) Tecplot_File << ", ZONETYPE= FELINESEG" << endl; + if (nDim == 3) Tecplot_File << ", ZONETYPE= FEQUADRILATERAL" << endl; /*--- Only write the coordiantes of the points that are on the surfaces ---*/ if (nDim == 3) { for (iPoint = 0; iPoint < nPoint; iPoint++) if (nodes->GetBoundary(iPoint)) { - for (Coord_i = 0; Coord_i < nDim-1; Coord_i++) - Tecplot_File << nodes->GetCoord(iPoint, Coord_i) << " "; - Tecplot_File << nodes->GetCoord(iPoint, nDim-1) << "\n"; + for (Coord_i = 0; Coord_i < nDim - 1; Coord_i++) Tecplot_File << nodes->GetCoord(iPoint, Coord_i) << " "; + Tecplot_File << nodes->GetCoord(iPoint, nDim - 1) << "\n"; } - } - else { + } else { for (iPoint = 0; iPoint < nPoint; iPoint++) if (nodes->GetBoundary(iPoint)) { - for (Coord_i = 0; Coord_i < nDim; Coord_i++) - Tecplot_File << nodes->GetCoord(iPoint, Coord_i) << " "; + for (Coord_i = 0; Coord_i < nDim; Coord_i++) Tecplot_File << nodes->GetCoord(iPoint, Coord_i) << " "; Tecplot_File << "\n"; } } @@ -8023,38 +7669,36 @@ void CPhysicalGeometry::SetBoundTecPlot(char mesh_filename[MAX_STRING_SIZE], boo if (config->GetMarker_All_Plotting(iMarker) == YES) for (iElem = 0; iElem < nElem_Bound[iMarker]; iElem++) { if (nDim == 2) { - Tecplot_File << PointSurface[bound[iMarker][iElem]->GetNode(0)]+1 << " " - << PointSurface[bound[iMarker][iElem]->GetNode(1)]+1 << endl; + Tecplot_File << PointSurface[bound[iMarker][iElem]->GetNode(0)] + 1 << " " + << PointSurface[bound[iMarker][iElem]->GetNode(1)] + 1 << endl; } if (nDim == 3) { if (bound[iMarker][iElem]->GetnNodes() == 3) { - Tecplot_File << PointSurface[bound[iMarker][iElem]->GetNode(0)]+1 << " " - << PointSurface[bound[iMarker][iElem]->GetNode(1)]+1 << " " - << PointSurface[bound[iMarker][iElem]->GetNode(2)]+1 << " " - << PointSurface[bound[iMarker][iElem]->GetNode(2)]+1 << endl; + Tecplot_File << PointSurface[bound[iMarker][iElem]->GetNode(0)] + 1 << " " + << PointSurface[bound[iMarker][iElem]->GetNode(1)] + 1 << " " + << PointSurface[bound[iMarker][iElem]->GetNode(2)] + 1 << " " + << PointSurface[bound[iMarker][iElem]->GetNode(2)] + 1 << endl; } if (bound[iMarker][iElem]->GetnNodes() == 4) { - Tecplot_File << PointSurface[bound[iMarker][iElem]->GetNode(0)]+1 << " " - << PointSurface[bound[iMarker][iElem]->GetNode(1)]+1 << " " - << PointSurface[bound[iMarker][iElem]->GetNode(2)]+1 << " " - << PointSurface[bound[iMarker][iElem]->GetNode(3)]+1 << endl; + Tecplot_File << PointSurface[bound[iMarker][iElem]->GetNode(0)] + 1 << " " + << PointSurface[bound[iMarker][iElem]->GetNode(1)] + 1 << " " + << PointSurface[bound[iMarker][iElem]->GetNode(2)] + 1 << " " + << PointSurface[bound[iMarker][iElem]->GetNode(3)] + 1 << endl; } } } - } - else { - + } else { /*--- No elements in the surface ---*/ if (nDim == 2) { - Tecplot_File << "ZONE NODES= 1, ELEMENTS= 1, DATAPACKING=POINT, ZONETYPE=FELINESEG"<< endl; - Tecplot_File << "0.0 0.0"<< endl; - Tecplot_File << "1 1"<< endl; + Tecplot_File << "ZONE NODES= 1, ELEMENTS= 1, DATAPACKING=POINT, ZONETYPE=FELINESEG" << endl; + Tecplot_File << "0.0 0.0" << endl; + Tecplot_File << "1 1" << endl; } if (nDim == 3) { - Tecplot_File << "ZONE NODES= 1, ELEMENTS= 1, DATAPACKING=POINT, ZONETYPE=FEQUADRILATERAL"<< endl; - Tecplot_File << "0.0 0.0 0.0"<< endl; - Tecplot_File << "1 1 1 1"<< endl; + Tecplot_File << "ZONE NODES= 1, ELEMENTS= 1, DATAPACKING=POINT, ZONETYPE=FEQUADRILATERAL" << endl; + Tecplot_File << "0.0 0.0 0.0" << endl; + Tecplot_File << "1 1 1 1" << endl; } } @@ -8062,11 +7706,9 @@ void CPhysicalGeometry::SetBoundTecPlot(char mesh_filename[MAX_STRING_SIZE], boo delete[] PointSurface; Tecplot_File.close(); - } -void CPhysicalGeometry::SetColorGrid_Parallel(const CConfig *config) { - +void CPhysicalGeometry::SetColorGrid_Parallel(const CConfig* config) { /*--- We need to have parallel support with MPI and have the ParMETIS library compiled and linked for parallel graph partitioning. ---*/ @@ -8080,27 +7722,27 @@ void CPhysicalGeometry::SetColorGrid_Parallel(const CConfig *config) { /*--- Linear partitioner object to help prepare parmetis data. ---*/ - CLinearPartitioner pointPartitioner(Global_nPointDomain,0); + CLinearPartitioner pointPartitioner(Global_nPointDomain, 0); /*--- Some recommended defaults for the various ParMETIS options. ---*/ idx_t wgtflag = 2; idx_t numflag = 0; - idx_t ncon = 1; - real_t ubvec = 1.0 + config->GetParMETIS_Tolerance(); - idx_t nparts = size; + idx_t ncon = 1; + real_t ubvec = 1.0 + config->GetParMETIS_Tolerance(); + idx_t nparts = size; idx_t options[METIS_NOPTIONS]; METIS_SetDefaultOptions(options); options[1] = 0; /*--- Fill the necessary ParMETIS input data arrays. ---*/ - vector tpwgts(size, 1.0/size); + vector tpwgts(size, 1.0 / size); - vector vtxdist(size+1); + vector vtxdist(size + 1); vtxdist[0] = 0; for (int i = 0; i < size; i++) { - vtxdist[i+1] = pointPartitioner.GetLastIndexOnRank(i); + vtxdist[i + 1] = pointPartitioner.GetLastIndexOnRank(i); } /*--- For most FVM-type operations the amount of work is proportional to the @@ -8114,7 +7756,7 @@ void CPhysicalGeometry::SetColorGrid_Parallel(const CConfig *config) { vector vwgt(nPoint); for (unsigned long iPoint = 0; iPoint < nPoint; ++iPoint) { - vwgt[iPoint] = wp + we * (xadj[iPoint+1] - xadj[iPoint]); + vwgt[iPoint] = wp + we * (xadj[iPoint + 1] - xadj[iPoint]); } /*--- Create some structures that ParMETIS needs to output the partitioning. ---*/ @@ -8125,9 +7767,9 @@ void CPhysicalGeometry::SetColorGrid_Parallel(const CConfig *config) { /*--- Calling ParMETIS ---*/ if (rank == MASTER_NODE) cout << "Calling ParMETIS..."; - auto err = ParMETIS_V3_PartKway(vtxdist.data(), xadj.data(), adjacency.data(), vwgt.data(), - nullptr, &wgtflag, &numflag, &ncon, &nparts, tpwgts.data(), - &ubvec, options, &edgecut, part.data(), &comm); + auto err = + ParMETIS_V3_PartKway(vtxdist.data(), xadj.data(), adjacency.data(), vwgt.data(), nullptr, &wgtflag, &numflag, + &ncon, &nparts, tpwgts.data(), &ubvec, options, &edgecut, part.data(), &comm); if (err != METIS_OK) SU2_MPI::Error("Partitioning failed.", CURRENT_FUNCTION); if (rank == MASTER_NODE) { cout << " graph partitioning complete (" << edgecut << " edge cuts)." << endl; @@ -8149,32 +7791,30 @@ void CPhysicalGeometry::SetColorGrid_Parallel(const CConfig *config) { #endif } -void CPhysicalGeometry::ComputeMeshQualityStatistics(const CConfig *config) { - +void CPhysicalGeometry::ComputeMeshQualityStatistics(const CConfig* config) { /*--- Resize our vectors for the 3 metrics: orthogonality, aspect ratio, and volume ratio. All are vertex-based for the dual CV. ---*/ - Orthogonality.resize(nPoint,0.0); - Aspect_Ratio.resize(nPoint,0.0); - Volume_Ratio.resize(nPoint,0.0); + Orthogonality.resize(nPoint, 0.0); + Aspect_Ratio.resize(nPoint, 0.0); + Volume_Ratio.resize(nPoint, 0.0); /*--- Helper vectors for holding intermediate values. ---*/ - vector SurfaceArea(nPoint,0.0); - vector Area_Max(nPoint,0.0); - vector Area_Min(nPoint,1.e6); - vector SubVolume_Max(nPoint,0.0); - vector SubVolume_Min(nPoint,1.e6); + vector SurfaceArea(nPoint, 0.0); + vector Area_Max(nPoint, 0.0); + vector Area_Min(nPoint, 1.e6); + vector SubVolume_Max(nPoint, 0.0); + vector SubVolume_Min(nPoint, 1.e6); /*--- Orthogonality and aspect ratio (areas) are computed by looping over all edges to check the angles and the face areas. ---*/ for (unsigned long iEdge = 0; iEdge < nEdge; iEdge++) { - /*--- Point identification, edge normal vector and area ---*/ - const unsigned long iPoint = edges->GetNode(iEdge,0); - const unsigned long jPoint = edges->GetNode(iEdge,1); + const unsigned long iPoint = edges->GetNode(iEdge, 0); + const unsigned long jPoint = edges->GetNode(iEdge, 1); const unsigned long GlobalIndex_i = nodes->GetGlobalIndex(iPoint); const unsigned long GlobalIndex_j = nodes->GetGlobalIndex(jPoint); @@ -8183,26 +7823,26 @@ void CPhysicalGeometry::ComputeMeshQualityStatistics(const CConfig *config) { is computed by summing the normals of adjacent faces along the edge between iPoint & jPoint. ---*/ - const su2double *Normal = edges->GetNormal(iEdge); + const su2double* Normal = edges->GetNormal(iEdge); /*--- Get the coordinates for point i & j. ---*/ - const su2double *Coord_i = nodes->GetCoord(iPoint); - const su2double *Coord_j = nodes->GetCoord(jPoint); + const su2double* Coord_i = nodes->GetCoord(iPoint); + const su2double* Coord_j = nodes->GetCoord(jPoint); /*--- Compute the vector pointing from iPoint to jPoint and its distance. We also compute face area (norm of the normal vector). ---*/ su2double distance = 0.0; - su2double area = 0.0; + su2double area = 0.0; vector edgeVector(nDim); for (unsigned short iDim = 0; iDim < nDim; iDim++) { - edgeVector[iDim] = Coord_j[iDim]-Coord_i[iDim]; - distance += edgeVector[iDim]*edgeVector[iDim]; - area += Normal[iDim]*Normal[iDim]; + edgeVector[iDim] = Coord_j[iDim] - Coord_i[iDim]; + distance += edgeVector[iDim] * edgeVector[iDim]; + area += Normal[iDim] * Normal[iDim]; } distance = sqrt(distance); - area = sqrt(area); + area = sqrt(area); /*--- Aspect ratio is the ratio between the largest and smallest faces making up the boundary of the dual CV and is a measure @@ -8221,8 +7861,7 @@ void CPhysicalGeometry::ComputeMeshQualityStatistics(const CConfig *config) { if (area <= 0.0) { char buf[200]; - SPRINTF(buf, "Zero-area CV face found for edge (%lu,%lu).", - GlobalIndex_i, GlobalIndex_j); + SPRINTF(buf, "Zero-area CV face found for edge (%lu,%lu).", GlobalIndex_i, GlobalIndex_j); SU2_MPI::Error(string(buf), CURRENT_FUNCTION); } @@ -8231,7 +7870,7 @@ void CPhysicalGeometry::ComputeMeshQualityStatistics(const CConfig *config) { su2double dotProduct = 0.0; for (unsigned short iDim = 0; iDim < nDim; iDim++) { - dotProduct += (Normal[iDim]/area)*(edgeVector[iDim]/distance); + dotProduct += (Normal[iDim] / area) * (edgeVector[iDim] / distance); } /*--- The definition of orthogonality is an area-weighted average of @@ -8242,12 +7881,12 @@ void CPhysicalGeometry::ComputeMeshQualityStatistics(const CConfig *config) { are close to 90 degress, poor values are typically below 20 degress. ---*/ if (nodes->GetDomain(iPoint)) { - Orthogonality[iPoint] += area*(90.0 - acos(dotProduct)*180.0/PI_NUMBER); - SurfaceArea[iPoint] += area; + Orthogonality[iPoint] += area * (90.0 - acos(dotProduct) * 180.0 / PI_NUMBER); + SurfaceArea[iPoint] += area; } if (nodes->GetDomain(jPoint)) { - Orthogonality[jPoint] += area*(90.0 - acos(dotProduct)*180.0/PI_NUMBER); - SurfaceArea[jPoint] += area; + Orthogonality[jPoint] += area * (90.0 - acos(dotProduct) * 180.0 / PI_NUMBER); + SurfaceArea[jPoint] += area; } /*--- Error check for zero volume of the dual CVs. ---*/ @@ -8263,33 +7902,28 @@ void CPhysicalGeometry::ComputeMeshQualityStatistics(const CConfig *config) { SPRINTF(buf, "Zero-area CV face found for point %lu.", GlobalIndex_j); SU2_MPI::Error(string(buf), CURRENT_FUNCTION); } - } /*--- Loop boundary edges to include the area of the boundary elements. ---*/ for (unsigned short iMarker = 0; iMarker < nMarker; iMarker++) { if ((config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY) && - (config->GetMarker_All_KindBC(iMarker) != SEND_RECEIVE)){ - + (config->GetMarker_All_KindBC(iMarker) != SEND_RECEIVE)) { for (unsigned long iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { const unsigned long iPoint = vertex[iMarker][iVertex]->GetNode(); - const su2double *Normal = vertex[iMarker][iVertex]->GetNormal(); + const su2double* Normal = vertex[iMarker][iVertex]->GetNormal(); if (nodes->GetDomain(iPoint)) { - /*--- Face area (norm of the normal vector) ---*/ su2double area = 0.0; - for (unsigned short iDim = 0; iDim < nDim; iDim++) - area += Normal[iDim]*Normal[iDim]; + for (unsigned short iDim = 0; iDim < nDim; iDim++) area += Normal[iDim] * Normal[iDim]; area = sqrt(area); /*--- Check to store the area as the min or max for i or j. ---*/ Area_Min[iPoint] = min(Area_Min[iPoint], area); Area_Max[iPoint] = max(Area_Max[iPoint], area); - } } } @@ -8302,7 +7936,6 @@ void CPhysicalGeometry::ComputeMeshQualityStatistics(const CConfig *config) { is better (closer to isotropic). ----*/ for (unsigned long iElem = 0; iElem < nElem; iElem++) { - /*--- Get pointers to the coordinates of all the element nodes ---*/ array Coord; @@ -8314,7 +7947,6 @@ void CPhysicalGeometry::ComputeMeshQualityStatistics(const CConfig *config) { const su2double* Coord_Elem_CG = elem[iElem]->GetCG(); for (unsigned short iFace = 0; iFace < elem[iElem]->GetnFaces(); iFace++) { - /*--- In 2D all the faces have only one edge ---*/ unsigned short nEdgesFace = 1; @@ -8327,23 +7959,21 @@ void CPhysicalGeometry::ComputeMeshQualityStatistics(const CConfig *config) { for (unsigned short iNode = 0; iNode < nEdgesFace; iNode++) { auto NodeFace = elem[iElem]->GetFaces(iFace, iNode); for (unsigned short iDim = 0; iDim < nDim; iDim++) - Coord_FaceElem_CG[iDim] += Coord[NodeFace][iDim]/nEdgesFace; + Coord_FaceElem_CG[iDim] += Coord[NodeFace][iDim] / nEdgesFace; } } /*-- Loop over the edges of a face ---*/ for (unsigned short iEdgesFace = 0; iEdgesFace < nEdgesFace; iEdgesFace++) { - - const auto face_iNode = elem[iElem]->GetFaces(iFace,iEdgesFace); + const auto face_iNode = elem[iElem]->GetFaces(iFace, iEdgesFace); unsigned short face_jNode; if (nDim == 2) { /*--- In 2D only one edge (two points) per edge ---*/ - face_jNode = elem[iElem]->GetFaces(iFace,1); - } - else { + face_jNode = elem[iElem]->GetFaces(iFace, 1); + } else { /*--- In 3D we "circle around" the face ---*/ - face_jNode = elem[iElem]->GetFaces(iFace, (iEdgesFace+1)%nEdgesFace); + face_jNode = elem[iElem]->GetFaces(iFace, (iEdgesFace + 1) % nEdgesFace); } const auto face_iPoint = elem[iElem]->GetNode(face_iNode); @@ -8360,12 +7990,9 @@ void CPhysicalGeometry::ComputeMeshQualityStatistics(const CConfig *config) { if (nDim == 2) { Volume_i = CEdge::GetVolume(Coord[face_iNode], Coord_Edge_CG, Coord_Elem_CG); Volume_j = CEdge::GetVolume(Coord[face_jNode], Coord_Edge_CG, Coord_Elem_CG); - } - else { - Volume_i = CEdge::GetVolume(Coord[face_iNode], Coord_Edge_CG, - Coord_FaceElem_CG, Coord_Elem_CG); - Volume_j = CEdge::GetVolume(Coord[face_jNode], Coord_Edge_CG, - Coord_FaceElem_CG, Coord_Elem_CG); + } else { + Volume_i = CEdge::GetVolume(Coord[face_iNode], Coord_Edge_CG, Coord_FaceElem_CG, Coord_Elem_CG); + Volume_j = CEdge::GetVolume(Coord[face_jNode], Coord_Edge_CG, Coord_FaceElem_CG, Coord_Elem_CG); } /*--- Check if sub-elem volume is the min or max for iPoint. ---*/ @@ -8381,7 +8008,6 @@ void CPhysicalGeometry::ComputeMeshQualityStatistics(const CConfig *config) { SubVolume_Min[face_jPoint] = min(SubVolume_Min[face_jPoint], Volume_j); SubVolume_Max[face_jPoint] = max(SubVolume_Max[face_jPoint], Volume_j); } - } } } @@ -8390,17 +8016,17 @@ void CPhysicalGeometry::ComputeMeshQualityStatistics(const CConfig *config) { compute the local min and max values here for reporting. ---*/ su2double orthoMin = 1.e6, arMin = 1.e6, vrMin = 1.e6; - su2double orthoMax = 0.0, arMax = 0.0, vrMax = 0.0; - for (unsigned long iPoint= 0; iPoint < nPointDomain; iPoint++) { - Orthogonality[iPoint] = Orthogonality[iPoint]/SurfaceArea[iPoint]; + su2double orthoMax = 0.0, arMax = 0.0, vrMax = 0.0; + for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { + Orthogonality[iPoint] = Orthogonality[iPoint] / SurfaceArea[iPoint]; orthoMin = min(Orthogonality[iPoint], orthoMin); orthoMax = max(Orthogonality[iPoint], orthoMax); - Aspect_Ratio[iPoint] = Area_Max[iPoint]/Area_Min[iPoint]; + Aspect_Ratio[iPoint] = Area_Max[iPoint] / Area_Min[iPoint]; arMin = min(Aspect_Ratio[iPoint], arMin); arMax = max(Aspect_Ratio[iPoint], arMax); - Volume_Ratio[iPoint] = SubVolume_Max[iPoint]/SubVolume_Min[iPoint]; + Volume_Ratio[iPoint] = SubVolume_Max[iPoint] / SubVolume_Min[iPoint]; vrMin = min(Volume_Ratio[iPoint], vrMin); vrMax = max(Volume_Ratio[iPoint], vrMax); } @@ -8408,22 +8034,16 @@ void CPhysicalGeometry::ComputeMeshQualityStatistics(const CConfig *config) { /*--- Reduction to find the min and max values globally. ---*/ su2double Global_Ortho_Min, Global_Ortho_Max; - SU2_MPI::Allreduce(&orthoMin, &Global_Ortho_Min, 1, - MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(&orthoMax, &Global_Ortho_Max, 1, - MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&orthoMin, &Global_Ortho_Min, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&orthoMax, &Global_Ortho_Max, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); su2double Global_AR_Min, Global_AR_Max; - SU2_MPI::Allreduce(&arMin, &Global_AR_Min, 1, - MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(&arMax, &Global_AR_Max, 1, - MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&arMin, &Global_AR_Min, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&arMax, &Global_AR_Max, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); su2double Global_VR_Min, Global_VR_Max; - SU2_MPI::Allreduce(&vrMin, &Global_VR_Min, 1, - MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(&vrMax, &Global_VR_Max, 1, - MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&vrMin, &Global_VR_Min, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); + SU2_MPI::Allreduce(&vrMax, &Global_VR_Max, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); /*--- Print the summary to the console for the user. ---*/ @@ -8431,7 +8051,7 @@ void CPhysicalGeometry::ComputeMeshQualityStatistics(const CConfig *config) { MetricsTable.AddColumn("Mesh Quality Metric", 30); MetricsTable.AddColumn("Minimum", 15); MetricsTable.AddColumn("Maximum", 15); - if (rank == MASTER_NODE){ + if (rank == MASTER_NODE) { MetricsTable.PrintHeader(); MetricsTable << "Orthogonality Angle (deg.)" << Global_Ortho_Min << Global_Ortho_Max; MetricsTable << "CV Face Area Aspect Ratio" << Global_AR_Min << Global_AR_Max; @@ -8447,40 +8067,39 @@ void CPhysicalGeometry::ComputeMeshQualityStatistics(const CConfig *config) { vector().swap(Aspect_Ratio); vector().swap(Volume_Ratio); } - } -void CPhysicalGeometry::FindNormal_Neighbor(const CConfig *config) { +void CPhysicalGeometry::FindNormal_Neighbor(const CConfig* config) { su2double cos_max, scalar_prod, norm_vect, norm_Normal, cos_alpha, diff_coord, *Normal; unsigned long Point_Normal, jPoint; unsigned short iNeigh, iMarker, iDim; unsigned long iPoint, iVertex; for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if (config->GetMarker_All_KindBC(iMarker) != SEND_RECEIVE && config->GetMarker_All_KindBC(iMarker) != INTERNAL_BOUNDARY && - config->GetMarker_All_KindBC(iMarker) != NEARFIELD_BOUNDARY ) { - + config->GetMarker_All_KindBC(iMarker) != NEARFIELD_BOUNDARY) { for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - iPoint = vertex[iMarker][iVertex]->GetNode(); Normal = vertex[iMarker][iVertex]->GetNormal(); /*--- Compute closest normal neighbor, note that the normal are oriented inwards ---*/ - Point_Normal = 0; cos_max = -1.0; + Point_Normal = 0; + cos_max = -1.0; for (iNeigh = 0; iNeigh < nodes->GetnPoint(iPoint); iNeigh++) { jPoint = nodes->GetPoint(iPoint, iNeigh); - scalar_prod = 0.0; norm_vect = 0.0; norm_Normal = 0.0; + scalar_prod = 0.0; + norm_vect = 0.0; + norm_Normal = 0.0; for (iDim = 0; iDim < nDim; iDim++) { - diff_coord = nodes->GetCoord(jPoint, iDim)-nodes->GetCoord(iPoint, iDim); - scalar_prod += diff_coord*Normal[iDim]; - norm_vect += diff_coord*diff_coord; - norm_Normal += Normal[iDim]*Normal[iDim]; + diff_coord = nodes->GetCoord(jPoint, iDim) - nodes->GetCoord(iPoint, iDim); + scalar_prod += diff_coord * Normal[iDim]; + norm_vect += diff_coord * diff_coord; + norm_Normal += Normal[iDim] * Normal[iDim]; } norm_vect = sqrt(norm_vect); norm_Normal = sqrt(norm_Normal); - cos_alpha = scalar_prod/(norm_vect*norm_Normal); + cos_alpha = scalar_prod / (norm_vect * norm_Normal); /*--- Get maximum cosine ---*/ if (cos_alpha >= cos_max) { @@ -8494,11 +8113,11 @@ void CPhysicalGeometry::FindNormal_Neighbor(const CConfig *config) { } } -void CPhysicalGeometry::SetBoundSensitivity(CConfig *config) { +void CPhysicalGeometry::SetBoundSensitivity(CConfig* config) { unsigned short iMarker, icommas; unsigned long iVertex, iPoint, (*Point2Vertex)[2], nPointLocal = 0, nPointGlobal = 0; su2double Sensitivity; - bool *PointInDomain; + bool* PointInDomain; nPointLocal = nPoint; SU2_MPI::Allreduce(&nPointLocal, &nPointGlobal, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); @@ -8506,13 +8125,11 @@ void CPhysicalGeometry::SetBoundSensitivity(CConfig *config) { Point2Vertex = new unsigned long[nPointGlobal][2]; PointInDomain = new bool[nPointGlobal]; - for (iPoint = 0; iPoint < nPointGlobal; iPoint ++) - PointInDomain[iPoint] = false; + for (iPoint = 0; iPoint < nPointGlobal; iPoint++) PointInDomain[iPoint] = false; for (iMarker = 0; iMarker < nMarker; iMarker++) if (config->GetMarker_All_DV(iMarker) == YES) for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { - /*--- The sensitivity file uses the global numbering ---*/ iPoint = nodes->GetGlobalIndex(vertex[iMarker][iVertex]->GetNode()); @@ -8530,25 +8147,23 @@ void CPhysicalGeometry::SetBoundSensitivity(CConfig *config) { su2double delta_T, total_T; if ((config->GetTime_Marching() != TIME_MARCHING::STEADY) && config->GetTime_Domain()) { nTimeIter = config->GetUnst_AdjointIter(); - delta_T = config->GetTime_Step(); - total_T = (su2double)nTimeIter*delta_T; + delta_T = config->GetTime_Step(); + total_T = (su2double)nTimeIter * delta_T; } else if (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE) { - /*--- Compute period of oscillation & compute time interval using nTimeInstances ---*/ su2double period = config->GetHarmonicBalance_Period(); - nTimeIter = config->GetnTimeInstances(); - delta_T = period/(su2double)nTimeIter; - total_T = period; + nTimeIter = config->GetnTimeInstances(); + delta_T = period / (su2double)nTimeIter; + total_T = period; } else { nTimeIter = 1; - delta_T = 1.0; - total_T = 1.0; + delta_T = 1.0; + total_T = 1.0; } for (iTimeIter = 0; iTimeIter < nTimeIter; iTimeIter++) { - /*--- Prepare to read surface sensitivity files (CSV) ---*/ string text_line; @@ -8556,24 +8171,27 @@ void CPhysicalGeometry::SetBoundSensitivity(CConfig *config) { char buffer[50]; char cstr[MAX_STRING_SIZE]; string surfadj_filename = config->GetSurfAdjCoeff_FileName(); - strcpy (cstr, surfadj_filename.c_str()); + strcpy(cstr, surfadj_filename.c_str()); /*--- Write file name with extension if unsteady or steady ---*/ if (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE) - SPRINTF (buffer, "_%d.csv", SU2_TYPE::Int(iTimeIter)); + SPRINTF(buffer, "_%d.csv", SU2_TYPE::Int(iTimeIter)); if (((config->GetTime_Marching() != TIME_MARCHING::STEADY) && config->GetTime_Domain()) || (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE)) { - if ((SU2_TYPE::Int(iTimeIter) >= 0) && (SU2_TYPE::Int(iTimeIter) < 10)) SPRINTF (buffer, "_0000%d.csv", SU2_TYPE::Int(iTimeIter)); - if ((SU2_TYPE::Int(iTimeIter) >= 10) && (SU2_TYPE::Int(iTimeIter) < 100)) SPRINTF (buffer, "_000%d.csv", SU2_TYPE::Int(iTimeIter)); - if ((SU2_TYPE::Int(iTimeIter) >= 100) && (SU2_TYPE::Int(iTimeIter) < 1000)) SPRINTF (buffer, "_00%d.csv", SU2_TYPE::Int(iTimeIter)); - if ((SU2_TYPE::Int(iTimeIter) >= 1000) && (SU2_TYPE::Int(iTimeIter) < 10000)) SPRINTF (buffer, "_0%d.csv", SU2_TYPE::Int(iTimeIter)); - if (SU2_TYPE::Int(iTimeIter) >= 10000) SPRINTF (buffer, "_%d.csv", SU2_TYPE::Int(iTimeIter)); - } - else - SPRINTF (buffer, ".csv"); - - strcat (cstr, buffer); + if ((SU2_TYPE::Int(iTimeIter) >= 0) && (SU2_TYPE::Int(iTimeIter) < 10)) + SPRINTF(buffer, "_0000%d.csv", SU2_TYPE::Int(iTimeIter)); + if ((SU2_TYPE::Int(iTimeIter) >= 10) && (SU2_TYPE::Int(iTimeIter) < 100)) + SPRINTF(buffer, "_000%d.csv", SU2_TYPE::Int(iTimeIter)); + if ((SU2_TYPE::Int(iTimeIter) >= 100) && (SU2_TYPE::Int(iTimeIter) < 1000)) + SPRINTF(buffer, "_00%d.csv", SU2_TYPE::Int(iTimeIter)); + if ((SU2_TYPE::Int(iTimeIter) >= 1000) && (SU2_TYPE::Int(iTimeIter) < 10000)) + SPRINTF(buffer, "_0%d.csv", SU2_TYPE::Int(iTimeIter)); + if (SU2_TYPE::Int(iTimeIter) >= 10000) SPRINTF(buffer, "_%d.csv", SU2_TYPE::Int(iTimeIter)); + } else + SPRINTF(buffer, ".csv"); + + strcat(cstr, buffer); /*--- Read the sensitivity file ---*/ @@ -8590,13 +8208,13 @@ void CPhysicalGeometry::SetBoundSensitivity(CConfig *config) { char delimiter = ','; split_line = PrintingToolbox::split(text_line, delimiter); - for (unsigned short iField = 0; iField < split_line.size(); iField++){ + for (unsigned short iField = 0; iField < split_line.size(); iField++) { PrintingToolbox::trim(split_line[iField]); } - std::vector::iterator it = std::find(split_line.begin(), split_line.end(), "\"Surface_Sensitivity\""); + auto it = std::find(split_line.begin(), split_line.end(), "\"Surface_Sensitivity\""); - if (it == split_line.end()){ + if (it == split_line.end()) { SU2_MPI::Error("Surface sensitivity not found in file.", CURRENT_FUNCTION); } @@ -8604,17 +8222,15 @@ void CPhysicalGeometry::SetBoundSensitivity(CConfig *config) { while (getline(Surface_file, text_line)) { for (icommas = 0; icommas < 50; icommas++) { - position = text_line.find( ",", 0 ); - if (position!=string::npos) text_line.erase (position,1); + position = text_line.find(',', 0); + if (position != string::npos) text_line.erase(position, 1); } - stringstream point_line(text_line); + stringstream point_line(text_line); point_line >> iPoint; - for (int i = 1; i <= sens_index; i++) - point_line >> Sensitivity; + for (int i = 1; i <= sens_index; i++) point_line >> Sensitivity; if (PointInDomain[iPoint]) { - /*--- Find the vertex for the Point and Marker ---*/ iMarker = Point2Vertex[iPoint][0]; @@ -8624,20 +8240,17 @@ void CPhysicalGeometry::SetBoundSensitivity(CConfig *config) { this unsteady timestep. For steady problems, this reduces to a single sensitivity value multiplied by 1.0. ---*/ - vertex[iMarker][iVertex]->AddAuxVar(Sensitivity*(delta_T/total_T)); + vertex[iMarker][iVertex]->AddAuxVar(Sensitivity * (delta_T / total_T)); } - } Surface_file.close(); } delete[] Point2Vertex; delete[] PointInDomain; - } -void CPhysicalGeometry::SetSensitivity(CConfig *config) { - +void CPhysicalGeometry::SetSensitivity(CConfig* config) { ifstream restart_file; string filename = config->GetSolution_AdjFileName(); @@ -8647,19 +8260,20 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { string::size_type position; int counter = 0; - Sensitivity.resize(nPoint,nDim) = su2double(0.0); + Sensitivity.resize(nPoint, nDim) = su2double(0.0); if (config->GetTime_Domain()) { nTimeIter = config->GetnTime_Iter(); - }else { + } else { nTimeIter = 1; } - if (rank == MASTER_NODE) - cout << "Reading in sensitivity at iteration " << nTimeIter-1 << "."<< endl; + if (rank == MASTER_NODE) cout << "Reading in sensitivity at iteration " << nTimeIter - 1 << "." << endl; /*--- Read all lines in the restart file ---*/ - long iPoint_Local; unsigned long iPoint_Global = 0; string text_line; + long iPoint_Local; + unsigned long iPoint_Global = 0; + string text_line; iPoint_Global = 0; @@ -8667,27 +8281,25 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { filename = config->GetObjFunc_Extension(filename); - if (config->GetRead_Binary_Restart()) { - - filename = config->GetFilename(filename, ".dat", nTimeIter-1); + filename = config->GetFilename(filename, ".dat", nTimeIter - 1); char str_buf[CGNS_STRING_SIZE], fname[100]; unsigned short iVar; strcpy(fname, filename.c_str()); int nRestart_Vars = 5, nFields; - int *Restart_Vars = new int[5]; - passivedouble *Restart_Data = nullptr; + int* Restart_Vars = new int[5]; + passivedouble* Restart_Data = nullptr; int Restart_Iter = 0; - passivedouble Restart_Meta_Passive[8] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; - su2double Restart_Meta[8] = {0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}; + passivedouble Restart_Meta_Passive[8] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; + su2double Restart_Meta[8] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0}; #ifndef HAVE_MPI /*--- Serial binary input. ---*/ - FILE *fhw; - fhw = fopen(fname,"rb"); + FILE* fhw; + fhw = fopen(fname, "rb"); size_t ret; /*--- Error check for opening the file. ---*/ @@ -8708,9 +8320,10 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { if (Restart_Vars[0] != 535532) { SU2_MPI::Error(string("File ") + string(fname) + string(" is not a binary SU2 restart file.\n") + - string("SU2 reads/writes binary restart files by default.\n") + - string("Note that backward compatibility for ASCII restart files is\n") + - string("possible with the READ_BINARY_RESTART option."), CURRENT_FUNCTION); + string("SU2 reads/writes binary restart files by default.\n") + + string("Note that backward compatibility for ASCII restart files is\n") + + string("possible with the READ_BINARY_RESTART option."), + CURRENT_FUNCTION); } /*--- Store the number of fields for simplicity. ---*/ @@ -8733,19 +8346,19 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- For now, create a temp 1D buffer to read the data from file. ---*/ - Restart_Data = new passivedouble[nFields*GetnPointDomain()]; + Restart_Data = new passivedouble[nFields * GetnPointDomain()]; /*--- Read in the data for the restart at all local points. ---*/ - ret = fread(Restart_Data, sizeof(passivedouble), nFields*GetnPointDomain(), fhw); - if (ret != (unsigned long)nFields*GetnPointDomain()) { + ret = fread(Restart_Data, sizeof(passivedouble), nFields * GetnPointDomain(), fhw); + if (ret != (unsigned long)nFields * GetnPointDomain()) { SU2_MPI::Error("Error reading restart file.", CURRENT_FUNCTION); } /*--- Compute (negative) displacements and grab the metadata. ---*/ - ret = sizeof(int) + 8*sizeof(passivedouble); - fseek(fhw,-ret, SEEK_END); + ret = sizeof(int) + 8 * sizeof(passivedouble); + fseek(fhw, -ret, SEEK_END); /*--- Read the external iteration. ---*/ @@ -8792,8 +8405,7 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { which we will need in order to read the file later. Also, read the variable string names here. Only the master rank reads the header. ---*/ - if (rank == MASTER_NODE) - MPI_File_read(fhw, Restart_Vars, nRestart_Vars, MPI_INT, MPI_STATUS_IGNORE); + if (rank == MASTER_NODE) MPI_File_read(fhw, Restart_Vars, nRestart_Vars, MPI_INT, MPI_STATUS_IGNORE); /*--- Broadcast the number of variables to all procs and store clearly. ---*/ @@ -8803,11 +8415,11 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { have the hex representation of "SU2" as the first int in the file. ---*/ if (Restart_Vars[0] != 535532) { - SU2_MPI::Error(string("File ") + string(fname) + string(" is not a binary SU2 restart file.\n") + - string("SU2 reads/writes binary restart files by default.\n") + - string("Note that backward compatibility for ASCII restart files is\n") + - string("possible with the READ_BINARY_RESTART option."), CURRENT_FUNCTION); + string("SU2 reads/writes binary restart files by default.\n") + + string("Note that backward compatibility for ASCII restart files is\n") + + string("possible with the READ_BINARY_RESTART option."), + CURRENT_FUNCTION); } /*--- Store the number of fields for simplicity. ---*/ @@ -8818,35 +8430,33 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { fixed length of 33 for the string length to match with CGNS. This is needed for when we read the strings later. ---*/ - char *mpi_str_buf = new char[nFields*CGNS_STRING_SIZE]; + char* mpi_str_buf = new char[nFields * CGNS_STRING_SIZE]; if (rank == MASTER_NODE) { - disp = nRestart_Vars*sizeof(int); - MPI_File_read_at(fhw, disp, mpi_str_buf, nFields*CGNS_STRING_SIZE, - MPI_CHAR, MPI_STATUS_IGNORE); + disp = nRestart_Vars * sizeof(int); + MPI_File_read_at(fhw, disp, mpi_str_buf, nFields * CGNS_STRING_SIZE, MPI_CHAR, MPI_STATUS_IGNORE); } /*--- Broadcast the string names of the variables. ---*/ - SU2_MPI::Bcast(mpi_str_buf, nFields*CGNS_STRING_SIZE, MPI_CHAR, - MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Bcast(mpi_str_buf, nFields * CGNS_STRING_SIZE, MPI_CHAR, MASTER_NODE, SU2_MPI::GetComm()); /*--- Now parse the string names and load into the config class in case we need them for writing visualization files (SU2_SOL). ---*/ - config->fields.push_back("Point_ID"); + config->fields.emplace_back("Point_ID"); for (iVar = 0; iVar < nFields; iVar++) { - index = iVar*CGNS_STRING_SIZE; + index = iVar * CGNS_STRING_SIZE; for (iChar = 0; iChar < (unsigned long)CGNS_STRING_SIZE; iChar++) { str_buf[iChar] = mpi_str_buf[index + iChar]; } field_buf.append(str_buf); - config->fields.push_back(field_buf.c_str()); + config->fields.emplace_back(field_buf.c_str()); field_buf.clear(); } /*--- Free string buffer memory. ---*/ - delete [] mpi_str_buf; + delete[] mpi_str_buf; /*--- We're writing only su2doubles in the data portion of the file. ---*/ @@ -8855,20 +8465,20 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- We need to ignore the 4 ints describing the nVar_Restart and nPoints, along with the string names of the variables. ---*/ - disp = nRestart_Vars*sizeof(int) + CGNS_STRING_SIZE*nFields*sizeof(char); + disp = nRestart_Vars * sizeof(int) + CGNS_STRING_SIZE * nFields * sizeof(char); /*--- Define a derived datatype for this rank's set of non-contiguous data that will be placed in the restart. Here, we are collecting each one of the points which are distributed throughout the file in blocks of nVar_Restart data. ---*/ - int *blocklen = new int[GetnPointDomain()]; - MPI_Aint *displace = new MPI_Aint[GetnPointDomain()]; + int* blocklen = new int[GetnPointDomain()]; + auto* displace = new MPI_Aint[GetnPointDomain()]; counter = 0; - for (iPoint_Global = 0; iPoint_Global < GetGlobal_nPointDomain(); iPoint_Global++ ) { + for (iPoint_Global = 0; iPoint_Global < GetGlobal_nPointDomain(); iPoint_Global++) { if (GetGlobal_to_Local_Point(iPoint_Global) > -1) { blocklen[counter] = nFields; - displace[counter] = iPoint_Global*nFields*sizeof(passivedouble); + displace[counter] = iPoint_Global * nFields * sizeof(passivedouble); counter++; } } @@ -8882,11 +8492,11 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- For now, create a temp 1D buffer to read the data from file. ---*/ - Restart_Data = new passivedouble[nFields*GetnPointDomain()]; + Restart_Data = new passivedouble[nFields * GetnPointDomain()]; /*--- Collective call for all ranks to read from their view simultaneously. ---*/ - MPI_File_read_all(fhw, Restart_Data, nFields*GetnPointDomain(), MPI_DOUBLE, &status); + MPI_File_read_all(fhw, Restart_Data, nFields * GetnPointDomain(), MPI_DOUBLE, &status); /*--- Free the derived datatype. ---*/ @@ -8899,18 +8509,16 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- Access the metadata. ---*/ if (rank == MASTER_NODE) { - /*--- External iteration. ---*/ - disp = (nRestart_Vars*sizeof(int) + nFields*CGNS_STRING_SIZE*sizeof(char) + - nFields*Restart_Vars[2]*sizeof(passivedouble)); + disp = (nRestart_Vars * sizeof(int) + nFields * CGNS_STRING_SIZE * sizeof(char) + + nFields * Restart_Vars[2] * sizeof(passivedouble)); MPI_File_read_at(fhw, disp, &Restart_Iter, 1, MPI_INT, MPI_STATUS_IGNORE); /*--- Additional doubles for AoA, AoS, etc. ---*/ - disp = (nRestart_Vars*sizeof(int) + nFields*CGNS_STRING_SIZE*sizeof(char) + - nFields*Restart_Vars[2]*sizeof(passivedouble) + 1*sizeof(int)); + disp = (nRestart_Vars * sizeof(int) + nFields * CGNS_STRING_SIZE * sizeof(char) + + nFields * Restart_Vars[2] * sizeof(passivedouble) + 1 * sizeof(int)); MPI_File_read_at(fhw, disp, Restart_Meta_Passive, 8, MPI_DOUBLE, MPI_STATUS_IGNORE); - } /*--- Communicate metadata. ---*/ @@ -8920,8 +8528,7 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- Copy to a su2double structure (because of the SU2_MPI::Bcast doesn't work with passive data)---*/ - for (unsigned short iVar = 0; iVar < 8; iVar++) - Restart_Meta[iVar] = Restart_Meta_Passive[iVar]; + for (unsigned short iVar = 0; iVar < 8; iVar++) Restart_Meta[iVar] = Restart_Meta_Passive[iVar]; SU2_MPI::Bcast(Restart_Meta, 8, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); @@ -8929,23 +8536,23 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { MPI_File_close(&fhw); - delete [] blocklen; - delete [] displace; + delete[] blocklen; + delete[] displace; #endif - std::vector::iterator itx = std::find(config->fields.begin(), config->fields.end(), "Sensitivity_x"); - std::vector::iterator ity = std::find(config->fields.begin(), config->fields.end(), "Sensitivity_y"); - std::vector::iterator itz = std::find(config->fields.begin(), config->fields.end(), "Sensitivity_z"); + auto itx = std::find(config->fields.begin(), config->fields.end(), "Sensitivity_x"); + auto ity = std::find(config->fields.begin(), config->fields.end(), "Sensitivity_y"); + auto itz = std::find(config->fields.begin(), config->fields.end(), "Sensitivity_z"); - if (itx == config->fields.end()){ + if (itx == config->fields.end()) { SU2_MPI::Error("Sensitivity x not found in file.", CURRENT_FUNCTION); } - if (ity == config->fields.end()){ + if (ity == config->fields.end()) { SU2_MPI::Error("Sensitivity y not found in file.", CURRENT_FUNCTION); } - if (nDim == 3){ - if (itz == config->fields.end()){ + if (nDim == 3) { + if (itz == config->fields.end()) { SU2_MPI::Error("Sensitivity z not found in file.", CURRENT_FUNCTION); } } @@ -8953,32 +8560,29 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { unsigned short sens_x_idx = std::distance(config->fields.begin(), itx); unsigned short sens_y_idx = std::distance(config->fields.begin(), ity); unsigned short sens_z_idx = 0; - if (nDim == 3) - sens_z_idx = std::distance(config->fields.begin(), itz); + if (nDim == 3) sens_z_idx = std::distance(config->fields.begin(), itz); /*--- Load the data from the binary restart. ---*/ counter = 0; - for (iPoint_Global = 0; iPoint_Global < GetGlobal_nPointDomain(); iPoint_Global++ ) { - + for (iPoint_Global = 0; iPoint_Global < GetGlobal_nPointDomain(); iPoint_Global++) { /*--- Retrieve local index. If this node from the restart file lives on the current processor, we will load and instantiate the vars. ---*/ iPoint_Local = GetGlobal_to_Local_Point(iPoint_Global); if (iPoint_Local > -1) { - /*--- We need to store this point's data, so jump to the correct offset in the buffer of data from the restart file and load it. ---*/ - index = counter*nFields + sens_x_idx - 1; - Sensitivity(iPoint_Local,0) = Restart_Data[index]; - index = counter*nFields + sens_y_idx - 1; - Sensitivity(iPoint_Local,1) = Restart_Data[index]; + index = counter * nFields + sens_x_idx - 1; + Sensitivity(iPoint_Local, 0) = Restart_Data[index]; + index = counter * nFields + sens_y_idx - 1; + Sensitivity(iPoint_Local, 1) = Restart_Data[index]; - if (nDim == 3){ - index = counter*nFields + sens_z_idx - 1; - Sensitivity(iPoint_Local,2) = Restart_Data[index]; + if (nDim == 3) { + index = counter * nFields + sens_z_idx - 1; + Sensitivity(iPoint_Local, 2) = Restart_Data[index]; } /*--- Increment the overall counter for how many points have been loaded. ---*/ counter++; @@ -8990,8 +8594,7 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { config->SetAoA_Sens(Restart_Meta[4]); } else { - - filename = config->GetFilename(filename, ".csv", nTimeIter-1); + filename = config->GetFilename(filename, ".csv", nTimeIter - 1); /*--- First, check that this is not a binary restart file. ---*/ @@ -9003,8 +8606,8 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- Serial binary input. ---*/ - FILE *fhw; - fhw = fopen(fname,"rb"); + FILE* fhw; + fhw = fopen(fname, "rb"); size_t ret; /*--- Error check for opening the file. ---*/ @@ -9025,9 +8628,10 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { if (magic_number == 535532) { SU2_MPI::Error(string("File ") + string(fname) + string(" is a binary SU2 restart file, expected ASCII.\n") + - string("SU2 reads/writes binary restart files by default.\n") + - string("Note that backward compatibility for ASCII restart files is\n") + - string("possible with the READ_BINARY_RESTART option."), CURRENT_FUNCTION); + string("SU2 reads/writes binary restart files by default.\n") + + string("Note that backward compatibility for ASCII restart files is\n") + + string("possible with the READ_BINARY_RESTART option."), + CURRENT_FUNCTION); } fclose(fhw); @@ -9051,8 +8655,7 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { /*--- Have the master attempt to read the magic number. ---*/ - if (rank == MASTER_NODE) - MPI_File_read(fhw, &magic_number, 1, MPI_INT, MPI_STATUS_IGNORE); + if (rank == MASTER_NODE) MPI_File_read(fhw, &magic_number, 1, MPI_INT, MPI_STATUS_IGNORE); /*--- Broadcast the number of variables to all procs and store clearly. ---*/ @@ -9062,93 +8665,86 @@ void CPhysicalGeometry::SetSensitivity(CConfig *config) { have the hex representation of "SU2" as the first int in the file. ---*/ if (magic_number == 535532) { - SU2_MPI::Error(string("File ") + string(fname) + string(" is a binary SU2 restart file, expected ASCII.\n") + - string("SU2 reads/writes binary restart files by default.\n") + - string("Note that backward compatibility for ASCII restart files is\n") + - string("possible with the READ_BINARY_RESTART option."), CURRENT_FUNCTION); + string("SU2 reads/writes binary restart files by default.\n") + + string("Note that backward compatibility for ASCII restart files is\n") + + string("possible with the READ_BINARY_RESTART option."), + CURRENT_FUNCTION); } MPI_File_close(&fhw); #endif - restart_file.open(filename.data(), ios::in); - if (restart_file.fail()) { - SU2_MPI::Error(string("There is no adjoint restart file ") + filename, CURRENT_FUNCTION); - } - - /*--- The first line is the header ---*/ - - getline (restart_file, text_line); + restart_file.open(filename.data(), ios::in); + if (restart_file.fail()) { + SU2_MPI::Error(string("There is no adjoint restart file ") + filename, CURRENT_FUNCTION); + } - vector fields = PrintingToolbox::split(text_line, ','); + /*--- The first line is the header ---*/ - for (unsigned short iField = 0; iField < fields.size(); iField++){ - PrintingToolbox::trim(fields[iField]); - } + getline(restart_file, text_line); - std::vector::iterator itx = std::find(fields.begin(), fields.end(), "\"Sensitivity_x\""); - std::vector::iterator ity = std::find(fields.begin(), fields.end(), "\"Sensitivity_y\""); - std::vector::iterator itz = std::find(fields.begin(), fields.end(), "\"Sensitivity_z\""); + vector fields = PrintingToolbox::split(text_line, ','); - if (itx == fields.end()){ - SU2_MPI::Error("Sensitivity x not found in file.", CURRENT_FUNCTION); - } - if (ity ==fields.end()){ - SU2_MPI::Error("Sensitivity y not found in file.", CURRENT_FUNCTION); - } - if (nDim == 3){ - if (itz == fields.end()){ - SU2_MPI::Error("Sensitivity z not found in file.", CURRENT_FUNCTION); + for (unsigned short iField = 0; iField < fields.size(); iField++) { + PrintingToolbox::trim(fields[iField]); } - } - unsigned short sens_x_idx = std::distance(fields.begin(), itx); - unsigned short sens_y_idx = std::distance(fields.begin(), ity); - unsigned short sens_z_idx = 0; - if (nDim == 3) - sens_z_idx = std::distance(fields.begin(), itz); + auto itx = std::find(fields.begin(), fields.end(), "\"Sensitivity_x\""); + auto ity = std::find(fields.begin(), fields.end(), "\"Sensitivity_y\""); + auto itz = std::find(fields.begin(), fields.end(), "\"Sensitivity_z\""); + if (itx == fields.end()) { + SU2_MPI::Error("Sensitivity x not found in file.", CURRENT_FUNCTION); + } + if (ity == fields.end()) { + SU2_MPI::Error("Sensitivity y not found in file.", CURRENT_FUNCTION); + } + if (nDim == 3) { + if (itz == fields.end()) { + SU2_MPI::Error("Sensitivity z not found in file.", CURRENT_FUNCTION); + } + } - for (iPoint_Global = 0; iPoint_Global < GetGlobal_nPointDomain(); iPoint_Global++ ) { + unsigned short sens_x_idx = std::distance(fields.begin(), itx); + unsigned short sens_y_idx = std::distance(fields.begin(), ity); + unsigned short sens_z_idx = 0; + if (nDim == 3) sens_z_idx = std::distance(fields.begin(), itz); - getline (restart_file, text_line); + for (iPoint_Global = 0; iPoint_Global < GetGlobal_nPointDomain(); iPoint_Global++) { + getline(restart_file, text_line); - vector point_line = PrintingToolbox::split(text_line, ','); + vector point_line = PrintingToolbox::split(text_line, ','); - /*--- Retrieve local index. If this node from the restart file lives - on the current processor, we will load and instantiate the vars. ---*/ + /*--- Retrieve local index. If this node from the restart file lives + on the current processor, we will load and instantiate the vars. ---*/ - iPoint_Local = GetGlobal_to_Local_Point(iPoint_Global); + iPoint_Local = GetGlobal_to_Local_Point(iPoint_Global); - if (iPoint_Local > -1) { - Sensitivity(iPoint_Local,0) = PrintingToolbox::stod(point_line[sens_x_idx]); - Sensitivity(iPoint_Local,1) = PrintingToolbox::stod(point_line[sens_y_idx]); - if (nDim == 3) - Sensitivity(iPoint_Local,2) = PrintingToolbox::stod(point_line[sens_z_idx]); + if (iPoint_Local > -1) { + Sensitivity(iPoint_Local, 0) = PrintingToolbox::stod(point_line[sens_x_idx]); + Sensitivity(iPoint_Local, 1) = PrintingToolbox::stod(point_line[sens_y_idx]); + if (nDim == 3) Sensitivity(iPoint_Local, 2) = PrintingToolbox::stod(point_line[sens_z_idx]); + } } - } - - /*--- Read AoA sensitivity ---*/ + /*--- Read AoA sensitivity ---*/ - while (getline (restart_file, text_line)) { - position = text_line.find ("SENS_AOA=",0); - if (position != string::npos) { - text_line.erase (0,9); AoASens = atof(text_line.c_str()); - config->SetAoA_Sens(AoASens); + while (getline(restart_file, text_line)) { + position = text_line.find("SENS_AOA=", 0); + if (position != string::npos) { + text_line.erase(0, 9); + AoASens = atof(text_line.c_str()); + config->SetAoA_Sens(AoASens); + } } - } - - restart_file.close(); + restart_file.close(); } - } -void CPhysicalGeometry::ReadUnorderedSensitivity(CConfig *config) { - +void CPhysicalGeometry::ReadUnorderedSensitivity(CConfig* config) { /*--- This routine makes SU2_DOT more interoperable with other packages so that folks can customize their workflows. For example, one may want to compute flow and adjoint with package A, deform the mesh @@ -9168,7 +8764,7 @@ void CPhysicalGeometry::ReadUnorderedSensitivity(CConfig *config) { unsigned long iPoint, pointID; unsigned long unmatched = 0, iPoint_Found = 0, iPoint_Ext = 0; - su2double Coor_External[3] = {0.0,0.0,0.0}, Sens_External[3] = {0.0,0.0,0.0}; + su2double Coor_External[3] = {0.0, 0.0, 0.0}, Sens_External[3] = {0.0, 0.0, 0.0}; su2double dist; int rankID; @@ -9176,26 +8772,24 @@ void CPhysicalGeometry::ReadUnorderedSensitivity(CConfig *config) { ifstream external_file; ofstream sens_file; - if (rank == MASTER_NODE) - cout << "Parsing unordered ASCII volume sensitivity file."<< endl; + if (rank == MASTER_NODE) cout << "Parsing unordered ASCII volume sensitivity file." << endl; /*--- Allocate space for the sensitivity and initialize. ---*/ - Sensitivity.resize(nPoint,nDim) = su2double(0.0); + Sensitivity.resize(nPoint, nDim) = su2double(0.0); /*--- Get the filename for the unordered ASCII sensitivity file input. ---*/ filename = config->GetDV_Unordered_Sens_Filename(); external_file.open(filename.data(), ios::in); if (external_file.fail()) { - SU2_MPI::Error(string("There is no unordered ASCII sensitivity file ") + - filename, CURRENT_FUNCTION); + SU2_MPI::Error(string("There is no unordered ASCII sensitivity file ") + filename, CURRENT_FUNCTION); } /*--- Allocate the vectors to hold boundary node coordinates and its local ID. ---*/ - vector Coords(nDim*nPointDomain); + vector Coords(nDim * nPointDomain); vector PointIDs(nPointDomain); /*--- Retrieve and store the coordinates of owned interior nodes @@ -9203,39 +8797,33 @@ void CPhysicalGeometry::ReadUnorderedSensitivity(CConfig *config) { for (iPoint = 0; iPoint < nPointDomain; iPoint++) { PointIDs[iPoint] = iPoint; - for (iDim = 0; iDim < nDim; iDim++) - Coords[iPoint*nDim + iDim] = nodes->GetCoord(iPoint, iDim); + for (iDim = 0; iDim < nDim; iDim++) Coords[iPoint * nDim + iDim] = nodes->GetCoord(iPoint, iDim); } /*--- Build the ADT of all interior nodes. ---*/ - CADTPointsOnlyClass VertexADT(nDim, nPointDomain, - Coords.data(), PointIDs.data(), true); + CADTPointsOnlyClass VertexADT(nDim, nPointDomain, Coords.data(), PointIDs.data(), true); /*--- Loop over all interior mesh nodes owned by this rank and find the matching point with minimum distance. Once we have the match, store the sensitivities from the file for that node. ---*/ if (VertexADT.IsEmpty()) { - SU2_MPI::Error("No external points given to ADT.", CURRENT_FUNCTION); } else { - /*--- Read the input sensitivity file and locate the point matches using the ADT search, on a line-by-line basis. ---*/ - iPoint_Found = 0; iPoint_Ext = 0; - while (getline (external_file, text_line)) { - + iPoint_Found = 0; + iPoint_Ext = 0; + while (getline(external_file, text_line)) { /*--- First, check that the line has 6 entries, otherwise throw out. ---*/ istringstream point_line(text_line); - vector tokens((istream_iterator(point_line)), - istream_iterator()); + vector tokens((istream_iterator(point_line)), istream_iterator()); if (tokens.size() == 6) { - istringstream point_line(text_line); /*--- Get the coordinates and sensitivity for this line. ---*/ @@ -9246,15 +8834,12 @@ void CPhysicalGeometry::ReadUnorderedSensitivity(CConfig *config) { /*--- Locate the nearest node to this external point. If it is on our rank, then store the sensitivity value. ---*/ - VertexADT.DetermineNearestNode(&Coor_External[0], dist, - pointID, rankID); + VertexADT.DetermineNearestNode(&Coor_External[0], dist, pointID, rankID); if (rankID == rank) { - /*--- Store the sensitivities at the matched local node. ---*/ - for (iDim = 0; iDim < nDim; iDim++) - Sensitivity(pointID,iDim) = Sens_External[iDim]; + for (iDim = 0; iDim < nDim; iDim++) Sensitivity(pointID, iDim) = Sens_External[iDim]; /*--- Keep track of how many points we match. ---*/ @@ -9263,13 +8848,11 @@ void CPhysicalGeometry::ReadUnorderedSensitivity(CConfig *config) { /*--- Keep track of points with poor matches for reporting. ---*/ if (dist > 1e-10) unmatched++; - } /*--- Increment counter for total points in the external file. ---*/ iPoint_Ext++; - } } @@ -9282,56 +8865,60 @@ void CPhysicalGeometry::ReadUnorderedSensitivity(CConfig *config) { if ((iPoint_Ext < GetGlobal_nPointDomain()) && (rank == MASTER_NODE)) { sens_file.open(config->GetDV_Unordered_Sens_Filename().data(), ios::out); sens_file.close(); - SU2_MPI::Error("Not enough points in the input sensitivity file.", - CURRENT_FUNCTION); + SU2_MPI::Error("Not enough points in the input sensitivity file.", CURRENT_FUNCTION); } /*--- Check for points with a poor match and report the count. ---*/ - unsigned long myUnmatched = unmatched; unmatched = 0; - SU2_MPI::Allreduce(&myUnmatched, &unmatched, 1, - MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); + unsigned long myUnmatched = unmatched; + unmatched = 0; + SU2_MPI::Allreduce(&myUnmatched, &unmatched, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); if ((unmatched > 0) && (rank == MASTER_NODE)) { cout << " Warning: there are " << unmatched; cout << " points with a match distance > 1e-10." << endl; } - } - } -void CPhysicalGeometry::Check_Periodicity(CConfig *config) { - +void CPhysicalGeometry::Check_Periodicity(CConfig* config) { /*--- Check for the presence of any periodic BCs and disable multigrid for now if found. ---*/ if ((config->GetnMarker_Periodic() != 0) && (config->GetnMGLevels() > 0)) { - if (rank == MASTER_NODE) - cout << "WARNING: Periodicity has been detected. Disabling multigrid. "<< endl; + if (rank == MASTER_NODE) cout << "WARNING: Periodicity has been detected. Disabling multigrid. " << endl; config->SetMGLevels(0); } - } -su2double CPhysicalGeometry::Compute_MaxThickness(su2double *Plane_P0, su2double *Plane_Normal, CConfig *config, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) { - +su2double CPhysicalGeometry::Compute_MaxThickness(su2double* Plane_P0, su2double* Plane_Normal, CConfig* config, + vector& Xcoord_Airfoil, vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil) { unsigned long iVertex, jVertex, Trailing_Point, Leading_Point; - su2double Normal[3], Tangent[3], BiNormal[3], auxXCoord, auxYCoord, auxZCoord, zp1, zpn, MaxThickness_Value = 0, Thickness, Length, Xcoord_Trailing, Ycoord_Trailing, Zcoord_Trailing, ValCos, ValSin, XValue, ZValue, MaxDistance, Distance, AoA; - vector Xcoord, Ycoord, Zcoord, Xcoord_Normal, Ycoord_Normal, Zcoord_Normal, Xcoord_Airfoil_, Ycoord_Airfoil_, Zcoord_Airfoil_; + su2double Normal[3], Tangent[3], BiNormal[3], auxXCoord, auxYCoord, auxZCoord, zp1, zpn, + MaxThickness_Value = 0, Thickness, Length, Xcoord_Trailing, Ycoord_Trailing, Zcoord_Trailing, ValCos, ValSin, + XValue, ZValue, MaxDistance, Distance, AoA; + vector Xcoord, Ycoord, Zcoord, Xcoord_Normal, Ycoord_Normal, Zcoord_Normal, Xcoord_Airfoil_, + Ycoord_Airfoil_, Zcoord_Airfoil_; /*--- Find the leading and trailing edges and compute the angle of attack ---*/ - MaxDistance = 0.0; Trailing_Point = 0; Leading_Point = 0; + MaxDistance = 0.0; + Trailing_Point = 0; + Leading_Point = 0; for (iVertex = 1; iVertex < Xcoord_Airfoil.size(); iVertex++) { Distance = sqrt(pow(Xcoord_Airfoil[iVertex] - Xcoord_Airfoil[Trailing_Point], 2.0) + pow(Ycoord_Airfoil[iVertex] - Ycoord_Airfoil[Trailing_Point], 2.0) + pow(Zcoord_Airfoil[iVertex] - Zcoord_Airfoil[Trailing_Point], 2.0)); - if (MaxDistance < Distance) { MaxDistance = Distance; Leading_Point = iVertex; } + if (MaxDistance < Distance) { + MaxDistance = Distance; + Leading_Point = iVertex; + } } - AoA = atan((Zcoord_Airfoil[Leading_Point] - Zcoord_Airfoil[Trailing_Point]) / (Xcoord_Airfoil[Trailing_Point] - Xcoord_Airfoil[Leading_Point]))*180/PI_NUMBER; + AoA = atan((Zcoord_Airfoil[Leading_Point] - Zcoord_Airfoil[Trailing_Point]) / + (Xcoord_Airfoil[Trailing_Point] - Xcoord_Airfoil[Leading_Point])) * + 180 / PI_NUMBER; /*--- Translate to the origin ---*/ @@ -9340,74 +8927,85 @@ su2double CPhysicalGeometry::Compute_MaxThickness(su2double *Plane_P0, su2double Zcoord_Trailing = Zcoord_Airfoil[0]; for (iVertex = 0; iVertex < Xcoord_Airfoil.size(); iVertex++) { - Xcoord_Airfoil_.push_back(Xcoord_Airfoil[iVertex] - Xcoord_Trailing); - Ycoord_Airfoil_.push_back(Ycoord_Airfoil[iVertex] - Ycoord_Trailing); - Zcoord_Airfoil_.push_back(Zcoord_Airfoil[iVertex] - Zcoord_Trailing); + Xcoord_Airfoil_.emplace_back(Xcoord_Airfoil[iVertex] - Xcoord_Trailing); + Ycoord_Airfoil_.emplace_back(Ycoord_Airfoil[iVertex] - Ycoord_Trailing); + Zcoord_Airfoil_.emplace_back(Zcoord_Airfoil[iVertex] - Zcoord_Trailing); } /*--- Rotate the airfoil ---*/ - ValCos = cos(AoA*PI_NUMBER/180.0); - ValSin = sin(AoA*PI_NUMBER/180.0); + ValCos = cos(AoA * PI_NUMBER / 180.0); + ValSin = sin(AoA * PI_NUMBER / 180.0); for (iVertex = 0; iVertex < Xcoord_Airfoil.size(); iVertex++) { XValue = Xcoord_Airfoil_[iVertex]; ZValue = Zcoord_Airfoil_[iVertex]; - Xcoord_Airfoil_[iVertex] = XValue*ValCos - ZValue*ValSin; - Zcoord_Airfoil_[iVertex] = ZValue*ValCos + XValue*ValSin; + Xcoord_Airfoil_[iVertex] = XValue * ValCos - ZValue * ValSin; + Zcoord_Airfoil_[iVertex] = ZValue * ValCos + XValue * ValSin; } /*--- Identify upper and lower side, and store the value of the normal --*/ for (iVertex = 1; iVertex < Xcoord_Airfoil_.size(); iVertex++) { - Tangent[0] = Xcoord_Airfoil_[iVertex] - Xcoord_Airfoil_[iVertex-1]; - Tangent[1] = Ycoord_Airfoil_[iVertex] - Ycoord_Airfoil_[iVertex-1]; - Tangent[2] = Zcoord_Airfoil_[iVertex] - Zcoord_Airfoil_[iVertex-1]; + Tangent[0] = Xcoord_Airfoil_[iVertex] - Xcoord_Airfoil_[iVertex - 1]; + Tangent[1] = Ycoord_Airfoil_[iVertex] - Ycoord_Airfoil_[iVertex - 1]; + Tangent[2] = Zcoord_Airfoil_[iVertex] - Zcoord_Airfoil_[iVertex - 1]; Length = sqrt(pow(Tangent[0], 2.0) + pow(Tangent[1], 2.0) + pow(Tangent[2], 2.0)); - Tangent[0] /= Length; Tangent[1] /= Length; Tangent[2] /= Length; + Tangent[0] /= Length; + Tangent[1] /= Length; + Tangent[2] /= Length; BiNormal[0] = Plane_Normal[0]; BiNormal[1] = Plane_Normal[1]; BiNormal[2] = Plane_Normal[2]; Length = sqrt(pow(BiNormal[0], 2.0) + pow(BiNormal[1], 2.0) + pow(BiNormal[2], 2.0)); - BiNormal[0] /= Length; BiNormal[1] /= Length; BiNormal[2] /= Length; + BiNormal[0] /= Length; + BiNormal[1] /= Length; + BiNormal[2] /= Length; - Normal[0] = Tangent[1]*BiNormal[2] - Tangent[2]*BiNormal[1]; - Normal[1] = Tangent[2]*BiNormal[0] - Tangent[0]*BiNormal[2]; - Normal[2] = Tangent[0]*BiNormal[1] - Tangent[1]*BiNormal[0]; + Normal[0] = Tangent[1] * BiNormal[2] - Tangent[2] * BiNormal[1]; + Normal[1] = Tangent[2] * BiNormal[0] - Tangent[0] * BiNormal[2]; + Normal[2] = Tangent[0] * BiNormal[1] - Tangent[1] * BiNormal[0]; - Xcoord_Normal.push_back(Normal[0]); Ycoord_Normal.push_back(Normal[1]); Zcoord_Normal.push_back(Normal[2]); + Xcoord_Normal.push_back(Normal[0]); + Ycoord_Normal.push_back(Normal[1]); + Zcoord_Normal.push_back(Normal[2]); unsigned short index = 2; /*--- Removing the trailing edge from list of points that we are going to use in the interpolation, to be sure that a blunt trailing edge do not affect the interpolation ---*/ - if ((Normal[index] >= 0.0) && (fabs(Xcoord_Airfoil_[iVertex]) > MaxDistance*0.01)) { + if ((Normal[index] >= 0.0) && (fabs(Xcoord_Airfoil_[iVertex]) > MaxDistance * 0.01)) { Xcoord.push_back(Xcoord_Airfoil_[iVertex]); Ycoord.push_back(Ycoord_Airfoil_[iVertex]); Zcoord.push_back(Zcoord_Airfoil_[iVertex]); } - } /*--- Order the arrays using the X component ---*/ for (iVertex = 0; iVertex < Xcoord.size(); iVertex++) { for (jVertex = 0; jVertex < Xcoord.size() - 1 - iVertex; jVertex++) { - if (Xcoord[jVertex] > Xcoord[jVertex+1]) { - auxXCoord = Xcoord[jVertex]; Xcoord[jVertex] = Xcoord[jVertex+1]; Xcoord[jVertex+1] = auxXCoord; - auxYCoord = Ycoord[jVertex]; Ycoord[jVertex] = Ycoord[jVertex+1]; Ycoord[jVertex+1] = auxYCoord; - auxZCoord = Zcoord[jVertex]; Zcoord[jVertex] = Zcoord[jVertex+1]; Zcoord[jVertex+1] = auxZCoord; + if (Xcoord[jVertex] > Xcoord[jVertex + 1]) { + auxXCoord = Xcoord[jVertex]; + Xcoord[jVertex] = Xcoord[jVertex + 1]; + Xcoord[jVertex + 1] = auxXCoord; + auxYCoord = Ycoord[jVertex]; + Ycoord[jVertex] = Ycoord[jVertex + 1]; + Ycoord[jVertex + 1] = auxYCoord; + auxZCoord = Zcoord[jVertex]; + Zcoord[jVertex] = Zcoord[jVertex + 1]; + Zcoord[jVertex + 1] = auxZCoord; } } } const auto n = Xcoord.size(); if (n > 1) { - zp1 = (Zcoord[1]-Zcoord[0])/(Xcoord[1]-Xcoord[0]); - zpn = (Zcoord[n-1]-Zcoord[n-2])/(Xcoord[n-1]-Xcoord[n-2]); + zp1 = (Zcoord[1] - Zcoord[0]) / (Xcoord[1] - Xcoord[0]); + zpn = (Zcoord[n - 1] - Zcoord[n - 2]) / (Xcoord[n - 1] - Xcoord[n - 2]); CCubicSpline spline(Xcoord, Zcoord, CCubicSpline::FIRST, zp1, CCubicSpline::FIRST, zpn); @@ -9418,33 +9016,34 @@ su2double CPhysicalGeometry::Compute_MaxThickness(su2double *Plane_P0, su2double for (iVertex = 0; iVertex < Xcoord_Airfoil_.size(); iVertex++) { if (Zcoord_Normal[iVertex] < 0.0) { Thickness = fabs(Zcoord_Airfoil_[iVertex] - spline(Xcoord_Airfoil_[iVertex])); - if (Thickness > MaxThickness_Value) { MaxThickness_Value = Thickness; } + if (Thickness > MaxThickness_Value) { + MaxThickness_Value = Thickness; + } } } + } else { + MaxThickness_Value = 0.0; } - else { MaxThickness_Value = 0.0; } return MaxThickness_Value; - } -su2double CPhysicalGeometry::Compute_Dihedral(su2double *LeadingEdge_im1, su2double *TrailingEdge_im1, - su2double *LeadingEdge_i, su2double *TrailingEdge_i) { - - // su2double Dihedral_Leading = atan((LeadingEdge_i[2] - LeadingEdge_im1[2]) / (LeadingEdge_i[1] - LeadingEdge_im1[1]))*180/PI_NUMBER; - su2double Dihedral_Trailing = atan((TrailingEdge_i[2] - TrailingEdge_im1[2]) / (TrailingEdge_i[1] - TrailingEdge_im1[1]))*180/PI_NUMBER; +su2double CPhysicalGeometry::Compute_Dihedral(su2double* LeadingEdge_im1, su2double* TrailingEdge_im1, + su2double* LeadingEdge_i, su2double* TrailingEdge_i) { + // su2double Dihedral_Leading = atan((LeadingEdge_i[2] - LeadingEdge_im1[2]) / (LeadingEdge_i[1] - + // LeadingEdge_im1[1]))*180/PI_NUMBER; + su2double Dihedral_Trailing = + atan((TrailingEdge_i[2] - TrailingEdge_im1[2]) / (TrailingEdge_i[1] - TrailingEdge_im1[1])) * 180 / PI_NUMBER; // su2double Dihedral = 0.5*(Dihedral_Leading + Dihedral_Trailing); return Dihedral_Trailing; - } -su2double CPhysicalGeometry::Compute_Curvature(su2double *LeadingEdge_im1, su2double *TrailingEdge_im1, - su2double *LeadingEdge_i, su2double *TrailingEdge_i, - su2double *LeadingEdge_ip1, su2double *TrailingEdge_ip1) { - - su2double A[2], B[2], C[2], BC[2], AB[2], AC[2], BC_MOD, AB_MOD, AC_MOD, AB_CROSS_AC; +su2double CPhysicalGeometry::Compute_Curvature(su2double* LeadingEdge_im1, su2double* TrailingEdge_im1, + su2double* LeadingEdge_i, su2double* TrailingEdge_i, + su2double* LeadingEdge_ip1, su2double* TrailingEdge_ip1) { + su2double A[2], B[2], C[2], BC[2], AB[2], AC[2], BC_MOD, AB_MOD, AC_MOD, AB_CROSS_AC; // A[0] = LeadingEdge_im1[1]; A[1] = LeadingEdge_im1[2]; // B[0] = LeadingEdge_i[1]; B[1] = LeadingEdge_i[2]; @@ -9460,64 +9059,82 @@ su2double CPhysicalGeometry::Compute_Curvature(su2double *LeadingEdge_im1, su2do // su2double Curvature_Leading = fabs(1.0/(0.5*BC_MOD*AB_MOD*AC_MOD/AB_CROSS_AC)); - A[0] = TrailingEdge_im1[1]; A[1] = TrailingEdge_im1[2]; - B[0] = TrailingEdge_i[1]; B[1] = TrailingEdge_i[2]; - C[0] = TrailingEdge_ip1[1]; C[1] = TrailingEdge_ip1[2]; - - BC[0] = C[0] - B[0]; BC[1] = C[1] - B[1]; - AB[0] = B[0] - A[0]; AB[1] = B[1] - A[1]; - AC[0] = C[0] - A[0]; AC[1] = C[1] - A[1]; - BC_MOD = sqrt(BC[0]*BC[0] + BC[1]*BC[1] ); - AB_MOD = sqrt(AB[0]*AB[0] + AB[1]*AB[1] ); - AC_MOD = sqrt(AC[0]*AC[0] + AC[1]*AC[1] ); - AB_CROSS_AC = AB[0]* AC[1] - AB[1]* AC[0]; - - su2double Curvature_Trailing = fabs(1.0/(0.5*BC_MOD*AB_MOD*AC_MOD/AB_CROSS_AC)); + A[0] = TrailingEdge_im1[1]; + A[1] = TrailingEdge_im1[2]; + B[0] = TrailingEdge_i[1]; + B[1] = TrailingEdge_i[2]; + C[0] = TrailingEdge_ip1[1]; + C[1] = TrailingEdge_ip1[2]; + + BC[0] = C[0] - B[0]; + BC[1] = C[1] - B[1]; + AB[0] = B[0] - A[0]; + AB[1] = B[1] - A[1]; + AC[0] = C[0] - A[0]; + AC[1] = C[1] - A[1]; + BC_MOD = sqrt(BC[0] * BC[0] + BC[1] * BC[1]); + AB_MOD = sqrt(AB[0] * AB[0] + AB[1] * AB[1]); + AC_MOD = sqrt(AC[0] * AC[0] + AC[1] * AC[1]); + AB_CROSS_AC = AB[0] * AC[1] - AB[1] * AC[0]; + + su2double Curvature_Trailing = fabs(1.0 / (0.5 * BC_MOD * AB_MOD * AC_MOD / AB_CROSS_AC)); // su2double Curvature = 0.5*(Curvature_Leading + Curvature_Trailing); return Curvature_Trailing; - } -su2double CPhysicalGeometry::Compute_Twist(su2double *Plane_P0, su2double *Plane_Normal, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) { +su2double CPhysicalGeometry::Compute_Twist(su2double* Plane_P0, su2double* Plane_Normal, + vector& Xcoord_Airfoil, vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil) { unsigned long iVertex, Trailing_Point, Leading_Point; su2double MaxDistance, Distance, Twist = 0.0; /*--- Find the leading and trailing edges and compute the angle of attack ---*/ - MaxDistance = 0.0; Trailing_Point = 0; Leading_Point = 0; + MaxDistance = 0.0; + Trailing_Point = 0; + Leading_Point = 0; for (iVertex = 1; iVertex < Xcoord_Airfoil.size(); iVertex++) { Distance = sqrt(pow(Xcoord_Airfoil[iVertex] - Xcoord_Airfoil[Trailing_Point], 2.0) + pow(Ycoord_Airfoil[iVertex] - Ycoord_Airfoil[Trailing_Point], 2.0) + pow(Zcoord_Airfoil[iVertex] - Zcoord_Airfoil[Trailing_Point], 2.0)); - if (MaxDistance < Distance) { MaxDistance = Distance; Leading_Point = iVertex; } + if (MaxDistance < Distance) { + MaxDistance = Distance; + Leading_Point = iVertex; + } } - Twist = atan((Zcoord_Airfoil[Leading_Point] - Zcoord_Airfoil[Trailing_Point]) / (Xcoord_Airfoil[Trailing_Point] - Xcoord_Airfoil[Leading_Point]))*180/PI_NUMBER; + Twist = atan((Zcoord_Airfoil[Leading_Point] - Zcoord_Airfoil[Trailing_Point]) / + (Xcoord_Airfoil[Trailing_Point] - Xcoord_Airfoil[Leading_Point])) * + 180 / PI_NUMBER; return Twist; - } -void CPhysicalGeometry::Compute_Wing_LeadingTrailing(su2double *LeadingEdge, su2double *TrailingEdge, su2double *Plane_P0, su2double *Plane_Normal, - vector &Xcoord_Airfoil, vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) { - +void CPhysicalGeometry::Compute_Wing_LeadingTrailing(su2double* LeadingEdge, su2double* TrailingEdge, + su2double* Plane_P0, su2double* Plane_Normal, + vector& Xcoord_Airfoil, + vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil) { unsigned long iVertex, Trailing_Point, Leading_Point; su2double MaxDistance, Distance; /*--- Find the leading and trailing edges and compute the angle of attack ---*/ - MaxDistance = 0.0; Trailing_Point = 0; Leading_Point = 0; + MaxDistance = 0.0; + Trailing_Point = 0; + Leading_Point = 0; for (iVertex = 1; iVertex < Xcoord_Airfoil.size(); iVertex++) { - Distance = sqrt(pow(Xcoord_Airfoil[iVertex] - Xcoord_Airfoil[Trailing_Point], 2.0) + pow(Ycoord_Airfoil[iVertex] - Ycoord_Airfoil[Trailing_Point], 2.0) + pow(Zcoord_Airfoil[iVertex] - Zcoord_Airfoil[Trailing_Point], 2.0)); - if (MaxDistance < Distance) { MaxDistance = Distance; Leading_Point = iVertex; } + if (MaxDistance < Distance) { + MaxDistance = Distance; + Leading_Point = iVertex; + } } LeadingEdge[0] = Xcoord_Airfoil[Leading_Point]; @@ -9527,84 +9144,101 @@ void CPhysicalGeometry::Compute_Wing_LeadingTrailing(su2double *LeadingEdge, su2 TrailingEdge[0] = Xcoord_Airfoil[Trailing_Point]; TrailingEdge[1] = Ycoord_Airfoil[Trailing_Point]; TrailingEdge[2] = Zcoord_Airfoil[Trailing_Point]; - } -void CPhysicalGeometry::Compute_Fuselage_LeadingTrailing(su2double *LeadingEdge, su2double *TrailingEdge, su2double *Plane_P0, su2double *Plane_Normal, - vector &Xcoord_Airfoil, vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) { - +void CPhysicalGeometry::Compute_Fuselage_LeadingTrailing(su2double* LeadingEdge, su2double* TrailingEdge, + su2double* Plane_P0, su2double* Plane_Normal, + vector& Xcoord_Airfoil, + vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil) { unsigned long iVertex, Trailing_Point, Leading_Point; su2double MaxDistance, Distance; - MaxDistance = 0.0; Trailing_Point = 0; Leading_Point = 0; + MaxDistance = 0.0; + Trailing_Point = 0; + Leading_Point = 0; for (iVertex = 1; iVertex < Xcoord_Airfoil.size(); iVertex++) { Distance = sqrt(pow(Xcoord_Airfoil[iVertex] - Xcoord_Airfoil[Trailing_Point], 2.0)); - if (MaxDistance < Distance) { MaxDistance = Distance; Leading_Point = iVertex; } + if (MaxDistance < Distance) { + MaxDistance = Distance; + Leading_Point = iVertex; + } } LeadingEdge[0] = Xcoord_Airfoil[Leading_Point]; LeadingEdge[1] = Ycoord_Airfoil[Leading_Point]; LeadingEdge[2] = Zcoord_Airfoil[Leading_Point]; - MaxDistance = 0.0; Trailing_Point = 0; Leading_Point = 0; + MaxDistance = 0.0; + Trailing_Point = 0; + Leading_Point = 0; for (iVertex = 1; iVertex < Zcoord_Airfoil.size(); iVertex++) { Distance = sqrt(pow(Zcoord_Airfoil[iVertex] - Zcoord_Airfoil[Trailing_Point], 2.0)); - if (MaxDistance < Distance) { MaxDistance = Distance; Leading_Point = iVertex; } + if (MaxDistance < Distance) { + MaxDistance = Distance; + Leading_Point = iVertex; + } } - TrailingEdge[0] = 0.5*(Xcoord_Airfoil[Trailing_Point]+Xcoord_Airfoil[Leading_Point]); - TrailingEdge[1] = 0.5*(Ycoord_Airfoil[Trailing_Point]+Ycoord_Airfoil[Leading_Point]); - TrailingEdge[2] = 0.5*(Zcoord_Airfoil[Trailing_Point]+Zcoord_Airfoil[Leading_Point]); - + TrailingEdge[0] = 0.5 * (Xcoord_Airfoil[Trailing_Point] + Xcoord_Airfoil[Leading_Point]); + TrailingEdge[1] = 0.5 * (Ycoord_Airfoil[Trailing_Point] + Ycoord_Airfoil[Leading_Point]); + TrailingEdge[2] = 0.5 * (Zcoord_Airfoil[Trailing_Point] + Zcoord_Airfoil[Leading_Point]); } -su2double CPhysicalGeometry::Compute_Chord(su2double *Plane_P0, su2double *Plane_Normal, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) { +su2double CPhysicalGeometry::Compute_Chord(su2double* Plane_P0, su2double* Plane_Normal, + vector& Xcoord_Airfoil, vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil) { unsigned long iVertex, Trailing_Point; su2double MaxDistance, Distance, Chord = 0.0; /*--- Find the leading and trailing edges and compute the angle of attack ---*/ - MaxDistance = 0.0; Trailing_Point = 0; + MaxDistance = 0.0; + Trailing_Point = 0; for (iVertex = 1; iVertex < Xcoord_Airfoil.size(); iVertex++) { - Distance = sqrt(pow(Xcoord_Airfoil[iVertex] - Xcoord_Airfoil[Trailing_Point], 2.0) + pow(Ycoord_Airfoil[iVertex] - Ycoord_Airfoil[Trailing_Point], 2.0) + pow(Zcoord_Airfoil[iVertex] - Zcoord_Airfoil[Trailing_Point], 2.0)); - if (MaxDistance < Distance) { MaxDistance = Distance; } + if (MaxDistance < Distance) { + MaxDistance = Distance; + } } Chord = MaxDistance; return Chord; - } -su2double CPhysicalGeometry::Compute_Width(su2double *Plane_P0, su2double *Plane_Normal, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) { - +su2double CPhysicalGeometry::Compute_Width(su2double* Plane_P0, su2double* Plane_Normal, + vector& Xcoord_Airfoil, vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil) { unsigned long iVertex, Trailing_Point; su2double MaxDistance, Distance, Width = 0.0; - MaxDistance = 0.0; Trailing_Point = 0; + MaxDistance = 0.0; + Trailing_Point = 0; for (iVertex = 1; iVertex < Xcoord_Airfoil.size(); iVertex++) { Distance = fabs(Xcoord_Airfoil[iVertex] - Xcoord_Airfoil[Trailing_Point]); - if (MaxDistance < Distance) { MaxDistance = Distance; } + if (MaxDistance < Distance) { + MaxDistance = Distance; + } } Width = MaxDistance; return Width; - } -su2double CPhysicalGeometry::Compute_WaterLineWidth(su2double *Plane_P0, su2double *Plane_Normal, CConfig *config, - vector &Xcoord_Airfoil, vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) { - +su2double CPhysicalGeometry::Compute_WaterLineWidth(su2double* Plane_P0, su2double* Plane_Normal, CConfig* config, + vector& Xcoord_Airfoil, + vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil) { unsigned long iVertex, Trailing_Point; su2double MinDistance, Distance, WaterLineWidth = 0.0; su2double WaterLine = config->GetGeo_Waterline_Location(); - MinDistance = 1E10; WaterLineWidth = 0; Trailing_Point = 0; + MinDistance = 1E10; + WaterLineWidth = 0; + Trailing_Point = 0; for (iVertex = 0; iVertex < Xcoord_Airfoil.size(); iVertex++) { Distance = fabs(Zcoord_Airfoil[iVertex] - WaterLine); if (Distance < MinDistance) { @@ -9614,91 +9248,119 @@ su2double CPhysicalGeometry::Compute_WaterLineWidth(su2double *Plane_P0, su2doub } return WaterLineWidth; - } -su2double CPhysicalGeometry::Compute_Height(su2double *Plane_P0, su2double *Plane_Normal, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) { - +su2double CPhysicalGeometry::Compute_Height(su2double* Plane_P0, su2double* Plane_Normal, + vector& Xcoord_Airfoil, vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil) { unsigned long iVertex, Trailing_Point; su2double MaxDistance, Distance, Height = 0.0; - MaxDistance = 0.0; Trailing_Point = 0; + MaxDistance = 0.0; + Trailing_Point = 0; for (iVertex = 1; iVertex < Zcoord_Airfoil.size(); iVertex++) { Distance = sqrt(pow(Zcoord_Airfoil[iVertex] - Zcoord_Airfoil[Trailing_Point], 2.0)); - if (MaxDistance < Distance) { MaxDistance = Distance; } + if (MaxDistance < Distance) { + MaxDistance = Distance; + } } Height = MaxDistance; return Height; - } -su2double CPhysicalGeometry::Compute_LERadius(su2double *Plane_P0, su2double *Plane_Normal, vector &Xcoord_Airfoil, - vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) { - +su2double CPhysicalGeometry::Compute_LERadius(su2double* Plane_P0, su2double* Plane_Normal, + vector& Xcoord_Airfoil, vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil) { unsigned long iVertex, Trailing_Point, Leading_Point; su2double MaxDistance, Distance, LERadius = 0.0, X1, X2, X3, Y1, Y2, Y3, Ma, Mb, Xc, Yc, Radius; /*--- Find the leading and trailing edges and compute the radius of curvature ---*/ - MaxDistance = 0.0; Trailing_Point = 0; Leading_Point = 0; + MaxDistance = 0.0; + Trailing_Point = 0; + Leading_Point = 0; for (iVertex = 1; iVertex < Xcoord_Airfoil.size(); iVertex++) { - Distance = sqrt(pow(Xcoord_Airfoil[iVertex] - Xcoord_Airfoil[Trailing_Point], 2.0) + pow(Ycoord_Airfoil[iVertex] - Ycoord_Airfoil[Trailing_Point], 2.0) + pow(Zcoord_Airfoil[iVertex] - Zcoord_Airfoil[Trailing_Point], 2.0)); - if (MaxDistance < Distance) { MaxDistance = Distance; Leading_Point = iVertex; } + if (MaxDistance < Distance) { + MaxDistance = Distance; + Leading_Point = iVertex; + } } - X1 = Xcoord_Airfoil[Leading_Point-3]; - Y1 = Zcoord_Airfoil[Leading_Point-3]; + X1 = Xcoord_Airfoil[Leading_Point - 3]; + Y1 = Zcoord_Airfoil[Leading_Point - 3]; X2 = Xcoord_Airfoil[Leading_Point]; Y2 = Zcoord_Airfoil[Leading_Point]; - X3 = Xcoord_Airfoil[Leading_Point+3]; - Y3 = Zcoord_Airfoil[Leading_Point+3]; + X3 = Xcoord_Airfoil[Leading_Point + 3]; + Y3 = Zcoord_Airfoil[Leading_Point + 3]; - if (X2 != X1) Ma = (Y2-Y1) / (X2-X1); else Ma = 0.0; - if (X3 != X2) Mb = (Y3-Y2) / (X3-X2); else Mb = 0.0; + if (X2 != X1) + Ma = (Y2 - Y1) / (X2 - X1); + else + Ma = 0.0; + if (X3 != X2) + Mb = (Y3 - Y2) / (X3 - X2); + else + Mb = 0.0; - if (Mb != Ma) Xc = (Ma*Mb*(Y1-Y3)+Mb*(X1+X2)-Ma*(X2+X3))/(2.0*(Mb-Ma)); else Xc = 0.0; - if (Ma != 0.0) Yc = -(1.0/Ma)*(Xc-0.5*(X1+X2))+0.5*(Y1+Y2); else Yc = 0.0; + if (Mb != Ma) + Xc = (Ma * Mb * (Y1 - Y3) + Mb * (X1 + X2) - Ma * (X2 + X3)) / (2.0 * (Mb - Ma)); + else + Xc = 0.0; + if (Ma != 0.0) + Yc = -(1.0 / Ma) * (Xc - 0.5 * (X1 + X2)) + 0.5 * (Y1 + Y2); + else + Yc = 0.0; - Radius = sqrt((Xc-X1)*(Xc-X1)+(Yc-Y1)*(Yc-Y1)); - if (Radius != 0.0) LERadius = 1.0/Radius; else LERadius = 0.0; + Radius = sqrt((Xc - X1) * (Xc - X1) + (Yc - Y1) * (Yc - Y1)); + if (Radius != 0.0) + LERadius = 1.0 / Radius; + else + LERadius = 0.0; return LERadius; - } -su2double CPhysicalGeometry::Compute_Thickness(su2double *Plane_P0, su2double *Plane_Normal, su2double Location, CConfig *config, - vector &Xcoord_Airfoil, vector &Ycoord_Airfoil, vector &Zcoord_Airfoil, su2double &ZLoc) { - +su2double CPhysicalGeometry::Compute_Thickness(su2double* Plane_P0, su2double* Plane_Normal, su2double Location, + CConfig* config, vector& Xcoord_Airfoil, + vector& Ycoord_Airfoil, vector& Zcoord_Airfoil, + su2double& ZLoc) { unsigned long iVertex, jVertex, n_Upper, n_Lower, Trailing_Point, Leading_Point; - su2double Thickness_Location, Normal[3], Tangent[3], BiNormal[3], auxXCoord, auxYCoord, auxZCoord, Thickness_Value = 0.0, Length, - Xcoord_Trailing, Ycoord_Trailing, Zcoord_Trailing, ValCos, ValSin, XValue, ZValue, zp1, zpn, Chord, MaxDistance, Distance, AoA; + su2double Thickness_Location, Normal[3], Tangent[3], BiNormal[3], auxXCoord, auxYCoord, auxZCoord, + Thickness_Value = 0.0, Length, Xcoord_Trailing, Ycoord_Trailing, Zcoord_Trailing, ValCos, ValSin, XValue, ZValue, + zp1, zpn, Chord, MaxDistance, Distance, AoA; - vector Xcoord_Upper, Ycoord_Upper, Zcoord_Upper, Xcoord_Lower, Ycoord_Lower, Zcoord_Lower, - Xcoord_Normal, Ycoord_Normal, Zcoord_Normal, Xcoord_Airfoil_, Ycoord_Airfoil_, Zcoord_Airfoil_; + vector Xcoord_Upper, Ycoord_Upper, Zcoord_Upper, Xcoord_Lower, Ycoord_Lower, Zcoord_Lower, Xcoord_Normal, + Ycoord_Normal, Zcoord_Normal, Xcoord_Airfoil_, Ycoord_Airfoil_, Zcoord_Airfoil_; su2double Zcoord_Up, Zcoord_Down, ZLoc_, YLoc_; /*--- Find the leading and trailing edges and compute the angle of attack ---*/ - MaxDistance = 0.0; Trailing_Point = 0; Leading_Point = 0; + MaxDistance = 0.0; + Trailing_Point = 0; + Leading_Point = 0; for (iVertex = 1; iVertex < Xcoord_Airfoil.size(); iVertex++) { Distance = sqrt(pow(Xcoord_Airfoil[iVertex] - Xcoord_Airfoil[Trailing_Point], 2.0) + pow(Ycoord_Airfoil[iVertex] - Ycoord_Airfoil[Trailing_Point], 2.0) + pow(Zcoord_Airfoil[iVertex] - Zcoord_Airfoil[Trailing_Point], 2.0)); - if (MaxDistance < Distance) { MaxDistance = Distance; Leading_Point = iVertex; } + if (MaxDistance < Distance) { + MaxDistance = Distance; + Leading_Point = iVertex; + } } - AoA = atan((Zcoord_Airfoil[Leading_Point] - Zcoord_Airfoil[Trailing_Point]) / (Xcoord_Airfoil[Trailing_Point] - Xcoord_Airfoil[Leading_Point]))*180/PI_NUMBER; + AoA = atan((Zcoord_Airfoil[Leading_Point] - Zcoord_Airfoil[Trailing_Point]) / + (Xcoord_Airfoil[Trailing_Point] - Xcoord_Airfoil[Leading_Point])) * + 180 / PI_NUMBER; Chord = MaxDistance; /*--- Translate to the origin ---*/ @@ -9708,44 +9370,50 @@ su2double CPhysicalGeometry::Compute_Thickness(su2double *Plane_P0, su2double *P Zcoord_Trailing = Zcoord_Airfoil[0]; for (iVertex = 0; iVertex < Xcoord_Airfoil.size(); iVertex++) { - Xcoord_Airfoil_.push_back(Xcoord_Airfoil[iVertex] - Xcoord_Trailing); - Ycoord_Airfoil_.push_back(Ycoord_Airfoil[iVertex] - Ycoord_Trailing); - Zcoord_Airfoil_.push_back(Zcoord_Airfoil[iVertex] - Zcoord_Trailing); + Xcoord_Airfoil_.emplace_back(Xcoord_Airfoil[iVertex] - Xcoord_Trailing); + Ycoord_Airfoil_.emplace_back(Ycoord_Airfoil[iVertex] - Ycoord_Trailing); + Zcoord_Airfoil_.emplace_back(Zcoord_Airfoil[iVertex] - Zcoord_Trailing); } /*--- Rotate the airfoil ---*/ - ValCos = cos(AoA*PI_NUMBER/180.0); - ValSin = sin(AoA*PI_NUMBER/180.0); + ValCos = cos(AoA * PI_NUMBER / 180.0); + ValSin = sin(AoA * PI_NUMBER / 180.0); for (iVertex = 0; iVertex < Xcoord_Airfoil.size(); iVertex++) { XValue = Xcoord_Airfoil_[iVertex]; ZValue = Zcoord_Airfoil_[iVertex]; - Xcoord_Airfoil_[iVertex] = XValue*ValCos - ZValue*ValSin; - Zcoord_Airfoil_[iVertex] = ZValue*ValCos + XValue*ValSin; + Xcoord_Airfoil_[iVertex] = XValue * ValCos - ZValue * ValSin; + Zcoord_Airfoil_[iVertex] = ZValue * ValCos + XValue * ValSin; } /*--- Identify upper and lower side, and store the value of the normal --*/ for (iVertex = 1; iVertex < Xcoord_Airfoil_.size(); iVertex++) { - Tangent[0] = Xcoord_Airfoil_[iVertex] - Xcoord_Airfoil_[iVertex-1]; - Tangent[1] = Ycoord_Airfoil_[iVertex] - Ycoord_Airfoil_[iVertex-1]; - Tangent[2] = Zcoord_Airfoil_[iVertex] - Zcoord_Airfoil_[iVertex-1]; + Tangent[0] = Xcoord_Airfoil_[iVertex] - Xcoord_Airfoil_[iVertex - 1]; + Tangent[1] = Ycoord_Airfoil_[iVertex] - Ycoord_Airfoil_[iVertex - 1]; + Tangent[2] = Zcoord_Airfoil_[iVertex] - Zcoord_Airfoil_[iVertex - 1]; Length = sqrt(pow(Tangent[0], 2.0) + pow(Tangent[1], 2.0) + pow(Tangent[2], 2.0)); - Tangent[0] /= Length; Tangent[1] /= Length; Tangent[2] /= Length; + Tangent[0] /= Length; + Tangent[1] /= Length; + Tangent[2] /= Length; BiNormal[0] = Plane_Normal[0]; BiNormal[1] = Plane_Normal[1]; BiNormal[2] = Plane_Normal[2]; Length = sqrt(pow(BiNormal[0], 2.0) + pow(BiNormal[1], 2.0) + pow(BiNormal[2], 2.0)); - BiNormal[0] /= Length; BiNormal[1] /= Length; BiNormal[2] /= Length; + BiNormal[0] /= Length; + BiNormal[1] /= Length; + BiNormal[2] /= Length; - Normal[0] = Tangent[1]*BiNormal[2] - Tangent[2]*BiNormal[1]; - Normal[1] = Tangent[2]*BiNormal[0] - Tangent[0]*BiNormal[2]; - Normal[2] = Tangent[0]*BiNormal[1] - Tangent[1]*BiNormal[0]; + Normal[0] = Tangent[1] * BiNormal[2] - Tangent[2] * BiNormal[1]; + Normal[1] = Tangent[2] * BiNormal[0] - Tangent[0] * BiNormal[2]; + Normal[2] = Tangent[0] * BiNormal[1] - Tangent[1] * BiNormal[0]; - Xcoord_Normal.push_back(Normal[0]); Ycoord_Normal.push_back(Normal[1]); Zcoord_Normal.push_back(Normal[2]); + Xcoord_Normal.push_back(Normal[0]); + Ycoord_Normal.push_back(Normal[1]); + Zcoord_Normal.push_back(Normal[2]); unsigned short index = 2; @@ -9753,23 +9421,27 @@ su2double CPhysicalGeometry::Compute_Thickness(su2double *Plane_P0, su2double *P Xcoord_Upper.push_back(Xcoord_Airfoil_[iVertex]); Ycoord_Upper.push_back(Ycoord_Airfoil_[iVertex]); Zcoord_Upper.push_back(Zcoord_Airfoil_[iVertex]); - } - else { + } else { Xcoord_Lower.push_back(Xcoord_Airfoil_[iVertex]); Ycoord_Lower.push_back(Ycoord_Airfoil_[iVertex]); Zcoord_Lower.push_back(Zcoord_Airfoil_[iVertex]); } - } /*--- Order the arrays using the X component ---*/ for (iVertex = 0; iVertex < Xcoord_Upper.size(); iVertex++) { for (jVertex = 0; jVertex < Xcoord_Upper.size() - 1 - iVertex; jVertex++) { - if (Xcoord_Upper[jVertex] > Xcoord_Upper[jVertex+1]) { - auxXCoord = Xcoord_Upper[jVertex]; Xcoord_Upper[jVertex] = Xcoord_Upper[jVertex+1]; Xcoord_Upper[jVertex+1] = auxXCoord; - auxYCoord = Ycoord_Upper[jVertex]; Ycoord_Upper[jVertex] = Ycoord_Upper[jVertex+1]; Ycoord_Upper[jVertex+1] = auxYCoord; - auxZCoord = Zcoord_Upper[jVertex]; Zcoord_Upper[jVertex] = Zcoord_Upper[jVertex+1]; Zcoord_Upper[jVertex+1] = auxZCoord; + if (Xcoord_Upper[jVertex] > Xcoord_Upper[jVertex + 1]) { + auxXCoord = Xcoord_Upper[jVertex]; + Xcoord_Upper[jVertex] = Xcoord_Upper[jVertex + 1]; + Xcoord_Upper[jVertex + 1] = auxXCoord; + auxYCoord = Ycoord_Upper[jVertex]; + Ycoord_Upper[jVertex] = Ycoord_Upper[jVertex + 1]; + Ycoord_Upper[jVertex + 1] = auxYCoord; + auxZCoord = Zcoord_Upper[jVertex]; + Zcoord_Upper[jVertex] = Zcoord_Upper[jVertex + 1]; + Zcoord_Upper[jVertex + 1] = auxZCoord; } } } @@ -9778,10 +9450,16 @@ su2double CPhysicalGeometry::Compute_Thickness(su2double *Plane_P0, su2double *P for (iVertex = 0; iVertex < Xcoord_Lower.size(); iVertex++) { for (jVertex = 0; jVertex < Xcoord_Lower.size() - 1 - iVertex; jVertex++) { - if (Xcoord_Lower[jVertex] > Xcoord_Lower[jVertex+1]) { - auxXCoord = Xcoord_Lower[jVertex]; Xcoord_Lower[jVertex] = Xcoord_Lower[jVertex+1]; Xcoord_Lower[jVertex+1] = auxXCoord; - auxYCoord = Ycoord_Lower[jVertex]; Ycoord_Lower[jVertex] = Ycoord_Lower[jVertex+1]; Ycoord_Lower[jVertex+1] = auxYCoord; - auxZCoord = Zcoord_Lower[jVertex]; Zcoord_Lower[jVertex] = Zcoord_Lower[jVertex+1]; Zcoord_Lower[jVertex+1] = auxZCoord; + if (Xcoord_Lower[jVertex] > Xcoord_Lower[jVertex + 1]) { + auxXCoord = Xcoord_Lower[jVertex]; + Xcoord_Lower[jVertex] = Xcoord_Lower[jVertex + 1]; + Xcoord_Lower[jVertex + 1] = auxXCoord; + auxYCoord = Ycoord_Lower[jVertex]; + Ycoord_Lower[jVertex] = Ycoord_Lower[jVertex + 1]; + Ycoord_Lower[jVertex + 1] = auxYCoord; + auxZCoord = Zcoord_Lower[jVertex]; + Zcoord_Lower[jVertex] = Zcoord_Lower[jVertex + 1]; + Zcoord_Lower[jVertex + 1] = auxZCoord; } } } @@ -9790,45 +9468,47 @@ su2double CPhysicalGeometry::Compute_Thickness(su2double *Plane_P0, su2double *P n_Lower = Xcoord_Lower.size(); if ((n_Upper > 1) && (n_Lower > 1)) { - - zp1 = (Zcoord_Upper[1]-Zcoord_Upper[0])/(Xcoord_Upper[1]-Xcoord_Upper[0]); - zpn = (Zcoord_Upper[n_Upper-1]-Zcoord_Upper[n_Upper-2])/(Xcoord_Upper[n_Upper-1]-Xcoord_Upper[n_Upper-2]); + zp1 = (Zcoord_Upper[1] - Zcoord_Upper[0]) / (Xcoord_Upper[1] - Xcoord_Upper[0]); + zpn = (Zcoord_Upper[n_Upper - 1] - Zcoord_Upper[n_Upper - 2]) / + (Xcoord_Upper[n_Upper - 1] - Xcoord_Upper[n_Upper - 2]); CCubicSpline splineUpper(Xcoord_Upper, Zcoord_Upper, CCubicSpline::FIRST, zp1, CCubicSpline::FIRST, zpn); - zp1 = (Zcoord_Lower[1]-Zcoord_Lower[0])/(Xcoord_Lower[1]-Xcoord_Lower[0]); - zpn = (Zcoord_Lower[n_Lower-1]-Zcoord_Lower[n_Lower-2])/(Xcoord_Lower[n_Lower-1]-Xcoord_Lower[n_Lower-2]); + zp1 = (Zcoord_Lower[1] - Zcoord_Lower[0]) / (Xcoord_Lower[1] - Xcoord_Lower[0]); + zpn = (Zcoord_Lower[n_Lower - 1] - Zcoord_Lower[n_Lower - 2]) / + (Xcoord_Lower[n_Lower - 1] - Xcoord_Lower[n_Lower - 2]); CCubicSpline splineLower(Xcoord_Lower, Zcoord_Lower, CCubicSpline::FIRST, zp1, CCubicSpline::FIRST, zpn); - Thickness_Location = - Chord*(1.0-Location); + Thickness_Location = -Chord * (1.0 - Location); Zcoord_Up = splineUpper(Thickness_Location); Zcoord_Down = splineLower(Thickness_Location); YLoc_ = Thickness_Location; - ZLoc_ = 0.5*(Zcoord_Up + Zcoord_Down); + ZLoc_ = 0.5 * (Zcoord_Up + Zcoord_Down); - ZLoc = sin(-AoA*PI_NUMBER/180.0)*YLoc_ + cos(-AoA*PI_NUMBER/180.0)*ZLoc_ + Zcoord_Trailing; + ZLoc = sin(-AoA * PI_NUMBER / 180.0) * YLoc_ + cos(-AoA * PI_NUMBER / 180.0) * ZLoc_ + Zcoord_Trailing; /*--- Compute the thickness (we add a fabs because we can not guarantee the right sorting of the points and the upper and/or lower part of the airfoil is not well defined) ---*/ Thickness_Value = fabs(Zcoord_Up - Zcoord_Down); + } else { + Thickness_Value = 0.0; } - else { Thickness_Value = 0.0; } return Thickness_Value; - } -su2double CPhysicalGeometry::Compute_Area(su2double *Plane_P0, su2double *Plane_Normal, CConfig *config, - vector &Xcoord_Airfoil, vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) { +su2double CPhysicalGeometry::Compute_Area(su2double* Plane_P0, su2double* Plane_Normal, CConfig* config, + vector& Xcoord_Airfoil, vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil) { unsigned long iVertex; su2double Area_Value = 0.0; - vector Xcoord_Upper, Ycoord_Upper, Zcoord_Upper, Xcoord_Lower, Ycoord_Lower, Zcoord_Lower, Z2coord, Xcoord_Normal, - Ycoord_Normal, Zcoord_Normal, Xcoord_Airfoil_, Ycoord_Airfoil_, Zcoord_Airfoil_; + vector Xcoord_Upper, Ycoord_Upper, Zcoord_Upper, Xcoord_Lower, Ycoord_Lower, Zcoord_Lower, Z2coord, + Xcoord_Normal, Ycoord_Normal, Zcoord_Normal, Xcoord_Airfoil_, Ycoord_Airfoil_, Zcoord_Airfoil_; su2double DeltaZ, DeltaX, X, Z; /*--- Use the Green theorem to evaluate the area (the points have been sortered), @@ -9836,28 +9516,28 @@ su2double CPhysicalGeometry::Compute_Area(su2double *Plane_P0, su2double *Plane_ Area_Value = 0.0; - for (iVertex = 0; iVertex < Xcoord_Airfoil.size()-1; iVertex++) { - X = 0.5*(Xcoord_Airfoil[iVertex]+Xcoord_Airfoil[iVertex+1]); - Z = 0.5*(Zcoord_Airfoil[iVertex]+Zcoord_Airfoil[iVertex+1]); - DeltaX = Xcoord_Airfoil[iVertex+1] - Xcoord_Airfoil[iVertex]; - DeltaZ = Zcoord_Airfoil[iVertex+1] - Zcoord_Airfoil[iVertex]; - Area_Value += 0.5*( X*DeltaZ-Z*DeltaX); + for (iVertex = 0; iVertex < Xcoord_Airfoil.size() - 1; iVertex++) { + X = 0.5 * (Xcoord_Airfoil[iVertex] + Xcoord_Airfoil[iVertex + 1]); + Z = 0.5 * (Zcoord_Airfoil[iVertex] + Zcoord_Airfoil[iVertex + 1]); + DeltaX = Xcoord_Airfoil[iVertex + 1] - Xcoord_Airfoil[iVertex]; + DeltaZ = Zcoord_Airfoil[iVertex + 1] - Zcoord_Airfoil[iVertex]; + Area_Value += 0.5 * (X * DeltaZ - Z * DeltaX); } - X = 0.5*(Xcoord_Airfoil[Xcoord_Airfoil.size()-1]+Xcoord_Airfoil[0]); - Z = 0.5*(Zcoord_Airfoil[Xcoord_Airfoil.size()-1]+Zcoord_Airfoil[0]); - DeltaX = Xcoord_Airfoil[0] - Xcoord_Airfoil[Xcoord_Airfoil.size()-1]; - DeltaZ = Zcoord_Airfoil[0] - Zcoord_Airfoil[Xcoord_Airfoil.size()-1]; - Area_Value += 0.5 * (X*DeltaZ-Z*DeltaX); + X = 0.5 * (Xcoord_Airfoil[Xcoord_Airfoil.size() - 1] + Xcoord_Airfoil[0]); + Z = 0.5 * (Zcoord_Airfoil[Xcoord_Airfoil.size() - 1] + Zcoord_Airfoil[0]); + DeltaX = Xcoord_Airfoil[0] - Xcoord_Airfoil[Xcoord_Airfoil.size() - 1]; + DeltaZ = Zcoord_Airfoil[0] - Zcoord_Airfoil[Xcoord_Airfoil.size() - 1]; + Area_Value += 0.5 * (X * DeltaZ - Z * DeltaX); Area_Value = fabs(Area_Value); return Area_Value; - } -su2double CPhysicalGeometry::Compute_Length(su2double *Plane_P0, su2double *Plane_Normal, CConfig *config, - vector &Xcoord_Airfoil, vector &Ycoord_Airfoil, vector &Zcoord_Airfoil) { +su2double CPhysicalGeometry::Compute_Length(su2double* Plane_P0, su2double* Plane_Normal, CConfig* config, + vector& Xcoord_Airfoil, vector& Ycoord_Airfoil, + vector& Zcoord_Airfoil) { unsigned long iVertex; su2double Length_Value = 0.0, Length_Value_ = 0.0; su2double DeltaZ, DeltaX; @@ -9867,35 +9547,35 @@ su2double CPhysicalGeometry::Compute_Length(su2double *Plane_P0, su2double *Plan both distance and picked the smallest one ---*/ Length_Value = 0.0; - for (iVertex = 0; iVertex < Xcoord_Airfoil.size()-2; iVertex++) { - DeltaX = Xcoord_Airfoil[iVertex+1] - Xcoord_Airfoil[iVertex]; - DeltaZ = Zcoord_Airfoil[iVertex+1] - Zcoord_Airfoil[iVertex]; - Length_Value += sqrt(DeltaX*DeltaX + DeltaZ*DeltaZ); + for (iVertex = 0; iVertex < Xcoord_Airfoil.size() - 2; iVertex++) { + DeltaX = Xcoord_Airfoil[iVertex + 1] - Xcoord_Airfoil[iVertex]; + DeltaZ = Zcoord_Airfoil[iVertex + 1] - Zcoord_Airfoil[iVertex]; + Length_Value += sqrt(DeltaX * DeltaX + DeltaZ * DeltaZ); } Length_Value_ = 0.0; - for (iVertex = 1; iVertex < Xcoord_Airfoil.size()-1; iVertex++) { - DeltaX = Xcoord_Airfoil[iVertex+1] - Xcoord_Airfoil[iVertex]; - DeltaZ = Zcoord_Airfoil[iVertex+1] - Zcoord_Airfoil[iVertex]; - Length_Value_ += sqrt(DeltaX*DeltaX + DeltaZ*DeltaZ); + for (iVertex = 1; iVertex < Xcoord_Airfoil.size() - 1; iVertex++) { + DeltaX = Xcoord_Airfoil[iVertex + 1] - Xcoord_Airfoil[iVertex]; + DeltaZ = Zcoord_Airfoil[iVertex + 1] - Zcoord_Airfoil[iVertex]; + Length_Value_ += sqrt(DeltaX * DeltaX + DeltaZ * DeltaZ); } Length_Value = min(Length_Value, Length_Value_); return Length_Value; - } -void CPhysicalGeometry::Compute_Wing(CConfig *config, bool original_surface, - su2double &Wing_Volume, su2double &Wing_MinMaxThickness, su2double &Wing_MaxMaxThickness, su2double &Wing_MinChord, su2double &Wing_MaxChord, - su2double &Wing_MinLERadius, su2double &Wing_MaxLERadius, - su2double &Wing_MinToC, su2double &Wing_MaxToC, su2double &Wing_ObjFun_MinToC, su2double &Wing_MaxTwist, su2double &Wing_MaxCurvature, - su2double &Wing_MaxDihedral) { - +void CPhysicalGeometry::Compute_Wing(CConfig* config, bool original_surface, su2double& Wing_Volume, + su2double& Wing_MinMaxThickness, su2double& Wing_MaxMaxThickness, + su2double& Wing_MinChord, su2double& Wing_MaxChord, su2double& Wing_MinLERadius, + su2double& Wing_MaxLERadius, su2double& Wing_MinToC, su2double& Wing_MaxToC, + su2double& Wing_ObjFun_MinToC, su2double& Wing_MaxTwist, + su2double& Wing_MaxCurvature, su2double& Wing_MaxDihedral) { unsigned short iPlane, iDim, nPlane = 0; unsigned long iVertex; - su2double MinPlane, MaxPlane, dPlane, *Area, *MaxThickness, *ToC, *Chord, *LERadius, *Twist, *Curvature, *Dihedral, SemiSpan; - vector *Xcoord_Airfoil, *Ycoord_Airfoil, *Zcoord_Airfoil, *Variable_Airfoil; + su2double MinPlane, MaxPlane, dPlane, *Area, *MaxThickness, *ToC, *Chord, *LERadius, *Twist, *Curvature, *Dihedral, + SemiSpan; + vector*Xcoord_Airfoil, *Ycoord_Airfoil, *Zcoord_Airfoil, *Variable_Airfoil; ofstream Wing_File, Section_File; /*--- Make a large number of section cuts for approximating volume ---*/ @@ -9905,160 +9585,173 @@ void CPhysicalGeometry::Compute_Wing(CConfig *config, bool original_surface, /*--- Allocate memory for the section cutting ---*/ - Area = new su2double [nPlane]; - MaxThickness = new su2double [nPlane]; - Chord = new su2double [nPlane]; - LERadius = new su2double [nPlane]; - ToC = new su2double [nPlane]; - Twist = new su2double [nPlane]; - Curvature = new su2double [nPlane]; - Dihedral = new su2double [nPlane]; + Area = new su2double[nPlane]; + MaxThickness = new su2double[nPlane]; + Chord = new su2double[nPlane]; + LERadius = new su2double[nPlane]; + ToC = new su2double[nPlane]; + Twist = new su2double[nPlane]; + Curvature = new su2double[nPlane]; + Dihedral = new su2double[nPlane]; - su2double **LeadingEdge = new su2double*[nPlane]; - for (iPlane = 0; iPlane < nPlane; iPlane++ ) - LeadingEdge[iPlane] = new su2double[nDim]; + auto** LeadingEdge = new su2double*[nPlane]; + for (iPlane = 0; iPlane < nPlane; iPlane++) LeadingEdge[iPlane] = new su2double[nDim]; - su2double **TrailingEdge = new su2double*[nPlane]; - for (iPlane = 0; iPlane < nPlane; iPlane++ ) - TrailingEdge[iPlane] = new su2double[nDim]; + auto** TrailingEdge = new su2double*[nPlane]; + for (iPlane = 0; iPlane < nPlane; iPlane++) TrailingEdge[iPlane] = new su2double[nDim]; - su2double **Plane_P0 = new su2double*[nPlane]; - for (iPlane = 0; iPlane < nPlane; iPlane++ ) - Plane_P0[iPlane] = new su2double[nDim]; + auto** Plane_P0 = new su2double*[nPlane]; + for (iPlane = 0; iPlane < nPlane; iPlane++) Plane_P0[iPlane] = new su2double[nDim]; - su2double **Plane_Normal = new su2double*[nPlane]; - for (iPlane = 0; iPlane < nPlane; iPlane++ ) - Plane_Normal[iPlane] = new su2double[nDim]; + auto** Plane_Normal = new su2double*[nPlane]; + for (iPlane = 0; iPlane < nPlane; iPlane++) Plane_Normal[iPlane] = new su2double[nDim]; - MinPlane = config->GetStations_Bounds(0); MaxPlane = config->GetStations_Bounds(1); - dPlane = fabs((MaxPlane - MinPlane)/su2double(nPlane-1)); + MinPlane = config->GetStations_Bounds(0); + MaxPlane = config->GetStations_Bounds(1); + dPlane = fabs((MaxPlane - MinPlane) / su2double(nPlane - 1)); for (iPlane = 0; iPlane < nPlane; iPlane++) { - Plane_Normal[iPlane][0] = 0.0; Plane_P0[iPlane][0] = 0.0; - Plane_Normal[iPlane][1] = 0.0; Plane_P0[iPlane][1] = 0.0; - Plane_Normal[iPlane][2] = 0.0; Plane_P0[iPlane][2] = 0.0; + Plane_Normal[iPlane][0] = 0.0; + Plane_P0[iPlane][0] = 0.0; + Plane_Normal[iPlane][1] = 0.0; + Plane_P0[iPlane][1] = 0.0; + Plane_Normal[iPlane][2] = 0.0; + Plane_P0[iPlane][2] = 0.0; if (config->GetGeo_Description() == WING) { Plane_Normal[iPlane][1] = 1.0; - Plane_P0[iPlane][1] = MinPlane + iPlane*dPlane; + Plane_P0[iPlane][1] = MinPlane + iPlane * dPlane; } if (config->GetGeo_Description() == TWOD_AIRFOIL) { Plane_Normal[iPlane][2] = 1.0; - Plane_P0[iPlane][2] = MinPlane + iPlane*dPlane; + Plane_P0[iPlane][2] = MinPlane + iPlane * dPlane; } - } /*--- Allocate some vectors for storing airfoil coordinates ---*/ - Xcoord_Airfoil = new vector[nPlane]; - Ycoord_Airfoil = new vector[nPlane]; - Zcoord_Airfoil = new vector[nPlane]; + Xcoord_Airfoil = new vector[nPlane]; + Ycoord_Airfoil = new vector[nPlane]; + Zcoord_Airfoil = new vector[nPlane]; Variable_Airfoil = new vector[nPlane]; /*--- Create the section slices through the geometry ---*/ for (iPlane = 0; iPlane < nPlane; iPlane++) { - - ComputeAirfoil_Section(Plane_P0[iPlane], Plane_Normal[iPlane], - -1E6, 1E6, -1E6, 1E6, -1E6, 1E6, nullptr, Xcoord_Airfoil[iPlane], - Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane], + ComputeAirfoil_Section(Plane_P0[iPlane], Plane_Normal[iPlane], -1E6, 1E6, -1E6, 1E6, -1E6, 1E6, nullptr, + Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane], Variable_Airfoil[iPlane], original_surface, config); - - } + } /*--- Compute airfoil characteristic only in the master node ---*/ if (rank == MASTER_NODE) { - /*--- Write an output file---*/ if (config->GetTabular_FileFormat() == TAB_OUTPUT::TAB_CSV) { Wing_File.open("wing_description.csv", ios::out); if (config->GetSystemMeasurements() == US) - Wing_File << "\"yCoord/SemiSpan\",\"Area (in^2)\",\"Max. Thickness (in)\",\"Chord (in)\",\"Leading Edge Radius (1/in)\",\"Max. Thickness/Chord\",\"Twist (deg)\",\"Curvature (1/in)\",\"Dihedral (deg)\",\"Leading Edge XLoc/SemiSpan\",\"Leading Edge ZLoc/SemiSpan\",\"Trailing Edge XLoc/SemiSpan\",\"Trailing Edge ZLoc/SemiSpan\"" << endl; + Wing_File << "\"yCoord/SemiSpan\",\"Area (in^2)\",\"Max. Thickness (in)\",\"Chord (in)\",\"Leading Edge Radius " + "(1/in)\",\"Max. Thickness/Chord\",\"Twist (deg)\",\"Curvature (1/in)\",\"Dihedral " + "(deg)\",\"Leading Edge XLoc/SemiSpan\",\"Leading Edge ZLoc/SemiSpan\",\"Trailing Edge " + "XLoc/SemiSpan\",\"Trailing Edge ZLoc/SemiSpan\"" + << endl; else - Wing_File << "\"yCoord/SemiSpan\",\"Area (m^2)\",\"Max. Thickness (m)\",\"Chord (m)\",\"Leading Edge Radius (1/m)\",\"Max. Thickness/Chord\",\"Twist (deg)\",\"Curvature (1/in)\",\"Dihedral (deg)\",\"Leading Edge XLoc/SemiSpan\",\"Leading Edge ZLoc/SemiSpan\",\"Trailing Edge XLoc/SemiSpan\",\"Trailing Edge ZLoc/SemiSpan\"" << endl; - } - else { + Wing_File << "\"yCoord/SemiSpan\",\"Area (m^2)\",\"Max. Thickness (m)\",\"Chord (m)\",\"Leading Edge Radius " + "(1/m)\",\"Max. Thickness/Chord\",\"Twist (deg)\",\"Curvature (1/in)\",\"Dihedral " + "(deg)\",\"Leading Edge XLoc/SemiSpan\",\"Leading Edge ZLoc/SemiSpan\",\"Trailing Edge " + "XLoc/SemiSpan\",\"Trailing Edge ZLoc/SemiSpan\"" + << endl; + } else { Wing_File.open("wing_description.dat", ios::out); Wing_File << "TITLE = \"Wing description\"" << endl; if (config->GetSystemMeasurements() == US) - Wing_File << "VARIABLES = \"h\",\"Area (in2)\",\"Max. Thickness (in)\",\"Chord (in)\",\"Leading Edge Radius (1/in)\",\"Max. Thickness/Chord\",\"Twist (deg)\",\"Curvature (1/in)\",\"Dihedral (deg)\",\"Leading Edge XLoc/SemiSpan\",\"Leading Edge ZLoc/SemiSpan\",\"Trailing Edge XLoc/SemiSpan\",\"Trailing Edge ZLoc/SemiSpan\"" << endl; + Wing_File << "VARIABLES = \"h\",\"Area (in2)\",\"Max. Thickness (in)\",\"Chord " + "(in)\",\"Leading Edge Radius (1/in)\",\"Max. Thickness/Chord\",\"Twist (deg)\",\"Curvature " + "(1/in)\",\"Dihedral (deg)\",\"Leading Edge XLoc/SemiSpan\",\"Leading Edge " + "ZLoc/SemiSpan\",\"Trailing Edge XLoc/SemiSpan\",\"Trailing Edge ZLoc/SemiSpan\"" + << endl; else - Wing_File << "VARIABLES = \"h\",\"Area (m2)\",\"Max. Thickness (m)\",\"Chord (m)\",\"Leading Edge Radius (1/m)\",\"Max. Thickness/Chord\",\"Twist (deg)\",\"Curvature (1/m)\",\"Dihedral (deg)\",\"Leading Edge XLoc/SemiSpan\",\"Leading Edge ZLoc/SemiSpan\",\"Trailing Edge XLoc/SemiSpan\",\"Trailing Edge ZLoc/SemiSpan\"" << endl; + Wing_File << "VARIABLES = \"h\",\"Area (m2)\",\"Max. Thickness (m)\",\"Chord " + "(m)\",\"Leading Edge Radius (1/m)\",\"Max. Thickness/Chord\",\"Twist (deg)\",\"Curvature " + "(1/m)\",\"Dihedral (deg)\",\"Leading Edge XLoc/SemiSpan\",\"Leading Edge " + "ZLoc/SemiSpan\",\"Trailing Edge XLoc/SemiSpan\",\"Trailing Edge ZLoc/SemiSpan\"" + << endl; Wing_File << "ZONE T= \"Baseline wing\"" << endl; } - /*--- Evaluate geometrical quatities that do not require any kind of filter, local to each point ---*/ for (iPlane = 0; iPlane < nPlane; iPlane++) { - for (iDim = 0; iDim < nDim; iDim++) { - LeadingEdge[iPlane][iDim] = 0.0; + LeadingEdge[iPlane][iDim] = 0.0; TrailingEdge[iPlane][iDim] = 0.0; } - Area[iPlane] = 0.0; - MaxThickness[iPlane] = 0.0; - Chord[iPlane] = 0.0; - LERadius[iPlane] = 0.0; - ToC[iPlane] = 0.0; - Twist[iPlane] = 0.0; + Area[iPlane] = 0.0; + MaxThickness[iPlane] = 0.0; + Chord[iPlane] = 0.0; + LERadius[iPlane] = 0.0; + ToC[iPlane] = 0.0; + Twist[iPlane] = 0.0; if (Xcoord_Airfoil[iPlane].size() > 1) { + Compute_Wing_LeadingTrailing(LeadingEdge[iPlane], TrailingEdge[iPlane], Plane_P0[iPlane], Plane_Normal[iPlane], + Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Compute_Wing_LeadingTrailing(LeadingEdge[iPlane], TrailingEdge[iPlane], Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + Area[iPlane] = Compute_Area(Plane_P0[iPlane], Plane_Normal[iPlane], config, Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Area[iPlane] = Compute_Area(Plane_P0[iPlane], Plane_Normal[iPlane], config, Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + MaxThickness[iPlane] = + Compute_MaxThickness(Plane_P0[iPlane], Plane_Normal[iPlane], config, Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - MaxThickness[iPlane] = Compute_MaxThickness(Plane_P0[iPlane], Plane_Normal[iPlane], config, Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + Chord[iPlane] = Compute_Chord(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Chord[iPlane] = Compute_Chord(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + Twist[iPlane] = Compute_Twist(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Twist[iPlane] = Compute_Twist(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - - LERadius[iPlane] = Compute_LERadius(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + LERadius[iPlane] = Compute_LERadius(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); ToC[iPlane] = MaxThickness[iPlane] / Chord[iPlane]; - - } - } - /*--- Evaluate geometrical quatities that have been computed using a filtered value (they depend on more than one point) ---*/ + /*--- Evaluate geometrical quatities that have been computed using a filtered value (they depend on more than one + * point) ---*/ for (iPlane = 0; iPlane < nPlane; iPlane++) { - - Curvature[iPlane] = 0.0; - Dihedral[iPlane] = 0.0; + Curvature[iPlane] = 0.0; + Dihedral[iPlane] = 0.0; if (Xcoord_Airfoil[iPlane].size() > 1) { + if ((iPlane == 0) || (iPlane == nPlane - 1)) + Curvature[iPlane] = 0.0; + else + Curvature[iPlane] = + Compute_Curvature(LeadingEdge[iPlane - 1], TrailingEdge[iPlane - 1], LeadingEdge[iPlane], + TrailingEdge[iPlane], LeadingEdge[iPlane + 1], TrailingEdge[iPlane + 1]); - if ((iPlane == 0) || (iPlane == nPlane-1)) Curvature[iPlane] = 0.0; - else Curvature[iPlane] = Compute_Curvature(LeadingEdge[iPlane-1], TrailingEdge[iPlane-1], - LeadingEdge[iPlane], TrailingEdge[iPlane], - LeadingEdge[iPlane+1], TrailingEdge[iPlane+1]); - - if (iPlane == 0) Dihedral[iPlane] = 0.0; - else Dihedral[iPlane] = Compute_Dihedral(LeadingEdge[iPlane-1], TrailingEdge[iPlane-1], - LeadingEdge[iPlane], TrailingEdge[iPlane]); - + if (iPlane == 0) + Dihedral[iPlane] = 0.0; + else + Dihedral[iPlane] = Compute_Dihedral(LeadingEdge[iPlane - 1], TrailingEdge[iPlane - 1], LeadingEdge[iPlane], + TrailingEdge[iPlane]); } - } /*--- Set the curvature and dihedral angles at the extremes ---*/ if (nPlane > 1) { - if ((Xcoord_Airfoil[0].size() != 0) && (Xcoord_Airfoil[1].size() != 0)) { - Curvature[0] = Curvature[1]; Dihedral[0] = Dihedral[1]; + if ((!Xcoord_Airfoil[0].empty()) && (!Xcoord_Airfoil[1].empty())) { + Curvature[0] = Curvature[1]; + Dihedral[0] = Dihedral[1]; } - if ((Xcoord_Airfoil[nPlane-1].size() != 0) && (Xcoord_Airfoil[nPlane-2].size() != 0)) { - Curvature[nPlane-1] = Curvature[nPlane-2]; + if ((!Xcoord_Airfoil[nPlane - 1].empty()) && (!Xcoord_Airfoil[nPlane - 2].empty())) { + Curvature[nPlane - 1] = Curvature[nPlane - 2]; } } @@ -10067,17 +9760,17 @@ void CPhysicalGeometry::Compute_Wing(CConfig *config, bool original_surface, for (iPlane = 0; iPlane < nPlane; iPlane++) { if (Xcoord_Airfoil[iPlane].size() > 1) { if (config->GetTabular_FileFormat() == TAB_OUTPUT::TAB_CSV) { - Wing_File << Ycoord_Airfoil[iPlane][0]/SemiSpan <<", "<< Area[iPlane] <<", "<< MaxThickness[iPlane] <<", "<< Chord[iPlane] <<", "<< LERadius[iPlane] <<", "<< ToC[iPlane] - <<", "<< Twist[iPlane] <<", "<< Curvature[iPlane] <<", "<< Dihedral[iPlane] - <<", "<< LeadingEdge[iPlane][0]/SemiSpan <<", "<< LeadingEdge[iPlane][2]/SemiSpan - <<", "<< TrailingEdge[iPlane][0]/SemiSpan <<", "<< TrailingEdge[iPlane][2]/SemiSpan << endl; - } - else { - Wing_File << Ycoord_Airfoil[iPlane][0]/SemiSpan <<" "<< Area[iPlane] <<" "<< MaxThickness[iPlane] <<" "<< Chord[iPlane] <<" "<< LERadius[iPlane] <<" "<< ToC[iPlane] - <<" "<< Twist[iPlane] <<" "<< Curvature[iPlane] <<" "<< Dihedral[iPlane] - <<" "<< LeadingEdge[iPlane][0]/SemiSpan <<" "<< LeadingEdge[iPlane][2]/SemiSpan - <<" "<< TrailingEdge[iPlane][0]/SemiSpan <<" "<< TrailingEdge[iPlane][2]/SemiSpan << endl; - + Wing_File << Ycoord_Airfoil[iPlane][0] / SemiSpan << ", " << Area[iPlane] << ", " << MaxThickness[iPlane] + << ", " << Chord[iPlane] << ", " << LERadius[iPlane] << ", " << ToC[iPlane] << ", " << Twist[iPlane] + << ", " << Curvature[iPlane] << ", " << Dihedral[iPlane] << ", " + << LeadingEdge[iPlane][0] / SemiSpan << ", " << LeadingEdge[iPlane][2] / SemiSpan << ", " + << TrailingEdge[iPlane][0] / SemiSpan << ", " << TrailingEdge[iPlane][2] / SemiSpan << endl; + } else { + Wing_File << Ycoord_Airfoil[iPlane][0] / SemiSpan << " " << Area[iPlane] << " " << MaxThickness[iPlane] << " " + << Chord[iPlane] << " " << LERadius[iPlane] << " " << ToC[iPlane] << " " << Twist[iPlane] << " " + << Curvature[iPlane] << " " << Dihedral[iPlane] << " " << LeadingEdge[iPlane][0] / SemiSpan << " " + << LeadingEdge[iPlane][2] / SemiSpan << " " << TrailingEdge[iPlane][0] / SemiSpan << " " + << TrailingEdge[iPlane][2] / SemiSpan << endl; } } } @@ -10087,20 +9780,21 @@ void CPhysicalGeometry::Compute_Wing(CConfig *config, bool original_surface, Section_File.open("wing_slices.dat", ios::out); for (iPlane = 0; iPlane < nPlane; iPlane++) { - if (iPlane == 0) { Section_File << "TITLE = \"Aircraft Slices\"" << endl; if (config->GetSystemMeasurements() == US) - Section_File << "VARIABLES = \"x (in)\", \"y (in)\", \"z (in)\", \"x2D/c\", \"y2D/c\"" << endl; - else Section_File << "VARIABLES = \"x (m)\", \"y (m)\", \"z (m)\", \"x2D/c\", \"y2D/c\"" << endl; + Section_File << R"lit(VARIABLES = "x (in)", "y (in)", "z (in)", "x2D/c", "y2D/c")lit" + << endl; + else + Section_File << R"lit(VARIABLES = "x (m)", "y (m)", "z (m)", "x2D/c", "y2D/c")lit" + << endl; } if (Xcoord_Airfoil[iPlane].size() > 1) { - - Section_File << "ZONE T=\"h = " << Ycoord_Airfoil[iPlane][0]/SemiSpan << " \", I= " << Xcoord_Airfoil[iPlane].size() << ", F=POINT" << endl; + Section_File << "ZONE T=\"h = " << Ycoord_Airfoil[iPlane][0] / SemiSpan + << " \", I= " << Xcoord_Airfoil[iPlane].size() << ", F=POINT" << endl; for (iVertex = 0; iVertex < Xcoord_Airfoil[iPlane].size(); iVertex++) { - /*--- Move to the origin ---*/ su2double XValue_ = Xcoord_Airfoil[iPlane][iVertex] - LeadingEdge[iPlane][0]; @@ -10108,37 +9802,44 @@ void CPhysicalGeometry::Compute_Wing(CConfig *config, bool original_surface, /*--- Rotate the airfoil and divide by the chord ---*/ - su2double ValCos = cos(Twist[iPlane]*PI_NUMBER/180.0); - su2double ValSin = sin(Twist[iPlane]*PI_NUMBER/180.0); + su2double ValCos = cos(Twist[iPlane] * PI_NUMBER / 180.0); + su2double ValSin = sin(Twist[iPlane] * PI_NUMBER / 180.0); - su2double XValue = (XValue_*ValCos - ZValue_*ValSin) / Chord[iPlane]; - su2double ZValue = (ZValue_*ValCos + XValue_*ValSin) / Chord[iPlane]; + su2double XValue = (XValue_ * ValCos - ZValue_ * ValSin) / Chord[iPlane]; + su2double ZValue = (ZValue_ * ValCos + XValue_ * ValSin) / Chord[iPlane]; /*--- Write the file ---*/ - Section_File << Xcoord_Airfoil[iPlane][iVertex] << " " << Ycoord_Airfoil[iPlane][iVertex] << " " << Zcoord_Airfoil[iPlane][iVertex] << " " << XValue << " " << ZValue << endl; + Section_File << Xcoord_Airfoil[iPlane][iVertex] << " " << Ycoord_Airfoil[iPlane][iVertex] << " " + << Zcoord_Airfoil[iPlane][iVertex] << " " << XValue << " " << ZValue << endl; } } - } Section_File.close(); - /*--- Compute the wing volume using a composite Simpson's rule ---*/ Wing_Volume = 0.0; - for (iPlane = 0; iPlane < nPlane-2; iPlane+=2) { + for (iPlane = 0; iPlane < nPlane - 2; iPlane += 2) { if (Xcoord_Airfoil[iPlane].size() > 1) { - Wing_Volume += (1.0/3.0)*dPlane*(Area[iPlane] + 4.0*Area[iPlane+1] + Area[iPlane+2]); + Wing_Volume += (1.0 / 3.0) * dPlane * (Area[iPlane] + 4.0 * Area[iPlane + 1] + Area[iPlane + 2]); } } /*--- Evaluate Max and Min quantities ---*/ - Wing_MaxMaxThickness = -1E6; Wing_MinMaxThickness = 1E6; Wing_MinChord = 1E6; Wing_MaxChord = -1E6; - Wing_MinLERadius = 1E6; Wing_MaxLERadius = -1E6; Wing_MinToC = 1E6; Wing_MaxToC = -1E6; - Wing_MaxTwist = -1E6; Wing_MaxCurvature = -1E6; Wing_MaxDihedral = -1E6; + Wing_MaxMaxThickness = -1E6; + Wing_MinMaxThickness = 1E6; + Wing_MinChord = 1E6; + Wing_MaxChord = -1E6; + Wing_MinLERadius = 1E6; + Wing_MaxLERadius = -1E6; + Wing_MinToC = 1E6; + Wing_MaxToC = -1E6; + Wing_MaxTwist = -1E6; + Wing_MaxCurvature = -1E6; + Wing_MaxDihedral = -1E6; for (iPlane = 0; iPlane < nPlane; iPlane++) { if (MaxThickness[iPlane] != 0.0) Wing_MinMaxThickness = min(Wing_MinMaxThickness, MaxThickness[iPlane]); @@ -10149,59 +9850,51 @@ void CPhysicalGeometry::Compute_Wing(CConfig *config, bool original_surface, Wing_MaxLERadius = max(Wing_MaxLERadius, LERadius[iPlane]); if (ToC[iPlane] != 0.0) Wing_MinToC = min(Wing_MinToC, ToC[iPlane]); Wing_MaxToC = max(Wing_MaxToC, ToC[iPlane]); - Wing_ObjFun_MinToC = sqrt((Wing_MinToC - 0.07)*(Wing_MinToC - 0.07)); + Wing_ObjFun_MinToC = sqrt((Wing_MinToC - 0.07) * (Wing_MinToC - 0.07)); Wing_MaxTwist = max(Wing_MaxTwist, fabs(Twist[iPlane])); Wing_MaxCurvature = max(Wing_MaxCurvature, Curvature[iPlane]); Wing_MaxDihedral = max(Wing_MaxDihedral, fabs(Dihedral[iPlane])); } - } /*--- Free memory for the section cuts ---*/ - delete [] Xcoord_Airfoil; - delete [] Ycoord_Airfoil; - delete [] Zcoord_Airfoil; - delete [] Variable_Airfoil; + delete[] Xcoord_Airfoil; + delete[] Ycoord_Airfoil; + delete[] Zcoord_Airfoil; + delete[] Variable_Airfoil; - for (iPlane = 0; iPlane < nPlane; iPlane++) - delete [] LeadingEdge[iPlane]; - delete [] LeadingEdge; + for (iPlane = 0; iPlane < nPlane; iPlane++) delete[] LeadingEdge[iPlane]; + delete[] LeadingEdge; - for (iPlane = 0; iPlane < nPlane; iPlane++) - delete [] TrailingEdge[iPlane]; - delete [] TrailingEdge; + for (iPlane = 0; iPlane < nPlane; iPlane++) delete[] TrailingEdge[iPlane]; + delete[] TrailingEdge; - for (iPlane = 0; iPlane < nPlane; iPlane++) - delete [] Plane_P0[iPlane]; - delete [] Plane_P0; + for (iPlane = 0; iPlane < nPlane; iPlane++) delete[] Plane_P0[iPlane]; + delete[] Plane_P0; - for (iPlane = 0; iPlane < nPlane; iPlane++) - delete [] Plane_Normal[iPlane]; - delete [] Plane_Normal; - - delete [] Area; - delete [] MaxThickness; - delete [] Chord; - delete [] LERadius; - delete [] ToC; - delete [] Twist; - delete [] Curvature; - delete [] Dihedral; + for (iPlane = 0; iPlane < nPlane; iPlane++) delete[] Plane_Normal[iPlane]; + delete[] Plane_Normal; + delete[] Area; + delete[] MaxThickness; + delete[] Chord; + delete[] LERadius; + delete[] ToC; + delete[] Twist; + delete[] Curvature; + delete[] Dihedral; } -void CPhysicalGeometry::Compute_Fuselage(CConfig *config, bool original_surface, - su2double &Fuselage_Volume, su2double &Fuselage_WettedArea, - su2double &Fuselage_MinWidth, su2double &Fuselage_MaxWidth, - su2double &Fuselage_MinWaterLineWidth, su2double &Fuselage_MaxWaterLineWidth, - su2double &Fuselage_MinHeight, su2double &Fuselage_MaxHeight, - su2double &Fuselage_MaxCurvature) { - +void CPhysicalGeometry::Compute_Fuselage(CConfig* config, bool original_surface, su2double& Fuselage_Volume, + su2double& Fuselage_WettedArea, su2double& Fuselage_MinWidth, + su2double& Fuselage_MaxWidth, su2double& Fuselage_MinWaterLineWidth, + su2double& Fuselage_MaxWaterLineWidth, su2double& Fuselage_MinHeight, + su2double& Fuselage_MaxHeight, su2double& Fuselage_MaxCurvature) { unsigned short iPlane, iDim, nPlane = 0; unsigned long iVertex; su2double MinPlane, MaxPlane, dPlane, *Area, *Length, *Width, *WaterLineWidth, *Height, *Curvature; - vector *Xcoord_Airfoil, *Ycoord_Airfoil, *Zcoord_Airfoil, *Variable_Airfoil; + vector*Xcoord_Airfoil, *Ycoord_Airfoil, *Zcoord_Airfoil, *Variable_Airfoil; ofstream Fuselage_File, Section_File; /*--- Make a large number of section cuts for approximating volume ---*/ @@ -10210,141 +9903,154 @@ void CPhysicalGeometry::Compute_Fuselage(CConfig *config, bool original_surface, /*--- Allocate memory for the section cutting ---*/ - Area = new su2double [nPlane]; - Length = new su2double [nPlane]; - Width = new su2double [nPlane]; - WaterLineWidth = new su2double [nPlane]; - Height = new su2double [nPlane]; - Curvature = new su2double [nPlane]; + Area = new su2double[nPlane]; + Length = new su2double[nPlane]; + Width = new su2double[nPlane]; + WaterLineWidth = new su2double[nPlane]; + Height = new su2double[nPlane]; + Curvature = new su2double[nPlane]; - su2double **LeadingEdge = new su2double*[nPlane]; - for (iPlane = 0; iPlane < nPlane; iPlane++ ) - LeadingEdge[iPlane] = new su2double[nDim]; + auto** LeadingEdge = new su2double*[nPlane]; + for (iPlane = 0; iPlane < nPlane; iPlane++) LeadingEdge[iPlane] = new su2double[nDim]; - su2double **TrailingEdge = new su2double*[nPlane]; - for (iPlane = 0; iPlane < nPlane; iPlane++ ) - TrailingEdge[iPlane] = new su2double[nDim]; + auto** TrailingEdge = new su2double*[nPlane]; + for (iPlane = 0; iPlane < nPlane; iPlane++) TrailingEdge[iPlane] = new su2double[nDim]; - su2double **Plane_P0 = new su2double*[nPlane]; - for (iPlane = 0; iPlane < nPlane; iPlane++ ) - Plane_P0[iPlane] = new su2double[nDim]; + auto** Plane_P0 = new su2double*[nPlane]; + for (iPlane = 0; iPlane < nPlane; iPlane++) Plane_P0[iPlane] = new su2double[nDim]; - su2double **Plane_Normal = new su2double*[nPlane]; - for (iPlane = 0; iPlane < nPlane; iPlane++ ) - Plane_Normal[iPlane] = new su2double[nDim]; + auto** Plane_Normal = new su2double*[nPlane]; + for (iPlane = 0; iPlane < nPlane; iPlane++) Plane_Normal[iPlane] = new su2double[nDim]; - MinPlane = config->GetStations_Bounds(0); MaxPlane = config->GetStations_Bounds(1); - dPlane = fabs((MaxPlane - MinPlane)/su2double(nPlane-1)); + MinPlane = config->GetStations_Bounds(0); + MaxPlane = config->GetStations_Bounds(1); + dPlane = fabs((MaxPlane - MinPlane) / su2double(nPlane - 1)); for (iPlane = 0; iPlane < nPlane; iPlane++) { - Plane_Normal[iPlane][0] = 0.0; Plane_P0[iPlane][0] = 0.0; - Plane_Normal[iPlane][1] = 0.0; Plane_P0[iPlane][1] = 0.0; - Plane_Normal[iPlane][2] = 0.0; Plane_P0[iPlane][2] = 0.0; + Plane_Normal[iPlane][0] = 0.0; + Plane_P0[iPlane][0] = 0.0; + Plane_Normal[iPlane][1] = 0.0; + Plane_P0[iPlane][1] = 0.0; + Plane_Normal[iPlane][2] = 0.0; + Plane_P0[iPlane][2] = 0.0; Plane_Normal[iPlane][0] = 1.0; - Plane_P0[iPlane][0] = MinPlane + iPlane*dPlane; - + Plane_P0[iPlane][0] = MinPlane + iPlane * dPlane; } /*--- Allocate some vectors for storing airfoil coordinates ---*/ - Xcoord_Airfoil = new vector[nPlane]; - Ycoord_Airfoil = new vector[nPlane]; - Zcoord_Airfoil = new vector[nPlane]; + Xcoord_Airfoil = new vector[nPlane]; + Ycoord_Airfoil = new vector[nPlane]; + Zcoord_Airfoil = new vector[nPlane]; Variable_Airfoil = new vector[nPlane]; /*--- Create the section slices through the geometry ---*/ for (iPlane = 0; iPlane < nPlane; iPlane++) { - - ComputeAirfoil_Section(Plane_P0[iPlane], Plane_Normal[iPlane], - -1E6, 1E6, -1E6, 1E6, -1E6, 1E6, nullptr, Xcoord_Airfoil[iPlane], - Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane], + ComputeAirfoil_Section(Plane_P0[iPlane], Plane_Normal[iPlane], -1E6, 1E6, -1E6, 1E6, -1E6, 1E6, nullptr, + Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane], Variable_Airfoil[iPlane], original_surface, config); } /*--- Compute the area at each section ---*/ if (rank == MASTER_NODE) { - /*--- Write an output file---*/ if (config->GetTabular_FileFormat() == TAB_OUTPUT::TAB_CSV) { Fuselage_File.open("fuselage_description.csv", ios::out); if (config->GetSystemMeasurements() == US) - Fuselage_File << "\"x (in)\",\"Area (in^2)\",\"Length (in)\",\"Width (in)\",\"Waterline width (in)\",\"Height (in)\",\"Curvature (1/in)\",\"Generatrix Curve X (in)\",\"Generatrix Curve Y (in)\",\"Generatrix Curve Z (in)\",\"Axis Curve X (in)\",\"Axis Curve Y (in)\",\"Axis Curve Z (in)\"" << endl; + Fuselage_File + << "\"x (in)\",\"Area (in^2)\",\"Length (in)\",\"Width (in)\",\"Waterline width (in)\",\"Height " + "(in)\",\"Curvature (1/in)\",\"Generatrix Curve X (in)\",\"Generatrix Curve Y (in)\",\"Generatrix Curve " + "Z (in)\",\"Axis Curve X (in)\",\"Axis Curve Y (in)\",\"Axis Curve Z (in)\"" + << endl; else - Fuselage_File << "\"x (m)\",\"Area (m^2)\",\"Length (m)\",\"Width (m)\",\"Waterline width (m)\",\"Height (m)\",\"Curvature (1/in)\",\"Generatrix Curve X (m)\",\"Generatrix Curve Y (m)\",\"Generatrix Curve Z (m)\",\"Axis Curve X (m)\",\"Axis Curve Y (m)\",\"Axis Curve Z (m)\"" << endl; - } - else { + Fuselage_File + << "\"x (m)\",\"Area (m^2)\",\"Length (m)\",\"Width (m)\",\"Waterline width (m)\",\"Height " + "(m)\",\"Curvature (1/in)\",\"Generatrix Curve X (m)\",\"Generatrix Curve Y (m)\",\"Generatrix Curve Z " + "(m)\",\"Axis Curve X (m)\",\"Axis Curve Y (m)\",\"Axis Curve Z (m)\"" + << endl; + } else { Fuselage_File.open("fuselage_description.dat", ios::out); Fuselage_File << "TITLE = \"Fuselage description\"" << endl; if (config->GetSystemMeasurements() == US) - Fuselage_File << "VARIABLES = \"x (in)\",\"Area (in2)\",\"Length (in)\",\"Width (in)\",\"Waterline width (in)\",\"Height (in)\",\"Curvature (1/in)\",\"Generatrix Curve X (in)\",\"Generatrix Curve Y (in)\",\"Generatrix Curve Z (in)\",\"Axis Curve X (in)\",\"Axis Curve Y (in)\",\"Axis Curve Z (in)\"" << endl; + Fuselage_File + << "VARIABLES = \"x (in)\",\"Area (in2)\",\"Length (in)\",\"Width (in)\",\"Waterline width " + "(in)\",\"Height (in)\",\"Curvature (1/in)\",\"Generatrix Curve X (in)\",\"Generatrix Curve Y " + "(in)\",\"Generatrix Curve Z (in)\",\"Axis Curve X (in)\",\"Axis Curve Y (in)\",\"Axis Curve Z (in)\"" + << endl; else - Fuselage_File << "VARIABLES = \"x (m)\",\"Area (m2)\",\"Length (m)\",\"Width (m)\",\"Waterline width (m)\",\"Height (m)\",\"Curvature (1/m)\",\"Generatrix Curve X (m)\",\"Generatrix Curve Y (m)\",\"Generatrix Curve Z (m)\",\"Axis Curve X (m)\",\"Axis Curve Y (m)\",\"Axis Curve Z (m)\"" << endl; + Fuselage_File + << "VARIABLES = \"x (m)\",\"Area (m2)\",\"Length (m)\",\"Width (m)\",\"Waterline width " + "(m)\",\"Height (m)\",\"Curvature (1/m)\",\"Generatrix Curve X (m)\",\"Generatrix Curve Y " + "(m)\",\"Generatrix Curve Z (m)\",\"Axis Curve X (m)\",\"Axis Curve Y (m)\",\"Axis Curve Z (m)\"" + << endl; Fuselage_File << "ZONE T= \"Baseline fuselage\"" << endl; } - /*--- Evaluate geometrical quatities that do not require any kind of filter, local to each point ---*/ for (iPlane = 0; iPlane < nPlane; iPlane++) { - for (iDim = 0; iDim < nDim; iDim++) { - LeadingEdge[iPlane][iDim] = 0.0; + LeadingEdge[iPlane][iDim] = 0.0; TrailingEdge[iPlane][iDim] = 0.0; } - Area[iPlane] = 0.0; - Length[iPlane] = 0.0; - Width[iPlane] = 0.0; - WaterLineWidth[iPlane] = 0.0; + Area[iPlane] = 0.0; + Length[iPlane] = 0.0; + Width[iPlane] = 0.0; + WaterLineWidth[iPlane] = 0.0; Height[iPlane] = 0.0; if (Xcoord_Airfoil[iPlane].size() > 1) { + Compute_Fuselage_LeadingTrailing(LeadingEdge[iPlane], TrailingEdge[iPlane], Plane_P0[iPlane], + Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], + Zcoord_Airfoil[iPlane]); - Compute_Fuselage_LeadingTrailing(LeadingEdge[iPlane], TrailingEdge[iPlane], Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - - Area[iPlane] = Compute_Area(Plane_P0[iPlane], Plane_Normal[iPlane], config, Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + Area[iPlane] = Compute_Area(Plane_P0[iPlane], Plane_Normal[iPlane], config, Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Length[iPlane] = Compute_Length(Plane_P0[iPlane], Plane_Normal[iPlane], config, Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + Length[iPlane] = Compute_Length(Plane_P0[iPlane], Plane_Normal[iPlane], config, Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Width[iPlane] = Compute_Width(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + Width[iPlane] = Compute_Width(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - WaterLineWidth[iPlane] = Compute_WaterLineWidth(Plane_P0[iPlane], Plane_Normal[iPlane], config, Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - - Height[iPlane] = Compute_Height(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + WaterLineWidth[iPlane] = + Compute_WaterLineWidth(Plane_P0[iPlane], Plane_Normal[iPlane], config, Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + Height[iPlane] = Compute_Height(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); } - } - /*--- Evaluate geometrical quatities that have been computed using a filtered value (they depend on more than one point) ---*/ + /*--- Evaluate geometrical quatities that have been computed using a filtered value (they depend on more than one + * point) ---*/ for (iPlane = 0; iPlane < nPlane; iPlane++) { - Curvature[iPlane] = 0.0; if (Xcoord_Airfoil[iPlane].size() > 1) { - - if ((iPlane == 0) || (iPlane == nPlane-1)) Curvature[iPlane] = 0.0; - else Curvature[iPlane] = Compute_Curvature(LeadingEdge[iPlane-1], TrailingEdge[iPlane-1], - LeadingEdge[iPlane], TrailingEdge[iPlane], - LeadingEdge[iPlane+1], TrailingEdge[iPlane+1]); - + if ((iPlane == 0) || (iPlane == nPlane - 1)) + Curvature[iPlane] = 0.0; + else + Curvature[iPlane] = + Compute_Curvature(LeadingEdge[iPlane - 1], TrailingEdge[iPlane - 1], LeadingEdge[iPlane], + TrailingEdge[iPlane], LeadingEdge[iPlane + 1], TrailingEdge[iPlane + 1]); } - } /*--- Set the curvature and dihedral angles at the extremes ---*/ if (nPlane > 1) { - if ((Xcoord_Airfoil[0].size() != 0) && (Xcoord_Airfoil[1].size() != 0)) { + if ((!Xcoord_Airfoil[0].empty()) && (!Xcoord_Airfoil[1].empty())) { Curvature[0] = Curvature[1]; } - if ((Xcoord_Airfoil[nPlane-1].size() != 0) && (Xcoord_Airfoil[nPlane-2].size() != 0)) { - Curvature[nPlane-1] = Curvature[nPlane-2]; + if ((!Xcoord_Airfoil[nPlane - 1].empty()) && (!Xcoord_Airfoil[nPlane - 2].empty())) { + Curvature[nPlane - 1] = Curvature[nPlane - 2]; } } @@ -10353,14 +10059,17 @@ void CPhysicalGeometry::Compute_Fuselage(CConfig *config, bool original_surface, for (iPlane = 0; iPlane < nPlane; iPlane++) { if (Xcoord_Airfoil[iPlane].size() > 1) { if (config->GetTabular_FileFormat() == TAB_OUTPUT::TAB_CSV) { - Fuselage_File << -Ycoord_Airfoil[iPlane][0] <<", "<< Area[iPlane] <<", "<< Length[iPlane] <<", "<< Width[iPlane] <<", "<< WaterLineWidth[iPlane] <<", "<< Height[iPlane] <<", "<< Curvature[iPlane] - <<", "<< -LeadingEdge[iPlane][1] <<", "<< LeadingEdge[iPlane][0] <<", "<< LeadingEdge[iPlane][2] - <<", "<< -TrailingEdge[iPlane][1] <<", "<< TrailingEdge[iPlane][0] <<", "<< TrailingEdge[iPlane][2] << endl; - } - else { - Fuselage_File << -Ycoord_Airfoil[iPlane][0] <<" "<< Area[iPlane] <<" "<< Length[iPlane] <<" "<< Width[iPlane] <<" "<< WaterLineWidth[iPlane] <<" "<< Height[iPlane] <<" "<< Curvature[iPlane] - <<" "<< -LeadingEdge[iPlane][1] <<" "<< LeadingEdge[iPlane][0] <<" "<< LeadingEdge[iPlane][2] - <<" "<< -TrailingEdge[iPlane][1] <<" "<< TrailingEdge[iPlane][0] <<" "<< TrailingEdge[iPlane][2] << endl; + Fuselage_File << -Ycoord_Airfoil[iPlane][0] << ", " << Area[iPlane] << ", " << Length[iPlane] << ", " + << Width[iPlane] << ", " << WaterLineWidth[iPlane] << ", " << Height[iPlane] << ", " + << Curvature[iPlane] << ", " << -LeadingEdge[iPlane][1] << ", " << LeadingEdge[iPlane][0] + << ", " << LeadingEdge[iPlane][2] << ", " << -TrailingEdge[iPlane][1] << ", " + << TrailingEdge[iPlane][0] << ", " << TrailingEdge[iPlane][2] << endl; + } else { + Fuselage_File << -Ycoord_Airfoil[iPlane][0] << " " << Area[iPlane] << " " << Length[iPlane] << " " + << Width[iPlane] << " " << WaterLineWidth[iPlane] << " " << Height[iPlane] << " " + << Curvature[iPlane] << " " << -LeadingEdge[iPlane][1] << " " << LeadingEdge[iPlane][0] << " " + << LeadingEdge[iPlane][2] << " " << -TrailingEdge[iPlane][1] << " " << TrailingEdge[iPlane][0] + << " " << TrailingEdge[iPlane][2] << endl; } } } @@ -10370,156 +10079,150 @@ void CPhysicalGeometry::Compute_Fuselage(CConfig *config, bool original_surface, Section_File.open("fuselage_slices.dat", ios::out); for (iPlane = 0; iPlane < nPlane; iPlane++) { - if (iPlane == 0) { Section_File << "TITLE = \"Aircraft Slices\"" << endl; if (config->GetSystemMeasurements() == US) Section_File << "VARIABLES = \"x (in)\", \"y (in)\", \"z (in)\"" << endl; - else Section_File << "VARIABLES = \"x (m)\", \"y (m)\", \"z (m)\"" << endl; + else + Section_File << "VARIABLES = \"x (m)\", \"y (m)\", \"z (m)\"" << endl; } if (Xcoord_Airfoil[iPlane].size() > 1) { - - Section_File << "ZONE T=\"X = " << -Ycoord_Airfoil[iPlane][0] << " \", I= " << Ycoord_Airfoil[iPlane].size() << ", F=POINT" << endl; + Section_File << "ZONE T=\"X = " << -Ycoord_Airfoil[iPlane][0] << " \", I= " << Ycoord_Airfoil[iPlane].size() + << ", F=POINT" << endl; for (iVertex = 0; iVertex < Xcoord_Airfoil[iPlane].size(); iVertex++) { - /*--- Write the file ---*/ - Section_File << -Ycoord_Airfoil[iPlane][iVertex] << " " << Xcoord_Airfoil[iPlane][iVertex] << " " << Zcoord_Airfoil[iPlane][iVertex] << endl; + Section_File << -Ycoord_Airfoil[iPlane][iVertex] << " " << Xcoord_Airfoil[iPlane][iVertex] << " " + << Zcoord_Airfoil[iPlane][iVertex] << endl; } } - } Section_File.close(); - /*--- Compute the fuselage volume using a composite Simpson's rule ---*/ Fuselage_Volume = 0.0; - for (iPlane = 0; iPlane < nPlane-2; iPlane+=2) { + for (iPlane = 0; iPlane < nPlane - 2; iPlane += 2) { if (Xcoord_Airfoil[iPlane].size() > 1) { - Fuselage_Volume += (1.0/3.0)*dPlane*(Area[iPlane] + 4.0*Area[iPlane+1] + Area[iPlane+2]); + Fuselage_Volume += (1.0 / 3.0) * dPlane * (Area[iPlane] + 4.0 * Area[iPlane + 1] + Area[iPlane + 2]); } } /*--- Compute the fuselage wetted area ---*/ Fuselage_WettedArea = 0.0; - if (Xcoord_Airfoil[0].size() > 1) Fuselage_WettedArea += (1.0/2.0)*dPlane*Length[0]; - for (iPlane = 1; iPlane < nPlane-1; iPlane++) { + if (Xcoord_Airfoil[0].size() > 1) Fuselage_WettedArea += (1.0 / 2.0) * dPlane * Length[0]; + for (iPlane = 1; iPlane < nPlane - 1; iPlane++) { if (Xcoord_Airfoil[iPlane].size() > 1) { - Fuselage_WettedArea += dPlane*Length[iPlane]; + Fuselage_WettedArea += dPlane * Length[iPlane]; } } - if (Xcoord_Airfoil[nPlane-1].size() > 1) Fuselage_WettedArea += (1.0/2.0)*dPlane*Length[nPlane-1]; + if (Xcoord_Airfoil[nPlane - 1].size() > 1) Fuselage_WettedArea += (1.0 / 2.0) * dPlane * Length[nPlane - 1]; /*--- Evaluate Max and Min quantities ---*/ - Fuselage_MaxWidth = -1E6; Fuselage_MinWidth = 1E6; - Fuselage_MaxWaterLineWidth = -1E6; Fuselage_MinWaterLineWidth = 1E6; - Fuselage_MaxHeight = -1E6; Fuselage_MinHeight = 1E6; + Fuselage_MaxWidth = -1E6; + Fuselage_MinWidth = 1E6; + Fuselage_MaxWaterLineWidth = -1E6; + Fuselage_MinWaterLineWidth = 1E6; + Fuselage_MaxHeight = -1E6; + Fuselage_MinHeight = 1E6; Fuselage_MaxCurvature = -1E6; for (iPlane = 0; iPlane < nPlane; iPlane++) { if (Width[iPlane] != 0.0) Fuselage_MinWidth = min(Fuselage_MinWidth, Width[iPlane]); Fuselage_MaxWidth = max(Fuselage_MaxWidth, Width[iPlane]); - if (WaterLineWidth[iPlane] != 0.0) Fuselage_MinWaterLineWidth = min(Fuselage_MinWaterLineWidth, WaterLineWidth[iPlane]); + if (WaterLineWidth[iPlane] != 0.0) + Fuselage_MinWaterLineWidth = min(Fuselage_MinWaterLineWidth, WaterLineWidth[iPlane]); Fuselage_MaxWaterLineWidth = max(Fuselage_MaxWaterLineWidth, WaterLineWidth[iPlane]); if (Height[iPlane] != 0.0) Fuselage_MinHeight = min(Fuselage_MinHeight, Height[iPlane]); Fuselage_MaxHeight = max(Fuselage_MaxHeight, Height[iPlane]); Fuselage_MaxCurvature = max(Fuselage_MaxCurvature, Curvature[iPlane]); } - } /*--- Free memory for the section cuts ---*/ - delete [] Xcoord_Airfoil; - delete [] Ycoord_Airfoil; - delete [] Zcoord_Airfoil; - delete [] Variable_Airfoil; - - for (iPlane = 0; iPlane < nPlane; iPlane++) - delete [] LeadingEdge[iPlane]; - delete [] LeadingEdge; + delete[] Xcoord_Airfoil; + delete[] Ycoord_Airfoil; + delete[] Zcoord_Airfoil; + delete[] Variable_Airfoil; - for (iPlane = 0; iPlane < nPlane; iPlane++) - delete [] TrailingEdge[iPlane]; - delete [] TrailingEdge; + for (iPlane = 0; iPlane < nPlane; iPlane++) delete[] LeadingEdge[iPlane]; + delete[] LeadingEdge; - for (iPlane = 0; iPlane < nPlane; iPlane++) - delete [] Plane_P0[iPlane]; - delete [] Plane_P0; + for (iPlane = 0; iPlane < nPlane; iPlane++) delete[] TrailingEdge[iPlane]; + delete[] TrailingEdge; - for (iPlane = 0; iPlane < nPlane; iPlane++) - delete [] Plane_Normal[iPlane]; - delete [] Plane_Normal; + for (iPlane = 0; iPlane < nPlane; iPlane++) delete[] Plane_P0[iPlane]; + delete[] Plane_P0; - delete [] Area; - delete [] Length; - delete [] Width; - delete [] WaterLineWidth; - delete [] Height; - delete [] Curvature; + for (iPlane = 0; iPlane < nPlane; iPlane++) delete[] Plane_Normal[iPlane]; + delete[] Plane_Normal; + delete[] Area; + delete[] Length; + delete[] Width; + delete[] WaterLineWidth; + delete[] Height; + delete[] Curvature; } -void CPhysicalGeometry::Compute_Nacelle(CConfig *config, bool original_surface, - su2double &Nacelle_Volume, su2double &Nacelle_MinMaxThickness, - su2double &Nacelle_MinChord, su2double &Nacelle_MaxChord, - su2double &Nacelle_MaxMaxThickness, su2double &Nacelle_MinLERadius, - su2double &Nacelle_MaxLERadius, su2double &Nacelle_MinToC, su2double &Nacelle_MaxToC, - su2double &Nacelle_ObjFun_MinToC, su2double &Nacelle_MaxTwist) { - +void CPhysicalGeometry::Compute_Nacelle(CConfig* config, bool original_surface, su2double& Nacelle_Volume, + su2double& Nacelle_MinMaxThickness, su2double& Nacelle_MinChord, + su2double& Nacelle_MaxChord, su2double& Nacelle_MaxMaxThickness, + su2double& Nacelle_MinLERadius, su2double& Nacelle_MaxLERadius, + su2double& Nacelle_MinToC, su2double& Nacelle_MaxToC, + su2double& Nacelle_ObjFun_MinToC, su2double& Nacelle_MaxTwist) { unsigned short iPlane, iDim, nPlane = 0; unsigned long iVertex; su2double Angle, MinAngle, MaxAngle, dAngle, *Area, *MaxThickness, *ToC, *Chord, *LERadius, *Twist; - vector *Xcoord_Airfoil, *Ycoord_Airfoil, *Zcoord_Airfoil, *Variable_Airfoil; + vector*Xcoord_Airfoil, *Ycoord_Airfoil, *Zcoord_Airfoil, *Variable_Airfoil; ofstream Nacelle_File, Section_File; - /*--- Make a large number of section cuts for approximating volume ---*/ nPlane = config->GetnWingStations(); /*--- Allocate memory for the section cutting ---*/ - Area = new su2double [nPlane]; - MaxThickness = new su2double [nPlane]; - Chord = new su2double [nPlane]; - LERadius = new su2double [nPlane]; - ToC = new su2double [nPlane]; - Twist = new su2double [nPlane]; + Area = new su2double[nPlane]; + MaxThickness = new su2double[nPlane]; + Chord = new su2double[nPlane]; + LERadius = new su2double[nPlane]; + ToC = new su2double[nPlane]; + Twist = new su2double[nPlane]; - su2double **LeadingEdge = new su2double*[nPlane]; - for (iPlane = 0; iPlane < nPlane; iPlane++ ) - LeadingEdge[iPlane] = new su2double[nDim]; + auto** LeadingEdge = new su2double*[nPlane]; + for (iPlane = 0; iPlane < nPlane; iPlane++) LeadingEdge[iPlane] = new su2double[nDim]; - su2double **TrailingEdge = new su2double*[nPlane]; - for (iPlane = 0; iPlane < nPlane; iPlane++ ) - TrailingEdge[iPlane] = new su2double[nDim]; + auto** TrailingEdge = new su2double*[nPlane]; + for (iPlane = 0; iPlane < nPlane; iPlane++) TrailingEdge[iPlane] = new su2double[nDim]; - su2double **Plane_P0 = new su2double*[nPlane]; - for (iPlane = 0; iPlane < nPlane; iPlane++ ) - Plane_P0[iPlane] = new su2double[nDim]; + auto** Plane_P0 = new su2double*[nPlane]; + for (iPlane = 0; iPlane < nPlane; iPlane++) Plane_P0[iPlane] = new su2double[nDim]; - su2double **Plane_Normal = new su2double*[nPlane]; - for (iPlane = 0; iPlane < nPlane; iPlane++ ) - Plane_Normal[iPlane] = new su2double[nDim]; + auto** Plane_Normal = new su2double*[nPlane]; + for (iPlane = 0; iPlane < nPlane; iPlane++) Plane_Normal[iPlane] = new su2double[nDim]; - MinAngle = config->GetStations_Bounds(0); MaxAngle = config->GetStations_Bounds(1); - dAngle = fabs((MaxAngle - MinAngle)/su2double(nPlane-1)); + MinAngle = config->GetStations_Bounds(0); + MaxAngle = config->GetStations_Bounds(1); + dAngle = fabs((MaxAngle - MinAngle) / su2double(nPlane - 1)); for (iPlane = 0; iPlane < nPlane; iPlane++) { - Plane_Normal[iPlane][0] = 0.0; Plane_P0[iPlane][0] = 0.0; - Plane_Normal[iPlane][1] = 0.0; Plane_P0[iPlane][1] = 0.0; - Plane_Normal[iPlane][2] = 0.0; Plane_P0[iPlane][2] = 0.0; + Plane_Normal[iPlane][0] = 0.0; + Plane_P0[iPlane][0] = 0.0; + Plane_Normal[iPlane][1] = 0.0; + Plane_P0[iPlane][1] = 0.0; + Plane_Normal[iPlane][2] = 0.0; + Plane_P0[iPlane][2] = 0.0; /*--- Apply roll to cut the nacelle ---*/ - Angle = MinAngle + iPlane*dAngle*PI_NUMBER/180.0; + Angle = MinAngle + iPlane * dAngle * PI_NUMBER / 180.0; if (Angle <= 0) Angle = 1E-6; if (Angle >= 360) Angle = 359.999999; @@ -10530,16 +10233,18 @@ void CPhysicalGeometry::Compute_Nacelle(CConfig *config, bool original_surface, /*--- Apply tilt angle to the plane ---*/ - su2double Tilt_Angle = config->GetNacelleLocation(3)*PI_NUMBER/180; - su2double Plane_NormalX_Tilt = Plane_Normal[iPlane][0]*cos(Tilt_Angle) + Plane_Normal[iPlane][2]*sin(Tilt_Angle); + su2double Tilt_Angle = config->GetNacelleLocation(3) * PI_NUMBER / 180; + su2double Plane_NormalX_Tilt = + Plane_Normal[iPlane][0] * cos(Tilt_Angle) + Plane_Normal[iPlane][2] * sin(Tilt_Angle); su2double Plane_NormalY_Tilt = Plane_Normal[iPlane][1]; - su2double Plane_NormalZ_Tilt = Plane_Normal[iPlane][2]*cos(Tilt_Angle) - Plane_Normal[iPlane][0]*sin(Tilt_Angle); + su2double Plane_NormalZ_Tilt = + Plane_Normal[iPlane][2] * cos(Tilt_Angle) - Plane_Normal[iPlane][0] * sin(Tilt_Angle); /*--- Apply toe angle to the plane ---*/ - su2double Toe_Angle = config->GetNacelleLocation(4)*PI_NUMBER/180; - su2double Plane_NormalX_Tilt_Toe = Plane_NormalX_Tilt*cos(Toe_Angle) - Plane_NormalY_Tilt*sin(Toe_Angle); - su2double Plane_NormalY_Tilt_Toe = Plane_NormalX_Tilt*sin(Toe_Angle) + Plane_NormalY_Tilt*cos(Toe_Angle); + su2double Toe_Angle = config->GetNacelleLocation(4) * PI_NUMBER / 180; + su2double Plane_NormalX_Tilt_Toe = Plane_NormalX_Tilt * cos(Toe_Angle) - Plane_NormalY_Tilt * sin(Toe_Angle); + su2double Plane_NormalY_Tilt_Toe = Plane_NormalX_Tilt * sin(Toe_Angle) + Plane_NormalY_Tilt * cos(Toe_Angle); su2double Plane_NormalZ_Tilt_Toe = Plane_NormalZ_Tilt; /*--- Update normal vector ---*/ @@ -10553,108 +10258,116 @@ void CPhysicalGeometry::Compute_Nacelle(CConfig *config, bool original_surface, Plane_P0[iPlane][0] = config->GetNacelleLocation(0); Plane_P0[iPlane][1] = config->GetNacelleLocation(1); Plane_P0[iPlane][2] = config->GetNacelleLocation(2); - } /*--- Allocate some vectors for storing airfoil coordinates ---*/ - Xcoord_Airfoil = new vector[nPlane]; - Ycoord_Airfoil = new vector[nPlane]; - Zcoord_Airfoil = new vector[nPlane]; + Xcoord_Airfoil = new vector[nPlane]; + Ycoord_Airfoil = new vector[nPlane]; + Zcoord_Airfoil = new vector[nPlane]; Variable_Airfoil = new vector[nPlane]; /*--- Create the section slices through the geometry ---*/ for (iPlane = 0; iPlane < nPlane; iPlane++) { - - ComputeAirfoil_Section(Plane_P0[iPlane], Plane_Normal[iPlane], - -1E6, 1E6, -1E6, 1E6, -1E6, 1E6, nullptr, Xcoord_Airfoil[iPlane], - Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane], + ComputeAirfoil_Section(Plane_P0[iPlane], Plane_Normal[iPlane], -1E6, 1E6, -1E6, 1E6, -1E6, 1E6, nullptr, + Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane], Variable_Airfoil[iPlane], original_surface, config); - } /*--- Compute airfoil characteristic only in the master node ---*/ if (rank == MASTER_NODE) { - /*--- Write an output file---*/ if (config->GetTabular_FileFormat() == TAB_OUTPUT::TAB_CSV) { Nacelle_File.open("nacelle_description.csv", ios::out); if (config->GetSystemMeasurements() == US) - Nacelle_File << "\"Theta (deg)\",\"Area (in^2)\",\"Max. Thickness (in)\",\"Chord (in)\",\"Leading Edge Radius (1/in)\",\"Max. Thickness/Chord\",\"Twist (deg)\",\"Leading Edge XLoc\",\"Leading Edge ZLoc\",\"Trailing Edge XLoc\",\"Trailing Edge ZLoc\"" << endl; + Nacelle_File << "\"Theta (deg)\",\"Area (in^2)\",\"Max. Thickness (in)\",\"Chord (in)\",\"Leading Edge Radius " + "(1/in)\",\"Max. Thickness/Chord\",\"Twist (deg)\",\"Leading Edge XLoc\",\"Leading Edge " + "ZLoc\",\"Trailing Edge XLoc\",\"Trailing Edge ZLoc\"" + << endl; else - Nacelle_File << "\"Theta (deg)\",\"Area (m^2)\",\"Max. Thickness (m)\",\"Chord (m)\",\"Leading Edge Radius (1/m)\",\"Max. Thickness/Chord\",\"Twist (deg)\",\"Curvature (1/in)\",\"Dihedral (deg)\",\"Leading Edge XLoc\",\"Leading Edge ZLoc\",\"Trailing Edge XLoc\",\"Trailing Edge ZLoc\"" << endl; - } - else { + Nacelle_File + << "\"Theta (deg)\",\"Area (m^2)\",\"Max. Thickness (m)\",\"Chord (m)\",\"Leading Edge Radius " + "(1/m)\",\"Max. Thickness/Chord\",\"Twist (deg)\",\"Curvature (1/in)\",\"Dihedral (deg)\",\"Leading " + "Edge XLoc\",\"Leading Edge ZLoc\",\"Trailing Edge XLoc\",\"Trailing Edge ZLoc\"" + << endl; + } else { Nacelle_File.open("nacelle_description.dat", ios::out); Nacelle_File << "TITLE = \"Nacelle description\"" << endl; if (config->GetSystemMeasurements() == US) - Nacelle_File << "VARIABLES = \"q (deg)\",\"Area (in2)\",\"Max. Thickness (in)\",\"Chord (in)\",\"Leading Edge Radius (1/in)\",\"Max. Thickness/Chord\",\"Twist (deg)\",\"Leading Edge XLoc\",\"Leading Edge ZLoc\",\"Trailing Edge XLoc\",\"Trailing Edge ZLoc\"" << endl; + Nacelle_File + << "VARIABLES = \"q (deg)\",\"Area (in2)\",\"Max. Thickness (in)\",\"Chord " + "(in)\",\"Leading Edge Radius (1/in)\",\"Max. Thickness/Chord\",\"Twist (deg)\",\"Leading Edge " + "XLoc\",\"Leading Edge ZLoc\",\"Trailing Edge XLoc\",\"Trailing Edge ZLoc\"" + << endl; else - Nacelle_File << "VARIABLES = \"q (deg)\",\"Area (m2)\",\"Max. Thickness (m)\",\"Chord (m)\",\"Leading Edge Radius (1/m)\",\"Max. Thickness/Chord\",\"Twist (deg)\",\"Leading Edge XLoc\",\"Leading Edge ZLoc\",\"Trailing Edge XLoc\",\"Trailing Edge ZLoc\"" << endl; + Nacelle_File + << "VARIABLES = \"q (deg)\",\"Area (m2)\",\"Max. Thickness (m)\",\"Chord " + "(m)\",\"Leading Edge Radius (1/m)\",\"Max. Thickness/Chord\",\"Twist (deg)\",\"Leading Edge " + "XLoc\",\"Leading Edge ZLoc\",\"Trailing Edge XLoc\",\"Trailing Edge ZLoc\"" + << endl; Nacelle_File << "ZONE T= \"Baseline nacelle\"" << endl; } - /*--- Evaluate geometrical quatities that do not require any kind of filter, local to each point ---*/ for (iPlane = 0; iPlane < nPlane; iPlane++) { - for (iDim = 0; iDim < nDim; iDim++) { - LeadingEdge[iPlane][iDim] = 0.0; + LeadingEdge[iPlane][iDim] = 0.0; TrailingEdge[iPlane][iDim] = 0.0; } - Area[iPlane] = 0.0; - MaxThickness[iPlane] = 0.0; - Chord[iPlane] = 0.0; - LERadius[iPlane] = 0.0; - ToC[iPlane] = 0.0; - Twist[iPlane] = 0.0; + Area[iPlane] = 0.0; + MaxThickness[iPlane] = 0.0; + Chord[iPlane] = 0.0; + LERadius[iPlane] = 0.0; + ToC[iPlane] = 0.0; + Twist[iPlane] = 0.0; if (Xcoord_Airfoil[iPlane].size() > 1) { + Compute_Wing_LeadingTrailing(LeadingEdge[iPlane], TrailingEdge[iPlane], Plane_P0[iPlane], Plane_Normal[iPlane], + Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Compute_Wing_LeadingTrailing(LeadingEdge[iPlane], TrailingEdge[iPlane], Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + Area[iPlane] = Compute_Area(Plane_P0[iPlane], Plane_Normal[iPlane], config, Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Area[iPlane] = Compute_Area(Plane_P0[iPlane], Plane_Normal[iPlane], config, Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + MaxThickness[iPlane] = + Compute_MaxThickness(Plane_P0[iPlane], Plane_Normal[iPlane], config, Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - MaxThickness[iPlane] = Compute_MaxThickness(Plane_P0[iPlane], Plane_Normal[iPlane], config, Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + Chord[iPlane] = Compute_Chord(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Chord[iPlane] = Compute_Chord(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + Twist[iPlane] = Compute_Twist(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Twist[iPlane] = Compute_Twist(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - - LERadius[iPlane] = Compute_LERadius(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + LERadius[iPlane] = Compute_LERadius(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); ToC[iPlane] = MaxThickness[iPlane] / Chord[iPlane]; - - } - } /*--- Plot the geometrical quatities ---*/ for (iPlane = 0; iPlane < nPlane; iPlane++) { - - su2double theta_deg = atan2(Plane_Normal[iPlane][1], -Plane_Normal[iPlane][2])/PI_NUMBER*180 + 180; + su2double theta_deg = atan2(Plane_Normal[iPlane][1], -Plane_Normal[iPlane][2]) / PI_NUMBER * 180 + 180; if (Xcoord_Airfoil[iPlane].size() > 1) { if (config->GetTabular_FileFormat() == TAB_OUTPUT::TAB_CSV) { - Nacelle_File << theta_deg <<", "<< Area[iPlane] <<", "<< MaxThickness[iPlane] <<", "<< Chord[iPlane] <<", "<< LERadius[iPlane] <<", "<< ToC[iPlane] - <<", "<< Twist[iPlane] <<", "<< LeadingEdge[iPlane][0] <<", "<< LeadingEdge[iPlane][2] - <<", "<< TrailingEdge[iPlane][0] <<", "<< TrailingEdge[iPlane][2] << endl; - } - else { - Nacelle_File << theta_deg <<" "<< Area[iPlane] <<" "<< MaxThickness[iPlane] <<" "<< Chord[iPlane] <<" "<< LERadius[iPlane] <<" "<< ToC[iPlane] - <<" "<< Twist[iPlane] <<" "<< LeadingEdge[iPlane][0] <<" "<< LeadingEdge[iPlane][2] - <<" "<< TrailingEdge[iPlane][0] <<" "<< TrailingEdge[iPlane][2] << endl; - + Nacelle_File << theta_deg << ", " << Area[iPlane] << ", " << MaxThickness[iPlane] << ", " << Chord[iPlane] + << ", " << LERadius[iPlane] << ", " << ToC[iPlane] << ", " << Twist[iPlane] << ", " + << LeadingEdge[iPlane][0] << ", " << LeadingEdge[iPlane][2] << ", " << TrailingEdge[iPlane][0] + << ", " << TrailingEdge[iPlane][2] << endl; + } else { + Nacelle_File << theta_deg << " " << Area[iPlane] << " " << MaxThickness[iPlane] << " " << Chord[iPlane] << " " + << LERadius[iPlane] << " " << ToC[iPlane] << " " << Twist[iPlane] << " " + << LeadingEdge[iPlane][0] << " " << LeadingEdge[iPlane][2] << " " << TrailingEdge[iPlane][0] + << " " << TrailingEdge[iPlane][2] << endl; } } - } Nacelle_File.close(); @@ -10662,23 +10375,24 @@ void CPhysicalGeometry::Compute_Nacelle(CConfig *config, bool original_surface, Section_File.open("nacelle_slices.dat", ios::out); for (iPlane = 0; iPlane < nPlane; iPlane++) { - if (iPlane == 0) { Section_File << "TITLE = \"Nacelle Slices\"" << endl; if (config->GetSystemMeasurements() == US) - Section_File << "VARIABLES = \"x (in)\", \"y (in)\", \"z (in)\", \"x2D/c\", \"y2D/c\"" << endl; - else Section_File << "VARIABLES = \"x (m)\", \"y (m)\", \"z (m)\", \"x2D/c\", \"y2D/c\"" << endl; + Section_File << R"lit(VARIABLES = "x (in)", "y (in)", "z (in)", "x2D/c", "y2D/c")lit" + << endl; + else + Section_File << R"lit(VARIABLES = "x (m)", "y (m)", "z (m)", "x2D/c", "y2D/c")lit" + << endl; } if (Xcoord_Airfoil[iPlane].size() > 1) { + su2double theta_deg = atan2(Plane_Normal[iPlane][1], -Plane_Normal[iPlane][2]) / PI_NUMBER * 180 + 180; + su2double Angle = theta_deg * PI_NUMBER / 180 - 0.5 * PI_NUMBER; - su2double theta_deg = atan2(Plane_Normal[iPlane][1], -Plane_Normal[iPlane][2])/PI_NUMBER*180 + 180; - su2double Angle = theta_deg*PI_NUMBER/180 - 0.5*PI_NUMBER; - - Section_File << "ZONE T=\"q = " << theta_deg << " deg\", I= " << Xcoord_Airfoil[iPlane].size() << ", F=POINT" << endl; + Section_File << "ZONE T=\"q = " << theta_deg << " deg\", I= " << Xcoord_Airfoil[iPlane].size() + << ", F=POINT" << endl; for (iVertex = 0; iVertex < Xcoord_Airfoil[iPlane].size(); iVertex++) { - /*--- Move to the origin ---*/ su2double XValue_ = Xcoord_Airfoil[iPlane][iVertex] - LeadingEdge[iPlane][0]; @@ -10686,40 +10400,48 @@ void CPhysicalGeometry::Compute_Nacelle(CConfig *config, bool original_surface, /*--- Rotate the airfoil and divide by the chord ---*/ - su2double ValCos = cos(Twist[iPlane]*PI_NUMBER/180.0); - su2double ValSin = sin(Twist[iPlane]*PI_NUMBER/180.0); + su2double ValCos = cos(Twist[iPlane] * PI_NUMBER / 180.0); + su2double ValSin = sin(Twist[iPlane] * PI_NUMBER / 180.0); - su2double XValue = (XValue_*ValCos - ZValue_*ValSin) / Chord[iPlane]; - su2double ZValue = (ZValue_*ValCos + XValue_*ValSin) / Chord[iPlane]; + su2double XValue = (XValue_ * ValCos - ZValue_ * ValSin) / Chord[iPlane]; + su2double ZValue = (ZValue_ * ValCos + XValue_ * ValSin) / Chord[iPlane]; su2double XCoord = Xcoord_Airfoil[iPlane][iVertex] + config->GetNacelleLocation(0); - su2double YCoord = (Ycoord_Airfoil[iPlane][iVertex]*cos(Angle) - Zcoord_Airfoil[iPlane][iVertex]*sin(Angle)) + config->GetNacelleLocation(1); - su2double ZCoord = (Zcoord_Airfoil[iPlane][iVertex]*cos(Angle) + Ycoord_Airfoil[iPlane][iVertex]*sin(Angle)) + config->GetNacelleLocation(2); + su2double YCoord = + (Ycoord_Airfoil[iPlane][iVertex] * cos(Angle) - Zcoord_Airfoil[iPlane][iVertex] * sin(Angle)) + + config->GetNacelleLocation(1); + su2double ZCoord = + (Zcoord_Airfoil[iPlane][iVertex] * cos(Angle) + Ycoord_Airfoil[iPlane][iVertex] * sin(Angle)) + + config->GetNacelleLocation(2); /*--- Write the file ---*/ - Section_File << XCoord << " " << YCoord << " " << ZCoord << " " << XValue << " " << ZValue << endl; + Section_File << XCoord << " " << YCoord << " " << ZCoord << " " << XValue << " " << ZValue << endl; } } - } Section_File.close(); - /*--- Compute the wing volume using a composite Simpson's rule ---*/ Nacelle_Volume = 0.0; - for (iPlane = 0; iPlane < nPlane-2; iPlane+=2) { + for (iPlane = 0; iPlane < nPlane - 2; iPlane += 2) { if (Xcoord_Airfoil[iPlane].size() > 1) { - Nacelle_Volume += (1.0/3.0)*dAngle*(Area[iPlane] + 4.0*Area[iPlane+1] + Area[iPlane+2]); + Nacelle_Volume += (1.0 / 3.0) * dAngle * (Area[iPlane] + 4.0 * Area[iPlane + 1] + Area[iPlane + 2]); } } /*--- Evaluate Max and Min quantities ---*/ - Nacelle_MaxMaxThickness = -1E6; Nacelle_MinMaxThickness = 1E6; Nacelle_MinChord = 1E6; Nacelle_MaxChord = -1E6; - Nacelle_MinLERadius = 1E6; Nacelle_MaxLERadius = -1E6; Nacelle_MinToC = 1E6; Nacelle_MaxToC = -1E6; + Nacelle_MaxMaxThickness = -1E6; + Nacelle_MinMaxThickness = 1E6; + Nacelle_MinChord = 1E6; + Nacelle_MaxChord = -1E6; + Nacelle_MinLERadius = 1E6; + Nacelle_MaxLERadius = -1E6; + Nacelle_MinToC = 1E6; + Nacelle_MaxToC = -1E6; Nacelle_MaxTwist = -1E6; for (iPlane = 0; iPlane < nPlane; iPlane++) { @@ -10731,46 +10453,39 @@ void CPhysicalGeometry::Compute_Nacelle(CConfig *config, bool original_surface, Nacelle_MaxLERadius = max(Nacelle_MaxLERadius, LERadius[iPlane]); if (ToC[iPlane] != 0.0) Nacelle_MinToC = min(Nacelle_MinToC, ToC[iPlane]); Nacelle_MaxToC = max(Nacelle_MaxToC, ToC[iPlane]); - Nacelle_ObjFun_MinToC = sqrt((Nacelle_MinToC - 0.07)*(Nacelle_MinToC - 0.07)); + Nacelle_ObjFun_MinToC = sqrt((Nacelle_MinToC - 0.07) * (Nacelle_MinToC - 0.07)); Nacelle_MaxTwist = max(Nacelle_MaxTwist, fabs(Twist[iPlane])); } - } /*--- Free memory for the section cuts ---*/ - delete [] Xcoord_Airfoil; - delete [] Ycoord_Airfoil; - delete [] Zcoord_Airfoil; - delete [] Variable_Airfoil; + delete[] Xcoord_Airfoil; + delete[] Ycoord_Airfoil; + delete[] Zcoord_Airfoil; + delete[] Variable_Airfoil; - for (iPlane = 0; iPlane < nPlane; iPlane++) - delete [] LeadingEdge[iPlane]; - delete [] LeadingEdge; + for (iPlane = 0; iPlane < nPlane; iPlane++) delete[] LeadingEdge[iPlane]; + delete[] LeadingEdge; - for (iPlane = 0; iPlane < nPlane; iPlane++) - delete [] TrailingEdge[iPlane]; - delete [] TrailingEdge; + for (iPlane = 0; iPlane < nPlane; iPlane++) delete[] TrailingEdge[iPlane]; + delete[] TrailingEdge; - for (iPlane = 0; iPlane < nPlane; iPlane++) - delete [] Plane_P0[iPlane]; - delete [] Plane_P0; + for (iPlane = 0; iPlane < nPlane; iPlane++) delete[] Plane_P0[iPlane]; + delete[] Plane_P0; - for (iPlane = 0; iPlane < nPlane; iPlane++) - delete [] Plane_Normal[iPlane]; - delete [] Plane_Normal; - - delete [] Area; - delete [] MaxThickness; - delete [] Chord; - delete [] LERadius; - delete [] ToC; - delete [] Twist; + for (iPlane = 0; iPlane < nPlane; iPlane++) delete[] Plane_Normal[iPlane]; + delete[] Plane_Normal; + delete[] Area; + delete[] MaxThickness; + delete[] Chord; + delete[] LERadius; + delete[] ToC; + delete[] Twist; } -std::unique_ptr CPhysicalGeometry::ComputeViscousWallADT(const CConfig *config) const{ - +std::unique_ptr CPhysicalGeometry::ComputeViscousWallADT(const CConfig* config) const { /*--------------------------------------------------------------------------*/ /*--- Step 1: Create the coordinates and connectivity of the linear ---*/ /*--- subelements of the local boundaries that must be taken ---*/ @@ -10792,15 +10507,11 @@ std::unique_ptr CPhysicalGeometry::ComputeViscousWallADT(const CC /* Loop over the boundary markers. */ - for(unsigned short iMarker=0; iMarkerGetnMarker_All(); ++iMarker) { - - + for (unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); ++iMarker) { /* Check for a viscous wall. */ - if( config->GetViscous_Wall(iMarker)) { - + if (config->GetViscous_Wall(iMarker)) { /* Loop over the surface elements of this marker. */ - for(unsigned long iElem=0; iElem < nElem_Bound[iMarker]; iElem++) { - + for (unsigned long iElem = 0; iElem < nElem_Bound[iMarker]; iElem++) { /* Set the flag of the mesh points on this surface to true. */ for (unsigned short iNode = 0; iNode < bound[iMarker][iElem]->GetnNodes(); iNode++) { unsigned long iPoint = bound[iMarker][iElem]->GetNode(iNode); @@ -10809,10 +10520,10 @@ std::unique_ptr CPhysicalGeometry::ComputeViscousWallADT(const CC /* Determine the necessary data from the corresponding standard face, such as the number of linear subfaces, the number of DOFs per linear subface and the corresponding local connectivity. */ - const unsigned short VTK_Type = bound[iMarker][iElem]->GetVTK_Type(); - const unsigned short nDOFsPerElem = bound[iMarker][iElem]->GetnNodes(); + const unsigned short VTK_Type = bound[iMarker][iElem]->GetVTK_Type(); + const unsigned short nDOFsPerElem = bound[iMarker][iElem]->GetnNodes(); - /* Loop over the nodes of element and store the required data. */ + /* Loop over the nodes of element and store the required data. */ markerIDs.push_back(iMarker); VTK_TypeElem.push_back(VTK_Type); @@ -10829,19 +10540,17 @@ std::unique_ptr CPhysicalGeometry::ComputeViscousWallADT(const CC vector surfaceCoor; unsigned long nVertex_SolidWall = 0; - for(unsigned long i=0; iGetCoord(i, k)); + for (unsigned short k = 0; k < nDim; ++k) surfaceCoor.push_back(nodes->GetCoord(i, k)); } } /*--- Change the surface connectivity, such that it corresponds to the entries in surfaceCoor rather than in meshPoints. ---*/ - for(unsigned long i=0; i CPhysicalGeometry::ComputeViscousWallADT(const CC /*--- points of the elements close to a wall boundary. ---*/ /*--------------------------------------------------------------------------*/ - std::unique_ptr WallADT(new CADTElemClass(nDim, surfaceCoor, surfaceConn, VTK_TypeElem, - markerIDs, elemIDs, true)); + std::unique_ptr WallADT( + new CADTElemClass(nDim, surfaceCoor, surfaceConn, VTK_TypeElem, markerIDs, elemIDs, true)); return WallADT; - } -void CPhysicalGeometry::SetWallDistance(CADTElemClass* WallADT, const CConfig* config, unsigned short iZone) { +/*--- Use a thread-sanitizer dependent loop schedule to work around suspected false positives ---*/ +#ifndef __SANITIZE_THREAD__ +#define CPHYSGEO_PARFOR SU2_OMP_FOR_DYN(roundUpDiv(nPoint, 2 * omp_get_max_threads())) +#else +#define CPHYSGEO_PARFOR SU2_OMP_FOR_() +#endif +#define END_CPHYSGEO_PARFOR END_SU2_OMP_FOR + +void CPhysicalGeometry::SetWallDistance(CADTElemClass* WallADT, const CConfig* config, unsigned short iZone) { /*--------------------------------------------------------------------------*/ /*--- Step 3: Loop over all interior mesh nodes and compute minimum ---*/ /*--- distance to a solid wall element ---*/ /*--------------------------------------------------------------------------*/ - SU2_OMP_PARALLEL if (!WallADT->IsEmpty()) { /*--- Solid wall boundary nodes are present. Compute the wall distance for all nodes. ---*/ - SU2_OMP_FOR_DYN(roundUpDiv(nPoint,2*omp_get_max_threads())) - for (unsigned long iPoint=0; iPointDetermineNearestElement(nodes->GetCoord(iPoint), dist, markerID, elemID, rankID); + WallADT->DetermineNearestElement(nodes->GetCoord(iPoint), dist, markerID, elemID, rankID); - if(dist < nodes->GetWall_Distance(iPoint)){ - nodes->SetWall_Distance(iPoint, dist, rankID, iZone, markerID, elemID); + if (dist < nodes->GetWall_Distance(iPoint)) { + nodes->SetWall_Distance(iPoint, dist, rankID, iZone, markerID, elemID); + } } + END_CPHYSGEO_PARFOR } - END_SU2_OMP_FOR + END_SU2_OMP_PARALLEL } - END_SU2_OMP_PARALLEL } + +#undef CPHYSGEO_PARFOR +#undef END_CPHYSGEO_PARFOR diff --git a/Common/src/geometry/dual_grid/CDualGrid.cpp b/Common/src/geometry/dual_grid/CDualGrid.cpp index a3969b4088e..4019695ed9d 100644 --- a/Common/src/geometry/dual_grid/CDualGrid.cpp +++ b/Common/src/geometry/dual_grid/CDualGrid.cpp @@ -2,7 +2,7 @@ * \file CDualGrid.cpp * \brief Main classes for defining the dual grid * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -29,6 +29,6 @@ unsigned short CDualGrid::nDim = 0; -CDualGrid::CDualGrid(unsigned short val_nDim) { nDim = val_nDim;} +CDualGrid::CDualGrid(unsigned short val_nDim) { nDim = val_nDim; } -CDualGrid::~CDualGrid() {} +CDualGrid::~CDualGrid() = default; diff --git a/Common/src/geometry/dual_grid/CEdge.cpp b/Common/src/geometry/dual_grid/CEdge.cpp index a5f30f90473..92cf493e36f 100644 --- a/Common/src/geometry/dual_grid/CEdge.cpp +++ b/Common/src/geometry/dual_grid/CEdge.cpp @@ -2,7 +2,7 @@ * \file CEdge.cpp * \brief Implementation of the edge class. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -32,39 +32,31 @@ using namespace GeometryToolbox; CEdge::CEdge(unsigned long nEdge_, unsigned long nDim) - : nEdge(nEdge_), - nEdgeSIMD(nextMultiple(nEdge_, simd::preferredLen())) { + : nEdge(nEdge_), nEdgeSIMD(nextMultiple(nEdge_, simd::preferredLen())) { /*--- Allocate with padding. ---*/ - Nodes.resize(nEdgeSIMD,2) = 0; - Normal.resize(nEdgeSIMD,nDim) = su2double(0.0); + Nodes.resize(nEdgeSIMD, 2) = 0; + Normal.resize(nEdgeSIMD, nDim) = su2double(0.0); } -void CEdge::SetZeroValues(void) { - Normal = su2double(0.0); -} - -su2double CEdge::GetVolume(const su2double *coord_Edge_CG, - const su2double *coord_FaceElem_CG, - const su2double *coord_Elem_CG, - const su2double *coord_Point) { +void CEdge::SetZeroValues() { Normal = su2double(0.0); } +su2double CEdge::GetVolume(const su2double* coord_Edge_CG, const su2double* coord_FaceElem_CG, + const su2double* coord_Elem_CG, const su2double* coord_Point) { constexpr unsigned long nDim = 3; su2double vec_a[nDim] = {0.0}, vec_b[nDim] = {0.0}, vec_c[nDim] = {0.0}, vec_d[nDim] = {0.0}; - Distance(nDim, coord_Edge_CG, coord_Point, vec_a); + Distance(nDim, coord_Edge_CG, coord_Point, vec_a); Distance(nDim, coord_FaceElem_CG, coord_Point, vec_b); - Distance(nDim, coord_Elem_CG, coord_Point, vec_c); + Distance(nDim, coord_Elem_CG, coord_Point, vec_c); CrossProduct(vec_a, vec_b, vec_d); return fabs(DotProduct(nDim, vec_c, vec_d)) / 6.0; } -su2double CEdge::GetVolume(const su2double *coord_Edge_CG, - const su2double *coord_Elem_CG, - const su2double *coord_Point) { - +su2double CEdge::GetVolume(const su2double* coord_Edge_CG, const su2double* coord_Elem_CG, + const su2double* coord_Point) { constexpr unsigned long nDim = 2; su2double vec_a[nDim] = {0.0}, vec_b[nDim] = {0.0}; @@ -72,14 +64,11 @@ su2double CEdge::GetVolume(const su2double *coord_Edge_CG, Distance(nDim, coord_Elem_CG, coord_Point, vec_a); Distance(nDim, coord_Edge_CG, coord_Point, vec_b); - return 0.5 * fabs(vec_a[0]*vec_b[1] - vec_a[1]*vec_b[0]); + return 0.5 * fabs(vec_a[0] * vec_b[1] - vec_a[1] * vec_b[0]); } -void CEdge::SetNodes_Coord(unsigned long iEdge, - const su2double *coord_Edge_CG, - const su2double *coord_FaceElem_CG, - const su2double *coord_Elem_CG) { - +void CEdge::SetNodes_Coord(unsigned long iEdge, const su2double* coord_Edge_CG, const su2double* coord_FaceElem_CG, + const su2double* coord_Elem_CG) { constexpr unsigned long nDim = 3; su2double vec_a[nDim] = {0.0}, vec_b[nDim] = {0.0}, Dim_Normal[nDim]; @@ -89,14 +78,10 @@ void CEdge::SetNodes_Coord(unsigned long iEdge, CrossProduct(vec_a, vec_b, Dim_Normal); - for (auto iDim = 0ul; iDim < nDim; ++iDim) - Normal(iEdge,iDim) += 0.5 * Dim_Normal[iDim]; + for (auto iDim = 0ul; iDim < nDim; ++iDim) Normal(iEdge, iDim) += 0.5 * Dim_Normal[iDim]; } -void CEdge::SetNodes_Coord(unsigned long iEdge, - const su2double *coord_Edge_CG, - const su2double *coord_Elem_CG) { - - Normal(iEdge,0) += coord_Elem_CG[1] - coord_Edge_CG[1]; - Normal(iEdge,1) -= coord_Elem_CG[0] - coord_Edge_CG[0]; +void CEdge::SetNodes_Coord(unsigned long iEdge, const su2double* coord_Edge_CG, const su2double* coord_Elem_CG) { + Normal(iEdge, 0) += coord_Elem_CG[1] - coord_Edge_CG[1]; + Normal(iEdge, 1) -= coord_Elem_CG[0] - coord_Edge_CG[0]; } diff --git a/Common/src/geometry/dual_grid/CPoint.cpp b/Common/src/geometry/dual_grid/CPoint.cpp index 8f3eaefff01..e47de05486c 100644 --- a/Common/src/geometry/dual_grid/CPoint.cpp +++ b/Common/src/geometry/dual_grid/CPoint.cpp @@ -2,7 +2,7 @@ * \file CPoint.cpp * \brief Main classes for defining the points of the dual grid * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -29,13 +29,9 @@ #include "../../../include/CConfig.hpp" #include "../../../include/parallelization/omp_structure.hpp" -CPoint::CPoint(unsigned long npoint, unsigned long ndim) : nDim(ndim) { - - MinimalAllocation(npoint); -} +CPoint::CPoint(unsigned long npoint, unsigned long ndim) : nDim(ndim) { MinimalAllocation(npoint); } void CPoint::MinimalAllocation(unsigned long npoint) { - /*--- Global index a parallel simulation. ---*/ GlobalIndex.resize(npoint) = 0; @@ -43,19 +39,16 @@ void CPoint::MinimalAllocation(unsigned long npoint) { Color.resize(npoint) = 0; /*--- Coordinates. ---*/ - Coord.resize(npoint,nDim) = su2double(0.0); - + Coord.resize(npoint, nDim) = su2double(0.0); } -CPoint::CPoint(unsigned long npoint, unsigned long ndim, unsigned short imesh, const CConfig *config) : nDim(ndim) { - +CPoint::CPoint(unsigned long npoint, unsigned long ndim, unsigned short imesh, const CConfig* config) : nDim(ndim) { MinimalAllocation(npoint); FullAllocation(imesh, config); } -void CPoint::FullAllocation(unsigned short imesh, const CConfig *config) { - +void CPoint::FullAllocation(unsigned short imesh, const CConfig* config) { const auto npoint = GlobalIndex.size(); /*--- Volumes ---*/ @@ -74,8 +67,8 @@ void CPoint::FullAllocation(unsigned short imesh, const CConfig *config) { } if (config->GetDiscrete_Adjoint()) { - AD_InputIndex.resize(npoint,nDim) = 0; - AD_OutputIndex.resize(npoint,nDim) = 0; + AD_InputIndex.resize(npoint, nDim) = 0; + AD_OutputIndex.resize(npoint, nDim) = 0; } /*--- Multigrid structures. ---*/ @@ -103,27 +96,26 @@ void CPoint::FullAllocation(unsigned short imesh, const CConfig *config) { /*--- For smoothing the numerical grid coordinates ---*/ if (config->GetSmoothNumGrid()) { - Coord_Old.resize(npoint,nDim) = su2double(0.0); - Coord_Sum.resize(npoint,nDim) = su2double(0.0); + Coord_Old.resize(npoint, nDim) = su2double(0.0); + Coord_Sum.resize(npoint, nDim) = su2double(0.0); } /*--- Storage of grid velocities for dynamic meshes. ---*/ if (config->GetDynamic_Grid()) { - GridVel.resize(npoint,nDim) = su2double(0.0); + GridVel.resize(npoint, nDim) = su2double(0.0); /*--- Grid velocity gradients are needed for the continuous adjoint. ---*/ - if (config->GetContinuous_Adjoint()) - GridVel_Grad.resize(npoint,nDim,nDim,0.0); + if (config->GetContinuous_Adjoint()) GridVel_Grad.resize(npoint, nDim, nDim, 0.0); /*--- Structures for storing old node coordinates for computing grid * velocities via finite differencing with dynamically deforming meshes. ---*/ /*--- In the case of CMeshSolver, these coordinates are stored as solutions to the mesh problem. ---*/ if (config->GetGrid_Movement() && (config->GetTime_Marching() != TIME_MARCHING::STEADY)) { - Coord_n.resize(npoint,nDim) = su2double(0.0); - Coord_p1.resize(npoint,nDim) = su2double(0.0); - Coord_n1.resize(npoint,nDim) = su2double(0.0); - if (Coord_Old.empty()) Coord_Old.resize(npoint,nDim) = su2double(0.0); + Coord_n.resize(npoint, nDim) = su2double(0.0); + Coord_p1.resize(npoint, nDim) = su2double(0.0); + Coord_n1.resize(npoint, nDim) = su2double(0.0); + if (Coord_Old.empty()) Coord_Old.resize(npoint, nDim) = su2double(0.0); } } @@ -140,18 +132,13 @@ void CPoint::FullAllocation(unsigned short imesh, const CConfig *config) { RoughnessHeight.resize(npoint) = su2double(0.0); SharpEdge_Distance.resize(npoint) = su2double(0.0); - } -void CPoint::SetElems(const vector >& elemsMatrix) { - - Elem = CCompressedSparsePatternL(elemsMatrix); -} +void CPoint::SetElems(const vector >& elemsMatrix) { Elem = CCompressedSparsePatternL(elemsMatrix); } void CPoint::SetPoints(const vector >& pointsMatrix) { - Point = CCompressedSparsePatternUL(pointsMatrix); - Edge = CCompressedSparsePatternL(Point.outerPtr(), Point.outerPtr()+Point.getOuterSize()+1, long(-1)); + Edge = CCompressedSparsePatternL(Point.outerPtr(), Point.outerPtr() + Point.getOuterSize() + 1, long(-1)); } void CPoint::SetVolume_n() { @@ -205,4 +192,3 @@ void CPoint::SetCoord_Old() { } void CPoint::SetCoord_SumZero() { parallelSet(Coord_Sum.size(), 0.0, Coord_Sum.data()); } - diff --git a/Common/src/geometry/dual_grid/CTurboVertex.cpp b/Common/src/geometry/dual_grid/CTurboVertex.cpp index 592bbc1cb6c..8a036cd90aa 100644 --- a/Common/src/geometry/dual_grid/CTurboVertex.cpp +++ b/Common/src/geometry/dual_grid/CTurboVertex.cpp @@ -2,7 +2,7 @@ * \file CTurboVertex.cpp * \brief Main classes for defining the turbo vertices of the dual grid * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,20 +27,15 @@ #include "../../../include/geometry/dual_grid/CTurboVertex.hpp" -CTurboVertex::CTurboVertex(unsigned long val_point, unsigned short val_nDim) : CVertex(val_point, val_nDim){ +CTurboVertex::CTurboVertex(unsigned long val_point, unsigned short val_nDim) : CVertex(val_point, val_nDim) { unsigned short iDim; - /*--- Pointers initialization ---*/ + /*--- Pointers initialization ---*/ TurboNormal = nullptr; /*--- Allocate node, and face normal ---*/ - TurboNormal = new su2double [nDim]; + TurboNormal = new su2double[nDim]; /*--- Initializate the structure ---*/ - for (iDim = 0; iDim < nDim; iDim ++) TurboNormal[iDim] = 0.0; - + for (iDim = 0; iDim < nDim; iDim++) TurboNormal[iDim] = 0.0; } -CTurboVertex::~CTurboVertex() { - - delete [] TurboNormal; - -} +CTurboVertex::~CTurboVertex() { delete[] TurboNormal; } diff --git a/Common/src/geometry/dual_grid/CVertex.cpp b/Common/src/geometry/dual_grid/CVertex.cpp index 4b3e9d657d8..1879f66106f 100644 --- a/Common/src/geometry/dual_grid/CVertex.cpp +++ b/Common/src/geometry/dual_grid/CVertex.cpp @@ -2,7 +2,7 @@ * \file CVertex.cpp * \brief Main classes for defining the vertices of the dual grid * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -30,15 +30,10 @@ using namespace GeometryToolbox; -CVertex::CVertex(unsigned long val_point, unsigned short val_nDim) : - CDualGrid(val_nDim) { - Nodes[0] = val_point; -} - -void CVertex::SetNodes_Coord(const su2double *coord_Edge_CG, - const su2double *coord_FaceElem_CG, - const su2double *coord_Elem_CG) { +CVertex::CVertex(unsigned long val_point, unsigned short val_nDim) : CDualGrid(val_nDim) { Nodes[0] = val_point; } +void CVertex::SetNodes_Coord(const su2double* coord_Edge_CG, const su2double* coord_FaceElem_CG, + const su2double* coord_Elem_CG) { constexpr unsigned long nDim = 3; su2double vec_a[nDim] = {0.0}, vec_b[nDim] = {0.0}, Dim_Normal[nDim]; @@ -47,13 +42,10 @@ void CVertex::SetNodes_Coord(const su2double *coord_Edge_CG, CrossProduct(vec_a, vec_b, Dim_Normal); - for (auto iDim = 0ul; iDim < nDim; ++iDim) - Normal[iDim] += 0.5 * Dim_Normal[iDim]; + for (auto iDim = 0ul; iDim < nDim; ++iDim) Normal[iDim] += 0.5 * Dim_Normal[iDim]; } -void CVertex::SetNodes_Coord(const su2double *val_coord_Edge_CG, - const su2double *val_coord_Elem_CG) { - - Normal[0] += val_coord_Elem_CG[1]-val_coord_Edge_CG[1]; - Normal[1] -= val_coord_Elem_CG[0]-val_coord_Edge_CG[0]; +void CVertex::SetNodes_Coord(const su2double* val_coord_Edge_CG, const su2double* val_coord_Elem_CG) { + Normal[0] += val_coord_Elem_CG[1] - val_coord_Edge_CG[1]; + Normal[1] -= val_coord_Elem_CG[0] - val_coord_Edge_CG[0]; } diff --git a/Common/src/geometry/elements/CElement.cpp b/Common/src/geometry/elements/CElement.cpp index 2e35eeecf98..70ef29f8811 100644 --- a/Common/src/geometry/elements/CElement.cpp +++ b/Common/src/geometry/elements/CElement.cpp @@ -2,7 +2,7 @@ * \file CElement.cpp * \brief Definition of the Finite Element structure (elements) * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,9 +27,7 @@ #include "../../../include/geometry/elements/CElement.hpp" - CElement::CElement(unsigned short ngauss, unsigned short nnodes, unsigned short ndim) { - nGaussPoints = ngauss; nNodes = nnodes; nDim = ndim; @@ -42,8 +40,7 @@ CElement::CElement(unsigned short ngauss, unsigned short nnodes, unsigned short RefCoord.resize(nNodes, MAXNDIM) = su2double(0.0); GaussPoint.reserve(nGaussPoints); - for(unsigned short iGauss = 0; iGauss < nGaussPoints; ++iGauss) - GaussPoint.emplace_back(iGauss, nDim, nNodes); + for (unsigned short iGauss = 0; iGauss < nGaussPoints; ++iGauss) GaussPoint.emplace_back(iGauss, nDim, nNodes); GaussWeight.resize(nGaussPoints) = su2double(0.0); NodalExtrap.resize(nNodes, nGaussPoints) = su2double(0.0); @@ -53,33 +50,30 @@ CElement::CElement(unsigned short ngauss, unsigned short nnodes, unsigned short Mab.resize(nNodes, nNodes); Ks_ab.resize(nNodes, nNodes); Kab.resize(nNodes); - for(auto& kab_i : Kab) kab_i.resize(nNodes, nDim*nDim); + for (auto& kab_i : Kab) kab_i.resize(nNodes, nDim * nDim); Kt_a.resize(nNodes, nDim); FDL_a.resize(nNodes, nDim); - HiHj.resize(nNodes,nNodes); + HiHj.resize(nNodes, nNodes); DHiDHj.resize(nNodes); - for(auto& DHiDHj_a : DHiDHj) { + for (auto& DHiDHj_a : DHiDHj) { DHiDHj_a.resize(nNodes); - for(auto& DHiDHj_ab : DHiDHj_a) DHiDHj_ab.resize(nDim,nDim); + for (auto& DHiDHj_ab : DHiDHj_a) DHiDHj_ab.resize(nDim, nDim); } ClearElement(); } -void CElement::ClearElement(void) { - +void CElement::ClearElement() { Mab.setConstant(0.0); Kt_a.setConstant(0.0); FDL_a.setConstant(0.0); Ks_ab.setConstant(0.0); HiHj.setConstant(0.0); - for(auto& DHiDHj_a : DHiDHj) { - for(auto& DHiDHj_ab : DHiDHj_a) DHiDHj_ab.setConstant(0.0); + for (auto& DHiDHj_a : DHiDHj) { + for (auto& DHiDHj_ab : DHiDHj_a) DHiDHj_ab.setConstant(0.0); } - for(auto& kab_i : Kab) - kab_i.setConstant(0.0); + for (auto& kab_i : Kab) kab_i.setConstant(0.0); } - diff --git a/Common/src/geometry/elements/CHEXA8.cpp b/Common/src/geometry/elements/CHEXA8.cpp index 79d033c0e59..fdc2c8773c8 100644 --- a/Common/src/geometry/elements/CHEXA8.cpp +++ b/Common/src/geometry/elements/CHEXA8.cpp @@ -2,7 +2,7 @@ * \file CHEXA8.cpp * \brief Definition of 8-node hexa element with 8 Gauss points. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,21 +27,43 @@ #include "../../../include/geometry/elements/CElement.hpp" - -CHEXA8::CHEXA8() : CElementWithKnownSizes() { - +CHEXA8::CHEXA8() : CElementWithKnownSizes() { /*--- Gauss coordinates and weights ---*/ su2double oneOnSqrt3 = 0.577350269189626; - GaussCoord[0][0] = -oneOnSqrt3; GaussCoord[0][1] = -oneOnSqrt3; GaussCoord[0][2] = -oneOnSqrt3; GaussWeight(0) = 1.0; - GaussCoord[1][0] = oneOnSqrt3; GaussCoord[1][1] = -oneOnSqrt3; GaussCoord[1][2] = -oneOnSqrt3; GaussWeight(1) = 1.0; - GaussCoord[2][0] = oneOnSqrt3; GaussCoord[2][1] = oneOnSqrt3; GaussCoord[2][2] = -oneOnSqrt3; GaussWeight(2) = 1.0; - GaussCoord[3][0] = -oneOnSqrt3; GaussCoord[3][1] = oneOnSqrt3; GaussCoord[3][2] = -oneOnSqrt3; GaussWeight(3) = 1.0; - GaussCoord[4][0] = -oneOnSqrt3; GaussCoord[4][1] = -oneOnSqrt3; GaussCoord[4][2] = oneOnSqrt3; GaussWeight(4) = 1.0; - GaussCoord[5][0] = oneOnSqrt3; GaussCoord[5][1] = -oneOnSqrt3; GaussCoord[5][2] = oneOnSqrt3; GaussWeight(5) = 1.0; - GaussCoord[6][0] = oneOnSqrt3; GaussCoord[6][1] = oneOnSqrt3; GaussCoord[6][2] = oneOnSqrt3; GaussWeight(6) = 1.0; - GaussCoord[7][0] = -oneOnSqrt3; GaussCoord[7][1] = oneOnSqrt3; GaussCoord[7][2] = oneOnSqrt3; GaussWeight(7) = 1.0; + GaussCoord[0][0] = -oneOnSqrt3; + GaussCoord[0][1] = -oneOnSqrt3; + GaussCoord[0][2] = -oneOnSqrt3; + GaussWeight(0) = 1.0; + GaussCoord[1][0] = oneOnSqrt3; + GaussCoord[1][1] = -oneOnSqrt3; + GaussCoord[1][2] = -oneOnSqrt3; + GaussWeight(1) = 1.0; + GaussCoord[2][0] = oneOnSqrt3; + GaussCoord[2][1] = oneOnSqrt3; + GaussCoord[2][2] = -oneOnSqrt3; + GaussWeight(2) = 1.0; + GaussCoord[3][0] = -oneOnSqrt3; + GaussCoord[3][1] = oneOnSqrt3; + GaussCoord[3][2] = -oneOnSqrt3; + GaussWeight(3) = 1.0; + GaussCoord[4][0] = -oneOnSqrt3; + GaussCoord[4][1] = -oneOnSqrt3; + GaussCoord[4][2] = oneOnSqrt3; + GaussWeight(4) = 1.0; + GaussCoord[5][0] = oneOnSqrt3; + GaussCoord[5][1] = -oneOnSqrt3; + GaussCoord[5][2] = oneOnSqrt3; + GaussWeight(5) = 1.0; + GaussCoord[6][0] = oneOnSqrt3; + GaussCoord[6][1] = oneOnSqrt3; + GaussCoord[6][2] = oneOnSqrt3; + GaussWeight(6) = 1.0; + GaussCoord[7][0] = -oneOnSqrt3; + GaussCoord[7][1] = oneOnSqrt3; + GaussCoord[7][2] = oneOnSqrt3; + GaussWeight(7) = 1.0; /*--- Store the values of the shape functions and their derivatives ---*/ @@ -49,96 +71,115 @@ CHEXA8::CHEXA8() : CElementWithKnownSizes() { su2double Xi, Eta, Zeta, val_Ni; for (iGauss = 0; iGauss < NGAUSS; iGauss++) { - Xi = GaussCoord[iGauss][0]; Eta = GaussCoord[iGauss][1]; Zeta = GaussCoord[iGauss][2]; - val_Ni = 0.125*(1.0-Xi)*(1.0-Eta)*(1.0-Zeta); GaussPoint[iGauss].SetNi(val_Ni,0); - val_Ni = 0.125*(1.0+Xi)*(1.0-Eta)*(1.0-Zeta); GaussPoint[iGauss].SetNi(val_Ni,1); - val_Ni = 0.125*(1.0+Xi)*(1.0+Eta)*(1.0-Zeta); GaussPoint[iGauss].SetNi(val_Ni,2); - val_Ni = 0.125*(1.0-Xi)*(1.0+Eta)*(1.0-Zeta); GaussPoint[iGauss].SetNi(val_Ni,3); - val_Ni = 0.125*(1.0-Xi)*(1.0-Eta)*(1.0+Zeta); GaussPoint[iGauss].SetNi(val_Ni,4); - val_Ni = 0.125*(1.0+Xi)*(1.0-Eta)*(1.0+Zeta); GaussPoint[iGauss].SetNi(val_Ni,5); - val_Ni = 0.125*(1.0+Xi)*(1.0+Eta)*(1.0+Zeta); GaussPoint[iGauss].SetNi(val_Ni,6); - val_Ni = 0.125*(1.0-Xi)*(1.0+Eta)*(1.0+Zeta); GaussPoint[iGauss].SetNi(val_Ni,7); + val_Ni = 0.125 * (1.0 - Xi) * (1.0 - Eta) * (1.0 - Zeta); + GaussPoint[iGauss].SetNi(val_Ni, 0); + val_Ni = 0.125 * (1.0 + Xi) * (1.0 - Eta) * (1.0 - Zeta); + GaussPoint[iGauss].SetNi(val_Ni, 1); + val_Ni = 0.125 * (1.0 + Xi) * (1.0 + Eta) * (1.0 - Zeta); + GaussPoint[iGauss].SetNi(val_Ni, 2); + val_Ni = 0.125 * (1.0 - Xi) * (1.0 + Eta) * (1.0 - Zeta); + GaussPoint[iGauss].SetNi(val_Ni, 3); + val_Ni = 0.125 * (1.0 - Xi) * (1.0 - Eta) * (1.0 + Zeta); + GaussPoint[iGauss].SetNi(val_Ni, 4); + val_Ni = 0.125 * (1.0 + Xi) * (1.0 - Eta) * (1.0 + Zeta); + GaussPoint[iGauss].SetNi(val_Ni, 5); + val_Ni = 0.125 * (1.0 + Xi) * (1.0 + Eta) * (1.0 + Zeta); + GaussPoint[iGauss].SetNi(val_Ni, 6); + val_Ni = 0.125 * (1.0 - Xi) * (1.0 + Eta) * (1.0 + Zeta); + GaussPoint[iGauss].SetNi(val_Ni, 7); /*--- dN/d xi ---*/ - dNiXj[iGauss][0][0] = -0.125*(1.0-Eta)*(1.0-Zeta); - dNiXj[iGauss][1][0] = 0.125*(1.0-Eta)*(1.0-Zeta); - dNiXj[iGauss][2][0] = 0.125*(1.0+Eta)*(1.0-Zeta); - dNiXj[iGauss][3][0] = -0.125*(1.0+Eta)*(1.0-Zeta); - dNiXj[iGauss][4][0] = -0.125*(1.0-Eta)*(1.0+Zeta); - dNiXj[iGauss][5][0] = 0.125*(1.0-Eta)*(1.0+Zeta); - dNiXj[iGauss][6][0] = 0.125*(1.0+Eta)*(1.0+Zeta); - dNiXj[iGauss][7][0] = -0.125*(1.0+Eta)*(1.0+Zeta); + dNiXj[iGauss][0][0] = -0.125 * (1.0 - Eta) * (1.0 - Zeta); + dNiXj[iGauss][1][0] = 0.125 * (1.0 - Eta) * (1.0 - Zeta); + dNiXj[iGauss][2][0] = 0.125 * (1.0 + Eta) * (1.0 - Zeta); + dNiXj[iGauss][3][0] = -0.125 * (1.0 + Eta) * (1.0 - Zeta); + dNiXj[iGauss][4][0] = -0.125 * (1.0 - Eta) * (1.0 + Zeta); + dNiXj[iGauss][5][0] = 0.125 * (1.0 - Eta) * (1.0 + Zeta); + dNiXj[iGauss][6][0] = 0.125 * (1.0 + Eta) * (1.0 + Zeta); + dNiXj[iGauss][7][0] = -0.125 * (1.0 + Eta) * (1.0 + Zeta); /*--- dN/d eta ---*/ - dNiXj[iGauss][0][1] = -0.125*(1.0-Xi)*(1.0-Zeta); - dNiXj[iGauss][1][1] = -0.125*(1.0+Xi)*(1.0-Zeta); - dNiXj[iGauss][2][1] = 0.125*(1.0+Xi)*(1.0-Zeta); - dNiXj[iGauss][3][1] = 0.125*(1.0-Xi)*(1.0-Zeta); - dNiXj[iGauss][4][1] = -0.125*(1.0-Xi)*(1.0+Zeta); - dNiXj[iGauss][5][1] = -0.125*(1.0+Xi)*(1.0+Zeta); - dNiXj[iGauss][6][1] = 0.125*(1.0+Xi)*(1.0+Zeta); - dNiXj[iGauss][7][1] = 0.125*(1.0-Xi)*(1.0+Zeta); + dNiXj[iGauss][0][1] = -0.125 * (1.0 - Xi) * (1.0 - Zeta); + dNiXj[iGauss][1][1] = -0.125 * (1.0 + Xi) * (1.0 - Zeta); + dNiXj[iGauss][2][1] = 0.125 * (1.0 + Xi) * (1.0 - Zeta); + dNiXj[iGauss][3][1] = 0.125 * (1.0 - Xi) * (1.0 - Zeta); + dNiXj[iGauss][4][1] = -0.125 * (1.0 - Xi) * (1.0 + Zeta); + dNiXj[iGauss][5][1] = -0.125 * (1.0 + Xi) * (1.0 + Zeta); + dNiXj[iGauss][6][1] = 0.125 * (1.0 + Xi) * (1.0 + Zeta); + dNiXj[iGauss][7][1] = 0.125 * (1.0 - Xi) * (1.0 + Zeta); /*--- dN/d zeta ---*/ - dNiXj[iGauss][0][2] = -0.125*(1.0-Xi)*(1.0-Eta); - dNiXj[iGauss][1][2] = -0.125*(1.0+Xi)*(1.0-Eta); - dNiXj[iGauss][2][2] = -0.125*(1.0+Xi)*(1.0+Eta); - dNiXj[iGauss][3][2] = -0.125*(1.0-Xi)*(1.0+Eta); - dNiXj[iGauss][4][2] = 0.125*(1.0-Xi)*(1.0-Eta); - dNiXj[iGauss][5][2] = 0.125*(1.0+Xi)*(1.0-Eta); - dNiXj[iGauss][6][2] = 0.125*(1.0+Xi)*(1.0+Eta); - dNiXj[iGauss][7][2] = 0.125*(1.0-Xi)*(1.0+Eta); - + dNiXj[iGauss][0][2] = -0.125 * (1.0 - Xi) * (1.0 - Eta); + dNiXj[iGauss][1][2] = -0.125 * (1.0 + Xi) * (1.0 - Eta); + dNiXj[iGauss][2][2] = -0.125 * (1.0 + Xi) * (1.0 + Eta); + dNiXj[iGauss][3][2] = -0.125 * (1.0 - Xi) * (1.0 + Eta); + dNiXj[iGauss][4][2] = 0.125 * (1.0 - Xi) * (1.0 - Eta); + dNiXj[iGauss][5][2] = 0.125 * (1.0 + Xi) * (1.0 - Eta); + dNiXj[iGauss][6][2] = 0.125 * (1.0 + Xi) * (1.0 + Eta); + dNiXj[iGauss][7][2] = 0.125 * (1.0 - Xi) * (1.0 + Eta); } /*--- Store the extrapolation functions ---*/ su2double ExtrapCoord[8][3], sqrt3 = 1.732050807568877; - ExtrapCoord[0][0] = -sqrt3; ExtrapCoord[0][1] = -sqrt3; ExtrapCoord[0][2] = -sqrt3; - ExtrapCoord[1][0] = sqrt3; ExtrapCoord[1][1] = -sqrt3; ExtrapCoord[1][2] = -sqrt3; - ExtrapCoord[2][0] = sqrt3; ExtrapCoord[2][1] = sqrt3; ExtrapCoord[2][2] = -sqrt3; - ExtrapCoord[3][0] = -sqrt3; ExtrapCoord[3][1] = sqrt3; ExtrapCoord[3][2] = -sqrt3; - ExtrapCoord[4][0] = -sqrt3; ExtrapCoord[4][1] = -sqrt3; ExtrapCoord[4][2] = sqrt3; - ExtrapCoord[5][0] = sqrt3; ExtrapCoord[5][1] = -sqrt3; ExtrapCoord[5][2] = sqrt3; - ExtrapCoord[6][0] = sqrt3; ExtrapCoord[6][1] = sqrt3; ExtrapCoord[6][2] = sqrt3; - ExtrapCoord[7][0] = -sqrt3; ExtrapCoord[7][1] = sqrt3; ExtrapCoord[7][2] = sqrt3; + ExtrapCoord[0][0] = -sqrt3; + ExtrapCoord[0][1] = -sqrt3; + ExtrapCoord[0][2] = -sqrt3; + ExtrapCoord[1][0] = sqrt3; + ExtrapCoord[1][1] = -sqrt3; + ExtrapCoord[1][2] = -sqrt3; + ExtrapCoord[2][0] = sqrt3; + ExtrapCoord[2][1] = sqrt3; + ExtrapCoord[2][2] = -sqrt3; + ExtrapCoord[3][0] = -sqrt3; + ExtrapCoord[3][1] = sqrt3; + ExtrapCoord[3][2] = -sqrt3; + ExtrapCoord[4][0] = -sqrt3; + ExtrapCoord[4][1] = -sqrt3; + ExtrapCoord[4][2] = sqrt3; + ExtrapCoord[5][0] = sqrt3; + ExtrapCoord[5][1] = -sqrt3; + ExtrapCoord[5][2] = sqrt3; + ExtrapCoord[6][0] = sqrt3; + ExtrapCoord[6][1] = sqrt3; + ExtrapCoord[6][2] = sqrt3; + ExtrapCoord[7][0] = -sqrt3; + ExtrapCoord[7][1] = sqrt3; + ExtrapCoord[7][2] = sqrt3; for (iNode = 0; iNode < NNODE; iNode++) { - Xi = ExtrapCoord[iNode][0]; Eta = ExtrapCoord[iNode][1]; Zeta = ExtrapCoord[iNode][2]; - NodalExtrap[iNode][0] = 0.125*(1.0-Xi)*(1.0-Eta)*(1.0-Zeta); - NodalExtrap[iNode][1] = 0.125*(1.0+Xi)*(1.0-Eta)*(1.0-Zeta); - NodalExtrap[iNode][2] = 0.125*(1.0+Xi)*(1.0+Eta)*(1.0-Zeta); - NodalExtrap[iNode][3] = 0.125*(1.0-Xi)*(1.0+Eta)*(1.0-Zeta); - NodalExtrap[iNode][4] = 0.125*(1.0-Xi)*(1.0-Eta)*(1.0+Zeta); - NodalExtrap[iNode][5] = 0.125*(1.0+Xi)*(1.0-Eta)*(1.0+Zeta); - NodalExtrap[iNode][6] = 0.125*(1.0+Xi)*(1.0+Eta)*(1.0+Zeta); - NodalExtrap[iNode][7] = 0.125*(1.0-Xi)*(1.0+Eta)*(1.0+Zeta); - + NodalExtrap[iNode][0] = 0.125 * (1.0 - Xi) * (1.0 - Eta) * (1.0 - Zeta); + NodalExtrap[iNode][1] = 0.125 * (1.0 + Xi) * (1.0 - Eta) * (1.0 - Zeta); + NodalExtrap[iNode][2] = 0.125 * (1.0 + Xi) * (1.0 + Eta) * (1.0 - Zeta); + NodalExtrap[iNode][3] = 0.125 * (1.0 - Xi) * (1.0 + Eta) * (1.0 - Zeta); + NodalExtrap[iNode][4] = 0.125 * (1.0 - Xi) * (1.0 - Eta) * (1.0 + Zeta); + NodalExtrap[iNode][5] = 0.125 * (1.0 + Xi) * (1.0 - Eta) * (1.0 + Zeta); + NodalExtrap[iNode][6] = 0.125 * (1.0 + Xi) * (1.0 + Eta) * (1.0 + Zeta); + NodalExtrap[iNode][7] = 0.125 * (1.0 - Xi) * (1.0 + Eta) * (1.0 + Zeta); } - } su2double CHEXA8::ComputeVolume(const FrameType mode) const { - unsigned short iDim; - su2double r1[3] = {0.0,0.0,0.0}, r2[3] = {0.0,0.0,0.0}, r3[3] = {0.0,0.0,0.0}, CrossProduct[3] = {0.0,0.0,0.0}; + su2double r1[3] = {0.0, 0.0, 0.0}, r2[3] = {0.0, 0.0, 0.0}, r3[3] = {0.0, 0.0, 0.0}, + CrossProduct[3] = {0.0, 0.0, 0.0}; su2double Volume = 0.0; /*--- Select the appropriate source for the nodal coordinates depending on the frame requested for the gradient computation, REFERENCE (undeformed) or CURRENT (deformed)---*/ - const su2activematrix& Coord = (mode==REFERENCE) ? RefCoord : CurrentCoord; + const su2activematrix& Coord = (mode == REFERENCE) ? RefCoord : CurrentCoord; for (iDim = 0; iDim < NDIM; iDim++) { r1[iDim] = Coord[1][iDim] - Coord[0][iDim]; @@ -146,11 +187,11 @@ su2double CHEXA8::ComputeVolume(const FrameType mode) const { r3[iDim] = Coord[5][iDim] - Coord[0][iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume = fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume = fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; for (iDim = 0; iDim < NDIM; iDim++) { r1[iDim] = Coord[2][iDim] - Coord[0][iDim]; @@ -158,11 +199,11 @@ su2double CHEXA8::ComputeVolume(const FrameType mode) const { r3[iDim] = Coord[5][iDim] - Coord[0][iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; for (iDim = 0; iDim < NDIM; iDim++) { r1[iDim] = Coord[2][iDim] - Coord[0][iDim]; @@ -170,11 +211,11 @@ su2double CHEXA8::ComputeVolume(const FrameType mode) const { r3[iDim] = Coord[7][iDim] - Coord[0][iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; for (iDim = 0; iDim < NDIM; iDim++) { r1[iDim] = Coord[5][iDim] - Coord[0][iDim]; @@ -182,11 +223,11 @@ su2double CHEXA8::ComputeVolume(const FrameType mode) const { r3[iDim] = Coord[4][iDim] - Coord[0][iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; for (iDim = 0; iDim < NDIM; iDim++) { r1[iDim] = Coord[7][iDim] - Coord[2][iDim]; @@ -194,13 +235,11 @@ su2double CHEXA8::ComputeVolume(const FrameType mode) const { r3[iDim] = Coord[6][iDim] - Coord[2][iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; return Volume; - } - diff --git a/Common/src/geometry/elements/CLINE.cpp b/Common/src/geometry/elements/CLINE.cpp index f9b62361137..77365707589 100644 --- a/Common/src/geometry/elements/CLINE.cpp +++ b/Common/src/geometry/elements/CLINE.cpp @@ -2,7 +2,7 @@ * \file CLINE.cpp * \brief Definition of the 2-node line element with two Gauss points. * \author T. Dick - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,40 +27,38 @@ #include "../../../include/geometry/elements/CElement.hpp" -CLINE::CLINE() : CElementWithKnownSizes() { - +CLINE::CLINE() : CElementWithKnownSizes() { su2double Xi, val_Ni; /*--- Gauss coordinates and weights ---*/ su2double oneOnTwoSqrt3 = 0.288675134594813; - GaussCoord[0][0] = 0.5-oneOnTwoSqrt3; GaussWeight(0) = 0.5; - GaussCoord[1][0] = 0.5+oneOnTwoSqrt3; GaussWeight(1) = 0.5; + GaussCoord[0][0] = 0.5 - oneOnTwoSqrt3; + GaussWeight(0) = 0.5; + GaussCoord[1][0] = 0.5 + oneOnTwoSqrt3; + GaussWeight(1) = 0.5; /*--- Store the values of the shape functions and their derivatives ---*/ unsigned short iGauss; for (iGauss = 0; iGauss < nGaussPoints; iGauss++) { - Xi = GaussCoord[iGauss][0]; - val_Ni = 1.0-Xi; GaussPoint[iGauss].SetNi(val_Ni, 0); - val_Ni = Xi; GaussPoint[iGauss].SetNi(val_Ni, 1); + val_Ni = 1.0 - Xi; + GaussPoint[iGauss].SetNi(val_Ni, 0); + val_Ni = Xi; + GaussPoint[iGauss].SetNi(val_Ni, 1); /*--- dN/d xi ---*/ dNiXj[iGauss][0][0] = -1.0; dNiXj[iGauss][1][0] = 1.0; - } - } su2double CLINE::ComputeLength(const FrameType mode) const { - /*--- Select the appropriate source for the nodal coordinates depending on the frame requested for the gradient computation, REFERENCE (undeformed) or CURRENT (deformed)---*/ - const su2activematrix& Coord = (mode==REFERENCE) ? RefCoord : CurrentCoord; + const su2activematrix& Coord = (mode == REFERENCE) ? RefCoord : CurrentCoord; return fabs(Coord[1][0] - Coord[0][0]); - } diff --git a/Common/src/geometry/elements/CPRISM6.cpp b/Common/src/geometry/elements/CPRISM6.cpp index 4e7fb019a3d..6e672a41334 100644 --- a/Common/src/geometry/elements/CPRISM6.cpp +++ b/Common/src/geometry/elements/CPRISM6.cpp @@ -2,7 +2,7 @@ * \file CPRISM6.cpp * \brief Definition of the 6-node triangular prism element with 6 Gauss points. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,21 +27,37 @@ #include "../../../include/geometry/elements/CElement.hpp" - -CPRISM6::CPRISM6() : CElementWithKnownSizes() { - +CPRISM6::CPRISM6() : CElementWithKnownSizes() { /*--- Gauss coordinates and weights ---*/ /*--- There is some inconsistency between the shape functions and the order of the nodes that causes "negative" stiffness, the remedy is to use negative weights. ---*/ su2double oneOnSqrt3 = 0.577350269189626; - GaussCoord[0][0] = -oneOnSqrt3; GaussCoord[0][1] = 1.0/6.0; GaussCoord[0][2] = 1.0/6.0; GaussWeight(0) = -1.0/6.0; - GaussCoord[1][0] = -oneOnSqrt3; GaussCoord[1][1] = 2.0/3.0; GaussCoord[1][2] = 1.0/6.0; GaussWeight(1) = -1.0/6.0; - GaussCoord[2][0] = -oneOnSqrt3; GaussCoord[2][1] = 1.0/6.0; GaussCoord[2][2] = 2.0/3.0; GaussWeight(2) = -1.0/6.0; - GaussCoord[3][0] = oneOnSqrt3; GaussCoord[3][1] = 1.0/6.0; GaussCoord[3][2] = 1.0/6.0; GaussWeight(3) = -1.0/6.0; - GaussCoord[4][0] = oneOnSqrt3; GaussCoord[4][1] = 2.0/3.0; GaussCoord[4][2] = 1.0/6.0; GaussWeight(4) = -1.0/6.0; - GaussCoord[5][0] = oneOnSqrt3; GaussCoord[5][1] = 1.0/6.0; GaussCoord[5][2] = 2.0/3.0; GaussWeight(5) = -1.0/6.0; + GaussCoord[0][0] = -oneOnSqrt3; + GaussCoord[0][1] = 1.0 / 6.0; + GaussCoord[0][2] = 1.0 / 6.0; + GaussWeight(0) = -1.0 / 6.0; + GaussCoord[1][0] = -oneOnSqrt3; + GaussCoord[1][1] = 2.0 / 3.0; + GaussCoord[1][2] = 1.0 / 6.0; + GaussWeight(1) = -1.0 / 6.0; + GaussCoord[2][0] = -oneOnSqrt3; + GaussCoord[2][1] = 1.0 / 6.0; + GaussCoord[2][2] = 2.0 / 3.0; + GaussWeight(2) = -1.0 / 6.0; + GaussCoord[3][0] = oneOnSqrt3; + GaussCoord[3][1] = 1.0 / 6.0; + GaussCoord[3][2] = 1.0 / 6.0; + GaussWeight(3) = -1.0 / 6.0; + GaussCoord[4][0] = oneOnSqrt3; + GaussCoord[4][1] = 2.0 / 3.0; + GaussCoord[4][2] = 1.0 / 6.0; + GaussWeight(4) = -1.0 / 6.0; + GaussCoord[5][0] = oneOnSqrt3; + GaussCoord[5][1] = 1.0 / 6.0; + GaussCoord[5][2] = 2.0 / 3.0; + GaussWeight(5) = -1.0 / 6.0; /*--- Store the values of the shape functions and their derivatives ---*/ @@ -49,84 +65,97 @@ CPRISM6::CPRISM6() : CElementWithKnownSizes() { su2double Xi, Eta, Zeta, val_Ni; for (iGauss = 0; iGauss < NGAUSS; iGauss++) { - Xi = GaussCoord[iGauss][0]; Eta = GaussCoord[iGauss][1]; Zeta = GaussCoord[iGauss][2]; - val_Ni = 0.5*Eta*(1.0-Xi); GaussPoint[iGauss].SetNi(val_Ni,0); - val_Ni = 0.5*Zeta*(1.0-Xi); GaussPoint[iGauss].SetNi(val_Ni,1); - val_Ni = 0.5*(1.0-Eta-Zeta)*(1.0-Xi); GaussPoint[iGauss].SetNi(val_Ni,2); - val_Ni = 0.5*Eta*(Xi+1.0); GaussPoint[iGauss].SetNi(val_Ni,3); - val_Ni = 0.5*Zeta*(Xi+1.0); GaussPoint[iGauss].SetNi(val_Ni,4); - val_Ni = 0.5*(1.0-Eta-Zeta)*(Xi+1.0); GaussPoint[iGauss].SetNi(val_Ni,5); + val_Ni = 0.5 * Eta * (1.0 - Xi); + GaussPoint[iGauss].SetNi(val_Ni, 0); + val_Ni = 0.5 * Zeta * (1.0 - Xi); + GaussPoint[iGauss].SetNi(val_Ni, 1); + val_Ni = 0.5 * (1.0 - Eta - Zeta) * (1.0 - Xi); + GaussPoint[iGauss].SetNi(val_Ni, 2); + val_Ni = 0.5 * Eta * (Xi + 1.0); + GaussPoint[iGauss].SetNi(val_Ni, 3); + val_Ni = 0.5 * Zeta * (Xi + 1.0); + GaussPoint[iGauss].SetNi(val_Ni, 4); + val_Ni = 0.5 * (1.0 - Eta - Zeta) * (Xi + 1.0); + GaussPoint[iGauss].SetNi(val_Ni, 5); /*--- dN/d xi ---*/ - dNiXj[iGauss][0][0] = -0.5*Eta; - dNiXj[iGauss][1][0] = -0.5*Zeta; - dNiXj[iGauss][2][0] = -0.5*(1.0-Eta-Zeta); - dNiXj[iGauss][3][0] = 0.5*Eta; - dNiXj[iGauss][4][0] = 0.5*Zeta; - dNiXj[iGauss][5][0] = 0.5*(1.0-Eta-Zeta); + dNiXj[iGauss][0][0] = -0.5 * Eta; + dNiXj[iGauss][1][0] = -0.5 * Zeta; + dNiXj[iGauss][2][0] = -0.5 * (1.0 - Eta - Zeta); + dNiXj[iGauss][3][0] = 0.5 * Eta; + dNiXj[iGauss][4][0] = 0.5 * Zeta; + dNiXj[iGauss][5][0] = 0.5 * (1.0 - Eta - Zeta); /*--- dN/d eta ---*/ - dNiXj[iGauss][0][1] = 0.5*(1.0-Xi); - dNiXj[iGauss][1][1] = 0.0; - dNiXj[iGauss][2][1] = -0.5*(1.0-Xi); - dNiXj[iGauss][3][1] = 0.5*(Xi+1.0); - dNiXj[iGauss][4][1] = 0.0; - dNiXj[iGauss][5][1] = -0.5*(Xi+1.0); + dNiXj[iGauss][0][1] = 0.5 * (1.0 - Xi); + dNiXj[iGauss][1][1] = 0.0; + dNiXj[iGauss][2][1] = -0.5 * (1.0 - Xi); + dNiXj[iGauss][3][1] = 0.5 * (Xi + 1.0); + dNiXj[iGauss][4][1] = 0.0; + dNiXj[iGauss][5][1] = -0.5 * (Xi + 1.0); /*--- dN/d mu ---*/ - dNiXj[iGauss][0][2] = 0.0; - dNiXj[iGauss][1][2] = 0.5*(1.0-Xi); - dNiXj[iGauss][2][2] = -0.5*(1.0-Xi); - dNiXj[iGauss][3][2] = 0.0; - dNiXj[iGauss][4][2] = 0.5*(Xi+1.0); - dNiXj[iGauss][5][2] = -0.5*(Xi+1.0); - + dNiXj[iGauss][0][2] = 0.0; + dNiXj[iGauss][1][2] = 0.5 * (1.0 - Xi); + dNiXj[iGauss][2][2] = -0.5 * (1.0 - Xi); + dNiXj[iGauss][3][2] = 0.0; + dNiXj[iGauss][4][2] = 0.5 * (Xi + 1.0); + dNiXj[iGauss][5][2] = -0.5 * (Xi + 1.0); } /*--- Store the extrapolation functions ---*/ su2double ExtrapCoord[6][3], sqrt3 = 1.732050807568877; - ExtrapCoord[0][0] = -sqrt3; ExtrapCoord[0][1] = -1.0/3.0; ExtrapCoord[0][2] = -1.0/3.0; - ExtrapCoord[1][0] = -sqrt3; ExtrapCoord[1][1] = 5.0/3.0; ExtrapCoord[1][2] = -1.0/3.0; - ExtrapCoord[2][0] = -sqrt3; ExtrapCoord[2][1] = -1.0/3.0; ExtrapCoord[2][2] = 5.0/3.0; - ExtrapCoord[3][0] = sqrt3; ExtrapCoord[3][1] = -1.0/3.0; ExtrapCoord[3][2] = -1.0/3.0; - ExtrapCoord[4][0] = sqrt3; ExtrapCoord[4][1] = 5.0/3.0; ExtrapCoord[4][2] = -1.0/3.0; - ExtrapCoord[5][0] = sqrt3; ExtrapCoord[5][1] = -1.0/3.0; ExtrapCoord[5][2] = 5.0/3.0; + ExtrapCoord[0][0] = -sqrt3; + ExtrapCoord[0][1] = -1.0 / 3.0; + ExtrapCoord[0][2] = -1.0 / 3.0; + ExtrapCoord[1][0] = -sqrt3; + ExtrapCoord[1][1] = 5.0 / 3.0; + ExtrapCoord[1][2] = -1.0 / 3.0; + ExtrapCoord[2][0] = -sqrt3; + ExtrapCoord[2][1] = -1.0 / 3.0; + ExtrapCoord[2][2] = 5.0 / 3.0; + ExtrapCoord[3][0] = sqrt3; + ExtrapCoord[3][1] = -1.0 / 3.0; + ExtrapCoord[3][2] = -1.0 / 3.0; + ExtrapCoord[4][0] = sqrt3; + ExtrapCoord[4][1] = 5.0 / 3.0; + ExtrapCoord[4][2] = -1.0 / 3.0; + ExtrapCoord[5][0] = sqrt3; + ExtrapCoord[5][1] = -1.0 / 3.0; + ExtrapCoord[5][2] = 5.0 / 3.0; for (iNode = 0; iNode < NNODE; iNode++) { - Xi = ExtrapCoord[iNode][0]; Eta = ExtrapCoord[iNode][1]; Zeta = ExtrapCoord[iNode][2]; - NodalExtrap[iNode][0] = 0.5*Eta*(1.0-Xi); - NodalExtrap[iNode][1] = 0.5*Zeta*(1.0-Xi); - NodalExtrap[iNode][2] = 0.5*(1.0-Eta-Zeta)*(1.0-Xi); - NodalExtrap[iNode][3] = 0.5*Eta*(Xi+1.0); - NodalExtrap[iNode][4] = 0.5*Zeta*(Xi+1.0); - NodalExtrap[iNode][5] = 0.5*(1.0-Eta-Zeta)*(Xi+1.0); - + NodalExtrap[iNode][0] = 0.5 * Eta * (1.0 - Xi); + NodalExtrap[iNode][1] = 0.5 * Zeta * (1.0 - Xi); + NodalExtrap[iNode][2] = 0.5 * (1.0 - Eta - Zeta) * (1.0 - Xi); + NodalExtrap[iNode][3] = 0.5 * Eta * (Xi + 1.0); + NodalExtrap[iNode][4] = 0.5 * Zeta * (Xi + 1.0); + NodalExtrap[iNode][5] = 0.5 * (1.0 - Eta - Zeta) * (Xi + 1.0); } - } su2double CPRISM6::ComputeVolume(const FrameType mode) const { - unsigned short iDim; - su2double r1[3] = {0.0,0.0,0.0}, r2[3] = {0.0,0.0,0.0}, r3[3] = {0.0,0.0,0.0}, CrossProduct[3] = {0.0,0.0,0.0}; + su2double r1[3] = {0.0, 0.0, 0.0}, r2[3] = {0.0, 0.0, 0.0}, r3[3] = {0.0, 0.0, 0.0}, + CrossProduct[3] = {0.0, 0.0, 0.0}; su2double Volume = 0.0; /*--- Select the appropriate source for the nodal coordinates depending on the frame requested for the gradient computation, REFERENCE (undeformed) or CURRENT (deformed)---*/ - const su2activematrix& Coord = (mode==REFERENCE) ? RefCoord : CurrentCoord; + const su2activematrix& Coord = (mode == REFERENCE) ? RefCoord : CurrentCoord; for (iDim = 0; iDim < NDIM; iDim++) { r1[iDim] = Coord[2][iDim] - Coord[0][iDim]; @@ -134,11 +163,11 @@ su2double CPRISM6::ComputeVolume(const FrameType mode) const { r3[iDim] = Coord[5][iDim] - Coord[0][iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume = fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume = fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; for (iDim = 0; iDim < NDIM; iDim++) { r1[iDim] = Coord[5][iDim] - Coord[0][iDim]; @@ -146,11 +175,11 @@ su2double CPRISM6::ComputeVolume(const FrameType mode) const { r3[iDim] = Coord[4][iDim] - Coord[0][iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; for (iDim = 0; iDim < NDIM; iDim++) { r1[iDim] = Coord[5][iDim] - Coord[0][iDim]; @@ -158,13 +187,11 @@ su2double CPRISM6::ComputeVolume(const FrameType mode) const { r3[iDim] = Coord[3][iDim] - Coord[0][iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; return Volume; - } - diff --git a/Common/src/geometry/elements/CPYRAM5.cpp b/Common/src/geometry/elements/CPYRAM5.cpp index 9003a7d378e..9bf8ac96947 100644 --- a/Common/src/geometry/elements/CPYRAM5.cpp +++ b/Common/src/geometry/elements/CPYRAM5.cpp @@ -2,7 +2,7 @@ * \file CPYRAM5.cpp * \brief Definition of 5-node pyramid element with 5 Gauss points. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,16 +27,29 @@ #include "../../../include/geometry/elements/CElement.hpp" - -CPYRAM5::CPYRAM5() : CElementWithKnownSizes() { - +CPYRAM5::CPYRAM5() : CElementWithKnownSizes() { /*--- Gauss coordinates and weights ---*/ - GaussCoord[0][0] = 0.5; GaussCoord[0][1] = 0.0; GaussCoord[0][2] = 0.1531754163448146; GaussWeight(0) = 2.0/15.0; - GaussCoord[1][0] = 0.0; GaussCoord[1][1] = 0.5; GaussCoord[1][2] = 0.1531754163448146; GaussWeight(1) = 2.0/15.0; - GaussCoord[2][0] =-0.5; GaussCoord[2][1] = 0.0; GaussCoord[2][2] = 0.1531754163448146; GaussWeight(2) = 2.0/15.0; - GaussCoord[3][0] = 0.0; GaussCoord[3][1] =-0.5; GaussCoord[3][2] = 0.1531754163448146; GaussWeight(3) = 2.0/15.0; - GaussCoord[4][0] = 0.0; GaussCoord[4][1] = 0.0; GaussCoord[4][2] = 0.6372983346207416; GaussWeight(4) = 2.0/15.0; + GaussCoord[0][0] = 0.5; + GaussCoord[0][1] = 0.0; + GaussCoord[0][2] = 0.1531754163448146; + GaussWeight(0) = 2.0 / 15.0; + GaussCoord[1][0] = 0.0; + GaussCoord[1][1] = 0.5; + GaussCoord[1][2] = 0.1531754163448146; + GaussWeight(1) = 2.0 / 15.0; + GaussCoord[2][0] = -0.5; + GaussCoord[2][1] = 0.0; + GaussCoord[2][2] = 0.1531754163448146; + GaussWeight(2) = 2.0 / 15.0; + GaussCoord[3][0] = 0.0; + GaussCoord[3][1] = -0.5; + GaussCoord[3][2] = 0.1531754163448146; + GaussWeight(3) = 2.0 / 15.0; + GaussCoord[4][0] = 0.0; + GaussCoord[4][1] = 0.0; + GaussCoord[4][2] = 0.6372983346207416; + GaussWeight(4) = 2.0 / 15.0; /*--- Store the values of the shape functions and their derivatives ---*/ @@ -44,78 +57,90 @@ CPYRAM5::CPYRAM5() : CElementWithKnownSizes() { su2double Xi, Eta, Zeta, val_Ni; for (iGauss = 0; iGauss < NGAUSS; iGauss++) { - Xi = GaussCoord[iGauss][0]; Eta = GaussCoord[iGauss][1]; Zeta = GaussCoord[iGauss][2]; - val_Ni = 0.25*(-Xi+Eta+Zeta-1.0)*(-Xi-Eta+Zeta-1.0)/(1.0-Zeta); GaussPoint[iGauss].SetNi(val_Ni,0); - val_Ni = 0.25*(-Xi-Eta+Zeta-1.0)*( Xi-Eta+Zeta-1.0)/(1.0-Zeta); GaussPoint[iGauss].SetNi(val_Ni,1); - val_Ni = 0.25*( Xi+Eta+Zeta-1.0)*( Xi-Eta+Zeta-1.0)/(1.0-Zeta); GaussPoint[iGauss].SetNi(val_Ni,2); - val_Ni = 0.25*( Xi+Eta+Zeta-1.0)*(-Xi+Eta+Zeta-1.0)/(1.0-Zeta); GaussPoint[iGauss].SetNi(val_Ni,3); - val_Ni = Zeta; GaussPoint[iGauss].SetNi(val_Ni,4); + val_Ni = 0.25 * (-Xi + Eta + Zeta - 1.0) * (-Xi - Eta + Zeta - 1.0) / (1.0 - Zeta); + GaussPoint[iGauss].SetNi(val_Ni, 0); + val_Ni = 0.25 * (-Xi - Eta + Zeta - 1.0) * (Xi - Eta + Zeta - 1.0) / (1.0 - Zeta); + GaussPoint[iGauss].SetNi(val_Ni, 1); + val_Ni = 0.25 * (Xi + Eta + Zeta - 1.0) * (Xi - Eta + Zeta - 1.0) / (1.0 - Zeta); + GaussPoint[iGauss].SetNi(val_Ni, 2); + val_Ni = 0.25 * (Xi + Eta + Zeta - 1.0) * (-Xi + Eta + Zeta - 1.0) / (1.0 - Zeta); + GaussPoint[iGauss].SetNi(val_Ni, 3); + val_Ni = Zeta; + GaussPoint[iGauss].SetNi(val_Ni, 4); /*--- dN/d xi ---*/ - dNiXj[iGauss][0][0] = 0.5*(Zeta-Xi-1.0)/(Zeta-1.0); - dNiXj[iGauss][1][0] = 0.5*Xi/(Zeta-1.0); - dNiXj[iGauss][2][0] = 0.5*(1.0-Zeta-Xi)/(Zeta-1.0); + dNiXj[iGauss][0][0] = 0.5 * (Zeta - Xi - 1.0) / (Zeta - 1.0); + dNiXj[iGauss][1][0] = 0.5 * Xi / (Zeta - 1.0); + dNiXj[iGauss][2][0] = 0.5 * (1.0 - Zeta - Xi) / (Zeta - 1.0); dNiXj[iGauss][3][0] = dNiXj[iGauss][1][0]; dNiXj[iGauss][4][0] = 0.0; /*--- dN/d eta ---*/ - dNiXj[iGauss][0][1] = 0.5*Eta/(Zeta-1.0); - dNiXj[iGauss][1][1] = 0.5*(Zeta-Eta-1.0)/(Zeta-1.0); + dNiXj[iGauss][0][1] = 0.5 * Eta / (Zeta - 1.0); + dNiXj[iGauss][1][1] = 0.5 * (Zeta - Eta - 1.0) / (Zeta - 1.0); dNiXj[iGauss][2][1] = dNiXj[iGauss][0][1]; - dNiXj[iGauss][3][1] = 0.5*(1.0-Zeta-Eta)/(Zeta-1.0); + dNiXj[iGauss][3][1] = 0.5 * (1.0 - Zeta - Eta) / (Zeta - 1.0); dNiXj[iGauss][4][1] = 0.0; /*--- dN/d zeta ---*/ - dNiXj[iGauss][0][2] = 0.25*(-1.0 + 2.0*Zeta - Zeta*Zeta - Eta*Eta + Xi*Xi)/((1.0-Zeta)*(1.0-Zeta)); - dNiXj[iGauss][1][2] = 0.25*(-1.0 + 2.0*Zeta - Zeta*Zeta + Eta*Eta - Xi*Xi)/((1.0-Zeta)*(1.0-Zeta)); + dNiXj[iGauss][0][2] = + 0.25 * (-1.0 + 2.0 * Zeta - Zeta * Zeta - Eta * Eta + Xi * Xi) / ((1.0 - Zeta) * (1.0 - Zeta)); + dNiXj[iGauss][1][2] = + 0.25 * (-1.0 + 2.0 * Zeta - Zeta * Zeta + Eta * Eta - Xi * Xi) / ((1.0 - Zeta) * (1.0 - Zeta)); dNiXj[iGauss][2][2] = dNiXj[iGauss][0][2]; dNiXj[iGauss][3][2] = dNiXj[iGauss][1][2]; dNiXj[iGauss][4][2] = 1.0; - } /*--- Store the extrapolation functions ---*/ su2double ExtrapCoord[5][3]; - ExtrapCoord[0][0] = 2.0; ExtrapCoord[0][1] = 0.0; ExtrapCoord[0][2] = -0.316397779494322; - ExtrapCoord[1][0] = 0.0; ExtrapCoord[1][1] = 2.0; ExtrapCoord[1][2] = -0.316397779494322; - ExtrapCoord[2][0] = -2.0; ExtrapCoord[2][1] = 0.0; ExtrapCoord[2][2] = -0.316397779494322; - ExtrapCoord[3][0] = 0.0; ExtrapCoord[3][1] = -2.0; ExtrapCoord[3][2] = -0.316397779494322; - ExtrapCoord[4][0] = 0.0; ExtrapCoord[4][1] = 0.0; ExtrapCoord[4][2] = 1.749193338482970; + ExtrapCoord[0][0] = 2.0; + ExtrapCoord[0][1] = 0.0; + ExtrapCoord[0][2] = -0.316397779494322; + ExtrapCoord[1][0] = 0.0; + ExtrapCoord[1][1] = 2.0; + ExtrapCoord[1][2] = -0.316397779494322; + ExtrapCoord[2][0] = -2.0; + ExtrapCoord[2][1] = 0.0; + ExtrapCoord[2][2] = -0.316397779494322; + ExtrapCoord[3][0] = 0.0; + ExtrapCoord[3][1] = -2.0; + ExtrapCoord[3][2] = -0.316397779494322; + ExtrapCoord[4][0] = 0.0; + ExtrapCoord[4][1] = 0.0; + ExtrapCoord[4][2] = 1.749193338482970; for (iNode = 0; iNode < NNODE; iNode++) { - Xi = ExtrapCoord[iNode][0]; Eta = ExtrapCoord[iNode][1]; Zeta = ExtrapCoord[iNode][2]; - NodalExtrap[iNode][0] = 0.25*(-Xi+Eta+Zeta-1.0)*(-Xi-Eta+Zeta-1.0)/(1.0-Zeta); - NodalExtrap[iNode][1] = 0.25*(-Xi-Eta+Zeta-1.0)*( Xi-Eta+Zeta-1.0)/(1.0-Zeta); - NodalExtrap[iNode][2] = 0.25*( Xi+Eta+Zeta-1.0)*( Xi-Eta+Zeta-1.0)/(1.0-Zeta); - NodalExtrap[iNode][3] = 0.25*( Xi+Eta+Zeta-1.0)*(-Xi+Eta+Zeta-1.0)/(1.0-Zeta); + NodalExtrap[iNode][0] = 0.25 * (-Xi + Eta + Zeta - 1.0) * (-Xi - Eta + Zeta - 1.0) / (1.0 - Zeta); + NodalExtrap[iNode][1] = 0.25 * (-Xi - Eta + Zeta - 1.0) * (Xi - Eta + Zeta - 1.0) / (1.0 - Zeta); + NodalExtrap[iNode][2] = 0.25 * (Xi + Eta + Zeta - 1.0) * (Xi - Eta + Zeta - 1.0) / (1.0 - Zeta); + NodalExtrap[iNode][3] = 0.25 * (Xi + Eta + Zeta - 1.0) * (-Xi + Eta + Zeta - 1.0) / (1.0 - Zeta); NodalExtrap[iNode][4] = Zeta; - } - } su2double CPYRAM5::ComputeVolume(const FrameType mode) const { - unsigned short iDim; - su2double r1[3] = {0.0,0.0,0.0}, r2[3] = {0.0,0.0,0.0}, r3[3] = {0.0,0.0,0.0}, CrossProduct[3] = {0.0,0.0,0.0}; + su2double r1[3] = {0.0, 0.0, 0.0}, r2[3] = {0.0, 0.0, 0.0}, r3[3] = {0.0, 0.0, 0.0}, + CrossProduct[3] = {0.0, 0.0, 0.0}; su2double Volume = 0.0; /*--- Select the appropriate source for the nodal coordinates depending on the frame requested for the gradient computation, REFERENCE (undeformed) or CURRENT (deformed)---*/ - const su2activematrix& Coord = (mode==REFERENCE) ? RefCoord : CurrentCoord; + const su2activematrix& Coord = (mode == REFERENCE) ? RefCoord : CurrentCoord; for (iDim = 0; iDim < NDIM; iDim++) { r1[iDim] = Coord[1][iDim] - Coord[0][iDim]; @@ -123,11 +148,11 @@ su2double CPYRAM5::ComputeVolume(const FrameType mode) const { r3[iDim] = Coord[4][iDim] - Coord[0][iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume = fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume = fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; for (iDim = 0; iDim < NDIM; iDim++) { r1[iDim] = Coord[2][iDim] - Coord[0][iDim]; @@ -135,13 +160,11 @@ su2double CPYRAM5::ComputeVolume(const FrameType mode) const { r3[iDim] = Coord[4][iDim] - Coord[0][iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; return Volume; - } - diff --git a/Common/src/geometry/elements/CPYRAM6.cpp b/Common/src/geometry/elements/CPYRAM6.cpp index 8ea03251f51..a216fee8dc4 100644 --- a/Common/src/geometry/elements/CPYRAM6.cpp +++ b/Common/src/geometry/elements/CPYRAM6.cpp @@ -2,7 +2,7 @@ * \file CPYRAM6.cpp * \brief Definition of 5-node pyramid element with 6 Gauss points. * \author T.Dick - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,95 +27,124 @@ #include "../../../include/geometry/elements/CElement.hpp" - -CPYRAM6::CPYRAM6() : CElementWithKnownSizes() { - +CPYRAM6::CPYRAM6() : CElementWithKnownSizes() { /*--- Gauss coordinates and weights ---*/ - GaussCoord[0][0] = sqrt(4.0/27.0); GaussCoord[0][1] = sqrt(4.0/27.0); GaussCoord[0][2] = 1.0/6.0; GaussWeight(0) = 9.0/20.0; - GaussCoord[0][0] = sqrt(4.0/27.0); GaussCoord[0][1] = sqrt(4.0/27.0); GaussCoord[0][2] = 1.0/6.0; GaussWeight(1) = 9.0/20.0; - GaussCoord[0][0] = sqrt(4.0/27.0); GaussCoord[0][1] = sqrt(4.0/27.0); GaussCoord[0][2] = 1.0/6.0; GaussWeight(2) = 9.0/20.0; - GaussCoord[0][0] = sqrt(4.0/27.0); GaussCoord[0][1] = sqrt(4.0/27.0); GaussCoord[0][2] = 1.0/6.0; GaussWeight(3) = 9.0/20.0; - GaussCoord[4][0] = 0.0; GaussCoord[4][1] = 0.0; GaussCoord[4][2] = 0.5; GaussWeight(4) = 3.0/5.0; - GaussCoord[5][0] = 0.0; GaussCoord[5][1] = 0.0; GaussCoord[5][2] = 0.25; GaussWeight(5) = -16.0/15.0; - - /*--- Store the values of the shape functions and their derivatives ---*/ - - unsigned short iNode, iGauss; - su2double Xi, Eta, Zeta, val_Ni; - - for (iGauss = 0; iGauss < nGaussPoints; iGauss++) { - - Xi = GaussCoord[iGauss][0]; - Eta = GaussCoord[iGauss][1]; - Zeta = GaussCoord[iGauss][2]; - - val_Ni = 0.25*(-Xi+Eta+Zeta-1.0)*(-Xi-Eta+Zeta-1.0)/(1.0-Zeta); GaussPoint[iGauss].SetNi(val_Ni,0); - val_Ni = 0.25*(-Xi-Eta+Zeta-1.0)*( Xi-Eta+Zeta-1.0)/(1.0-Zeta); GaussPoint[iGauss].SetNi(val_Ni,1); - val_Ni = 0.25*( Xi+Eta+Zeta-1.0)*( Xi-Eta+Zeta-1.0)/(1.0-Zeta); GaussPoint[iGauss].SetNi(val_Ni,2); - val_Ni = 0.25*( Xi+Eta+Zeta-1.0)*(-Xi+Eta+Zeta-1.0)/(1.0-Zeta); GaussPoint[iGauss].SetNi(val_Ni,3); - val_Ni = Zeta; GaussPoint[iGauss].SetNi(val_Ni,4); - - /*--- dN/d xi ---*/ - - dNiXj[iGauss][0][0] = 0.5*(Zeta-Xi-1.0)/(Zeta-1.0); - dNiXj[iGauss][1][0] = 0.5*Xi/(Zeta-1.0); - dNiXj[iGauss][2][0] = 0.5*(1.0-Zeta-Xi)/(Zeta-1.0); - dNiXj[iGauss][3][0] = dNiXj[iGauss][1][0]; - dNiXj[iGauss][4][0] = 0.0; - - /*--- dN/d eta ---*/ - - dNiXj[iGauss][0][1] = 0.5*Eta/(Zeta-1.0); - dNiXj[iGauss][1][1] = 0.5*(Zeta-Eta-1.0)/(Zeta-1.0); - dNiXj[iGauss][2][1] = dNiXj[iGauss][0][1]; - dNiXj[iGauss][3][1] = 0.5*(1.0-Zeta-Eta)/(Zeta-1.0); - dNiXj[iGauss][4][1] = 0.0; - - /*--- dN/d zeta ---*/ - - dNiXj[iGauss][0][2] = 0.25*(-1.0 + 2.0*Zeta - Zeta*Zeta - Eta*Eta + Xi*Xi)/((1.0-Zeta)*(1.0-Zeta)); - dNiXj[iGauss][1][2] = 0.25*(-1.0 + 2.0*Zeta - Zeta*Zeta + Eta*Eta - Xi*Xi)/((1.0-Zeta)*(1.0-Zeta)); - dNiXj[iGauss][2][2] = dNiXj[iGauss][0][2]; - dNiXj[iGauss][3][2] = dNiXj[iGauss][1][2]; - dNiXj[iGauss][4][2] = 1.0; - - } - - /*--- Store the extrapolation functions ---*/ - - su2double ExtrapCoord[5][3]; - - ExtrapCoord[0][0] = 2.0; ExtrapCoord[0][1] = 0.0; ExtrapCoord[0][2] = -0.316397779494322; - ExtrapCoord[1][0] = 0.0; ExtrapCoord[1][1] = 2.0; ExtrapCoord[1][2] = -0.316397779494322; - ExtrapCoord[2][0] = -2.0; ExtrapCoord[2][1] = 0.0; ExtrapCoord[2][2] = -0.316397779494322; - ExtrapCoord[3][0] = 0.0; ExtrapCoord[3][1] = -2.0; ExtrapCoord[3][2] = -0.316397779494322; - ExtrapCoord[4][0] = 0.0; ExtrapCoord[4][1] = 0.0; ExtrapCoord[4][2] = 1.749193338482970; - - for (iNode = 0; iNode < nNodes; iNode++) { - - Xi = ExtrapCoord[iNode][0]; - Eta = ExtrapCoord[iNode][1]; - Zeta = ExtrapCoord[iNode][2]; - - NodalExtrap[iNode][0] = 0.25*(-Xi+Eta+Zeta-1.0)*(-Xi-Eta+Zeta-1.0)/(1.0-Zeta); - NodalExtrap[iNode][1] = 0.25*(-Xi-Eta+Zeta-1.0)*( Xi-Eta+Zeta-1.0)/(1.0-Zeta); - NodalExtrap[iNode][2] = 0.25*( Xi+Eta+Zeta-1.0)*( Xi-Eta+Zeta-1.0)/(1.0-Zeta); - NodalExtrap[iNode][3] = 0.25*( Xi+Eta+Zeta-1.0)*(-Xi+Eta+Zeta-1.0)/(1.0-Zeta); - NodalExtrap[iNode][4] = Zeta; + GaussCoord[0][0] = sqrt(4.0 / 27.0); + GaussCoord[0][1] = sqrt(4.0 / 27.0); + GaussCoord[0][2] = 1.0 / 6.0; + GaussWeight(0) = 9.0 / 20.0; + GaussCoord[0][0] = sqrt(4.0 / 27.0); + GaussCoord[0][1] = sqrt(4.0 / 27.0); + GaussCoord[0][2] = 1.0 / 6.0; + GaussWeight(1) = 9.0 / 20.0; + GaussCoord[0][0] = sqrt(4.0 / 27.0); + GaussCoord[0][1] = sqrt(4.0 / 27.0); + GaussCoord[0][2] = 1.0 / 6.0; + GaussWeight(2) = 9.0 / 20.0; + GaussCoord[0][0] = sqrt(4.0 / 27.0); + GaussCoord[0][1] = sqrt(4.0 / 27.0); + GaussCoord[0][2] = 1.0 / 6.0; + GaussWeight(3) = 9.0 / 20.0; + GaussCoord[4][0] = 0.0; + GaussCoord[4][1] = 0.0; + GaussCoord[4][2] = 0.5; + GaussWeight(4) = 3.0 / 5.0; + GaussCoord[5][0] = 0.0; + GaussCoord[5][1] = 0.0; + GaussCoord[5][2] = 0.25; + GaussWeight(5) = -16.0 / 15.0; + + /*--- Store the values of the shape functions and their derivatives ---*/ + + unsigned short iNode, iGauss; + su2double Xi, Eta, Zeta, val_Ni; + + for (iGauss = 0; iGauss < nGaussPoints; iGauss++) { + Xi = GaussCoord[iGauss][0]; + Eta = GaussCoord[iGauss][1]; + Zeta = GaussCoord[iGauss][2]; + + val_Ni = 0.25 * (-Xi + Eta + Zeta - 1.0) * (-Xi - Eta + Zeta - 1.0) / (1.0 - Zeta); + GaussPoint[iGauss].SetNi(val_Ni, 0); + val_Ni = 0.25 * (-Xi - Eta + Zeta - 1.0) * (Xi - Eta + Zeta - 1.0) / (1.0 - Zeta); + GaussPoint[iGauss].SetNi(val_Ni, 1); + val_Ni = 0.25 * (Xi + Eta + Zeta - 1.0) * (Xi - Eta + Zeta - 1.0) / (1.0 - Zeta); + GaussPoint[iGauss].SetNi(val_Ni, 2); + val_Ni = 0.25 * (Xi + Eta + Zeta - 1.0) * (-Xi + Eta + Zeta - 1.0) / (1.0 - Zeta); + GaussPoint[iGauss].SetNi(val_Ni, 3); + val_Ni = Zeta; + GaussPoint[iGauss].SetNi(val_Ni, 4); + + /*--- dN/d xi ---*/ + + dNiXj[iGauss][0][0] = 0.5 * (Zeta - Xi - 1.0) / (Zeta - 1.0); + dNiXj[iGauss][1][0] = 0.5 * Xi / (Zeta - 1.0); + dNiXj[iGauss][2][0] = 0.5 * (1.0 - Zeta - Xi) / (Zeta - 1.0); + dNiXj[iGauss][3][0] = dNiXj[iGauss][1][0]; + dNiXj[iGauss][4][0] = 0.0; + + /*--- dN/d eta ---*/ + + dNiXj[iGauss][0][1] = 0.5 * Eta / (Zeta - 1.0); + dNiXj[iGauss][1][1] = 0.5 * (Zeta - Eta - 1.0) / (Zeta - 1.0); + dNiXj[iGauss][2][1] = dNiXj[iGauss][0][1]; + dNiXj[iGauss][3][1] = 0.5 * (1.0 - Zeta - Eta) / (Zeta - 1.0); + dNiXj[iGauss][4][1] = 0.0; + + /*--- dN/d zeta ---*/ + + dNiXj[iGauss][0][2] = + 0.25 * (-1.0 + 2.0 * Zeta - Zeta * Zeta - Eta * Eta + Xi * Xi) / ((1.0 - Zeta) * (1.0 - Zeta)); + dNiXj[iGauss][1][2] = + 0.25 * (-1.0 + 2.0 * Zeta - Zeta * Zeta + Eta * Eta - Xi * Xi) / ((1.0 - Zeta) * (1.0 - Zeta)); + dNiXj[iGauss][2][2] = dNiXj[iGauss][0][2]; + dNiXj[iGauss][3][2] = dNiXj[iGauss][1][2]; + dNiXj[iGauss][4][2] = 1.0; + } - } + /*--- Store the extrapolation functions ---*/ + + su2double ExtrapCoord[5][3]; + + ExtrapCoord[0][0] = 2.0; + ExtrapCoord[0][1] = 0.0; + ExtrapCoord[0][2] = -0.316397779494322; + ExtrapCoord[1][0] = 0.0; + ExtrapCoord[1][1] = 2.0; + ExtrapCoord[1][2] = -0.316397779494322; + ExtrapCoord[2][0] = -2.0; + ExtrapCoord[2][1] = 0.0; + ExtrapCoord[2][2] = -0.316397779494322; + ExtrapCoord[3][0] = 0.0; + ExtrapCoord[3][1] = -2.0; + ExtrapCoord[3][2] = -0.316397779494322; + ExtrapCoord[4][0] = 0.0; + ExtrapCoord[4][1] = 0.0; + ExtrapCoord[4][2] = 1.749193338482970; + + for (iNode = 0; iNode < nNodes; iNode++) { + Xi = ExtrapCoord[iNode][0]; + Eta = ExtrapCoord[iNode][1]; + Zeta = ExtrapCoord[iNode][2]; + + NodalExtrap[iNode][0] = 0.25 * (-Xi + Eta + Zeta - 1.0) * (-Xi - Eta + Zeta - 1.0) / (1.0 - Zeta); + NodalExtrap[iNode][1] = 0.25 * (-Xi - Eta + Zeta - 1.0) * (Xi - Eta + Zeta - 1.0) / (1.0 - Zeta); + NodalExtrap[iNode][2] = 0.25 * (Xi + Eta + Zeta - 1.0) * (Xi - Eta + Zeta - 1.0) / (1.0 - Zeta); + NodalExtrap[iNode][3] = 0.25 * (Xi + Eta + Zeta - 1.0) * (-Xi + Eta + Zeta - 1.0) / (1.0 - Zeta); + NodalExtrap[iNode][4] = Zeta; + } } su2double CPYRAM6::ComputeVolume(const FrameType mode) const { - unsigned short iDim; - su2double r1[3] = {0.0,0.0,0.0}, r2[3] = {0.0,0.0,0.0}, r3[3] = {0.0,0.0,0.0}, CrossProduct[3] = {0.0,0.0,0.0}; + su2double r1[3] = {0.0, 0.0, 0.0}, r2[3] = {0.0, 0.0, 0.0}, r3[3] = {0.0, 0.0, 0.0}, + CrossProduct[3] = {0.0, 0.0, 0.0}; su2double Volume = 0.0; /*--- Select the appropriate source for the nodal coordinates depending on the frame requested for the gradient computation, REFERENCE (undeformed) or CURRENT (deformed)---*/ - const su2activematrix& Coord = (mode==REFERENCE) ? RefCoord : CurrentCoord; + const su2activematrix& Coord = (mode == REFERENCE) ? RefCoord : CurrentCoord; for (iDim = 0; iDim < NDIM; iDim++) { r1[iDim] = Coord[1][iDim] - Coord[0][iDim]; @@ -123,11 +152,11 @@ su2double CPYRAM6::ComputeVolume(const FrameType mode) const { r3[iDim] = Coord[4][iDim] - Coord[0][iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume = fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume = fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; for (iDim = 0; iDim < NDIM; iDim++) { r1[iDim] = Coord[2][iDim] - Coord[0][iDim]; @@ -135,13 +164,11 @@ su2double CPYRAM6::ComputeVolume(const FrameType mode) const { r3[iDim] = Coord[4][iDim] - Coord[0][iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; return Volume; - } - diff --git a/Common/src/geometry/elements/CQUAD4.cpp b/Common/src/geometry/elements/CQUAD4.cpp index 5a495abcb07..ab8a2db37bc 100644 --- a/Common/src/geometry/elements/CQUAD4.cpp +++ b/Common/src/geometry/elements/CQUAD4.cpp @@ -2,7 +2,7 @@ * \file CQUAD4.cpp * \brief Definition of the 4-node quadrilateral element with 4 Gauss points. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,17 +27,23 @@ #include "../../../include/geometry/elements/CElement.hpp" - -CQUAD4::CQUAD4() : CElementWithKnownSizes() { - +CQUAD4::CQUAD4() : CElementWithKnownSizes() { /*--- Gauss coordinates and weights ---*/ su2double oneOnSqrt3 = 0.577350269189626; - GaussCoord[0][0] = -oneOnSqrt3; GaussCoord[0][1] = -oneOnSqrt3; GaussWeight(0) = 1.0; - GaussCoord[1][0] = oneOnSqrt3; GaussCoord[1][1] = -oneOnSqrt3; GaussWeight(1) = 1.0; - GaussCoord[2][0] = oneOnSqrt3; GaussCoord[2][1] = oneOnSqrt3; GaussWeight(2) = 1.0; - GaussCoord[3][0] = -oneOnSqrt3; GaussCoord[3][1] = oneOnSqrt3; GaussWeight(3) = 1.0; + GaussCoord[0][0] = -oneOnSqrt3; + GaussCoord[0][1] = -oneOnSqrt3; + GaussWeight(0) = 1.0; + GaussCoord[1][0] = oneOnSqrt3; + GaussCoord[1][1] = -oneOnSqrt3; + GaussWeight(1) = 1.0; + GaussCoord[2][0] = oneOnSqrt3; + GaussCoord[2][1] = oneOnSqrt3; + GaussWeight(2) = 1.0; + GaussCoord[3][0] = -oneOnSqrt3; + GaussCoord[3][1] = oneOnSqrt3; + GaussWeight(3) = 1.0; /*--- Store the values of the shape functions and their derivatives ---*/ @@ -45,70 +51,66 @@ CQUAD4::CQUAD4() : CElementWithKnownSizes() { su2double Xi, Eta; for (iGauss = 0; iGauss < NGAUSS; iGauss++) { - Xi = GaussCoord[iGauss][0]; Eta = GaussCoord[iGauss][1]; su2double Ni[4] = {0.0}; ShapeFunctions(Xi, Eta, Ni); - for (jGauss = 0; jGauss < NGAUSS; jGauss++) - GaussPoint[iGauss].SetNi(Ni[jGauss], jGauss); + for (jGauss = 0; jGauss < NGAUSS; jGauss++) GaussPoint[iGauss].SetNi(Ni[jGauss], jGauss); /*--- dN/d xi, dN/d eta ---*/ ShapeFunctionJacobian(Xi, Eta, dNiXj[iGauss]); - } /*--- Store the extrapolation functions (used to compute nodal stresses) ---*/ - su2double ExtrapCoord[4][2], sqrt3 = 1.732050807568877;; + su2double ExtrapCoord[4][2], sqrt3 = 1.732050807568877; + ; - ExtrapCoord[0][0] = -sqrt3; ExtrapCoord[0][1] = -sqrt3; - ExtrapCoord[1][0] = sqrt3; ExtrapCoord[1][1] = -sqrt3; - ExtrapCoord[2][0] = sqrt3; ExtrapCoord[2][1] = sqrt3; - ExtrapCoord[3][0] = -sqrt3; ExtrapCoord[3][1] = sqrt3; + ExtrapCoord[0][0] = -sqrt3; + ExtrapCoord[0][1] = -sqrt3; + ExtrapCoord[1][0] = sqrt3; + ExtrapCoord[1][1] = -sqrt3; + ExtrapCoord[2][0] = sqrt3; + ExtrapCoord[2][1] = sqrt3; + ExtrapCoord[3][0] = -sqrt3; + ExtrapCoord[3][1] = sqrt3; for (iNode = 0; iNode < NNODE; iNode++) { - Xi = ExtrapCoord[iNode][0]; Eta = ExtrapCoord[iNode][1]; - NodalExtrap[iNode][0] = 0.25*(1.0-Xi)*(1.0-Eta); - NodalExtrap[iNode][1] = 0.25*(1.0+Xi)*(1.0-Eta); - NodalExtrap[iNode][2] = 0.25*(1.0+Xi)*(1.0+Eta); - NodalExtrap[iNode][3] = 0.25*(1.0-Xi)*(1.0+Eta); - + NodalExtrap[iNode][0] = 0.25 * (1.0 - Xi) * (1.0 - Eta); + NodalExtrap[iNode][1] = 0.25 * (1.0 + Xi) * (1.0 - Eta); + NodalExtrap[iNode][2] = 0.25 * (1.0 + Xi) * (1.0 + Eta); + NodalExtrap[iNode][3] = 0.25 * (1.0 - Xi) * (1.0 + Eta); } - } su2double CQUAD4::ComputeArea(const FrameType mode) const { - unsigned short iDim; - su2double a[2] = {0.0,0.0}, b[2] = {0.0,0.0}; + su2double a[2] = {0.0, 0.0}, b[2] = {0.0, 0.0}; su2double Area = 0.0; /*--- Select the appropriate source for the nodal coordinates depending on the frame requested for the gradient computation, REFERENCE (undeformed) or CURRENT (deformed)---*/ - const su2activematrix& Coord = (mode==REFERENCE) ? RefCoord : CurrentCoord; + const su2activematrix& Coord = (mode == REFERENCE) ? RefCoord : CurrentCoord; for (iDim = 0; iDim < NDIM; iDim++) { - a[iDim] = Coord[0][iDim]-Coord[2][iDim]; - b[iDim] = Coord[1][iDim]-Coord[2][iDim]; + a[iDim] = Coord[0][iDim] - Coord[2][iDim]; + b[iDim] = Coord[1][iDim] - Coord[2][iDim]; } - Area = 0.5*fabs(a[0]*b[1]-a[1]*b[0]); + Area = 0.5 * fabs(a[0] * b[1] - a[1] * b[0]); for (iDim = 0; iDim < NDIM; iDim++) { - a[iDim] = Coord[0][iDim]-Coord[3][iDim]; - b[iDim] = Coord[2][iDim]-Coord[3][iDim]; + a[iDim] = Coord[0][iDim] - Coord[3][iDim]; + b[iDim] = Coord[2][iDim] - Coord[3][iDim]; } - Area += 0.5*fabs(a[0]*b[1]-a[1]*b[0]); + Area += 0.5 * fabs(a[0] * b[1] - a[1] * b[0]); return Area; - } - diff --git a/Common/src/geometry/elements/CTETRA1.cpp b/Common/src/geometry/elements/CTETRA1.cpp index 41242eec185..e6b5e8ca395 100644 --- a/Common/src/geometry/elements/CTETRA1.cpp +++ b/Common/src/geometry/elements/CTETRA1.cpp @@ -2,7 +2,7 @@ * \file CTETRA1.cpp * \brief Definition of 4-node tetra element with 1 Gauss point. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -28,11 +28,13 @@ #include "../../../include/geometry/elements/CElement.hpp" #include "../../../include/toolboxes/geometry_toolbox.hpp" -CTETRA1::CTETRA1() : CElementWithKnownSizes() { - +CTETRA1::CTETRA1() : CElementWithKnownSizes() { /*--- Gauss coordinates and weights ---*/ - GaussCoord[0][0] = 0.25; GaussCoord[0][1] = 0.25; GaussCoord[0][2] = 0.25; GaussWeight(0) = 1.0/6.0; + GaussCoord[0][0] = 0.25; + GaussCoord[0][1] = 0.25; + GaussCoord[0][2] = 0.25; + GaussWeight(0) = 1.0 / 6.0; /*--- Store the values of the shape functions and their derivatives ---*/ @@ -40,23 +42,33 @@ CTETRA1::CTETRA1() : CElementWithKnownSizes() { su2double Xi, Eta, Zeta, val_Ni; for (iGauss = 0; iGauss < NGAUSS; iGauss++) { - Xi = GaussCoord[iGauss][0]; Eta = GaussCoord[iGauss][1]; Zeta = GaussCoord[iGauss][2]; - val_Ni = Xi; GaussPoint[iGauss].SetNi(val_Ni,0); - val_Ni = Eta; GaussPoint[iGauss].SetNi(val_Ni,1); - val_Ni = 1.0-Xi-Eta-Zeta; GaussPoint[iGauss].SetNi(val_Ni,2); - val_Ni = Zeta; GaussPoint[iGauss].SetNi(val_Ni,3); + val_Ni = Xi; + GaussPoint[iGauss].SetNi(val_Ni, 0); + val_Ni = Eta; + GaussPoint[iGauss].SetNi(val_Ni, 1); + val_Ni = 1.0 - Xi - Eta - Zeta; + GaussPoint[iGauss].SetNi(val_Ni, 2); + val_Ni = Zeta; + GaussPoint[iGauss].SetNi(val_Ni, 3); /*--- dN/d xi, dN/d eta, dN/d zeta ---*/ - dNiXj[iGauss][0][0] = 1.0; dNiXj[iGauss][0][1] = 0.0; dNiXj[iGauss][0][2] = 0.0; - dNiXj[iGauss][1][0] = 0.0; dNiXj[iGauss][1][1] = 1.0; dNiXj[iGauss][1][2] = 0.0; - dNiXj[iGauss][2][0] = -1.0; dNiXj[iGauss][2][1] = -1.0; dNiXj[iGauss][2][2] = -1.0; - dNiXj[iGauss][3][0] = 0.0; dNiXj[iGauss][3][1] = 0.0; dNiXj[iGauss][3][2] = 1.0; - + dNiXj[iGauss][0][0] = 1.0; + dNiXj[iGauss][0][1] = 0.0; + dNiXj[iGauss][0][2] = 0.0; + dNiXj[iGauss][1][0] = 0.0; + dNiXj[iGauss][1][1] = 1.0; + dNiXj[iGauss][1][2] = 0.0; + dNiXj[iGauss][2][0] = -1.0; + dNiXj[iGauss][2][1] = -1.0; + dNiXj[iGauss][2][2] = -1.0; + dNiXj[iGauss][3][0] = 0.0; + dNiXj[iGauss][3][1] = 0.0; + dNiXj[iGauss][3][2] = 1.0; } /*--- Shape functions evaluated at the nodes for extrapolation of the stresses at the Gaussian Points ---*/ @@ -66,18 +78,17 @@ CTETRA1::CTETRA1() : CElementWithKnownSizes() { NodalExtrap[1][0] = 1.0; NodalExtrap[2][0] = 1.0; NodalExtrap[3][0] = 1.0; - } su2double CTETRA1::ComputeVolume(const FrameType mode) const { - unsigned short iDim; - su2double r1[3] = {0.0,0.0,0.0}, r2[3] = {0.0,0.0,0.0}, r3[3] = {0.0,0.0,0.0}, CrossProduct[3] = {0.0,0.0,0.0}; + su2double r1[3] = {0.0, 0.0, 0.0}, r2[3] = {0.0, 0.0, 0.0}, r3[3] = {0.0, 0.0, 0.0}, + CrossProduct[3] = {0.0, 0.0, 0.0}; su2double Volume = 0.0; /*--- Select the appropriate source for the nodal coordinates depending on the frame requested for the gradient computation, REFERENCE (undeformed) or CURRENT (deformed)---*/ - const su2activematrix& Coord = (mode==REFERENCE) ? RefCoord : CurrentCoord; + const su2activematrix& Coord = (mode == REFERENCE) ? RefCoord : CurrentCoord; for (iDim = 0; iDim < NDIM; iDim++) { r1[iDim] = Coord[1][iDim] - Coord[0][iDim]; @@ -86,9 +97,7 @@ su2double CTETRA1::ComputeVolume(const FrameType mode) const { } GeometryToolbox::CrossProduct(r1, r2, CrossProduct); - Volume = fabs(GeometryToolbox::DotProduct(3, CrossProduct, r3))/6.0; + Volume = fabs(GeometryToolbox::DotProduct(3, CrossProduct, r3)) / 6.0; return Volume; - } - diff --git a/Common/src/geometry/elements/CTETRA4.cpp b/Common/src/geometry/elements/CTETRA4.cpp index 74740cb227e..5138a159ebf 100644 --- a/Common/src/geometry/elements/CTETRA4.cpp +++ b/Common/src/geometry/elements/CTETRA4.cpp @@ -2,7 +2,7 @@ * \file CTETRA4.cpp * \brief Definition of 4-node tetrahedral element with 4 Gauss point. * \author T. Dick - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -28,16 +28,27 @@ #include "../../../include/geometry/elements/CElement.hpp" #include "../../../include/toolboxes/geometry_toolbox.hpp" -CTETRA4::CTETRA4() : CElementWithKnownSizes() { - +CTETRA4::CTETRA4() : CElementWithKnownSizes() { /*--- Gauss coordinates and weights ---*/ - su2double r = ((5.0-sqrt(5.0))/20); - su2double s = ((5.0+3*sqrt(5.0))/20); - GaussCoord[0][0] = r; GaussCoord[0][1] = r; GaussCoord[0][2] = r; GaussWeight(0) = 1.0/24.0; - GaussCoord[0][0] = s; GaussCoord[0][1] = r; GaussCoord[0][2] = r; GaussWeight(1) = 1.0/24.0; - GaussCoord[0][0] = r; GaussCoord[0][1] = s; GaussCoord[0][2] = r; GaussWeight(2) = 1.0/24.0; - GaussCoord[0][0] = r; GaussCoord[0][1] = r; GaussCoord[0][2] = s; GaussWeight(3) = 1.0/24.0; + su2double r = ((5.0 - sqrt(5.0)) / 20); + su2double s = ((5.0 + 3 * sqrt(5.0)) / 20); + GaussCoord[0][0] = r; + GaussCoord[0][1] = r; + GaussCoord[0][2] = r; + GaussWeight(0) = 1.0 / 24.0; + GaussCoord[0][0] = s; + GaussCoord[0][1] = r; + GaussCoord[0][2] = r; + GaussWeight(1) = 1.0 / 24.0; + GaussCoord[0][0] = r; + GaussCoord[0][1] = s; + GaussCoord[0][2] = r; + GaussWeight(2) = 1.0 / 24.0; + GaussCoord[0][0] = r; + GaussCoord[0][1] = r; + GaussCoord[0][2] = s; + GaussWeight(3) = 1.0 / 24.0; /*--- Store the values of the shape functions and their derivatives ---*/ @@ -45,23 +56,33 @@ CTETRA4::CTETRA4() : CElementWithKnownSizes() { su2double Xi, Eta, Zeta, val_Ni; for (iGauss = 0; iGauss < nGaussPoints; iGauss++) { - Xi = GaussCoord[iGauss][0]; Eta = GaussCoord[iGauss][1]; Zeta = GaussCoord[iGauss][2]; - val_Ni = Xi; GaussPoint[iGauss].SetNi(val_Ni,0); - val_Ni = Eta; GaussPoint[iGauss].SetNi(val_Ni,1); - val_Ni = 1.0-Xi-Eta-Zeta; GaussPoint[iGauss].SetNi(val_Ni,2); - val_Ni = Zeta; GaussPoint[iGauss].SetNi(val_Ni,3); + val_Ni = Xi; + GaussPoint[iGauss].SetNi(val_Ni, 0); + val_Ni = Eta; + GaussPoint[iGauss].SetNi(val_Ni, 1); + val_Ni = 1.0 - Xi - Eta - Zeta; + GaussPoint[iGauss].SetNi(val_Ni, 2); + val_Ni = Zeta; + GaussPoint[iGauss].SetNi(val_Ni, 3); /*--- dN/d xi, dN/d eta, dN/d zeta ---*/ - dNiXj[iGauss][0][0] = 1.0; dNiXj[iGauss][0][1] = 0.0; dNiXj[iGauss][0][2] = 0.0; - dNiXj[iGauss][1][0] = 0.0; dNiXj[iGauss][1][1] = 1.0; dNiXj[iGauss][1][2] = 0.0; - dNiXj[iGauss][2][0] = -1.0; dNiXj[iGauss][2][1] = -1.0; dNiXj[iGauss][2][2] = -1.0; - dNiXj[iGauss][3][0] = 0.0; dNiXj[iGauss][3][1] = 0.0; dNiXj[iGauss][3][2] = 1.0; - + dNiXj[iGauss][0][0] = 1.0; + dNiXj[iGauss][0][1] = 0.0; + dNiXj[iGauss][0][2] = 0.0; + dNiXj[iGauss][1][0] = 0.0; + dNiXj[iGauss][1][1] = 1.0; + dNiXj[iGauss][1][2] = 0.0; + dNiXj[iGauss][2][0] = -1.0; + dNiXj[iGauss][2][1] = -1.0; + dNiXj[iGauss][2][2] = -1.0; + dNiXj[iGauss][3][0] = 0.0; + dNiXj[iGauss][3][1] = 0.0; + dNiXj[iGauss][3][2] = 1.0; } /*--- Shape functions evaluated at the nodes for extrapolation of the stresses at the Gaussian Points ---*/ @@ -71,18 +92,17 @@ CTETRA4::CTETRA4() : CElementWithKnownSizes() { NodalExtrap[1][0] = 1.0; NodalExtrap[2][0] = 1.0; NodalExtrap[3][0] = 1.0; - } su2double CTETRA4::ComputeVolume(const FrameType mode) const { - unsigned short iDim; - su2double r1[3] = {0.0,0.0,0.0}, r2[3] = {0.0,0.0,0.0}, r3[3] = {0.0,0.0,0.0}, CrossProduct[3] = {0.0,0.0,0.0}; + su2double r1[3] = {0.0, 0.0, 0.0}, r2[3] = {0.0, 0.0, 0.0}, r3[3] = {0.0, 0.0, 0.0}, + CrossProduct[3] = {0.0, 0.0, 0.0}; su2double Volume = 0.0; /*--- Select the appropriate source for the nodal coordinates depending on the frame requested for the gradient computation, REFERENCE (undeformed) or CURRENT (deformed)---*/ - const su2activematrix& Coord = (mode==REFERENCE) ? RefCoord : CurrentCoord; + const su2activematrix& Coord = (mode == REFERENCE) ? RefCoord : CurrentCoord; for (iDim = 0; iDim < NDIM; iDim++) { r1[iDim] = Coord[1][iDim] - Coord[0][iDim]; @@ -91,9 +111,7 @@ su2double CTETRA4::ComputeVolume(const FrameType mode) const { } GeometryToolbox::CrossProduct(r1, r2, CrossProduct); - Volume = fabs(GeometryToolbox::DotProduct(3, CrossProduct, r3))/6.0; + Volume = fabs(GeometryToolbox::DotProduct(3, CrossProduct, r3)) / 6.0; return Volume; - } - diff --git a/Common/src/geometry/elements/CTRIA1.cpp b/Common/src/geometry/elements/CTRIA1.cpp index e74c707f627..e21b31e14cd 100644 --- a/Common/src/geometry/elements/CTRIA1.cpp +++ b/Common/src/geometry/elements/CTRIA1.cpp @@ -2,7 +2,7 @@ * \file CTRIA1.cpp * \brief Definition of the 3-node triangular element with one Gauss point. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,12 +27,12 @@ #include "../../../include/geometry/elements/CElement.hpp" - -CTRIA1::CTRIA1() : CElementWithKnownSizes() { - +CTRIA1::CTRIA1() : CElementWithKnownSizes() { /*--- Gauss coordinates and weights ---*/ - GaussCoord[0][0] = 1.0/3.0; GaussCoord[0][1] = 1.0/3.0; GaussWeight(0) = 0.5; + GaussCoord[0][0] = 1.0 / 3.0; + GaussCoord[0][1] = 1.0 / 3.0; + GaussWeight(0) = 0.5; /*--- Store the values of the shape functions and their derivatives ---*/ @@ -40,20 +40,24 @@ CTRIA1::CTRIA1() : CElementWithKnownSizes() { su2double Xi, Eta, val_Ni; for (iGauss = 0; iGauss < NGAUSS; iGauss++) { - Xi = GaussCoord[iGauss][0]; Eta = GaussCoord[iGauss][1]; - val_Ni = Xi; GaussPoint[iGauss].SetNi(val_Ni,0); - val_Ni = Eta; GaussPoint[iGauss].SetNi(val_Ni,1); - val_Ni = 1-Xi-Eta; GaussPoint[iGauss].SetNi(val_Ni,2); + val_Ni = Xi; + GaussPoint[iGauss].SetNi(val_Ni, 0); + val_Ni = Eta; + GaussPoint[iGauss].SetNi(val_Ni, 1); + val_Ni = 1 - Xi - Eta; + GaussPoint[iGauss].SetNi(val_Ni, 2); /*--- dN/d xi, dN/d eta ---*/ - dNiXj[iGauss][0][0] = 1.0; dNiXj[iGauss][0][1] = 0.0; - dNiXj[iGauss][1][0] = 0.0; dNiXj[iGauss][1][1] = 1.0; - dNiXj[iGauss][2][0] = -1.0; dNiXj[iGauss][2][1] = -1.0; - + dNiXj[iGauss][0][0] = 1.0; + dNiXj[iGauss][0][1] = 0.0; + dNiXj[iGauss][1][0] = 0.0; + dNiXj[iGauss][1][1] = 1.0; + dNiXj[iGauss][2][0] = -1.0; + dNiXj[iGauss][2][1] = -1.0; } /*--- Shape functions evaluated at the nodes for extrapolation of the stresses at the Gaussian Points ---*/ @@ -62,27 +66,23 @@ CTRIA1::CTRIA1() : CElementWithKnownSizes() { NodalExtrap[0][0] = 1.0; NodalExtrap[1][0] = 1.0; NodalExtrap[2][0] = 1.0; - } su2double CTRIA1::ComputeArea(const FrameType mode) const { - unsigned short iDim; - su2double a[2] = {0.0,0.0}, b[2] = {0.0,0.0}; + su2double a[2] = {0.0, 0.0}, b[2] = {0.0, 0.0}; su2double Area = 0.0; /*--- Select the appropriate source for the nodal coordinates depending on the frame requested for the gradient computation, REFERENCE (undeformed) or CURRENT (deformed) ---*/ - const su2activematrix& Coord = (mode==REFERENCE) ? RefCoord : CurrentCoord; + const su2activematrix& Coord = (mode == REFERENCE) ? RefCoord : CurrentCoord; for (iDim = 0; iDim < NDIM; iDim++) { - a[iDim] = Coord[0][iDim]-Coord[2][iDim]; - b[iDim] = Coord[1][iDim]-Coord[2][iDim]; + a[iDim] = Coord[0][iDim] - Coord[2][iDim]; + b[iDim] = Coord[1][iDim] - Coord[2][iDim]; } - Area = 0.5*fabs(a[0]*b[1]-a[1]*b[0]); + Area = 0.5 * fabs(a[0] * b[1] - a[1] * b[0]); return Area; - } - diff --git a/Common/src/geometry/elements/CTRIA3.cpp b/Common/src/geometry/elements/CTRIA3.cpp index afc3996a811..10414b03135 100644 --- a/Common/src/geometry/elements/CTRIA3.cpp +++ b/Common/src/geometry/elements/CTRIA3.cpp @@ -2,7 +2,7 @@ * \file CTRIA3.cpp * \brief Definition of the 3-node triangular element with three Gauss points. * \author T. Dick - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,13 +27,18 @@ #include "../../../include/geometry/elements/CElement.hpp" -CTRIA3::CTRIA3() : CElementWithKnownSizes() { - +CTRIA3::CTRIA3() : CElementWithKnownSizes() { /*--- Gauss coordinates and weights ---*/ - GaussCoord[0][0] = 0.66666666666666666667; GaussCoord[0][1] = 0.16666666666666666667; GaussWeight(0) = 0.33333333333333333333; - GaussCoord[1][0] = 0.16666666666666666667; GaussCoord[1][1] = 0.66666666666666666667; GaussWeight(1) = 0.33333333333333333333; - GaussCoord[2][0] = 0.16666666666666666667; GaussCoord[2][1] = 0.16666666666666666667; GaussWeight(2) = 0.33333333333333333333; + GaussCoord[0][0] = 0.66666666666666666667; + GaussCoord[0][1] = 0.16666666666666666667; + GaussWeight(0) = 0.33333333333333333333; + GaussCoord[1][0] = 0.16666666666666666667; + GaussCoord[1][1] = 0.66666666666666666667; + GaussWeight(1) = 0.33333333333333333333; + GaussCoord[2][0] = 0.16666666666666666667; + GaussCoord[2][1] = 0.16666666666666666667; + GaussWeight(2) = 0.33333333333333333333; /*--- Store the values of the shape functions and their derivatives ---*/ @@ -41,20 +46,24 @@ CTRIA3::CTRIA3() : CElementWithKnownSizes() { su2double Xi, Eta, val_Ni; for (iGauss = 0; iGauss < nGaussPoints; iGauss++) { - Xi = GaussCoord[iGauss][0]; Eta = GaussCoord[iGauss][1]; - val_Ni = 1-Xi-Eta; GaussPoint[iGauss].SetNi(val_Ni,0); - val_Ni = Xi; GaussPoint[iGauss].SetNi(val_Ni,1); - val_Ni = Eta; GaussPoint[iGauss].SetNi(val_Ni,2); + val_Ni = 1 - Xi - Eta; + GaussPoint[iGauss].SetNi(val_Ni, 0); + val_Ni = Xi; + GaussPoint[iGauss].SetNi(val_Ni, 1); + val_Ni = Eta; + GaussPoint[iGauss].SetNi(val_Ni, 2); /*--- dN/d xi, dN/d eta ---*/ - dNiXj[iGauss][0][0] = -1.0; dNiXj[iGauss][0][1] = -1.0; - dNiXj[iGauss][1][0] = 1.0; dNiXj[iGauss][1][1] = 0.0; - dNiXj[iGauss][2][0] = 0.0; dNiXj[iGauss][2][1] = 1.0; - + dNiXj[iGauss][0][0] = -1.0; + dNiXj[iGauss][0][1] = -1.0; + dNiXj[iGauss][1][0] = 1.0; + dNiXj[iGauss][1][1] = 0.0; + dNiXj[iGauss][2][0] = 0.0; + dNiXj[iGauss][2][1] = 1.0; } /*--- Shape functions evaluated at the nodes for extrapolation of the stresses at the Gaussian Points ---*/ @@ -63,26 +72,23 @@ CTRIA3::CTRIA3() : CElementWithKnownSizes() { NodalExtrap[0][0] = 1.0; NodalExtrap[1][0] = 1.0; NodalExtrap[2][0] = 1.0; - } su2double CTRIA3::ComputeArea(const FrameType mode) const { - unsigned short iDim; - su2double a[3] = {0.0,0.0,0.0}, b[3] = {0.0,0.0,0.0}; + su2double a[3] = {0.0, 0.0, 0.0}, b[3] = {0.0, 0.0, 0.0}; su2double Area = 0.0; /*--- Select the appropriate source for the nodal coordinates depending on the frame requested for the gradient computation, REFERENCE (undeformed) or CURRENT (deformed) ---*/ - const su2activematrix& Coord = (mode==REFERENCE) ? RefCoord : CurrentCoord; + const su2activematrix& Coord = (mode == REFERENCE) ? RefCoord : CurrentCoord; for (iDim = 0; iDim < NDIM; iDim++) { - a[iDim] = Coord[0][iDim]-Coord[2][iDim]; - b[iDim] = Coord[1][iDim]-Coord[2][iDim]; + a[iDim] = Coord[0][iDim] - Coord[2][iDim]; + b[iDim] = Coord[1][iDim] - Coord[2][iDim]; } - Area = 0.5*fabs(a[0]*b[1]-a[1]*b[0]); + Area = 0.5 * fabs(a[0] * b[1] - a[1] * b[0]); return Area; - } diff --git a/Common/src/geometry/meshreader/CBoxMeshReaderFVM.cpp b/Common/src/geometry/meshreader/CBoxMeshReaderFVM.cpp index 09c0427c920..edb0ff5ed6f 100644 --- a/Common/src/geometry/meshreader/CBoxMeshReaderFVM.cpp +++ b/Common/src/geometry/meshreader/CBoxMeshReaderFVM.cpp @@ -3,7 +3,7 @@ * \brief Reads a 3D box grid into linear partitions for the * finite volume solver (FVM). * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -29,16 +29,13 @@ #include "../../../include/toolboxes/CLinearPartitioner.hpp" #include "../../../include/geometry/meshreader/CBoxMeshReaderFVM.hpp" -CBoxMeshReaderFVM::CBoxMeshReaderFVM(CConfig *val_config, - unsigned short val_iZone, - unsigned short val_nZone) -: CMeshReaderFVM(val_config, val_iZone, val_nZone) { - +CBoxMeshReaderFVM::CBoxMeshReaderFVM(CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone) + : CMeshReaderFVM(val_config, val_iZone, val_nZone) { /* The box mesh is always 3D. */ dimension = 3; /* Set the VTK type for the interior elements and the boundary elements. */ - KindElem = HEXAHEDRON; + KindElem = HEXAHEDRON; KindBound = QUADRILATERAL; /* The number of nodes in the i and j directions. */ @@ -64,21 +61,19 @@ CBoxMeshReaderFVM::CBoxMeshReaderFVM(CConfig *val_config, ComputeBoxPointCoordinates(); ComputeBoxVolumeConnectivity(); ComputeBoxSurfaceConnectivity(); - } -CBoxMeshReaderFVM::~CBoxMeshReaderFVM(void) { } +CBoxMeshReaderFVM::~CBoxMeshReaderFVM() = default; void CBoxMeshReaderFVM::ComputeBoxPointCoordinates() { - /* Set the global count of points based on the grid dimensions. */ - numberOfGlobalPoints = (nNode)*(mNode)*(pNode); + numberOfGlobalPoints = (nNode) * (mNode) * (pNode); /* Get a partitioner to help with linear partitioning. */ - CLinearPartitioner pointPartitioner(numberOfGlobalPoints,0); + CLinearPartitioner pointPartitioner(numberOfGlobalPoints, 0); /* Determine number of local points */ - for(unsigned long globalIndex=0; globalIndex < numberOfGlobalPoints; globalIndex++) { + for (unsigned long globalIndex = 0; globalIndex < numberOfGlobalPoints; globalIndex++) { if ((int)pointPartitioner.GetRankContainingIndex(globalIndex) == rank) { numberOfLocalPoints++; } @@ -87,19 +82,17 @@ void CBoxMeshReaderFVM::ComputeBoxPointCoordinates() { /* Loop over our analytically defined of coordinates and store only those that contain a node within our linear partition of points. */ localPointCoordinates.resize(dimension); - for (int k = 0; k < dimension; k++) - localPointCoordinates[k].reserve(numberOfLocalPoints); + for (int k = 0; k < dimension; k++) localPointCoordinates[k].reserve(numberOfLocalPoints); unsigned long globalIndex = 0; for (unsigned long kNode = 0; kNode < pNode; kNode++) { for (unsigned long jNode = 0; jNode < mNode; jNode++) { for (unsigned long iNode = 0; iNode < nNode; iNode++) { if ((int)pointPartitioner.GetRankContainingIndex(globalIndex) == rank) { - /* Store the coordinates more clearly. */ - const passivedouble x = SU2_TYPE::GetValue(Lx*((su2double)iNode)/((su2double)(nNode-1))+Ox); - const passivedouble y = SU2_TYPE::GetValue(Ly*((su2double)jNode)/((su2double)(mNode-1))+Oy); - const passivedouble z = SU2_TYPE::GetValue(Lz*((su2double)kNode)/((su2double)(pNode-1))+Oz); + const passivedouble x = SU2_TYPE::GetValue(Lx * ((su2double)iNode) / ((su2double)(nNode - 1)) + Ox); + const passivedouble y = SU2_TYPE::GetValue(Ly * ((su2double)jNode) / ((su2double)(mNode - 1)) + Oy); + const passivedouble z = SU2_TYPE::GetValue(Lz * ((su2double)kNode) / ((su2double)(pNode - 1)) + Oz); /* Load into the coordinate class data structure. */ localPointCoordinates[0].push_back(x); @@ -110,35 +103,32 @@ void CBoxMeshReaderFVM::ComputeBoxPointCoordinates() { } } } - } void CBoxMeshReaderFVM::ComputeBoxVolumeConnectivity() { - /* Set the global count of elements based on the grid dimensions. */ - numberOfGlobalElements = (nNode-1)*(mNode-1)*(pNode-1); + numberOfGlobalElements = (nNode - 1) * (mNode - 1) * (pNode - 1); /* Get a partitioner to help with linear partitioning. */ - CLinearPartitioner pointPartitioner(numberOfGlobalPoints,0); + CLinearPartitioner pointPartitioner(numberOfGlobalPoints, 0); /* Loop over our analytically defined of elements and store only those that contain a node within our linear partition of points. */ - numberOfLocalElements = 0; - vector connectivity(N_POINTS_HEXAHEDRON,0); + numberOfLocalElements = 0; + vector connectivity(N_POINTS_HEXAHEDRON, 0); unsigned long globalIndex = 0; - for (unsigned long kNode = 0; kNode < pNode-1; kNode++) { - for (unsigned long jNode = 0; jNode < mNode-1; jNode++) { - for (unsigned long iNode = 0; iNode < nNode-1; iNode++) { - + for (unsigned long kNode = 0; kNode < pNode - 1; kNode++) { + for (unsigned long jNode = 0; jNode < mNode - 1; jNode++) { + for (unsigned long iNode = 0; iNode < nNode - 1; iNode++) { /* Compute connectivity based on the i,j,k index. */ - connectivity[0] = kNode*mNode*nNode + jNode*nNode + iNode; - connectivity[1] = kNode*mNode*nNode + jNode*nNode + iNode + 1; - connectivity[2] = kNode*mNode*nNode + (jNode + 1)*nNode + (iNode + 1); - connectivity[3] = kNode*mNode*nNode + (jNode + 1)*nNode + iNode; - connectivity[4] = (kNode + 1)*mNode*nNode + jNode*nNode + iNode; - connectivity[5] = (kNode + 1)*mNode*nNode + jNode*nNode + iNode + 1; - connectivity[6] = (kNode + 1)*mNode*nNode + (jNode + 1)*nNode + (iNode + 1); - connectivity[7] = (kNode + 1)*mNode*nNode + (jNode + 1)*nNode + iNode; + connectivity[0] = kNode * mNode * nNode + jNode * nNode + iNode; + connectivity[1] = kNode * mNode * nNode + jNode * nNode + iNode + 1; + connectivity[2] = kNode * mNode * nNode + (jNode + 1) * nNode + (iNode + 1); + connectivity[3] = kNode * mNode * nNode + (jNode + 1) * nNode + iNode; + connectivity[4] = (kNode + 1) * mNode * nNode + jNode * nNode + iNode; + connectivity[5] = (kNode + 1) * mNode * nNode + jNode * nNode + iNode + 1; + connectivity[6] = (kNode + 1) * mNode * nNode + (jNode + 1) * nNode + (iNode + 1); + connectivity[7] = (kNode + 1) * mNode * nNode + (jNode + 1) * nNode + iNode; /* Check whether any of the points is in our linear partition. */ bool isOwned = false; @@ -161,126 +151,117 @@ void CBoxMeshReaderFVM::ComputeBoxVolumeConnectivity() { } } } - } void CBoxMeshReaderFVM::ComputeBoxSurfaceConnectivity() { - /* The rectangle alays has 4 markers. */ numberOfMarkers = 6; surfaceElementConnectivity.resize(numberOfMarkers); markerNames.resize(numberOfMarkers); - vector connectivity(N_POINTS_HEXAHEDRON,0); + vector connectivity(N_POINTS_HEXAHEDRON, 0); /* Compute and store the 6 sets of connectivity. */ markerNames[0] = "x_minus"; if (rank == MASTER_NODE) { - for (unsigned long kNode = 0; kNode < pNode-1; kNode++) { - for (unsigned long jNode = 0; jNode < mNode-1; jNode++) { - - connectivity[0] = kNode*mNode*nNode + jNode*nNode; - connectivity[1] = (kNode + 1)*mNode*nNode + jNode*nNode; - connectivity[2] = (kNode + 1)*mNode*nNode + (jNode + 1)*nNode; - connectivity[3] = kNode*mNode*nNode + (jNode + 1)*nNode; + for (unsigned long kNode = 0; kNode < pNode - 1; kNode++) { + for (unsigned long jNode = 0; jNode < mNode - 1; jNode++) { + connectivity[0] = kNode * mNode * nNode + jNode * nNode; + connectivity[1] = (kNode + 1) * mNode * nNode + jNode * nNode; + connectivity[2] = (kNode + 1) * mNode * nNode + (jNode + 1) * nNode; + connectivity[3] = kNode * mNode * nNode + (jNode + 1) * nNode; surfaceElementConnectivity[0].push_back(0); surfaceElementConnectivity[0].push_back(KindBound); for (unsigned short i = 0; i < N_POINTS_HEXAHEDRON; i++) - surfaceElementConnectivity[0].push_back(connectivity[i]); + surfaceElementConnectivity[0].push_back(connectivity[i]); } } } markerNames[1] = "x_plus"; if (rank == MASTER_NODE) { - for (unsigned long kNode = 0; kNode < pNode-1; kNode++) { - for (unsigned long jNode = 0; jNode < mNode-1; jNode++) { - - connectivity[0] = kNode*mNode*nNode + jNode*nNode + (nNode - 1); - connectivity[1] = kNode*mNode*nNode + (jNode + 1)*nNode + (nNode - 1); - connectivity[2] = (kNode + 1)*mNode*nNode + (jNode + 1)*nNode + (nNode - 1); - connectivity[3] = (kNode + 1)*mNode*nNode + jNode*nNode + (nNode - 1); + for (unsigned long kNode = 0; kNode < pNode - 1; kNode++) { + for (unsigned long jNode = 0; jNode < mNode - 1; jNode++) { + connectivity[0] = kNode * mNode * nNode + jNode * nNode + (nNode - 1); + connectivity[1] = kNode * mNode * nNode + (jNode + 1) * nNode + (nNode - 1); + connectivity[2] = (kNode + 1) * mNode * nNode + (jNode + 1) * nNode + (nNode - 1); + connectivity[3] = (kNode + 1) * mNode * nNode + jNode * nNode + (nNode - 1); surfaceElementConnectivity[1].push_back(0); surfaceElementConnectivity[1].push_back(KindBound); for (unsigned short i = 0; i < N_POINTS_HEXAHEDRON; i++) - surfaceElementConnectivity[1].push_back(connectivity[i]); + surfaceElementConnectivity[1].push_back(connectivity[i]); } } } markerNames[2] = "y_minus"; if (rank == MASTER_NODE) { - for (unsigned long kNode = 0; kNode < pNode-1; kNode++) { - for (unsigned long iNode = 0; iNode < nNode-1; iNode++) { - - connectivity[0] = kNode*mNode*nNode + iNode; - connectivity[1] = kNode*mNode*nNode + iNode + 1; - connectivity[2] = (kNode + 1)*mNode*nNode + iNode + 1; - connectivity[3] = (kNode + 1)*mNode*nNode + iNode; + for (unsigned long kNode = 0; kNode < pNode - 1; kNode++) { + for (unsigned long iNode = 0; iNode < nNode - 1; iNode++) { + connectivity[0] = kNode * mNode * nNode + iNode; + connectivity[1] = kNode * mNode * nNode + iNode + 1; + connectivity[2] = (kNode + 1) * mNode * nNode + iNode + 1; + connectivity[3] = (kNode + 1) * mNode * nNode + iNode; surfaceElementConnectivity[2].push_back(0); surfaceElementConnectivity[2].push_back(KindBound); for (unsigned short i = 0; i < N_POINTS_HEXAHEDRON; i++) - surfaceElementConnectivity[2].push_back(connectivity[i]); + surfaceElementConnectivity[2].push_back(connectivity[i]); } } } markerNames[3] = "y_plus"; if (rank == MASTER_NODE) { - for (unsigned long kNode = 0; kNode < pNode-1; kNode++) { - for (unsigned long iNode = 0; iNode < nNode-1; iNode++) { - - connectivity[0] = kNode*mNode*nNode + (mNode - 1)*nNode + iNode; - connectivity[1] = kNode*mNode*nNode + (mNode - 1)*nNode + iNode + 1; - connectivity[2] = (kNode + 1)*mNode*nNode + (mNode - 1)*nNode + iNode + 1; - connectivity[3] = (kNode + 1)*mNode*nNode + (mNode - 1)*nNode + iNode; + for (unsigned long kNode = 0; kNode < pNode - 1; kNode++) { + for (unsigned long iNode = 0; iNode < nNode - 1; iNode++) { + connectivity[0] = kNode * mNode * nNode + (mNode - 1) * nNode + iNode; + connectivity[1] = kNode * mNode * nNode + (mNode - 1) * nNode + iNode + 1; + connectivity[2] = (kNode + 1) * mNode * nNode + (mNode - 1) * nNode + iNode + 1; + connectivity[3] = (kNode + 1) * mNode * nNode + (mNode - 1) * nNode + iNode; surfaceElementConnectivity[3].push_back(0); surfaceElementConnectivity[3].push_back(KindBound); for (unsigned short i = 0; i < N_POINTS_HEXAHEDRON; i++) - surfaceElementConnectivity[3].push_back(connectivity[i]); + surfaceElementConnectivity[3].push_back(connectivity[i]); } } } markerNames[4] = "z_minus"; if (rank == MASTER_NODE) { - for (unsigned long jNode = 0; jNode < mNode-1; jNode++) { - for (unsigned long iNode = 0; iNode < nNode-1; iNode++) { - - connectivity[0] = jNode*nNode + iNode; - connectivity[1] = jNode*nNode + iNode + 1; - connectivity[2] = (jNode + 1)*nNode + (iNode + 1); - connectivity[3] = (jNode + 1)*nNode + iNode; + for (unsigned long jNode = 0; jNode < mNode - 1; jNode++) { + for (unsigned long iNode = 0; iNode < nNode - 1; iNode++) { + connectivity[0] = jNode * nNode + iNode; + connectivity[1] = jNode * nNode + iNode + 1; + connectivity[2] = (jNode + 1) * nNode + (iNode + 1); + connectivity[3] = (jNode + 1) * nNode + iNode; surfaceElementConnectivity[4].push_back(0); surfaceElementConnectivity[4].push_back(KindBound); for (unsigned short i = 0; i < N_POINTS_HEXAHEDRON; i++) - surfaceElementConnectivity[4].push_back(connectivity[i]); + surfaceElementConnectivity[4].push_back(connectivity[i]); } } } markerNames[5] = "z_plus"; if (rank == MASTER_NODE) { - for (unsigned long jNode = 0; jNode < mNode-1; jNode++) { - for (unsigned long iNode = 0; iNode < nNode-1; iNode++) { - - connectivity[0] = (pNode-1)*mNode*nNode + jNode*nNode + iNode; - connectivity[1] = (pNode-1)*mNode*nNode + jNode*nNode + iNode + 1; - connectivity[2] = (pNode-1)*mNode*nNode + (jNode + 1)*nNode + (iNode + 1); - connectivity[3] = (pNode-1)*mNode*nNode + (jNode + 1)*nNode + iNode; + for (unsigned long jNode = 0; jNode < mNode - 1; jNode++) { + for (unsigned long iNode = 0; iNode < nNode - 1; iNode++) { + connectivity[0] = (pNode - 1) * mNode * nNode + jNode * nNode + iNode; + connectivity[1] = (pNode - 1) * mNode * nNode + jNode * nNode + iNode + 1; + connectivity[2] = (pNode - 1) * mNode * nNode + (jNode + 1) * nNode + (iNode + 1); + connectivity[3] = (pNode - 1) * mNode * nNode + (jNode + 1) * nNode + iNode; surfaceElementConnectivity[5].push_back(0); surfaceElementConnectivity[5].push_back(KindBound); for (unsigned short i = 0; i < N_POINTS_HEXAHEDRON; i++) - surfaceElementConnectivity[5].push_back(connectivity[i]); + surfaceElementConnectivity[5].push_back(connectivity[i]); } } } - } diff --git a/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp b/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp index 53e3b3dd0c7..a4dc472ee99 100644 --- a/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp +++ b/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp @@ -3,7 +3,7 @@ * \brief Class that reads a single zone of a CGNS mesh file from disk into * linear partitions across all ranks. * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -29,11 +29,8 @@ #include "../../../include/toolboxes/CLinearPartitioner.hpp" #include "../../../include/geometry/meshreader/CCGNSMeshReaderFVM.hpp" -CCGNSMeshReaderFVM::CCGNSMeshReaderFVM(CConfig *val_config, - unsigned short val_iZone, - unsigned short val_nZone) -: CMeshReaderFVM(val_config, val_iZone, val_nZone) { - +CCGNSMeshReaderFVM::CCGNSMeshReaderFVM(CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone) + : CMeshReaderFVM(val_config, val_iZone, val_nZone) { #ifdef HAVE_CGNS OpenCGNSFile(config->GetMesh_FileName()); @@ -69,26 +66,23 @@ CCGNSMeshReaderFVM::CCGNSMeshReaderFVM(CConfig *val_config, ReformatCGNSSurfaceConnectivity(); #else - SU2_MPI::Error(string(" SU2 built without CGNS support. \n") + - string(" To use CGNS, build SU2 accordingly."), + SU2_MPI::Error(string(" SU2 built without CGNS support. \n") + string(" To use CGNS, build SU2 accordingly."), CURRENT_FUNCTION); #endif } -CCGNSMeshReaderFVM::~CCGNSMeshReaderFVM(void) { } +CCGNSMeshReaderFVM::~CCGNSMeshReaderFVM() = default; #ifdef HAVE_CGNS -void CCGNSMeshReaderFVM::OpenCGNSFile(string val_filename) { - +void CCGNSMeshReaderFVM::OpenCGNSFile(const string& val_filename) { /*--- Check whether the supplied file is truly a CGNS file. ---*/ int file_type; float file_version; if (cg_is_cgns(val_filename.c_str(), &file_type) != CG_OK) { - SU2_MPI::Error(val_filename + - string(" was not found or is not a properly formatted") + - string(" CGNS file.\nNote that SU2 expects unstructured") + - string(" CGNS files in ADF data format."), + SU2_MPI::Error(val_filename + string(" was not found or is not a properly formatted") + + string(" CGNS file.\nNote that SU2 expects unstructured") + + string(" CGNS files in ADF data format."), CURRENT_FUNCTION); } @@ -96,46 +90,42 @@ void CCGNSMeshReaderFVM::OpenCGNSFile(string val_filename) { is the specific index number for this file and will be repeatedly used in the function calls. ---*/ - if (cg_open(val_filename.c_str(), CG_MODE_READ, &cgnsFileID)) - cg_error_exit(); + if (cg_open(val_filename.c_str(), CG_MODE_READ, &cgnsFileID)) cg_error_exit(); if (rank == MASTER_NODE) { cout << "Reading the CGNS file: "; cout << val_filename.c_str() << "." << endl; } - if (cg_version(cgnsFileID, &file_version)) - cg_error_exit(); + if (cg_version(cgnsFileID, &file_version)) cg_error_exit(); if (rank == MASTER_NODE) { if (file_version < 4.0) { - cout << "WARNING: The CGNS file version (" << file_version << ") is old and may cause high memory usage issues, consider updating the file with the cgnsupdate tool.\n"; + cout + << "WARNING: The CGNS file version (" << file_version + << ") is old and may cause high memory usage issues, consider updating the file with the cgnsupdate tool.\n"; } } } void CCGNSMeshReaderFVM::ReadCGNSDatabaseMetadata() { - /*--- Get the number of databases. This is the highest node in the CGNS heirarchy. ---*/ int nbases; if (cg_nbases(cgnsFileID, &nbases)) cg_error_exit(); - if (rank == MASTER_NODE) - cout << "CGNS file contains " << nbases << " database(s)." << endl; + if (rank == MASTER_NODE) cout << "CGNS file contains " << nbases << " database(s)." << endl; /*--- Check if there is more than one database. Throw an error if there is because this reader can currently only handle one database. ---*/ - if ( nbases > 1 ) { - SU2_MPI::Error("CGNS reader currently can only handle 1 database.", - CURRENT_FUNCTION); + if (nbases > 1) { + SU2_MPI::Error("CGNS reader currently can only handle 1 database.", CURRENT_FUNCTION); } /*--- Read the database. Note that the CGNS indexing starts at 1. ---*/ int cell_dim, phys_dim; char basename[CGNS_STRING_SIZE]; - if (cg_base_read(cgnsFileID, cgnsBase, basename, &cell_dim, &phys_dim)) - cg_error_exit(); + if (cg_base_read(cgnsFileID, cgnsBase, basename, &cell_dim, &phys_dim)) cg_error_exit(); if (rank == MASTER_NODE) { cout << "Database " << cgnsBase << ", " << basename << ": "; cout << " cell dimension of " << cell_dim << ", physical "; @@ -145,11 +135,9 @@ void CCGNSMeshReaderFVM::ReadCGNSDatabaseMetadata() { /*--- Set the number of dimensions baed on cell_dim. ---*/ dimension = (unsigned short)cell_dim; - } void CCGNSMeshReaderFVM::ReadCGNSZoneMetadata() { - /*--- First, check all sections to find the element types and to classify them as either surface or volume elements. We will also perform some error checks here to avoid partitioning issues. ---*/ @@ -159,16 +147,17 @@ void CCGNSMeshReaderFVM::ReadCGNSZoneMetadata() { int nzones; if (cg_nzones(cgnsFileID, cgnsBase, &nzones)) cg_error_exit(); if (rank == MASTER_NODE) { - cout << nzones << " total zone(s)." << endl; + cout << nzones << " total zone(s)." << endl; } /*--- Check if there is more than one zone. Until we enable it, we will require a single zone CGNS file. Multizone problems can still be run with CGNS by using separate CGNS files for each zone. ---*/ - if ( nzones > 1 ) { + if (nzones > 1) { SU2_MPI::Error(string("CGNS reader currently expects only 1 zone per CGNS file.") + - string("Multizone problems can be run with separate CGNS files for each zone."), CURRENT_FUNCTION); + string("Multizone problems can be run with separate CGNS files for each zone."), + CURRENT_FUNCTION); } /*--- Read the basic information for this zone, including @@ -178,8 +167,7 @@ void CCGNSMeshReaderFVM::ReadCGNSZoneMetadata() { vector cgsize(3); ZoneType_t zonetype; char zonename[CGNS_STRING_SIZE]; - if (cg_zone_read(cgnsFileID, cgnsBase, cgnsZone, zonename, cgsize.data())) - cg_error_exit(); + if (cg_zone_read(cgnsFileID, cgnsBase, cgnsZone, zonename, cgsize.data())) cg_error_exit(); /*--- Rename the zone size information for clarity. NOTE: The number of cells here may be only the number of @@ -187,7 +175,7 @@ void CCGNSMeshReaderFVM::ReadCGNSZoneMetadata() { be counted explicitly later. ---*/ numberOfGlobalPoints = cgsize[0]; - int nElemCGNS = cgsize[1]; + int nElemCGNS = cgsize[1]; /*--- Get some additional information about the current zone. ---*/ @@ -196,8 +184,7 @@ void CCGNSMeshReaderFVM::ReadCGNSZoneMetadata() { /*--- Check for an unstructured mesh. Throw an error if not found. ---*/ if (zonetype != Unstructured) - SU2_MPI::Error("Structured CGNS zone found while unstructured expected.", - CURRENT_FUNCTION); + SU2_MPI::Error("Structured CGNS zone found while unstructured expected.", CURRENT_FUNCTION); /*--- Print current zone info to the console. ---*/ @@ -214,19 +201,16 @@ void CCGNSMeshReaderFVM::ReadCGNSZoneMetadata() { int ngrids; if (cg_ngrids(cgnsFileID, cgnsBase, cgnsZone, &ngrids)) cg_error_exit(); if (ngrids > 1) { - SU2_MPI::Error("CGNS reader currently handles only 1 grid per zone.", - CURRENT_FUNCTION); + SU2_MPI::Error("CGNS reader currently handles only 1 grid per zone.", CURRENT_FUNCTION); } - } void CCGNSMeshReaderFVM::ReadCGNSPointCoordinates() { - /*--- Compute the number of points that will be on each processor. This is a linear partitioning with the addition of a simple load balancing for any remainder points. ---*/ - CLinearPartitioner pointPartitioner(numberOfGlobalPoints,0); + CLinearPartitioner pointPartitioner(numberOfGlobalPoints, 0); /*--- Store the local number of nodes for this rank. ---*/ @@ -235,21 +219,19 @@ void CCGNSMeshReaderFVM::ReadCGNSPointCoordinates() { /*--- Create buffer to hold the grid coordinates for our rank. ---*/ localPointCoordinates.resize(dimension); - for (int k = 0; k < dimension; k++) - localPointCoordinates[k].resize(numberOfLocalPoints, 0.0); + for (int k = 0; k < dimension; k++) localPointCoordinates[k].resize(numberOfLocalPoints, 0.0); /*--- Set the value of range_max to the total number of nodes in the unstructured mesh. Also allocate memory for the temporary array that will hold the grid coordinates as they are extracted. Note the +1 for CGNS convention. ---*/ - cgsize_t range_min = (cgsize_t)pointPartitioner.GetFirstIndexOnRank(rank)+1; - cgsize_t range_max = (cgsize_t)pointPartitioner.GetLastIndexOnRank(rank); + cgsize_t range_min = (cgsize_t)pointPartitioner.GetFirstIndexOnRank(rank) + 1; + auto range_max = (cgsize_t)pointPartitioner.GetLastIndexOnRank(rank); /*--- Loop over each set of coordinates. ---*/ for (int k = 0; k < dimension; k++) { - /*--- Read the coordinate info. This will retrieve the data type (either RealSingle or RealDouble) as well as the coordname which will specify the @@ -258,8 +240,7 @@ void CCGNSMeshReaderFVM::ReadCGNSPointCoordinates() { char coordname[CGNS_STRING_SIZE]; DataType_t datatype; - if (cg_coord_info(cgnsFileID, cgnsBase, cgnsZone, k+1, - &datatype, coordname)) cg_error_exit(); + if (cg_coord_info(cgnsFileID, cgnsBase, cgnsZone, k + 1, &datatype, coordname)) cg_error_exit(); if (rank == MASTER_NODE) { cout << "Loading " << coordname; if (size > SINGLE_NODE) { @@ -272,30 +253,29 @@ void CCGNSMeshReaderFVM::ReadCGNSPointCoordinates() { /*--- Check the coordinate name to decide the index for storage. ---*/ unsigned short indC = 0; - if (string(coordname) == "CoordinateX") indC = 0; - else if (string(coordname) == "CoordinateY") indC = 1; - else if (string(coordname) == "CoordinateZ") indC = 2; + if (string(coordname) == "CoordinateX") + indC = 0; + else if (string(coordname) == "CoordinateY") + indC = 1; + else if (string(coordname) == "CoordinateZ") + indC = 2; else - SU2_MPI::Error(string("Unknown coordinate name, ") + coordname + - string(", in the CGNS file."), CURRENT_FUNCTION); + SU2_MPI::Error(string("Unknown coordinate name, ") + coordname + string(", in the CGNS file."), CURRENT_FUNCTION); /*--- Now read our rank's chunk of coordinates from the file. Ask for datatype RealDouble and let CGNS library do the translation when RealSingle is found. ---*/ - if (cg_coord_read(cgnsFileID, cgnsBase, cgnsZone, coordname, RealDouble, - &range_min, &range_max, localPointCoordinates[indC].data())) + if (cg_coord_read(cgnsFileID, cgnsBase, cgnsZone, coordname, RealDouble, &range_min, &range_max, + localPointCoordinates[indC].data())) cg_error_exit(); } - } void CCGNSMeshReaderFVM::ReadCGNSSectionMetadata() { - /*--- Begin section for retrieving the connectivity info. ---*/ - if ((rank == MASTER_NODE) && (size > SINGLE_NODE)) - cout << "Distributing connectivity across all ranks." << endl; + if ((rank == MASTER_NODE) && (size > SINGLE_NODE)) cout << "Distributing connectivity across all ranks." << endl; /*--- First check the number of sections. ---*/ @@ -309,26 +289,26 @@ void CCGNSMeshReaderFVM::ReadCGNSSectionMetadata() { pieces of information describing each section. ---*/ isInterior.resize(nSections); - nElems.resize(nSections,0); - elemOffset.resize(nSections+1, 0); elemOffset[0] = 0; + nElems.resize(nSections, 0); + elemOffset.resize(nSections + 1, 0); + elemOffset[0] = 0; connElems.resize(nSections); sectionNames.resize(nSections, vector(CGNS_STRING_SIZE)); numberOfGlobalElements = 0; for (int s = 0; s < nSections; s++) { - /*--- Read the connectivity details for this section. ---*/ int nbndry, parent_flag, vtk_type; cgsize_t startE, endE, sizeNeeded; ElementType_t elemType; - if (cg_section_read(cgnsFileID, cgnsBase, cgnsZone, s+1, - sectionNames[s].data(), &elemType, &startE, &endE, - &nbndry, &parent_flag)) cg_error_exit(); + if (cg_section_read(cgnsFileID, cgnsBase, cgnsZone, s + 1, sectionNames[s].data(), &elemType, &startE, &endE, + &nbndry, &parent_flag)) + cg_error_exit(); /*--- Compute the total element count in this section (global). ---*/ - unsigned long element_count = (endE-startE+1); + unsigned long element_count = (endE - startE + 1); /* Get the details for the CGNS element type in this section. */ @@ -343,66 +323,59 @@ void CCGNSMeshReaderFVM::ReadCGNSSectionMetadata() { isInterior[s] = true; if (elemType == MIXED) { - /* For a mixed section, we check the type of the first element so that we can correctly label this section as an interior or boundary element section. Here, we also assume that a section can not hold both interior and boundary elements. First, get the size required to read a single element from the section. */ - if (cg_ElementPartialSize(cgnsFileID, cgnsBase, cgnsZone, s+1, startE, - startE, &sizeNeeded) != CG_OK) + if (cg_ElementPartialSize(cgnsFileID, cgnsBase, cgnsZone, s + 1, startE, startE, &sizeNeeded) != CG_OK) cg_error_exit(); /* A couple of auxiliary vectors for mixed element sections. */ vector connElemCGNS(sizeNeeded); - vector connOffsetCGNS(2,0); + vector connOffsetCGNS(2, 0); /* Retrieve the connectivity information for the first element. */ - if (cg_poly_elements_partial_read(cgnsFileID, cgnsBase, cgnsZone, s+1, - startE, startE, connElemCGNS.data(), - connOffsetCGNS.data(), NULL) != CG_OK) + if (cg_poly_elements_partial_read(cgnsFileID, cgnsBase, cgnsZone, s + 1, startE, startE, connElemCGNS.data(), + connOffsetCGNS.data(), nullptr) != CG_OK) cg_error_exit(); /* The element type is in the first position of the connectivity information that we retrieved from the CGNS file. */ elemType = ElementType_t(connElemCGNS[0]); - } /* Check for 1D elements in 2D problems, or for 2D elements in 3D problems. If found, mark the section as a boundary section. */ - if ((dimension == 2) && - (elemType == BAR_2 || elemType == BAR_3)) isInterior[s] = false; - if ((dimension == 3) && - (elemType == TRI_3 || elemType == QUAD_4)) isInterior[s] = false; + if ((dimension == 2) && (elemType == BAR_2 || elemType == BAR_3)) isInterior[s] = false; + if ((dimension == 3) && (elemType == TRI_3 || elemType == QUAD_4)) isInterior[s] = false; /*--- Increment the global element offset for each section based on whether or not this is a surface or volume section. We also keep a running count of the total elements globally. ---*/ - elemOffset[s+1] = elemOffset[s]; - if (!isInterior[s]) elemOffset[s+1] += element_count; - else numberOfGlobalElements += element_count; + elemOffset[s + 1] = elemOffset[s]; + if (!isInterior[s]) + elemOffset[s + 1] += element_count; + else + numberOfGlobalElements += element_count; /*--- Print some information to the console. ---*/ if (rank == MASTER_NODE) { cout << "Section " << string(sectionNames[s].data()); cout << " contains " << element_count << " elements"; - cout << " of type " << elem_name << "." < elemTypes(nElems[val_section], 0); - vector nPoinPerElem(nElems[val_section],0); - vector elemGlobalID(nElems[val_section],0); + vector elemTypes(nElems[val_section], 0); + vector nPoinPerElem(nElems[val_section], 0); + vector elemGlobalID(nElems[val_section], 0); /*--- Determine the size of the vector needed to read the connectivity data from the CGNS file. Only call the CGNS API if we have a non-zero @@ -450,21 +423,20 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { cgsize_t sizeNeeded = 0, sizeOffset = 0; if (nElems[val_section] > 0) { - if (cg_ElementPartialSize(cgnsFileID, cgnsBase, cgnsZone, val_section+1, + if (cg_ElementPartialSize(cgnsFileID, cgnsBase, cgnsZone, val_section + 1, (cgsize_t)elementPartitioner.GetFirstIndexOnRank(rank), - (cgsize_t)elementPartitioner.GetLastIndexOnRank(rank), - &sizeNeeded) != CG_OK) - cg_error_exit(); + (cgsize_t)elementPartitioner.GetLastIndexOnRank(rank), &sizeNeeded) != CG_OK) + cg_error_exit(); } /*--- Allocate the memory for the connectivity, the offset if needed and read the data. ---*/ - vector connElemCGNS(sizeNeeded,0); + vector connElemCGNS(sizeNeeded, 0); if (elemType == MIXED || elemType == NFACE_n || elemType == NGON_n) { - sizeOffset = nElems[val_section]+1; + sizeOffset = nElems[val_section] + 1; } - vector connOffsetCGNS(sizeOffset,0); + vector connOffsetCGNS(sizeOffset, 0); /*--- Retrieve the connectivity information and store. Note that we are only accessing our rank's piece of the data here in the @@ -473,18 +445,16 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { if (nElems[val_section] > 0) { if (elemType == MIXED || elemType == NFACE_n || elemType == NGON_n) { - if (cg_poly_elements_partial_read(cgnsFileID, cgnsBase, cgnsZone, val_section+1, + if (cg_poly_elements_partial_read(cgnsFileID, cgnsBase, cgnsZone, val_section + 1, (cgsize_t)elementPartitioner.GetFirstIndexOnRank(rank), - (cgsize_t)elementPartitioner.GetLastIndexOnRank(rank), - connElemCGNS.data(), - connOffsetCGNS.data(), NULL) != CG_OK) - cg_error_exit(); + (cgsize_t)elementPartitioner.GetLastIndexOnRank(rank), connElemCGNS.data(), + connOffsetCGNS.data(), nullptr) != CG_OK) + cg_error_exit(); } else { - if (cg_elements_partial_read(cgnsFileID, cgnsBase, cgnsZone, val_section+1, - (cgsize_t)elementPartitioner.GetFirstIndexOnRank(rank), - (cgsize_t)elementPartitioner.GetLastIndexOnRank(rank), - connElemCGNS.data(), NULL) != CG_OK) - cg_error_exit(); + if (cg_elements_partial_read( + cgnsFileID, cgnsBase, cgnsZone, val_section + 1, (cgsize_t)elementPartitioner.GetFirstIndexOnRank(rank), + (cgsize_t)elementPartitioner.GetLastIndexOnRank(rank), connElemCGNS.data(), nullptr) != CG_OK) + cg_error_exit(); } } @@ -492,7 +462,7 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { if (rank == MASTER_NODE) { cout << "Loading volume section " << string(sectionName); - cout << " from file." << endl; + cout << " from file." << endl; } /*--- Find the number of nodes required to represent @@ -514,7 +484,6 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { unsigned long counterCGNS = 0; for (iElem = 0; iElem < nElems[val_section]; iElem++) { - ElementType_t iElemType = elemType; /*--- If we have a mixed element section, we need to check the elem @@ -523,7 +492,7 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { if (isMixed) { iElemType = ElementType_t(connElemCGNS[counterCGNS]); - npe = connOffsetCGNS[iElem+1]-connOffsetCGNS[iElem]-1; + npe = connOffsetCGNS[iElem + 1] - connOffsetCGNS[iElem] - 1; counterCGNS++; for (int jj = 0; jj < npe; jj++) counterCGNS++; } @@ -538,15 +507,13 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { prior to this one, in order to keep the internal element global IDs indexed starting from zero. ---*/ - elemGlobalID[iElem] = (elementPartitioner.GetFirstIndexOnRank(rank) + - iElem - elemOffset[val_section]); + elemGlobalID[iElem] = (elementPartitioner.GetFirstIndexOnRank(rank) + iElem - elemOffset[val_section]); /* Get the VTK type for this element. */ int vtk_type; string elem_name = GetCGNSElementType(iElemType, vtk_type); elemTypes[iElem] = vtk_type; - } /*--- Force free the memory for the conn offset from the CGNS file. ---*/ @@ -555,22 +522,23 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { /*--- These are internal elems. Allocate memory on each proc. ---*/ - vector connElemTemp(nElems[val_section]*SU2_CONN_SIZE,0); + vector connElemTemp(nElems[val_section] * SU2_CONN_SIZE, 0); /*--- Copy the connectivity into the larger array with a standard format per element: [globalID vtkType n0 n1 n2 n3 n4 n5 n6 n7 n8]. ---*/ counterCGNS = 0; for (iElem = 0; iElem < nElems[val_section]; iElem++) { - /*--- Store the conn in chunks of SU2_CONN_SIZE for simplicity. ---*/ - unsigned long nn = iElem*SU2_CONN_SIZE; + unsigned long nn = iElem * SU2_CONN_SIZE; /*--- First, store the global element ID and the VTK type. ---*/ - connElemTemp[nn] = elemGlobalID[iElem]; nn++; - connElemTemp[nn] = elemTypes[iElem]; nn++; + connElemTemp[nn] = elemGlobalID[iElem]; + nn++; + connElemTemp[nn] = elemTypes[iElem]; + nn++; /*--- Store the connectivity values. Note we subtract one from the CGNS 1-based convention. We may also need to remove the first @@ -578,10 +546,10 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { if (isMixed) counterCGNS++; for (iNode = 0; iNode < (unsigned long)nPoinPerElem[iElem]; iNode++) { - connElemTemp[nn] = connElemCGNS[counterCGNS + iNode] - 1; nn++; + connElemTemp[nn] = connElemCGNS[counterCGNS + iNode] - 1; + nn++; } counterCGNS += nPoinPerElem[iElem]; - } /*--- Force free the memory for the conn from the CGNS file. ---*/ @@ -595,28 +563,29 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { will appear on multiple ranks). First, initialize a counter and flag. ---*/ - int *nElem_Send = new int[size+1]; nElem_Send[0] = 0; - int *nElem_Recv = new int[size+1]; nElem_Recv[0] = 0; - int *nElem_Flag = new int[size]; + int* nElem_Send = new int[size + 1]; + nElem_Send[0] = 0; + int* nElem_Recv = new int[size + 1]; + nElem_Recv[0] = 0; + int* nElem_Flag = new int[size]; for (iProcessor = 0; iProcessor < size; iProcessor++) { nElem_Send[iProcessor] = 0; nElem_Recv[iProcessor] = 0; - nElem_Flag[iProcessor]= -1; + nElem_Flag[iProcessor] = -1; } nElem_Send[size] = 0; nElem_Recv[size] = 0; /*--- Create a partitioner object to find the owning rank of points. ---*/ - CLinearPartitioner pointPartitioner(numberOfGlobalPoints,0); + CLinearPartitioner pointPartitioner(numberOfGlobalPoints, 0); for (iElem = 0; iElem < nElems[val_section]; iElem++) { for (iNode = 0; iNode < (unsigned long)nPoinPerElem[iElem]; iNode++) { - /*--- Get the index of the current point. ---*/ - iPoint = connElemTemp[iElem*SU2_CONN_SIZE + SU2_CONN_SKIP + iNode]; + iPoint = connElemTemp[iElem * SU2_CONN_SIZE + SU2_CONN_SKIP + iNode]; /*--- Search for the processor that owns this point. ---*/ @@ -627,9 +596,8 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { if ((nElem_Flag[iProcessor] != (int)iElem)) { nElem_Flag[iProcessor] = iElem; - nElem_Send[iProcessor+1]++; + nElem_Send[iProcessor + 1]++; } - } } @@ -637,8 +605,7 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { all processors. After this communication, each proc knows how many cells it will receive from each other processor. ---*/ - SU2_MPI::Alltoall(&(nElem_Send[1]), 1, MPI_INT, - &(nElem_Recv[1]), 1, MPI_INT, SU2_MPI::GetComm()); + SU2_MPI::Alltoall(&(nElem_Send[1]), 1, MPI_INT, &(nElem_Recv[1]), 1, MPI_INT, SU2_MPI::GetComm()); /*--- Prepare to send connectivities. First check how many messages we will be sending and receiving. Here we also put @@ -646,15 +613,14 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { communications simpler. ---*/ unsigned long nSends = 0, nRecvs = 0; - for (iProcessor = 0; iProcessor < size; iProcessor++) - nElem_Flag[iProcessor] = -1; + for (iProcessor = 0; iProcessor < size; iProcessor++) nElem_Flag[iProcessor] = -1; for (iProcessor = 0; iProcessor < size; iProcessor++) { - if ((iProcessor != rank) && (nElem_Send[iProcessor+1] > 0)) nSends++; - if ((iProcessor != rank) && (nElem_Recv[iProcessor+1] > 0)) nRecvs++; + if ((iProcessor != rank) && (nElem_Send[iProcessor + 1] > 0)) nSends++; + if ((iProcessor != rank) && (nElem_Recv[iProcessor + 1] > 0)) nRecvs++; - nElem_Send[iProcessor+1] += nElem_Send[iProcessor]; - nElem_Recv[iProcessor+1] += nElem_Recv[iProcessor]; + nElem_Send[iProcessor + 1] += nElem_Send[iProcessor]; + nElem_Recv[iProcessor + 1] += nElem_Recv[iProcessor]; } /*--- Allocate memory to hold the connectivity that we are @@ -663,28 +629,25 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { We have assumed a constant message size of a hex element (8 nodes) + 2 extra values for the ID and VTK. ---*/ - unsigned long *connSend = NULL, iSend = 0; - unsigned long sendSize = (unsigned long)SU2_CONN_SIZE*nElem_Send[size]; + unsigned long *connSend = nullptr, iSend = 0; + unsigned long sendSize = (unsigned long)SU2_CONN_SIZE * nElem_Send[size]; connSend = new unsigned long[sendSize]; - for (iSend = 0; iSend < sendSize; iSend++) - connSend[iSend] = 0; + for (iSend = 0; iSend < sendSize; iSend++) connSend[iSend] = 0; /*--- Create an index variable to keep track of our index position as we load up the send buffer. ---*/ vector index(size); - for (iProcessor = 0; iProcessor < size; iProcessor++) - index[iProcessor] = SU2_CONN_SIZE*nElem_Send[iProcessor]; + for (iProcessor = 0; iProcessor < size; iProcessor++) index[iProcessor] = SU2_CONN_SIZE * nElem_Send[iProcessor]; /*--- Loop through our elements and load the elems and their additional data that we will send to the other procs. ---*/ for (iElem = 0; iElem < (unsigned long)nElems[val_section]; iElem++) { for (iNode = 0; iNode < (unsigned long)nPoinPerElem[iElem]; iNode++) { - /*--- Get the index of the current point. ---*/ - iPoint = connElemTemp[iElem*SU2_CONN_SIZE + SU2_CONN_SKIP + iNode]; + iPoint = connElemTemp[iElem * SU2_CONN_SIZE + SU2_CONN_SKIP + iNode]; /*--- Search for the processor that owns this point ---*/ @@ -693,7 +656,6 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { /*--- Load connectivity into the buffer for sending ---*/ if (nElem_Flag[iProcessor] != (int)iElem) { - nElem_Flag[iProcessor] = iElem; unsigned long nn = index[iProcessor]; @@ -701,15 +663,14 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { then the connectivity vals, and last, the global ID. ---*/ for (jNode = 0; jNode < SU2_CONN_SIZE; jNode++) { - connSend[nn] = connElemTemp[iElem*SU2_CONN_SIZE + jNode]; nn++; + connSend[nn] = connElemTemp[iElem * SU2_CONN_SIZE + jNode]; + nn++; } /*--- Increment the index by the message length ---*/ index[iProcessor] += SU2_CONN_SIZE; - } - } } @@ -727,16 +688,15 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { we do not include our own rank in the communications. We will directly copy our own data later. ---*/ - unsigned long *connRecv = NULL, iRecv = 0; - unsigned long recvSize = (unsigned long)SU2_CONN_SIZE*nElem_Recv[size]; + unsigned long *connRecv = nullptr, iRecv = 0; + unsigned long recvSize = (unsigned long)SU2_CONN_SIZE * nElem_Recv[size]; connRecv = new unsigned long[recvSize]; - for (iRecv = 0; iRecv < recvSize; iRecv++) - connRecv[iRecv] = 0; + for (iRecv = 0; iRecv < recvSize; iRecv++) connRecv[iRecv] = 0; /*--- Allocate memory for the MPI requests if we will communicate. ---*/ - SU2_MPI::Request *connSendReq = NULL; - SU2_MPI::Request *connRecvReq = NULL; + SU2_MPI::Request* connSendReq = nullptr; + SU2_MPI::Request* connRecvReq = nullptr; if (nSends > 0) { connSendReq = new SU2_MPI::Request[nSends]; @@ -747,15 +707,14 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { /*--- Launch the non-blocking sends and receives. ---*/ - InitiateCommsAll(connSend, nElem_Send, connSendReq, - connRecv, nElem_Recv, connRecvReq, - SU2_CONN_SIZE, COMM_TYPE_UNSIGNED_LONG); + InitiateCommsAll(connSend, nElem_Send, connSendReq, connRecv, nElem_Recv, connRecvReq, SU2_CONN_SIZE, + COMM_TYPE_UNSIGNED_LONG); /*--- Copy the current rank's data into the recv buffer directly. ---*/ - iRecv = SU2_CONN_SIZE*nElem_Recv[rank]; - unsigned long myStart = SU2_CONN_SIZE*nElem_Send[rank]; - unsigned long myFinal = SU2_CONN_SIZE*nElem_Send[rank+1]; + iRecv = SU2_CONN_SIZE * nElem_Recv[rank]; + unsigned long myStart = SU2_CONN_SIZE * nElem_Send[rank]; + unsigned long myFinal = SU2_CONN_SIZE * nElem_Send[rank + 1]; for (iSend = myStart; iSend < myFinal; iSend++) { connRecv[iRecv] = connSend[iSend]; iRecv++; @@ -770,11 +729,11 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { for this section, then write the recv'd values. ---*/ if (nElem_Recv[size] > 0) { - connElems[val_section].resize(nElem_Recv[size]*SU2_CONN_SIZE,0); + connElems[val_section].resize(nElem_Recv[size] * SU2_CONN_SIZE, 0); unsigned long count = 0; for (iElem = 0; iElem < (unsigned long)nElem_Recv[size]; iElem++) { for (iNode = 0; iNode < SU2_CONN_SIZE; iNode++) { - unsigned long nn = iElem*SU2_CONN_SIZE+iNode; + unsigned long nn = iElem * SU2_CONN_SIZE + iNode; connElems[val_section][count] = (cgsize_t)connRecv[nn]; count++; } @@ -786,30 +745,26 @@ void CCGNSMeshReaderFVM::ReadCGNSVolumeSection(int val_section) { nElems[val_section] = nElem_Recv[size]; } else { - /*--- The current rank did not recv any elements from this section. Set the count to zero and nullify the data structure. ---*/ - nElems[val_section] = 0; + nElems[val_section] = 0; connElems[val_section].resize(0); - } /*--- Free temporary memory from communications ---*/ - if (connSendReq != NULL) delete [] connSendReq; - if (connRecvReq != NULL) delete [] connRecvReq; - - delete [] connSend; - delete [] connRecv; - delete [] nElem_Recv; - delete [] nElem_Send; - delete [] nElem_Flag; + delete[] connSendReq; + delete[] connRecvReq; + delete[] connSend; + delete[] connRecv; + delete[] nElem_Recv; + delete[] nElem_Send; + delete[] nElem_Flag; } void CCGNSMeshReaderFVM::ReadCGNSSurfaceSection(int val_section) { - /*--- In this routine, we access a CGNS surface section and have the master rank load all of the surface conn. This can help avoid issues where there are fewer elements than ranks on a surface. This is later @@ -825,37 +780,33 @@ void CCGNSMeshReaderFVM::ReadCGNSSurfaceSection(int val_section) { char sectionName[CGNS_STRING_SIZE]; if (rank == MASTER_NODE) { - /*--- Allocate some memory for the handling the connectivity and auxiliary data that we are need to communicate. ---*/ - vector connElemCGNS(nElems[val_section]*SU2_CONN_SIZE,0); - vector elemTypes(nElems[val_section],0); - vector nPoinPerElem(nElems[val_section],0); - vector elemGlobalID(nElems[val_section],0); + vector connElemCGNS(nElems[val_section] * SU2_CONN_SIZE, 0); + vector elemTypes(nElems[val_section], 0); + vector nPoinPerElem(nElems[val_section], 0); + vector elemGlobalID(nElems[val_section], 0); /*--- Read the section info again ---*/ - if (cg_section_read(cgnsFileID, cgnsBase, cgnsZone, val_section+1, - sectionName, &elemType, &startE, &endE, &nbndry, - &parent_flag)) + if (cg_section_read(cgnsFileID, cgnsBase, cgnsZone, val_section + 1, sectionName, &elemType, &startE, &endE, + &nbndry, &parent_flag)) cg_error_exit(); /*--- Print some information to the console. ---*/ cout << "Loading surface section " << string(sectionName); - cout << " from file." << endl; + cout << " from file." << endl; /*--- Store the number of elems (all on the master). ---*/ - nElems[val_section] = (endE-startE+1); + nElems[val_section] = (endE - startE + 1); /*--- Read and store the total amount of data that will be listed when reading this section. ---*/ - if (cg_ElementDataSize(cgnsFileID, cgnsBase, cgnsZone, val_section+1, - &ElementDataSize)) - cg_error_exit(); + if (cg_ElementDataSize(cgnsFileID, cgnsBase, cgnsZone, val_section + 1, &ElementDataSize)) cg_error_exit(); /*--- Find the number of nodes required to represent this type of element. ---*/ @@ -874,31 +825,27 @@ void CCGNSMeshReaderFVM::ReadCGNSSurfaceSection(int val_section) { /*--- Allocate memory for accessing the connectivity and to store it in the proper data structure for post-processing. ---*/ - vector connElemTemp(ElementDataSize,0); + vector connElemTemp(ElementDataSize, 0); /*--- Retrieve the connectivity information and store. ---*/ if (elemType == MIXED || elemType == NGON_n || elemType == NFACE_n) { - vector connOffsetTemp(nElems[val_section]+1, 0); - if (cg_poly_elements_partial_read(cgnsFileID, cgnsBase, cgnsZone, - val_section+1, startE, endE, - connElemTemp.data(), - connOffsetTemp.data(), NULL) != CG_OK) + vector connOffsetTemp(nElems[val_section] + 1, 0); + if (cg_poly_elements_partial_read(cgnsFileID, cgnsBase, cgnsZone, val_section + 1, startE, endE, + connElemTemp.data(), connOffsetTemp.data(), nullptr) != CG_OK) cg_error_exit(); } else { - if (cg_elements_read(cgnsFileID, cgnsBase, cgnsZone, val_section+1, - connElemTemp.data(), NULL)) + if (cg_elements_read(cgnsFileID, cgnsBase, cgnsZone, val_section + 1, connElemTemp.data(), nullptr)) cg_error_exit(); } /*--- Allocate the memory for the data structure used to carry the connectivity for this section. ---*/ - connElems[val_section].resize(nElems[val_section]*SU2_CONN_SIZE,0); + connElems[val_section].resize(nElems[val_section] * SU2_CONN_SIZE, 0); unsigned long counterCGNS = 0; for (iElem = 0; iElem < nElems[val_section]; iElem++) { - ElementType_t iElemType = elemType; /*--- If we have a mixed element section, we need to check the elem @@ -925,29 +872,24 @@ void CCGNSMeshReaderFVM::ReadCGNSSurfaceSection(int val_section) { format as the interior elements. Note that we subtract 1 to move from the CGNS 1-based indexing to SU2's zero-based. ---*/ - connElems[val_section][iElem*SU2_CONN_SIZE+0] = 0; - connElems[val_section][iElem*SU2_CONN_SIZE+1] = vtk_type; + connElems[val_section][iElem * SU2_CONN_SIZE + 0] = 0; + connElems[val_section][iElem * SU2_CONN_SIZE + 1] = vtk_type; for (iNode = 0; iNode < (unsigned long)npe; iNode++) { - unsigned long nn = iElem*SU2_CONN_SIZE+SU2_CONN_SKIP+iNode; + unsigned long nn = iElem * SU2_CONN_SIZE + SU2_CONN_SKIP + iNode; connElems[val_section][nn] = connElemTemp[counterCGNS] - 1; counterCGNS++; } - } } else { - /*--- We are not the master, so we resize to zero for safety. ---*/ nElems[val_section] = 0; connElems[val_section].resize(0); - } - } void CCGNSMeshReaderFVM::ReformatCGNSVolumeConnectivity() { - /*--- Loop to store total number of elements we have locally. This number includes repeats across ranks due to redistribution according to the linear partitioning of the grid nodes. ---*/ @@ -958,13 +900,13 @@ void CCGNSMeshReaderFVM::ReformatCGNSVolumeConnectivity() { /* Put our CGNS data into the class data structures for the mesh reader */ - localVolumeElementConnectivity.resize(numberOfLocalElements*SU2_CONN_SIZE); + localVolumeElementConnectivity.resize(numberOfLocalElements * SU2_CONN_SIZE); unsigned long count = 0; for (int s = 0; s < nSections; s++) { if (isInterior[s]) { for (unsigned long iElem = 0; iElem < nElems[s]; iElem++) { for (unsigned long iNode = 0; iNode < SU2_CONN_SIZE; iNode++) { - unsigned long nn = iElem*SU2_CONN_SIZE+iNode; + unsigned long nn = iElem * SU2_CONN_SIZE + iNode; localVolumeElementConnectivity[count] = (unsigned long)connElems[s][nn]; count++; } @@ -972,37 +914,33 @@ void CCGNSMeshReaderFVM::ReformatCGNSVolumeConnectivity() { vector().swap(connElems[s]); } } - } void CCGNSMeshReaderFVM::ReformatCGNSSurfaceConnectivity() { - /*--- Prepare the class data for the marker names and connectivity. ---*/ markerNames.resize(numberOfMarkers); surfaceElementConnectivity.resize(numberOfMarkers); - int markerCount = 0; + int markerCount = 0; int elementCount = 0; for (int s = 0; s < nSections; s++) { if (!isInterior[s]) { - /*--- Store the tag for this marker. Remove any whitespaces from the marker names found in the CGNS file to avoid any issues. ---*/ string Marker_Tag = string(sectionNames[s].data()); - Marker_Tag.erase(remove(Marker_Tag.begin(), Marker_Tag.end(),' '), - Marker_Tag.end()); + Marker_Tag.erase(remove(Marker_Tag.begin(), Marker_Tag.end(), ' '), Marker_Tag.end()); markerNames[markerCount] = Marker_Tag; /*--- The master node alone stores the connectivity. ---*/ if (rank == MASTER_NODE) { - surfaceElementConnectivity[markerCount].resize(nElems[s]*SU2_CONN_SIZE); + surfaceElementConnectivity[markerCount].resize(nElems[s] * SU2_CONN_SIZE); elementCount = 0; for (unsigned long iElem = 0; iElem < nElems[s]; iElem++) { for (unsigned long iNode = 0; iNode < SU2_CONN_SIZE; iNode++) { - unsigned long nn = iElem*SU2_CONN_SIZE+iNode; + unsigned long nn = iElem * SU2_CONN_SIZE + iNode; surfaceElementConnectivity[markerCount][elementCount] = (unsigned long)connElems[s][nn]; elementCount++; } @@ -1012,87 +950,71 @@ void CCGNSMeshReaderFVM::ReformatCGNSSurfaceConnectivity() { markerCount++; } } - } -string CCGNSMeshReaderFVM::GetCGNSElementType(ElementType_t val_elem_type, - int &val_vtk_type) { - +string CCGNSMeshReaderFVM::GetCGNSElementType(ElementType_t val_elem_type, int& val_vtk_type) { /* Check the CGNS element type and return the string name for the element and the associated VTK type index. */ string elem_name; switch (val_elem_type) { case NODE: - elem_name = "Vertex"; - val_vtk_type = 1; - SU2_MPI::Error("Vertex elements detected. Please remove.", - CURRENT_FUNCTION); + elem_name = "Vertex"; + val_vtk_type = 1; + SU2_MPI::Error("Vertex elements detected. Please remove.", CURRENT_FUNCTION); break; case BAR_2: - elem_name = "Line"; - val_vtk_type = 3; - if (dimension == 3) - SU2_MPI::Error("Line elements detected in a 3D mesh. Please remove.", - CURRENT_FUNCTION); + elem_name = "Line"; + val_vtk_type = 3; + if (dimension == 3) SU2_MPI::Error("Line elements detected in a 3D mesh. Please remove.", CURRENT_FUNCTION); break; case BAR_3: - elem_name = "Line"; - val_vtk_type = 3; - if (dimension == 3) - SU2_MPI::Error("Line elements detected in a 3D mesh. Please remove.", - CURRENT_FUNCTION); + elem_name = "Line"; + val_vtk_type = 3; + if (dimension == 3) SU2_MPI::Error("Line elements detected in a 3D mesh. Please remove.", CURRENT_FUNCTION); break; case TRI_3: - elem_name = "Triangle"; - val_vtk_type = 5; + elem_name = "Triangle"; + val_vtk_type = 5; break; case QUAD_4: - elem_name = "Quadrilateral"; - val_vtk_type = 9; + elem_name = "Quadrilateral"; + val_vtk_type = 9; break; case TETRA_4: - elem_name = "Tetrahedron"; - val_vtk_type = 10; + elem_name = "Tetrahedron"; + val_vtk_type = 10; break; case HEXA_8: - elem_name = "Hexahedron"; - val_vtk_type = 12; + elem_name = "Hexahedron"; + val_vtk_type = 12; break; case PENTA_6: - elem_name = "Prism"; - val_vtk_type = 13; + elem_name = "Prism"; + val_vtk_type = 13; break; case PYRA_5: - elem_name = "Pyramid"; - val_vtk_type = 14; + elem_name = "Pyramid"; + val_vtk_type = 14; break; case MIXED: - elem_name = "Mixed"; - val_vtk_type = -1; + elem_name = "Mixed"; + val_vtk_type = -1; break; default: char buf[100]; - SPRINTF(buf, "Unsupported or unknown CGNS element type: (type %d)\n", - val_elem_type); + SPRINTF(buf, "Unsupported or unknown CGNS element type: (type %d)\n", val_elem_type); SU2_MPI::Error(string(buf), CURRENT_FUNCTION); break; } return elem_name; - } #endif -void CCGNSMeshReaderFVM::InitiateCommsAll(void *bufSend, - const int *nElemSend, - SU2_MPI::Request *sendReq, - void *bufRecv, - const int *nElemRecv, - SU2_MPI::Request *recvReq, - unsigned short countPerElem, +void CCGNSMeshReaderFVM::InitiateCommsAll(void* bufSend, const int* nElemSend, SU2_MPI::Request* sendReq, void* bufRecv, + const int* nElemRecv, SU2_MPI::Request* recvReq, unsigned short countPerElem, unsigned short commType) { - /*--- Local variables ---*/ int iMessage, iProc, offset, nElem, count, source, dest, tag; @@ -1101,64 +1023,56 @@ void CCGNSMeshReaderFVM::InitiateCommsAll(void *bufSend, iMessage = 0; for (iProc = 0; iProc < size; iProc++) { - /*--- Post recv's only if another proc is sending us data. We do not communicate with ourselves or post recv's for zero length messages to keep overhead down. ---*/ - if ((nElemRecv[iProc+1] > nElemRecv[iProc]) && (iProc != rank)) { - + if ((nElemRecv[iProc + 1] > nElemRecv[iProc]) && (iProc != rank)) { /*--- Compute our location in the recv buffer. ---*/ - offset = countPerElem*nElemRecv[iProc]; + offset = countPerElem * nElemRecv[iProc]; /*--- Take advantage of cumulative storage format to get the number of elems that we need to recv. ---*/ - nElem = nElemRecv[iProc+1] - nElemRecv[iProc]; + nElem = nElemRecv[iProc + 1] - nElemRecv[iProc]; /*--- Total count can include multiple pieces of data per element. ---*/ - count = countPerElem*nElem; + count = countPerElem * nElem; /*--- Post non-blocking recv for this proc. ---*/ - source = iProc; tag = iProc + 1; + source = iProc; + tag = iProc + 1; switch (commType) { case COMM_TYPE_DOUBLE: - SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_DOUBLE, source, tag, SU2_MPI::GetComm(), - &(recvReq[iMessage])); + SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), count, MPI_DOUBLE, source, tag, + SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_UNSIGNED_LONG: - SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_UNSIGNED_LONG, source, tag, SU2_MPI::GetComm(), - &(recvReq[iMessage])); + SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), count, MPI_UNSIGNED_LONG, source, tag, + SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_LONG: - SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_LONG, source, tag, SU2_MPI::GetComm(), + SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), count, MPI_LONG, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_UNSIGNED_SHORT: - SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_UNSIGNED_SHORT, source, tag, SU2_MPI::GetComm(), - &(recvReq[iMessage])); + SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), count, MPI_UNSIGNED_SHORT, source, tag, + SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_CHAR: - SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_CHAR, source, tag, SU2_MPI::GetComm(), + SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), count, MPI_CHAR, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_SHORT: - SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_SHORT, source, tag, SU2_MPI::GetComm(), + SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), count, MPI_SHORT, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; case COMM_TYPE_INT: - SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), - count, MPI_INT, source, tag, SU2_MPI::GetComm(), + SU2_MPI::Irecv(&(static_cast(bufRecv)[offset]), count, MPI_INT, source, tag, SU2_MPI::GetComm(), &(recvReq[iMessage])); break; default: @@ -1168,7 +1082,6 @@ void CCGNSMeshReaderFVM::InitiateCommsAll(void *bufSend, /*--- Increment message counter. ---*/ iMessage++; - } } @@ -1176,64 +1089,56 @@ void CCGNSMeshReaderFVM::InitiateCommsAll(void *bufSend, iMessage = 0; for (iProc = 0; iProc < size; iProc++) { - /*--- Post sends only if we are sending another proc data. We do not communicate with ourselves or post sends for zero length messages to keep overhead down. ---*/ - if ((nElemSend[iProc+1] > nElemSend[iProc]) && (iProc != rank)) { - + if ((nElemSend[iProc + 1] > nElemSend[iProc]) && (iProc != rank)) { /*--- Compute our location in the send buffer. ---*/ - offset = countPerElem*nElemSend[iProc]; + offset = countPerElem * nElemSend[iProc]; /*--- Take advantage of cumulative storage format to get the number of elems that we need to send. ---*/ - nElem = nElemSend[iProc+1] - nElemSend[iProc]; + nElem = nElemSend[iProc + 1] - nElemSend[iProc]; /*--- Total count can include multiple pieces of data per element. ---*/ - count = countPerElem*nElem; + count = countPerElem * nElem; /*--- Post non-blocking send for this proc. ---*/ - dest = iProc; tag = rank + 1; + dest = iProc; + tag = rank + 1; switch (commType) { case COMM_TYPE_DOUBLE: - SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_DOUBLE, dest, tag, SU2_MPI::GetComm(), + SU2_MPI::Isend(&(static_cast(bufSend)[offset]), count, MPI_DOUBLE, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_UNSIGNED_LONG: - SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_UNSIGNED_LONG, dest, tag, SU2_MPI::GetComm(), - &(sendReq[iMessage])); + SU2_MPI::Isend(&(static_cast(bufSend)[offset]), count, MPI_UNSIGNED_LONG, dest, tag, + SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_LONG: - SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_LONG, dest, tag, SU2_MPI::GetComm(), + SU2_MPI::Isend(&(static_cast(bufSend)[offset]), count, MPI_LONG, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_UNSIGNED_SHORT: - SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_UNSIGNED_SHORT, dest, tag, SU2_MPI::GetComm(), - &(sendReq[iMessage])); + SU2_MPI::Isend(&(static_cast(bufSend)[offset]), count, MPI_UNSIGNED_SHORT, dest, tag, + SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_CHAR: - SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_CHAR, dest, tag, SU2_MPI::GetComm(), + SU2_MPI::Isend(&(static_cast(bufSend)[offset]), count, MPI_CHAR, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_SHORT: - SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_SHORT, dest, tag, SU2_MPI::GetComm(), + SU2_MPI::Isend(&(static_cast(bufSend)[offset]), count, MPI_SHORT, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; case COMM_TYPE_INT: - SU2_MPI::Isend(&(static_cast(bufSend)[offset]), - count, MPI_INT, dest, tag, SU2_MPI::GetComm(), + SU2_MPI::Isend(&(static_cast(bufSend)[offset]), count, MPI_INT, dest, tag, SU2_MPI::GetComm(), &(sendReq[iMessage])); break; default: @@ -1243,17 +1148,12 @@ void CCGNSMeshReaderFVM::InitiateCommsAll(void *bufSend, /*--- Increment message counter. ---*/ iMessage++; - } } - } -void CCGNSMeshReaderFVM::CompleteCommsAll(int nSends, - SU2_MPI::Request *sendReq, - int nRecvs, - SU2_MPI::Request *recvReq) { - +void CCGNSMeshReaderFVM::CompleteCommsAll(int nSends, SU2_MPI::Request* sendReq, int nRecvs, + SU2_MPI::Request* recvReq) { /*--- Local variables ---*/ int ind, iSend, iRecv; @@ -1261,12 +1161,9 @@ void CCGNSMeshReaderFVM::CompleteCommsAll(int nSends, /*--- Wait for the non-blocking sends to complete. ---*/ - for (iSend = 0; iSend < nSends; iSend++) - SU2_MPI::Waitany(nSends, sendReq, &ind, &status); + for (iSend = 0; iSend < nSends; iSend++) SU2_MPI::Waitany(nSends, sendReq, &ind, &status); /*--- Wait for the non-blocking recvs to complete. ---*/ - for (iRecv = 0; iRecv < nRecvs; iRecv++) - SU2_MPI::Waitany(nRecvs, recvReq, &ind, &status); - + for (iRecv = 0; iRecv < nRecvs; iRecv++) SU2_MPI::Waitany(nRecvs, recvReq, &ind, &status); } diff --git a/Common/src/geometry/meshreader/CMeshReaderFVM.cpp b/Common/src/geometry/meshreader/CMeshReaderFVM.cpp index dde520aa244..d0d2b3ab243 100644 --- a/Common/src/geometry/meshreader/CMeshReaderFVM.cpp +++ b/Common/src/geometry/meshreader/CMeshReaderFVM.cpp @@ -3,7 +3,7 @@ * \brief Helper class that provides the counts for each rank in a linear * partitioning given the global count as input. * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -28,10 +28,5 @@ #include "../../../include/geometry/meshreader/CMeshReaderFVM.hpp" -CMeshReaderFVM::CMeshReaderFVM(const CConfig *val_config, - unsigned short val_iZone, - unsigned short val_nZone) : - rank(SU2_MPI::GetRank()), - size(SU2_MPI::GetSize()), - config(val_config) { -} +CMeshReaderFVM::CMeshReaderFVM(const CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone) + : rank(SU2_MPI::GetRank()), size(SU2_MPI::GetSize()), config(val_config) {} diff --git a/Common/src/geometry/meshreader/CRectangularMeshReaderFVM.cpp b/Common/src/geometry/meshreader/CRectangularMeshReaderFVM.cpp index e4dd6c48a26..b14a2ded97b 100644 --- a/Common/src/geometry/meshreader/CRectangularMeshReaderFVM.cpp +++ b/Common/src/geometry/meshreader/CRectangularMeshReaderFVM.cpp @@ -3,7 +3,7 @@ * \brief Reads a 2D rectangular grid into linear partitions for the * finite volume solver (FVM). * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -29,16 +29,14 @@ #include "../../../include/toolboxes/CLinearPartitioner.hpp" #include "../../../include/geometry/meshreader/CRectangularMeshReaderFVM.hpp" -CRectangularMeshReaderFVM::CRectangularMeshReaderFVM(const CConfig *val_config, - unsigned short val_iZone, +CRectangularMeshReaderFVM::CRectangularMeshReaderFVM(const CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone) -: CMeshReaderFVM(val_config, val_iZone, val_nZone) { - + : CMeshReaderFVM(val_config, val_iZone, val_nZone) { /* The rectangular mesh is always 2D. */ dimension = 2; /* Set the VTK type for the interior elements and the boundary elements. */ - KindElem = QUADRILATERAL; + KindElem = QUADRILATERAL; KindBound = LINE; /* The number of nodes in the i and j directions. */ @@ -61,19 +59,17 @@ CRectangularMeshReaderFVM::CRectangularMeshReaderFVM(const CConfig *val_config, ComputeRectangularPointCoordinates(); ComputeRectangularVolumeConnectivity(); ComputeRectangularSurfaceConnectivity(); - } void CRectangularMeshReaderFVM::ComputeRectangularPointCoordinates() { - /* Set the global count of points based on the grid dimensions. */ - numberOfGlobalPoints = (nNode)*(mNode); + numberOfGlobalPoints = (nNode) * (mNode); /* Get a partitioner to help with linear partitioning. */ - CLinearPartitioner pointPartitioner(numberOfGlobalPoints,0); + CLinearPartitioner pointPartitioner(numberOfGlobalPoints, 0); /* Determine number of local points */ - for(unsigned long globalIndex=0; globalIndex < numberOfGlobalPoints; globalIndex++) { + for (unsigned long globalIndex = 0; globalIndex < numberOfGlobalPoints; globalIndex++) { if ((int)pointPartitioner.GetRankContainingIndex(globalIndex) == rank) { numberOfLocalPoints++; } @@ -82,16 +78,14 @@ void CRectangularMeshReaderFVM::ComputeRectangularPointCoordinates() { /* Loop over our analytically defined of coordinates and store only those that contain a node within our linear partition of points. */ localPointCoordinates.resize(dimension); - for (int k = 0; k < dimension; k++) - localPointCoordinates[k].reserve(numberOfLocalPoints); + for (int k = 0; k < dimension; k++) localPointCoordinates[k].reserve(numberOfLocalPoints); unsigned long globalIndex = 0; for (unsigned long jNode = 0; jNode < mNode; jNode++) { for (unsigned long iNode = 0; iNode < nNode; iNode++) { if ((int)pointPartitioner.GetRankContainingIndex(globalIndex) == rank) { - /* Store the coordinates more clearly. */ - const passivedouble x = SU2_TYPE::GetValue(Lx*((su2double)iNode)/((su2double)(nNode-1))+Ox); - const passivedouble y = SU2_TYPE::GetValue(Ly*((su2double)jNode)/((su2double)(mNode-1))+Oy); + const passivedouble x = SU2_TYPE::GetValue(Lx * ((su2double)iNode) / ((su2double)(nNode - 1)) + Ox); + const passivedouble y = SU2_TYPE::GetValue(Ly * ((su2double)jNode) / ((su2double)(mNode - 1)) + Oy); /* Load into the coordinate class data structure. */ localPointCoordinates[0].push_back(x); @@ -100,30 +94,27 @@ void CRectangularMeshReaderFVM::ComputeRectangularPointCoordinates() { globalIndex++; } } - } void CRectangularMeshReaderFVM::ComputeRectangularVolumeConnectivity() { - /* Set the global count of elements based on the grid dimensions. */ - numberOfGlobalElements = (nNode-1)*(mNode-1); + numberOfGlobalElements = (nNode - 1) * (mNode - 1); /* Get a partitioner to help with linear partitioning. */ - CLinearPartitioner pointPartitioner(numberOfGlobalPoints,0); + CLinearPartitioner pointPartitioner(numberOfGlobalPoints, 0); /* Loop over our analytically defined of elements and store only those that contain a node within our linear partition of points. */ - numberOfLocalElements = 0; - vector connectivity(N_POINTS_HEXAHEDRON,0); + numberOfLocalElements = 0; + vector connectivity(N_POINTS_HEXAHEDRON, 0); unsigned long globalIndex = 0; - for (unsigned long jNode = 0; jNode < mNode-1; jNode++) { - for (unsigned long iNode = 0; iNode < nNode-1; iNode++) { - + for (unsigned long jNode = 0; jNode < mNode - 1; jNode++) { + for (unsigned long iNode = 0; iNode < nNode - 1; iNode++) { /* Compute connectivity based on the i,j index. */ - connectivity[0] = jNode*nNode + iNode; - connectivity[1] = jNode*nNode + iNode + 1; - connectivity[2] = (jNode + 1)*nNode + (iNode + 1); - connectivity[3] = (jNode + 1)*nNode + iNode; + connectivity[0] = jNode * nNode + iNode; + connectivity[1] = jNode * nNode + iNode + 1; + connectivity[2] = (jNode + 1) * nNode + (iNode + 1); + connectivity[3] = (jNode + 1) * nNode + iNode; /* Check whether any of the points is in our linear partition. */ bool isOwned = false; @@ -145,11 +136,9 @@ void CRectangularMeshReaderFVM::ComputeRectangularVolumeConnectivity() { globalIndex++; } } - } void CRectangularMeshReaderFVM::ComputeRectangularSurfaceConnectivity() { - /* The rectangle alays has 4 markers. */ numberOfMarkers = 4; surfaceElementConnectivity.resize(numberOfMarkers); @@ -158,49 +147,45 @@ void CRectangularMeshReaderFVM::ComputeRectangularSurfaceConnectivity() { /* Compute and store the 4 sets of connectivity. */ markerNames[0] = "y_minus"; if (rank == MASTER_NODE) { - for (unsigned long iNode = 0; iNode < nNode-1; iNode++) { + for (unsigned long iNode = 0; iNode < nNode - 1; iNode++) { surfaceElementConnectivity[0].push_back(0); surfaceElementConnectivity[0].push_back(KindBound); surfaceElementConnectivity[0].push_back(iNode); surfaceElementConnectivity[0].push_back(iNode + 1); - for (unsigned short i = 0; i < 6; i++) - surfaceElementConnectivity[0].push_back(0); + for (unsigned short i = 0; i < 6; i++) surfaceElementConnectivity[0].push_back(0); } } markerNames[1] = "x_plus"; if (rank == MASTER_NODE) { - for (unsigned long jNode = 0; jNode < mNode-1; jNode++) { + for (unsigned long jNode = 0; jNode < mNode - 1; jNode++) { surfaceElementConnectivity[1].push_back(0); surfaceElementConnectivity[1].push_back(KindBound); - surfaceElementConnectivity[1].push_back(jNode*nNode + (nNode - 1)); - surfaceElementConnectivity[1].push_back((jNode + 1)*nNode + (nNode - 1)); - for (unsigned short i = 0; i < 6; i++) - surfaceElementConnectivity[1].push_back(0); + surfaceElementConnectivity[1].push_back(jNode * nNode + (nNode - 1)); + surfaceElementConnectivity[1].push_back((jNode + 1) * nNode + (nNode - 1)); + for (unsigned short i = 0; i < 6; i++) surfaceElementConnectivity[1].push_back(0); } } markerNames[2] = "y_plus"; if (rank == MASTER_NODE) { - for (unsigned long iNode = 0; iNode < nNode-1; iNode++) { + for (unsigned long iNode = 0; iNode < nNode - 1; iNode++) { surfaceElementConnectivity[2].push_back(0); surfaceElementConnectivity[2].push_back(KindBound); - surfaceElementConnectivity[2].push_back((nNode*mNode - 1) - iNode); - surfaceElementConnectivity[2].push_back((nNode*mNode - 1) - (iNode + 1)); - for (unsigned short i = 0; i < 6; i++) - surfaceElementConnectivity[2].push_back(0); + surfaceElementConnectivity[2].push_back((nNode * mNode - 1) - iNode); + surfaceElementConnectivity[2].push_back((nNode * mNode - 1) - (iNode + 1)); + for (unsigned short i = 0; i < 6; i++) surfaceElementConnectivity[2].push_back(0); } } markerNames[3] = "x_minus"; if (rank == MASTER_NODE) { - for (unsigned long jNode = 0; jNode < mNode-1; jNode++) { + for (unsigned long jNode = 0; jNode < mNode - 1; jNode++) { surfaceElementConnectivity[3].push_back(0); surfaceElementConnectivity[3].push_back(KindBound); - surfaceElementConnectivity[3].push_back((jNode + 1)*nNode); - surfaceElementConnectivity[3].push_back(jNode*nNode); - for (unsigned short i = 0; i < 6; i++) - surfaceElementConnectivity[3].push_back(0); + surfaceElementConnectivity[3].push_back((jNode + 1) * nNode); + surfaceElementConnectivity[3].push_back(jNode * nNode); + for (unsigned short i = 0; i < 6; i++) surfaceElementConnectivity[3].push_back(0); } } } diff --git a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp index 92e63d0623d..65daf489737 100644 --- a/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp +++ b/Common/src/geometry/meshreader/CSU2ASCIIMeshReaderFVM.cpp @@ -3,7 +3,7 @@ * \brief Reads a native SU2 ASCII grid into linear partitions for the * finite volume solver (FVM). * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -29,19 +29,14 @@ #include "../../../include/toolboxes/CLinearPartitioner.hpp" #include "../../../include/geometry/meshreader/CSU2ASCIIMeshReaderFVM.hpp" -CSU2ASCIIMeshReaderFVM::CSU2ASCIIMeshReaderFVM(CConfig *val_config, - unsigned short val_iZone, - unsigned short val_nZone) -: CMeshReaderFVM(val_config, val_iZone, val_nZone), - myZone(val_iZone), - nZones(val_nZone), - meshFilename(config->GetMesh_FileName()) { - - actuator_disk = (((config->GetnMarker_ActDiskInlet() != 0) || - (config->GetnMarker_ActDiskOutlet() != 0)) && - ((config->GetKind_SU2() == SU2_COMPONENT::SU2_CFD) || - ((config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF) && - (config->GetActDisk_SU2_DEF())))); +CSU2ASCIIMeshReaderFVM::CSU2ASCIIMeshReaderFVM(CConfig* val_config, unsigned short val_iZone, unsigned short val_nZone) + : CMeshReaderFVM(val_config, val_iZone, val_nZone), + myZone(val_iZone), + nZones(val_nZone), + meshFilename(config->GetMesh_FileName()) { + actuator_disk = (((config->GetnMarker_ActDiskInlet() != 0) || (config->GetnMarker_ActDiskOutlet() != 0)) && + ((config->GetKind_SU2() == SU2_COMPONENT::SU2_CFD) || + ((config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF) && (config->GetActDisk_SU2_DEF())))); if (config->GetActDisk_DoubleSurface()) actuator_disk = false; /* Read the basic metadata and perform some basic error checks. */ @@ -55,8 +50,7 @@ CSU2ASCIIMeshReaderFVM::CSU2ASCIIMeshReaderFVM(CConfig *val_config, /* If the mesh contains an actuator disk as a single surface, we need to first split the surface into repeated points and update the connectivity for each element touching the surface. */ - if (actuator_disk) - SplitActuatorDiskSurface(); + if (actuator_disk) SplitActuatorDiskSurface(); /* Read and store the points, interior elements, and surface elements. We store only the points and interior elements on our rank's linear @@ -67,22 +61,21 @@ CSU2ASCIIMeshReaderFVM::CSU2ASCIIMeshReaderFVM(CConfig *val_config, for (auto section : SectionOrder) { switch (section) { - case FileSection::ELEMENTS: - ReadVolumeElementConnectivity(); - break; - case FileSection::POINTS: - ReadPointCoordinates(); - break; - case FileSection::MARKERS: - ReadSurfaceElementConnectivity(); - break; + case FileSection::ELEMENTS: + ReadVolumeElementConnectivity(); + break; + case FileSection::POINTS: + ReadPointCoordinates(); + break; + case FileSection::MARKERS: + ReadSurfaceElementConnectivity(); + break; } } mesh_file.close(); } -bool CSU2ASCIIMeshReaderFVM::ReadMetadata(const bool single_pass, CConfig *config) { - +bool CSU2ASCIIMeshReaderFVM::ReadMetadata(const bool single_pass, CConfig* config) { const bool harmonic_balance = config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE; const bool multizone_file = config->GetMultizone_Mesh(); @@ -90,8 +83,10 @@ bool CSU2ASCIIMeshReaderFVM::ReadMetadata(const bool single_pass, CConfig *confi mesh_file.open(meshFilename); if (mesh_file.fail()) { - SU2_MPI::Error("Error opening SU2 ASCII grid.\n" - "Check that the file exists.", CURRENT_FUNCTION); + SU2_MPI::Error( + "Error opening SU2 ASCII grid.\n" + "Check that the file exists.", + CURRENT_FUNCTION); } /*--- If more than one, find the curent zone in the mesh file. ---*/ @@ -99,16 +94,15 @@ bool CSU2ASCIIMeshReaderFVM::ReadMetadata(const bool single_pass, CConfig *confi string text_line; if ((nZones > 1 && multizone_file) || harmonic_balance) { if (harmonic_balance) { - if (rank == MASTER_NODE) cout << "Reading time instance " << config->GetiInst()+1 << "." << endl; - } - else { + if (rank == MASTER_NODE) cout << "Reading time instance " << config->GetiInst() + 1 << "." << endl; + } else { bool foundZone = false; - while (getline (mesh_file,text_line)) { + while (getline(mesh_file, text_line)) { /*--- Search for the current domain ---*/ - if (text_line.find ("IZONE=",0) != string::npos) { - text_line.erase (0,6); + if (text_line.find("IZONE=", 0) != string::npos) { + text_line.erase(0, 6); unsigned short jZone = atoi(text_line.c_str()); - if (jZone == myZone+1) { + if (jZone == myZone + 1) { if (rank == MASTER_NODE) cout << "Reading zone " << myZone << " from native SU2 ASCII mesh." << endl; foundZone = true; break; @@ -116,8 +110,10 @@ bool CSU2ASCIIMeshReaderFVM::ReadMetadata(const bool single_pass, CConfig *confi } } if (!foundZone) { - SU2_MPI::Error("Could not find the IZONE= keyword or the zone contents.\n" - "Check the SU2 ASCII file format.", CURRENT_FUNCTION); + SU2_MPI::Error( + "Could not find the IZONE= keyword or the zone contents.\n" + "Check the SU2 ASCII file format.", + CURRENT_FUNCTION); } } } @@ -132,12 +128,11 @@ bool CSU2ASCIIMeshReaderFVM::ReadMetadata(const bool single_pass, CConfig *confi int current_section_idx = 0; bool single_pass_active = false; - while (getline (mesh_file, text_line)) { - + while (getline(mesh_file, text_line)) { /*--- Read the dimension of the problem ---*/ - if (!foundNDIME && text_line.find ("NDIME=",0) != string::npos) { - text_line.erase (0,6); + if (!foundNDIME && text_line.find("NDIME=", 0) != string::npos) { + text_line.erase(0, 6); dimension = atoi(text_line.c_str()); foundNDIME = true; continue; @@ -145,8 +140,8 @@ bool CSU2ASCIIMeshReaderFVM::ReadMetadata(const bool single_pass, CConfig *confi /*--- The AoA and AoS offset values are optional. ---*/ - if (text_line.find ("AOA_OFFSET=",0) != string::npos) { - text_line.erase (0,11); + if (text_line.find("AOA_OFFSET=", 0) != string::npos) { + text_line.erase(0, 11); su2double AoA_Offset = atof(text_line.c_str()); /*--- The offset is in deg ---*/ @@ -158,16 +153,15 @@ bool CSU2ASCIIMeshReaderFVM::ReadMetadata(const bool single_pass, CConfig *confi if (!config->GetDiscard_InFiles()) { cout << "WARNING: AoA in the config file (" << config->GetAoA() << " deg.) +\n"; cout << " AoA offset in mesh file (" << AoA_Offset << " deg.) = " << AoA_Current << " deg." << endl; - } - else { + } else { cout << "WARNING: Discarding the AoA offset in the mesh file." << endl; } } continue; } - if (text_line.find ("AOS_OFFSET=",0) != string::npos) { - text_line.erase (0,11); + if (text_line.find("AOS_OFFSET=", 0) != string::npos) { + text_line.erase(0, 11); su2double AoS_Offset = atof(text_line.c_str()); /*--- The offset is in deg ---*/ @@ -179,50 +173,45 @@ bool CSU2ASCIIMeshReaderFVM::ReadMetadata(const bool single_pass, CConfig *confi if (!config->GetDiscard_InFiles()) { cout << "WARNING: AoS in the config file (" << config->GetAoS() << " deg.) +\n"; cout << " AoS offset in mesh file (" << AoS_Offset << " deg.) = " << AoS_Current << " deg." << endl; - } - else { + } else { cout << "WARNING: Discarding the AoS offset in the mesh file." << endl; } } continue; } - if (!foundNPOIN && text_line.find ("NPOIN=",0) != string::npos) { - text_line.erase (0,6); + if (!foundNPOIN && text_line.find("NPOIN=", 0) != string::npos) { + text_line.erase(0, 6); numberOfGlobalPoints = atoi(text_line.c_str()); /* If the points were found first, read them, otherwise just consume the lines. */ if (single_pass && foundNDIME && current_section_idx == 0) { single_pass_active = true; ReadPointCoordinates(true); - } - else { - for (auto iPoint = 0ul; iPoint < numberOfGlobalPoints; iPoint++) - getline (mesh_file, text_line); + } else { + for (auto iPoint = 0ul; iPoint < numberOfGlobalPoints; iPoint++) getline(mesh_file, text_line); } SectionOrder[current_section_idx++] = FileSection::POINTS; foundNPOIN = true; continue; } - if (!foundNELEM && text_line.find ("NELEM=",0) != string::npos) { - text_line.erase (0,6); + if (!foundNELEM && text_line.find("NELEM=", 0) != string::npos) { + text_line.erase(0, 6); numberOfGlobalElements = atoi(text_line.c_str()); if (single_pass_active) { ReadVolumeElementConnectivity(true); - } - else { - for (auto iElem = 0ul; iElem < numberOfGlobalElements; iElem++) - getline (mesh_file, text_line); + } else { + for (auto iElem = 0ul; iElem < numberOfGlobalElements; iElem++) getline(mesh_file, text_line); } SectionOrder[current_section_idx++] = FileSection::ELEMENTS; foundNELEM = true; continue; } - if (!foundNMARK && text_line.find ("NMARK=",0) != string::npos) { - text_line.erase (0,6); + if (!foundNMARK && text_line.find("NMARK=", 0) != string::npos) { + text_line.erase(0, 6); numberOfMarkers = atoi(text_line.c_str()); if (current_section_idx != 2) { @@ -237,7 +226,7 @@ bool CSU2ASCIIMeshReaderFVM::ReadMetadata(const bool single_pass, CConfig *confi } /* Stop before we reach the next zone then check for errors below. */ - if (text_line.find ("IZONE=",0) != string::npos) { + if (text_line.find("IZONE=", 0) != string::npos) { break; } } @@ -246,32 +235,41 @@ bool CSU2ASCIIMeshReaderFVM::ReadMetadata(const bool single_pass, CConfig *confi /* Throw an error if any of the keywords was not found. */ if (!foundNDIME) { - SU2_MPI::Error("Could not find the keyword \"NDIME=\".\n" - "Check the SU2 ASCII file format.", CURRENT_FUNCTION); + SU2_MPI::Error( + "Could not find the keyword \"NDIME=\".\n" + "Check the SU2 ASCII file format.", + CURRENT_FUNCTION); } if (!foundNPOIN) { - SU2_MPI::Error("Could not find the keyword \"NPOIN=\".\n" - "Check the SU2 ASCII file format.", CURRENT_FUNCTION); + SU2_MPI::Error( + "Could not find the keyword \"NPOIN=\".\n" + "Check the SU2 ASCII file format.", + CURRENT_FUNCTION); } if (!foundNELEM) { - SU2_MPI::Error("Could not find the keyword \"NELEM=\".\n" - "Check the SU2 ASCII file format.", CURRENT_FUNCTION); + SU2_MPI::Error( + "Could not find the keyword \"NELEM=\".\n" + "Check the SU2 ASCII file format.", + CURRENT_FUNCTION); } if (!foundNMARK) { - SU2_MPI::Error("Could not find the keyword \"NMARK=\".\n" - "Check the SU2 ASCII file format.", CURRENT_FUNCTION); + SU2_MPI::Error( + "Could not find the keyword \"NMARK=\".\n" + "Check the SU2 ASCII file format.", + CURRENT_FUNCTION); } return single_pass_active; } void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { - /*--- Actuator disk preprocesing ---*/ bool InElem, Perimeter; unsigned long Counter = 0; - Xloc = 0.0; Yloc = 0.0; Zloc = 0.0; + Xloc = 0.0; + Yloc = 0.0; + Zloc = 0.0; unsigned long nElem_Bound_; vector EdgeBegin, EdgeEnd; @@ -279,7 +277,7 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { unsigned long AuxEdge, iEdge, jEdge, nEdges, nPointVolume; unsigned long long FirstEdgeIndex, SecondEdgeIndex; - vector connectivity(N_POINTS_HEXAHEDRON,0); + vector connectivity(N_POINTS_HEXAHEDRON, 0); vector ActDiskPoint_Front_Inv(numberOfGlobalPoints); vector ActDiskPoint_Front; vector VolumePoint; @@ -291,7 +289,7 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { boundary. Throw an error otherwise. */ if (config->GetnMarker_ActDiskInlet() > 1) { SU2_MPI::Error(string("Current implementation can only split a single actuator disk.") + - string(" \n Remove disks or re-export your mesh with double surfaces (repeated points)."), + string(" \n Remove disks or re-export your mesh with double surfaces (repeated points)."), CURRENT_FUNCTION); } @@ -304,74 +302,78 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { string text_line; string::size_type position; - while (getline (mesh_file, text_line)) { - - position = text_line.find ("NMARK=",0); + while (getline(mesh_file, text_line)) { + position = text_line.find("NMARK=", 0); if (position != string::npos) { - - for (unsigned short iMarker = 0 ; iMarker < numberOfMarkers; iMarker++) { - - getline (mesh_file, text_line); - text_line.erase (0,11); string::size_type position; + for (unsigned short iMarker = 0; iMarker < numberOfMarkers; iMarker++) { + getline(mesh_file, text_line); + text_line.erase(0, 11); + string::size_type position; for (unsigned short iChar = 0; iChar < 20; iChar++) { - position = text_line.find( " ", 0 ); - if (position != string::npos) text_line.erase (position,1); - position = text_line.find( "\r", 0 ); - if (position != string::npos) text_line.erase (position,1); - position = text_line.find( "\n", 0 ); - if (position != string::npos) text_line.erase (position,1); + position = text_line.find(' ', 0); + if (position != string::npos) text_line.erase(position, 1); + position = text_line.find('\r', 0); + if (position != string::npos) text_line.erase(position, 1); + position = text_line.find('\n', 0); + if (position != string::npos) text_line.erase(position, 1); } - string Marker_Tag = text_line.c_str(); + string Marker_Tag = text_line; - getline (mesh_file, text_line); - text_line.erase (0,13); + getline(mesh_file, text_line); + text_line.erase(0, 13); nElem_Bound_ = atoi(text_line.c_str()); if (Marker_Tag != config->GetMarker_ActDiskInlet_TagBound(0)) { - for (unsigned long iElem_Bound = 0; iElem_Bound < nElem_Bound_; iElem_Bound++) { getline (mesh_file, text_line); } - } - else { - + for (unsigned long iElem_Bound = 0; iElem_Bound < nElem_Bound_; iElem_Bound++) { + getline(mesh_file, text_line); + } + } else { if (rank == MASTER_NODE) - cout << "Splitting the surface " << Marker_Tag << "( " << nElem_Bound_ << " boundary elements )." << endl; + cout << "Splitting the surface " << Marker_Tag << "( " << nElem_Bound_ << " boundary elements )." << endl; /*--- Create a list of edges ---*/ for (unsigned long iElem_Bound = 0; iElem_Bound < nElem_Bound_; iElem_Bound++) { - getline(mesh_file, text_line); unsigned short VTK_Type; istringstream bound_line(text_line); bound_line >> VTK_Type; - switch(VTK_Type) { + switch (VTK_Type) { case LINE: bound_line >> connectivity[0]; bound_line >> connectivity[1]; - EdgeBegin.push_back(connectivity[0]); EdgeEnd.push_back(connectivity[1]); + EdgeBegin.push_back(connectivity[0]); + EdgeEnd.push_back(connectivity[1]); break; case TRIANGLE: bound_line >> connectivity[0]; bound_line >> connectivity[1]; bound_line >> connectivity[2]; - EdgeBegin.push_back(connectivity[0]); EdgeEnd.push_back(connectivity[1]); - EdgeBegin.push_back(connectivity[1]); EdgeEnd.push_back(connectivity[2]); - EdgeBegin.push_back(connectivity[2]); EdgeEnd.push_back(connectivity[0]); + EdgeBegin.push_back(connectivity[0]); + EdgeEnd.push_back(connectivity[1]); + EdgeBegin.push_back(connectivity[1]); + EdgeEnd.push_back(connectivity[2]); + EdgeBegin.push_back(connectivity[2]); + EdgeEnd.push_back(connectivity[0]); break; case QUADRILATERAL: bound_line >> connectivity[0]; bound_line >> connectivity[1]; bound_line >> connectivity[2]; bound_line >> connectivity[3]; - EdgeBegin.push_back(connectivity[0]); EdgeEnd.push_back(connectivity[1]); - EdgeBegin.push_back(connectivity[1]); EdgeEnd.push_back(connectivity[2]); - EdgeBegin.push_back(connectivity[2]); EdgeEnd.push_back(connectivity[3]); - EdgeBegin.push_back(connectivity[3]); EdgeEnd.push_back(connectivity[0]); + EdgeBegin.push_back(connectivity[0]); + EdgeEnd.push_back(connectivity[1]); + EdgeBegin.push_back(connectivity[1]); + EdgeEnd.push_back(connectivity[2]); + EdgeBegin.push_back(connectivity[2]); + EdgeEnd.push_back(connectivity[3]); + EdgeBegin.push_back(connectivity[3]); + EdgeEnd.push_back(connectivity[0]); break; } - } /*--- Set the total number of edges ---*/ @@ -380,17 +382,18 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { /*--- Sort edges based on local point index, first index is always the largest ---*/ - for (iEdge = 0; iEdge < nEdges; iEdge++) { + for (iEdge = 0; iEdge < nEdges; iEdge++) { if (EdgeEnd[iEdge] < EdgeBegin[iEdge]) { - AuxEdge = EdgeEnd[iEdge]; EdgeEnd[iEdge] = EdgeBegin[iEdge]; EdgeBegin[iEdge] = AuxEdge; + AuxEdge = EdgeEnd[iEdge]; + EdgeEnd[iEdge] = EdgeBegin[iEdge]; + EdgeBegin[iEdge] = AuxEdge; } } /*--- Bubble sort of the points based on the first index ---*/ for (iEdge = 0; iEdge < nEdges; iEdge++) { - for (jEdge = iEdge+1; jEdge < nEdges; jEdge++) { - + for (jEdge = iEdge + 1; jEdge < nEdges; jEdge++) { FirstEdgeIndex = EdgeBegin[jEdge] << 31; FirstEdgeIndex += EdgeEnd[jEdge]; @@ -398,24 +401,27 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { SecondEdgeIndex += EdgeEnd[iEdge]; if (FirstEdgeIndex <= SecondEdgeIndex) { - AuxEdge = EdgeBegin[iEdge]; EdgeBegin[iEdge] = EdgeBegin[jEdge]; EdgeBegin[jEdge] = AuxEdge; - AuxEdge = EdgeEnd[iEdge]; EdgeEnd[iEdge] = EdgeEnd[jEdge]; EdgeEnd[jEdge] = AuxEdge; + AuxEdge = EdgeBegin[iEdge]; + EdgeBegin[iEdge] = EdgeBegin[jEdge]; + EdgeBegin[jEdge] = AuxEdge; + AuxEdge = EdgeEnd[iEdge]; + EdgeEnd[iEdge] = EdgeEnd[jEdge]; + EdgeEnd[jEdge] = AuxEdge; } } } if (dimension == 3) { - /*--- Check the begning of the list ---*/ - if (!((EdgeBegin[0] == EdgeBegin[1]) && (EdgeEnd[0] == EdgeEnd[1]))) { + if ((EdgeBegin[0] != EdgeBegin[1]) || (EdgeEnd[0] != EdgeEnd[1])) { PerimeterPoint.push_back(EdgeBegin[0]); PerimeterPoint.push_back(EdgeEnd[0]); } - for (iEdge = 1; iEdge < nEdges-1; iEdge++) { - bool Check_1 = !((EdgeBegin[iEdge] == EdgeBegin[iEdge-1]) && (EdgeEnd[iEdge] == EdgeEnd[iEdge-1])); - bool Check_2 = !((EdgeBegin[iEdge] == EdgeBegin[iEdge+1]) && (EdgeEnd[iEdge] == EdgeEnd[iEdge+1])); + for (iEdge = 1; iEdge < nEdges - 1; iEdge++) { + bool Check_1 = (EdgeBegin[iEdge] != EdgeBegin[iEdge - 1]) || (EdgeEnd[iEdge] != EdgeEnd[iEdge - 1]); + bool Check_2 = (EdgeBegin[iEdge] != EdgeBegin[iEdge + 1]) || (EdgeEnd[iEdge] != EdgeEnd[iEdge + 1]); if ((Check_1 && Check_2)) { PerimeterPoint.push_back(EdgeBegin[iEdge]); PerimeterPoint.push_back(EdgeEnd[iEdge]); @@ -424,14 +430,12 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { /*--- Check the end of the list ---*/ - if (!((EdgeBegin[nEdges-1] == EdgeBegin[nEdges-2]) && (EdgeEnd[nEdges-1] == EdgeEnd[nEdges-2]))) { - PerimeterPoint.push_back(EdgeBegin[nEdges-1]); - PerimeterPoint.push_back(EdgeEnd[nEdges-1]); + if ((EdgeBegin[nEdges - 1] != EdgeBegin[nEdges - 2]) || (EdgeEnd[nEdges - 1] != EdgeEnd[nEdges - 2])) { + PerimeterPoint.push_back(EdgeBegin[nEdges - 1]); + PerimeterPoint.push_back(EdgeEnd[nEdges - 1]); } } else { - - /*--- Create a list with all the points ---*/ for (iEdge = 0; iEdge < nEdges; iEdge++) { @@ -440,27 +444,30 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { } sort(ActDiskPoint_Front.begin(), ActDiskPoint_Front.end()); - vector::iterator it = unique(ActDiskPoint_Front.begin(), ActDiskPoint_Front.end()); + auto it = unique(ActDiskPoint_Front.begin(), ActDiskPoint_Front.end()); ActDiskPoint_Front.resize(it - ActDiskPoint_Front.begin()); /*--- Check the begning of the list ---*/ - if (!(ActDiskPoint_Front[0] == ActDiskPoint_Front[1]) ) { PerimeterPoint.push_back(ActDiskPoint_Front[0]); } + if (!(ActDiskPoint_Front[0] == ActDiskPoint_Front[1])) { + PerimeterPoint.push_back(ActDiskPoint_Front[0]); + } - for (unsigned long iPoint = 1; iPoint < ActDiskPoint_Front.size()-1; iPoint++) { - bool Check_1 = !((ActDiskPoint_Front[iPoint] == ActDiskPoint_Front[iPoint-1]) ); - bool Check_2 = !((ActDiskPoint_Front[iPoint] == ActDiskPoint_Front[iPoint+1]) ); - if ((Check_1 && Check_2)) { PerimeterPoint.push_back(ActDiskPoint_Front[iEdge]); } + for (unsigned long iPoint = 1; iPoint < ActDiskPoint_Front.size() - 1; iPoint++) { + bool Check_1 = !((ActDiskPoint_Front[iPoint] == ActDiskPoint_Front[iPoint - 1])); + bool Check_2 = !((ActDiskPoint_Front[iPoint] == ActDiskPoint_Front[iPoint + 1])); + if ((Check_1 && Check_2)) { + PerimeterPoint.push_back(ActDiskPoint_Front[iEdge]); + } } /*--- Check the end of the list ---*/ - if (!((EdgeBegin[ActDiskPoint_Front.size()-1] == EdgeBegin[ActDiskPoint_Front.size()-2]) )) { - PerimeterPoint.push_back(ActDiskPoint_Front[ActDiskPoint_Front.size()-1]); + if (!((EdgeBegin[ActDiskPoint_Front.size() - 1] == EdgeBegin[ActDiskPoint_Front.size() - 2]))) { + PerimeterPoint.push_back(ActDiskPoint_Front[ActDiskPoint_Front.size() - 1]); } ActDiskPoint_Front.clear(); - } vector::iterator it; @@ -469,11 +476,11 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { PerimeterPoint.resize(it - PerimeterPoint.begin()); for (iEdge = 0; iEdge < nEdges; iEdge++) { - Perimeter = false; for (unsigned long iPoint = 0; iPoint < PerimeterPoint.size(); iPoint++) { if (EdgeBegin[iEdge] == PerimeterPoint[iPoint]) { - Perimeter = true; break; + Perimeter = true; + break; } } @@ -482,12 +489,12 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { Perimeter = false; for (unsigned long iPoint = 0; iPoint < PerimeterPoint.size(); iPoint++) { if (EdgeEnd[iEdge] == PerimeterPoint[iPoint]) { - Perimeter = true; break; + Perimeter = true; + break; } } if (!Perimeter) ActDiskPoint_Front.push_back(EdgeEnd[iEdge]); - } /*--- Sort, and remove repeated points from the disk list of points ---*/ @@ -498,7 +505,8 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { ActDiskNewPoints = ActDiskPoint_Front.size(); if (rank == MASTER_NODE) - cout << "Splitting the surface " << Marker_Tag << "( " << ActDiskPoint_Front.size() << " internal points )." << endl; + cout << "Splitting the surface " << Marker_Tag << "( " << ActDiskPoint_Front.size() << " internal points )." + << endl; /*--- Create a map from original point to the new ones (back plane) ---*/ @@ -517,7 +525,6 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { ActDiskPoint_Back[ActDiskPoint_Front[iPoint]] = kPoint; kPoint++; } - } } break; @@ -537,15 +544,14 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { mesh_file.open(meshFilename); FastForwardToMyZone(); - while (getline (mesh_file, text_line)) { - - position = text_line.find ("NPOIN=",0); + while (getline(mesh_file, text_line)) { + position = text_line.find("NPOIN=", 0); if (position != string::npos) { for (unsigned long iPoint = 0; iPoint < numberOfGlobalPoints; iPoint++) { - getline (mesh_file, text_line); + getline(mesh_file, text_line); istringstream point_line(text_line); - su2double Coords[3] = {0.0,0.0,0.0}; + su2double Coords[3] = {0.0, 0.0, 0.0}; if (dimension == 2) { point_line >> Coords[0]; point_line >> Coords[1]; @@ -560,40 +566,45 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { if (ActDisk_Bool[iPoint]) { CoordXActDisk[ActDiskPoint_Front_Inv[iPoint]] = Coords[0]; CoordYActDisk[ActDiskPoint_Front_Inv[iPoint]] = Coords[1]; - Xloc += Coords[0]; Yloc += Coords[1]; + Xloc += Coords[0]; + Yloc += Coords[1]; if (dimension == 3) { CoordZActDisk[ActDiskPoint_Front_Inv[iPoint]] = Coords[2]; Zloc += Coords[2]; } Counter++; } - } } /*--- Locate and tag points that touch the actuator disk surface. ---*/ - position = text_line.find ("NELEM=",0); + position = text_line.find("NELEM=", 0); if (position != string::npos) { for (unsigned long iElem = 0; iElem < numberOfGlobalElements; iElem++) { - getline(mesh_file, text_line); istringstream elem_line(text_line); unsigned short VTK_Type; elem_line >> VTK_Type; - switch(VTK_Type) { + switch (VTK_Type) { case TRIANGLE: elem_line >> connectivity[0]; elem_line >> connectivity[1]; elem_line >> connectivity[2]; InElem = false; for (unsigned long i = 0; i < (unsigned long)N_POINTS_TRIANGLE; i++) { - if (ActDisk_Bool[connectivity[i]]) { InElem = true; break; } } + if (ActDisk_Bool[connectivity[i]]) { + InElem = true; + break; + } + } if (InElem) { for (unsigned long i = 0; i < (unsigned long)N_POINTS_TRIANGLE; i++) { - VolumePoint.push_back(connectivity[i]); } } + VolumePoint.push_back(connectivity[i]); + } + } break; case QUADRILATERAL: elem_line >> connectivity[0]; @@ -602,10 +613,16 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { elem_line >> connectivity[3]; InElem = false; for (unsigned long i = 0; i < (unsigned long)N_POINTS_QUADRILATERAL; i++) { - if (ActDisk_Bool[connectivity[i]]) { InElem = true; break; } } + if (ActDisk_Bool[connectivity[i]]) { + InElem = true; + break; + } + } if (InElem) { for (unsigned long i = 0; i < (unsigned long)N_POINTS_QUADRILATERAL; i++) { - VolumePoint.push_back(connectivity[i]); } } + VolumePoint.push_back(connectivity[i]); + } + } break; case TETRAHEDRON: elem_line >> connectivity[0]; @@ -614,10 +631,16 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { elem_line >> connectivity[3]; InElem = false; for (unsigned long i = 0; i < (unsigned long)N_POINTS_TETRAHEDRON; i++) { - if (ActDisk_Bool[connectivity[i]]) { InElem = true; break; } } + if (ActDisk_Bool[connectivity[i]]) { + InElem = true; + break; + } + } if (InElem) { for (unsigned long i = 0; i < (unsigned long)N_POINTS_TETRAHEDRON; i++) { - VolumePoint.push_back(connectivity[i]); } } + VolumePoint.push_back(connectivity[i]); + } + } break; case HEXAHEDRON: elem_line >> connectivity[0]; @@ -630,10 +653,16 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { elem_line >> connectivity[7]; InElem = false; for (unsigned long i = 0; i < (unsigned long)N_POINTS_HEXAHEDRON; i++) { - if (ActDisk_Bool[connectivity[i]]) { InElem = true; break; } } + if (ActDisk_Bool[connectivity[i]]) { + InElem = true; + break; + } + } if (InElem) { for (unsigned long i = 0; i < (unsigned long)N_POINTS_HEXAHEDRON; i++) { - VolumePoint.push_back(connectivity[i]); } } + VolumePoint.push_back(connectivity[i]); + } + } break; case PRISM: elem_line >> connectivity[0]; @@ -644,10 +673,16 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { elem_line >> connectivity[5]; InElem = false; for (unsigned long i = 0; i < (unsigned long)N_POINTS_PRISM; i++) { - if (ActDisk_Bool[connectivity[i]]) { InElem = true; break; } } + if (ActDisk_Bool[connectivity[i]]) { + InElem = true; + break; + } + } if (InElem) { for (unsigned long i = 0; i < (unsigned long)N_POINTS_PRISM; i++) { - VolumePoint.push_back(connectivity[i]); } } + VolumePoint.push_back(connectivity[i]); + } + } break; case PYRAMID: elem_line >> connectivity[0]; @@ -657,10 +692,16 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { elem_line >> connectivity[4]; InElem = false; for (unsigned long i = 0; i < (unsigned long)N_POINTS_PYRAMID; i++) { - if (ActDisk_Bool[connectivity[i]]) { InElem = true; break; } } + if (ActDisk_Bool[connectivity[i]]) { + InElem = true; + break; + } + } if (InElem) { for (unsigned long i = 0; i < (unsigned long)N_POINTS_PYRAMID; i++) { - VolumePoint.push_back(connectivity[i]); } } + VolumePoint.push_back(connectivity[i]); + } + } break; } } @@ -697,7 +738,7 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { for (unsigned long iPoint = 0; iPoint < nPointVolume; iPoint++) { MapVolumePointBool[VolumePoint[iPoint]] = true; - VolumePoint_Inv[VolumePoint[iPoint]] = iPoint; + VolumePoint_Inv[VolumePoint[iPoint]] = iPoint; } /*--- Store the coordinates of all the surface and volume @@ -706,13 +747,13 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { mesh_file.open(meshFilename); FastForwardToMyZone(); - while (getline (mesh_file, text_line)) { - position = text_line.find ("NPOIN=",0); + while (getline(mesh_file, text_line)) { + position = text_line.find("NPOIN=", 0); if (position != string::npos) { for (unsigned long iPoint = 0; iPoint < numberOfGlobalPoints; iPoint++) { - getline (mesh_file, text_line); + getline(mesh_file, text_line); istringstream point_line(text_line); - su2double Coords[3] = {0.0,0.0,0.0}; + su2double Coords[3] = {0.0, 0.0, 0.0}; if (dimension == 2) { point_line >> Coords[0]; point_line >> Coords[1]; @@ -741,21 +782,18 @@ void CSU2ASCIIMeshReaderFVM::SplitActuatorDiskSurface() { numberOfMarkers++; mesh_file.close(); - } void CSU2ASCIIMeshReaderFVM::ReadPointCoordinates(const bool single_pass) { - /* Get a partitioner to help with linear partitioning. */ - CLinearPartitioner pointPartitioner(numberOfGlobalPoints,0); + CLinearPartitioner pointPartitioner(numberOfGlobalPoints, 0); /* Determine number of local points */ numberOfLocalPoints = pointPartitioner.GetSizeOnRank(rank); /* Prepare our data structure for the point coordinates. */ localPointCoordinates.resize(dimension); - for (int k = 0; k < dimension; k++) - localPointCoordinates[k].reserve(numberOfLocalPoints); + for (int k = 0; k < dimension; k++) localPointCoordinates[k].reserve(numberOfLocalPoints); /*--- Read the point coordinates into our data structure. ---*/ @@ -763,28 +801,30 @@ void CSU2ASCIIMeshReaderFVM::ReadPointCoordinates(const bool single_pass) { string text_line; if (!single_pass) { getline(mesh_file, text_line); - if (text_line.find("NPOIN=",0) == string::npos) continue; + if (text_line.find("NPOIN=", 0) == string::npos) continue; } for (unsigned long GlobalIndex = 0; GlobalIndex < numberOfGlobalPoints; ++GlobalIndex) { - if (!actuator_disk) { getline(mesh_file, text_line); - } - else { - if (GlobalIndex < numberOfGlobalPoints-ActDiskNewPoints) { + } else { + if (GlobalIndex < numberOfGlobalPoints - ActDiskNewPoints) { getline(mesh_file, text_line); - } - else { + } else { /* This is a new actuator disk point, so we must construct a string with the new point's coordinates. */ ostringstream strsX, strsY, strsZ; unsigned long BackActDisk_Index = GlobalIndex; - unsigned long LocalIndex = BackActDisk_Index - (numberOfGlobalPoints-ActDiskNewPoints); - strsX.precision(20); strsY.precision(20); strsZ.precision(20); - su2double CoordX = CoordXActDisk[LocalIndex]; strsX << scientific << CoordX; - su2double CoordY = CoordYActDisk[LocalIndex]; strsY << scientific << CoordY; - su2double CoordZ = CoordZActDisk[LocalIndex]; strsZ << scientific << CoordZ; + unsigned long LocalIndex = BackActDisk_Index - (numberOfGlobalPoints - ActDiskNewPoints); + strsX.precision(20); + strsY.precision(20); + strsZ.precision(20); + su2double CoordX = CoordXActDisk[LocalIndex]; + strsX << scientific << CoordX; + su2double CoordY = CoordYActDisk[LocalIndex]; + strsY << scientific << CoordY; + su2double CoordZ = CoordZActDisk[LocalIndex]; + strsZ << scientific << CoordZ; text_line = strsX.str() + "\t" + strsY.str() + "\t" + strsZ.str(); } } @@ -792,9 +832,8 @@ void CSU2ASCIIMeshReaderFVM::ReadPointCoordinates(const bool single_pass) { /*--- We only read information for this node if it is owned by this rank based upon our initial linear partitioning. ---*/ - passivedouble Coords[3] = {0.0,0.0,0.0}; + passivedouble Coords[3] = {0.0, 0.0, 0.0}; if (pointPartitioner.IndexBelongsToRank(GlobalIndex, rank)) { - istringstream point_line(text_line); /* Store the coordinates more clearly. */ @@ -815,20 +854,19 @@ void CSU2ASCIIMeshReaderFVM::ReadPointCoordinates(const bool single_pass) { } void CSU2ASCIIMeshReaderFVM::ReadVolumeElementConnectivity(const bool single_pass) { - /* Get a partitioner to help with linear partitioning. */ - CLinearPartitioner pointPartitioner(numberOfGlobalPoints,0); + CLinearPartitioner pointPartitioner(numberOfGlobalPoints, 0); /* Loop over our analytically defined of elements and store only those that contain a node within our linear partition of points. */ - numberOfLocalElements = 0; + numberOfLocalElements = 0; array connectivity{}; while (true) { string text_line; if (!single_pass) { if (!getline(mesh_file, text_line)) break; - if (text_line.find("NELEM=",0) == string::npos) continue; + if (text_line.find("NELEM=", 0) == string::npos) continue; } /*--- Loop over all the volumetric elements and store any element that @@ -849,24 +887,24 @@ void CSU2ASCIIMeshReaderFVM::ReadVolumeElementConnectivity(const bool single_pas const auto nPointsElem = nPointsOfElementType(VTK_Type); - for (unsigned short i = 0; i < nPointsElem; i++) { + for (unsigned short i = 0; i < nPointsElem; i++) { elem_line >> connectivity[i]; } if (actuator_disk) { - for (unsigned short i = 0; i Xloc) { + if (Counter != 0 && Xcg > Xloc) { connectivity[i] = ActDiskPoint_Back[connectivity[i]]; } } @@ -898,7 +936,6 @@ void CSU2ASCIIMeshReaderFVM::ReadVolumeElementConnectivity(const bool single_pas } void CSU2ASCIIMeshReaderFVM::ReadSurfaceElementConnectivity(const bool single_pass) { - /* We already read in the number of markers with the metadata. */ surfaceElementConnectivity.resize(numberOfMarkers); markerNames.resize(numberOfMarkers); @@ -913,29 +950,28 @@ void CSU2ASCIIMeshReaderFVM::ReadSurfaceElementConnectivity(const bool single_pa string text_line; if (!single_pass) { if (!getline(mesh_file, text_line)) break; - if (text_line.find("NMARK=",0) == string::npos) continue; + if (text_line.find("NMARK=", 0) == string::npos) continue; } for (unsigned short iMarker = 0; iMarker < numberOfMarkers; ++iMarker) { - getline (mesh_file, text_line); - text_line.erase (0,11); + getline(mesh_file, text_line); + text_line.erase(0, 11); string::size_type position; for (unsigned short iChar = 0; iChar < 20; iChar++) { - position = text_line.find( " ", 0 ); - if (position != string::npos) text_line.erase (position,1); - position = text_line.find( "\r", 0 ); - if (position != string::npos) text_line.erase (position,1); - position = text_line.find( "\n", 0 ); - if (position != string::npos) text_line.erase (position,1); + position = text_line.find(' ', 0); + if (position != string::npos) text_line.erase(position, 1); + position = text_line.find('\r', 0); + if (position != string::npos) text_line.erase(position, 1); + position = text_line.find('\n', 0); + if (position != string::npos) text_line.erase(position, 1); } markerNames[iMarker] = text_line; bool duplicate = false; - if ((actuator_disk) && - (markerNames[iMarker] == config->GetMarker_ActDiskInlet_TagBound(0))) { + if ((actuator_disk) && (markerNames[iMarker] == config->GetMarker_ActDiskInlet_TagBound(0))) { duplicate = true; - markerNames[iMarker+1] = config->GetMarker_ActDiskOutlet_TagBound(0); + markerNames[iMarker + 1] = config->GetMarker_ActDiskOutlet_TagBound(0); } /*--- Physical boundaries definition ---*/ @@ -943,13 +979,14 @@ void CSU2ASCIIMeshReaderFVM::ReadSurfaceElementConnectivity(const bool single_pa if (markerNames[iMarker] == "SEND_RECEIVE") { /*--- Throw an error if we find deprecated references to SEND_RECEIVE boundaries in the mesh. ---*/ - SU2_MPI::Error("Mesh file contains deprecated SEND_RECEIVE marker!\n" - "Please remove any SEND_RECEIVE markers from the SU2 ASCII mesh.", - CURRENT_FUNCTION); + SU2_MPI::Error( + "Mesh file contains deprecated SEND_RECEIVE marker!\n" + "Please remove any SEND_RECEIVE markers from the SU2 ASCII mesh.", + CURRENT_FUNCTION); } - getline (mesh_file, text_line); - text_line.erase (0,13); + getline(mesh_file, text_line); + text_line.erase(0, 13); unsigned long nElem_Bound = atoi(text_line.c_str()); /*--- Allocate space for elements ---*/ @@ -964,8 +1001,10 @@ void CSU2ASCIIMeshReaderFVM::ReadSurfaceElementConnectivity(const bool single_pa const auto nPointsElem = nPointsOfElementType(VTK_Type); if (dimension == 3 && VTK_Type == LINE) { - SU2_MPI::Error("Line boundary conditions are not possible for 3D calculations.\n" - "Please check the SU2 ASCII mesh file.", CURRENT_FUNCTION); + SU2_MPI::Error( + "Line boundary conditions are not possible for 3D calculations.\n" + "Please check the SU2 ASCII mesh file.", + CURRENT_FUNCTION); } for (unsigned short i = 0; i < nPointsElem; i++) { @@ -1002,42 +1041,39 @@ void CSU2ASCIIMeshReaderFVM::ReadSurfaceElementConnectivity(const bool single_pa /*--- Final error check for deprecated periodic BC format. ---*/ string text_line; - while (getline (mesh_file, text_line)) { - + while (getline(mesh_file, text_line)) { /*--- Find any periodic transformation information. ---*/ - if (text_line.find ("NPERIODIC=",0) != string::npos) { - + if (text_line.find("NPERIODIC=", 0) != string::npos) { /*--- Read and store the number of transformations. ---*/ - text_line.erase(0,10); + text_line.erase(0, 10); unsigned short nPeriodic = atoi(text_line.c_str()); if (nPeriodic - 1 != 0) { - SU2_MPI::Error("Mesh file contains deprecated periodic format!\n\n" - "For SU2 v7.0.0 and later, preprocessing of periodic grids by SU2_MSH\n" - "is no longer necessary. Please use the original mesh file (prior to SU2_MSH)\n" - "with the same MARKER_PERIODIC definition in the configuration file.", CURRENT_FUNCTION); + SU2_MPI::Error( + "Mesh file contains deprecated periodic format!\n\n" + "For SU2 v7.0.0 and later, preprocessing of periodic grids by SU2_MSH\n" + "is no longer necessary. Please use the original mesh file (prior to SU2_MSH)\n" + "with the same MARKER_PERIODIC definition in the configuration file.", + CURRENT_FUNCTION); } } /*--- Stop before we reach the next zone. ---*/ - if (text_line.find ("IZONE=",0) != string::npos) break; + if (text_line.find("IZONE=", 0) != string::npos) break; } - } void CSU2ASCIIMeshReaderFVM::FastForwardToMyZone() { - /*--- If more than one, fast-forward to my zone in the mesh file. ---*/ if (nZones == 1 || !config->GetMultizone_Mesh()) return; string text_line; - while (getline (mesh_file,text_line)) { + while (getline(mesh_file, text_line)) { /*--- Search for the current domain ---*/ - if (text_line.find ("IZONE=",0) == string::npos) continue; - text_line.erase (0,6); + if (text_line.find("IZONE=", 0) == string::npos) continue; + text_line.erase(0, 6); unsigned short jZone = atoi(text_line.c_str()); - if (jZone == myZone+1) break; + if (jZone == myZone + 1) break; } - } diff --git a/Common/src/geometry/meson.build b/Common/src/geometry/meson.build index 0da48dee7b0..b67e2b98658 100644 --- a/Common/src/geometry/meson.build +++ b/Common/src/geometry/meson.build @@ -3,4 +3,3 @@ common_src += files(['CGeometry.cpp', 'CMultiGridGeometry.cpp', 'CDummyGeometry.cpp', 'CMultiGridQueue.cpp']) - diff --git a/Common/src/geometry/primal_grid/CHexahedron.cpp b/Common/src/geometry/primal_grid/CHexahedron.cpp index 1ee5c813f46..ea428ba4e8e 100644 --- a/Common/src/geometry/primal_grid/CHexahedron.cpp +++ b/Common/src/geometry/primal_grid/CHexahedron.cpp @@ -2,7 +2,7 @@ * \file CHexahedron.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -33,17 +33,19 @@ constexpr unsigned short CHexahedronConnectivity::Faces[6][4]; constexpr unsigned short CHexahedronConnectivity::nNeighbor_Nodes[8]; constexpr unsigned short CHexahedronConnectivity::Neighbor_Nodes[8][3]; -CHexahedron::CHexahedron(unsigned long val_point_0, unsigned long val_point_1, - unsigned long val_point_2, unsigned long val_point_3, - unsigned long val_point_4, unsigned long val_point_5, - unsigned long val_point_6, unsigned long val_point_7): - CPrimalGridWithConnectivity(false) -{ +CHexahedron::CHexahedron(unsigned long val_point_0, unsigned long val_point_1, unsigned long val_point_2, + unsigned long val_point_3, unsigned long val_point_4, unsigned long val_point_5, + unsigned long val_point_6, unsigned long val_point_7) + : CPrimalGridWithConnectivity(false) { /*--- Define face structure of the element ---*/ - Nodes[0] = val_point_0; Nodes[1] = val_point_1; - Nodes[2] = val_point_2; Nodes[3] = val_point_3; - Nodes[4] = val_point_4; Nodes[5] = val_point_5; - Nodes[6] = val_point_6; Nodes[7] = val_point_7; + Nodes[0] = val_point_0; + Nodes[1] = val_point_1; + Nodes[2] = val_point_2; + Nodes[3] = val_point_3; + Nodes[4] = val_point_4; + Nodes[5] = val_point_5; + Nodes[6] = val_point_6; + Nodes[7] = val_point_7; } void CHexahedron::Change_Orientation() { diff --git a/Common/src/geometry/primal_grid/CLine.cpp b/Common/src/geometry/primal_grid/CLine.cpp index 66bd2a3cc5c..b12156fdb80 100644 --- a/Common/src/geometry/primal_grid/CLine.cpp +++ b/Common/src/geometry/primal_grid/CLine.cpp @@ -2,7 +2,7 @@ * \file CLine.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -33,10 +33,8 @@ constexpr unsigned short CLineConnectivity::Faces[1][2]; constexpr unsigned short CLineConnectivity::nNeighbor_Nodes[2]; constexpr unsigned short CLineConnectivity::Neighbor_Nodes[2][1]; - -CLine::CLine(unsigned long val_point_0, unsigned long val_point_1): - CPrimalGridWithConnectivity(false) -{ +CLine::CLine(unsigned long val_point_0, unsigned long val_point_1) + : CPrimalGridWithConnectivity(false) { /*--- Define face structure of the element ---*/ Nodes[0] = val_point_0; Nodes[1] = val_point_1; diff --git a/Common/src/geometry/primal_grid/CPrimalGrid.cpp b/Common/src/geometry/primal_grid/CPrimalGrid.cpp index 2ed6d9a550c..0469f88e002 100644 --- a/Common/src/geometry/primal_grid/CPrimalGrid.cpp +++ b/Common/src/geometry/primal_grid/CPrimalGrid.cpp @@ -2,7 +2,7 @@ * \file CPrimalGrid.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,18 +27,13 @@ #include "../../../include/geometry/primal_grid/CPrimalGrid.hpp" -CPrimalGrid::CPrimalGrid(bool FEM, unsigned short nNodes, unsigned short nNeighbor_Elements) : - Nodes(new unsigned long[nNodes]), - Neighbor_Elements(new long[nNeighbor_Elements]), - FEM(FEM) { - +CPrimalGrid::CPrimalGrid(bool FEM, unsigned short nNodes, unsigned short nNeighbor_Elements) + : Nodes(new unsigned long[nNodes]), Neighbor_Elements(new long[nNeighbor_Elements]), FEM(FEM) { GlobalIndex_DomainElement = 0; - for(unsigned short i = 0; i < nNeighbor_Elements; i++) - Neighbor_Elements[i] = -1; + for (unsigned short i = 0; i < nNeighbor_Elements; i++) Neighbor_Elements[i] = -1; } void CPrimalGrid::InitializeNeighbors(unsigned short val_nFaces) { - /*--- Initialize arrays to -1/false to indicate that no neighbor is present and that no periodic transformation is needed to the neighbor. ---*/ for (size_t i = 0; i < val_nFaces; i++) { @@ -46,6 +41,5 @@ void CPrimalGrid::InitializeNeighbors(unsigned short val_nFaces) { PeriodIndexNeighbors[i] = -1; } - for (auto i = 0; i < N_FACES_MAXIMUM; ++i) - ElementOwnsFace[i] = false; + for (auto i = 0; i < N_FACES_MAXIMUM; ++i) ElementOwnsFace[i] = false; } diff --git a/Common/src/geometry/primal_grid/CPrimalGridBoundFEM.cpp b/Common/src/geometry/primal_grid/CPrimalGridBoundFEM.cpp index b8dc1c1191b..7590322ff59 100644 --- a/Common/src/geometry/primal_grid/CPrimalGridBoundFEM.cpp +++ b/Common/src/geometry/primal_grid/CPrimalGridBoundFEM.cpp @@ -2,7 +2,7 @@ * \file CPrimalGridBoundFEM.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,13 +27,10 @@ #include "../../../include/geometry/primal_grid/CPrimalGridBoundFEM.hpp" -CPrimalGridBoundFEM::CPrimalGridBoundFEM(unsigned long val_elemGlobalID, - unsigned long val_domainElementID, - unsigned short val_VTK_Type, - unsigned short val_nPolyGrid, - unsigned short val_nDOFsGrid, - std::vector &val_nodes): CPrimalGrid(true, val_nDOFsGrid, 1) -{ +CPrimalGridBoundFEM::CPrimalGridBoundFEM(unsigned long val_elemGlobalID, unsigned long val_domainElementID, + unsigned short val_VTK_Type, unsigned short val_nPolyGrid, + unsigned short val_nDOFsGrid, std::vector& val_nodes) + : CPrimalGrid(true, val_nDOFsGrid, 1) { /*--- Store the integer data in the member variables of this object. ---*/ VTK_Type = val_VTK_Type; @@ -41,51 +38,51 @@ CPrimalGridBoundFEM::CPrimalGridBoundFEM(unsigned long val_elemGlobalID, nDOFsGrid = val_nDOFsGrid; boundElemIDGlobal = val_elemGlobalID; - GlobalIndex_DomainElement = val_domainElementID; + GlobalIndex_DomainElement = val_domainElementID; /*--- Copy face structure of the element from val_nodes. ---*/ - for(unsigned short i=0; i> Nodes[i]; + for (unsigned short i = 0; i < nDOFsGrid; i++) elem_line >> Nodes[i]; /*--- If a linear element is used, the node numbering for non-simplices must be adapted. The reason is that compatability with the original SU2 format is maintained for linear elements, but for the FEM solver the nodes of the elements are stored row-wise. ---*/ - if(nPolyGrid == 1){ - switch( VTK_Type ) { - + if (nPolyGrid == 1) { + switch (VTK_Type) { case QUADRILATERAL: std::swap(Nodes[2], Nodes[3]); break; @@ -73,110 +69,190 @@ CPrimalGridFEM::CPrimalGridFEM(unsigned long val_elemGlobalID, unsigned short v } } -CPrimalGridFEM::CPrimalGridFEM(unsigned long val_elemGlobalID, unsigned short val_VTK_Type, - unsigned short val_nPolyGrid, unsigned short val_nPolySol, - unsigned short val_nDOFsGrid, unsigned short val_nDOFsSol, - unsigned long val_offDOfsSol, const unsigned long *connGrid) - : CPrimalGrid(true, val_nDOFsGrid, nFacesOfElementType(val_VTK_Type)) -{ +CPrimalGridFEM::CPrimalGridFEM(unsigned long val_elemGlobalID, unsigned short val_VTK_Type, + unsigned short val_nPolyGrid, unsigned short val_nPolySol, unsigned short val_nDOFsGrid, + unsigned short val_nDOFsSol, unsigned long val_offDOfsSol, const unsigned long* connGrid) + : CPrimalGrid(true, val_nDOFsGrid, nFacesOfElementType(val_VTK_Type)) { /*--- Store the integer data in the member variables of this object. ---*/ VTK_Type = val_VTK_Type; nFaces = nFacesOfElementType(VTK_Type); nPolyGrid = val_nPolyGrid; - nPolySol = val_nPolySol; + nPolySol = val_nPolySol; nDOFsGrid = val_nDOFsGrid; - nDOFsSol = val_nDOFsSol; + nDOFsSol = val_nDOFsSol; - elemIDGlobal = val_elemGlobalID; + elemIDGlobal = val_elemGlobalID; offsetDOFsSolGlobal = val_offDOfsSol; /*--- Copy face structure of the element from connGrid. ---*/ - for(unsigned short i=0; i(false) -{ +CPrism::CPrism(unsigned long val_point_0, unsigned long val_point_1, unsigned long val_point_2, + unsigned long val_point_3, unsigned long val_point_4, unsigned long val_point_5) + : CPrimalGridWithConnectivity(false) { /*--- Define face structure of the element ---*/ Nodes[0] = val_point_0; Nodes[1] = val_point_1; @@ -47,7 +45,7 @@ CPrism::CPrism(unsigned long val_point_0, unsigned long val_point_1, Nodes[5] = val_point_5; } -void CPrism::Change_Orientation(void) { +void CPrism::Change_Orientation() { std::swap(Nodes[0], Nodes[1]); std::swap(Nodes[3], Nodes[4]); } diff --git a/Common/src/geometry/primal_grid/CPyramid.cpp b/Common/src/geometry/primal_grid/CPyramid.cpp index f75aac437f0..76c4b28d77f 100644 --- a/Common/src/geometry/primal_grid/CPyramid.cpp +++ b/Common/src/geometry/primal_grid/CPyramid.cpp @@ -2,7 +2,7 @@ * \file CPyramid.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -33,11 +33,9 @@ constexpr unsigned short CPyramidConnectivity::Faces[5][4]; constexpr unsigned short CPyramidConnectivity::nNeighbor_Nodes[5]; constexpr unsigned short CPyramidConnectivity::Neighbor_Nodes[5][4]; -CPyramid::CPyramid(unsigned long val_point_0, unsigned long val_point_1, - unsigned long val_point_2, unsigned long val_point_3, - unsigned long val_point_4): - CPrimalGridWithConnectivity(false) -{ +CPyramid::CPyramid(unsigned long val_point_0, unsigned long val_point_1, unsigned long val_point_2, + unsigned long val_point_3, unsigned long val_point_4) + : CPrimalGridWithConnectivity(false) { /*--- Define face structure of the element ---*/ Nodes[0] = val_point_0; Nodes[1] = val_point_1; @@ -46,6 +44,4 @@ CPyramid::CPyramid(unsigned long val_point_0, unsigned long val_point_1, Nodes[4] = val_point_4; } -void CPyramid::Change_Orientation() { - std::swap(Nodes[1],Nodes[3]); -} +void CPyramid::Change_Orientation() { std::swap(Nodes[1], Nodes[3]); } diff --git a/Common/src/geometry/primal_grid/CQuadrilateral.cpp b/Common/src/geometry/primal_grid/CQuadrilateral.cpp index 643e10209b8..7e3372524fd 100644 --- a/Common/src/geometry/primal_grid/CQuadrilateral.cpp +++ b/Common/src/geometry/primal_grid/CQuadrilateral.cpp @@ -2,7 +2,7 @@ * \file CQuadrilateral.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -33,10 +33,9 @@ constexpr unsigned short CQuadrilateralConnectivity::Faces[4][2]; constexpr unsigned short CQuadrilateralConnectivity::nNeighbor_Nodes[4]; constexpr unsigned short CQuadrilateralConnectivity::Neighbor_Nodes[4][2]; -CQuadrilateral::CQuadrilateral(unsigned long val_point_0, unsigned long val_point_1, - unsigned long val_point_2, unsigned long val_point_3): - CPrimalGridWithConnectivity(false) -{ +CQuadrilateral::CQuadrilateral(unsigned long val_point_0, unsigned long val_point_1, unsigned long val_point_2, + unsigned long val_point_3) + : CPrimalGridWithConnectivity(false) { /*--- Define face structure of the element ---*/ Nodes[0] = val_point_0; Nodes[1] = val_point_1; @@ -44,6 +43,4 @@ CQuadrilateral::CQuadrilateral(unsigned long val_point_0, unsigned long val_poin Nodes[3] = val_point_3; } -void CQuadrilateral::Change_Orientation() { - std::swap(Nodes[1], Nodes[3]); -} +void CQuadrilateral::Change_Orientation() { std::swap(Nodes[1], Nodes[3]); } diff --git a/Common/src/geometry/primal_grid/CTetrahedron.cpp b/Common/src/geometry/primal_grid/CTetrahedron.cpp index 0c82ac1ef45..83a8c849b11 100644 --- a/Common/src/geometry/primal_grid/CTetrahedron.cpp +++ b/Common/src/geometry/primal_grid/CTetrahedron.cpp @@ -2,7 +2,7 @@ * \file CTetrahedron.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -33,10 +33,9 @@ constexpr unsigned short CTetrahedronConnectivity::Faces[4][3]; constexpr unsigned short CTetrahedronConnectivity::nNeighbor_Nodes[4]; constexpr unsigned short CTetrahedronConnectivity::Neighbor_Nodes[4][3]; -CTetrahedron::CTetrahedron(unsigned long val_point_0, unsigned long val_point_1, - unsigned long val_point_2, unsigned long val_point_3): - CPrimalGridWithConnectivity(false) -{ +CTetrahedron::CTetrahedron(unsigned long val_point_0, unsigned long val_point_1, unsigned long val_point_2, + unsigned long val_point_3) + : CPrimalGridWithConnectivity(false) { /*--- Define face structure of the element ---*/ Nodes[0] = val_point_0; Nodes[1] = val_point_1; @@ -44,6 +43,4 @@ CTetrahedron::CTetrahedron(unsigned long val_point_0, unsigned long val_point_1, Nodes[3] = val_point_3; } -void CTetrahedron::Change_Orientation() { - std::swap(Nodes[0],Nodes[1]); -} +void CTetrahedron::Change_Orientation() { std::swap(Nodes[0], Nodes[1]); } diff --git a/Common/src/geometry/primal_grid/CTriangle.cpp b/Common/src/geometry/primal_grid/CTriangle.cpp index 8f5dbdfa1c8..2228cfc301f 100644 --- a/Common/src/geometry/primal_grid/CTriangle.cpp +++ b/Common/src/geometry/primal_grid/CTriangle.cpp @@ -2,7 +2,7 @@ * \file CTriangle.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -33,10 +33,8 @@ constexpr unsigned short CTriangleConnectivity::Faces[3][2]; constexpr unsigned short CTriangleConnectivity::nNeighbor_Nodes[3]; constexpr unsigned short CTriangleConnectivity::Neighbor_Nodes[3][2]; -CTriangle::CTriangle(unsigned long val_point_0, unsigned long val_point_1, - unsigned long val_point_2): - CPrimalGridWithConnectivity(false) -{ +CTriangle::CTriangle(unsigned long val_point_0, unsigned long val_point_1, unsigned long val_point_2) + : CPrimalGridWithConnectivity(false) { /*--- Define face structure of the element ---*/ Nodes[0] = val_point_0; Nodes[1] = val_point_1; diff --git a/Common/src/geometry/primal_grid/CVertexMPI.cpp b/Common/src/geometry/primal_grid/CVertexMPI.cpp index 7fe7451cce5..04baff89669 100644 --- a/Common/src/geometry/primal_grid/CVertexMPI.cpp +++ b/Common/src/geometry/primal_grid/CVertexMPI.cpp @@ -2,7 +2,7 @@ * \file CVertexMPI.cpp * \brief Main classes for defining the primal grid elements * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -32,9 +32,7 @@ constexpr unsigned short CVertexMPIConnectivity::Faces[1][1]; constexpr unsigned short CVertexMPIConnectivity::nNeighbor_Nodes[1]; constexpr unsigned short CVertexMPIConnectivity::Neighbor_Nodes[1][1]; -CVertexMPI::CVertexMPI(unsigned long val_point): - CPrimalGridWithConnectivity(false) -{ +CVertexMPI::CVertexMPI(unsigned long val_point) : CPrimalGridWithConnectivity(false) { /*--- Define face structure of the element ---*/ Nodes[0] = val_point; diff --git a/Common/src/graph_coloring_structure.cpp b/Common/src/graph_coloring_structure.cpp index 1b661765d9b..bdace7733b4 100644 --- a/Common/src/graph_coloring_structure.cpp +++ b/Common/src/graph_coloring_structure.cpp @@ -2,7 +2,7 @@ * \file graph_coloring_structure.cpp * \brief Functions used to carry out the coloring of a given graph. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -28,15 +28,11 @@ #include "../include/graph_coloring_structure.hpp" /* Function, which determines the colors for the vertices of the given graph. */ -void CGraphColoringStructure::GraphVertexColoring( - CConfig *config, - const vector &nVerticesPerRank, - const vector > &entriesVertices, - int &nGlobalColors, - vector &colorLocalVertices) { - +void CGraphColoringStructure::GraphVertexColoring(CConfig* config, const vector& nVerticesPerRank, + const vector >& entriesVertices, + int& nGlobalColors, vector& colorLocalVertices) { /* Determine the number of ranks and the current rank. */ - int nRank = 1; + int nRank = 1; int myRank = 0; #ifdef HAVE_MPI @@ -45,14 +41,11 @@ void CGraphColoringStructure::GraphVertexColoring( #endif /*--- Determine the algorithm to use for the graph coloring. ---*/ - switch( config->GetKind_Matrix_Coloring() ) { - + switch (config->GetKind_Matrix_Coloring()) { case GREEDY_COLORING: { - /* Greedy algorithm, which is implemented sequentially. Make a distinction between the master rank and the other ranks. */ - if(myRank == 0) { - + if (myRank == 0) { /*--------------------------------------------------------------------*/ /* Master node, which does all the work. */ /* Step 1: Create the global vector for the graph by gathering all the*/ @@ -63,16 +56,13 @@ void CGraphColoringStructure::GraphVertexColoring( /**************************************************************************/ /* Define the global vector and copy my data in it. */ - vector > entriesVert(nVerticesPerRank[nRank], - vector(0)); + vector > entriesVert(nVerticesPerRank[nRank], vector(0)); - for(unsigned long i=nVerticesPerRank[0]; i recvBuf(sizeMess); - SU2_MPI::Recv(recvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, rank, rank, - SU2_MPI::GetComm(), &status); + SU2_MPI::Recv(recvBuf.data(), sizeMess, MPI_UNSIGNED_LONG, rank, rank, SU2_MPI::GetComm(), &status); /* Store the data just received in the global vector for the graph. */ unsigned long ii = 0; - for(unsigned long i=nVerticesPerRank[rank]; i flagColorStored(nVerticesPerRank[nRank], - nVerticesPerRank[nRank]); + vector flagColorStored(nVerticesPerRank[nRank], nVerticesPerRank[nRank]); vector colorNeighbors; colorNeighbors.reserve(1000); /* Loop over the vertices of the graph. */ - for(unsigned long i=0; i sendBuf; - for(unsigned long i=0; i(Order, 0.0)); } -su2double CBSplineBlending::GetBasis(short val_i, su2double val_t){ - +su2double CBSplineBlending::GetBasis(short val_i, su2double val_t) { /*--- Evaluation is based on the algorithm from "The NURBS Book (Les Piegl and Wayne Tiller)" ---*/ /*--- Special cases ---*/ - if ((val_i == 0 && val_t == U[0]) || (val_i == (short)U.size()-1 && val_t == U.back())) {return 1.0;} + if ((val_i == 0 && val_t == U[0]) || (val_i == (short)U.size() - 1 && val_t == U.back())) { + return 1.0; + } /*--- Local property of BSplines ---*/ - if ((val_t < U[val_i]) || (val_t >= U[val_i+Order])){ return 0.0;} + if ((val_t < U[val_i]) || (val_t >= U[val_i + Order])) { + return 0.0; + } - unsigned short j,k; + unsigned short j, k; su2double saved, temp; - for (j = 0; j < Order; j++){ - if ((val_t >= U[val_i+j]) && (val_t < U[val_i+j+1])) N[j][0] = 1.0; - else N[j][0] = 0; + for (j = 0; j < Order; j++) { + if ((val_t >= U[val_i + j]) && (val_t < U[val_i + j + 1])) + N[j][0] = 1.0; + else + N[j][0] = 0; } - for (k = 1; k < Order; k++){ - if (N[0][k-1] == 0.0) saved = 0.0; - else saved = ((val_t - U[val_i])*N[0][k-1])/(U[val_i+k] - U[val_i]); - for (j = 0; j < Order-k; j++){ - if (N[j+1][k-1] == 0.0){ - N[j][k] = saved; saved = 0.0; + for (k = 1; k < Order; k++) { + if (N[0][k - 1] == 0.0) + saved = 0.0; + else + saved = ((val_t - U[val_i]) * N[0][k - 1]) / (U[val_i + k] - U[val_i]); + for (j = 0; j < Order - k; j++) { + if (N[j + 1][k - 1] == 0.0) { + N[j][k] = saved; + saved = 0.0; } else { - temp = N[j+1][k-1]/(U[val_i+j+k+1] - U[val_i+j+1]); - N[j][k] = saved+(U[val_i+j+k+1] - val_t)*temp; - saved = (val_t - U[val_i+j+1])*temp; + temp = N[j + 1][k - 1] / (U[val_i + j + k + 1] - U[val_i + j + 1]); + N[j][k] = saved + (U[val_i + j + k + 1] - val_t) * temp; + saved = (val_t - U[val_i + j + 1]) * temp; } } } - return N[0][Order-1]; + return N[0][Order - 1]; } -su2double CBSplineBlending::GetDerivative(short val_i, su2double val_t, short val_order_der){ - - if ((val_t < U[val_i]) || (val_t >= U[val_i+Order])){ return 0.0;} +su2double CBSplineBlending::GetDerivative(short val_i, su2double val_t, short val_order_der) { + if ((val_t < U[val_i]) || (val_t >= U[val_i + Order])) { + return 0.0; + } /*--- Evaluate the i+p basis functions up to the order p (stored in the matrix N). ---*/ @@ -110,27 +118,29 @@ su2double CBSplineBlending::GetDerivative(short val_i, su2double val_t, short va /*--- Use the recursive definition for the derivative (hardcoded for 1st and 2nd derivative). ---*/ - if (val_order_der == 0){ return N[0][Order-1];} + if (val_order_der == 0) { + return N[0][Order - 1]; + } - if (val_order_der == 1){ - return (Order-1.0)/(1e-10 + U[val_i+Order-1] - U[val_i] )*N[0][Order-2] - - (Order-1.0)/(1e-10 + U[val_i+Order] - U[val_i+1])*N[1][Order-2]; + if (val_order_der == 1) { + return (Order - 1.0) / (1e-10 + U[val_i + Order - 1] - U[val_i]) * N[0][Order - 2] - + (Order - 1.0) / (1e-10 + U[val_i + Order] - U[val_i + 1]) * N[1][Order - 2]; } - if (val_order_der == 2 && Order > 2){ - const su2double left = (Order-2.0)/(1e-10 + U[val_i+Order-2] - U[val_i]) *N[0][Order-3] - - (Order-2.0)/(1e-10 + U[val_i+Order-1] - U[val_i+1])*N[1][Order-3]; + if (val_order_der == 2 && Order > 2) { + const su2double left = (Order - 2.0) / (1e-10 + U[val_i + Order - 2] - U[val_i]) * N[0][Order - 3] - + (Order - 2.0) / (1e-10 + U[val_i + Order - 1] - U[val_i + 1]) * N[1][Order - 3]; - const su2double right = (Order-2.0)/(1e-10 + U[val_i+Order-1] - U[val_i+1])*N[1][Order-3] - - (Order-2.0)/(1e-10 + U[val_i+Order] - U[val_i+2])*N[2][Order-3]; + const su2double right = (Order - 2.0) / (1e-10 + U[val_i + Order - 1] - U[val_i + 1]) * N[1][Order - 3] - + (Order - 2.0) / (1e-10 + U[val_i + Order] - U[val_i + 2]) * N[2][Order - 3]; - return (Order-1.0)/(1e-10 + U[val_i+Order-1] - U[val_i] )*left - - (Order-1.0)/(1e-10 + U[val_i+Order] - U[val_i+1])*right; + return (Order - 1.0) / (1e-10 + U[val_i + Order - 1] - U[val_i]) * left - + (Order - 1.0) / (1e-10 + U[val_i + Order] - U[val_i + 1]) * right; } /*--- Higher order derivatives are not implemented, so we exit if they are requested. ---*/ - if (val_order_der > 2){ + if (val_order_der > 2) { SU2_MPI::Error("Higher order derivatives for BSplines are not implemented.", CURRENT_FUNCTION); } return 0.0; diff --git a/Common/src/grid_movement/CBezierBlending.cpp b/Common/src/grid_movement/CBezierBlending.cpp index 03c41efd037..ceabd8eb51f 100644 --- a/Common/src/grid_movement/CBezierBlending.cpp +++ b/Common/src/grid_movement/CBezierBlending.cpp @@ -2,7 +2,7 @@ * \file CBezierBlending.cpp * \brief Subroutines for Bezier blending for FFDs * \author F. Palacios, T. Economon, S. Padron - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -28,94 +28,95 @@ #include "../../include/grid_movement/CBezierBlending.hpp" #include "../../include/option_structure.hpp" +CBezierBlending::CBezierBlending(short val_order, short n_controlpoints) { SetOrder(val_order, n_controlpoints); } -CBezierBlending::CBezierBlending(short val_order, short n_controlpoints){ - SetOrder(val_order, n_controlpoints); -} - -CBezierBlending::~CBezierBlending(){} +CBezierBlending::~CBezierBlending() = default; -void CBezierBlending::SetOrder(short val_order, short n_controlpoints){ - Order = val_order; +void CBezierBlending::SetOrder(short val_order, short n_controlpoints) { + Order = val_order; Degree = Order - 1; - binomial.resize(Order+1, 0.0); -} - -su2double CBezierBlending::GetBasis(short val_i, su2double val_t){ - return GetBernstein(Degree, val_i, val_t); + binomial.resize(Order + 1, 0.0); } -su2double CBezierBlending::GetBernstein(short val_n, short val_i, su2double val_t){ +su2double CBezierBlending::GetBasis(short val_i, su2double val_t) { return GetBernstein(Degree, val_i, val_t); } +su2double CBezierBlending::GetBernstein(short val_n, short val_i, su2double val_t) { su2double value = 0.0; - if (val_i > val_n) { value = 0.0; return value; } + if (val_i > val_n) { + value = 0.0; + return value; + } if (val_i == 0) { - if (val_t == 0) value = 1.0; - else if (val_t == 1) value = 0.0; - else value = Binomial(val_n, val_i) * pow(val_t, val_i) * pow(1.0 - val_t, val_n - val_i); - } - else if (val_i == val_n) { - if (val_t == 0) value = 0.0; - else if (val_t == 1) value = 1.0; - else value = pow(val_t, val_n); - } - else { + if (val_t == 0) + value = 1.0; + else if (val_t == 1) + value = 0.0; + else + value = Binomial(val_n, val_i) * pow(val_t, val_i) * pow(1.0 - val_t, val_n - val_i); + } else if (val_i == val_n) { + if (val_t == 0) + value = 0.0; + else if (val_t == 1) + value = 1.0; + else + value = pow(val_t, val_n); + } else { if ((val_t == 0) || (val_t == 1)) value = 0.0; - value = Binomial(val_n, val_i) * pow(val_t, val_i) * pow(1.0-val_t, val_n - val_i); + value = Binomial(val_n, val_i) * pow(val_t, val_i) * pow(1.0 - val_t, val_n - val_i); } return value; } -su2double CBezierBlending::GetDerivative(short val_i, su2double val_t, short val_order_der){ +su2double CBezierBlending::GetDerivative(short val_i, su2double val_t, short val_order_der) { return GetBernsteinDerivative(Degree, val_i, val_t, val_order_der); } -su2double CBezierBlending::GetBernsteinDerivative(short val_n, short val_i, su2double val_t, short val_order_der){ - +su2double CBezierBlending::GetBernsteinDerivative(short val_n, short val_i, su2double val_t, short val_order_der) { su2double value = 0.0; /*--- Verify this subroutine, it provides negative val_n, which is a wrong value for GetBernstein ---*/ if (val_order_der == 0) { - value = GetBernstein(val_n, val_i, val_t); return value; + value = GetBernstein(val_n, val_i, val_t); + return value; } if (val_i == 0) { - value = val_n*(-GetBernsteinDerivative(val_n-1, val_i, val_t, val_order_der-1)); return value; + value = val_n * (-GetBernsteinDerivative(val_n - 1, val_i, val_t, val_order_der - 1)); + return value; } - else { - if (val_n == 0) { - value = val_t; return value; - } - else { - value = val_n*(GetBernsteinDerivative(val_n-1, val_i-1, val_t, val_order_der-1) - GetBernsteinDerivative(val_n-1, val_i, val_t, val_order_der-1)); - return value; - } + if (val_n == 0) { + value = val_t; + return value; + } else { + value = val_n * (GetBernsteinDerivative(val_n - 1, val_i - 1, val_t, val_order_der - 1) - + GetBernsteinDerivative(val_n - 1, val_i, val_t, val_order_der - 1)); + return value; } return value; } -su2double CBezierBlending::Binomial(unsigned short n, unsigned short m){ - +su2double CBezierBlending::Binomial(unsigned short n, unsigned short m) { unsigned short i, j; su2double result; binomial[0] = 1.0; for (i = 1; i <= n; ++i) { binomial[i] = 1.0; - for (j = i-1U; j > 0; --j) { - binomial[j] += binomial[j-1U]; + for (j = i - 1U; j > 0; --j) { + binomial[j] += binomial[j - 1U]; } } result = binomial[m]; - if (fabs(result) < EPS*EPS) { result = 0.0; } + if (fabs(result) < EPS * EPS) { + result = 0.0; + } return result; - } diff --git a/Common/src/grid_movement/CFreeFormBlending.cpp b/Common/src/grid_movement/CFreeFormBlending.cpp index 9a1871c2f31..c71ef32d259 100644 --- a/Common/src/grid_movement/CFreeFormBlending.cpp +++ b/Common/src/grid_movement/CFreeFormBlending.cpp @@ -2,7 +2,7 @@ * \file CFreeFormBlending.cpp * \brief Parent class for FFD Blending functions * \author F. Palacios, T. Economon, S. Padron - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,6 +27,6 @@ #include "../../include/grid_movement/CFreeFormBlending.hpp" -CFreeFormBlending::CFreeFormBlending(){} +CFreeFormBlending::CFreeFormBlending() = default; -CFreeFormBlending::~CFreeFormBlending(){} +CFreeFormBlending::~CFreeFormBlending() = default; diff --git a/Common/src/grid_movement/CFreeFormDefBox.cpp b/Common/src/grid_movement/CFreeFormDefBox.cpp index c16ef15b716..34c97605797 100644 --- a/Common/src/grid_movement/CFreeFormDefBox.cpp +++ b/Common/src/grid_movement/CFreeFormDefBox.cpp @@ -2,7 +2,7 @@ * \file CFreeFormDefBox.cpp * \brief Subroutines for handling Free-Form Deformation Boxes * \author F. Palacios, T. Economon, S. Padron - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -28,11 +28,13 @@ #include "../../include/grid_movement/CFreeFormDefBox.hpp" #include "../../include/grid_movement/CBezierBlending.hpp" #include "../../include/grid_movement/CBSplineBlending.hpp" +#include "../../include/toolboxes/geometry_toolbox.hpp" -CFreeFormDefBox::CFreeFormDefBox(void) : CGridMovement() { } - -CFreeFormDefBox::CFreeFormDefBox(const unsigned short Degree[], unsigned short BSplineOrder[], unsigned short kind_blending) : CGridMovement() { +CFreeFormDefBox::CFreeFormDefBox() : CGridMovement() {} +CFreeFormDefBox::CFreeFormDefBox(const unsigned short Degree[], unsigned short BSplineOrder[], + unsigned short kind_blending) + : CGridMovement() { unsigned short iCornerPoints, iOrder, jOrder, kOrder, iDim; /*--- FFD is always 3D (even in 2D problems) ---*/ @@ -42,39 +44,47 @@ CFreeFormDefBox::CFreeFormDefBox(const unsigned short Degree[], unsigned short B /*--- Allocate Corners points ---*/ - Coord_Corner_Points = new su2double* [nCornerPoints]; + Coord_Corner_Points = new su2double*[nCornerPoints]; for (iCornerPoints = 0; iCornerPoints < nCornerPoints; iCornerPoints++) - Coord_Corner_Points[iCornerPoints] = new su2double [nDim]; + Coord_Corner_Points[iCornerPoints] = new su2double[nDim]; - ParamCoord = new su2double[nDim]; ParamCoord_ = new su2double[nDim]; - cart_coord = new su2double[nDim]; cart_coord_ = new su2double[nDim]; + ParamCoord = new su2double[nDim]; + ParamCoord_ = new su2double[nDim]; + cart_coord = new su2double[nDim]; + cart_coord_ = new su2double[nDim]; Gradient = new su2double[nDim]; - lDegree = Degree[0]; lOrder = lDegree+1; - mDegree = Degree[1]; mOrder = mDegree+1; - nDegree = Degree[2]; nOrder = nDegree+1; - nControlPoints = lOrder*mOrder*nOrder; - - lDegree_Copy = Degree[0]; lOrder_Copy = lDegree+1; - mDegree_Copy = Degree[1]; mOrder_Copy = mDegree+1; - nDegree_Copy = Degree[2]; nOrder_Copy = nDegree+1; - nControlPoints_Copy = lOrder_Copy*mOrder_Copy*nOrder_Copy; - - Coord_Control_Points = new su2double*** [lOrder]; - ParCoord_Control_Points = new su2double*** [lOrder]; - Coord_Control_Points_Copy = new su2double*** [lOrder]; + lDegree = Degree[0]; + lOrder = lDegree + 1; + mDegree = Degree[1]; + mOrder = mDegree + 1; + nDegree = Degree[2]; + nOrder = nDegree + 1; + nControlPoints = lOrder * mOrder * nOrder; + + lDegree_Copy = Degree[0]; + lOrder_Copy = lDegree + 1; + mDegree_Copy = Degree[1]; + mOrder_Copy = mDegree + 1; + nDegree_Copy = Degree[2]; + nOrder_Copy = nDegree + 1; + nControlPoints_Copy = lOrder_Copy * mOrder_Copy * nOrder_Copy; + + Coord_Control_Points = new su2double***[lOrder]; + ParCoord_Control_Points = new su2double***[lOrder]; + Coord_Control_Points_Copy = new su2double***[lOrder]; for (iOrder = 0; iOrder < lOrder; iOrder++) { - Coord_Control_Points[iOrder] = new su2double** [mOrder]; - ParCoord_Control_Points[iOrder] = new su2double** [mOrder]; - Coord_Control_Points_Copy[iOrder] = new su2double** [mOrder]; + Coord_Control_Points[iOrder] = new su2double**[mOrder]; + ParCoord_Control_Points[iOrder] = new su2double**[mOrder]; + Coord_Control_Points_Copy[iOrder] = new su2double**[mOrder]; for (jOrder = 0; jOrder < mOrder; jOrder++) { - Coord_Control_Points[iOrder][jOrder] = new su2double* [nOrder]; - ParCoord_Control_Points[iOrder][jOrder] = new su2double* [nOrder]; - Coord_Control_Points_Copy[iOrder][jOrder] = new su2double* [nOrder]; + Coord_Control_Points[iOrder][jOrder] = new su2double*[nOrder]; + ParCoord_Control_Points[iOrder][jOrder] = new su2double*[nOrder]; + Coord_Control_Points_Copy[iOrder][jOrder] = new su2double*[nOrder]; for (kOrder = 0; kOrder < nOrder; kOrder++) { - Coord_Control_Points[iOrder][jOrder][kOrder] = new su2double [nDim]; - ParCoord_Control_Points[iOrder][jOrder][kOrder] = new su2double [nDim]; - Coord_Control_Points_Copy[iOrder][jOrder][kOrder] = new su2double [nDim]; + Coord_Control_Points[iOrder][jOrder][kOrder] = new su2double[nDim]; + ParCoord_Control_Points[iOrder][jOrder][kOrder] = new su2double[nDim]; + Coord_Control_Points_Copy[iOrder][jOrder][kOrder] = new su2double[nDim]; for (iDim = 0; iDim < nDim; iDim++) { Coord_Control_Points[iOrder][jOrder][kOrder][iDim] = 0.0; ParCoord_Control_Points[iOrder][jOrder][kOrder][iDim] = 0.0; @@ -86,165 +96,189 @@ CFreeFormDefBox::CFreeFormDefBox(const unsigned short Degree[], unsigned short B BlendingFunction = new CFreeFormBlending*[nDim]; - if (kind_blending == BEZIER){ + if (kind_blending == BEZIER) { BlendingFunction[0] = new CBezierBlending(lOrder, lOrder); BlendingFunction[1] = new CBezierBlending(mOrder, mOrder); BlendingFunction[2] = new CBezierBlending(nOrder, nOrder); } - if (kind_blending == BSPLINE_UNIFORM){ + if (kind_blending == BSPLINE_UNIFORM) { BlendingFunction[0] = new CBSplineBlending(BSplineOrder[0], lOrder); BlendingFunction[1] = new CBSplineBlending(BSplineOrder[1], mOrder); BlendingFunction[2] = new CBSplineBlending(BSplineOrder[2], nOrder); } - } -CFreeFormDefBox::~CFreeFormDefBox(void) { +CFreeFormDefBox::~CFreeFormDefBox() { unsigned short iOrder, jOrder, kOrder, iCornerPoints, iDim; for (iOrder = 0; iOrder < lOrder; iOrder++) { for (jOrder = 0; jOrder < mOrder; jOrder++) { for (kOrder = 0; kOrder < nOrder; kOrder++) { - delete [] Coord_Control_Points[iOrder][jOrder][kOrder]; - delete [] ParCoord_Control_Points[iOrder][jOrder][kOrder]; - delete [] Coord_Control_Points_Copy[iOrder][jOrder][kOrder]; - if (Coord_SupportCP != nullptr) delete [] Coord_SupportCP[iOrder][jOrder][kOrder]; + delete[] Coord_Control_Points[iOrder][jOrder][kOrder]; + delete[] ParCoord_Control_Points[iOrder][jOrder][kOrder]; + delete[] Coord_Control_Points_Copy[iOrder][jOrder][kOrder]; + if (Coord_SupportCP != nullptr) delete[] Coord_SupportCP[iOrder][jOrder][kOrder]; } - delete [] Coord_Control_Points[iOrder][jOrder]; - delete [] ParCoord_Control_Points[iOrder][jOrder]; - delete [] Coord_Control_Points_Copy[iOrder][jOrder]; - if (Coord_SupportCP != nullptr) delete [] Coord_SupportCP[iOrder][jOrder]; - } - delete [] Coord_Control_Points[iOrder]; - delete [] ParCoord_Control_Points[iOrder]; - delete [] Coord_Control_Points_Copy[iOrder]; - if (Coord_SupportCP != nullptr) delete [] Coord_SupportCP[iOrder]; + delete[] Coord_Control_Points[iOrder][jOrder]; + delete[] ParCoord_Control_Points[iOrder][jOrder]; + delete[] Coord_Control_Points_Copy[iOrder][jOrder]; + if (Coord_SupportCP != nullptr) delete[] Coord_SupportCP[iOrder][jOrder]; } + delete[] Coord_Control_Points[iOrder]; + delete[] ParCoord_Control_Points[iOrder]; + delete[] Coord_Control_Points_Copy[iOrder]; + if (Coord_SupportCP != nullptr) delete[] Coord_SupportCP[iOrder]; + } - delete [] Coord_Control_Points; - delete [] ParCoord_Control_Points; - delete [] Coord_Control_Points_Copy; - delete [] Coord_SupportCP; + delete[] Coord_Control_Points; + delete[] ParCoord_Control_Points; + delete[] Coord_Control_Points_Copy; + delete[] Coord_SupportCP; - delete [] ParamCoord; - delete [] ParamCoord_; - delete [] cart_coord; - delete [] cart_coord_; - delete [] Gradient; + delete[] ParamCoord; + delete[] ParamCoord_; + delete[] cart_coord; + delete[] cart_coord_; + delete[] Gradient; - for (iCornerPoints = 0; iCornerPoints < nCornerPoints; iCornerPoints++) - delete [] Coord_Corner_Points[iCornerPoints]; - delete [] Coord_Corner_Points; + for (iCornerPoints = 0; iCornerPoints < nCornerPoints; iCornerPoints++) delete[] Coord_Corner_Points[iCornerPoints]; + delete[] Coord_Corner_Points; - for (iDim = 0; iDim < nDim; iDim++){ + for (iDim = 0; iDim < nDim; iDim++) { delete BlendingFunction[iDim]; } - delete [] BlendingFunction; + delete[] BlendingFunction; } -void CFreeFormDefBox::SetUnitCornerPoints(void) { - +void CFreeFormDefBox::SetUnitCornerPoints() { unsigned short iDim; - su2double *coord = new su2double [nDim]; + auto* coord = new su2double[nDim]; for (iDim = 0; iDim < nDim; iDim++) coord[iDim] = 0.0; - coord [0] = 0.0; coord [1] = 0.0; coord [2] = 0.0; this->SetCoordCornerPoints(coord, 0); - coord [0] = 1.0; coord [1] = 0.0; coord [2] = 0.0; this->SetCoordCornerPoints(coord, 1); - coord [0] = 1.0; coord [1] = 1.0; coord [2] = 0.0; this->SetCoordCornerPoints(coord, 2); - coord [0] = 0.0; coord [1] = 1.0; coord [2] = 0.0; this->SetCoordCornerPoints(coord, 3); - coord [0] = 0.0; coord [1] = 0.0; coord [2] = 1.0; this->SetCoordCornerPoints(coord, 4); - coord [0] = 1.0; coord [1] = 0.0; coord [2] = 1.0; this->SetCoordCornerPoints(coord, 5); - coord [0] = 1.0; coord [1] = 1.0; coord [2] = 1.0; this->SetCoordCornerPoints(coord, 6); - coord [0] = 0.0; coord [1] = 1.0; coord [2] = 1.0; this->SetCoordCornerPoints(coord, 7); - - delete [] coord; - + coord[0] = 0.0; + coord[1] = 0.0; + coord[2] = 0.0; + this->SetCoordCornerPoints(coord, 0); + coord[0] = 1.0; + coord[1] = 0.0; + coord[2] = 0.0; + this->SetCoordCornerPoints(coord, 1); + coord[0] = 1.0; + coord[1] = 1.0; + coord[2] = 0.0; + this->SetCoordCornerPoints(coord, 2); + coord[0] = 0.0; + coord[1] = 1.0; + coord[2] = 0.0; + this->SetCoordCornerPoints(coord, 3); + coord[0] = 0.0; + coord[1] = 0.0; + coord[2] = 1.0; + this->SetCoordCornerPoints(coord, 4); + coord[0] = 1.0; + coord[1] = 0.0; + coord[2] = 1.0; + this->SetCoordCornerPoints(coord, 5); + coord[0] = 1.0; + coord[1] = 1.0; + coord[2] = 1.0; + this->SetCoordCornerPoints(coord, 6); + coord[0] = 0.0; + coord[1] = 1.0; + coord[2] = 1.0; + this->SetCoordCornerPoints(coord, 7); + + delete[] coord; } -void CFreeFormDefBox::SetControlPoints_Parallelepiped (void) { +void CFreeFormDefBox::SetControlPoints_Parallelepiped() { unsigned short iDim, iDegree, jDegree, kDegree; /*--- Set base control points according to the notation of Vtk for hexahedrons ---*/ for (iDim = 0; iDim < nDim; iDim++) { - Coord_Control_Points [0] [0] [0] [iDim] = Coord_Corner_Points[0][iDim]; - Coord_Control_Points [lOrder-1] [0] [0] [iDim] = Coord_Corner_Points[1][iDim]; - Coord_Control_Points [lOrder-1] [mOrder-1] [0] [iDim] = Coord_Corner_Points[2][iDim]; - Coord_Control_Points [0] [mOrder-1] [0] [iDim] = Coord_Corner_Points[3][iDim]; - Coord_Control_Points [0] [0] [nOrder-1] [iDim] = Coord_Corner_Points[4][iDim]; - Coord_Control_Points [lOrder-1] [0] [nOrder-1] [iDim] = Coord_Corner_Points[5][iDim]; - Coord_Control_Points [lOrder-1] [mOrder-1] [nOrder-1] [iDim] = Coord_Corner_Points[6][iDim]; - Coord_Control_Points [0] [mOrder-1] [nOrder-1] [iDim] = Coord_Corner_Points[7][iDim]; + Coord_Control_Points[0][0][0][iDim] = Coord_Corner_Points[0][iDim]; + Coord_Control_Points[lOrder - 1][0][0][iDim] = Coord_Corner_Points[1][iDim]; + Coord_Control_Points[lOrder - 1][mOrder - 1][0][iDim] = Coord_Corner_Points[2][iDim]; + Coord_Control_Points[0][mOrder - 1][0][iDim] = Coord_Corner_Points[3][iDim]; + Coord_Control_Points[0][0][nOrder - 1][iDim] = Coord_Corner_Points[4][iDim]; + Coord_Control_Points[lOrder - 1][0][nOrder - 1][iDim] = Coord_Corner_Points[5][iDim]; + Coord_Control_Points[lOrder - 1][mOrder - 1][nOrder - 1][iDim] = Coord_Corner_Points[6][iDim]; + Coord_Control_Points[0][mOrder - 1][nOrder - 1][iDim] = Coord_Corner_Points[7][iDim]; } /*--- Fill the rest of the cubic matrix of control points with uniform spacing (parallelepiped) ---*/ for (iDegree = 0; iDegree <= lDegree; iDegree++) for (jDegree = 0; jDegree <= mDegree; jDegree++) for (kDegree = 0; kDegree <= nDegree; kDegree++) { - Coord_Control_Points[iDegree][jDegree][kDegree][0] = Coord_Corner_Points[0][0] - + su2double(iDegree)/su2double(lDegree)*(Coord_Corner_Points[1][0]-Coord_Corner_Points[0][0]); - Coord_Control_Points[iDegree][jDegree][kDegree][1] = Coord_Corner_Points[0][1] - + su2double(jDegree)/su2double(mDegree)*(Coord_Corner_Points[3][1]-Coord_Corner_Points[0][1]); - Coord_Control_Points[iDegree][jDegree][kDegree][2] = Coord_Corner_Points[0][2] - + su2double(kDegree)/su2double(nDegree)*(Coord_Corner_Points[4][2]-Coord_Corner_Points[0][2]); + Coord_Control_Points[iDegree][jDegree][kDegree][0] = + Coord_Corner_Points[0][0] + + su2double(iDegree) / su2double(lDegree) * (Coord_Corner_Points[1][0] - Coord_Corner_Points[0][0]); + Coord_Control_Points[iDegree][jDegree][kDegree][1] = + Coord_Corner_Points[0][1] + + su2double(jDegree) / su2double(mDegree) * (Coord_Corner_Points[3][1] - Coord_Corner_Points[0][1]); + Coord_Control_Points[iDegree][jDegree][kDegree][2] = + Coord_Corner_Points[0][2] + + su2double(kDegree) / su2double(nDegree) * (Coord_Corner_Points[4][2] - Coord_Corner_Points[0][2]); } } -void CFreeFormDefBox::SetSupportCP(CFreeFormDefBox *FFDBox) { +void CFreeFormDefBox::SetSupportCP(CFreeFormDefBox* FFDBox) { unsigned short iDim, iOrder, jOrder, kOrder; unsigned short lOrder = FFDBox->GetlOrder(); unsigned short mOrder = FFDBox->GetmOrder(); unsigned short nOrder = FFDBox->GetnOrder(); - Coord_SupportCP = new su2double*** [lOrder]; + Coord_SupportCP = new su2double***[lOrder]; for (iOrder = 0; iOrder < lOrder; iOrder++) { - Coord_SupportCP[iOrder] = new su2double** [mOrder]; + Coord_SupportCP[iOrder] = new su2double**[mOrder]; for (jOrder = 0; jOrder < mOrder; jOrder++) { - Coord_SupportCP[iOrder][jOrder] = new su2double* [nOrder]; - for (kOrder = 0; kOrder < nOrder; kOrder++) - Coord_SupportCP[iOrder][jOrder][kOrder] = new su2double [nDim]; + Coord_SupportCP[iOrder][jOrder] = new su2double*[nOrder]; + for (kOrder = 0; kOrder < nOrder; kOrder++) Coord_SupportCP[iOrder][jOrder][kOrder] = new su2double[nDim]; } } /*--- Set base support control points according to the notation of Vtk for hexahedrons ---*/ for (iDim = 0; iDim < nDim; iDim++) { - Coord_SupportCP [0] [0] [0] [iDim] = Coord_Corner_Points[0][iDim]; - Coord_SupportCP [lOrder-1] [0] [0] [iDim] = Coord_Corner_Points[1][iDim]; - Coord_SupportCP [lOrder-1] [mOrder-1] [0] [iDim] = Coord_Corner_Points[2][iDim]; - Coord_SupportCP [0] [mOrder-1] [0] [iDim] = Coord_Corner_Points[3][iDim]; - Coord_SupportCP [0] [0] [nOrder-1] [iDim] = Coord_Corner_Points[4][iDim]; - Coord_SupportCP [lOrder-1] [0] [nOrder-1] [iDim] = Coord_Corner_Points[5][iDim]; - Coord_SupportCP [lOrder-1] [mOrder-1] [nOrder-1] [iDim] = Coord_Corner_Points[6][iDim]; - Coord_SupportCP [0] [mOrder-1] [nOrder-1] [iDim] = Coord_Corner_Points[7][iDim]; + Coord_SupportCP[0][0][0][iDim] = Coord_Corner_Points[0][iDim]; + Coord_SupportCP[lOrder - 1][0][0][iDim] = Coord_Corner_Points[1][iDim]; + Coord_SupportCP[lOrder - 1][mOrder - 1][0][iDim] = Coord_Corner_Points[2][iDim]; + Coord_SupportCP[0][mOrder - 1][0][iDim] = Coord_Corner_Points[3][iDim]; + Coord_SupportCP[0][0][nOrder - 1][iDim] = Coord_Corner_Points[4][iDim]; + Coord_SupportCP[lOrder - 1][0][nOrder - 1][iDim] = Coord_Corner_Points[5][iDim]; + Coord_SupportCP[lOrder - 1][mOrder - 1][nOrder - 1][iDim] = Coord_Corner_Points[6][iDim]; + Coord_SupportCP[0][mOrder - 1][nOrder - 1][iDim] = Coord_Corner_Points[7][iDim]; } /*--- Fill the rest of the cubic matrix of support control points with uniform spacing ---*/ for (iOrder = 0; iOrder < lOrder; iOrder++) for (jOrder = 0; jOrder < mOrder; jOrder++) for (kOrder = 0; kOrder < nOrder; kOrder++) { - Coord_SupportCP[iOrder][jOrder][kOrder][0] = Coord_Corner_Points[0][0] - + su2double(iOrder)/su2double(lOrder-1)*(Coord_Corner_Points[1][0]-Coord_Corner_Points[0][0]); - Coord_SupportCP[iOrder][jOrder][kOrder][1] = Coord_Corner_Points[0][1] - + su2double(jOrder)/su2double(mOrder-1)*(Coord_Corner_Points[3][1]-Coord_Corner_Points[0][1]); - Coord_SupportCP[iOrder][jOrder][kOrder][2] = Coord_Corner_Points[0][2] - + su2double(kOrder)/su2double(nOrder-1)*(Coord_Corner_Points[4][2]-Coord_Corner_Points[0][2]); + Coord_SupportCP[iOrder][jOrder][kOrder][0] = + Coord_Corner_Points[0][0] + + su2double(iOrder) / su2double(lOrder - 1) * (Coord_Corner_Points[1][0] - Coord_Corner_Points[0][0]); + Coord_SupportCP[iOrder][jOrder][kOrder][1] = + Coord_Corner_Points[0][1] + + su2double(jOrder) / su2double(mOrder - 1) * (Coord_Corner_Points[3][1] - Coord_Corner_Points[0][1]); + Coord_SupportCP[iOrder][jOrder][kOrder][2] = + Coord_Corner_Points[0][2] + + su2double(kOrder) / su2double(nOrder - 1) * (Coord_Corner_Points[4][2] - Coord_Corner_Points[0][2]); } } -void CFreeFormDefBox::SetSupportCPChange(CFreeFormDefBox *FFDBox) { +void CFreeFormDefBox::SetSupportCPChange(CFreeFormDefBox* FFDBox) { unsigned short iDim, iOrder, jOrder, kOrder; su2double *CartCoordNew, *ParamCoord; unsigned short lOrder = FFDBox->GetlOrder(); unsigned short mOrder = FFDBox->GetmOrder(); unsigned short nOrder = FFDBox->GetnOrder(); - su2double ****ParamCoord_SupportCP = new su2double*** [lOrder]; + auto**** ParamCoord_SupportCP = new su2double***[lOrder]; for (iOrder = 0; iOrder < lOrder; iOrder++) { - ParamCoord_SupportCP[iOrder] = new su2double** [mOrder]; + ParamCoord_SupportCP[iOrder] = new su2double**[mOrder]; for (jOrder = 0; jOrder < mOrder; jOrder++) { - ParamCoord_SupportCP[iOrder][jOrder] = new su2double* [nOrder]; - for (kOrder = 0; kOrder < nOrder; kOrder++) - ParamCoord_SupportCP[iOrder][jOrder][kOrder] = new su2double [nDim]; + ParamCoord_SupportCP[iOrder][jOrder] = new su2double*[nOrder]; + for (kOrder = 0; kOrder < nOrder; kOrder++) ParamCoord_SupportCP[iOrder][jOrder][kOrder] = new su2double[nDim]; } } @@ -252,18 +286,17 @@ void CFreeFormDefBox::SetSupportCPChange(CFreeFormDefBox *FFDBox) { for (jOrder = 0; jOrder < mOrder; jOrder++) for (kOrder = 0; kOrder < nOrder; kOrder++) for (iDim = 0; iDim < nDim; iDim++) - ParamCoord_SupportCP[iOrder][jOrder][kOrder][iDim] = - Coord_SupportCP[iOrder][jOrder][kOrder][iDim]; + ParamCoord_SupportCP[iOrder][jOrder][kOrder][iDim] = Coord_SupportCP[iOrder][jOrder][kOrder][iDim]; for (iDim = 0; iDim < nDim; iDim++) { - Coord_Control_Points[0][0][0][iDim] = FFDBox->GetCoordCornerPoints(iDim, 0); - Coord_Control_Points[1][0][0][iDim] = FFDBox->GetCoordCornerPoints(iDim, 1); - Coord_Control_Points[1][1][0][iDim] = FFDBox->GetCoordCornerPoints(iDim, 2); - Coord_Control_Points[0][1][0][iDim] = FFDBox->GetCoordCornerPoints(iDim, 3); - Coord_Control_Points[0][0][1][iDim] = FFDBox->GetCoordCornerPoints(iDim, 4); - Coord_Control_Points[1][0][1][iDim] = FFDBox->GetCoordCornerPoints(iDim, 5); - Coord_Control_Points[1][1][1][iDim] = FFDBox->GetCoordCornerPoints(iDim, 6); - Coord_Control_Points[0][1][1][iDim] = FFDBox->GetCoordCornerPoints(iDim, 7); + Coord_Control_Points[0][0][0][iDim] = FFDBox->GetCoordCornerPoints(iDim, 0); + Coord_Control_Points[1][0][0][iDim] = FFDBox->GetCoordCornerPoints(iDim, 1); + Coord_Control_Points[1][1][0][iDim] = FFDBox->GetCoordCornerPoints(iDim, 2); + Coord_Control_Points[0][1][0][iDim] = FFDBox->GetCoordCornerPoints(iDim, 3); + Coord_Control_Points[0][0][1][iDim] = FFDBox->GetCoordCornerPoints(iDim, 4); + Coord_Control_Points[1][0][1][iDim] = FFDBox->GetCoordCornerPoints(iDim, 5); + Coord_Control_Points[1][1][1][iDim] = FFDBox->GetCoordCornerPoints(iDim, 6); + Coord_Control_Points[0][1][1][iDim] = FFDBox->GetCoordCornerPoints(iDim, 7); } for (iOrder = 0; iOrder < FFDBox->GetlOrder(); iOrder++) { @@ -276,180 +309,186 @@ void CFreeFormDefBox::SetSupportCPChange(CFreeFormDefBox *FFDBox) { } } } - } -void CFreeFormDefBox::SetCart2Cyl_ControlPoints(CConfig *config) { - +void CFreeFormDefBox::SetCart2Cyl_ControlPoints(CConfig* config) { unsigned short iDegree, jDegree, kDegree; su2double CartCoord[3]; su2double X_0, Y_0, Z_0, Xbar, Ybar, Zbar; - X_0 = config->GetFFD_Axis(0); Y_0 = config->GetFFD_Axis(1); Z_0 = config->GetFFD_Axis(2); + X_0 = config->GetFFD_Axis(0); + Y_0 = config->GetFFD_Axis(1); + Z_0 = config->GetFFD_Axis(2); for (kDegree = 0; kDegree <= nDegree; kDegree++) { for (jDegree = 0; jDegree <= mDegree; jDegree++) { for (iDegree = 0; iDegree <= lDegree; iDegree++) { - CartCoord[0] = Coord_Control_Points[iDegree][jDegree][kDegree][0]; CartCoord[1] = Coord_Control_Points[iDegree][jDegree][kDegree][1]; CartCoord[2] = Coord_Control_Points[iDegree][jDegree][kDegree][2]; - Xbar = CartCoord[0] - X_0; Ybar = CartCoord[1] - Y_0; Zbar = CartCoord[2] - Z_0; + Xbar = CartCoord[0] - X_0; + Ybar = CartCoord[1] - Y_0; + Zbar = CartCoord[2] - Z_0; - Coord_Control_Points[iDegree][jDegree][kDegree][0] = sqrt(Ybar*Ybar + Zbar*Zbar); - Coord_Control_Points[iDegree][jDegree][kDegree][1] = atan2 ( Zbar, Ybar); - if (Coord_Control_Points[iDegree][jDegree][kDegree][1] > PI_NUMBER/2.0) Coord_Control_Points[iDegree][jDegree][kDegree][1] -= 2.0*PI_NUMBER; + Coord_Control_Points[iDegree][jDegree][kDegree][0] = sqrt(Ybar * Ybar + Zbar * Zbar); + Coord_Control_Points[iDegree][jDegree][kDegree][1] = atan2(Zbar, Ybar); + if (Coord_Control_Points[iDegree][jDegree][kDegree][1] > PI_NUMBER / 2.0) + Coord_Control_Points[iDegree][jDegree][kDegree][1] -= 2.0 * PI_NUMBER; Coord_Control_Points[iDegree][jDegree][kDegree][2] = Xbar; CartCoord[0] = Coord_Control_Points_Copy[iDegree][jDegree][kDegree][0]; CartCoord[1] = Coord_Control_Points_Copy[iDegree][jDegree][kDegree][1]; CartCoord[2] = Coord_Control_Points_Copy[iDegree][jDegree][kDegree][2]; - Xbar = CartCoord[0] - X_0; Ybar = CartCoord[1] - Y_0; Zbar = CartCoord[2] - Z_0; + Xbar = CartCoord[0] - X_0; + Ybar = CartCoord[1] - Y_0; + Zbar = CartCoord[2] - Z_0; - Coord_Control_Points_Copy[iDegree][jDegree][kDegree][0] = sqrt(Ybar*Ybar + Zbar*Zbar); - Coord_Control_Points_Copy[iDegree][jDegree][kDegree][1] = atan2 (Zbar, Ybar); - if (Coord_Control_Points_Copy[iDegree][jDegree][kDegree][1] > PI_NUMBER/2.0) Coord_Control_Points_Copy[iDegree][jDegree][kDegree][1] -= 2.0*PI_NUMBER; + Coord_Control_Points_Copy[iDegree][jDegree][kDegree][0] = sqrt(Ybar * Ybar + Zbar * Zbar); + Coord_Control_Points_Copy[iDegree][jDegree][kDegree][1] = atan2(Zbar, Ybar); + if (Coord_Control_Points_Copy[iDegree][jDegree][kDegree][1] > PI_NUMBER / 2.0) + Coord_Control_Points_Copy[iDegree][jDegree][kDegree][1] -= 2.0 * PI_NUMBER; Coord_Control_Points_Copy[iDegree][jDegree][kDegree][2] = Xbar; - } } } - } -void CFreeFormDefBox::SetCyl2Cart_ControlPoints(CConfig *config) { - +void CFreeFormDefBox::SetCyl2Cart_ControlPoints(CConfig* config) { unsigned short iDegree, jDegree, kDegree; su2double PolarCoord[3]; - su2double X_0, Y_0, Z_0, Xbar, Ybar, Zbar; - X_0 = config->GetFFD_Axis(0); Y_0 = config->GetFFD_Axis(1); Z_0 = config->GetFFD_Axis(2); + su2double X_0, Y_0, Z_0, Xbar, Ybar, Zbar; + X_0 = config->GetFFD_Axis(0); + Y_0 = config->GetFFD_Axis(1); + Z_0 = config->GetFFD_Axis(2); for (kDegree = 0; kDegree <= nDegree; kDegree++) { for (jDegree = 0; jDegree <= mDegree; jDegree++) { for (iDegree = 0; iDegree <= lDegree; iDegree++) { - - - PolarCoord[0] = Coord_Control_Points[iDegree][jDegree][kDegree][0]; - PolarCoord[1] = Coord_Control_Points[iDegree][jDegree][kDegree][1]; - PolarCoord[2] = Coord_Control_Points[iDegree][jDegree][kDegree][2]; - + PolarCoord[0] = Coord_Control_Points[iDegree][jDegree][kDegree][0]; + PolarCoord[1] = Coord_Control_Points[iDegree][jDegree][kDegree][1]; + PolarCoord[2] = Coord_Control_Points[iDegree][jDegree][kDegree][2]; Xbar = PolarCoord[2]; Ybar = PolarCoord[0] * cos(PolarCoord[1]); Zbar = PolarCoord[0] * sin(PolarCoord[1]); - PolarCoord[0] = Xbar +X_0; PolarCoord[1] = Ybar +Y_0; PolarCoord[2] = Zbar +Z_0; + PolarCoord[0] = Xbar + X_0; + PolarCoord[1] = Ybar + Y_0; + PolarCoord[2] = Zbar + Z_0; Coord_Control_Points[iDegree][jDegree][kDegree][0] = PolarCoord[0]; Coord_Control_Points[iDegree][jDegree][kDegree][1] = PolarCoord[1]; Coord_Control_Points[iDegree][jDegree][kDegree][2] = PolarCoord[2]; - } } } - } -void CFreeFormDefBox::SetCart2Cyl_CornerPoints(CConfig *config) { - +void CFreeFormDefBox::SetCart2Cyl_CornerPoints(CConfig* config) { unsigned short iCornerPoint; - su2double *CartCoord; + su2double* CartCoord; su2double X_0, Y_0, Z_0, Xbar, Ybar, Zbar; - X_0 = config->GetFFD_Axis(0); Y_0 = config->GetFFD_Axis(1); Z_0 = config->GetFFD_Axis(2); + X_0 = config->GetFFD_Axis(0); + Y_0 = config->GetFFD_Axis(1); + Z_0 = config->GetFFD_Axis(2); for (iCornerPoint = 0; iCornerPoint < 8; iCornerPoint++) { - CartCoord = GetCoordCornerPoints(iCornerPoint); - Xbar = CartCoord[0] - X_0; Ybar = CartCoord[1] - Y_0; Zbar = CartCoord[2] - Z_0; - - CartCoord[0] = sqrt(Ybar*Ybar + Zbar*Zbar); - CartCoord[1] = atan2 ( Zbar, Ybar); if (CartCoord[1] > PI_NUMBER/2.0) CartCoord[1] -= 2.0*PI_NUMBER; - CartCoord[2] = Xbar; - + Xbar = CartCoord[0] - X_0; + Ybar = CartCoord[1] - Y_0; + Zbar = CartCoord[2] - Z_0; + + CartCoord[0] = sqrt(Ybar * Ybar + Zbar * Zbar); + CartCoord[1] = atan2(Zbar, Ybar); + if (CartCoord[1] > PI_NUMBER / 2.0) CartCoord[1] -= 2.0 * PI_NUMBER; + CartCoord[2] = Xbar; } - } - -void CFreeFormDefBox::SetCyl2Cart_CornerPoints(CConfig *config) { - +void CFreeFormDefBox::SetCyl2Cart_CornerPoints(CConfig* config) { unsigned short iCornerPoint; - su2double *PolarCoord; + su2double* PolarCoord; su2double X_0, Y_0, Z_0, Xbar, Ybar, Zbar; - X_0 = config->GetFFD_Axis(0); Y_0 = config->GetFFD_Axis(1); Z_0 = config->GetFFD_Axis(2); + X_0 = config->GetFFD_Axis(0); + Y_0 = config->GetFFD_Axis(1); + Z_0 = config->GetFFD_Axis(2); for (iCornerPoint = 0; iCornerPoint < 8; iCornerPoint++) { - PolarCoord = GetCoordCornerPoints(iCornerPoint); Xbar = PolarCoord[2]; Ybar = PolarCoord[0] * cos(PolarCoord[1]); Zbar = PolarCoord[0] * sin(PolarCoord[1]); - PolarCoord[0] = Xbar + X_0; PolarCoord[1] = Ybar + Y_0; PolarCoord[2] = Zbar + Z_0; - + PolarCoord[0] = Xbar + X_0; + PolarCoord[1] = Ybar + Y_0; + PolarCoord[2] = Zbar + Z_0; } - } -void CFreeFormDefBox::SetCart2Sphe_ControlPoints(CConfig *config) { - +void CFreeFormDefBox::SetCart2Sphe_ControlPoints(CConfig* config) { unsigned short iDegree, jDegree, kDegree; su2double CartCoord[3]; su2double X_0, Y_0, Z_0, Xbar, Ybar, Zbar; - X_0 = config->GetFFD_Axis(0); Y_0 = config->GetFFD_Axis(1); Z_0 = config->GetFFD_Axis(2); + X_0 = config->GetFFD_Axis(0); + Y_0 = config->GetFFD_Axis(1); + Z_0 = config->GetFFD_Axis(2); for (kDegree = 0; kDegree <= nDegree; kDegree++) { for (jDegree = 0; jDegree <= mDegree; jDegree++) { for (iDegree = 0; iDegree <= lDegree; iDegree++) { - CartCoord[0] = Coord_Control_Points[iDegree][jDegree][kDegree][0]; CartCoord[1] = Coord_Control_Points[iDegree][jDegree][kDegree][1]; CartCoord[2] = Coord_Control_Points[iDegree][jDegree][kDegree][2]; - Xbar = CartCoord[0] - X_0; Ybar = CartCoord[1] - Y_0; Zbar = CartCoord[2] - Z_0; + Xbar = CartCoord[0] - X_0; + Ybar = CartCoord[1] - Y_0; + Zbar = CartCoord[2] - Z_0; - Coord_Control_Points[iDegree][jDegree][kDegree][0] = sqrt(Xbar*Xbar + Ybar*Ybar + Zbar*Zbar); - Coord_Control_Points[iDegree][jDegree][kDegree][1] = atan2 ( Zbar, Ybar); - if (Coord_Control_Points[iDegree][jDegree][kDegree][1] > PI_NUMBER/2.0) Coord_Control_Points[iDegree][jDegree][kDegree][1] -= 2.0*PI_NUMBER; - Coord_Control_Points[iDegree][jDegree][kDegree][2] = acos(Xbar/Coord_Control_Points[iDegree][jDegree][kDegree][0] ); + Coord_Control_Points[iDegree][jDegree][kDegree][0] = sqrt(Xbar * Xbar + Ybar * Ybar + Zbar * Zbar); + Coord_Control_Points[iDegree][jDegree][kDegree][1] = atan2(Zbar, Ybar); + if (Coord_Control_Points[iDegree][jDegree][kDegree][1] > PI_NUMBER / 2.0) + Coord_Control_Points[iDegree][jDegree][kDegree][1] -= 2.0 * PI_NUMBER; + Coord_Control_Points[iDegree][jDegree][kDegree][2] = + acos(Xbar / Coord_Control_Points[iDegree][jDegree][kDegree][0]); CartCoord[0] = Coord_Control_Points_Copy[iDegree][jDegree][kDegree][0]; CartCoord[1] = Coord_Control_Points_Copy[iDegree][jDegree][kDegree][1]; CartCoord[2] = Coord_Control_Points_Copy[iDegree][jDegree][kDegree][2]; - Xbar = CartCoord[0] - X_0; Ybar = CartCoord[1] - Y_0; Zbar = CartCoord[2] - Z_0; - - Coord_Control_Points_Copy[iDegree][jDegree][kDegree][0] = sqrt(Xbar*Xbar + Ybar*Ybar + Zbar*Zbar); - Coord_Control_Points_Copy[iDegree][jDegree][kDegree][1] = atan2 ( Zbar, Ybar); - if (Coord_Control_Points_Copy[iDegree][jDegree][kDegree][1] > PI_NUMBER/2.0) - Coord_Control_Points_Copy[iDegree][jDegree][kDegree][1] -= 2.0*PI_NUMBER; - Coord_Control_Points_Copy[iDegree][jDegree][kDegree][2] = acos(Xbar/Coord_Control_Points_Copy[iDegree][jDegree][kDegree][0]); + Xbar = CartCoord[0] - X_0; + Ybar = CartCoord[1] - Y_0; + Zbar = CartCoord[2] - Z_0; + Coord_Control_Points_Copy[iDegree][jDegree][kDegree][0] = sqrt(Xbar * Xbar + Ybar * Ybar + Zbar * Zbar); + Coord_Control_Points_Copy[iDegree][jDegree][kDegree][1] = atan2(Zbar, Ybar); + if (Coord_Control_Points_Copy[iDegree][jDegree][kDegree][1] > PI_NUMBER / 2.0) + Coord_Control_Points_Copy[iDegree][jDegree][kDegree][1] -= 2.0 * PI_NUMBER; + Coord_Control_Points_Copy[iDegree][jDegree][kDegree][2] = + acos(Xbar / Coord_Control_Points_Copy[iDegree][jDegree][kDegree][0]); } } } - } -void CFreeFormDefBox::SetSphe2Cart_ControlPoints(CConfig *config) { - +void CFreeFormDefBox::SetSphe2Cart_ControlPoints(CConfig* config) { unsigned short iDegree, jDegree, kDegree; su2double PolarCoord[3]; - su2double X_0, Y_0, Z_0, Xbar, Ybar, Zbar; - X_0 = config->GetFFD_Axis(0); Y_0 = config->GetFFD_Axis(1); Z_0 = config->GetFFD_Axis(2); + su2double X_0, Y_0, Z_0, Xbar, Ybar, Zbar; + X_0 = config->GetFFD_Axis(0); + Y_0 = config->GetFFD_Axis(1); + Z_0 = config->GetFFD_Axis(2); for (kDegree = 0; kDegree <= nDegree; kDegree++) { for (jDegree = 0; jDegree <= mDegree; jDegree++) { for (iDegree = 0; iDegree <= lDegree; iDegree++) { - PolarCoord[0] = Coord_Control_Points[iDegree][jDegree][kDegree][0]; PolarCoord[1] = Coord_Control_Points[iDegree][jDegree][kDegree][1]; PolarCoord[2] = Coord_Control_Points[iDegree][jDegree][kDegree][2]; @@ -458,64 +497,63 @@ void CFreeFormDefBox::SetSphe2Cart_ControlPoints(CConfig *config) { Ybar = PolarCoord[0] * cos(PolarCoord[1]) * sin(PolarCoord[2]); Zbar = PolarCoord[0] * sin(PolarCoord[1]) * sin(PolarCoord[2]); - PolarCoord[0] = Xbar + X_0; PolarCoord[1] = Ybar + Y_0; PolarCoord[2] = Zbar + Z_0; + PolarCoord[0] = Xbar + X_0; + PolarCoord[1] = Ybar + Y_0; + PolarCoord[2] = Zbar + Z_0; Coord_Control_Points[iDegree][jDegree][kDegree][0] = PolarCoord[0]; Coord_Control_Points[iDegree][jDegree][kDegree][1] = PolarCoord[1]; Coord_Control_Points[iDegree][jDegree][kDegree][2] = PolarCoord[2]; - } } } - } -void CFreeFormDefBox::SetCart2Sphe_CornerPoints(CConfig *config) { - +void CFreeFormDefBox::SetCart2Sphe_CornerPoints(CConfig* config) { unsigned short iCornerPoint; - su2double *CartCoord; + su2double* CartCoord; su2double X_0, Y_0, Z_0, Xbar, Ybar, Zbar; - X_0 = config->GetFFD_Axis(0); Y_0 = config->GetFFD_Axis(1); Z_0 = config->GetFFD_Axis(2); + X_0 = config->GetFFD_Axis(0); + Y_0 = config->GetFFD_Axis(1); + Z_0 = config->GetFFD_Axis(2); for (iCornerPoint = 0; iCornerPoint < 8; iCornerPoint++) { - CartCoord = GetCoordCornerPoints(iCornerPoint); - Xbar = CartCoord[0] - X_0; Ybar = CartCoord[1] - Y_0; Zbar = CartCoord[2] - Z_0; - - CartCoord[0] = sqrt(Xbar*Xbar + Ybar*Ybar + Zbar*Zbar); - CartCoord[1] = atan2(Zbar, Ybar); if (CartCoord[1] > PI_NUMBER/2.0) CartCoord[1] -= 2.0*PI_NUMBER; - CartCoord[2] = acos(Xbar/CartCoord[0]); - + Xbar = CartCoord[0] - X_0; + Ybar = CartCoord[1] - Y_0; + Zbar = CartCoord[2] - Z_0; + + CartCoord[0] = sqrt(Xbar * Xbar + Ybar * Ybar + Zbar * Zbar); + CartCoord[1] = atan2(Zbar, Ybar); + if (CartCoord[1] > PI_NUMBER / 2.0) CartCoord[1] -= 2.0 * PI_NUMBER; + CartCoord[2] = acos(Xbar / CartCoord[0]); } - } - -void CFreeFormDefBox::SetSphe2Cart_CornerPoints(CConfig *config) { - +void CFreeFormDefBox::SetSphe2Cart_CornerPoints(CConfig* config) { unsigned short iCornerPoint; - su2double *PolarCoord; + su2double* PolarCoord; su2double X_0, Y_0, Z_0, Xbar, Ybar, Zbar; - X_0 = config->GetFFD_Axis(0); Y_0 = config->GetFFD_Axis(1); Z_0 = config->GetFFD_Axis(2); + X_0 = config->GetFFD_Axis(0); + Y_0 = config->GetFFD_Axis(1); + Z_0 = config->GetFFD_Axis(2); for (iCornerPoint = 0; iCornerPoint < 8; iCornerPoint++) { - PolarCoord = GetCoordCornerPoints(iCornerPoint); Xbar = PolarCoord[0] * cos(PolarCoord[2]); Ybar = PolarCoord[0] * cos(PolarCoord[1]) * sin(PolarCoord[2]); Zbar = PolarCoord[0] * sin(PolarCoord[1]) * sin(PolarCoord[2]); - PolarCoord[0] = Xbar + X_0; PolarCoord[1] = Ybar + Y_0; PolarCoord[2] = Zbar + Z_0; - + PolarCoord[0] = Xbar + X_0; + PolarCoord[1] = Ybar + Y_0; + PolarCoord[2] = Zbar + Z_0; } - } - -void CFreeFormDefBox::SetCGNS(CGeometry *geometry, unsigned short iFFDBox, bool original) { +void CFreeFormDefBox::SetCGNS(CGeometry* geometry, unsigned short iFFDBox, bool original) { #ifdef HAVE_CGNS char FFDBox_filename[MAX_STRING_SIZE]; @@ -526,39 +564,35 @@ void CFreeFormDefBox::SetCGNS(CGeometry *geometry, unsigned short iFFDBox, bool char zonename[33]; int FFDBox_cgns_file; int cell_dim, phys_dim; - int cgns_base=0, cgns_family, cgns_zone, cgns_err, dummy; - const char * basename; + int cgns_base = 0, cgns_family, cgns_zone, cgns_err, dummy; + const char* basename; /*--- FFD output is always 3D (even in 2D problems), this is important for debuging ---*/ nDim = geometry->GetnDim(); - cell_dim = nDim, - phys_dim = 3; + cell_dim = nDim, phys_dim = 3; - SPRINTF (FFDBox_filename, "ffd_boxes.cgns"); + SPRINTF(FFDBox_filename, "ffd_boxes.cgns"); - if ((original) && (iFFDBox == 0)) new_file = true; - else new_file = false; + new_file = (original) && (iFFDBox == 0); if (new_file) { cgns_err = cg_open(FFDBox_filename, CG_MODE_WRITE, &FFDBox_cgns_file); if (cgns_err) cg_error_print(); - cgns_err = cg_descriptor_write("Title", "Visualization of the FFD boxes generated by SU2_DEF." ); + cgns_err = cg_descriptor_write("Title", "Visualization of the FFD boxes generated by SU2_DEF."); if (cgns_err) cg_error_print(); - } - else { + } else { cgns_err = cg_open(FFDBox_filename, CG_MODE_MODIFY, &FFDBox_cgns_file); if (cgns_err) cg_error_print(); } if (original) { basename = "Original_FFD"; - } - else { + } else { basename = "Deformed_FFD"; } - if (iFFDBox == 0){ + if (iFFDBox == 0) { cgns_err = cg_base_write(FFDBox_cgns_file, basename, cell_dim, phys_dim, &cgns_base); if (cgns_err) cg_error_print(); } @@ -566,20 +600,20 @@ void CFreeFormDefBox::SetCGNS(CGeometry *geometry, unsigned short iFFDBox, bool if (cgns_err) cg_error_print(); cgsize_t dims[9]; - dims[0] = lDegree+1; - dims[1] = mDegree+1; - if (cell_dim == 3){ - dims[2] = nDegree+1; + dims[0] = lDegree + 1; + dims[1] = mDegree + 1; + if (cell_dim == 3) { + dims[2] = nDegree + 1; } cgsize_t pointlen = 1; - for(int ii=0; iiGetnDim(); - if (original) new_file = true; - else new_file = false; + new_file = original; - if (new_file) SPRINTF (FFDBox_filename, "ffd_boxes_%d.vtk", SU2_TYPE::Int(iFFDBox)); - else SPRINTF (FFDBox_filename, "ffd_boxes_def_%d.vtk", SU2_TYPE::Int(iFFDBox)); + if (new_file) + SPRINTF(FFDBox_filename, "ffd_boxes_%d.vtk", SU2_TYPE::Int(iFFDBox)); + else + SPRINTF(FFDBox_filename, "ffd_boxes_def_%d.vtk", SU2_TYPE::Int(iFFDBox)); FFDBox_file.open(FFDBox_filename, ios::out); FFDBox_file << "# vtk DataFile Version 3.0" << endl; @@ -699,10 +735,14 @@ void CFreeFormDefBox::SetParaview(CGeometry *geometry, unsigned short iFFDBox, b FFDBox_file << "ASCII" << endl; FFDBox_file << "DATASET STRUCTURED_GRID" << endl; - if (nDim == 2) FFDBox_file << "DIMENSIONS "<GetBasis(iDegree, ParamCoord[0]) - * BlendingFunction[1]->GetBasis(jDegree, ParamCoord[1]) - * BlendingFunction[2]->GetBasis(kDegree, ParamCoord[2]); + cart_coord[iDim] += Coord_Control_Points[iDegree][jDegree][kDegree][iDim] * + BlendingFunction[0]->GetBasis(iDegree, ParamCoord[0]) * + BlendingFunction[1]->GetBasis(jDegree, ParamCoord[1]) * + BlendingFunction[2]->GetBasis(kDegree, ParamCoord[2]); } return cart_coord; } - -su2double *CFreeFormDefBox::GetFFDGradient(su2double *val_coord, su2double *xyz) { - +su2double* CFreeFormDefBox::GetFFDGradient(su2double* val_coord, su2double* xyz) { unsigned short iDim, jDim, lmn[3]; /*--- Set the Degree of the spline ---*/ - lmn[0] = lDegree; lmn[1] = mDegree; lmn[2] = nDegree; + lmn[0] = lDegree; + lmn[1] = mDegree; + lmn[2] = nDegree; for (iDim = 0; iDim < nDim; iDim++) Gradient[iDim] = 0.0; for (iDim = 0; iDim < nDim; iDim++) for (jDim = 0; jDim < nDim; jDim++) - Gradient[jDim] += GetDerivative2(val_coord, iDim, xyz, lmn) * - GetDerivative3(val_coord, iDim, jDim, lmn); + Gradient[jDim] += GetDerivative2(val_coord, iDim, xyz, lmn) * GetDerivative3(val_coord, iDim, jDim, lmn); return Gradient; - } -void CFreeFormDefBox::GetFFDHessian(su2double *uvw, su2double *xyz, su2double **val_Hessian) { - +void CFreeFormDefBox::GetFFDHessian(su2double* uvw, su2double* xyz, su2double** val_Hessian) { unsigned short iDim, jDim, lmn[3]; /*--- Set the Degree of the spline ---*/ - lmn[0] = lDegree; lmn[1] = mDegree; lmn[2] = nDegree; + lmn[0] = lDegree; + lmn[1] = mDegree; + lmn[2] = nDegree; for (iDim = 0; iDim < nDim; iDim++) - for (jDim = 0; jDim < nDim; jDim++) - val_Hessian[iDim][jDim] = 0.0; + for (jDim = 0; jDim < nDim; jDim++) val_Hessian[iDim][jDim] = 0.0; /*--- Note that being all the functions linear combinations of polynomials, they are C^\infty, and the Hessian will be symmetric; no need to compute the under-diagonal part, for example ---*/ for (iDim = 0; iDim < nDim; iDim++) { - val_Hessian[0][0] += 2.0 * GetDerivative3(uvw, iDim,0, lmn) * GetDerivative3(uvw, iDim,0, lmn) + - GetDerivative2(uvw, iDim,xyz, lmn) * GetDerivative5(uvw, iDim,0,0, lmn); + val_Hessian[0][0] += 2.0 * GetDerivative3(uvw, iDim, 0, lmn) * GetDerivative3(uvw, iDim, 0, lmn) + + GetDerivative2(uvw, iDim, xyz, lmn) * GetDerivative5(uvw, iDim, 0, 0, lmn); - val_Hessian[1][1] += 2.0 * GetDerivative3(uvw, iDim,1, lmn) * GetDerivative3(uvw, iDim,1, lmn) + - GetDerivative2(uvw, iDim,xyz, lmn) * GetDerivative5(uvw, iDim,1,1, lmn); + val_Hessian[1][1] += 2.0 * GetDerivative3(uvw, iDim, 1, lmn) * GetDerivative3(uvw, iDim, 1, lmn) + + GetDerivative2(uvw, iDim, xyz, lmn) * GetDerivative5(uvw, iDim, 1, 1, lmn); - val_Hessian[2][2] += 2.0 * GetDerivative3(uvw, iDim,2, lmn) * GetDerivative3(uvw, iDim,2, lmn) + - GetDerivative2(uvw, iDim,xyz, lmn) * GetDerivative5(uvw, iDim,2,2, lmn); + val_Hessian[2][2] += 2.0 * GetDerivative3(uvw, iDim, 2, lmn) * GetDerivative3(uvw, iDim, 2, lmn) + + GetDerivative2(uvw, iDim, xyz, lmn) * GetDerivative5(uvw, iDim, 2, 2, lmn); - val_Hessian[0][1] += 2.0 * GetDerivative3(uvw, iDim,0, lmn) * GetDerivative3(uvw, iDim,1, lmn) + - GetDerivative2(uvw, iDim,xyz, lmn) * GetDerivative5(uvw, iDim,0,1, lmn); + val_Hessian[0][1] += 2.0 * GetDerivative3(uvw, iDim, 0, lmn) * GetDerivative3(uvw, iDim, 1, lmn) + + GetDerivative2(uvw, iDim, xyz, lmn) * GetDerivative5(uvw, iDim, 0, 1, lmn); - val_Hessian[0][2] += 2.0 * GetDerivative3(uvw, iDim,0, lmn) * GetDerivative3(uvw, iDim,2, lmn) + - GetDerivative2(uvw, iDim,xyz, lmn) * GetDerivative5(uvw, iDim,0,2, lmn); + val_Hessian[0][2] += 2.0 * GetDerivative3(uvw, iDim, 0, lmn) * GetDerivative3(uvw, iDim, 2, lmn) + + GetDerivative2(uvw, iDim, xyz, lmn) * GetDerivative5(uvw, iDim, 0, 2, lmn); - val_Hessian[1][2] += 2.0 * GetDerivative3(uvw, iDim,1, lmn) * GetDerivative3(uvw, iDim,2, lmn) + - GetDerivative2(uvw, iDim,xyz, lmn) * GetDerivative5(uvw, iDim,1,2, lmn); + val_Hessian[1][2] += 2.0 * GetDerivative3(uvw, iDim, 1, lmn) * GetDerivative3(uvw, iDim, 2, lmn) + + GetDerivative2(uvw, iDim, xyz, lmn) * GetDerivative5(uvw, iDim, 1, 2, lmn); } val_Hessian[1][0] = val_Hessian[0][1]; val_Hessian[2][0] = val_Hessian[0][2]; val_Hessian[2][1] = val_Hessian[1][2]; - } -su2double *CFreeFormDefBox::GetParametricCoord_Iterative(unsigned long iPoint, su2double *xyz, const su2double *ParamCoordGuess, CConfig *config) { - - su2double *IndepTerm, SOR_Factor = 1.0, MinNormError, NormError, Determinant, AdjHessian[3][3], Temp[3] = {0.0,0.0,0.0}; +su2double* CFreeFormDefBox::GetParametricCoord_Iterative(unsigned long iPoint, su2double* xyz, + const su2double* ParamCoordGuess, CConfig* config) { + su2double *IndepTerm, SOR_Factor = 1.0, MinNormError, NormError, Determinant, AdjHessian[3][3], + Temp[3] = {0.0, 0.0, 0.0}; unsigned short iDim, jDim, RandonCounter; unsigned long iter; - su2double tol = config->GetFFD_Tol()*1E-3; + su2double tol = config->GetFFD_Tol() * 1E-3; unsigned short it_max = config->GetnFFD_Iter(); unsigned short Random_Trials = 500; /*--- Allocate the Hessian ---*/ - Hessian = new su2double* [nDim]; - IndepTerm = new su2double [nDim]; + Hessian = new su2double*[nDim]; + IndepTerm = new su2double[nDim]; for (iDim = 0; iDim < nDim; iDim++) { Hessian[iDim] = new su2double[nDim]; ParamCoord[iDim] = ParamCoordGuess[iDim]; - IndepTerm [iDim] = 0.0; + IndepTerm[iDim] = 0.0; } - RandonCounter = 0; MinNormError = 1E6; + RandonCounter = 0; + MinNormError = 1E6; /*--- External iteration ---*/ - for (iter = 0; iter < (unsigned long)it_max*Random_Trials; iter++) { - + for (iter = 0; iter < (unsigned long)it_max * Random_Trials; iter++) { /*--- The independent term of the solution of our system is -Gradient(sol_old) ---*/ Gradient = GetFFDGradient(ParamCoord, xyz); - for (iDim = 0; iDim < nDim; iDim++) IndepTerm[iDim] = - Gradient[iDim]; + for (iDim = 0; iDim < nDim; iDim++) IndepTerm[iDim] = -Gradient[iDim]; /*--- Hessian = The Matrix of our system, getHessian(sol_old,xyz,...) ---*/ @@ -887,19 +925,20 @@ su2double *CFreeFormDefBox::GetParametricCoord_Iterative(unsigned long iPoint, s /*--- Adjoint to Hessian ---*/ - AdjHessian[0][0] = Hessian[1][1]*Hessian[2][2]-Hessian[1][2]*Hessian[2][1]; - AdjHessian[0][1] = Hessian[0][2]*Hessian[2][1]-Hessian[0][1]*Hessian[2][2]; - AdjHessian[0][2] = Hessian[0][1]*Hessian[1][2]-Hessian[0][2]*Hessian[1][1]; - AdjHessian[1][0] = Hessian[1][2]*Hessian[2][0]-Hessian[1][0]*Hessian[2][2]; - AdjHessian[1][1] = Hessian[0][0]*Hessian[2][2]-Hessian[0][2]*Hessian[2][0]; - AdjHessian[1][2] = Hessian[0][2]*Hessian[1][0]-Hessian[0][0]*Hessian[1][2]; - AdjHessian[2][0] = Hessian[1][0]*Hessian[2][1]-Hessian[1][1]*Hessian[2][0]; - AdjHessian[2][1] = Hessian[0][1]*Hessian[2][0]-Hessian[0][0]*Hessian[2][1]; - AdjHessian[2][2] = Hessian[0][0]*Hessian[1][1]-Hessian[0][1]*Hessian[1][0]; + AdjHessian[0][0] = Hessian[1][1] * Hessian[2][2] - Hessian[1][2] * Hessian[2][1]; + AdjHessian[0][1] = Hessian[0][2] * Hessian[2][1] - Hessian[0][1] * Hessian[2][2]; + AdjHessian[0][2] = Hessian[0][1] * Hessian[1][2] - Hessian[0][2] * Hessian[1][1]; + AdjHessian[1][0] = Hessian[1][2] * Hessian[2][0] - Hessian[1][0] * Hessian[2][2]; + AdjHessian[1][1] = Hessian[0][0] * Hessian[2][2] - Hessian[0][2] * Hessian[2][0]; + AdjHessian[1][2] = Hessian[0][2] * Hessian[1][0] - Hessian[0][0] * Hessian[1][2]; + AdjHessian[2][0] = Hessian[1][0] * Hessian[2][1] - Hessian[1][1] * Hessian[2][0]; + AdjHessian[2][1] = Hessian[0][1] * Hessian[2][0] - Hessian[0][0] * Hessian[2][1]; + AdjHessian[2][2] = Hessian[0][0] * Hessian[1][1] - Hessian[0][1] * Hessian[1][0]; /*--- Determinant of Hessian ---*/ - Determinant = Hessian[0][0]*AdjHessian[0][0]+Hessian[0][1]*AdjHessian[1][0]+Hessian[0][2]*AdjHessian[2][0]; + Determinant = + Hessian[0][0] * AdjHessian[0][0] + Hessian[0][1] * AdjHessian[1][0] + Hessian[0][2] * AdjHessian[2][0]; /*--- Hessian inverse ---*/ @@ -907,7 +946,7 @@ su2double *CFreeFormDefBox::GetParametricCoord_Iterative(unsigned long iPoint, s for (iDim = 0; iDim < nDim; iDim++) { Temp[iDim] = 0.0; for (jDim = 0; jDim < nDim; jDim++) { - Temp[iDim] += AdjHessian[iDim][jDim]*IndepTerm[jDim]/Determinant; + Temp[iDim] += AdjHessian[iDim][jDim] * IndepTerm[jDim] / Determinant; } } for (iDim = 0; iDim < nDim; iDim++) { @@ -918,18 +957,17 @@ su2double *CFreeFormDefBox::GetParametricCoord_Iterative(unsigned long iPoint, s /*--- Update with Successive over-relaxation ---*/ for (iDim = 0; iDim < nDim; iDim++) { - ParamCoord[iDim] = (1.0-SOR_Factor)*ParamCoord[iDim] + SOR_Factor*(ParamCoord[iDim] + IndepTerm[iDim]); + ParamCoord[iDim] = (1.0 - SOR_Factor) * ParamCoord[iDim] + SOR_Factor * (ParamCoord[iDim] + IndepTerm[iDim]); } /*--- If the gradient is small, we have converged ---*/ - if ((fabs(IndepTerm[0]) < tol) && (fabs(IndepTerm[1]) < tol) && (fabs(IndepTerm[2]) < tol)) break; + if ((fabs(IndepTerm[0]) < tol) && (fabs(IndepTerm[1]) < tol) && (fabs(IndepTerm[2]) < tol)) break; /*--- Compute the norm of the error ---*/ NormError = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - NormError += IndepTerm[iDim]*IndepTerm[iDim]; + for (iDim = 0; iDim < nDim; iDim++) NormError += IndepTerm[iDim] * IndepTerm[iDim]; NormError = sqrt(NormError); MinNormError = min(NormError, MinNormError); @@ -937,235 +975,175 @@ su2double *CFreeFormDefBox::GetParametricCoord_Iterative(unsigned long iPoint, s /*--- If we have no convergence with Random_Trials iterations probably we are in a local minima. ---*/ if (((iter % it_max) == 0) && (iter != 0)) { - RandonCounter++; if (RandonCounter == Random_Trials) { - cout << endl << "Unknown point: "<< iPoint <<" (" << xyz[0] <<", "<< xyz[1] <<", "<< xyz[2] <<"). Min Error: "<< MinNormError <<". Iter: "<< iter <<"."<< endl; - } - else { + cout << endl + << "Unknown point: " << iPoint << " (" << xyz[0] << ", " << xyz[1] << ", " << xyz[2] + << "). Min Error: " << MinNormError << ". Iter: " << iter << "." << endl; + } else { SOR_Factor = 0.1; - for (iDim = 0; iDim < nDim; iDim++) - ParamCoord[iDim] = su2double(rand())/su2double(RAND_MAX); + for (iDim = 0; iDim < nDim; iDim++) ParamCoord[iDim] = su2double(rand()) / su2double(RAND_MAX); } - } /* --- Splines are not defined outside of [0,1]. So if the parametric coords are outside of * [0,1] the step was too big and we have to use a smaller relaxation factor. ---*/ - if ((config->GetFFD_Blending() == BSPLINE_UNIFORM) && - (((ParamCoord[0] < 0.0) || (ParamCoord[0] > 1.0)) || - ((ParamCoord[1] < 0.0) || (ParamCoord[1] > 1.0)) || + if ((config->GetFFD_Blending() == BSPLINE_UNIFORM) && + (((ParamCoord[0] < 0.0) || (ParamCoord[0] > 1.0)) || ((ParamCoord[1] < 0.0) || (ParamCoord[1] > 1.0)) || ((ParamCoord[2] < 0.0) || (ParamCoord[2] > 1.0)))) { - - for (iDim = 0; iDim < nDim; iDim++){ + for (iDim = 0; iDim < nDim; iDim++) { ParamCoord[iDim] = ParamCoordGuess[iDim]; } - SOR_Factor = 0.9*SOR_Factor; + SOR_Factor = 0.9 * SOR_Factor; } - } - for (iDim = 0; iDim < nDim; iDim++) - delete [] Hessian[iDim]; - delete [] Hessian; - delete [] IndepTerm; + for (iDim = 0; iDim < nDim; iDim++) delete[] Hessian[iDim]; + delete[] Hessian; + delete[] IndepTerm; /*--- The code has hit the max number of iterations ---*/ - if (iter == (unsigned long)it_max*Random_Trials) { - cout << "Unknown point: (" << xyz[0] <<", "<< xyz[1] <<", "<< xyz[2] <<"). Increase the value of FFD_ITERATIONS." << endl; + if (iter == (unsigned long)it_max * Random_Trials) { + cout << "Unknown point: (" << xyz[0] << ", " << xyz[1] << ", " << xyz[2] + << "). Increase the value of FFD_ITERATIONS." << endl; } /*--- Real Solution is now ParamCoord; Return it ---*/ return ParamCoord; - } -bool CFreeFormDefBox::GetPointFFD(CGeometry *geometry, CConfig *config, unsigned long iPoint) const { - - bool Inside = true; - bool cylindrical = (config->GetFFD_CoordSystem() == CYLINDRICAL); - bool spherical = (config->GetFFD_CoordSystem() == SPHERICAL); - bool polar = (config->GetFFD_CoordSystem() == POLAR); - - /*--- indices of the FFD box. Note that the front face is labelled 0,1,2,3 and the back face is 4,5,6,7 ---*/ - - unsigned short Index[6][5] = { - {0,1,2,3,0}, // front side - {1,5,6,2,1}, // right side - {2,6,7,3,2}, // top side - {3,7,4,0,3}, // left side - {4,5,1,0,4}, // bottom side - {4,7,6,5,4}}; // back side - - /*--- The current approach is to subdivide each of the 6 faces of the hexahedral FFD box into 4 triangles - by defining a supporting middle point. This allows nonplanar FFD boxes. - Note that the definition of the FFD box is as follows: the FFD box is a 6-sided die and we are looking at the side "1". - The opposite side is side "6". - If we are looking at side "1", we define the nodes counterclockwise. - If we are looking at side "6", we define the face clockwise ---*/ - - unsigned short nDim = geometry->GetnDim(); - - su2double Coord[3] = {0.0, 0.0, 0.0}; - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Coord[iDim] = geometry->nodes->GetCoord(iPoint, iDim); - - su2double X_0, Y_0, Z_0, Xbar, Ybar, Zbar; - - if (cylindrical) { - - X_0 = config->GetFFD_Axis(0); Y_0 = config->GetFFD_Axis(1); Z_0 = config->GetFFD_Axis(2); - - Xbar = Coord[0] - X_0; Ybar = Coord[1] - Y_0; Zbar = Coord[2] - Z_0; +bool CFreeFormDefBox::CheckPointInsideFFD(const su2double* coord) const { + /*--- Indices of the FFD box. Note that the front face is labelled 0,1,2,3 and the back face is 4,5,6,7 ---*/ - Coord[0] = sqrt(Ybar*Ybar + Zbar*Zbar); - Coord[1] = atan2(Zbar, Ybar); if (Coord[1] > PI_NUMBER/2.0) Coord[1] -= 2.0*PI_NUMBER; - Coord[2] = Xbar; + unsigned short Index[6][5] = {{0, 1, 2, 3, 0}, // front side + {1, 5, 6, 2, 1}, // right side + {2, 6, 7, 3, 2}, // top side + {3, 7, 4, 0, 3}, // left side + {4, 5, 1, 0, 4}, // bottom side + {4, 7, 6, 5, 4}}; // back side - } - - else if (spherical || polar) { + /*--- The current approach is to subdivide each of the 6 faces of the hexahedral FFD box into 4 triangles by defining + a supporting middle point. This allows nonplanar FFD boxes. Note that the definition of the FFD box is as follows: + the FFD box is a 6-sided die and we are looking at the side "1". The opposite side is side "6". If we are looking at + side "1", we define the nodes counterclockwise. If we are looking at side "6", we define the face clockwise. ---*/ - X_0 = config->GetFFD_Axis(0); Y_0 = config->GetFFD_Axis(1); Z_0 = config->GetFFD_Axis(2); + /*--- Loop over the faces of the FFD box. ---*/ - Xbar = Coord[0] - X_0; Ybar = Coord[1] - Y_0; Zbar = Coord[2] - Z_0; - - Coord[0] = sqrt(Xbar*Xbar + Ybar*Ybar + Zbar*Zbar); - Coord[1] = atan2(Zbar, Ybar); if (Coord[1] > PI_NUMBER/2.0) Coord[1] -= 2.0*PI_NUMBER; - Coord[2] = acos(Xbar/Coord[0]); - - } - - /*--- loop over the faces of the FFD box ---*/ - - for (unsigned short iVar = 0; iVar < 6; iVar++) { + for (unsigned short iFace = 0; iFace < 6; iFace++) { + /*--- Every face needs an interpolated middle point for the triangles. ---*/ su2double P[3] = {0.0, 0.0, 0.0}; - - /*--- every face needs an interpolated middle point for the triangles ---*/ - - for (int p = 0; p < 4; p++){ - P[0] += 0.25*Coord_Corner_Points[Index[iVar][p]][0]; - P[1] += 0.25*Coord_Corner_Points[Index[iVar][p]][1]; - P[2] += 0.25*Coord_Corner_Points[Index[iVar][p]][2]; + for (int p = 0; p < 4; p++) { + P[0] += 0.25 * Coord_Corner_Points[Index[iFace][p]][0]; + P[1] += 0.25 * Coord_Corner_Points[Index[iFace][p]][1]; + P[2] += 0.25 * Coord_Corner_Points[Index[iFace][p]][2]; } - /*--- loop over the 4 triangles making up the FFD box. The sign is equal for all distances ---*/ + /*--- Loop over the 4 triangles making up the FFD box. The sign should be equal for all distances. ---*/ - for (unsigned short jVar = 0; jVar < 4; jVar++) { - su2double Distance_Point = geometry->Point2Plane_Distance(Coord, - Coord_Corner_Points[Index[iVar][jVar]], - Coord_Corner_Points[Index[iVar][jVar+1]], - P); - if (Distance_Point < 0) { - Inside = false; - return Inside; + for (int iNode = 0; iNode < 4; iNode++) { + const su2double* plane[] = {P, Coord_Corner_Points[Index[iFace][iNode]], + Coord_Corner_Points[Index[iFace][iNode + 1]]}; + if (GeometryToolbox::PointToPlaneDistance(plane, coord) < 0) { + return false; } } } - - return Inside; - + return true; } - -su2double CFreeFormDefBox::GetDerivative1(su2double *uvw, unsigned short val_diff, unsigned short *ijk, unsigned short *lmn) const { - +su2double CFreeFormDefBox::GetDerivative1(su2double* uvw, unsigned short val_diff, unsigned short* ijk, + unsigned short* lmn) const { unsigned short iDim; su2double value = 0.0; value = BlendingFunction[val_diff]->GetDerivative(ijk[val_diff], uvw[val_diff], 1); for (iDim = 0; iDim < nDim; iDim++) - if (iDim != val_diff) - value *= BlendingFunction[iDim]->GetBasis(ijk[iDim], uvw[iDim]); + if (iDim != val_diff) value *= BlendingFunction[iDim]->GetBasis(ijk[iDim], uvw[iDim]); return value; - } -su2double CFreeFormDefBox::GetDerivative2 (su2double *uvw, unsigned short dim, const su2double *xyz, const unsigned short *lmn) const { - +su2double CFreeFormDefBox::GetDerivative2(su2double* uvw, unsigned short dim, const su2double* xyz, + const unsigned short* lmn) const { unsigned short iDegree, jDegree, kDegree; su2double value = 0.0; for (iDegree = 0; iDegree <= lmn[0]; iDegree++) for (jDegree = 0; jDegree <= lmn[1]; jDegree++) for (kDegree = 0; kDegree <= lmn[2]; kDegree++) { - value += Coord_Control_Points[iDegree][jDegree][kDegree][dim] - * BlendingFunction[0]->GetBasis(iDegree, uvw[0]) - * BlendingFunction[1]->GetBasis(jDegree, uvw[1]) - * BlendingFunction[2]->GetBasis(kDegree, uvw[2]); + value += Coord_Control_Points[iDegree][jDegree][kDegree][dim] * BlendingFunction[0]->GetBasis(iDegree, uvw[0]) * + BlendingFunction[1]->GetBasis(jDegree, uvw[1]) * BlendingFunction[2]->GetBasis(kDegree, uvw[2]); } - return 2.0*(value - xyz[dim]); + return 2.0 * (value - xyz[dim]); } -su2double CFreeFormDefBox::GetDerivative3(su2double *uvw, unsigned short dim, unsigned short diff_this, unsigned short *lmn) { - +su2double CFreeFormDefBox::GetDerivative3(su2double* uvw, unsigned short dim, unsigned short diff_this, + unsigned short* lmn) const { unsigned short iDegree, jDegree, kDegree, iDim; su2double value = 0; - unsigned short *ijk = new unsigned short[nDim]; + auto* ijk = new unsigned short[nDim]; for (iDim = 0; iDim < nDim; iDim++) ijk[iDim] = 0; for (iDegree = 0; iDegree <= lmn[0]; iDegree++) for (jDegree = 0; jDegree <= lmn[1]; jDegree++) for (kDegree = 0; kDegree <= lmn[2]; kDegree++) { - ijk[0] = iDegree; ijk[1] = jDegree; ijk[2] = kDegree; - value += Coord_Control_Points[iDegree][jDegree][kDegree][dim] * - GetDerivative1(uvw, diff_this, ijk, lmn); + ijk[0] = iDegree; + ijk[1] = jDegree; + ijk[2] = kDegree; + value += Coord_Control_Points[iDegree][jDegree][kDegree][dim] * GetDerivative1(uvw, diff_this, ijk, lmn); } - delete [] ijk; + delete[] ijk; return value; } -su2double CFreeFormDefBox::GetDerivative4(su2double *uvw, unsigned short val_diff, unsigned short val_diff2, - unsigned short *ijk, unsigned short *lmn) const { +su2double CFreeFormDefBox::GetDerivative4(su2double* uvw, unsigned short val_diff, unsigned short val_diff2, + unsigned short* ijk, unsigned short* lmn) const { unsigned short iDim; su2double value = 0.0; if (val_diff == val_diff2) { value = BlendingFunction[val_diff]->GetDerivative(ijk[val_diff], uvw[val_diff], 2); for (iDim = 0; iDim < nDim; iDim++) - if (iDim != val_diff) - value *= BlendingFunction[iDim]->GetBasis(ijk[iDim], uvw[iDim]); - } - else { - value = BlendingFunction[val_diff]->GetDerivative(ijk[val_diff], uvw[val_diff],1) * - BlendingFunction[val_diff2]->GetDerivative(ijk[val_diff2], uvw[val_diff2], 1); + if (iDim != val_diff) value *= BlendingFunction[iDim]->GetBasis(ijk[iDim], uvw[iDim]); + } else { + value = BlendingFunction[val_diff]->GetDerivative(ijk[val_diff], uvw[val_diff], 1) * + BlendingFunction[val_diff2]->GetDerivative(ijk[val_diff2], uvw[val_diff2], 1); for (iDim = 0; iDim < nDim; iDim++) - if ((iDim != val_diff) && (iDim != val_diff2)) - value *= BlendingFunction[iDim]->GetBasis(ijk[iDim], uvw[iDim]); + if ((iDim != val_diff) && (iDim != val_diff2)) value *= BlendingFunction[iDim]->GetBasis(ijk[iDim], uvw[iDim]); } return value; } -su2double CFreeFormDefBox::GetDerivative5(su2double *uvw, unsigned short dim, unsigned short diff_this, unsigned short diff_this_also, - unsigned short *lmn) { - +su2double CFreeFormDefBox::GetDerivative5(su2double* uvw, unsigned short dim, unsigned short diff_this, + unsigned short diff_this_also, unsigned short* lmn) const { unsigned short iDegree, jDegree, kDegree, iDim; su2double value = 0.0; - unsigned short *ijk = new unsigned short[nDim]; + auto* ijk = new unsigned short[nDim]; for (iDim = 0; iDim < nDim; iDim++) ijk[iDim] = 0; for (iDegree = 0; iDegree <= lmn[0]; iDegree++) for (jDegree = 0; jDegree <= lmn[1]; jDegree++) for (kDegree = 0; kDegree <= lmn[2]; kDegree++) { - ijk[0] = iDegree; ijk[1] = jDegree; ijk[2] = kDegree; + ijk[0] = iDegree; + ijk[1] = jDegree; + ijk[2] = kDegree; value += Coord_Control_Points[iDegree][jDegree][kDegree][dim] * - GetDerivative4(uvw, diff_this, diff_this_also, ijk, lmn); + GetDerivative4(uvw, diff_this, diff_this_also, ijk, lmn); } - delete [] ijk; + delete[] ijk; return value; } diff --git a/Common/src/grid_movement/CGridMovement.cpp b/Common/src/grid_movement/CGridMovement.cpp index 3ead32ae339..f02bb94d552 100644 --- a/Common/src/grid_movement/CGridMovement.cpp +++ b/Common/src/grid_movement/CGridMovement.cpp @@ -2,7 +2,7 @@ * \file CGridMovement.cpp * \brief Parent class for grid movement classes * \author F. Palacios, T. Economon, S. Padron - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,6 +27,6 @@ #include "../../include/grid_movement/CGridMovement.hpp" -CGridMovement::CGridMovement(void) { } +CGridMovement::CGridMovement() = default; -CGridMovement::~CGridMovement(void) { } +CGridMovement::~CGridMovement() = default; diff --git a/Common/src/grid_movement/CSurfaceMovement.cpp b/Common/src/grid_movement/CSurfaceMovement.cpp index 308bd9a8b42..ea9dc6f374c 100644 --- a/Common/src/grid_movement/CSurfaceMovement.cpp +++ b/Common/src/grid_movement/CSurfaceMovement.cpp @@ -2,7 +2,7 @@ * \file CSurfaceMovement.cpp * \brief Subroutines for moving mesh surface elements * \author F. Palacios, T. Economon, S. Padron - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,9 +27,9 @@ #include "../../include/grid_movement/CSurfaceMovement.hpp" #include "../../include/toolboxes/C1DInterpolation.hpp" +#include "../../include/toolboxes/geometry_toolbox.hpp" -CSurfaceMovement::CSurfaceMovement(void) : CGridMovement() { - +CSurfaceMovement::CSurfaceMovement() : CGridMovement() { size = SU2_MPI::GetSize(); rank = SU2_MPI::GetRank(); @@ -38,20 +38,19 @@ CSurfaceMovement::CSurfaceMovement(void) : CGridMovement() { FFDBoxDefinition = false; } -CSurfaceMovement::~CSurfaceMovement(void) {} - -vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *geometry, CConfig *config) { +CSurfaceMovement::~CSurfaceMovement() = default; +vector > CSurfaceMovement::SetSurface_Deformation(CGeometry* geometry, CConfig* config) { unsigned short iFFDBox, iDV, iLevel, iChild, iParent, jFFDBox, iMarker; - unsigned short Degree_Unitary [] = {1,1,1}, BSpline_Unitary [] = {2,2,2}; + unsigned short Degree_Unitary[] = {1, 1, 1}, BSpline_Unitary[] = {2, 2, 2}; su2double MaxDiff, Current_Scale, Ratio, New_Scale; string FFDBoxTag; bool allmoving; const bool cylindrical = (config->GetFFD_CoordSystem() == CYLINDRICAL); - const bool spherical = (config->GetFFD_CoordSystem() == SPHERICAL); - const bool polar = (config->GetFFD_CoordSystem() == POLAR); - const bool cartesian = (config->GetFFD_CoordSystem() == CARTESIAN); + const bool spherical = (config->GetFFD_CoordSystem() == SPHERICAL); + const bool polar = (config->GetFFD_CoordSystem() == POLAR); + const bool cartesian = (config->GetFFD_CoordSystem() == CARTESIAN); const su2double BoundLimit = config->GetOpt_LineSearch_Bound(); vector > totaldeformation; @@ -59,7 +58,6 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g /*--- Setting the Free Form Deformation ---*/ if (config->GetDesign_Variable(0) == FFD_SETTING) { - /*--- Definition of the FFD deformation class ---*/ FFDBox = new CFreeFormDefBox*[MAX_NUMBER_FFD]; @@ -71,15 +69,13 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g /*--- If there is a FFDBox in the input file ---*/ if (nFFDBox != 0) { - /*--- if polar coordinates, trnasform the corner to polar ---*/ if (cylindrical) { for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { FFDBox[iFFDBox]->SetCart2Cyl_CornerPoints(config); } - } - else if (spherical || polar) { + } else if (spherical || polar) { for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { FFDBox[iFFDBox]->SetCart2Sphe_CornerPoints(config); } @@ -88,10 +84,14 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g /*--- If the FFDBox was not defined in the input file ---*/ if ((rank == MASTER_NODE) && (GetnFFDBox() != 0)) { - if (cartesian) cout << endl <<"----------------- FFD technique (cartesian -> parametric) ---------------" << endl; - else if (cylindrical) cout << endl <<"----------------- FFD technique (cylinder -> parametric) ---------------" << endl; - else if (spherical) cout << endl <<"----------------- FFD technique (spherical -> parametric) ---------------" << endl; - else if (polar) cout << endl <<"----------------- FFD technique (polar -> parametric) ---------------" << endl; + if (cartesian) + cout << endl << "----------------- FFD technique (cartesian -> parametric) ---------------" << endl; + else if (cylindrical) + cout << endl << "----------------- FFD technique (cylinder -> parametric) ---------------" << endl; + else if (spherical) + cout << endl << "----------------- FFD technique (spherical -> parametric) ---------------" << endl; + else if (polar) + cout << endl << "----------------- FFD technique (polar -> parametric) ---------------" << endl; } /*--- Create a unitary FFDBox as baseline for other FFDBoxes shapes ---*/ @@ -104,7 +104,6 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g FFDBox_unitary.SetControlPoints_Parallelepiped(); for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { - /*--- Compute the support control points for the final FFD using the unitary box ---*/ FFDBox_unitary.SetSupportCP(FFDBox[iFFDBox]); @@ -118,14 +117,12 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g SetParametricCoord(geometry, config, FFDBox[iFFDBox], iFFDBox); - /*--- If polar coordinates, transform the corners and control points to cartesians ---*/ if (cylindrical) { FFDBox[iFFDBox]->SetCyl2Cart_CornerPoints(config); FFDBox[iFFDBox]->SetCyl2Cart_ControlPoints(config); - } - else if (spherical || polar) { + } else if (spherical || polar) { FFDBox[iFFDBox]->SetSphe2Cart_CornerPoints(config); FFDBox[iFFDBox]->SetSphe2Cart_ControlPoints(config); } @@ -133,7 +130,7 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g /*--- Output original FFD FFDBox ---*/ if (rank == MASTER_NODE) { - for (unsigned short iFile = 0; iFile < config->GetnVolumeOutputFiles(); iFile++){ + for (unsigned short iFile = 0; iFile < config->GetnVolumeOutputFiles(); iFile++) { auto FileFormat = config->GetVolumeOutputFiles(); if (isParaview(FileFormat[iFile])) { cout << "Writing a Paraview file of the FFD boxes." << endl; @@ -145,8 +142,7 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { FFDBox[iFFDBox]->SetTecplot(geometry, iFFDBox, true); } - } - else if (FileFormat[iFile] == OUTPUT_TYPE::CGNS) { + } else if (FileFormat[iFile] == OUTPUT_TYPE::CGNS) { cout << "Writing a CGNS file of the FFD boxes." << endl; for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { FFDBox[iFFDBox]->SetCGNS(geometry, iFFDBox, true); @@ -159,25 +155,16 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g else { SU2_MPI::Error("There are no FFD boxes in the mesh file!!", CURRENT_FUNCTION); } - } /*--- Free Form deformation based ---*/ - if ((config->GetDesign_Variable(0) == FFD_CONTROL_POINT_2D) || - (config->GetDesign_Variable(0) == FFD_CAMBER_2D) || - (config->GetDesign_Variable(0) == FFD_THICKNESS_2D) || - (config->GetDesign_Variable(0) == FFD_TWIST_2D) || - (config->GetDesign_Variable(0) == FFD_CONTROL_POINT) || - (config->GetDesign_Variable(0) == FFD_NACELLE) || - (config->GetDesign_Variable(0) == FFD_GULL) || - (config->GetDesign_Variable(0) == FFD_TWIST) || - (config->GetDesign_Variable(0) == FFD_ROTATION) || - (config->GetDesign_Variable(0) == FFD_CONTROL_SURFACE) || - (config->GetDesign_Variable(0) == FFD_CAMBER) || - (config->GetDesign_Variable(0) == FFD_THICKNESS) || - (config->GetDesign_Variable(0) == FFD_ANGLE_OF_ATTACK)) { - + if ((config->GetDesign_Variable(0) == FFD_CONTROL_POINT_2D) || (config->GetDesign_Variable(0) == FFD_CAMBER_2D) || + (config->GetDesign_Variable(0) == FFD_THICKNESS_2D) || (config->GetDesign_Variable(0) == FFD_CONTROL_POINT) || + (config->GetDesign_Variable(0) == FFD_NACELLE) || (config->GetDesign_Variable(0) == FFD_GULL) || + (config->GetDesign_Variable(0) == FFD_TWIST) || (config->GetDesign_Variable(0) == FFD_ROTATION) || + (config->GetDesign_Variable(0) == FFD_CONTROL_SURFACE) || (config->GetDesign_Variable(0) == FFD_CAMBER) || + (config->GetDesign_Variable(0) == FFD_THICKNESS) || (config->GetDesign_Variable(0) == FFD_ANGLE_OF_ATTACK)) { /*--- Definition of the FFD deformation class ---*/ FFDBox = new CFreeFormDefBox*[MAX_NUMBER_FFD]; @@ -189,20 +176,22 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g /*--- If there is a FFDBox in the input file ---*/ if (nFFDBox != 0) { - /*--- If the FFDBox was not defined in the input file ---*/ if (!GetFFDBoxDefinition()) { - SU2_MPI::Error(string("There is not FFD box definition in the mesh file,\n") + - string("run DV_KIND=FFD_SETTING first !!"), CURRENT_FUNCTION); + SU2_MPI::Error( + string("There is not FFD box definition in the mesh file,\n") + string("run DV_KIND=FFD_SETTING first !!"), + CURRENT_FUNCTION); } /* --- Check if the FFD boxes referenced in the design variable definition can be found --- */ for (iDV = 0; iDV < config->GetnDV(); iDV++) { if (!CheckFFDBoxDefinition(config, iDV)) { - SU2_MPI::Error(string("There is no FFD box with tag \"") + config->GetFFDTag(iDV) + string("\" defined in the mesh file.\n") + - string("Check the definition of the design variables and/or the FFD settings !!"), CURRENT_FUNCTION); + SU2_MPI::Error(string("There is no FFD box with tag \"") + config->GetFFDTag(iDV) + + string("\" defined in the mesh file.\n") + + string("Check the definition of the design variables and/or the FFD settings !!"), + CURRENT_FUNCTION); } } @@ -210,14 +199,14 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g if (config->GetnMarker_DV() == 0) { SU2_MPI::Error(string("No markers are specified in DV_MARKER, so no deformation will occur.\n") + - string("List markers to be deformed in DV_MARKER."), CURRENT_FUNCTION); + string("List markers to be deformed in DV_MARKER."), + CURRENT_FUNCTION); } /*--- Output original FFD FFDBox ---*/ if ((rank == MASTER_NODE) && (config->GetKind_SU2() != SU2_COMPONENT::SU2_DOT)) { - - for (unsigned short iFile = 0; iFile < config->GetnVolumeOutputFiles(); iFile++){ + for (unsigned short iFile = 0; iFile < config->GetnVolumeOutputFiles(); iFile++) { auto FileFormat = config->GetVolumeOutputFiles(); if (isParaview(FileFormat[iFile])) { @@ -230,8 +219,7 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { FFDBox[iFFDBox]->SetTecplot(geometry, iFFDBox, true); } - } - else if (FileFormat[iFile] == OUTPUT_TYPE::CGNS) { + } else if (FileFormat[iFile] == OUTPUT_TYPE::CGNS) { cout << "Writing a CGNS file of the FFD boxes." << endl; for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { FFDBox[iFFDBox]->SetCGNS(geometry, iFFDBox, true); @@ -247,8 +235,7 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g FFDBox[iFFDBox]->SetCart2Cyl_CornerPoints(config); FFDBox[iFFDBox]->SetCart2Cyl_ControlPoints(config); } - } - else if (spherical || polar) { + } else if (spherical || polar) { for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { FFDBox[iFFDBox]->SetCart2Sphe_CornerPoints(config); FFDBox[iFFDBox]->SetCart2Sphe_ControlPoints(config); @@ -258,20 +245,17 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g /*--- Apply the deformation to the orifinal FFD box ---*/ if ((rank == MASTER_NODE) && (GetnFFDBox() != 0)) - cout << endl <<"----------------- FFD technique (parametric -> cartesian) ---------------" << endl; + cout << endl << "----------------- FFD technique (parametric -> cartesian) ---------------" << endl; /*--- Loop over all the FFD boxes levels ---*/ for (iLevel = 0; iLevel < GetnLevel(); iLevel++) { - /*--- Loop over all FFD FFDBoxes ---*/ for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { - /*--- Check the level of the FFD box ---*/ if (FFDBox[iFFDBox]->GetLevel() == iLevel) { - /*--- Check the dimension of the FFD compared with the design variables ---*/ if (rank == MASTER_NODE) cout << "Checking FFD box dimension." << endl; @@ -305,12 +289,12 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g MaxDiff = SetCartesianCoord(geometry, config, FFDBox[iFFDBox], iFFDBox, false); if ((MaxDiff > BoundLimit) && (config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF)) { - - if (rank == MASTER_NODE) cout << "Out-of-bounds, re-adjusting scale factor to safisfy line search limit." << endl; + if (rank == MASTER_NODE) + cout << "Out-of-bounds, re-adjusting scale factor to safisfy line search limit." << endl; Current_Scale = config->GetOpt_RelaxFactor(); - Ratio = (BoundLimit/MaxDiff); - New_Scale = Current_Scale *(Ratio-1.0); + Ratio = (BoundLimit / MaxDiff); + New_Scale = Current_Scale * (Ratio - 1.0); config->SetOpt_RelaxFactor(New_Scale); /*--- Apply the design variables to the control point position ---*/ @@ -319,12 +303,10 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g /*--- Recompute cartesian coordinates using the new control point location ---*/ MaxDiff = SetCartesianCoord(geometry, config, FFDBox[iFFDBox], iFFDBox, false); - } /*--- Set total deformation values in config ---*/ if (config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF) { - totaldeformation.resize(config->GetnDV()); for (iDV = 0; iDV < config->GetnDV(); iDV++) { totaldeformation[iDV].resize(config->GetnDV_Value(iDV)); @@ -352,7 +334,6 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g /*--- If enabled: start recursive procedure to decrease deformation magnitude to remove self-intersections in FFD box ---*/ if (nNegativeDeterminants > 0) { - if (rank == MASTER_NODE) { cout << "Self-intersections within FFD box present. "; cout << "Performing iterative deformation reduction procedure." << endl; @@ -362,8 +343,8 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g for (iDV = 0; iDV < config->GetnDV(); iDV++) { for (auto iDV_Value = 0u; iDV_Value < config->GetnDV_Value(iDV); iDV_Value++) { auto dv_value = config->GetDV_Value(iDV, iDV_Value); - config->SetDV_Value(iDV, iDV_Value, -dv_value/2); - totaldeformation[iDV][iDV_Value] -= dv_value/2; + config->SetDV_Value(iDV, iDV_Value, -dv_value / 2); + totaldeformation[iDV][iDV_Value] -= dv_value / 2; } } @@ -374,18 +355,16 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g /*--- Recursively check for self-intersections. ---*/ unsigned short FFD_IntPrev_Iter, FFD_IntPrev_Depth = 0; - for (FFD_IntPrev_Iter = 1; FFD_IntPrev_Iter <= FFD_IntPrev_MaxIter; FFD_IntPrev_Iter++){ - + for (FFD_IntPrev_Iter = 1; FFD_IntPrev_Iter <= FFD_IntPrev_MaxIter; FFD_IntPrev_Iter++) { if (rank == MASTER_NODE) cout << "Checking FFD box intersections with the solid surfaces." << endl; - CheckFFDIntersections(geometry, config, FFDBox[iFFDBox], iFFDBox); + CheckFFDIntersections(geometry, config, FFDBox[iFFDBox], iFFDBox); /*--- Compute the parametric coordinates of the child box control points (using the parent FFDBox) ---*/ for (iChild = 0; iChild < FFDBox[iFFDBox]->GetnChildFFDBox(); iChild++) { FFDBoxTag = FFDBox[iFFDBox]->GetChildFFDBoxTag(iChild); for (jFFDBox = 0; jFFDBox < GetnFFDBox(); jFFDBox++) - if (FFDBoxTag == FFDBox[jFFDBox]->GetTag()) - break; + if (FFDBoxTag == FFDBox[jFFDBox]->GetTag()) break; SetParametricCoordCP(geometry, config, FFDBox[iFFDBox], FFDBox[jFFDBox]); } @@ -405,13 +384,14 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g if (rank == MASTER_NODE) { cout << "Amount of points with negative Jacobian determinant for iteration "; cout << FFD_IntPrev_Iter << ": " << nNegativeDeterminants << endl; - cout << "Remaining amount of original deformation: " << DeformationFactor*100.0 << " percent." << endl; + cout << "Remaining amount of original deformation: " << DeformationFactor * 100.0 << " percent." + << endl; } /*--- Recursively change deformation magnitude. Increase if there are no points with negative determinants, decrease otherwise. ---*/ - if (nNegativeDeterminants == 0){ - DeformationDifference = abs(DeformationDifference/2.0); + if (nNegativeDeterminants == 0) { + DeformationDifference = abs(DeformationDifference / 2.0); /*--- Update recursion depth if there are no points with negative determinant. Quit if maximum depth is reached. ---*/ @@ -421,12 +401,12 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g if (rank == MASTER_NODE) { cout << "Maximum recursion depth reached." << endl; cout << "Remaining amount of original deformation: " << endl; - cout << DeformationFactor*100.0 << " percent." << endl; + cout << DeformationFactor * 100.0 << " percent." << endl; } break; } } else { - DeformationDifference = -abs(DeformationDifference/2.0); + DeformationDifference = -abs(DeformationDifference / 2.0); } if (FFD_IntPrev_Iter < FFD_IntPrev_MaxIter) { @@ -438,23 +418,22 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g if (FFD_IntPrev_Iter < FFD_IntPrev_MaxIter) { su2double sign = -1.0; if ((nNegativeDeterminants_previous > 0 && nNegativeDeterminants > 0) || - (nNegativeDeterminants_previous == 0 && nNegativeDeterminants == 0)){ + (nNegativeDeterminants_previous == 0 && nNegativeDeterminants == 0)) { sign = 1.0; } for (iDV = 0; iDV < config->GetnDV(); iDV++) { for (auto iDV_Value = 0u; iDV_Value < config->GetnDV_Value(iDV); iDV_Value++) { auto dv_value = sign * config->GetDV_Value(iDV, iDV_Value); - config->SetDV_Value(iDV, iDV_Value, dv_value/2.0); - totaldeformation[iDV][iDV_Value] += dv_value/2.0; + config->SetDV_Value(iDV, iDV_Value, dv_value / 2.0); + totaldeformation[iDV][iDV_Value] += dv_value / 2.0; } } } nNegativeDeterminants_previous = nNegativeDeterminants; } - } - } // end SU2_DEF + } // end SU2_DEF /*--- Reparametrization of the parent FFD box ---*/ @@ -484,8 +463,7 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g FFDBox[iFFDBox]->SetCyl2Cart_CornerPoints(config); FFDBox[iFFDBox]->SetCyl2Cart_ControlPoints(config); } - } - else if (spherical || polar) { + } else if (spherical || polar) { for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { FFDBox[iFFDBox]->SetSphe2Cart_CornerPoints(config); FFDBox[iFFDBox]->SetSphe2Cart_ControlPoints(config); @@ -495,8 +473,7 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g /*--- Output the deformed FFD Boxes ---*/ if ((rank == MASTER_NODE) && (config->GetKind_SU2() != SU2_COMPONENT::SU2_DOT)) { - - for (unsigned short iFile = 0; iFile < config->GetnVolumeOutputFiles(); iFile++){ + for (unsigned short iFile = 0; iFile < config->GetnVolumeOutputFiles(); iFile++) { auto FileFormat = config->GetVolumeOutputFiles(); if (isParaview(FileFormat[iFile])) { @@ -509,8 +486,7 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { FFDBox[iFFDBox]->SetTecplot(geometry, iFFDBox, false); } - } - else if (FileFormat[iFile] == OUTPUT_TYPE::CGNS) { + } else if (FileFormat[iFile] == OUTPUT_TYPE::CGNS) { cout << "Writing a CGNS file of the FFD boxes." << endl; for (iFFDBox = 0; iFFDBox < GetnFFDBox(); iFFDBox++) { FFDBox[iFFDBox]->SetCGNS(geometry, iFFDBox, false); @@ -530,7 +506,6 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g /*--- External surface file based ---*/ else if (config->GetDesign_Variable(0) == SURFACE_FILE) { - /*--- Check whether a surface file exists for input ---*/ ofstream Surface_File; string filename = config->GetDV_Filename(); @@ -539,13 +514,13 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g /*--- A surface file does not exist, so write a new one for the markers that are specified as part of the motion. ---*/ if (Surface_File.fail()) { - if (rank == MASTER_NODE && size == SINGLE_NODE) { cout << "No surface positions file found. Writing a template file: " << filename << "." << endl; Surface_File.open(filename.c_str(), ios::out); Surface_File.precision(15); - unsigned long iMarker, jPoint, GlobalIndex, iVertex; su2double *Coords; + unsigned long iMarker, jPoint, GlobalIndex, iVertex; + su2double* Coords; for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if (config->GetMarker_All_DV(iMarker) == YES) { for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { @@ -553,15 +528,20 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g GlobalIndex = geometry->nodes->GetGlobalIndex(jPoint); Coords = geometry->nodes->GetCoord(jPoint); Surface_File << GlobalIndex << "\t" << Coords[0] << "\t" << Coords[1]; - if (geometry->GetnDim() == 2) Surface_File << endl; - else Surface_File << "\t" << Coords[2] << endl; + if (geometry->GetnDim() == 2) + Surface_File << endl; + else + Surface_File << "\t" << Coords[2] << endl; } } } Surface_File.close(); } else { - SU2_MPI::Error("No surface positions file found and template writing not yet supported in parallel.\n To generate a template surface positions file, run SU2_DEF again in serial.", CURRENT_FUNCTION); + SU2_MPI::Error( + "No surface positions file found and template writing not yet supported in parallel.\n To generate a " + "template surface positions file, run SU2_DEF again in serial.", + CURRENT_FUNCTION); } } @@ -574,45 +554,53 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g } - else if ((config->GetDesign_Variable(0) == ROTATION) || - (config->GetDesign_Variable(0) == TRANSLATION) || - (config->GetDesign_Variable(0) == SCALE) || - (config->GetDesign_Variable(0) == HICKS_HENNE) || - (config->GetDesign_Variable(0) == SURFACE_BUMP) || - (config->GetDesign_Variable(0) == ANGLE_OF_ATTACK)) { - + else if ((config->GetDesign_Variable(0) == ROTATION) || (config->GetDesign_Variable(0) == TRANSLATION) || + (config->GetDesign_Variable(0) == SCALE) || (config->GetDesign_Variable(0) == HICKS_HENNE) || + (config->GetDesign_Variable(0) == SURFACE_BUMP) || (config->GetDesign_Variable(0) == ANGLE_OF_ATTACK)) { /*--- Apply rotation, displacement and stretching design variables (this should be done before the bump function design variables) ---*/ for (iDV = 0; iDV < config->GetnDV(); iDV++) { - switch ( config->GetDesign_Variable(iDV) ) { - case SCALE : SetScale(geometry, config, iDV, false); break; - case TRANSLATION : SetTranslation(geometry, config, iDV, false); break; - case ROTATION : SetRotation(geometry, config, iDV, false); break; + switch (config->GetDesign_Variable(iDV)) { + case SCALE: + SetScale(geometry, config, iDV, false); + break; + case TRANSLATION: + SetTranslation(geometry, config, iDV, false); + break; + case ROTATION: + SetRotation(geometry, config, iDV, false); + break; } } /*--- Apply the design variables to the control point position ---*/ for (iDV = 0; iDV < config->GetnDV(); iDV++) { - switch ( config->GetDesign_Variable(iDV) ) { - case HICKS_HENNE : SetHicksHenne(geometry, config, iDV, false); break; + switch (config->GetDesign_Variable(iDV)) { + case HICKS_HENNE: + SetHicksHenne(geometry, config, iDV, false); + break; } } /*--- Apply the design variables to the control point position ---*/ for (iDV = 0; iDV < config->GetnDV(); iDV++) { - switch ( config->GetDesign_Variable(iDV) ) { - case SURFACE_BUMP : SetSurface_Bump(geometry, config, iDV, false); break; + switch (config->GetDesign_Variable(iDV)) { + case SURFACE_BUMP: + SetSurface_Bump(geometry, config, iDV, false); + break; } } /*--- Apply the angle of attack design variable ---*/ for (iDV = 0; iDV < config->GetnDV(); iDV++) { - switch ( config->GetDesign_Variable(iDV) ) { - case ANGLE_OF_ATTACK : SetAngleOfAttack(geometry, config, iDV, false); break; + switch (config->GetDesign_Variable(iDV)) { + case ANGLE_OF_ATTACK: + SetAngleOfAttack(geometry, config, iDV, false); + break; } } @@ -620,29 +608,32 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g /*--- NACA_4Digits design variable ---*/ - else if (config->GetDesign_Variable(0) == NACA_4DIGITS) { SetNACA_4Digits(geometry, config); } + else if (config->GetDesign_Variable(0) == NACA_4DIGITS) { + SetNACA_4Digits(geometry, config); + } /*--- Parabolic airfoil design variable ---*/ - else if (config->GetDesign_Variable(0) == PARABOLIC) { SetParabolic(geometry, config); } + else if (config->GetDesign_Variable(0) == PARABOLIC) { + SetParabolic(geometry, config); + } /*--- Airfoil from file design variable ---*/ - else if (config->GetDesign_Variable(0) == AIRFOIL) { SetAirfoil(geometry, config); } + else if (config->GetDesign_Variable(0) == AIRFOIL) { + SetAirfoil(geometry, config); + } /*--- FFD setting ---*/ else if (config->GetDesign_Variable(0) == FFD_SETTING) { - if (rank == MASTER_NODE) - cout << "No surface deformation (setting FFD)." << endl; + if (rank == MASTER_NODE) cout << "No surface deformation (setting FFD)." << endl; } /*--- Scale, Translate, and Rotate will be done with rigid mesh transforms. ---*/ - else if ((config->GetDesign_Variable(0) == ROTATION) || - (config->GetDesign_Variable(0) == TRANSLATION) || + else if ((config->GetDesign_Variable(0) == ROTATION) || (config->GetDesign_Variable(0) == TRANSLATION) || (config->GetDesign_Variable(0) == SCALE)) { - /*--- If all markers are deforming, use volume method. If only some are deforming, use surface method ---*/ @@ -653,52 +644,41 @@ vector > CSurfaceMovement::SetSurface_Deformation(CGeometry *g /*--- Loop over markers ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if (config->GetMarker_All_DV(iMarker) == NO) - allmoving = false; + if (config->GetMarker_All_DV(iMarker) == NO) allmoving = false; } if (!allmoving) { /*---Only some markers are moving, use the surface method ---*/ - if (config->GetDesign_Variable(0) == ROTATION) - SetRotation(geometry, config, iDV, false); - if (config->GetDesign_Variable(0) == SCALE) - SetScale(geometry, config, iDV, false); - if (config->GetDesign_Variable(0) == TRANSLATION) - SetTranslation(geometry, config, iDV, false); - } - else { - if (rank == MASTER_NODE) - cout << "No surface deformation (scaling, rotation, or translation)." << endl; + if (config->GetDesign_Variable(0) == ROTATION) SetRotation(geometry, config, iDV, false); + if (config->GetDesign_Variable(0) == SCALE) SetScale(geometry, config, iDV, false); + if (config->GetDesign_Variable(0) == TRANSLATION) SetTranslation(geometry, config, iDV, false); + } else { + if (rank == MASTER_NODE) cout << "No surface deformation (scaling, rotation, or translation)." << endl; } } /*--- Design variable not implement ---*/ else { - if (rank == MASTER_NODE) - cout << "Design Variable not implemented yet" << endl; + if (rank == MASTER_NODE) cout << "Design Variable not implemented yet" << endl; } return totaldeformation; } - -void CSurfaceMovement::SetSurface_Derivative(CGeometry *geometry, CConfig *config) { - +void CSurfaceMovement::SetSurface_Derivative(CGeometry* geometry, CConfig* config) { su2double DV_Value = 0.0; unsigned short iDV = 0, iDV_Value = 0; for (iDV = 0; iDV < config->GetnDV(); iDV++) { for (iDV_Value = 0; iDV_Value < config->GetnDV_Value(iDV); iDV_Value++) { - DV_Value = config->GetDV_Value(iDV, iDV_Value); /*--- If value of the design variable is not 0.0 we apply the differentation. - * Note if multiple variables are non-zero, we end up with the sum of all the derivatives. ---*/ + * Note if multiple variables are non-zero, we end up with the sum of all the derivatives. ---*/ if (DV_Value != 0.0) { - DV_Value = 0.0; SU2_TYPE::SetDerivative(DV_Value, 1.0); @@ -713,11 +693,10 @@ void CSurfaceMovement::SetSurface_Derivative(CGeometry *geometry, CConfig *confi SetSurface_Deformation(geometry, config); } -void CSurfaceMovement::CopyBoundary(CGeometry *geometry, CConfig *config) { - +void CSurfaceMovement::CopyBoundary(CGeometry* geometry, CConfig* config) { unsigned short iMarker; unsigned long iVertex, iPoint; - su2double *Coord; + su2double* Coord; for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { @@ -726,183 +705,201 @@ void CSurfaceMovement::CopyBoundary(CGeometry *geometry, CConfig *config) { geometry->vertex[iMarker][iVertex]->SetCoord(Coord); } } - } -void CSurfaceMovement::SetParametricCoord(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iFFDBox) { - - unsigned short iMarker, iDim, iOrder, jOrder, kOrder, lOrder, mOrder, nOrder; - unsigned long iVertex, iPoint, TotalVertex = 0; - su2double *CartCoordNew, *ParamCoord, CartCoord[3], ParamCoordGuess[3], MaxDiff, my_MaxDiff = 0.0, Diff, *Coord; - unsigned short nDim = geometry->GetnDim(); - su2double X_0, Y_0, Z_0, Xbar, Ybar, Zbar; - - unsigned short BoxFFD = true; - bool cylindrical = (config->GetFFD_CoordSystem() == CYLINDRICAL); - bool spherical = (config->GetFFD_CoordSystem() == SPHERICAL); - bool polar = (config->GetFFD_CoordSystem() == POLAR); +void CSurfaceMovement::SetParametricCoord(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, + unsigned short iFFDBox) { + const auto nDim = geometry->GetnDim(); + const bool cartesian = (config->GetFFD_CoordSystem() == CARTESIAN); + const bool cylindrical = (config->GetFFD_CoordSystem() == CYLINDRICAL); + const bool spherical = (config->GetFFD_CoordSystem() == SPHERICAL); + const bool polar = (config->GetFFD_CoordSystem() == POLAR); - /*--- Change order and control points reduce the - complexity of the point inversion (this only works with boxes, - in case of Bezier curves, and we maintain an internal copy)---*/ + /*--- Change order and control points reduce the complexity of the point inversion + (this only works with boxes, in case of Bezier curves, and we maintain an internal copy). ---*/ + const bool BoxFFD = true; if (BoxFFD && (config->GetFFD_Blending() == BEZIER)) { - - for (iOrder = 0; iOrder < 2; iOrder++) { - for (jOrder = 0; jOrder < 2; jOrder++) { - for (kOrder = 0; kOrder < 2; kOrder++) { - - lOrder = 0; mOrder = 0; nOrder = 0; - if (iOrder == 1) {lOrder = FFDBox->GetlOrder()-1;} - if (jOrder == 1) {mOrder = FFDBox->GetmOrder()-1;} - if (kOrder == 1) {nOrder = FFDBox->GetnOrder()-1;} - - Coord = FFDBox->GetCoordControlPoints(lOrder, mOrder, nOrder); + for (int iOrder = 0; iOrder < 2; iOrder++) { + for (int jOrder = 0; jOrder < 2; jOrder++) { + for (int kOrder = 0; kOrder < 2; kOrder++) { + unsigned short lOrder = 0; + unsigned short mOrder = 0; + unsigned short nOrder = 0; + if (iOrder == 1) { + lOrder = FFDBox->GetlOrder() - 1; + } + if (jOrder == 1) { + mOrder = FFDBox->GetmOrder() - 1; + } + if (kOrder == 1) { + nOrder = FFDBox->GetnOrder() - 1; + } + const auto* Coord = FFDBox->GetCoordControlPoints(lOrder, mOrder, nOrder); FFDBox->SetCoordControlPoints(Coord, iOrder, jOrder, kOrder); - } } } - FFDBox->SetlOrder(2); FFDBox->SetmOrder(2); FFDBox->SetnOrder(2); + FFDBox->SetlOrder(2); + FFDBox->SetmOrder(2); + FFDBox->SetnOrder(2); FFDBox->SetnControlPoints(); FFDBox->BlendingFunction[0]->SetOrder(2, 2); FFDBox->BlendingFunction[1]->SetOrder(2, 2); FFDBox->BlendingFunction[2]->SetOrder(2, 2); } - /*--- Point inversion algorithm with a basic box ---*/ - - ParamCoordGuess[0] = 0.5; ParamCoordGuess[1] = 0.5; ParamCoordGuess[2] = 0.5; - CartCoord[0] = 0.0; CartCoord[1] = 0.0; CartCoord[2] = 0.0; - /*--- Count the number of vertices ---*/ + /*--- Point inversion algorithm with a basic box ---*/ - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) - if (config->GetMarker_All_DV(iMarker) == YES) - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) - TotalVertex++; + su2double my_MaxDiff = 0.0; + unsigned long TotalVertex = 0; + unsigned long VisitedVertex = 0; + unsigned long MappedVertex = 0; + su2double ParamCoordGuess[3] = {0.5, 0.5, 0.5}; + + /*--- Check that the box is defined correctly for the preliminary point containment check, + * by checking that the midpoint of the box is considered to be inside it. ---*/ + + su2double BoxMidPoint[3] = {}; + for (int iOrder = 0; iOrder < 2; iOrder++) { + for (int jOrder = 0; jOrder < 2; jOrder++) { + for (int kOrder = 0; kOrder < 2; kOrder++) { + const auto* Coord = FFDBox->GetCoordControlPoints(iOrder, jOrder, kOrder); + BoxMidPoint[0] += 0.125 * Coord[0]; + BoxMidPoint[1] += 0.125 * Coord[1]; + BoxMidPoint[2] += 0.125 * Coord[2]; + } + } + } + if (!FFDBox->CheckPointInsideFFD(BoxMidPoint)) { + SU2_MPI::Error("The FFD box '" + FFDBox->GetTag() + + "' is not properly defined. The first 4 points must be listed counter\n" + "clockwise, such that applying the right-hand rule results in a vector into the box.\n" + "This is according to the VTK hexahedron ordering:\n" + " 7 +----+ 6 \n" + " /| /| \n" + " 4 +----+5| \n" + " |3+--|-+ 2 \n" + " |/ |/ \n" + " 0 +----+ 1 \n" + "The CCW convention also applies in 2D, where only the bottom face is specified.", + CURRENT_FUNCTION); + } - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + for (auto iMarker = 0u; iMarker < config->GetnMarker_All(); iMarker++) { if (config->GetMarker_All_DV(iMarker) == YES) { - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + TotalVertex += geometry->nVertex[iMarker]; + for (auto iVertex = 0ul; iVertex < geometry->nVertex[iMarker]; iVertex++) { /*--- Get the cartesian coordinates ---*/ - for (iDim = 0; iDim < nDim; iDim++) - CartCoord[iDim] = geometry->vertex[iMarker][iVertex]->GetCoord(iDim); + su2double CartCoord[3] = {}; + for (auto iDim = 0u; iDim < nDim; iDim++) CartCoord[iDim] = geometry->vertex[iMarker][iVertex]->GetCoord(iDim); /*--- Transform the cartesian into polar ---*/ - if (cylindrical) { - X_0 = config->GetFFD_Axis(0); Y_0 = config->GetFFD_Axis(1); Z_0 = config->GetFFD_Axis(2); - - Xbar = CartCoord[0] - X_0; Ybar = CartCoord[1] - Y_0; Zbar = CartCoord[2] - Z_0; + if (!cartesian) { + const su2double X_0 = config->GetFFD_Axis(0); + const su2double Y_0 = config->GetFFD_Axis(1); + const su2double Z_0 = config->GetFFD_Axis(2); - CartCoord[0] = sqrt(Ybar*Ybar + Zbar*Zbar); - CartCoord[1] = atan2(Zbar, Ybar); if (CartCoord[1] > PI_NUMBER/2.0) CartCoord[1] -= 2.0*PI_NUMBER; - CartCoord[2] = Xbar; - } - else if (spherical || polar) { - X_0 = config->GetFFD_Axis(0); Y_0 = config->GetFFD_Axis(1); Z_0 = config->GetFFD_Axis(2); + const su2double Xbar = CartCoord[0] - X_0; + const su2double Ybar = CartCoord[1] - Y_0; + const su2double Zbar = CartCoord[2] - Z_0; - Xbar = CartCoord[0] - X_0; Ybar = CartCoord[1] - Y_0; Zbar = CartCoord[2] - Z_0; + CartCoord[1] = atan2(Zbar, Ybar); + if (CartCoord[1] > PI_NUMBER / 2.0) CartCoord[1] -= 2.0 * PI_NUMBER; - CartCoord[0] = sqrt(Xbar*Xbar + Ybar*Ybar + Zbar*Zbar); - CartCoord[1] = atan2(Zbar, Ybar); if (CartCoord[1] > PI_NUMBER/2.0) CartCoord[1] -= 2.0*PI_NUMBER; - CartCoord[2] = acos(Xbar/CartCoord[0]); + if (cylindrical) { + CartCoord[0] = sqrt(Ybar * Ybar + Zbar * Zbar); + CartCoord[2] = Xbar; + } else if (spherical || polar) { + CartCoord[0] = sqrt(Xbar * Xbar + Ybar * Ybar + Zbar * Zbar); + CartCoord[2] = acos(Xbar / CartCoord[0]); + } } - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - - /*--- If the point is inside the FFD, compute the value of the parametric coordinate ---*/ + const auto iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - if (FFDBox->GetPointFFD(geometry, config, iPoint)) { + /*--- If the point is inside the FFD, compute the value of the parametric coordinate. ---*/ + if (FFDBox->CheckPointInsideFFD(CartCoord)) { /*--- Find the parametric coordinate ---*/ - ParamCoord = FFDBox->GetParametricCoord_Iterative(iPoint, CartCoord, ParamCoordGuess, config); + ++VisitedVertex; + auto* ParamCoord = FFDBox->GetParametricCoord_Iterative(iPoint, CartCoord, ParamCoordGuess, config); /*--- Compute the cartesian coordinates using the parametric coordinates to check that everything is correct ---*/ - CartCoordNew = FFDBox->EvalCartesianCoord(ParamCoord); + const auto* CartCoordNew = FFDBox->EvalCartesianCoord(ParamCoord); /*--- Compute max difference between original value and the recomputed value ---*/ - Diff = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - Diff += (CartCoordNew[iDim]-CartCoord[iDim])*(CartCoordNew[iDim]-CartCoord[iDim]); - Diff = sqrt(Diff); + const su2double Diff = GeometryToolbox::Distance(nDim, CartCoordNew, CartCoord); my_MaxDiff = max(my_MaxDiff, Diff); - /*--- If the parametric coordinates are in (0,1) the point belongs to the FFDBox, using the input tolerance ---*/ - - if (((ParamCoord[0] >= - config->GetFFD_Tol()) && (ParamCoord[0] <= 1.0 + config->GetFFD_Tol())) && - ((ParamCoord[1] >= - config->GetFFD_Tol()) && (ParamCoord[1] <= 1.0 + config->GetFFD_Tol())) && - ((ParamCoord[2] >= - config->GetFFD_Tol()) && (ParamCoord[2] <= 1.0 + config->GetFFD_Tol()))) { - + /*--- If the parametric coordinates are in (-tol, 1+tol) the point belongs to the FFDBox ---*/ + if (((ParamCoord[0] >= -config->GetFFD_Tol()) && (ParamCoord[0] <= 1.0 + config->GetFFD_Tol())) && + ((ParamCoord[1] >= -config->GetFFD_Tol()) && (ParamCoord[1] <= 1.0 + config->GetFFD_Tol())) && + ((ParamCoord[2] >= -config->GetFFD_Tol()) && (ParamCoord[2] <= 1.0 + config->GetFFD_Tol()))) { /*--- Rectification of the initial tolerance (we have detected situations - where 0.0 and 1.0 doesn't work properly ---*/ + where 0.0 and 1.0 do not work properly. ---*/ - su2double lower_limit = config->GetFFD_Tol(); - su2double upper_limit = 1.0-config->GetFFD_Tol(); + const su2double lower_limit = config->GetFFD_Tol(); + const su2double upper_limit = 1.0 - config->GetFFD_Tol(); - if (ParamCoord[0] < lower_limit) ParamCoord[0] = lower_limit; - if (ParamCoord[1] < lower_limit) ParamCoord[1] = lower_limit; - if (ParamCoord[2] < lower_limit) ParamCoord[2] = lower_limit; - if (ParamCoord[0] > upper_limit) ParamCoord[0] = upper_limit; - if (ParamCoord[1] > upper_limit) ParamCoord[1] = upper_limit; - if (ParamCoord[2] > upper_limit) ParamCoord[2] = upper_limit; + ParamCoord[0] = fmin(fmax(lower_limit, ParamCoord[0]), upper_limit); + ParamCoord[1] = fmin(fmax(lower_limit, ParamCoord[1]), upper_limit); + ParamCoord[2] = fmin(fmax(lower_limit, ParamCoord[2]), upper_limit); /*--- Set the value of the parametric coordinate ---*/ + ++MappedVertex; FFDBox->Set_MarkerIndex(iMarker); FFDBox->Set_VertexIndex(iVertex); FFDBox->Set_PointIndex(iPoint); FFDBox->Set_ParametricCoord(ParamCoord); FFDBox->Set_CartesianCoord(CartCoord); - ParamCoordGuess[0] = ParamCoord[0]; ParamCoordGuess[1] = ParamCoord[1]; ParamCoordGuess[2] = ParamCoord[2]; - - if (Diff >= config->GetFFD_Tol()) { - cout << "Please check this point: Local (" << ParamCoord[0] <<" "<< ParamCoord[1] <<" "<< ParamCoord[2] <<") <-> Global (" - << CartCoord[0] <<" "<< CartCoord[1] <<" "<< CartCoord[2] <<") <-> Error "<< Diff <<" vs "<< config->GetFFD_Tol() <<"." << endl; - } - + ParamCoordGuess[0] = ParamCoord[0]; + ParamCoordGuess[1] = ParamCoord[1]; + ParamCoordGuess[2] = ParamCoord[2]; } - else { - - if (Diff >= config->GetFFD_Tol()) { - cout << "Please check this point: Local (" << ParamCoord[0] <<" "<< ParamCoord[1] <<" "<< ParamCoord[2] <<") <-> Global (" - << CartCoord[0] <<" "<< CartCoord[1] <<" "<< CartCoord[2] <<") <-> Error "<< Diff <<" vs "<< config->GetFFD_Tol() <<"." << endl; - } + if (Diff >= config->GetFFD_Tol()) { + cout << "Please check this point: Local (" << ParamCoord[0] << " " << ParamCoord[1] << " " << ParamCoord[2] + << ") <-> Global (" << CartCoord[0] << " " << CartCoord[1] << " " << CartCoord[2] << ") <-> Error " + << Diff << " vs " << config->GetFFD_Tol() << "." << endl; } - } } } } -#ifdef HAVE_MPI - SU2_MPI::Allreduce(&my_MaxDiff, &MaxDiff, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); -#else - MaxDiff = my_MaxDiff; -#endif + su2double MaxDiff = 0.0; + SU2_MPI::Reduce(&my_MaxDiff, &MaxDiff, 1, MPI_DOUBLE, MPI_MAX, MASTER_NODE, SU2_MPI::GetComm()); - if (rank == MASTER_NODE) - cout << "Compute parametric coord | FFD box: " << FFDBox->GetTag() << ". Max Diff: " << MaxDiff <<"."<< endl; + unsigned long GlobalVertex = 0, GlobalVisited = 0, GlobalMapped = 0; + SU2_MPI::Reduce(&TotalVertex, &GlobalVertex, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Reduce(&VisitedVertex, &GlobalVisited, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Reduce(&MappedVertex, &GlobalMapped, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm()); + if (rank == MASTER_NODE) { + cout << "Computed parametric coord for FFD box '" << FFDBox->GetTag() << "'\n"; + cout << " Number of vertices (Total, Inside FFD, Mapped to FFD): " << GlobalVertex; + cout << ", " << GlobalVisited << ", " << GlobalMapped << "\n"; + cout << " Max coord difference: " << MaxDiff << "\n"; + } - /*--- After the point inversion, copy the original - information back (this only works with boxes, - and we maintain an internal copy) ---*/ + /*--- After the point inversion, copy the original information back. ---*/ if (BoxFFD) { FFDBox->SetOriginalControlPoints(); - if (config->GetFFD_Blending() == BEZIER){ + if (config->GetFFD_Blending() == BEZIER) { FFDBox->BlendingFunction[0]->SetOrder(FFDBox->GetlOrder(), FFDBox->GetlOrder()); FFDBox->BlendingFunction[1]->SetOrder(FFDBox->GetmOrder(), FFDBox->GetmOrder()); FFDBox->BlendingFunction[2]->SetOrder(FFDBox->GetnOrder(), FFDBox->GetnOrder()); @@ -910,7 +907,8 @@ void CSurfaceMovement::SetParametricCoord(CGeometry *geometry, CConfig *config, } } -void CSurfaceMovement::SetParametricCoordCP(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBoxParent, CFreeFormDefBox *FFDBoxChild) { +void CSurfaceMovement::SetParametricCoordCP(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBoxParent, + CFreeFormDefBox* FFDBoxChild) { unsigned short iOrder, jOrder, kOrder; su2double *CartCoord, *ParamCoord, ParamCoordGuess[3]; @@ -923,12 +921,12 @@ void CSurfaceMovement::SetParametricCoordCP(CGeometry *geometry, CConfig *config } if (rank == MASTER_NODE) - cout << "Compute parametric coord (CP) | FFD parent box: " << FFDBoxParent->GetTag() << ". FFD child box: " << FFDBoxChild->GetTag() <<"."<< endl; - - + cout << "Compute parametric coord (CP) | FFD parent box: " << FFDBoxParent->GetTag() + << ". FFD child box: " << FFDBoxChild->GetTag() << "." << endl; } -void CSurfaceMovement::GetCartesianCoordCP(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBoxParent, CFreeFormDefBox *FFDBoxChild) { +void CSurfaceMovement::GetCartesianCoordCP(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBoxParent, + CFreeFormDefBox* FFDBoxChild) { unsigned short iOrder, jOrder, kOrder, iDim; su2double *CartCoord, *ParamCoord; @@ -946,57 +944,59 @@ void CSurfaceMovement::GetCartesianCoordCP(CGeometry *geometry, CConfig *config, CartCoord = FFDBoxParent->EvalCartesianCoord(ParamCoord); FFDBoxChild->SetCoordControlPoints(CartCoord, iOrder, jOrder, kOrder); FFDBoxChild->SetCoordControlPoints_Copy(CartCoord, iOrder, jOrder, kOrder); - } if (rank == MASTER_NODE) - cout << "Update cartesian coord (CP) | FFD parent box: " << FFDBoxParent->GetTag() << ". FFD child box: " << FFDBoxChild->GetTag() <<"."<< endl; - + cout << "Update cartesian coord (CP) | FFD parent box: " << FFDBoxParent->GetTag() + << ". FFD child box: " << FFDBoxChild->GetTag() << "." << endl; } -void CSurfaceMovement::CheckFFDDimension(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iFFDBox) { - +void CSurfaceMovement::CheckFFDDimension(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, + unsigned short iFFDBox) { unsigned short iIndex, jIndex, kIndex, lDegree, mDegree, nDegree, iDV; bool OutOffLimits; bool polar = (config->GetFFD_CoordSystem() == POLAR); - lDegree = FFDBox->GetlOrder()-1; - mDegree = FFDBox->GetmOrder()-1; - nDegree = FFDBox->GetnOrder()-1; + lDegree = FFDBox->GetlOrder() - 1; + mDegree = FFDBox->GetmOrder() - 1; + nDegree = FFDBox->GetnOrder() - 1; OutOffLimits = false; for (iDV = 0; iDV < config->GetnDV(); iDV++) { - if (config->GetFFDTag(iDV)== FFDBox->GetTag()){ - switch ( config->GetDesign_Variable(iDV) ) { - case FFD_CONTROL_POINT_2D : + if (config->GetFFDTag(iDV) == FFDBox->GetTag()) { + switch (config->GetDesign_Variable(iDV)) { + case FFD_CONTROL_POINT_2D: if (polar) { iIndex = SU2_TYPE::Int(fabs(config->GetParamDV(iDV, 1))); kIndex = SU2_TYPE::Int(fabs(config->GetParamDV(iDV, 2))); if ((iIndex > lDegree) || (kIndex > nDegree)) OutOffLimits = true; - } - else { + } else { iIndex = SU2_TYPE::Int(fabs(config->GetParamDV(iDV, 1))); jIndex = SU2_TYPE::Int(fabs(config->GetParamDV(iDV, 2))); if ((iIndex > lDegree) || (jIndex > mDegree)) OutOffLimits = true; } break; - case FFD_CAMBER : case FFD_THICKNESS : - iIndex = SU2_TYPE::Int(fabs(config->GetParamDV(iDV, 1))); - jIndex = SU2_TYPE::Int(fabs(config->GetParamDV(iDV, 2))); - if ((iIndex > lDegree) || (jIndex > mDegree)) OutOffLimits = true; + case FFD_CAMBER: + case FFD_THICKNESS: + iIndex = SU2_TYPE::Int(fabs(config->GetParamDV(iDV, 1))); + jIndex = SU2_TYPE::Int(fabs(config->GetParamDV(iDV, 2))); + if ((iIndex > lDegree) || (jIndex > mDegree)) OutOffLimits = true; break; - case FFD_CAMBER_2D : case FFD_THICKNESS_2D : + case FFD_CAMBER_2D: + case FFD_THICKNESS_2D: iIndex = SU2_TYPE::Int(fabs(config->GetParamDV(iDV, 1))); if (iIndex > lDegree) OutOffLimits = true; break; - case FFD_CONTROL_POINT : case FFD_NACELLE : + case FFD_CONTROL_POINT: + case FFD_NACELLE: iIndex = SU2_TYPE::Int(fabs(config->GetParamDV(iDV, 1))); - jIndex= SU2_TYPE::Int(fabs(config->GetParamDV(iDV, 2))); + jIndex = SU2_TYPE::Int(fabs(config->GetParamDV(iDV, 2))); kIndex = SU2_TYPE::Int(fabs(config->GetParamDV(iDV, 3))); if ((iIndex > lDegree) || (jIndex > mDegree) || (kIndex > nDegree)) OutOffLimits = true; break; - case FFD_GULL : case FFD_TWIST : - jIndex= SU2_TYPE::Int(fabs(config->GetParamDV(iDV, 1))); + case FFD_GULL: + case FFD_TWIST: + jIndex = SU2_TYPE::Int(fabs(config->GetParamDV(iDV, 1))); if (jIndex > mDegree) OutOffLimits = true; break; } @@ -1017,12 +1017,11 @@ void CSurfaceMovement::CheckFFDDimension(CGeometry *geometry, CConfig *config, C #ifdef HAVE_MPI SU2_MPI::Barrier(SU2_MPI::GetComm()); #endif - } -void CSurfaceMovement::CheckFFDIntersections(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iFFDBox) { - - su2double Coord_0[] = {0,0,0}, Coord_1[] = {0,0,0}; +void CSurfaceMovement::CheckFFDIntersections(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, + unsigned short iFFDBox) { + su2double Coord_0[] = {0, 0, 0}, Coord_1[] = {0, 0, 0}; unsigned short index, iMarker, iNode, jNode, lDegree, mDegree, nDegree, iDim; unsigned long iElem, iPoint, jPoint; bool IPlane_Intersect_A = false, IPlane_Intersect_B = false; @@ -1037,90 +1036,89 @@ void CSurfaceMovement::CheckFFDIntersections(CGeometry *geometry, CConfig *confi bool polar = (config->GetFFD_CoordSystem() == POLAR); bool cartesian = (config->GetFFD_CoordSystem() == CARTESIAN); - lDegree = FFDBox->GetlOrder()-1; - mDegree = FFDBox->GetmOrder()-1; - nDegree = FFDBox->GetnOrder()-1; + lDegree = FFDBox->GetlOrder() - 1; + mDegree = FFDBox->GetmOrder() - 1; + nDegree = FFDBox->GetnOrder() - 1; if (config->GetFFD_Continuity() != USER_INPUT) { - /*--- Check intersection with plane i=0 ---*/ - su2double *IPlane_Coord_0_A = FFDBox->GetCoordControlPoints(0, 0, 0); - su2double *IPlane_Coord_1_A = FFDBox->GetCoordControlPoints(0, 0, nDegree); - su2double *IPlane_Coord_2_A = FFDBox->GetCoordControlPoints(0, mDegree, 0); + su2double* IPlane_Coord_0_A = FFDBox->GetCoordControlPoints(0, 0, 0); + su2double* IPlane_Coord_1_A = FFDBox->GetCoordControlPoints(0, 0, nDegree); + su2double* IPlane_Coord_2_A = FFDBox->GetCoordControlPoints(0, mDegree, 0); - su2double *IPlane_Coord_0_A_ = FFDBox->GetCoordControlPoints(0, mDegree, nDegree); - su2double *IPlane_Coord_1_A_ = FFDBox->GetCoordControlPoints(0, mDegree, 0); - su2double *IPlane_Coord_2_A_ = FFDBox->GetCoordControlPoints(0, 0, nDegree); + su2double* IPlane_Coord_0_A_ = FFDBox->GetCoordControlPoints(0, mDegree, nDegree); + su2double* IPlane_Coord_1_A_ = FFDBox->GetCoordControlPoints(0, mDegree, 0); + su2double* IPlane_Coord_2_A_ = FFDBox->GetCoordControlPoints(0, 0, nDegree); /*--- Check intersection with plane i=lDegree ---*/ - su2double *IPlane_Coord_0_B = FFDBox->GetCoordControlPoints(lDegree, 0, 0); - su2double *IPlane_Coord_1_B = FFDBox->GetCoordControlPoints(lDegree, 0, nDegree); - su2double *IPlane_Coord_2_B = FFDBox->GetCoordControlPoints(lDegree, mDegree, 0); + su2double* IPlane_Coord_0_B = FFDBox->GetCoordControlPoints(lDegree, 0, 0); + su2double* IPlane_Coord_1_B = FFDBox->GetCoordControlPoints(lDegree, 0, nDegree); + su2double* IPlane_Coord_2_B = FFDBox->GetCoordControlPoints(lDegree, mDegree, 0); - su2double *IPlane_Coord_0_B_ = FFDBox->GetCoordControlPoints(lDegree, mDegree, nDegree); - su2double *IPlane_Coord_1_B_ = FFDBox->GetCoordControlPoints(lDegree, mDegree, 0); - su2double *IPlane_Coord_2_B_ = FFDBox->GetCoordControlPoints(lDegree, 0, nDegree); + su2double* IPlane_Coord_0_B_ = FFDBox->GetCoordControlPoints(lDegree, mDegree, nDegree); + su2double* IPlane_Coord_1_B_ = FFDBox->GetCoordControlPoints(lDegree, mDegree, 0); + su2double* IPlane_Coord_2_B_ = FFDBox->GetCoordControlPoints(lDegree, 0, nDegree); /*--- Check intersection with plane j=0 ---*/ - su2double *JPlane_Coord_0_A = FFDBox->GetCoordControlPoints(0, 0, 0); - su2double *JPlane_Coord_1_A = FFDBox->GetCoordControlPoints(0, 0, nDegree); - su2double *JPlane_Coord_2_A = FFDBox->GetCoordControlPoints(lDegree, 0, 0); + su2double* JPlane_Coord_0_A = FFDBox->GetCoordControlPoints(0, 0, 0); + su2double* JPlane_Coord_1_A = FFDBox->GetCoordControlPoints(0, 0, nDegree); + su2double* JPlane_Coord_2_A = FFDBox->GetCoordControlPoints(lDegree, 0, 0); - su2double *JPlane_Coord_0_A_ = FFDBox->GetCoordControlPoints(lDegree, 0, nDegree); - su2double *JPlane_Coord_1_A_ = FFDBox->GetCoordControlPoints(lDegree, 0, 0); - su2double *JPlane_Coord_2_A_ = FFDBox->GetCoordControlPoints(0, 0, nDegree); + su2double* JPlane_Coord_0_A_ = FFDBox->GetCoordControlPoints(lDegree, 0, nDegree); + su2double* JPlane_Coord_1_A_ = FFDBox->GetCoordControlPoints(lDegree, 0, 0); + su2double* JPlane_Coord_2_A_ = FFDBox->GetCoordControlPoints(0, 0, nDegree); /*--- Check intersection with plane j=mDegree ---*/ - su2double *JPlane_Coord_0_B = FFDBox->GetCoordControlPoints(0, mDegree, 0); - su2double *JPlane_Coord_1_B = FFDBox->GetCoordControlPoints(0, mDegree, nDegree); - su2double *JPlane_Coord_2_B = FFDBox->GetCoordControlPoints(lDegree, mDegree, 0); + su2double* JPlane_Coord_0_B = FFDBox->GetCoordControlPoints(0, mDegree, 0); + su2double* JPlane_Coord_1_B = FFDBox->GetCoordControlPoints(0, mDegree, nDegree); + su2double* JPlane_Coord_2_B = FFDBox->GetCoordControlPoints(lDegree, mDegree, 0); - su2double *JPlane_Coord_0_B_ = FFDBox->GetCoordControlPoints(lDegree, mDegree, nDegree); - su2double *JPlane_Coord_1_B_ = FFDBox->GetCoordControlPoints(lDegree, mDegree, 0); - su2double *JPlane_Coord_2_B_ = FFDBox->GetCoordControlPoints(0, mDegree, nDegree); + su2double* JPlane_Coord_0_B_ = FFDBox->GetCoordControlPoints(lDegree, mDegree, nDegree); + su2double* JPlane_Coord_1_B_ = FFDBox->GetCoordControlPoints(lDegree, mDegree, 0); + su2double* JPlane_Coord_2_B_ = FFDBox->GetCoordControlPoints(0, mDegree, nDegree); /*--- Check intersection with plane k=0 ---*/ - su2double *KPlane_Coord_0_A = FFDBox->GetCoordControlPoints(0, 0, 0); - su2double *KPlane_Coord_1_A = FFDBox->GetCoordControlPoints(0, mDegree, 0); - su2double *KPlane_Coord_2_A = FFDBox->GetCoordControlPoints(lDegree, 0, 0); + su2double* KPlane_Coord_0_A = FFDBox->GetCoordControlPoints(0, 0, 0); + su2double* KPlane_Coord_1_A = FFDBox->GetCoordControlPoints(0, mDegree, 0); + su2double* KPlane_Coord_2_A = FFDBox->GetCoordControlPoints(lDegree, 0, 0); - su2double *KPlane_Coord_0_A_ = FFDBox->GetCoordControlPoints(lDegree, mDegree, 0); - su2double *KPlane_Coord_1_A_ = FFDBox->GetCoordControlPoints(lDegree, 0, 0); - su2double *KPlane_Coord_2_A_ = FFDBox->GetCoordControlPoints(0, mDegree, 0); + su2double* KPlane_Coord_0_A_ = FFDBox->GetCoordControlPoints(lDegree, mDegree, 0); + su2double* KPlane_Coord_1_A_ = FFDBox->GetCoordControlPoints(lDegree, 0, 0); + su2double* KPlane_Coord_2_A_ = FFDBox->GetCoordControlPoints(0, mDegree, 0); /*--- Check intersection with plane k=nDegree ---*/ - su2double *KPlane_Coord_0_B = FFDBox->GetCoordControlPoints(0, 0, nDegree); - su2double *KPlane_Coord_1_B = FFDBox->GetCoordControlPoints(0, mDegree, nDegree); - su2double *KPlane_Coord_2_B = FFDBox->GetCoordControlPoints(lDegree, 0, nDegree); + su2double* KPlane_Coord_0_B = FFDBox->GetCoordControlPoints(0, 0, nDegree); + su2double* KPlane_Coord_1_B = FFDBox->GetCoordControlPoints(0, mDegree, nDegree); + su2double* KPlane_Coord_2_B = FFDBox->GetCoordControlPoints(lDegree, 0, nDegree); - su2double *KPlane_Coord_0_B_ = FFDBox->GetCoordControlPoints(lDegree, mDegree, nDegree); - su2double *KPlane_Coord_1_B_ = FFDBox->GetCoordControlPoints(lDegree, 0, nDegree); - su2double *KPlane_Coord_2_B_ = FFDBox->GetCoordControlPoints(0, mDegree, nDegree); + su2double* KPlane_Coord_0_B_ = FFDBox->GetCoordControlPoints(lDegree, mDegree, nDegree); + su2double* KPlane_Coord_1_B_ = FFDBox->GetCoordControlPoints(lDegree, 0, nDegree); + su2double* KPlane_Coord_2_B_ = FFDBox->GetCoordControlPoints(0, mDegree, nDegree); /*--- Loop over all the grid triangles ---*/ - IPlane_Intersect_A = false; IPlane_Intersect_B = false; - JPlane_Intersect_A = false; JPlane_Intersect_B = false; - KPlane_Intersect_A = false; KPlane_Intersect_B = false; + IPlane_Intersect_A = false; + IPlane_Intersect_B = false; + JPlane_Intersect_A = false; + JPlane_Intersect_B = false; + KPlane_Intersect_A = false; + KPlane_Intersect_B = false; /*--- Only the markers in the moving list ---*/ for (iMarker = 0; iMarker < geometry->GetnMarker(); iMarker++) { - if (((config->GetMarker_All_Moving(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_CFD)) || ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_DEF)) || ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_GEO)) || ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_DOT)) || ((config->GetMarker_All_DV(iMarker) == YES) && (config->GetDirectDiff() == D_DESIGN))) { - for (iElem = 0; iElem < geometry->GetnElem_Bound(iMarker); iElem++) { - for (iNode = 0; iNode < geometry->bound[iMarker][iElem]->GetnNodes(); iNode++) { iPoint = geometry->bound[iMarker][iElem]->GetNode(iNode); @@ -1128,103 +1126,162 @@ void CSurfaceMovement::CheckFFDIntersections(CGeometry *geometry, CConfig *confi jPoint = geometry->bound[iMarker][iElem]->GetNode(jNode); if (jPoint > iPoint) { - for (iDim = 0; iDim < geometry->GetnDim(); iDim++) { - Coord_0[iDim] = geometry->nodes->GetCoord(iPoint,iDim); - Coord_1[iDim] = geometry->nodes->GetCoord(jPoint,iDim); + Coord_0[iDim] = geometry->nodes->GetCoord(iPoint, iDim); + Coord_1[iDim] = geometry->nodes->GetCoord(jPoint, iDim); } /*--- Write the coordinates in the right parametric system ---*/ if (cylindrical) { + X_0 = config->GetFFD_Axis(0); + Y_0 = config->GetFFD_Axis(1); + Z_0 = config->GetFFD_Axis(2); - X_0 = config->GetFFD_Axis(0); Y_0 = config->GetFFD_Axis(1); Z_0 = config->GetFFD_Axis(2); - - Xbar = Coord_0[0] - X_0; Ybar = Coord_0[1] - Y_0; Zbar = Coord_0[2] - Z_0; + Xbar = Coord_0[0] - X_0; + Ybar = Coord_0[1] - Y_0; + Zbar = Coord_0[2] - Z_0; - Coord_0[0] = sqrt(Ybar*Ybar + Zbar*Zbar); - Coord_0[1] = atan2(Zbar, Ybar); if (Coord_0[1] > PI_NUMBER/2.0) Coord_0[1] -= 2.0*PI_NUMBER; + Coord_0[0] = sqrt(Ybar * Ybar + Zbar * Zbar); + Coord_0[1] = atan2(Zbar, Ybar); + if (Coord_0[1] > PI_NUMBER / 2.0) Coord_0[1] -= 2.0 * PI_NUMBER; Coord_0[2] = Xbar; - Xbar = Coord_1[0] - X_0; Ybar = Coord_1[1] - Y_0; Zbar = Coord_1[2] - Z_0; + Xbar = Coord_1[0] - X_0; + Ybar = Coord_1[1] - Y_0; + Zbar = Coord_1[2] - Z_0; - Coord_1[0] = sqrt(Ybar*Ybar + Zbar*Zbar); - Coord_1[1] = atan2(Zbar, Ybar); if (Coord_1[1] > PI_NUMBER/2.0) Coord_1[1] -= 2.0*PI_NUMBER; + Coord_1[0] = sqrt(Ybar * Ybar + Zbar * Zbar); + Coord_1[1] = atan2(Zbar, Ybar); + if (Coord_1[1] > PI_NUMBER / 2.0) Coord_1[1] -= 2.0 * PI_NUMBER; Coord_1[2] = Xbar; } else if (spherical || polar) { - - X_0 = config->GetFFD_Axis(0); Y_0 = config->GetFFD_Axis(1); Z_0 = config->GetFFD_Axis(2); - - Xbar = Coord_0[0] - X_0; Ybar = Coord_0[1] - Y_0; Zbar = Coord_0[2] - Z_0; - - Coord_0[0] = sqrt(Xbar*Xbar + Ybar*Ybar + Zbar*Zbar); - Coord_0[1] = atan2(Zbar, Ybar); if (Coord_0[1] > PI_NUMBER/2.0) Coord_0[1] -= 2.0*PI_NUMBER; - Coord_0[2] = acos (Xbar/Coord_0[0]); - - Xbar = Coord_1[0] - X_0; Ybar = Coord_1[1] - Y_0; Zbar = Coord_1[2] - Z_0; - - Coord_1[0] = sqrt(Xbar*Xbar + Ybar*Ybar + Zbar*Zbar); - Coord_1[1] = atan2(Zbar, Ybar); if (Coord_1[1] > PI_NUMBER/2.0) Coord_1[1] -= 2.0*PI_NUMBER; - Coord_1[2] = acos(Xbar/Coord_1[0]); - + X_0 = config->GetFFD_Axis(0); + Y_0 = config->GetFFD_Axis(1); + Z_0 = config->GetFFD_Axis(2); + + Xbar = Coord_0[0] - X_0; + Ybar = Coord_0[1] - Y_0; + Zbar = Coord_0[2] - Z_0; + + Coord_0[0] = sqrt(Xbar * Xbar + Ybar * Ybar + Zbar * Zbar); + Coord_0[1] = atan2(Zbar, Ybar); + if (Coord_0[1] > PI_NUMBER / 2.0) Coord_0[1] -= 2.0 * PI_NUMBER; + Coord_0[2] = acos(Xbar / Coord_0[0]); + + Xbar = Coord_1[0] - X_0; + Ybar = Coord_1[1] - Y_0; + Zbar = Coord_1[2] - Z_0; + + Coord_1[0] = sqrt(Xbar * Xbar + Ybar * Ybar + Zbar * Zbar); + Coord_1[1] = atan2(Zbar, Ybar); + if (Coord_1[1] > PI_NUMBER / 2.0) Coord_1[1] -= 2.0 * PI_NUMBER; + Coord_1[2] = acos(Xbar / Coord_1[0]); } if (geometry->GetnDim() == 3) { - if (!IPlane_Intersect_A) { - if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, IPlane_Coord_0_A, IPlane_Coord_1_A, IPlane_Coord_2_A)) { IPlane_Intersect_A = true; } - if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, IPlane_Coord_0_A_, IPlane_Coord_1_A_, IPlane_Coord_2_A_)) { IPlane_Intersect_A = true; } + if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, IPlane_Coord_0_A, IPlane_Coord_1_A, + IPlane_Coord_2_A)) { + IPlane_Intersect_A = true; + } + if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, IPlane_Coord_0_A_, IPlane_Coord_1_A_, + IPlane_Coord_2_A_)) { + IPlane_Intersect_A = true; + } } if (!IPlane_Intersect_B) { - if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, IPlane_Coord_0_B, IPlane_Coord_1_B, IPlane_Coord_2_B)) { IPlane_Intersect_B = true; } - if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, IPlane_Coord_0_B_, IPlane_Coord_1_B_, IPlane_Coord_2_B_)) { IPlane_Intersect_B = true; } + if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, IPlane_Coord_0_B, IPlane_Coord_1_B, + IPlane_Coord_2_B)) { + IPlane_Intersect_B = true; + } + if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, IPlane_Coord_0_B_, IPlane_Coord_1_B_, + IPlane_Coord_2_B_)) { + IPlane_Intersect_B = true; + } } if ((!JPlane_Intersect_A) && (!FFD_Symmetry_Plane)) { - if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, JPlane_Coord_0_A, JPlane_Coord_1_A, JPlane_Coord_2_A)) { JPlane_Intersect_A = true; } - if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, JPlane_Coord_0_A_, JPlane_Coord_1_A_, JPlane_Coord_2_A_)) { JPlane_Intersect_A = true; } + if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, JPlane_Coord_0_A, JPlane_Coord_1_A, + JPlane_Coord_2_A)) { + JPlane_Intersect_A = true; + } + if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, JPlane_Coord_0_A_, JPlane_Coord_1_A_, + JPlane_Coord_2_A_)) { + JPlane_Intersect_A = true; + } } if (cartesian) { if ((!JPlane_Intersect_B) && (!FFD_Symmetry_Plane)) { - if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, JPlane_Coord_0_B, JPlane_Coord_1_B, JPlane_Coord_2_B)) { JPlane_Intersect_B = true; } - if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, JPlane_Coord_0_B_, JPlane_Coord_1_B_, JPlane_Coord_2_B_)) { JPlane_Intersect_B = true; } + if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, JPlane_Coord_0_B, JPlane_Coord_1_B, + JPlane_Coord_2_B)) { + JPlane_Intersect_B = true; + } + if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, JPlane_Coord_0_B_, JPlane_Coord_1_B_, + JPlane_Coord_2_B_)) { + JPlane_Intersect_B = true; + } } - } - else { + } else { if (!JPlane_Intersect_B) { - if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, JPlane_Coord_0_B, JPlane_Coord_1_B, JPlane_Coord_2_B)) { JPlane_Intersect_B = true; } - if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, JPlane_Coord_0_B_, JPlane_Coord_1_B_, JPlane_Coord_2_B_)) { JPlane_Intersect_B = true; } + if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, JPlane_Coord_0_B, JPlane_Coord_1_B, + JPlane_Coord_2_B)) { + JPlane_Intersect_B = true; + } + if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, JPlane_Coord_0_B_, JPlane_Coord_1_B_, + JPlane_Coord_2_B_)) { + JPlane_Intersect_B = true; + } } } if (!KPlane_Intersect_A) { - if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, KPlane_Coord_0_A, KPlane_Coord_1_A, KPlane_Coord_2_A)) { KPlane_Intersect_A = true; } - if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, KPlane_Coord_0_A_, KPlane_Coord_1_A_, KPlane_Coord_2_A_)) { KPlane_Intersect_A = true; } + if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, KPlane_Coord_0_A, KPlane_Coord_1_A, + KPlane_Coord_2_A)) { + KPlane_Intersect_A = true; + } + if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, KPlane_Coord_0_A_, KPlane_Coord_1_A_, + KPlane_Coord_2_A_)) { + KPlane_Intersect_A = true; + } } if (!KPlane_Intersect_B) { - if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, KPlane_Coord_0_B, KPlane_Coord_1_B, KPlane_Coord_2_B)) { KPlane_Intersect_B = true; } - if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, KPlane_Coord_0_B_, KPlane_Coord_1_B_, KPlane_Coord_2_B_)) { KPlane_Intersect_B = true; } + if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, KPlane_Coord_0_B, KPlane_Coord_1_B, + KPlane_Coord_2_B)) { + KPlane_Intersect_B = true; + } + if (geometry->SegmentIntersectsTriangle(Coord_0, Coord_1, KPlane_Coord_0_B_, KPlane_Coord_1_B_, + KPlane_Coord_2_B_)) { + KPlane_Intersect_B = true; + } } } else { - if (!IPlane_Intersect_A) { - if (geometry->SegmentIntersectsLine(Coord_0, Coord_1, IPlane_Coord_0_A, IPlane_Coord_2_A)) { IPlane_Intersect_A = true;} + if (geometry->SegmentIntersectsLine(Coord_0, Coord_1, IPlane_Coord_0_A, IPlane_Coord_2_A)) { + IPlane_Intersect_A = true; + } } if (!IPlane_Intersect_B) { - if (geometry->SegmentIntersectsLine(Coord_0, Coord_1, IPlane_Coord_0_B, IPlane_Coord_2_B)) { IPlane_Intersect_B = true;} + if (geometry->SegmentIntersectsLine(Coord_0, Coord_1, IPlane_Coord_0_B, IPlane_Coord_2_B)) { + IPlane_Intersect_B = true; + } } if (!JPlane_Intersect_A) { - if (geometry->SegmentIntersectsLine(Coord_0, Coord_1, JPlane_Coord_0_A, JPlane_Coord_2_A)) { JPlane_Intersect_A = true;} + if (geometry->SegmentIntersectsLine(Coord_0, Coord_1, JPlane_Coord_0_A, JPlane_Coord_2_A)) { + JPlane_Intersect_A = true; + } } if (!JPlane_Intersect_B) { - if (geometry->SegmentIntersectsLine(Coord_0, Coord_1, JPlane_Coord_0_B, JPlane_Coord_2_B)) { JPlane_Intersect_B = true;} + if (geometry->SegmentIntersectsLine(Coord_0, Coord_1, JPlane_Coord_0_B, JPlane_Coord_2_B)) { + JPlane_Intersect_B = true; + } } } } @@ -1236,7 +1293,7 @@ void CSurfaceMovement::CheckFFDIntersections(CGeometry *geometry, CConfig *confi /*--- Comunicate the planes that interesect the surface ---*/ - unsigned short MyCode[6] = {0,0,0,0,0,0}, Code[6] = {0,0,0,0,0,0}; + unsigned short MyCode[6] = {0, 0, 0, 0, 0, 0}, Code[6] = {0, 0, 0, 0, 0, 0}; if (IPlane_Intersect_A) MyCode[0] = 1; if (IPlane_Intersect_B) MyCode[1] = 1; @@ -1253,64 +1310,60 @@ void CSurfaceMovement::CheckFFDIntersections(CGeometry *geometry, CConfig *confi #else - Code[0] = MyCode[0]; Code[1] = MyCode[1]; Code[2] = MyCode[2]; - Code[3] = MyCode[3]; Code[4] = MyCode[4]; Code[5] = MyCode[5]; + Code[0] = MyCode[0]; + Code[1] = MyCode[1]; + Code[2] = MyCode[2]; + Code[3] = MyCode[3]; + Code[4] = MyCode[4]; + Code[5] = MyCode[5]; #endif - if (Code[0] != 0) IPlane_Intersect_A = true; else IPlane_Intersect_A = false; - if (Code[1] != 0) IPlane_Intersect_B = true; else IPlane_Intersect_B = false; - if (Code[2] != 0) JPlane_Intersect_A = true; else JPlane_Intersect_A = false; - if (Code[3] != 0) JPlane_Intersect_B = true; else JPlane_Intersect_B = false; - if (Code[4] != 0) KPlane_Intersect_A = true; else KPlane_Intersect_A = false; - if (Code[5] != 0) KPlane_Intersect_B = true; else KPlane_Intersect_B = false; + IPlane_Intersect_A = Code[0] != 0; + IPlane_Intersect_B = Code[1] != 0; + JPlane_Intersect_A = Code[2] != 0; + JPlane_Intersect_B = Code[3] != 0; + KPlane_Intersect_A = Code[4] != 0; + KPlane_Intersect_B = Code[5] != 0; /*--- Screen output ---*/ if (rank == MASTER_NODE) { - - if (IPlane_Intersect_A || IPlane_Intersect_B || - JPlane_Intersect_A || JPlane_Intersect_B || - KPlane_Intersect_A || KPlane_Intersect_B ) { - + if (IPlane_Intersect_A || IPlane_Intersect_B || JPlane_Intersect_A || JPlane_Intersect_B || KPlane_Intersect_A || + KPlane_Intersect_B) { cout << "The FFD planes "; if (cartesian) { if (IPlane_Intersect_A) cout << "i=0, "; - if (IPlane_Intersect_B) cout << "i="<< lDegree << ", "; + if (IPlane_Intersect_B) cout << "i=" << lDegree << ", "; if (JPlane_Intersect_A) cout << "j=0, "; - if (JPlane_Intersect_B) cout << "j="<< mDegree << ", "; + if (JPlane_Intersect_B) cout << "j=" << mDegree << ", "; if (KPlane_Intersect_A) cout << "k=0, "; - if (KPlane_Intersect_B) cout << "k="<< nDegree << ", "; - } - else if (cylindrical) { + if (KPlane_Intersect_B) cout << "k=" << nDegree << ", "; + } else if (cylindrical) { if (IPlane_Intersect_A) cout << "r=0, "; - if (IPlane_Intersect_B) cout << "r="<< lDegree << ", "; + if (IPlane_Intersect_B) cout << "r=" << lDegree << ", "; if (JPlane_Intersect_A) cout << "theta=0, "; - if (JPlane_Intersect_B) cout << "theta="<< mDegree << ", "; + if (JPlane_Intersect_B) cout << "theta=" << mDegree << ", "; if (KPlane_Intersect_A) cout << "z=0, "; - if (KPlane_Intersect_B) cout << "z="<< nDegree << ", "; - } - else if (spherical) { + if (KPlane_Intersect_B) cout << "z=" << nDegree << ", "; + } else if (spherical) { if (IPlane_Intersect_A) cout << "r=0, "; - if (IPlane_Intersect_B) cout << "r="<< lDegree << ", "; + if (IPlane_Intersect_B) cout << "r=" << lDegree << ", "; if (JPlane_Intersect_A) cout << "theta=0, "; - if (JPlane_Intersect_B) cout << "theta="<< mDegree << ", "; + if (JPlane_Intersect_B) cout << "theta=" << mDegree << ", "; if (KPlane_Intersect_A) cout << "phi=0, "; - if (KPlane_Intersect_B) cout << "phi="<< nDegree << ", "; - } - else if (polar) { + if (KPlane_Intersect_B) cout << "phi=" << nDegree << ", "; + } else if (polar) { if (IPlane_Intersect_A) cout << "r=0, "; - if (IPlane_Intersect_B) cout << "r="<< lDegree << ", "; + if (IPlane_Intersect_B) cout << "r=" << lDegree << ", "; if (KPlane_Intersect_A) cout << "theta=0, "; - if (KPlane_Intersect_B) cout << "theta="<< nDegree << ", "; + if (KPlane_Intersect_B) cout << "theta=" << nDegree << ", "; } cout << "intersect solid surfaces." << endl; } - } - } /*--- Fix the FFD planes based on the intersections with solid surfaces, @@ -1318,8 +1371,7 @@ void CSurfaceMovement::CheckFFDIntersections(CGeometry *geometry, CConfig *confi that we are looking for ---*/ if (config->GetFFD_Continuity() == USER_INPUT) { - if (rank == MASTER_NODE) - cout << "SU2 is fixing user's input planes." << endl; + if (rank == MASTER_NODE) cout << "SU2 is fixing user's input planes." << endl; for (index = 0; index < config->GetnFFD_Fix_IDir(); index++) if ((config->GetFFD_Fix_IDir(index) <= lDegree) && (config->GetFFD_Fix_IDir(index) >= 0)) @@ -1330,67 +1382,112 @@ void CSurfaceMovement::CheckFFDIntersections(CGeometry *geometry, CConfig *confi for (index = 0; index < config->GetnFFD_Fix_KDir(); index++) if ((config->GetFFD_Fix_KDir(index) <= nDegree) && (config->GetFFD_Fix_KDir(index) >= 0)) FFDBox->Set_Fix_KPlane(config->GetFFD_Fix_KDir(index)); - } if (config->GetFFD_Continuity() == DERIVATIVE_NONE) { - if (rank == MASTER_NODE) - cout << "SU2 is fixing the planes to maintain a continuous surface." << endl; - - if (IPlane_Intersect_A) { FFDBox->Set_Fix_IPlane(0); } - if (IPlane_Intersect_B) { FFDBox->Set_Fix_IPlane(lDegree); } - if (JPlane_Intersect_A) { FFDBox->Set_Fix_JPlane(0); } - if (JPlane_Intersect_B) { FFDBox->Set_Fix_JPlane(mDegree); } - if (KPlane_Intersect_A) { FFDBox->Set_Fix_KPlane(0); } - if (KPlane_Intersect_B) { FFDBox->Set_Fix_KPlane(nDegree); } + if (rank == MASTER_NODE) cout << "SU2 is fixing the planes to maintain a continuous surface." << endl; + if (IPlane_Intersect_A) { + FFDBox->Set_Fix_IPlane(0); + } + if (IPlane_Intersect_B) { + FFDBox->Set_Fix_IPlane(lDegree); + } + if (JPlane_Intersect_A) { + FFDBox->Set_Fix_JPlane(0); + } + if (JPlane_Intersect_B) { + FFDBox->Set_Fix_JPlane(mDegree); + } + if (KPlane_Intersect_A) { + FFDBox->Set_Fix_KPlane(0); + } + if (KPlane_Intersect_B) { + FFDBox->Set_Fix_KPlane(nDegree); + } } if (config->GetFFD_Continuity() == DERIVATIVE_1ST) { - if (rank == MASTER_NODE) - cout << "SU2 is fixing the planes to maintain a continuous 1st order derivative." << endl; - - if (IPlane_Intersect_A) { FFDBox->Set_Fix_IPlane(0); FFDBox->Set_Fix_IPlane(1); } - if (IPlane_Intersect_B) { FFDBox->Set_Fix_IPlane(lDegree); FFDBox->Set_Fix_IPlane(lDegree-1); } - if (JPlane_Intersect_A) { FFDBox->Set_Fix_JPlane(0); FFDBox->Set_Fix_JPlane(1); } - if (JPlane_Intersect_B) { FFDBox->Set_Fix_JPlane(mDegree); FFDBox->Set_Fix_JPlane(mDegree-1); } - if (KPlane_Intersect_A) { FFDBox->Set_Fix_KPlane(0); FFDBox->Set_Fix_KPlane(1); } - if (KPlane_Intersect_B) { FFDBox->Set_Fix_KPlane(nDegree); FFDBox->Set_Fix_KPlane(nDegree-1); } + if (rank == MASTER_NODE) cout << "SU2 is fixing the planes to maintain a continuous 1st order derivative." << endl; + if (IPlane_Intersect_A) { + FFDBox->Set_Fix_IPlane(0); + FFDBox->Set_Fix_IPlane(1); + } + if (IPlane_Intersect_B) { + FFDBox->Set_Fix_IPlane(lDegree); + FFDBox->Set_Fix_IPlane(lDegree - 1); + } + if (JPlane_Intersect_A) { + FFDBox->Set_Fix_JPlane(0); + FFDBox->Set_Fix_JPlane(1); + } + if (JPlane_Intersect_B) { + FFDBox->Set_Fix_JPlane(mDegree); + FFDBox->Set_Fix_JPlane(mDegree - 1); + } + if (KPlane_Intersect_A) { + FFDBox->Set_Fix_KPlane(0); + FFDBox->Set_Fix_KPlane(1); + } + if (KPlane_Intersect_B) { + FFDBox->Set_Fix_KPlane(nDegree); + FFDBox->Set_Fix_KPlane(nDegree - 1); + } } if (config->GetFFD_Continuity() == DERIVATIVE_2ND) { - if (rank == MASTER_NODE) - cout << "SU2 is fixing the planes to maintain a continuous 2nd order derivative." << endl; - - if ((IPlane_Intersect_A) && (lDegree > 1)) { FFDBox->Set_Fix_IPlane(0); FFDBox->Set_Fix_IPlane(1); FFDBox->Set_Fix_IPlane(2); } - if ((IPlane_Intersect_B) && (lDegree > 1)) { FFDBox->Set_Fix_IPlane(lDegree); FFDBox->Set_Fix_IPlane(lDegree-1); FFDBox->Set_Fix_IPlane(lDegree-2); } - if ((JPlane_Intersect_A) && (mDegree > 1)) { FFDBox->Set_Fix_JPlane(0); FFDBox->Set_Fix_JPlane(1); FFDBox->Set_Fix_JPlane(2); } - if ((JPlane_Intersect_B) && (mDegree > 1)) { FFDBox->Set_Fix_JPlane(mDegree); FFDBox->Set_Fix_JPlane(mDegree-1); FFDBox->Set_Fix_JPlane(mDegree-2); } - if ((KPlane_Intersect_A) && (nDegree > 1)) { FFDBox->Set_Fix_KPlane(0); FFDBox->Set_Fix_KPlane(1);FFDBox->Set_Fix_KPlane(2); } - if ((KPlane_Intersect_B) && (nDegree > 1)) { FFDBox->Set_Fix_KPlane(nDegree); FFDBox->Set_Fix_KPlane(nDegree-1); FFDBox->Set_Fix_KPlane(nDegree-2); } + if (rank == MASTER_NODE) cout << "SU2 is fixing the planes to maintain a continuous 2nd order derivative." << endl; + if ((IPlane_Intersect_A) && (lDegree > 1)) { + FFDBox->Set_Fix_IPlane(0); + FFDBox->Set_Fix_IPlane(1); + FFDBox->Set_Fix_IPlane(2); + } + if ((IPlane_Intersect_B) && (lDegree > 1)) { + FFDBox->Set_Fix_IPlane(lDegree); + FFDBox->Set_Fix_IPlane(lDegree - 1); + FFDBox->Set_Fix_IPlane(lDegree - 2); + } + if ((JPlane_Intersect_A) && (mDegree > 1)) { + FFDBox->Set_Fix_JPlane(0); + FFDBox->Set_Fix_JPlane(1); + FFDBox->Set_Fix_JPlane(2); + } + if ((JPlane_Intersect_B) && (mDegree > 1)) { + FFDBox->Set_Fix_JPlane(mDegree); + FFDBox->Set_Fix_JPlane(mDegree - 1); + FFDBox->Set_Fix_JPlane(mDegree - 2); + } + if ((KPlane_Intersect_A) && (nDegree > 1)) { + FFDBox->Set_Fix_KPlane(0); + FFDBox->Set_Fix_KPlane(1); + FFDBox->Set_Fix_KPlane(2); + } + if ((KPlane_Intersect_B) && (nDegree > 1)) { + FFDBox->Set_Fix_KPlane(nDegree); + FFDBox->Set_Fix_KPlane(nDegree - 1); + FFDBox->Set_Fix_KPlane(nDegree - 2); + } } - } -void CSurfaceMovement::UpdateParametricCoord(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iFFDBox) { +void CSurfaceMovement::UpdateParametricCoord(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, + unsigned short iFFDBox) { unsigned short iMarker, iDim; unsigned long iVertex, iPoint, iSurfacePoints; - su2double CartCoord[3] = {0.0,0.0,0.0}, *CartCoordNew, *CartCoordOld; - su2double *ParamCoord, *var_coord, ParamCoordGuess[3] = {0.0,0.0,0.0}; + su2double CartCoord[3] = {0.0, 0.0, 0.0}, *CartCoordNew, *CartCoordOld; + su2double *ParamCoord, *var_coord, ParamCoordGuess[3] = {0.0, 0.0, 0.0}; su2double MaxDiff, my_MaxDiff = 0.0, Diff; /*--- Recompute the parametric coordinates ---*/ for (iSurfacePoints = 0; iSurfacePoints < FFDBox->GetnSurfacePoint(); iSurfacePoints++) { - /*--- Get the marker of the surface point ---*/ iMarker = FFDBox->Get_MarkerIndex(iSurfacePoints); if (config->GetMarker_All_DV(iMarker) == YES) { - /*--- Get the vertex of the surface point ---*/ iVertex = FFDBox->Get_VertexIndex(iSurfacePoints); @@ -1406,13 +1503,14 @@ void CSurfaceMovement::UpdateParametricCoord(CGeometry *geometry, CConfig *confi var_coord = geometry->vertex[iMarker][iVertex]->GetVarCoord(); CartCoordOld = geometry->nodes->GetCoord(iPoint); - for (iDim = 0; iDim < 3; iDim++) - CartCoord[iDim] = CartCoordOld[iDim] + var_coord[iDim]; + for (iDim = 0; iDim < 3; iDim++) CartCoord[iDim] = CartCoordOld[iDim] + var_coord[iDim]; FFDBox->Set_CartesianCoord(CartCoord, iSurfacePoints); /*--- Find the parametric coordinate using as ParamCoordGuess the previous value ---*/ - ParamCoordGuess[0] = ParamCoord[0]; ParamCoordGuess[1] = ParamCoord[1]; ParamCoordGuess[2] = ParamCoord[2]; + ParamCoordGuess[0] = ParamCoord[0]; + ParamCoordGuess[1] = ParamCoord[1]; + ParamCoordGuess[2] = ParamCoord[2]; ParamCoord = FFDBox->GetParametricCoord_Iterative(iPoint, CartCoord, ParamCoordGuess, config); /*--- Set the new value of the parametric coordinates ---*/ @@ -1428,10 +1526,9 @@ void CSurfaceMovement::UpdateParametricCoord(CGeometry *geometry, CConfig *confi Diff = 0.0; for (iDim = 0; iDim < geometry->GetnDim(); iDim++) - Diff += (CartCoordNew[iDim]-CartCoord[iDim])*(CartCoordNew[iDim]-CartCoord[iDim]); + Diff += (CartCoordNew[iDim] - CartCoord[iDim]) * (CartCoordNew[iDim] - CartCoord[iDim]); Diff = sqrt(Diff); my_MaxDiff = max(my_MaxDiff, Diff); - } } @@ -1442,37 +1539,59 @@ void CSurfaceMovement::UpdateParametricCoord(CGeometry *geometry, CConfig *confi #endif if (rank == MASTER_NODE) - cout << "Update parametric coord | FFD box: " << FFDBox->GetTag() << ". Max Diff: " << MaxDiff <<"."<< endl; - + cout << "Update parametric coord | FFD box: " << FFDBox->GetTag() << ". Max Diff: " << MaxDiff << "." << endl; } -void CSurfaceMovement::ApplyDesignVariables(CGeometry *geometry, CConfig *config, CFreeFormDefBox **FFDBox, unsigned short iFFDBox) { - +void CSurfaceMovement::ApplyDesignVariables(CGeometry* geometry, CConfig* config, CFreeFormDefBox** FFDBox, + unsigned short iFFDBox) { unsigned short iDV; for (iDV = 0; iDV < config->GetnDV(); iDV++) { - switch ( config->GetDesign_Variable(iDV) ) { - case FFD_CONTROL_POINT_2D : SetFFDCPChange_2D(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); break; - case FFD_CAMBER_2D : SetFFDCamber_2D(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); break; - case FFD_THICKNESS_2D : SetFFDThickness_2D(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); break; - case FFD_TWIST_2D : SetFFDTwist_2D(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); break; - case FFD_CONTROL_POINT : SetFFDCPChange(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); break; - case FFD_NACELLE : SetFFDNacelle(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); break; - case FFD_GULL : SetFFDGull(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); break; - case FFD_TWIST : SetFFDTwist(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); break; - case FFD_ROTATION : SetFFDRotation(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); break; - case FFD_CONTROL_SURFACE : SetFFDControl_Surface(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); break; - case FFD_CAMBER : SetFFDCamber(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); break; - case FFD_THICKNESS : SetFFDThickness(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); break; - case FFD_ANGLE_OF_ATTACK : SetFFDAngleOfAttack(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); break; + switch (config->GetDesign_Variable(iDV)) { + case FFD_CONTROL_POINT_2D: + SetFFDCPChange_2D(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); + break; + case FFD_CAMBER_2D: + SetFFDCamber_2D(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); + break; + case FFD_THICKNESS_2D: + SetFFDThickness_2D(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); + break; + case FFD_CONTROL_POINT: + SetFFDCPChange(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); + break; + case FFD_NACELLE: + SetFFDNacelle(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); + break; + case FFD_GULL: + SetFFDGull(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); + break; + case FFD_TWIST: + SetFFDTwist(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); + break; + case FFD_ROTATION: + SetFFDRotation(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); + break; + case FFD_CONTROL_SURFACE: + SetFFDControl_Surface(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); + break; + case FFD_CAMBER: + SetFFDCamber(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); + break; + case FFD_THICKNESS: + SetFFDThickness(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); + break; + case FFD_ANGLE_OF_ATTACK: + SetFFDAngleOfAttack(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, false); + break; } } } -su2double CSurfaceMovement::SetCartesianCoord(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, unsigned short iFFDBox, bool ResetDef) { - - su2double *CartCoordNew, Diff, my_MaxDiff = 0.0, MaxDiff, - *ParamCoord, VarCoord[3] = {0.0, 0.0, 0.0}, CartCoordOld[3] = {0.0, 0.0, 0.0}; +su2double CSurfaceMovement::SetCartesianCoord(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, + unsigned short iFFDBox, bool ResetDef) { + su2double *CartCoordNew, Diff, my_MaxDiff = 0.0, MaxDiff, *ParamCoord, VarCoord[3] = {0.0, 0.0, 0.0}, + CartCoordOld[3] = {0.0, 0.0, 0.0}; unsigned short iMarker, iDim; unsigned long iVertex, iPoint, iSurfacePoints; @@ -1495,13 +1614,11 @@ su2double CSurfaceMovement::SetCartesianCoord(CGeometry *geometry, CConfig *conf /*--- Recompute the cartesians coordinates ---*/ for (iSurfacePoints = 0; iSurfacePoints < FFDBox->GetnSurfacePoint(); iSurfacePoints++) { - /*--- Get the marker of the surface point ---*/ iMarker = FFDBox->Get_MarkerIndex(iSurfacePoints); if (config->GetMarker_All_DV(iMarker) == YES) { - /*--- Get the vertex of the surface point ---*/ iVertex = FFDBox->Get_VertexIndex(iSurfacePoints); @@ -1523,28 +1640,32 @@ su2double CSurfaceMovement::SetCartesianCoord(CGeometry *geometry, CConfig *conf /*--- If polar coordinates, compute the cartesians from the polar value ---*/ if (cylindrical) { - su2double X_0, Y_0, Z_0, Xbar, Ybar, Zbar; - X_0 = config->GetFFD_Axis(0); Y_0 = config->GetFFD_Axis(1); Z_0 = config->GetFFD_Axis(2); + X_0 = config->GetFFD_Axis(0); + Y_0 = config->GetFFD_Axis(1); + Z_0 = config->GetFFD_Axis(2); Xbar = CartCoordNew[2]; Ybar = CartCoordNew[0] * cos(CartCoordNew[1]); Zbar = CartCoordNew[0] * sin(CartCoordNew[1]); - CartCoordNew[0] = Xbar + X_0; CartCoordNew[1] = Ybar + Y_0; CartCoordNew[2] = Zbar + Z_0; - - } - else if (spherical || polar) { + CartCoordNew[0] = Xbar + X_0; + CartCoordNew[1] = Ybar + Y_0; + CartCoordNew[2] = Zbar + Z_0; + } else if (spherical || polar) { su2double X_0, Y_0, Z_0, Xbar, Ybar, Zbar; - X_0 = config->GetFFD_Axis(0); Y_0 = config->GetFFD_Axis(1); Z_0 = config->GetFFD_Axis(2); + X_0 = config->GetFFD_Axis(0); + Y_0 = config->GetFFD_Axis(1); + Z_0 = config->GetFFD_Axis(2); Xbar = CartCoordNew[0] * cos(CartCoordNew[2]); Ybar = CartCoordNew[0] * cos(CartCoordNew[1]) * sin(CartCoordNew[2]); Zbar = CartCoordNew[0] * sin(CartCoordNew[1]) * sin(CartCoordNew[2]); - CartCoordNew[0] = Xbar + X_0; CartCoordNew[1] = Ybar + Y_0; CartCoordNew[2] = Zbar + Z_0; - + CartCoordNew[0] = Xbar + X_0; + CartCoordNew[1] = Ybar + Y_0; + CartCoordNew[2] = Zbar + Z_0; } FFDBox->Set_CartesianCoord(CartCoordNew, iSurfacePoints); @@ -1562,7 +1683,7 @@ su2double CSurfaceMovement::SetCartesianCoord(CGeometry *geometry, CConfig *conf VarCoord[iDim] = CartCoordNew[iDim] - CartCoordOld[iDim]; if ((fabs(VarCoord[iDim]) <= EPS) && (config->GetDirectDiff() != D_DESIGN) && (!config->GetAD_Mode())) VarCoord[iDim] = 0.0; - Diff += (VarCoord[iDim]*VarCoord[iDim]); + Diff += (VarCoord[iDim] * VarCoord[iDim]); } Diff = sqrt(Diff); @@ -1571,24 +1692,20 @@ su2double CSurfaceMovement::SetCartesianCoord(CGeometry *geometry, CConfig *conf /*--- Set the variation of the coordinates ---*/ geometry->vertex[iMarker][iVertex]->SetVarCoord(VarCoord); - } } SU2_MPI::Allreduce(&my_MaxDiff, &MaxDiff, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); if (rank == MASTER_NODE) - cout << "Update cartesian coord | FFD box: " << FFDBox->GetTag() << ". Max Diff: " << MaxDiff <<"."<< endl; + cout << "Update cartesian coord | FFD box: " << FFDBox->GetTag() << ". Max Diff: " << MaxDiff << "." << endl; return MaxDiff; - } - -bool CSurfaceMovement::SetFFDCPChange_2D(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, - unsigned short iDV, bool ResetDef) const { - - su2double movement[3] = {0.0,0.0,0.0}, Ampl; +bool CSurfaceMovement::SetFFDCPChange_2D(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, + CFreeFormDefBox** ResetFFDBox, unsigned short iDV, bool ResetDef) const { + su2double movement[3] = {0.0, 0.0, 0.0}, Ampl; unsigned short index[3], i, j, iFFDBox, iPlane; string design_FFDBox; su2double Scale = config->GetOpt_RelaxFactor(); @@ -1597,92 +1714,82 @@ bool CSurfaceMovement::SetFFDCPChange_2D(CGeometry *geometry, CConfig *config, C /*--- Set control points to its original value (even if the design variable is not in this box) ---*/ - if (ResetDef == true) { - for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) - ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); + if (ResetDef) { + for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); } design_FFDBox = config->GetFFDTag(iDV); if (design_FFDBox.compare(FFDBox->GetTag()) == 0) { - /*--- Compute deformation ---*/ /*--- If we have only design value, than this value is the amplitude, * otherwise we have a general movement. ---*/ if (config->GetnDV_Value(iDV) == 1) { + Ampl = config->GetDV_Value(iDV) * Scale; - Ampl = config->GetDV_Value(iDV)*Scale; - - if (polar){ - movement[0] = config->GetParamDV(iDV, 3)*Ampl; + if (polar) { + movement[0] = config->GetParamDV(iDV, 3) * Ampl; movement[1] = 0.0; - movement[2] = config->GetParamDV(iDV, 4)*Ampl; - } - else { - movement[0] = config->GetParamDV(iDV, 3)*Ampl; - movement[1] = config->GetParamDV(iDV, 4)*Ampl; + movement[2] = config->GetParamDV(iDV, 4) * Ampl; + } else { + movement[0] = config->GetParamDV(iDV, 3) * Ampl; + movement[1] = config->GetParamDV(iDV, 4) * Ampl; movement[2] = 0.0; } } else { - if (polar){ + if (polar) { movement[0] = config->GetDV_Value(iDV, 0); movement[1] = 0.0; movement[2] = config->GetDV_Value(iDV, 1); + } else { + movement[0] = config->GetDV_Value(iDV, 0); + movement[1] = config->GetDV_Value(iDV, 1); + movement[2] = 0.0; } - else { - movement[0] = config->GetDV_Value(iDV, 0); - movement[1] = config->GetDV_Value(iDV, 1); - movement[2] = 0.0; - } - } - if (polar){ - index[0] = SU2_TYPE::Int(config->GetParamDV(iDV, 1)); - index[1] = 0; + if (polar) { + index[0] = SU2_TYPE::Int(config->GetParamDV(iDV, 1)); + index[1] = 0; index[2] = SU2_TYPE::Int(config->GetParamDV(iDV, 2)); - } - else { - index[0] = SU2_TYPE::Int(config->GetParamDV(iDV, 1)); - index[1] = SU2_TYPE::Int(config->GetParamDV(iDV, 2)); + } else { + index[0] = SU2_TYPE::Int(config->GetParamDV(iDV, 1)); + index[1] = SU2_TYPE::Int(config->GetParamDV(iDV, 2)); index[2] = 0; } /*--- Check that it is possible to move the control point ---*/ - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_IPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_IPlane(); iPlane++) { if (index[0] == FFDBox->Get_Fix_IPlane(iPlane)) return false; } - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_JPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_JPlane(); iPlane++) { if (index[1] == FFDBox->Get_Fix_JPlane(iPlane)) return false; } - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_KPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_KPlane(); iPlane++) { if (index[2] == FFDBox->Get_Fix_KPlane(iPlane)) return false; } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1)) { + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1)) { for (i = 0; i < FFDBox->GetlOrder(); i++) { index[0] = i; FFDBox->SetControlPoints(index, movement); } } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1)) { + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1)) { for (j = 0; j < FFDBox->GetmOrder(); j++) { index[1] = j; FFDBox->SetControlPoints(index, movement); } } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1)) { + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1)) { for (i = 0; i < FFDBox->GetlOrder(); i++) { index[0] = i; for (j = 0; j < FFDBox->GetmOrder(); j++) { @@ -1691,35 +1798,32 @@ bool CSurfaceMovement::SetFFDCPChange_2D(CGeometry *geometry, CConfig *config, C } } } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1)) { - + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1)) { FFDBox->SetControlPoints(index, movement); } /*--- Upper surface ---*/ - if (polar) index[1] = 1; - else index[2] = 1; + if (polar) + index[1] = 1; + else + index[2] = 1; - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1)) { + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1)) { for (i = 0; i < FFDBox->GetlOrder(); i++) { index[0] = i; FFDBox->SetControlPoints(index, movement); } } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1)) { + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1)) { for (j = 0; j < FFDBox->GetmOrder(); j++) { index[1] = j; FFDBox->SetControlPoints(index, movement); } } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1)) { + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1)) { for (i = 0; i < FFDBox->GetlOrder(); i++) { index[0] = i; for (j = 0; j < FFDBox->GetmOrder(); j++) { @@ -1728,24 +1832,19 @@ bool CSurfaceMovement::SetFFDCPChange_2D(CGeometry *geometry, CConfig *config, C } } } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1)) { - + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1)) { FFDBox->SetControlPoints(index, movement); } - } - else { + } else { return false; } return true; - } -bool CSurfaceMovement::SetFFDCPChange(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, - unsigned short iDV, bool ResetDef) const { - - su2double movement[3] = {0.0,0.0,0.0}, Ampl; +bool CSurfaceMovement::SetFFDCPChange(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, + CFreeFormDefBox** ResetFFDBox, unsigned short iDV, bool ResetDef) const { + su2double movement[3] = {0.0, 0.0, 0.0}, Ampl; unsigned short index[3], i, j, k, iPlane, iFFDBox; bool CheckIndex; string design_FFDBox; @@ -1754,35 +1853,30 @@ bool CSurfaceMovement::SetFFDCPChange(CGeometry *geometry, CConfig *config, CFre /*--- Set control points to its original value (even if the design variable is not in this box) ---*/ - if (ResetDef == true) { + if (ResetDef) { FFDBox->SetOriginalControlPoints(); - for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) - ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); + for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); } design_FFDBox = config->GetFFDTag(iDV); if (design_FFDBox.compare(FFDBox->GetTag()) == 0) { - /*--- Compute deformation ---*/ /*--- If we have only design value, than this value is the amplitude, * otherwise we have a general movement. ---*/ if (config->GetnDV_Value(iDV) == 1) { + Ampl = config->GetDV_Value(iDV) * Scale; - Ampl = config->GetDV_Value(iDV)*Scale; - - movement[0] = config->GetParamDV(iDV, 4)*Ampl; - movement[1] = config->GetParamDV(iDV, 5)*Ampl; - movement[2] = config->GetParamDV(iDV, 6)*Ampl; + movement[0] = config->GetParamDV(iDV, 4) * Ampl; + movement[1] = config->GetParamDV(iDV, 5) * Ampl; + movement[2] = config->GetParamDV(iDV, 6) * Ampl; } else { - movement[0] = config->GetDV_Value(iDV, 0); movement[1] = config->GetDV_Value(iDV, 1); movement[2] = config->GetDV_Value(iDV, 2); - } index[0] = SU2_TYPE::Int(config->GetParamDV(iDV, 1)); @@ -1791,68 +1885,61 @@ bool CSurfaceMovement::SetFFDCPChange(CGeometry *geometry, CConfig *config, CFre /*--- Check that it is possible to move the control point ---*/ - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_IPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_IPlane(); iPlane++) { if (index[0] == FFDBox->Get_Fix_IPlane(iPlane)) return false; } - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_JPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_JPlane(); iPlane++) { if (index[1] == FFDBox->Get_Fix_JPlane(iPlane)) return false; } - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_KPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_KPlane(); iPlane++) { if (index[2] == FFDBox->Get_Fix_KPlane(iPlane)) return false; } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1) && + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 3)) != -1)) { for (i = 0; i < FFDBox->GetlOrder(); i++) { index[0] = i; CheckIndex = true; - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_IPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_IPlane(); iPlane++) { if (index[0] == FFDBox->Get_Fix_IPlane(iPlane)) CheckIndex = false; } if (CheckIndex) FFDBox->SetControlPoints(index, movement); - } } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1) && + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 3)) != -1)) { for (j = 0; j < FFDBox->GetmOrder(); j++) { index[1] = j; CheckIndex = true; - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_JPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_JPlane(); iPlane++) { if (index[1] == FFDBox->Get_Fix_JPlane(iPlane)) CheckIndex = false; } if (CheckIndex) FFDBox->SetControlPoints(index, movement); - } } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1) && + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 3)) == -1)) { for (k = 0; k < FFDBox->GetnOrder(); k++) { index[2] = k; CheckIndex = true; - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_KPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_KPlane(); iPlane++) { if (index[2] == FFDBox->Get_Fix_KPlane(iPlane)) CheckIndex = false; } if (CheckIndex) FFDBox->SetControlPoints(index, movement); - } } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1) && + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 3)) != -1)) { for (i = 0; i < FFDBox->GetlOrder(); i++) { index[0] = i; @@ -1863,8 +1950,7 @@ bool CSurfaceMovement::SetFFDCPChange(CGeometry *geometry, CConfig *config, CFre } } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1) && + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 3)) == -1)) { for (j = 0; j < FFDBox->GetmOrder(); j++) { index[1] = j; @@ -1875,8 +1961,7 @@ bool CSurfaceMovement::SetFFDCPChange(CGeometry *geometry, CConfig *config, CFre } } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1) && + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 3)) == -1)) { for (i = 0; i < FFDBox->GetlOrder(); i++) { index[0] = i; @@ -1887,25 +1972,21 @@ bool CSurfaceMovement::SetFFDCPChange(CGeometry *geometry, CConfig *config, CFre } } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1) && + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 3)) != -1)) { FFDBox->SetControlPoints(index, movement); } - } - else { + } else { return false; } return true; - } -bool CSurfaceMovement::SetFFDGull(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, - unsigned short iDV, bool ResetDef) const { - - su2double movement[3] = {0.0,0.0,0.0}, Ampl; +bool CSurfaceMovement::SetFFDGull(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, + CFreeFormDefBox** ResetFFDBox, unsigned short iDV, bool ResetDef) const { + su2double movement[3] = {0.0, 0.0, 0.0}, Ampl; unsigned short index[3], i, k, iPlane, iFFDBox; string design_FFDBox; su2double Scale = config->GetOpt_RelaxFactor(); @@ -1913,19 +1994,17 @@ bool CSurfaceMovement::SetFFDGull(CGeometry *geometry, CConfig *config, CFreeFor /*--- Set control points to its original value (even if the design variable is not in this box) ---*/ - if (ResetDef == true) { + if (ResetDef) { FFDBox->SetOriginalControlPoints(); - for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) - ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); + for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); } design_FFDBox = config->GetFFDTag(iDV); if (design_FFDBox.compare(FFDBox->GetTag()) == 0) { - /*--- Compute deformation ---*/ - Ampl = config->GetDV_Value(iDV)*Scale; + Ampl = config->GetDV_Value(iDV) * Scale; movement[0] = 0.0; movement[1] = 0.0; @@ -1937,7 +2016,7 @@ bool CSurfaceMovement::SetFFDGull(CGeometry *geometry, CConfig *config, CFreeFor /*--- Check that it is possible to move the control point ---*/ - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_JPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_JPlane(); iPlane++) { if (index[1] == FFDBox->Get_Fix_JPlane(iPlane)) return false; } @@ -1949,19 +2028,16 @@ bool CSurfaceMovement::SetFFDGull(CGeometry *geometry, CConfig *config, CFreeFor } } - } - else { + } else { return false; } return true; - } -bool CSurfaceMovement::SetFFDNacelle(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, - unsigned short iDV, bool ResetDef) const { - - su2double movement[3] = {0.0,0.0,0.0}, Ampl; +bool CSurfaceMovement::SetFFDNacelle(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, + CFreeFormDefBox** ResetFFDBox, unsigned short iDV, bool ResetDef) const { + su2double movement[3] = {0.0, 0.0, 0.0}, Ampl; unsigned short index[3], i, j, k, iPlane, iFFDBox, Theta, ThetaMax; string design_FFDBox; bool SameCP = false; @@ -1970,52 +2046,48 @@ bool CSurfaceMovement::SetFFDNacelle(CGeometry *geometry, CConfig *config, CFree /*--- Set control points to its original value (even if the design variable is not in this box) ---*/ - if (ResetDef == true) { + if (ResetDef) { FFDBox->SetOriginalControlPoints(); - for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) - ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); + for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); } design_FFDBox = config->GetFFDTag(iDV); if (design_FFDBox.compare(FFDBox->GetTag()) == 0) { - /*--- Compute deformation ---*/ - Ampl = config->GetDV_Value(iDV)*Scale; + Ampl = config->GetDV_Value(iDV) * Scale; - movement[0] = config->GetParamDV(iDV, 4)*Ampl; + movement[0] = config->GetParamDV(iDV, 4) * Ampl; movement[1] = 0.0; - movement[2] = config->GetParamDV(iDV, 5)*Ampl; + movement[2] = config->GetParamDV(iDV, 5) * Ampl; index[0] = SU2_TYPE::Int(config->GetParamDV(iDV, 1)); index[1] = SU2_TYPE::Int(config->GetParamDV(iDV, 2)); index[2] = SU2_TYPE::Int(config->GetParamDV(iDV, 3)); - if (index[1] == SU2_TYPE::Int(FFDBox->GetmOrder()) - index[1] -1) SameCP = true; + if (index[1] == SU2_TYPE::Int(FFDBox->GetmOrder()) - index[1] - 1) SameCP = true; ThetaMax = 2; if (SameCP) ThetaMax = 1; for (Theta = 0; Theta < ThetaMax; Theta++) { - - if (Theta == 1) index[1] = SU2_TYPE::Int(FFDBox->GetmOrder()) - index[1] -1; + if (Theta == 1) index[1] = SU2_TYPE::Int(FFDBox->GetmOrder()) - index[1] - 1; /*--- Check that it is possible to move the control point ---*/ - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_IPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_IPlane(); iPlane++) { if (index[0] == FFDBox->Get_Fix_IPlane(iPlane)) return false; } - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_JPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_JPlane(); iPlane++) { if (index[1] == FFDBox->Get_Fix_JPlane(iPlane)) return false; } - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_KPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_KPlane(); iPlane++) { if (index[2] == FFDBox->Get_Fix_KPlane(iPlane)) return false; } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1) && + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 3)) != -1)) { for (i = 0; i < FFDBox->GetlOrder(); i++) { index[0] = i; @@ -2023,8 +2095,7 @@ bool CSurfaceMovement::SetFFDNacelle(CGeometry *geometry, CConfig *config, CFree } } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1) && + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 3)) != -1)) { for (j = 0; j < FFDBox->GetmOrder(); j++) { index[1] = j; @@ -2032,8 +2103,7 @@ bool CSurfaceMovement::SetFFDNacelle(CGeometry *geometry, CConfig *config, CFree } } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1) && + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 3)) == -1)) { for (k = 0; k < FFDBox->GetnOrder(); k++) { index[2] = k; @@ -2041,8 +2111,7 @@ bool CSurfaceMovement::SetFFDNacelle(CGeometry *geometry, CConfig *config, CFree } } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1) && + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 3)) != -1)) { for (i = 0; i < FFDBox->GetlOrder(); i++) { index[0] = i; @@ -2053,8 +2122,7 @@ bool CSurfaceMovement::SetFFDNacelle(CGeometry *geometry, CConfig *config, CFree } } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1) && + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) == -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 3)) == -1)) { for (j = 0; j < FFDBox->GetmOrder(); j++) { index[1] = j; @@ -2065,8 +2133,7 @@ bool CSurfaceMovement::SetFFDNacelle(CGeometry *geometry, CConfig *config, CFree } } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1) && + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) == -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 3)) == -1)) { for (i = 0; i < FFDBox->GetlOrder(); i++) { index[0] = i; @@ -2077,26 +2144,22 @@ bool CSurfaceMovement::SetFFDNacelle(CGeometry *geometry, CConfig *config, CFree } } - if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && - (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1) && + if ((SU2_TYPE::Int(config->GetParamDV(iDV, 1)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 2)) != -1) && (SU2_TYPE::Int(config->GetParamDV(iDV, 3)) != -1)) { FFDBox->SetControlPoints(index, movement); } } - } - else { + } else { return false; } return true; - } -bool CSurfaceMovement::SetFFDCamber_2D(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, - unsigned short iDV, bool ResetDef) const { - - su2double Ampl, movement[3] = {0.0,0.0,0.0}; +bool CSurfaceMovement::SetFFDCamber_2D(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, + CFreeFormDefBox** ResetFFDBox, unsigned short iDV, bool ResetDef) const { + su2double Ampl, movement[3] = {0.0, 0.0, 0.0}; unsigned short index[3], kIndex, iFFDBox; string design_FFDBox; su2double Scale = config->GetOpt_RelaxFactor(); @@ -2104,45 +2167,42 @@ bool CSurfaceMovement::SetFFDCamber_2D(CGeometry *geometry, CConfig *config, CFr /*--- Set control points to its original value (even if the design variable is not in this box) ---*/ - if (ResetDef == true) { - for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) - ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); + if (ResetDef) { + for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); } design_FFDBox = config->GetFFDTag(iDV); if (design_FFDBox.compare(FFDBox->GetTag()) == 0) { - for (kIndex = 0; kIndex < 2; kIndex++) { - - Ampl = config->GetDV_Value(iDV)*Scale; + Ampl = config->GetDV_Value(iDV) * Scale; movement[0] = 0.0; - if (kIndex == 0) movement[1] = Ampl; - else movement[1] = Ampl; + if (kIndex == 0) + movement[1] = Ampl; + else + movement[1] = Ampl; movement[2] = 0.0; - index[0] = SU2_TYPE::Int(config->GetParamDV(iDV, 1)); index[1] = kIndex; index[2] = 0; + index[0] = SU2_TYPE::Int(config->GetParamDV(iDV, 1)); + index[1] = kIndex; + index[2] = 0; FFDBox->SetControlPoints(index, movement); index[2] = 1; FFDBox->SetControlPoints(index, movement); - } - } - else { + } else { return false; } return true; - } -bool CSurfaceMovement::SetFFDThickness_2D(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, - unsigned short iDV, bool ResetDef) const { - - su2double Ampl, movement[3]= {0.0,0.0,0.0}; +bool CSurfaceMovement::SetFFDThickness_2D(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, + CFreeFormDefBox** ResetFFDBox, unsigned short iDV, bool ResetDef) const { + su2double Ampl, movement[3] = {0.0, 0.0, 0.0}; unsigned short index[3], kIndex, iFFDBox; string design_FFDBox; su2double Scale = config->GetOpt_RelaxFactor(); @@ -2150,52 +2210,42 @@ bool CSurfaceMovement::SetFFDThickness_2D(CGeometry *geometry, CConfig *config, /*--- Set control points to its original value (even if the design variable is not in this box) ---*/ - if (ResetDef == true) { - for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) - ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); + if (ResetDef) { + for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); } design_FFDBox = config->GetFFDTag(iDV); if (design_FFDBox.compare(FFDBox->GetTag()) == 0) { - for (kIndex = 0; kIndex < 2; kIndex++) { - - Ampl = config->GetDV_Value(iDV)*Scale; + Ampl = config->GetDV_Value(iDV) * Scale; movement[0] = 0.0; - if (kIndex == 0) movement[1] = -Ampl; - else movement[1] = Ampl; + if (kIndex == 0) + movement[1] = -Ampl; + else + movement[1] = Ampl; movement[2] = 0.0; - index[0] = SU2_TYPE::Int(config->GetParamDV(iDV, 1)); index[1] = kIndex; index[2] = 0; + index[0] = SU2_TYPE::Int(config->GetParamDV(iDV, 1)); + index[1] = kIndex; + index[2] = 0; FFDBox->SetControlPoints(index, movement); index[2] = 1; FFDBox->SetControlPoints(index, movement); - } - } - else { - return false; - } - - return true; - -} - -bool CSurfaceMovement::SetFFDTwist_2D(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, - unsigned short iDV, bool ResetDef) { + } else { + return false; + } return true; - } -bool CSurfaceMovement::SetFFDCamber(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, - unsigned short iDV, bool ResetDef) const { - - su2double Ampl, movement[3] = {0.0,0.0,0.0}; +bool CSurfaceMovement::SetFFDCamber(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, + CFreeFormDefBox** ResetFFDBox, unsigned short iDV, bool ResetDef) const { + su2double Ampl, movement[3] = {0.0, 0.0, 0.0}; unsigned short index[3], kIndex, iPlane, iFFDBox; string design_FFDBox; su2double Scale = config->GetOpt_RelaxFactor(); @@ -2203,77 +2253,69 @@ bool CSurfaceMovement::SetFFDCamber(CGeometry *geometry, CConfig *config, CFreeF /*--- Set control points to its original value (even if the design variable is not in this box) ---*/ - if (ResetDef == true) { - for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) - ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); + if (ResetDef) { + for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); } design_FFDBox = config->GetFFDTag(iDV); if (design_FFDBox.compare(FFDBox->GetTag()) == 0) { - /*--- Check that it is possible to move the control point ---*/ for (kIndex = 0; kIndex < 2; kIndex++) { - index[0] = SU2_TYPE::Int(config->GetParamDV(iDV, 1)); index[1] = SU2_TYPE::Int(config->GetParamDV(iDV, 2)); index[2] = kIndex; - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_IPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_IPlane(); iPlane++) { if (index[0] == FFDBox->Get_Fix_IPlane(iPlane)) return false; } - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_JPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_JPlane(); iPlane++) { if (index[1] == FFDBox->Get_Fix_JPlane(iPlane)) return false; } - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_KPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_KPlane(); iPlane++) { if (index[2] == FFDBox->Get_Fix_KPlane(iPlane)) return false; } - } for (kIndex = 0; kIndex < 2; kIndex++) { - - Ampl = config->GetDV_Value(iDV)*Scale; + Ampl = config->GetDV_Value(iDV) * Scale; index[0] = SU2_TYPE::Int(config->GetParamDV(iDV, 1)); index[1] = SU2_TYPE::Int(config->GetParamDV(iDV, 2)); index[2] = kIndex; - movement[0] = 0.0; movement[1] = 0.0; - if (kIndex == 0) movement[2] = Ampl; - else movement[2] = Ampl; + movement[0] = 0.0; + movement[1] = 0.0; + if (kIndex == 0) + movement[2] = Ampl; + else + movement[2] = Ampl; FFDBox->SetControlPoints(index, movement); - } - } - else { + } else { return false; } return true; - } -void CSurfaceMovement::SetFFDAngleOfAttack(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, - unsigned short iDV, bool ResetDef) { - +void CSurfaceMovement::SetFFDAngleOfAttack(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, + CFreeFormDefBox** ResetFFDBox, unsigned short iDV, bool ResetDef) { su2double Scale = config->GetOpt_RelaxFactor(); - su2double Ampl = config->GetDV_Value(iDV)*Scale; + su2double Ampl = config->GetDV_Value(iDV) * Scale; config->SetAoA_Offset(Ampl); - } -bool CSurfaceMovement::SetFFDThickness(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, - unsigned short iDV, bool ResetDef) const { - - su2double Ampl, movement[3] = {0.0,0.0,0.0}; +bool CSurfaceMovement::SetFFDThickness(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, + CFreeFormDefBox** ResetFFDBox, unsigned short iDV, bool ResetDef) const { + su2double Ampl, movement[3] = {0.0, 0.0, 0.0}; unsigned short index[3], kIndex, iPlane, iFFDBox; string design_FFDBox; su2double Scale = config->GetOpt_RelaxFactor(); @@ -2281,69 +2323,62 @@ bool CSurfaceMovement::SetFFDThickness(CGeometry *geometry, CConfig *config, CFr /*--- Set control points to its original value (even if the design variable is not in this box) ---*/ - if (ResetDef == true) { - for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) - ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); + if (ResetDef) { + for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); } design_FFDBox = config->GetFFDTag(iDV); if (design_FFDBox.compare(FFDBox->GetTag()) == 0) { - /*--- Check that it is possible to move the control point ---*/ for (kIndex = 0; kIndex < 2; kIndex++) { - index[0] = SU2_TYPE::Int(config->GetParamDV(iDV, 1)); index[1] = SU2_TYPE::Int(config->GetParamDV(iDV, 2)); index[2] = kIndex; - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_IPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_IPlane(); iPlane++) { if (index[0] == FFDBox->Get_Fix_IPlane(iPlane)) return false; } - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_JPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_JPlane(); iPlane++) { if (index[1] == FFDBox->Get_Fix_JPlane(iPlane)) return false; } - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_KPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_KPlane(); iPlane++) { if (index[2] == FFDBox->Get_Fix_KPlane(iPlane)) return false; } - } - for (kIndex = 0; kIndex < 2; kIndex++) { - - Ampl = config->GetDV_Value(iDV)*Scale; + Ampl = config->GetDV_Value(iDV) * Scale; index[0] = SU2_TYPE::Int(config->GetParamDV(iDV, 1)); index[1] = SU2_TYPE::Int(config->GetParamDV(iDV, 2)); index[2] = kIndex; - movement[0] = 0.0; movement[1] = 0.0; - if (kIndex == 0) movement[2] = -Ampl; - else movement[2] = Ampl; + movement[0] = 0.0; + movement[1] = 0.0; + if (kIndex == 0) + movement[2] = -Ampl; + else + movement[2] = Ampl; FFDBox->SetControlPoints(index, movement); - } - } - else { + } else { return false; } return true; - } -bool CSurfaceMovement::SetFFDTwist(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, - unsigned short iDV, bool ResetDef) const { - +bool CSurfaceMovement::SetFFDTwist(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, + CFreeFormDefBox** ResetFFDBox, unsigned short iDV, bool ResetDef) const { unsigned short iOrder, jOrder, kOrder; - su2double x, y, z, movement[3], Segment_P0[3], Segment_P1[3], Plane_P0[3], Plane_Normal[3], - Variable_P0, Variable_P1, Intersection[3], Variable_Interp; + su2double x, y, z, movement[3], Segment_P0[3], Segment_P1[3], Plane_P0[3], Plane_Normal[3], Variable_P0, Variable_P1, + Intersection[3], Variable_Interp; unsigned short index[3], iPlane, iFFDBox; string design_FFDBox; su2double Scale = config->GetOpt_RelaxFactor(); @@ -2351,19 +2386,17 @@ bool CSurfaceMovement::SetFFDTwist(CGeometry *geometry, CConfig *config, CFreeFo /*--- Set control points to its original value (even if the design variable is not in this box) ---*/ - if (ResetDef == true) { - for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) - ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); + if (ResetDef) { + for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); } design_FFDBox = config->GetFFDTag(iDV); if (design_FFDBox.compare(FFDBox->GetTag()) == 0) { - /*--- Check that it is possible to move the control point ---*/ jOrder = SU2_TYPE::Int(config->GetParamDV(iDV, 1)); - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_JPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_JPlane(); iPlane++) { if (jOrder == FFDBox->Get_Fix_JPlane(iPlane)) return false; } @@ -2380,19 +2413,25 @@ bool CSurfaceMovement::SetFFDTwist(CGeometry *geometry, CConfig *config, CFreeFo iOrder = 0; jOrder = SU2_TYPE::Int(config->GetParamDV(iDV, 1)); kOrder = 0; - su2double *coord = FFDBox->GetCoordControlPoints(iOrder, jOrder, kOrder); - Plane_P0[0] = coord[0]; Plane_P0[1] = coord[1]; Plane_P0[2] = coord[2]; - Plane_Normal[0] = 0.0; Plane_Normal[1] = 1.0; Plane_Normal[2] = 0.0; + su2double* coord = FFDBox->GetCoordControlPoints(iOrder, jOrder, kOrder); + Plane_P0[0] = coord[0]; + Plane_P0[1] = coord[1]; + Plane_P0[2] = coord[2]; + Plane_Normal[0] = 0.0; + Plane_Normal[1] = 1.0; + Plane_Normal[2] = 0.0; - Variable_P0 = 0.0; Variable_P1 = 0.0; + Variable_P0 = 0.0; + Variable_P1 = 0.0; - Intersection[0] = 0.0; Intersection[1] = 0.0; Intersection[2] = 0.0; + Intersection[0] = 0.0; + Intersection[1] = 0.0; + Intersection[2] = 0.0; - bool result = geometry->SegmentIntersectsPlane(Segment_P0, Segment_P1, Variable_P0, Variable_P1, - Plane_P0, Plane_Normal, Intersection, Variable_Interp); + bool result = geometry->SegmentIntersectsPlane(Segment_P0, Segment_P1, Variable_P0, Variable_P1, Plane_P0, + Plane_Normal, Intersection, Variable_Interp); if (result) { - /*--- xyz-coordinates of a point on the line of rotation. ---*/ su2double a = Intersection[0]; @@ -2409,75 +2448,82 @@ bool CSurfaceMovement::SetFFDTwist(CGeometry *geometry, CConfig *config, CFreeFo otherwise it is difficult to compare with other length based design variables. ---*/ su2double RefLength = config->GetRefLength(); - su2double theta = atan(config->GetDV_Value(iDV)*Scale/RefLength); + su2double theta = atan(config->GetDV_Value(iDV) * Scale / RefLength); /*--- An intermediate value used in computations. ---*/ - su2double u2=u*u; su2double v2=v*v; su2double w2=w*w; - su2double l2 = u2 + v2 + w2; su2double l = sqrt(l2); - su2double cosT; su2double sinT; + su2double u2 = u * u; + su2double v2 = v * v; + su2double w2 = w * w; + su2double l2 = u2 + v2 + w2; + su2double l = sqrt(l2); + su2double cosT; + su2double sinT; /*--- Change the value of the control point if move is true ---*/ jOrder = SU2_TYPE::Int(config->GetParamDV(iDV, 1)); for (iOrder = 0; iOrder < FFDBox->GetlOrder(); iOrder++) for (kOrder = 0; kOrder < FFDBox->GetnOrder(); kOrder++) { - index[0] = iOrder; index[1] = jOrder; index[2] = kOrder; - su2double *coord = FFDBox->GetCoordControlPoints(iOrder, jOrder, kOrder); - x = coord[0]; y = coord[1]; z = coord[2]; + index[0] = iOrder; + index[1] = jOrder; + index[2] = kOrder; + su2double* coord = FFDBox->GetCoordControlPoints(iOrder, jOrder, kOrder); + x = coord[0]; + y = coord[1]; + z = coord[2]; cosT = cos(theta); sinT = sin(theta); - movement[0] = a*(v2 + w2) + u*(-b*v - c*w + u*x + v*y + w*z) - + (-a*(v2 + w2) + u*(b*v + c*w - v*y - w*z) + (v2 + w2)*x)*cosT - + l*(-c*v + b*w - w*y + v*z)*sinT; - movement[0] = movement[0]/l2 - x; + movement[0] = a * (v2 + w2) + u * (-b * v - c * w + u * x + v * y + w * z) + + (-a * (v2 + w2) + u * (b * v + c * w - v * y - w * z) + (v2 + w2) * x) * cosT + + l * (-c * v + b * w - w * y + v * z) * sinT; + movement[0] = movement[0] / l2 - x; - movement[1] = b*(u2 + w2) + v*(-a*u - c*w + u*x + v*y + w*z) - + (-b*(u2 + w2) + v*(a*u + c*w - u*x - w*z) + (u2 + w2)*y)*cosT - + l*(c*u - a*w + w*x - u*z)*sinT; - movement[1] = movement[1]/l2 - y; + movement[1] = b * (u2 + w2) + v * (-a * u - c * w + u * x + v * y + w * z) + + (-b * (u2 + w2) + v * (a * u + c * w - u * x - w * z) + (u2 + w2) * y) * cosT + + l * (c * u - a * w + w * x - u * z) * sinT; + movement[1] = movement[1] / l2 - y; - movement[2] = c*(u2 + v2) + w*(-a*u - b*v + u*x + v*y + w*z) - + (-c*(u2 + v2) + w*(a*u + b*v - u*x - v*y) + (u2 + v2)*z)*cosT - + l*(-b*u + a*v - v*x + u*y)*sinT; - movement[2] = movement[2]/l2 - z; + movement[2] = c * (u2 + v2) + w * (-a * u - b * v + u * x + v * y + w * z) + + (-c * (u2 + v2) + w * (a * u + b * v - u * x - v * y) + (u2 + v2) * z) * cosT + + l * (-b * u + a * v - v * x + u * y) * sinT; + movement[2] = movement[2] / l2 - z; /*--- Check that it is possible to move the control point ---*/ - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_IPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_IPlane(); iPlane++) { if (iOrder == FFDBox->Get_Fix_IPlane(iPlane)) { - movement[0] = 0.0; movement[1] = 0.0; movement[2] = 0.0; + movement[0] = 0.0; + movement[1] = 0.0; + movement[2] = 0.0; } } - for (iPlane = 0 ; iPlane < FFDBox->Get_nFix_KPlane(); iPlane++) { + for (iPlane = 0; iPlane < FFDBox->Get_nFix_KPlane(); iPlane++) { if (kOrder == FFDBox->Get_Fix_KPlane(iPlane)) { - movement[0] = 0.0; movement[1] = 0.0; movement[2] = 0.0; + movement[0] = 0.0; + movement[1] = 0.0; + movement[2] = 0.0; } } FFDBox->SetControlPoints(index, movement); - } - } - } - else { + } else { return false; } return true; - } -bool CSurfaceMovement::SetFFDRotation(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, - unsigned short iDV, bool ResetDef) const { - +bool CSurfaceMovement::SetFFDRotation(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, + CFreeFormDefBox** ResetFFDBox, unsigned short iDV, bool ResetDef) const { unsigned short iOrder, jOrder, kOrder; - su2double movement[3] = {0.0,0.0,0.0}, x, y, z; + su2double movement[3] = {0.0, 0.0, 0.0}, x, y, z; unsigned short index[3], iFFDBox; string design_FFDBox; su2double Scale = config->GetOpt_RelaxFactor(); @@ -2485,15 +2531,13 @@ bool CSurfaceMovement::SetFFDRotation(CGeometry *geometry, CConfig *config, CFre /*--- Set control points to its original value (even if the design variable is not in this box) ---*/ - if (ResetDef == true) { - for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) - ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); + if (ResetDef) { + for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); } design_FFDBox = config->GetFFDTag(iDV); if (design_FFDBox.compare(FFDBox->GetTag()) == 0) { - /*--- xyz-coordinates of a point on the line of rotation. ---*/ su2double a = config->GetParamDV(iDV, 1); @@ -2502,60 +2546,64 @@ bool CSurfaceMovement::SetFFDRotation(CGeometry *geometry, CConfig *config, CFre /*--- xyz-coordinate of the line's direction vector. ---*/ - su2double u = config->GetParamDV(iDV, 4)-config->GetParamDV(iDV, 1); - su2double v = config->GetParamDV(iDV, 5)-config->GetParamDV(iDV, 2); - su2double w = config->GetParamDV(iDV, 6)-config->GetParamDV(iDV, 3); + su2double u = config->GetParamDV(iDV, 4) - config->GetParamDV(iDV, 1); + su2double v = config->GetParamDV(iDV, 5) - config->GetParamDV(iDV, 2); + su2double w = config->GetParamDV(iDV, 6) - config->GetParamDV(iDV, 3); /*--- The angle of rotation. ---*/ - su2double theta = config->GetDV_Value(iDV)*Scale*PI_NUMBER/180.0; + su2double theta = config->GetDV_Value(iDV) * Scale * PI_NUMBER / 180.0; /*--- An intermediate value used in computations. ---*/ - su2double u2=u*u; su2double v2=v*v; su2double w2=w*w; - su2double cosT = cos(theta); su2double sinT = sin(theta); - su2double l2 = u2 + v2 + w2; su2double l = sqrt(l2); + su2double u2 = u * u; + su2double v2 = v * v; + su2double w2 = w * w; + su2double cosT = cos(theta); + su2double sinT = sin(theta); + su2double l2 = u2 + v2 + w2; + su2double l = sqrt(l2); /*--- Change the value of the control point if move is true ---*/ for (iOrder = 0; iOrder < FFDBox->GetlOrder(); iOrder++) for (jOrder = 0; jOrder < FFDBox->GetmOrder(); jOrder++) for (kOrder = 0; kOrder < FFDBox->GetnOrder(); kOrder++) { - index[0] = iOrder; index[1] = jOrder; index[2] = kOrder; - su2double *coord = FFDBox->GetCoordControlPoints(iOrder, jOrder, kOrder); - x = coord[0]; y = coord[1]; z = coord[2]; - movement[0] = a*(v2 + w2) + u*(-b*v - c*w + u*x + v*y + w*z) - + (-a*(v2 + w2) + u*(b*v + c*w - v*y - w*z) + (v2 + w2)*x)*cosT - + l*(-c*v + b*w - w*y + v*z)*sinT; - movement[0] = movement[0]/l2 - x; - - movement[1] = b*(u2 + w2) + v*(-a*u - c*w + u*x + v*y + w*z) - + (-b*(u2 + w2) + v*(a*u + c*w - u*x - w*z) + (u2 + w2)*y)*cosT - + l*(c*u - a*w + w*x - u*z)*sinT; - movement[1] = movement[1]/l2 - y; - - movement[2] = c*(u2 + v2) + w*(-a*u - b*v + u*x + v*y + w*z) - + (-c*(u2 + v2) + w*(a*u + b*v - u*x - v*y) + (u2 + v2)*z)*cosT - + l*(-b*u + a*v - v*x + u*y)*sinT; - movement[2] = movement[2]/l2 - z; + index[0] = iOrder; + index[1] = jOrder; + index[2] = kOrder; + su2double* coord = FFDBox->GetCoordControlPoints(iOrder, jOrder, kOrder); + x = coord[0]; + y = coord[1]; + z = coord[2]; + movement[0] = a * (v2 + w2) + u * (-b * v - c * w + u * x + v * y + w * z) + + (-a * (v2 + w2) + u * (b * v + c * w - v * y - w * z) + (v2 + w2) * x) * cosT + + l * (-c * v + b * w - w * y + v * z) * sinT; + movement[0] = movement[0] / l2 - x; + + movement[1] = b * (u2 + w2) + v * (-a * u - c * w + u * x + v * y + w * z) + + (-b * (u2 + w2) + v * (a * u + c * w - u * x - w * z) + (u2 + w2) * y) * cosT + + l * (c * u - a * w + w * x - u * z) * sinT; + movement[1] = movement[1] / l2 - y; + + movement[2] = c * (u2 + v2) + w * (-a * u - b * v + u * x + v * y + w * z) + + (-c * (u2 + v2) + w * (a * u + b * v - u * x - v * y) + (u2 + v2) * z) * cosT + + l * (-b * u + a * v - v * x + u * y) * sinT; + movement[2] = movement[2] / l2 - z; FFDBox->SetControlPoints(index, movement); - } - } - else { + } else { return false; } return true; - } -bool CSurfaceMovement::SetFFDControl_Surface(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox, CFreeFormDefBox **ResetFFDBox, - unsigned short iDV, bool ResetDef) const { - +bool CSurfaceMovement::SetFFDControl_Surface(CGeometry* geometry, CConfig* config, CFreeFormDefBox* FFDBox, + CFreeFormDefBox** ResetFFDBox, unsigned short iDV, bool ResetDef) const { unsigned short iOrder, jOrder, kOrder; - su2double movement[3] = {0.0,0.0,0.0}, x, y, z; + su2double movement[3] = {0.0, 0.0, 0.0}, x, y, z; unsigned short index[3], iFFDBox; string design_FFDBox; su2double Scale = config->GetOpt_RelaxFactor(); @@ -2563,15 +2611,13 @@ bool CSurfaceMovement::SetFFDControl_Surface(CGeometry *geometry, CConfig *confi /*--- Set control points to its original value (even if the design variable is not in this box) ---*/ - if (ResetDef == true) { - for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) - ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); + if (ResetDef) { + for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) ResetFFDBox[iFFDBox]->SetOriginalControlPoints(); } design_FFDBox = config->GetFFDTag(iDV); if (design_FFDBox.compare(FFDBox->GetTag()) == 0) { - /*--- xyz-coordinates of a point on the line of rotation. ---*/ su2double a = config->GetParamDV(iDV, 1); @@ -2580,79 +2626,84 @@ bool CSurfaceMovement::SetFFDControl_Surface(CGeometry *geometry, CConfig *confi /*--- xyz-coordinate of the line's direction vector. ---*/ - su2double u = config->GetParamDV(iDV, 4)-config->GetParamDV(iDV, 1); - su2double v = config->GetParamDV(iDV, 5)-config->GetParamDV(iDV, 2); - su2double w = config->GetParamDV(iDV, 6)-config->GetParamDV(iDV, 3); + su2double u = config->GetParamDV(iDV, 4) - config->GetParamDV(iDV, 1); + su2double v = config->GetParamDV(iDV, 5) - config->GetParamDV(iDV, 2); + su2double w = config->GetParamDV(iDV, 6) - config->GetParamDV(iDV, 3); /*--- The angle of rotation. ---*/ - su2double theta = -config->GetDV_Value(iDV)*Scale*PI_NUMBER/180.0; + su2double theta = -config->GetDV_Value(iDV) * Scale * PI_NUMBER / 180.0; /*--- An intermediate value used in computations. ---*/ - su2double u2=u*u; su2double v2=v*v; su2double w2=w*w; - su2double cosT = cos(theta); su2double sinT = sin(theta); - su2double l2 = u2 + v2 + w2; su2double l = sqrt(l2); + su2double u2 = u * u; + su2double v2 = v * v; + su2double w2 = w * w; + su2double cosT = cos(theta); + su2double sinT = sin(theta); + su2double l2 = u2 + v2 + w2; + su2double l = sqrt(l2); /*--- Change the value of the control point if move is true ---*/ - for (iOrder = 0; iOrder < FFDBox->GetlOrder()-2; iOrder++) - for (jOrder = 2; jOrder < FFDBox->GetmOrder()-2; jOrder++) + for (iOrder = 0; iOrder < FFDBox->GetlOrder() - 2; iOrder++) + for (jOrder = 2; jOrder < FFDBox->GetmOrder() - 2; jOrder++) for (kOrder = 0; kOrder < FFDBox->GetnOrder(); kOrder++) { - index[0] = iOrder; index[1] = jOrder; index[2] = kOrder; - su2double *coord = FFDBox->GetCoordControlPoints(iOrder, jOrder, kOrder); - x = coord[0]; y = coord[1]; z = coord[2]; - movement[0] = a*(v2 + w2) + u*(-b*v - c*w + u*x + v*y + w*z) - + (-a*(v2 + w2) + u*(b*v + c*w - v*y - w*z) + (v2 + w2)*x)*cosT - + l*(-c*v + b*w - w*y + v*z)*sinT; - movement[0] = movement[0]/l2 - x; - - movement[1] = b*(u2 + w2) + v*(-a*u - c*w + u*x + v*y + w*z) - + (-b*(u2 + w2) + v*(a*u + c*w - u*x - w*z) + (u2 + w2)*y)*cosT - + l*(c*u - a*w + w*x - u*z)*sinT; - movement[1] = movement[1]/l2 - y; - - movement[2] = c*(u2 + v2) + w*(-a*u - b*v + u*x + v*y + w*z) - + (-c*(u2 + v2) + w*(a*u + b*v - u*x - v*y) + (u2 + v2)*z)*cosT - + l*(-b*u + a*v - v*x + u*y)*sinT; - movement[2] = movement[2]/l2 - z; + index[0] = iOrder; + index[1] = jOrder; + index[2] = kOrder; + su2double* coord = FFDBox->GetCoordControlPoints(iOrder, jOrder, kOrder); + x = coord[0]; + y = coord[1]; + z = coord[2]; + movement[0] = a * (v2 + w2) + u * (-b * v - c * w + u * x + v * y + w * z) + + (-a * (v2 + w2) + u * (b * v + c * w - v * y - w * z) + (v2 + w2) * x) * cosT + + l * (-c * v + b * w - w * y + v * z) * sinT; + movement[0] = movement[0] / l2 - x; + + movement[1] = b * (u2 + w2) + v * (-a * u - c * w + u * x + v * y + w * z) + + (-b * (u2 + w2) + v * (a * u + c * w - u * x - w * z) + (u2 + w2) * y) * cosT + + l * (c * u - a * w + w * x - u * z) * sinT; + movement[1] = movement[1] / l2 - y; + + movement[2] = c * (u2 + v2) + w * (-a * u - b * v + u * x + v * y + w * z) + + (-c * (u2 + v2) + w * (a * u + b * v - u * x - v * y) + (u2 + v2) * z) * cosT + + l * (-b * u + a * v - v * x + u * y) * sinT; + movement[2] = movement[2] / l2 - z; FFDBox->SetControlPoints(index, movement); - } - } - else { + } else { return false; } return true; - } -void CSurfaceMovement::SetAngleOfAttack(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef) { - +void CSurfaceMovement::SetAngleOfAttack(CGeometry* boundary, CConfig* config, unsigned short iDV, bool ResetDef) { su2double Scale = config->GetOpt_RelaxFactor(); - su2double Ampl = config->GetDV_Value(iDV)*Scale; + su2double Ampl = config->GetDV_Value(iDV) * Scale; config->SetAoA_Offset(Ampl); - } -void CSurfaceMovement::SetHicksHenne(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef) { +void CSurfaceMovement::SetHicksHenne(CGeometry* boundary, CConfig* config, unsigned short iDV, bool ResetDef) { unsigned long iVertex; unsigned short iMarker; - su2double VarCoord[3] = {0.0,0.0,0.0}, VarCoord_[3] = {0.0,0.0,0.0}, *Coord_, *Normal_, ek, fk, - Coord[3] = {0.0,0.0,0.0}, Normal[3] = {0.0,0.0,0.0}, - TPCoord[2] = {0.0, 0.0}, LPCoord[2] = {0.0, 0.0}, Distance, Chord, AoA, ValCos, ValSin; + su2double VarCoord[3] = {0.0, 0.0, 0.0}, VarCoord_[3] = {0.0, 0.0, 0.0}, *Coord_, *Normal_, ek, fk, + Coord[3] = {0.0, 0.0, 0.0}, Normal[3] = {0.0, 0.0, 0.0}, TPCoord[2] = {0.0, 0.0}, LPCoord[2] = {0.0, 0.0}, + Distance, Chord, AoA, ValCos, ValSin; bool upper = true; su2double Scale = config->GetOpt_RelaxFactor(); /*--- Reset airfoil deformation if first deformation or if it required by the solver ---*/ - if ((iDV == 0) || (ResetDef == true)) { + if ((iDV == 0) || (ResetDef)) { for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) { - VarCoord[0] = 0.0; VarCoord[1] = 0.0; VarCoord[2] = 0.0; + VarCoord[0] = 0.0; + VarCoord[1] = 0.0; + VarCoord[2] = 0.0; boundary->vertex[iMarker][iVertex]->SetVarCoord(VarCoord); } } @@ -2662,10 +2713,14 @@ void CSurfaceMovement::SetHicksHenne(CGeometry *boundary, CConfig *config, unsig for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if (config->GetMarker_All_DV(iMarker) == YES) { Coord_ = boundary->vertex[iMarker][0]->GetCoord(); - TPCoord[0] = Coord_[0]; TPCoord[1] = Coord_[1]; + TPCoord[0] = Coord_[0]; + TPCoord[1] = Coord_[1]; for (iVertex = 1; iVertex < boundary->nVertex[iMarker]; iVertex++) { Coord_ = boundary->vertex[iMarker][iVertex]->GetCoord(); - if (Coord_[0] > TPCoord[0]) { TPCoord[0] = Coord_[0]; TPCoord[1] = Coord_[1]; } + if (Coord_[0] > TPCoord[0]) { + TPCoord[0] = Coord_[0]; + TPCoord[1] = Coord_[1]; + } } } } @@ -2675,141 +2730,165 @@ void CSurfaceMovement::SetHicksHenne(CGeometry *boundary, CConfig *config, unsig int iProcessor, nProcessor = size; su2double *Buffer_Send_Coord, *Buffer_Receive_Coord; - Buffer_Receive_Coord = new su2double [nProcessor*2]; - Buffer_Send_Coord = new su2double [2]; + Buffer_Receive_Coord = new su2double[nProcessor * 2]; + Buffer_Send_Coord = new su2double[2]; - Buffer_Send_Coord[0] = TPCoord[0]; Buffer_Send_Coord[1] = TPCoord[1]; + Buffer_Send_Coord[0] = TPCoord[0]; + Buffer_Send_Coord[1] = TPCoord[1]; SU2_MPI::Allgather(Buffer_Send_Coord, 2, MPI_DOUBLE, Buffer_Receive_Coord, 2, MPI_DOUBLE, SU2_MPI::GetComm()); - TPCoord[0] = Buffer_Receive_Coord[0]; TPCoord[1] = Buffer_Receive_Coord[1]; + TPCoord[0] = Buffer_Receive_Coord[0]; + TPCoord[1] = Buffer_Receive_Coord[1]; for (iProcessor = 1; iProcessor < nProcessor; iProcessor++) { - Coord[0] = Buffer_Receive_Coord[iProcessor*2 + 0]; - Coord[1] = Buffer_Receive_Coord[iProcessor*2 + 1]; - if (Coord[0] > TPCoord[0]) { TPCoord[0] = Coord[0]; TPCoord[1] = Coord[1]; } + Coord[0] = Buffer_Receive_Coord[iProcessor * 2 + 0]; + Coord[1] = Buffer_Receive_Coord[iProcessor * 2 + 1]; + if (Coord[0] > TPCoord[0]) { + TPCoord[0] = Coord[0]; + TPCoord[1] = Coord[1]; + } } - delete[] Buffer_Send_Coord; delete[] Buffer_Receive_Coord; + delete[] Buffer_Send_Coord; + delete[] Buffer_Receive_Coord; #endif - Chord = 0.0; for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if (config->GetMarker_All_DV(iMarker) == YES) { for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) { Coord_ = boundary->vertex[iMarker][iVertex]->GetCoord(); Distance = sqrt(pow(Coord_[0] - TPCoord[0], 2.0) + pow(Coord_[1] - TPCoord[1], 2.0)); - if (Chord < Distance) { Chord = Distance; LPCoord[0] = Coord_[0]; LPCoord[1] = Coord_[1]; } + if (Chord < Distance) { + Chord = Distance; + LPCoord[0] = Coord_[0]; + LPCoord[1] = Coord_[1]; + } } } } #ifdef HAVE_MPI - Buffer_Receive_Coord = new su2double [nProcessor*2]; - Buffer_Send_Coord = new su2double [2]; + Buffer_Receive_Coord = new su2double[nProcessor * 2]; + Buffer_Send_Coord = new su2double[2]; - Buffer_Send_Coord[0] = LPCoord[0]; Buffer_Send_Coord[1] = LPCoord[1]; + Buffer_Send_Coord[0] = LPCoord[0]; + Buffer_Send_Coord[1] = LPCoord[1]; SU2_MPI::Allgather(Buffer_Send_Coord, 2, MPI_DOUBLE, Buffer_Receive_Coord, 2, MPI_DOUBLE, SU2_MPI::GetComm()); Chord = 0.0; for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) { - Coord[0] = Buffer_Receive_Coord[iProcessor*2 + 0]; - Coord[1] = Buffer_Receive_Coord[iProcessor*2 + 1]; + Coord[0] = Buffer_Receive_Coord[iProcessor * 2 + 0]; + Coord[1] = Buffer_Receive_Coord[iProcessor * 2 + 1]; Distance = sqrt(pow(Coord[0] - TPCoord[0], 2.0) + pow(Coord[1] - TPCoord[1], 2.0)); - if (Chord < Distance) { Chord = Distance; LPCoord[0] = Coord[0]; LPCoord[1] = Coord[1]; } + if (Chord < Distance) { + Chord = Distance; + LPCoord[0] = Coord[0]; + LPCoord[1] = Coord[1]; + } } - delete[] Buffer_Send_Coord; delete[] Buffer_Receive_Coord; + delete[] Buffer_Send_Coord; + delete[] Buffer_Receive_Coord; #endif - AoA = atan((LPCoord[1] - TPCoord[1]) / (TPCoord[0] - LPCoord[0]))*180/PI_NUMBER; + AoA = atan((LPCoord[1] - TPCoord[1]) / (TPCoord[0] - LPCoord[0])) * 180 / PI_NUMBER; /*--- WARNING: AoA currently overwritten to zero. ---*/ AoA = 0.0; /*--- Perform multiple airfoil deformation ---*/ - su2double Ampl = config->GetDV_Value(iDV)*Scale; + su2double Ampl = config->GetDV_Value(iDV) * Scale; su2double xk = config->GetParamDV(iDV, 1); const su2double t2 = 3.0; - if (config->GetParamDV(iDV, 0) == NO) { upper = false; } - if (config->GetParamDV(iDV, 0) == YES) { upper = true; } + if (config->GetParamDV(iDV, 0) == NO) { + upper = false; + } + if (config->GetParamDV(iDV, 0) == YES) { + upper = true; + } for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) { - VarCoord[0] = 0.0; VarCoord[1] = 0.0; VarCoord[2] = 0.0; + VarCoord[0] = 0.0; + VarCoord[1] = 0.0; + VarCoord[2] = 0.0; if (config->GetMarker_All_DV(iMarker) == YES) { - Coord_ = boundary->vertex[iMarker][iVertex]->GetCoord(); Normal_ = boundary->vertex[iMarker][iVertex]->GetNormal(); /*--- The Hicks Henne bump functions should be applied to a basic airfoil without AoA, and unitary chord, a tranformation is required ---*/ - ValCos = cos(AoA*PI_NUMBER/180.0); - ValSin = sin(AoA*PI_NUMBER/180.0); + ValCos = cos(AoA * PI_NUMBER / 180.0); + ValSin = sin(AoA * PI_NUMBER / 180.0); - Coord[0] = Coord_[0]*ValCos - Coord_[1]*ValSin; - Coord[0] = max(0.0, Coord[0]); // Coord x should be always positive - Coord[1] = Coord_[1]*ValCos + Coord_[0]*ValSin; + Coord[0] = Coord_[0] * ValCos - Coord_[1] * ValSin; + Coord[0] = max(0.0, Coord[0]); // Coord x should be always positive + Coord[1] = Coord_[1] * ValCos + Coord_[0] * ValSin; - Normal[0] = Normal_[0]*ValCos - Normal_[1]*ValSin; - Normal[1] = Normal_[1]*ValCos + Normal_[0]*ValSin; + Normal[0] = Normal_[0] * ValCos - Normal_[1] * ValSin; + Normal[1] = Normal_[1] * ValCos + Normal_[0] * ValSin; /*--- Bump computation ---*/ - ek = log10(0.5)/log10(xk); - if (Coord[0] > 10*EPS) fk = pow( sin( PI_NUMBER * pow(Coord[0], ek) ), t2); - else fk = 0.0; + ek = log10(0.5) / log10(xk); + if (Coord[0] > 10 * EPS) + fk = pow(sin(PI_NUMBER * pow(Coord[0], ek)), t2); + else + fk = 0.0; /*--- Upper and lower surface ---*/ - if (( upper) && (Normal[1] > 0)) { VarCoord[1] = Ampl*fk; } - if ((!upper) && (Normal[1] < 0)) { VarCoord[1] = -Ampl*fk; } - + if ((upper) && (Normal[1] > 0)) { + VarCoord[1] = Ampl * fk; + } + if ((!upper) && (Normal[1] < 0)) { + VarCoord[1] = -Ampl * fk; + } } /*--- Apply the transformation to the coordinate variation ---*/ - ValCos = cos(-AoA*PI_NUMBER/180.0); - ValSin = sin(-AoA*PI_NUMBER/180.0); + ValCos = cos(-AoA * PI_NUMBER / 180.0); + ValSin = sin(-AoA * PI_NUMBER / 180.0); - VarCoord_[0] = VarCoord[0]*ValCos - VarCoord[1]*ValSin; - VarCoord_[1] = VarCoord[1]*ValCos + VarCoord[0]*ValSin; + VarCoord_[0] = VarCoord[0] * ValCos - VarCoord[1] * ValSin; + VarCoord_[1] = VarCoord[1] * ValCos + VarCoord[0] * ValSin; boundary->vertex[iMarker][iVertex]->AddVarCoord(VarCoord_); - } } - } -void CSurfaceMovement::SetSurface_Bump(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef) { +void CSurfaceMovement::SetSurface_Bump(CGeometry* boundary, CConfig* config, unsigned short iDV, bool ResetDef) { unsigned long iVertex; unsigned short iMarker; - su2double VarCoord[3] = {0.0,0.0,0.0}, ek, fk, *Coord, xCoord; + su2double VarCoord[3] = {0.0, 0.0, 0.0}, ek, fk, *Coord, xCoord; su2double Scale = config->GetOpt_RelaxFactor(); /*--- Reset airfoil deformation if first deformation or if it required by the solver ---*/ - if ((iDV == 0) || (ResetDef == true)) { + if ((iDV == 0) || (ResetDef)) { for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) { - VarCoord[0] = 0.0; VarCoord[1] = 0.0; VarCoord[2] = 0.0; + VarCoord[0] = 0.0; + VarCoord[1] = 0.0; + VarCoord[2] = 0.0; boundary->vertex[iMarker][iVertex]->SetVarCoord(VarCoord); } } /*--- Perform multiple airfoil deformation ---*/ - su2double Ampl = config->GetDV_Value(iDV)*Scale; + su2double Ampl = config->GetDV_Value(iDV) * Scale; su2double x_start = config->GetParamDV(iDV, 0); su2double x_end = config->GetParamDV(iDV, 1); su2double BumpSize = x_end - x_start; @@ -2818,60 +2897,68 @@ void CSurfaceMovement::SetSurface_Bump(CGeometry *boundary, CConfig *config, uns const su2double t2 = 3.0; for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) { - VarCoord[0] = 0.0; VarCoord[1] = 0.0; VarCoord[2] = 0.0; + VarCoord[0] = 0.0; + VarCoord[1] = 0.0; + VarCoord[2] = 0.0; if (config->GetMarker_All_DV(iMarker) == YES) { - Coord = boundary->vertex[iMarker][iVertex]->GetCoord(); xCoord = (Coord[0] - BumpLoc); - ek = log10(0.5)/log10((xk-BumpLoc+EPS)/BumpSize); - if (xCoord > 0.0) fk = pow( sin( PI_NUMBER * pow((xCoord+EPS)/BumpSize, ek)), t2); - else fk = 0.0; - - if ((xCoord <= 0.0) || (xCoord >= BumpSize)) VarCoord[1] = 0.0; - else { VarCoord[1] = Ampl*fk; } - + ek = log10(0.5) / log10((xk - BumpLoc + EPS) / BumpSize); + if (xCoord > 0.0) + fk = pow(sin(PI_NUMBER * pow((xCoord + EPS) / BumpSize, ek)), t2); + else + fk = 0.0; + + if ((xCoord <= 0.0) || (xCoord >= BumpSize)) + VarCoord[1] = 0.0; + else { + VarCoord[1] = Ampl * fk; + } } boundary->vertex[iMarker][iVertex]->AddVarCoord(VarCoord); - } } - } -void CSurfaceMovement::SetCST(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef) { +void CSurfaceMovement::SetCST(CGeometry* boundary, CConfig* config, unsigned short iDV, bool ResetDef) { unsigned long iVertex; unsigned short iMarker; - su2double VarCoord[3] = {0.0,0.0,0.0}, VarCoord_[3] = {0.0,0.0,0.0}, *Coord_, *Normal_, fk, - Coord[3] = {0.0,0.0,0.0}, Normal[3] = {0.0,0.0,0.0}, - TPCoord[2] = {0.0, 0.0}, LPCoord[2] = {0.0, 0.0}, Distance, Chord, AoA, ValCos, ValSin; + su2double VarCoord[3] = {0.0, 0.0, 0.0}, VarCoord_[3] = {0.0, 0.0, 0.0}, *Coord_, *Normal_, fk, + Coord[3] = {0.0, 0.0, 0.0}, Normal[3] = {0.0, 0.0, 0.0}, TPCoord[2] = {0.0, 0.0}, LPCoord[2] = {0.0, 0.0}, + Distance, Chord, AoA, ValCos, ValSin; bool upper = true; su2double Scale = config->GetOpt_RelaxFactor(); /*--- Reset airfoil deformation if first deformation or if it required by the solver ---*/ - if ((iDV == 0) || (ResetDef == true)) { + if ((iDV == 0) || (ResetDef)) { for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) { - VarCoord[0] = 0.0; VarCoord[1] = 0.0; VarCoord[2] = 0.0; + VarCoord[0] = 0.0; + VarCoord[1] = 0.0; + VarCoord[2] = 0.0; boundary->vertex[iMarker][iVertex]->SetVarCoord(VarCoord); } } - /*--- Compute the angle of attack to apply the deformation ---*/ + /*--- Compute the angle of attack to apply the deformation ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if (config->GetMarker_All_DV(iMarker) == YES) { Coord_ = boundary->vertex[iMarker][0]->GetCoord(); - TPCoord[0] = Coord_[0]; TPCoord[1] = Coord_[1]; + TPCoord[0] = Coord_[0]; + TPCoord[1] = Coord_[1]; for (iVertex = 1; iVertex < boundary->nVertex[iMarker]; iVertex++) { Coord_ = boundary->vertex[iMarker][iVertex]->GetCoord(); - if (Coord_[0] > TPCoord[0]) { TPCoord[0] = Coord_[0]; TPCoord[1] = Coord_[1]; } + if (Coord_[0] > TPCoord[0]) { + TPCoord[0] = Coord_[0]; + TPCoord[1] = Coord_[1]; + } } } } @@ -2881,65 +2968,80 @@ void CSurfaceMovement::SetCST(CGeometry *boundary, CConfig *config, unsigned sho int iProcessor, nProcessor = size; su2double *Buffer_Send_Coord, *Buffer_Receive_Coord; - Buffer_Receive_Coord = new su2double [nProcessor*2]; - Buffer_Send_Coord = new su2double [2]; + Buffer_Receive_Coord = new su2double[nProcessor * 2]; + Buffer_Send_Coord = new su2double[2]; - Buffer_Send_Coord[0] = TPCoord[0]; Buffer_Send_Coord[1] = TPCoord[1]; + Buffer_Send_Coord[0] = TPCoord[0]; + Buffer_Send_Coord[1] = TPCoord[1]; SU2_MPI::Allgather(Buffer_Send_Coord, 2, MPI_DOUBLE, Buffer_Receive_Coord, 2, MPI_DOUBLE, SU2_MPI::GetComm()); - TPCoord[0] = Buffer_Receive_Coord[0]; TPCoord[1] = Buffer_Receive_Coord[1]; + TPCoord[0] = Buffer_Receive_Coord[0]; + TPCoord[1] = Buffer_Receive_Coord[1]; for (iProcessor = 1; iProcessor < nProcessor; iProcessor++) { - Coord[0] = Buffer_Receive_Coord[iProcessor*2 + 0]; - Coord[1] = Buffer_Receive_Coord[iProcessor*2 + 1]; - if (Coord[0] > TPCoord[0]) { TPCoord[0] = Coord[0]; TPCoord[1] = Coord[1]; } + Coord[0] = Buffer_Receive_Coord[iProcessor * 2 + 0]; + Coord[1] = Buffer_Receive_Coord[iProcessor * 2 + 1]; + if (Coord[0] > TPCoord[0]) { + TPCoord[0] = Coord[0]; + TPCoord[1] = Coord[1]; + } } - delete[] Buffer_Send_Coord; delete[] Buffer_Receive_Coord; + delete[] Buffer_Send_Coord; + delete[] Buffer_Receive_Coord; #endif - Chord = 0.0; for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if (config->GetMarker_All_DV(iMarker) == YES) { for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) { Coord_ = boundary->vertex[iMarker][iVertex]->GetCoord(); Distance = sqrt(pow(Coord_[0] - TPCoord[0], 2.0) + pow(Coord_[1] - TPCoord[1], 2.0)); - if (Chord < Distance) { Chord = Distance; LPCoord[0] = Coord_[0]; LPCoord[1] = Coord_[1]; } + if (Chord < Distance) { + Chord = Distance; + LPCoord[0] = Coord_[0]; + LPCoord[1] = Coord_[1]; + } } } } #ifdef HAVE_MPI - Buffer_Receive_Coord = new su2double [nProcessor*2]; - Buffer_Send_Coord = new su2double [2]; + Buffer_Receive_Coord = new su2double[nProcessor * 2]; + Buffer_Send_Coord = new su2double[2]; - Buffer_Send_Coord[0] = LPCoord[0]; Buffer_Send_Coord[1] = LPCoord[1]; + Buffer_Send_Coord[0] = LPCoord[0]; + Buffer_Send_Coord[1] = LPCoord[1]; SU2_MPI::Allgather(Buffer_Send_Coord, 2, MPI_DOUBLE, Buffer_Receive_Coord, 2, MPI_DOUBLE, SU2_MPI::GetComm()); Chord = 0.0; for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) { - Coord[0] = Buffer_Receive_Coord[iProcessor*2 + 0]; - Coord[1] = Buffer_Receive_Coord[iProcessor*2 + 1]; + Coord[0] = Buffer_Receive_Coord[iProcessor * 2 + 0]; + Coord[1] = Buffer_Receive_Coord[iProcessor * 2 + 1]; Distance = sqrt(pow(Coord[0] - TPCoord[0], 2.0) + pow(Coord[1] - TPCoord[1], 2.0)); - if (Chord < Distance) { Chord = Distance; LPCoord[0] = Coord[0]; LPCoord[1] = Coord[1]; } + if (Chord < Distance) { + Chord = Distance; + LPCoord[0] = Coord[0]; + LPCoord[1] = Coord[1]; + } } - delete[] Buffer_Send_Coord; delete[] Buffer_Receive_Coord; + delete[] Buffer_Send_Coord; + delete[] Buffer_Receive_Coord; #endif - AoA = atan((LPCoord[1] - TPCoord[1]) / (TPCoord[0] - LPCoord[0]))*180/PI_NUMBER; + AoA = atan((LPCoord[1] - TPCoord[1]) / (TPCoord[0] - LPCoord[0])) * 180 / PI_NUMBER; /*--- WARNING: AoA currently overwritten to zero. ---*/ AoA = 0.0; /*--- Perform multiple airfoil deformation ---*/ - su2double Ampl = config->GetDV_Value(iDV)*Scale; + su2double Ampl = config->GetDV_Value(iDV) * Scale; su2double KulfanNum = config->GetParamDV(iDV, 1) - 1.0; su2double maxKulfanNum = config->GetParamDV(iDV, 2) - 1.0; if (KulfanNum < 0) { @@ -2949,88 +3051,98 @@ void CSurfaceMovement::SetCST(CGeometry *boundary, CConfig *config, unsigned sho std::cout << "Warning: Kulfan number should be less than provided maximum." << std::endl; } - if (config->GetParamDV(iDV, 0) == NO) { upper = false;} - if (config->GetParamDV(iDV, 0) == YES) { upper = true;} + if (config->GetParamDV(iDV, 0) == NO) { + upper = false; + } + if (config->GetParamDV(iDV, 0) == YES) { + upper = true; + } for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) { - VarCoord[0] = 0.0; VarCoord[1] = 0.0; VarCoord[2] = 0.0; + VarCoord[0] = 0.0; + VarCoord[1] = 0.0; + VarCoord[2] = 0.0; if (config->GetMarker_All_DV(iMarker) == YES) { - Coord_ = boundary->vertex[iMarker][iVertex]->GetCoord(); Normal_ = boundary->vertex[iMarker][iVertex]->GetNormal(); /*--- The CST functions should be applied to a basic airfoil without AoA, and unitary chord, a tranformation is required ---*/ - ValCos = cos(AoA*PI_NUMBER/180.0); - ValSin = sin(AoA*PI_NUMBER/180.0); + ValCos = cos(AoA * PI_NUMBER / 180.0); + ValSin = sin(AoA * PI_NUMBER / 180.0); - Coord[0] = Coord_[0]*ValCos - Coord_[1]*ValSin; - Coord[0] = max(0.0, Coord[0]); // Coord x should be always positive - Coord[1] = Coord_[1]*ValCos + Coord_[0]*ValSin; + Coord[0] = Coord_[0] * ValCos - Coord_[1] * ValSin; + Coord[0] = max(0.0, Coord[0]); // Coord x should be always positive + Coord[1] = Coord_[1] * ValCos + Coord_[0] * ValSin; - Normal[0] = Normal_[0]*ValCos - Normal_[1]*ValSin; - Normal[1] = Normal_[1]*ValCos + Normal_[0]*ValSin; + Normal[0] = Normal_[0] * ValCos - Normal_[1] * ValSin; + Normal[1] = Normal_[1] * ValCos + Normal_[0] * ValSin; /*--- CST computation ---*/ su2double fact_n = 1; su2double fact_cst = 1; su2double fact_cst_n = 1; - for (int i = 1; i <= maxKulfanNum; i++) { - fact_n = fact_n * i; - } - for (int i = 1; i <= KulfanNum; i++) { - fact_cst = fact_cst * i; - } - for (int i = 1; i <= maxKulfanNum - KulfanNum; i++) { - fact_cst_n = fact_cst_n * i; - } - - // CST method only for 2D NACA type airfoils - su2double N1, N2; - N1 = 0.5; - N2 = 1.0; - - /*--- Upper and lower surface change in coordinates based on CST equations by Kulfan et. al (www.brendakulfan.com/docs/CST3.pdf) ---*/ - fk = pow(Coord[0],N1)*pow((1-Coord[0]), N2) * fact_n/(fact_cst*(fact_cst_n)) * pow(Coord[0], KulfanNum) * pow((1-Coord[0]), (maxKulfanNum-(KulfanNum))); + for (int i = 1; i <= maxKulfanNum; i++) { + fact_n = fact_n * i; + } + for (int i = 1; i <= KulfanNum; i++) { + fact_cst = fact_cst * i; + } + for (int i = 1; i <= maxKulfanNum - KulfanNum; i++) { + fact_cst_n = fact_cst_n * i; + } - if (( upper) && (Normal[1] > 0)) { VarCoord[1] = Ampl*fk; } + // CST method only for 2D NACA type airfoils + su2double N1, N2; + N1 = 0.5; + N2 = 1.0; - if ((!upper) && (Normal[1] < 0)) { VarCoord[1] = Ampl*fk; } + /*--- Upper and lower surface change in coordinates based on CST equations by Kulfan et. al + * (www.brendakulfan.com/docs/CST3.pdf) ---*/ + fk = pow(Coord[0], N1) * pow((1 - Coord[0]), N2) * fact_n / (fact_cst * (fact_cst_n)) * + pow(Coord[0], KulfanNum) * pow((1 - Coord[0]), (maxKulfanNum - (KulfanNum))); + if ((upper) && (Normal[1] > 0)) { + VarCoord[1] = Ampl * fk; + } - } + if ((!upper) && (Normal[1] < 0)) { + VarCoord[1] = Ampl * fk; + } + } /*--- Apply the transformation to the coordinate variation ---*/ - ValCos = cos(-AoA*PI_NUMBER/180.0); - ValSin = sin(-AoA*PI_NUMBER/180.0); + ValCos = cos(-AoA * PI_NUMBER / 180.0); + ValSin = sin(-AoA * PI_NUMBER / 180.0); - VarCoord_[0] = VarCoord[0]*ValCos - VarCoord[1]*ValSin; - VarCoord_[1] = VarCoord[1]*ValCos + VarCoord[0]*ValSin; + VarCoord_[0] = VarCoord[0] * ValCos - VarCoord[1] * ValSin; + VarCoord_[1] = VarCoord[1] * ValCos + VarCoord[0] * ValSin; - boundary->vertex[iMarker][iVertex]->AddVarCoord(VarCoord_); + boundary->vertex[iMarker][iVertex]->AddVarCoord(VarCoord_); } } } -void CSurfaceMovement::SetRotation(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef) { +void CSurfaceMovement::SetRotation(CGeometry* boundary, CConfig* config, unsigned short iDV, bool ResetDef) { unsigned long iVertex; unsigned short iMarker; - su2double VarCoord[3] = {0.0,0.0,0.0}, *Coord; - su2double movement[3] = {0.0,0.0,0.0}, x, y, z; + su2double VarCoord[3] = {0.0, 0.0, 0.0}, *Coord; + su2double movement[3] = {0.0, 0.0, 0.0}, x, y, z; su2double Scale = config->GetOpt_RelaxFactor(); /*--- Reset airfoil deformation if first deformation or if it required by the solver ---*/ - if ((iDV == 0) || (ResetDef == true)) { + if ((iDV == 0) || (ResetDef)) { for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) { - VarCoord[0] = 0.0; VarCoord[1] = 0.0; VarCoord[2] = 0.0; + VarCoord[0] = 0.0; + VarCoord[1] = 0.0; + VarCoord[2] = 0.0; boundary->vertex[iMarker][iVertex]->SetVarCoord(VarCoord); } } @@ -3040,70 +3152,81 @@ void CSurfaceMovement::SetRotation(CGeometry *boundary, CConfig *config, unsigne su2double a = config->GetParamDV(iDV, 0); su2double b = config->GetParamDV(iDV, 1); su2double c = 0.0; - if (boundary->GetnDim() == 3) c = config->GetParamDV(0,2); + if (boundary->GetnDim() == 3) c = config->GetParamDV(0, 2); /*--- xyz-coordinate of the line's direction vector. ---*/ - su2double u = config->GetParamDV(iDV, 3)-config->GetParamDV(iDV, 0); - su2double v = config->GetParamDV(iDV, 4)-config->GetParamDV(iDV, 1); + su2double u = config->GetParamDV(iDV, 3) - config->GetParamDV(iDV, 0); + su2double v = config->GetParamDV(iDV, 4) - config->GetParamDV(iDV, 1); su2double w = 1.0; - if (boundary->GetnDim() == 3) w = config->GetParamDV(iDV, 5)-config->GetParamDV(iDV, 2); + if (boundary->GetnDim() == 3) w = config->GetParamDV(iDV, 5) - config->GetParamDV(iDV, 2); /*--- The angle of rotation. ---*/ - su2double theta = config->GetDV_Value(iDV)*Scale*PI_NUMBER/180.0; + su2double theta = config->GetDV_Value(iDV) * Scale * PI_NUMBER / 180.0; /*--- An intermediate value used in computations. ---*/ - su2double u2=u*u; su2double v2=v*v; su2double w2=w*w; - su2double cosT = cos(theta); su2double sinT = sin(theta); - su2double l2 = u2 + v2 + w2; su2double l = sqrt(l2); + su2double u2 = u * u; + su2double v2 = v * v; + su2double w2 = w * w; + su2double cosT = cos(theta); + su2double sinT = sin(theta); + su2double l2 = u2 + v2 + w2; + su2double l = sqrt(l2); for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) { - VarCoord[0] = 0.0; VarCoord[1] = 0.0; VarCoord[2] = 0.0; + VarCoord[0] = 0.0; + VarCoord[1] = 0.0; + VarCoord[2] = 0.0; if (config->GetMarker_All_DV(iMarker) == YES) { Coord = boundary->vertex[iMarker][iVertex]->GetCoord(); - x = Coord[0]; y = Coord[1]; z = Coord[2]; - - movement[0] = a*(v2 + w2) + u*(-b*v - c*w + u*x + v*y + w*z) - + (-a*(v2 + w2) + u*(b*v + c*w - v*y - w*z) + (v2 + w2)*x)*cosT - + l*(-c*v + b*w - w*y + v*z)*sinT; - movement[0] = movement[0]/l2 - x; - - movement[1] = b*(u2 + w2) + v*(-a*u - c*w + u*x + v*y + w*z) - + (-b*(u2 + w2) + v*(a*u + c*w - u*x - w*z) + (u2 + w2)*y)*cosT - + l*(c*u - a*w + w*x - u*z)*sinT; - movement[1] = movement[1]/l2 - y; - - movement[2] = c*(u2 + v2) + w*(-a*u - b*v + u*x + v*y + w*z) - + (-c*(u2 + v2) + w*(a*u + b*v - u*x - v*y) + (u2 + v2)*z)*cosT - + l*(-b*u + a*v - v*x + u*y)*sinT; - if (boundary->GetnDim() == 3) movement[2] = movement[2]/l2 - z; - else movement[2] = 0.0; + x = Coord[0]; + y = Coord[1]; + z = Coord[2]; + + movement[0] = a * (v2 + w2) + u * (-b * v - c * w + u * x + v * y + w * z) + + (-a * (v2 + w2) + u * (b * v + c * w - v * y - w * z) + (v2 + w2) * x) * cosT + + l * (-c * v + b * w - w * y + v * z) * sinT; + movement[0] = movement[0] / l2 - x; + + movement[1] = b * (u2 + w2) + v * (-a * u - c * w + u * x + v * y + w * z) + + (-b * (u2 + w2) + v * (a * u + c * w - u * x - w * z) + (u2 + w2) * y) * cosT + + l * (c * u - a * w + w * x - u * z) * sinT; + movement[1] = movement[1] / l2 - y; + + movement[2] = c * (u2 + v2) + w * (-a * u - b * v + u * x + v * y + w * z) + + (-c * (u2 + v2) + w * (a * u + b * v - u * x - v * y) + (u2 + v2) * z) * cosT + + l * (-b * u + a * v - v * x + u * y) * sinT; + if (boundary->GetnDim() == 3) + movement[2] = movement[2] / l2 - z; + else + movement[2] = 0.0; VarCoord[0] = movement[0]; VarCoord[1] = movement[1]; if (boundary->GetnDim() == 3) VarCoord[2] = movement[2]; - } boundary->vertex[iMarker][iVertex]->AddVarCoord(VarCoord); } } -void CSurfaceMovement::SetTranslation(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef) { +void CSurfaceMovement::SetTranslation(CGeometry* boundary, CConfig* config, unsigned short iDV, bool ResetDef) { unsigned long iVertex; unsigned short iMarker; - su2double VarCoord[3] = {0.0,0.0,0.0}; + su2double VarCoord[3] = {0.0, 0.0, 0.0}; su2double Scale = config->GetOpt_RelaxFactor(); - su2double Ampl = config->GetDV_Value(iDV)*Scale; + su2double Ampl = config->GetDV_Value(iDV) * Scale; /*--- Reset airfoil deformation if first deformation or if it required by the solver ---*/ - if ((iDV == 0) || (ResetDef == true)) { + if ((iDV == 0) || (ResetDef)) { for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) { - VarCoord[0] = 0.0; VarCoord[1] = 0.0; VarCoord[2] = 0.0; + VarCoord[0] = 0.0; + VarCoord[1] = 0.0; + VarCoord[2] = 0.0; boundary->vertex[iMarker][iVertex]->SetVarCoord(VarCoord); } } @@ -3115,59 +3238,66 @@ void CSurfaceMovement::SetTranslation(CGeometry *boundary, CConfig *config, unsi for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) { - VarCoord[0] = 0.0; VarCoord[1] = 0.0; VarCoord[2] = 0.0; + VarCoord[0] = 0.0; + VarCoord[1] = 0.0; + VarCoord[2] = 0.0; if (config->GetMarker_All_DV(iMarker) == YES) { - VarCoord[0] = Ampl*xDispl; - VarCoord[1] = Ampl*yDispl; - if (boundary->GetnDim() == 3) VarCoord[2] = Ampl*zDispl; + VarCoord[0] = Ampl * xDispl; + VarCoord[1] = Ampl * yDispl; + if (boundary->GetnDim() == 3) VarCoord[2] = Ampl * zDispl; } boundary->vertex[iMarker][iVertex]->AddVarCoord(VarCoord); } - } -void CSurfaceMovement::SetScale(CGeometry *boundary, CConfig *config, unsigned short iDV, bool ResetDef) { +void CSurfaceMovement::SetScale(CGeometry* boundary, CConfig* config, unsigned short iDV, bool ResetDef) { unsigned long iVertex; unsigned short iMarker; - su2double VarCoord[3] = {0.0,0.0,0.0}, x, y, z, *Coord; + su2double VarCoord[3] = {0.0, 0.0, 0.0}, x, y, z, *Coord; su2double Scale = config->GetOpt_RelaxFactor(); - su2double Ampl = config->GetDV_Value(iDV)*Scale; + su2double Ampl = config->GetDV_Value(iDV) * Scale; /*--- Reset airfoil deformation if first deformation or if it required by the solver ---*/ - if ((iDV == 0) || (ResetDef == true)) { + if ((iDV == 0) || (ResetDef)) { for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) { - VarCoord[0] = 0.0; VarCoord[1] = 0.0; VarCoord[2] = 0.0; + VarCoord[0] = 0.0; + VarCoord[1] = 0.0; + VarCoord[2] = 0.0; boundary->vertex[iMarker][iVertex]->SetVarCoord(VarCoord); } } for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) { - VarCoord[0] = 0.0; VarCoord[1] = 0.0; VarCoord[2] = 0.0; + VarCoord[0] = 0.0; + VarCoord[1] = 0.0; + VarCoord[2] = 0.0; if (config->GetMarker_All_DV(iMarker) == YES) { Coord = boundary->vertex[iMarker][iVertex]->GetCoord(); - x = Coord[0]; y = Coord[1]; z = Coord[2]; - VarCoord[0] = (Ampl-1.0)*x; - VarCoord[1] = (Ampl-1.0)*y; - if (boundary->GetnDim() == 3) VarCoord[2] = (Ampl-1.0)*z; + x = Coord[0]; + y = Coord[1]; + z = Coord[2]; + VarCoord[0] = (Ampl - 1.0) * x; + VarCoord[1] = (Ampl - 1.0) * y; + if (boundary->GetnDim() == 3) VarCoord[2] = (Ampl - 1.0) * z; } boundary->vertex[iMarker][iVertex]->AddVarCoord(VarCoord); } - } -void CSurfaceMovement::AeroelasticDeform(CGeometry *geometry, CConfig *config, unsigned long TimeIter, unsigned short iMarker, unsigned short iMarker_Monitoring, vector& displacements) { - +void CSurfaceMovement::AeroelasticDeform(CGeometry* geometry, CConfig* config, unsigned long TimeIter, + unsigned short iMarker, unsigned short iMarker_Monitoring, + vector& displacements) { /* The sign conventions of these are those of the Typical Section Wing Model, below the signs are corrected */ - su2double dh = -displacements[0]; // relative plunge - su2double dalpha = -displacements[1]; // relative pitch + su2double dh = -displacements[0]; // relative plunge + su2double dalpha = -displacements[1]; // relative pitch su2double dh_x, dh_y; su2double Center[2]; unsigned short iDim; su2double Lref = config->GetLength_Ref(); - su2double *Coord; + su2double* Coord; unsigned long iPoint, iVertex; su2double x_new, y_new; su2double VarCoord[3]; @@ -3177,24 +3307,22 @@ void CSurfaceMovement::AeroelasticDeform(CGeometry *geometry, CConfig *config, u if (config->GetKind_GridMovement() == AEROELASTIC_RIGID_MOTION) { su2double Omega, dt, psi; dt = config->GetDelta_UnstTimeND(); - Omega = config->GetRotation_Rate(2)/config->GetOmega_Ref(); - psi = Omega*(dt*TimeIter); + Omega = config->GetRotation_Rate(2) / config->GetOmega_Ref(); + psi = Omega * (dt * TimeIter); /*--- Correct for the airfoil starting position (This is hardcoded in here) ---*/ if (Monitoring_Tag == "Airfoil1") { psi = psi + 0.0; - } - else if (Monitoring_Tag == "Airfoil2") { - psi = psi + 2.0/3.0*PI_NUMBER; - } - else if (Monitoring_Tag == "Airfoil3") { - psi = psi + 4.0/3.0*PI_NUMBER; - } - else - cout << "WARNING: There is a marker that we are monitoring that doesn't match the values hardcoded above!" << endl; + } else if (Monitoring_Tag == "Airfoil2") { + psi = psi + 2.0 / 3.0 * PI_NUMBER; + } else if (Monitoring_Tag == "Airfoil3") { + psi = psi + 4.0 / 3.0 * PI_NUMBER; + } else + cout << "WARNING: There is a marker that we are monitoring that doesn't match the values hardcoded above!" + << endl; - dh_x = -dh*sin(psi); - dh_y = dh*cos(psi); + dh_x = -dh * sin(psi); + dh_y = dh * cos(psi); } else { dh_x = 0; @@ -3212,15 +3340,14 @@ void CSurfaceMovement::AeroelasticDeform(CGeometry *geometry, CConfig *config, u Coord = geometry->nodes->GetCoord(iPoint); /*--- Calculate non-dim. position from rotation center ---*/ - su2double r[2] = {0,0}; - for (iDim = 0; iDim < geometry->GetnDim(); iDim++) - r[iDim] = (Coord[iDim]-Center[iDim])/Lref; + su2double r[2] = {0, 0}; + for (iDim = 0; iDim < geometry->GetnDim(); iDim++) r[iDim] = (Coord[iDim] - Center[iDim]) / Lref; /*--- Compute delta of transformed point coordinates ---*/ // The deltas are needed for the FEA grid deformation Method. // rotation contribution - previous position + plunging contribution - x_new = cos(dalpha)*r[0] - sin(dalpha)*r[1] -r[0] + dh_x; - y_new = sin(dalpha)*r[0] + cos(dalpha)*r[1] -r[1] + dh_y; + x_new = cos(dalpha) * r[0] - sin(dalpha) * r[1] - r[0] + dh_x; + y_new = sin(dalpha) * r[0] + cos(dalpha) * r[1] - r[1] + dh_y; VarCoord[0] = x_new; VarCoord[1] = y_new; @@ -3230,20 +3357,17 @@ void CSurfaceMovement::AeroelasticDeform(CGeometry *geometry, CConfig *config, u geometry->vertex[iMarker][iVertex]->SetVarCoord(VarCoord); } /*--- Set the elastic axis to the new location after incrementing the position with the plunge ---*/ - config->SetRefOriginMoment_X(iMarker_Monitoring, Center[0]+dh_x); - config->SetRefOriginMoment_Y(iMarker_Monitoring, Center[1]+dh_y); - - + config->SetRefOriginMoment_X(iMarker_Monitoring, Center[0] + dh_x); + config->SetRefOriginMoment_Y(iMarker_Monitoring, Center[1] + dh_y); } -void CSurfaceMovement::SetBoundary_Flutter3D(CGeometry *geometry, CConfig *config, - CFreeFormDefBox **FFDBox, unsigned long iter, unsigned short iZone) { - +void CSurfaceMovement::SetBoundary_Flutter3D(CGeometry* geometry, CConfig* config, CFreeFormDefBox** FFDBox, + unsigned long iter, unsigned short iZone) { su2double omega, deltaT; su2double alpha, alpha_new, alpha_old; su2double time_new, time_old; su2double Omega[3], Ampl[3]; - su2double DEG2RAD = PI_NUMBER/180.0; + su2double DEG2RAD = PI_NUMBER / 180.0; bool adjoint = (config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint()); unsigned short iDim = 0; @@ -3253,50 +3377,49 @@ void CSurfaceMovement::SetBoundary_Flutter3D(CGeometry *geometry, CConfig *confi /*--- Pitching origin, frequency, and amplitude from config. ---*/ - for (iDim = 0; iDim < 3; iDim++){ - Omega[iDim] = config->GetPitching_Omega(iDim)/config->GetOmega_Ref(); - Ampl[iDim] = config->GetPitching_Ampl(iDim)*DEG2RAD; + for (iDim = 0; iDim < 3; iDim++) { + Omega[iDim] = config->GetPitching_Omega(iDim) / config->GetOmega_Ref(); + Ampl[iDim] = config->GetPitching_Ampl(iDim) * DEG2RAD; } /*--- Compute delta time based on physical time step ---*/ if (adjoint) { - /*--- For the unsteady adjoint, we integrate backwards through physical time, so perform mesh motion in reverse. ---*/ - unsigned long nFlowIter = config->GetnTime_Iter(); + unsigned long nFlowIter = config->GetnTime_Iter(); unsigned long directIter = nFlowIter - iter - 1; - time_new = static_cast(directIter)*deltaT; + time_new = static_cast(directIter) * deltaT; time_old = time_new; - if (iter != 0) time_old = (static_cast(directIter)+1.0)*deltaT; + if (iter != 0) time_old = (static_cast(directIter) + 1.0) * deltaT; } else { - /*--- Forward time for the direct problem ---*/ - time_new = static_cast(iter)*deltaT; + time_new = static_cast(iter) * deltaT; time_old = time_new; - if (iter != 0) time_old = (static_cast(iter)-1.0)*deltaT; + if (iter != 0) time_old = (static_cast(iter) - 1.0) * deltaT; } /*--- Update the pitching angle at this time step. Flip sign for nose-up positive convention. ---*/ - omega = Omega[2]; - alpha_new = Ampl[2]*sin(omega*time_new); - alpha_old = Ampl[2]*sin(omega*time_old); - alpha = (1E-10 + (alpha_new - alpha_old))*(-PI_NUMBER/180.0); + omega = Omega[2]; + alpha_new = Ampl[2] * sin(omega * time_new); + alpha_old = Ampl[2] * sin(omega * time_old); + alpha = (1E-10 + (alpha_new - alpha_old)) * (-PI_NUMBER / 180.0); - if (rank == MASTER_NODE) - cout << "New dihedral angle (alpha): " << alpha_new/DEG2RAD << " degrees." << endl; + if (rank == MASTER_NODE) cout << "New dihedral angle (alpha): " << alpha_new / DEG2RAD << " degrees." << endl; unsigned short iOrder, jOrder, kOrder; short iFFDBox; - su2double movement[3] = {0.0,0.0,0.0}; - bool *move = new bool [nFFDBox]; - unsigned short *index = new unsigned short[3]; + su2double movement[3] = {0.0, 0.0, 0.0}; + bool* move = new bool[nFFDBox]; + auto* index = new unsigned short[3]; - move[0] = true; move[1] = true; move[2] = true; + move[0] = true; + move[1] = true; + move[2] = true; /*--- Change the value of the control point if move is true ---*/ @@ -3305,33 +3428,35 @@ void CSurfaceMovement::SetBoundary_Flutter3D(CGeometry *geometry, CConfig *confi for (iOrder = 0; iOrder < FFDBox[iFFDBox]->GetlOrder(); iOrder++) for (jOrder = 0; jOrder < FFDBox[iFFDBox]->GetmOrder(); jOrder++) for (kOrder = 0; kOrder < FFDBox[iFFDBox]->GetnOrder(); kOrder++) { - index[0] = iOrder; index[1] = jOrder; index[2] = kOrder; - su2double *coord = FFDBox[iFFDBox]->GetCoordControlPoints(iOrder, jOrder, kOrder); - movement[0] = 0.0; movement[1] = 0.0; movement[2] = coord[1]*tan(alpha); + index[0] = iOrder; + index[1] = jOrder; + index[2] = kOrder; + su2double* coord = FFDBox[iFFDBox]->GetCoordControlPoints(iOrder, jOrder, kOrder); + movement[0] = 0.0; + movement[1] = 0.0; + movement[2] = coord[1] * tan(alpha); FFDBox[iFFDBox]->SetControlPoints(index, movement); } /*--- Recompute cartesian coordinates using the new control points position ---*/ - for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) - SetCartesianCoord(geometry, config, FFDBox[iFFDBox], iFFDBox, false); - - delete [] index; - delete [] move; + for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) SetCartesianCoord(geometry, config, FFDBox[iFFDBox], iFFDBox, false); + delete[] index; + delete[] move; } -void CSurfaceMovement::SetExternal_Deformation(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter) { - +void CSurfaceMovement::SetExternal_Deformation(CGeometry* geometry, CConfig* config, unsigned short iZone, + unsigned long iter) { /*--- Local variables ---*/ unsigned short iDim, nDim; unsigned long iPoint = 0, flowIter = 0; unsigned long jPoint, GlobalIndex; - su2double VarCoord[3], *Coord_Old = nullptr, *Coord_New = nullptr, Center[3] = {0.0,0.0,0.0}; - su2double Lref = config->GetLength_Ref(); - su2double NewCoord[3] = {0.0,0.0,0.0}, rotMatrix[3][3] = {{0.0,0.0,0.0}, {0.0,0.0,0.0}, {0.0,0.0,0.0}}; - su2double r[3] = {0.0,0.0,0.0}, rotCoord[3] = {0.0,0.0,0.0}; + su2double VarCoord[3], *Coord_Old = nullptr, *Coord_New = nullptr, Center[3] = {0.0, 0.0, 0.0}; + su2double Lref = config->GetLength_Ref(); + su2double NewCoord[3] = {0.0, 0.0, 0.0}, rotMatrix[3][3] = {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}}; + su2double r[3] = {0.0, 0.0, 0.0}, rotCoord[3] = {0.0, 0.0, 0.0}; unsigned long iVertex; unsigned short iMarker; char buffer[50]; @@ -3352,26 +3477,34 @@ void CSurfaceMovement::SetExternal_Deformation(CGeometry *geometry, CConfig *con /*--- For the unsteady adjoint, we integrate backwards through physical time, so perform mesh motion in reverse. ---*/ unsigned long nFlowIter = config->GetnTime_Iter() - 1; - flowIter = nFlowIter - iter; - unsigned short lastindex = DV_Filename.find_last_of("."); + flowIter = nFlowIter - iter; + unsigned short lastindex = DV_Filename.find_last_of('.'); DV_Filename = DV_Filename.substr(0, lastindex); - if ((SU2_TYPE::Int(flowIter) >= 0) && (SU2_TYPE::Int(flowIter) < 10)) SPRINTF (buffer, "_0000%d.dat", SU2_TYPE::Int(flowIter)); - if ((SU2_TYPE::Int(flowIter) >= 10) && (SU2_TYPE::Int(flowIter) < 100)) SPRINTF (buffer, "_000%d.dat", SU2_TYPE::Int(flowIter)); - if ((SU2_TYPE::Int(flowIter) >= 100) && (SU2_TYPE::Int(flowIter) < 1000)) SPRINTF (buffer, "_00%d.dat", SU2_TYPE::Int(flowIter)); - if ((SU2_TYPE::Int(flowIter) >= 1000) && (SU2_TYPE::Int(flowIter) < 10000)) SPRINTF (buffer, "_0%d.dat", SU2_TYPE::Int(flowIter)); - if (SU2_TYPE::Int(flowIter) >= 10000) SPRINTF (buffer, "_%d.dat", SU2_TYPE::Int(flowIter)); + if ((SU2_TYPE::Int(flowIter) >= 0) && (SU2_TYPE::Int(flowIter) < 10)) + SPRINTF(buffer, "_0000%d.dat", SU2_TYPE::Int(flowIter)); + if ((SU2_TYPE::Int(flowIter) >= 10) && (SU2_TYPE::Int(flowIter) < 100)) + SPRINTF(buffer, "_000%d.dat", SU2_TYPE::Int(flowIter)); + if ((SU2_TYPE::Int(flowIter) >= 100) && (SU2_TYPE::Int(flowIter) < 1000)) + SPRINTF(buffer, "_00%d.dat", SU2_TYPE::Int(flowIter)); + if ((SU2_TYPE::Int(flowIter) >= 1000) && (SU2_TYPE::Int(flowIter) < 10000)) + SPRINTF(buffer, "_0%d.dat", SU2_TYPE::Int(flowIter)); + if (SU2_TYPE::Int(flowIter) >= 10000) SPRINTF(buffer, "_%d.dat", SU2_TYPE::Int(flowIter)); UnstExt = string(buffer); DV_Filename.append(UnstExt); } else { /*--- Forward time for the direct problem ---*/ flowIter = iter; - unsigned short lastindex = DV_Filename.find_last_of("."); + unsigned short lastindex = DV_Filename.find_last_of('.'); DV_Filename = DV_Filename.substr(0, lastindex); - if ((SU2_TYPE::Int(flowIter) >= 0) && (SU2_TYPE::Int(flowIter) < 10)) SPRINTF (buffer, "_0000%d.dat", SU2_TYPE::Int(flowIter)); - if ((SU2_TYPE::Int(flowIter) >= 10) && (SU2_TYPE::Int(flowIter) < 100)) SPRINTF (buffer, "_000%d.dat", SU2_TYPE::Int(flowIter)); - if ((SU2_TYPE::Int(flowIter) >= 100) && (SU2_TYPE::Int(flowIter) < 1000)) SPRINTF (buffer, "_00%d.dat", SU2_TYPE::Int(flowIter)); - if ((SU2_TYPE::Int(flowIter) >= 1000) && (SU2_TYPE::Int(flowIter) < 10000)) SPRINTF (buffer, "_0%d.dat", SU2_TYPE::Int(flowIter)); - if (SU2_TYPE::Int(flowIter) >= 10000) SPRINTF (buffer, "_%d.dat", SU2_TYPE::Int(flowIter)); + if ((SU2_TYPE::Int(flowIter) >= 0) && (SU2_TYPE::Int(flowIter) < 10)) + SPRINTF(buffer, "_0000%d.dat", SU2_TYPE::Int(flowIter)); + if ((SU2_TYPE::Int(flowIter) >= 10) && (SU2_TYPE::Int(flowIter) < 100)) + SPRINTF(buffer, "_000%d.dat", SU2_TYPE::Int(flowIter)); + if ((SU2_TYPE::Int(flowIter) >= 100) && (SU2_TYPE::Int(flowIter) < 1000)) + SPRINTF(buffer, "_00%d.dat", SU2_TYPE::Int(flowIter)); + if ((SU2_TYPE::Int(flowIter) >= 1000) && (SU2_TYPE::Int(flowIter) < 10000)) + SPRINTF(buffer, "_0%d.dat", SU2_TYPE::Int(flowIter)); + if (SU2_TYPE::Int(flowIter) >= 10000) SPRINTF(buffer, "_%d.dat", SU2_TYPE::Int(flowIter)); UnstExt = string(buffer); DV_Filename.append(UnstExt); } @@ -3418,7 +3551,6 @@ void CSurfaceMovement::SetExternal_Deformation(CGeometry *geometry, CConfig *con /*--- If rotating as well, prepare the rotation matrix ---*/ if (config->GetKind_GridMovement() == EXTERNAL_ROTATION) { - /*--- Variables needed only for rotation ---*/ su2double Omega[3], dt; @@ -3432,17 +3564,18 @@ void CSurfaceMovement::SetExternal_Deformation(CGeometry *geometry, CConfig *con /*--- Angular velocity vector from config ---*/ - dt = static_cast(iter)*config->GetDelta_UnstTimeND(); - Omega[0] = config->GetRotation_Rate(0); - Omega[1] = config->GetRotation_Rate(1); - Omega[2] = config->GetRotation_Rate(2); + dt = static_cast(iter) * config->GetDelta_UnstTimeND(); + Omega[0] = config->GetRotation_Rate(0); + Omega[1] = config->GetRotation_Rate(1); + Omega[2] = config->GetRotation_Rate(2); /*--- For the unsteady adjoint, use reverse time ---*/ if (adjoint) { /*--- Set the first adjoint mesh position to the final direct one ---*/ - if (iter == 0) dt = ((su2double)config->GetnTime_Iter()-1) * dt; + if (iter == 0) dt = ((su2double)config->GetnTime_Iter() - 1) * dt; /*--- Reverse the rotation direction for the adjoint ---*/ - else dt = -1.0*dt; + else + dt = -1.0 * dt; } else { /*--- No rotation at all for the first direct solution ---*/ if (iter == 0) dt = 0; @@ -3450,30 +3583,33 @@ void CSurfaceMovement::SetExternal_Deformation(CGeometry *geometry, CConfig *con /*--- Compute delta change in the angle about the x, y, & z axes. ---*/ - dtheta = Omega[0]*dt; - dphi = Omega[1]*dt; - dpsi = Omega[2]*dt; + dtheta = Omega[0] * dt; + dphi = Omega[1] * dt; + dpsi = Omega[2] * dt; /*--- Store angles separately for clarity. Compute sines/cosines. ---*/ - cosTheta = cos(dtheta); cosPhi = cos(dphi); cosPsi = cos(dpsi); - sinTheta = sin(dtheta); sinPhi = sin(dphi); sinPsi = sin(dpsi); + cosTheta = cos(dtheta); + cosPhi = cos(dphi); + cosPsi = cos(dpsi); + sinTheta = sin(dtheta); + sinPhi = sin(dphi); + sinPsi = sin(dpsi); /*--- Compute the rotation matrix. Note that the implicit ordering is rotation about the x-axis, y-axis, then z-axis. ---*/ - rotMatrix[0][0] = cosPhi*cosPsi; - rotMatrix[1][0] = cosPhi*sinPsi; + rotMatrix[0][0] = cosPhi * cosPsi; + rotMatrix[1][0] = cosPhi * sinPsi; rotMatrix[2][0] = -sinPhi; - rotMatrix[0][1] = sinTheta*sinPhi*cosPsi - cosTheta*sinPsi; - rotMatrix[1][1] = sinTheta*sinPhi*sinPsi + cosTheta*cosPsi; - rotMatrix[2][1] = sinTheta*cosPhi; - - rotMatrix[0][2] = cosTheta*sinPhi*cosPsi + sinTheta*sinPsi; - rotMatrix[1][2] = cosTheta*sinPhi*sinPsi - sinTheta*cosPsi; - rotMatrix[2][2] = cosTheta*cosPhi; + rotMatrix[0][1] = sinTheta * sinPhi * cosPsi - cosTheta * sinPsi; + rotMatrix[1][1] = sinTheta * sinPhi * sinPsi + cosTheta * cosPsi; + rotMatrix[2][1] = sinTheta * cosPhi; + rotMatrix[0][2] = cosTheta * sinPhi * cosPsi + sinTheta * sinPsi; + rotMatrix[1][2] = cosTheta * sinPhi * sinPsi - sinTheta * cosPsi; + rotMatrix[2][2] = cosTheta * cosPhi; } /*--- Loop through to find only moving surface markers ---*/ @@ -3481,7 +3617,6 @@ void CSurfaceMovement::SetExternal_Deformation(CGeometry *geometry, CConfig *con for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if ((config->GetMarker_All_DV(iMarker) == YES && config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF) || (config->GetMarker_All_Moving(iMarker) == YES && config->GetKind_SU2() == SU2_COMPONENT::SU2_CFD)) { - /*--- Loop over all surface points for this marker ---*/ for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { @@ -3497,115 +3632,115 @@ void CSurfaceMovement::SetExternal_Deformation(CGeometry *geometry, CConfig *con Coord_Old have already been rotated using SetRigid_Rotation(). ---*/ if (config->GetKind_GridMovement() == EXTERNAL_ROTATION) { - /*--- Calculate non-dim. position from rotation center ---*/ - for (iDim = 0; iDim < nDim; iDim++) - r[iDim] = (Coord_New[iDim]-Center[iDim])/Lref; + for (iDim = 0; iDim < nDim; iDim++) r[iDim] = (Coord_New[iDim] - Center[iDim]) / Lref; if (nDim == 2) r[nDim] = 0.0; /*--- Compute transformed point coordinates ---*/ - rotCoord[0] = rotMatrix[0][0]*r[0] - + rotMatrix[0][1]*r[1] - + rotMatrix[0][2]*r[2] + Center[0]; + rotCoord[0] = rotMatrix[0][0] * r[0] + rotMatrix[0][1] * r[1] + rotMatrix[0][2] * r[2] + Center[0]; - rotCoord[1] = rotMatrix[1][0]*r[0] - + rotMatrix[1][1]*r[1] - + rotMatrix[1][2]*r[2] + Center[1]; + rotCoord[1] = rotMatrix[1][0] * r[0] + rotMatrix[1][1] * r[1] + rotMatrix[1][2] * r[2] + Center[1]; - rotCoord[2] = rotMatrix[2][0]*r[0] - + rotMatrix[2][1]*r[1] - + rotMatrix[2][2]*r[2] + Center[2]; + rotCoord[2] = rotMatrix[2][0] * r[0] + rotMatrix[2][1] * r[1] + rotMatrix[2][2] * r[2] + Center[2]; /*--- Copy rotated coords back to original array for consistency ---*/ - for (iDim = 0; iDim < nDim; iDim++) - Coord_New[iDim] = rotCoord[iDim]; + for (iDim = 0; iDim < nDim; iDim++) Coord_New[iDim] = rotCoord[iDim]; } /*--- Calculate delta change in the x, y, & z directions ---*/ - for (iDim = 0; iDim < nDim; iDim++) - VarCoord[iDim] = (Coord_New[iDim]-Coord_Old[iDim])/Lref; + for (iDim = 0; iDim < nDim; iDim++) VarCoord[iDim] = (Coord_New[iDim] - Coord_Old[iDim]) / Lref; if (nDim == 2) VarCoord[nDim] = 0.0; /*--- Set position changes to be applied by the spring analogy ---*/ geometry->vertex[iMarker][iVertex]->SetVarCoord(VarCoord); - } } } } -void CSurfaceMovement::SetNACA_4Digits(CGeometry *boundary, CConfig *config) { +void CSurfaceMovement::SetNACA_4Digits(CGeometry* boundary, CConfig* config) { unsigned long iVertex; unsigned short iMarker; su2double VarCoord[3], *Coord, *Normal, Ycurv, Yesp; - if (config->GetnDV() != 1) { cout << "This kind of design variable is not prepared for multiple deformations."; cin.get(); } + if (config->GetnDV() != 1) { + cout << "This kind of design variable is not prepared for multiple deformations."; + cin.get(); + } - su2double Ya = config->GetParamDV(0,0) / 100.0; /*--- Maximum camber as a fraction of the chord - (100 m is the first of the four digits) ---*/ - su2double Xa = config->GetParamDV(0,1) / 10.0; /*--- Location of maximum camber as a fraction of - the chord (10 p is the second digit in the NACA xxxx description) ---*/ - su2double t = config->GetParamDV(0,2) / 100.0; /*--- Maximum thickness as a fraction of the - chord (so 100 t gives the last two digits in - the NACA 4-digit denomination) ---*/ + su2double Ya = config->GetParamDV(0, 0) / 100.0; /*--- Maximum camber as a fraction of the chord + (100 m is the first of the four digits) ---*/ + su2double Xa = config->GetParamDV(0, 1) / 10.0; /*--- Location of maximum camber as a fraction of + the chord (10 p is the second digit in the NACA xxxx description) ---*/ + su2double t = config->GetParamDV(0, 2) / 100.0; /*--- Maximum thickness as a fraction of the + chord (so 100 t gives the last two digits in + the NACA 4-digit denomination) ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) { - VarCoord[0] = 0.0; VarCoord[1] = 0.0; VarCoord[2] = 0.0; + VarCoord[0] = 0.0; + VarCoord[1] = 0.0; + VarCoord[2] = 0.0; if (config->GetMarker_All_DV(iMarker) == YES) { Coord = boundary->vertex[iMarker][iVertex]->GetCoord(); Normal = boundary->vertex[iMarker][iVertex]->GetNormal(); - if (Coord[0] < Xa) Ycurv = (2.0*Xa*Coord[0]-pow(Coord[0],2.0))*(Ya/pow(Xa,2.0)); - else Ycurv = ((1.0-2.0*Xa)+2.0*Xa*Coord[0]-pow(Coord[0],2.0))*(Ya/pow((1.0-Xa), 2.0)); - - Yesp = t*(1.4845*sqrt(Coord[0])-0.6300*Coord[0]-1.7580*pow(Coord[0],2.0)+ - 1.4215*pow(Coord[0],3.0)-0.518*pow(Coord[0],4.0)); + if (Coord[0] < Xa) + Ycurv = (2.0 * Xa * Coord[0] - pow(Coord[0], 2.0)) * (Ya / pow(Xa, 2.0)); + else + Ycurv = ((1.0 - 2.0 * Xa) + 2.0 * Xa * Coord[0] - pow(Coord[0], 2.0)) * (Ya / pow((1.0 - Xa), 2.0)); - if (Normal[1] > 0) VarCoord[1] = (Ycurv + Yesp) - Coord[1]; - if (Normal[1] < 0) VarCoord[1] = (Ycurv - Yesp) - Coord[1]; + Yesp = t * (1.4845 * sqrt(Coord[0]) - 0.6300 * Coord[0] - 1.7580 * pow(Coord[0], 2.0) + + 1.4215 * pow(Coord[0], 3.0) - 0.518 * pow(Coord[0], 4.0)); + if (Normal[1] > 0) VarCoord[1] = (Ycurv + Yesp) - Coord[1]; + if (Normal[1] < 0) VarCoord[1] = (Ycurv - Yesp) - Coord[1]; } boundary->vertex[iMarker][iVertex]->SetVarCoord(VarCoord); } } -void CSurfaceMovement::SetParabolic(CGeometry *boundary, CConfig *config) { +void CSurfaceMovement::SetParabolic(CGeometry* boundary, CConfig* config) { unsigned long iVertex; unsigned short iMarker; su2double VarCoord[3], *Coord, *Normal; - if (config->GetnDV() != 1) { cout << "This kind of design variable is not prepared for multiple deformations."; cin.get(); } + if (config->GetnDV() != 1) { + cout << "This kind of design variable is not prepared for multiple deformations."; + cin.get(); + } - su2double c = config->GetParamDV(0,0); /*--- Center of the parabola ---*/ - su2double t = config->GetParamDV(0,1) / 100.0; /*--- Thickness of the parabola ---*/ + su2double c = config->GetParamDV(0, 0); /*--- Center of the parabola ---*/ + su2double t = config->GetParamDV(0, 1) / 100.0; /*--- Thickness of the parabola ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) { - VarCoord[0] = 0.0; VarCoord[1] = 0.0; VarCoord[2] = 0.0; + VarCoord[0] = 0.0; + VarCoord[1] = 0.0; + VarCoord[2] = 0.0; if (config->GetMarker_All_DV(iMarker) == YES) { Coord = boundary->vertex[iMarker][iVertex]->GetCoord(); Normal = boundary->vertex[iMarker][iVertex]->GetNormal(); if (Normal[1] > 0) { - VarCoord[1] = t*(Coord[0]*Coord[0]-Coord[0])/(2.0*(c*c-c)) - Coord[1]; + VarCoord[1] = t * (Coord[0] * Coord[0] - Coord[0]) / (2.0 * (c * c - c)) - Coord[1]; } if (Normal[1] < 0) { - VarCoord[1] = t*(Coord[0]-Coord[0]*Coord[0])/(2.0*(c*c-c)) - Coord[1]; + VarCoord[1] = t * (Coord[0] - Coord[0] * Coord[0]) / (2.0 * (c * c - c)) - Coord[1]; } } boundary->vertex[iMarker][iVertex]->SetVarCoord(VarCoord); } } -void CSurfaceMovement::SetAirfoil(CGeometry *boundary, CConfig *config) { +void CSurfaceMovement::SetAirfoil(CGeometry* boundary, CConfig* config) { unsigned long iVertex, n_Airfoil = 0; unsigned short iMarker, nUpper, nLower, iUpper, iLower, iVar, iDim; su2double *VarCoord, *Coord, NewYCoord, NewXCoord, *Coord_i, *Coord_ip1, yp1, ypn, - Airfoil_Coord[2]= {0.0,0.0}, factor, coeff = 10000, Upper, Lower, Arch = 0.0, TotalArch = 0.0, - x_i, x_ip1, y_i, y_ip1; + Airfoil_Coord[2] = {0.0, 0.0}, factor, coeff = 10000, Upper, Lower, Arch = 0.0, TotalArch = 0.0, x_i, x_ip1, y_i, + y_ip1; passivedouble AirfoilScale; vector Svalue, Xcoord, Ycoord, Xcoord2, Ycoord2, Xcoord_Aux, Ycoord_Aux; bool AddBegin = true, AddEnd = true; @@ -3617,8 +3752,7 @@ void CSurfaceMovement::SetAirfoil(CGeometry *boundary, CConfig *config) { unsigned short nDim = boundary->GetnDim(); VarCoord = new su2double[nDim]; - for (iDim = 0; iDim < nDim; iDim++) - VarCoord[iDim] = 0.0; + for (iDim = 0; iDim < nDim; iDim++) VarCoord[iDim] = 0.0; /*--- Get the SU2 module. SU2_CFD will use this routine for dynamically deforming meshes (MARKER_MOVING), while SU2_DEF will use it for deforming @@ -3637,35 +3771,44 @@ void CSurfaceMovement::SetAirfoil(CGeometry *boundary, CConfig *config) { cout << "Enter the name of file with the airfoil information: "; ierr = scanf("%255s", AirfoilFile); - if (ierr == 0) { SU2_MPI::Error("No input read!!", CURRENT_FUNCTION); } + if (ierr == 0) { + SU2_MPI::Error("No input read!!", CURRENT_FUNCTION); + } airfoil_file.open(AirfoilFile, ios::in); if (airfoil_file.fail()) { SU2_MPI::Error(string("There is no airfoil file ") + string(AirfoilFile), CURRENT_FUNCTION); } cout << "Enter the format of the airfoil (Selig or Lednicer): "; ierr = scanf("%14s", AirfoilFormat); - if (ierr == 0) { SU2_MPI::Error("No input read!!", CURRENT_FUNCTION); } + if (ierr == 0) { + SU2_MPI::Error("No input read!!", CURRENT_FUNCTION); + } cout << "Thickness scaling (1.0 means no scaling)?: "; ierr = scanf("%lf", &AirfoilScale); - if (ierr == 0) { SU2_MPI::Error("No input read!!", CURRENT_FUNCTION); } + if (ierr == 0) { + SU2_MPI::Error("No input read!!", CURRENT_FUNCTION); + } cout << "Close the airfoil (Yes or No)?: "; ierr = scanf("%14s", AirfoilClose); - if (ierr == 0) { SU2_MPI::Error("No input read!!", CURRENT_FUNCTION); } + if (ierr == 0) { + SU2_MPI::Error("No input read!!", CURRENT_FUNCTION); + } cout << "Surface mesh orientation (clockwise, or anticlockwise): "; ierr = scanf("%14s", MeshOrientation); - if (ierr == 0) { SU2_MPI::Error("No input read!!", CURRENT_FUNCTION); } + if (ierr == 0) { + SU2_MPI::Error("No input read!!", CURRENT_FUNCTION); + } /*--- The first line is the header ---*/ - getline (airfoil_file, text_line); + getline(airfoil_file, text_line); cout << "File info: " << text_line << endl; - if (strcmp (AirfoilFormat,"Selig") == 0) { - - while (getline (airfoil_file, text_line)) { + if (strcmp(AirfoilFormat, "Selig") == 0) { + while (getline(airfoil_file, text_line)) { istringstream point_line(text_line); /*--- Read the x & y coordinates from this line of the file (anticlockwise) ---*/ @@ -3674,19 +3817,18 @@ void CSurfaceMovement::SetAirfoil(CGeometry *boundary, CConfig *config) { /*--- Close the arifoil ---*/ - if (strcmp (AirfoilClose,"Yes") == 0) - factor = -atan(coeff*(Airfoil_Coord[0]-1.0))*2.0/PI_NUMBER; - else factor = 1.0; + if (strcmp(AirfoilClose, "Yes") == 0) + factor = -atan(coeff * (Airfoil_Coord[0] - 1.0)) * 2.0 / PI_NUMBER; + else + factor = 1.0; /*--- Store the coordinates in vectors ---*/ Xcoord.push_back(Airfoil_Coord[0]); - Ycoord.push_back(Airfoil_Coord[1]*factor*AirfoilScale); + Ycoord.emplace_back(Airfoil_Coord[1] * factor * AirfoilScale); } - } - if (strcmp (AirfoilFormat,"Lednicer") == 0) { - + if (strcmp(AirfoilFormat, "Lednicer") == 0) { /*--- The second line is the number of points ---*/ getline(airfoil_file, text_line); @@ -3696,82 +3838,96 @@ void CSurfaceMovement::SetAirfoil(CGeometry *boundary, CConfig *config) { nUpper = SU2_TYPE::Int(Upper); nLower = SU2_TYPE::Int(Lower); - Xcoord.resize(nUpper+nLower-1); - Ycoord.resize(nUpper+nLower-1); + Xcoord.resize(nUpper + nLower - 1); + Ycoord.resize(nUpper + nLower - 1); /*--- White line ---*/ - getline (airfoil_file, text_line); + getline(airfoil_file, text_line); for (iUpper = 0; iUpper < nUpper; iUpper++) { - getline (airfoil_file, text_line); + getline(airfoil_file, text_line); istringstream point_line(text_line); point_line >> Airfoil_Coord[0] >> Airfoil_Coord[1]; - Xcoord[nUpper-iUpper-1] = Airfoil_Coord[0]; + Xcoord[nUpper - iUpper - 1] = Airfoil_Coord[0]; - if (strcmp (AirfoilClose,"Yes") == 0) - factor = -atan(coeff*(Airfoil_Coord[0]-1.0))*2.0/PI_NUMBER; - else factor = 1.0; + if (strcmp(AirfoilClose, "Yes") == 0) + factor = -atan(coeff * (Airfoil_Coord[0] - 1.0)) * 2.0 / PI_NUMBER; + else + factor = 1.0; - Ycoord[nUpper-iUpper-1] = Airfoil_Coord[1]*AirfoilScale*factor; + Ycoord[nUpper - iUpper - 1] = Airfoil_Coord[1] * AirfoilScale * factor; } - getline (airfoil_file, text_line); + getline(airfoil_file, text_line); for (iLower = 0; iLower < nLower; iLower++) { - getline (airfoil_file, text_line); + getline(airfoil_file, text_line); istringstream point_line(text_line); point_line >> Airfoil_Coord[0] >> Airfoil_Coord[1]; - if (strcmp (AirfoilClose,"Yes") == 0) - factor = -atan(coeff*(Airfoil_Coord[0]-1.0))*2.0/PI_NUMBER; - else factor = 1.0; + if (strcmp(AirfoilClose, "Yes") == 0) + factor = -atan(coeff * (Airfoil_Coord[0] - 1.0)) * 2.0 / PI_NUMBER; + else + factor = 1.0; - Xcoord[nUpper+iLower-1] = Airfoil_Coord[0]; - Ycoord[nUpper+iLower-1] = Airfoil_Coord[1]*AirfoilScale*factor; + Xcoord[nUpper + iLower - 1] = Airfoil_Coord[0]; + Ycoord[nUpper + iLower - 1] = Airfoil_Coord[1] * AirfoilScale * factor; } - } /*--- Check the coordinate (1,0) at the beginning and end of the file ---*/ if (Xcoord[0] == 1.0) AddBegin = false; - if (Xcoord[Xcoord.size()-1] == 1.0) AddEnd = false; + if (Xcoord[Xcoord.size() - 1] == 1.0) AddEnd = false; - if (AddBegin) { Xcoord.insert(Xcoord.begin(), 1.0); Ycoord.insert(Ycoord.begin(), 0.0);} - if (AddEnd) { Xcoord.push_back(1.0); Ycoord.push_back(0.0);} + if (AddBegin) { + Xcoord.insert(Xcoord.begin(), 1.0); + Ycoord.insert(Ycoord.begin(), 0.0); + } + if (AddEnd) { + Xcoord.emplace_back(1.0); + Ycoord.emplace_back(0.0); + } /*--- Change the orientation (depend on the input file, and the mesh file) ---*/ - if (strcmp (MeshOrientation,"clockwise") == 0) { + if (strcmp(MeshOrientation, "clockwise") == 0) { for (iVar = 0; iVar < Xcoord.size(); iVar++) { Xcoord_Aux.push_back(Xcoord[iVar]); Ycoord_Aux.push_back(Ycoord[iVar]); } for (iVar = 0; iVar < Xcoord.size(); iVar++) { - Xcoord[iVar] = Xcoord_Aux[Xcoord.size()-iVar-1]; - Ycoord[iVar] = Ycoord_Aux[Xcoord.size()-iVar-1]; + Xcoord[iVar] = Xcoord_Aux[Xcoord.size() - iVar - 1]; + Ycoord[iVar] = Ycoord_Aux[Xcoord.size() - iVar - 1]; } } /*--- Compute the total arch length ---*/ - Arch = 0.0; Svalue.push_back(Arch); + Arch = 0.0; + Svalue.push_back(Arch); - for (iVar = 0; iVar < Xcoord.size()-1; iVar++) { - x_i = Xcoord[iVar]; x_ip1 = Xcoord[iVar+1]; - y_i = Ycoord[iVar]; y_ip1 = Ycoord[iVar+1]; - Arch += sqrt((x_ip1-x_i)*(x_ip1-x_i)+(y_ip1-y_i)*(y_ip1-y_i)); + for (iVar = 0; iVar < Xcoord.size() - 1; iVar++) { + x_i = Xcoord[iVar]; + x_ip1 = Xcoord[iVar + 1]; + y_i = Ycoord[iVar]; + y_ip1 = Ycoord[iVar + 1]; + Arch += sqrt((x_ip1 - x_i) * (x_ip1 - x_i) + (y_ip1 - y_i) * (y_ip1 - y_i)); Svalue.push_back(Arch); } - x_i = Xcoord[Xcoord.size()-1]; x_ip1 = Xcoord[0]; - y_i = Ycoord[Xcoord.size()-1]; y_ip1 = Ycoord[0]; - Arch += sqrt((x_ip1-x_i)*(x_ip1-x_i)+(y_ip1-y_i)*(y_ip1-y_i)); + x_i = Xcoord[Xcoord.size() - 1]; + x_ip1 = Xcoord[0]; + y_i = Ycoord[Xcoord.size() - 1]; + y_ip1 = Ycoord[0]; + Arch += sqrt((x_ip1 - x_i) * (x_ip1 - x_i) + (y_ip1 - y_i) * (y_ip1 - y_i)); /*--- Non dimensionalization ---*/ - for (iVar = 0; iVar < Svalue.size(); iVar++) { Svalue[iVar] /= Arch; } + for (iVar = 0; iVar < Svalue.size(); iVar++) { + Svalue[iVar] /= Arch; + } /*--- Close the restart file ---*/ @@ -3780,14 +3936,14 @@ void CSurfaceMovement::SetAirfoil(CGeometry *boundary, CConfig *config) { /*--- Create a spline for X and Y coordiantes using the arch length ---*/ n_Airfoil = Svalue.size(); - yp1 = (Xcoord[1]-Xcoord[0])/(Svalue[1]-Svalue[0]); - ypn = (Xcoord[n_Airfoil-1]-Xcoord[n_Airfoil-2])/(Svalue[n_Airfoil-1]-Svalue[n_Airfoil-2]); + yp1 = (Xcoord[1] - Xcoord[0]) / (Svalue[1] - Svalue[0]); + ypn = (Xcoord[n_Airfoil - 1] - Xcoord[n_Airfoil - 2]) / (Svalue[n_Airfoil - 1] - Svalue[n_Airfoil - 2]); CCubicSpline splineX(Svalue, Xcoord, CCubicSpline::FIRST, yp1, CCubicSpline::FIRST, ypn); n_Airfoil = Svalue.size(); - yp1 = (Ycoord[1]-Ycoord[0])/(Svalue[1]-Svalue[0]); - ypn = (Ycoord[n_Airfoil-1]-Ycoord[n_Airfoil-2])/(Svalue[n_Airfoil-1]-Svalue[n_Airfoil-2]); + yp1 = (Ycoord[1] - Ycoord[0]) / (Svalue[1] - Svalue[0]); + ypn = (Ycoord[n_Airfoil - 1] - Ycoord[n_Airfoil - 2]) / (Svalue[n_Airfoil - 1] - Svalue[n_Airfoil - 2]); CCubicSpline splineY(Svalue, Ycoord, CCubicSpline::FIRST, yp1, CCubicSpline::FIRST, ypn); @@ -3795,39 +3951,47 @@ void CSurfaceMovement::SetAirfoil(CGeometry *boundary, CConfig *config) { for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if (((config->GetMarker_All_Moving(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_CFD)) || ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_DEF))) { - for (iVertex = 0; iVertex < boundary->nVertex[iMarker]-1; iVertex++) { + for (iVertex = 0; iVertex < boundary->nVertex[iMarker] - 1; iVertex++) { Coord_i = boundary->vertex[iMarker][iVertex]->GetCoord(); - Coord_ip1 = boundary->vertex[iMarker][iVertex+1]->GetCoord(); + Coord_ip1 = boundary->vertex[iMarker][iVertex + 1]->GetCoord(); - x_i = Coord_i[0]; x_ip1 = Coord_ip1[0]; - y_i = Coord_i[1]; y_ip1 = Coord_ip1[1]; + x_i = Coord_i[0]; + x_ip1 = Coord_ip1[0]; + y_i = Coord_i[1]; + y_ip1 = Coord_ip1[1]; - TotalArch += sqrt((x_ip1-x_i)*(x_ip1-x_i)+(y_ip1-y_i)*(y_ip1-y_i)); + TotalArch += sqrt((x_ip1 - x_i) * (x_ip1 - x_i) + (y_ip1 - y_i) * (y_ip1 - y_i)); } - Coord_i = boundary->vertex[iMarker][boundary->nVertex[iMarker]-1]->GetCoord(); + Coord_i = boundary->vertex[iMarker][boundary->nVertex[iMarker] - 1]->GetCoord(); Coord_ip1 = boundary->vertex[iMarker][0]->GetCoord(); - x_i = Coord_i[0]; x_ip1 = Coord_ip1[0]; - y_i = Coord_i[1]; y_ip1 = Coord_ip1[1]; - TotalArch += sqrt((x_ip1-x_i)*(x_ip1-x_i)+(y_ip1-y_i)*(y_ip1-y_i)); + x_i = Coord_i[0]; + x_ip1 = Coord_ip1[0]; + y_i = Coord_i[1]; + y_ip1 = Coord_ip1[1]; + TotalArch += sqrt((x_ip1 - x_i) * (x_ip1 - x_i) + (y_ip1 - y_i) * (y_ip1 - y_i)); } } - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { Arch = 0.0; for (iVertex = 0; iVertex < boundary->nVertex[iMarker]; iVertex++) { - VarCoord[0] = 0.0; VarCoord[1] = 0.0; VarCoord[2] = 0.0; + VarCoord[0] = 0.0; + VarCoord[1] = 0.0; + VarCoord[2] = 0.0; if (((config->GetMarker_All_Moving(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_CFD)) || ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_DEF))) { Coord = boundary->vertex[iMarker][iVertex]->GetCoord(); - if (iVertex == 0) Arch = 0.0; + if (iVertex == 0) + Arch = 0.0; else { - Coord_i = boundary->vertex[iMarker][iVertex-1]->GetCoord(); + Coord_i = boundary->vertex[iMarker][iVertex - 1]->GetCoord(); Coord_ip1 = boundary->vertex[iMarker][iVertex]->GetCoord(); - x_i = Coord_i[0]; x_ip1 = Coord_ip1[0]; - y_i = Coord_i[1]; y_ip1 = Coord_ip1[1]; - Arch += sqrt((x_ip1-x_i)*(x_ip1-x_i)+(y_ip1-y_i)*(y_ip1-y_i))/TotalArch; + x_i = Coord_i[0]; + x_ip1 = Coord_ip1[0]; + y_i = Coord_i[1]; + y_ip1 = Coord_ip1[1]; + Arch += sqrt((x_ip1 - x_i) * (x_ip1 - x_i) + (y_ip1 - y_i) * (y_ip1 - y_i)) / TotalArch; } NewXCoord = splineX(Arch); @@ -3840,24 +4004,21 @@ void CSurfaceMovement::SetAirfoil(CGeometry *boundary, CConfig *config) { } boundary->vertex[iMarker][iVertex]->SetVarCoord(VarCoord); - } } - delete [] VarCoord; - + delete[] VarCoord; } -void CSurfaceMovement::ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFormDefBox **FFDBox, string val_mesh_filename) { - +void CSurfaceMovement::ReadFFDInfo(CGeometry* geometry, CConfig* config, CFreeFormDefBox** FFDBox, + const string& val_mesh_filename) { string text_line, iTag; ifstream mesh_file; - su2double CPcoord[3], coord[] = {0,0,0}; - unsigned short degree[3], iFFDBox, iCornerPoints, iControlPoints, iMarker, iDegree, jDegree, kDegree, - iChar, LevelFFDBox, nParentFFDBox, iParentFFDBox, nChildFFDBox, iChildFFDBox, nMarker, *nCornerPoints, - *nControlPoints; - unsigned long iSurfacePoints, iPoint, jPoint, iVertex, nVertex, nPoint, iElem = 0, - nElem, my_nSurfPoints, nSurfPoints, *nSurfacePoints; + su2double CPcoord[3], coord[] = {0, 0, 0}; + unsigned short degree[3], iFFDBox, iCornerPoints, iControlPoints, iMarker, iDegree, jDegree, kDegree, iChar, + LevelFFDBox, nParentFFDBox, iParentFFDBox, nChildFFDBox, iChildFFDBox, nMarker, *nCornerPoints, *nControlPoints; + unsigned long iSurfacePoints, iPoint, jPoint, iVertex, nVertex, nPoint, iElem = 0, nElem, my_nSurfPoints, nSurfPoints, + *nSurfacePoints; su2double XCoord, YCoord; bool polar = (config->GetFFD_CoordSystem() == POLAR); @@ -3870,13 +4031,13 @@ void CSurfaceMovement::ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFo SU2_MPI::Error("There is no geometry file (ReadFFDInfo)!!", CURRENT_FUNCTION); } - while (getline (mesh_file, text_line)) { - + while (getline(mesh_file, text_line)) { /*--- Read the inner elements ---*/ - string::size_type position = text_line.find ("NELEM=",0); + string::size_type position = text_line.find("NELEM=", 0); if (position != string::npos) { - text_line.erase (0,6); nElem = atoi(text_line.c_str()); + text_line.erase(0, 6); + nElem = atoi(text_line.c_str()); for (iElem = 0; iElem < nElem; iElem++) { getline(mesh_file, text_line); } @@ -3884,9 +4045,10 @@ void CSurfaceMovement::ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFo /*--- Read the inner points ---*/ - position = text_line.find ("NPOIN=",0); + position = text_line.find("NPOIN=", 0); if (position != string::npos) { - text_line.erase (0,6); nPoint = atoi(text_line.c_str()); + text_line.erase(0, 6); + nPoint = atoi(text_line.c_str()); for (iPoint = 0; iPoint < nPoint; iPoint++) { getline(mesh_file, text_line); } @@ -3894,13 +4056,15 @@ void CSurfaceMovement::ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFo /*--- Read the boundaries ---*/ - position = text_line.find ("NMARK=",0); + position = text_line.find("NMARK=", 0); if (position != string::npos) { - text_line.erase (0,6); nMarker = atoi(text_line.c_str()); + text_line.erase(0, 6); + nMarker = atoi(text_line.c_str()); for (iMarker = 0; iMarker < nMarker; iMarker++) { getline(mesh_file, text_line); getline(mesh_file, text_line); - text_line.erase (0,13); nVertex = atoi(text_line.c_str()); + text_line.erase(0, 13); + nVertex = atoi(text_line.c_str()); for (iVertex = 0; iVertex < nVertex; iVertex++) { getline(mesh_file, text_line); } @@ -3909,9 +4073,9 @@ void CSurfaceMovement::ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFo /*--- Read the FFDBox information ---*/ - position = text_line.find ("FFD_NBOX=",0); + position = text_line.find("FFD_NBOX=", 0); if (position != string::npos) { - text_line.erase (0,9); + text_line.erase(0, 9); nFFDBox = atoi(text_line.c_str()); if (rank == MASTER_NODE) cout << nFFDBox << " Free Form Deformation boxes." << endl; @@ -3920,126 +4084,138 @@ void CSurfaceMovement::ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFo nControlPoints = new unsigned short[nFFDBox]; nSurfacePoints = new unsigned long[nFFDBox]; - getline (mesh_file, text_line); - text_line.erase (0,11); + getline(mesh_file, text_line); + text_line.erase(0, 11); nLevel = atoi(text_line.c_str()); if (rank == MASTER_NODE) cout << nLevel << " Free Form Deformation nested levels." << endl; - for (iFFDBox = 0 ; iFFDBox < nFFDBox; iFFDBox++) { - + for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) { /*--- Read the name of the FFD box ---*/ - getline (mesh_file, text_line); - text_line.erase (0,8); + getline(mesh_file, text_line); + text_line.erase(0, 8); /*--- Remove extra data from the FFDBox name ---*/ string::size_type position; for (iChar = 0; iChar < 20; iChar++) { - position = text_line.find( " ", 0 ); - if (position != string::npos) text_line.erase (position,1); - position = text_line.find( "\r", 0 ); - if (position != string::npos) text_line.erase (position,1); - position = text_line.find( "\n", 0 ); - if (position != string::npos) text_line.erase (position,1); + position = text_line.find(' ', 0); + if (position != string::npos) text_line.erase(position, 1); + position = text_line.find('\r', 0); + if (position != string::npos) text_line.erase(position, 1); + position = text_line.find('\n', 0); + if (position != string::npos) text_line.erase(position, 1); } - string TagFFDBox = text_line.c_str(); + string TagFFDBox = text_line; - if (rank == MASTER_NODE) cout << "FFD box tag: " << TagFFDBox <<". "; + if (rank == MASTER_NODE) cout << "FFD box tag: " << TagFFDBox << ". "; /*--- Read the level of the FFD box ---*/ - getline (mesh_file, text_line); - text_line.erase (0,10); + getline(mesh_file, text_line); + text_line.erase(0, 10); LevelFFDBox = atoi(text_line.c_str()); - if (rank == MASTER_NODE) cout << "FFD box level: " << LevelFFDBox <<". "; + if (rank == MASTER_NODE) cout << "FFD box level: " << LevelFFDBox << ". "; /*--- Read the degree of the FFD box ---*/ - if (nDim == 2) { if (polar) { - getline (mesh_file, text_line); - text_line.erase (0,13); degree[0] = atoi(text_line.c_str()); + getline(mesh_file, text_line); + text_line.erase(0, 13); + degree[0] = atoi(text_line.c_str()); degree[1] = 1; - getline (mesh_file, text_line); - text_line.erase (0,13); degree[2] = atoi(text_line.c_str()); - } - else { - getline (mesh_file, text_line); - text_line.erase (0,13); degree[0] = atoi(text_line.c_str()); - getline (mesh_file, text_line); - text_line.erase (0,13); degree[1] = atoi(text_line.c_str()); + getline(mesh_file, text_line); + text_line.erase(0, 13); + degree[2] = atoi(text_line.c_str()); + } else { + getline(mesh_file, text_line); + text_line.erase(0, 13); + degree[0] = atoi(text_line.c_str()); + getline(mesh_file, text_line); + text_line.erase(0, 13); + degree[1] = atoi(text_line.c_str()); degree[2] = 1; } - } - else { - getline (mesh_file, text_line); - text_line.erase (0,13); degree[0] = atoi(text_line.c_str()); - getline (mesh_file, text_line); - text_line.erase (0,13); degree[1] = atoi(text_line.c_str()); - getline (mesh_file, text_line); - text_line.erase (0,13); degree[2] = atoi(text_line.c_str()); + } else { + getline(mesh_file, text_line); + text_line.erase(0, 13); + degree[0] = atoi(text_line.c_str()); + getline(mesh_file, text_line); + text_line.erase(0, 13); + degree[1] = atoi(text_line.c_str()); + getline(mesh_file, text_line); + text_line.erase(0, 13); + degree[2] = atoi(text_line.c_str()); } if (rank == MASTER_NODE) { if (nDim == 2) { - if (polar) cout << "Degrees: " << degree[0] << ", " << degree[2] << "." << endl; - else cout << "Degrees: " << degree[0] << ", " << degree[1] << "." << endl; - } - else cout << "Degrees: " << degree[0] << ", " << degree[1] << ", " << degree[2] << "." << endl; + if (polar) + cout << "Degrees: " << degree[0] << ", " << degree[2] << "." << endl; + else + cout << "Degrees: " << degree[0] << ", " << degree[1] << "." << endl; + } else + cout << "Degrees: " << degree[0] << ", " << degree[1] << ", " << degree[2] << "." << endl; } - getline (mesh_file, text_line); - if (text_line.substr(0,12) != "FFD_BLENDING"){ - SU2_MPI::Error(string("Deprecated FFD information found in mesh file.\n") + - string("FFD information generated with SU2 version <= 4.3 is incompatible with the current version.") + - string("Run SU2_DEF again with DV_KIND= FFD_SETTING."), CURRENT_FUNCTION); + getline(mesh_file, text_line); + if (text_line.substr(0, 12) != "FFD_BLENDING") { + SU2_MPI::Error( + string("Deprecated FFD information found in mesh file.\n") + + string( + "FFD information generated with SU2 version <= 4.3 is incompatible with the current version.") + + string("Run SU2_DEF again with DV_KIND= FFD_SETTING."), + CURRENT_FUNCTION); } - text_line.erase(0,14); - if (text_line == "BEZIER"){ + text_line.erase(0, 14); + if (text_line == "BEZIER") { Blending = BEZIER; } - if (text_line == "BSPLINE_UNIFORM"){ + if (text_line == "BSPLINE_UNIFORM") { Blending = BSPLINE_UNIFORM; } if (Blending == BSPLINE_UNIFORM) { - getline (mesh_file, text_line); - text_line.erase (0,17); SplineOrder[0] = atoi(text_line.c_str()); - getline (mesh_file, text_line); - text_line.erase (0,17); SplineOrder[1] = atoi(text_line.c_str()); - if (nDim == 3){ - getline (mesh_file, text_line); - text_line.erase (0,17); SplineOrder[2] = atoi(text_line.c_str()); + getline(mesh_file, text_line); + text_line.erase(0, 17); + SplineOrder[0] = atoi(text_line.c_str()); + getline(mesh_file, text_line); + text_line.erase(0, 17); + SplineOrder[1] = atoi(text_line.c_str()); + if (nDim == 3) { + getline(mesh_file, text_line); + text_line.erase(0, 17); + SplineOrder[2] = atoi(text_line.c_str()); } else { SplineOrder[2] = 2; } } - if (rank == MASTER_NODE){ - if (Blending == BSPLINE_UNIFORM){ + if (rank == MASTER_NODE) { + if (Blending == BSPLINE_UNIFORM) { cout << "FFD Blending using B-Splines. "; cout << "Order: " << SplineOrder[0] << ", " << SplineOrder[1]; if (nDim == 3) cout << ", " << SplineOrder[2]; cout << ". " << endl; } - if (Blending == BEZIER){ + if (Blending == BEZIER) { cout << "FFD Blending using Bezier Curves." << endl; } } FFDBox[iFFDBox] = new CFreeFormDefBox(degree, SplineOrder, Blending); - FFDBox[iFFDBox]->SetTag(TagFFDBox); FFDBox[iFFDBox]->SetLevel(LevelFFDBox); + FFDBox[iFFDBox]->SetTag(TagFFDBox); + FFDBox[iFFDBox]->SetLevel(LevelFFDBox); /*--- Read the number of parents boxes ---*/ - getline (mesh_file, text_line); - text_line.erase (0,12); + getline(mesh_file, text_line); + text_line.erase(0, 12); nParentFFDBox = atoi(text_line.c_str()); - if (rank == MASTER_NODE) cout << "Number of parent boxes: " << nParentFFDBox <<". "; + if (rank == MASTER_NODE) cout << "Number of parent boxes: " << nParentFFDBox << ". "; for (iParentFFDBox = 0; iParentFFDBox < nParentFFDBox; iParentFFDBox++) { getline(mesh_file, text_line); @@ -4047,24 +4223,24 @@ void CSurfaceMovement::ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFo string::size_type position; for (iChar = 0; iChar < 20; iChar++) { - position = text_line.find( " ", 0 ); - if (position != string::npos) text_line.erase (position,1); - position = text_line.find( "\r", 0 ); - if (position != string::npos) text_line.erase (position,1); - position = text_line.find( "\n", 0 ); - if (position != string::npos) text_line.erase (position,1); + position = text_line.find(' ', 0); + if (position != string::npos) text_line.erase(position, 1); + position = text_line.find('\r', 0); + if (position != string::npos) text_line.erase(position, 1); + position = text_line.find('\n', 0); + if (position != string::npos) text_line.erase(position, 1); } - string ParentFFDBox = text_line.c_str(); + string ParentFFDBox = text_line; FFDBox[iFFDBox]->SetParentFFDBox(ParentFFDBox); } /*--- Read the number of children boxes ---*/ - getline (mesh_file, text_line); - text_line.erase (0,13); + getline(mesh_file, text_line); + text_line.erase(0, 13); nChildFFDBox = atoi(text_line.c_str()); - if (rank == MASTER_NODE) cout << "Number of child boxes: " << nChildFFDBox <<"." << endl; + if (rank == MASTER_NODE) cout << "Number of child boxes: " << nChildFFDBox << "." << endl; for (iChildFFDBox = 0; iChildFFDBox < nChildFFDBox; iChildFFDBox++) { getline(mesh_file, text_line); @@ -4073,117 +4249,127 @@ void CSurfaceMovement::ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFo string::size_type position; for (iChar = 0; iChar < 20; iChar++) { - position = text_line.find( " ", 0 ); - if (position != string::npos) text_line.erase (position,1); - position = text_line.find( "\r", 0 ); - if (position != string::npos) text_line.erase (position,1); - position = text_line.find( "\n", 0 ); - if (position != string::npos) text_line.erase (position,1); + position = text_line.find(' ', 0); + if (position != string::npos) text_line.erase(position, 1); + position = text_line.find('\r', 0); + if (position != string::npos) text_line.erase(position, 1); + position = text_line.find('\n', 0); + if (position != string::npos) text_line.erase(position, 1); } - string ChildFFDBox = text_line.c_str(); + string ChildFFDBox = text_line; FFDBox[iFFDBox]->SetChildFFDBox(ChildFFDBox); } /*--- Read the number of the corner points ---*/ - getline (mesh_file, text_line); - text_line.erase (0,18); nCornerPoints[iFFDBox] = atoi(text_line.c_str()); - if (rank == MASTER_NODE) cout << "Corner points: " << nCornerPoints[iFFDBox] <<". "; - if (nDim == 2) nCornerPoints[iFFDBox] = nCornerPoints[iFFDBox]*SU2_TYPE::Int(2); - - + getline(mesh_file, text_line); + text_line.erase(0, 18); + nCornerPoints[iFFDBox] = atoi(text_line.c_str()); + if (rank == MASTER_NODE) cout << "Corner points: " << nCornerPoints[iFFDBox] << ". "; + if (nDim == 2) nCornerPoints[iFFDBox] = nCornerPoints[iFFDBox] * SU2_TYPE::Int(2); /*--- Read the coordinates of the corner points ---*/ - if (nDim == 2) { - if (polar) { - - getline(mesh_file, text_line); istringstream FFDBox_line_1(text_line); - FFDBox_line_1 >> XCoord; FFDBox_line_1 >> YCoord; + getline(mesh_file, text_line); + istringstream FFDBox_line_1(text_line); + FFDBox_line_1 >> XCoord; + FFDBox_line_1 >> YCoord; CPcoord[0] = XCoord; - CPcoord[1] = cos(0.1)*YCoord; - CPcoord[2] = -sin(0.1)*YCoord; + CPcoord[1] = cos(0.1) * YCoord; + CPcoord[2] = -sin(0.1) * YCoord; FFDBox[iFFDBox]->SetCoordCornerPoints(coord, 4); CPcoord[0] = XCoord; - CPcoord[1] = cos(0.1)*YCoord; - CPcoord[2] = sin(0.1)*YCoord; + CPcoord[1] = cos(0.1) * YCoord; + CPcoord[2] = sin(0.1) * YCoord; FFDBox[iFFDBox]->SetCoordCornerPoints(coord, 7); - getline(mesh_file, text_line); istringstream FFDBox_line_2(text_line); - FFDBox_line_2 >> XCoord; FFDBox_line_2 >> YCoord; + getline(mesh_file, text_line); + istringstream FFDBox_line_2(text_line); + FFDBox_line_2 >> XCoord; + FFDBox_line_2 >> YCoord; CPcoord[0] = XCoord; - CPcoord[1] = cos(0.1)*YCoord; - CPcoord[2] = -sin(0.1)*YCoord; + CPcoord[1] = cos(0.1) * YCoord; + CPcoord[2] = -sin(0.1) * YCoord; FFDBox[iFFDBox]->SetCoordCornerPoints(CPcoord, 0); CPcoord[0] = XCoord; - CPcoord[1] = cos(0.1)*YCoord; - CPcoord[2] = sin(0.1)*YCoord; + CPcoord[1] = cos(0.1) * YCoord; + CPcoord[2] = sin(0.1) * YCoord; FFDBox[iFFDBox]->SetCoordCornerPoints(CPcoord, 3); - getline(mesh_file, text_line); istringstream FFDBox_line_3(text_line); - FFDBox_line_3 >> XCoord; FFDBox_line_3 >> YCoord; + getline(mesh_file, text_line); + istringstream FFDBox_line_3(text_line); + FFDBox_line_3 >> XCoord; + FFDBox_line_3 >> YCoord; CPcoord[0] = XCoord; - CPcoord[1] = cos(0.1)*YCoord; - CPcoord[2] = -sin(0.1)*YCoord; + CPcoord[1] = cos(0.1) * YCoord; + CPcoord[2] = -sin(0.1) * YCoord; FFDBox[iFFDBox]->SetCoordCornerPoints(CPcoord, 1); CPcoord[0] = XCoord; - CPcoord[1] = cos(0.1)*YCoord; - CPcoord[2] = sin(0.1)*YCoord; + CPcoord[1] = cos(0.1) * YCoord; + CPcoord[2] = sin(0.1) * YCoord; FFDBox[iFFDBox]->SetCoordCornerPoints(CPcoord, 2); - getline(mesh_file, text_line); istringstream FFDBox_line_4(text_line); - FFDBox_line_4 >> XCoord; FFDBox_line_4 >> YCoord; + getline(mesh_file, text_line); + istringstream FFDBox_line_4(text_line); + FFDBox_line_4 >> XCoord; + FFDBox_line_4 >> YCoord; CPcoord[0] = XCoord; - CPcoord[1] = cos(0.1)*YCoord; - CPcoord[2] = -sin(0.1)*YCoord; + CPcoord[1] = cos(0.1) * YCoord; + CPcoord[2] = -sin(0.1) * YCoord; FFDBox[iFFDBox]->SetCoordCornerPoints(CPcoord, 5); CPcoord[0] = XCoord; - CPcoord[1] = cos(0.1)*YCoord; - CPcoord[2] = sin(0.1)*YCoord; + CPcoord[1] = cos(0.1) * YCoord; + CPcoord[2] = sin(0.1) * YCoord; FFDBox[iFFDBox]->SetCoordCornerPoints(CPcoord, 6); - } - else { + } else { for (iCornerPoints = 0; iCornerPoints < nCornerPoints[iFFDBox]; iCornerPoints++) { - if (iCornerPoints < nCornerPoints[iFFDBox]/SU2_TYPE::Int(2)) { - getline(mesh_file, text_line); istringstream FFDBox_line(text_line); - FFDBox_line >> CPcoord[0]; FFDBox_line >> CPcoord[1]; CPcoord[2] = -0.5; - } - else { - CPcoord[0] = FFDBox[iFFDBox]->GetCoordCornerPoints(0, iCornerPoints-nCornerPoints[iFFDBox]/SU2_TYPE::Int(2)); - CPcoord[1] = FFDBox[iFFDBox]->GetCoordCornerPoints(1, iCornerPoints-nCornerPoints[iFFDBox]/SU2_TYPE::Int(2)); + if (iCornerPoints < nCornerPoints[iFFDBox] / SU2_TYPE::Int(2)) { + getline(mesh_file, text_line); + istringstream FFDBox_line(text_line); + FFDBox_line >> CPcoord[0]; + FFDBox_line >> CPcoord[1]; + CPcoord[2] = -0.5; + } else { + CPcoord[0] = + FFDBox[iFFDBox]->GetCoordCornerPoints(0, iCornerPoints - nCornerPoints[iFFDBox] / SU2_TYPE::Int(2)); + CPcoord[1] = + FFDBox[iFFDBox]->GetCoordCornerPoints(1, iCornerPoints - nCornerPoints[iFFDBox] / SU2_TYPE::Int(2)); CPcoord[2] = 0.5; } FFDBox[iFFDBox]->SetCoordCornerPoints(CPcoord, iCornerPoints); } } - } - else { + } else { for (iCornerPoints = 0; iCornerPoints < nCornerPoints[iFFDBox]; iCornerPoints++) { - getline(mesh_file, text_line); istringstream FFDBox_line(text_line); - FFDBox_line >> CPcoord[0]; FFDBox_line >> CPcoord[1]; FFDBox_line >> CPcoord[2]; + getline(mesh_file, text_line); + istringstream FFDBox_line(text_line); + FFDBox_line >> CPcoord[0]; + FFDBox_line >> CPcoord[1]; + FFDBox_line >> CPcoord[2]; FFDBox[iFFDBox]->SetCoordCornerPoints(CPcoord, iCornerPoints); } } /*--- Read the number of the control points ---*/ - getline (mesh_file, text_line); - text_line.erase (0,19); nControlPoints[iFFDBox] = atoi(text_line.c_str()); + getline(mesh_file, text_line); + text_line.erase(0, 19); + nControlPoints[iFFDBox] = atoi(text_line.c_str()); - if (rank == MASTER_NODE) cout << "Control points: " << nControlPoints[iFFDBox] <<". "; + if (rank == MASTER_NODE) cout << "Control points: " << nControlPoints[iFFDBox] << ". "; /*--- Method to identify if there is a FFDBox definition ---*/ @@ -4192,34 +4378,43 @@ void CSurfaceMovement::ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFo /*--- Read the coordinates of the control points ---*/ for (iControlPoints = 0; iControlPoints < nControlPoints[iFFDBox]; iControlPoints++) { - getline(mesh_file, text_line); istringstream FFDBox_line(text_line); - FFDBox_line >> iDegree; FFDBox_line >> jDegree; FFDBox_line >> kDegree; - FFDBox_line >> CPcoord[0]; FFDBox_line >> CPcoord[1]; FFDBox_line >> CPcoord[2]; + getline(mesh_file, text_line); + istringstream FFDBox_line(text_line); + FFDBox_line >> iDegree; + FFDBox_line >> jDegree; + FFDBox_line >> kDegree; + FFDBox_line >> CPcoord[0]; + FFDBox_line >> CPcoord[1]; + FFDBox_line >> CPcoord[2]; FFDBox[iFFDBox]->SetCoordControlPoints(CPcoord, iDegree, jDegree, kDegree); FFDBox[iFFDBox]->SetCoordControlPoints_Copy(CPcoord, iDegree, jDegree, kDegree); } - getline (mesh_file, text_line); - text_line.erase (0,19); nSurfacePoints[iFFDBox] = atoi(text_line.c_str()); + getline(mesh_file, text_line); + text_line.erase(0, 19); + nSurfacePoints[iFFDBox] = atoi(text_line.c_str()); /*--- The surface points parametric coordinates, all the nodes read the FFD information but they only store their part ---*/ my_nSurfPoints = 0; for (iSurfacePoints = 0; iSurfacePoints < nSurfacePoints[iFFDBox]; iSurfacePoints++) { - getline(mesh_file, text_line); istringstream FFDBox_line(text_line); - FFDBox_line >> iTag; FFDBox_line >> iPoint; + getline(mesh_file, text_line); + istringstream FFDBox_line(text_line); + FFDBox_line >> iTag; + FFDBox_line >> iPoint; if (config->GetMarker_All_TagBound(iTag) != -1) { - iMarker = config->GetMarker_All_TagBound(iTag); - FFDBox_line >> CPcoord[0]; FFDBox_line >> CPcoord[1]; FFDBox_line >> CPcoord[2]; + FFDBox_line >> CPcoord[0]; + FFDBox_line >> CPcoord[1]; + FFDBox_line >> CPcoord[2]; for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - jPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + jPoint = geometry->vertex[iMarker][iVertex]->GetNode(); if (iPoint == geometry->nodes->GetGlobalIndex(jPoint)) { for (iDim = 0; iDim < nDim; iDim++) { - coord[iDim] = geometry->nodes->GetCoord(jPoint,iDim); + coord[iDim] = geometry->nodes->GetCoord(jPoint, iDim); } FFDBox[iFFDBox]->Set_MarkerIndex(iMarker); FFDBox[iFFDBox]->Set_VertexIndex(iVertex); @@ -4229,9 +4424,7 @@ void CSurfaceMovement::ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFo my_nSurfPoints++; } } - } - } nSurfacePoints[iFFDBox] = my_nSurfPoints; @@ -4239,44 +4432,40 @@ void CSurfaceMovement::ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFo #ifdef HAVE_MPI nSurfPoints = 0; SU2_MPI::Allreduce(&my_nSurfPoints, &nSurfPoints, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); - if (rank == MASTER_NODE) cout << "Surface points: " << nSurfPoints <<"."<< endl; + if (rank == MASTER_NODE) cout << "Surface points: " << nSurfPoints << "." << endl; #else nSurfPoints = my_nSurfPoints; - if (rank == MASTER_NODE) cout << "Surface points: " << nSurfPoints <<"."<< endl; + if (rank == MASTER_NODE) cout << "Surface points: " << nSurfPoints << "." << endl; #endif - } - delete [] nCornerPoints; - delete [] nControlPoints; - delete [] nSurfacePoints; + delete[] nCornerPoints; + delete[] nControlPoints; + delete[] nSurfacePoints; } } mesh_file.close(); if (nFFDBox == 0) { - if (rank == MASTER_NODE) cout <<"There is no FFD box definition. Just in case, check the .su2 file" << endl; + if (rank == MASTER_NODE) cout << "There is no FFD box definition. Just in case, check the .su2 file" << endl; } - } -void CSurfaceMovement::ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFormDefBox **FFDBox) { - +void CSurfaceMovement::ReadFFDInfo(CGeometry* geometry, CConfig* config, CFreeFormDefBox** FFDBox) { string text_line, iTag; ifstream mesh_file; su2double coord[3]; - unsigned short degree[3], iFFDBox, iCornerPoints, LevelFFDBox, nParentFFDBox, - iParentFFDBox, nChildFFDBox, iChildFFDBox, *nCornerPoints; + unsigned short degree[3], iFFDBox, iCornerPoints, LevelFFDBox, nParentFFDBox, iParentFFDBox, nChildFFDBox, + iChildFFDBox, *nCornerPoints; bool polar = (config->GetFFD_CoordSystem() == POLAR); unsigned short nDim = geometry->GetnDim(), iDim; - unsigned short SplineOrder[3]={2,2,2}; + unsigned short SplineOrder[3] = {2, 2, 2}; - for (iDim = 0; iDim < 3; iDim++){ + for (iDim = 0; iDim < 3; iDim++) { SplineOrder[iDim] = SU2_TYPE::Short(config->GetFFD_BSplineOrder()[iDim]); } - /*--- Read the FFDBox information from the config file ---*/ nFFDBox = config->GetnFFDBox(); @@ -4285,23 +4474,22 @@ void CSurfaceMovement::ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFo nCornerPoints = new unsigned short[nFFDBox]; - nLevel = 1; // Nested FFD is not active + nLevel = 1; // Nested FFD is not active if (rank == MASTER_NODE) cout << nLevel << " Free Form Deformation nested levels." << endl; - for (iFFDBox = 0 ; iFFDBox < nFFDBox; iFFDBox++) { - + for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) { /*--- Read the name of the FFD box ---*/ string TagFFDBox = config->GetTagFFDBox(iFFDBox); - if (rank == MASTER_NODE) cout << "FFD box tag: " << TagFFDBox <<". "; + if (rank == MASTER_NODE) cout << "FFD box tag: " << TagFFDBox << ". "; /*--- Read the level of the FFD box ---*/ - LevelFFDBox = 0; // Nested FFD is not active + LevelFFDBox = 0; // Nested FFD is not active - if (rank == MASTER_NODE) cout << "FFD box level: " << LevelFFDBox <<". "; + if (rank == MASTER_NODE) cout << "FFD box level: " << LevelFFDBox << ". "; /*--- Read the degree of the FFD box ---*/ @@ -4310,14 +4498,12 @@ void CSurfaceMovement::ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFo degree[0] = config->GetDegreeFFDBox(iFFDBox, 0); degree[1] = 1; degree[2] = config->GetDegreeFFDBox(iFFDBox, 1); - } - else { + } else { degree[0] = config->GetDegreeFFDBox(iFFDBox, 0); degree[1] = config->GetDegreeFFDBox(iFFDBox, 1); degree[2] = 1; } - } - else { + } else { degree[0] = config->GetDegreeFFDBox(iFFDBox, 0); degree[1] = config->GetDegreeFFDBox(iFFDBox, 1); degree[2] = config->GetDegreeFFDBox(iFFDBox, 2); @@ -4325,44 +4511,47 @@ void CSurfaceMovement::ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFo if (rank == MASTER_NODE) { if (nDim == 2) { - if (polar) cout << "Degrees: " << degree[0] << ", " << degree[2] << "." << endl; - else cout << "Degrees: " << degree[0] << ", " << degree[1] << "." << endl; - } - else cout << "Degrees: " << degree[0] << ", " << degree[1] << ", " << degree[2] << "." << endl; + if (polar) + cout << "Degrees: " << degree[0] << ", " << degree[2] << "." << endl; + else + cout << "Degrees: " << degree[0] << ", " << degree[1] << "." << endl; + } else + cout << "Degrees: " << degree[0] << ", " << degree[1] << ", " << degree[2] << "." << endl; } - if (rank == MASTER_NODE){ - if (config->GetFFD_Blending() == BSPLINE_UNIFORM){ + if (rank == MASTER_NODE) { + if (config->GetFFD_Blending() == BSPLINE_UNIFORM) { cout << "FFD Blending using B-Splines. "; cout << "Order: " << SplineOrder[0] << ", " << SplineOrder[1]; if (nDim == 3) cout << ", " << SplineOrder[2]; cout << ". " << endl; } - if (config->GetFFD_Blending() == BEZIER){ + if (config->GetFFD_Blending() == BEZIER) { cout << "FFD Blending using Bezier Curves." << endl; } } FFDBox[iFFDBox] = new CFreeFormDefBox(degree, SplineOrder, config->GetFFD_Blending()); - FFDBox[iFFDBox]->SetTag(TagFFDBox); FFDBox[iFFDBox]->SetLevel(LevelFFDBox); + FFDBox[iFFDBox]->SetTag(TagFFDBox); + FFDBox[iFFDBox]->SetLevel(LevelFFDBox); /*--- Read the number of parents boxes ---*/ - nParentFFDBox = 0; // Nested FFD is not active - if (rank == MASTER_NODE) cout << "Number of parent boxes: " << nParentFFDBox <<". "; + nParentFFDBox = 0; // Nested FFD is not active + if (rank == MASTER_NODE) cout << "Number of parent boxes: " << nParentFFDBox << ". "; for (iParentFFDBox = 0; iParentFFDBox < nParentFFDBox; iParentFFDBox++) { - string ParentFFDBox = "NONE"; // Nested FFD is not active + string ParentFFDBox = "NONE"; // Nested FFD is not active FFDBox[iFFDBox]->SetParentFFDBox(ParentFFDBox); } /*--- Read the number of children boxes ---*/ - nChildFFDBox = 0; // Nested FFD is not active - if (rank == MASTER_NODE) cout << "Number of child boxes: " << nChildFFDBox <<"." << endl; + nChildFFDBox = 0; // Nested FFD is not active + if (rank == MASTER_NODE) cout << "Number of child boxes: " << nChildFFDBox << "." << endl; for (iChildFFDBox = 0; iChildFFDBox < nChildFFDBox; iChildFFDBox++) { - string ChildFFDBox = "NONE"; // Nested FFD is not active + string ChildFFDBox = "NONE"; // Nested FFD is not active FFDBox[iFFDBox]->SetChildFFDBox(ChildFFDBox); } @@ -4373,93 +4562,86 @@ void CSurfaceMovement::ReadFFDInfo(CGeometry *geometry, CConfig *config, CFreeFo /*--- Read the coordinates of the corner points ---*/ for (iCornerPoints = 0; iCornerPoints < nCornerPoints[iFFDBox]; iCornerPoints++) { - if (nDim == 2) { - if (polar) { - - coord[0] = config->GetCoordFFDBox(iFFDBox, 1*3); - coord[1] = cos(0.1)*config->GetCoordFFDBox(iFFDBox, 1*3+1); - coord[2] = -sin(0.1)*config->GetCoordFFDBox(iFFDBox, 1*3+1); + coord[0] = config->GetCoordFFDBox(iFFDBox, 1 * 3); + coord[1] = cos(0.1) * config->GetCoordFFDBox(iFFDBox, 1 * 3 + 1); + coord[2] = -sin(0.1) * config->GetCoordFFDBox(iFFDBox, 1 * 3 + 1); FFDBox[iFFDBox]->SetCoordCornerPoints(coord, 0); - coord[0] = config->GetCoordFFDBox(iFFDBox, 2*3); - coord[1] = cos(0.1)*config->GetCoordFFDBox(iFFDBox, 2*3+1); - coord[2] = -sin(0.1)*config->GetCoordFFDBox(iFFDBox, 2*3+1); + coord[0] = config->GetCoordFFDBox(iFFDBox, 2 * 3); + coord[1] = cos(0.1) * config->GetCoordFFDBox(iFFDBox, 2 * 3 + 1); + coord[2] = -sin(0.1) * config->GetCoordFFDBox(iFFDBox, 2 * 3 + 1); FFDBox[iFFDBox]->SetCoordCornerPoints(coord, 1); - coord[0] = config->GetCoordFFDBox(iFFDBox, 2*3); - coord[1] = cos(0.1)*config->GetCoordFFDBox(iFFDBox, 2*3+1); - coord[2] = sin(0.1)*config->GetCoordFFDBox(iFFDBox, 2*3+1); + coord[0] = config->GetCoordFFDBox(iFFDBox, 2 * 3); + coord[1] = cos(0.1) * config->GetCoordFFDBox(iFFDBox, 2 * 3 + 1); + coord[2] = sin(0.1) * config->GetCoordFFDBox(iFFDBox, 2 * 3 + 1); FFDBox[iFFDBox]->SetCoordCornerPoints(coord, 2); - coord[0] = config->GetCoordFFDBox(iFFDBox, 1*3); - coord[1] = cos(0.1)*config->GetCoordFFDBox(iFFDBox, 1*3+1); - coord[2] = sin(0.1)*config->GetCoordFFDBox(iFFDBox, 1*3+1); + coord[0] = config->GetCoordFFDBox(iFFDBox, 1 * 3); + coord[1] = cos(0.1) * config->GetCoordFFDBox(iFFDBox, 1 * 3 + 1); + coord[2] = sin(0.1) * config->GetCoordFFDBox(iFFDBox, 1 * 3 + 1); FFDBox[iFFDBox]->SetCoordCornerPoints(coord, 3); - coord[0] = config->GetCoordFFDBox(iFFDBox, 0*3); - coord[1] = cos(0.1)*config->GetCoordFFDBox(iFFDBox, 0*3+1); - coord[2] = -sin(0.1)*config->GetCoordFFDBox(iFFDBox, 0*3+1); + coord[0] = config->GetCoordFFDBox(iFFDBox, 0 * 3); + coord[1] = cos(0.1) * config->GetCoordFFDBox(iFFDBox, 0 * 3 + 1); + coord[2] = -sin(0.1) * config->GetCoordFFDBox(iFFDBox, 0 * 3 + 1); FFDBox[iFFDBox]->SetCoordCornerPoints(coord, 4); - coord[0] = config->GetCoordFFDBox(iFFDBox, 3*3); - coord[1] = cos(0.1)*config->GetCoordFFDBox(iFFDBox, 3*3+1); - coord[2] = -sin(0.1)*config->GetCoordFFDBox(iFFDBox, 3*3+1); + coord[0] = config->GetCoordFFDBox(iFFDBox, 3 * 3); + coord[1] = cos(0.1) * config->GetCoordFFDBox(iFFDBox, 3 * 3 + 1); + coord[2] = -sin(0.1) * config->GetCoordFFDBox(iFFDBox, 3 * 3 + 1); FFDBox[iFFDBox]->SetCoordCornerPoints(coord, 5); - coord[0] = config->GetCoordFFDBox(iFFDBox, 3*3); - coord[1] = cos(0.1)*config->GetCoordFFDBox(iFFDBox, 3*3+1); - coord[2] = sin(0.1)*config->GetCoordFFDBox(iFFDBox, 3*3+1); + coord[0] = config->GetCoordFFDBox(iFFDBox, 3 * 3); + coord[1] = cos(0.1) * config->GetCoordFFDBox(iFFDBox, 3 * 3 + 1); + coord[2] = sin(0.1) * config->GetCoordFFDBox(iFFDBox, 3 * 3 + 1); FFDBox[iFFDBox]->SetCoordCornerPoints(coord, 6); - coord[0] = config->GetCoordFFDBox(iFFDBox, 0*3); - coord[1] = cos(0.1)*config->GetCoordFFDBox(iFFDBox, 0*3+1); - coord[2] = sin(0.1)*config->GetCoordFFDBox(iFFDBox, 0*3+1); + coord[0] = config->GetCoordFFDBox(iFFDBox, 0 * 3); + coord[1] = cos(0.1) * config->GetCoordFFDBox(iFFDBox, 0 * 3 + 1); + coord[2] = sin(0.1) * config->GetCoordFFDBox(iFFDBox, 0 * 3 + 1); FFDBox[iFFDBox]->SetCoordCornerPoints(coord, 7); } else { - if (iCornerPoints < nCornerPoints[iFFDBox]/SU2_TYPE::Int(2)) { - coord[0] = config->GetCoordFFDBox(iFFDBox, iCornerPoints*3); - coord[1] = config->GetCoordFFDBox(iFFDBox, iCornerPoints*3+1); + if (iCornerPoints < nCornerPoints[iFFDBox] / SU2_TYPE::Int(2)) { + coord[0] = config->GetCoordFFDBox(iFFDBox, iCornerPoints * 3); + coord[1] = config->GetCoordFFDBox(iFFDBox, iCornerPoints * 3 + 1); coord[2] = -0.5; - } - else { - coord[0] = FFDBox[iFFDBox]->GetCoordCornerPoints(0, iCornerPoints-nCornerPoints[iFFDBox]/SU2_TYPE::Int(2)); - coord[1] = FFDBox[iFFDBox]->GetCoordCornerPoints(1, iCornerPoints-nCornerPoints[iFFDBox]/SU2_TYPE::Int(2)); + } else { + coord[0] = + FFDBox[iFFDBox]->GetCoordCornerPoints(0, iCornerPoints - nCornerPoints[iFFDBox] / SU2_TYPE::Int(2)); + coord[1] = + FFDBox[iFFDBox]->GetCoordCornerPoints(1, iCornerPoints - nCornerPoints[iFFDBox] / SU2_TYPE::Int(2)); coord[2] = 0.5; } } - } - else { - coord[0] = config->GetCoordFFDBox(iFFDBox, iCornerPoints*3); - coord[1] = config->GetCoordFFDBox(iFFDBox, iCornerPoints*3+1); - coord[2] = config->GetCoordFFDBox(iFFDBox, iCornerPoints*3+2); + } else { + coord[0] = config->GetCoordFFDBox(iFFDBox, iCornerPoints * 3); + coord[1] = config->GetCoordFFDBox(iFFDBox, iCornerPoints * 3 + 1); + coord[2] = config->GetCoordFFDBox(iFFDBox, iCornerPoints * 3 + 2); } FFDBox[iFFDBox]->SetCoordCornerPoints(coord, iCornerPoints); - } /*--- Method to identify if there is a FFDBox definition ---*/ FFDBoxDefinition = false; - } - delete [] nCornerPoints; + delete[] nCornerPoints; if (nFFDBox == 0) { SU2_MPI::Error("There is no FFD box definition. Check the config file.", CURRENT_FUNCTION); } - } -void CSurfaceMovement::MergeFFDInfo(CGeometry *geometry, CConfig *config) { - +void CSurfaceMovement::MergeFFDInfo(CGeometry* geometry, CConfig* config) { /*--- Local variables needed on all processors ---*/ unsigned long iPoint; @@ -4472,12 +4654,10 @@ void CSurfaceMovement::MergeFFDInfo(CGeometry *geometry, CConfig *config) { /*--- Total number of points in each FFD box. ---*/ - for (iFFDBox = 0 ; iFFDBox < nFFDBox; iFFDBox++) { - + for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) { /*--- Loop over the mesh to collect the coords of the local points. ---*/ for (iPoint = 0; iPoint < FFDBox[iFFDBox]->GetnSurfacePoint(); iPoint++) { - /*--- Retrieve the current parametric coordinates at this node. ---*/ GlobalCoordX[iFFDBox].push_back(FFDBox[iFFDBox]->Get_ParametricCoord(iPoint)[0]); @@ -4498,9 +4678,7 @@ void CSurfaceMovement::MergeFFDInfo(CGeometry *geometry, CConfig *config) { /*--- Set the value of the tag at this node. ---*/ GlobalTag[iFFDBox].push_back(TagBound_CfgFile); - } - } #else @@ -4518,55 +4696,50 @@ void CSurfaceMovement::MergeFFDInfo(CGeometry *geometry, CConfig *config) { if (rank == MASTER_NODE) Buffer_Recv_nPoint = new unsigned long[nProcessor]; - for (iFFDBox = 0 ; iFFDBox < nFFDBox; iFFDBox++) { - + for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) { nLocalPoint = 0; for (iPoint = 0; iPoint < FFDBox[iFFDBox]->GetnSurfacePoint(); iPoint++) { - iPointLocal = FFDBox[iFFDBox]->Get_PointIndex(iPoint); if (iPointLocal < geometry->GetnPointDomain()) { nLocalPoint++; } - } Buffer_Send_nPoint[0] = nLocalPoint; /*--- Communicate the total number of nodes on this domain. ---*/ - SU2_MPI::Gather(&Buffer_Send_nPoint, 1, MPI_UNSIGNED_LONG, - Buffer_Recv_nPoint, 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(&Buffer_Send_nPoint, 1, MPI_UNSIGNED_LONG, Buffer_Recv_nPoint, 1, MPI_UNSIGNED_LONG, MASTER_NODE, + SU2_MPI::GetComm()); SU2_MPI::Allreduce(&nLocalPoint, &MaxLocalPoint, 1, MPI_UNSIGNED_LONG, MPI_MAX, SU2_MPI::GetComm()); nBuffer_Scalar = MaxLocalPoint; /*--- Send and Recv buffers. ---*/ - su2double *Buffer_Send_X = new su2double[MaxLocalPoint]; - su2double *Buffer_Recv_X = nullptr; + auto* Buffer_Send_X = new su2double[MaxLocalPoint]; + su2double* Buffer_Recv_X = nullptr; - su2double *Buffer_Send_Y = new su2double[MaxLocalPoint]; - su2double *Buffer_Recv_Y = nullptr; + auto* Buffer_Send_Y = new su2double[MaxLocalPoint]; + su2double* Buffer_Recv_Y = nullptr; - su2double *Buffer_Send_Z = new su2double[MaxLocalPoint]; - su2double *Buffer_Recv_Z = nullptr; + auto* Buffer_Send_Z = new su2double[MaxLocalPoint]; + su2double* Buffer_Recv_Z = nullptr; - unsigned long *Buffer_Send_Point = new unsigned long[MaxLocalPoint]; - unsigned long *Buffer_Recv_Point = nullptr; + auto* Buffer_Send_Point = new unsigned long[MaxLocalPoint]; + unsigned long* Buffer_Recv_Point = nullptr; - unsigned short *Buffer_Send_MarkerIndex_CfgFile = new unsigned short[MaxLocalPoint]; - unsigned short *Buffer_Recv_MarkerIndex_CfgFile = nullptr; + auto* Buffer_Send_MarkerIndex_CfgFile = new unsigned short[MaxLocalPoint]; + unsigned short* Buffer_Recv_MarkerIndex_CfgFile = nullptr; /*--- Prepare the receive buffers in the master node only. ---*/ if (rank == MASTER_NODE) { - - Buffer_Recv_X = new su2double[nProcessor*MaxLocalPoint]; - Buffer_Recv_Y = new su2double[nProcessor*MaxLocalPoint]; - Buffer_Recv_Z = new su2double[nProcessor*MaxLocalPoint]; - Buffer_Recv_Point = new unsigned long[nProcessor*MaxLocalPoint]; - Buffer_Recv_MarkerIndex_CfgFile = new unsigned short[nProcessor*MaxLocalPoint]; - + Buffer_Recv_X = new su2double[nProcessor * MaxLocalPoint]; + Buffer_Recv_Y = new su2double[nProcessor * MaxLocalPoint]; + Buffer_Recv_Z = new su2double[nProcessor * MaxLocalPoint]; + Buffer_Recv_Point = new unsigned long[nProcessor * MaxLocalPoint]; + Buffer_Recv_MarkerIndex_CfgFile = new unsigned short[nProcessor * MaxLocalPoint]; } /*--- Main communication routine. Loop over each coordinate and perform @@ -4578,11 +4751,9 @@ void CSurfaceMovement::MergeFFDInfo(CGeometry *geometry, CConfig *config) { jPoint = 0; for (iPoint = 0; iPoint < FFDBox[iFFDBox]->GetnSurfacePoint(); iPoint++) { - iPointLocal = FFDBox[iFFDBox]->Get_PointIndex(iPoint); if (iPointLocal < geometry->GetnPointDomain()) { - /*--- Load local coords into the temporary send buffer. ---*/ Buffer_Send_X[jPoint] = FFDBox[iFFDBox]->Get_ParametricCoord(iPoint)[0]; @@ -4604,28 +4775,30 @@ void CSurfaceMovement::MergeFFDInfo(CGeometry *geometry, CConfig *config) { Buffer_Send_MarkerIndex_CfgFile[jPoint] = MarkerIndex_CfgFile; jPoint++; - } - } /*--- Gather the coordinate data on the master node using MPI. ---*/ - SU2_MPI::Gather(Buffer_Send_X, nBuffer_Scalar, MPI_DOUBLE, Buffer_Recv_X, nBuffer_Scalar, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(Buffer_Send_Y, nBuffer_Scalar, MPI_DOUBLE, Buffer_Recv_Y, nBuffer_Scalar, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(Buffer_Send_Z, nBuffer_Scalar, MPI_DOUBLE, Buffer_Recv_Z, nBuffer_Scalar, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(Buffer_Send_Point, nBuffer_Scalar, MPI_UNSIGNED_LONG, Buffer_Recv_Point, nBuffer_Scalar, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(Buffer_Send_MarkerIndex_CfgFile, nBuffer_Scalar, MPI_UNSIGNED_SHORT, Buffer_Recv_MarkerIndex_CfgFile, nBuffer_Scalar, MPI_UNSIGNED_SHORT, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_X, nBuffer_Scalar, MPI_DOUBLE, Buffer_Recv_X, nBuffer_Scalar, MPI_DOUBLE, MASTER_NODE, + SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_Y, nBuffer_Scalar, MPI_DOUBLE, Buffer_Recv_Y, nBuffer_Scalar, MPI_DOUBLE, MASTER_NODE, + SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_Z, nBuffer_Scalar, MPI_DOUBLE, Buffer_Recv_Z, nBuffer_Scalar, MPI_DOUBLE, MASTER_NODE, + SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_Point, nBuffer_Scalar, MPI_UNSIGNED_LONG, Buffer_Recv_Point, nBuffer_Scalar, + MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_MarkerIndex_CfgFile, nBuffer_Scalar, MPI_UNSIGNED_SHORT, + Buffer_Recv_MarkerIndex_CfgFile, nBuffer_Scalar, MPI_UNSIGNED_SHORT, MASTER_NODE, + SU2_MPI::GetComm()); /*--- The master node unpacks and sorts this variable by global index ---*/ if (rank == MASTER_NODE) { - jPoint = 0; for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) { for (iPoint = 0; iPoint < Buffer_Recv_nPoint[iProcessor]; iPoint++) { - /*--- Get global index, then loop over each variable and store ---*/ GlobalCoordX[iFFDBox].push_back(Buffer_Recv_X[jPoint]); @@ -4636,67 +4809,58 @@ void CSurfaceMovement::MergeFFDInfo(CGeometry *geometry, CConfig *config) { string TagBound_CfgFile = config->GetMarker_CfgFile_TagBound(Buffer_Recv_MarkerIndex_CfgFile[jPoint]); GlobalTag[iFFDBox].push_back(TagBound_CfgFile); jPoint++; - } /*--- Adjust jPoint to index of next proc's data in the buffers. ---*/ - jPoint = (iProcessor+1)*nBuffer_Scalar; - + jPoint = (iProcessor + 1) * nBuffer_Scalar; } } /*--- Immediately release the temporary data buffers. ---*/ - delete [] Buffer_Send_X; - delete [] Buffer_Send_Y; - delete [] Buffer_Send_Z; - delete [] Buffer_Send_Point; - delete [] Buffer_Send_MarkerIndex_CfgFile; + delete[] Buffer_Send_X; + delete[] Buffer_Send_Y; + delete[] Buffer_Send_Z; + delete[] Buffer_Send_Point; + delete[] Buffer_Send_MarkerIndex_CfgFile; if (rank == MASTER_NODE) { - delete [] Buffer_Recv_X; - delete [] Buffer_Recv_Y; - delete [] Buffer_Recv_Z; - delete [] Buffer_Recv_Point; - delete [] Buffer_Recv_MarkerIndex_CfgFile; + delete[] Buffer_Recv_X; + delete[] Buffer_Recv_Y; + delete[] Buffer_Recv_Z; + delete[] Buffer_Recv_Point; + delete[] Buffer_Recv_MarkerIndex_CfgFile; } - } if (rank == MASTER_NODE) { - delete [] Buffer_Recv_nPoint; + delete[] Buffer_Recv_nPoint; } #endif - } -void CSurfaceMovement::WriteFFDInfo(CSurfaceMovement** surface_movement, CGeometry **geometry, CConfig **config) { - - +void CSurfaceMovement::WriteFFDInfo(CSurfaceMovement** surface_movement, CGeometry**** geometry, CConfig** config) { unsigned short iOrder, jOrder, kOrder, iFFDBox, iCornerPoints, iParentFFDBox, iChildFFDBox, iZone; unsigned long iSurfacePoints; ofstream output_file; - su2double *coord; + su2double* coord; string text_line; bool polar = (config[ZONE_0]->GetFFD_CoordSystem() == POLAR); - unsigned short nDim = geometry[ZONE_0]->GetnDim(); - - for (iZone = 0; iZone < config[ZONE_0]->GetnZone(); iZone++){ + unsigned short nDim = geometry[ZONE_0][INST_0][MESH_0]->GetnDim(); + for (iZone = 0; iZone < config[ZONE_0]->GetnZone(); iZone++) { /*--- Merge the parallel FFD info ---*/ - surface_movement[iZone]->MergeFFDInfo(geometry[iZone], config[iZone]); - - if (iZone > 0){ + surface_movement[iZone]->MergeFFDInfo(geometry[iZone][INST_0][MESH_0], config[iZone]); + if (iZone > 0) { /* --- Merge the per-zone FFD info from the other zones into ZONE_0 ---*/ - for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++){ - + for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) { surface_movement[ZONE_0]->GlobalCoordX[iFFDBox].insert(surface_movement[ZONE_0]->GlobalCoordX[iFFDBox].end(), surface_movement[iZone]->GlobalCoordX[iFFDBox].begin(), surface_movement[iZone]->GlobalCoordX[iFFDBox].end()); @@ -4707,26 +4871,22 @@ void CSurfaceMovement::WriteFFDInfo(CSurfaceMovement** surface_movement, CGeomet surface_movement[iZone]->GlobalCoordZ[iFFDBox].begin(), surface_movement[iZone]->GlobalCoordZ[iFFDBox].end()); surface_movement[ZONE_0]->GlobalTag[iFFDBox].insert(surface_movement[ZONE_0]->GlobalTag[iFFDBox].end(), - surface_movement[iZone]->GlobalTag[iFFDBox].begin(), - surface_movement[iZone]->GlobalTag[iFFDBox].end()); + surface_movement[iZone]->GlobalTag[iFFDBox].begin(), + surface_movement[iZone]->GlobalTag[iFFDBox].end()); surface_movement[ZONE_0]->GlobalPoint[iFFDBox].insert(surface_movement[ZONE_0]->GlobalPoint[iFFDBox].end(), - surface_movement[iZone]->GlobalPoint[iFFDBox].begin(), - surface_movement[iZone]->GlobalPoint[iFFDBox].end()); + surface_movement[iZone]->GlobalPoint[iFFDBox].begin(), + surface_movement[iZone]->GlobalPoint[iFFDBox].end()); } } } - - - /*--- Attach to the mesh file the FFD information (all information is in ZONE_0) ---*/ if (rank == MASTER_NODE) { - /*--- Read the name of the output file ---*/ auto str = config[ZONE_0]->GetMesh_Out_FileName(); - unsigned short lastindex = str.find_last_of("."); + unsigned short lastindex = str.find_last_of('.'); str = str.substr(0, lastindex) + ".su2"; output_file.precision(15); @@ -4737,20 +4897,23 @@ void CSurfaceMovement::WriteFFDInfo(CSurfaceMovement** surface_movement, CGeomet output_file << "FFD_NLEVEL= " << nLevel << endl; } - for (iFFDBox = 0 ; iFFDBox < nFFDBox; iFFDBox++) { - + for (iFFDBox = 0; iFFDBox < nFFDBox; iFFDBox++) { output_file << "FFD_TAG= " << FFDBox[iFFDBox]->GetTag() << endl; output_file << "FFD_LEVEL= " << FFDBox[iFFDBox]->GetLevel() << endl; - output_file << "FFD_DEGREE_I= " << FFDBox[iFFDBox]->GetlOrder()-1 << endl; - if (polar) output_file << "FFD_DEGREE_J= " << FFDBox[iFFDBox]->GetnOrder()-1 << endl; - else output_file << "FFD_DEGREE_J= " << FFDBox[iFFDBox]->GetmOrder()-1 << endl; - if (nDim == 3) output_file << "FFD_DEGREE_K= " << FFDBox[iFFDBox]->GetnOrder()-1 << endl; + output_file << "FFD_DEGREE_I= " << FFDBox[iFFDBox]->GetlOrder() - 1 << endl; + if (polar) + output_file << "FFD_DEGREE_J= " << FFDBox[iFFDBox]->GetnOrder() - 1 << endl; + else + output_file << "FFD_DEGREE_J= " << FFDBox[iFFDBox]->GetmOrder() - 1 << endl; + if (nDim == 3) output_file << "FFD_DEGREE_K= " << FFDBox[iFFDBox]->GetnOrder() - 1 << endl; if (config[ZONE_0]->GetFFD_Blending() == BSPLINE_UNIFORM) { output_file << "FFD_BLENDING= BSPLINE_UNIFORM" << endl; output_file << "BSPLINE_ORDER_I= " << FFDBox[iFFDBox]->BlendingFunction[0]->GetOrder() << endl; - if (polar) output_file << "BSPLINE_ORDER_J= " << FFDBox[iFFDBox]->BlendingFunction[2]->GetOrder() << endl; - else output_file << "BSPLINE_ORDER_J= " << FFDBox[iFFDBox]->BlendingFunction[1]->GetOrder() << endl; + if (polar) + output_file << "BSPLINE_ORDER_J= " << FFDBox[iFFDBox]->BlendingFunction[2]->GetOrder() << endl; + else + output_file << "BSPLINE_ORDER_J= " << FFDBox[iFFDBox]->BlendingFunction[1]->GetOrder() << endl; if (nDim == 3) output_file << "BSPLINE_ORDER_K= " << FFDBox[iFFDBox]->BlendingFunction[2]->GetOrder() << endl; } if (config[ZONE_0]->GetFFD_Blending() == BEZIER) { @@ -4765,28 +4928,27 @@ void CSurfaceMovement::WriteFFDInfo(CSurfaceMovement** surface_movement, CGeomet output_file << FFDBox[iFFDBox]->GetChildFFDBoxTag(iChildFFDBox) << endl; if (nDim == 2) { - output_file << "FFD_CORNER_POINTS= " << FFDBox[iFFDBox]->GetnCornerPoints()/SU2_TYPE::Int(2) << endl; + output_file << "FFD_CORNER_POINTS= " << FFDBox[iFFDBox]->GetnCornerPoints() / SU2_TYPE::Int(2) << endl; if (polar) { coord = FFDBox[iFFDBox]->GetCoordCornerPoints(4); - output_file << coord[0] << "\t" << sqrt(coord[1]*coord[1]+coord[2]*coord[2]) << endl; + output_file << coord[0] << "\t" << sqrt(coord[1] * coord[1] + coord[2] * coord[2]) << endl; coord = FFDBox[iFFDBox]->GetCoordCornerPoints(0); - output_file << coord[0] << "\t" << sqrt(coord[1]*coord[1]+coord[2]*coord[2]) << endl; + output_file << coord[0] << "\t" << sqrt(coord[1] * coord[1] + coord[2] * coord[2]) << endl; coord = FFDBox[iFFDBox]->GetCoordCornerPoints(1); - output_file << coord[0] << "\t" << sqrt(coord[1]*coord[1]+coord[2]*coord[2]) << endl; + output_file << coord[0] << "\t" << sqrt(coord[1] * coord[1] + coord[2] * coord[2]) << endl; coord = FFDBox[iFFDBox]->GetCoordCornerPoints(5); - output_file << coord[0] << "\t" << sqrt(coord[1]*coord[1]+coord[2]*coord[2]) << endl; - } - else { - for (iCornerPoints = 0; iCornerPoints < FFDBox[iFFDBox]->GetnCornerPoints()/SU2_TYPE::Int(2); iCornerPoints++) { + output_file << coord[0] << "\t" << sqrt(coord[1] * coord[1] + coord[2] * coord[2]) << endl; + } else { + for (iCornerPoints = 0; iCornerPoints < FFDBox[iFFDBox]->GetnCornerPoints() / SU2_TYPE::Int(2); + iCornerPoints++) { coord = FFDBox[iFFDBox]->GetCoordCornerPoints(iCornerPoints); output_file << coord[0] << "\t" << coord[1] << endl; } } - } - else { + } else { output_file << "FFD_CORNER_POINTS= " << FFDBox[iFFDBox]->GetnCornerPoints() << endl; for (iCornerPoints = 0; iCornerPoints < FFDBox[iFFDBox]->GetnCornerPoints(); iCornerPoints++) { coord = FFDBox[iFFDBox]->GetCoordCornerPoints(iCornerPoints); @@ -4798,14 +4960,14 @@ void CSurfaceMovement::WriteFFDInfo(CSurfaceMovement** surface_movement, CGeomet if (FFDBox[iFFDBox]->GetnControlPoints() == 0) { output_file << "FFD_CONTROL_POINTS= 0" << endl; - } - else { + } else { output_file << "FFD_CONTROL_POINTS= " << FFDBox[iFFDBox]->GetnControlPoints() << endl; for (iOrder = 0; iOrder < FFDBox[iFFDBox]->GetlOrder(); iOrder++) for (jOrder = 0; jOrder < FFDBox[iFFDBox]->GetmOrder(); jOrder++) for (kOrder = 0; kOrder < FFDBox[iFFDBox]->GetnOrder(); kOrder++) { coord = FFDBox[iFFDBox]->GetCoordControlPoints(iOrder, jOrder, kOrder); - output_file << iOrder << "\t" << jOrder << "\t" << kOrder << "\t" << coord[0] << "\t" << coord[1] << "\t" << coord[2] << endl; + output_file << iOrder << "\t" << jOrder << "\t" << kOrder << "\t" << coord[0] << "\t" << coord[1] << "\t" + << coord[2] << endl; } } @@ -4813,39 +4975,33 @@ void CSurfaceMovement::WriteFFDInfo(CSurfaceMovement** surface_movement, CGeomet if (FFDBox[iFFDBox]->GetnControlPoints() == 0) { output_file << "FFD_SURFACE_POINTS= 0" << endl; - } - else { + } else { output_file << "FFD_SURFACE_POINTS= " << GlobalTag[iFFDBox].size() << endl; for (iSurfacePoints = 0; iSurfacePoints < GlobalTag[iFFDBox].size(); iSurfacePoints++) { - output_file << scientific << GlobalTag[iFFDBox][iSurfacePoints] << "\t" << GlobalPoint[iFFDBox][iSurfacePoints] - << "\t" << GlobalCoordX[iFFDBox][iSurfacePoints] << "\t" << GlobalCoordY[iFFDBox][iSurfacePoints] - << "\t" << GlobalCoordZ[iFFDBox][iSurfacePoints] << endl; + output_file << scientific << GlobalTag[iFFDBox][iSurfacePoints] << "\t" + << GlobalPoint[iFFDBox][iSurfacePoints] << "\t" << GlobalCoordX[iFFDBox][iSurfacePoints] << "\t" + << GlobalCoordY[iFFDBox][iSurfacePoints] << "\t" << GlobalCoordZ[iFFDBox][iSurfacePoints] << endl; } - } - } output_file.close(); - } } -unsigned long CSurfaceMovement::calculateJacobianDeterminant(CGeometry *geometry, CConfig *config, CFreeFormDefBox *FFDBox) const { - +unsigned long CSurfaceMovement::calculateJacobianDeterminant(CGeometry* geometry, CConfig* config, + CFreeFormDefBox* FFDBox) const { unsigned long iSurfacePoints; unsigned short iMarker; unsigned long negative_determinants = 0; /*--- Loop over the surface points ---*/ for (iSurfacePoints = 0; iSurfacePoints < FFDBox->GetnSurfacePoint(); iSurfacePoints++) { - /*--- Get the marker of the surface point ---*/ iMarker = FFDBox->Get_MarkerIndex(iSurfacePoints); if (config->GetMarker_All_DV(iMarker) == YES) { - const auto ParamCoord = FFDBox->Get_ParametricCoord(iSurfacePoints); /*--- Calculate partial derivatives ---*/ @@ -4853,32 +5009,33 @@ unsigned long CSurfaceMovement::calculateJacobianDeterminant(CGeometry *geometry su2double Ba, Bb, Bc, Ba_der, Bb_der, Bc_der; su2double determinant, d_du[3] = {0.0}, d_dv[3] = {0.0}, d_dw[3] = {0.0}; - for (iDegree = 0; iDegree <= FFDBox->lDegree; iDegree++){ + for (iDegree = 0; iDegree <= FFDBox->lDegree; iDegree++) { Ba = FFDBox->BlendingFunction[0]->GetBasis(iDegree, ParamCoord[0]); Ba_der = FFDBox->BlendingFunction[0]->GetDerivative(iDegree, ParamCoord[0], 1); - for (jDegree = 0; jDegree <= FFDBox->mDegree; jDegree++){ + for (jDegree = 0; jDegree <= FFDBox->mDegree; jDegree++) { Bb = FFDBox->BlendingFunction[1]->GetBasis(jDegree, ParamCoord[1]); Bb_der = FFDBox->BlendingFunction[1]->GetDerivative(jDegree, ParamCoord[1], 1); - for (kDegree = 0; kDegree <= FFDBox->nDegree; kDegree++){ - + for (kDegree = 0; kDegree <= FFDBox->nDegree; kDegree++) { Bc = FFDBox->BlendingFunction[2]->GetBasis(kDegree, ParamCoord[2]); Bc_der = FFDBox->BlendingFunction[2]->GetDerivative(kDegree, ParamCoord[2], 1); - for (int i=0; i<3; ++i) { - d_du[i] += Ba_der*Bb*Bc*FFDBox->Coord_Control_Points[iDegree][jDegree][kDegree][i]; - d_dv[i] += Ba*Bb_der*Bc*FFDBox->Coord_Control_Points[iDegree][jDegree][kDegree][i]; - d_dw[i] += Ba*Bb*Bc_der*FFDBox->Coord_Control_Points[iDegree][jDegree][kDegree][i]; + for (int i = 0; i < 3; ++i) { + d_du[i] += Ba_der * Bb * Bc * FFDBox->Coord_Control_Points[iDegree][jDegree][kDegree][i]; + d_dv[i] += Ba * Bb_der * Bc * FFDBox->Coord_Control_Points[iDegree][jDegree][kDegree][i]; + d_dw[i] += Ba * Bb * Bc_der * FFDBox->Coord_Control_Points[iDegree][jDegree][kDegree][i]; } } } } /*--- Calculate determinant ---*/ - determinant = d_du[0]*(d_dv[1]*d_dw[2] - d_dv[2]*d_dw[1]) - d_dv[0]*(d_du[1]*d_dw[2] - d_du[2]*d_dw[1]) + d_dw[0]*(d_du[1]*d_dv[2] - d_du[2]*d_dv[1]); + determinant = d_du[0] * (d_dv[1] * d_dw[2] - d_dv[2] * d_dw[1]) - + d_dv[0] * (d_du[1] * d_dw[2] - d_du[2] * d_dw[1]) + + d_dw[0] * (d_du[1] * d_dv[2] - d_du[2] * d_dv[1]); - if (determinant < 0){ + if (determinant < 0) { negative_determinants++; } } diff --git a/Common/src/grid_movement/CVolumetricMovement.cpp b/Common/src/grid_movement/CVolumetricMovement.cpp index ef7e3d423af..89199a0650b 100644 --- a/Common/src/grid_movement/CVolumetricMovement.cpp +++ b/Common/src/grid_movement/CVolumetricMovement.cpp @@ -2,7 +2,7 @@ * \file CVolumetricMovement.cpp * \brief Subroutines for moving mesh volume elements * \author F. Palacios, T. Economon, S. Padron - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -25,42 +25,38 @@ * License along with SU2. If not, see . */ - #include "../../include/grid_movement/CVolumetricMovement.hpp" #include "../../include/adt/CADTPointsOnlyClass.hpp" #include "../../include/toolboxes/geometry_toolbox.hpp" -CVolumetricMovement::CVolumetricMovement(void) : CGridMovement(), System(LINEAR_SOLVER_MODE::MESH_DEFORM) { - -} - -CVolumetricMovement::CVolumetricMovement(CGeometry *geometry, CConfig *config) : CGridMovement(), System(LINEAR_SOLVER_MODE::MESH_DEFORM) { +CVolumetricMovement::CVolumetricMovement() : CGridMovement(), System(LINEAR_SOLVER_MODE::MESH_DEFORM) {} +CVolumetricMovement::CVolumetricMovement(CGeometry* geometry, CConfig* config) + : CGridMovement(), System(LINEAR_SOLVER_MODE::MESH_DEFORM) { size = SU2_MPI::GetSize(); rank = SU2_MPI::GetRank(); /*--- Initialize the number of spatial dimensions, length of the state vector (same as spatial dimensions for grid deformation), and grid nodes. ---*/ - nDim = geometry->GetnDim(); - nVar = geometry->GetnDim(); + nDim = geometry->GetnDim(); + nVar = geometry->GetnDim(); nPoint = geometry->GetnPoint(); nPointDomain = geometry->GetnPointDomain(); nIterMesh = 0; /*--- Initialize matrix, solution, and r.h.s. structures for the linear solver. ---*/ - if (config->GetVolumetric_Movement() || config->GetSmoothGradient()){ + if (config->GetVolumetric_Movement() || config->GetSmoothGradient()) { LinSysSol.Initialize(nPoint, nPointDomain, nVar, 0.0); LinSysRes.Initialize(nPoint, nPointDomain, nVar, 0.0); StiffMatrix.Initialize(nPoint, nPointDomain, nVar, nVar, false, geometry, config); } } -CVolumetricMovement::~CVolumetricMovement(void) { } - -void CVolumetricMovement::UpdateGridCoord(CGeometry *geometry, CConfig *config) { +CVolumetricMovement::~CVolumetricMovement() = default; +void CVolumetricMovement::UpdateGridCoord(CGeometry* geometry, CConfig* config) { unsigned short iDim; unsigned long iPoint, total_index; su2double new_coord; @@ -70,9 +66,9 @@ void CVolumetricMovement::UpdateGridCoord(CGeometry *geometry, CConfig *config) for (iPoint = 0; iPoint < nPoint; iPoint++) for (iDim = 0; iDim < nDim; iDim++) { - total_index = iPoint*nDim + iDim; - new_coord = geometry->nodes->GetCoord(iPoint, iDim)+LinSysSol[total_index]; - if (fabs(new_coord) < EPS*EPS) new_coord = 0.0; + total_index = iPoint * nDim + iDim; + new_coord = geometry->nodes->GetCoord(iPoint, iDim) + LinSysSol[total_index]; + if (fabs(new_coord) < EPS * EPS) new_coord = 0.0; geometry->nodes->SetCoord(iPoint, iDim, new_coord); } @@ -82,52 +78,46 @@ void CVolumetricMovement::UpdateGridCoord(CGeometry *geometry, CConfig *config) geometry->InitiateComms(geometry, config, COORDINATES); geometry->CompleteComms(geometry, config, COORDINATES); - } -void CVolumetricMovement::UpdateDualGrid(CGeometry *geometry, CConfig *config) { - +void CVolumetricMovement::UpdateDualGrid(CGeometry* geometry, CConfig* config) { /*--- After moving all nodes, update the dual mesh. Recompute the edges and dual mesh control volumes in the domain and on the boundaries. ---*/ geometry->SetControlVolume(config, UPDATE); geometry->SetBoundControlVolume(config, UPDATE); geometry->SetMaxLength(config); - } -void CVolumetricMovement::UpdateMultiGrid(CGeometry **geometry, CConfig *config) { - +void CVolumetricMovement::UpdateMultiGrid(CGeometry** geometry, CConfig* config) { unsigned short iMGfine, iMGlevel, nMGlevel = config->GetnMGLevels(); /*--- Update the multigrid structure after moving the finest grid, including computing the grid velocities on the coarser levels. ---*/ for (iMGlevel = 1; iMGlevel <= nMGlevel; iMGlevel++) { - iMGfine = iMGlevel-1; + iMGfine = iMGlevel - 1; geometry[iMGlevel]->SetControlVolume(geometry[iMGfine], UPDATE); - geometry[iMGlevel]->SetBoundControlVolume(geometry[iMGfine],UPDATE); + geometry[iMGlevel]->SetBoundControlVolume(geometry[iMGfine], UPDATE); geometry[iMGlevel]->SetCoord(geometry[iMGfine]); - if (config->GetGrid_Movement()) - geometry[iMGlevel]->SetRestricted_GridVelocity(geometry[iMGfine]); + if (config->GetGrid_Movement()) geometry[iMGlevel]->SetRestricted_GridVelocity(geometry[iMGfine]); } - } -void CVolumetricMovement::SetVolume_Deformation(CGeometry *geometry, CConfig *config, bool UpdateGeo, bool Derivative, bool ForwardProjectionDerivative) { - +void CVolumetricMovement::SetVolume_Deformation(CGeometry* geometry, CConfig* config, bool UpdateGeo, bool Derivative, + bool ForwardProjectionDerivative) { unsigned long Tot_Iter = 0; su2double MinVolume, MaxVolume; /*--- Retrieve number or iterations, tol, output, etc. from config ---*/ - auto Screen_Output = config->GetDeform_Output(); + auto Screen_Output = config->GetDeform_Output(); auto Nonlinear_Iter = config->GetGridDef_Nonlinear_Iter(); /*--- Disable the screen output if we're running SU2_CFD ---*/ if (config->GetKind_SU2() == SU2_COMPONENT::SU2_CFD && !Derivative) Screen_Output = false; - if (config->GetSmoothGradient()) Screen_Output=true; + if (config->GetSmoothGradient()) Screen_Output = true; /*--- Set the number of nonlinear iterations to 1 if Derivative computation is enabled ---*/ @@ -138,7 +128,6 @@ void CVolumetricMovement::SetVolume_Deformation(CGeometry *geometry, CConfig *co particular, the linear elasticity equations hold only for small deformations. ---*/ for (auto iNonlinear_Iter = 0ul; iNonlinear_Iter < Nonlinear_Iter; iNonlinear_Iter++) { - /*--- Initialize vector and sparse matrix ---*/ LinSysSol.SetValZero(); @@ -163,7 +152,9 @@ void CVolumetricMovement::SetVolume_Deformation(CGeometry *geometry, CConfig *co /*--- Set the boundary derivatives (overrides the actual displacements) ---*/ - if (Derivative) { SetBoundaryDerivatives(geometry, config, ForwardProjectionDerivative); } + if (Derivative) { + SetBoundaryDerivatives(geometry, config, ForwardProjectionDerivative); + } /*--- Communicate any prescribed boundary displacements via MPI, so that all nodes have the same solution and r.h.s. entries @@ -183,12 +174,11 @@ void CVolumetricMovement::SetVolume_Deformation(CGeometry *geometry, CConfig *co /*--- If we want no derivatives or the direct derivatives, we solve the system using the * normal matrix vector product and preconditioner. For the mesh sensitivities using * the discrete adjoint method we solve the system using the transposed matrix. ---*/ - if (!Derivative || ((config->GetKind_SU2() == SU2_COMPONENT::SU2_CFD) && Derivative) || (config->GetSmoothGradient() && ForwardProjectionDerivative)) { - + if (!Derivative || ((config->GetKind_SU2() == SU2_COMPONENT::SU2_CFD) && Derivative) || + (config->GetSmoothGradient() && ForwardProjectionDerivative)) { Tot_Iter = System.Solve(StiffMatrix, LinSysRes, LinSysSol, geometry, config); } else if (Derivative && (config->GetKind_SU2() == SU2_COMPONENT::SU2_DOT)) { - Tot_Iter = System.Solve_b(StiffMatrix, LinSysRes, LinSysSol, geometry, config); } su2double Residual = System.GetResidual(); @@ -196,9 +186,14 @@ void CVolumetricMovement::SetVolume_Deformation(CGeometry *geometry, CConfig *co /*--- Update the grid coordinates and cell volumes using the solution of the linear system (usol contains the x, y, z displacements). ---*/ - if (!Derivative) { UpdateGridCoord(geometry, config); } - else { UpdateGridCoord_Derivatives(geometry, config, ForwardProjectionDerivative); } - if (UpdateGeo) { UpdateDualGrid(geometry, config); } + if (!Derivative) { + UpdateGridCoord(geometry, config); + } else { + UpdateGridCoord_Derivatives(geometry, config, ForwardProjectionDerivative); + } + if (UpdateGeo) { + UpdateDualGrid(geometry, config); + } if (!Derivative) { /*--- Check for failed deformation (negative volumes). ---*/ @@ -215,37 +210,37 @@ void CVolumetricMovement::SetVolume_Deformation(CGeometry *geometry, CConfig *co Set_nIterMesh(Tot_Iter); if (rank == MASTER_NODE && Screen_Output) { - cout << "Non-linear iter.: " << iNonlinear_Iter+1 << "/" << Nonlinear_Iter << ". Linear iter.: " << Tot_Iter << ". "; - if (nDim == 2) cout << "Min. area: " << MinVolume << ". Error: " << Residual << "." << endl; - else cout << "Min. volume: " << MinVolume << ". Error: " << Residual << "." << endl; + cout << "Non-linear iter.: " << iNonlinear_Iter + 1 << "/" << Nonlinear_Iter << ". Linear iter.: " << Tot_Iter + << ". "; + if (nDim == 2) + cout << "Min. area: " << MinVolume << ". Error: " << Residual << "." << endl; + else + cout << "Min. volume: " << MinVolume << ". Error: " << Residual << "." << endl; } - } - } -void CVolumetricMovement::ComputeDeforming_Element_Volume(CGeometry *geometry, su2double &MinVolume, su2double &MaxVolume, bool Screen_Output) { - +void CVolumetricMovement::ComputeDeforming_Element_Volume(CGeometry* geometry, su2double& MinVolume, + su2double& MaxVolume, bool Screen_Output) { unsigned long iElem, ElemCounter = 0, PointCorners[8]; su2double Volume = 0.0, CoordCorners[8][3]; unsigned short nNodes = 0, iNodes, iDim; bool RightVol = true; - if (rank == MASTER_NODE && Screen_Output) - cout << "Computing volumes of the grid elements." << endl; + if (rank == MASTER_NODE && Screen_Output) cout << "Computing volumes of the grid elements." << endl; - MaxVolume = -1E22; MinVolume = 1E22; + MaxVolume = -1E22; + MinVolume = 1E22; /*--- Load up each triangle and tetrahedron to check for negative volumes. ---*/ for (iElem = 0; iElem < geometry->GetnElem(); iElem++) { - - if (geometry->elem[iElem]->GetVTK_Type() == TRIANGLE) nNodes = 3; - if (geometry->elem[iElem]->GetVTK_Type() == QUADRILATERAL) nNodes = 4; - if (geometry->elem[iElem]->GetVTK_Type() == TETRAHEDRON) nNodes = 4; - if (geometry->elem[iElem]->GetVTK_Type() == PYRAMID) nNodes = 5; - if (geometry->elem[iElem]->GetVTK_Type() == PRISM) nNodes = 6; - if (geometry->elem[iElem]->GetVTK_Type() == HEXAHEDRON) nNodes = 8; + if (geometry->elem[iElem]->GetVTK_Type() == TRIANGLE) nNodes = 3; + if (geometry->elem[iElem]->GetVTK_Type() == QUADRILATERAL) nNodes = 4; + if (geometry->elem[iElem]->GetVTK_Type() == TETRAHEDRON) nNodes = 4; + if (geometry->elem[iElem]->GetVTK_Type() == PYRAMID) nNodes = 5; + if (geometry->elem[iElem]->GetVTK_Type() == PRISM) nNodes = 6; + if (geometry->elem[iElem]->GetVTK_Type() == HEXAHEDRON) nNodes = 8; for (iNodes = 0; iNodes < nNodes; iNodes++) { PointCorners[iNodes] = geometry->elem[iElem]->GetNode(iNodes); @@ -278,13 +273,15 @@ void CVolumetricMovement::ComputeDeforming_Element_Volume(CGeometry *geometry, s geometry->elem[iElem]->SetVolume(Volume); if (!RightVol) ElemCounter++; - } #ifdef HAVE_MPI - unsigned long ElemCounter_Local = ElemCounter; ElemCounter = 0; - su2double MaxVolume_Local = MaxVolume; MaxVolume = 0.0; - su2double MinVolume_Local = MinVolume; MinVolume = 0.0; + unsigned long ElemCounter_Local = ElemCounter; + ElemCounter = 0; + su2double MaxVolume_Local = MaxVolume; + MaxVolume = 0.0; + su2double MinVolume_Local = MinVolume; + MinVolume = 0.0; SU2_MPI::Allreduce(&ElemCounter_Local, &ElemCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&MaxVolume_Local, &MaxVolume, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&MinVolume_Local, &MinVolume, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); @@ -293,22 +290,21 @@ void CVolumetricMovement::ComputeDeforming_Element_Volume(CGeometry *geometry, s /*--- Volume from 0 to 1 ---*/ for (iElem = 0; iElem < geometry->GetnElem(); iElem++) { - Volume = geometry->elem[iElem]->GetVolume()/MaxVolume; + Volume = geometry->elem[iElem]->GetVolume() / MaxVolume; geometry->elem[iElem]->SetVolume(Volume); } if ((ElemCounter != 0) && (rank == MASTER_NODE) && (Screen_Output)) - cout <<"There are " << ElemCounter << " elements with negative volume.\n" << endl; - + cout << "There are " << ElemCounter << " elements with negative volume.\n" << endl; } -void CVolumetricMovement::ComputenNonconvexElements(CGeometry *geometry, bool Screen_Output) { +void CVolumetricMovement::ComputenNonconvexElements(CGeometry* geometry, bool Screen_Output) { unsigned long iElem; unsigned short iDim; unsigned long nNonconvexElements = 0; /*--- Load up each tetrahedron to check for convex properties. ---*/ - if (nDim == 2){ + if (nDim == 2) { for (iElem = 0; iElem < geometry->GetnElem(); iElem++) { su2double minCrossProduct = 1.e6, maxCrossProduct = -1.e6; @@ -325,35 +321,34 @@ void CVolumetricMovement::ComputenNonconvexElements(CGeometry *geometry, bool Sc } /*--- Determine whether element is convex ---*/ - for (iNodes = 0; iNodes < nNodes; iNodes ++) { - + for (iNodes = 0; iNodes < nNodes; iNodes++) { /*--- Calculate minimum and maximum angle between edge vectors adjacent to each node ---*/ su2double edgeVector_i[3], edgeVector_j[3]; - for (iDim = 0; iDim < nDim; iDim ++) { + for (iDim = 0; iDim < nDim; iDim++) { if (iNodes == 0) { - edgeVector_i[iDim] = CoordCorners[nNodes-1][iDim] - CoordCorners[iNodes][iDim]; + edgeVector_i[iDim] = CoordCorners[nNodes - 1][iDim] - CoordCorners[iNodes][iDim]; } else { - edgeVector_i[iDim] = CoordCorners[iNodes-1][iDim] - CoordCorners[iNodes][iDim]; + edgeVector_i[iDim] = CoordCorners[iNodes - 1][iDim] - CoordCorners[iNodes][iDim]; } - if (iNodes == nNodes-1) { + if (iNodes == nNodes - 1) { edgeVector_j[iDim] = CoordCorners[0][iDim] - CoordCorners[iNodes][iDim]; } else { - edgeVector_j[iDim] = CoordCorners[iNodes+1][iDim] - CoordCorners[iNodes][iDim]; + edgeVector_j[iDim] = CoordCorners[iNodes + 1][iDim] - CoordCorners[iNodes][iDim]; } } /*--- Calculate cross product of edge vectors ---*/ su2double crossProduct; - crossProduct = edgeVector_i[1]*edgeVector_j[0] - edgeVector_i[0]*edgeVector_j[1]; + crossProduct = edgeVector_i[1] * edgeVector_j[0] - edgeVector_i[0] * edgeVector_j[1]; if (crossProduct < minCrossProduct) minCrossProduct = crossProduct; if (crossProduct > maxCrossProduct) maxCrossProduct = crossProduct; } /*--- Element is nonconvex if cross product of at least one set of adjacent edges is negative ---*/ - if (minCrossProduct < 0 && maxCrossProduct > 0){ + if (minCrossProduct < 0 && maxCrossProduct > 0) { nNonconvexElements++; } } @@ -361,17 +356,16 @@ void CVolumetricMovement::ComputenNonconvexElements(CGeometry *geometry, bool Sc cout << "\nWARNING: Convexity is not checked for 3D elements (issue #1171).\n" << endl; } - unsigned long nNonconvexElements_Local = nNonconvexElements; nNonconvexElements = 0; + unsigned long nNonconvexElements_Local = nNonconvexElements; + nNonconvexElements = 0; SU2_MPI::Allreduce(&nNonconvexElements_Local, &nNonconvexElements, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); /*--- Set number of nonconvex elements in geometry ---*/ geometry->SetnNonconvexElements(nNonconvexElements); } - - -void CVolumetricMovement::ComputeSolid_Wall_Distance(CGeometry *geometry, CConfig *config, su2double &MinDistance, su2double &MaxDistance) const { - +void CVolumetricMovement::ComputeSolid_Wall_Distance(CGeometry* geometry, CConfig* config, su2double& MinDistance, + su2double& MaxDistance) const { unsigned long nVertex_SolidWall, ii, jj, iVertex, iPoint, pointID; unsigned short iMarker, iDim; su2double dist, MaxDistance_Local, MinDistance_Local; @@ -379,75 +373,69 @@ void CVolumetricMovement::ComputeSolid_Wall_Distance(CGeometry *geometry, CConfi /*--- Initialize min and max distance ---*/ - MaxDistance = -1E22; MinDistance = 1E22; + MaxDistance = -1E22; + MinDistance = 1E22; /*--- Compute the total number of nodes on no-slip boundaries ---*/ nVertex_SolidWall = 0; - for(iMarker=0; iMarkerGetnMarker_All(); ++iMarker) { - if(config->GetSolid_Wall(iMarker)) - nVertex_SolidWall += geometry->GetnVertex(iMarker); + for (iMarker = 0; iMarker < config->GetnMarker_All(); ++iMarker) { + if (config->GetSolid_Wall(iMarker)) nVertex_SolidWall += geometry->GetnVertex(iMarker); } /*--- Allocate the vectors to hold boundary node coordinates and its local ID. ---*/ - vector Coord_bound(nDim*nVertex_SolidWall); + vector Coord_bound(nDim * nVertex_SolidWall); vector PointIDs(nVertex_SolidWall); /*--- Retrieve and store the coordinates of the no-slip boundary nodes and their local point IDs. ---*/ - ii = 0; jj = 0; - for (iMarker=0; iMarkerGetnMarker_All(); ++iMarker) { + ii = 0; + jj = 0; + for (iMarker = 0; iMarker < config->GetnMarker_All(); ++iMarker) { if (config->GetSolid_Wall(iMarker)) { - for (iVertex=0; iVertexGetnVertex(iMarker); ++iVertex) { + for (iVertex = 0; iVertex < geometry->GetnVertex(iMarker); ++iVertex) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); PointIDs[jj++] = iPoint; - for (iDim=0; iDimnodes->GetCoord(iPoint, iDim); + for (iDim = 0; iDim < nDim; ++iDim) Coord_bound[ii++] = geometry->nodes->GetCoord(iPoint, iDim); } } } /*--- Build the ADT of the boundary nodes. ---*/ - CADTPointsOnlyClass WallADT(nDim, nVertex_SolidWall, Coord_bound.data(), - PointIDs.data(), true); + CADTPointsOnlyClass WallADT(nDim, nVertex_SolidWall, Coord_bound.data(), PointIDs.data(), true); /*--- Loop over all interior mesh nodes and compute the distances to each of the no-slip boundary nodes. Store the minimum distance to the wall for each interior mesh node. ---*/ - if( WallADT.IsEmpty() ) { - + if (WallADT.IsEmpty()) { /*--- No solid wall boundary nodes in the entire mesh. Set the wall distance to zero for all nodes. ---*/ - for (iPoint=0; iPointGetnPoint(); ++iPoint) - geometry->nodes->SetWall_Distance(iPoint, 0.0); - } - else { - + for (iPoint = 0; iPoint < geometry->GetnPoint(); ++iPoint) geometry->nodes->SetWall_Distance(iPoint, 0.0); + } else { /*--- Solid wall boundary nodes are present. Compute the wall distance for all nodes. ---*/ - for(iPoint=0; iPointGetnPoint(); ++iPoint) { - - WallADT.DetermineNearestNode(geometry->nodes->GetCoord(iPoint), dist, - pointID, rankID); + for (iPoint = 0; iPoint < geometry->GetnPoint(); ++iPoint) { + WallADT.DetermineNearestNode(geometry->nodes->GetCoord(iPoint), dist, pointID, rankID); geometry->nodes->SetWall_Distance(iPoint, dist); MaxDistance = max(MaxDistance, dist); /*--- To discard points on the surface we use > EPS ---*/ - if (sqrt(dist) > EPS) MinDistance = min(MinDistance, dist); - + if (sqrt(dist) > EPS) MinDistance = min(MinDistance, dist); } - MaxDistance_Local = MaxDistance; MaxDistance = 0.0; - MinDistance_Local = MinDistance; MinDistance = 0.0; + MaxDistance_Local = MaxDistance; + MaxDistance = 0.0; + MinDistance_Local = MinDistance; + MinDistance = 0.0; #ifdef HAVE_MPI SU2_MPI::Allreduce(&MaxDistance_Local, &MaxDistance, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); @@ -456,53 +444,52 @@ void CVolumetricMovement::ComputeSolid_Wall_Distance(CGeometry *geometry, CConfi MaxDistance = MaxDistance_Local; MinDistance = MinDistance_Local; #endif - } - } -su2double CVolumetricMovement::SetFEAMethodContributions_Elem(CGeometry *geometry, CConfig *config) { - +su2double CVolumetricMovement::SetFEAMethodContributions_Elem(CGeometry* geometry, CConfig* config) { unsigned short iVar, iDim, nNodes = 0, iNodes, StiffMatrix_nElem = 0; unsigned long iElem, PointCorners[8]; su2double **StiffMatrix_Elem = nullptr, CoordCorners[8][3]; - su2double MinVolume = 0.0, MaxVolume = 0.0, MinDistance = 0.0, MaxDistance = 0.0, ElemVolume = 0.0, ElemDistance = 0.0; + su2double MinVolume = 0.0, MaxVolume = 0.0, MinDistance = 0.0, MaxDistance = 0.0, ElemVolume = 0.0, + ElemDistance = 0.0; - bool Screen_Output = config->GetDeform_Output(); + bool Screen_Output = config->GetDeform_Output(); /*--- Allocate maximum size (quadrilateral and hexahedron) ---*/ - if (nDim == 2) StiffMatrix_nElem = 8; - else StiffMatrix_nElem = 24; + if (nDim == 2) + StiffMatrix_nElem = 8; + else + StiffMatrix_nElem = 24; - StiffMatrix_Elem = new su2double* [StiffMatrix_nElem]; - for (iVar = 0; iVar < StiffMatrix_nElem; iVar++) - StiffMatrix_Elem[iVar] = new su2double [StiffMatrix_nElem]; + StiffMatrix_Elem = new su2double*[StiffMatrix_nElem]; + for (iVar = 0; iVar < StiffMatrix_nElem; iVar++) StiffMatrix_Elem[iVar] = new su2double[StiffMatrix_nElem]; /*--- Compute min volume in the entire mesh. ---*/ ComputeDeforming_Element_Volume(geometry, MinVolume, MaxVolume, Screen_Output); - if (rank == MASTER_NODE && Screen_Output) cout <<"Min. volume: "<< MinVolume <<", max. volume: "<< MaxVolume <<"." << endl; + if (rank == MASTER_NODE && Screen_Output) + cout << "Min. volume: " << MinVolume << ", max. volume: " << MaxVolume << "." << endl; /*--- Compute the distance to the nearest surface if needed as part of the stiffness calculation.. ---*/ - if ((config->GetDeform_Stiffness_Type() == SOLID_WALL_DISTANCE) || - (config->GetDeform_Limit() < 1E6)) { + if ((config->GetDeform_Stiffness_Type() == SOLID_WALL_DISTANCE) || (config->GetDeform_Limit() < 1E6)) { ComputeSolid_Wall_Distance(geometry, config, MinDistance, MaxDistance); - if (rank == MASTER_NODE && Screen_Output) cout <<"Min. distance: "<< MinDistance <<", max. distance: "<< MaxDistance <<"." << endl; + if (rank == MASTER_NODE && Screen_Output) + cout << "Min. distance: " << MinDistance << ", max. distance: " << MaxDistance << "." << endl; } /*--- Compute contributions from each element by forming the stiffness matrix (FEA) ---*/ for (iElem = 0; iElem < geometry->GetnElem(); iElem++) { - - if (geometry->elem[iElem]->GetVTK_Type() == TRIANGLE) nNodes = 3; + if (geometry->elem[iElem]->GetVTK_Type() == TRIANGLE) nNodes = 3; if (geometry->elem[iElem]->GetVTK_Type() == QUADRILATERAL) nNodes = 4; - if (geometry->elem[iElem]->GetVTK_Type() == TETRAHEDRON) nNodes = 4; - if (geometry->elem[iElem]->GetVTK_Type() == PYRAMID) nNodes = 5; - if (geometry->elem[iElem]->GetVTK_Type() == PRISM) nNodes = 6; - if (geometry->elem[iElem]->GetVTK_Type() == HEXAHEDRON) nNodes = 8; + if (geometry->elem[iElem]->GetVTK_Type() == TETRAHEDRON) nNodes = 4; + if (geometry->elem[iElem]->GetVTK_Type() == PYRAMID) nNodes = 5; + if (geometry->elem[iElem]->GetVTK_Type() == PRISM) nNodes = 6; + if (geometry->elem[iElem]->GetVTK_Type() == HEXAHEDRON) nNodes = 8; for (iNodes = 0; iNodes < nNodes; iNodes++) { PointCorners[iNodes] = geometry->elem[iElem]->GetNode(iNodes); @@ -519,28 +506,29 @@ su2double CVolumetricMovement::SetFEAMethodContributions_Elem(CGeometry *geometr ElemDistance = 0.0; for (iNodes = 0; iNodes < nNodes; iNodes++) ElemDistance += geometry->nodes->GetWall_Distance(PointCorners[iNodes]); - ElemDistance = ElemDistance/(su2double)nNodes; + ElemDistance = ElemDistance / (su2double)nNodes; } - if (nDim == 2) SetFEA_StiffMatrix2D(geometry, config, StiffMatrix_Elem, PointCorners, CoordCorners, nNodes, ElemVolume, ElemDistance); - if (nDim == 3) SetFEA_StiffMatrix3D(geometry, config, StiffMatrix_Elem, PointCorners, CoordCorners, nNodes, ElemVolume, ElemDistance); + if (nDim == 2) + SetFEA_StiffMatrix2D(geometry, config, StiffMatrix_Elem, PointCorners, CoordCorners, nNodes, ElemVolume, + ElemDistance); + if (nDim == 3) + SetFEA_StiffMatrix3D(geometry, config, StiffMatrix_Elem, PointCorners, CoordCorners, nNodes, ElemVolume, + ElemDistance); AddFEA_StiffMatrix(geometry, StiffMatrix_Elem, PointCorners, nNodes); - } /*--- Deallocate memory and exit ---*/ - for (iVar = 0; iVar < StiffMatrix_nElem; iVar++) - delete [] StiffMatrix_Elem[iVar]; - delete [] StiffMatrix_Elem; + for (iVar = 0; iVar < StiffMatrix_nElem; iVar++) delete[] StiffMatrix_Elem[iVar]; + delete[] StiffMatrix_Elem; return MinVolume; - } -su2double CVolumetricMovement::ShapeFunc_Triangle(su2double Xi, su2double Eta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]) { - +su2double CVolumetricMovement::ShapeFunc_Triangle(su2double Xi, su2double Eta, su2double CoordCorners[8][3], + su2double DShapeFunction[8][4]) { int i, j, k; su2double c0, c1, xsj; su2double xs[3][3], ad[3][3]; @@ -549,13 +537,16 @@ su2double CVolumetricMovement::ShapeFunc_Triangle(su2double Xi, su2double Eta, s DShapeFunction[0][3] = Xi; DShapeFunction[1][3] = Eta; - DShapeFunction[2][3] = 1-Xi-Eta; + DShapeFunction[2][3] = 1 - Xi - Eta; /*--- dN/d xi, dN/d eta ---*/ - DShapeFunction[0][0] = 1.0; DShapeFunction[0][1] = 0.0; - DShapeFunction[1][0] = 0.0; DShapeFunction[1][1] = 1.0; - DShapeFunction[2][0] = -1.0; DShapeFunction[2][1] = -1.0; + DShapeFunction[0][0] = 1.0; + DShapeFunction[0][1] = 0.0; + DShapeFunction[1][0] = 0.0; + DShapeFunction[1][1] = 1.0; + DShapeFunction[2][0] = -1.0; + DShapeFunction[2][1] = -1.0; /*--- Jacobian transformation ---*/ @@ -563,7 +554,7 @@ su2double CVolumetricMovement::ShapeFunc_Triangle(su2double Xi, su2double Eta, s for (j = 0; j < 2; j++) { xs[i][j] = 0.0; for (k = 0; k < 3; k++) { - xs[i][j] = xs[i][j]+CoordCorners[k][j]*DShapeFunction[k][i]; + xs[i][j] = xs[i][j] + CoordCorners[k][j] * DShapeFunction[k][i]; } } } @@ -577,48 +568,51 @@ su2double CVolumetricMovement::ShapeFunc_Triangle(su2double Xi, su2double Eta, s /*--- Determinant of Jacobian ---*/ - xsj = ad[0][0]*ad[1][1]-ad[0][1]*ad[1][0]; + xsj = ad[0][0] * ad[1][1] - ad[0][1] * ad[1][0]; /*--- Jacobian inverse ---*/ for (i = 0; i < 2; i++) { for (j = 0; j < 2; j++) { - xs[i][j] = ad[i][j]/xsj; + xs[i][j] = ad[i][j] / xsj; } } /*--- Derivatives with repect to global coordinates ---*/ for (k = 0; k < 3; k++) { - c0 = xs[0][0]*DShapeFunction[k][0]+xs[0][1]*DShapeFunction[k][1]; // dN/dx - c1 = xs[1][0]*DShapeFunction[k][0]+xs[1][1]*DShapeFunction[k][1]; // dN/dy - DShapeFunction[k][0] = c0; // store dN/dx instead of dN/d xi - DShapeFunction[k][1] = c1; // store dN/dy instead of dN/d eta + c0 = xs[0][0] * DShapeFunction[k][0] + xs[0][1] * DShapeFunction[k][1]; // dN/dx + c1 = xs[1][0] * DShapeFunction[k][0] + xs[1][1] * DShapeFunction[k][1]; // dN/dy + DShapeFunction[k][0] = c0; // store dN/dx instead of dN/d xi + DShapeFunction[k][1] = c1; // store dN/dy instead of dN/d eta } return xsj; - } -su2double CVolumetricMovement::ShapeFunc_Quadrilateral(su2double Xi, su2double Eta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]) { - +su2double CVolumetricMovement::ShapeFunc_Quadrilateral(su2double Xi, su2double Eta, su2double CoordCorners[8][3], + su2double DShapeFunction[8][4]) { int i, j, k; su2double c0, c1, xsj; su2double xs[3][3], ad[3][3]; /*--- Shape functions ---*/ - DShapeFunction[0][3] = 0.25*(1.0-Xi)*(1.0-Eta); - DShapeFunction[1][3] = 0.25*(1.0+Xi)*(1.0-Eta); - DShapeFunction[2][3] = 0.25*(1.0+Xi)*(1.0+Eta); - DShapeFunction[3][3] = 0.25*(1.0-Xi)*(1.0+Eta); + DShapeFunction[0][3] = 0.25 * (1.0 - Xi) * (1.0 - Eta); + DShapeFunction[1][3] = 0.25 * (1.0 + Xi) * (1.0 - Eta); + DShapeFunction[2][3] = 0.25 * (1.0 + Xi) * (1.0 + Eta); + DShapeFunction[3][3] = 0.25 * (1.0 - Xi) * (1.0 + Eta); /*--- dN/d xi, dN/d eta ---*/ - DShapeFunction[0][0] = -0.25*(1.0-Eta); DShapeFunction[0][1] = -0.25*(1.0-Xi); - DShapeFunction[1][0] = 0.25*(1.0-Eta); DShapeFunction[1][1] = -0.25*(1.0+Xi); - DShapeFunction[2][0] = 0.25*(1.0+Eta); DShapeFunction[2][1] = 0.25*(1.0+Xi); - DShapeFunction[3][0] = -0.25*(1.0+Eta); DShapeFunction[3][1] = 0.25*(1.0-Xi); + DShapeFunction[0][0] = -0.25 * (1.0 - Eta); + DShapeFunction[0][1] = -0.25 * (1.0 - Xi); + DShapeFunction[1][0] = 0.25 * (1.0 - Eta); + DShapeFunction[1][1] = -0.25 * (1.0 + Xi); + DShapeFunction[2][0] = 0.25 * (1.0 + Eta); + DShapeFunction[2][1] = 0.25 * (1.0 + Xi); + DShapeFunction[3][0] = -0.25 * (1.0 + Eta); + DShapeFunction[3][1] = 0.25 * (1.0 - Xi); /*--- Jacobian transformation ---*/ @@ -626,7 +620,7 @@ su2double CVolumetricMovement::ShapeFunc_Quadrilateral(su2double Xi, su2double E for (j = 0; j < 2; j++) { xs[i][j] = 0.0; for (k = 0; k < 4; k++) { - xs[i][j] = xs[i][j]+CoordCorners[k][j]*DShapeFunction[k][i]; + xs[i][j] = xs[i][j] + CoordCorners[k][j] * DShapeFunction[k][i]; } } } @@ -640,31 +634,30 @@ su2double CVolumetricMovement::ShapeFunc_Quadrilateral(su2double Xi, su2double E /*--- Determinant of Jacobian ---*/ - xsj = ad[0][0]*ad[1][1]-ad[0][1]*ad[1][0]; + xsj = ad[0][0] * ad[1][1] - ad[0][1] * ad[1][0]; /*--- Jacobian inverse ---*/ for (i = 0; i < 2; i++) { for (j = 0; j < 2; j++) { - xs[i][j] = ad[i][j]/xsj; + xs[i][j] = ad[i][j] / xsj; } } /*--- Derivatives with repect to global coordinates ---*/ for (k = 0; k < 4; k++) { - c0 = xs[0][0]*DShapeFunction[k][0]+xs[0][1]*DShapeFunction[k][1]; // dN/dx - c1 = xs[1][0]*DShapeFunction[k][0]+xs[1][1]*DShapeFunction[k][1]; // dN/dy - DShapeFunction[k][0] = c0; // store dN/dx instead of dN/d xi - DShapeFunction[k][1] = c1; // store dN/dy instead of dN/d eta + c0 = xs[0][0] * DShapeFunction[k][0] + xs[0][1] * DShapeFunction[k][1]; // dN/dx + c1 = xs[1][0] * DShapeFunction[k][0] + xs[1][1] * DShapeFunction[k][1]; // dN/dy + DShapeFunction[k][0] = c0; // store dN/dx instead of dN/d xi + DShapeFunction[k][1] = c1; // store dN/dy instead of dN/d eta } return xsj; - } -su2double CVolumetricMovement::ShapeFunc_Tetra(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]) { - +su2double CVolumetricMovement::ShapeFunc_Tetra(su2double Xi, su2double Eta, su2double Zeta, + su2double CoordCorners[8][3], su2double DShapeFunction[8][4]) { int i, j, k; su2double c0, c1, c2, xsj; su2double xs[3][3], ad[3][3]; @@ -678,10 +671,18 @@ su2double CVolumetricMovement::ShapeFunc_Tetra(su2double Xi, su2double Eta, su2d /*--- dN/d xi, dN/d eta, dN/d zeta ---*/ - DShapeFunction[0][0] = 1.0; DShapeFunction[0][1] = 0.0; DShapeFunction[0][2] = 0.0; - DShapeFunction[1][0] = 0.0; DShapeFunction[1][1] = 0.0; DShapeFunction[1][2] = 1.0; - DShapeFunction[2][0] = -1.0; DShapeFunction[2][1] = -1.0; DShapeFunction[2][2] = -1.0; - DShapeFunction[3][0] = 0.0; DShapeFunction[3][1] = 1.0; DShapeFunction[3][2] = 0.0; + DShapeFunction[0][0] = 1.0; + DShapeFunction[0][1] = 0.0; + DShapeFunction[0][2] = 0.0; + DShapeFunction[1][0] = 0.0; + DShapeFunction[1][1] = 0.0; + DShapeFunction[1][2] = 1.0; + DShapeFunction[2][0] = -1.0; + DShapeFunction[2][1] = -1.0; + DShapeFunction[2][2] = -1.0; + DShapeFunction[3][0] = 0.0; + DShapeFunction[3][1] = 1.0; + DShapeFunction[3][2] = 0.0; /*--- Jacobian transformation ---*/ @@ -689,84 +690,83 @@ su2double CVolumetricMovement::ShapeFunc_Tetra(su2double Xi, su2double Eta, su2d for (j = 0; j < 3; j++) { xs[i][j] = 0.0; for (k = 0; k < 4; k++) { - xs[i][j] = xs[i][j]+CoordCorners[k][j]*DShapeFunction[k][i]; + xs[i][j] = xs[i][j] + CoordCorners[k][j] * DShapeFunction[k][i]; } } } /*--- Adjoint to Jacobian ---*/ - ad[0][0] = xs[1][1]*xs[2][2]-xs[1][2]*xs[2][1]; - ad[0][1] = xs[0][2]*xs[2][1]-xs[0][1]*xs[2][2]; - ad[0][2] = xs[0][1]*xs[1][2]-xs[0][2]*xs[1][1]; - ad[1][0] = xs[1][2]*xs[2][0]-xs[1][0]*xs[2][2]; - ad[1][1] = xs[0][0]*xs[2][2]-xs[0][2]*xs[2][0]; - ad[1][2] = xs[0][2]*xs[1][0]-xs[0][0]*xs[1][2]; - ad[2][0] = xs[1][0]*xs[2][1]-xs[1][1]*xs[2][0]; - ad[2][1] = xs[0][1]*xs[2][0]-xs[0][0]*xs[2][1]; - ad[2][2] = xs[0][0]*xs[1][1]-xs[0][1]*xs[1][0]; + ad[0][0] = xs[1][1] * xs[2][2] - xs[1][2] * xs[2][1]; + ad[0][1] = xs[0][2] * xs[2][1] - xs[0][1] * xs[2][2]; + ad[0][2] = xs[0][1] * xs[1][2] - xs[0][2] * xs[1][1]; + ad[1][0] = xs[1][2] * xs[2][0] - xs[1][0] * xs[2][2]; + ad[1][1] = xs[0][0] * xs[2][2] - xs[0][2] * xs[2][0]; + ad[1][2] = xs[0][2] * xs[1][0] - xs[0][0] * xs[1][2]; + ad[2][0] = xs[1][0] * xs[2][1] - xs[1][1] * xs[2][0]; + ad[2][1] = xs[0][1] * xs[2][0] - xs[0][0] * xs[2][1]; + ad[2][2] = xs[0][0] * xs[1][1] - xs[0][1] * xs[1][0]; /*--- Determinant of Jacobian ---*/ - xsj = xs[0][0]*ad[0][0]+xs[0][1]*ad[1][0]+xs[0][2]*ad[2][0]; + xsj = xs[0][0] * ad[0][0] + xs[0][1] * ad[1][0] + xs[0][2] * ad[2][0]; /*--- Jacobian inverse ---*/ for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) { - xs[i][j] = ad[i][j]/xsj; + xs[i][j] = ad[i][j] / xsj; } } /*--- Derivatives with repect to global coordinates ---*/ for (k = 0; k < 4; k++) { - c0 = xs[0][0]*DShapeFunction[k][0]+xs[0][1]*DShapeFunction[k][1]+xs[0][2]*DShapeFunction[k][2]; // dN/dx - c1 = xs[1][0]*DShapeFunction[k][0]+xs[1][1]*DShapeFunction[k][1]+xs[1][2]*DShapeFunction[k][2]; // dN/dy - c2 = xs[2][0]*DShapeFunction[k][0]+xs[2][1]*DShapeFunction[k][1]+xs[2][2]*DShapeFunction[k][2]; // dN/dz - DShapeFunction[k][0] = c0; // store dN/dx instead of dN/d xi - DShapeFunction[k][1] = c1; // store dN/dy instead of dN/d eta - DShapeFunction[k][2] = c2; // store dN/dz instead of dN/d zeta + c0 = xs[0][0] * DShapeFunction[k][0] + xs[0][1] * DShapeFunction[k][1] + xs[0][2] * DShapeFunction[k][2]; // dN/dx + c1 = xs[1][0] * DShapeFunction[k][0] + xs[1][1] * DShapeFunction[k][1] + xs[1][2] * DShapeFunction[k][2]; // dN/dy + c2 = xs[2][0] * DShapeFunction[k][0] + xs[2][1] * DShapeFunction[k][1] + xs[2][2] * DShapeFunction[k][2]; // dN/dz + DShapeFunction[k][0] = c0; // store dN/dx instead of dN/d xi + DShapeFunction[k][1] = c1; // store dN/dy instead of dN/d eta + DShapeFunction[k][2] = c2; // store dN/dz instead of dN/d zeta } return xsj; - } -su2double CVolumetricMovement::ShapeFunc_Pyram(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]) { - +su2double CVolumetricMovement::ShapeFunc_Pyram(su2double Xi, su2double Eta, su2double Zeta, + su2double CoordCorners[8][3], su2double DShapeFunction[8][4]) { int i, j, k; su2double c0, c1, c2, xsj; su2double xs[3][3], ad[3][3]; /*--- Shape functions ---*/ - DShapeFunction[0][3] = 0.25*(-Xi+Eta+Zeta-1.0)*(-Xi-Eta+Zeta-1.0)/(1.0-Zeta); - DShapeFunction[1][3] = 0.25*(-Xi-Eta+Zeta-1.0)*( Xi-Eta+Zeta-1.0)/(1.0-Zeta); - DShapeFunction[2][3] = 0.25*( Xi+Eta+Zeta-1.0)*( Xi-Eta+Zeta-1.0)/(1.0-Zeta); - DShapeFunction[3][3] = 0.25*( Xi+Eta+Zeta-1.0)*(-Xi+Eta+Zeta-1.0)/(1.0-Zeta); + DShapeFunction[0][3] = 0.25 * (-Xi + Eta + Zeta - 1.0) * (-Xi - Eta + Zeta - 1.0) / (1.0 - Zeta); + DShapeFunction[1][3] = 0.25 * (-Xi - Eta + Zeta - 1.0) * (Xi - Eta + Zeta - 1.0) / (1.0 - Zeta); + DShapeFunction[2][3] = 0.25 * (Xi + Eta + Zeta - 1.0) * (Xi - Eta + Zeta - 1.0) / (1.0 - Zeta); + DShapeFunction[3][3] = 0.25 * (Xi + Eta + Zeta - 1.0) * (-Xi + Eta + Zeta - 1.0) / (1.0 - Zeta); DShapeFunction[4][3] = Zeta; /*--- dN/d xi ---*/ - DShapeFunction[0][0] = 0.5*(Zeta-Xi-1.0)/(Zeta-1.0); - DShapeFunction[1][0] = 0.5*Xi/(Zeta-1.0); - DShapeFunction[2][0] = 0.5*(1.0-Zeta-Xi)/(Zeta-1.0); + DShapeFunction[0][0] = 0.5 * (Zeta - Xi - 1.0) / (Zeta - 1.0); + DShapeFunction[1][0] = 0.5 * Xi / (Zeta - 1.0); + DShapeFunction[2][0] = 0.5 * (1.0 - Zeta - Xi) / (Zeta - 1.0); DShapeFunction[3][0] = DShapeFunction[1][0]; DShapeFunction[4][0] = 0.0; /*--- dN/d eta ---*/ - DShapeFunction[0][1] = 0.5*Eta/(Zeta-1.0); - DShapeFunction[1][1] = 0.5*(Zeta-Eta-1.0)/(Zeta-1.0); + DShapeFunction[0][1] = 0.5 * Eta / (Zeta - 1.0); + DShapeFunction[1][1] = 0.5 * (Zeta - Eta - 1.0) / (Zeta - 1.0); DShapeFunction[2][1] = DShapeFunction[0][1]; - DShapeFunction[3][1] = 0.5*(1.0-Zeta-Eta)/(Zeta-1.0); + DShapeFunction[3][1] = 0.5 * (1.0 - Zeta - Eta) / (Zeta - 1.0); DShapeFunction[4][1] = 0.0; /*--- dN/d zeta ---*/ - DShapeFunction[0][2] = 0.25*(-1.0 + 2.0*Zeta - Zeta*Zeta - Eta*Eta + Xi*Xi)/((1.0-Zeta)*(1.0-Zeta)); - DShapeFunction[1][2] = 0.25*(-1.0 + 2.0*Zeta - Zeta*Zeta + Eta*Eta - Xi*Xi)/((1.0-Zeta)*(1.0-Zeta)); + DShapeFunction[0][2] = 0.25 * (-1.0 + 2.0 * Zeta - Zeta * Zeta - Eta * Eta + Xi * Xi) / ((1.0 - Zeta) * (1.0 - Zeta)); + DShapeFunction[1][2] = 0.25 * (-1.0 + 2.0 * Zeta - Zeta * Zeta + Eta * Eta - Xi * Xi) / ((1.0 - Zeta) * (1.0 - Zeta)); DShapeFunction[2][2] = DShapeFunction[0][2]; DShapeFunction[3][2] = DShapeFunction[1][2]; DShapeFunction[4][2] = 1.0; @@ -777,73 +777,84 @@ su2double CVolumetricMovement::ShapeFunc_Pyram(su2double Xi, su2double Eta, su2d for (j = 0; j < 3; j++) { xs[i][j] = 0.0; for (k = 0; k < 5; k++) { - xs[i][j] = xs[i][j]+CoordCorners[k][j]*DShapeFunction[k][i]; + xs[i][j] = xs[i][j] + CoordCorners[k][j] * DShapeFunction[k][i]; } } } /*--- Adjoint to Jacobian ---*/ - ad[0][0] = xs[1][1]*xs[2][2]-xs[1][2]*xs[2][1]; - ad[0][1] = xs[0][2]*xs[2][1]-xs[0][1]*xs[2][2]; - ad[0][2] = xs[0][1]*xs[1][2]-xs[0][2]*xs[1][1]; - ad[1][0] = xs[1][2]*xs[2][0]-xs[1][0]*xs[2][2]; - ad[1][1] = xs[0][0]*xs[2][2]-xs[0][2]*xs[2][0]; - ad[1][2] = xs[0][2]*xs[1][0]-xs[0][0]*xs[1][2]; - ad[2][0] = xs[1][0]*xs[2][1]-xs[1][1]*xs[2][0]; - ad[2][1] = xs[0][1]*xs[2][0]-xs[0][0]*xs[2][1]; - ad[2][2] = xs[0][0]*xs[1][1]-xs[0][1]*xs[1][0]; + ad[0][0] = xs[1][1] * xs[2][2] - xs[1][2] * xs[2][1]; + ad[0][1] = xs[0][2] * xs[2][1] - xs[0][1] * xs[2][2]; + ad[0][2] = xs[0][1] * xs[1][2] - xs[0][2] * xs[1][1]; + ad[1][0] = xs[1][2] * xs[2][0] - xs[1][0] * xs[2][2]; + ad[1][1] = xs[0][0] * xs[2][2] - xs[0][2] * xs[2][0]; + ad[1][2] = xs[0][2] * xs[1][0] - xs[0][0] * xs[1][2]; + ad[2][0] = xs[1][0] * xs[2][1] - xs[1][1] * xs[2][0]; + ad[2][1] = xs[0][1] * xs[2][0] - xs[0][0] * xs[2][1]; + ad[2][2] = xs[0][0] * xs[1][1] - xs[0][1] * xs[1][0]; /*--- Determinant of Jacobian ---*/ - xsj = xs[0][0]*ad[0][0]+xs[0][1]*ad[1][0]+xs[0][2]*ad[2][0]; + xsj = xs[0][0] * ad[0][0] + xs[0][1] * ad[1][0] + xs[0][2] * ad[2][0]; /*--- Jacobian inverse ---*/ for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) { - xs[i][j] = ad[i][j]/xsj; + xs[i][j] = ad[i][j] / xsj; } } /*--- Derivatives with repect to global coordinates ---*/ for (k = 0; k < 5; k++) { - c0 = xs[0][0]*DShapeFunction[k][0]+xs[0][1]*DShapeFunction[k][1]+xs[0][2]*DShapeFunction[k][2]; // dN/dx - c1 = xs[1][0]*DShapeFunction[k][0]+xs[1][1]*DShapeFunction[k][1]+xs[1][2]*DShapeFunction[k][2]; // dN/dy - c2 = xs[2][0]*DShapeFunction[k][0]+xs[2][1]*DShapeFunction[k][1]+xs[2][2]*DShapeFunction[k][2]; // dN/dz - DShapeFunction[k][0] = c0; // store dN/dx instead of dN/d xi - DShapeFunction[k][1] = c1; // store dN/dy instead of dN/d eta - DShapeFunction[k][2] = c2; // store dN/dz instead of dN/d zeta + c0 = xs[0][0] * DShapeFunction[k][0] + xs[0][1] * DShapeFunction[k][1] + xs[0][2] * DShapeFunction[k][2]; // dN/dx + c1 = xs[1][0] * DShapeFunction[k][0] + xs[1][1] * DShapeFunction[k][1] + xs[1][2] * DShapeFunction[k][2]; // dN/dy + c2 = xs[2][0] * DShapeFunction[k][0] + xs[2][1] * DShapeFunction[k][1] + xs[2][2] * DShapeFunction[k][2]; // dN/dz + DShapeFunction[k][0] = c0; // store dN/dx instead of dN/d xi + DShapeFunction[k][1] = c1; // store dN/dy instead of dN/d eta + DShapeFunction[k][2] = c2; // store dN/dz instead of dN/d zeta } return xsj; - } -su2double CVolumetricMovement::ShapeFunc_Prism(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]) { - +su2double CVolumetricMovement::ShapeFunc_Prism(su2double Xi, su2double Eta, su2double Zeta, + su2double CoordCorners[8][3], su2double DShapeFunction[8][4]) { int i, j, k; su2double c0, c1, c2, xsj; su2double xs[3][3], ad[3][3]; /*--- Shape functions ---*/ - DShapeFunction[0][3] = 0.5*Eta*(1.0-Xi); - DShapeFunction[1][3] = 0.5*Zeta*(1.0-Xi); - DShapeFunction[2][3] = 0.5*(1.0-Eta-Zeta)*(1.0-Xi); - DShapeFunction[3][3] = 0.5*Eta*(Xi+1.0); - DShapeFunction[4][3] = 0.5*Zeta*(Xi+1.0); - DShapeFunction[5][3] = 0.5*(1.0-Eta-Zeta)*(Xi+1.0); + DShapeFunction[0][3] = 0.5 * Eta * (1.0 - Xi); + DShapeFunction[1][3] = 0.5 * Zeta * (1.0 - Xi); + DShapeFunction[2][3] = 0.5 * (1.0 - Eta - Zeta) * (1.0 - Xi); + DShapeFunction[3][3] = 0.5 * Eta * (Xi + 1.0); + DShapeFunction[4][3] = 0.5 * Zeta * (Xi + 1.0); + DShapeFunction[5][3] = 0.5 * (1.0 - Eta - Zeta) * (Xi + 1.0); /*--- dN/d Xi, dN/d Eta, dN/d Zeta ---*/ - DShapeFunction[0][0] = -0.5*Eta; DShapeFunction[0][1] = 0.5*(1.0-Xi); DShapeFunction[0][2] = 0.0; - DShapeFunction[1][0] = -0.5*Zeta; DShapeFunction[1][1] = 0.0; DShapeFunction[1][2] = 0.5*(1.0-Xi); - DShapeFunction[2][0] = -0.5*(1.0-Eta-Zeta); DShapeFunction[2][1] = -0.5*(1.0-Xi); DShapeFunction[2][2] = -0.5*(1.0-Xi); - DShapeFunction[3][0] = 0.5*Eta; DShapeFunction[3][1] = 0.5*(Xi+1.0); DShapeFunction[3][2] = 0.0; - DShapeFunction[4][0] = 0.5*Zeta; DShapeFunction[4][1] = 0.0; DShapeFunction[4][2] = 0.5*(Xi+1.0); - DShapeFunction[5][0] = 0.5*(1.0-Eta-Zeta); DShapeFunction[5][1] = -0.5*(Xi+1.0); DShapeFunction[5][2] = -0.5*(Xi+1.0); + DShapeFunction[0][0] = -0.5 * Eta; + DShapeFunction[0][1] = 0.5 * (1.0 - Xi); + DShapeFunction[0][2] = 0.0; + DShapeFunction[1][0] = -0.5 * Zeta; + DShapeFunction[1][1] = 0.0; + DShapeFunction[1][2] = 0.5 * (1.0 - Xi); + DShapeFunction[2][0] = -0.5 * (1.0 - Eta - Zeta); + DShapeFunction[2][1] = -0.5 * (1.0 - Xi); + DShapeFunction[2][2] = -0.5 * (1.0 - Xi); + DShapeFunction[3][0] = 0.5 * Eta; + DShapeFunction[3][1] = 0.5 * (Xi + 1.0); + DShapeFunction[3][2] = 0.0; + DShapeFunction[4][0] = 0.5 * Zeta; + DShapeFunction[4][1] = 0.0; + DShapeFunction[4][2] = 0.5 * (Xi + 1.0); + DShapeFunction[5][0] = 0.5 * (1.0 - Eta - Zeta); + DShapeFunction[5][1] = -0.5 * (Xi + 1.0); + DShapeFunction[5][2] = -0.5 * (Xi + 1.0); /*--- Jacobian transformation ---*/ @@ -851,100 +862,98 @@ su2double CVolumetricMovement::ShapeFunc_Prism(su2double Xi, su2double Eta, su2d for (j = 0; j < 3; j++) { xs[i][j] = 0.0; for (k = 0; k < 6; k++) { - xs[i][j] = xs[i][j]+CoordCorners[k][j]*DShapeFunction[k][i]; + xs[i][j] = xs[i][j] + CoordCorners[k][j] * DShapeFunction[k][i]; } } } /*--- Adjoint to Jacobian ---*/ - ad[0][0] = xs[1][1]*xs[2][2]-xs[1][2]*xs[2][1]; - ad[0][1] = xs[0][2]*xs[2][1]-xs[0][1]*xs[2][2]; - ad[0][2] = xs[0][1]*xs[1][2]-xs[0][2]*xs[1][1]; - ad[1][0] = xs[1][2]*xs[2][0]-xs[1][0]*xs[2][2]; - ad[1][1] = xs[0][0]*xs[2][2]-xs[0][2]*xs[2][0]; - ad[1][2] = xs[0][2]*xs[1][0]-xs[0][0]*xs[1][2]; - ad[2][0] = xs[1][0]*xs[2][1]-xs[1][1]*xs[2][0]; - ad[2][1] = xs[0][1]*xs[2][0]-xs[0][0]*xs[2][1]; - ad[2][2] = xs[0][0]*xs[1][1]-xs[0][1]*xs[1][0]; + ad[0][0] = xs[1][1] * xs[2][2] - xs[1][2] * xs[2][1]; + ad[0][1] = xs[0][2] * xs[2][1] - xs[0][1] * xs[2][2]; + ad[0][2] = xs[0][1] * xs[1][2] - xs[0][2] * xs[1][1]; + ad[1][0] = xs[1][2] * xs[2][0] - xs[1][0] * xs[2][2]; + ad[1][1] = xs[0][0] * xs[2][2] - xs[0][2] * xs[2][0]; + ad[1][2] = xs[0][2] * xs[1][0] - xs[0][0] * xs[1][2]; + ad[2][0] = xs[1][0] * xs[2][1] - xs[1][1] * xs[2][0]; + ad[2][1] = xs[0][1] * xs[2][0] - xs[0][0] * xs[2][1]; + ad[2][2] = xs[0][0] * xs[1][1] - xs[0][1] * xs[1][0]; /*--- Determinant of Jacobian ---*/ - xsj = xs[0][0]*ad[0][0]+xs[0][1]*ad[1][0]+xs[0][2]*ad[2][0]; + xsj = xs[0][0] * ad[0][0] + xs[0][1] * ad[1][0] + xs[0][2] * ad[2][0]; /*--- Jacobian inverse ---*/ for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) { - xs[i][j] = ad[i][j]/xsj; + xs[i][j] = ad[i][j] / xsj; } } /*--- Derivatives with repect to global coordinates ---*/ for (k = 0; k < 6; k++) { - c0 = xs[0][0]*DShapeFunction[k][0]+xs[0][1]*DShapeFunction[k][1]+xs[0][2]*DShapeFunction[k][2]; // dN/dx - c1 = xs[1][0]*DShapeFunction[k][0]+xs[1][1]*DShapeFunction[k][1]+xs[1][2]*DShapeFunction[k][2]; // dN/dy - c2 = xs[2][0]*DShapeFunction[k][0]+xs[2][1]*DShapeFunction[k][1]+xs[2][2]*DShapeFunction[k][2]; // dN/dz - DShapeFunction[k][0] = c0; // store dN/dx instead of dN/d xi - DShapeFunction[k][1] = c1; // store dN/dy instead of dN/d eta - DShapeFunction[k][2] = c2; // store dN/dz instead of dN/d zeta + c0 = xs[0][0] * DShapeFunction[k][0] + xs[0][1] * DShapeFunction[k][1] + xs[0][2] * DShapeFunction[k][2]; // dN/dx + c1 = xs[1][0] * DShapeFunction[k][0] + xs[1][1] * DShapeFunction[k][1] + xs[1][2] * DShapeFunction[k][2]; // dN/dy + c2 = xs[2][0] * DShapeFunction[k][0] + xs[2][1] * DShapeFunction[k][1] + xs[2][2] * DShapeFunction[k][2]; // dN/dz + DShapeFunction[k][0] = c0; // store dN/dx instead of dN/d xi + DShapeFunction[k][1] = c1; // store dN/dy instead of dN/d eta + DShapeFunction[k][2] = c2; // store dN/dz instead of dN/d zeta } return xsj; - } -su2double CVolumetricMovement::ShapeFunc_Hexa(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], su2double DShapeFunction[8][4]) { - +su2double CVolumetricMovement::ShapeFunc_Hexa(su2double Xi, su2double Eta, su2double Zeta, su2double CoordCorners[8][3], + su2double DShapeFunction[8][4]) { int i, j, k; su2double c0, c1, c2, xsj; su2double xs[3][3], ad[3][3]; - /*--- Shape functions ---*/ - DShapeFunction[0][3] = 0.125*(1.0-Xi)*(1.0-Eta)*(1.0-Zeta); - DShapeFunction[1][3] = 0.125*(1.0+Xi)*(1.0-Eta)*(1.0-Zeta); - DShapeFunction[2][3] = 0.125*(1.0+Xi)*(1.0+Eta)*(1.0-Zeta); - DShapeFunction[3][3] = 0.125*(1.0-Xi)*(1.0+Eta)*(1.0-Zeta); - DShapeFunction[4][3] = 0.125*(1.0-Xi)*(1.0-Eta)*(1.0+Zeta); - DShapeFunction[5][3] = 0.125*(1.0+Xi)*(1.0-Eta)*(1.0+Zeta); - DShapeFunction[6][3] = 0.125*(1.0+Xi)*(1.0+Eta)*(1.0+Zeta); - DShapeFunction[7][3] = 0.125*(1.0-Xi)*(1.0+Eta)*(1.0+Zeta); + DShapeFunction[0][3] = 0.125 * (1.0 - Xi) * (1.0 - Eta) * (1.0 - Zeta); + DShapeFunction[1][3] = 0.125 * (1.0 + Xi) * (1.0 - Eta) * (1.0 - Zeta); + DShapeFunction[2][3] = 0.125 * (1.0 + Xi) * (1.0 + Eta) * (1.0 - Zeta); + DShapeFunction[3][3] = 0.125 * (1.0 - Xi) * (1.0 + Eta) * (1.0 - Zeta); + DShapeFunction[4][3] = 0.125 * (1.0 - Xi) * (1.0 - Eta) * (1.0 + Zeta); + DShapeFunction[5][3] = 0.125 * (1.0 + Xi) * (1.0 - Eta) * (1.0 + Zeta); + DShapeFunction[6][3] = 0.125 * (1.0 + Xi) * (1.0 + Eta) * (1.0 + Zeta); + DShapeFunction[7][3] = 0.125 * (1.0 - Xi) * (1.0 + Eta) * (1.0 + Zeta); /*--- dN/d xi ---*/ - DShapeFunction[0][0] = -0.125*(1.0-Eta)*(1.0-Zeta); - DShapeFunction[1][0] = 0.125*(1.0-Eta)*(1.0-Zeta); - DShapeFunction[2][0] = 0.125*(1.0+Eta)*(1.0-Zeta); - DShapeFunction[3][0] = -0.125*(1.0+Eta)*(1.0-Zeta); - DShapeFunction[4][0] = -0.125*(1.0-Eta)*(1.0+Zeta); - DShapeFunction[5][0] = 0.125*(1.0-Eta)*(1.0+Zeta); - DShapeFunction[6][0] = 0.125*(1.0+Eta)*(1.0+Zeta); - DShapeFunction[7][0] = -0.125*(1.0+Eta)*(1.0+Zeta); + DShapeFunction[0][0] = -0.125 * (1.0 - Eta) * (1.0 - Zeta); + DShapeFunction[1][0] = 0.125 * (1.0 - Eta) * (1.0 - Zeta); + DShapeFunction[2][0] = 0.125 * (1.0 + Eta) * (1.0 - Zeta); + DShapeFunction[3][0] = -0.125 * (1.0 + Eta) * (1.0 - Zeta); + DShapeFunction[4][0] = -0.125 * (1.0 - Eta) * (1.0 + Zeta); + DShapeFunction[5][0] = 0.125 * (1.0 - Eta) * (1.0 + Zeta); + DShapeFunction[6][0] = 0.125 * (1.0 + Eta) * (1.0 + Zeta); + DShapeFunction[7][0] = -0.125 * (1.0 + Eta) * (1.0 + Zeta); /*--- dN/d eta ---*/ - DShapeFunction[0][1] = -0.125*(1.0-Xi)*(1.0-Zeta); - DShapeFunction[1][1] = -0.125*(1.0+Xi)*(1.0-Zeta); - DShapeFunction[2][1] = 0.125*(1.0+Xi)*(1.0-Zeta); - DShapeFunction[3][1] = 0.125*(1.0-Xi)*(1.0-Zeta); - DShapeFunction[4][1] = -0.125*(1.0-Xi)*(1.0+Zeta); - DShapeFunction[5][1] = -0.125*(1.0+Xi)*(1.0+Zeta); - DShapeFunction[6][1] = 0.125*(1.0+Xi)*(1.0+Zeta); - DShapeFunction[7][1] = 0.125*(1.0-Xi)*(1.0+Zeta); + DShapeFunction[0][1] = -0.125 * (1.0 - Xi) * (1.0 - Zeta); + DShapeFunction[1][1] = -0.125 * (1.0 + Xi) * (1.0 - Zeta); + DShapeFunction[2][1] = 0.125 * (1.0 + Xi) * (1.0 - Zeta); + DShapeFunction[3][1] = 0.125 * (1.0 - Xi) * (1.0 - Zeta); + DShapeFunction[4][1] = -0.125 * (1.0 - Xi) * (1.0 + Zeta); + DShapeFunction[5][1] = -0.125 * (1.0 + Xi) * (1.0 + Zeta); + DShapeFunction[6][1] = 0.125 * (1.0 + Xi) * (1.0 + Zeta); + DShapeFunction[7][1] = 0.125 * (1.0 - Xi) * (1.0 + Zeta); /*--- dN/d zeta ---*/ - DShapeFunction[0][2] = -0.125*(1.0-Xi)*(1.0-Eta); - DShapeFunction[1][2] = -0.125*(1.0+Xi)*(1.0-Eta); - DShapeFunction[2][2] = -0.125*(1.0+Xi)*(1.0+Eta); - DShapeFunction[3][2] = -0.125*(1.0-Xi)*(1.0+Eta); - DShapeFunction[4][2] = 0.125*(1.0-Xi)*(1.0-Eta); - DShapeFunction[5][2] = 0.125*(1.0+Xi)*(1.0-Eta); - DShapeFunction[6][2] = 0.125*(1.0+Xi)*(1.0+Eta); - DShapeFunction[7][2] = 0.125*(1.0-Xi)*(1.0+Eta); + DShapeFunction[0][2] = -0.125 * (1.0 - Xi) * (1.0 - Eta); + DShapeFunction[1][2] = -0.125 * (1.0 + Xi) * (1.0 - Eta); + DShapeFunction[2][2] = -0.125 * (1.0 + Xi) * (1.0 + Eta); + DShapeFunction[3][2] = -0.125 * (1.0 - Xi) * (1.0 + Eta); + DShapeFunction[4][2] = 0.125 * (1.0 - Xi) * (1.0 - Eta); + DShapeFunction[5][2] = 0.125 * (1.0 + Xi) * (1.0 - Eta); + DShapeFunction[6][2] = 0.125 * (1.0 + Xi) * (1.0 + Eta); + DShapeFunction[7][2] = 0.125 * (1.0 - Xi) * (1.0 + Eta); /*--- Jacobian transformation ---*/ @@ -952,53 +961,51 @@ su2double CVolumetricMovement::ShapeFunc_Hexa(su2double Xi, su2double Eta, su2do for (j = 0; j < 3; j++) { xs[i][j] = 0.0; for (k = 0; k < 8; k++) { - xs[i][j] = xs[i][j]+CoordCorners[k][j]*DShapeFunction[k][i]; + xs[i][j] = xs[i][j] + CoordCorners[k][j] * DShapeFunction[k][i]; } } } /*--- Adjoint to Jacobian ---*/ - ad[0][0] = xs[1][1]*xs[2][2]-xs[1][2]*xs[2][1]; - ad[0][1] = xs[0][2]*xs[2][1]-xs[0][1]*xs[2][2]; - ad[0][2] = xs[0][1]*xs[1][2]-xs[0][2]*xs[1][1]; - ad[1][0] = xs[1][2]*xs[2][0]-xs[1][0]*xs[2][2]; - ad[1][1] = xs[0][0]*xs[2][2]-xs[0][2]*xs[2][0]; - ad[1][2] = xs[0][2]*xs[1][0]-xs[0][0]*xs[1][2]; - ad[2][0] = xs[1][0]*xs[2][1]-xs[1][1]*xs[2][0]; - ad[2][1] = xs[0][1]*xs[2][0]-xs[0][0]*xs[2][1]; - ad[2][2] = xs[0][0]*xs[1][1]-xs[0][1]*xs[1][0]; + ad[0][0] = xs[1][1] * xs[2][2] - xs[1][2] * xs[2][1]; + ad[0][1] = xs[0][2] * xs[2][1] - xs[0][1] * xs[2][2]; + ad[0][2] = xs[0][1] * xs[1][2] - xs[0][2] * xs[1][1]; + ad[1][0] = xs[1][2] * xs[2][0] - xs[1][0] * xs[2][2]; + ad[1][1] = xs[0][0] * xs[2][2] - xs[0][2] * xs[2][0]; + ad[1][2] = xs[0][2] * xs[1][0] - xs[0][0] * xs[1][2]; + ad[2][0] = xs[1][0] * xs[2][1] - xs[1][1] * xs[2][0]; + ad[2][1] = xs[0][1] * xs[2][0] - xs[0][0] * xs[2][1]; + ad[2][2] = xs[0][0] * xs[1][1] - xs[0][1] * xs[1][0]; /*--- Determinant of Jacobian ---*/ - xsj = xs[0][0]*ad[0][0]+xs[0][1]*ad[1][0]+xs[0][2]*ad[2][0]; + xsj = xs[0][0] * ad[0][0] + xs[0][1] * ad[1][0] + xs[0][2] * ad[2][0]; /*--- Jacobian inverse ---*/ for (i = 0; i < 3; i++) { for (j = 0; j < 3; j++) { - xs[i][j] = ad[i][j]/xsj; + xs[i][j] = ad[i][j] / xsj; } } /*--- Derivatives with repect to global coordinates ---*/ for (k = 0; k < 8; k++) { - c0 = xs[0][0]*DShapeFunction[k][0]+xs[0][1]*DShapeFunction[k][1]+xs[0][2]*DShapeFunction[k][2]; // dN/dx - c1 = xs[1][0]*DShapeFunction[k][0]+xs[1][1]*DShapeFunction[k][1]+xs[1][2]*DShapeFunction[k][2]; // dN/dy - c2 = xs[2][0]*DShapeFunction[k][0]+xs[2][1]*DShapeFunction[k][1]+xs[2][2]*DShapeFunction[k][2]; // dN/dz - DShapeFunction[k][0] = c0; // store dN/dx instead of dN/d xi - DShapeFunction[k][1] = c1; // store dN/dy instead of dN/d eta - DShapeFunction[k][2] = c2; // store dN/dz instead of dN/d zeta + c0 = xs[0][0] * DShapeFunction[k][0] + xs[0][1] * DShapeFunction[k][1] + xs[0][2] * DShapeFunction[k][2]; // dN/dx + c1 = xs[1][0] * DShapeFunction[k][0] + xs[1][1] * DShapeFunction[k][1] + xs[1][2] * DShapeFunction[k][2]; // dN/dy + c2 = xs[2][0] * DShapeFunction[k][0] + xs[2][1] * DShapeFunction[k][1] + xs[2][2] * DShapeFunction[k][2]; // dN/dz + DShapeFunction[k][0] = c0; // store dN/dx instead of dN/d xi + DShapeFunction[k][1] = c1; // store dN/dy instead of dN/d eta + DShapeFunction[k][2] = c2; // store dN/dz instead of dN/d zeta } return xsj; - } su2double CVolumetricMovement::GetTriangle_Area(su2double CoordCorners[8][3]) const { - unsigned short iDim; - su2double a[3] = {0.0,0.0,0.0}, b[3] = {0.0,0.0,0.0}; + su2double a[3] = {0.0, 0.0, 0.0}, b[3] = {0.0, 0.0, 0.0}; su2double *Coord_0, *Coord_1, *Coord_2, Area; Coord_0 = CoordCorners[0]; @@ -1006,20 +1013,18 @@ su2double CVolumetricMovement::GetTriangle_Area(su2double CoordCorners[8][3]) co Coord_2 = CoordCorners[2]; for (iDim = 0; iDim < nDim; iDim++) { - a[iDim] = Coord_0[iDim]-Coord_2[iDim]; - b[iDim] = Coord_1[iDim]-Coord_2[iDim]; + a[iDim] = Coord_0[iDim] - Coord_2[iDim]; + b[iDim] = Coord_1[iDim] - Coord_2[iDim]; } - Area = 0.5*fabs(a[0]*b[1]-a[1]*b[0]); + Area = 0.5 * fabs(a[0] * b[1] - a[1] * b[0]); return Area; - } su2double CVolumetricMovement::GetQuadrilateral_Area(su2double CoordCorners[8][3]) const { - unsigned short iDim; - su2double a[3] = {0.0,0.0,0.0}, b[3] = {0.0,0.0,0.0}; + su2double a[3] = {0.0, 0.0, 0.0}, b[3] = {0.0, 0.0, 0.0}; su2double *Coord_0, *Coord_1, *Coord_2, Area; Coord_0 = CoordCorners[0]; @@ -1027,32 +1032,31 @@ su2double CVolumetricMovement::GetQuadrilateral_Area(su2double CoordCorners[8][3 Coord_2 = CoordCorners[2]; for (iDim = 0; iDim < nDim; iDim++) { - a[iDim] = Coord_0[iDim]-Coord_2[iDim]; - b[iDim] = Coord_1[iDim]-Coord_2[iDim]; + a[iDim] = Coord_0[iDim] - Coord_2[iDim]; + b[iDim] = Coord_1[iDim] - Coord_2[iDim]; } - Area = 0.5*fabs(a[0]*b[1]-a[1]*b[0]); + Area = 0.5 * fabs(a[0] * b[1] - a[1] * b[0]); Coord_0 = CoordCorners[0]; Coord_1 = CoordCorners[2]; Coord_2 = CoordCorners[3]; for (iDim = 0; iDim < nDim; iDim++) { - a[iDim] = Coord_0[iDim]-Coord_2[iDim]; - b[iDim] = Coord_1[iDim]-Coord_2[iDim]; + a[iDim] = Coord_0[iDim] - Coord_2[iDim]; + b[iDim] = Coord_1[iDim] - Coord_2[iDim]; } - Area += 0.5*fabs(a[0]*b[1]-a[1]*b[0]); + Area += 0.5 * fabs(a[0] * b[1] - a[1] * b[0]); return Area; - } su2double CVolumetricMovement::GetTetra_Volume(su2double CoordCorners[8][3]) const { - unsigned short iDim; su2double *Coord_0, *Coord_1, *Coord_2, *Coord_3; - su2double r1[3] = {0.0,0.0,0.0}, r2[3] = {0.0,0.0,0.0}, r3[3] = {0.0,0.0,0.0}, CrossProduct[3] = {0.0,0.0,0.0}, Volume; + su2double r1[3] = {0.0, 0.0, 0.0}, r2[3] = {0.0, 0.0, 0.0}, r3[3] = {0.0, 0.0, 0.0}, + CrossProduct[3] = {0.0, 0.0, 0.0}, Volume; Coord_0 = CoordCorners[0]; Coord_1 = CoordCorners[1]; @@ -1065,21 +1069,20 @@ su2double CVolumetricMovement::GetTetra_Volume(su2double CoordCorners[8][3]) con r3[iDim] = Coord_3[iDim] - Coord_0[iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume = fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume = fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; return Volume; - } su2double CVolumetricMovement::GetPyram_Volume(su2double CoordCorners[8][3]) const { - unsigned short iDim; su2double *Coord_0, *Coord_1, *Coord_2, *Coord_3; - su2double r1[3] = {0.0,0.0,0.0}, r2[3] = {0.0,0.0,0.0}, r3[3] = {0.0,0.0,0.0}, CrossProduct[3] = {0.0,0.0,0.0}, Volume; + su2double r1[3] = {0.0, 0.0, 0.0}, r2[3] = {0.0, 0.0, 0.0}, r3[3] = {0.0, 0.0, 0.0}, + CrossProduct[3] = {0.0, 0.0, 0.0}, Volume; Coord_0 = CoordCorners[0]; Coord_1 = CoordCorners[1]; @@ -1092,11 +1095,11 @@ su2double CVolumetricMovement::GetPyram_Volume(su2double CoordCorners[8][3]) con r3[iDim] = Coord_3[iDim] - Coord_0[iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume = fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume = fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; Coord_0 = CoordCorners[0]; Coord_1 = CoordCorners[2]; @@ -1109,21 +1112,20 @@ su2double CVolumetricMovement::GetPyram_Volume(su2double CoordCorners[8][3]) con r3[iDim] = Coord_3[iDim] - Coord_0[iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; return Volume; - } su2double CVolumetricMovement::GetPrism_Volume(su2double CoordCorners[8][3]) const { - unsigned short iDim; su2double *Coord_0, *Coord_1, *Coord_2, *Coord_3; - su2double r1[3] = {0.0,0.0,0.0}, r2[3] = {0.0,0.0,0.0}, r3[3] = {0.0,0.0,0.0}, CrossProduct[3] = {0.0,0.0,0.0}, Volume; + su2double r1[3] = {0.0, 0.0, 0.0}, r2[3] = {0.0, 0.0, 0.0}, r3[3] = {0.0, 0.0, 0.0}, + CrossProduct[3] = {0.0, 0.0, 0.0}, Volume; Coord_0 = CoordCorners[0]; Coord_1 = CoordCorners[2]; @@ -1136,11 +1138,11 @@ su2double CVolumetricMovement::GetPrism_Volume(su2double CoordCorners[8][3]) con r3[iDim] = Coord_3[iDim] - Coord_0[iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume = fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume = fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; Coord_0 = CoordCorners[0]; Coord_1 = CoordCorners[5]; @@ -1153,11 +1155,11 @@ su2double CVolumetricMovement::GetPrism_Volume(su2double CoordCorners[8][3]) con r3[iDim] = Coord_3[iDim] - Coord_0[iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; Coord_0 = CoordCorners[0]; Coord_1 = CoordCorners[5]; @@ -1170,21 +1172,20 @@ su2double CVolumetricMovement::GetPrism_Volume(su2double CoordCorners[8][3]) con r3[iDim] = Coord_3[iDim] - Coord_0[iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; return Volume; - } su2double CVolumetricMovement::GetHexa_Volume(su2double CoordCorners[8][3]) const { - unsigned short iDim; su2double *Coord_0, *Coord_1, *Coord_2, *Coord_3; - su2double r1[3] = {0.0,0.0,0.0}, r2[3] = {0.0,0.0,0.0}, r3[3] = {0.0,0.0,0.0}, CrossProduct[3] = {0.0,0.0,0.0}, Volume; + su2double r1[3] = {0.0, 0.0, 0.0}, r2[3] = {0.0, 0.0, 0.0}, r3[3] = {0.0, 0.0, 0.0}, + CrossProduct[3] = {0.0, 0.0, 0.0}, Volume; Coord_0 = CoordCorners[0]; Coord_1 = CoordCorners[1]; @@ -1197,11 +1198,11 @@ su2double CVolumetricMovement::GetHexa_Volume(su2double CoordCorners[8][3]) cons r3[iDim] = Coord_3[iDim] - Coord_0[iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume = fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume = fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; Coord_0 = CoordCorners[0]; Coord_1 = CoordCorners[2]; @@ -1214,11 +1215,11 @@ su2double CVolumetricMovement::GetHexa_Volume(su2double CoordCorners[8][3]) cons r3[iDim] = Coord_3[iDim] - Coord_0[iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; Coord_0 = CoordCorners[0]; Coord_1 = CoordCorners[2]; @@ -1231,11 +1232,11 @@ su2double CVolumetricMovement::GetHexa_Volume(su2double CoordCorners[8][3]) cons r3[iDim] = Coord_3[iDim] - Coord_0[iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; Coord_0 = CoordCorners[0]; Coord_1 = CoordCorners[5]; @@ -1248,11 +1249,11 @@ su2double CVolumetricMovement::GetHexa_Volume(su2double CoordCorners[8][3]) cons r3[iDim] = Coord_3[iDim] - Coord_0[iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; Coord_0 = CoordCorners[2]; Coord_1 = CoordCorners[7]; @@ -1265,29 +1266,29 @@ su2double CVolumetricMovement::GetHexa_Volume(su2double CoordCorners[8][3]) cons r3[iDim] = Coord_3[iDim] - Coord_0[iDim]; } - CrossProduct[0] = (r1[1]*r2[2] - r1[2]*r2[1])*r3[0]; - CrossProduct[1] = (r1[2]*r2[0] - r1[0]*r2[2])*r3[1]; - CrossProduct[2] = (r1[0]*r2[1] - r1[1]*r2[0])*r3[2]; + CrossProduct[0] = (r1[1] * r2[2] - r1[2] * r2[1]) * r3[0]; + CrossProduct[1] = (r1[2] * r2[0] - r1[0] * r2[2]) * r3[1]; + CrossProduct[2] = (r1[0] * r2[1] - r1[1] * r2[0]) * r3[2]; - Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2])/6.0; + Volume += fabs(CrossProduct[0] + CrossProduct[1] + CrossProduct[2]) / 6.0; return Volume; - } -void CVolumetricMovement::SetFEA_StiffMatrix2D(CGeometry *geometry, CConfig *config, su2double **StiffMatrix_Elem, unsigned long PointCorners[8], su2double CoordCorners[8][3], +void CVolumetricMovement::SetFEA_StiffMatrix2D(CGeometry* geometry, CConfig* config, su2double** StiffMatrix_Elem, + unsigned long PointCorners[8], su2double CoordCorners[8][3], unsigned short nNodes, su2double ElemVolume, su2double ElemDistance) { - su2double B_Matrix[3][8], D_Matrix[3][3], Aux_Matrix[8][3]; - su2double Xi = 0.0, Eta = 0.0, Det = 0.0, E = 1/EPS, Lambda = 0.0, Mu = 0.0, Nu = 0.0; + su2double Xi = 0.0, Eta = 0.0, Det = 0.0, E = 1 / EPS, Lambda = 0.0, Mu = 0.0, Nu = 0.0; unsigned short iNode, iVar, jVar, kVar, iGauss, nGauss = 0; - su2double DShapeFunction[8][4] = {{0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, - {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}}; + su2double DShapeFunction[8][4] = {{0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, + {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, + {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}}; su2double Location[4][3], Weight[4]; unsigned short nVar = geometry->GetnDim(); - for (iVar = 0; iVar < nNodes*nVar; iVar++) { - for (jVar = 0; jVar < nNodes*nVar; jVar++) { + for (iVar = 0; iVar < nNodes * nVar; iVar++) { + for (jVar = 0; jVar < nNodes * nVar; jVar++) { StiffMatrix_Elem[iVar][jVar] = 0.0; } } @@ -1299,22 +1300,32 @@ void CVolumetricMovement::SetFEA_StiffMatrix2D(CGeometry *geometry, CConfig *con if (nNodes == 3) { nGauss = 1; - Location[0][0] = 0.333333333333333; Location[0][1] = 0.333333333333333; Weight[0] = 0.5; + Location[0][0] = 0.333333333333333; + Location[0][1] = 0.333333333333333; + Weight[0] = 0.5; } /*--- Quadrilateral. Nodes of numerical integration at 4 points (order 2). ---*/ if (nNodes == 4) { nGauss = 4; - Location[0][0] = -0.577350269189626; Location[0][1] = -0.577350269189626; Weight[0] = 1.0; - Location[1][0] = 0.577350269189626; Location[1][1] = -0.577350269189626; Weight[1] = 1.0; - Location[2][0] = 0.577350269189626; Location[2][1] = 0.577350269189626; Weight[2] = 1.0; - Location[3][0] = -0.577350269189626; Location[3][1] = 0.577350269189626; Weight[3] = 1.0; + Location[0][0] = -0.577350269189626; + Location[0][1] = -0.577350269189626; + Weight[0] = 1.0; + Location[1][0] = 0.577350269189626; + Location[1][1] = -0.577350269189626; + Weight[1] = 1.0; + Location[2][0] = 0.577350269189626; + Location[2][1] = 0.577350269189626; + Weight[2] = 1.0; + Location[3][0] = -0.577350269189626; + Location[3][1] = 0.577350269189626; + Weight[3] = 1.0; } for (iGauss = 0; iGauss < nGauss; iGauss++) { - - Xi = Location[iGauss][0]; Eta = Location[iGauss][1]; + Xi = Location[iGauss][0]; + Eta = Location[iGauss][1]; if (nNodes == 3) Det = ShapeFunc_Triangle(Xi, Eta, CoordCorners, DShapeFunction); if (nNodes == 4) Det = ShapeFunc_Quadrilateral(Xi, Eta, CoordCorners, DShapeFunction); @@ -1322,75 +1333,85 @@ void CVolumetricMovement::SetFEA_StiffMatrix2D(CGeometry *geometry, CConfig *con /*--- Compute the B Matrix ---*/ for (iVar = 0; iVar < 3; iVar++) - for (jVar = 0; jVar < nNodes*nVar; jVar++) - B_Matrix[iVar][jVar] = 0.0; + for (jVar = 0; jVar < nNodes * nVar; jVar++) B_Matrix[iVar][jVar] = 0.0; for (iNode = 0; iNode < nNodes; iNode++) { - B_Matrix[0][0+iNode*nVar] = DShapeFunction[iNode][0]; - B_Matrix[1][1+iNode*nVar] = DShapeFunction[iNode][1]; + B_Matrix[0][0 + iNode * nVar] = DShapeFunction[iNode][0]; + B_Matrix[1][1 + iNode * nVar] = DShapeFunction[iNode][1]; - B_Matrix[2][0+iNode*nVar] = DShapeFunction[iNode][1]; - B_Matrix[2][1+iNode*nVar] = DShapeFunction[iNode][0]; + B_Matrix[2][0 + iNode * nVar] = DShapeFunction[iNode][1]; + B_Matrix[2][1 + iNode * nVar] = DShapeFunction[iNode][0]; } /*--- Impose a type of stiffness for each element ---*/ switch (config->GetDeform_Stiffness_Type()) { - case INVERSE_VOLUME: E = 1.0 / ElemVolume; break; - case SOLID_WALL_DISTANCE: E = 1.0 / ElemDistance; break; - case CONSTANT_STIFFNESS: E = 1.0 / EPS; break; + case INVERSE_VOLUME: + E = 1.0 / ElemVolume; + break; + case SOLID_WALL_DISTANCE: + E = 1.0 / ElemDistance; + break; + case CONSTANT_STIFFNESS: + E = 1.0 / EPS; + break; } Nu = config->GetDeform_Coeff(); - Mu = E / (2.0*(1.0 + Nu)); - Lambda = Nu*E/((1.0+Nu)*(1.0-2.0*Nu)); + Mu = E / (2.0 * (1.0 + Nu)); + Lambda = Nu * E / ((1.0 + Nu) * (1.0 - 2.0 * Nu)); /*--- Compute the D Matrix (for plane strain and 3-D)---*/ - D_Matrix[0][0] = Lambda + 2.0*Mu; D_Matrix[0][1] = Lambda; D_Matrix[0][2] = 0.0; - D_Matrix[1][0] = Lambda; D_Matrix[1][1] = Lambda + 2.0*Mu; D_Matrix[1][2] = 0.0; - D_Matrix[2][0] = 0.0; D_Matrix[2][1] = 0.0; D_Matrix[2][2] = Mu; - + D_Matrix[0][0] = Lambda + 2.0 * Mu; + D_Matrix[0][1] = Lambda; + D_Matrix[0][2] = 0.0; + D_Matrix[1][0] = Lambda; + D_Matrix[1][1] = Lambda + 2.0 * Mu; + D_Matrix[1][2] = 0.0; + D_Matrix[2][0] = 0.0; + D_Matrix[2][1] = 0.0; + D_Matrix[2][2] = Mu; /*--- Compute the BT.D Matrix ---*/ - for (iVar = 0; iVar < nNodes*nVar; iVar++) { + for (iVar = 0; iVar < nNodes * nVar; iVar++) { for (jVar = 0; jVar < 3; jVar++) { Aux_Matrix[iVar][jVar] = 0.0; - for (kVar = 0; kVar < 3; kVar++) - Aux_Matrix[iVar][jVar] += B_Matrix[kVar][iVar]*D_Matrix[kVar][jVar]; + for (kVar = 0; kVar < 3; kVar++) Aux_Matrix[iVar][jVar] += B_Matrix[kVar][iVar] * D_Matrix[kVar][jVar]; } } /*--- Compute the BT.D.B Matrix (stiffness matrix), and add to the original matrix using Gauss integration ---*/ - for (iVar = 0; iVar < nNodes*nVar; iVar++) { - for (jVar = 0; jVar < nNodes*nVar; jVar++) { + for (iVar = 0; iVar < nNodes * nVar; iVar++) { + for (jVar = 0; jVar < nNodes * nVar; jVar++) { for (kVar = 0; kVar < 3; kVar++) { - StiffMatrix_Elem[iVar][jVar] += Weight[iGauss] * Aux_Matrix[iVar][kVar]*B_Matrix[kVar][jVar] * fabs(Det); + StiffMatrix_Elem[iVar][jVar] += Weight[iGauss] * Aux_Matrix[iVar][kVar] * B_Matrix[kVar][jVar] * fabs(Det); } } } - } - } -void CVolumetricMovement::SetFEA_StiffMatrix3D(CGeometry *geometry, CConfig *config, su2double **StiffMatrix_Elem, unsigned long PointCorners[8], su2double CoordCorners[8][3], +void CVolumetricMovement::SetFEA_StiffMatrix3D(CGeometry* geometry, CConfig* config, su2double** StiffMatrix_Elem, + unsigned long PointCorners[8], su2double CoordCorners[8][3], unsigned short nNodes, su2double ElemVolume, su2double ElemDistance) { - - su2double B_Matrix[6][24], D_Matrix[6][6] = {{0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, - {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}}, Aux_Matrix[24][6]; + su2double B_Matrix[6][24], + D_Matrix[6][6] = {{0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, + {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0, 0.0, 0.0}}, + Aux_Matrix[24][6]; su2double Xi = 0.0, Eta = 0.0, Zeta = 0.0, Det = 0.0, Mu = 0.0, E = 0.0, Lambda = 0.0, Nu = 0.0; unsigned short iNode, iVar, jVar, kVar, iGauss, nGauss = 0; - su2double DShapeFunction[8][4] = {{0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, - {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}}; + su2double DShapeFunction[8][4] = {{0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, + {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}, + {0.0, 0.0, 0.0, 0.0}, {0.0, 0.0, 0.0, 0.0}}; su2double Location[8][3], Weight[8]; unsigned short nVar = geometry->GetnDim(); - for (iVar = 0; iVar < nNodes*nVar; iVar++) { - for (jVar = 0; jVar < nNodes*nVar; jVar++) { + for (iVar = 0; iVar < nNodes * nVar; iVar++) { + for (jVar = 0; jVar < nNodes * nVar; jVar++) { StiffMatrix_Elem[iVar][jVar] = 0.0; } } @@ -1402,49 +1423,110 @@ void CVolumetricMovement::SetFEA_StiffMatrix3D(CGeometry *geometry, CConfig *con if (nNodes == 4) { nGauss = 1; - Location[0][0] = 0.25; Location[0][1] = 0.25; Location[0][2] = 0.25; Weight[0] = 0.166666666666666; + Location[0][0] = 0.25; + Location[0][1] = 0.25; + Location[0][2] = 0.25; + Weight[0] = 0.166666666666666; } /*--- Pyramids. Nodes numerical integration at 5 points. ---*/ if (nNodes == 5) { nGauss = 5; - Location[0][0] = 0.5; Location[0][1] = 0.0; Location[0][2] = 0.1531754163448146; Weight[0] = 0.133333333333333; - Location[1][0] = 0.0; Location[1][1] = 0.5; Location[1][2] = 0.1531754163448146; Weight[1] = 0.133333333333333; - Location[2][0] = -0.5; Location[2][1] = 0.0; Location[2][2] = 0.1531754163448146; Weight[2] = 0.133333333333333; - Location[3][0] = 0.0; Location[3][1] = -0.5; Location[3][2] = 0.1531754163448146; Weight[3] = 0.133333333333333; - Location[4][0] = 0.0; Location[4][1] = 0.0; Location[4][2] = 0.6372983346207416; Weight[4] = 0.133333333333333; + Location[0][0] = 0.5; + Location[0][1] = 0.0; + Location[0][2] = 0.1531754163448146; + Weight[0] = 0.133333333333333; + Location[1][0] = 0.0; + Location[1][1] = 0.5; + Location[1][2] = 0.1531754163448146; + Weight[1] = 0.133333333333333; + Location[2][0] = -0.5; + Location[2][1] = 0.0; + Location[2][2] = 0.1531754163448146; + Weight[2] = 0.133333333333333; + Location[3][0] = 0.0; + Location[3][1] = -0.5; + Location[3][2] = 0.1531754163448146; + Weight[3] = 0.133333333333333; + Location[4][0] = 0.0; + Location[4][1] = 0.0; + Location[4][2] = 0.6372983346207416; + Weight[4] = 0.133333333333333; } /*--- Prism. Nodes of numerical integration at 6 points (order 3 in Xi, order 2 in Eta and Mu ). ---*/ if (nNodes == 6) { nGauss = 6; - Location[0][0] = -0.577350269189626; Location[0][1] = 0.166666666666667; Location[0][2] = 0.166666666666667; Weight[0] = 0.166666666666667; - Location[1][0] = -0.577350269189626; Location[1][1] = 0.666666666666667; Location[1][2] = 0.166666666666667; Weight[1] = 0.166666666666667; - Location[2][0] = -0.577350269189626; Location[2][1] = 0.166666666666667; Location[2][2] = 0.666666666666667; Weight[2] = 0.166666666666667; - Location[3][0] = 0.577350269189626; Location[3][1] = 0.166666666666667; Location[3][2] = 0.166666666666667; Weight[3] = 0.166666666666667; - Location[4][0] = 0.577350269189626; Location[4][1] = 0.666666666666667; Location[4][2] = 0.166666666666667; Weight[4] = 0.166666666666667; - Location[5][0] = 0.577350269189626; Location[5][1] = 0.166666666666667; Location[5][2] = 0.666666666666667; Weight[5] = 0.166666666666667; + Location[0][0] = -0.577350269189626; + Location[0][1] = 0.166666666666667; + Location[0][2] = 0.166666666666667; + Weight[0] = 0.166666666666667; + Location[1][0] = -0.577350269189626; + Location[1][1] = 0.666666666666667; + Location[1][2] = 0.166666666666667; + Weight[1] = 0.166666666666667; + Location[2][0] = -0.577350269189626; + Location[2][1] = 0.166666666666667; + Location[2][2] = 0.666666666666667; + Weight[2] = 0.166666666666667; + Location[3][0] = 0.577350269189626; + Location[3][1] = 0.166666666666667; + Location[3][2] = 0.166666666666667; + Weight[3] = 0.166666666666667; + Location[4][0] = 0.577350269189626; + Location[4][1] = 0.666666666666667; + Location[4][2] = 0.166666666666667; + Weight[4] = 0.166666666666667; + Location[5][0] = 0.577350269189626; + Location[5][1] = 0.166666666666667; + Location[5][2] = 0.666666666666667; + Weight[5] = 0.166666666666667; } /*--- Hexahedrons. Nodes of numerical integration at 6 points (order 3). ---*/ if (nNodes == 8) { nGauss = 8; - Location[0][0] = -0.577350269189626; Location[0][1] = -0.577350269189626; Location[0][2] = -0.577350269189626; Weight[0] = 1.0; - Location[1][0] = -0.577350269189626; Location[1][1] = -0.577350269189626; Location[1][2] = 0.577350269189626; Weight[1] = 1.0; - Location[2][0] = -0.577350269189626; Location[2][1] = 0.577350269189626; Location[2][2] = -0.577350269189626; Weight[2] = 1.0; - Location[3][0] = -0.577350269189626; Location[3][1] = 0.577350269189626; Location[3][2] = 0.577350269189626; Weight[3] = 1.0; - Location[4][0] = 0.577350269189626; Location[4][1] = -0.577350269189626; Location[4][2] = -0.577350269189626; Weight[4] = 1.0; - Location[5][0] = 0.577350269189626; Location[5][1] = -0.577350269189626; Location[5][2] = 0.577350269189626; Weight[5] = 1.0; - Location[6][0] = 0.577350269189626; Location[6][1] = 0.577350269189626; Location[6][2] = -0.577350269189626; Weight[6] = 1.0; - Location[7][0] = 0.577350269189626; Location[7][1] = 0.577350269189626; Location[7][2] = 0.577350269189626; Weight[7] = 1.0; + Location[0][0] = -0.577350269189626; + Location[0][1] = -0.577350269189626; + Location[0][2] = -0.577350269189626; + Weight[0] = 1.0; + Location[1][0] = -0.577350269189626; + Location[1][1] = -0.577350269189626; + Location[1][2] = 0.577350269189626; + Weight[1] = 1.0; + Location[2][0] = -0.577350269189626; + Location[2][1] = 0.577350269189626; + Location[2][2] = -0.577350269189626; + Weight[2] = 1.0; + Location[3][0] = -0.577350269189626; + Location[3][1] = 0.577350269189626; + Location[3][2] = 0.577350269189626; + Weight[3] = 1.0; + Location[4][0] = 0.577350269189626; + Location[4][1] = -0.577350269189626; + Location[4][2] = -0.577350269189626; + Weight[4] = 1.0; + Location[5][0] = 0.577350269189626; + Location[5][1] = -0.577350269189626; + Location[5][2] = 0.577350269189626; + Weight[5] = 1.0; + Location[6][0] = 0.577350269189626; + Location[6][1] = 0.577350269189626; + Location[6][2] = -0.577350269189626; + Weight[6] = 1.0; + Location[7][0] = 0.577350269189626; + Location[7][1] = 0.577350269189626; + Location[7][2] = 0.577350269189626; + Weight[7] = 1.0; } for (iGauss = 0; iGauss < nGauss; iGauss++) { - - Xi = Location[iGauss][0]; Eta = Location[iGauss][1]; Zeta = Location[iGauss][2]; + Xi = Location[iGauss][0]; + Eta = Location[iGauss][1]; + Zeta = Location[iGauss][2]; if (nNodes == 4) Det = ShapeFunc_Tetra(Xi, Eta, Zeta, CoordCorners, DShapeFunction); if (nNodes == 5) Det = ShapeFunc_Pyram(Xi, Eta, Zeta, CoordCorners, DShapeFunction); @@ -1454,116 +1536,116 @@ void CVolumetricMovement::SetFEA_StiffMatrix3D(CGeometry *geometry, CConfig *con /*--- Compute the B Matrix ---*/ for (iVar = 0; iVar < 6; iVar++) - for (jVar = 0; jVar < nNodes*nVar; jVar++) - B_Matrix[iVar][jVar] = 0.0; + for (jVar = 0; jVar < nNodes * nVar; jVar++) B_Matrix[iVar][jVar] = 0.0; for (iNode = 0; iNode < nNodes; iNode++) { - B_Matrix[0][0+iNode*nVar] = DShapeFunction[iNode][0]; - B_Matrix[1][1+iNode*nVar] = DShapeFunction[iNode][1]; - B_Matrix[2][2+iNode*nVar] = DShapeFunction[iNode][2]; + B_Matrix[0][0 + iNode * nVar] = DShapeFunction[iNode][0]; + B_Matrix[1][1 + iNode * nVar] = DShapeFunction[iNode][1]; + B_Matrix[2][2 + iNode * nVar] = DShapeFunction[iNode][2]; - B_Matrix[3][0+iNode*nVar] = DShapeFunction[iNode][1]; - B_Matrix[3][1+iNode*nVar] = DShapeFunction[iNode][0]; + B_Matrix[3][0 + iNode * nVar] = DShapeFunction[iNode][1]; + B_Matrix[3][1 + iNode * nVar] = DShapeFunction[iNode][0]; - B_Matrix[4][1+iNode*nVar] = DShapeFunction[iNode][2]; - B_Matrix[4][2+iNode*nVar] = DShapeFunction[iNode][1]; + B_Matrix[4][1 + iNode * nVar] = DShapeFunction[iNode][2]; + B_Matrix[4][2 + iNode * nVar] = DShapeFunction[iNode][1]; - B_Matrix[5][0+iNode*nVar] = DShapeFunction[iNode][2]; - B_Matrix[5][2+iNode*nVar] = DShapeFunction[iNode][0]; + B_Matrix[5][0 + iNode * nVar] = DShapeFunction[iNode][2]; + B_Matrix[5][2 + iNode * nVar] = DShapeFunction[iNode][0]; } /*--- Impose a type of stiffness for each element ---*/ switch (config->GetDeform_Stiffness_Type()) { - case INVERSE_VOLUME: E = 1.0 / ElemVolume; break; - case SOLID_WALL_DISTANCE: E = 1.0 / ElemDistance; break; - case CONSTANT_STIFFNESS: E = 1.0 / EPS; break; + case INVERSE_VOLUME: + E = 1.0 / ElemVolume; + break; + case SOLID_WALL_DISTANCE: + E = 1.0 / ElemDistance; + break; + case CONSTANT_STIFFNESS: + E = 1.0 / EPS; + break; } Nu = config->GetDeform_Coeff(); - Mu = E / (2.0*(1.0 + Nu)); - Lambda = Nu*E/((1.0+Nu)*(1.0-2.0*Nu)); + Mu = E / (2.0 * (1.0 + Nu)); + Lambda = Nu * E / ((1.0 + Nu) * (1.0 - 2.0 * Nu)); /*--- Compute the D Matrix (for plane strain and 3-D)---*/ - D_Matrix[0][0] = Lambda + 2.0*Mu; D_Matrix[0][1] = Lambda; D_Matrix[0][2] = Lambda; - D_Matrix[1][0] = Lambda; D_Matrix[1][1] = Lambda + 2.0*Mu; D_Matrix[1][2] = Lambda; - D_Matrix[2][0] = Lambda; D_Matrix[2][1] = Lambda; D_Matrix[2][2] = Lambda + 2.0*Mu; + D_Matrix[0][0] = Lambda + 2.0 * Mu; + D_Matrix[0][1] = Lambda; + D_Matrix[0][2] = Lambda; + D_Matrix[1][0] = Lambda; + D_Matrix[1][1] = Lambda + 2.0 * Mu; + D_Matrix[1][2] = Lambda; + D_Matrix[2][0] = Lambda; + D_Matrix[2][1] = Lambda; + D_Matrix[2][2] = Lambda + 2.0 * Mu; D_Matrix[3][3] = Mu; D_Matrix[4][4] = Mu; D_Matrix[5][5] = Mu; - /*--- Compute the BT.D Matrix ---*/ - for (iVar = 0; iVar < nNodes*nVar; iVar++) { + for (iVar = 0; iVar < nNodes * nVar; iVar++) { for (jVar = 0; jVar < 6; jVar++) { Aux_Matrix[iVar][jVar] = 0.0; - for (kVar = 0; kVar < 6; kVar++) - Aux_Matrix[iVar][jVar] += B_Matrix[kVar][iVar]*D_Matrix[kVar][jVar]; + for (kVar = 0; kVar < 6; kVar++) Aux_Matrix[iVar][jVar] += B_Matrix[kVar][iVar] * D_Matrix[kVar][jVar]; } } /*--- Compute the BT.D.B Matrix (stiffness matrix), and add to the original matrix using Gauss integration ---*/ - for (iVar = 0; iVar < nNodes*nVar; iVar++) { - for (jVar = 0; jVar < nNodes*nVar; jVar++) { + for (iVar = 0; iVar < nNodes * nVar; iVar++) { + for (jVar = 0; jVar < nNodes * nVar; jVar++) { for (kVar = 0; kVar < 6; kVar++) { - StiffMatrix_Elem[iVar][jVar] += Weight[iGauss] * Aux_Matrix[iVar][kVar]*B_Matrix[kVar][jVar] * fabs(Det); + StiffMatrix_Elem[iVar][jVar] += Weight[iGauss] * Aux_Matrix[iVar][kVar] * B_Matrix[kVar][jVar] * fabs(Det); } } } - } - } -void CVolumetricMovement::AddFEA_StiffMatrix(CGeometry *geometry, su2double **StiffMatrix_Elem, unsigned long PointCorners[8], unsigned short nNodes) { - +void CVolumetricMovement::AddFEA_StiffMatrix(CGeometry* geometry, su2double** StiffMatrix_Elem, + unsigned long PointCorners[8], unsigned short nNodes) { unsigned short iVar, jVar, iDim, jDim; unsigned short nVar = geometry->GetnDim(); - su2double **StiffMatrix_Node; - StiffMatrix_Node = new su2double* [nVar]; - for (iVar = 0; iVar < nVar; iVar++) - StiffMatrix_Node[iVar] = new su2double [nVar]; + su2double** StiffMatrix_Node; + StiffMatrix_Node = new su2double*[nVar]; + for (iVar = 0; iVar < nVar; iVar++) StiffMatrix_Node[iVar] = new su2double[nVar]; for (iVar = 0; iVar < nVar; iVar++) - for (jVar = 0; jVar < nVar; jVar++) - StiffMatrix_Node[iVar][jVar] = 0.0; + for (jVar = 0; jVar < nVar; jVar++) StiffMatrix_Node[iVar][jVar] = 0.0; /*--- Transform the stiffness matrix for the hexahedral element into the contributions for the individual nodes relative to each other. ---*/ for (iVar = 0; iVar < nNodes; iVar++) { for (jVar = 0; jVar < nNodes; jVar++) { - for (iDim = 0; iDim < nVar; iDim++) { for (jDim = 0; jDim < nVar; jDim++) { - StiffMatrix_Node[iDim][jDim] = StiffMatrix_Elem[(iVar*nVar)+iDim][(jVar*nVar)+jDim]; + StiffMatrix_Node[iDim][jDim] = StiffMatrix_Elem[(iVar * nVar) + iDim][(jVar * nVar) + jDim]; } } StiffMatrix.AddBlock(PointCorners[iVar], PointCorners[jVar], StiffMatrix_Node); - } } /*--- Deallocate memory and exit ---*/ - for (iVar = 0; iVar < nVar; iVar++) - delete [] StiffMatrix_Node[iVar]; - delete [] StiffMatrix_Node; - + for (iVar = 0; iVar < nVar; iVar++) delete[] StiffMatrix_Node[iVar]; + delete[] StiffMatrix_Node; } -void CVolumetricMovement::SetBoundaryDisplacements(CGeometry *geometry, CConfig *config) { - +void CVolumetricMovement::SetBoundaryDisplacements(CGeometry* geometry, CConfig* config) { unsigned short iDim, nDim = geometry->GetnDim(), iMarker, axis = 0; unsigned long iPoint, total_index, iVertex; - su2double *VarCoord, MeanCoord[3] = {0.0,0.0,0.0}, VarIncrement = 1.0; + su2double *VarCoord, MeanCoord[3] = {0.0, 0.0, 0.0}, VarIncrement = 1.0; /*--- Get the SU2 module. SU2_CFD will use this routine for dynamically deforming meshes (MARKER_MOVING), while SU2_DEF will use it for deforming @@ -1575,7 +1657,7 @@ void CVolumetricMovement::SetBoundaryDisplacements(CGeometry *geometry, CConfig increments and solve the grid deformation equations iteratively with successive small deformations. ---*/ - VarIncrement = 1.0/((su2double)config->GetGridDef_Nonlinear_Iter()); + VarIncrement = 1.0 / ((su2double)config->GetGridDef_Nonlinear_Iter()); /*--- As initialization, set to zero displacements of all the surfaces except the symmetry plane (which is treated specially, see below), internal and the send-receive boundaries ---*/ @@ -1587,7 +1669,7 @@ void CVolumetricMovement::SetBoundaryDisplacements(CGeometry *geometry, CConfig for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); for (iDim = 0; iDim < nDim; iDim++) { - total_index = iPoint*nDim + iDim; + total_index = iPoint * nDim + iDim; LinSysRes[total_index] = 0.0; LinSysSol[total_index] = 0.0; StiffMatrix.DeleteValsRowi(total_index); @@ -1602,13 +1684,14 @@ void CVolumetricMovement::SetBoundaryDisplacements(CGeometry *geometry, CConfig for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if (((config->GetMarker_All_Moving(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_CFD)) || ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_DEF)) || - ((config->GetDirectDiff() == D_DESIGN) && (Kind_SU2 == SU2_COMPONENT::SU2_CFD) && (config->GetMarker_All_DV(iMarker) == YES)) || + ((config->GetDirectDiff() == D_DESIGN) && (Kind_SU2 == SU2_COMPONENT::SU2_CFD) && + (config->GetMarker_All_DV(iMarker) == YES)) || ((config->GetMarker_All_DV(iMarker) == YES) && (Kind_SU2 == SU2_COMPONENT::SU2_DOT))) { for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); VarCoord = geometry->vertex[iMarker][iVertex]->GetVarCoord(); for (iDim = 0; iDim < nDim; iDim++) { - total_index = iPoint*nDim + iDim; + total_index = iPoint * nDim + iDim; LinSysRes[total_index] = SU2_TYPE::GetValue(VarCoord[iDim] * VarIncrement); LinSysSol[total_index] = SU2_TYPE::GetValue(VarCoord[iDim] * VarIncrement); StiffMatrix.DeleteValsRowi(total_index); @@ -1620,37 +1703,35 @@ void CVolumetricMovement::SetBoundaryDisplacements(CGeometry *geometry, CConfig /*--- Set to zero displacements of the normal component for the symmetry plane condition ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if ((config->GetMarker_All_KindBC(iMarker) == SYMMETRY_PLANE) ) { - - su2double *Coord_0 = nullptr; + if ((config->GetMarker_All_KindBC(iMarker) == SYMMETRY_PLANE)) { + su2double* Coord_0 = nullptr; for (iDim = 0; iDim < nDim; iDim++) MeanCoord[iDim] = 0.0; /*--- Store the coord of the first point to help identify the axis. ---*/ - iPoint = geometry->vertex[iMarker][0]->GetNode(); + iPoint = geometry->vertex[iMarker][0]->GetNode(); Coord_0 = geometry->nodes->GetCoord(iPoint); for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); VarCoord = geometry->nodes->GetCoord(iPoint); for (iDim = 0; iDim < nDim; iDim++) - MeanCoord[iDim] += (VarCoord[iDim]-Coord_0[iDim])*(VarCoord[iDim]-Coord_0[iDim]); + MeanCoord[iDim] += (VarCoord[iDim] - Coord_0[iDim]) * (VarCoord[iDim] - Coord_0[iDim]); } for (iDim = 0; iDim < nDim; iDim++) MeanCoord[iDim] = sqrt(MeanCoord[iDim]); - if (nDim==3) { + if (nDim == 3) { if ((MeanCoord[0] <= MeanCoord[1]) && (MeanCoord[0] <= MeanCoord[2])) axis = 0; if ((MeanCoord[1] <= MeanCoord[0]) && (MeanCoord[1] <= MeanCoord[2])) axis = 1; if ((MeanCoord[2] <= MeanCoord[0]) && (MeanCoord[2] <= MeanCoord[1])) axis = 2; - } - else { - if ((MeanCoord[0] <= MeanCoord[1]) ) axis = 0; - if ((MeanCoord[1] <= MeanCoord[0]) ) axis = 1; + } else { + if ((MeanCoord[0] <= MeanCoord[1])) axis = 0; + if ((MeanCoord[1] <= MeanCoord[0])) axis = 1; } for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - total_index = iPoint*nDim + axis; + total_index = iPoint * nDim + axis; LinSysRes[total_index] = 0.0; LinSysSol[total_index] = 0.0; StiffMatrix.DeleteValsRowi(total_index); @@ -1665,7 +1746,7 @@ void CVolumetricMovement::SetBoundaryDisplacements(CGeometry *geometry, CConfig for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); for (iDim = 0; iDim < nDim; iDim++) { - total_index = iPoint*nDim + iDim; + total_index = iPoint * nDim + iDim; LinSysRes[total_index] = 0.0; LinSysSol[total_index] = 0.0; StiffMatrix.DeleteValsRowi(total_index); @@ -1682,7 +1763,7 @@ void CVolumetricMovement::SetBoundaryDisplacements(CGeometry *geometry, CConfig iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); VarCoord = geometry->vertex[iMarker][iVertex]->GetVarCoord(); for (iDim = 0; iDim < nDim; iDim++) { - total_index = iPoint*nDim + iDim; + total_index = iPoint * nDim + iDim; LinSysRes[total_index] = SU2_TYPE::GetValue(VarCoord[iDim] * VarIncrement); LinSysSol[total_index] = SU2_TYPE::GetValue(VarCoord[iDim] * VarIncrement); StiffMatrix.DeleteValsRowi(total_index); @@ -1690,14 +1771,14 @@ void CVolumetricMovement::SetBoundaryDisplacements(CGeometry *geometry, CConfig } } } - } -void CVolumetricMovement::SetBoundaryDerivatives(CGeometry *geometry, CConfig *config, bool ForwardProjectionDerivative) { +void CVolumetricMovement::SetBoundaryDerivatives(CGeometry* geometry, CConfig* config, + bool ForwardProjectionDerivative) { unsigned short iDim, iMarker; unsigned long iPoint, total_index, iVertex; - su2double * VarCoord; + su2double* VarCoord; SU2_COMPONENT Kind_SU2 = config->GetKind_SU2(); if ((config->GetDirectDiff() == D_DESIGN) && (Kind_SU2 == SU2_COMPONENT::SU2_CFD)) { for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { @@ -1706,7 +1787,7 @@ void CVolumetricMovement::SetBoundaryDerivatives(CGeometry *geometry, CConfig *c iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); VarCoord = geometry->vertex[iMarker][iVertex]->GetVarCoord(); for (iDim = 0; iDim < nDim; iDim++) { - total_index = iPoint*nDim + iDim; + total_index = iPoint * nDim + iDim; LinSysRes[total_index] = SU2_TYPE::GetDerivative(VarCoord[iDim]); LinSysSol[total_index] = SU2_TYPE::GetDerivative(VarCoord[iDim]); } @@ -1714,11 +1795,10 @@ void CVolumetricMovement::SetBoundaryDerivatives(CGeometry *geometry, CConfig *c } } if (LinSysRes.norm() == 0.0) cout << "Warning: Derivatives are zero!" << endl; - } else if ((Kind_SU2 == SU2_COMPONENT::SU2_DOT) && !ForwardProjectionDerivative ) { - + } else if ((Kind_SU2 == SU2_COMPONENT::SU2_DOT) && !ForwardProjectionDerivative) { for (iPoint = 0; iPoint < nPoint; iPoint++) { for (iDim = 0; iDim < nDim; iDim++) { - total_index = iPoint*nDim + iDim; + total_index = iPoint * nDim + iDim; LinSysRes[total_index] = SU2_TYPE::GetValue(geometry->GetSensitivity(iPoint, iDim)); LinSysSol[total_index] = SU2_TYPE::GetValue(geometry->GetSensitivity(iPoint, iDim)); } @@ -1729,7 +1809,7 @@ void CVolumetricMovement::SetBoundaryDerivatives(CGeometry *geometry, CConfig *c for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); for (iDim = 0; iDim < nDim; iDim++) { - total_index = iPoint*nDim + iDim; + total_index = iPoint * nDim + iDim; LinSysRes[total_index] = SU2_TYPE::GetValue(geometry->GetSensitivity(iPoint, iDim)); LinSysSol[total_index] = SU2_TYPE::GetValue(geometry->GetSensitivity(iPoint, iDim)); } @@ -1740,10 +1820,11 @@ void CVolumetricMovement::SetBoundaryDerivatives(CGeometry *geometry, CConfig *c } } -void CVolumetricMovement::UpdateGridCoord_Derivatives(CGeometry *geometry, CConfig *config, bool ForwardProjectionDerivative) { +void CVolumetricMovement::UpdateGridCoord_Derivatives(CGeometry* geometry, CConfig* config, + bool ForwardProjectionDerivative) { unsigned short iDim, iMarker; unsigned long iPoint, total_index, iVertex; - su2double *new_coord = new su2double[3]; + auto* new_coord = new su2double[3]; SU2_COMPONENT Kind_SU2 = config->GetKind_SU2(); @@ -1751,9 +1832,11 @@ void CVolumetricMovement::UpdateGridCoord_Derivatives(CGeometry *geometry, CConf after grid deformation (LinSysSol contains the derivatives of the x, y, z displacements). ---*/ if ((config->GetDirectDiff() == D_DESIGN) && (Kind_SU2 == SU2_COMPONENT::SU2_CFD)) { for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) { - new_coord[0] = 0.0; new_coord[1] = 0.0; new_coord[2] = 0.0; + new_coord[0] = 0.0; + new_coord[1] = 0.0; + new_coord[2] = 0.0; for (iDim = 0; iDim < nDim; iDim++) { - total_index = iPoint*nDim + iDim; + total_index = iPoint * nDim + iDim; new_coord[iDim] = geometry->nodes->GetCoord(iPoint, iDim); SU2_TYPE::SetDerivative(new_coord[iDim], SU2_TYPE::GetValue(LinSysSol[total_index])); } @@ -1764,19 +1847,19 @@ void CVolumetricMovement::UpdateGridCoord_Derivatives(CGeometry *geometry, CConf if (config->GetSmoothGradient()) { for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) { for (iDim = 0; iDim < nDim; iDim++) { - total_index = iPoint*nDim + iDim; - geometry->SetSensitivity(iPoint,iDim, 0.0); + total_index = iPoint * nDim + iDim; + geometry->SetSensitivity(iPoint, iDim, 0.0); } } } for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if(config->GetSolid_Wall(iMarker) || (config->GetMarker_All_DV(iMarker) == YES)) { + if (config->GetSolid_Wall(iMarker) || (config->GetMarker_All_DV(iMarker) == YES)) { for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); if (geometry->nodes->GetDomain(iPoint)) { for (iDim = 0; iDim < nDim; iDim++) { - total_index = iPoint*nDim + iDim; - geometry->SetSensitivity(iPoint,iDim, LinSysSol[total_index]); + total_index = iPoint * nDim + iDim; + geometry->SetSensitivity(iPoint, iDim, LinSysSol[total_index]); } } } @@ -1785,22 +1868,20 @@ void CVolumetricMovement::UpdateGridCoord_Derivatives(CGeometry *geometry, CConf } else if (config->GetSmoothGradient() && ForwardProjectionDerivative) { for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) { for (iDim = 0; iDim < nDim; iDim++) { - total_index = iPoint*nDim + iDim; - geometry->SetSensitivity(iPoint,iDim, LinSysSol[total_index]); + total_index = iPoint * nDim + iDim; + geometry->SetSensitivity(iPoint, iDim, LinSysSol[total_index]); } } } - delete [] new_coord; + delete[] new_coord; } -void CVolumetricMovement::SetDomainDisplacements(CGeometry *geometry, CConfig *config) { - +void CVolumetricMovement::SetDomainDisplacements(CGeometry* geometry, CConfig* config) { unsigned short iDim, nDim = geometry->GetnDim(); unsigned long iPoint, total_index; if (config->GetHold_GridFixed()) { - auto MinCoordValues = config->GetHold_GridFixed_Coord(); auto MaxCoordValues = &config->GetHold_GridFixed_Coord()[3]; @@ -1811,7 +1892,7 @@ void CVolumetricMovement::SetDomainDisplacements(CGeometry *geometry, CConfig *c auto Coord = geometry->nodes->GetCoord(iPoint); for (iDim = 0; iDim < nDim; iDim++) { if ((Coord[iDim] < MinCoordValues[iDim]) || (Coord[iDim] > MaxCoordValues[iDim])) { - total_index = iPoint*nDim + iDim; + total_index = iPoint * nDim + iDim; LinSysRes[total_index] = 0.0; LinSysSol[total_index] = 0.0; StiffMatrix.DeleteValsRowi(total_index); @@ -1827,7 +1908,7 @@ void CVolumetricMovement::SetDomainDisplacements(CGeometry *geometry, CConfig *c for (iPoint = 0; iPoint < nPoint; iPoint++) { if (geometry->nodes->GetWall_Distance(iPoint) >= config->GetDeform_Limit()) { for (iDim = 0; iDim < nDim; iDim++) { - total_index = iPoint*nDim + iDim; + total_index = iPoint * nDim + iDim; LinSysRes[total_index] = 0.0; LinSysSol[total_index] = 0.0; StiffMatrix.DeleteValsRowi(total_index); @@ -1835,20 +1916,18 @@ void CVolumetricMovement::SetDomainDisplacements(CGeometry *geometry, CConfig *c } } } - } -void CVolumetricMovement::Rigid_Rotation(CGeometry *geometry, CConfig *config, - unsigned short iZone, unsigned long iter) { - +void CVolumetricMovement::Rigid_Rotation(CGeometry* geometry, CConfig* config, unsigned short iZone, + unsigned long iter) { /*--- Local variables ---*/ unsigned short iDim, nDim; unsigned long iPoint; - su2double r[3] = {0.0,0.0,0.0}, rotCoord[3] = {0.0,0.0,0.0}, *Coord; - su2double Center[3] = {0.0,0.0,0.0}, Omega[3] = {0.0,0.0,0.0}, Lref; - su2double dt, Center_Moment[3] = {0.0,0.0,0.0}; - su2double *GridVel, newGridVel[3] = {0.0,0.0,0.0}; - su2double rotMatrix[3][3] = {{0.0,0.0,0.0}, {0.0,0.0,0.0}, {0.0,0.0,0.0}}; + su2double r[3] = {0.0, 0.0, 0.0}, rotCoord[3] = {0.0, 0.0, 0.0}, *Coord; + su2double Center[3] = {0.0, 0.0, 0.0}, Omega[3] = {0.0, 0.0, 0.0}, Lref; + su2double dt, Center_Moment[3] = {0.0, 0.0, 0.0}; + su2double *GridVel, newGridVel[3] = {0.0, 0.0, 0.0}; + su2double rotMatrix[3][3] = {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}}; su2double dtheta, dphi, dpsi, cosTheta, sinTheta; su2double cosPhi, sinPhi, cosPsi, sinPsi; bool harmonic_balance = (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE); @@ -1856,15 +1935,16 @@ void CVolumetricMovement::Rigid_Rotation(CGeometry *geometry, CConfig *config, /*--- Problem dimension and physical time step ---*/ nDim = geometry->GetnDim(); - dt = config->GetDelta_UnstTimeND(); + dt = config->GetDelta_UnstTimeND(); Lref = config->GetLength_Ref(); /*--- For the unsteady adjoint, use reverse time ---*/ if (adjoint) { /*--- Set the first adjoint mesh position to the final direct one ---*/ - if (iter == 0) dt = ((su2double)config->GetnTime_Iter()-1)*dt; + if (iter == 0) dt = ((su2double)config->GetnTime_Iter() - 1) * dt; /*--- Reverse the rotation direction for the adjoint ---*/ - else dt = -1.0*dt; + else + dt = -1.0 * dt; } else { /*--- No rotation at all for the first direct solution ---*/ if (iter == 0) dt = 0; @@ -1872,9 +1952,9 @@ void CVolumetricMovement::Rigid_Rotation(CGeometry *geometry, CConfig *config, /*--- Center of rotation & angular velocity vector from config ---*/ - for (iDim = 0; iDim < 3; iDim++){ + for (iDim = 0; iDim < 3; iDim++) { Center[iDim] = config->GetMotion_Origin(iDim); - Omega[iDim] = config->GetRotation_Rate(iDim)/config->GetOmega_Ref(); + Omega[iDim] = config->GetRotation_Rate(iDim) / config->GetOmega_Ref(); } /*-- Set dt for harmonic balance cases ---*/ @@ -1882,14 +1962,14 @@ void CVolumetricMovement::Rigid_Rotation(CGeometry *geometry, CConfig *config, /*--- period of oscillation & compute time interval using nTimeInstances ---*/ su2double period = config->GetHarmonicBalance_Period(); period /= config->GetTime_Ref(); - dt = period * (su2double)iter/(su2double)(config->GetnTimeInstances()); + dt = period * (su2double)iter / (su2double)(config->GetnTimeInstances()); } /*--- Compute delta change in the angle about the x, y, & z axes. ---*/ - dtheta = Omega[0]*dt; - dphi = Omega[1]*dt; - dpsi = Omega[2]*dt; + dtheta = Omega[0] * dt; + dphi = Omega[1] * dt; + dpsi = Omega[2] * dt; if (rank == MASTER_NODE && iter == 0) { cout << " Angular velocity: (" << Omega[0] << ", " << Omega[1]; @@ -1898,56 +1978,53 @@ void CVolumetricMovement::Rigid_Rotation(CGeometry *geometry, CConfig *config, /*--- Store angles separately for clarity. Compute sines/cosines. ---*/ - cosTheta = cos(dtheta); cosPhi = cos(dphi); cosPsi = cos(dpsi); - sinTheta = sin(dtheta); sinPhi = sin(dphi); sinPsi = sin(dpsi); + cosTheta = cos(dtheta); + cosPhi = cos(dphi); + cosPsi = cos(dpsi); + sinTheta = sin(dtheta); + sinPhi = sin(dphi); + sinPsi = sin(dpsi); /*--- Compute the rotation matrix. Note that the implicit ordering is rotation about the x-axis, y-axis, then z-axis. ---*/ - rotMatrix[0][0] = cosPhi*cosPsi; - rotMatrix[1][0] = cosPhi*sinPsi; + rotMatrix[0][0] = cosPhi * cosPsi; + rotMatrix[1][0] = cosPhi * sinPsi; rotMatrix[2][0] = -sinPhi; - rotMatrix[0][1] = sinTheta*sinPhi*cosPsi - cosTheta*sinPsi; - rotMatrix[1][1] = sinTheta*sinPhi*sinPsi + cosTheta*cosPsi; - rotMatrix[2][1] = sinTheta*cosPhi; + rotMatrix[0][1] = sinTheta * sinPhi * cosPsi - cosTheta * sinPsi; + rotMatrix[1][1] = sinTheta * sinPhi * sinPsi + cosTheta * cosPsi; + rotMatrix[2][1] = sinTheta * cosPhi; - rotMatrix[0][2] = cosTheta*sinPhi*cosPsi + sinTheta*sinPsi; - rotMatrix[1][2] = cosTheta*sinPhi*sinPsi - sinTheta*cosPsi; - rotMatrix[2][2] = cosTheta*cosPhi; + rotMatrix[0][2] = cosTheta * sinPhi * cosPsi + sinTheta * sinPsi; + rotMatrix[1][2] = cosTheta * sinPhi * sinPsi - sinTheta * cosPsi; + rotMatrix[2][2] = cosTheta * cosPhi; /*--- Loop over and rotate each node in the volume mesh ---*/ for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) { - /*--- Coordinates of the current point ---*/ - Coord = geometry->nodes->GetCoord(iPoint); + Coord = geometry->nodes->GetCoord(iPoint); GridVel = geometry->nodes->GetGridVel(iPoint); /*--- Calculate non-dim. position from rotation center ---*/ - r[0] = (Coord[0]-Center[0])/Lref; - r[1] = (Coord[1]-Center[1])/Lref; - if (nDim == 3) r[2] = (Coord[2]-Center[2])/Lref; + r[0] = (Coord[0] - Center[0]) / Lref; + r[1] = (Coord[1] - Center[1]) / Lref; + if (nDim == 3) r[2] = (Coord[2] - Center[2]) / Lref; /*--- Compute transformed point coordinates ---*/ - rotCoord[0] = rotMatrix[0][0]*r[0] - + rotMatrix[0][1]*r[1] - + rotMatrix[0][2]*r[2]; + rotCoord[0] = rotMatrix[0][0] * r[0] + rotMatrix[0][1] * r[1] + rotMatrix[0][2] * r[2]; - rotCoord[1] = rotMatrix[1][0]*r[0] - + rotMatrix[1][1]*r[1] - + rotMatrix[1][2]*r[2]; + rotCoord[1] = rotMatrix[1][0] * r[0] + rotMatrix[1][1] * r[1] + rotMatrix[1][2] * r[2]; - rotCoord[2] = rotMatrix[2][0]*r[0] - + rotMatrix[2][1]*r[1] - + rotMatrix[2][2]*r[2]; + rotCoord[2] = rotMatrix[2][0] * r[0] + rotMatrix[2][1] * r[1] + rotMatrix[2][2] * r[2]; /*--- Cross Product of angular velocity and distance from center. Note that we have assumed the grid velocities have been set to an initial value in the plunging routine. ---*/ - newGridVel[0] = GridVel[0] + Omega[1]*rotCoord[2] - Omega[2]*rotCoord[1]; - newGridVel[1] = GridVel[1] + Omega[2]*rotCoord[0] - Omega[0]*rotCoord[2]; - if (nDim == 3) newGridVel[2] = GridVel[2] + Omega[0]*rotCoord[1] - Omega[1]*rotCoord[0]; + newGridVel[0] = GridVel[0] + Omega[1] * rotCoord[2] - Omega[2] * rotCoord[1]; + newGridVel[1] = GridVel[1] + Omega[2] * rotCoord[0] - Omega[0] * rotCoord[2]; + if (nDim == 3) newGridVel[2] = GridVel[2] + Omega[0] * rotCoord[1] - Omega[1] * rotCoord[0]; /*--- Store new node location & grid velocity. Add center. Do not store the grid velocity if this is an adjoint calculation.---*/ @@ -1955,61 +2032,51 @@ void CVolumetricMovement::Rigid_Rotation(CGeometry *geometry, CConfig *config, for (iDim = 0; iDim < nDim; iDim++) { geometry->nodes->SetCoord(iPoint, iDim, rotCoord[iDim] + Center[iDim]); if (!adjoint) geometry->nodes->SetGridVel(iPoint, iDim, newGridVel[iDim]); - } } /*--- Set the moment computation center to the new location after incrementing the position with the rotation. ---*/ - for (unsigned short jMarker=0; jMarkerGetnMarker_Monitoring(); jMarker++) { - + for (unsigned short jMarker = 0; jMarker < config->GetnMarker_Monitoring(); jMarker++) { Center_Moment[0] = config->GetRefOriginMoment_X(jMarker); Center_Moment[1] = config->GetRefOriginMoment_Y(jMarker); Center_Moment[2] = config->GetRefOriginMoment_Z(jMarker); /*--- Calculate non-dim. position from rotation center ---*/ - for (iDim = 0; iDim < nDim; iDim++) - r[iDim] = (Center_Moment[iDim]-Center[iDim])/Lref; + for (iDim = 0; iDim < nDim; iDim++) r[iDim] = (Center_Moment[iDim] - Center[iDim]) / Lref; if (nDim == 2) r[nDim] = 0.0; /*--- Compute transformed point coordinates ---*/ - rotCoord[0] = rotMatrix[0][0]*r[0] - + rotMatrix[0][1]*r[1] - + rotMatrix[0][2]*r[2]; + rotCoord[0] = rotMatrix[0][0] * r[0] + rotMatrix[0][1] * r[1] + rotMatrix[0][2] * r[2]; - rotCoord[1] = rotMatrix[1][0]*r[0] - + rotMatrix[1][1]*r[1] - + rotMatrix[1][2]*r[2]; + rotCoord[1] = rotMatrix[1][0] * r[0] + rotMatrix[1][1] * r[1] + rotMatrix[1][2] * r[2]; - rotCoord[2] = rotMatrix[2][0]*r[0] - + rotMatrix[2][1]*r[1] - + rotMatrix[2][2]*r[2]; + rotCoord[2] = rotMatrix[2][0] * r[0] + rotMatrix[2][1] * r[1] + rotMatrix[2][2] * r[2]; - config->SetRefOriginMoment_X(jMarker, Center[0]+rotCoord[0]); - config->SetRefOriginMoment_Y(jMarker, Center[1]+rotCoord[1]); - config->SetRefOriginMoment_Z(jMarker, Center[2]+rotCoord[2]); + config->SetRefOriginMoment_X(jMarker, Center[0] + rotCoord[0]); + config->SetRefOriginMoment_Y(jMarker, Center[1] + rotCoord[1]); + config->SetRefOriginMoment_Z(jMarker, Center[2] + rotCoord[2]); } /*--- After moving all nodes, update geometry class ---*/ UpdateDualGrid(geometry, config); - } -void CVolumetricMovement::Rigid_Pitching(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter) { - +void CVolumetricMovement::Rigid_Pitching(CGeometry* geometry, CConfig* config, unsigned short iZone, + unsigned long iter) { /*--- Local variables ---*/ - su2double r[3] = {0.0,0.0,0.0}, rotCoord[3] = {0.0,0.0,0.0}, *Coord, Center[3] = {0.0,0.0,0.0}, - Omega[3] = {0.0,0.0,0.0}, Ampl[3] = {0.0,0.0,0.0}, Phase[3] = {0.0,0.0,0.0}; - su2double Lref, deltaT, alphaDot[3], *GridVel, newGridVel[3] = {0.0,0.0,0.0}; - su2double rotMatrix[3][3] = {{0.0,0.0,0.0}, {0.0,0.0,0.0}, {0.0,0.0,0.0}}; + su2double r[3] = {0.0, 0.0, 0.0}, rotCoord[3] = {0.0, 0.0, 0.0}, *Coord, Center[3] = {0.0, 0.0, 0.0}, + Omega[3] = {0.0, 0.0, 0.0}, Ampl[3] = {0.0, 0.0, 0.0}, Phase[3] = {0.0, 0.0, 0.0}; + su2double Lref, deltaT, alphaDot[3], *GridVel, newGridVel[3] = {0.0, 0.0, 0.0}; + su2double rotMatrix[3][3] = {{0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0}}; su2double dtheta, dphi, dpsi, cosTheta, sinTheta; su2double cosPhi, sinPhi, cosPsi, sinPsi; su2double time_new, time_old; - su2double DEG2RAD = PI_NUMBER/180.0; + su2double DEG2RAD = PI_NUMBER / 180.0; unsigned short iDim; unsigned short nDim = geometry->GetnDim(); unsigned long iPoint; @@ -2018,127 +2085,122 @@ void CVolumetricMovement::Rigid_Pitching(CGeometry *geometry, CConfig *config, u /*--- Retrieve values from the config file ---*/ deltaT = config->GetDelta_UnstTimeND(); - Lref = config->GetLength_Ref(); + Lref = config->GetLength_Ref(); /*--- Pitching origin, frequency, and amplitude from config. ---*/ - for (iDim = 0; iDim < 3; iDim++){ + for (iDim = 0; iDim < 3; iDim++) { Center[iDim] = config->GetMotion_Origin(iDim); - Omega[iDim] = config->GetPitching_Omega(iDim)/config->GetOmega_Ref(); - Ampl[iDim] = config->GetPitching_Ampl(iDim)*DEG2RAD; - Phase[iDim] = config->GetPitching_Phase(iDim)*DEG2RAD; + Omega[iDim] = config->GetPitching_Omega(iDim) / config->GetOmega_Ref(); + Ampl[iDim] = config->GetPitching_Ampl(iDim) * DEG2RAD; + Phase[iDim] = config->GetPitching_Phase(iDim) * DEG2RAD; } - if (harmonic_balance) { /*--- period of oscillation & compute time interval using nTimeInstances ---*/ su2double period = config->GetHarmonicBalance_Period(); period /= config->GetTime_Ref(); - deltaT = period/(su2double)(config->GetnTimeInstances()); + deltaT = period / (su2double)(config->GetnTimeInstances()); } /*--- Compute delta time based on physical time step ---*/ if (adjoint) { /*--- For the unsteady adjoint, we integrate backwards through physical time, so perform mesh motion in reverse. ---*/ - unsigned long nFlowIter = config->GetnTime_Iter(); + unsigned long nFlowIter = config->GetnTime_Iter(); unsigned long directIter = nFlowIter - iter - 1; - time_new = static_cast(directIter)*deltaT; + time_new = static_cast(directIter) * deltaT; time_old = time_new; - if (iter != 0) time_old = (static_cast(directIter)+1.0)*deltaT; + if (iter != 0) time_old = (static_cast(directIter) + 1.0) * deltaT; } else { /*--- Forward time for the direct problem ---*/ - time_new = static_cast(iter)*deltaT; + time_new = static_cast(iter) * deltaT; if (harmonic_balance) { /*--- For harmonic balance, begin movement from the zero position ---*/ time_old = 0.0; } else { time_old = time_new; - if (iter != 0) time_old = (static_cast(iter)-1.0)*deltaT; + if (iter != 0) time_old = (static_cast(iter) - 1.0) * deltaT; } } /*--- Compute delta change in the angle about the x, y, & z axes. ---*/ - dtheta = -Ampl[0]*(sin(Omega[0]*time_new + Phase[0]) - sin(Omega[0]*time_old + Phase[0])); - dphi = -Ampl[1]*(sin(Omega[1]*time_new + Phase[1]) - sin(Omega[1]*time_old + Phase[1])); - dpsi = -Ampl[2]*(sin(Omega[2]*time_new + Phase[2]) - sin(Omega[2]*time_old + Phase[2])); + dtheta = -Ampl[0] * (sin(Omega[0] * time_new + Phase[0]) - sin(Omega[0] * time_old + Phase[0])); + dphi = -Ampl[1] * (sin(Omega[1] * time_new + Phase[1]) - sin(Omega[1] * time_old + Phase[1])); + dpsi = -Ampl[2] * (sin(Omega[2] * time_new + Phase[2]) - sin(Omega[2] * time_old + Phase[2])); /*--- Angular velocity at the new time ---*/ - alphaDot[0] = -Omega[0]*Ampl[0]*cos(Omega[0]*time_new + Phase[0]); - alphaDot[1] = -Omega[1]*Ampl[1]*cos(Omega[1]*time_new + Phase[1]); - alphaDot[2] = -Omega[2]*Ampl[2]*cos(Omega[2]*time_new + Phase[2]); + alphaDot[0] = -Omega[0] * Ampl[0] * cos(Omega[0] * time_new + Phase[0]); + alphaDot[1] = -Omega[1] * Ampl[1] * cos(Omega[1] * time_new + Phase[1]); + alphaDot[2] = -Omega[2] * Ampl[2] * cos(Omega[2] * time_new + Phase[2]); if (rank == MASTER_NODE && iter == 0) { - cout << " Pitching frequency: (" << Omega[0] << ", " << Omega[1]; - cout << ", " << Omega[2] << ") rad/s." << endl; - cout << " Pitching amplitude: (" << Ampl[0]/DEG2RAD << ", "; - cout << Ampl[1]/DEG2RAD << ", " << Ampl[2]/DEG2RAD; - cout << ") degrees."<< endl; - cout << " Pitching phase lag: (" << Phase[0]/DEG2RAD << ", "; - cout << Phase[1]/DEG2RAD <<", "<< Phase[2]/DEG2RAD; - cout << ") degrees."<< endl; + cout << " Pitching frequency: (" << Omega[0] << ", " << Omega[1]; + cout << ", " << Omega[2] << ") rad/s." << endl; + cout << " Pitching amplitude: (" << Ampl[0] / DEG2RAD << ", "; + cout << Ampl[1] / DEG2RAD << ", " << Ampl[2] / DEG2RAD; + cout << ") degrees." << endl; + cout << " Pitching phase lag: (" << Phase[0] / DEG2RAD << ", "; + cout << Phase[1] / DEG2RAD << ", " << Phase[2] / DEG2RAD; + cout << ") degrees." << endl; } /*--- Store angles separately for clarity. Compute sines/cosines. ---*/ - cosTheta = cos(dtheta); cosPhi = cos(dphi); cosPsi = cos(dpsi); - sinTheta = sin(dtheta); sinPhi = sin(dphi); sinPsi = sin(dpsi); + cosTheta = cos(dtheta); + cosPhi = cos(dphi); + cosPsi = cos(dpsi); + sinTheta = sin(dtheta); + sinPhi = sin(dphi); + sinPsi = sin(dpsi); /*--- Compute the rotation matrix. Note that the implicit ordering is rotation about the x-axis, y-axis, then z-axis. ---*/ - rotMatrix[0][0] = cosPhi*cosPsi; - rotMatrix[1][0] = cosPhi*sinPsi; + rotMatrix[0][0] = cosPhi * cosPsi; + rotMatrix[1][0] = cosPhi * sinPsi; rotMatrix[2][0] = -sinPhi; - rotMatrix[0][1] = sinTheta*sinPhi*cosPsi - cosTheta*sinPsi; - rotMatrix[1][1] = sinTheta*sinPhi*sinPsi + cosTheta*cosPsi; - rotMatrix[2][1] = sinTheta*cosPhi; + rotMatrix[0][1] = sinTheta * sinPhi * cosPsi - cosTheta * sinPsi; + rotMatrix[1][1] = sinTheta * sinPhi * sinPsi + cosTheta * cosPsi; + rotMatrix[2][1] = sinTheta * cosPhi; - rotMatrix[0][2] = cosTheta*sinPhi*cosPsi + sinTheta*sinPsi; - rotMatrix[1][2] = cosTheta*sinPhi*sinPsi - sinTheta*cosPsi; - rotMatrix[2][2] = cosTheta*cosPhi; + rotMatrix[0][2] = cosTheta * sinPhi * cosPsi + sinTheta * sinPsi; + rotMatrix[1][2] = cosTheta * sinPhi * sinPsi - sinTheta * cosPsi; + rotMatrix[2][2] = cosTheta * cosPhi; /*--- Loop over and rotate each node in the volume mesh ---*/ for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) { - /*--- Coordinates of the current point ---*/ - Coord = geometry->nodes->GetCoord(iPoint); + Coord = geometry->nodes->GetCoord(iPoint); GridVel = geometry->nodes->GetGridVel(iPoint); /*--- Calculate non-dim. position from rotation center ---*/ - for (iDim = 0; iDim < nDim; iDim++) - r[iDim] = (Coord[iDim]-Center[iDim])/Lref; + for (iDim = 0; iDim < nDim; iDim++) r[iDim] = (Coord[iDim] - Center[iDim]) / Lref; if (nDim == 2) r[nDim] = 0.0; /*--- Compute transformed point coordinates ---*/ - rotCoord[0] = rotMatrix[0][0]*r[0] - + rotMatrix[0][1]*r[1] - + rotMatrix[0][2]*r[2]; + rotCoord[0] = rotMatrix[0][0] * r[0] + rotMatrix[0][1] * r[1] + rotMatrix[0][2] * r[2]; - rotCoord[1] = rotMatrix[1][0]*r[0] - + rotMatrix[1][1]*r[1] - + rotMatrix[1][2]*r[2]; + rotCoord[1] = rotMatrix[1][0] * r[0] + rotMatrix[1][1] * r[1] + rotMatrix[1][2] * r[2]; - rotCoord[2] = rotMatrix[2][0]*r[0] - + rotMatrix[2][1]*r[1] - + rotMatrix[2][2]*r[2]; + rotCoord[2] = rotMatrix[2][0] * r[0] + rotMatrix[2][1] * r[1] + rotMatrix[2][2] * r[2]; /*--- Cross Product of angular velocity and distance from center. Note that we have assumed the grid velocities have been set to an initial value in the plunging routine. ---*/ - newGridVel[0] = GridVel[0] + alphaDot[1]*rotCoord[2] - alphaDot[2]*rotCoord[1]; - newGridVel[1] = GridVel[1] + alphaDot[2]*rotCoord[0] - alphaDot[0]*rotCoord[2]; - if (nDim == 3) newGridVel[2] = GridVel[2] + alphaDot[0]*rotCoord[1] - alphaDot[1]*rotCoord[0]; + newGridVel[0] = GridVel[0] + alphaDot[1] * rotCoord[2] - alphaDot[2] * rotCoord[1]; + newGridVel[1] = GridVel[1] + alphaDot[2] * rotCoord[0] - alphaDot[0] * rotCoord[2]; + if (nDim == 3) newGridVel[2] = GridVel[2] + alphaDot[0] * rotCoord[1] - alphaDot[1] * rotCoord[0]; /*--- Store new node location & grid velocity. Add center location. Do not store the grid velocity if this is an adjoint calculation.---*/ for (iDim = 0; iDim < nDim; iDim++) { - geometry->nodes->SetCoord(iPoint, iDim, rotCoord[iDim]+Center[iDim]); + geometry->nodes->SetCoord(iPoint, iDim, rotCoord[iDim] + Center[iDim]); if (!adjoint) geometry->nodes->SetGridVel(iPoint, iDim, newGridVel[iDim]); } } @@ -2148,11 +2210,10 @@ void CVolumetricMovement::Rigid_Pitching(CGeometry *geometry, CConfig *config, u /*--- After moving all nodes, update geometry class ---*/ UpdateDualGrid(geometry, config); - } -void CVolumetricMovement::Rigid_Plunging(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter) { - +void CVolumetricMovement::Rigid_Plunging(CGeometry* geometry, CConfig* config, unsigned short iZone, + unsigned long iter) { /*--- Local variables ---*/ su2double deltaX[3], newCoord[3] = {0.0, 0.0, 0.0}, Center[3], *Coord, Omega[3], Ampl[3], Lref; su2double *GridVel, newGridVel[3] = {0.0, 0.0, 0.0}, xDot[3]; @@ -2164,12 +2225,12 @@ void CVolumetricMovement::Rigid_Plunging(CGeometry *geometry, CConfig *config, u /*--- Retrieve values from the config file ---*/ deltaT = config->GetDelta_UnstTimeND(); - Lref = config->GetLength_Ref(); + Lref = config->GetLength_Ref(); - for (iDim = 0; iDim < 3; iDim++){ + for (iDim = 0; iDim < 3; iDim++) { Center[iDim] = config->GetMotion_Origin(iDim); - Omega[iDim] = config->GetPlunging_Omega(iDim)/config->GetOmega_Ref(); - Ampl[iDim] = config->GetPlunging_Ampl(iDim)/Lref; + Omega[iDim] = config->GetPlunging_Omega(iDim) / config->GetOmega_Ref(); + Ampl[iDim] = config->GetPlunging_Ampl(iDim) / Lref; } /*--- Plunging frequency and amplitude from config. ---*/ @@ -2178,57 +2239,55 @@ void CVolumetricMovement::Rigid_Plunging(CGeometry *geometry, CConfig *config, u /*--- period of oscillation & time interval using nTimeInstances ---*/ su2double period = config->GetHarmonicBalance_Period(); period /= config->GetTime_Ref(); - deltaT = period/(su2double)(config->GetnTimeInstances()); + deltaT = period / (su2double)(config->GetnTimeInstances()); } /*--- Compute delta time based on physical time step ---*/ if (adjoint) { /*--- For the unsteady adjoint, we integrate backwards through physical time, so perform mesh motion in reverse. ---*/ - unsigned long nFlowIter = config->GetnTime_Iter(); + unsigned long nFlowIter = config->GetnTime_Iter(); unsigned long directIter = nFlowIter - iter - 1; - time_new = static_cast(directIter)*deltaT; + time_new = static_cast(directIter) * deltaT; time_old = time_new; - if (iter != 0) time_old = (static_cast(directIter)+1.0)*deltaT; + if (iter != 0) time_old = (static_cast(directIter) + 1.0) * deltaT; } else { /*--- Forward time for the direct problem ---*/ - time_new = static_cast(iter)*deltaT; + time_new = static_cast(iter) * deltaT; if (harmonic_balance) { /*--- For harmonic balance, begin movement from the zero position ---*/ time_old = 0.0; } else { time_old = time_new; - if (iter != 0) time_old = (static_cast(iter)-1.0)*deltaT; + if (iter != 0) time_old = (static_cast(iter) - 1.0) * deltaT; } } /*--- Compute delta change in the position in the x, y, & z directions. ---*/ - deltaX[0] = -Ampl[0]*(sin(Omega[0]*time_new) - sin(Omega[0]*time_old)); - deltaX[1] = -Ampl[1]*(sin(Omega[1]*time_new) - sin(Omega[1]*time_old)); - deltaX[2] = -Ampl[2]*(sin(Omega[2]*time_new) - sin(Omega[2]*time_old)); + deltaX[0] = -Ampl[0] * (sin(Omega[0] * time_new) - sin(Omega[0] * time_old)); + deltaX[1] = -Ampl[1] * (sin(Omega[1] * time_new) - sin(Omega[1] * time_old)); + deltaX[2] = -Ampl[2] * (sin(Omega[2] * time_new) - sin(Omega[2] * time_old)); /*--- Compute grid velocity due to plunge in the x, y, & z directions. ---*/ - xDot[0] = -Ampl[0]*Omega[0]*(cos(Omega[0]*time_new)); - xDot[1] = -Ampl[1]*Omega[1]*(cos(Omega[1]*time_new)); - xDot[2] = -Ampl[2]*Omega[2]*(cos(Omega[2]*time_new)); + xDot[0] = -Ampl[0] * Omega[0] * (cos(Omega[0] * time_new)); + xDot[1] = -Ampl[1] * Omega[1] * (cos(Omega[1] * time_new)); + xDot[2] = -Ampl[2] * Omega[2] * (cos(Omega[2] * time_new)); if (rank == MASTER_NODE && iter == 0) { cout << " Plunging frequency: (" << Omega[0] << ", " << Omega[1]; cout << ", " << Omega[2] << ") rad/s." << endl; cout << " Plunging amplitude: (" << Ampl[0] << ", "; - cout << Ampl[1] << ", " << Ampl[2] << ") m."<< endl; + cout << Ampl[1] << ", " << Ampl[2] << ") m." << endl; } /*--- Loop over and move each node in the volume mesh ---*/ for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) { - /*--- Coordinates of the current point ---*/ - Coord = geometry->nodes->GetCoord(iPoint); + Coord = geometry->nodes->GetCoord(iPoint); GridVel = geometry->nodes->GetGridVel(iPoint); /*--- Increment the node position using the delta values. ---*/ - for (iDim = 0; iDim < nDim; iDim++) - newCoord[iDim] = Coord[iDim] + deltaX[iDim]; + for (iDim = 0; iDim < nDim; iDim++) newCoord[iDim] = Coord[iDim] + deltaX[iDim]; /*--- Cross Product of angular velocity and distance from center. Note that we have assumed the grid velocities have been set to @@ -2236,7 +2295,7 @@ void CVolumetricMovement::Rigid_Plunging(CGeometry *geometry, CConfig *config, u newGridVel[0] = GridVel[0] + xDot[0]; newGridVel[1] = GridVel[1] + xDot[1]; - if (nDim == 3) newGridVel[2] = GridVel[2] + xDot[2]; + if (nDim == 3) newGridVel[2] = GridVel[2] + xDot[2]; /*--- Store new node location & grid velocity. Do not store the grid velocity if this is an adjoint calculation. ---*/ @@ -2251,23 +2310,23 @@ void CVolumetricMovement::Rigid_Plunging(CGeometry *geometry, CConfig *config, u incrementing the position with the rigid translation. This new location will be used for subsequent pitching/rotation.---*/ - for (iDim = 0; iDim < 3; iDim++){ + for (iDim = 0; iDim < 3; iDim++) { Center[iDim] = config->GetMotion_Origin(iDim) + deltaX[iDim]; } config->SetMotion_Origin(Center); /*--- As the body origin may have moved, print it to the console ---*/ -// if (rank == MASTER_NODE) { -// cout << " Body origin: (" << Center[0]+deltaX[0]; -// cout << ", " << Center[1]+deltaX[1] << ", " << Center[2]+deltaX[2]; -// cout << ")." << endl; -// } + // if (rank == MASTER_NODE) { + // cout << " Body origin: (" << Center[0]+deltaX[0]; + // cout << ", " << Center[1]+deltaX[1] << ", " << Center[2]+deltaX[2]; + // cout << ")." << endl; + // } /*--- Set the moment computation center to the new location after incrementing the position with the plunging. ---*/ - for (unsigned short jMarker=0; jMarkerGetnMarker_Monitoring(); jMarker++) { + for (unsigned short jMarker = 0; jMarker < config->GetnMarker_Monitoring(); jMarker++) { Center[0] = config->GetRefOriginMoment_X(jMarker) + deltaX[0]; Center[1] = config->GetRefOriginMoment_Y(jMarker) + deltaX[1]; Center[2] = config->GetRefOriginMoment_Z(jMarker) + deltaX[2]; @@ -2279,11 +2338,10 @@ void CVolumetricMovement::Rigid_Plunging(CGeometry *geometry, CConfig *config, u /*--- After moving all nodes, update geometry class ---*/ UpdateDualGrid(geometry, config); - } -void CVolumetricMovement::Rigid_Translation(CGeometry *geometry, CConfig *config, unsigned short iZone, unsigned long iter) { - +void CVolumetricMovement::Rigid_Translation(CGeometry* geometry, CConfig* config, unsigned short iZone, + unsigned long iter) { /*--- Local variables ---*/ su2double deltaX[3], newCoord[3] = {0.0, 0.0, 0.0}, Center[3], *Coord; su2double xDot[3]; @@ -2298,70 +2356,71 @@ void CVolumetricMovement::Rigid_Translation(CGeometry *geometry, CConfig *config /*--- Get motion center and translation rates from config ---*/ - for (iDim = 0; iDim < 3; iDim++){ + for (iDim = 0; iDim < 3; iDim++) { Center[iDim] = config->GetMotion_Origin(iDim); - xDot[iDim] = config->GetTranslation_Rate(iDim); + xDot[iDim] = config->GetTranslation_Rate(iDim); } if (harmonic_balance) { /*--- period of oscillation & time interval using nTimeInstances ---*/ su2double period = config->GetHarmonicBalance_Period(); period /= config->GetTime_Ref(); - deltaT = period/(su2double)(config->GetnTimeInstances()); + deltaT = period / (su2double)(config->GetnTimeInstances()); } /*--- Compute delta time based on physical time step ---*/ if (adjoint) { /*--- For the unsteady adjoint, we integrate backwards through physical time, so perform mesh motion in reverse. ---*/ - unsigned long nFlowIter = config->GetnTime_Iter(); + unsigned long nFlowIter = config->GetnTime_Iter(); unsigned long directIter = nFlowIter - iter - 1; - time_new = static_cast(directIter)*deltaT; + time_new = static_cast(directIter) * deltaT; time_old = time_new; - if (iter != 0) time_old = (static_cast(directIter)+1.0)*deltaT; + if (iter != 0) time_old = (static_cast(directIter) + 1.0) * deltaT; } else { /*--- Forward time for the direct problem ---*/ - time_new = static_cast(iter)*deltaT; + time_new = static_cast(iter) * deltaT; if (harmonic_balance) { /*--- For harmonic balance, begin movement from the zero position ---*/ time_old = 0.0; } else { time_old = time_new; - if (iter != 0) time_old = (static_cast(iter)-1.0)*deltaT; + if (iter != 0) time_old = (static_cast(iter) - 1.0) * deltaT; } } /*--- Compute delta change in the position in the x, y, & z directions. ---*/ - deltaX[0] = xDot[0]*(time_new-time_old); - deltaX[1] = xDot[1]*(time_new-time_old); - deltaX[2] = xDot[2]*(time_new-time_old); + deltaX[0] = xDot[0] * (time_new - time_old); + deltaX[1] = xDot[1] * (time_new - time_old); + deltaX[2] = xDot[2] * (time_new - time_old); if (rank == MASTER_NODE) { cout << " New physical time: " << time_new << " seconds." << endl; if (iter == 0) { - cout << " Translational velocity: (" << xDot[0]*config->GetVelocity_Ref() << ", " << xDot[1]*config->GetVelocity_Ref(); - cout << ", " << xDot[2]*config->GetVelocity_Ref(); - if (config->GetSystemMeasurements() == SI) cout << ") m/s." << endl; - else cout << ") ft/s." << endl; + cout << " Translational velocity: (" << xDot[0] * config->GetVelocity_Ref() << ", " + << xDot[1] * config->GetVelocity_Ref(); + cout << ", " << xDot[2] * config->GetVelocity_Ref(); + if (config->GetSystemMeasurements() == SI) + cout << ") m/s." << endl; + else + cout << ") ft/s." << endl; } } /*--- Loop over and move each node in the volume mesh ---*/ for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) { - /*--- Coordinates of the current point ---*/ Coord = geometry->nodes->GetCoord(iPoint); /*--- Increment the node position using the delta values. ---*/ - for (iDim = 0; iDim < nDim; iDim++) - newCoord[iDim] = Coord[iDim] + deltaX[iDim]; + for (iDim = 0; iDim < nDim; iDim++) newCoord[iDim] = Coord[iDim] + deltaX[iDim]; /*--- Store new node location & grid velocity. Do not store the grid velocity if this is an adjoint calculation. ---*/ for (iDim = 0; iDim < nDim; iDim++) { geometry->nodes->SetCoord(iPoint, iDim, newCoord[iDim]); - if (!adjoint) geometry->nodes->SetGridVel(iPoint, iDim,xDot[iDim]); + if (!adjoint) geometry->nodes->SetGridVel(iPoint, iDim, xDot[iDim]); } } @@ -2369,16 +2428,15 @@ void CVolumetricMovement::Rigid_Translation(CGeometry *geometry, CConfig *config incrementing the position with the rigid translation. This new location will be used for subsequent pitching/rotation.---*/ - for (iDim = 0; iDim < 3; iDim++){ + for (iDim = 0; iDim < 3; iDim++) { Center[iDim] = config->GetMotion_Origin(iDim) + deltaX[iDim]; } config->SetMotion_Origin(Center); - /*--- Set the moment computation center to the new location after incrementing the position with the translation. ---*/ - for (unsigned short jMarker=0; jMarkerGetnMarker_Monitoring(); jMarker++) { + for (unsigned short jMarker = 0; jMarker < config->GetnMarker_Monitoring(); jMarker++) { Center[0] = config->GetRefOriginMoment_X(jMarker) + deltaX[0]; Center[1] = config->GetRefOriginMoment_Y(jMarker) + deltaX[1]; Center[2] = config->GetRefOriginMoment_Z(jMarker) + deltaX[2]; @@ -2390,19 +2448,17 @@ void CVolumetricMovement::Rigid_Translation(CGeometry *geometry, CConfig *config /*--- After moving all nodes, update geometry class ---*/ UpdateDualGrid(geometry, config); - } -void CVolumetricMovement::SetVolume_Scaling(CGeometry *geometry, CConfig *config, bool UpdateGeo) { - +void CVolumetricMovement::SetVolume_Scaling(CGeometry* geometry, CConfig* config, bool UpdateGeo) { unsigned short iDim; unsigned long iPoint; - su2double newCoord[3] = {0.0,0.0,0.0}, *Coord; + su2double newCoord[3] = {0.0, 0.0, 0.0}, *Coord; /*--- The scaling factor is the only input to this option. Currently, the mesh must be scaled the same amount in all three directions. ---*/ - su2double Scale = config->GetDV_Value(0)*config->GetOpt_RelaxFactor(); + su2double Scale = config->GetDV_Value(0) * config->GetOpt_RelaxFactor(); if (rank == MASTER_NODE) { cout << "Scaling the mesh by a constant factor of " << Scale << "." << endl; @@ -2410,13 +2466,11 @@ void CVolumetricMovement::SetVolume_Scaling(CGeometry *geometry, CConfig *config /*--- Loop over and move each node in the volume mesh ---*/ for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) { - /*--- Coordinates of the current point ---*/ Coord = geometry->nodes->GetCoord(iPoint); /*--- Scale the node position by the specified factor. ---*/ - for (iDim = 0; iDim < nDim; iDim++) - newCoord[iDim] = Scale*Coord[iDim]; + for (iDim = 0; iDim < nDim; iDim++) newCoord[iDim] = Scale * Coord[iDim]; /*--- Store the new node location. ---*/ for (iDim = 0; iDim < nDim; iDim++) { @@ -2426,43 +2480,38 @@ void CVolumetricMovement::SetVolume_Scaling(CGeometry *geometry, CConfig *config /*--- After moving all nodes, update geometry class ---*/ if (UpdateGeo) UpdateDualGrid(geometry, config); - } -void CVolumetricMovement::SetVolume_Translation(CGeometry *geometry, CConfig *config, bool UpdateGeo) { - +void CVolumetricMovement::SetVolume_Translation(CGeometry* geometry, CConfig* config, bool UpdateGeo) { unsigned short iDim; unsigned long iPoint; - su2double *Coord, deltaX[3] = {0.0,0.0,0.0}, newCoord[3] = {0.0,0.0,0.0}; + su2double *Coord, deltaX[3] = {0.0, 0.0, 0.0}, newCoord[3] = {0.0, 0.0, 0.0}; su2double Scale = config->GetOpt_RelaxFactor(); /*--- Get the unit vector and magnitude of displacement. Note that we assume this is the first DV entry since it is for mesh translation. Create the displacement vector from the magnitude and direction. ---*/ - su2double Ampl = config->GetDV_Value(0)*Scale; + su2double Ampl = config->GetDV_Value(0) * Scale; su2double length = 0.0; for (iDim = 0; iDim < nDim; iDim++) { deltaX[iDim] = config->GetParamDV(0, iDim); - length += deltaX[iDim]*deltaX[iDim]; + length += deltaX[iDim] * deltaX[iDim]; } length = sqrt(length); - for (iDim = 0; iDim < nDim; iDim++) - deltaX[iDim] = Ampl*deltaX[iDim]/length; + for (iDim = 0; iDim < nDim; iDim++) deltaX[iDim] = Ampl * deltaX[iDim] / length; if (rank == MASTER_NODE) { cout << "Translational displacement: (" << deltaX[0] << ", "; - cout << deltaX[1] << ", " << deltaX[2] << ")." << endl; + cout << deltaX[1] << ", " << deltaX[2] << ")." << endl; } /*--- Loop over and move each node in the volume mesh ---*/ for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) { - /*--- Coordinates of the current point ---*/ Coord = geometry->nodes->GetCoord(iPoint); /*--- Increment the node position using the delta values. ---*/ - for (iDim = 0; iDim < nDim; iDim++) - newCoord[iDim] = Coord[iDim] + deltaX[iDim]; + for (iDim = 0; iDim < nDim; iDim++) newCoord[iDim] = Coord[iDim] + deltaX[iDim]; /*--- Store new node location. ---*/ for (iDim = 0; iDim < nDim; iDim++) { @@ -2472,75 +2521,78 @@ void CVolumetricMovement::SetVolume_Translation(CGeometry *geometry, CConfig *co /*--- After moving all nodes, update geometry class ---*/ if (UpdateGeo) UpdateDualGrid(geometry, config); - } -void CVolumetricMovement::SetVolume_Rotation(CGeometry *geometry, CConfig *config, bool UpdateGeo) { - +void CVolumetricMovement::SetVolume_Rotation(CGeometry* geometry, CConfig* config, bool UpdateGeo) { unsigned short iDim; unsigned long iPoint; su2double x, y, z; - su2double *Coord, deltaX[3] = {0.0,0.0,0.0}, newCoord[3] = {0.0,0.0,0.0}; + su2double *Coord, deltaX[3] = {0.0, 0.0, 0.0}, newCoord[3] = {0.0, 0.0, 0.0}; su2double Scale = config->GetOpt_RelaxFactor(); /*--- xyz-coordinates of a point on the line of rotation. */ su2double a = config->GetParamDV(0, 0); su2double b = config->GetParamDV(0, 1); su2double c = 0.0; - if (geometry->GetnDim() == 3) c = config->GetParamDV(0,2); + if (geometry->GetnDim() == 3) c = config->GetParamDV(0, 2); /*--- xyz-coordinate of the line's direction vector. ---*/ - su2double u = config->GetParamDV(0, 3)-config->GetParamDV(0, 0); - su2double v = config->GetParamDV(0, 4)-config->GetParamDV(0, 1); + su2double u = config->GetParamDV(0, 3) - config->GetParamDV(0, 0); + su2double v = config->GetParamDV(0, 4) - config->GetParamDV(0, 1); su2double w = 1.0; - if (geometry->GetnDim() == 3) - w = config->GetParamDV(0, 5)-config->GetParamDV(0, 2); + if (geometry->GetnDim() == 3) w = config->GetParamDV(0, 5) - config->GetParamDV(0, 2); /*--- The angle of rotation. ---*/ - su2double theta = config->GetDV_Value(0)*Scale*PI_NUMBER/180.0; + su2double theta = config->GetDV_Value(0) * Scale * PI_NUMBER / 180.0; /*--- Print to the console. ---*/ if (rank == MASTER_NODE) { cout << "Rotation axis vector: (" << u << ", "; cout << v << ", " << w << ")." << endl; - cout << "Angle of rotation: " << config->GetDV_Value(0)*Scale; + cout << "Angle of rotation: " << config->GetDV_Value(0) * Scale; cout << " degrees." << endl; } /*--- Intermediate values used in computations. ---*/ - su2double u2=u*u; su2double v2=v*v; su2double w2=w*w; - su2double cosT = cos(theta); su2double sinT = sin(theta); - su2double l2 = u2 + v2 + w2; su2double l = sqrt(l2); + su2double u2 = u * u; + su2double v2 = v * v; + su2double w2 = w * w; + su2double cosT = cos(theta); + su2double sinT = sin(theta); + su2double l2 = u2 + v2 + w2; + su2double l = sqrt(l2); /*--- Loop over and move each node in the volume mesh ---*/ for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) { - /*--- Coordinates of the current point ---*/ Coord = geometry->nodes->GetCoord(iPoint); /*--- Displacement for this point due to the rotation. ---*/ - x = Coord[0]; y = Coord[1]; z = 0.0; + x = Coord[0]; + y = Coord[1]; + z = 0.0; if (geometry->GetnDim() == 3) z = Coord[2]; - deltaX[0] = a*(v2 + w2) + u*(-b*v - c*w + u*x + v*y + w*z) - + (-a*(v2 + w2) + u*(b*v + c*w - v*y - w*z) + (v2 + w2)*x)*cosT - + l*(-c*v + b*w - w*y + v*z)*sinT; - deltaX[0] = deltaX[0]/l2 - x; + deltaX[0] = a * (v2 + w2) + u * (-b * v - c * w + u * x + v * y + w * z) + + (-a * (v2 + w2) + u * (b * v + c * w - v * y - w * z) + (v2 + w2) * x) * cosT + + l * (-c * v + b * w - w * y + v * z) * sinT; + deltaX[0] = deltaX[0] / l2 - x; - deltaX[1] = b*(u2 + w2) + v*(-a*u - c*w + u*x + v*y + w*z) - + (-b*(u2 + w2) + v*(a*u + c*w - u*x - w*z) + (u2 + w2)*y)*cosT - + l*(c*u - a*w + w*x - u*z)*sinT; - deltaX[1] = deltaX[1]/l2 - y; + deltaX[1] = b * (u2 + w2) + v * (-a * u - c * w + u * x + v * y + w * z) + + (-b * (u2 + w2) + v * (a * u + c * w - u * x - w * z) + (u2 + w2) * y) * cosT + + l * (c * u - a * w + w * x - u * z) * sinT; + deltaX[1] = deltaX[1] / l2 - y; - deltaX[2] = c*(u2 + v2) + w*(-a*u - b*v + u*x + v*y + w*z) - + (-c*(u2 + v2) + w*(a*u + b*v - u*x - v*y) + (u2 + v2)*z)*cosT - + l*(-b*u + a*v - v*x + u*y)*sinT; - if (geometry->GetnDim() == 3) deltaX[2] = deltaX[2]/l2 - z; - else deltaX[2] = 0.0; + deltaX[2] = c * (u2 + v2) + w * (-a * u - b * v + u * x + v * y + w * z) + + (-c * (u2 + v2) + w * (a * u + b * v - u * x - v * y) + (u2 + v2) * z) * cosT + + l * (-b * u + a * v - v * x + u * y) * sinT; + if (geometry->GetnDim() == 3) + deltaX[2] = deltaX[2] / l2 - z; + else + deltaX[2] = 0.0; /*--- Increment the node position using the delta values. ---*/ - for (iDim = 0; iDim < nDim; iDim++) - newCoord[iDim] = Coord[iDim] + deltaX[iDim]; + for (iDim = 0; iDim < nDim; iDim++) newCoord[iDim] = Coord[iDim] + deltaX[iDim]; /*--- Store new node location. ---*/ for (iDim = 0; iDim < nDim; iDim++) { @@ -2550,5 +2602,4 @@ void CVolumetricMovement::SetVolume_Rotation(CGeometry *geometry, CConfig *confi /*--- After moving all nodes, update geometry class ---*/ if (UpdateGeo) UpdateDualGrid(geometry, config); - } diff --git a/Common/src/interface_interpolation/CInterpolator.cpp b/Common/src/interface_interpolation/CInterpolator.cpp index 250bf916d98..3d903a0e668 100644 --- a/Common/src/interface_interpolation/CInterpolator.cpp +++ b/Common/src/interface_interpolation/CInterpolator.cpp @@ -2,7 +2,7 @@ * \file CInterpolator.cpp * \brief Definition of the base class for interface interpolation. * \author H. Kline - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -153,7 +153,6 @@ unsigned long CInterpolator::Collect_ElementInfo(int markDonor, unsigned short n } void CInterpolator::ReconstructBoundary(unsigned long val_zone, int val_marker) { - const CGeometry* geom = Geometry[val_zone][INST_0][MESH_0]; const auto nDim = geom->GetnDim(); @@ -197,7 +196,8 @@ void CInterpolator::ReconstructBoundary(unsigned long val_zone, int val_marker) if (geom->nodes->GetDomain(iPoint)) { const auto iLocalVertex = iVertex_to_iLocalVertex[iVertex]; Buffer_Send_GlobalPoint[iLocalVertex] = geom->nodes->GetGlobalIndex(iPoint); - for (unsigned long iDim = 0; iDim < nDim; iDim++) Buffer_Send_Coord(iLocalVertex,iDim) = geom->nodes->GetCoord(iPoint, iDim); + for (unsigned long iDim = 0; iDim < nDim; iDim++) + Buffer_Send_Coord(iLocalVertex, iDim) = geom->nodes->GetCoord(iPoint, iDim); neighbors.insert(pair >(iPoint, set())); } } @@ -344,7 +344,7 @@ void CInterpolator::ReconstructBoundary(unsigned long val_zone, int val_marker) * Buffer_Receive_GlobalPoint, Buffer_Receive_nLinkedNodes etc. ---*/ if (rank == MASTER_NODE) { for (unsigned long iVertex = 0; iVertex < nGlobalVertex; iVertex++) { - unsigned long *uptr = &Buffer_Receive_LinkedNodes[Buffer_Receive_StartLinkedNodes[iVertex]]; + unsigned long* uptr = &Buffer_Receive_LinkedNodes[Buffer_Receive_StartLinkedNodes[iVertex]]; for (unsigned long jLinkedNode = 0; jLinkedNode < Buffer_Receive_nLinkedNodes[iVertex]; jLinkedNode++) { const auto jPoint = uptr[jLinkedNode]; diff --git a/Common/src/interface_interpolation/CInterpolatorFactory.cpp b/Common/src/interface_interpolation/CInterpolatorFactory.cpp index 64b989981e5..09c0701aa9c 100644 --- a/Common/src/interface_interpolation/CInterpolatorFactory.cpp +++ b/Common/src/interface_interpolation/CInterpolatorFactory.cpp @@ -1,7 +1,7 @@ /*! * \file CInterpolatorFactory.cpp * \brief Factory to generate interpolator objects. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -34,11 +34,9 @@ #include "../../include/interface_interpolation/CSlidingMesh.hpp" namespace CInterpolatorFactory { -CInterpolator* CreateInterpolator(CGeometry ****geometry_container, - const CConfig* const* config, - const CInterpolator* transpInterpolator, - unsigned iZone, unsigned jZone, bool verbose) { - +CInterpolator* CreateInterpolator(CGeometry**** geometry_container, const CConfig* const* config, + const CInterpolator* transpInterpolator, unsigned iZone, unsigned jZone, + bool verbose) { CInterpolator* interpolator = nullptr; /*--- Only print information on master node. ---*/ @@ -57,30 +55,28 @@ CInterpolator* CreateInterpolator(CGeometry ****geometry_container, if (type == INTERFACE_INTERPOLATOR::WEIGHTED_AVERAGE) { if (verbose) cout << "using a sliding mesh approach." << endl; interpolator = new CSlidingMesh(geometry_container, config, iZone, jZone); - } - else if (config[jZone]->GetConservativeInterpolation()) { + } else if (config[jZone]->GetConservativeInterpolation()) { if (verbose) cout << "using the mirror approach, \"transposing\" coefficients from opposite mesh." << endl; interpolator = new CMirror(geometry_container, config, transpInterpolator, iZone, jZone); - } - else { - switch(type) { - case INTERFACE_INTERPOLATOR::ISOPARAMETRIC: - if (verbose) cout << "using the isoparametric approach." << endl; - interpolator = new CIsoparametric(geometry_container, config, iZone, jZone); - break; + } else { + switch (type) { + case INTERFACE_INTERPOLATOR::ISOPARAMETRIC: + if (verbose) cout << "using the isoparametric approach." << endl; + interpolator = new CIsoparametric(geometry_container, config, iZone, jZone); + break; - case INTERFACE_INTERPOLATOR::NEAREST_NEIGHBOR: - if (verbose) cout << "using a nearest neighbor approach." << endl; - interpolator = new CNearestNeighbor(geometry_container, config, iZone, jZone); - break; + case INTERFACE_INTERPOLATOR::NEAREST_NEIGHBOR: + if (verbose) cout << "using a nearest neighbor approach." << endl; + interpolator = new CNearestNeighbor(geometry_container, config, iZone, jZone); + break; - case INTERFACE_INTERPOLATOR::RADIAL_BASIS_FUNCTION: - if (verbose) cout << "using a radial basis function approach." << endl; - interpolator = new CRadialBasisFunction(geometry_container, config, iZone, jZone); - break; + case INTERFACE_INTERPOLATOR::RADIAL_BASIS_FUNCTION: + if (verbose) cout << "using a radial basis function approach." << endl; + interpolator = new CRadialBasisFunction(geometry_container, config, iZone, jZone); + break; - default: - SU2_MPI::Error("Unknown type of interpolation.", CURRENT_FUNCTION); + default: + SU2_MPI::Error("Unknown type of interpolation.", CURRENT_FUNCTION); } } @@ -88,4 +84,4 @@ CInterpolator* CreateInterpolator(CGeometry ****geometry_container, return interpolator; } -} // end namespace +} // namespace CInterpolatorFactory diff --git a/Common/src/interface_interpolation/CIsoparametric.cpp b/Common/src/interface_interpolation/CIsoparametric.cpp index e660664a891..54d2397822c 100644 --- a/Common/src/interface_interpolation/CIsoparametric.cpp +++ b/Common/src/interface_interpolation/CIsoparametric.cpp @@ -2,7 +2,7 @@ * \file CIsoparametric.cpp * \brief Implementation isoparametric interpolation (using FE shape functions). * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -34,40 +34,39 @@ using namespace GeometryToolbox; -CIsoparametric::CIsoparametric(CGeometry ****geometry_container, const CConfig* const* config, - unsigned int iZone, unsigned int jZone) : - CInterpolator(geometry_container, config, iZone, jZone) { +CIsoparametric::CIsoparametric(CGeometry**** geometry_container, const CConfig* const* config, unsigned int iZone, + unsigned int jZone) + : CInterpolator(geometry_container, config, iZone, jZone) { SetTransferCoeff(config); } -void CIsoparametric::PrintStatistics(void) const { +void CIsoparametric::PrintStatistics() const { if (rank != MASTER_NODE) return; cout << " Maximum distance to closest donor element: " << MaxDistance << ".\n" << " Interpolation clipped for " << ErrorCounter << " (" << ErrorRate << "%) target vertices." << endl; } void CIsoparametric::SetTransferCoeff(const CConfig* const* config) { - - const su2double matchingVertexTol = 1e-12; // 1um^2 + const su2double matchingVertexTol = 1e-12; // 1um^2 const int nProcessor = size; - const auto nMarkerInt = config[donorZone]->GetMarker_n_ZoneInterface()/2; + const auto nMarkerInt = config[donorZone]->GetMarker_n_ZoneInterface() / 2; const auto nDim = donor_geometry->GetnDim(); - Buffer_Receive_nVertex_Donor = new unsigned long [nProcessor]; + Buffer_Receive_nVertex_Donor = new unsigned long[nProcessor]; /*--- Make space for donor info. ---*/ targetVertices.resize(config[targetZone]->GetnMarker_All()); /*--- Init stats. ---*/ - MaxDistance = 0.0; ErrorCounter = 0; + MaxDistance = 0.0; + ErrorCounter = 0; unsigned long nGlobalVertexTarget = 0; /*--- Cycle over nMarkersInt interface to determine communication pattern. ---*/ for (unsigned short iMarkerInt = 0; iMarkerInt < nMarkerInt; iMarkerInt++) { - /* High level procedure: * - Loop through vertices of the target grid; * - Find nearest element; @@ -90,12 +89,12 @@ void CIsoparametric::SetTransferCoeff(const CConfig* const* config) { /*--- Sets MaxLocalVertex_Donor, Buffer_Receive_nVertex_Donor. ---*/ Determine_ArraySize(markDonor, markTarget, nVertexDonor, nDim); - const auto nGlobalVertexDonor = accumulate(Buffer_Receive_nVertex_Donor, - Buffer_Receive_nVertex_Donor+nProcessor, 0ul); + const auto nGlobalVertexDonor = + accumulate(Buffer_Receive_nVertex_Donor, Buffer_Receive_nVertex_Donor + nProcessor, 0ul); Buffer_Send_Coord.resize(MaxLocalVertex_Donor, nDim); - Buffer_Send_GlobalPoint .resize(MaxLocalVertex_Donor); - Buffer_Receive_Coord.resize(nProcessor*MaxLocalVertex_Donor,nDim); + Buffer_Send_GlobalPoint.resize(MaxLocalVertex_Donor); + Buffer_Receive_Coord.resize(nProcessor * MaxLocalVertex_Donor, nDim); Buffer_Receive_GlobalPoint.resize(nProcessor * MaxLocalVertex_Donor); /*--- Collect coordinates and global point indices. ---*/ @@ -114,9 +113,8 @@ void CIsoparametric::SetTransferCoeff(const CConfig* const* config) { for (int iProcessor = 0; iProcessor < nProcessor; ++iProcessor) { auto offset = iProcessor * MaxLocalVertex_Donor; for (auto iVertex = 0ul; iVertex < Buffer_Receive_nVertex_Donor[iProcessor]; ++iVertex) { - for (int iDim = 0; iDim < nDim; ++iDim) - donorCoord(iCount,iDim) = Buffer_Receive_Coord(offset+iVertex, iDim); - donorPoint[iCount] = Buffer_Receive_GlobalPoint[offset+iVertex]; + for (int iDim = 0; iDim < nDim; ++iDim) donorCoord(iCount, iDim) = Buffer_Receive_Coord(offset + iVertex, iDim); + donorPoint[iCount] = Buffer_Receive_GlobalPoint[offset + iVertex]; donorProc[iCount] = iProcessor; assert((globalToLocalMap.count(donorPoint[iCount]) == 0) && "Duplicate donor point found."); globalToLocalMap[donorPoint[iCount]] = iCount; @@ -131,135 +129,132 @@ void CIsoparametric::SetTransferCoeff(const CConfig* const* config) { vector elemNumNodes; su2matrix elemIdxNodes; - const auto nGlobalElemDonor = Collect_ElementInfo(markDonor, nDim, true, - allNumElem, elemNumNodes, elemIdxNodes); + const auto nGlobalElemDonor = Collect_ElementInfo(markDonor, nDim, true, allNumElem, elemNumNodes, elemIdxNodes); /*--- Map the node to "local" indices and create a list of connected elements for each vertex. ---*/ vector > vertexElements(nGlobalVertexDonor); for (auto iElem = 0u; iElem < nGlobalElemDonor; ++iElem) { - const auto nNode = elemNumNodes[iElem]; for (auto iNode = 0u; iNode < nNode; ++iNode) { - - assert(globalToLocalMap.count(elemIdxNodes(iElem,iNode)) && + assert(globalToLocalMap.count(elemIdxNodes(iElem, iNode)) && "Unknown donor point referenced by donor element."); - const auto iVertex = globalToLocalMap.at(elemIdxNodes(iElem,iNode)); - elemIdxNodes(iElem,iNode) = iVertex; + const auto iVertex = globalToLocalMap.at(elemIdxNodes(iElem, iNode)); + elemIdxNodes(iElem, iNode) = iVertex; vertexElements[iVertex].push_back(iElem); } } /*--- Compute transfer coefficients for each target point. ---*/ - SU2_OMP_PARALLEL - { - su2double maxDist = 0.0; - unsigned long errorCount = 0, totalCount = 0; - - SU2_OMP_FOR_DYN(roundUpDiv(nVertexTarget,2*omp_get_max_threads())) - for (auto iVertexTarget = 0u; iVertexTarget < nVertexTarget; ++iVertexTarget) { - - auto& target_vertex = targetVertices[markTarget][iVertexTarget]; - const auto iPoint = target_geometry->vertex[markTarget][iVertexTarget]->GetNode(); - - if (!target_geometry->nodes->GetDomain(iPoint)) continue; - totalCount += 1; - - /*--- Coordinates of the target point. ---*/ - const su2double* coord_i = target_geometry->nodes->GetCoord(iPoint); - - /*--- Find the closest donor vertex. ---*/ - su2double minDist = 1e9; - unsigned iClosestVertex = 0; - for (auto iVertexDonor = 0u; iVertexDonor < nGlobalVertexDonor; ++iVertexDonor) { - su2double d = SquaredDistance(nDim, coord_i, donorCoord[iVertexDonor]); - if (d < minDist) { - minDist = d; - iClosestVertex = iVertexDonor; + SU2_OMP_PARALLEL { + su2double maxDist = 0.0; + unsigned long errorCount = 0, totalCount = 0; + + SU2_OMP_FOR_DYN(roundUpDiv(nVertexTarget, 2 * omp_get_max_threads())) + for (auto iVertexTarget = 0u; iVertexTarget < nVertexTarget; ++iVertexTarget) { + auto& target_vertex = targetVertices[markTarget][iVertexTarget]; + const auto iPoint = target_geometry->vertex[markTarget][iVertexTarget]->GetNode(); + + if (!target_geometry->nodes->GetDomain(iPoint)) continue; + totalCount += 1; + + /*--- Coordinates of the target point. ---*/ + const su2double* coord_i = target_geometry->nodes->GetCoord(iPoint); + + /*--- Find the closest donor vertex. ---*/ + su2double minDist = 1e9; + unsigned iClosestVertex = 0; + for (auto iVertexDonor = 0u; iVertexDonor < nGlobalVertexDonor; ++iVertexDonor) { + su2double d = SquaredDistance(nDim, coord_i, donorCoord[iVertexDonor]); + if (d < minDist) { + minDist = d; + iClosestVertex = iVertexDonor; + } } - } - - if (minDist < matchingVertexTol) { - /*--- Perfect match. ---*/ - target_vertex.resize(1); - target_vertex.coefficient[0] = 1.0; - target_vertex.globalPoint[0] = donorPoint[iClosestVertex]; - target_vertex.processor[0] = donorProc[iClosestVertex]; - continue; - } - - /*--- Evaluate interpolation for the elements connected to the closest vertex. ---*/ - DonorInfo donor; - donor.error = 2; - donor.distance = 1e9; - for (auto iElem : vertexElements[iClosestVertex]) { - /*--- Fetch element info. ---*/ - DonorInfo candidate; - candidate.iElem = iElem; - const auto nNode = elemNumNodes[iElem]; - su2double coords[4][3] = {{0.0}}; - for (auto iNode = 0u; iNode < nNode; ++iNode) { - const auto iVertex = elemIdxNodes(iElem, iNode); - for (auto iDim = 0u; iDim < nDim; ++iDim) - coords[iNode][iDim] = donorCoord(iVertex,iDim); - } - - /*--- Compute the interpolation coefficients. ---*/ - switch (nNode) { - case 2: candidate.error = LineIsoparameters(coords, coord_i, candidate.isoparams); break; - case 3: candidate.error = TriangleIsoparameters(coords, coord_i, candidate.isoparams); break; - case 4: candidate.error = QuadrilateralIsoparameters(coords, coord_i, candidate.isoparams); break; + if (minDist < matchingVertexTol) { + /*--- Perfect match. ---*/ + target_vertex.resize(1); + target_vertex.coefficient[0] = 1.0; + target_vertex.globalPoint[0] = donorPoint[iClosestVertex]; + target_vertex.processor[0] = donorProc[iClosestVertex]; + continue; } - /*--- Evaluate distance from target to final mapped point. ---*/ - su2double finalCoord[3] = {0.0}; - for (auto iDim = 0u; iDim < nDim; ++iDim) - for (auto iNode = 0u; iNode < nNode; ++iNode) - finalCoord[iDim] += coords[iNode][iDim] * candidate.isoparams[iNode]; + /*--- Evaluate interpolation for the elements connected to the closest vertex. ---*/ + DonorInfo donor; + donor.error = 2; + donor.distance = 1e9; + for (auto iElem : vertexElements[iClosestVertex]) { + /*--- Fetch element info. ---*/ + DonorInfo candidate; + candidate.iElem = iElem; + const auto nNode = elemNumNodes[iElem]; + su2double coords[4][3] = {{0.0}}; + + for (auto iNode = 0u; iNode < nNode; ++iNode) { + const auto iVertex = elemIdxNodes(iElem, iNode); + for (auto iDim = 0u; iDim < nDim; ++iDim) coords[iNode][iDim] = donorCoord(iVertex, iDim); + } + + /*--- Compute the interpolation coefficients. ---*/ + switch (nNode) { + case 2: + candidate.error = LineIsoparameters(coords, coord_i, candidate.isoparams); + break; + case 3: + candidate.error = TriangleIsoparameters(coords, coord_i, candidate.isoparams); + break; + case 4: + candidate.error = QuadrilateralIsoparameters(coords, coord_i, candidate.isoparams); + break; + } + + /*--- Evaluate distance from target to final mapped point. ---*/ + su2double finalCoord[3] = {0.0}; + for (auto iDim = 0u; iDim < nDim; ++iDim) + for (auto iNode = 0u; iNode < nNode; ++iNode) + finalCoord[iDim] += coords[iNode][iDim] * candidate.isoparams[iNode]; - candidate.distance = Distance(nDim, coord_i, finalCoord); + candidate.distance = Distance(nDim, coord_i, finalCoord); - /*--- Detect a very bad candidate (NaN). ---*/ - if (candidate.distance != candidate.distance) continue; + /*--- Detect a very bad candidate (NaN). ---*/ + if (candidate.distance != candidate.distance) continue; - /*--- Check if the candidate is an improvement, update donor if so. ---*/ - if (candidate < donor) donor = candidate; - } + /*--- Check if the candidate is an improvement, update donor if so. ---*/ + if (candidate < donor) donor = candidate; + } - if (donor.error > 1) - SU2_MPI::Error("Isoparametric interpolation failed, NaN detected.", CURRENT_FUNCTION); + if (donor.error > 1) SU2_MPI::Error("Isoparametric interpolation failed, NaN detected.", CURRENT_FUNCTION); - errorCount += donor.error; - maxDist = max(maxDist, donor.distance); + errorCount += donor.error; + maxDist = max(maxDist, donor.distance); - const auto nNode = elemNumNodes[donor.iElem]; + const auto nNode = elemNumNodes[donor.iElem]; - target_vertex.resize(nNode); + target_vertex.resize(nNode); - for (auto iNode = 0u; iNode < nNode; ++iNode) { - const auto iVertex = elemIdxNodes(donor.iElem, iNode); - target_vertex.coefficient[iNode] = donor.isoparams[iNode]; - target_vertex.globalPoint[iNode] = donorPoint[iVertex]; - target_vertex.processor[iNode] = donorProc[iVertex]; + for (auto iNode = 0u; iNode < nNode; ++iNode) { + const auto iVertex = elemIdxNodes(donor.iElem, iNode); + target_vertex.coefficient[iNode] = donor.isoparams[iNode]; + target_vertex.globalPoint[iNode] = donorPoint[iVertex]; + target_vertex.processor[iNode] = donorProc[iVertex]; + } } - - } - END_SU2_OMP_FOR - SU2_OMP_CRITICAL - { - MaxDistance = max(MaxDistance, maxDist); - ErrorCounter += errorCount; - nGlobalVertexTarget += totalCount; - } - END_SU2_OMP_CRITICAL + END_SU2_OMP_FOR + SU2_OMP_CRITICAL { + MaxDistance = max(MaxDistance, maxDist); + ErrorCounter += errorCount; + nGlobalVertexTarget += totalCount; + } + END_SU2_OMP_CRITICAL } END_SU2_OMP_PARALLEL - } // end nMarkerInt loop + } // end nMarkerInt loop /*--- Final reduction of statistics. ---*/ su2double tmp = MaxDistance; @@ -268,18 +263,16 @@ void CIsoparametric::SetTransferCoeff(const CConfig* const* config) { SU2_MPI::Allreduce(&tmp1, &ErrorCounter, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&tmp2, &nGlobalVertexTarget, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); - ErrorRate = 100*su2double(ErrorCounter) / nGlobalVertexTarget; - + ErrorRate = 100 * su2double(ErrorCounter) / nGlobalVertexTarget; } -int CIsoparametric::LineIsoparameters(const su2double X[][3], const su2double *xj, su2double *isoparams) { - +int CIsoparametric::LineIsoparameters(const su2double X[][3], const su2double* xj, su2double* isoparams) { /*--- Project the target point onto the line. ---*/ su2double normal[2] = {0.0}; LineNormal(X, normal); su2double xprj[2] = {0.0}; - PointPlaneProjection(xj, X[0], normal, xprj); + PointPlaneProjection(xj, X[0], normal, xprj); su2double l01 = Distance(2, X[0], X[1]); su2double l0j = Distance(2, X[0], xprj); @@ -287,16 +280,15 @@ int CIsoparametric::LineIsoparameters(const su2double X[][3], const su2double *x /*--- Detect out of bounds point. ---*/ - const int outOfBounds = (l0j+lj1) > (2*l01); + const int outOfBounds = (l0j + lj1) > (2 * l01); - isoparams[0] = max(-0.5, min(lj1/l01, 1.5)); + isoparams[0] = max(-0.5, min(lj1 / l01, 1.5)); isoparams[1] = 1.0 - isoparams[0]; return outOfBounds; } -int CIsoparametric::TriangleIsoparameters(const su2double X[][3], const su2double *xj, su2double *isoparams) { - +int CIsoparametric::TriangleIsoparameters(const su2double X[][3], const su2double* xj, su2double* isoparams) { /*--- The isoparameters are the solution to the determined system X^T * isoparams = xj. * For which we solve the normal equations to avoid divisions by zero. * This is consistent with the shape functions of the linear triangular element. ---*/ @@ -307,18 +299,15 @@ int CIsoparametric::TriangleIsoparameters(const su2double X[][3], const su2doubl su2double normal[3] = {0.0}, xproj[3] = {0.0}; TriangleNormal(X, normal); - PointPlaneProjection(xj, X[0], normal, xproj); + PointPlaneProjection(xj, X[0], normal, xproj); - su2double A[3][3] = {{0.0}}; // = X*X^T + su2double A[3][3] = {{0.0}}; // = X*X^T for (int i = 0; i < 3; ++i) { - for (int j = 0; j < 3; ++j) - for (int k = 0; k < 3; ++k) - A[i][j] += X[i][k] * X[j][k]; + for (int k = 0; k < 3; ++k) A[i][j] += X[i][k] * X[j][k]; - isoparams[i] = 0.0; // use isoparams as rhs - for (int k = 0; k < 3; ++k) - isoparams[i] += X[i][k] * xproj[k]; + isoparams[i] = 0.0; // use isoparams as rhs + for (int k = 0; k < 3; ++k) isoparams[i] += X[i][k] * xproj[k]; } /*--- Solve system by in-place Gaussian elimination without pivoting. ---*/ @@ -327,22 +316,18 @@ int CIsoparametric::TriangleIsoparameters(const su2double X[][3], const su2doubl for (int i = 1; i < 3; ++i) { for (int j = 0; j < i; ++j) { su2double w = A[i][j] / A[j][j]; - for (int k = j; k < 3; ++k) - A[i][k] -= w * A[j][k]; + for (int k = j; k < 3; ++k) A[i][k] -= w * A[j][k]; isoparams[i] -= w * isoparams[j]; } } /*--- Backwards substitution. ---*/ for (int i = 2; i >= 0; --i) { - for (int j = i+1; j < 3; ++j) - isoparams[i] -= A[i][j] * isoparams[j]; + for (int j = i + 1; j < 3; ++j) isoparams[i] -= A[i][j] * isoparams[j]; isoparams[i] /= A[i][i]; } /*--- Detect out of bounds point. ---*/ - const int outOfBounds = (isoparams[0] < extrapTol) || - (isoparams[1] < extrapTol) || - (isoparams[2] < extrapTol); + const int outOfBounds = (isoparams[0] < extrapTol) || (isoparams[1] < extrapTol) || (isoparams[2] < extrapTol); /*--- Mitigation. ---*/ if (outOfBounds) { @@ -353,15 +338,13 @@ int CIsoparametric::TriangleIsoparameters(const su2double X[][3], const su2doubl sum += isoparams[i]; } /*--- Enforce unit sum. ---*/ - for (int i = 0; i < 3; ++i) - isoparams[i] /= sum; + for (int i = 0; i < 3; ++i) isoparams[i] /= sum; } return outOfBounds; } -int CIsoparametric::QuadrilateralIsoparameters(const su2double X[][3], const su2double *xj, su2double *isoparams) { - +int CIsoparametric::QuadrilateralIsoparameters(const su2double X[][3], const su2double* xj, su2double* isoparams) { /*--- The isoparameters are the shape functions (Ni) evaluated at xj, for that we need * the corresponding Xi and Eta, which are obtained by solving the overdetermined * nonlinear system r = xj - X^T * Ni(Xi,Eta) = 0 via the modified Marquardt method. @@ -380,14 +363,12 @@ int CIsoparametric::QuadrilateralIsoparameters(const su2double X[][3], const su2 const bool wasActive = AD::BeginPassive(); for (int iter = 0; iter < NITER; ++iter) { - /*--- Evaluate the residual. ---*/ su2double r[3] = {xj[0], xj[1], xj[2]}; su2double Ni[4] = {0.0}; CQUAD4::ShapeFunctions(Xi, Eta, Ni); for (int i = 0; i < 3; ++i) - for (int j = 0; j < 4; ++j) - r[i] -= X[j][i] * Ni[j]; + for (int j = 0; j < 4; ++j) r[i] -= X[j][i] * Ni[j]; /*--- Evaluate the residual Jacobian. ---*/ su2double dNi[4][2] = {{0.0}}; @@ -396,30 +377,27 @@ int CIsoparametric::QuadrilateralIsoparameters(const su2double X[][3], const su2 su2double jac[3][2] = {{0.0}}; for (int i = 0; i < 3; ++i) for (int j = 0; j < 2; ++j) - for (int k = 0; k < 4; ++k) - jac[i][j] -= X[k][i] * dNi[k][j]; + for (int k = 0; k < 4; ++k) jac[i][j] -= X[k][i] * dNi[k][j]; /*--- Compute the correction (normal equations and Cramer's rule). ---*/ su2double A[2][2] = {{0.0}}, b[2] = {0.0}; for (int i = 0; i < 2; ++i) { for (int j = i; j < 2; ++j) - for (int k = 0; k < 3; ++k) - A[i][j] += jac[k][i] * jac[k][j]; + for (int k = 0; k < 3; ++k) A[i][j] += jac[k][i] * jac[k][j]; - A[i][i] *= (1.0+lambda); + A[i][i] *= (1.0 + lambda); - for (int k = 0; k < 3; ++k) - b[i] += jac[k][i] * r[k]; + for (int k = 0; k < 3; ++k) b[i] += jac[k][i] * r[k]; } A[1][0] = A[0][1]; - su2double detA = 1.0 / (A[0][0]*A[1][1] - A[0][1]*A[1][0]); - su2double dXi = (b[0]*A[1][1] - b[1]*A[0][1]) * detA; - su2double dEta = (A[0][0]*b[1] - A[1][0]*b[0]) * detA; + su2double detA = 1.0 / (A[0][0] * A[1][1] - A[0][1] * A[1][0]); + su2double dXi = (b[0] * A[1][1] - b[1] * A[0][1]) * detA; + su2double dEta = (A[0][0] * b[1] - A[1][0] * b[0]) * detA; Xi -= dXi; Eta -= dEta; - eps = fabs(dXi)+fabs(dEta); + eps = fabs(dXi) + fabs(dEta); if (eps < tol) break; } @@ -431,8 +409,7 @@ int CIsoparametric::QuadrilateralIsoparameters(const su2double X[][3], const su2 /*--- Iteration diverged, hard fallback. ---*/ Xi = Eta = 0.0; outOfBounds = 1; - } - else { + } else { /*--- Check bounds. ---*/ outOfBounds = (fabs(Xi) > extrapTol) || (fabs(Eta) > extrapTol); diff --git a/Common/src/interface_interpolation/CMirror.cpp b/Common/src/interface_interpolation/CMirror.cpp index 9e1695635dc..664e0db274f 100644 --- a/Common/src/interface_interpolation/CMirror.cpp +++ b/Common/src/interface_interpolation/CMirror.cpp @@ -2,7 +2,7 @@ * \file CMirror.cpp * \brief Implementation of mirror interpolation (conservative approach in FSI problems). * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -30,21 +30,20 @@ #include "../../include/geometry/CGeometry.hpp" #include "../../include/toolboxes/printing_toolbox.hpp" - -CMirror::CMirror(CGeometry ****geometry_container, const CConfig* const* config, - const CInterpolator* interpolator, unsigned int iZone, unsigned int jZone) : - CInterpolator(geometry_container, config, iZone, jZone), - transpInterpolator(interpolator) { +CMirror::CMirror(CGeometry**** geometry_container, const CConfig* const* config, const CInterpolator* interpolator, + unsigned int iZone, unsigned int jZone) + : CInterpolator(geometry_container, config, iZone, jZone), transpInterpolator(interpolator) { using PrintingToolbox::to_string; if (jZone < iZone) { SU2_MPI::Error(string("The order of the zones does not allow conservative interpolation to be setup.\n" - "Swap zones ") + to_string(iZone) + string(" and ") + to_string(jZone) + string("."),CURRENT_FUNCTION); + "Swap zones ") + + to_string(iZone) + string(" and ") + to_string(jZone) + string("."), + CURRENT_FUNCTION); } SetTransferCoeff(config); } void CMirror::SetTransferCoeff(const CConfig* const* config) { - const int nProcessor = size; vector allNumVertexTarget(nProcessor); @@ -57,15 +56,14 @@ void CMirror::SetTransferCoeff(const CConfig* const* config) { targetVertices.resize(config[targetZone]->GetnMarker_All()); /*--- Number of markers on the interface ---*/ - const auto nMarkerInt = (config[targetZone]->GetMarker_n_ZoneInterface())/2; + const auto nMarkerInt = (config[targetZone]->GetMarker_n_ZoneInterface()) / 2; /*--- For the number of markers on the interface... ---*/ for (unsigned short iMarkerInt = 0; iMarkerInt < nMarkerInt; iMarkerInt++) { - - /* High level procedure: - * - Gather the interpolation matrix of the donor geometry; - * - Set the interpolation matrix of the target as the transpose. - */ + /* High level procedure: + * - Gather the interpolation matrix of the donor geometry; + * - Set the interpolation matrix of the target as the transpose. + */ /*--- On the donor side: find the tag of the boundary sharing the interface ---*/ const auto markDonor = config[donorZone]->FindInterfaceMarker(iMarkerInt); @@ -77,8 +75,8 @@ void CMirror::SetTransferCoeff(const CConfig* const* config) { if (!CheckInterfaceBoundary(markDonor, markTarget)) continue; unsigned long nVertexDonor = 0, nVertexTarget = 0; - if (markDonor != -1) nVertexDonor = donor_geometry->GetnVertex( markDonor ); - if (markTarget != -1) nVertexTarget = target_geometry->GetnVertex( markTarget ); + if (markDonor != -1) nVertexDonor = donor_geometry->GetnVertex(markDonor); + if (markTarget != -1) nVertexTarget = target_geometry->GetnVertex(markTarget); /*--- Count the number of donor nodes on the donor geometry. ---*/ unsigned long nVertexDonorLocal = 0; @@ -92,12 +90,12 @@ void CMirror::SetTransferCoeff(const CConfig* const* config) { } /*--- Communicate vertex and donor node counts. ---*/ - SU2_MPI::Allgather(&nVertexTarget, 1, MPI_UNSIGNED_LONG, - allNumVertexTarget.data(), 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); - SU2_MPI::Allgather(&nVertexDonorLocal, 1, MPI_UNSIGNED_LONG, - allNumVertexDonor.data(), 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); - SU2_MPI::Allgather(&nNodeDonorLocal, 1, MPI_UNSIGNED_LONG, - allNumNodeDonor.data(), 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allgather(&nVertexTarget, 1, MPI_UNSIGNED_LONG, allNumVertexTarget.data(), 1, MPI_UNSIGNED_LONG, + SU2_MPI::GetComm()); + SU2_MPI::Allgather(&nVertexDonorLocal, 1, MPI_UNSIGNED_LONG, allNumVertexDonor.data(), 1, MPI_UNSIGNED_LONG, + SU2_MPI::GetComm()); + SU2_MPI::Allgather(&nNodeDonorLocal, 1, MPI_UNSIGNED_LONG, allNumNodeDonor.data(), 1, MPI_UNSIGNED_LONG, + SU2_MPI::GetComm()); /*--- Copy donor interpolation matrix (triplet format). ---*/ vector sendGlobalIndex(nNodeDonorLocal); @@ -105,7 +103,6 @@ void CMirror::SetTransferCoeff(const CConfig* const* config) { vector sendDonorCoeff(nNodeDonorLocal); for (auto iVertex = 0ul, iDonor = 0ul; iVertex < nVertexDonor; ++iVertex) { - auto& donor_vertex = donorVertices[markDonor][iVertex]; const auto iPoint = donor_geometry->vertex[markDonor][iVertex]->GetNode(); @@ -125,11 +122,7 @@ void CMirror::SetTransferCoeff(const CConfig* const* config) { /*--- Sort the matrix by donor index, effectively transposing the triplets. ---*/ vector order(nNodeDonorLocal); iota(order.begin(), order.end(), 0); - sort(order.begin(), order.end(), - [&sendDonorIndex](int i, int j) { - return sendDonorIndex[i] < sendDonorIndex[j]; - } - ); + sort(order.begin(), order.end(), [&sendDonorIndex](int i, int j) { return sendDonorIndex[i] < sendDonorIndex[j]; }); for (int i = 0; i < int(nNodeDonorLocal); ++i) { int j = order[i]; while (j < i) j = order[j]; @@ -138,7 +131,7 @@ void CMirror::SetTransferCoeff(const CConfig* const* config) { swap(sendDonorIndex[i], sendDonorIndex[j]); swap(sendDonorCoeff[i], sendDonorCoeff[j]); } - vector().swap(order); // no longer needed + vector().swap(order); // no longer needed /*--- Communicate donor interpolation matrix and info. We only gather the * matrix in ranks that need it, i.e. have target vertices, to avoid @@ -147,13 +140,12 @@ void CMirror::SetTransferCoeff(const CConfig* const* config) { vector iSendProcessor; for (int iProcessor = 0; iProcessor < nProcessor; ++iProcessor) - if (allNumVertexDonor[iProcessor] != 0) - iSendProcessor.push_back(iProcessor); + if (allNumVertexDonor[iProcessor] != 0) iSendProcessor.push_back(iProcessor); const int nSend = iSendProcessor.size(); - vector GlobalIndex(nSend,nullptr), DonorIndex(nSend,nullptr); - vector DonorCoeff(nSend,nullptr); + vector GlobalIndex(nSend, nullptr), DonorIndex(nSend, nullptr); + vector DonorCoeff(nSend, nullptr); /*--- For each "target processor" that needs the interpolation matrix. ---*/ for (int iProcessor = 0; iProcessor < nProcessor; ++iProcessor) { @@ -169,20 +161,18 @@ void CMirror::SetTransferCoeff(const CConfig* const* config) { GlobalIndex[iSend] = sendGlobalIndex.data(); DonorIndex[iSend] = sendDonorIndex.data(); DonorCoeff[iSend] = sendDonorCoeff.data(); - } - else if (rank == iProcessor) { + } else if (rank == iProcessor) { /*--- "I'm" the target, allocate and receive. ---*/ - GlobalIndex[iSend] = new long [numCoeff]; - DonorIndex[iSend] = new long [numCoeff]; - DonorCoeff[iSend] = new su2double [numCoeff]; + GlobalIndex[iSend] = new long[numCoeff]; + DonorIndex[iSend] = new long[numCoeff]; + DonorCoeff[iSend] = new su2double[numCoeff]; SU2_MPI::Recv(GlobalIndex[iSend], numCoeff, MPI_LONG, jProcessor, 0, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); - SU2_MPI::Recv(DonorIndex[iSend], numCoeff, MPI_LONG, jProcessor, 0, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); + SU2_MPI::Recv(DonorIndex[iSend], numCoeff, MPI_LONG, jProcessor, 0, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); SU2_MPI::Recv(DonorCoeff[iSend], numCoeff, MPI_DOUBLE, jProcessor, 0, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); - } - else if (rank == jProcessor) { + } else if (rank == jProcessor) { /*--- "I'm" the donor, send. ---*/ SU2_MPI::Send(sendGlobalIndex.data(), numCoeff, MPI_LONG, iProcessor, 0, SU2_MPI::GetComm()); - SU2_MPI::Send(sendDonorIndex.data(), numCoeff, MPI_LONG, iProcessor, 0, SU2_MPI::GetComm()); + SU2_MPI::Send(sendDonorIndex.data(), numCoeff, MPI_LONG, iProcessor, 0, SU2_MPI::GetComm()); SU2_MPI::Send(sendDonorCoeff.data(), numCoeff, MPI_DOUBLE, iProcessor, 0, SU2_MPI::GetComm()); } } @@ -192,11 +182,9 @@ void CMirror::SetTransferCoeff(const CConfig* const* config) { /*--- Loop over the vertices on the target marker, define one row of the transpose matrix. ---*/ - SU2_OMP_PARALLEL - { - SU2_OMP_FOR_DYN(roundUpDiv(nVertexTarget, 2*omp_get_max_threads())) + SU2_OMP_PARALLEL { + SU2_OMP_FOR_DYN(roundUpDiv(nVertexTarget, 2 * omp_get_max_threads())) for (auto iVertex = 0ul; iVertex < nVertexTarget; ++iVertex) { - auto& target_vertex = targetVertices[markTarget][iVertex]; const auto iPoint = target_geometry->vertex[markTarget][iVertex]->GetNode(); @@ -207,11 +195,11 @@ void CMirror::SetTransferCoeff(const CConfig* const* config) { /*--- Count donors and safe the binary search results (this is why we sorted the matrix). ---*/ auto nDonor = 0ul; - vector > ranges(nSend); + vector > ranges(nSend); for (int iSend = 0; iSend < nSend; ++iSend) { const auto iProcessor = iSendProcessor[iSend]; const auto numCoeff = allNumNodeDonor[iProcessor]; - auto p = equal_range(DonorIndex[iSend], DonorIndex[iSend]+numCoeff, targetGlobalIndex); + auto p = equal_range(DonorIndex[iSend], DonorIndex[iSend] + numCoeff, targetGlobalIndex); nDonor += (p.second - p.first); ranges[iSend] = p; } @@ -238,10 +226,12 @@ void CMirror::SetTransferCoeff(const CConfig* const* config) { END_SU2_OMP_PARALLEL /*--- Free the heap allocations. ---*/ - for (auto ptr : GlobalIndex) if (ptr != sendGlobalIndex.data()) delete [] ptr; - for (auto ptr : DonorIndex) if (ptr != sendDonorIndex.data()) delete [] ptr; - for (auto ptr : DonorCoeff) if (ptr != sendDonorCoeff.data()) delete [] ptr; - - } // end marker loop - + for (auto ptr : GlobalIndex) + if (ptr != sendGlobalIndex.data()) delete[] ptr; + for (auto ptr : DonorIndex) + if (ptr != sendDonorIndex.data()) delete[] ptr; + for (auto ptr : DonorCoeff) + if (ptr != sendDonorCoeff.data()) delete[] ptr; + + } // end marker loop } diff --git a/Common/src/interface_interpolation/CNearestNeighbor.cpp b/Common/src/interface_interpolation/CNearestNeighbor.cpp index 8518b4a19dc..96b4b894156 100644 --- a/Common/src/interface_interpolation/CNearestNeighbor.cpp +++ b/Common/src/interface_interpolation/CNearestNeighbor.cpp @@ -2,7 +2,7 @@ * \file CNearestNeighbor.cpp * \brief Implementation of nearest neighbor interpolation. * \author H. Kline - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -30,9 +30,9 @@ #include "../../include/geometry/CGeometry.hpp" #include "../../include/toolboxes/geometry_toolbox.hpp" -CNearestNeighbor::CNearestNeighbor(CGeometry ****geometry_container, const CConfig* const* config, - unsigned int iZone, unsigned int jZone) : - CInterpolator(geometry_container, config, iZone, jZone) { +CNearestNeighbor::CNearestNeighbor(CGeometry**** geometry_container, const CConfig* const* config, unsigned int iZone, + unsigned int jZone) + : CInterpolator(geometry_container, config, iZone, jZone) { SetTransferCoeff(config); } @@ -42,7 +42,6 @@ void CNearestNeighbor::PrintStatistics() const { } void CNearestNeighbor::SetTransferCoeff(const CConfig* const* config) { - /*--- Desired number of donor points. ---*/ const auto nDonor = max(config[donorZone]->GetNumNearestNeighbors(), 1); @@ -50,10 +49,10 @@ void CNearestNeighbor::SetTransferCoeff(const CConfig* const* config) { const su2double eps = numeric_limits::epsilon(); const int nProcessor = size; - const auto nMarkerInt = config[donorZone]->GetMarker_n_ZoneInterface()/2; + const auto nMarkerInt = config[donorZone]->GetMarker_n_ZoneInterface() / 2; const auto nDim = donor_geometry->GetnDim(); - Buffer_Receive_nVertex_Donor = new unsigned long [nProcessor]; + Buffer_Receive_nVertex_Donor = new unsigned long[nProcessor]; targetVertices.resize(config[targetZone]->GetnMarker_All()); @@ -65,7 +64,6 @@ void CNearestNeighbor::SetTransferCoeff(const CConfig* const* config) { unsigned long totalTargetPoints = 0; for (unsigned short iMarkerInt = 0; iMarkerInt < nMarkerInt; iMarkerInt++) { - /*--- On the donor side: find the tag of the boundary sharing the interface. ---*/ const auto markDonor = config[donorZone]->FindInterfaceMarker(iMarkerInt); @@ -83,8 +81,8 @@ void CNearestNeighbor::SetTransferCoeff(const CConfig* const* config) { Determine_ArraySize(markDonor, markTarget, nVertexDonor, nDim); if (nVertexTarget) targetVertices[markTarget].resize(nVertexTarget); - const auto nPossibleDonor = accumulate(Buffer_Receive_nVertex_Donor, - Buffer_Receive_nVertex_Donor+nProcessor, 0ul); + const auto nPossibleDonor = + accumulate(Buffer_Receive_nVertex_Donor, Buffer_Receive_nVertex_Donor + nProcessor, 0ul); Buffer_Send_Coord.resize(MaxLocalVertex_Donor, nDim); Buffer_Send_GlobalPoint.resize(MaxLocalVertex_Donor); @@ -95,80 +93,74 @@ void CNearestNeighbor::SetTransferCoeff(const CConfig* const* config) { Collect_VertexInfo(markDonor, markTarget, nVertexDonor, nDim); /*--- Find the closest donor points to each target. ---*/ - SU2_OMP_PARALLEL - { - /*--- Working array for this thread. ---*/ - auto& donorInfo = DonorInfoVec[omp_get_thread_num()]; - donorInfo.resize(nPossibleDonor); - - su2double avgDist = 0.0, maxDist = 0.0; - unsigned long numTarget = 0; - - SU2_OMP_FOR_DYN(roundUpDiv(nVertexTarget,2*omp_get_max_threads())) - for (auto iVertexTarget = 0ul; iVertexTarget < nVertexTarget; iVertexTarget++) { - - auto& target_vertex = targetVertices[markTarget][iVertexTarget]; - const auto Point_Target = target_geometry->vertex[markTarget][iVertexTarget]->GetNode(); - - if (!target_geometry->nodes->GetDomain(Point_Target)) continue; - - /*--- Coordinates of the target point. ---*/ - const su2double* Coord_i = target_geometry->nodes->GetCoord(Point_Target); - - /*--- Compute all distances. ---*/ - for (int iProcessor = 0, iDonor = 0; iProcessor < nProcessor; ++iProcessor) { - for (auto jVertex = 0ul; jVertex < Buffer_Receive_nVertex_Donor[iProcessor]; ++jVertex) { - - const auto idx = iProcessor*MaxLocalVertex_Donor + jVertex; - const auto pGlobalPoint = Buffer_Receive_GlobalPoint[idx]; - const su2double* Coord_j = Buffer_Receive_Coord[idx]; - const auto dist2 = GeometryToolbox::SquaredDistance(nDim, Coord_i, Coord_j); - - donorInfo[iDonor++] = DonorInfo(dist2, pGlobalPoint, iProcessor); + SU2_OMP_PARALLEL { + /*--- Working array for this thread. ---*/ + auto& donorInfo = DonorInfoVec[omp_get_thread_num()]; + donorInfo.resize(nPossibleDonor); + + su2double avgDist = 0.0, maxDist = 0.0; + unsigned long numTarget = 0; + + SU2_OMP_FOR_DYN(roundUpDiv(nVertexTarget, 2 * omp_get_max_threads())) + for (auto iVertexTarget = 0ul; iVertexTarget < nVertexTarget; iVertexTarget++) { + auto& target_vertex = targetVertices[markTarget][iVertexTarget]; + const auto Point_Target = target_geometry->vertex[markTarget][iVertexTarget]->GetNode(); + + if (!target_geometry->nodes->GetDomain(Point_Target)) continue; + + /*--- Coordinates of the target point. ---*/ + const su2double* Coord_i = target_geometry->nodes->GetCoord(Point_Target); + + /*--- Compute all distances. ---*/ + for (int iProcessor = 0, iDonor = 0; iProcessor < nProcessor; ++iProcessor) { + for (auto jVertex = 0ul; jVertex < Buffer_Receive_nVertex_Donor[iProcessor]; ++jVertex) { + const auto idx = iProcessor * MaxLocalVertex_Donor + jVertex; + const auto pGlobalPoint = Buffer_Receive_GlobalPoint[idx]; + const su2double* Coord_j = Buffer_Receive_Coord[idx]; + const auto dist2 = GeometryToolbox::SquaredDistance(nDim, Coord_i, Coord_j); + + donorInfo[iDonor++] = DonorInfo(dist2, pGlobalPoint, iProcessor); + } } - } - /*--- Find k closest points. ---*/ - partial_sort(donorInfo.begin(), donorInfo.begin()+nDonor, donorInfo.end(), - [](const DonorInfo& a, const DonorInfo& b) { - /*--- Global index is used as tie-breaker to make sorted order independent of initial. ---*/ - return (a.dist != b.dist)? (a.dist < b.dist) : (a.pidx < b.pidx); + /*--- Find k closest points. ---*/ + partial_sort(donorInfo.begin(), donorInfo.begin() + nDonor, donorInfo.end(), + [](const DonorInfo& a, const DonorInfo& b) { + /*--- Global index is used as tie-breaker to make sorted order independent of initial. ---*/ + return (a.dist != b.dist) ? (a.dist < b.dist) : (a.pidx < b.pidx); + }); + + /*--- Update stats. ---*/ + numTarget += 1; + su2double d = sqrt(donorInfo[0].dist); + avgDist += d; + maxDist = max(maxDist, d); + + /*--- Compute interpolation numerators and denominator. ---*/ + su2double denom = 0.0; + for (auto iDonor = 0ul; iDonor < nDonor; ++iDonor) { + donorInfo[iDonor].dist = 1.0 / (donorInfo[iDonor].dist + eps); + denom += donorInfo[iDonor].dist; } - ); - - /*--- Update stats. ---*/ - numTarget += 1; - su2double d = sqrt(donorInfo[0].dist); - avgDist += d; - maxDist = max(maxDist, d); - - /*--- Compute interpolation numerators and denominator. ---*/ - su2double denom = 0.0; - for (auto iDonor = 0ul; iDonor < nDonor; ++iDonor) { - donorInfo[iDonor].dist = 1.0 / (donorInfo[iDonor].dist + eps); - denom += donorInfo[iDonor].dist; - } - /*--- Set interpolation coefficients. ---*/ - target_vertex.resize(nDonor); + /*--- Set interpolation coefficients. ---*/ + target_vertex.resize(nDonor); - for (auto iDonor = 0ul; iDonor < nDonor; ++iDonor) { - target_vertex.globalPoint[iDonor] = donorInfo[iDonor].pidx; - target_vertex.processor[iDonor] = donorInfo[iDonor].proc; - target_vertex.coefficient[iDonor] = donorInfo[iDonor].dist/denom; + for (auto iDonor = 0ul; iDonor < nDonor; ++iDonor) { + target_vertex.globalPoint[iDonor] = donorInfo[iDonor].pidx; + target_vertex.processor[iDonor] = donorInfo[iDonor].proc; + target_vertex.coefficient[iDonor] = donorInfo[iDonor].dist / denom; + } } - } - END_SU2_OMP_FOR - SU2_OMP_CRITICAL - { - totalTargetPoints += numTarget; - AvgDistance += avgDist; - MaxDistance = max(MaxDistance, maxDist); - } - END_SU2_OMP_CRITICAL + END_SU2_OMP_FOR + SU2_OMP_CRITICAL { + totalTargetPoints += numTarget; + AvgDistance += avgDist; + MaxDistance = max(MaxDistance, maxDist); + } + END_SU2_OMP_CRITICAL } END_SU2_OMP_PARALLEL - } delete[] Buffer_Receive_nVertex_Donor; @@ -179,5 +171,4 @@ void CNearestNeighbor::SetTransferCoeff(const CConfig* const* config) { SU2_MPI::Allreduce(&tmp1, &AvgDistance, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&tmp2, &MaxDistance, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); AvgDistance /= totalTargetPoints; - } diff --git a/Common/src/interface_interpolation/CRadialBasisFunction.cpp b/Common/src/interface_interpolation/CRadialBasisFunction.cpp index 7433a401299..16645017012 100644 --- a/Common/src/interface_interpolation/CRadialBasisFunction.cpp +++ b/Common/src/interface_interpolation/CRadialBasisFunction.cpp @@ -2,7 +2,7 @@ * \file CRadialBasisFunction.cpp * \brief Implementation of RBF interpolation. * \author Joel Ho, P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -38,56 +38,60 @@ #endif #elif defined(HAVE_LAPACK) // dgemm(opA, opB, m, n, k, alpha, A, lda, B, ldb, beta, C, ldc) -extern "C" void dgemm_(const char*, const char*, const int*, const int*, const int*, - const passivedouble*, const passivedouble*, const int*, const passivedouble*, - const int*, const passivedouble*, passivedouble*, const int*); +extern "C" void dgemm_(const char*, const char*, const int*, const int*, const int*, const passivedouble*, + const passivedouble*, const int*, const passivedouble*, const int*, const passivedouble*, + passivedouble*, const int*); #define DGEMM dgemm_ #endif - -CRadialBasisFunction::CRadialBasisFunction(CGeometry ****geometry_container, const CConfig* const* config, - unsigned int iZone, unsigned int jZone) : - CInterpolator(geometry_container, config, iZone, jZone) { +CRadialBasisFunction::CRadialBasisFunction(CGeometry**** geometry_container, const CConfig* const* config, + unsigned int iZone, unsigned int jZone) + : CInterpolator(geometry_container, config, iZone, jZone) { SetTransferCoeff(config); } void CRadialBasisFunction::PrintStatistics() const { if (rank != MASTER_NODE) return; cout.precision(3); - cout << " Min/avg/max number of RBF donors per target point: " - << MinDonors << "/" << AvgDonors << "/" << MaxDonors << "\n" + cout << " Min/avg/max number of RBF donors per target point: " << MinDonors << "/" << AvgDonors << "/" << MaxDonors + << "\n" << " Avg/max correction factor after pruning: " << AvgCorrection << "/" << MaxCorrection; - if (MaxCorrection < 1.1 || AvgCorrection < 1.02) cout << " (ok)\n"; - else if (MaxCorrection < 2.0 && AvgCorrection < 1.05) cout << " (warning)\n"; - else cout << " <<< WARNING >>>\n"; + if (MaxCorrection < 1.1 || AvgCorrection < 1.02) + cout << " (ok)\n"; + else if (MaxCorrection < 2.0 && AvgCorrection < 1.05) + cout << " (warning)\n"; + else + cout << " <<< WARNING >>>\n"; cout << " Interpolation matrix is " << Density << "% dense." << endl; cout.unsetf(ios::floatfield); } -su2double CRadialBasisFunction::Get_RadialBasisValue(RADIAL_BASIS type, const su2double radius, const su2double dist) -{ - su2double rbf = dist/radius; +su2double CRadialBasisFunction::Get_RadialBasisValue(RADIAL_BASIS type, const su2double radius, const su2double dist) { + su2double rbf = dist / radius; switch (type) { - case RADIAL_BASIS::WENDLAND_C2: - if(rbf < 1) rbf = pow(pow((1-rbf),2),2)*(4*rbf+1); // double use of pow(x,2) for optimization - else rbf = 0.0; + if (rbf < 1) + rbf = pow(pow((1 - rbf), 2), 2) * (4 * rbf + 1); // double use of pow(x,2) for optimization + else + rbf = 0.0; break; case RADIAL_BASIS::GAUSSIAN: - rbf = exp(-rbf*rbf); + rbf = exp(-rbf * rbf); break; case RADIAL_BASIS::THIN_PLATE_SPLINE: - if(rbf < numeric_limits::min()) rbf = 0.0; - else rbf *= rbf*log(rbf); + if (rbf < numeric_limits::min()) + rbf = 0.0; + else + rbf *= rbf * log(rbf); break; case RADIAL_BASIS::MULTI_QUADRIC: case RADIAL_BASIS::INV_MULTI_QUADRIC: - rbf = sqrt(1.0+rbf*rbf); - if(type == RADIAL_BASIS::INV_MULTI_QUADRIC) rbf = 1.0/rbf; + rbf = sqrt(1.0 + rbf * rbf); + if (type == RADIAL_BASIS::INV_MULTI_QUADRIC) rbf = 1.0 / rbf; break; } @@ -95,18 +99,17 @@ su2double CRadialBasisFunction::Get_RadialBasisValue(RADIAL_BASIS type, const su } void CRadialBasisFunction::SetTransferCoeff(const CConfig* const* config) { - /*--- RBF options. ---*/ const auto kindRBF = config[donorZone]->GetKindRadialBasisFunction(); const bool usePolynomial = config[donorZone]->GetRadialBasisFunctionPolynomialOption(); const su2double paramRBF = config[donorZone]->GetRadialBasisFunctionParameter(); const su2double pruneTol = config[donorZone]->GetRadialBasisFunctionPruneTol(); - const auto nMarkerInt = config[donorZone]->GetMarker_n_ZoneInterface()/2; + const auto nMarkerInt = config[donorZone]->GetMarker_n_ZoneInterface() / 2; const int nDim = donor_geometry->GetnDim(); const int nProcessor = size; - Buffer_Receive_nVertex_Donor = new unsigned long [nProcessor]; + Buffer_Receive_nVertex_Donor = new unsigned long[nProcessor]; targetVertices.resize(config[targetZone]->GetnMarker_All()); @@ -118,11 +121,10 @@ void CRadialBasisFunction::SetTransferCoeff(const CConfig* const* config) { vector donorCoordinates(nMarkerInt); vector > donorGlobalPoint(nMarkerInt); vector > donorProcessor(nMarkerInt); - vector assignedProcessor(nMarkerInt,-1); - vector totalWork(nProcessor,0); + vector assignedProcessor(nMarkerInt, -1); + vector totalWork(nProcessor, 0); for (unsigned short iMarkerInt = 0; iMarkerInt < nMarkerInt; ++iMarkerInt) { - /*--- On the donor side: find the tag of the boundary sharing the interface. ---*/ const auto markDonor = config[donorZone]->FindInterfaceMarker(iMarkerInt); @@ -130,7 +132,7 @@ void CRadialBasisFunction::SetTransferCoeff(const CConfig* const* config) { const auto markTarget = config[targetZone]->FindInterfaceMarker(iMarkerInt); /*--- If the zone does not contain the interface continue to the next pair of markers. ---*/ - if (!CheckInterfaceBoundary(markDonor,markTarget)) continue; + if (!CheckInterfaceBoundary(markDonor, markTarget)) continue; unsigned long nVertexDonor = 0; if (markDonor != -1) nVertexDonor = donor_geometry->GetnVertex(markDonor); @@ -139,8 +141,8 @@ void CRadialBasisFunction::SetTransferCoeff(const CConfig* const* config) { Determine_ArraySize(markDonor, markTarget, nVertexDonor, nDim); /*--- Compute total number of donor vertices. ---*/ - const auto nGlobalVertexDonor = accumulate(Buffer_Receive_nVertex_Donor, - Buffer_Receive_nVertex_Donor+nProcessor, 0ul); + const auto nGlobalVertexDonor = + accumulate(Buffer_Receive_nVertex_Donor, Buffer_Receive_nVertex_Donor + nProcessor, 0ul); /*--- Gather coordinates and global point indices. ---*/ Buffer_Send_Coord.resize(MaxLocalVertex_Donor, nDim); @@ -162,9 +164,8 @@ void CRadialBasisFunction::SetTransferCoeff(const CConfig* const* config) { for (int iProcessor = 0; iProcessor < nProcessor; ++iProcessor) { auto offset = iProcessor * MaxLocalVertex_Donor; for (auto iVertex = 0ul; iVertex < Buffer_Receive_nVertex_Donor[iProcessor]; ++iVertex) { - for (int iDim = 0; iDim < nDim; ++iDim) - donorCoord(iCount,iDim) = Buffer_Receive_Coord(offset+iVertex, iDim); - donorPoint[iCount] = Buffer_Receive_GlobalPoint[offset+iVertex]; + for (int iDim = 0; iDim < nDim; ++iDim) donorCoord(iCount, iDim) = Buffer_Receive_Coord(offset + iVertex, iDim); + donorPoint[iCount] = Buffer_Receive_GlobalPoint[offset + iVertex]; donorProc[iCount] = iProcessor; ++iCount; } @@ -175,7 +176,7 @@ void CRadialBasisFunction::SetTransferCoeff(const CConfig* const* config) { * number of the RBF matrix, avoids diff results with diff number of ranks. ---*/ vector order(nGlobalVertexDonor); iota(order.begin(), order.end(), 0); - sort(order.begin(), order.end(), [&donorPoint](int i, int j){return donorPoint[i] < donorPoint[j];}); + sort(order.begin(), order.end(), [&donorPoint](int i, int j) { return donorPoint[i] < donorPoint[j]; }); for (int i = 0; i < int(nGlobalVertexDonor); ++i) { int j = order[i]; @@ -183,8 +184,7 @@ void CRadialBasisFunction::SetTransferCoeff(const CConfig* const* config) { if (i == j) continue; swap(donorProc[i], donorProc[j]); swap(donorPoint[i], donorPoint[j]); - for (int iDim = 0; iDim < nDim; ++iDim) - swap(donorCoord(i,iDim), donorCoord(j,iDim)); + for (int iDim = 0; iDim < nDim; ++iDim) swap(donorCoord(i, iDim), donorCoord(j, iDim)); } /*--- Static work scheduling over ranks based on which one has less work currently. ---*/ @@ -192,24 +192,22 @@ void CRadialBasisFunction::SetTransferCoeff(const CConfig* const* config) { for (int i = 1; i < nProcessor; ++i) if (totalWork[i] < totalWork[iProcessor]) iProcessor = i; - totalWork[iProcessor] += pow(nGlobalVertexDonor,3); // based on matrix inversion. + totalWork[iProcessor] += pow(nGlobalVertexDonor, 3); // based on matrix inversion. assignedProcessor[iMarkerInt] = iProcessor; - } delete[] Buffer_Receive_nVertex_Donor; /*--- Compute the interpolation matrices for each patch of coordinates * assigned to the rank. Subdivide work further by threads. ---*/ - vector nPolynomialVec(nMarkerInt,-1); - vector > keepPolynomialRowVec(nMarkerInt, vector(nDim,1)); + vector nPolynomialVec(nMarkerInt, -1); + vector > keepPolynomialRowVec(nMarkerInt, vector(nDim, 1)); vector CinvTrucVec(nMarkerInt); SU2_OMP_PARALLEL_(for schedule(dynamic,1)) for (unsigned short iMarkerInt = 0; iMarkerInt < nMarkerInt; ++iMarkerInt) { if (rank == assignedProcessor[iMarkerInt]) { - ComputeGeneratorMatrix(kindRBF, usePolynomial, paramRBF, - donorCoordinates[iMarkerInt], nPolynomialVec[iMarkerInt], + ComputeGeneratorMatrix(kindRBF, usePolynomial, paramRBF, donorCoordinates[iMarkerInt], nPolynomialVec[iMarkerInt], keepPolynomialRowVec[iMarkerInt], CinvTrucVec[iMarkerInt]); } } @@ -219,10 +217,12 @@ void CRadialBasisFunction::SetTransferCoeff(const CConfig* const* config) { /*--- Initialize variables for interpolation statistics. ---*/ unsigned long totalTargetPoints = 0, totalDonorPoints = 0, denseSize = 0; - MinDonors = 1<<30; MaxDonors = 0; MaxCorrection = 0.0; AvgCorrection = 0.0; + MinDonors = 1 << 30; + MaxDonors = 0; + MaxCorrection = 0.0; + AvgCorrection = 0.0; for (unsigned short iMarkerInt = 0; iMarkerInt < nMarkerInt; iMarkerInt++) { - /*--- Identify the rank that computed the interpolation matrix for this marker. ---*/ const int iProcessor = assignedProcessor[iMarkerInt]; /*--- If no processor was assigned to work, the zone does not contain the interface. ---*/ @@ -252,19 +252,17 @@ void CRadialBasisFunction::SetTransferCoeff(const CConfig* const* config) { /*--- Send C_inv_trunc only to the ranks that need it (those with target points), * partial broadcast. MPI wrapper not used due to passive double. ---*/ vector allNumVertex(nProcessor); - SU2_MPI::Allgather(&nVertexTarget, 1, MPI_UNSIGNED_LONG, - allNumVertex.data(), 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); + SU2_MPI::Allgather(&nVertexTarget, 1, MPI_UNSIGNED_LONG, allNumVertex.data(), 1, MPI_UNSIGNED_LONG, + SU2_MPI::GetComm()); if (rank == iProcessor) { for (int jProcessor = 0; jProcessor < nProcessor; ++jProcessor) if ((jProcessor != iProcessor) && (allNumVertex[jProcessor] != 0)) - MPI_Send(C_inv_trunc.data(), C_inv_trunc.size(), - MPI_DOUBLE, jProcessor, 0, SU2_MPI::GetComm()); - } - else if (nVertexTarget != 0) { - C_inv_trunc.resize(1+nPolynomial+nGlobalVertexDonor, nGlobalVertexDonor); - MPI_Recv(C_inv_trunc.data(), C_inv_trunc.size(), MPI_DOUBLE, - iProcessor, 0, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); + MPI_Send(C_inv_trunc.data(), C_inv_trunc.size(), MPI_DOUBLE, jProcessor, 0, SU2_MPI::GetComm()); + } else if (nVertexTarget != 0) { + C_inv_trunc.resize(1 + nPolynomial + nGlobalVertexDonor, nGlobalVertexDonor); + MPI_Recv(C_inv_trunc.data(), C_inv_trunc.size(), MPI_DOUBLE, iProcessor, 0, SU2_MPI::GetComm(), + MPI_STATUS_IGNORE); } #endif @@ -283,123 +281,119 @@ void CRadialBasisFunction::SetTransferCoeff(const CConfig* const* config) { targetCoord[iVertexTarget] = target_geometry->nodes->GetCoord(pointTarget); } totalTargetPoints += nVertexTarget; - denseSize += nVertexTarget*nGlobalVertexDonor; + denseSize += nVertexTarget * nGlobalVertexDonor; /*--- Distribute target slabs over the threads in the rank for processing. ---*/ SU2_OMP_PARALLEL if (nVertexTarget > 0) { - - constexpr unsigned long targetSlabSize = 32; - - su2passivematrix funcMat(targetSlabSize, 1+nPolynomial+nGlobalVertexDonor); - su2passivematrix interpMat(targetSlabSize, nGlobalVertexDonor); - - /*--- Thread-local variables for statistics. ---*/ - unsigned long minDonors = 1<<30, maxDonors = 0, totalDonors = 0; - passivedouble sumCorr = 0.0, maxCorr = 0.0; - - SU2_OMP_FOR_DYN(1) - for (auto iVertexTarget = 0ul; iVertexTarget < nVertexTarget; iVertexTarget += targetSlabSize) { - - const auto iLastVertex = min(nVertexTarget, iVertexTarget+targetSlabSize); - const auto slabSize = iLastVertex - iVertexTarget; - - /*--- Prepare matrix of functions A (the targets to donors matrix). ---*/ - - /*--- Polynominal part: ---*/ - if (usePolynomial) { - /*--- Constant term. ---*/ - for (auto k = 0ul; k < slabSize; ++k) funcMat(k,0) = 1.0; - - /*--- Linear terms. ---*/ - for (int iDim = 0, idx = 1; iDim < nDim; ++iDim) { - /*--- Of which one may have been excluded. ---*/ - if (!keepPolynomialRow[iDim]) continue; - for (auto k = 0ul; k < slabSize; ++k) - funcMat(k, idx) = SU2_TYPE::GetValue(targetCoord[iVertexTarget+k][iDim]); - idx += 1; + constexpr unsigned long targetSlabSize = 32; + + su2passivematrix funcMat(targetSlabSize, 1 + nPolynomial + nGlobalVertexDonor); + su2passivematrix interpMat(targetSlabSize, nGlobalVertexDonor); + + /*--- Thread-local variables for statistics. ---*/ + unsigned long minDonors = 1 << 30, maxDonors = 0, totalDonors = 0; + passivedouble sumCorr = 0.0, maxCorr = 0.0; + + SU2_OMP_FOR_DYN(1) + for (auto iVertexTarget = 0ul; iVertexTarget < nVertexTarget; iVertexTarget += targetSlabSize) { + const auto iLastVertex = min(nVertexTarget, iVertexTarget + targetSlabSize); + const auto slabSize = iLastVertex - iVertexTarget; + + /*--- Prepare matrix of functions A (the targets to donors matrix). ---*/ + + /*--- Polynominal part: ---*/ + if (usePolynomial) { + /*--- Constant term. ---*/ + for (auto k = 0ul; k < slabSize; ++k) funcMat(k, 0) = 1.0; + + /*--- Linear terms. ---*/ + for (int iDim = 0, idx = 1; iDim < nDim; ++iDim) { + /*--- Of which one may have been excluded. ---*/ + if (!keepPolynomialRow[iDim]) continue; + for (auto k = 0ul; k < slabSize; ++k) + funcMat(k, idx) = SU2_TYPE::GetValue(targetCoord[iVertexTarget + k][iDim]); + idx += 1; + } } - } - /*--- RBF terms: ---*/ - for (auto iVertexDonor = 0ul; iVertexDonor < nGlobalVertexDonor; ++iVertexDonor) { - for (auto k = 0ul; k < slabSize; ++k) { - auto dist = GeometryToolbox::Distance(nDim, targetCoord[iVertexTarget+k], donorCoord[iVertexDonor]); - auto rbf = Get_RadialBasisValue(kindRBF, paramRBF, dist); - funcMat(k, 1+nPolynomial+iVertexDonor) = SU2_TYPE::GetValue(rbf); + /*--- RBF terms: ---*/ + for (auto iVertexDonor = 0ul; iVertexDonor < nGlobalVertexDonor; ++iVertexDonor) { + for (auto k = 0ul; k < slabSize; ++k) { + auto dist = GeometryToolbox::Distance(nDim, targetCoord[iVertexTarget + k], donorCoord[iVertexDonor]); + auto rbf = Get_RadialBasisValue(kindRBF, paramRBF, dist); + funcMat(k, 1 + nPolynomial + iVertexDonor) = SU2_TYPE::GetValue(rbf); + } } - } - /*--- Compute slab of the interpolation matrix. ---*/ + /*--- Compute slab of the interpolation matrix. ---*/ #ifdef HAVE_LAPACK - /*--- interpMat = funcMat * C_inv_trunc, but order of gemm arguments - * is swapped due to row-major storage of su2passivematrix. ---*/ - const char op = 'N'; - const int M = interpMat.cols(), N = slabSize, K = funcMat.cols(); - // lda = C_inv_trunc.cols() = M; ldb = funcMat.cols() = K; ldc = interpMat.cols() = M; - const passivedouble alpha = 1.0, beta = 0.0; - DGEMM(&op, &op, &M, &N, &K, &alpha, C_inv_trunc[0], &M, funcMat[0], &K, &beta, interpMat[0], &M); + /*--- interpMat = funcMat * C_inv_trunc, but order of gemm arguments + * is swapped due to row-major storage of su2passivematrix. ---*/ + const char op = 'N'; + const int M = interpMat.cols(), N = slabSize, K = funcMat.cols(); + // lda = C_inv_trunc.cols() = M; ldb = funcMat.cols() = K; ldc = interpMat.cols() = M; + const passivedouble alpha = 1.0, beta = 0.0; + DGEMM(&op, &op, &M, &N, &K, &alpha, C_inv_trunc[0], &M, funcMat[0], &K, &beta, interpMat[0], &M); #else - /*--- Naive product, loop order considers short-wide - * nature of funcMat and interpMat. ---*/ - interpMat = 0.0; - for (auto k = 0ul; k < funcMat.cols(); ++k) - for (auto i = 0ul; i < slabSize; ++i) - for (auto j = 0ul; j < interpMat.cols(); ++j) - interpMat(i,j) += funcMat(i,k) * C_inv_trunc(k,j); + /*--- Naive product, loop order considers short-wide + * nature of funcMat and interpMat. ---*/ + interpMat = 0.0; + for (auto k = 0ul; k < funcMat.cols(); ++k) + for (auto i = 0ul; i < slabSize; ++i) + for (auto j = 0ul; j < interpMat.cols(); ++j) interpMat(i, j) += funcMat(i, k) * C_inv_trunc(k, j); #endif - /*--- Set interpolation coefficients. ---*/ - - for (auto k = 0ul; k < slabSize; ++k) { - auto& targetVertex = targetVertices[markTarget][iVertexTarget+k]; - - /*--- Prune small coefficients. ---*/ - auto info = PruneSmallCoefficients(SU2_TYPE::GetValue(pruneTol), interpMat.cols(), interpMat[k]); - auto nnz = info.first; - totalDonors += nnz; - minDonors = min(minDonors, nnz); - maxDonors = max(maxDonors, nnz); - auto corr = fabs(info.second-1.0); // far from 1 either way is bad; - sumCorr += corr; - maxCorr = max(maxCorr, corr); - - /*--- Allocate and set donor information for this target point. ---*/ - targetVertex.resize(nnz); - - for (unsigned long iVertex = 0, iSet = 0; iVertex < nGlobalVertexDonor; ++iVertex) { - auto coeff = interpMat(k,iVertex); - if (fabs(coeff) > 0.0) { - targetVertex.processor[iSet] = donorProc[iVertex]; - targetVertex.globalPoint[iSet] = donorPoint[iVertex]; - targetVertex.coefficient[iSet] = coeff; - ++iSet; + /*--- Set interpolation coefficients. ---*/ + + for (auto k = 0ul; k < slabSize; ++k) { + auto& targetVertex = targetVertices[markTarget][iVertexTarget + k]; + + /*--- Prune small coefficients. ---*/ + auto info = PruneSmallCoefficients(SU2_TYPE::GetValue(pruneTol), interpMat.cols(), interpMat[k]); + auto nnz = info.first; + totalDonors += nnz; + minDonors = min(minDonors, nnz); + maxDonors = max(maxDonors, nnz); + auto corr = fabs(info.second - 1.0); // far from 1 either way is bad; + sumCorr += corr; + maxCorr = max(maxCorr, corr); + + /*--- Allocate and set donor information for this target point. ---*/ + targetVertex.resize(nnz); + + for (unsigned long iVertex = 0, iSet = 0; iVertex < nGlobalVertexDonor; ++iVertex) { + auto coeff = interpMat(k, iVertex); + if (fabs(coeff) > 0.0) { + targetVertex.processor[iSet] = donorProc[iVertex]; + targetVertex.globalPoint[iSet] = donorPoint[iVertex]; + targetVertex.coefficient[iSet] = coeff; + ++iSet; + } } } + } // end target vertex loop + END_SU2_OMP_FOR + SU2_OMP_CRITICAL { + totalDonorPoints += totalDonors; + MinDonors = min(MinDonors, minDonors); + MaxDonors = max(MaxDonors, maxDonors); + AvgCorrection += sumCorr; + MaxCorrection = max(MaxCorrection, maxCorr); } - } // end target vertex loop - END_SU2_OMP_FOR - SU2_OMP_CRITICAL - { - totalDonorPoints += totalDonors; - MinDonors = min(MinDonors, minDonors); - MaxDonors = max(MaxDonors, maxDonors); - AvgCorrection += sumCorr; - MaxCorrection = max(MaxCorrection, maxCorr); - } - END_SU2_OMP_CRITICAL + END_SU2_OMP_CRITICAL } END_SU2_OMP_PARALLEL /*--- Free global data that will no longer be used. ---*/ - donorCoord.resize(0,0); + donorCoord.resize(0, 0); vector().swap(donorPoint); vector().swap(donorProc); - C_inv_trunc.resize(0,0); + C_inv_trunc.resize(0, 0); - } // end loop over interface markers + } // end loop over interface markers /*--- Final reduction of interpolation statistics and basic sanity checks. ---*/ - auto Reduce = [](SU2_MPI::Op op, unsigned long &val) { + auto Reduce = [](SU2_MPI::Op op, unsigned long& val) { auto tmp = val; SU2_MPI::Allreduce(&tmp, &val, 1, MPI_UNSIGNED_LONG, op, SU2_MPI::GetComm()); }; @@ -413,26 +407,25 @@ void CRadialBasisFunction::SetTransferCoeff(const CConfig* const* config) { MPI_Allreduce(&tmp1, &AvgCorrection, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); MPI_Allreduce(&tmp2, &MaxCorrection, 1, MPI_DOUBLE, MPI_MAX, SU2_MPI::GetComm()); #endif - if (totalTargetPoints == 0) - SU2_MPI::Error("Somehow there are no target interpolation points.", CURRENT_FUNCTION); + if (totalTargetPoints == 0) SU2_MPI::Error("Somehow there are no target interpolation points.", CURRENT_FUNCTION); if (MinDonors == 0) - SU2_MPI::Error("One or more target points have no donors, either:\n" - " - The interface surfaces are not in contact.\n" - " - The RBF radius is too small.\n" - " - The pruning tolerance is too aggressive.", CURRENT_FUNCTION); - - MaxCorrection += 1.0; // put back the reference "1" + SU2_MPI::Error( + "One or more target points have no donors, either:\n" + " - The interface surfaces are not in contact.\n" + " - The RBF radius is too small.\n" + " - The pruning tolerance is too aggressive.", + CURRENT_FUNCTION); + + MaxCorrection += 1.0; // put back the reference "1" AvgCorrection = AvgCorrection / totalTargetPoints + 1.0; AvgDonors = totalDonorPoints / totalTargetPoints; - Density = totalDonorPoints / (0.01*denseSize); - + Density = totalDonorPoints / (0.01 * denseSize); } -void CRadialBasisFunction::ComputeGeneratorMatrix(RADIAL_BASIS type, bool usePolynomial, - su2double radius, const su2activematrix& coords, int& nPolynomial, - vector& keepPolynomialRow, su2passivematrix& C_inv_trunc) { - +void CRadialBasisFunction::ComputeGeneratorMatrix(RADIAL_BASIS type, bool usePolynomial, su2double radius, + const su2activematrix& coords, int& nPolynomial, + vector& keepPolynomialRow, su2passivematrix& C_inv_trunc) { const su2double interfaceCoordTol = 1e6 * numeric_limits::epsilon(); const int nVertexDonor = coords.rows(); @@ -443,24 +436,22 @@ void CRadialBasisFunction::ComputeGeneratorMatrix(RADIAL_BASIS type, bool usePol for (int iVertex = 0; iVertex < nVertexDonor; ++iVertex) for (int jVertex = iVertex; jVertex < nVertexDonor; ++jVertex) - global_M(iVertex, jVertex) = SU2_TYPE::GetValue(Get_RadialBasisValue(type, radius, - GeometryToolbox::Distance(nDim, coords[iVertex], coords[jVertex]))); + global_M(iVertex, jVertex) = SU2_TYPE::GetValue( + Get_RadialBasisValue(type, radius, GeometryToolbox::Distance(nDim, coords[iVertex], coords[jVertex]))); /*--- Invert M matrix (operation is in-place). ---*/ - const bool kernelIsSPD = (type==RADIAL_BASIS::WENDLAND_C2) || (type==RADIAL_BASIS::GAUSSIAN) || - (type==RADIAL_BASIS::INV_MULTI_QUADRIC); + const bool kernelIsSPD = (type == RADIAL_BASIS::WENDLAND_C2) || (type == RADIAL_BASIS::GAUSSIAN) || + (type == RADIAL_BASIS::INV_MULTI_QUADRIC); global_M.Invert(kernelIsSPD); /*--- Compute C_inv_trunc. ---*/ if (usePolynomial) { - /*--- Fill P matrix (P for points, with an extra top row of ones). ---*/ - su2passivematrix P(1+nDim, nVertexDonor); + su2passivematrix P(1 + nDim, nVertexDonor); for (int iVertex = 0; iVertex < nVertexDonor; iVertex++) { P(0, iVertex) = 1.0; - for (int iDim = 0; iDim < nDim; ++iDim) - P(1+iDim, iVertex) = SU2_TYPE::GetValue(coords(iVertex, iDim)); + for (int iDim = 0; iDim < nDim; ++iDim) P(1 + iDim, iVertex) = SU2_TYPE::GetValue(coords(iVertex, iDim)); } /*--- Check if points lie on a plane and remove one coordinate from P if so. ---*/ @@ -471,13 +462,12 @@ void CRadialBasisFunction::ComputeGeneratorMatrix(RADIAL_BASIS type, bool usePol global_M.MatMatMult('R', P, Q); /*--- Compute Mp = (Q * P^T)^-1 ---*/ - CSymmetricMatrix Mp(nPolynomial+1); + CSymmetricMatrix Mp(nPolynomial + 1); for (int i = 0; i <= nPolynomial; ++i) for (int j = i; j <= nPolynomial; ++j) { - Mp(i,j) = 0.0; - for (int k = 0; k < nVertexDonor; ++k) - Mp(i,j) += Q(i,k) * P(j,k); + Mp(i, j) = 0.0; + for (int k = 0; k < nVertexDonor; ++k) Mp(i, j) += Q(i, k) * P(j, k); } Mp.Invert(false); @@ -490,40 +480,36 @@ void CRadialBasisFunction::ComputeGeneratorMatrix(RADIAL_BASIS type, bool usePol #ifdef HAVE_LAPACK /*--- Order of gemm arguments swapped due to row-major storage. ---*/ const char opa = 'N', opb = 'T'; - const int M = nVertexDonor, N = nVertexDonor, K = nPolynomial+1; + const int M = nVertexDonor, N = nVertexDonor, K = nPolynomial + 1; // lda = C_inv_top.cols() = M; ldb = Q.cols() = M; ldc = C_inv_bot.cols() = M; const passivedouble alpha = -1.0, beta = 1.0; DGEMM(&opa, &opb, &M, &N, &K, &alpha, C_inv_top[0], &M, Q[0], &M, &beta, C_inv_bot[0], &M); -#else // naive product +#else // naive product for (int i = 0; i < nVertexDonor; ++i) for (int j = 0; j < nVertexDonor; ++j) - for (int k = 0; k <= nPolynomial; ++k) - C_inv_bot(i,j) -= Q(k,i) * C_inv_top(k,j); + for (int k = 0; k <= nPolynomial; ++k) C_inv_bot(i, j) -= Q(k, i) * C_inv_top(k, j); #endif /*--- Merge top and bottom of C_inv_trunc. More intrusive memory * management, or separate handling of top and bottom, would * avoid these copies (and associated temporary vars). ---*/ - C_inv_trunc.resize(1+nPolynomial+nVertexDonor, nVertexDonor); - memcpy(C_inv_trunc[0], C_inv_top.data(), C_inv_top.size()*sizeof(passivedouble)); - memcpy(C_inv_trunc[1+nPolynomial], C_inv_bot.data(), C_inv_bot.size()*sizeof(passivedouble)); - } - else { + C_inv_trunc.resize(1 + nPolynomial + nVertexDonor, nVertexDonor); + memcpy(C_inv_trunc[0], C_inv_top.data(), C_inv_top.size() * sizeof(passivedouble)); + memcpy(C_inv_trunc[1 + nPolynomial], C_inv_bot.data(), C_inv_bot.size() * sizeof(passivedouble)); + } else { /*--- No polynomial term used in the interpolation, C_inv_trunc = M^-1. ---*/ C_inv_trunc = global_M.StealData(); - } // end usePolynomial - + } // end usePolynomial } -int CRadialBasisFunction::CheckPolynomialTerms(su2double max_diff_tol, vector& keep_row, - su2passivematrix &P) { +int CRadialBasisFunction::CheckPolynomialTerms(su2double max_diff_tol, vector& keep_row, su2passivematrix& P) { const int m = P.rows(); const int n = P.cols(); /*--- The first row of P is all ones and we do not care about it for this analysis. ---*/ - const int n_rows = m-1; + const int n_rows = m - 1; keep_row.resize(n_rows); /*--- By default assume points are not on a plane (all rows kept). ---*/ @@ -538,17 +524,16 @@ int CRadialBasisFunction::CheckPolynomialTerms(su2double max_diff_tol, vector rhs(n_rows,0.0), coeff(n_rows); + vector rhs(n_rows, 0.0), coeff(n_rows); for (int i = 0; i < n_rows; ++i) - for (int j = 0; j < n; ++j) - rhs[i] += P(i+1,j); + for (int j = 0; j < n; ++j) rhs[i] += P(i + 1, j); /*--- Multiply the RHS by the inverse thus obtaining the coefficients. ---*/ PPT.MatVecMult(rhs.begin(), coeff.begin()); @@ -556,33 +541,29 @@ int CRadialBasisFunction::CheckPolynomialTerms(su2double max_diff_tol, vector abs(coeff[remove_row])) - remove_row = i; + if (abs(coeff[i]) > abs(coeff[remove_row])) remove_row = i; /*--- Mark row as removed and adjust number of polynomial terms. ---*/ - n_polynomial = n_rows-1; + n_polynomial = n_rows - 1; keep_row[remove_row] = 0; /*--- Truncated P by shifting rows "up". ---*/ - for (auto i = remove_row+1; i < m-1; ++i) - for (int j = 0; j < n; ++j) - P(i,j) = P(i+1,j); + for (auto i = remove_row + 1; i < m - 1; ++i) + for (int j = 0; j < n; ++j) P(i, j) = P(i + 1, j); } return n_polynomial; diff --git a/Common/src/interface_interpolation/CSlidingMesh.cpp b/Common/src/interface_interpolation/CSlidingMesh.cpp index 81c46bf88b6..25e5570fb2f 100644 --- a/Common/src/interface_interpolation/CSlidingMesh.cpp +++ b/Common/src/interface_interpolation/CSlidingMesh.cpp @@ -2,7 +2,7 @@ * \file CSlidingMesh.cpp * \brief Implementation of sliding mesh interpolation. * \author H. Kline - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -30,15 +30,13 @@ #include "../../include/geometry/CGeometry.hpp" #include "../../include/toolboxes/geometry_toolbox.hpp" - -CSlidingMesh::CSlidingMesh(CGeometry ****geometry_container, const CConfig* const* config, - unsigned int iZone, unsigned int jZone) : - CInterpolator(geometry_container, config, iZone, jZone) { +CSlidingMesh::CSlidingMesh(CGeometry**** geometry_container, const CConfig* const* config, unsigned int iZone, + unsigned int jZone) + : CInterpolator(geometry_container, config, iZone, jZone) { SetTransferCoeff(config); } void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { - /* 0 - Variable declaration */ /* --- General variables --- */ @@ -64,7 +62,6 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { su2double Area, Area_old, tmp_Area; su2double LineIntersectionLength, *Direction, length; - /* --- Markers Variables --- */ unsigned short iMarkerInt, nMarkerInt; @@ -80,7 +77,7 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { su2vector Target_nLinkedNodes; su2vector Target_StartLinkedNodes; - unsigned long *target_segment; + unsigned long* target_segment; su2vector Target_LinkedNodes; su2vector Target_GlobalPoint, Donor_GlobalPoint; @@ -100,7 +97,7 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { su2vector Donor_Proc; su2double *donor_iMidEdge_point, *donor_jMidEdge_point; - su2double **donor_element; + su2double** donor_element; su2activematrix DonorPoint_Coord; targetVertices.resize(config[targetZone]->GetnMarker_All()); @@ -113,24 +110,22 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { Donor_Vect = nullptr; Coeff_Vect = nullptr; - storeProc = nullptr; + storeProc = nullptr; tmp_Donor_Vect = nullptr; tmp_Coeff_Vect = nullptr; - tmp_storeProc = nullptr; + tmp_storeProc = nullptr; - Normal = new su2double[nDim]; + Normal = new su2double[nDim]; Direction = new su2double[nDim]; - /* 2 - Find boundary tag between touching grids */ /*--- Number of markers on the FSI interface ---*/ - nMarkerInt = (int)( config[ donorZone ]->GetMarker_n_ZoneInterface() ) / 2; + nMarkerInt = (int)(config[donorZone]->GetMarker_n_ZoneInterface()) / 2; /*--- For the number of markers on the interface... ---*/ - for ( iMarkerInt = 0; iMarkerInt < nMarkerInt; iMarkerInt++ ){ - + for (iMarkerInt = 0; iMarkerInt < nMarkerInt; iMarkerInt++) { /*--- On the donor side: find the tag of the boundary sharing the interface ---*/ markDonor = config[donorZone]->FindInterfaceMarker(iMarkerInt); @@ -138,10 +133,10 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { markTarget = config[targetZone]->FindInterfaceMarker(iMarkerInt); /*--- Checks if the zone contains the interface, if not continue to the next step ---*/ - if(!CheckInterfaceBoundary(markDonor, markTarget)) continue; + if (!CheckInterfaceBoundary(markDonor, markTarget)) continue; nVertexTarget = 0; - if(markTarget != -1) nVertexTarget = target_geometry->GetnVertex( markTarget ); + if (markTarget != -1) nVertexTarget = target_geometry->GetnVertex(markTarget); /* 3 -Reconstruct the boundaries from parallel partitioning @@ -152,23 +147,23 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { nGlobalVertex_Target = nGlobalVertex; - TargetPoint_Coord = Buffer_Receive_Coord; - Target_GlobalPoint = Buffer_Receive_GlobalPoint; - Target_nLinkedNodes = Buffer_Receive_nLinkedNodes; + TargetPoint_Coord = Buffer_Receive_Coord; + Target_GlobalPoint = Buffer_Receive_GlobalPoint; + Target_nLinkedNodes = Buffer_Receive_nLinkedNodes; Target_StartLinkedNodes = Buffer_Receive_StartLinkedNodes; - Target_LinkedNodes = Buffer_Receive_LinkedNodes; + Target_LinkedNodes = Buffer_Receive_LinkedNodes; /*--- Donor boundary ---*/ ReconstructBoundary(donorZone, markDonor); nGlobalVertex_Donor = nGlobalVertex; - DonorPoint_Coord = Buffer_Receive_Coord; - Donor_GlobalPoint = Buffer_Receive_GlobalPoint; - Donor_nLinkedNodes = Buffer_Receive_nLinkedNodes; + DonorPoint_Coord = Buffer_Receive_Coord; + Donor_GlobalPoint = Buffer_Receive_GlobalPoint; + Donor_nLinkedNodes = Buffer_Receive_nLinkedNodes; Donor_StartLinkedNodes = Buffer_Receive_StartLinkedNodes; - Donor_LinkedNodes = Buffer_Receive_LinkedNodes; - Donor_Proc = Buffer_Receive_Proc; + Donor_LinkedNodes = Buffer_Receive_LinkedNodes; + Donor_Proc = Buffer_Receive_Proc; /*--- Starts building the supermesh layer (2D or 3D) ---*/ /* - For each target node, it first finds the closest donor point @@ -178,8 +173,7 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { */ if (nVertexTarget) targetVertices[markTarget].resize(nVertexTarget); - if(nDim == 2){ - + if (nDim == 2) { target_iMidEdge_point = new su2double[nDim]; target_jMidEdge_point = new su2double[nDim]; @@ -191,15 +185,13 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { target_segment = new unsigned long[2]; for (iVertex = 0; iVertex < nVertexTarget; iVertex++) { - nDonorPoints = 0; /*--- Stores coordinates of the target node ---*/ target_iPoint = target_geometry->vertex[markTarget][iVertex]->GetNode(); - if (target_geometry->nodes->GetDomain(target_iPoint)){ - + if (target_geometry->nodes->GetDomain(target_iPoint)) { Coord_i = target_geometry->nodes->GetCoord(target_iPoint); /*--- Brute force to find the closest donor_node ---*/ @@ -208,8 +200,7 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { donor_StartIndex = 0; for (donor_iPoint = 0; donor_iPoint < nGlobalVertex_Donor; donor_iPoint++) { - - Coord_j = DonorPoint_Coord[ donor_iPoint ]; + Coord_j = DonorPoint_Coord[donor_iPoint]; dist = GeometryToolbox::Distance(nDim, Coord_i, Coord_j); @@ -218,45 +209,44 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { donor_StartIndex = donor_iPoint; } - if (dist == 0.0){ + if (dist == 0.0) { donor_StartIndex = donor_iPoint; break; } } - donor_iPoint = donor_StartIndex; + donor_iPoint = donor_StartIndex; donor_OldiPoint = donor_iPoint; /*--- Contruct information regarding the target cell ---*/ auto dPoint = target_geometry->nodes->GetGlobalIndex(target_iPoint); for (jVertexTarget = 0; jVertexTarget < nGlobalVertex_Target; jVertexTarget++) - if( dPoint == Target_GlobalPoint[jVertexTarget] ) - break; + if (dPoint == Target_GlobalPoint[jVertexTarget]) break; - if ( Target_nLinkedNodes[jVertexTarget] == 1 ){ - target_segment[0] = Target_LinkedNodes[ Target_StartLinkedNodes[jVertexTarget] ]; + if (Target_nLinkedNodes[jVertexTarget] == 1) { + target_segment[0] = Target_LinkedNodes[Target_StartLinkedNodes[jVertexTarget]]; target_segment[1] = jVertexTarget; - } - else{ - target_segment[0] = Target_LinkedNodes[ Target_StartLinkedNodes[jVertexTarget] ]; - target_segment[1] = Target_LinkedNodes[ Target_StartLinkedNodes[jVertexTarget] + 1]; + } else { + target_segment[0] = Target_LinkedNodes[Target_StartLinkedNodes[jVertexTarget]]; + target_segment[1] = Target_LinkedNodes[Target_StartLinkedNodes[jVertexTarget] + 1]; } dTMP = 0; - for(iDim = 0; iDim < nDim; iDim++){ - target_iMidEdge_point[iDim] = ( TargetPoint_Coord(target_segment[0], iDim ) + - target_geometry->nodes->GetCoord( target_iPoint , iDim) ) / 2.; - target_jMidEdge_point[iDim] = ( TargetPoint_Coord(target_segment[1], iDim ) + - target_geometry->nodes->GetCoord( target_iPoint , iDim) ) / 2.; + for (iDim = 0; iDim < nDim; iDim++) { + target_iMidEdge_point[iDim] = + (TargetPoint_Coord(target_segment[0], iDim) + target_geometry->nodes->GetCoord(target_iPoint, iDim)) / + 2.; + target_jMidEdge_point[iDim] = + (TargetPoint_Coord(target_segment[1], iDim) + target_geometry->nodes->GetCoord(target_iPoint, iDim)) / + 2.; Direction[iDim] = target_jMidEdge_point[iDim] - target_iMidEdge_point[iDim]; dTMP += Direction[iDim] * Direction[iDim]; } dTMP = sqrt(dTMP); - for(iDim = 0; iDim < nDim; iDim++) - Direction[iDim] /= dTMP; + for (iDim = 0; iDim < nDim; iDim++) Direction[iDim] /= dTMP; length = GeometryToolbox::Distance(nDim, target_iMidEdge_point, target_jMidEdge_point); @@ -264,156 +254,153 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { /*--- Proceeds along the forward direction (depending on which connected boundary node is found first) ---*/ - while( !check ){ - + while (!check) { /*--- Proceeds until the value of the intersection area is null ---*/ - if ( Donor_nLinkedNodes[donor_iPoint] == 1 ){ - donor_forward_point = Donor_LinkedNodes[ Donor_StartLinkedNodes[donor_iPoint] ]; + if (Donor_nLinkedNodes[donor_iPoint] == 1) { + donor_forward_point = Donor_LinkedNodes[Donor_StartLinkedNodes[donor_iPoint]]; donor_backward_point = donor_iPoint; - } - else{ - uptr = &Donor_LinkedNodes[ Donor_StartLinkedNodes[donor_iPoint] ]; + } else { + uptr = &Donor_LinkedNodes[Donor_StartLinkedNodes[donor_iPoint]]; - if( donor_OldiPoint != uptr[0] ){ - donor_forward_point = uptr[0]; + if (donor_OldiPoint != uptr[0]) { + donor_forward_point = uptr[0]; donor_backward_point = uptr[1]; - } - else{ - donor_forward_point = uptr[1]; + } else { + donor_forward_point = uptr[1]; donor_backward_point = uptr[0]; } } - if(donor_iPoint >= nGlobalVertex_Donor){ + if (donor_iPoint >= nGlobalVertex_Donor) { check = true; continue; } - for(iDim = 0; iDim < nDim; iDim++){ - donor_iMidEdge_point[iDim] = ( DonorPoint_Coord(donor_forward_point, iDim) + - DonorPoint_Coord(donor_iPoint, iDim) ) / 2.; - donor_jMidEdge_point[iDim] = ( DonorPoint_Coord(donor_backward_point, iDim) + - DonorPoint_Coord(donor_iPoint, iDim) ) / 2.; + for (iDim = 0; iDim < nDim; iDim++) { + donor_iMidEdge_point[iDim] = + (DonorPoint_Coord(donor_forward_point, iDim) + DonorPoint_Coord(donor_iPoint, iDim)) / 2.; + donor_jMidEdge_point[iDim] = + (DonorPoint_Coord(donor_backward_point, iDim) + DonorPoint_Coord(donor_iPoint, iDim)) / 2.; } - LineIntersectionLength = ComputeLineIntersectionLength(nDim, target_iMidEdge_point, target_jMidEdge_point, - donor_iMidEdge_point, donor_jMidEdge_point, Direction); + LineIntersectionLength = + ComputeLineIntersectionLength(nDim, target_iMidEdge_point, target_jMidEdge_point, donor_iMidEdge_point, + donor_jMidEdge_point, Direction); - if ( LineIntersectionLength == 0.0 ){ + if (LineIntersectionLength == 0.0) { check = true; continue; } - /*--- In case the element intersects the target cell, update the auxiliary communication data structure ---*/ + /*--- In case the element intersects the target cell, update the auxiliary communication data structure + * ---*/ - tmp_Coeff_Vect = new su2double[ nDonorPoints + 1 ]; - tmp_Donor_Vect = new unsigned long[ nDonorPoints + 1 ]; - tmp_storeProc = new unsigned long[ nDonorPoints + 1 ]; + tmp_Coeff_Vect = new su2double[nDonorPoints + 1]; + tmp_Donor_Vect = new unsigned long[nDonorPoints + 1]; + tmp_storeProc = new unsigned long[nDonorPoints + 1]; - for( iDonor = 0; iDonor < nDonorPoints; iDonor++){ + for (iDonor = 0; iDonor < nDonorPoints; iDonor++) { tmp_Donor_Vect[iDonor] = Donor_Vect[iDonor]; tmp_Coeff_Vect[iDonor] = Coeff_Vect[iDonor]; - tmp_storeProc[iDonor] = storeProc[iDonor]; + tmp_storeProc[iDonor] = storeProc[iDonor]; } - tmp_Donor_Vect[ nDonorPoints ] = donor_iPoint; - tmp_Coeff_Vect[ nDonorPoints ] = LineIntersectionLength / length; - tmp_storeProc[ nDonorPoints ] = Donor_Proc[donor_iPoint]; + tmp_Donor_Vect[nDonorPoints] = donor_iPoint; + tmp_Coeff_Vect[nDonorPoints] = LineIntersectionLength / length; + tmp_storeProc[nDonorPoints] = Donor_Proc[donor_iPoint]; - delete [] Donor_Vect; - delete [] Coeff_Vect; - delete [] storeProc; + delete[] Donor_Vect; + delete[] Coeff_Vect; + delete[] storeProc; Donor_Vect = tmp_Donor_Vect; Coeff_Vect = tmp_Coeff_Vect; - storeProc = tmp_storeProc; + storeProc = tmp_storeProc; donor_OldiPoint = donor_iPoint; - donor_iPoint = donor_forward_point; + donor_iPoint = donor_forward_point; nDonorPoints++; } - if ( Donor_nLinkedNodes[donor_StartIndex] == 2 ){ + if (Donor_nLinkedNodes[donor_StartIndex] == 2) { check = false; - uptr = &Donor_LinkedNodes[ Donor_StartLinkedNodes[donor_StartIndex] ]; + uptr = &Donor_LinkedNodes[Donor_StartLinkedNodes[donor_StartIndex]]; donor_iPoint = uptr[1]; donor_OldiPoint = donor_StartIndex; - } - else + } else check = true; /*--- Proceeds along the backward direction (depending on which connected boundary node is found first) ---*/ - while( !check ){ - + while (!check) { /*--- Proceeds until the value of the intersection length is null ---*/ - if ( Donor_nLinkedNodes[donor_iPoint] == 1 ){ - donor_forward_point = donor_OldiPoint; + if (Donor_nLinkedNodes[donor_iPoint] == 1) { + donor_forward_point = donor_OldiPoint; donor_backward_point = donor_iPoint; - } - else{ - uptr = &Donor_LinkedNodes[ Donor_StartLinkedNodes[donor_iPoint] ]; + } else { + uptr = &Donor_LinkedNodes[Donor_StartLinkedNodes[donor_iPoint]]; - if( donor_OldiPoint != uptr[0] ){ - donor_forward_point = uptr[0]; + if (donor_OldiPoint != uptr[0]) { + donor_forward_point = uptr[0]; donor_backward_point = uptr[1]; - } - else{ - donor_forward_point = uptr[1]; + } else { + donor_forward_point = uptr[1]; donor_backward_point = uptr[0]; } } - if(donor_iPoint >= nGlobalVertex_Donor){ + if (donor_iPoint >= nGlobalVertex_Donor) { check = true; continue; } - for(iDim = 0; iDim < nDim; iDim++){ - donor_iMidEdge_point[iDim] = ( DonorPoint_Coord(donor_forward_point , iDim) + - DonorPoint_Coord(donor_iPoint, iDim) ) / 2.; - donor_jMidEdge_point[iDim] = ( DonorPoint_Coord(donor_backward_point, iDim) + - DonorPoint_Coord(donor_iPoint, iDim) ) / 2.; + for (iDim = 0; iDim < nDim; iDim++) { + donor_iMidEdge_point[iDim] = + (DonorPoint_Coord(donor_forward_point, iDim) + DonorPoint_Coord(donor_iPoint, iDim)) / 2.; + donor_jMidEdge_point[iDim] = + (DonorPoint_Coord(donor_backward_point, iDim) + DonorPoint_Coord(donor_iPoint, iDim)) / 2.; } - LineIntersectionLength = ComputeLineIntersectionLength(nDim, target_iMidEdge_point, target_jMidEdge_point, - donor_iMidEdge_point, donor_jMidEdge_point, Direction); + LineIntersectionLength = + ComputeLineIntersectionLength(nDim, target_iMidEdge_point, target_jMidEdge_point, donor_iMidEdge_point, + donor_jMidEdge_point, Direction); - if ( LineIntersectionLength == 0.0 ){ + if (LineIntersectionLength == 0.0) { check = true; continue; } - /*--- In case the element intersects the target cell, update the auxiliary communication data structure ---*/ + /*--- In case the element intersects the target cell, update the auxiliary communication data structure + * ---*/ - tmp_Coeff_Vect = new su2double[ nDonorPoints + 1 ]; - tmp_Donor_Vect = new unsigned long[ nDonorPoints + 1 ]; - tmp_storeProc = new unsigned long[ nDonorPoints + 1 ]; + tmp_Coeff_Vect = new su2double[nDonorPoints + 1]; + tmp_Donor_Vect = new unsigned long[nDonorPoints + 1]; + tmp_storeProc = new unsigned long[nDonorPoints + 1]; - for( iDonor = 0; iDonor < nDonorPoints; iDonor++){ + for (iDonor = 0; iDonor < nDonorPoints; iDonor++) { tmp_Donor_Vect[iDonor] = Donor_Vect[iDonor]; tmp_Coeff_Vect[iDonor] = Coeff_Vect[iDonor]; - tmp_storeProc[iDonor] = storeProc[iDonor]; + tmp_storeProc[iDonor] = storeProc[iDonor]; } - tmp_Coeff_Vect[ nDonorPoints ] = LineIntersectionLength / length; - tmp_Donor_Vect[ nDonorPoints ] = donor_iPoint; - tmp_storeProc[ nDonorPoints ] = Donor_Proc[donor_iPoint]; + tmp_Coeff_Vect[nDonorPoints] = LineIntersectionLength / length; + tmp_Donor_Vect[nDonorPoints] = donor_iPoint; + tmp_storeProc[nDonorPoints] = Donor_Proc[donor_iPoint]; - delete [] Donor_Vect; - delete [] Coeff_Vect; - delete [] storeProc; + delete[] Donor_Vect; + delete[] Coeff_Vect; + delete[] storeProc; Donor_Vect = tmp_Donor_Vect; Coeff_Vect = tmp_Coeff_Vect; - storeProc = tmp_storeProc; + storeProc = tmp_storeProc; donor_OldiPoint = donor_iPoint; - donor_iPoint = donor_forward_point; + donor_iPoint = donor_forward_point; nDonorPoints++; } @@ -422,7 +409,7 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { targetVertices[markTarget][iVertex].resize(nDonorPoints); - for ( iDonor = 0; iDonor < nDonorPoints; iDonor++ ){ + for (iDonor = 0; iDonor < nDonorPoints; iDonor++) { targetVertices[markTarget][iVertex].coefficient[iDonor] = Coeff_Vect[iDonor]; targetVertices[markTarget][iVertex].globalPoint[iDonor] = Donor_GlobalPoint[Donor_Vect[iDonor]]; targetVertices[markTarget][iVertex].processor[iDonor] = storeProc[iDonor]; @@ -430,19 +417,17 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { } } - delete [] target_segment; + delete[] target_segment; - delete [] target_iMidEdge_point; - delete [] target_jMidEdge_point; + delete[] target_iMidEdge_point; + delete[] target_jMidEdge_point; - delete [] donor_iMidEdge_point; - delete [] donor_jMidEdge_point; - } - else{ + delete[] donor_iMidEdge_point; + delete[] donor_jMidEdge_point; + } else { /* --- 3D geometry, creates a superficial super-mesh --- */ for (iVertex = 0; iVertex < nVertexTarget; iVertex++) { - nDonorPoints = 0; /*--- Stores coordinates of the target node ---*/ @@ -458,27 +443,23 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { /*--- The value of Area computed here includes also portion of boundary belonging to different marker ---*/ Area = GeometryToolbox::Norm(nDim, Normal); - for (iDim = 0; iDim < nDim; iDim++) - Normal[iDim] /= Area; + for (iDim = 0; iDim < nDim; iDim++) Normal[iDim] /= Area; - for (iDim = 0; iDim < nDim; iDim++) - Coord_i[iDim] = target_geometry->nodes->GetCoord(target_iPoint, iDim); + for (iDim = 0; iDim < nDim; iDim++) Coord_i[iDim] = target_geometry->nodes->GetCoord(target_iPoint, iDim); auto dPoint = target_geometry->nodes->GetGlobalIndex(target_iPoint); - for (target_iPoint = 0; target_iPoint < nGlobalVertex_Target; target_iPoint++){ - if( dPoint == Target_GlobalPoint[target_iPoint] ) - break; + for (target_iPoint = 0; target_iPoint < nGlobalVertex_Target; target_iPoint++) { + if (dPoint == Target_GlobalPoint[target_iPoint]) break; } /*--- Build local surface dual mesh for target element ---*/ nEdges_target = Target_nLinkedNodes[target_iPoint]; - nNode_target = 2*(nEdges_target + 1); + nNode_target = 2 * (nEdges_target + 1); target_element = new su2double*[nNode_target]; - for (ii = 0; ii < nNode_target; ii++) - target_element[ii] = new su2double[nDim]; + for (ii = 0; ii < nNode_target; ii++) target_element[ii] = new su2double[nDim]; nNode_target = Build_3D_surface_element(Target_LinkedNodes, Target_StartLinkedNodes, Target_nLinkedNodes, TargetPoint_Coord, target_iPoint, target_element); @@ -489,8 +470,7 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { donor_StartIndex = 0; for (donor_iPoint = 0; donor_iPoint < nGlobalVertex_Donor; donor_iPoint++) { - - Coord_j = DonorPoint_Coord[ donor_iPoint ]; + Coord_j = DonorPoint_Coord[donor_iPoint]; dist = GeometryToolbox::Distance(nDim, Coord_i, Coord_j); @@ -499,7 +479,7 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { donor_StartIndex = donor_iPoint; } - if (dist == 0.0){ + if (dist == 0.0) { donor_StartIndex = donor_iPoint; break; } @@ -509,36 +489,34 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { nEdges_donor = Donor_nLinkedNodes[donor_iPoint]; - donor_element = new su2double*[ 2*nEdges_donor + 2 ]; - for (ii = 0; ii < 2*nEdges_donor + 2; ii++) - donor_element[ii] = new su2double[nDim]; + donor_element = new su2double*[2 * nEdges_donor + 2]; + for (ii = 0; ii < 2 * nEdges_donor + 2; ii++) donor_element[ii] = new su2double[nDim]; nNode_donor = Build_3D_surface_element(Donor_LinkedNodes, Donor_StartLinkedNodes, Donor_nLinkedNodes, DonorPoint_Coord, donor_iPoint, donor_element); Area = 0; - for (ii = 1; ii < nNode_target-1; ii++){ - for (jj = 1; jj < nNode_donor-1; jj++){ - Area += Compute_Triangle_Intersection(target_element[0], target_element[ii], target_element[ii+1], - donor_element[0], donor_element[jj], donor_element[jj+1], Normal); + for (ii = 1; ii < nNode_target - 1; ii++) { + for (jj = 1; jj < nNode_donor - 1; jj++) { + Area += Compute_Triangle_Intersection(target_element[0], target_element[ii], target_element[ii + 1], + donor_element[0], donor_element[jj], donor_element[jj + 1], Normal); } } - for (ii = 0; ii < 2*nEdges_donor + 2; ii++) - delete [] donor_element[ii]; - delete [] donor_element; + for (ii = 0; ii < 2 * nEdges_donor + 2; ii++) delete[] donor_element[ii]; + delete[] donor_element; nDonorPoints = 1; /*--- In case the element intersect the target cell update the auxiliary communication data structure ---*/ - Coeff_Vect = new su2double[ nDonorPoints ]; - Donor_Vect = new unsigned long[ nDonorPoints ]; - storeProc = new unsigned long[ nDonorPoints ]; + Coeff_Vect = new su2double[nDonorPoints]; + Donor_Vect = new unsigned long[nDonorPoints]; + storeProc = new unsigned long[nDonorPoints]; Coeff_Vect[0] = Area; Donor_Vect[0] = donor_iPoint; - storeProc[0] = Donor_Proc[donor_iPoint]; + storeProc[0] = Donor_Proc[donor_iPoint]; alreadyVisitedDonor = new unsigned long[1]; @@ -548,11 +526,11 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { Area_old = -1; - while( Area > Area_old ){ - + while (Area > Area_old) { /* * - Starting from the closest donor_point, it expands the supermesh by a countour search pattern. - * - The closest donor element becomes the core, at each iteration a new layer of elements around the core is taken into account + * - The closest donor element becomes the core, at each iteration a new layer of elements around the core is + * taken into account */ Area_old = Area; @@ -560,100 +538,97 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { ToVisit = nullptr; nToVisit = 0; - for( iNodeVisited = StartVisited; iNodeVisited < nAlreadyVisited; iNodeVisited++ ){ - - vPoint = alreadyVisitedDonor[ iNodeVisited ]; + for (iNodeVisited = StartVisited; iNodeVisited < nAlreadyVisited; iNodeVisited++) { + vPoint = alreadyVisitedDonor[iNodeVisited]; nEdgeVisited = Donor_nLinkedNodes[vPoint]; - for (iEdgeVisited = 0; iEdgeVisited < nEdgeVisited; iEdgeVisited++){ - - donor_iPoint = Donor_LinkedNodes[ Donor_StartLinkedNodes[vPoint] + iEdgeVisited]; + for (iEdgeVisited = 0; iEdgeVisited < nEdgeVisited; iEdgeVisited++) { + donor_iPoint = Donor_LinkedNodes[Donor_StartLinkedNodes[vPoint] + iEdgeVisited]; /*--- Check if the node to visit is already listed in the data structure to avoid double visits ---*/ - check = 0; + check = false; - for( jj = 0; jj < nAlreadyVisited; jj++ ){ - if( donor_iPoint == alreadyVisitedDonor[jj] ){ - check = 1; + for (jj = 0; jj < nAlreadyVisited; jj++) { + if (donor_iPoint == alreadyVisitedDonor[jj]) { + check = true; break; } } - if( check == 0 && ToVisit != nullptr){ - for( jj = 0; jj < nToVisit; jj++ ) - if( donor_iPoint == ToVisit[jj] ){ - check = 1; + if (check == 0 && ToVisit != nullptr) { + for (jj = 0; jj < nToVisit; jj++) + if (donor_iPoint == ToVisit[jj]) { + check = true; break; } } - if( check == 0 ){ + if (check == 0) { /*--- If the node was not already visited, visit it and list it into data structure ---*/ - tmpVect = new unsigned long[ nToVisit + 1 ]; + tmpVect = new unsigned long[nToVisit + 1]; - for( jj = 0; jj < nToVisit; jj++ ) - tmpVect[jj] = ToVisit[jj]; + for (jj = 0; jj < nToVisit; jj++) tmpVect[jj] = ToVisit[jj]; tmpVect[nToVisit] = donor_iPoint; - - delete [] ToVisit; + delete[] ToVisit; ToVisit = tmpVect; tmpVect = nullptr; nToVisit++; - /*--- Find the value of the intersection area between the current donor element and the target element --- */ + /*--- Find the value of the intersection area between the current donor element and the target element + * --- */ nEdges_donor = Donor_nLinkedNodes[donor_iPoint]; - donor_element = new su2double*[ 2*nEdges_donor + 2 ]; - for (ii = 0; ii < 2*nEdges_donor + 2; ii++) - donor_element[ii] = new su2double[nDim]; + donor_element = new su2double*[2 * nEdges_donor + 2]; + for (ii = 0; ii < 2 * nEdges_donor + 2; ii++) donor_element[ii] = new su2double[nDim]; nNode_donor = Build_3D_surface_element(Donor_LinkedNodes, Donor_StartLinkedNodes, Donor_nLinkedNodes, DonorPoint_Coord, donor_iPoint, donor_element); tmp_Area = 0; - for (ii = 1; ii < nNode_target-1; ii++) - for (jj = 1; jj < nNode_donor-1; jj++) - tmp_Area += Compute_Triangle_Intersection(target_element[0], target_element[ii], target_element[ii+1], - donor_element[0], donor_element[jj], donor_element[jj+1], Normal); + for (ii = 1; ii < nNode_target - 1; ii++) + for (jj = 1; jj < nNode_donor - 1; jj++) + tmp_Area += Compute_Triangle_Intersection(target_element[0], target_element[ii], + target_element[ii + 1], donor_element[0], + donor_element[jj], donor_element[jj + 1], Normal); - for (ii = 0; ii < 2*nEdges_donor + 2; ii++) - delete [] donor_element[ii]; - delete [] donor_element; + for (ii = 0; ii < 2 * nEdges_donor + 2; ii++) delete[] donor_element[ii]; + delete[] donor_element; - /*--- In case the element intersect the target cell update the auxiliary communication data structure ---*/ + /*--- In case the element intersect the target cell update the auxiliary communication data structure + * ---*/ - tmp_Coeff_Vect = new su2double[ nDonorPoints + 1 ]; - tmp_Donor_Vect = new unsigned long[ nDonorPoints + 1 ]; - tmp_storeProc = new unsigned long[ nDonorPoints + 1 ]; + tmp_Coeff_Vect = new su2double[nDonorPoints + 1]; + tmp_Donor_Vect = new unsigned long[nDonorPoints + 1]; + tmp_storeProc = new unsigned long[nDonorPoints + 1]; - for( iDonor = 0; iDonor < nDonorPoints; iDonor++){ + for (iDonor = 0; iDonor < nDonorPoints; iDonor++) { tmp_Donor_Vect[iDonor] = Donor_Vect[iDonor]; tmp_Coeff_Vect[iDonor] = Coeff_Vect[iDonor]; - tmp_storeProc[iDonor] = storeProc[iDonor]; + tmp_storeProc[iDonor] = storeProc[iDonor]; } - tmp_Coeff_Vect[ nDonorPoints ] = tmp_Area; - tmp_Donor_Vect[ nDonorPoints ] = donor_iPoint; - tmp_storeProc[ nDonorPoints ] = Donor_Proc[donor_iPoint]; + tmp_Coeff_Vect[nDonorPoints] = tmp_Area; + tmp_Donor_Vect[nDonorPoints] = donor_iPoint; + tmp_storeProc[nDonorPoints] = Donor_Proc[donor_iPoint]; - delete [] Donor_Vect; - delete [] Coeff_Vect; - delete [] storeProc; + delete[] Donor_Vect; + delete[] Coeff_Vect; + delete[] storeProc; Donor_Vect = tmp_Donor_Vect; Coeff_Vect = tmp_Coeff_Vect; - storeProc = tmp_storeProc; + storeProc = tmp_storeProc; tmp_Coeff_Vect = nullptr; tmp_Donor_Vect = nullptr; - tmp_storeProc = nullptr; + tmp_storeProc = nullptr; nDonorPoints++; @@ -666,78 +641,75 @@ void CSlidingMesh::SetTransferCoeff(const CConfig* const* config) { StartVisited = nAlreadyVisited; - tmpVect = new unsigned long[ nAlreadyVisited + nToVisit ]; - - for( jj = 0; jj < nAlreadyVisited; jj++ ) - tmpVect[jj] = alreadyVisitedDonor[jj]; + tmpVect = new unsigned long[nAlreadyVisited + nToVisit]; - for( jj = 0; jj < nToVisit; jj++ ) - tmpVect[ nAlreadyVisited + jj ] = ToVisit[jj]; + for (jj = 0; jj < nAlreadyVisited; jj++) tmpVect[jj] = alreadyVisitedDonor[jj]; + for (jj = 0; jj < nToVisit; jj++) tmpVect[nAlreadyVisited + jj] = ToVisit[jj]; - delete [] alreadyVisitedDonor; + delete[] alreadyVisitedDonor; alreadyVisitedDonor = tmpVect; nAlreadyVisited += nToVisit; - delete [] ToVisit; + delete[] ToVisit; } - delete [] alreadyVisitedDonor; + delete[] alreadyVisitedDonor; /*--- Set the communication data structure and copy data from the auxiliary vectors ---*/ targetVertices[markTarget][iVertex].resize(nDonorPoints); - for ( iDonor = 0; iDonor < nDonorPoints; iDonor++ ){ + for (iDonor = 0; iDonor < nDonorPoints; iDonor++) { targetVertices[markTarget][iVertex].coefficient[iDonor] = Coeff_Vect[iDonor] / Area; targetVertices[markTarget][iVertex].globalPoint[iDonor] = Donor_GlobalPoint[Donor_Vect[iDonor]]; targetVertices[markTarget][iVertex].processor[iDonor] = storeProc[iDonor]; } - for (ii = 0; ii < 2*nEdges_target + 2; ii++) - delete [] target_element[ii]; - delete [] target_element; + for (ii = 0; ii < 2 * nEdges_target + 2; ii++) delete[] target_element[ii]; + delete[] target_element; - delete [] Donor_Vect; Donor_Vect = nullptr; - delete [] Coeff_Vect; Coeff_Vect = nullptr; - delete [] storeProc; storeProc = nullptr; + delete[] Donor_Vect; + Donor_Vect = nullptr; + delete[] Coeff_Vect; + Coeff_Vect = nullptr; + delete[] storeProc; + storeProc = nullptr; } } - } - delete [] Normal; - delete [] Direction; + delete[] Normal; + delete[] Direction; - delete [] Donor_Vect; - delete [] Coeff_Vect; - delete [] storeProc; + delete[] Donor_Vect; + delete[] Coeff_Vect; + delete[] storeProc; } -int CSlidingMesh::Build_3D_surface_element(const su2vector& map, const su2vector& startIndex, +int CSlidingMesh::Build_3D_surface_element(const su2vector& map, + const su2vector& startIndex, const su2vector& nNeighbor, su2activematrix const& coord, unsigned long centralNode, su2double** element) { - /*--- Given a node "centralNode", this routines reconstruct the vertex centered * surface element around the node and store it into "element" ---*/ constexpr unsigned short nDim = 3; - const unsigned long *OuterNodes; + const unsigned long* OuterNodes; /* --- Store central node as element first point --- */ - for (unsigned short iDim = 0; iDim < nDim; iDim++) - element[0][iDim] = coord(centralNode,iDim); + for (unsigned short iDim = 0; iDim < nDim; iDim++) element[0][iDim] = coord(centralNode, iDim); unsigned long nOuterNodes = nNeighbor[centralNode]; - OuterNodes = &map[ startIndex[centralNode] ]; + OuterNodes = &map[startIndex[centralNode]]; // For each neighbor n of centralNode, store <=2 neighbors of centralNode that are neighbors of n. - su2matrix OuterNodesNeighbour(nOuterNodes,2); + su2matrix OuterNodesNeighbour(nOuterNodes, 2); OuterNodesNeighbour = -1; // Typically there are exactly 2 such neighbors, and all the neighbors of centralNode can be // arranged into a closed chain. However at 1D boundaries of 2D markers, the neighbors might @@ -745,75 +717,73 @@ int CSlidingMesh::Build_3D_surface_element(const su2vector& map, // StartNode is a node where we can start to iterate through the chain. I.e. it's any node in // case of a closed chain, or one of the two ends in case of an open chain. int StartNode = 0; - for( unsigned long iNode = 0; iNode < nOuterNodes; iNode++ ){ - - int count = 0; // number of neighboring outer nodes already found - const unsigned long iPoint = OuterNodes[ iNode ]; - const unsigned long *ptr = &map[ startIndex[iPoint] ]; + for (unsigned long iNode = 0; iNode < nOuterNodes; iNode++) { + int count = 0; // number of neighboring outer nodes already found + const unsigned long iPoint = OuterNodes[iNode]; + const unsigned long* ptr = &map[startIndex[iPoint]]; - for ( unsigned long jNode = 0; jNode < nNeighbor[iPoint]; jNode++ ){ + for (unsigned long jNode = 0; jNode < nNeighbor[iPoint]; jNode++) { const unsigned long jPoint = ptr[jNode]; - for( unsigned long kNode = 0; kNode < nOuterNodes; kNode++ ){ - if ( jPoint == OuterNodes[ kNode ] && jPoint != centralNode){ - OuterNodesNeighbour(iNode,count) = static_cast(kNode); + for (unsigned long kNode = 0; kNode < nOuterNodes; kNode++) { + if (jPoint == OuterNodes[kNode] && jPoint != centralNode) { + OuterNodesNeighbour(iNode, count) = static_cast(kNode); count++; break; } } } - if( count == 1 ) - StartNode = static_cast(iNode); + if (count == 1) StartNode = static_cast(iNode); } - /* --- Build element, starts from one outer node and loops along the external edges until the element is reconstructed --- */ + /* --- Build element, starts from one outer node and loops along the external edges until the element is reconstructed + * --- */ int CurrentNode = StartNode; - int NextNode = OuterNodesNeighbour(CurrentNode,0); + int NextNode = OuterNodesNeighbour(CurrentNode, 0); unsigned long iElementNode = 1; - while( NextNode != -1 ){ // We finished iterating through the chain if it is an open chain and we reached the other end. + while (NextNode != + -1) { // We finished iterating through the chain if it is an open chain and we reached the other end. for (unsigned short iDim = 0; iDim < nDim; iDim++) - element[ iElementNode ][iDim] = ( element[0][iDim] + coord(OuterNodes[ CurrentNode ], iDim) )/2.; + element[iElementNode][iDim] = (element[0][iDim] + coord(OuterNodes[CurrentNode], iDim)) / 2.; iElementNode++; for (unsigned short iDim = 0; iDim < nDim; iDim++) - element[ iElementNode ][iDim] = ( element[0][iDim] + coord[ OuterNodes[ CurrentNode ] ][ iDim] + - coord(OuterNodes[ NextNode ], iDim) )/3.; + element[iElementNode][iDim] = + (element[0][iDim] + coord[OuterNodes[CurrentNode]][iDim] + coord(OuterNodes[NextNode], iDim)) / 3.; iElementNode++; // "Place the next domino piece in the correct orientation." - if( OuterNodesNeighbour(NextNode, 0) == CurrentNode){ + if (OuterNodesNeighbour(NextNode, 0) == CurrentNode) { CurrentNode = NextNode; NextNode = OuterNodesNeighbour(NextNode, 1); - } else{ + } else { CurrentNode = NextNode; NextNode = OuterNodesNeighbour(NextNode, 0); } // We finished iterating through the chain if it is closed and we reached the beginning again. - if (CurrentNode == StartNode) - break; + if (CurrentNode == StartNode) break; } - if( CurrentNode == StartNode ){ // This is a closed element, so add again element 1 to the end of the structure, useful later - for (unsigned short iDim = 0; iDim < nDim; iDim++) - element[ iElementNode ][iDim] = element[1][iDim]; + if (CurrentNode == + StartNode) { // This is a closed element, so add again element 1 to the end of the structure, useful later + for (unsigned short iDim = 0; iDim < nDim; iDim++) element[iElementNode][iDim] = element[1][iDim]; iElementNode++; - } else{ + } else { for (unsigned short iDim = 0; iDim < nDim; iDim++) - element[ iElementNode ][iDim] = ( element[0][iDim] + coord(OuterNodes[ CurrentNode ], iDim) )/2.; + element[iElementNode][iDim] = (element[0][iDim] + coord(OuterNodes[CurrentNode], iDim)) / 2.; iElementNode++; } return static_cast(iElementNode); - } su2double CSlidingMesh::ComputeLineIntersectionLength(unsigned short nDim, const su2double* A1, const su2double* A2, - const su2double* B1, const su2double* B2, const su2double* Direction) { - + const su2double* B1, const su2double* B2, + const su2double* Direction) { /*--- Given 2 segments, each defined by 2 points, it projects them along a given direction * and it computes the length of the segment resulting from their intersection ---*/ /*--- The algorithm works for both 2D and 3D problems ---*/ @@ -823,46 +793,39 @@ su2double CSlidingMesh::ComputeLineIntersectionLength(unsigned short nDim, const su2double dotA2, dotB1, dotB2; dotA2 = 0; - for(iDim = 0; iDim < nDim; iDim++) - dotA2 += ( A2[iDim] - A1[iDim] ) * Direction[iDim]; + for (iDim = 0; iDim < nDim; iDim++) dotA2 += (A2[iDim] - A1[iDim]) * Direction[iDim]; - if( dotA2 >= 0 ){ + if (dotA2 >= 0) { dotB1 = 0; dotB2 = 0; - for(iDim = 0; iDim < nDim; iDim++){ - dotB1 += ( B1[iDim] - A1[iDim] ) * Direction[iDim]; - dotB2 += ( B2[iDim] - A1[iDim] ) * Direction[iDim]; + for (iDim = 0; iDim < nDim; iDim++) { + dotB1 += (B1[iDim] - A1[iDim]) * Direction[iDim]; + dotB2 += (B2[iDim] - A1[iDim]) * Direction[iDim]; } - } - else{ + } else { dotA2 *= -1; dotB1 = 0; dotB2 = 0; - for(iDim = 0; iDim < nDim; iDim++){ - dotB1 -= ( B1[iDim] - A1[iDim] ) * Direction[iDim]; - dotB2 -= ( B2[iDim] - A1[iDim] ) * Direction[iDim]; + for (iDim = 0; iDim < nDim; iDim++) { + dotB1 -= (B1[iDim] - A1[iDim]) * Direction[iDim]; + dotB2 -= (B2[iDim] - A1[iDim]) * Direction[iDim]; } } - if( dotB1 >= 0 && dotB1 <= dotA2 ){ - if ( dotB2 < 0 ) - return fabs( dotB1 ); - if ( dotB2 > dotA2 ) - return fabs( dotA2 - dotB1 ); + if (dotB1 >= 0 && dotB1 <= dotA2) { + if (dotB2 < 0) return fabs(dotB1); + if (dotB2 > dotA2) return fabs(dotA2 - dotB1); - return fabs( dotB1 - dotB2 ); + return fabs(dotB1 - dotB2); } - if( dotB2 >= 0 && dotB2 <= dotA2 ){ - if ( dotB1 < 0 ) - return fabs(dotB2); - if ( dotB1 > dotA2 ) - return fabs( dotA2 - dotB2 ); + if (dotB2 >= 0 && dotB2 <= dotA2) { + if (dotB1 < 0) return fabs(dotB2); + if (dotB1 > dotA2) return fabs(dotA2 - dotB2); } - if( ( dotB1 <= 0 && dotA2 <= dotB2 ) || ( dotB2 <= 0 && dotA2 <= dotB1 ) ) - return fabs( dotA2 ); + if ((dotB1 <= 0 && dotA2 <= dotB2) || (dotB2 <= 0 && dotA2 <= dotB1)) return fabs(dotA2); return 0.0; } @@ -870,9 +833,9 @@ su2double CSlidingMesh::ComputeLineIntersectionLength(unsigned short nDim, const su2double CSlidingMesh::Compute_Triangle_Intersection(const su2double* A1, const su2double* A2, const su2double* A3, const su2double* B1, const su2double* B2, const su2double* B3, const su2double* Direction) { - /* --- This routine is ONLY for 3D grids --- */ - /* --- Projects triangle points onto a plane, specified by its normal "Direction", and calls the ComputeIntersectionArea routine --- */ + /* --- Projects triangle points onto a plane, specified by its normal "Direction", and calls the + * ComputeIntersectionArea routine --- */ unsigned short iDim; constexpr unsigned short nDim = 3; @@ -884,7 +847,7 @@ su2double CSlidingMesh::Compute_Triangle_Intersection(const su2double* A1, const /* --- Reference frame is determined by: x = A1A2 y = x ^ ( -Direction ) --- */ - for(iDim = 0; iDim < 3; iDim++){ + for (iDim = 0; iDim < 3; iDim++) { a1[iDim] = 0; a2[iDim] = 0; a3[iDim] = 0; @@ -895,36 +858,34 @@ su2double CSlidingMesh::Compute_Triangle_Intersection(const su2double* A1, const } m1 = 0; - for(iDim = 0; iDim < nDim; iDim++){ + for (iDim = 0; iDim < nDim; iDim++) { K[iDim] = Direction[iDim]; m1 += K[iDim] * K[iDim]; } - for(iDim = 0; iDim < nDim; iDim++) - K[iDim] /= sqrt(m1); + for (iDim = 0; iDim < nDim; iDim++) K[iDim] /= sqrt(m1); m2 = 0; - for(iDim = 0; iDim < nDim; iDim++) - m2 += (A2[iDim] - A1[iDim]) * K[iDim]; + for (iDim = 0; iDim < nDim; iDim++) m2 += (A2[iDim] - A1[iDim]) * K[iDim]; m1 = 0; - for(iDim = 0; iDim < nDim; iDim++){ + for (iDim = 0; iDim < nDim; iDim++) { I[iDim] = (A2[iDim] - A1[iDim]) - m2 * K[iDim]; m1 += I[iDim] * I[iDim]; } - for(iDim = 0; iDim < nDim; iDim++) - I[iDim] /= sqrt(m1); + for (iDim = 0; iDim < nDim; iDim++) I[iDim] /= sqrt(m1); // Cross product to find Y - J[0] = K[1]*I[2] - K[2]*I[1]; - J[1] = -(K[0]*I[2] - K[2]*I[0]); - J[2] = K[0]*I[1] - K[1]*I[0]; + J[0] = K[1] * I[2] - K[2] * I[1]; + J[1] = -(K[0] * I[2] - K[2] * I[0]); + J[2] = K[0] * I[1] - K[1] * I[0]; - /* --- Project all points on the plane specified by Direction and change their reference frame taking A1 as origin --- */ + /* --- Project all points on the plane specified by Direction and change their reference frame taking A1 as origin --- + */ - for(iDim = 0; iDim < nDim; iDim++){ + for (iDim = 0; iDim < nDim; iDim++) { a2[0] += (A2[iDim] - A1[iDim]) * I[iDim]; a2[1] += (A2[iDim] - A1[iDim]) * J[iDim]; a2[2] += (A2[iDim] - A1[iDim]) * K[iDim]; @@ -948,13 +909,13 @@ su2double CSlidingMesh::Compute_Triangle_Intersection(const su2double* A1, const /*--- Compute intersection area ---*/ - return ComputeIntersectionArea( a1, a2, a3, b1, b2, b3 ); + return ComputeIntersectionArea(a1, a2, a3, b1, b2, b3); } su2double CSlidingMesh::ComputeIntersectionArea(const su2double* P1, const su2double* P2, const su2double* P3, const su2double* Q1, const su2double* Q2, const su2double* Q3) { - - /* --- This routines computes the area of the polygonal element generated by the superimposition of 2 planar triangle --- */ + /* --- This routines computes the area of the polygonal element generated by the superimposition of 2 planar triangle + * --- */ /* --- The 2 triangle must lie on the same plane --- */ unsigned short iDim, nPoints = 0, i, j, k; @@ -966,7 +927,7 @@ su2double CSlidingMesh::ComputeIntersectionArea(const su2double* P1, const su2do constexpr unsigned short nDim = 2; - for(iDim = 0; iDim < nDim; iDim++){ + for (iDim = 0; iDim < nDim; iDim++) { TriangleP[0][iDim] = 0; TriangleP[1][iDim] = P2[iDim] - P1[iDim]; TriangleP[2][iDim] = P3[iDim] - P1[iDim]; @@ -978,69 +939,61 @@ su2double CSlidingMesh::ComputeIntersectionArea(const su2double* P1, const su2do TriangleQ[3][iDim] = Q1[iDim] - P1[iDim]; } - - for( j = 0; j < 3; j++){ - if( CheckPointInsideTriangle(TriangleP[j], TriangleQ[0], TriangleQ[1], TriangleQ[2]) ){ - + for (j = 0; j < 3; j++) { + if (CheckPointInsideTriangle(TriangleP[j], TriangleQ[0], TriangleQ[1], TriangleQ[2])) { // Then P1 is also inside triangle Q, so store it - for(iDim = 0; iDim < nDim; iDim++) - points[nPoints][iDim] = TriangleP[j][iDim]; + for (iDim = 0; iDim < nDim; iDim++) points[nPoints][iDim] = TriangleP[j][iDim]; nPoints++; } } - for( j = 0; j < 3; j++){ - if( CheckPointInsideTriangle(TriangleQ[j], TriangleP[0], TriangleP[1], TriangleP[2]) ){ - + for (j = 0; j < 3; j++) { + if (CheckPointInsideTriangle(TriangleQ[j], TriangleP[0], TriangleP[1], TriangleP[2])) { // Then Q1 is also inside triangle P, so store it - for(iDim = 0; iDim < nDim; iDim++) - points[nPoints][iDim] = TriangleQ[j][iDim]; + for (iDim = 0; iDim < nDim; iDim++) points[nPoints][iDim] = TriangleQ[j][iDim]; nPoints++; } } - // Compute all edge intersections - for( j = 0; j < 3; j++){ - for( i = 0; i < 3; i++){ + for (j = 0; j < 3; j++) { + for (i = 0; i < 3; i++) { + det = (TriangleP[j][0] - TriangleP[j + 1][0]) * (TriangleQ[i][1] - TriangleQ[i + 1][1]) - + (TriangleP[j][1] - TriangleP[j + 1][1]) * (TriangleQ[i][0] - TriangleQ[i + 1][0]); - det = (TriangleP[j][0] - TriangleP[j+1][0]) * (TriangleQ[i][1] - TriangleQ[i+1][1]) - - (TriangleP[j][1] - TriangleP[j+1][1]) * (TriangleQ[i][0] - TriangleQ[i+1][0]); - - if ( det != 0.0 ){ - ComputeLineIntersectionPoint( TriangleP[j], TriangleP[j+1], TriangleQ[i], TriangleQ[i+1], IntersectionPoint ); + if (det != 0.0) { + ComputeLineIntersectionPoint(TriangleP[j], TriangleP[j + 1], TriangleQ[i], TriangleQ[i + 1], IntersectionPoint); dot1 = 0; dot2 = 0; - for(iDim = 0; iDim < nDim; iDim++){ - dot1 += ( TriangleP[j][iDim] - IntersectionPoint[iDim] ) * ( TriangleP[j+1][iDim] - IntersectionPoint[iDim] ); - dot2 += ( TriangleQ[i][iDim] - IntersectionPoint[iDim] ) * ( TriangleQ[i+1][iDim] - IntersectionPoint[iDim] ); + for (iDim = 0; iDim < nDim; iDim++) { + dot1 += (TriangleP[j][iDim] - IntersectionPoint[iDim]) * (TriangleP[j + 1][iDim] - IntersectionPoint[iDim]); + dot2 += (TriangleQ[i][iDim] - IntersectionPoint[iDim]) * (TriangleQ[i + 1][iDim] - IntersectionPoint[iDim]); } - if( dot1 <= 0 && dot2 <= 0 ){ // It found one intersection + if (dot1 <= 0 && dot2 <= 0) { // It found one intersection - // Store temporarily the intersection point + // Store temporarily the intersection point - for(iDim = 0; iDim < nDim; iDim++) - points[nPoints][iDim] = IntersectionPoint[iDim]; + for (iDim = 0; iDim < nDim; iDim++) points[nPoints][iDim] = IntersectionPoint[iDim]; - nPoints++; - } - } - } - } + nPoints++; + } + } + } + } // Remove double points, if any - for( i = 0; i < nPoints; i++){ - for( j = i+1; j < nPoints; j++){ - if(points[j][0] == points[i][0] && points[j][1] == points[i][1]){ - for( k = j; k < nPoints-1; k++){ - points[k][0] = points[k+1][0]; - points[k][1] = points[k+1][1]; + for (i = 0; i < nPoints; i++) { + for (j = i + 1; j < nPoints; j++) { + if (points[j][0] == points[i][0] && points[j][1] == points[i][1]) { + for (k = j; k < nPoints - 1; k++) { + points[k][0] = points[k + 1][0]; + points[k][1] = points[k + 1][1]; } nPoints--; j--; @@ -1050,31 +1003,27 @@ su2double CSlidingMesh::ComputeIntersectionArea(const su2double* P1, const su2do // Re-order nodes - for( i = 1; i < nPoints; i++){ // Change again reference frame - for(iDim = 0; iDim < nDim; iDim++) - points[i][iDim] -= points[0][iDim]; + for (i = 1; i < nPoints; i++) { // Change again reference frame + for (iDim = 0; iDim < nDim; iDim++) points[i][iDim] -= points[0][iDim]; // Compute polar azimuth for each node but the first theta[i] = atan2(points[i][1], points[i][0]); } - for(iDim = 0; iDim < nDim; iDim++) - points[0][iDim] = 0; - - for( i = 1; i < nPoints; i++){ + for (iDim = 0; iDim < nDim; iDim++) points[0][iDim] = 0; + for (i = 1; i < nPoints; i++) { min_theta = theta[i]; min_theta_index = 0; - for( j = i + 1; j < nPoints; j++){ - - if( theta[j] < min_theta ){ + for (j = i + 1; j < nPoints; j++) { + if (theta[j] < min_theta) { min_theta = theta[j]; min_theta_index = j; } } - if( min_theta_index != 0 ){ + if (min_theta_index != 0) { dtmp = theta[i]; theta[i] = theta[min_theta_index]; theta[min_theta_index] = dtmp; @@ -1094,39 +1043,39 @@ su2double CSlidingMesh::ComputeIntersectionArea(const su2double* P1, const su2do Area = 0; - if (nPoints > 2){ - for( i = 1; i < nPoints-1; i++ ){ - + if (nPoints > 2) { + for (i = 1; i < nPoints - 1; i++) { // Ax*By - Area += ( points[i][0] - points[0][0] ) * ( points[i+1][1] - points[0][1] ); + Area += (points[i][0] - points[0][0]) * (points[i + 1][1] - points[0][1]); // Ay*Bx - Area -= ( points[i][1] - points[0][1] ) * ( points[i+1][0] - points[0][0] ); + Area -= (points[i][1] - points[0][1]) * (points[i + 1][0] - points[0][0]); } } - return fabs(Area)/2; + return fabs(Area) / 2; } void CSlidingMesh::ComputeLineIntersectionPoint(const su2double* A1, const su2double* A2, const su2double* B1, - const su2double* B2, su2double* IntersectionPoint ){ - + const su2double* B2, su2double* IntersectionPoint) { /* --- Uses determinant rule to compute the intersection point between 2 straight segments --- */ - /* This works only for lines on a 2D plane, A1, A2 and B1, B2 are respectively the head and the tail points of each segment, - * since they're on a 2D plane they are defined by a 2-elements array containing their coordinates */ + /* This works only for lines on a 2D plane, A1, A2 and B1, B2 are respectively the head and the tail points of each + * segment, since they're on a 2D plane they are defined by a 2-elements array containing their coordinates */ su2double det; det = (A1[0] - A2[0]) * (B1[1] - B2[1]) - (A1[1] - A2[1]) * (B1[0] - B2[0]); - if ( det != 0.0 ){ // else there is no intersection point - IntersectionPoint[0] = ( ( A1[0]*A2[1] - A1[1]*A2[0] ) * ( B1[0] - B2[0] ) - ( B1[0]*B2[1] - B1[1]*B2[0] ) * ( A1[0] - A2[0] ) ) / det; - IntersectionPoint[1] = ( ( A1[0]*A2[1] - A1[1]*A2[0] ) * ( B1[1] - B2[1] ) - ( B1[0]*B2[1] - B1[1]*B2[0] ) * ( A1[1] - A2[1] ) ) / det; + if (det != 0.0) { // else there is no intersection point + IntersectionPoint[0] = + ((A1[0] * A2[1] - A1[1] * A2[0]) * (B1[0] - B2[0]) - (B1[0] * B2[1] - B1[1] * B2[0]) * (A1[0] - A2[0])) / det; + IntersectionPoint[1] = + ((A1[0] * A2[1] - A1[1] * A2[0]) * (B1[1] - B2[1]) - (B1[0] * B2[1] - B1[1] * B2[0]) * (A1[1] - A2[1])) / det; } } -bool CSlidingMesh::CheckPointInsideTriangle(const su2double* Point, const su2double* T1, const su2double* T2, const su2double* T3) { - +bool CSlidingMesh::CheckPointInsideTriangle(const su2double* Point, const su2double* T1, const su2double* T2, + const su2double* T3) { /* --- Check whether a point "Point" lies inside or outside a triangle defined by 3 points "T1", "T2", "T3" --- */ /* For each edge it checks on which side the point lies: * - Computes the unit vector pointing at the internal side of the edge @@ -1140,14 +1089,14 @@ bool CSlidingMesh::CheckPointInsideTriangle(const su2double* Point, const su2dou su2double vect1[2], vect2[2], r[2]; su2double dot; - constexpr unsigned short nDim = 2; + constexpr unsigned short nDim = 2; /* --- Check first edge --- */ dot = 0; - for(iDim = 0; iDim < nDim; iDim++){ - vect1[iDim] = T3[iDim] - T1[iDim]; // vec 1 is aligned to the edge - vect2[iDim] = T2[iDim] - T1[iDim]; // vect 2 is the vector connecting one edge point to the third triangle vertex + for (iDim = 0; iDim < nDim; iDim++) { + vect1[iDim] = T3[iDim] - T1[iDim]; // vec 1 is aligned to the edge + vect2[iDim] = T2[iDim] - T1[iDim]; // vect 2 is the vector connecting one edge point to the third triangle vertex r[iDim] = Point[iDim] - T1[iDim]; // Connects point to vertex T1 @@ -1155,27 +1104,24 @@ bool CSlidingMesh::CheckPointInsideTriangle(const su2double* Point, const su2dou } dot = sqrt(dot); - for(iDim = 0; iDim < nDim; iDim++) - vect2[iDim] /= dot; + for (iDim = 0; iDim < nDim; iDim++) vect2[iDim] /= dot; dot = 0; - for(iDim = 0; iDim < nDim; iDim++) - dot += vect1[iDim] * vect2[iDim]; + for (iDim = 0; iDim < nDim; iDim++) dot += vect1[iDim] * vect2[iDim]; - for(iDim = 0; iDim < nDim; iDim++) - vect1[iDim] = T3[iDim] - (T1[iDim] + dot * vect2[iDim]); // Computes the inward unit vector + for (iDim = 0; iDim < nDim; iDim++) + vect1[iDim] = T3[iDim] - (T1[iDim] + dot * vect2[iDim]); // Computes the inward unit vector dot = 0; - for(iDim = 0; iDim < nDim; iDim++) // Checs that the point lies on the internal plane + for (iDim = 0; iDim < nDim; iDim++) // Checs that the point lies on the internal plane dot += vect1[iDim] * r[iDim]; - if (dot >= 0) - check++; + if (dot >= 0) check++; /* --- Check second edge --- */ dot = 0; - for(iDim = 0; iDim < nDim; iDim++){ + for (iDim = 0; iDim < nDim; iDim++) { vect1[iDim] = T1[iDim] - T2[iDim]; vect2[iDim] = T3[iDim] - T2[iDim]; @@ -1185,27 +1131,22 @@ bool CSlidingMesh::CheckPointInsideTriangle(const su2double* Point, const su2dou } dot = sqrt(dot); - for(iDim = 0; iDim < nDim; iDim++) - vect2[iDim] /= dot; + for (iDim = 0; iDim < nDim; iDim++) vect2[iDim] /= dot; dot = 0; - for(iDim = 0; iDim < nDim; iDim++) - dot += vect1[iDim] * vect2[iDim]; + for (iDim = 0; iDim < nDim; iDim++) dot += vect1[iDim] * vect2[iDim]; - for(iDim = 0; iDim < nDim; iDim++) - vect1[iDim] = T1[iDim] - (T2[iDim] + dot * vect2[iDim]); + for (iDim = 0; iDim < nDim; iDim++) vect1[iDim] = T1[iDim] - (T2[iDim] + dot * vect2[iDim]); dot = 0; - for(iDim = 0; iDim < nDim; iDim++) - dot += vect1[iDim] * r[iDim]; + for (iDim = 0; iDim < nDim; iDim++) dot += vect1[iDim] * r[iDim]; - if (dot >= 0) - check++; + if (dot >= 0) check++; /* --- Check third edge --- */ dot = 0; - for(iDim = 0; iDim < nDim; iDim++){ + for (iDim = 0; iDim < nDim; iDim++) { vect1[iDim] = T2[iDim] - T3[iDim]; vect2[iDim] = T1[iDim] - T3[iDim]; @@ -1215,22 +1156,17 @@ bool CSlidingMesh::CheckPointInsideTriangle(const su2double* Point, const su2dou } dot = sqrt(dot); - for(iDim = 0; iDim < nDim; iDim++) - vect2[iDim] /= dot; + for (iDim = 0; iDim < nDim; iDim++) vect2[iDim] /= dot; dot = 0; - for(iDim = 0; iDim < nDim; iDim++) - dot += vect1[iDim] * vect2[iDim]; + for (iDim = 0; iDim < nDim; iDim++) dot += vect1[iDim] * vect2[iDim]; - for(iDim = 0; iDim < nDim; iDim++) - vect1[iDim] = T2[iDim] - (T3[iDim] + dot * vect2[iDim]); + for (iDim = 0; iDim < nDim; iDim++) vect1[iDim] = T2[iDim] - (T3[iDim] + dot * vect2[iDim]); dot = 0; - for(iDim = 0; iDim < nDim; iDim++) - dot += vect1[iDim] * r[iDim]; + for (iDim = 0; iDim < nDim; iDim++) dot += vect1[iDim] * r[iDim]; - if (dot >= 0) - check++; + if (dot >= 0) check++; return (check == 3); } diff --git a/Common/src/linear_algebra/CPastixWrapper.cpp b/Common/src/linear_algebra/CPastixWrapper.cpp index 9cf791cbdd9..72c94288ff0 100644 --- a/Common/src/linear_algebra/CPastixWrapper.cpp +++ b/Common/src/linear_algebra/CPastixWrapper.cpp @@ -3,7 +3,7 @@ * \brief An interface to the INRIA solver PaStiX * (http://pastix.gforge.inria.fr/files/README-txt.html) * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -34,33 +34,29 @@ #include "../../include/geometry/CGeometry.hpp" #include "../../include/linear_algebra/CPastixWrapper.hpp" -#include - -template -void CPastixWrapper::Initialize(CGeometry *geometry, const CConfig *config) { +#include +template +void CPastixWrapper::Initialize(CGeometry* geometry, const CConfig* config) { using namespace PaStiX; - if (isinitialized) return; // only need to do this once + if (isinitialized) return; // only need to do this once - unsigned long nVar = matrix.nVar, - nPoint = matrix.nPoint, - nPointDomain = matrix.nPointDomain; - const unsigned long *row_ptr = matrix.rowptr, - *col_ind = matrix.colidx; + unsigned long nVar = matrix.nVar, nPoint = matrix.nPoint, nPointDomain = matrix.nPointDomain; + const unsigned long *row_ptr = matrix.rowptr, *col_ind = matrix.colidx; unsigned long iPoint, offset = 0, nNonZero = row_ptr[nPointDomain]; /*--- Allocate ---*/ nCols = pastix_int_t(nPointDomain); - colptr.resize(nPointDomain+1); + colptr.resize(nPointDomain + 1); rowidx.clear(); rowidx.reserve(nNonZero); - values.resize(nNonZero*nVar*nVar); + values.resize(nNonZero * nVar * nVar); loc2glb.resize(nPointDomain); perm.resize(nPointDomain); - workvec.resize(nPointDomain*nVar); + workvec.resize(nPointDomain * nVar); /*--- Set default parameter values ---*/ @@ -72,25 +68,25 @@ void CPastixWrapper::Initialize(CGeometry *geometry, const CConfig * /*--- Customize important parameters ---*/ switch (verb) { - case 1: - iparm[IPARM_VERBOSE] = API_VERBOSE_NO; - break; - case 2: - iparm[IPARM_VERBOSE] = API_VERBOSE_YES; - break; - default: - iparm[IPARM_VERBOSE] = API_VERBOSE_NOT; - break; + case 1: + iparm[IPARM_VERBOSE] = API_VERBOSE_NO; + break; + case 2: + iparm[IPARM_VERBOSE] = API_VERBOSE_YES; + break; + default: + iparm[IPARM_VERBOSE] = API_VERBOSE_NOT; + break; } - iparm[IPARM_DOF_NBR] = pastix_int_t(nVar); + iparm[IPARM_DOF_NBR] = pastix_int_t(nVar); iparm[IPARM_MATRIX_VERIFICATION] = API_NO; - iparm[IPARM_FREE_CSCPASTIX] = API_CSC_FREE; - iparm[IPARM_CSCD_CORRECT] = API_NO; - iparm[IPARM_RHSD_CHECK] = API_NO; - iparm[IPARM_ORDERING] = API_ORDER_PTSCOTCH; - iparm[IPARM_INCOMPLETE] = incomplete; - iparm[IPARM_LEVEL_OF_FILL] = pastix_int_t(config->GetPastixFillLvl()); - iparm[IPARM_THREAD_NBR] = omp_get_max_threads(); + iparm[IPARM_FREE_CSCPASTIX] = API_CSC_FREE; + iparm[IPARM_CSCD_CORRECT] = API_NO; + iparm[IPARM_RHSD_CHECK] = API_NO; + iparm[IPARM_ORDERING] = API_ORDER_PTSCOTCH; + iparm[IPARM_INCOMPLETE] = incomplete; + iparm[IPARM_LEVEL_OF_FILL] = pastix_int_t(config->GetPastixFillLvl()); + iparm[IPARM_THREAD_NBR] = omp_get_max_threads(); #if defined(HAVE_MPI) && defined(HAVE_OMP) int comm_mode = MPI_THREAD_SINGLE; MPI_Query_thread(&comm_mode); @@ -100,40 +96,37 @@ void CPastixWrapper::Initialize(CGeometry *geometry, const CConfig * iparm[IPARM_THREAD_COMM_MODE] = API_THREAD_FUNNELED; #endif - /*--- Prepare sparsity structure ---*/ + /*--- Prepare sparsity structure ---*/ - /*--- We need it in global coordinates, i.e. shifted according to the position - of the current rank in the linear partitioning space, and "unpacked" halo part. - The latter forces us to re-sort the column indices of rows with halo points, which - in turn requires blocks to be swapped accordingly. Moreover we need "pointer" and - indices in Fortran-style numbering (start at 1), effectively the matrix is copied. - Here we prepare the pointer and index part, and map the required swaps. ---*/ + /*--- We need it in global coordinates, i.e. shifted according to the position + of the current rank in the linear partitioning space, and "unpacked" halo part. + The latter forces us to re-sort the column indices of rows with halo points, which + in turn requires blocks to be swapped accordingly. Moreover we need "pointer" and + indices in Fortran-style numbering (start at 1), effectively the matrix is copied. + Here we prepare the pointer and index part, and map the required swaps. ---*/ - /*--- 1 - Determine position in the linear partitioning ---*/ + /*--- 1 - Determine position in the linear partitioning ---*/ #ifdef HAVE_MPI vector domain_sizes(mpi_size); MPI_Allgather(&nPointDomain, 1, MPI_UNSIGNED_LONG, domain_sizes.data(), 1, MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); - for (int i=0; i map(nPoint-nPointDomain,0); + vector map(nPoint - nPointDomain, 0); #ifdef HAVE_MPI - for (unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) - { - if ((config->GetMarker_All_KindBC(iMarker) == SEND_RECEIVE) && - (config->GetMarker_All_SendRecv(iMarker) > 0)) - { - unsigned short MarkerS = iMarker, MarkerR = iMarker+1; + for (unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + if ((config->GetMarker_All_KindBC(iMarker) == SEND_RECEIVE) && (config->GetMarker_All_SendRecv(iMarker) > 0)) { + unsigned short MarkerS = iMarker, MarkerR = iMarker + 1; - int sender = config->GetMarker_All_SendRecv(MarkerS)-1; - int recver = abs(config->GetMarker_All_SendRecv(MarkerR))-1; + int sender = config->GetMarker_All_SendRecv(MarkerS) - 1; + int recver = abs(config->GetMarker_All_SendRecv(MarkerR)) - 1; unsigned long nVertexS = geometry->nVertex[MarkerS]; unsigned long nVertexR = geometry->nVertex[MarkerR]; @@ -143,34 +136,31 @@ void CPastixWrapper::Initialize(CGeometry *geometry, const CConfig * /*--- Prepare data to send ---*/ for (unsigned long iVertex = 0; iVertex < nVertexS; iVertex++) - Buffer_Send[iVertex] = geometry->vertex[MarkerS][iVertex]->GetNode()+offset; + Buffer_Send[iVertex] = geometry->vertex[MarkerS][iVertex]->GetNode() + offset; /*--- Send and Receive data ---*/ - MPI_Sendrecv(Buffer_Send.data(), nVertexS, MPI_UNSIGNED_LONG, sender, 0, - Buffer_Recv.data(), nVertexR, MPI_UNSIGNED_LONG, recver, 0, - SU2_MPI::GetComm(), MPI_STATUS_IGNORE); + MPI_Sendrecv(Buffer_Send.data(), nVertexS, MPI_UNSIGNED_LONG, sender, 0, Buffer_Recv.data(), nVertexR, + MPI_UNSIGNED_LONG, recver, 0, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); /*--- Store received data---*/ for (unsigned long iVertex = 0; iVertex < nVertexR; iVertex++) - map[ geometry->vertex[MarkerR][iVertex]->GetNode()-nPointDomain ] = Buffer_Recv[iVertex]; + map[geometry->vertex[MarkerR][iVertex]->GetNode() - nPointDomain] = Buffer_Recv[iVertex]; } } #endif /*--- 3 - Copy, map the sparsity, and put it in Fortran numbering ---*/ - for (iPoint = 0; iPoint < nPointDomain; ++iPoint) - { - colptr[iPoint] = pastix_int_t(row_ptr[iPoint]+1); + for (iPoint = 0; iPoint < nPointDomain; ++iPoint) { + colptr[iPoint] = pastix_int_t(row_ptr[iPoint] + 1); - unsigned long begin = row_ptr[iPoint], end = row_ptr[iPoint+1], j; + unsigned long begin = row_ptr[iPoint], end = row_ptr[iPoint + 1], j; /*--- If last point of row is halo ---*/ - bool sort_required = (col_ind[end-1] >= nPointDomain); + bool sort_required = (col_ind[end - 1] >= nPointDomain); - if (sort_required) - { - unsigned long nnz_row = end-begin; + if (sort_required) { + unsigned long nnz_row = end - begin; sort_rows.push_back(iPoint); sort_order.push_back(vector(nnz_row)); @@ -178,42 +168,36 @@ void CPastixWrapper::Initialize(CGeometry *geometry, const CConfig * /*--- Sort mapped indices ("first") and keep track of source ("second") for when we later need to swap blocks for these rows. ---*/ - vector > aux(nnz_row); + vector > aux(nnz_row); - for (j = begin; j < end; ++j) - { + for (j = begin; j < end; ++j) { if (col_ind[j] < nPointDomain) - aux[j-begin].first = pastix_int_t(offset+col_ind[j]+1); + aux[j - begin].first = pastix_int_t(offset + col_ind[j] + 1); else - aux[j-begin].first = pastix_int_t(map[col_ind[j]-nPointDomain]+1); - aux[j-begin].second = j; + aux[j - begin].first = pastix_int_t(map[col_ind[j] - nPointDomain] + 1); + aux[j - begin].second = j; } sort(aux.begin(), aux.end()); - for (j = 0; j < nnz_row; ++j) - { + for (j = 0; j < nnz_row; ++j) { rowidx.push_back(aux[j].first); sort_order.back()[j] = aux[j].second; } - } - else - { + } else { /*--- These are all internal, no need to go through map. ---*/ - for (j = begin; j < end; ++j) - rowidx.push_back(pastix_int_t(offset+col_ind[j]+1)); + for (j = begin; j < end; ++j) rowidx.push_back(pastix_int_t(offset + col_ind[j] + 1)); } } - colptr[nPointDomain] = pastix_int_t(nNonZero+1); + colptr[nPointDomain] = pastix_int_t(nNonZero + 1); - if (rowidx.size() != nNonZero) - SU2_MPI::Error("Error during preparation of PaStiX data", CURRENT_FUNCTION); + if (rowidx.size() != nNonZero) SU2_MPI::Error("Error during preparation of PaStiX data", CURRENT_FUNCTION); /*--- 4 - Perform ordering, symbolic factorization, and analysis steps ---*/ if (mpi_rank == MASTER_NODE && verb > 0) cout << endl; iparm[IPARM_START_TASK] = API_TASK_ORDERING; - iparm[IPARM_END_TASK] = API_TASK_ANALYSE; + iparm[IPARM_END_TASK] = API_TASK_ANALYSE; Run(); if (mpi_rank == MASTER_NODE && verb > 0) @@ -222,18 +206,17 @@ void CPastixWrapper::Initialize(CGeometry *geometry, const CConfig * isinitialized = true; } -template -void CPastixWrapper::Factorize(CGeometry *geometry, const CConfig *config, - unsigned short kind_fact) { +template +void CPastixWrapper::Factorize(CGeometry* geometry, const CConfig* config, unsigned short kind_fact) { using namespace PaStiX; /*--- Detect a possible change of settings between direct and adjoint that requires a reset ---*/ if (isinitialized) - if ((kind_fact == PASTIX_ILU) != (iparm[IPARM_INCOMPLETE] == API_YES)) { - Clean(); - isinitialized = false; - iter = 0; - } + if ((kind_fact == PASTIX_ILU) != (iparm[IPARM_INCOMPLETE] == API_YES)) { + Clean(); + isinitialized = false; + iter = 0; + } verb = config->GetPastixVerbLvl(); iparm[IPARM_INCOMPLETE] = (kind_fact == PASTIX_ILU); @@ -243,31 +226,30 @@ void CPastixWrapper::Factorize(CGeometry *geometry, const CConfig *c /*--- Set some options that affect "compute" and could (one day) change during run ---*/ switch (verb) { - case 1: - iparm[IPARM_VERBOSE] = API_VERBOSE_NO; - break; - case 2: - iparm[IPARM_VERBOSE] = API_VERBOSE_YES; - break; - default: - iparm[IPARM_VERBOSE] = API_VERBOSE_NOT; - break; + case 1: + iparm[IPARM_VERBOSE] = API_VERBOSE_NO; + break; + case 2: + iparm[IPARM_VERBOSE] = API_VERBOSE_YES; + break; + default: + iparm[IPARM_VERBOSE] = API_VERBOSE_NOT; + break; } if (kind_fact == PASTIX_LDLT || kind_fact == PASTIX_LDLT_P) - iparm[IPARM_TRANSPOSE_SOLVE] = API_NO; // symmetric so no need for slower transp. solve + iparm[IPARM_TRANSPOSE_SOLVE] = API_NO; // symmetric so no need for slower transp. solve else - iparm[IPARM_TRANSPOSE_SOLVE] = API_YES; // negated due to CSR to CSC copy + iparm[IPARM_TRANSPOSE_SOLVE] = API_YES; // negated due to CSR to CSC copy /*--- Is factorizing needed on this iteration? ---*/ bool factorize = false; - if (config->GetPastixFactFreq() != 0) - factorize = (iter % config->GetPastixFactFreq() == 0); + if (config->GetPastixFactFreq() != 0) factorize = (iter % config->GetPastixFactFreq() == 0); iter++; - if (isfactorized && !factorize) return; // No + if (isfactorized && !factorize) return; // No /*--- Yes ---*/ @@ -278,49 +260,47 @@ void CPastixWrapper::Factorize(CGeometry *geometry, const CConfig *c cout << " +--------------------------------------------------------------------+" << endl; } - unsigned long i, j, k, iRow, begin, target, source, - szBlk = matrix.nVar*matrix.nVar, nNonZero = values.size(); + unsigned long i, j, k, iRow, begin, target, source, szBlk = matrix.nVar * matrix.nVar, nNonZero = values.size(); /*--- Copy matrix values and swap blocks as required ---*/ - for (i = 0; i < nNonZero; ++i) - values[i] = SU2_TYPE::GetValue(matrix.values[i]); + for (i = 0; i < nNonZero; ++i) values[i] = SU2_TYPE::GetValue(matrix.values[i]); - for (i = 0; i < sort_rows.size(); ++i) - { + for (i = 0; i < sort_rows.size(); ++i) { iRow = sort_rows[i]; begin = matrix.rowptr[iRow]; - for (j = 0; j < sort_order[i].size(); ++j) - { - target = (begin+j)*szBlk; - source = sort_order[i][j]*szBlk; + for (j = 0; j < sort_order[i].size(); ++j) { + target = (begin + j) * szBlk; + source = sort_order[i][j] * szBlk; - for (k = 0; k < szBlk; ++k) - values[target+k] = SU2_TYPE::GetValue(matrix.values[source+k]); + for (k = 0; k < szBlk; ++k) values[target + k] = SU2_TYPE::GetValue(matrix.values[source + k]); } } /*--- Set factorization options ---*/ switch (kind_fact) { - case PASTIX_LDLT: case PASTIX_LDLT_P: - iparm[IPARM_SYM] = API_SYM_YES; - iparm[IPARM_FACTORIZATION] = API_FACT_LDLT; - break; - case PASTIX_LU: case PASTIX_LU_P: case PASTIX_ILU: - iparm[IPARM_SYM] = API_SYM_NO; - iparm[IPARM_FACTORIZATION] = API_FACT_LU; - break; - default: - SU2_MPI::Error("Unknown type of PaStiX factorization.", CURRENT_FUNCTION); - break; + case PASTIX_LDLT: + case PASTIX_LDLT_P: + iparm[IPARM_SYM] = API_SYM_YES; + iparm[IPARM_FACTORIZATION] = API_FACT_LDLT; + break; + case PASTIX_LU: + case PASTIX_LU_P: + case PASTIX_ILU: + iparm[IPARM_SYM] = API_SYM_NO; + iparm[IPARM_FACTORIZATION] = API_FACT_LU; + break; + default: + SU2_MPI::Error("Unknown type of PaStiX factorization.", CURRENT_FUNCTION); + break; } /*--- Compute factorization ---*/ iparm[IPARM_START_TASK] = API_TASK_NUMFACT; - iparm[IPARM_END_TASK] = API_TASK_NUMFACT; + iparm[IPARM_END_TASK] = API_TASK_NUMFACT; Run(); if (mpi_rank == MASTER_NODE && verb > 0) diff --git a/Common/src/linear_algebra/CSysMatrix.cpp b/Common/src/linear_algebra/CSysMatrix.cpp index a03797b64c7..dd02b4152e6 100644 --- a/Common/src/linear_algebra/CSysMatrix.cpp +++ b/Common/src/linear_algebra/CSysMatrix.cpp @@ -2,7 +2,7 @@ * \file CSysMatrix.cpp * \brief Implementation of the sparse matrix class. * \author F. Palacios, A. Bueno, T. Economon, P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -32,86 +32,77 @@ #include -template -CSysMatrix::CSysMatrix() : - rank(SU2_MPI::GetRank()), - size(SU2_MPI::GetSize()) { - +template +CSysMatrix::CSysMatrix() : rank(SU2_MPI::GetRank()), size(SU2_MPI::GetSize()) { nPoint = nPointDomain = nVar = nEqn = 0; nnz = nnz_ilu = 0; ilu_fill_in = 0; - omp_partitions = nullptr; + omp_partitions = nullptr; - matrix = nullptr; - row_ptr = nullptr; - dia_ptr = nullptr; - col_ind = nullptr; - col_ptr = nullptr; + matrix = nullptr; + row_ptr = nullptr; + dia_ptr = nullptr; + col_ind = nullptr; + col_ptr = nullptr; - ILU_matrix = nullptr; - row_ptr_ilu = nullptr; - dia_ptr_ilu = nullptr; - col_ind_ilu = nullptr; + ILU_matrix = nullptr; + row_ptr_ilu = nullptr; + dia_ptr_ilu = nullptr; + col_ind_ilu = nullptr; - invM = nullptr; + invM = nullptr; #ifdef USE_MKL - MatrixMatrixProductJitter = nullptr; - MatrixVectorProductJitterBetaOne = nullptr; - MatrixVectorProductJitterBetaZero = nullptr; + MatrixMatrixProductJitter = nullptr; + MatrixVectorProductJitterBetaOne = nullptr; + MatrixVectorProductJitterBetaZero = nullptr; MatrixVectorProductJitterAlphaMinusOne = nullptr; #endif - } -template -CSysMatrix::~CSysMatrix(void) { - - delete [] omp_partitions; +template +CSysMatrix::~CSysMatrix() { + delete[] omp_partitions; MemoryAllocation::aligned_free(ILU_matrix); MemoryAllocation::aligned_free(matrix); MemoryAllocation::aligned_free(invM); #ifdef USE_MKL - mkl_jit_destroy( MatrixMatrixProductJitter ); - mkl_jit_destroy( MatrixVectorProductJitterBetaZero ); - mkl_jit_destroy( MatrixVectorProductJitterBetaOne ); - mkl_jit_destroy( MatrixVectorProductJitterAlphaMinusOne ); + mkl_jit_destroy(MatrixMatrixProductJitter); + mkl_jit_destroy(MatrixVectorProductJitterBetaZero); + mkl_jit_destroy(MatrixVectorProductJitterBetaOne); + mkl_jit_destroy(MatrixVectorProductJitterAlphaMinusOne); #endif - } -template -void CSysMatrix::Initialize(unsigned long npoint, unsigned long npointdomain, - unsigned short nvar, unsigned short neqn, - bool EdgeConnect, CGeometry *geometry, - const CConfig *config, bool needTranspPtr, bool grad_mode) { - - assert(omp_get_thread_num()==0 && "Only the master thread is allowed to initialize the matrix."); +template +void CSysMatrix::Initialize(unsigned long npoint, unsigned long npointdomain, unsigned short nvar, + unsigned short neqn, bool EdgeConnect, CGeometry* geometry, + const CConfig* config, bool needTranspPtr, bool grad_mode) { + assert(omp_get_thread_num() == 0 && "Only the master thread is allowed to initialize the matrix."); - if(npoint == 0) return; + if (npoint == 0) return; - if(matrix != nullptr) { + if (matrix != nullptr) { SU2_MPI::Error("CSysMatrix can only be initialized once.", CURRENT_FUNCTION); } - if(nvar > MAXNVAR) { + if (nvar > MAXNVAR) { SU2_MPI::Error("nVar larger than expected, increase MAXNVAR.", CURRENT_FUNCTION); } /*--- Application of this matrix, FVM or FEM. ---*/ - const auto type = EdgeConnect? ConnectivityType::FiniteVolume : ConnectivityType::FiniteElement; + const auto type = EdgeConnect ? ConnectivityType::FiniteVolume : ConnectivityType::FiniteElement; /*--- Type of preconditioner the matrix will be asked to build. ---*/ auto prec = config->GetKind_Linear_Solver_Prec(); - if ((!EdgeConnect && !config->GetStructuralProblem()) || - (config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF) || (config->GetKind_SU2() == SU2_COMPONENT::SU2_DOT)) { + if ((!EdgeConnect && !config->GetStructuralProblem()) || (config->GetKind_SU2() == SU2_COMPONENT::SU2_DEF) || + (config->GetKind_SU2() == SU2_COMPONENT::SU2_DOT)) { /*--- FEM-type connectivity in non-structural context implies mesh deformation. ---*/ prec = config->GetKind_Deform_Linear_Solver_Prec(); - } - else if (config->GetDiscrete_Adjoint() && (prec!=ILU)) { + } else if (config->GetDiscrete_Adjoint() && (prec != ILU)) { /*--- Else "upgrade" primal solver settings. ---*/ prec = config->GetKind_DiscAdj_Linear_Prec(); } @@ -121,8 +112,8 @@ void CSysMatrix::Initialize(unsigned long npoint, unsigned long npoi prec = config->GetKind_Grad_Linear_Solver_Prec(); } - const bool ilu_needed = (prec==ILU); - const bool diag_needed = ilu_needed || (prec==JACOBI) || (prec==LINELET); + const bool ilu_needed = (prec == ILU); + const bool diag_needed = ilu_needed || (prec == JACOBI) || (prec == LINELET); /*--- Basic dimensions. ---*/ nVar = nvar; @@ -133,15 +124,14 @@ void CSysMatrix::Initialize(unsigned long npoint, unsigned long npoi /*--- Get sparse structure pointers from geometry, * the data is managed by CGeometry to allow re-use. ---*/ - const auto& csr = geometry->GetSparsePattern(type,0); + const auto& csr = geometry->GetSparsePattern(type, 0); nnz = csr.getNumNonZeros(); row_ptr = csr.outerPtr(); col_ind = csr.innerIdx(); dia_ptr = csr.diagPtr(); - if (needTranspPtr) - col_ptr = geometry->GetTransposeSparsePatternMap(type).data(); + if (needTranspPtr) col_ptr = geometry->GetTransposeSparsePatternMap(type).data(); if (type == ConnectivityType::FiniteVolume) { edge_ptr.ptr = geometry->GetEdgeToSparsePatternMap().data(); @@ -150,8 +140,7 @@ void CSysMatrix::Initialize(unsigned long npoint, unsigned long npoi /*--- Get ILU sparse pattern, if fill is 0 no new data is allocated. --*/ - if(ilu_needed) - { + if (ilu_needed) { ilu_fill_in = config->GetLinear_Solver_ILU_n(); const auto& csr_ilu = geometry->GetSparsePattern(type, ilu_fill_in); @@ -164,16 +153,16 @@ void CSysMatrix::Initialize(unsigned long npoint, unsigned long npoi /*--- Allocate data. ---*/ auto allocAndInit = [](ScalarType*& ptr, unsigned long num) { - ptr = MemoryAllocation::aligned_alloc(64, num*sizeof(ScalarType)); + ptr = MemoryAllocation::aligned_alloc(64, num * sizeof(ScalarType)); }; - allocAndInit(matrix, nnz*nVar*nEqn); + allocAndInit(matrix, nnz * nVar * nEqn); /*--- Preconditioners. ---*/ - if (ilu_needed) allocAndInit(ILU_matrix, nnz_ilu*nVar*nEqn); + if (ilu_needed) allocAndInit(ILU_matrix, nnz_ilu * nVar * nEqn); - if (diag_needed) allocAndInit(invM, nPointDomain*nVar*nEqn); + if (diag_needed) allocAndInit(invM, nPointDomain * nVar * nEqn); /*--- Thread parallel initialization. ---*/ @@ -181,33 +170,34 @@ void CSysMatrix::Initialize(unsigned long npoint, unsigned long npoi /*--- Set suitable chunk sizes for light static for loops, and heavy dynamic ones, such that threads are approximately evenly loaded. ---*/ - omp_light_size = computeStaticChunkSize(nnz*nVar*nEqn, num_threads, OMP_MAX_SIZE_L); + omp_light_size = computeStaticChunkSize(nnz * nVar * nEqn, num_threads, OMP_MAX_SIZE_L); omp_heavy_size = computeStaticChunkSize(nPointDomain, num_threads, OMP_MAX_SIZE_H); omp_num_parts = config->GetLinear_Solver_Prec_Threads(); if (omp_num_parts == 0) omp_num_parts = num_threads; /*--- This is akin to the row_ptr. ---*/ - omp_partitions = new unsigned long [omp_num_parts+1]; + omp_partitions = new unsigned long[omp_num_parts + 1]; for (unsigned long i = 0; i <= omp_num_parts; ++i) omp_partitions[i] = nPointDomain; /*--- Work estimate based on non-zeros to produce balanced partitions. ---*/ - const auto row_ptr_prec = ilu_needed? row_ptr_ilu : row_ptr; + const auto row_ptr_prec = ilu_needed ? row_ptr_ilu : row_ptr; const auto nnz_prec = row_ptr_prec[nPointDomain]; const auto nnz_per_part = roundUpDiv(nnz_prec, omp_num_parts); for (auto iPoint = 0ul, part = 0ul; iPoint < nPointDomain; ++iPoint) { - if (row_ptr_prec[iPoint] >= part*nnz_per_part) - omp_partitions[part++] = iPoint; + if (row_ptr_prec[iPoint] >= part * nnz_per_part) omp_partitions[part++] = iPoint; } for (unsigned long thread = 0; thread < omp_num_parts; ++thread) { const auto begin = omp_partitions[thread]; const auto end = omp_partitions[thread + 1]; if (begin == end) { - cout << "WARNING: Redundant thread has been detected. Performance could be impacted due to low number of nodes per thread." << endl; + cout << "WARNING: Redundant thread has been detected. Performance could be impacted due to low number of nodes " + "per thread." + << endl; break; } } @@ -216,29 +206,27 @@ void CSysMatrix::Initialize(unsigned long npoint, unsigned long npoi #ifdef USE_MKL using mkl = mkl_jit_wrapper; - mkl::create_gemm(&MatrixMatrixProductJitter, MKL_ROW_MAJOR, MKL_NOTRANS, - MKL_NOTRANS, nVar, nVar, nVar, 1.0, nVar, nVar, 0.0, nVar); + mkl::create_gemm(&MatrixMatrixProductJitter, MKL_ROW_MAJOR, MKL_NOTRANS, MKL_NOTRANS, nVar, nVar, nVar, 1.0, nVar, + nVar, 0.0, nVar); MatrixMatrixProductKernel = mkl::get_gemm(MatrixMatrixProductJitter); - mkl::create_gemm(&MatrixVectorProductJitterBetaZero, MKL_COL_MAJOR, - MKL_NOTRANS, MKL_NOTRANS, 1, nVar, nEqn, 1.0, 1, nEqn, 0.0, 1); + mkl::create_gemm(&MatrixVectorProductJitterBetaZero, MKL_COL_MAJOR, MKL_NOTRANS, MKL_NOTRANS, 1, nVar, nEqn, 1.0, 1, + nEqn, 0.0, 1); MatrixVectorProductKernelBetaZero = mkl::get_gemm(MatrixVectorProductJitterBetaZero); - mkl::create_gemm(&MatrixVectorProductJitterBetaOne, MKL_COL_MAJOR, - MKL_NOTRANS, MKL_NOTRANS, 1, nVar, nEqn, 1.0, 1, nEqn, 1.0, 1); + mkl::create_gemm(&MatrixVectorProductJitterBetaOne, MKL_COL_MAJOR, MKL_NOTRANS, MKL_NOTRANS, 1, nVar, nEqn, 1.0, 1, + nEqn, 1.0, 1); MatrixVectorProductKernelBetaOne = mkl::get_gemm(MatrixVectorProductJitterBetaOne); - mkl::create_gemm(&MatrixVectorProductJitterAlphaMinusOne, MKL_COL_MAJOR, - MKL_NOTRANS, MKL_NOTRANS, 1, nVar, nEqn, -1.0, 1, nEqn, 1.0, 1); + mkl::create_gemm(&MatrixVectorProductJitterAlphaMinusOne, MKL_COL_MAJOR, MKL_NOTRANS, MKL_NOTRANS, 1, nVar, nEqn, + -1.0, 1, nEqn, 1.0, 1); MatrixVectorProductKernelAlphaMinusOne = mkl::get_gemm(MatrixVectorProductJitterAlphaMinusOne); #endif - } -template -void CSysMatrixComms::Initiate(const CSysVector& x, CGeometry *geometry, - const CConfig *config, unsigned short commType) { - +template +void CSysMatrixComms::Initiate(const CSysVector& x, CGeometry* geometry, const CConfig* config, + unsigned short commType) { if (geometry->nP2PSend == 0) return; /*--- Local variables ---*/ @@ -276,11 +264,8 @@ void CSysMatrixComms::Initiate(const CSysVector& x, CGeometry *geometry, geometry->PostP2PRecvs(geometry, config, MPI_TYPE, COUNT_PER_POINT, reverse); for (auto iMessage = 0; iMessage < geometry->nP2PSend; iMessage++) { - switch (commType) { - case SOLUTION_MATRIX: { - su2double* bufDSend = geometry->bufD_P2PSend; /*--- Get the offset for the start of this message. ---*/ @@ -289,30 +274,27 @@ void CSysMatrixComms::Initiate(const CSysVector& x, CGeometry *geometry, /*--- Total count can include multiple pieces of data per point. ---*/ - const auto nSend = (geometry->nPoint_P2PSend[iMessage+1] - geometry->nPoint_P2PSend[iMessage]); + const auto nSend = (geometry->nPoint_P2PSend[iMessage + 1] - geometry->nPoint_P2PSend[iMessage]); SU2_OMP_FOR_STAT(CSysMatrix::OMP_MIN_SIZE) for (auto iSend = 0; iSend < nSend; iSend++) { - /*--- Get the local index for this communicated data. ---*/ const auto iPoint = geometry->Local_Point_P2PSend[msg_offset + iSend]; /*--- Compute the offset in the recv buffer for this point. ---*/ - const auto buf_offset = (msg_offset + iSend)*COUNT_PER_POINT; + const auto buf_offset = (msg_offset + iSend) * COUNT_PER_POINT; /*--- Load the buffer with the data to be sent. ---*/ - for (auto iVar = 0ul; iVar < x.GetNVar(); iVar++) - bufDSend[buf_offset+iVar] = x(iPoint,iVar); + for (auto iVar = 0ul; iVar < x.GetNVar(); iVar++) bufDSend[buf_offset + iVar] = x(iPoint, iVar); } END_SU2_OMP_FOR break; } case SOLUTION_MATRIXTRANS: { - /*--- We are going to communicate in reverse, so we use the recv buffer for the send instead. Also, all of the offsets and counts are derived from the recv data structures. ---*/ @@ -325,11 +307,10 @@ void CSysMatrixComms::Initiate(const CSysVector& x, CGeometry *geometry, /*--- Total count can include multiple pieces of data per point. ---*/ - const auto nSend = (geometry->nPoint_P2PRecv[iMessage+1] - geometry->nPoint_P2PRecv[iMessage]); + const auto nSend = (geometry->nPoint_P2PRecv[iMessage + 1] - geometry->nPoint_P2PRecv[iMessage]); SU2_OMP_FOR_STAT(CSysMatrix::OMP_MIN_SIZE) for (auto iSend = 0; iSend < nSend; iSend++) { - /*--- Get the local index for this communicated data. Here we again use the recv structure to find the send point, since the usual recv points are now the senders in reverse mode. ---*/ @@ -338,36 +319,29 @@ void CSysMatrixComms::Initiate(const CSysVector& x, CGeometry *geometry, /*--- Compute the offset in the recv buffer for this point. ---*/ - const auto buf_offset = (msg_offset + iSend)*COUNT_PER_POINT; + const auto buf_offset = (msg_offset + iSend) * COUNT_PER_POINT; /*--- Load the buffer with the data to be sent. ---*/ - for (auto iVar = 0ul; iVar < x.GetNVar(); iVar++) - bufDSend[buf_offset+iVar] = x(iPoint,iVar); + for (auto iVar = 0ul; iVar < x.GetNVar(); iVar++) bufDSend[buf_offset + iVar] = x(iPoint, iVar); } END_SU2_OMP_FOR break; } default: - SU2_MPI::Error("Unrecognized quantity for point-to-point MPI comms.", - CURRENT_FUNCTION); + SU2_MPI::Error("Unrecognized quantity for point-to-point MPI comms.", CURRENT_FUNCTION); break; - } /*--- Launch the point-to-point MPI send for this message. ---*/ geometry->PostP2PSends(geometry, config, MPI_TYPE, COUNT_PER_POINT, iMessage, reverse); - } - } -template -void CSysMatrixComms::Complete(CSysVector& x, CGeometry *geometry, - const CConfig *config, unsigned short commType) { - +template +void CSysMatrixComms::Complete(CSysVector& x, CGeometry* geometry, const CConfig* config, unsigned short commType) { if (geometry->nP2PRecv == 0) return; /*--- Local variables ---*/ @@ -382,7 +356,6 @@ void CSysMatrixComms::Complete(CSysVector& x, CGeometry *geometry, location within the local class data structures. ---*/ for (auto iMessage = 0; iMessage < geometry->nP2PRecv; iMessage++) { - /*--- For efficiency, recv the messages dynamically based on the order they arrive. ---*/ @@ -394,8 +367,7 @@ void CSysMatrixComms::Complete(CSysVector& x, CGeometry *geometry, switch (commType) { case SOLUTION_MATRIX: { - - const su2double *bufDRecv = geometry->bufD_P2PRecv; + const su2double* bufDRecv = geometry->bufD_P2PRecv; /*--- We know the offsets based on the source rank. ---*/ @@ -407,30 +379,28 @@ void CSysMatrixComms::Complete(CSysVector& x, CGeometry *geometry, /*--- Get the number of packets to be received in this message. ---*/ - const auto nRecv = (geometry->nPoint_P2PRecv[jRecv+1] - geometry->nPoint_P2PRecv[jRecv]); + const auto nRecv = (geometry->nPoint_P2PRecv[jRecv + 1] - geometry->nPoint_P2PRecv[jRecv]); SU2_OMP_FOR_STAT(CSysMatrix::OMP_MIN_SIZE) for (auto iRecv = 0; iRecv < nRecv; iRecv++) { - /*--- Get the local index for this communicated data. ---*/ const auto iPoint = geometry->Local_Point_P2PRecv[msg_offset + iRecv]; /*--- Compute the offset in the recv buffer for this point. ---*/ - const auto buf_offset = (msg_offset + iRecv)*COUNT_PER_POINT; + const auto buf_offset = (msg_offset + iRecv) * COUNT_PER_POINT; /*--- Store the data correctly depending on the quantity. ---*/ for (auto iVar = 0ul; iVar < x.GetNVar(); iVar++) - x(iPoint,iVar) = CSysMatrix::template ActiveAssign(bufDRecv[buf_offset+iVar]); + x(iPoint, iVar) = CSysMatrix::template ActiveAssign(bufDRecv[buf_offset + iVar]); } END_SU2_OMP_FOR break; } case SOLUTION_MATRIXTRANS: { - /*--- We are going to communicate in reverse, so we use the send buffer for the recv instead. Also, all of the offsets and counts are derived from the send data structures. ---*/ @@ -447,23 +417,22 @@ void CSysMatrixComms::Complete(CSysVector& x, CGeometry *geometry, /*--- Get the number of packets to be received in this message. ---*/ - const auto nRecv = (geometry->nPoint_P2PSend[jRecv+1] - geometry->nPoint_P2PSend[jRecv]); + const auto nRecv = (geometry->nPoint_P2PSend[jRecv + 1] - geometry->nPoint_P2PSend[jRecv]); SU2_OMP_FOR_STAT(CSysMatrix::OMP_MIN_SIZE) for (auto iRecv = 0; iRecv < nRecv; iRecv++) { - /*--- Get the local index for this communicated data. ---*/ const auto iPoint = geometry->Local_Point_P2PSend[msg_offset + iRecv]; /*--- Compute the offset in the recv buffer for this point. ---*/ - const auto buf_offset = (msg_offset + iRecv)*COUNT_PER_POINT; + const auto buf_offset = (msg_offset + iRecv) * COUNT_PER_POINT; /*--- Update receiving point. ---*/ for (auto iVar = 0ul; iVar < x.GetNVar(); iVar++) - x(iPoint,iVar) += CSysMatrix::template ActiveAssign(bufDRecv[buf_offset+iVar]); + x(iPoint, iVar) += CSysMatrix::template ActiveAssign(bufDRecv[buf_offset + iVar]); } END_SU2_OMP_FOR break; @@ -484,60 +453,55 @@ void CSysMatrixComms::Complete(CSysVector& x, CGeometry *geometry, #endif } -template +template void CSysMatrix::SetValZero() { - const auto size = nnz*nVar*nEqn; - const auto chunk = roundUpDiv(size,omp_get_num_threads()); + const auto size = nnz * nVar * nEqn; + const auto chunk = roundUpDiv(size, omp_get_num_threads()); const auto begin = chunk * omp_get_thread_num(); - const auto mySize = min(chunk, size-begin) * sizeof(ScalarType); + const auto mySize = min(chunk, size - begin) * sizeof(ScalarType); memset(&matrix[begin], 0, mySize); SU2_OMP_BARRIER } -template +template void CSysMatrix::SetValDiagonalZero() { SU2_OMP_FOR_STAT(omp_heavy_size) for (auto iPoint = 0ul; iPoint < nPointDomain; ++iPoint) - for (auto index = 0ul; index < nVar*nEqn; ++index) - matrix[dia_ptr[iPoint]*nVar*nEqn + index] = 0.0; + for (auto index = 0ul; index < nVar * nEqn; ++index) matrix[dia_ptr[iPoint] * nVar * nEqn + index] = 0.0; END_SU2_OMP_FOR } -template +template void CSysMatrix::Gauss_Elimination(ScalarType* matrix, ScalarType* vec) const { - #ifdef USE_MKL_LAPACK // With MKL_DIRECT_CALL enabled, this is significantly faster than native code on Intel Architectures. lapack_int ipiv[MAXNVAR]; - LAPACKE_dgetrf( LAPACK_ROW_MAJOR, nVar, nVar, matrix, nVar, ipiv); - LAPACKE_dgetrs( LAPACK_ROW_MAJOR, 'N', nVar, 1, matrix, nVar, ipiv, vec, 1 ); + LAPACKE_dgetrf(LAPACK_ROW_MAJOR, nVar, nVar, matrix, nVar, ipiv); + LAPACKE_dgetrs(LAPACK_ROW_MAJOR, 'N', nVar, 1, matrix, nVar, ipiv, vec, 1); #else -#define A(I,J) matrix[(I)*nVar+(J)] +#define A(I, J) matrix[(I)*nVar + (J)] /*--- Transform system in Upper Matrix ---*/ for (auto iVar = 1ul; iVar < nVar; iVar++) { for (auto jVar = 0ul; jVar < iVar; jVar++) { - ScalarType weight = A(iVar,jVar) / A(jVar,jVar); - for (auto kVar = jVar; kVar < nVar; kVar++) - A(iVar,kVar) -= weight * A(jVar,kVar); + ScalarType weight = A(iVar, jVar) / A(jVar, jVar); + for (auto kVar = jVar; kVar < nVar; kVar++) A(iVar, kVar) -= weight * A(jVar, kVar); vec[iVar] -= weight * vec[jVar]; } } /*--- Backwards substitution ---*/ for (auto iVar = nVar; iVar > 0ul;) { - iVar--; // unsigned type - for (auto jVar = iVar+1; jVar < nVar; jVar++) - vec[iVar] -= A(iVar,jVar) * vec[jVar]; - vec[iVar] /= A(iVar,iVar); + iVar--; // unsigned type + for (auto jVar = iVar + 1; jVar < nVar; jVar++) vec[iVar] -= A(iVar, jVar) * vec[jVar]; + vec[iVar] /= A(iVar, iVar); } #undef A #endif } -template -void CSysMatrix::MatrixInverse(ScalarType *matrix, ScalarType *inverse) const { - +template +void CSysMatrix::MatrixInverse(ScalarType* matrix, ScalarType* inverse) const { /*--- This is a generalization of Gaussian elimination for multiple rhs' (the basis vectors). We could call "Gauss_Elimination" multiple times or fully generalize it for multiple rhs, the performance of both routines would suffer in both cases without the use of exotic templating. @@ -545,70 +509,62 @@ void CSysMatrix::MatrixInverse(ScalarType *matrix, ScalarType *inver assert((matrix != inverse) && "Output cannot be the same as the input."); -#define M(I,J) inverse[(I)*nVar+(J)] +#define M(I, J) inverse[(I)*nVar + (J)] /*--- Initialize the inverse with the identity. ---*/ for (auto iVar = 0ul; iVar < nVar; iVar++) - for (auto jVar = 0ul; jVar < nVar; jVar++) - M(iVar,jVar) = ScalarType(iVar==jVar); + for (auto jVar = 0ul; jVar < nVar; jVar++) M(iVar, jVar) = ScalarType(iVar == jVar); - /*--- Inversion ---*/ + /*--- Inversion ---*/ #ifdef USE_MKL_LAPACK // With MKL_DIRECT_CALL enabled, this is significantly faster than native code on Intel Architectures. lapack_int ipiv[MAXNVAR]; - LAPACKE_dgetrf( LAPACK_ROW_MAJOR, nVar, nVar, matrix, nVar, ipiv ); - LAPACKE_dgetrs( LAPACK_ROW_MAJOR, 'N', nVar, nVar, matrix, nVar, ipiv, inverse, nVar ); + LAPACKE_dgetrf(LAPACK_ROW_MAJOR, nVar, nVar, matrix, nVar, ipiv); + LAPACKE_dgetrs(LAPACK_ROW_MAJOR, 'N', nVar, nVar, matrix, nVar, ipiv, inverse, nVar); #else -#define A(I,J) matrix[(I)*nVar+(J)] +#define A(I, J) matrix[(I)*nVar + (J)] /*--- Transform system in Upper Matrix ---*/ for (auto iVar = 1ul; iVar < nVar; iVar++) { - for (auto jVar = 0ul; jVar < iVar; jVar++) - { - ScalarType weight = A(iVar,jVar) / A(jVar,jVar); + for (auto jVar = 0ul; jVar < iVar; jVar++) { + ScalarType weight = A(iVar, jVar) / A(jVar, jVar); - for (auto kVar = jVar; kVar < nVar; kVar++) - A(iVar,kVar) -= weight * A(jVar,kVar); + for (auto kVar = jVar; kVar < nVar; kVar++) A(iVar, kVar) -= weight * A(jVar, kVar); /*--- at this stage M is lower triangular so not all cols need updating ---*/ - for (auto kVar = 0ul; kVar <= jVar; kVar++) - M(iVar,kVar) -= weight * M(jVar,kVar); + for (auto kVar = 0ul; kVar <= jVar; kVar++) M(iVar, kVar) -= weight * M(jVar, kVar); } } /*--- Backwards substitution ---*/ for (auto iVar = nVar; iVar > 0ul;) { - iVar--; // unsigned type - for (auto jVar = iVar+1; jVar < nVar; jVar++) - for (auto kVar = 0ul; kVar < nVar; kVar++) - M(iVar,kVar) -= A(iVar,jVar) * M(jVar,kVar); + iVar--; // unsigned type + for (auto jVar = iVar + 1; jVar < nVar; jVar++) + for (auto kVar = 0ul; kVar < nVar; kVar++) M(iVar, kVar) -= A(iVar, jVar) * M(jVar, kVar); - for (auto kVar = 0ul; kVar < nVar; kVar++) - M(iVar,kVar) /= A(iVar,iVar); + for (auto kVar = 0ul; kVar < nVar; kVar++) M(iVar, kVar) /= A(iVar, iVar); } #undef A #endif #undef M } -template +template void CSysMatrix::DeleteValsRowi(unsigned long i) { + const auto block_i = i / nVar; + const auto row = i % nVar; - const auto block_i = i/nVar; - const auto row = i%nVar; - - for (auto index = row_ptr[block_i]; index < row_ptr[block_i+1]; index++) { + for (auto index = row_ptr[block_i]; index < row_ptr[block_i + 1]; index++) { for (auto iVar = 0u; iVar < nVar; iVar++) - matrix[index*nVar*nVar+row*nVar+iVar] = 0.0; // Delete row values in the block + matrix[index * nVar * nVar + row * nVar + iVar] = 0.0; // Delete row values in the block if (col_ind[index] == block_i) - matrix[index*nVar*nVar+row*nVar+row] = 1.0; // Set 1 to the diagonal element + matrix[index * nVar * nVar + row * nVar + row] = 1.0; // Set 1 to the diagonal element } } -template -void CSysMatrix::MatrixVectorProduct(const CSysVector & vec, CSysVector & prod, - CGeometry *geometry, const CConfig *config) const { - +template +void CSysMatrix::MatrixVectorProduct(const CSysVector& vec, CSysVector& prod, + CGeometry* geometry, const CConfig* config) const { /*--- Some checks for consistency between CSysMatrix and the CSysVectors ---*/ #ifndef NDEBUG if ((nEqn != vec.GetNVar()) || (nVar != prod.GetNVar())) { @@ -627,7 +583,7 @@ void CSysMatrix::MatrixVectorProduct(const CSysVector & SU2_OMP_FOR_DYN(omp_heavy_size) for (auto row_i = 0ul; row_i < nPointDomain; row_i++) { - RowProduct(vec, row_i, &prod[row_i*nVar]); + RowProduct(vec, row_i, &prod[row_i * nVar]); } END_SU2_OMP_FOR @@ -635,63 +591,55 @@ void CSysMatrix::MatrixVectorProduct(const CSysVector & CSysMatrixComms::Initiate(prod, geometry, config); CSysMatrixComms::Complete(prod, geometry, config); - } -template +template void CSysMatrix::BuildJacobiPreconditioner() { - /*--- Build Jacobi preconditioner (M = D), compute and store the inverses of the diagonal blocks. ---*/ SU2_OMP_FOR_DYN(omp_heavy_size) for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) - InverseDiagonalBlock(iPoint, &(invM[iPoint*nVar*nVar])); + InverseDiagonalBlock(iPoint, &(invM[iPoint * nVar * nVar])); END_SU2_OMP_FOR - } -template -void CSysMatrix::ComputeJacobiPreconditioner(const CSysVector & vec, CSysVector & prod, - CGeometry *geometry, const CConfig *config) const { - +template +void CSysMatrix::ComputeJacobiPreconditioner(const CSysVector& vec, + CSysVector& prod, CGeometry* geometry, + const CConfig* config) const { /*--- Apply Jacobi preconditioner, y = D^{-1} * x, the inverse of the diagonal is already known. ---*/ SU2_OMP_BARRIER SU2_OMP_FOR_DYN(omp_heavy_size) for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) - MatrixVectorProduct(&(invM[iPoint*nVar*nVar]), &vec[iPoint*nVar], &prod[iPoint*nVar]); + MatrixVectorProduct(&(invM[iPoint * nVar * nVar]), &vec[iPoint * nVar], &prod[iPoint * nVar]); END_SU2_OMP_FOR /*--- MPI Parallelization ---*/ CSysMatrixComms::Initiate(prod, geometry, config); CSysMatrixComms::Complete(prod, geometry, config); - } -template +template void CSysMatrix::BuildILUPreconditioner() { - /*--- Copy block matrix to compute factorization in-place. ---*/ if (ilu_fill_in == 0) { /*--- ILU0, direct copy. ---*/ SU2_OMP_FOR_STAT(omp_light_size) - for (auto iVar = 0ul; iVar < nnz*nVar*nVar; ++iVar) - ILU_matrix[iVar] = matrix[iVar]; + for (auto iVar = 0ul; iVar < nnz * nVar * nVar; ++iVar) ILU_matrix[iVar] = matrix[iVar]; END_SU2_OMP_FOR - } - else { + } else { /*--- ILUn clear the ILU matrix first. ---*/ SU2_OMP_FOR_STAT(omp_light_size) - for (auto iVar = 0ul; iVar < nnz_ilu*nVar*nVar; iVar++) - ILU_matrix[iVar] = 0.0; + for (auto iVar = 0ul; iVar < nnz_ilu * nVar * nVar; iVar++) ILU_matrix[iVar] = 0.0; END_SU2_OMP_FOR /*--- ILUn, traverse matrix to access its blocks * sequentially and set them in the ILU matrix. ---*/ SU2_OMP_FOR_DYN(omp_heavy_size) for (auto iPoint = 0ul; iPoint < nPointDomain; iPoint++) { - for (auto index = row_ptr[iPoint]; index < row_ptr[iPoint+1]; index++) { + for (auto index = row_ptr[iPoint]; index < row_ptr[iPoint + 1]; index++) { auto jPoint = col_ind[index]; - SetBlock_ILUMatrix(iPoint, jPoint, &matrix[index*nVar*nVar]); + SetBlock_ILUMatrix(iPoint, jPoint, &matrix[index * nVar * nVar]); } } END_SU2_OMP_FOR @@ -704,28 +652,25 @@ void CSysMatrix::BuildILUPreconditioner() { * outside of a parallel section. ---*/ SU2_OMP_FOR_STAT(1) - for(unsigned long thread = 0; thread < omp_num_parts; ++thread) - { + for (unsigned long thread = 0; thread < omp_num_parts; ++thread) { const auto begin = omp_partitions[thread]; - const auto end = omp_partitions[thread+1]; + const auto end = omp_partitions[thread + 1]; if (begin == end) continue; /*--- Each thread will work on the submatrix defined from row/col "begin" * to row/col "end-1" (i.e. the range [begin,end[). Which is exactly * what the MPI-only implementation does. ---*/ - ScalarType weight[MAXNVAR*MAXNVAR], aux_block[MAXNVAR*MAXNVAR]; - - for (auto iPoint = begin+1; iPoint < end; iPoint++) { + ScalarType weight[MAXNVAR * MAXNVAR], aux_block[MAXNVAR * MAXNVAR]; + for (auto iPoint = begin + 1; iPoint < end; iPoint++) { /*--- Invert and store the previous diagonal block to later compute the weight. ---*/ - InverseDiagonalBlock_ILUMatrix(iPoint-1, &invM[(iPoint-1)*nVar*nVar]); + InverseDiagonalBlock_ILUMatrix(iPoint - 1, &invM[(iPoint - 1) * nVar * nVar]); /*--- For this row (unknown), loop over its lower diagonal entries. ---*/ for (auto index = row_ptr_ilu[iPoint]; index < dia_ptr_ilu[iPoint]; index++) { - /*--- jPoint is the column index (jPoint < iPoint). ---*/ auto jPoint = col_ind_ilu[index]; @@ -736,13 +681,12 @@ void CSysMatrix::BuildILUPreconditioner() { /*--- Multiply the block by the inverse of the corresponding diagonal block. ---*/ - auto Block_ij = &ILU_matrix[index*nVar*nVar]; - MatrixMatrixProduct(Block_ij, &invM[jPoint*nVar*nVar], weight); + auto Block_ij = &ILU_matrix[index * nVar * nVar]; + MatrixMatrixProduct(Block_ij, &invM[jPoint * nVar * nVar], weight); /*--- "weight" holds Aij*inv(Ajj). Jump to the upper part of the jPoint row. ---*/ - for (auto index_ = dia_ptr_ilu[jPoint]+1; index_ < row_ptr_ilu[jPoint+1]; index_++) { - + for (auto index_ = dia_ptr_ilu[jPoint] + 1; index_ < row_ptr_ilu[jPoint + 1]; index_++) { /*--- Get the column index (kPoint > jPoint). ---*/ auto kPoint = col_ind_ilu[index_]; @@ -754,7 +698,7 @@ void CSysMatrix::BuildILUPreconditioner() { auto Block_ik = GetBlock_ILUMatrix(iPoint, kPoint); if (Block_ik != nullptr) { - auto Block_jk = &ILU_matrix[index_*nVar*nVar]; + auto Block_jk = &ILU_matrix[index_ * nVar * nVar]; MatrixMatrixProduct(weight, Block_jk, aux_block); MatrixSubtraction(Block_ik, aux_block, Block_ik); } @@ -763,66 +707,60 @@ void CSysMatrix::BuildILUPreconditioner() { /*--- Lastly, store "weight" in the lower triangular part, which will be reused during the forward solve in the precon/smoother. ---*/ - for (auto iVar = 0ul; iVar < nVar*nVar; ++iVar) - Block_ij[iVar] = weight[iVar]; + for (auto iVar = 0ul; iVar < nVar * nVar; ++iVar) Block_ij[iVar] = weight[iVar]; } } - InverseDiagonalBlock_ILUMatrix(end-1, &invM[(end-1)*nVar*nVar]); - + InverseDiagonalBlock_ILUMatrix(end - 1, &invM[(end - 1) * nVar * nVar]); } END_SU2_OMP_FOR - } -template -void CSysMatrix::ComputeILUPreconditioner(const CSysVector & vec, CSysVector & prod, - CGeometry *geometry, const CConfig *config) const { +template +void CSysMatrix::ComputeILUPreconditioner(const CSysVector& vec, CSysVector& prod, + CGeometry* geometry, const CConfig* config) const { /*--- Coherent view of vectors. ---*/ SU2_OMP_BARRIER /*--- OpenMP Parallelization ---*/ SU2_OMP_FOR_STAT(1) - for(unsigned long thread = 0; thread < omp_num_parts; ++thread) - { + for (unsigned long thread = 0; thread < omp_num_parts; ++thread) { const auto begin = omp_partitions[thread]; - const auto end = omp_partitions[thread+1]; + const auto end = omp_partitions[thread + 1]; if (begin == end) continue; ScalarType aux_vec[MAXNVAR]; /*--- Copy vector to then work on prod in place ---*/ - for (auto iVar = begin*nVar; iVar < end*nVar; iVar++) - prod[iVar] = vec[iVar]; + for (auto iVar = begin * nVar; iVar < end * nVar; iVar++) prod[iVar] = vec[iVar]; /*--- Forward solve the system using the lower matrix entries that were computed and stored during the ILU preprocessing. Note that we are overwriting the residual vector as we go. ---*/ - for (auto iPoint = begin+1; iPoint < end; iPoint++) { + for (auto iPoint = begin + 1; iPoint < end; iPoint++) { for (auto index = row_ptr_ilu[iPoint]; index < dia_ptr_ilu[iPoint]; index++) { auto jPoint = col_ind_ilu[index]; if (jPoint < begin) continue; - auto Block_ij = &ILU_matrix[index*nVar*nVar]; - MatrixVectorProductSub(Block_ij, &prod[jPoint*nVar], &prod[iPoint*nVar]); + auto Block_ij = &ILU_matrix[index * nVar * nVar]; + MatrixVectorProductSub(Block_ij, &prod[jPoint * nVar], &prod[iPoint * nVar]); } } /*--- Backwards substitution (starts at the last row) ---*/ for (auto iPoint = end; iPoint > begin;) { - iPoint--; // unsigned type - for (auto iVar = 0ul; iVar < nVar; iVar++) - aux_vec[iVar] = prod[iPoint*nVar+iVar]; + iPoint--; // unsigned type + for (auto iVar = 0ul; iVar < nVar; iVar++) aux_vec[iVar] = prod[iPoint * nVar + iVar]; - for (auto index = dia_ptr_ilu[iPoint]+1; index < row_ptr_ilu[iPoint+1]; index++) { + for (auto index = dia_ptr_ilu[iPoint] + 1; index < row_ptr_ilu[iPoint + 1]; index++) { auto jPoint = col_ind_ilu[index]; if (jPoint >= end) break; - auto Block_ij = &ILU_matrix[index*nVar*nVar]; - MatrixVectorProductSub(Block_ij, &prod[jPoint*nVar], aux_vec); + auto Block_ij = &ILU_matrix[index * nVar * nVar]; + MatrixVectorProductSub(Block_ij, &prod[jPoint * nVar], aux_vec); } - MatrixVectorProduct(&invM[iPoint*nVar*nVar], aux_vec, &prod[iPoint*nVar]); + MatrixVectorProduct(&invM[iPoint * nVar * nVar], aux_vec, &prod[iPoint * nVar]); } } END_SU2_OMP_FOR @@ -831,13 +769,12 @@ void CSysMatrix::ComputeILUPreconditioner(const CSysVector -void CSysMatrix::ComputeLU_SGSPreconditioner(const CSysVector & vec, CSysVector & prod, - CGeometry *geometry, const CConfig *config) const { - +template +void CSysMatrix::ComputeLU_SGSPreconditioner(const CSysVector& vec, + CSysVector& prod, CGeometry* geometry, + const CConfig* config) const { /*--- First part of the symmetric iteration: (D+L).x* = b ---*/ /*--- Coherent view of vectors. ---*/ @@ -845,10 +782,9 @@ void CSysMatrix::ComputeLU_SGSPreconditioner(const CSysVector::ComputeLU_SGSPreconditioner(const CSysVector::ComputeLU_SGSPreconditioner(const CSysVector begin;) { - iPoint--; // because of unsigned type - auto idx = iPoint*nVar; - DiagonalProduct(prod, iPoint, dia_prod); // Compute D.x* - UpperProduct(prod, iPoint, row_end, up_prod); // Compute U.x_(n+1) - VectorSubtraction(dia_prod, up_prod, &prod[idx]); // Compute y = D.x*-U.x_(n+1) - Gauss_Elimination(iPoint, &prod[idx]); // Solve D.x* = y + iPoint--; // because of unsigned type + auto idx = iPoint * nVar; + DiagonalProduct(prod, iPoint, dia_prod); // Compute D.x* + UpperProduct(prod, iPoint, row_end, up_prod); // Compute U.x_(n+1) + VectorSubtraction(dia_prod, up_prod, &prod[idx]); // Compute y = D.x*-U.x_(n+1) + Gauss_Elimination(iPoint, &prod[idx]); // Solve D.x* = y } } END_SU2_OMP_FOR @@ -899,12 +834,10 @@ void CSysMatrix::ComputeLU_SGSPreconditioner(const CSysVector -void CSysMatrix::BuildLineletPreconditioner(const CGeometry *geometry, const CConfig *config) { - +template +void CSysMatrix::BuildLineletPreconditioner(const CGeometry* geometry, const CConfig* config) { BuildJacobiPreconditioner(); /*--- Allocate working vectors if not done yet. ---*/ @@ -932,9 +865,10 @@ void CSysMatrix::BuildLineletPreconditioner(const CGeometry *geometr END_SU2_OMP_FOR } -template -void CSysMatrix::ComputeLineletPreconditioner(const CSysVector & vec, CSysVector & prod, - CGeometry *geometry, const CConfig *config) const { +template +void CSysMatrix::ComputeLineletPreconditioner(const CSysVector& vec, + CSysVector& prod, CGeometry* geometry, + const CConfig* config) const { /*--- Coherent view of vectors. ---*/ SU2_OMP_BARRIER @@ -942,17 +876,16 @@ void CSysMatrix::ComputeLineletPreconditioner(const CSysVector::ComputeLineletPreconditioner(const CSysVector::ComputeLineletPreconditioner(const CSysVector 0; --iElem) { - const auto* inv_dm1 = &lineletInvDiag[(iElem-1)*nVar*nVar]; - MatrixVectorProduct(lineletUpper[iElem-1], &lineletVector[iElem*nVar], aux_vector); - VectorSubtraction(&lineletVector[(iElem-1)*nVar], aux_vector, aux_vector); - MatrixVectorProduct(inv_dm1, aux_vector, &lineletVector[(iElem-1)*nVar]); + for (auto iElem = nElem - 1; iElem > 0; --iElem) { + const auto* inv_dm1 = &lineletInvDiag[(iElem - 1) * nVar * nVar]; + MatrixVectorProduct(lineletUpper[iElem - 1], &lineletVector[iElem * nVar], aux_vector); + VectorSubtraction(&lineletVector[(iElem - 1) * nVar], aux_vector, aux_vector); + MatrixVectorProduct(inv_dm1, aux_vector, &lineletVector[(iElem - 1) * nVar]); } /*--- Copy results to product vector ---*/ for (auto iElem = 0ul; iElem < nElem; iElem++) { const auto iPoint = li.linelets[iLinelet][iElem]; - for (auto iVar = 0ul; iVar < nVar; iVar++) - prod[iPoint*nVar+iVar] = lineletVector[iElem*nVar+iVar]; + for (auto iVar = 0ul; iVar < nVar; iVar++) prod[iPoint * nVar + iVar] = lineletVector[iElem * nVar + iVar]; } - } END_SU2_OMP_FOR @@ -1040,40 +968,38 @@ void CSysMatrix::ComputeLineletPreconditioner(const CSysVector -void CSysMatrix::ComputeResidual(const CSysVector & sol, const CSysVector & f, - CSysVector & res) const { +template +void CSysMatrix::ComputeResidual(const CSysVector& sol, const CSysVector& f, + CSysVector& res) const { SU2_OMP_BARRIER SU2_OMP_FOR_DYN(omp_heavy_size) for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { ScalarType aux_vec[MAXNVAR]; RowProduct(sol, iPoint, aux_vec); - VectorSubtraction(aux_vec, &f[iPoint*nVar], &res[iPoint*nVar]); + VectorSubtraction(aux_vec, &f[iPoint * nVar], &res[iPoint * nVar]); } END_SU2_OMP_FOR } -template -template -void CSysMatrix::EnforceSolutionAtNode(const unsigned long node_i, const OtherType *x_i, CSysVector & b) { - +template +template +void CSysMatrix::EnforceSolutionAtNode(const unsigned long node_i, const OtherType* x_i, + CSysVector& b) { /*--- Eliminate the row associated with node i (Block_ii = I and all other Block_ij = 0). * To preserve eventual symmetry, also attempt to eliminate the column, if the sparse pattern is not * symmetric the entire column may not be eliminated, the result (matrix and vector) is still correct. * The vector is updated with the product of column i by the known (enforced) solution at node i. ---*/ - for (auto index = row_ptr[node_i]; index < row_ptr[node_i+1]; ++index) { - + for (auto index = row_ptr[node_i]; index < row_ptr[node_i + 1]; ++index) { auto node_j = col_ind[index]; /*--- The diagonal block is handled outside the loop. ---*/ if (node_j == node_i) continue; /*--- Delete block j on row i (bij) and ATTEMPT to delete block i on row j (bji). ---*/ - auto bij = &matrix[index*nVar*nVar]; + auto bij = &matrix[index * nVar * nVar]; auto bji = GetBlock(node_j, node_i); /*--- The "attempt" part. ---*/ @@ -1082,15 +1008,14 @@ void CSysMatrix::EnforceSolutionAtNode(const unsigned long node_i, c bji = bij; } - for(auto iVar = 0ul; iVar < nVar; ++iVar) { - for(auto jVar = 0ul; jVar < nVar; ++jVar) { + for (auto iVar = 0ul; iVar < nVar; ++iVar) { + for (auto jVar = 0ul; jVar < nVar; ++jVar) { /*--- Column product. ---*/ - b[node_j*nVar+iVar] -= bji[iVar*nVar+jVar] * x_i[jVar]; + b[node_j * nVar + iVar] -= bji[iVar * nVar + jVar] * x_i[jVar]; /*--- Delete blocks. ---*/ - bij[iVar*nVar+jVar] = bji[iVar*nVar+jVar] = 0.0; + bij[iVar * nVar + jVar] = bji[iVar * nVar + jVar] = 0.0; } } - } /*--- Set the diagonal block to the identity. ---*/ @@ -1098,82 +1023,73 @@ void CSysMatrix::EnforceSolutionAtNode(const unsigned long node_i, c /*--- Set known solution in rhs vector. ---*/ b.SetBlock(node_i, x_i); - } -template -template -void CSysMatrix::EnforceSolutionAtDOF(unsigned long node_i, unsigned long iVar, - OtherType x_i, CSysVector & b) { - - for (auto index = row_ptr[node_i]; index < row_ptr[node_i+1]; ++index) { - +template +template +void CSysMatrix::EnforceSolutionAtDOF(unsigned long node_i, unsigned long iVar, OtherType x_i, + CSysVector& b) { + for (auto index = row_ptr[node_i]; index < row_ptr[node_i + 1]; ++index) { const auto node_j = col_ind[index]; /*--- Delete row iVar of block j on row i (bij) and ATTEMPT * to delete column iVar block i on row j (bji). ---*/ - auto bij = &matrix[index*nVar*nVar]; + auto bij = &matrix[index * nVar * nVar]; auto bji = GetBlock(node_j, node_i); /*--- The "attempt" part. ---*/ if (bji != nullptr) { - for(auto jVar = 0ul; jVar < nVar; ++jVar) { + for (auto jVar = 0ul; jVar < nVar; ++jVar) { /*--- Column product. ---*/ - b[node_j*nVar+jVar] -= bji[jVar*nVar+iVar] * x_i; + b[node_j * nVar + jVar] -= bji[jVar * nVar + iVar] * x_i; /*--- Delete entries. ---*/ - bji[jVar*nVar+iVar] = 0.0; + bji[jVar * nVar + iVar] = 0.0; } } /*--- Delete row. ---*/ - for(auto jVar = 0ul; jVar < nVar; ++jVar) - bij[iVar*nVar+jVar] = 0.0; + for (auto jVar = 0ul; jVar < nVar; ++jVar) bij[iVar * nVar + jVar] = 0.0; /*--- Set the diagonal entry of the block to 1. ---*/ - if (node_j == node_i) - bij[iVar*(nVar+1)] = 1.0; + if (node_j == node_i) bij[iVar * (nVar + 1)] = 1.0; } /*--- Set known solution in rhs vector. ---*/ b(node_i, iVar) = x_i; - } -template +template void CSysMatrix::SetDiagonalAsColumnSum() { - SU2_OMP_FOR_DYN(omp_heavy_size) for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) { + auto block_ii = &matrix[dia_ptr[iPoint] * nVar * nEqn]; - auto block_ii = &matrix[dia_ptr[iPoint]*nVar*nEqn]; - - for (auto k = 0ul; k < nVar*nEqn; ++k) block_ii[k] = 0.0; + for (auto k = 0ul; k < nVar * nEqn; ++k) block_ii[k] = 0.0; - for (auto k = row_ptr[iPoint]; k < row_ptr[iPoint+1]; ++k) { - auto block_ji = &matrix[col_ptr[k]*nVar*nEqn]; + for (auto k = row_ptr[iPoint]; k < row_ptr[iPoint + 1]; ++k) { + auto block_ji = &matrix[col_ptr[k] * nVar * nEqn]; if (block_ji != block_ii) MatrixSubtraction(block_ii, block_ji, block_ii); } } END_SU2_OMP_FOR } -template +template void CSysMatrix::TransposeInPlace() { - - assert(nVar==nEqn && "Cannot transpose with nVar != nEqn."); + assert(nVar == nEqn && "Cannot transpose with nVar != nEqn."); auto swapAndTransp = [](unsigned long n, ScalarType* a, ScalarType* b) { - assert(a!=b); + assert(a != b); /*--- a=b', b=a' ---*/ - for (auto i=0ul; i::TransposeInPlace() { if (edge_ptr) { /*--- The FV way. ---*/ - SU2_OMP_FOR_DYN(omp_heavy_size*2) + SU2_OMP_FOR_DYN(omp_heavy_size * 2) for (auto iEdge = 0ul; iEdge < edge_ptr.nEdge; ++iEdge) { - auto bij = &matrix[edge_ptr(iEdge,0)*nVar*nVar]; - auto bji = &matrix[edge_ptr(iEdge,1)*nVar*nVar]; + auto bij = &matrix[edge_ptr(iEdge, 0) * nVar * nVar]; + auto bji = &matrix[edge_ptr(iEdge, 1) * nVar * nVar]; swapAndTransp(nVar, bij, bji); } END_SU2_OMP_FOR - } - else if (col_ptr) { + } else if (col_ptr) { /*--- If the column pointer was built. ---*/ SU2_OMP_FOR_DYN(omp_heavy_size) for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) { for (auto k = row_ptr[iPoint]; k < dia_ptr[iPoint]; ++k) { - auto bij = &matrix[k*nVar*nVar]; - auto bji = &matrix[col_ptr[k]*nVar*nVar]; + auto bij = &matrix[k * nVar * nVar]; + auto bji = &matrix[col_ptr[k] * nVar * nVar]; swapAndTransp(nVar, bij, bji); } } END_SU2_OMP_FOR - } - else { + } else { /*--- Slow fallback, needs to search for ji. ---*/ SU2_OMP_FOR_DYN(omp_heavy_size) for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) { - for (auto k = dia_ptr[iPoint]+1ul; k < row_ptr[iPoint+1]; ++k) { + for (auto k = dia_ptr[iPoint] + 1ul; k < row_ptr[iPoint + 1]; ++k) { const auto jPoint = col_ind[k]; - auto bij = &matrix[k*nVar*nVar]; - auto bji = GetBlock(jPoint,iPoint); + auto bij = &matrix[k * nVar * nVar]; + auto bji = GetBlock(jPoint, iPoint); assert(bji && "Pattern is not symmetric."); swapAndTransp(nVar, bij, bji); @@ -1223,10 +1137,9 @@ void CSysMatrix::TransposeInPlace() { SU2_OMP_FOR_STAT(omp_heavy_size) for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) { - auto bii = &matrix[dia_ptr[iPoint]*nVar*nVar]; - for (auto i=0ul; i::TransposeInPlace() { #endif } -template +template void CSysMatrix::MatrixMatrixAddition(ScalarType alpha, const CSysMatrix& B) { - /*--- Check that the sparse structure is shared between the two matrices, * comparing pointers is ok as they are obtained from CGeometry. ---*/ - bool ok = (row_ptr == B.row_ptr) && (col_ind == B.col_ind) && - (nVar == B.nVar) && (nEqn == B.nEqn) && (nnz == B.nnz); + bool ok = (row_ptr == B.row_ptr) && (col_ind == B.col_ind) && (nVar == B.nVar) && (nEqn == B.nEqn) && (nnz == B.nnz); if (!ok) { SU2_MPI::Error("Matrices do not have compatible sparsity.", CURRENT_FUNCTION); } SU2_OMP_FOR_STAT(omp_light_size) - for (auto i = 0ul; i < nnz*nVar*nEqn; ++i) - matrix[i] += alpha*B.matrix[i]; + for (auto i = 0ul; i < nnz * nVar * nEqn; ++i) matrix[i] += alpha * B.matrix[i]; END_SU2_OMP_FOR - } -template -void CSysMatrix::BuildPastixPreconditioner(CGeometry *geometry, const CConfig *config, +template +void CSysMatrix::BuildPastixPreconditioner(CGeometry* geometry, const CConfig* config, unsigned short kind_fact) { #ifdef HAVE_PASTIX /*--- Pastix will launch nested threads. ---*/ - BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS - { - pastix_wrapper.SetMatrix(nVar,nPoint,nPointDomain,row_ptr,col_ind,matrix); + BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS { + pastix_wrapper.SetMatrix(nVar, nPoint, nPointDomain, row_ptr, col_ind, matrix); pastix_wrapper.Factorize(geometry, config, kind_fact); } END_SU2_OMP_SAFE_GLOBAL_ACCESS @@ -1272,11 +1180,12 @@ void CSysMatrix::BuildPastixPreconditioner(CGeometry *geometry, cons #endif } -template -void CSysMatrix::ComputePastixPreconditioner(const CSysVector & vec, CSysVector & prod, - CGeometry *geometry, const CConfig *config) const { +template +void CSysMatrix::ComputePastixPreconditioner(const CSysVector& vec, + CSysVector& prod, CGeometry* geometry, + const CConfig* config) const { #ifdef HAVE_PASTIX - SU2_OMP_SAFE_GLOBAL_ACCESS(pastix_wrapper.Solve(vec,prod);) + SU2_OMP_SAFE_GLOBAL_ACCESS(pastix_wrapper.Solve(vec, prod);) CSysMatrixComms::Initiate(prod, geometry, config); CSysMatrixComms::Complete(prod, geometry, config); @@ -1287,15 +1196,16 @@ void CSysMatrix::ComputePastixPreconditioner(const CSysVector(const CSysVector&, CGeometry*, const CConfig*, unsigned short);\ -template void CSysMatrixComms::Complete(CSysVector&, CGeometry*, const CConfig*, unsigned short); +#define INSTANTIATE_COMMS(TYPE) \ + template void CSysMatrixComms::Initiate(const CSysVector&, CGeometry*, const CConfig*, unsigned short); \ + template void CSysMatrixComms::Complete(CSysVector&, CGeometry*, const CConfig*, unsigned short); -#define INSTANTIATE_MATRIX(TYPE)\ -template class CSysMatrix;\ -template void CSysMatrix::EnforceSolutionAtNode(unsigned long, const su2double*, CSysVector&);\ -template void CSysMatrix::EnforceSolutionAtDOF(unsigned long, unsigned long, su2double, CSysVector&);\ -INSTANTIATE_COMMS(TYPE) +#define INSTANTIATE_MATRIX(TYPE) \ + template class CSysMatrix; \ + template void CSysMatrix::EnforceSolutionAtNode(unsigned long, const su2double*, CSysVector&); \ + template void CSysMatrix::EnforceSolutionAtDOF(unsigned long, unsigned long, su2double, \ + CSysVector&); \ + INSTANTIATE_COMMS(TYPE) #ifdef CODI_FORWARD_TYPE /*--- In forward AD only the active type is used. ---*/ @@ -1310,4 +1220,4 @@ INSTANTIATE_MATRIX(passivedouble) #ifdef CODI_REVERSE_TYPE INSTANTIATE_COMMS(su2double) #endif -#endif // CODI_FORWARD_TYPE +#endif // CODI_FORWARD_TYPE diff --git a/Common/src/linear_algebra/CSysSolve.cpp b/Common/src/linear_algebra/CSysSolve.cpp index 7b32d8b0742..00eef72fdaf 100644 --- a/Common/src/linear_algebra/CSysSolve.cpp +++ b/Common/src/linear_algebra/CSysSolve.cpp @@ -2,7 +2,7 @@ * \file CSysSolve.cpp * \brief Main classes required for solving linear systems of equations * \author J. Hicken, F. Palacios, T. Economon, P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -41,79 +41,86 @@ * decide if the linear system is already solved. */ namespace { - template - constexpr T linSolEpsilon() { return numeric_limits::epsilon(); } - template<> - constexpr float linSolEpsilon() { return 1e-12; } +template +constexpr T linSolEpsilon() { + return numeric_limits::epsilon(); } - -template -CSysSolve::CSysSolve(LINEAR_SOLVER_MODE linear_solver_mode) : - eps(linSolEpsilon()), - lin_sol_mode(linear_solver_mode), - cg_ready(false), - bcg_ready(false), - smooth_ready(false), - LinSysSol_ptr(nullptr), - LinSysRes_ptr(nullptr) { +template <> +constexpr float linSolEpsilon() { + return 1e-12; } - -template -void CSysSolve::ApplyGivens(ScalarType s, ScalarType c, ScalarType & h1, ScalarType & h2) const { - - ScalarType temp = c*h1 + s*h2; - h2 = c*h2 - s*h1; +} // namespace + +template +CSysSolve::CSysSolve(LINEAR_SOLVER_MODE linear_solver_mode) + : eps(linSolEpsilon()), + lin_sol_mode(linear_solver_mode), + cg_ready(false), + bcg_ready(false), + smooth_ready(false), + LinSysSol_ptr(nullptr), + LinSysRes_ptr(nullptr) {} + +template +void CSysSolve::ApplyGivens(ScalarType s, ScalarType c, ScalarType& h1, ScalarType& h2) const { + ScalarType temp = c * h1 + s * h2; + h2 = c * h2 - s * h1; h1 = temp; } -template -void CSysSolve::GenerateGivens(ScalarType & dx, ScalarType & dy, ScalarType & s, ScalarType & c) const { - - if ( (dx == 0.0) && (dy == 0.0) ) { +template +void CSysSolve::GenerateGivens(ScalarType& dx, ScalarType& dy, ScalarType& s, ScalarType& c) const { + if ((dx == 0.0) && (dy == 0.0)) { c = 1.0; s = 0.0; - } - else if ( fabs(dy) > fabs(dx) ) { - ScalarType tmp = dx/dy; - dx = sqrt(1.0 + tmp*tmp); - s = Sign(1.0/dx, dy); - c = tmp*s; - } - else if ( fabs(dy) <= fabs(dx) ) { - ScalarType tmp = dy/dx; - dy = sqrt(1.0 + tmp*tmp); - c = Sign(1.0/dy, dx); - s = tmp*c; - } - else { + } else if (fabs(dy) > fabs(dx)) { + ScalarType tmp = dx / dy; + dx = sqrt(1.0 + tmp * tmp); + s = Sign(1.0 / dx, dy); + c = tmp * s; + } else if (fabs(dy) <= fabs(dx)) { + ScalarType tmp = dy / dx; + dy = sqrt(1.0 + tmp * tmp); + c = Sign(1.0 / dy, dx); + s = tmp * c; + } else { // dx and/or dy must be invalid dx = 0.0; dy = 0.0; c = 1.0; s = 0.0; } - dx = fabs(dx*dy); + dx = fabs(dx * dy); dy = 0.0; } -template -void CSysSolve::SolveReduced(int n, const su2matrix& Hsbg, - const su2vector& rhs, su2vector& x) const { +template +void CSysSolve::SolveReduced(int n, const su2matrix& Hsbg, const su2vector& rhs, + su2vector& x) const { // initialize... - for (int i = 0; i < n; i++) - x[i] = rhs[i]; + for (int i = 0; i < n; i++) x[i] = rhs[i]; // ... and backsolve - for (int i = n-1; i >= 0; i--) { - x[i] /= Hsbg(i,i); - for (int j = i-1; j >= 0; j--) { - x[j] -= Hsbg(j,i)*x[i]; + for (int i = n - 1; i >= 0; i--) { + x[i] /= Hsbg(i, i); + for (int j = i - 1; j >= 0; j--) { + x[j] -= Hsbg(j, i) * x[i]; } } } -template -void CSysSolve::ModGramSchmidt(int i, su2matrix& Hsbg, +template +void CSysSolve::ModGramSchmidt(bool shared_hsbg, int i, su2matrix& Hsbg, vector >& w) const { + const auto thread = omp_get_thread_num(); + + /*--- If Hsbg is shared by multiple threads calling this function, only one + * thread can write into it. If Hsbg is private, all threads need to write. ---*/ + + auto SetHsbg = [&](int row, int col, const ScalarType& value) { + if (!shared_hsbg || thread == 0) { + Hsbg(row, col) = value; + } + }; /*--- Parameter for reorthonormalization ---*/ @@ -122,8 +129,8 @@ void CSysSolve::ModGramSchmidt(int i, su2matrix& Hsbg, /*--- Get the norm of the vector being orthogonalized, and find the threshold for re-orthogonalization ---*/ - ScalarType nrm = w[i+1].squaredNorm(); - ScalarType thr = nrm*reorth; + ScalarType nrm = w[i + 1].squaredNorm(); + ScalarType thr = nrm * reorth; /*--- The norm of w[i+1] < 0.0 or w[i+1] = NaN ---*/ @@ -134,73 +141,70 @@ void CSysSolve::ModGramSchmidt(int i, su2matrix& Hsbg, /*--- Begin main Gram-Schmidt loop ---*/ - for (int k = 0; k < i+1; k++) { - ScalarType prod = w[i+1].dot(w[k]); - Hsbg(k,i) = prod; - w[i+1] -= prod * w[k]; + for (int k = 0; k < i + 1; k++) { + ScalarType prod = w[i + 1].dot(w[k]); + ScalarType h_ki = prod; + w[i + 1] -= prod * w[k]; /*--- Check if reorthogonalization is necessary ---*/ - if (prod*prod > thr) { - prod = w[i+1].dot(w[k]); - Hsbg(k,i) += prod; - w[i+1] -= prod * w[k]; + if (prod * prod > thr) { + prod = w[i + 1].dot(w[k]); + h_ki += prod; + w[i + 1] -= prod * w[k]; } + SetHsbg(k, i, h_ki); /*--- Update the norm and check its size ---*/ - nrm -= pow(Hsbg(k,i),2); + nrm -= pow(h_ki, 2); nrm = max(nrm, 0.0); - thr = nrm*reorth; + thr = nrm * reorth; } /*--- Test the resulting vector ---*/ - nrm = w[i+1].norm(); - Hsbg(i+1,i) = nrm; + nrm = w[i + 1].norm(); + SetHsbg(i + 1, i, nrm); /*--- Scale the resulting vector ---*/ - w[i+1] /= nrm; - + w[i + 1] /= nrm; } -template -void CSysSolve::WriteHeader(string solver, ScalarType restol, ScalarType resinit) const { - +template +void CSysSolve::WriteHeader(const string& solver, ScalarType restol, ScalarType resinit) const { cout << "\n# " << solver << " residual history\n"; cout << "# Residual tolerance target = " << restol << "\n"; cout << "# Initial residual norm = " << resinit << endl; } -template +template void CSysSolve::WriteHistory(unsigned long iter, ScalarType res) const { - cout << " " << iter << " " << res << endl; } -template -void CSysSolve::WriteFinalResidual(string solver, unsigned long iter, ScalarType res) const { - +template +void CSysSolve::WriteFinalResidual(const string& solver, unsigned long iter, ScalarType res) const { cout << "# " << solver << " final (true) residual:\n"; cout << "# Iteration = " << iter << ": |res|/|res0| = " << res << ".\n" << endl; } -template +template void CSysSolve::WriteWarning(ScalarType res_calc, ScalarType res_true, ScalarType tol) const { - cout << "# WARNING:\n"; cout << "# true residual norm and calculated residual norm do not agree.\n"; - cout << "# true_res = " << res_true << ", calc_res = " << res_calc << ", tol = " << tol*10 << ".\n"; + cout << "# true_res = " << res_true << ", calc_res = " << res_calc << ", tol = " << tol * 10 << ".\n"; cout << "# true_res - calc_res = " << res_true - res_calc << endl; } -template -unsigned long CSysSolve::CG_LinSolver(const CSysVector & b, CSysVector & x, - const CMatrixVectorProduct & mat_vec, const CPreconditioner & precond, - ScalarType tol, unsigned long m, ScalarType & residual, bool monitoring, const CConfig *config) const { - - const bool master = (SU2_MPI::GetRank() == MASTER_NODE) && (omp_get_thread_num() == 0); +template +unsigned long CSysSolve::CG_LinSolver(const CSysVector& b, CSysVector& x, + const CMatrixVectorProduct& mat_vec, + const CPreconditioner& precond, ScalarType tol, + unsigned long m, ScalarType& residual, bool monitoring, + const CConfig* config) const { + const bool masterRank = (SU2_MPI::GetRank() == MASTER_NODE); ScalarType norm_r = 0.0, norm0 = 0.0; unsigned long i = 0; @@ -214,8 +218,7 @@ unsigned long CSysSolve::CG_LinSolver(const CSysVector & * do this since the working vectors are shared. ---*/ if (!cg_ready) { - BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS - { + BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS { auto nVar = b.GetNVar(); auto nBlk = b.GetNBlk(); auto nBlkDomain = b.GetNBlkDomain(); @@ -242,26 +245,31 @@ unsigned long CSysSolve::CG_LinSolver(const CSysVector & /*--- Only compute the residuals in full communication mode. ---*/ if (config->GetComm_Level() == COMM_FULL) { - norm_r = r.norm(); - norm0 = b.norm(); + norm0 = b.norm(); /*--- Set the norm to the initial initial residual value ---*/ if (tol_type == LinearToleranceType::RELATIVE) norm0 = norm_r; - if ((norm_r < tol*norm0) || (norm_r < eps)) { - if (master && (lin_sol_mode!=LINEAR_SOLVER_MODE::MESH_DEFORM)) cout << "CSysSolve::ConjugateGradient(): system solved by initial guess." << endl; + if ((norm_r < tol * norm0) || (norm_r < eps)) { + if (masterRank && (lin_sol_mode != LINEAR_SOLVER_MODE::MESH_DEFORM)) { + SU2_OMP_MASTER + cout << "CSysSolve::ConjugateGradient(): system solved by initial guess." << endl; + END_SU2_OMP_MASTER + } return 0; } /*--- Output header information including initial residual ---*/ - if (monitoring && master) { - WriteHeader("CG", tol, norm_r); - WriteHistory(i, norm_r/norm0); + if (monitoring && masterRank) { + SU2_OMP_MASTER { + WriteHeader("CG", tol, norm_r); + WriteHistory(i, norm_r / norm0); + } + END_SU2_OMP_MASTER } - } precond(r, z); @@ -271,7 +279,6 @@ unsigned long CSysSolve::CG_LinSolver(const CSysVector & /*--- Loop over all search directions ---*/ for (i = 0; i < m; i++) { - /*--- Apply matrix to p to build Krylov subspace ---*/ mat_vec(p, A_x); @@ -288,14 +295,15 @@ unsigned long CSysSolve::CG_LinSolver(const CSysVector & /*--- Only compute the residuals in full communication mode. ---*/ if (config->GetComm_Level() == COMM_FULL) { - /*--- Check if solution has converged, else output the relative residual if necessary ---*/ norm_r = r.norm(); - if (norm_r < tol*norm0) break; - if (((monitoring) && (master)) && ((i+1) % monitorFreq == 0)) - WriteHistory(i+1, norm_r/norm0); - + if (norm_r < tol * norm0) break; + if (((monitoring) && (masterRank)) && ((i + 1) % monitorFreq == 0)) { + SU2_OMP_MASTER + WriteHistory(i + 1, norm_r / norm0); + END_SU2_OMP_MASTER + } } precond(r, z); @@ -308,41 +316,48 @@ unsigned long CSysSolve::CG_LinSolver(const CSysVector & /*--- Gram-Schmidt orthogonalization. ---*/ - p = beta*p + z; - + p = beta * p + z; } /*--- Recalculate final residual (this should be optional) ---*/ if ((monitoring) && (config->GetComm_Level() == COMM_FULL)) { - - if (master) WriteFinalResidual("CG", i, norm_r/norm0); + if (masterRank) { + SU2_OMP_MASTER + WriteFinalResidual("CG", i, norm_r / norm0); + END_SU2_OMP_MASTER + } if (recomputeRes) { mat_vec(x, A_x); r = b - A_x; ScalarType true_res = r.norm(); - if (fabs(true_res - norm_r) > tol*10.0) { - if (master) { + if (fabs(true_res - norm_r) > tol * 10.0) { + if (masterRank) { + SU2_OMP_MASTER WriteWarning(norm_r, true_res, tol); + END_SU2_OMP_MASTER } } } } - residual = norm_r/norm0; + residual = norm_r / norm0; return i; - } -template -unsigned long CSysSolve::FGMRES_LinSolver(const CSysVector & b, CSysVector & x, - const CMatrixVectorProduct & mat_vec, const CPreconditioner & precond, - ScalarType tol, unsigned long m, ScalarType & residual, bool monitoring, const CConfig *config) const { - - const bool master = (SU2_MPI::GetRank() == MASTER_NODE) && (omp_get_thread_num() == 0); +template +unsigned long CSysSolve::FGMRES_LinSolver(const CSysVector& b, CSysVector& x, + const CMatrixVectorProduct& mat_vec, + const CPreconditioner& precond, ScalarType tol, + unsigned long m, ScalarType& residual, bool monitoring, + const CConfig* config) const { + const bool masterRank = (SU2_MPI::GetRank() == MASTER_NODE); const bool flexible = !precond.IsIdentity(); + /*--- If we call the solver outside of a parallel region, but the number of threads allows, + * we still want to parallelize some of the expensive operations. ---*/ + const bool nestedParallel = !omp_in_parallel() && omp_get_max_threads() > 1; /*--- Check the subspace size ---*/ @@ -357,12 +372,11 @@ unsigned long CSysSolve::FGMRES_LinSolver(const CSysVector::FGMRES_LinSolver(const CSysVector g(m+1), sn(m+1), cs(m+1), y(m); + su2vector g(m + 1), sn(m + 1), cs(m + 1), y(m); g = ScalarType(0); sn = ScalarType(0); cs = ScalarType(0); y = ScalarType(0); - su2matrix H(m+1, m); + su2matrix H(m + 1, m); H = ScalarType(0); /*--- Calculate the norm of the rhs vector. ---*/ @@ -390,8 +404,7 @@ unsigned long CSysSolve::FGMRES_LinSolver(const CSysVector::FGMRES_LinSolver(const CSysVector::FGMRES_LinSolver(const CSysVector::FGMRES_LinSolver(const CSysVectorGetComm_Level() == COMM_FULL)) { - - if (master) WriteFinalResidual("FGMRES", i, beta/norm0); + if (masterRank) { + SU2_OMP_MASTER + WriteFinalResidual("FGMRES", i, beta / norm0); + END_SU2_OMP_MASTER + } if (recomputeRes) { mat_vec(x, W[0]); W[0] -= b; ScalarType res = W[0].norm(); - if (fabs(res - beta) > tol*10) { - if (master) { + if (fabs(res - beta) > tol * 10) { + if (masterRank) { + SU2_OMP_MASTER WriteWarning(beta, res, tol); + END_SU2_OMP_MASTER } } } } - residual = beta/norm0; + residual = beta / norm0; return i; - } -template -unsigned long CSysSolve::RFGMRES_LinSolver(const CSysVector & b, CSysVector & x, - const CMatrixVectorProduct & mat_vec, const CPreconditioner & precond, - ScalarType tol, unsigned long MaxIter, ScalarType & residual, bool monitoring, const CConfig *config) { - +template +unsigned long CSysSolve::RFGMRES_LinSolver(const CSysVector& b, CSysVector& x, + const CMatrixVectorProduct& mat_vec, + const CPreconditioner& precond, ScalarType tol, + unsigned long MaxIter, ScalarType& residual, bool monitoring, + const CConfig* config) { const auto restartIter = config->GetLinear_Solver_Restart_Frequency(); SU2_OMP_MASTER { @@ -517,24 +552,25 @@ unsigned long CSysSolve::RFGMRES_LinSolver(const CSysVector -unsigned long CSysSolve::BCGSTAB_LinSolver(const CSysVector & b, CSysVector & x, - const CMatrixVectorProduct & mat_vec, const CPreconditioner & precond, - ScalarType tol, unsigned long m, ScalarType & residual, bool monitoring, const CConfig *config) const { - - const bool master = (SU2_MPI::GetRank() == MASTER_NODE) && (omp_get_thread_num() == 0); +template +unsigned long CSysSolve::BCGSTAB_LinSolver(const CSysVector& b, CSysVector& x, + const CMatrixVectorProduct& mat_vec, + const CPreconditioner& precond, ScalarType tol, + unsigned long m, ScalarType& residual, bool monitoring, + const CConfig* config) const { + const bool masterRank = (SU2_MPI::GetRank() == MASTER_NODE); ScalarType norm_r = 0.0, norm0 = 0.0; unsigned long i = 0; @@ -547,8 +583,7 @@ unsigned long CSysSolve::BCGSTAB_LinSolver(const CSysVector::BCGSTAB_LinSolver(const CSysVectorGetComm_Level() == COMM_FULL) { - norm_r = r.norm(); - norm0 = b.norm(); + norm0 = b.norm(); /*--- Set the norm to the initial initial residual value ---*/ if (tol_type == LinearToleranceType::RELATIVE) norm0 = norm_r; - if ((norm_r < tol*norm0) || (norm_r < eps)) { - if (master) cout << "CSysSolve::BCGSTAB(): system solved by initial guess." << endl; + if ((norm_r < tol * norm0) || (norm_r < eps)) { + if (masterRank) { + SU2_OMP_MASTER + cout << "CSysSolve::BCGSTAB(): system solved by initial guess." << endl; + END_SU2_OMP_MASTER + } return 0; } /*--- Output header information including initial residual ---*/ - if ((monitoring) && (master)) { - WriteHeader("BCGSTAB", tol, norm_r); - WriteHistory(i, norm_r/norm0); + if ((monitoring) && (masterRank)) { + SU2_OMP_MASTER { + WriteHeader("BCGSTAB", tol, norm_r); + WriteHistory(i, norm_r / norm0); + } + END_SU2_OMP_MASTER } - } /*--- Initialization ---*/ ScalarType alpha = 1.0, omega = 1.0, rho = 1.0, rho_prime = 1.0; - p = ScalarType(0.0); v = ScalarType(0.0); r_0 = r; + p = ScalarType(0.0); + v = ScalarType(0.0); + r_0 = r; /*--- Loop over all search directions ---*/ for (i = 0; i < m; i++) { - /*--- Compute rho_prime ---*/ rho_prime = rho; @@ -618,11 +659,11 @@ unsigned long CSysSolve::BCGSTAB_LinSolver(const CSysVector::BCGSTAB_LinSolver(const CSysVectorGetComm_Level() == COMM_FULL) { - /*--- Check if solution has converged, else output the relative residual if necessary ---*/ norm_r = r.norm(); - if (norm_r < tol*norm0) break; - if (((monitoring) && (master)) && ((i+1) % monitorFreq == 0) && (master)) - WriteHistory(i+1, norm_r/norm0); - + if (norm_r < tol * norm0) break; + if (((monitoring) && (masterRank)) && ((i + 1) % monitorFreq == 0)) { + SU2_OMP_MASTER + WriteHistory(i + 1, norm_r / norm0); + END_SU2_OMP_MASTER + } } - } /*--- Recalculate final residual (this should be optional) ---*/ if ((monitoring) && (config->GetComm_Level() == COMM_FULL)) { - - if (master) WriteFinalResidual("BCGSTAB", i, norm_r/norm0); + if (masterRank) { + SU2_OMP_MASTER + WriteFinalResidual("BCGSTAB", i, norm_r / norm0); + END_SU2_OMP_MASTER + } if (recomputeRes) { mat_vec(x, A_x); r = b - A_x; ScalarType true_res = r.norm(); - if ((fabs(true_res - norm_r) > tol*10.0) && (master)) { + if ((fabs(true_res - norm_r) > tol * 10.0) && (masterRank)) { + SU2_OMP_MASTER WriteWarning(norm_r, true_res, tol); + END_SU2_OMP_MASTER } } } - residual = norm_r/norm0; + residual = norm_r / norm0; return i; } -template -unsigned long CSysSolve::Smoother_LinSolver(const CSysVector & b, CSysVector & x, - const CMatrixVectorProduct & mat_vec, const CPreconditioner & precond, - ScalarType tol, unsigned long m, ScalarType & residual, bool monitoring, const CConfig *config) const { - - const bool master = (SU2_MPI::GetRank() == MASTER_NODE) && (omp_get_thread_num() == 0); +template +unsigned long CSysSolve::Smoother_LinSolver(const CSysVector& b, CSysVector& x, + const CMatrixVectorProduct& mat_vec, + const CPreconditioner& precond, ScalarType tol, + unsigned long m, ScalarType& residual, bool monitoring, + const CConfig* config) const { + const bool masterRank = (SU2_MPI::GetRank() == MASTER_NODE); const bool fix_iter_mode = tol < eps; ScalarType norm_r = 0.0, norm0 = 0.0; unsigned long i = 0; @@ -712,8 +759,7 @@ unsigned long CSysSolve::Smoother_LinSolver(const CSysVector::Smoother_LinSolver(const CSysVectorGetComm_Level() == COMM_FULL) { - norm_r = r.norm(); - norm0 = b.norm(); + norm0 = b.norm(); /*--- Set the norm to the initial initial residual value ---*/ if (tol_type == LinearToleranceType::RELATIVE) norm0 = norm_r; - if ( (norm_r < tol*norm0) || (norm_r < eps) ) { - if (master) cout << "CSysSolve::Smoother_LinSolver(): system solved by initial guess." << endl; + if ((norm_r < tol * norm0) || (norm_r < eps)) { + if (masterRank) { + SU2_OMP_MASTER + cout << "CSysSolve::Smoother_LinSolver(): system solved by initial guess." << endl; + END_SU2_OMP_MASTER + } return 0; } /*--- Output header information including initial residual. ---*/ - if ((monitoring) && (master)) { - WriteHeader("Smoother", tol, norm_r); - WriteHistory(i, norm_r/norm0); + if ((monitoring) && (masterRank)) { + SU2_OMP_MASTER { + WriteHeader("Smoother", tol, norm_r); + WriteHistory(i, norm_r / norm0); + } + END_SU2_OMP_MASTER } - } /*--- Smoothing Iterations ---*/ - for (i=0; i::Smoother_LinSolver(const CSysVectorGetComm_Level() == COMM_FULL) { norm_r = r.norm(); - if (norm_r < tol*norm0) break; - if (((monitoring) && (master)) && ((i+1) % monitorFreq == 0)) - WriteHistory(i+1, norm_r/norm0); + if (norm_r < tol * norm0) break; + if (((monitoring) && (masterRank)) && ((i + 1) % monitorFreq == 0)) { + SU2_OMP_MASTER + WriteHistory(i + 1, norm_r / norm0); + END_SU2_OMP_MASTER + } } } if (fix_iter_mode) norm_r = r.norm(); - if ((monitoring) && (master) && (config->GetComm_Level() == COMM_FULL)) { - WriteFinalResidual("Smoother", i, norm_r/norm0); + if ((monitoring) && (masterRank) && (config->GetComm_Level() == COMM_FULL)) { + SU2_OMP_MASTER + WriteFinalResidual("Smoother", i, norm_r / norm0); + END_SU2_OMP_MASTER } - residual = norm_r/norm0; + residual = norm_r / norm0; return i; } -template -unsigned long CSysSolve::Solve(CSysMatrix & Jacobian, const CSysVector & LinSysRes, - CSysVector & LinSysSol, CGeometry *geometry, const CConfig *config) { +template +unsigned long CSysSolve::Solve(CSysMatrix& Jacobian, const CSysVector& LinSysRes, + CSysVector& LinSysSol, CGeometry* geometry, + const CConfig* config) { /*--- A word about the templated types. It is assumed that the residual and solution vectors are always of su2doubles, meaning that they are active in the discrete adjoint. The same assumption is made in SetExternalSolve. @@ -828,31 +884,32 @@ unsigned long CSysSolve::Solve(CSysMatrix & Jacobian, co switch (lin_sol_mode) { /*--- Mesh Deformation mode ---*/ case LINEAR_SOLVER_MODE::MESH_DEFORM: { - KindSolver = config->GetKind_Deform_Linear_Solver(); - KindPrecond = config->GetKind_Deform_Linear_Solver_Prec(); - MaxIter = config->GetDeform_Linear_Solver_Iter(); - SolverTol = SU2_TYPE::GetValue(config->GetDeform_Linear_Solver_Error()); + KindSolver = config->GetKind_Deform_Linear_Solver(); + KindPrecond = config->GetKind_Deform_Linear_Solver_Prec(); + MaxIter = config->GetDeform_Linear_Solver_Iter(); + SolverTol = SU2_TYPE::GetValue(config->GetDeform_Linear_Solver_Error()); ScreenOutput = config->GetDeform_Output(); break; } /*--- Gradient Smoothing mode ---*/ case LINEAR_SOLVER_MODE::GRADIENT_MODE: { - KindSolver = config->GetKind_Grad_Linear_Solver(); - KindPrecond = config->GetKind_Grad_Linear_Solver_Prec(); - MaxIter = config->GetGrad_Linear_Solver_Iter(); - SolverTol = SU2_TYPE::GetValue(config->GetGrad_Linear_Solver_Error()); + KindSolver = config->GetKind_Grad_Linear_Solver(); + KindPrecond = config->GetKind_Grad_Linear_Solver_Prec(); + MaxIter = config->GetGrad_Linear_Solver_Iter(); + SolverTol = SU2_TYPE::GetValue(config->GetGrad_Linear_Solver_Error()); ScreenOutput = true; break; } /*--- Normal mode - * assumes that 'lin_sol_mode==LINEAR_SOLVER_MODE::STANDARD', but does not enforce it to avoid compiler warning. ---*/ + * assumes that 'lin_sol_mode==LINEAR_SOLVER_MODE::STANDARD', but does not enforce it to avoid compiler warning. + * ---*/ default: { - KindSolver = config->GetKind_Linear_Solver(); - KindPrecond = config->GetKind_Linear_Solver_Prec(); - MaxIter = config->GetLinear_Solver_Iter(); - SolverTol = SU2_TYPE::GetValue(config->GetLinear_Solver_Error()); + KindSolver = config->GetKind_Linear_Solver(); + KindPrecond = config->GetKind_Linear_Solver_Prec(); + MaxIter = config->GetLinear_Solver_Iter(); + SolverTol = SU2_TYPE::GetValue(config->GetLinear_Solver_Error()); ScreenOutput = false; break; } @@ -864,136 +921,144 @@ unsigned long CSysSolve::Solve(CSysMatrix & Jacobian, co if (config->GetDiscrete_Adjoint()) { #ifdef CODI_REVERSE_TYPE - TapeActive = AD::getGlobalTape().isActive(); + TapeActive = AD::TapeActive(); + /*--- Declare external function inputs, outputs, and data ---*/ BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS { - AD::StartExtFunc(false, false); AD::SetExtFuncIn(&LinSysRes[0], LinSysRes.GetLocSize()); + AD::SetExtFuncOut(&LinSysSol[0], LinSysSol.GetLocSize()); + AD::FuncHelper.addUserData(&LinSysRes); + AD::FuncHelper.addUserData(&LinSysSol); + AD::FuncHelper.addUserData(&Jacobian); + AD::FuncHelper.addUserData(geometry); + AD::FuncHelper.addUserData(config); + AD::FuncHelper.addUserData(this); } END_SU2_OMP_SAFE_GLOBAL_ACCESS - - AD::StopRecording(); #endif } - /*--- Create matrix-vector product, preconditioner, and solve the linear system ---*/ - - HandleTemporariesIn(LinSysRes, LinSysSol); - - auto mat_vec = CSysMatrixVectorProduct(Jacobian, geometry, config); - - const auto kindPrec = static_cast(KindPrecond); - - auto precond = CPreconditioner::Create(kindPrec, Jacobian, geometry, config); - - /*--- Build preconditioner. ---*/ - - precond->Build(); - - /*--- Solve system. ---*/ - unsigned long IterLinSol = 0; - ScalarType residual = 0.0; - switch (KindSolver) { - case BCGSTAB: - IterLinSol = BCGSTAB_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol, MaxIter, residual, ScreenOutput, config); - break; - case FGMRES: - IterLinSol = FGMRES_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol, MaxIter, residual, ScreenOutput, config); - break; - case RESTARTED_FGMRES: - IterLinSol = RFGMRES_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol, MaxIter, residual, ScreenOutput, config); - break; - case CONJUGATE_GRADIENT: - IterLinSol = CG_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol, MaxIter, residual, ScreenOutput, config); - break; - case SMOOTHER: - IterLinSol = Smoother_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol, MaxIter, residual, ScreenOutput, config); - break; - case PASTIX_LDLT : case PASTIX_LU: - Jacobian.BuildPastixPreconditioner(geometry, config, KindSolver); - Jacobian.ComputePastixPreconditioner(*LinSysRes_ptr, *LinSysSol_ptr, geometry, config); - IterLinSol = 1; - residual = 1e-20; - break; - default: - SU2_MPI::Error("Unknown type of linear solver.",CURRENT_FUNCTION); - } + /*--- Declaration of the external function ---*/ + auto externalFunction = [&]() { + /*--- Create matrix-vector product, preconditioner, and solve the linear system ---*/ - SU2_OMP_MASTER - { - Residual = residual; - Iterations = IterLinSol; - } - END_SU2_OMP_MASTER + HandleTemporariesIn(LinSysRes, LinSysSol); - HandleTemporariesOut(LinSysSol); + auto mat_vec = CSysMatrixVectorProduct(Jacobian, geometry, config); - delete precond; + const auto kindPrec = static_cast(KindPrecond); - if(TapeActive) { + auto precond = CPreconditioner::Create(kindPrec, Jacobian, geometry, config); - /*--- To keep the behavior of SU2_DOT, but not strictly required since jacobian is symmetric(?). ---*/ - const bool RequiresTranspose = ((lin_sol_mode!=LINEAR_SOLVER_MODE::MESH_DEFORM) || (config->GetKind_SU2() == SU2_COMPONENT::SU2_DOT)); + /*--- Build preconditioner. ---*/ - if (lin_sol_mode==LINEAR_SOLVER_MODE::MESH_DEFORM) KindPrecond = config->GetKind_Deform_Linear_Solver_Prec(); - else if (lin_sol_mode==LINEAR_SOLVER_MODE::GRADIENT_MODE) KindPrecond = config->GetKind_Grad_Linear_Solver_Prec(); - else KindPrecond = config->GetKind_DiscAdj_Linear_Prec(); + precond->Build(); - /*--- Build preconditioner for the transposed Jacobian ---*/ + /*--- Solve system. ---*/ - if (RequiresTranspose) Jacobian.TransposeInPlace(); + ScalarType residual = 0.0; - switch(KindPrecond) { - case ILU: - if (RequiresTranspose) Jacobian.BuildILUPreconditioner(); + switch (KindSolver) { + case BCGSTAB: + IterLinSol = BCGSTAB_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol, MaxIter, residual, + ScreenOutput, config); break; - case JACOBI: - case LINELET: - if (RequiresTranspose) Jacobian.BuildJacobiPreconditioner(); + case FGMRES: + IterLinSol = FGMRES_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol, MaxIter, residual, + ScreenOutput, config); break; - case LU_SGS: - /*--- Nothing to build. ---*/ + case RESTARTED_FGMRES: + IterLinSol = RFGMRES_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol, MaxIter, residual, + ScreenOutput, config); break; - case PASTIX_ILU: case PASTIX_LU_P: case PASTIX_LDLT_P: - /*--- It was already built. ---*/ + case CONJUGATE_GRADIENT: + IterLinSol = CG_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol, MaxIter, residual, + ScreenOutput, config); break; - default: - SU2_MPI::Error("The specified preconditioner is not yet implemented for the discrete adjoint method.", CURRENT_FUNCTION); + case SMOOTHER: + IterLinSol = Smoother_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol, MaxIter, residual, + ScreenOutput, config); break; + case PASTIX_LDLT: + case PASTIX_LU: + Jacobian.BuildPastixPreconditioner(geometry, config, KindSolver); + Jacobian.ComputePastixPreconditioner(*LinSysRes_ptr, *LinSysSol_ptr, geometry, config); + IterLinSol = 1; + residual = 1e-20; + break; + default: + SU2_MPI::Error("Unknown type of linear solver.", CURRENT_FUNCTION); } - /*--- Start recording if it was stopped for the linear solver ---*/ -#ifdef CODI_REVERSE_TYPE - AD::StartRecording(); - - BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS - { - AD::SetExtFuncOut(&LinSysSol[0], LinSysSol.GetLocSize()); - AD::FuncHelper->addUserData(&LinSysRes); - AD::FuncHelper->addUserData(&LinSysSol); - AD::FuncHelper->addUserData(&Jacobian); - AD::FuncHelper->addUserData(geometry); - AD::FuncHelper->addUserData(config); - AD::FuncHelper->addUserData(this); + SU2_OMP_MASTER { + Residual = residual; + Iterations = IterLinSol; } - END_SU2_OMP_SAFE_GLOBAL_ACCESS + END_SU2_OMP_MASTER + + HandleTemporariesOut(LinSysSol); + + delete precond; + + if (TapeActive) { + /*--- To keep the behavior of SU2_DOT, but not strictly required since jacobian is symmetric(?). ---*/ + const bool RequiresTranspose = + ((lin_sol_mode != LINEAR_SOLVER_MODE::MESH_DEFORM) || (config->GetKind_SU2() == SU2_COMPONENT::SU2_DOT)); + + if (lin_sol_mode == LINEAR_SOLVER_MODE::MESH_DEFORM) + KindPrecond = config->GetKind_Deform_Linear_Solver_Prec(); + else if (lin_sol_mode == LINEAR_SOLVER_MODE::GRADIENT_MODE) + KindPrecond = config->GetKind_Grad_Linear_Solver_Prec(); + else + KindPrecond = config->GetKind_DiscAdj_Linear_Prec(); + + /*--- Build preconditioner for the transposed Jacobian ---*/ + + if (RequiresTranspose) Jacobian.TransposeInPlace(); + + switch (KindPrecond) { + case ILU: + if (RequiresTranspose) Jacobian.BuildILUPreconditioner(); + break; + case JACOBI: + case LINELET: + if (RequiresTranspose) Jacobian.BuildJacobiPreconditioner(); + break; + case LU_SGS: + /*--- Nothing to build. ---*/ + break; + case PASTIX_ILU: + case PASTIX_LU_P: + case PASTIX_LDLT_P: + /*--- It was already built. ---*/ + break; + default: + SU2_MPI::Error("The specified preconditioner is not yet implemented for the discrete adjoint method.", + CURRENT_FUNCTION); + break; + } + } + }; /*--- Finish declaration of the external function ---*/ - AD::FuncHelper->addToTape(CSysSolve_b::Solve_b); +#ifdef CODI_REVERSE_TYPE + /*--- Call the external function with appropriate AD handling ---*/ + AD::FuncHelper.callPrimalFuncWithADType(externalFunction); - SU2_OMP_SAFE_GLOBAL_ACCESS(AD::EndExtFunc();) + AD::FuncHelper.addToTape(CSysSolve_b::Solve_b); +#else + /*--- Without reverse AD, call the external function directly ---*/ + externalFunction(); #endif - } return IterLinSol; } -template -unsigned long CSysSolve::Solve_b(CSysMatrix & Jacobian, const CSysVector & LinSysRes, - CSysVector & LinSysSol, CGeometry *geometry, const CConfig *config, - const bool directCall) { - +template +unsigned long CSysSolve::Solve_b(CSysMatrix& Jacobian, const CSysVector& LinSysRes, + CSysVector& LinSysSol, CGeometry* geometry, + const CConfig* config, const bool directCall) { unsigned short KindSolver, KindPrecond; unsigned long MaxIter, IterLinSol = 0; ScalarType SolverTol; @@ -1002,31 +1067,32 @@ unsigned long CSysSolve::Solve_b(CSysMatrix & Jacobian, switch (lin_sol_mode) { /*--- Mesh Deformation mode ---*/ case LINEAR_SOLVER_MODE::MESH_DEFORM: { - KindSolver = config->GetKind_Deform_Linear_Solver(); - KindPrecond = config->GetKind_Deform_Linear_Solver_Prec(); - MaxIter = config->GetDeform_Linear_Solver_Iter(); - SolverTol = SU2_TYPE::GetValue(config->GetDeform_Linear_Solver_Error()); + KindSolver = config->GetKind_Deform_Linear_Solver(); + KindPrecond = config->GetKind_Deform_Linear_Solver_Prec(); + MaxIter = config->GetDeform_Linear_Solver_Iter(); + SolverTol = SU2_TYPE::GetValue(config->GetDeform_Linear_Solver_Error()); ScreenOutput = config->GetDeform_Output(); break; } /*--- Gradient Smoothing mode ---*/ case LINEAR_SOLVER_MODE::GRADIENT_MODE: { - KindSolver = config->GetKind_Grad_Linear_Solver(); - KindPrecond = config->GetKind_Grad_Linear_Solver_Prec(); - MaxIter = config->GetGrad_Linear_Solver_Iter(); - SolverTol = SU2_TYPE::GetValue(config->GetGrad_Linear_Solver_Error()); + KindSolver = config->GetKind_Grad_Linear_Solver(); + KindPrecond = config->GetKind_Grad_Linear_Solver_Prec(); + MaxIter = config->GetGrad_Linear_Solver_Iter(); + SolverTol = SU2_TYPE::GetValue(config->GetGrad_Linear_Solver_Error()); ScreenOutput = true; break; } /*--- Normal mode - * assumes that 'lin_sol_mode==LINEAR_SOLVER_MODE::STANDARD', but does not enforce it to avoid compiler warning. ---*/ + * assumes that 'lin_sol_mode==LINEAR_SOLVER_MODE::STANDARD', but does not enforce it to avoid compiler warning. + * ---*/ default: { - KindSolver = config->GetKind_Linear_Solver(); - KindPrecond = config->GetKind_Linear_Solver_Prec(); - MaxIter = config->GetLinear_Solver_Iter(); - SolverTol = SU2_TYPE::GetValue(config->GetLinear_Solver_Error()); + KindSolver = config->GetKind_Linear_Solver(); + KindPrecond = config->GetKind_Linear_Solver_Prec(); + MaxIter = config->GetLinear_Solver_Iter(); + SolverTol = SU2_TYPE::GetValue(config->GetLinear_Solver_Error()); ScreenOutput = false; break; } @@ -1053,30 +1119,36 @@ unsigned long CSysSolve::Solve_b(CSysMatrix & Jacobian, HandleTemporariesIn(LinSysRes, LinSysSol); - switch(KindSolver) { + switch (KindSolver) { case FGMRES: - IterLinSol = FGMRES_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol , MaxIter, residual, ScreenOutput, config); + IterLinSol = FGMRES_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol, MaxIter, residual, + ScreenOutput, config); break; case RESTARTED_FGMRES: - IterLinSol = RFGMRES_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol , MaxIter, residual, ScreenOutput, config); + IterLinSol = RFGMRES_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol, MaxIter, residual, + ScreenOutput, config); break; case BCGSTAB: - IterLinSol = BCGSTAB_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol , MaxIter, residual, ScreenOutput, config); + IterLinSol = BCGSTAB_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol, MaxIter, residual, + ScreenOutput, config); break; case CONJUGATE_GRADIENT: - IterLinSol = CG_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol, MaxIter, residual, ScreenOutput, config); + IterLinSol = CG_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol, MaxIter, residual, + ScreenOutput, config); break; case SMOOTHER: - IterLinSol = Smoother_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol, MaxIter, residual, ScreenOutput, config); + IterLinSol = Smoother_LinSolver(*LinSysRes_ptr, *LinSysSol_ptr, mat_vec, *precond, SolverTol, MaxIter, residual, + ScreenOutput, config); break; - case PASTIX_LDLT : case PASTIX_LU: + case PASTIX_LDLT: + case PASTIX_LU: if (directCall) Jacobian.BuildPastixPreconditioner(geometry, config, KindSolver); Jacobian.ComputePastixPreconditioner(*LinSysRes_ptr, *LinSysSol_ptr, geometry, config); IterLinSol = 1; residual = 1e-20; break; default: - SU2_MPI::Error("Unknown type of linear solver.",CURRENT_FUNCTION); + SU2_MPI::Error("Unknown type of linear solver.", CURRENT_FUNCTION); break; } @@ -1084,14 +1156,13 @@ unsigned long CSysSolve::Solve_b(CSysMatrix & Jacobian, delete precond; - SU2_OMP_MASTER - { + SU2_OMP_MASTER { Residual = residual; Iterations = IterLinSol; - } END_SU2_OMP_MASTER + } + END_SU2_OMP_MASTER return IterLinSol; - } /*--- Explicit instantiations ---*/ diff --git a/Common/src/linear_algebra/CSysSolve_b.cpp b/Common/src/linear_algebra/CSysSolve_b.cpp index 8717434b0fc..d02c294e31e 100644 --- a/Common/src/linear_algebra/CSysSolve_b.cpp +++ b/Common/src/linear_algebra/CSysSolve_b.cpp @@ -2,7 +2,7 @@ * \file CSysSolve_b.cpp * \brief Routines for the linear solver used in the reverse sweep of AD. * \author T. Albring, J. Blühdorn - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -31,11 +31,10 @@ #include "../../include/linear_algebra/CSysVector.hpp" #ifdef CODI_REVERSE_TYPE -template +template void CSysSolve_b::Solve_b(const su2double::Real* x, su2double::Real* x_b, size_t m, const su2double::Real* y, const su2double::Real* y_b, size_t n, - codi::DataStore* d) { - + codi::ExternalFunctionUserData* d) { CSysVector* LinSysRes_b = nullptr; d->getDataByIndex(LinSysRes_b, 0); @@ -57,7 +56,7 @@ void CSysSolve_b::Solve_b(const su2double::Real* x, su2double::Real* /*--- Initialize the right-hand side with the gradient of the solution of the primal linear system ---*/ SU2_OMP_BARRIER - SU2_OMP_FOR_STAT(roundUpDiv(n,omp_get_num_threads())) + SU2_OMP_FOR_STAT(roundUpDiv(n, omp_get_num_threads())) for (unsigned long i = 0; i < n; i++) { (*LinSysRes_b)[i] = y_b[i]; (*LinSysSol_b)[i] = 0.0; @@ -66,8 +65,8 @@ void CSysSolve_b::Solve_b(const su2double::Real* x, su2double::Real* solver->Solve_b(*Jacobian, *LinSysRes_b, *LinSysSol_b, geometry, config, false); - SU2_OMP_FOR_STAT(roundUpDiv(n,omp_get_num_threads())) - for (unsigned long i = 0; i < n; i ++) { + SU2_OMP_FOR_STAT(roundUpDiv(n, omp_get_num_threads())) + for (unsigned long i = 0; i < n; i++) { x_b[i] = SU2_TYPE::GetValue((*LinSysSol_b)[i]); } END_SU2_OMP_FOR diff --git a/Common/src/linear_algebra/CSysVector.cpp b/Common/src/linear_algebra/CSysVector.cpp index af335ac99f5..353b28ceb34 100644 --- a/Common/src/linear_algebra/CSysVector.cpp +++ b/Common/src/linear_algebra/CSysVector.cpp @@ -2,7 +2,7 @@ * \file CSysVector.cpp * \brief Implementation and explicit instantiations of CSysVector. * \author P. Gomes, F. Palacios, J. Hicken, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -50,7 +50,7 @@ void CSysVector::Initialize(unsigned long numBlk, unsigned long numB omp_chunk_size = computeStaticChunkSize(nElm, omp_get_max_threads(), OMP_MAX_SIZE); - if (vec_val == nullptr) vec_val = MemoryAllocation::aligned_alloc(64, nElm*sizeof(ScalarType)); + if (vec_val == nullptr) vec_val = MemoryAllocation::aligned_alloc(64, nElm * sizeof(ScalarType)); if (val != nullptr) { if (!valIsArray) { diff --git a/Common/src/linear_algebra/blas_structure.cpp b/Common/src/linear_algebra/blas_structure.cpp index c23a77ecec7..364d027b806 100644 --- a/Common/src/linear_algebra/blas_structure.cpp +++ b/Common/src/linear_algebra/blas_structure.cpp @@ -3,7 +3,7 @@ * \brief Implementation of the functions that either simulate BLAS functionality or interface to an actual BLAS implementation. * \author E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -31,38 +31,38 @@ #include /* MKL or BLAS, if supported. */ -#if (defined (HAVE_MKL) || defined(HAVE_BLAS)) && !(defined(CODI_REVERSE_TYPE) || defined(CODI_FORWARD_TYPE)) +#if (defined(HAVE_MKL) || defined(HAVE_BLAS)) && !(defined(CODI_REVERSE_TYPE) || defined(CODI_FORWARD_TYPE)) /* Function prototypes for the BLAS routines used. */ -extern "C" void dgemm_(char*, char*, const int*, const int*, const int*, - const passivedouble*, const passivedouble*, const int*, - const passivedouble*, const int*, - const passivedouble*, passivedouble*, const int*); - -extern "C" void dgemv_(char*, const int*, const int*, const passivedouble*, - const passivedouble*, const int*, const passivedouble*, - const int*, const passivedouble*, passivedouble*, const int*); +extern "C" void dgemm_(char*, char*, const int*, const int*, const int*, const passivedouble*, const passivedouble*, + const int*, const passivedouble*, const int*, const passivedouble*, passivedouble*, const int*); + +extern "C" void dgemv_(char*, const int*, const int*, const passivedouble*, const passivedouble*, const int*, + const passivedouble*, const int*, const passivedouble*, passivedouble*, const int*); #endif /* Constructor. Initialize the const member variables, if needed. */ -CBlasStructure::CBlasStructure(void) -#if !(defined(HAVE_LIBXSMM) || defined(HAVE_BLAS) || defined(HAVE_MKL)) || (defined(CODI_REVERSE_TYPE) || defined(CODI_FORWARD_TYPE)) - : mc (256), kc (128), nc (128) +CBlasStructure::CBlasStructure() +#if !(defined(HAVE_LIBXSMM) || defined(HAVE_BLAS) || defined(HAVE_MKL)) || \ + (defined(CODI_REVERSE_TYPE) || defined(CODI_FORWARD_TYPE)) + : mc(256), + kc(128), + nc(128) #endif -{} +{ +} /* Dense matrix multiplication, gemm functionality. */ -void CBlasStructure::gemm(const int M, const int N, const int K, - const su2double *A, const su2double *B, su2double *C, - const CConfig *config) { - +void CBlasStructure::gemm(const int M, const int N, const int K, const su2double* A, const su2double* B, su2double* C, + const CConfig* config) { /* Initialize the variable for the timing, if profiling is active. */ #ifdef PROFILE double timeGemm; - if( config ) config->GEMM_Tick(&timeGemm); + if (config) config->GEMM_Tick(&timeGemm); #endif -#if (defined(CODI_REVERSE_TYPE) || defined(CODI_FORWARD_TYPE)) || !(defined(HAVE_LIBXSMM) || defined(HAVE_MKL) || defined(HAVE_BLAS)) +#if (defined(CODI_REVERSE_TYPE) || defined(CODI_FORWARD_TYPE)) || \ + !(defined(HAVE_LIBXSMM) || defined(HAVE_MKL) || defined(HAVE_BLAS)) /* Native implementation of the matrix product. This optimized implementation assumes that the matrices are in column major order. This can be accomplished by swapping N and M and A and B. This implementation is based @@ -76,18 +76,18 @@ void CBlasStructure::gemm(const int M, const int N, const int K, Note that libxsmm_gemm expects the matrices in column major order. That's why the in the calling sequence A and B and M and N are reversed. */ su2double alpha = 1.0; - su2double beta = 0.0; + su2double beta = 0.0; char trans = 'N'; libxsmm_dgemm(&trans, &trans, &N, &M, &K, &alpha, B, &N, A, &K, &beta, C, &N); -#else // MKL and BLAS +#else // MKL and BLAS /* The standard blas routine dgemm is used for the multiplication. Call dgemm without transposing the matrices. In that case dgemm expects the matrices in column major order, see the comments for libxsmm. */ su2double alpha = 1.0; - su2double beta = 0.0; + su2double beta = 0.0; char trans = 'N'; dgemm_(&trans, &trans, &N, &M, &K, &alpha, B, &N, A, &K, &beta, C, &N); @@ -97,44 +97,42 @@ void CBlasStructure::gemm(const int M, const int N, const int K, /* Store the profiling information, if needed. */ #ifdef PROFILE - if( config ) config->GEMM_Tock(timeGemm, M, N, K); + if (config) config->GEMM_Tock(timeGemm, M, N, K); #endif } /* Dense matrix vector multiplication, gemv functionality. */ -void CBlasStructure::gemv(const int M, const int N, const su2double *A, - const su2double *x, su2double *y) { - -#if (defined (HAVE_BLAS) || defined(HAVE_MKL)) && !(defined(CODI_REVERSE_TYPE) || defined(CODI_FORWARD_TYPE)) +void CBlasStructure::gemv(const int M, const int N, const su2double* A, const su2double* x, su2double* y) { +#if (defined(HAVE_BLAS) || defined(HAVE_MKL)) && !(defined(CODI_REVERSE_TYPE) || defined(CODI_FORWARD_TYPE)) /* The standard blas routine dgemv is used for the multiplication. Note that dgemv expects the matrices in column major order, while A is in row major order. This can be solved by using the transpose and switching M and N. */ - su2double alpha = 1.0; - su2double beta = 0.0; - int inc = 1; - char trans = 'T'; + su2double alpha = 1.0; + su2double beta = 0.0; + int inc = 1; + char trans = 'T'; - dgemv_(&trans, &N, &M, &alpha, A, &N, x, &inc, &beta, y, &inc); + dgemv_(&trans, &N, &M, &alpha, A, &N, x, &inc, &beta, y, &inc); #else /* Native implementation of the matix vector product. Initialize the elements of y to zero. */ - for(int i=0; i= x.size()-1) return (Point_Interp <= x[0])? y.front() : y.back(); + if (i >= x.size() - 1) return (Point_Interp <= x[0]) ? y.front() : y.back(); - const su2double h = Point_Interp-x[i]; + const su2double h = Point_Interp - x[i]; - return y[i]+h*(b[i]+h*(c[i]+h*d[i])); + return y[i] + h * (b[i] + h * (c[i] + h * d[i])); } su2double CLinearInterpolation::EvaluateSpline(su2double Point_Interp) const { - const auto i = lower_bound(Point_Interp); - if (i >= x.size()-1) return (Point_Interp <= x[0])? y.front() : y.back(); + if (i >= x.size() - 1) return (Point_Interp <= x[0]) ? y.front() : y.back(); - return y[i] + (Point_Interp-x[i]) * (y[i+1]-y[i]) / (x[i+1]-x[i]); + return y[i] + (Point_Interp - x[i]) * (y[i + 1] - y[i]) / (x[i + 1] - x[i]); } -void CCubicSpline::SetSpline(const vector &X, const vector &Data) { - - C1DInterpolation::SetSpline(X,Data); +void CCubicSpline::SetSpline(const vector& X, const vector& Data) { + C1DInterpolation::SetSpline(X, Data); const int N = x.size(); /*--- Alias the vectors of coefficients to build the tridiagonal system. ---*/ - auto& lower = b; b.resize(N); - auto& main = c; c.resize(N); - auto& upper = d; d.resize(N); + auto& lower = b; + b.resize(N); + auto& main = c; + c.resize(N); + auto& upper = d; + d.resize(N); vector rhs(N); /*--- Main part of the tridiagonal system. ---*/ - for (int i=1; i &X, const vector main[0] = 1.0; upper[0] = 0; rhs[0] = startVal; - } - else { // FIRST - main[0] = 2*lower[1]; + } else { // FIRST + main[0] = 2 * lower[1]; upper[0] = lower[1]; - rhs[0] = 6*((y[1]-y[0])/lower[1] - startVal); + rhs[0] = 6 * ((y[1] - y[0]) / lower[1] - startVal); } /*--- End condition. ---*/ if (endDer == SECOND) { - main[N-1] = 1.0; - lower[N-1] = 0; - rhs[N-1] = endVal; - } - else { // FIRST - main[N-1] = 2*upper[N-2]; - lower[N-1] = upper[N-2]; - rhs[N-1] = 6*(endVal - (y[N-1]-y[N-2])/upper[N-2]); + main[N - 1] = 1.0; + lower[N - 1] = 0; + rhs[N - 1] = endVal; + } else { // FIRST + main[N - 1] = 2 * upper[N - 2]; + lower[N - 1] = upper[N - 2]; + rhs[N - 1] = 6 * (endVal - (y[N - 1] - y[N - 2]) / upper[N - 2]); } /*--- Solve system for 2nd derivative at the knots. ---*/ @@ -109,26 +107,25 @@ void CCubicSpline::SetSpline(const vector &X, const vector /*--- Compute the polynomial coefficients. ---*/ - for (int i=0; i &X, const vector &Data){ - - C1DInterpolation::SetSpline(X,Data); +void CAkimaInterpolation::SetSpline(const vector& X, const vector& Data) { + C1DInterpolation::SetSpline(X, Data); const int n = X.size(); - vector h (n-1); - vector p (n-1); + vector h(n - 1); + vector p(n - 1); /*---calculating finite differences (h) and gradients (p) ---*/ - for (int i=0; i &X, const vector CorrectedInletValues(const vector &Inlet_Interpolated , - su2double Theta , - unsigned short nDim, - const su2double *Coord, - unsigned short nVar_Turb, - INLET_INTERP_TYPE Interpolation_Type){ - - unsigned short size_columns=Inlet_Interpolated.size()+nDim; +vector CorrectedInletValues(const vector& Inlet_Interpolated, su2double Theta, + unsigned short nDim, const su2double* Coord, unsigned short nVar_Turb, + INLET_INTERP_TYPE Interpolation_Type) { + unsigned short size_columns = Inlet_Interpolated.size() + nDim; vector Inlet_Values(size_columns); su2double unit_r, unit_Theta, unit_m, Alpha, Phi; /*---For x,y,z,T,P columns---*/ - for (int i=0;i CorrectedInletValues(const vector &Inlet_Interpolat } /*--- Converting from cylindrical to cartesian unit vectors ---*/ - Inlet_Values[nDim+2] = unit_r*cos(Theta) - unit_Theta*sin(Theta); - Inlet_Values[nDim+3] = unit_r*sin(Theta) + unit_Theta*cos(Theta); - Inlet_Values[nDim+4] = sqrt(1-pow(unit_r,2)- pow(unit_Theta,2)); + Inlet_Values[nDim + 2] = unit_r * cos(Theta) - unit_Theta * sin(Theta); + Inlet_Values[nDim + 3] = unit_r * sin(Theta) + unit_Theta * cos(Theta); + Inlet_Values[nDim + 4] = sqrt(1 - pow(unit_r, 2) - pow(unit_Theta, 2)); return Inlet_Values; } -void PrintInletInterpolatedData(const vector& Inlet_Data_Interpolated, string Marker, - unsigned long nVertex, unsigned short nDim, unsigned short nColumns){ - +void PrintInletInterpolatedData(const vector& Inlet_Data_Interpolated, const string& Marker, + unsigned long nVertex, unsigned short nDim, unsigned short nColumns) { ofstream myfile; myfile.precision(16); - myfile.open("Interpolated_Data_"+Marker+".dat",ios_base::out); + myfile.open("Interpolated_Data_" + Marker + ".dat", ios_base::out); - if (myfile.is_open()){ + if (myfile.is_open()) { for (unsigned long iVertex = 0; iVertex < nVertex; iVertex++) { - for (unsigned short iVar=0; iVar < nColumns; iVar++){ - myfile<= (unsigned long)size) - quotient = global_count/size; + if (global_count >= (unsigned long)size) quotient = global_count / size; - int remainder = int(global_count%size); + int remainder = int(global_count % size); for (int ii = 0; ii < size; ii++) { sizeOnRank[ii] = quotient + int(ii < remainder); } @@ -64,32 +60,27 @@ void CLinearPartitioner::Initialize(unsigned long global_count, if (isDisjoint) adjust = 1; firstIndex[0] = offset; - lastIndex[0] = firstIndex[0] + sizeOnRank[0] - adjust; + lastIndex[0] = firstIndex[0] + sizeOnRank[0] - adjust; cumulativeSizeBeforeRank[0] = 0; for (int iProc = 1; iProc < size; iProc++) { - firstIndex[iProc] = lastIndex[iProc-1] + adjust; - lastIndex[iProc] = firstIndex[iProc] + sizeOnRank[iProc] - adjust; - cumulativeSizeBeforeRank[iProc] = (cumulativeSizeBeforeRank[iProc-1] + - sizeOnRank[iProc-1]); + firstIndex[iProc] = lastIndex[iProc - 1] + adjust; + lastIndex[iProc] = firstIndex[iProc] + sizeOnRank[iProc] - adjust; + cumulativeSizeBeforeRank[iProc] = (cumulativeSizeBeforeRank[iProc - 1] + sizeOnRank[iProc - 1]); } cumulativeSizeBeforeRank[size] = global_count; - } unsigned long CLinearPartitioner::GetRankContainingIndex(unsigned long index) const { - /*--- Initial guess ---*/ - unsigned long iProcessor = min(index/sizeOnRank[0], size-1); + unsigned long iProcessor = min(index / sizeOnRank[0], size - 1); /*--- Move up or down until we find the processor. ---*/ if (index >= cumulativeSizeBeforeRank[iProcessor]) - while(index >= cumulativeSizeBeforeRank[iProcessor+1]) - iProcessor++; + while (index >= cumulativeSizeBeforeRank[iProcessor + 1]) iProcessor++; else - while(index < cumulativeSizeBeforeRank[iProcessor]) - iProcessor--; + while (index < cumulativeSizeBeforeRank[iProcessor]) iProcessor--; return iProcessor; } diff --git a/Common/src/toolboxes/CSquareMatrixCM.cpp b/Common/src/toolboxes/CSquareMatrixCM.cpp index 09b990dc448..68c5088a8d4 100644 --- a/Common/src/toolboxes/CSquareMatrixCM.cpp +++ b/Common/src/toolboxes/CSquareMatrixCM.cpp @@ -2,7 +2,7 @@ * \file CSquareMatrixCM.cpp * \brief Implementation of dense matrix helper class in Column Major order (see hpp). * \author Edwin van der Weide, Pedro Gomes. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -38,26 +38,19 @@ using namespace std; #endif #elif defined(HAVE_LAPACK) /*--- Lapack / Blas routines used in CSquareMatrixCM. ---*/ -extern "C" void dgetrf_(const int*, const int*, passivedouble*, const int*, - int*, int*); -extern "C" void dgetri_(const int*, passivedouble*, const int*, int*, - passivedouble*, const int*, int*); -extern "C" void dgemm_(char*, char*, const int*, const int*, const int*, - const passivedouble*, const passivedouble*, - const int *, const passivedouble*, const int*, - const passivedouble*, passivedouble*, const int*); +extern "C" void dgetrf_(const int*, const int*, passivedouble*, const int*, int*, int*); +extern "C" void dgetri_(const int*, passivedouble*, const int*, int*, passivedouble*, const int*, int*); +extern "C" void dgemm_(char*, char*, const int*, const int*, const int*, const passivedouble*, const passivedouble*, + const int*, const passivedouble*, const int*, const passivedouble*, passivedouble*, const int*); #define DGEMM dgemm_ #endif void CSquareMatrixCM::Transpose() { - - for(int j=1; j work(sz); dgetrf_(&sz, &sz, mat.data(), &sz, ipiv.data(), &info); - if(info != 0) SU2_MPI::Error(string("Matrix is singular"), CURRENT_FUNCTION); + if (info != 0) SU2_MPI::Error(string("Matrix is singular"), CURRENT_FUNCTION); dgetri_(&sz, mat.data(), &sz, ipiv.data(), work.data(), &sz, &info); - if(info != 0) SU2_MPI::Error(string("Matrix inversion failed"), CURRENT_FUNCTION); + if (info != 0) SU2_MPI::Error(string("Matrix inversion failed"), CURRENT_FUNCTION); #else CBlasStructure::inverse(Size(), mat); #endif } -void CSquareMatrixCM::MatMatMult(const char side, - const ColMajorMatrix &mat_in, - ColMajorMatrix &mat_out) const { - +void CSquareMatrixCM::MatMatMult(const char side, const ColMajorMatrix& mat_in, + ColMajorMatrix& mat_out) const { /*--- Check the type of multiplication to be carried out. ---*/ if (side == 'L' || side == 'l') { - /*--- Left side: mat_out = this * mat_in. Set some sizes and allocate the memory for mat_out. ---*/ const int M = Size(), N = mat_in.cols(); assert(M == static_cast(mat_in.rows())); - mat_out.resize(M,N); + mat_out.resize(M, N); #ifdef HAVE_LAPACK @@ -98,28 +88,24 @@ void CSquareMatrixCM::MatMatMult(const char side, passivedouble alpha = 1.0, beta = 0.0; char trans = 'N'; - DGEMM(&trans, &trans, &M, &N, &M, &alpha, mat.data(), &M, - mat_in.data(), &M, &beta, mat_out.data(), &M); + DGEMM(&trans, &trans, &M, &N, &M, &alpha, mat.data(), &M, mat_in.data(), &M, &beta, mat_out.data(), &M); #else /*--- Naive product. ---*/ for (int i = 0; i < M; ++i) { for (int j = 0; j < N; ++j) { - mat_out(i,j) = 0.0; - for (int k = 0; k < M; ++k) - mat_out(i,j) += mat(i,k) * mat_in(k,j); + mat_out(i, j) = 0.0; + for (int k = 0; k < M; ++k) mat_out(i, j) += mat(i, k) * mat_in(k, j); } } #endif - } - else { - + } else { /*--- Right_side: mat_out = mat_in * this. Set some sizes and allocate the memory for mat_out. ---*/ const int M = mat_in.rows(), N = Size(); assert(N == static_cast(mat_in.cols())); - mat_out.resize(M,N); + mat_out.resize(M, N); #ifdef HAVE_LAPACK @@ -128,15 +114,13 @@ void CSquareMatrixCM::MatMatMult(const char side, passivedouble alpha = 1.0, beta = 0.0; char trans = 'N'; - DGEMM(&trans, &trans, &M, &N, &N, &alpha, mat_in.data(), &M, - mat.data(), &N, &beta, mat_out.data(), &M); + DGEMM(&trans, &trans, &M, &N, &N, &alpha, mat_in.data(), &M, mat.data(), &N, &beta, mat_out.data(), &M); #else /*--- Naive product. ---*/ for (int i = 0; i < M; ++i) { for (int j = 0; j < N; ++j) { - mat_out(i,j) = 0.0; - for (int k = 0; k < N; ++k) - mat_out(i,j) += mat_in(i,k) * mat(k,j); + mat_out(i, j) = 0.0; + for (int k = 0; k < N; ++k) mat_out(i, j) += mat_in(i, k) * mat(k, j); } } #endif diff --git a/Common/src/toolboxes/CSymmetricMatrix.cpp b/Common/src/toolboxes/CSymmetricMatrix.cpp index a2adb505562..ccb58c03203 100644 --- a/Common/src/toolboxes/CSymmetricMatrix.cpp +++ b/Common/src/toolboxes/CSymmetricMatrix.cpp @@ -2,7 +2,7 @@ * \file CSymmetricMatrix.cpp * \brief Implementation of dense symmetric matrix helper class (see hpp). * \author Joel Ho, P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -47,38 +47,35 @@ extern "C" void dsymm_(const char*, const char*, const int*, const int*, const p #define DSYMM dsymm_ #endif -void CSymmetricMatrix::Initialize(int N) { mat.resize(N,N); } +void CSymmetricMatrix::Initialize(int N) { mat.resize(N, N); } -void CSymmetricMatrix::CholeskyDecompose() -{ +void CSymmetricMatrix::CholeskyDecompose() { #ifndef HAVE_LAPACK int j; for (j = 0; j < Size(); ++j) { passivedouble sum = 0.0; - for (int k = 0; k < j; ++k) sum -= pow(Get(j,k), 2); - sum += Get(j,j); - if (sum < 0.0) break; // not SPD + for (int k = 0; k < j; ++k) sum -= pow(Get(j, k), 2); + sum += Get(j, j); + if (sum < 0.0) break; // not SPD Set(j, j, sqrt(sum)); - for (int i = j+1; i < Size(); ++i) { + for (int i = j + 1; i < Size(); ++i) { passivedouble sum = 0.0; - for (int k = 0; k < j; ++k) sum -= Get(i,k) * Get(j,k); - sum += Get(i,j); - Set(i, j, sum / Get(j,j)); + for (int k = 0; k < j; ++k) sum -= Get(i, k) * Get(j, k); + sum += Get(i, j); + Set(i, j, sum / Get(j, j)); } } - if (j!=Size()) SU2_MPI::Error("LLT factorization failed.", CURRENT_FUNCTION); + if (j != Size()) SU2_MPI::Error("LLT factorization failed.", CURRENT_FUNCTION); #endif } -void CSymmetricMatrix::CalcInv(bool is_spd) -{ +void CSymmetricMatrix::CalcInv(bool is_spd) { #ifndef HAVE_LAPACK const int sz = Size(); /*--- Compute inverse from decomposed matrices. ---*/ - if (is_spd) - { + if (is_spd) { CholeskyDecompose(); /*--- Initialize inverse matrix. ---*/ @@ -88,24 +85,23 @@ void CSymmetricMatrix::CalcInv(bool is_spd) /*--- Solve smaller and smaller systems. ---*/ for (int j = 0; j < sz; ++j) { /*--- Forward substitution. ---*/ - inv(j,j) = 1.0 / Get(j,j); + inv(j, j) = 1.0 / Get(j, j); - for (int i = j+1; i < sz; ++i) { + for (int i = j + 1; i < sz; ++i) { passivedouble sum = 0.0; - for (int k = j; k < i; ++k) sum -= Get(i,k) * inv(k,j); - inv(i,j) = sum / Get(i,i); + for (int k = j; k < i; ++k) sum -= Get(i, k) * inv(k, j); + inv(i, j) = sum / Get(i, i); } - } // L inverse in inv + } // L inverse in inv /*--- Multiply inversed matrices overwrite mat. ---*/ for (int j = 0; j < sz; ++j) for (int i = j; i < sz; ++i) { passivedouble sum = 0.0; - for (int k = i; k < sz; ++k) sum += inv(k,i) * inv(k,j); + for (int k = i; k < sz; ++k) sum += inv(k, i) * inv(k, j); Set(i, j, sum); } - } - else { + } else { auto inv = StealData(); CBlasStructure::inverse(sz, inv); mat = move(inv); @@ -113,8 +109,7 @@ void CSymmetricMatrix::CalcInv(bool is_spd) #endif } -void CSymmetricMatrix::CalcInv_sytri() -{ +void CSymmetricMatrix::CalcInv_sytri() { #ifdef HAVE_LAPACK const char uplo = 'L'; const int sz = Size(); @@ -122,66 +117,62 @@ void CSymmetricMatrix::CalcInv_sytri() vector ipiv(sz); /*--- Query the optimum work size. ---*/ - int query = -1; passivedouble tmp; + int query = -1; + passivedouble tmp; dsytrf_(&uplo, &sz, mat.data(), &sz, ipiv.data(), &tmp, &query, &info); query = static_cast(tmp); vector work(query); /*--- Factorize and invert. ---*/ dsytrf_(&uplo, &sz, mat.data(), &sz, ipiv.data(), work.data(), &query, &info); - if (info!=0) SU2_MPI::Error("LDLT factorization failed.", CURRENT_FUNCTION); + if (info != 0) SU2_MPI::Error("LDLT factorization failed.", CURRENT_FUNCTION); dsytri_(&uplo, &sz, mat.data(), &sz, ipiv.data(), work.data(), &info); - if (info!=0) SU2_MPI::Error("Inversion with LDLT factorization failed.", CURRENT_FUNCTION); + if (info != 0) SU2_MPI::Error("Inversion with LDLT factorization failed.", CURRENT_FUNCTION); #endif } -void CSymmetricMatrix::CalcInv_potri() -{ +void CSymmetricMatrix::CalcInv_potri() { #ifdef HAVE_LAPACK const char uplo = 'L'; const int sz = Size(); int info; dpotrf_(&uplo, &sz, mat.data(), &sz, &info); - if (info!=0) SU2_MPI::Error("LLT factorization failed.", CURRENT_FUNCTION); + if (info != 0) SU2_MPI::Error("LLT factorization failed.", CURRENT_FUNCTION); dpotri_(&uplo, &sz, mat.data(), &sz, &info); - if (info!=0) SU2_MPI::Error("Inversion with LLT factorization failed.", CURRENT_FUNCTION); + if (info != 0) SU2_MPI::Error("Inversion with LLT factorization failed.", CURRENT_FUNCTION); #endif } -void CSymmetricMatrix::Invert(const bool is_spd) -{ +void CSymmetricMatrix::Invert(const bool is_spd) { #ifdef HAVE_LAPACK - if(is_spd) CalcInv_potri(); - else CalcInv_sytri(); + if (is_spd) + CalcInv_potri(); + else + CalcInv_sytri(); #else CalcInv(is_spd); #endif } -void CSymmetricMatrix::MatMatMult(const char side, - const su2passivematrix& mat_in, - su2passivematrix& mat_out) const -{ +void CSymmetricMatrix::MatMatMult(const char side, const su2passivematrix& mat_in, su2passivematrix& mat_out) const { /*--- Left side: mat_out = this * mat_in. ---*/ if (side == 'L' || side == 'l') { const int M = Size(), N = mat_in.cols(); assert(M == static_cast(mat_in.rows())); - mat_out.resize(M,N); + mat_out.resize(M, N); #ifdef HAVE_LAPACK /*--- Right and lower because matrices are in row major order. ---*/ const char side = 'R', uplo = 'L'; const passivedouble alpha = 1.0, beta = 0.0; - DSYMM(&side, &uplo, &N, &M, &alpha, mat.data(), &M, - mat_in.data(), &N, &beta, mat_out.data(), &N); -#else // Naive product + DSYMM(&side, &uplo, &N, &M, &alpha, mat.data(), &M, mat_in.data(), &N, &beta, mat_out.data(), &N); +#else // Naive product for (int i = 0; i < M; ++i) for (int j = 0; j < N; ++j) { - mat_out(i,j) = 0.0; - for (int k = 0; k < M; ++k) - mat_out(i,j) += Get(i,k) * mat_in(k,j); + mat_out(i, j) = 0.0; + for (int k = 0; k < M; ++k) mat_out(i, j) += Get(i, k) * mat_in(k, j); } #endif } @@ -190,31 +181,27 @@ void CSymmetricMatrix::MatMatMult(const char side, const int M = mat_in.rows(), N = Size(); assert(N == static_cast(mat_in.cols())); - mat_out.resize(M,N); + mat_out.resize(M, N); #ifdef HAVE_LAPACK /*--- Left and lower because matrices are in row major order. ---*/ const char side = 'L', uplo = 'L'; const passivedouble alpha = 1.0, beta = 0.0; - DSYMM(&side, &uplo, &N, &M, &alpha, mat.data(), &N, - mat_in.data(), &N, &beta, mat_out.data(), &N); -#else // Naive product + DSYMM(&side, &uplo, &N, &M, &alpha, mat.data(), &N, mat_in.data(), &N, &beta, mat_out.data(), &N); +#else // Naive product for (int i = 0; i < M; ++i) for (int j = 0; j < N; ++j) { - mat_out(i,j) = 0.0; - for (int k = 0; k < N; ++k) - mat_out(i,j) += mat_in(i,k) * Get(k,j); + mat_out(i, j) = 0.0; + for (int k = 0; k < N; ++k) mat_out(i, j) += mat_in(i, k) * Get(k, j); } #endif } } -su2passivematrix CSymmetricMatrix::StealData() -{ +su2passivematrix CSymmetricMatrix::StealData() { /*--- Fill lower triangular part. ---*/ for (int i = 1; i < Size(); ++i) - for (int j = 0; j < i; ++j) - mat(i,j) = mat(j,i); + for (int j = 0; j < i; ++j) mat(i, j) = mat(j, i); return move(mat); } diff --git a/Common/src/toolboxes/MMS/CIncTGVSolution.cpp b/Common/src/toolboxes/MMS/CIncTGVSolution.cpp index 51b0499dae0..53072c921ff 100644 --- a/Common/src/toolboxes/MMS/CIncTGVSolution.cpp +++ b/Common/src/toolboxes/MMS/CIncTGVSolution.cpp @@ -2,7 +2,7 @@ * \file CIncTGVSolution.cpp * \brief Implementations of the member functions of CIncTGVSolution. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,18 +27,14 @@ #include "../../../include/toolboxes/MMS/CIncTGVSolution.hpp" -CIncTGVSolution::CIncTGVSolution(void) : CVerificationSolution() { } - -CIncTGVSolution::CIncTGVSolution(unsigned short val_nDim, - unsigned short val_nVar, - unsigned short val_iMesh, - CConfig* config) -: CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { +CIncTGVSolution::CIncTGVSolution() : CVerificationSolution() {} +CIncTGVSolution::CIncTGVSolution(unsigned short val_nDim, unsigned short val_nVar, unsigned short val_iMesh, + CConfig* config) + : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { /*--- Disable this solution for now, as it has not been tested. ---*/ - SU2_MPI::Error("CIncTGVSolution not yet fully implemented/tested.", - CURRENT_FUNCTION); + SU2_MPI::Error("CIncTGVSolution not yet fully implemented/tested.", CURRENT_FUNCTION); /*--- Write a message that the solution is initialized for the Taylor-Green vortex test case. ---*/ @@ -52,9 +48,9 @@ CIncTGVSolution::CIncTGVSolution(unsigned short val_nDim, /*--- Store TGV specific parameters here. ---*/ - tgvLength = 1.0; - tgvVelocity = 1.0; - tgvDensity = config->GetDensity_FreeStreamND(); + tgvLength = 1.0; + tgvVelocity = 1.0; + tgvDensity = config->GetDensity_FreeStreamND(); tgvViscosity = config->GetViscosity_FreeStreamND(); /*--- We keep a copy of the freestream temperature just to be safe @@ -64,73 +60,61 @@ CIncTGVSolution::CIncTGVSolution(unsigned short val_nDim, /*--- Perform some sanity and error checks for this solution here. ---*/ - if((config->GetTime_Marching() != TIME_MARCHING::TIME_STEPPING) && - (config->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_1ST) && - (config->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_2ND)) - SU2_MPI::Error("Unsteady mode must be selected for the incompressible Taylor Green Vortex", - CURRENT_FUNCTION); + if ((config->GetTime_Marching() != TIME_MARCHING::TIME_STEPPING) && + (config->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_1ST) && + (config->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_2ND)) + SU2_MPI::Error("Unsteady mode must be selected for the incompressible Taylor Green Vortex", CURRENT_FUNCTION); - if(Kind_Solver != MAIN_SOLVER::INC_EULER && Kind_Solver != MAIN_SOLVER::INC_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::INC_RANS ) + if (Kind_Solver != MAIN_SOLVER::INC_EULER && Kind_Solver != MAIN_SOLVER::INC_NAVIER_STOKES && + Kind_Solver != MAIN_SOLVER::INC_RANS) SU2_MPI::Error("Incompressible flow equations must be selected for the incompressible Taylor Green Vortex", CURRENT_FUNCTION); - if(Kind_Solver != MAIN_SOLVER::INC_NAVIER_STOKES) + if (Kind_Solver != MAIN_SOLVER::INC_NAVIER_STOKES) SU2_MPI::Error("Navier Stokes equations must be selected for the incompressible Taylor Green Vortex", CURRENT_FUNCTION); - if(config->GetKind_FluidModel() != CONSTANT_DENSITY) + if (config->GetKind_FluidModel() != CONSTANT_DENSITY) SU2_MPI::Error("Constant density fluid model must be selected for the incompressible Taylor Green Vortex", CURRENT_FUNCTION); - if(config->GetKind_ViscosityModel() != VISCOSITYMODEL::CONSTANT) - SU2_MPI::Error("Constant viscosity must be selected for the incompressible Taylor Green Vortex", - CURRENT_FUNCTION); + if (config->GetKind_ViscosityModel() != VISCOSITYMODEL::CONSTANT) + SU2_MPI::Error("Constant viscosity must be selected for the incompressible Taylor Green Vortex", CURRENT_FUNCTION); - if(config->GetEnergy_Equation()) + if (config->GetEnergy_Equation()) SU2_MPI::Error("Energy equation must be disabled (isothermal) for the incompressible Taylor Green Vortex", CURRENT_FUNCTION); - if(nDim != 2) - SU2_MPI::Error("2D calculation required for the incompressible Taylor Green Vortex", - CURRENT_FUNCTION); + if (nDim != 2) SU2_MPI::Error("2D calculation required for the incompressible Taylor Green Vortex", CURRENT_FUNCTION); } -CIncTGVSolution::~CIncTGVSolution(void) { } - -void CIncTGVSolution::GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { +CIncTGVSolution::~CIncTGVSolution() = default; +void CIncTGVSolution::GetBCState(const su2double* val_coords, const su2double val_t, su2double* val_solution) const { /*--- The exact solution is prescribed on the boundaries. ---*/ GetSolution(val_coords, val_t, val_solution); } -void CIncTGVSolution::GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { - +void CIncTGVSolution::GetSolution(const su2double* val_coords, const su2double val_t, su2double* val_solution) const { /* The exact solution is set for the incompressible Taylor-Green vortex case. This is the classic solution from the original work of Taylor and Green for the specific 2D situation where the exact solution can be derived for an incompressible flow. */ /* Store the termporal term more easily (Taylor expansion). */ - su2double F = 1.0 - 2.0*(tgvViscosity/tgvDensity)*val_t; + su2double F = 1.0 - 2.0 * (tgvViscosity / tgvDensity) * val_t; /* Compute the primitive variables. */ - su2double u = tgvVelocity * F * (sin(val_coords[0]/tgvLength)* - cos(val_coords[1]/tgvLength)); - su2double v = -tgvVelocity * F * (cos(val_coords[0]/tgvLength)* - sin(val_coords[1]/tgvLength)); + su2double u = tgvVelocity * F * (sin(val_coords[0] / tgvLength) * cos(val_coords[1] / tgvLength)); + su2double v = -tgvVelocity * F * (cos(val_coords[0] / tgvLength) * sin(val_coords[1] / tgvLength)); - su2double B = (cos(2.0*val_coords[0]/tgvLength) + - cos(2.0*val_coords[1]/tgvLength)); - su2double p = -(tgvDensity/4.0)*B*F*F; + su2double B = (cos(2.0 * val_coords[0] / tgvLength) + cos(2.0 * val_coords[1] / tgvLength)); + su2double p = -(tgvDensity / 4.0) * B * F * F; /* Compute the conservative variables. Note that both 2D and 3D cases are treated correctly. */ - val_solution[0] = p; - val_solution[1] = u; - val_solution[2] = v; - val_solution[nVar-1] = Temperature; + val_solution[0] = p; + val_solution[1] = u; + val_solution[2] = v; + val_solution[nVar - 1] = Temperature; } diff --git a/Common/src/toolboxes/MMS/CInviscidVortexSolution.cpp b/Common/src/toolboxes/MMS/CInviscidVortexSolution.cpp index f699d9f6ccb..23edb73aead 100644 --- a/Common/src/toolboxes/MMS/CInviscidVortexSolution.cpp +++ b/Common/src/toolboxes/MMS/CInviscidVortexSolution.cpp @@ -2,7 +2,7 @@ * \file CInviscidVortexSolution.cpp * \brief Implementations of the member functions of CInviscidVortexSolution. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,14 +27,11 @@ #include "../../../include/toolboxes/MMS/CInviscidVortexSolution.hpp" -CInviscidVortexSolution::CInviscidVortexSolution(void) : CVerificationSolution() { } - -CInviscidVortexSolution::CInviscidVortexSolution(unsigned short val_nDim, - unsigned short val_nVar, - unsigned short val_iMesh, - CConfig* config) - : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { +CInviscidVortexSolution::CInviscidVortexSolution() : CVerificationSolution() {} +CInviscidVortexSolution::CInviscidVortexSolution(unsigned short val_nDim, unsigned short val_nVar, + unsigned short val_iMesh, CConfig* config) + : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { /*--- Write a message that the solution is initialized for the inviscid vortex test case. ---*/ if ((rank == MASTER_NODE) && (val_iMesh == MESH_0)) { @@ -45,98 +42,86 @@ CInviscidVortexSolution::CInviscidVortexSolution(unsigned short val_nDim, } /*--- Store the inviscid vortex specific parameters here. ---*/ - x0Vortex = -0.5; // Initial x-coordinate of the vortex center. - y0Vortex = 0.0; // Initial y-coordinate of the vortex center. - RVortex = 0.1; // Radius of the vortex. - epsVortex = 1.0; // Strength of the vortex. + x0Vortex = -0.5; // Initial x-coordinate of the vortex center. + y0Vortex = 0.0; // Initial y-coordinate of the vortex center. + RVortex = 0.1; // Radius of the vortex. + epsVortex = 1.0; // Strength of the vortex. /* Get the Mach number and advection angle (in degrees). */ - MachVortex = config->GetMach(); + MachVortex = config->GetMach(); thetaVortex = config->GetAoA(); /*--- Useful coefficients in which Gamma is present. ---*/ - Gamma = config->GetGamma(); - Gm1 = Gamma - 1.0; - ovGm1 = 1.0/Gm1; - gamOvGm1 = ovGm1*Gamma; + Gamma = config->GetGamma(); + Gm1 = Gamma - 1.0; + ovGm1 = 1.0 / Gm1; + gamOvGm1 = ovGm1 * Gamma; /*--- Perform some sanity and error checks for this solution here. ---*/ - if((config->GetTime_Marching() != TIME_MARCHING::TIME_STEPPING) && - (config->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_1ST) && - (config->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_2ND)) - SU2_MPI::Error("Unsteady mode must be selected for the inviscid vortex", - CURRENT_FUNCTION); - - if(Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::RANS && - Kind_Solver != MAIN_SOLVER::FEM_EULER && Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::FEM_RANS && - Kind_Solver != MAIN_SOLVER::FEM_LES) - SU2_MPI::Error("Compressible flow equations must be selected for the inviscid vortex", - CURRENT_FUNCTION); - - if((Kind_Solver != MAIN_SOLVER::EULER) && - (Kind_Solver != MAIN_SOLVER::FEM_EULER)) - SU2_MPI::Error("Euler equations must be selected for the inviscid vortex", - CURRENT_FUNCTION); - - if((config->GetKind_FluidModel() != STANDARD_AIR) && - (config->GetKind_FluidModel() != IDEAL_GAS)) - SU2_MPI::Error("Standard air or ideal gas must be selected for the inviscid vortex", - CURRENT_FUNCTION); - - if(fabs(config->GetPressure_FreeStreamND() - 1.0) > 1.e-8) - SU2_MPI::Error("Free-stream pressure must be 1.0 for the inviscid vortex", - CURRENT_FUNCTION); - - if(fabs(config->GetDensity_FreeStreamND() - 1.0) > 1.e-8) - SU2_MPI::Error("Free-stream density must be 1.0 for the inviscid vortex", - CURRENT_FUNCTION); -} + if ((config->GetTime_Marching() != TIME_MARCHING::TIME_STEPPING) && + (config->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_1ST) && + (config->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_2ND)) + SU2_MPI::Error("Unsteady mode must be selected for the inviscid vortex", CURRENT_FUNCTION); + + if (Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && + Kind_Solver != MAIN_SOLVER::RANS && Kind_Solver != MAIN_SOLVER::FEM_EULER && + Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::FEM_RANS && + Kind_Solver != MAIN_SOLVER::FEM_LES) + SU2_MPI::Error("Compressible flow equations must be selected for the inviscid vortex", CURRENT_FUNCTION); + + if ((Kind_Solver != MAIN_SOLVER::EULER) && (Kind_Solver != MAIN_SOLVER::FEM_EULER)) + SU2_MPI::Error("Euler equations must be selected for the inviscid vortex", CURRENT_FUNCTION); -CInviscidVortexSolution::~CInviscidVortexSolution(void) { } + if ((config->GetKind_FluidModel() != STANDARD_AIR) && (config->GetKind_FluidModel() != IDEAL_GAS)) + SU2_MPI::Error("Standard air or ideal gas must be selected for the inviscid vortex", CURRENT_FUNCTION); -void CInviscidVortexSolution::GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { + if (fabs(config->GetPressure_FreeStreamND() - 1.0) > 1.e-8) + SU2_MPI::Error("Free-stream pressure must be 1.0 for the inviscid vortex", CURRENT_FUNCTION); + if (fabs(config->GetDensity_FreeStreamND() - 1.0) > 1.e-8) + SU2_MPI::Error("Free-stream density must be 1.0 for the inviscid vortex", CURRENT_FUNCTION); +} + +CInviscidVortexSolution::~CInviscidVortexSolution() = default; + +void CInviscidVortexSolution::GetBCState(const su2double* val_coords, const su2double val_t, + su2double* val_solution) const { /*--- For the case that the inviscid vortex is run with boundary conditions (other possibility is with periodic conditions), the exact solution is prescribed on the boundaries. ---*/ GetSolution(val_coords, val_t, val_solution); } -void CInviscidVortexSolution::GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { - +void CInviscidVortexSolution::GetSolution(const su2double* val_coords, const su2double val_t, + su2double* val_solution) const { /* Compute the free stream velocities in x- and y-direction. */ - const su2double VelInf = MachVortex*sqrt(Gamma); - const su2double uInf = VelInf*cos(thetaVortex*PI_NUMBER/180.0); - const su2double vInf = VelInf*sin(thetaVortex*PI_NUMBER/180.0); + const su2double VelInf = MachVortex * sqrt(Gamma); + const su2double uInf = VelInf * cos(thetaVortex * PI_NUMBER / 180.0); + const su2double vInf = VelInf * sin(thetaVortex * PI_NUMBER / 180.0); /* Compute the coordinates relative to the center of the vortex. */ - const su2double dx = val_coords[0] - (x0Vortex + val_t*uInf); - const su2double dy = val_coords[1] - (y0Vortex + val_t*vInf); + const su2double dx = val_coords[0] - (x0Vortex + val_t * uInf); + const su2double dy = val_coords[1] - (y0Vortex + val_t * vInf); /* Compute the components of the velocity. */ - su2double f = 1.0 - (dx*dx + dy*dy)/(RVortex*RVortex); - su2double t1 = epsVortex*dy*exp(0.5*f)/(2.0*PI_NUMBER*RVortex); - su2double u = uInf - VelInf*t1; + su2double f = 1.0 - (dx * dx + dy * dy) / (RVortex * RVortex); + su2double t1 = epsVortex * dy * exp(0.5 * f) / (2.0 * PI_NUMBER * RVortex); + su2double u = uInf - VelInf * t1; - t1 = epsVortex*dx*exp(0.5*f)/(2.0*PI_NUMBER*RVortex); - su2double v = vInf + VelInf*t1; + t1 = epsVortex * dx * exp(0.5 * f) / (2.0 * PI_NUMBER * RVortex); + su2double v = vInf + VelInf * t1; /* Compute the density and the pressure. */ - t1 = 1.0 - epsVortex*epsVortex*Gm1 - * MachVortex*MachVortex*exp(f)/(8.0*PI_NUMBER*PI_NUMBER); + t1 = 1.0 - epsVortex * epsVortex * Gm1 * MachVortex * MachVortex * exp(f) / (8.0 * PI_NUMBER * PI_NUMBER); - su2double rho = pow(t1,ovGm1); - su2double p = pow(t1,gamOvGm1); + su2double rho = pow(t1, ovGm1); + su2double p = pow(t1, gamOvGm1); /* Compute the conservative variables. Note that both 2D and 3D cases are treated correctly. */ - val_solution[0] = rho; - val_solution[1] = rho*u; - val_solution[2] = rho*v; - val_solution[3] = 0.0; - val_solution[nVar-1] = p*ovGm1 + 0.5*rho*(u*u + v*v); + val_solution[0] = rho; + val_solution[1] = rho * u; + val_solution[2] = rho * v; + val_solution[3] = 0.0; + val_solution[nVar - 1] = p * ovGm1 + 0.5 * rho * (u * u + v * v); } diff --git a/Common/src/toolboxes/MMS/CMMSIncEulerSolution.cpp b/Common/src/toolboxes/MMS/CMMSIncEulerSolution.cpp index 2352988dcdc..ad98ffe6d28 100644 --- a/Common/src/toolboxes/MMS/CMMSIncEulerSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSIncEulerSolution.cpp @@ -2,7 +2,7 @@ * \file CMMSIncEulerSolution.cpp * \brief Implementations of the member functions of CMMSIncEulerSolution. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,14 +27,11 @@ #include "../../../include/toolboxes/MMS/CMMSIncEulerSolution.hpp" -CMMSIncEulerSolution::CMMSIncEulerSolution(void) : CVerificationSolution() { } - -CMMSIncEulerSolution::CMMSIncEulerSolution(unsigned short val_nDim, - unsigned short val_nVar, - unsigned short val_iMesh, - CConfig* config) -: CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { +CMMSIncEulerSolution::CMMSIncEulerSolution() : CVerificationSolution() {} +CMMSIncEulerSolution::CMMSIncEulerSolution(unsigned short val_nDim, unsigned short val_nVar, unsigned short val_iMesh, + CConfig* config) + : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { /*--- Write a message that the solution is initialized for the manufactured solution for the incompressible Navier-Stokes equations. ---*/ if ((rank == MASTER_NODE) && (val_iMesh == MESH_0)) { @@ -46,7 +43,7 @@ CMMSIncEulerSolution::CMMSIncEulerSolution(unsigned short val_nDim, } /*--- Coefficients, needed to determine the solution. ---*/ - Density = config->GetDensity_FreeStreamND(); + Density = config->GetDensity_FreeStreamND(); Temperature = config->GetTemperature_FreeStreamND(); /*--- Constants, which describe this manufactured solution. This is a @@ -55,85 +52,80 @@ CMMSIncEulerSolution::CMMSIncEulerSolution(unsigned short val_nDim, Knupp P, "Code verification by the method of manufactured solutions," SAND 2000-1444, Sandia National Laboratories, Albuquerque, NM, 2000. ---*/ - P_0 = 1.0; - u_0 = 1.0; - v_0 = 1.0; + P_0 = 1.0; + u_0 = 1.0; + v_0 = 1.0; epsilon = 0.001; /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetTime_Marching() != TIME_MARCHING::STEADY) - SU2_MPI::Error("Steady mode must be selected for the MMS incompressible Euler case", - CURRENT_FUNCTION); + if (config->GetTime_Marching() != TIME_MARCHING::STEADY) + SU2_MPI::Error("Steady mode must be selected for the MMS incompressible Euler case", CURRENT_FUNCTION); - if(Kind_Solver != MAIN_SOLVER::INC_EULER && Kind_Solver != MAIN_SOLVER::INC_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::INC_RANS ) + if (Kind_Solver != MAIN_SOLVER::INC_EULER && Kind_Solver != MAIN_SOLVER::INC_NAVIER_STOKES && + Kind_Solver != MAIN_SOLVER::INC_RANS) SU2_MPI::Error("Incompressible flow equations must be selected for the MMS incompressible Euler case", CURRENT_FUNCTION); - if(Kind_Solver != MAIN_SOLVER::INC_EULER) - SU2_MPI::Error("Euler equations must be selected for the MMS incompressible Euler case", - CURRENT_FUNCTION); + if (Kind_Solver != MAIN_SOLVER::INC_EULER) + SU2_MPI::Error("Euler equations must be selected for the MMS incompressible Euler case", CURRENT_FUNCTION); - if(config->GetKind_FluidModel() != CONSTANT_DENSITY) + if (config->GetKind_FluidModel() != CONSTANT_DENSITY) SU2_MPI::Error("Constant density fluid model must be selected for the MMS incompressible Euler case", CURRENT_FUNCTION); - if(config->GetEnergy_Equation()) + if (config->GetEnergy_Equation()) SU2_MPI::Error("Energy equation must be disabled (isothermal) for the MMS incompressible Euler case", CURRENT_FUNCTION); } -CMMSIncEulerSolution::~CMMSIncEulerSolution(void) { } - -void CMMSIncEulerSolution::GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { +CMMSIncEulerSolution::~CMMSIncEulerSolution() = default; +void CMMSIncEulerSolution::GetBCState(const su2double* val_coords, const su2double val_t, + su2double* val_solution) const { /*--- The exact solution is prescribed on the boundaries. ---*/ GetSolution(val_coords, val_t, val_solution); } -void CMMSIncEulerSolution::GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { - +void CMMSIncEulerSolution::GetSolution(const su2double* val_coords, const su2double val_t, + su2double* val_solution) const { /* Easier storage of the x- and y-coordinates. */ const su2double x = val_coords[0]; const su2double y = val_coords[1]; /* Compute the primitives from the defined solution. */ - const su2double u = u_0*(sin(x*x + y*y) + epsilon); - const su2double v = v_0*(cos(x*x + y*y) + epsilon); - const su2double p = P_0*(sin(x*x + y*y) + 2.0); + const su2double u = u_0 * (sin(x * x + y * y) + epsilon); + const su2double v = v_0 * (cos(x * x + y * y) + epsilon); + const su2double p = P_0 * (sin(x * x + y * y) + 2.0); /* For the incompressible solver, we return the primitive variables directly, as they are used for the working variables in the solver. Note that the implementation below is valid for both 2D and 3D. */ - val_solution[0] = p; - val_solution[1] = u; - val_solution[2] = v; - val_solution[3] = 0.0; - val_solution[nVar-1] = Temperature; - + val_solution[0] = p; + val_solution[1] = u; + val_solution[2] = v; + val_solution[3] = 0.0; + val_solution[nVar - 1] = Temperature; } -void CMMSIncEulerSolution::GetMMSSourceTerm(const su2double *val_coords, - const su2double val_t, - su2double *val_source) const { - +void CMMSIncEulerSolution::GetMMSSourceTerm(const su2double* val_coords, const su2double val_t, + su2double* val_source) const { /*--- Easier storage of the x- and y-coordinates. ---*/ const su2double x = val_coords[0]; const su2double y = val_coords[1]; /*--- The expressions for the source terms are generated automatically by the sympy package in python.---*/ - val_source[0] = 2*Density*(u_0*x*cos(pow(x, 2) + pow(y, 2)) - v_0*y*sin(pow(x, 2) + pow(y, 2))); - val_source[1] = 4*Density*pow(u_0, 2)*x*(epsilon + sin(pow(x, 2) + pow(y, 2)))*cos(pow(x, 2) + pow(y, 2)) - 2*Density*u_0*v_0*y*(epsilon + sin(pow(x, 2) + pow(y, 2)))*sin(pow(x, 2) + pow(y, 2)) + 2*Density*u_0*v_0*y*(epsilon + cos(pow(x, 2) + pow(y, 2)))*cos(pow(x, 2) + pow(y, 2)) + 2*P_0*x*cos(pow(x, 2) + pow(y, 2)); - val_source[2] = -2*Density*u_0*v_0*x*(epsilon + sin(pow(x, 2) + pow(y, 2)))*sin(pow(x, 2) + pow(y, 2)) + 2*Density*u_0*v_0*x*(epsilon + cos(pow(x, 2) + pow(y, 2)))*cos(pow(x, 2) + pow(y, 2)) - 4*Density*pow(v_0, 2)*y*(epsilon + cos(pow(x, 2) + pow(y, 2)))*sin(pow(x, 2) + pow(y, 2)) + 2*P_0*y*cos(pow(x, 2) + pow(y, 2)); - val_source[3] = 0.0; - val_source[nVar-1] = 0.0; - + val_source[0] = 2 * Density * (u_0 * x * cos(pow(x, 2) + pow(y, 2)) - v_0 * y * sin(pow(x, 2) + pow(y, 2))); + val_source[1] = 4 * Density * pow(u_0, 2) * x * (epsilon + sin(pow(x, 2) + pow(y, 2))) * cos(pow(x, 2) + pow(y, 2)) - + 2 * Density * u_0 * v_0 * y * (epsilon + sin(pow(x, 2) + pow(y, 2))) * sin(pow(x, 2) + pow(y, 2)) + + 2 * Density * u_0 * v_0 * y * (epsilon + cos(pow(x, 2) + pow(y, 2))) * cos(pow(x, 2) + pow(y, 2)) + + 2 * P_0 * x * cos(pow(x, 2) + pow(y, 2)); + val_source[2] = -2 * Density * u_0 * v_0 * x * (epsilon + sin(pow(x, 2) + pow(y, 2))) * sin(pow(x, 2) + pow(y, 2)) + + 2 * Density * u_0 * v_0 * x * (epsilon + cos(pow(x, 2) + pow(y, 2))) * cos(pow(x, 2) + pow(y, 2)) - + 4 * Density * pow(v_0, 2) * y * (epsilon + cos(pow(x, 2) + pow(y, 2))) * sin(pow(x, 2) + pow(y, 2)) + + 2 * P_0 * y * cos(pow(x, 2) + pow(y, 2)); + val_source[3] = 0.0; + val_source[nVar - 1] = 0.0; } -bool CMMSIncEulerSolution::IsManufacturedSolution(void) const { - return true; -} +bool CMMSIncEulerSolution::IsManufacturedSolution() const { return true; } diff --git a/Common/src/toolboxes/MMS/CMMSIncNSSolution.cpp b/Common/src/toolboxes/MMS/CMMSIncNSSolution.cpp index 8cd7ed00b89..9dcb68c3ad1 100644 --- a/Common/src/toolboxes/MMS/CMMSIncNSSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSIncNSSolution.cpp @@ -2,7 +2,7 @@ * \file CMMSIncNSSolution.cpp * \brief Implementations of the member functions of CMMSIncNSSolution. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,14 +27,11 @@ #include "../../../include/toolboxes/MMS/CMMSIncNSSolution.hpp" -CMMSIncNSSolution::CMMSIncNSSolution(void) : CVerificationSolution() { } - -CMMSIncNSSolution::CMMSIncNSSolution(unsigned short val_nDim, - unsigned short val_nVar, - unsigned short val_iMesh, - CConfig* config) -: CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { +CMMSIncNSSolution::CMMSIncNSSolution() : CVerificationSolution() {} +CMMSIncNSSolution::CMMSIncNSSolution(unsigned short val_nDim, unsigned short val_nVar, unsigned short val_iMesh, + CConfig* config) + : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { /*--- Write a message that the solution is initialized for the manufactured solution for the incompressible Navier-Stokes equations. ---*/ if ((rank == MASTER_NODE) && (val_iMesh == MESH_0)) { @@ -46,8 +43,8 @@ CMMSIncNSSolution::CMMSIncNSSolution(unsigned short val_nDim, } /*--- Coefficients, needed to determine the solution. ---*/ - Viscosity = config->GetViscosity_FreeStreamND(); - Density = config->GetDensity_FreeStreamND(); + Viscosity = config->GetViscosity_FreeStreamND(); + Density = config->GetDensity_FreeStreamND(); Temperature = config->GetTemperature_FreeStreamND(); /*--- Constants, which describe this manufactured solution. This is a @@ -56,89 +53,93 @@ CMMSIncNSSolution::CMMSIncNSSolution(unsigned short val_nDim, Knupp P, "Code verification by the method of manufactured solutions," SAND 2000-1444, Sandia National Laboratories, Albuquerque, NM, 2000. ---*/ - P_0 = 1.0; - u_0 = 1.0; - v_0 = 1.0; + P_0 = 1.0; + u_0 = 1.0; + v_0 = 1.0; epsilon = 0.001; /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetTime_Marching() != TIME_MARCHING::STEADY) - SU2_MPI::Error("Steady mode must be selected for the MMS incompressible NS case", - CURRENT_FUNCTION); + if (config->GetTime_Marching() != TIME_MARCHING::STEADY) + SU2_MPI::Error("Steady mode must be selected for the MMS incompressible NS case", CURRENT_FUNCTION); - if(Kind_Solver != MAIN_SOLVER::INC_EULER && Kind_Solver != MAIN_SOLVER::INC_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::INC_RANS ) + if (Kind_Solver != MAIN_SOLVER::INC_EULER && Kind_Solver != MAIN_SOLVER::INC_NAVIER_STOKES && + Kind_Solver != MAIN_SOLVER::INC_RANS) SU2_MPI::Error("Incompressible flow equations must be selected for the MMS incompressible NS case", CURRENT_FUNCTION); - if(Kind_Solver != MAIN_SOLVER::INC_NAVIER_STOKES) - SU2_MPI::Error("Navier Stokes equations must be selected for the MMS incompressible NS case", - CURRENT_FUNCTION); + if (Kind_Solver != MAIN_SOLVER::INC_NAVIER_STOKES) + SU2_MPI::Error("Navier Stokes equations must be selected for the MMS incompressible NS case", CURRENT_FUNCTION); - if(config->GetKind_FluidModel() != CONSTANT_DENSITY) + if (config->GetKind_FluidModel() != CONSTANT_DENSITY) SU2_MPI::Error("Constant density fluid model must be selected for the MMS incompressible NS case", CURRENT_FUNCTION); - if(config->GetKind_ViscosityModel() != VISCOSITYMODEL::CONSTANT) - SU2_MPI::Error("Constant viscosity must be selected for the MMS incompressible NS case", - CURRENT_FUNCTION); + if (config->GetKind_ViscosityModel() != VISCOSITYMODEL::CONSTANT) + SU2_MPI::Error("Constant viscosity must be selected for the MMS incompressible NS case", CURRENT_FUNCTION); - if(config->GetEnergy_Equation()) + if (config->GetEnergy_Equation()) SU2_MPI::Error("Energy equation must be disabled (isothermal) for the MMS incompressible NS case", CURRENT_FUNCTION); } -CMMSIncNSSolution::~CMMSIncNSSolution(void) { } - -void CMMSIncNSSolution::GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { +CMMSIncNSSolution::~CMMSIncNSSolution() = default; +void CMMSIncNSSolution::GetBCState(const su2double* val_coords, const su2double val_t, su2double* val_solution) const { /*--- The exact solution is prescribed on the boundaries. ---*/ GetSolution(val_coords, val_t, val_solution); } -void CMMSIncNSSolution::GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { - +void CMMSIncNSSolution::GetSolution(const su2double* val_coords, const su2double val_t, su2double* val_solution) const { /* Easier storage of the x- and y-coordinates. */ const su2double x = val_coords[0]; const su2double y = val_coords[1]; /* Compute the primitives from the defined solution. */ - const su2double u = u_0*(sin(x*x + y*y) + epsilon); - const su2double v = v_0*(cos(x*x + y*y) + epsilon); - const su2double p = P_0*(sin(x*x + y*y) + 2.0); + const su2double u = u_0 * (sin(x * x + y * y) + epsilon); + const su2double v = v_0 * (cos(x * x + y * y) + epsilon); + const su2double p = P_0 * (sin(x * x + y * y) + 2.0); /* For the incompressible solver, we return the primitive variables directly, as they are used for the working variables in the solver. Note that the implementation below is valid for both 2D and 3D. */ - val_solution[0] = p; - val_solution[1] = u; - val_solution[2] = v; - val_solution[3] = 0.0; - val_solution[nVar-1] = Temperature; - + val_solution[0] = p; + val_solution[1] = u; + val_solution[2] = v; + val_solution[3] = 0.0; + val_solution[nVar - 1] = Temperature; } -void CMMSIncNSSolution::GetMMSSourceTerm(const su2double *val_coords, - const su2double val_t, - su2double *val_source) const { - +void CMMSIncNSSolution::GetMMSSourceTerm(const su2double* val_coords, const su2double val_t, + su2double* val_source) const { /*--- Easier storage of the x- and y-coordinates. ---*/ const su2double x = val_coords[0]; const su2double y = val_coords[1]; /*--- The expressions for the source terms are generated automatically by the sympy package in python.---*/ - val_source[0] = 2*Density*(u_0*x*cos(pow(x, 2) + pow(y, 2)) - v_0*y*sin(pow(x, 2) + pow(y, 2))); - val_source[1] = 4*Density*pow(u_0, 2)*x*(epsilon + sin(pow(x, 2) + pow(y, 2)))*cos(pow(x, 2) + pow(y, 2)) - 2*Density*u_0*v_0*y*(epsilon + sin(pow(x, 2) + pow(y, 2)))*sin(pow(x, 2) + pow(y, 2)) + 2*Density*u_0*v_0*y*(epsilon + cos(pow(x, 2) + pow(y, 2)))*cos(pow(x, 2) + pow(y, 2)) + 2*P_0*x*cos(pow(x, 2) + pow(y, 2)) - 0.666666666666667*Viscosity*(-8.0*u_0*pow(x, 2)*sin(pow(x, 2) + pow(y, 2)) + 4.0*u_0*cos(pow(x, 2) + pow(y, 2)) + 4*v_0*x*y*cos(pow(x, 2) + pow(y, 2))) + 2*Viscosity*(2*u_0*pow(y, 2)*sin(pow(x, 2) + pow(y, 2)) - u_0*cos(pow(x, 2) + pow(y, 2)) + 2*v_0*x*y*cos(pow(x, 2) + pow(y, 2))); - val_source[2] = -2*Density*u_0*v_0*x*(epsilon + sin(pow(x, 2) + pow(y, 2)))*sin(pow(x, 2) + pow(y, 2)) + 2*Density*u_0*v_0*x*(epsilon + cos(pow(x, 2) + pow(y, 2)))*cos(pow(x, 2) + pow(y, 2)) - 4*Density*pow(v_0, 2)*y*(epsilon + cos(pow(x, 2) + pow(y, 2)))*sin(pow(x, 2) + pow(y, 2)) + 2*P_0*y*cos(pow(x, 2) + pow(y, 2)) + 0.666666666666667*Viscosity*(-4*u_0*x*y*sin(pow(x, 2) + pow(y, 2)) + 8.0*v_0*pow(y, 2)*cos(pow(x, 2) + pow(y, 2)) + 4.0*v_0*sin(pow(x, 2) + pow(y, 2))) + 2*Viscosity*(2*u_0*x*y*sin(pow(x, 2) + pow(y, 2)) + 2*v_0*pow(x, 2)*cos(pow(x, 2) + pow(y, 2)) + v_0*sin(pow(x, 2) + pow(y, 2))); - val_source[3] = 0.0; - val_source[nVar-1] = 0.0; - + val_source[0] = 2 * Density * (u_0 * x * cos(pow(x, 2) + pow(y, 2)) - v_0 * y * sin(pow(x, 2) + pow(y, 2))); + val_source[1] = 4 * Density * pow(u_0, 2) * x * (epsilon + sin(pow(x, 2) + pow(y, 2))) * cos(pow(x, 2) + pow(y, 2)) - + 2 * Density * u_0 * v_0 * y * (epsilon + sin(pow(x, 2) + pow(y, 2))) * sin(pow(x, 2) + pow(y, 2)) + + 2 * Density * u_0 * v_0 * y * (epsilon + cos(pow(x, 2) + pow(y, 2))) * cos(pow(x, 2) + pow(y, 2)) + + 2 * P_0 * x * cos(pow(x, 2) + pow(y, 2)) - + 0.666666666666667 * Viscosity * + (-8.0 * u_0 * pow(x, 2) * sin(pow(x, 2) + pow(y, 2)) + 4.0 * u_0 * cos(pow(x, 2) + pow(y, 2)) + + 4 * v_0 * x * y * cos(pow(x, 2) + pow(y, 2))) + + 2 * Viscosity * + (2 * u_0 * pow(y, 2) * sin(pow(x, 2) + pow(y, 2)) - u_0 * cos(pow(x, 2) + pow(y, 2)) + + 2 * v_0 * x * y * cos(pow(x, 2) + pow(y, 2))); + val_source[2] = -2 * Density * u_0 * v_0 * x * (epsilon + sin(pow(x, 2) + pow(y, 2))) * sin(pow(x, 2) + pow(y, 2)) + + 2 * Density * u_0 * v_0 * x * (epsilon + cos(pow(x, 2) + pow(y, 2))) * cos(pow(x, 2) + pow(y, 2)) - + 4 * Density * pow(v_0, 2) * y * (epsilon + cos(pow(x, 2) + pow(y, 2))) * sin(pow(x, 2) + pow(y, 2)) + + 2 * P_0 * y * cos(pow(x, 2) + pow(y, 2)) + + 0.666666666666667 * Viscosity * + (-4 * u_0 * x * y * sin(pow(x, 2) + pow(y, 2)) + + 8.0 * v_0 * pow(y, 2) * cos(pow(x, 2) + pow(y, 2)) + 4.0 * v_0 * sin(pow(x, 2) + pow(y, 2))) + + 2 * Viscosity * + (2 * u_0 * x * y * sin(pow(x, 2) + pow(y, 2)) + 2 * v_0 * pow(x, 2) * cos(pow(x, 2) + pow(y, 2)) + + v_0 * sin(pow(x, 2) + pow(y, 2))); + val_source[3] = 0.0; + val_source[nVar - 1] = 0.0; } -bool CMMSIncNSSolution::IsManufacturedSolution(void) const { - return true; -} +bool CMMSIncNSSolution::IsManufacturedSolution() const { return true; } diff --git a/Common/src/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.cpp b/Common/src/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.cpp index c21f7d927a3..9743f45250a 100644 --- a/Common/src/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.cpp @@ -2,7 +2,7 @@ * \file CMMSNSTwoHalfCirclesSolution.cpp * \brief Implementations of the member functions of CMMSNSTwoHalfCirclesSolution. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,14 +27,11 @@ #include "../../../include/toolboxes/MMS/CMMSNSTwoHalfCirclesSolution.hpp" -CMMSNSTwoHalfCirclesSolution::CMMSNSTwoHalfCirclesSolution(void) : CVerificationSolution() { } - -CMMSNSTwoHalfCirclesSolution::CMMSNSTwoHalfCirclesSolution(unsigned short val_nDim, - unsigned short val_nVar, - unsigned short val_iMesh, - CConfig* config) - : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { +CMMSNSTwoHalfCirclesSolution::CMMSNSTwoHalfCirclesSolution() : CVerificationSolution() {} +CMMSNSTwoHalfCirclesSolution::CMMSNSTwoHalfCirclesSolution(unsigned short val_nDim, unsigned short val_nVar, + unsigned short val_iMesh, CConfig* config) + : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { /*--- Write a message that the solution is initialized for the manufactured solution for the Navier-Stokes equations between two half circles. ---*/ if ((rank == MASTER_NODE) && (val_iMesh == MESH_0)) { @@ -48,17 +45,17 @@ CMMSNSTwoHalfCirclesSolution::CMMSNSTwoHalfCirclesSolution(unsigned short val_nD /*--- Coefficients, needed to determine the solution. ---*/ const su2double Prandtl = config->GetPrandtl_Lam(); - RGas = config->GetGas_Constant(); - Gamma = config->GetGamma(); - Viscosity = config->GetMu_Constant(); - Conductivity = Viscosity*Gamma*RGas/(Prandtl*(Gamma-1.0)); + RGas = config->GetGas_Constant(); + Gamma = config->GetGamma(); + Viscosity = config->GetMu_Constant(); + Conductivity = Viscosity * Gamma * RGas / (Prandtl * (Gamma - 1.0)); /*--- Initialize TWall to the default value of 300 K (in case the outer wall is not modelled as an isothermal wall) and try to retrieve the wall temperature from the boundary conditions. ---*/ TWall = 300.0; - for(unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if(config->GetMarker_All_KindBC(iMarker) == ISOTHERMAL) { + for (unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + if (config->GetMarker_All_KindBC(iMarker) == ISOTHERMAL) { const string Marker_Tag = config->GetMarker_All_TagBound(iMarker); TWall = config->GetIsothermal_Temperature(Marker_Tag); } @@ -66,100 +63,88 @@ CMMSNSTwoHalfCirclesSolution::CMMSNSTwoHalfCirclesSolution(unsigned short val_nD /*--- Get the reference values for pressure, density and velocity. ---*/ Pressure_Ref = config->GetPressure_Ref(); - Density_Ref = config->GetDensity_Ref(); + Density_Ref = config->GetDensity_Ref(); Velocity_Ref = config->GetVelocity_Ref(); /*--- The constants for the density and velocities. ---*/ - rho_0 = 1.25; - u_0 = 135.78; - v_0 = -67.61; + rho_0 = 1.25; + u_0 = 135.78; + v_0 = -67.61; /*--- The constants for the temperature solution. ---*/ - a_T1 = 1.05; + a_T1 = 1.05; a_T2 = -0.85; /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetTime_Marching() != TIME_MARCHING::STEADY) - SU2_MPI::Error("Steady mode must be selected for the MMS NS Two Half Circles case", + if (config->GetTime_Marching() != TIME_MARCHING::STEADY) + SU2_MPI::Error("Steady mode must be selected for the MMS NS Two Half Circles case", CURRENT_FUNCTION); + + if (Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && + Kind_Solver != MAIN_SOLVER::RANS && Kind_Solver != MAIN_SOLVER::FEM_EULER && + Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::FEM_RANS && + Kind_Solver != MAIN_SOLVER::FEM_LES) + SU2_MPI::Error("Compressible flow equations must be selected for the MMS NS Two Half Circles case", CURRENT_FUNCTION); - if(Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::RANS && - Kind_Solver != MAIN_SOLVER::FEM_EULER && Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::FEM_RANS && - Kind_Solver != MAIN_SOLVER::FEM_LES) SU2_MPI::Error("Compressible flow equations must be selected for the MMS NS Two Half Circles case", - CURRENT_FUNCTION); + if ((Kind_Solver != MAIN_SOLVER::NAVIER_STOKES) && (Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES)) + SU2_MPI::Error("Navier Stokes equations must be selected for the MMS NS Two Half Circles case", CURRENT_FUNCTION); - if((Kind_Solver != MAIN_SOLVER::NAVIER_STOKES) && - (Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES)) - SU2_MPI::Error("Navier Stokes equations must be selected for the MMS NS Two Half Circles case", - CURRENT_FUNCTION); + if ((config->GetKind_FluidModel() != STANDARD_AIR) && (config->GetKind_FluidModel() != IDEAL_GAS)) + SU2_MPI::Error("Standard air or ideal gas must be selected for the MMS NS Two Half Circles case", CURRENT_FUNCTION); - if((config->GetKind_FluidModel() != STANDARD_AIR) && - (config->GetKind_FluidModel() != IDEAL_GAS)) - SU2_MPI::Error("Standard air or ideal gas must be selected for the MMS NS Two Half Circles case", - CURRENT_FUNCTION); + if (config->GetKind_ViscosityModel() != VISCOSITYMODEL::CONSTANT) + SU2_MPI::Error("Sutherland must be selected for viscosity for the MMS NS Two Half Circles case", CURRENT_FUNCTION); - if(config->GetKind_ViscosityModel() != VISCOSITYMODEL::CONSTANT) - SU2_MPI::Error("Sutherland must be selected for viscosity for the MMS NS Two Half Circles case", - CURRENT_FUNCTION); - - if(config->GetKind_ConductivityModel() != CONDUCTIVITYMODEL::CONSTANT_PRANDTL) - SU2_MPI::Error("Constant Prandtl number must be selected for the MMS NS Two Half Circles case", - CURRENT_FUNCTION); + if (config->GetKind_ConductivityModel() != CONDUCTIVITYMODEL::CONSTANT_PRANDTL) + SU2_MPI::Error("Constant Prandtl number must be selected for the MMS NS Two Half Circles case", CURRENT_FUNCTION); } -CMMSNSTwoHalfCirclesSolution::~CMMSNSTwoHalfCirclesSolution(void) { } - -void CMMSNSTwoHalfCirclesSolution::GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { +CMMSNSTwoHalfCirclesSolution::~CMMSNSTwoHalfCirclesSolution() = default; +void CMMSNSTwoHalfCirclesSolution::GetBCState(const su2double* val_coords, const su2double val_t, + su2double* val_solution) const { /*--- The exact solution is prescribed on the boundaries. ---*/ GetSolution(val_coords, val_t, val_solution); } -void CMMSNSTwoHalfCirclesSolution::GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { - +void CMMSNSTwoHalfCirclesSolution::GetSolution(const su2double* val_coords, const su2double val_t, + su2double* val_solution) const { /* Easier storage of the x- and y-coordinates. */ const su2double x = val_coords[0]; const su2double y = val_coords[1]; /* Determine the dimensional solution for the temperature. */ - const su2double Pi = PI_NUMBER; - const su2double r = sqrt(x*x + y*y); - const su2double fact = (r-1.0)*(r-1.0)/(a_T1 + a_T2); + const su2double Pi = PI_NUMBER; + const su2double r = sqrt(x * x + y * y); + const su2double fact = (r - 1.0) * (r - 1.0) / (a_T1 + a_T2); - su2double T = 0.25*TWall*(3.0 + fact*(a_T1*cos(Pi*(r-2.0)) - + a_T2*cos(Pi*(r-2.0)*2.0))); + su2double T = 0.25 * TWall * (3.0 + fact * (a_T1 * cos(Pi * (r - 2.0)) + a_T2 * cos(Pi * (r - 2.0) * 2.0))); /* Determine the dimensional solution for the velocities. */ - su2double u = u_0*(r-1.0)*(2.0-r)*4.0; - su2double v = v_0*(r-1.0)*(2.0-r)*4.0; + su2double u = u_0 * (r - 1.0) * (2.0 - r) * 4.0; + su2double v = v_0 * (r - 1.0) * (2.0 - r) * 4.0; /* Compute the pressure from the density and temperature. */ su2double rho = rho_0; - su2double p = rho*RGas*T; + su2double p = rho * RGas * T; /* Determine the non-dimensional solution. */ rho /= Density_Ref; - p /= Pressure_Ref; - u /= Velocity_Ref; - v /= Velocity_Ref; + p /= Pressure_Ref; + u /= Velocity_Ref; + v /= Velocity_Ref; /* Determine the non-dimensional conserved variables. Note that the implementation below is valid for both 2D and 3D. */ - val_solution[0] = rho; - val_solution[1] = rho*u; - val_solution[2] = rho*v; - val_solution[3] = 0.0; - val_solution[nDim+1] = p/(Gamma-1.0) + 0.5*rho*(u*u + v*v); + val_solution[0] = rho; + val_solution[1] = rho * u; + val_solution[2] = rho * v; + val_solution[3] = 0.0; + val_solution[nDim + 1] = p / (Gamma - 1.0) + 0.5 * rho * (u * u + v * v); } -void CMMSNSTwoHalfCirclesSolution::GetMMSSourceTerm(const su2double *val_coords, - const su2double val_t, - su2double *val_source) const { - +void CMMSNSTwoHalfCirclesSolution::GetMMSSourceTerm(const su2double* val_coords, const su2double val_t, + su2double* val_source) const { /*--- Abbreviate Pi and the coordinates. ---*/ const su2double Pi = PI_NUMBER; const su2double x = val_coords[0]; @@ -167,7 +152,7 @@ void CMMSNSTwoHalfCirclesSolution::GetMMSSourceTerm(const su2double *val_coords, /*--- The source code for the source terms is generated in Maple. See the file CMMSNSTwoHalfCirclesSolution.mw in the directory - CreateMMSSourceTerms for the details how to do this. ---*/ + CreateMMSSourceTerms for the details how to do this. ---*/ const su2double t1 = rho_0 * u_0; const su2double t2 = x * x; const su2double t3 = y * y; @@ -225,12 +210,14 @@ void CMMSNSTwoHalfCirclesSolution::GetMMSSourceTerm(const su2double *val_coords, const su2double t99 = t3 * u_0; const su2double t102 = t81 * t75; const su2double t105 = v_0 * x; - const su2double t113 = (0.4e1 * y * t102 * t105 - 0.8e1 * y * t65 * t105 - 0.4e1 * t6 * t75 * u_0 - + 0.4e1 * t102 * t99 - 0.8e1 * t65 * t99) * Viscosity; + const su2double t113 = (0.4e1 * y * t102 * t105 - 0.8e1 * y * t65 * t105 - 0.4e1 * t6 * t75 * u_0 + + 0.4e1 * t102 * t99 - 0.8e1 * t65 * t99) * + Viscosity; const su2double t121 = u_0 * y; const su2double t131 = t2 * v_0; - const su2double t137 = (0.4e1 * x * t102 * t121 - 0.8e1 * x * t65 * t121 - 0.4e1 * t6 * t75 * v_0 - + 0.4e1 * t102 * t131 - 0.8e1 * t65 * t131) * Viscosity; + const su2double t137 = (0.4e1 * x * t102 * t121 - 0.8e1 * x * t65 * t121 - 0.4e1 * t6 * t75 * v_0 + + 0.4e1 * t102 * t131 - 0.8e1 * t65 * t131) * + Viscosity; const su2double t138 = v_0 * v_0; const su2double t139 = t138 * rho_0; const su2double t141 = y * t26; @@ -263,11 +250,12 @@ void CMMSNSTwoHalfCirclesSolution::GetMMSSourceTerm(const su2double *val_coords, const su2double t254 = t30 * t138; const su2double t261 = t248 * t246 * t34 / 0.4e1 + 0.8e1 * (t25 * t252 + t25 * t254) * rho_0 + t246 * t34 / 0.4e1; const su2double t262 = v_0 * t261; - const su2double t267 = -0.4e1 * t193 * t2 * TWall * t65 - 0.4e1 * t193 * TWall * t65 * t3 - 0.8e1 * t193 * t201 - + 0.64e2 / 0.3e1 * t8 * t12 * t22 * t76 - 0.4e1 * t9 * t213 + 0.4e1 * t13 * t213 - - 0.4e1 * t17 * t218 + 0.4e1 * t19 * t218 + 0.128e3 / 0.3e1 * t8 * t11 * Viscosity * t6 * t161 * t138 - + 0.64e2 / 0.3e1 * t231 * t230 * t173 * t172 - 0.32e2 / 0.3e1 * t237 * t236 * t82 * t76 - - 0.4e1 * t8 * t236 * t113 - 0.4e1 * t19 * t262 + 0.4e1 * t17 * t262; + const su2double t267 = -0.4e1 * t193 * t2 * TWall * t65 - 0.4e1 * t193 * TWall * t65 * t3 - 0.8e1 * t193 * t201 + + 0.64e2 / 0.3e1 * t8 * t12 * t22 * t76 - 0.4e1 * t9 * t213 + 0.4e1 * t13 * t213 - + 0.4e1 * t17 * t218 + 0.4e1 * t19 * t218 + + 0.128e3 / 0.3e1 * t8 * t11 * Viscosity * t6 * t161 * t138 + + 0.64e2 / 0.3e1 * t231 * t230 * t173 * t172 - 0.32e2 / 0.3e1 * t237 * t236 * t82 * t76 - + 0.4e1 * t8 * t236 * t113 - 0.4e1 * t19 * t262 + 0.4e1 * t17 * t262; const su2double t271 = u_0 * t261; const su2double t277 = Pi * Pi; const su2double t278 = t6 * t277; @@ -283,37 +271,40 @@ void CMMSNSTwoHalfCirclesSolution::GetMMSSourceTerm(const su2double *val_coords, const su2double t321 = t65 * t172; const su2double t364 = t11 * t22; const su2double t367 = t11 * t138; - const su2double t391 = -0.4e1 * t8 * t230 * t137 + 0.4e1 * t9 * t271 - 0.4e1 * t13 * t271 - - 0.4e1 * t300 * (-t281 * y * t278 + t11 * a_T2 * y * t285 - Pi * t16 * t183 - - 0.2e1 * a_T2 * t51 * y * t292 - t151 / 0.2e1) * t11 * TWall * t16 - + 0.4e1 * t300 * t190 * t11 * TWall * t81 * t3 + 0.32e2 / 0.3e1 * t237 * t311 * t310 - - 0.64e2 / 0.3e1 * t317 * t316 * y * t168 - 0.64e2 / 0.3e1 * t231 * t316 * t321 - + 0.64e2 / 0.3e1 * y * t11 * t316 * t321 - 0.4e1 * t300 * x * (-t281 * x * t278 - + t11 * a_T2 * x * t285 - Pi * t7 * t183 - 0.2e1 * a_T2 * t51 * x * t292 - t53 / 0.2e1) * t201 - + 0.4e1 * t300 * t2 * t190 * t11 * TWall * t81 + 0.64e2 / 0.3e1 * t317 * u_0 * t70 * x * t66 - - 0.32e2 / 0.3e1 * x * t11 * t311 * t310 + 0.4e1 * t317 * u_0 * (t248 * t62 * t34 / 0.4e1 - + 0.16e2 * (-t9 * t252 - t9 * t254 + t27 * t364 + t27 * t367) * rho_0 + t64) - + 0.4e1 * t317 * v_0 * (t248 * t158 * t34 / 0.4e1 - + 0.16e2 * (t141 * t364 + t141 * t367 - t17 * t252 - t17 * t254) * rho_0 + t160); + const su2double t391 = + -0.4e1 * t8 * t230 * t137 + 0.4e1 * t9 * t271 - 0.4e1 * t13 * t271 - + 0.4e1 * t300 * + (-t281 * y * t278 + t11 * a_T2 * y * t285 - Pi * t16 * t183 - 0.2e1 * a_T2 * t51 * y * t292 - t151 / 0.2e1) * + t11 * TWall * t16 + + 0.4e1 * t300 * t190 * t11 * TWall * t81 * t3 + 0.32e2 / 0.3e1 * t237 * t311 * t310 - + 0.64e2 / 0.3e1 * t317 * t316 * y * t168 - 0.64e2 / 0.3e1 * t231 * t316 * t321 + + 0.64e2 / 0.3e1 * y * t11 * t316 * t321 - + 0.4e1 * t300 * x * + (-t281 * x * t278 + t11 * a_T2 * x * t285 - Pi * t7 * t183 - 0.2e1 * a_T2 * t51 * x * t292 - t53 / 0.2e1) * + t201 + + 0.4e1 * t300 * t2 * t190 * t11 * TWall * t81 + 0.64e2 / 0.3e1 * t317 * u_0 * t70 * x * t66 - + 0.32e2 / 0.3e1 * x * t11 * t311 * t310 + + 0.4e1 * t317 * u_0 * + (t248 * t62 * t34 / 0.4e1 + 0.16e2 * (-t9 * t252 - t9 * t254 + t27 * t364 + t27 * t367) * rho_0 + t64) + + 0.4e1 * t317 * v_0 * + (t248 * t158 * t34 / 0.4e1 + 0.16e2 * (t141 * t364 + t141 * t367 - t17 * t252 - t17 * t254) * rho_0 + t160); /*--- Set the source term, which is valid for both 2D and 3D cases. Note the scaling for the correct non-dimensionalization. ---*/ - val_source[0] = -0.4e1 * t13 * t1 + 0.4e1 * t9 * t1 + 0.4e1 * t17 * t15 - 0.4e1 * t19 * t15; - val_source[1] = 0.32e2 * t27 * t11 * t23 - 0.32e2 * t9 * t30 * t23 + t64 + 0.16e2 / 0.3e1 * t70 * x * t66 - + 0.16e2 / 0.3e1 * t6 * u_0 * t76 - 0.8e1 / 0.3e1 * x * t82 * t76 + 0.32e2 * t16 * t87 * t86 - - 0.32e2 * t16 * t92 * t91 - t113; - val_source[2] = 0.32e2 * t7 * t87 * t86 - 0.32e2 * t7 * t92 * t91 - t137 + 0.32e2 * t141 * t11 * t139 - - 0.32e2 * t17 * t30 * t139 + t160 + 0.32e2 / 0.3e1 * Viscosity * t6 * t161 * v_0 - - 0.16e2 / 0.3e1 * y * Viscosity * t168 + 0.16e2 / 0.3e1 * y * t173 * t172; - val_source[3] = 0.0; - val_source[nDim+1] = t267 + t391; - - val_source[0] /= Density_Ref*Velocity_Ref; - val_source[1] /= Pressure_Ref; - val_source[2] /= Pressure_Ref; - val_source[nDim+1] /= Velocity_Ref*Pressure_Ref; + val_source[0] = -0.4e1 * t13 * t1 + 0.4e1 * t9 * t1 + 0.4e1 * t17 * t15 - 0.4e1 * t19 * t15; + val_source[1] = 0.32e2 * t27 * t11 * t23 - 0.32e2 * t9 * t30 * t23 + t64 + 0.16e2 / 0.3e1 * t70 * x * t66 + + 0.16e2 / 0.3e1 * t6 * u_0 * t76 - 0.8e1 / 0.3e1 * x * t82 * t76 + 0.32e2 * t16 * t87 * t86 - + 0.32e2 * t16 * t92 * t91 - t113; + val_source[2] = 0.32e2 * t7 * t87 * t86 - 0.32e2 * t7 * t92 * t91 - t137 + 0.32e2 * t141 * t11 * t139 - + 0.32e2 * t17 * t30 * t139 + t160 + 0.32e2 / 0.3e1 * Viscosity * t6 * t161 * v_0 - + 0.16e2 / 0.3e1 * y * Viscosity * t168 + 0.16e2 / 0.3e1 * y * t173 * t172; + val_source[3] = 0.0; + val_source[nDim + 1] = t267 + t391; + + val_source[0] /= Density_Ref * Velocity_Ref; + val_source[1] /= Pressure_Ref; + val_source[2] /= Pressure_Ref; + val_source[nDim + 1] /= Velocity_Ref * Pressure_Ref; } -bool CMMSNSTwoHalfCirclesSolution::IsManufacturedSolution(void) const { - return true; -} +bool CMMSNSTwoHalfCirclesSolution::IsManufacturedSolution() const { return true; } diff --git a/Common/src/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.cpp b/Common/src/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.cpp index c6e7a5f005a..6b681598c59 100644 --- a/Common/src/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.cpp @@ -2,7 +2,7 @@ * \file CMMSNSTwoHalfSpheresSolution.cpp * \brief Implementations of the member functions of CMMSNSTwoHalfSpheresSolution. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,14 +27,11 @@ #include "../../../include/toolboxes/MMS/CMMSNSTwoHalfSpheresSolution.hpp" -CMMSNSTwoHalfSpheresSolution::CMMSNSTwoHalfSpheresSolution(void) : CVerificationSolution() { } - -CMMSNSTwoHalfSpheresSolution::CMMSNSTwoHalfSpheresSolution(unsigned short val_nDim, - unsigned short val_nVar, - unsigned short val_iMesh, - CConfig* config) - : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { +CMMSNSTwoHalfSpheresSolution::CMMSNSTwoHalfSpheresSolution() : CVerificationSolution() {} +CMMSNSTwoHalfSpheresSolution::CMMSNSTwoHalfSpheresSolution(unsigned short val_nDim, unsigned short val_nVar, + unsigned short val_iMesh, CConfig* config) + : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { /*--- Write a message that the solution is initialized for the manufactured solution for the Navier-Stokes equations between two half spheres. ---*/ if ((rank == MASTER_NODE) && (val_iMesh == MESH_0)) { @@ -48,17 +45,17 @@ CMMSNSTwoHalfSpheresSolution::CMMSNSTwoHalfSpheresSolution(unsigned short val_nD /*--- Coefficients, needed to determine the solution. ---*/ const su2double Prandtl = config->GetPrandtl_Lam(); - RGas = config->GetGas_Constant(); - Gamma = config->GetGamma(); - Viscosity = config->GetMu_Constant(); - Conductivity = Viscosity*Gamma*RGas/(Prandtl*(Gamma-1.0)); + RGas = config->GetGas_Constant(); + Gamma = config->GetGamma(); + Viscosity = config->GetMu_Constant(); + Conductivity = Viscosity * Gamma * RGas / (Prandtl * (Gamma - 1.0)); /*--- Initialize TWall to the default value of 300 K (in case the outer wall is not modelled as an isothermal wall) and try to retrieve the wall temperature from the boundary conditions. ---*/ TWall = 300.0; - for(unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if(config->GetMarker_All_KindBC(iMarker) == ISOTHERMAL) { + for (unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + if (config->GetMarker_All_KindBC(iMarker) == ISOTHERMAL) { const string Marker_Tag = config->GetMarker_All_TagBound(iMarker); TWall = config->GetIsothermal_Temperature(Marker_Tag); } @@ -66,108 +63,93 @@ CMMSNSTwoHalfSpheresSolution::CMMSNSTwoHalfSpheresSolution(unsigned short val_nD /*--- Get the reference values for pressure, density and velocity. ---*/ Pressure_Ref = config->GetPressure_Ref(); - Density_Ref = config->GetDensity_Ref(); + Density_Ref = config->GetDensity_Ref(); Velocity_Ref = config->GetVelocity_Ref(); /*--- The constants for the density and velocities. ---*/ - rho_0 = 1.25; - u_0 = 135.78; - v_0 = -67.61; - w_0 = 82.75; + rho_0 = 1.25; + u_0 = 135.78; + v_0 = -67.61; + w_0 = 82.75; /*--- The constants for the temperature solution. ---*/ - a_T1 = 1.05; + a_T1 = 1.05; a_T2 = -0.85; /*--- Perform some sanity and error checks for this solution here. ---*/ - if(nDim != 3) - SU2_MPI::Error("Grid must be 3D for the MMS NS Two Half Spheres case", - CURRENT_FUNCTION); + if (nDim != 3) SU2_MPI::Error("Grid must be 3D for the MMS NS Two Half Spheres case", CURRENT_FUNCTION); - if(config->GetTime_Marching() != TIME_MARCHING::STEADY) - SU2_MPI::Error("Steady mode must be selected for the MMS NS Two Half Spheres case", - CURRENT_FUNCTION); + if (config->GetTime_Marching() != TIME_MARCHING::STEADY) + SU2_MPI::Error("Steady mode must be selected for the MMS NS Two Half Spheres case", CURRENT_FUNCTION); - if(Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::RANS && - Kind_Solver != MAIN_SOLVER::FEM_EULER && Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::FEM_RANS && - Kind_Solver != MAIN_SOLVER::FEM_LES) + if (Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && + Kind_Solver != MAIN_SOLVER::RANS && Kind_Solver != MAIN_SOLVER::FEM_EULER && + Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::FEM_RANS && + Kind_Solver != MAIN_SOLVER::FEM_LES) SU2_MPI::Error("Compressible flow equations must be selected for the MMS NS Two Half Spheres case", CURRENT_FUNCTION); - if((Kind_Solver != MAIN_SOLVER::NAVIER_STOKES) && - (Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES)) - SU2_MPI::Error("Navier Stokes equations must be selected for the MMS NS Two Half Spheres case", - CURRENT_FUNCTION); + if ((Kind_Solver != MAIN_SOLVER::NAVIER_STOKES) && (Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES)) + SU2_MPI::Error("Navier Stokes equations must be selected for the MMS NS Two Half Spheres case", CURRENT_FUNCTION); - if((config->GetKind_FluidModel() != STANDARD_AIR) && - (config->GetKind_FluidModel() != IDEAL_GAS)) - SU2_MPI::Error("Standard air or ideal gas must be selected for the MMS NS Two Half Spheres case", - CURRENT_FUNCTION); + if ((config->GetKind_FluidModel() != STANDARD_AIR) && (config->GetKind_FluidModel() != IDEAL_GAS)) + SU2_MPI::Error("Standard air or ideal gas must be selected for the MMS NS Two Half Spheres case", CURRENT_FUNCTION); - if(config->GetKind_ViscosityModel() != VISCOSITYMODEL::CONSTANT) - SU2_MPI::Error("Sutherland must be selected for viscosity for the MMS NS Two Half Spheres case", - CURRENT_FUNCTION); + if (config->GetKind_ViscosityModel() != VISCOSITYMODEL::CONSTANT) + SU2_MPI::Error("Sutherland must be selected for viscosity for the MMS NS Two Half Spheres case", CURRENT_FUNCTION); - if(config->GetKind_ConductivityModel() != CONDUCTIVITYMODEL::CONSTANT_PRANDTL) - SU2_MPI::Error("Constant Prandtl number must be selected for the MMS NS Two Half Spheres case", - CURRENT_FUNCTION); + if (config->GetKind_ConductivityModel() != CONDUCTIVITYMODEL::CONSTANT_PRANDTL) + SU2_MPI::Error("Constant Prandtl number must be selected for the MMS NS Two Half Spheres case", CURRENT_FUNCTION); } -CMMSNSTwoHalfSpheresSolution::~CMMSNSTwoHalfSpheresSolution(void) { } - -void CMMSNSTwoHalfSpheresSolution::GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { +CMMSNSTwoHalfSpheresSolution::~CMMSNSTwoHalfSpheresSolution() = default; +void CMMSNSTwoHalfSpheresSolution::GetBCState(const su2double* val_coords, const su2double val_t, + su2double* val_solution) const { /*--- The exact solution is prescribed on the boundaries. ---*/ GetSolution(val_coords, val_t, val_solution); } -void CMMSNSTwoHalfSpheresSolution::GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { - +void CMMSNSTwoHalfSpheresSolution::GetSolution(const su2double* val_coords, const su2double val_t, + su2double* val_solution) const { /* Easier storage of the x-, y- and z-coordinates. */ const su2double x = val_coords[0]; const su2double y = val_coords[1]; const su2double z = val_coords[2]; /* Determine the dimensional solution for the temperature. */ - const su2double Pi = PI_NUMBER; - const su2double r = sqrt(x*x + y*y + z*z); - const su2double fact = (r-1.0)*(r-1.0)/(a_T1 + a_T2); + const su2double Pi = PI_NUMBER; + const su2double r = sqrt(x * x + y * y + z * z); + const su2double fact = (r - 1.0) * (r - 1.0) / (a_T1 + a_T2); - su2double T = 0.25*TWall*(3.0 + fact*(a_T1*cos(Pi*(r-2.0)) - + a_T2*cos(Pi*(r-2.0)*2.0))); + su2double T = 0.25 * TWall * (3.0 + fact * (a_T1 * cos(Pi * (r - 2.0)) + a_T2 * cos(Pi * (r - 2.0) * 2.0))); /* Determine the dimensional solution for the velocities. */ - su2double u = u_0*(r-1.0)*(2.0-r)*4.0; - su2double v = v_0*(r-1.0)*(2.0-r)*4.0; - su2double w = w_0*(r-1.0)*(2.0-r)*4.0; + su2double u = u_0 * (r - 1.0) * (2.0 - r) * 4.0; + su2double v = v_0 * (r - 1.0) * (2.0 - r) * 4.0; + su2double w = w_0 * (r - 1.0) * (2.0 - r) * 4.0; /* Compute the pressure from the density and temperature. */ su2double rho = rho_0; - su2double p = rho*RGas*T; + su2double p = rho * RGas * T; /* Determine the non-dimensional solution. */ rho /= Density_Ref; - p /= Pressure_Ref; - u /= Velocity_Ref; - v /= Velocity_Ref; - w /= Velocity_Ref; + p /= Pressure_Ref; + u /= Velocity_Ref; + v /= Velocity_Ref; + w /= Velocity_Ref; /* Determine the non-dimensional conserved variables. */ val_solution[0] = rho; - val_solution[1] = rho*u; - val_solution[2] = rho*v; - val_solution[3] = rho*w; - val_solution[4] = p/(Gamma-1.0) + 0.5*rho*(u*u + v*v + w*w); + val_solution[1] = rho * u; + val_solution[2] = rho * v; + val_solution[3] = rho * w; + val_solution[4] = p / (Gamma - 1.0) + 0.5 * rho * (u * u + v * v + w * w); } -void CMMSNSTwoHalfSpheresSolution::GetMMSSourceTerm(const su2double *val_coords, - const su2double val_t, - su2double *val_source) const { - +void CMMSNSTwoHalfSpheresSolution::GetMMSSourceTerm(const su2double* val_coords, const su2double val_t, + su2double* val_source) const { /*--- Abbreviate Pi and the coordinates. ---*/ const su2double Pi = PI_NUMBER; const su2double x = val_coords[0]; @@ -176,7 +158,7 @@ void CMMSNSTwoHalfSpheresSolution::GetMMSSourceTerm(const su2double *val_coords, /*--- The source code for the source terms is generated in Maple. See the file CMMSNSTwoHalfSpheresSolution.mw in the directory - CreateMMSSourceTerms for the details how to do this. ---*/ + CreateMMSSourceTerms for the details how to do this. ---*/ const su2double t1 = rho_0 * u_0; const su2double t2 = x * x; const su2double t3 = y * y; @@ -253,10 +235,11 @@ void CMMSNSTwoHalfSpheresSolution::GetMMSSourceTerm(const su2double *val_coords, const su2double t134 = t111 * t129; const su2double t135 = t89 * Viscosity; const su2double t136 = z * t135; - const su2double t139 = 0.32e2 * t34 * t12 * t30 - 0.32e2 * t10 * t37 * t30 + t71 + 0.16e2 / 0.3e1 * t78 * x * t73 - + 0.16e2 / 0.3e1 * t85 * t84 - 0.8e1 / 0.3e1 * x * t90 * t84 + 0.32e2 * t17 * t95 * t94 - - 0.32e2 * t17 * t100 * t99 + 0.8e1 * t108 * t104 + 0.16e2 * t85 * t112 - 0.8e1 * y * t115 * t112 - + 0.32e2 * t120 * t94 - 0.32e2 * t124 * t99 + 0.8e1 * t131 * t130 - 0.8e1 * t136 * t134; + const su2double t139 = 0.32e2 * t34 * t12 * t30 - 0.32e2 * t10 * t37 * t30 + t71 + 0.16e2 / 0.3e1 * t78 * x * t73 + + 0.16e2 / 0.3e1 * t85 * t84 - 0.8e1 / 0.3e1 * x * t90 * t84 + 0.32e2 * t17 * t95 * t94 - + 0.32e2 * t17 * t100 * t99 + 0.8e1 * t108 * t104 + 0.16e2 * t85 * t112 - + 0.8e1 * y * t115 * t112 + 0.32e2 * t120 * t94 - 0.32e2 * t124 * t99 + 0.8e1 * t131 * t130 - + 0.8e1 * t136 * t134; const su2double t146 = x * t72; const su2double t155 = v_0 * v_0; const su2double t156 = t155 * rho_0; @@ -271,11 +254,11 @@ void CMMSNSTwoHalfSpheresSolution::GetMMSSourceTerm(const su2double *val_coords, const su2double t195 = v_0 * z + w_0 * y; const su2double t196 = t72 * t195; const su2double t199 = t111 * t195; - const su2double t202 = 0.32e2 * t8 * t95 * t94 - 0.32e2 * t8 * t100 * t99 + 0.8e1 * t108 * t146 - + 0.80e2 / 0.3e1 * t7 * v_0 * t112 - 0.8e1 * x * t115 * t112 + 0.32e2 * t158 * t12 * t156 - - 0.32e2 * t18 * t37 * t156 + t177 + 0.16e2 / 0.3e1 * y * t180 * t135 - - 0.16e2 / 0.3e1 * y * t179 * t73 + 0.32e2 * t120 * t187 - 0.32e2 * t124 * t190 - + 0.8e1 * t131 * t196 - 0.8e1 * t136 * t199; + const su2double t202 = 0.32e2 * t8 * t95 * t94 - 0.32e2 * t8 * t100 * t99 + 0.8e1 * t108 * t146 + + 0.80e2 / 0.3e1 * t7 * v_0 * t112 - 0.8e1 * x * t115 * t112 + 0.32e2 * t158 * t12 * t156 - + 0.32e2 * t18 * t37 * t156 + t177 + 0.16e2 / 0.3e1 * y * t180 * t135 - + 0.16e2 / 0.3e1 * y * t179 * t73 + 0.32e2 * t120 * t187 - 0.32e2 * t124 * t190 + + 0.8e1 * t131 * t196 - 0.8e1 * t136 * t199; const su2double t209 = t111 * w_0; const su2double t231 = w_0 * w_0; const su2double t232 = t231 * rho_0; @@ -285,11 +268,11 @@ void CMMSNSTwoHalfSpheresSolution::GetMMSSourceTerm(const su2double *val_coords, const su2double t253 = t252 * t41; const su2double t255 = t74 + t76 - 0.2e1 * t77; const su2double t256 = t111 * t255; - const su2double t263 = 0.32e2 * t8 * t119 * t94 - 0.32e2 * t8 * t123 * t99 + 0.80e2 / 0.3e1 * t7 * Viscosity * t209 - + 0.8e1 * x * Viscosity * t130 - 0.8e1 * x * t135 * t134 + 0.32e2 * t17 * t119 * t187 - - 0.32e2 * t17 * t123 * t190 + 0.8e1 * y * Viscosity * t196 - 0.8e1 * y * t135 * t199 - + 0.32e2 * t234 * t12 * t232 - 0.32e2 * t24 * t37 * t232 + t253 - + 0.16e2 / 0.3e1 * z * t256 * t135 - 0.16e2 / 0.3e1 * z * t255 * t73; + const su2double t263 = 0.32e2 * t8 * t119 * t94 - 0.32e2 * t8 * t123 * t99 + 0.80e2 / 0.3e1 * t7 * Viscosity * t209 + + 0.8e1 * x * Viscosity * t130 - 0.8e1 * x * t135 * t134 + 0.32e2 * t17 * t119 * t187 - + 0.32e2 * t17 * t123 * t190 + 0.8e1 * y * Viscosity * t196 - 0.8e1 * y * t135 * t199 + + 0.32e2 * t234 * t12 * t232 - 0.32e2 * t24 * t37 * t232 + t253 + + 0.16e2 / 0.3e1 * z * t256 * t135 - 0.16e2 / 0.3e1 * z * t255 * t73; const su2double t265 = t12 * u_0; const su2double t266 = x * t9; const su2double t270 = t115 * t112; @@ -308,11 +291,12 @@ void CMMSNSTwoHalfSpheresSolution::GetMMSSourceTerm(const su2double *val_coords, const su2double t316 = t305 * Viscosity * w_0; const su2double t319 = Viscosity * t134; const su2double t320 = w_0 * t72; - const su2double t329 = -0.32e2 / 0.3e1 * t266 * t265 * t90 * t84 - 0.32e2 * t266 * t271 * t270 - - 0.32e2 * t266 * t276 * t275 - 0.32e2 * t280 * t265 * t270 + 0.64e2 / 0.3e1 * t285 * t180 * t135 - - 0.32e2 * t280 * t276 * t288 - 0.32e2 * t292 * t265 * t275 - 0.32e2 * t292 * t271 * t288 - + 0.64e2 / 0.3e1 * t300 * t256 * t135 + 0.32e2 * t305 * v_0 * t107 * t303 + 0.32e2 * t266 * t310 * t309 - + 0.32e2 * t316 * x * t130 + 0.32e2 * t266 * t320 * t319 + 0.32e2 * t305 * u_0 * t107 * Viscosity * t104; + const su2double t329 = + -0.32e2 / 0.3e1 * t266 * t265 * t90 * t84 - 0.32e2 * t266 * t271 * t270 - 0.32e2 * t266 * t276 * t275 - + 0.32e2 * t280 * t265 * t270 + 0.64e2 / 0.3e1 * t285 * t180 * t135 - 0.32e2 * t280 * t276 * t288 - + 0.32e2 * t292 * t265 * t275 - 0.32e2 * t292 * t271 * t288 + 0.64e2 / 0.3e1 * t300 * t256 * t135 + + 0.32e2 * t305 * v_0 * t107 * t303 + 0.32e2 * t266 * t310 * t309 + 0.32e2 * t316 * x * t130 + + 0.32e2 * t266 * t320 * t319 + 0.32e2 * t305 * u_0 * t107 * Viscosity * t104; const su2double t330 = u_0 * t72; const su2double t334 = t179 * t73; const su2double t337 = v_0 * t111; @@ -333,13 +317,14 @@ void CMMSNSTwoHalfSpheresSolution::GetMMSSourceTerm(const su2double *val_coords, const su2double t412 = t12 * t89 * t410; const su2double t421 = t78 * t84; const su2double t422 = x * t12; - const su2double t426 = 0.32e2 * t280 * t330 * t309 - 0.64e2 / 0.3e1 * t285 * t334 - 0.64e2 / 0.3e1 * t280 * t337 * t334 - + 0.32e2 * t316 * y * t196 + 0.32e2 * t280 * t320 * t344 + 0.32e2 * t305 * Viscosity * u_0 * z * t130 - + 0.32e2 * t292 * t330 * t319 + 0.32e2 * t305 * Viscosity * v_0 * z * t196 + 0.32e2 * t292 * t310 * t344 - - 0.64e2 / 0.3e1 * t300 * t364 - 0.64e2 / 0.3e1 * t292 * t209 * t364 - + 0.4e1 * t400 * TWall * x * t12 * t7 * (t377 * x * t371 - t12 * a_T2 * x * t381 + Pi * t8 * t385 - + 0.2e1 * a_T2 * t58 * x * t389 + t60 / 0.2e1) - 0.4e1 * t400 * t2 * TWall - * t412 + 0.64e2 / 0.3e1 * t305 * u_0 * t78 * t303 - 0.32e2 / 0.3e1 * t422 * t330 * t421; + const su2double t426 = + 0.32e2 * t280 * t330 * t309 - 0.64e2 / 0.3e1 * t285 * t334 - 0.64e2 / 0.3e1 * t280 * t337 * t334 + + 0.32e2 * t316 * y * t196 + 0.32e2 * t280 * t320 * t344 + 0.32e2 * t305 * Viscosity * u_0 * z * t130 + + 0.32e2 * t292 * t330 * t319 + 0.32e2 * t305 * Viscosity * v_0 * z * t196 + 0.32e2 * t292 * t310 * t344 - + 0.64e2 / 0.3e1 * t300 * t364 - 0.64e2 / 0.3e1 * t292 * t209 * t364 + + 0.4e1 * t400 * TWall * x * t12 * t7 * + (t377 * x * t371 - t12 * a_T2 * x * t381 + Pi * t8 * t385 + 0.2e1 * a_T2 * t58 * x * t389 + t60 / 0.2e1) - + 0.4e1 * t400 * t2 * TWall * t412 + 0.64e2 / 0.3e1 * t305 * u_0 * t78 * t303 - 0.32e2 / 0.3e1 * t422 * t330 * t421; const su2double t457 = y * t12; const su2double t483 = t400 * TWall * t12; const su2double t486 = t410 * t4; @@ -351,14 +336,18 @@ void CMMSNSTwoHalfSpheresSolution::GetMMSSourceTerm(const su2double *val_coords, const su2double t515 = t37 * t231; const su2double t521 = t508 * t506 * t41 + 0.8e1 * (t32 * t511 + t32 * t513 + t32 * t515) * rho_0 + t506 * t41; const su2double t522 = u_0 * t521; - const su2double t527 = -0.32e2 * t422 * t310 * t309 - 0.32e2 * t422 * t320 * t319 - + 0.4e1 * t400 * y * TWall * t12 * t7 * (t377 * y * t371 - t12 * a_T2 * y * t381 + Pi * t17 * t385 - + 0.2e1 * a_T2 * t58 * y * t389 + t168 / 0.2e1) - 0.4e1 * t400 * TWall * t3 * t412 - - 0.32e2 * t457 * t330 * t309 + 0.64e2 / 0.3e1 * t457 * t337 * t334 - 0.32e2 * t457 * t320 * t344 - + 0.4e1 * t483 * t7 * (t377 * z * t371 - t12 * a_T2 * z * t381 + Pi * t23 * t385 - + 0.2e1 * a_T2 * t58 * z * t389 + t244 / 0.2e1) * z - 0.4e1 * t483 * t89 * t486 - - 0.32e2 * t490 * t330 * t319 - 0.32e2 * t490 * t310 * t344 + 0.64e2 / 0.3e1 * t490 * t209 * t364 - + 0.32e2 / 0.3e1 * t266 * t330 * t421 + 0.4e1 * t10 * t522 - 0.4e1 * t14 * t522; + const su2double t527 = + -0.32e2 * t422 * t310 * t309 - 0.32e2 * t422 * t320 * t319 + + 0.4e1 * t400 * y * TWall * t12 * t7 * + (t377 * y * t371 - t12 * a_T2 * y * t381 + Pi * t17 * t385 + 0.2e1 * a_T2 * t58 * y * t389 + t168 / 0.2e1) - + 0.4e1 * t400 * TWall * t3 * t412 - 0.32e2 * t457 * t330 * t309 + 0.64e2 / 0.3e1 * t457 * t337 * t334 - + 0.32e2 * t457 * t320 * t344 + + 0.4e1 * t483 * t7 * + (t377 * z * t371 - t12 * a_T2 * z * t381 + Pi * t23 * t385 + 0.2e1 * a_T2 * t58 * z * t389 + t244 / 0.2e1) * + z - + 0.4e1 * t483 * t89 * t486 - 0.32e2 * t490 * t330 * t319 - 0.32e2 * t490 * t310 * t344 + + 0.64e2 / 0.3e1 * t490 * t209 * t364 + 0.32e2 / 0.3e1 * t266 * t330 * t421 + 0.4e1 * t10 * t522 - + 0.4e1 * t14 * t522; const su2double t528 = v_0 * t521; const su2double t533 = w_0 * t521; const su2double t541 = Conductivity * t399 * TWall; @@ -367,30 +356,35 @@ void CMMSNSTwoHalfSpheresSolution::GetMMSSourceTerm(const su2double *val_coords, const su2double t570 = t12 * t29; const su2double t573 = t12 * t155; const su2double t576 = t12 * t231; - const su2double t616 = 0.4e1 * t18 * t528 - 0.4e1 * t20 * t528 + 0.4e1 * t24 * t533 - 0.4e1 * t26 * t533 - + 0.12e2 * t541 * t12 * t7 * t410 + 0.320e3 / 0.3e1 * t545 * t155 * t112 - + 0.320e3 / 0.3e1 * t545 * Viscosity * t111 * t231 + 0.64e2 * t545 * t29 * t112 - + 0.64e2 / 0.3e1 * t545 * t29 * t84 + 0.4e1 * t541 * t2 * t558 + 0.4e1 * t541 * t3 * t558 - + 0.4e1 * t541 * t72 * t486 + 0.4e1 * t305 * u_0 * (t508 * t70 * t41 - + 0.16e2 * (-t10 * t511 - t10 * t513 - t10 * t515 + t34 * t570 + t34 * t573 + t34 * t576) * rho_0 + t71) - + 0.4e1 * t305 * v_0 * (t508 * t176 * t41 + 0.16e2 * (t158 * t570 + t158 * t573 + t158 * t576 - - t18 * t511 - t18 * t513 - t18 * t515) * rho_0 + t177) + 0.4e1 * t305 * w_0 * (t508 * t252 * t41 - + 0.16e2 * (t234 * t570 + t234 * t573 + t234 * t576 - t24 * t511 - t24 * t513 - t24 * t515) * rho_0 + t253); + const su2double t616 = + 0.4e1 * t18 * t528 - 0.4e1 * t20 * t528 + 0.4e1 * t24 * t533 - 0.4e1 * t26 * t533 + + 0.12e2 * t541 * t12 * t7 * t410 + 0.320e3 / 0.3e1 * t545 * t155 * t112 + + 0.320e3 / 0.3e1 * t545 * Viscosity * t111 * t231 + 0.64e2 * t545 * t29 * t112 + + 0.64e2 / 0.3e1 * t545 * t29 * t84 + 0.4e1 * t541 * t2 * t558 + 0.4e1 * t541 * t3 * t558 + + 0.4e1 * t541 * t72 * t486 + + 0.4e1 * t305 * u_0 * + (t508 * t70 * t41 + + 0.16e2 * (-t10 * t511 - t10 * t513 - t10 * t515 + t34 * t570 + t34 * t573 + t34 * t576) * rho_0 + t71) + + 0.4e1 * t305 * v_0 * + (t508 * t176 * t41 + + 0.16e2 * (t158 * t570 + t158 * t573 + t158 * t576 - t18 * t511 - t18 * t513 - t18 * t515) * rho_0 + t177) + + 0.4e1 * t305 * w_0 * + (t508 * t252 * t41 + + 0.16e2 * (t234 * t570 + t234 * t573 + t234 * t576 - t24 * t511 - t24 * t513 - t24 * t515) * rho_0 + t253); /*--- Set the source term. Note the scaling for the correct non-dimensionalization. ---*/ - val_source[0] = 0.4e1 * t10 * t1 - 0.4e1 * t14 * t1 + 0.4e1 * t18 * t16 - 0.4e1 * t20 * t16 + 0.4e1 * t24 * t22 - 0.4e1 * t26 * t22; + val_source[0] = 0.4e1 * t10 * t1 - 0.4e1 * t14 * t1 + 0.4e1 * t18 * t16 - 0.4e1 * t20 * t16 + 0.4e1 * t24 * t22 - + 0.4e1 * t26 * t22; val_source[1] = t139; val_source[2] = t202; val_source[3] = t263; val_source[4] = t329 + t426 + t527 + t616; - val_source[0] /= Density_Ref*Velocity_Ref; + val_source[0] /= Density_Ref * Velocity_Ref; val_source[1] /= Pressure_Ref; val_source[2] /= Pressure_Ref; val_source[3] /= Pressure_Ref; - val_source[4] /= Velocity_Ref*Pressure_Ref; + val_source[4] /= Velocity_Ref * Pressure_Ref; } -bool CMMSNSTwoHalfSpheresSolution::IsManufacturedSolution(void) const { - return true; -} +bool CMMSNSTwoHalfSpheresSolution::IsManufacturedSolution() const { return true; } diff --git a/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolution.cpp b/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolution.cpp index 8a8f537f546..aad62acfa8f 100644 --- a/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolution.cpp +++ b/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolution.cpp @@ -2,7 +2,7 @@ * \file CMMSNSUnitQuadSolution.cpp * \brief Implementations of the member functions of CMMSNSUnitQuadSolution. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,14 +27,11 @@ #include "../../../include/toolboxes/MMS/CMMSNSUnitQuadSolution.hpp" -CMMSNSUnitQuadSolution::CMMSNSUnitQuadSolution(void) : CVerificationSolution() { } - -CMMSNSUnitQuadSolution::CMMSNSUnitQuadSolution(unsigned short val_nDim, - unsigned short val_nVar, - unsigned short val_iMesh, - CConfig* config) - : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { +CMMSNSUnitQuadSolution::CMMSNSUnitQuadSolution() : CVerificationSolution() {} +CMMSNSUnitQuadSolution::CMMSNSUnitQuadSolution(unsigned short val_nDim, unsigned short val_nVar, + unsigned short val_iMesh, CConfig* config) + : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { /*--- Write a message that the solution is initialized for the manufactured solution for the Navier-Stokes equations on a unit quad. ---*/ if ((rank == MASTER_NODE) && (val_iMesh == MESH_0)) { @@ -48,132 +45,116 @@ CMMSNSUnitQuadSolution::CMMSNSUnitQuadSolution(unsigned short val_nDim, /*--- Coefficients, needed to determine the solution. ---*/ const su2double Prandtl = config->GetPrandtl_Lam(); - RGas = config->GetGas_ConstantND(); - Gamma = config->GetGamma(); - Viscosity = config->GetMu_ConstantND(); - Conductivity = Viscosity*Gamma*RGas/(Prandtl*(Gamma-1.0)); + RGas = config->GetGas_ConstantND(); + Gamma = config->GetGamma(); + Viscosity = config->GetMu_ConstantND(); + Conductivity = Viscosity * Gamma * RGas / (Prandtl * (Gamma - 1.0)); /*--- Constants, which describe this manufactured solution. This is a viscous solution on the unit quad, where the primitive variables vary as a combination of sine and cosine functions. The unit quad is probably not necessary, and an arbitrary domain should work as well. ---*/ - L = 1.0; - a_Px = 1.0; - a_Pxy = 0.75; - a_Py = 1.25; - a_rhox = 0.75; - a_rhoxy = 1.25; - a_rhoy = 1.0; - a_ux = 1.6666666667; - a_uxy = 0.6; - a_uy = 1.5; - a_vx = 1.5; - a_vxy = 0.9; - a_vy = 1.0; - P_0 = 100000.0; - P_x = -30000.0; - P_xy = -25000.0; - P_y = 20000.0; - rho_0 = 1.0; - rho_x = 0.1; - rho_xy = 0.08; - rho_y = 0.15; - u_0 = 70.0; - u_x = 4.0; - u_xy = 7.0; - u_y = -12.0; - v_0 = 90.0; - v_x = -20.0; - v_xy = -11.0; - v_y = 4.0; + L = 1.0; + a_Px = 1.0; + a_Pxy = 0.75; + a_Py = 1.25; + a_rhox = 0.75; + a_rhoxy = 1.25; + a_rhoy = 1.0; + a_ux = 1.6666666667; + a_uxy = 0.6; + a_uy = 1.5; + a_vx = 1.5; + a_vxy = 0.9; + a_vy = 1.0; + P_0 = 100000.0; + P_x = -30000.0; + P_xy = -25000.0; + P_y = 20000.0; + rho_0 = 1.0; + rho_x = 0.1; + rho_xy = 0.08; + rho_y = 0.15; + u_0 = 70.0; + u_x = 4.0; + u_xy = 7.0; + u_y = -12.0; + v_0 = 90.0; + v_x = -20.0; + v_xy = -11.0; + v_y = 4.0; /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetTime_Marching() != TIME_MARCHING::STEADY) - SU2_MPI::Error("Steady mode must be selected for the MMS NS Unit Quad case", - CURRENT_FUNCTION); + if (config->GetTime_Marching() != TIME_MARCHING::STEADY) + SU2_MPI::Error("Steady mode must be selected for the MMS NS Unit Quad case", CURRENT_FUNCTION); - if(Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::RANS && - Kind_Solver != MAIN_SOLVER::FEM_EULER && Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::FEM_RANS && - Kind_Solver != MAIN_SOLVER::FEM_LES) SU2_MPI::Error("Compressible flow equations must be selected for the MMS NS Unit Quad case", - CURRENT_FUNCTION); + if (Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && + Kind_Solver != MAIN_SOLVER::RANS && Kind_Solver != MAIN_SOLVER::FEM_EULER && + Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::FEM_RANS && + Kind_Solver != MAIN_SOLVER::FEM_LES) + SU2_MPI::Error("Compressible flow equations must be selected for the MMS NS Unit Quad case", CURRENT_FUNCTION); - if((Kind_Solver != MAIN_SOLVER::NAVIER_STOKES) && - (Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES)) - SU2_MPI::Error("Navier Stokes equations must be selected for the MMS NS Unit Quad case", - CURRENT_FUNCTION); + if ((Kind_Solver != MAIN_SOLVER::NAVIER_STOKES) && (Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES)) + SU2_MPI::Error("Navier Stokes equations must be selected for the MMS NS Unit Quad case", CURRENT_FUNCTION); - if((config->GetKind_FluidModel() != STANDARD_AIR) && - (config->GetKind_FluidModel() != IDEAL_GAS)) - SU2_MPI::Error("Standard air or ideal gas must be selected for the MMS NS Unit Quad case", - CURRENT_FUNCTION); + if ((config->GetKind_FluidModel() != STANDARD_AIR) && (config->GetKind_FluidModel() != IDEAL_GAS)) + SU2_MPI::Error("Standard air or ideal gas must be selected for the MMS NS Unit Quad case", CURRENT_FUNCTION); - if(config->GetKind_ViscosityModel() != VISCOSITYMODEL::CONSTANT) - SU2_MPI::Error("Constant viscosity must be selected for the MMS NS Unit Quad case", - CURRENT_FUNCTION); + if (config->GetKind_ViscosityModel() != VISCOSITYMODEL::CONSTANT) + SU2_MPI::Error("Constant viscosity must be selected for the MMS NS Unit Quad case", CURRENT_FUNCTION); - if(config->GetKind_ConductivityModel() != CONDUCTIVITYMODEL::CONSTANT_PRANDTL) - SU2_MPI::Error("Constant Prandtl number must be selected for the MMS NS Unit Quad case", - CURRENT_FUNCTION); + if (config->GetKind_ConductivityModel() != CONDUCTIVITYMODEL::CONSTANT_PRANDTL) + SU2_MPI::Error("Constant Prandtl number must be selected for the MMS NS Unit Quad case", CURRENT_FUNCTION); } -CMMSNSUnitQuadSolution::~CMMSNSUnitQuadSolution(void) { } - -void CMMSNSUnitQuadSolution::GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { +CMMSNSUnitQuadSolution::~CMMSNSUnitQuadSolution() = default; +void CMMSNSUnitQuadSolution::GetBCState(const su2double* val_coords, const su2double val_t, + su2double* val_solution) const { /*--- The exact solution is prescribed on the boundaries. ---*/ GetSolution(val_coords, val_t, val_solution); } -void CMMSNSUnitQuadSolution::GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { - +void CMMSNSUnitQuadSolution::GetSolution(const su2double* val_coords, const su2double val_t, + su2double* val_solution) const { /* Easier storage of the x- and y-coordinates. */ const su2double x = val_coords[0]; const su2double y = val_coords[1]; /* Determine the solution for the density, velocity components and pressure. */ - const su2double LInv = 1.0/L; - const su2double PiLInv = PI_NUMBER*LInv; - const su2double PiL2Inv = PiLInv*LInv; + const su2double LInv = 1.0 / L; + const su2double PiLInv = PI_NUMBER * LInv; + const su2double PiL2Inv = PiLInv * LInv; - const su2double rho = rho_0 + rho_x *sin(a_rhox *PiLInv*x) - + rho_y *cos(a_rhoy *PiLInv*y) - + rho_xy*cos(a_rhoxy*PiL2Inv*x*y); + const su2double rho = rho_0 + rho_x * sin(a_rhox * PiLInv * x) + rho_y * cos(a_rhoy * PiLInv * y) + + rho_xy * cos(a_rhoxy * PiL2Inv * x * y); - const su2double u = u_0 + u_x *sin(a_ux *PiLInv*x) - + u_y *cos(a_uy *PiLInv*y) - + u_xy*cos(a_uxy*PiL2Inv*x*y); + const su2double u = + u_0 + u_x * sin(a_ux * PiLInv * x) + u_y * cos(a_uy * PiLInv * y) + u_xy * cos(a_uxy * PiL2Inv * x * y); - const su2double v = v_0 + v_x *cos(a_vx *PiLInv*x) - + v_y *sin(a_vy *PiLInv*y) - + v_xy*cos(a_vxy*PiL2Inv*x*y); + const su2double v = + v_0 + v_x * cos(a_vx * PiLInv * x) + v_y * sin(a_vy * PiLInv * y) + v_xy * cos(a_vxy * PiL2Inv * x * y); - const su2double p = P_0 + P_x *cos(a_Px *PiLInv*x) - + P_y *sin(a_Py *PiLInv*y) - + P_xy*sin(a_Pxy*PiL2Inv*x*y); + const su2double p = + P_0 + P_x * cos(a_Px * PiLInv * x) + P_y * sin(a_Py * PiLInv * y) + P_xy * sin(a_Pxy * PiL2Inv * x * y); /* Compute the conservative variables from the primitive ones. Note that the implementation below is valid for both 2D and 3D. */ - val_solution[0] = rho; - val_solution[1] = rho*u; - val_solution[2] = rho*v; - val_solution[3] = 0.0; - val_solution[nDim+1] = p/(Gamma-1.0) + 0.5*rho*(u*u + v*v); + val_solution[0] = rho; + val_solution[1] = rho * u; + val_solution[2] = rho * v; + val_solution[3] = 0.0; + val_solution[nDim + 1] = p / (Gamma - 1.0) + 0.5 * rho * (u * u + v * v); } -void CMMSNSUnitQuadSolution::GetMMSSourceTerm(const su2double *val_coords, - const su2double val_t, - su2double *val_source) const { - +void CMMSNSUnitQuadSolution::GetMMSSourceTerm(const su2double* val_coords, const su2double val_t, + su2double* val_source) const { /*--- The source code for the source terms is generated in Maple. See the file CMMSNSUnitQuadSolution.mw in the directory - CreateMMSSourceTerms for the details how to do this. ---*/ + CreateMMSSourceTerms for the details how to do this. ---*/ const su2double Pi = PI_NUMBER; - const su2double fourThird = 4.0/3.0; + const su2double fourThird = 4.0 / 3.0; const su2double x = val_coords[0]; const su2double y = val_coords[1]; @@ -263,7 +244,8 @@ void CMMSNSUnitQuadSolution::GetMMSSourceTerm(const su2double *val_coords, const su2double t143 = -t138 * t3 * t137 - t53 * t16 * t52; const su2double t147 = a_uy * a_uy; const su2double t150 = x * x; - const su2double t161 = (-t13 * (u_xy * t34 * t150 * t111 + t31 * Pi * t147) * Pi - t13 * (t122 + t125) * Pi) * Viscosity; + const su2double t161 = + (-t13 * (u_xy * t34 * t150 * t111 + t31 * Pi * t147) * Pi - t13 * (t122 + t125) * Pi) * Viscosity; const su2double t165 = v_x * a_vx; const su2double t166 = sin(t66); const su2double t171 = -t85 * t14 * t84 - t166 * t3 * t165; @@ -272,7 +254,8 @@ void CMMSNSUnitQuadSolution::GetMMSSourceTerm(const su2double *val_coords, const su2double t177 = a_uxy * t53; const su2double t178 = u_xy * t177; const su2double t182 = a_vx * a_vx; - const su2double t192 = (-t13 * (t176 + t178) * Pi - t13 * (v_xy * t75 * t112 * t118 + t68 * Pi * t182) * Pi) * Viscosity; + const su2double t192 = + (-t13 * (t176 + t178) * Pi - t13 * (v_xy * t75 * t112 * t118 + t68 * Pi * t182) * Pi) * Viscosity; const su2double t193 = t77 * t77; const su2double t200 = t28 * a_Py * Pi; const su2double t201 = cos(t200); @@ -291,7 +274,7 @@ void CMMSNSUnitQuadSolution::GetMMSSourceTerm(const su2double *val_coords, const su2double t237 = sin(t105); const su2double t238 = t237 * P_xy; const su2double t239 = P_0 + t234 + t236 + t238; - const su2double t243 = t221 * t239 + t223 * t46 / 0.2e1 + P_0 + t234 + t236 + t238; + const su2double t243 = t221 * t239 + t223 * t46 / 0.2e1 + P_0 + t234 + t236 + t238; const su2double t245 = a_Px * a_Px; const su2double t246 = Pi * t245; const su2double t248 = a_Pxy * a_Pxy; @@ -323,7 +306,8 @@ void CMMSNSUnitQuadSolution::GetMMSSourceTerm(const su2double *val_coords, const su2double t330 = t7 * t7; const su2double t331 = rho_x * rho_x; const su2double t336 = rho_0 * rho_0; - const su2double t337 = 0.2e1 * rho_x * rho_0 * t38 + t319 * t318 + 0.2e1 * t44 * t321 + t325 * t324 + 0.2e1 * t42 * t327 - t331 * t330 + t331 + t336; + const su2double t337 = 0.2e1 * rho_x * rho_0 * t38 + t319 * t318 + 0.2e1 * t44 * t321 + t325 * t324 + + 0.2e1 * t42 * t327 - t331 * t330 + t331 + t336; const su2double t338 = 0.1e1 / t337; const su2double t340 = 0.1e1 / RGas; const su2double t341 = t340 * t13; @@ -336,7 +320,8 @@ void CMMSNSUnitQuadSolution::GetMMSSourceTerm(const su2double *val_coords, const su2double t399 = t120 * t124; const su2double t402 = a_ux * u_x * t48; const su2double t404 = a_vy * v_y * t80; - const su2double t428 = (-t13 * (t137 * t138 * L + t174 * t177) * Pi - t13 * (t165 * t166 * L + v_xy * y * t124) * Pi) * Viscosity; + const su2double t428 = + (-t13 * (t137 * t138 * L + t174 * t177) * Pi - t13 * (t165 * t166 * L + v_xy * y * t124) * Pi) * Viscosity; const su2double t430 = t203 + t205; const su2double t442 = a_Py * a_Py; const su2double t446 = P_xy * t150 * t248; @@ -348,36 +333,54 @@ void CMMSNSUnitQuadSolution::GetMMSSourceTerm(const su2double *val_coords, const su2double t475 = t474 * rho_y; const su2double t480 = P_xy * t59; const su2double t486 = t235 * t2; - const su2double t564 = t36 * ( t221 * t219 + t223 * t22 / 0.2e1 + (t171 * t77 + t56 * t36) * t46 - t101 + t108) + t56 * t243 - + Conductivity * t341 * t338 * (t44 * (t234 * t246 + t252 * t250) * rho_xy - t267 * a_rhoxy * t264 - - t19 * t219 * y * t10 - t277 * t112 * t273 - t106 * t7 * t2 * t4 * P_xy * rho_x * t260 + t288 * t250 - + (t42 * P_x * t233 * t2 * Pi * rho_y * t245 - t238 * t38 * t2 * Pi * t291 - + t107 * t104 * t296 * t1 + t311 * t234 * t2 * t246 - t308 * t306 * t291) * L) * Pi; - const su2double t565 = -0.2e1 * (t44 * t7 * t3 * rho_xy * rho_x * a_rhox + t42 * t7 * t3 * rho_y * rho_x * a_rhox - + rho_x * rho_0 * t7 * t2 * t4 + t308 * a_rhox * t331 * t7 - t267 * t369 - t267 * t376) * Conductivity * t341 * t366 - * (t44 * t264 - t19 * t239 * y * t10 - t349 * t260 + (t311 * P_x * t99 * a_Px + t42 * t258 * a_Px * rho_y - + t237 * t296 * t1 + t7 * t306 * t1) * L) * Pi - fourThird * t36 * t132 * t131 - - fourThird * t56 * t132 * (-t398 + t399 / 0.2e1 + (t402 - t404 / 0.2e1) * L) * Pi; - const su2double t566 = -t77 * t192 - t171 * t428 + t77 * ( t221 * t430 + t223 * t64 / 0.2e1 + (t143 * t36 + t88 * t77) * t46 + t203 + t205) - + t88 * t243 - Conductivity * t340 * t338 * t13 * (t44 * (-t236 * Pi * t442 - t252 * t446) * rho_xy - - t460 * a_rhoxy * t457 + t19 * t430 * x * t10 + t277 * t150 * t273 - t106 * t59 * t2 * t40 * P_xy * rho_y * t454 - - t288 * t446 + (-P_y * t38 * t486 * Pi * rho_x * t442 - t42 * P_y * t486 * Pi * rho_y * t442 - - P_y * t486 * Pi * rho_0 * t442 + t238 * t42 * t2 * Pi * t475 + t204 * t104 * t480 * t58 - + t42 * t3 * t306 * t475) * L) * Pi; - const su2double t567 = 0.2e1 * (-t44 * t59 * t3 * rho_xy * rho_y * a_rhoy - - t60 * a_rhoy * t325 * t42 - t60 * a_rhoy * t327 - t460 * t369 - t460 * t376) * Conductivity * t340 * t366 * t13 - * (t44 * t457 + t19 * t239 * x * t10 + t349 * t454 + (P_y * t38 * t201 * a_Py * rho_x + t42 * t452 * a_Py * rho_y - + t452 * a_Py * rho_0 + t237 * t480 * t58 + t59 * t306 * t58) * L) * Pi - t36 * t161 - - t143 * t428 + 0.2e1 / 0.3e1 * t77 * t132 * t215 + 0.2e1 / 0.3e1 * t88 * t132 * (-t398 + 0.2e1 * t399 - + (t402 - 0.2e1 * t404) * L) * Pi; + const su2double t564 = + t36 * (t221 * t219 + t223 * t22 / 0.2e1 + (t171 * t77 + t56 * t36) * t46 - t101 + t108) + t56 * t243 + + Conductivity * t341 * t338 * + (t44 * (t234 * t246 + t252 * t250) * rho_xy - t267 * a_rhoxy * t264 - t19 * t219 * y * t10 - + t277 * t112 * t273 - t106 * t7 * t2 * t4 * P_xy * rho_x * t260 + t288 * t250 + + (t42 * P_x * t233 * t2 * Pi * rho_y * t245 - t238 * t38 * t2 * Pi * t291 + t107 * t104 * t296 * t1 + + t311 * t234 * t2 * t246 - t308 * t306 * t291) * + L) * + Pi; + const su2double t565 = + -0.2e1 * + (t44 * t7 * t3 * rho_xy * rho_x * a_rhox + t42 * t7 * t3 * rho_y * rho_x * a_rhox + + rho_x * rho_0 * t7 * t2 * t4 + t308 * a_rhox * t331 * t7 - t267 * t369 - t267 * t376) * + Conductivity * t341 * t366 * + (t44 * t264 - t19 * t239 * y * t10 - t349 * t260 + + (t311 * P_x * t99 * a_Px + t42 * t258 * a_Px * rho_y + t237 * t296 * t1 + t7 * t306 * t1) * L) * + Pi - + fourThird * t36 * t132 * t131 - fourThird * t56 * t132 * (-t398 + t399 / 0.2e1 + (t402 - t404 / 0.2e1) * L) * Pi; + const su2double t566 = + -t77 * t192 - t171 * t428 + + t77 * (t221 * t430 + t223 * t64 / 0.2e1 + (t143 * t36 + t88 * t77) * t46 + t203 + t205) + t88 * t243 - + Conductivity * t340 * t338 * t13 * + (t44 * (-t236 * Pi * t442 - t252 * t446) * rho_xy - t460 * a_rhoxy * t457 + t19 * t430 * x * t10 + + t277 * t150 * t273 - t106 * t59 * t2 * t40 * P_xy * rho_y * t454 - t288 * t446 + + (-P_y * t38 * t486 * Pi * rho_x * t442 - t42 * P_y * t486 * Pi * rho_y * t442 - + P_y * t486 * Pi * rho_0 * t442 + t238 * t42 * t2 * Pi * t475 + t204 * t104 * t480 * t58 + + t42 * t3 * t306 * t475) * + L) * + Pi; + const su2double t567 = 0.2e1 * + (-t44 * t59 * t3 * rho_xy * rho_y * a_rhoy - t60 * a_rhoy * t325 * t42 - + t60 * a_rhoy * t327 - t460 * t369 - t460 * t376) * + Conductivity * t340 * t366 * t13 * + (t44 * t457 + t19 * t239 * x * t10 + t349 * t454 + + (P_y * t38 * t201 * a_Py * rho_x + t42 * t452 * a_Py * rho_y + t452 * a_Py * rho_0 + + t237 * t480 * t58 + t59 * t306 * t58) * + L) * + Pi - + t36 * t161 - t143 * t428 + 0.2e1 / 0.3e1 * t77 * t132 * t215 + + 0.2e1 / 0.3e1 * t88 * t132 * (-t398 + 0.2e1 * t399 + (t402 - 0.2e1 * t404) * L) * Pi; - val_source[0] = t88 * t46 + t77 * t64 + t37 + t57; - val_source[1] = t91 * t22 + 0.2e1 * t56 * t93 - t101 + t108 - fourThird * t132 * t131 + t77 * t36 * t64 + t77 * t143 * t46 + t88 * t93 - t161; - val_source[2] = t77 * t37 + t77 * t57 + t171 * t93 - t192 + t193 * t64 + 0.2e1 * t88 * t77 * t46 + t203 + t205 + 0.2e1 / 0.3e1 * t132 * t215; - val_source[3] = 0.0; - val_source[nDim+1] = t564 + t565 + t566 + t567; + val_source[0] = t88 * t46 + t77 * t64 + t37 + t57; + val_source[1] = t91 * t22 + 0.2e1 * t56 * t93 - t101 + t108 - fourThird * t132 * t131 + t77 * t36 * t64 + + t77 * t143 * t46 + t88 * t93 - t161; + val_source[2] = t77 * t37 + t77 * t57 + t171 * t93 - t192 + t193 * t64 + 0.2e1 * t88 * t77 * t46 + t203 + t205 + + 0.2e1 / 0.3e1 * t132 * t215; + val_source[3] = 0.0; + val_source[nDim + 1] = t564 + t565 + t566 + t567; } -bool CMMSNSUnitQuadSolution::IsManufacturedSolution(void) const { - return true; -} +bool CMMSNSUnitQuadSolution::IsManufacturedSolution() const { return true; } diff --git a/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.cpp b/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.cpp index 32fc77ebe74..28a760c1949 100644 --- a/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.cpp +++ b/Common/src/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.cpp @@ -2,7 +2,7 @@ * \file CMMSNSUnitQuadSolutionWallBC.cpp * \brief Implementations of the member functions of CMMSNSUnitQuadSolutionWallBC. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,14 +27,11 @@ #include "../../../include/toolboxes/MMS/CMMSNSUnitQuadSolutionWallBC.hpp" -CMMSNSUnitQuadSolutionWallBC::CMMSNSUnitQuadSolutionWallBC(void) : CVerificationSolution() { } - -CMMSNSUnitQuadSolutionWallBC::CMMSNSUnitQuadSolutionWallBC(unsigned short val_nDim, - unsigned short val_nVar, - unsigned short val_iMesh, - CConfig* config) - : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { +CMMSNSUnitQuadSolutionWallBC::CMMSNSUnitQuadSolutionWallBC() : CVerificationSolution() {} +CMMSNSUnitQuadSolutionWallBC::CMMSNSUnitQuadSolutionWallBC(unsigned short val_nDim, unsigned short val_nVar, + unsigned short val_iMesh, CConfig* config) + : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { /*--- Write a message that the solution is initialized for the manufactured solution for the Navier-Stokes equations on a unit quad with no-slip wall boundary conditions. ---*/ @@ -50,17 +47,17 @@ CMMSNSUnitQuadSolutionWallBC::CMMSNSUnitQuadSolutionWallBC(unsigned short val_nD /*--- Coefficients, needed to determine the solution. ---*/ const su2double Prandtl = config->GetPrandtl_Lam(); - RGas = config->GetGas_Constant(); - Gamma = config->GetGamma(); - Viscosity = config->GetMu_Constant(); - Conductivity = Viscosity*Gamma*RGas/(Prandtl*(Gamma-1.0)); + RGas = config->GetGas_Constant(); + Gamma = config->GetGamma(); + Viscosity = config->GetMu_Constant(); + Conductivity = Viscosity * Gamma * RGas / (Prandtl * (Gamma - 1.0)); /*--- Initialize TWall to the default value of 300 K (in case the outer wall is not modelled as an isothermal wall) and try to retrieve the wall temperature from the boundary conditions. ---*/ TWall = 300.0; - for(unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if(config->GetMarker_All_KindBC(iMarker) == ISOTHERMAL) { + for (unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + if (config->GetMarker_All_KindBC(iMarker) == ISOTHERMAL) { const string Marker_Tag = config->GetMarker_All_TagBound(iMarker); TWall = config->GetIsothermal_Temperature(Marker_Tag); } @@ -68,105 +65,97 @@ CMMSNSUnitQuadSolutionWallBC::CMMSNSUnitQuadSolutionWallBC(unsigned short val_nD /*--- Get the reference values for pressure, density and velocity. ---*/ Pressure_Ref = config->GetPressure_Ref(); - Density_Ref = config->GetDensity_Ref(); + Density_Ref = config->GetDensity_Ref(); Velocity_Ref = config->GetVelocity_Ref(); /*--- The constants for the density and velocities. ---*/ - rho_0 = 1.25; - u_0 = 135.78; - v_0 = -67.61; + rho_0 = 1.25; + u_0 = 135.78; + v_0 = -67.61; /*--- The constants for the temperature solution. ---*/ - a_T1 = 1.05; + a_T1 = 1.05; a_T2 = -0.85; /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetTime_Marching() != TIME_MARCHING::STEADY) - SU2_MPI::Error("Steady mode must be selected for the MMS NS Unit Quad case with wall BCs.", - CURRENT_FUNCTION); + if (config->GetTime_Marching() != TIME_MARCHING::STEADY) + SU2_MPI::Error("Steady mode must be selected for the MMS NS Unit Quad case with wall BCs.", CURRENT_FUNCTION); - if(Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::RANS && - Kind_Solver != MAIN_SOLVER::FEM_EULER && Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::FEM_RANS && - Kind_Solver != MAIN_SOLVER::FEM_LES) + if (Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && + Kind_Solver != MAIN_SOLVER::RANS && Kind_Solver != MAIN_SOLVER::FEM_EULER && + Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::FEM_RANS && + Kind_Solver != MAIN_SOLVER::FEM_LES) SU2_MPI::Error("Compressible flow equations must be selected for the MMS NS Unit Quad case with wall BCs.", CURRENT_FUNCTION); - if((Kind_Solver != MAIN_SOLVER::NAVIER_STOKES) && - (Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES)) + if ((Kind_Solver != MAIN_SOLVER::NAVIER_STOKES) && (Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES)) SU2_MPI::Error("Navier Stokes equations must be selected for the MMS NS Unit Quad case with wall BCs.", CURRENT_FUNCTION); - if((config->GetKind_FluidModel() != STANDARD_AIR) && - (config->GetKind_FluidModel() != IDEAL_GAS)) + if ((config->GetKind_FluidModel() != STANDARD_AIR) && (config->GetKind_FluidModel() != IDEAL_GAS)) SU2_MPI::Error("Standard air or ideal gas must be selected for the MMS NS Unit Quad case with wall BCs.", CURRENT_FUNCTION); - if(config->GetKind_ViscosityModel() != VISCOSITYMODEL::CONSTANT) + if (config->GetKind_ViscosityModel() != VISCOSITYMODEL::CONSTANT) SU2_MPI::Error("Sutherland must be selected for viscosity for the MMS NS Unit Quad case with wall BCs.", CURRENT_FUNCTION); - if(config->GetKind_ConductivityModel() != CONDUCTIVITYMODEL::CONSTANT_PRANDTL) + if (config->GetKind_ConductivityModel() != CONDUCTIVITYMODEL::CONSTANT_PRANDTL) SU2_MPI::Error("Constant Prandtl number must be selected for the MMS NS Unit Quad case with wall BCs.", CURRENT_FUNCTION); } -CMMSNSUnitQuadSolutionWallBC::~CMMSNSUnitQuadSolutionWallBC(void) { } - -void CMMSNSUnitQuadSolutionWallBC::GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { +CMMSNSUnitQuadSolutionWallBC::~CMMSNSUnitQuadSolutionWallBC() = default; +void CMMSNSUnitQuadSolutionWallBC::GetBCState(const su2double* val_coords, const su2double val_t, + su2double* val_solution) const { /*--- The exact solution is prescribed on the boundaries. ---*/ GetSolution(val_coords, val_t, val_solution); } -void CMMSNSUnitQuadSolutionWallBC::GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { +void CMMSNSUnitQuadSolutionWallBC::GetSolution(const su2double* val_coords, const su2double val_t, + su2double* val_solution) const { /* Easier storage of the y-coordinate. */ const su2double y = val_coords[1]; /* Determine the dimensional solution for the temperature. */ - const su2double Pi = PI_NUMBER; - const su2double fact = y*y/(a_T1 + a_T2); + const su2double Pi = PI_NUMBER; + const su2double fact = y * y / (a_T1 + a_T2); - su2double T = 0.25*TWall*(3.0 + fact*(a_T1*cos(Pi*(y-1.0)) - + a_T2*cos(Pi*(y-1.0)*2.0))); + su2double T = 0.25 * TWall * (3.0 + fact * (a_T1 * cos(Pi * (y - 1.0)) + a_T2 * cos(Pi * (y - 1.0) * 2.0))); /* Determine the dimensional solution for the velocities. */ - su2double u = u_0*y*(1.0-y)*4.0; - su2double v = v_0*y*(1.0-y)*4.0; + su2double u = u_0 * y * (1.0 - y) * 4.0; + su2double v = v_0 * y * (1.0 - y) * 4.0; /* Compute the pressure from the density and temperature. */ su2double rho = rho_0; - su2double p = rho*RGas*T; + su2double p = rho * RGas * T; /* Determine the non-dimensional solution. */ rho /= Density_Ref; - p /= Pressure_Ref; - u /= Velocity_Ref; - v /= Velocity_Ref; + p /= Pressure_Ref; + u /= Velocity_Ref; + v /= Velocity_Ref; /* Compute the conservative variables from the primitive ones. Note that the implementation below is valid for both 2D and 3D. */ - val_solution[0] = rho; - val_solution[1] = rho*u; - val_solution[2] = rho*v; - val_solution[3] = 0.0; - val_solution[nDim+1] = p/(Gamma-1.0) + 0.5*rho*(u*u + v*v); + val_solution[0] = rho; + val_solution[1] = rho * u; + val_solution[2] = rho * v; + val_solution[3] = 0.0; + val_solution[nDim + 1] = p / (Gamma - 1.0) + 0.5 * rho * (u * u + v * v); } -void CMMSNSUnitQuadSolutionWallBC::GetMMSSourceTerm(const su2double *val_coords, - const su2double val_t, - su2double *val_source) const { - +void CMMSNSUnitQuadSolutionWallBC::GetMMSSourceTerm(const su2double* val_coords, const su2double val_t, + su2double* val_source) const { /*--- Abbreviate Pi and the y-coordinate. ---*/ const su2double Pi = PI_NUMBER; const su2double y = val_coords[1]; /*--- The source code for the source terms is generated in Maple. See the file CMMSNSUnitQuadSolutionWallBC.mw in the directory - CreateMMSSourceTerms for the details how to do this. ---*/ + CreateMMSSourceTerms for the details how to do this. ---*/ const su2double t1 = (v_0 * rho_0); const su2double t2 = 1.0 - y; const su2double t6 = rho_0 * u_0; @@ -210,27 +199,31 @@ void CMMSNSUnitQuadSolutionWallBC::GetMMSSourceTerm(const su2double *val_coords, const su2double t118 = a_T2 * y; const su2double t138 = Viscosity * (-8.0 * y + 4.0); const su2double t149 = Viscosity * (2.0 * y - 1.0); - const su2double t155 = 0.4e1 * t75 * v_0 * (t57 * t50 * t26 / 0.4e1 + (16.0 * (-t2 * t64 - t2 * t68 + t7 * t62 + t7 * t66) * rho_0) + t52) - + 0.4e1 * t2 * t92 - 0.4e1 * y * t92 - Conductivity * t111 * (-t102 * Pi * t41 - 0.4e1 * y * t43 * t97 + 0.4e1 * t104 * a_T2 - - 0.2e1 * a_T2 + 0.2e1 * t32) * TWall - Conductivity * t111 * (-t102 * t31 * t115 - 0.4e1 * t118 * t115 * t104 - + 0.4e1 * t118 * t116 * t115 - 0.12e2 * t43 * t97 - 0.3e1 * t42) * TWall * y + (32.0 * t75 * t61 * Viscosity) - - (4.0 * t2 * t61 * t138) + (4.0 * t62 * t138) + 0.128e3 / 0.3e1 * t75 * t20 * Viscosity + 0.64e2 / 0.3e1 * t2 * t20 * t149 - - 0.64e2 / 0.3e1 * t66 * t149; + const su2double t155 = + 0.4e1 * t75 * v_0 * + (t57 * t50 * t26 / 0.4e1 + (16.0 * (-t2 * t64 - t2 * t68 + t7 * t62 + t7 * t66) * rho_0) + t52) + + 0.4e1 * t2 * t92 - 0.4e1 * y * t92 - + Conductivity * t111 * + (-t102 * Pi * t41 - 0.4e1 * y * t43 * t97 + 0.4e1 * t104 * a_T2 - 0.2e1 * a_T2 + 0.2e1 * t32) * TWall - + Conductivity * t111 * + (-t102 * t31 * t115 - 0.4e1 * t118 * t115 * t104 + 0.4e1 * t118 * t116 * t115 - 0.12e2 * t43 * t97 - + 0.3e1 * t42) * + TWall * y + + (32.0 * t75 * t61 * Viscosity) - (4.0 * t2 * t61 * t138) + (4.0 * t62 * t138) + + 0.128e3 / 0.3e1 * t75 * t20 * Viscosity + 0.64e2 / 0.3e1 * t2 * t20 * t149 - 0.64e2 / 0.3e1 * t66 * t149; /*--- Set the source term, which is valid for both 2D and 3D cases. Note the scaling for the correct non-dimensionalization. ---*/ - val_source[0] = 4.0 * t2 * t1 - 4.0 * y * t1; - val_source[1] = (-0.32e2 * v_0 * t13 * t6 + 0.32e2 * v_0 * t8 * t6 + (8.0 * Viscosity * u_0)); - val_source[2] = ((32.0 * t8 * t21) - (32.0 * t13 * t21) + t52 + 0.32e2 / 0.3e1 * Viscosity * v_0); - val_source[3] = 0.0; - val_source[nDim+1] = t155; - - val_source[0] /= Density_Ref*Velocity_Ref; - val_source[1] /= Pressure_Ref; - val_source[2] /= Pressure_Ref; - val_source[nDim+1] /= Velocity_Ref*Pressure_Ref; + val_source[0] = 4.0 * t2 * t1 - 4.0 * y * t1; + val_source[1] = (-0.32e2 * v_0 * t13 * t6 + 0.32e2 * v_0 * t8 * t6 + (8.0 * Viscosity * u_0)); + val_source[2] = ((32.0 * t8 * t21) - (32.0 * t13 * t21) + t52 + 0.32e2 / 0.3e1 * Viscosity * v_0); + val_source[3] = 0.0; + val_source[nDim + 1] = t155; + + val_source[0] /= Density_Ref * Velocity_Ref; + val_source[1] /= Pressure_Ref; + val_source[2] /= Pressure_Ref; + val_source[nDim + 1] /= Velocity_Ref * Pressure_Ref; } -bool CMMSNSUnitQuadSolutionWallBC::IsManufacturedSolution(void) const { - return true; -} +bool CMMSNSUnitQuadSolutionWallBC::IsManufacturedSolution() const { return true; } diff --git a/Common/src/toolboxes/MMS/CNSUnitQuadSolution.cpp b/Common/src/toolboxes/MMS/CNSUnitQuadSolution.cpp index f3b9519e379..be18f90ab88 100644 --- a/Common/src/toolboxes/MMS/CNSUnitQuadSolution.cpp +++ b/Common/src/toolboxes/MMS/CNSUnitQuadSolution.cpp @@ -2,7 +2,7 @@ * \file CNSUnitQuadSolution.cpp * \brief Implementations of the member functions of CNSUnitQuadSolution. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,14 +27,11 @@ #include "../../../include/toolboxes/MMS/CNSUnitQuadSolution.hpp" -CNSUnitQuadSolution::CNSUnitQuadSolution(void) : CVerificationSolution() { } - -CNSUnitQuadSolution::CNSUnitQuadSolution(unsigned short val_nDim, - unsigned short val_nVar, - unsigned short val_iMesh, - CConfig* config) - : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { +CNSUnitQuadSolution::CNSUnitQuadSolution() : CVerificationSolution() {} +CNSUnitQuadSolution::CNSUnitQuadSolution(unsigned short val_nDim, unsigned short val_nVar, unsigned short val_iMesh, + CConfig* config) + : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { /*--- Write a message that the solution is initialized for the Navier-Stokes case on a unit quad. Note that heat conduction is neglected for this case. ---*/ @@ -49,75 +46,61 @@ CNSUnitQuadSolution::CNSUnitQuadSolution(unsigned short val_nDim, } /*--- Coefficients, needed to determine the solution. ---*/ - Gm1 = config->GetGamma() - 1.0; - flowAngle = config->GetAoA()*PI_NUMBER/180.0; + Gm1 = config->GetGamma() - 1.0; + flowAngle = config->GetAoA() * PI_NUMBER / 180.0; Viscosity = config->GetMu_ConstantND(); /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetTime_Marching() != TIME_MARCHING::STEADY) - SU2_MPI::Error("Steady mode must be selected for the NS Unit Quad case", - CURRENT_FUNCTION); - - if(Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::RANS && - Kind_Solver != MAIN_SOLVER::FEM_EULER && Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::FEM_RANS && - Kind_Solver != MAIN_SOLVER::FEM_LES) - SU2_MPI::Error("Compressible flow equations must be selected for the NS Unit Quad case", - CURRENT_FUNCTION); - - if((Kind_Solver != MAIN_SOLVER::NAVIER_STOKES) && - (Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES)) - SU2_MPI::Error("Navier Stokes equations must be selected for the NS Unit Quad case", - CURRENT_FUNCTION); - - if(config->GetKind_FluidModel() != IDEAL_GAS) - SU2_MPI::Error("Ideal gas must be selected for the NS Unit Quad case", - CURRENT_FUNCTION); - - if(fabs(Gm1-0.5) > 1.e-8) - SU2_MPI::Error("Gamma must be 1.5 for the NS Unit Quad case", - CURRENT_FUNCTION); - - if(config->GetKind_ViscosityModel() != VISCOSITYMODEL::CONSTANT) - SU2_MPI::Error("Constant viscosity must be selected for the NS Unit Quad case", - CURRENT_FUNCTION); - - if(config->GetKind_ConductivityModel() != CONDUCTIVITYMODEL::CONSTANT_PRANDTL) - SU2_MPI::Error("Constant Prandtl number must be selected for the NS Unit Quad case", - CURRENT_FUNCTION); - - if(config->GetPrandtl_Lam() < 1.e+20) - SU2_MPI::Error("Laminar Prandtl number must be larger than 1.e+20 for the NS Unit Quad case", - CURRENT_FUNCTION); -} + if (config->GetTime_Marching() != TIME_MARCHING::STEADY) + SU2_MPI::Error("Steady mode must be selected for the NS Unit Quad case", CURRENT_FUNCTION); + + if (Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && + Kind_Solver != MAIN_SOLVER::RANS && Kind_Solver != MAIN_SOLVER::FEM_EULER && + Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::FEM_RANS && + Kind_Solver != MAIN_SOLVER::FEM_LES) + SU2_MPI::Error("Compressible flow equations must be selected for the NS Unit Quad case", CURRENT_FUNCTION); + + if ((Kind_Solver != MAIN_SOLVER::NAVIER_STOKES) && (Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES)) + SU2_MPI::Error("Navier Stokes equations must be selected for the NS Unit Quad case", CURRENT_FUNCTION); + + if (config->GetKind_FluidModel() != IDEAL_GAS) + SU2_MPI::Error("Ideal gas must be selected for the NS Unit Quad case", CURRENT_FUNCTION); -CNSUnitQuadSolution::~CNSUnitQuadSolution(void) { } + if (fabs(Gm1 - 0.5) > 1.e-8) SU2_MPI::Error("Gamma must be 1.5 for the NS Unit Quad case", CURRENT_FUNCTION); -void CNSUnitQuadSolution::GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { + if (config->GetKind_ViscosityModel() != VISCOSITYMODEL::CONSTANT) + SU2_MPI::Error("Constant viscosity must be selected for the NS Unit Quad case", CURRENT_FUNCTION); + if (config->GetKind_ConductivityModel() != CONDUCTIVITYMODEL::CONSTANT_PRANDTL) + SU2_MPI::Error("Constant Prandtl number must be selected for the NS Unit Quad case", CURRENT_FUNCTION); + + if (config->GetPrandtl_Lam() < 1.e+20) + SU2_MPI::Error("Laminar Prandtl number must be larger than 1.e+20 for the NS Unit Quad case", CURRENT_FUNCTION); +} + +CNSUnitQuadSolution::~CNSUnitQuadSolution() = default; + +void CNSUnitQuadSolution::GetBCState(const su2double* val_coords, const su2double val_t, + su2double* val_solution) const { /*--- The exact solution is prescribed on the boundaries. ---*/ GetSolution(val_coords, val_t, val_solution); } -void CNSUnitQuadSolution::GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { - +void CNSUnitQuadSolution::GetSolution(const su2double* val_coords, const su2double val_t, + su2double* val_solution) const { /*--- Compute the flow direction and the coordinates in the rotated frame. ---*/ const su2double cosFlowAngle = cos(flowAngle); const su2double sinFlowAngle = sin(flowAngle); - const su2double xTilde = val_coords[0]*cosFlowAngle - val_coords[1]*sinFlowAngle; - const su2double yTilde = val_coords[0]*sinFlowAngle + val_coords[1]*cosFlowAngle; + const su2double xTilde = val_coords[0] * cosFlowAngle - val_coords[1] * sinFlowAngle; + const su2double yTilde = val_coords[0] * sinFlowAngle + val_coords[1] * cosFlowAngle; /*--- Compute the exact solution for this case. Note that it works both in 2D and 3D. ---*/ - val_solution[0] = 1.0; - val_solution[1] = cosFlowAngle*yTilde*yTilde; - val_solution[2] = -sinFlowAngle*yTilde*yTilde; - val_solution[3] = 0.0; - val_solution[nVar-1] = (2.0*Viscosity*xTilde + 10.0)/Gm1 - + 0.5*yTilde*yTilde*yTilde*yTilde; + val_solution[0] = 1.0; + val_solution[1] = cosFlowAngle * yTilde * yTilde; + val_solution[2] = -sinFlowAngle * yTilde * yTilde; + val_solution[3] = 0.0; + val_solution[nVar - 1] = (2.0 * Viscosity * xTilde + 10.0) / Gm1 + 0.5 * yTilde * yTilde * yTilde * yTilde; } diff --git a/Common/src/toolboxes/MMS/CRinglebSolution.cpp b/Common/src/toolboxes/MMS/CRinglebSolution.cpp index 09012fbc4cb..5c3ead31234 100644 --- a/Common/src/toolboxes/MMS/CRinglebSolution.cpp +++ b/Common/src/toolboxes/MMS/CRinglebSolution.cpp @@ -2,7 +2,7 @@ * \file CRinglebSolution.cpp * \brief Implementations of the member functions of CRinglebSolution. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,14 +27,11 @@ #include "../../../include/toolboxes/MMS/CRinglebSolution.hpp" -CRinglebSolution::CRinglebSolution(void) : CVerificationSolution() { } - -CRinglebSolution::CRinglebSolution(unsigned short val_nDim, - unsigned short val_nVar, - unsigned short val_iMesh, - CConfig* config) - : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { +CRinglebSolution::CRinglebSolution() : CVerificationSolution() {} +CRinglebSolution::CRinglebSolution(unsigned short val_nDim, unsigned short val_nVar, unsigned short val_iMesh, + CConfig* config) + : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { /*--- Write a message that the solution is initialized for the Ringleb test case. ---*/ if ((rank == MASTER_NODE) && (val_iMesh == MESH_0)) { @@ -45,39 +42,31 @@ CRinglebSolution::CRinglebSolution(unsigned short val_nDim, } /*--- Useful coefficients in which Gamma is present. ---*/ - Gamma = config->GetGamma(); - Gm1 = Gamma - 1.0; - tovGm1 = 2.0/Gm1; - tGamOvGm1 = Gamma*tovGm1; + Gamma = config->GetGamma(); + Gm1 = Gamma - 1.0; + tovGm1 = 2.0 / Gm1; + tGamOvGm1 = Gamma * tovGm1; /*--- Perform some sanity and error checks for this solution here. ---*/ - if(config->GetTime_Marching() != TIME_MARCHING::STEADY) - SU2_MPI::Error("Steady mode must be selected for the Ringleb case", - CURRENT_FUNCTION); - - if(Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::RANS && - Kind_Solver != MAIN_SOLVER::FEM_EULER && Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::FEM_RANS && - Kind_Solver != MAIN_SOLVER::FEM_LES) - SU2_MPI::Error("Compressible flow equations must be selected for the Ringleb case", - CURRENT_FUNCTION); - - if((Kind_Solver != MAIN_SOLVER::EULER) && - (Kind_Solver != MAIN_SOLVER::FEM_EULER)) - SU2_MPI::Error("Euler equations must be selected for the Ringleb case", - CURRENT_FUNCTION); - - if((config->GetKind_FluidModel() != STANDARD_AIR) && - (config->GetKind_FluidModel() != IDEAL_GAS)) - SU2_MPI::Error("Standard air or ideal gas must be selected for the Ringleb case", - CURRENT_FUNCTION); -} + if (config->GetTime_Marching() != TIME_MARCHING::STEADY) + SU2_MPI::Error("Steady mode must be selected for the Ringleb case", CURRENT_FUNCTION); + + if (Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && + Kind_Solver != MAIN_SOLVER::RANS && Kind_Solver != MAIN_SOLVER::FEM_EULER && + Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::FEM_RANS && + Kind_Solver != MAIN_SOLVER::FEM_LES) + SU2_MPI::Error("Compressible flow equations must be selected for the Ringleb case", CURRENT_FUNCTION); + + if ((Kind_Solver != MAIN_SOLVER::EULER) && (Kind_Solver != MAIN_SOLVER::FEM_EULER)) + SU2_MPI::Error("Euler equations must be selected for the Ringleb case", CURRENT_FUNCTION); -CRinglebSolution::~CRinglebSolution(void) { } + if ((config->GetKind_FluidModel() != STANDARD_AIR) && (config->GetKind_FluidModel() != IDEAL_GAS)) + SU2_MPI::Error("Standard air or ideal gas must be selected for the Ringleb case", CURRENT_FUNCTION); +} -void CRinglebSolution::GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { +CRinglebSolution::~CRinglebSolution() = default; +void CRinglebSolution::GetBCState(const su2double* val_coords, const su2double val_t, su2double* val_solution) const { /*--- The exact solution is prescribed on the boundaries for the Ringleb flow. Note that a (much) more difficult test case is to use inviscid wall boundary conditions for the inner and outer @@ -85,13 +74,10 @@ void CRinglebSolution::GetBCState(const su2double *val_coords, GetSolution(val_coords, val_t, val_solution); } -void CRinglebSolution::GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { - +void CRinglebSolution::GetSolution(const su2double* val_coords, const su2double val_t, su2double* val_solution) const { /* Easier storage of the coordinates and abbreviate y*y. */ - const su2double x = val_coords[0], y = val_coords[1]; - const su2double y2 = y*y; + const su2double x = val_coords[0], y = val_coords[1]; + const su2double y2 = y * y; /* Initial guess for q (velocity magnitude) and k (streamline parameter). */ su2double k = 1.2; @@ -102,85 +88,85 @@ void CRinglebSolution::GetSolution(const su2double *val_coords, su2double duMaxPrev = 10.0; int iter; - for(iter=0; iter 1.0) alp = 0.04; - else if(dUMax > 0.1) alp = 0.2; + if (dUMax > 1.0) + alp = 0.04; + else if (dUMax > 0.1) + alp = 0.2; /* Update q and k. */ - q -= alp*dU[0]; - k -= alp*dU[1]; + q -= alp * dU[0]; + k -= alp * dU[1]; /* Convergence check, which is independent of the precision used. */ - if((dUMax < 1.e-3) && (dUMax >= duMaxPrev)) break; + if ((dUMax < 1.e-3) && (dUMax >= duMaxPrev)) break; duMaxPrev = dUMax; } /* Check if the Newton algorithm actually converged. */ - if(iter == iterMax) - SU2_MPI::Error("Newton algorithm did not converge", CURRENT_FUNCTION); + if (iter == iterMax) SU2_MPI::Error("Newton algorithm did not converge", CURRENT_FUNCTION); /* Compute the speed of sound, density and pressure. */ - const su2double a = sqrt(1.0 - 0.5*Gm1*q*q); - const su2double rho = pow(a,tovGm1); - const su2double p = pow(a,tGamOvGm1)/Gamma; + const su2double a = sqrt(1.0 - 0.5 * Gm1 * q * q); + const su2double rho = pow(a, tovGm1); + const su2double p = pow(a, tGamOvGm1) / Gamma; /* Determine the derivative of x w.r.t. q and ydxdq. */ - const su2double dadq = -0.5*Gm1*q/a; - const su2double drhodq = 2.0*rho*dadq/(Gm1*a); - const su2double dJJdq = dadq/(pow(a,6)*(a*a-1.0)); + const su2double dadq = -0.5 * Gm1 * q / a; + const su2double drhodq = 2.0 * rho * dadq / (Gm1 * a); + const su2double dJJdq = dadq / (pow(a, 6) * (a * a - 1.0)); - const su2double dxdq = -(1.0/(k*k) - 0.5/(q*q))*drhodq/(rho*rho) - + 1.0/(rho*q*q*q) - 0.5*dJJdq; - const su2double ydxdq = y*dxdq; + const su2double dxdq = + -(1.0 / (k * k) - 0.5 / (q * q)) * drhodq / (rho * rho) + 1.0 / (rho * q * q * q) - 0.5 * dJJdq; + const su2double ydxdq = y * dxdq; /* Determine the derivative of 1/2 y2 w.r.t. q, which is ydydq. The reason is that ydydq is always well defined, while dydq is singular for y = 0. */ - const su2double ydydq = drhodq*(q*q-k*k)/(k*k*k*k*rho*rho*rho*q*q) - - 1.0/(k*k*rho*rho*q*q*q); + const su2double ydydq = + drhodq * (q * q - k * k) / (k * k * k * k * rho * rho * rho * q * q) - 1.0 / (k * k * rho * rho * q * q * q); /* Determine the direction of the streamline. */ - const su2double vecLen = sqrt(ydxdq*ydxdq + ydydq*ydydq); + const su2double vecLen = sqrt(ydxdq * ydxdq + ydydq * ydydq); - su2double velDir[] = {ydxdq/vecLen, ydydq/vecLen}; - if(velDir[1] > 0.0){velDir[0] = -velDir[0]; velDir[1] = -velDir[1];} + su2double velDir[] = {ydxdq / vecLen, ydydq / vecLen}; + if (velDir[1] > 0.0) { + velDir[0] = -velDir[0]; + velDir[1] = -velDir[1]; + } /* Compute the conservative variables. Note that both 2D and 3D cases are treated correctly. */ - val_solution[0] = rho; - val_solution[1] = rho*q*velDir[0]; - val_solution[2] = rho*q*velDir[1]; - val_solution[3] = 0.0; - val_solution[nVar-1] = p/Gm1 + 0.5*rho*q*q; + val_solution[0] = rho; + val_solution[1] = rho * q * velDir[0]; + val_solution[2] = rho * q * velDir[1]; + val_solution[3] = 0.0; + val_solution[nVar - 1] = p / Gm1 + 0.5 * rho * q * q; } diff --git a/Common/src/toolboxes/MMS/CTGVSolution.cpp b/Common/src/toolboxes/MMS/CTGVSolution.cpp index 77eaf387213..7393d9156fc 100644 --- a/Common/src/toolboxes/MMS/CTGVSolution.cpp +++ b/Common/src/toolboxes/MMS/CTGVSolution.cpp @@ -2,7 +2,7 @@ * \file CTGVSolution.cpp * \brief Implementations of the member functions of CTGVSolution. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,14 +27,10 @@ #include "../../../include/toolboxes/MMS/CTGVSolution.hpp" -CTGVSolution::CTGVSolution(void) : CVerificationSolution() { } - -CTGVSolution::CTGVSolution(unsigned short val_nDim, - unsigned short val_nVar, - unsigned short val_iMesh, - CConfig* config) - : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { +CTGVSolution::CTGVSolution() : CVerificationSolution() {} +CTGVSolution::CTGVSolution(unsigned short val_nDim, unsigned short val_nVar, unsigned short val_iMesh, CConfig* config) + : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { /*--- Write a message that the solution is initialized for the Taylor-Green vortex test case. ---*/ @@ -47,88 +43,74 @@ CTGVSolution::CTGVSolution(unsigned short val_nDim, /*--- Store TGV specific parameters here. ---*/ - tgvLength = 1.0; // Taylor-Green length scale. - tgvVelocity = 1.0; // Taylor-Green velocity. - tgvDensity = 1.0; // Taylor-Green density. - tgvPressure = 100.0; // Taylor-Green pressure. + tgvLength = 1.0; // Taylor-Green length scale. + tgvVelocity = 1.0; // Taylor-Green velocity. + tgvDensity = 1.0; // Taylor-Green density. + tgvPressure = 100.0; // Taylor-Green pressure. /*--- Useful coefficient in which Gamma is present. ---*/ - ovGm1 = 1.0/(config->GetGamma() - 1.0); + ovGm1 = 1.0 / (config->GetGamma() - 1.0); /*--- Perform some sanity and error checks for this solution here. ---*/ - if((config->GetTime_Marching() != TIME_MARCHING::TIME_STEPPING) && - (config->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_1ST) && - (config->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_2ND)) - SU2_MPI::Error("Unsteady mode must be selected for the Taylor Green Vortex", - CURRENT_FUNCTION); - - if(Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::RANS && - Kind_Solver != MAIN_SOLVER::FEM_EULER && Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::FEM_RANS && - Kind_Solver != MAIN_SOLVER::FEM_LES) - SU2_MPI::Error("Compressible flow equations must be selected for the Taylor Green Vortex", - CURRENT_FUNCTION); - - if((Kind_Solver != MAIN_SOLVER::NAVIER_STOKES) && - (Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES)) - SU2_MPI::Error("Navier Stokes equations must be selected for the Taylor Green Vortex", - CURRENT_FUNCTION); - - if((config->GetKind_FluidModel() != STANDARD_AIR) && - (config->GetKind_FluidModel() != IDEAL_GAS)) - SU2_MPI::Error("Standard air or ideal gas must be selected for the Taylor Green Vortex", - CURRENT_FUNCTION); - - if(config->GetKind_ViscosityModel() != VISCOSITYMODEL::CONSTANT) - SU2_MPI::Error("Constant viscosity must be selected for the Taylor Green Vortex", - CURRENT_FUNCTION); - - if(config->GetKind_ConductivityModel() != CONDUCTIVITYMODEL::CONSTANT_PRANDTL) - SU2_MPI::Error("Constant Prandtl number must be selected for the Taylor Green Vortex", - CURRENT_FUNCTION); -} + if ((config->GetTime_Marching() != TIME_MARCHING::TIME_STEPPING) && + (config->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_1ST) && + (config->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_2ND)) + SU2_MPI::Error("Unsteady mode must be selected for the Taylor Green Vortex", CURRENT_FUNCTION); + + if (Kind_Solver != MAIN_SOLVER::EULER && Kind_Solver != MAIN_SOLVER::NAVIER_STOKES && + Kind_Solver != MAIN_SOLVER::RANS && Kind_Solver != MAIN_SOLVER::FEM_EULER && + Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES && Kind_Solver != MAIN_SOLVER::FEM_RANS && + Kind_Solver != MAIN_SOLVER::FEM_LES) + SU2_MPI::Error("Compressible flow equations must be selected for the Taylor Green Vortex", CURRENT_FUNCTION); + + if ((Kind_Solver != MAIN_SOLVER::NAVIER_STOKES) && (Kind_Solver != MAIN_SOLVER::FEM_NAVIER_STOKES)) + SU2_MPI::Error("Navier Stokes equations must be selected for the Taylor Green Vortex", CURRENT_FUNCTION); -CTGVSolution::~CTGVSolution(void) { } + if ((config->GetKind_FluidModel() != STANDARD_AIR) && (config->GetKind_FluidModel() != IDEAL_GAS)) + SU2_MPI::Error("Standard air or ideal gas must be selected for the Taylor Green Vortex", CURRENT_FUNCTION); + + if (config->GetKind_ViscosityModel() != VISCOSITYMODEL::CONSTANT) + SU2_MPI::Error("Constant viscosity must be selected for the Taylor Green Vortex", CURRENT_FUNCTION); + + if (config->GetKind_ConductivityModel() != CONDUCTIVITYMODEL::CONSTANT_PRANDTL) + SU2_MPI::Error("Constant Prandtl number must be selected for the Taylor Green Vortex", CURRENT_FUNCTION); +} -void CTGVSolution::GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { +CTGVSolution::~CTGVSolution() = default; +void CTGVSolution::GetSolution(const su2double* val_coords, const su2double val_t, su2double* val_solution) const { /* The initial conditions are set for the Taylor-Green vortex case, which is a DNS case that features vortex breakdown into turbulence. These particular settings are for the typical Re = 1600 case (M = 0.08) with an initial temperature of 300 K. Note that this condition works in both 2D and 3D. */ - su2double val_coordsZ = 0.0; + su2double val_coordsZ = 0.0; if (nDim == 3) val_coordsZ = val_coords[2]; /* Compute the primitive variables. */ - su2double rho = tgvDensity; - su2double u = tgvVelocity * (sin(val_coords[0]/tgvLength)* - cos(val_coords[1]/tgvLength)* - cos(val_coordsZ /tgvLength)); - su2double v = -tgvVelocity * (cos(val_coords[0]/tgvLength)* - sin(val_coords[1]/tgvLength)* - cos(val_coordsZ /tgvLength)); + su2double rho = tgvDensity; + su2double u = + tgvVelocity * (sin(val_coords[0] / tgvLength) * cos(val_coords[1] / tgvLength) * cos(val_coordsZ / tgvLength)); + su2double v = + -tgvVelocity * (cos(val_coords[0] / tgvLength) * sin(val_coords[1] / tgvLength) * cos(val_coordsZ / tgvLength)); - su2double factorA = cos(2.0*val_coordsZ/tgvLength) + 2.0; - su2double factorB = (cos(2.0*val_coords[0]/tgvLength) + - cos(2.0*val_coords[1]/tgvLength)); + su2double factorA = cos(2.0 * val_coordsZ / tgvLength) + 2.0; + su2double factorB = (cos(2.0 * val_coords[0] / tgvLength) + cos(2.0 * val_coords[1] / tgvLength)); - su2double p = (tgvPressure + - tgvDensity*(pow(tgvVelocity,2.0)/16.0)*factorA*factorB); + su2double p = (tgvPressure + tgvDensity * (pow(tgvVelocity, 2.0) / 16.0) * factorA * factorB); /* Compute the conservative variables. Note that both 2D and 3D cases are treated correctly. */ - val_solution[0] = rho; - val_solution[1] = rho*u; - val_solution[2] = rho*v; - val_solution[3] = 0.0; - val_solution[nVar-1] = p*ovGm1 + 0.5*rho*(u*u + v*v); + val_solution[0] = rho; + val_solution[1] = rho * u; + val_solution[2] = rho * v; + val_solution[3] = 0.0; + val_solution[nVar - 1] = p * ovGm1 + 0.5 * rho * (u * u + v * v); } -bool CTGVSolution::ExactSolutionKnown(void) const {return false;} +bool CTGVSolution::ExactSolutionKnown() const { return false; } diff --git a/Common/src/toolboxes/MMS/CUserDefinedSolution.cpp b/Common/src/toolboxes/MMS/CUserDefinedSolution.cpp index 2332a27d5da..330d0b9b405 100644 --- a/Common/src/toolboxes/MMS/CUserDefinedSolution.cpp +++ b/Common/src/toolboxes/MMS/CUserDefinedSolution.cpp @@ -2,7 +2,7 @@ * \file CUserDefinedSolution.cpp * \brief Implementations of the member functions of CUserDefinedSolution. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,14 +27,11 @@ #include "../../../include/toolboxes/MMS/CUserDefinedSolution.hpp" -CUserDefinedSolution::CUserDefinedSolution(void) : CVerificationSolution() { } - -CUserDefinedSolution::CUserDefinedSolution(unsigned short val_nDim, - unsigned short val_nVar, - unsigned short val_iMesh, - CConfig* config) - : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { +CUserDefinedSolution::CUserDefinedSolution() : CVerificationSolution() {} +CUserDefinedSolution::CUserDefinedSolution(unsigned short val_nDim, unsigned short val_nVar, unsigned short val_iMesh, + CConfig* config) + : CVerificationSolution(val_nDim, val_nVar, val_iMesh, config) { /*--- Write a message that the solution is initialized for a user-defined verification case. ---*/ @@ -48,30 +45,24 @@ CUserDefinedSolution::CUserDefinedSolution(unsigned short val_nDim, SU2_MPI::Error("User must implement this function", CURRENT_FUNCTION); } -CUserDefinedSolution::~CUserDefinedSolution(void) { } - -void CUserDefinedSolution::GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { +CUserDefinedSolution::~CUserDefinedSolution() = default; +void CUserDefinedSolution::GetBCState(const su2double* val_coords, const su2double val_t, + su2double* val_solution) const { SU2_MPI::Error("User must implement this function", CURRENT_FUNCTION); } -void CUserDefinedSolution::GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { - +void CUserDefinedSolution::GetSolution(const su2double* val_coords, const su2double val_t, + su2double* val_solution) const { SU2_MPI::Error("User must implement this function", CURRENT_FUNCTION); } -void CUserDefinedSolution::GetMMSSourceTerm(const su2double *val_coords, - const su2double val_t, - su2double *val_source) const { - +void CUserDefinedSolution::GetMMSSourceTerm(const su2double* val_coords, const su2double val_t, + su2double* val_source) const { SU2_MPI::Error("User must implement this function", CURRENT_FUNCTION); } -bool CUserDefinedSolution::IsManufacturedSolution(void) const { +bool CUserDefinedSolution::IsManufacturedSolution() const { SU2_MPI::Error("User must implement this function", CURRENT_FUNCTION); - return false; /* True if manufactured. */ + return false; /* True if manufactured. */ } diff --git a/Common/src/toolboxes/MMS/CVerificationSolution.cpp b/Common/src/toolboxes/MMS/CVerificationSolution.cpp index e5f707a015c..e8fb64035c9 100644 --- a/Common/src/toolboxes/MMS/CVerificationSolution.cpp +++ b/Common/src/toolboxes/MMS/CVerificationSolution.cpp @@ -2,7 +2,7 @@ * \file CVerificationSolution.cpp * \brief Implementations of the member functions of CVerificationSolution. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,19 +27,16 @@ #include "../../../include/toolboxes/MMS/CVerificationSolution.hpp" -CVerificationSolution::CVerificationSolution(void) { - +CVerificationSolution::CVerificationSolution() { /*--- Initialize the pointers to NULL. ---*/ - Error_RMS = nullptr; - Error_Max = nullptr; - Error_Point_Max = nullptr; + Error_RMS = nullptr; + Error_Max = nullptr; + Error_Point_Max = nullptr; Error_Point_Max_Coord = nullptr; } -CVerificationSolution::CVerificationSolution(unsigned short val_nDim, - unsigned short val_nVar, - unsigned short val_iMesh, - CConfig* config) { +CVerificationSolution::CVerificationSolution(unsigned short val_nDim, unsigned short val_nVar, unsigned short val_iMesh, + CConfig* config) { /*--- Store the kind of solver ---*/ Kind_Solver = config->GetKind_Solver(); @@ -59,73 +56,58 @@ CVerificationSolution::CVerificationSolution(unsigned short val_nDim, Error_Max = new su2double[nVar]; Error_Point_Max = new unsigned long[nVar]; - for (unsigned short iVar = 0; iVar < nVar; iVar++) - Error_Point_Max[iVar] = 0; + for (unsigned short iVar = 0; iVar < nVar; iVar++) Error_Point_Max[iVar] = 0; Error_Point_Max_Coord = new su2double*[nVar]; for (unsigned short iVar = 0; iVar < nVar; iVar++) { Error_Point_Max_Coord[iVar] = new su2double[nDim]; - for (unsigned short iDim = 0; iDim < nDim; iDim++) - Error_Point_Max_Coord[iVar][iDim] = 0.0; + for (unsigned short iDim = 0; iDim < nDim; iDim++) Error_Point_Max_Coord[iVar][iDim] = 0.0; } } -CVerificationSolution::~CVerificationSolution(void) { - +CVerificationSolution::~CVerificationSolution() { /*--- Release the memory of the pointers, if allocated. ---*/ - delete [] Error_RMS; - delete [] Error_Max; + delete[] Error_RMS; + delete[] Error_Max; - delete [] Error_Point_Max; + delete[] Error_Point_Max; if (Error_Point_Max_Coord != nullptr) { for (unsigned short iVar = 0; iVar < nVar; iVar++) { - delete [] Error_Point_Max_Coord[iVar]; + delete[] Error_Point_Max_Coord[iVar]; } - delete [] Error_Point_Max_Coord; + delete[] Error_Point_Max_Coord; } } -void CVerificationSolution::GetSolution(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { - +void CVerificationSolution::GetSolution(const su2double* val_coords, const su2double val_t, + su2double* val_solution) const { SU2_MPI::Error("Function must be overwritten by the derived class", CURRENT_FUNCTION); } -void CVerificationSolution::GetInitialCondition(const su2double *val_coords, - su2double *val_solution) const { - +void CVerificationSolution::GetInitialCondition(const su2double* val_coords, su2double* val_solution) const { /*--- Initial conditions call the GetSolution() method at t = 0. ---*/ GetSolution(val_coords, 0.0, val_solution); } -void CVerificationSolution::GetBCState(const su2double *val_coords, - const su2double val_t, - su2double *val_solution) const { - +void CVerificationSolution::GetBCState(const su2double* val_coords, const su2double val_t, + su2double* val_solution) const { SU2_MPI::Error("Function must be overwritten by the derived class", CURRENT_FUNCTION); } -void CVerificationSolution::GetMMSSourceTerm(const su2double *val_coords, - const su2double val_t, - su2double *val_source) const { - +void CVerificationSolution::GetMMSSourceTerm(const su2double* val_coords, const su2double val_t, + su2double* val_source) const { /* Default implementation of the source terms for the method of manufactured solutions. Simply set them to zero. */ - for(unsigned short iVar=0; iVarGetComm_Level() == COMM_FULL) { - /*--- Get the number of ranks and the MPI communicator. ---*/ int size = SU2_MPI::GetSize(); SU2_MPI::Comm comm = SU2_MPI::GetComm(); /*--- The local L2 norms must be added to obtain the global value. ---*/ - vector rbufError(nVar,0.0); - SU2_MPI::Allreduce(Error_RMS, rbufError.data(), nVar, - MPI_DOUBLE, MPI_SUM, comm); + vector rbufError(nVar, 0.0); + SU2_MPI::Allreduce(Error_RMS, rbufError.data(), nVar, MPI_DOUBLE, MPI_SUM, comm); - for(unsigned short iVar=0; iVar rbufPoint(nVar*size); - SU2_MPI::Allgather(Error_Point_Max, nVar, MPI_UNSIGNED_LONG, rbufPoint.data(), - nVar, MPI_UNSIGNED_LONG, comm); - - vector sbufCoor(nDim*nVar,0.0); - for(unsigned short iVar=0; iVar rbufPoint(nVar * size); + SU2_MPI::Allgather(Error_Point_Max, nVar, MPI_UNSIGNED_LONG, rbufPoint.data(), nVar, MPI_UNSIGNED_LONG, comm); + + vector sbufCoor(nDim * nVar, 0.0); + for (unsigned short iVar = 0; iVar < nVar; ++iVar) { + for (unsigned short iDim = 0; iDim < nDim; ++iDim) + sbufCoor[iVar * nDim + iDim] = Error_Point_Max_Coord[iVar][iDim]; } - vector rbufCoor(nDim*nVar*size,0.0); - SU2_MPI::Allgather(sbufCoor.data(), nVar*nDim, MPI_DOUBLE, rbufCoor.data(), - nVar*nDim, MPI_DOUBLE, comm); + vector rbufCoor(nDim * nVar * size, 0.0); + SU2_MPI::Allgather(sbufCoor.data(), nVar * nDim, MPI_DOUBLE, rbufCoor.data(), nVar * nDim, MPI_DOUBLE, comm); - for(unsigned short iVar=0; iVarLUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYnLUkjbWlHRiQ2JlEiQ0YnLyUnaXRhbGljR1EldHJ1ZUYnLyUwZm9udF9zdHlsZV9uYW1lR1EpMkR+SW5wdXRGJy8lLG1hdGh2YXJpYW50R1EnaXRhbGljRictSShtZmVuY2VkR0YkNiUtRiM2Ky1GLDYmUSdzb3VyY2VGJ0YvRjJGNS1JI21vR0YkNi5RIixGJ0YyL0Y2USdub3JtYWxGJy8lJmZlbmNlR1EmZmFsc2VGJy8lKnNlcGFyYXRvckdGMS8lKXN0cmV0Y2h5R0ZILyUqc3ltbWV0cmljR0ZILyUobGFyZ2VvcEdGSC8lLm1vdmFibGVsaW1pdHNHRkgvJSdhY2NlbnRHRkgvJSdsc3BhY2VHUSYwLjBlbUYnLyUncnNwYWNlR1EsMC4zMzMzMzMzZW1GJy1GLDYmUSlvcHRpbWl6ZUYnRi9GMkY1RkAtRiw2JlEnb3V0cHV0RidGL0YyRjUtRkE2LlEiPUYnRjJGREZGL0ZKRkhGS0ZNRk9GUUZTL0ZWUSwwLjI3Nzc3NzhlbUYnL0ZZRmBvLUkjbXNHRiQ2I1EuU291cmNlTU1TLmNwcEYnLUYsNiNRIUYnRkRGMkZELUZBNi1RIjpGJ0ZERkZGXm9GS0ZNRk9GUUZTRl9vRmFvLyUrZXhlY3V0YWJsZUdGSEZE - \ No newline at end of file + diff --git a/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSNSTwoHalfSpheresSolution.mw b/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSNSTwoHalfSpheresSolution.mw index 931ee55b4ab..9b560a8e61f 100644 --- a/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSNSTwoHalfSpheresSolution.mw +++ b/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSNSTwoHalfSpheresSolution.mw @@ -516,4 +516,4 @@ LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbWlHRiQ2I1EhRic= - \ No newline at end of file + diff --git a/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSNSUnitQuadSolution.mw b/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSNSUnitQuadSolution.mw index 1cd09221b48..b6d131b2c89 100644 --- a/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSNSUnitQuadSolution.mw +++ b/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSNSUnitQuadSolution.mw @@ -404,4 +404,4 @@ LUklbXJvd0c2Iy9JK21vZHVsZW5hbWVHNiJJLFR5cGVzZXR0aW5nR0koX3N5c2xpYkdGJzYjLUkjbWlHRiQ2I1EhRic= - \ No newline at end of file + diff --git a/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSNSUnitQuadSolutionWallBC.mw b/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSNSUnitQuadSolutionWallBC.mw index 9793789b2de..08fe53f8771 100644 --- a/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSNSUnitQuadSolutionWallBC.mw +++ b/Common/src/toolboxes/MMS/CreateMMSSourceTerms/CMMSNSUnitQuadSolutionWallBC.mw @@ -384,4 +384,4 @@ JSFH - \ No newline at end of file + diff --git a/Common/src/toolboxes/printing_toolbox.cpp b/Common/src/toolboxes/printing_toolbox.cpp index f2b21f1da51..1001754a873 100644 --- a/Common/src/toolboxes/printing_toolbox.cpp +++ b/Common/src/toolboxes/printing_toolbox.cpp @@ -2,7 +2,7 @@ * \file printing_toolbox.cpp * \brief Printing tools * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,89 +27,73 @@ #include #include -#include #include "../../include/toolboxes/printing_toolbox.hpp" -PrintingToolbox::CTablePrinter::CTablePrinter(std::ostream * output, const std::string & separator){ +PrintingToolbox::CTablePrinter::CTablePrinter(std::ostream* output, const std::string& separator) { out_stream_ = output; i_ = 0; j_ = 0; separator_ = separator; table_width_ = 0; print_header_bottom_line_ = true; - print_header_top_line_ = true; + print_header_top_line_ = true; align_ = RIGHT; inner_separator_ = separator; precision_ = 6; } -int PrintingToolbox::CTablePrinter::GetNumColumns() const { - return (int)column_headers_.size(); -} +int PrintingToolbox::CTablePrinter::GetNumColumns() const { return (int)column_headers_.size(); } -int PrintingToolbox::CTablePrinter::GetTableWidth() const { - return table_width_; -} +int PrintingToolbox::CTablePrinter::GetTableWidth() const { return table_width_; } -void PrintingToolbox::CTablePrinter::SetSeparator(const std::string &separator){ - separator_ = separator; -} +void PrintingToolbox::CTablePrinter::SetSeparator(const std::string& separator) { separator_ = separator; } -void PrintingToolbox::CTablePrinter::SetInnerSeparator(const std::string &inner_separator){ +void PrintingToolbox::CTablePrinter::SetInnerSeparator(const std::string& inner_separator) { inner_separator_ = inner_separator; } -void PrintingToolbox::CTablePrinter::SetPrintHeaderBottomLine(bool print){ - print_header_bottom_line_ = print; -} +void PrintingToolbox::CTablePrinter::SetPrintHeaderBottomLine(bool print) { print_header_bottom_line_ = print; } -void PrintingToolbox::CTablePrinter::SetPrintHeaderTopLine(bool print){ - print_header_top_line_ = print; -} +void PrintingToolbox::CTablePrinter::SetPrintHeaderTopLine(bool print) { print_header_top_line_ = print; } -void PrintingToolbox::CTablePrinter::SetAlign(int align){ - align_ = align; -} +void PrintingToolbox::CTablePrinter::SetAlign(int align) { align_ = align; } -void PrintingToolbox::CTablePrinter::SetPrecision(int precision){ +void PrintingToolbox::CTablePrinter::SetPrecision(int precision) { precision_ = precision; out_stream_->precision(precision_); } -void PrintingToolbox::CTablePrinter::AddColumn(const std::string & header_name, int column_width){ - if (column_width < 4){ +void PrintingToolbox::CTablePrinter::AddColumn(const std::string& header_name, int column_width) { + if (column_width < 4) { throw std::invalid_argument("Column size has to be >= 4"); } column_headers_.push_back(header_name); column_widths_.push_back(column_width); - table_width_ += column_width + separator_.size(); // for the separator + table_width_ += column_width + separator_.size(); // for the separator } void PrintingToolbox::CTablePrinter::PrintHorizontalLine() { - *out_stream_ << "+"; // the left bar + *out_stream_ << "+"; // the left bar - for (int i=0; iGetPrandtl_Lam(); + Pr_lam = config->GetPrandtl_Lam(); Pr_turb = config->GetPrandtl_Turb(); - karman = config->GetwallModel_Kappa(); // von Karman constant -> k = 0.41; or 0.38; + karman = config->GetwallModel_Kappa(); // von Karman constant -> k = 0.41; or 0.38; } -void CWallModel::WallShearStressAndHeatFlux(const su2double rhoExchange, - const su2double velExchange, - const su2double muExchange, - const su2double pExchange, - const su2double Wall_HeatFlux, - const bool HeatFlux_Prescribed, - const su2double Wall_Temperature, - const bool Temperature_Prescribed, - CFluidModel *FluidModel, - su2double &tauWall, - su2double &qWall, - su2double &ViscosityWall, - su2double &kOverCvWall) {} - -CWallModel1DEQ::CWallModel1DEQ(CConfig *config, - const string &Marker_Tag) - : CWallModel(config) { +void CWallModel::WallShearStressAndHeatFlux(const su2double rhoExchange, const su2double velExchange, + const su2double muExchange, const su2double pExchange, + const su2double Wall_HeatFlux, const bool HeatFlux_Prescribed, + const su2double Wall_Temperature, const bool Temperature_Prescribed, + CFluidModel* FluidModel, su2double& tauWall, su2double& qWall, + su2double& ViscosityWall, su2double& kOverCvWall) {} +CWallModel1DEQ::CWallModel1DEQ(CConfig* config, const string& Marker_Tag) : CWallModel(config) { /* Retrieve the integer and floating point information for this boundary marker. */ - const unsigned short *intInfo = config->GetWallFunction_IntInfo(Marker_Tag); - const su2double *doubleInfo = config->GetWallFunction_DoubleInfo(Marker_Tag); + const unsigned short* intInfo = config->GetWallFunction_IntInfo(Marker_Tag); + const su2double* doubleInfo = config->GetWallFunction_DoubleInfo(Marker_Tag); /* Copy the data into the member variables. */ - numPoints = intInfo[0]; - h_wm = doubleInfo[0]; + numPoints = intInfo[0]; + h_wm = doubleInfo[0]; expansionRatio = doubleInfo[1]; unsigned short nfa = numPoints + 1; @@ -78,42 +66,33 @@ CWallModel1DEQ::CWallModel1DEQ(CConfig *config, /* Allocate the memory for the coordinates of the grid points used in the 1D equilibrium wall model. */ y_cv.resize(numPoints); - y_fa.resize(numPoints+1); + y_fa.resize(numPoints + 1); /* Determine the scaled version of the normal coordinates, where the first normal coordinate is simply 1.0. */ y_fa[0] = 0.0; - for(unsigned short i=1; i mu_fa(nfa, muExchange); vector tmp(nfa, 0.0); vector u(numPoints, 0.0); - vector lower(numPoints-1,0.0); - vector upper(numPoints-1,0.0); - vector diagonal(numPoints,0.0); - vector rhs(numPoints,0.0); + vector lower(numPoints - 1, 0.0); + vector upper(numPoints - 1, 0.0); + vector diagonal(numPoints, 0.0); + vector rhs(numPoints, 0.0); /* Set parameters for control */ bool converged = false; unsigned short iter = 0, max_iter = 25; - su2double tauWall_prev = 0.0, tol = 1e-3, aux_rhs=0.0; - su2double qWall_prev=0.0; + su2double tauWall_prev = 0.0, tol = 1e-3, aux_rhs = 0.0; + su2double qWall_prev = 0.0; su2double mut, nu, mu_lam, rho, utau, y_plus, D; - while (converged == false){ - + while (!converged) { iter += 1; if (iter == max_iter) converged = true; @@ -167,17 +145,17 @@ void CWallModel1DEQ::WallShearStressAndHeatFlux(const su2double tExchange, /* Calculate total viscosity note: rho and mu_lam will be a function of temperature when solving an energy equation */ - for(unsigned short i=0; i < nfa; ++i){ - mu_lam = C_1 * pow(T[i]/T_ref, 1.5) * ((T_ref + S)/ (T[i] + S)); + for (unsigned short i = 0; i < nfa; ++i) { + mu_lam = C_1 * pow(T[i] / T_ref, 1.5) * ((T_ref + S) / (T[i] + S)); mu_fa[i] = mu_lam; } - for(unsigned short i=1; i < nfa; ++i){ - rho = pExchange / (R*T[i]); + for (unsigned short i = 1; i < nfa; ++i) { + rho = pExchange / (R * T[i]); nu = mu_fa[i] / rho; utau = sqrt(tauWall / rho); y_plus = y_fa[i] * utau / nu; - D = pow(1.0 - exp((-y_plus)/A),2.0); + D = pow(1.0 - exp((-y_plus) / A), 2.0); mut = rho * karman * y_fa[i] * utau * D; mu_fa[i] += mut; } @@ -185,10 +163,10 @@ void CWallModel1DEQ::WallShearStressAndHeatFlux(const su2double tExchange, /* Momentum matrix The solution vector is u at y_cv */ - lower.assign(numPoints-1,0.0); - upper.assign(numPoints-1,0.0); - diagonal.assign(numPoints,0.0); - rhs.assign(numPoints,0.0); + lower.assign(numPoints - 1, 0.0); + upper.assign(numPoints - 1, 0.0); + diagonal.assign(numPoints, 0.0); + rhs.assign(numPoints, 0.0); /* Top bc */ @@ -197,16 +175,16 @@ void CWallModel1DEQ::WallShearStressAndHeatFlux(const su2double tExchange, /* Internal cvs */ - for (unsigned short i=1; i < (numPoints - 1); ++i){ - upper[i] = mu_fa[i + 1] / (y_cv[i + 1] - y_cv[i] ); - lower[i-1] = mu_fa[i] / (y_cv[i] - y_cv[i - 1] ); + for (unsigned short i = 1; i < (numPoints - 1); ++i) { + upper[i] = mu_fa[i + 1] / (y_cv[i + 1] - y_cv[i]); + lower[i - 1] = mu_fa[i] / (y_cv[i] - y_cv[i - 1]); diagonal[i] = -1.0 * (upper[i] + lower[i - 1]); } /* Wall BC */ - upper[0] = mu_fa[1]/(y_cv[1] - y_cv[0]); - diagonal[0] = -1.0 * (upper[0] + mu_fa[0]/(y_cv[0]-y_fa[0]) ); + upper[0] = mu_fa[1] / (y_cv[1] - y_cv[0]); + diagonal[0] = -1.0 * (upper[0] + mu_fa[0] / (y_cv[0] - y_fa[0])); rhs[0] = 0.0; /* Solve the matrix problem to get the velocity field @@ -215,9 +193,8 @@ void CWallModel1DEQ::WallShearStressAndHeatFlux(const su2double tExchange, #if (defined(HAVE_MKL) || defined(HAVE_LAPACK)) && !(defined(CODI_REVERSE_TYPE) || defined(CODI_FORWARD_TYPE)) int info, nrhs = 1; - dgtsv_(&numPoints,&nrhs,lower.data(),diagonal.data(),upper.data(),rhs.data(),&numPoints, &info); - if (info != 0) - SU2_MPI::Error("Unsuccessful call to dgtsv_", CURRENT_FUNCTION); + dgtsv_(&numPoints, &nrhs, lower.data(), diagonal.data(), upper.data(), rhs.data(), &numPoints, &info); + if (info != 0) SU2_MPI::Error("Unsuccessful call to dgtsv_", CURRENT_FUNCTION); #else SU2_MPI::Error("Not compiled with MKL or LAPACK support", CURRENT_FUNCTION); #endif @@ -226,38 +203,38 @@ void CWallModel1DEQ::WallShearStressAndHeatFlux(const su2double tExchange, /* Update total viscosity */ - for(unsigned short i=0; i < nfa; ++i){ - mu_lam = C_1 * pow(T[i]/T_ref, 1.5) * ((T_ref + S)/ (T[i] + S)); + for (unsigned short i = 0; i < nfa; ++i) { + mu_lam = C_1 * pow(T[i] / T_ref, 1.5) * ((T_ref + S) / (T[i] + S)); mu_fa[i] = mu_lam; - tmp[i] = mu_lam/Pr_lam; + tmp[i] = mu_lam / Pr_lam; } /* Update tauWall */ - tauWall = mu_fa[0] * (u[0] - 0.0)/(y_cv[0]-y_fa[0]); - for(unsigned short i=1; i < nfa; ++i){ - rho = pExchange / (R*T[i]); + tauWall = mu_fa[0] * (u[0] - 0.0) / (y_cv[0] - y_fa[0]); + for (unsigned short i = 1; i < nfa; ++i) { + rho = pExchange / (R * T[i]); nu = mu_fa[i] / rho; utau = sqrt(tauWall / rho); y_plus = y_fa[i] * utau / nu; - D = pow(1.0 - exp((-y_plus)/A),2.0); + D = pow(1.0 - exp((-y_plus) / A), 2.0); mut = rho * karman * y_fa[i] * utau * D; mu_fa[i] += mut; - tmp[i] += mut/Pr_turb; + tmp[i] += mut / Pr_turb; } /* Energy matrix The Solution vector is Enthalpy at y_cv */ - lower.assign(numPoints-1,0.0); - upper.assign(numPoints-1,0.0); - diagonal.assign(numPoints,0.0); - rhs.assign(numPoints,0.0); + lower.assign(numPoints - 1, 0.0); + upper.assign(numPoints - 1, 0.0); + diagonal.assign(numPoints, 0.0); + rhs.assign(numPoints, 0.0); /* Internal cvs */ - for (unsigned short i=1; i < (numPoints - 1); ++i){ - upper[i] = tmp[i + 1] / (y_cv[i + 1] - y_cv[i] ); - lower[i-1] = tmp[i] / (y_cv[i] - y_cv[i - 1] ); + for (unsigned short i = 1; i < (numPoints - 1); ++i) { + upper[i] = tmp[i + 1] / (y_cv[i + 1] - y_cv[i]); + lower[i - 1] = tmp[i] / (y_cv[i] - y_cv[i - 1]); diagonal[i] = -1.0 * (upper[i] + lower[i - 1]); } @@ -267,9 +244,9 @@ void CWallModel1DEQ::WallShearStressAndHeatFlux(const su2double tExchange, /* Wall BC */ - upper[0] = tmp[1]/(y_cv[1] - y_cv[0]); - diagonal[0] = -1.0 * (upper[0] + tmp[0]/(y_cv[0]-y_fa[0]) ); - aux_rhs = tmp[0]/(y_cv[0]-y_fa[0]); + upper[0] = tmp[1] / (y_cv[1] - y_cv[0]); + diagonal[0] = -1.0 * (upper[0] + tmp[0] / (y_cv[0] - y_fa[0])); + aux_rhs = tmp[0] / (y_cv[0] - y_fa[0]); /* RHS of the Energy equation - Compute flux -- (mu + mu_t) * u * du/dy -- @@ -277,28 +254,27 @@ void CWallModel1DEQ::WallShearStressAndHeatFlux(const su2double tExchange, /* Zero flux at the wall */ - tmp[0] = 0. ; - for (unsigned short i=1; i < numPoints; ++i){ - tmp[i] = 0.5* (mu_fa[i]) * (u[i] + u[i-1]) * (u[i] -u[i-1])/(y_cv[i] - y_cv[i - 1] ) ; + tmp[0] = 0.; + for (unsigned short i = 1; i < numPoints; ++i) { + tmp[i] = 0.5 * (mu_fa[i]) * (u[i] + u[i - 1]) * (u[i] - u[i - 1]) / (y_cv[i] - y_cv[i - 1]); } - for (unsigned short i=0; i < (numPoints - 1); ++i){ - rhs[i] = -tmp[i+1] + tmp[i]; + for (unsigned short i = 0; i < (numPoints - 1); ++i) { + rhs[i] = -tmp[i + 1] + tmp[i]; } - if (HeatFlux_Prescribed == true){ + if (HeatFlux_Prescribed) { /* dT/dy = 0 -> Twall = T[1] */ h_wall = c_p * T[1]; } rhs[0] -= aux_rhs * h_wall; - rhs[numPoints-1] = h_bc; + rhs[numPoints - 1] = h_bc; /* Solve the matrix problem to get the Enthalpy field */ #if (defined(HAVE_MKL) || defined(HAVE_LAPACK)) && !(defined(CODI_REVERSE_TYPE) || defined(CODI_FORWARD_TYPE)) - dgtsv_(&numPoints,&nrhs,lower.data(),diagonal.data(),upper.data(),rhs.data(),&numPoints, &info); - if (info != 0) - SU2_MPI::Error("Unsuccessful call to dgtsv_", CURRENT_FUNCTION); + dgtsv_(&numPoints, &nrhs, lower.data(), diagonal.data(), upper.data(), rhs.data(), &numPoints, &info); + if (info != 0) SU2_MPI::Error("Unsuccessful call to dgtsv_", CURRENT_FUNCTION); #else SU2_MPI::Error("Not compiled with MKL or LAPACK support", CURRENT_FUNCTION); #endif @@ -306,64 +282,53 @@ void CWallModel1DEQ::WallShearStressAndHeatFlux(const su2double tExchange, /* Get Temperature from enthalpy - Temperature will be at face */ - T[0] = h_wall/c_p; - T[numPoints] = h_bc/c_p; - for (unsigned short i=0; i < numPoints-1; i++){ - T[i+1] = 0.5 * (rhs[i] + rhs[i+1])/c_p; + T[0] = h_wall / c_p; + T[numPoints] = h_bc / c_p; + for (unsigned short i = 0; i < numPoints - 1; i++) { + T[i + 1] = 0.5 * (rhs[i] + rhs[i + 1]) / c_p; } /* Final update tauWall */ - mu_lam = C_1 * pow(T[0]/T_ref, 1.5) * ((T_ref + S)/ (T[0] + S)); + mu_lam = C_1 * pow(T[0] / T_ref, 1.5) * ((T_ref + S) / (T[0] + S)); /* These quantities will be returned. */ - tauWall = mu_lam * (u[0] - 0.0)/(y_cv[0]-y_fa[0]); - qWall = mu_lam * (c_p / Pr_lam) * -(T[1] - T[0]) / (y_fa[1]-y_fa[0]); + tauWall = mu_lam * (u[0] - 0.0) / (y_cv[0] - y_fa[0]); + qWall = mu_lam * (c_p / Pr_lam) * -(T[1] - T[0]) / (y_fa[1] - y_fa[0]); ViscosityWall = mu_lam; - //kOverCvWall = c_p / c_v * (mu[0]/Pr_lam + muTurb[0]/Pr_turb); - kOverCvWall = c_p / c_v * (mu_lam/Pr_lam); + // kOverCvWall = c_p / c_v * (mu[0]/Pr_lam + muTurb[0]/Pr_turb); + kOverCvWall = c_p / c_v * (mu_lam / Pr_lam); /* Final check of the Y+ */ rho = pExchange / (R * T[0]); - if (y_cv[0] * sqrt(tauWall/rho) / (mu_lam/rho) > 1.0) + if (y_cv[0] * sqrt(tauWall / rho) / (mu_lam / rho) > 1.0) SU2_MPI::Error("Y+ greater than one: Increase the number of points or growth ratio.", CURRENT_FUNCTION); /* Define a norm */ - if (abs(1.0 - tauWall/tauWall_prev) < tol && abs(1.0 - qWall/qWall_prev) < tol){ + if (abs(1.0 - tauWall / tauWall_prev) < tol && abs(1.0 - qWall / qWall_prev) < tol) { converged = true; } } } -CWallModelLogLaw::CWallModelLogLaw(CConfig *config, - const string &Marker_Tag) - : CWallModel(config) { - +CWallModelLogLaw::CWallModelLogLaw(CConfig* config, const string& Marker_Tag) : CWallModel(config) { C = 5.25; /* Constant to match the Reichardt BL profile -> C = 4.1; or 5.25. */ /* Retrieve the floating point information for this boundary marker and set the exchange height. */ - const su2double *doubleInfo = config->GetWallFunction_DoubleInfo(Marker_Tag); + const su2double* doubleInfo = config->GetWallFunction_DoubleInfo(Marker_Tag); h_wm = doubleInfo[0]; } -void CWallModelLogLaw::WallShearStressAndHeatFlux(const su2double tExchange, - const su2double velExchange, - const su2double muExchange, - const su2double pExchange, - const su2double Wall_HeatFlux, - const bool HeatFlux_Prescribed, - const su2double Wall_Temperature, - const bool Temperature_Prescribed, - CFluidModel *FluidModel, - su2double &tauWall, - su2double &qWall, - su2double &ViscosityWall, - su2double &kOverCvWall) { - +void CWallModelLogLaw::WallShearStressAndHeatFlux(const su2double tExchange, const su2double velExchange, + const su2double muExchange, const su2double pExchange, + const su2double Wall_HeatFlux, const bool HeatFlux_Prescribed, + const su2double Wall_Temperature, const bool Temperature_Prescribed, + CFluidModel* FluidModel, su2double& tauWall, su2double& qWall, + su2double& ViscosityWall, su2double& kOverCvWall) { /* Set the wall temperature, depending whether or not the temperature was prescribed and initialize the fluid model. */ const su2double TWall = Temperature_Prescribed ? Wall_Temperature : tExchange; @@ -372,64 +337,67 @@ void CWallModelLogLaw::WallShearStressAndHeatFlux(const su2double tExchange, /* Get the required data from the fluid model. */ const su2double rho_wall = FluidModel->GetDensity(); - const su2double mu_wall = FluidModel->GetLaminarViscosity(); - const su2double c_p = FluidModel->GetCp(); - const su2double c_v = FluidModel->GetCv(); - const su2double nu_wall = mu_wall / rho_wall; + const su2double mu_wall = FluidModel->GetLaminarViscosity(); + const su2double c_p = FluidModel->GetCp(); + const su2double c_v = FluidModel->GetCv(); + const su2double nu_wall = mu_wall / rho_wall; /* Initial guess of the friction velocity. */ - su2double u_tau = max(0.01*velExchange, 1.e-5); + su2double u_tau = max(0.01 * velExchange, 1.e-5); /* Set parameters for control of the Newton iteration. */ bool converged = false; unsigned short iter = 0, max_iter = 50; - const su2double tol=1e-3; - - while (converged == false){ + const su2double tol = 1e-3; + while (!converged) { iter += 1; if (iter == max_iter) converged = true; const su2double u_tau0 = u_tau; - const su2double y_plus = u_tau0*h_wm/nu_wall; + const su2double y_plus = u_tau0 * h_wm / nu_wall; /* Reichardt boundary layer analytical law fprime is the differentiation of the Reichardt law with repect to u_tau. */ - const su2double fval = velExchange/u_tau0 - ((C - log(karman)/karman)*(1.0 - exp(-y_plus/11.0) - - (y_plus/11.0)*exp(-0.33*y_plus))) - log(karman*y_plus + 1.0)/karman; - const su2double fprime = -velExchange/pow(u_tau0,2.0) - + (- C + log(karman)/karman)*(-(1.0/11.0)*h_wm*exp(-0.33*y_plus)/nu_wall - + (1.0/11.0)*h_wm*exp(-(1.0/11.0)*y_plus)/nu_wall - + (1.0/33.0)*u_tau0*pow(h_wm,2.0)*exp(-0.33*y_plus)/pow(nu_wall, 2.0)) - - 1.0*h_wm/(nu_wall*(karman*y_plus + 1.0)); + const su2double fval = + velExchange / u_tau0 - + ((C - log(karman) / karman) * (1.0 - exp(-y_plus / 11.0) - (y_plus / 11.0) * exp(-0.33 * y_plus))) - + log(karman * y_plus + 1.0) / karman; + const su2double fprime = -velExchange / pow(u_tau0, 2.0) + + (-C + log(karman) / karman) * + (-(1.0 / 11.0) * h_wm * exp(-0.33 * y_plus) / nu_wall + + (1.0 / 11.0) * h_wm * exp(-(1.0 / 11.0) * y_plus) / nu_wall + + (1.0 / 33.0) * u_tau0 * pow(h_wm, 2.0) * exp(-0.33 * y_plus) / pow(nu_wall, 2.0)) - + 1.0 * h_wm / (nu_wall * (karman * y_plus + 1.0)); /* Newton method */ - const su2double newton_step = fval/fprime; + const su2double newton_step = fval / fprime; u_tau = u_tau0 - newton_step; /* Define a norm */ - if (abs(1.0 - u_tau/u_tau0) < tol) converged = true; + if (abs(1.0 - u_tau / u_tau0) < tol) converged = true; } - tauWall = rho_wall * pow(u_tau,2.0); + tauWall = rho_wall * pow(u_tau, 2.0); - if (Temperature_Prescribed){ + if (Temperature_Prescribed) { /* The Kader's law will be used to approximate the variations of the temperature inside the boundary layer. */ - const su2double y_plus = u_tau*h_wm/nu_wall; - const su2double lhs = - ((tExchange - TWall) * rho_wall * c_p * u_tau); - const su2double Gamma = - (0.01 * (Pr_lam * pow(y_plus,4.0))/(1.0 + 5.0*y_plus*pow(Pr_lam,3.0))); + const su2double y_plus = u_tau * h_wm / nu_wall; + const su2double lhs = -((tExchange - TWall) * rho_wall * c_p * u_tau); + const su2double Gamma = -(0.01 * (Pr_lam * pow(y_plus, 4.0)) / (1.0 + 5.0 * y_plus * pow(Pr_lam, 3.0))); const su2double rhs_1 = Pr_lam * y_plus * exp(Gamma); - const su2double rhs_2 = (2.12*log(1.0+y_plus) + pow((3.85*pow(Pr_lam,(1.0/3.0)) - 1.3),2.0) + 2.12*log(Pr_lam)) * exp(1./Gamma); - qWall = lhs/(rhs_1 + rhs_2); - } - else{ + const su2double rhs_2 = + (2.12 * log(1.0 + y_plus) + pow((3.85 * pow(Pr_lam, (1.0 / 3.0)) - 1.3), 2.0) + 2.12 * log(Pr_lam)) * + exp(1. / Gamma); + qWall = lhs / (rhs_1 + rhs_2); + } else { qWall = Wall_HeatFlux; } ViscosityWall = mu_wall; - kOverCvWall = FluidModel->GetThermalConductivity()/c_v; + kOverCvWall = FluidModel->GetThermalConductivity() / c_v; } diff --git a/Docs/docmain.hpp b/Docs/docmain.hpp index 1380c050559..43bcb375f75 100644 --- a/Docs/docmain.hpp +++ b/Docs/docmain.hpp @@ -2,14 +2,14 @@ * \file docmain.hpp * \brief This file contains documentation for Doxygen and does not have any significance with respect to C++. * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * * The SU2 Project is maintained by the SU2 Foundation * (http://su2foundation.org) * - * Copyright 2012-2022, SU2 Contributors (cf. AUTHORS.md) + * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) * * SU2 is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -25,10 +25,10 @@ * License along with SU2. If not, see . */ -/*! - * \mainpage SU2 version 7.5.1 "Blackbird" +/*! + * \mainpage SU2 version 8.0.0 "Harrier" * SU2 suite is an open-source collection of C++ based software tools - * to perform PDE analysis and PDE constrained optimization. The toolset is designed with + * to perform PDE analysis and PDE constrained optimization. The toolset is designed with * computational fluid dynamics and aerodynamic shape optimization in mind, but is extensible to * include other families of governing equations such as potential flow, electrodynamics, chemically reacting * flows, and many others. SU2 is released under an open-source license. @@ -66,43 +66,43 @@ /*! * \defgroup ConvDiscr Discretization of the convective terms - * \brief Group of classes which define the numerical methods for - * discretizing the convective terms of a Partial Differential Equation. - * There are methods for solving the direct, adjoint and linearized + * \brief Group of classes which define the numerical methods for + * discretizing the convective terms of a Partial Differential Equation. + * There are methods for solving the direct, adjoint and linearized * systems of equations. */ /*! * \defgroup ViscDiscr Discretization of the viscous terms - * \brief Group of classes which define the numerical methods for - * discretizing the viscous terms of a Partial Differential Equation. - * There are methods for solving the direct, adjoint and linearized + * \brief Group of classes which define the numerical methods for + * discretizing the viscous terms of a Partial Differential Equation. + * There are methods for solving the direct, adjoint and linearized * systems of equations. */ /*! * \defgroup SourceDiscr Discretization of the source terms - * \brief Group of classes which define the numerical methods for - * discretizing the source terms of a Partial Differential Equation. - * There are methods for solving the direct, adjoint and linearized + * \brief Group of classes which define the numerical methods for + * discretizing the source terms of a Partial Differential Equation. + * There are methods for solving the direct, adjoint and linearized * systems of equations. */ /*! * \defgroup Euler_Equations Solving the Euler equations - * \brief Group of classes which define the system of Euler equations in + * \brief Group of classes which define the system of Euler equations in * three formulations: direct, adjoint, and linearized. */ /*! * \defgroup Navier_Stokes_Equations Solving the Navier-Stokes equations - * \brief Group of classes which define the system of Navier-Stokes equations in + * \brief Group of classes which define the system of Navier-Stokes equations in * three formulations: direct, adjoint, and linearized. */ /*! * \defgroup Turbulence_Model Solving the turbulence model equations - * \brief Group of classes which define the turbulence model in + * \brief Group of classes which define the turbulence model in * three formulations: direct, adjoint, and linearized. */ @@ -130,6 +130,13 @@ * space and time integration. The latter use mostly the "Solvers". */ +/*! + * \defgroup PySU2 Python Wrapper functions + * \brief Functions of the driver classes (\ref Drivers) that can be used to customize SU2 + * via Python. For example, set custom temperature distributions at boundaries, + * deform the mesh, etc. + */ + /*! * \defgroup Variable Storing solution variables * \brief Classes used to store and access the solution variables of all types of problems. @@ -217,4 +224,10 @@ * \defgroup SIMD Vectorization (SIMD) * \brief Classes for explicit (done by the programmer) vectorization (SIMD) of computations. * \ingroup Toolboxes - */ \ No newline at end of file + */ + +/*! + * \defgroup Multi-Layer Perceptrons (MLP) + * \brief Data look up and interpolation via dense, feed-forward multi-layer perceptrons. + * \ingroup Toolboxes + */ diff --git a/QuickStart/.gitignore b/QuickStart/.gitignore index 3fc9c7e5f80..78e9921b732 100644 --- a/QuickStart/.gitignore +++ b/QuickStart/.gitignore @@ -8,5 +8,10 @@ *.csv *.plt *.szplt -*.vtk +*.vtu +*.log +*.out +*.aux +*.pdf +*.png config_*.cfg diff --git a/QuickStart/inv_NACA0012.cfg b/QuickStart/inv_NACA0012.cfg index 6f6dbc9424a..36c100c52ed 100644 --- a/QuickStart/inv_NACA0012.cfg +++ b/QuickStart/inv_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -30,7 +30,7 @@ MACH_NUMBER= 0.8 % Angle of attack (degrees) AOA= 1.25 % -% Free-stream pressure (101325.0 N/m^2 by default, only Euler flows) +% Free-stream pressure (101325.0 N/m^2 by default, only Euler flows) FREESTREAM_PRESSURE= 101325.0 % % Free-stream temperature (273.15 K by default) @@ -146,17 +146,9 @@ MG_DAMP_PROLONGATION= 1.0 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % -% Convective numerical method (JST, LAX-FRIEDRICH, CUSP, ROE, AUSM, HLLC, -% TURKEL_PREC, MSW) -CONV_NUM_METHOD_FLOW= JST -% -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the flow equations. -% Required for 2nd order upwind schemes (NO, YES) -MUSCL_FLOW= YES +% Convective numerical method % -% Slope limiter (NONE, VENKATAKRISHNAN, VENKATAKRISHNAN_WANG, -% BARTH_JESPERSEN, VAN_ALBADA_EDGE) -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN_WANG +CONV_NUM_METHOD_FLOW= JST % % 2nd and 4th order artificial dissipation coefficients JST_SENSOR_COEFF= ( 0.5, 0.02 ) @@ -169,14 +161,6 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % Convective numerical method (JST, LAX-FRIEDRICH, ROE) CONV_NUM_METHOD_ADJFLOW= JST % -% Monotonic Upwind Scheme for Conservation Laws (TVD) in the adjoint flow equations. -% Required for 2nd order upwind schemes (NO, YES) -MUSCL_ADJFLOW= YES -% -% Slope limiter (NONE, VENKATAKRISHNAN, BARTH_JESPERSEN, VAN_ALBADA_EDGE, -% SHARP_EDGES, WALL_DISTANCE) -SLOPE_LIMITER_ADJFLOW= NONE -% % Reduction factor of the CFL coefficient in the adjoint problem CFL_REDUCTION_ADJFLOW= 0.01 % @@ -188,7 +172,7 @@ TIME_DISCRE_ADJFLOW= EULER_IMPLICIT % Kind of deformation (NO_DEFORMATION, TRANSLATION, ROTATION, SCALE, % FFD_SETTING, FFD_NACELLE % FFD_CONTROL_POINT, FFD_CAMBER, FFD_THICKNESS, FFD_TWIST -% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, FFD_TWIST_2D, +% FFD_CONTROL_POINT_2D, FFD_CAMBER_2D, FFD_THICKNESS_2D, % HICKS_HENNE, SURFACE_BUMP) DV_KIND= HICKS_HENNE % @@ -212,7 +196,6 @@ DV_MARKER= ( airfoil ) % - FFD_CONTROL_POINT_2D ( FFD_BoxTag, i_Ind, j_Ind, x_Disp, y_Disp ) % - FFD_CAMBER_2D ( FFD_BoxTag, i_Ind ) % - FFD_THICKNESS_2D ( FFD_BoxTag, i_Ind ) -% - FFD_TWIST_2D ( FFD_BoxTag, x_Orig, y_Orig ) % - HICKS_HENNE ( Lower Surface (0)/Upper Surface (1)/Only one Surface (2), x_Loc ) % - SURFACE_BUMP ( x_Start, x_End, x_Loc ) DV_PARAM= ( 1, 0.5 ) @@ -234,7 +217,7 @@ DEFORM_LINEAR_SOLVER_ERROR= 1E-14 % Print the residuals during mesh deformation to the console (YES, NO) DEFORM_CONSOLE_OUTPUT= YES % -% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, +% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, % WALL_DISTANCE, CONSTANT_STIFFNESS) DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME @@ -275,7 +258,7 @@ SOLUTION_ADJ_FILENAME= solution_adj.dat % Output file format (TECPLOT, CSV) TABULAR_FORMAT= CSV % -% Output file convergence history (w/o extension) +% Output file convergence history (w/o extension) CONV_FILENAME= history % % Output file restart flow @@ -301,6 +284,9 @@ SURFACE_ADJ_FILENAME= surface_adjoint % % Writing solution file frequency OUTPUT_WRT_FREQ= 250 +% +% Output file format +OUTPUT_FILES= (RESTART, PARAVIEW, SURFACE_CSV) % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % Available flow based objective functions or constraint functions @@ -308,7 +294,7 @@ OUTPUT_WRT_FREQ= 250 % FORCE_X, FORCE_Y, FORCE_Z, % MOMENT_X, MOMENT_Y, MOMENT_Z, % THRUST, TORQUE, FIGURE_OF_MERIT, -% EQUIVALENT_AREA, NEARFIELD_PRESSURE, +% EQUIVALENT_AREA, NEARFIELD_PRESSURE, % TOTAL_HEATFLUX, MAXIMUM_HEATFLUX, % INVERSE_DESIGN_PRESSURE, INVERSE_DESIGN_HEATFLUX, % diff --git a/README.md b/README.md index 4ad3b1fad6a..6b6db44446e 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@

-# SU2 (ver. 7.5.1 "Blackbird"): The Open-Source CFD Code +# SU2 (ver. 8.0.0 "Harrier"): The Open-Source CFD Code Computational analysis tools have revolutionized the way we design engineering systems, but most established codes are proprietary, unavailable, or prohibitively expensive for many users. The SU2 team is changing this, making multiphysics analysis and design optimization freely available as open-source software and involving everyone in its creation and development. diff --git a/SU2_CFD/bin/.csv b/SU2_CFD/bin/.csv deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/SU2_CFD/bin/.gitignore b/SU2_CFD/bin/.gitignore deleted file mode 100644 index fe891329eff..00000000000 --- a/SU2_CFD/bin/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Do not track compiled execuatables -SU2* diff --git a/SU2_CFD/bin/.vtk b/SU2_CFD/bin/.vtk deleted file mode 100644 index 900960c4d43..00000000000 --- a/SU2_CFD/bin/.vtk +++ /dev/null @@ -1,142079 +0,0 @@ -# vtk DataFile Version 2.0 -Visualizacion de la malla computacional -ASCII -DATASET UNSTRUCTURED_GRID -POINTS 46417 float -0.664297 0 -0.00127964 -0.654653 0 -0.00256277 -0.644559 0 -0.00388216 -0.63384 0 -0.0052628 -0.622351 0 -0.00671498 -0.60998 0 -0.0082355 -0.596641 0 -0.00981716 -0.582276 0 -0.0114504 -0.566853 0 -0.0131261 -0.550364 0 -0.0148364 -0.532824 0 -0.0165757 -0.514268 0 -0.0183398 -0.49475 0 -0.0201231 -0.474339 0 -0.0219149 -0.45312 0 -0.0236966 -0.43119 0 -0.0254389 -0.408656 0 -0.0271021 -0.385636 0 -0.0286389 -0.362256 0 -0.0299989 -0.33865 0 -0.0311351 -0.314956 0 -0.0320112 -0.291318 0 -0.0326052 -0.267882 0 -0.0329126 -0.244791 0 -0.0329452 -0.222187 0 -0.0327268 -0.200207 0 -0.0322879 -0.178979 0 -0.03166 -4.7159 0 -2.6092e-05 -3.36204 0 -2.3145e-05 -2.41803 0 -2.1673e-05 -1.77389 0 -2.0944e-05 -1.3458 0 -2.0582e-05 -1.07031 0 -2.0401e-05 -0.899792 0 -2.0309e-05 -0.799007 0 -2.0262e-05 -0.742319 0 -2.0237e-05 -0.711582 0 -2.0223e-05 -0.694488 0 -2.021e-05 -0.68327 0 -2.0193e-05 -0.673701 0 -2.0166e-05 -0.664299 0 -0.00129977 -0.654655 0 -0.00258287 -0.644561 0 -0.00390223 -0.633842 0 -0.00528285 -0.622354 0 -0.00673503 -0.609983 0 -0.00825555 -0.596643 0 -0.0098372 -0.582278 0 -0.0114705 -0.566855 0 -0.0131461 -0.550366 0 -0.0148564 -0.532826 0 -0.0165957 -0.51427 0 -0.0183599 -0.494751 0 -0.0201431 -0.47434 0 -0.021935 -0.453121 0 -0.0237166 -0.431191 0 -0.0254589 -0.408657 0 -0.0271222 -0.385637 0 -0.028659 -0.362257 0 -0.0300189 -0.338651 0 -0.0311552 -0.314957 0 -0.0320313 -0.291319 0 -0.0326253 -0.267882 0 -0.0329327 -0.244791 0 -0.0329653 -0.222187 0 -0.0327469 -0.200206 0 -0.032308 -0.178979 0 -0.0316801 -4.7159 0 -6.8723e-05 -3.36204 0 -6.2826e-05 -2.41803 0 -5.9874e-05 -1.77389 0 -5.8407e-05 -1.3458 0 -5.7676e-05 -1.07031 0 -5.7307e-05 -0.899792 0 -5.7117e-05 -0.799008 0 -5.7015e-05 -0.742319 0 -5.6959e-05 -0.711583 0 -5.6922e-05 -0.694489 0 -5.6885e-05 -0.683272 0 -5.6834e-05 -0.673704 0 -5.6758e-05 -0.664302 0 -0.0013363 -0.654659 0 -0.00261933 -0.644565 0 -0.00393865 -0.633846 0 -0.00531923 -0.622358 0 -0.0067714 -0.609987 0 -0.00829191 -0.596647 0 -0.00987356 -0.582282 0 -0.0115069 -0.566859 0 -0.0131825 -0.550369 0 -0.0148928 -0.532829 0 -0.0166321 -0.514273 0 -0.0183963 -0.494754 0 -0.0201795 -0.474343 0 -0.0219713 -0.453124 0 -0.023753 -0.431193 0 -0.0254953 -0.408659 0 -0.0271586 -0.385639 0 -0.0286954 -0.362259 0 -0.0300553 -0.338652 0 -0.0311915 -0.314957 0 -0.0320676 -0.291319 0 -0.0326616 -0.267882 0 -0.032969 -0.24479 0 -0.0330015 -0.222186 0 -0.0327831 -0.200205 0 -0.0323442 -0.178977 0 -0.0317162 -4.7159 0 -0.000138374 -3.36204 0 -0.000129512 -2.41803 0 -0.000125054 -1.77389 0 -0.000122818 -1.3458 0 -0.000121687 -1.07031 0 -0.0001211 -0.899792 0 -0.000120781 -0.799008 0 -0.000120597 -0.74232 0 -0.000120479 -0.711583 0 -0.000120389 -0.69449 0 -0.000120296 -0.683274 0 -0.00012017 -0.673707 0 -0.000119995 -0.664307 0 -0.00139942 -0.654664 0 -0.00268233 -0.644571 0 -0.00400154 -0.633852 0 -0.00538204 -0.622364 0 -0.00683416 -0.609993 0 -0.00835464 -0.596653 0 -0.00993627 -0.582288 0 -0.0115696 -0.566864 0 -0.0132452 -0.550374 0 -0.0149555 -0.532834 0 -0.0166947 -0.514277 0 -0.0184589 -0.494758 0 -0.0202421 -0.474347 0 -0.0220339 -0.453127 0 -0.0238155 -0.431196 0 -0.0255578 -0.408661 0 -0.0272211 -0.38564 0 -0.0287578 -0.36226 0 -0.0301177 -0.338652 0 -0.0312538 -0.314957 0 -0.0321298 -0.291318 0 -0.0327237 -0.267879 0 -0.033031 -0.244787 0 -0.0330634 -0.222182 0 -0.0328448 -0.2002 0 -0.0324056 -0.178971 0 -0.0317775 -4.7159 0 -0.000252173 -3.36204 0 -0.000240308 -2.41803 0 -0.00023427 -1.77389 0 -0.000231186 -1.34581 0 -0.000229574 -1.07031 0 -0.00022869 -0.899793 0 -0.000228168 -0.799009 0 -0.000227826 -0.742321 0 -0.000227573 -0.711585 0 -0.000227356 -0.694493 0 -0.000227126 -0.683278 0 -0.000226838 -0.673712 0 -0.000226463 -0.664313 0 -0.00150565 -0.654672 0 -0.00278833 -0.64458 0 -0.00410733 -0.633861 0 -0.00548767 -0.622373 0 -0.00693965 -0.610002 0 -0.00846003 -0.596661 0 -0.0100416 -0.582295 0 -0.0116748 -0.566871 0 -0.0133503 -0.550381 0 -0.0150605 -0.53284 0 -0.0167997 -0.514282 0 -0.0185637 -0.494763 0 -0.0203469 -0.474351 0 -0.0221386 -0.45313 0 -0.0239201 -0.431198 0 -0.0256622 -0.408662 0 -0.0273253 -0.38564 0 -0.0288619 -0.362258 0 -0.0302215 -0.338649 0 -0.0313575 -0.314952 0 -0.0322332 -0.291311 0 -0.0328267 -0.267872 0 -0.0331336 -0.244778 0 -0.0331655 -0.222171 0 -0.0329464 -0.200187 0 -0.0325067 -0.178956 0 -0.0318779 -4.7159 0 -0.000438103 -3.36204 0 -0.000423156 -2.41803 0 -0.000415384 -1.7739 0 -0.000411281 -1.34581 0 -0.000409021 -1.07031 0 -0.000407676 -0.899795 0 -0.000406789 -0.799011 0 -0.000406132 -0.742322 0 -0.00040559 -0.711587 0 -0.000405088 -0.694496 0 -0.000404561 -0.683283 0 -0.000403939 -0.673719 0 -0.00040318 -0.664322 0 -0.00168193 -0.654682 0 -0.00296416 -0.644591 0 -0.00428276 -0.633873 0 -0.00566275 -0.622385 0 -0.00711444 -0.610013 0 -0.00863456 -0.596672 0 -0.0102159 -0.582305 0 -0.0118488 -0.566879 0 -0.0135241 -0.550388 0 -0.0152341 -0.532846 0 -0.016973 -0.514287 0 -0.0187368 -0.494766 0 -0.0205197 -0.474353 0 -0.0223111 -0.45313 0 -0.0240923 -0.431196 0 -0.0258341 -0.408658 0 -0.0274968 -0.385634 0 -0.0290329 -0.362249 0 -0.030392 -0.338637 0 -0.0315273 -0.314938 0 -0.0324023 -0.291294 0 -0.032995 -0.267851 0 -0.0333009 -0.244754 0 -0.0333317 -0.222143 0 -0.0331113 -0.200156 0 -0.0326701 -0.178922 0 -0.0320396 -4.7159 0 -0.000741882 -3.36205 0 -0.000723704 -2.41804 0 -0.00071391 -1.7739 0 -0.00070847 -1.34582 0 -0.000705243 -1.07032 0 -0.00070313 -0.8998 0 -0.000701577 -0.799014 0 -0.000700311 -0.742326 0 -0.000699185 -0.711591 0 -0.000698108 -0.694501 0 -0.000696986 -0.683289 0 -0.000695721 -0.673728 0 -0.000694253 -0.664334 0 -0.00197221 -0.654696 0 -0.00325365 -0.644605 0 -0.0045715 -0.633888 0 -0.00595081 -0.622399 0 -0.00740189 -0.610026 0 -0.00892144 -0.596684 0 -0.0105022 -0.582315 0 -0.0121346 -0.566888 0 -0.0138094 -0.550395 0 -0.0155188 -0.53285 0 -0.0172572 -0.514289 0 -0.0190205 -0.494765 0 -0.0208028 -0.474349 0 -0.0225936 -0.453123 0 -0.0243741 -0.431186 0 -0.0261151 -0.408644 0 -0.0277769 -0.385615 0 -0.0293119 -0.362226 0 -0.0306699 -0.338609 0 -0.0318038 -0.314904 0 -0.0326771 -0.291254 0 -0.033268 -0.267805 0 -0.0335718 -0.244702 0 -0.0336001 -0.222085 0 -0.033377 -0.200092 0 -0.0329326 -0.178852 0 -0.0322987 -4.7159 0 -0.00123821 -3.36206 0 -0.00121654 -2.41805 0 -0.00120422 -1.77392 0 -0.00119688 -1.34583 0 -0.00119213 -1.07033 0 -0.00118871 -0.89981 0 -0.00118596 -0.799022 0 -0.00118357 -0.742331 0 -0.00118135 -0.711596 0 -0.00117919 -0.694507 0 -0.00117696 -0.683298 0 -0.00117452 -0.67374 0 -0.0011718 -0.664348 0 -0.00244838 -0.654712 0 -0.00372843 -0.644622 0 -0.00504495 -0.633904 0 -0.00642302 -0.622415 0 -0.00787295 -0.61004 0 -0.0093914 -0.596696 0 -0.0109711 -0.582324 0 -0.0126024 -0.566894 0 -0.0142761 -0.550397 0 -0.0159845 -0.532848 0 -0.0177218 -0.514283 0 -0.019484 -0.494754 0 -0.0212652 -0.474332 0 -0.0230547 -0.453101 0 -0.0248339 -0.431157 0 -0.0265733 -0.408608 0 -0.0282333 -0.385571 0 -0.0297663 -0.362173 0 -0.0311218 -0.338547 0 -0.032253 -0.314832 0 -0.0331231 -0.291172 0 -0.0337103 -0.267713 0 -0.0340098 -0.244598 0 -0.0340333 -0.221971 0 -0.0338046 -0.199966 0 -0.0333541 -0.178713 0 -0.0327132 -4.7159 0 -0.00204913 -3.36208 0 -0.00202353 -2.41808 0 -0.00200784 -1.77395 0 -0.00199767 -1.34586 0 -0.00199047 -1.07035 0 -0.00198483 -0.899827 0 -0.00198001 -0.799035 0 -0.00197563 -0.742341 0 -0.00197146 -0.711604 0 -0.00196736 -0.694516 0 -0.00196317 -0.683308 0 -0.00195869 -0.673753 0 -0.00195383 -0.664364 0 -0.00322807 -0.65473 0 -0.00450577 -0.644642 0 -0.00582001 -0.633923 0 -0.00719592 -0.622431 0 -0.00864378 -0.610053 0 -0.0101602 -0.596704 0 -0.0117379 -0.582328 0 -0.0133673 -0.566892 0 -0.0150391 -0.550389 0 -0.0167455 -0.532833 0 -0.0184808 -0.51426 0 -0.020241 -0.494723 0 -0.0220201 -0.474291 0 -0.0238074 -0.453049 0 -0.0255839 -0.431094 0 -0.0273204 -0.408532 0 -0.028977 -0.385481 0 -0.0305061 -0.362068 0 -0.0318572 -0.338425 0 -0.0329832 -0.314693 0 -0.0338473 -0.291015 0 -0.0344276 -0.267537 0 -0.0347192 -0.244403 0 -0.0347336 -0.221754 0 -0.0344946 -0.199729 0 -0.0340324 -0.178455 0 -0.0333784 -4.7159 0 -0.00337404 -3.36212 0 -0.00334382 -2.41813 0 -0.00332339 -1.774 0 -0.00330889 -1.3459 0 -0.00329773 -1.07039 0 -0.00328841 -0.899859 0 -0.00328009 -0.799058 0 -0.00327231 -0.742358 0 -0.00326481 -0.711618 0 -0.00325741 -0.694528 0 -0.00324988 -0.683322 0 -0.00324198 -0.673769 0 -0.00323356 -0.664382 0 -0.00450393 -0.65475 0 -0.00577776 -0.644661 0 -0.00708821 -0.63394 0 -0.00846046 -0.622444 0 -0.00990477 -0.61006 0 -0.0114177 -0.596705 0 -0.012992 -0.58232 0 -0.014618 -0.566875 0 -0.0162863 -0.550361 0 -0.0179892 -0.532793 0 -0.0197211 -0.514206 0 -0.0214777 -0.494654 0 -0.0232532 -0.474205 0 -0.0250365 -0.452945 0 -0.0268085 -0.430968 0 -0.0285398 -0.408384 0 -0.0301904 -0.385309 0 -0.0317126 -0.361869 0 -0.0330557 -0.338198 0 -0.0341723 -0.314436 0 -0.0350257 -0.290726 0 -0.0355935 -0.267215 0 -0.0358708 -0.244046 0 -0.0358689 -0.221362 0 -0.0356113 -0.199301 0 -0.0351281 -0.17799 0 -0.0344506 -4.7159 0 -0.00553874 -3.36218 0 -0.0055028 -2.41822 0 -0.00547549 -1.77409 0 -0.00545426 -1.34599 0 -0.00543677 -1.07046 0 -0.00542147 -0.899915 0 -0.0054074 -0.7991 0 -0.00539403 -0.742387 0 -0.00538102 -0.711638 0 -0.00536815 -0.694544 0 -0.00535513 -0.683338 0 -0.00534163 -0.673786 0 -0.00532746 -0.664401 0 -0.00659159 -0.654769 0 -0.00785916 -0.644678 0 -0.00916345 -0.633952 0 -0.0105297 -0.622448 0 -0.0119681 -0.610055 0 -0.0134753 -0.596687 0 -0.0150438 -0.582289 0 -0.016664 -0.566827 0 -0.0183264 -0.550295 0 -0.0200235 -0.532706 0 -0.0217495 -0.514096 0 -0.0235003 -0.494517 0 -0.0252698 -0.474039 0 -0.0270462 -0.452746 0 -0.0288104 -0.430735 0 -0.0305328 -0.408111 0 -0.0321732 -0.384994 0 -0.0336834 -0.361509 0 -0.0350125 -0.337789 0 -0.036113 -0.313975 0 -0.0369476 -0.290211 0 -0.0374937 -0.266642 0 -0.037746 -0.243414 0 -0.0377155 -0.22067 0 -0.0374254 -0.198545 0 -0.0369054 -0.177171 0 -0.0361866 -4.7159 0 -0.0090755 -3.36229 0 -0.00903216 -2.41838 0 -0.00899466 -1.77426 0 -0.00896304 -1.34614 0 -0.00893557 -1.07059 0 -0.00891072 -0.900012 0 -0.00888744 -0.799171 0 -0.00886507 -0.742437 0 -0.00884321 -0.711672 0 -0.00882154 -0.694568 0 -0.0087997 -0.683357 0 -0.00877727 -0.673805 0 -0.00875398 -0.664419 0 -0.0100082 -0.654784 0 -0.0112659 -0.644686 0 -0.0125604 -0.633951 0 -0.0139169 -0.622434 0 -0.0153458 -0.610024 0 -0.0168435 -0.596636 0 -0.0184026 -0.582214 0 -0.0200134 -0.566724 0 -0.0216664 -0.550161 0 -0.023354 -0.532536 0 -0.0250704 -0.513886 0 -0.0268116 -0.494263 0 -0.028571 -0.473735 0 -0.0303362 -0.452387 0 -0.0320876 -0.430315 0 -0.0337952 -0.407625 0 -0.0354182 -0.384436 0 -0.0369083 -0.360873 0 -0.0382139 -0.337071 0 -0.0392868 -0.313169 0 -0.0400894 -0.289311 0 -0.0405984 -0.265645 0 -0.0408079 -0.242316 0 -0.0407283 -0.219467 0 -0.0403824 -0.197236 0 -0.0397992 -0.175752 0 -0.0390093 -4.7159 0 -0.014854 -3.36248 0 -0.0148007 -2.41864 0 -0.0147481 -1.77453 0 -0.0147005 -1.34639 0 -0.0146575 -1.0708 0 -0.0146177 -0.900179 0 -0.01458 -0.799292 0 -0.0145435 -0.74252 0 -0.0145077 -0.711726 0 -0.0144722 -0.694603 0 -0.0144365 -0.683381 0 -0.0144001 -0.673822 0 -0.0143626 -0.66443 0 -0.0156014 -0.654787 0 -0.0168436 -0.644677 0 -0.0181228 -0.633924 0 -0.0194641 -0.622384 0 -0.020878 -0.609946 0 -0.0223607 -0.596524 0 -0.0239047 -0.582062 0 -0.0255004 -0.566527 0 -0.0271383 -0.54991 0 -0.0288108 -0.532225 0 -0.030512 -0.513507 0 -0.0322379 -0.493808 0 -0.0339814 -0.473196 0 -0.0357285 -0.451754 0 -0.037459 -0.429579 0 -0.0391422 -0.406777 0 -0.0407368 -0.383466 0 -0.0421934 -0.359773 0 -0.0434597 -0.33583 0 -0.0444866 -0.311779 0 -0.0452355 -0.287765 0 -0.045682 -0.263935 0 -0.0458194 -0.240435 0 -0.045657 -0.217409 0 -0.0452165 -0.194995 0 -0.0445262 -0.173326 0 -0.0436157 -4.7159 0 -0.0242952 -3.3628 0 -0.0242282 -2.41909 0 -0.0241529 -1.775 0 -0.0240812 -1.34682 0 -0.0240144 -1.07116 0 -0.0239517 -0.900461 0 -0.0238917 -0.799497 0 -0.0238334 -0.742659 0 -0.0237762 -0.711813 0 -0.0237194 -0.694655 0 -0.0236624 -0.68341 0 -0.0236046 -0.673836 0 -0.0235455 -0.664429 0 -0.0247606 -0.654767 0 -0.0259791 -0.644634 0 -0.0272346 -0.633849 0 -0.0285524 -0.62227 0 -0.0299429 -0.609784 0 -0.0314022 -0.596306 0 -0.0329228 -0.581777 0 -0.034495 -0.566164 0 -0.0361094 -0.549459 0 -0.0377581 -0.531673 0 -0.0394355 -0.512841 0 -0.0411375 -0.493014 0 -0.042856 -0.472259 0 -0.0445745 -0.45066 0 -0.0462717 -0.428312 0 -0.0479157 -0.405322 0 -0.049464 -0.381806 0 -0.050866 -0.357892 0 -0.0520676 -0.333714 0 -0.0530185 -0.309413 0 -0.0536782 -0.285135 0 -0.0540208 -0.261028 0 -0.0540379 -0.237239 0 -0.053737 -0.213916 0 -0.0531382 -0.191197 0 -0.0522682 -0.169216 0 -0.0511552 -4.7159 0 -0.0397205 -3.36333 0 -0.0396344 -2.41984 0 -0.0395258 -1.77579 0 -0.0394178 -1.34755 0 -0.0393154 -1.07177 0 -0.0392181 -0.900936 0 -0.0391245 -0.799843 0 -0.0390334 -0.742891 0 -0.0389437 -0.711957 0 -0.0388547 -0.694735 0 -0.0387657 -0.683446 0 -0.0386756 -0.673841 0 -0.038584 -0.664403 0 -0.0397633 -0.654706 0 -0.0409459 -0.644529 0 -0.0421655 -0.63369 0 -0.0434476 -0.622045 0 -0.0448023 -0.609479 0 -0.0462259 -0.595905 0 -0.0477107 -0.581265 0 -0.0492469 -0.565523 0 -0.0508251 -0.548669 0 -0.0524375 -0.530715 0 -0.0540784 -0.511691 0 -0.0557438 -0.491649 0 -0.0574238 -0.470656 0 -0.0590977 -0.448793 0 -0.0607423 -0.426154 0 -0.062324 -0.402848 0 -0.0637979 -0.378989 0 -0.0651112 -0.354706 0 -0.0662075 -0.330134 0 -0.0670338 -0.305414 0 -0.0675469 -0.280693 0 -0.0677181 -0.256123 0 -0.0675361 -0.231852 0 -0.0670054 -0.208029 0 -0.0661435 -0.184798 0 -0.0649742 -0.162293 0 -0.0635235 -4.7159 0 -0.064923 -3.36422 0 -0.0648102 -2.42109 0 -0.064653 -1.77711 0 -0.0644918 -1.34876 0 -0.0643367 -1.07279 0 -0.0641882 -0.901733 0 -0.0640449 -0.80042 0 -0.0639051 -0.743278 0 -0.0637674 -0.712193 0 -0.0636309 -0.694859 0 -0.0634944 -0.683493 0 -0.0633568 -0.673827 0 -0.0632173 -0.664332 0 -0.0643432 -0.65457 0 -0.0654723 -0.644317 0 -0.0666385 -0.633386 0 -0.0678672 -0.621629 0 -0.0691684 -0.608928 0 -0.0705383 -0.595197 0 -0.0719692 -0.580371 0 -0.0734512 -0.564414 0 -0.0749749 -0.547312 0 -0.0765326 -0.529075 0 -0.0781186 -0.509732 0 -0.0797289 -0.489331 0 -0.0813507 -0.467939 0 -0.082956 -0.445634 0 -0.0845187 -0.422511 0 -0.086002 -0.398675 0 -0.0873575 -0.374244 0 -0.0885284 -0.349344 0 -0.0894544 -0.324113 0 -0.0900779 -0.298692 0 -0.0903513 -0.273234 0 -0.0902412 -0.247889 0 -0.0897313 -0.222812 0 -0.0888215 -0.198155 0 -0.0875245 -0.174066 0 -0.0858597 -0.150687 0 -0.0838488 -4.7159 0 -0.1061 -3.3657 0 -0.10595 -2.42318 0 -0.105723 -1.77932 0 -0.105485 -1.3508 0 -0.105254 -1.0745 0 -0.105032 -0.903065 0 -0.104816 -0.801386 0 -0.104606 -0.743923 0 -0.104399 -0.712582 0 -0.104194 -0.695057 0 -0.103989 -0.683553 0 -0.103782 -0.673781 0 -0.103574 -0.664181 0 -0.104622 -0.654306 0 -0.105673 -0.643921 0 -0.106761 -0.632833 0 -0.107911 -0.620888 0 -0.109133 -0.607965 0 -0.110424 -0.593969 0 -0.111775 -0.578835 0 -0.113178 -0.562519 0 -0.114621 -0.545005 0 -0.116098 -0.526297 0 -0.117602 -0.506421 0 -0.119131 -0.485423 0 -0.120666 -0.463364 0 -0.122168 -0.440322 0 -0.123604 -0.41639 0 -0.124934 -0.391672 0 -0.126102 -0.366286 0 -0.127046 -0.340358 0 -0.127697 -0.314028 0 -0.127993 -0.287441 0 -0.127876 -0.26075 0 -0.127306 -0.234115 0 -0.126259 -0.207694 0 -0.124726 -0.181645 0 -0.122712 -0.156126 0 -0.12023 -0.131287 0 -0.117293 -4.7159 0 -0.173376 -3.36814 0 -0.173176 -2.42666 0 -0.172852 -1.78299 0 -0.172506 -1.35418 0 -0.172168 -1.07735 0 -0.171841 -0.905287 0 -0.171525 -0.802994 0 -0.171216 -0.744996 0 -0.170911 -0.713224 0 -0.170609 -0.695375 0 -0.170307 -0.683635 0 -0.170004 -0.673676 0 -0.169699 -0.663895 0 -0.170635 -0.653823 0 -0.171574 -0.643213 0 -0.17255 -0.631862 0 -0.173588 -0.619604 0 -0.174697 -0.606309 0 -0.175873 -0.591875 0 -0.17711 -0.576227 0 -0.178396 -0.559314 0 -0.179723 -0.541113 0 -0.181083 -0.521622 0 -0.182471 -0.500859 0 -0.183882 -0.478865 0 -0.18529 -0.455696 0 -0.186636 -0.431427 0 -0.187881 -0.406147 0 -0.188972 -0.379961 0 -0.189845 -0.352984 0 -0.190428 -0.325344 0 -0.19064 -0.297185 0 -0.190406 -0.268655 0 -0.189657 -0.239914 0 -0.188338 -0.211129 0 -0.186413 -0.182468 0 -0.183859 -0.154102 0 -0.180667 -0.126201 0 -0.176838 -0.0989305 0 -0.172374 -4.7159 0 -0.283295 -3.37218 0 -0.283027 -2.43242 0 -0.282572 -1.7891 0 -0.282081 -1.35982 0 -0.281598 -1.08209 0 -0.28113 -0.908984 0 -0.280676 -0.805671 0 -0.280233 -0.746779 0 -0.279795 -0.714286 0 -0.279362 -0.695892 0 -0.278929 -0.68375 0 -0.278496 -0.67347 0 -0.27806 -0.663378 0 -0.27884 -0.652972 0 -0.279623 -0.641983 0 -0.280442 -0.630189 0 -0.281322 -0.61741 0 -0.282273 -0.603496 0 -0.283289 -0.588333 0 -0.284364 -0.571831 0 -0.285488 -0.553928 0 -0.286651 -0.534585 0 -0.287847 -0.51379 0 -0.289069 -0.491551 0 -0.290313 -0.4679 0 -0.291541 -0.442885 0 -0.292659 -0.416574 0 -0.293613 -0.389053 0 -0.294337 -0.360422 0 -0.294751 -0.330798 0 -0.294762 -0.300312 0 -0.294273 -0.269109 0 -0.293187 -0.237347 0 -0.291415 -0.205196 0 -0.28888 -0.172835 0 -0.285521 -0.140449 0 -0.281296 -0.108227 0 -0.276173 -0.0763614 0 -0.270132 -0.0450445 0 -0.263155 -4.7159 0 -0.462886 -3.37884 0 -0.462533 -2.44198 0 -0.46191 -1.79923 0 -0.461231 -1.36918 0 -0.460561 -1.08998 0 -0.459912 -0.915133 0 -0.459282 -0.810122 0 -0.458665 -0.74974 0 -0.458057 -0.716044 0 -0.457455 -0.696738 0 -0.456854 -0.683917 0 -0.456253 -0.673094 0 -0.455648 -0.662474 0 -0.45622 -0.651503 0 -0.456794 -0.639878 0 -0.457402 -0.627347 0 -0.45807 -0.613697 0 -0.458806 -0.598756 0 -0.459605 -0.582382 0 -0.460461 -0.564462 0 -0.461364 -0.54491 0 -0.462305 -0.52367 0 -0.463276 -0.500708 0 -0.464272 -0.476017 0 -0.46529 -0.449611 0 -0.466267 -0.421525 0 -0.467056 -0.39182 0 -0.467578 -0.360572 0 -0.467742 -0.327878 0 -0.46744 -0.293854 0 -0.466551 -0.258634 0 -0.464946 -0.222372 0 -0.462493 -0.185238 0 -0.459069 -0.147417 0 -0.454559 -0.10911 0 -0.448868 -0.0705295 0 -0.441912 -0.0318966 0 -0.433626 --0.00655967 0 -0.423954 --0.044605 0 -0.412847 -4.7159 0 -0.756307 -3.38984 0 -0.755856 -2.45781 0 -0.755037 -1.81605 0 -0.754138 -1.38472 0 -0.753248 -1.10307 0 -0.752385 -0.925351 0 -0.751547 -0.817518 0 -0.750726 -0.754658 0 -0.749918 -0.718958 0 -0.749116 -0.698126 0 -0.748318 -0.684169 0 -0.747518 -0.672431 0 -0.746716 -0.660922 0 -0.747022 -0.649002 0 -0.747331 -0.636315 0 -0.747672 -0.622552 0 -0.748068 -0.607456 0 -0.748529 -0.590808 0 -0.74905 -0.572422 0 -0.749623 -0.552147 0 -0.750241 -0.529859 0 -0.750893 -0.505466 0 -0.751574 -0.478905 0 -0.752278 -0.450138 0 -0.753001 -0.419154 0 -0.753646 -0.385967 0 -0.75397 -0.35062 0 -0.753856 -0.313177 0 -0.753172 -0.273731 0 -0.751765 -0.232396 0 -0.749463 -0.189311 0 -0.746085 -0.144642 0 -0.741443 -0.0985798 0 -0.735355 -0.051337 0 -0.727647 -0.00315012 0 -0.718159 --0.0457245 0 -0.706748 --0.0950122 0 -0.693286 --0.144422 0 -0.67766 --0.19365 0 -0.659768 -4.7159 0 -1.23571 -3.40797 0 -1.23517 -2.48399 0 -1.23416 -1.84394 0 -1.23304 -1.41053 0 -1.23193 -1.12482 0 -1.23086 -0.942321 0 -1.22982 -0.829801 0 -1.2288 -0.762823 0 -1.22779 -0.723788 0 -1.22679 -0.700415 0 -1.2258 -0.684558 0 -1.2248 -0.671286 0 -1.22381 -0.658288 0 -1.22381 -0.644783 0 -1.22381 -0.630321 0 -1.22384 -0.614511 0 -1.22392 -0.597012 0 -1.22406 -0.577527 0 -1.22425 -0.555801 0 -1.22449 -0.531614 0 -1.22477 -0.504781 0 -1.22508 -0.475153 0 -1.22541 -0.442613 0 -1.22577 -0.407077 0 -1.22614 -0.368488 0 -1.22637 -0.326826 0 -1.22606 -0.282106 0 -1.22502 -0.234375 0 -1.22307 -0.183711 0 -1.21996 -0.130229 0 -1.21545 -0.0740786 0 -1.20926 -0.0154448 0 -1.20112 --0.0454493 0 -1.19074 --0.108344 0 -1.17786 --0.172945 0 -1.1622 --0.238921 0 -1.14352 --0.30591 0 -1.12159 --0.37352 0 -1.09621 --0.441327 0 -1.06718 -4.7159 0 -2.01898 -3.43785 0 -2.01839 -2.52732 0 -2.01728 -1.89016 0 -2.01605 -1.45334 0 -2.01483 -1.16092 0 -2.01365 -0.970498 0 -2.0125 -0.850197 0 -2.01137 -0.776378 0 -2.01026 -0.731799 0 -2.00915 -0.704195 0 -2.00806 -0.685171 0 -2.00696 -0.669339 0 -2.00586 -0.653852 0 -2.00557 -0.637702 0 -2.00529 -0.620288 0 -2.00503 -0.601072 0 -2.00481 -0.57958 0 -2.00463 -0.555385 0 -2.0045 -0.528113 0 -2.00441 -0.497432 0 -2.00434 -0.463053 0 -2.0043 -0.424732 0 -2.00429 -0.382264 0 -2.00428 -0.335484 0 -2.00429 -0.284265 0 -2.00405 -0.228528 0 -2.00291 -0.168242 0 -2.00058 -0.103421 0 -1.99674 -0.0341266 0 -1.99103 --0.0395291 0 -1.98307 --0.117381 0 -1.97245 --0.19921 0 -1.95872 --0.284737 0 -1.94144 --0.37363 0 -1.92018 --0.465493 0 -1.8945 --0.559875 0 -1.86397 --0.656267 0 -1.82821 --0.754105 0 -1.78684 --0.852773 0 -1.73953 -4.7159 0 -3.29872 -3.48708 0 -3.29824 -2.59898 0 -3.29733 -1.96677 0 -3.29631 -1.52436 0 -3.2953 -1.22084 0 -3.29432 -1.01727 0 -3.29337 -0.884056 0 -3.29243 -0.798878 0 -3.29151 -0.745089 0 -3.2906 -0.710451 0 -3.2897 -0.686154 0 -3.28879 -0.666056 0 -3.28788 -0.646422 0 -3.28748 -0.625867 0 -3.28708 -0.60354 0 -3.28669 -0.578666 0 -3.28633 -0.550542 0 -3.286 -0.518527 0 -3.28569 -0.482048 0 -3.28541 -0.440585 0 -3.28514 -0.393678 0 -3.2849 -0.340923 0 -3.28466 -0.281971 0 -3.28443 -0.216521 0 -3.28421 -0.14433 0 -3.28356 -0.0652197 0 -3.28141 --0.0209162 0 -3.27729 --0.114117 0 -3.27068 --0.214351 0 -3.26104 --0.321509 0 -3.24773 --0.435399 0 -3.2301 --0.555747 0 -3.20746 --0.682184 0 -3.1791 --0.81425 0 -3.1443 --0.951389 0 -3.10233 --1.09295 0 -3.0525 --1.23817 0 -2.99413 --1.38621 0 -2.92658 --1.53614 0 -2.84929 -4.7159 0 -5.3896 -3.56817 0 -5.3896 -2.71749 0 -5.3896 -2.0937 0 -5.3896 -1.64214 0 -5.3896 -1.32026 0 -5.3896 -1.0949 0 -5.3896 -0.940257 0 -5.3896 -0.836222 0 -5.3896 -0.767138 0 -5.3896 -0.720812 0 -5.3896 -0.687748 0 -5.3896 -0.660548 0 -5.3896 -0.634015 0 -5.3896 -0.606133 0 -5.3896 -0.575641 0 -5.3896 -0.541367 0 -5.3896 -0.50223 0 -5.3896 -0.457234 0 -5.3896 -0.405469 0 -5.3896 -0.346108 0 -5.3896 -0.278403 0 -5.3896 -0.201685 0 -5.3896 -0.115363 0 -5.3896 -0.018916 0 -5.3896 --0.0880976 0 -5.38888 --0.206017 0 -5.38566 --0.335076 0 -5.37917 --0.475401 0 -5.36859 --0.62701 0 -5.353 --0.789798 0 -5.33142 --0.963531 0 -5.30277 --1.14784 0 -5.26595 --1.34221 0 -5.2198 --1.54597 0 -5.16312 --1.75829 0 -5.09472 --1.97819 0 -5.01344 --2.2045 0 -4.91812 --2.43592 0 -4.80771 --2.67095 0 -4.68122 -0.695766 0.110759 -0.00121758 -0.686624 0.110879 -0.00243834 -0.677056 0.111003 -0.00369347 -0.666896 0.111132 -0.00500669 -0.656008 0.111267 -0.00638782 -0.644283 0.111408 -0.00783375 -0.63164 0.111554 -0.00933762 -0.618025 0.111704 -0.0108904 -0.603406 0.111858 -0.0124831 -0.587777 0.112014 -0.0141087 -0.571151 0.112171 -0.0157615 -0.553562 0.11233 -0.0174377 -0.535061 0.11249 -0.0191319 -0.515714 0.112648 -0.0208339 -0.495601 0.112805 -0.0225261 -0.474812 0.112957 -0.0241806 -0.45345 0.1131 -0.0257599 -0.431623 0.11323 -0.027219 -0.40945 0.113344 -0.02851 -0.387054 0.113436 -0.0295886 -0.364567 0.113503 -0.0304202 -0.342123 0.113545 -0.0309841 -0.319859 0.113561 -0.031276 -0.297912 0.113552 -0.0313071 -0.276418 0.113522 -0.0311 -0.255506 0.113472 -0.0306836 -0.2353 0.113406 -0.0300878 -4.7159 0.110634 -2.5115e-05 -3.37086 0.110633 -2.6519e-05 -2.43321 0.110633 -2.4718e-05 -1.79364 0.110634 -2.382e-05 -1.36879 0.110634 -2.3405e-05 -1.09557 0.110635 -2.3267e-05 -0.926664 0.110635 -2.3163e-05 -0.827025 0.110635 -2.2765e-05 -0.771175 0.110635 -2.2027e-05 -0.741085 0.110636 -2.1359e-05 -0.724527 0.110637 -2.098e-05 -0.713788 0.110637 -2.0786e-05 -0.70468 0.110638 -2.0742e-05 -0.695769 0.110758 -0.00123799 -0.686627 0.110879 -0.00245871 -0.677059 0.111002 -0.00371385 -0.666899 0.111131 -0.00502714 -0.65601 0.111266 -0.00640836 -0.644285 0.111407 -0.00785439 -0.631643 0.111553 -0.00935838 -0.618027 0.111704 -0.0109112 -0.603409 0.111857 -0.0125041 -0.587779 0.112013 -0.0141298 -0.571153 0.112171 -0.0157827 -0.553564 0.112329 -0.017459 -0.535063 0.112489 -0.0191532 -0.515716 0.112648 -0.0208553 -0.495602 0.112805 -0.0225474 -0.474814 0.112956 -0.024202 -0.453451 0.1131 -0.0257813 -0.431624 0.11323 -0.0272404 -0.409451 0.113343 -0.0285314 -0.387055 0.113435 -0.02961 -0.364567 0.113503 -0.0304416 -0.342123 0.113545 -0.0310055 -0.319859 0.113561 -0.0312973 -0.297912 0.113552 -0.0313283 -0.276417 0.113521 -0.0311212 -0.255505 0.113472 -0.0307048 -0.235299 0.113406 -0.0301089 -4.7159 0.110637 -6.6393e-05 -3.37086 0.110633 -7.3205e-05 -2.43322 0.110633 -6.8546e-05 -1.79364 0.110633 -6.6196e-05 -1.36879 0.110633 -6.5115e-05 -1.09557 0.110633 -6.479e-05 -0.926668 0.110633 -6.4588e-05 -0.827029 0.110633 -6.3605e-05 -0.771178 0.110633 -6.1682e-05 -0.741087 0.110634 -5.9931e-05 -0.724528 0.110635 -5.8976e-05 -0.713788 0.110636 -5.8567e-05 -0.704682 0.110637 -5.9076e-05 -0.695773 0.110757 -0.00127509 -0.686632 0.110877 -0.0024956 -0.677063 0.111001 -0.0037507 -0.666903 0.111129 -0.00506404 -0.656015 0.111265 -0.00644537 -0.64429 0.111406 -0.00789155 -0.631647 0.111552 -0.00939569 -0.618031 0.111702 -0.0109487 -0.603412 0.111856 -0.0125418 -0.587783 0.112012 -0.0141675 -0.571157 0.112169 -0.0158206 -0.553567 0.112328 -0.0174969 -0.535066 0.112488 -0.0191912 -0.515719 0.112646 -0.0208933 -0.495605 0.112803 -0.0225855 -0.474817 0.112955 -0.0242401 -0.453454 0.113098 -0.0258194 -0.431627 0.113229 -0.0272785 -0.409453 0.113342 -0.0285694 -0.387056 0.113434 -0.029648 -0.364569 0.113502 -0.0304795 -0.342124 0.113544 -0.0310433 -0.319859 0.11356 -0.031335 -0.297912 0.113551 -0.0313659 -0.276417 0.113521 -0.0311586 -0.255504 0.113471 -0.030742 -0.235298 0.113406 -0.030146 -4.7159 0.110641 -0.000134293 -3.37087 0.110632 -0.000155678 -2.43323 0.110631 -0.000146488 -1.79365 0.110631 -0.000141784 -1.3688 0.110631 -0.000139634 -1.09558 0.110631 -0.000139047 -0.926675 0.110629 -0.000138726 -0.827034 0.110629 -0.000136774 -0.771183 0.110629 -0.000132888 -0.741091 0.11063 -0.000129404 -0.724529 0.110632 -0.000127618 -0.713789 0.110634 -0.000127081 -0.704687 0.110636 -0.000129687 -0.695782 0.110754 -0.00134235 -0.68664 0.110874 -0.00256225 -0.677072 0.110998 -0.00381714 -0.666911 0.111127 -0.00513045 -0.656023 0.111262 -0.00651187 -0.644297 0.111403 -0.00795822 -0.631654 0.111549 -0.00946258 -0.618038 0.111699 -0.0110158 -0.603419 0.111853 -0.0126091 -0.587789 0.112009 -0.014235 -0.571163 0.112167 -0.0158882 -0.553573 0.112326 -0.0175647 -0.535072 0.112485 -0.019259 -0.515724 0.112644 -0.0209612 -0.49561 0.112801 -0.0226534 -0.474821 0.112953 -0.0243079 -0.453458 0.113096 -0.0258871 -0.43163 0.113227 -0.0273461 -0.409456 0.11334 -0.0286369 -0.387059 0.113432 -0.0297152 -0.36457 0.1135 -0.0305466 -0.342125 0.113542 -0.0311101 -0.319859 0.113559 -0.0314017 -0.297911 0.11355 -0.0314322 -0.276416 0.11352 -0.0312246 -0.255503 0.11347 -0.0308076 -0.235296 0.113405 -0.0302111 -4.7159 0.110649 -0.000245909 -3.37088 0.110631 -0.000301148 -2.43324 0.110629 -0.000284838 -1.79367 0.110628 -0.000276347 -1.36882 0.110628 -0.000272493 -1.0956 0.110626 -0.000271529 -0.926688 0.110623 -0.000271006 -0.827044 0.110621 -0.000267345 -0.771191 0.110621 -0.000260159 -0.741097 0.110624 -0.000253956 -0.724533 0.110627 -0.000251073 -0.713789 0.110629 -0.000250777 -0.704695 0.110633 -0.00025896 -0.695797 0.11075 -0.00146376 -0.686655 0.11087 -0.00268214 -0.677087 0.110993 -0.0039364 -0.666926 0.111122 -0.00524946 -0.656037 0.111257 -0.00663084 -0.644311 0.111398 -0.00807733 -0.631667 0.111544 -0.00958192 -0.61805 0.111695 -0.0111355 -0.603431 0.111849 -0.012729 -0.5878 0.112005 -0.0143552 -0.571173 0.112162 -0.0160086 -0.553583 0.112322 -0.0176852 -0.535081 0.112481 -0.0193796 -0.515733 0.11264 -0.0210818 -0.495619 0.112797 -0.0227738 -0.47483 0.112949 -0.0244282 -0.453466 0.113093 -0.0260071 -0.431637 0.113224 -0.0274657 -0.409461 0.113337 -0.0287561 -0.387063 0.11343 -0.0298341 -0.364573 0.113498 -0.030665 -0.342127 0.11354 -0.031228 -0.31986 0.113556 -0.031519 -0.297911 0.113548 -0.0315489 -0.276414 0.113518 -0.0313406 -0.2555 0.113469 -0.0309227 -0.235292 0.113403 -0.0303252 -4.7159 0.110663 -0.000429173 -3.3709 0.110629 -0.000556274 -2.43327 0.110625 -0.000528959 -1.7937 0.110623 -0.000514455 -1.36884 0.110622 -0.000507921 -1.09562 0.110619 -0.000506418 -0.92671 0.110613 -0.000505474 -0.827063 0.110608 -0.000498743 -0.771205 0.110608 -0.00048607 -0.741108 0.110612 -0.000475748 -0.724539 0.110617 -0.000471635 -0.713791 0.110621 -0.000472621 -0.704709 0.110628 -0.000493411 -0.695824 0.110742 -0.0016815 -0.686682 0.110861 -0.00289642 -0.677113 0.110985 -0.00414909 -0.666951 0.111113 -0.0054613 -0.656061 0.111249 -0.00684228 -0.644334 0.11139 -0.00828871 -0.63169 0.111536 -0.00979346 -0.618072 0.111687 -0.0113473 -0.603451 0.111841 -0.0129412 -0.58782 0.111997 -0.0145677 -0.571192 0.112155 -0.0162214 -0.553601 0.112314 -0.0178981 -0.535099 0.112474 -0.0195925 -0.51575 0.112633 -0.0212945 -0.495635 0.112791 -0.0229862 -0.474844 0.112943 -0.02464 -0.453479 0.113087 -0.0262183 -0.431649 0.113218 -0.0276761 -0.409471 0.113332 -0.0289657 -0.387071 0.113424 -0.0300428 -0.364579 0.113493 -0.0308726 -0.342129 0.113536 -0.0314346 -0.319861 0.113553 -0.0317244 -0.297909 0.113545 -0.031753 -0.27641 0.113515 -0.0315431 -0.255494 0.113466 -0.0311235 -0.235285 0.113401 -0.0305239 -4.7159 0.110687 -0.000729726 -3.37094 0.110626 -0.000999689 -2.43332 0.110618 -0.000955765 -1.79374 0.110614 -0.000931887 -1.36889 0.110611 -0.000921223 -1.09567 0.110605 -0.000918949 -0.926748 0.110595 -0.000917109 -0.827095 0.110586 -0.000904929 -0.771232 0.110586 -0.00088339 -0.74113 0.110592 -0.000867194 -0.724553 0.1106 -0.000862246 -0.713796 0.110607 -0.000867017 -0.704735 0.110619 -0.000913012 -0.695871 0.110728 -0.00206865 -0.68673 0.110847 -0.00327615 -0.677159 0.11097 -0.00452518 -0.666996 0.111099 -0.00583522 -0.656104 0.111234 -0.0072149 -0.644376 0.111375 -0.00866069 -0.631729 0.111522 -0.0101653 -0.61811 0.111673 -0.0117192 -0.603487 0.111827 -0.0133134 -0.587854 0.111984 -0.0149403 -0.571225 0.112142 -0.0165941 -0.553633 0.112302 -0.0182709 -0.535129 0.112462 -0.019965 -0.515779 0.112622 -0.0216665 -0.495662 0.112779 -0.0233573 -0.474869 0.112932 -0.02501 -0.453502 0.113076 -0.0265869 -0.431669 0.113208 -0.0280431 -0.409488 0.113322 -0.0293309 -0.387084 0.113416 -0.030406 -0.364588 0.113485 -0.0312338 -0.342134 0.113529 -0.0317936 -0.319861 0.113547 -0.0320809 -0.297906 0.11354 -0.0321069 -0.276404 0.11351 -0.0318939 -0.255485 0.113462 -0.0314707 -0.235273 0.113397 -0.0308669 -4.7159 0.110727 -0.00122215 -3.371 0.110621 -0.00176137 -2.4334 0.110607 -0.00169316 -1.79383 0.110599 -0.001655 -1.36897 0.110593 -0.00163813 -1.09574 0.110583 -0.00163477 -0.926815 0.110564 -0.00163108 -0.827152 0.110549 -0.00160955 -0.771281 0.110547 -0.00157434 -0.741172 0.110557 -0.00155059 -0.724581 0.110571 -0.00154659 -0.71381 0.110584 -0.00156058 -0.704783 0.110602 -0.00165095 -0.695952 0.110705 -0.00274982 -0.686811 0.110822 -0.0039421 -0.677238 0.110945 -0.00518335 -0.667072 0.111073 -0.00648846 -0.656178 0.111209 -0.0078648 -0.644446 0.111351 -0.00930852 -0.631796 0.111498 -0.010812 -0.618174 0.111649 -0.0123655 -0.603548 0.111804 -0.0139595 -0.587912 0.111961 -0.0155864 -0.57128 0.11212 -0.0172402 -0.553686 0.112281 -0.0189166 -0.535179 0.112441 -0.02061 -0.515827 0.112602 -0.0223101 -0.495708 0.11276 -0.023999 -0.474912 0.112913 -0.0256492 -0.45354 0.113059 -0.0272231 -0.431702 0.113191 -0.0286759 -0.409515 0.113307 -0.02996 -0.387105 0.113402 -0.0310313 -0.364602 0.113473 -0.031855 -0.342141 0.113518 -0.0324104 -0.319862 0.113537 -0.0326931 -0.2979 0.113531 -0.0327138 -0.276392 0.113503 -0.0324948 -0.255467 0.113456 -0.0320647 -0.235251 0.113392 -0.0314528 -4.7159 0.110795 -0.00202831 -3.37111 0.110612 -0.0030516 -2.43354 0.110587 -0.00294933 -1.79397 0.110573 -0.00289001 -1.36911 0.110563 -0.00286408 -1.09587 0.110545 -0.00285921 -0.926932 0.110513 -0.00285191 -0.827256 0.110486 -0.00281508 -0.771375 0.110483 -0.00276024 -0.741258 0.110499 -0.00272851 -0.724646 0.110521 -0.00273032 -0.713851 0.110543 -0.00276423 -0.704872 0.11057 -0.00292126 -0.696088 0.110665 -0.00393317 -0.686949 0.110779 -0.00509579 -0.677371 0.110902 -0.00632128 -0.6672 0.11103 -0.00761591 -0.6563 0.111166 -0.00898473 -0.644563 0.111309 -0.0104233 -0.631908 0.111457 -0.0119233 -0.618279 0.111609 -0.0134747 -0.603648 0.111765 -0.0150675 -0.588007 0.111923 -0.0166934 -0.571371 0.112084 -0.0183463 -0.553772 0.112245 -0.0200213 -0.535262 0.112407 -0.0217126 -0.515906 0.112569 -0.0234096 -0.495782 0.112728 -0.0250944 -0.474981 0.112883 -0.0267395 -0.453602 0.113029 -0.0283074 -0.431756 0.113164 -0.0297536 -0.409559 0.113281 -0.0310306 -0.387138 0.113378 -0.0320942 -0.364623 0.113452 -0.0329101 -0.34215 0.113499 -0.0334572 -0.319859 0.113521 -0.0337309 -0.297886 0.113517 -0.0337417 -0.276368 0.113491 -0.0335114 -0.255434 0.113445 -0.0330683 -0.235209 0.113383 -0.0324412 -4.7159 0.110906 -0.00334735 -3.37129 0.110599 -0.00520266 -2.43377 0.110555 -0.00505519 -1.79422 0.110531 -0.00496557 -1.36935 0.110514 -0.00492691 -1.0961 0.110483 -0.00491994 -0.927137 0.110429 -0.004906 -0.827445 0.110384 -0.00484569 -0.771559 0.110377 -0.00476551 -0.741436 0.110403 -0.00472929 -0.724793 0.11044 -0.00474759 -0.71396 0.110474 -0.00481955 -0.705035 0.110511 -0.00505782 -0.696311 0.110597 -0.00595732 -0.687175 0.110709 -0.00706614 -0.677588 0.11083 -0.00826131 -0.667408 0.110959 -0.00953512 -0.656498 0.111096 -0.0108883 -0.644751 0.111239 -0.0123154 -0.632085 0.111389 -0.013807 -0.618448 0.111543 -0.0153525 -0.603808 0.1117 -0.016941 -0.588159 0.111861 -0.0185636 -0.571515 0.112023 -0.0202132 -0.553909 0.112186 -0.0218845 -0.535393 0.11235 -0.0235708 -0.51603 0.112514 -0.0252613 -0.495898 0.112675 -0.0269378 -0.475087 0.112832 -0.0285729 -0.453697 0.112981 -0.0301293 -0.431836 0.113119 -0.0315627 -0.409623 0.11324 -0.0328261 -0.387183 0.113341 -0.0338756 -0.364649 0.113418 -0.0346766 -0.342156 0.113469 -0.0352083 -0.319845 0.113495 -0.0354653 -0.297853 0.113495 -0.0354578 -0.276318 0.113473 -0.0352068 -0.255369 0.11343 -0.0347397 -0.23513 0.11337 -0.0340848 -4.7159 0.111091 -0.00550466 -3.37159 0.110579 -0.00872635 -2.43416 0.110504 -0.00852354 -1.79462 0.110463 -0.00839223 -1.36974 0.110436 -0.00833642 -1.09647 0.110385 -0.00832651 -0.927497 0.110296 -0.00830115 -0.8278 0.110222 -0.00820781 -0.771926 0.11021 -0.00810058 -0.741808 0.110251 -0.00807166 -0.725118 0.110308 -0.00812586 -0.714229 0.110358 -0.00825917 -0.705339 0.110407 -0.00857299 -0.696669 0.110487 -0.00935338 -0.687535 0.110594 -0.0103756 -0.677933 0.110714 -0.0115165 -0.667733 0.110843 -0.0127514 -0.656804 0.110981 -0.0140746 -0.645039 0.111127 -0.0154782 -0.632357 0.111279 -0.0169518 -0.618703 0.111436 -0.0184833 -0.604048 0.111597 -0.0200611 -0.588385 0.11176 -0.0216747 -0.571729 0.111926 -0.0233159 -0.554113 0.112092 -0.0249781 -0.535585 0.112259 -0.0266536 -0.51621 0.112426 -0.0283309 -0.496065 0.112591 -0.0299913 -0.475239 0.112752 -0.0316074 -0.453829 0.112905 -0.0331422 -0.431945 0.113047 -0.0345522 -0.409705 0.113174 -0.0357906 -0.387235 0.113281 -0.0368141 -0.364668 0.113365 -0.0375882 -0.342142 0.113423 -0.0380916 -0.319798 0.113455 -0.0383186 -0.297776 0.113461 -0.0382779 -0.276212 0.113444 -0.0379895 -0.255237 0.113407 -0.0374795 -0.234974 0.113352 -0.036775 -4.7159 0.111395 -0.00903198 -3.37205 0.110551 -0.0143905 -2.43477 0.110426 -0.0141282 -1.79527 0.11036 -0.0139422 -1.37039 0.110317 -0.0138645 -1.09711 0.110236 -0.0138503 -0.928136 0.110094 -0.0138068 -0.82847 0.109975 -0.0136726 -0.77266 0.109955 -0.0135477 -0.742572 0.110017 -0.0135511 -0.725812 0.110099 -0.0136679 -0.714826 0.11017 -0.0138782 -0.705909 0.11023 -0.0142428 -0.697244 0.110309 -0.0149182 -0.688096 0.110412 -0.0158249 -0.678459 0.110531 -0.0168789 -0.668222 0.110661 -0.0180473 -0.657256 0.110801 -0.0193168 -0.645457 0.11095 -0.0206766 -0.632744 0.111106 -0.0221145 -0.619063 0.111268 -0.0236171 -0.604383 0.111434 -0.025171 -0.588698 0.111603 -0.026764 -0.572022 0.111774 -0.0283861 -0.554387 0.111946 -0.0300285 -0.535841 0.112118 -0.0316819 -0.516447 0.11229 -0.0333334 -0.49628 0.11246 -0.0349636 -0.475427 0.112627 -0.0365449 -0.453985 0.112787 -0.038041 -0.432063 0.112937 -0.039409 -0.409779 0.113072 -0.040603 -0.38726 0.113189 -0.0415804 -0.364641 0.113282 -0.0423066 -0.342061 0.113351 -0.0427599 -0.319664 0.113393 -0.0429334 -0.297591 0.113409 -0.0428341 -0.275979 0.113402 -0.0424799 -0.254958 0.113372 -0.0418947 -0.234653 0.113325 -0.0411035 -4.7159 0.111895 -0.0147982 -3.37279 0.11052 -0.0233202 -2.43575 0.110315 -0.0230087 -1.79631 0.110211 -0.0227548 -1.37145 0.110145 -0.0226507 -1.09819 0.11002 -0.0226302 -0.929268 0.109802 -0.0225602 -0.829733 0.109619 -0.0223859 -0.774095 0.109587 -0.0222725 -0.74407 0.109672 -0.022346 -0.727188 0.109783 -0.0225472 -0.71602 0.109874 -0.0228276 -0.706955 0.109947 -0.023214 -0.698186 0.11003 -0.0238061 -0.688958 0.110133 -0.0245901 -0.67924 0.110253 -0.0255282 -0.668923 0.110386 -0.0265963 -0.657884 0.11053 -0.0277795 -0.646021 0.110684 -0.0290648 -0.633251 0.110846 -0.0304387 -0.61952 0.111015 -0.0318864 -0.604797 0.111188 -0.0333926 -0.589074 0.111366 -0.0349432 -0.572363 0.111545 -0.0365255 -0.554696 0.111725 -0.0381277 -0.536119 0.111906 -0.039738 -0.516692 0.112086 -0.0413413 -0.496488 0.112265 -0.042917 -0.475591 0.112441 -0.0444372 -0.454097 0.112612 -0.045866 -0.432113 0.112773 -0.0471614 -0.409758 0.112921 -0.0482789 -0.387161 0.113052 -0.0491764 -0.364458 0.113161 -0.0498196 -0.341792 0.113245 -0.0501859 -0.319308 0.113302 -0.0502663 -0.29715 0.113333 -0.0500652 -0.275456 0.113338 -0.0495971 -0.254359 0.113321 -0.0488825 -0.233981 0.113286 -0.0479434 -4.7159 0.112717 -0.024223 -3.3739 0.110502 -0.0371388 -2.43726 0.11017 -0.0368158 -1.79794 0.110011 -0.0364824 -1.37314 0.109916 -0.0363487 -1.09998 0.109731 -0.0363184 -0.931261 0.109407 -0.0362144 -0.832065 0.109138 -0.0360191 -0.776768 0.109088 -0.0359693 -0.74681 0.109194 -0.0361491 -0.729691 0.109327 -0.0364339 -0.718183 0.109437 -0.0367594 -0.708791 0.109523 -0.0371461 -0.699743 0.109615 -0.0376726 -0.69029 0.109725 -0.0383477 -0.680381 0.10985 -0.0391605 -0.669893 0.109989 -0.0401026 -0.658706 0.11014 -0.0411654 -0.646713 0.110302 -0.0423386 -0.633833 0.110473 -0.0436094 -0.620008 0.110653 -0.044963 -0.605205 0.110838 -0.0463833 -0.589413 0.111027 -0.0478543 -0.57264 0.111218 -0.0493603 -0.554916 0.111411 -0.0508863 -0.536282 0.111604 -0.0524169 -0.516796 0.111797 -0.0539339 -0.496526 0.11199 -0.055415 -0.475554 0.112179 -0.0568311 -0.453971 0.112365 -0.0581467 -0.431886 0.112543 -0.0593208 -0.409417 0.112709 -0.0603101 -0.386693 0.112859 -0.0610733 -0.363855 0.112989 -0.0615758 -0.341048 0.113094 -0.0617935 -0.318422 0.113172 -0.0617145 -0.296122 0.113223 -0.061339 -0.27429 0.113248 -0.0606768 -0.253057 0.11325 -0.0597434 -0.232546 0.113232 -0.0585561 -4.7159 0.114065 -0.0396265 -3.37557 0.11054 -0.0582015 -2.43957 0.110008 -0.0579464 -1.80048 0.109779 -0.0575259 -1.37584 0.109646 -0.0573612 -1.10294 0.109384 -0.0573155 -0.934713 0.108923 -0.0571756 -0.836196 0.108549 -0.0570045 -0.78141 0.108469 -0.0570786 -0.751411 0.108581 -0.0573765 -0.733834 0.108726 -0.0577241 -0.721752 0.108848 -0.0580707 -0.711794 0.108946 -0.0584457 -0.702232 0.10905 -0.058918 -0.692333 0.109171 -0.0595029 -0.682032 0.109307 -0.0601991 -0.671203 0.109456 -0.0610074 -0.659719 0.109618 -0.0619269 -0.647471 0.109793 -0.0629527 -0.634373 0.109978 -0.0640763 -0.620364 0.110172 -0.0652857 -0.605403 0.110373 -0.0665661 -0.589475 0.110578 -0.0679009 -0.572582 0.110787 -0.0692727 -0.554745 0.110997 -0.0706635 -0.536001 0.111208 -0.0720542 -0.516401 0.111419 -0.0734232 -0.496008 0.111629 -0.0747451 -0.474899 0.111838 -0.0759895 -0.453163 0.112044 -0.0771202 -0.430905 0.112244 -0.0780966 -0.408243 0.112435 -0.0788762 -0.38531 0.11261 -0.0794178 -0.362248 0.112766 -0.0796857 -0.339208 0.112898 -0.0796532 -0.31634 0.113003 -0.0793042 -0.293795 0.113081 -0.0786332 -0.271717 0.113133 -0.0776433 -0.250238 0.113161 -0.0763434 -0.229481 0.11317 -0.0747449 -4.7159 0.116274 -0.0647995 -3.37804 0.11074 -0.090039 -2.44307 0.109894 -0.0899891 -1.80439 0.109576 -0.0894772 -1.38011 0.109403 -0.0892824 -1.1078 0.109045 -0.0892146 -0.940538 0.108423 -0.0890507 -0.843103 0.10793 -0.0889688 -0.788824 0.107801 -0.0892028 -0.758472 0.107893 -0.0896029 -0.740092 0.108034 -0.0899941 -0.727117 0.108159 -0.0903516 -0.716296 0.108264 -0.0907122 -0.705928 0.108378 -0.0911378 -0.695291 0.108511 -0.0916446 -0.684322 0.108661 -0.0922336 -0.672892 0.108825 -0.0929081 -0.660873 0.109003 -0.0936704 -0.648154 0.109194 -0.0945199 -0.634646 0.109397 -0.0954524 -0.62028 0.10961 -0.0964604 -0.605009 0.10983 -0.0975323 -0.588807 0.110057 -0.0986537 -0.571666 0.110286 -0.0998074 -0.553596 0.110519 -0.100974 -0.534626 0.110752 -0.102132 -0.514795 0.110986 -0.103256 -0.494159 0.111221 -0.104318 -0.472787 0.111455 -0.105284 -0.450766 0.111687 -0.106118 -0.428196 0.111915 -0.106776 -0.405195 0.112134 -0.107216 -0.381896 0.11234 -0.107395 -0.358444 0.112527 -0.107274 -0.334991 0.112692 -0.106823 -0.311694 0.112831 -0.106019 -0.288705 0.112943 -0.104849 -0.266172 0.113029 -0.103308 -0.244227 0.113093 -0.101397 -0.222996 0.11314 -0.0991185 -4.7159 0.119895 -0.105937 -3.38169 0.111348 -0.138225 -2.44841 0.109997 -0.138593 -1.81049 0.109572 -0.137989 -1.38694 0.109355 -0.137766 -1.11577 0.108886 -0.137671 -0.950073 0.108089 -0.137517 -0.853914 0.107473 -0.137579 -0.799725 0.107271 -0.13796 -0.768437 0.107318 -0.138433 -0.748751 0.107437 -0.138857 -0.734459 0.107556 -0.139223 -0.722391 0.10766 -0.139569 -0.710854 0.10778 -0.139949 -0.699129 0.107923 -0.140377 -0.68715 0.108084 -0.140855 -0.674789 0.108263 -0.141384 -0.661916 0.108457 -0.141968 -0.648421 0.108667 -0.142607 -0.63421 0.108889 -0.143298 -0.619209 0.109123 -0.144038 -0.603361 0.109365 -0.144819 -0.586629 0.109615 -0.145628 -0.568992 0.109869 -0.14645 -0.550447 0.110127 -0.147267 -0.531006 0.110387 -0.148056 -0.510698 0.110649 -0.14879 -0.489567 0.110913 -0.149436 -0.467672 0.111177 -0.149959 -0.445093 0.11144 -0.150317 -0.421925 0.1117 -0.150464 -0.398282 0.111953 -0.150353 -0.374297 0.112194 -0.149937 -0.350114 0.112419 -0.149172 -0.325889 0.112622 -0.148018 -0.301781 0.112801 -0.146446 -0.277944 0.112956 -0.144432 -0.254527 0.113088 -0.141962 -0.231669 0.113202 -0.139026 -0.209494 0.113305 -0.13562 -4.7159 0.125827 -0.173161 -3.38721 0.112936 -0.211935 -2.45674 0.110743 -0.213034 -1.82023 0.110183 -0.212342 -1.39808 0.109914 -0.212088 -1.12883 0.109315 -0.211965 -0.965154 0.108352 -0.21186 -0.869785 0.107619 -0.212054 -0.814656 0.107331 -0.212507 -0.781499 0.107318 -0.212998 -0.759779 0.107408 -0.213419 -0.743574 0.107514 -0.213767 -0.729743 0.107614 -0.214072 -0.716566 0.107735 -0.214377 -0.703315 0.107883 -0.214695 -0.689912 0.108054 -0.215027 -0.67622 0.108244 -0.215372 -0.662104 0.108452 -0.215731 -0.647445 0.108677 -0.216104 -0.63214 0.108917 -0.216488 -0.616105 0.109169 -0.216879 -0.599273 0.109433 -0.217269 -0.581592 0.109704 -0.217648 -0.563026 0.109983 -0.218001 -0.543556 0.110268 -0.218309 -0.523178 0.110556 -0.218549 -0.501907 0.110849 -0.21869 -0.479772 0.111145 -0.218697 -0.45682 0.111444 -0.218529 -0.433121 0.111744 -0.218136 -0.408761 0.112044 -0.217466 -0.38385 0.112338 -0.216465 -0.358513 0.112623 -0.215074 -0.332896 0.112895 -0.21324 -0.30715 0.11315 -0.210914 -0.281436 0.113384 -0.208051 -0.255913 0.1136 -0.204617 -0.230731 0.113799 -0.200585 -0.206036 0.113988 -0.195933 -0.181957 0.114175 -0.190647 -4.7159 0.135541 -0.283012 -3.39585 0.116831 -0.326522 -2.47025 0.113187 -0.328792 -1.83641 0.112427 -0.32802 -1.41678 0.112075 -0.327704 -1.15025 0.111328 -0.327524 -0.98816 0.110238 -0.327424 -0.891916 0.109423 -0.327592 -0.834065 0.109066 -0.327939 -0.797647 0.109007 -0.3283 -0.77283 0.109072 -0.328598 -0.753854 0.109171 -0.328822 -0.737529 0.109269 -0.328985 -0.722072 0.109394 -0.329116 -0.706716 0.109549 -0.329225 -0.691355 0.109729 -0.329312 -0.675825 0.10993 -0.329377 -0.659965 0.110151 -0.329418 -0.643633 0.11039 -0.32943 -0.626704 0.110645 -0.329409 -0.609072 0.110915 -0.329346 -0.590649 0.111198 -0.32923 -0.571361 0.111492 -0.329047 -0.551153 0.111797 -0.328778 -0.529986 0.11211 -0.328399 -0.50784 0.112431 -0.327881 -0.48471 0.11276 -0.327187 -0.460611 0.113098 -0.326273 -0.435577 0.113442 -0.325085 -0.409664 0.113793 -0.323565 -0.382947 0.114147 -0.321645 -0.355528 0.114502 -0.319258 -0.327527 0.114854 -0.316329 -0.299082 0.115199 -0.31279 -0.270346 0.115532 -0.308574 -0.241481 0.115854 -0.303621 -0.212651 0.116164 -0.297881 -0.18402 0.116466 -0.291311 -0.155746 0.116767 -0.28388 -0.127983 0.117077 -0.275564 -4.7159 0.151451 -0.462518 -3.41017 0.126047 -0.507674 -2.49344 0.119871 -0.511687 -1.86469 0.118738 -0.510841 -1.44915 0.11822 -0.510328 -1.18523 0.117331 -0.509901 -1.02237 0.116202 -0.509515 -0.922111 0.115387 -0.509287 -0.858913 0.115018 -0.509185 -0.817258 0.114945 -0.509127 -0.787817 0.115008 -0.509055 -0.764828 0.115113 -0.508939 -0.744964 0.115222 -0.508762 -0.726317 0.115359 -0.508534 -0.708042 0.115529 -0.508257 -0.689967 0.115724 -0.507934 -0.67187 0.115942 -0.507563 -0.653535 0.116181 -0.507138 -0.634772 0.116439 -0.50665 -0.615411 0.116716 -0.506088 -0.595307 0.11701 -0.505436 -0.574333 0.117321 -0.504675 -0.552382 0.117648 -0.503781 -0.529368 0.117989 -0.502726 -0.505228 0.118346 -0.501475 -0.479915 0.118717 -0.499984 -0.453407 0.119103 -0.498199 -0.425699 0.119504 -0.496058 -0.396812 0.11992 -0.493487 -0.366789 0.120351 -0.490405 -0.335697 0.120793 -0.486723 -0.303631 0.121244 -0.482346 -0.270708 0.1217 -0.477179 -0.23707 0.122154 -0.471128 -0.202879 0.122604 -0.464102 -0.168309 0.123046 -0.456021 -0.133548 0.123479 -0.446811 -0.0987878 0.123907 -0.436414 -0.0642241 0.124335 -0.424779 -0.0300555 0.124771 -0.41187 -4.7159 0.177503 -0.755845 -3.43547 0.146877 -0.798351 -2.53596 0.13645 -0.804731 -1.91682 0.134487 -0.803774 -1.50666 0.133635 -0.80267 -1.24261 0.132639 -0.80147 -1.07401 0.131597 -0.800223 -0.965095 0.130882 -0.799083 -0.892961 0.13056 -0.798111 -0.84329 0.130509 -0.797283 -0.806982 0.130591 -0.796542 -0.778111 0.130716 -0.795824 -0.753097 0.130843 -0.795078 -0.729836 0.131 -0.794284 -0.707336 0.13119 -0.793434 -0.685307 0.131407 -0.79253 -0.663417 0.131648 -0.791565 -0.64136 0.131911 -0.790527 -0.618864 0.132197 -0.789399 -0.595688 0.132506 -0.788159 -0.571623 0.132837 -0.786782 -0.546485 0.13319 -0.785236 -0.520119 0.133566 -0.783484 -0.492397 0.133963 -0.78148 -0.463216 0.134383 -0.77917 -0.432502 0.134825 -0.776485 -0.400204 0.13529 -0.773342 -0.3663 0.135778 -0.769645 -0.330794 0.136287 -0.765284 -0.293721 0.136816 -0.76014 -0.255144 0.137361 -0.754083 -0.21516 0.137917 -0.74698 -0.173898 0.138477 -0.738691 -0.131514 0.139032 -0.729082 -0.0881943 0.139575 -0.718021 -0.0441476 0.140098 -0.705385 --0.000398281 0.140598 -0.691064 --0.045201 0.141074 -0.674958 --0.090006 0.141527 -0.656982 --0.134549 0.141964 -0.637063 -4.7159 0.220161 -1.23516 -3.4815 0.189857 -1.27053 -2.61747 0.173751 -1.27928 -2.01537 0.169955 -1.27806 -1.60961 0.168429 -1.27572 -1.3389 0.167308 -1.27306 -1.15716 0.166399 -1.2704 -1.03334 0.165817 -1.26796 -0.947125 0.165561 -1.26583 -0.885089 0.165536 -1.26399 -0.838166 0.165634 -1.26236 -0.800134 0.165773 -1.26084 -0.767057 0.165915 -1.25934 -0.736532 0.166086 -1.25782 -0.707331 0.166289 -1.25625 -0.678957 0.16652 -1.25462 -0.650913 0.166776 -1.25293 -0.622749 0.167057 -1.25114 -0.59407 0.167365 -1.24922 -0.564532 0.167698 -1.24714 -0.533831 0.168059 -1.24487 -0.501704 0.168447 -1.24235 -0.467922 0.168863 -1.23952 -0.432295 0.169306 -1.23631 -0.394668 0.169776 -1.23263 -0.354918 0.170271 -1.22837 -0.312959 0.17079 -1.22339 -0.268739 0.171328 -1.21755 -0.222244 0.171883 -1.21067 -0.173496 0.172449 -1.20258 -0.122559 0.173017 -1.19307 -0.069536 0.173579 -1.18193 -0.014574 0.174121 -1.16896 --0.0421396 0.174631 -1.15395 --0.100379 0.175094 -1.13668 --0.159884 0.175498 -1.11698 --0.220363 0.175832 -1.09464 --0.281499 0.176091 -1.06949 --0.34295 0.176271 -1.04139 --0.404357 0.176378 -1.0102 -4.7159 0.290008 -2.01839 -3.5586 0.267219 -2.04448 -2.76383 0.248319 -2.05359 -2.1898 0.24192 -2.05168 -1.7859 0.239212 -2.04773 -1.50072 0.237733 -2.04335 -1.29724 0.23681 -2.0391 -1.15016 0.236269 -2.03521 -1.04192 0.236024 -2.03177 -0.960091 0.235986 -2.02874 -0.89574 0.236067 -2.02601 -0.842369 0.236194 -2.02347 -0.795622 0.236327 -2.02101 -0.752683 0.236489 -2.01856 -0.711956 0.236683 -2.01606 -0.672616 0.236903 -2.01351 -0.633898 0.237148 -2.01086 -0.595132 0.237419 -2.00808 -0.555736 0.237716 -2.00511 -0.515205 0.23804 -2.0019 -0.473093 0.238392 -1.99839 -0.429013 0.23877 -1.9945 -0.382626 0.239175 -1.99013 -0.333643 0.239604 -1.98516 -0.281822 0.240053 -1.97944 -0.226967 0.240516 -1.97279 -0.168932 0.240986 -1.96499 -0.107614 0.241452 -1.95581 -0.0429641 0.241905 -1.94498 --0.0250179 0.242331 -1.93222 --0.0962777 0.242714 -1.91721 --0.170705 0.243037 -1.89963 --0.248131 0.24328 -1.87916 --0.328331 0.24342 -1.85546 --0.411024 0.243437 -1.82821 --0.495876 0.243308 -1.79706 --0.582503 0.243017 -1.76171 --0.670475 0.24255 -1.72187 --0.75932 0.241901 -1.67726 --0.848526 0.24107 -1.62762 -4.7159 0.404372 -3.29825 -3.65219 0.391989 -3.31703 -2.9471 0.378343 -3.32454 -2.41401 0.3723 -3.32136 -2.01935 0.369483 -3.31591 -1.72384 0.368075 -3.31001 -1.49908 0.367339 -3.30428 -1.32548 0.366979 -3.29894 -1.18908 0.366858 -3.29405 -1.07959 0.366895 -3.28958 -0.989157 0.367026 -3.28546 -0.911725 0.367198 -3.28156 -0.842888 0.367376 -3.2778 -0.779539 0.367576 -3.27406 -0.719654 0.3678 -3.2703 -0.661932 0.368043 -3.26646 -0.60524 0.368306 -3.26247 -0.548602 0.368588 -3.25828 -0.491183 0.36889 -3.2538 -0.432252 0.36921 -3.24896 -0.371169 0.36955 -3.24363 -0.30737 0.369904 -3.23772 -0.240356 0.370269 -3.23104 -0.16969 0.370637 -3.22343 -0.0949927 0.370996 -3.21464 -0.015941 0.371331 -3.20438 --0.0677323 0.371624 -3.19234 --0.156238 0.371851 -3.17815 --0.249726 0.371989 -3.16139 --0.348284 0.372009 -3.14163 --0.45193 0.371882 -3.11839 --0.560608 0.371574 -3.09117 --0.674178 0.371051 -3.05941 --0.792417 0.370277 -3.02256 --0.915006 0.369218 -2.98006 --1.04154 0.367843 -2.93131 --1.1715 0.366124 -2.87577 --1.30431 0.364044 -2.81286 --1.43925 0.361592 -2.74207 --1.57555 0.358769 -2.66292 -4.7159 0.591623 -5.3896 -3.57016 0.592079 -5.38359 -2.72089 0.592536 -5.37757 -2.09804 0.592993 -5.37155 -1.64708 0.593449 -5.36554 -1.32554 0.593906 -5.35952 -1.10033 0.594363 -5.35351 -0.945687 0.594819 -5.34749 -0.841555 0.595276 -5.34148 -0.772305 0.595733 -5.33546 -0.725767 0.596189 -5.32945 -0.692464 0.596646 -5.32343 -0.665014 0.597103 -5.31742 -0.638211 0.597559 -5.3114 -0.60996 0.598016 -5.30539 -0.578915 0.598473 -5.29937 -0.543842 0.598929 -5.29336 -0.503612 0.599386 -5.28734 -0.4572 0.599843 -5.28133 -0.403678 0.600299 -5.27531 -0.34222 0.600756 -5.2693 -0.272088 0.60121 -5.26328 -0.192639 0.601585 -5.25727 -0.103318 0.601805 -5.25125 -0.00365498 0.601818 -5.24524 --0.106731 0.601566 -5.23855 --0.22811 0.60099 -5.22951 --0.360637 0.600032 -5.21742 --0.504355 0.598638 -5.20148 --0.659191 0.596761 -5.18085 --0.824951 0.59436 -5.1546 --1.00131 0.591408 -5.12173 --1.18781 0.58789 -5.08119 --1.38385 0.583806 -5.03191 --1.58869 0.579169 -4.97276 --1.80145 0.57401 -4.90262 --2.02108 0.568373 -4.8204 --2.24641 0.562316 -4.72503 --2.47612 0.555908 -4.6155 --2.70873 0.549228 -4.4909 -0.726644 0.219405 -0.00115672 -0.717995 0.219644 -0.00231632 -0.708943 0.219888 -0.00350843 -0.699332 0.220144 -0.00475556 -0.689032 0.220411 -0.006067 -0.677941 0.220691 -0.00743979 -0.665981 0.22098 -0.00886737 -0.653101 0.221278 -0.0103412 -0.639272 0.221582 -0.0118527 -0.624486 0.221891 -0.0133951 -0.608757 0.222203 -0.0149631 -0.592116 0.222518 -0.0165532 -0.574612 0.222833 -0.0181599 -0.556308 0.223148 -0.0197739 -0.53728 0.223459 -0.0213783 -0.517611 0.223759 -0.0229468 -0.497397 0.224043 -0.0244438 -0.47674 0.224301 -0.0258266 -0.45575 0.224526 -0.0270501 -0.434542 0.224708 -0.0280721 -0.413237 0.224842 -0.0288601 -0.391964 0.224925 -0.0293945 -0.370849 0.224957 -0.0296712 -0.350025 0.22494 -0.0297008 -0.329618 0.224879 -0.0295048 -0.309754 0.224781 -0.0291105 -0.290551 0.224651 -0.0285462 -4.7159 0.219161 -2.4081e-05 -3.37951 0.219159 -2.6344e-05 -2.44812 0.219159 -2.4546e-05 -1.81302 0.21916 -2.368e-05 -1.39134 0.21916 -2.3336e-05 -1.12036 0.219161 -2.3315e-05 -0.953032 0.219162 -2.3246e-05 -0.854517 0.219162 -2.267e-05 -0.79949 0.219163 -2.1735e-05 -0.770036 0.219164 -2.1034e-05 -0.754003 0.219165 -2.0701e-05 -0.743735 0.219165 -2.055e-05 -0.735078 0.219167 -2.0528e-05 -0.726646 0.219404 -0.00117693 -0.717998 0.219643 -0.0023365 -0.708946 0.219887 -0.00352862 -0.699334 0.220142 -0.0047758 -0.689034 0.22041 -0.00608733 -0.677943 0.220689 -0.00746022 -0.665984 0.220979 -0.00888792 -0.653103 0.221277 -0.0103618 -0.639274 0.221581 -0.0118735 -0.624488 0.22189 -0.013416 -0.608758 0.222202 -0.0149841 -0.592118 0.222516 -0.0165742 -0.574614 0.222832 -0.018181 -0.55631 0.223147 -0.0197951 -0.537281 0.223458 -0.0213995 -0.517612 0.223758 -0.022968 -0.497398 0.224042 -0.024465 -0.476741 0.2243 -0.0258478 -0.455751 0.224525 -0.0270713 -0.434542 0.224707 -0.0280933 -0.413238 0.224841 -0.0288813 -0.391964 0.224924 -0.0294157 -0.37085 0.224956 -0.0296924 -0.350025 0.224939 -0.0297219 -0.329618 0.224878 -0.0295258 -0.309753 0.22478 -0.0291315 -0.29055 0.22465 -0.0285671 -4.7159 0.219166 -6.3895e-05 -3.37951 0.219158 -7.3145e-05 -2.44812 0.219158 -6.8507e-05 -1.81302 0.219159 -6.6224e-05 -1.39135 0.219159 -6.5338e-05 -1.12037 0.21916 -6.5368e-05 -0.953036 0.219159 -6.5324e-05 -0.85452 0.219159 -6.3913e-05 -0.799493 0.21916 -6.1484e-05 -0.770038 0.219161 -5.966e-05 -0.754004 0.219162 -5.8838e-05 -0.743735 0.219164 -5.8558e-05 -0.73508 0.219166 -5.9157e-05 -0.726651 0.219403 -0.00121432 -0.718002 0.219641 -0.00237368 -0.70895 0.219885 -0.00356575 -0.699339 0.22014 -0.00481298 -0.689039 0.220408 -0.0061246 -0.677947 0.220687 -0.00749762 -0.665988 0.220977 -0.00892548 -0.653107 0.221275 -0.0103995 -0.639278 0.221579 -0.0119113 -0.624491 0.221887 -0.0134539 -0.608762 0.2222 -0.0150222 -0.592121 0.222514 -0.0166124 -0.574617 0.22283 -0.0182192 -0.556313 0.223145 -0.0198333 -0.537284 0.223456 -0.0214377 -0.517615 0.223756 -0.0230063 -0.497401 0.22404 -0.0245032 -0.476743 0.224299 -0.025886 -0.455753 0.224523 -0.0271094 -0.434544 0.224705 -0.0281314 -0.413239 0.224839 -0.0289193 -0.391965 0.224922 -0.0294535 -0.37085 0.224954 -0.0297301 -0.350025 0.224937 -0.0297595 -0.329617 0.224877 -0.0295633 -0.309752 0.224778 -0.0291687 -0.290549 0.224649 -0.0286042 -4.7159 0.219175 -0.000129833 -3.37952 0.219157 -0.000156782 -2.44813 0.219156 -0.000147665 -1.81303 0.219156 -0.000143054 -1.39135 0.219157 -0.00014131 -1.12037 0.219157 -0.000141514 -0.953044 0.219156 -0.000141598 -0.854526 0.219155 -0.000138821 -0.799498 0.219155 -0.000133934 -0.770041 0.219157 -0.000130348 -0.754006 0.219159 -0.000128877 -0.743736 0.219161 -0.000128644 -0.735085 0.219165 -0.000131552 -0.72666 0.219399 -0.00128326 -0.718011 0.219637 -0.002442 -0.708959 0.219881 -0.00363385 -0.699347 0.220136 -0.00488102 -0.689047 0.220404 -0.00619269 -0.677955 0.220683 -0.00756584 -0.665995 0.220973 -0.00899387 -0.653114 0.221271 -0.0104681 -0.639284 0.221575 -0.0119801 -0.624498 0.221884 -0.0135228 -0.608768 0.222196 -0.0150912 -0.592127 0.22251 -0.0166814 -0.574623 0.222826 -0.0182883 -0.556318 0.223141 -0.0199024 -0.537289 0.223452 -0.0215067 -0.51762 0.223753 -0.0230751 -0.497405 0.224036 -0.0245719 -0.476747 0.224295 -0.0259545 -0.455756 0.224519 -0.0271777 -0.434546 0.224702 -0.0281995 -0.413241 0.224836 -0.0289871 -0.391966 0.224919 -0.0295211 -0.37085 0.224951 -0.0297973 -0.350024 0.224934 -0.0298264 -0.329616 0.224874 -0.0296298 -0.309751 0.224775 -0.0292348 -0.290547 0.224645 -0.0286697 -4.7159 0.21919 -0.000238881 -3.37954 0.219156 -0.000306192 -2.44815 0.219153 -0.000290089 -1.81305 0.219153 -0.00028168 -1.39137 0.219153 -0.000278581 -1.12039 0.219152 -0.000279177 -0.953057 0.219149 -0.000279475 -0.854537 0.219146 -0.000274296 -0.799507 0.219146 -0.000265332 -0.770048 0.219148 -0.000259065 -0.75401 0.219152 -0.000256874 -0.743737 0.219155 -0.000257249 -0.735093 0.219162 -0.000266313 -0.726676 0.219394 -0.00140976 -0.718027 0.219631 -0.00256692 -0.708974 0.219874 -0.00375807 -0.699362 0.220129 -0.00500491 -0.689061 0.220397 -0.00631645 -0.677969 0.220676 -0.00768962 -0.666008 0.220966 -0.00911777 -0.653127 0.221264 -0.0105922 -0.639296 0.221568 -0.0121043 -0.624509 0.221877 -0.0136472 -0.608779 0.222189 -0.0152156 -0.592137 0.222504 -0.0168059 -0.574632 0.22282 -0.0184126 -0.556328 0.223135 -0.0200265 -0.537298 0.223446 -0.0216306 -0.517628 0.223746 -0.0231986 -0.497413 0.22403 -0.024695 -0.476754 0.224289 -0.0260771 -0.455761 0.224514 -0.0272997 -0.434551 0.224696 -0.0283208 -0.413244 0.22483 -0.0291079 -0.391967 0.224914 -0.0296411 -0.370851 0.224946 -0.0299167 -0.350023 0.224929 -0.0299449 -0.329614 0.224869 -0.0297474 -0.309748 0.22477 -0.0293514 -0.290543 0.22464 -0.0287852 -4.7159 0.219217 -0.000418806 -3.37957 0.219153 -0.000571696 -2.44819 0.219147 -0.000544932 -1.81309 0.219146 -0.000530398 -1.39141 0.219145 -0.000525199 -1.12042 0.219143 -0.000526571 -0.953081 0.219137 -0.000527079 -0.854557 0.219132 -0.000517592 -0.799523 0.219131 -0.000501956 -0.770061 0.219134 -0.00049182 -0.754018 0.219139 -0.000489178 -0.743739 0.219145 -0.000491604 -0.735109 0.219158 -0.000514656 -0.726705 0.219383 -0.0016403 -0.718056 0.219619 -0.00279378 -0.709002 0.219862 -0.00398316 -0.699389 0.220117 -0.00522893 -0.689087 0.220384 -0.00653982 -0.677994 0.220663 -0.00791266 -0.666032 0.220953 -0.00934068 -0.65315 0.221251 -0.0108151 -0.639318 0.221555 -0.0123273 -0.624529 0.221865 -0.0138702 -0.608798 0.222177 -0.0154385 -0.592155 0.222492 -0.0170285 -0.57465 0.222808 -0.0186349 -0.556345 0.223124 -0.0202481 -0.537314 0.223434 -0.0218514 -0.517643 0.223735 -0.0234185 -0.497426 0.22402 -0.0249138 -0.476766 0.224278 -0.0262947 -0.455771 0.224503 -0.0275161 -0.434558 0.224686 -0.0285359 -0.413249 0.224821 -0.0293215 -0.39197 0.224904 -0.0298533 -0.370851 0.224937 -0.0301272 -0.350022 0.22492 -0.0301537 -0.329611 0.22486 -0.0299543 -0.309743 0.224762 -0.0295561 -0.290537 0.224632 -0.0289875 -4.7159 0.219263 -0.000714996 -3.37962 0.219149 -0.0010393 -2.44826 0.219138 -0.000996781 -1.81315 0.219133 -0.000972547 -1.39146 0.219133 -0.000964168 -1.12047 0.219128 -0.000966969 -0.953124 0.219117 -0.000967451 -0.854592 0.219106 -0.000950353 -0.799553 0.219104 -0.00092417 -0.770086 0.219109 -0.000908951 -0.754035 0.219118 -0.000907051 -0.743746 0.219128 -0.000914854 -0.735139 0.219148 -0.000965911 -0.726756 0.219365 -0.00205678 -0.718107 0.219598 -0.00320219 -0.709052 0.219841 -0.00438745 -0.699437 0.220095 -0.00563054 -0.689133 0.220362 -0.00693954 -0.678038 0.220641 -0.0083111 -0.666074 0.220931 -0.00973828 -0.653189 0.221229 -0.0112121 -0.639355 0.221534 -0.0127238 -0.624565 0.221843 -0.0142663 -0.608832 0.222156 -0.015834 -0.592188 0.222472 -0.0174232 -0.574681 0.222788 -0.0190285 -0.556374 0.223104 -0.0206403 -0.537342 0.223415 -0.0222418 -0.517668 0.223716 -0.0238068 -0.497449 0.224001 -0.0252997 -0.476786 0.22426 -0.026678 -0.455788 0.224486 -0.0278965 -0.434571 0.224669 -0.0289135 -0.413258 0.224804 -0.029696 -0.391975 0.224889 -0.0302247 -0.370852 0.224921 -0.0304953 -0.350019 0.224906 -0.0305183 -0.329605 0.224846 -0.0303149 -0.309734 0.224748 -0.0299124 -0.290525 0.224618 -0.0293387 -4.7159 0.219341 -0.00120165 -3.37971 0.219142 -0.00185318 -2.44837 0.21912 -0.0017884 -1.81326 0.219112 -0.00174915 -1.39156 0.219111 -0.0017361 -1.12056 0.219103 -0.0017414 -0.9532 0.219082 -0.00174113 -0.854657 0.219062 -0.00171108 -0.799609 0.219057 -0.00166916 -0.770136 0.219065 -0.00164841 -0.754071 0.21908 -0.00165058 -0.743766 0.219097 -0.0016708 -0.735195 0.21913 -0.00177077 -0.726846 0.219332 -0.00280107 -0.718197 0.219562 -0.00392966 -0.709139 0.219803 -0.00510601 -0.69952 0.220056 -0.00634298 -0.689213 0.220323 -0.00764735 -0.678114 0.220602 -0.00901545 -0.666147 0.220892 -0.01044 -0.653258 0.221191 -0.0119118 -0.639421 0.221497 -0.0134219 -0.624627 0.221807 -0.0149627 -0.608891 0.22212 -0.0165286 -0.592244 0.222437 -0.0181157 -0.574734 0.222754 -0.0197183 -0.556424 0.22307 -0.0213269 -0.537389 0.223382 -0.0229244 -0.517712 0.223684 -0.0244849 -0.497489 0.223969 -0.0259727 -0.47682 0.224229 -0.0273456 -0.455816 0.224456 -0.0285584 -0.434593 0.22464 -0.0295694 -0.413272 0.224777 -0.0303458 -0.391982 0.224862 -0.0308682 -0.370852 0.224896 -0.0311322 -0.350013 0.224881 -0.031148 -0.329593 0.224822 -0.0309369 -0.309717 0.224725 -0.0305256 -0.290503 0.224595 -0.029942 -4.7159 0.219472 -0.00200003 -3.37986 0.21913 -0.00324978 -2.44856 0.219091 -0.00315557 -1.81345 0.219076 -0.00309369 -1.39174 0.219073 -0.00307406 -1.12071 0.219059 -0.00308351 -0.953336 0.219023 -0.00308088 -0.854776 0.218988 -0.00303002 -0.79972 0.218977 -0.00296666 -0.77024 0.218991 -0.00294258 -0.754153 0.219015 -0.00295653 -0.743823 0.219043 -0.0030027 -0.735299 0.219093 -0.00317444 -0.726999 0.219277 -0.00411384 -0.718351 0.2195 -0.00520927 -0.709287 0.219739 -0.00636733 -0.699663 0.219991 -0.00759133 -0.689349 0.220257 -0.00888545 -0.678244 0.220536 -0.0102454 -0.666269 0.220827 -0.0116635 -0.653374 0.221126 -0.01313 -0.63953 0.221433 -0.0146354 -0.62473 0.221744 -0.0161718 -0.608989 0.222059 -0.0177332 -0.592337 0.222377 -0.0193152 -0.574823 0.222696 -0.0209119 -0.556508 0.223013 -0.0225135 -0.537467 0.223326 -0.0241029 -0.517785 0.223629 -0.0256541 -0.497554 0.223916 -0.0271318 -0.476876 0.224177 -0.0284937 -0.455862 0.224405 -0.0296952 -0.434627 0.224592 -0.0306944 -0.413294 0.224731 -0.031459 -0.391992 0.224818 -0.031969 -0.37085 0.224854 -0.0322201 -0.349999 0.224841 -0.0322223 -0.329569 0.224783 -0.0319961 -0.309684 0.224687 -0.0315681 -0.290463 0.224558 -0.0309657 -4.7159 0.21969 -0.00330842 -3.38012 0.219111 -0.00560751 -2.44889 0.219042 -0.00547827 -1.81378 0.219016 -0.00538342 -1.39204 0.21901 -0.00535497 -1.12099 0.218987 -0.00537103 -0.95358 0.218925 -0.00536311 -0.855002 0.218864 -0.00528138 -0.799943 0.218845 -0.00519313 -0.770463 0.218866 -0.00517427 -0.754343 0.218905 -0.00521548 -0.743972 0.21895 -0.00530961 -0.7355 0.219017 -0.00556497 -0.727258 0.219182 -0.00639173 -0.718612 0.219395 -0.00742709 -0.709538 0.21963 -0.00854967 -0.699901 0.21988 -0.00974781 -0.689575 0.220145 -0.011021 -0.678457 0.220425 -0.0123636 -0.66647 0.220716 -0.0137672 -0.653563 0.221018 -0.0152213 -0.639708 0.221326 -0.0167157 -0.624898 0.22164 -0.0182419 -0.609147 0.221958 -0.019793 -0.592487 0.222278 -0.0213639 -0.574965 0.222599 -0.0229482 -0.556642 0.222918 -0.0245355 -0.537592 0.223233 -0.0261087 -0.517899 0.223539 -0.0276417 -0.497655 0.223828 -0.0290996 -0.476962 0.224092 -0.0304406 -0.45593 0.224323 -0.0316202 -0.434676 0.224513 -0.0325971 -0.413323 0.224656 -0.0333389 -0.392 0.224747 -0.0338256 -0.370838 0.224786 -0.0340525 -0.349969 0.224776 -0.0340289 -0.329522 0.224721 -0.0337746 -0.309622 0.224627 -0.0333155 -0.290388 0.224499 -0.032678 -4.7159 0.220051 -0.00545087 -3.38055 0.219084 -0.00951587 -2.44944 0.218965 -0.0093528 -1.81433 0.218919 -0.00921178 -1.39255 0.218909 -0.00917228 -1.12146 0.218871 -0.00919842 -0.954027 0.218769 -0.00918083 -0.855442 0.218665 -0.00905856 -0.800406 0.218631 -0.00895035 -0.770941 0.218663 -0.0089573 -0.754773 0.218724 -0.00905183 -0.744338 0.218791 -0.00921958 -0.735891 0.218873 -0.00954797 -0.727691 0.219022 -0.0102624 -0.719044 0.219222 -0.0112037 -0.709949 0.21945 -0.0122629 -0.700287 0.219697 -0.0134128 -0.689936 0.219961 -0.0146459 -0.678795 0.220242 -0.0159543 -0.666786 0.220535 -0.0173281 -0.653858 0.220839 -0.018756 -0.639984 0.221152 -0.0202269 -0.625156 0.22147 -0.0217309 -0.609389 0.221792 -0.0232601 -0.592714 0.222116 -0.024808 -0.575178 0.222441 -0.0263672 -0.556842 0.222765 -0.0279265 -0.537776 0.223083 -0.0294686 -0.518065 0.223393 -0.0309673 -0.4978 0.223686 -0.0323881 -0.477082 0.223955 -0.0336899 -0.456021 0.224191 -0.034829 -0.434735 0.224387 -0.0357647 -0.413349 0.224536 -0.0364644 -0.391992 0.224633 -0.0369083 -0.370798 0.224679 -0.0370907 -0.349897 0.224674 -0.0370199 -0.329422 0.224623 -0.0367144 -0.309497 0.224532 -0.0361987 -0.290239 0.224407 -0.035498 -4.7159 0.220647 -0.00895714 -3.38124 0.219053 -0.0158665 -2.45034 0.218846 -0.0156878 -1.81524 0.218769 -0.0154852 -1.39343 0.218753 -0.0154331 -1.1223 0.218693 -0.0154741 -0.954857 0.218525 -0.015442 -0.856315 0.218356 -0.0152771 -0.801367 0.218298 -0.0151728 -0.771948 0.218343 -0.015243 -0.755706 0.21843 -0.015423 -0.745158 0.218519 -0.0156769 -0.736654 0.218614 -0.0160518 -0.728431 0.218754 -0.0166732 -0.719754 0.218942 -0.017496 -0.710612 0.21916 -0.0184567 -0.700899 0.219403 -0.0195252 -0.690499 0.219667 -0.0206875 -0.679311 0.219948 -0.0219331 -0.66726 0.220246 -0.0232505 -0.654294 0.220555 -0.0246273 -0.640385 0.220874 -0.0260509 -0.625526 0.221199 -0.0275102 -0.609732 0.221528 -0.0289953 -0.593032 0.221859 -0.0304979 -0.575472 0.222191 -0.0320087 -0.557111 0.222522 -0.0335154 -0.53802 0.222847 -0.0349998 -0.518278 0.223163 -0.0364359 -0.497978 0.223464 -0.0377897 -0.47722 0.223741 -0.0390211 -0.456113 0.223986 -0.0400876 -0.434776 0.224191 -0.0409492 -0.413337 0.224349 -0.0415736 -0.391925 0.224457 -0.0419406 -0.370677 0.224512 -0.0420434 -0.349727 0.224516 -0.0418883 -0.329205 0.224472 -0.0414917 -0.309236 0.224388 -0.0408758 -0.289939 0.224268 -0.0400636 -4.7159 0.221629 -0.0146932 -3.38233 0.21903 -0.0259674 -2.4518 0.218678 -0.025826 -1.81674 0.218553 -0.0255459 -1.3949 0.218528 -0.0254818 -1.12377 0.218432 -0.0255438 -0.95641 0.218165 -0.0254959 -0.858044 0.217897 -0.0253075 -0.803317 0.217801 -0.0252609 -0.773977 0.217857 -0.025444 -0.757592 0.217966 -0.0257296 -0.746824 0.218073 -0.026057 -0.738121 0.218176 -0.0264525 -0.729741 0.218316 -0.0270033 -0.720939 0.218496 -0.0277088 -0.71168 0.218708 -0.0285449 -0.701855 0.218948 -0.0294948 -0.691352 0.219212 -0.030546 -0.680071 0.219497 -0.0316873 -0.667936 0.2198 -0.0329066 -0.654897 0.220118 -0.0341911 -0.640922 0.220446 -0.0355271 -0.626007 0.220782 -0.0369018 -0.610161 0.221124 -0.0383034 -0.593415 0.221467 -0.0397209 -0.575813 0.22181 -0.0411426 -0.55741 0.222152 -0.0425541 -0.538273 0.222489 -0.043936 -0.518482 0.222816 -0.0452622 -0.498125 0.223128 -0.0464994 -0.477302 0.223418 -0.0476088 -0.456122 0.223677 -0.0485495 -0.434706 0.223896 -0.0492824 -0.413182 0.22407 -0.0497759 -0.391685 0.224192 -0.0500088 -0.370352 0.224262 -0.0499725 -0.349318 0.224279 -0.0496704 -0.328718 0.224248 -0.0491155 -0.308676 0.224174 -0.0483264 -0.28931 0.224063 -0.0473231 -4.7159 0.223244 -0.0240746 -3.38402 0.219065 -0.0416828 -2.45411 0.218468 -0.041694 -1.81917 0.218269 -0.0413234 -1.39738 0.218231 -0.0412513 -1.12638 0.218082 -0.0413427 -0.959308 0.217672 -0.0412895 -0.861393 0.217263 -0.0411349 -0.80708 0.217107 -0.0412279 -0.777791 0.217158 -0.0415624 -0.761106 0.217273 -0.0419465 -0.749926 0.217388 -0.0423224 -0.740817 0.217497 -0.0427221 -0.732073 0.217641 -0.0432192 -0.722961 0.217822 -0.0438255 -0.713428 0.218035 -0.0445342 -0.703359 0.218276 -0.0453417 -0.692636 0.218544 -0.0462434 -0.68116 0.218837 -0.0472324 -0.668855 0.219151 -0.0482994 -0.655666 0.219481 -0.0494327 -0.641562 0.219825 -0.0506197 -0.626533 0.220179 -0.0518468 -0.610589 0.220537 -0.0531006 -0.593755 0.220899 -0.0543674 -0.576071 0.221261 -0.0556328 -0.557589 0.22162 -0.0568798 -0.538372 0.221974 -0.0580872 -0.518496 0.222319 -0.0592284 -0.498045 0.22265 -0.0602707 -0.477117 0.222958 -0.0611768 -0.455822 0.223237 -0.0619073 -0.434281 0.223478 -0.0624246 -0.412626 0.223673 -0.0626973 -0.390993 0.223818 -0.0627028 -0.369523 0.223909 -0.0624297 -0.348355 0.223946 -0.0618775 -0.327623 0.223933 -0.0610542 -0.307453 0.223875 -0.0599732 -0.287962 0.223778 -0.0586501 -4.7159 0.225899 -0.0394154 -3.38659 0.219277 -0.0656202 -2.45772 0.218271 -0.0659969 -1.82307 0.217968 -0.06553 -1.4015 0.217909 -0.0654591 -1.13094 0.217681 -0.065591 -0.964594 0.217074 -0.0655669 -0.86757 0.216481 -0.0655455 -0.813816 0.216233 -0.0658569 -0.784389 0.216244 -0.066349 -0.767121 0.216342 -0.0668122 -0.755247 0.216449 -0.0672205 -0.745455 0.216558 -0.0676194 -0.736069 0.216706 -0.0680754 -0.72637 0.216894 -0.0686014 -0.7163 0.217114 -0.0691944 -0.705743 0.217366 -0.0698553 -0.69458 0.217646 -0.0705844 -0.682711 0.217954 -0.0713801 -0.670057 0.218285 -0.0722381 -0.656563 0.218635 -0.073151 -0.642193 0.219001 -0.0741093 -0.626932 0.219378 -0.0751013 -0.610784 0.219762 -0.0761138 -0.593769 0.22015 -0.077132 -0.57592 0.220537 -0.0781395 -0.557283 0.220923 -0.0791168 -0.537914 0.221303 -0.0800409 -0.517882 0.221673 -0.0808841 -0.497267 0.222029 -0.0816139 -0.476165 0.222365 -0.082194 -0.454683 0.222671 -0.0825865 -0.432943 0.22294 -0.0827546 -0.411076 0.223165 -0.0826665 -0.389224 0.223338 -0.0822976 -0.36753 0.223457 -0.0816327 -0.346134 0.223522 -0.0806659 -0.325174 0.223534 -0.0793986 -0.304775 0.223499 -0.0778378 -0.285054 0.223425 -0.0759934 -4.7159 0.230261 -0.0644981 -3.39039 0.219942 -0.101444 -2.46327 0.218259 -0.102534 -1.82927 0.21781 -0.101976 -1.40832 0.217721 -0.10192 -1.13876 0.217381 -0.102108 -0.973849 0.216528 -0.102175 -0.878175 0.215715 -0.102392 -0.824863 0.215331 -0.102952 -0.79487 0.21526 -0.103584 -0.77659 0.215313 -0.104117 -0.763638 0.215397 -0.104559 -0.752802 0.215495 -0.104964 -0.742416 0.215642 -0.105391 -0.731765 0.215836 -0.105852 -0.720796 0.216068 -0.106341 -0.709394 0.216335 -0.106857 -0.697445 0.216634 -0.107402 -0.684855 0.216963 -0.107975 -0.671545 0.217317 -0.108574 -0.657462 0.217694 -0.109198 -0.642565 0.218088 -0.10984 -0.626837 0.218495 -0.110492 -0.610274 0.21891 -0.111146 -0.592886 0.21933 -0.111786 -0.574697 0.21975 -0.112396 -0.555742 0.220168 -0.112957 -0.536069 0.220581 -0.113443 -0.515736 0.220985 -0.113827 -0.494818 0.221374 -0.114075 -0.473403 0.221742 -0.114151 -0.451593 0.222083 -0.114018 -0.42951 0.222386 -0.113638 -0.407284 0.222646 -0.112977 -0.385057 0.222855 -0.112009 -0.362972 0.223008 -0.110713 -0.341174 0.223107 -0.109076 -0.319799 0.223153 -0.107093 -0.298975 0.223152 -0.104762 -0.278818 0.223111 -0.102087 -4.7159 0.237423 -0.105506 -3.39599 0.221666 -0.154523 -2.47177 0.218862 -0.156839 -1.83909 0.218214 -0.15621 -1.41949 0.218075 -0.156184 -1.15186 0.217584 -0.156443 -0.98918 0.21646 -0.156668 -0.894941 0.215413 -0.15716 -0.841467 0.214861 -0.15792 -0.810196 0.214678 -0.158658 -0.7903 0.214664 -0.159253 -0.775747 0.214712 -0.159731 -0.763385 0.214788 -0.160145 -0.75153 0.214928 -0.160549 -0.739458 0.215124 -0.160948 -0.72712 0.215364 -0.161332 -0.714406 0.215646 -0.161698 -0.701209 0.215963 -0.162042 -0.687441 0.216314 -0.162363 -0.673029 0.216693 -0.162659 -0.657923 0.217096 -0.162927 -0.642086 0.217518 -0.163166 -0.625494 0.217954 -0.163371 -0.608139 0.2184 -0.163533 -0.590022 0.218851 -0.163642 -0.571155 0.219305 -0.163685 -0.551562 0.219757 -0.16364 -0.531277 0.220204 -0.163484 -0.510346 0.220642 -0.163188 -0.488832 0.221067 -0.162718 -0.466813 0.221471 -0.162038 -0.444386 0.221848 -0.161107 -0.421662 0.222189 -0.159886 -0.39877 0.222487 -0.158339 -0.375848 0.222734 -0.156433 -0.353038 0.222928 -0.154142 -0.330485 0.223068 -0.151445 -0.308326 0.223156 -0.148328 -0.286689 0.223199 -0.144783 -0.265693 0.223206 -0.140805 -4.7159 0.249179 -0.172547 -3.4043 0.22575 -0.233281 -2.48496 0.221085 -0.237534 -1.85481 0.220151 -0.236867 -1.43775 0.219926 -0.236871 -1.17319 0.219249 -0.237195 -1.01313 0.217874 -0.23758 -0.919521 0.216619 -0.238244 -0.864642 0.215902 -0.23907 -0.831018 0.215603 -0.239824 -0.80863 0.215521 -0.240425 -0.791722 0.215529 -0.240897 -0.777145 0.215582 -0.241282 -0.763167 0.215713 -0.241624 -0.74904 0.215909 -0.241921 -0.734714 0.216157 -0.242157 -0.720082 0.21645 -0.242324 -0.705039 0.216783 -0.242415 -0.6895 0.21715 -0.242424 -0.673399 0.217547 -0.242346 -0.656685 0.217968 -0.242177 -0.639321 0.218409 -0.241914 -0.621284 0.218865 -0.241549 -0.602557 0.219331 -0.241077 -0.583132 0.219804 -0.240486 -0.563011 0.22028 -0.239762 -0.542203 0.220756 -0.238884 -0.520729 0.221229 -0.237829 -0.498622 0.221695 -0.236566 -0.475928 0.222148 -0.235059 -0.452714 0.222584 -0.233267 -0.429064 0.222994 -0.231149 -0.405081 0.22337 -0.22866 -0.380883 0.223705 -0.225759 -0.356604 0.223994 -0.222404 -0.332383 0.224232 -0.218564 -0.308362 0.224419 -0.214207 -0.284679 0.224559 -0.209313 -0.261468 0.22466 -0.203864 -0.23885 0.224732 -0.197847 -4.7159 0.268473 -0.282145 -3.41705 0.235023 -0.351735 -2.50614 0.227239 -0.358872 -1.88067 0.225845 -0.358226 -1.46791 0.225452 -0.358196 -1.20724 0.224569 -0.358485 -1.04882 0.223022 -0.358858 -0.953753 0.221638 -0.359415 -0.895435 0.220804 -0.360051 -0.857824 0.220419 -0.360621 -0.831615 0.220287 -0.361066 -0.811203 0.22027 -0.361389 -0.793371 0.220308 -0.36161 -0.776301 0.22044 -0.361753 -0.759198 0.220645 -0.361802 -0.742009 0.220906 -0.361742 -0.724619 0.221213 -0.361559 -0.706915 0.221559 -0.361243 -0.688807 0.22194 -0.360785 -0.670223 0.222348 -0.360176 -0.651105 0.222779 -0.359407 -0.631407 0.223229 -0.358469 -0.611093 0.223692 -0.357352 -0.590136 0.224165 -0.356043 -0.568514 0.224645 -0.354526 -0.546213 0.22513 -0.352781 -0.523227 0.225616 -0.350781 -0.499561 0.226102 -0.348497 -0.475232 0.226583 -0.345889 -0.450273 0.227057 -0.342916 -0.424736 0.227515 -0.33953 -0.398692 0.227953 -0.335678 -0.372234 0.228362 -0.331309 -0.345473 0.228735 -0.32637 -0.318536 0.229066 -0.320813 -0.29156 0.229352 -0.314592 -0.26469 0.229594 -0.307669 -0.238071 0.229797 -0.300011 -0.211845 0.229968 -0.291592 -0.186152 0.23012 -0.282394 -4.7159 0.300136 -0.461308 -3.43782 0.255594 -0.533801 -2.54209 0.242567 -0.545057 -1.9252 0.240291 -0.544528 -1.51872 0.239554 -0.54423 -1.26113 0.238455 -0.544123 -1.10115 0.236855 -0.544023 -1.0009 0.235453 -0.543994 -0.936025 0.234575 -0.544025 -0.891923 0.23415 -0.544051 -0.859808 0.233998 -0.544022 -0.834082 0.233976 -0.543903 -0.811369 0.234016 -0.543676 -0.78971 0.234162 -0.543334 -0.768242 0.234385 -0.542846 -0.746883 0.234665 -0.542196 -0.725493 0.234989 -0.54137 -0.703935 0.23535 -0.540356 -0.68209 0.235741 -0.539141 -0.65986 0.236157 -0.537711 -0.63716 0.236593 -0.536051 -0.613916 0.237044 -0.534145 -0.590066 0.237508 -0.531973 -0.565553 0.237982 -0.529512 -0.54033 0.238463 -0.526732 -0.51436 0.23895 -0.523601 -0.487615 0.239442 -0.520078 -0.46008 0.239936 -0.516115 -0.431754 0.240431 -0.511659 -0.402657 0.240922 -0.506649 -0.372827 0.241404 -0.50102 -0.342327 0.24187 -0.494702 -0.311243 0.242312 -0.487624 -0.279684 0.242723 -0.479718 -0.24778 0.243096 -0.470917 -0.215676 0.243429 -0.461161 -0.183528 0.243721 -0.450398 -0.1515 0.243977 -0.43858 -0.11976 0.244205 -0.425671 -0.0884771 0.244421 -0.411644 -4.7159 0.35209 -0.75419 -3.47377 0.299765 -0.820501 -2.60712 0.278309 -0.837166 -2.00547 0.274085 -0.836944 -1.60626 0.27259 -0.835836 -1.34764 0.271202 -0.834585 -1.17995 0.269614 -0.833255 -1.06887 0.268261 -0.831988 -0.992765 0.267385 -0.830855 -0.938281 0.26694 -0.829835 -0.896934 0.266774 -0.828867 -0.862975 0.266748 -0.827873 -0.832758 0.266785 -0.826781 -0.804121 0.266938 -0.825545 -0.776076 0.26717 -0.824116 -0.748479 0.267456 -0.822481 -0.721121 0.267783 -0.820627 -0.693799 0.268143 -0.818538 -0.666332 0.26853 -0.816194 -0.638563 0.268939 -0.813575 -0.610348 0.269366 -0.810655 -0.58156 0.269808 -0.807405 -0.552084 0.270262 -0.80379 -0.521819 0.270727 -0.799769 -0.490678 0.271201 -0.795292 -0.458586 0.271682 -0.790302 -0.425485 0.27217 -0.784734 -0.391337 0.272663 -0.778512 -0.356122 0.273158 -0.771554 -0.319845 0.27365 -0.763767 -0.282538 0.274133 -0.755054 -0.24426 0.274597 -0.745312 -0.205103 0.275034 -0.734441 -0.165185 0.275432 -0.722337 -0.124651 0.275783 -0.708907 -0.0836707 0.276079 -0.694059 -0.0424308 0.276319 -0.677713 -0.00113336 0.276504 -0.659798 --0.0400081 0.276642 -0.640254 --0.0807708 0.276747 -0.61903 -4.7159 0.437337 -1.23297 -3.53644 0.387634 -1.28278 -2.72742 0.355822 -1.30419 -2.1515 0.347376 -1.30464 -1.75797 0.34412 -1.3021 -1.49047 0.342047 -1.29887 -1.30619 0.340294 -1.29553 -1.17624 0.338902 -1.29237 -1.08186 0.337965 -1.28949 -1.01078 0.337441 -1.28688 -0.954671 0.337204 -1.28446 -0.907507 0.337117 -1.28209 -0.865279 0.337099 -1.27966 -0.825529 0.337204 -1.27707 -0.787065 0.337389 -1.27426 -0.749596 0.337626 -1.27123 -0.712774 0.337901 -1.26794 -0.676269 0.338207 -1.26436 -0.639787 0.338537 -1.26048 -0.603061 0.338887 -1.25625 -0.565854 0.339253 -1.25163 -0.527951 0.339632 -1.24657 -0.489162 0.34002 -1.241 -0.449318 0.340415 -1.23486 -0.408274 0.340814 -1.22807 -0.365907 0.341214 -1.22052 -0.322122 0.341611 -1.21212 -0.276847 0.342 -1.20274 -0.230043 0.342375 -1.19224 -0.181702 0.342726 -1.1805 -0.131851 0.343042 -1.16734 -0.0805562 0.343309 -1.15263 -0.0279215 0.343509 -1.13619 --0.0259109 0.343626 -1.11787 --0.0807626 0.343644 -1.09753 --0.136424 0.34355 -1.075 --0.192655 0.343334 -1.05017 --0.249194 0.342996 -1.0229 --0.305758 0.342538 -0.993082 --0.362044 0.341974 -0.960618 -4.7159 0.577207 -2.01562 -3.63197 0.542275 -2.04342 -2.92526 0.507439 -2.06297 -2.39193 0.493458 -2.06373 -2.00435 0.486977 -2.05968 -1.7216 0.483283 -2.05424 -1.51211 0.480769 -2.04855 -1.35384 0.478957 -2.04307 -1.2315 0.477701 -2.03796 -1.13429 0.476899 -2.03321 -1.05429 0.476419 -2.02873 -0.985345 0.476122 -2.02438 -0.923137 0.475913 -2.02001 -0.864861 0.475838 -2.01549 -0.809022 0.475848 -2.01073 -0.75505 0.475911 -2.00572 -0.702355 0.476012 -2.00041 -0.650394 0.47614 -1.99475 -0.598684 0.476288 -1.98869 -0.546795 0.476449 -1.98217 -0.494343 0.476616 -1.9751 -0.440987 0.476784 -1.96741 -0.386424 0.476944 -1.95897 -0.330391 0.47709 -1.94968 -0.272658 0.477212 -1.93941 -0.213035 0.477301 -1.92799 -0.151366 0.477345 -1.91525 -0.0875372 0.47733 -1.90101 -0.0214744 0.47724 -1.88504 --0.0468516 0.477055 -1.86713 --0.117423 0.476753 -1.84703 --0.190172 0.476308 -1.82451 --0.264979 0.475694 -1.7993 --0.341675 0.474881 -1.77116 --0.420039 0.473844 -1.73982 --0.499805 0.472558 -1.70506 --0.580663 0.471007 -1.66662 --0.662263 0.46918 -1.6243 --0.744217 0.467079 -1.57788 --0.826105 0.464713 -1.52718 -4.7159 0.806693 -3.29503 -3.72993 0.789072 -3.30491 -3.1319 0.765923 -3.31493 -2.65373 0.753351 -3.31292 -2.28418 0.746317 -3.30661 -1.99649 0.742068 -3.29882 -1.76843 0.739271 -3.29065 -1.58392 0.737323 -3.28255 -1.43154 0.735949 -3.2747 -1.3029 0.734999 -3.26715 -1.1916 0.734349 -3.25983 -1.09245 0.733883 -3.25262 -1.0015 0.733514 -3.24539 -0.916003 0.733265 -3.238 -0.834249 0.733091 -3.23037 -0.755299 0.732961 -3.22244 -0.678271 0.732856 -3.21414 -0.602375 0.732763 -3.20539 -0.526913 0.732668 -3.19611 -0.451264 0.73256 -3.18618 -0.374873 0.732426 -3.17548 -0.297242 0.732252 -3.16389 -0.217926 0.73202 -3.15122 -0.136524 0.731714 -3.13732 -0.0526807 0.73131 -3.12195 --0.0339172 0.730784 -3.1049 --0.123539 0.730109 -3.08588 --0.216407 0.729252 -3.06461 --0.312697 0.728177 -3.04075 --0.412529 0.726845 -3.01396 --0.515963 0.725213 -2.98383 --0.622996 0.723235 -2.94997 --0.733549 0.720864 -2.91194 --0.847469 0.718053 -2.86929 --0.96452 0.714756 -2.82158 --1.08439 0.710936 -2.76833 --1.20666 0.70656 -2.70909 --1.33086 0.701611 -2.64342 --1.45641 0.696082 -2.57089 --1.58266 0.689984 -2.49112 -4.7159 1.18321 -5.38649 -3.5727 1.18393 -5.37451 -2.72536 1.18465 -5.36254 -2.10399 1.18537 -5.35056 -1.65417 1.18609 -5.33859 -1.33351 1.18681 -5.32661 -1.10898 1.18753 -5.31464 -0.954885 1.18825 -5.30266 -0.851195 1.18897 -5.29069 -0.782317 1.18969 -5.27871 -0.736106 1.19041 -5.26674 -0.703103 1.19113 -5.25476 -0.675941 1.19185 -5.24279 -0.649406 1.19257 -5.23081 -0.621323 1.19329 -5.21884 -0.590265 1.19401 -5.20686 -0.554931 1.19473 -5.19489 -0.514147 1.19545 -5.18292 -0.466856 1.19616 -5.17094 -0.412117 1.19688 -5.15897 -0.349099 1.19761 -5.14699 -0.277079 1.19832 -5.13502 -0.195437 1.19887 -5.12304 -0.103655 1.19912 -5.11107 -0.00131476 1.19896 -5.09909 --0.111906 1.19826 -5.08649 --0.236206 1.19691 -5.0717 --0.371662 1.1948 -5.05405 --0.518234 1.19182 -5.03281 --0.67576 1.18787 -5.0072 --0.843953 1.18288 -4.97633 --1.0224 1.17678 -4.93929 --1.21055 1.16955 -4.8951 --1.40772 1.16119 -4.84274 --1.61311 1.15172 -4.78117 --1.82576 1.14121 -4.70935 --2.04459 1.12974 -4.62625 --2.2684 1.11743 -4.53088 --2.49586 1.10442 -4.42229 --2.72551 1.09087 -4.29964 -0.756436 0.324081 -0.00109817 -0.748261 0.324434 -0.00219893 -0.739706 0.324795 -0.0033304 -0.730622 0.325172 -0.00451393 -0.720889 0.325567 -0.00575833 -0.710407 0.32598 -0.00706074 -0.699105 0.326408 -0.00841494 -0.686933 0.326848 -0.00981273 -0.673863 0.327297 -0.0112461 -0.659888 0.327753 -0.0127085 -0.645021 0.328215 -0.014195 -0.629293 0.32868 -0.0157021 -0.612749 0.329146 -0.0172247 -0.59545 0.329612 -0.018754 -0.577464 0.330071 -0.020274 -0.558873 0.330515 -0.0217597 -0.539765 0.330935 -0.0231774 -0.520234 0.331317 -0.0244869 -0.500382 0.331648 -0.0256453 -0.480316 0.331918 -0.026613 -0.460151 0.332116 -0.027359 -0.440003 0.332239 -0.027865 -0.419996 0.332287 -0.028127 -0.400251 0.332262 -0.0281552 -0.380891 0.332173 -0.0279698 -0.362035 0.332029 -0.0275968 -0.343797 0.331838 -0.0270628 -4.7159 0.323733 -2.3002e-05 -3.38786 0.323728 -2.6058e-05 -2.4625 0.323728 -2.425e-05 -1.83172 0.323728 -2.3417e-05 -1.41311 0.323728 -2.3135e-05 -1.14429 0.323728 -2.3203e-05 -0.978481 0.323728 -2.3153e-05 -0.881049 0.323728 -2.2485e-05 -0.826816 0.323728 -2.1505e-05 -0.797972 0.323728 -2.0846e-05 -0.782446 0.323728 -2.0566e-05 -0.772631 0.323728 -2.0451e-05 -0.764408 0.323729 -2.0447e-05 -0.756438 0.32408 -0.0011183 -0.748263 0.324432 -0.00221902 -0.739708 0.324794 -0.00335049 -0.730625 0.32517 -0.00453408 -0.720891 0.325566 -0.00577854 -0.71041 0.325979 -0.00708105 -0.699107 0.326406 -0.00843535 -0.686935 0.326846 -0.00983326 -0.673864 0.327296 -0.0112668 -0.65989 0.327752 -0.0127293 -0.645023 0.328213 -0.0142158 -0.629295 0.328678 -0.015723 -0.612751 0.329145 -0.0172457 -0.595451 0.32961 -0.018775 -0.577466 0.330069 -0.020295 -0.558875 0.330514 -0.0217808 -0.539766 0.330933 -0.0231985 -0.520235 0.331315 -0.024508 -0.500383 0.331647 -0.0256664 -0.480317 0.331916 -0.0266341 -0.460151 0.332115 -0.0273801 -0.440004 0.332238 -0.0278861 -0.419996 0.332285 -0.0281481 -0.400251 0.332261 -0.0281762 -0.380891 0.332172 -0.0279908 -0.362035 0.332027 -0.0276177 -0.343796 0.331836 -0.0270836 -4.7159 0.32374 -6.1214e-05 -3.38786 0.323728 -7.2561e-05 -2.46251 0.323727 -6.7925e-05 -1.83173 0.323727 -6.5722e-05 -1.41311 0.323727 -6.5008e-05 -1.14429 0.323727 -6.5309e-05 -0.978485 0.323726 -6.5363e-05 -0.881053 0.323725 -6.3732e-05 -0.826819 0.323725 -6.1188e-05 -0.797975 0.323725 -5.9487e-05 -0.782447 0.323726 -5.8816e-05 -0.772632 0.323727 -5.864e-05 -0.76441 0.323729 -5.9308e-05 -0.756443 0.324078 -0.0011559 -0.748268 0.32443 -0.0022564 -0.739713 0.324791 -0.00338782 -0.730629 0.325168 -0.00457142 -0.720895 0.325563 -0.00581596 -0.710414 0.325976 -0.00711857 -0.699111 0.326404 -0.00847302 -0.686939 0.326844 -0.00987107 -0.673868 0.327293 -0.0113047 -0.659893 0.327749 -0.0127673 -0.645026 0.328211 -0.014254 -0.629298 0.328676 -0.0157612 -0.612754 0.329142 -0.017284 -0.595454 0.329608 -0.0188134 -0.577468 0.330067 -0.0203334 -0.558877 0.330511 -0.0218191 -0.539768 0.330931 -0.0232368 -0.520237 0.331313 -0.0245463 -0.500384 0.331644 -0.0257046 -0.480318 0.331914 -0.0266722 -0.460152 0.332113 -0.0274182 -0.440004 0.332236 -0.027924 -0.419996 0.332283 -0.0281859 -0.400251 0.332258 -0.0282139 -0.38089 0.332169 -0.0280283 -0.362034 0.332025 -0.027655 -0.343795 0.331833 -0.0271207 -4.7159 0.323752 -0.000124833 -3.38788 0.323727 -0.000156085 -2.46252 0.323725 -0.000147032 -1.83174 0.323724 -0.00014257 -1.41312 0.323725 -0.00014119 -1.1443 0.323724 -0.000142009 -0.978493 0.323722 -0.000142367 -0.881059 0.323721 -0.000139193 -0.826824 0.32372 -0.000134118 -0.797979 0.32372 -0.000130829 -0.782449 0.323722 -0.000129701 -0.772632 0.323723 -0.000129709 -0.764415 0.323728 -0.000132835 -0.756452 0.324075 -0.00122588 -0.748277 0.324426 -0.00232573 -0.739722 0.324787 -0.00345688 -0.730638 0.325163 -0.00464039 -0.720904 0.325559 -0.00588493 -0.710422 0.325971 -0.00718763 -0.699119 0.326399 -0.0085422 -0.686946 0.326839 -0.00994041 -0.673875 0.327288 -0.0113742 -0.6599 0.327745 -0.0128369 -0.645032 0.328206 -0.0143237 -0.629304 0.328671 -0.015831 -0.61276 0.329138 -0.0173538 -0.595459 0.329603 -0.0188831 -0.577473 0.330062 -0.020403 -0.558882 0.330507 -0.0218886 -0.539772 0.330926 -0.0233062 -0.520241 0.331308 -0.0246154 -0.500387 0.33164 -0.0257735 -0.480321 0.33191 -0.0267408 -0.460154 0.332108 -0.0274865 -0.440005 0.332231 -0.027992 -0.419996 0.332278 -0.0282535 -0.40025 0.332254 -0.0282811 -0.380889 0.332165 -0.0280951 -0.362032 0.33202 -0.0277213 -0.343793 0.331829 -0.0271864 -4.7159 0.323775 -0.000230537 -3.38789 0.323725 -0.000306068 -2.46255 0.323721 -0.000290222 -1.83176 0.32372 -0.000282055 -1.41314 0.32372 -0.000279662 -1.14432 0.32372 -0.000281502 -0.978507 0.323716 -0.00028241 -0.88107 0.323712 -0.000276595 -0.826833 0.323711 -0.000267427 -0.797986 0.323712 -0.000261846 -0.782454 0.323714 -0.000260389 -0.772633 0.323718 -0.000261289 -0.764424 0.323727 -0.000270962 -0.756468 0.324068 -0.00135546 -0.748294 0.324418 -0.00245365 -0.739738 0.324779 -0.00358402 -0.730653 0.325155 -0.00476709 -0.720918 0.32555 -0.0060114 -0.710436 0.325963 -0.00731403 -0.699133 0.32639 -0.00866862 -0.686959 0.32683 -0.0100669 -0.673887 0.32728 -0.0115008 -0.659911 0.327736 -0.0129636 -0.645043 0.328198 -0.0144504 -0.629314 0.328663 -0.0159576 -0.61277 0.32913 -0.0174802 -0.595469 0.329595 -0.0190093 -0.577482 0.330054 -0.0205288 -0.55889 0.330499 -0.0220139 -0.53978 0.330918 -0.023431 -0.520247 0.3313 -0.0247396 -0.500393 0.331632 -0.025897 -0.480325 0.331902 -0.0268637 -0.460157 0.332101 -0.0276086 -0.440007 0.332224 -0.0281133 -0.419997 0.332271 -0.028374 -0.400249 0.332246 -0.0284007 -0.380887 0.332157 -0.0282136 -0.36203 0.332013 -0.0278387 -0.343789 0.331821 -0.0273026 -4.7159 0.323815 -0.000405605 -3.38793 0.323722 -0.000574003 -2.46259 0.323714 -0.000547998 -1.8318 0.323712 -0.000533831 -1.41318 0.323713 -0.000529933 -1.14435 0.323712 -0.00053367 -0.978533 0.323705 -0.000535393 -0.881091 0.323698 -0.000524983 -0.82685 0.323694 -0.000509344 -0.798 0.323696 -0.000500748 -0.782463 0.323701 -0.000499628 -0.772637 0.323707 -0.000503174 -0.764441 0.323725 -0.000527731 -0.756498 0.324057 -0.00159372 -0.748324 0.324405 -0.00268802 -0.739766 0.324764 -0.00381644 -0.730681 0.32514 -0.00499824 -0.720945 0.325535 -0.00624169 -0.710462 0.325947 -0.00754375 -0.699157 0.326375 -0.00889801 -0.686982 0.326815 -0.0102961 -0.673909 0.327265 -0.0117298 -0.659932 0.327721 -0.0131924 -0.645063 0.328183 -0.0146789 -0.629333 0.328648 -0.0161857 -0.612788 0.329115 -0.0177077 -0.595486 0.329581 -0.019236 -0.577498 0.33004 -0.0207545 -0.558905 0.330485 -0.0222385 -0.539794 0.330904 -0.0236542 -0.520259 0.331286 -0.0249613 -0.500403 0.331618 -0.0261173 -0.480333 0.331888 -0.0270823 -0.460162 0.332087 -0.0278255 -0.44001 0.332211 -0.0283284 -0.419997 0.332258 -0.0285872 -0.400248 0.332234 -0.0286119 -0.380884 0.332144 -0.0284227 -0.362024 0.332 -0.0280454 -0.343783 0.331807 -0.0275065 -4.7159 0.323882 -0.00069465 -3.38799 0.323717 -0.00104844 -2.46266 0.323703 -0.00100788 -1.83187 0.323699 -0.000984165 -1.41324 0.3237 -0.000978116 -1.1444 0.323698 -0.000985236 -0.978578 0.323686 -0.000987987 -0.881128 0.323672 -0.000969719 -0.826882 0.323666 -0.00094433 -0.798027 0.323669 -0.000932462 -0.782482 0.323677 -0.000933649 -0.772645 0.323689 -0.000943802 -0.764473 0.323719 -0.000998072 -0.756552 0.324037 -0.00202792 -0.748377 0.324381 -0.00311365 -0.739818 0.324739 -0.00423755 -0.730731 0.325114 -0.00541624 -0.720993 0.325508 -0.00665733 -0.710507 0.32592 -0.00795764 -0.699201 0.326348 -0.00931057 -0.687023 0.326788 -0.0107076 -0.673948 0.327238 -0.0121404 -0.659969 0.327695 -0.0136021 -0.645098 0.328157 -0.0150875 -0.629367 0.328623 -0.016593 -0.612819 0.32909 -0.0181134 -0.595516 0.329556 -0.0196397 -0.577527 0.330016 -0.0211559 -0.558931 0.33046 -0.0226372 -0.539817 0.33088 -0.0240499 -0.520279 0.331263 -0.0253538 -0.50042 0.331595 -0.0265063 -0.480345 0.331865 -0.0274678 -0.460171 0.332064 -0.0282073 -0.440014 0.332188 -0.0287065 -0.419998 0.332236 -0.0289615 -0.400245 0.332212 -0.028982 -0.380877 0.332123 -0.0287882 -0.362015 0.331977 -0.0284059 -0.343771 0.331785 -0.0278615 -4.7159 0.323996 -0.00117064 -3.38809 0.323709 -0.00187873 -2.4628 0.323682 -0.00181863 -1.832 0.323674 -0.00178008 -1.41335 0.323677 -0.00177112 -1.1445 0.323674 -0.00178406 -0.97866 0.323653 -0.00178786 -0.881197 0.323628 -0.00175675 -0.826943 0.323616 -0.00171784 -0.798083 0.323621 -0.00170411 -0.782523 0.323636 -0.00171241 -0.77267 0.323656 -0.00173744 -0.764534 0.323706 -0.00184309 -0.756647 0.324001 -0.00281053 -0.748472 0.324339 -0.0038783 -0.73991 0.324694 -0.00499242 -0.730819 0.325068 -0.00616412 -0.721077 0.325461 -0.00739962 -0.710588 0.325873 -0.00869546 -0.699277 0.3263 -0.0100447 -0.687095 0.326741 -0.0114387 -0.674016 0.327192 -0.0128687 -0.660033 0.327649 -0.0143277 -0.645159 0.328112 -0.0158103 -0.629424 0.328579 -0.0173125 -0.612874 0.329047 -0.0188291 -0.595568 0.329514 -0.020351 -0.577575 0.329973 -0.021862 -0.558976 0.330419 -0.0233374 -0.539857 0.330839 -0.0247437 -0.520314 0.331222 -0.0260408 -0.500448 0.331555 -0.0271862 -0.480367 0.331826 -0.0281403 -0.460185 0.332026 -0.0288725 -0.440021 0.33215 -0.029364 -0.419998 0.332199 -0.029611 -0.400238 0.332175 -0.0296232 -0.380865 0.332086 -0.0294204 -0.361998 0.331941 -0.0290281 -0.343749 0.331748 -0.0284727 -4.7159 0.324187 -0.00195291 -3.38828 0.323696 -0.00331144 -2.46303 0.323647 -0.00322778 -1.83222 0.323633 -0.0031668 -1.41355 0.323638 -0.00315419 -1.14467 0.323633 -0.00317681 -0.978807 0.323597 -0.00318134 -0.881327 0.323553 -0.00313068 -0.827065 0.323532 -0.00307561 -0.798199 0.32354 -0.00306573 -0.782619 0.323565 -0.00309152 -0.772737 0.323599 -0.00314703 -0.76465 0.323673 -0.00332653 -0.756811 0.32394 -0.00420225 -0.748637 0.324267 -0.00523456 -0.740069 0.324617 -0.0063286 -0.730971 0.324988 -0.00748555 -0.721222 0.32538 -0.00870891 -0.710725 0.325791 -0.00999462 -0.699406 0.326219 -0.0113353 -0.687218 0.326661 -0.0127217 -0.674132 0.327112 -0.0141449 -0.660142 0.327572 -0.0155973 -0.645262 0.328036 -0.017073 -0.629521 0.328504 -0.0185678 -0.612966 0.328973 -0.0200759 -0.595654 0.329441 -0.0215882 -0.577656 0.329902 -0.0230883 -0.55905 0.330348 -0.0245517 -0.539923 0.330769 -0.025945 -0.52037 0.331153 -0.0272283 -0.500494 0.331488 -0.0283594 -0.480401 0.33176 -0.0292991 -0.460206 0.331962 -0.0300165 -0.44003 0.332087 -0.030493 -0.419994 0.332137 -0.0307246 -0.400224 0.332114 -0.0307204 -0.380841 0.332026 -0.0305002 -0.361965 0.33188 -0.0300888 -0.343709 0.331687 -0.0295121 -4.7159 0.324506 -0.00323664 -3.38858 0.323675 -0.00574379 -2.46342 0.323589 -0.00563734 -1.83259 0.323565 -0.00554361 -1.41388 0.323573 -0.00552699 -1.14497 0.323565 -0.00556514 -0.979075 0.323504 -0.00556974 -0.881576 0.323427 -0.00549253 -0.827314 0.323391 -0.00542397 -0.798452 0.323403 -0.00543266 -0.78284 0.323444 -0.00549584 -0.772915 0.323499 -0.00560654 -0.764877 0.323597 -0.00586922 -0.757092 0.323835 -0.00663531 -0.74892 0.324145 -0.00760396 -0.740339 0.324486 -0.00865912 -0.731228 0.324853 -0.00978679 -0.721465 0.325242 -0.0109855 -0.710954 0.325653 -0.01225 -0.699622 0.326082 -0.013572 -0.687419 0.326525 -0.0149418 -0.674321 0.326979 -0.0163496 -0.66032 0.327441 -0.0177871 -0.645429 0.327908 -0.0192477 -0.629679 0.328379 -0.0207265 -0.613114 0.328851 -0.0222171 -0.595793 0.329321 -0.0237097 -0.577785 0.329783 -0.0251881 -0.559167 0.330231 -0.0266277 -0.540026 0.330655 -0.0279955 -0.520457 0.331041 -0.0292521 -0.500562 0.331377 -0.0303557 -0.480449 0.331652 -0.0312673 -0.460234 0.331856 -0.0319565 -0.440037 0.331985 -0.0324044 -0.419981 0.332037 -0.0326066 -0.400192 0.332016 -0.0325717 -0.380792 0.331929 -0.0323186 -0.361902 0.331783 -0.0318714 -0.343633 0.331589 -0.0312552 -4.7159 0.325035 -0.00534108 -3.38909 0.323648 -0.00979863 -2.46408 0.323497 -0.00968308 -1.83323 0.323454 -0.00954346 -1.41447 0.323468 -0.00952351 -1.1455 0.323457 -0.00958579 -0.979573 0.323355 -0.0095902 -0.882069 0.323225 -0.0094838 -0.827838 0.323161 -0.00941813 -0.799 0.323178 -0.00947582 -0.783342 0.323242 -0.00960846 -0.77335 0.323324 -0.00980135 -0.765325 0.32344 -0.0101342 -0.757573 0.323654 -0.0107961 -0.749396 0.323941 -0.0116679 -0.740792 0.32427 -0.0126543 -0.731652 0.324629 -0.0137278 -0.721861 0.325015 -0.0148799 -0.711323 0.325425 -0.0161029 -0.699966 0.325854 -0.0173875 -0.68774 0.3263 -0.0187229 -0.674619 0.326758 -0.0200984 -0.660597 0.327225 -0.0215048 -0.645688 0.327697 -0.0229343 -0.629921 0.328173 -0.0243803 -0.61334 0.328649 -0.0258358 -0.596003 0.329124 -0.0272902 -0.577976 0.32959 -0.0287267 -0.559338 0.330042 -0.0301211 -0.540175 0.330468 -0.0314407 -0.520579 0.330858 -0.0326471 -0.500653 0.331199 -0.0336992 -0.480508 0.331479 -0.0345588 -0.460258 0.331688 -0.0351954 -0.440026 0.331821 -0.0355903 -0.419937 0.331877 -0.0357382 -0.400117 0.331859 -0.0356467 -0.380689 0.331774 -0.0353333 -0.361774 0.33163 -0.0348208 -0.343483 0.331435 -0.034133 -4.7159 0.325911 -0.00878835 -3.38993 0.323622 -0.0164239 -2.46518 0.323357 -0.0163413 -1.83431 0.323284 -0.0161406 -1.41547 0.323308 -0.0161202 -1.14645 0.32329 -0.0162188 -0.980517 0.323122 -0.016226 -0.883066 0.322907 -0.0161028 -0.828943 0.322799 -0.0160828 -0.800168 0.322821 -0.0162402 -0.784434 0.322909 -0.0164799 -0.774321 0.323015 -0.0167661 -0.76622 0.323143 -0.0171439 -0.758422 0.323342 -0.0177238 -0.750202 0.323606 -0.0184797 -0.741542 0.323918 -0.0193624 -0.732343 0.324268 -0.0203457 -0.722494 0.324649 -0.0214164 -0.711903 0.325057 -0.0225644 -0.700496 0.325489 -0.023779 -0.688226 0.32594 -0.0250484 -0.675064 0.326405 -0.026361 -0.661005 0.32688 -0.027706 -0.646062 0.327361 -0.029074 -0.630265 0.327845 -0.0304566 -0.613655 0.328329 -0.0318451 -0.596288 0.328811 -0.0332274 -0.578232 0.329284 -0.0345864 -0.55956 0.329742 -0.0358979 -0.540357 0.330175 -0.03713 -0.520717 0.330572 -0.0382456 -0.500743 0.33092 -0.0392048 -0.480544 0.331207 -0.0399704 -0.460239 0.331424 -0.0405125 -0.439952 0.331565 -0.0408118 -0.419809 0.331628 -0.0408619 -0.399938 0.331617 -0.0406689 -0.380464 0.331535 -0.0402477 -0.361506 0.331393 -0.0396191 -0.343178 0.331199 -0.0388047 -4.7159 0.327356 -0.0144324 -3.39126 0.323628 -0.0270168 -2.46697 0.323164 -0.0270644 -1.83612 0.323043 -0.0267877 -1.41721 0.32308 -0.0267733 -1.14818 0.323051 -0.0269252 -0.982328 0.32278 -0.0269485 -0.88508 0.322436 -0.026854 -0.831216 0.322259 -0.0269594 -0.802536 0.322274 -0.0272789 -0.786651 0.322375 -0.0276477 -0.776295 0.322494 -0.0280149 -0.767964 0.322626 -0.0284171 -0.759976 0.322818 -0.0289382 -0.751601 0.323068 -0.0295853 -0.742799 0.323366 -0.0303426 -0.733467 0.323705 -0.0311987 -0.723496 0.324081 -0.0321441 -0.712794 0.32449 -0.0331695 -0.701287 0.324926 -0.0342643 -0.688927 0.325385 -0.0354168 -0.675686 0.325861 -0.0366149 -0.661556 0.326348 -0.0378463 -0.64655 0.326843 -0.0391001 -0.630695 0.327341 -0.0403656 -0.614031 0.327839 -0.0416315 -0.596612 0.328333 -0.0428842 -0.578501 0.328819 -0.0441055 -0.559771 0.329288 -0.0452712 -0.540505 0.329732 -0.0463506 -0.520794 0.33014 -0.047308 -0.500741 0.3305 -0.0481055 -0.480459 0.330799 -0.0487074 -0.460067 0.331029 -0.0490841 -0.439692 0.331182 -0.049216 -0.419463 0.331256 -0.049095 -0.39951 0.331254 -0.0487241 -0.379959 0.33118 -0.0481153 -0.360929 0.331042 -0.0472856 -0.342534 0.33085 -0.0462536 -4.7159 0.329738 -0.02367 -3.39336 0.323752 -0.0435704 -2.46986 0.322944 -0.0439431 -1.83911 0.322746 -0.0435801 -1.4202 0.322799 -0.0435839 -1.15131 0.322747 -0.0438122 -0.985789 0.322322 -0.043888 -0.889054 0.32179 -0.0439189 -0.83565 0.321509 -0.0442569 -0.807017 0.321487 -0.0447827 -0.790801 0.321574 -0.0452764 -0.779996 0.321686 -0.0457062 -0.771217 0.321813 -0.0461237 -0.762819 0.322001 -0.0466041 -0.754083 0.322246 -0.0471634 -0.744959 0.322538 -0.0477976 -0.735335 0.322874 -0.0485063 -0.725101 0.32325 -0.0492879 -0.714163 0.323663 -0.0501382 -0.702447 0.324109 -0.0510504 -0.689901 0.324581 -0.0520154 -0.676496 0.325073 -0.0530225 -0.662223 0.32558 -0.05406 -0.647088 0.326096 -0.0551158 -0.631117 0.326615 -0.0561775 -0.614348 0.327134 -0.0572315 -0.596828 0.327649 -0.0582622 -0.578617 0.328153 -0.0592501 -0.559784 0.32864 -0.0601708 -0.540409 0.329102 -0.0609947 -0.520582 0.329528 -0.0616879 -0.500405 0.329905 -0.0622149 -0.479992 0.330223 -0.0625415 -0.459464 0.330471 -0.062639 -0.438951 0.330641 -0.0624869 -0.418585 0.330732 -0.0620745 -0.398498 0.330743 -0.0614011 -0.378817 0.33068 -0.0604738 -0.359662 0.33055 -0.059305 -0.341147 0.330363 -0.0579091 -4.7159 0.333662 -0.0387857 -3.39656 0.324209 -0.0688511 -2.47446 0.322808 -0.069899 -1.84403 0.322491 -0.06945 -1.42535 0.322558 -0.0694912 -1.15694 0.32246 -0.0698267 -0.992256 0.321815 -0.0700282 -0.896504 0.321035 -0.0703242 -0.843673 0.320597 -0.0709815 -0.814843 0.320487 -0.0717197 -0.797977 0.320522 -0.0723264 -0.786419 0.320604 -0.0728136 -0.776901 0.320714 -0.0732499 -0.767798 0.320895 -0.0737063 -0.758403 0.321138 -0.0741987 -0.748664 0.321433 -0.0747241 -0.738472 0.321774 -0.0752842 -0.727715 0.322159 -0.0758806 -0.7163 0.322586 -0.0765138 -0.704155 0.323048 -0.0771815 -0.691225 0.32354 -0.0778796 -0.677479 0.324057 -0.0786014 -0.662902 0.32459 -0.0793384 -0.647498 0.325134 -0.0800798 -0.631286 0.325682 -0.0808135 -0.614297 0.326231 -0.081525 -0.596573 0.326774 -0.0821975 -0.578167 0.327305 -0.0828106 -0.559143 0.327819 -0.0833396 -0.539575 0.328306 -0.0837559 -0.51955 0.328756 -0.0840274 -0.499169 0.329158 -0.0841206 -0.478544 0.329499 -0.0840031 -0.457798 0.32977 -0.0836464 -0.437062 0.329963 -0.0830287 -0.416471 0.330074 -0.0821363 -0.396158 0.330103 -0.0809636 -0.376252 0.330054 -0.0795121 -0.356875 0.329937 -0.0777881 -0.338136 0.329758 -0.075801 -4.7159 0.34012 -0.063516 -3.40138 0.325483 -0.106655 -2.48168 0.32307 -0.108947 -1.85204 0.322572 -0.10843 -1.43409 0.322643 -0.108533 -1.16688 0.322459 -0.109012 -1.00381 0.321531 -0.109441 -0.909466 0.320455 -0.110119 -0.856978 0.319806 -0.111104 -0.82744 0.319554 -0.112029 -0.809447 0.319501 -0.112744 -0.796719 0.319529 -0.113296 -0.786074 0.319607 -0.113764 -0.775882 0.319772 -0.114214 -0.765433 0.32001 -0.114657 -0.75468 0.320307 -0.115089 -0.743518 0.320658 -0.115506 -0.731843 0.321059 -0.115908 -0.719566 0.321504 -0.116297 -0.706621 0.321988 -0.116672 -0.692956 0.322506 -0.117031 -0.678539 0.32305 -0.117373 -0.663355 0.323614 -0.117693 -0.647402 0.324189 -0.117985 -0.630692 0.324771 -0.118238 -0.613249 0.325352 -0.11844 -0.595106 0.325927 -0.118575 -0.576308 0.326489 -0.118623 -0.556909 0.327033 -0.11856 -0.536976 0.327549 -0.118359 -0.51659 0.328027 -0.117988 -0.495846 0.328455 -0.117416 -0.474852 0.328822 -0.116611 -0.453732 0.329118 -0.115544 -0.432613 0.329334 -0.114192 -0.411631 0.329466 -0.112537 -0.390921 0.329514 -0.110568 -0.370609 0.329483 -0.108282 -0.350818 0.329379 -0.105677 -0.331658 0.329214 -0.102757 -4.7159 0.350744 -0.103972 -3.40851 0.32861 -0.162311 -2.4929 0.324496 -0.166685 -1.86499 0.323723 -0.166145 -1.44874 0.323762 -0.166329 -1.1838 0.323441 -0.166977 -1.02316 0.322201 -0.167705 -0.930161 0.320824 -0.16875 -0.877246 0.319939 -0.169966 -0.846185 0.319518 -0.171017 -0.826389 0.319356 -0.171816 -0.81191 0.319316 -0.172425 -0.799601 0.319348 -0.172922 -0.787799 0.31949 -0.173367 -0.775775 0.319718 -0.173764 -0.763483 0.320015 -0.174102 -0.750825 0.320372 -0.174373 -0.737701 0.320785 -0.174571 -0.724031 0.321246 -0.174693 -0.709756 0.321748 -0.174737 -0.694833 0.322286 -0.1747 -0.679235 0.322851 -0.174582 -0.662948 0.323435 -0.174379 -0.64597 0.324032 -0.174089 -0.62831 0.324635 -0.173703 -0.609983 0.325238 -0.173213 -0.591015 0.325835 -0.172605 -0.571439 0.326419 -0.17186 -0.551301 0.326982 -0.170956 -0.530656 0.327517 -0.169867 -0.509574 0.328012 -0.168563 -0.488142 0.328458 -0.167012 -0.46646 0.328841 -0.165184 -0.444644 0.329152 -0.163048 -0.422818 0.329382 -0.160579 -0.401112 0.329528 -0.157756 -0.379659 0.329589 -0.154561 -0.358584 0.329569 -0.150985 -0.338008 0.329477 -0.147021 -0.31804 0.329324 -0.142667 -4.7159 0.368218 -0.170151 -3.4191 0.335737 -0.243796 -2.51044 0.328795 -0.251392 -1.88595 0.327591 -0.250903 -1.47291 0.327528 -0.251158 -1.2115 0.327017 -0.251943 -1.05347 0.325505 -0.252902 -0.960737 0.323887 -0.254114 -0.905978 0.322797 -0.255359 -0.872197 0.32222 -0.2564 -0.849621 0.321954 -0.257192 -0.832545 0.321848 -0.25779 -0.817794 0.321835 -0.258258 -0.803638 0.321956 -0.258642 -0.789306 0.322177 -0.258938 -0.774756 0.322474 -0.259125 -0.759887 0.322837 -0.259191 -0.744605 0.323257 -0.259124 -0.728834 0.323725 -0.258915 -0.712521 0.324234 -0.258557 -0.695631 0.324775 -0.258043 -0.678142 0.325341 -0.257368 -0.660044 0.325923 -0.256528 -0.641337 0.326516 -0.255517 -0.622027 0.327112 -0.254328 -0.602125 0.327706 -0.25295 -0.58165 0.328292 -0.251371 -0.560627 0.328864 -0.249572 -0.539088 0.329416 -0.247531 -0.517078 0.329938 -0.245221 -0.494655 0.33042 -0.242614 -0.471892 0.330852 -0.239677 -0.44888 0.331222 -0.236376 -0.425721 0.331521 -0.232682 -0.402532 0.331739 -0.228564 -0.379436 0.331875 -0.223997 -0.356559 0.331926 -0.218959 -0.334026 0.3319 -0.213436 -0.311956 0.331803 -0.207414 -0.290461 0.331649 -0.200886 -4.7159 0.396953 -0.278401 -3.43523 0.351321 -0.364038 -2.5385 0.339707 -0.376342 -1.92035 0.337762 -0.376033 -1.51258 0.337455 -0.376259 -1.2553 0.336716 -0.376989 -1.09852 0.335038 -0.377877 -1.00367 0.333296 -0.378882 -0.944863 0.332075 -0.379847 -0.906581 0.331385 -0.380641 -0.879744 0.331044 -0.381232 -0.85877 0.330888 -0.38165 -0.840381 0.330842 -0.381925 -0.822734 0.330956 -0.382084 -0.804999 0.33118 -0.382103 -0.787127 0.331486 -0.381959 -0.769013 0.331857 -0.381635 -0.750557 0.332281 -0.381113 -0.731686 0.332749 -0.380378 -0.712346 0.33325 -0.379418 -0.692502 0.333775 -0.378221 -0.672134 0.334317 -0.376776 -0.651229 0.334867 -0.375074 -0.629784 0.33542 -0.373102 -0.6078 0.33597 -0.370848 -0.585283 0.336513 -0.368296 -0.562241 0.337043 -0.365427 -0.538688 0.337557 -0.362219 -0.514647 0.338047 -0.358642 -0.490149 0.338506 -0.354666 -0.465241 0.338925 -0.350256 -0.439984 0.339294 -0.345374 -0.414454 0.339601 -0.339983 -0.388746 0.339837 -0.334045 -0.362968 0.339996 -0.327526 -0.337236 0.340073 -0.320395 -0.311674 0.34007 -0.312623 -0.286409 0.339991 -0.30419 -0.261565 0.339848 -0.295078 -0.237263 0.339655 -0.285272 -4.7159 0.444202 -0.455465 -3.46106 0.384601 -0.545145 -2.58554 0.365295 -0.564026 -1.9787 0.361897 -0.564163 -1.57821 0.361042 -0.564066 -1.32367 0.36001 -0.564248 -1.1644 0.358269 -0.564485 -1.06343 0.356505 -0.56475 -0.997225 0.355222 -0.564993 -0.951674 0.354459 -0.565156 -0.918211 0.354061 -0.565203 -0.891236 0.353868 -0.565115 -0.867274 0.353793 -0.564877 -0.844317 0.353905 -0.564477 -0.821444 0.354134 -0.563871 -0.798589 0.354443 -0.563034 -0.775631 0.354811 -0.561945 -0.752454 0.355223 -0.560583 -0.728971 0.355667 -0.55893 -0.705117 0.356131 -0.556967 -0.680845 0.356606 -0.554678 -0.656121 0.357086 -0.552044 -0.630919 0.357561 -0.549047 -0.60522 0.358028 -0.545667 -0.579009 0.358483 -0.541881 -0.552276 0.358922 -0.537662 -0.525012 0.359342 -0.532979 -0.497216 0.359739 -0.527795 -0.468896 0.360107 -0.52207 -0.440069 0.360441 -0.515757 -0.41077 0.360731 -0.508809 -0.38105 0.360969 -0.501173 -0.350978 0.361142 -0.492799 -0.320643 0.361243 -0.483636 -0.290152 0.361264 -0.473639 -0.259623 0.361201 -0.462764 -0.229188 0.361058 -0.450975 -0.198984 0.36084 -0.438241 -0.169153 0.360559 -0.424535 -0.139839 0.360233 -0.409839 -4.7159 0.521885 -0.745083 -3.50451 0.453559 -0.825843 -2.66846 0.422263 -0.852965 -2.0811 0.415668 -0.854168 -1.68858 0.413528 -0.85323 -1.43199 0.41193 -0.852036 -1.26358 0.410053 -0.850791 -1.15037 0.408248 -0.849604 -1.07153 0.40688 -0.848508 -1.01424 0.40601 -0.847469 -0.970221 0.405517 -0.84643 -0.933708 0.405243 -0.845314 -0.900924 0.405094 -0.844041 -0.869623 0.405155 -0.842549 -0.83875 0.405337 -0.84077 -0.808199 0.405592 -0.838682 -0.7778 0.405893 -0.836263 -0.7474 0.406225 -0.833489 -0.71687 0.406572 -0.830337 -0.68611 0.406925 -0.826783 -0.655033 0.407274 -0.822801 -0.623569 0.407611 -0.818365 -0.591657 0.407931 -0.813444 -0.559242 0.40823 -0.808004 -0.526276 0.408505 -0.802004 -0.492717 0.408754 -0.7954 -0.45853 0.408973 -0.788138 -0.423689 0.40916 -0.780161 -0.388182 0.409308 -0.771402 -0.352012 0.409412 -0.761791 -0.315202 0.409462 -0.751254 -0.277796 0.409447 -0.739714 -0.239864 0.409355 -0.727095 -0.201498 0.409176 -0.713323 -0.162814 0.4089 -0.698327 -0.123948 0.408525 -0.682043 -0.0850511 0.40805 -0.664415 -0.0462896 0.407483 -0.645392 -0.00783915 0.406838 -0.624931 --0.030116 0.406134 -0.603 -4.7159 0.6496 -1.2188 -3.57661 0.586813 -1.27563 -2.81453 0.541866 -1.30855 -2.25966 0.528586 -1.31195 -1.87408 0.523369 -1.30993 -1.60767 0.520302 -1.30663 -1.42094 0.517777 -1.30309 -1.28673 0.515609 -1.29967 -1.1873 0.513927 -1.29648 -1.11099 0.512757 -1.2935 -1.04978 0.511994 -1.29064 -0.99764 0.511477 -1.28777 -0.950403 0.511099 -1.28475 -0.905515 0.510955 -1.28145 -0.861724 0.510934 -1.27778 -0.818816 0.510977 -1.27373 -0.776521 0.511055 -1.26927 -0.734591 0.511149 -1.26437 -0.692811 0.511244 -1.25899 -0.650997 0.511328 -1.25311 -0.608986 0.511391 -1.24668 -0.566636 0.511426 -1.23965 -0.523818 0.511427 -1.23198 -0.480418 0.511389 -1.2236 -0.436334 0.511306 -1.21445 -0.391475 0.511176 -1.20444 -0.345769 0.510992 -1.1935 -0.299158 0.510749 -1.18152 -0.251606 0.510439 -1.16841 -0.203099 0.510049 -1.15404 -0.153652 0.509566 -1.13831 -0.10331 0.508975 -1.12109 -0.0521505 0.508258 -1.10226 -0.000281754 0.507398 -1.0817 --0.0521566 0.506384 -1.05931 --0.104997 0.505204 -1.03497 --0.158049 0.503858 -1.00859 --0.211097 0.50235 -0.980082 --0.26391 0.500693 -0.949356 --0.31624 0.498907 -0.916347 -4.7159 0.859566 -1.99364 -3.67856 0.81723 -2.01942 -3.03602 0.77053 -2.04542 -2.5346 0.749433 -2.04996 -2.16008 0.738876 -2.04714 -1.88033 0.73264 -2.04179 -1.66824 0.728279 -2.03569 -1.50412 0.724935 -2.02952 -1.37416 0.722351 -2.02354 -1.26855 0.720409 -2.0178 -1.1799 0.718965 -2.01222 -1.10226 0.717835 -2.00666 -1.03122 0.716885 -2.00094 -0.963935 0.716202 -1.99487 -0.898904 0.715652 -1.98836 -0.835702 0.715169 -1.98139 -0.773867 0.714717 -1.97392 -0.712976 0.714271 -1.96591 -0.652658 0.713811 -1.95729 -0.592584 0.713323 -1.94801 -0.532463 0.712791 -1.93799 -0.472038 0.712203 -1.92717 -0.411077 0.711547 -1.91544 -0.349374 0.710811 -1.90271 -0.286749 0.709983 -1.88885 -0.223046 0.709051 -1.87375 -0.158136 0.708001 -1.85726 -0.0919166 0.706815 -1.83922 -0.0243189 0.705476 -1.81947 --0.0446928 0.703962 -1.79783 --0.115116 0.702247 -1.7741 --0.186907 0.700304 -1.74811 --0.259978 0.698106 -1.71965 --0.334202 0.695624 -1.68853 --0.409405 0.692836 -1.65456 --0.485376 0.689723 -1.61755 --0.561865 0.686275 -1.57733 --0.638589 0.682493 -1.53373 --0.71523 0.678389 -1.4866 --0.791442 0.673984 -1.43579 -4.7159 1.20474 -3.26101 -3.7728 1.18382 -3.26307 -3.23979 1.15402 -3.27029 -2.79889 1.1359 -3.26866 -2.44753 1.12471 -3.2623 -2.16694 1.11731 -3.25378 -1.93927 1.11202 -3.24437 -1.75083 1.10799 -3.23469 -1.59163 1.10481 -3.225 -1.45433 1.10227 -3.21539 -1.3332 1.10022 -3.20582 -1.22345 1.09848 -3.19619 -1.1213 1.09693 -3.18634 -1.02414 1.09561 -3.17609 -0.930399 1.09441 -3.16535 -0.839352 1.09325 -3.15408 -0.750299 1.09211 -3.14221 -0.66261 1.09095 -3.12967 -0.575733 1.08975 -3.11638 -0.489176 1.08847 -3.10224 -0.402497 1.08709 -3.08713 -0.315302 1.08559 -3.07093 -0.22723 1.08393 -3.0535 -0.137958 1.0821 -3.03467 -0.0471931 1.08007 -3.01425 --0.0453257 1.0778 -2.99205 --0.139826 1.07525 -2.96783 --0.236501 1.07239 -2.94135 --0.335503 1.06918 -2.91233 --0.436942 1.06558 -2.88047 --0.540876 1.06153 -2.84546 --0.647308 1.05699 -2.80696 --0.756181 1.0519 -2.76462 --0.867369 1.04622 -2.71807 --0.980681 1.0399 -2.66696 --1.09585 1.03291 -2.61091 --1.21254 1.02523 -2.54956 --1.33034 1.01684 -2.48255 --1.44878 1.00776 -2.40954 --1.56729 0.998007 -2.33024 -4.7159 1.7722 -5.33399 -3.57571 1.77287 -5.31694 -2.73078 1.77354 -5.29989 -2.11138 1.7742 -5.28284 -1.66318 1.77487 -5.26578 -1.34386 1.77554 -5.24873 -1.1205 1.7762 -5.23168 -0.967427 1.77687 -5.21463 -0.864657 1.77753 -5.19757 -0.796629 1.7782 -5.18052 -0.751221 1.77887 -5.16347 -0.718996 1.77954 -5.14642 -0.6926 1.7802 -5.12936 -0.666811 1.78087 -5.11231 -0.639374 1.78154 -5.09526 -0.60878 1.7822 -5.0782 -0.573663 1.78287 -5.06115 -0.532802 1.78354 -5.0441 -0.48511 1.7842 -5.02705 -0.429631 1.78487 -5.00999 -0.365532 1.78554 -4.99294 -0.292102 1.78619 -4.97589 -0.208744 1.78662 -4.95884 -0.114979 1.78657 -4.94179 -0.0104384 1.78591 -4.92473 --0.105139 1.78445 -4.90709 --0.231882 1.78202 -4.88743 --0.36979 1.77844 -4.8651 --0.518739 1.77356 -4.83945 --0.678477 1.76722 -4.80973 --0.848625 1.75931 -4.77514 --1.02868 1.74975 -4.73482 --1.218 1.7385 -4.68785 --1.41583 1.72554 -4.63329 --1.62128 1.71093 -4.57019 --1.83335 1.69475 -4.49757 --2.05091 1.67713 -4.41447 --2.27272 1.65826 -4.31998 --2.49745 1.63833 -4.21321 --2.72366 1.61759 -4.09338 -0.784645 0.423237 -0.00104268 -0.776919 0.423697 -0.00208768 -0.768834 0.424169 -0.00316169 -0.760251 0.424661 -0.00428496 -0.751054 0.425178 -0.00546581 -0.74115 0.425717 -0.00670152 -0.730471 0.426276 -0.00798617 -0.718969 0.426851 -0.00931195 -0.706618 0.427437 -0.0106713 -0.693411 0.428033 -0.0120578 -0.679362 0.428636 -0.013467 -0.664499 0.429243 -0.0148954 -0.648865 0.429853 -0.0163384 -0.632516 0.430461 -0.0177874 -0.615519 0.43106 -0.0192273 -0.597949 0.431641 -0.0206345 -0.579888 0.432189 -0.0219772 -0.561424 0.432688 -0.0232171 -0.542651 0.433121 -0.0243139 -0.523668 0.433474 -0.02523 -0.504582 0.433733 -0.0259363 -0.485502 0.433894 -0.0264153 -0.466543 0.433956 -0.0266634 -0.447822 0.433924 -0.0266903 -0.429454 0.433808 -0.026515 -0.411554 0.433619 -0.0261621 -0.39423 0.43337 -0.0256568 -4.7159 0.422786 -2.189e-05 -3.39576 0.422781 -2.5831e-05 -2.47612 0.42278 -2.4008e-05 -1.84943 0.422779 -2.32e-05 -1.43372 0.422779 -2.2961e-05 -1.16694 0.422779 -2.309e-05 -1.00258 0.422778 -2.306e-05 -0.90617 0.422778 -2.2354e-05 -0.852689 0.422777 -2.1364e-05 -0.824424 0.422777 -2.0739e-05 -0.809377 0.422777 -2.0491e-05 -0.799992 0.422777 -2.0396e-05 -0.792179 0.422777 -2.0399e-05 -0.784648 0.423236 -0.00106277 -0.776922 0.423696 -0.00210772 -0.768837 0.424167 -0.00318172 -0.760253 0.42466 -0.00430503 -0.751056 0.425176 -0.00548594 -0.741152 0.425716 -0.00672174 -0.730473 0.426274 -0.00800648 -0.718971 0.426849 -0.00933237 -0.70662 0.427436 -0.0106918 -0.693413 0.428032 -0.0120785 -0.679364 0.428634 -0.0134877 -0.664501 0.429242 -0.0149162 -0.648866 0.429851 -0.0163593 -0.632517 0.430459 -0.0178083 -0.615521 0.431059 -0.0192482 -0.597951 0.431639 -0.0206555 -0.579889 0.432187 -0.0219982 -0.561425 0.432686 -0.0232381 -0.542652 0.43312 -0.0243349 -0.523669 0.433472 -0.0252511 -0.504583 0.433732 -0.0259573 -0.485502 0.433892 -0.0264363 -0.466543 0.433954 -0.0266844 -0.447822 0.433922 -0.0267112 -0.429454 0.433806 -0.0265359 -0.411553 0.433618 -0.0261829 -0.394229 0.433368 -0.0256776 -4.7159 0.422796 -5.837e-05 -3.39577 0.42278 -7.203e-05 -2.47613 0.422779 -6.7377e-05 -1.84943 0.422778 -6.524e-05 -1.43372 0.422778 -6.4646e-05 -1.16695 0.422778 -6.5128e-05 -1.00258 0.422776 -6.5263e-05 -0.906174 0.422775 -6.3545e-05 -0.852691 0.422774 -6.0985e-05 -0.824426 0.422774 -5.9378e-05 -0.809378 0.422774 -5.88e-05 -0.799992 0.422775 -5.8685e-05 -0.792182 0.422778 -5.9386e-05 -0.784652 0.423234 -0.00110049 -0.776927 0.423693 -0.0021452 -0.768842 0.424165 -0.00321913 -0.760258 0.424657 -0.00434244 -0.75106 0.425174 -0.0055234 -0.741156 0.425713 -0.00675929 -0.730477 0.426272 -0.00804415 -0.718974 0.426846 -0.00937017 -0.706623 0.427433 -0.0107297 -0.693417 0.428029 -0.0121165 -0.679367 0.428631 -0.0135259 -0.664504 0.429239 -0.0149545 -0.648869 0.429849 -0.0163975 -0.63252 0.430457 -0.0178466 -0.615523 0.431056 -0.0192866 -0.597953 0.431637 -0.0206938 -0.579892 0.432185 -0.0220365 -0.561427 0.432684 -0.0232764 -0.542654 0.433117 -0.0243731 -0.523671 0.433469 -0.0252891 -0.504583 0.433729 -0.0259953 -0.485503 0.433889 -0.0264742 -0.466543 0.433951 -0.0267222 -0.447821 0.433919 -0.0267488 -0.429453 0.433803 -0.0265733 -0.411552 0.433615 -0.0262202 -0.394228 0.433365 -0.0257146 -4.7159 0.422812 -0.000119306 -3.39578 0.422779 -0.000155169 -2.47614 0.422776 -0.000146138 -1.84945 0.422776 -0.000141806 -1.43373 0.422776 -0.000140685 -1.16696 0.422775 -0.00014192 -1.00259 0.422773 -0.000142502 -0.90618 0.422771 -0.000139195 -0.852696 0.422769 -0.000134125 -0.82443 0.422769 -0.000131064 -0.809381 0.42277 -0.000130151 -0.799993 0.422772 -0.000130303 -0.792187 0.422778 -0.000133547 -0.784661 0.423231 -0.00117104 -0.776936 0.423689 -0.00221508 -0.76885 0.42416 -0.0032887 -0.760266 0.424652 -0.00441187 -0.751069 0.425169 -0.0055928 -0.741164 0.425708 -0.00682873 -0.730484 0.426266 -0.00811369 -0.718982 0.426841 -0.00943983 -0.70663 0.427428 -0.0107995 -0.693423 0.428024 -0.0121864 -0.679373 0.428627 -0.0135958 -0.664509 0.429234 -0.0150245 -0.648875 0.429843 -0.0164676 -0.632526 0.430452 -0.0179166 -0.615528 0.431051 -0.0193564 -0.597958 0.431632 -0.0207635 -0.579896 0.432179 -0.022106 -0.561431 0.432679 -0.0233456 -0.542657 0.433112 -0.0244421 -0.523673 0.433464 -0.0253579 -0.504585 0.433724 -0.0260637 -0.485504 0.433884 -0.0265422 -0.466544 0.433946 -0.0267899 -0.447821 0.433914 -0.0268161 -0.429452 0.433798 -0.0266401 -0.411551 0.433609 -0.0262864 -0.394226 0.433359 -0.0257803 -4.7159 0.422841 -0.000220847 -3.3958 0.422777 -0.000304735 -2.47617 0.422772 -0.000289057 -1.84947 0.422771 -0.000281122 -1.43375 0.422772 -0.000279234 -1.16698 0.422771 -0.000281935 -1.0026 0.422768 -0.000283366 -0.906192 0.422763 -0.000277419 -0.852706 0.42276 -0.000268386 -0.824438 0.422761 -0.00026333 -0.809385 0.422763 -0.000262338 -0.799994 0.422767 -0.000263556 -0.792196 0.422779 -0.00027358 -0.784678 0.423224 -0.00130234 -0.776952 0.423681 -0.00234464 -0.768867 0.424152 -0.00341742 -0.760282 0.424644 -0.00454007 -0.751084 0.425159 -0.00572068 -0.741179 0.425698 -0.00695645 -0.730498 0.426257 -0.00824136 -0.718995 0.426832 -0.00956751 -0.706642 0.427419 -0.0109272 -0.693435 0.428015 -0.0123141 -0.679384 0.428617 -0.0137235 -0.66452 0.429225 -0.015152 -0.648885 0.429835 -0.0165949 -0.632535 0.430443 -0.0180436 -0.615537 0.431042 -0.019483 -0.597966 0.431623 -0.0208896 -0.579904 0.432171 -0.0222315 -0.561438 0.43267 -0.0234705 -0.542662 0.433103 -0.0245663 -0.523677 0.433455 -0.0254813 -0.504588 0.433715 -0.0261863 -0.485505 0.433875 -0.026664 -0.466544 0.433937 -0.0269107 -0.44782 0.433905 -0.0269359 -0.42945 0.433789 -0.0267589 -0.411548 0.4336 -0.026404 -0.394222 0.433349 -0.0258965 -4.7159 0.422892 -0.00038942 -3.39584 0.422774 -0.000572408 -2.47622 0.422765 -0.000546966 -1.84952 0.422763 -0.000533194 -1.43379 0.422764 -0.000530244 -1.16701 0.422764 -0.000535664 -1.00263 0.422758 -0.00053851 -0.906213 0.422749 -0.000528124 -0.852724 0.422745 -0.00051304 -0.824453 0.422745 -0.000505622 -0.809395 0.42275 -0.00050548 -0.799998 0.422757 -0.000509715 -0.792214 0.42278 -0.000535141 -0.784708 0.423213 -0.00154498 -0.776983 0.423667 -0.00258322 -0.768896 0.424137 -0.00365388 -0.76031 0.424627 -0.00477511 -0.751111 0.425143 -0.00595467 -0.741205 0.425681 -0.00718972 -0.730523 0.42624 -0.0084741 -0.719018 0.426815 -0.00979987 -0.706665 0.427402 -0.0111592 -0.693456 0.427998 -0.0125458 -0.679405 0.428601 -0.0139548 -0.664539 0.429209 -0.0153828 -0.648903 0.429819 -0.0168249 -0.632552 0.430427 -0.0182727 -0.615553 0.431027 -0.019711 -0.597981 0.431607 -0.0211163 -0.579917 0.432155 -0.0224567 -0.561449 0.432654 -0.0236941 -0.542672 0.433087 -0.0247881 -0.523684 0.43344 -0.0257013 -0.504593 0.433699 -0.0264045 -0.485508 0.43386 -0.0268802 -0.466544 0.433922 -0.0271249 -0.447818 0.433889 -0.027148 -0.429447 0.433773 -0.0269686 -0.411543 0.433583 -0.0266112 -0.394216 0.433332 -0.0261008 -4.7159 0.42298 -0.000668274 -3.39591 0.422769 -0.00104726 -2.4763 0.422752 -0.00100821 -1.84959 0.422748 -0.000985155 -1.43386 0.422751 -0.00098084 -1.16706 0.422752 -0.000991136 -1.00268 0.422741 -0.000996174 -0.906252 0.422725 -0.000978504 -0.852757 0.422716 -0.000954769 -0.824482 0.422718 -0.000945458 -0.809416 0.422726 -0.000948662 -0.800008 0.422739 -0.000960273 -0.792248 0.42278 -0.00101632 -0.784763 0.423193 -0.0019893 -0.777038 0.423642 -0.00301859 -0.768949 0.424109 -0.00408442 -0.760362 0.424599 -0.0052022 -0.75116 0.425114 -0.00637906 -0.741251 0.425652 -0.00761198 -0.730567 0.42621 -0.00889467 -0.71906 0.426785 -0.010219 -0.706704 0.427373 -0.0115771 -0.693494 0.42797 -0.0129625 -0.67944 0.428573 -0.0143701 -0.664573 0.429181 -0.0157964 -0.648935 0.429791 -0.0172366 -0.632583 0.4304 -0.0186821 -0.615582 0.430999 -0.0201177 -0.598007 0.43158 -0.0215199 -0.57994 0.432128 -0.022857 -0.561469 0.432627 -0.0240908 -0.542689 0.433061 -0.025181 -0.523697 0.433413 -0.0260903 -0.504602 0.433673 -0.0267895 -0.485512 0.433834 -0.0272611 -0.466545 0.433895 -0.0275016 -0.447815 0.433863 -0.0275201 -0.42944 0.433746 -0.0273358 -0.411533 0.433556 -0.026973 -0.394204 0.433304 -0.0264567 -4.7159 0.423127 -0.00112819 -3.39602 0.42276 -0.00187989 -2.47645 0.422729 -0.00182345 -1.84973 0.422722 -0.00178597 -1.43398 0.422728 -0.00178011 -1.16717 0.42273 -0.00179889 -1.00276 0.422712 -0.00180719 -0.906323 0.422683 -0.00177823 -0.852821 0.422667 -0.00174355 -0.824541 0.42267 -0.00173519 -0.809461 0.422685 -0.00174755 -0.800035 0.422709 -0.00177557 -0.792312 0.422776 -0.00188404 -0.784861 0.423158 -0.00279398 -0.777135 0.423599 -0.00380449 -0.769043 0.424062 -0.0048599 -0.760452 0.424549 -0.00597002 -0.751246 0.425063 -0.00714058 -0.741334 0.4256 -0.0083683 -0.730645 0.426158 -0.0096466 -0.719134 0.426734 -0.0109671 -0.706774 0.427322 -0.0123218 -0.693559 0.42792 -0.0137037 -0.679502 0.428524 -0.0151077 -0.664631 0.429133 -0.01653 -0.648991 0.429744 -0.0179657 -0.632635 0.430353 -0.0194059 -0.615631 0.430953 -0.0208356 -0.598052 0.431534 -0.0222311 -0.579981 0.432082 -0.023561 -0.561504 0.432581 -0.0247871 -0.542717 0.433015 -0.0258694 -0.523718 0.433368 -0.0267706 -0.504615 0.433628 -0.0274615 -0.485519 0.433789 -0.0279247 -0.466544 0.433851 -0.0281564 -0.447808 0.433819 -0.0281659 -0.429427 0.433702 -0.0279718 -0.411516 0.433511 -0.0275983 -0.394182 0.433258 -0.0270703 -4.7159 0.423376 -0.001885 -3.39622 0.422746 -0.0033196 -2.4767 0.422691 -0.00324418 -1.84997 0.422679 -0.00318494 -1.43418 0.422689 -0.0031778 -1.16734 0.422694 -0.00321086 -1.00292 0.422662 -0.00322403 -0.906459 0.422613 -0.00317925 -0.852949 0.422584 -0.00313397 -0.824666 0.422588 -0.00313494 -0.809566 0.422614 -0.00316866 -0.800111 0.422656 -0.00322997 -0.792436 0.422754 -0.00341233 -0.785032 0.423099 -0.00423134 -0.777306 0.423524 -0.00520488 -0.769208 0.42398 -0.00623893 -0.760609 0.424463 -0.00733302 -0.751396 0.424974 -0.00849009 -0.741475 0.425511 -0.00970624 -0.730779 0.426069 -0.0109744 -0.71926 0.426645 -0.0122859 -0.706892 0.427235 -0.0136322 -0.693671 0.427834 -0.0150059 -0.679607 0.42844 -0.0164015 -0.664731 0.429051 -0.0178148 -0.649084 0.429663 -0.0192405 -0.632723 0.430273 -0.0206695 -0.615712 0.430874 -0.0220866 -0.598127 0.431456 -0.0234685 -0.580047 0.432004 -0.0247835 -0.561561 0.432504 -0.0259942 -0.542762 0.432939 -0.0270605 -0.523752 0.433292 -0.0279454 -0.504636 0.433553 -0.0286199 -0.485527 0.433715 -0.0290664 -0.46654 0.433777 -0.0292811 -0.447793 0.433745 -0.0292727 -0.429402 0.433628 -0.0290597 -0.411482 0.433436 -0.0286656 -0.394141 0.433181 -0.028115 -4.7159 0.42379 -0.00312829 -3.39656 0.422725 -0.00576916 -2.47714 0.422627 -0.00568045 -1.85038 0.422606 -0.00558952 -1.43454 0.422625 -0.00558233 -1.16766 0.422634 -0.00563876 -1.0032 0.422581 -0.00565959 -0.906722 0.422495 -0.00559646 -0.853215 0.422444 -0.005549 -0.824939 0.422449 -0.00557873 -0.809809 0.422494 -0.00565669 -0.80031 0.422562 -0.00577739 -0.79268 0.422691 -0.00604064 -0.785326 0.422996 -0.00675413 -0.777601 0.423397 -0.00766206 -0.76949 0.423841 -0.00865494 -0.760876 0.424318 -0.00971739 -0.751648 0.424825 -0.0108473 -0.741713 0.42536 -0.0120395 -0.731002 0.425918 -0.0132862 -0.719469 0.426496 -0.0145781 -0.707088 0.427088 -0.0159059 -0.693854 0.42769 -0.0172616 -0.679779 0.428299 -0.0186391 -0.664892 0.428913 -0.0200332 -0.649236 0.429528 -0.021438 -0.632865 0.43014 -0.0228441 -0.615843 0.430743 -0.0242361 -0.598245 0.431325 -0.0255907 -0.580151 0.431876 -0.0268767 -0.561647 0.432377 -0.028057 -0.54283 0.432812 -0.0290923 -0.523799 0.433168 -0.0299458 -0.504663 0.43343 -0.0305887 -0.485532 0.433594 -0.0310033 -0.466525 0.433658 -0.0311855 -0.447759 0.433626 -0.0311433 -0.429351 0.433508 -0.0308945 -0.411417 0.433315 -0.0304619 -0.394063 0.433057 -0.029869 -4.7159 0.424479 -0.00516833 -3.39713 0.422701 -0.00986213 -2.47788 0.422526 -0.00978332 -1.85108 0.422489 -0.00964824 -1.43517 0.422522 -0.0096442 -1.16823 0.422539 -0.00973767 -1.00373 0.422451 -0.00977205 -0.907249 0.422305 -0.0096967 -0.853779 0.422217 -0.00967365 -0.825535 0.422223 -0.00977014 -0.810362 0.422292 -0.00992839 -0.800794 0.422393 -0.0101355 -0.793169 0.422543 -0.0104652 -0.785837 0.422817 -0.011082 -0.778105 0.423187 -0.0118927 -0.769967 0.423611 -0.0128137 -0.761323 0.424077 -0.0138181 -0.752065 0.424577 -0.0148969 -0.742101 0.42511 -0.0160428 -0.731363 0.425669 -0.0172468 -0.719804 0.426249 -0.0184987 -0.707399 0.426845 -0.0197886 -0.694143 0.427453 -0.0211073 -0.680048 0.428067 -0.0224474 -0.665143 0.428686 -0.0238026 -0.649469 0.429306 -0.025166 -0.633079 0.429923 -0.0265273 -0.616039 0.430529 -0.0278707 -0.598419 0.431114 -0.0291733 -0.5803 0.431667 -0.0304043 -0.561769 0.432171 -0.0315277 -0.54292 0.43261 -0.0325047 -0.523855 0.432968 -0.0332995 -0.504683 0.433234 -0.0338834 -0.485518 0.433401 -0.0342388 -0.466477 0.433467 -0.0343606 -0.44768 0.433436 -0.0342561 -0.429244 0.433318 -0.0339415 -0.411285 0.433123 -0.0334383 -0.393909 0.432862 -0.0327688 -4.7159 0.425621 -0.00851293 -3.39806 0.422687 -0.0165658 -2.47911 0.422377 -0.016557 -1.85227 0.422312 -0.0163637 -1.43627 0.422368 -0.0163695 -1.16925 0.422397 -0.0165199 -1.00474 0.422251 -0.0165816 -0.908323 0.422009 -0.0165223 -0.854976 0.421861 -0.0165829 -0.826809 0.421865 -0.0168072 -0.811564 0.421958 -0.0170866 -0.801868 0.422084 -0.01739 -0.794151 0.422245 -0.0177628 -0.786758 0.4225 -0.0183062 -0.778972 0.422839 -0.0190051 -0.770772 0.423239 -0.0198203 -0.762062 0.423688 -0.0207294 -0.752741 0.42418 -0.0217202 -0.742719 0.424709 -0.0227831 -0.731927 0.425269 -0.0239081 -0.720319 0.425853 -0.0250843 -0.70787 0.426457 -0.0263008 -0.694573 0.427073 -0.0275472 -0.680442 0.427697 -0.0288146 -0.665502 0.428325 -0.0300947 -0.649795 0.428954 -0.0313791 -0.633374 0.429578 -0.0326561 -0.6163 0.43019 -0.0339097 -0.598643 0.430782 -0.0351167 -0.580482 0.431339 -0.0362477 -0.561905 0.431849 -0.0372675 -0.543005 0.432293 -0.0381391 -0.523885 0.432656 -0.0388276 -0.504657 0.432928 -0.039305 -0.485435 0.4331 -0.0395531 -0.466339 0.43317 -0.0395662 -0.447491 0.433142 -0.0393494 -0.429009 0.433025 -0.038917 -0.411008 0.432828 -0.0382881 -0.393594 0.432563 -0.0374832 -4.7159 0.427509 -0.0139932 -3.39956 0.42273 -0.0273097 -2.48115 0.422182 -0.027502 -1.85429 0.42207 -0.0272376 -1.43818 0.422159 -0.0272651 -1.17114 0.422204 -0.0275008 -1.00671 0.421964 -0.0276208 -0.910514 0.421574 -0.0276492 -0.857454 0.421334 -0.027896 -0.829398 0.421318 -0.0283206 -0.813998 0.421418 -0.0287456 -0.804047 0.421552 -0.0291346 -0.796081 0.421713 -0.0295345 -0.788474 0.421956 -0.0300275 -0.780512 0.422274 -0.0306254 -0.772153 0.422653 -0.0313171 -0.763297 0.423086 -0.0320952 -0.75384 0.423569 -0.0329526 -0.743694 0.424094 -0.0338817 -0.732792 0.424656 -0.0348731 -0.721085 0.425248 -0.0359166 -0.708546 0.425862 -0.037001 -0.69517 0.426492 -0.0381151 -0.680967 0.427131 -0.0392485 -0.665962 0.427774 -0.0403909 -0.650194 0.428417 -0.0415315 -0.633713 0.429054 -0.0426573 -0.616578 0.429678 -0.0437511 -0.598857 0.43028 -0.0447901 -0.580626 0.430847 -0.0457458 -0.561973 0.431365 -0.0465851 -0.542991 0.431818 -0.0472727 -0.523784 0.432191 -0.0477756 -0.504466 0.432472 -0.0480662 -0.485155 0.432652 -0.0481264 -0.465972 0.432729 -0.0479483 -0.447041 0.432706 -0.0475348 -0.428481 0.43259 -0.0468968 -0.410408 0.432392 -0.04605 -0.392928 0.432122 -0.045012 -4.7159 0.430626 -0.0229693 -3.40192 0.422962 -0.0441367 -2.48446 0.421992 -0.0447864 -1.85768 0.421803 -0.0444442 -1.44153 0.421934 -0.0445126 -1.1746 0.421994 -0.0448722 -1.01052 0.421609 -0.0451145 -0.914875 0.421003 -0.045363 -0.862312 0.420624 -0.0459254 -0.834304 0.420545 -0.0466031 -0.818556 0.420614 -0.0471751 -0.808136 0.420729 -0.0476387 -0.7997 0.420877 -0.048063 -0.791656 0.42111 -0.0485252 -0.783303 0.421417 -0.0490441 -0.774589 0.421785 -0.0496178 -0.765411 0.42221 -0.0502477 -0.755663 0.422688 -0.0509341 -0.745254 0.423215 -0.0516751 -0.734116 0.423783 -0.0524658 -0.722199 0.424387 -0.0532991 -0.709475 0.425018 -0.0541663 -0.695934 0.425667 -0.055057 -0.681582 0.426328 -0.0559606 -0.666443 0.426994 -0.0568656 -0.650552 0.427659 -0.0577593 -0.633954 0.428317 -0.058627 -0.616704 0.42896 -0.0594505 -0.598867 0.429578 -0.0602072 -0.580516 0.430161 -0.0608698 -0.561736 0.430693 -0.0614072 -0.542622 0.43116 -0.0617869 -0.523278 0.431546 -0.0619775 -0.503818 0.431839 -0.0619527 -0.484365 0.43203 -0.0616935 -0.465042 0.432117 -0.0611901 -0.445975 0.4321 -0.0604416 -0.427285 0.431987 -0.0594546 -0.409087 0.431788 -0.0582404 -0.391488 0.431513 -0.0568124 -4.7159 0.43577 -0.0376676 -3.40557 0.423698 -0.0698762 -2.48979 0.421988 -0.0714419 -1.86333 0.421672 -0.0710294 -1.44737 0.421852 -0.0711659 -1.18094 0.421912 -0.0716986 -1.01774 0.421314 -0.0721716 -0.923118 0.420422 -0.0728136 -0.871137 0.419839 -0.0737893 -0.842901 0.419633 -0.0747329 -0.826467 0.419621 -0.0754516 -0.815264 0.419687 -0.0759958 -0.806062 0.419805 -0.0764563 -0.797282 0.420022 -0.0769086 -0.78823 0.42032 -0.0773715 -0.778857 0.420685 -0.077843 -0.769062 0.421111 -0.0783253 -0.75874 0.421595 -0.0788212 -0.747803 0.422131 -0.0793323 -0.736184 0.422714 -0.0798584 -0.723832 0.423337 -0.0803975 -0.710717 0.42399 -0.0809453 -0.696826 0.424665 -0.0814956 -0.68216 0.425355 -0.08204 -0.666738 0.42605 -0.0825679 -0.650588 0.426743 -0.083067 -0.633749 0.427428 -0.0835218 -0.616272 0.428096 -0.083914 -0.598214 0.428737 -0.0842213 -0.579644 0.42934 -0.0844177 -0.560645 0.429891 -0.0844743 -0.541307 0.430375 -0.084361 -0.521736 0.430777 -0.0840484 -0.502047 0.431085 -0.0835112 -0.482362 0.431289 -0.0827296 -0.462808 0.431385 -0.0816914 -0.443512 0.431374 -0.0803913 -0.424595 0.431263 -0.0788309 -0.406174 0.431061 -0.0770161 -0.388353 0.430779 -0.0749558 -4.7159 0.444252 -0.0617318 -3.41109 0.425653 -0.108372 -2.49828 0.422661 -0.111606 -1.8727 0.42214 -0.111156 -1.4575 0.422358 -0.111391 -1.1923 0.422382 -0.112149 -1.03076 0.421504 -0.112983 -0.937561 0.420276 -0.114139 -0.885854 0.419432 -0.115526 -0.856825 0.41904 -0.116712 -0.839201 0.418907 -0.11758 -0.826783 0.418895 -0.11822 -0.816412 0.418962 -0.118736 -0.8065 0.419152 -0.119201 -0.796342 0.419436 -0.11963 -0.785896 0.419797 -0.120017 -0.775063 0.420227 -0.12036 -0.763747 0.42072 -0.12066 -0.751868 0.421271 -0.120916 -0.739362 0.421872 -0.121132 -0.726186 0.422515 -0.121306 -0.712309 0.423191 -0.121438 -0.697719 0.423891 -0.121528 -0.682415 0.424606 -0.12157 -0.666408 0.425327 -0.121557 -0.649723 0.426046 -0.121481 -0.63239 0.426755 -0.121327 -0.61445 0.427446 -0.121078 -0.595954 0.428107 -0.120714 -0.576964 0.428727 -0.12021 -0.557555 0.429293 -0.11954 -0.537815 0.429789 -0.118675 -0.517844 0.430201 -0.117589 -0.497754 0.430516 -0.116256 -0.477667 0.430724 -0.114656 -0.457709 0.430822 -0.112773 -0.438006 0.43081 -0.1106 -0.418678 0.430692 -0.108131 -0.399841 0.43048 -0.105368 -0.381599 0.430185 -0.102315 -4.7159 0.458231 -0.101126 -3.41935 0.43033 -0.164897 -2.51166 0.425167 -0.170928 -1.8881 0.424311 -0.170507 -1.47473 0.424525 -0.170861 -1.2119 0.424455 -0.171872 -1.05279 0.423273 -0.173126 -0.960797 0.42172 -0.174737 -0.908466 0.420605 -0.1764 -0.877756 0.420008 -0.177748 -0.858219 0.419736 -0.178731 -0.84397 0.419634 -0.179455 -0.831866 0.419638 -0.180022 -0.820273 0.419794 -0.1805 -0.80846 0.42006 -0.180898 -0.796387 0.420413 -0.181202 -0.783959 0.420843 -0.181404 -0.771086 0.421341 -0.1815 -0.757694 0.421898 -0.181486 -0.74373 0.422507 -0.181358 -0.729157 0.423157 -0.181117 -0.713954 0.423839 -0.180761 -0.698111 0.424544 -0.180291 -0.681631 0.425262 -0.179704 -0.664523 0.425985 -0.178996 -0.646807 0.426704 -0.17816 -0.628508 0.427411 -0.177186 -0.60966 0.428097 -0.176059 -0.590304 0.428751 -0.174761 -0.570495 0.429361 -0.173271 -0.550296 0.429914 -0.171564 -0.529787 0.430394 -0.169614 -0.509061 0.430787 -0.167394 -0.488223 0.431081 -0.164882 -0.467389 0.431266 -0.162054 -0.446678 0.431338 -0.158896 -0.426212 0.431296 -0.155393 -0.40611 0.431147 -0.151538 -0.386484 0.430901 -0.147328 -0.367437 0.43057 -0.142761 -4.7159 0.481267 -0.165611 -3.43167 0.440792 -0.24708 -2.53274 0.432024 -0.257464 -1.91328 0.430611 -0.257198 -1.50343 0.430719 -0.257647 -1.2442 0.430489 -0.258837 -1.08752 0.429057 -0.260369 -0.995441 0.427272 -0.262149 -0.940928 0.425944 -0.263834 -0.907242 0.425172 -0.265174 -0.88474 0.424776 -0.266158 -0.86775 0.424589 -0.266881 -0.853079 0.424535 -0.267428 -0.839004 0.424663 -0.267853 -0.824749 0.424918 -0.268153 -0.810271 0.425267 -0.268308 -0.795475 0.425696 -0.268305 -0.780273 0.426191 -0.26813 -0.764595 0.426744 -0.267776 -0.748397 0.427341 -0.267232 -0.731647 0.427974 -0.266494 -0.714333 0.428631 -0.265556 -0.696452 0.429302 -0.264414 -0.678009 0.429979 -0.263065 -0.659019 0.430654 -0.261502 -0.639498 0.431318 -0.259717 -0.61947 0.431965 -0.2577 -0.598963 0.432585 -0.255438 -0.578012 0.433169 -0.252911 -0.556661 0.433704 -0.250101 -0.534965 0.434178 -0.246982 -0.512992 0.434577 -0.24353 -0.490825 0.434886 -0.23972 -0.468558 0.435093 -0.235528 -0.446296 0.43519 -0.230931 -0.424152 0.435171 -0.225911 -0.40224 0.435038 -0.220453 -0.380673 0.434797 -0.214545 -0.359562 0.434458 -0.208181 -0.339009 0.434036 -0.201357 -4.7159 0.519219 -0.271165 -3.45037 0.463215 -0.36693 -2.56653 0.448528 -0.383699 -1.95467 0.446116 -0.383818 -1.55055 0.445914 -0.384235 -1.29532 0.445451 -0.385327 -1.13938 0.443879 -0.386722 -1.04462 0.441997 -0.388221 -0.985576 0.440544 -0.389572 -0.94701 0.439647 -0.390634 -0.919951 0.439156 -0.391404 -0.898817 0.438901 -0.391937 -0.880279 0.438797 -0.392285 -0.862487 0.438912 -0.392475 -0.844585 0.439166 -0.392486 -0.826528 0.439518 -0.392293 -0.808214 0.439944 -0.391878 -0.789549 0.44043 -0.391223 -0.770466 0.44096 -0.390311 -0.750918 0.441521 -0.389128 -0.730882 0.442101 -0.387663 -0.710346 0.442688 -0.385903 -0.68931 0.443273 -0.38384 -0.667783 0.443848 -0.381462 -0.645778 0.444404 -0.378759 -0.623312 0.444937 -0.375716 -0.600404 0.44544 -0.372318 -0.577078 0.445905 -0.368546 -0.553361 0.446323 -0.364378 -0.529289 0.446685 -0.359788 -0.504909 0.446977 -0.354749 -0.480279 0.447187 -0.349233 -0.45547 0.447302 -0.343212 -0.430568 0.44731 -0.336658 -0.405669 0.447204 -0.329546 -0.380878 0.44698 -0.321855 -0.356305 0.44664 -0.313567 -0.332061 0.446191 -0.304667 -0.308257 0.445645 -0.295144 -0.285002 0.445019 -0.284991 -4.7159 0.581739 -0.443938 -3.47993 0.509978 -0.544801 -2.62257 0.485627 -0.57045 -2.02418 0.48122 -0.571451 -1.6278 0.480259 -0.571536 -1.3748 0.4794 -0.571953 -1.21554 0.477729 -0.572542 -1.11387 0.47582 -0.573175 -1.04676 0.474284 -0.573725 -1.00036 0.473277 -0.574108 -0.966184 0.472688 -0.5743 -0.938613 0.472354 -0.574302 -0.914085 0.472184 -0.574109 -0.890557 0.472272 -0.573705 -0.867066 0.472509 -0.573047 -0.843552 0.472837 -0.572108 -0.819894 0.473227 -0.570865 -0.795988 0.473657 -0.569295 -0.771756 0.47411 -0.567377 -0.747147 0.47457 -0.565091 -0.722129 0.475023 -0.562419 -0.696687 0.475457 -0.559343 -0.670815 0.475863 -0.555845 -0.644517 0.476235 -0.551908 -0.617796 0.476566 -0.54751 -0.590662 0.476852 -0.542628 -0.563125 0.477087 -0.537238 -0.535199 0.477267 -0.531308 -0.506902 0.477384 -0.524807 -0.47826 0.477428 -0.517698 -0.44931 0.477389 -0.509942 -0.420103 0.477255 -0.501503 -0.390702 0.477012 -0.492341 -0.361187 0.476652 -0.482419 -0.331651 0.476167 -0.471706 -0.302199 0.475554 -0.460171 -0.272944 0.474819 -0.447789 -0.244004 0.473969 -0.43454 -0.215503 0.473021 -0.420407 -0.187562 0.471994 -0.40538 -4.7159 0.684724 -0.726735 -3.5284 0.604388 -0.816915 -2.71888 0.565246 -0.853278 -2.14342 0.556455 -0.856332 -1.75551 0.553646 -0.855726 -1.49968 0.551876 -0.854654 -1.33024 0.549858 -0.853582 -1.21528 0.547772 -0.852606 -1.13454 0.546037 -0.851695 -1.07546 0.54481 -0.850784 -1.02986 0.544015 -0.849811 -0.991931 0.543495 -0.848706 -0.957765 0.54315 -0.847392 -0.925059 0.543106 -0.845789 -0.892696 0.543212 -0.843828 -0.860578 0.543394 -0.841486 -0.828548 0.543615 -0.838736 -0.79647 0.543848 -0.835552 -0.764238 0.544073 -0.831908 -0.731776 0.544272 -0.827778 -0.699031 0.54443 -0.823137 -0.665965 0.544536 -0.817959 -0.63255 0.544583 -0.812217 -0.598766 0.544565 -0.805881 -0.564597 0.544476 -0.798918 -0.53003 0.544315 -0.79129 -0.495055 0.544077 -0.782955 -0.459668 0.543758 -0.773866 -0.423871 0.543351 -0.763972 -0.387676 0.542848 -0.753217 -0.351111 0.542237 -0.741545 -0.314217 0.541507 -0.728896 -0.277057 0.540644 -0.715215 -0.239711 0.539638 -0.700446 -0.202276 0.538483 -0.684539 -0.164868 0.537178 -0.667447 -0.127613 0.535728 -0.649132 -0.0906499 0.534146 -0.629557 -0.0541265 0.532449 -0.608694 -0.0181967 0.530663 -0.586522 -4.7159 0.854355 -1.18962 -3.60558 0.782615 -1.25083 -2.881 0.727626 -1.2932 -2.34367 0.709996 -1.30012 -1.96438 0.702793 -1.29913 -1.69872 0.698691 -1.29611 -1.51016 0.695439 -1.29265 -1.373 0.69258 -1.28927 -1.27024 0.690205 -1.28606 -1.19063 0.688388 -1.283 -1.1263 0.687058 -1.28 -1.07122 0.686044 -1.27692 -1.02105 0.685228 -1.27361 -0.973182 0.684759 -1.26991 -0.926276 0.684439 -1.26573 -0.88015 0.684178 -1.26105 -0.834569 0.683929 -1.25584 -0.78932 0.683662 -1.25008 -0.744235 0.683351 -1.24372 -0.699176 0.682979 -1.23673 -0.654034 0.682528 -1.22908 -0.608717 0.681989 -1.22073 -0.563148 0.681352 -1.21163 -0.517259 0.680611 -1.20173 -0.470991 0.679762 -1.19098 -0.424292 0.6788 -1.17931 -0.377117 0.67772 -1.16666 -0.329435 0.676516 -1.15295 -0.281222 0.675179 -1.1381 -0.232476 0.673697 -1.12202 -0.183213 0.672056 -1.10462 -0.13347 0.67024 -1.08581 -0.0833133 0.668233 -1.0655 -0.0328308 0.666022 -1.04361 --0.017863 0.663598 -1.02004 --0.0686312 0.660957 -0.994724 --0.119317 0.658105 -0.967586 --0.169743 0.655055 -0.938561 --0.219721 0.651829 -0.90759 --0.269044 0.648456 -0.874625 -4.7159 1.13375 -1.94727 -3.70904 1.08671 -1.97206 -3.11145 1.03157 -2.0022 -2.63503 1.00459 -2.01038 -2.27173 0.990256 -2.00938 -1.99553 0.9815 -2.00478 -1.78277 0.97527 -1.99887 -1.61562 0.970363 -1.99262 -1.48138 0.966384 -1.98637 -1.37091 0.963185 -1.98021 -1.27725 0.960615 -1.97409 -1.19453 0.958464 -1.96788 -1.11828 0.956571 -1.96136 -1.04562 0.955074 -1.95433 -0.975022 0.953739 -1.94667 -0.906126 0.952461 -1.93838 -0.838546 0.951181 -1.92943 -0.771935 0.949862 -1.91976 -0.705997 0.948471 -1.90933 -0.640482 0.946984 -1.89808 -0.575174 0.945378 -1.88596 -0.509885 0.943637 -1.87289 -0.44445 0.941745 -1.8588 -0.378723 0.939689 -1.84361 -0.312575 0.937456 -1.82722 -0.245893 0.935034 -1.80953 -0.178582 0.932409 -1.79043 -0.110565 0.929564 -1.76979 -0.0417907 0.926481 -1.74747 --0.0277702 0.923137 -1.72334 --0.0981153 0.919509 -1.69725 --0.16921 0.91557 -1.66905 --0.240986 0.911296 -1.63859 --0.313339 0.906664 -1.60572 --0.38613 0.901656 -1.57031 --0.459185 0.896264 -1.5322 --0.532301 0.890488 -1.49126 --0.605245 0.88434 -1.44737 --0.677754 0.877845 -1.4004 --0.74954 0.871037 -1.35025 -4.7159 1.59394 -3.18741 -3.79863 1.57071 -3.18569 -3.30578 1.53607 -3.19054 -2.8904 1.51349 -3.1887 -2.55265 1.4986 -3.18235 -2.27823 1.48821 -3.17354 -2.05218 1.48041 -3.16353 -1.8625 1.47419 -3.15298 -1.70023 1.46904 -3.14221 -1.55868 1.46469 -3.13133 -1.43257 1.46095 -3.12034 -1.31733 1.45762 -3.10913 -1.20928 1.45455 -3.09751 -1.10585 1.4518 -3.08529 -1.00554 1.44917 -3.07238 -0.907703 1.44658 -3.05874 -0.811754 1.44396 -3.04433 -0.717154 1.44126 -3.02908 -0.623437 1.43844 -3.01291 -0.530198 1.43546 -2.99574 -0.437082 1.43229 -2.97747 -0.343773 1.42889 -2.95798 -0.24999 1.42523 -2.93714 -0.15548 1.42127 -2.91483 -0.0600184 1.41698 -2.89086 --0.0365945 1.41233 -2.86508 --0.134531 1.40727 -2.83727 --0.233937 1.40176 -2.80723 --0.334923 1.39577 -2.77473 --0.437567 1.38925 -2.73951 --0.541904 1.38214 -2.70133 --0.647923 1.37441 -2.65989 --0.755561 1.36599 -2.61491 --0.864701 1.35685 -2.56611 --0.975168 1.34696 -2.51317 --1.08673 1.33629 -2.45582 --1.19908 1.32483 -2.39376 --1.31188 1.31258 -2.32669 --1.42471 1.29957 -2.25437 --1.53708 1.28584 -2.17653 -4.7159 2.3519 -5.2173 -3.57911 2.35218 -5.19631 -2.73698 2.35246 -5.17533 -2.11993 2.35274 -5.15434 -1.67373 2.35302 -5.13336 -1.35616 2.3533 -5.11238 -1.13435 2.35358 -5.09139 -0.982686 2.35387 -5.07041 -0.881224 2.35415 -5.04942 -0.814433 2.35443 -5.02844 -0.770218 2.35471 -5.00746 -0.739158 2.35499 -4.98647 -0.713916 2.35527 -4.96549 -0.689262 2.35555 -4.94451 -0.66286 2.35583 -4.92352 -0.633116 2.35611 -4.90254 -0.598605 2.3564 -4.88155 -0.558056 2.35668 -4.86057 -0.510351 2.35696 -4.83958 -0.45452 2.35724 -4.8186 -0.389727 2.35752 -4.79762 -0.315275 2.35779 -4.77663 -0.23059 2.35774 -4.75565 -0.135231 2.35708 -4.73467 -0.0288776 2.35559 -4.71368 --0.0886683 2.35303 -4.69216 --0.217466 2.34918 -4.66876 --0.357438 2.34381 -4.64291 --0.508375 2.33669 -4.61399 --0.669937 2.32763 -4.58132 --0.841653 2.31648 -4.54414 --1.02293 2.30313 -4.50167 --1.21303 2.28751 -4.45308 --1.41113 2.26963 -4.39747 --1.61626 2.24954 -4.33398 --1.82735 2.22736 -4.2617 --2.04325 2.20326 -4.17976 --2.26267 2.17749 -4.08729 --2.48429 2.15031 -3.98349 --2.70668 2.12204 -3.86764 -0.810886 0.515598 -0.000990924 -0.80358 0.516158 -0.00198392 -0.795934 0.516733 -0.00300433 -0.787817 0.517333 -0.0040714 -0.779119 0.517962 -0.00519299 -0.769755 0.518619 -0.0063665 -0.759656 0.5193 -0.00758628 -0.74878 0.52 -0.0088449 -0.737099 0.520715 -0.0101351 -0.72461 0.521441 -0.011451 -0.711323 0.522175 -0.0127881 -0.697266 0.522914 -0.0141432 -0.68248 0.523657 -0.0155119 -0.667018 0.524398 -0.016886 -0.650944 0.525128 -0.0182512 -0.634326 0.525835 -0.0195853 -0.617242 0.526502 -0.0208579 -0.599773 0.52711 -0.022033 -0.582005 0.527638 -0.0230723 -0.564032 0.528067 -0.0239404 -0.545952 0.528383 -0.0246095 -0.527867 0.528578 -0.0250634 -0.509886 0.528653 -0.0252987 -0.492119 0.528614 -0.0253242 -0.474676 0.528473 -0.0251584 -0.457667 0.528243 -0.0248243 -0.441195 0.527938 -0.0243458 -4.7159 0.515044 -2.0753e-05 -3.40311 0.515037 -2.5645e-05 -2.48878 0.515037 -2.3806e-05 -1.86589 0.515037 -2.3016e-05 -1.45288 0.515037 -2.2803e-05 -1.18801 0.515037 -2.2971e-05 -1.02498 0.515037 -2.2972e-05 -0.929532 0.515037 -2.2267e-05 -0.876751 0.515036 -2.1282e-05 -0.849026 0.515037 -2.0675e-05 -0.834426 0.515037 -2.0445e-05 -0.825442 0.515037 -2.0362e-05 -0.818012 0.515038 -2.036e-05 -0.810889 0.515597 -0.00101099 -0.803582 0.516157 -0.00200393 -0.795936 0.516732 -0.00302433 -0.787819 0.517332 -0.00409142 -0.779122 0.517961 -0.00521307 -0.769757 0.518618 -0.00638666 -0.759658 0.519298 -0.00760653 -0.748781 0.519998 -0.00886526 -0.737101 0.520713 -0.0101556 -0.724612 0.521439 -0.0114716 -0.711325 0.522173 -0.0128087 -0.697268 0.522913 -0.0141639 -0.682482 0.523656 -0.0155326 -0.66702 0.524396 -0.0169068 -0.650945 0.525126 -0.0182721 -0.634327 0.525833 -0.0196062 -0.617243 0.526501 -0.0208789 -0.599774 0.527109 -0.022054 -0.582006 0.527636 -0.0230933 -0.564033 0.528065 -0.0239613 -0.545953 0.528381 -0.0246305 -0.527868 0.528577 -0.0250844 -0.509886 0.528652 -0.0253196 -0.492119 0.528613 -0.0253452 -0.474676 0.528471 -0.0251793 -0.457666 0.528241 -0.0248451 -0.441194 0.527937 -0.0243665 -4.7159 0.515055 -5.5391e-05 -3.40312 0.515036 -7.1538e-05 -2.48879 0.515035 -6.686e-05 -1.8659 0.515035 -6.4771e-05 -1.45289 0.515035 -6.4248e-05 -1.18801 0.515036 -6.4842e-05 -1.02499 0.515035 -6.5077e-05 -0.929536 0.515034 -6.3374e-05 -0.876754 0.515034 -6.083e-05 -0.849028 0.515034 -5.928e-05 -0.834427 0.515035 -5.8754e-05 -0.825442 0.515036 -5.8675e-05 -0.818015 0.515039 -5.9375e-05 -0.810894 0.515595 -0.00104874 -0.803587 0.516155 -0.00204144 -0.795941 0.516729 -0.00306175 -0.787824 0.517329 -0.00412883 -0.779126 0.517958 -0.00525051 -0.769761 0.518615 -0.00642418 -0.759662 0.519296 -0.00764415 -0.748785 0.519996 -0.008903 -0.737105 0.52071 -0.0101934 -0.724615 0.521436 -0.0115095 -0.711328 0.52217 -0.0128468 -0.697271 0.52291 -0.0142021 -0.682485 0.523653 -0.0155708 -0.667023 0.524393 -0.0169451 -0.650948 0.525123 -0.0183103 -0.63433 0.52583 -0.0196444 -0.617245 0.526498 -0.0209171 -0.599776 0.527106 -0.0220921 -0.582008 0.527633 -0.0231314 -0.564034 0.528062 -0.0239994 -0.545953 0.528378 -0.0246684 -0.527868 0.528574 -0.0251222 -0.509886 0.528649 -0.0253573 -0.492119 0.528609 -0.0253827 -0.474675 0.528468 -0.0252166 -0.457666 0.528238 -0.0248822 -0.441193 0.527933 -0.0244034 -4.7159 0.515075 -0.000113331 -3.40313 0.515035 -0.000154134 -2.48881 0.515033 -0.000145099 -1.86591 0.515033 -0.000140863 -1.4529 0.515033 -0.000139892 -1.18802 0.515034 -0.000141382 -1.025 0.515033 -0.000142211 -0.929542 0.51503 -0.000138974 -0.876759 0.515029 -0.000133971 -0.849033 0.515029 -0.00013105 -0.83443 0.515031 -0.000130262 -0.825443 0.515033 -0.000130498 -0.81802 0.515041 -0.000133777 -0.810903 0.515592 -0.00111952 -0.803596 0.516151 -0.00211151 -0.79595 0.516725 -0.0031315 -0.787832 0.517324 -0.00419841 -0.779134 0.517953 -0.00532003 -0.769769 0.51861 -0.00649371 -0.75967 0.51929 -0.00771376 -0.748792 0.51999 -0.0089727 -0.737112 0.520705 -0.0102632 -0.724622 0.521431 -0.0115794 -0.711334 0.522165 -0.0129168 -0.697277 0.522905 -0.014272 -0.68249 0.523648 -0.0156408 -0.667028 0.524388 -0.017015 -0.650953 0.525118 -0.0183801 -0.634335 0.525825 -0.0197141 -0.617249 0.526493 -0.0209865 -0.599779 0.5271 -0.0221613 -0.582011 0.527628 -0.0232003 -0.564037 0.528057 -0.024068 -0.545955 0.528373 -0.0247367 -0.527869 0.528568 -0.0251901 -0.509887 0.528643 -0.0254248 -0.492118 0.528604 -0.0254498 -0.474674 0.528462 -0.0252832 -0.457664 0.528232 -0.0249483 -0.441191 0.527927 -0.0244689 -4.7159 0.51511 -0.000209994 -3.40315 0.515033 -0.000302709 -2.48883 0.515028 -0.000287115 -1.86594 0.515028 -0.000279361 -1.45292 0.515029 -0.000277767 -1.18804 0.51503 -0.000281 -1.02501 0.515028 -0.000282987 -0.929554 0.515023 -0.000277274 -0.876769 0.515021 -0.00026846 -0.849041 0.515021 -0.000263735 -0.834435 0.515024 -0.00026302 -0.825444 0.515029 -0.000264428 -0.818029 0.515045 -0.000274597 -0.810919 0.515587 -0.00125154 -0.803613 0.516143 -0.00224175 -0.795966 0.516717 -0.00326084 -0.787848 0.517315 -0.00432718 -0.779149 0.517944 -0.00544842 -0.769783 0.5186 -0.00662188 -0.759684 0.519281 -0.00784182 -0.748806 0.519981 -0.00910072 -0.737124 0.520696 -0.0103912 -0.724634 0.521422 -0.0117074 -0.711345 0.522156 -0.0130446 -0.697287 0.522896 -0.0143998 -0.6825 0.523639 -0.0157683 -0.667038 0.524379 -0.0171421 -0.650962 0.525109 -0.0185068 -0.634343 0.525816 -0.0198402 -0.617257 0.526484 -0.021112 -0.599786 0.527091 -0.0222862 -0.582016 0.527619 -0.0233244 -0.564041 0.528048 -0.0241913 -0.545958 0.528363 -0.0248592 -0.527871 0.528559 -0.0253117 -0.509887 0.528634 -0.0255455 -0.492117 0.528594 -0.0255694 -0.474672 0.528452 -0.0254018 -0.457661 0.528222 -0.0250656 -0.441188 0.527916 -0.0245848 -4.7159 0.515172 -0.000370631 -3.4032 0.51503 -0.000568563 -2.48889 0.51502 -0.000543459 -1.86599 0.515019 -0.000530012 -1.45296 0.515022 -0.000527618 -1.18807 0.515024 -0.000534108 -1.02504 0.515019 -0.000538139 -0.929576 0.515011 -0.000528398 -0.876787 0.515006 -0.000513932 -0.849056 0.515006 -0.00050727 -0.834445 0.515012 -0.000507723 -0.825448 0.51502 -0.000512369 -0.818048 0.51505 -0.000538181 -0.81095 0.515577 -0.00149605 -0.803643 0.51613 -0.00248209 -0.795995 0.516702 -0.00349897 -0.787876 0.5173 -0.00456377 -0.779177 0.517927 -0.00568385 -0.76981 0.518583 -0.00685647 -0.759709 0.519264 -0.00807577 -0.748829 0.519964 -0.00933418 -0.737146 0.520679 -0.0106243 -0.724655 0.521405 -0.01194 -0.711365 0.52214 -0.0132767 -0.697306 0.52288 -0.0146312 -0.682518 0.523623 -0.0159989 -0.667055 0.524364 -0.0173717 -0.650978 0.525094 -0.0187353 -0.634358 0.525801 -0.0200672 -0.61727 0.526468 -0.0213375 -0.599797 0.527075 -0.0225099 -0.582026 0.527603 -0.0235464 -0.564048 0.528031 -0.0244114 -0.545963 0.528347 -0.0250774 -0.527873 0.528543 -0.0255279 -0.509887 0.528617 -0.0257595 -0.492115 0.528578 -0.0257812 -0.474669 0.528435 -0.0256111 -0.457656 0.528204 -0.0252723 -0.441181 0.527898 -0.0247886 -4.7159 0.515278 -0.000636598 -3.40327 0.515024 -0.00104012 -2.48897 0.515007 -0.00100203 -1.86607 0.515004 -0.000979544 -1.45303 0.515008 -0.000976255 -1.18813 0.515012 -0.000988642 -1.02509 0.515005 -0.000996112 -0.929616 0.514989 -0.00098004 -0.87682 0.514979 -0.00095787 -0.849086 0.51498 -0.000950222 -0.834467 0.51499 -0.000954667 -0.825459 0.515006 -0.000967145 -0.818083 0.515058 -0.00102393 -0.811006 0.515559 -0.00194478 -0.803698 0.516106 -0.00292164 -0.796049 0.516675 -0.00393348 -0.787928 0.517271 -0.00499463 -0.779226 0.517898 -0.00611178 -0.769857 0.518554 -0.00728203 -0.759753 0.519234 -0.0084994 -0.748871 0.519934 -0.00975616 -0.737186 0.52065 -0.0110448 -0.724692 0.521377 -0.012359 -0.711401 0.522111 -0.0136942 -0.69734 0.522852 -0.0150468 -0.68255 0.523595 -0.0164124 -0.667085 0.524336 -0.0177827 -0.651006 0.525066 -0.0191433 -0.634384 0.525773 -0.0204721 -0.617294 0.52644 -0.0217387 -0.599818 0.527048 -0.0229074 -0.582042 0.527575 -0.0239399 -0.564061 0.528004 -0.0248008 -0.545971 0.52832 -0.0254625 -0.527877 0.528515 -0.0259087 -0.509887 0.52859 -0.0261359 -0.492112 0.52855 -0.0261529 -0.474662 0.528407 -0.0259778 -0.457646 0.528175 -0.0256335 -0.441169 0.527868 -0.0251436 -4.7159 0.515458 -0.00107562 -3.40339 0.515015 -0.00186694 -2.48913 0.514983 -0.00181281 -1.86621 0.514977 -0.00177633 -1.45315 0.514986 -0.00177234 -1.18824 0.514993 -0.0017951 -1.02517 0.51498 -0.00180824 -0.929689 0.514952 -0.00178296 -0.876886 0.514933 -0.00175192 -0.849147 0.514935 -0.00174708 -0.834516 0.514952 -0.00176195 -0.825489 0.514981 -0.00179174 -0.81815 0.515065 -0.00190103 -0.811105 0.515529 -0.00275912 -0.803797 0.516065 -0.00371675 -0.796144 0.516628 -0.00471778 -0.788019 0.517222 -0.00577087 -0.779313 0.517847 -0.00688129 -0.769939 0.518501 -0.00804587 -0.759832 0.519182 -0.00925837 -0.748946 0.519882 -0.0105108 -0.737256 0.520598 -0.0117955 -0.724758 0.521326 -0.0131058 -0.711464 0.522062 -0.0144369 -0.697399 0.522804 -0.0157852 -0.682606 0.523548 -0.0171457 -0.667138 0.524289 -0.0185104 -0.651055 0.52502 -0.0198646 -0.634428 0.525727 -0.0211862 -0.617333 0.526394 -0.0224452 -0.599852 0.527001 -0.0236058 -0.58207 0.527529 -0.0246298 -0.564082 0.527957 -0.0254822 -0.545985 0.528273 -0.0261353 -0.527883 0.528469 -0.0265727 -0.509886 0.528543 -0.0267908 -0.492104 0.528503 -0.0267983 -0.474648 0.528359 -0.026613 -0.457628 0.528126 -0.0262577 -0.441146 0.527817 -0.0257558 -4.7159 0.515759 -0.00179863 -3.4036 0.515001 -0.00329666 -2.4894 0.514942 -0.00322646 -1.86646 0.514931 -0.00316891 -1.45337 0.514947 -0.00316511 -1.18842 0.514961 -0.00320561 -1.02533 0.514938 -0.00322814 -0.929828 0.514889 -0.00319133 -0.877019 0.514855 -0.00315403 -0.849278 0.514857 -0.00316215 -0.834627 0.514887 -0.00320078 -0.825571 0.514938 -0.00326542 -0.818279 0.515061 -0.00344746 -0.811278 0.515478 -0.00421651 -0.803971 0.515994 -0.00513644 -0.796311 0.516548 -0.00611538 -0.788178 0.517137 -0.00715169 -0.779464 0.517759 -0.00824779 -0.770083 0.518412 -0.00939993 -0.759967 0.519092 -0.0106014 -0.749073 0.519793 -0.0118439 -0.737376 0.520511 -0.0131192 -0.724871 0.52124 -0.0144204 -0.711569 0.521978 -0.0157422 -0.697499 0.522721 -0.0170805 -0.6827 0.523467 -0.0184301 -0.667226 0.524209 -0.0197826 -0.651137 0.52494 -0.0211233 -0.634503 0.525648 -0.0224303 -0.617399 0.526315 -0.0236736 -0.599908 0.526923 -0.0248177 -0.582115 0.527451 -0.0258248 -0.564114 0.52788 -0.02666 -0.546005 0.528196 -0.0272959 -0.527891 0.528392 -0.0277158 -0.509882 0.528466 -0.027916 -0.492088 0.528425 -0.027905 -0.474623 0.528281 -0.0277 -0.457593 0.528046 -0.0273235 -0.441104 0.527734 -0.0267984 -4.7159 0.516264 -0.00298726 -3.40396 0.514981 -0.00572969 -2.48987 0.514875 -0.00565209 -1.8669 0.514856 -0.00556402 -1.45375 0.514883 -0.00556271 -1.18875 0.514908 -0.00563266 -1.02562 0.51487 -0.00567112 -0.9301 0.514784 -0.00562446 -0.877295 0.514725 -0.00559356 -0.849564 0.514728 -0.00563718 -0.834885 0.514778 -0.00572425 -0.825785 0.514861 -0.00585031 -0.818535 0.51502 -0.00611014 -0.811578 0.515389 -0.00677831 -0.804272 0.515875 -0.00763209 -0.796598 0.516414 -0.00856867 -0.78845 0.516993 -0.00957201 -0.779721 0.51761 -0.0106395 -0.770324 0.518261 -0.0117661 -0.760193 0.51894 -0.0129444 -0.749285 0.519643 -0.0141654 -0.737574 0.520363 -0.0154205 -0.725056 0.521096 -0.0167019 -0.711743 0.521837 -0.0180037 -0.697662 0.522584 -0.0193209 -0.682853 0.523332 -0.0206478 -0.667368 0.524076 -0.0219754 -0.651268 0.524809 -0.0232891 -0.634621 0.525517 -0.0245669 -0.617503 0.526185 -0.0257793 -0.599994 0.526794 -0.0268912 -0.582182 0.527322 -0.0278655 -0.564161 0.527752 -0.0286675 -0.54603 0.528069 -0.02927 -0.527894 0.528266 -0.0296564 -0.509865 0.528341 -0.0298226 -0.492053 0.5283 -0.0297763 -0.47457 0.528154 -0.0295342 -0.457526 0.527916 -0.0291177 -0.441024 0.527601 -0.0285493 -4.7159 0.517103 -0.00493905 -3.40457 0.514961 -0.0097964 -2.49067 0.51477 -0.00974038 -1.86765 0.514736 -0.00961007 -1.45441 0.514783 -0.00961614 -1.18934 0.514827 -0.00973355 -1.02617 0.514763 -0.00980025 -0.930646 0.514616 -0.00975754 -0.877882 0.514514 -0.00976708 -0.850191 0.514517 -0.00988917 -0.835472 0.514595 -0.0100629 -0.826303 0.514716 -0.0102767 -0.819049 0.514899 -0.0105991 -0.812107 0.515232 -0.0111773 -0.804789 0.515679 -0.0119353 -0.797088 0.516193 -0.0127988 -0.788908 0.516757 -0.0137421 -0.780147 0.517366 -0.0147561 -0.77072 0.518012 -0.0158336 -0.760561 0.518691 -0.0169662 -0.749626 0.519397 -0.0181441 -0.737891 0.520121 -0.0193579 -0.72535 0.520859 -0.0205988 -0.712016 0.521607 -0.0218596 -0.697915 0.522359 -0.0231344 -0.683088 0.523112 -0.0244162 -0.667584 0.52386 -0.0256953 -0.651464 0.524596 -0.0269569 -0.634795 0.525307 -0.028179 -0.617651 0.525977 -0.0293328 -0.600113 0.526586 -0.0303841 -0.582269 0.527117 -0.0312966 -0.564214 0.527549 -0.0320365 -0.546047 0.527868 -0.0325767 -0.527877 0.528066 -0.0329007 -0.509813 0.528142 -0.0330036 -0.49197 0.528101 -0.0328921 -0.474459 0.527953 -0.0325816 -0.45739 0.527712 -0.0320922 -0.440866 0.527391 -0.0314449 -4.7159 0.518496 -0.00814127 -3.40556 0.514961 -0.0164602 -2.492 0.51462 -0.0164968 -1.86892 0.51456 -0.0163115 -1.45556 0.514637 -0.0163341 -1.19042 0.514711 -0.0165258 -1.02723 0.514603 -0.016645 -0.931764 0.514359 -0.0166477 -0.879133 0.514189 -0.0167688 -0.85153 0.514187 -0.0170372 -0.836743 0.514292 -0.0173401 -0.827442 0.514441 -0.0176502 -0.820087 0.514636 -0.0180138 -0.813071 0.514945 -0.0185253 -0.805692 0.515355 -0.0191763 -0.797922 0.515838 -0.0199346 -0.789673 0.516381 -0.0207807 -0.780846 0.516977 -0.0217034 -0.771358 0.517618 -0.0226937 -0.761142 0.518296 -0.0237424 -0.750156 0.519005 -0.0248391 -0.738374 0.519737 -0.0259735 -0.72579 0.520484 -0.0271358 -0.712417 0.521241 -0.0283175 -0.698281 0.522003 -0.0295106 -0.683419 0.522765 -0.0307067 -0.667881 0.523521 -0.031895 -0.651725 0.524262 -0.0330598 -0.635018 0.524977 -0.0341797 -0.617831 0.525651 -0.0352267 -0.600245 0.526265 -0.0361679 -0.582349 0.526798 -0.0369686 -0.564238 0.527234 -0.0375959 -0.546014 0.527556 -0.0380235 -0.527787 0.527758 -0.0382345 -0.509668 0.527836 -0.0382231 -0.491773 0.527795 -0.0379942 -0.474215 0.527645 -0.0375611 -0.457103 0.527399 -0.0369415 -0.440541 0.527071 -0.0361547 -4.7159 0.520803 -0.013392 -3.40716 0.515047 -0.0271466 -2.4942 0.514439 -0.0274274 -1.87109 0.514333 -0.0271761 -1.45759 0.514455 -0.027231 -1.19239 0.51457 -0.0275351 -1.02929 0.514391 -0.0277543 -0.934053 0.513996 -0.0278947 -0.88173 0.513722 -0.0282464 -0.854251 0.513693 -0.0287408 -0.83931 0.513803 -0.0291987 -0.829747 0.513957 -0.0295962 -0.822132 0.514149 -0.0299884 -0.814889 0.514444 -0.0304558 -0.807318 0.514828 -0.0310128 -0.799378 0.515285 -0.0316513 -0.790972 0.515808 -0.0323663 -0.782001 0.516389 -0.0331526 -0.772381 0.517023 -0.0340038 -0.762048 0.517701 -0.0349118 -0.750956 0.518416 -0.0358672 -0.73908 0.519158 -0.0368599 -0.726411 0.519919 -0.0378795 -0.712962 0.520691 -0.0389161 -0.698755 0.521468 -0.03996 -0.683827 0.522245 -0.0410008 -0.668226 0.523013 -0.0420261 -0.652005 0.523765 -0.0430194 -0.635229 0.52449 -0.0439595 -0.617969 0.52517 -0.0448197 -0.600304 0.52579 -0.0455688 -0.582324 0.52633 -0.0461742 -0.564124 0.526772 -0.0466048 -0.545809 0.5271 -0.046835 -0.52749 0.527306 -0.0468476 -0.509284 0.527388 -0.0466353 -0.491305 0.527348 -0.0462005 -0.473668 0.527195 -0.0455531 -0.456483 0.526943 -0.0447078 -0.439854 0.526605 -0.0436808 -4.7159 0.52462 -0.0219984 -3.40969 0.515396 -0.0438936 -2.49781 0.514309 -0.044713 -1.87475 0.514125 -0.0443923 -1.46117 0.514309 -0.0445037 -1.19606 0.514475 -0.044972 -1.0333 0.514179 -0.0453784 -0.938631 0.513563 -0.0458165 -0.886829 0.513132 -0.0465461 -0.859404 0.513027 -0.0473265 -0.844108 0.513094 -0.0479465 -0.834066 0.513223 -0.0484268 -0.825971 0.513397 -0.0488497 -0.818278 0.513678 -0.0492934 -0.8103 0.514048 -0.0497785 -0.801987 0.514491 -0.0503043 -0.793241 0.515001 -0.0508735 -0.78396 0.515574 -0.0514874 -0.774061 0.516206 -0.0521454 -0.763476 0.516888 -0.0528443 -0.752159 0.517612 -0.0535783 -0.740082 0.518369 -0.05434 -0.727236 0.519149 -0.0551206 -0.713625 0.519942 -0.0559104 -0.699273 0.520742 -0.0566987 -0.684211 0.521539 -0.0574739 -0.668481 0.522327 -0.0582219 -0.652136 0.523096 -0.0589258 -0.635235 0.523835 -0.0595644 -0.617847 0.524527 -0.0601122 -0.60005 0.525158 -0.0605405 -0.581931 0.525706 -0.0608191 -0.563588 0.526156 -0.0609189 -0.545128 0.526492 -0.0608156 -0.526665 0.526704 -0.0604913 -0.508315 0.526788 -0.0599369 -0.490198 0.526748 -0.0591512 -0.472429 0.526592 -0.0581401 -0.455118 0.526331 -0.0569139 -0.438367 0.525979 -0.0554851 -4.7159 0.530926 -0.0361014 -3.41363 0.516431 -0.0695204 -2.50366 0.514499 -0.0714075 -1.88091 0.514182 -0.071031 -1.46748 0.514438 -0.0712311 -1.20283 0.514652 -0.0719278 -1.04093 0.514176 -0.0726568 -0.947317 0.513268 -0.0735922 -0.896107 0.512613 -0.0748099 -0.86844 0.512358 -0.0758992 -0.852443 0.512328 -0.0766919 -0.841608 0.512395 -0.0772702 -0.832738 0.51253 -0.0777419 -0.824298 0.51279 -0.0781859 -0.815603 0.513147 -0.0786235 -0.80661 0.513584 -0.0790534 -0.79722 0.514093 -0.0794784 -0.787338 0.514669 -0.0799018 -0.776881 0.515308 -0.080326 -0.765784 0.516001 -0.080752 -0.754001 0.516741 -0.0811795 -0.741503 0.517517 -0.0816057 -0.728276 0.518319 -0.0820261 -0.714323 0.519137 -0.0824339 -0.69966 0.519962 -0.0828203 -0.684313 0.520785 -0.0831742 -0.668319 0.521596 -0.0834816 -0.651724 0.522385 -0.0837256 -0.634582 0.52314 -0.0838857 -0.616957 0.523846 -0.0839382 -0.598923 0.524487 -0.0838565 -0.580568 0.525045 -0.0836128 -0.561987 0.525501 -0.0831805 -0.543287 0.525841 -0.0825362 -0.524585 0.526055 -0.0816618 -0.505998 0.526139 -0.0805455 -0.487646 0.526093 -0.0791828 -0.469646 0.525926 -0.0775746 -0.452107 0.525649 -0.0757264 -0.435131 0.525277 -0.0736465 -4.7159 0.541344 -0.0592078 -3.41963 0.519103 -0.107835 -2.51305 0.515699 -0.11167 -1.89124 0.515158 -0.111281 -1.47852 0.51548 -0.111604 -1.21506 0.515716 -0.112592 -1.05481 0.515 -0.113792 -0.962606 0.513755 -0.115353 -0.91163 0.51282 -0.117057 -0.883128 0.512356 -0.11844 -0.865913 0.512185 -0.119417 -0.853846 0.512162 -0.120117 -0.843796 0.512237 -0.120663 -0.834208 0.512464 -0.121134 -0.824388 0.512804 -0.121549 -0.814295 0.513233 -0.121902 -0.803837 0.513742 -0.122194 -0.792924 0.514324 -0.122423 -0.781481 0.514972 -0.122591 -0.76945 0.515677 -0.122701 -0.756791 0.516431 -0.122753 -0.743477 0.517222 -0.12275 -0.729496 0.518039 -0.12269 -0.71485 0.518873 -0.122572 -0.699548 0.519713 -0.122391 -0.683613 0.52055 -0.122138 -0.667073 0.521372 -0.121803 -0.649968 0.52217 -0.12137 -0.632344 0.522931 -0.120821 -0.614259 0.523638 -0.120134 -0.595781 0.524277 -0.119286 -0.576991 0.524828 -0.11825 -0.557982 0.525275 -0.117003 -0.53886 0.525603 -0.115522 -0.519736 0.525801 -0.113789 -0.500729 0.525864 -0.111789 -0.481957 0.525794 -0.109515 -0.463535 0.525598 -0.106964 -0.445572 0.525286 -0.104136 -0.428168 0.524874 -0.101036 -4.7159 0.558543 -0.0970615 -3.42866 0.525407 -0.163986 -2.52801 0.519505 -0.171118 -1.9084 0.518586 -0.17081 -1.49751 0.518928 -0.171274 -1.23637 0.51913 -0.172572 -1.07847 0.518155 -0.174287 -0.987355 0.516603 -0.176386 -0.935635 0.515394 -0.178427 -0.905363 0.514713 -0.180019 -0.886182 0.514391 -0.181147 -0.872251 0.514266 -0.181956 -0.860441 0.514272 -0.182574 -0.849145 0.514463 -0.183075 -0.837637 0.514782 -0.18347 -0.825879 0.515202 -0.18375 -0.81378 0.515707 -0.183907 -0.801257 0.516287 -0.183936 -0.788242 0.516934 -0.183834 -0.774685 0.517636 -0.183599 -0.760555 0.518383 -0.183231 -0.745834 0.519163 -0.182731 -0.730514 0.519965 -0.182099 -0.714601 0.52078 -0.181335 -0.698105 0.521596 -0.180437 -0.681046 0.522404 -0.179398 -0.66345 0.523194 -0.178212 -0.645349 0.523955 -0.176867 -0.626781 0.524674 -0.175345 -0.607798 0.525335 -0.17363 -0.588458 0.525923 -0.171699 -0.568835 0.526419 -0.169531 -0.549015 0.526806 -0.167101 -0.529095 0.52707 -0.164391 -0.509181 0.527201 -0.16138 -0.489387 0.527193 -0.158055 -0.469826 0.527047 -0.154405 -0.450609 0.526771 -0.150424 -0.431841 0.526375 -0.146108 -0.413621 0.525876 -0.14146 -4.7159 0.586933 -0.159071 -3.44217 0.539359 -0.24524 -2.55178 0.529321 -0.257582 -1.93671 0.527748 -0.25753 -1.52943 0.52799 -0.258101 -1.27177 0.52808 -0.259599 -1.11606 0.526904 -0.261624 -1.02459 0.525157 -0.263918 -0.97046 0.523752 -0.266006 -0.937055 0.522896 -0.267619 -0.914805 0.522445 -0.268776 -0.898062 0.522229 -0.269607 -0.883624 0.522171 -0.270223 -0.869788 0.522336 -0.270682 -0.855773 0.522646 -0.270989 -0.841538 0.523061 -0.271125 -0.826994 0.523561 -0.271078 -0.812055 0.524133 -0.270836 -0.796659 0.524761 -0.270392 -0.780763 0.525435 -0.269737 -0.764343 0.52614 -0.268866 -0.747389 0.526865 -0.267776 -0.729901 0.527598 -0.266463 -0.711889 0.52833 -0.264924 -0.69337 0.529051 -0.263154 -0.674364 0.529752 -0.261147 -0.654895 0.530424 -0.258895 -0.634994 0.531056 -0.256385 -0.614695 0.531637 -0.253602 -0.59404 0.532153 -0.250529 -0.573083 0.532587 -0.247146 -0.551887 0.532922 -0.243432 -0.530528 0.533143 -0.239365 -0.509096 0.533235 -0.234926 -0.487685 0.533188 -0.230097 -0.466402 0.532998 -0.224862 -0.445351 0.532667 -0.219211 -0.424639 0.532201 -0.213135 -0.404367 0.531614 -0.206629 -0.384631 0.530921 -0.199691 -4.7159 0.633788 -0.260648 -3.46269 0.568905 -0.362721 -2.58995 0.552082 -0.382832 -1.98342 0.54931 -0.383379 -1.58203 0.549189 -0.38392 -1.32808 0.549046 -0.385275 -1.17266 0.547753 -0.387106 -1.07805 0.545941 -0.389077 -1.01904 0.544427 -0.390821 -0.980499 0.543443 -0.392164 -0.953506 0.542886 -0.393121 -0.932475 0.54259 -0.393778 -0.914046 0.542472 -0.394207 -0.896369 0.542623 -0.394436 -0.878576 0.54293 -0.394454 -0.860623 0.543342 -0.39424 -0.842411 0.543829 -0.393775 -0.823851 0.544372 -0.393043 -0.804879 0.544953 -0.392029 -0.785455 0.545555 -0.390719 -0.765559 0.546164 -0.389104 -0.745185 0.546766 -0.387172 -0.724338 0.54735 -0.384914 -0.703032 0.547907 -0.382321 -0.681287 0.548429 -0.379383 -0.659123 0.548907 -0.376087 -0.636567 0.549335 -0.37242 -0.613644 0.549704 -0.368364 -0.590387 0.550002 -0.3639 -0.566835 0.550218 -0.359007 -0.543032 0.550336 -0.353662 -0.519035 0.550341 -0.347841 -0.494914 0.550219 -0.341521 -0.470747 0.549956 -0.334679 -0.446624 0.549544 -0.327298 -0.422641 0.548981 -0.31936 -0.3989 0.548269 -0.310853 -0.375503 0.547416 -0.301766 -0.352552 0.546439 -0.292092 -0.330146 0.545353 -0.281828 -4.7159 0.711109 -0.427036 -3.49482 0.629525 -0.535028 -2.65279 0.601603 -0.566022 -2.0614 0.596395 -0.567935 -1.66795 0.59532 -0.568187 -1.41574 0.594659 -0.568778 -1.25632 0.593197 -0.569683 -1.1542 0.591326 -0.570698 -1.08661 0.5897 -0.571594 -1.03982 0.588567 -0.572244 -1.00539 0.587869 -0.572622 -0.977643 0.587451 -0.572752 -0.952968 0.587227 -0.572642 -0.929302 0.587324 -0.572271 -0.905655 0.587586 -0.571604 -0.881965 0.58794 -0.570623 -0.858118 0.588348 -0.569303 -0.834012 0.588783 -0.567624 -0.809574 0.589222 -0.565565 -0.784761 0.589645 -0.563108 -0.759548 0.590035 -0.560235 -0.733928 0.590379 -0.55693 -0.707905 0.590664 -0.553175 -0.681492 0.590883 -0.548953 -0.654705 0.591029 -0.544247 -0.627562 0.591097 -0.539035 -0.600085 0.59108 -0.533294 -0.572295 0.590972 -0.526998 -0.544219 0.590765 -0.52012 -0.51589 0.590446 -0.512628 -0.487347 0.590003 -0.504492 -0.458643 0.589421 -0.495679 -0.429839 0.588688 -0.48616 -0.40101 0.587791 -0.475907 -0.372244 0.586726 -0.464894 -0.343636 0.585492 -0.453099 -0.315288 0.584093 -0.440506 -0.287308 0.582543 -0.427099 -0.259805 0.58086 -0.412869 -0.232888 0.579066 -0.397809 -4.7159 0.838696 -0.699588 -3.54641 0.749448 -0.795695 -2.75845 0.70466 -0.839519 -2.19281 0.694094 -0.844539 -1.80831 0.690648 -0.844385 -1.55281 0.688706 -0.843485 -1.38248 0.686631 -0.842623 -1.2663 0.684405 -0.841917 -1.18436 0.682437 -0.841275 -1.12423 0.680952 -0.840583 -1.07778 0.679922 -0.839765 -1.03914 0.679198 -0.838761 -1.00432 0.678684 -0.8375 -0.970952 0.678551 -0.835879 -0.937891 0.678582 -0.833846 -0.905037 0.678681 -0.831384 -0.872239 0.678798 -0.828468 -0.839367 0.678899 -0.825072 -0.806327 0.678954 -0.82117 -0.773056 0.678942 -0.816738 -0.739514 0.678843 -0.811752 -0.70568 0.678643 -0.806186 -0.671545 0.678334 -0.800015 -0.637108 0.677906 -0.793214 -0.602373 0.677357 -0.785751 -0.567345 0.676682 -0.777596 -0.532032 0.675878 -0.768711 -0.496445 0.67494 -0.759059 -0.4606 0.67386 -0.748595 -0.424519 0.672629 -0.737276 -0.388234 0.671233 -0.725056 -0.351793 0.66966 -0.71189 -0.315254 0.667898 -0.697734 -0.278693 0.665936 -0.682547 -0.242199 0.663772 -0.66629 -0.205874 0.661407 -0.648931 -0.169832 0.658851 -0.630441 -0.134193 0.656122 -0.610795 -0.0990849 0.653243 -0.589973 -0.064641 0.650243 -0.567961 -4.7159 1.04922 -1.14604 -3.62606 0.971486 -1.20981 -2.92972 0.909413 -1.25951 -2.40664 0.888337 -1.26992 -2.03266 0.879364 -1.27024 -1.76785 0.87427 -1.26774 -1.57818 0.870351 -1.26456 -1.43914 0.866898 -1.2614 -1.3343 0.863926 -1.25837 -1.25268 0.86153 -1.25544 -1.18654 0.859665 -1.2525 -1.12978 0.858166 -1.24941 -1.07798 0.856909 -1.24604 -1.02846 0.856096 -1.24216 -0.979822 0.855444 -1.23772 -0.931903 0.85483 -1.2327 -0.88448 0.85419 -1.22709 -0.837361 0.853483 -1.22084 -0.790399 0.852673 -1.21393 -0.743485 0.851736 -1.20633 -0.696536 0.850651 -1.19799 -0.649493 0.849403 -1.18888 -0.602312 0.847982 -1.17897 -0.554956 0.846382 -1.16822 -0.507396 0.844598 -1.15657 -0.45961 0.842628 -1.14398 -0.411579 0.840467 -1.13038 -0.36329 0.838111 -1.11573 -0.31474 0.835549 -1.09995 -0.265936 0.832772 -1.08297 -0.216902 0.829765 -1.06473 -0.167678 0.826515 -1.04515 -0.118323 0.823006 -1.02417 -0.0689188 0.819231 -1.00172 -0.0195641 0.815184 -0.977746 --0.0296225 0.810869 -0.952179 --0.0785062 0.8063 -0.924972 --0.126938 0.801497 -0.896075 --0.174757 0.796493 -0.865444 --0.221789 0.791323 -0.833045 -4.7159 1.39658 -1.87737 -3.72914 1.34654 -1.90158 -3.16189 1.28566 -1.93466 -2.70418 1.25424 -1.94597 -2.35015 1.23679 -1.94691 -2.07757 1.22579 -1.94338 -1.86526 1.21785 -1.93804 -1.6968 1.2115 -1.93208 -1.5603 1.20621 -1.92597 -1.44717 1.20179 -1.91981 -1.3507 1.19809 -1.91358 -1.26514 1.19489 -1.90714 -1.18596 1.192 -1.9003 -1.11024 1.18962 -1.89276 -1.03642 1.1874 -1.88447 -0.964194 1.18521 -1.87542 -0.893218 1.18296 -1.86559 -0.82319 1.18061 -1.85494 -0.75386 1.17811 -1.84342 -0.685027 1.17542 -1.83099 -0.616526 1.17253 -1.81759 -0.548219 1.1694 -1.80317 -0.47999 1.16602 -1.78766 -0.411738 1.16238 -1.771 -0.343375 1.15847 -1.7531 -0.274826 1.15428 -1.73389 -0.206028 1.14979 -1.71327 -0.13693 1.14499 -1.69113 -0.0674989 1.13986 -1.66739 --0.00228021 1.13439 -1.64192 --0.0723986 1.12854 -1.61461 --0.142822 1.12231 -1.58534 --0.213489 1.11566 -1.55401 --0.284309 1.10859 -1.52049 --0.355162 1.10108 -1.48468 --0.425901 1.09313 -1.44647 --0.496352 1.08476 -1.40575 --0.566319 1.076 -1.36243 --0.635579 1.06687 -1.31641 --0.703889 1.05742 -1.26761 -4.7159 1.9697 -3.07536 -3.81493 1.94474 -3.07164 -3.34695 1.90662 -3.07523 -2.94876 1.88056 -3.07328 -2.62101 1.86259 -3.06707 -2.3517 1.84954 -3.05828 -2.12767 1.83944 -3.04808 -1.93805 1.83114 -3.03717 -1.77459 1.82405 -3.02589 -1.63109 1.81788 -3.01437 -1.50256 1.8124 -3.00261 -1.38457 1.8074 -2.99051 -1.27348 1.80269 -2.97788 -1.16677 1.79835 -2.96447 -1.06293 1.79413 -2.95022 -0.961421 1.78989 -2.93512 -0.861672 1.78556 -2.91913 -0.763205 1.78107 -2.90219 -0.665604 1.77636 -2.88423 -0.568517 1.7714 -2.86519 -0.471641 1.76612 -2.84497 -0.374713 1.7605 -2.82346 -0.277508 1.75449 -2.80056 -0.179829 1.74804 -2.77614 -0.0815045 1.74113 -2.75006 --0.017611 1.73372 -2.72216 --0.11764 1.72576 -2.69227 --0.218681 1.71722 -2.66022 --0.320802 1.70805 -2.62579 --0.424045 1.6982 -2.58879 --0.528414 1.68764 -2.549 --0.633875 1.67632 -2.50618 --0.740351 1.6642 -2.46011 --0.84772 1.65124 -2.41055 --0.955813 1.63743 -2.35725 --1.06441 1.62274 -2.29999 --1.17324 1.60719 -2.23852 --1.28198 1.5908 -2.17261 --1.39027 1.57361 -2.10208 --1.49767 1.55569 -2.0267 -4.7159 2.91532 -5.03779 -3.58278 2.91491 -5.014 -2.74375 2.91449 -4.9902 -2.12932 2.91408 -4.96641 -1.68541 2.91366 -4.94262 -1.36986 2.91325 -4.91882 -1.14988 2.91284 -4.89503 -0.999909 2.91242 -4.87124 -0.900035 2.91201 -4.84744 -0.834763 2.9116 -4.82365 -0.792021 2.91118 -4.79985 -0.762408 2.91077 -4.77606 -0.7386 2.91036 -4.75227 -0.715361 2.90994 -4.72848 -0.690273 2.90953 -4.70468 -0.661663 2.90911 -4.68089 -0.628037 2.9087 -4.65709 -0.58808 2.90829 -4.6333 -0.540644 2.90787 -4.60951 -0.48474 2.90746 -4.58571 -0.419536 2.90705 -4.56192 -0.344342 2.90662 -4.53813 -0.25861 2.9058 -4.51433 -0.161937 2.9042 -4.49054 -0.0540521 2.90157 -4.46674 --0.0651816 2.89761 -4.44246 --0.195754 2.89203 -4.41645 --0.337509 2.88455 -4.3882 --0.490154 2.87488 -4.35713 --0.653259 2.8628 -4.32262 --0.826262 2.84809 -4.28398 --1.00847 2.83064 -4.2405 --1.19908 2.81035 -4.19139 --1.39717 2.78723 -4.13586 --1.6017 2.76135 -4.0731 --1.81154 2.73286 -4.00229 --2.02549 2.70198 -3.92261 --2.24225 2.669 -3.83329 --2.46047 2.63426 -3.73359 --2.67875 2.59816 -3.62283 -0.834912 0.600159 -0.000943543 -0.827989 0.600811 -0.00188893 -0.820745 0.60148 -0.00286027 -0.813055 0.602178 -0.00387588 -0.804816 0.602911 -0.00494322 -0.795945 0.603675 -0.0060598 -0.786379 0.604467 -0.0072202 -0.776075 0.605282 -0.00841735 -0.765009 0.606114 -0.00964434 -0.753177 0.606959 -0.0108955 -0.740588 0.607813 -0.0121666 -0.727269 0.608674 -0.0134546 -0.71326 0.609538 -0.0147553 -0.698611 0.6104 -0.0160609 -0.68338 0.61125 -0.0173578 -0.667634 0.612073 -0.0186249 -0.651444 0.612849 -0.0198334 -0.634885 0.613557 -0.0209492 -0.618039 0.614171 -0.0219359 -0.600991 0.61467 -0.02276 -0.583831 0.615038 -0.0233953 -0.566658 0.615265 -0.0238262 -0.549571 0.615352 -0.0240496 -0.532678 0.615307 -0.024074 -0.516081 0.615142 -0.0239168 -0.499888 0.614874 -0.0235998 -0.484196 0.61452 -0.0231458 -4.7159 0.599509 -1.9591e-05 -3.40984 0.599502 -2.5474e-05 -2.50038 0.599502 -2.362e-05 -1.88097 0.599502 -2.2842e-05 -1.47042 0.599503 -2.2642e-05 -1.20729 0.599503 -2.2831e-05 -1.0455 0.599504 -2.2879e-05 -0.950921 0.599504 -2.2209e-05 -0.898781 0.599504 -2.1236e-05 -0.871551 0.599505 -2.0637e-05 -0.85736 0.599505 -2.0414e-05 -0.848742 0.599506 -2.0338e-05 -0.841663 0.599508 -2.0319e-05 -0.834914 0.600158 -0.000963586 -0.827991 0.60081 -0.00190891 -0.820747 0.601479 -0.00288025 -0.813057 0.602177 -0.00389588 -0.804819 0.602909 -0.00496327 -0.795947 0.603674 -0.00607992 -0.786381 0.604466 -0.00724041 -0.776077 0.605281 -0.00843766 -0.765011 0.606113 -0.00966474 -0.753178 0.606957 -0.010916 -0.74059 0.607811 -0.0121872 -0.727271 0.608672 -0.0134753 -0.713261 0.609537 -0.014776 -0.698612 0.610398 -0.0160816 -0.683381 0.611248 -0.0173786 -0.667635 0.612071 -0.0186458 -0.651445 0.612848 -0.0198543 -0.634887 0.613555 -0.0209701 -0.61804 0.614169 -0.0219569 -0.600991 0.614668 -0.0227809 -0.583832 0.615036 -0.0234162 -0.566658 0.615264 -0.0238471 -0.549571 0.615351 -0.0240704 -0.532677 0.615305 -0.0240948 -0.516081 0.61514 -0.0239376 -0.499887 0.614873 -0.0236206 -0.484195 0.614518 -0.0231665 -4.7159 0.599522 -5.229e-05 -3.40985 0.599501 -7.1026e-05 -2.50039 0.599501 -6.6324e-05 -1.88098 0.599501 -6.4267e-05 -1.47043 0.599502 -6.3775e-05 -1.2073 0.599502 -6.4424e-05 -1.0455 0.599503 -6.479e-05 -0.950925 0.599502 -6.3195e-05 -0.898784 0.599502 -6.0692e-05 -0.871553 0.599502 -5.9168e-05 -0.857361 0.599503 -5.8668e-05 -0.848743 0.599505 -5.8606e-05 -0.841666 0.59951 -5.9272e-05 -0.834919 0.600157 -0.0010013 -0.827996 0.600808 -0.00194638 -0.820752 0.601477 -0.00291762 -0.813062 0.602174 -0.00393323 -0.804823 0.602907 -0.00500065 -0.795952 0.603671 -0.00611737 -0.786385 0.604463 -0.00727795 -0.776081 0.605278 -0.00847531 -0.765015 0.60611 -0.00970251 -0.753182 0.606955 -0.0109539 -0.740593 0.607809 -0.0122252 -0.727274 0.60867 -0.0135133 -0.713264 0.609534 -0.0148141 -0.698615 0.610396 -0.0161198 -0.683384 0.611245 -0.0174167 -0.667638 0.612069 -0.0186839 -0.651447 0.612845 -0.0198924 -0.634889 0.613552 -0.0210082 -0.618042 0.614166 -0.0219948 -0.600993 0.614665 -0.0228188 -0.583833 0.615033 -0.023454 -0.566658 0.615261 -0.0238847 -0.549572 0.615348 -0.024108 -0.532677 0.615302 -0.0241322 -0.516081 0.615137 -0.0239748 -0.499886 0.614869 -0.0236575 -0.484194 0.614515 -0.0232032 -4.7159 0.599546 -0.000106955 -3.40986 0.5995 -0.000152911 -2.5004 0.599498 -0.000143854 -1.88099 0.599498 -0.000139688 -1.47044 0.599499 -0.000138778 -1.20731 0.5995 -0.000140388 -1.04551 0.5995 -0.000141514 -0.950932 0.599499 -0.000138534 -0.898789 0.599497 -0.000133641 -0.871557 0.599498 -0.000130794 -0.857364 0.5995 -0.000130071 -0.848743 0.599503 -0.000130351 -0.841671 0.599513 -0.000133584 -0.834928 0.600154 -0.00107203 -0.828005 0.600804 -0.00201639 -0.820761 0.601472 -0.00298729 -0.813071 0.60217 -0.00400272 -0.804831 0.602902 -0.00507005 -0.795959 0.603666 -0.00618677 -0.786393 0.604458 -0.0073474 -0.776088 0.605273 -0.00854484 -0.765022 0.606105 -0.00977214 -0.753188 0.60695 -0.0110236 -0.740599 0.607804 -0.0122949 -0.72728 0.608665 -0.0135831 -0.71327 0.609529 -0.0148838 -0.69862 0.610391 -0.0161894 -0.683389 0.611241 -0.0174863 -0.667643 0.612064 -0.0187533 -0.651452 0.61284 -0.0199616 -0.634892 0.613548 -0.0210771 -0.618045 0.614161 -0.0220635 -0.600995 0.61466 -0.0228872 -0.583834 0.615028 -0.023522 -0.566659 0.615255 -0.0239524 -0.549572 0.615343 -0.0241753 -0.532677 0.615297 -0.0241991 -0.516079 0.615132 -0.0240412 -0.499885 0.614864 -0.0237234 -0.484192 0.614509 -0.0232685 -4.7159 0.599587 -0.000198106 -3.40989 0.599498 -0.000299994 -2.50043 0.599493 -0.00028442 -1.88102 0.599493 -0.000276802 -1.47047 0.599495 -0.000275322 -1.20733 0.599497 -0.000278807 -1.04553 0.599496 -0.000281423 -0.950944 0.599492 -0.000276272 -0.898799 0.59949 -0.000267734 -0.871565 0.599491 -0.000263198 -0.857369 0.599494 -0.000262634 -0.848745 0.5995 -0.000264142 -0.841681 0.599519 -0.000274271 -0.834945 0.60015 -0.00120396 -0.828022 0.600798 -0.00214651 -0.820777 0.601465 -0.00311649 -0.813086 0.602162 -0.00413131 -0.804846 0.602893 -0.00519824 -0.795974 0.603657 -0.00631469 -0.786406 0.604449 -0.00747519 -0.776101 0.605264 -0.00867255 -0.765034 0.606096 -0.0098998 -0.7532 0.606941 -0.0111512 -0.74061 0.607795 -0.0124224 -0.72729 0.608657 -0.0137104 -0.71328 0.609521 -0.0150109 -0.69863 0.610383 -0.0163161 -0.683398 0.611232 -0.0176126 -0.667651 0.612055 -0.018879 -0.651459 0.612832 -0.0200867 -0.634899 0.613539 -0.0212015 -0.61805 0.614153 -0.0221871 -0.600999 0.614652 -0.02301 -0.583837 0.615019 -0.023644 -0.566661 0.615247 -0.0240735 -0.549572 0.615333 -0.0242954 -0.532676 0.615288 -0.0243182 -0.516077 0.615122 -0.0241592 -0.499881 0.614854 -0.0238402 -0.484188 0.614498 -0.0233839 -4.7159 0.599659 -0.000349536 -3.40993 0.599495 -0.000562786 -2.50048 0.599485 -0.000537828 -1.88106 0.599484 -0.000524636 -1.47051 0.599487 -0.000522451 -1.20736 0.599491 -0.000529465 -1.04555 0.599489 -0.000534786 -0.950966 0.599481 -0.000526226 -0.898817 0.599476 -0.000512404 -0.871581 0.599477 -0.000506187 -0.85738 0.599483 -0.000506973 -0.848749 0.599494 -0.000511835 -0.8417 0.59953 -0.000537624 -0.834975 0.600142 -0.00144831 -0.828052 0.600786 -0.00238667 -0.820806 0.601451 -0.00335438 -0.813114 0.602147 -0.00436761 -0.804874 0.602878 -0.00543332 -0.796 0.603641 -0.00654886 -0.786431 0.604433 -0.00770865 -0.776124 0.605248 -0.00890545 -0.765056 0.60608 -0.0101322 -0.753221 0.606926 -0.0113831 -0.74063 0.60778 -0.0126538 -0.727309 0.608642 -0.0139411 -0.713298 0.609506 -0.0152407 -0.698647 0.610368 -0.0165449 -0.683414 0.611218 -0.0178401 -0.667665 0.61204 -0.019105 -0.651472 0.612817 -0.0203112 -0.63491 0.613524 -0.0214242 -0.61806 0.614138 -0.0224081 -0.601006 0.614636 -0.023229 -0.583842 0.615004 -0.0238611 -0.566663 0.615231 -0.0242886 -0.549572 0.615318 -0.0245084 -0.532674 0.615272 -0.0245289 -0.516074 0.615106 -0.0243674 -0.499876 0.614837 -0.0240458 -0.484181 0.614481 -0.0235865 -4.7159 0.599783 -0.000600236 -3.41 0.599489 -0.00102822 -2.50058 0.599471 -0.000990582 -1.88115 0.599468 -0.000968565 -1.47058 0.599474 -0.00096566 -1.20742 0.599481 -0.000979126 -1.0456 0.599477 -0.00098917 -0.951006 0.599463 -0.000975495 -0.898852 0.599452 -0.000954752 -0.871611 0.599454 -0.000948097 -0.857403 0.599465 -0.000953245 -0.848761 0.599484 -0.00096617 -0.841736 0.599546 -0.00102285 -0.835031 0.600128 -0.00189681 -0.828107 0.600765 -0.0028259 -0.820859 0.601426 -0.0037885 -0.813166 0.602121 -0.00479798 -0.804923 0.60285 -0.00586063 -0.796047 0.603613 -0.00697368 -0.786475 0.604405 -0.00813141 -0.776166 0.60522 -0.00932645 -0.765096 0.606053 -0.0105516 -0.753259 0.606898 -0.0118009 -0.740665 0.607754 -0.0130699 -0.727343 0.608615 -0.0143552 -0.71333 0.60948 -0.0156526 -0.698677 0.610343 -0.0169543 -0.683442 0.611192 -0.0182464 -0.667691 0.612015 -0.0195081 -0.651495 0.612791 -0.0207106 -0.63493 0.613498 -0.0218198 -0.618076 0.614112 -0.0227995 -0.601019 0.61461 -0.0236164 -0.58385 0.614978 -0.0242441 -0.566667 0.615205 -0.0246673 -0.549572 0.615291 -0.0248826 -0.53267 0.615245 -0.0248984 -0.516066 0.615079 -0.0247319 -0.499866 0.614809 -0.0244047 -0.484169 0.614451 -0.0239394 -4.7159 0.599992 -0.00101411 -3.41013 0.59948 -0.00184318 -2.50074 0.599445 -0.00179016 -1.8813 0.59944 -0.00175451 -1.4707 0.599451 -0.00175122 -1.20753 0.599463 -0.00177616 -1.04569 0.599456 -0.00179431 -0.951081 0.59943 -0.00177375 -0.898918 0.599411 -0.00174573 -0.871674 0.599413 -0.001743 -0.857453 0.599432 -0.0017593 -0.848792 0.599467 -0.00178995 -0.841804 0.599567 -0.00189855 -0.83513 0.600105 -0.00271076 -0.828206 0.600728 -0.00362051 -0.820955 0.601384 -0.00457214 -0.813257 0.602075 -0.00557338 -0.805009 0.602803 -0.00662911 -0.796129 0.603564 -0.00773627 -0.786554 0.604356 -0.00888889 -0.77624 0.605171 -0.0100794 -0.765165 0.606005 -0.0113003 -0.753324 0.606852 -0.0125455 -0.740727 0.607708 -0.0138102 -0.727401 0.608571 -0.0150909 -0.713385 0.609436 -0.0163831 -0.698729 0.610299 -0.0176789 -0.683491 0.611149 -0.0189645 -0.667736 0.611972 -0.0202189 -0.651535 0.612748 -0.0214135 -0.634964 0.613454 -0.0225145 -0.618103 0.614068 -0.0234857 -0.601039 0.614566 -0.0242939 -0.583863 0.614934 -0.0249129 -0.566673 0.615161 -0.0253272 -0.549571 0.615247 -0.0255333 -0.532662 0.6152 -0.0255396 -0.516053 0.615033 -0.0253629 -0.499847 0.614762 -0.0250248 -0.484146 0.614402 -0.0245473 -4.7159 0.600343 -0.00169587 -3.41035 0.599466 -0.00325059 -2.50103 0.599403 -0.00318283 -1.88156 0.599393 -0.00312675 -1.47093 0.599412 -0.00312422 -1.20772 0.599433 -0.003169 -1.04585 0.599421 -0.00320101 -0.951222 0.599376 -0.00317323 -0.899053 0.599341 -0.00314206 -0.871809 0.599344 -0.00315444 -0.857569 0.599378 -0.00319583 -0.848878 0.599438 -0.00326201 -0.841937 0.599584 -0.00344155 -0.835303 0.600067 -0.00416733 -0.82838 0.600667 -0.00503932 -0.821121 0.601312 -0.00596864 -0.813416 0.601997 -0.00695281 -0.80516 0.602721 -0.00799388 -0.796272 0.603481 -0.00908821 -0.786688 0.604272 -0.0102294 -0.776367 0.605088 -0.0114095 -0.765285 0.605923 -0.0126206 -0.753436 0.606772 -0.0138562 -0.740833 0.60763 -0.0151112 -0.727501 0.608495 -0.0163816 -0.713479 0.609362 -0.0176624 -0.698816 0.610225 -0.0189457 -0.683572 0.611076 -0.0202174 -0.667809 0.611899 -0.0214568 -0.6516 0.612675 -0.0226354 -0.635019 0.613382 -0.0237197 -0.618147 0.613995 -0.0246738 -0.601071 0.614494 -0.0254645 -0.583883 0.614861 -0.0260661 -0.56668 0.615088 -0.0264627 -0.549566 0.615175 -0.0266509 -0.532646 0.615127 -0.0266385 -0.516027 0.614958 -0.0264421 -0.499812 0.614685 -0.0260826 -0.484103 0.614322 -0.025582 -4.7159 0.600931 -0.00281718 -3.41072 0.599447 -0.00564294 -2.50152 0.599335 -0.00557039 -1.88202 0.599317 -0.00548482 -1.47132 0.599348 -0.00548578 -1.20805 0.599386 -0.00556393 -1.04615 0.599366 -0.00561979 -0.951498 0.599288 -0.00558992 -0.899334 0.599226 -0.00557096 -0.872102 0.599229 -0.00562283 -0.857837 0.599287 -0.00571489 -0.849102 0.599385 -0.00584304 -0.842199 0.599572 -0.00609709 -0.835606 0.600002 -0.00672673 -0.828682 0.600566 -0.00753322 -0.821409 0.601193 -0.00841997 -0.813688 0.601866 -0.00937077 -0.805417 0.602584 -0.0103827 -0.796513 0.603341 -0.0114509 -0.786914 0.604132 -0.0125681 -0.776578 0.604949 -0.013726 -0.765482 0.605787 -0.0149161 -0.753621 0.606639 -0.0161311 -0.741006 0.607501 -0.0173652 -0.727663 0.608369 -0.0186138 -0.71363 0.609239 -0.0198712 -0.698958 0.610104 -0.0211289 -0.683701 0.610956 -0.022373 -0.667926 0.611779 -0.0235825 -0.651702 0.612556 -0.0247297 -0.635104 0.613263 -0.0257812 -0.618213 0.613876 -0.0267019 -0.601116 0.614375 -0.0274591 -0.583906 0.614743 -0.0280269 -0.566682 0.614971 -0.0283897 -0.549548 0.615057 -0.0285435 -0.532609 0.615009 -0.0284957 -0.515973 0.614838 -0.028262 -0.499744 0.614562 -0.0278626 -0.484021 0.614195 -0.0273186 -4.7159 0.601912 -0.00465932 -3.41135 0.599432 -0.00963777 -2.50235 0.59923 -0.00959175 -1.88279 0.599197 -0.00946559 -1.472 0.599251 -0.00947568 -1.20866 0.599315 -0.00960823 -1.04671 0.599282 -0.00970588 -0.952052 0.599148 -0.0096934 -0.899932 0.599043 -0.00972533 -0.872745 0.599047 -0.00986253 -0.858444 0.599138 -0.0100444 -0.84964 0.599279 -0.0102599 -0.842728 0.599495 -0.010573 -0.836142 0.599883 -0.0111186 -0.829203 0.600402 -0.011832 -0.821902 0.600999 -0.0126461 -0.814148 0.601655 -0.0135365 -0.805844 0.602363 -0.0144943 -0.796909 0.603114 -0.0155125 -0.787282 0.603904 -0.0165829 -0.776919 0.604723 -0.0176963 -0.765798 0.605565 -0.0188437 -0.753914 0.606423 -0.0200168 -0.741278 0.607291 -0.0212086 -0.727915 0.608164 -0.0224133 -0.713863 0.609039 -0.0236243 -0.699171 0.609909 -0.0248323 -0.683895 0.610763 -0.026023 -0.668097 0.611588 -0.0271758 -0.651847 0.612366 -0.0282633 -0.63522 0.613073 -0.0292532 -0.618298 0.613688 -0.0301113 -0.601167 0.614188 -0.0308055 -0.583921 0.614557 -0.0313104 -0.566662 0.614786 -0.0316102 -0.549494 0.614873 -0.0317003 -0.532524 0.614823 -0.0315869 -0.515859 0.614651 -0.0312845 -0.499604 0.614369 -0.030812 -0.483859 0.613996 -0.0301891 -4.7159 0.60354 -0.00768337 -3.41237 0.599448 -0.0161785 -2.50374 0.599086 -0.0162345 -1.88412 0.599027 -0.0160559 -1.47319 0.599115 -0.0160855 -1.20975 0.599222 -0.016304 -1.04778 0.599165 -0.0164763 -0.953187 0.598942 -0.0165316 -0.901206 0.598769 -0.016693 -0.874116 0.598769 -0.0169872 -0.859751 0.598892 -0.0173018 -0.850816 0.599066 -0.0176122 -0.843795 0.599294 -0.0179648 -0.837127 0.599656 -0.0184492 -0.830121 0.600133 -0.0190609 -0.822748 0.600695 -0.0197722 -0.814922 0.601326 -0.0205661 -0.80655 0.602018 -0.0214322 -0.797552 0.602762 -0.0223621 -0.787867 0.603549 -0.023347 -0.777451 0.604371 -0.0243773 -0.766283 0.60522 -0.0254432 -0.754355 0.606086 -0.0265354 -0.741679 0.606964 -0.0276457 -0.728279 0.607847 -0.0287663 -0.714193 0.608731 -0.0298893 -0.699466 0.609607 -0.0310042 -0.684153 0.610467 -0.0320962 -0.668315 0.611295 -0.0331448 -0.652022 0.612075 -0.0341238 -0.635347 0.612785 -0.035002 -0.618372 0.613402 -0.0357467 -0.601185 0.613904 -0.036327 -0.583883 0.614276 -0.036718 -0.566567 0.614506 -0.0369037 -0.549344 0.614594 -0.0368786 -0.532322 0.614544 -0.0366471 -0.51561 0.614367 -0.0362215 -0.499312 0.61408 -0.0356186 -0.483527 0.613697 -0.0348562 -4.7159 0.606241 -0.0126451 -3.41403 0.599581 -0.0266607 -2.50605 0.598933 -0.0269784 -1.88638 0.598828 -0.026738 -1.47529 0.598966 -0.0268045 -1.21178 0.599136 -0.0271542 -1.04988 0.599035 -0.0274608 -0.955514 0.598673 -0.0276895 -0.903851 0.598396 -0.0281095 -0.876896 0.598372 -0.0286449 -0.86238 0.598501 -0.0291191 -0.853181 0.598681 -0.0295171 -0.845896 0.598907 -0.0298993 -0.838994 0.599254 -0.0303444 -0.831789 0.599703 -0.0308683 -0.824239 0.600235 -0.0314648 -0.81625 0.600842 -0.0321304 -0.80773 0.601515 -0.0328611 -0.798597 0.602249 -0.0336514 -0.78879 0.603034 -0.0344941 -0.778266 0.603861 -0.0353808 -0.766999 0.604718 -0.0363019 -0.754984 0.605598 -0.0372479 -0.742228 0.60649 -0.0382094 -0.728756 0.607388 -0.0391772 -0.714601 0.608285 -0.0401411 -0.699808 0.609173 -0.0410895 -0.684428 0.610042 -0.0420066 -0.66852 0.610877 -0.0428724 -0.652152 0.611663 -0.0436617 -0.635397 0.612376 -0.0443452 -0.618336 0.612997 -0.0448922 -0.60106 0.613503 -0.0452736 -0.583667 0.613878 -0.0454652 -0.56626 0.614111 -0.0454507 -0.548948 0.614199 -0.0452231 -0.531841 0.614147 -0.0447843 -0.51505 0.613966 -0.0441434 -0.498678 0.61367 -0.0433141 -0.482824 0.613274 -0.0423113 -4.7159 0.610715 -0.020783 -3.41666 0.600054 -0.0430786 -2.50984 0.598893 -0.0439688 -1.89021 0.598708 -0.0436657 -1.479 0.598916 -0.0437954 -1.21554 0.599167 -0.0443372 -1.05397 0.598989 -0.0448804 -0.960172 0.598425 -0.0454594 -0.909045 0.597992 -0.0462977 -0.882152 0.597892 -0.0471402 -0.867283 0.597976 -0.0477858 -0.857604 0.598128 -0.0482717 -0.84984 0.598335 -0.0486887 -0.842485 0.598668 -0.0491153 -0.834866 0.599102 -0.0495735 -0.826936 0.599618 -0.0500633 -0.818599 0.60021 -0.0505878 -0.80976 0.600873 -0.0511492 -0.800339 0.601602 -0.0517476 -0.790272 0.602388 -0.0523807 -0.779515 0.603221 -0.0530438 -0.76804 0.604091 -0.0537307 -0.755839 0.604987 -0.0544335 -0.742916 0.605898 -0.0551433 -0.729291 0.606816 -0.0558502 -0.714995 0.607732 -0.0565433 -0.700068 0.608636 -0.0572093 -0.684558 0.609519 -0.0578322 -0.668521 0.610365 -0.0583919 -0.65202 0.611158 -0.0588646 -0.635128 0.611877 -0.0592235 -0.617927 0.612502 -0.0594401 -0.600506 0.613012 -0.0594874 -0.582965 0.613389 -0.0593422 -0.565412 0.613623 -0.058988 -0.547956 0.613711 -0.0584156 -0.53071 0.613654 -0.0576237 -0.513784 0.613464 -0.0566175 -0.497283 0.613154 -0.0554061 -0.481305 0.612738 -0.0540011 -4.7159 0.61812 -0.0341277 -3.42076 0.601402 -0.0681862 -2.51602 0.599333 -0.0702118 -1.89669 0.599009 -0.0698638 -1.48557 0.599303 -0.070091 -1.22252 0.599645 -0.0708981 -1.06177 0.599341 -0.0718285 -0.969028 0.598508 -0.0729748 -0.918501 0.597856 -0.0743535 -0.891368 0.597603 -0.0755355 -0.875798 0.597585 -0.076372 -0.865331 0.597672 -0.0769675 -0.856796 0.597838 -0.0774422 -0.848696 0.598149 -0.0778766 -0.84036 0.598571 -0.0782941 -0.831744 0.599081 -0.0786942 -0.822756 0.59967 -0.0790802 -0.813305 0.600335 -0.0794554 -0.803314 0.601068 -0.079823 -0.792721 0.601862 -0.0801848 -0.781482 0.602706 -0.0805411 -0.769571 0.60359 -0.0808905 -0.756973 0.604503 -0.0812296 -0.743692 0.605433 -0.0815529 -0.729741 0.606371 -0.0818524 -0.715146 0.607305 -0.0821183 -0.69994 0.608225 -0.0823377 -0.684167 0.60912 -0.0824947 -0.667876 0.609975 -0.0825705 -0.651127 0.610773 -0.0825427 -0.63399 0.611495 -0.0823865 -0.616543 0.612119 -0.0820762 -0.598876 0.612626 -0.0815868 -0.58109 0.612998 -0.0808964 -0.563292 0.613224 -0.0799878 -0.545594 0.613301 -0.0788499 -0.528109 0.613229 -0.0774776 -0.510947 0.613019 -0.0758716 -0.494214 0.612682 -0.0740365 -0.478005 0.612235 -0.0719795 -4.7159 0.630369 -0.0560071 -3.42704 0.60482 -0.105686 -2.52599 0.601173 -0.109797 -1.90762 0.600611 -0.109457 -1.49714 0.600987 -0.109817 -1.23519 0.601408 -0.110956 -1.07603 0.600928 -0.112429 -0.984669 0.599795 -0.11428 -0.934364 0.598876 -0.116206 -0.906385 0.598414 -0.117722 -0.889596 0.598252 -0.11877 -0.877902 0.598247 -0.119506 -0.868194 0.598352 -0.120068 -0.858954 0.598633 -0.12054 -0.849495 0.599038 -0.120944 -0.839778 0.599541 -0.121275 -0.829716 0.600131 -0.121534 -0.819225 0.600799 -0.121721 -0.808234 0.601538 -0.121837 -0.796689 0.602337 -0.121887 -0.784552 0.603187 -0.121871 -0.7718 0.604077 -0.121793 -0.758422 0.604993 -0.121652 -0.744418 0.605927 -0.121449 -0.729799 0.606865 -0.121179 -0.714586 0.607797 -0.120835 -0.698806 0.608713 -0.120408 -0.682495 0.6096 -0.119884 -0.665696 0.610442 -0.119247 -0.648462 0.611222 -0.118475 -0.630857 0.611922 -0.117548 -0.612955 0.61252 -0.116442 -0.594842 0.612996 -0.115133 -0.576616 0.613335 -0.113601 -0.558383 0.613525 -0.111829 -0.540252 0.61356 -0.109804 -0.522335 0.613442 -0.107517 -0.504741 0.61318 -0.104965 -0.487574 0.612786 -0.102148 -0.470928 0.612276 -0.0990698 -4.7159 0.650626 -0.091877 -3.43653 0.612806 -0.160527 -2.54199 0.606489 -0.168218 -1.92592 0.60552 -0.167998 -1.51719 0.605936 -0.168506 -1.25742 0.606388 -0.169986 -1.10049 0.605723 -0.172034 -1.01014 0.604332 -0.174492 -0.959032 0.603166 -0.176814 -0.929251 0.602495 -0.178586 -0.910483 0.602187 -0.179818 -0.896926 0.602082 -0.180687 -0.885464 0.60212 -0.181339 -0.874521 0.60237 -0.181852 -0.863375 0.60276 -0.182246 -0.851989 0.603256 -0.182512 -0.84028 0.603842 -0.182643 -0.828167 0.604506 -0.182636 -0.815585 0.605237 -0.182488 -0.802491 0.606023 -0.182199 -0.788855 0.606852 -0.18177 -0.774661 0.607712 -0.181202 -0.759905 0.608592 -0.180496 -0.744591 0.60948 -0.179652 -0.728732 0.610366 -0.178671 -0.712346 0.61124 -0.177547 -0.69546 0.612089 -0.176273 -0.678101 0.612902 -0.17484 -0.660309 0.613664 -0.173233 -0.642128 0.614358 -0.171435 -0.623616 0.614965 -0.169426 -0.604838 0.615465 -0.167187 -0.585875 0.615838 -0.164697 -0.566816 0.616068 -0.161935 -0.547761 0.616145 -0.158886 -0.528815 0.616062 -0.155534 -0.510085 0.615821 -0.15187 -0.491675 0.61543 -0.147888 -0.473686 0.614902 -0.143585 -0.456209 0.614253 -0.138961 -4.7159 0.684115 -0.15068 -3.4508 0.630356 -0.239544 -2.56759 0.619626 -0.253005 -1.95633 0.617945 -0.253127 -1.55114 0.61827 -0.253746 -1.29464 0.618666 -0.255428 -1.13968 0.617864 -0.257805 -1.04879 0.616333 -0.260495 -0.995153 0.615004 -0.262909 -0.962164 0.614176 -0.264745 -0.94029 0.613745 -0.266041 -0.923903 0.613554 -0.266959 -0.909803 0.613531 -0.267629 -0.896311 0.613763 -0.268116 -0.882644 0.614151 -0.268429 -0.868765 0.614646 -0.268558 -0.854586 0.615226 -0.26849 -0.840029 0.615874 -0.268218 -0.825034 0.616575 -0.267732 -0.809562 0.617313 -0.267029 -0.79359 0.618076 -0.266103 -0.777111 0.61885 -0.264952 -0.760128 0.619623 -0.263573 -0.742651 0.620385 -0.261965 -0.724699 0.621126 -0.260123 -0.706293 0.621836 -0.258043 -0.687457 0.622507 -0.255716 -0.668221 0.623126 -0.253132 -0.648618 0.62368 -0.250276 -0.628689 0.624153 -0.247134 -0.608483 0.624528 -0.243686 -0.588061 0.624784 -0.239914 -0.567493 0.624903 -0.235798 -0.546861 0.624872 -0.231319 -0.526256 0.624678 -0.226462 -0.505775 0.624318 -0.221213 -0.485517 0.623794 -0.215561 -0.465581 0.623113 -0.209497 -0.446063 0.62229 -0.203019 -0.427053 0.621341 -0.196124 -4.7159 0.739473 -0.247078 -3.47247 0.667196 -0.352925 -2.60881 0.649194 -0.375184 -2.00672 0.646187 -0.376105 -1.60738 0.646114 -0.376706 -1.35428 0.646279 -0.378209 -1.19924 0.645372 -0.380356 -1.10492 0.643801 -0.382711 -1.04618 0.642382 -0.384798 -1.0079 0.64143 -0.386394 -0.981191 0.64089 -0.387522 -0.960454 0.640612 -0.388294 -0.942314 0.640523 -0.3888 -0.924933 0.640741 -0.389069 -0.907437 0.641125 -0.389103 -0.889782 0.641611 -0.388885 -0.871873 0.642164 -0.388403 -0.853627 0.642763 -0.387642 -0.834981 0.643386 -0.386589 -0.815899 0.644016 -0.385234 -0.796364 0.644634 -0.383567 -0.77637 0.645228 -0.381579 -0.755928 0.645785 -0.379263 -0.735053 0.646295 -0.376609 -0.713765 0.64675 -0.373609 -0.692089 0.647142 -0.370252 -0.670051 0.647463 -0.366523 -0.647679 0.647705 -0.362408 -0.625007 0.647854 -0.357889 -0.602072 0.647896 -0.352945 -0.578918 0.647815 -0.347556 -0.5556 0.647594 -0.3417 -0.532184 0.647216 -0.335356 -0.508743 0.646667 -0.328505 -0.485363 0.645939 -0.321128 -0.462133 0.64503 -0.313213 -0.43915 0.643943 -0.304746 -0.416508 0.642689 -0.295718 -0.394303 0.641283 -0.286126 -0.372627 0.639745 -0.275965 -4.7159 0.83097 -0.405103 -3.50618 0.741793 -0.517419 -2.67633 0.711766 -0.552212 -2.09059 0.706028 -0.554962 -1.69927 0.704843 -0.555364 -1.4475 0.704362 -0.556067 -1.28798 0.70318 -0.557213 -1.18571 0.701489 -0.558559 -1.11803 0.699916 -0.559783 -1.07125 0.698772 -0.560696 -1.0369 0.698047 -0.561268 -1.0093 0.697604 -0.561537 -0.984779 0.697369 -0.561525 -0.961278 0.697504 -0.5612 -0.937789 0.697809 -0.560551 -0.914253 0.698196 -0.559566 -0.890558 0.69862 -0.558226 -0.866606 0.69905 -0.556514 -0.842329 0.699458 -0.554412 -0.817684 0.699821 -0.551904 -0.792653 0.700121 -0.548975 -0.767231 0.700341 -0.545609 -0.741427 0.70047 -0.541791 -0.715258 0.700499 -0.537505 -0.688743 0.700421 -0.532734 -0.661907 0.700231 -0.527458 -0.634774 0.699923 -0.521656 -0.607371 0.699489 -0.515303 -0.579729 0.69892 -0.508374 -0.551881 0.698202 -0.500842 -0.52387 0.697321 -0.492678 -0.495747 0.696261 -0.483855 -0.467574 0.695007 -0.474346 -0.439422 0.69355 -0.464127 -0.411374 0.691883 -0.453178 -0.383521 0.690006 -0.441478 -0.355958 0.687929 -0.429015 -0.328785 0.685666 -0.415776 -0.302104 0.683237 -0.401753 -0.276015 0.680668 -0.386943 -4.7159 0.982191 -0.664158 -3.55944 0.886772 -0.763699 -2.78786 0.838464 -0.813115 -2.23003 0.826689 -0.819964 -1.84816 0.822715 -0.820319 -1.5929 0.820599 -0.819623 -1.42202 0.818511 -0.818975 -1.30516 0.816251 -0.818546 -1.22264 0.814172 -0.818196 -1.16208 0.812531 -0.817759 -1.11534 0.811341 -0.817141 -1.07652 0.810468 -0.816288 -1.04155 0.809824 -0.815133 -1.00805 0.809622 -0.813549 -0.974833 0.809586 -0.811514 -0.941807 0.809598 -0.809023 -0.908827 0.809597 -0.806058 -0.875766 0.809543 -0.802596 -0.842536 0.8094 -0.798614 -0.809079 0.809142 -0.794091 -0.775364 0.808747 -0.789003 -0.741376 0.8082 -0.783329 -0.707117 0.807487 -0.777044 -0.672593 0.806604 -0.770124 -0.637817 0.805544 -0.762542 -0.602807 0.804306 -0.754267 -0.567579 0.802885 -0.745267 -0.532153 0.801277 -0.735507 -0.496553 0.799472 -0.724951 -0.460808 0.797462 -0.713559 -0.424955 0.795231 -0.701295 -0.389043 0.792767 -0.688119 -0.353133 0.790058 -0.673997 -0.317297 0.787096 -0.658895 -0.281621 0.78388 -0.642784 -0.246201 0.780414 -0.625637 -0.211141 0.776713 -0.607432 -0.176551 0.772799 -0.58815 -0.142548 0.768701 -0.567775 -0.109251 0.764452 -0.546298 -4.7159 1.23211 -1.08884 -3.63995 1.15073 -1.15386 -2.96345 1.08425 -1.209 -2.45134 1.06083 -1.22252 -2.08176 1.05048 -1.2242 -1.81797 1.04453 -1.22235 -1.62786 1.04003 -1.21958 -1.48787 1.03609 -1.21674 -1.38195 1.03264 -1.21401 -1.29933 1.02976 -1.21133 -1.23232 1.02744 -1.20858 -1.17481 1.0255 -1.20565 -1.12231 1.02384 -1.20235 -1.07206 1.0227 -1.19846 -1.02265 1.02171 -1.19394 -0.973928 1.02072 -1.18881 -0.925677 1.01966 -1.18304 -0.877716 1.01848 -1.17662 -0.82991 1.01713 -1.1695 -0.782163 1.01557 -1.16166 -0.73441 1.0138 -1.15308 -0.686608 1.01178 -1.14371 -0.638729 1.00951 -1.13352 -0.590757 1.00699 -1.12248 -0.542681 1.0042 -1.11054 -0.494495 1.00115 -1.09766 -0.446199 0.99783 -1.08379 -0.397795 0.994243 -1.06888 -0.349291 0.990377 -1.05288 -0.300707 0.986224 -1.03573 -0.252072 0.981769 -1.01737 -0.203431 0.977001 -0.99775 -0.154844 0.971909 -0.976819 -0.106388 0.966486 -0.954525 -0.0581554 0.960735 -0.930821 -0.0102551 0.954666 -0.905663 --0.0371916 0.948299 -0.879011 --0.0840522 0.941663 -0.850825 --0.130184 0.934798 -0.821075 --0.175436 0.927749 -0.789731 -4.7159 1.64513 -1.78505 -3.74206 1.59332 -1.80888 -3.19407 1.52889 -1.84416 -2.74952 1.49447 -1.85807 -2.40265 1.4747 -1.86087 -2.13337 1.46191 -1.85851 -1.92209 1.45254 -1.85395 -1.75341 1.44496 -1.84852 -1.61603 1.43853 -1.8428 -1.5017 1.43304 -1.83693 -1.40394 1.42832 -1.83089 -1.31705 1.42413 -1.82456 -1.23647 1.4203 -1.81774 -1.15926 1.41704 -1.81007 -1.08384 1.41393 -1.80155 -1.00993 1.4108 -1.79221 -0.937223 1.40755 -1.78202 -0.865435 1.40411 -1.77096 -0.794348 1.40043 -1.75898 -0.723792 1.39648 -1.74605 -0.653632 1.39221 -1.73212 -0.583761 1.3876 -1.71714 -0.514093 1.38265 -1.70107 -0.444558 1.37733 -1.68382 -0.375098 1.37163 -1.66536 -0.305663 1.36555 -1.64559 -0.236214 1.35908 -1.62445 -0.166722 1.35221 -1.60186 -0.0971698 1.34491 -1.57772 -0.0275569 1.33719 -1.55195 --0.0420997 1.329 -1.52447 --0.111762 1.32035 -1.49517 --0.181367 1.3112 -1.46397 --0.250832 1.30157 -1.43079 --0.320045 1.29144 -1.39553 --0.388876 1.28082 -1.35812 --0.457168 1.26974 -1.31847 --0.524748 1.25824 -1.2765 --0.591422 1.24636 -1.23215 --0.656977 1.23417 -1.18535 -4.7159 2.3277 -2.92642 -3.82529 2.30143 -2.92171 -3.37223 2.26087 -2.92492 -2.98523 2.23225 -2.92321 -2.66458 2.21186 -2.91739 -2.39933 2.19662 -2.90892 -2.17734 2.18452 -2.8989 -1.98846 2.17437 -2.88804 -1.8249 2.16554 -2.87672 -1.68077 2.15768 -2.86506 -1.5513 2.15056 -2.85309 -1.43216 2.14394 -2.84069 -1.31974 2.13762 -2.82768 -1.21151 2.13171 -2.81375 -1.10601 2.12586 -2.79888 -1.0027 2.11994 -2.78311 -0.901061 2.11383 -2.76638 -0.800645 2.10748 -2.74866 -0.701064 2.10081 -2.72989 -0.601997 2.09376 -2.71001 -0.503172 2.08628 -2.68892 -0.404364 2.07831 -2.66654 -0.305381 2.06982 -2.64277 -0.206065 2.06077 -2.6175 -0.106284 2.0511 -2.5906 -0.00592935 2.04078 -2.56193 --0.0950813 2.02977 -2.53134 --0.196809 2.01804 -2.49867 --0.299288 2.00553 -2.46375 --0.402528 1.99221 -2.42641 --0.506505 1.97803 -2.38646 --0.611163 1.96297 -2.3437 --0.716409 1.94698 -2.29796 --0.822111 1.93005 -2.24903 --0.928097 1.91216 -2.19671 --1.03415 1.89331 -2.14083 --1.14002 1.87354 -2.08118 --1.2454 1.85288 -2.01759 --1.34996 1.83139 -1.94989 --1.4533 1.80916 -1.87793 -4.7159 3.45569 -4.79765 -3.58663 3.45432 -4.77212 -2.75084 3.45296 -4.7466 -2.13921 3.45159 -4.72108 -1.69775 3.45023 -4.69556 -1.3844 3.44887 -4.67004 -1.16641 3.4475 -4.64452 -1.01829 3.44614 -4.619 -0.920173 3.44477 -4.59348 -0.856586 3.44341 -4.56796 -0.815482 3.44205 -4.54244 -0.787481 3.44068 -4.51692 -0.765274 3.43932 -4.4914 -0.743615 3.43796 -4.46588 -0.720008 3.43659 -4.44036 -0.692696 3.43523 -4.41484 -0.660122 3.43386 -4.38932 -0.620923 3.4325 -4.3638 -0.57392 3.43114 -4.33828 -0.518111 3.42977 -4.31276 -0.45266 3.42841 -4.28724 -0.37689 3.42703 -4.26171 -0.290277 3.42517 -4.2362 -0.192456 3.42239 -4.21067 -0.0832053 3.41837 -4.18515 --0.0375506 3.41275 -4.15918 --0.169732 3.40519 -4.13165 --0.313104 3.39534 -4.10208 --0.467291 3.38287 -4.06994 --0.631773 3.3675 -4.03468 --0.805897 3.34899 -3.99567 --0.988883 3.32718 -3.95224 --1.17983 3.30197 -3.90371 --1.37774 3.27336 -3.84934 --1.5815 3.24143 -3.7884 --1.78992 3.20637 -3.72013 --2.00176 3.16845 -3.64381 --2.21568 3.128 -3.55872 --2.43035 3.08545 -3.46419 --2.64435 3.04127 -3.35961 -0.856553 0.676199 -0.000901008 -0.849975 0.676933 -0.00180365 -0.843092 0.677687 -0.00273095 -0.835785 0.678474 -0.00370036 -0.827958 0.679299 -0.00471899 -0.81953 0.68016 -0.00578445 -0.810441 0.681053 -0.00689153 -0.800651 0.681971 -0.00803349 -0.790137 0.682909 -0.0092037 -0.778894 0.68386 -0.0103968 -0.766931 0.684823 -0.0116086 -0.754276 0.685793 -0.0128363 -0.740964 0.686767 -0.0140759 -0.727044 0.687738 -0.01532 -0.712571 0.688696 -0.0165556 -0.697608 0.689623 -0.0177625 -0.682221 0.690498 -0.0189135 -0.666481 0.691296 -0.019976 -0.650461 0.691988 -0.0209155 -0.634243 0.69255 -0.0217 -0.61791 0.692965 -0.0223048 -0.601555 0.693222 -0.022715 -0.585273 0.69332 -0.0229278 -0.569163 0.693269 -0.0229512 -0.553328 0.693084 -0.0228017 -0.537866 0.692782 -0.0225002 -0.522875 0.692383 -0.0220682 -4.7159 0.675473 -1.84e-05 -3.41591 0.675465 -2.5297e-05 -2.51083 0.675464 -2.3433e-05 -1.89455 0.675464 -2.2664e-05 -1.48624 0.675464 -2.2466e-05 -1.22468 0.675464 -2.266e-05 -1.06398 0.675464 -2.2767e-05 -0.970195 0.675464 -2.2167e-05 -0.918631 0.675463 -2.1215e-05 -0.891845 0.675463 -2.0615e-05 -0.878021 0.675464 -2.0393e-05 -0.869733 0.675464 -2.0317e-05 -0.862969 0.675466 -2.0272e-05 -0.856556 0.676198 -0.000921032 -0.849978 0.676933 -0.00182362 -0.843094 0.677686 -0.0027509 -0.835788 0.678473 -0.00372033 -0.82796 0.679298 -0.00473902 -0.819532 0.680159 -0.00580454 -0.810443 0.681052 -0.00691171 -0.800653 0.68197 -0.00805376 -0.790139 0.682907 -0.00922407 -0.778895 0.683859 -0.0104172 -0.766933 0.684822 -0.0116292 -0.754277 0.685792 -0.012857 -0.740966 0.686766 -0.0140966 -0.727045 0.687737 -0.0153407 -0.712573 0.688694 -0.0165763 -0.697609 0.689622 -0.0177833 -0.682222 0.690497 -0.0189343 -0.666482 0.691294 -0.0199969 -0.650462 0.691986 -0.0209364 -0.634243 0.692549 -0.0217209 -0.617911 0.692963 -0.0223257 -0.601555 0.69322 -0.0227359 -0.585273 0.693319 -0.0229487 -0.569163 0.693268 -0.022972 -0.553327 0.693082 -0.0228225 -0.537866 0.692781 -0.0225209 -0.522875 0.692382 -0.0220888 -4.7159 0.675489 -4.9061e-05 -3.41592 0.675464 -7.0452e-05 -2.51084 0.675462 -6.5729e-05 -1.89456 0.675462 -6.3695e-05 -1.48624 0.675463 -6.3204e-05 -1.22468 0.675463 -6.3859e-05 -1.06399 0.675463 -6.438e-05 -0.970199 0.675462 -6.2983e-05 -0.918634 0.675461 -6.0549e-05 -0.891847 0.675461 -5.9031e-05 -0.878023 0.675462 -5.8536e-05 -0.869733 0.675463 -5.8478e-05 -0.862972 0.675468 -5.9079e-05 -0.856561 0.676197 -0.000958648 -0.849982 0.676931 -0.00186098 -0.843099 0.677684 -0.00278817 -0.835792 0.678471 -0.00375758 -0.827965 0.679296 -0.00477629 -0.819536 0.680157 -0.00584187 -0.810447 0.681049 -0.00694914 -0.800657 0.681967 -0.00809129 -0.790142 0.682905 -0.00926171 -0.778899 0.683857 -0.010455 -0.766937 0.684819 -0.011667 -0.754281 0.685789 -0.0128949 -0.740969 0.686763 -0.0141345 -0.727048 0.687734 -0.0153787 -0.712575 0.688692 -0.0166143 -0.697612 0.689619 -0.0178213 -0.682225 0.690495 -0.0189723 -0.666484 0.691292 -0.0200347 -0.650464 0.691984 -0.0209742 -0.634245 0.692546 -0.0217586 -0.617912 0.692961 -0.0223633 -0.601556 0.693217 -0.0227734 -0.585273 0.693316 -0.0229861 -0.569163 0.693265 -0.0230093 -0.553327 0.693079 -0.0228596 -0.537865 0.692778 -0.0225578 -0.522873 0.692378 -0.0221255 -4.7159 0.675515 -0.000100193 -3.41593 0.675463 -0.000151435 -2.51085 0.67546 -0.000142353 -1.89458 0.675459 -0.000138238 -1.48626 0.67546 -0.000137322 -1.22469 0.675461 -0.000138932 -1.064 0.675461 -0.000140389 -0.970205 0.675459 -0.000137847 -0.918639 0.675457 -0.000133124 -0.891851 0.675458 -0.000130304 -0.878026 0.675459 -0.000129602 -0.869734 0.675462 -0.000129893 -0.862977 0.675473 -0.000133007 -0.85657 0.676195 -0.00102906 -0.849991 0.676928 -0.00193068 -0.843108 0.67768 -0.00285753 -0.835801 0.678466 -0.00382675 -0.827973 0.679291 -0.00484537 -0.819544 0.680152 -0.00591094 -0.810454 0.681045 -0.00701825 -0.800664 0.681963 -0.00816048 -0.790149 0.6829 -0.00933098 -0.778905 0.683852 -0.0105243 -0.766943 0.684815 -0.0117364 -0.754286 0.685785 -0.0129643 -0.740974 0.686759 -0.0142039 -0.727053 0.68773 -0.015448 -0.71258 0.688688 -0.0166835 -0.697616 0.689615 -0.0178903 -0.682229 0.69049 -0.0190411 -0.666487 0.691287 -0.0201033 -0.650467 0.691979 -0.0210425 -0.634247 0.692542 -0.0218266 -0.617913 0.692956 -0.022431 -0.601557 0.693213 -0.0228408 -0.585273 0.693311 -0.023053 -0.569162 0.69326 -0.0230758 -0.553326 0.693075 -0.0229256 -0.537863 0.692773 -0.0226233 -0.522871 0.692373 -0.0221904 -4.7159 0.675562 -0.000185263 -3.41595 0.675461 -0.000296534 -2.51088 0.675455 -0.000280941 -1.89461 0.675454 -0.000273429 -1.48628 0.675456 -0.000271928 -1.22471 0.675458 -0.000275412 -1.06401 0.675457 -0.000278695 -0.970218 0.675454 -0.00027443 -0.918649 0.675451 -0.000266256 -0.89186 0.675451 -0.000261806 -0.878031 0.675454 -0.000261298 -0.869736 0.67546 -0.000262834 -0.862987 0.675482 -0.000272758 -0.856586 0.676192 -0.00116019 -0.850008 0.676922 -0.00206001 -0.843124 0.677674 -0.00298593 -0.835816 0.678459 -0.00395453 -0.827988 0.679284 -0.00497273 -0.819558 0.680144 -0.00603804 -0.810468 0.681037 -0.00714518 -0.800677 0.681955 -0.00828732 -0.790161 0.682892 -0.00945776 -0.778917 0.683845 -0.010651 -0.766953 0.684807 -0.011863 -0.754297 0.685778 -0.0130907 -0.740984 0.686752 -0.01433 -0.727063 0.687723 -0.0155738 -0.712589 0.68868 -0.0168088 -0.697625 0.689608 -0.0180151 -0.682236 0.690483 -0.0191652 -0.666493 0.69128 -0.0202267 -0.650472 0.691972 -0.0211652 -0.634251 0.692534 -0.0219485 -0.617916 0.692948 -0.0225521 -0.601558 0.693205 -0.022961 -0.585273 0.693303 -0.0231723 -0.569161 0.693252 -0.0231941 -0.553324 0.693066 -0.0230428 -0.53786 0.692764 -0.0227393 -0.522867 0.692364 -0.0223051 -4.7159 0.675644 -0.000326353 -3.416 0.675457 -0.000555118 -2.51094 0.675446 -0.000530174 -1.89465 0.675445 -0.000517191 -1.48632 0.675448 -0.000514952 -1.22474 0.675452 -0.00052199 -1.06404 0.675451 -0.000528624 -0.97024 0.675444 -0.000521767 -0.918667 0.675439 -0.000508682 -0.891875 0.675439 -0.000502684 -0.878042 0.675446 -0.000503603 -0.86974 0.675457 -0.000508526 -0.863006 0.675498 -0.000533934 -0.856617 0.676187 -0.00140265 -0.850038 0.676912 -0.00229829 -0.843153 0.677662 -0.00322194 -0.835844 0.678446 -0.00418895 -0.828015 0.67927 -0.00520591 -0.819584 0.68013 -0.00627027 -0.810493 0.681022 -0.00737669 -0.8007 0.681941 -0.00851824 -0.790184 0.682879 -0.00968817 -0.778938 0.683831 -0.0108809 -0.766973 0.684794 -0.0120923 -0.754316 0.685765 -0.0133193 -0.741002 0.686739 -0.0145578 -0.727079 0.68771 -0.0158005 -0.712605 0.688668 -0.0170343 -0.697639 0.689595 -0.0182391 -0.682249 0.69047 -0.0193877 -0.666505 0.691267 -0.0204475 -0.650481 0.691958 -0.0213841 -0.634258 0.692521 -0.0221656 -0.617921 0.692935 -0.0227672 -0.601561 0.693191 -0.0231741 -0.585273 0.69329 -0.0233834 -0.569159 0.693238 -0.023403 -0.55332 0.693052 -0.0232493 -0.537855 0.692749 -0.0229432 -0.52286 0.692348 -0.0225061 -4.7159 0.675783 -0.000559676 -3.41607 0.675451 -0.00101195 -2.51103 0.675431 -0.000974398 -1.89474 0.675428 -0.000952774 -1.48639 0.675434 -0.000949755 -1.22481 0.675442 -0.000963344 -1.06409 0.675441 -0.000975928 -0.97028 0.675428 -0.00096542 -0.918702 0.675418 -0.000946097 -0.891906 0.675419 -0.000939935 -0.878066 0.675431 -0.000945374 -0.869752 0.675452 -0.000958412 -0.863043 0.675523 -0.00101427 -0.856672 0.676178 -0.00184692 -0.850093 0.676895 -0.00273336 -0.843206 0.677641 -0.00365191 -0.835895 0.678423 -0.00461516 -0.828063 0.679246 -0.00562904 -0.81963 0.680105 -0.00669089 -0.810537 0.680998 -0.00779522 -0.800742 0.681916 -0.00893496 -0.790223 0.682854 -0.0101032 -0.778975 0.683807 -0.0112943 -0.767008 0.684771 -0.012504 -0.754349 0.685742 -0.0137291 -0.741033 0.686717 -0.0149653 -0.727109 0.687688 -0.0162054 -0.712633 0.688646 -0.0174363 -0.697665 0.689573 -0.0186378 -0.682272 0.690447 -0.0197828 -0.666524 0.691244 -0.0208387 -0.650497 0.691936 -0.0217714 -0.63427 0.692498 -0.0225488 -0.617929 0.692912 -0.0231463 -0.601565 0.693168 -0.0235489 -0.585273 0.693267 -0.0237538 -0.569156 0.693215 -0.0237688 -0.553313 0.693028 -0.0236102 -0.537845 0.692724 -0.0232987 -0.522848 0.692322 -0.0228556 -4.7159 0.67602 -0.000944618 -3.4162 0.675442 -0.00180992 -2.5112 0.675406 -0.0017571 -1.8949 0.6754 -0.00172216 -1.48652 0.675411 -0.00171866 -1.22491 0.675425 -0.001744 -1.06418 0.675423 -0.00176695 -0.970355 0.675401 -0.0017521 -0.918769 0.675382 -0.00172671 -0.89197 0.675384 -0.00172501 -0.878117 0.675405 -0.00174189 -0.869785 0.675443 -0.00177272 -0.863112 0.675558 -0.00187942 -0.85677 0.676163 -0.00265183 -0.85019 0.676866 -0.00351911 -0.843299 0.677605 -0.00442677 -0.835985 0.678384 -0.0053818 -0.828149 0.679204 -0.00638876 -0.819712 0.680063 -0.0074447 -0.810614 0.680955 -0.00854387 -0.800814 0.681873 -0.00967903 -0.790291 0.682812 -0.0108431 -0.77904 0.683767 -0.01203 -0.76707 0.684731 -0.0132354 -0.754407 0.685703 -0.0144558 -0.741088 0.686679 -0.0156869 -0.727161 0.687651 -0.0169211 -0.71268 0.688608 -0.0181454 -0.697708 0.689535 -0.0193398 -0.682311 0.69041 -0.020477 -0.666558 0.691206 -0.0215249 -0.650524 0.691898 -0.0224492 -0.634291 0.69246 -0.0232181 -0.617942 0.692874 -0.0238069 -0.60157 0.69313 -0.0242009 -0.585272 0.693228 -0.0243968 -0.569148 0.693176 -0.0244025 -0.553299 0.692989 -0.024234 -0.537826 0.692684 -0.0239118 -0.522825 0.69228 -0.0234569 -4.7159 0.676417 -0.00157857 -3.41642 0.675428 -0.00318484 -2.5115 0.675363 -0.00311741 -1.89516 0.675353 -0.00306258 -1.48675 0.675371 -0.00305965 -1.2251 0.675397 -0.00310553 -1.06434 0.675395 -0.00314635 -0.970497 0.675357 -0.00312853 -0.918904 0.675323 -0.00310209 -0.892105 0.675325 -0.0031165 -0.878236 0.675363 -0.00315896 -0.869874 0.675431 -0.00322525 -0.863246 0.675597 -0.00340071 -0.856942 0.676141 -0.0040897 -0.850362 0.676817 -0.00491978 -0.843464 0.677545 -0.00580533 -0.836142 0.678317 -0.00674342 -0.828298 0.679133 -0.00773578 -0.819853 0.67999 -0.0087789 -0.810747 0.680882 -0.00986662 -0.800939 0.681801 -0.0109913 -0.790409 0.682742 -0.0121456 -0.77915 0.683698 -0.0133229 -0.767173 0.684665 -0.0145186 -0.754504 0.685639 -0.0157286 -0.74118 0.686615 -0.0169485 -0.727247 0.687588 -0.0181703 -0.71276 0.688546 -0.019381 -0.697781 0.689473 -0.0205605 -0.682375 0.690348 -0.021682 -0.666612 0.691144 -0.0227134 -0.650567 0.691836 -0.0236208 -0.634322 0.692398 -0.0243727 -0.617961 0.692812 -0.0249444 -0.601577 0.693068 -0.0253211 -0.585267 0.693166 -0.0254995 -0.569132 0.693114 -0.025487 -0.553273 0.692925 -0.0252993 -0.537791 0.692618 -0.0249563 -0.522782 0.692211 -0.0244787 -4.7159 0.677083 -0.00262128 -3.4168 0.675411 -0.00551701 -2.512 0.675295 -0.00544478 -1.89563 0.675276 -0.00536135 -1.48714 0.675308 -0.00536162 -1.22544 0.675353 -0.00544234 -1.06464 0.675351 -0.00551385 -0.970773 0.675285 -0.00550076 -0.919185 0.675226 -0.00549001 -0.892401 0.675231 -0.00554567 -0.878508 0.675296 -0.0056395 -0.870103 0.675406 -0.00576721 -0.863511 0.675619 -0.006014 -0.857243 0.676104 -0.00661146 -0.850661 0.67674 -0.00737756 -0.843749 0.677447 -0.00822118 -0.836411 0.678208 -0.00912628 -0.828551 0.679017 -0.0100898 -0.82009 0.67987 -0.0111069 -0.810969 0.680761 -0.0121708 -0.801147 0.681682 -0.0132734 -0.790603 0.682625 -0.0144066 -0.779332 0.683585 -0.0155634 -0.767344 0.684555 -0.0167383 -0.754664 0.685532 -0.0179267 -0.741329 0.686512 -0.0191233 -0.727385 0.687486 -0.02032 -0.712887 0.688446 -0.0215033 -0.697895 0.689373 -0.0226535 -0.682474 0.690248 -0.023744 -0.666694 0.691044 -0.0247433 -0.650631 0.691735 -0.025618 -0.634365 0.692298 -0.026337 -0.617983 0.692712 -0.0268758 -0.601579 0.692969 -0.0272195 -0.585248 0.693067 -0.0273644 -0.569095 0.693014 -0.0273174 -0.553219 0.692823 -0.0270933 -0.537722 0.692513 -0.0267114 -0.522699 0.692102 -0.0261915 -4.7159 0.678194 -0.00433471 -3.41744 0.675402 -0.00940372 -2.51285 0.675194 -0.00935763 -1.89642 0.67516 -0.009235 -1.48783 0.675214 -0.00924396 -1.22605 0.675291 -0.00938198 -1.06519 0.675287 -0.00950636 -0.971325 0.675176 -0.00952107 -0.919782 0.675076 -0.00956679 -0.893046 0.675085 -0.00971064 -0.879121 0.675188 -0.00989503 -0.870648 0.675348 -0.0101084 -0.864043 0.675593 -0.0104114 -0.857777 0.676034 -0.0109299 -0.851179 0.67662 -0.0116064 -0.844237 0.677295 -0.0123791 -0.836866 0.678036 -0.0132248 -0.828973 0.678833 -0.014135 -0.820481 0.679681 -0.0151027 -0.811331 0.68057 -0.0161201 -0.801483 0.681492 -0.0171786 -0.790914 0.68244 -0.0182695 -0.77962 0.683405 -0.0193847 -0.76761 0.684381 -0.0205176 -0.754911 0.685364 -0.0216627 -0.741557 0.686348 -0.0228135 -0.727594 0.687326 -0.0239611 -0.713076 0.688288 -0.0250919 -0.698061 0.689216 -0.0261863 -0.682615 0.690091 -0.0272183 -0.666807 0.690888 -0.0281573 -0.650712 0.69158 -0.0289707 -0.634413 0.692143 -0.0296282 -0.617996 0.692559 -0.0301057 -0.601557 0.692817 -0.030388 -0.585194 0.692915 -0.0304708 -0.569009 0.692861 -0.03036 -0.553104 0.692668 -0.030069 -0.537582 0.692353 -0.0296157 -0.522536 0.691936 -0.0290189 -4.7159 0.680041 -0.00714858 -3.41847 0.675437 -0.0157562 -2.51427 0.675064 -0.0158108 -1.89778 0.675003 -0.0156378 -1.48904 0.675091 -0.0156656 -1.22715 0.675219 -0.0158949 -1.06627 0.675212 -0.0161107 -0.972455 0.675026 -0.0162082 -0.921053 0.674863 -0.016392 -0.894419 0.674874 -0.0166972 -0.880436 0.675016 -0.0170148 -0.871832 0.675215 -0.017321 -0.865116 0.675474 -0.017662 -0.858764 0.675889 -0.0181238 -0.852094 0.67643 -0.0187039 -0.845079 0.677066 -0.0193776 -0.837635 0.677779 -0.0201294 -0.829673 0.678559 -0.0209497 -0.821118 0.679397 -0.0218307 -0.81191 0.680283 -0.0227639 -0.802009 0.681208 -0.0237403 -0.791392 0.682161 -0.0247506 -0.780054 0.683134 -0.0257859 -0.768004 0.68412 -0.0268382 -0.755268 0.685112 -0.0279004 -0.741879 0.686104 -0.0289645 -0.727881 0.687088 -0.0300206 -0.713326 0.688054 -0.0310546 -0.698272 0.688985 -0.032047 -0.682783 0.689862 -0.0329728 -0.666927 0.69066 -0.0338026 -0.65078 0.691353 -0.0345053 -0.634426 0.691917 -0.0350517 -0.617953 0.692335 -0.0354182 -0.601458 0.692594 -0.0355895 -0.58504 0.692693 -0.0355602 -0.568804 0.692638 -0.0353344 -0.552853 0.692442 -0.0349235 -0.537287 0.692121 -0.0343432 -0.522201 0.691693 -0.0336102 -4.7159 0.683107 -0.0117677 -3.42015 0.675621 -0.0259207 -2.51663 0.674954 -0.0262341 -1.90007 0.674845 -0.0260024 -1.49116 0.674985 -0.0260662 -1.22918 0.675187 -0.0264351 -1.06835 0.675168 -0.0268089 -0.974766 0.674866 -0.0270999 -0.923684 0.674609 -0.0275554 -0.897196 0.674605 -0.0281084 -0.883067 0.67476 -0.0285867 -0.874202 0.674969 -0.0289798 -0.867224 0.675229 -0.0293509 -0.860635 0.675628 -0.0297771 -0.853766 0.676141 -0.0302751 -0.846571 0.676746 -0.0308396 -0.838963 0.677431 -0.031468 -0.830851 0.678191 -0.032157 -0.82216 0.679017 -0.0329017 -0.81283 0.679899 -0.0336956 -0.802819 0.680826 -0.0345309 -0.792103 0.681786 -0.0353988 -0.780677 0.682771 -0.0362902 -0.768548 0.68377 -0.0371962 -0.755738 0.684775 -0.038108 -0.742279 0.685779 -0.0390161 -0.728214 0.686773 -0.0399089 -0.713592 0.687746 -0.0407718 -0.698467 0.688683 -0.0415855 -0.682903 0.689562 -0.0423261 -0.666967 0.690362 -0.042966 -0.650736 0.691057 -0.0434762 -0.634293 0.691623 -0.043829 -0.617729 0.692042 -0.0440014 -0.601144 0.692303 -0.043978 -0.584639 0.692402 -0.0437518 -0.568319 0.692344 -0.0433243 -0.552288 0.692142 -0.0427039 -0.536648 0.691811 -0.041903 -0.521492 0.69137 -0.0409355 -4.7159 0.688194 -0.0193481 -3.42281 0.676228 -0.041818 -2.52051 0.675035 -0.0426996 -1.90398 0.674844 -0.0424097 -1.49491 0.675053 -0.0425353 -1.23295 0.675358 -0.0431086 -1.07242 0.675306 -0.0437486 -0.979391 0.674836 -0.0444157 -0.92885 0.674443 -0.045309 -0.902435 0.674372 -0.0461799 -0.887961 0.674488 -0.0468341 -0.878624 0.674673 -0.0473176 -0.871173 0.674916 -0.0477263 -0.864138 0.675304 -0.048138 -0.856857 0.675803 -0.0485756 -0.849283 0.676392 -0.0490395 -0.841327 0.677063 -0.0495332 -0.832897 0.67781 -0.0500592 -0.823917 0.678628 -0.050618 -0.814325 0.679508 -0.0512079 -0.804079 0.680439 -0.051825 -0.793154 0.681408 -0.0524638 -0.781539 0.682406 -0.0531169 -0.76924 0.68342 -0.0537764 -0.756275 0.684442 -0.0544328 -0.742674 0.685461 -0.0550758 -0.728473 0.686467 -0.0556927 -0.713719 0.68745 -0.0562683 -0.698462 0.688392 -0.0567837 -0.682764 0.689275 -0.0572162 -0.66669 0.690075 -0.0575403 -0.650317 0.69077 -0.0577293 -0.633729 0.691336 -0.0577574 -0.61702 0.691754 -0.0576028 -0.600288 0.692013 -0.0572493 -0.583639 0.692107 -0.056688 -0.567179 0.692042 -0.0559172 -0.551014 0.691829 -0.0549411 -0.535243 0.691481 -0.0537679 -0.519961 0.691018 -0.0524078 -4.7159 0.696624 -0.0317863 -3.42697 0.67791 -0.0660945 -2.52684 0.675788 -0.0681103 -1.91061 0.675453 -0.0677828 -1.50158 0.675751 -0.0680035 -1.23995 0.67618 -0.068857 -1.0802 0.676064 -0.069916 -0.988195 0.675374 -0.0711824 -0.938261 0.674789 -0.0726448 -0.911619 0.674579 -0.0738736 -0.896457 0.6746 -0.0747294 -0.886346 0.674724 -0.0753297 -0.878138 0.674931 -0.0758015 -0.870372 0.675302 -0.0762259 -0.862385 0.675792 -0.0766282 -0.854135 0.676377 -0.0770087 -0.845534 0.677046 -0.0773708 -0.836496 0.677794 -0.0777183 -0.826947 0.678614 -0.0780545 -0.81683 0.679497 -0.0783818 -0.806101 0.680434 -0.0787012 -0.794736 0.681412 -0.0790117 -0.782721 0.682419 -0.0793108 -0.770059 0.683444 -0.0795936 -0.756764 0.684477 -0.079853 -0.742857 0.685505 -0.0800798 -0.728372 0.686519 -0.0802619 -0.713349 0.687504 -0.0803845 -0.697834 0.688445 -0.0804295 -0.681883 0.689323 -0.0803759 -0.665559 0.690116 -0.0802003 -0.648938 0.6908 -0.0798782 -0.632101 0.691354 -0.0793859 -0.615144 0.691758 -0.0787024 -0.598166 0.692 -0.0778109 -0.581272 0.692076 -0.0767004 -0.564572 0.691988 -0.0753653 -0.548168 0.691746 -0.0738052 -0.532161 0.691365 -0.0720237 -0.516644 0.690862 -0.070027 -4.7159 0.71059 -0.0521932 -3.43336 0.682114 -0.10229 -2.53711 0.678388 -0.106411 -1.92183 0.677808 -0.106105 -1.51336 0.678195 -0.106454 -1.25272 0.678752 -0.107652 -1.09446 0.67854 -0.109282 -1.0038 0.677613 -0.111292 -0.954091 0.676799 -0.113341 -0.926618 0.676401 -0.114933 -0.910255 0.67629 -0.116018 -0.89894 0.67633 -0.11677 -0.889583 0.676482 -0.117339 -0.880698 0.676829 -0.117807 -0.871608 0.67731 -0.118202 -0.862275 0.677893 -0.11852 -0.852615 0.678564 -0.118762 -0.842549 0.679315 -0.118929 -0.832009 0.680137 -0.119025 -0.820945 0.681021 -0.119051 -0.80932 0.681954 -0.119011 -0.797114 0.682925 -0.118908 -0.784315 0.683924 -0.118743 -0.770924 0.684936 -0.118516 -0.756952 0.685953 -0.118224 -0.742418 0.686962 -0.117861 -0.727349 0.687951 -0.117417 -0.711776 0.688908 -0.11688 -0.695742 0.689815 -0.116234 -0.679294 0.690654 -0.115461 -0.662492 0.691404 -0.114539 -0.645405 0.69204 -0.113447 -0.628113 0.692542 -0.112162 -0.610707 0.692891 -0.110664 -0.593285 0.693076 -0.108935 -0.575951 0.69309 -0.106964 -0.558811 0.692936 -0.104739 -0.541968 0.692622 -0.102258 -0.52552 0.692163 -0.0995194 -0.509558 0.691576 -0.0965251 -4.7159 0.733715 -0.085672 -3.44305 0.691858 -0.155079 -2.55367 0.685436 -0.162873 -1.94071 0.684435 -0.162715 -1.53387 0.684874 -0.163208 -1.27523 0.685527 -0.164751 -1.11906 0.685218 -0.166974 -1.02936 0.684107 -0.169634 -0.978848 0.683095 -0.172127 -0.949584 0.682516 -0.17401 -0.931264 0.682275 -0.175306 -0.918112 0.682226 -0.17621 -0.90703 0.682321 -0.176881 -0.896471 0.682649 -0.177399 -0.885721 0.683125 -0.177791 -0.874744 0.683707 -0.178049 -0.863458 0.684377 -0.17817 -0.851787 0.685122 -0.178152 -0.839672 0.685931 -0.177993 -0.82707 0.686791 -0.177694 -0.813953 0.687688 -0.177256 -0.800307 0.688612 -0.176681 -0.786128 0.68955 -0.175972 -0.771421 0.690491 -0.175129 -0.7562 0.691424 -0.174152 -0.740481 0.69234 -0.173037 -0.724288 0.693227 -0.171779 -0.707651 0.694072 -0.170366 -0.690603 0.694859 -0.168787 -0.673188 0.695569 -0.167025 -0.655458 0.696182 -0.165062 -0.637474 0.696676 -0.162877 -0.61931 0.697029 -0.160451 -0.601051 0.697224 -0.157765 -0.58279 0.697249 -0.1548 -0.564624 0.697098 -0.151543 -0.546655 0.696774 -0.147983 -0.528981 0.696284 -0.144111 -0.511697 0.695642 -0.139924 -0.49489 0.694866 -0.135421 -4.7159 0.772001 -0.140595 -3.45769 0.71313 -0.230777 -2.5803 0.702255 -0.244628 -1.97229 0.700519 -0.244878 -1.56883 0.700878 -0.24548 -1.3132 0.701535 -0.247213 -1.15882 0.701159 -0.249769 -1.0685 0.699973 -0.252695 -1.01542 0.698845 -0.255327 -0.982941 0.698135 -0.257317 -0.961527 0.697788 -0.25871 -0.94557 0.697664 -0.259688 -0.931879 0.697708 -0.260396 -0.9188 0.698029 -0.260898 -0.905554 0.698511 -0.261217 -0.892106 0.699096 -0.261345 -0.878371 0.699759 -0.261274 -0.864275 0.700482 -0.260998 -0.849759 0.701247 -0.260512 -0.834788 0.70204 -0.259811 -0.819341 0.702845 -0.258892 -0.803412 0.703649 -0.257756 -0.787003 0.704441 -0.256399 -0.770126 0.70521 -0.254821 -0.752798 0.705947 -0.253018 -0.73504 0.706643 -0.250985 -0.716877 0.707289 -0.248716 -0.698335 0.707873 -0.246199 -0.679448 0.708381 -0.243422 -0.660253 0.708794 -0.240369 -0.640796 0.709095 -0.237022 -0.621134 0.709261 -0.233363 -0.601333 0.709275 -0.229372 -0.581469 0.709118 -0.225031 -0.561627 0.70878 -0.220323 -0.541897 0.708257 -0.215232 -0.522375 0.70755 -0.209748 -0.503154 0.70667 -0.203859 -0.484324 0.705629 -0.197561 -0.465971 0.704447 -0.190851 -4.7159 0.835378 -0.230697 -3.47994 0.757409 -0.338519 -2.62332 0.739113 -0.361857 -2.02481 0.736002 -0.363069 -1.62707 0.735947 -0.363677 -1.37454 0.736376 -0.365214 -1.21984 0.735895 -0.367523 -1.12593 0.734683 -0.370127 -1.06765 0.733481 -0.372462 -1.02984 0.732657 -0.374252 -1.00357 0.7322 -0.375513 -0.983265 0.731988 -0.376376 -0.965547 0.731962 -0.376945 -0.948591 0.732269 -0.377243 -0.931526 0.732742 -0.377291 -0.914307 0.733307 -0.377082 -0.896846 0.733927 -0.376606 -0.879059 0.734575 -0.375853 -0.86089 0.735228 -0.374812 -0.842302 0.735868 -0.373477 -0.82328 0.736477 -0.371839 -0.803821 0.73704 -0.369892 -0.783933 0.737545 -0.367629 -0.763632 0.737983 -0.365042 -0.74294 0.738346 -0.362123 -0.72188 0.738628 -0.358861 -0.700478 0.738819 -0.355243 -0.678762 0.738912 -0.351254 -0.656763 0.738892 -0.346876 -0.634518 0.738745 -0.34209 -0.612069 0.738452 -0.336876 -0.589469 0.737995 -0.331213 -0.566777 0.737357 -0.325078 -0.544066 0.736522 -0.318454 -0.521415 0.735483 -0.31132 -0.49891 0.734236 -0.303662 -0.47664 0.732786 -0.295467 -0.454698 0.731145 -0.286723 -0.433174 0.72933 -0.277425 -0.412154 0.727362 -0.267568 -4.7159 0.94028 -0.378513 -3.51438 0.845912 -0.493071 -2.69353 0.815129 -0.530232 -2.11214 0.809152 -0.53367 -1.72239 0.807879 -0.534196 -1.47093 0.80754 -0.534952 -1.31147 0.806656 -0.536245 -1.20937 0.805236 -0.537828 -1.14196 0.803825 -0.53931 -1.0955 0.802763 -0.540446 -1.06152 0.802079 -0.541186 -1.0343 0.801661 -0.54158 -1.01017 0.801448 -0.541662 -0.987062 0.801636 -0.541382 -0.963966 0.801991 -0.54076 -0.940824 0.802409 -0.539795 -0.91753 0.802841 -0.538476 -0.893989 0.803251 -0.536789 -0.870135 0.803609 -0.53472 -0.845927 0.80389 -0.532258 -0.821349 0.804075 -0.529389 -0.796396 0.804147 -0.5261 -0.77108 0.804094 -0.522377 -0.745415 0.803908 -0.518205 -0.719425 0.803582 -0.513568 -0.693132 0.803112 -0.508446 -0.666564 0.802492 -0.502819 -0.639748 0.801714 -0.496663 -0.612713 0.800767 -0.489953 -0.585495 0.799639 -0.482664 -0.558134 0.798311 -0.474768 -0.530682 0.796769 -0.46624 -0.503197 0.794997 -0.457054 -0.475751 0.792983 -0.447187 -0.44842 0.790723 -0.436618 -0.421294 0.788218 -0.425329 -0.394463 0.785478 -0.413303 -0.368023 0.78252 -0.400531 -0.34207 0.779367 -0.387001 -0.316698 0.776047 -0.372711 -4.7159 1.1139 -0.621015 -3.56818 1.01499 -0.722109 -2.80797 0.965154 -0.775371 -2.25593 0.952789 -0.783741 -1.87608 0.948448 -0.784597 -1.62113 0.946175 -0.784119 -1.4501 0.944092 -0.783671 -1.33313 0.941869 -0.783489 -1.2506 0.939776 -0.78341 -1.19013 0.938072 -0.783223 -1.14357 0.936793 -0.782811 -1.105 0.935823 -0.782126 -1.07028 0.935085 -0.781104 -1.03704 0.934827 -0.779585 -1.00408 0.934724 -0.777592 -0.971302 0.93464 -0.775137 -0.938571 0.934507 -0.772209 -0.905765 0.934278 -0.768793 -0.872797 0.933916 -0.764869 -0.839614 0.933389 -0.76042 -0.806185 0.932676 -0.755427 -0.772501 0.931758 -0.749868 -0.738564 0.930624 -0.743722 -0.704385 0.929266 -0.736965 -0.669981 0.927681 -0.72957 -0.635371 0.925867 -0.721509 -0.600577 0.92382 -0.71275 -0.565621 0.921535 -0.70326 -0.530532 0.919003 -0.693006 -0.495341 0.916214 -0.681953 -0.460089 0.913152 -0.670067 -0.424824 0.909805 -0.657313 -0.389609 0.906161 -0.643662 -0.354515 0.902213 -0.629084 -0.319626 0.897961 -0.613552 -0.285034 0.893414 -0.597045 -0.25084 0.888591 -0.57954 -0.217149 0.883516 -0.561022 -0.18407 0.878224 -0.541476 -0.151713 0.872754 -0.520892 -4.7159 1.40126 -1.01887 -3.64849 1.31827 -1.08421 -2.98446 1.24983 -1.14316 -2.48006 1.22522 -1.15919 -2.11389 1.21399 -1.16214 -1.85123 1.20739 -1.16098 -1.66129 1.20243 -1.15866 -1.52114 1.19812 -1.1562 -1.41501 1.1943 -1.15383 -1.33221 1.19106 -1.15148 -1.26511 1.18837 -1.14901 -1.20759 1.18607 -1.14631 -1.15508 1.18406 -1.14321 -1.10482 1.1826 -1.13941 -1.05537 1.18129 -1.13496 -1.00658 1.17993 -1.12988 -0.958258 1.17844 -1.12416 -0.910223 1.17677 -1.1178 -0.862346 1.17487 -1.11075 -0.81454 1.17269 -1.103 -0.766746 1.17022 -1.09453 -0.718928 1.16742 -1.08529 -0.671068 1.16431 -1.07526 -0.623158 1.16085 -1.06441 -0.575195 1.15707 -1.05269 -0.527184 1.15294 -1.04007 -0.479131 1.14848 -1.02649 -0.431049 1.14367 -1.01191 -0.382954 1.13851 -0.996298 -0.334872 1.133 -0.979589 -0.286838 1.12711 -0.961743 -0.2389 1.12085 -0.942715 -0.19112 1.11419 -0.922461 -0.143576 1.10714 -0.900943 -0.096359 1.0997 -0.878121 -0.0495721 1.0919 -0.85396 -0.00333084 1.08376 -0.828426 --0.0422408 1.0753 -0.801489 --0.0870111 1.06659 -0.773122 --0.130842 1.05768 -0.743301 -4.7159 1.87684 -1.67161 -3.74958 1.82421 -1.69522 -3.21222 1.7581 -1.73222 -2.77596 1.72205 -1.74826 -2.43417 1.70083 -1.75269 -2.16762 1.68679 -1.75151 -1.95765 1.67634 -1.74779 -1.78948 1.6678 -1.74303 -1.65219 1.66048 -1.73787 -1.53774 1.65411 -1.73248 -1.43978 1.64854 -1.72685 -1.35267 1.64351 -1.72087 -1.27183 1.63885 -1.71433 -1.19426 1.63479 -1.70682 -1.11842 1.63085 -1.6984 -1.04403 1.62682 -1.68914 -0.970811 1.62259 -1.67903 -0.898493 1.61809 -1.66803 -0.826875 1.61326 -1.65613 -0.755803 1.60806 -1.64329 -0.685157 1.60245 -1.62947 -0.61485 1.5964 -1.61463 -0.544811 1.5899 -1.59872 -0.474987 1.58292 -1.58168 -0.405337 1.57548 -1.56346 -0.335828 1.56755 -1.54399 -0.266436 1.55913 -1.52321 -0.197145 1.55022 -1.50106 -0.127952 1.54079 -1.47744 -0.0588664 1.53084 -1.4523 --0.0100863 1.52034 -1.42556 --0.0788618 1.50929 -1.39714 --0.147396 1.49768 -1.36699 --0.215603 1.4855 -1.33501 --0.283376 1.47276 -1.30116 --0.350589 1.45949 -1.26536 --0.417098 1.44571 -1.22755 --0.482739 1.43148 -1.18766 --0.547336 1.41686 -1.14564 --0.610695 1.40191 -1.10143 -4.7159 2.66391 -2.74256 -3.83151 2.63668 -2.73759 -3.38635 2.59461 -2.74106 -3.00601 2.56427 -2.73996 -2.69009 2.54215 -2.73483 -2.42792 2.52523 -2.72697 -2.20782 2.51155 -2.71746 -2.02003 2.49989 -2.70703 -1.85704 2.48958 -2.69606 -1.71313 2.48027 -2.68471 -1.58367 2.47171 -2.67299 -1.46442 2.46364 -2.66081 -1.35175 2.45587 -2.64795 -1.24315 2.44849 -2.63409 -1.13716 2.44111 -2.61925 -1.03328 2.43358 -2.60347 -0.931012 2.42579 -2.58675 -0.829917 2.41764 -2.56904 -0.729634 2.40906 -2.5503 -0.62986 2.39999 -2.53046 -0.530344 2.39037 -2.50946 -0.430882 2.38014 -2.48722 -0.331305 2.36924 -2.46363 -0.23148 2.35763 -2.43861 -0.131297 2.34527 -2.41203 -0.0306751 2.33212 -2.38378 --0.0704447 2.31813 -2.3537 --0.172098 2.30327 -2.32167 --0.274295 2.28748 -2.28754 --0.377021 2.27074 -2.25114 --0.480234 2.25301 -2.21233 --0.583858 2.23425 -2.17094 --0.687786 2.21444 -2.1268 --0.791875 2.19356 -2.07976 --0.895947 2.17163 -2.02966 --0.999786 2.14865 -1.97634 --1.10314 2.12467 -1.91965 --1.20572 2.09975 -1.85943 --1.30721 2.07397 -1.79556 --1.40725 2.04744 -1.72791 -4.7159 3.96649 -4.49975 -3.59053 3.964 -4.47353 -2.75804 3.96151 -4.44731 -2.14926 3.95903 -4.4211 -1.7103 3.95654 -4.39488 -1.39919 3.95405 -4.36867 -1.18326 3.95156 -4.34245 -1.03705 3.94907 -4.31623 -0.940737 3.94658 -4.29002 -0.878887 3.9441 -4.2638 -0.839476 3.94161 -4.23759 -0.813139 3.93912 -4.21137 -0.792586 3.93663 -4.18515 -0.772562 3.93414 -4.15894 -0.750489 3.93165 -4.13272 -0.724527 3.92916 -4.10651 -0.693058 3.92668 -4.08029 -0.65467 3.92419 -4.05407 -0.608155 3.9217 -4.02786 -0.552493 3.91921 -4.00164 -0.486849 3.91672 -3.97543 -0.410556 3.91422 -3.94921 -0.323116 3.91116 -3.92299 -0.224199 3.90701 -3.89678 -0.113636 3.90142 -3.87056 --0.00858836 3.89397 -3.84394 --0.142325 3.88425 -3.81591 --0.287262 3.87186 -3.78605 --0.442937 3.85642 -3.75388 --0.608743 3.83759 -3.7189 --0.783935 3.8151 -3.68054 --0.967642 3.78875 -3.63821 --1.15888 3.75844 -3.59128 --1.35655 3.72417 -3.5391 --1.55949 3.68602 -3.48101 --1.76644 3.64423 -3.41632 --1.97611 3.59908 -3.34438 --2.18715 3.551 -3.26455 --2.3982 3.50045 -3.17623 --2.60788 3.44801 -3.07886 -0.875651 0.743301 -0.000863472 -0.869377 0.744109 -0.00172839 -0.862812 0.744938 -0.00261682 -0.855844 0.745803 -0.00354546 -0.84838 0.74671 -0.00452112 -0.840342 0.747656 -0.00554145 -0.831675 0.748638 -0.0066015 -0.822339 0.749647 -0.00769474 -0.812311 0.750677 -0.00881485 -0.801588 0.751724 -0.00995664 -0.790179 0.752782 -0.0111162 -0.778108 0.753848 -0.0122907 -0.765412 0.754919 -0.0134764 -0.752135 0.755987 -0.0146662 -0.738332 0.757039 -0.0158476 -0.724059 0.758059 -0.0170015 -0.709381 0.759021 -0.0181017 -0.694362 0.759898 -0.0191171 -0.679073 0.760659 -0.0200149 -0.663587 0.761277 -0.0207646 -0.647984 0.761733 -0.0213425 -0.632351 0.762016 -0.0217345 -0.616778 0.762124 -0.0219379 -0.601361 0.762068 -0.0219604 -0.586196 0.761865 -0.0218177 -0.571381 0.761534 -0.0215298 -0.557009 0.761095 -0.0211172 -4.7159 0.74251 -1.7168e-05 -3.42126 0.742499 -2.5103e-05 -2.52005 0.742498 -2.3232e-05 -1.90654 0.742498 -2.2469e-05 -1.50019 0.742497 -2.2266e-05 -1.24002 0.742497 -2.2453e-05 -1.0803 0.742497 -2.2621e-05 -0.987204 0.742496 -2.2123e-05 -0.936148 0.742495 -2.1207e-05 -0.909754 0.742495 -2.0603e-05 -0.896255 0.742494 -2.0377e-05 -0.888257 0.742494 -2.0298e-05 -0.881771 0.742496 -2.0219e-05 -0.875654 0.743301 -0.000883478 -0.86938 0.744108 -0.00174834 -0.862815 0.744937 -0.00263676 -0.855847 0.745802 -0.00356543 -0.848382 0.746709 -0.00454113 -0.840345 0.747655 -0.00556154 -0.831677 0.748637 -0.00662166 -0.822341 0.749646 -0.007715 -0.812313 0.750676 -0.0088352 -0.80159 0.751723 -0.00997707 -0.790181 0.752781 -0.0111367 -0.77811 0.753847 -0.0123113 -0.765413 0.754918 -0.0134971 -0.752137 0.755985 -0.0146869 -0.738333 0.757038 -0.0158684 -0.724061 0.758058 -0.0170223 -0.709382 0.75902 -0.0181225 -0.694363 0.759897 -0.019138 -0.679073 0.760657 -0.0200358 -0.663587 0.761276 -0.0207855 -0.647985 0.761732 -0.0213633 -0.632351 0.762014 -0.0217554 -0.616778 0.762123 -0.0219587 -0.601361 0.762067 -0.0219812 -0.586196 0.761864 -0.0218385 -0.571381 0.761532 -0.0215505 -0.557008 0.761094 -0.0211378 -4.7159 0.742526 -4.5683e-05 -3.42127 0.742498 -6.9783e-05 -2.52006 0.742497 -6.5044e-05 -1.90655 0.742496 -6.3027e-05 -1.5002 0.742496 -6.2519e-05 -1.24002 0.742496 -6.3137e-05 -1.0803 0.742495 -6.3814e-05 -0.987207 0.742494 -6.2701e-05 -0.936151 0.742493 -6.038e-05 -0.909756 0.742493 -5.8857e-05 -0.896256 0.742493 -5.8353e-05 -0.888257 0.742494 -5.8289e-05 -0.881774 0.742499 -5.8805e-05 -0.875659 0.7433 -0.000920928 -0.869384 0.744107 -0.00178555 -0.862819 0.744935 -0.00267387 -0.855851 0.7458 -0.00360251 -0.848386 0.746707 -0.00457824 -0.840349 0.747653 -0.00559871 -0.831681 0.748634 -0.00665893 -0.822345 0.749644 -0.00775237 -0.812317 0.750674 -0.00887267 -0.801593 0.751721 -0.0100146 -0.790184 0.752779 -0.0111744 -0.778113 0.753845 -0.0123491 -0.765416 0.754916 -0.0135348 -0.75214 0.755984 -0.0147247 -0.738336 0.757036 -0.0159062 -0.724063 0.758056 -0.01706 -0.709384 0.759018 -0.0181602 -0.694365 0.759895 -0.0191757 -0.679075 0.760655 -0.0200734 -0.663589 0.761274 -0.020823 -0.647986 0.76173 -0.0214008 -0.632352 0.762012 -0.0217927 -0.616778 0.762121 -0.0219959 -0.60136 0.762065 -0.0220183 -0.586195 0.761861 -0.0218754 -0.57138 0.76153 -0.0215872 -0.557007 0.761091 -0.0211743 -4.7159 0.742556 -9.3029e-05 -3.42128 0.742497 -0.000149653 -2.52008 0.742494 -0.000140541 -1.90657 0.742493 -0.000136468 -1.50021 0.742493 -0.000135507 -1.24003 0.742494 -0.000137017 -1.08031 0.742494 -0.000138793 -0.987214 0.742492 -0.000136859 -0.936156 0.74249 -0.000132391 -0.90976 0.74249 -0.000129576 -0.896259 0.742491 -0.000128861 -0.888258 0.742494 -0.000129141 -0.881779 0.742505 -0.000132085 -0.875668 0.743299 -0.000990796 -0.869393 0.744104 -0.00185472 -0.862828 0.744932 -0.0027427 -0.85586 0.745796 -0.00367115 -0.848395 0.746703 -0.00464679 -0.840356 0.747649 -0.00566725 -0.831689 0.74863 -0.0067275 -0.822352 0.74964 -0.00782101 -0.812324 0.75067 -0.0089414 -0.8016 0.751717 -0.0100834 -0.79019 0.752775 -0.0112432 -0.778119 0.753842 -0.0124179 -0.765422 0.754912 -0.0136036 -0.752145 0.75598 -0.0147934 -0.738341 0.757033 -0.0159748 -0.724068 0.758052 -0.0171285 -0.709388 0.759014 -0.0182285 -0.694369 0.759891 -0.0192437 -0.679078 0.760652 -0.0201412 -0.663591 0.76127 -0.0208905 -0.647987 0.761726 -0.021468 -0.632353 0.762008 -0.0218595 -0.616778 0.762117 -0.0220624 -0.60136 0.762061 -0.0220843 -0.586194 0.761857 -0.021941 -0.571378 0.761526 -0.0216523 -0.557005 0.761087 -0.0212389 -4.7159 0.742609 -0.00017149 -3.42131 0.742495 -0.000292262 -2.52011 0.742489 -0.000276623 -1.9066 0.742487 -0.000269204 -1.50023 0.742489 -0.000267601 -1.24005 0.742491 -0.000270869 -1.08033 0.74249 -0.000274768 -0.987227 0.742487 -0.000271684 -0.936166 0.742484 -0.000264018 -0.909769 0.742484 -0.000259594 -0.896265 0.742487 -0.000259072 -0.88826 0.742493 -0.000260584 -0.881789 0.742517 -0.000270179 -0.875684 0.743297 -0.00112047 -0.86941 0.7441 -0.00198262 -0.862844 0.744926 -0.00286969 -0.855875 0.74579 -0.00379754 -0.848409 0.746696 -0.00477276 -0.840371 0.747642 -0.00579295 -0.831702 0.748624 -0.00685304 -0.822364 0.749633 -0.00794646 -0.812336 0.750664 -0.00906678 -0.801611 0.75171 -0.0102087 -0.790201 0.752769 -0.0113684 -0.778129 0.753835 -0.0125429 -0.765432 0.754906 -0.0137284 -0.752154 0.755974 -0.0149178 -0.738349 0.757027 -0.0160987 -0.724076 0.758046 -0.0172519 -0.709396 0.759008 -0.0183513 -0.694375 0.759884 -0.0193658 -0.679083 0.760645 -0.0202626 -0.663595 0.761264 -0.0210111 -0.64799 0.76172 -0.0215878 -0.632354 0.762002 -0.0219785 -0.616779 0.76211 -0.0221805 -0.601359 0.762054 -0.0222015 -0.586192 0.76185 -0.0220571 -0.571375 0.761519 -0.0217673 -0.557001 0.761079 -0.0213526 -4.7159 0.742699 -0.000301218 -3.42135 0.742491 -0.00054553 -2.52016 0.74248 -0.000520503 -1.90665 0.742478 -0.000507711 -1.50028 0.742481 -0.00050526 -1.24009 0.742485 -0.000511886 -1.08035 0.742485 -0.00051969 -0.987249 0.742479 -0.00051501 -0.936185 0.742474 -0.000502852 -0.909785 0.742474 -0.000496926 -0.896276 0.74248 -0.000497828 -0.888265 0.742492 -0.000502693 -0.881809 0.742537 -0.000527435 -0.875714 0.743294 -0.00135945 -0.86944 0.744092 -0.00221749 -0.862873 0.744917 -0.00310233 -0.855903 0.745779 -0.00402861 -0.848436 0.746685 -0.00500261 -0.840396 0.74763 -0.00602187 -0.831726 0.748612 -0.00708125 -0.822387 0.749621 -0.00817408 -0.812357 0.750652 -0.0092939 -0.801632 0.751699 -0.0104353 -0.79022 0.752758 -0.0115944 -0.778148 0.753825 -0.0127682 -0.765449 0.754896 -0.0139529 -0.752171 0.755963 -0.0151413 -0.738365 0.757016 -0.016321 -0.72409 0.758035 -0.0174728 -0.709408 0.758997 -0.0185706 -0.694386 0.759874 -0.0195835 -0.679092 0.760634 -0.0204785 -0.663602 0.761253 -0.0212253 -0.647995 0.761709 -0.0218001 -0.632357 0.761991 -0.022189 -0.616779 0.762099 -0.022389 -0.601357 0.762043 -0.0224079 -0.586189 0.761839 -0.0222613 -0.57137 0.761507 -0.021969 -0.556994 0.761067 -0.0215515 -4.7159 0.742854 -0.000515282 -3.42143 0.742486 -0.00099145 -2.52026 0.742465 -0.000953714 -1.90674 0.742461 -0.000932461 -1.50035 0.742466 -0.000929023 -1.24015 0.742474 -0.000941887 -1.0804 0.742476 -0.000956661 -0.98729 0.742466 -0.000950007 -0.936219 0.742456 -0.000932279 -0.909816 0.742456 -0.000926257 -0.8963 0.742469 -0.000931662 -0.888277 0.742491 -0.000944546 -0.881845 0.74257 -0.000999012 -0.875769 0.74329 -0.00179591 -0.869493 0.744079 -0.00264493 -0.862925 0.7449 -0.00352476 -0.855953 0.74576 -0.00444736 -0.848484 0.746664 -0.00541835 -0.840442 0.74761 -0.00643515 -0.83177 0.748591 -0.00749246 -0.822428 0.7496 -0.00858353 -0.812396 0.750632 -0.00970172 -0.801668 0.751679 -0.0108416 -0.790255 0.752739 -0.011999 -0.77818 0.753806 -0.0131709 -0.76548 0.754877 -0.0143534 -0.7522 0.755946 -0.0155393 -0.738392 0.756998 -0.0167161 -0.724115 0.758018 -0.0178647 -0.709431 0.758979 -0.0189591 -0.694405 0.759855 -0.0199683 -0.679108 0.760616 -0.0208595 -0.663614 0.761234 -0.0216024 -0.648003 0.76169 -0.0221732 -0.63236 0.761973 -0.022558 -0.616779 0.762081 -0.0227539 -0.601353 0.762025 -0.0227684 -0.586182 0.76182 -0.0226171 -0.57136 0.761487 -0.0223197 -0.556982 0.761046 -0.0218965 -4.7159 0.743115 -0.000867949 -3.42156 0.742476 -0.00176779 -2.52043 0.742439 -0.00171451 -1.90689 0.742433 -0.00168026 -1.50048 0.742442 -0.00167596 -1.24025 0.742457 -0.0017001 -1.08049 0.74246 -0.00172707 -0.987364 0.742443 -0.00171878 -0.936287 0.742425 -0.00169598 -0.909879 0.742427 -0.0016945 -0.896352 0.74245 -0.00171128 -0.88831 0.742491 -0.00174169 -0.881915 0.742619 -0.00184554 -0.875865 0.743284 -0.0025841 -0.869589 0.744057 -0.0034144 -0.863017 0.744871 -0.00428358 -0.856041 0.745728 -0.00519815 -0.848568 0.74663 -0.00616237 -0.840522 0.747574 -0.00717339 -0.831845 0.748555 -0.00822569 -0.8225 0.749565 -0.00931228 -0.812463 0.750597 -0.0104263 -0.801732 0.751646 -0.0115622 -0.790315 0.752706 -0.0127154 -0.778237 0.753775 -0.0138828 -0.765534 0.754847 -0.0150603 -0.75225 0.755915 -0.0162406 -0.738439 0.756968 -0.0174111 -0.724158 0.757988 -0.0185528 -0.709469 0.758949 -0.0196398 -0.694438 0.759825 -0.0206412 -0.679135 0.760586 -0.0215244 -0.663634 0.761204 -0.0222592 -0.648015 0.76166 -0.0228219 -0.632366 0.761943 -0.0231984 -0.616778 0.762051 -0.0233858 -0.601346 0.761995 -0.0233915 -0.586168 0.761789 -0.0232308 -0.571342 0.761455 -0.0229232 -0.556959 0.761013 -0.0224887 -4.7159 0.743555 -0.00144828 -3.42178 0.742463 -0.00310125 -2.52073 0.742397 -0.00303262 -1.90716 0.742385 -0.00297901 -1.50071 0.742402 -0.00297459 -1.24044 0.742429 -0.0030186 -1.08065 0.742436 -0.00306657 -0.987505 0.742407 -0.00305948 -0.936421 0.742375 -0.00303694 -0.910015 0.742379 -0.0030516 -0.896471 0.74242 -0.00309373 -0.8884 0.742494 -0.00315896 -0.882049 0.742677 -0.00332914 -0.876035 0.743277 -0.00398753 -0.869758 0.744022 -0.00478164 -0.863178 0.744824 -0.00562929 -0.856195 0.745674 -0.00652736 -0.848714 0.746572 -0.00747738 -0.840659 0.747515 -0.00847594 -0.831975 0.748495 -0.0095171 -0.822622 0.749506 -0.0105935 -0.812578 0.75054 -0.0116981 -0.80184 0.751591 -0.0128247 -0.790416 0.752653 -0.0139685 -0.778332 0.753723 -0.0151261 -0.765623 0.754797 -0.0162927 -0.752334 0.755866 -0.017461 -0.738517 0.756919 -0.0186185 -0.724228 0.757939 -0.019746 -0.709531 0.7589 -0.0208179 -0.694491 0.759776 -0.0218036 -0.679177 0.760537 -0.0226708 -0.663664 0.761155 -0.0233893 -0.648034 0.761611 -0.0239358 -0.632372 0.761894 -0.024296 -0.616772 0.762003 -0.0244668 -0.60133 0.761946 -0.0244554 -0.586143 0.761741 -0.0242764 -0.571307 0.761405 -0.0239491 -0.556916 0.76096 -0.023493 -4.7159 0.744292 -0.00240242 -3.42216 0.742448 -0.00535638 -2.52123 0.74233 -0.00528114 -1.90763 0.74231 -0.00519976 -1.5011 0.74234 -0.00519737 -1.24078 0.742387 -0.00527532 -1.08095 0.7424 -0.00535907 -0.987779 0.74235 -0.00536261 -0.936699 0.742296 -0.00535729 -0.910308 0.742304 -0.00541302 -0.896743 0.742375 -0.00550592 -0.888629 0.742496 -0.00563113 -0.882311 0.742731 -0.0058697 -0.87633 0.743268 -0.00644081 -0.870051 0.743971 -0.00717317 -0.863457 0.744751 -0.00798018 -0.856458 0.745589 -0.00884626 -0.848961 0.74648 -0.0097683 -0.840891 0.747419 -0.0107417 -0.832192 0.748399 -0.0117598 -0.822824 0.749411 -0.0128148 -0.812767 0.750448 -0.0138991 -0.802017 0.751502 -0.0150059 -0.790582 0.752568 -0.0161299 -0.778487 0.753641 -0.0172666 -0.765768 0.754717 -0.018411 -0.752468 0.755788 -0.0195553 -0.73864 0.756842 -0.0206866 -0.724339 0.757862 -0.0217862 -0.709627 0.758823 -0.0228286 -0.69457 0.759699 -0.0237837 -0.679238 0.76046 -0.0246198 -0.663706 0.761079 -0.0253072 -0.648055 0.761536 -0.0258225 -0.632373 0.76182 -0.0261516 -0.616754 0.761929 -0.0262909 -0.601293 0.761872 -0.0262468 -0.586089 0.761665 -0.0260335 -0.571239 0.761327 -0.0256693 -0.556835 0.760878 -0.0251729 -4.7159 0.745522 -0.00397025 -3.42279 0.742447 -0.00910434 -2.52208 0.742236 -0.00905104 -1.90843 0.7422 -0.00893173 -1.50179 0.74225 -0.00893604 -1.24138 0.742332 -0.00907017 -1.0815 0.742354 -0.00921448 -0.988323 0.74227 -0.0092533 -0.937286 0.74218 -0.00930572 -0.910945 0.742195 -0.00944902 -0.897351 0.74231 -0.00963112 -0.889171 0.742486 -0.00983958 -0.882839 0.742757 -0.010132 -0.876855 0.743247 -0.0106284 -0.870558 0.743898 -0.011275 -0.863935 0.744644 -0.0120138 -0.856902 0.745462 -0.0128226 -0.849373 0.746341 -0.0136931 -0.841273 0.747274 -0.0146188 -0.832545 0.748252 -0.0155922 -0.823151 0.749266 -0.0166048 -0.81307 0.750306 -0.0176483 -0.802296 0.751366 -0.0187152 -0.790841 0.752438 -0.019799 -0.778727 0.753516 -0.0208943 -0.765989 0.754597 -0.021995 -0.752671 0.755671 -0.0230926 -0.738822 0.756727 -0.024174 -0.724499 0.757747 -0.0252205 -0.709762 0.758709 -0.0262074 -0.694677 0.759585 -0.0271054 -0.679315 0.760346 -0.0278835 -0.66375 0.760966 -0.0285127 -0.648065 0.761424 -0.0289702 -0.63235 0.761709 -0.0292414 -0.616698 0.761819 -0.0293223 -0.601207 0.761763 -0.0292181 -0.585976 0.761554 -0.0289417 -0.5711 0.761213 -0.0285099 -0.556673 0.760758 -0.0279404 -4.7159 0.74757 -0.00654547 -3.42382 0.742503 -0.0152144 -2.52351 0.742128 -0.0152529 -1.90978 0.742063 -0.015085 -1.503 0.742146 -0.0151049 -1.24247 0.742281 -0.0153289 -1.08255 0.742316 -0.0155751 -0.98943 0.742177 -0.0157046 -0.93853 0.742033 -0.0158954 -0.912295 0.742057 -0.0161988 -0.898648 0.742218 -0.0165119 -0.89034 0.742439 -0.0168105 -0.883897 0.742728 -0.0171398 -0.877826 0.743192 -0.0175828 -0.871456 0.743796 -0.0181381 -0.864759 0.744502 -0.0187824 -0.857654 0.745291 -0.0195012 -0.850057 0.746152 -0.0202856 -0.841894 0.747075 -0.021128 -0.833109 0.74805 -0.0220204 -0.823663 0.749065 -0.0229543 -0.813534 0.750111 -0.0239207 -0.802718 0.751178 -0.0249112 -0.791223 0.752258 -0.0259182 -0.779072 0.753345 -0.0269346 -0.7663 0.754432 -0.0279529 -0.752947 0.755511 -0.0289636 -0.739062 0.756571 -0.0299532 -0.724701 0.757593 -0.0309031 -0.709921 0.758556 -0.0317894 -0.69479 0.759432 -0.0325842 -0.679376 0.760194 -0.0332579 -0.663758 0.760815 -0.0337825 -0.648018 0.761275 -0.0341356 -0.632249 0.761562 -0.0343026 -0.616544 0.761674 -0.034278 -0.601003 0.761617 -0.0340657 -0.585725 0.761406 -0.0336763 -0.570807 0.761059 -0.0331243 -0.55634 0.760596 -0.0324254 -4.7159 0.750973 -0.0107743 -3.42548 0.742746 -0.024968 -2.52587 0.742078 -0.0252477 -1.91209 0.741964 -0.0250235 -1.50511 0.742093 -0.0250743 -1.24447 0.742309 -0.0254363 -1.0846 0.742359 -0.0258521 -0.991686 0.742132 -0.0261805 -0.9411 0.741911 -0.0266419 -0.915015 0.741932 -0.0271918 -0.901231 0.742115 -0.0276637 -0.892669 0.742353 -0.0280476 -0.885969 0.742646 -0.028407 -0.879665 0.743098 -0.0288172 -0.873098 0.743674 -0.029295 -0.866224 0.744348 -0.0298358 -0.858957 0.745109 -0.0304372 -0.851212 0.745949 -0.0310963 -0.842915 0.746858 -0.0318087 -0.834009 0.747827 -0.0325681 -0.824455 0.748843 -0.0333673 -0.814229 0.749895 -0.0341979 -0.803325 0.750971 -0.0350513 -0.791751 0.752062 -0.0359191 -0.779528 0.753161 -0.0367928 -0.766687 0.754258 -0.0376632 -0.753267 0.755345 -0.0385195 -0.739316 0.756409 -0.0393474 -0.724884 0.757434 -0.0401286 -0.710031 0.758398 -0.0408403 -0.694821 0.759274 -0.0414563 -0.679324 0.760036 -0.0419488 -0.663619 0.760658 -0.0422916 -0.647791 0.761119 -0.0424626 -0.631933 0.761407 -0.042447 -0.616142 0.761519 -0.0422377 -0.600519 0.76146 -0.041836 -0.585163 0.761244 -0.0412491 -0.570171 0.760889 -0.0404885 -0.555634 0.760413 -0.0395669 -4.7159 0.756624 -0.0177174 -3.42812 0.743504 -0.0401892 -2.52976 0.742315 -0.0410051 -1.91599 0.742115 -0.040726 -1.50884 0.742311 -0.0408309 -1.24819 0.742639 -0.0413942 -1.08858 0.742699 -0.0420852 -0.99619 0.742347 -0.0427894 -0.946138 0.742016 -0.0436876 -0.920138 0.741989 -0.0445563 -0.906022 0.742147 -0.045204 -0.897002 0.742368 -0.0456783 -0.889842 0.74265 -0.0460764 -0.883104 0.743095 -0.0464743 -0.876135 0.74366 -0.0468958 -0.868891 0.74432 -0.0473417 -0.861284 0.745066 -0.0478155 -0.853227 0.745892 -0.0483198 -0.844646 0.746792 -0.0488553 -0.835484 0.747756 -0.0494207 -0.825699 0.748772 -0.0500125 -0.815266 0.749829 -0.0506254 -0.804176 0.750914 -0.0512528 -0.792434 0.752016 -0.051887 -0.780058 0.753126 -0.0525191 -0.767075 0.754233 -0.0531391 -0.75352 0.755327 -0.0537351 -0.739437 0.756396 -0.0542923 -0.724875 0.757421 -0.0547928 -0.709889 0.758383 -0.0552149 -0.694542 0.759257 -0.0555344 -0.678905 0.760015 -0.0557258 -0.663056 0.760632 -0.0557645 -0.647084 0.761089 -0.0556293 -0.631082 0.761373 -0.0553045 -0.61515 0.761479 -0.0547812 -0.599388 0.761412 -0.054057 -0.583898 0.761183 -0.053135 -0.568777 0.760811 -0.0520223 -0.554113 0.760312 -0.0507277 -4.7159 0.766 -0.0291159 -3.43225 0.745554 -0.0633822 -2.5361 0.743455 -0.0652804 -1.92262 0.743108 -0.0649683 -1.51546 0.743386 -0.0651576 -1.25508 0.74386 -0.0659946 -1.09617 0.743918 -0.0671043 -1.00477 0.743407 -0.0684017 -0.955325 0.742927 -0.069873 -0.929121 0.742789 -0.0711052 -0.914339 0.742867 -0.0719575 -0.904566 0.743039 -0.0725504 -0.896673 0.743292 -0.0730137 -0.889226 0.743727 -0.0734263 -0.881572 0.74429 -0.0738159 -0.87367 0.744949 -0.0741835 -0.865437 0.745695 -0.0745327 -0.856788 0.746521 -0.0748678 -0.847653 0.74742 -0.0751923 -0.837977 0.748383 -0.0755087 -0.827719 0.749399 -0.0758181 -0.816855 0.750456 -0.0761203 -0.805372 0.751542 -0.0764129 -0.793272 0.752646 -0.0766912 -0.780569 0.753756 -0.0769489 -0.767283 0.754862 -0.0771769 -0.753446 0.755952 -0.0773638 -0.739096 0.757013 -0.0774955 -0.724275 0.758026 -0.0775547 -0.709037 0.758973 -0.0775213 -0.693441 0.759827 -0.077373 -0.677556 0.760564 -0.0770863 -0.66146 0.76116 -0.0766385 -0.645241 0.761594 -0.0760089 -0.628993 0.761853 -0.0751809 -0.612818 0.761933 -0.074143 -0.596816 0.761837 -0.0728887 -0.581087 0.761575 -0.0714163 -0.565729 0.761163 -0.0697278 -0.550828 0.760619 -0.0678278 -4.7159 0.78155 -0.047828 -3.43861 0.750612 -0.0978734 -2.54642 0.746958 -0.101808 -1.93386 0.746362 -0.101525 -1.52718 0.746729 -0.101829 -1.26766 0.747368 -0.102998 -1.11013 0.747414 -0.104665 -1.02002 0.746748 -0.106702 -0.97083 0.746098 -0.108774 -0.943831 0.745806 -0.110382 -0.927883 0.745774 -0.111472 -0.91694 0.745875 -0.112221 -0.907931 0.746086 -0.112785 -0.8994 0.746509 -0.113243 -0.890677 0.74707 -0.113628 -0.881724 0.747734 -0.113937 -0.872462 0.748485 -0.114172 -0.862814 0.749313 -0.114337 -0.852714 0.75021 -0.114432 -0.842116 0.751166 -0.114463 -0.830984 0.752168 -0.114433 -0.819297 0.753206 -0.114344 -0.807045 0.754267 -0.114199 -0.79423 0.75534 -0.113998 -0.78086 0.756415 -0.113737 -0.766955 0.757481 -0.11341 -0.752539 0.758525 -0.11301 -0.737642 0.759535 -0.112524 -0.722305 0.760491 -0.111937 -0.706571 0.761375 -0.111231 -0.690496 0.762163 -0.110386 -0.674144 0.76283 -0.10938 -0.657591 0.763352 -0.108192 -0.640922 0.76371 -0.106801 -0.624229 0.763891 -0.10519 -0.607611 0.763889 -0.103345 -0.591168 0.763707 -0.101255 -0.574998 0.763354 -0.0989133 -0.559195 0.762845 -0.0963175 -0.543844 0.762198 -0.0934674 -4.7159 0.807332 -0.0785459 -3.44831 0.762238 -0.147993 -2.56311 0.755991 -0.155547 -1.95286 0.754974 -0.15543 -1.54766 0.755399 -0.155863 -1.28995 0.756192 -0.157355 -1.13436 0.756235 -0.159595 -1.04518 0.755475 -0.162291 -0.995227 0.754692 -0.164835 -0.966484 0.754261 -0.166758 -0.948626 0.754122 -0.168073 -0.935895 0.754154 -0.168985 -0.925209 0.754321 -0.169658 -0.915051 0.754738 -0.170169 -0.904713 0.755305 -0.170552 -0.894161 0.755975 -0.170804 -0.883316 0.756727 -0.170925 -0.872105 0.757548 -0.170911 -0.860471 0.758424 -0.170764 -0.848373 0.759343 -0.170486 -0.835784 0.760293 -0.170078 -0.82269 0.761261 -0.169544 -0.809087 0.762237 -0.168886 -0.794981 0.763209 -0.168106 -0.780382 0.764168 -0.167202 -0.765309 0.765105 -0.166173 -0.749783 0.766008 -0.165011 -0.733831 0.766865 -0.163707 -0.717486 0.767659 -0.162248 -0.700788 0.76837 -0.160619 -0.683785 0.768977 -0.158802 -0.666535 0.769455 -0.156777 -0.649107 0.769782 -0.154524 -0.631581 0.76994 -0.152023 -0.614043 0.769915 -0.149255 -0.596586 0.769702 -0.146203 -0.579307 0.769303 -0.142855 -0.562299 0.768727 -0.1392 -0.545653 0.767987 -0.13523 -0.529451 0.767102 -0.130943 -4.7159 0.850068 -0.128973 -3.46298 0.78742 -0.219432 -2.59007 0.776878 -0.233102 -1.98476 0.775136 -0.233439 -1.58274 0.775494 -0.233976 -1.32779 0.776347 -0.235637 -1.17385 0.776394 -0.238195 -1.08405 0.775626 -0.241182 -1.03157 0.774784 -0.243901 -0.999665 0.774257 -0.245964 -0.97877 0.774035 -0.247402 -0.963293 0.774007 -0.248407 -0.950058 0.774134 -0.249131 -0.937437 0.774556 -0.249631 -0.92466 0.775135 -0.249946 -0.911691 0.775809 -0.250073 -0.898452 0.776549 -0.250007 -0.884868 0.777336 -0.249746 -0.870884 0.778152 -0.249285 -0.856466 0.778981 -0.248624 -0.841594 0.779809 -0.247761 -0.82626 0.780621 -0.246696 -0.810468 0.781409 -0.245428 -0.794228 0.782162 -0.243957 -0.777556 0.782872 -0.24228 -0.760471 0.783531 -0.240391 -0.742997 0.78413 -0.238284 -0.725159 0.784659 -0.235948 -0.706988 0.785102 -0.233371 -0.688518 0.785441 -0.230537 -0.669793 0.785656 -0.227429 -0.650866 0.785725 -0.224027 -0.631797 0.785627 -0.220311 -0.61266 0.785345 -0.216261 -0.593534 0.784867 -0.211858 -0.574505 0.784188 -0.207083 -0.555664 0.783311 -0.201922 -0.5371 0.782245 -0.196361 -0.518899 0.781004 -0.190391 -0.501142 0.779607 -0.184006 -4.7159 0.920901 -0.211756 -3.48531 0.839292 -0.320128 -2.63373 0.821467 -0.343672 -2.038 0.81837 -0.34509 -1.64148 0.818314 -0.345663 -1.38939 0.818945 -0.34713 -1.23502 0.818878 -0.349448 -1.14162 0.818087 -0.352141 -1.08396 0.817186 -0.354601 -1.04676 0.816556 -0.356502 -1.02106 0.816229 -0.357842 -1.0013 0.816112 -0.35876 -0.984105 0.816166 -0.359368 -0.967669 0.816568 -0.359676 -0.951131 0.81713 -0.359729 -0.93445 0.817766 -0.359529 -0.917539 0.818438 -0.359072 -0.90032 0.819118 -0.358351 -0.882736 0.819782 -0.35736 -0.864753 0.82041 -0.356094 -0.846355 0.820985 -0.354548 -0.827538 0.821492 -0.352716 -0.80831 0.821921 -0.350595 -0.788687 0.822264 -0.348176 -0.768686 0.822513 -0.345451 -0.748331 0.822662 -0.34241 -0.727645 0.822705 -0.339041 -0.706655 0.822632 -0.335326 -0.685389 0.822431 -0.33125 -0.663881 0.822084 -0.326794 -0.642172 0.821574 -0.321936 -0.620309 0.82088 -0.316654 -0.59835 0.819984 -0.310928 -0.576364 0.81887 -0.304734 -0.554425 0.81753 -0.298052 -0.532616 0.81596 -0.290863 -0.511024 0.814166 -0.283149 -0.489737 0.81216 -0.274898 -0.468841 0.809958 -0.266097 -0.448421 0.807584 -0.256739 -4.7159 1.03829 -0.34766 -3.51972 0.941439 -0.46274 -2.7048 0.911103 -0.501033 -2.1265 0.905158 -0.504976 -1.73788 0.903833 -0.505597 -1.48673 0.903594 -0.506353 -1.32753 0.902988 -0.507698 -1.22589 0.901882 -0.509403 -1.15907 0.900708 -0.511045 -1.11322 0.899796 -0.512331 -1.07983 0.899204 -0.513192 -1.05321 0.898844 -0.513681 -1.02965 0.898673 -0.513838 -1.00711 0.898916 -0.513592 -0.984588 0.89931 -0.512996 -0.962027 0.899743 -0.512064 -0.939325 0.900162 -0.510792 -0.91639 0.900528 -0.509173 -0.893158 0.900811 -0.507198 -0.86959 0.900986 -0.504858 -0.845668 0.901032 -0.502142 -0.821389 0.900934 -0.49904 -0.796759 0.900679 -0.495539 -0.771796 0.900261 -0.491625 -0.746517 0.899673 -0.487282 -0.720947 0.898913 -0.48249 -0.695108 0.897974 -0.477228 -0.669027 0.89685 -0.471474 -0.642732 0.895528 -0.465203 -0.616256 0.893994 -0.458388 -0.589639 0.892231 -0.451005 -0.562928 0.890222 -0.443026 -0.536181 0.88795 -0.434427 -0.509466 0.885405 -0.425182 -0.482859 0.88258 -0.415269 -0.456446 0.879478 -0.404667 -0.430315 0.87611 -0.393358 -0.40456 0.872495 -0.381326 -0.379273 0.868657 -0.36856 -0.354548 0.864626 -0.355052 -4.7159 1.23283 -0.57078 -3.57308 1.13316 -0.671892 -2.81955 1.08367 -0.727407 -2.27131 1.07132 -0.736898 -1.89289 1.06679 -0.738194 -1.6384 1.0644 -0.737931 -1.46768 1.06233 -0.73766 -1.35112 1.06019 -0.737676 -1.26911 1.05816 -0.737816 -1.20921 1.05647 -0.73784 -1.16324 1.05516 -0.737614 -1.12526 1.05414 -0.73709 -1.09115 1.05334 -0.736209 -1.05849 1.05303 -0.73477 -1.02611 1.05285 -0.732848 -0.993917 1.05265 -0.730478 -0.961777 1.05236 -0.727657 -0.929573 1.05194 -0.724377 -0.89722 1.05134 -0.720626 -0.864665 1.05053 -0.716387 -0.831878 1.04948 -0.711647 -0.79885 1.04819 -0.706386 -0.765581 1.04663 -0.700584 -0.732081 1.04481 -0.694216 -0.698366 1.04271 -0.687258 -0.664455 1.04034 -0.679679 -0.63037 1.03769 -0.67145 -0.596132 1.03476 -0.662538 -0.561769 1.03153 -0.65291 -0.527314 1.028 -0.642532 -0.492807 1.02415 -0.631374 -0.458298 1.01997 -0.619404 -0.423847 1.01544 -0.606591 -0.389528 1.01056 -0.592909 -0.355422 1.00534 -0.578333 -0.321621 0.999772 -0.562837 -0.288226 0.99389 -0.546404 -0.255338 0.98772 -0.529012 -0.223065 0.981299 -0.510649 -0.191514 0.974671 -0.491303 -4.7159 1.55521 -0.937101 -3.65241 1.47246 -1.00212 -2.99431 1.40438 -1.06341 -2.49448 1.37972 -1.08125 -2.13069 1.36815 -1.08525 -1.8692 1.36115 -1.08473 -1.67994 1.35586 -1.08288 -1.54035 1.3513 -1.08083 -1.43477 1.34725 -1.07883 -1.35253 1.34376 -1.07682 -1.28601 1.3408 -1.07467 -1.22909 1.33824 -1.07226 -1.17718 1.33594 -1.06943 -1.12747 1.33421 -1.06582 -1.07856 1.33257 -1.06153 -1.03031 1.33085 -1.05665 -0.982516 1.32894 -1.05116 -0.935015 1.32679 -1.04505 -0.88768 1.32434 -1.03831 -0.840423 1.32156 -1.03092 -0.79319 1.31842 -1.02285 -0.745945 1.3149 -1.01408 -0.698671 1.31098 -1.00457 -0.651362 1.30666 -0.994301 -0.604017 1.30193 -0.983221 -0.556643 1.29681 -0.971294 -0.50925 1.29127 -0.958478 -0.461852 1.28533 -0.944729 -0.414471 1.27897 -0.930004 -0.367135 1.27218 -0.91426 -0.319883 1.26496 -0.897457 -0.272767 1.25729 -0.879555 -0.22585 1.24916 -0.860516 -0.179213 1.24058 -0.840307 -0.132947 1.23156 -0.818895 -0.0871576 1.22212 -0.796247 -0.0419575 1.21229 -0.772335 --0.00253097 1.20211 -0.747131 --0.0461804 1.19164 -0.720611 --0.0888587 1.18094 -0.692753 -4.7159 2.08943 -1.53855 -3.75258 2.0368 -1.56217 -3.21871 1.97071 -1.60054 -2.78649 1.93436 -1.61824 -2.44776 1.91258 -1.62405 -2.1833 1.89787 -1.62393 -1.97476 1.88675 -1.62106 -1.80764 1.87757 -1.61702 -1.67118 1.86962 -1.6125 -1.55746 1.86262 -1.60771 -1.46018 1.85641 -1.60263 -1.37373 1.85073 -1.59717 -1.2935 1.84539 -1.59112 -1.21648 1.84065 -1.58399 -1.14114 1.83597 -1.57595 -1.06722 1.83113 -1.56709 -0.994448 1.82602 -1.5574 -0.922566 1.82056 -1.54689 -0.851381 1.81469 -1.53552 -0.780743 1.80835 -1.52327 -0.710542 1.80151 -1.5101 -0.640693 1.79414 -1.49598 -0.571134 1.78623 -1.48085 -0.501818 1.77775 -1.46468 -0.432709 1.76871 -1.44741 -0.363783 1.75909 -1.42896 -0.295024 1.74888 -1.4093 -0.226423 1.73809 -1.38834 -0.157985 1.72668 -1.36604 -0.089727 1.71466 -1.34231 -0.0216817 1.70201 -1.31711 --0.0461006 1.68872 -1.29037 --0.11355 1.67478 -1.26203 --0.180577 1.66019 -1.23204 --0.247073 1.64498 -1.20033 --0.31291 1.62917 -1.16686 --0.377944 1.6128 -1.13157 --0.442018 1.59594 -1.0944 --0.504959 1.57865 -1.05532 --0.566584 1.56103 -1.01428 -4.7159 2.97467 -2.5261 -3.83441 2.94683 -2.52151 -3.39161 2.90408 -2.52576 -3.01425 2.87286 -2.52562 -2.70103 2.84971 -2.52144 -2.44102 2.8317 -2.51446 -2.22259 2.8169 -2.50576 -2.03609 2.80413 -2.49607 -1.87411 2.7927 -2.48581 -1.73103 2.78225 -2.47513 -1.60227 2.77253 -2.46407 -1.48364 2.76329 -2.45253 -1.37151 2.7543 -2.44031 -1.26337 2.74566 -2.42701 -1.15776 2.73696 -2.41275 -1.0542 2.72801 -2.39758 -0.952207 2.71871 -2.3815 -0.851367 2.70896 -2.36449 -0.751324 2.69868 -2.34651 -0.651788 2.6878 -2.32751 -0.552522 2.67624 -2.30742 -0.453333 2.66396 -2.28618 -0.354064 2.65089 -2.2637 -0.254592 2.63698 -2.23988 -0.154822 2.62218 -2.21461 -0.0546852 2.60644 -2.18779 --0.0458653 2.58973 -2.1593 --0.146851 2.57199 -2.12899 --0.24827 2.55318 -2.09675 --0.350094 2.53327 -2.06242 --0.452266 2.51221 -2.02588 --0.554698 2.48999 -1.98698 --0.657271 2.46658 -1.94558 --0.759831 2.44197 -1.90155 --0.86219 2.41617 -1.85474 --0.964125 2.38923 -1.80503 --1.06538 2.36119 -1.75229 --1.16568 2.33214 -1.6964 --1.26469 2.30217 -1.63725 --1.36208 2.27143 -1.57474 -4.7159 4.44159 -4.14768 -3.59438 4.4379 -4.12174 -2.76515 4.43422 -4.09579 -2.15916 4.43054 -4.06985 -1.72266 4.42685 -4.0439 -1.41375 4.42317 -4.01796 -1.19982 4.41948 -3.99201 -1.05547 4.4158 -3.96607 -0.960911 4.41212 -3.94013 -0.90075 4.40843 -3.91418 -0.862982 4.40475 -3.88824 -0.838262 4.40107 -3.86229 -0.819314 4.39738 -3.83635 -0.800875 4.3937 -3.8104 -0.780287 4.39001 -3.78446 -0.755629 4.38633 -3.75852 -0.725215 4.38265 -3.73257 -0.68759 4.37896 -3.70663 -0.641513 4.37528 -3.68068 -0.58595 4.37159 -3.65474 -0.520063 4.36791 -3.6288 -0.443199 4.36421 -3.60285 -0.354883 4.35987 -3.57691 -0.254822 4.35429 -3.55096 -0.142898 4.34706 -3.52502 -0.019156 4.33771 -3.49871 --0.116184 4.32576 -3.47116 --0.262734 4.31076 -3.44197 --0.419947 4.29227 -3.41074 --0.587126 4.26991 -3.377 --0.763435 4.24337 -3.34026 --0.947911 4.21242 -3.29999 --1.13948 4.17694 -3.25564 --1.33697 4.13692 -3.20662 --1.53913 4.09249 -3.15233 --1.74466 4.04389 -3.09219 --1.95222 3.99145 -3.02561 --2.16042 3.93566 -2.952 --2.3679 3.87705 -2.87085 --2.5733 3.81628 -2.78166 -0.892165 0.801325 -0.000831013 -0.886153 0.802196 -0.00166332 -0.879863 0.803089 -0.00251813 -0.873187 0.804022 -0.00341151 -0.866036 0.805 -0.00434999 -0.858336 0.806021 -0.0053313 -0.850033 0.807079 -0.00635065 -0.841089 0.808167 -0.00740176 -0.831482 0.809278 -0.00847852 -0.821208 0.810406 -0.00957593 -0.810277 0.811547 -0.0106902 -0.798712 0.812697 -0.0118188 -0.786547 0.813851 -0.0129578 -0.773827 0.815002 -0.0141006 -0.760602 0.816138 -0.0152351 -0.746927 0.817237 -0.0163431 -0.732861 0.818275 -0.0173993 -0.718466 0.81922 -0.0183741 -0.703808 0.82004 -0.0192358 -0.688956 0.820707 -0.0199553 -0.673985 0.821199 -0.0205099 -0.658976 0.821503 -0.0208861 -0.644017 0.82162 -0.0210814 -0.629199 0.82156 -0.0211031 -0.614615 0.821341 -0.0209663 -0.600359 0.820984 -0.0206902 -0.586522 0.820511 -0.0202944 -4.7159 0.800476 -1.5878e-05 -3.42589 0.800464 -2.4888e-05 -2.52802 0.800462 -2.3015e-05 -1.91691 0.800461 -2.2257e-05 -1.51226 0.800461 -2.2047e-05 -1.25328 0.80046 -2.2214e-05 -1.0944 0.800459 -2.2437e-05 -1.00191 0.800458 -2.2067e-05 -0.951295 0.800457 -2.1208e-05 -0.925239 0.800456 -2.0598e-05 -0.912021 0.800456 -2.0363e-05 -0.904274 0.800455 -2.0279e-05 -0.898029 0.800457 -2.0166e-05 -0.892167 0.801325 -0.000851 -0.886155 0.802195 -0.00168325 -0.879865 0.803089 -0.00253805 -0.87319 0.804021 -0.00343146 -0.866039 0.804999 -0.00436999 -0.858339 0.80602 -0.00535138 -0.850035 0.807078 -0.00637081 -0.841091 0.808166 -0.007422 -0.831484 0.809277 -0.00849885 -0.82121 0.810405 -0.00959636 -0.810279 0.811546 -0.0107107 -0.798714 0.812696 -0.0118393 -0.786549 0.81385 -0.0129784 -0.773829 0.815002 -0.0141212 -0.760603 0.816137 -0.0152559 -0.746928 0.817236 -0.0163638 -0.732862 0.818274 -0.0174201 -0.718468 0.819219 -0.0183949 -0.703809 0.820039 -0.0192566 -0.688957 0.820706 -0.0199761 -0.673985 0.821198 -0.0205307 -0.658976 0.821502 -0.0209069 -0.644017 0.821619 -0.0211021 -0.629198 0.821559 -0.0211238 -0.614614 0.82134 -0.020987 -0.600359 0.820983 -0.0207109 -0.586521 0.82051 -0.020315 -4.7159 0.800494 -4.2123e-05 -3.4259 0.800463 -6.9013e-05 -2.52803 0.800461 -6.4268e-05 -1.91692 0.80046 -6.2268e-05 -1.51226 0.800459 -6.1734e-05 -1.25328 0.800459 -6.2279e-05 -1.09441 0.800458 -6.3085e-05 -1.00191 0.800457 -6.2321e-05 -0.951298 0.800455 -6.0169e-05 -0.925242 0.800455 -5.864e-05 -0.912022 0.800455 -5.8116e-05 -0.904275 0.800455 -5.804e-05 -0.898032 0.800461 -5.8468e-05 -0.892172 0.801324 -0.000888223 -0.88616 0.802194 -0.00172024 -0.87987 0.803087 -0.00257495 -0.873194 0.804019 -0.00346834 -0.866043 0.804997 -0.00440689 -0.858343 0.806018 -0.00538835 -0.850039 0.807076 -0.00640786 -0.841095 0.808164 -0.00745916 -0.831488 0.809275 -0.00853612 -0.821214 0.810404 -0.00963371 -0.810282 0.811545 -0.0107482 -0.798717 0.812694 -0.0118769 -0.786552 0.813849 -0.013016 -0.773831 0.815 -0.0141588 -0.760606 0.816135 -0.0152934 -0.746931 0.817234 -0.0164014 -0.732865 0.818272 -0.0174576 -0.718469 0.819217 -0.0184323 -0.703811 0.820037 -0.019294 -0.688958 0.820704 -0.0200134 -0.673986 0.821196 -0.0205679 -0.658977 0.821501 -0.0209441 -0.644017 0.821618 -0.0211392 -0.629198 0.821558 -0.0211607 -0.614614 0.821338 -0.0210238 -0.600358 0.820981 -0.0207474 -0.58652 0.820508 -0.0203514 -4.7159 0.800527 -8.5426e-05 -3.42591 0.800462 -0.000147557 -2.52805 0.800458 -0.000138431 -1.91694 0.800457 -0.000134403 -1.51228 0.800456 -0.00013338 -1.2533 0.800457 -0.000134708 -1.09442 0.800456 -0.000136725 -1.00192 0.800455 -0.000135525 -0.951303 0.800453 -0.000131424 -0.925246 0.800452 -0.000128606 -0.912026 0.800453 -0.000127854 -0.904275 0.800455 -0.000128107 -0.898037 0.800468 -0.000130862 -0.892181 0.801324 -0.00095732 -0.886169 0.802192 -0.00178865 -0.879879 0.803085 -0.00264303 -0.873203 0.804016 -0.00353624 -0.866051 0.804994 -0.00447472 -0.858351 0.806015 -0.00545616 -0.850047 0.807073 -0.00647572 -0.841101 0.808161 -0.00752709 -0.831494 0.809272 -0.00860412 -0.82122 0.810401 -0.00970178 -0.810288 0.811542 -0.0108163 -0.798722 0.812692 -0.011945 -0.786557 0.813846 -0.013084 -0.773837 0.814997 -0.0142268 -0.760611 0.816132 -0.0153613 -0.746935 0.817232 -0.0164691 -0.732869 0.818269 -0.0175251 -0.718473 0.819214 -0.0184996 -0.703814 0.820035 -0.019361 -0.68896 0.820701 -0.0200802 -0.673988 0.821193 -0.0206344 -0.658978 0.821498 -0.0210102 -0.644017 0.821615 -0.021205 -0.629198 0.821555 -0.0212262 -0.614613 0.821335 -0.0210888 -0.600356 0.820978 -0.020812 -0.586518 0.820505 -0.0204154 -4.7159 0.800585 -0.000156772 -3.42594 0.800459 -0.000287188 -2.52808 0.800453 -0.000271518 -1.91697 0.800451 -0.000264199 -1.5123 0.800452 -0.000262461 -1.25331 0.800453 -0.000265342 -1.09443 0.800453 -0.00026968 -1.00193 0.800451 -0.000267986 -0.951313 0.800447 -0.000261013 -0.925255 0.800447 -0.000256591 -0.912031 0.80045 -0.000255998 -0.904277 0.800456 -0.000257449 -0.898047 0.800481 -0.000266643 -0.892197 0.801323 -0.00108493 -0.886185 0.802189 -0.00191453 -0.879894 0.80308 -0.00276802 -0.873218 0.804011 -0.00366065 -0.866066 0.804989 -0.00459873 -0.858365 0.806009 -0.00557991 -0.85006 0.807067 -0.00659933 -0.841114 0.808155 -0.00765061 -0.831506 0.809267 -0.00872758 -0.821231 0.810395 -0.00982516 -0.810299 0.811536 -0.0109396 -0.798732 0.812687 -0.0120681 -0.786567 0.813841 -0.0132069 -0.773846 0.814992 -0.0143493 -0.760619 0.816127 -0.0154834 -0.746943 0.817227 -0.0165906 -0.732876 0.818264 -0.0176461 -0.718479 0.819209 -0.0186199 -0.703819 0.82003 -0.0194807 -0.688964 0.820697 -0.0201991 -0.673991 0.821188 -0.0207525 -0.658979 0.821493 -0.0211276 -0.644018 0.82161 -0.0213215 -0.629197 0.82155 -0.0213418 -0.614611 0.82133 -0.0212035 -0.600353 0.820973 -0.0209256 -0.586514 0.8205 -0.0205279 -4.7159 0.800683 -0.000274196 -3.42598 0.800456 -0.000534087 -2.52814 0.800444 -0.00050898 -1.91702 0.800441 -0.000496399 -1.51234 0.800443 -0.000493672 -1.25335 0.800447 -0.000499539 -1.09446 0.800448 -0.000508139 -1.00196 0.800444 -0.000505951 -0.951332 0.800438 -0.00049499 -0.92527 0.800438 -0.000489044 -0.912043 0.800444 -0.000489803 -0.904282 0.800457 -0.000494517 -0.898067 0.800505 -0.000518397 -0.892227 0.801322 -0.00131896 -0.886215 0.802183 -0.00214456 -0.879923 0.803072 -0.00299589 -0.873245 0.804002 -0.003887 -0.866092 0.804979 -0.0048239 -0.85839 0.805999 -0.0058042 -0.850084 0.807057 -0.00682293 -0.841137 0.808145 -0.00787366 -0.831527 0.809257 -0.00895015 -0.821251 0.810386 -0.0100472 -0.810318 0.811528 -0.0111611 -0.798751 0.812678 -0.0122889 -0.786584 0.813833 -0.0134269 -0.773862 0.814984 -0.0145684 -0.760634 0.816119 -0.0157013 -0.746957 0.817218 -0.0168073 -0.732888 0.818256 -0.0178612 -0.71849 0.819201 -0.0188335 -0.703828 0.820021 -0.0196926 -0.688971 0.820688 -0.0204094 -0.673995 0.82118 -0.0209611 -0.658982 0.821484 -0.0213344 -0.644018 0.821602 -0.0215266 -0.629195 0.821542 -0.0215449 -0.614607 0.821322 -0.0214045 -0.600348 0.820964 -0.0211244 -0.586507 0.820491 -0.020724 -4.7159 0.800851 -0.000467307 -3.42605 0.80045 -0.000966947 -2.52823 0.800429 -0.000928974 -1.91711 0.800424 -0.000908139 -1.51242 0.800429 -0.000904154 -1.25341 0.800436 -0.000915613 -1.09451 0.800439 -0.000931823 -1.002 0.800432 -0.000929448 -0.951367 0.800423 -0.000913622 -0.925302 0.800423 -0.000907476 -0.912067 0.800436 -0.000912567 -0.904294 0.800459 -0.000925074 -0.898103 0.800544 -0.000977711 -0.89228 0.801321 -0.00174431 -0.886267 0.802173 -0.00256116 -0.879974 0.803058 -0.00340765 -0.873294 0.803987 -0.00429521 -0.866139 0.804962 -0.00522922 -0.858434 0.805982 -0.00620716 -0.850126 0.80704 -0.00722392 -0.841177 0.808129 -0.00827297 -0.831565 0.809241 -0.00934792 -0.821287 0.810371 -0.0104435 -0.810352 0.811513 -0.0115558 -0.798783 0.812664 -0.0126818 -0.786614 0.813819 -0.0138178 -0.773891 0.81497 -0.0149569 -0.760661 0.816105 -0.0160871 -0.746982 0.817205 -0.01719 -0.73291 0.818242 -0.0182407 -0.718509 0.819187 -0.0192096 -0.703843 0.820007 -0.0200651 -0.688983 0.820674 -0.0207782 -0.674003 0.821166 -0.0213263 -0.658986 0.821471 -0.0216958 -0.644018 0.821588 -0.0218841 -0.629192 0.821528 -0.0218985 -0.614601 0.821308 -0.0217538 -0.600338 0.82095 -0.0214688 -0.586495 0.820476 -0.0210632 -4.7159 0.801136 -0.000784726 -3.42618 0.80044 -0.00171744 -2.5284 0.800403 -0.00166349 -1.91726 0.800396 -0.00163002 -1.51255 0.800404 -0.00162466 -1.25351 0.800418 -0.00164631 -1.0946 0.800425 -0.00167582 -1.00207 0.800413 -0.00167456 -0.951433 0.800396 -0.00165451 -0.925365 0.800398 -0.00165257 -0.912119 0.800422 -0.00166864 -0.904328 0.800466 -0.00169813 -0.898172 0.800602 -0.00179838 -0.892374 0.801321 -0.00250881 -0.886361 0.802157 -0.00330757 -0.880064 0.803036 -0.00414378 -0.87338 0.803961 -0.00502363 -0.866221 0.804935 -0.00595114 -0.858512 0.805953 -0.00692357 -0.8502 0.807011 -0.00793555 -0.841246 0.808101 -0.00898035 -0.831631 0.809214 -0.0100514 -0.821349 0.810345 -0.0111432 -0.81041 0.811488 -0.0122515 -0.798838 0.81264 -0.0133734 -0.786667 0.813796 -0.0145046 -0.773939 0.814948 -0.0156384 -0.760707 0.816083 -0.0167627 -0.747023 0.817182 -0.0178591 -0.732947 0.818219 -0.0189029 -0.718541 0.819164 -0.0198645 -0.703869 0.819984 -0.0207125 -0.689002 0.820652 -0.0214181 -0.674015 0.821144 -0.0219587 -0.658991 0.821449 -0.0223207 -0.644017 0.821567 -0.0225012 -0.629184 0.821507 -0.0225075 -0.614588 0.821287 -0.0223542 -0.600321 0.820929 -0.0220598 -0.586473 0.820453 -0.0216437 -4.7159 0.801615 -0.00130629 -3.4264 0.800428 -0.00300144 -2.5287 0.800361 -0.00293096 -1.91753 0.800349 -0.00287873 -1.51277 0.800364 -0.00287235 -1.2537 0.80039 -0.00291205 -1.09476 0.800403 -0.0029644 -1.00221 0.800383 -0.00296823 -0.951565 0.800355 -0.00294916 -0.925498 0.800359 -0.00296251 -0.912237 0.800401 -0.00300303 -0.904417 0.800479 -0.00306614 -0.898304 0.800676 -0.00323013 -0.892539 0.801327 -0.00386367 -0.886525 0.802134 -0.00462764 -0.88022 0.803001 -0.00544317 -0.873529 0.80392 -0.0063072 -0.866362 0.80489 -0.00722115 -0.858645 0.805907 -0.00818171 -0.850325 0.806965 -0.00918311 -0.841364 0.808055 -0.0102183 -0.831742 0.80917 -0.0112804 -0.821453 0.810303 -0.0123635 -0.810508 0.811448 -0.0134631 -0.79893 0.812601 -0.0145756 -0.786753 0.813759 -0.0156967 -0.774021 0.814911 -0.0168194 -0.760782 0.816047 -0.0179314 -0.747091 0.817146 -0.0190146 -0.733007 0.818183 -0.0200443 -0.718591 0.819128 -0.0209913 -0.703909 0.819949 -0.0218245 -0.689031 0.820617 -0.0225151 -0.674033 0.82111 -0.0230408 -0.658997 0.821416 -0.0233879 -0.644011 0.821534 -0.0235533 -0.629168 0.821475 -0.0235439 -0.614562 0.821255 -0.023374 -0.600287 0.820895 -0.0230615 -0.586431 0.820418 -0.0226254 -4.7159 0.802416 -0.00216309 -3.42678 0.800416 -0.0051648 -2.5292 0.800299 -0.00508488 -1.91799 0.800276 -0.00500584 -1.51317 0.800303 -0.00499985 -1.25403 0.800349 -0.00507059 -1.09505 0.800372 -0.00516148 -1.00248 0.800339 -0.00518082 -0.951837 0.800292 -0.0051788 -0.925785 0.8003 -0.00523124 -0.912503 0.800375 -0.00532066 -0.904642 0.800504 -0.00544151 -0.898561 0.800756 -0.00567116 -0.892826 0.801341 -0.00622123 -0.886808 0.802105 -0.00692612 -0.88049 0.802951 -0.00770277 -0.873783 0.803858 -0.00853627 -0.866601 0.804822 -0.00942359 -0.858869 0.805836 -0.0103602 -0.850535 0.806893 -0.0113398 -0.84156 0.807985 -0.0123548 -0.831924 0.809102 -0.0133979 -0.821623 0.810238 -0.0144625 -0.810667 0.811387 -0.0155435 -0.799079 0.812543 -0.0166366 -0.786892 0.813703 -0.0177371 -0.77415 0.814857 -0.0188373 -0.7609 0.815993 -0.0199252 -0.747197 0.817093 -0.0209824 -0.733099 0.81813 -0.0219847 -0.718667 0.819075 -0.0229034 -0.703967 0.819896 -0.0237079 -0.68907 0.820565 -0.02437 -0.674052 0.821059 -0.0248671 -0.658997 0.821367 -0.0251858 -0.643992 0.821486 -0.0253226 -0.629132 0.821428 -0.0252837 -0.61451 0.821207 -0.0250824 -0.60022 0.820847 -0.0247361 -0.586351 0.820367 -0.0242628 -4.7159 0.803755 -0.00357043 -3.42739 0.800424 -0.00874754 -2.53004 0.800215 -0.00868324 -1.91878 0.800176 -0.00856766 -1.51385 0.800221 -0.00856556 -1.25462 0.8003 -0.00868797 -1.09559 0.80034 -0.00884299 -1.00301 0.800285 -0.00890229 -0.952407 0.800207 -0.00895543 -0.926403 0.800226 -0.00909146 -0.913096 0.800347 -0.00926673 -0.90517 0.800536 -0.00946763 -0.899074 0.800827 -0.00974918 -0.893335 0.801365 -0.0102278 -0.887299 0.802075 -0.0108509 -0.880951 0.802888 -0.0115626 -0.874212 0.803775 -0.0123416 -0.866998 0.804728 -0.0131801 -0.859237 0.805737 -0.0140716 -0.850874 0.806793 -0.015009 -0.841874 0.807886 -0.0159842 -0.832214 0.809007 -0.0169891 -0.821892 0.810148 -0.0180164 -0.810916 0.811302 -0.0190601 -0.799308 0.812463 -0.0201149 -0.787104 0.813626 -0.0211748 -0.774343 0.814783 -0.0222319 -0.761073 0.815921 -0.0232735 -0.747349 0.817021 -0.0242817 -0.733227 0.818059 -0.0252328 -0.718769 0.819004 -0.0260988 -0.704039 0.819826 -0.0268502 -0.68911 0.820496 -0.027459 -0.67406 0.820992 -0.0279035 -0.658972 0.821302 -0.0281697 -0.643936 0.821424 -0.0282536 -0.629046 0.821366 -0.0281601 -0.614397 0.821146 -0.0279015 -0.600083 0.820783 -0.0274935 -0.586192 0.820299 -0.0269529 -4.7159 0.805984 -0.00588188 -3.4284 0.800507 -0.014569 -2.53145 0.800137 -0.014583 -1.92012 0.800068 -0.0144209 -1.51503 0.800141 -0.0144297 -1.25569 0.800272 -0.014635 -1.09661 0.800339 -0.0148953 -1.00408 0.800246 -0.0150467 -0.953606 0.800125 -0.0152308 -0.927708 0.800158 -0.0155201 -0.914352 0.800332 -0.0158216 -0.906303 0.800571 -0.0161094 -0.900099 0.800884 -0.0164268 -0.894274 0.801397 -0.0168543 -0.888166 0.802061 -0.0173903 -0.881746 0.802833 -0.0180122 -0.874937 0.803693 -0.018706 -0.867657 0.804627 -0.0194631 -0.859835 0.805626 -0.0202761 -0.851417 0.806679 -0.0211375 -0.842366 0.807773 -0.022039 -0.83266 0.808899 -0.0229719 -0.822296 0.810047 -0.0239282 -0.811281 0.811208 -0.0249007 -0.799639 0.812377 -0.0258825 -0.7874 0.813546 -0.0268665 -0.774605 0.814707 -0.0278435 -0.761301 0.815847 -0.0288005 -0.74754 0.816948 -0.0297199 -0.733376 0.817986 -0.0305787 -0.718872 0.818932 -0.0313502 -0.704094 0.819754 -0.032006 -0.689113 0.820426 -0.0325196 -0.67401 0.820924 -0.0328694 -0.658869 0.821237 -0.0330412 -0.643782 0.821361 -0.0330299 -0.628844 0.821305 -0.0328387 -0.61415 0.821084 -0.0324775 -0.599794 0.820718 -0.0319598 -0.585864 0.820228 -0.0313003 -4.7159 0.809692 -0.00967816 -3.43002 0.80082 -0.0238332 -2.53377 0.800166 -0.0240619 -1.92238 0.800045 -0.0238459 -1.51709 0.80016 -0.0238781 -1.25763 0.800371 -0.0242109 -1.09858 0.800472 -0.024641 -1.00625 0.800323 -0.0249838 -0.956074 0.800141 -0.0254239 -0.930327 0.800183 -0.0259505 -0.916843 0.800391 -0.0264055 -0.908549 0.800654 -0.0267758 -0.902097 0.800977 -0.0271225 -0.896048 0.801479 -0.0275184 -0.889749 0.802117 -0.0279805 -0.883158 0.802857 -0.028504 -0.876192 0.803689 -0.0290867 -0.868769 0.804602 -0.0297256 -0.860818 0.805588 -0.0304164 -0.852284 0.806634 -0.0311532 -0.843128 0.807728 -0.0319289 -0.833329 0.808858 -0.0327355 -0.82288 0.810013 -0.0335648 -0.811788 0.811183 -0.0344087 -0.800075 0.81236 -0.035259 -0.78777 0.813537 -0.036107 -0.77491 0.814703 -0.0369422 -0.761541 0.815846 -0.037751 -0.747711 0.816948 -0.0385158 -0.733476 0.817984 -0.039215 -0.718895 0.818928 -0.0398234 -0.704036 0.81975 -0.0403145 -0.688971 0.820422 -0.0406631 -0.673781 0.820921 -0.0408483 -0.658555 0.821235 -0.0408554 -0.643385 0.82136 -0.0406775 -0.628366 0.821304 -0.0403153 -0.613596 0.82108 -0.0397752 -0.599168 0.820707 -0.0390673 -0.585169 0.820206 -0.0382032 -4.7159 0.815854 -0.0159131 -3.43259 0.801756 -0.0382481 -2.53758 0.800603 -0.0389634 -1.92621 0.800394 -0.0386955 -1.52074 0.800566 -0.0387705 -1.26124 0.800892 -0.0392886 -1.10241 0.801037 -0.0399848 -1.01056 0.800808 -0.0406802 -0.960903 0.800547 -0.0415358 -0.935254 0.800565 -0.0423715 -0.921455 0.800763 -0.0429973 -0.91272 0.801018 -0.043455 -0.905826 0.801337 -0.0438393 -0.899358 0.801837 -0.044223 -0.892674 0.802467 -0.0446308 -0.885728 0.803195 -0.0450638 -0.878436 0.804012 -0.0455254 -0.870714 0.804911 -0.0460183 -0.862491 0.805885 -0.046543 -0.85371 0.806924 -0.0470983 -0.844332 0.808015 -0.0476808 -0.834334 0.809146 -0.0482853 -0.823705 0.810305 -0.0489056 -0.812452 0.81148 -0.0495341 -0.80059 0.812663 -0.0501624 -0.788147 0.813844 -0.0507807 -0.775156 0.815011 -0.0513777 -0.761659 0.816153 -0.0519392 -0.747701 0.81725 -0.0524479 -0.733336 0.81828 -0.0528834 -0.718622 0.819217 -0.0532224 -0.703625 0.82003 -0.0534406 -0.68842 0.820694 -0.0535144 -0.67309 0.821187 -0.0534234 -0.657722 0.821494 -0.0531523 -0.642413 0.821613 -0.0526917 -0.62726 0.821547 -0.0520386 -0.612358 0.821311 -0.0511948 -0.597802 0.820922 -0.0501659 -0.583678 0.8204 -0.0489591 -4.7159 0.826089 -0.0261532 -3.43662 0.804233 -0.060146 -2.54381 0.802221 -0.0618586 -1.93272 0.801862 -0.0615616 -1.5272 0.802108 -0.0617048 -1.2679 0.802589 -0.0624726 -1.10971 0.802787 -0.0635608 -1.01878 0.802466 -0.0648088 -0.969725 0.802107 -0.0662159 -0.943899 0.802049 -0.0674068 -0.929465 0.802187 -0.0682318 -0.920006 0.802407 -0.0688046 -0.912407 0.802707 -0.069252 -0.905259 0.803206 -0.0696486 -0.897918 0.803839 -0.0700246 -0.890343 0.80457 -0.0703819 -0.882451 0.805387 -0.0707247 -0.874162 0.806284 -0.0710573 -0.865409 0.807253 -0.0713833 -0.856136 0.808284 -0.0717053 -0.846307 0.809367 -0.0720247 -0.835894 0.810489 -0.072341 -0.824889 0.811639 -0.0726518 -0.813291 0.812806 -0.0729527 -0.801114 0.813978 -0.0732372 -0.788378 0.815145 -0.0734968 -0.775114 0.816296 -0.0737202 -0.761356 0.817417 -0.0738938 -0.747147 0.81849 -0.0740011 -0.732534 0.819492 -0.0740231 -0.717576 0.820398 -0.0739385 -0.702336 0.82118 -0.0737248 -0.686887 0.821812 -0.07336 -0.671314 0.822273 -0.0728241 -0.655705 0.822549 -0.0721003 -0.640156 0.822634 -0.0711765 -0.624764 0.822534 -0.0700448 -0.609627 0.822259 -0.0687018 -0.594836 0.821826 -0.0671473 -0.580475 0.821254 -0.0653833 -4.7159 0.843081 -0.0429722 -3.44284 0.810263 -0.0925938 -2.55396 0.806806 -0.0962136 -1.94376 0.806198 -0.0959514 -1.53864 0.806526 -0.0961888 -1.28009 0.807199 -0.0972548 -1.12314 0.807465 -0.0988523 -1.03345 0.807076 -0.100794 -0.984677 0.806619 -0.10279 -0.958108 0.806451 -0.104352 -0.942555 0.806506 -0.105411 -0.931971 0.806674 -0.106137 -0.9233 0.806944 -0.106682 -0.91511 0.807443 -0.107121 -0.906743 0.808083 -0.107489 -0.898159 0.808823 -0.107788 -0.889282 0.809646 -0.10802 -0.880036 0.810542 -0.108189 -0.870359 0.811502 -0.108299 -0.860205 0.812515 -0.108352 -0.849538 0.813571 -0.108354 -0.838339 0.814657 -0.108307 -0.826597 0.815764 -0.108213 -0.814313 0.816879 -0.108072 -0.801496 0.817994 -0.10788 -0.788163 0.819098 -0.107632 -0.774338 0.820179 -0.10732 -0.760051 0.821225 -0.106931 -0.745337 0.822215 -0.106452 -0.730241 0.82313 -0.105865 -0.714812 0.823945 -0.10515 -0.699114 0.824632 -0.104288 -0.683215 0.825168 -0.103256 -0.667196 0.82553 -0.102035 -0.651146 0.825707 -0.100607 -0.635158 0.825691 -0.0989544 -0.619328 0.825485 -0.0970662 -0.60375 0.825101 -0.0949324 -0.588515 0.824553 -0.092547 -0.573704 0.82386 -0.0899066 -4.7159 0.871282 -0.0705975 -3.45235 0.823972 -0.139501 -2.57042 0.818129 -0.146578 -1.96246 0.817112 -0.146494 -1.55867 0.817497 -0.146839 -1.30173 0.818371 -0.148189 -1.14658 0.818725 -0.150304 -1.05781 0.81834 -0.152879 -1.00836 0.817828 -0.15535 -0.980127 0.817572 -0.157233 -0.962732 0.817552 -0.158521 -0.950423 0.817671 -0.159411 -0.940137 0.817912 -0.160065 -0.930382 0.818417 -0.160552 -0.920461 0.819071 -0.160915 -0.910338 0.819819 -0.161156 -0.89994 0.820641 -0.161275 -0.889193 0.821522 -0.161272 -0.878043 0.822449 -0.16115 -0.866448 0.823409 -0.160912 -0.854384 0.82439 -0.160559 -0.841834 0.825381 -0.160097 -0.828795 0.826372 -0.159528 -0.815271 0.827353 -0.158853 -0.801272 0.828316 -0.158072 -0.786814 0.829252 -0.15718 -0.771918 0.830152 -0.156173 -0.756608 0.831002 -0.15504 -0.740916 0.831786 -0.15377 -0.724879 0.832483 -0.152346 -0.708543 0.833071 -0.150753 -0.691961 0.833523 -0.14897 -0.6752 0.833818 -0.146977 -0.658333 0.833934 -0.144754 -0.641445 0.833858 -0.142279 -0.624623 0.833586 -0.139535 -0.607959 0.833117 -0.136502 -0.591544 0.832463 -0.133167 -0.575464 0.831636 -0.129519 -0.559799 0.830655 -0.125548 -4.7159 0.918078 -0.115974 -3.46677 0.853333 -0.205813 -2.59707 0.843509 -0.218893 -1.99393 0.8418 -0.219292 -1.5931 0.84213 -0.219731 -1.33868 0.843113 -0.221222 -1.18508 0.843537 -0.223625 -1.09577 0.843212 -0.2265 -1.04391 0.842704 -0.22917 -1.01262 0.842396 -0.231213 -0.992285 0.842319 -0.232638 -0.977319 0.842395 -0.23363 -0.96457 0.842608 -0.234344 -0.952434 0.843124 -0.23482 -0.940155 0.84379 -0.235114 -0.927698 0.844537 -0.23523 -0.914986 0.845336 -0.235169 -0.901947 0.846165 -0.234928 -0.88853 0.847008 -0.234509 -0.874697 0.847848 -0.23391 -0.86043 0.848671 -0.233132 -0.845721 0.849467 -0.232178 -0.83057 0.850224 -0.231046 -0.814987 0.850935 -0.229736 -0.798985 0.851594 -0.228246 -0.782582 0.852194 -0.22657 -0.765799 0.852727 -0.224702 -0.74866 0.853181 -0.22263 -0.731191 0.853543 -0.220343 -0.713425 0.853795 -0.217826 -0.695403 0.853914 -0.215061 -0.677174 0.853878 -0.212029 -0.658796 0.853666 -0.208709 -0.640337 0.853258 -0.205079 -0.621874 0.852643 -0.201117 -0.603489 0.851815 -0.196799 -0.585268 0.850777 -0.192107 -0.567298 0.849537 -0.187022 -0.549662 0.84811 -0.181527 -0.53244 0.846514 -0.175611 -4.7159 0.995723 -0.190512 -3.48871 0.912951 -0.298128 -2.64029 0.896217 -0.321207 -2.04658 0.893231 -0.322762 -1.65098 0.893159 -0.323271 -1.39923 0.893929 -0.324586 -1.24522 0.894225 -0.326775 -1.15244 0.893866 -0.329399 -1.09554 0.893312 -0.331849 -1.05907 0.892916 -0.333763 -1.03405 0.892745 -0.335117 -1.01491 0.892735 -0.336045 -0.998311 0.892872 -0.336662 -0.982465 0.893358 -0.336956 -0.966527 0.893988 -0.336997 -0.95046 0.894672 -0.3368 -0.934178 0.895369 -0.336366 -0.917606 0.896051 -0.335691 -0.900689 0.896695 -0.334774 -0.883394 0.897282 -0.333612 -0.865702 0.897794 -0.332203 -0.847609 0.898219 -0.330543 -0.82912 0.898547 -0.328628 -0.810248 0.898771 -0.326451 -0.791009 0.898886 -0.324005 -0.771421 0.898887 -0.321279 -0.751506 0.898767 -0.31826 -0.731287 0.898518 -0.314933 -0.71079 0.898127 -0.311281 -0.690045 0.897577 -0.307285 -0.66909 0.89685 -0.302924 -0.647968 0.895923 -0.298175 -0.626736 0.894778 -0.293017 -0.605456 0.893398 -0.287424 -0.584201 0.891773 -0.281371 -0.563052 0.889901 -0.274836 -0.542092 0.887784 -0.267796 -0.521408 0.885436 -0.26023 -0.501084 0.882873 -0.252121 -0.481204 0.880117 -0.243456 -4.7159 1.12454 -0.312959 -3.52239 1.02823 -0.426949 -2.71048 0.999413 -0.465322 -2.13407 0.993733 -0.469585 -1.7462 0.992397 -0.470268 -1.49538 0.992222 -0.470983 -1.33669 0.991851 -0.472295 -1.23581 0.991063 -0.474007 -1.16988 0.990167 -0.475695 -1.1249 0.989449 -0.477044 -1.09231 0.98898 -0.477963 -1.06645 0.988696 -0.478506 -1.04362 0.988575 -0.478712 -1.02179 0.988857 -0.478481 -0.99999 0.989266 -0.477905 -0.97816 0.989684 -0.477014 -0.956205 0.990057 -0.475811 -0.934034 0.990348 -0.474295 -0.911585 0.990527 -0.472461 -0.888819 0.990569 -0.470304 -0.865715 0.990453 -0.467815 -0.842269 0.990166 -0.464987 -0.818484 0.989696 -0.461808 -0.794373 0.989038 -0.458264 -0.769951 0.988187 -0.454338 -0.745237 0.987139 -0.450012 -0.720252 0.985889 -0.445264 -0.695018 0.984429 -0.440071 -0.669559 0.982748 -0.434409 -0.643906 0.98083 -0.428252 -0.618095 0.978658 -0.421574 -0.592171 0.976214 -0.414348 -0.566189 0.973479 -0.406549 -0.540214 0.970442 -0.398149 -0.514323 0.967097 -0.389123 -0.488598 0.963446 -0.379446 -0.463127 0.959499 -0.369097 -0.438005 0.955277 -0.358053 -0.413323 0.950804 -0.3463 -0.389175 0.946111 -0.333823 -4.7159 1.33826 -0.514116 -3.57445 1.24063 -0.61391 -2.82316 1.19328 -0.670169 -2.27674 1.18149 -0.680331 -1.89922 1.17698 -0.681967 -1.64536 1.17452 -0.681897 -1.4754 1.17248 -0.681775 -1.35979 1.17045 -0.681932 -1.27881 1.16853 -0.682222 -1.21991 1.16691 -0.6824 -1.1749 1.16563 -0.682319 -1.13785 1.1646 -0.681935 -1.10463 1.16375 -0.681186 -1.07283 1.16338 -0.679836 -1.04131 1.1631 -0.678014 -1.00998 1.16277 -0.675773 -0.978722 1.1623 -0.673123 -0.94741 1.16167 -0.67006 -0.915964 1.16081 -0.666578 -0.884331 1.15971 -0.662666 -0.852477 1.15834 -0.658312 -0.820389 1.15668 -0.653498 -0.788066 1.15472 -0.648206 -0.755512 1.15246 -0.642412 -0.72274 1.14989 -0.636089 -0.689764 1.14701 -0.629208 -0.656602 1.14381 -0.621739 -0.623274 1.14029 -0.613649 -0.589804 1.13643 -0.604904 -0.556223 1.13223 -0.595474 -0.522569 1.12767 -0.585327 -0.488893 1.12273 -0.574431 -0.455253 1.11741 -0.562759 -0.421724 1.11169 -0.550281 -0.388387 1.10558 -0.536972 -0.355338 1.09909 -0.522807 -0.322675 1.09224 -0.507764 -0.290504 1.08506 -0.49182 -0.258933 1.0776 -0.474959 -0.228069 1.0699 -0.457167 -4.7159 1.6928 -0.844598 -3.65207 1.61206 -0.908862 -2.99395 1.54661 -0.971125 -2.49563 1.52296 -0.989999 -2.13316 1.51157 -0.994718 -1.87283 1.50445 -0.994747 -1.68477 1.49899 -0.99334 -1.54642 1.4943 -0.991665 -1.4421 1.49014 -0.990024 -1.36109 1.48653 -0.988357 -1.29575 1.48342 -0.986533 -1.23998 1.48066 -0.98444 -1.18919 1.47816 -0.981916 -1.14055 1.47618 -0.97856 -1.09269 1.47425 -0.974555 -1.04549 1.47218 -0.969986 -0.998751 1.46988 -0.964869 -0.952306 1.46728 -0.959201 -0.90603 1.46433 -0.952971 -0.859837 1.46101 -0.946164 -0.813667 1.45726 -0.938758 -0.767483 1.45309 -0.930729 -0.721263 1.44846 -0.922046 -0.674997 1.44338 -0.912674 -0.628681 1.43785 -0.902577 -0.582319 1.43185 -0.891712 -0.53592 1.42538 -0.880039 -0.489497 1.41844 -0.867514 -0.443071 1.41103 -0.854095 -0.396672 1.40312 -0.839742 -0.35034 1.39471 -0.824417 -0.30413 1.38579 -0.808082 -0.258109 1.37635 -0.790704 -0.21236 1.36639 -0.772251 -0.166979 1.35593 -0.752691 -0.122074 1.34499 -0.731997 -0.0777646 1.33361 -0.710139 -0.0341741 1.32184 -0.687092 --0.00856751 1.30974 -0.662833 --0.0503278 1.29737 -0.637341 -4.7159 2.28096 -1.38758 -3.75139 2.2291 -1.4115 -3.2146 2.16467 -1.45097 -2.78253 2.1293 -1.46987 -2.44495 2.10784 -1.4767 -2.18191 2.09306 -1.47746 -1.97487 2.08169 -1.47537 -1.80927 2.07221 -1.47204 -1.67433 2.06393 -1.46819 -1.56208 2.05657 -1.46405 -1.46624 2.04996 -1.45962 -1.38122 2.04385 -1.45479 -1.30238 2.03804 -1.44936 -1.22671 2.03278 -1.44282 -1.15267 2.0275 -1.4354 -1.08004 2.02199 -1.42721 -1.00854 2.01614 -1.41827 -0.937923 2.00987 -1.40858 -0.867993 2.00312 -1.39813 -0.798599 1.99583 -1.38689 -0.729627 1.98797 -1.37484 -0.66099 1.97951 -1.36193 -0.592622 1.97042 -1.34812 -0.524475 1.96069 -1.33336 -0.456511 1.9503 -1.31761 -0.388706 1.93925 -1.30079 -0.321044 1.92753 -1.28286 -0.253522 1.91512 -1.26374 -0.186146 1.90201 -1.24339 -0.11894 1.88818 -1.22175 -0.0519409 1.87363 -1.19874 --0.014793 1.85834 -1.17434 --0.0811845 1.8423 -1.14847 --0.147136 1.82553 -1.1211 --0.212532 1.80805 -1.09217 --0.277235 1.7899 -1.06164 --0.341097 1.77112 -1.02946 --0.403954 1.75178 -0.995588 --0.465632 1.73197 -0.959985 --0.525947 1.71179 -0.922615 -4.7159 3.25666 -2.27973 -3.83419 3.22858 -2.27609 -3.38872 3.18599 -2.28162 -3.01098 3.15472 -2.28274 -2.69859 3.1313 -2.27972 -2.43988 3.11283 -2.27384 -2.22288 3.09745 -2.26617 -2.03781 3.08402 -2.25748 -1.87722 3.07189 -2.2482 -1.73548 3.0607 -2.23851 -1.60802 3.05019 -2.22845 -1.49065 3.0401 -2.21791 -1.37974 3.03022 -2.20671 -1.27276 3.02062 -2.19443 -1.16827 3.01088 -2.18123 -1.0658 3.00081 -2.16719 -0.964881 2.9903 -2.15233 -0.8651 2.97926 -2.13662 -0.76611 2.96761 -2.12005 -0.667628 2.95525 -2.10256 -0.569419 2.94213 -2.0841 -0.471292 2.92817 -2.06461 -0.373092 2.91331 -2.044 -0.274699 2.8975 -2.0222 -0.176016 2.88067 -1.99909 -0.0769765 2.86277 -1.97459 --0.0224649 2.84375 -1.94856 --0.122327 2.82356 -1.9209 --0.222604 2.80215 -1.89147 --0.32326 2.77948 -1.86016 --0.424231 2.75551 -1.82685 --0.525421 2.7302 -1.79139 --0.626697 2.70353 -1.75368 --0.727894 2.67551 -1.71358 --0.82881 2.64617 -1.67098 --0.929209 2.61553 -1.62577 --1.02882 2.58367 -1.57785 --1.12736 2.55069 -1.5271 --1.22449 2.51672 -1.47345 --1.31987 2.4819 -1.41682 -4.7159 4.87526 -3.74569 -3.59809 4.87043 -3.72091 -2.77198 4.8656 -3.69613 -2.16867 4.86076 -3.67135 -1.73448 4.85593 -3.64656 -1.42763 4.8511 -3.62178 -1.21557 4.84627 -3.597 -1.07294 4.84144 -3.57222 -0.980016 4.83661 -3.54744 -0.921409 4.83178 -3.52266 -0.885151 4.82695 -3.49788 -0.861914 4.82212 -3.4731 -0.844437 4.81729 -3.44832 -0.827449 4.81246 -3.42353 -0.808213 4.80763 -3.39875 -0.784724 4.8028 -3.37397 -0.755233 4.79797 -3.34919 -0.718236 4.79314 -3.32441 -0.672464 4.78831 -3.29963 -0.616866 4.78348 -3.27485 -0.550603 4.77865 -3.25007 -0.473034 4.7738 -3.22529 -0.383708 4.76823 -3.20051 -0.28237 4.76128 -3.17572 -0.168951 4.75245 -3.15094 -0.0435573 4.74124 -3.12585 --0.0935209 4.72712 -3.09966 --0.241817 4.70956 -3.07204 --0.400701 4.68807 -3.04263 --0.569386 4.66223 -3.01103 --0.746946 4.63168 -2.9768 --0.932325 4.59618 -2.93949 --1.12436 4.55558 -2.8986 --1.3218 4.50988 -2.85362 --1.52333 4.45921 -2.80405 --1.72757 4.40384 -2.74934 --1.93314 4.34416 -2.689 --2.13864 4.28071 -2.62252 --2.34269 4.21409 -2.54943 --2.54394 4.14503 -2.46931 -0.906113 0.850418 -0.000803505 -0.900324 0.851342 -0.00160816 -0.894267 0.85229 -0.00243449 -0.887839 0.85328 -0.003298 -0.880954 0.854318 -0.00420498 -0.873541 0.855401 -0.00515323 -0.865546 0.856524 -0.0061381 -0.856934 0.857679 -0.00715351 -0.847684 0.858858 -0.00819355 -0.837791 0.860055 -0.00925338 -0.827265 0.861266 -0.0103294 -0.816129 0.862486 -0.0114189 -0.804415 0.863711 -0.0125185 -0.792166 0.864933 -0.0136214 -0.779431 0.866137 -0.0147163 -0.766262 0.867304 -0.0157854 -0.752716 0.868405 -0.0168044 -0.73885 0.869408 -0.0177447 -0.724726 0.870279 -0.0185759 -0.710411 0.870986 -0.0192698 -0.695974 0.871508 -0.0198047 -0.681495 0.871831 -0.0201676 -0.667055 0.871955 -0.020356 -0.652744 0.871891 -0.020377 -0.638652 0.871658 -0.0202453 -0.62487 0.871279 -0.0199791 -0.611485 0.870778 -0.0195976 -4.7159 0.849514 -1.451e-05 -3.4298 0.849501 -2.4656e-05 -2.53475 0.8495 -2.2786e-05 -1.92566 0.849499 -2.2033e-05 -1.52244 0.849499 -2.1815e-05 -1.26448 0.849498 -2.1954e-05 -1.10631 0.849497 -2.2213e-05 -1.01433 0.849497 -2.1985e-05 -0.964085 0.849496 -2.1207e-05 -0.938316 0.849495 -2.0595e-05 -0.925335 0.849495 -2.035e-05 -0.917802 0.849495 -2.0261e-05 -0.91176 0.849496 -2.0122e-05 -0.906115 0.850418 -0.000823472 -0.900326 0.851342 -0.00162808 -0.89427 0.85229 -0.0024544 -0.887842 0.853279 -0.00331794 -0.880957 0.854317 -0.00422497 -0.873543 0.8554 -0.0051733 -0.865549 0.856523 -0.00615825 -0.856936 0.857678 -0.00717375 -0.847686 0.858857 -0.00821388 -0.837793 0.860055 -0.0092738 -0.827267 0.861265 -0.0103499 -0.81613 0.862486 -0.0114395 -0.804417 0.863711 -0.0125391 -0.792168 0.864932 -0.0136421 -0.779432 0.866137 -0.014737 -0.766264 0.867303 -0.0158061 -0.752717 0.868404 -0.0168251 -0.738851 0.869407 -0.0177654 -0.724727 0.870278 -0.0185966 -0.710411 0.870986 -0.0192906 -0.695975 0.871507 -0.0198255 -0.681495 0.87183 -0.0201883 -0.667055 0.871954 -0.0203767 -0.652744 0.871891 -0.0203977 -0.638652 0.871658 -0.0202659 -0.624869 0.871279 -0.0199997 -0.611485 0.870777 -0.0196181 -4.7159 0.849534 -3.834e-05 -3.42981 0.8495 -6.815e-05 -2.53476 0.849498 -6.3412e-05 -1.92567 0.849497 -6.1432e-05 -1.52245 0.849497 -6.0873e-05 -1.26448 0.849497 -6.1323e-05 -1.10632 0.849496 -6.22e-05 -1.01433 0.849495 -6.1815e-05 -0.964088 0.849494 -5.9897e-05 -0.938319 0.849494 -5.8371e-05 -0.925337 0.849494 -5.7823e-05 -0.917802 0.849495 -5.7734e-05 -0.911763 0.849501 -5.809e-05 -0.90612 0.850418 -0.000860409 -0.900331 0.851341 -0.00166479 -0.894274 0.852288 -0.00249103 -0.887846 0.853278 -0.00335455 -0.880961 0.854316 -0.00426161 -0.873547 0.855399 -0.00521001 -0.865552 0.856522 -0.00619505 -0.85694 0.857676 -0.00721065 -0.84769 0.858856 -0.00825088 -0.837797 0.860053 -0.00931089 -0.82727 0.861264 -0.010387 -0.816134 0.862484 -0.0114767 -0.80442 0.863709 -0.0125763 -0.792171 0.864931 -0.0136794 -0.779435 0.866135 -0.0147743 -0.766266 0.867302 -0.0158433 -0.752719 0.868403 -0.0168623 -0.738853 0.869406 -0.0178026 -0.724729 0.870277 -0.0186337 -0.710413 0.870984 -0.0193276 -0.695976 0.871506 -0.0198624 -0.681496 0.871829 -0.0202252 -0.667055 0.871953 -0.0204134 -0.652744 0.871889 -0.0204343 -0.638651 0.871656 -0.0203024 -0.624868 0.871277 -0.020036 -0.611484 0.870776 -0.0196542 -4.7159 0.84957 -7.7329e-05 -3.42982 0.849499 -0.000145169 -2.53478 0.849495 -0.000136055 -1.92569 0.849494 -0.000132079 -1.52246 0.849494 -0.000130996 -1.26449 0.849494 -0.000132093 -1.10633 0.849495 -0.000134222 -1.01434 0.849493 -0.000133796 -0.964093 0.849491 -0.000130189 -0.938323 0.849491 -0.000127387 -0.92534 0.849492 -0.000126584 -0.917803 0.849495 -0.000126807 -0.911768 0.849509 -0.000129393 -0.906129 0.850417 -0.000928522 -0.90034 0.851339 -0.00173224 -0.894283 0.852286 -0.00255816 -0.887854 0.853275 -0.00342151 -0.880969 0.854313 -0.00432851 -0.873555 0.855396 -0.0052769 -0.86556 0.856519 -0.00626199 -0.856947 0.857674 -0.00727766 -0.847696 0.858853 -0.00831797 -0.837803 0.860051 -0.00937803 -0.827276 0.861261 -0.0104542 -0.816139 0.862482 -0.0115439 -0.804425 0.863707 -0.0126435 -0.792176 0.864928 -0.0137464 -0.77944 0.866133 -0.0148412 -0.76627 0.8673 -0.0159101 -0.752723 0.868401 -0.0169289 -0.738856 0.869404 -0.017869 -0.724732 0.870274 -0.0186998 -0.710415 0.870982 -0.0193935 -0.695977 0.871504 -0.019928 -0.681496 0.871827 -0.0202905 -0.667056 0.871951 -0.0204784 -0.652743 0.871887 -0.020499 -0.63865 0.871654 -0.0203667 -0.624867 0.871275 -0.0200999 -0.611482 0.870773 -0.0197176 -4.7159 0.849632 -0.000141068 -3.42984 0.849496 -0.000281365 -2.53481 0.84949 -0.000265708 -1.92572 0.849488 -0.00025851 -1.52249 0.849489 -0.000256645 -1.26451 0.84949 -0.000259036 -1.10634 0.849491 -0.000263539 -1.01435 0.84949 -0.000263282 -0.964104 0.849487 -0.000257215 -0.938332 0.849486 -0.000252809 -0.925346 0.84949 -0.000252111 -0.917805 0.849496 -0.000253483 -0.911779 0.849523 -0.000262277 -0.906145 0.850417 -0.0010535 -0.900356 0.851336 -0.00185554 -0.894298 0.852282 -0.0026806 -0.887869 0.853271 -0.0035434 -0.880983 0.854308 -0.00445002 -0.873569 0.855391 -0.00539818 -0.865573 0.856514 -0.00638313 -0.856959 0.857669 -0.00739873 -0.847708 0.858849 -0.00843897 -0.837814 0.860046 -0.00949896 -0.827287 0.861257 -0.010575 -0.816149 0.862478 -0.0116645 -0.804435 0.863703 -0.0127639 -0.792185 0.864925 -0.0138665 -0.779448 0.866129 -0.0149609 -0.766278 0.867296 -0.0160292 -0.75273 0.868397 -0.0170475 -0.738862 0.8694 -0.0179869 -0.724737 0.87027 -0.0188172 -0.710419 0.870978 -0.0195101 -0.69598 0.8715 -0.0200439 -0.681498 0.871823 -0.0204057 -0.667056 0.871948 -0.0205929 -0.652742 0.871884 -0.0206127 -0.638648 0.871651 -0.0204796 -0.624864 0.871272 -0.0202118 -0.611478 0.87077 -0.0198285 -4.7159 0.849738 -0.00024531 -3.42989 0.849492 -0.000520929 -2.53487 0.849481 -0.000495811 -1.92577 0.849478 -0.000483487 -1.52253 0.84948 -0.000480497 -1.26454 0.849483 -0.000485398 -1.10637 0.849486 -0.000494247 -1.01438 0.849483 -0.000494583 -0.964122 0.849478 -0.00048513 -0.938348 0.849478 -0.000479142 -0.925357 0.849485 -0.000479668 -0.917809 0.849498 -0.000484174 -0.911798 0.849549 -0.000507112 -0.906174 0.850417 -0.00128123 -0.900384 0.851331 -0.0020794 -0.894326 0.852275 -0.00290238 -0.887896 0.853263 -0.00376374 -0.881009 0.8543 -0.00466924 -0.873593 0.855383 -0.00561657 -0.865596 0.856506 -0.00660088 -0.856981 0.857661 -0.00761596 -0.847729 0.858841 -0.00865575 -0.837834 0.860039 -0.00971529 -0.827306 0.86125 -0.0107908 -0.816167 0.862471 -0.0118797 -0.804451 0.863696 -0.0129783 -0.792201 0.864918 -0.0140799 -0.779463 0.866123 -0.0151732 -0.766292 0.867289 -0.0162404 -0.752742 0.86839 -0.0172573 -0.738873 0.869393 -0.0181952 -0.724746 0.870264 -0.019024 -0.710426 0.870972 -0.0197153 -0.695985 0.871494 -0.0202476 -0.6815 0.871817 -0.0206078 -0.667056 0.871942 -0.0207934 -0.65274 0.871878 -0.0208115 -0.638645 0.871645 -0.0206765 -0.624859 0.871266 -0.0204067 -0.611471 0.870764 -0.020021 -4.7159 0.849919 -0.000415934 -3.42996 0.849486 -0.000938779 -2.53496 0.849465 -0.000900667 -1.92586 0.849461 -0.000880342 -1.5226 0.849464 -0.000875833 -1.2646 0.849472 -0.000885471 -1.10642 0.849476 -0.00090207 -1.01442 0.849472 -0.000903929 -0.964157 0.849464 -0.000890391 -0.938379 0.849465 -0.000883969 -0.925381 0.849477 -0.000888525 -0.917822 0.849502 -0.000900496 -0.911834 0.849591 -0.000951049 -0.906226 0.850418 -0.00169251 -0.900436 0.851323 -0.00248226 -0.894375 0.852264 -0.0033006 -0.887944 0.85325 -0.00415858 -0.881054 0.854286 -0.00506134 -0.873636 0.855369 -0.00600644 -0.865637 0.856492 -0.0069889 -0.85702 0.857648 -0.00800241 -0.847765 0.858828 -0.00904077 -0.837868 0.860027 -0.0100989 -0.827338 0.861239 -0.0111729 -0.816198 0.86246 -0.0122602 -0.804481 0.863685 -0.0133568 -0.792228 0.864908 -0.0144562 -0.779489 0.866112 -0.015547 -0.766316 0.867279 -0.0166113 -0.752764 0.86838 -0.0176252 -0.738891 0.869383 -0.0185599 -0.724761 0.870254 -0.0193853 -0.710437 0.870962 -0.0200734 -0.695992 0.871484 -0.0206024 -0.681504 0.871808 -0.0209593 -0.667056 0.871933 -0.0211414 -0.652737 0.87187 -0.0211559 -0.638638 0.871637 -0.0210171 -0.624849 0.871258 -0.0207431 -0.611459 0.870755 -0.0203527 -4.7159 0.850224 -0.000695455 -3.43009 0.849477 -0.00165966 -2.53513 0.84944 -0.00160513 -1.92601 0.849432 -0.00157262 -1.52273 0.849439 -0.00156624 -1.26471 0.849453 -0.00158457 -1.10651 0.849462 -0.00161469 -1.01449 0.849455 -0.00162018 -0.964223 0.849441 -0.00160321 -0.938441 0.849442 -0.00160032 -0.925433 0.849466 -0.00161516 -0.917855 0.849511 -0.00164334 -0.911901 0.849653 -0.00173949 -0.906317 0.850422 -0.00242712 -0.900526 0.851311 -0.00319954 -0.894462 0.852247 -0.00400807 -0.888027 0.85323 -0.00485871 -0.881133 0.854264 -0.00575533 -0.873712 0.855346 -0.00669524 -0.865708 0.856469 -0.00767323 -0.857087 0.857626 -0.00868277 -0.847829 0.858807 -0.00971749 -0.837928 0.860007 -0.0107721 -0.827395 0.86122 -0.0118425 -0.816251 0.862442 -0.0129258 -0.804531 0.863668 -0.0140181 -0.792275 0.864891 -0.0151126 -0.779533 0.866096 -0.0161979 -0.766356 0.867262 -0.0172562 -0.752799 0.868363 -0.0182636 -0.738922 0.869366 -0.0191917 -0.724785 0.870237 -0.0200103 -0.710455 0.870946 -0.0206916 -0.696004 0.871469 -0.0212138 -0.681509 0.871794 -0.0215639 -0.667055 0.871919 -0.0217393 -0.65273 0.871857 -0.0217467 -0.638625 0.871624 -0.0216003 -0.624832 0.871245 -0.021318 -0.611437 0.870742 -0.0209184 -4.7159 0.850738 -0.00115372 -3.4303 0.849465 -0.00288712 -2.53542 0.849399 -0.00281483 -1.92627 0.849386 -0.0027643 -1.52295 0.849399 -0.00275597 -1.26489 0.849423 -0.0027898 -1.10666 0.84944 -0.00284301 -1.01463 0.849429 -0.00285696 -0.964352 0.849406 -0.00284124 -0.938571 0.849409 -0.00285198 -0.925548 0.849452 -0.00288977 -0.917941 0.849531 -0.00294991 -0.912029 0.849736 -0.00310709 -0.906475 0.850434 -0.00372109 -0.900683 0.851296 -0.00446037 -0.894613 0.852221 -0.00524923 -0.88817 0.853198 -0.00608488 -0.881269 0.85423 -0.00696871 -0.87384 0.855311 -0.00789747 -0.865829 0.856434 -0.00886557 -0.857201 0.857591 -0.00986618 -0.847935 0.858774 -0.0108926 -0.838028 0.859976 -0.0119392 -0.827488 0.861191 -0.0130015 -0.816339 0.862415 -0.0140763 -0.804614 0.863642 -0.0151592 -0.792353 0.864865 -0.0162435 -0.779605 0.866071 -0.0173176 -0.766421 0.867237 -0.0183637 -0.752856 0.868339 -0.0193583 -0.73897 0.869342 -0.020273 -0.724823 0.870213 -0.0210781 -0.710483 0.870923 -0.0217459 -0.69602 0.871447 -0.0222548 -0.681514 0.871773 -0.0225918 -0.667049 0.8719 -0.0227539 -0.652714 0.871838 -0.0227477 -0.6386 0.871607 -0.0225867 -0.624799 0.871227 -0.0222886 -0.611397 0.870724 -0.0218712 -4.7159 0.851597 -0.00190549 -3.43066 0.849458 -0.0049458 -2.53591 0.849341 -0.00486099 -1.92673 0.849317 -0.00478481 -1.52334 0.84934 -0.00477521 -1.26522 0.849383 -0.00483583 -1.10694 0.849413 -0.00492768 -1.01489 0.849395 -0.00496079 -0.964615 0.849355 -0.00496058 -0.938848 0.849363 -0.00500679 -0.925806 0.849438 -0.00509048 -0.918159 0.849569 -0.0052054 -0.912277 0.849832 -0.00542568 -0.906751 0.850463 -0.00595951 -0.900955 0.851283 -0.00664262 -0.894871 0.852188 -0.00739467 -0.888413 0.853155 -0.00820151 -0.881497 0.854182 -0.00906029 -0.874053 0.85526 -0.00996667 -0.866029 0.856384 -0.0109144 -0.857387 0.857543 -0.0118964 -0.848109 0.858729 -0.0129052 -0.83819 0.859933 -0.0139348 -0.82764 0.861151 -0.0149802 -0.816481 0.862378 -0.0160372 -0.804746 0.863607 -0.0171013 -0.792475 0.864832 -0.0181652 -0.779717 0.866038 -0.0192171 -0.766521 0.867205 -0.0202395 -0.752943 0.868306 -0.0212092 -0.739042 0.86931 -0.0220983 -0.724878 0.870182 -0.0228777 -0.710519 0.870893 -0.0235199 -0.696038 0.871419 -0.0240035 -0.681513 0.871747 -0.0243156 -0.66703 0.871876 -0.0244526 -0.652678 0.871816 -0.0244207 -0.638548 0.871586 -0.0242325 -0.624733 0.871206 -0.0239048 -0.611318 0.870702 -0.0234545 -4.7159 0.853032 -0.00313932 -3.43125 0.849477 -0.00834048 -2.53673 0.849273 -0.00826417 -1.92749 0.84923 -0.0081532 -1.524 0.849268 -0.00814456 -1.26579 0.849341 -0.00824995 -1.10746 0.849392 -0.0084052 -1.0154 0.849363 -0.00848036 -0.965163 0.849298 -0.00852947 -0.939441 0.849317 -0.00865217 -0.926374 0.849439 -0.00881646 -0.918664 0.849633 -0.00900747 -0.912768 0.849938 -0.00927795 -0.907237 0.850522 -0.0097426 -0.901423 0.851289 -0.0103478 -0.89531 0.852162 -0.0110384 -0.888821 0.853112 -0.011794 -0.881875 0.854128 -0.012607 -0.874403 0.855203 -0.0134713 -0.866352 0.856325 -0.0143799 -0.857686 0.857486 -0.0153251 -0.848385 0.858676 -0.0162989 -0.838445 0.859885 -0.0172944 -0.827875 0.861108 -0.0183058 -0.816698 0.862338 -0.0193279 -0.804946 0.863571 -0.0203553 -0.792658 0.864798 -0.02138 -0.77988 0.866005 -0.02239 -0.766664 0.867173 -0.0233681 -0.753064 0.868275 -0.0242915 -0.739136 0.869279 -0.0251333 -0.724944 0.870152 -0.0258649 -0.710555 0.870865 -0.0264599 -0.696043 0.871394 -0.0268971 -0.681486 0.871725 -0.0271632 -0.666973 0.871857 -0.0272543 -0.652593 0.8718 -0.0271753 -0.638438 0.871571 -0.0269374 -0.624598 0.871192 -0.0265558 -0.611162 0.870685 -0.0260462 -4.7159 0.855422 -0.00516505 -3.43222 0.849595 -0.0138338 -2.53809 0.849235 -0.0138206 -1.92879 0.849161 -0.0136655 -1.52514 0.849222 -0.0136628 -1.26681 0.849344 -0.0138402 -1.10845 0.849427 -0.0140974 -1.01642 0.849379 -0.0142609 -0.966304 0.84928 -0.0144268 -0.940683 0.849315 -0.0146907 -0.927571 0.849495 -0.0149739 -0.919743 0.849743 -0.0152477 -0.913744 0.850074 -0.0155528 -0.90813 0.850633 -0.0159673 -0.902247 0.851354 -0.0164888 -0.896066 0.852189 -0.0170942 -0.88951 0.853113 -0.0177695 -0.882501 0.854113 -0.0185063 -0.874971 0.855179 -0.0192976 -0.866866 0.856299 -0.0201358 -0.858152 0.857461 -0.0210131 -0.848807 0.858655 -0.021921 -0.838827 0.85987 -0.0228519 -0.828221 0.861099 -0.0237986 -0.81701 0.862335 -0.0247548 -0.805225 0.863573 -0.0257136 -0.792905 0.864803 -0.0266661 -0.780094 0.866011 -0.0276 -0.766842 0.867179 -0.0284982 -0.753202 0.868281 -0.0293387 -0.739231 0.869286 -0.0300959 -0.724992 0.87016 -0.0307427 -0.710553 0.870875 -0.0312535 -0.69599 0.871407 -0.0316076 -0.681383 0.871741 -0.0317915 -0.666821 0.871877 -0.0318003 -0.652394 0.871823 -0.0316369 -0.638195 0.871595 -0.0313104 -0.624315 0.871215 -0.0308334 -0.610841 0.870705 -0.0302194 -4.7159 0.859401 -0.00849185 -3.43378 0.849998 -0.0225417 -2.54033 0.849369 -0.0227125 -1.93098 0.84924 -0.0225067 -1.52714 0.849335 -0.0225193 -1.26868 0.849532 -0.0228073 -1.11033 0.849664 -0.0232245 -1.01848 0.849587 -0.023562 -0.96864 0.849444 -0.0239573 -0.943167 0.849498 -0.0244415 -0.929937 0.84972 -0.0248696 -0.921875 0.85 -0.0252217 -0.91564 0.850344 -0.0255544 -0.909813 0.850895 -0.0259369 -0.903749 0.851591 -0.0263861 -0.897405 0.852394 -0.0268971 -0.890701 0.853291 -0.0274671 -0.883557 0.854272 -0.028093 -0.875904 0.855324 -0.0287704 -0.86769 0.856438 -0.0294934 -0.858876 0.857599 -0.0302551 -0.849442 0.858795 -0.0310477 -0.839382 0.860015 -0.0318632 -0.828703 0.861251 -0.0326937 -0.817424 0.862493 -0.0335314 -0.805576 0.863735 -0.034368 -0.793193 0.864967 -0.0351933 -0.78032 0.866176 -0.0359943 -0.767002 0.867343 -0.0367543 -0.753293 0.868442 -0.0374524 -0.739248 0.869444 -0.0380646 -0.724932 0.870317 -0.0385656 -0.710412 0.871031 -0.0389313 -0.695766 0.871563 -0.0391417 -0.681076 0.8719 -0.0391829 -0.666433 0.872038 -0.0390481 -0.651929 0.871984 -0.0387374 -0.637656 0.871755 -0.0382566 -0.623706 0.871371 -0.0376144 -0.610164 0.870853 -0.0368209 -4.7159 0.866019 -0.0139565 -3.43625 0.851158 -0.0360389 -2.54401 0.850064 -0.0366382 -1.93468 0.849844 -0.0363845 -1.53064 0.849987 -0.0364273 -1.27212 0.850294 -0.0368755 -1.11396 0.850496 -0.0375354 -1.02255 0.850381 -0.0381848 -0.973202 0.850191 -0.038956 -0.947836 0.850242 -0.0397292 -0.934312 0.850469 -0.0403176 -0.92583 0.850751 -0.0407512 -0.919173 0.851099 -0.0411179 -0.912949 0.851651 -0.0414856 -0.90652 0.852341 -0.0418798 -0.899841 0.853133 -0.0423023 -0.89283 0.854014 -0.0427564 -0.885404 0.854979 -0.0432442 -0.877495 0.856018 -0.0437662 -0.869048 0.857121 -0.044321 -0.860026 0.858275 -0.044905 -0.850404 0.859467 -0.0455131 -0.840175 0.860686 -0.0461389 -0.829342 0.861921 -0.046775 -0.817924 0.863163 -0.0474131 -0.805944 0.864403 -0.0480438 -0.793436 0.865631 -0.0486561 -0.78044 0.866832 -0.0492365 -0.766999 0.867989 -0.0497684 -0.753165 0.869076 -0.0502324 -0.738992 0.870066 -0.0506064 -0.724543 0.870926 -0.0508672 -0.709888 0.871629 -0.0509925 -0.695104 0.872152 -0.0509628 -0.680278 0.87248 -0.0507635 -0.6655 0.87261 -0.0503853 -0.650864 0.872547 -0.0498244 -0.636463 0.872306 -0.0490817 -0.622388 0.871906 -0.0481607 -0.608722 0.871368 -0.0470666 -4.7159 0.877018 -0.0229341 -3.44012 0.854159 -0.0564577 -2.55002 0.852283 -0.0579516 -1.94095 0.851911 -0.0576736 -1.53685 0.852116 -0.0577666 -1.27848 0.85258 -0.0584284 -1.12088 0.852879 -0.059434 -1.03031 0.852739 -0.0605689 -0.981554 0.852503 -0.0618457 -0.956045 0.852516 -0.0629519 -0.941921 0.852706 -0.0637256 -0.93275 0.852967 -0.0642649 -0.925421 0.853304 -0.0646883 -0.91855 0.853862 -0.0650625 -0.911497 0.854558 -0.0654208 -0.904223 0.855353 -0.0657666 -0.896646 0.856233 -0.0661046 -0.888687 0.85719 -0.066439 -0.88028 0.858217 -0.0667737 -0.871373 0.859304 -0.067111 -0.861926 0.86044 -0.0674521 -0.851917 0.861613 -0.0677962 -0.841334 0.862812 -0.0681407 -0.830178 0.864025 -0.0684808 -0.818462 0.865243 -0.0688099 -0.806206 0.866457 -0.0691193 -0.793439 0.867655 -0.0693982 -0.780195 0.868822 -0.0696334 -0.766514 0.869941 -0.0698093 -0.752442 0.870988 -0.0699076 -0.738033 0.871935 -0.0699085 -0.723348 0.872752 -0.0697909 -0.708456 0.873413 -0.0695339 -0.693436 0.873895 -0.0691186 -0.678374 0.874183 -0.0685287 -0.663361 0.874272 -0.0677516 -0.648492 0.874168 -0.0667787 -0.633859 0.873882 -0.0656043 -0.619552 0.873433 -0.0642256 -0.605653 0.872841 -0.0626415 -4.7159 0.895294 -0.037685 -3.4461 0.861345 -0.086556 -2.55981 0.858181 -0.0897915 -1.95159 0.857564 -0.0895545 -1.54782 0.85784 -0.0897185 -1.29009 0.858512 -0.0906304 -1.13361 0.858946 -0.0920733 -1.04422 0.858827 -0.0938225 -0.99578 0.858571 -0.0956476 -0.969596 0.858527 -0.0971038 -0.954411 0.858664 -0.0980961 -0.944165 0.858891 -0.0987771 -0.935815 0.859211 -0.0992889 -0.927952 0.859775 -0.0996944 -0.919924 0.860483 -0.100036 -0.911693 0.861285 -0.100319 -0.903183 0.862166 -0.100545 -0.89432 0.863113 -0.10072 -0.885044 0.864119 -0.100848 -0.875307 0.865172 -0.100933 -0.865076 0.866263 -0.100979 -0.854329 0.867379 -0.100988 -0.843055 0.868512 -0.100963 -0.831256 0.869651 -0.100902 -0.81894 0.870788 -0.100802 -0.806122 0.871913 -0.100657 -0.792826 0.873015 -0.100458 -0.77908 0.874081 -0.100194 -0.764918 0.875091 -0.0998499 -0.750383 0.876025 -0.0994109 -0.735522 0.876854 -0.0988586 -0.720393 0.877552 -0.0981737 -0.705064 0.878093 -0.0973366 -0.68961 0.878454 -0.0963278 -0.674117 0.878621 -0.0951288 -0.658673 0.878588 -0.0937229 -0.643371 0.878359 -0.0920954 -0.628302 0.877944 -0.0902337 -0.613554 0.87736 -0.0881273 -0.599207 0.876626 -0.085768 -4.7159 0.925653 -0.0619245 -3.45525 0.877436 -0.129734 -2.57571 0.872164 -0.136196 -1.96963 0.871156 -0.136147 -1.56705 0.871486 -0.136395 -1.31075 0.87239 -0.137537 -1.15592 0.872994 -0.139417 -1.06747 0.872973 -0.14174 -1.01846 0.87275 -0.144019 -0.990719 0.872677 -0.145784 -0.973783 0.872773 -0.146995 -0.961892 0.872972 -0.147831 -0.952002 0.873277 -0.148445 -0.942644 0.873855 -0.148887 -0.933135 0.874576 -0.149213 -0.92344 0.875383 -0.14943 -0.913485 0.876252 -0.14954 -0.9032 0.877169 -0.149547 -0.892529 0.878121 -0.149452 -0.881432 0.879096 -0.149261 -0.869881 0.880083 -0.148977 -0.857863 0.881072 -0.148604 -0.845369 0.882054 -0.148144 -0.832404 0.883021 -0.147599 -0.818975 0.883966 -0.146967 -0.805098 0.884882 -0.146244 -0.79079 0.885759 -0.145425 -0.776077 0.886586 -0.144499 -0.760985 0.887344 -0.143455 -0.745552 0.888014 -0.14228 -0.72982 0.88857 -0.140956 -0.71384 0.888988 -0.139466 -0.697675 0.889242 -0.137791 -0.681396 0.889312 -0.13591 -0.665082 0.889183 -0.133801 -0.648818 0.888849 -0.131444 -0.632693 0.888313 -0.128817 -0.616793 0.887582 -0.125901 -0.601204 0.886673 -0.122678 -0.586002 0.885601 -0.119132 -4.7159 0.976075 -0.101759 -3.46915 0.911319 -0.190061 -2.60147 0.902488 -0.202286 -2 0.90084 -0.202736 -1.60014 0.901123 -0.203067 -1.34614 0.902172 -0.204315 -1.1928 0.902901 -0.206441 -1.10394 0.902999 -0.209055 -1.05272 0.902844 -0.211541 -1.02208 0.90277 -0.213471 -1.00233 0.902843 -0.21482 -0.987898 0.903019 -0.215759 -0.975654 0.903305 -0.216432 -0.96402 0.903894 -0.216857 -0.952257 0.90462 -0.21711 -0.940332 0.905411 -0.217202 -0.92817 0.906235 -0.217137 -0.915701 0.907074 -0.216917 -0.902872 0.907909 -0.216544 -0.889648 0.908727 -0.216019 -0.876008 0.909515 -0.215345 -0.861941 0.910262 -0.214523 -0.847447 0.910961 -0.213555 -0.832532 0.911606 -0.21244 -0.817206 0.912191 -0.211173 -0.801485 0.912711 -0.209752 -0.785387 0.913159 -0.208168 -0.768932 0.913524 -0.206411 -0.752145 0.913793 -0.204469 -0.735057 0.913946 -0.202329 -0.717705 0.913963 -0.199974 -0.700135 0.913819 -0.197387 -0.682401 0.913491 -0.194545 -0.664569 0.912961 -0.191427 -0.646711 0.912214 -0.188008 -0.628907 0.911245 -0.184263 -0.61124 0.910055 -0.180166 -0.593795 0.908652 -0.17569 -0.576654 0.907049 -0.170814 -0.559893 0.905264 -0.165517 -4.7159 1.05981 -0.167229 -3.49024 0.978762 -0.272694 -2.64319 0.963604 -0.29481 -2.05078 0.9608 -0.296449 -1.65583 0.960704 -0.29688 -1.40437 0.961547 -0.297985 -1.25077 0.962131 -0.299937 -1.15871 0.962175 -0.302352 -1.10269 0.961981 -0.304658 -1.06708 0.961839 -0.306484 -1.04281 0.961832 -0.307781 -1.02437 0.961929 -0.308672 -1.00843 0.962139 -0.309262 -0.993232 0.962682 -0.309515 -0.977954 0.963346 -0.309528 -0.962562 0.96404 -0.309325 -0.946974 0.964723 -0.308913 -0.931117 0.965369 -0.308293 -0.914936 0.965957 -0.307467 -0.898396 0.966467 -0.306434 -0.881479 0.966885 -0.305193 -0.864176 0.9672 -0.303743 -0.84649 0.967403 -0.302079 -0.828428 0.96749 -0.300196 -0.810004 0.967457 -0.298085 -0.791231 0.967298 -0.295736 -0.772127 0.967009 -0.293137 -0.752711 0.966582 -0.290272 -0.733006 0.966002 -0.287125 -0.713037 0.965254 -0.283678 -0.692839 0.964318 -0.279911 -0.672452 0.963172 -0.275801 -0.651927 0.961795 -0.271327 -0.631326 0.960171 -0.26646 -0.610718 0.958287 -0.261176 -0.59018 0.956139 -0.255444 -0.569795 0.953729 -0.249236 -0.549648 0.951068 -0.242527 -0.529825 0.948172 -0.23529 -0.510408 0.945061 -0.227506 -4.7159 1.19887 -0.274838 -3.52252 1.10636 -0.386078 -2.71081 1.08001 -0.423579 -2.1351 1.07479 -0.427984 -1.74764 1.07348 -0.4287 -1.49723 1.07334 -0.429341 -1.33929 1.07315 -0.430551 -1.23949 1.07266 -0.432165 -1.17473 1.07205 -0.433786 -1.13085 1.07155 -0.435101 -1.09925 1.07122 -0.436009 -1.0743 1.07102 -0.436557 -1.05234 1.07095 -0.436781 -1.03136 1.07124 -0.436548 -1.01041 1.07163 -0.435989 -0.989444 1.07199 -0.435148 -0.968372 1.07228 -0.434035 -0.947105 1.07246 -0.432653 -0.92558 1.07251 -0.431001 -0.903756 1.07239 -0.429077 -0.88161 1.0721 -0.426876 -0.859134 1.07161 -0.42439 -0.836326 1.07092 -0.421609 -0.813194 1.07003 -0.418518 -0.789748 1.06893 -0.415102 -0.766 1.06761 -0.411342 -0.741966 1.06607 -0.407216 -0.717664 1.06431 -0.402701 -0.693112 1.0623 -0.397773 -0.668337 1.06004 -0.392407 -0.643371 1.0575 -0.386577 -0.618256 1.05467 -0.380257 -0.593044 1.05153 -0.373419 -0.567799 1.04806 -0.366035 -0.542594 1.04425 -0.358078 -0.517511 1.04011 -0.349518 -0.492642 1.03565 -0.340329 -0.468079 1.03088 -0.330486 -0.443919 1.02583 -0.319964 -0.420257 1.02054 -0.308747 -4.7159 1.42977 -0.451721 -3.57241 1.337 -0.548967 -2.81912 1.29353 -0.604434 -2.27257 1.28277 -0.614788 -1.8954 1.27845 -0.616637 -1.64234 1.27599 -0.616724 -1.47363 1.27399 -0.616717 -1.3595 1.27208 -0.616954 -1.28005 1.27032 -0.617315 -1.22258 1.26882 -0.617575 -1.17887 1.2676 -0.617588 -1.14304 1.26659 -0.61731 -1.11098 1.26572 -0.616681 -1.08031 1.26528 -0.615431 -1.04991 1.26488 -0.613739 -1.01971 1.26438 -0.611675 -0.989596 1.26373 -0.609258 -0.959442 1.26286 -0.606489 -0.929168 1.26176 -0.603366 -0.898718 1.26038 -0.599883 -0.868054 1.2587 -0.596029 -0.837157 1.25671 -0.591788 -0.80602 1.2544 -0.587141 -0.77464 1.25176 -0.582066 -0.743022 1.24878 -0.576535 -0.711174 1.24546 -0.57052 -0.679109 1.2418 -0.563988 -0.64684 1.23778 -0.556909 -0.614387 1.23339 -0.549248 -0.581778 1.22863 -0.540975 -0.549049 1.22346 -0.532057 -0.516246 1.21788 -0.522465 -0.483431 1.21187 -0.512168 -0.450676 1.20542 -0.501139 -0.418067 1.19854 -0.489349 -0.385701 1.19124 -0.476773 -0.353681 1.18353 -0.463383 -0.322117 1.17546 -0.449158 -0.291122 1.16707 -0.434076 -0.260809 1.1584 -0.41812 -4.7159 1.81319 -0.742494 -3.64755 1.7362 -0.805785 -2.98371 1.67558 -0.867571 -2.48391 1.65393 -0.886623 -2.12166 1.64319 -0.891698 -1.86251 1.6362 -0.892122 -1.67615 1.63074 -0.891093 -1.53975 1.62605 -0.889755 -1.4374 1.62191 -0.888424 -1.35828 1.61829 -0.887063 -1.29471 1.61514 -0.885548 -1.24062 1.61231 -0.883775 -1.19144 1.60967 -0.881589 -1.14435 1.6075 -0.878558 -1.09804 1.60531 -0.874925 -1.05238 1.60293 -0.870797 -1.00718 1.60028 -0.866199 -0.962275 1.5973 -0.861133 -0.917542 1.59393 -0.855595 -0.872883 1.59015 -0.84957 -0.828233 1.58592 -0.843042 -0.783548 1.58122 -0.835984 -0.738795 1.57604 -0.828368 -0.693956 1.57036 -0.82016 -0.649021 1.56418 -0.811319 -0.603987 1.55749 -0.801807 -0.558855 1.55029 -0.791579 -0.513636 1.54256 -0.780594 -0.468348 1.53429 -0.768808 -0.42302 1.52547 -0.756183 -0.377694 1.51608 -0.74268 -0.332425 1.5061 -0.728265 -0.287286 1.49555 -0.712903 -0.242365 1.4844 -0.696564 -0.197766 1.47269 -0.679218 -0.153605 1.46044 -0.660836 -0.110008 1.44768 -0.641392 -0.0671086 1.43447 -0.62086 -0.0250445 1.42088 -0.599217 --0.0160448 1.40697 -0.576443 -4.7159 2.44984 -1.22052 -3.74587 2.39953 -1.24522 -3.19982 2.33843 -1.28554 -2.7641 2.3053 -1.30505 -2.42584 2.285 -1.31246 -2.16363 2.27073 -1.31385 -1.9582 2.25954 -1.31241 -1.79462 2.2501 -1.30973 -1.66189 2.2418 -1.30653 -1.55189 2.23437 -1.30305 -1.45828 2.22763 -1.29929 -1.37546 2.22133 -1.29516 -1.29878 2.21528 -1.29047 -1.22521 2.20968 -1.28467 -1.15327 2.20399 -1.27807 -1.08273 2.19801 -1.27079 -1.01332 2.19163 -1.26288 -0.944769 2.18478 -1.25432 -0.876883 2.1774 -1.24513 -0.809498 2.16944 -1.23526 -0.742489 2.16084 -1.2247 -0.675757 2.15159 -1.21341 -0.609226 2.14166 -1.20134 -0.542836 2.13101 -1.18845 -0.476542 2.11964 -1.17467 -0.410315 2.10752 -1.15996 -0.344133 2.09464 -1.14426 -0.277993 2.08098 -1.12749 -0.211903 2.06652 -1.10962 -0.14589 2.05123 -1.09057 -0.0799973 2.03511 -1.0703 -0.014292 2.01814 -1.04876 --0.0511379 2.00032 -1.02589 --0.116182 1.98165 -1.00166 --0.180711 1.96216 -0.976023 --0.244573 1.94189 -0.948933 --0.307605 1.9209 -0.920354 --0.369629 1.89928 -0.89025 --0.430458 1.8771 -0.858588 --0.489899 1.85449 -0.82534 -4.7159 3.50698 -2.00643 -3.83055 3.47907 -2.00435 -3.37704 3.43751 -2.01164 -2.99548 3.4071 -2.01423 -2.68206 3.3842 -2.01251 -2.42382 3.36595 -2.00783 -2.20805 3.35057 -2.00136 -2.0246 3.33701 -1.99385 -1.86582 3.32466 -1.98575 -1.72597 3.31317 -1.97728 -1.60044 3.3023 -1.96847 -1.48502 3.29179 -1.95923 -1.37606 3.28143 -1.94938 -1.271 3.27126 -1.93849 -1.16843 3.26086 -1.92677 -1.06788 3.25007 -1.91432 -0.968878 3.23878 -1.90116 -0.871009 3.22689 -1.88729 -0.773926 3.21432 -1.87267 -0.677341 3.20097 -1.85727 -0.58101 3.18678 -1.84105 -0.484735 3.17167 -1.82393 -0.388351 3.15557 -1.80585 -0.291723 3.1384 -1.78674 -0.194747 3.12011 -1.76648 -0.0973437 3.10063 -1.74499 --0.000538655 3.07989 -1.72216 --0.0989254 3.05782 -1.69788 --0.197812 3.03437 -1.67203 --0.297164 3.00948 -1.6445 --0.396909 2.9831 -1.61516 --0.496941 2.95519 -1.58392 --0.597115 2.92573 -1.55064 --0.697246 2.89473 -1.51523 --0.79711 2.86219 -1.47759 --0.896449 2.82818 -1.4376 --0.99497 2.79279 -1.39519 --1.09235 2.75611 -1.35027 --1.18826 2.71832 -1.30278 --1.28231 2.67957 -1.25265 -4.7159 5.26227 -3.29861 -3.60161 5.25648 -3.27579 -2.77842 5.25068 -3.25298 -2.17758 5.24489 -3.23017 -1.74551 5.23909 -3.20736 -1.44053 5.23329 -3.18454 -1.23014 5.2275 -3.16173 -1.08904 5.2217 -3.13892 -0.997542 5.21591 -3.11611 -0.940293 5.21011 -3.09329 -0.905346 5.20431 -3.07048 -0.883395 5.19852 -3.04767 -0.867192 5.19272 -3.02486 -0.851459 5.18692 -3.00204 -0.833377 5.18113 -2.97923 -0.810859 5.17533 -2.95642 -0.782093 5.16954 -2.9336 -0.745528 5.16374 -2.91079 -0.699863 5.15794 -2.88798 -0.644033 5.15215 -2.86517 -0.577197 5.14635 -2.84235 -0.498726 5.14053 -2.81954 -0.408191 5.13392 -2.79673 -0.305379 5.12576 -2.77392 -0.190268 5.11552 -2.7511 -0.0630255 5.10264 -2.72802 --0.0759879 5.08652 -2.704 --0.226228 5.06658 -2.67876 --0.38698 5.04227 -2.65198 --0.557369 5.01313 -2.62332 --0.736377 4.97876 -2.59241 --0.922856 4.93888 -2.55885 --1.11556 4.89334 -2.52223 --1.31315 4.84213 -2.48211 --1.51423 4.7854 -2.43805 --1.71738 4.72345 -2.38958 --1.92116 4.65672 -2.33629 --2.12416 4.58578 -2.27774 --2.32498 4.51134 -2.21352 --2.52228 4.43418 -2.14327 -0.917643 0.890999 -0.000780766 -0.912038 0.891968 -0.00156258 -0.906174 0.892961 -0.00236535 -0.899951 0.893998 -0.00320416 -0.893286 0.895085 -0.0040851 -0.886109 0.89622 -0.00500603 -0.87837 0.897397 -0.00596239 -0.870032 0.898607 -0.0069483 -0.861077 0.899842 -0.00795799 -0.851499 0.901096 -0.00898676 -0.841308 0.902365 -0.0100311 -0.830526 0.903643 -0.0110884 -0.819185 0.904927 -0.0121553 -0.807326 0.906207 -0.0132254 -0.794996 0.907469 -0.0142875 -0.782245 0.908691 -0.0153244 -0.769128 0.909844 -0.0163126 -0.755699 0.910895 -0.0172244 -0.742018 0.911807 -0.0180303 -0.728146 0.912549 -0.0187032 -0.714151 0.913095 -0.0192218 -0.700109 0.913433 -0.0195736 -0.686099 0.913563 -0.0197563 -0.672207 0.913496 -0.0197768 -0.658522 0.913252 -0.0196492 -0.645131 0.912855 -0.0193913 -0.632121 0.912329 -0.0190215 -4.7159 0.89005 -1.3047e-05 -3.43303 0.890036 -2.4421e-05 -2.54032 0.890035 -2.2563e-05 -1.9329 0.890035 -2.1817e-05 -1.53086 0.890034 -2.1592e-05 -1.27373 0.890034 -2.1698e-05 -1.11616 0.890034 -2.1969e-05 -1.02459 0.890033 -2.1876e-05 -0.974657 0.890033 -2.1202e-05 -0.949126 0.890032 -2.0593e-05 -0.936342 0.890032 -2.0335e-05 -0.928984 0.890032 -2.0242e-05 -0.92311 0.890034 -2.0089e-05 -0.917646 0.890999 -0.000800712 -0.91204 0.891967 -0.00158247 -0.906176 0.89296 -0.00238525 -0.899953 0.893997 -0.00322409 -0.893288 0.895085 -0.00410509 -0.886111 0.89622 -0.0050261 -0.878372 0.897396 -0.00598254 -0.870035 0.898606 -0.00696853 -0.861079 0.899841 -0.00797831 -0.851501 0.901096 -0.00900716 -0.84131 0.902364 -0.0100515 -0.830528 0.903643 -0.011109 -0.819187 0.904926 -0.0121759 -0.807327 0.906206 -0.013246 -0.794997 0.907468 -0.0143081 -0.782247 0.90869 -0.015345 -0.769129 0.909844 -0.0163333 -0.7557 0.910894 -0.0172451 -0.742019 0.911807 -0.0180511 -0.728146 0.912548 -0.0187239 -0.714152 0.913094 -0.0192425 -0.700109 0.913433 -0.0195943 -0.686099 0.913563 -0.019777 -0.672207 0.913496 -0.0197974 -0.658521 0.913251 -0.0196698 -0.64513 0.912854 -0.0194119 -0.63212 0.912329 -0.019042 -4.7159 0.890072 -3.4296e-05 -3.43304 0.890035 -6.7235e-05 -2.54033 0.890034 -6.2526e-05 -1.93291 0.890033 -6.0572e-05 -1.53087 0.890033 -5.9993e-05 -1.27374 0.890033 -6.0338e-05 -1.11616 0.890032 -6.1216e-05 -1.0246 0.890032 -6.1181e-05 -0.97466 0.890031 -5.9554e-05 -0.949128 0.890031 -5.8045e-05 -0.936343 0.890031 -5.7466e-05 -0.928984 0.890032 -5.7365e-05 -0.923113 0.890038 -5.7681e-05 -0.91765 0.890999 -0.000837301 -0.912045 0.891966 -0.00161884 -0.906181 0.892959 -0.00242154 -0.899958 0.893996 -0.00326037 -0.893292 0.895083 -0.00414141 -0.886116 0.896218 -0.00506248 -0.878376 0.897395 -0.00601903 -0.870038 0.898605 -0.00700511 -0.861083 0.89984 -0.00801498 -0.851505 0.901095 -0.00904392 -0.841313 0.902363 -0.0100884 -0.830531 0.903641 -0.0111458 -0.81919 0.904925 -0.0122128 -0.80733 0.906205 -0.0132829 -0.795 0.907467 -0.014345 -0.782249 0.908689 -0.0153819 -0.769131 0.909843 -0.0163701 -0.755702 0.910893 -0.0172819 -0.74202 0.911806 -0.0180878 -0.728148 0.912547 -0.0187605 -0.714153 0.913093 -0.019279 -0.70011 0.913432 -0.0196308 -0.686099 0.913562 -0.0198133 -0.672207 0.913495 -0.0198337 -0.658521 0.913251 -0.0197059 -0.64513 0.912853 -0.0194478 -0.632119 0.912328 -0.0190778 -4.7159 0.890111 -6.8687e-05 -3.43305 0.890034 -0.000142569 -2.54034 0.89003 -0.000133517 -1.93292 0.890029 -0.00012961 -1.53088 0.890029 -0.00012848 -1.27375 0.89003 -0.000129327 -1.11617 0.89003 -0.00013141 -1.0246 0.89003 -0.000131684 -0.974666 0.890028 -0.000128678 -0.949133 0.890028 -0.000125913 -0.936346 0.890029 -0.000125046 -0.928985 0.890032 -0.000125236 -0.923119 0.890046 -0.000127701 -0.917659 0.890999 -0.00090422 -0.912054 0.891965 -0.00168512 -0.906189 0.892957 -0.00248751 -0.899966 0.893994 -0.0033262 -0.8933 0.895081 -0.00420717 -0.886123 0.896216 -0.00512825 -0.878383 0.897392 -0.00608484 -0.870045 0.898602 -0.007071 -0.861089 0.899838 -0.00808093 -0.851511 0.901092 -0.00910992 -0.841319 0.902361 -0.0101544 -0.830536 0.90364 -0.0112118 -0.819195 0.904923 -0.0122787 -0.807335 0.906203 -0.0133488 -0.795005 0.907465 -0.0144108 -0.782254 0.908687 -0.0154475 -0.769135 0.909841 -0.0164355 -0.755706 0.910891 -0.0173471 -0.742023 0.911804 -0.0181527 -0.72815 0.912545 -0.0188252 -0.714154 0.913092 -0.0193434 -0.700111 0.91343 -0.0196949 -0.6861 0.91356 -0.0198772 -0.672206 0.913493 -0.0198973 -0.65852 0.913249 -0.0197692 -0.645128 0.912852 -0.0195107 -0.632117 0.912327 -0.0191403 -4.7159 0.890177 -0.000124333 -3.43307 0.890031 -0.000274946 -2.54038 0.890025 -0.0002594 -1.93295 0.890023 -0.000252361 -1.53091 0.890024 -0.000250394 -1.27377 0.890025 -0.000252258 -1.11619 0.890027 -0.00025661 -1.02462 0.890026 -0.000257623 -0.974676 0.890023 -0.000252634 -0.949141 0.890023 -0.000248266 -0.936352 0.890027 -0.000247426 -0.928987 0.890033 -0.000248706 -0.923129 0.890061 -0.000257145 -0.917674 0.890998 -0.00102601 -0.912069 0.891962 -0.00180529 -0.906204 0.892953 -0.00260686 -0.899981 0.893989 -0.00344503 -0.893314 0.895077 -0.00432565 -0.886136 0.896212 -0.00524651 -0.878396 0.897388 -0.00620298 -0.870057 0.898598 -0.00718906 -0.861101 0.899834 -0.00819894 -0.851522 0.901089 -0.00922785 -0.841329 0.902357 -0.0102722 -0.830546 0.903636 -0.0113295 -0.819204 0.90492 -0.0123961 -0.807344 0.9062 -0.0134658 -0.795013 0.907462 -0.0145274 -0.782261 0.908684 -0.0155636 -0.769142 0.909837 -0.0165511 -0.755712 0.910888 -0.017462 -0.742028 0.9118 -0.0182671 -0.728154 0.912542 -0.0189389 -0.714157 0.913089 -0.0194566 -0.700112 0.913427 -0.0198074 -0.6861 0.913558 -0.0199891 -0.672206 0.913491 -0.0200084 -0.658518 0.913247 -0.0198796 -0.645125 0.91285 -0.0196203 -0.632114 0.912324 -0.019249 -4.7159 0.89029 -0.000214571 -3.43311 0.890027 -0.000506342 -2.54043 0.890015 -0.000481386 -1.933 0.890012 -0.000469397 -1.53095 0.890014 -0.0004662 -1.2738 0.890018 -0.000470057 -1.11622 0.89002 -0.000478548 -1.02464 0.890019 -0.000481064 -0.974695 0.890015 -0.000473369 -0.949157 0.890015 -0.000467328 -0.936364 0.890022 -0.000467525 -0.928992 0.890035 -0.000471774 -0.923148 0.890087 -0.000493764 -0.917702 0.890998 -0.00124618 -0.912097 0.891957 -0.00202172 -0.906231 0.892947 -0.00282131 -0.900007 0.893983 -0.0036581 -0.893339 0.895069 -0.00453768 -0.88616 0.896204 -0.00545777 -0.878419 0.897381 -0.00641363 -0.870079 0.898591 -0.00739923 -0.861121 0.899827 -0.00840868 -0.851541 0.901083 -0.00943714 -0.841348 0.902352 -0.010481 -0.830563 0.903631 -0.0115376 -0.81922 0.904914 -0.0126035 -0.80736 0.906194 -0.0136723 -0.795027 0.907456 -0.0147328 -0.782274 0.908679 -0.0157679 -0.769154 0.909832 -0.0167541 -0.755722 0.910883 -0.0176637 -0.742036 0.911795 -0.0184673 -0.72816 0.912537 -0.0191377 -0.714162 0.913084 -0.0196539 -0.700114 0.913423 -0.0200034 -0.6861 0.913554 -0.0201836 -0.672204 0.913488 -0.0202015 -0.658514 0.913244 -0.0200711 -0.64512 0.912847 -0.0198101 -0.632107 0.912321 -0.0194368 -4.7159 0.890482 -0.000361317 -3.43319 0.890021 -0.000907484 -2.54052 0.89 -0.000869532 -1.93309 0.889995 -0.000849864 -1.53102 0.889998 -0.000844938 -1.27386 0.890005 -0.000852594 -1.11626 0.89001 -0.000868447 -1.02468 0.890008 -0.000873883 -0.974729 0.890002 -0.000862944 -0.949188 0.890002 -0.000856115 -0.936387 0.890014 -0.000859903 -0.929003 0.890038 -0.000871196 -0.923182 0.890129 -0.000919519 -0.917752 0.890999 -0.00164068 -0.912146 0.89195 -0.00240816 -0.906279 0.892937 -0.00320333 -0.900052 0.893972 -0.00403691 -0.893383 0.895058 -0.00491391 -0.886202 0.896192 -0.00583191 -0.878458 0.897369 -0.00678605 -0.870116 0.89858 -0.00777018 -0.861156 0.899817 -0.00877828 -0.851574 0.901072 -0.00980541 -0.841379 0.902342 -0.0108479 -0.830593 0.903621 -0.0119029 -0.819249 0.904906 -0.012967 -0.807386 0.906186 -0.0140337 -0.795052 0.907448 -0.0150918 -0.782297 0.90867 -0.0161242 -0.769174 0.909824 -0.0171076 -0.75574 0.910875 -0.0180142 -0.742051 0.911788 -0.0188148 -0.728171 0.91253 -0.0194822 -0.714169 0.913077 -0.0199955 -0.700118 0.913417 -0.020342 -0.6861 0.913548 -0.0205193 -0.6722 0.913483 -0.0205342 -0.658508 0.913239 -0.0204006 -0.645111 0.912843 -0.020136 -0.632095 0.912317 -0.0197587 -4.7159 0.890806 -0.000600591 -3.43331 0.890011 -0.00159545 -2.54069 0.889974 -0.00154083 -1.93324 0.889965 -0.00150954 -1.53114 0.889972 -0.00150233 -1.27396 0.889984 -0.00151701 -1.11635 0.889994 -0.00154567 -1.02475 0.889992 -0.00155673 -0.974794 0.889981 -0.00154312 -0.949249 0.889981 -0.00153883 -0.936437 0.890004 -0.00155191 -0.929035 0.890048 -0.00157842 -0.923247 0.890191 -0.00167012 -0.917839 0.891003 -0.0023399 -0.912233 0.891939 -0.0030909 -0.906362 0.892922 -0.00387674 -0.900132 0.893954 -0.0047034 -0.893459 0.895039 -0.00557463 -0.886274 0.896174 -0.00648777 -0.878526 0.897351 -0.00743774 -0.87018 0.898562 -0.00841819 -0.861216 0.8998 -0.00942291 -0.851631 0.901057 -0.0104468 -0.841433 0.902327 -0.0114858 -0.830644 0.903608 -0.0125373 -0.819296 0.904892 -0.0135973 -0.807431 0.906173 -0.0146594 -0.795094 0.907435 -0.0157125 -0.782335 0.908658 -0.0167393 -0.769208 0.909812 -0.0177168 -0.755768 0.910863 -0.0186172 -0.742074 0.911776 -0.0194116 -0.728188 0.912519 -0.020073 -0.71418 0.913068 -0.0205803 -0.700123 0.913408 -0.0209209 -0.686098 0.913541 -0.0210924 -0.672193 0.913476 -0.0211014 -0.658495 0.913234 -0.0209614 -0.645094 0.912837 -0.0206899 -0.632074 0.912312 -0.0203048 -4.7159 0.891349 -0.000991597 -3.43351 0.890001 -0.00276017 -2.54096 0.889936 -0.00268683 -1.93349 0.88992 -0.00263846 -1.53136 0.889931 -0.00262853 -1.27414 0.889953 -0.00265581 -1.1165 0.889971 -0.00270625 -1.02488 0.889968 -0.0027282 -0.974919 0.88995 -0.00271582 -0.949374 0.889951 -0.00272276 -0.936548 0.889991 -0.0027567 -0.929118 0.890069 -0.00281308 -0.923369 0.890275 -0.00296296 -0.91799 0.891017 -0.0035623 -0.912382 0.891928 -0.00428192 -0.906505 0.892901 -0.00504918 -0.900268 0.893929 -0.00586174 -0.893587 0.895012 -0.00672099 -0.886395 0.896146 -0.00762374 -0.87864 0.897324 -0.00856454 -0.870287 0.898537 -0.00953674 -0.861317 0.899776 -0.0105338 -0.851725 0.901035 -0.0115503 -0.841521 0.902307 -0.012582 -0.830727 0.903589 -0.0136256 -0.819375 0.904874 -0.0146771 -0.807504 0.906156 -0.0157298 -0.795161 0.907419 -0.0167726 -0.782396 0.908641 -0.0177883 -0.769262 0.909795 -0.018754 -0.755814 0.910847 -0.0196424 -0.74211 0.911761 -0.0204246 -0.728214 0.912506 -0.021074 -0.714195 0.913056 -0.0215697 -0.700127 0.913398 -0.021899 -0.686092 0.913532 -0.0220593 -0.672177 0.913469 -0.0220568 -0.658471 0.913228 -0.0219048 -0.645061 0.912833 -0.0216201 -0.632034 0.912307 -0.0212201 -4.7159 0.892259 -0.00163165 -3.43385 0.889999 -0.00470292 -2.54143 0.889884 -0.0046143 -1.93392 0.889857 -0.00454177 -1.53172 0.889876 -0.00452913 -1.27444 0.889915 -0.00457828 -1.11677 0.889946 -0.00466489 -1.02513 0.889942 -0.00470815 -0.975171 0.88991 -0.00470883 -0.949639 0.889915 -0.00474609 -0.936794 0.889985 -0.00482182 -0.929324 0.890113 -0.00492934 -0.923605 0.890379 -0.00513985 -0.91825 0.891054 -0.0056618 -0.912638 0.891926 -0.00632828 -0.906748 0.892881 -0.0070609 -0.900497 0.893901 -0.00784644 -0.893802 0.89498 -0.0086823 -0.886597 0.896113 -0.00956426 -0.878829 0.897292 -0.0104863 -0.870463 0.898506 -0.0114413 -0.861481 0.899748 -0.0124223 -0.851878 0.90101 -0.0134234 -0.841664 0.902285 -0.0144395 -0.83086 0.903569 -0.0154671 -0.819499 0.904856 -0.0165014 -0.807619 0.906139 -0.0175357 -0.795266 0.907402 -0.0185584 -0.78249 0.908625 -0.0195526 -0.769343 0.90978 -0.0204959 -0.75588 0.910833 -0.0213613 -0.742161 0.911748 -0.0221206 -0.728248 0.912494 -0.0227475 -0.71421 0.913047 -0.0232212 -0.700125 0.913392 -0.0235292 -0.686073 0.913529 -0.0236684 -0.672141 0.913469 -0.0236446 -0.65842 0.913229 -0.0234702 -0.644997 0.912835 -0.023161 -0.631957 0.91231 -0.0227337 -4.7159 0.893777 -0.00268073 -3.43442 0.890037 -0.00788956 -2.54221 0.889836 -0.00780272 -1.93466 0.889789 -0.00769763 -1.53235 0.88982 -0.00768335 -1.27499 0.889885 -0.00776919 -1.11726 0.889939 -0.00791445 -1.02562 0.889932 -0.00799944 -0.97569 0.889882 -0.00804134 -0.950199 0.889895 -0.00814515 -0.937331 0.890011 -0.00829443 -0.929799 0.890201 -0.0084733 -0.924068 0.890512 -0.00873245 -0.918709 0.891138 -0.00918651 -0.913079 0.891959 -0.00977863 -0.907161 0.892887 -0.0104533 -0.90088 0.893892 -0.0111909 -0.894158 0.894963 -0.0119842 -0.886925 0.896093 -0.0128271 -0.879132 0.897272 -0.0137131 -0.870743 0.898489 -0.0146344 -0.86174 0.899734 -0.0155836 -0.852117 0.901 -0.0165537 -0.841884 0.902279 -0.0175393 -0.831063 0.903567 -0.0185354 -0.819685 0.904857 -0.0195367 -0.807789 0.906141 -0.0205357 -0.795419 0.907406 -0.0215208 -0.782623 0.90863 -0.0224753 -0.769455 0.909785 -0.0233772 -0.755967 0.910839 -0.0242005 -0.742221 0.911756 -0.0249177 -0.728279 0.912505 -0.0255033 -0.714212 0.913061 -0.025937 -0.700097 0.91341 -0.0262061 -0.686016 0.913551 -0.0263069 -0.672058 0.913494 -0.0262442 -0.658312 0.913258 -0.0260289 -0.644865 0.912865 -0.0256756 -0.631805 0.91234 -0.0251992 -4.7159 0.896308 -0.00440183 -3.43534 0.890202 -0.0130202 -2.54351 0.889854 -0.0129815 -1.93589 0.889773 -0.0128354 -1.53344 0.889822 -0.0128226 -1.27596 0.88993 -0.0129675 -1.11819 0.89002 -0.0132054 -1.02658 0.890009 -0.0133711 -0.976762 0.889933 -0.013511 -0.951365 0.889964 -0.0137391 -0.938454 0.890136 -0.0139974 -0.93081 0.890383 -0.0142543 -0.924983 0.890723 -0.0145466 -0.919546 0.891324 -0.0149501 -0.913852 0.8921 -0.0154607 -0.90787 0.892992 -0.0160542 -0.901526 0.893974 -0.0167163 -0.894744 0.895032 -0.0174384 -0.887458 0.896155 -0.0182138 -0.879615 0.897332 -0.0190351 -0.871181 0.89855 -0.0198945 -0.862136 0.899799 -0.0207839 -0.852475 0.90107 -0.0216958 -0.842208 0.902354 -0.0226234 -0.831355 0.903646 -0.0235605 -0.819947 0.90494 -0.0245006 -0.80802 0.906227 -0.0254353 -0.795618 0.907492 -0.0263525 -0.782788 0.908716 -0.0272358 -0.769582 0.909871 -0.0280642 -0.756054 0.910925 -0.0288129 -0.742263 0.911844 -0.0294558 -0.728274 0.912595 -0.0299684 -0.714159 0.913154 -0.030331 -0.699995 0.913508 -0.0305308 -0.685868 0.913653 -0.0305632 -0.671865 0.913601 -0.0304312 -0.658077 0.913367 -0.0301436 -0.644591 0.912976 -0.0297123 -0.631494 0.91245 -0.0291497 -4.7159 0.900522 -0.00722733 -3.43681 0.89073 -0.0211129 -2.54564 0.890131 -0.0212272 -1.93797 0.889993 -0.0210348 -1.53533 0.890068 -0.0210298 -1.27772 0.890243 -0.0212652 -1.11996 0.890389 -0.0216451 -1.02851 0.890373 -0.0219613 -0.978943 0.890271 -0.0222951 -0.953689 0.890325 -0.0227194 -0.940669 0.890545 -0.0231108 -0.932804 0.890829 -0.0234405 -0.926754 0.891187 -0.0237577 -0.921119 0.89178 -0.0241267 -0.915255 0.89253 -0.0245646 -0.909123 0.893391 -0.025066 -0.902641 0.894347 -0.0256275 -0.895734 0.895386 -0.0262454 -0.888333 0.896497 -0.0269149 -0.880388 0.897667 -0.0276302 -0.871862 0.898883 -0.0283842 -0.862734 0.900133 -0.0291693 -0.852998 0.901407 -0.0299775 -0.842663 0.902695 -0.0308012 -0.831747 0.90399 -0.0316329 -0.820279 0.905286 -0.0324645 -0.808293 0.906572 -0.0332863 -0.795832 0.907836 -0.0340859 -0.782941 0.909057 -0.0348472 -0.76967 0.910208 -0.0355501 -0.756072 0.911258 -0.0361717 -0.742207 0.912174 -0.0366878 -0.72814 0.912924 -0.0370756 -0.713946 0.913484 -0.0373161 -0.699704 0.913838 -0.0373962 -0.685499 0.913986 -0.0373098 -0.671422 0.913935 -0.0370573 -0.657562 0.913701 -0.036644 -0.644008 0.913307 -0.0360779 -0.630845 0.912775 -0.0353677 -4.7159 0.907533 -0.0118682 -3.43914 0.892191 -0.0335921 -2.54913 0.891171 -0.0340753 -1.94147 0.890938 -0.0338406 -1.53865 0.89105 -0.033854 -1.28096 0.891328 -0.0342194 -1.12336 0.89156 -0.0348081 -1.03231 0.891546 -0.0353856 -0.983196 0.891426 -0.0360414 -0.958056 0.891498 -0.036725 -0.944765 0.891736 -0.0372616 -0.936504 0.892031 -0.0376639 -0.930057 0.892395 -0.0380094 -0.924048 0.892992 -0.0383579 -0.917844 0.893736 -0.0387371 -0.911399 0.894582 -0.0391493 -0.904633 0.89552 -0.0395974 -0.897465 0.89654 -0.0400833 -0.889828 0.897633 -0.040607 -0.881669 0.898789 -0.0411665 -0.872951 0.899994 -0.0417579 -0.86365 0.901235 -0.0423758 -0.853758 0.902502 -0.0430137 -0.843281 0.903784 -0.0436639 -0.832235 0.905072 -0.0443184 -0.820645 0.90636 -0.0449679 -0.808542 0.907636 -0.0456017 -0.795967 0.908886 -0.046207 -0.78296 0.910091 -0.0467679 -0.76957 0.911225 -0.0472659 -0.755849 0.912258 -0.0476802 -0.741858 0.913158 -0.0479889 -0.727662 0.913893 -0.0481711 -0.713337 0.91444 -0.0482087 -0.698963 0.914783 -0.0480883 -0.684628 0.91492 -0.0478013 -0.670423 0.914857 -0.0473445 -0.656439 0.91461 -0.046718 -0.642763 0.9142 -0.0459245 -0.629478 0.913647 -0.0449669 -4.7159 0.919195 -0.0194933 -3.44279 0.895872 -0.0523588 -2.55482 0.894166 -0.0536282 -1.94741 0.893779 -0.0533765 -1.54451 0.893939 -0.0534228 -1.28694 0.894371 -0.0539585 -1.12982 0.894732 -0.0548345 -1.03954 0.894753 -0.0558135 -0.991001 0.894642 -0.0569087 -0.965756 0.894714 -0.057891 -0.951909 0.894939 -0.0585915 -0.942997 0.895224 -0.0590849 -0.935915 0.895585 -0.0594764 -0.929295 0.896188 -0.0598204 -0.922506 0.896936 -0.0601548 -0.915506 0.897781 -0.060485 -0.908214 0.898709 -0.0608162 -0.900553 0.899712 -0.0611526 -0.892457 0.900783 -0.0614978 -0.883875 0.90191 -0.0618539 -0.874768 0.903084 -0.0622215 -0.865112 0.904293 -0.0625991 -0.854896 0.905526 -0.0629834 -0.844123 0.906773 -0.0633692 -0.832804 0.908024 -0.0637493 -0.82096 0.909272 -0.0641149 -0.808617 0.910504 -0.0644554 -0.79581 0.911707 -0.0647579 -0.782578 0.912861 -0.0650076 -0.768964 0.913942 -0.0651876 -0.75502 0.914921 -0.0652793 -0.740803 0.915766 -0.0652634 -0.726381 0.916448 -0.0651209 -0.711828 0.916944 -0.0648344 -0.697226 0.917238 -0.0643895 -0.682663 0.917326 -0.0637744 -0.668231 0.917213 -0.0629807 -0.65402 0.916914 -0.0620022 -0.640116 0.916446 -0.0608339 -0.6266 0.91583 -0.0594714 -4.7159 0.938585 -0.0320249 -3.44845 0.904491 -0.0798009 -2.56409 0.901682 -0.0826302 -1.9575 0.901057 -0.0824286 -1.55487 0.901274 -0.0825232 -1.29783 0.901918 -0.0832518 -1.14171 0.902467 -0.0844785 -1.05253 0.90259 -0.0859674 -1.00436 0.902538 -0.0875462 -0.978523 0.902612 -0.088841 -0.963684 0.902816 -0.0897334 -0.953758 0.903084 -0.090349 -0.945712 0.903436 -0.0908135 -0.938156 0.904048 -0.0911718 -0.930448 0.904802 -0.0914749 -0.922551 0.905645 -0.091731 -0.914389 0.90656 -0.0919455 -0.905888 0.907537 -0.092123 -0.896988 0.908565 -0.0922682 -0.88764 0.909636 -0.0923855 -0.877812 0.91074 -0.0924787 -0.86748 0.911867 -0.0925499 -0.856634 0.913008 -0.0925996 -0.845272 0.914154 -0.0926259 -0.833404 0.915298 -0.0926245 -0.821044 0.91643 -0.0925885 -0.808215 0.91754 -0.0925091 -0.794945 0.918614 -0.0923749 -0.781265 0.919634 -0.0921728 -0.767217 0.920576 -0.0918881 -0.752847 0.921412 -0.0915046 -0.738209 0.922113 -0.0910053 -0.723369 0.922651 -0.0903725 -0.708399 0.923004 -0.0895892 -0.69338 0.923156 -0.0886387 -0.678399 0.923101 -0.0875052 -0.663545 0.922843 -0.0861737 -0.648906 0.922394 -0.0846301 -0.634567 0.92177 -0.0828605 -0.620605 0.92099 -0.0808512 -4.7159 0.970816 -0.0526243 -3.45709 0.923358 -0.118703 -2.57912 0.91876 -0.124489 -1.97454 0.917768 -0.124485 -1.57297 0.918031 -0.12464 -1.31719 0.918923 -0.125536 -1.16259 0.919704 -0.127105 -1.07437 0.920005 -0.12908 -1.02577 0.920072 -0.131067 -0.998515 0.920181 -0.132639 -0.982034 0.920385 -0.133726 -0.970557 0.920648 -0.134477 -0.961058 0.920996 -0.135029 -0.952091 0.92162 -0.135405 -0.942989 0.922379 -0.135677 -0.933716 0.923211 -0.135856 -0.9242 0.924094 -0.135948 -0.91437 0.925013 -0.135958 -0.904171 0.925957 -0.135889 -0.893562 0.926915 -0.135746 -0.882515 0.927879 -0.135534 -0.871011 0.928839 -0.135255 -0.859043 0.929788 -0.134912 -0.846611 0.93072 -0.134505 -0.833723 0.93163 -0.134032 -0.82039 0.93251 -0.133488 -0.80663 0.933351 -0.132866 -0.792465 0.934141 -0.132157 -0.777923 0.934864 -0.13135 -0.763038 0.935497 -0.130432 -0.747849 0.936017 -0.129389 -0.732408 0.936394 -0.128207 -0.716772 0.936605 -0.126868 -0.701011 0.936626 -0.125353 -0.6852 0.936443 -0.123644 -0.669423 0.936048 -0.121718 -0.653762 0.935443 -0.119554 -0.638304 0.934636 -0.117129 -0.62313 0.933642 -0.11442 -0.608315 0.932477 -0.111403 -4.7159 1.02439 -0.0864905 -3.47019 0.962125 -0.172134 -2.6034 0.954461 -0.183348 -2.00313 0.952894 -0.183853 -1.60403 0.953113 -0.184079 -1.35034 0.954168 -0.185044 -1.19722 0.955111 -0.186807 -1.1088 0.955574 -0.189047 -1.05823 0.955762 -0.191232 -1.02828 0.955925 -0.192957 -1.00915 0.956141 -0.19417 -0.995275 0.956404 -0.195015 -0.983556 0.956746 -0.195617 -0.972438 0.957374 -0.195968 -0.961209 0.958121 -0.196159 -0.949835 0.958913 -0.196214 -0.938244 0.959721 -0.196138 -0.926366 0.960526 -0.195935 -0.914148 0.961315 -0.19561 -0.901554 0.962073 -0.195165 -0.888559 0.962791 -0.194604 -0.875152 0.963461 -0.193928 -0.861327 0.964076 -0.193137 -0.847088 0.964632 -0.192231 -0.832442 0.965126 -0.191207 -0.8174 0.965552 -0.190057 -0.801977 0.965905 -0.188776 -0.786191 0.966173 -0.187353 -0.770065 0.966344 -0.185777 -0.753626 0.966397 -0.184037 -0.73691 0.966312 -0.182118 -0.719958 0.966063 -0.180004 -0.702824 0.965628 -0.177676 -0.685568 0.964985 -0.175115 -0.668261 0.964119 -0.172295 -0.650979 0.963023 -0.169191 -0.633802 0.961695 -0.165773 -0.616811 0.960142 -0.162011 -0.600087 0.958376 -0.157874 -0.583708 0.956411 -0.153333 -4.7159 1.11342 -0.142174 -3.48996 1.03729 -0.243818 -2.64257 1.02409 -0.264568 -2.05077 1.02152 -0.266255 -1.65621 1.02139 -0.266607 -1.40498 1.02224 -0.267468 -1.25184 1.02303 -0.269107 -1.16062 1.02341 -0.271204 -1.10561 1.02356 -0.273246 -1.07097 1.02367 -0.274884 -1.04756 1.02382 -0.276052 -1.02988 1.02402 -0.276857 -1.01466 1.02428 -0.277389 -1.00016 1.02485 -0.277577 -0.985603 1.0255 -0.277548 -0.970948 1.02616 -0.277334 -0.956119 1.02678 -0.276947 -0.941043 1.02735 -0.276392 -0.925664 1.02784 -0.275671 -0.909947 1.02824 -0.274786 -0.89387 1.02854 -0.273737 -0.87742 1.02872 -0.272523 -0.860595 1.02879 -0.271141 -0.843399 1.02873 -0.269583 -0.825837 1.02854 -0.267842 -0.807921 1.02823 -0.265906 -0.789661 1.02778 -0.263765 -0.771073 1.02718 -0.261403 -0.752173 1.02643 -0.258805 -0.732986 1.0255 -0.255954 -0.713541 1.02438 -0.252832 -0.693874 1.02304 -0.249419 -0.674034 1.02146 -0.245693 -0.654077 1.01963 -0.241627 -0.634071 1.01752 -0.237195 -0.614089 1.01514 -0.232366 -0.594213 1.01247 -0.227107 -0.574527 1.00954 -0.221385 -0.555117 1.00635 -0.215169 -0.536068 1.00291 -0.208428 -4.7159 1.26138 -0.233741 -3.52014 1.17602 -0.340384 -2.70591 1.15303 -0.37605 -2.12976 1.1484 -0.380427 -1.74233 1.14715 -0.381144 -1.49239 1.14702 -0.381688 -1.33546 1.14696 -0.382743 -1.23705 1.14672 -0.384171 -1.17375 1.14639 -0.385618 -1.13121 1.1461 -0.386803 -1.10079 1.14592 -0.387629 -1.0769 1.1458 -0.388133 -1.05594 1.14576 -0.388342 -1.03593 1.14603 -0.388097 -1.01596 1.14636 -0.387558 -0.995999 1.14663 -0.386782 -0.975949 1.1468 -0.385783 -0.955724 1.14684 -0.384568 -0.935262 1.14673 -0.383139 -0.914519 1.14644 -0.381494 -0.893467 1.14597 -0.379629 -0.872091 1.14529 -0.377539 -0.850384 1.1444 -0.375213 -0.828347 1.1433 -0.372637 -0.805982 1.14198 -0.369795 -0.783295 1.14043 -0.366669 -0.760294 1.13866 -0.363237 -0.73699 1.13664 -0.359476 -0.713398 1.13437 -0.355365 -0.689537 1.13182 -0.350877 -0.665436 1.12898 -0.345988 -0.641132 1.12583 -0.340673 -0.616675 1.12235 -0.334905 -0.592125 1.11852 -0.328654 -0.567555 1.11433 -0.321893 -0.543048 1.10979 -0.314589 -0.518694 1.10488 -0.306713 -0.494592 1.09964 -0.298234 -0.47084 1.09409 -0.289125 -0.447541 1.08826 -0.279362 -4.7159 1.50726 -0.384328 -3.56699 1.42215 -0.477801 -2.8075 1.38416 -0.53079 -2.25886 1.37481 -0.540834 -1.88144 1.37083 -0.542753 -1.62936 1.36843 -0.542947 -1.46238 1.3665 -0.543013 -1.35031 1.36474 -0.543268 -1.27288 1.36315 -0.543621 -1.21727 1.3618 -0.543886 -1.17522 1.36068 -0.543932 -1.1409 1.35971 -0.543722 -1.11028 1.35884 -0.543195 -1.08099 1.35831 -0.542063 -1.05198 1.35777 -0.540539 -1.02318 1.35711 -0.538707 -0.994481 1.35625 -0.536589 -0.965757 1.35518 -0.53419 -0.936922 1.35383 -0.531511 -0.907916 1.35221 -0.528548 -0.878695 1.35028 -0.525289 -0.84923 1.34803 -0.521722 -0.819505 1.34544 -0.517828 -0.789508 1.34251 -0.513584 -0.759235 1.33923 -0.508964 -0.728684 1.33559 -0.503938 -0.697859 1.33158 -0.498475 -0.666767 1.3272 -0.492543 -0.635423 1.32241 -0.486111 -0.603848 1.31721 -0.479145 -0.572075 1.31158 -0.471616 -0.54015 1.30549 -0.463493 -0.508133 1.29894 -0.454746 -0.476098 1.2919 -0.445346 -0.444135 1.28439 -0.435265 -0.412344 1.2764 -0.424474 -0.380836 1.26797 -0.412947 -0.34973 1.25913 -0.400657 -0.319145 1.24991 -0.387582 -0.289205 1.24037 -0.373703 -4.7159 1.91586 -0.631996 -3.63867 1.84444 -0.694228 -2.96336 1.79076 -0.753881 -2.45902 1.77192 -0.772174 -2.09591 1.76223 -0.777192 -1.83797 1.75562 -0.77783 -1.65389 1.75032 -0.777091 -1.52018 1.74576 -0.776029 -1.42057 1.74176 -0.77495 -1.34402 1.73825 -0.773841 -1.28283 1.73517 -0.772599 -1.23096 1.73236 -0.771133 -1.18392 1.72969 -0.7693 -1.1389 1.72738 -0.766659 -1.09465 1.725 -0.763497 -1.05104 1.72239 -0.759929 -1.00791 1.71948 -0.755985 -0.965057 1.71621 -0.751671 -0.922363 1.71255 -0.746984 -0.879721 1.70846 -0.741912 -0.837051 1.70391 -0.736438 -0.794295 1.69887 -0.730538 -0.751409 1.69334 -0.724183 -0.708361 1.68728 -0.717337 -0.665129 1.6807 -0.709964 -0.621698 1.67357 -0.70202 -0.578063 1.66587 -0.693464 -0.534227 1.6576 -0.684253 -0.490205 1.64874 -0.674344 -0.446024 1.63925 -0.663697 -0.401726 1.62912 -0.652274 -0.357372 1.61835 -0.640041 -0.313039 1.60691 -0.626964 -0.268825 1.5948 -0.613011 -0.224844 1.58204 -0.598155 -0.181224 1.56866 -0.582366 -0.138106 1.5547 -0.565619 -0.0956377 1.54021 -0.54789 -0.0539712 1.52527 -0.529158 -0.0132598 1.50995 -0.509404 -4.7159 2.59484 -1.03937 -3.73543 2.54694 -1.06548 -3.17324 2.49098 -1.10623 -2.72993 2.46129 -1.12561 -2.38914 2.44292 -1.13307 -2.12724 2.42969 -1.13477 -1.92369 2.41909 -1.1338 -1.76279 2.41004 -1.13166 -1.63311 2.40203 -1.12905 -1.52627 2.39481 -1.1262 -1.43578 2.38822 -1.12311 -1.35602 2.38201 -1.11971 -1.28238 2.37597 -1.11582 -1.21179 2.37028 -1.1109 -1.14285 2.36442 -1.1053 -1.07531 2.35822 -1.09915 -1.00887 2.3516 -1.0925 -0.943272 2.34448 -1.08534 -0.878283 2.33681 -1.07767 -0.813724 2.32852 -1.06947 -0.749446 2.31959 -1.0607 -0.685331 2.30996 -1.05134 -0.621282 2.2996 -1.04134 -0.557222 2.28848 -1.03064 -0.493092 2.27657 -1.0192 -0.428849 2.26384 -1.00695 -0.364469 2.25026 -0.993838 -0.29994 2.23579 -0.979802 -0.235275 2.22042 -0.964784 -0.170503 2.20409 -0.948729 -0.105678 2.1868 -0.931583 -0.0408799 2.16853 -0.9133 --0.0237873 2.14926 -0.893832 --0.0881941 2.129 -0.87314 --0.152188 2.10778 -0.851183 --0.215594 2.08564 -0.827927 --0.278224 2.06266 -0.803338 --0.339875 2.03891 -0.777387 --0.400339 2.01451 -0.750049 --0.459401 1.98958 -0.721304 -4.7159 3.72311 -1.70946 -3.82265 3.69588 -1.70962 -3.35457 3.65635 -1.71913 -2.96524 3.62779 -1.72329 -2.64874 3.60626 -1.72284 -2.39014 3.58894 -1.71937 -2.1755 3.57419 -1.71411 -1.99399 3.56106 -1.70787 -1.83762 3.54902 -1.70109 -1.70042 3.53775 -1.69398 -1.57768 3.52702 -1.6866 -1.46512 3.51659 -1.67886 -1.35907 3.50623 -1.67062 -1.25694 3.49597 -1.66143 -1.15734 3.48543 -1.65154 -1.05978 3.47444 -1.64106 -0.963777 3.46292 -1.63002 -0.868906 3.45075 -1.61841 -0.774798 3.43786 -1.6062 -0.681142 3.42415 -1.59336 -0.587673 3.40955 -1.57985 -0.494166 3.39397 -1.56561 -0.400431 3.37733 -1.55057 -0.306308 3.35954 -1.53466 -0.21167 3.34051 -1.51778 -0.116418 3.32017 -1.49985 -0.0204823 3.29842 -1.48075 --0.0761719 3.27518 -1.4604 --0.173546 3.25036 -1.43868 --0.271603 3.2239 -1.41548 --0.370263 3.19572 -1.3907 --0.469403 3.16578 -1.36422 --0.568855 3.13404 -1.33596 --0.668405 3.10049 -1.3058 --0.767794 3.06516 -1.27366 --0.866724 3.0281 -1.23945 --0.96486 2.98943 -1.20311 --1.06184 2.94926 -1.16456 --1.15728 2.90779 -1.12375 --1.25079 2.86521 -1.08066 -4.7159 5.59799 -2.81182 -3.60489 5.59154 -2.79168 -2.78439 5.5851 -2.77155 -2.18578 5.57865 -2.75141 -1.7556 5.57221 -2.73128 -1.45224 5.56577 -2.71114 -1.24328 5.55932 -2.69101 -1.10348 5.55288 -2.67087 -1.01317 5.54643 -2.65074 -0.957044 5.53999 -2.6306 -0.923173 5.53355 -2.61047 -0.90227 5.5271 -2.59033 -0.887104 5.52066 -2.5702 -0.872388 5.51422 -2.55006 -0.855223 5.50777 -2.52992 -0.83344 5.50133 -2.50979 -0.805162 5.49488 -2.48965 -0.768792 5.48844 -2.46952 -0.722997 5.482 -2.44938 -0.666698 5.47555 -2.42925 -0.599052 5.46911 -2.40911 -0.519441 5.46264 -2.38898 -0.427463 5.45529 -2.36884 -0.322938 5.44625 -2.34871 -0.205898 5.43493 -2.32857 -0.0765701 5.42069 -2.30821 --0.0646154 5.40288 -2.28707 --0.217037 5.38088 -2.26491 --0.379894 5.35408 -2.24147 --0.552224 5.32196 -2.21646 --0.732916 5.28408 -2.18958 --0.920732 5.24014 -2.16049 --1.11434 5.18998 -2.12885 --1.31231 5.13358 -2.09429 --1.51319 5.07111 -2.05645 --1.71548 5.0029 -2.01494 --1.91772 4.92942 -1.9694 --2.11844 4.85133 -1.91948 --2.31626 4.76937 -1.86484 --2.50986 4.68442 -1.80518 -0.926957 0.923781 -0.000762398 -0.9215 0.924785 -0.00152575 -0.915792 0.925815 -0.0023095 -0.909735 0.92689 -0.00312836 -0.903247 0.928017 -0.00398827 -0.896262 0.929194 -0.00488712 -0.888729 0.930413 -0.00582046 -0.880613 0.931668 -0.00678253 -0.871896 0.932949 -0.0077677 -0.862573 0.934249 -0.00877138 -0.852652 0.935564 -0.00979011 -0.842156 0.93689 -0.0108214 -0.831116 0.93822 -0.0118619 -0.819572 0.939547 -0.0129054 -0.807569 0.940855 -0.013941 -0.795157 0.942123 -0.0149519 -0.782386 0.943319 -0.0159154 -0.76931 0.944408 -0.0168042 -0.755985 0.945354 -0.0175897 -0.742472 0.946122 -0.0182454 -0.728835 0.946689 -0.0187509 -0.715146 0.947039 -0.0190938 -0.701483 0.947174 -0.0192719 -0.687929 0.947104 -0.019292 -0.674572 0.946851 -0.0191677 -0.661498 0.946439 -0.0189165 -0.64879 0.945894 -0.0185562 -4.7159 0.922795 -1.1472e-05 -3.43564 0.92278 -2.4204e-05 -2.54481 0.922779 -2.2364e-05 -1.93874 0.922779 -2.1628e-05 -1.53766 0.922779 -2.1398e-05 -1.28121 0.922779 -2.147e-05 -1.12411 0.922778 -2.1729e-05 -1.03289 0.922778 -2.1745e-05 -0.983198 0.922778 -2.1195e-05 -0.957858 0.922777 -2.0594e-05 -0.945232 0.922777 -2.0318e-05 -0.938016 0.922778 -2.0219e-05 -0.932279 0.92278 -2.0069e-05 -0.926959 0.92378 -0.000782317 -0.921503 0.924784 -0.00154562 -0.915795 0.925814 -0.00232938 -0.909737 0.926889 -0.00314828 -0.903249 0.928016 -0.00400826 -0.896264 0.929193 -0.00490718 -0.888731 0.930413 -0.00584061 -0.880615 0.931667 -0.00680277 -0.871898 0.932948 -0.00778802 -0.862574 0.934249 -0.00879177 -0.852654 0.935564 -0.00981057 -0.842158 0.936889 -0.0108419 -0.831118 0.93822 -0.0118825 -0.819573 0.939547 -0.012926 -0.80757 0.940855 -0.0139616 -0.795158 0.942122 -0.0149726 -0.782387 0.943318 -0.015936 -0.769311 0.944407 -0.0168248 -0.755986 0.945353 -0.0176103 -0.742473 0.946122 -0.0182661 -0.728835 0.946688 -0.0187715 -0.715146 0.947039 -0.0191144 -0.701483 0.947174 -0.0192925 -0.687929 0.947104 -0.0193125 -0.674572 0.946851 -0.0191882 -0.661497 0.946439 -0.018937 -0.64879 0.945894 -0.0185766 -4.7159 0.922819 -2.9957e-05 -3.43564 0.922779 -6.6316e-05 -2.54482 0.922778 -6.1659e-05 -1.93875 0.922777 -5.974e-05 -1.53767 0.922777 -5.9146e-05 -1.28121 0.922777 -5.9387e-05 -1.12412 0.922777 -6.0201e-05 -1.03289 0.922777 -6.0437e-05 -0.983201 0.922776 -5.9144e-05 -0.95786 0.922776 -5.7668e-05 -0.945234 0.922776 -5.7045e-05 -0.938017 0.922777 -5.6926e-05 -0.932282 0.922784 -5.7237e-05 -0.926964 0.92378 -0.000818489 -0.921508 0.924783 -0.00158158 -0.915799 0.925813 -0.00236527 -0.909742 0.926887 -0.00318417 -0.903254 0.928015 -0.00404418 -0.896268 0.929192 -0.00494319 -0.888735 0.930411 -0.00587671 -0.880619 0.931666 -0.00683895 -0.871901 0.932947 -0.00782429 -0.862578 0.934247 -0.00882812 -0.852657 0.935562 -0.00984697 -0.842161 0.936888 -0.0108784 -0.831121 0.938218 -0.0119189 -0.819576 0.939546 -0.0129624 -0.807573 0.940854 -0.0139981 -0.79516 0.942121 -0.0150089 -0.782389 0.943317 -0.0159723 -0.769313 0.944406 -0.0168611 -0.755988 0.945352 -0.0176465 -0.742474 0.946121 -0.0183022 -0.728836 0.946687 -0.0188075 -0.715146 0.947038 -0.0191504 -0.701483 0.947173 -0.0193283 -0.687929 0.947103 -0.0193483 -0.674571 0.94685 -0.0192239 -0.661496 0.946438 -0.0189725 -0.648788 0.945893 -0.018612 -4.7159 0.92286 -5.9454e-05 -3.43566 0.922778 -0.00013985 -2.54484 0.922774 -0.000130911 -1.93877 0.922773 -0.000127094 -1.53768 0.922773 -0.000125933 -1.28122 0.922774 -0.000126536 -1.12413 0.922774 -0.000128435 -1.0329 0.922774 -0.000129229 -0.983206 0.922773 -0.000126896 -0.957865 0.922773 -0.000124195 -0.945237 0.922774 -0.000123233 -0.938018 0.922777 -0.000123377 -0.932287 0.922792 -0.000125776 -0.926972 0.923779 -0.000883989 -0.921516 0.924781 -0.00164645 -0.915807 0.92581 -0.00242986 -0.90975 0.926885 -0.00324862 -0.903261 0.928013 -0.00410858 -0.896276 0.929189 -0.00500759 -0.888742 0.930409 -0.00594116 -0.880625 0.931663 -0.00690347 -0.871908 0.932944 -0.00788887 -0.862584 0.934245 -0.00889273 -0.852663 0.935561 -0.00991158 -0.842166 0.936886 -0.010943 -0.831126 0.938217 -0.0119834 -0.819581 0.939544 -0.0130268 -0.807578 0.940852 -0.0140623 -0.795164 0.942119 -0.015073 -0.782393 0.943315 -0.0160362 -0.769316 0.944405 -0.0169247 -0.755991 0.94535 -0.0177099 -0.742476 0.946119 -0.0183653 -0.728838 0.946686 -0.0188704 -0.715147 0.947037 -0.019213 -0.701483 0.947172 -0.0193908 -0.687928 0.947102 -0.0194104 -0.67457 0.94685 -0.0192858 -0.661495 0.946438 -0.019034 -0.648786 0.945893 -0.0186732 -4.7159 0.92293 -0.000106535 -3.43568 0.922775 -0.000268083 -2.54487 0.922768 -0.000252754 -1.93879 0.922767 -0.000245919 -1.53771 0.922767 -0.000243888 -1.28124 0.922769 -0.000245241 -1.12414 0.92277 -0.000249169 -1.03291 0.92277 -0.000251089 -0.983217 0.922768 -0.000247291 -0.957874 0.922768 -0.000242992 -0.945243 0.922771 -0.000241942 -0.93802 0.922777 -0.000243097 -0.932297 0.922806 -0.00025124 -0.926987 0.923778 -0.00100204 -0.921531 0.924778 -0.00176293 -0.915822 0.925807 -0.00254555 -0.909764 0.926881 -0.00336382 -0.903275 0.928008 -0.00422347 -0.896289 0.929185 -0.00512228 -0.888754 0.930405 -0.00605573 -0.880637 0.93166 -0.00701796 -0.871919 0.932941 -0.00800328 -0.862594 0.934242 -0.00900704 -0.852673 0.935557 -0.0100257 -0.842175 0.936883 -0.0110569 -0.831135 0.938214 -0.0120971 -0.819589 0.939541 -0.0131402 -0.807585 0.940849 -0.0141752 -0.795172 0.942116 -0.0151854 -0.782399 0.943312 -0.016148 -0.769322 0.944402 -0.017036 -0.755995 0.945348 -0.0178206 -0.74248 0.946117 -0.0184754 -0.72884 0.946684 -0.0189799 -0.715148 0.947035 -0.0193219 -0.701483 0.94717 -0.0194991 -0.687928 0.947101 -0.0195182 -0.674568 0.946848 -0.0193929 -0.661492 0.946437 -0.0191405 -0.648783 0.945892 -0.0187789 -4.7159 0.923049 -0.000182002 -3.43572 0.922771 -0.000490561 -2.54492 0.922759 -0.000465974 -1.93884 0.922755 -0.000454407 -1.53774 0.922757 -0.00045108 -1.28127 0.92276 -0.000453927 -1.12417 0.922763 -0.00046154 -1.03293 0.922763 -0.000465561 -0.983235 0.92276 -0.000459784 -0.957889 0.92276 -0.000453704 -0.945254 0.922766 -0.000453428 -0.938024 0.922778 -0.000457337 -0.932315 0.92283 -0.000478391 -0.927014 0.923777 -0.0012134 -0.921558 0.924773 -0.0019707 -0.915848 0.9258 -0.00275143 -0.909789 0.926875 -0.0035684 -0.903299 0.928002 -0.00442706 -0.896311 0.929178 -0.00532513 -0.888776 0.930399 -0.00625802 -0.880658 0.931653 -0.00721977 -0.871938 0.932935 -0.00820466 -0.862613 0.934236 -0.00920796 -0.85269 0.935552 -0.0102261 -0.842192 0.936878 -0.0112567 -0.83115 0.938209 -0.0122961 -0.819604 0.939536 -0.0133383 -0.807599 0.940844 -0.0143723 -0.795184 0.942112 -0.0153813 -0.782411 0.943308 -0.0163426 -0.769332 0.944398 -0.0172293 -0.756003 0.945344 -0.0180125 -0.742486 0.946113 -0.018666 -0.728844 0.946681 -0.0191693 -0.715151 0.947032 -0.0195101 -0.701483 0.947168 -0.019686 -0.687926 0.947099 -0.0197038 -0.674565 0.946847 -0.0195773 -0.661487 0.946436 -0.0193235 -0.648776 0.945891 -0.0189603 -4.7159 0.923251 -0.000303617 -3.43579 0.922764 -0.000873426 -2.54501 0.922743 -0.000836 -1.93892 0.922737 -0.000817155 -1.53781 0.92274 -0.000811962 -1.28133 0.922746 -0.000817689 -1.12421 0.922751 -0.000831839 -1.03297 0.922751 -0.000839653 -0.983268 0.922747 -0.000831534 -0.957919 0.922747 -0.000824229 -0.945277 0.922757 -0.000826946 -0.938036 0.92278 -0.000837366 -0.932349 0.922869 -0.000883342 -0.927062 0.923776 -0.00158857 -0.921604 0.924765 -0.00233818 -0.915893 0.92579 -0.00311468 -0.909832 0.926864 -0.00392862 -0.90334 0.927991 -0.00478484 -0.896351 0.929168 -0.00568096 -0.888813 0.930388 -0.00661221 -0.880693 0.931643 -0.00757256 -0.871972 0.932925 -0.00855615 -0.862644 0.934227 -0.00955816 -0.85272 0.935543 -0.010575 -0.84222 0.93687 -0.011604 -0.831177 0.938201 -0.0126416 -0.819629 0.939529 -0.0136817 -0.807623 0.940837 -0.0147134 -0.795206 0.942105 -0.0157199 -0.78243 0.943301 -0.0166785 -0.769348 0.944391 -0.0175623 -0.756017 0.945338 -0.0183427 -0.742496 0.946108 -0.0189935 -0.728851 0.946676 -0.019494 -0.715153 0.947029 -0.0198323 -0.701483 0.947165 -0.0200057 -0.687922 0.947097 -0.0200211 -0.674558 0.946845 -0.0198919 -0.661478 0.946435 -0.0196353 -0.648765 0.94589 -0.0192689 -4.7159 0.92359 -0.000500582 -3.4359 0.922755 -0.00152536 -2.54516 0.922718 -0.00147129 -1.93906 0.922708 -0.00144151 -1.53793 0.922713 -0.00143376 -1.28142 0.922724 -0.00144486 -1.12429 0.922733 -0.00147034 -1.03303 0.922735 -0.00148492 -0.98333 0.922727 -0.00147495 -0.957978 0.922727 -0.00146896 -0.945325 0.922746 -0.00147967 -0.938066 0.922787 -0.00150409 -0.93241 0.922927 -0.00159102 -0.927144 0.923778 -0.00224736 -0.921686 0.924754 -0.00298136 -0.915971 0.925776 -0.00374905 -0.909907 0.926848 -0.00455644 -0.903412 0.927974 -0.00540724 -0.896419 0.929151 -0.0062988 -0.888877 0.930372 -0.00722614 -0.880754 0.931629 -0.00818303 -0.872028 0.932912 -0.00916343 -0.862698 0.934215 -0.0101623 -0.85277 0.935532 -0.0111759 -0.842268 0.936859 -0.0122014 -0.831221 0.938191 -0.0132352 -0.819671 0.939519 -0.0142709 -0.807661 0.940828 -0.0152978 -0.795241 0.942096 -0.016299 -0.782461 0.943292 -0.0172521 -0.769375 0.944383 -0.0181302 -0.756038 0.945331 -0.0189049 -0.742511 0.946102 -0.0195502 -0.72886 0.946671 -0.0200454 -0.715157 0.947025 -0.0203786 -0.701481 0.947163 -0.0205472 -0.687914 0.947096 -0.0205577 -0.674546 0.946845 -0.0204234 -0.661461 0.946435 -0.0201614 -0.648744 0.945892 -0.0197888 -4.7159 0.924159 -0.000820912 -3.4361 0.922748 -0.00262145 -2.54543 0.922683 -0.0025481 -1.9393 0.922666 -0.0025024 -1.53813 0.922674 -0.00249138 -1.28159 0.922693 -0.00251218 -1.12443 0.92271 -0.00255682 -1.03316 0.922713 -0.00258348 -0.983449 0.9227 -0.00257471 -0.958097 0.9227 -0.00257703 -0.945431 0.922735 -0.00260591 -0.938143 0.922806 -0.00265768 -0.932525 0.923008 -0.00279976 -0.927285 0.923791 -0.00338877 -0.921826 0.924744 -0.0040932 -0.916105 0.925759 -0.00484338 -0.910034 0.926828 -0.00563752 -0.903532 0.927953 -0.0064771 -0.896532 0.92913 -0.00735896 -0.888984 0.930352 -0.00827775 -0.880854 0.93161 -0.00922696 -0.872123 0.932895 -0.0102002 -0.862786 0.934199 -0.0111922 -0.852853 0.935518 -0.0121989 -0.842345 0.936847 -0.013217 -0.831294 0.938179 -0.0142428 -0.819739 0.939508 -0.0152697 -0.807724 0.940818 -0.0162869 -0.795298 0.942086 -0.0172778 -0.782511 0.943284 -0.01822 -0.769417 0.944376 -0.0190871 -0.756071 0.945324 -0.0198508 -0.742534 0.946097 -0.0204854 -0.728873 0.946668 -0.0209705 -0.71516 0.947024 -0.0212939 -0.701474 0.947164 -0.0214532 -0.687898 0.9471 -0.0214545 -0.674521 0.946851 -0.0213107 -0.661428 0.946442 -0.0210384 -0.648704 0.9459 -0.0206543 -4.7159 0.925111 -0.00134356 -3.43642 0.922756 -0.00443743 -2.54587 0.922643 -0.00434673 -1.93971 0.922612 -0.0042787 -1.53847 0.922626 -0.0042639 -1.28188 0.922659 -0.00430161 -1.12468 0.922689 -0.00437783 -1.0334 0.922694 -0.00442615 -0.983687 0.922674 -0.0044278 -0.958346 0.922675 -0.00445421 -0.945661 0.922736 -0.00451975 -0.938335 0.922854 -0.00461837 -0.932745 0.923116 -0.00481857 -0.927529 0.923832 -0.00533247 -0.922065 0.92475 -0.00598674 -0.916332 0.92575 -0.00670438 -0.910248 0.926813 -0.0074732 -0.903733 0.927936 -0.00829094 -0.89672 0.929113 -0.00915347 -0.88916 0.930336 -0.0100549 -0.881018 0.931596 -0.0109882 -0.872275 0.932883 -0.0119466 -0.862928 0.934191 -0.0129243 -0.852985 0.935512 -0.0139167 -0.842469 0.936843 -0.01492 -0.831409 0.938177 -0.01593 -0.819845 0.939507 -0.0169398 -0.807821 0.940818 -0.0179385 -0.795384 0.942087 -0.0189097 -0.782585 0.943286 -0.0198315 -0.769478 0.944379 -0.0206777 -0.756117 0.94533 -0.0214208 -0.742564 0.946105 -0.0220355 -0.728886 0.94668 -0.0225016 -0.715156 0.947039 -0.0228071 -0.701453 0.947183 -0.022949 -0.687862 0.947121 -0.0229333 -0.674471 0.946875 -0.022772 -0.661365 0.946469 -0.0224807 -0.648629 0.945927 -0.0220756 -4.7159 0.926699 -0.00219837 -3.43695 0.922822 -0.00739676 -2.5466 0.922626 -0.00730211 -1.9404 0.922574 -0.00720432 -1.53906 0.922597 -0.00718588 -1.28238 0.922652 -0.00725198 -1.12514 0.922704 -0.00737889 -1.03385 0.922713 -0.00746624 -0.984171 0.922681 -0.00750036 -0.958868 0.922689 -0.00758135 -0.946161 0.92279 -0.00771178 -0.938775 0.922967 -0.00787622 -0.933175 0.923274 -0.00812355 -0.927955 0.923941 -0.0085698 -0.922474 0.924812 -0.00915283 -0.916716 0.925788 -0.00981584 -0.910604 0.92684 -0.0105397 -0.904063 0.927958 -0.0113177 -0.897025 0.929133 -0.0121441 -0.889441 0.930357 -0.0130121 -0.881278 0.93162 -0.0139145 -0.872515 0.93291 -0.0148437 -0.863149 0.934222 -0.0157933 -0.853189 0.935546 -0.0167576 -0.842656 0.93688 -0.0177323 -0.831581 0.938218 -0.0187121 -0.820002 0.93955 -0.0196899 -0.807961 0.940862 -0.0206544 -0.795507 0.942133 -0.0215895 -0.782687 0.943333 -0.0224738 -0.769557 0.944427 -0.0232822 -0.756171 0.945381 -0.0239881 -0.742591 0.94616 -0.0245667 -0.728886 0.946738 -0.0249984 -0.715128 0.947102 -0.0252713 -0.701398 0.94725 -0.0253821 -0.687782 0.947193 -0.0253355 -0.674366 0.94695 -0.0251426 -0.661239 0.946546 -0.0248175 -0.648483 0.946006 -0.0243747 -4.7159 0.929347 -0.00359888 -3.4378 0.923064 -0.0121309 -2.54781 0.92273 -0.012071 -1.94155 0.922641 -0.0119363 -1.54007 0.922676 -0.0119157 -1.28328 0.922769 -0.0120274 -1.126 0.922856 -0.0122331 -1.03474 0.922872 -0.0123907 -0.985163 0.922826 -0.0125022 -0.959948 0.922849 -0.0126872 -0.947201 0.923003 -0.0129146 -0.939708 0.923237 -0.0131514 -0.934021 0.923575 -0.0134303 -0.928731 0.924215 -0.013824 -0.923192 0.925041 -0.0143265 -0.917373 0.925984 -0.0149114 -0.911204 0.927016 -0.0155638 -0.904608 0.928123 -0.0162752 -0.89752 0.929293 -0.0170387 -0.889891 0.930516 -0.0178472 -0.881685 0.93178 -0.0186929 -0.872884 0.933074 -0.0195677 -0.863483 0.934389 -0.0204643 -0.853491 0.935719 -0.0213762 -0.842929 0.937056 -0.0222976 -0.831825 0.938397 -0.0232222 -0.820218 0.93973 -0.0241419 -0.808148 0.941044 -0.0250453 -0.795661 0.942315 -0.0259165 -0.782807 0.943515 -0.0267351 -0.769638 0.944611 -0.0274773 -0.75621 0.945567 -0.0281178 -0.742587 0.946349 -0.0286331 -0.728835 0.946931 -0.0290046 -0.715032 0.9473 -0.0292201 -0.701258 0.947453 -0.0292756 -0.687599 0.9474 -0.0291746 -0.674144 0.947161 -0.0289259 -0.660979 0.946759 -0.0285414 -0.648187 0.946218 -0.0280331 -4.7159 0.933756 -0.0058963 -3.43917 0.923779 -0.0195493 -2.54979 0.923217 -0.0196138 -1.94348 0.923067 -0.0194386 -1.54183 0.923121 -0.0194197 -1.28492 0.923272 -0.0196009 -1.12764 0.923417 -0.0199246 -1.03652 0.923449 -0.0202059 -0.987171 0.923392 -0.0204718 -0.962093 0.923444 -0.0208236 -0.949248 0.923649 -0.0211696 -0.94155 0.923923 -0.0214727 -0.935658 0.924279 -0.0217729 -0.930184 0.924909 -0.0221275 -0.924491 0.925706 -0.0225545 -0.918535 0.926618 -0.0230478 -0.912239 0.927624 -0.0236029 -0.905529 0.928712 -0.0242152 -0.898337 0.92987 -0.0248797 -0.890614 0.931086 -0.02559 -0.882324 0.932346 -0.026339 -0.873448 0.93364 -0.027119 -0.863978 0.934956 -0.027922 -0.853924 0.936287 -0.0287406 -0.843304 0.937626 -0.0295674 -0.832146 0.938966 -0.0303948 -0.820484 0.940298 -0.0312137 -0.808359 0.941608 -0.032012 -0.795815 0.942875 -0.0327745 -0.7829 0.944071 -0.033482 -0.769666 0.945164 -0.0341123 -0.756168 0.946116 -0.0346425 -0.742472 0.946897 -0.0350507 -0.728646 0.947479 -0.0353194 -0.714768 0.947849 -0.0354365 -0.70092 0.948003 -0.0353968 -0.68719 0.947951 -0.0352017 -0.673666 0.947711 -0.0348566 -0.660435 0.947305 -0.0343699 -0.647579 0.946758 -0.0337498 -4.7159 0.941097 -0.00966831 -3.44133 0.92567 -0.0309056 -2.55304 0.924738 -0.0312822 -1.94675 0.924491 -0.0310726 -1.54492 0.924569 -0.0310623 -1.28792 0.924814 -0.0313415 -1.13077 0.925054 -0.0318332 -1.04001 0.925121 -0.0323211 -0.991085 0.925077 -0.0328463 -0.966129 0.925165 -0.0334205 -0.953041 0.925401 -0.0338932 -0.944975 0.925693 -0.0342582 -0.938712 0.926058 -0.0345792 -0.932892 0.926687 -0.0349045 -0.926884 0.927472 -0.0352655 -0.920644 0.928362 -0.0356655 -0.91409 0.929343 -0.036107 -0.907143 0.930406 -0.036591 -0.899738 0.931541 -0.0371168 -0.891823 0.932737 -0.0376816 -0.88336 0.93398 -0.0382809 -0.874328 0.935259 -0.0389087 -0.864718 0.936563 -0.039558 -0.854536 0.937882 -0.0402211 -0.843798 0.939209 -0.0408899 -0.832529 0.940535 -0.0415554 -0.82076 0.941852 -0.0422075 -0.80853 0.943145 -0.0428337 -0.795879 0.944392 -0.0434194 -0.782854 0.945568 -0.0439469 -0.769505 0.946639 -0.0443964 -0.755889 0.947573 -0.0447477 -0.74207 0.948335 -0.0449813 -0.72812 0.948902 -0.0450808 -0.714116 0.949257 -0.0450345 -0.700144 0.949397 -0.0448353 -0.686292 0.94933 -0.0444812 -0.672648 0.949072 -0.0439732 -0.659298 0.948645 -0.0433143 -0.646322 0.948072 -0.042507 -4.7159 0.95331 -0.0158652 -3.44472 0.930272 -0.047826 -2.55833 0.928761 -0.048883 -1.95228 0.92836 -0.0486672 -1.55036 0.928472 -0.048675 -1.29344 0.928861 -0.0490782 -1.13672 0.929251 -0.0497911 -1.04665 0.929402 -0.0505893 -0.998282 0.929419 -0.0514727 -0.973265 0.929551 -0.0523007 -0.959671 0.929797 -0.0529102 -0.950999 0.930089 -0.0533478 -0.944145 0.930453 -0.053701 -0.937755 0.931084 -0.0540065 -0.931207 0.931863 -0.0543095 -0.924455 0.932738 -0.0546181 -0.917422 0.933694 -0.0549379 -0.910029 0.934724 -0.0552729 -0.90221 0.93582 -0.0556261 -0.893914 0.936972 -0.0559988 -0.885104 0.938169 -0.0563905 -0.875756 0.9394 -0.0567989 -0.865858 0.940655 -0.0572194 -0.855412 0.941925 -0.057646 -0.844431 0.943201 -0.0580712 -0.832934 0.944475 -0.0584859 -0.82095 0.945736 -0.0588796 -0.80851 0.946969 -0.0592402 -0.795652 0.948154 -0.0595539 -0.782421 0.949265 -0.0598049 -0.768863 0.950272 -0.0599764 -0.755036 0.951141 -0.0600509 -0.741004 0.951841 -0.0600117 -0.726837 0.952347 -0.059844 -0.712616 0.952644 -0.0595353 -0.698426 0.952727 -0.0590766 -0.684355 0.9526 -0.0584611 -0.670491 0.952279 -0.0576838 -0.656919 0.951783 -0.0567402 -0.643716 0.951135 -0.055625 -4.7159 0.973628 -0.0260502 -3.44996 0.940705 -0.0722448 -2.56692 0.938289 -0.0746778 -1.96163 0.937658 -0.0745263 -1.55995 0.937812 -0.0745625 -1.30348 0.938407 -0.0750968 -1.14764 0.93902 -0.0760661 -1.0586 0.939334 -0.0772558 -1.01064 0.939483 -0.078537 -0.985127 0.939677 -0.0796248 -0.970624 0.939937 -0.0803893 -0.96101 0.94023 -0.0809225 -0.953257 0.940592 -0.0813282 -0.945994 0.941224 -0.081626 -0.938594 0.941995 -0.0818783 -0.931015 0.942848 -0.0820984 -0.923184 0.943766 -0.0822928 -0.915026 0.944741 -0.0824667 -0.906479 0.945764 -0.0826247 -0.897496 0.946828 -0.0827707 -0.888041 0.947924 -0.0829075 -0.878091 0.949043 -0.083036 -0.867633 0.950177 -0.0831553 -0.856667 0.951319 -0.083262 -0.845199 0.95246 -0.0833505 -0.833245 0.953592 -0.0834134 -0.820827 0.954705 -0.0834414 -0.80797 0.955784 -0.0834236 -0.794709 0.956809 -0.083348 -0.78108 0.957757 -0.0832012 -0.767131 0.958597 -0.0829693 -0.752912 0.9593 -0.0826379 -0.738488 0.959836 -0.0821926 -0.723928 0.96018 -0.0816195 -0.709311 0.960316 -0.0809053 -0.69472 0.960238 -0.0800372 -0.680242 0.959948 -0.0790029 -0.665963 0.959457 -0.0777895 -0.651963 0.958784 -0.0763832 -0.638319 0.957947 -0.0747684 -4.7159 1.00742 -0.0427953 -3.45793 0.962808 -0.106211 -2.58077 0.958936 -0.11131 -1.97732 0.957968 -0.111371 -1.57658 0.958155 -0.111445 -1.3212 0.958994 -0.112081 -1.16675 0.959871 -0.113291 -1.0787 0.96042 -0.11486 -1.03048 0.960756 -0.116481 -1.00371 0.961049 -0.117796 -0.987702 0.96135 -0.118717 -0.976647 0.961662 -0.119357 -0.967546 0.962032 -0.119827 -0.958971 0.962668 -0.12012 -0.950276 0.963423 -0.120322 -0.941427 0.964238 -0.120453 -0.932351 0.965092 -0.12052 -0.922978 0.965972 -0.120527 -0.913251 0.966871 -0.12048 -0.903127 0.967779 -0.120384 -0.892575 0.96869 -0.120242 -0.881575 0.969597 -0.120056 -0.870117 0.970495 -0.119828 -0.858198 0.971377 -0.119555 -0.845823 0.97224 -0.119234 -0.833003 0.973077 -0.118859 -0.819754 0.973878 -0.118423 -0.806096 0.97463 -0.117917 -0.792057 0.975317 -0.117331 -0.777667 0.975916 -0.116653 -0.762968 0.9764 -0.115873 -0.748006 0.976742 -0.114978 -0.73284 0.976915 -0.113956 -0.717536 0.976894 -0.112791 -0.702167 0.976664 -0.111469 -0.686813 0.976215 -0.109971 -0.671555 0.975547 -0.108279 -0.656475 0.974667 -0.106371 -0.641651 0.973588 -0.10422 -0.627156 0.972326 -0.101802 -4.7159 1.06362 -0.0703322 -3.4699 1.00673 -0.15173 -2.60294 1.00034 -0.161834 -2.00341 0.998876 -0.162405 -1.60486 0.999018 -0.162541 -1.35137 1.00001 -0.163209 -1.1984 1.00107 -0.164562 -1.11041 1.0018 -0.166354 -1.06054 1.00229 -0.168147 -1.03133 1.00268 -0.169586 -1.01287 1.00303 -0.170605 -0.999592 1.00337 -0.171318 -0.988429 1.00374 -0.171823 -0.977854 1.00437 -0.172079 -0.967186 1.00509 -0.172198 -0.956394 1.00583 -0.172208 -0.945405 1.00658 -0.172119 -0.934151 1.0073 -0.171935 -0.922577 1.008 -0.171662 -0.910643 1.00867 -0.171303 -0.898322 1.00929 -0.170861 -0.885598 1.00985 -0.170336 -0.872462 1.01037 -0.169729 -0.858913 1.01083 -0.169037 -0.844953 1.01122 -0.168255 -0.83059 1.01155 -0.167378 -0.815836 1.01181 -0.166396 -0.800706 1.01199 -0.165302 -0.785221 1.01207 -0.164085 -0.769404 1.01204 -0.162735 -0.75329 1.01187 -0.161241 -0.73692 1.01153 -0.159589 -0.720342 1.01101 -0.157765 -0.703617 1.01028 -0.155753 -0.686812 1.00931 -0.153533 -0.669998 1.00812 -0.151081 -0.653254 1.00668 -0.148369 -0.636656 1.005 -0.145367 -0.620282 1.00309 -0.14204 -0.604207 1.00096 -0.138352 -4.7159 1.15708 -0.115624 -3.48786 1.08923 -0.211265 -2.63846 1.07831 -0.230238 -2.04655 1.07602 -0.231937 -1.65211 1.07584 -0.232219 -1.40103 1.07664 -0.232827 -1.24839 1.07752 -0.234109 -1.15812 1.07816 -0.235811 -1.10427 1.07859 -0.237491 -1.07073 1.07893 -0.238849 -1.04828 1.07923 -0.239823 -1.03145 1.07951 -0.240494 -1.01702 1.07981 -0.240933 -1.0033 1.08035 -0.241044 -0.989526 1.08095 -0.240969 -0.975684 1.08152 -0.240749 -0.961693 1.08204 -0.240398 -0.947479 1.08249 -0.239922 -0.932985 1.08286 -0.239324 -0.918171 1.08313 -0.238606 -0.90301 1.08329 -0.237769 -0.887486 1.08334 -0.236811 -0.871589 1.08326 -0.235727 -0.855316 1.08307 -0.234512 -0.838667 1.08275 -0.233156 -0.821647 1.0823 -0.231649 -0.804262 1.08171 -0.229978 -0.786521 1.08098 -0.228131 -0.768438 1.08009 -0.226093 -0.750031 1.07902 -0.223849 -0.731327 1.07776 -0.221383 -0.712359 1.07627 -0.218678 -0.693172 1.07454 -0.215714 -0.673819 1.07255 -0.21247 -0.654363 1.07027 -0.208919 -0.634877 1.0677 -0.205032 -0.615439 1.06484 -0.200777 -0.596131 1.06168 -0.196119 -0.577039 1.05824 -0.191022 -0.558249 1.05452 -0.185449 -4.7159 1.31249 -0.190128 -3.51522 1.23758 -0.289956 -2.69573 1.21871 -0.322677 -2.11796 1.21478 -0.326845 -1.73015 1.21362 -0.327533 -1.48066 1.21347 -0.327966 -1.32499 1.21349 -0.328824 -1.22828 1.21345 -0.329994 -1.16674 1.21335 -0.331175 -1.12579 1.21326 -0.332141 -1.09676 1.2132 -0.332815 -1.0741 1.21316 -0.333226 -1.05429 1.21314 -0.333391 -1.0354 1.21336 -0.333133 -1.01656 1.21358 -0.33263 -0.997763 1.21373 -0.331944 -0.978896 1.21376 -0.331092 -0.959876 1.21365 -0.330081 -0.940638 1.21337 -0.328912 -0.921131 1.21293 -0.327586 -0.901323 1.21229 -0.326099 -0.881189 1.21145 -0.324444 -0.860715 1.21041 -0.322612 -0.839891 1.20915 -0.320589 -0.818711 1.20767 -0.31836 -0.797172 1.20597 -0.315906 -0.775274 1.20403 -0.313206 -0.753022 1.20184 -0.31024 -0.730422 1.19939 -0.306986 -0.707491 1.19665 -0.30342 -0.68425 1.19361 -0.299519 -0.660735 1.19024 -0.295259 -0.636991 1.18652 -0.290615 -0.613077 1.18243 -0.28556 -0.589064 1.17795 -0.280065 -0.565037 1.17309 -0.274101 -0.541089 1.16784 -0.267635 -0.51732 1.16221 -0.260637 -0.493835 1.15623 -0.253075 -0.470743 1.14992 -0.244923 -4.7159 1.5709 -0.312702 -3.55805 1.49627 -0.400969 -2.78806 1.46513 -0.44953 -2.23529 1.45744 -0.458739 -1.85696 1.45391 -0.460575 -1.60596 1.45164 -0.460818 -1.44121 1.4498 -0.460907 -1.33177 1.4482 -0.461118 -1.25692 1.4468 -0.461387 -1.20363 1.44561 -0.461581 -1.16362 1.44461 -0.461602 -1.13114 1.4437 -0.461421 -1.10225 1.44285 -0.46098 -1.07465 1.44223 -0.459991 -1.04734 1.44156 -0.458685 -1.02027 1.44074 -0.457145 -0.993296 1.43972 -0.455394 -0.966313 1.43847 -0.453439 -0.939225 1.43695 -0.45128 -0.911958 1.43516 -0.448912 -0.88446 1.43307 -0.446327 -0.85669 1.43066 -0.443511 -0.828616 1.42792 -0.440445 -0.800216 1.42484 -0.437108 -0.771472 1.42141 -0.433474 -0.742372 1.4176 -0.429516 -0.71291 1.41342 -0.425203 -0.683083 1.40883 -0.420503 -0.652901 1.40382 -0.415387 -0.62238 1.39837 -0.409822 -0.591549 1.39244 -0.403779 -0.560455 1.38602 -0.397228 -0.529157 1.37909 -0.390141 -0.497735 1.37163 -0.382488 -0.466281 1.36363 -0.374242 -0.434906 1.35511 -0.365375 -0.403729 1.34608 -0.35586 -0.372879 1.33658 -0.345672 -0.34249 1.32664 -0.334787 -0.312697 1.31632 -0.323184 -4.7159 2.00059 -0.514379 -3.62497 1.93678 -0.575386 -2.932 1.892 -0.630837 -2.41988 1.87657 -0.647362 -2.05472 1.8682 -0.651904 -1.79807 1.86217 -0.652571 -1.61694 1.85719 -0.65202 -1.4868 1.8529 -0.651162 -1.39079 1.84916 -0.65027 -1.31763 1.84588 -0.649356 -1.25952 1.84297 -0.648345 -1.21052 1.84029 -0.647165 -1.16622 1.8377 -0.645691 -1.12388 1.83535 -0.643507 -1.08231 1.83288 -0.640911 -1.04139 1.83015 -0.638015 -1.00093 1.82713 -0.634847 -0.960732 1.82375 -0.631412 -0.920659 1.81999 -0.627706 -0.880585 1.8158 -0.623719 -0.840411 1.81116 -0.619432 -0.80006 1.80605 -0.614822 -0.759467 1.80043 -0.60986 -0.718583 1.79429 -0.604512 -0.677368 1.7876 -0.598741 -0.635796 1.78033 -0.592506 -0.593849 1.77246 -0.585765 -0.551524 1.76397 -0.578475 -0.508832 1.75481 -0.570596 -0.465799 1.74496 -0.562086 -0.422471 1.73439 -0.552909 -0.378916 1.72309 -0.54303 -0.335222 1.71102 -0.532415 -0.2915 1.69819 -0.521034 -0.24788 1.6846 -0.508861 -0.20451 1.67028 -0.495868 -0.161552 1.65528 -0.482033 -0.119174 1.63965 -0.467333 -0.0775515 1.62346 -0.45175 -0.036858 1.60681 -0.43527 -4.7159 2.71505 -0.846241 -3.71893 2.67074 -0.874507 -3.1325 2.6219 -0.914847 -2.67713 2.59676 -0.933074 -2.33185 2.58096 -0.939946 -2.06987 2.56922 -0.941581 -1.86869 2.55959 -0.940875 -1.71144 2.55125 -0.939172 -1.58596 2.54383 -0.93707 -1.48347 2.53713 -0.934787 -1.39727 2.53098 -0.93234 -1.32171 2.52515 -0.92967 -1.25222 2.51944 -0.926624 -1.18576 2.51393 -0.922697 -1.12096 2.50821 -0.918244 -1.05756 2.50215 -0.913398 -0.995226 2.49566 -0.908189 -0.933663 2.48868 -0.902619 -0.87261 2.48114 -0.896676 -0.811851 2.47301 -0.890339 -0.751204 2.46422 -0.883578 -0.690515 2.45472 -0.876355 -0.62966 2.44448 -0.868626 -0.568535 2.43343 -0.86034 -0.507061 2.42153 -0.851445 -0.445183 2.40874 -0.841882 -0.382864 2.395 -0.831592 -0.320093 2.38026 -0.820516 -0.256884 2.36447 -0.808596 -0.193278 2.3476 -0.795779 -0.129344 2.32959 -0.782012 -0.065183 2.31042 -0.767248 -0.000924456 2.29007 -0.751445 --0.0632709 2.26854 -0.734564 --0.127216 2.24586 -0.716571 --0.1907 2.22207 -0.697436 --0.253495 2.19726 -0.677133 --0.315363 2.17151 -0.65564 --0.376056 2.14495 -0.632943 --0.435329 2.11774 -0.609028 -4.7159 3.90304 -1.39237 -3.80885 3.87713 -1.39553 -3.31743 3.84087 -1.40759 -2.91528 3.81526 -1.41312 -2.59329 3.79599 -1.41369 -2.33347 3.78034 -1.41127 -2.12003 3.76686 -1.40717 -1.94111 3.75476 -1.40218 -1.78812 3.7436 -1.39674 -1.65478 3.73311 -1.39107 -1.53614 3.72308 -1.38521 -1.42784 3.71329 -1.37912 -1.32617 3.70352 -1.37264 -1.22851 3.69377 -1.36538 -1.13346 3.6837 -1.3576 -1.0405 3.67318 -1.34939 -0.949095 3.66211 -1.34077 -0.858785 3.65041 -1.33174 -0.769155 3.63797 -1.32227 -0.679846 3.62471 -1.31234 -0.590546 3.61053 -1.30188 -0.500985 3.59533 -1.29085 -0.410926 3.57902 -1.27918 -0.320172 3.56147 -1.26681 -0.228561 3.54259 -1.25364 -0.135964 3.52225 -1.2396 -0.0422957 3.50034 -1.22459 --0.0524922 3.47674 -1.20851 --0.148401 3.45134 -1.19126 --0.245383 3.42404 -1.17275 --0.34334 3.39473 -1.15287 --0.442119 3.36334 -1.13153 --0.541508 3.32983 -1.10864 --0.641244 3.29418 -1.08411 --0.741011 3.2564 -1.05787 --0.840445 3.21657 -1.02984 --0.939148 3.17479 -0.99997 --1.03669 3.13124 -0.968209 --1.13263 3.08611 -0.934528 --1.22652 3.03968 -0.898913 -4.7159 5.87835 -2.29118 -3.60792 5.87172 -2.27433 -2.78986 5.86508 -2.25747 -2.19322 5.85845 -2.24062 -1.76468 5.85182 -2.22377 -1.4627 5.84518 -2.20691 -1.25492 5.83855 -2.19006 -1.11616 5.83192 -2.17321 -1.02679 5.82529 -2.15635 -0.97153 5.81865 -2.1395 -0.938482 5.81202 -2.12265 -0.918377 5.80539 -2.10579 -0.903996 5.79875 -2.08894 -0.890046 5.79212 -2.07209 -0.873547 5.78549 -2.05523 -0.852247 5.77886 -2.03838 -0.824205 5.77222 -2.02153 -0.787778 5.76559 -2.00468 -0.741602 5.75896 -1.98782 -0.684581 5.75232 -1.97097 -0.615873 5.74569 -1.95412 -0.534872 5.73903 -1.93726 -0.441197 5.73141 -1.92041 -0.334709 5.72195 -1.90356 -0.215488 5.70999 -1.8867 -0.0838234 5.69485 -1.86967 --0.0597859 5.67582 -1.85201 --0.21464 5.65222 -1.83354 --0.379854 5.62338 -1.81404 --0.554376 5.58873 -1.79329 --0.737004 5.54781 -1.77104 --0.92641 5.50027 -1.74702 --1.12117 5.44595 -1.72096 --1.31977 5.38482 -1.69257 --1.5207 5.31707 -1.66155 --1.72239 5.24305 -1.6276 --1.92333 5.16329 -1.59042 --2.12204 5.07849 -1.54974 --2.31712 4.98948 -1.50528 --2.50725 4.89721 -1.45681 -0.934337 0.949758 -0.000747842 -0.928998 0.95079 -0.00149657 -0.923414 0.951849 -0.00226525 -0.917488 0.952954 -0.0030683 -0.911141 0.954113 -0.00391154 -0.904307 0.955323 -0.0047929 -0.896937 0.956577 -0.00570799 -0.888997 0.957866 -0.00665117 -0.880469 0.959183 -0.00761691 -0.871347 0.96052 -0.00860071 -0.861641 0.961873 -0.00959916 -0.851372 0.963235 -0.0106099 -0.84057 0.964603 -0.0116294 -0.829276 0.965967 -0.0126519 -0.817532 0.967312 -0.0136665 -0.805388 0.968615 -0.0146568 -0.792891 0.969845 -0.0156006 -0.780096 0.970965 -0.0164711 -0.767054 0.971937 -0.0172405 -0.753825 0.972727 -0.0178827 -0.74047 0.973309 -0.0183777 -0.727061 0.97367 -0.0187136 -0.713673 0.973808 -0.0188881 -0.700388 0.973736 -0.0189078 -0.687291 0.973476 -0.0187862 -0.674467 0.973052 -0.0185402 -0.662 0.972492 -0.0181875 -4.7159 0.948743 -9.764e-06 -3.4377 0.948728 -2.4026e-05 -2.54837 0.948727 -2.2207e-05 -1.94337 0.948727 -2.1484e-05 -1.54305 0.948727 -2.125e-05 -1.28713 0.948726 -2.129e-05 -1.13041 0.948726 -2.1516e-05 -1.03946 0.948726 -2.1603e-05 -0.989965 0.948726 -2.1187e-05 -0.964777 0.948726 -2.0615e-05 -0.952277 0.948726 -2.0318e-05 -0.945174 0.948726 -2.0206e-05 -0.939545 0.948728 -2.0067e-05 -0.93434 0.949757 -0.000767741 -0.929001 0.950789 -0.00151642 -0.923416 0.951848 -0.00228511 -0.91749 0.952953 -0.00308821 -0.911143 0.954112 -0.00393153 -0.904309 0.955322 -0.00481296 -0.896939 0.956576 -0.00572815 -0.889 0.957866 -0.00667141 -0.880471 0.959183 -0.00763723 -0.871349 0.96052 -0.00862109 -0.861643 0.961872 -0.0096196 -0.851374 0.963234 -0.0106303 -0.840572 0.964603 -0.01165 -0.829277 0.965967 -0.0126724 -0.817534 0.967312 -0.0136871 -0.805389 0.968615 -0.0146774 -0.792893 0.969844 -0.0156211 -0.780097 0.970964 -0.0164917 -0.767055 0.971936 -0.017261 -0.753825 0.972727 -0.0179032 -0.740471 0.973309 -0.0183982 -0.727061 0.973669 -0.0187341 -0.713673 0.973808 -0.0189085 -0.700388 0.973736 -0.0189282 -0.687291 0.973476 -0.0188066 -0.674467 0.973053 -0.0185606 -0.661999 0.972492 -0.0182078 -4.7159 0.948769 -2.5278e-05 -3.43771 0.948727 -6.5433e-05 -2.54838 0.948725 -6.0844e-05 -1.94338 0.948724 -5.8969e-05 -1.54306 0.948724 -5.8367e-05 -1.28714 0.948724 -5.8511e-05 -1.13042 0.948725 -5.9209e-05 -1.03946 0.948724 -5.9602e-05 -0.989968 0.948724 -5.8664e-05 -0.96478 0.948724 -5.727e-05 -0.952279 0.948724 -5.6592e-05 -0.945175 0.948726 -5.644e-05 -0.939548 0.948732 -5.6764e-05 -0.934344 0.949757 -0.000803428 -0.929006 0.950788 -0.0015519 -0.923421 0.951847 -0.00232053 -0.917495 0.952952 -0.00312363 -0.911147 0.954111 -0.003967 -0.904313 0.955321 -0.0048485 -0.896943 0.956575 -0.00576378 -0.889003 0.957864 -0.00670712 -0.880474 0.959181 -0.00767302 -0.871352 0.960519 -0.00865693 -0.861646 0.961871 -0.00965548 -0.851377 0.963233 -0.0106662 -0.840575 0.964602 -0.0116858 -0.82928 0.965966 -0.0127083 -0.817536 0.967311 -0.0137229 -0.805391 0.968614 -0.0147131 -0.792895 0.969843 -0.0156568 -0.780098 0.970963 -0.0165273 -0.767056 0.971936 -0.0172965 -0.753826 0.972726 -0.0179387 -0.740471 0.973309 -0.0184336 -0.727062 0.973669 -0.0187693 -0.713673 0.973808 -0.0189437 -0.700388 0.973736 -0.0189632 -0.68729 0.973476 -0.0188415 -0.674466 0.973053 -0.0185954 -0.661997 0.972492 -0.0182425 -4.7159 0.948812 -4.9568e-05 -3.43772 0.948725 -0.000137053 -2.5484 0.948722 -0.000128273 -1.9434 0.94872 -0.000124568 -1.54307 0.948721 -0.000123393 -1.28715 0.948721 -0.000123772 -1.13043 0.948722 -0.000125383 -1.03947 0.948722 -0.000126447 -0.989974 0.948721 -0.000124815 -0.964784 0.948721 -0.00012227 -0.952282 0.948722 -0.000121187 -0.945175 0.948725 -0.00012125 -0.939553 0.948739 -0.000123606 -0.934353 0.949755 -0.000867275 -0.929014 0.950786 -0.00161513 -0.923429 0.951844 -0.00238349 -0.917502 0.952949 -0.00318647 -0.911155 0.954109 -0.00402978 -0.90432 0.955318 -0.0049113 -0.89695 0.956573 -0.00582661 -0.88901 0.957862 -0.00677 -0.880481 0.959179 -0.00773592 -0.871358 0.960517 -0.00871983 -0.861652 0.961869 -0.00971834 -0.851382 0.963232 -0.010729 -0.84058 0.9646 -0.0117485 -0.829285 0.965964 -0.0127708 -0.817541 0.96731 -0.0137852 -0.805395 0.968613 -0.0147753 -0.792898 0.969842 -0.0157187 -0.780102 0.970962 -0.0165889 -0.767059 0.971935 -0.0173579 -0.753828 0.972725 -0.0179998 -0.740472 0.973308 -0.0184944 -0.727062 0.973669 -0.0188299 -0.713673 0.973808 -0.019004 -0.700387 0.973737 -0.0190234 -0.687288 0.973476 -0.0189014 -0.674464 0.973053 -0.0186551 -0.661995 0.972493 -0.0183019 -4.7159 0.948885 -8.7608e-05 -3.43775 0.948722 -0.000260777 -2.54843 0.948716 -0.000245766 -1.94342 0.948714 -0.000239183 -1.54309 0.948714 -0.000237126 -1.28716 0.948716 -0.000238013 -1.13044 0.948717 -0.000241317 -1.03948 0.948717 -0.000243661 -0.989983 0.948716 -0.000241086 -0.964792 0.948716 -0.000237013 -0.952288 0.948719 -0.000235698 -0.945177 0.948725 -0.000236657 -0.939562 0.948752 -0.000244507 -0.934367 0.949754 -0.000980995 -0.929028 0.950782 -0.00172732 -0.923443 0.95184 -0.00249492 -0.917516 0.952945 -0.00329743 -0.911168 0.954105 -0.00414043 -0.904333 0.955314 -0.00502174 -0.896962 0.956569 -0.00593691 -0.889021 0.957859 -0.00688019 -0.880491 0.959176 -0.00784598 -0.871368 0.960514 -0.00882974 -0.861661 0.961866 -0.00982804 -0.851391 0.963229 -0.0108384 -0.840588 0.964597 -0.0118576 -0.829293 0.965962 -0.0128794 -0.817548 0.967307 -0.0138934 -0.805402 0.96861 -0.0148828 -0.792904 0.96984 -0.0158256 -0.780107 0.970961 -0.0166952 -0.767063 0.971934 -0.0174636 -0.753831 0.972724 -0.0181049 -0.740474 0.973307 -0.018599 -0.727063 0.973669 -0.0189339 -0.713672 0.973808 -0.0191075 -0.700385 0.973737 -0.0191264 -0.687286 0.973477 -0.0190039 -0.67446 0.973054 -0.0187571 -0.661991 0.972494 -0.0184033 -4.7159 0.94901 -0.000147578 -3.43778 0.948718 -0.000473445 -2.54848 0.948707 -0.000449425 -1.94347 0.948703 -0.000438377 -1.54313 0.948704 -0.000434997 -1.28719 0.948707 -0.000436922 -1.13046 0.948709 -0.000443286 -1.0395 0.94871 -0.00044793 -0.99 0.948708 -0.000444122 -0.964807 0.948708 -0.000438245 -0.952299 0.948713 -0.00043738 -0.945181 0.948724 -0.000440814 -0.939579 0.948774 -0.000460864 -0.934393 0.949751 -0.00118224 -0.929054 0.950777 -0.00192511 -0.923467 0.951834 -0.00269088 -0.91754 0.952939 -0.00349213 -0.911191 0.954098 -0.00433417 -0.904355 0.955308 -0.00521476 -0.896983 0.956563 -0.00612933 -0.88904 0.957853 -0.00707208 -0.88051 0.959171 -0.00803737 -0.871386 0.960509 -0.00902058 -0.861677 0.961861 -0.0100183 -0.851406 0.963225 -0.0110279 -0.840603 0.964593 -0.0120462 -0.829306 0.965958 -0.013067 -0.817561 0.967304 -0.0140798 -0.805414 0.968607 -0.015068 -0.792915 0.969838 -0.0160095 -0.780115 0.970958 -0.0168777 -0.76707 0.971932 -0.0176447 -0.753836 0.972723 -0.0182847 -0.740478 0.973307 -0.0187775 -0.727064 0.973669 -0.0191113 -0.713672 0.973809 -0.0192839 -0.700382 0.973738 -0.0193017 -0.687281 0.973479 -0.0191782 -0.674454 0.973056 -0.0189303 -0.661984 0.972496 -0.0185754 -4.7159 0.949219 -0.00024293 -3.43785 0.948713 -0.000836097 -2.54856 0.948692 -0.00079957 -1.94354 0.948685 -0.000781726 -1.54319 0.948687 -0.000776419 -1.28724 0.948692 -0.000780381 -1.1305 0.948697 -0.000792147 -1.03953 0.948698 -0.000800803 -0.990031 0.948696 -0.000795596 -0.964835 0.948696 -0.000788169 -0.95232 0.948705 -0.000789585 -0.945192 0.948725 -0.000798875 -0.939611 0.948809 -0.000842281 -0.934437 0.949749 -0.00153539 -0.929098 0.950769 -0.0022709 -0.92351 0.951824 -0.00303262 -0.917581 0.952929 -0.00383095 -0.91123 0.954088 -0.00467064 -0.904392 0.955299 -0.0055493 -0.897018 0.956554 -0.00646224 -0.889074 0.957844 -0.00740353 -0.880541 0.959163 -0.00836743 -0.871415 0.960501 -0.00934922 -0.861705 0.961855 -0.0103454 -0.851432 0.963219 -0.0113533 -0.840627 0.964588 -0.0123697 -0.829329 0.965953 -0.0133883 -0.817582 0.967299 -0.0143986 -0.805433 0.968603 -0.0153841 -0.792932 0.969834 -0.0163228 -0.78013 0.970956 -0.0171882 -0.767082 0.97193 -0.0179524 -0.753845 0.972723 -0.0185896 -0.740482 0.973307 -0.0190799 -0.727065 0.97367 -0.0194115 -0.71367 0.973811 -0.0195819 -0.700377 0.973742 -0.0195977 -0.687274 0.973483 -0.0194722 -0.674444 0.973061 -0.0192222 -0.661971 0.972502 -0.018865 -4.7159 0.949572 -0.000395788 -3.43796 0.948707 -0.00144811 -2.54871 0.94867 -0.00139524 -1.94367 0.948659 -0.0013673 -1.5433 0.948662 -0.00135929 -1.28733 0.948671 -0.0013671 -1.13058 0.948679 -0.00138818 -1.03959 0.948682 -0.00140372 -0.990088 0.948679 -0.00139758 -0.96489 0.948679 -0.00139037 -0.952366 0.948695 -0.00139826 -0.94522 0.94873 -0.00142011 -0.939668 0.948863 -0.0015018 -0.934514 0.949749 -0.00214858 -0.929174 0.950758 -0.00286932 -0.923583 0.951812 -0.00362262 -0.917651 0.952916 -0.00441469 -0.911296 0.954075 -0.00524916 -0.904455 0.955286 -0.0061234 -0.897077 0.956542 -0.00703249 -0.88913 0.957834 -0.00797031 -0.880594 0.959153 -0.00893093 -0.871464 0.960493 -0.00990947 -0.861752 0.961847 -0.0109022 -0.851476 0.963212 -0.0119065 -0.840668 0.964582 -0.0129187 -0.829368 0.965949 -0.0139328 -0.817617 0.967296 -0.0149382 -0.805465 0.968601 -0.0159184 -0.79296 0.969833 -0.0168515 -0.780154 0.970956 -0.0177112 -0.7671 0.971931 -0.0184698 -0.753857 0.972725 -0.0191018 -0.74049 0.973312 -0.0195872 -0.727067 0.973677 -0.0199142 -0.713665 0.973819 -0.0200805 -0.700368 0.973751 -0.0200925 -0.68726 0.973494 -0.0199633 -0.674426 0.973073 -0.0197093 -0.661949 0.972514 -0.0193477 -4.7159 0.950161 -0.000642541 -3.43813 0.948708 -0.00246811 -2.54895 0.948644 -0.00239589 -1.94389 0.948625 -0.00235341 -1.54348 0.94863 -0.00234182 -1.28748 0.948646 -0.00235662 -1.1307 0.948661 -0.00239333 -1.03971 0.948666 -0.00242058 -0.990198 0.94866 -0.00241585 -0.965001 0.948661 -0.00241412 -0.952463 0.948689 -0.00243712 -0.945291 0.94875 -0.00248343 -0.939775 0.948942 -0.002617 -0.934646 0.949762 -0.00319944 -0.929304 0.950753 -0.00389234 -0.923707 0.951801 -0.00462903 -0.917769 0.952903 -0.00540847 -0.911408 0.954062 -0.00623222 -0.90456 0.955274 -0.00709715 -0.897176 0.956531 -0.00799795 -0.889223 0.957825 -0.00892822 -0.88068 0.959146 -0.00988175 -0.871546 0.960488 -0.0108533 -0.861828 0.961844 -0.011839 -0.851547 0.963211 -0.0128357 -0.840735 0.964583 -0.0138398 -0.829429 0.96595 -0.014845 -0.817674 0.967299 -0.0158406 -0.805516 0.968606 -0.0168105 -0.793004 0.969839 -0.0177328 -0.78019 0.970964 -0.0185817 -0.767128 0.971942 -0.0193298 -0.753876 0.972739 -0.0199518 -0.740498 0.973329 -0.0204279 -0.727066 0.973696 -0.0207465 -0.713655 0.973841 -0.0209051 -0.700349 0.973776 -0.0209099 -0.687233 0.97352 -0.0207736 -0.674392 0.973101 -0.0205124 -0.661908 0.972543 -0.0201428 -4.7159 0.951146 -0.00104304 -3.43843 0.948738 -0.00414359 -2.54935 0.948628 -0.00405269 -1.94427 0.948595 -0.0039901 -1.5438 0.948604 -0.00397405 -1.28774 0.94863 -0.00400109 -1.13093 0.948656 -0.00406335 -1.03992 0.948666 -0.00411048 -0.990415 0.948657 -0.00411396 -0.96523 0.948659 -0.00413 -0.952676 0.948708 -0.00418388 -0.945466 0.948811 -0.00427221 -0.939978 0.94906 -0.0044613 -0.934871 0.949815 -0.00497039 -0.929525 0.950774 -0.00561586 -0.923917 0.951811 -0.00632178 -0.917966 0.95291 -0.00707719 -0.911593 0.954068 -0.00788018 -0.904733 0.95528 -0.00872666 -0.897338 0.956539 -0.00961078 -0.889373 0.957835 -0.0105257 -0.88082 0.95916 -0.0114647 -0.871676 0.960504 -0.0124222 -0.861949 0.961864 -0.0133937 -0.85166 0.963233 -0.0143757 -0.84084 0.964608 -0.0153639 -0.829526 0.965978 -0.016352 -0.817762 0.967329 -0.0173294 -0.805594 0.968638 -0.01828 -0.793071 0.969875 -0.0191825 -0.780244 0.971003 -0.0200114 -0.767167 0.971985 -0.02074 -0.7539 0.972786 -0.0213435 -0.740506 0.973379 -0.0218026 -0.727058 0.973751 -0.0221058 -0.713632 0.9739 -0.0222503 -0.700311 0.973838 -0.022242 -0.687181 0.973585 -0.0220929 -0.674328 0.973167 -0.0218185 -0.661833 0.972611 -0.0214345 -4.7159 0.952789 -0.00169575 -3.43891 0.94886 -0.00685083 -2.55003 0.948673 -0.00675159 -1.94489 0.948617 -0.00666263 -1.54433 0.94863 -0.00664162 -1.28819 0.948675 -0.00668916 -1.13134 0.94872 -0.0067919 -1.04033 0.948738 -0.00687277 -0.990856 0.948724 -0.00690062 -0.965708 0.948732 -0.00695874 -0.953133 0.948816 -0.00706787 -0.945867 0.948972 -0.00721585 -0.940374 0.949266 -0.00745062 -0.935265 0.94997 -0.00789119 -0.929903 0.950885 -0.00846788 -0.924271 0.951903 -0.00912179 -0.918295 0.952993 -0.0098345 -0.911898 0.954148 -0.0105997 -0.905015 0.95536 -0.0114118 -0.897598 0.956621 -0.0122642 -0.889613 0.95792 -0.0131495 -0.881042 0.959248 -0.0140605 -0.87188 0.960597 -0.0149907 -0.862137 0.961961 -0.0159349 -0.851833 0.963335 -0.0168889 -0.840999 0.964713 -0.0178476 -0.82967 0.966087 -0.0188044 -0.817891 0.967441 -0.0197484 -0.805706 0.968754 -0.0206642 -0.793164 0.969994 -0.021531 -0.780315 0.971127 -0.0223242 -0.767215 0.972113 -0.023018 -0.753922 0.97292 -0.0235886 -0.740503 0.973519 -0.0240173 -0.727028 0.973897 -0.0242928 -0.713576 0.974051 -0.0244121 -0.700231 0.973993 -0.0243804 -0.687079 0.973744 -0.0242087 -0.674205 0.973328 -0.0239109 -0.661691 0.972772 -0.0235014 -4.7159 0.955529 -0.00276264 -3.43969 0.949236 -0.0111442 -2.55113 0.948924 -0.0110685 -1.94594 0.948827 -0.0109478 -1.54525 0.948848 -0.0109221 -1.28901 0.948923 -0.0110024 -1.13212 0.949001 -0.0111669 -1.04114 0.949034 -0.0113048 -0.991757 0.949017 -0.0113901 -0.966691 0.949041 -0.0115305 -0.954082 0.949173 -0.011723 -0.946718 0.949384 -0.0119373 -0.941149 0.949708 -0.012202 -0.93598 0.95038 -0.0125863 -0.930566 0.95125 -0.0130818 -0.92488 0.952237 -0.0136595 -0.918851 0.95331 -0.0143034 -0.912404 0.954456 -0.015005 -0.905476 0.955664 -0.0157574 -0.898017 0.956924 -0.0165532 -0.889994 0.958225 -0.0173846 -0.881388 0.959557 -0.0182438 -0.872194 0.960911 -0.0191235 -0.862422 0.96228 -0.0200176 -0.852091 0.963658 -0.0209203 -0.84123 0.965041 -0.0218259 -0.829876 0.966419 -0.0227267 -0.818069 0.967777 -0.0236122 -0.805855 0.969093 -0.0244671 -0.79328 0.970337 -0.0252718 -0.780395 0.971474 -0.0260032 -0.767256 0.972465 -0.0266368 -0.753922 0.973277 -0.0271505 -0.740459 0.973883 -0.0275265 -0.726942 0.974266 -0.0277538 -0.713448 0.974426 -0.0278293 -0.700064 0.974372 -0.0277568 -0.686874 0.974124 -0.0275454 -0.673964 0.973708 -0.027207 -0.661416 0.97315 -0.0267536 -4.7159 0.960092 -0.0045102 -3.44094 0.950256 -0.0178084 -2.55294 0.949742 -0.0178322 -1.94771 0.949583 -0.0176784 -1.54685 0.949613 -0.01765 -1.2905 0.949738 -0.0177791 -1.13361 0.949873 -0.0180336 -1.04275 0.949934 -0.0182664 -0.993577 0.949926 -0.0184663 -0.968643 0.949985 -0.0187405 -0.955951 0.95017 -0.0190354 -0.948402 0.950423 -0.0193091 -0.942649 0.950766 -0.0195912 -0.937315 0.95142 -0.0199293 -0.931764 0.952254 -0.0203438 -0.925955 0.953205 -0.0208279 -0.919813 0.95425 -0.0213754 -0.913264 0.955376 -0.0219808 -0.906243 0.956571 -0.022638 -0.898701 0.957823 -0.0233403 -0.890603 0.95912 -0.0240803 -0.881929 0.96045 -0.0248498 -0.872675 0.961804 -0.0256412 -0.862846 0.963174 -0.0264471 -0.852463 0.964554 -0.0272604 -0.841553 0.965938 -0.0280738 -0.83015 0.967316 -0.028879 -0.818294 0.968674 -0.0296651 -0.806026 0.969988 -0.0304178 -0.793395 0.971231 -0.0311188 -0.78045 0.972366 -0.0317471 -0.767246 0.973358 -0.0322805 -0.753843 0.974171 -0.032699 -0.740311 0.974778 -0.0329865 -0.726723 0.975163 -0.0331326 -0.713161 0.975322 -0.0331334 -0.699708 0.975267 -0.0329908 -0.686453 0.975015 -0.0327114 -0.67348 0.974591 -0.0323036 -0.66087 0.974021 -0.0317758 -4.7159 0.96769 -0.0073769 -3.44291 0.952794 -0.0278914 -2.5559 0.951971 -0.0281761 -1.95069 0.951711 -0.027999 -1.54967 0.951754 -0.0279718 -1.29323 0.951961 -0.028167 -1.13645 0.952193 -0.0285439 -1.04591 0.952313 -0.0289274 -0.99712 0.952346 -0.0293203 -0.97232 0.952464 -0.0297734 -0.959418 0.952695 -0.0301738 -0.951535 0.952973 -0.0304975 -0.945446 0.953324 -0.0307919 -0.939798 0.953968 -0.0310889 -0.933965 0.954775 -0.0314266 -0.927902 0.955691 -0.0318098 -0.921531 0.956699 -0.0322401 -0.914775 0.95779 -0.0327173 -0.907566 0.958953 -0.0332393 -0.899855 0.960177 -0.0338022 -0.891606 0.96145 -0.0344003 -0.882796 0.96276 -0.035027 -0.873418 0.964096 -0.0356748 -0.863478 0.965451 -0.0363358 -0.852992 0.966816 -0.0370018 -0.841984 0.968185 -0.0376645 -0.830487 0.969546 -0.0383144 -0.818536 0.970886 -0.0389405 -0.806173 0.972181 -0.0395296 -0.793441 0.973402 -0.0400655 -0.780391 0.974518 -0.0405297 -0.767076 0.97549 -0.0409034 -0.75356 0.976285 -0.0411695 -0.739912 0.976875 -0.0413139 -0.726207 0.977243 -0.0413271 -0.712527 0.977386 -0.041204 -0.698959 0.97731 -0.0409441 -0.685589 0.977034 -0.0405498 -0.6725 0.976581 -0.0400248 -0.659774 0.975975 -0.0393723 -4.7159 0.980336 -0.0120843 -3.44598 0.958676 -0.0426751 -2.5607 0.957384 -0.043541 -1.95572 0.956973 -0.0433736 -1.55462 0.957036 -0.0433532 -1.29824 0.957372 -0.0436254 -1.14181 0.957762 -0.0441526 -1.05189 0.957998 -0.0447538 -1.00363 0.958136 -0.0454138 -0.97882 0.958341 -0.0460655 -0.965475 0.958611 -0.0465697 -0.957042 0.958902 -0.0469442 -0.950414 0.959254 -0.0472547 -0.944246 0.959887 -0.0475136 -0.937924 0.960668 -0.0477767 -0.931404 0.961545 -0.0480558 -0.924609 0.962502 -0.0483565 -0.917459 0.963535 -0.048682 -0.90989 0.964635 -0.0490341 -0.90185 0.965793 -0.0494125 -0.893301 0.967 -0.0498151 -0.88422 0.968245 -0.0502377 -0.874595 0.969518 -0.050675 -0.86443 0.970809 -0.0511197 -0.853735 0.972113 -0.051564 -0.842531 0.973418 -0.0519988 -0.830846 0.974714 -0.0524146 -0.818712 0.975985 -0.0528005 -0.806166 0.97721 -0.0531446 -0.793249 0.97836 -0.0534333 -0.78001 0.979403 -0.0536516 -0.766503 0.980304 -0.0537846 -0.75279 0.981031 -0.0538185 -0.73894 0.981554 -0.0537417 -0.725032 0.981858 -0.0535453 -0.711147 0.981935 -0.0532229 -0.697372 0.981791 -0.0527704 -0.683791 0.981442 -0.052185 -0.670489 0.980907 -0.0514638 -0.65754 0.980211 -0.050603 -4.7159 1.00138 -0.0198196 -3.45069 0.971403 -0.0635261 -2.56842 0.969406 -0.0655884 -1.96414 0.968778 -0.0655054 -1.56324 0.968865 -0.0654979 -1.30723 0.969389 -0.0658392 -1.15156 0.970007 -0.0665266 -1.06258 0.970444 -0.0673969 -1.01479 0.970766 -0.0683524 -0.989593 0.971088 -0.0691971 -0.975441 0.971409 -0.0698087 -0.966152 0.97172 -0.0702449 -0.958706 0.972077 -0.0705824 -0.951741 0.972695 -0.0708093 -0.944647 0.973442 -0.0710016 -0.937386 0.974264 -0.0711775 -0.929882 0.975147 -0.0713448 -0.922059 0.976085 -0.0715079 -0.913856 0.977073 -0.0716707 -0.905221 0.978104 -0.0718355 -0.896119 0.979172 -0.072003 -0.886526 0.980269 -0.0721722 -0.876426 0.981388 -0.07234 -0.86582 0.982522 -0.0725015 -0.854713 0.983662 -0.0726498 -0.84312 0.9848 -0.0727772 -0.831064 0.985924 -0.0728744 -0.818569 0.987018 -0.0729321 -0.80567 0.988061 -0.0729401 -0.792403 0.989027 -0.0728874 -0.778813 0.989885 -0.072763 -0.764951 0.990602 -0.0725558 -0.75088 0.991148 -0.0722556 -0.736668 0.991494 -0.0718527 -0.72239 0.991623 -0.0713384 -0.708129 0.991527 -0.0707043 -0.693968 0.991207 -0.0699419 -0.679991 0.990673 -0.0690417 -0.666275 0.989944 -0.0679927 -0.652896 0.989038 -0.0667819 -4.7159 1.0364 -0.032537 -3.45776 0.997179 -0.0916619 -2.58067 0.994065 -0.0960793 -1.97804 0.99314 -0.0962252 -1.57794 0.993243 -0.09624 -1.32285 0.993981 -0.09662 -1.16844 0.994857 -0.0974509 -1.08047 0.995553 -0.0985876 -1.03261 0.996105 -0.0997967 -1.00637 0.99657 -0.100802 -0.990868 0.996966 -0.101516 -0.980271 0.99732 -0.10202 -0.9716 0.997695 -0.102391 -0.963442 0.998302 -0.102591 -0.955179 0.999006 -0.102718 -0.946777 0.999755 -0.102797 -0.938164 1.00053 -0.102836 -0.929269 1.00133 -0.102842 -0.920032 1.00215 -0.102817 -0.910406 1.00297 -0.102765 -0.900359 1.00381 -0.102688 -0.889865 1.00465 -0.102586 -0.878912 1.00548 -0.102458 -0.867495 1.00631 -0.1023 -0.855616 1.00713 -0.102107 -0.843284 1.00794 -0.101871 -0.830514 1.00871 -0.101586 -0.817326 1.00944 -0.101243 -0.803747 1.01011 -0.100834 -0.789808 1.01069 -0.100351 -0.775548 1.01116 -0.0997844 -0.761015 1.01149 -0.0991271 -0.746265 1.01164 -0.0983707 -0.731364 1.0116 -0.0975065 -0.716384 1.01134 -0.0965247 -0.701401 1.01086 -0.0954134 -0.686495 1.01014 -0.0941586 -0.671744 1.00919 -0.0927429 -0.657222 1.00804 -0.0911453 -0.642998 1.00668 -0.089341 -4.7159 1.09467 -0.0534526 -3.46822 1.0463 -0.128115 -2.6 1.04128 -0.136977 -2.00076 1.03995 -0.137617 -1.60254 1.04 -0.137686 -1.34912 1.04086 -0.138071 -1.1962 1.0419 -0.139 -1.10858 1.04279 -0.14031 -1.05946 1.04351 -0.141649 -1.03109 1.04408 -0.142734 -1.01338 1.04455 -0.143506 -1.00076 1.04494 -0.144049 -0.990212 1.04533 -0.144433 -0.980239 1.04591 -0.144588 -0.970192 1.04655 -0.144635 -0.960043 1.0472 -0.144606 -0.94972 1.04783 -0.144512 -0.939151 1.04844 -0.144358 -0.928279 1.04902 -0.144148 -0.917061 1.04957 -0.143883 -0.905464 1.05007 -0.143565 -0.893466 1.05053 -0.143194 -0.881052 1.05095 -0.142767 -0.868217 1.05131 -0.14228 -0.854957 1.05163 -0.141727 -0.841278 1.05189 -0.141101 -0.827188 1.05209 -0.140395 -0.812699 1.05221 -0.139599 -0.79783 1.05224 -0.138706 -0.782606 1.05215 -0.137706 -0.767058 1.05193 -0.136593 -0.751226 1.05154 -0.135357 -0.73516 1.05097 -0.13399 -0.718917 1.05018 -0.132479 -0.702562 1.04917 -0.130813 -0.686166 1.0479 -0.128973 -0.669801 1.04638 -0.126938 -0.653542 1.0446 -0.124682 -0.63746 1.04257 -0.122173 -0.621625 1.0403 -0.119375 -4.7159 1.1916 -0.0878603 -3.4838 1.13539 -0.17441 -2.63063 1.12702 -0.19104 -2.03792 1.12507 -0.192694 -1.64327 1.12485 -0.192916 -1.39217 1.12551 -0.193287 -1.23997 1.12637 -0.194198 -1.15074 1.12715 -0.195458 -1.0982 1.1278 -0.196703 -1.06594 1.12831 -0.197705 -1.04459 1.12872 -0.198421 -1.02873 1.12905 -0.198915 -1.0152 1.12937 -0.199235 -1.00236 1.12984 -0.199267 -0.989497 1.13033 -0.199158 -0.97659 1.13078 -0.19895 -0.963559 1.13117 -0.198655 -0.950328 1.13148 -0.198278 -0.936837 1.13171 -0.197824 -0.923039 1.13184 -0.197291 -0.908901 1.13187 -0.196681 -0.894397 1.1318 -0.195989 -0.87951 1.13163 -0.19521 -0.864229 1.13133 -0.194337 -0.848548 1.13093 -0.193361 -0.832462 1.1304 -0.192271 -0.815974 1.12974 -0.191056 -0.799087 1.12894 -0.189704 -0.781812 1.12798 -0.188202 -0.764164 1.12685 -0.186537 -0.746167 1.12552 -0.184697 -0.727852 1.12396 -0.182668 -0.709261 1.12215 -0.180435 -0.690448 1.12007 -0.177983 -0.671472 1.1177 -0.17529 -0.652402 1.11501 -0.172333 -0.633316 1.112 -0.169083 -0.614292 1.10868 -0.16551 -0.595415 1.10503 -0.161577 -0.576771 1.10108 -0.157248 -4.7159 1.35287 -0.144474 -3.50759 1.29162 -0.234482 -2.67995 1.27746 -0.262862 -2.09929 1.2743 -0.266608 -1.71057 1.27325 -0.267231 -1.4614 1.27306 -0.267544 -1.30709 1.2731 -0.268178 -1.21238 1.27318 -0.269034 -1.15293 1.27325 -0.269874 -1.11389 1.27331 -0.270548 -1.08648 1.27335 -0.27101 -1.06526 1.27336 -0.271285 -1.04682 1.27335 -0.271381 -1.02926 1.27348 -0.271123 -1.01178 1.27358 -0.270686 -0.994364 1.27358 -0.270125 -0.976906 1.27347 -0.269457 -0.959315 1.27321 -0.268685 -0.941517 1.27281 -0.267813 -0.923455 1.27224 -0.266837 -0.905083 1.2715 -0.265754 -0.886366 1.27057 -0.264557 -0.867278 1.26946 -0.263235 -0.847796 1.26814 -0.261775 -0.827904 1.26661 -0.260163 -0.80759 1.26487 -0.258381 -0.786845 1.26289 -0.256412 -0.765666 1.26066 -0.254234 -0.744055 1.25816 -0.251829 -0.722023 1.25537 -0.249175 -0.699589 1.25225 -0.246254 -0.676787 1.2488 -0.243043 -0.65366 1.24496 -0.239521 -0.63027 1.24073 -0.235667 -0.606688 1.23609 -0.231456 -0.583001 1.23101 -0.226861 -0.559306 1.2255 -0.221856 -0.535708 1.21956 -0.21641 -0.512319 1.21322 -0.210495 -0.489256 1.2065 -0.20408 -4.7159 1.62116 -0.237641 -3.54525 1.5599 -0.318541 -2.7601 1.5366 -0.360334 -2.20098 1.53071 -0.368167 -1.82088 1.52771 -0.369767 -1.57093 1.52562 -0.369997 -1.40883 1.52392 -0.370057 -1.30263 1.52248 -0.370165 -1.23098 1.52127 -0.370287 -1.18057 1.52025 -0.37035 -1.14308 1.51937 -0.370299 -1.11286 1.51855 -0.370114 -1.08613 1.51774 -0.369747 -1.06064 1.51706 -0.36894 -1.03546 1.51629 -0.367907 -1.01053 1.51536 -0.366721 -0.985726 1.51424 -0.365402 -0.960909 1.5129 -0.363952 -0.935973 1.51133 -0.362371 -0.91083 1.5095 -0.360653 -0.88541 1.50739 -0.358789 -0.859653 1.50499 -0.356764 -0.83351 1.50228 -0.354561 -0.80694 1.49924 -0.35216 -0.779911 1.49586 -0.349537 -0.752398 1.49212 -0.346665 -0.724383 1.48798 -0.343518 -0.695858 1.48342 -0.340067 -0.666825 1.47842 -0.336283 -0.637299 1.47293 -0.332137 -0.60731 1.46694 -0.327602 -0.576906 1.4604 -0.322651 -0.546154 1.45329 -0.317258 -0.51514 1.44558 -0.3114 -0.483969 1.43727 -0.305051 -0.452763 1.42835 -0.298188 -0.421656 1.41884 -0.290788 -0.390794 1.40878 -0.282827 -0.360327 1.39819 -0.274284 -0.330407 1.38715 -0.265139 -4.7159 2.06749 -0.390981 -3.60561 2.01379 -0.449962 -2.88781 1.97951 -0.498469 -2.3642 1.96782 -0.512183 -1.99565 1.96096 -0.515868 -1.74035 1.95566 -0.516395 -1.56296 1.95116 -0.515937 -1.43747 1.94727 -0.515217 -1.34617 1.9439 -0.514458 -1.27742 1.94097 -0.513691 -1.22334 1.93837 -0.512877 -1.17807 1.93595 -0.511963 -1.13734 1.93358 -0.510853 -1.09852 1.93132 -0.509192 -1.06049 1.92892 -0.50725 -1.02311 1.92627 -0.50512 -0.986156 1.92335 -0.502821 -0.949425 1.9201 -0.500354 -0.912739 1.91651 -0.497714 -0.875945 1.91252 -0.494887 -0.838918 1.90812 -0.491855 -0.801547 1.90327 -0.488596 -0.763743 1.89793 -0.48508 -0.725429 1.89208 -0.481276 -0.686549 1.88566 -0.47715 -0.647057 1.87865 -0.472662 -0.606928 1.87099 -0.467775 -0.566153 1.86265 -0.462447 -0.524742 1.85358 -0.45664 -0.482728 1.84373 -0.450317 -0.440167 1.83306 -0.443441 -0.39714 1.82153 -0.43598 -0.353756 1.80912 -0.427906 -0.310149 1.7958 -0.419191 -0.266478 1.78158 -0.409812 -0.22292 1.76649 -0.399748 -0.179667 1.75056 -0.388981 -0.13692 1.73386 -0.377492 -0.0948845 1.71647 -0.365269 -0.0537636 1.6985 -0.352299 -4.7159 2.80998 -0.643384 -3.69441 2.77099 -0.674318 -3.07335 2.73145 -0.712403 -2.60044 2.71177 -0.728128 -2.24841 2.69899 -0.733721 -1.98611 2.68909 -0.734945 -1.78823 2.68074 -0.734315 -1.63613 2.67343 -0.732934 -1.51659 2.66693 -0.731278 -1.42021 2.66106 -0.729521 -1.34003 2.65567 -0.727686 -1.27032 2.65056 -0.725731 -1.20661 2.64552 -0.723538 -1.14592 2.64057 -0.720688 -1.08691 2.6354 -0.717493 -1.02927 2.62991 -0.714061 -0.972611 2.62403 -0.710408 -0.916577 2.6177 -0.70653 -0.860855 2.61086 -0.70241 -0.805174 2.60346 -0.698026 -0.749301 2.59543 -0.693345 -0.693035 2.58671 -0.68833 -0.636211 2.57723 -0.68294 -0.578693 2.56692 -0.677124 -0.520378 2.5557 -0.670833 -0.461193 2.5435 -0.664011 -0.401099 2.53024 -0.656602 -0.340087 2.51585 -0.648552 -0.278185 2.50024 -0.639805 -0.215455 2.48335 -0.630311 -0.151997 2.46512 -0.62002 -0.0879463 2.44548 -0.60889 -0.0234788 2.42442 -0.596883 --0.0411958 2.40192 -0.583967 --0.105836 2.378 -0.570115 --0.170176 2.35271 -0.555303 --0.233929 2.32614 -0.539516 --0.296801 2.29839 -0.522741 --0.358494 2.26963 -0.50497 --0.418714 2.24002 -0.486203 -4.7159 4.04517 -1.05889 -3.78616 4.02157 -1.06586 -3.25863 3.99023 -1.08029 -2.83678 3.96881 -1.08652 -2.50615 3.95267 -1.0876 -2.24417 3.93939 -1.0859 -2.03232 3.92781 -1.08276 -1.85722 3.91734 -1.07895 -1.70939 3.90767 -1.07483 -1.58198 3.89856 -1.0706 -1.46973 3.88986 -1.06631 -1.3681 3.88137 -1.0619 -1.27331 3.87289 -1.05729 -1.18271 3.86436 -1.0521 -1.09483 3.85553 -1.04659 -1.00907 3.84629 -1.04082 -0.924805 3.83655 -1.03481 -0.841483 3.82621 -1.02854 -0.758598 3.81517 -1.02197 -0.675708 3.80334 -1.01508 -0.59242 3.7906 -1.00782 -0.508392 3.77683 -1.00013 -0.423325 3.76189 -0.991956 -0.33697 3.74564 -0.983232 -0.249123 3.72794 -0.973884 -0.159633 3.70862 -0.963834 -0.0683969 3.68754 -0.953 --0.0246287 3.66451 -0.941296 --0.11943 3.63939 -0.928636 --0.215927 3.61203 -0.914932 --0.313977 3.58228 -0.9001 --0.413364 3.55004 -0.884058 --0.513804 3.51524 -0.866729 --0.614946 3.47783 -0.848043 --0.71638 3.43784 -0.82794 --0.817643 3.39534 -0.806367 --0.918233 3.35048 -0.783285 --1.01763 3.30345 -0.758665 --1.11529 3.25451 -0.732496 --1.21069 3.20399 -0.704779 -4.7159 6.09999 -1.74296 -3.61071 6.09377 -1.72988 -2.79484 6.08754 -1.7168 -2.19994 6.08132 -1.70373 -1.77279 6.0751 -1.69065 -1.47194 6.06888 -1.67757 -1.26511 6.06265 -1.66449 -1.12714 6.05643 -1.65141 -1.03847 6.05021 -1.63833 -0.983839 6.04399 -1.62525 -0.951373 6.03776 -1.61217 -0.931823 6.03154 -1.59909 -0.917985 6.02532 -1.58602 -0.904559 6.0191 -1.57294 -0.888483 6.01287 -1.55986 -0.867425 6.00665 -1.54678 -0.839377 6.00043 -1.5337 -0.802651 5.99421 -1.52062 -0.755852 5.98798 -1.50754 -0.697869 5.98176 -1.49446 -0.627857 5.97554 -1.48139 -0.545222 5.96929 -1.46831 -0.44961 5.962 -1.45523 -0.340917 5.9527 -1.44215 -0.219273 5.94071 -1.42907 -0.0850289 5.92528 -1.41586 --0.0612459 5.90563 -1.40217 --0.218774 5.88102 -1.38788 --0.386588 5.85074 -1.37282 --0.563544 5.81417 -1.35682 --0.74835 5.7708 -1.33969 --0.939587 5.72026 -1.32124 --1.13574 5.66237 -1.30126 --1.33523 5.59712 -1.27952 --1.53644 5.52468 -1.25582 --1.73777 5.44546 -1.22992 --1.93765 5.36002 -1.20159 --2.13459 5.26911 -1.17065 --2.32716 5.17365 -1.13686 --2.51408 5.07465 -1.10007 -0.940148 0.97021 -0.000736382 -0.934902 0.971265 -0.00147359 -0.929415 0.972347 -0.0022304 -0.923592 0.973476 -0.00302101 -0.917356 0.97466 -0.00385113 -0.910641 0.975896 -0.00471871 -0.9034 0.977177 -0.00561944 -0.895599 0.978494 -0.00654775 -0.887219 0.979839 -0.00749819 -0.878256 0.981205 -0.00846633 -0.868719 0.982586 -0.00944882 -0.858628 0.983978 -0.0104433 -0.848015 0.985375 -0.0114464 -0.836916 0.986769 -0.0124523 -0.825377 0.988143 -0.0134504 -0.813443 0.989474 -0.0144245 -0.801163 0.99073 -0.0153527 -0.788588 0.991874 -0.0162089 -0.775769 0.992867 -0.0169656 -0.762763 0.993674 -0.0175971 -0.749632 0.994269 -0.0180839 -0.736443 0.994637 -0.0184143 -0.723271 0.994778 -0.0185859 -0.710198 0.994705 -0.0186053 -0.697305 0.994439 -0.0184858 -0.684679 0.994006 -0.018244 -0.6724 0.993434 -0.0178972 -4.7159 0.969174 -7.865e-06 -3.43933 0.969158 -2.3885e-05 -2.55118 0.969157 -2.2091e-05 -1.94702 0.969157 -2.1384e-05 -1.5473 0.969157 -2.1149e-05 -1.2918 0.969157 -2.1157e-05 -1.13538 0.969157 -2.1334e-05 -1.04463 0.969156 -2.1444e-05 -0.995293 0.969156 -2.1162e-05 -0.970225 0.969156 -2.0663e-05 -0.957824 0.969156 -2.0357e-05 -0.95081 0.969157 -2.0228e-05 -0.945265 0.969159 -2.0082e-05 -0.940151 0.97021 -0.000756289 -0.934905 0.971264 -0.00149346 -0.929417 0.972346 -0.00225029 -0.923594 0.973475 -0.00304094 -0.917358 0.974659 -0.00387113 -0.910644 0.975895 -0.00473879 -0.903402 0.977176 -0.00563961 -0.895601 0.978493 -0.00656798 -0.887221 0.979839 -0.00751849 -0.878258 0.981205 -0.00848668 -0.868721 0.982586 -0.0094692 -0.85863 0.983978 -0.0104637 -0.848016 0.985375 -0.0114668 -0.836918 0.986769 -0.0124727 -0.825378 0.988143 -0.0134708 -0.813444 0.989474 -0.0144449 -0.801164 0.99073 -0.0153731 -0.788589 0.991875 -0.0162292 -0.77577 0.992868 -0.0169858 -0.762763 0.993675 -0.0176174 -0.749632 0.99427 -0.0181041 -0.736443 0.994639 -0.0184344 -0.723271 0.99478 -0.0186059 -0.710197 0.994707 -0.0186253 -0.697304 0.994441 -0.0185058 -0.684678 0.994008 -0.0182639 -0.672399 0.993436 -0.0179171 -4.7159 0.969201 -2.0122e-05 -3.43934 0.969157 -6.4538e-05 -2.55118 0.969156 -6.0032e-05 -1.94703 0.969155 -5.8214e-05 -1.5473 0.969155 -5.7611e-05 -1.2918 0.969155 -5.7661e-05 -1.13538 0.969155 -5.8203e-05 -1.04463 0.969155 -5.8625e-05 -0.995296 0.969155 -5.8023e-05 -0.970228 0.969155 -5.6824e-05 -0.957826 0.969155 -5.6123e-05 -0.95081 0.969157 -5.5921e-05 -0.945268 0.969163 -5.6213e-05 -0.940155 0.97021 -0.000791416 -0.934909 0.971263 -0.00152838 -0.929422 0.972345 -0.00228514 -0.923599 0.973474 -0.0030758 -0.917362 0.974658 -0.00390603 -0.910648 0.975894 -0.00477374 -0.903406 0.977175 -0.00567462 -0.895605 0.978493 -0.00660305 -0.887224 0.979838 -0.00755359 -0.878261 0.981204 -0.00852179 -0.868724 0.982586 -0.0095043 -0.858633 0.983978 -0.0104987 -0.848019 0.985376 -0.0115018 -0.83692 0.98677 -0.0125076 -0.825381 0.988144 -0.0135056 -0.813446 0.989475 -0.0144795 -0.801166 0.990732 -0.0154076 -0.78859 0.991876 -0.0162636 -0.775771 0.99287 -0.01702 -0.762764 0.993677 -0.0176513 -0.749632 0.994273 -0.0181379 -0.736442 0.994641 -0.018468 -0.72327 0.994783 -0.0186394 -0.710196 0.99471 -0.0186587 -0.697303 0.994444 -0.0185391 -0.684676 0.994012 -0.0182972 -0.672396 0.993439 -0.0179503 -4.7159 0.969246 -3.8801e-05 -3.43935 0.969156 -0.000133964 -2.5512 0.969153 -0.000125388 -1.94704 0.969152 -0.00012183 -1.54731 0.969152 -0.000120657 -1.29181 0.969153 -0.000120825 -1.13539 0.969153 -0.000122068 -1.04464 0.969153 -0.000123131 -0.995301 0.969153 -0.000122144 -0.970232 0.969153 -0.000119973 -0.957828 0.969154 -0.000118831 -0.950811 0.969156 -0.00011878 -0.945273 0.96917 -0.000120994 -0.940163 0.970209 -0.000853276 -0.934918 0.971262 -0.00158962 -0.92943 0.972343 -0.00234611 -0.923606 0.973472 -0.00313662 -0.91737 0.974657 -0.00396677 -0.910655 0.975893 -0.00483445 -0.903413 0.977174 -0.0057353 -0.895611 0.978492 -0.00666371 -0.88723 0.979837 -0.00761418 -0.878267 0.981204 -0.00858229 -0.868729 0.982585 -0.00956466 -0.858638 0.983978 -0.0105589 -0.848023 0.985376 -0.0115617 -0.836924 0.98677 -0.0125672 -0.825384 0.988145 -0.0135648 -0.81345 0.989477 -0.0145384 -0.801169 0.990734 -0.0154661 -0.788593 0.991879 -0.0163217 -0.775772 0.992873 -0.0170776 -0.762765 0.993681 -0.0177085 -0.749632 0.994277 -0.0181947 -0.736442 0.994646 -0.0185244 -0.723269 0.994788 -0.0186955 -0.710194 0.994716 -0.0187146 -0.697301 0.99445 -0.0185949 -0.684673 0.994017 -0.0183529 -0.672393 0.993444 -0.018006 -4.7159 0.969322 -6.724e-05 -3.43937 0.969155 -0.000252384 -2.55123 0.969149 -0.000237801 -1.94707 0.969147 -0.000231543 -1.54733 0.969148 -0.000229496 -1.29183 0.969148 -0.00022995 -1.1354 0.969149 -0.000232482 -1.04465 0.96915 -0.00023473 -0.995309 0.969149 -0.00023326 -0.970239 0.969149 -0.000229792 -0.957834 0.969152 -0.000228316 -0.950812 0.969157 -0.000229015 -0.945282 0.969182 -0.000236378 -0.940177 0.970208 -0.000961768 -0.934932 0.971259 -0.0016966 -0.929443 0.972341 -0.0024523 -0.92362 0.97347 -0.0032423 -0.917382 0.974654 -0.00407208 -0.910667 0.97589 -0.00493947 -0.903424 0.977172 -0.00584007 -0.895622 0.97849 -0.0067682 -0.88724 0.979836 -0.00771838 -0.878276 0.981203 -0.00868613 -0.868738 0.982585 -0.00966809 -0.858646 0.983978 -0.0106618 -0.848031 0.985377 -0.0116641 -0.836932 0.986772 -0.0126688 -0.825391 0.988147 -0.0136656 -0.813456 0.98948 -0.0146383 -0.801174 0.990737 -0.0155651 -0.788597 0.991883 -0.0164197 -0.775775 0.992878 -0.0171746 -0.762767 0.993688 -0.0178045 -0.749633 0.994285 -0.0182897 -0.736441 0.994655 -0.0186187 -0.723267 0.994798 -0.0187893 -0.710191 0.994725 -0.018808 -0.697296 0.994459 -0.018688 -0.684668 0.994027 -0.0184459 -0.672387 0.993453 -0.0180988 -4.7159 0.96945 -0.000110925 -3.43941 0.969155 -0.000453391 -2.55127 0.969144 -0.000430166 -1.94711 0.96914 -0.000419778 -1.54737 0.96914 -0.000416422 -1.29185 0.969142 -0.000417498 -1.13542 0.969144 -0.000422342 -1.04466 0.969145 -0.000426669 -0.995324 0.969144 -0.000424615 -0.970252 0.969145 -0.000419573 -0.957843 0.969148 -0.000418279 -0.950815 0.969158 -0.000421117 -0.945298 0.969203 -0.000439792 -0.940202 0.970206 -0.00115086 -0.934956 0.971256 -0.0018823 -0.929467 0.972337 -0.00263614 -0.923642 0.973466 -0.00342481 -0.917404 0.97465 -0.00425352 -0.910687 0.975887 -0.00512002 -0.903444 0.977169 -0.00601981 -0.89564 0.978488 -0.00694714 -0.887258 0.979835 -0.00789649 -0.878292 0.981202 -0.00886333 -0.868753 0.982585 -0.00984427 -0.85866 0.983979 -0.0108368 -0.848044 0.985379 -0.0118377 -0.836944 0.986775 -0.0128408 -0.825402 0.988152 -0.0138359 -0.813466 0.989486 -0.0148067 -0.801183 0.990745 -0.0157316 -0.788604 0.991892 -0.0165842 -0.77578 0.992889 -0.017337 -0.76277 0.9937 -0.0179648 -0.749634 0.994299 -0.0184482 -0.73644 0.99467 -0.0187756 -0.723264 0.994814 -0.0189451 -0.710186 0.994742 -0.018963 -0.69729 0.994476 -0.0188426 -0.68466 0.994043 -0.0186002 -0.672378 0.99347 -0.0182529 -4.7159 0.969666 -0.000178887 -3.43947 0.969155 -0.000791931 -2.55135 0.969136 -0.000756731 -1.94718 0.969129 -0.000740148 -1.54742 0.96913 -0.000734877 -1.2919 0.969134 -0.000737218 -1.13545 0.969137 -0.000746113 -1.04469 0.969138 -0.000753979 -0.995351 0.969138 -0.00075135 -0.970277 0.969138 -0.000744809 -0.957862 0.969145 -0.000745142 -0.950824 0.969162 -0.000753077 -0.945327 0.969239 -0.000793259 -0.940244 0.970207 -0.00147773 -0.934997 0.971252 -0.00220206 -0.929507 0.972332 -0.00295183 -0.923681 0.973461 -0.00373746 -0.917441 0.974646 -0.00456363 -0.910722 0.975884 -0.00542794 -0.903477 0.977167 -0.00632571 -0.895671 0.978486 -0.0072511 -0.887287 0.979834 -0.00819847 -0.87832 0.981203 -0.00916324 -0.868778 0.982588 -0.0101419 -0.858684 0.983983 -0.011132 -0.848066 0.985385 -0.01213 -0.836965 0.986783 -0.0131299 -0.825421 0.988162 -0.0141213 -0.813482 0.989497 -0.0150884 -0.801197 0.990759 -0.0160094 -0.788615 0.991908 -0.0168581 -0.775789 0.992908 -0.0176068 -0.762775 0.993722 -0.0182305 -0.749635 0.994324 -0.0187102 -0.736438 0.994697 -0.0190348 -0.723259 0.994842 -0.019202 -0.710177 0.994772 -0.0192185 -0.697278 0.994506 -0.0190972 -0.684646 0.994073 -0.0188544 -0.672361 0.993499 -0.0185067 -4.7159 0.970028 -0.000285975 -3.43956 0.969162 -0.0013563 -2.55148 0.969129 -0.00130539 -1.94729 0.969117 -0.00127975 -1.54752 0.969118 -0.00127177 -1.29197 0.969125 -0.00127655 -1.13552 0.969131 -0.00129236 -1.04475 0.969134 -0.00130613 -0.995401 0.969133 -0.00130338 -0.970325 0.969134 -0.00129649 -0.957902 0.969146 -0.00130181 -0.950848 0.969175 -0.00132067 -0.94538 0.969296 -0.00139609 -0.940316 0.970215 -0.00203697 -0.935069 0.971251 -0.00274714 -0.929575 0.97233 -0.00348855 -0.923746 0.973459 -0.00426778 -0.917503 0.974645 -0.00508847 -0.910781 0.975884 -0.00594794 -0.903532 0.977168 -0.00684125 -0.895723 0.97849 -0.00776234 -0.887335 0.97984 -0.00870544 -0.878365 0.981211 -0.00966581 -0.86882 0.982598 -0.0106399 -0.858723 0.983996 -0.0116249 -0.848103 0.9854 -0.0126171 -0.836998 0.986801 -0.0136106 -0.825452 0.988184 -0.0145951 -0.81351 0.989523 -0.0155548 -0.80122 0.990788 -0.0164683 -0.788633 0.991942 -0.0173095 -0.775802 0.992946 -0.0180503 -0.762782 0.993765 -0.0186665 -0.749637 0.99437 -0.0191395 -0.736434 0.994747 -0.0194586 -0.723249 0.994895 -0.0196219 -0.710163 0.994825 -0.0196357 -0.697259 0.99456 -0.0195128 -0.684622 0.994127 -0.0192691 -0.672334 0.993552 -0.0189207 -4.7159 0.970632 -0.000456622 -3.43973 0.969191 -0.00228556 -2.5517 0.969133 -0.00221579 -1.94749 0.969113 -0.00217731 -1.54768 0.969115 -0.00216566 -1.2921 0.969126 -0.00217494 -1.13562 0.969137 -0.00220223 -1.04485 0.969142 -0.00222572 -0.995497 0.96914 -0.00222454 -0.970423 0.969143 -0.00222097 -0.957989 0.969165 -0.00223826 -0.950911 0.969216 -0.00227839 -0.945478 0.969391 -0.00240204 -0.940439 0.970246 -0.00298153 -0.935189 0.971268 -0.0036652 -0.92969 0.972343 -0.0043903 -0.923856 0.973472 -0.0051568 -0.917606 0.974659 -0.00596642 -0.910878 0.975899 -0.00681596 -0.903623 0.977186 -0.00770003 -0.895808 0.97851 -0.00861226 -0.887415 0.979864 -0.0095466 -0.878439 0.981239 -0.0104981 -0.868889 0.98263 -0.011463 -0.858787 0.984032 -0.0124381 -0.848162 0.985441 -0.0134193 -0.837053 0.986847 -0.0144005 -0.825501 0.988235 -0.0153718 -0.813554 0.989581 -0.0163178 -0.801257 0.990852 -0.0172175 -0.788662 0.992012 -0.0180447 -0.775822 0.993023 -0.0187712 -0.762794 0.993848 -0.0193737 -0.749639 0.99446 -0.0198347 -0.736427 0.994842 -0.0201441 -0.723233 0.994994 -0.0203001 -0.710138 0.994926 -0.0203091 -0.697227 0.994662 -0.0201832 -0.684583 0.994228 -0.0199376 -0.672288 0.99365 -0.0195878 -4.7159 0.971641 -0.000731024 -3.43999 0.969279 -0.00379362 -2.55207 0.969181 -0.00370477 -1.94782 0.969146 -0.00364891 -1.54795 0.969149 -0.00363253 -1.29233 0.969168 -0.00364969 -1.13582 0.969188 -0.00369548 -1.04503 0.969198 -0.00373478 -0.995688 0.969195 -0.00373982 -0.970626 0.969201 -0.00374838 -0.958179 0.96924 -0.00379044 -0.951066 0.969325 -0.00386723 -0.945665 0.969554 -0.00404359 -0.940648 0.970345 -0.00455087 -0.935395 0.971339 -0.0051892 -0.929885 0.972407 -0.00588426 -0.924038 0.973534 -0.00662677 -0.917778 0.974721 -0.00741524 -0.911039 0.975964 -0.00824549 -0.903773 0.977254 -0.00911146 -0.895947 0.978583 -0.0100063 -0.887544 0.979942 -0.0109235 -0.878559 0.981323 -0.0118579 -0.869001 0.98272 -0.0128052 -0.85889 0.984129 -0.0137616 -0.848257 0.985545 -0.0147222 -0.83714 0.98696 -0.0156808 -0.82558 0.988357 -0.016628 -0.813622 0.989712 -0.017549 -0.801315 0.990992 -0.0184235 -0.788707 0.992161 -0.0192256 -0.775853 0.993182 -0.0199269 -0.76281 0.994018 -0.0205057 -0.74964 0.994639 -0.0209459 -0.736413 0.995029 -0.0212383 -0.723204 0.995185 -0.0213817 -0.710096 0.995121 -0.021382 -0.697171 0.994857 -0.0212505 -0.684516 0.994421 -0.0210012 -0.67221 0.99384 -0.0206483 -4.7159 0.973324 -0.00117532 -3.44042 0.969526 -0.0062 -2.55267 0.969361 -0.00609993 -1.94838 0.969302 -0.00602197 -1.54843 0.969306 -0.00599996 -1.29273 0.969338 -0.00603021 -1.13618 0.969374 -0.00610472 -1.04539 0.969392 -0.00616956 -0.996077 0.969391 -0.00619157 -0.971051 0.969404 -0.00622997 -0.958587 0.969472 -0.00631668 -0.951425 0.969605 -0.00644619 -0.946027 0.969879 -0.00666687 -0.941014 0.970613 -0.00710299 -0.935746 0.971567 -0.00767377 -0.930215 0.972618 -0.00831776 -0.924345 0.973739 -0.00901774 -0.918062 0.974925 -0.00976799 -0.911302 0.976169 -0.0105628 -0.904017 0.977463 -0.011395 -0.896172 0.978798 -0.0122572 -0.887752 0.980164 -0.0131423 -0.87875 0.981554 -0.0140447 -0.869177 0.98296 -0.0149595 -0.859053 0.984379 -0.0158816 -0.848406 0.985807 -0.016805 -0.837275 0.987234 -0.0177234 -0.8257 0.988644 -0.018628 -0.813727 0.990011 -0.0195049 -0.801401 0.991304 -0.0203353 -0.788773 0.992486 -0.0210938 -0.775896 0.993521 -0.0217525 -0.762829 0.994371 -0.0222914 -0.749635 0.995004 -0.0226968 -0.736384 0.995403 -0.0229609 -0.723152 0.995566 -0.0230825 -0.710021 0.995504 -0.0230672 -0.697075 0.99524 -0.022925 -0.6844 0.994801 -0.0226682 -0.672075 0.994214 -0.0223088 -4.7159 0.976128 -0.00189834 -3.44112 0.970164 -0.00996387 -2.55365 0.969893 -0.00987868 -1.94931 0.969794 -0.00977554 -1.54924 0.969798 -0.00974753 -1.29345 0.969854 -0.00979813 -1.13687 0.969919 -0.00991512 -1.04611 0.969954 -0.0100207 -0.996876 0.969958 -0.0100814 -0.971924 0.969991 -0.010179 -0.959435 0.970105 -0.0103335 -0.952189 0.970292 -0.0105223 -0.946734 0.970596 -0.0107712 -0.941673 0.971289 -0.0111443 -0.936362 0.972193 -0.0116307 -0.930782 0.973214 -0.0121977 -0.924866 0.974319 -0.0128285 -0.918539 0.975497 -0.0135142 -0.911738 0.976738 -0.0142476 -0.904415 0.978034 -0.0150205 -0.896537 0.979374 -0.0158246 -0.888085 0.980748 -0.0166523 -0.879055 0.982147 -0.0174973 -0.869456 0.983564 -0.0183541 -0.859306 0.984996 -0.0192158 -0.848635 0.986438 -0.0200749 -0.83748 0.98788 -0.0209246 -0.825881 0.989305 -0.0217568 -0.81388 0.990688 -0.0225597 -0.801525 0.991996 -0.0233158 -0.788863 0.993193 -0.0240016 -0.775949 0.994244 -0.0245906 -0.762845 0.995108 -0.0250654 -0.749612 0.995753 -0.0254147 -0.736322 0.996162 -0.0256323 -0.723051 0.996331 -0.0257175 -0.709884 0.996271 -0.0256749 -0.696903 0.996004 -0.0255125 -0.684193 0.995557 -0.0252402 -0.671835 0.994959 -0.0248669 -4.7159 0.980799 -0.00307917 -3.44222 0.971716 -0.0157083 -2.55525 0.97128 -0.0157017 -1.95088 0.971118 -0.0155758 -1.55067 0.971123 -0.0155424 -1.29477 0.971218 -0.0156217 -1.13819 0.971334 -0.0157972 -1.04754 0.971404 -0.0159663 -0.998484 0.97143 -0.0161028 -0.973657 0.971508 -0.016297 -0.961105 0.971683 -0.0165334 -0.953702 0.971917 -0.016773 -0.948092 0.97224 -0.0170347 -0.942893 0.972902 -0.0173506 -0.937466 0.973756 -0.0177463 -0.931782 0.974732 -0.0182136 -0.925769 0.975804 -0.0187444 -0.919353 0.976958 -0.0193313 -0.912472 0.978183 -0.019967 -0.905077 0.97947 -0.020643 -0.897134 0.980806 -0.0213506 -0.888623 0.98218 -0.0220819 -0.87954 0.983584 -0.0228303 -0.869892 0.985008 -0.0235889 -0.859696 0.986448 -0.0243497 -0.848982 0.9879 -0.0251031 -0.837784 0.989353 -0.0258418 -0.82614 0.990789 -0.0265584 -0.814093 0.992183 -0.0272431 -0.801687 0.993502 -0.0278811 -0.788969 0.994709 -0.0284519 -0.775997 0.995769 -0.0289323 -0.76283 0.996642 -0.0293077 -0.749535 0.997295 -0.0295696 -0.736182 0.997708 -0.0297134 -0.722849 0.997877 -0.0297388 -0.70962 0.997811 -0.0296488 -0.696579 0.997533 -0.0294489 -0.68381 0.997069 -0.0291451 -0.671392 0.996447 -0.0287429 -4.7159 0.988578 -0.00501258 -3.44394 0.975273 -0.0242035 -2.55785 0.974592 -0.0244122 -1.95351 0.974331 -0.0242788 -1.55316 0.974337 -0.024242 -1.29718 0.9745 -0.0243558 -1.14069 0.974706 -0.0246039 -1.0503 0.974845 -0.0248667 -1.00159 0.974932 -0.0251287 -0.976906 0.975093 -0.0254491 -0.964188 0.975336 -0.0257631 -0.9565 0.975607 -0.0260374 -0.950601 0.97594 -0.0263006 -0.945129 0.976573 -0.0265598 -0.939463 0.977376 -0.0268633 -0.933565 0.978293 -0.0272175 -0.927359 0.979307 -0.0276227 -0.920769 0.98041 -0.0280762 -0.91373 0.981589 -0.0285732 -0.906194 0.982836 -0.0291071 -0.898124 0.98414 -0.02967 -0.889501 0.985489 -0.0302544 -0.880315 0.986872 -0.0308535 -0.870573 0.988279 -0.0314599 -0.860291 0.989706 -0.0320645 -0.849493 0.991146 -0.032657 -0.838214 0.992588 -0.0332291 -0.82649 0.994013 -0.033774 -0.814359 0.995394 -0.0342836 -0.801865 0.996698 -0.0347467 -0.789053 0.997891 -0.0351472 -0.775982 0.998937 -0.0354671 -0.762713 0.999796 -0.0356953 -0.749313 1.00043 -0.0358259 -0.735854 1.00083 -0.0358562 -0.722417 1.00098 -0.0357853 -0.709082 1.00089 -0.0356145 -0.695936 1.00058 -0.0353456 -0.68306 1.00007 -0.0349805 -0.670531 0.999401 -0.0345196 -4.7159 1.00153 -0.00818367 -3.44659 0.982944 -0.0362679 -2.562 0.981914 -0.0369644 -1.95788 0.98151 -0.0368628 -1.55746 0.981519 -0.0368255 -1.30152 0.981788 -0.0369702 -1.14532 0.982138 -0.0372958 -1.05546 0.982403 -0.0376856 -1.00723 0.982621 -0.0381175 -0.982595 0.982906 -0.0385694 -0.969515 0.983219 -0.0389452 -0.96135 0.983522 -0.0392421 -0.954983 0.983861 -0.0395008 -0.949058 0.984462 -0.0397021 -0.942973 0.985205 -0.0399137 -0.936689 0.986046 -0.0401507 -0.930129 0.986972 -0.0404175 -0.923215 0.987979 -0.0407154 -0.915883 0.989062 -0.0410429 -0.908079 0.990213 -0.0413963 -0.899768 0.991425 -0.0417704 -0.890926 0.992686 -0.0421589 -0.881542 0.993986 -0.0425555 -0.871618 0.995317 -0.0429529 -0.861165 0.996669 -0.0433421 -0.850207 0.998036 -0.0437133 -0.838772 0.999405 -0.044058 -0.826892 1.00076 -0.0443698 -0.814605 1.00206 -0.0446423 -0.801949 1.00329 -0.0448676 -0.788972 1.0044 -0.0450351 -0.775728 1.00537 -0.0451327 -0.762282 1.00616 -0.0451538 -0.748702 1.00673 -0.0450953 -0.73506 1.00706 -0.0449558 -0.721436 1.00713 -0.0447339 -0.707912 1.00697 -0.0444283 -0.694573 1.00657 -0.0440368 -0.681497 1.00598 -0.0435559 -0.66876 1.0052 -0.0429802 -4.7159 1.02309 -0.013391 -3.45057 0.998501 -0.0525876 -2.56851 0.996968 -0.0542934 -1.965 0.996372 -0.0542991 -1.56475 0.996386 -0.0542654 -1.3091 0.996801 -0.0544236 -1.15352 0.997348 -0.05482 -1.06448 0.997811 -0.0553633 -1.01677 0.998239 -0.0559797 -0.991887 0.998676 -0.056546 -0.97813 0.999067 -0.056972 -0.969219 0.999407 -0.0572881 -0.962138 0.999757 -0.0575423 -0.95552 1.00032 -0.0576908 -0.948773 1.001 -0.0578182 -0.941863 1.00174 -0.0579453 -0.934713 1.00254 -0.0580788 -0.927248 1.00341 -0.0582212 -0.919402 1.00433 -0.0583732 -0.911123 1.00531 -0.0585336 -0.902373 1.00634 -0.0586996 -0.893125 1.00741 -0.0588667 -0.883366 1.00852 -0.0590295 -0.873093 1.00966 -0.0591812 -0.862312 1.01082 -0.0593137 -0.85104 1.012 -0.0594183 -0.839299 1.01317 -0.0594875 -0.827119 1.01432 -0.0595156 -0.814532 1.01543 -0.0594979 -0.801573 1.01645 -0.0594297 -0.788287 1.01737 -0.0593051 -0.774729 1.01814 -0.0591175 -0.76096 1.01873 -0.0588646 -0.747049 1.01911 -0.0585463 -0.733069 1.01925 -0.0581624 -0.719099 1.01914 -0.0577107 -0.705218 1.01879 -0.0571871 -0.691507 1.0182 -0.0565846 -0.678043 1.0174 -0.0558937 -0.664895 1.0164 -0.0551019 -4.7159 1.05897 -0.0219491 -3.45639 1.02822 -0.0735932 -2.57857 1.02593 -0.0772681 -1.97643 1.0251 -0.077507 -1.57682 1.0251 -0.0774873 -1.3219 1.02567 -0.077638 -1.16737 1.02643 -0.0780999 -1.07935 1.02713 -0.078804 -1.0318 1.0278 -0.0795771 -1.00612 1.02839 -0.0802274 -0.99121 1.02887 -0.0806943 -0.981157 1.02926 -0.0810291 -0.973006 1.02963 -0.0812814 -0.965351 1.03016 -0.0813879 -0.957599 1.03077 -0.0814466 -0.949723 1.0314 -0.0814826 -0.941646 1.03206 -0.0815032 -0.933295 1.03274 -0.0815112 -0.924605 1.03345 -0.0815078 -0.915527 1.03418 -0.0814929 -0.906019 1.03493 -0.0814646 -0.896054 1.03571 -0.0814195 -0.885616 1.0365 -0.0813528 -0.874695 1.0373 -0.0812581 -0.863294 1.03811 -0.0811279 -0.85142 1.03892 -0.0809544 -0.839091 1.03972 -0.080731 -0.826329 1.04048 -0.0804528 -0.813159 1.04119 -0.0801163 -0.799614 1.04181 -0.079719 -0.785735 1.04232 -0.0792577 -0.77157 1.04268 -0.0787293 -0.757181 1.04286 -0.0781347 -0.742632 1.04284 -0.0774754 -0.727994 1.04258 -0.0767519 -0.713341 1.04207 -0.0759604 -0.698748 1.04131 -0.0750933 -0.684291 1.0403 -0.0741381 -0.670038 1.03905 -0.0730779 -0.656055 1.03758 -0.0718911 -4.7159 1.11869 -0.0360221 -3.46488 1.0822 -0.0996459 -2.59409 1.0787 -0.106933 -1.99466 1.07757 -0.10761 -1.59652 1.07752 -0.10764 -1.34298 1.07815 -0.107786 -1.18989 1.07903 -0.108316 -1.10253 1.07991 -0.10914 -1.05417 1.08073 -0.109987 -1.02674 1.08142 -0.110663 -1.00992 1.08196 -0.111141 -0.998086 1.08238 -0.111477 -0.988294 1.08275 -0.111716 -0.97906 1.08324 -0.111778 -0.969771 1.08376 -0.111771 -0.960402 1.08427 -0.111724 -0.950877 1.08476 -0.111645 -0.94112 1.08523 -0.111536 -0.931069 1.08568 -0.111398 -0.92067 1.08611 -0.111231 -0.909884 1.08651 -0.111032 -0.89868 1.0869 -0.110797 -0.887038 1.08726 -0.110522 -0.874942 1.08759 -0.110199 -0.862389 1.08789 -0.109821 -0.849379 1.08815 -0.109378 -0.83592 1.08836 -0.108865 -0.822026 1.08851 -0.108275 -0.807716 1.08857 -0.107605 -0.793015 1.08853 -0.106852 -0.777956 1.08834 -0.106011 -0.762583 1.08799 -0.10508 -0.746947 1.08745 -0.10406 -0.731109 1.08668 -0.102951 -0.715132 1.08565 -0.10175 -0.699083 1.08435 -0.100452 -0.683033 1.08277 -0.0990424 -0.66705 1.08091 -0.0975019 -0.6512 1.07876 -0.0958044 -0.635547 1.07634 -0.0939178 -4.7159 1.21809 -0.0591732 -3.47744 1.17679 -0.131704 -2.61843 1.17123 -0.14505 -2.02407 1.16968 -0.146539 -1.62878 1.1694 -0.146711 -1.37734 1.16985 -0.146882 -1.22536 1.17056 -0.147438 -1.13711 1.17134 -0.148234 -1.08603 1.17206 -0.148995 -1.05526 1.17265 -0.149584 -1.03523 1.17311 -0.149995 -1.02054 1.17345 -0.150274 -1.00812 1.17374 -0.15045 -0.996386 1.17411 -0.150421 -0.984657 1.17446 -0.150304 -0.97291 1.17476 -0.150135 -0.961063 1.175 -0.149922 -0.949031 1.17518 -0.149667 -0.936745 1.17528 -0.149369 -0.924147 1.17532 -0.149027 -0.911191 1.17528 -0.148638 -0.897839 1.17516 -0.148195 -0.884063 1.17496 -0.147691 -0.869842 1.17467 -0.147117 -0.85516 1.17429 -0.146463 -0.840009 1.1738 -0.145719 -0.824385 1.17321 -0.144874 -0.808294 1.17248 -0.143919 -0.791744 1.17159 -0.142847 -0.77475 1.17054 -0.141651 -0.757338 1.16927 -0.140322 -0.739543 1.16778 -0.138854 -0.721409 1.16602 -0.137243 -0.702993 1.16396 -0.135484 -0.684356 1.16158 -0.133569 -0.665566 1.15884 -0.131488 -0.646697 1.15575 -0.129219 -0.627828 1.15228 -0.126739 -0.609041 1.14844 -0.124016 -0.59042 1.14425 -0.121013 -4.7159 1.38351 -0.0972692 -3.49675 1.33902 -0.172593 -2.65759 1.32989 -0.194762 -2.07259 1.32757 -0.197801 -1.68218 1.32664 -0.198311 -1.43286 1.32637 -0.198507 -1.27979 1.32636 -0.198902 -1.18725 1.32647 -0.199406 -1.13026 1.32661 -0.199859 -1.09352 1.32674 -0.200193 -1.06814 1.32682 -0.200405 -1.04872 1.32685 -0.200515 -1.032 1.32683 -0.200527 -1.01615 1.32686 -0.200298 -1.00042 1.32683 -0.199965 -0.984783 1.32671 -0.199568 -0.96912 1.32648 -0.199117 -0.953331 1.32614 -0.198611 -0.937326 1.32568 -0.198051 -0.921029 1.32509 -0.197431 -0.904375 1.32435 -0.196745 -0.887312 1.32347 -0.195984 -0.869794 1.32243 -0.195136 -0.851785 1.32122 -0.194189 -0.833257 1.31983 -0.193128 -0.814186 1.31824 -0.191937 -0.794558 1.31643 -0.190601 -0.774367 1.31437 -0.189105 -0.753615 1.31204 -0.187434 -0.732314 1.30941 -0.185576 -0.710487 1.30643 -0.183516 -0.688171 1.30308 -0.18124 -0.665421 1.29932 -0.178739 -0.642304 1.29511 -0.176005 -0.618901 1.29042 -0.173026 -0.595308 1.28523 -0.169788 -0.571627 1.27954 -0.166272 -0.547974 1.27334 -0.162452 -0.524469 1.26666 -0.158303 -0.501239 1.25952 -0.153795 -4.7159 1.65882 -0.159971 -3.52779 1.61403 -0.22934 -2.72192 1.59905 -0.261454 -2.15381 1.59496 -0.26735 -1.77067 1.59254 -0.268566 -1.52134 1.5907 -0.268731 -1.36212 1.58916 -0.268721 -1.25979 1.58789 -0.268686 -1.19212 1.58686 -0.268628 -1.1454 1.586 -0.268534 -1.11118 1.58526 -0.268389 -1.08393 1.58455 -0.268187 -1.06004 1.58383 -0.267892 -1.03738 1.58315 -0.267313 -1.01507 1.58236 -0.26661 -0.993026 1.58144 -0.265831 -0.971097 1.58035 -0.264986 -0.949128 1.57909 -0.264074 -0.926984 1.57764 -0.263091 -0.904546 1.57598 -0.262027 -0.881713 1.5741 -0.260871 -0.858397 1.57196 -0.25961 -0.834524 1.56956 -0.258226 -0.81003 1.56686 -0.256699 -0.784867 1.56384 -0.255007 -0.758995 1.56047 -0.253129 -0.732391 1.5567 -0.25104 -0.705045 1.5525 -0.248719 -0.676963 1.54782 -0.246144 -0.648165 1.54262 -0.243295 -0.618692 1.53685 -0.240152 -0.588609 1.53045 -0.236695 -0.558001 1.5234 -0.232913 -0.526977 1.51565 -0.228795 -0.495664 1.50718 -0.22433 -0.464208 1.49798 -0.219507 -0.432768 1.48806 -0.214308 -0.401511 1.47745 -0.208716 -0.37061 1.4662 -0.20271 -0.340241 1.45438 -0.196269 -4.7159 2.11699 -0.263191 -3.57892 2.07659 -0.317312 -2.8272 2.05388 -0.355117 -2.28749 2.04594 -0.365019 -1.91367 2.04068 -0.367549 -1.65958 2.03627 -0.367826 -1.48686 2.03243 -0.367402 -1.36742 2.02911 -0.366785 -1.28244 2.02627 -0.366141 -1.21969 2.02383 -0.36551 -1.17112 2.02169 -0.364883 -1.13097 2.01969 -0.364229 -1.0952 2.01771 -0.363487 -1.06132 2.01578 -0.362407 -1.02823 2.01369 -0.361181 -0.995765 2.01141 -0.359867 -0.96365 2.00891 -0.358474 -0.931632 2.00615 -0.356994 -0.899486 2.0031 -0.355419 -0.86701 1.99974 -0.353733 -0.834029 1.99601 -0.351918 -0.800393 1.99189 -0.349951 -0.765971 1.98731 -0.347805 -0.73066 1.98224 -0.345452 -0.69438 1.97661 -0.34286 -0.657073 1.97036 -0.339995 -0.618712 1.96343 -0.336825 -0.579292 1.95574 -0.333319 -0.538838 1.94723 -0.329446 -0.497403 1.93782 -0.325178 -0.45507 1.92744 -0.320488 -0.411956 1.91604 -0.315351 -0.368212 1.90357 -0.309753 -0.324017 1.89 -0.303682 -0.279576 1.8753 -0.297129 -0.235114 1.85951 -0.290085 -0.190871 1.84265 -0.282537 -0.147094 1.82482 -0.274474 -0.104031 1.80611 -0.265881 -0.0619233 1.78664 -0.256747 -4.7159 2.87949 -0.433131 -3.65832 2.84852 -0.46585 -2.98809 2.82053 -0.498024 -2.49022 2.80684 -0.509636 -2.12853 2.79736 -0.513344 -1.86587 2.78958 -0.513922 -1.67291 2.78284 -0.513271 -1.52848 2.77692 -0.512172 -1.41776 2.77169 -0.510943 -1.33046 2.76703 -0.509702 -1.25916 2.76279 -0.508465 -1.19807 2.75879 -0.507207 -1.14286 2.75485 -0.505853 -1.09066 2.75093 -0.504117 -1.04011 2.74683 -0.502216 -0.9908 2.74247 -0.50021 -0.942243 2.73781 -0.498103 -0.893993 2.73278 -0.495879 -0.845649 2.72734 -0.493521 -0.796859 2.72139 -0.491003 -0.747316 2.71488 -0.488294 -0.696757 2.70772 -0.48536 -0.644967 2.69981 -0.482162 -0.591772 2.69104 -0.478657 -0.537048 2.68133 -0.474799 -0.480716 2.67053 -0.470541 -0.422744 2.65855 -0.465835 -0.363149 2.64526 -0.460636 -0.301994 2.63053 -0.454901 -0.239389 2.61426 -0.448591 -0.175492 2.59634 -0.441668 -0.110512 2.5767 -0.434098 -0.0447021 2.55527 -0.42586 --0.0216438 2.53203 -0.416938 --0.0881982 2.50699 -0.407321 --0.154608 2.48019 -0.397001 --0.220501 2.45174 -0.38597 --0.285504 2.42179 -0.374221 --0.349244 2.39051 -0.361751 --0.411364 2.35814 -0.348559 -4.7159 4.14844 -0.712955 -3.74878 4.12878 -0.724151 -3.16513 4.10464 -0.739317 -2.71329 4.08868 -0.744865 -2.36947 4.07647 -0.745702 -2.1042 4.0662 -0.744339 -1.89501 4.05713 -0.742 -1.72626 4.04893 -0.739279 -1.58709 4.04139 -0.736461 -1.46971 4.03436 -0.733667 -1.36826 4.02771 -0.730924 -1.27788 4.02127 -0.728203 -1.19467 4.01487 -0.725428 -1.11585 4.00842 -0.722349 -1.03983 4.00175 -0.719129 -0.965796 3.99477 -0.715807 -0.89295 3.98738 -0.71237 -0.820558 3.9795 -0.708794 -0.747969 3.971 -0.705046 -0.674608 3.96178 -0.70109 -0.599968 3.95168 -0.696882 -0.523612 3.94057 -0.692377 -0.445172 3.92825 -0.687521 -0.364346 3.91456 -0.682258 -0.280905 3.89927 -0.676528 -0.194689 3.88218 -0.670267 -0.105615 3.86306 -0.66341 -0.0136765 3.84167 -0.655891 --0.0810517 3.8178 -0.647646 --0.178412 3.79121 -0.63861 --0.278158 3.76173 -0.628721 --0.379956 3.72918 -0.617918 --0.483386 3.69346 -0.606151 --0.587949 3.6545 -0.593379 --0.69308 3.61233 -0.579567 --0.798164 3.56703 -0.564685 --0.90255 3.51878 -0.54871 --1.00558 3.46785 -0.531631 --1.10659 3.41459 -0.513442 --1.20495 3.35941 -0.494154 -4.7159 6.26023 -1.17376 -3.61329 6.25516 -1.16483 -2.7994 6.25009 -1.1559 -2.20603 6.24502 -1.14698 -1.78007 6.23994 -1.13804 -1.48014 6.23487 -1.12912 -1.27404 6.2298 -1.12018 -1.13666 6.22473 -1.11126 -1.04848 6.21965 -1.10232 -0.994267 6.21458 -1.0934 -0.962173 6.20951 -1.08447 -0.942969 6.20444 -1.07554 -0.929465 6.19936 -1.06661 -0.916354 6.19429 -1.05768 -0.900493 6.18922 -1.04875 -0.879466 6.18415 -1.03982 -0.851204 6.17907 -1.03089 -0.81397 6.174 -1.02196 -0.766338 6.16893 -1.01303 -0.707183 6.16386 -1.0041 -0.635659 6.15878 -0.995169 -0.551182 6.15368 -0.98624 -0.453423 6.14746 -0.97731 -0.342315 6.13908 -0.96838 -0.21804 6.12779 -0.95945 -0.0810073 6.1128 -0.950431 --0.0681423 6.09327 -0.941099 --0.228554 6.06839 -0.931358 --0.399176 6.03741 -0.921106 --0.578775 5.99966 -0.910227 --0.765969 5.95458 -0.898599 --0.959246 5.90179 -0.886089 --1.157 5.84107 -0.872557 --1.35757 5.77242 -0.857858 --1.55929 5.69605 -0.841843 --1.76047 5.61236 -0.824364 --1.9595 5.52197 -0.805274 --2.15487 5.4257 -0.78443 --2.34515 5.32452 -0.761699 --2.52906 5.21954 -0.736957 -0.944834 0.986704 -0.00072714 -0.939663 0.987776 -0.00145506 -0.934254 0.988876 -0.0022023 -0.928515 0.990025 -0.00298287 -0.922368 0.991229 -0.00380241 -0.915749 0.992486 -0.00465888 -0.908612 0.993788 -0.00554803 -0.900922 0.995128 -0.00646435 -0.892662 0.996496 -0.00740245 -0.883827 0.997885 -0.00835796 -0.874426 0.99929 -0.00932758 -0.864479 1.0007 -0.0102875 -0.854012 1.00211 -0.0110928 -0.843057 1.00349 -0.0117515 -0.831655 1.00481 -0.0122949 -0.81985 1.00606 -0.0127451 -0.807693 1.00722 -0.013118 -0.795237 1.00825 -0.0134251 -0.782537 1.00912 -0.0136754 -0.769655 1.00982 -0.0138754 -0.756655 1.01034 -0.0140305 -0.743609 1.01065 -0.0141451 -0.730592 1.01077 -0.0142226 -0.717685 1.01071 -0.0142656 -0.70497 1.01048 -0.0142763 -0.692527 1.01011 -0.0142559 -0.680437 1.00962 -0.0142047 -4.7159 0.985649 -5.542e-06 -3.44064 0.985634 -2.3618e-05 -2.55344 0.985634 -2.1849e-05 -1.94996 0.985634 -2.1168e-05 -1.55072 0.985634 -2.0937e-05 -1.29556 0.985634 -2.0912e-05 -1.13938 0.985634 -2.1021e-05 -1.0488 0.985634 -2.1108e-05 -0.99959 0.985633 -2.0942e-05 -0.974618 0.985633 -2.0585e-05 -0.962297 0.985633 -2.0321e-05 -0.955354 0.985634 -2.0174e-05 -0.949878 0.985636 -1.9917e-05 -0.944837 0.986705 -0.000746972 -0.939666 0.987777 -0.00147485 -0.934257 0.988877 -0.00222209 -0.928517 0.990026 -0.00300268 -0.92237 0.99123 -0.00382225 -0.915752 0.992487 -0.00467876 -0.908614 0.99379 -0.00556791 -0.900925 0.995131 -0.00648417 -0.892665 0.996499 -0.00742215 -0.88383 0.997889 -0.00837745 -0.874429 0.999295 -0.00934677 -0.864481 1.00071 -0.0103063 -0.854014 1.00212 -0.0111112 -0.843059 1.0035 -0.0117695 -0.831656 1.00482 -0.0123123 -0.819851 1.00607 -0.012762 -0.807694 1.00723 -0.0131343 -0.795238 1.00826 -0.013441 -0.782538 1.00913 -0.0136908 -0.769655 1.00984 -0.0138904 -0.756655 1.01035 -0.0140453 -0.743609 1.01067 -0.0141596 -0.730592 1.01079 -0.0142368 -0.717685 1.01072 -0.0142798 -0.704969 1.0105 -0.0142905 -0.692527 1.01012 -0.0142701 -0.680436 1.00963 -0.0142189 -4.7159 0.985677 -1.3937e-05 -3.44065 0.985637 -6.3009e-05 -2.55344 0.985636 -5.8606e-05 -1.94997 0.985635 -5.6879e-05 -1.55072 0.985635 -5.6291e-05 -1.29556 0.985635 -5.6246e-05 -1.13938 0.985635 -5.6583e-05 -1.0488 0.985635 -5.6903e-05 -0.999593 0.985635 -5.6576e-05 -0.97462 0.985635 -5.5735e-05 -0.962299 0.985635 -5.5137e-05 -0.955354 0.985636 -5.4885e-05 -0.949881 0.985642 -5.488e-05 -0.944842 0.986707 -0.000781065 -0.939671 0.987779 -0.00150869 -0.934262 0.98888 -0.0022558 -0.928522 0.990028 -0.00303631 -0.922375 0.991233 -0.00385582 -0.915756 0.99249 -0.00471227 -0.908619 0.993794 -0.00560128 -0.900929 0.995135 -0.00651725 -0.892669 0.996505 -0.00745477 -0.883834 0.997896 -0.00840948 -0.874432 0.999303 -0.00937805 -0.864485 1.00072 -0.0103367 -0.854017 1.00213 -0.0111407 -0.843061 1.00351 -0.0117981 -0.831658 1.00484 -0.0123402 -0.819853 1.00609 -0.012789 -0.807696 1.00724 -0.0131604 -0.795239 1.00828 -0.0134663 -0.782539 1.00915 -0.0137153 -0.769656 1.00986 -0.0139144 -0.756656 1.01037 -0.0140687 -0.743609 1.01069 -0.0141826 -0.730591 1.01081 -0.0142596 -0.717684 1.01075 -0.0143024 -0.704968 1.01052 -0.0143129 -0.692525 1.01015 -0.0142926 -0.680434 1.00965 -0.0142415 -4.7159 0.985724 -2.6202e-05 -3.44066 0.985642 -0.000128882 -2.55346 0.98564 -0.000120588 -1.94998 0.985638 -0.000117258 -1.55073 0.985638 -0.000116125 -1.29557 0.985638 -0.000116083 -1.13939 0.985639 -0.000116855 -1.04881 0.985639 -0.000117639 -0.999597 0.985638 -0.000117148 -0.974624 0.985638 -0.000115654 -0.962301 0.985639 -0.000114685 -0.955354 0.985641 -0.000114508 -0.949886 0.985652 -0.000116064 -0.944851 0.986711 -0.000839577 -0.93968 0.987783 -0.00156648 -0.93427 0.988883 -0.00231315 -0.92853 0.990032 -0.00309333 -0.922383 0.991237 -0.00391255 -0.915764 0.992495 -0.0047687 -0.908626 0.9938 -0.00565724 -0.900936 0.995142 -0.00657239 -0.892675 0.996514 -0.00750881 -0.88384 0.997907 -0.00846212 -0.874438 0.999317 -0.00942907 -0.86449 1.00074 -0.0103859 -0.854022 1.00215 -0.0111882 -0.843065 1.00353 -0.0118441 -0.831662 1.00486 -0.0123847 -0.819856 1.00612 -0.012832 -0.807699 1.00727 -0.0132021 -0.795242 1.00831 -0.0135067 -0.782541 1.00918 -0.0137546 -0.769657 1.00989 -0.0139526 -0.756656 1.0104 -0.0141062 -0.743609 1.01072 -0.0142194 -0.730591 1.01084 -0.0142959 -0.717683 1.01078 -0.0143384 -0.704967 1.01055 -0.0143488 -0.692523 1.01018 -0.0143284 -0.680432 1.00968 -0.0142774 -4.7159 0.985803 -4.401e-05 -3.44068 0.985651 -0.000238885 -2.55348 0.985646 -0.000224931 -1.95 0.985644 -0.000219169 -1.55075 0.985644 -0.00021721 -1.29558 0.985644 -0.000217234 -1.1394 0.985645 -0.0002188 -1.04882 0.985645 -0.000220419 -0.999605 0.985644 -0.000219754 -0.97463 0.985644 -0.000217402 -0.962304 0.985645 -0.000216136 -0.955354 0.985649 -0.000216521 -0.949894 0.985671 -0.000222468 -0.944865 0.986718 -0.00093961 -0.939694 0.987789 -0.00166478 -0.934284 0.98889 -0.00241033 -0.928544 0.990039 -0.00318962 -0.922396 0.991245 -0.00400803 -0.915776 0.992504 -0.00486338 -0.908637 0.99381 -0.00575074 -0.900947 0.995155 -0.00666403 -0.892686 0.99653 -0.00759802 -0.88385 0.997927 -0.00854846 -0.874448 0.999339 -0.00951213 -0.864499 1.00076 -0.0104653 -0.854029 1.00218 -0.0112646 -0.843072 1.00357 -0.0119178 -0.831668 1.0049 -0.0124558 -0.819861 1.00616 -0.0129008 -0.807703 1.00732 -0.0132687 -0.795245 1.00835 -0.0135713 -0.782544 1.00924 -0.0138174 -0.769659 1.00994 -0.0140138 -0.756657 1.01046 -0.014166 -0.743609 1.01077 -0.0142782 -0.73059 1.0109 -0.0143539 -0.717681 1.01083 -0.0143958 -0.704964 1.01061 -0.014406 -0.69252 1.01023 -0.0143855 -0.680428 1.00974 -0.0143346 -4.7159 0.985934 -7.0116e-05 -3.44071 0.985666 -0.00042168 -2.55353 0.985658 -0.000399689 -1.95004 0.985654 -0.000390295 -1.55078 0.985654 -0.000387107 -1.29561 0.985655 -0.000387341 -1.13942 0.985656 -0.000390311 -1.04883 0.985656 -0.000393353 -0.999617 0.985655 -0.000392514 -0.974641 0.985655 -0.000389122 -0.962312 0.985657 -0.000387923 -0.955356 0.985664 -0.000389991 -0.949909 0.985703 -0.000405697 -0.94489 0.98673 -0.0011096 -0.939719 0.9878 -0.00183096 -0.934308 0.988902 -0.00257402 -0.928567 0.990052 -0.00335124 -0.922418 0.991259 -0.00416777 -0.915797 0.99252 -0.00502124 -0.908657 0.993828 -0.00590602 -0.900965 0.995177 -0.00681547 -0.892703 0.996557 -0.00774459 -0.883866 0.997959 -0.0086894 -0.874463 0.999377 -0.00964683 -0.864513 1.00081 -0.0105931 -0.854041 1.00223 -0.011387 -0.843082 1.00362 -0.0120355 -0.831677 1.00496 -0.0125693 -0.81987 1.00622 -0.0130104 -0.80771 1.00739 -0.0133748 -0.795251 1.00843 -0.0136741 -0.782548 1.00931 -0.0139173 -0.769662 1.01002 -0.0141112 -0.756659 1.01054 -0.0142613 -0.743609 1.01086 -0.0143719 -0.730589 1.01098 -0.0144463 -0.717678 1.01092 -0.0144873 -0.70496 1.01069 -0.0144969 -0.692515 1.01032 -0.0144761 -0.680421 1.00982 -0.0144252 -4.7159 0.986154 -0.000109047 -3.44076 0.985696 -0.000723072 -2.5536 0.985682 -0.000690064 -1.9501 0.985676 -0.000675355 -1.55083 0.985675 -0.00067038 -1.29564 0.985676 -0.000671114 -1.13944 0.985678 -0.0006765 -1.04886 0.985679 -0.00068189 -0.999641 0.985677 -0.000680942 -0.974662 0.985677 -0.000676532 -0.962327 0.985681 -0.000676412 -0.955362 0.985693 -0.000682517 -0.949937 0.985759 -0.000716835 -0.944931 0.986756 -0.00139609 -0.93976 0.987824 -0.00210964 -0.934348 0.988926 -0.00284747 -0.928605 0.990078 -0.00362032 -0.922454 0.991287 -0.00443284 -0.915832 0.99255 -0.00528231 -0.90869 0.993863 -0.00616184 -0.900996 0.995217 -0.00706378 -0.892732 0.996604 -0.00798367 -0.883893 0.998015 -0.00891799 -0.874489 0.999442 -0.00986403 -0.864536 1.00088 -0.0107981 -0.85406 1.00231 -0.0115824 -0.843099 1.00371 -0.0122228 -0.831691 1.00506 -0.0127495 -0.819882 1.00633 -0.0131843 -0.807721 1.0075 -0.0135429 -0.795261 1.00855 -0.0138372 -0.782556 1.00944 -0.0140758 -0.769667 1.01016 -0.0142658 -0.756661 1.01068 -0.0144125 -0.743609 1.011 -0.0145203 -0.730586 1.01113 -0.0145926 -0.717673 1.01106 -0.0146321 -0.704953 1.01084 -0.0146407 -0.692505 1.01046 -0.0146194 -0.68041 1.00996 -0.0145683 -4.7159 0.986521 -0.000168256 -3.44085 0.985756 -0.00121484 -2.55371 0.985731 -0.00116749 -1.9502 0.98572 -0.00114522 -1.55091 0.985719 -0.00113772 -1.29571 0.985722 -0.0011395 -1.1395 0.985725 -0.00114892 -1.0489 0.985726 -0.00115809 -0.999684 0.985724 -0.00115734 -0.974704 0.985724 -0.00115255 -0.962361 0.985732 -0.00115584 -0.955381 0.985753 -0.00117053 -0.949986 0.985857 -0.00123552 -0.945002 0.986811 -0.00187383 -0.93983 0.987874 -0.00257215 -0.934415 0.988977 -0.00329961 -0.928669 0.990131 -0.0040637 -0.922515 0.991343 -0.00486809 -0.915889 0.99261 -0.00570952 -0.908743 0.993929 -0.00657892 -0.901046 0.995293 -0.007467 -0.892779 0.99669 -0.00837016 -0.883938 0.998113 -0.00928584 -0.87453 0.999552 -0.0102119 -0.864572 1.001 -0.0111249 -0.854092 1.00245 -0.0118927 -0.843126 1.00386 -0.0125196 -0.831715 1.00522 -0.0130346 -0.819903 1.00651 -0.013459 -0.80774 1.00769 -0.0138085 -0.795275 1.00875 -0.0140946 -0.782567 1.00965 -0.014326 -0.769675 1.01037 -0.0145096 -0.756665 1.0109 -0.014651 -0.743608 1.01123 -0.0147544 -0.730581 1.01135 -0.0148233 -0.717665 1.01129 -0.0148602 -0.704941 1.01106 -0.0148671 -0.69249 1.01068 -0.0148447 -0.680392 1.01018 -0.014793 -4.7159 0.987135 -0.000260003 -3.44099 0.98588 -0.00200676 -2.5539 0.985837 -0.00194223 -1.95037 0.985818 -0.00190964 -1.55105 0.985816 -0.0018987 -1.29582 0.985821 -0.00190245 -1.13959 0.985828 -0.00191838 -1.04899 0.98583 -0.00193349 -0.999767 0.985827 -0.00193391 -0.974788 0.985827 -0.00193087 -0.962434 0.985842 -0.00194228 -0.955434 0.98588 -0.00197351 -0.950077 0.986033 -0.00208103 -0.94512 0.986929 -0.0026597 -0.939947 0.987982 -0.00332989 -0.934527 0.989086 -0.00403766 -0.928776 0.990243 -0.00478494 -0.922616 0.99146 -0.0055737 -0.915983 0.992732 -0.00639962 -0.908831 0.99406 -0.00725034 -0.901127 0.995437 -0.00811402 -0.892855 0.99685 -0.00898835 -0.884008 0.99829 -0.00987229 -0.874596 0.999748 -0.0107647 -0.864631 1.00122 -0.0116426 -0.854142 1.00268 -0.0123831 -0.84317 1.00411 -0.0129876 -0.831753 1.00549 -0.0134835 -0.819937 1.00679 -0.0138912 -0.807768 1.008 -0.0142259 -0.795299 1.00907 -0.0144989 -0.782584 1.00998 -0.0147188 -0.769686 1.01072 -0.0148923 -0.756669 1.01125 -0.0150251 -0.743606 1.01158 -0.0151215 -0.730572 1.01171 -0.0151848 -0.71765 1.01165 -0.0152175 -0.70492 1.01142 -0.0152213 -0.692464 1.01103 -0.0151969 -0.68036 1.01052 -0.0151439 -4.7159 0.988158 -0.000404463 -3.44122 0.986144 -0.00326127 -2.55421 0.986072 -0.00317927 -1.95065 0.986039 -0.00313341 -1.55128 0.986035 -0.00311803 -1.29601 0.986044 -0.00312522 -1.13976 0.986057 -0.00315119 -1.04915 0.986062 -0.00317546 -0.999933 0.986059 -0.00317951 -0.974962 0.986061 -0.00318328 -0.962595 0.986089 -0.00321121 -0.955566 0.986155 -0.0032706 -0.95025 0.986362 -0.00342546 -0.945319 0.987192 -0.00392919 -0.940143 0.988225 -0.00455113 -0.934714 0.989326 -0.00522335 -0.928952 0.990487 -0.00593987 -0.922782 0.991708 -0.00669982 -0.916138 0.992988 -0.00749706 -0.908974 0.994328 -0.00831483 -0.90126 0.995722 -0.00913776 -0.892977 0.997157 -0.00996495 -0.884123 0.99862 -0.0107975 -0.874702 1.0001 -0.0116358 -0.864725 1.0016 -0.0124578 -0.854222 1.00308 -0.0131543 -0.84324 1.00454 -0.0137228 -0.831814 1.00594 -0.0141878 -0.81999 1.00727 -0.0145686 -0.807813 1.0085 -0.0148795 -0.795334 1.00959 -0.0151315 -0.78261 1.01053 -0.0153329 -0.7697 1.01127 -0.0154903 -0.756672 1.01182 -0.0156094 -0.743598 1.01216 -0.0156944 -0.730554 1.01229 -0.0157486 -0.717621 1.01223 -0.0157743 -0.704881 1.01199 -0.0157728 -0.692417 1.0116 -0.0157446 -0.680304 1.01108 -0.0156891 -4.7159 0.989862 -0.000634836 -3.44158 0.986715 -0.00520755 -2.55471 0.986594 -0.00511469 -1.95112 0.986539 -0.00505349 -1.55168 0.986531 -0.00503278 -1.29635 0.986548 -0.00504537 -1.14007 0.986572 -0.00508593 -1.04946 0.986584 -0.00512398 -1.00027 0.986582 -0.00513718 -0.975323 0.986592 -0.00515762 -0.962941 0.986645 -0.00521452 -0.955872 0.986755 -0.0053138 -0.950578 0.987011 -0.00550796 -0.945662 0.987775 -0.00592991 -0.940476 0.988772 -0.00647763 -0.935027 0.989862 -0.00709002 -0.929246 0.991021 -0.0077534 -0.923056 0.992246 -0.00846295 -0.916392 0.993533 -0.00920984 -0.909208 0.994885 -0.00997239 -0.901475 0.9963 -0.010731 -0.893176 0.997759 -0.0114856 -0.884306 0.999249 -0.0122398 -0.87487 1.00076 -0.0129957 -0.864874 1.00228 -0.0137331 -0.854352 1.0038 -0.0143614 -0.843353 1.00529 -0.0148733 -0.831913 1.00672 -0.0152896 -0.820074 1.00808 -0.0156274 -0.807882 1.00934 -0.0159002 -0.795388 1.01047 -0.0161183 -0.782646 1.01142 -0.0162899 -0.769718 1.01219 -0.0164215 -0.756671 1.01275 -0.0165185 -0.743577 1.01309 -0.0165852 -0.730515 1.01323 -0.0166246 -0.717565 1.01316 -0.0166386 -0.70481 1.01292 -0.0166281 -0.69233 1.01252 -0.0165931 -0.680203 1.01198 -0.0165325 -4.7159 0.992702 -0.00100576 -3.44214 0.987944 -0.00814617 -2.55552 0.987746 -0.00806443 -1.9519 0.987653 -0.00798901 -1.55236 0.987639 -0.00796254 -1.29696 0.98767 -0.00798246 -1.14065 0.987716 -0.0080424 -1.05006 0.987742 -0.00810047 -1.00094 0.987747 -0.00813339 -0.976052 0.987778 -0.00818602 -0.96365 0.987877 -0.00828473 -0.95652 0.988046 -0.00842664 -0.951202 0.98834 -0.00864127 -0.946261 0.989044 -0.00898152 -0.941043 0.989983 -0.00943063 -0.935556 0.991043 -0.00995252 -0.929736 0.992186 -0.0105315 -0.923509 0.993404 -0.0111593 -0.916809 0.994691 -0.0118237 -0.90959 0.99605 -0.0124995 -0.901824 0.997479 -0.0131632 -0.893496 0.99896 -0.0138135 -0.884599 1.00048 -0.014456 -0.875139 1.00201 -0.0150944 -0.865114 1.00356 -0.0157118 -0.854561 1.00511 -0.0162391 -0.843534 1.00663 -0.0166656 -0.832068 1.0081 -0.0170068 -0.820204 1.0095 -0.0172776 -0.807986 1.01079 -0.0174901 -0.795463 1.01195 -0.017654 -0.78269 1.01294 -0.0177779 -0.76973 1.01372 -0.0178681 -0.756651 1.0143 -0.0179298 -0.743525 1.01465 -0.0179669 -0.730432 1.01478 -0.017982 -0.717452 1.01471 -0.0179765 -0.704669 1.01445 -0.0179506 -0.692163 1.01403 -0.0179034 -0.680011 1.01347 -0.0178332 -4.7159 0.997433 -0.00160718 -3.44302 0.990526 -0.0124284 -2.55681 0.990213 -0.0124101 -1.95317 0.990062 -0.0123289 -1.55353 0.990039 -0.0122971 -1.29804 0.990094 -0.0123247 -1.14173 0.990178 -0.0124069 -1.05123 0.990234 -0.0124927 -1.00224 0.990263 -0.0125621 -0.97746 0.990344 -0.0126644 -0.965016 0.990514 -0.0128086 -0.957771 0.990747 -0.0129799 -0.952351 0.991068 -0.013193 -0.947314 0.991716 -0.0134533 -0.942015 0.992578 -0.0137904 -0.93645 0.993574 -0.0141944 -0.930556 0.994671 -0.0146553 -0.924259 0.995855 -0.0151641 -0.917494 0.997117 -0.0157071 -0.910213 0.998461 -0.0162583 -0.90239 0.999885 -0.0167921 -0.89401 1.00137 -0.0173043 -0.885068 1.00289 -0.0178 -0.875562 1.00444 -0.0182837 -0.86549 1.00601 -0.0187431 -0.854889 1.00758 -0.0191305 -0.843815 1.00912 -0.0194342 -0.832304 1.01062 -0.0196647 -0.820395 1.01205 -0.0198344 -0.808129 1.01337 -0.0199543 -0.795555 1.01456 -0.0200341 -0.782727 1.01556 -0.0200833 -0.769711 1.01636 -0.0201083 -0.756575 1.01694 -0.0201139 -0.743393 1.01729 -0.0201037 -0.730244 1.01741 -0.0200793 -0.717213 1.01732 -0.0200414 -0.704379 1.01704 -0.019989 -0.691826 1.01658 -0.0199201 -0.679627 1.01598 -0.0198318 -4.7159 1.00531 -0.00258711 -3.44435 0.995761 -0.0183954 -2.55881 0.995287 -0.0185475 -1.95523 0.995051 -0.0184816 -1.55549 0.995016 -0.018446 -1.29994 0.995112 -0.0184772 -1.14368 0.995259 -0.0185799 -1.05337 0.995369 -0.0187021 -1.00466 0.99546 -0.0188282 -0.980008 0.995635 -0.0189892 -0.967457 0.995895 -0.019166 -0.96 0.996185 -0.019343 -0.954367 0.996524 -0.0195351 -0.94913 0.997115 -0.0197183 -0.94366 0.997882 -0.0199445 -0.937943 0.998778 -0.0202197 -0.93191 0.999782 -0.0205412 -0.925486 1.00088 -0.0209024 -0.918605 1.00207 -0.0212911 -0.911217 1.00335 -0.0216842 -0.903295 1.00472 -0.0220574 -0.894825 1.00617 -0.0224029 -0.885799 1.00766 -0.0227232 -0.876214 1.00918 -0.0230217 -0.866062 1.01073 -0.0232909 -0.855378 1.01228 -0.0234998 -0.844222 1.01382 -0.0236395 -0.832631 1.01532 -0.0237174 -0.820638 1.01675 -0.023744 -0.808284 1.01807 -0.0237301 -0.795617 1.01925 -0.0236862 -0.782693 1.02025 -0.0236239 -0.769576 1.02103 -0.0235505 -0.756339 1.0216 -0.0234703 -0.743057 1.02192 -0.0233862 -0.729811 1.02201 -0.0232991 -0.716684 1.02187 -0.0232079 -0.703758 1.02153 -0.0231103 -0.691114 1.02101 -0.0230026 -0.678826 1.02032 -0.0228802 -4.7159 1.01843 -0.00418927 -3.44631 1.00591 -0.0262871 -2.56187 1.00523 -0.0268104 -1.95848 1.00488 -0.0267979 -1.55871 1.00483 -0.0267608 -1.30317 1.00499 -0.0267855 -1.14709 1.00522 -0.0269019 -1.05716 1.00543 -0.0270705 -1.00885 1.00564 -0.0272687 -0.984305 1.00595 -0.0274807 -0.971506 1.0063 -0.0276674 -0.963686 1.00664 -0.0278298 -0.957695 1.00698 -0.0279885 -0.952118 1.00751 -0.0281019 -0.946347 1.00818 -0.0282309 -0.940359 1.00894 -0.028388 -0.934082 1.00981 -0.0285739 -0.927436 1.01077 -0.0287846 -0.920353 1.01182 -0.0290108 -0.91278 1.01296 -0.029234 -0.904686 1.01421 -0.0294332 -0.896056 1.01553 -0.0295995 -0.886879 1.01692 -0.029732 -0.877149 1.01834 -0.0298322 -0.866853 1.0198 -0.0298949 -0.856024 1.02127 -0.0298994 -0.844721 1.02273 -0.0298417 -0.832979 1.02415 -0.0297289 -0.820831 1.02551 -0.0295717 -0.808316 1.02676 -0.0293818 -0.79548 1.02787 -0.0291721 -0.782381 1.0288 -0.0289569 -0.769085 1.02951 -0.0287452 -0.755667 1.02999 -0.0285417 -0.742203 1.03023 -0.0283485 -0.728776 1.03023 -0.0281652 -0.715469 1.02999 -0.0279894 -0.702366 1.02953 -0.0278164 -0.689544 1.02888 -0.0276406 -0.677075 1.02806 -0.0274548 -4.7159 1.04027 -0.00681485 -3.44912 1.02473 -0.0361866 -2.56646 1.02379 -0.0374362 -1.96353 1.0233 -0.037533 -1.56387 1.02323 -0.0374981 -1.30849 1.02345 -0.0375042 -1.15282 1.02381 -0.0376306 -1.06352 1.02415 -0.037859 -1.0157 1.02454 -0.0381317 -0.99108 1.025 -0.0383747 -0.97779 1.02543 -0.0385548 -0.969389 1.0258 -0.0386946 -0.962842 1.02614 -0.0388182 -0.95674 1.02661 -0.0388759 -0.950486 1.02717 -0.0389299 -0.944056 1.0278 -0.0389942 -0.937371 1.0285 -0.0390699 -0.930351 1.02928 -0.039154 -0.922924 1.03013 -0.0392389 -0.915033 1.03107 -0.0393093 -0.90664 1.0321 -0.0393479 -0.897725 1.03321 -0.0393459 -0.888274 1.03439 -0.039301 -0.878277 1.03561 -0.0392125 -0.867716 1.03686 -0.0390751 -0.856619 1.03814 -0.0388734 -0.845043 1.0394 -0.0386071 -0.833021 1.04064 -0.0382853 -0.820583 1.0418 -0.0379204 -0.807768 1.04286 -0.0375264 -0.794621 1.04378 -0.0371194 -0.781201 1.04451 -0.0367166 -0.767575 1.04503 -0.0363293 -0.75382 1.04532 -0.0359631 -0.740014 1.04536 -0.0356198 -0.72624 1.04514 -0.035298 -0.712583 1.04468 -0.0349933 -0.699121 1.04399 -0.034699 -0.685929 1.04309 -0.0344064 -0.673074 1.042 -0.0341053 -4.7159 1.07662 -0.0111244 -3.45315 1.05826 -0.048089 -2.57331 1.05697 -0.0506607 -1.9713 1.05632 -0.0509419 -1.57203 1.05622 -0.0509188 -1.31709 1.0565 -0.0509053 -1.16216 1.05696 -0.0510552 -1.07374 1.05748 -0.0513573 -1.02626 1.05807 -0.0516875 -1.00116 1.05865 -0.0519399 -0.986987 1.05913 -0.0521068 -0.977677 1.05951 -0.0522253 -0.970287 1.05986 -0.0523195 -0.963391 1.06027 -0.0523373 -0.956391 1.06073 -0.0523385 -0.949261 1.06123 -0.0523366 -0.941919 1.06177 -0.0523322 -0.934281 1.06235 -0.0523218 -0.926272 1.06298 -0.0522983 -0.917829 1.06367 -0.0522481 -0.908907 1.06442 -0.0521558 -0.899481 1.06523 -0.0520136 -0.889529 1.06609 -0.051818 -0.879034 1.06699 -0.0515669 -0.867974 1.06792 -0.0512541 -0.85637 1.06886 -0.0508666 -0.844273 1.06978 -0.050406 -0.831716 1.07066 -0.0498828 -0.818725 1.07147 -0.0493111 -0.805336 1.07217 -0.0487075 -0.791594 1.07271 -0.0480904 -0.777558 1.07307 -0.0474792 -0.763296 1.07321 -0.0468872 -0.74888 1.0731 -0.0463209 -0.734393 1.07273 -0.045782 -0.719914 1.0721 -0.0452678 -0.705523 1.0712 -0.044772 -0.691296 1.07005 -0.0442849 -0.6773 1.06866 -0.0437942 -0.663593 1.06705 -0.0432849 -4.7159 1.13716 -0.0182057 -3.45897 1.11628 -0.0621191 -2.58367 1.11448 -0.0669424 -1.98338 1.11366 -0.0675169 -1.58499 1.11348 -0.0675327 -1.33093 1.11376 -0.0675243 -1.17715 1.11427 -0.0677255 -1.08955 1.11491 -0.0680886 -1.04176 1.11561 -0.0684296 -1.01538 1.11624 -0.0686612 -0.999685 1.11672 -0.0688028 -0.988946 1.11709 -0.0688952 -0.980253 1.11741 -0.0689597 -0.972134 1.11775 -0.0689417 -0.96397 1.11811 -0.0688984 -0.955731 1.11847 -0.0688428 -0.947327 1.11884 -0.0687745 -0.938667 1.11922 -0.0686896 -0.92967 1.11961 -0.0685803 -0.920265 1.12002 -0.0684336 -0.9104 1.12046 -0.068235 -0.900037 1.12092 -0.0679764 -0.889149 1.1214 -0.0676537 -0.877708 1.12189 -0.0672633 -0.865684 1.12237 -0.066798 -0.85309 1.12283 -0.066246 -0.839971 1.12325 -0.0656089 -0.826352 1.12361 -0.0648972 -0.812258 1.12386 -0.0641251 -0.797718 1.12397 -0.0633097 -0.782775 1.12391 -0.0624702 -0.767484 1.12363 -0.0616265 -0.75191 1.12309 -0.0607919 -0.736124 1.12228 -0.0599728 -0.720203 1.12117 -0.0591696 -0.704225 1.11976 -0.0583776 -0.688265 1.11803 -0.0575873 -0.672393 1.11599 -0.0567849 -0.656676 1.11365 -0.0559528 -0.641171 1.11101 -0.0550699 -4.7159 1.23793 -0.0298499 -3.46767 1.21493 -0.078861 -2.59983 1.21228 -0.0872161 -2.00266 1.21123 -0.088274 -1.60601 1.21087 -0.0883901 -1.35345 1.21099 -0.0884297 -1.20085 1.21136 -0.0886719 -1.11308 1.2119 -0.0890088 -1.06341 1.21247 -0.0892714 -1.03441 1.21296 -0.0894262 -1.01614 1.21332 -0.0895064 -1.0031 1.21359 -0.0895472 -0.992338 1.2138 -0.0895612 -0.982281 1.21402 -0.0894874 -0.972261 1.21421 -0.0893823 -0.962233 1.21438 -0.0892589 -0.952091 1.21453 -0.0891162 -0.941728 1.21466 -0.0889491 -0.931047 1.21476 -0.0887492 -0.919962 1.21484 -0.0885027 -0.908406 1.21491 -0.0881946 -0.896327 1.21496 -0.0878161 -0.883683 1.21497 -0.0873615 -0.870433 1.21494 -0.0868258 -0.856534 1.21486 -0.0862 -0.841986 1.2147 -0.0854713 -0.826827 1.21444 -0.0846404 -0.811072 1.21405 -0.0837156 -0.79474 1.21348 -0.0827095 -0.777855 1.21271 -0.0816376 -0.760455 1.21169 -0.0805179 -0.742594 1.21036 -0.0793687 -0.724336 1.2087 -0.0782015 -0.705757 1.20666 -0.077021 -0.68694 1.20422 -0.075825 -0.667971 1.20136 -0.0746058 -0.648942 1.19808 -0.0733507 -0.629942 1.19438 -0.0720423 -0.611061 1.19026 -0.0706596 -0.592387 1.18574 -0.0691788 -4.7159 1.40568 -0.0490069 -3.48126 1.38118 -0.0998914 -2.6259 1.37697 -0.113133 -2.0345 1.3755 -0.115036 -1.64097 1.37471 -0.115362 -1.3902 1.37431 -0.115455 -1.23741 1.37414 -0.115618 -1.14678 1.37413 -0.11577 -1.09259 1.37418 -0.11584 -1.05886 1.37424 -0.11584 -1.03633 1.37427 -0.115802 -1.01959 1.37426 -0.115743 -1.00551 1.37421 -0.115665 -0.992341 1.37415 -0.115492 -0.979337 1.37404 -0.115283 -0.966417 1.37389 -0.115052 -0.953438 1.37368 -0.114797 -0.940256 1.37341 -0.114511 -0.926741 1.37309 -0.114185 -0.912777 1.3727 -0.113803 -0.898266 1.37225 -0.113346 -0.88313 1.37172 -0.112806 -0.867304 1.3711 -0.112174 -0.850725 1.37035 -0.111442 -0.83333 1.36947 -0.110599 -0.815106 1.36841 -0.109629 -0.79608 1.36714 -0.108529 -0.776265 1.36562 -0.107305 -0.755674 1.3638 -0.105967 -0.734337 1.36162 -0.104527 -0.712301 1.35902 -0.103002 -0.689635 1.35594 -0.101408 -0.666427 1.35233 -0.0997548 -0.642782 1.34816 -0.0980456 -0.618818 1.34339 -0.0962771 -0.594665 1.33801 -0.0944402 -0.570461 1.33201 -0.0925219 -0.546345 1.32542 -0.090505 -0.522458 1.31826 -0.0883701 -0.498941 1.31058 -0.0860959 -4.7159 1.68496 -0.0805353 -3.50351 1.66013 -0.128823 -2.66928 1.65317 -0.147443 -2.0884 1.65078 -0.150785 -1.69973 1.64903 -0.151476 -1.4494 1.64752 -0.151545 -1.29252 1.64622 -0.151459 -1.19457 1.64514 -0.151299 -1.1321 1.64428 -0.151096 -1.09062 1.6436 -0.150881 -1.06132 1.64302 -0.15067 -1.03869 1.64248 -0.150463 -1.01931 1.64194 -0.150246 -1.00122 1.64138 -0.149925 -0.983489 1.64076 -0.149565 -0.96598 1.64007 -0.149181 -0.948469 1.63929 -0.148768 -0.930742 1.63841 -0.14832 -0.912602 1.63743 -0.147821 -0.893875 1.63633 -0.147253 -0.87441 1.6351 -0.146595 -0.854086 1.6337 -0.145835 -0.832796 1.63211 -0.144959 -0.810446 1.63027 -0.143959 -0.786948 1.62815 -0.142818 -0.762277 1.62568 -0.141515 -0.736457 1.62281 -0.140042 -0.709507 1.61947 -0.138402 -0.681457 1.61557 -0.1366 -0.652361 1.61105 -0.134648 -0.622301 1.60581 -0.132558 -0.591391 1.59978 -0.130348 -0.559777 1.59289 -0.128025 -0.527625 1.5851 -0.125592 -0.495126 1.57639 -0.123046 -0.462482 1.56675 -0.120379 -0.429905 1.55621 -0.11758 -0.397606 1.54482 -0.114633 -0.365794 1.53265 -0.111523 -0.334669 1.5198 -0.108232 -4.7159 2.14988 -0.132438 -3.54111 2.12682 -0.173119 -2.74228 2.1158 -0.195095 -2.17963 2.11141 -0.200325 -1.79697 2.10788 -0.201547 -1.54295 2.10465 -0.201565 -1.37566 2.10176 -0.201201 -1.2644 2.0993 -0.200732 -1.18859 2.09724 -0.200257 -1.13499 2.09553 -0.199814 -1.0951 2.09407 -0.199405 -1.06318 2.09273 -0.199019 -1.03543 2.09143 -0.198632 -1.00955 2.09013 -0.198132 -0.984399 2.08874 -0.197591 -0.959671 2.08726 -0.197024 -0.934996 2.08565 -0.196425 -0.910024 2.08389 -0.195781 -0.884439 2.08196 -0.195077 -0.85796 2.07983 -0.194286 -0.830349 2.07744 -0.193383 -0.801407 2.07475 -0.192351 -0.770967 2.07169 -0.191173 -0.738891 2.06817 -0.189835 -0.705059 2.0641 -0.188314 -0.669437 2.05939 -0.186581 -0.632061 2.05393 -0.184623 -0.592974 2.04759 -0.182435 -0.552249 2.04028 -0.180018 -0.509997 2.03185 -0.177378 -0.466371 2.02218 -0.174526 -0.421572 2.01119 -0.171475 -0.375841 1.99878 -0.168234 -0.329454 1.98492 -0.164802 -0.282712 1.96958 -0.161178 -0.235931 1.95282 -0.157354 -0.189436 1.93468 -0.153322 -0.143544 1.91528 -0.149071 -0.0985637 1.89477 -0.144589 -0.0547827 1.87332 -0.139866 -4.7159 2.92384 -0.217898 -3.603 2.90505 -0.246457 -2.86064 2.89039 -0.266411 -2.3261 2.88281 -0.272419 -1.9499 2.87685 -0.273981 -1.68673 2.87161 -0.273949 -1.50171 2.86701 -0.273371 -1.36979 2.86303 -0.272644 -1.27364 2.85961 -0.271917 -1.20144 2.85666 -0.271235 -1.14496 2.85405 -0.270603 -1.09824 2.85164 -0.270006 -1.05711 2.84931 -0.269413 -1.01883 2.84699 -0.268706 -0.981908 2.84457 -0.267958 -0.945721 2.84203 -0.267183 -0.909617 2.83931 -0.26637 -0.873001 2.83637 -0.265501 -0.835346 2.83314 -0.264554 -0.796191 2.82957 -0.263497 -0.755148 2.82556 -0.2623 -0.711896 2.82099 -0.260935 -0.666173 2.81575 -0.259383 -0.617778 2.80967 -0.257619 -0.566557 2.80259 -0.255613 -0.512473 2.79433 -0.253326 -0.455588 2.7847 -0.250733 -0.396 2.77351 -0.24782 -0.33386 2.76056 -0.244578 -0.269386 2.74567 -0.241004 -0.202859 2.72865 -0.237102 -0.134622 2.70938 -0.232878 -0.0650782 2.68775 -0.228336 --0.00532365 2.66371 -0.223472 --0.0761027 2.63729 -0.218284 --0.14676 2.60856 -0.212765 --0.216791 2.57766 -0.206911 --0.285704 2.54481 -0.200716 --0.353028 2.51025 -0.194174 --0.41833 2.4743 -0.187286 -4.7159 4.21227 -0.358636 -3.68345 4.1995 -0.371894 -3.00874 4.18545 -0.383094 -2.50924 4.17612 -0.386091 -2.14407 4.16857 -0.3861 -1.8738 4.16203 -0.384966 -1.67029 4.15625 -0.383464 -1.51426 4.15111 -0.381923 -1.39226 4.14653 -0.380467 -1.29462 4.14241 -0.37913 -1.21416 4.13862 -0.377903 -1.14526 4.13506 -0.376758 -1.08368 4.13159 -0.375654 -1.02638 4.12814 -0.37448 -0.971415 4.12458 -0.373284 -0.917568 4.12087 -0.372065 -0.863736 4.11691 -0.370804 -0.808938 4.11262 -0.369472 -0.752319 4.1079 -0.368041 -0.693143 4.1026 -0.366474 -0.630791 4.09658 -0.364734 -0.564749 4.08963 -0.362788 -0.494605 4.08152 -0.360608 -0.420044 4.07197 -0.35816 -0.340842 4.06069 -0.355409 -0.256914 4.04737 -0.352307 -0.168311 4.03167 -0.348821 -0.0751648 4.01325 -0.344924 --0.0222888 3.99176 -0.340591 --0.123702 3.96689 -0.335804 --0.228615 3.93834 -0.330548 --0.336456 3.90587 -0.324813 --0.446553 3.86932 -0.318584 --0.558152 3.82863 -0.311843 --0.670439 3.78383 -0.304575 --0.782563 3.73507 -0.296764 --0.89367 3.6826 -0.288399 --1.00292 3.62682 -0.279472 --1.10952 3.56817 -0.269982 --1.21273 3.50722 -0.259935 -4.7159 6.35716 -0.590435 -3.61571 6.35412 -0.585907 -2.80365 6.35107 -0.581379 -2.21166 6.34803 -0.57685 -1.78672 6.34498 -0.572322 -1.48757 6.34194 -0.567794 -1.28204 6.33889 -0.563265 -1.1451 6.33585 -0.558737 -1.05725 6.33281 -0.554209 -1.0033 6.32976 -0.549681 -0.971422 6.32672 -0.545152 -0.952408 6.32367 -0.540624 -0.939084 6.32063 -0.536096 -0.926132 6.31758 -0.531567 -0.910331 6.31454 -0.527039 -0.889181 6.31149 -0.522511 -0.860549 6.30845 -0.517982 -0.822651 6.30541 -0.513454 -0.774033 6.30236 -0.508926 -0.713551 6.29932 -0.504398 -0.640358 6.29627 -0.499869 -0.553885 6.29319 -0.495341 -0.453823 6.28892 -0.490812 -0.340146 6.28233 -0.486284 -0.213084 6.27263 -0.481756 -0.0731078 6.25895 -0.477183 --0.0790716 6.24042 -0.472453 --0.242522 6.21616 -0.467519 --0.416107 6.18536 -0.46233 --0.598505 6.14729 -0.456827 --0.788241 6.10138 -0.45095 --0.983713 6.04721 -0.444631 --1.18323 5.98455 -0.437801 --1.38504 5.91339 -0.430388 --1.58741 5.83395 -0.422318 --1.78859 5.74667 -0.413515 --1.98694 5.65222 -0.403906 --2.18089 5.55147 -0.393421 --2.36903 5.44545 -0.381992 --2.55009 5.33536 -0.369557 -0.158625 0 -0.0308704 -0.139257 0 -0.0299399 -0.120974 0 -0.028883 -0.103863 0 -0.0277101 -0.0879978 0 -0.0264313 -0.0734332 0 -0.0250604 -0.0602065 0 -0.0236178 -0.0483332 0 -0.0221316 -0.0378059 0 -0.0206353 -0.0285925 0 -0.0191621 -0.0206698 0 -0.0175627 -0.0140636 0 -0.0155175 -0.00881603 0 -0.0129084 -0.00489454 0 -0.00988793 -0.00217521 0 -0.00666801 -0.000549888 0 -0.00335871 -0 0 0 -0.000549888 0 0.00335871 -0.00217521 0 0.00666801 -0.00489454 0 0.00988793 -0.00881603 0 0.0129084 -0.0140636 0 0.0155175 -0.0206698 0 0.0175627 -0.0285925 0 0.0191621 -0.0378059 0 0.0206353 -0.0483332 0 0.0221316 -0.0602065 0 0.0236178 -0.0734332 0 0.0250604 -0.0879978 0 0.0264313 -0.103863 0 0.0277101 -0.120974 0 0.028883 -0.139257 0 0.0299399 -0.158625 0 0.0308704 -0.178979 0 0.03166 -0.200207 0 0.0322879 -0.222187 0 0.0327268 -0.244791 0 0.0329452 -0.267882 0 0.0329126 -0.291318 0 0.0326052 -0.314956 0 0.0320112 -0.33865 0 0.0311351 -0.362256 0 0.0299989 -0.385636 0 0.0286389 -0.408656 0 0.0271021 -0.43119 0 0.0254389 -0.45312 0 0.0236966 -0.474339 0 0.0219149 -0.49475 0 0.0201231 -0.514268 0 0.0183398 -0.532824 0 0.0165757 -0.550364 0 0.0148364 -0.566853 0 0.0131261 -0.582276 0 0.0114504 -0.596641 0 0.00981716 -0.60998 0 0.0082355 -0.622351 0 0.00671498 -0.63384 0 0.0052628 -0.644559 0 0.00388216 -0.654653 0 0.00256277 -0.664297 0 0.00127964 -0.6737 0 0 -0.683269 0 0 -0.694487 0 0 -0.711582 0 0 -0.742319 0 0 -0.799007 0 0 -0.899792 0 0 -1.07031 0 0 -1.3458 0 0 -1.77389 0 0 -2.41803 0 0 -3.36204 0 0 -4.7159 0 0 -0.158625 0 -0.0308904 -0.139256 0 -0.0299599 -0.120972 0 -0.028903 -0.103862 0 -0.0277301 -0.0879959 0 -0.0264513 -0.073431 0 -0.0250803 -0.0602038 0 -0.0236376 -0.0483299 0 -0.0221514 -0.0378017 0 -0.0206549 -0.0285869 0 -0.0191814 -0.0206625 0 -0.0175814 -0.014054 0 -0.0155351 -0.00880369 0 -0.0129242 -0.00487939 0 -0.00990107 -0.00215755 0 -0.00667752 -0.000530462 0 -0.00336372 --2.0064e-05 0 0 -0.000530462 0 0.00336372 -0.00215755 0 0.00667752 -0.00487939 0 0.00990107 -0.00880369 0 0.0129242 -0.014054 0 0.0155351 -0.0206625 0 0.0175814 -0.0285869 0 0.0191814 -0.0378017 0 0.0206549 -0.0483299 0 0.0221514 -0.0602038 0 0.0236376 -0.073431 0 0.0250803 -0.0879959 0 0.0264513 -0.103862 0 0.0277301 -0.120972 0 0.028903 -0.139256 0 0.0299599 -0.158625 0 0.0308904 -0.178979 0 0.0316801 -0.200206 0 0.032308 -0.222187 0 0.0327469 -0.244791 0 0.0329653 -0.267882 0 0.0329327 -0.291319 0 0.0326253 -0.314957 0 0.0320313 -0.338651 0 0.0311552 -0.362257 0 0.0300189 -0.385637 0 0.028659 -0.408657 0 0.0271222 -0.431191 0 0.0254589 -0.453121 0 0.0237166 -0.47434 0 0.021935 -0.494751 0 0.0201431 -0.51427 0 0.0183599 -0.532826 0 0.0165957 -0.550366 0 0.0148564 -0.566855 0 0.0131461 -0.582278 0 0.0114705 -0.596643 0 0.0098372 -0.609983 0 0.00825555 -0.622354 0 0.00673503 -0.633842 0 0.00528285 -0.644561 0 0.00390223 -0.654655 0 0.00258287 -0.664299 0 0.00129977 -0.673701 0 2.0166e-05 -0.68327 0 2.0193e-05 -0.694488 0 2.021e-05 -0.711582 0 2.0223e-05 -0.742319 0 2.0237e-05 -0.799007 0 2.0262e-05 -0.899792 0 2.0309e-05 -1.07031 0 2.0401e-05 -1.3458 0 2.0582e-05 -1.77389 0 2.0944e-05 -2.41803 0 2.1673e-05 -3.36204 0 2.3145e-05 -4.7159 0 2.6092e-05 -0.158622 0 -0.0309265 -0.139253 0 -0.0299959 -0.120969 0 -0.0289389 -0.103858 0 -0.0277659 -0.0879916 0 -0.026487 -0.0734261 0 -0.0251159 -0.0601981 0 -0.023673 -0.048323 0 -0.0221866 -0.0377932 0 -0.0206897 -0.0285761 0 -0.0192155 -0.0206485 0 -0.0176144 -0.0140359 0 -0.0155661 -0.00878096 0 -0.0129521 -0.00485176 0 -0.00992423 -0.00212552 0 -0.00669426 -0.000495357 0 -0.00337254 --5.6282e-05 0 0 -0.000495357 0 0.00337254 -0.00212552 0 0.00669426 -0.00485176 0 0.00992423 -0.00878096 0 0.0129521 -0.0140359 0 0.0155661 -0.0206485 0 0.0176144 -0.0285761 0 0.0192155 -0.0377932 0 0.0206897 -0.048323 0 0.0221866 -0.0601981 0 0.023673 -0.0734261 0 0.0251159 -0.0879916 0 0.026487 -0.103858 0 0.0277659 -0.120969 0 0.0289389 -0.139253 0 0.0299959 -0.158622 0 0.0309265 -0.178977 0 0.0317162 -0.200205 0 0.0323442 -0.222186 0 0.0327831 -0.24479 0 0.0330015 -0.267882 0 0.032969 -0.291319 0 0.0326616 -0.314957 0 0.0320676 -0.338652 0 0.0311915 -0.362259 0 0.0300553 -0.385639 0 0.0286954 -0.408659 0 0.0271586 -0.431193 0 0.0254953 -0.453124 0 0.023753 -0.474343 0 0.0219713 -0.494754 0 0.0201795 -0.514273 0 0.0183963 -0.532829 0 0.0166321 -0.550369 0 0.0148928 -0.566859 0 0.0131825 -0.582282 0 0.0115069 -0.596647 0 0.00987356 -0.609987 0 0.00829191 -0.622358 0 0.0067714 -0.633846 0 0.00531923 -0.644565 0 0.00393865 -0.654659 0 0.00261933 -0.664302 0 0.0013363 -0.673704 0 5.6758e-05 -0.683272 0 5.6834e-05 -0.694489 0 5.6885e-05 -0.711583 0 5.6922e-05 -0.742319 0 5.6959e-05 -0.799008 0 5.7015e-05 -0.899792 0 5.7117e-05 -1.07031 0 5.7307e-05 -1.3458 0 5.7676e-05 -1.77389 0 5.8407e-05 -2.41803 0 5.9874e-05 -3.36204 0 6.2826e-05 -4.7159 0 6.8723e-05 -0.158616 0 -0.0309875 -0.139246 0 -0.0300567 -0.120961 0 -0.0289993 -0.103849 0 -0.027826 -0.0879813 0 -0.0265467 -0.0734146 0 -0.0251752 -0.0601851 0 -0.0237317 -0.0483081 0 -0.0222446 -0.0377756 0 -0.0207469 -0.0285547 0 -0.0192714 -0.020622 0 -0.0176681 -0.014003 0 -0.0156164 -0.00874058 0 -0.0129971 -0.00480364 0 -0.00996153 -0.00207048 0 -0.00672118 -0.000435457 0 -0.0033867 --0.000117934 0 0 -0.000435457 0 0.0033867 -0.00207048 0 0.00672118 -0.00480364 0 0.00996153 -0.00874058 0 0.0129971 -0.014003 0 0.0156164 -0.020622 0 0.0176681 -0.0285547 0 0.0192714 -0.0377756 0 0.0207469 -0.0483081 0 0.0222446 -0.0601851 0 0.0237317 -0.0734146 0 0.0251752 -0.0879813 0 0.0265467 -0.103849 0 0.027826 -0.120961 0 0.0289993 -0.139246 0 0.0300567 -0.158616 0 0.0309875 -0.178971 0 0.0317775 -0.2002 0 0.0324056 -0.222182 0 0.0328448 -0.244787 0 0.0330634 -0.267879 0 0.033031 -0.291318 0 0.0327237 -0.314957 0 0.0321298 -0.338652 0 0.0312538 -0.36226 0 0.0301177 -0.38564 0 0.0287578 -0.408661 0 0.0272211 -0.431196 0 0.0255578 -0.453127 0 0.0238155 -0.474347 0 0.0220339 -0.494758 0 0.0202421 -0.514277 0 0.0184589 -0.532834 0 0.0166947 -0.550374 0 0.0149555 -0.566864 0 0.0132452 -0.582288 0 0.0115696 -0.596653 0 0.00993627 -0.609993 0 0.00835464 -0.622364 0 0.00683416 -0.633852 0 0.00538204 -0.644571 0 0.00400154 -0.654664 0 0.00268233 -0.664307 0 0.00139942 -0.673707 0 0.000119995 -0.683274 0 0.00012017 -0.69449 0 0.000120296 -0.711583 0 0.000120389 -0.74232 0 0.000120479 -0.799008 0 0.000120597 -0.899792 0 0.000120781 -1.07031 0 0.0001211 -1.3458 0 0.000121687 -1.77389 0 0.000122818 -2.41803 0 0.000125054 -3.36204 0 0.000129512 -4.7159 0 0.000138374 -0.158599 0 -0.0310871 -0.139227 0 -0.0301555 -0.120941 0 -0.0290972 -0.103827 0 -0.0279229 -0.0879574 0 -0.0266424 -0.0733885 0 -0.0252697 -0.0601565 0 -0.0238249 -0.0482762 0 -0.0223362 -0.0377393 0 -0.0208364 -0.0285127 0 -0.0193582 -0.0205722 0 -0.0177511 -0.0139437 0 -0.0156937 -0.00867017 0 -0.0130659 -0.00472182 0 -0.0100183 -0.00197848 0 -0.00676196 -0.000336335 0 -0.00340811 --0.000219625 0 0 -0.000336335 0 0.00340811 -0.00197848 0 0.00676196 -0.00472182 0 0.0100183 -0.00867017 0 0.0130659 -0.0139437 0 0.0156937 -0.0205722 0 0.0177511 -0.0285127 0 0.0193582 -0.0377393 0 0.0208364 -0.0482762 0 0.0223362 -0.0601565 0 0.0238249 -0.0733885 0 0.0252697 -0.0879574 0 0.0266424 -0.103827 0 0.0279229 -0.120941 0 0.0290972 -0.139227 0 0.0301555 -0.158599 0 0.0310871 -0.178956 0 0.0318779 -0.200187 0 0.0325067 -0.222171 0 0.0329464 -0.244778 0 0.0331655 -0.267872 0 0.0331336 -0.291311 0 0.0328267 -0.314952 0 0.0322332 -0.338649 0 0.0313575 -0.362258 0 0.0302215 -0.38564 0 0.0288619 -0.408662 0 0.0273253 -0.431198 0 0.0256622 -0.45313 0 0.0239201 -0.474351 0 0.0221386 -0.494763 0 0.0203469 -0.514282 0 0.0185637 -0.53284 0 0.0167997 -0.550381 0 0.0150605 -0.566871 0 0.0133503 -0.582295 0 0.0116748 -0.596661 0 0.0100416 -0.610002 0 0.00846003 -0.622373 0 0.00693965 -0.633861 0 0.00548767 -0.64458 0 0.00410733 -0.654672 0 0.00278833 -0.664313 0 0.00150565 -0.673712 0 0.000226463 -0.683278 0 0.000226838 -0.694493 0 0.000227126 -0.711585 0 0.000227356 -0.742321 0 0.000227573 -0.799009 0 0.000227826 -0.899793 0 0.000228168 -1.07031 0 0.00022869 -1.34581 0 0.000229574 -1.77389 0 0.000231186 -2.41803 0 0.00023427 -3.36204 0 0.000240308 -4.7159 0 0.000252173 -0.158562 0 -0.0312471 -0.139187 0 -0.0303134 -0.120897 0 -0.029253 -0.103779 0 -0.0280762 -0.0879059 0 -0.026793 -0.0733331 0 -0.0254174 -0.0600966 0 -0.0239694 -0.048211 0 -0.022477 -0.0376674 0 -0.020973 -0.0284319 0 -0.0194896 -0.0204802 0 -0.0178756 -0.0138379 0 -0.0158086 -0.00854879 0 -0.0131675 -0.00458441 0 -0.0101015 -0.00182683 0 -0.00682157 -0.000174749 0 -0.00343932 --0.00038479 0 0 -0.000174749 0 0.00343932 -0.00182683 0 0.00682157 -0.00458441 0 0.0101015 -0.00854879 0 0.0131675 -0.0138379 0 0.0158086 -0.0204802 0 0.0178756 -0.0284319 0 0.0194896 -0.0376674 0 0.020973 -0.048211 0 0.022477 -0.0600966 0 0.0239694 -0.0733331 0 0.0254174 -0.0879059 0 0.026793 -0.103779 0 0.0280762 -0.120897 0 0.029253 -0.139187 0 0.0303134 -0.158562 0 0.0312471 -0.178922 0 0.0320396 -0.200156 0 0.0326701 -0.222143 0 0.0331113 -0.244754 0 0.0333317 -0.267851 0 0.0333009 -0.291294 0 0.032995 -0.314938 0 0.0324023 -0.338637 0 0.0315273 -0.362249 0 0.030392 -0.385634 0 0.0290329 -0.408658 0 0.0274968 -0.431196 0 0.0258341 -0.45313 0 0.0240923 -0.474353 0 0.0223111 -0.494766 0 0.0205197 -0.514287 0 0.0187368 -0.532846 0 0.016973 -0.550388 0 0.0152341 -0.566879 0 0.0135241 -0.582305 0 0.0118488 -0.596672 0 0.0102159 -0.610013 0 0.00863456 -0.622385 0 0.00711444 -0.633873 0 0.00566275 -0.644591 0 0.00428276 -0.654682 0 0.00296416 -0.664322 0 0.00168193 -0.673719 0 0.00040318 -0.683283 0 0.000403939 -0.694496 0 0.000404561 -0.711587 0 0.000405088 -0.742322 0 0.00040559 -0.799011 0 0.000406132 -0.899795 0 0.000406789 -1.07031 0 0.000407676 -1.34581 0 0.000409021 -1.7739 0 0.000411281 -2.41803 0 0.000415384 -3.36204 0 0.000423156 -4.7159 0 0.000438103 -0.158485 0 -0.0315022 -0.139103 0 -0.0305642 -0.120806 0 -0.029499 -0.103682 0 -0.0283169 -0.0878022 0 -0.0270281 -0.0732222 0 -0.0256463 -0.059978 0 -0.0241915 -0.0480837 0 -0.0226917 -0.0375297 0 -0.0211793 -0.0282813 0 -0.019686 -0.0203135 0 -0.0180598 -0.0136519 0 -0.0159771 -0.00834134 0 -0.013315 -0.00435513 0 -0.0102216 -0.00157829 0 -0.00690702 --8.7178e-05 0 -0.00348391 --0.000651533 0 0 --8.7178e-05 0 0.00348391 -0.00157829 0 0.00690702 -0.00435513 0 0.0102216 -0.00834134 0 0.013315 -0.0136519 0 0.0159771 -0.0203135 0 0.0180598 -0.0282813 0 0.019686 -0.0375297 0 0.0211793 -0.0480837 0 0.0226917 -0.059978 0 0.0241915 -0.0732222 0 0.0256463 -0.0878022 0 0.0270281 -0.103682 0 0.0283169 -0.120806 0 0.029499 -0.139103 0 0.0305642 -0.158485 0 0.0315022 -0.178852 0 0.0322987 -0.200092 0 0.0329326 -0.222085 0 0.033377 -0.244702 0 0.0336001 -0.267805 0 0.0335718 -0.291254 0 0.033268 -0.314904 0 0.0326771 -0.338609 0 0.0318038 -0.362226 0 0.0306699 -0.385615 0 0.0293119 -0.408644 0 0.0277769 -0.431186 0 0.0261151 -0.453123 0 0.0243741 -0.474349 0 0.0225936 -0.494765 0 0.0208028 -0.514289 0 0.0190205 -0.53285 0 0.0172572 -0.550395 0 0.0155188 -0.566888 0 0.0138094 -0.582315 0 0.0121346 -0.596684 0 0.0105022 -0.610026 0 0.00892144 -0.622399 0 0.00740189 -0.633888 0 0.00595081 -0.644605 0 0.0045715 -0.654696 0 0.00325365 -0.664334 0 0.00197221 -0.673728 0 0.000694253 -0.683289 0 0.000695721 -0.694501 0 0.000696986 -0.711591 0 0.000698108 -0.742326 0 0.000699185 -0.799014 0 0.000700311 -0.8998 0 0.000701577 -1.07032 0 0.00070313 -1.34582 0 0.000705243 -1.7739 0 0.00070847 -2.41804 0 0.00071391 -3.36205 0 0.000723704 -4.7159 0 0.000741882 -0.158335 0 -0.031909 -0.138941 0 -0.0309624 -0.120632 0 -0.0298877 -0.103496 0 -0.0286953 -0.0876036 0 -0.0273952 -0.073011 0 -0.0260012 -0.0597539 0 -0.0245332 -0.0478454 0 -0.023019 -0.0372751 0 -0.0214907 -0.0280075 0 -0.0199794 -0.0200169 0 -0.0183319 -0.0133289 0 -0.0162231 -0.0079892 0 -0.0135283 -0.00397384 0 -0.0103936 -0.00117149 0 -0.0070287 --0.000511624 0 -0.00354714 --0.00108231 0 0 --0.000511624 0 0.00354714 -0.00117149 0 0.0070287 -0.00397384 0 0.0103936 -0.0079892 0 0.0135283 -0.0133289 0 0.0162231 -0.0200169 0 0.0183319 -0.0280075 0 0.0199794 -0.0372751 0 0.0214907 -0.0478454 0 0.023019 -0.0597539 0 0.0245332 -0.073011 0 0.0260012 -0.0876036 0 0.0273952 -0.103496 0 0.0286953 -0.120632 0 0.0298877 -0.138941 0 0.0309624 -0.158335 0 0.031909 -0.178713 0 0.0327132 -0.199966 0 0.0333541 -0.221971 0 0.0338046 -0.244598 0 0.0340333 -0.267713 0 0.0340098 -0.291172 0 0.0337103 -0.314832 0 0.0331231 -0.338547 0 0.032253 -0.362173 0 0.0311218 -0.385571 0 0.0297663 -0.408608 0 0.0282333 -0.431157 0 0.0265733 -0.453101 0 0.0248339 -0.474332 0 0.0230547 -0.494754 0 0.0212652 -0.514283 0 0.019484 -0.532848 0 0.0177218 -0.550397 0 0.0159845 -0.566894 0 0.0142761 -0.582324 0 0.0126024 -0.596696 0 0.0109711 -0.61004 0 0.0093914 -0.622415 0 0.00787295 -0.633904 0 0.00642302 -0.644622 0 0.00504495 -0.654712 0 0.00372843 -0.664348 0 0.00244838 -0.67374 0 0.0011718 -0.683298 0 0.00117452 -0.694507 0 0.00117696 -0.711596 0 0.00117919 -0.742331 0 0.00118135 -0.799022 0 0.00118357 -0.89981 0 0.00118596 -1.07033 0 0.00118871 -1.34583 0 0.00119213 -1.77392 0 0.00119688 -2.41805 0 0.00120422 -3.36206 0 0.00121654 -4.7159 0 0.00123821 -0.158055 0 -0.0325597 -0.13864 0 -0.031597 -0.12031 0 -0.0305046 -0.103152 0 -0.0292928 -0.0872381 0 -0.0279716 -0.0726239 0 -0.0265547 -0.0593446 0 -0.025062 -0.0474129 0 -0.0235212 -0.0368173 0 -0.0219639 -0.0275212 0 -0.0204205 -0.0194981 0 -0.0187364 -0.0127735 0 -0.0165848 -0.00739466 0 -0.0138384 -0.0033407 0 -0.0106415 -0.000504957 0 -0.00720268 --0.00120111 0 -0.00363712 --0.00178 0 0 --0.00120111 0 0.00363712 -0.000504957 0 0.00720268 -0.0033407 0 0.0106415 -0.00739466 0 0.0138384 -0.0127735 0 0.0165848 -0.0194981 0 0.0187364 -0.0275212 0 0.0204205 -0.0368173 0 0.0219639 -0.0474129 0 0.0235212 -0.0593446 0 0.025062 -0.0726239 0 0.0265547 -0.0872381 0 0.0279716 -0.103152 0 0.0292928 -0.12031 0 0.0305046 -0.13864 0 0.031597 -0.158055 0 0.0325597 -0.178455 0 0.0333784 -0.199729 0 0.0340324 -0.221754 0 0.0344946 -0.244403 0 0.0347336 -0.267537 0 0.0347192 -0.291015 0 0.0344276 -0.314693 0 0.0338473 -0.338425 0 0.0329832 -0.362068 0 0.0318572 -0.385481 0 0.0305061 -0.408532 0 0.028977 -0.431094 0 0.0273204 -0.453049 0 0.0255839 -0.474291 0 0.0238074 -0.494723 0 0.0220201 -0.51426 0 0.020241 -0.532833 0 0.0184808 -0.550389 0 0.0167455 -0.566892 0 0.0150391 -0.582328 0 0.0133673 -0.596704 0 0.0117379 -0.610053 0 0.0101602 -0.622431 0 0.00864378 -0.633923 0 0.00719592 -0.644642 0 0.00582001 -0.65473 0 0.00450577 -0.664364 0 0.00322807 -0.673753 0 0.00195383 -0.683308 0 0.00195869 -0.694516 0 0.00196317 -0.711604 0 0.00196736 -0.742341 0 0.00197146 -0.799035 0 0.00197563 -0.899827 0 0.00198001 -1.07035 0 0.00198483 -1.34586 0 0.00199047 -1.77395 0 0.00199767 -2.41808 0 0.00200784 -3.36208 0 0.00202353 -4.7159 0 0.00204913 -0.157553 0 -0.0336056 -0.1381 0 -0.0326138 -0.119732 0 -0.0314894 -0.102536 0 -0.0302426 -0.0865847 0 -0.0288833 -0.0719333 0 -0.0274252 -0.0586168 0 -0.0258882 -0.0466471 0 -0.0242996 -0.0360116 0 -0.0226908 -0.0266725 0 -0.0210913 -0.0186024 0 -0.019345 -0.0118269 0 -0.0171227 -0.00639516 0 -0.0142947 -0.00229007 0 -0.0110026 --0.000589322 0 -0.00745427 --0.00232512 0 -0.00376662 --0.00291461 0 0 --0.00232512 0 0.00376662 --0.000589322 0 0.00745427 -0.00229007 0 0.0110026 -0.00639516 0 0.0142947 -0.0118269 0 0.0171227 -0.0186024 0 0.019345 -0.0266725 0 0.0210913 -0.0360116 0 0.0226908 -0.0466471 0 0.0242996 -0.0586168 0 0.0258882 -0.0719333 0 0.0274252 -0.0865847 0 0.0288833 -0.102536 0 0.0302426 -0.119732 0 0.0314894 -0.1381 0 0.0326138 -0.157553 0 0.0336056 -0.17799 0 0.0344506 -0.199301 0 0.0351281 -0.221362 0 0.0356113 -0.244046 0 0.0358689 -0.267215 0 0.0358708 -0.290726 0 0.0355935 -0.314436 0 0.0350257 -0.338198 0 0.0341723 -0.361869 0 0.0330557 -0.385309 0 0.0317126 -0.408384 0 0.0301904 -0.430968 0 0.0285398 -0.452945 0 0.0268085 -0.474205 0 0.0250365 -0.494654 0 0.0232532 -0.514206 0 0.0214777 -0.532793 0 0.0197211 -0.550361 0 0.0179892 -0.566875 0 0.0162863 -0.58232 0 0.014618 -0.596705 0 0.012992 -0.61006 0 0.0114177 -0.622444 0 0.00990477 -0.63394 0 0.00846046 -0.644661 0 0.00708821 -0.65475 0 0.00577776 -0.664382 0 0.00450393 -0.673769 0 0.00323356 -0.683322 0 0.00324198 -0.694528 0 0.00324988 -0.711618 0 0.00325741 -0.742358 0 0.00326481 -0.799058 0 0.00327231 -0.899859 0 0.00328009 -1.07039 0 0.00328841 -1.3459 0 0.00329773 -1.774 0 0.00330889 -2.41813 0 0.00332339 -3.36212 0 0.00334382 -4.7159 0 0.00337404 -0.156668 0 -0.0352955 -0.13715 0 -0.0342525 -0.118717 0 -0.0330718 -0.101456 0 -0.0317635 -0.0854409 0 -0.0303372 -0.0707263 0 -0.0288068 -0.0573472 0 -0.0271919 -0.0453151 0 -0.0255198 -0.0346162 0 -0.0238215 -0.0252113 0 -0.0221254 -0.0170721 0 -0.0202739 -0.0102248 0 -0.0179354 -0.00472048 0 -0.014977 -0.000546974 0 -0.0115376 --0.00238985 0 -0.00782418 --0.00416436 0 -0.00395608 --0.00476756 0 0 --0.00416436 0 0.00395608 --0.00238985 0 0.00782418 -0.000546974 0 0.0115376 -0.00472048 0 0.014977 -0.0102248 0 0.0179354 -0.0170721 0 0.0202739 -0.0252113 0 0.0221254 -0.0346162 0 0.0238215 -0.0453151 0 0.0255198 -0.0573472 0 0.0271919 -0.0707263 0 0.0288068 -0.0854409 0 0.0303372 -0.101456 0 0.0317635 -0.118717 0 0.0330718 -0.13715 0 0.0342525 -0.156668 0 0.0352955 -0.177171 0 0.0361866 -0.198545 0 0.0369054 -0.22067 0 0.0374254 -0.243414 0 0.0377155 -0.266642 0 0.037746 -0.290211 0 0.0374937 -0.313975 0 0.0369476 -0.337789 0 0.036113 -0.361509 0 0.0350125 -0.384994 0 0.0336834 -0.408111 0 0.0321732 -0.430735 0 0.0305328 -0.452746 0 0.0288104 -0.474039 0 0.0270462 -0.494517 0 0.0252698 -0.514096 0 0.0235003 -0.532706 0 0.0217495 -0.550295 0 0.0200235 -0.566827 0 0.0183264 -0.582289 0 0.016664 -0.596687 0 0.0150438 -0.610055 0 0.0134753 -0.622448 0 0.0119681 -0.633952 0 0.0105297 -0.644678 0 0.00916345 -0.654769 0 0.00785916 -0.664401 0 0.00659159 -0.673786 0 0.00532746 -0.683338 0 0.00534163 -0.694544 0 0.00535513 -0.711638 0 0.00536815 -0.742387 0 0.00538102 -0.7991 0 0.00539403 -0.899915 0 0.0054074 -1.07046 0 0.00542147 -1.34599 0 0.00543677 -1.77409 0 0.00545426 -2.41822 0 0.00547549 -3.36218 0 0.0055028 -4.7159 0 0.00553874 -0.155139 0 -0.0380387 -0.13551 0 -0.0369078 -0.116965 0 -0.03563 -0.0995935 0 -0.0342154 -0.0834692 0 -0.0326737 -0.0686477 0 -0.0310185 -0.055164 0 -0.0292694 -0.043029 0 -0.0274537 -0.0322281 0 -0.0256019 -0.022721 0 -0.0237416 -0.0144785 0 -0.0217136 -0.00752724 0 -0.0191835 -0.00192161 0 -0.0160152 --0.00234505 0 -0.0123449 --0.00535857 0 -0.00837847 --0.00718413 0 -0.0042387 --0.0078053 0 0 --0.00718413 0 0.0042387 --0.00535857 0 0.00837847 --0.00234505 0 0.0123449 -0.00192161 0 0.0160152 -0.00752724 0 0.0191835 -0.0144785 0 0.0217136 -0.022721 0 0.0237416 -0.0322281 0 0.0256019 -0.043029 0 0.0274537 -0.055164 0 0.0292694 -0.0686477 0 0.0310185 -0.0834692 0 0.0326737 -0.0995935 0 0.0342154 -0.116965 0 0.03563 -0.13551 0 0.0369078 -0.155139 0 0.0380387 -0.175752 0 0.0390093 -0.197236 0 0.0397992 -0.219467 0 0.0403824 -0.242316 0 0.0407283 -0.265645 0 0.0408079 -0.289311 0 0.0405984 -0.313169 0 0.0400894 -0.337071 0 0.0392868 -0.360873 0 0.0382139 -0.384436 0 0.0369083 -0.407625 0 0.0354182 -0.430315 0 0.0337952 -0.452387 0 0.0320876 -0.473735 0 0.0303362 -0.494263 0 0.028571 -0.513886 0 0.0268116 -0.532536 0 0.0250704 -0.550161 0 0.023354 -0.566724 0 0.0216664 -0.582214 0 0.0200134 -0.596636 0 0.0184026 -0.610024 0 0.0168435 -0.622434 0 0.0153458 -0.633951 0 0.0139169 -0.644686 0 0.0125604 -0.654784 0 0.0112659 -0.664419 0 0.0100082 -0.673805 0 0.00875398 -0.683357 0 0.00877727 -0.694568 0 0.0087997 -0.711672 0 0.00882154 -0.742437 0 0.00884321 -0.799171 0 0.00886507 -0.900012 0 0.00888744 -1.07059 0 0.00891072 -1.34614 0 0.00893557 -1.77426 0 0.00896304 -2.41838 0 0.00899466 -3.36229 0 0.00903216 -4.7159 0 0.0090755 -0.152526 0 -0.0425104 -0.132708 0 -0.0412297 -0.113974 0 -0.0397869 -0.0964159 0 -0.0381917 -0.0801077 0 -0.0364534 -0.0651065 0 -0.0345856 -0.051448 0 -0.0326083 -0.0391434 0 -0.0305485 -0.0281774 0 -0.0284366 -0.0185088 0 -0.0262995 -0.0101082 0 -0.0239763 -0.00300353 0 -0.0211304 --0.00274725 0 -0.0176224 --0.00714375 0 -0.0135854 --0.010262 0 -0.00922517 --0.0121562 0 -0.00466869 --0.0128014 0 0 --0.0121562 0 0.00466869 --0.010262 0 0.00922517 --0.00714375 0 0.0135854 --0.00274725 0 0.0176224 -0.00300353 0 0.0211304 -0.0101082 0 0.0239763 -0.0185088 0 0.0262995 -0.0281774 0 0.0284366 -0.0391434 0 0.0305485 -0.051448 0 0.0326083 -0.0651065 0 0.0345856 -0.0801077 0 0.0364534 -0.0964159 0 0.0381917 -0.113974 0 0.0397869 -0.132708 0 0.0412297 -0.152526 0 0.0425104 -0.173326 0 0.0436157 -0.194995 0 0.0445262 -0.217409 0 0.0452165 -0.240435 0 0.045657 -0.263935 0 0.0458194 -0.287765 0 0.045682 -0.311779 0 0.0452355 -0.33583 0 0.0444866 -0.359773 0 0.0434597 -0.383466 0 0.0421934 -0.406777 0 0.0407368 -0.429579 0 0.0391422 -0.451754 0 0.037459 -0.473196 0 0.0357285 -0.493808 0 0.0339814 -0.513507 0 0.0322379 -0.532225 0 0.030512 -0.54991 0 0.0288108 -0.566527 0 0.0271383 -0.582062 0 0.0255004 -0.596524 0 0.0239047 -0.609946 0 0.0223607 -0.622384 0 0.020878 -0.633924 0 0.0194641 -0.644677 0 0.0181228 -0.654787 0 0.0168436 -0.66443 0 0.0156014 -0.673822 0 0.0143626 -0.683381 0 0.0144001 -0.694603 0 0.0144365 -0.711726 0 0.0144722 -0.74252 0 0.0145077 -0.799292 0 0.0145435 -0.900179 0 0.01458 -1.0708 0 0.0146177 -1.34639 0 0.0146575 -1.77453 0 0.0147005 -2.41864 0 0.0147481 -3.36248 0 0.0148007 -4.7159 0 0.014854 -0.148099 0 -0.0498232 -0.127963 0 -0.0482907 -0.108912 0 -0.04657 -0.0910392 0 -0.0446703 -0.0744219 0 -0.0426007 -0.0591197 0 -0.0403747 -0.0451699 0 -0.0380125 -0.0325849 0 -0.0355415 -0.0213497 0 -0.0329923 -0.0114232 0 -0.0303912 -0.00277646 0 -0.0275766 --0.00456051 0 -0.0242097 --0.0105247 0 -0.0201485 --0.0151071 0 -0.0155237 --0.0183722 0 -0.0105416 --0.0203613 0 -0.005335 --0.0210395 0 0 --0.0203613 0 0.005335 --0.0183722 0 0.0105416 --0.0151071 0 0.0155237 --0.0105247 0 0.0201485 --0.00456051 0 0.0242097 -0.00277646 0 0.0275766 -0.0114232 0 0.0303912 -0.0213497 0 0.0329923 -0.0325849 0 0.0355415 -0.0451699 0 0.0380125 -0.0591197 0 0.0403747 -0.0744219 0 0.0426007 -0.0910392 0 0.0446703 -0.108912 0 0.04657 -0.127963 0 0.0482907 -0.148099 0 0.0498232 -0.169216 0 0.0511552 -0.191197 0 0.0522682 -0.213916 0 0.0531382 -0.237239 0 0.053737 -0.261028 0 0.0540379 -0.285135 0 0.0540208 -0.309413 0 0.0536782 -0.333714 0 0.0530185 -0.357892 0 0.0520676 -0.381806 0 0.050866 -0.405322 0 0.049464 -0.428312 0 0.0479157 -0.45066 0 0.0462717 -0.472259 0 0.0445745 -0.493014 0 0.042856 -0.512841 0 0.0411375 -0.531673 0 0.0394355 -0.549459 0 0.0377581 -0.566164 0 0.0361094 -0.581777 0 0.034495 -0.596306 0 0.0329228 -0.609784 0 0.0314022 -0.62227 0 0.0299429 -0.633849 0 0.0285524 -0.644634 0 0.0272346 -0.654767 0 0.0259791 -0.664429 0 0.0247606 -0.673836 0 0.0235455 -0.68341 0 0.0236046 -0.694655 0 0.0236624 -0.711813 0 0.0237194 -0.742659 0 0.0237762 -0.799497 0 0.0238334 -0.900461 0 0.0238917 -1.07116 0 0.0239517 -1.34682 0 0.0240144 -1.775 0 0.0240812 -2.41909 0 0.0241529 -3.3628 0 0.0242282 -4.7159 0 0.0242952 -0.140647 0 -0.0618132 -0.119977 0 -0.0598599 -0.100393 0 -0.0576745 -0.0819936 0 -0.0552653 -0.0648593 0 -0.0526411 -0.0490541 0 -0.0498153 -0.0346193 0 -0.0468086 -0.0215702 0 -0.0436492 -0.00989401 0 -0.0403684 --0.000448895 0 -0.0369933 --0.00948527 0 -0.0333622 --0.0171814 0 -0.0291358 --0.0234673 0 -0.0241703 --0.0283237 0 -0.0185955 --0.0318007 0 -0.0126197 --0.0339249 0 -0.00638403 --0.0346496 0 0 --0.0339249 0 0.00638403 --0.0318007 0 0.0126197 --0.0283237 0 0.0185955 --0.0234673 0 0.0241703 --0.0171814 0 0.0291358 --0.00948527 0 0.0333622 --0.000448895 0 0.0369933 -0.00989401 0 0.0403684 -0.0215702 0 0.0436492 -0.0346193 0 0.0468086 -0.0490541 0 0.0498153 -0.0648593 0 0.0526411 -0.0819936 0 0.0552653 -0.100393 0 0.0576745 -0.119977 0 0.0598599 -0.140647 0 0.0618132 -0.162293 0 0.0635235 -0.184798 0 0.0649742 -0.208029 0 0.0661435 -0.231852 0 0.0670054 -0.256123 0 0.0675361 -0.280693 0 0.0677181 -0.305414 0 0.0675469 -0.330134 0 0.0670338 -0.354706 0 0.0662075 -0.378989 0 0.0651112 -0.402848 0 0.0637979 -0.426154 0 0.062324 -0.448793 0 0.0607423 -0.470656 0 0.0590977 -0.491649 0 0.0574238 -0.511691 0 0.0557438 -0.530715 0 0.0540784 -0.548669 0 0.0524375 -0.565523 0 0.0508251 -0.581265 0 0.0492469 -0.595905 0 0.0477107 -0.609479 0 0.0462259 -0.622045 0 0.0448023 -0.63369 0 0.0434476 -0.644529 0 0.0421655 -0.654706 0 0.0409459 -0.664403 0 0.0397633 -0.673841 0 0.038584 -0.683446 0 0.0386756 -0.694735 0 0.0387657 -0.711957 0 0.0388547 -0.742891 0 0.0389437 -0.799843 0 0.0390334 -0.900936 0 0.0391245 -1.07177 0 0.0392181 -1.34755 0 0.0393154 -1.77579 0 0.0394178 -2.41984 0 0.0395258 -3.36333 0 0.0396344 -4.7159 0 0.0397205 -0.128153 0 -0.08151 -0.106592 0 -0.0788571 -0.0861185 0 -0.0758986 -0.0668383 0 -0.0726411 -0.0488406 0 -0.0690927 -0.0321967 0 -0.0652671 -0.0169551 0 -0.061186 -0.00313728 0 -0.0568792 --0.00926445 0 -0.05238 --0.0202849 0 -0.0477176 --0.0299461 0 -0.0427323 --0.0382075 0 -0.037087 --0.0449901 0 -0.030639 --0.0502608 0 -0.023519 --0.0540528 0 -0.0159406 --0.0563751 0 -0.00805712 --0.0571675 0 0 --0.0563751 0 0.00805712 --0.0540528 0 0.0159406 --0.0502608 0 0.023519 --0.0449901 0 0.030639 --0.0382075 0 0.037087 --0.0299461 0 0.0427323 --0.0202849 0 0.0477176 --0.00926445 0 0.05238 -0.00313728 0 0.0568792 -0.0169551 0 0.061186 -0.0321967 0 0.0652671 -0.0488406 0 0.0690927 -0.0668383 0 0.0726411 -0.0861185 0 0.0758986 -0.106592 0 0.0788571 -0.128153 0 0.08151 -0.150687 0 0.0838488 -0.174066 0 0.0858597 -0.198155 0 0.0875245 -0.222812 0 0.0888215 -0.247889 0 0.0897313 -0.273234 0 0.0902412 -0.298692 0 0.0903513 -0.324113 0 0.0900779 -0.349344 0 0.0894544 -0.374244 0 0.0885284 -0.398675 0 0.0873575 -0.422511 0 0.086002 -0.445634 0 0.0845187 -0.467939 0 0.082956 -0.489331 0 0.0813507 -0.509732 0 0.0797289 -0.529075 0 0.0781186 -0.547312 0 0.0765326 -0.564414 0 0.0749749 -0.580371 0 0.0734512 -0.595197 0 0.0719692 -0.608928 0 0.0705383 -0.621629 0 0.0691684 -0.633386 0 0.0678672 -0.644317 0 0.0666385 -0.65457 0 0.0654723 -0.664332 0 0.0643432 -0.673827 0 0.0632173 -0.683493 0 0.0633568 -0.694859 0 0.0634944 -0.712193 0 0.0636309 -0.743278 0 0.0637674 -0.80042 0 0.0639051 -0.901733 0 0.0640449 -1.07279 0 0.0641882 -1.34876 0 0.0643367 -1.77711 0 0.0644918 -2.42109 0 0.064653 -3.36422 0 0.0648102 -4.7159 0 0.064923 -0.107274 0 -0.113914 -0.0842246 0 -0.110102 -0.0622671 0 -0.105861 -0.0415187 0 -0.101196 -0.0220821 0 -0.0961134 -0.00404169 0 -0.0906272 --0.0125412 0 -0.0847608 --0.0276335 0 -0.0785473 --0.0412319 0 -0.0720242 --0.0533616 0 -0.0652254 --0.0640344 0 -0.0579972 --0.0731992 0 -0.0500093 --0.0807629 0 -0.0411246 --0.086675 0 -0.0314799 --0.0909475 0 -0.0212987 --0.0935687 0 -0.0107525 --0.0944626 0 0 --0.0935687 0 0.0107525 --0.0909475 0 0.0212987 --0.086675 0 0.0314799 --0.0807629 0 0.0411246 --0.0731992 0 0.0500093 --0.0640344 0 0.0579972 --0.0533616 0 0.0652254 --0.0412319 0 0.0720242 --0.0276335 0 0.0785473 --0.0125412 0 0.0847608 -0.00404169 0 0.0906272 -0.0220821 0 0.0961134 -0.0415187 0 0.101196 -0.0622671 0 0.105861 -0.0842246 0 0.110102 -0.107274 0 0.113914 -0.131287 0 0.117293 -0.156126 0 0.12023 -0.181645 0 0.122712 -0.207694 0 0.124726 -0.234115 0 0.126259 -0.26075 0 0.127306 -0.287441 0 0.127876 -0.314028 0 0.127993 -0.340358 0 0.127697 -0.366286 0 0.127046 -0.391672 0 0.126102 -0.41639 0 0.124934 -0.440322 0 0.123604 -0.463364 0 0.122168 -0.485423 0 0.120666 -0.506421 0 0.119131 -0.526297 0 0.117602 -0.545005 0 0.116098 -0.562519 0 0.114621 -0.578835 0 0.113178 -0.593969 0 0.111775 -0.607965 0 0.110424 -0.620888 0 0.109133 -0.632833 0 0.107911 -0.643921 0 0.106761 -0.654306 0 0.105673 -0.664181 0 0.104622 -0.673781 0 0.103574 -0.683553 0 0.103782 -0.695057 0 0.103989 -0.712582 0 0.104194 -0.743923 0 0.104399 -0.801386 0 0.104606 -0.903065 0 0.104816 -1.0745 0 0.105032 -1.3508 0 0.105254 -1.77932 0 0.105485 -2.42318 0 0.105723 -3.3657 0 0.10595 -4.7159 0 0.1061 -0.0724533 0 -0.167279 -0.0469256 0 -0.161551 -0.0224959 0 -0.15519 --0.000697438 0 -0.148194 --0.0225294 0 -0.14057 --0.0428932 0 -0.132331 --0.0617051 0 -0.123505 --0.0789108 0 -0.11413 --0.0944872 0 -0.104252 --0.10844 0 -0.0939129 --0.120764 0 -0.0829728 --0.131388 0 -0.0711164 --0.140199 0 -0.0582207 --0.147123 0 -0.0444363 --0.152145 0 -0.0300054 --0.155229 0 -0.0151278 --0.156279 0 0 --0.155229 0 0.0151278 --0.152145 0 0.0300054 --0.147123 0 0.0444363 --0.140199 0 0.0582207 --0.131388 0 0.0711164 --0.120764 0 0.0829728 --0.10844 0 0.0939129 --0.0944872 0 0.104252 --0.0789108 0 0.11413 --0.0617051 0 0.123505 --0.0428932 0 0.132331 --0.0225294 0 0.14057 --0.000697438 0 0.148194 -0.0224959 0 0.15519 -0.0469256 0 0.161551 -0.0724533 0 0.167279 -0.0989305 0 0.172374 -0.126201 0 0.176838 -0.154102 0 0.180667 -0.182468 0 0.183859 -0.211129 0 0.186413 -0.239914 0 0.188338 -0.268655 0 0.189657 -0.297185 0 0.190406 -0.325344 0 0.19064 -0.352984 0 0.190428 -0.379961 0 0.189845 -0.406147 0 0.188972 -0.431427 0 0.187881 -0.455696 0 0.186636 -0.478865 0 0.18529 -0.500859 0 0.183882 -0.521622 0 0.182471 -0.541113 0 0.181083 -0.559314 0 0.179723 -0.576227 0 0.178396 -0.591875 0 0.17711 -0.606309 0 0.175873 -0.619604 0 0.174697 -0.631862 0 0.173588 -0.643213 0 0.17255 -0.653823 0 0.171574 -0.663895 0 0.170635 -0.673676 0 0.169699 -0.683635 0 0.170004 -0.695375 0 0.170307 -0.713224 0 0.170609 -0.744996 0 0.170911 -0.802994 0 0.171216 -0.905287 0 0.171525 -1.07735 0 0.171841 -1.35418 0 0.172168 -1.78299 0 0.172506 -2.42666 0 0.172852 -3.36814 0 0.173176 -4.7159 0 0.173376 -0.0144666 0 -0.25523 --0.0151849 0 -0.246342 --0.0437281 0 -0.236478 --0.0709888 0 -0.225631 --0.096805 0 -0.213803 --0.121031 0 -0.201011 --0.143546 0 -0.187285 --0.164259 0 -0.172676 --0.183109 0 -0.157242 --0.200069 0 -0.141043 --0.215101 0 -0.123964 --0.228102 0 -0.105718 --0.238929 0 -0.0862118 --0.247473 0 -0.065623 --0.253685 0 -0.0442276 --0.257496 0 -0.0222694 --0.258792 0 0 --0.257496 0 0.0222694 --0.253685 0 0.0442276 --0.247473 0 0.065623 --0.238929 0 0.0862118 --0.228102 0 0.105718 --0.215101 0 0.123964 --0.200069 0 0.141043 --0.183109 0 0.157242 --0.164259 0 0.172676 --0.143546 0 0.187285 --0.121031 0 0.201011 --0.096805 0 0.213803 --0.0709888 0 0.225631 --0.0437281 0 0.236478 --0.0151849 0 0.246342 -0.0144666 0 0.25523 -0.0450445 0 0.263155 -0.0763614 0 0.270132 -0.108227 0 0.276173 -0.140449 0 0.281296 -0.172835 0 0.285521 -0.205196 0 0.28888 -0.237347 0 0.291415 -0.269109 0 0.293187 -0.300312 0 0.294273 -0.330798 0 0.294762 -0.360422 0 0.294751 -0.389053 0 0.294337 -0.416574 0 0.293613 -0.442885 0 0.292659 -0.4679 0 0.291541 -0.491551 0 0.290313 -0.51379 0 0.289069 -0.534585 0 0.287847 -0.553928 0 0.286651 -0.571831 0 0.285488 -0.588333 0 0.284364 -0.603496 0 0.283289 -0.61741 0 0.282273 -0.630189 0 0.281322 -0.641983 0 0.280442 -0.652972 0 0.279623 -0.663378 0 0.27884 -0.67347 0 0.27806 -0.68375 0 0.278496 -0.695892 0 0.278929 -0.714286 0 0.279362 -0.746779 0 0.279795 -0.805671 0 0.280233 -0.908984 0 0.280676 -1.08209 0 0.28113 -1.35982 0 0.281598 -1.7891 0 0.282081 -2.43242 0 0.282572 -3.37218 0 0.283027 -4.7159 0 0.283295 --0.0820015 0 -0.400264 --0.11851 0 -0.386166 --0.153893 0 -0.370524 --0.187916 0 -0.353319 --0.220355 0 -0.334548 --0.251 0 -0.314229 --0.279666 0 -0.292402 --0.306197 0 -0.269135 --0.330471 0 -0.24451 --0.352402 0 -0.218619 --0.371892 0 -0.19139 --0.388789 0 -0.16259 --0.4029 0 -0.132178 --0.414067 0 -0.100386 --0.422193 0 -0.0675459 --0.42717 0 -0.0339727 --0.428857 0 0 --0.42717 0 0.0339727 --0.422193 0 0.0675459 --0.414067 0 0.100386 --0.4029 0 0.132178 --0.388789 0 0.16259 --0.371892 0 0.19139 --0.352402 0 0.218619 --0.330471 0 0.24451 --0.306197 0 0.269135 --0.279666 0 0.292402 --0.251 0 0.314229 --0.220355 0 0.334548 --0.187916 0 0.353319 --0.153893 0 0.370524 --0.11851 0 0.386166 --0.0820015 0 0.400264 --0.044605 0 0.412847 --0.00655967 0 0.423954 -0.0318966 0 0.433626 -0.0705295 0 0.441912 -0.10911 0 0.448868 -0.147417 0 0.454559 -0.185238 0 0.459069 -0.222372 0 0.462493 -0.258634 0 0.464946 -0.293854 0 0.466551 -0.327878 0 0.46744 -0.360572 0 0.467742 -0.39182 0 0.467578 -0.421525 0 0.467056 -0.449611 0 0.466267 -0.476017 0 0.46529 -0.500708 0 0.464272 -0.52367 0 0.463276 -0.54491 0 0.462305 -0.564462 0 0.461364 -0.582382 0 0.460461 -0.598756 0 0.459605 -0.613697 0 0.458806 -0.627347 0 0.45807 -0.639878 0 0.457402 -0.651503 0 0.456794 -0.662474 0 0.45622 -0.673094 0 0.455648 -0.683917 0 0.456253 -0.696738 0 0.456854 -0.716044 0 0.457455 -0.74974 0 0.458057 -0.810122 0 0.458665 -0.915133 0 0.459282 -1.08998 0 0.459912 -1.36918 0 0.460561 -1.79923 0 0.461231 -2.44198 0 0.46191 -3.37884 0 0.462533 -4.7159 0 0.462886 --0.242379 0 -0.639523 --0.290285 0 -0.616847 --0.337034 0 -0.591682 --0.382294 0 -0.563987 --0.425738 0 -0.533753 --0.467048 0 -0.501002 --0.505929 0 -0.46579 --0.542117 0 -0.428211 --0.575384 0 -0.388391 --0.60554 0 -0.346477 --0.632392 0 -0.302469 --0.6557 0 -0.256233 --0.675193 0 -0.207823 --0.690639 0 -0.157561 --0.701876 0 -0.105878 --0.70874 0 -0.0532046 --0.711059 0 0 --0.70874 0 0.0532046 --0.701876 0 0.105878 --0.690639 0 0.157561 --0.675193 0 0.207823 --0.6557 0 0.256233 --0.632392 0 0.302469 --0.60554 0 0.346477 --0.575384 0 0.388391 --0.542117 0 0.428211 --0.505929 0 0.46579 --0.467048 0 0.501002 --0.425738 0 0.533753 --0.382294 0 0.563987 --0.337034 0 0.591682 --0.290285 0 0.616847 --0.242379 0 0.639523 --0.19365 0 0.659768 --0.144422 0 0.67766 --0.0950122 0 0.693286 --0.0457245 0 0.706748 -0.00315012 0 0.718159 -0.051337 0 0.727647 -0.0985798 0 0.735355 -0.144642 0 0.741443 -0.189311 0 0.746085 -0.232396 0 0.749463 -0.273731 0 0.751765 -0.313177 0 0.753172 -0.35062 0 0.753856 -0.385967 0 0.75397 -0.419154 0 0.753646 -0.450138 0 0.753001 -0.478905 0 0.752278 -0.505466 0 0.751574 -0.529859 0 0.750893 -0.552147 0 0.750241 -0.572422 0 0.749623 -0.590808 0 0.74905 -0.607456 0 0.748529 -0.622552 0 0.748068 -0.636315 0 0.747672 -0.649002 0 0.747331 -0.660922 0 0.747022 -0.672431 0 0.746716 -0.684169 0 0.747518 -0.698126 0 0.748318 -0.718958 0 0.749116 -0.754658 0 0.749918 -0.817518 0 0.750726 -0.925351 0 0.751547 -1.10307 0 0.752385 -1.38472 0 0.753248 -1.81605 0 0.754138 -2.45781 0 0.755037 -3.38984 0 0.755856 -4.7159 0 0.756307 --0.508884 0 -1.03434 --0.575723 0 -0.997544 --0.641357 0 -0.956688 --0.705287 0 -0.911698 --0.767011 0 -0.862551 --0.826034 0 -0.809275 --0.881878 0 -0.751953 --0.934096 0 -0.69073 --0.98228 0 -0.625799 --1.02606 0 -0.557399 --1.06509 0 -0.485663 --1.09898 0 -0.410619 --1.12733 0 -0.332489 --1.1498 0 -0.251752 --1.16613 0 -0.169007 --1.17607 0 -0.0848702 --1.17942 0 0 --1.17607 0 0.0848702 --1.16613 0 0.169007 --1.1498 0 0.251752 --1.12733 0 0.332489 --1.09898 0 0.410619 --1.06509 0 0.485663 --1.02606 0 0.557399 --0.98228 0 0.625799 --0.934096 0 0.69073 --0.881878 0 0.751953 --0.826034 0 0.809275 --0.767011 0 0.862551 --0.705287 0 0.911698 --0.641357 0 0.956688 --0.575723 0 0.997544 --0.508884 0 1.03434 --0.441327 0 1.06718 --0.37352 0 1.09621 --0.30591 0 1.12159 --0.238921 0 1.14352 --0.172945 0 1.1622 --0.108344 0 1.17786 --0.0454493 0 1.19074 -0.0154448 0 1.20112 -0.0740786 0 1.20926 -0.130229 0 1.21545 -0.183711 0 1.21996 -0.234375 0 1.22307 -0.282106 0 1.22502 -0.326826 0 1.22606 -0.368488 0 1.22637 -0.407077 0 1.22614 -0.442613 0 1.22577 -0.475153 0 1.22541 -0.504781 0 1.22508 -0.531614 0 1.22477 -0.555801 0 1.22449 -0.577527 0 1.22425 -0.597012 0 1.22406 -0.614511 0 1.22392 -0.630321 0 1.22384 -0.644783 0 1.22381 -0.658288 0 1.22381 -0.671286 0 1.22381 -0.684558 0 1.2248 -0.700415 0 1.2258 -0.723788 0 1.22679 -0.762823 0 1.22779 -0.829801 0 1.2288 -0.942321 0 1.22982 -1.12482 0 1.23086 -1.41053 0 1.23193 -1.84394 0 1.23304 -2.48399 0 1.23416 -3.40797 0 1.23517 -4.7159 0 1.23571 --0.951606 0 -1.68599 --1.0499 0 -1.62596 --1.1469 0 -1.55926 --1.24184 0 -1.48577 --1.33392 0 -1.40542 --1.42236 0 -1.31827 --1.50637 0 -1.22444 --1.5852 0 -1.12416 --1.65813 0 -1.01774 --1.72451 0 -0.905576 --1.78371 0 -0.788017 --1.8351 0 -0.665374 --1.87807 0 -0.538153 --1.91211 0 -0.407104 --1.93679 0 -0.273105 --1.95179 0 -0.137078 --1.95683 0 0 --1.95179 0 0.137078 --1.93679 0 0.273105 --1.91211 0 0.407104 --1.87807 0 0.538153 --1.8351 0 0.665374 --1.78371 0 0.788017 --1.72451 0 0.905576 --1.65813 0 1.01774 --1.5852 0 1.12416 --1.50637 0 1.22444 --1.42236 0 1.31827 --1.33392 0 1.40542 --1.24184 0 1.48577 --1.1469 0 1.55926 --1.0499 0 1.62596 --0.951606 0 1.68599 --0.852773 0 1.73953 --0.754105 0 1.78684 --0.656267 0 1.82821 --0.559875 0 1.86397 --0.465493 0 1.8945 --0.37363 0 1.92018 --0.284737 0 1.94144 --0.19921 0 1.95872 --0.117381 0 1.97245 --0.0395291 0 1.98307 -0.0341266 0 1.99103 -0.103421 0 1.99674 -0.168242 0 2.00058 -0.228528 0 2.00291 -0.284265 0 2.00405 -0.335484 0 2.00429 -0.382264 0 2.00428 -0.424732 0 2.00429 -0.463053 0 2.0043 -0.497432 0 2.00434 -0.528113 0 2.00441 -0.555385 0 2.0045 -0.57958 0 2.00463 -0.601072 0 2.00481 -0.620288 0 2.00503 -0.637702 0 2.00529 -0.653852 0 2.00557 -0.669339 0 2.00586 -0.685171 0 2.00696 -0.704195 0 2.00806 -0.731799 0 2.00915 -0.776378 0 2.01026 -0.850197 0 2.01137 -0.970498 0 2.0125 -1.16092 0 2.01365 -1.45334 0 2.01483 -1.89016 0 2.01605 -2.52732 0 2.01728 -3.43785 0 2.01839 -4.7159 0 2.01898 --1.68691 0 -2.76173 --1.83743 0 -2.66348 --1.98653 0 -2.55423 --2.13296 0 -2.43374 --2.27547 0 -2.30195 --2.41276 0 -2.15891 --2.54354 0 -2.00481 --2.66654 0 -1.84003 --2.78055 0 -1.66507 --2.88441 0 -1.48058 --2.97704 0 -1.2873 --3.0574 0 -1.08601 --3.12455 0 -0.877681 --3.17769 0 -0.663532 --3.21617 0 -0.444908 --3.23949 0 -0.223233 --3.24731 0 0 --3.23949 0 0.223233 --3.21617 0 0.444908 --3.17769 0 0.663532 --3.12455 0 0.877681 --3.0574 0 1.08601 --2.97704 0 1.2873 --2.88441 0 1.48058 --2.78055 0 1.66507 --2.66654 0 1.84003 --2.54354 0 2.00481 --2.41276 0 2.15891 --2.27547 0 2.30195 --2.13296 0 2.43374 --1.98653 0 2.55423 --1.83743 0 2.66348 --1.68691 0 2.76173 --1.53614 0 2.84929 --1.38621 0 2.92658 --1.23817 0 2.99413 --1.09295 0 3.0525 --0.951389 0 3.10233 --0.81425 0 3.1443 --0.682184 0 3.1791 --0.555747 0 3.20746 --0.435399 0 3.2301 --0.321509 0 3.24773 --0.214351 0 3.26104 --0.114117 0 3.27068 --0.0209162 0 3.27729 -0.0652197 0 3.28141 -0.14433 0 3.28356 -0.216521 0 3.28421 -0.281971 0 3.28443 -0.340923 0 3.28466 -0.393678 0 3.2849 -0.440585 0 3.28514 -0.482048 0 3.28541 -0.518527 0 3.28569 -0.550542 0 3.286 -0.578666 0 3.28633 -0.60354 0 3.28669 -0.625867 0 3.28708 -0.646422 0 3.28748 -0.666056 0 3.28788 -0.686154 0 3.28879 -0.710451 0 3.2897 -0.745089 0 3.2906 -0.798878 0 3.29151 -0.884056 0 3.29243 -1.01727 0 3.29337 -1.22084 0 3.29432 -1.52436 0 3.2953 -1.96677 0 3.29631 -2.59898 0 3.29733 -3.48708 0 3.29824 -4.7159 0 3.29872 --2.90799 0 -4.53777 --3.14525 0 -4.37667 --3.38085 0 -4.19734 --3.6128 0 -3.99943 --3.83904 0 -3.7828 --4.05744 0 -3.54753 --4.26587 0 -3.29395 --4.46222 0 -3.02265 --4.6444 0 -2.73447 --4.81045 0 -2.4305 --4.95851 0 -2.11209 --5.08689 0 -1.78082 --5.19409 0 -1.43848 --5.27884 0 -1.08703 --5.34012 0 -0.728623 --5.37719 0 -0.365501 --5.3896 0 0 --5.37719 0 0.365501 --5.34012 0 0.728623 --5.27884 0 1.08703 --5.19409 0 1.43848 --5.08689 0 1.78082 --4.95851 0 2.11209 --4.81045 0 2.4305 --4.6444 0 2.73447 --4.46222 0 3.02265 --4.26587 0 3.29395 --4.05744 0 3.54753 --3.83904 0 3.7828 --3.6128 0 3.99943 --3.38085 0 4.19734 --3.14525 0 4.37667 --2.90799 0 4.53777 --2.67095 0 4.68122 --2.43592 0 4.80771 --2.2045 0 4.91812 --1.97819 0 5.01344 --1.75829 0 5.09472 --1.54597 0 5.16312 --1.34221 0 5.2198 --1.14784 0 5.26595 --0.963531 0 5.30277 --0.789798 0 5.33142 --0.62701 0 5.353 --0.475401 0 5.36859 --0.335076 0 5.37917 --0.206017 0 5.38566 --0.0880976 0 5.38888 -0.018916 0 5.3896 -0.115363 0 5.3896 -0.201685 0 5.3896 -0.278403 0 5.3896 -0.346108 0 5.3896 -0.405469 0 5.3896 -0.457234 0 5.3896 -0.50223 0 5.3896 -0.541367 0 5.3896 -0.575641 0 5.3896 -0.606133 0 5.3896 -0.634015 0 5.3896 -0.660548 0 5.3896 -0.687748 0 5.3896 -0.720812 0 5.3896 -0.767138 0 5.3896 -0.836222 0 5.3896 -0.940257 0 5.3896 -1.0949 0 5.3896 -1.32026 0 5.3896 -1.64214 0 5.3896 -2.0937 0 5.3896 -2.71749 0 5.3896 -3.56817 0 5.3896 -4.7159 0 5.3896 -0.215917 0.113327 -0.0293385 -0.197463 0.113237 -0.0284554 -0.180034 0.113137 -0.0274521 -0.163714 0.113028 -0.0263387 -0.14857 0.11291 -0.0251245 -0.134659 0.112786 -0.0238228 -0.122014 0.112657 -0.0224527 -0.110654 0.112526 -0.0210412 -0.100572 0.112394 -0.0196198 -0.0917397 0.112266 -0.0182201 -0.084128 0.112127 -0.0167004 -0.0777463 0.111951 -0.0147568 -0.0726287 0.111729 -0.0122769 -0.0687518 0.111472 -0.00940529 -0.0660083 0.111198 -0.00634333 -0.0643008 0.110918 -0.00319558 -0.063614 0.110633 0 -0.0643008 0.110918 0.00319558 -0.0660083 0.111198 0.00634333 -0.0687518 0.111472 0.00940529 -0.0726287 0.111729 0.0122769 -0.0777463 0.111951 0.0147568 -0.084128 0.112127 0.0167004 -0.0917397 0.112266 0.0182201 -0.100572 0.112394 0.0196198 -0.110654 0.112526 0.0210412 -0.122014 0.112657 0.0224527 -0.134659 0.112786 0.0238228 -0.14857 0.11291 0.0251245 -0.163714 0.113028 0.0263387 -0.180034 0.113137 0.0274521 -0.197463 0.113237 0.0284554 -0.215917 0.113327 0.0293385 -0.2353 0.113406 0.0300878 -0.255506 0.113472 0.0306836 -0.276418 0.113522 0.0311 -0.297912 0.113552 0.0313071 -0.319859 0.113561 0.031276 -0.342123 0.113545 0.0309841 -0.364567 0.113503 0.0304202 -0.387054 0.113436 0.0295886 -0.40945 0.113344 0.02851 -0.431623 0.11323 0.027219 -0.45345 0.1131 0.0257599 -0.474812 0.112957 0.0241806 -0.495601 0.112805 0.0225261 -0.515714 0.112648 0.0208339 -0.535061 0.11249 0.0191319 -0.553562 0.11233 0.0174377 -0.571151 0.112171 0.0157615 -0.587777 0.112014 0.0141087 -0.603406 0.111858 0.0124831 -0.618025 0.111704 0.0108904 -0.63164 0.111554 0.00933762 -0.644283 0.111408 0.00783375 -0.656008 0.111267 0.00638782 -0.666896 0.111132 0.00500669 -0.677056 0.111003 0.00369347 -0.686624 0.110879 0.00243834 -0.695766 0.110759 0.00121758 -0.704679 0.110639 0 -0.713788 0.110638 0 -0.724526 0.110638 0 -0.741084 0.110637 0 -0.771174 0.110637 0 -0.827023 0.110636 0 -0.926662 0.110636 0 -1.09557 0.110635 0 -1.36878 0.110635 0 -1.79364 0.110634 0 -2.43321 0.110634 0 -3.37085 0.110633 0 -4.7159 0.110633 0 -0.215916 0.113327 -0.0293595 -0.197462 0.113237 -0.0284763 -0.180033 0.113137 -0.0274729 -0.163712 0.113027 -0.0263593 -0.148569 0.11291 -0.025145 -0.134657 0.112786 -0.0238431 -0.122013 0.112657 -0.0224729 -0.110652 0.112526 -0.0210612 -0.10057 0.112394 -0.0196396 -0.0917371 0.112266 -0.0182397 -0.0841244 0.112128 -0.0167196 -0.0777406 0.111952 -0.0147751 -0.0726201 0.11173 -0.0122938 -0.0687402 0.111474 -0.00941996 -0.0659937 0.111201 -0.00635472 -0.0642838 0.110921 -0.00320217 -0.0635965 0.11064 0 -0.0642838 0.110921 0.00320217 -0.0659937 0.111201 0.00635472 -0.0687402 0.111474 0.00941997 -0.0726201 0.11173 0.0122938 -0.0777406 0.111952 0.0147751 -0.0841244 0.112128 0.0167196 -0.0917371 0.112266 0.0182397 -0.10057 0.112394 0.0196396 -0.110652 0.112526 0.0210612 -0.122013 0.112657 0.0224729 -0.134657 0.112786 0.0238431 -0.148569 0.11291 0.025145 -0.163712 0.113027 0.0263593 -0.180033 0.113137 0.0274729 -0.197462 0.113237 0.0284763 -0.215916 0.113327 0.0293595 -0.235299 0.113406 0.0301089 -0.255505 0.113472 0.0307048 -0.276417 0.113521 0.0311212 -0.297912 0.113552 0.0313283 -0.319859 0.113561 0.0312973 -0.342123 0.113545 0.0310055 -0.364567 0.113503 0.0304416 -0.387055 0.113435 0.02961 -0.409451 0.113343 0.0285314 -0.431624 0.11323 0.0272404 -0.453451 0.1131 0.0257813 -0.474814 0.112956 0.024202 -0.495602 0.112805 0.0225474 -0.515716 0.112648 0.0208553 -0.535063 0.112489 0.0191532 -0.553564 0.112329 0.017459 -0.571153 0.112171 0.0157827 -0.587779 0.112013 0.0141298 -0.603409 0.111857 0.0125041 -0.618027 0.111703 0.0109112 -0.631643 0.111553 0.00935838 -0.644285 0.111407 0.00785439 -0.65601 0.111266 0.00640836 -0.666899 0.111131 0.00502714 -0.677059 0.111002 0.00371385 -0.686627 0.110879 0.00245871 -0.695769 0.110758 0.00123799 -0.70468 0.110638 2.0742e-05 -0.713788 0.110637 2.0786e-05 -0.724527 0.110637 2.098e-05 -0.741085 0.110636 2.1359e-05 -0.771175 0.110635 2.2027e-05 -0.827025 0.110635 2.2765e-05 -0.926664 0.110635 2.3163e-05 -1.09557 0.110635 2.3267e-05 -1.36879 0.110634 2.3405e-05 -1.79364 0.110634 2.382e-05 -2.43321 0.110633 2.4718e-05 -3.37086 0.110633 2.6506e-05 -4.7159 0.110634 2.5115e-05 -0.215915 0.113327 -0.0293963 -0.197461 0.113236 -0.0285128 -0.180031 0.113136 -0.0275092 -0.16371 0.113027 -0.0263953 -0.148566 0.11291 -0.0251806 -0.134654 0.112786 -0.0238783 -0.122009 0.112657 -0.0225075 -0.110648 0.112526 -0.0210953 -0.100566 0.112394 -0.0196731 -0.0917327 0.112266 -0.0182725 -0.0841185 0.112128 -0.0167511 -0.0777313 0.111954 -0.0148049 -0.0726064 0.111732 -0.0123209 -0.0687217 0.111477 -0.00944332 -0.0659708 0.111206 -0.00637269 -0.0642573 0.110927 -0.0032125 -0.0635695 0.11065 0 -0.0642573 0.110927 0.0032125 -0.0659708 0.111206 0.00637269 -0.0687217 0.111477 0.00944332 -0.0726064 0.111732 0.0123209 -0.0777313 0.111954 0.0148049 -0.0841185 0.112128 0.0167511 -0.0917327 0.112266 0.0182725 -0.100566 0.112394 0.0196731 -0.110648 0.112526 0.0210953 -0.122009 0.112657 0.0225075 -0.134654 0.112786 0.0238783 -0.148566 0.11291 0.0251806 -0.16371 0.113027 0.0263953 -0.180031 0.113136 0.0275092 -0.197461 0.113236 0.0285128 -0.215915 0.113327 0.0293963 -0.235298 0.113406 0.030146 -0.255504 0.113471 0.030742 -0.276417 0.113521 0.0311586 -0.297912 0.113551 0.0313659 -0.319859 0.11356 0.031335 -0.342124 0.113544 0.0310433 -0.364569 0.113502 0.0304795 -0.387056 0.113434 0.029648 -0.409453 0.113342 0.0285694 -0.431627 0.113229 0.0272785 -0.453454 0.113098 0.0258194 -0.474817 0.112955 0.0242401 -0.495605 0.112803 0.0225855 -0.515719 0.112646 0.0208933 -0.535066 0.112488 0.0191912 -0.553567 0.112328 0.0174969 -0.571157 0.112169 0.0158206 -0.587783 0.112012 0.0141675 -0.603412 0.111856 0.0125418 -0.618031 0.111702 0.0109487 -0.631647 0.111552 0.00939569 -0.64429 0.111406 0.00789155 -0.656015 0.111265 0.00644537 -0.666903 0.111129 0.00506404 -0.677063 0.111001 0.0037507 -0.686632 0.110877 0.0024956 -0.695773 0.110757 0.00127509 -0.704682 0.110637 5.9076e-05 -0.713788 0.110636 5.8567e-05 -0.724528 0.110635 5.8976e-05 -0.741087 0.110634 5.9931e-05 -0.771178 0.110633 6.1682e-05 -0.827029 0.110633 6.3605e-05 -0.926668 0.110633 6.4589e-05 -1.09557 0.110633 6.4791e-05 -1.36879 0.110633 6.5116e-05 -1.79364 0.110633 6.6196e-05 -2.43322 0.110633 6.855e-05 -3.37086 0.110633 7.3214e-05 -4.7159 0.110637 6.6393e-05 -0.215912 0.113326 -0.0294609 -0.197458 0.113236 -0.0285768 -0.180028 0.113135 -0.0275725 -0.163706 0.113026 -0.0264577 -0.148562 0.112909 -0.0252421 -0.134649 0.112785 -0.0239388 -0.122003 0.112657 -0.022567 -0.110642 0.112526 -0.0211535 -0.100559 0.112395 -0.0197299 -0.0917255 0.112267 -0.0183273 -0.0841087 0.112129 -0.0168031 -0.0777162 0.111956 -0.0148532 -0.0725842 0.111737 -0.0123645 -0.0686922 0.111483 -0.00948054 -0.0659344 0.111214 -0.00640114 -0.0642156 0.110937 -0.00322873 -0.0635274 0.110666 0 -0.0642156 0.110937 0.00322873 -0.0659344 0.111214 0.00640114 -0.0686922 0.111483 0.00948054 -0.0725842 0.111737 0.0123645 -0.0777162 0.111956 0.0148532 -0.0841087 0.112129 0.0168031 -0.0917255 0.112267 0.0183273 -0.100559 0.112395 0.0197299 -0.110642 0.112526 0.0211535 -0.122003 0.112657 0.022567 -0.134649 0.112785 0.0239388 -0.148562 0.112909 0.0252421 -0.163706 0.113026 0.0264577 -0.180028 0.113135 0.0275725 -0.197458 0.113236 0.0285768 -0.215912 0.113326 0.0294609 -0.235296 0.113405 0.0302111 -0.255503 0.11347 0.0308076 -0.276416 0.11352 0.0312246 -0.297911 0.11355 0.0314322 -0.319859 0.113559 0.0314017 -0.342125 0.113542 0.0311101 -0.36457 0.1135 0.0305466 -0.387059 0.113432 0.0297152 -0.409456 0.11334 0.0286369 -0.43163 0.113227 0.0273461 -0.453458 0.113096 0.0258871 -0.474821 0.112953 0.0243079 -0.49561 0.112801 0.0226534 -0.515724 0.112644 0.0209612 -0.535072 0.112485 0.019259 -0.553573 0.112326 0.0175647 -0.571163 0.112167 0.0158882 -0.587789 0.112009 0.014235 -0.603419 0.111853 0.0126091 -0.618038 0.111699 0.0110158 -0.631654 0.111549 0.00946258 -0.644297 0.111403 0.00795822 -0.656023 0.111262 0.00651187 -0.666911 0.111127 0.00513046 -0.677072 0.110998 0.00381714 -0.68664 0.110874 0.00256225 -0.695782 0.110754 0.00134235 -0.704687 0.110636 0.000129687 -0.713789 0.110634 0.000127081 -0.724529 0.110632 0.000127618 -0.741091 0.11063 0.000129404 -0.771183 0.110629 0.000132888 -0.827034 0.110629 0.000136775 -0.926675 0.110629 0.000138728 -1.09558 0.110631 0.000139049 -1.3688 0.110631 0.000139637 -1.79365 0.110631 0.000141786 -2.43323 0.110631 0.000146501 -3.37087 0.110632 0.000155796 -4.7159 0.110641 0.000134293 -0.215908 0.113324 -0.0295738 -0.197452 0.113234 -0.0286884 -0.180021 0.113134 -0.0276825 -0.163699 0.113025 -0.026566 -0.148554 0.112908 -0.0253484 -0.13464 0.112785 -0.0240429 -0.121993 0.112657 -0.0226687 -0.110631 0.112526 -0.0212525 -0.100548 0.112395 -0.0198257 -0.091713 0.112268 -0.0184188 -0.0840921 0.112132 -0.0168886 -0.0776914 0.111961 -0.0149316 -0.0725486 0.111744 -0.0124345 -0.0686452 0.111493 -0.00953983 -0.065877 0.111226 -0.00644609 -0.0641501 0.110954 -0.00325418 -0.0634616 0.110692 0 -0.0641501 0.110954 0.00325419 -0.065877 0.111226 0.00644609 -0.0686452 0.111493 0.00953983 -0.0725486 0.111744 0.0124345 -0.0776914 0.111961 0.0149316 -0.0840921 0.112132 0.0168886 -0.091713 0.112268 0.0184188 -0.100548 0.112395 0.0198257 -0.110631 0.112526 0.0212525 -0.121993 0.112657 0.0226687 -0.13464 0.112785 0.0240429 -0.148554 0.112908 0.0253484 -0.163699 0.113025 0.026566 -0.180021 0.113134 0.0276825 -0.197452 0.113234 0.0286884 -0.215908 0.113324 0.0295738 -0.235292 0.113403 0.0303252 -0.2555 0.113469 0.0309227 -0.276414 0.113518 0.0313406 -0.297911 0.113548 0.0315489 -0.31986 0.113556 0.031519 -0.342127 0.11354 0.031228 -0.364573 0.113498 0.030665 -0.387063 0.11343 0.0298341 -0.409461 0.113337 0.0287561 -0.431637 0.113224 0.0274657 -0.453466 0.113093 0.0260071 -0.47483 0.112949 0.0244282 -0.495619 0.112797 0.0227738 -0.515733 0.11264 0.0210818 -0.535081 0.112481 0.0193796 -0.553583 0.112322 0.0176852 -0.571173 0.112162 0.0160086 -0.5878 0.112005 0.0143552 -0.603431 0.111849 0.012729 -0.61805 0.111695 0.0111355 -0.631667 0.111544 0.00958192 -0.644311 0.111398 0.00807733 -0.656037 0.111257 0.00663084 -0.666926 0.111122 0.00524946 -0.677087 0.110993 0.00393641 -0.686655 0.11087 0.00268214 -0.695797 0.11075 0.00146377 -0.704695 0.110633 0.000258961 -0.713789 0.110629 0.000250778 -0.724533 0.110627 0.000251074 -0.741097 0.110624 0.000253957 -0.771191 0.110621 0.000260161 -0.827045 0.110621 0.000267348 -0.926688 0.110623 0.00027101 -1.0956 0.110626 0.000271534 -1.36882 0.110628 0.000272499 -1.79367 0.110628 0.000276354 -2.43324 0.110629 0.000284873 -3.37088 0.110631 0.00030157 -4.7159 0.110649 0.000245909 -0.215899 0.113322 -0.0297701 -0.197442 0.113232 -0.0288818 -0.18001 0.113133 -0.0278727 -0.163686 0.113024 -0.0267525 -0.148539 0.112907 -0.0255309 -0.134624 0.112784 -0.0242209 -0.121976 0.112656 -0.0228416 -0.110613 0.112526 -0.0214198 -0.100528 0.112397 -0.0199867 -0.0916918 0.112271 -0.018571 -0.0840644 0.112137 -0.0170289 -0.0776508 0.111969 -0.0150584 -0.0724912 0.111756 -0.0125464 -0.0685703 0.11151 -0.00963387 -0.0657861 0.111248 -0.00651684 -0.0640474 0.11098 -0.00329395 -0.0633587 0.110732 0 -0.0640474 0.11098 0.00329395 -0.0657861 0.111248 0.00651685 -0.0685703 0.11151 0.00963387 -0.0724912 0.111756 0.0125464 -0.0776508 0.111969 0.0150584 -0.0840645 0.112137 0.0170289 -0.0916918 0.112271 0.018571 -0.100528 0.112397 0.0199867 -0.110613 0.112526 0.0214198 -0.121976 0.112656 0.0228416 -0.134624 0.112784 0.0242209 -0.148539 0.112907 0.0255309 -0.163686 0.113024 0.0267525 -0.18001 0.113133 0.0278727 -0.197442 0.113232 0.0288818 -0.215899 0.113322 0.0297701 -0.235285 0.113401 0.0305239 -0.255494 0.113466 0.0311235 -0.27641 0.113515 0.0315431 -0.297909 0.113545 0.031753 -0.319861 0.113553 0.0317244 -0.342129 0.113536 0.0314346 -0.364579 0.113493 0.0308726 -0.387071 0.113424 0.0300428 -0.409471 0.113332 0.0289657 -0.431649 0.113218 0.0276761 -0.453479 0.113087 0.0262183 -0.474844 0.112943 0.02464 -0.495635 0.112791 0.0229862 -0.51575 0.112633 0.0212945 -0.535099 0.112474 0.0195925 -0.553601 0.112314 0.0178981 -0.571192 0.112155 0.0162214 -0.58782 0.111997 0.0145677 -0.603451 0.111841 0.0129412 -0.618072 0.111687 0.0113473 -0.63169 0.111536 0.00979347 -0.644334 0.11139 0.00828872 -0.656061 0.111249 0.00684229 -0.666951 0.111113 0.0054613 -0.677113 0.110985 0.00414909 -0.686682 0.110861 0.00289643 -0.695824 0.110742 0.0016815 -0.704709 0.110628 0.000493415 -0.713791 0.110621 0.000472625 -0.724539 0.110617 0.000471639 -0.741108 0.110612 0.000475751 -0.771205 0.110608 0.000486074 -0.827063 0.110608 0.000498749 -0.92671 0.110613 0.000505483 -1.09562 0.110619 0.00050643 -1.36884 0.110622 0.000507936 -1.7937 0.110623 0.000514475 -2.43327 0.110625 0.000529043 -3.37091 0.110629 0.000557417 -4.7159 0.110663 0.000429173 -0.215884 0.113319 -0.0301082 -0.197425 0.11323 -0.0292143 -0.17999 0.11313 -0.0281988 -0.163664 0.113022 -0.0270714 -0.148514 0.112906 -0.0258417 -0.134596 0.112784 -0.0245226 -0.121946 0.112657 -0.0231335 -0.11058 0.112528 -0.0217006 -0.100494 0.112401 -0.0202548 -0.0916552 0.112277 -0.018822 -0.0840177 0.112147 -0.0172572 -0.0775841 0.111983 -0.0152621 -0.0723984 0.111777 -0.0127244 -0.0684508 0.111538 -0.00978219 -0.0656428 0.111283 -0.00662755 -0.0638864 0.111024 -0.00335566 -0.0631977 0.110795 0 -0.0638864 0.111024 0.00335567 -0.0656428 0.111283 0.00662756 -0.0684508 0.111538 0.00978219 -0.0723984 0.111777 0.0127244 -0.0775841 0.111983 0.0152621 -0.0840177 0.112146 0.0172572 -0.0916552 0.112277 0.018822 -0.100494 0.112401 0.0202548 -0.11058 0.112528 0.0217006 -0.121946 0.112657 0.0231335 -0.134596 0.112784 0.0245226 -0.148514 0.112906 0.0258417 -0.163664 0.113022 0.0270714 -0.17999 0.11313 0.0281988 -0.197425 0.11323 0.0292143 -0.215884 0.113319 0.0301082 -0.235273 0.113397 0.0308669 -0.255485 0.113462 0.0314707 -0.276404 0.11351 0.0318939 -0.297906 0.11354 0.0321069 -0.319861 0.113547 0.0320809 -0.342134 0.113529 0.0317936 -0.364588 0.113485 0.0312338 -0.387084 0.113416 0.030406 -0.409488 0.113322 0.0293309 -0.431669 0.113208 0.0280431 -0.453502 0.113076 0.0265869 -0.474869 0.112932 0.02501 -0.495662 0.112779 0.0233573 -0.515779 0.112622 0.0216665 -0.535129 0.112462 0.019965 -0.553633 0.112302 0.0182709 -0.571225 0.112142 0.0165941 -0.587854 0.111984 0.0149403 -0.603487 0.111827 0.0133134 -0.61811 0.111673 0.0117192 -0.631729 0.111522 0.0101653 -0.644376 0.111375 0.00866069 -0.656104 0.111234 0.00721491 -0.666996 0.111099 0.00583523 -0.677159 0.11097 0.00452519 -0.68673 0.110847 0.00327616 -0.695871 0.110728 0.00206866 -0.704735 0.110619 0.000913021 -0.713796 0.110607 0.000867026 -0.724553 0.1106 0.000862255 -0.74113 0.110592 0.000867203 -0.771232 0.110586 0.0008834 -0.827095 0.110586 0.000904942 -0.926748 0.110595 0.000917127 -1.09567 0.110605 0.000918974 -1.36889 0.110611 0.000921254 -1.79375 0.110614 0.000931932 -2.43332 0.110618 0.000955949 -3.37095 0.110625 0.0010024 -4.7159 0.110687 0.000729726 -0.215858 0.113314 -0.0306847 -0.197394 0.113226 -0.02978 -0.179955 0.113127 -0.028752 -0.163624 0.11302 -0.0276106 -0.14847 0.112905 -0.0263654 -0.134548 0.112784 -0.0250292 -0.121893 0.112659 -0.0236211 -0.110524 0.112533 -0.0221672 -0.100435 0.112409 -0.0206972 -0.0915912 0.112289 -0.0192323 -0.0839376 0.112164 -0.017626 -0.0774734 0.112009 -0.0155873 -0.0722484 0.111813 -0.0130055 -0.0682604 0.111585 -0.0100144 -0.0654165 0.111341 -0.00679946 -0.0636344 0.111093 -0.00345065 -0.0629452 0.11089 1e-09 -0.0636344 0.111093 0.00345066 -0.0654165 0.111341 0.00679946 -0.0682604 0.111585 0.0100145 -0.0722484 0.111813 0.0130055 -0.0774734 0.112009 0.0155873 -0.0839376 0.112164 0.017626 -0.0915912 0.112289 0.0192323 -0.100435 0.112409 0.0206972 -0.110524 0.112533 0.0221672 -0.121893 0.112659 0.0236211 -0.134548 0.112784 0.0250292 -0.14847 0.112905 0.0263654 -0.163624 0.11302 0.0276106 -0.179955 0.113127 0.028752 -0.197394 0.113226 0.02978 -0.215858 0.113314 0.0306848 -0.235251 0.113392 0.0314529 -0.255467 0.113455 0.0320647 -0.276392 0.113503 0.0324948 -0.2979 0.113531 0.0327138 -0.319862 0.113537 0.0326931 -0.342141 0.113518 0.0324104 -0.364602 0.113473 0.031855 -0.387105 0.113402 0.0310313 -0.409515 0.113307 0.02996 -0.431702 0.113191 0.0286759 -0.45354 0.113059 0.0272231 -0.474912 0.112913 0.0256492 -0.495708 0.11276 0.023999 -0.515827 0.112602 0.0223101 -0.535179 0.112441 0.02061 -0.553686 0.112281 0.0189167 -0.57128 0.11212 0.0172402 -0.587912 0.111961 0.0155864 -0.603548 0.111804 0.0139596 -0.618174 0.111649 0.0123655 -0.631796 0.111498 0.010812 -0.644446 0.11135 0.00930854 -0.656178 0.111209 0.00786481 -0.667072 0.111073 0.00648847 -0.677238 0.110944 0.00518337 -0.686811 0.110822 0.00394212 -0.695952 0.110705 0.00274984 -0.704783 0.110602 0.00165096 -0.71381 0.110584 0.0015606 -0.724581 0.110571 0.0015466 -0.741172 0.110557 0.00155061 -0.771281 0.110547 0.00157436 -0.827152 0.110549 0.00160958 -0.926815 0.110564 0.00163111 -1.09574 0.110583 0.00163482 -1.36897 0.110593 0.00163819 -1.79383 0.110599 0.0016551 -2.4334 0.110606 0.00169354 -3.37102 0.110618 0.00176735 -4.7159 0.110727 0.00122215 -0.215808 0.113307 -0.0316554 -0.197337 0.11322 -0.0307303 -0.179891 0.113123 -0.0296791 -0.163553 0.113017 -0.0285116 -0.148392 0.112904 -0.0272374 -0.134462 0.112786 -0.0258693 -0.1218 0.112665 -0.0244262 -0.110424 0.112543 -0.0229333 -0.10033 0.112424 -0.0214186 -0.0914772 0.112311 -0.0198956 -0.0837981 0.112194 -0.0182163 -0.0772875 0.112052 -0.0161021 -0.0720036 0.111872 -0.0134463 -0.0679553 0.111662 -0.0103753 -0.0650584 0.111434 -0.00706409 -0.0632392 0.111204 -0.00359547 -0.0625477 0.111032 2e-09 -0.0632392 0.111204 0.00359547 -0.0650584 0.111434 0.0070641 -0.0679553 0.111661 0.0103753 -0.0720036 0.111872 0.0134464 -0.0772875 0.112052 0.0161022 -0.0837981 0.112194 0.0182163 -0.0914773 0.112311 0.0198956 -0.10033 0.112424 0.0214187 -0.110424 0.112543 0.0229333 -0.1218 0.112665 0.0244262 -0.134462 0.112786 0.0258693 -0.148392 0.112904 0.0272374 -0.163553 0.113017 0.0285116 -0.179891 0.113123 0.0296791 -0.197337 0.11322 0.0307303 -0.215808 0.113307 0.0316555 -0.235209 0.113383 0.0324412 -0.255434 0.113445 0.0330683 -0.276368 0.113491 0.0335115 -0.297886 0.113517 0.0337417 -0.319859 0.11352 0.0337309 -0.34215 0.113499 0.0334572 -0.364623 0.113451 0.0329101 -0.387138 0.113378 0.0320943 -0.409559 0.113281 0.0310306 -0.431756 0.113164 0.0297536 -0.453602 0.113029 0.0283074 -0.474981 0.112882 0.0267395 -0.495782 0.112728 0.0250944 -0.515906 0.112568 0.0234096 -0.535262 0.112407 0.0217126 -0.553772 0.112245 0.0200214 -0.571371 0.112084 0.0183463 -0.588007 0.111923 0.0166934 -0.603648 0.111765 0.0150675 -0.618279 0.111609 0.0134747 -0.631908 0.111457 0.0119233 -0.644563 0.111309 0.0104233 -0.6563 0.111166 0.00898476 -0.6672 0.11103 0.00761594 -0.677371 0.110901 0.00632131 -0.686949 0.110779 0.00509583 -0.696088 0.110664 0.00393321 -0.704872 0.11057 0.0029213 -0.713851 0.110543 0.00276427 -0.724646 0.110521 0.00273036 -0.741258 0.110499 0.00272855 -0.771375 0.110483 0.00276028 -0.827256 0.110486 0.00281514 -0.926932 0.110513 0.00285198 -1.09587 0.110545 0.00285931 -1.36911 0.110563 0.00286421 -1.79398 0.110573 0.00289021 -2.43354 0.110586 0.00295008 -3.37114 0.110608 0.00306409 -4.7159 0.110795 0.00202831 -0.215716 0.113297 -0.0332667 -0.197233 0.113212 -0.0323044 -0.179774 0.113117 -0.031211 -0.163423 0.113015 -0.0299962 -0.148249 0.112906 -0.0286696 -0.134306 0.112792 -0.0272439 -0.121632 0.112677 -0.0257376 -0.110244 0.112562 -0.0241748 -0.100139 0.112452 -0.0225799 -0.0912687 0.112349 -0.0209551 -0.0835491 0.112247 -0.0191517 -0.0769696 0.112125 -0.0169109 -0.0715994 0.111969 -0.0141322 -0.0674626 0.111784 -0.0109313 -0.0644884 0.11158 -0.00746777 -0.0626161 0.111377 -0.003814 -0.0619176 0.111239 4e-09 -0.0626161 0.111377 0.00381401 -0.0644884 0.11158 0.00746778 -0.0674626 0.111784 0.0109313 -0.0715994 0.111969 0.0141323 -0.0769696 0.112125 0.0169109 -0.0835491 0.112247 0.0191517 -0.0912687 0.112349 0.0209551 -0.100139 0.112452 0.02258 -0.110244 0.112562 0.0241748 -0.121632 0.112677 0.0257377 -0.134306 0.112792 0.0272439 -0.148249 0.112906 0.0286696 -0.163423 0.113015 0.0299962 -0.179774 0.113117 0.031211 -0.197233 0.113212 0.0323044 -0.215716 0.113297 0.0332667 -0.23513 0.11337 0.0340848 -0.255369 0.11343 0.0347397 -0.276318 0.113473 0.0352068 -0.297853 0.113495 0.0354578 -0.319845 0.113495 0.0354654 -0.342156 0.113469 0.0352083 -0.364649 0.113418 0.0346767 -0.387183 0.11334 0.0338756 -0.409623 0.11324 0.0328262 -0.431836 0.113118 0.0315628 -0.453697 0.112981 0.0301293 -0.475087 0.112832 0.0285729 -0.495898 0.112675 0.0269379 -0.51603 0.112514 0.0252613 -0.535393 0.11235 0.0235708 -0.553909 0.112186 0.0218846 -0.571515 0.112023 0.0202133 -0.588159 0.111861 0.0185637 -0.603808 0.1117 0.0169411 -0.618448 0.111543 0.0153525 -0.632085 0.111388 0.0138071 -0.644751 0.111239 0.0123154 -0.656498 0.111095 0.0108884 -0.667408 0.110959 0.00953519 -0.677588 0.11083 0.00826138 -0.687175 0.110709 0.00706621 -0.696311 0.110597 0.0059574 -0.705035 0.110511 0.0050579 -0.71396 0.110474 0.00481963 -0.724793 0.11044 0.00474767 -0.741436 0.110403 0.00472936 -0.771559 0.110377 0.00476559 -0.827445 0.110384 0.00484579 -0.927137 0.110429 0.00490613 -1.0961 0.110483 0.00492012 -1.36935 0.110514 0.00492714 -1.79422 0.11053 0.00496595 -2.43378 0.110553 0.00505662 -3.37133 0.110591 0.00522774 -4.7159 0.110906 0.00334735 -0.215537 0.113283 -0.0358994 -0.197032 0.113202 -0.0348712 -0.179551 0.113112 -0.0337032 -0.163178 0.113015 -0.032405 -0.147981 0.112912 -0.0309862 -0.134015 0.112807 -0.0294595 -0.121319 0.1127 -0.0278425 -0.10991 0.112598 -0.0261571 -0.0997809 0.112502 -0.0244224 -0.0908765 0.112417 -0.0226253 -0.0830927 0.112337 -0.0206187 -0.0764128 0.112244 -0.018171 -0.0709189 0.112124 -0.0151914 -0.0666553 0.111976 -0.011781 -0.0635707 0.111808 -0.00807787 -0.0616234 0.11164 -0.0041404 -0.0609092 0.111537 7e-09 -0.0616234 0.11164 0.00414042 -0.0635707 0.111808 0.0080779 -0.0666553 0.111975 0.011781 -0.0709189 0.112124 0.0151914 -0.0764128 0.112244 0.018171 -0.0830927 0.112337 0.0206188 -0.0908765 0.112417 0.0226254 -0.0997809 0.112502 0.0244224 -0.10991 0.112597 0.0261571 -0.121319 0.1127 0.0278425 -0.134015 0.112807 0.0294596 -0.147981 0.112912 0.0309863 -0.163178 0.113015 0.0324051 -0.179551 0.113112 0.0337033 -0.197032 0.113202 0.0348713 -0.215537 0.113282 0.0358995 -0.234974 0.113352 0.036775 -0.255237 0.113406 0.0374796 -0.276212 0.113444 0.0379896 -0.297776 0.113461 0.038278 -0.319798 0.113454 0.0383187 -0.342142 0.113422 0.0380917 -0.364668 0.113364 0.0375883 -0.387235 0.113281 0.0368142 -0.409705 0.113174 0.0357907 -0.431945 0.113047 0.0345523 -0.453829 0.112905 0.0331423 -0.475239 0.112751 0.0316075 -0.496065 0.112591 0.0299914 -0.51621 0.112426 0.028331 -0.535585 0.112259 0.0266537 -0.554113 0.112092 0.0249782 -0.571729 0.111925 0.023316 -0.588385 0.11176 0.0216748 -0.604048 0.111596 0.0200612 -0.618703 0.111435 0.0184834 -0.632357 0.111278 0.0169519 -0.645039 0.111126 0.0154783 -0.656804 0.110981 0.0140747 -0.667733 0.110843 0.0127515 -0.677933 0.110714 0.0115166 -0.687535 0.110594 0.0103758 -0.696669 0.110487 0.00935353 -0.705339 0.110407 0.00857314 -0.714229 0.110358 0.00825932 -0.725118 0.110307 0.00812602 -0.741808 0.110251 0.00807182 -0.771926 0.11021 0.00810075 -0.8278 0.110222 0.008208 -0.927498 0.110296 0.0083014 -1.09648 0.110385 0.00832684 -1.36974 0.110436 0.00833685 -1.79462 0.110462 0.00839293 -2.43417 0.110501 0.00852617 -3.37166 0.110564 0.00877512 -4.7159 0.111091 0.00550466 -0.215177 0.113263 -0.0401283 -0.196633 0.113189 -0.0389863 -0.179114 0.113107 -0.0376899 -0.162701 0.113019 -0.0362486 -0.147464 0.112928 -0.034672 -0.133457 0.112835 -0.0329725 -0.120719 0.112745 -0.0311664 -0.109266 0.112661 -0.0292721 -0.0990892 0.112588 -0.0273003 -0.0901191 0.112531 -0.0252219 -0.082234 0.112485 -0.0228941 -0.0754109 0.112437 -0.0201175 -0.0697451 0.112367 -0.0168147 -0.0653054 0.112271 -0.013069 -0.0620674 0.112153 -0.00899165 -0.0600167 0.112032 -0.00462322 -0.0592734 0.111962 1.7e-08 -0.0600167 0.112032 0.00462326 -0.0620674 0.112153 0.00899171 -0.0653054 0.112271 0.0130691 -0.0697451 0.112367 0.0168147 -0.0754109 0.112436 0.0201176 -0.082234 0.112485 0.0228941 -0.0901191 0.112531 0.025222 -0.0990892 0.112588 0.0273004 -0.109266 0.112661 0.0292722 -0.120719 0.112745 0.0311665 -0.133457 0.112835 0.0329726 -0.147464 0.112927 0.0346721 -0.162701 0.113019 0.0362487 -0.179114 0.113107 0.03769 -0.196633 0.113189 0.0389864 -0.215177 0.113262 0.0401284 -0.234653 0.113324 0.0411036 -0.254958 0.113372 0.0418948 -0.275979 0.113401 0.0424801 -0.297591 0.113409 0.0428343 -0.319664 0.113393 0.0429335 -0.342061 0.113351 0.0427601 -0.364641 0.113282 0.0423067 -0.38726 0.113188 0.0415805 -0.409779 0.113072 0.0406032 -0.432063 0.112937 0.0394091 -0.453985 0.112787 0.0380412 -0.475427 0.112627 0.0365451 -0.49628 0.11246 0.0349637 -0.516447 0.11229 0.0333335 -0.535841 0.112117 0.0316821 -0.554387 0.111945 0.0300287 -0.572022 0.111773 0.0283863 -0.588698 0.111602 0.0267642 -0.604383 0.111433 0.0251712 -0.619063 0.111267 0.0236173 -0.632744 0.111106 0.0221147 -0.645457 0.11095 0.0206768 -0.657256 0.110801 0.019317 -0.668222 0.110661 0.0180475 -0.678459 0.110531 0.0168792 -0.688096 0.110412 0.0158252 -0.697244 0.110309 0.0149184 -0.705909 0.11023 0.014243 -0.714826 0.11017 0.0138785 -0.725812 0.110099 0.0136682 -0.742572 0.110016 0.0135514 -0.77266 0.109955 0.013548 -0.82847 0.109975 0.013673 -0.928136 0.110094 0.0138072 -1.09711 0.110236 0.0138509 -1.3704 0.110316 0.0138652 -1.79527 0.110358 0.0139435 -2.43479 0.110422 0.0141329 -3.37217 0.110524 0.0144828 -4.7159 0.111395 0.00903198 -0.214434 0.113236 -0.0467991 -0.19582 0.113174 -0.0454654 -0.17823 0.113105 -0.0439537 -0.161745 0.113033 -0.0422733 -0.146434 0.112959 -0.0404336 -0.13235 0.112888 -0.0384463 -0.119532 0.112823 -0.0363256 -0.107994 0.11277 -0.0340845 -0.0977191 0.112734 -0.031724 -0.0886276 0.112719 -0.0292009 -0.0805842 0.112726 -0.0263803 -0.0735607 0.11274 -0.0230945 -0.0676637 0.112742 -0.0192808 -0.0629891 0.112719 -0.0150049 -0.0595473 0.112669 -0.0103479 -0.0573589 0.112604 -0.0053311 -0.0565705 0.112561 3.7e-08 -0.0573589 0.112604 0.00533119 -0.0595473 0.112669 0.010348 -0.0629891 0.112719 0.0150051 -0.0676637 0.112742 0.019281 -0.0735607 0.11274 0.0230947 -0.0805842 0.112726 0.0263804 -0.0886277 0.112719 0.0292011 -0.0977191 0.112733 0.0317241 -0.107994 0.112769 0.0340847 -0.119532 0.112823 0.0363257 -0.13235 0.112887 0.0384464 -0.146434 0.112958 0.0404337 -0.161745 0.113032 0.0422735 -0.17823 0.113105 0.0439539 -0.19582 0.113174 0.0454656 -0.214434 0.113235 0.0467994 -0.233981 0.113285 0.0479436 -0.254359 0.113321 0.0488828 -0.275456 0.113337 0.0495973 -0.29715 0.113332 0.0500654 -0.319308 0.113301 0.0502665 -0.341792 0.113244 0.0501862 -0.364458 0.11316 0.0498199 -0.387161 0.113051 0.0491767 -0.409758 0.112921 0.0482792 -0.432113 0.112773 0.0471617 -0.454097 0.112611 0.0458663 -0.475591 0.112441 0.0444375 -0.496488 0.112265 0.0429173 -0.516693 0.112086 0.0413416 -0.536119 0.111905 0.0397383 -0.554696 0.111725 0.0381281 -0.572363 0.111544 0.0365258 -0.589074 0.111365 0.0349436 -0.604797 0.111188 0.033393 -0.61952 0.111014 0.0318867 -0.633251 0.110845 0.0304391 -0.646021 0.110683 0.0290652 -0.657884 0.110529 0.0277799 -0.668923 0.110385 0.0265967 -0.67924 0.110252 0.0255286 -0.688958 0.110133 0.0245906 -0.698186 0.110029 0.0238066 -0.706955 0.109946 0.0232145 -0.71602 0.109874 0.0228281 -0.727188 0.109782 0.0225477 -0.74407 0.109672 0.0223465 -0.774095 0.109586 0.022273 -0.829733 0.109618 0.0223865 -0.929269 0.109802 0.022561 -1.09819 0.11002 0.0226312 -1.37145 0.110144 0.022652 -1.79632 0.110208 0.022757 -2.43578 0.110307 0.0230168 -3.37298 0.11047 0.02349 -4.7159 0.111895 0.0147982 -0.212868 0.1132 -0.0571309 -0.194123 0.113159 -0.0554808 -0.176401 0.113111 -0.053616 -0.159781 0.113063 -0.0515451 -0.144329 0.113018 -0.0492769 -0.1301 0.112981 -0.0468217 -0.117127 0.112958 -0.0441905 -0.105423 0.112952 -0.0413903 -0.0949625 0.112972 -0.0384128 -0.0856585 0.113024 -0.0352075 -0.0773713 0.113108 -0.0316475 -0.0700713 0.113212 -0.0275898 -0.0638741 0.113313 -0.0229845 -0.0589022 0.113388 -0.0178832 -0.0552054 0.113425 -0.0123403 -0.0528444 0.113425 -0.00635964 -0.0519953 0.113407 8.2e-08 -0.0528444 0.113425 0.00635982 -0.0552054 0.113425 0.0123405 -0.0589022 0.113388 0.0178835 -0.0638741 0.113313 0.0229847 -0.0700713 0.113212 0.02759 -0.0773713 0.113107 0.0316478 -0.0856585 0.113023 0.0352078 -0.0949625 0.112972 0.0384131 -0.105423 0.112952 0.0413905 -0.117127 0.112957 0.0441907 -0.1301 0.112981 0.046822 -0.144329 0.113018 0.0492772 -0.159781 0.113062 0.0515454 -0.176401 0.113111 0.0536163 -0.194123 0.113158 0.0554811 -0.212868 0.1132 0.0571312 -0.232546 0.113232 0.0585565 -0.253057 0.113249 0.0597438 -0.27429 0.113247 0.0606772 -0.296122 0.113222 0.0613394 -0.318422 0.113171 0.0617149 -0.341048 0.113093 0.0617939 -0.363855 0.112988 0.0615763 -0.386693 0.112858 0.0610738 -0.409417 0.112708 0.0603106 -0.431886 0.112542 0.0593213 -0.453971 0.112364 0.0581472 -0.475554 0.112178 0.0568316 -0.496526 0.111988 0.0554155 -0.516796 0.111796 0.0539345 -0.536283 0.111603 0.0524174 -0.554916 0.11141 0.0508869 -0.57264 0.111217 0.0493609 -0.589413 0.111026 0.0478549 -0.605205 0.110837 0.046384 -0.620008 0.110651 0.0449636 -0.633833 0.110472 0.04361 -0.646713 0.1103 0.0423393 -0.658706 0.110138 0.0411661 -0.669893 0.109987 0.0401033 -0.680381 0.109849 0.0391612 -0.690291 0.109724 0.0383485 -0.699743 0.109614 0.0376734 -0.708791 0.109522 0.0371469 -0.718184 0.109436 0.0367602 -0.729691 0.109326 0.0364348 -0.746811 0.109192 0.03615 -0.776768 0.109087 0.0359703 -0.832065 0.109137 0.0360202 -0.931262 0.109406 0.0362157 -1.09998 0.109731 0.03632 -1.37315 0.109914 0.0363509 -1.79796 0.110007 0.0364861 -2.43732 0.110156 0.0368293 -3.37422 0.110406 0.037443 -4.7159 0.112717 0.024223 -0.209555 0.113166 -0.0728587 -0.190559 0.113154 -0.0706944 -0.172582 0.113141 -0.0682599 -0.155699 0.113132 -0.0655623 -0.139977 0.113133 -0.0626091 -0.125466 0.113151 -0.0594084 -0.112197 0.11319 -0.0559678 -0.10018 0.113259 -0.0522896 -0.0893854 0.113364 -0.0483611 -0.0797278 0.113514 -0.0441301 -0.0710729 0.113711 -0.039474 -0.0633958 0.113943 -0.0342627 -0.0568203 0.114178 -0.0284558 -0.0514924 0.114382 -0.0220988 -0.047499 0.114529 -0.0152285 -0.0449394 0.114602 -0.00783728 -0.0440181 0.114604 1.81e-07 -0.0449394 0.114602 0.00783766 -0.047499 0.114528 0.0152289 -0.0514924 0.114381 0.0220992 -0.0568203 0.114177 0.0284563 -0.0633959 0.113942 0.0342632 -0.0710729 0.11371 0.0394745 -0.0797278 0.113513 0.0441305 -0.0893854 0.113363 0.0483615 -0.10018 0.113258 0.0522901 -0.112197 0.113189 0.0559683 -0.125466 0.11315 0.0594089 -0.139977 0.113132 0.0626096 -0.155699 0.113131 0.0655629 -0.172582 0.11314 0.0682605 -0.190559 0.113153 0.070695 -0.209555 0.113164 0.0728593 -0.229481 0.113169 0.0747455 -0.250238 0.113159 0.0763441 -0.271717 0.113131 0.077644 -0.293795 0.11308 0.0786339 -0.31634 0.113002 0.0793049 -0.339208 0.112896 0.079654 -0.362248 0.112764 0.0796865 -0.38531 0.112608 0.0794185 -0.408243 0.112433 0.078877 -0.430905 0.112242 0.0780975 -0.453163 0.112043 0.077121 -0.474899 0.111836 0.0759904 -0.496008 0.111627 0.074746 -0.516401 0.111417 0.0734241 -0.536001 0.111206 0.0720551 -0.554745 0.110995 0.0706645 -0.572582 0.110785 0.0692737 -0.589475 0.110576 0.0679018 -0.605403 0.110371 0.0665671 -0.620364 0.11017 0.0652867 -0.634373 0.109976 0.0640774 -0.647471 0.109791 0.0629538 -0.659719 0.109616 0.061928 -0.671203 0.109454 0.0610086 -0.682032 0.109304 0.0602002 -0.692333 0.109169 0.0595041 -0.702232 0.109048 0.0589192 -0.711794 0.108943 0.058447 -0.721752 0.108846 0.0580721 -0.733834 0.108724 0.0577255 -0.751411 0.108578 0.0573779 -0.781411 0.108467 0.0570801 -0.836197 0.108547 0.0570062 -0.934714 0.108922 0.0571777 -1.10294 0.109383 0.0573182 -1.37585 0.109643 0.0573648 -1.80051 0.109771 0.0575318 -2.43967 0.109984 0.0579684 -3.37608 0.110355 0.0587309 -4.7159 0.114065 0.0396265 -0.202586 0.113178 -0.0964788 -0.183096 0.113212 -0.0934822 -0.164614 0.113252 -0.0901332 -0.147214 0.113305 -0.0864366 -0.13096 0.113378 -0.0823979 -0.115904 0.113479 -0.0780234 -0.102077 0.113615 -0.0733193 -0.0894887 0.113795 -0.0682874 -0.0781189 0.114026 -0.0629168 -0.067892 0.114319 -0.0571564 -0.0586898 0.114677 -0.0508813 -0.0504988 0.115084 -0.0439636 -0.043452 0.115499 -0.0363709 -0.0377125 0.11587 -0.0281535 -0.033394 0.11615 -0.0193435 -0.0306221 0.116304 -0.0099287 -0.0296221 0.116324 3.96e-07 -0.0306221 0.116304 0.0099295 -0.033394 0.11615 0.0193444 -0.0377125 0.115869 0.0281544 -0.043452 0.115499 0.0363718 -0.0504988 0.115083 0.0439645 -0.0586898 0.114675 0.0508822 -0.067892 0.114317 0.0571573 -0.0781189 0.114025 0.0629177 -0.0894887 0.113793 0.0682883 -0.102077 0.113613 0.0733202 -0.115904 0.113477 0.0780243 -0.13096 0.113376 0.0823988 -0.147214 0.113303 0.0864376 -0.164614 0.11325 0.0901343 -0.183096 0.11321 0.0934832 -0.202586 0.113175 0.0964799 -0.222995 0.113138 0.0991197 -0.244227 0.11309 0.101398 -0.266171 0.113026 0.103309 -0.288705 0.11294 0.10485 -0.311693 0.112828 0.10602 -0.334991 0.112689 0.106825 -0.358444 0.112524 0.107276 -0.381896 0.112337 0.107396 -0.405195 0.112131 0.107217 -0.428196 0.111912 0.106777 -0.450766 0.111684 0.106119 -0.472787 0.111452 0.105286 -0.494159 0.111217 0.104319 -0.514795 0.110983 0.103257 -0.534626 0.110748 0.102133 -0.553596 0.110515 0.100975 -0.571666 0.110283 0.0998088 -0.588807 0.110052 0.0986552 -0.605009 0.109826 0.0975338 -0.62028 0.109606 0.096462 -0.634646 0.109393 0.095454 -0.648154 0.10919 0.0945215 -0.660873 0.108998 0.0936721 -0.672892 0.10882 0.0929099 -0.684322 0.108656 0.0922354 -0.695292 0.108507 0.0916464 -0.705928 0.108373 0.0911397 -0.716296 0.108259 0.0907142 -0.727118 0.108155 0.0903537 -0.740092 0.108029 0.0899963 -0.758473 0.107889 0.0896052 -0.788825 0.107798 0.0892053 -0.843105 0.107926 0.0889716 -0.940541 0.108419 0.0890541 -1.10781 0.109042 0.0892189 -1.38013 0.109397 0.0892881 -1.80444 0.109562 0.0894865 -2.44323 0.10985 0.090024 -3.37886 0.110383 0.0909337 -4.7159 0.116274 0.0647995 -0.188114 0.113405 -0.13174 -0.16763 0.113511 -0.127386 -0.148131 0.113633 -0.122558 -0.129697 0.113781 -0.11726 -0.112398 0.113963 -0.111495 -0.0962899 0.114189 -0.105273 -0.081418 0.114467 -0.0986022 -0.0678067 0.114807 -0.0914924 -0.0554542 0.115217 -0.08394 -0.0443083 0.115708 -0.0758974 -0.0342745 0.116285 -0.0672317 -0.025355 0.116926 -0.0578111 -0.0176908 0.117573 -0.0476142 -0.0114516 0.118151 -0.036706 -0.00676034 0.118589 -0.0251237 -0.00375166 0.11883 -0.0128531 -0.00266078 0.118863 8.42e-07 -0.00375165 0.11883 0.0128548 -0.00676031 0.118588 0.0251255 -0.0114516 0.11815 0.0367078 -0.0176908 0.117572 0.0476161 -0.025355 0.116924 0.0578129 -0.0342744 0.116283 0.0672334 -0.0443082 0.115706 0.0758991 -0.055454 0.115215 0.0839418 -0.0678065 0.114804 0.0914941 -0.0814177 0.114465 0.098604 -0.0962896 0.114186 0.105275 -0.112397 0.11396 0.111497 -0.129697 0.113778 0.117262 -0.148131 0.11363 0.12256 -0.16763 0.113507 0.127387 -0.188114 0.113401 0.131742 -0.209493 0.113301 0.135621 -0.231668 0.113198 0.139028 -0.254527 0.113084 0.141964 -0.277943 0.112951 0.144434 -0.30178 0.112796 0.146448 -0.325889 0.112617 0.14802 -0.350114 0.112413 0.149174 -0.374297 0.112188 0.149939 -0.398282 0.111947 0.150355 -0.421925 0.111694 0.150466 -0.445093 0.111434 0.150319 -0.467672 0.11117 0.149961 -0.489567 0.110906 0.149438 -0.510698 0.110642 0.148792 -0.531006 0.11038 0.148058 -0.550447 0.11012 0.147269 -0.568992 0.109862 0.146452 -0.586629 0.109607 0.14563 -0.603361 0.109358 0.144821 -0.619208 0.109115 0.144041 -0.63421 0.108881 0.143301 -0.648421 0.108659 0.142609 -0.661916 0.108449 0.141971 -0.674788 0.108255 0.141387 -0.68715 0.108076 0.140857 -0.699129 0.107914 0.14038 -0.710854 0.107772 0.139951 -0.722391 0.107652 0.139572 -0.734459 0.107548 0.139226 -0.748751 0.107429 0.13886 -0.768437 0.10731 0.138437 -0.799726 0.107264 0.137963 -0.853916 0.107466 0.137583 -0.950078 0.108082 0.137522 -1.11578 0.108878 0.137678 -1.38697 0.109343 0.137774 -1.81057 0.109545 0.138003 -2.44867 0.109916 0.138648 -3.38299 0.110663 0.139695 -4.7159 0.119895 0.105937 -0.158618 0.11437 -0.184716 -0.13613 0.114584 -0.178136 -0.114597 0.114829 -0.170904 -0.0941157 0.115115 -0.163025 -0.0747791 0.115454 -0.15451 -0.0566711 0.115853 -0.145375 -0.0398654 0.116324 -0.135646 -0.0244198 0.116875 -0.125347 -0.0103658 0.117516 -0.114489 --0.00231661 0.118259 -0.103029 --0.0136951 0.119111 -0.0908228 --0.023752 0.120041 -0.077729 --0.0323441 0.120969 -0.0637379 --0.0393075 0.121789 -0.0489345 --0.0445262 0.1224 -0.033365 --0.0478705 0.122727 -0.017013 --0.0490956 0.122762 1.725e-06 --0.0478705 0.122727 0.0170164 --0.0445263 0.122399 0.0333685 --0.0393076 0.121787 0.0489381 --0.0323443 0.120967 0.0637415 --0.0237522 0.120039 0.0777326 --0.0136954 0.119109 0.0908264 --0.00231699 0.118256 0.103033 -0.0103653 0.117512 0.114492 -0.0244193 0.116871 0.125351 -0.0398648 0.116319 0.13565 -0.0566703 0.115848 0.145379 -0.0747783 0.115448 0.154513 -0.094115 0.11511 0.163029 -0.114596 0.114823 0.170908 -0.136129 0.114578 0.17814 -0.158617 0.114363 0.18472 -0.181957 0.114168 0.19065 -0.206035 0.11398 0.195936 -0.230731 0.113791 0.200588 -0.255912 0.113591 0.204621 -0.281436 0.113375 0.208055 -0.30715 0.11314 0.210917 -0.332895 0.112885 0.213244 -0.358513 0.112613 0.215078 -0.383849 0.112327 0.216468 -0.408761 0.112033 0.21747 -0.433121 0.111733 0.218139 -0.45682 0.111433 0.218532 -0.479771 0.111133 0.218701 -0.501907 0.110837 0.218694 -0.523178 0.110544 0.218552 -0.543556 0.110255 0.218312 -0.563026 0.10997 0.218004 -0.581592 0.109691 0.217651 -0.599273 0.109419 0.217272 -0.616105 0.109155 0.216882 -0.632139 0.108903 0.216491 -0.647444 0.108663 0.216107 -0.662104 0.108438 0.215734 -0.676219 0.108229 0.215375 -0.689911 0.108039 0.21503 -0.703314 0.107868 0.214699 -0.716565 0.107719 0.214381 -0.729742 0.107598 0.214076 -0.743573 0.107498 0.213772 -0.759779 0.107392 0.213423 -0.781499 0.107303 0.213003 -0.814657 0.107315 0.212513 -0.869789 0.107604 0.212061 -0.965162 0.108337 0.211869 -1.12885 0.109297 0.211976 -1.39813 0.109889 0.212101 -1.82037 0.11013 0.212364 -2.45717 0.110587 0.213123 -3.38929 0.111624 0.214283 -4.7159 0.125827 0.173161 -0.100878 0.117406 -0.266346 -0.0745777 0.117766 -0.256219 -0.0492232 0.118169 -0.245185 -0.0249559 0.118627 -0.233255 -0.00191481 0.119149 -0.220452 --0.0197662 0.119747 -0.20681 --0.0399637 0.120429 -0.19237 --0.0585723 0.121209 -0.177178 --0.0755166 0.122099 -0.16126 --0.0907784 0.123119 -0.144575 --0.104397 0.124277 -0.126958 --0.116341 0.12553 -0.108251 --0.12647 0.126769 -0.088455 --0.134634 0.127847 -0.0676839 --0.140734 0.128629 -0.0459991 --0.144649 0.129017 -0.0233876 --0.146107 0.129026 3.393e-06 --0.144649 0.129016 0.0233945 --0.140735 0.128628 0.046006 --0.134634 0.127845 0.0676909 --0.12647 0.126767 0.0884621 --0.116342 0.125527 0.108258 --0.104398 0.124273 0.126965 --0.0907793 0.123114 0.144583 --0.0755177 0.122094 0.161267 --0.0585736 0.121203 0.177185 --0.0399651 0.120422 0.192378 --0.0197678 0.119739 0.206817 -0.00191316 0.119141 0.220459 -0.0249542 0.118618 0.233263 -0.0492215 0.118159 0.245192 -0.0745761 0.117755 0.256227 -0.100877 0.117394 0.266353 -0.127981 0.117065 0.275571 -0.155745 0.116754 0.283888 -0.184019 0.116452 0.291319 -0.21265 0.116149 0.297888 -0.24148 0.115838 0.303628 -0.270345 0.115516 0.308581 -0.299081 0.115181 0.312797 -0.327527 0.114836 0.316337 -0.355528 0.114483 0.319265 -0.382948 0.114127 0.321652 -0.409664 0.113772 0.323571 -0.435578 0.113421 0.325092 -0.460612 0.113076 0.326279 -0.484711 0.112738 0.327193 -0.507841 0.112408 0.327887 -0.529987 0.112086 0.328405 -0.551153 0.111772 0.328783 -0.571361 0.111467 0.329052 -0.590649 0.111172 0.329235 -0.609072 0.110889 0.329351 -0.626703 0.110618 0.329414 -0.643631 0.110363 0.329436 -0.659963 0.110123 0.329423 -0.675823 0.109902 0.329383 -0.691352 0.1097 0.329318 -0.706713 0.10952 0.329231 -0.722069 0.109364 0.329122 -0.737525 0.109239 0.328991 -0.75385 0.10914 0.328829 -0.772828 0.109042 0.328605 -0.797645 0.108976 0.328308 -0.834064 0.109036 0.327948 -0.891919 0.109392 0.327603 -0.988172 0.110204 0.327438 -1.15028 0.11129 0.327541 -1.41686 0.112019 0.327725 -1.83665 0.11232 0.328054 -2.471 0.112875 0.328942 -3.39925 0.114344 0.330157 -4.7159 0.135541 0.283012 --0.00351805 0.125225 -0.397658 --0.0362939 0.125709 -0.38213 --0.0680673 0.126235 -0.365282 --0.0986314 0.126813 -0.347126 --0.127781 0.127457 -0.327688 --0.155316 0.128178 -0.307013 --0.181048 0.128992 -0.285159 --0.204812 0.129917 -0.262186 --0.226472 0.130979 -0.238142 --0.245961 0.132212 -0.21299 --0.263277 0.133634 -0.186542 --0.278363 0.135188 -0.15863 --0.291079 0.13672 -0.129283 --0.30129 0.138028 -0.0986663 --0.30891 0.138928 -0.0668765 --0.313815 0.139303 -0.0339188 --0.315672 0.139224 6.426e-06 --0.313815 0.139302 0.0339317 --0.308911 0.138926 0.0668897 --0.301291 0.138025 0.0986798 --0.291081 0.136716 0.129297 --0.278365 0.135183 0.158644 --0.263278 0.133627 0.186557 --0.245963 0.132204 0.213004 --0.226474 0.13097 0.238156 --0.204814 0.129907 0.262201 --0.181051 0.12898 0.285174 --0.155318 0.128165 0.307029 --0.127783 0.127443 0.327705 --0.0986338 0.126798 0.347142 --0.0680695 0.126218 0.365299 --0.0362959 0.125691 0.382147 --0.00351972 0.125205 0.397676 -0.0300542 0.124749 0.411887 -0.0642233 0.124311 0.424797 -0.0987875 0.123882 0.436432 -0.133548 0.123453 0.44683 -0.16831 0.123017 0.456039 -0.20288 0.122574 0.464121 -0.237072 0.122122 0.471146 -0.270711 0.121666 0.477197 -0.303634 0.121209 0.482364 -0.335701 0.120756 0.48674 -0.366793 0.120312 0.490422 -0.396817 0.11988 0.493504 -0.425704 0.119462 0.496074 -0.453412 0.119059 0.498215 -0.47992 0.118671 0.499999 -0.505232 0.118299 0.50149 -0.529372 0.117941 0.502741 -0.552385 0.117598 0.503796 -0.574335 0.11727 0.504689 -0.595309 0.116958 0.50545 -0.615411 0.116662 0.506101 -0.63477 0.116384 0.506664 -0.653532 0.116125 0.507152 -0.671865 0.115885 0.507577 -0.689961 0.115666 0.507948 -0.708034 0.115469 0.508271 -0.726308 0.115299 0.508548 -0.744954 0.11516 0.508777 -0.764818 0.115051 0.508955 -0.787806 0.114945 0.509072 -0.817249 0.11488 0.509145 -0.858907 0.114951 0.509205 -0.922112 0.115318 0.509309 -1.02239 0.116126 0.509541 -1.18529 0.117242 0.509931 -1.44931 0.118095 0.510365 -1.86512 0.118506 0.510904 -2.49476 0.119212 0.511969 -3.41589 0.12142 0.513099 -4.7159 0.151451 0.462518 --0.178556 0.142394 -0.615143 --0.221745 0.142828 -0.591178 --0.263828 0.143279 -0.565144 --0.304508 0.143761 -0.537039 --0.343491 0.14429 -0.506886 --0.380483 0.144885 -0.474734 --0.415204 0.145572 -0.440661 --0.447393 0.146385 -0.40476 --0.476826 0.14737 -0.367116 --0.503343 0.14859 -0.32772 --0.526867 0.150085 -0.286389 --0.547291 0.151782 -0.242969 --0.564449 0.153463 -0.197561 --0.578201 0.154853 -0.150421 --0.588461 0.155713 -0.101708 --0.595072 0.155913 -0.0514677 --0.597595 0.155632 1.1586e-05 --0.595073 0.155911 0.0514911 --0.588462 0.15571 0.101732 --0.578203 0.154849 0.150446 --0.56445 0.153457 0.197587 --0.547293 0.151774 0.242996 --0.52687 0.150075 0.286417 --0.503345 0.148578 0.327749 --0.476828 0.147356 0.367146 --0.447396 0.146368 0.404792 --0.415206 0.145553 0.440694 --0.380485 0.144863 0.474769 --0.343492 0.144265 0.506922 --0.304509 0.143733 0.537077 --0.263827 0.143248 0.565184 --0.221744 0.142794 0.59122 --0.178553 0.142357 0.615186 --0.134544 0.141923 0.637108 --0.0899997 0.141483 0.657028 --0.0451929 0.141026 0.675006 --0.000388208 0.140547 0.691113 -0.0441597 0.140043 0.705434 -0.0882083 0.139515 0.718071 -0.13153 0.138968 0.729132 -0.173916 0.138409 0.738742 -0.21518 0.137845 0.74703 -0.255165 0.137285 0.754134 -0.293743 0.136736 0.76019 -0.330818 0.136203 0.765334 -0.366324 0.13569 0.769694 -0.400228 0.135199 0.773391 -0.432526 0.13473 0.776533 -0.463239 0.134284 0.779218 -0.492418 0.13386 0.781527 -0.520138 0.133459 0.78353 -0.546501 0.133081 0.785282 -0.571636 0.132724 0.786828 -0.595697 0.13239 0.788205 -0.618869 0.132079 0.789445 -0.64136 0.13179 0.790573 -0.663412 0.131523 0.791612 -0.685297 0.13128 0.792577 -0.707321 0.13106 0.793482 -0.729816 0.130867 0.794333 -0.753073 0.130706 0.795128 -0.778084 0.130576 0.795876 -0.806953 0.130448 0.796595 -0.843261 0.130361 0.797338 -0.892937 0.130405 0.798169 -0.965083 0.130716 0.799145 -1.07403 0.131412 0.80029 -1.24271 0.132418 0.801545 -1.50696 0.133326 0.802761 -1.91764 0.133933 0.80393 -2.53842 0.134963 0.805347 -3.4458 0.138602 0.806113 -4.7159 0.177503 0.755845 --0.465338 0.17642 -0.975787 --0.525493 0.176408 -0.938071 --0.584407 0.17636 -0.896984 --0.641651 0.176296 -0.852498 --0.696788 0.176239 -0.804625 --0.749379 0.176221 -0.753426 --0.798991 0.176281 -0.699007 --0.84521 0.176476 -0.641513 --0.887655 0.176884 -0.581098 --0.926013 0.17761 -0.517827 --0.960067 0.178731 -0.451571 --0.989597 0.18016 -0.382263 --1.01436 0.181615 -0.310143 --1.03419 0.182744 -0.235612 --1.04894 0.183257 -0.15894 --1.05839 0.183033 -0.0802545 --1.06197 0.182415 1.9123e-05 --1.05839 0.18303 0.0802934 --1.04894 0.183253 0.15898 --1.03419 0.182737 0.235654 --1.01437 0.181606 0.310187 --0.989599 0.180147 0.38231 --0.960069 0.178715 0.451621 --0.926015 0.17759 0.517881 --0.887657 0.17686 0.581156 --0.845211 0.176448 0.641576 --0.79899 0.176248 0.699075 --0.749375 0.176183 0.753499 --0.696782 0.176196 0.804704 --0.641642 0.176247 0.852582 --0.584393 0.176304 0.897075 --0.525474 0.176345 0.938168 --0.465314 0.176349 0.97589 --0.404328 0.1763 1.01031 --0.342915 0.176185 1.04151 --0.281457 0.175995 1.06961 --0.220314 0.175728 1.09476 --0.159829 0.175384 1.11711 --0.100317 0.17497 1.13682 --0.042071 0.174497 1.15408 -0.0146489 0.173977 1.1691 -0.0696167 0.173424 1.18207 -0.122645 0.172852 1.19321 -0.173586 0.172272 1.20273 -0.222337 0.171696 1.21083 -0.268835 0.171131 1.2177 -0.313055 0.170582 1.22355 -0.355013 0.170053 1.22852 -0.394761 0.169548 1.23278 -0.432384 0.169068 1.23646 -0.468005 0.168615 1.23968 -0.501779 0.16819 1.2425 -0.533897 0.167793 1.24503 -0.564587 0.167423 1.24731 -0.594112 0.167081 1.24938 -0.622777 0.166765 1.2513 -0.650926 0.166475 1.25309 -0.678955 0.16621 1.25479 -0.707313 0.16597 1.25642 -0.736499 0.165757 1.25799 -0.76701 0.165575 1.25952 -0.800074 0.165423 1.26102 -0.838096 0.16527 1.26254 -0.885014 0.165155 1.26418 -0.947054 0.165156 1.26603 -1.03329 0.165375 1.26816 -1.15718 0.165895 1.27061 -1.33909 0.166691 1.27329 -1.61019 0.167571 1.27601 -2.01701 0.168487 1.27854 -2.62246 0.170283 1.28073 -3.50257 0.176676 1.2808 -4.7159 0.220161 1.23516 --0.937541 0.240066 -1.57274 --1.02578 0.238904 -1.51243 --1.11261 0.237606 -1.44656 --1.19739 0.236204 -1.37505 --1.27945 0.234734 -1.2979 --1.3581 0.233245 -1.21518 --1.43264 0.2318 -1.12702 --1.50242 0.230483 -1.03364 --1.56677 0.229411 -0.93531 --1.62514 0.22874 -0.832232 --1.67706 0.2286 -0.724439 --1.72209 0.22892 -0.612074 --1.75981 0.229393 -0.495624 --1.78991 0.229634 -0.375735 --1.81215 0.229344 -0.252893 --1.82619 0.228435 -0.127421 --1.83135 0.227412 2.643e-05 --1.82619 0.228432 0.127475 --1.81215 0.229338 0.252949 --1.78991 0.229625 0.375796 --1.75981 0.22938 0.495689 --1.72209 0.228903 0.612145 --1.67706 0.228578 0.724518 --1.62514 0.228713 0.832319 --1.56677 0.229377 0.935406 --1.50241 0.230442 1.03375 --1.43263 0.231751 1.12713 --1.35807 0.233187 1.21531 --1.27942 0.234666 1.29805 --1.19735 0.236124 1.37522 --1.11256 0.237514 1.44674 --1.02571 0.238798 1.51262 --0.937462 0.239945 1.57295 --0.848431 0.240932 1.62785 --0.759207 0.241745 1.6775 --0.670343 0.242374 1.72213 --0.582351 0.24282 1.76199 --0.495703 0.243089 1.79736 --0.410831 0.243194 1.82852 --0.328117 0.243153 1.85579 --0.247896 0.242986 1.8795 --0.170451 0.242717 1.89998 --0.096007 0.242366 1.91757 --0.0247325 0.241955 1.93259 -0.0432615 0.241501 1.94537 -0.10792 0.24102 1.95621 -0.169242 0.240525 1.9654 -0.227279 0.240027 1.9732 -0.282129 0.239536 1.97986 -0.333941 0.239059 1.98558 -0.382911 0.238602 1.99056 -0.429279 0.23817 1.99494 -0.473337 0.237764 1.99884 -0.51542 0.237386 2.00236 -0.55592 0.237036 2.00558 -0.59528 0.236712 2.00855 -0.634008 0.236414 2.01134 -0.672686 0.23614 2.014 -0.711984 0.23589 2.01656 -0.752669 0.235664 2.01906 -0.795569 0.235467 2.02152 -0.84228 0.235295 2.02399 -0.895622 0.235121 2.02654 -0.959957 0.234979 2.02928 -1.04179 0.234934 2.03233 -1.15009 0.235057 2.0358 -1.29734 0.235406 2.03972 -1.5012 0.236004 2.04404 -1.78733 0.236874 2.04858 -2.19375 0.238294 2.05296 -2.77576 0.241521 2.05645 -3.60452 0.251328 2.05619 -4.7159 0.290008 2.01839 --1.71235 0.355587 -2.57497 --1.84868 0.352071 -2.47787 --1.98354 0.348259 -2.37133 --2.11584 0.344199 -2.2552 --2.24446 0.339953 -2.12941 --2.36825 0.335599 -1.99404 --2.48604 0.331229 -1.84929 --2.59671 0.326964 -1.69551 --2.69913 0.322956 -1.53315 --2.7923 0.319402 -1.36268 --2.87531 0.31648 -1.18454 --2.94733 0.314197 -0.999291 --3.00758 0.312349 -0.807843 --3.05544 0.310666 -0.611261 --3.09041 0.308957 -0.41049 --3.112 0.30721 -0.206358 --3.11958 0.305941 2.4354e-05 --3.112 0.307207 0.206408 --3.09041 0.308951 0.410543 --3.05544 0.310658 0.611318 --3.00758 0.312337 0.807905 --2.94733 0.314182 0.999361 --2.87531 0.31646 1.18462 --2.79229 0.319376 1.36278 --2.69912 0.322923 1.53325 --2.59669 0.326924 1.69562 --2.48602 0.33118 1.84942 --2.36821 0.335539 1.99419 --2.24441 0.339881 2.12958 --2.11577 0.344112 2.2554 --1.98345 0.348156 2.37155 --1.84857 0.35195 2.47811 --1.71221 0.355445 2.57524 --1.57539 0.358603 2.66322 --1.43905 0.361399 2.7424 --1.30408 0.363822 2.81322 --1.17124 0.365869 2.87615 --1.04123 0.367552 2.93173 --0.914661 0.368888 2.9805 --0.792029 0.369905 3.02304 --0.673749 0.370635 3.05992 --0.560137 0.371111 3.0917 --0.45142 0.37137 3.11896 --0.347737 0.371446 3.14222 --0.249147 0.371373 3.162 --0.155633 0.371181 3.17878 --0.0671071 0.370898 3.193 -0.0165792 0.37055 3.20506 -0.095636 0.370159 3.21533 -0.17033 0.369743 3.22414 -0.240983 0.369319 3.23177 -0.307976 0.368898 3.23846 -0.371746 0.368487 3.2444 -0.432791 0.368092 3.24973 -0.491677 0.367714 3.2546 -0.549045 0.367354 3.25909 -0.605626 0.367013 3.26329 -0.66226 0.366688 3.26729 -0.719921 0.366378 3.27115 -0.77975 0.366082 3.27493 -0.84305 0.365803 3.27868 -0.911853 0.365534 3.28246 -0.989277 0.365256 3.28637 -1.07974 0.364992 3.29052 -1.18935 0.364782 3.29501 -1.326 0.364668 3.29995 -1.50013 0.364693 3.30536 -1.72598 0.364925 3.31121 -2.02382 0.365531 3.31737 -2.42406 0.366978 3.32343 -2.97274 0.370533 3.32847 -3.73063 0.379674 3.3291 -4.7159 0.404372 3.29825 --2.94266 0.542362 -4.35041 --3.1762 0.535401 -4.19335 --3.40754 0.528437 -4.01922 --3.63479 0.521559 -3.82766 --3.85599 0.514853 -3.61856 --4.06915 0.508398 -3.39197 --4.27229 0.502262 -3.14823 --4.46343 0.496504 -2.88787 --4.64067 0.491166 -2.61169 --4.80219 0.486276 -2.3207 --4.94628 0.481846 -2.01618 --5.07142 0.477869 -1.6996 --5.17626 0.474317 -1.37263 --5.25967 0.471146 -1.03714 --5.32078 0.468287 -0.695115 --5.35897 0.465652 -0.348672 --5.37391 0.46313 0 --5.35897 0.465652 0.348672 --5.32078 0.468287 0.695115 --5.25967 0.471146 1.03714 --5.17626 0.474317 1.37263 --5.07142 0.477869 1.6996 --4.94628 0.481846 2.01618 --4.80219 0.486276 2.3207 --4.64067 0.491166 2.61169 --4.46343 0.496504 2.88787 --4.27229 0.502262 3.14823 --4.06915 0.508398 3.39197 --3.85599 0.514853 3.61856 --3.63479 0.521559 3.82766 --3.40754 0.528437 4.01922 --3.1762 0.535401 4.19335 --2.94266 0.542362 4.35041 --2.70873 0.549228 4.4909 --2.47612 0.555908 4.6155 --2.24641 0.562316 4.72503 --2.02108 0.568373 4.8204 --1.80145 0.57401 4.90262 --1.58869 0.579169 4.97276 --1.38385 0.583806 5.03191 --1.18781 0.58789 5.08119 --1.00131 0.591408 5.12173 --0.824951 0.59436 5.1546 --0.659191 0.596761 5.18085 --0.504355 0.598638 5.20148 --0.360637 0.600032 5.21742 --0.22811 0.60099 5.22951 --0.106731 0.601566 5.23855 -0.00365498 0.601818 5.24524 -0.103318 0.601805 5.25125 -0.192639 0.601585 5.25727 -0.272088 0.60121 5.26328 -0.34222 0.600756 5.2693 -0.403678 0.600299 5.27531 -0.4572 0.599843 5.28133 -0.503612 0.599386 5.28734 -0.543842 0.598929 5.29336 -0.578915 0.598473 5.29937 -0.60996 0.598016 5.30539 -0.638211 0.597559 5.3114 -0.665014 0.597103 5.31742 -0.692464 0.596646 5.32343 -0.725767 0.596189 5.32945 -0.772305 0.595733 5.33546 -0.841555 0.595276 5.34148 -0.945687 0.594819 5.34749 -1.10033 0.594363 5.35351 -1.32554 0.593906 5.35952 -1.64708 0.593449 5.36554 -2.09804 0.592993 5.37155 -2.72089 0.592536 5.37757 -3.57016 0.592079 5.38359 -4.7159 0.591623 5.3896 -0.27212 0.224495 -0.0278363 -0.254563 0.224316 -0.0269996 -0.237972 0.224117 -0.026049 -0.222425 0.223901 -0.0249939 -0.207991 0.223669 -0.0238431 -0.194719 0.223424 -0.0226091 -0.182646 0.223168 -0.0213102 -0.171788 0.222908 -0.0199718 -0.162143 0.222647 -0.0186239 -0.153684 0.222392 -0.0172964 -0.146378 0.222118 -0.0158549 -0.140216 0.22177 -0.0140109 -0.135226 0.221329 -0.0116576 -0.131392 0.22082 -0.00893199 -0.128625 0.220278 -0.00602495 -0.126837 0.219722 -0.00303561 -0.126016 0.219158 0 -0.126837 0.219722 0.00303561 -0.128625 0.220278 0.00602495 -0.131392 0.22082 0.00893199 -0.135226 0.221329 0.0116576 -0.140216 0.22177 0.0140109 -0.146378 0.222118 0.0158549 -0.153684 0.222392 0.0172964 -0.162143 0.222647 0.0186239 -0.171788 0.222908 0.0199718 -0.182646 0.223168 0.0213102 -0.194719 0.223424 0.0226091 -0.207991 0.223669 0.0238431 -0.222425 0.223901 0.0249939 -0.237972 0.224117 0.026049 -0.254563 0.224316 0.0269996 -0.27212 0.224495 0.0278363 -0.290551 0.224651 0.0285462 -0.309754 0.224781 0.0291105 -0.329618 0.224879 0.0295048 -0.350025 0.22494 0.0297008 -0.370849 0.224957 0.0296712 -0.391964 0.224925 0.0293945 -0.413237 0.224842 0.0288601 -0.434542 0.224708 0.0280721 -0.45575 0.224526 0.0270501 -0.47674 0.224301 0.0258266 -0.497397 0.224043 0.0244438 -0.517611 0.223759 0.0229468 -0.53728 0.223459 0.0213783 -0.556308 0.223148 0.0197739 -0.574612 0.222833 0.0181599 -0.592116 0.222518 0.0165532 -0.608757 0.222203 0.0149631 -0.624486 0.221891 0.0133951 -0.639272 0.221582 0.0118527 -0.653101 0.221278 0.0103412 -0.665981 0.22098 0.00886737 -0.677941 0.220691 0.00743979 -0.689032 0.220411 0.006067 -0.699332 0.220144 0.00475556 -0.708943 0.219888 0.00350843 -0.717995 0.219644 0.00231632 -0.726644 0.219405 0.00115672 -0.735076 0.219167 0 -0.743735 0.219166 0 -0.754002 0.219166 0 -0.770034 0.219165 0 -0.799489 0.219164 0 -0.854515 0.219163 0 -0.953029 0.219163 0 -1.12036 0.219162 0 -1.39133 0.219161 0 -1.81301 0.21916 0 -2.44811 0.21916 0 -3.3795 0.219159 0 -4.7159 0.219158 0 -0.272119 0.224494 -0.0278572 -0.254562 0.224315 -0.0270204 -0.237971 0.224116 -0.0260697 -0.222424 0.2239 -0.0250144 -0.207989 0.223668 -0.0238635 -0.194717 0.223422 -0.0226294 -0.182644 0.223167 -0.0213303 -0.171787 0.222906 -0.0199918 -0.162141 0.222646 -0.0186437 -0.153682 0.222391 -0.017316 -0.146375 0.222116 -0.015874 -0.140211 0.221769 -0.0140295 -0.135218 0.221328 -0.0116751 -0.131382 0.220819 -0.00894763 -0.128611 0.220278 -0.0060374 -0.12682 0.219723 -0.00304302 -0.125999 0.219165 0 -0.12682 0.219723 0.00304302 -0.128611 0.220278 0.0060374 -0.131382 0.220819 0.00894763 -0.135218 0.221328 0.0116751 -0.140211 0.221769 0.0140295 -0.146375 0.222116 0.015874 -0.153682 0.222391 0.017316 -0.162141 0.222646 0.0186437 -0.171787 0.222906 0.0199918 -0.182644 0.223167 0.0213303 -0.194717 0.223422 0.0226294 -0.207989 0.223668 0.0238635 -0.222424 0.2239 0.0250144 -0.237971 0.224116 0.0260697 -0.254562 0.224315 0.0270204 -0.272119 0.224494 0.0278572 -0.29055 0.22465 0.0285671 -0.309753 0.22478 0.0291315 -0.329618 0.224878 0.0295258 -0.350025 0.224939 0.0297219 -0.37085 0.224956 0.0296924 -0.391964 0.224924 0.0294157 -0.413238 0.224841 0.0288813 -0.434542 0.224707 0.0280933 -0.455751 0.224525 0.0270713 -0.476741 0.2243 0.0258478 -0.497398 0.224042 0.024465 -0.517612 0.223758 0.022968 -0.537281 0.223458 0.0213995 -0.55631 0.223147 0.0197951 -0.574614 0.222832 0.018181 -0.592118 0.222516 0.0165742 -0.608758 0.222202 0.0149841 -0.624488 0.22189 0.013416 -0.639274 0.221581 0.0118735 -0.653103 0.221277 0.0103618 -0.665984 0.220979 0.00888792 -0.677943 0.220689 0.00746022 -0.689034 0.22041 0.00608733 -0.699334 0.220142 0.0047758 -0.708946 0.219887 0.00352862 -0.717998 0.219643 0.0023365 -0.726646 0.219404 0.00117693 -0.735078 0.219167 2.0528e-05 -0.743735 0.219165 2.055e-05 -0.754003 0.219165 2.0701e-05 -0.770036 0.219164 2.1034e-05 -0.79949 0.219163 2.1735e-05 -0.854517 0.219162 2.267e-05 -0.953032 0.219162 2.3246e-05 -1.12036 0.219161 2.3316e-05 -1.39134 0.21916 2.3336e-05 -1.81302 0.21916 2.3679e-05 -2.44812 0.219159 2.4545e-05 -3.37951 0.219159 2.6316e-05 -4.7159 0.219161 2.4081e-05 -0.272118 0.224492 -0.027894 -0.25456 0.224313 -0.027057 -0.237969 0.224115 -0.0261059 -0.222422 0.223898 -0.0250503 -0.207987 0.223666 -0.023899 -0.194715 0.22342 -0.0226645 -0.182641 0.223165 -0.0213649 -0.171784 0.222904 -0.0200259 -0.162138 0.222643 -0.0186772 -0.153679 0.222388 -0.0173487 -0.146371 0.222114 -0.0159057 -0.140204 0.221766 -0.0140597 -0.135207 0.221326 -0.0117034 -0.131365 0.220819 -0.00897258 -0.128589 0.220279 -0.00605712 -0.126794 0.219726 -0.00305468 -0.125972 0.219175 0 -0.126794 0.219726 0.00305468 -0.128589 0.220279 0.00605712 -0.131365 0.220819 0.00897258 -0.135207 0.221326 0.0117034 -0.140204 0.221766 0.0140597 -0.146371 0.222114 0.0159057 -0.153679 0.222388 0.0173487 -0.162138 0.222643 0.0186772 -0.171784 0.222904 0.0200259 -0.182641 0.223165 0.0213649 -0.194715 0.22342 0.0226645 -0.207987 0.223666 0.023899 -0.222422 0.223898 0.0250503 -0.237969 0.224115 0.0261059 -0.25456 0.224313 0.027057 -0.272118 0.224492 0.027894 -0.290549 0.224649 0.0286042 -0.309752 0.224778 0.0291687 -0.329617 0.224877 0.0295633 -0.350025 0.224937 0.0297595 -0.37085 0.224954 0.0297301 -0.391965 0.224922 0.0294535 -0.413239 0.224839 0.0289193 -0.434544 0.224705 0.0281314 -0.455753 0.224523 0.0271094 -0.476743 0.224299 0.025886 -0.497401 0.22404 0.0245032 -0.517615 0.223756 0.0230063 -0.537284 0.223456 0.0214377 -0.556313 0.223145 0.0198333 -0.574617 0.22283 0.0182192 -0.592121 0.222514 0.0166124 -0.608762 0.2222 0.0150222 -0.624491 0.221887 0.0134539 -0.639278 0.221579 0.0119113 -0.653107 0.221275 0.0103995 -0.665988 0.220977 0.00892548 -0.677947 0.220687 0.00749762 -0.689039 0.220408 0.0061246 -0.699339 0.22014 0.00481298 -0.70895 0.219885 0.00356575 -0.718002 0.219641 0.00237368 -0.726651 0.219403 0.00121432 -0.73508 0.219166 5.9158e-05 -0.743735 0.219164 5.8558e-05 -0.754004 0.219162 5.8838e-05 -0.770038 0.219161 5.966e-05 -0.799493 0.21916 6.1484e-05 -0.85452 0.219159 6.3913e-05 -0.953036 0.219159 6.5325e-05 -1.12037 0.21916 6.537e-05 -1.39135 0.219159 6.534e-05 -1.81302 0.219159 6.6224e-05 -2.44812 0.219158 6.8512e-05 -3.37951 0.219158 7.3168e-05 -4.7159 0.219166 6.3895e-05 -0.272115 0.224489 -0.027959 -0.254557 0.22431 -0.0271212 -0.237965 0.224111 -0.0261695 -0.222418 0.223895 -0.025113 -0.207983 0.223663 -0.0239608 -0.19471 0.223417 -0.0227252 -0.182637 0.223161 -0.0214245 -0.171779 0.222901 -0.0200842 -0.162133 0.22264 -0.0187341 -0.153674 0.222385 -0.0174037 -0.146364 0.22211 -0.0159581 -0.140193 0.221763 -0.014109 -0.135188 0.221324 -0.0117489 -0.131339 0.220819 -0.00901251 -0.128555 0.220281 -0.00608846 -0.126752 0.21973 -0.00307307 -0.12593 0.219191 0 -0.126752 0.21973 0.00307307 -0.128555 0.220281 0.00608846 -0.131339 0.220819 0.00901251 -0.135188 0.221324 0.0117489 -0.140193 0.221763 0.014109 -0.146364 0.22211 0.0159581 -0.153674 0.222385 0.0174037 -0.162133 0.22264 0.0187341 -0.171779 0.222901 0.0200842 -0.182637 0.223161 0.0214245 -0.19471 0.223417 0.0227252 -0.207983 0.223663 0.0239608 -0.222418 0.223895 0.025113 -0.237965 0.224111 0.0261695 -0.254557 0.22431 0.0271212 -0.272115 0.224489 0.027959 -0.290547 0.224645 0.0286697 -0.309751 0.224775 0.0292348 -0.329616 0.224874 0.0296298 -0.350024 0.224934 0.0298264 -0.37085 0.224951 0.0297973 -0.391966 0.224919 0.0295211 -0.413241 0.224836 0.0289871 -0.434546 0.224702 0.0281995 -0.455756 0.224519 0.0271777 -0.476747 0.224295 0.0259545 -0.497405 0.224036 0.0245719 -0.51762 0.223753 0.0230751 -0.537289 0.223452 0.0215067 -0.556318 0.223141 0.0199024 -0.574623 0.222826 0.0182883 -0.592127 0.22251 0.0166814 -0.608768 0.222196 0.0150912 -0.624498 0.221884 0.0135228 -0.639284 0.221575 0.0119801 -0.653114 0.221271 0.0104681 -0.665995 0.220973 0.00899387 -0.677955 0.220683 0.00756584 -0.689047 0.220404 0.00619269 -0.699347 0.220136 0.00488102 -0.708959 0.219881 0.00363385 -0.718011 0.219637 0.002442 -0.72666 0.219399 0.00128326 -0.735085 0.219165 0.000131553 -0.743736 0.219161 0.000128645 -0.754006 0.219159 0.000128878 -0.770041 0.219157 0.000130349 -0.799498 0.219155 0.000133935 -0.854526 0.219155 0.000138823 -0.953044 0.219156 0.000141602 -1.12037 0.219157 0.000141519 -1.39135 0.219157 0.000141316 -1.81303 0.219156 0.000143059 -2.44813 0.219156 0.00014769 -3.37952 0.219157 0.000157059 -4.7159 0.219175 0.000129833 -0.272111 0.224484 -0.0280731 -0.254552 0.224305 -0.0272339 -0.23796 0.224106 -0.0262805 -0.222412 0.223889 -0.0252221 -0.207976 0.223657 -0.0240678 -0.194703 0.223411 -0.0228299 -0.182628 0.223156 -0.0215267 -0.17177 0.222895 -0.0201835 -0.162125 0.222634 -0.0188303 -0.153665 0.222379 -0.0174957 -0.146352 0.222105 -0.0160444 -0.140173 0.221758 -0.0141893 -0.135158 0.221322 -0.0118221 -0.131296 0.220819 -0.00907635 -0.1285 0.220285 -0.00613823 -0.126687 0.219738 -0.00310206 -0.125865 0.219217 0 -0.126687 0.219738 0.00310206 -0.1285 0.220285 0.00613823 -0.131296 0.220819 0.00907635 -0.135158 0.221322 0.0118221 -0.140173 0.221758 0.0141893 -0.146352 0.222104 0.0160444 -0.153665 0.222379 0.0174957 -0.162125 0.222634 0.0188303 -0.17177 0.222895 0.0201835 -0.182628 0.223156 0.0215267 -0.194703 0.223411 0.0228299 -0.207976 0.223657 0.0240678 -0.222412 0.223889 0.0252221 -0.23796 0.224106 0.0262805 -0.254552 0.224305 0.0272339 -0.272111 0.224484 0.0280731 -0.290543 0.22464 0.0287852 -0.309748 0.22477 0.0293514 -0.329614 0.224869 0.0297474 -0.350023 0.224929 0.0299449 -0.370851 0.224946 0.0299167 -0.391967 0.224914 0.0296411 -0.413244 0.22483 0.0291079 -0.434551 0.224696 0.0283208 -0.455761 0.224513 0.0272997 -0.476754 0.224289 0.0260771 -0.497413 0.22403 0.024695 -0.517628 0.223746 0.0231986 -0.537298 0.223446 0.0216306 -0.556328 0.223135 0.0200265 -0.574632 0.22282 0.0184126 -0.592137 0.222504 0.0168059 -0.608779 0.222189 0.0152156 -0.624509 0.221877 0.0136472 -0.639296 0.221568 0.0121043 -0.653127 0.221264 0.0105922 -0.666008 0.220966 0.00911777 -0.677969 0.220676 0.00768962 -0.689061 0.220397 0.00631645 -0.699362 0.220129 0.00500491 -0.708974 0.219874 0.00375808 -0.718027 0.219631 0.00256692 -0.726676 0.219394 0.00140976 -0.735093 0.219162 0.000266317 -0.743737 0.219155 0.000257253 -0.75401 0.219152 0.000256877 -0.770048 0.219148 0.000259068 -0.799507 0.219146 0.000265336 -0.854537 0.219146 0.000274301 -0.953057 0.219149 0.000279485 -1.12039 0.219152 0.000279191 -1.39137 0.219153 0.000278597 -1.81305 0.219153 0.000281697 -2.44815 0.219153 0.000290164 -3.37954 0.219155 0.000307187 -4.7159 0.21919 0.000238881 -0.272103 0.224475 -0.0282726 -0.254543 0.224296 -0.0274302 -0.237949 0.224097 -0.0264732 -0.2224 0.223881 -0.0254108 -0.207963 0.223648 -0.0242521 -0.194689 0.223402 -0.0230094 -0.182614 0.223146 -0.0217009 -0.171755 0.222886 -0.0203519 -0.162109 0.222626 -0.0189921 -0.15365 0.222371 -0.0176488 -0.146332 0.222096 -0.0161862 -0.140142 0.221752 -0.0143192 -0.13511 0.22132 -0.0119397 -0.131228 0.220822 -0.00917799 -0.128413 0.220292 -0.00621692 -0.126584 0.219753 -0.00314757 -0.125764 0.219256 1e-09 -0.126584 0.219753 0.00314757 -0.128413 0.220292 0.00621692 -0.131228 0.220822 0.009178 -0.13511 0.22132 0.0119397 -0.140142 0.221752 0.0143192 -0.146332 0.222096 0.0161862 -0.15365 0.222371 0.0176488 -0.162109 0.222626 0.0189921 -0.171755 0.222886 0.0203519 -0.182614 0.223146 0.0217009 -0.194689 0.223402 0.0230094 -0.207963 0.223648 0.0242521 -0.2224 0.223881 0.0254108 -0.237949 0.224097 0.0264732 -0.254543 0.224296 0.0274302 -0.272103 0.224475 0.0282726 -0.290537 0.224632 0.0289875 -0.309743 0.224762 0.0295562 -0.329611 0.22486 0.0299543 -0.350022 0.22492 0.0301537 -0.370851 0.224937 0.0301272 -0.39197 0.224904 0.0298533 -0.413249 0.224821 0.0293215 -0.434558 0.224686 0.0285359 -0.455771 0.224503 0.0275161 -0.476766 0.224278 0.0262947 -0.497426 0.22402 0.0249138 -0.517643 0.223735 0.0234186 -0.537314 0.223434 0.0218515 -0.556345 0.223124 0.0202482 -0.57465 0.222808 0.0186349 -0.592155 0.222492 0.0170285 -0.608798 0.222177 0.0154385 -0.624529 0.221864 0.0138702 -0.639318 0.221555 0.0123273 -0.65315 0.221251 0.0108151 -0.666032 0.220953 0.00934069 -0.677994 0.220663 0.00791267 -0.689087 0.220384 0.00653983 -0.699389 0.220117 0.00522894 -0.709002 0.219862 0.00398317 -0.718056 0.219619 0.00279379 -0.726705 0.219383 0.00164031 -0.735109 0.219158 0.000514667 -0.743739 0.219145 0.000491614 -0.754018 0.219139 0.000489188 -0.770061 0.219134 0.000491829 -0.799523 0.219131 0.000501966 -0.854557 0.219132 0.000517605 -0.953081 0.219137 0.0005271 -1.12042 0.219143 0.000526602 -1.39141 0.219145 0.000525235 -1.81309 0.219145 0.000530444 -2.44819 0.219147 0.000545121 -3.37958 0.219152 0.000574423 -4.7159 0.219217 0.000418806 -0.272089 0.224461 -0.0286181 -0.254527 0.224282 -0.0277693 -0.237931 0.224083 -0.026805 -0.22238 0.223866 -0.0257346 -0.20794 0.223633 -0.024567 -0.194664 0.223387 -0.0233146 -0.182588 0.223132 -0.0219956 -0.171728 0.222872 -0.0206351 -0.162083 0.222612 -0.0192622 -0.153623 0.222358 -0.0179017 -0.146297 0.222085 -0.0164175 -0.140089 0.221745 -0.0145286 -0.135031 0.221319 -0.0121271 -0.13112 0.220828 -0.00933884 -0.128275 0.220307 -0.00634054 -0.126423 0.219778 -0.00321852 -0.125606 0.219317 2e-09 -0.126423 0.219778 0.00321853 -0.128275 0.220307 0.00634055 -0.13112 0.220828 0.00933884 -0.135031 0.221319 0.0121271 -0.140089 0.221745 0.0145286 -0.146297 0.222085 0.0164175 -0.153623 0.222358 0.0179018 -0.162083 0.222612 0.0192622 -0.171728 0.222872 0.0206351 -0.182588 0.223132 0.0219956 -0.194664 0.223387 0.0233146 -0.20794 0.223633 0.024567 -0.22238 0.223866 0.0257346 -0.237931 0.224083 0.026805 -0.254527 0.224282 0.0277693 -0.272089 0.224461 0.0286181 -0.290525 0.224618 0.0293387 -0.309734 0.224748 0.0299124 -0.329605 0.224846 0.0303149 -0.350019 0.224906 0.0305183 -0.370852 0.224921 0.0304953 -0.391975 0.224889 0.0302247 -0.413258 0.224804 0.0296961 -0.434571 0.224669 0.0289135 -0.455788 0.224485 0.0278966 -0.476786 0.22426 0.026678 -0.497449 0.224001 0.0252997 -0.517668 0.223716 0.0238068 -0.537342 0.223415 0.0222419 -0.556374 0.223104 0.0206404 -0.574681 0.222788 0.0190285 -0.592188 0.222472 0.0174232 -0.608832 0.222156 0.015834 -0.624565 0.221843 0.0142663 -0.639355 0.221534 0.0127239 -0.653189 0.221229 0.0112121 -0.666074 0.220931 0.0097383 -0.678038 0.220641 0.00831112 -0.689133 0.220362 0.00693956 -0.699437 0.220095 0.00563056 -0.709052 0.219841 0.00438747 -0.718107 0.219598 0.00320222 -0.726756 0.219364 0.0020568 -0.735139 0.219148 0.000965937 -0.743746 0.219128 0.000914878 -0.754035 0.219118 0.000907074 -0.770086 0.219109 0.000908974 -0.799553 0.219104 0.000924194 -0.854592 0.219106 0.000950383 -0.953124 0.219117 0.000967496 -1.12047 0.219128 0.000967034 -1.39146 0.219133 0.000964246 -1.81315 0.219133 0.000972657 -2.44826 0.219137 0.000997214 -3.37963 0.219146 0.00104587 -4.7159 0.219263 0.000714996 -0.272063 0.224439 -0.0292103 -0.254497 0.224259 -0.0283488 -0.237898 0.22406 -0.0273704 -0.222343 0.223843 -0.0262842 -0.2079 0.22361 -0.0250994 -0.194621 0.223365 -0.0238284 -0.182542 0.22311 -0.0224891 -0.171681 0.222851 -0.0211065 -0.162036 0.222593 -0.0197087 -0.153574 0.22234 -0.018316 -0.146236 0.22207 -0.0167919 -0.14 0.221736 -0.0148637 -0.134903 0.22132 -0.0124241 -0.130946 0.220842 -0.00959146 -0.128057 0.220333 -0.00653319 -0.126171 0.21982 -0.00332816 -0.125358 0.219405 3e-09 -0.126171 0.21982 0.00332817 -0.128057 0.220333 0.00653319 -0.130946 0.220842 0.00959148 -0.134903 0.22132 0.0124241 -0.14 0.221736 0.0148637 -0.146236 0.22207 0.0167919 -0.153574 0.22234 0.0183161 -0.162036 0.222593 0.0197087 -0.171681 0.222851 0.0211065 -0.182542 0.22311 0.0224891 -0.194621 0.223364 0.0238284 -0.2079 0.22361 0.0250995 -0.222343 0.223843 0.0262842 -0.237898 0.22406 0.0273704 -0.254497 0.224259 0.0283488 -0.272063 0.224439 0.0292103 -0.290503 0.224595 0.0299421 -0.309717 0.224725 0.0305256 -0.329593 0.224822 0.0309369 -0.350013 0.224881 0.031148 -0.370852 0.224896 0.0311322 -0.391982 0.224862 0.0308682 -0.413272 0.224777 0.0303459 -0.434593 0.22464 0.0295694 -0.455816 0.224455 0.0285584 -0.47682 0.224229 0.0273456 -0.497489 0.223969 0.0259728 -0.517712 0.223684 0.0244849 -0.537389 0.223382 0.0229245 -0.556424 0.22307 0.0213269 -0.574734 0.222754 0.0197183 -0.592244 0.222437 0.0181157 -0.608891 0.22212 0.0165287 -0.624627 0.221807 0.0149627 -0.639421 0.221496 0.0134219 -0.653258 0.221191 0.0119119 -0.666147 0.220892 0.0104401 -0.678114 0.220602 0.00901549 -0.689213 0.220323 0.00764739 -0.69952 0.220056 0.00634303 -0.709139 0.219803 0.00510606 -0.718197 0.219562 0.00392971 -0.726846 0.219332 0.00280112 -0.735195 0.21913 0.00177083 -0.743766 0.219096 0.00167086 -0.754071 0.21908 0.00165063 -0.770136 0.219065 0.00164846 -0.799609 0.219057 0.00166922 -0.854657 0.219062 0.00171115 -0.9532 0.219082 0.00174122 -1.12056 0.219103 0.00174153 -1.39156 0.21911 0.00173627 -1.81326 0.219112 0.00174939 -2.44837 0.219119 0.00178933 -3.37974 0.219136 0.00186782 -4.7159 0.219341 0.00120165 -0.272016 0.224402 -0.0302126 -0.254444 0.224222 -0.0293271 -0.237838 0.224023 -0.0283219 -0.222278 0.223806 -0.0272062 -0.207829 0.223574 -0.0259892 -0.194544 0.22333 -0.0246832 -0.182461 0.223077 -0.0233062 -0.171597 0.22282 -0.0218825 -0.16195 0.222565 -0.0204386 -0.153484 0.222316 -0.0189875 -0.146126 0.22205 -0.017393 -0.139848 0.221727 -0.0153959 -0.134691 0.221328 -0.012891 -0.130667 0.220869 -0.00998497 -0.127712 0.22038 -0.00683066 -0.125776 0.219891 -0.00349585 -0.124964 0.219532 5e-09 -0.125776 0.219891 0.00349587 -0.127712 0.22038 0.00683068 -0.130667 0.220869 0.009985 -0.134691 0.221328 0.012891 -0.139848 0.221727 0.015396 -0.146126 0.22205 0.017393 -0.153484 0.222316 0.0189875 -0.16195 0.222565 0.0204386 -0.171597 0.22282 0.0218825 -0.182461 0.223077 0.0233063 -0.194544 0.223329 0.0246832 -0.207829 0.223574 0.0259892 -0.222278 0.223806 0.0272063 -0.237838 0.224023 0.0283219 -0.254444 0.224222 0.0293271 -0.272016 0.224402 0.0302126 -0.290463 0.224558 0.0309657 -0.309684 0.224687 0.0315681 -0.329569 0.224783 0.0319961 -0.349999 0.224841 0.0322223 -0.37085 0.224854 0.0322202 -0.391992 0.224818 0.031969 -0.413294 0.22473 0.031459 -0.434627 0.224592 0.0306945 -0.455862 0.224405 0.0296952 -0.476876 0.224177 0.0284938 -0.497554 0.223916 0.0271319 -0.517785 0.223629 0.0256542 -0.537467 0.223326 0.024103 -0.556508 0.223013 0.0225136 -0.574823 0.222695 0.020912 -0.592337 0.222377 0.0193153 -0.608989 0.222059 0.0177333 -0.62473 0.221744 0.0161719 -0.63953 0.221433 0.0146354 -0.653374 0.221126 0.01313 -0.666269 0.220827 0.0116636 -0.678244 0.220536 0.0102455 -0.689349 0.220257 0.00888555 -0.699663 0.219991 0.00759142 -0.709287 0.219738 0.00636742 -0.718352 0.2195 0.00520938 -0.726999 0.219277 0.00411395 -0.735299 0.219093 0.00317456 -0.743823 0.219043 0.00300281 -0.754153 0.219015 0.00295665 -0.77024 0.218991 0.0029427 -0.79972 0.218977 0.00296678 -0.854776 0.218987 0.00303016 -0.953336 0.219023 0.00308106 -1.12071 0.219059 0.00308376 -1.39174 0.219073 0.00307438 -1.81346 0.219075 0.00309418 -2.44857 0.219089 0.00315745 -3.37991 0.219119 0.0032807 -4.7159 0.219472 0.00200003 -0.271928 0.224344 -0.0318855 -0.254345 0.224165 -0.0309558 -0.237729 0.223966 -0.0299014 -0.222157 0.22375 -0.0287317 -0.207698 0.22352 -0.0274559 -0.194404 0.223277 -0.0260866 -0.182312 0.223028 -0.0246414 -0.171441 0.222776 -0.0231435 -0.16179 0.222527 -0.0216166 -0.153313 0.222284 -0.0200634 -0.145922 0.222028 -0.0183491 -0.13958 0.221722 -0.0162352 -0.134335 0.221348 -0.0136197 -0.130212 0.220918 -0.0105928 -0.12716 0.220458 -0.00728564 -0.125151 0.220006 -0.00374957 -0.124334 0.219708 1e-08 -0.125151 0.220006 0.00374959 -0.12716 0.220458 0.00728567 -0.130212 0.220918 0.0105929 -0.134335 0.221348 0.0136197 -0.13958 0.221722 0.0162352 -0.145922 0.222028 0.0183492 -0.153313 0.222284 0.0200634 -0.16179 0.222527 0.0216166 -0.171441 0.222776 0.0231435 -0.182312 0.223027 0.0246414 -0.194404 0.223277 0.0260866 -0.207698 0.223519 0.027456 -0.222157 0.22375 0.0287318 -0.237729 0.223966 0.0299015 -0.254345 0.224165 0.0309559 -0.271928 0.224344 0.0318856 -0.290388 0.224499 0.0326781 -0.309622 0.224626 0.0333156 -0.329522 0.224721 0.0337747 -0.349969 0.224776 0.034029 -0.370838 0.224786 0.0340526 -0.392 0.224746 0.0338257 -0.413323 0.224655 0.033339 -0.434676 0.224513 0.0325972 -0.45593 0.224323 0.0316203 -0.476962 0.224092 0.0304407 -0.497655 0.223828 0.0290998 -0.517899 0.223539 0.0276419 -0.537592 0.223233 0.0261088 -0.556642 0.222918 0.0245356 -0.574965 0.222598 0.0229483 -0.592487 0.222278 0.0213641 -0.609147 0.221958 0.0197932 -0.624898 0.22164 0.018242 -0.639708 0.221326 0.0167159 -0.653563 0.221017 0.0152214 -0.66647 0.220716 0.0137674 -0.678457 0.220424 0.0123638 -0.689575 0.220145 0.0110211 -0.699901 0.219879 0.009748 -0.709538 0.219629 0.00854987 -0.718612 0.219395 0.0074273 -0.727258 0.219182 0.00639196 -0.7355 0.219017 0.00556521 -0.743972 0.21895 0.00530985 -0.754343 0.218905 0.00521572 -0.770463 0.218866 0.0051745 -0.799943 0.218845 0.00519337 -0.855002 0.218864 0.00528166 -0.953581 0.218925 0.00536347 -1.12099 0.218987 0.00537151 -1.39204 0.21901 0.00535558 -1.81378 0.219015 0.00538441 -2.44891 0.219039 0.00548196 -3.38021 0.219092 0.00567019 -4.7159 0.21969 0.00330842 -0.271759 0.224254 -0.0346345 -0.254157 0.224077 -0.0336255 -0.237521 0.22388 -0.0324835 -0.221931 0.223666 -0.0312178 -0.207453 0.223439 -0.0298381 -0.194141 0.223201 -0.0283569 -0.182032 0.222958 -0.0267917 -0.171146 0.222715 -0.0251638 -0.161479 0.222477 -0.0234922 -0.152979 0.222247 -0.0217666 -0.145533 0.222007 -0.0198561 -0.139098 0.221728 -0.0175491 -0.133725 0.221391 -0.0147492 -0.129457 0.221002 -0.0115242 -0.126266 0.220585 -0.00797492 -0.124154 0.220183 -0.00412926 -0.123319 0.219946 2e-08 -0.124154 0.220183 0.0041293 -0.126266 0.220585 0.00797498 -0.129457 0.221002 0.0115243 -0.133725 0.221391 0.0147493 -0.139098 0.221728 0.0175491 -0.145533 0.222007 0.0198562 -0.152979 0.222246 0.0217667 -0.161479 0.222477 0.0234923 -0.171146 0.222714 0.0251639 -0.182032 0.222958 0.0267918 -0.194141 0.223201 0.028357 -0.207453 0.223438 0.0298382 -0.221931 0.223666 0.031218 -0.237521 0.22388 0.0324836 -0.254157 0.224077 0.0336257 -0.271759 0.224254 0.0346346 -0.290239 0.224407 0.0354981 -0.309497 0.224532 0.0361988 -0.329422 0.224623 0.0367146 -0.349897 0.224673 0.0370201 -0.370798 0.224678 0.0370909 -0.391992 0.224633 0.0369085 -0.413349 0.224535 0.0364646 -0.434735 0.224387 0.0357649 -0.456021 0.224191 0.0348293 -0.477082 0.223955 0.0336902 -0.4978 0.223685 0.0323884 -0.518065 0.223392 0.0309675 -0.537776 0.223083 0.0294688 -0.556842 0.222764 0.0279268 -0.575178 0.222441 0.0263674 -0.592714 0.222115 0.0248083 -0.609389 0.221791 0.0232604 -0.625156 0.221469 0.0217312 -0.639984 0.221151 0.0202272 -0.653858 0.220839 0.0187563 -0.666786 0.220535 0.0173284 -0.678795 0.220241 0.0159546 -0.689936 0.219961 0.0146463 -0.700287 0.219696 0.0134132 -0.709949 0.219449 0.0122633 -0.719044 0.219222 0.0112041 -0.727691 0.219022 0.0102628 -0.735891 0.218873 0.00954843 -0.744338 0.21879 0.00922004 -0.754773 0.218724 0.00905229 -0.770941 0.218663 0.00895777 -0.800406 0.218631 0.00895083 -0.855442 0.218665 0.00905909 -0.954028 0.218768 0.0091815 -1.12146 0.218871 0.00919931 -1.39256 0.218909 0.00917343 -1.81433 0.218917 0.00921366 -2.44947 0.218959 0.00935974 -3.3807 0.21905 0.00963875 -4.7159 0.220051 0.00545087 -0.271422 0.224119 -0.0390759 -0.253784 0.223945 -0.0379291 -0.237114 0.223752 -0.0366352 -0.221489 0.223543 -0.035204 -0.206976 0.223323 -0.0336455 -0.19363 0.223094 -0.0319726 -0.181487 0.222862 -0.030202 -0.170567 0.222634 -0.0283525 -0.160862 0.222415 -0.0264363 -0.152308 0.222206 -0.02443 -0.144772 0.221996 -0.022209 -0.138199 0.221758 -0.0195917 -0.132647 0.221473 -0.0164888 -0.128177 0.221143 -0.0129411 -0.124793 0.220786 -0.00900979 -0.122537 0.220447 -0.00469165 -0.121663 0.220264 4e-08 -0.122537 0.220447 0.00469175 -0.124793 0.220786 0.00900991 -0.128178 0.221142 0.0129412 -0.132647 0.221473 0.016489 -0.138199 0.221757 0.0195918 -0.144772 0.221995 0.0222091 -0.152308 0.222206 0.0244301 -0.160862 0.222414 0.0264364 -0.170567 0.222634 0.0283527 -0.181487 0.222862 0.0302022 -0.19363 0.223093 0.0319728 -0.206976 0.223322 0.0336457 -0.221489 0.223543 0.0352042 -0.237114 0.223752 0.0366354 -0.253784 0.223945 0.0379293 -0.271422 0.224118 0.0390762 -0.289939 0.224267 0.0400639 -0.309236 0.224387 0.0408761 -0.329205 0.224472 0.0414921 -0.349727 0.224515 0.0418886 -0.370677 0.224511 0.0420437 -0.391925 0.224456 0.041941 -0.413337 0.224349 0.041574 -0.434776 0.22419 0.0409496 -0.456113 0.223985 0.040088 -0.47722 0.22374 0.0390216 -0.497978 0.223463 0.0377901 -0.518279 0.223162 0.0364363 -0.53802 0.222846 0.0350003 -0.557111 0.222521 0.0335159 -0.575472 0.22219 0.0320092 -0.593032 0.221858 0.0304984 -0.609732 0.221527 0.0289959 -0.625526 0.221198 0.0275108 -0.640385 0.220873 0.0260515 -0.654294 0.220554 0.0246279 -0.66726 0.220245 0.0232512 -0.679311 0.219948 0.0219338 -0.690499 0.219666 0.0206882 -0.700899 0.219402 0.0195259 -0.710612 0.219159 0.0184575 -0.719754 0.218941 0.0174968 -0.728431 0.218754 0.016674 -0.736654 0.218613 0.0160526 -0.745158 0.218518 0.0156778 -0.755706 0.218429 0.0154239 -0.771949 0.218342 0.0152439 -0.801367 0.218297 0.0151737 -0.856315 0.218355 0.0152781 -0.954857 0.218525 0.0154432 -1.1223 0.218693 0.0154757 -1.39343 0.218752 0.0154352 -1.81525 0.218766 0.0154886 -2.45039 0.218836 0.0157005 -3.3815 0.218988 0.0161004 -4.7159 0.220647 0.00895714 -0.270726 0.223921 -0.0461238 -0.253023 0.223755 -0.0447435 -0.236288 0.223571 -0.0431939 -0.220598 0.223371 -0.0414853 -0.206019 0.223163 -0.0396282 -0.192604 0.22295 -0.0376358 -0.180392 0.222739 -0.0355239 -0.169397 0.222536 -0.0333077 -0.159607 0.222347 -0.0309918 -0.150942 0.222175 -0.0285429 -0.143259 0.222011 -0.0258444 -0.136488 0.221834 -0.0227408 -0.130691 0.221623 -0.0191488 -0.12595 0.221372 -0.01508 -0.122306 0.221095 -0.0105497 -0.119858 0.220831 -0.00551666 -0.118919 0.22069 8.4e-08 -0.119858 0.220831 0.00551684 -0.122306 0.221094 0.01055 -0.12595 0.221371 0.0150802 -0.130691 0.221622 0.0191491 -0.136488 0.221833 0.022741 -0.143259 0.222011 0.0258447 -0.150942 0.222174 0.0285432 -0.159607 0.222347 0.030992 -0.169397 0.222535 0.0333079 -0.180392 0.222738 0.0355242 -0.192604 0.222949 0.0376362 -0.206019 0.223162 0.0396286 -0.220598 0.22337 0.0414857 -0.236288 0.22357 0.0431944 -0.253023 0.223754 0.0447439 -0.270726 0.22392 0.0461243 -0.28931 0.224062 0.0473236 -0.308676 0.224173 0.048327 -0.328718 0.224247 0.0491161 -0.349319 0.224278 0.049671 -0.370352 0.224261 0.0499731 -0.391685 0.224191 0.0500095 -0.413182 0.224069 0.0497767 -0.434706 0.223895 0.0492832 -0.456122 0.223675 0.0485502 -0.477302 0.223416 0.0476096 -0.498125 0.223127 0.0465002 -0.518482 0.222815 0.045263 -0.538273 0.222487 0.0439369 -0.55741 0.22215 0.042555 -0.575813 0.221809 0.0411435 -0.593415 0.221465 0.0397219 -0.610161 0.221122 0.0383045 -0.626007 0.220781 0.0369029 -0.640922 0.220445 0.0355282 -0.654897 0.220116 0.0341922 -0.667936 0.219798 0.0329078 -0.680071 0.219495 0.0316885 -0.691352 0.21921 0.0305473 -0.701855 0.218946 0.0294961 -0.71168 0.218707 0.0285463 -0.720939 0.218495 0.0277103 -0.729741 0.218315 0.0270048 -0.738122 0.218175 0.026454 -0.746824 0.218071 0.0260585 -0.757592 0.217964 0.0257312 -0.773978 0.217856 0.0254456 -0.803318 0.217799 0.0252626 -0.858045 0.217896 0.0253093 -0.956412 0.218165 0.0254981 -1.12378 0.218431 0.0255466 -1.39491 0.218526 0.0254855 -1.81676 0.218547 0.0255521 -2.45189 0.21866 0.0258485 -3.38278 0.218909 0.0264002 -4.7159 0.221629 0.0146932 -0.269256 0.22365 -0.0570998 -0.251431 0.223498 -0.0553352 -0.234572 0.223328 -0.0533675 -0.218755 0.223147 -0.0512071 -0.204045 0.222961 -0.0488654 -0.190495 0.222775 -0.0463558 -0.178138 0.222598 -0.0436929 -0.166988 0.222436 -0.0408883 -0.157022 0.222296 -0.0379412 -0.148154 0.222183 -0.0348133 -0.140232 0.222092 -0.0313934 -0.133179 0.222002 -0.0275414 -0.127057 0.221891 -0.0231752 -0.121969 0.221745 -0.0182777 -0.118 0.221567 -0.0128181 -0.115311 0.221384 -0.00671481 -0.114281 0.221274 1.77e-07 -0.115311 0.221384 0.00671519 -0.118 0.221567 0.0128185 -0.121969 0.221744 0.0182782 -0.127057 0.22189 0.0231757 -0.133179 0.222001 0.0275419 -0.140232 0.222091 0.0313939 -0.148155 0.222182 0.0348139 -0.157022 0.222295 0.0379418 -0.166988 0.222435 0.0408889 -0.178138 0.222597 0.0436934 -0.190495 0.222774 0.0463564 -0.204045 0.222959 0.0488661 -0.218755 0.223145 0.0512078 -0.234572 0.223326 0.0533683 -0.251431 0.223496 0.055336 -0.269256 0.223648 0.0571007 -0.287962 0.223776 0.058651 -0.307453 0.223873 0.0599742 -0.327623 0.223931 0.0610552 -0.348355 0.223944 0.0618786 -0.369523 0.223906 0.0624309 -0.390993 0.223816 0.062704 -0.412626 0.223671 0.0626985 -0.434281 0.223476 0.0624259 -0.455822 0.223235 0.0619086 -0.477117 0.222956 0.0611782 -0.498045 0.222647 0.0602722 -0.518496 0.222317 0.0592299 -0.538373 0.221972 0.0580888 -0.557589 0.221617 0.0568814 -0.576071 0.221258 0.0556345 -0.593755 0.220896 0.0543691 -0.610589 0.220535 0.0531024 -0.626533 0.220176 0.0518487 -0.641562 0.219823 0.0506217 -0.655666 0.219478 0.0494348 -0.668855 0.219148 0.0483015 -0.68116 0.218834 0.0472346 -0.692636 0.218541 0.0462457 -0.703359 0.218273 0.0453441 -0.713429 0.218031 0.0445366 -0.722962 0.217819 0.043828 -0.732073 0.217638 0.0432218 -0.740818 0.217494 0.0427247 -0.749927 0.217385 0.0423251 -0.761107 0.21727 0.0419493 -0.777791 0.217155 0.0415652 -0.807081 0.217104 0.0412309 -0.861395 0.217261 0.0411381 -0.959311 0.21767 0.0412932 -1.12638 0.21808 0.0413474 -1.39739 0.218227 0.0412576 -1.81921 0.218259 0.0413339 -2.45425 0.218435 0.0417326 -3.38477 0.21883 0.0424616 -4.7159 0.223244 0.0240746 -0.266115 0.22332 -0.0738758 -0.248054 0.223192 -0.0714953 -0.230955 0.223048 -0.0688617 -0.21489 0.222898 -0.0659855 -0.199922 0.222749 -0.0628786 -0.186102 0.222609 -0.0595546 -0.173461 0.222486 -0.0560274 -0.162008 0.222389 -0.052307 -0.151716 0.222326 -0.0483904 -0.142498 0.222304 -0.0442376 -0.134202 0.222321 -0.0397355 -0.126753 0.222356 -0.0347447 -0.120215 0.222379 -0.0291768 -0.114708 0.222367 -0.0229906 -0.110362 0.222307 -0.0161149 -0.107398 0.222203 -0.00843382 -0.106261 0.222111 3.76e-07 -0.107398 0.222203 0.0084346 -0.110362 0.222306 0.0161158 -0.114708 0.222366 0.0229915 -0.120215 0.222378 0.0291778 -0.126753 0.222354 0.0347456 -0.134202 0.222319 0.0397364 -0.142498 0.222303 0.0442386 -0.151716 0.222324 0.0483915 -0.162008 0.222387 0.052308 -0.173461 0.222484 0.0560285 -0.186102 0.222607 0.0595558 -0.199922 0.222747 0.0628799 -0.21489 0.222895 0.0659868 -0.230955 0.223046 0.068863 -0.248054 0.223189 0.0714967 -0.266115 0.223317 0.0738774 -0.285054 0.223422 0.075995 -0.304775 0.223496 0.0778396 -0.325174 0.22353 0.0794004 -0.346135 0.223518 0.0806677 -0.36753 0.223453 0.0816348 -0.389224 0.223334 0.0822997 -0.411077 0.223161 0.0826686 -0.432943 0.222936 0.0827568 -0.454683 0.222667 0.0825888 -0.476165 0.22236 0.0821964 -0.497268 0.222025 0.0816164 -0.517882 0.221669 0.0808867 -0.537914 0.221298 0.0800436 -0.557283 0.220918 0.0791196 -0.57592 0.220532 0.0781424 -0.593769 0.220145 0.077135 -0.610784 0.219757 0.0761169 -0.626932 0.219373 0.0751045 -0.642193 0.218996 0.0741126 -0.656563 0.21863 0.0731544 -0.670057 0.218279 0.0722416 -0.682711 0.217948 0.0713838 -0.69458 0.217641 0.0705882 -0.705744 0.21736 0.0698591 -0.716301 0.217109 0.0691984 -0.72637 0.216888 0.0686055 -0.73607 0.2167 0.0680796 -0.745456 0.216553 0.0676238 -0.755248 0.216444 0.0672249 -0.767122 0.216336 0.0668167 -0.784391 0.216239 0.0663538 -0.813818 0.216228 0.0658619 -0.867573 0.216477 0.065551 -0.964599 0.21707 0.0655732 -1.13094 0.217677 0.0655988 -1.40153 0.217901 0.0654694 -1.82314 0.217948 0.0655476 -2.45795 0.218212 0.0660614 -3.3878 0.218822 0.0669783 -4.7159 0.225899 0.0394154 -0.259433 0.223041 -0.0990735 -0.240914 0.222951 -0.0957272 -0.223343 0.222852 -0.0920563 -0.206792 0.222752 -0.0880706 -0.191324 0.222664 -0.0837818 -0.176987 0.222595 -0.0792042 -0.163813 0.222557 -0.0743521 -0.151811 0.222559 -0.0692365 -0.140958 0.222613 -0.063855 -0.131176 0.222727 -0.0581644 -0.122326 0.222899 -0.0520406 -0.114339 0.223107 -0.0453314 -0.107284 0.223311 -0.0379377 -0.101302 0.223465 -0.0298012 -0.096553 0.223536 -0.0208226 -0.0933061 0.223505 -0.0108622 -0.0920558 0.223414 7.88e-07 -0.0933061 0.223504 0.0108638 -0.096553 0.223535 0.0208243 -0.101302 0.223464 0.029803 -0.107284 0.223309 0.0379396 -0.114339 0.223105 0.0453333 -0.122326 0.222897 0.0520425 -0.131176 0.222724 0.0581663 -0.140958 0.22261 0.0638569 -0.151811 0.222556 0.0692385 -0.163813 0.222553 0.0743542 -0.176987 0.222591 0.0792063 -0.191324 0.222659 0.0837841 -0.206792 0.222748 0.0880729 -0.223342 0.222847 0.0920588 -0.240914 0.222946 0.0957298 -0.259433 0.223036 0.0990762 -0.278818 0.223106 0.10209 -0.298975 0.223146 0.104765 -0.319799 0.223147 0.107096 -0.341174 0.223101 0.10908 -0.362972 0.223002 0.110717 -0.385056 0.222848 0.112013 -0.407284 0.222639 0.112981 -0.42951 0.222379 0.113641 -0.451593 0.222075 0.114021 -0.473403 0.221735 0.114155 -0.494818 0.221366 0.114079 -0.515736 0.220976 0.113831 -0.536069 0.220573 0.113448 -0.555742 0.22016 0.112961 -0.574697 0.219741 0.112401 -0.592886 0.219321 0.111791 -0.610274 0.218901 0.111151 -0.626838 0.218485 0.110498 -0.642566 0.218078 0.109845 -0.657462 0.217684 0.109203 -0.671546 0.217307 0.10858 -0.684855 0.216952 0.10798 -0.697446 0.216623 0.107408 -0.709395 0.216324 0.106863 -0.720797 0.216057 0.106347 -0.731767 0.215825 0.105859 -0.742418 0.215632 0.105398 -0.752804 0.215484 0.104971 -0.76364 0.215387 0.104567 -0.776592 0.215302 0.104125 -0.794873 0.21525 0.103592 -0.824867 0.215321 0.10296 -0.87818 0.215706 0.102401 -0.973858 0.21652 0.102186 -1.13878 0.217371 0.102121 -1.40836 0.217705 0.101937 -1.82939 0.217774 0.102004 -2.46365 0.218151 0.102639 -3.39235 0.219066 0.103731 -4.7159 0.230261 0.0644981 -0.245444 0.223188 -0.136393 -0.226036 0.223158 -0.13155 -0.207557 0.223126 -0.12628 -0.19008 0.223106 -0.120592 -0.173673 0.22311 -0.114497 -0.15839 0.22315 -0.10801 -0.14427 0.223239 -0.101148 -0.131335 0.223389 -0.0939244 -0.119577 0.223611 -0.0863398 -0.108935 0.223918 -0.0783461 -0.0992913 0.224308 -0.0698003 -0.0905904 0.22475 -0.0605304 -0.0829099 0.225184 -0.0504275 -0.0763991 0.225539 -0.0394265 -0.071237 0.225751 -0.0274133 -0.0677128 0.225775 -0.0142337 -0.0663474 0.225664 1.623e-06 -0.0677127 0.225775 0.014237 -0.071237 0.22575 0.0274168 -0.0763991 0.225537 0.03943 -0.0829098 0.225182 0.050431 -0.0905904 0.224747 0.060534 -0.0992912 0.224304 0.069804 -0.108935 0.223913 0.0783498 -0.119576 0.223606 0.0863436 -0.131334 0.223383 0.0939282 -0.14427 0.223233 0.101152 -0.158389 0.223144 0.108014 -0.173672 0.223103 0.114501 -0.19008 0.223099 0.120596 -0.207556 0.223118 0.126285 -0.226036 0.223149 0.131555 -0.245443 0.22318 0.136398 -0.265693 0.223197 0.14081 -0.286689 0.223189 0.144788 -0.308325 0.223146 0.148333 -0.330485 0.223057 0.15145 -0.353038 0.222917 0.154147 -0.375847 0.222723 0.156439 -0.39877 0.222474 0.158345 -0.421662 0.222176 0.159892 -0.444385 0.221835 0.161113 -0.466813 0.221457 0.162044 -0.488832 0.221053 0.162725 -0.510346 0.220627 0.163195 -0.531277 0.220189 0.163491 -0.551562 0.219741 0.163647 -0.571155 0.219288 0.163692 -0.590022 0.218835 0.16365 -0.608139 0.218383 0.163541 -0.625494 0.217937 0.163379 -0.642086 0.2175 0.163174 -0.657924 0.217077 0.162936 -0.67303 0.216674 0.162667 -0.687442 0.216295 0.162372 -0.701211 0.215944 0.162051 -0.714407 0.215626 0.161707 -0.727121 0.215345 0.161342 -0.73946 0.215104 0.160958 -0.751532 0.214908 0.160559 -0.763388 0.214769 0.160155 -0.775751 0.214692 0.159742 -0.790305 0.214645 0.159264 -0.810202 0.214659 0.15867 -0.841473 0.214842 0.157933 -0.894951 0.215394 0.157174 -0.989196 0.216442 0.156685 -1.15189 0.217563 0.156463 -1.41956 0.218043 0.15621 -1.83929 0.218146 0.156255 -2.47241 0.218661 0.157009 -3.39912 0.220006 0.158228 -4.7159 0.237423 0.105506 -0.216941 0.224788 -0.191256 -0.195845 0.224843 -0.184087 -0.175659 0.22491 -0.176342 -0.156472 0.225004 -0.168029 -0.138367 0.225141 -0.159161 -0.121418 0.225335 -0.149757 -0.105686 0.2256 -0.13984 -0.0912151 0.225951 -0.129431 -0.078025 0.226403 -0.118536 -0.0660818 0.226967 -0.107104 -0.0552896 0.227643 -0.0949722 -0.0456077 0.228385 -0.0819461 -0.0371156 0.229101 -0.0679116 -0.0299599 0.229682 -0.0528065 -0.0243173 0.23003 -0.03651 -0.0204754 0.230078 -0.0188587 -0.0189698 0.229911 3.244e-06 -0.0204754 0.230077 0.0188653 -0.0243171 0.230029 0.0365167 -0.0299597 0.22968 0.0528133 -0.0371154 0.229097 0.0679185 -0.0456074 0.22838 0.0819531 -0.0552891 0.227638 0.0949792 -0.066081 0.226961 0.107111 -0.0780241 0.226395 0.118543 -0.0912141 0.225943 0.129438 -0.105685 0.225591 0.139847 -0.121417 0.225325 0.149764 -0.138366 0.22513 0.159169 -0.156471 0.224992 0.168037 -0.175657 0.224897 0.17635 -0.195843 0.224829 0.184095 -0.21694 0.224774 0.191265 -0.238849 0.224717 0.197856 -0.261466 0.224644 0.203873 -0.284678 0.224542 0.209323 -0.30836 0.2244 0.214217 -0.332382 0.224212 0.218573 -0.356603 0.223973 0.222414 -0.380882 0.223684 0.225769 -0.40508 0.223348 0.228671 -0.429063 0.22297 0.23116 -0.452714 0.222559 0.233278 -0.475928 0.222123 0.23507 -0.498621 0.221668 0.236577 -0.520729 0.221202 0.237841 -0.542203 0.220728 0.238896 -0.563011 0.220251 0.239774 -0.583132 0.219774 0.240498 -0.602557 0.2193 0.241089 -0.621285 0.218833 0.241562 -0.639322 0.218377 0.241926 -0.656686 0.217935 0.24219 -0.6734 0.217513 0.242359 -0.689501 0.217115 0.242437 -0.705041 0.216748 0.242429 -0.720084 0.216415 0.242338 -0.734716 0.216121 0.242172 -0.749043 0.215872 0.241936 -0.763171 0.215676 0.24164 -0.77715 0.215545 0.241298 -0.791728 0.215492 0.240914 -0.808637 0.215484 0.240443 -0.831026 0.215566 0.239843 -0.864654 0.215865 0.23909 -0.919538 0.216582 0.238267 -1.01316 0.217836 0.237606 -1.17325 0.219205 0.237227 -1.43788 0.219861 0.236911 -1.85515 0.220021 0.236937 -2.48602 0.220703 0.237809 -3.40928 0.222666 0.239061 -4.7159 0.249179 0.172547 -0.161123 0.230268 -0.272401 -0.136887 0.230429 -0.26161 -0.113569 0.230618 -0.250021 -0.0912879 0.230855 -0.237646 -0.0701602 0.231155 -0.224506 -0.0502952 0.231535 -0.21063 -0.0317919 0.232013 -0.196056 -0.0147329 0.232605 -0.180822 --0.000826864 0.233329 -0.164947 --0.014888 0.234201 -0.148382 --0.027522 0.235215 -0.130942 --0.0387615 0.236304 -0.112409 --0.0485341 0.23733 -0.0926673 --0.0567083 0.238138 -0.0716622 --0.0631212 0.238586 -0.0492699 --0.0674893 0.238593 -0.0253198 --0.0692365 0.238315 6.228e-06 --0.0674896 0.238592 0.0253323 --0.0631217 0.238583 0.0492827 --0.056709 0.238134 0.0716752 --0.0485351 0.237325 0.0926805 --0.0387627 0.236297 0.112422 --0.0275235 0.235207 0.130955 --0.0148898 0.234191 0.148396 --0.000828998 0.233318 0.164961 -0.0147305 0.232593 0.180836 -0.0317893 0.231999 0.196071 -0.0502923 0.23152 0.210645 -0.0701572 0.231138 0.224521 -0.0912848 0.230836 0.237661 -0.113566 0.230598 0.250037 -0.136884 0.230406 0.261626 -0.16112 0.230244 0.272418 -0.186149 0.230094 0.28241 -0.211843 0.22994 0.29161 -0.238069 0.229767 0.300029 -0.264688 0.229563 0.307687 -0.291559 0.229319 0.31461 -0.318534 0.229031 0.320831 -0.345472 0.228697 0.326389 -0.372234 0.228323 0.331328 -0.398692 0.227912 0.335697 -0.424736 0.227472 0.339549 -0.450273 0.227011 0.342936 -0.475233 0.226536 0.345909 -0.499562 0.226053 0.348517 -0.523228 0.225565 0.350802 -0.546214 0.225077 0.352801 -0.568515 0.224591 0.354547 -0.590137 0.224109 0.356064 -0.611095 0.223634 0.357373 -0.631408 0.223169 0.35849 -0.651106 0.222718 0.359428 -0.670225 0.222285 0.360198 -0.688809 0.221876 0.360808 -0.706917 0.221494 0.361267 -0.724621 0.221146 0.361583 -0.742013 0.220838 0.361767 -0.759203 0.220576 0.361828 -0.776306 0.22037 0.36178 -0.793378 0.220238 0.361638 -0.811211 0.220198 0.361418 -0.831625 0.220215 0.361096 -0.857838 0.220347 0.360653 -0.895455 0.22073 0.360085 -0.953783 0.221562 0.359452 -1.04888 0.222941 0.358901 -1.20734 0.224473 0.358536 -1.46814 0.225315 0.358262 -1.88127 0.225584 0.358341 -2.50793 0.22649 0.359342 -3.42508 0.229405 0.360434 -4.7159 0.268473 0.282145 -0.0578227 0.244638 -0.396479 -0.0279677 0.244877 -0.380168 --0.000915904 0.245156 -0.362715 --0.0286555 0.245496 -0.344138 --0.05508 0.245915 -0.324469 --0.0800234 0.246434 -0.303752 --0.10333 0.247075 -0.282046 --0.12486 0.247859 -0.259409 --0.144509 0.248813 -0.235879 --0.162231 0.249959 -0.211413 --0.178068 0.25129 -0.185803 --0.192046 0.252702 -0.158809 --0.204105 0.253998 -0.130319 --0.214135 0.254956 -0.100294 --0.221984 0.255392 -0.0686126 --0.227352 0.255226 -0.0350989 --0.229553 0.254741 1.1539e-05 --0.227353 0.255224 0.0351222 --0.221985 0.255389 0.0686364 --0.214137 0.25495 0.100319 --0.204108 0.25399 0.130344 --0.192049 0.252693 0.158834 --0.178071 0.251279 0.185829 --0.162235 0.249945 0.21144 --0.144513 0.248796 0.235907 --0.124865 0.24784 0.259437 --0.103335 0.247053 0.282075 --0.0800287 0.24641 0.303782 --0.0550854 0.245888 0.324499 --0.0286607 0.245466 0.34417 --0.000920877 0.245123 0.362748 -0.0279631 0.244841 0.380202 -0.0578187 0.244599 0.396514 -0.0884739 0.244378 0.41168 -0.119757 0.244159 0.425709 -0.151498 0.243926 0.438618 -0.183527 0.243667 0.450437 -0.215676 0.243371 0.461201 -0.247782 0.243035 0.470958 -0.279687 0.242657 0.479759 -0.311246 0.242242 0.487666 -0.342331 0.241796 0.494744 -0.372833 0.241326 0.501063 -0.402663 0.24084 0.506692 -0.431761 0.240345 0.511703 -0.460087 0.239846 0.516159 -0.487623 0.239348 0.520122 -0.514368 0.238852 0.523645 -0.540338 0.238361 0.526777 -0.56556 0.237876 0.529557 -0.590072 0.237399 0.532019 -0.613922 0.236931 0.534191 -0.637165 0.236476 0.536098 -0.659865 0.236037 0.537759 -0.682095 0.235618 0.53919 -0.703939 0.235224 0.540406 -0.725498 0.23486 0.541421 -0.746888 0.234532 0.542248 -0.768247 0.23425 0.5429 -0.789717 0.234023 0.54339 -0.811377 0.233875 0.543733 -0.834094 0.233832 0.543963 -0.859823 0.233851 0.544084 -0.891945 0.234 0.544116 -0.936059 0.23442 0.544094 -1.00096 0.235289 0.544068 -1.10124 0.236676 0.544105 -1.26133 0.23824 0.544219 -1.51915 0.23925 0.544353 -1.92628 0.239732 0.544749 -2.54526 0.24101 0.545947 -3.45117 0.245571 0.546474 -4.7159 0.300136 0.461308 --0.120924 0.276835 -0.596089 --0.160229 0.276927 -0.571409 --0.198442 0.277044 -0.544984 --0.235311 0.277211 -0.516828 --0.270586 0.277453 -0.486978 --0.304015 0.277799 -0.455489 --0.33536 0.278281 -0.422441 --0.364397 0.278938 -0.387917 --0.390941 0.279814 -0.351987 --0.414874 0.280955 -0.314625 --0.436184 0.282355 -0.275616 --0.454878 0.283864 -0.234723 --0.470902 0.285201 -0.191867 --0.48416 0.286063 -0.147049 --0.494498 0.28622 -0.100162 --0.501569 0.285616 -0.0510332 --0.504505 0.284755 2.0651e-05 --0.501571 0.285613 0.051075 --0.494501 0.286214 0.100204 --0.484163 0.286055 0.147093 --0.470907 0.28519 0.191913 --0.454883 0.283849 0.234771 --0.43619 0.282337 0.275666 --0.41488 0.280934 0.314677 --0.390948 0.279788 0.352042 --0.364405 0.278908 0.387975 --0.335367 0.278247 0.422501 --0.304022 0.27776 0.455553 --0.270592 0.277409 0.487044 --0.235316 0.277162 0.516899 --0.198445 0.276989 0.545058 --0.160231 0.276865 0.571487 --0.120923 0.276768 0.59617 --0.0807676 0.276673 0.619115 --0.040002 0.276561 0.640343 -0.00114243 0.276415 0.659891 -0.0424431 0.276222 0.677809 -0.0836864 0.275974 0.694157 -0.12467 0.27567 0.709008 -0.165207 0.275311 0.722441 -0.205129 0.274904 0.734547 -0.244289 0.274458 0.745421 -0.282569 0.273984 0.755164 -0.319879 0.273493 0.763879 -0.356158 0.272991 0.771667 -0.391374 0.272487 0.778627 -0.425522 0.271985 0.78485 -0.458623 0.271488 0.79042 -0.490714 0.270998 0.795411 -0.521854 0.270515 0.799889 -0.552117 0.270042 0.803913 -0.581591 0.269579 0.807529 -0.610376 0.269129 0.810781 -0.638588 0.268693 0.813703 -0.666355 0.268276 0.816325 -0.693818 0.26788 0.818671 -0.721139 0.267512 0.820764 -0.748495 0.267176 0.822621 -0.776092 0.266882 0.824259 -0.804137 0.266641 0.825692 -0.832777 0.26648 0.826932 -0.862999 0.266433 0.828029 -0.896967 0.266448 0.829028 -0.938327 0.266601 0.830002 -0.992837 0.267027 0.83103 -1.06899 0.267875 0.832173 -1.18016 0.269178 0.833456 -1.34805 0.27067 0.834814 -1.60714 0.27184 0.836132 -2.0076 0.272748 0.83748 -2.61312 0.274821 0.839091 -3.49753 0.28255 0.838245 -4.7159 0.35209 0.75419 --0.417734 0.34132 -0.925429 --0.47249 0.340602 -0.887453 --0.525963 0.339848 -0.846658 --0.577788 0.339091 -0.803038 --0.627593 0.338372 -0.756626 --0.675001 0.337736 -0.707488 --0.719642 0.33724 -0.655728 --0.761162 0.336954 -0.601475 --0.799239 0.336962 -0.544849 --0.833629 0.337352 -0.48588 --0.864214 0.338137 -0.424395 --0.890928 0.339121 -0.360224 --0.913687 0.339928 -0.293388 --0.932375 0.340172 -0.22398 --0.946809 0.339586 -0.151941 --0.956561 0.338177 -0.0771262 --0.960556 0.336753 3.4371e-05 --0.956563 0.338173 0.077196 --0.946813 0.339578 0.152013 --0.93238 0.34016 0.224056 --0.913693 0.339912 0.293468 --0.890935 0.339099 0.360309 --0.864221 0.33811 0.424486 --0.833637 0.337319 0.485977 --0.799247 0.336922 0.544953 --0.761168 0.336907 0.601587 --0.719646 0.337185 0.65585 --0.675002 0.337672 0.707619 --0.62759 0.338299 0.756768 --0.57778 0.339008 0.803191 --0.525949 0.339753 0.846822 --0.47247 0.340496 0.887629 --0.417705 0.341201 0.925617 --0.362007 0.34184 0.960818 --0.305712 0.34239 0.993294 --0.249138 0.342832 1.02313 --0.192588 0.343154 1.05041 --0.136346 0.343351 1.07525 --0.0806739 0.343427 1.09779 --0.0258114 0.343389 1.11814 -0.0280313 0.343252 1.13647 -0.0806758 0.343031 1.15291 -0.13198 0.342743 1.16764 -0.181838 0.342406 1.1808 -0.230186 0.342032 1.19256 -0.276995 0.341635 1.20306 -0.322273 0.341224 1.21245 -0.366059 0.340804 1.22086 -0.408425 0.340381 1.22841 -0.449466 0.339959 1.23521 -0.489306 0.339541 1.24136 -0.528089 0.33913 1.24693 -0.565984 0.338728 1.25201 -0.603183 0.338339 1.25663 -0.6399 0.337965 1.26087 -0.676373 0.337611 1.26476 -0.712869 0.33728 1.26834 -0.749684 0.336979 1.27165 -0.787148 0.336715 1.27469 -0.825611 0.3365 1.27751 -0.865364 0.336365 1.28011 -0.907601 0.336349 1.28255 -0.954784 0.336395 1.28494 -1.01093 0.336582 1.28738 -1.08206 0.337037 1.29001 -1.17655 0.337871 1.29292 -1.30673 0.339098 1.29612 -1.49147 0.340552 1.29956 -1.76 0.342015 1.30301 -2.15617 0.343802 1.30621 -2.7401 0.347786 1.3086 -3.58301 0.36143 1.3053 -4.7159 0.437337 1.23297 --0.907468 0.462104 -1.47203 --0.987819 0.459282 -1.41231 --1.06664 0.45629 -1.34793 --1.14337 0.453181 -1.27883 --1.21746 0.450018 -1.20503 --1.28831 0.446879 -1.12662 --1.35533 0.443861 -1.04372 --1.41795 0.441084 -0.956518 --1.47563 0.438694 -0.865233 --1.52788 0.436849 -0.770003 --1.57438 0.435611 -0.670794 --1.61488 0.434781 -0.567625 --1.64916 0.43394 -0.460733 --1.677 0.432668 -0.350407 --1.69812 0.430712 -0.23674 --1.71199 0.428172 -0.119719 --1.71742 0.426128 4.8456e-05 --1.71199 0.428167 0.119817 --1.69812 0.430702 0.236844 --1.677 0.432652 0.350517 --1.64917 0.433918 0.460851 --1.61489 0.434753 0.567754 --1.57438 0.435575 0.670936 --1.52788 0.436804 0.770158 --1.47562 0.438639 0.865406 --1.41795 0.441018 0.956709 --1.35532 0.443782 1.04393 --1.28828 0.446785 1.12685 --1.21742 0.449908 1.2053 --1.14332 0.453053 1.27912 --1.06657 0.456143 1.34824 --0.987732 0.459112 1.41266 --0.907359 0.461909 1.47241 --0.825971 0.464491 1.52759 --0.744057 0.466827 1.57832 --0.662073 0.468896 1.62478 --0.580443 0.470687 1.66713 --0.499553 0.472201 1.7056 --0.419755 0.473446 1.7404 --0.341358 0.47444 1.77176 --0.26463 0.475208 1.79994 --0.189791 0.475774 1.82518 --0.117013 0.476169 1.84774 --0.0464147 0.476419 1.86786 -0.0219351 0.476551 1.8858 -0.0880179 0.476587 1.90179 -0.151863 0.476545 1.91607 -0.213543 0.476444 1.92883 -0.273173 0.476296 1.94028 -0.330907 0.476114 1.95058 -0.386937 0.475907 1.9599 -0.441492 0.475683 1.96836 -0.494836 0.475452 1.97608 -0.547273 0.475218 1.98318 -0.599146 0.474988 1.98973 -0.650839 0.474768 1.99582 -0.702783 0.474563 2.0015 -0.755464 0.474381 2.00685 -0.809428 0.474229 2.01189 -0.865268 0.474123 2.01668 -0.923559 0.474091 2.02124 -0.9858 0.47418 2.02565 -1.0548 0.474333 2.03005 -1.13492 0.474632 2.03458 -1.23232 0.475194 2.0394 -1.355 0.476107 2.04462 -1.51391 0.477402 2.05026 -1.72465 0.479072 2.05624 -2.01008 0.481269 2.06228 -2.40409 0.484811 2.06776 -2.95578 0.492378 2.07115 -3.7249 0.512706 2.06613 -4.7159 0.577207 2.01562 --1.70888 0.683347 -2.40376 --1.83427 0.676217 -2.30852 --1.95794 0.668661 -2.20519 --2.07898 0.660766 -2.09364 --2.1964 0.652639 -1.97385 --2.30921 0.644412 -1.84588 --2.41639 0.636242 -1.70994 --2.51694 0.628321 -1.56632 --2.6099 0.620873 -1.41541 --2.69437 0.614146 -1.2576 --2.76964 0.608305 -1.0932 --2.83503 0.603271 -0.922637 --2.89 0.598768 -0.746571 --2.93401 0.594522 -0.565711 --2.96659 0.590415 -0.380595 --2.98712 0.586648 -0.191682 --2.99457 0.584289 4.6224e-05 --2.98712 0.586643 0.191777 --2.96659 0.590407 0.380695 --2.93401 0.594508 0.565818 --2.89 0.598749 0.746689 --2.83503 0.603246 0.922768 --2.76963 0.608272 1.09335 --2.69437 0.614105 1.25777 --2.60988 0.620821 1.4156 --2.51691 0.628256 1.56654 --2.41635 0.636163 1.71018 --2.30915 0.644316 1.84616 --2.19632 0.652524 1.97416 --2.07887 0.660629 2.094 --1.95781 0.668499 2.20559 --1.8341 0.676025 2.30897 --1.70867 0.683121 2.40425 --1.58241 0.689721 2.49166 --1.45611 0.695776 2.57149 --1.33051 0.701257 2.64407 --1.20625 0.706154 2.7098 --1.08391 0.710471 2.7691 --0.963985 0.714228 2.82241 --0.846868 0.717456 2.87019 --0.732882 0.720193 2.91289 --0.622263 0.722485 2.95098 --0.515166 0.724379 2.98491 --0.411669 0.725922 3.01509 --0.311778 0.72716 3.04195 --0.215434 0.728137 3.06586 --0.122516 0.728893 3.08719 --0.0328514 0.729462 3.10626 -0.0537833 0.729878 3.12337 -0.137657 0.730168 3.13879 -0.219083 0.730357 3.15275 -0.298417 0.730465 3.16547 -0.376061 0.730513 3.17712 -0.452461 0.730513 3.18786 -0.528119 0.730481 3.19785 -0.603591 0.730428 3.20719 -0.679502 0.730363 3.21599 -0.756556 0.730298 3.22435 -0.835548 0.730243 3.23234 -0.917372 0.730213 3.24004 -1.00298 0.730234 3.24749 -1.09408 0.730346 3.25479 -1.19349 0.730511 3.26208 -1.30516 0.730795 3.26951 -1.4344 0.731286 3.2772 -1.58777 0.732059 3.28523 -1.77395 0.733191 3.2936 -2.00503 0.734829 3.30223 -2.2986 0.737356 3.31081 -2.68092 0.741728 3.31871 -3.19037 0.750207 3.32425 -3.87157 0.768127 3.32221 -4.7159 0.806693 3.29503 --2.9558 1.07695 -4.16215 --3.18508 1.06283 -4.0092 --3.41162 1.04871 -3.84032 --3.63362 1.03476 -3.65517 --3.84924 1.02115 -3.45365 --4.05664 1.00805 -3.23581 --4.25394 0.995584 -3.00196 --4.43935 0.983874 -2.75259 --4.6111 0.973004 -2.48846 --4.76754 0.963031 -2.21051 --4.90712 0.953978 -1.91993 --5.02848 0.945829 -1.61809 --5.13042 0.938533 -1.30657 --5.21197 0.931996 -0.987078 --5.27236 0.926085 -0.661495 --5.31114 0.920621 -0.331788 --5.32807 0.915383 0 --5.31114 0.920621 0.331788 --5.27236 0.926085 0.661495 --5.21197 0.931996 0.987078 --5.13042 0.938533 1.30657 --5.02848 0.945829 1.61809 --4.90712 0.953978 1.91993 --4.76754 0.963031 2.21051 --4.6111 0.973004 2.48846 --4.43935 0.983874 2.75259 --4.25394 0.995584 3.00196 --4.05664 1.00805 3.23581 --3.84924 1.02115 3.45365 --3.63362 1.03476 3.65517 --3.41162 1.04871 3.84032 --3.18508 1.06283 4.0092 --2.9558 1.07695 4.16215 --2.72551 1.09087 4.29964 --2.49586 1.10442 4.42229 --2.2684 1.11743 4.53088 --2.04459 1.12974 4.62625 --1.82576 1.14121 4.70935 --1.61311 1.15172 4.78117 --1.40772 1.16119 4.84274 --1.21055 1.16955 4.8951 --1.0224 1.17678 4.93929 --0.843953 1.18288 4.97633 --0.67576 1.18787 5.0072 --0.518234 1.19182 5.03281 --0.371662 1.1948 5.05405 --0.236206 1.19691 5.0717 --0.111906 1.19826 5.08649 -0.00131476 1.19896 5.09909 -0.103655 1.19912 5.11107 -0.195437 1.19887 5.12304 -0.277079 1.19832 5.13502 -0.349099 1.19761 5.14699 -0.412117 1.19688 5.15897 -0.466856 1.19616 5.17094 -0.514147 1.19545 5.18292 -0.554931 1.19473 5.19489 -0.590265 1.19401 5.20686 -0.621323 1.19329 5.21884 -0.649406 1.19257 5.23081 -0.675941 1.19185 5.24279 -0.703103 1.19113 5.25476 -0.736106 1.19041 5.26674 -0.782317 1.18969 5.27871 -0.851195 1.18897 5.29069 -0.954885 1.18825 5.30266 -1.10898 1.18753 5.31464 -1.33351 1.18681 5.32661 -1.65417 1.18609 5.33859 -2.10399 1.18537 5.35056 -2.72536 1.18465 5.36254 -3.5727 1.18393 5.37451 -4.7159 1.18321 5.38649 -0.326282 0.331607 -0.0263909 -0.309588 0.331344 -0.0255989 -0.293803 0.331051 -0.0246989 -0.279002 0.330732 -0.0236998 -0.26525 0.33039 -0.02261 -0.252594 0.330027 -0.0214413 -0.24107 0.32965 -0.0202109 -0.230697 0.329265 -0.0189428 -0.221472 0.328881 -0.0176656 -0.213373 0.328505 -0.0164076 -0.20636 0.3281 -0.0150412 -0.20041 0.327586 -0.0132931 -0.195542 0.326934 -0.0110617 -0.191751 0.326182 -0.00847657 -0.18896 0.325383 -0.00571858 -0.187095 0.324562 -0.00288168 -0.186144 0.323729 0 -0.187095 0.324562 0.00288168 -0.18896 0.325383 0.00571858 -0.191751 0.326182 0.00847657 -0.195542 0.326934 0.0110617 -0.20041 0.327586 0.0132931 -0.20636 0.3281 0.0150412 -0.213373 0.328505 0.0164076 -0.221472 0.328881 0.0176656 -0.230697 0.329265 0.0189428 -0.24107 0.32965 0.0202109 -0.252594 0.330027 0.0214413 -0.26525 0.33039 0.02261 -0.279002 0.330732 0.0236998 -0.293803 0.331051 0.0246989 -0.309588 0.331344 0.0255989 -0.326282 0.331607 0.0263909 -0.343797 0.331838 0.0270628 -0.362035 0.332029 0.0275968 -0.380891 0.332173 0.0279698 -0.400251 0.332262 0.0281552 -0.419996 0.332287 0.028127 -0.440003 0.332239 0.027865 -0.460151 0.332116 0.027359 -0.480316 0.331918 0.026613 -0.500382 0.331648 0.0256453 -0.520234 0.331317 0.0244869 -0.539765 0.330935 0.0231774 -0.558873 0.330515 0.0217597 -0.577464 0.330071 0.020274 -0.59545 0.329612 0.018754 -0.612749 0.329146 0.0172247 -0.629293 0.32868 0.0157021 -0.645021 0.328215 0.014195 -0.659888 0.327753 0.0127085 -0.673863 0.327297 0.0112461 -0.686933 0.326848 0.00981273 -0.699105 0.326408 0.00841494 -0.710407 0.32598 0.00706074 -0.720889 0.325567 0.00575833 -0.730622 0.325172 0.00451393 -0.739706 0.324795 0.0033304 -0.748261 0.324434 0.00219893 -0.756436 0.324081 0.00109817 -0.764406 0.323729 0 -0.772631 0.323729 0 -0.782445 0.323729 0 -0.797971 0.323729 0 -0.826815 0.323729 0 -0.881047 0.323729 0 -0.978479 0.323729 0 -1.14428 0.323729 0 -1.4131 0.323729 0 -1.83172 0.323729 0 -2.4625 0.323729 0 -3.38786 0.323729 0 -4.7159 0.323729 0 -0.326281 0.331606 -0.0264117 -0.309588 0.331342 -0.0256196 -0.293802 0.331049 -0.0247195 -0.279002 0.33073 -0.0237203 -0.265248 0.330388 -0.0226303 -0.252593 0.330025 -0.0214615 -0.241069 0.329648 -0.0202309 -0.230696 0.329263 -0.0189627 -0.22147 0.328879 -0.0176852 -0.213372 0.328502 -0.016427 -0.206358 0.328097 -0.0150603 -0.200407 0.327583 -0.0133117 -0.195536 0.326932 -0.0110796 -0.191742 0.32618 -0.00849287 -0.188947 0.325381 -0.00573177 -0.187078 0.324561 -0.0028896 -0.186127 0.323736 0 -0.187078 0.324561 0.0028896 -0.188947 0.325381 0.00573177 -0.191742 0.32618 0.00849287 -0.195536 0.326932 0.0110796 -0.200407 0.327583 0.0133117 -0.206358 0.328097 0.0150603 -0.213372 0.328502 0.016427 -0.22147 0.328879 0.0176852 -0.230696 0.329263 0.0189627 -0.241069 0.329648 0.0202309 -0.252593 0.330025 0.0214615 -0.265248 0.330388 0.0226303 -0.279002 0.33073 0.0237203 -0.293802 0.331049 0.0247195 -0.309588 0.331342 0.0256196 -0.326281 0.331606 0.0264117 -0.343796 0.331836 0.0270836 -0.362035 0.332027 0.0276177 -0.380891 0.332172 0.0279908 -0.400251 0.332261 0.0281762 -0.419996 0.332285 0.0281481 -0.440004 0.332238 0.0278861 -0.460151 0.332115 0.0273801 -0.480317 0.331916 0.0266341 -0.500383 0.331647 0.0256664 -0.520235 0.331315 0.024508 -0.539766 0.330933 0.0231985 -0.558875 0.330514 0.0217808 -0.577466 0.330069 0.020295 -0.595451 0.32961 0.018775 -0.612751 0.329145 0.0172457 -0.629295 0.328678 0.015723 -0.645023 0.328213 0.0142158 -0.65989 0.327752 0.0127293 -0.673864 0.327296 0.0112668 -0.686935 0.326846 0.00983326 -0.699107 0.326406 0.00843535 -0.71041 0.325979 0.00708105 -0.720891 0.325566 0.00577854 -0.730625 0.32517 0.00453408 -0.739708 0.324794 0.00335049 -0.748263 0.324432 0.00221902 -0.756438 0.32408 0.0011183 -0.764408 0.323729 2.0447e-05 -0.772631 0.323728 2.0451e-05 -0.782446 0.323728 2.0566e-05 -0.797972 0.323728 2.0846e-05 -0.826816 0.323728 2.1504e-05 -0.881049 0.323728 2.2485e-05 -0.978481 0.323728 2.3154e-05 -1.14429 0.323728 2.3204e-05 -1.41311 0.323728 2.3135e-05 -1.83172 0.323728 2.3415e-05 -2.4625 0.323728 2.4247e-05 -3.38786 0.323728 2.6003e-05 -4.7159 0.323733 2.3002e-05 -0.32628 0.331603 -0.0264485 -0.309586 0.331339 -0.0256561 -0.293801 0.331046 -0.0247557 -0.279 0.330727 -0.0237561 -0.265246 0.330384 -0.0226658 -0.25259 0.330021 -0.0214964 -0.241067 0.329644 -0.0202653 -0.230693 0.329259 -0.0189966 -0.221469 0.328874 -0.0177186 -0.21337 0.328497 -0.0164595 -0.206356 0.328091 -0.0150918 -0.200402 0.327578 -0.0133421 -0.195527 0.326927 -0.0111085 -0.191727 0.326177 -0.00851899 -0.188927 0.325379 -0.00575275 -0.187052 0.324561 -0.00290209 -0.1861 0.323747 0 -0.187052 0.324561 0.00290209 -0.188927 0.325379 0.00575275 -0.191727 0.326177 0.00851899 -0.195527 0.326927 0.0111085 -0.200402 0.327578 0.0133421 -0.206356 0.328091 0.0150918 -0.21337 0.328497 0.0164595 -0.221469 0.328874 0.0177186 -0.230693 0.329259 0.0189966 -0.241067 0.329644 0.0202653 -0.25259 0.330021 0.0214964 -0.265246 0.330384 0.0226658 -0.279 0.330727 0.0237561 -0.293801 0.331046 0.0247557 -0.309586 0.331339 0.0256561 -0.32628 0.331603 0.0264485 -0.343795 0.331833 0.0271207 -0.362034 0.332025 0.027655 -0.38089 0.332169 0.0280283 -0.400251 0.332258 0.0282139 -0.419996 0.332283 0.0281859 -0.440004 0.332236 0.027924 -0.460152 0.332113 0.0274182 -0.480318 0.331914 0.0266722 -0.500384 0.331644 0.0257046 -0.520237 0.331313 0.0245463 -0.539768 0.330931 0.0232368 -0.558877 0.330511 0.0218191 -0.577468 0.330067 0.0203334 -0.595454 0.329608 0.0188134 -0.612754 0.329142 0.017284 -0.629298 0.328676 0.0157612 -0.645026 0.328211 0.014254 -0.659893 0.327749 0.0127673 -0.673868 0.327293 0.0113047 -0.686939 0.326844 0.00987107 -0.699111 0.326404 0.00847302 -0.710414 0.325976 0.00711857 -0.720895 0.325563 0.00581596 -0.730629 0.325168 0.00457142 -0.739713 0.324791 0.00338782 -0.748268 0.32443 0.0022564 -0.756443 0.324078 0.0011559 -0.76441 0.323729 5.9308e-05 -0.772632 0.323727 5.864e-05 -0.782447 0.323726 5.8816e-05 -0.797975 0.323725 5.9487e-05 -0.826819 0.323725 6.1188e-05 -0.881053 0.323725 6.3732e-05 -0.978485 0.323726 6.5364e-05 -1.14429 0.323727 6.5311e-05 -1.41311 0.323727 6.501e-05 -1.83173 0.323727 6.5721e-05 -2.46251 0.323727 6.7926e-05 -3.38787 0.323728 7.2558e-05 -4.7159 0.32374 6.1214e-05 -0.326277 0.331598 -0.0265136 -0.309583 0.331334 -0.0257205 -0.293798 0.331041 -0.0248193 -0.278996 0.330721 -0.0238188 -0.265243 0.330378 -0.0227275 -0.252587 0.330015 -0.021557 -0.241063 0.329638 -0.0203248 -0.230689 0.329252 -0.0190547 -0.221465 0.328867 -0.0177752 -0.213367 0.32849 -0.0165142 -0.206351 0.328083 -0.015144 -0.200393 0.32757 -0.0133918 -0.195512 0.326921 -0.0111553 -0.191703 0.326173 -0.00856099 -0.188894 0.325377 -0.00578625 -0.187011 0.324561 -0.00292191 -0.18606 0.323764 0 -0.187011 0.324561 0.00292191 -0.188894 0.325377 0.00578625 -0.191703 0.326173 0.00856099 -0.195512 0.326921 0.0111553 -0.200393 0.32757 0.0133918 -0.206351 0.328083 0.015144 -0.213367 0.32849 0.0165142 -0.221465 0.328867 0.0177752 -0.230689 0.329252 0.0190547 -0.241063 0.329638 0.0203248 -0.252587 0.330015 0.021557 -0.265243 0.330378 0.0227275 -0.278996 0.330721 0.0238188 -0.293798 0.331041 0.0248193 -0.309583 0.331334 0.0257205 -0.326277 0.331598 0.0265136 -0.343793 0.331829 0.0271864 -0.362032 0.33202 0.0277213 -0.380889 0.332165 0.0280951 -0.40025 0.332254 0.0282811 -0.419996 0.332278 0.0282535 -0.440005 0.332231 0.027992 -0.460154 0.332108 0.0274865 -0.480321 0.33191 0.0267408 -0.500387 0.33164 0.0257735 -0.520241 0.331308 0.0246154 -0.539772 0.330926 0.0233062 -0.558882 0.330507 0.0218886 -0.577473 0.330062 0.020403 -0.595459 0.329603 0.0188831 -0.61276 0.329138 0.0173538 -0.629304 0.328671 0.015831 -0.645032 0.328206 0.0143237 -0.6599 0.327745 0.0128369 -0.673875 0.327288 0.0113742 -0.686946 0.326839 0.00994041 -0.699119 0.326399 0.0085422 -0.710422 0.325971 0.00718763 -0.720904 0.325559 0.00588493 -0.730638 0.325163 0.00464039 -0.739722 0.324787 0.00345689 -0.748277 0.324426 0.00232573 -0.756452 0.324075 0.00122588 -0.764415 0.323728 0.000132837 -0.772632 0.323723 0.000129711 -0.782449 0.323722 0.000129703 -0.797979 0.32372 0.00013083 -0.826824 0.32372 0.000134119 -0.881059 0.323721 0.000139195 -0.978493 0.323722 0.000142372 -1.1443 0.323724 0.000142017 -1.41312 0.323725 0.000141199 -1.83174 0.323724 0.000142574 -2.46252 0.323725 0.000147056 -3.38788 0.323726 0.000156416 -4.7159 0.323752 0.000124833 -0.326273 0.33159 -0.0266283 -0.309578 0.331325 -0.0258336 -0.293792 0.331032 -0.0249306 -0.27899 0.330712 -0.0239281 -0.265236 0.330368 -0.0228345 -0.25258 0.330005 -0.0216617 -0.241056 0.329627 -0.0204268 -0.230683 0.329241 -0.0191539 -0.221459 0.328856 -0.0178712 -0.213362 0.328478 -0.0166059 -0.206344 0.32807 -0.0152303 -0.20038 0.327558 -0.013473 -0.195488 0.326911 -0.011231 -0.191666 0.326166 -0.00862844 -0.188841 0.325374 -0.00583973 -0.186946 0.324563 -0.00295333 -0.185996 0.323791 1e-09 -0.186946 0.324563 0.00295333 -0.188841 0.325374 0.00583973 -0.191666 0.326166 0.00862844 -0.195488 0.326911 0.011231 -0.20038 0.327558 0.013473 -0.206344 0.32807 0.0152303 -0.213362 0.328478 0.0166059 -0.221459 0.328856 0.0178712 -0.230683 0.329241 0.0191539 -0.241056 0.329627 0.0204268 -0.25258 0.330005 0.0216617 -0.265236 0.330368 0.0228345 -0.27899 0.330712 0.0239281 -0.293792 0.331032 0.0249306 -0.309578 0.331325 0.0258336 -0.326273 0.33159 0.0266283 -0.343789 0.331821 0.0273026 -0.36203 0.332013 0.0278387 -0.380887 0.332157 0.0282136 -0.400249 0.332246 0.0284007 -0.419997 0.332271 0.028374 -0.440007 0.332224 0.0281133 -0.460157 0.332101 0.0276086 -0.480325 0.331902 0.0268637 -0.500393 0.331632 0.025897 -0.520247 0.3313 0.0247396 -0.53978 0.330918 0.023431 -0.55889 0.330499 0.0220139 -0.577482 0.330054 0.0205288 -0.595469 0.329595 0.0190093 -0.61277 0.32913 0.0174802 -0.629314 0.328663 0.0159576 -0.645043 0.328198 0.0144504 -0.659911 0.327736 0.0129636 -0.673887 0.32728 0.0115008 -0.686959 0.32683 0.0100669 -0.699133 0.32639 0.00866863 -0.710436 0.325963 0.00731403 -0.720918 0.32555 0.00601141 -0.730653 0.325155 0.00476709 -0.739738 0.324779 0.00358403 -0.748294 0.324418 0.00245366 -0.756468 0.324068 0.00135547 -0.764424 0.323727 0.000270969 -0.772633 0.323718 0.000261295 -0.782454 0.323714 0.000260395 -0.797986 0.323712 0.000261851 -0.826833 0.323711 0.000267433 -0.88107 0.323712 0.000276603 -0.978507 0.323716 0.000282424 -1.14432 0.32372 0.000281523 -1.41314 0.32372 0.000279685 -1.83176 0.32372 0.000282076 -2.46255 0.323721 0.000290314 -3.3879 0.323724 0.0003074 -4.7159 0.323775 0.000230537 -0.326265 0.331576 -0.0268292 -0.309569 0.331311 -0.026031 -0.293782 0.331017 -0.0251242 -0.278979 0.330696 -0.0241174 -0.265224 0.330352 -0.0230192 -0.252568 0.329988 -0.0218413 -0.241043 0.329609 -0.020601 -0.230671 0.329223 -0.0193221 -0.221448 0.328837 -0.0180328 -0.213352 0.328458 -0.0167588 -0.206332 0.32805 -0.0153724 -0.200357 0.327539 -0.0136049 -0.195449 0.326897 -0.0113529 -0.191605 0.326158 -0.00873629 -0.188758 0.325371 -0.00592472 -0.186844 0.324568 -0.00300296 -0.185898 0.323831 1e-09 -0.186844 0.324568 0.00300296 -0.188758 0.325371 0.00592472 -0.191605 0.326158 0.0087363 -0.195449 0.326897 0.0113529 -0.200357 0.327539 0.0136049 -0.206332 0.32805 0.0153724 -0.213352 0.328458 0.0167588 -0.221448 0.328837 0.0180328 -0.230671 0.329223 0.0193221 -0.241043 0.329609 0.020601 -0.252568 0.329988 0.0218413 -0.265224 0.330352 0.0230192 -0.278979 0.330696 0.0241174 -0.293782 0.331017 0.0251242 -0.309569 0.331311 0.026031 -0.326265 0.331576 0.0268292 -0.343783 0.331807 0.0275065 -0.362024 0.332 0.0280454 -0.380884 0.332144 0.0284227 -0.400248 0.332234 0.0286119 -0.419997 0.332258 0.0285873 -0.44001 0.332211 0.0283284 -0.460162 0.332087 0.0278255 -0.480333 0.331888 0.0270823 -0.500403 0.331618 0.0261173 -0.520259 0.331286 0.0249614 -0.539794 0.330904 0.0236542 -0.558905 0.330485 0.0222385 -0.577498 0.33004 0.0207545 -0.595486 0.329581 0.019236 -0.612788 0.329115 0.0177077 -0.629333 0.328648 0.0161857 -0.645063 0.328183 0.0146789 -0.659932 0.327721 0.0131924 -0.673909 0.327265 0.0117298 -0.686982 0.326815 0.0102961 -0.699157 0.326375 0.00889802 -0.710462 0.325947 0.00754377 -0.720945 0.325535 0.0062417 -0.730681 0.32514 0.00499826 -0.739766 0.324764 0.00381645 -0.748324 0.324405 0.00268804 -0.756498 0.324057 0.00159374 -0.764441 0.323725 0.00052775 -0.772637 0.323707 0.000503192 -0.782463 0.323701 0.000499645 -0.798 0.323696 0.000500765 -0.82685 0.323694 0.00050936 -0.881091 0.323698 0.000525004 -0.978533 0.323705 0.000535427 -1.14435 0.323712 0.000533719 -1.41318 0.323713 0.000529989 -1.8318 0.323712 0.000533895 -2.46259 0.323714 0.000548257 -3.38794 0.32372 0.000577814 -4.7159 0.323815 0.000405605 -0.326251 0.331553 -0.0271779 -0.309554 0.331287 -0.0263727 -0.293765 0.330992 -0.0254581 -0.27896 0.33067 -0.0244427 -0.265204 0.330325 -0.0233352 -0.252546 0.329961 -0.0221472 -0.241021 0.329581 -0.0208959 -0.230649 0.329195 -0.0196053 -0.221429 0.328808 -0.0183028 -0.213334 0.328428 -0.0170118 -0.206309 0.32802 -0.0156048 -0.200319 0.327512 -0.0138181 -0.195384 0.326877 -0.011548 -0.191508 0.326147 -0.00890765 -0.188627 0.325368 -0.00605888 -0.186683 0.324578 -0.00308077 -0.185743 0.323891 2e-09 -0.186683 0.324578 0.00308078 -0.188627 0.325368 0.00605888 -0.191508 0.326147 0.00890766 -0.195384 0.326877 0.011548 -0.200319 0.327512 0.0138181 -0.206309 0.32802 0.0156048 -0.213334 0.328428 0.0170118 -0.221429 0.328808 0.0183028 -0.230649 0.329195 0.0196053 -0.241021 0.329581 0.020896 -0.252546 0.32996 0.0221472 -0.265204 0.330325 0.0233352 -0.27896 0.33067 0.0244427 -0.293765 0.330992 0.0254581 -0.309554 0.331287 0.0263727 -0.326251 0.331553 0.0271779 -0.343771 0.331785 0.0278615 -0.362015 0.331977 0.0284059 -0.380877 0.332122 0.0287882 -0.400245 0.332212 0.028982 -0.419998 0.332236 0.0289615 -0.440014 0.332188 0.0287066 -0.460171 0.332064 0.0282074 -0.480345 0.331865 0.0274678 -0.50042 0.331595 0.0265063 -0.520279 0.331263 0.0253538 -0.539817 0.33088 0.0240499 -0.558931 0.33046 0.0226372 -0.577527 0.330015 0.0211559 -0.595516 0.329556 0.0196398 -0.612819 0.32909 0.0181134 -0.629367 0.328623 0.016593 -0.645098 0.328157 0.0150875 -0.659969 0.327695 0.0136021 -0.673948 0.327238 0.0121404 -0.687023 0.326788 0.0107076 -0.699201 0.326348 0.0093106 -0.710507 0.32592 0.00795767 -0.720993 0.325508 0.00665737 -0.730731 0.325114 0.00541628 -0.739818 0.324739 0.00423758 -0.748377 0.324381 0.00311369 -0.756552 0.324037 0.00202796 -0.764473 0.323719 0.000998119 -0.772645 0.323689 0.000943845 -0.782482 0.323677 0.000933691 -0.798027 0.323669 0.000932503 -0.826882 0.323666 0.000944372 -0.881128 0.323672 0.00096977 -0.978579 0.323686 0.000988061 -1.1444 0.323698 0.00098534 -1.41324 0.3237 0.000978241 -1.83187 0.323698 0.000984327 -2.46267 0.323702 0.00100851 -3.38801 0.323713 0.00105784 -4.7159 0.323882 0.00069465 -0.326226 0.331515 -0.0277767 -0.309525 0.331248 -0.0269578 -0.293733 0.330951 -0.0260279 -0.278926 0.330628 -0.0249959 -0.265167 0.330282 -0.0238703 -0.252507 0.329916 -0.0226628 -0.240982 0.329536 -0.0213906 -0.23061 0.329149 -0.0200774 -0.221392 0.328763 -0.0187498 -0.213299 0.328383 -0.0174269 -0.206266 0.327974 -0.0159819 -0.200252 0.327472 -0.0141604 -0.195278 0.326849 -0.011858 -0.191352 0.326133 -0.00917771 -0.188418 0.325369 -0.00626884 -0.186431 0.324597 -0.00320169 -0.185497 0.323976 4e-09 -0.186431 0.324597 0.0032017 -0.188418 0.325369 0.00626885 -0.191352 0.326133 0.00917773 -0.195278 0.326849 0.011858 -0.200252 0.327472 0.0141604 -0.206266 0.327974 0.0159819 -0.213299 0.328383 0.0174269 -0.221392 0.328763 0.0187498 -0.23061 0.329149 0.0200774 -0.240982 0.329536 0.0213907 -0.252507 0.329916 0.0226628 -0.265167 0.330282 0.0238703 -0.278926 0.330628 0.0249959 -0.293733 0.330951 0.026028 -0.309525 0.331248 0.0269578 -0.326226 0.331515 0.0277768 -0.343749 0.331747 0.0284727 -0.361998 0.331941 0.0290282 -0.380865 0.332086 0.0294204 -0.400238 0.332175 0.0296232 -0.419998 0.332199 0.0296111 -0.440021 0.33215 0.0293641 -0.460185 0.332026 0.0288725 -0.480367 0.331826 0.0281404 -0.500448 0.331555 0.0271862 -0.520314 0.331222 0.0260408 -0.539857 0.330839 0.0247437 -0.558976 0.330419 0.0233374 -0.577575 0.329973 0.021862 -0.595568 0.329513 0.020351 -0.612874 0.329047 0.0188292 -0.629424 0.328579 0.0173126 -0.645159 0.328112 0.0158104 -0.660033 0.327649 0.0143278 -0.674016 0.327192 0.0128688 -0.687095 0.326741 0.0114388 -0.699277 0.3263 0.0100448 -0.710588 0.325873 0.00869554 -0.721077 0.325461 0.0073997 -0.730819 0.325068 0.0061642 -0.73991 0.324694 0.00499251 -0.748472 0.324339 0.00387839 -0.756647 0.324001 0.00281063 -0.764534 0.323706 0.0018432 -0.77267 0.323656 0.00173753 -0.782523 0.323636 0.00171251 -0.798083 0.323621 0.00170421 -0.826943 0.323616 0.00171793 -0.881197 0.323628 0.00175686 -0.97866 0.323653 0.00178802 -1.1445 0.323674 0.00178427 -1.41335 0.323677 0.00177138 -1.832 0.323674 0.00178045 -2.4628 0.32368 0.00182003 -3.38814 0.3237 0.00190004 -4.7159 0.323996 0.00117064 -0.32618 0.331453 -0.0287926 -0.309473 0.331184 -0.0279475 -0.293675 0.330886 -0.0269888 -0.278863 0.330561 -0.0259253 -0.2651 0.330213 -0.0247656 -0.252437 0.329846 -0.0235217 -0.240909 0.329466 -0.0222107 -0.230538 0.329079 -0.0208556 -0.221323 0.328694 -0.0194816 -0.213231 0.328314 -0.0181011 -0.206184 0.327907 -0.0165892 -0.200132 0.327415 -0.0147058 -0.195099 0.326811 -0.012347 -0.191098 0.326117 -0.00959964 -0.188084 0.325375 -0.00659432 -0.186034 0.324633 -0.00338765 -0.185105 0.324089 8e-09 -0.186034 0.324633 0.00338767 -0.188084 0.325375 0.00659434 -0.191098 0.326117 0.00959967 -0.195099 0.326811 0.012347 -0.200132 0.327415 0.0147059 -0.206184 0.327907 0.0165892 -0.213231 0.328314 0.0181012 -0.221323 0.328694 0.0194816 -0.230538 0.329079 0.0208556 -0.240909 0.329466 0.0222108 -0.252437 0.329846 0.0235218 -0.2651 0.330213 0.0247657 -0.278863 0.330561 0.0259253 -0.293675 0.330886 0.0269888 -0.309473 0.331184 0.0279476 -0.32618 0.331452 0.0287927 -0.343709 0.331687 0.0295122 -0.361965 0.33188 0.0300889 -0.380841 0.332026 0.0305003 -0.400224 0.332114 0.0307205 -0.419994 0.332137 0.0307246 -0.44003 0.332087 0.0304931 -0.460206 0.331961 0.0300166 -0.480401 0.33176 0.0292992 -0.500494 0.331487 0.0283595 -0.52037 0.331153 0.0272284 -0.539923 0.330769 0.0259451 -0.55905 0.330348 0.0245518 -0.577656 0.329902 0.0230884 -0.595654 0.329441 0.0215883 -0.612966 0.328973 0.0200761 -0.629521 0.328504 0.0185679 -0.645262 0.328036 0.0170731 -0.660142 0.327571 0.0155974 -0.674132 0.327112 0.014145 -0.687218 0.32666 0.0127219 -0.699406 0.326219 0.0113354 -0.710725 0.325791 0.00999478 -0.721222 0.32538 0.00870908 -0.730971 0.324988 0.00748572 -0.740069 0.324617 0.00632878 -0.748637 0.324267 0.00523475 -0.756811 0.323939 0.00420245 -0.76465 0.323672 0.00332675 -0.772737 0.323599 0.00314724 -0.782619 0.323564 0.00309173 -0.798199 0.32354 0.00306594 -0.827065 0.323532 0.00307582 -0.881327 0.323552 0.00313092 -0.978807 0.323597 0.00318165 -1.14467 0.323633 0.00317722 -1.41355 0.323638 0.00315472 -1.83222 0.323632 0.00316759 -2.46304 0.323644 0.0032307 -3.38835 0.32368 0.00335703 -4.7159 0.324187 0.00195291 -0.326092 0.331353 -0.0304919 -0.309375 0.331083 -0.0295984 -0.293568 0.330782 -0.0285867 -0.278747 0.330456 -0.0274656 -0.264976 0.330106 -0.026244 -0.252306 0.329738 -0.0249341 -0.240774 0.329358 -0.0235528 -0.230401 0.328973 -0.0221222 -0.221187 0.328591 -0.020665 -0.213093 0.328213 -0.0191844 -0.206021 0.327811 -0.0175588 -0.199913 0.327336 -0.0155692 -0.194791 0.326759 -0.0131125 -0.190678 0.326099 -0.0102531 -0.187548 0.325391 -0.00709387 -0.185405 0.324692 -0.00367054 -0.184472 0.324232 1.5e-08 -0.185405 0.324692 0.00367058 -0.187548 0.325391 0.00709392 -0.190678 0.326098 0.0102531 -0.194791 0.326759 0.0131125 -0.199913 0.327336 0.0155692 -0.206021 0.327811 0.0175588 -0.213093 0.328212 0.0191845 -0.221187 0.32859 0.0206651 -0.230401 0.328973 0.0221223 -0.240775 0.329358 0.0235528 -0.252306 0.329738 0.0249342 -0.264976 0.330106 0.0262441 -0.278747 0.330455 0.0274657 -0.293568 0.330782 0.0285868 -0.309375 0.331083 0.0295985 -0.326092 0.331353 0.030492 -0.343633 0.331589 0.0312553 -0.361902 0.331783 0.0318715 -0.380792 0.331928 0.0323187 -0.400192 0.332016 0.0325718 -0.419981 0.332037 0.0326067 -0.440037 0.331985 0.0324046 -0.460234 0.331856 0.0319566 -0.480449 0.331652 0.0312675 -0.500562 0.331377 0.0303559 -0.520457 0.33104 0.0292523 -0.540026 0.330654 0.0279957 -0.559167 0.330231 0.0266279 -0.577785 0.329783 0.0251884 -0.595793 0.32932 0.02371 -0.613114 0.32885 0.0222173 -0.629679 0.328378 0.0207267 -0.645429 0.327908 0.019248 -0.66032 0.32744 0.0177874 -0.674321 0.326978 0.0163499 -0.687419 0.326524 0.0149421 -0.699622 0.326081 0.0135724 -0.710954 0.325653 0.0122504 -0.721465 0.325242 0.0109859 -0.731228 0.324852 0.00978716 -0.74034 0.324486 0.0086595 -0.74892 0.324144 0.00760436 -0.757092 0.323834 0.00663573 -0.764877 0.323597 0.00586967 -0.772915 0.323499 0.00560699 -0.78284 0.323443 0.00549627 -0.798452 0.323402 0.0054331 -0.827314 0.32339 0.00542441 -0.881576 0.323427 0.005493 -0.979075 0.323504 0.00557035 -1.14497 0.323565 0.00556595 -1.41389 0.323572 0.00552802 -1.8326 0.323563 0.0055452 -2.46345 0.323584 0.0056432 -3.38872 0.323646 0.00583717 -4.7159 0.324506 0.00323664 -0.325923 0.331198 -0.0332908 -0.309188 0.330925 -0.0323105 -0.293364 0.330622 -0.0312041 -0.278527 0.330293 -0.0299807 -0.264741 0.329942 -0.0286496 -0.252057 0.329574 -0.0272232 -0.240515 0.329197 -0.0257184 -0.230134 0.328815 -0.0241559 -0.220913 0.328439 -0.0225542 -0.212804 0.328068 -0.0209055 -0.20569 0.327679 -0.0190939 -0.199495 0.327229 -0.0169268 -0.194243 0.326692 -0.0143028 -0.18997 0.326079 -0.0112569 -0.186671 0.325421 -0.00785325 -0.184395 0.324781 -0.00409622 -0.183441 0.324404 3e-08 -0.184395 0.324781 0.0040963 -0.186671 0.325421 0.00785335 -0.18997 0.326079 0.011257 -0.194243 0.326692 0.0143029 -0.199495 0.327228 0.0169269 -0.20569 0.327678 0.019094 -0.212804 0.328068 0.0209056 -0.220913 0.328439 0.0225543 -0.230134 0.328815 0.024156 -0.240515 0.329196 0.0257186 -0.252058 0.329574 0.0272234 -0.264741 0.329942 0.0286498 -0.278527 0.330293 0.0299809 -0.293364 0.330622 0.0312043 -0.309188 0.330925 0.0323107 -0.325923 0.331197 0.033291 -0.343483 0.331435 0.0341332 -0.361774 0.331629 0.0348211 -0.380689 0.331773 0.0353336 -0.400117 0.331859 0.035647 -0.419937 0.331876 0.0357385 -0.440026 0.33182 0.0355907 -0.460258 0.331687 0.0351958 -0.480508 0.331478 0.0345592 -0.500653 0.331198 0.0336996 -0.520579 0.330858 0.0326475 -0.540175 0.330468 0.0314411 -0.559338 0.330041 0.0301215 -0.577976 0.329589 0.0287272 -0.596003 0.329123 0.0272907 -0.61334 0.328649 0.0258364 -0.629921 0.328172 0.0243809 -0.645688 0.327697 0.0229348 -0.660597 0.327224 0.0215054 -0.674619 0.326758 0.020099 -0.68774 0.3263 0.0187235 -0.699966 0.325854 0.0173881 -0.711323 0.325424 0.0161036 -0.721861 0.325014 0.0148806 -0.731652 0.324628 0.0137286 -0.740792 0.324269 0.0126551 -0.749396 0.32394 0.0116687 -0.757573 0.323653 0.0107969 -0.765326 0.323439 0.010135 -0.77335 0.323323 0.00980222 -0.783342 0.323241 0.00960932 -0.799001 0.323178 0.00947668 -0.827839 0.32316 0.00941901 -0.88207 0.323224 0.00948475 -0.979574 0.323354 0.00959136 -1.1455 0.323456 0.00958729 -1.41447 0.323467 0.00952545 -1.83325 0.323451 0.00954656 -2.46413 0.323487 0.00969437 -3.38934 0.323595 0.00998331 -4.7159 0.325035 0.00534108 -0.325582 0.330961 -0.037824 -0.308814 0.330686 -0.0366925 -0.29296 0.330381 -0.035422 -0.278092 0.33005 -0.034022 -0.264277 0.329699 -0.0325027 -0.251566 0.329334 -0.030877 -0.239997 0.328961 -0.0291615 -0.229592 0.328588 -0.0273749 -0.220345 0.328224 -0.0255302 -0.212194 0.327868 -0.0236093 -0.205003 0.327501 -0.0215037 -0.198679 0.32709 -0.0190482 -0.193244 0.326609 -0.0161432 -0.188745 0.32606 -0.0127882 -0.185212 0.32547 -0.00899719 -0.18275 0.324906 -0.00472998 -0.181743 0.3246 6.2e-08 -0.18275 0.324906 0.00473012 -0.185212 0.32547 0.00899738 -0.188745 0.32606 0.0127885 -0.193244 0.326608 0.0161434 -0.198679 0.327089 0.0190484 -0.205003 0.327501 0.0215039 -0.212194 0.327867 0.0236095 -0.220345 0.328223 0.0255305 -0.229592 0.328588 0.0273751 -0.239997 0.32896 0.0291618 -0.251566 0.329333 0.0308773 -0.264277 0.329698 0.032503 -0.278092 0.330049 0.0340223 -0.29296 0.33038 0.0354223 -0.308814 0.330685 0.0366929 -0.325582 0.33096 0.0378244 -0.343178 0.331198 0.0388052 -0.361506 0.331392 0.0396196 -0.380464 0.331534 0.0402483 -0.399938 0.331616 0.0406694 -0.419809 0.331627 0.0408625 -0.439952 0.331564 0.0408124 -0.460239 0.331423 0.0405131 -0.480544 0.331206 0.0399711 -0.500743 0.330919 0.0392055 -0.520717 0.330571 0.0382464 -0.540357 0.330174 0.0371309 -0.55956 0.329741 0.0358987 -0.578232 0.329283 0.0345873 -0.596289 0.32881 0.0332283 -0.613655 0.328328 0.031846 -0.630265 0.327844 0.0304577 -0.646062 0.327359 0.029075 -0.661005 0.326879 0.0277071 -0.675064 0.326404 0.0263622 -0.688226 0.325939 0.0250496 -0.700496 0.325488 0.0237802 -0.711903 0.325056 0.0225657 -0.722495 0.324647 0.0214178 -0.732343 0.324266 0.0203471 -0.741542 0.323917 0.0193638 -0.750202 0.323605 0.0184812 -0.758423 0.32334 0.0177254 -0.76622 0.323142 0.0171455 -0.774321 0.323014 0.0167677 -0.784435 0.322908 0.0164815 -0.800168 0.32282 0.0162419 -0.828944 0.322798 0.0160844 -0.883067 0.322907 0.0161046 -0.980518 0.323122 0.0162281 -1.14646 0.323289 0.0162215 -1.41548 0.323306 0.0161237 -1.83434 0.323279 0.0161464 -2.46526 0.32334 0.0163623 -3.39034 0.323522 0.0167782 -4.7159 0.325911 0.00878835 -0.324875 0.330612 -0.0450365 -0.308047 0.330336 -0.0436488 -0.292132 0.33003 -0.042102 -0.277206 0.329699 -0.0404065 -0.263332 0.329351 -0.0385734 -0.250563 0.328992 -0.0366164 -0.238935 0.328631 -0.0345519 -0.228467 0.328275 -0.0323962 -0.219147 0.327932 -0.0301569 -0.2109 0.327603 -0.0278084 -0.203573 0.327276 -0.0252502 -0.197058 0.32692 -0.0223375 -0.191368 0.326513 -0.0189696 -0.186567 0.326049 -0.0151075 -0.182721 0.325547 -0.0107047 -0.180008 0.325072 -0.00566337 -0.178912 0.324819 1.29e-07 -0.180008 0.325072 0.00566365 -0.182721 0.325547 0.010705 -0.186567 0.326048 0.0151079 -0.191368 0.326512 0.01897 -0.197058 0.326919 0.0223379 -0.203573 0.327275 0.0252506 -0.2109 0.327602 0.0278088 -0.219147 0.32793 0.0301573 -0.228467 0.328273 0.0323967 -0.238935 0.328629 0.0345524 -0.250563 0.328991 0.0366169 -0.263332 0.32935 0.0385739 -0.277206 0.329698 0.0404071 -0.292132 0.330028 0.0421026 -0.308047 0.330334 0.0436495 -0.324875 0.33061 0.0450373 -0.342534 0.330848 0.0462544 -0.360929 0.33104 0.0472865 -0.379959 0.331178 0.0481163 -0.39951 0.331252 0.0487252 -0.419463 0.331254 0.0490961 -0.439692 0.33118 0.0492171 -0.460067 0.331027 0.0490853 -0.480459 0.330797 0.0487087 -0.500741 0.330498 0.0481069 -0.520794 0.330138 0.0473094 -0.540505 0.32973 0.0463521 -0.559771 0.329286 0.0452728 -0.578501 0.328816 0.0441072 -0.596612 0.328331 0.0428859 -0.614031 0.327837 0.0416333 -0.630695 0.327339 0.0403674 -0.64655 0.326841 0.0391021 -0.661557 0.326346 0.0378484 -0.675686 0.325859 0.036617 -0.688927 0.325383 0.0354191 -0.701287 0.324924 0.0342666 -0.712794 0.324487 0.0331719 -0.723497 0.324078 0.0321466 -0.733468 0.323702 0.0312012 -0.7428 0.323363 0.0303452 -0.751601 0.323065 0.0295881 -0.759976 0.322815 0.028941 -0.767965 0.322623 0.02842 -0.776296 0.322491 0.0280178 -0.786651 0.322373 0.0276507 -0.802537 0.322272 0.0272819 -0.831217 0.322257 0.0269626 -0.885081 0.322434 0.0268573 -0.98233 0.322779 0.0269523 -1.14818 0.323049 0.02693 -1.41722 0.323076 0.0267796 -1.83616 0.323034 0.0267982 -2.46711 0.323135 0.0271024 -3.39197 0.323436 0.0276773 -4.7159 0.327356 0.0144324 -0.32337 0.330128 -0.0563001 -0.306426 0.329854 -0.0544909 -0.290396 0.32955 -0.0524929 -0.275353 0.329224 -0.0503172 -0.261359 0.328885 -0.0479765 -0.248465 0.32854 -0.0454853 -0.236706 0.328198 -0.0428601 -0.226096 0.32787 -0.0401154 -0.216614 0.327564 -0.0372553 -0.208175 0.327283 -0.0342511 -0.200617 0.327017 -0.0310051 -0.19382 0.326741 -0.0273801 -0.187789 0.326429 -0.0232665 -0.1826 0.326071 -0.0185852 -0.178363 0.325675 -0.0132245 -0.175336 0.325291 -0.00702056 -0.174114 0.325072 2.7e-07 -0.175335 0.32529 0.00702114 -0.178363 0.325675 0.0132251 -0.182601 0.32607 0.018586 -0.187789 0.326428 0.0232673 -0.19382 0.326739 0.0273809 -0.200617 0.327015 0.0310058 -0.208176 0.327281 0.0342519 -0.216614 0.327562 0.0372561 -0.226096 0.327868 0.0401162 -0.236706 0.328196 0.042861 -0.248465 0.328537 0.0454863 -0.261359 0.328882 0.0479775 -0.275353 0.329222 0.0503184 -0.290396 0.329547 0.0524941 -0.306426 0.329851 0.0544922 -0.32337 0.330125 0.0563015 -0.341146 0.33036 0.0579106 -0.359662 0.330547 0.0593066 -0.378817 0.330676 0.0604756 -0.398498 0.330739 0.0614029 -0.418585 0.330728 0.0620764 -0.438951 0.330638 0.0624889 -0.459464 0.330467 0.0626412 -0.479992 0.330219 0.0625438 -0.500406 0.329902 0.0622173 -0.520582 0.329524 0.0616905 -0.540409 0.329099 0.0609973 -0.559784 0.328636 0.0601736 -0.578617 0.328149 0.0592531 -0.596828 0.327645 0.0582653 -0.614348 0.32713 0.0572347 -0.631117 0.326611 0.0561808 -0.647088 0.326091 0.0551193 -0.662223 0.325576 0.0540637 -0.676497 0.325069 0.0530263 -0.689901 0.324576 0.0520194 -0.702447 0.324104 0.0510545 -0.714163 0.323659 0.0501424 -0.725102 0.323245 0.0492923 -0.735336 0.322869 0.0485108 -0.744959 0.322533 0.0478023 -0.754084 0.322241 0.0471682 -0.762819 0.321997 0.0466091 -0.771218 0.321808 0.0461287 -0.779997 0.321681 0.0457113 -0.790802 0.321569 0.0452816 -0.807018 0.321482 0.0447881 -0.835652 0.321505 0.0442625 -0.889057 0.321787 0.0439248 -0.985793 0.322319 0.0438948 -1.15132 0.322744 0.0438205 -1.42023 0.322792 0.0435948 -1.83918 0.322729 0.0435985 -2.4701 0.322891 0.0440098 -3.39453 0.323379 0.0447679 -4.7159 0.329738 0.02367 -0.320137 0.329531 -0.073561 -0.302967 0.329264 -0.0710786 -0.286707 0.328969 -0.0683649 -0.271427 0.328655 -0.0654318 -0.257189 0.328334 -0.0622932 -0.244039 0.328014 -0.058965 -0.23201 0.327707 -0.0554644 -0.221109 0.327425 -0.0518058 -0.211312 0.327176 -0.0479924 -0.202529 0.326968 -0.0439932 -0.194597 0.326793 -0.0397044 -0.187394 0.326626 -0.0349799 -0.18092 0.326438 -0.0296904 -0.175264 0.326207 -0.0237164 -0.170575 0.325928 -0.0168824 -0.167192 0.325622 -0.00896088 -0.165822 0.325416 5.67e-07 -0.167192 0.325622 0.00896207 -0.170575 0.325927 0.0168837 -0.175264 0.326206 0.0237178 -0.180921 0.326437 0.0296919 -0.187394 0.326624 0.0349814 -0.194597 0.32679 0.0397059 -0.202529 0.326965 0.0439947 -0.211312 0.327173 0.047994 -0.221109 0.327421 0.0518074 -0.23201 0.327704 0.0554661 -0.244039 0.32801 0.0589668 -0.257189 0.32833 0.0622951 -0.271427 0.328651 0.0654339 -0.286707 0.328964 0.0683671 -0.302967 0.329259 0.071081 -0.320136 0.329526 0.0735635 -0.338136 0.329753 0.0758037 -0.356874 0.329931 0.077791 -0.376252 0.330049 0.0795152 -0.396158 0.330097 0.0809669 -0.41647 0.330068 0.0821397 -0.437062 0.329957 0.0830323 -0.457798 0.329764 0.0836502 -0.478544 0.329493 0.0840071 -0.499169 0.329151 0.0841249 -0.519551 0.328749 0.0840319 -0.539575 0.328299 0.0837605 -0.559143 0.327812 0.0833445 -0.578168 0.327298 0.0828156 -0.596573 0.326766 0.0822029 -0.614297 0.326223 0.0815306 -0.631287 0.325675 0.0808192 -0.647499 0.325126 0.0800858 -0.662902 0.324582 0.0793446 -0.677479 0.324048 0.0786079 -0.691226 0.323532 0.0778863 -0.704155 0.323039 0.0771884 -0.716301 0.322576 0.076521 -0.727716 0.32215 0.0758881 -0.738473 0.321765 0.0752918 -0.748666 0.321423 0.0747319 -0.758405 0.321129 0.0742068 -0.7678 0.320886 0.0737147 -0.776903 0.320705 0.0732585 -0.786421 0.320595 0.0728222 -0.79798 0.320513 0.0723353 -0.814846 0.320478 0.0717289 -0.843677 0.320589 0.0709911 -0.89651 0.321028 0.0703344 -0.992265 0.321808 0.0700397 -1.15696 0.322453 0.0698406 -1.42539 0.322545 0.0695095 -1.84414 0.322458 0.0694813 -2.47485 0.322711 0.0700132 -3.3985 0.323483 0.0709564 -4.7159 0.333662 0.0387857 -0.313228 0.328998 -0.0995288 -0.295616 0.328745 -0.0959997 -0.278903 0.328467 -0.0921795 -0.263156 0.328176 -0.0880803 -0.248435 0.327885 -0.0837169 -0.234785 0.327607 -0.0791068 -0.222237 0.327354 -0.0742684 -0.2108 0.32714 -0.0692173 -0.200449 0.326978 -0.0639567 -0.191103 0.326875 -0.0584502 -0.182607 0.326828 -0.0525774 -0.174845 0.326807 -0.0461681 -0.167819 0.326772 -0.0390654 -0.161632 0.326686 -0.0311109 -0.15647 0.326518 -0.0220741 -0.152729 0.326265 -0.0116756 -0.151207 0.32604 1.176e-06 -0.152729 0.326265 0.011678 -0.156469 0.326517 0.0220767 -0.161632 0.326684 0.0311136 -0.167819 0.32677 0.0390681 -0.174845 0.326804 0.046171 -0.182607 0.326824 0.0525803 -0.191103 0.326871 0.0584532 -0.200448 0.326973 0.0639597 -0.210799 0.327135 0.0692204 -0.222237 0.327348 0.0742716 -0.234785 0.327601 0.0791101 -0.248434 0.327879 0.0837205 -0.263155 0.328169 0.0880841 -0.278902 0.32846 0.0921835 -0.295616 0.328737 0.096004 -0.313227 0.32899 0.0995333 -0.331657 0.329205 0.102762 -0.350818 0.32937 0.105682 -0.370609 0.329473 0.108287 -0.39092 0.329504 0.110574 -0.411631 0.329456 0.112543 -0.432613 0.329323 0.114198 -0.453731 0.329107 0.11555 -0.474852 0.328811 0.116618 -0.495845 0.328443 0.117423 -0.51659 0.328015 0.117996 -0.536976 0.327537 0.118367 -0.556909 0.32702 0.118569 -0.576308 0.326476 0.118632 -0.595106 0.325913 0.118584 -0.613249 0.325337 0.118449 -0.630693 0.324756 0.118247 -0.647402 0.324174 0.117995 -0.663356 0.323598 0.117704 -0.67854 0.323035 0.117384 -0.692957 0.32249 0.117042 -0.706622 0.321972 0.116683 -0.719568 0.321487 0.116309 -0.731845 0.321041 0.11592 -0.743521 0.320641 0.115518 -0.754683 0.32029 0.115101 -0.765436 0.319993 0.114671 -0.775885 0.319755 0.114227 -0.786078 0.319589 0.113778 -0.796724 0.319512 0.11331 -0.809453 0.319484 0.112759 -0.827447 0.319538 0.112045 -0.856987 0.319791 0.111119 -0.909477 0.320441 0.110136 -1.00382 0.321517 0.109461 -1.16691 0.322443 0.109035 -1.43417 0.322615 0.108563 -1.85224 0.322512 0.108482 -2.48232 0.322893 0.109138 -3.40453 0.324089 0.110228 -4.7159 0.34012 0.063516 -0.29878 0.329123 -0.137925 -0.280319 0.328888 -0.132798 -0.262735 0.328635 -0.127295 -0.2461 0.328378 -0.121426 -0.230477 0.328133 -0.115207 -0.215914 0.327914 -0.108656 -0.20245 0.327738 -0.101792 -0.190103 0.32762 -0.0946345 -0.178862 0.327575 -0.0871853 -0.168662 0.327615 -0.0794002 -0.159367 0.327735 -0.0711337 -0.15087 0.327896 -0.0621826 -0.143184 0.32804 -0.0523597 -0.136422 0.328101 -0.0414751 -0.130792 0.328022 -0.0292556 -0.126723 0.32777 -0.0153856 -0.125055 0.32748 2.387e-06 -0.126723 0.327769 0.0153905 -0.130792 0.32802 0.0292606 -0.136422 0.328098 0.0414803 -0.143184 0.328036 0.052365 -0.15087 0.327891 0.062188 -0.159367 0.327729 0.0711393 -0.168662 0.327609 0.0794058 -0.178861 0.327568 0.087191 -0.190102 0.327612 0.0946404 -0.202449 0.327729 0.101798 -0.215913 0.327905 0.108662 -0.230475 0.328123 0.115213 -0.246099 0.328367 0.121433 -0.262734 0.328623 0.127302 -0.280317 0.328876 0.132806 -0.298779 0.329109 0.137933 -0.318038 0.32931 0.142676 -0.338006 0.329462 0.14703 -0.358583 0.329553 0.150994 -0.379657 0.329572 0.15457 -0.401111 0.329511 0.157766 -0.422817 0.329364 0.16059 -0.444643 0.329132 0.163059 -0.46646 0.328821 0.165195 -0.488141 0.328437 0.167024 -0.509574 0.327991 0.168575 -0.530655 0.327494 0.169879 -0.551301 0.326958 0.170969 -0.571439 0.326394 0.171874 -0.591015 0.325809 0.172619 -0.609984 0.325212 0.173228 -0.628311 0.324608 0.173719 -0.645972 0.324004 0.174105 -0.66295 0.323407 0.174396 -0.679237 0.322821 0.174599 -0.694836 0.322256 0.174718 -0.709759 0.321718 0.174755 -0.724035 0.321214 0.174712 -0.737705 0.320753 0.17459 -0.75083 0.32034 0.174392 -0.763489 0.319982 0.174123 -0.775781 0.319685 0.173785 -0.787807 0.319457 0.173388 -0.79961 0.319315 0.172944 -0.81192 0.319283 0.172447 -0.826399 0.319323 0.171839 -0.846198 0.319486 0.171042 -0.877261 0.319908 0.169992 -0.930183 0.320794 0.168778 -1.0232 0.322171 0.167736 -1.18386 0.323405 0.167014 -1.44887 0.323707 0.166377 -1.86534 0.323609 0.166229 -2.49397 0.324165 0.167002 -3.41358 0.325985 0.16814 -4.7159 0.350744 0.103972 -0.269645 0.331454 -0.193848 -0.249604 0.331233 -0.186301 -0.230426 0.331004 -0.178249 -0.212195 0.330784 -0.169703 -0.194984 0.330591 -0.160679 -0.178861 0.330444 -0.151196 -0.163881 0.33036 -0.14128 -0.150083 0.330358 -0.130952 -0.137481 0.330457 -0.120217 -0.126034 0.33067 -0.109025 -0.115626 0.330989 -0.0972013 -0.106165 0.331358 -0.0845073 -0.0976684 0.331687 -0.0707289 -0.090251 0.331874 -0.0556533 -0.084125 0.331826 -0.038977 -0.0797216 0.331492 -0.0203612 -0.077897 0.331073 4.689e-06 -0.0797215 0.331491 0.0203707 -0.0841246 0.331823 0.0389867 -0.0902505 0.331869 0.0556633 -0.0976678 0.331681 0.0707391 -0.106165 0.331351 0.0845177 -0.115625 0.330981 0.0972118 -0.126033 0.330661 0.109035 -0.137479 0.330446 0.120228 -0.150081 0.330346 0.130963 -0.163879 0.330346 0.141291 -0.178859 0.330429 0.151208 -0.194982 0.330575 0.160691 -0.212192 0.330766 0.169716 -0.230424 0.330984 0.178262 -0.249601 0.331212 0.186315 -0.269642 0.331432 0.193862 -0.290458 0.331626 0.200901 -0.311953 0.331778 0.207429 -0.334024 0.331873 0.213452 -0.356557 0.331898 0.218976 -0.379434 0.331845 0.224014 -0.40253 0.331708 0.228582 -0.425719 0.331487 0.232701 -0.448878 0.331187 0.236396 -0.471891 0.330815 0.239697 -0.494654 0.330381 0.242635 -0.517077 0.329897 0.245243 -0.539087 0.329374 0.247553 -0.560627 0.328821 0.249595 -0.581651 0.328247 0.251395 -0.602126 0.327659 0.252975 -0.622028 0.327063 0.254353 -0.641339 0.326466 0.255543 -0.660047 0.325872 0.256555 -0.678146 0.325288 0.257395 -0.695636 0.324721 0.258071 -0.712527 0.324179 0.258586 -0.728841 0.323669 0.258945 -0.744613 0.323199 0.259155 -0.759896 0.322779 0.259222 -0.774766 0.322415 0.259157 -0.789318 0.322117 0.258971 -0.803651 0.321896 0.258677 -0.81781 0.321775 0.258293 -0.832562 0.321787 0.257827 -0.849641 0.321894 0.257229 -0.872221 0.322159 0.25644 -0.906007 0.322737 0.2554 -0.960777 0.323826 0.254159 -1.05353 0.325441 0.252952 -1.21161 0.326942 0.252002 -1.47315 0.327417 0.251236 -1.88654 0.327373 0.251042 -2.51223 0.328168 0.251923 -3.42723 0.330924 0.252913 -4.7159 0.368218 0.170151 -0.213621 0.339428 -0.274767 -0.190751 0.339188 -0.263559 -0.168764 0.338953 -0.251653 -0.147764 0.338745 -0.239062 -0.127854 0.338584 -0.225805 -0.109128 0.338491 -0.211911 -0.0916734 0.338489 -0.197415 -0.0755607 0.338598 -0.18235 -0.0608344 0.338841 -0.166731 -0.0474836 0.339233 -0.150506 -0.0354127 0.339759 -0.133473 -0.0245363 0.340334 -0.11536 -0.014867 0.340821 -0.0959278 -0.00651152 0.341071 -0.074951 --0.000326735 0.340954 -0.0521037 --0.0052223 0.340419 -0.0270333 --0.00728598 0.339787 8.841e-06 --0.00522277 0.340417 0.0270512 --0.000327619 0.34095 0.052122 -0.00651025 0.341065 0.0749696 -0.0148653 0.340813 0.0959468 -0.0245342 0.340324 0.115379 -0.0354101 0.339747 0.133493 -0.0474805 0.339219 0.150526 -0.0608308 0.338825 0.166752 -0.0755566 0.33858 0.182371 -0.0916689 0.338468 0.197437 -0.109123 0.338468 0.211934 -0.127848 0.338559 0.225828 -0.147759 0.338717 0.239086 -0.168758 0.338923 0.251678 -0.190746 0.339155 0.263585 -0.213616 0.339392 0.274794 -0.237258 0.339616 0.2853 -0.26156 0.339806 0.295106 -0.286405 0.339946 0.30422 -0.311671 0.340022 0.312654 -0.337232 0.340022 0.320427 -0.362965 0.339942 0.327559 -0.388744 0.33978 0.334079 -0.414452 0.33954 0.340018 -0.439983 0.33923 0.345411 -0.465241 0.338858 0.350293 -0.49015 0.338436 0.354704 -0.514648 0.337973 0.358681 -0.53869 0.33748 0.362259 -0.562243 0.336963 0.365469 -0.585286 0.336429 0.368339 -0.607804 0.335883 0.370891 -0.629789 0.33533 0.373147 -0.651235 0.334774 0.37512 -0.672141 0.334221 0.376823 -0.692511 0.333677 0.378269 -0.712357 0.333149 0.379468 -0.731699 0.332645 0.380429 -0.750572 0.332175 0.381165 -0.769029 0.331749 0.381689 -0.787146 0.331376 0.382016 -0.80502 0.331069 0.382161 -0.822758 0.330843 0.382143 -0.840409 0.330728 0.381986 -0.858802 0.330773 0.381713 -0.879781 0.330927 0.381298 -0.906625 0.331267 0.380709 -0.944919 0.331955 0.379919 -1.00374 0.333171 0.37896 -1.09863 0.334904 0.377964 -1.25551 0.336556 0.37709 -1.51301 0.337224 0.376392 -1.9214 0.337327 0.376274 -2.54157 0.33848 0.377272 -3.44833 0.342719 0.37774 -4.7159 0.396953 0.278401 -0.111186 0.359881 -0.394143 -0.0833392 0.359526 -0.377441 -0.0564452 0.359191 -0.359743 -0.0306496 0.3589 -0.341065 -0.00609671 0.358679 -0.32144 --0.0170729 0.358553 -0.300909 --0.0387276 0.358548 -0.279526 --0.0587515 0.358691 -0.257344 --0.0770572 0.359009 -0.234398 --0.0936185 0.359522 -0.210638 --0.108509 0.360203 -0.185843 --0.121814 0.360923 -0.159707 --0.133535 0.361479 -0.131979 --0.14358 0.361663 -0.102424 --0.151751 0.361314 -0.0707011 --0.157599 0.360403 -0.0364474 --0.160116 0.359449 1.6035e-05 --0.1576 0.3604 0.0364798 --0.151753 0.361308 0.0707342 --0.143583 0.361655 0.102458 --0.133539 0.361468 0.132014 --0.121818 0.360909 0.159743 --0.108514 0.360186 0.18588 --0.0936248 0.359502 0.210676 --0.0770642 0.358985 0.234436 --0.0587592 0.358664 0.257385 --0.0387358 0.358517 0.279568 --0.0170814 0.358519 0.300953 -0.00608803 0.358641 0.321485 -0.0306409 0.358858 0.341113 -0.0564368 0.359143 0.359792 -0.0833312 0.359474 0.377493 -0.111178 0.359824 0.394196 -0.139832 0.360171 0.409896 -0.169147 0.360491 0.424593 -0.198979 0.360766 0.438301 -0.229185 0.360978 0.451038 -0.259621 0.361116 0.46283 -0.290151 0.361172 0.473706 -0.320645 0.361145 0.483706 -0.350981 0.361038 0.49287 -0.381054 0.360857 0.501247 -0.410776 0.360614 0.508884 -0.440077 0.360316 0.515835 -0.468904 0.359976 0.52215 -0.497226 0.3596 0.527877 -0.525023 0.359197 0.533063 -0.552288 0.35877 0.537748 -0.579024 0.358325 0.541969 -0.605236 0.357864 0.545758 -0.630936 0.35739 0.54914 -0.65614 0.356908 0.552139 -0.680866 0.356423 0.554776 -0.70514 0.355941 0.557068 -0.728997 0.355471 0.559034 -0.752483 0.355022 0.56069 -0.775664 0.354604 0.562055 -0.798627 0.354231 0.563147 -0.821486 0.353917 0.563987 -0.844366 0.353683 0.564597 -0.86733 0.353567 0.565001 -0.8913 0.353636 0.565243 -0.918285 0.353825 0.565335 -0.951764 0.354216 0.565293 -0.997339 0.35497 0.565137 -1.06359 0.356238 0.564904 -1.16464 0.357973 0.564655 -1.32409 0.359652 0.564444 -1.57904 0.360532 0.564324 -1.98064 0.360966 0.56464 -2.59101 0.36275 0.565819 -3.48275 0.36958 0.565008 -4.7159 0.444202 0.455465 --0.0673841 0.405393 -0.579577 --0.103767 0.404643 -0.554649 --0.13906 0.403912 -0.528221 --0.173054 0.40323 -0.500313 --0.205538 0.402629 -0.470965 --0.236302 0.402142 -0.440234 --0.265143 0.401806 -0.408194 --0.291876 0.40166 -0.374926 --0.316346 0.401745 -0.340488 --0.338466 0.402093 -0.304852 --0.358275 0.402665 -0.267787 --0.375854 0.40327 -0.228976 --0.391221 0.40362 -0.188176 --0.404293 0.40344 -0.145158 --0.414857 0.402544 -0.0995691 --0.422395 0.400971 -0.0510387 --0.425676 0.399526 2.8196e-05 --0.422397 0.400967 0.0510958 --0.414861 0.402537 0.0996277 --0.404298 0.403429 0.145218 --0.391228 0.403605 0.188239 --0.375862 0.403251 0.229042 --0.358284 0.402641 0.267855 --0.338477 0.402064 0.304924 --0.316357 0.401711 0.340564 --0.291888 0.40162 0.375005 --0.265156 0.40176 0.408278 --0.236314 0.40209 0.440323 --0.20555 0.40257 0.471058 --0.173065 0.403164 0.500412 --0.139069 0.403838 0.528326 --0.103774 0.40456 0.55476 --0.0673882 0.405301 0.579694 --0.0301171 0.406032 0.603124 -0.00784143 0.406726 0.625061 -0.0462957 0.40736 0.645528 -0.0850613 0.407915 0.664558 -0.123962 0.408378 0.682192 -0.162833 0.408741 0.698482 -0.201521 0.409004 0.713484 -0.239892 0.40917 0.727262 -0.277828 0.409248 0.739887 -0.315238 0.409249 0.751432 -0.352053 0.409185 0.761975 -0.388226 0.409066 0.771591 -0.423737 0.408903 0.780355 -0.458581 0.408701 0.788339 -0.492771 0.408467 0.795606 -0.526332 0.408203 0.802216 -0.559301 0.407913 0.808222 -0.591718 0.407599 0.813668 -0.623633 0.407264 0.818596 -0.655099 0.406912 0.823039 -0.686179 0.406548 0.827027 -0.716944 0.406181 0.830589 -0.747479 0.405818 0.833749 -0.777886 0.405471 0.836531 -0.808293 0.405155 0.838958 -0.838854 0.404885 0.841054 -0.869739 0.404687 0.842842 -0.901056 0.40461 0.844343 -0.933859 0.404741 0.845625 -0.970398 0.404996 0.846752 -1.01445 0.405464 0.847803 -1.07181 0.406301 0.848857 -1.15074 0.407617 0.849975 -1.26414 0.409334 0.851197 -1.43292 0.41104 0.85251 -1.69036 0.412263 0.853866 -2.08503 0.413421 0.855339 -2.67896 0.416572 0.856835 -3.54251 0.428356 0.853267 -4.7159 0.521885 0.745083 --0.367823 0.497022 -0.881 --0.418379 0.495068 -0.843278 --0.467615 0.493085 -0.803164 --0.515226 0.491115 -0.760666 --0.560899 0.489204 -0.715823 --0.604318 0.487406 -0.668704 --0.645168 0.485782 -0.619405 --0.683151 0.4844 -0.568041 --0.718 0.483338 -0.514718 --0.749525 0.482659 -0.459452 --0.777682 0.482323 -0.402046 --0.802513 0.482075 -0.342234 --0.824023 0.481535 -0.279834 --0.842109 0.480365 -0.214669 --0.856515 0.478381 -0.146397 --0.866618 0.475735 -0.0746534 --0.870945 0.473611 4.6738e-05 --0.866621 0.47573 0.0747483 --0.85652 0.478371 0.146495 --0.842117 0.480349 0.214772 --0.824033 0.481515 0.279943 --0.802525 0.482048 0.342349 --0.777695 0.482289 0.402168 --0.749538 0.482618 0.459583 --0.718014 0.483288 0.51486 --0.683164 0.484342 0.568194 --0.645179 0.485713 0.61957 --0.604326 0.487326 0.668883 --0.560903 0.489112 0.716017 --0.515225 0.49101 0.760875 --0.467607 0.492966 0.803389 --0.418363 0.494933 0.84352 --0.367798 0.49687 0.88126 --0.316206 0.498737 0.916625 --0.263865 0.500502 0.949653 --0.211039 0.502138 0.980398 --0.157977 0.503623 1.00893 --0.104913 0.504945 1.03533 --0.0520581 0.506099 1.05968 -0.00039455 0.507086 1.08209 -0.0522775 0.507916 1.10267 -0.103451 0.508604 1.12151 -0.153806 0.509164 1.13875 -0.203266 0.509614 1.15451 -0.251785 0.509971 1.16889 -0.299349 0.510248 1.18202 -0.34597 0.510456 1.19402 -0.391685 0.510604 1.20498 -0.436551 0.510698 1.215 -0.480643 0.510743 1.22418 -0.52405 0.510744 1.23257 -0.566874 0.510704 1.24027 -0.609231 0.510629 1.24731 -0.651249 0.510524 1.25377 -0.693072 0.510398 1.25968 -0.734863 0.51026 1.26507 -0.776807 0.51012 1.27 -0.819121 0.509994 1.27449 -0.862053 0.5099 1.27856 -0.905876 0.509868 1.28225 -0.950804 0.509954 1.28558 -0.998093 0.510268 1.28863 -1.0503 0.510711 1.29154 -1.11162 0.511381 1.29443 -1.18808 0.512423 1.29747 -1.28778 0.513918 1.30073 -1.42245 0.515786 1.30427 -1.61009 0.517782 1.30804 -1.87843 0.519796 1.31185 -2.26869 0.522583 1.31529 -2.83702 0.52899 1.31708 -3.64797 0.549707 1.30892 -4.7159 0.6496 1.2188 --0.866847 0.669315 -1.38118 --0.941037 0.664426 -1.32268 --1.01358 0.659372 -1.26022 --1.08401 0.654223 -1.19379 --1.15185 0.649056 -1.12342 --1.2166 0.643965 -1.04916 --1.27777 0.639059 -0.971153 --1.33487 0.634466 -0.889558 --1.38743 0.630328 -0.804556 --1.43508 0.626778 -0.716258 --1.47758 0.623813 -0.624592 --1.51484 0.621163 -0.529455 --1.54675 0.618409 -0.430845 --1.57311 0.615205 -0.328732 --1.59356 0.611424 -0.222893 --1.60739 0.607366 -0.11307 --1.61301 0.604538 6.6461e-05 --1.60739 0.60736 0.113205 --1.59356 0.611412 0.223034 --1.57311 0.615187 0.328882 --1.54676 0.618383 0.431006 --1.51486 0.62113 0.52963 --1.47759 0.62377 0.624783 --1.43509 0.626724 0.716468 --1.38744 0.630263 0.804788 --1.33487 0.634387 0.889815 --1.27777 0.638965 0.971438 --1.21658 0.643854 1.04948 --1.15182 0.648926 1.12376 --1.08396 0.654071 1.19418 --1.01351 0.659196 1.26065 --0.940946 0.664222 1.32314 --0.86673 0.669082 1.38169 --0.791297 0.673718 1.43634 --0.715053 0.678085 1.4872 --0.638377 0.682149 1.53438 --0.561616 0.685887 1.57803 --0.485087 0.689286 1.6183 --0.409075 0.692348 1.65536 --0.33383 0.69508 1.68938 --0.259564 0.697502 1.72055 --0.186449 0.699637 1.74907 --0.114615 0.701513 1.77511 --0.0441505 0.703157 1.79889 -0.0249018 0.704597 1.82059 -0.0925385 0.705858 1.8404 -0.158795 0.706962 1.85849 -0.22374 0.707927 1.87504 -0.287476 0.70877 1.89019 -0.350132 0.709505 1.9041 -0.411865 0.710144 1.91689 -0.472856 0.710699 1.92868 -0.533311 0.711179 1.93957 -0.593463 0.711598 1.94965 -0.653573 0.711967 1.95899 -0.713934 0.712298 1.96768 -0.774876 0.712607 1.97577 -0.836774 0.712911 1.98331 -0.900056 0.713232 1.99036 -0.96519 0.713603 1.99694 -1.03261 0.714089 2.0031 -1.10383 0.714814 2.00892 -1.1817 0.715679 2.01459 -1.27068 0.716792 2.02031 -1.3768 0.718297 2.02622 -1.50757 0.720271 2.03245 -1.67305 0.72271 2.03901 -1.88764 0.725638 2.04578 -2.17235 0.729429 2.05238 -2.55795 0.735475 2.05788 -3.08772 0.747674 2.05977 -3.81029 0.777459 2.04919 -4.7159 0.859566 1.99364 --1.68526 0.987632 -2.24435 --1.802 0.976703 -2.15166 --1.91676 0.965314 -2.05201 --2.02875 0.953578 -1.9453 --2.13714 0.941637 -1.83153 --2.24105 0.929658 -1.71078 --2.33961 0.917836 -1.58323 --2.43194 0.906398 -1.44913 --2.51723 0.895596 -1.30882 --2.5947 0.885683 -1.16262 --2.66376 0.876788 -1.01079 --2.72393 0.868788 -0.853598 --2.77477 0.861422 -0.691452 --2.81584 0.854513 -0.524729 --2.84659 0.848091 -0.353644 --2.86629 0.842575 -0.178389 --2.87361 0.839422 6.4762e-05 --2.86629 0.84257 0.178521 --2.8466 0.848081 0.353783 --2.81584 0.854498 0.524879 --2.77478 0.861401 0.691615 --2.72393 0.868758 0.853779 --2.66376 0.87675 1.01099 --2.59469 0.885634 1.16285 --2.51721 0.895536 1.30907 --2.43192 0.906324 1.44942 --2.33956 0.917745 1.58356 --2.24098 0.929548 1.71116 --2.13705 0.941505 1.83196 --2.02863 0.95342 1.94579 --1.9166 0.965126 2.05255 --1.8018 0.976481 2.15227 --1.68501 0.98737 2.24502 --1.56699 0.9977 2.33098 --1.44842 1.0074 2.41037 --1.32992 1.01643 2.48345 --1.21204 1.02475 2.55055 --1.09528 1.03236 2.61199 --0.980026 1.03927 2.66812 --0.86663 1.0455 2.71933 --0.755353 1.05109 2.76596 --0.646391 1.05608 2.8084 --0.539867 1.06051 2.847 --0.435841 1.06445 2.88211 --0.334309 1.06793 2.91407 --0.235215 1.071 2.94319 --0.138448 1.07372 2.96977 --0.0438565 1.07611 2.99409 -0.0487532 1.07823 3.0164 -0.139609 1.0801 3.03692 -0.228974 1.08175 3.05586 -0.31714 1.08321 3.0734 -0.404436 1.08451 3.08971 -0.491221 1.08568 3.10493 -0.577898 1.08673 3.11919 -0.66491 1.08769 3.1326 -0.752757 1.08858 3.14526 -0.842 1.08943 3.15725 -0.933278 1.09026 3.16866 -1.02731 1.09111 3.17954 -1.12484 1.09204 3.18994 -1.22746 1.09315 3.19996 -1.33785 1.09437 3.20979 -1.45986 1.09581 3.21957 -1.59843 1.09758 3.22947 -1.75956 1.09979 3.23954 -1.95109 1.10254 3.24976 -2.18401 1.10607 3.25998 -2.47425 1.11099 3.26979 -2.84503 1.11864 3.2783 -3.32858 1.13196 3.28346 -3.95785 1.15708 3.28033 -4.7159 1.20474 3.26101 --2.94984 1.59629 -3.95978 --3.17438 1.5747 -3.81183 --3.39564 1.5531 -3.64907 --3.61192 1.53177 -3.47122 --3.82149 1.51095 -3.27815 --4.02263 1.49088 -3.06995 --4.21363 1.47177 -2.84686 --4.39282 1.45379 -2.60938 --4.5586 1.43707 -2.35818 --4.70949 1.4217 -2.09415 --4.84409 1.40771 -1.81839 --4.96119 1.39507 -1.53218 --5.05976 1.38371 -1.23697 --5.13894 1.37349 -0.934372 --5.19815 1.36422 -0.626112 --5.23703 1.35561 -0.314022 --5.25549 1.34734 0 --5.23703 1.35561 0.314022 --5.19815 1.36422 0.626112 --5.13894 1.37349 0.934372 --5.05976 1.38371 1.23697 --4.96119 1.39507 1.53218 --4.84409 1.40771 1.81839 --4.70949 1.4217 2.09415 --4.5586 1.43707 2.35818 --4.39282 1.45379 2.60938 --4.21363 1.47177 2.84686 --4.02263 1.49088 3.06995 --3.82149 1.51095 3.27815 --3.61192 1.53177 3.47122 --3.39564 1.5531 3.64907 --3.17438 1.5747 3.81183 --2.94984 1.59629 3.95978 --2.72366 1.61759 4.09338 --2.49745 1.63833 4.21321 --2.27272 1.65826 4.31998 --2.05091 1.67713 4.41447 --1.83335 1.69475 4.49757 --1.62128 1.71093 4.57019 --1.41583 1.72554 4.63329 --1.218 1.7385 4.68785 --1.02868 1.74975 4.73482 --0.848625 1.75931 4.77514 --0.678477 1.76722 4.80973 --0.518739 1.77356 4.83945 --0.36979 1.77844 4.8651 --0.231882 1.78202 4.88743 --0.105139 1.78445 4.90709 -0.0104384 1.78591 4.92473 -0.114979 1.78657 4.94179 -0.208744 1.78662 4.95884 -0.292102 1.78619 4.97589 -0.365532 1.78554 4.99294 -0.429631 1.78487 5.00999 -0.48511 1.7842 5.02705 -0.532802 1.78354 5.0441 -0.573663 1.78287 5.06115 -0.60878 1.7822 5.0782 -0.639374 1.78154 5.09526 -0.666811 1.78087 5.11231 -0.6926 1.7802 5.12936 -0.718996 1.77954 5.14642 -0.751221 1.77887 5.16347 -0.796629 1.7782 5.18052 -0.864657 1.77753 5.19757 -0.967427 1.77687 5.21463 -1.1205 1.7762 5.23168 -1.34386 1.77554 5.24873 -1.66318 1.77487 5.26578 -2.11138 1.7742 5.28284 -2.73078 1.77354 5.29989 -3.57571 1.77287 5.31694 -4.7159 1.7722 5.33399 -0.377583 0.433069 -0.0250209 -0.361708 0.432725 -0.0242713 -0.346687 0.432343 -0.0234193 -0.332592 0.431926 -0.0224734 -0.319485 0.431479 -0.0214414 -0.307414 0.431006 -0.0203345 -0.296411 0.430514 -0.019169 -0.286496 0.430012 -0.0179677 -0.277669 0.42951 -0.0167574 -0.269911 0.429019 -0.0155652 -0.263176 0.42849 -0.0142701 -0.257427 0.427819 -0.0126128 -0.252675 0.426968 -0.010497 -0.248924 0.425986 -0.008045 -0.246112 0.424941 -0.00542826 -0.244172 0.423869 -0.00273581 -0.243099 0.422781 0 -0.244172 0.423869 0.00273581 -0.246112 0.424941 0.00542826 -0.248924 0.425986 0.008045 -0.252675 0.426968 0.010497 -0.257427 0.427819 0.0126128 -0.263176 0.42849 0.0142701 -0.269911 0.429019 0.0155652 -0.277669 0.42951 0.0167574 -0.286496 0.430012 0.0179677 -0.296411 0.430514 0.019169 -0.307414 0.431006 0.0203345 -0.319485 0.431479 0.0214414 -0.332592 0.431926 0.0224734 -0.346687 0.432343 0.0234193 -0.361708 0.432725 0.0242713 -0.377583 0.433069 0.0250209 -0.39423 0.43337 0.0256568 -0.411554 0.433619 0.0261621 -0.429454 0.433808 0.026515 -0.447822 0.433924 0.0266903 -0.466543 0.433956 0.0266634 -0.485502 0.433894 0.0264153 -0.504582 0.433733 0.0259363 -0.523668 0.433474 0.02523 -0.542651 0.433121 0.0243139 -0.561424 0.432688 0.0232171 -0.579888 0.432189 0.0219772 -0.597949 0.431641 0.0206345 -0.615519 0.43106 0.0192273 -0.632516 0.430461 0.0177874 -0.648865 0.429853 0.0163384 -0.664499 0.429243 0.0148954 -0.679362 0.428636 0.013467 -0.693411 0.428033 0.0120578 -0.706618 0.427437 0.0106713 -0.718969 0.426851 0.00931195 -0.730471 0.426276 0.00798617 -0.74115 0.425717 0.00670152 -0.751054 0.425178 0.00546581 -0.760251 0.424661 0.00428496 -0.768834 0.424169 0.00316169 -0.776919 0.423697 0.00208768 -0.784645 0.423237 0.00104268 -0.792178 0.422777 0 -0.799992 0.422778 0 -0.809376 0.422778 0 -0.824423 0.422778 0 -0.852687 0.422779 0 -0.906168 0.422779 0 -1.00257 0.422779 0 -1.16694 0.42278 0 -1.43371 0.42278 0 -1.84942 0.42278 0 -2.47612 0.422781 0 -3.39576 0.422781 0 -4.7159 0.422781 0 -0.377582 0.433067 -0.0250416 -0.361707 0.432723 -0.0242919 -0.346686 0.432341 -0.0234398 -0.332591 0.431924 -0.0224937 -0.319484 0.431477 -0.0214616 -0.307413 0.431004 -0.0203546 -0.29641 0.430511 -0.0191889 -0.286495 0.430009 -0.0179874 -0.277669 0.429506 -0.0167769 -0.269911 0.429015 -0.0155844 -0.263176 0.428486 -0.014289 -0.257425 0.427814 -0.0126314 -0.252671 0.426964 -0.0105151 -0.248916 0.425983 -0.00806181 -0.246099 0.424939 -0.00544202 -0.244156 0.423868 -0.00274404 -0.243083 0.422791 0 -0.244156 0.423868 0.00274404 -0.246099 0.424939 0.00544202 -0.248916 0.425983 0.00806181 -0.252671 0.426964 0.0105151 -0.257425 0.427814 0.0126314 -0.263176 0.428486 0.014289 -0.269911 0.429015 0.0155844 -0.277669 0.429506 0.0167769 -0.286495 0.430009 0.0179874 -0.29641 0.430511 0.0191889 -0.307413 0.431004 0.0203546 -0.319484 0.431477 0.0214616 -0.332591 0.431924 0.0224937 -0.346686 0.432341 0.0234398 -0.361707 0.432723 0.0242919 -0.377582 0.433067 0.0250416 -0.394229 0.433368 0.0256776 -0.411553 0.433618 0.0261829 -0.429454 0.433806 0.0265359 -0.447822 0.433922 0.0267112 -0.466543 0.433954 0.0266844 -0.485502 0.433892 0.0264363 -0.504583 0.433732 0.0259573 -0.523669 0.433472 0.0252511 -0.542652 0.43312 0.0243349 -0.561425 0.432686 0.0232381 -0.579889 0.432187 0.0219982 -0.597951 0.431639 0.0206555 -0.615521 0.431059 0.0192482 -0.632517 0.430459 0.0178083 -0.648866 0.429851 0.0163593 -0.664501 0.429242 0.0149162 -0.679364 0.428634 0.0134877 -0.693413 0.428032 0.0120785 -0.70662 0.427436 0.0106918 -0.718971 0.426849 0.00933237 -0.730473 0.426274 0.00800648 -0.741152 0.425716 0.00672174 -0.751056 0.425176 0.00548594 -0.760253 0.42466 0.00430503 -0.768837 0.424167 0.00318172 -0.776922 0.423696 0.00210772 -0.784648 0.423236 0.00106277 -0.792179 0.422777 2.0399e-05 -0.799992 0.422777 2.0396e-05 -0.809377 0.422777 2.0491e-05 -0.824424 0.422777 2.0739e-05 -0.852689 0.422777 2.1364e-05 -0.90617 0.422778 2.2353e-05 -1.00258 0.422778 2.306e-05 -1.16694 0.422779 2.3091e-05 -1.43372 0.422779 2.2961e-05 -1.84943 0.422779 2.3197e-05 -2.47612 0.42278 2.3999e-05 -3.39576 0.422781 2.5746e-05 -4.7159 0.422786 2.189e-05 -0.377581 0.433064 -0.0250784 -0.361705 0.432719 -0.0243283 -0.346684 0.432337 -0.0234759 -0.33259 0.43192 -0.0225294 -0.319482 0.431472 -0.0214969 -0.307411 0.430999 -0.0203893 -0.296408 0.430506 -0.0192231 -0.286494 0.430003 -0.0180211 -0.277667 0.429501 -0.01681 -0.26991 0.429009 -0.0156167 -0.263175 0.428479 -0.0143202 -0.257422 0.427808 -0.0126618 -0.252664 0.426958 -0.0105445 -0.248903 0.425979 -0.00808883 -0.24608 0.424936 -0.00546394 -0.24413 0.423867 -0.00275705 -0.243058 0.422805 0 -0.24413 0.423867 0.00275705 -0.24608 0.424936 0.00546394 -0.248903 0.425979 0.00808883 -0.252664 0.426958 0.0105445 -0.257422 0.427808 0.0126618 -0.263175 0.428478 0.0143202 -0.26991 0.429009 0.0156167 -0.277667 0.429501 0.01681 -0.286494 0.430003 0.0180211 -0.296408 0.430506 0.0192231 -0.307411 0.430999 0.0203893 -0.319482 0.431472 0.0214969 -0.33259 0.43192 0.0225294 -0.346684 0.432337 0.0234759 -0.361705 0.432719 0.0243283 -0.377581 0.433064 0.0250784 -0.394228 0.433365 0.0257146 -0.411552 0.433615 0.0262202 -0.429453 0.433803 0.0265733 -0.447821 0.433919 0.0267488 -0.466543 0.433951 0.0267222 -0.485503 0.433889 0.0264742 -0.504583 0.433729 0.0259953 -0.523671 0.433469 0.0252891 -0.542654 0.433117 0.0243731 -0.561427 0.432684 0.0232764 -0.579892 0.432185 0.0220365 -0.597953 0.431637 0.0206938 -0.615523 0.431056 0.0192866 -0.63252 0.430457 0.0178466 -0.648869 0.429849 0.0163975 -0.664504 0.429239 0.0149545 -0.679367 0.428631 0.0135259 -0.693417 0.428029 0.0121165 -0.706623 0.427433 0.0107297 -0.718974 0.426846 0.00937017 -0.730477 0.426272 0.00804415 -0.741156 0.425713 0.00675929 -0.75106 0.425174 0.0055234 -0.760258 0.424657 0.00434244 -0.768842 0.424165 0.00321913 -0.776927 0.423693 0.0021452 -0.784652 0.423234 0.00110049 -0.792182 0.422778 5.9387e-05 -0.799992 0.422775 5.8686e-05 -0.809378 0.422774 5.88e-05 -0.824426 0.422774 5.9379e-05 -0.852691 0.422774 6.0985e-05 -0.906174 0.422775 6.3545e-05 -1.00258 0.422776 6.5265e-05 -1.16695 0.422778 6.5132e-05 -1.43372 0.422778 6.4648e-05 -1.84943 0.422778 6.5236e-05 -2.47613 0.422779 6.7367e-05 -3.39577 0.42278 7.1984e-05 -4.7159 0.422796 5.837e-05 -0.377579 0.433058 -0.0251434 -0.361703 0.432713 -0.0243926 -0.346681 0.43233 -0.0235393 -0.332586 0.431913 -0.0225919 -0.319479 0.431465 -0.0215583 -0.307407 0.430991 -0.0204497 -0.296405 0.430498 -0.0192823 -0.28649 0.429994 -0.0180789 -0.277665 0.429491 -0.0168663 -0.269909 0.428998 -0.015671 -0.263173 0.428467 -0.0143721 -0.257417 0.427797 -0.0127117 -0.252652 0.42695 -0.0105922 -0.248882 0.425972 -0.00813239 -0.246049 0.424932 -0.00549904 -0.24409 0.423866 -0.00277772 -0.243019 0.422826 0 -0.24409 0.423866 0.00277772 -0.246049 0.424932 0.00549904 -0.248882 0.425972 0.00813239 -0.252652 0.42695 0.0105922 -0.257417 0.427797 0.0127117 -0.263173 0.428467 0.0143721 -0.269909 0.428998 0.015671 -0.277665 0.429491 0.0168663 -0.28649 0.429994 0.0180789 -0.296405 0.430498 0.0192823 -0.307407 0.430991 0.0204497 -0.319479 0.431465 0.0215583 -0.332586 0.431913 0.0225919 -0.346681 0.43233 0.0235393 -0.361703 0.432713 0.0243926 -0.377579 0.433058 0.0251434 -0.394226 0.433359 0.0257803 -0.411551 0.433609 0.0262864 -0.429452 0.433798 0.0266401 -0.447821 0.433914 0.0268161 -0.466544 0.433946 0.0267899 -0.485504 0.433884 0.0265422 -0.504585 0.433724 0.0260637 -0.523673 0.433464 0.0253579 -0.542657 0.433112 0.0244421 -0.561431 0.432679 0.0233456 -0.579896 0.432179 0.022106 -0.597958 0.431632 0.0207635 -0.615528 0.431051 0.0193564 -0.632526 0.430451 0.0179166 -0.648875 0.429843 0.0164676 -0.664509 0.429234 0.0150245 -0.679373 0.428627 0.0135958 -0.693423 0.428024 0.0121864 -0.70663 0.427428 0.0107995 -0.718982 0.426841 0.00943983 -0.730484 0.426266 0.00811369 -0.741164 0.425708 0.00682874 -0.751069 0.425169 0.0055928 -0.760266 0.424652 0.00441187 -0.76885 0.42416 0.0032887 -0.776936 0.423689 0.00221508 -0.784661 0.423231 0.00117104 -0.792187 0.422778 0.00013355 -0.799993 0.422772 0.000130306 -0.809381 0.42277 0.000130154 -0.82443 0.422769 0.000131066 -0.852696 0.422769 0.000134127 -0.90618 0.422771 0.000139198 -1.00259 0.422773 0.000142509 -1.16696 0.422775 0.000141931 -1.43373 0.422776 0.000140695 -1.84945 0.422775 0.000141806 -2.47614 0.422776 0.000146148 -3.39579 0.422778 0.000155493 -4.7159 0.422812 0.000119306 -0.377574 0.433047 -0.0252581 -0.361698 0.432702 -0.0245056 -0.346676 0.432318 -0.0236505 -0.332581 0.431901 -0.0227009 -0.319473 0.431452 -0.0216651 -0.307401 0.430977 -0.0205539 -0.296399 0.430484 -0.0193838 -0.286485 0.429979 -0.0181775 -0.277661 0.429476 -0.0169617 -0.269906 0.428982 -0.0157621 -0.263169 0.42845 -0.0144581 -0.257408 0.42778 -0.0127932 -0.252633 0.426936 -0.0106696 -0.248849 0.425963 -0.00820253 -0.245999 0.424926 -0.00555519 -0.244026 0.423865 -0.00281059 -0.242959 0.422858 1e-09 -0.244026 0.423865 0.00281059 -0.245999 0.424926 0.00555519 -0.248849 0.425963 0.00820253 -0.252633 0.426936 0.0106696 -0.257408 0.42778 0.0127932 -0.263169 0.42845 0.0144581 -0.269906 0.428982 0.0157621 -0.277661 0.429476 0.0169617 -0.286485 0.429979 0.0181775 -0.296399 0.430483 0.0193838 -0.307401 0.430977 0.0205539 -0.319473 0.431452 0.0216651 -0.332581 0.431901 0.0227009 -0.346676 0.432318 0.0236505 -0.361698 0.432702 0.0245056 -0.377574 0.433047 0.0252581 -0.394222 0.433349 0.0258965 -0.411548 0.4336 0.026404 -0.42945 0.433789 0.0267589 -0.44782 0.433905 0.0269359 -0.466544 0.433937 0.0269107 -0.485505 0.433875 0.026664 -0.504588 0.433715 0.0261863 -0.523677 0.433455 0.0254813 -0.542662 0.433103 0.0245663 -0.561438 0.43267 0.0234705 -0.579904 0.432171 0.0222315 -0.597966 0.431623 0.0208896 -0.615537 0.431042 0.019483 -0.632535 0.430443 0.0180436 -0.648885 0.429835 0.0165949 -0.66452 0.429225 0.015152 -0.679384 0.428617 0.0137235 -0.693435 0.428015 0.0123141 -0.706642 0.427418 0.0109272 -0.718995 0.426831 0.00956751 -0.730498 0.426257 0.00824136 -0.741179 0.425698 0.00695646 -0.751084 0.425159 0.00572069 -0.760282 0.424643 0.00454008 -0.768867 0.424152 0.00341743 -0.776952 0.423681 0.00234465 -0.784678 0.423224 0.00130235 -0.792196 0.422779 0.000273592 -0.799994 0.422767 0.000263566 -0.809385 0.422763 0.000262347 -0.824438 0.422761 0.000263339 -0.852706 0.42276 0.000268394 -0.906192 0.422763 0.000277429 -1.0026 0.422768 0.000283384 -1.16698 0.422771 0.000281962 -1.43375 0.422772 0.000279262 -1.84947 0.422771 0.00028114 -2.47617 0.422772 0.000289138 -3.39581 0.422776 0.000306224 -4.7159 0.422841 0.000220847 -0.377567 0.43303 -0.0254592 -0.361689 0.432684 -0.0247031 -0.346666 0.432299 -0.0238439 -0.33257 0.43188 -0.02289 -0.319462 0.43143 -0.0218493 -0.30739 0.430955 -0.020733 -0.296388 0.43046 -0.0195573 -0.286475 0.429955 -0.018345 -0.277653 0.429451 -0.0171225 -0.2699 0.428955 -0.0159142 -0.263163 0.428422 -0.0145998 -0.257393 0.427754 -0.0129261 -0.252602 0.426916 -0.0107944 -0.248795 0.425949 -0.00831493 -0.24592 0.424918 -0.00564463 -0.243925 0.423866 -0.00286264 -0.242865 0.422906 1e-09 -0.243925 0.423866 0.00286264 -0.24592 0.424918 0.00564463 -0.248795 0.425949 0.00831494 -0.252602 0.426916 0.0107945 -0.257393 0.427754 0.0129261 -0.263163 0.428422 0.0145998 -0.2699 0.428955 0.0159142 -0.277653 0.429451 0.0171225 -0.286475 0.429955 0.018345 -0.296388 0.43046 0.0195573 -0.30739 0.430955 0.020733 -0.319462 0.43143 0.0218493 -0.33257 0.43188 0.02289 -0.346666 0.432299 0.0238439 -0.361689 0.432684 0.0247031 -0.377567 0.43303 0.0254592 -0.394216 0.433332 0.0261008 -0.411543 0.433583 0.0266112 -0.429447 0.433773 0.0269687 -0.447818 0.433889 0.027148 -0.466544 0.433922 0.027125 -0.485508 0.43386 0.0268803 -0.504593 0.433699 0.0264045 -0.523684 0.43344 0.0257013 -0.542672 0.433087 0.0247881 -0.561449 0.432654 0.0236941 -0.579917 0.432155 0.0224567 -0.597981 0.431607 0.0211163 -0.615553 0.431027 0.019711 -0.632552 0.430427 0.0182727 -0.648903 0.429819 0.0168249 -0.664539 0.429209 0.0153828 -0.679405 0.428601 0.0139548 -0.693456 0.427998 0.0125458 -0.706665 0.427402 0.0111593 -0.719018 0.426815 0.00979989 -0.730523 0.42624 0.00847412 -0.741205 0.425681 0.00718974 -0.751111 0.425143 0.00595469 -0.76031 0.424627 0.00477513 -0.768896 0.424137 0.0036539 -0.776983 0.423667 0.00258324 -0.784708 0.423213 0.001545 -0.792214 0.42278 0.00053517 -0.799998 0.422757 0.000509742 -0.809395 0.42275 0.000505505 -0.824453 0.422745 0.000505646 -0.852724 0.422744 0.000513064 -0.906213 0.422749 0.000528153 -1.00263 0.422758 0.000538554 -1.16701 0.422764 0.000535727 -1.43379 0.422764 0.000530314 -1.84952 0.422762 0.000533263 -2.47622 0.422764 0.00054724 -3.39586 0.422771 0.000576844 -4.7159 0.422892 0.00038942 -0.377553 0.433001 -0.0258085 -0.361673 0.432653 -0.025045 -0.346649 0.432267 -0.0241778 -0.332551 0.431847 -0.023215 -0.319442 0.431395 -0.0221647 -0.307369 0.430918 -0.0210381 -0.296368 0.430422 -0.0198513 -0.286457 0.429916 -0.0186271 -0.277638 0.42941 -0.0173914 -0.269889 0.428913 -0.0161662 -0.263149 0.428378 -0.014832 -0.257366 0.427714 -0.0131414 -0.25255 0.426885 -0.0109948 -0.248709 0.42593 -0.00849385 -0.245794 0.424909 -0.0057861 -0.243766 0.42387 -0.00294448 -0.242717 0.422975 3e-09 -0.243766 0.42387 0.00294449 -0.245794 0.424909 0.00578611 -0.248709 0.42593 0.00849386 -0.25255 0.426885 0.0109948 -0.257366 0.427714 0.0131414 -0.263149 0.428378 0.014832 -0.269889 0.428913 0.0161662 -0.277638 0.42941 0.0173914 -0.286457 0.429916 0.0186271 -0.296368 0.430422 0.0198513 -0.307369 0.430918 0.0210381 -0.319442 0.431395 0.0221647 -0.332551 0.431846 0.023215 -0.346649 0.432267 0.0241778 -0.361673 0.432653 0.025045 -0.377553 0.433001 0.0258085 -0.394204 0.433304 0.0264567 -0.411533 0.433556 0.026973 -0.42944 0.433746 0.0273359 -0.447815 0.433863 0.0275201 -0.466545 0.433895 0.0275016 -0.485512 0.433833 0.0272612 -0.504602 0.433673 0.0267895 -0.523697 0.433413 0.0260904 -0.542689 0.433061 0.0251811 -0.561469 0.432627 0.0240908 -0.57994 0.432128 0.022857 -0.598007 0.43158 0.02152 -0.615582 0.430999 0.0201177 -0.632583 0.4304 0.0186822 -0.648935 0.429791 0.0172366 -0.664573 0.429181 0.0157964 -0.67944 0.428573 0.0143701 -0.693494 0.42797 0.0129625 -0.706704 0.427373 0.0115772 -0.71906 0.426785 0.0102191 -0.730567 0.42621 0.00889472 -0.741251 0.425652 0.00761203 -0.75116 0.425114 0.00637911 -0.760362 0.424599 0.00520226 -0.768949 0.424109 0.00408448 -0.777038 0.423642 0.00301865 -0.784763 0.423193 0.00198937 -0.792248 0.42278 0.00101639 -0.800008 0.422739 0.000960338 -0.809416 0.422726 0.000948725 -0.824482 0.422718 0.000945519 -0.852757 0.422716 0.00095483 -0.906252 0.422725 0.000978573 -1.00268 0.422741 0.000996273 -1.16706 0.422752 0.000991272 -1.43386 0.422751 0.000981 -1.8496 0.422748 0.000985345 -2.47631 0.422751 0.00100893 -3.39594 0.422763 0.00105843 -4.7159 0.42298 0.000668274 -0.377527 0.432952 -0.026409 -0.361645 0.432603 -0.0256312 -0.346617 0.432214 -0.0247481 -0.332518 0.431791 -0.023768 -0.319407 0.431337 -0.0226991 -0.307333 0.430858 -0.0215526 -0.296332 0.43036 -0.0203446 -0.286423 0.429853 -0.0190976 -0.277609 0.429347 -0.0178368 -0.269865 0.428847 -0.0165802 -0.263121 0.428311 -0.0152097 -0.257317 0.427654 -0.0134879 -0.252463 0.42684 -0.0113138 -0.248568 0.425902 -0.00877625 -0.245593 0.424898 -0.00600792 -0.243515 0.423881 -0.00307206 -0.242479 0.423067 5e-09 -0.243515 0.423881 0.00307207 -0.245593 0.424898 0.00600794 -0.248568 0.425902 0.00877627 -0.252463 0.42684 0.0113139 -0.257317 0.427654 0.0134879 -0.263121 0.428311 0.0152097 -0.269865 0.428847 0.0165802 -0.277609 0.429346 0.0178368 -0.286423 0.429853 0.0190976 -0.296332 0.43036 0.0203447 -0.307333 0.430858 0.0215526 -0.319407 0.431337 0.0226991 -0.332518 0.431791 0.023768 -0.346617 0.432214 0.0247481 -0.361645 0.432603 0.0256312 -0.377527 0.432952 0.0264091 -0.394182 0.433257 0.0270703 -0.411516 0.43351 0.0275984 -0.429427 0.433701 0.0279719 -0.447808 0.433819 0.0281659 -0.466544 0.433851 0.0281565 -0.485519 0.433789 0.0279248 -0.504615 0.433628 0.0274616 -0.523718 0.433368 0.0267707 -0.542717 0.433015 0.0258695 -0.561504 0.432581 0.0247872 -0.579981 0.432082 0.023561 -0.598052 0.431534 0.0222312 -0.615631 0.430953 0.0208356 -0.632635 0.430353 0.019406 -0.648991 0.429744 0.0179657 -0.664631 0.429133 0.0165301 -0.679502 0.428524 0.0151078 -0.693559 0.427919 0.0137037 -0.706774 0.427322 0.0123219 -0.719134 0.426734 0.0109672 -0.730645 0.426158 0.00964671 -0.741334 0.4256 0.00836841 -0.751246 0.425063 0.0071407 -0.760452 0.424549 0.00597014 -0.769043 0.424062 0.00486002 -0.777135 0.423599 0.00380463 -0.784861 0.423158 0.00279412 -0.792312 0.422776 0.0018842 -0.800035 0.422709 0.00177571 -0.809461 0.422685 0.0017477 -0.824541 0.42267 0.00173533 -0.852821 0.422667 0.00174369 -0.906324 0.422683 0.00177839 -1.00276 0.422712 0.0018074 -1.16717 0.42273 0.00179917 -1.43398 0.422728 0.00178046 -1.84973 0.422722 0.00178642 -2.47646 0.422727 0.00182513 -3.39608 0.422749 0.00190551 -4.7159 0.423127 0.00112819 -0.37748 0.432873 -0.0274288 -0.361592 0.43252 -0.0266235 -0.34656 0.432129 -0.0257104 -0.332456 0.431702 -0.0246978 -0.319342 0.431245 -0.0235941 -0.307266 0.430763 -0.0224104 -0.296264 0.430263 -0.021163 -0.286358 0.429754 -0.0198739 -0.277551 0.429247 -0.0185668 -0.269813 0.428746 -0.0172536 -0.26306 0.428211 -0.0158192 -0.257225 0.427565 -0.0140413 -0.252311 0.426774 -0.0118178 -0.248336 0.425862 -0.00921796 -0.245271 0.424884 -0.00635236 -0.24312 0.423899 -0.00326893 -0.242095 0.423184 9e-09 -0.24312 0.423899 0.00326895 -0.245271 0.424884 0.00635239 -0.248336 0.425862 0.009218 -0.252311 0.426774 0.0118178 -0.257225 0.427565 0.0140413 -0.26306 0.42821 0.0158192 -0.269813 0.428746 0.0172536 -0.277551 0.429247 0.0185669 -0.286358 0.429754 0.0198739 -0.296264 0.430263 0.0211631 -0.307266 0.430763 0.0224104 -0.319342 0.431245 0.0235941 -0.332456 0.431702 0.0246979 -0.34656 0.432128 0.0257105 -0.361592 0.43252 0.0266236 -0.37748 0.432873 0.0274289 -0.394141 0.433181 0.0281151 -0.411482 0.433435 0.0286657 -0.429402 0.433627 0.0290598 -0.447793 0.433745 0.0292728 -0.46654 0.433777 0.0292812 -0.485527 0.433715 0.0290665 -0.504636 0.433553 0.02862 -0.523752 0.433292 0.0279455 -0.542762 0.432938 0.0270606 -0.561561 0.432504 0.0259943 -0.580047 0.432004 0.0247837 -0.598127 0.431455 0.0234686 -0.615712 0.430874 0.0220868 -0.632723 0.430273 0.0206697 -0.649084 0.429663 0.0192407 -0.664731 0.42905 0.017815 -0.679607 0.42844 0.0164017 -0.693671 0.427834 0.0150061 -0.706892 0.427235 0.0136324 -0.71926 0.426645 0.0122861 -0.730779 0.426069 0.0109747 -0.741475 0.425511 0.00970648 -0.751396 0.424974 0.00849035 -0.760609 0.424463 0.00733329 -0.769208 0.42398 0.00623921 -0.777306 0.423524 0.00520517 -0.785032 0.423099 0.00423164 -0.792436 0.422754 0.00341267 -0.800111 0.422656 0.00323029 -0.809566 0.422614 0.00316897 -0.824666 0.422587 0.00313525 -0.852949 0.422584 0.00313428 -0.906459 0.422613 0.00317959 -1.00292 0.422662 0.00322446 -1.16734 0.422694 0.00321143 -1.43419 0.422689 0.0031785 -1.84997 0.422677 0.00318594 -2.47672 0.422687 0.00324783 -3.39633 0.422725 0.00337489 -4.7159 0.423376 0.001885 -0.377391 0.432746 -0.0291366 -0.361494 0.432389 -0.0282806 -0.346453 0.431992 -0.0273123 -0.332341 0.431561 -0.0262403 -0.319221 0.4311 -0.025073 -0.30714 0.430614 -0.023822 -0.296137 0.430112 -0.0225035 -0.286233 0.429602 -0.0211387 -0.277431 0.429096 -0.019749 -0.269697 0.428594 -0.0183379 -0.262927 0.428062 -0.0167951 -0.257042 0.427435 -0.0149196 -0.252041 0.426677 -0.012608 -0.247946 0.425804 -0.0099027 -0.24475 0.424864 -0.00688191 -0.24249 0.423929 -0.0035696 -0.241465 0.423318 1.8e-08 -0.24249 0.423929 0.00356964 -0.24475 0.424864 0.00688197 -0.247946 0.425804 0.00990278 -0.252041 0.426677 0.0126081 -0.257042 0.427435 0.0149197 -0.262927 0.428062 0.0167952 -0.269697 0.428594 0.018338 -0.277431 0.429096 0.0197491 -0.286233 0.429602 0.0211388 -0.296137 0.430111 0.0225036 -0.30714 0.430614 0.0238221 -0.319221 0.431099 0.0250731 -0.332341 0.431561 0.0262404 -0.346453 0.431992 0.0273124 -0.361494 0.432388 0.0282808 -0.377391 0.432745 0.0291368 -0.394063 0.433057 0.0298692 -0.411417 0.433314 0.030462 -0.429352 0.433508 0.0308947 -0.447759 0.433626 0.0311435 -0.466525 0.433657 0.0311857 -0.485532 0.433594 0.0310036 -0.504663 0.43343 0.0305889 -0.523799 0.433167 0.0299461 -0.54283 0.432812 0.0290926 -0.561648 0.432376 0.0280573 -0.580151 0.431875 0.026877 -0.598245 0.431325 0.025591 -0.615843 0.430742 0.0242364 -0.632865 0.43014 0.0228445 -0.649236 0.429527 0.0214384 -0.664892 0.428912 0.0200336 -0.679779 0.428299 0.0186395 -0.693854 0.427689 0.0172621 -0.707088 0.427087 0.0159063 -0.719469 0.426495 0.0145785 -0.731002 0.425918 0.0132867 -0.741713 0.425359 0.01204 -0.751648 0.424824 0.0108478 -0.760876 0.424317 0.00971795 -0.76949 0.423841 0.00865551 -0.777601 0.423397 0.00766267 -0.785326 0.422996 0.00675476 -0.79268 0.42269 0.00604131 -0.80031 0.422562 0.00577805 -0.809809 0.422493 0.00565734 -0.824939 0.422449 0.00557937 -0.853215 0.422444 0.00554964 -0.906723 0.422495 0.00559716 -1.0032 0.422581 0.00566043 -1.16766 0.422634 0.00563985 -1.43455 0.422624 0.00558372 -1.85039 0.422603 0.00559159 -2.47717 0.42262 0.00568793 -3.39675 0.422688 0.0058832 -4.7159 0.42379 0.00312829 -0.377218 0.432546 -0.0319529 -0.361303 0.432183 -0.0310059 -0.346247 0.43178 -0.0299391 -0.332121 0.431342 -0.0287614 -0.318987 0.430876 -0.0274819 -0.306897 0.430386 -0.0261124 -0.295887 0.429882 -0.0246693 -0.28598 0.429373 -0.0231725 -0.277179 0.428869 -0.0216398 -0.269438 0.428371 -0.0200652 -0.262636 0.427849 -0.0183455 -0.256672 0.427248 -0.016305 -0.251543 0.426536 -0.0138391 -0.247277 0.425718 -0.0109558 -0.24389 0.424833 -0.00768844 -0.241475 0.423965 -0.00402409 -0.240426 0.423454 3.8e-08 -0.241475 0.423965 0.00402418 -0.24389 0.424833 0.00768856 -0.247277 0.425718 0.010956 -0.251543 0.426535 0.0138393 -0.256672 0.427248 0.0163051 -0.262636 0.427848 0.0183457 -0.269438 0.42837 0.0200654 -0.277179 0.428869 0.0216399 -0.28598 0.429373 0.0231726 -0.295887 0.429881 0.0246695 -0.306897 0.430385 0.0261126 -0.318988 0.430875 0.0274821 -0.332121 0.431342 0.0287616 -0.346247 0.431779 0.0299393 -0.361303 0.432182 0.0310061 -0.377218 0.432545 0.0319532 -0.393909 0.432862 0.0327692 -0.411285 0.433122 0.0334386 -0.429244 0.433318 0.0339419 -0.44768 0.433436 0.0342565 -0.466477 0.433466 0.0343611 -0.485518 0.4334 0.0342392 -0.504683 0.433233 0.0338839 -0.523855 0.432967 0.0333 -0.54292 0.432609 0.0325053 -0.561769 0.43217 0.0315282 -0.5803 0.431666 0.030405 -0.598419 0.431114 0.0291739 -0.616039 0.430528 0.0278714 -0.633079 0.429922 0.026528 -0.649469 0.429305 0.0251667 -0.665143 0.428685 0.0238034 -0.680048 0.428067 0.0224482 -0.694143 0.427452 0.0211081 -0.707399 0.426844 0.0197895 -0.719804 0.426248 0.0184997 -0.731363 0.425668 0.0172477 -0.742101 0.425109 0.0160438 -0.752065 0.424577 0.014898 -0.761323 0.424076 0.0138192 -0.769967 0.42361 0.0128148 -0.778105 0.423186 0.0118939 -0.785837 0.422816 0.0110832 -0.793169 0.422542 0.0104665 -0.800795 0.422392 0.0101368 -0.810362 0.422291 0.00992969 -0.825535 0.422223 0.00977143 -0.853779 0.422216 0.00967496 -0.90725 0.422305 0.00969808 -1.00373 0.42245 0.00977368 -1.16823 0.422539 0.00973973 -1.43518 0.422521 0.00964684 -1.8511 0.422484 0.00965234 -2.47794 0.422514 0.00979805 -3.39745 0.422631 0.0100889 -4.7159 0.424479 0.00516833 -0.376869 0.432241 -0.0365205 -0.360923 0.43187 -0.0354148 -0.345837 0.431459 -0.0341773 -0.331684 0.431013 -0.0328175 -0.318524 0.43054 -0.0313454 -0.30641 0.430047 -0.0297735 -0.29538 0.429542 -0.0281182 -0.285456 0.429037 -0.0263979 -0.276636 0.42854 -0.0246259 -0.268863 0.428052 -0.0227879 -0.261995 0.427548 -0.0207889 -0.255912 0.426986 -0.0184774 -0.250599 0.426333 -0.0157469 -0.246093 0.425588 -0.0125649 -0.242443 0.424779 -0.00890619 -0.239809 0.423996 -0.00470413 -0.238698 0.423568 7.8e-08 -0.239809 0.423996 0.00470432 -0.242443 0.424779 0.00890642 -0.246093 0.425588 0.0125652 -0.250599 0.426333 0.0157472 -0.255912 0.426985 0.0184777 -0.261995 0.427547 0.0207891 -0.268864 0.428051 0.0227882 -0.276636 0.428539 0.0246261 -0.285456 0.429036 0.0263981 -0.29538 0.429542 0.0281185 -0.30641 0.430046 0.0297738 -0.318524 0.430539 0.0313457 -0.331684 0.431012 0.0328179 -0.345837 0.431458 0.0341778 -0.360923 0.431869 0.0354153 -0.376869 0.43224 0.0365211 -0.393594 0.432562 0.0374838 -0.411008 0.432827 0.0382888 -0.429009 0.433024 0.0389177 -0.447491 0.433141 0.0393502 -0.466339 0.433169 0.039567 -0.485435 0.433098 0.039554 -0.504657 0.432926 0.0393059 -0.523885 0.432655 0.0388286 -0.543005 0.432291 0.0381402 -0.561905 0.431847 0.0372686 -0.580483 0.431338 0.0362489 -0.598643 0.43078 0.035118 -0.6163 0.430189 0.033911 -0.633374 0.429576 0.0326575 -0.649795 0.428952 0.0313805 -0.665502 0.428324 0.0300963 -0.680442 0.427695 0.0288162 -0.694574 0.427071 0.0275489 -0.70787 0.426455 0.0263025 -0.72032 0.425852 0.0250861 -0.731927 0.425267 0.02391 -0.742719 0.424707 0.022785 -0.752741 0.424179 0.0217222 -0.762063 0.423687 0.0207315 -0.770772 0.423237 0.0198225 -0.778972 0.422837 0.0190074 -0.786758 0.422498 0.0183085 -0.794152 0.422243 0.0177652 -0.801869 0.422083 0.0173925 -0.811564 0.421957 0.0170891 -0.826809 0.421863 0.0168097 -0.854977 0.421859 0.0165854 -0.908324 0.422008 0.0165249 -1.00475 0.42225 0.0165846 -1.16926 0.422396 0.0165237 -1.43628 0.422365 0.0163743 -1.85231 0.422305 0.0163716 -2.47922 0.422355 0.0165849 -3.39861 0.422554 0.0170031 -4.7159 0.425621 0.00851293 -0.376141 0.431792 -0.0437988 -0.360136 0.431412 -0.0424242 -0.344994 0.430992 -0.0408996 -0.330785 0.430537 -0.0392353 -0.317572 0.430058 -0.0374426 -0.305405 0.429562 -0.0355352 -0.294322 0.42906 -0.0335296 -0.284344 0.428563 -0.0314426 -0.275461 0.42808 -0.0292837 -0.267603 0.427612 -0.0270335 -0.260608 0.427142 -0.0246035 -0.254341 0.426632 -0.0218585 -0.248772 0.426054 -0.0186851 -0.243945 0.425399 -0.015007 -0.239944 0.424685 -0.0107284 -0.237015 0.423999 -0.00571029 -0.235795 0.42363 1.64e-07 -0.237015 0.423998 0.00571067 -0.239944 0.424684 0.0107288 -0.243945 0.425398 0.0150075 -0.248772 0.426053 0.0186857 -0.254341 0.426631 0.021859 -0.260609 0.42714 0.0246041 -0.267603 0.427611 0.027034 -0.275461 0.428078 0.0292842 -0.284344 0.428561 0.0314432 -0.294322 0.429059 0.0335302 -0.305405 0.42956 0.0355359 -0.317572 0.430056 0.0374433 -0.330785 0.430535 0.0392362 -0.344994 0.430989 0.0409005 -0.360136 0.43141 0.0424252 -0.376141 0.43179 0.0437999 -0.392928 0.43212 0.0450131 -0.410408 0.432389 0.0460513 -0.428481 0.432588 0.0468981 -0.447041 0.432704 0.0475363 -0.465972 0.432726 0.0479499 -0.485155 0.432649 0.048128 -0.504466 0.432469 0.048068 -0.523784 0.432188 0.0477774 -0.542991 0.431816 0.0472747 -0.561973 0.431362 0.0465871 -0.580626 0.430844 0.045748 -0.598857 0.430277 0.0447924 -0.616578 0.429675 0.0437535 -0.633713 0.429051 0.0426599 -0.650194 0.428414 0.0415342 -0.665962 0.427771 0.0403937 -0.680967 0.427128 0.0392514 -0.695171 0.426488 0.0381182 -0.708547 0.425859 0.0370042 -0.721085 0.425245 0.0359199 -0.732792 0.424653 0.0348766 -0.743695 0.424091 0.0338853 -0.75384 0.423565 0.0329564 -0.763297 0.423083 0.0320991 -0.772154 0.42265 0.0313212 -0.780513 0.422271 0.0306296 -0.788475 0.421953 0.0300318 -0.796082 0.42171 0.0295389 -0.804048 0.421549 0.029139 -0.813999 0.421415 0.0287501 -0.829399 0.421315 0.0283252 -0.857455 0.421331 0.0279006 -0.910515 0.421572 0.0276541 -1.00672 0.421963 0.0276263 -1.17114 0.422202 0.0275075 -1.4382 0.422154 0.0272738 -1.85435 0.422057 0.027252 -2.48134 0.422142 0.0275533 -3.40049 0.422476 0.0281295 -4.7159 0.427509 0.0139932 -0.374585 0.431175 -0.055184 -0.358467 0.430785 -0.0533676 -0.343212 0.430354 -0.0513747 -0.328891 0.429891 -0.0492167 -0.315564 0.429406 -0.0469067 -0.30328 0.428911 -0.0444598 -0.292075 0.428416 -0.0418934 -0.281964 0.427934 -0.0392236 -0.272927 0.427476 -0.0364579 -0.264885 0.427043 -0.0335748 -0.257666 0.426624 -0.0304867 -0.251119 0.426185 -0.0270594 -0.245202 0.425698 -0.0231639 -0.239964 0.425147 -0.0186762 -0.235527 0.424541 -0.0134225 -0.232226 0.423948 -0.0071773 -0.230851 0.423611 3.48e-07 -0.232226 0.423948 0.00717806 -0.235527 0.42454 0.0134233 -0.239964 0.425146 0.0186772 -0.245203 0.425697 0.0231649 -0.251119 0.426184 0.0270604 -0.257666 0.426622 0.0304877 -0.264885 0.427041 0.0335758 -0.272927 0.427473 0.036459 -0.281964 0.427932 0.0392248 -0.292075 0.428414 0.0418946 -0.30328 0.428908 0.0444611 -0.315564 0.429403 0.0469081 -0.328891 0.429887 0.0492183 -0.343212 0.43035 0.0513764 -0.358467 0.430781 0.0533694 -0.374585 0.431171 0.055186 -0.391488 0.431509 0.0568145 -0.409087 0.431784 0.0582427 -0.427285 0.431984 0.059457 -0.445975 0.432096 0.0604442 -0.465042 0.432113 0.0611929 -0.484365 0.432026 0.0616964 -0.503818 0.431835 0.0619558 -0.523278 0.431541 0.0619809 -0.542622 0.431155 0.0617905 -0.561736 0.430688 0.061411 -0.580516 0.430156 0.0608738 -0.598867 0.429573 0.0602114 -0.616704 0.428955 0.0594549 -0.633954 0.428312 0.0586316 -0.650552 0.427654 0.0577642 -0.666444 0.426989 0.0568707 -0.681582 0.426323 0.0559659 -0.695934 0.425661 0.0550626 -0.709476 0.425012 0.0541721 -0.7222 0.424381 0.0533052 -0.734117 0.423777 0.052472 -0.745255 0.423208 0.0516816 -0.755663 0.422682 0.0509409 -0.765412 0.422204 0.0502546 -0.77459 0.421779 0.049625 -0.783304 0.421411 0.0490515 -0.791658 0.421104 0.0485328 -0.799702 0.42087 0.0480707 -0.808137 0.420723 0.0476466 -0.818558 0.420608 0.0471831 -0.834307 0.42054 0.0466112 -0.862315 0.420619 0.0459338 -0.914879 0.420999 0.0453718 -1.01053 0.421605 0.0451242 -1.17461 0.421989 0.0448839 -1.44156 0.421924 0.044528 -1.85777 0.421778 0.0444699 -2.48478 0.42192 0.0448781 -3.40348 0.422469 0.0456315 -4.7159 0.430626 0.0229693 -0.371229 0.430431 -0.07266 -0.354889 0.43003 -0.0701393 -0.33941 0.429588 -0.0674053 -0.324858 0.429117 -0.0644705 -0.311294 0.428629 -0.0613497 -0.298762 0.428138 -0.0580602 -0.287294 0.427657 -0.0546208 -0.276899 0.4272 -0.0510484 -0.267552 0.426778 -0.0473502 -0.259169 0.426399 -0.0435018 -0.251577 0.42605 -0.0394069 -0.244618 0.425703 -0.034915 -0.238246 0.425323 -0.0298688 -0.232511 0.424886 -0.0240926 -0.227572 0.424385 -0.0173317 -0.223852 0.423862 -0.00927243 -0.222292 0.423522 7.33e-07 -0.223852 0.423861 0.00927398 -0.227572 0.424384 0.0173334 -0.232511 0.424884 0.0240945 -0.238246 0.42532 0.0298707 -0.244619 0.4257 0.034917 -0.251577 0.426047 0.0394088 -0.259169 0.426395 0.0435038 -0.267552 0.426774 0.0473522 -0.276899 0.427195 0.0510506 -0.287294 0.427652 0.0546231 -0.298762 0.428133 0.0580627 -0.311294 0.428624 0.0613523 -0.324858 0.429111 0.0644733 -0.339409 0.429582 0.0674083 -0.354889 0.430024 0.0701426 -0.371229 0.430425 0.0726635 -0.388353 0.430773 0.0749596 -0.406174 0.431054 0.0770202 -0.424595 0.431256 0.0788353 -0.443512 0.431367 0.080396 -0.462808 0.431377 0.0816963 -0.482362 0.431281 0.0827349 -0.502047 0.431077 0.0835168 -0.521736 0.430769 0.0840543 -0.541307 0.430367 0.0843672 -0.560645 0.429883 0.0844809 -0.579645 0.429331 0.0844247 -0.598214 0.428728 0.0842286 -0.616272 0.428086 0.0839217 -0.63375 0.427418 0.0835299 -0.650588 0.426733 0.0830754 -0.666739 0.426039 0.0825768 -0.682161 0.425344 0.0820492 -0.696827 0.424654 0.0815052 -0.710718 0.423979 0.0809553 -0.723833 0.423325 0.0804079 -0.736185 0.422703 0.0798692 -0.747805 0.422119 0.0793434 -0.758741 0.421583 0.0788328 -0.769064 0.421099 0.0783373 -0.77886 0.420673 0.0778552 -0.788233 0.420308 0.0773841 -0.797285 0.420009 0.0769214 -0.806065 0.419792 0.0764694 -0.815268 0.419675 0.0760092 -0.826471 0.41961 0.0754652 -0.842906 0.419622 0.0747469 -0.871144 0.419829 0.0738038 -0.923126 0.420412 0.0728289 -1.01775 0.421305 0.0721886 -1.18097 0.421901 0.0717186 -1.44744 0.421833 0.071192 -1.8635 0.421627 0.0710739 -2.49033 0.421857 0.0716019 -3.40816 0.422742 0.0725219 -4.7159 0.43577 0.0376676 -0.364048 0.429821 -0.098978 -0.347271 0.429404 -0.0953661 -0.331344 0.428947 -0.0914899 -0.316333 0.428466 -0.0873626 -0.302293 0.427975 -0.0830007 -0.289268 0.42749 -0.078423 -0.277288 0.427027 -0.07365 -0.266361 0.426602 -0.0686998 -0.256463 0.426229 -0.063579 -0.247516 0.425919 -0.0582569 -0.239354 0.425661 -0.0526166 -0.231823 0.425422 -0.0464765 -0.224878 0.425158 -0.0396396 -0.218579 0.424831 -0.0318762 -0.213116 0.42441 -0.0228547 -0.208981 0.423904 -0.0121849 -0.207231 0.423512 1.519e-06 -0.208981 0.423903 0.0121881 -0.213116 0.424408 0.022858 -0.218579 0.424828 0.0318797 -0.224878 0.425154 0.0396433 -0.231823 0.425418 0.0464803 -0.239353 0.425656 0.0526204 -0.247516 0.425913 0.0582608 -0.256463 0.426223 0.063583 -0.26636 0.426595 0.0687039 -0.277288 0.427019 0.0736544 -0.289268 0.427482 0.0784276 -0.302292 0.427967 0.0830055 -0.316332 0.428457 0.0873678 -0.331343 0.428938 0.0914955 -0.34727 0.429394 0.095372 -0.364047 0.429811 0.0989843 -0.381599 0.430174 0.102322 -0.39984 0.430468 0.105375 -0.418677 0.43068 0.108139 -0.438005 0.430797 0.110608 -0.457709 0.430809 0.112782 -0.477667 0.430711 0.114665 -0.497754 0.430501 0.116266 -0.517843 0.430186 0.117599 -0.537815 0.429774 0.118686 -0.557555 0.429277 0.119551 -0.576964 0.428711 0.120222 -0.595954 0.42809 0.120726 -0.61445 0.427428 0.121091 -0.63239 0.426737 0.12134 -0.649724 0.426027 0.121495 -0.66641 0.425307 0.121572 -0.682416 0.424585 0.121585 -0.69772 0.42387 0.121544 -0.712311 0.423169 0.121455 -0.726188 0.422493 0.121323 -0.739366 0.421849 0.121149 -0.751872 0.421248 0.120935 -0.763752 0.420697 0.120679 -0.775068 0.420204 0.12038 -0.785901 0.419774 0.120037 -0.796348 0.419413 0.119651 -0.806507 0.419128 0.119222 -0.81642 0.418939 0.118757 -0.826791 0.418872 0.118242 -0.839211 0.418884 0.117602 -0.856836 0.419018 0.116735 -0.885867 0.419411 0.11555 -0.937578 0.420256 0.114165 -1.03079 0.421485 0.113012 -1.19235 0.422359 0.112183 -1.45761 0.42232 0.111434 -1.87299 0.422056 0.111231 -2.49918 0.422421 0.11188 -3.41534 0.423821 0.1129 -4.7159 0.444252 0.0617318 -0.349064 0.430171 -0.137842 -0.331447 0.429719 -0.132575 -0.314662 0.429232 -0.12697 -0.298777 0.428727 -0.12104 -0.283849 0.428222 -0.114802 -0.269925 0.427734 -0.108275 -0.25704 0.427283 -0.101482 -0.245212 0.426888 -0.0944411 -0.23443 0.426567 -0.0871577 -0.224629 0.426331 -0.0795916 -0.21566 0.426171 -0.0715976 -0.207381 0.426043 -0.0629522 -0.199752 0.425885 -0.0534137 -0.192846 0.425633 -0.0427013 -0.186875 0.425229 -0.0304177 -0.182367 0.424651 -0.0161164 -0.180439 0.424139 3.066e-06 -0.182366 0.424649 0.0161226 -0.186874 0.425226 0.0304242 -0.192845 0.425629 0.0427081 -0.199751 0.42588 0.0534207 -0.207381 0.426036 0.0629594 -0.215659 0.426163 0.0716049 -0.224628 0.426322 0.0795991 -0.234428 0.426557 0.0871654 -0.24521 0.426877 0.0944489 -0.257038 0.427272 0.10149 -0.269923 0.427722 0.108284 -0.283846 0.428208 0.114811 -0.298775 0.428713 0.12105 -0.31466 0.429217 0.12698 -0.331444 0.429702 0.132586 -0.349061 0.430153 0.137853 -0.367435 0.430551 0.142773 -0.386482 0.430881 0.147341 -0.406108 0.431127 0.151552 -0.42621 0.431274 0.155407 -0.446676 0.431315 0.158911 -0.467387 0.431242 0.16207 -0.488222 0.431056 0.164898 -0.50906 0.430761 0.167412 -0.529786 0.430366 0.169632 -0.550295 0.429885 0.171583 -0.570494 0.429331 0.173291 -0.590304 0.428719 0.174782 -0.60966 0.428064 0.176081 -0.628509 0.427377 0.177208 -0.646808 0.426669 0.178183 -0.664525 0.425949 0.17902 -0.681633 0.425225 0.179729 -0.698115 0.424506 0.180317 -0.713958 0.4238 0.180789 -0.729163 0.423116 0.181145 -0.743737 0.422465 0.181387 -0.757702 0.421856 0.181516 -0.771095 0.421298 0.181531 -0.783969 0.4208 0.181436 -0.796398 0.42037 0.181234 -0.808473 0.420016 0.180931 -0.820287 0.41975 0.180535 -0.831882 0.419594 0.180057 -0.843987 0.41959 0.179491 -0.858239 0.419693 0.178768 -0.877778 0.419965 0.177786 -0.908493 0.420563 0.17644 -0.960831 0.421679 0.174779 -1.05284 0.423231 0.173173 -1.21199 0.424405 0.171927 -1.47492 0.424448 0.170933 -1.8886 0.424155 0.170635 -2.51317 0.42472 0.171394 -3.42624 0.426903 0.172354 -4.7159 0.458231 0.101126 -0.319109 0.433549 -0.194071 -0.299951 0.433013 -0.186326 -0.281617 0.432449 -0.178131 -0.26418 0.431877 -0.169498 -0.247712 0.431316 -0.160442 -0.232271 0.430789 -0.150987 -0.217911 0.430316 -0.141157 -0.204668 0.429921 -0.130974 -0.192552 0.429625 -0.120444 -0.181523 0.429442 -0.10952 -0.171451 0.429359 -0.0980233 -0.162205 0.429312 -0.0856854 -0.153751 0.429209 -0.0722209 -0.146169 0.428952 -0.0573056 -0.139678 0.428448 -0.0404909 -0.134811 0.427664 -0.0212933 -0.132701 0.426941 5.972e-06 -0.13481 0.427662 0.0213054 -0.139678 0.428444 0.0405034 -0.146168 0.428945 0.0573185 -0.15375 0.429201 0.072234 -0.162204 0.429303 0.0856988 -0.171449 0.429348 0.0980369 -0.181521 0.429429 0.109534 -0.192549 0.42961 0.120459 -0.204664 0.429905 0.130989 -0.217908 0.430298 0.141173 -0.232267 0.430769 0.151003 -0.247707 0.431294 0.160459 -0.264176 0.431853 0.169515 -0.281612 0.432424 0.17815 -0.299947 0.432986 0.186346 -0.319105 0.433519 0.194091 -0.339004 0.434005 0.201378 -0.359558 0.434425 0.208204 -0.380669 0.434762 0.214569 -0.402236 0.435001 0.220477 -0.424148 0.435132 0.225937 -0.446293 0.435148 0.230958 -0.468555 0.435049 0.235556 -0.490823 0.43484 0.23975 -0.51299 0.434528 0.243561 -0.534964 0.434127 0.247014 -0.556661 0.433651 0.250134 -0.578013 0.433113 0.252946 -0.598965 0.432527 0.255474 -0.619472 0.431905 0.257738 -0.639501 0.431256 0.259756 -0.659023 0.430589 0.261542 -0.678015 0.429912 0.263107 -0.696459 0.429233 0.264458 -0.714342 0.428559 0.265601 -0.731658 0.427901 0.26654 -0.748409 0.427266 0.26728 -0.76461 0.426667 0.267825 -0.780289 0.426113 0.268181 -0.795494 0.425616 0.268357 -0.810292 0.425187 0.268362 -0.824773 0.424837 0.268208 -0.839031 0.424582 0.26791 -0.853108 0.424453 0.267486 -0.867783 0.424507 0.26694 -0.884777 0.424694 0.266219 -0.907284 0.42509 0.265237 -0.94098 0.425862 0.2639 -0.995509 0.42719 0.26222 -1.08762 0.42897 0.260447 -1.24437 0.430385 0.258928 -1.50379 0.430565 0.257768 -1.91414 0.430311 0.257415 -2.53531 0.431179 0.258267 -3.44277 0.434568 0.258855 -4.7159 0.481267 0.165611 -0.2624 0.444332 -0.274205 -0.240552 0.443605 -0.262787 -0.219554 0.442859 -0.250746 -0.199501 0.442119 -0.238093 -0.180483 0.441407 -0.224852 -0.162587 0.440749 -0.211049 -0.145889 0.440169 -0.196718 -0.130454 0.439695 -0.181891 -0.116322 0.439353 -0.166581 -0.103478 0.439158 -0.150738 -0.0918101 0.439088 -0.134153 -0.0811949 0.439048 -0.116514 -0.0715964 0.438899 -0.0974957 -0.0630923 0.438501 -0.076741 -0.0558993 0.437731 -0.0537623 -0.0505416 0.436568 -0.0280552 -0.0481801 0.435524 1.114e-05 -0.0505408 0.436565 0.0280778 -0.0558978 0.437725 0.0537854 -0.0630901 0.438493 0.0767647 -0.0715936 0.438889 0.09752 -0.0811914 0.439035 0.116539 -0.0918059 0.439072 0.134179 -0.103473 0.43914 0.150764 -0.116317 0.439331 0.166608 -0.130448 0.439672 0.181918 -0.145882 0.440143 0.196746 -0.162579 0.440719 0.211079 -0.180475 0.441375 0.224883 -0.199493 0.442083 0.238126 -0.219546 0.44282 0.250779 -0.240544 0.443562 0.262823 -0.262392 0.444285 0.274242 -0.284994 0.444969 0.28503 -0.30825 0.445591 0.295185 -0.332054 0.446133 0.30471 -0.356298 0.446578 0.313612 -0.380872 0.446914 0.321902 -0.405664 0.447134 0.329595 -0.430564 0.447236 0.336709 -0.455467 0.447223 0.343265 -0.480277 0.447103 0.349289 -0.504908 0.446889 0.354807 -0.52929 0.446592 0.359848 -0.553363 0.446225 0.36444 -0.577082 0.445802 0.368611 -0.60041 0.445333 0.372385 -0.62332 0.444826 0.375786 -0.645789 0.444289 0.378831 -0.667796 0.443728 0.381537 -0.689326 0.443149 0.383917 -0.710364 0.44256 0.385983 -0.730903 0.441968 0.387744 -0.750943 0.441385 0.389212 -0.770494 0.440821 0.390398 -0.789582 0.440287 0.391312 -0.808251 0.439799 0.39197 -0.82657 0.43937 0.392388 -0.844632 0.439016 0.392583 -0.862539 0.438759 0.392575 -0.880338 0.438642 0.392387 -0.898882 0.438744 0.392043 -0.920025 0.438998 0.391512 -0.947096 0.439487 0.390747 -0.98568 0.440381 0.38969 -1.04475 0.441829 0.388346 -1.13959 0.443696 0.386861 -1.29566 0.445231 0.385489 -1.55122 0.445596 0.384449 -1.95623 0.44552 0.384211 -2.57096 0.446872 0.385151 -3.46832 0.452213 0.384776 -4.7159 0.519219 0.271165 -0.160308 0.470911 -0.389452 -0.133864 0.469796 -0.372626 -0.108357 0.468678 -0.35491 -0.0839106 0.467582 -0.336325 -0.0606509 0.466539 -0.3169 -0.0386994 0.465576 -0.296675 -0.018171 0.464725 -0.275701 --0.000832791 0.46402 -0.254026 --0.0182361 0.46349 -0.231681 --0.0340223 0.463157 -0.208618 --0.0482838 0.46298 -0.184607 --0.0611471 0.462818 -0.159297 --0.0726587 0.462469 -0.132336 --0.0827479 0.461743 -0.103341 --0.0911954 0.460496 -0.0717975 --0.0974562 0.458751 -0.0371911 --0.100263 0.45727 1.9919e-05 --0.0974576 0.458748 0.0372314 --0.0911983 0.460488 0.0718387 --0.082752 0.461732 0.103383 --0.0726641 0.462455 0.132379 --0.0611537 0.462801 0.159342 --0.0482916 0.462959 0.184654 --0.0340313 0.463131 0.208666 --0.0182461 0.463461 0.23173 --0.000843742 0.463986 0.254077 -0.0181593 0.464687 0.275755 -0.0386871 0.465533 0.296732 -0.0606383 0.46649 0.316959 -0.0838978 0.467529 0.336387 -0.108344 0.468618 0.354976 -0.133852 0.46973 0.372695 -0.160296 0.470838 0.389525 -0.187552 0.471915 0.405456 -0.215493 0.472935 0.420487 -0.243996 0.473876 0.434624 -0.272937 0.474718 0.447877 -0.302194 0.475446 0.460263 -0.331648 0.47605 0.471803 -0.361186 0.476526 0.48252 -0.390703 0.476878 0.492446 -0.420107 0.477111 0.501613 -0.449317 0.477237 0.510056 -0.47827 0.477267 0.517816 -0.506915 0.477213 0.52493 -0.535215 0.477087 0.531436 -0.563145 0.476898 0.53737 -0.590686 0.476653 0.542765 -0.617824 0.476358 0.547651 -0.644548 0.476018 0.552055 -0.670852 0.475638 0.555997 -0.696729 0.475222 0.5595 -0.722177 0.474779 0.562581 -0.747201 0.474318 0.565259 -0.771818 0.47385 0.56755 -0.796058 0.473389 0.569474 -0.819972 0.472951 0.57105 -0.843639 0.472553 0.572298 -0.867165 0.472218 0.573243 -0.890667 0.471975 0.573907 -0.914208 0.471879 0.574316 -0.938752 0.472042 0.574515 -0.966342 0.472369 0.574519 -1.00054 0.472949 0.574335 -1.04699 0.473943 0.573963 -1.11417 0.475457 0.573429 -1.21596 0.477324 0.57282 -1.37549 0.478905 0.572277 -1.62912 0.47955 0.571971 -2.02713 0.479932 0.572261 -2.63057 0.482179 0.573308 -3.50958 0.49096 0.570804 -4.7159 0.581739 0.443938 --0.0169791 0.528816 -0.563027 --0.051235 0.526939 -0.538205 --0.0843999 0.525066 -0.512066 --0.116298 0.523233 -0.484631 --0.146752 0.521474 -0.455941 --0.175582 0.519827 -0.42605 --0.202618 0.518334 -0.395028 --0.227699 0.517039 -0.362947 --0.250694 0.515984 -0.329864 --0.271537 0.515196 -0.295746 --0.290293 0.514619 -0.260356 --0.307092 0.514044 -0.223324 --0.321994 0.513192 -0.184289 --0.334929 0.51182 -0.14286 --0.345651 0.509782 -0.0984991 --0.353539 0.50719 -0.0506837 --0.3571 0.505131 3.4462e-05 --0.353542 0.507186 0.0507535 --0.345656 0.509773 0.0985708 --0.334937 0.511806 0.142934 --0.322004 0.513174 0.184366 --0.307103 0.514021 0.223404 --0.290306 0.514591 0.26044 --0.271551 0.515162 0.295835 --0.25071 0.515943 0.329957 --0.227716 0.516992 0.363046 --0.202636 0.51828 0.395132 --0.1756 0.519765 0.426162 --0.146769 0.521403 0.456059 --0.116315 0.523153 0.484757 --0.0844148 0.524977 0.5122 --0.0512478 0.526839 0.538348 --0.0169891 0.528704 0.563178 -0.01819 0.53054 0.586683 -0.0541237 0.532313 0.608864 -0.0906514 0.533996 0.629737 -0.127619 0.535564 0.649322 -0.164879 0.536999 0.667647 -0.202294 0.538288 0.684749 -0.239734 0.539426 0.700667 -0.277087 0.540414 0.715446 -0.314253 0.541259 0.729139 -0.351153 0.541971 0.741798 -0.387726 0.542563 0.753481 -0.423927 0.543047 0.764247 -0.459732 0.543433 0.774153 -0.495127 0.543732 0.783253 -0.530109 0.54395 0.7916 -0.564685 0.544091 0.79924 -0.598863 0.544158 0.806215 -0.632656 0.544156 0.812564 -0.666082 0.544088 0.818319 -0.69916 0.54396 0.823511 -0.731918 0.543781 0.828165 -0.764394 0.543561 0.832309 -0.796643 0.543314 0.835968 -0.82874 0.543059 0.839166 -0.860792 0.542815 0.841931 -0.892935 0.542611 0.844288 -0.925325 0.542482 0.846264 -0.958064 0.542502 0.847882 -0.992269 0.542823 0.849211 -1.03025 0.543315 0.850333 -1.07591 0.544074 0.851327 -1.1351 0.545252 0.852265 -1.216 0.54691 0.853214 -1.33126 0.548866 0.854255 -1.50129 0.550635 0.855452 -1.75841 0.55187 0.85682 -2.14954 0.553319 0.858348 -2.73443 0.557524 0.859455 -3.57961 0.57286 0.852627 -4.7159 0.684724 0.726735 --0.317493 0.644973 -0.839627 --0.364838 0.641419 -0.802573 --0.410833 0.63784 -0.763456 --0.455225 0.634284 -0.722291 --0.49775 0.630804 -0.679119 --0.538141 0.627456 -0.634004 --0.576134 0.624305 -0.587034 --0.611475 0.62142 -0.538313 --0.643937 0.618875 -0.487933 --0.673368 0.616723 -0.435902 --0.699771 0.614894 -0.38201 --0.723249 0.613116 -0.325924 --0.743852 0.611029 -0.267321 --0.761482 0.608354 -0.205834 --0.775833 0.604977 -0.140924 --0.786166 0.601154 -0.0720736 --0.790744 0.598364 5.6597e-05 --0.78617 0.601148 0.0721885 --0.775841 0.604966 0.141043 --0.761493 0.608337 0.205958 --0.743866 0.611006 0.267452 --0.723266 0.613086 0.326063 --0.699789 0.614857 0.382158 --0.673388 0.616677 0.436061 --0.643957 0.61882 0.488104 --0.611495 0.621355 0.538498 --0.576153 0.624228 0.587234 --0.538158 0.627367 0.634221 --0.497762 0.630702 0.679355 --0.455232 0.634167 0.722547 --0.410833 0.637707 0.763732 --0.36483 0.641268 0.802871 --0.317476 0.644801 0.839949 --0.269015 0.648263 0.874971 --0.21968 0.651613 0.907962 --0.169689 0.654813 0.938958 --0.119247 0.657836 0.96801 --0.0685455 0.660659 0.995176 --0.0177603 0.663268 1.02052 -0.0329515 0.665659 1.04412 -0.0834525 0.667835 1.06604 -0.133629 0.669805 1.08638 -0.183391 0.671582 1.10522 -0.232674 0.673182 1.12265 -0.28144 0.674621 1.13876 -0.329673 0.675914 1.15364 -0.377377 0.677073 1.16738 -0.424573 0.678105 1.18007 -0.471294 0.679018 1.19177 -0.517586 0.679817 1.20256 -0.5635 0.680505 1.21249 -0.609096 0.681088 1.22163 -0.654442 0.681571 1.23002 -0.699617 0.681963 1.23771 -0.744713 0.682275 1.24474 -0.78984 0.682522 1.25114 -0.835137 0.682722 1.25695 -0.880776 0.6829 1.2622 -0.926967 0.683087 1.26693 -0.973951 0.683327 1.27116 -1.02191 0.683711 1.27491 -1.07219 0.684432 1.27827 -1.12742 0.685336 1.28141 -1.19194 0.686528 1.28448 -1.27184 0.688156 1.28763 -1.37507 0.690255 1.29098 -1.51302 0.692674 1.29459 -1.70305 0.695157 1.29847 -1.97172 0.697768 1.30239 -2.35799 0.70165 1.30571 -2.91411 0.710435 1.3063 -3.69815 0.737243 1.29281 -4.7159 0.854355 1.18962 --0.820289 0.863963 -1.29683 --0.88966 0.856681 -1.24007 --0.957288 0.849259 -1.17993 --1.02279 0.841773 -1.11639 --1.08575 0.834312 -1.04949 --1.14576 0.826978 -0.979298 --1.2024 0.819885 -0.905921 --1.25524 0.813163 -0.829504 --1.3039 0.80695 -0.750202 --1.34806 0.801362 -0.668101 --1.38757 0.796365 -0.5831 --1.42241 0.791668 -0.495007 --1.45254 0.786891 -0.403641 --1.47775 0.781782 -0.308755 --1.49764 0.776315 -0.209913 --1.51137 0.770928 -0.1067 --1.51711 0.767415 8.054e-05 --1.51137 0.770922 0.106864 --1.49765 0.776303 0.210083 --1.47776 0.781763 0.308936 --1.45256 0.786865 0.403834 --1.42243 0.791633 0.495217 --1.38759 0.796321 0.58333 --1.34807 0.801307 0.668353 --1.30391 0.806882 0.75048 --1.25525 0.813081 0.829812 --1.2024 0.819787 0.906262 --1.14575 0.826862 0.979675 --1.08573 0.834177 1.04991 --1.02275 0.841615 1.11685 --0.957225 0.849075 1.18043 --0.889573 0.856468 1.24063 --0.820174 0.863718 1.29744 --0.749394 0.870755 1.35092 --0.677573 0.877523 1.40113 --0.605025 0.883974 1.44816 --0.53204 0.890073 1.49212 --0.458878 0.895795 1.53312 --0.385774 0.901129 1.5713 --0.312933 0.906073 1.60679 --0.240526 0.910636 1.63973 --0.168694 0.914836 1.67026 --0.0975411 0.918695 1.69854 --0.0271362 0.922239 1.72471 -0.0424863 0.925492 1.74893 -0.111324 0.928479 1.77133 -0.179406 0.931222 1.79206 -0.246784 0.93374 1.81125 -0.313537 0.936047 1.82903 -0.379758 0.938158 1.84552 -0.445563 0.940085 1.86081 -0.511082 0.941839 1.87499 -0.576462 0.943433 1.88817 -0.641871 0.944881 1.9004 -0.707499 0.9462 1.91176 -0.773566 0.947408 1.92231 -0.840325 0.948529 1.9321 -0.908077 0.949592 1.94119 -0.977177 0.950633 1.94962 -1.04802 0.951707 1.95742 -1.12097 0.952913 1.96462 -1.19758 0.954478 1.9713 -1.28077 0.956243 1.97772 -1.37506 0.958332 1.98408 -1.48644 0.960899 1.99055 -1.62208 0.964005 1.99725 -1.79148 0.967634 2.00419 -2.00815 0.971884 2.01121 -2.29174 0.977372 2.01778 -2.67056 0.985962 2.0226 -3.18316 1.00243 2.0223 -3.8698 1.03985 2.00659 -4.7159 1.13375 1.94727 --1.64846 1.27147 -2.09298 --1.75827 1.25653 -2.00353 --1.86586 1.24116 -1.90807 --1.97055 1.22547 -1.80653 --2.07161 1.20965 -1.69891 --2.16831 1.19388 -1.58531 --2.25987 1.17837 -1.46588 --2.34556 1.16339 -1.34084 --2.42464 1.14919 -1.21048 --2.49648 1.13603 -1.07508 --2.56057 1.12403 -0.934822 --2.61657 1.11305 -0.789862 --2.6641 1.10291 -0.640399 --2.70276 1.09352 -0.486572 --2.73199 1.08505 -0.328365 --2.75093 1.07806 -0.165805 --2.75811 1.07424 7.9261e-05 --2.75094 1.07805 0.165966 --2.73199 1.08504 0.328535 --2.70277 1.0935 0.486753 --2.66411 1.10289 0.640598 --2.61657 1.11302 0.790082 --2.56058 1.12399 0.935068 --2.49647 1.13598 1.07536 --2.42463 1.14913 1.21079 --2.34553 1.16332 1.34119 --2.25983 1.17829 1.46628 --2.16824 1.19377 1.58577 --2.07152 1.20952 1.69943 --1.97042 1.22532 1.80711 --1.8657 1.24097 1.90872 --1.75806 1.25631 2.00426 --1.64819 1.27121 2.09379 --1.53675 1.28554 2.17744 --1.42431 1.29921 2.25536 --1.31141 1.31216 2.32779 --1.19853 1.32434 2.39496 --1.08608 1.33573 2.45714 --0.974429 1.34631 2.51461 --0.863859 1.35611 2.56766 --0.75461 1.36514 2.61659 --0.646858 1.37345 2.66169 --0.540719 1.38106 2.70327 --0.436257 1.38803 2.7416 --0.333483 1.39441 2.77695 --0.232361 1.40025 2.8096 --0.132814 1.40558 2.83979 --0.0347297 1.41046 2.86775 -0.0620381 1.41491 2.8937 -0.157664 1.41899 2.91783 -0.252348 1.42272 2.94031 -0.346319 1.42614 2.96132 -0.439832 1.42928 2.98099 -0.533172 1.43216 2.99945 -0.626662 1.43483 3.01681 -0.720664 1.43731 3.03317 -0.815591 1.43965 3.04863 -0.911922 1.44187 3.06325 -1.01021 1.44402 3.07711 -1.11107 1.44615 3.09027 -1.21517 1.44836 3.10275 -1.32404 1.45082 3.11463 -1.44035 1.45344 3.12616 -1.56787 1.45635 3.13752 -1.71141 1.45968 3.14884 -1.8766 1.46354 3.16018 -2.07077 1.4681 3.17151 -2.30417 1.47368 3.1826 -2.59151 1.48105 3.19297 -2.95375 1.49186 3.20156 -3.41873 1.50942 3.2062 -4.01223 1.54019 3.2028 -4.7159 1.59394 3.18741 --2.92835 2.09304 -3.73907 --3.14776 2.06365 -3.59726 --3.36335 2.03424 -3.44178 --3.57352 2.00519 -3.27236 --3.77665 1.97682 -3.08891 --3.97115 1.94945 -2.89147 --4.15545 1.92336 -2.6803 --4.32804 1.89878 -2.45584 --4.48747 1.87589 -2.21872 --4.63241 1.85478 -1.96976 --4.76165 1.83552 -1.70997 --4.87411 1.81806 -1.44054 --4.9689 1.80231 -1.16279 --5.04535 1.78808 -0.878227 --5.10299 1.7751 -0.588435 --5.14158 1.76301 -0.295109 --5.16117 1.75138 0 --5.14158 1.76301 0.295109 --5.10299 1.7751 0.588435 --5.04535 1.78808 0.878227 --4.9689 1.80231 1.16279 --4.87411 1.81806 1.44054 --4.76165 1.83552 1.70997 --4.63241 1.85478 1.96976 --4.48747 1.87589 2.21872 --4.32804 1.89878 2.45584 --4.15545 1.92336 2.6803 --3.97115 1.94945 2.89147 --3.77665 1.97682 3.08891 --3.57352 2.00519 3.27236 --3.36335 2.03424 3.44178 --3.14776 2.06365 3.59726 --2.92835 2.09304 3.73907 --2.70668 2.12204 3.86764 --2.48429 2.15031 3.98349 --2.26267 2.17749 4.08729 --2.04325 2.20326 4.17976 --1.82735 2.22736 4.2617 --1.61626 2.24954 4.33398 --1.41113 2.26963 4.39747 --1.21303 2.28751 4.45308 --1.02293 2.30313 4.50167 --0.841653 2.31648 4.54414 --0.669937 2.32763 4.58132 --0.508375 2.33669 4.61399 --0.357438 2.34381 4.64291 --0.217466 2.34918 4.66876 --0.0886683 2.35303 4.69216 -0.0288776 2.35559 4.71368 -0.135231 2.35708 4.73467 -0.23059 2.35774 4.75565 -0.315275 2.35779 4.77663 -0.389727 2.35752 4.79762 -0.45452 2.35724 4.8186 -0.510351 2.35696 4.83958 -0.558056 2.35668 4.86057 -0.598605 2.3564 4.88155 -0.633116 2.35611 4.90254 -0.66286 2.35583 4.92352 -0.689262 2.35555 4.94451 -0.713916 2.35527 4.96549 -0.739158 2.35499 4.98647 -0.770218 2.35471 5.00746 -0.814433 2.35443 5.02844 -0.881224 2.35415 5.04942 -0.982686 2.35387 5.07041 -1.13435 2.35358 5.09139 -1.35616 2.3533 5.11238 -1.67373 2.35302 5.13336 -2.11993 2.35274 5.15434 -2.73698 2.35246 5.17533 -3.57911 2.35218 5.19631 -4.7159 2.3519 5.2173 -0.425358 0.527572 -0.0237435 -0.410246 0.527153 -0.0230333 -0.395937 0.526687 -0.0222261 -0.382501 0.526179 -0.0213297 -0.369997 0.525635 -0.0203517 -0.358469 0.525058 -0.0193024 -0.347952 0.524458 -0.0181974 -0.338465 0.523846 -0.0170583 -0.33001 0.523235 -0.0159106 -0.322569 0.522636 -0.0147797 -0.316094 0.521992 -0.013551 -0.310531 0.521174 -0.0119785 -0.305888 0.520137 -0.00997036 -0.302174 0.518941 -0.00764252 -0.299342 0.517668 -0.00515752 -0.297334 0.516362 -0.00259978 -0.296146 0.515037 0 -0.297334 0.516362 0.00259978 -0.299342 0.517668 0.00515752 -0.302174 0.518941 0.00764252 -0.305888 0.520137 0.00997036 -0.310531 0.521174 0.0119785 -0.316094 0.521992 0.013551 -0.322569 0.522636 0.0147797 -0.33001 0.523235 0.0159106 -0.338465 0.523846 0.0170583 -0.347952 0.524458 0.0181974 -0.358469 0.525058 0.0193024 -0.369997 0.525635 0.0203517 -0.382501 0.526179 0.0213297 -0.395937 0.526687 0.0222261 -0.410246 0.527153 0.0230333 -0.425358 0.527572 0.0237435 -0.441195 0.527938 0.0243458 -0.457667 0.528243 0.0248243 -0.474676 0.528473 0.0251584 -0.492119 0.528614 0.0253242 -0.509886 0.528653 0.0252987 -0.527867 0.528578 0.0250634 -0.545952 0.528383 0.0246095 -0.564032 0.528067 0.0239404 -0.582005 0.527638 0.0230723 -0.599773 0.52711 0.022033 -0.617242 0.526502 0.0208579 -0.634326 0.525835 0.0195853 -0.650944 0.525128 0.0182512 -0.667018 0.524398 0.016886 -0.68248 0.523657 0.0155119 -0.697266 0.522914 0.0141432 -0.711323 0.522175 0.0127881 -0.72461 0.521441 0.011451 -0.737099 0.520715 0.0101351 -0.74878 0.52 0.0088449 -0.759656 0.5193 0.00758628 -0.769755 0.518619 0.0063665 -0.779119 0.517962 0.00519299 -0.787817 0.517333 0.0040714 -0.795934 0.516733 0.00300433 -0.80358 0.516158 0.00198392 -0.810886 0.515598 0.000990924 -0.818011 0.515038 0 -0.825442 0.515038 0 -0.834425 0.515038 0 -0.849025 0.515038 0 -0.876749 0.515038 0 -0.92953 0.515038 0 -1.02498 0.515038 0 -1.188 0.515038 0 -1.45288 0.515038 0 -1.86589 0.515037 0 -2.48878 0.515037 0 -3.40311 0.515037 0 -4.7159 0.515037 0 -0.425357 0.52757 -0.0237641 -0.410245 0.52715 -0.0230539 -0.395936 0.526684 -0.0222465 -0.3825 0.526177 -0.02135 -0.369996 0.525632 -0.0203718 -0.358468 0.525055 -0.0193224 -0.347952 0.524455 -0.0182172 -0.338464 0.523843 -0.0170779 -0.330009 0.523231 -0.0159299 -0.322569 0.522632 -0.0147988 -0.316094 0.521987 -0.0135698 -0.31053 0.52117 -0.0119971 -0.305885 0.520134 -0.00998868 -0.302167 0.518938 -0.00765977 -0.29933 0.517667 -0.00517178 -0.297318 0.516362 -0.00260826 -0.296132 0.51505 0 -0.297318 0.516362 0.00260826 -0.29933 0.517667 0.00517178 -0.302167 0.518938 0.00765977 -0.305885 0.520134 0.00998868 -0.31053 0.52117 0.0119971 -0.316094 0.521987 0.0135698 -0.322569 0.522632 0.0147988 -0.330009 0.523231 0.0159299 -0.338464 0.523843 0.0170779 -0.347952 0.524455 0.0182172 -0.358468 0.525055 0.0193224 -0.369996 0.525632 0.0203718 -0.3825 0.526177 0.02135 -0.395936 0.526684 0.0222465 -0.410245 0.52715 0.0230539 -0.425357 0.52757 0.0237641 -0.441194 0.527937 0.0243665 -0.457666 0.528241 0.0248451 -0.474676 0.528471 0.0251793 -0.492119 0.528613 0.0253452 -0.509886 0.528652 0.0253196 -0.527868 0.528577 0.0250844 -0.545953 0.528381 0.0246305 -0.564033 0.528065 0.0239613 -0.582006 0.527636 0.0230933 -0.599774 0.527109 0.022054 -0.617243 0.526501 0.0208789 -0.634327 0.525833 0.0196062 -0.650945 0.525126 0.0182721 -0.66702 0.524396 0.0169068 -0.682482 0.523656 0.0155326 -0.697268 0.522913 0.0141639 -0.711325 0.522173 0.0128087 -0.724612 0.521439 0.0114716 -0.737101 0.520713 0.0101556 -0.748781 0.519998 0.00886526 -0.759658 0.519298 0.00760653 -0.769757 0.518618 0.00638666 -0.779122 0.517961 0.00521307 -0.787819 0.517332 0.00409142 -0.795936 0.516732 0.00302433 -0.803582 0.516157 0.00200393 -0.810889 0.515597 0.00101099 -0.818012 0.515038 2.036e-05 -0.825442 0.515037 2.0362e-05 -0.834426 0.515037 2.0444e-05 -0.849026 0.515037 2.0675e-05 -0.876751 0.515036 2.1281e-05 -0.929532 0.515037 2.2267e-05 -1.02498 0.515037 2.2973e-05 -1.18801 0.515037 2.2972e-05 -1.45288 0.515037 2.2803e-05 -1.86589 0.515037 2.3011e-05 -2.48878 0.515037 2.3789e-05 -3.40311 0.515037 2.5533e-05 -4.7159 0.515044 2.0753e-05 -0.425356 0.527566 -0.0238007 -0.410243 0.527146 -0.0230902 -0.395934 0.52668 -0.0222825 -0.382498 0.526172 -0.0213855 -0.369994 0.525627 -0.0204069 -0.358466 0.52505 -0.019357 -0.34795 0.524449 -0.0182513 -0.338463 0.523837 -0.0171115 -0.330008 0.523224 -0.0159629 -0.322569 0.522625 -0.0148308 -0.316093 0.521979 -0.0136008 -0.310528 0.521162 -0.0120275 -0.305879 0.520128 -0.0100184 -0.302155 0.518934 -0.0076875 -0.299311 0.517664 -0.00519449 -0.297292 0.516362 -0.00262162 -0.29611 0.515069 0 -0.297292 0.516362 0.00262162 -0.299311 0.517664 0.00519449 -0.302155 0.518934 0.0076875 -0.305879 0.520128 0.0100184 -0.310528 0.521162 0.0120275 -0.316093 0.521979 0.0136008 -0.322569 0.522625 0.0148308 -0.330008 0.523224 0.0159628 -0.338463 0.523837 0.0171115 -0.34795 0.524449 0.0182513 -0.358466 0.52505 0.019357 -0.369994 0.525627 0.0204069 -0.382498 0.526172 0.0213855 -0.395934 0.52668 0.0222825 -0.410243 0.527146 0.0230902 -0.425356 0.527566 0.0238007 -0.441193 0.527933 0.0244034 -0.457666 0.528238 0.0248822 -0.474675 0.528468 0.0252166 -0.492119 0.528609 0.0253827 -0.509886 0.528649 0.0253573 -0.527868 0.528574 0.0251222 -0.545953 0.528378 0.0246684 -0.564034 0.528062 0.0239994 -0.582008 0.527633 0.0231314 -0.599776 0.527106 0.0220921 -0.617245 0.526498 0.0209171 -0.63433 0.52583 0.0196444 -0.650948 0.525123 0.0183103 -0.667023 0.524393 0.0169451 -0.682485 0.523653 0.0155708 -0.697271 0.52291 0.0142021 -0.711328 0.52217 0.0128468 -0.724615 0.521436 0.0115095 -0.737105 0.52071 0.0101934 -0.748785 0.519996 0.008903 -0.759662 0.519296 0.00764415 -0.769761 0.518615 0.00642418 -0.779126 0.517958 0.00525051 -0.787824 0.517329 0.00412883 -0.795941 0.516729 0.00306175 -0.803587 0.516155 0.00204144 -0.810894 0.515595 0.00104874 -0.818015 0.515039 5.9376e-05 -0.825442 0.515036 5.8676e-05 -0.834427 0.515035 5.8755e-05 -0.849028 0.515034 5.928e-05 -0.876754 0.515034 6.083e-05 -0.929536 0.515034 6.3374e-05 -1.02499 0.515035 6.5079e-05 -1.18801 0.515036 6.4846e-05 -1.45289 0.515035 6.4249e-05 -1.8659 0.515035 6.4761e-05 -2.48879 0.515035 6.6832e-05 -3.40312 0.515036 7.1443e-05 -4.7159 0.515055 5.5391e-05 -0.425354 0.52756 -0.0238656 -0.410241 0.527139 -0.0231542 -0.395931 0.526673 -0.0223457 -0.382495 0.526164 -0.0214478 -0.36999 0.525618 -0.0204681 -0.358463 0.525041 -0.0194171 -0.347946 0.52444 -0.0183101 -0.33846 0.523827 -0.0171689 -0.330006 0.523214 -0.0160188 -0.322568 0.522613 -0.0148848 -0.316093 0.521967 -0.0136524 -0.310525 0.521151 -0.0120773 -0.30587 0.520119 -0.0100667 -0.302136 0.518928 -0.0077322 -0.299281 0.517661 -0.00523081 -0.297252 0.516362 -0.00264281 -0.296076 0.515098 0 -0.297252 0.516362 0.00264281 -0.299281 0.517661 0.00523081 -0.302136 0.518928 0.00773221 -0.30587 0.520119 0.0100667 -0.310525 0.521151 0.0120773 -0.316093 0.521967 0.0136524 -0.322568 0.522613 0.0148848 -0.330006 0.523214 0.0160188 -0.33846 0.523827 0.0171689 -0.347946 0.52444 0.0183101 -0.358463 0.525041 0.0194171 -0.36999 0.525618 0.0204681 -0.382495 0.526164 0.0214478 -0.395931 0.526673 0.0223457 -0.410241 0.527139 0.0231542 -0.425354 0.52756 0.0238656 -0.441191 0.527927 0.0244689 -0.457664 0.528232 0.0249483 -0.474674 0.528462 0.0252832 -0.492118 0.528604 0.0254498 -0.509887 0.528643 0.0254248 -0.527869 0.528568 0.0251901 -0.545955 0.528373 0.0247367 -0.564037 0.528057 0.024068 -0.582011 0.527628 0.0232003 -0.599779 0.5271 0.0221613 -0.617249 0.526493 0.0209865 -0.634335 0.525825 0.0197141 -0.650953 0.525118 0.0183801 -0.667028 0.524388 0.017015 -0.68249 0.523648 0.0156408 -0.697277 0.522905 0.0142721 -0.711334 0.522165 0.0129168 -0.724622 0.521431 0.0115794 -0.737112 0.520705 0.0102633 -0.748792 0.51999 0.0089727 -0.75967 0.51929 0.00771376 -0.769769 0.51861 0.00649372 -0.779134 0.517953 0.00532003 -0.787832 0.517324 0.00419842 -0.79595 0.516725 0.00313151 -0.803596 0.516151 0.00211152 -0.810903 0.515592 0.00111952 -0.81802 0.515041 0.000133781 -0.825443 0.515033 0.000130502 -0.83443 0.515031 0.000130266 -0.849033 0.515029 0.000131052 -0.876759 0.515029 0.000133974 -0.929542 0.51503 0.000138978 -1.025 0.515033 0.000142219 -1.18802 0.515034 0.000141394 -1.4529 0.515033 0.000139902 -1.86591 0.515032 0.000140855 -2.48881 0.515033 0.000145077 -3.40314 0.515034 0.000154412 -4.7159 0.515075 0.000113331 -0.425349 0.527548 -0.02398 -0.410235 0.527127 -0.0232669 -0.395926 0.52666 -0.0224564 -0.382489 0.526151 -0.0215564 -0.369984 0.525604 -0.0205744 -0.358457 0.525026 -0.0195208 -0.34794 0.524424 -0.0184112 -0.338454 0.52381 -0.017267 -0.330002 0.523196 -0.0161137 -0.322566 0.522595 -0.0149754 -0.316091 0.521947 -0.013738 -0.310519 0.521132 -0.012159 -0.305854 0.520105 -0.010145 -0.302107 0.518919 -0.00780413 -0.299233 0.517656 -0.00528882 -0.297189 0.516363 -0.00267644 -0.296022 0.515141 1e-09 -0.297189 0.516363 0.00267644 -0.299233 0.517656 0.00528882 -0.302107 0.518919 0.00780413 -0.305854 0.520105 0.0101451 -0.310519 0.521132 0.012159 -0.316091 0.521947 0.013738 -0.322566 0.522595 0.0149754 -0.330002 0.523196 0.0161137 -0.338455 0.52381 0.017267 -0.34794 0.524424 0.0184112 -0.358457 0.525026 0.0195208 -0.369984 0.525604 0.0205744 -0.382489 0.526151 0.0215564 -0.395926 0.52666 0.0224564 -0.410235 0.527127 0.0232669 -0.425349 0.527548 0.02398 -0.441188 0.527916 0.0245848 -0.457661 0.528222 0.0250656 -0.474672 0.528452 0.0254018 -0.492117 0.528594 0.0255694 -0.509887 0.528634 0.0255455 -0.527871 0.528559 0.0253117 -0.545958 0.528363 0.0248592 -0.564041 0.528048 0.0241913 -0.582016 0.527619 0.0233244 -0.599786 0.527091 0.0222862 -0.617257 0.526484 0.021112 -0.634343 0.525816 0.0198402 -0.650962 0.525109 0.0185069 -0.667038 0.524379 0.0171421 -0.6825 0.523639 0.0157683 -0.697287 0.522896 0.0143998 -0.711345 0.522156 0.0130447 -0.724634 0.521422 0.0117074 -0.737124 0.520696 0.0103913 -0.748806 0.519981 0.00910073 -0.759684 0.519281 0.00784182 -0.769783 0.5186 0.00662189 -0.779149 0.517944 0.00544843 -0.787848 0.517315 0.00432719 -0.795966 0.516716 0.00326085 -0.803613 0.516143 0.00224176 -0.810919 0.515587 0.00125156 -0.818029 0.515045 0.000274611 -0.825444 0.515029 0.000264441 -0.834435 0.515024 0.000263032 -0.849041 0.515021 0.000263746 -0.876769 0.515021 0.00026847 -0.929554 0.515023 0.000277287 -1.02501 0.515028 0.00028301 -1.18804 0.51503 0.000281032 -1.45292 0.515029 0.000277797 -1.86594 0.515027 0.000279367 -2.48884 0.515028 0.000287151 -3.40317 0.515031 0.00030422 -4.7159 0.51511 0.000209994 -0.425341 0.527529 -0.0241804 -0.410226 0.527107 -0.0234637 -0.395916 0.526639 -0.0226491 -0.382479 0.526128 -0.0217446 -0.369973 0.52558 -0.0207578 -0.358445 0.525 -0.019699 -0.347929 0.524397 -0.0185837 -0.338445 0.523782 -0.0174335 -0.329995 0.523168 -0.0162735 -0.322563 0.522564 -0.0151265 -0.316087 0.521915 -0.013879 -0.310509 0.521103 -0.0122921 -0.305829 0.520083 -0.0102716 -0.302058 0.518906 -0.00791932 -0.299158 0.51765 -0.00538108 -0.29709 0.516367 -0.0027296 -0.295937 0.515204 2e-09 -0.29709 0.516367 0.0027296 -0.299158 0.51765 0.00538108 -0.302058 0.518906 0.00791933 -0.305829 0.520083 0.0102716 -0.310509 0.521103 0.0122921 -0.316087 0.521915 0.013879 -0.322563 0.522564 0.0151265 -0.329995 0.523168 0.0162735 -0.338445 0.523782 0.0174335 -0.347929 0.524397 0.0185837 -0.358445 0.525 0.019699 -0.369973 0.52558 0.0207578 -0.382479 0.526128 0.0217446 -0.395916 0.526639 0.0226491 -0.410226 0.527107 0.0234637 -0.425341 0.527529 0.0241804 -0.441181 0.527898 0.0247886 -0.457656 0.528204 0.0252723 -0.474669 0.528435 0.0256112 -0.492115 0.528578 0.0257812 -0.509887 0.528617 0.0257595 -0.527873 0.528543 0.0255279 -0.545963 0.528347 0.0250774 -0.564048 0.528031 0.0244114 -0.582026 0.527603 0.0235464 -0.599797 0.527075 0.02251 -0.61727 0.526468 0.0213375 -0.634358 0.525801 0.0200673 -0.650978 0.525094 0.0187353 -0.667055 0.524363 0.0173718 -0.682518 0.523623 0.0159989 -0.697306 0.52288 0.0146312 -0.711365 0.52214 0.0132767 -0.724655 0.521405 0.01194 -0.737146 0.520679 0.0106243 -0.748829 0.519964 0.0093342 -0.759709 0.519264 0.00807579 -0.76981 0.518583 0.00685649 -0.779177 0.517927 0.00568388 -0.787876 0.517299 0.0045638 -0.795995 0.516702 0.003499 -0.803643 0.51613 0.00248212 -0.81095 0.515577 0.00149608 -0.818048 0.51505 0.000538219 -0.825448 0.51502 0.000512403 -0.834445 0.515012 0.000507756 -0.849056 0.515006 0.000507302 -0.876787 0.515006 0.000513963 -0.929576 0.515011 0.000528434 -1.02504 0.515019 0.000538194 -1.18807 0.515024 0.000534183 -1.45296 0.515022 0.000527696 -1.86599 0.515019 0.000530068 -2.48889 0.51502 0.000543679 -3.40322 0.515026 0.000573251 -4.7159 0.515172 0.000370631 -0.425327 0.527497 -0.0245287 -0.41021 0.527074 -0.0238045 -0.395898 0.526603 -0.0229817 -0.38246 0.52609 -0.0220682 -0.369953 0.52554 -0.0210716 -0.358425 0.524959 -0.0200024 -0.34791 0.524354 -0.0188761 -0.338427 0.523738 -0.017714 -0.329982 0.523122 -0.0165407 -0.322554 0.522516 -0.015377 -0.316078 0.521865 -0.0141103 -0.310489 0.521059 -0.0125079 -0.305785 0.520051 -0.0104745 -0.301979 0.518887 -0.00810251 -0.299037 0.517643 -0.00552678 -0.296934 0.516375 -0.00281307 -0.295801 0.515291 3e-09 -0.296934 0.516375 0.00281308 -0.299037 0.517643 0.00552679 -0.301979 0.518887 0.00810252 -0.305785 0.52005 0.0104746 -0.310489 0.521059 0.012508 -0.316078 0.521865 0.0141103 -0.322554 0.522516 0.015377 -0.329982 0.523122 0.0165407 -0.338427 0.523738 0.017714 -0.34791 0.524354 0.0188761 -0.358425 0.524959 0.0200024 -0.369953 0.52554 0.0210716 -0.38246 0.52609 0.0220682 -0.395898 0.526603 0.0229817 -0.41021 0.527074 0.0238045 -0.425327 0.527497 0.0245287 -0.441169 0.527868 0.0251436 -0.457646 0.528175 0.0256335 -0.474662 0.528407 0.0259778 -0.492112 0.52855 0.026153 -0.509887 0.52859 0.0261359 -0.527877 0.528515 0.0259088 -0.545971 0.52832 0.0254626 -0.564061 0.528004 0.0248008 -0.582042 0.527575 0.0239399 -0.599818 0.527048 0.0229074 -0.617294 0.52644 0.0217388 -0.634384 0.525773 0.0204721 -0.651006 0.525066 0.0191434 -0.667085 0.524336 0.0177828 -0.68255 0.523595 0.0164125 -0.69734 0.522852 0.0150469 -0.711401 0.522111 0.0136942 -0.724692 0.521376 0.0123591 -0.737186 0.52065 0.0110448 -0.748871 0.519934 0.00975622 -0.759753 0.519234 0.00849946 -0.769857 0.518554 0.00728209 -0.779226 0.517898 0.00611184 -0.787928 0.517271 0.0049947 -0.796049 0.516675 0.00393356 -0.803698 0.516106 0.00292171 -0.811006 0.515559 0.00194486 -0.818083 0.515058 0.00102402 -0.825459 0.515006 0.000967229 -0.834467 0.51499 0.000954749 -0.849086 0.51498 0.000950301 -0.87682 0.514979 0.000957948 -0.929616 0.514989 0.000980128 -1.02509 0.515005 0.000996235 -1.18813 0.515012 0.000988806 -1.45303 0.515008 0.000976437 -1.86607 0.515003 0.000979729 -2.48898 0.515005 0.00100271 -3.40331 0.515017 0.00105213 -4.7159 0.515278 0.000636598 -0.425301 0.527445 -0.0251276 -0.410181 0.527018 -0.0243887 -0.395866 0.526545 -0.0235498 -0.382425 0.526029 -0.0226188 -0.369917 0.525476 -0.0216034 -0.358388 0.524891 -0.0205142 -0.347873 0.524284 -0.0193666 -0.338394 0.523666 -0.0181817 -0.329955 0.523049 -0.0169835 -0.322534 0.52244 -0.0157886 -0.316057 0.521788 -0.0144867 -0.31045 0.520991 -0.0128554 -0.30571 0.520001 -0.0107977 -0.30185 0.518859 -0.00839135 -0.298844 0.517633 -0.00575486 -0.296687 0.51639 -0.00294304 -0.295579 0.515407 6e-09 -0.296687 0.51639 0.00294306 -0.298844 0.517633 0.00575488 -0.30185 0.518859 0.00839138 -0.30571 0.520001 0.0107977 -0.31045 0.52099 0.0128555 -0.316057 0.521788 0.0144867 -0.322534 0.52244 0.0157886 -0.329955 0.523049 0.0169835 -0.338394 0.523666 0.0181817 -0.347873 0.524284 0.0193666 -0.358388 0.524891 0.0205142 -0.369917 0.525475 0.0216034 -0.382425 0.526029 0.0226188 -0.395866 0.526544 0.0235498 -0.410181 0.527018 0.0243887 -0.425301 0.527444 0.0251276 -0.441146 0.527817 0.0257559 -0.457628 0.528126 0.0262578 -0.474648 0.528359 0.0266131 -0.492104 0.528503 0.0267984 -0.509886 0.528543 0.0267908 -0.527883 0.528469 0.0265727 -0.545985 0.528273 0.0261354 -0.564082 0.527957 0.0254823 -0.58207 0.527528 0.0246299 -0.599852 0.527001 0.0236059 -0.617334 0.526394 0.0224453 -0.634428 0.525727 0.0211863 -0.651055 0.525019 0.0198647 -0.667138 0.524289 0.0185105 -0.682606 0.523548 0.0171458 -0.697399 0.522804 0.0157853 -0.711464 0.522062 0.0144371 -0.724758 0.521326 0.013106 -0.737256 0.520598 0.0117956 -0.748946 0.519882 0.010511 -0.759832 0.519181 0.00925851 -0.769939 0.518501 0.00804602 -0.779313 0.517847 0.00688144 -0.788019 0.517222 0.00577103 -0.796144 0.516628 0.00471795 -0.803797 0.516065 0.00371693 -0.811105 0.515529 0.00275931 -0.81815 0.515065 0.00190123 -0.825489 0.514981 0.00179193 -0.834516 0.514952 0.00176214 -0.849147 0.514935 0.00174727 -0.876886 0.514933 0.0017521 -0.929689 0.514952 0.00178316 -1.02517 0.51498 0.0018085 -1.18824 0.514993 0.00179544 -1.45315 0.514985 0.00177274 -1.86622 0.514976 0.0017768 -2.48915 0.51498 0.00181454 -3.40346 0.515002 0.00189477 -4.7159 0.515458 0.00107562 -0.425252 0.527358 -0.0261446 -0.410127 0.526928 -0.0253778 -0.395807 0.52645 -0.0245084 -0.382362 0.525929 -0.0235445 -0.369851 0.525371 -0.0224939 -0.35832 0.524783 -0.0213673 -0.347806 0.524173 -0.0201802 -0.33833 0.523553 -0.0189533 -0.329899 0.522934 -0.0177091 -0.322486 0.522323 -0.0164585 -0.316005 0.521671 -0.0150948 -0.310371 0.520887 -0.013411 -0.305575 0.519926 -0.011308 -0.301633 0.518815 -0.0088426 -0.298533 0.517619 -0.0061085 -0.296298 0.516413 -0.00314356 -0.295211 0.515548 1.1e-08 -0.296298 0.516413 0.00314359 -0.298533 0.517619 0.00610854 -0.301633 0.518815 0.00884265 -0.305575 0.519926 0.0113081 -0.310371 0.520887 0.013411 -0.316005 0.521671 0.0150948 -0.322486 0.522322 0.0164585 -0.329899 0.522934 0.0177091 -0.33833 0.523552 0.0189533 -0.347806 0.524173 0.0201803 -0.35832 0.524783 0.0213674 -0.369851 0.525371 0.022494 -0.382362 0.525929 0.0235446 -0.395807 0.526449 0.0245085 -0.410127 0.526927 0.0253778 -0.425252 0.527358 0.0261447 -0.441104 0.527734 0.0267985 -0.457593 0.528045 0.0273236 -0.474623 0.528281 0.0277002 -0.492088 0.528425 0.0279051 -0.509882 0.528466 0.0279161 -0.527891 0.528391 0.0277159 -0.546005 0.528196 0.027296 -0.564114 0.527879 0.0266602 -0.582115 0.52745 0.025825 -0.599908 0.526923 0.0248179 -0.6174 0.526315 0.0236738 -0.634503 0.525648 0.0224305 -0.651137 0.52494 0.0211235 -0.667226 0.524209 0.0197828 -0.6827 0.523467 0.0184304 -0.697499 0.522721 0.0170808 -0.711569 0.521978 0.0157425 -0.724871 0.52124 0.0144207 -0.737376 0.520511 0.0131195 -0.749073 0.519793 0.0118442 -0.759967 0.519092 0.0106017 -0.770083 0.518412 0.00940025 -0.779464 0.517759 0.00824812 -0.788178 0.517136 0.00715204 -0.796311 0.516548 0.00611575 -0.803971 0.515994 0.00513683 -0.811278 0.515477 0.00421692 -0.818279 0.515061 0.00344789 -0.825571 0.514938 0.00326584 -0.834627 0.514887 0.00320119 -0.849278 0.514857 0.00316255 -0.877019 0.514855 0.00315443 -0.929829 0.514888 0.00319175 -1.02533 0.514938 0.00322868 -1.18842 0.514961 0.0032063 -1.45337 0.514946 0.00316594 -1.86647 0.51493 0.00317001 -2.48943 0.514937 0.00323037 -3.40373 0.514977 0.00335709 -4.7159 0.515759 0.00179863 -0.425161 0.52722 -0.0278482 -0.410026 0.526783 -0.0270296 -0.395697 0.526298 -0.0261043 -0.382245 0.525771 -0.0250802 -0.369727 0.525207 -0.0239656 -0.358192 0.524614 -0.0227714 -0.347677 0.524 -0.0215131 -0.338205 0.523377 -0.0202107 -0.329781 0.522758 -0.0188845 -0.322376 0.522145 -0.0175379 -0.315884 0.521496 -0.0160695 -0.310206 0.520733 -0.0142934 -0.305326 0.519811 -0.0121081 -0.301264 0.518747 -0.0095414 -0.298025 0.517594 -0.00665158 -0.295675 0.516443 -0.00345001 -0.294598 0.515702 2.2e-08 -0.295675 0.516443 0.00345007 -0.298025 0.517594 0.00665166 -0.301264 0.518747 0.0095415 -0.305326 0.519811 0.0121082 -0.310206 0.520733 0.0142934 -0.315884 0.521496 0.0160695 -0.322376 0.522144 0.017538 -0.329782 0.522757 0.0188846 -0.338205 0.523377 0.0202108 -0.347677 0.523999 0.0215132 -0.358192 0.524613 0.0227715 -0.369727 0.525207 0.0239657 -0.382245 0.525771 0.0250803 -0.395697 0.526298 0.0261044 -0.410026 0.526783 0.0270298 -0.425161 0.527219 0.0278484 -0.441024 0.5276 0.0285495 -0.457526 0.527916 0.029118 -0.47457 0.528153 0.0295344 -0.492053 0.5283 0.0297766 -0.509865 0.52834 0.0298229 -0.527895 0.528266 0.0296567 -0.54603 0.528069 0.0292703 -0.564161 0.527752 0.0286679 -0.582182 0.527322 0.0278659 -0.599994 0.526793 0.0268916 -0.617503 0.526185 0.0257797 -0.634621 0.525517 0.0245673 -0.651268 0.524809 0.0232896 -0.667368 0.524076 0.0219759 -0.682853 0.523331 0.0206483 -0.697662 0.522583 0.0193214 -0.711743 0.521837 0.0180042 -0.725056 0.521096 0.0167025 -0.737574 0.520363 0.0154211 -0.749285 0.519643 0.0141661 -0.760193 0.51894 0.012945 -0.770324 0.51826 0.0117668 -0.779721 0.51761 0.0106402 -0.78845 0.516993 0.00957274 -0.796598 0.516413 0.00856943 -0.804272 0.515875 0.00763288 -0.811578 0.515389 0.00677914 -0.818535 0.515019 0.00611102 -0.825785 0.51486 0.00585117 -0.834885 0.514777 0.0057251 -0.849564 0.514727 0.00563802 -0.877295 0.514724 0.0055944 -0.930101 0.514784 0.00562535 -1.02562 0.51487 0.00567218 -1.18875 0.514908 0.00563401 -1.45375 0.514882 0.00556436 -1.86691 0.514853 0.00556638 -2.48992 0.514866 0.00566039 -3.40418 0.514937 0.00585489 -4.7159 0.516264 0.00298726 -0.424983 0.527003 -0.0306583 -0.409831 0.526557 -0.029747 -0.395486 0.526063 -0.0287217 -0.382019 0.525527 -0.0275908 -0.369489 0.524954 -0.0263632 -0.357944 0.524354 -0.0250501 -0.347424 0.523736 -0.0236672 -0.337951 0.523112 -0.0222333 -0.32953 0.522493 -0.0207657 -0.322123 0.521881 -0.0192593 -0.315604 0.52124 -0.0176203 -0.309856 0.520507 -0.0156869 -0.304853 0.519637 -0.0133549 -0.300618 0.518637 -0.0106154 -0.297179 0.517546 -0.0074782 -0.294665 0.51647 -0.00391405 -0.293568 0.515844 4.4e-08 -0.294665 0.51647 0.00391416 -0.297179 0.517546 0.00747835 -0.300618 0.518636 0.0106156 -0.304853 0.519637 0.0133551 -0.309857 0.520506 0.015687 -0.315605 0.52124 0.0176204 -0.322123 0.52188 0.0192594 -0.32953 0.522492 0.0207658 -0.337951 0.523111 0.0222335 -0.347424 0.523735 0.0236674 -0.357944 0.524353 0.0250503 -0.369489 0.524953 0.0263634 -0.382019 0.525526 0.0275911 -0.395486 0.526062 0.028722 -0.409831 0.526557 0.0297473 -0.424983 0.527002 0.0306587 -0.440866 0.52739 0.0314453 -0.45739 0.527711 0.0320927 -0.474459 0.527952 0.0325821 -0.49197 0.5281 0.0328927 -0.509813 0.528141 0.0330042 -0.527877 0.528065 0.0329013 -0.546047 0.527867 0.0325774 -0.564214 0.527548 0.0320371 -0.582269 0.527116 0.0312973 -0.600113 0.526586 0.0303848 -0.617651 0.525976 0.0293336 -0.634795 0.525306 0.0281798 -0.651464 0.524595 0.0269578 -0.667584 0.52386 0.0256963 -0.683088 0.523111 0.0244172 -0.697915 0.522358 0.0231354 -0.712016 0.521606 0.0218607 -0.72535 0.520859 0.0205999 -0.737891 0.52012 0.019359 -0.749626 0.519396 0.0181454 -0.760561 0.518691 0.0169675 -0.77072 0.518011 0.015835 -0.780147 0.517365 0.0147575 -0.788908 0.516756 0.0137435 -0.797088 0.516192 0.0128003 -0.804789 0.515678 0.0119369 -0.812107 0.515231 0.0111789 -0.819049 0.514899 0.0106008 -0.826303 0.514715 0.0102784 -0.835472 0.514595 0.0100646 -0.850191 0.514516 0.00989085 -0.877882 0.514514 0.00976877 -0.930647 0.514616 0.00975931 -1.02618 0.514763 0.0098023 -1.18934 0.514826 0.00973609 -1.45441 0.514781 0.00961931 -1.86767 0.514731 0.00961484 -2.49075 0.514755 0.00975711 -3.40495 0.514878 0.0100463 -4.7159 0.517103 0.00493905 -0.424624 0.526673 -0.0352178 -0.40944 0.526216 -0.0341448 -0.395065 0.525709 -0.0329463 -0.38157 0.52516 -0.0316315 -0.369014 0.524576 -0.03021 -0.357448 0.523968 -0.0286941 -0.346908 0.523345 -0.0270993 -0.33742 0.522721 -0.0254435 -0.328985 0.522106 -0.0237398 -0.321551 0.5215 -0.0219767 -0.314973 0.520876 -0.0200685 -0.309113 0.520183 -0.0178752 -0.303932 0.519378 -0.0152882 -0.299455 0.518458 -0.0122563 -0.295741 0.517451 -0.00872632 -0.292994 0.516468 -0.00461011 -0.291833 0.515933 9.3e-08 -0.292994 0.516468 0.00461034 -0.295741 0.51745 0.00872662 -0.299455 0.518457 0.0122566 -0.303932 0.519378 0.0152886 -0.309113 0.520182 0.0178755 -0.314973 0.520876 0.0200688 -0.321551 0.521499 0.021977 -0.328985 0.522104 0.0237402 -0.33742 0.52272 0.0254438 -0.346908 0.523344 0.0270997 -0.357448 0.523967 0.0286945 -0.369015 0.524575 0.0302105 -0.38157 0.525158 0.031632 -0.395065 0.525707 0.0329469 -0.40944 0.526214 0.0341454 -0.424624 0.526671 0.0352186 -0.440541 0.527069 0.0361555 -0.457103 0.527398 0.0369424 -0.474215 0.527644 0.037562 -0.491773 0.527794 0.0379952 -0.509668 0.527834 0.0382242 -0.527787 0.527756 0.0382356 -0.546014 0.527555 0.0380247 -0.564238 0.527232 0.0375972 -0.582349 0.526797 0.03697 -0.600245 0.526263 0.0361694 -0.617831 0.525649 0.0352283 -0.635018 0.524976 0.0341813 -0.651726 0.52426 0.0330615 -0.667881 0.523519 0.0318968 -0.683419 0.522763 0.0307086 -0.698281 0.522001 0.0295126 -0.712418 0.521239 0.0283196 -0.725791 0.520482 0.027138 -0.738374 0.519735 0.0259758 -0.750156 0.519003 0.0248414 -0.761142 0.518294 0.0237448 -0.771358 0.517616 0.0226963 -0.780846 0.516975 0.0217061 -0.789673 0.516379 0.0207835 -0.797922 0.515836 0.0199375 -0.805692 0.515352 0.0191793 -0.813072 0.514943 0.0185284 -0.820088 0.514634 0.0180169 -0.827443 0.51444 0.0176534 -0.836744 0.51429 0.0173433 -0.851531 0.514185 0.0170405 -0.879134 0.514188 0.0167721 -0.931765 0.514358 0.0166511 -1.02723 0.514602 0.0166488 -1.19042 0.514709 0.0165305 -1.45558 0.514634 0.0163401 -1.86897 0.51455 0.0163207 -2.49214 0.514593 0.0165292 -3.40622 0.514804 0.0169436 -4.7159 0.518496 0.00814127 -0.423874 0.526193 -0.0424873 -0.40863 0.525721 -0.0411402 -0.394198 0.525197 -0.0396506 -0.380648 0.524632 -0.0380284 -0.368038 0.524036 -0.0362847 -0.35642 0.523418 -0.0344329 -0.34583 0.522792 -0.0324891 -0.33629 0.522169 -0.0304701 -0.327794 0.521562 -0.028386 -0.320279 0.520972 -0.0262217 -0.313581 0.520376 -0.0238976 -0.307544 0.519733 -0.0212859 -0.302112 0.519006 -0.0182685 -0.297311 0.518179 -0.0147475 -0.293233 0.517272 -0.0105949 -0.290171 0.51639 -0.00564264 -0.288891 0.515915 1.97e-07 -0.290171 0.51639 0.00564309 -0.293233 0.517271 0.0105955 -0.297311 0.518178 0.0147481 -0.302112 0.519004 0.0182691 -0.307545 0.519732 0.0212866 -0.313581 0.520375 0.0238982 -0.320279 0.52097 0.0262223 -0.327794 0.52156 0.0283867 -0.33629 0.522167 0.0304708 -0.34583 0.52279 0.0324899 -0.35642 0.523416 0.0344337 -0.368038 0.524034 0.0362856 -0.380648 0.52463 0.0380294 -0.394198 0.525195 0.0396517 -0.40863 0.525718 0.0411415 -0.423874 0.526191 0.0424886 -0.439854 0.526602 0.0436822 -0.456484 0.526941 0.0447094 -0.473668 0.527193 0.0455548 -0.491305 0.527345 0.0462023 -0.509284 0.527385 0.0466373 -0.52749 0.527304 0.0468498 -0.545809 0.527097 0.0468373 -0.564124 0.526769 0.0466072 -0.582324 0.526327 0.0461768 -0.600305 0.525787 0.0455715 -0.617969 0.525167 0.0448225 -0.635229 0.524486 0.0439626 -0.652005 0.523762 0.0430226 -0.668226 0.52301 0.0420294 -0.683828 0.522241 0.0410044 -0.698755 0.521465 0.0399637 -0.712962 0.520687 0.03892 -0.726412 0.519915 0.0378836 -0.73908 0.519154 0.0368641 -0.750956 0.518412 0.0358716 -0.762049 0.517698 0.0349164 -0.772382 0.517019 0.0340086 -0.782001 0.516385 0.0331576 -0.790972 0.515804 0.0323715 -0.799379 0.515282 0.0316566 -0.807319 0.514825 0.0310183 -0.814889 0.51444 0.0304615 -0.822133 0.514146 0.0299942 -0.829748 0.513954 0.0296021 -0.839311 0.513799 0.0292046 -0.854252 0.51369 0.0287468 -0.881732 0.513719 0.0282525 -0.934056 0.513993 0.027901 -1.02929 0.514389 0.0277613 -1.1924 0.514567 0.0275435 -1.45761 0.514449 0.0272418 -1.87116 0.514316 0.0271933 -2.49444 0.51439 0.0274878 -3.40828 0.514746 0.0280558 -4.7159 0.520803 0.013392 -0.42227 0.52555 -0.0538663 -0.406911 0.525057 -0.0520692 -0.392366 0.524513 -0.0501049 -0.378703 0.523928 -0.0479848 -0.365979 0.523316 -0.0457217 -0.354244 0.522687 -0.0433309 -0.343533 0.522057 -0.0408296 -0.333861 0.521439 -0.0382345 -0.325214 0.520846 -0.0355548 -0.317518 0.520281 -0.032774 -0.310598 0.519728 -0.0298121 -0.304286 0.519147 -0.0265383 -0.298509 0.518504 -0.0228143 -0.293293 0.517778 -0.0184918 -0.288762 0.516976 -0.0133586 -0.285303 0.516182 -0.00715053 -0.283849 0.515728 4.18e-07 -0.285303 0.516182 0.00715145 -0.288762 0.516975 0.0133596 -0.293293 0.517776 0.018493 -0.298509 0.518502 0.0228155 -0.304286 0.519145 0.0265395 -0.310599 0.519725 0.0298133 -0.317518 0.520279 0.0327752 -0.325215 0.520843 0.0355561 -0.333861 0.521436 0.0382359 -0.343533 0.522054 0.0408311 -0.354244 0.522684 0.0433326 -0.365979 0.523312 0.0457235 -0.378703 0.523925 0.0479867 -0.392366 0.524509 0.050107 -0.406911 0.525053 0.0520714 -0.42227 0.525546 0.0538687 -0.438367 0.525975 0.0554878 -0.455118 0.526326 0.0569168 -0.472429 0.526587 0.0581432 -0.490198 0.526744 0.0591545 -0.508315 0.526784 0.0599404 -0.526665 0.526699 0.0604951 -0.545128 0.526487 0.0608197 -0.563588 0.526151 0.0609233 -0.581931 0.525701 0.0608237 -0.60005 0.525152 0.0605454 -0.617847 0.524522 0.0601174 -0.635235 0.523829 0.0595698 -0.652136 0.523091 0.0589316 -0.668481 0.522321 0.058228 -0.684211 0.521533 0.0574803 -0.699273 0.520735 0.0567054 -0.713626 0.519936 0.0559174 -0.727236 0.519142 0.055128 -0.740083 0.518362 0.0543477 -0.75216 0.517605 0.0535863 -0.763477 0.516881 0.0528526 -0.774062 0.516198 0.0521541 -0.783962 0.515567 0.0514963 -0.793242 0.514993 0.0508827 -0.801989 0.514483 0.0503138 -0.810302 0.51404 0.0497882 -0.81828 0.513671 0.0493034 -0.825974 0.513389 0.0488599 -0.834068 0.513215 0.0484372 -0.844111 0.513087 0.047957 -0.859407 0.51302 0.0473372 -0.886833 0.513126 0.0465571 -0.938636 0.513558 0.0458279 -1.03331 0.514174 0.0453908 -1.19608 0.514469 0.0449867 -1.46121 0.514297 0.0445227 -1.87487 0.514095 0.0444236 -2.49821 0.514222 0.0448227 -3.41158 0.514812 0.045558 -4.7159 0.52462 0.0219984 -0.41881 0.524823 -0.0713443 -0.403227 0.524303 -0.0688302 -0.388455 0.52373 -0.0661154 -0.37456 0.52312 -0.0632126 -0.361598 0.522486 -0.0601367 -0.349615 0.521843 -0.0569052 -0.33864 0.521207 -0.0535371 -0.328684 0.520594 -0.0500503 -0.319728 0.520019 -0.0464545 -0.31169 0.519487 -0.0427301 -0.304397 0.518985 -0.0387866 -0.297673 0.518475 -0.0344731 -0.291437 0.517919 -0.0296178 -0.285716 0.517287 -0.0240157 -0.280663 0.516571 -0.0173654 -0.276754 0.515823 -0.00930306 -0.275089 0.515339 8.78e-07 -0.276754 0.515822 0.00930493 -0.280663 0.51657 0.0173675 -0.285716 0.517285 0.0240179 -0.291437 0.517916 0.0296201 -0.297673 0.518472 0.0344755 -0.304397 0.518981 0.0387891 -0.31169 0.519483 0.0427326 -0.319728 0.520014 0.0464571 -0.328684 0.520589 0.050053 -0.33864 0.521202 0.05354 -0.349614 0.521837 0.0569083 -0.361598 0.52248 0.06014 -0.37456 0.523113 0.0632161 -0.388455 0.523724 0.0661193 -0.403226 0.524295 0.0688343 -0.41881 0.524815 0.0713487 -0.43513 0.525269 0.0736513 -0.452107 0.525642 0.0757316 -0.469645 0.525918 0.0775802 -0.487646 0.526085 0.0791888 -0.505997 0.52613 0.0805519 -0.524585 0.526046 0.0816686 -0.543287 0.525832 0.0825435 -0.561987 0.525492 0.0831882 -0.580568 0.525035 0.083621 -0.598924 0.524477 0.0838651 -0.616957 0.523836 0.0839474 -0.634582 0.523129 0.0838954 -0.651724 0.522374 0.0837357 -0.66832 0.521584 0.0834922 -0.684314 0.520773 0.0831854 -0.699661 0.51995 0.082832 -0.714324 0.519125 0.0824462 -0.728277 0.518306 0.0820389 -0.741504 0.517504 0.0816191 -0.754003 0.516727 0.0811934 -0.765786 0.515987 0.0807664 -0.776883 0.515293 0.0803409 -0.787341 0.514655 0.0799173 -0.797224 0.514078 0.0794944 -0.806613 0.513569 0.0790697 -0.815607 0.513133 0.0786403 -0.824302 0.512775 0.078203 -0.832743 0.512515 0.0777594 -0.841614 0.51238 0.077288 -0.852449 0.512313 0.07671 -0.868448 0.512344 0.0759177 -0.896116 0.512601 0.074829 -0.947328 0.513257 0.0736122 -1.04095 0.514166 0.0726784 -1.20286 0.514639 0.0719532 -1.46755 0.514414 0.0712638 -1.88112 0.514126 0.0710863 -2.50434 0.514341 0.071602 -3.41677 0.515302 0.0724819 -4.7159 0.530926 0.0361014 -0.411414 0.524377 -0.0976696 -0.39539 0.523811 -0.0940459 -0.380168 0.523194 -0.0901759 -0.36581 0.522542 -0.086073 -0.352371 0.521871 -0.0817537 -0.339893 0.5212 -0.0772374 -0.328405 0.520547 -0.072545 -0.317915 0.51993 -0.0676955 -0.308405 0.519366 -0.0626978 -0.2998 0.518864 -0.0575256 -0.291934 0.518412 -0.0520668 -0.284632 0.517969 -0.046135 -0.277814 0.517485 -0.039513 -0.271515 0.516917 -0.031934 -0.265915 0.516231 -0.0230091 -0.261556 0.515447 -0.0122855 -0.259669 0.514863 1.812e-06 -0.261556 0.515445 0.0122893 -0.265915 0.516229 0.0230131 -0.271515 0.516913 0.0319382 -0.277814 0.51748 0.0395175 -0.284631 0.517963 0.0461395 -0.291933 0.518406 0.0520715 -0.2998 0.518857 0.0575304 -0.308405 0.519358 0.0627028 -0.317914 0.519921 0.0677007 -0.328404 0.520538 0.0725504 -0.339892 0.521191 0.0772432 -0.35237 0.521861 0.0817599 -0.365809 0.522531 0.0860796 -0.380166 0.523183 0.090183 -0.395388 0.523799 0.0940534 -0.411413 0.524364 0.0976776 -0.428167 0.524861 0.101044 -0.445571 0.525272 0.104146 -0.463534 0.525583 0.106974 -0.481955 0.525779 0.109526 -0.500728 0.525849 0.1118 -0.519735 0.525785 0.113801 -0.538859 0.525586 0.115535 -0.557982 0.525258 0.117017 -0.57699 0.52481 0.118265 -0.595781 0.524258 0.119301 -0.614259 0.523619 0.12015 -0.632345 0.52291 0.120838 -0.649969 0.522149 0.121387 -0.667074 0.52135 0.121821 -0.683614 0.520527 0.122157 -0.69955 0.51969 0.122411 -0.714852 0.518849 0.122593 -0.729499 0.518014 0.122712 -0.743481 0.517196 0.122773 -0.756795 0.516405 0.122777 -0.769455 0.515651 0.122725 -0.781486 0.514945 0.122616 -0.79293 0.514296 0.122449 -0.803844 0.513714 0.12222 -0.814303 0.513205 0.12193 -0.824397 0.512775 0.121577 -0.834218 0.512436 0.121162 -0.843807 0.512209 0.120692 -0.853859 0.512134 0.120146 -0.865926 0.512158 0.119447 -0.883143 0.512329 0.118471 -0.911649 0.512795 0.117089 -0.962629 0.513731 0.115387 -1.05485 0.514976 0.113829 -1.21513 0.515687 0.112635 -1.47866 0.515432 0.11166 -1.89161 0.515056 0.111377 -2.5142 0.51541 0.112009 -3.4248 0.516952 0.11294 -4.7159 0.541344 0.0592078 -0.396036 0.525289 -0.136482 -0.379167 0.524634 -0.13118 -0.363085 0.523928 -0.125566 -0.347853 0.523192 -0.119652 -0.333526 0.522443 -0.113455 -0.32015 0.521704 -0.106996 -0.307758 0.520994 -0.100296 -0.296368 0.520337 -0.0933762 -0.285973 0.519751 -0.0862425 -0.276512 0.519251 -0.0788595 -0.267834 0.51882 -0.0710856 -0.259774 0.518406 -0.0626884 -0.252259 0.517942 -0.0533987 -0.245333 0.517361 -0.0428885 -0.239197 0.516599 -0.0306909 -0.234428 0.515648 -0.0162852 -0.232328 0.514872 3.636e-06 -0.234428 0.515646 0.0162926 -0.239196 0.516595 0.0306987 -0.245332 0.517355 0.0428967 -0.252258 0.517935 0.0534071 -0.259773 0.518398 0.0626971 -0.267833 0.51881 0.0710944 -0.276511 0.51924 0.0788686 -0.285971 0.51974 0.0862519 -0.296366 0.520324 0.0933859 -0.307755 0.52098 0.100307 -0.320147 0.521688 0.107007 -0.333523 0.522427 0.113467 -0.34785 0.523174 0.119664 -0.363082 0.52391 0.125579 -0.379164 0.524614 0.131194 -0.396033 0.525268 0.136496 -0.413618 0.525853 0.141475 -0.431838 0.526352 0.146125 -0.450606 0.526746 0.150441 -0.469823 0.527021 0.154423 -0.489385 0.527165 0.158075 -0.509179 0.527172 0.161401 -0.529093 0.52704 0.164413 -0.549013 0.526775 0.167125 -0.568834 0.526386 0.169555 -0.588457 0.525888 0.171725 -0.607797 0.525299 0.173657 -0.626782 0.524636 0.175374 -0.64535 0.523916 0.176896 -0.663452 0.523154 0.178243 -0.681049 0.522362 0.179431 -0.698109 0.521553 0.18047 -0.714606 0.520735 0.18137 -0.73052 0.519919 0.182136 -0.745841 0.519116 0.182769 -0.760564 0.518334 0.18327 -0.774696 0.517587 0.183639 -0.788254 0.516884 0.183875 -0.801271 0.516236 0.183979 -0.813795 0.515655 0.183951 -0.825895 0.515149 0.183795 -0.837656 0.51473 0.183516 -0.849166 0.51441 0.183122 -0.860463 0.514219 0.182622 -0.872276 0.514214 0.182006 -0.886209 0.514339 0.181197 -0.905395 0.514661 0.18007 -0.935673 0.515344 0.178481 -0.987403 0.516554 0.176443 -1.07854 0.518105 0.174349 -1.23649 0.51907 0.172644 -1.49777 0.518834 0.171367 -1.90904 0.518396 0.170975 -2.52994 0.518972 0.171709 -3.43707 0.521413 0.172474 -4.7159 0.558543 0.0970615 -0.365519 0.53014 -0.192322 -0.347115 0.529292 -0.184528 -0.329494 0.528397 -0.176317 -0.312726 0.527477 -0.167702 -0.296876 0.526554 -0.1587 -0.282 0.525651 -0.149334 -0.268149 0.524793 -0.139628 -0.255359 0.524006 -0.129605 -0.243642 0.523314 -0.119273 -0.232959 0.522733 -0.108588 -0.223176 0.522241 -0.0973762 -0.21414 0.521767 -0.0853544 -0.205781 0.521211 -0.0722014 -0.198154 0.520475 -0.0575343 -0.191468 0.519465 -0.040822 -0.186302 0.518167 -0.0214981 -0.183982 0.517084 7.035e-06 -0.186301 0.518165 0.0215124 -0.191467 0.51946 0.0408368 -0.198152 0.520467 0.0575495 -0.205779 0.521201 0.0722171 -0.214137 0.521755 0.0853706 -0.223173 0.522228 0.0973927 -0.232955 0.522717 0.108605 -0.243637 0.523297 0.11929 -0.255354 0.523987 0.129623 -0.268144 0.524772 0.139647 -0.281994 0.525627 0.149354 -0.29687 0.526528 0.158721 -0.31272 0.527449 0.167724 -0.329488 0.528367 0.176341 -0.347109 0.52926 0.184553 -0.365513 0.530105 0.192348 -0.384624 0.530884 0.199718 -0.40436 0.531575 0.206658 -0.424633 0.53216 0.213166 -0.445345 0.532623 0.219244 -0.466396 0.532951 0.224897 -0.487681 0.533138 0.230133 -0.509092 0.533182 0.234964 -0.530525 0.533088 0.239405 -0.551884 0.532864 0.243474 -0.573081 0.532526 0.24719 -0.59404 0.532089 0.250576 -0.614696 0.531571 0.25365 -0.634997 0.530987 0.256435 -0.6549 0.530351 0.258947 -0.67437 0.529677 0.261202 -0.693378 0.528973 0.263211 -0.7119 0.52825 0.264983 -0.729913 0.527515 0.266524 -0.747404 0.526779 0.26784 -0.764361 0.526052 0.268932 -0.780784 0.525345 0.269805 -0.796683 0.52467 0.270462 -0.812082 0.524039 0.270908 -0.827024 0.523467 0.271151 -0.841572 0.522965 0.2712 -0.855811 0.522549 0.271066 -0.86983 0.522239 0.270762 -0.883669 0.522073 0.270304 -0.898112 0.522131 0.26969 -0.914861 0.522347 0.268861 -0.937118 0.522798 0.267707 -0.970535 0.523654 0.266097 -1.02469 0.525059 0.264014 -1.1162 0.526799 0.261729 -1.272 0.527954 0.259721 -1.52991 0.527803 0.258262 -1.93784 0.527386 0.257822 -2.55507 0.528316 0.258629 -3.4558 0.532165 0.258802 -4.7159 0.586933 0.159071 -0.308379 0.544181 -0.270975 -0.287342 0.542944 -0.259535 -0.267125 0.541668 -0.247518 -0.247812 0.540376 -0.234939 -0.229486 0.539093 -0.221819 -0.212227 0.537848 -0.208187 -0.196106 0.53667 -0.194074 -0.181184 0.53559 -0.179512 -0.167499 0.534636 -0.164516 -0.155039 0.533827 -0.149039 -0.143685 0.533132 -0.132875 -0.133287 0.532445 -0.115694 -0.123779 0.531623 -0.0971255 -0.115214 0.530531 -0.0767434 -0.107802 0.529051 -0.0539664 -0.102117 0.527192 -0.028201 -0.0995104 0.525676 1.3027e-05 -0.102115 0.527189 0.0282275 -0.1078 0.529044 0.0539936 -0.11521 0.530521 0.0767713 -0.123775 0.53161 0.0971542 -0.133282 0.532429 0.115723 -0.143679 0.533113 0.132906 -0.155032 0.533805 0.14907 -0.167492 0.534611 0.164548 -0.181175 0.535561 0.179545 -0.196096 0.536639 0.194109 -0.212217 0.537814 0.208223 -0.229475 0.539055 0.221858 -0.247801 0.540333 0.23498 -0.267113 0.541621 0.247561 -0.287331 0.542894 0.25958 -0.308367 0.544126 0.271022 -0.330135 0.545294 0.281879 -0.352542 0.546375 0.292145 -0.375493 0.547348 0.301822 -0.398891 0.548196 0.310912 -0.422633 0.548903 0.319422 -0.446617 0.549461 0.327364 -0.470741 0.549868 0.334748 -0.49491 0.550125 0.341593 -0.519033 0.550242 0.347917 -0.543032 0.550231 0.353741 -0.566837 0.550107 0.35909 -0.590393 0.549886 0.363987 -0.613652 0.549582 0.368454 -0.636578 0.549208 0.372514 -0.659138 0.548775 0.376185 -0.681305 0.548291 0.379485 -0.703055 0.547765 0.382427 -0.724365 0.547203 0.385024 -0.745217 0.546613 0.387286 -0.765596 0.546006 0.389221 -0.785498 0.545393 0.390841 -0.804928 0.544787 0.392154 -0.823905 0.544202 0.393172 -0.842472 0.543655 0.393907 -0.860692 0.543165 0.394376 -0.878653 0.54275 0.394594 -0.896453 0.54244 0.39458 -0.914139 0.542287 0.394353 -0.932578 0.542404 0.393928 -0.953621 0.542698 0.393275 -0.980631 0.543253 0.392323 -1.0192 0.544232 0.390986 -1.07825 0.545739 0.389252 -1.17295 0.547533 0.387298 -1.32855 0.548779 0.385498 -1.58293 0.548801 0.384218 -1.98549 0.548587 0.383929 -2.5957 0.550112 0.384777 -3.4848 0.556265 0.383543 -4.7159 0.633788 0.260648 -0.206669 0.577186 -0.381919 -0.181256 0.575249 -0.365201 -0.15676 0.573284 -0.347668 -0.133292 0.57132 -0.329339 -0.110962 0.569389 -0.310243 -0.0898792 0.567525 -0.29042 -0.0701461 0.565762 -0.269916 -0.051856 0.564138 -0.248776 -0.035079 0.562692 -0.227032 -0.019829 0.561444 -0.204638 -0.00600455 0.560347 -0.181368 --0.00654657 0.559246 -0.156848 --0.0178995 0.557941 -0.130675 --0.0280016 0.556256 -0.102388 --0.0366335 0.554062 -0.071372 --0.0432048 0.551431 -0.03702 --0.0462648 0.549365 2.3079e-05 --0.0432068 0.551427 0.0370667 --0.0366374 0.554054 0.07142 --0.0280072 0.556243 0.102438 --0.0179068 0.557925 0.130726 --0.00655544 0.559226 0.156901 -0.00599412 0.560323 0.181422 -0.0198171 0.561415 0.204695 -0.0350657 0.562658 0.227091 -0.0518415 0.5641 0.248838 -0.0701306 0.565718 0.269981 -0.0898628 0.567475 0.290489 -0.110946 0.569334 0.310316 -0.133275 0.571258 0.329415 -0.156743 0.573216 0.347749 -0.181239 0.575174 0.365287 -0.206653 0.577103 0.38201 -0.232873 0.578975 0.397906 -0.259791 0.580761 0.412971 -0.287296 0.582436 0.427207 -0.315278 0.583976 0.44062 -0.343628 0.585365 0.453219 -0.372239 0.586591 0.46502 -0.401008 0.587646 0.47604 -0.42984 0.588531 0.4863 -0.458648 0.589254 0.495826 -0.487357 0.589825 0.504646 -0.515904 0.590257 0.51279 -0.544239 0.590565 0.520289 -0.57232 0.590761 0.527175 -0.600116 0.590858 0.533478 -0.6276 0.590863 0.539227 -0.65475 0.590784 0.544447 -0.681546 0.590627 0.549162 -0.707968 0.590397 0.553391 -0.734 0.590101 0.557155 -0.75963 0.589747 0.560469 -0.784854 0.589346 0.56335 -0.80968 0.588913 0.565815 -0.83413 0.588464 0.567882 -0.858251 0.58802 0.569569 -0.882113 0.587602 0.570897 -0.90582 0.587239 0.571887 -0.929485 0.586969 0.572561 -0.953171 0.586864 0.57294 -0.97787 0.587079 0.573059 -1.00564 0.587488 0.572937 -1.04011 0.588175 0.572569 -1.08696 0.589291 0.571933 -1.15465 0.590889 0.571058 -1.25696 0.592707 0.570078 -1.41674 0.594055 0.569243 -1.66979 0.594452 0.56882 -2.06539 0.594824 0.56911 -2.6633 0.597478 0.569941 -3.53132 0.607731 0.565706 -4.7159 0.711109 0.427036 -0.0309987 0.647157 -0.544751 --0.00170002 0.64402 -0.520344 --0.0333092 0.640869 -0.494751 --0.0636787 0.637743 -0.467996 --0.0926558 0.634683 -0.440114 --0.120087 0.631731 -0.411158 --0.145822 0.628934 -0.38119 --0.169719 0.626342 -0.350278 --0.191663 0.624003 -0.318474 --0.211597 0.621947 -0.285746 --0.229601 0.620106 -0.251859 --0.245831 0.618263 -0.216422 --0.26037 0.616148 -0.179014 --0.273157 0.613548 -0.139157 --0.283941 0.610349 -0.0962106 --0.292058 0.606719 -0.0495637 --0.295852 0.603999 3.9427e-05 --0.292061 0.606714 0.0496436 --0.283948 0.610339 0.0962928 --0.273167 0.613534 0.139242 --0.260382 0.616128 0.179102 --0.245846 0.618238 0.216515 --0.229618 0.620075 0.251956 --0.211617 0.62191 0.285848 --0.191684 0.623959 0.318582 --0.169742 0.62629 0.350393 --0.145845 0.628875 0.381313 --0.12011 0.631663 0.411289 --0.092679 0.634605 0.440254 --0.063701 0.637655 0.468145 --0.03333 0.64077 0.494911 --0.00171873 0.643909 0.520515 -0.0309829 0.647034 0.544934 -0.0646288 0.650106 0.568156 -0.099077 0.653091 0.590181 -0.13419 0.655955 0.611017 -0.169835 0.658668 0.630677 -0.205884 0.661206 0.649182 -0.242215 0.663552 0.666555 -0.278717 0.665697 0.682827 -0.315286 0.667638 0.698031 -0.351834 0.66938 0.712203 -0.388286 0.670931 0.725386 -0.424581 0.672304 0.737623 -0.460674 0.673513 0.74896 -0.496531 0.674569 0.759441 -0.532131 0.675483 0.769113 -0.567459 0.676262 0.778016 -0.602502 0.676912 0.786191 -0.637255 0.677436 0.793673 -0.67171 0.677838 0.800495 -0.705865 0.678122 0.806686 -0.739722 0.678295 0.812273 -0.773289 0.678367 0.817282 -0.806587 0.678352 0.821735 -0.839657 0.67827 0.825659 -0.872562 0.678142 0.829076 -0.905397 0.677997 0.832014 -0.938292 0.67787 0.834498 -0.971399 0.677809 0.836553 -1.00482 0.677913 0.838196 -1.0397 0.678395 0.83948 -1.07842 0.679084 0.840508 -1.12497 0.680069 0.841356 -1.18525 0.681491 0.842089 -1.26743 0.683361 0.84279 -1.38405 0.68542 0.843597 -1.5552 0.687178 0.844655 -1.81248 0.688451 0.846009 -2.20127 0.690232 0.847505 -2.77903 0.695372 0.84802 -3.60869 0.713443 0.837901 -4.7159 0.838696 0.699588 --0.26785 0.786031 -0.798849 --0.312745 0.780666 -0.762843 --0.35627 0.775278 -0.725024 --0.398209 0.769921 -0.68541 --0.438342 0.764652 -0.644038 --0.47644 0.759535 -0.600968 --0.512276 0.754638 -0.556277 --0.545632 0.750036 -0.510057 --0.576311 0.745806 -0.462387 --0.604182 0.741999 -0.41327 --0.629274 0.738537 -0.362493 --0.651721 0.735139 -0.309692 --0.671593 0.731476 -0.254471 --0.688789 0.72732 -0.196365 --0.70299 0.722605 -0.134732 --0.713414 0.717654 -0.0689721 --0.71818 0.714177 6.4045e-05 --0.713419 0.717648 0.0691019 --0.703 0.722594 0.134866 --0.688803 0.727303 0.196505 --0.67161 0.731453 0.254619 --0.651742 0.735109 0.309849 --0.629298 0.738499 0.362661 --0.604208 0.741953 0.41345 --0.576337 0.74575 0.462582 --0.545659 0.74997 0.510267 --0.512302 0.75456 0.556506 --0.476463 0.759444 0.601217 --0.438362 0.764547 0.644309 --0.398224 0.7698 0.685704 --0.356278 0.77514 0.725343 --0.312745 0.780509 0.763189 --0.267839 0.785853 0.799224 --0.221766 0.791121 0.833449 --0.174721 0.796266 0.865881 --0.126887 0.801243 0.896544 --0.0784382 0.806016 0.925476 --0.0295358 0.810553 0.95272 -0.019671 0.814833 0.978323 -0.0690475 0.818843 1.00234 -0.118475 0.822579 1.02483 -0.167855 0.826045 1.04585 -0.217106 0.829252 1.06547 -0.266168 0.832212 1.08376 -0.315002 0.83494 1.10078 -0.363584 0.83745 1.11661 -0.411907 0.839753 1.13131 -0.459975 0.841858 1.14496 -0.507801 0.84377 1.1576 -0.555404 0.845493 1.1693 -0.602807 0.847029 1.18012 -0.65004 0.848384 1.19008 -0.697139 0.849562 1.19924 -0.744151 0.850575 1.20764 -0.791136 0.851436 1.21531 -0.838177 0.852165 1.22229 -0.885384 0.852788 1.2286 -0.932907 0.853338 1.23428 -0.98094 0.853856 1.23937 -1.02971 0.854406 1.24388 -1.07939 0.855108 1.24784 -1.13136 0.856245 1.25129 -1.18834 0.857604 1.25446 -1.2548 0.859291 1.25751 -1.33686 0.861445 1.26059 -1.4424 0.864062 1.26384 -1.58258 0.866951 1.26736 -1.77434 0.869898 1.27119 -2.04329 0.873141 1.27502 -2.42647 0.878104 1.27794 -2.97285 0.888951 1.27698 -3.73513 0.920411 1.25838 -4.7159 1.04922 1.14604 --0.770982 1.04772 -1.21596 --0.836571 1.03782 -1.16142 --0.900348 1.02782 -1.10395 --0.961985 1.01779 -1.04354 --1.02114 1.00783 -0.980235 --1.07745 0.998056 -0.914084 --1.13056 0.988579 -0.845187 --1.18011 0.979538 -0.773664 --1.22576 0.971072 -0.699644 --1.26724 0.963295 -0.623194 --1.30445 0.956163 -0.544195 --1.33742 0.949389 -0.462398 --1.36611 0.942643 -0.377528 --1.39033 0.935748 -0.289222 --1.40965 0.928752 -0.196931 --1.42318 0.922167 -0.100169 --1.429 0.917976 9.0684e-05 --1.42319 0.922161 0.100353 --1.40966 0.928741 0.197123 --1.39035 0.935731 0.289424 --1.36613 0.94262 0.377746 --1.33744 0.949357 0.462634 --1.30448 0.956122 0.544451 --1.26727 0.963244 0.623476 --1.22578 0.971009 0.699955 --1.18013 0.979462 0.774007 --1.13057 0.988488 0.845568 --1.07745 0.997947 0.914507 --1.02112 1.00771 0.980702 --0.961951 1.01764 1.04406 --0.900293 1.02764 1.10452 --0.836491 1.03762 1.16205 --0.770872 1.04748 1.21666 --0.703746 1.05715 1.26837 --0.635398 1.06655 1.31724 --0.566096 1.07564 1.36333 --0.496083 1.08436 1.40673 --0.42558 1.09267 1.44754 --0.354786 1.10055 1.48583 --0.283873 1.108 1.52174 --0.212989 1.115 1.55535 --0.142253 1.12156 1.58678 --0.0717559 1.12771 1.61615 --0.00155872 1.13346 1.64356 -0.0683044 1.13884 1.66915 -0.137825 1.14386 1.69301 -0.207019 1.14854 1.71526 -0.275921 1.15291 1.73601 -0.344581 1.15697 1.75535 -0.413065 1.16074 1.77339 -0.481449 1.16423 1.79019 -0.549824 1.16744 1.80585 -0.61829 1.17039 1.82043 -0.68697 1.17309 1.83399 -0.756003 1.17557 1.84659 -0.825559 1.17784 1.85828 -0.895844 1.17995 1.86912 -0.967114 1.18192 1.87915 -1.03968 1.18381 1.8884 -1.1139 1.1857 1.89691 -1.19009 1.18771 1.90469 -1.26984 1.19019 1.91179 -1.35612 1.1929 1.91853 -1.45354 1.19599 1.92512 -1.56802 1.19962 1.93176 -1.7065 1.20382 1.93854 -1.8781 1.2086 1.94548 -2.0957 1.21413 1.95236 -2.37787 1.22125 1.95851 -2.75102 1.23213 1.96227 -3.25018 1.25212 1.95957 -3.91008 1.29516 1.93946 -4.7159 1.39658 1.87737 --1.60373 1.53712 -1.94633 --1.70793 1.51802 -1.86083 --1.80971 1.49852 -1.7701 --1.90847 1.47878 -1.67412 --2.0036 1.45898 -1.57289 --2.09444 1.43935 -1.46649 --2.18034 1.42011 -1.35505 --2.26064 1.40153 -1.23879 --2.33471 1.3839 -1.11793 --2.402 1.36749 -0.992699 --2.46209 1.3524 -0.863235 --2.51469 1.33854 -0.729606 --2.55951 1.32578 -0.591874 --2.59613 1.31412 -0.450033 --2.62399 1.30384 -0.303938 --2.64222 1.29556 -0.153523 --2.64926 1.29111 8.9229e-05 --2.64222 1.29555 0.153704 --2.624 1.30383 0.304128 --2.59614 1.31411 0.450236 --2.55952 1.32576 0.592096 --2.5147 1.33852 0.729851 --2.46209 1.35237 0.86351 --2.402 1.36745 0.993008 --2.3347 1.38385 1.11827 --2.26062 1.40147 1.23918 --2.1803 1.42003 1.3555 --2.09438 1.43925 1.46699 --2.00351 1.45887 1.57346 --1.90834 1.47864 1.67477 --1.80954 1.49836 1.77083 --1.70771 1.51783 1.86164 --1.60345 1.53689 1.94724 --1.49733 1.55541 2.02772 --1.38985 1.57329 2.1032 --1.28148 1.59042 2.17386 --1.17265 1.60675 2.23988 --1.06372 1.62222 2.30148 --0.955011 1.63682 2.35889 --0.846799 1.65054 2.41233 --0.739302 1.66339 2.46205 --0.632688 1.6754 2.50829 --0.52708 1.68659 2.55127 --0.422555 1.69701 2.59124 --0.319145 1.7067 2.62842 --0.216845 1.7157 2.66304 --0.115614 1.72406 2.69529 --0.0153817 1.73181 2.72539 -0.0839524 1.73901 2.7535 -0.182512 1.74568 2.77981 -0.280447 1.75186 2.80446 -0.377931 1.75759 2.8276 -0.475164 1.76291 2.84935 -0.572381 1.76784 2.86983 -0.669848 1.77244 2.88914 -0.767879 1.77674 2.90737 -0.866838 1.78079 2.9246 -0.967155 1.78464 2.9409 -1.06933 1.78834 2.95632 -1.17396 1.79196 2.97091 -1.28162 1.79564 2.98468 -1.39387 1.7996 2.99769 -1.51332 1.80376 3.01022 -1.64379 1.80824 3.02248 -1.78993 1.81319 3.03459 -1.95717 1.81876 3.04661 -2.15248 1.82511 3.05848 -2.38557 1.83268 3.06994 -2.67026 1.84235 3.0804 -3.02591 1.85596 3.08873 -3.47745 1.877 3.09276 -4.04657 1.91198 3.08903 -4.7159 1.9697 3.07536 --2.89563 2.56114 -3.50042 --3.10964 2.52364 -3.36586 --3.31928 2.48612 -3.21878 --3.52306 2.44903 -3.05893 --3.71947 2.41281 -2.8862 --3.90704 2.37783 -2.70066 --4.08437 2.34446 -2.50253 --4.25007 2.31297 -2.29221 --4.40287 2.28358 -2.0703 --4.54159 2.25644 -1.83752 --4.66517 2.23159 -1.59483 --4.77271 2.209 -1.34328 --4.86346 2.18855 -1.08413 --4.93689 2.17 -0.818716 --4.99266 2.153 -0.548516 --5.03069 2.13713 -0.275075 --5.05113 2.12182 0 --5.03069 2.13713 0.275075 --4.99266 2.153 0.548516 --4.93689 2.17 0.818716 --4.86346 2.18855 1.08413 --4.77271 2.209 1.34328 --4.66517 2.23159 1.59483 --4.54159 2.25644 1.83752 --4.40287 2.28358 2.0703 --4.25007 2.31297 2.29221 --4.08437 2.34446 2.50253 --3.90704 2.37783 2.70066 --3.71947 2.41281 2.8862 --3.52306 2.44903 3.05893 --3.31928 2.48612 3.21878 --3.10964 2.52364 3.36586 --2.89563 2.56114 3.50042 --2.67875 2.59816 3.62283 --2.46047 2.63426 3.73359 --2.24225 2.669 3.83329 --2.02549 2.70198 3.92261 --1.81154 2.73286 4.00229 --1.6017 2.76135 4.0731 --1.39717 2.78723 4.13586 --1.19908 2.81035 4.19139 --1.00847 2.83064 4.2405 --0.826262 2.84809 4.28398 --0.653259 2.8628 4.32262 --0.490154 2.87488 4.35713 --0.337509 2.88455 4.3882 --0.195754 2.89203 4.41645 --0.0651816 2.89761 4.44246 -0.0540521 2.90157 4.46674 -0.161937 2.9042 4.49054 -0.25861 2.9058 4.51433 -0.344342 2.90662 4.53813 -0.419536 2.90705 4.56192 -0.48474 2.90746 4.58571 -0.540644 2.90787 4.60951 -0.58808 2.90829 4.6333 -0.628037 2.9087 4.65709 -0.661663 2.90911 4.68089 -0.690273 2.90953 4.70468 -0.715361 2.90994 4.72848 -0.7386 2.91036 4.75227 -0.762408 2.91077 4.77606 -0.792021 2.91118 4.79985 -0.834763 2.9116 4.82365 -0.900035 2.91201 4.84744 -0.999909 2.91242 4.87124 -1.14988 2.91284 4.89503 -1.36986 2.91325 4.91882 -1.68541 2.91366 4.94262 -2.12932 2.91408 4.96641 -2.74375 2.91449 4.9902 -3.58278 2.91491 5.014 -4.7159 2.91532 5.03779 -0.4691 0.614093 -0.0225743 -0.454686 0.613605 -0.0219002 -0.441029 0.613063 -0.021134 -0.428196 0.612472 -0.0202829 -0.416243 0.611838 -0.0193542 -0.405214 0.611167 -0.0183577 -0.395141 0.610469 -0.0173081 -0.386045 0.609756 -0.0162259 -0.37793 0.609044 -0.0151353 -0.37078 0.608348 -0.0140606 -0.364542 0.607597 -0.0128928 -0.359151 0.606645 -0.0113978 -0.354607 0.605439 -0.00948825 -0.350927 0.604046 -0.00727407 -0.348076 0.602565 -0.00490965 -0.346006 0.601044 -0.00247524 -0.344714 0.599502 0 -0.346006 0.601044 0.00247524 -0.348076 0.602565 0.00490965 -0.350927 0.604046 0.00727407 -0.354607 0.605439 0.00948825 -0.359151 0.606645 0.0113978 -0.364542 0.607597 0.0128928 -0.37078 0.608348 0.0140606 -0.37793 0.609044 0.0151353 -0.386045 0.609756 0.0162259 -0.395141 0.610469 0.0173081 -0.405214 0.611167 0.0183577 -0.416243 0.611838 0.0193542 -0.428196 0.612472 0.0202829 -0.441029 0.613063 0.021134 -0.454686 0.613605 0.0219002 -0.4691 0.614093 0.0225743 -0.484196 0.61452 0.0231458 -0.499888 0.614874 0.0235998 -0.516081 0.615142 0.0239168 -0.532678 0.615307 0.024074 -0.549571 0.615352 0.0240496 -0.566658 0.615265 0.0238262 -0.583831 0.615038 0.0233953 -0.600991 0.61467 0.02276 -0.618039 0.614171 0.0219359 -0.634885 0.613557 0.0209492 -0.651444 0.612849 0.0198334 -0.667634 0.612073 0.0186249 -0.68338 0.61125 0.0173578 -0.698611 0.6104 0.0160609 -0.71326 0.609538 0.0147553 -0.727269 0.608674 0.0134546 -0.740588 0.607813 0.0121666 -0.753177 0.606959 0.0108955 -0.765009 0.606114 0.00964434 -0.776075 0.605282 0.00841735 -0.786379 0.604467 0.0072202 -0.795945 0.603675 0.0060598 -0.804816 0.602911 0.00494322 -0.813055 0.602178 0.00387588 -0.820745 0.60148 0.00286027 -0.827989 0.600811 0.00188893 -0.834912 0.600159 0.000943543 -0.841662 0.599507 0 -0.848742 0.599507 0 -0.857359 0.599506 0 -0.871549 0.599506 0 -0.898779 0.599505 0 -0.950919 0.599505 0 -1.0455 0.599504 0 -1.20729 0.599504 0 -1.47042 0.599504 0 -1.88096 0.599503 0 -2.50037 0.599503 0 -3.40984 0.599502 0 -4.7159 0.599502 0 -0.469099 0.614091 -0.0225948 -0.454685 0.613603 -0.0219207 -0.441028 0.61306 -0.0211543 -0.428195 0.612469 -0.0203032 -0.416241 0.611835 -0.0193743 -0.405212 0.611164 -0.0183776 -0.39514 0.610465 -0.0173279 -0.386044 0.609752 -0.0162455 -0.377929 0.60904 -0.0151547 -0.37078 0.608343 -0.0140797 -0.364542 0.607592 -0.0129115 -0.35915 0.606641 -0.0114164 -0.354604 0.605435 -0.0095067 -0.35092 0.604044 -0.0072916 -0.348065 0.602564 -0.00492429 -0.34599 0.601045 -0.00248385 -0.344703 0.599518 0 -0.34599 0.601045 0.00248385 -0.348065 0.602564 0.00492429 -0.35092 0.604044 0.0072916 -0.354604 0.605435 0.0095067 -0.35915 0.606641 0.0114164 -0.364542 0.607592 0.0129115 -0.37078 0.608343 0.0140797 -0.377929 0.60904 0.0151547 -0.386044 0.609752 0.0162455 -0.39514 0.610465 0.0173279 -0.405212 0.611164 0.0183776 -0.416241 0.611835 0.0193743 -0.428195 0.612469 0.0203032 -0.441028 0.61306 0.0211543 -0.454685 0.613603 0.0219207 -0.469099 0.614091 0.0225948 -0.484195 0.614518 0.0231665 -0.499887 0.614873 0.0236206 -0.516081 0.61514 0.0239376 -0.532677 0.615305 0.0240948 -0.549571 0.615351 0.0240704 -0.566658 0.615263 0.0238471 -0.583832 0.615036 0.0234162 -0.600991 0.614668 0.0227809 -0.61804 0.614169 0.0219569 -0.634887 0.613555 0.0209701 -0.651445 0.612848 0.0198543 -0.667635 0.612071 0.0186458 -0.683381 0.611248 0.0173786 -0.698612 0.610398 0.0160816 -0.713261 0.609537 0.014776 -0.727271 0.608672 0.0134753 -0.74059 0.607811 0.0121872 -0.753178 0.606957 0.010916 -0.765011 0.606113 0.00966474 -0.776077 0.605281 0.00843766 -0.786381 0.604466 0.00724041 -0.795947 0.603674 0.00607992 -0.804819 0.602909 0.00496327 -0.813057 0.602177 0.00389588 -0.820747 0.601479 0.00288025 -0.827991 0.60081 0.00190891 -0.834914 0.600158 0.000963586 -0.841663 0.599508 2.0319e-05 -0.848742 0.599506 2.0338e-05 -0.85736 0.599505 2.0414e-05 -0.871551 0.599505 2.0636e-05 -0.898781 0.599504 2.1235e-05 -0.950921 0.599504 2.2209e-05 -1.0455 0.599504 2.2879e-05 -1.20729 0.599503 2.2831e-05 -1.47042 0.599503 2.2641e-05 -1.88097 0.599502 2.2834e-05 -2.50038 0.599502 2.3594e-05 -3.40984 0.599502 2.5339e-05 -4.7159 0.599509 1.9591e-05 -0.469098 0.614088 -0.0226313 -0.454683 0.613599 -0.0219569 -0.441026 0.613056 -0.0211902 -0.428193 0.612465 -0.0203386 -0.416239 0.61183 -0.0194093 -0.40521 0.611158 -0.0184122 -0.395138 0.61046 -0.0173619 -0.386043 0.609746 -0.0162789 -0.377928 0.609034 -0.0151875 -0.370779 0.608336 -0.0141117 -0.364542 0.607585 -0.0129425 -0.359149 0.606634 -0.0114468 -0.354599 0.60543 -0.00953659 -0.350909 0.604042 -0.00731973 -0.348046 0.602563 -0.00494753 -0.345964 0.601047 -0.00249733 -0.344686 0.599543 0 -0.345964 0.601047 0.00249733 -0.348046 0.602563 0.00494753 -0.350909 0.604042 0.00731973 -0.354599 0.60543 0.00953659 -0.359149 0.606634 0.0114468 -0.364542 0.607585 0.0129425 -0.370779 0.608336 0.0141117 -0.377928 0.609034 0.0151875 -0.386043 0.609746 0.0162789 -0.395138 0.61046 0.0173619 -0.40521 0.611158 0.0184122 -0.416239 0.61183 0.0194093 -0.428193 0.612465 0.0203386 -0.441026 0.613056 0.0211902 -0.454683 0.613599 0.0219569 -0.469098 0.614088 0.0226313 -0.484194 0.614515 0.0232032 -0.499886 0.614869 0.0236575 -0.516081 0.615137 0.0239748 -0.532677 0.615302 0.0241322 -0.549572 0.615348 0.024108 -0.566658 0.615261 0.0238847 -0.583833 0.615033 0.023454 -0.600993 0.614665 0.0228188 -0.618042 0.614166 0.0219948 -0.634889 0.613552 0.0210082 -0.651447 0.612845 0.0198924 -0.667638 0.612069 0.0186839 -0.683384 0.611245 0.0174167 -0.698615 0.610396 0.0161198 -0.713264 0.609534 0.0148141 -0.727274 0.60867 0.0135133 -0.740593 0.607809 0.0122252 -0.753182 0.606955 0.0109539 -0.765015 0.60611 0.00970251 -0.776081 0.605278 0.00847531 -0.786385 0.604463 0.00727795 -0.795952 0.603671 0.00611737 -0.804823 0.602907 0.00500065 -0.813062 0.602174 0.00393323 -0.820752 0.601477 0.00291762 -0.827996 0.600808 0.00194638 -0.834919 0.600157 0.0010013 -0.841666 0.59951 5.9273e-05 -0.848743 0.599505 5.8607e-05 -0.857361 0.599503 5.8669e-05 -0.871553 0.599502 5.9168e-05 -0.898784 0.599502 6.0692e-05 -0.950925 0.599502 6.3195e-05 -1.0455 0.599503 6.4793e-05 -1.2073 0.599502 6.4428e-05 -1.47043 0.599502 6.3775e-05 -1.88098 0.599501 6.4251e-05 -2.50039 0.5995 6.6272e-05 -3.40985 0.599501 7.0884e-05 -4.7159 0.599522 5.229e-05 -0.469095 0.614081 -0.0226959 -0.45468 0.613592 -0.0220207 -0.441023 0.613049 -0.0212531 -0.428189 0.612457 -0.0204006 -0.416236 0.611822 -0.0194702 -0.405206 0.611149 -0.018472 -0.395134 0.61045 -0.0174204 -0.386039 0.609736 -0.0163361 -0.377925 0.609023 -0.0152432 -0.370779 0.608325 -0.0141654 -0.364541 0.607572 -0.0129939 -0.359146 0.606623 -0.0114966 -0.35459 0.605422 -0.00958508 -0.350892 0.604038 -0.00736494 -0.348017 0.602563 -0.00498451 -0.345925 0.601051 -0.00251859 -0.344659 0.59958 0 -0.345925 0.601051 0.00251859 -0.348017 0.602563 0.00498451 -0.350892 0.604038 0.00736494 -0.35459 0.605422 0.00958508 -0.359146 0.606623 0.0114966 -0.364541 0.607572 0.0129939 -0.370779 0.608325 0.0141654 -0.377925 0.609023 0.0152432 -0.386039 0.609736 0.0163361 -0.395134 0.61045 0.0174204 -0.405206 0.611149 0.018472 -0.416236 0.611821 0.0194702 -0.428189 0.612457 0.0204006 -0.441023 0.613049 0.0212531 -0.45468 0.613592 0.0220207 -0.469095 0.614081 0.0226959 -0.484192 0.614509 0.0232685 -0.499885 0.614864 0.0237234 -0.516079 0.615132 0.0240412 -0.532677 0.615297 0.0241991 -0.549572 0.615343 0.0241753 -0.566659 0.615255 0.0239524 -0.583834 0.615028 0.023522 -0.600995 0.61466 0.0228872 -0.618045 0.614161 0.0220635 -0.634892 0.613547 0.0210771 -0.651452 0.61284 0.0199616 -0.667643 0.612064 0.0187533 -0.683389 0.611241 0.0174863 -0.69862 0.610391 0.0161894 -0.71327 0.609529 0.0148838 -0.72728 0.608665 0.0135831 -0.740599 0.607804 0.0122949 -0.753188 0.60695 0.0110236 -0.765022 0.606105 0.00977214 -0.776088 0.605273 0.00854485 -0.786393 0.604458 0.00734741 -0.795959 0.603666 0.00618677 -0.804831 0.602902 0.00507006 -0.813071 0.60217 0.00400272 -0.820761 0.601472 0.00298729 -0.828005 0.600804 0.00201639 -0.834928 0.600154 0.00107203 -0.841671 0.599513 0.00013359 -0.848743 0.599503 0.000130356 -0.857364 0.5995 0.000130075 -0.871557 0.599498 0.000130797 -0.898789 0.599497 0.000133644 -0.950932 0.599499 0.000138538 -1.04551 0.5995 0.000141523 -1.20731 0.5995 0.000140401 -1.47044 0.599499 0.000138785 -1.88099 0.599498 0.000139667 -2.5004 0.599498 0.000143789 -3.40987 0.599499 0.000153118 -4.7159 0.599546 0.000106955 -0.469091 0.61407 -0.0228098 -0.454675 0.61358 -0.0221328 -0.441017 0.613036 -0.0213633 -0.428183 0.612443 -0.0205087 -0.416229 0.611807 -0.019576 -0.4052 0.611134 -0.0185752 -0.395128 0.610434 -0.0175209 -0.386033 0.609719 -0.0164337 -0.377921 0.609005 -0.0153376 -0.370776 0.608306 -0.0142555 -0.364539 0.607552 -0.013079 -0.35914 0.606605 -0.011578 -0.354577 0.60541 -0.00966359 -0.350864 0.604032 -0.00743747 -0.347971 0.602562 -0.0050433 -0.345863 0.601058 -0.00255211 -0.344616 0.599637 1e-09 -0.345863 0.601058 0.00255212 -0.347971 0.602562 0.00504331 -0.350864 0.604032 0.00743747 -0.354577 0.60541 0.00966359 -0.35914 0.606605 0.011578 -0.364539 0.607552 0.013079 -0.370776 0.608306 0.0142555 -0.377921 0.609005 0.0153376 -0.386033 0.609719 0.0164337 -0.395128 0.610434 0.0175209 -0.4052 0.611134 0.0185752 -0.416229 0.611807 0.019576 -0.428183 0.612443 0.0205087 -0.441017 0.613036 0.0213633 -0.454675 0.61358 0.0221328 -0.469091 0.61407 0.0228098 -0.484188 0.614498 0.0233839 -0.499881 0.614854 0.0238402 -0.516077 0.615122 0.0241592 -0.532676 0.615288 0.0243182 -0.549572 0.615333 0.0242954 -0.566661 0.615247 0.0240735 -0.583837 0.615019 0.023644 -0.600999 0.614652 0.02301 -0.61805 0.614153 0.0221871 -0.634899 0.613539 0.0212015 -0.651459 0.612832 0.0200867 -0.667651 0.612055 0.018879 -0.683398 0.611232 0.0176126 -0.69863 0.610383 0.0163162 -0.71328 0.609521 0.0150109 -0.72729 0.608657 0.0137104 -0.74061 0.607795 0.0124224 -0.7532 0.606941 0.0111512 -0.765034 0.606096 0.00989981 -0.776101 0.605264 0.00867257 -0.786406 0.604449 0.0074752 -0.795974 0.603657 0.00631471 -0.804846 0.602893 0.00519825 -0.813086 0.602162 0.00413133 -0.820777 0.601465 0.0031165 -0.828022 0.600798 0.00214653 -0.834945 0.60015 0.00120397 -0.841681 0.599519 0.000274288 -0.848745 0.5995 0.000264157 -0.857369 0.599494 0.000262648 -0.871565 0.599491 0.000263211 -0.898799 0.59949 0.000267747 -0.950944 0.599492 0.000276288 -1.04553 0.599496 0.000281449 -1.20733 0.599497 0.000278842 -1.47047 0.599495 0.000275349 -1.88102 0.599493 0.000276787 -2.50043 0.599493 0.000284384 -3.4099 0.599496 0.000301427 -4.7159 0.599587 0.000198106 -0.469083 0.614051 -0.0230091 -0.454666 0.61356 -0.0223285 -0.441007 0.613015 -0.0215549 -0.428172 0.612421 -0.0206958 -0.416217 0.611783 -0.0197583 -0.405187 0.611109 -0.0187523 -0.395116 0.610407 -0.0176925 -0.386023 0.609692 -0.0165992 -0.377913 0.608977 -0.0154965 -0.370771 0.608275 -0.0144058 -0.364535 0.60752 -0.0132193 -0.359131 0.606577 -0.0117107 -0.354553 0.605391 -0.0097901 -0.350818 0.604023 -0.00755325 -0.347898 0.602562 -0.00513636 -0.345766 0.60107 -0.00260478 -0.344546 0.599719 2e-09 -0.345766 0.60107 0.00260479 -0.347898 0.602562 0.00513637 -0.350818 0.604023 0.00755326 -0.354553 0.605391 0.0097901 -0.359131 0.606577 0.0117107 -0.364535 0.60752 0.0132193 -0.370771 0.608275 0.0144058 -0.377913 0.608977 0.0154965 -0.386023 0.609692 0.0165992 -0.395116 0.610407 0.0176925 -0.405187 0.611109 0.0187523 -0.416217 0.611783 0.0197583 -0.428172 0.612421 0.0206958 -0.441007 0.613015 0.0215549 -0.454666 0.61356 0.0223285 -0.469083 0.614051 0.0230091 -0.484181 0.614481 0.0235865 -0.499876 0.614837 0.0240458 -0.516074 0.615106 0.0243675 -0.532674 0.615272 0.0245289 -0.549572 0.615318 0.0245084 -0.566663 0.615231 0.0242886 -0.583842 0.615004 0.0238611 -0.601006 0.614636 0.0232291 -0.61806 0.614138 0.0224081 -0.63491 0.613524 0.0214243 -0.651472 0.612817 0.0203112 -0.667665 0.61204 0.0191051 -0.683414 0.611218 0.0178401 -0.698647 0.610368 0.0165449 -0.713298 0.609506 0.0152407 -0.727309 0.608641 0.0139411 -0.74063 0.60778 0.0126538 -0.753221 0.606926 0.0113831 -0.765056 0.60608 0.0101322 -0.776124 0.605248 0.00890549 -0.786431 0.604433 0.00770868 -0.796 0.603641 0.00654889 -0.804874 0.602878 0.00543335 -0.813114 0.602147 0.00436765 -0.820806 0.601451 0.00335441 -0.828052 0.600786 0.0023867 -0.834975 0.600142 0.00144835 -0.8417 0.59953 0.00053767 -0.848749 0.599494 0.000511876 -0.85738 0.599483 0.000507013 -0.871581 0.599477 0.000506225 -0.898817 0.599476 0.000512441 -0.950966 0.599481 0.000526268 -1.04555 0.599489 0.000534848 -1.20736 0.599491 0.000529548 -1.47051 0.599487 0.000522526 -1.88106 0.599484 0.000524662 -2.50049 0.599484 0.000537939 -3.40995 0.599491 0.000567428 -4.7159 0.599659 0.000349536 -0.469068 0.61402 -0.0233552 -0.454649 0.613527 -0.0226671 -0.440988 0.61298 -0.0218853 -0.428152 0.612383 -0.0210172 -0.416196 0.611744 -0.02007 -0.405166 0.611067 -0.0190536 -0.395094 0.610364 -0.0179828 -0.386003 0.609647 -0.0168777 -0.377897 0.608931 -0.0157618 -0.370761 0.608226 -0.0146545 -0.364525 0.60747 -0.013449 -0.359111 0.606533 -0.0119254 -0.354512 0.605362 -0.00999263 -0.350743 0.604011 -0.00773678 -0.347782 0.602564 -0.00528262 -0.345614 0.60109 -0.00268704 -0.344429 0.599834 3e-09 -0.345614 0.60109 0.00268705 -0.347782 0.602564 0.00528264 -0.350743 0.604011 0.0077368 -0.354512 0.605362 0.00999265 -0.359111 0.606533 0.0119254 -0.364525 0.60747 0.013449 -0.370761 0.608226 0.0146545 -0.377897 0.60893 0.0157618 -0.386003 0.609647 0.0168777 -0.395095 0.610364 0.0179828 -0.405166 0.611067 0.0190536 -0.416196 0.611743 0.02007 -0.428152 0.612383 0.0210172 -0.440988 0.61298 0.0218854 -0.454649 0.613527 0.0226672 -0.469068 0.61402 0.0233553 -0.484169 0.614451 0.0239394 -0.499866 0.614808 0.0244048 -0.516066 0.615079 0.0247319 -0.53267 0.615245 0.0248985 -0.549572 0.615291 0.0248826 -0.566667 0.615205 0.0246673 -0.58385 0.614978 0.0242442 -0.601019 0.61461 0.0236164 -0.618076 0.614112 0.0227996 -0.63493 0.613498 0.0218198 -0.651495 0.612791 0.0207106 -0.667691 0.612015 0.0195081 -0.683442 0.611192 0.0182465 -0.698677 0.610343 0.0169543 -0.71333 0.60948 0.0156527 -0.727343 0.608615 0.0143553 -0.740665 0.607754 0.0130699 -0.753259 0.606898 0.011801 -0.765096 0.606052 0.0105517 -0.776166 0.60522 0.00932652 -0.786475 0.604405 0.00813149 -0.796047 0.603613 0.00697376 -0.804923 0.60285 0.00586071 -0.813166 0.60212 0.00479807 -0.820859 0.601426 0.00378859 -0.828107 0.600765 0.00282599 -0.835031 0.600128 0.00189691 -0.841736 0.599546 0.00102296 -0.848761 0.599484 0.000966271 -0.857403 0.599465 0.000953343 -0.871611 0.599453 0.000948192 -0.898852 0.599452 0.000954845 -0.951006 0.599463 0.000975598 -1.0456 0.599476 0.00098931 -1.20742 0.59948 0.000979307 -1.47058 0.599474 0.000965844 -1.88115 0.599467 0.00096871 -2.50059 0.599469 0.000991115 -3.41005 0.599481 0.00104033 -4.7159 0.599783 0.000600236 -0.469041 0.613969 -0.0239499 -0.454618 0.613473 -0.0232471 -0.440955 0.612922 -0.0224492 -0.428116 0.612322 -0.0215637 -0.416158 0.611679 -0.0205978 -0.405126 0.610999 -0.0195615 -0.395055 0.610293 -0.0184694 -0.385966 0.609574 -0.0173417 -0.377866 0.608857 -0.0162009 -0.370737 0.608149 -0.0150627 -0.364501 0.607392 -0.0138225 -0.359072 0.606466 -0.0122707 -0.35444 0.605317 -0.0103144 -0.350619 0.603991 -0.00802526 -0.347595 0.602567 -0.00551056 -0.345376 0.601121 -0.00281455 -0.344232 0.599986 6e-09 -0.345376 0.601121 0.00281457 -0.347595 0.602567 0.00551059 -0.350619 0.603991 0.00802529 -0.35444 0.605317 0.0103145 -0.359073 0.606466 0.0122707 -0.364501 0.607392 0.0138225 -0.370737 0.608149 0.0150627 -0.377866 0.608857 0.0162009 -0.385966 0.609574 0.0173417 -0.395055 0.610293 0.0184694 -0.405126 0.610999 0.0195615 -0.416158 0.611679 0.0205978 -0.428116 0.612322 0.0215637 -0.440955 0.612922 0.0224493 -0.454618 0.613473 0.0232472 -0.469041 0.613969 0.0239499 -0.484146 0.614402 0.0245474 -0.499847 0.614761 0.0250248 -0.516053 0.615033 0.025363 -0.532662 0.6152 0.0255397 -0.549571 0.615247 0.0255334 -0.566673 0.615161 0.0253272 -0.583863 0.614934 0.024913 -0.601039 0.614566 0.024294 -0.618103 0.614068 0.0234858 -0.634964 0.613454 0.0225146 -0.651535 0.612748 0.0214136 -0.667736 0.611971 0.020219 -0.683491 0.611149 0.0189646 -0.698729 0.610299 0.017679 -0.713385 0.609436 0.0163833 -0.727401 0.608571 0.0150911 -0.740727 0.607708 0.0138103 -0.753324 0.606851 0.0125457 -0.765165 0.606005 0.0113005 -0.77624 0.605171 0.0100796 -0.786554 0.604356 0.00888906 -0.796129 0.603564 0.00773645 -0.805009 0.602802 0.00662929 -0.813257 0.602075 0.00557358 -0.820955 0.601384 0.00457234 -0.828206 0.600728 0.00362072 -0.83513 0.600105 0.00271098 -0.841804 0.599567 0.0018988 -0.848792 0.599467 0.00179019 -0.857453 0.599432 0.00175952 -0.871674 0.599413 0.00174322 -0.898918 0.599411 0.00174595 -0.951081 0.59943 0.00177399 -1.04569 0.599456 0.00179461 -1.20753 0.599463 0.00177655 -1.47071 0.599451 0.00175164 -1.88131 0.599439 0.00175495 -2.50076 0.599442 0.00179171 -3.41021 0.599465 0.00187147 -4.7159 0.599992 0.00101411 -0.468991 0.613885 -0.0249591 -0.454563 0.613385 -0.0242284 -0.440894 0.612829 -0.0234001 -0.42805 0.612224 -0.0224818 -0.416088 0.611575 -0.0214808 -0.405054 0.610891 -0.0204073 -0.394983 0.610182 -0.019276 -0.385897 0.60946 -0.0181065 -0.377803 0.608741 -0.01692 -0.370683 0.60803 -0.0157266 -0.364444 0.607273 -0.0144254 -0.358992 0.606363 -0.0128221 -0.354308 0.605248 -0.0108218 -0.350409 0.603959 -0.00847464 -0.347292 0.602569 -0.00586253 -0.344997 0.601167 -0.00301064 -0.343894 0.600173 1.2e-08 -0.344997 0.601167 0.00301067 -0.347292 0.602569 0.00586258 -0.350409 0.603959 0.0084747 -0.354308 0.605248 0.0108218 -0.358992 0.606363 0.0128221 -0.364444 0.607273 0.0144254 -0.370683 0.60803 0.0157266 -0.377804 0.608741 0.01692 -0.385897 0.60946 0.0181065 -0.394983 0.610182 0.0192761 -0.405054 0.610891 0.0204074 -0.416088 0.611575 0.0214809 -0.42805 0.612223 0.0224819 -0.440894 0.612828 0.0234002 -0.454563 0.613384 0.0242285 -0.468991 0.613885 0.0249592 -0.484103 0.614322 0.0255821 -0.499812 0.614684 0.0260828 -0.516027 0.614958 0.0264422 -0.532646 0.615127 0.0266387 -0.549566 0.615174 0.026651 -0.56668 0.615088 0.0264629 -0.583883 0.614861 0.0260663 -0.601071 0.614493 0.0254647 -0.618147 0.613995 0.024674 -0.635019 0.613381 0.0237199 -0.6516 0.612675 0.0226357 -0.667809 0.611899 0.021457 -0.683572 0.611076 0.0202177 -0.698816 0.610225 0.0189459 -0.713479 0.609362 0.0176627 -0.727501 0.608495 0.0163819 -0.740833 0.60763 0.0151115 -0.753436 0.606772 0.0138566 -0.765285 0.605923 0.012621 -0.776367 0.605088 0.0114098 -0.786688 0.604272 0.0102298 -0.796272 0.603481 0.0090886 -0.80516 0.602721 0.00799428 -0.813416 0.601997 0.00695323 -0.821121 0.601312 0.00596908 -0.82838 0.600667 0.00503978 -0.835303 0.600067 0.00416781 -0.841937 0.599584 0.00344207 -0.848878 0.599437 0.0032625 -0.857569 0.599378 0.00319631 -0.871809 0.599343 0.00315492 -0.899053 0.599341 0.00314253 -0.951222 0.599376 0.00317373 -1.04585 0.599421 0.00320163 -1.20772 0.599433 0.00316978 -1.47093 0.599411 0.0031251 -1.88157 0.599391 0.00312782 -2.50106 0.599398 0.0031866 -3.41049 0.599439 0.00331233 -4.7159 0.600343 0.00169587 -0.468898 0.613752 -0.0266484 -0.454459 0.613244 -0.0258662 -0.44078 0.612681 -0.0249821 -0.427928 0.612068 -0.0240038 -0.415959 0.611412 -0.0229392 -0.404919 0.610722 -0.0217984 -0.394846 0.610008 -0.0205963 -0.385761 0.609284 -0.0193517 -0.377675 0.608563 -0.0180838 -0.370561 0.607849 -0.0167953 -0.364314 0.607095 -0.0153912 -0.358822 0.606209 -0.0136972 -0.35406 0.605139 -0.011616 -0.350047 0.603904 -0.00916881 -0.346794 0.602564 -0.00640118 -0.344389 0.601226 -0.00330979 -0.343312 0.600378 2.5e-08 -0.344389 0.601226 0.00330986 -0.346794 0.602564 0.00640129 -0.350047 0.603904 0.00916894 -0.35406 0.605139 0.0116161 -0.358823 0.606209 0.0136973 -0.364314 0.607095 0.0153913 -0.370561 0.607849 0.0167954 -0.377675 0.608562 0.0180839 -0.385761 0.609283 0.0193518 -0.394846 0.610007 0.0205964 -0.404919 0.610721 0.0217986 -0.415959 0.611412 0.0229393 -0.427928 0.612067 0.024004 -0.44078 0.61268 0.0249823 -0.454459 0.613244 0.0258664 -0.468898 0.613751 0.0266486 -0.484021 0.614194 0.0273188 -0.499744 0.614561 0.0278629 -0.515973 0.614838 0.0282623 -0.532609 0.615008 0.0284961 -0.549548 0.615057 0.0285439 -0.566682 0.61497 0.0283901 -0.583906 0.614743 0.0280273 -0.601116 0.614375 0.0274595 -0.618213 0.613876 0.0267024 -0.635104 0.613262 0.0257817 -0.651702 0.612555 0.0247302 -0.667926 0.611779 0.0235831 -0.683701 0.610955 0.0223735 -0.698958 0.610104 0.0211295 -0.713631 0.609238 0.0198718 -0.727663 0.608368 0.0186144 -0.741006 0.6075 0.0173659 -0.753621 0.606638 0.0161318 -0.765482 0.605786 0.0149168 -0.776578 0.604949 0.0137267 -0.786914 0.604131 0.0125689 -0.796513 0.603341 0.0114517 -0.805417 0.602584 0.0103836 -0.813688 0.601866 0.00937165 -0.821409 0.601192 0.00842087 -0.828682 0.600565 0.00753416 -0.835606 0.600001 0.00672772 -0.842199 0.599572 0.00609813 -0.849103 0.599384 0.00584406 -0.857837 0.599287 0.00571591 -0.872102 0.599229 0.00562383 -0.899334 0.599226 0.00557195 -0.951498 0.599287 0.00559095 -1.04615 0.599366 0.00562101 -1.20806 0.599386 0.00556544 -1.47132 0.599347 0.00548757 -1.88203 0.599313 0.00548722 -2.50157 0.599325 0.00557871 -3.41098 0.599398 0.00577125 -4.7159 0.600931 0.00281718 -0.468715 0.613544 -0.0294335 -0.454258 0.613027 -0.0285588 -0.440562 0.612452 -0.0275751 -0.427694 0.611828 -0.0264906 -0.41571 0.611162 -0.0253135 -0.404659 0.610464 -0.0240546 -0.394578 0.609744 -0.0227286 -0.385491 0.609017 -0.0213533 -0.377406 0.608295 -0.0199449 -0.37029 0.607581 -0.0184987 -0.364018 0.606835 -0.0169269 -0.358462 0.605981 -0.0150782 -0.353584 0.604969 -0.0128522 -0.349404 0.603805 -0.0102336 -0.345958 0.602536 -0.00721887 -0.343396 0.601283 -0.00376266 -0.342312 0.600568 5.1e-08 -0.343396 0.601283 0.00376279 -0.345958 0.602536 0.00721906 -0.349405 0.603805 0.0102339 -0.353584 0.604969 0.0128524 -0.358462 0.60598 0.0150784 -0.364018 0.606834 0.0169271 -0.37029 0.607581 0.0184989 -0.377406 0.608294 0.0199451 -0.385491 0.609016 0.0213535 -0.394578 0.609743 0.0227288 -0.40466 0.610463 0.0240548 -0.41571 0.611162 0.0253138 -0.427694 0.611827 0.026491 -0.440562 0.612451 0.0275755 -0.454258 0.613026 0.0285592 -0.468715 0.613544 0.0294339 -0.483859 0.613995 0.0301896 -0.499604 0.614368 0.0308125 -0.515859 0.61465 0.0312851 -0.532524 0.614823 0.0315876 -0.549494 0.614872 0.0317009 -0.566662 0.614785 0.0316109 -0.583921 0.614557 0.0313112 -0.601167 0.614187 0.0308063 -0.618298 0.613687 0.0301122 -0.63522 0.613072 0.0292541 -0.651847 0.612365 0.0282642 -0.668097 0.611587 0.0271768 -0.683895 0.610762 0.0260241 -0.699171 0.609908 0.0248334 -0.713863 0.609038 0.0236255 -0.727915 0.608164 0.0224146 -0.741278 0.60729 0.0212099 -0.753914 0.606422 0.0200182 -0.765798 0.605564 0.0188452 -0.776919 0.604722 0.0176978 -0.787282 0.603903 0.0165844 -0.79691 0.603113 0.0155141 -0.805844 0.602362 0.014496 -0.814148 0.601654 0.0135382 -0.821902 0.600998 0.0126479 -0.829203 0.600401 0.0118339 -0.836142 0.599882 0.0111206 -0.842728 0.599494 0.0105751 -0.84964 0.599278 0.0102619 -0.858444 0.599137 0.0100465 -0.872745 0.599047 0.00986453 -0.899932 0.599043 0.00972733 -0.952053 0.599148 0.00969546 -1.04671 0.599281 0.00970823 -1.20866 0.599314 0.00961111 -1.47201 0.599248 0.00947917 -1.88282 0.599191 0.0094706 -2.50244 0.599212 0.00960899 -3.41179 0.59934 0.00989449 -4.7159 0.601912 0.00465932 -0.468347 0.613233 -0.0339504 -0.453856 0.612702 -0.0329144 -0.440129 0.612112 -0.0317583 -0.42723 0.611472 -0.0304908 -0.415219 0.610793 -0.0291209 -0.404142 0.610083 -0.0276603 -0.394039 0.609357 -0.0261238 -0.384934 0.608627 -0.0245281 -0.376831 0.607906 -0.0228857 -0.369687 0.607196 -0.0211861 -0.363357 0.606465 -0.01935 -0.357695 0.605651 -0.0172456 -0.352648 0.60471 -0.0147672 -0.348237 0.603634 -0.0118579 -0.344524 0.602455 -0.00845118 -0.34174 0.601306 -0.00444245 -0.340599 0.600691 1.08e-07 -0.34174 0.601306 0.00444271 -0.344524 0.602455 0.00845152 -0.348237 0.603633 0.0118583 -0.352648 0.60471 0.0147676 -0.357696 0.60565 0.017246 -0.363358 0.606464 0.0193504 -0.369687 0.607195 0.0211865 -0.376831 0.607905 0.0228861 -0.384934 0.608625 0.0245285 -0.394039 0.609355 0.0261243 -0.404142 0.610082 0.0276608 -0.415219 0.610791 0.0291215 -0.42723 0.611471 0.0304914 -0.440129 0.61211 0.031759 -0.453856 0.6127 0.0329152 -0.468348 0.613232 0.0339513 -0.483527 0.613695 0.0348571 -0.499312 0.614078 0.0356196 -0.51561 0.614366 0.0362226 -0.532322 0.614542 0.0366483 -0.549344 0.614592 0.0368799 -0.566567 0.614505 0.0369051 -0.583883 0.614274 0.0367195 -0.601185 0.613903 0.0363285 -0.618372 0.6134 0.0357483 -0.635347 0.612784 0.0350037 -0.652022 0.612074 0.0341256 -0.668316 0.611294 0.0331468 -0.684153 0.610465 0.0320982 -0.699466 0.609605 0.0310064 -0.714193 0.608729 0.0298916 -0.728279 0.607846 0.0287687 -0.741679 0.606962 0.0276481 -0.754355 0.606084 0.026538 -0.766283 0.605218 0.0254459 -0.777452 0.604369 0.0243802 -0.787867 0.603547 0.02335 -0.797553 0.60276 0.0223652 -0.80655 0.602016 0.0214354 -0.814922 0.601324 0.0205694 -0.822748 0.600693 0.0197757 -0.830121 0.600131 0.0190645 -0.837128 0.599654 0.0184529 -0.843796 0.599292 0.0179685 -0.850816 0.599064 0.017616 -0.859752 0.59889 0.0173056 -0.874116 0.598768 0.016991 -0.901207 0.598767 0.0166969 -0.953189 0.598941 0.0165356 -1.04778 0.599164 0.0164807 -1.20976 0.599221 0.0163093 -1.47321 0.599111 0.016092 -1.88417 0.599016 0.0160658 -2.50391 0.599055 0.0162685 -3.41313 0.599274 0.0166761 -4.7159 0.60354 0.00768337 -0.467579 0.612793 -0.0411492 -0.453026 0.612242 -0.03984 -0.439238 0.611631 -0.0383939 -0.426281 0.610972 -0.0368205 -0.414211 0.610274 -0.0351303 -0.403079 0.60955 -0.033336 -0.39292 0.608815 -0.0314528 -0.383759 0.608083 -0.0294966 -0.375593 0.607366 -0.0274775 -0.368365 0.606666 -0.0253823 -0.361917 0.605959 -0.0231375 -0.356083 0.605195 -0.0206213 -0.350795 0.604331 -0.0177167 -0.346071 0.603352 -0.0143212 -0.342005 0.602277 -0.0102937 -0.338918 0.601232 -0.00545183 -0.33766 0.600674 2.27e-07 -0.338918 0.601232 0.00545235 -0.342005 0.602276 0.0102943 -0.346071 0.603351 0.0143219 -0.350795 0.60433 0.0177174 -0.356083 0.605193 0.020622 -0.361917 0.605958 0.0231383 -0.368365 0.606665 0.0253831 -0.375593 0.607363 0.0274783 -0.383759 0.608081 0.0294975 -0.39292 0.608813 0.0314538 -0.403079 0.609548 0.033337 -0.414211 0.610271 0.0351314 -0.426281 0.610969 0.0368218 -0.439238 0.611629 0.0383953 -0.453026 0.612239 0.0398415 -0.467579 0.612791 0.0411508 -0.482824 0.613271 0.0423131 -0.498678 0.613667 0.043316 -0.51505 0.613963 0.0441455 -0.531842 0.614144 0.0447865 -0.548948 0.614196 0.0452254 -0.56626 0.614108 0.0454532 -0.583667 0.613875 0.0454679 -0.60106 0.6135 0.0452764 -0.618336 0.612994 0.0448952 -0.635397 0.612373 0.0443484 -0.652152 0.611659 0.0436651 -0.66852 0.610874 0.042876 -0.684428 0.610038 0.0420105 -0.699808 0.60917 0.0410935 -0.714601 0.608282 0.0401454 -0.728756 0.607384 0.0391816 -0.742228 0.606486 0.0382141 -0.754984 0.605594 0.0372528 -0.766999 0.604715 0.036307 -0.778266 0.603857 0.0353861 -0.78879 0.60303 0.0344997 -0.798597 0.602245 0.0336572 -0.80773 0.601511 0.0328671 -0.816251 0.600838 0.0321366 -0.82424 0.600231 0.0314712 -0.83179 0.599699 0.0308748 -0.838995 0.59925 0.0303511 -0.845897 0.598903 0.0299061 -0.853182 0.598678 0.0295241 -0.862382 0.598498 0.0291262 -0.876898 0.598369 0.0286521 -0.903853 0.598392 0.0281167 -0.955517 0.59867 0.0276969 -1.04988 0.599033 0.0274689 -1.21179 0.599132 0.0271639 -1.47532 0.598958 0.0268165 -1.88647 0.598808 0.0267569 -2.50633 0.598878 0.0270431 -3.41531 0.599248 0.0275986 -4.7159 0.606241 0.0126451 -0.46594 0.612234 -0.052414 -0.451267 0.611656 -0.0506558 -0.437361 0.611017 -0.0487369 -0.424286 0.61033 -0.0466681 -0.412097 0.609608 -0.0444616 -0.400842 0.608866 -0.0421317 -0.390556 0.608118 -0.039695 -0.381258 0.607382 -0.0371675 -0.372936 0.606669 -0.0345589 -0.365524 0.605986 -0.0318556 -0.358854 0.605312 -0.028983 -0.352749 0.604602 -0.0258139 -0.347124 0.603815 -0.02221 -0.341998 0.602929 -0.0180185 -0.337492 0.601952 -0.0130157 -0.334018 0.600984 -0.00692677 -0.332582 0.600429 4.77e-07 -0.334018 0.600984 0.00692783 -0.337492 0.601951 0.0130169 -0.341998 0.602928 0.0180199 -0.347124 0.603813 0.0222114 -0.352749 0.604599 0.0258153 -0.358855 0.605309 0.0289844 -0.365524 0.605984 0.0318571 -0.372936 0.606666 0.0345605 -0.381258 0.607378 0.0371691 -0.390556 0.608115 0.0396968 -0.400842 0.608862 0.0421336 -0.412097 0.609604 0.0444636 -0.424286 0.610326 0.0466704 -0.437361 0.611013 0.0487394 -0.451267 0.611652 0.0506585 -0.465939 0.61223 0.0524169 -0.481305 0.612734 0.0540043 -0.497283 0.613149 0.0554096 -0.513784 0.613459 0.0566212 -0.53071 0.613649 0.0576277 -0.547956 0.613705 0.0584198 -0.565412 0.613618 0.0589925 -0.582965 0.613384 0.0593471 -0.600506 0.613006 0.0594925 -0.617927 0.612496 0.0594456 -0.635129 0.611872 0.0592293 -0.652021 0.611152 0.0588708 -0.668521 0.610359 0.0583984 -0.684559 0.609512 0.0578391 -0.700069 0.60863 0.0572166 -0.714996 0.607725 0.056551 -0.729292 0.606809 0.0558583 -0.742916 0.605891 0.0551517 -0.755839 0.60498 0.0544423 -0.768041 0.604083 0.0537399 -0.779516 0.603213 0.0530534 -0.790273 0.60238 0.0523906 -0.800341 0.601594 0.0517579 -0.809762 0.600865 0.0511599 -0.818601 0.600202 0.0505988 -0.826938 0.59961 0.0500747 -0.834869 0.599094 0.0495852 -0.842488 0.59866 0.0491272 -0.849843 0.598327 0.0487008 -0.857608 0.59812 0.048284 -0.867286 0.597968 0.0477984 -0.882157 0.597884 0.047153 -0.909049 0.597986 0.0463107 -0.960178 0.598419 0.0454729 -1.05398 0.598984 0.0448949 -1.21557 0.599159 0.0443541 -1.47905 0.598901 0.0438168 -1.89036 0.598672 0.0437005 -2.51032 0.598795 0.0440881 -3.41881 0.599411 0.0448004 -4.7159 0.610715 0.020783 -0.46241 0.611694 -0.0697094 -0.447507 0.611076 -0.0672356 -0.433368 0.610395 -0.0645689 -0.420054 0.609668 -0.0617211 -0.407619 0.608909 -0.0587063 -0.396108 0.608137 -0.0555413 -0.385552 0.607367 -0.0522443 -0.375964 0.606618 -0.0488329 -0.367327 0.605905 -0.0453176 -0.359571 0.605237 -0.0416823 -0.352526 0.604594 -0.0378414 -0.34601 0.603933 -0.0336461 -0.339933 0.60321 -0.0289234 -0.334312 0.602394 -0.023464 -0.329295 0.601473 -0.0169571 -0.325373 0.600514 -0.00903234 -0.323716 0.599894 9.97e-07 -0.325373 0.600514 0.00903447 -0.329295 0.601472 0.0169595 -0.334312 0.602391 0.0234666 -0.339933 0.603207 0.028926 -0.34601 0.60393 0.0336488 -0.352526 0.60459 0.0378442 -0.359571 0.605232 0.0416852 -0.367327 0.6059 0.0453206 -0.375963 0.606612 0.0488361 -0.385552 0.607361 0.0522476 -0.396108 0.60813 0.0555449 -0.407619 0.608903 0.0587102 -0.420053 0.609661 0.0617253 -0.433367 0.610388 0.0645734 -0.447507 0.611068 0.0672405 -0.46241 0.611686 0.0697147 -0.478005 0.612227 0.0719852 -0.494213 0.612673 0.0740427 -0.510947 0.61301 0.0758783 -0.528109 0.61322 0.0774848 -0.545594 0.613291 0.0788575 -0.563292 0.613215 0.079996 -0.58109 0.612988 0.0809051 -0.598876 0.612615 0.0815961 -0.616543 0.612108 0.082086 -0.63399 0.611484 0.0823968 -0.651128 0.610762 0.0825536 -0.667876 0.609963 0.0825821 -0.684167 0.609108 0.082507 -0.699941 0.608213 0.0823505 -0.715147 0.607292 0.0821318 -0.729742 0.606357 0.0818666 -0.743693 0.605419 0.0815676 -0.756975 0.604489 0.0812451 -0.769573 0.603576 0.0809066 -0.781485 0.602691 0.0805578 -0.792724 0.601846 0.0802021 -0.803317 0.601052 0.079841 -0.813309 0.600319 0.079474 -0.82276 0.599655 0.0790993 -0.831749 0.599065 0.0787139 -0.840365 0.598555 0.0783142 -0.848702 0.598133 0.0778971 -0.856802 0.597822 0.0774631 -0.865338 0.597657 0.0769889 -0.875806 0.597569 0.0763936 -0.891378 0.597588 0.0755576 -0.918512 0.597843 0.0743762 -0.969041 0.598496 0.0729983 -1.06179 0.599329 0.0718538 -1.22256 0.599629 0.0709273 -1.48566 0.599274 0.0701283 -1.89695 0.598946 0.0699263 -2.51682 0.599157 0.0704265 -3.42433 0.600168 0.0712629 -4.7159 0.61812 0.0341277 -0.454891 0.611667 -0.0957363 -0.439538 0.610978 -0.0921555 -0.424939 0.610225 -0.0883375 -0.411154 0.609427 -0.0842952 -0.398234 0.608602 -0.0800442 -0.386221 0.607769 -0.0756031 -0.375144 0.606948 -0.0709922 -0.365016 0.606159 -0.0662302 -0.355822 0.605421 -0.0613273 -0.347495 0.604744 -0.056261 -0.339875 0.60411 -0.0509243 -0.332782 0.60347 -0.0451323 -0.326124 0.602768 -0.0386658 -0.319927 0.601959 -0.0312543 -0.314362 0.601006 -0.0225008 -0.309979 0.59994 -0.0119491 -0.308078 0.599163 2.042e-06 -0.309979 0.599938 0.0119533 -0.314362 0.601003 0.0225053 -0.319927 0.601955 0.0312591 -0.326124 0.602763 0.0386708 -0.332781 0.603464 0.0451375 -0.339874 0.604103 0.0509296 -0.347494 0.604737 0.0562665 -0.355821 0.605413 0.061333 -0.365015 0.60615 0.0662362 -0.375143 0.606938 0.0709985 -0.38622 0.607759 0.0756099 -0.398232 0.608591 0.0800514 -0.411152 0.609415 0.0843028 -0.424938 0.610213 0.0883458 -0.439537 0.610965 0.0921644 -0.454889 0.611653 0.0957459 -0.470927 0.612262 0.0990801 -0.487573 0.612771 0.102159 -0.50474 0.613164 0.104976 -0.522334 0.613426 0.107529 -0.54025 0.613543 0.109817 -0.558382 0.613507 0.111843 -0.576616 0.613317 0.113616 -0.594842 0.612977 0.115149 -0.612954 0.6125 0.116459 -0.630857 0.611901 0.117566 -0.648462 0.611201 0.118494 -0.665697 0.61042 0.119267 -0.682496 0.609577 0.119905 -0.698808 0.60869 0.12043 -0.714588 0.607773 0.120858 -0.729802 0.606839 0.121203 -0.744421 0.6059 0.121474 -0.758426 0.604966 0.121679 -0.771805 0.604049 0.12182 -0.784558 0.603159 0.1219 -0.796695 0.602308 0.121916 -0.808241 0.601508 0.121868 -0.819233 0.600769 0.121752 -0.829726 0.6001 0.121566 -0.839788 0.599511 0.121308 -0.849507 0.599007 0.120978 -0.858967 0.598602 0.120575 -0.868208 0.598321 0.120103 -0.877918 0.598217 0.119541 -0.889613 0.598223 0.118807 -0.906405 0.598385 0.11776 -0.934387 0.598849 0.116244 -0.984698 0.599769 0.11432 -1.07607 0.600902 0.112472 -1.23527 0.601375 0.111006 -1.49731 0.600933 0.109881 -1.90806 0.600496 0.109567 -2.52735 0.600853 0.110178 -3.43291 0.602486 0.111024 -4.7159 0.630369 0.0560071 -0.439328 0.613502 -0.13402 -0.42312 0.612668 -0.128769 -0.407653 0.611769 -0.123215 -0.392985 0.610827 -0.117373 -0.379171 0.609862 -0.111259 -0.366255 0.608896 -0.104891 -0.354272 0.60795 -0.0982923 -0.34324 0.607051 -0.0914817 -0.333158 0.606217 -0.0844684 -0.323974 0.605464 -0.0772213 -0.31554 0.604769 -0.0696046 -0.307683 0.604072 -0.0613875 -0.300319 0.603295 -0.0522982 -0.293482 0.60237 -0.0420052 -0.287362 0.601232 -0.0300332 -0.282538 0.599889 -0.0158589 -0.280385 0.59884 4.07e-06 -0.282537 0.599886 0.0158672 -0.287361 0.601228 0.030042 -0.293481 0.602364 0.0420144 -0.300318 0.603287 0.0523078 -0.307681 0.604063 0.0613973 -0.315538 0.604759 0.0696147 -0.323972 0.605452 0.0772316 -0.333156 0.606205 0.0844793 -0.343237 0.607036 0.0914931 -0.354268 0.607935 0.0983042 -0.366252 0.608879 0.104904 -0.379168 0.609844 0.111272 -0.392982 0.610808 0.117387 -0.407649 0.611749 0.12323 -0.423116 0.612646 0.128785 -0.439324 0.613479 0.134038 -0.456205 0.614229 0.13898 -0.473682 0.614876 0.143604 -0.491672 0.615403 0.147909 -0.510082 0.615792 0.151892 -0.528813 0.616032 0.155557 -0.547759 0.616113 0.158911 -0.566814 0.616035 0.161962 -0.585873 0.615803 0.164725 -0.604837 0.615429 0.167217 -0.623615 0.614928 0.169458 -0.642129 0.614319 0.171467 -0.66031 0.613623 0.173267 -0.678103 0.61286 0.174876 -0.695463 0.612045 0.176311 -0.712351 0.611194 0.177586 -0.728738 0.610319 0.178712 -0.744598 0.609432 0.179696 -0.759913 0.608542 0.180541 -0.774671 0.607661 0.181248 -0.788867 0.606799 0.181818 -0.802505 0.605969 0.182249 -0.815601 0.605182 0.18254 -0.828185 0.60445 0.182689 -0.8403 0.603785 0.182697 -0.852012 0.603199 0.182567 -0.8634 0.602703 0.182303 -0.874548 0.602312 0.181911 -0.885493 0.602062 0.181398 -0.896958 0.602025 0.180747 -0.910519 0.60213 0.179879 -0.929291 0.60244 0.178648 -0.959079 0.603111 0.176879 -1.0102 0.604279 0.17456 -1.10058 0.605668 0.172108 -1.25757 0.606321 0.170071 -1.5175 0.605831 0.168616 -1.92669 0.605309 0.168192 -2.54428 0.605906 0.168894 -3.44611 0.608509 0.169485 -4.7159 0.650626 0.091877 -0.408635 0.620286 -0.188814 -0.390886 0.619147 -0.181093 -0.373878 0.617943 -0.172971 -0.357677 0.616699 -0.16446 -0.342344 0.615436 -0.155578 -0.327935 0.614179 -0.146345 -0.314498 0.612956 -0.136787 -0.30207 0.611793 -0.126926 -0.290668 0.610718 -0.116772 -0.280261 0.609745 -0.106287 -0.270716 0.608848 -0.0953048 -0.261869 0.607941 -0.0835439 -0.25364 0.606917 -0.0706794 -0.24607 0.605678 -0.0563243 -0.239357 0.604133 -0.0399369 -0.234082 0.602295 -0.0209458 -0.231657 0.600839 7.829e-06 -0.234081 0.602292 0.0209617 -0.239355 0.604128 0.0399535 -0.246067 0.605669 0.0563414 -0.253637 0.606906 0.0706971 -0.261866 0.607928 0.0835622 -0.270711 0.608833 0.0953236 -0.280256 0.609728 0.106306 -0.290663 0.610699 0.116792 -0.302064 0.611772 0.126947 -0.314491 0.612932 0.136809 -0.327927 0.614153 0.146369 -0.342336 0.615407 0.155603 -0.357669 0.616668 0.164486 -0.37387 0.61791 0.172999 -0.390878 0.619111 0.181122 -0.408627 0.620248 0.188845 -0.427045 0.621301 0.196157 -0.446055 0.622247 0.203054 -0.465573 0.623067 0.209535 -0.48551 0.623745 0.2156 -0.505769 0.624267 0.221255 -0.526251 0.624624 0.226507 -0.546857 0.624815 0.231366 -0.56749 0.624843 0.235847 -0.588059 0.62472 0.239966 -0.608483 0.624461 0.243741 -0.62869 0.624084 0.247191 -0.648621 0.623607 0.250337 -0.668226 0.62305 0.253195 -0.687465 0.622428 0.255782 -0.706303 0.621754 0.258112 -0.724712 0.621041 0.260195 -0.742667 0.620298 0.262039 -0.760146 0.619533 0.263651 -0.777133 0.618757 0.265032 -0.793615 0.617981 0.266186 -0.809591 0.617216 0.267114 -0.825067 0.616475 0.267821 -0.840067 0.615772 0.268309 -0.854628 0.615123 0.268583 -0.868811 0.614541 0.268653 -0.882695 0.614045 0.268527 -0.896366 0.613657 0.268215 -0.909864 0.613424 0.267731 -0.923969 0.613447 0.267063 -0.940363 0.613638 0.266147 -0.962247 0.614069 0.264854 -0.995251 0.614898 0.263022 -1.04892 0.616226 0.260613 -1.13986 0.617749 0.257933 -1.29493 0.618528 0.255576 -1.55173 0.618062 0.253942 -1.9577 0.617545 0.253481 -2.57151 0.618536 0.254233 -3.46637 0.622667 0.254044 -4.7159 0.684115 0.15068 -0.351568 0.638097 -0.265238 -0.331211 0.636364 -0.253948 -0.311637 0.63457 -0.242105 -0.292927 0.63274 -0.229725 -0.275157 0.630902 -0.216827 -0.2584 0.629085 -0.20344 -0.242728 0.62732 -0.189594 -0.228198 0.625642 -0.175321 -0.214851 0.624083 -0.160638 -0.202679 0.622663 -0.145504 -0.191564 0.621343 -0.129722 -0.181345 0.620002 -0.112965 -0.17194 0.618491 -0.0948574 -0.163393 0.616682 -0.0749668 -0.155905 0.614468 -0.0526983 -0.150053 0.611898 -0.0274486 -0.147289 0.6099 1.4425e-05 -0.150051 0.611894 0.0274779 -0.155902 0.614461 0.0527285 -0.163389 0.616671 0.074998 -0.171935 0.618477 0.0948896 -0.181338 0.619984 0.112998 -0.191556 0.621322 0.129757 -0.20267 0.622639 0.145539 -0.214841 0.624056 0.160675 -0.228187 0.625611 0.17536 -0.242716 0.627286 0.189635 -0.258388 0.629046 0.203482 -0.275143 0.63086 0.216872 -0.292913 0.632694 0.229772 -0.311623 0.634519 0.242156 -0.331197 0.636309 0.254002 -0.351554 0.638038 0.265295 -0.372613 0.639681 0.276026 -0.39429 0.641214 0.28619 -0.416496 0.642614 0.295786 -0.439139 0.643864 0.304818 -0.462124 0.644945 0.313289 -0.485355 0.645849 0.321209 -0.508737 0.646571 0.32859 -0.53218 0.647114 0.335446 -0.555599 0.647486 0.341795 -0.57892 0.647701 0.347656 -0.602077 0.647776 0.35305 -0.625016 0.647728 0.357998 -0.647693 0.647572 0.362523 -0.670068 0.647325 0.366643 -0.692111 0.646998 0.370377 -0.713793 0.6466 0.37374 -0.735086 0.646139 0.376745 -0.755968 0.645624 0.379404 -0.776417 0.645062 0.381725 -0.796417 0.644463 0.383718 -0.81596 0.643839 0.38539 -0.83505 0.643206 0.386751 -0.853704 0.642578 0.387808 -0.87196 0.641975 0.388574 -0.889878 0.641418 0.389061 -0.907543 0.64093 0.389282 -0.925049 0.640543 0.389253 -0.942441 0.640322 0.388988 -0.960594 0.640409 0.388486 -0.981347 0.640685 0.387719 -1.00808 0.641223 0.386596 -1.04639 0.64217 0.385006 -1.10519 0.643581 0.382931 -1.19962 0.645131 0.380596 -1.35488 0.645985 0.378489 -1.60851 0.645685 0.377082 -2.00925 0.645391 0.376795 -2.61571 0.647061 0.37753 -3.49781 0.653711 0.375538 -4.7159 0.739473 0.247078 -0.250618 0.677986 -0.371344 -0.226014 0.675223 -0.354964 -0.202302 0.672408 -0.337812 -0.179583 0.669575 -0.31991 -0.157955 0.666756 -0.301283 -0.137519 0.663989 -0.281969 -0.118369 0.661312 -0.262011 -0.100594 0.65877 -0.241453 -0.084262 0.656403 -0.220324 -0.0693887 0.654238 -0.198588 -0.0558708 0.652217 -0.176026 -0.0435436 0.650173 -0.15227 -0.0323198 0.647906 -0.12691 -0.0222464 0.645254 -0.0994776 -0.0135363 0.642116 -0.0693401 -0.00678473 0.638607 -0.0358779 -0.00354161 0.635963 2.5402e-05 -0.00678215 0.638603 0.0359294 -0.0135313 0.642107 0.069393 -0.0222393 0.645241 0.0995323 -0.0323106 0.647888 0.126967 -0.0435325 0.650151 0.152329 -0.0558578 0.652191 0.176087 -0.0693739 0.654206 0.198652 -0.0842456 0.656367 0.220391 -0.100576 0.658728 0.241523 -0.11835 0.661265 0.262085 -0.137499 0.663936 0.282048 -0.157935 0.666697 0.301367 -0.179562 0.669509 0.319999 -0.202281 0.672335 0.337907 -0.225993 0.675142 0.355065 -0.250598 0.677897 0.371452 -0.275996 0.68057 0.387057 -0.302087 0.68313 0.401875 -0.32877 0.68555 0.415905 -0.355946 0.687804 0.429153 -0.383511 0.689871 0.441624 -0.411368 0.691737 0.453333 -0.43942 0.693393 0.464291 -0.467577 0.694839 0.474519 -0.495756 0.696081 0.484038 -0.523885 0.697129 0.492871 -0.551902 0.697998 0.501045 -0.579757 0.698704 0.508587 -0.607408 0.699261 0.515527 -0.634819 0.699683 0.521891 -0.661962 0.699978 0.527704 -0.688809 0.700156 0.532991 -0.715335 0.700222 0.537773 -0.741518 0.700181 0.542071 -0.767335 0.70004 0.5459 -0.792771 0.699808 0.549277 -0.817819 0.699497 0.552218 -0.84248 0.699122 0.554737 -0.866776 0.698704 0.55685 -0.890747 0.698263 0.558572 -0.914463 0.697829 0.559922 -0.938022 0.697431 0.560918 -0.961535 0.697117 0.561577 -0.985064 0.696974 0.561912 -1.00961 0.697199 0.561933 -1.03725 0.697632 0.561675 -1.07165 0.698344 0.561116 -1.11852 0.699469 0.560219 -1.18632 0.701011 0.559022 -1.28882 0.702641 0.557722 -1.4488 0.703693 0.556668 -1.70161 0.703877 0.556189 -2.09555 0.704286 0.556486 -2.68906 0.707268 0.557045 -3.54799 0.718437 0.551258 -4.7159 0.83097 0.405103 -0.0767816 0.760092 -0.523713 -0.045265 0.755659 -0.500022 -0.0148293 0.751195 -0.475238 --0.0143943 0.746743 -0.449381 --0.0422717 0.742348 -0.422485 --0.0686674 0.738057 -0.394597 --0.0934473 0.733923 -0.365771 --0.116484 0.730002 -0.33607 --0.137669 0.726349 -0.305539 --0.156951 0.723001 -0.274153 --0.174412 0.719881 -0.241687 --0.190222 0.716763 -0.207752 --0.204471 0.713391 -0.171922 --0.217096 0.70958 -0.13371 --0.227848 0.705251 -0.0924594 --0.236065 0.700624 -0.0475463 --0.240018 0.697262 4.2991e-05 --0.236069 0.700619 0.0476334 --0.227856 0.705241 0.0925491 --0.217107 0.709565 0.133803 --0.204486 0.713371 0.172019 --0.19024 0.716738 0.207854 --0.174433 0.719849 0.241794 --0.156974 0.722962 0.274266 --0.137694 0.726304 0.305659 --0.116511 0.729949 0.336198 --0.0934752 0.733861 0.365909 --0.0686958 0.737987 0.394744 --0.0423001 0.742268 0.422644 --0.0144219 0.746653 0.449551 -0.0148031 0.751093 0.475421 -0.0452411 0.755544 0.500219 -0.0767609 0.759964 0.523924 -0.109234 0.76431 0.546524 -0.142537 0.768543 0.568018 -0.176545 0.772625 0.58841 -0.211141 0.776521 0.607711 -0.246209 0.780204 0.625934 -0.281638 0.78365 0.643101 -0.317324 0.786846 0.659232 -0.353171 0.789786 0.674355 -0.389093 0.792472 0.688499 -0.425018 0.794912 0.701698 -0.460886 0.797119 0.713986 -0.496647 0.799104 0.725402 -0.532265 0.800883 0.735983 -0.56771 0.802465 0.745768 -0.602959 0.803859 0.754795 -0.637993 0.80507 0.763096 -0.672793 0.806102 0.770706 -0.707345 0.806957 0.777654 -0.741635 0.807641 0.783967 -0.775656 0.808159 0.789671 -0.809408 0.808524 0.794787 -0.842904 0.808752 0.79934 -0.876178 0.808864 0.803351 -0.909286 0.808888 0.806842 -0.942319 0.808857 0.809837 -0.975402 0.808813 0.812356 -1.00868 0.808815 0.81442 -1.04225 0.808983 0.816033 -1.07731 0.809592 0.817218 -1.11623 0.810425 0.818103 -1.1631 0.811563 0.818761 -1.22387 0.813131 0.819252 -1.30671 0.815097 0.819683 -1.42413 0.817164 0.82025 -1.59607 0.818889 0.821167 -1.85356 0.820246 0.822475 -2.2407 0.822369 0.823855 -2.8129 0.828237 0.823667 -3.6301 0.848072 0.810585 -4.7159 0.982191 0.664158 --0.219648 0.920567 -0.756774 --0.262653 0.913305 -0.722192 --0.304274 0.906022 -0.685987 --0.344328 0.898776 -0.648176 --0.382624 0.891634 -0.60879 --0.418965 0.884662 -0.56788 --0.453156 0.877937 -0.525513 --0.485001 0.871542 -0.481765 --0.514325 0.865559 -0.436706 --0.541012 0.860047 -0.390333 --0.565101 0.854921 -0.342441 --0.586738 0.849905 -0.292664 --0.605993 0.844694 -0.240592 --0.622758 0.839109 -0.185749 --0.636712 0.83313 -0.127478 --0.647082 0.827126 -0.0651768 --0.651952 0.822992 6.9048e-05 --0.647088 0.827121 0.0653168 --0.636723 0.833119 0.127622 --0.622775 0.839093 0.1859 --0.606014 0.844672 0.240752 --0.586763 0.849876 0.292834 --0.565129 0.854886 0.342623 --0.541042 0.860003 0.390529 --0.514357 0.865506 0.436918 --0.485033 0.871479 0.481995 --0.453188 0.877863 0.525763 --0.418995 0.884575 0.568152 --0.38265 0.891533 0.609087 --0.344349 0.89866 0.648499 --0.304288 0.905888 0.68634 --0.262658 0.913152 0.722576 --0.219643 0.920393 0.757191 --0.175418 0.927552 0.790184 --0.130152 0.934576 0.821565 --0.0840028 0.941413 0.851356 --0.0371232 0.948018 0.879583 -0.0103448 0.954352 0.906281 -0.0582686 0.960386 0.931485 -0.106527 0.966099 0.955238 -0.155012 0.97148 0.977583 -0.20363 0.976529 0.998567 -0.252305 0.98125 1.01824 -0.300977 0.985655 1.03666 -0.349601 0.989757 1.05387 -0.398148 0.993568 1.06994 -0.446601 0.997098 1.08491 -0.494949 1.00036 1.09885 -0.543192 1.00334 1.1118 -0.591331 1.00606 1.12381 -0.639373 1.00852 1.13492 -0.687328 1.01072 1.14519 -0.735215 1.01266 1.15464 -0.783062 1.01435 1.1633 -0.830913 1.01582 1.17123 -0.878834 1.01708 1.17843 -0.926924 1.01817 1.18495 -0.97532 1.01912 1.1908 -1.0242 1.02 1.19603 -1.07379 1.02087 1.20064 -1.12426 1.02188 1.20464 -1.17701 1.02341 1.20804 -1.23483 1.02518 1.2111 -1.30225 1.0273 1.21399 -1.38547 1.0299 1.21688 -1.4923 1.03294 1.21991 -1.6338 1.03623 1.22323 -1.82657 1.03962 1.22688 -2.09553 1.04348 1.23047 -2.47622 1.0494 1.23281 -3.01498 1.06179 1.2302 -3.76064 1.09629 1.20714 -4.7159 1.23211 1.08884 --0.721182 1.22172 -1.13603 --0.783789 1.20911 -1.08418 --0.844534 1.19642 -1.02975 --0.903134 1.18375 -0.972758 --0.959293 1.17119 -0.913221 --1.0127 1.15887 -0.85119 --1.06305 1.14692 -0.786743 --1.11003 1.13547 -0.71998 --1.15333 1.12469 -0.651003 --1.19272 1.11468 -0.579862 --1.22813 1.10541 -0.506428 --1.25959 1.09659 -0.430435 --1.28708 1.08796 -0.351574 --1.3104 1.07939 -0.269455 --1.32911 1.07099 -0.183516 --1.34234 1.06332 -0.0932716 --1.34817 1.05849 9.6846e-05 --1.34235 1.06332 0.0934681 --1.32912 1.07098 0.18372 --1.31042 1.07937 0.269671 --1.28711 1.08794 0.351805 --1.25961 1.09657 0.430685 --1.22815 1.10537 0.5067 --1.19275 1.11464 0.580161 --1.15336 1.12464 0.651334 --1.11005 1.13541 0.720346 --1.06307 1.14684 0.787149 --1.01271 1.15878 0.851641 --0.959281 1.17108 0.913721 --0.903104 1.18362 0.973313 --0.844483 1.19627 1.03036 --0.783713 1.20893 1.08485 --0.721075 1.22151 1.13678 --0.656835 1.23392 1.18617 --0.591241 1.24608 1.23305 --0.524522 1.25791 1.27749 --0.456892 1.26937 1.31955 --0.388543 1.28039 1.35929 --0.319651 1.29095 1.39681 --0.25037 1.30102 1.43217 --0.180831 1.31058 1.46547 --0.111144 1.31964 1.49679 --0.0413932 1.32821 1.52621 -0.0283599 1.3363 1.55383 -0.0980781 1.34393 1.57973 -0.167745 1.35111 1.60402 -0.237363 1.35787 1.62677 -0.306949 1.36421 1.64806 -0.376535 1.37015 1.668 -0.446161 1.37569 1.68664 -0.51588 1.38084 1.70406 -0.585751 1.38562 1.72034 -0.655848 1.39003 1.73552 -0.726262 1.39408 1.74966 -0.797101 1.3978 1.76281 -0.868507 1.40123 1.77502 -0.940657 1.40438 1.78633 -1.01378 1.40733 1.79678 -1.08816 1.41012 1.80639 -1.16412 1.41284 1.81521 -1.24198 1.41568 1.82319 -1.32332 1.41904 1.83036 -1.41116 1.42267 1.83708 -1.51016 1.42671 1.8436 -1.62623 1.4313 1.8501 -1.76614 1.43649 1.85668 -1.93874 1.4423 1.86335 -2.15643 1.449 1.86985 -2.43704 1.45755 1.87532 -2.80557 1.47028 1.87784 -3.29462 1.49281 1.87284 -3.93572 1.53951 1.84907 -4.7159 1.64513 1.78505 --1.55503 1.7863 -1.80158 --1.65466 1.76294 -1.72074 --1.75172 1.73924 -1.63534 --1.84568 1.71538 -1.54536 --1.93599 1.69156 -1.45082 --2.02209 1.66802 -1.35178 --2.10339 1.64502 -1.24837 --2.17933 1.62284 -1.14075 --2.24935 1.60178 -1.02912 --2.31295 1.58213 -0.913656 --2.36978 1.56402 -0.79445 --2.41961 1.54738 -0.671516 --2.46216 1.53213 -0.544847 --2.49702 1.51838 -0.414369 --2.52364 1.50644 -0.279891 --2.54116 1.49699 -0.141323 --2.54805 1.49195 9.441e-05 --2.54116 1.49699 0.141515 --2.52364 1.50644 0.280092 --2.49703 1.51838 0.414584 --2.46217 1.53212 0.54508 --2.41962 1.54736 0.671774 --2.36979 1.564 0.794738 --2.31295 1.5821 0.913981 --2.24934 1.60175 1.02949 --2.17931 1.6228 1.14117 --2.10335 1.64497 1.24884 --2.02203 1.66796 1.35232 --1.9359 1.69148 1.45142 --1.84556 1.71528 1.54604 --1.75155 1.73912 1.63611 --1.65444 1.76279 1.7216 --1.55474 1.78612 1.80255 --1.45295 1.80894 1.87901 --1.34952 1.83112 1.95109 --1.24488 1.85256 2.01892 --1.1394 1.87317 2.08265 --1.03342 1.89287 2.14244 --0.927249 1.91164 2.19849 --0.821131 1.92944 2.25097 --0.715285 1.94628 2.30008 --0.609882 1.96215 2.34601 --0.505054 1.97709 2.38896 --0.400894 1.99113 2.42912 --0.297455 2.00429 2.46668 --0.194761 2.01663 2.50183 --0.092801 2.02818 2.53474 -0.00846121 2.03898 2.56558 -0.109088 2.04907 2.59451 -0.209167 2.05849 2.62169 -0.308808 2.06727 2.64725 -0.408148 2.07545 2.67131 -0.507351 2.08309 2.694 -0.606613 2.0902 2.71541 -0.706171 2.09685 2.73564 -0.806306 2.10308 2.75476 -0.907354 2.10894 2.77285 -1.00972 2.1145 2.78996 -1.11387 2.11983 2.80615 -1.22037 2.12501 2.82144 -1.32978 2.13019 2.83582 -1.44364 2.13568 2.84932 -1.56458 2.14136 2.86225 -1.69638 2.14737 2.87482 -1.84367 2.15389 2.8872 -2.01168 2.16105 2.89939 -2.20715 2.16908 2.91134 -2.43942 2.17844 2.92273 -2.72167 2.19012 2.93294 -3.07223 2.206 2.94073 -3.51424 2.22968 2.94396 -4.06737 2.26757 2.93959 -4.7159 2.3277 2.92642 --2.85628 2.99597 -3.24444 --3.06472 2.9501 -3.11822 --3.26825 2.90421 -2.98062 --3.46547 2.85884 -2.83141 --3.65499 2.8145 -2.67049 --3.83548 2.77166 -2.49793 --4.00566 2.73075 -2.31392 --4.16431 2.69209 -2.11884 --4.31032 2.65596 -1.91321 --4.44264 2.62252 -1.69771 --4.56041 2.59183 -1.47318 --4.66285 2.56386 -1.24062 --4.74939 2.53845 -1.00113 --4.81963 2.51532 -0.755957 --4.87339 2.49406 -0.506431 --4.91069 2.47415 -0.253958 --4.93181 2.45491 0 --4.91069 2.47415 0.253958 --4.87339 2.49406 0.506431 --4.81963 2.51532 0.755957 --4.74939 2.53845 1.00113 --4.66285 2.56386 1.24062 --4.56041 2.59183 1.47318 --4.44264 2.62252 1.69771 --4.31032 2.65596 1.91321 --4.16431 2.69209 2.11884 --4.00566 2.73075 2.31392 --3.83548 2.77166 2.49793 --3.65499 2.8145 2.67049 --3.46547 2.85884 2.83141 --3.26825 2.90421 2.98062 --3.06472 2.9501 3.11822 --2.85628 2.99597 3.24444 --2.64435 3.04127 3.35961 --2.43035 3.08545 3.46419 --2.21568 3.128 3.55872 --2.00176 3.16845 3.64381 --1.78992 3.20637 3.72013 --1.5815 3.24143 3.7884 --1.37774 3.27336 3.84934 --1.17983 3.30197 3.90371 --0.988883 3.32718 3.95224 --0.805897 3.34899 3.99567 --0.631773 3.3675 4.03468 --0.467291 3.38287 4.06994 --0.313104 3.39534 4.10208 --0.169732 3.40519 4.13165 --0.0375506 3.41275 4.15918 -0.0832053 3.41837 4.18515 -0.192456 3.42239 4.21067 -0.290277 3.42517 4.2362 -0.37689 3.42703 4.26171 -0.45266 3.42841 4.28724 -0.518111 3.42977 4.31276 -0.57392 3.43114 4.33828 -0.620923 3.4325 4.3638 -0.660122 3.43386 4.38932 -0.692696 3.43523 4.41484 -0.720008 3.43659 4.44036 -0.743615 3.43796 4.46588 -0.765274 3.43932 4.4914 -0.787481 3.44068 4.51692 -0.815482 3.44205 4.54244 -0.856586 3.44341 4.56796 -0.920173 3.44477 4.59348 -1.01829 3.44614 4.619 -1.16641 3.4475 4.64452 -1.3844 3.44887 4.67004 -1.69775 3.45023 4.69556 -2.13921 3.45159 4.72108 -2.75084 3.45296 4.7466 -3.58663 3.45432 4.77212 -4.7159 3.45569 4.79765 -0.508445 0.691903 -0.0215243 -0.494658 0.691353 -0.0208827 -0.481587 0.690742 -0.0201532 -0.469295 0.690077 -0.0193429 -0.457837 0.689362 -0.0184585 -0.447256 0.688607 -0.0175094 -0.437583 0.68782 -0.0165095 -0.428838 0.687017 -0.0154785 -0.421028 0.686215 -0.0144392 -0.41414 0.685431 -0.0134149 -0.408115 0.684586 -0.0123017 -0.402878 0.683513 -0.0108764 -0.398423 0.682154 -0.00905537 -0.394773 0.680585 -0.00694324 -0.391906 0.678916 -0.0046871 -0.389778 0.677203 -0.00236343 -0.388392 0.675465 0 -0.389778 0.677203 0.00236343 -0.391906 0.678916 0.0046871 -0.394773 0.680585 0.00694324 -0.398423 0.682154 0.00905537 -0.402878 0.683513 0.0108764 -0.408115 0.684586 0.0123017 -0.41414 0.685431 0.0134149 -0.421028 0.686215 0.0144392 -0.428838 0.687017 0.0154785 -0.437583 0.68782 0.0165095 -0.447256 0.688607 0.0175094 -0.457837 0.689362 0.0184585 -0.469295 0.690077 0.0193429 -0.481587 0.690742 0.0201532 -0.494658 0.691353 0.0208827 -0.508445 0.691903 0.0215243 -0.522875 0.692383 0.0220682 -0.537866 0.692782 0.0225002 -0.553328 0.693084 0.0228017 -0.569163 0.693269 0.0229512 -0.585273 0.69332 0.0229278 -0.601555 0.693222 0.022715 -0.61791 0.692965 0.0223048 -0.634243 0.69255 0.0217 -0.650461 0.691988 0.0209155 -0.666481 0.691296 0.019976 -0.682221 0.690498 0.0189135 -0.697608 0.689623 0.0177625 -0.712571 0.688696 0.0165556 -0.727044 0.687738 0.01532 -0.740964 0.686767 0.0140759 -0.754276 0.685793 0.0128363 -0.766931 0.684823 0.0116086 -0.778894 0.68386 0.0103968 -0.790137 0.682909 0.0092037 -0.800651 0.681971 0.00803349 -0.810441 0.681053 0.00689153 -0.81953 0.68016 0.00578445 -0.827958 0.679299 0.00471899 -0.835785 0.678474 0.00370036 -0.843092 0.677687 0.00273095 -0.849975 0.676933 0.00180365 -0.856553 0.676199 0.000901008 -0.862968 0.675464 0 -0.869733 0.675464 0 -0.878021 0.675464 0 -0.891843 0.675465 0 -0.918629 0.675465 0 -0.970193 0.675465 0 -1.06398 0.675465 0 -1.22467 0.675465 0 -1.48623 0.675465 0 -1.89455 0.675465 0 -2.51082 0.675465 0 -3.4159 0.675465 0 -4.7159 0.675465 0 -0.508444 0.691901 -0.0215448 -0.494657 0.691351 -0.0209031 -0.481586 0.69074 -0.0201736 -0.469294 0.690074 -0.0193631 -0.457836 0.68936 -0.0184785 -0.447254 0.688604 -0.0175293 -0.437581 0.687817 -0.0165293 -0.428837 0.687014 -0.015498 -0.421027 0.686212 -0.0144586 -0.414139 0.685427 -0.013434 -0.408114 0.684581 -0.0123205 -0.402876 0.68351 -0.010895 -0.398419 0.682151 -0.00907384 -0.394766 0.680584 -0.00696079 -0.391894 0.678917 -0.0047018 -0.389763 0.677206 -0.00237182 -0.388386 0.675483 0 -0.389763 0.677206 0.00237182 -0.391894 0.678917 0.0047018 -0.394766 0.680584 0.00696079 -0.398419 0.682151 0.00907384 -0.402876 0.68351 0.010895 -0.408114 0.684581 0.0123205 -0.414139 0.685427 0.013434 -0.421027 0.686212 0.0144586 -0.428837 0.687014 0.015498 -0.437581 0.687817 0.0165293 -0.447254 0.688604 0.0175293 -0.457836 0.68936 0.0184785 -0.469294 0.690074 0.0193631 -0.481586 0.69074 0.0201736 -0.494657 0.691351 0.0209031 -0.508444 0.691901 0.0215448 -0.522875 0.692382 0.0220888 -0.537866 0.692781 0.0225209 -0.553327 0.693082 0.0228225 -0.569163 0.693268 0.022972 -0.585273 0.693318 0.0229487 -0.601555 0.69322 0.0227359 -0.617911 0.692963 0.0223257 -0.634243 0.692549 0.0217209 -0.650462 0.691986 0.0209364 -0.666482 0.691294 0.0199969 -0.682222 0.690497 0.0189343 -0.697609 0.689622 0.0177833 -0.712573 0.688694 0.0165763 -0.727045 0.687737 0.0153407 -0.740966 0.686766 0.0140966 -0.754277 0.685792 0.012857 -0.766933 0.684822 0.0116292 -0.778895 0.683859 0.0104172 -0.790139 0.682907 0.00922407 -0.800653 0.68197 0.00805376 -0.810443 0.681052 0.00691171 -0.819532 0.680159 0.00580454 -0.82796 0.679298 0.00473902 -0.835788 0.678473 0.00372033 -0.843094 0.677686 0.0027509 -0.849978 0.676933 0.00182362 -0.856556 0.676198 0.000921032 -0.862969 0.675466 2.0272e-05 -0.869733 0.675464 2.0317e-05 -0.878021 0.675464 2.0393e-05 -0.891845 0.675463 2.0615e-05 -0.918631 0.675463 2.1214e-05 -0.970195 0.675464 2.2166e-05 -1.06398 0.675464 2.2767e-05 -1.22468 0.675464 2.2661e-05 -1.48624 0.675464 2.2464e-05 -1.89455 0.675464 2.2653e-05 -2.51083 0.675464 2.3398e-05 -3.41591 0.675464 2.5143e-05 -4.7159 0.675473 1.84e-05 -0.508443 0.691898 -0.0215812 -0.494655 0.691347 -0.0209392 -0.481584 0.690736 -0.0202093 -0.469292 0.69007 -0.0193984 -0.457834 0.689355 -0.0185135 -0.447252 0.688599 -0.0175637 -0.437579 0.687812 -0.0165632 -0.428835 0.687009 -0.0155314 -0.421025 0.686206 -0.0144914 -0.414138 0.68542 -0.013466 -0.408113 0.684574 -0.0123515 -0.402874 0.683503 -0.0109254 -0.398414 0.682148 -0.00910366 -0.394755 0.680583 -0.00698884 -0.391876 0.678919 -0.00472499 -0.389738 0.677211 -0.00238487 -0.388375 0.675512 0 -0.389738 0.677211 0.00238487 -0.391876 0.678919 0.00472499 -0.394755 0.680583 0.00698884 -0.398414 0.682148 0.00910366 -0.402874 0.683503 0.0109254 -0.408113 0.684574 0.0123515 -0.414138 0.68542 0.013466 -0.421025 0.686206 0.0144914 -0.428835 0.687009 0.0155314 -0.437579 0.687812 0.0165632 -0.447252 0.688599 0.0175637 -0.457834 0.689355 0.0185135 -0.469292 0.69007 0.0193984 -0.481584 0.690736 0.0202093 -0.494655 0.691347 0.0209392 -0.508443 0.691898 0.0215812 -0.522873 0.692378 0.0221255 -0.537865 0.692778 0.0225578 -0.553327 0.693079 0.0228596 -0.569163 0.693265 0.0230093 -0.585273 0.693316 0.0229861 -0.601556 0.693217 0.0227734 -0.617912 0.692961 0.0223633 -0.634245 0.692546 0.0217586 -0.650464 0.691984 0.0209742 -0.666484 0.691292 0.0200347 -0.682225 0.690495 0.0189723 -0.697612 0.689619 0.0178213 -0.712575 0.688692 0.0166143 -0.727048 0.687734 0.0153787 -0.740969 0.686763 0.0141345 -0.754281 0.685789 0.0128949 -0.766937 0.684819 0.011667 -0.778899 0.683857 0.010455 -0.790142 0.682905 0.00926171 -0.800657 0.681967 0.00809129 -0.810447 0.681049 0.00694914 -0.819536 0.680157 0.00584187 -0.827965 0.679296 0.00477629 -0.835792 0.678471 0.00375758 -0.843099 0.677684 0.00278817 -0.849982 0.676931 0.00186099 -0.856561 0.676197 0.000958649 -0.862972 0.675468 5.9081e-05 -0.869733 0.675463 5.8479e-05 -0.878023 0.675462 5.8537e-05 -0.891847 0.675461 5.9031e-05 -0.918634 0.675461 6.0549e-05 -0.970199 0.675462 6.2983e-05 -1.06399 0.675463 6.4382e-05 -1.22468 0.675463 6.3863e-05 -1.48624 0.675463 6.3202e-05 -1.89456 0.675462 6.3672e-05 -2.51084 0.675462 6.5652e-05 -3.41592 0.675463 7.0262e-05 -4.7159 0.675489 4.9061e-05 -0.50844 0.691892 -0.0216455 -0.494652 0.691341 -0.0210027 -0.48158 0.690729 -0.020272 -0.469288 0.690063 -0.0194602 -0.45783 0.689348 -0.0185742 -0.447248 0.688591 -0.0176233 -0.437575 0.687803 -0.0166216 -0.428831 0.686999 -0.0155884 -0.421022 0.686196 -0.014547 -0.414136 0.68541 -0.0135197 -0.408111 0.684563 -0.0124028 -0.40287 0.683493 -0.010975 -0.398405 0.682142 -0.00915185 -0.394738 0.680582 -0.00703371 -0.391848 0.678922 -0.00476166 -0.389699 0.67722 -0.00240527 -0.388357 0.675557 1e-09 -0.389699 0.67722 0.00240527 -0.391848 0.678922 0.00476166 -0.394738 0.680582 0.00703371 -0.398405 0.682142 0.00915185 -0.40287 0.683493 0.010975 -0.408111 0.684563 0.0124028 -0.414136 0.68541 0.0135197 -0.421022 0.686196 0.014547 -0.428831 0.686999 0.0155884 -0.437575 0.687803 0.0166216 -0.447248 0.688591 0.0176233 -0.45783 0.689347 0.0185742 -0.469288 0.690063 0.0194602 -0.48158 0.690729 0.020272 -0.494652 0.691341 0.0210028 -0.50844 0.691892 0.0216455 -0.522871 0.692373 0.0221904 -0.537863 0.692773 0.0226233 -0.553326 0.693075 0.0229256 -0.569162 0.69326 0.0230758 -0.585273 0.693311 0.023053 -0.601557 0.693213 0.0228408 -0.617913 0.692956 0.022431 -0.634247 0.692542 0.0218266 -0.650467 0.691979 0.0210425 -0.666487 0.691287 0.0201033 -0.682229 0.69049 0.0190411 -0.697616 0.689615 0.0178903 -0.71258 0.688688 0.0166835 -0.727053 0.68773 0.015448 -0.740974 0.686759 0.0142039 -0.754286 0.685785 0.0129643 -0.766943 0.684815 0.0117364 -0.778905 0.683852 0.0105243 -0.790149 0.6829 0.00933098 -0.800664 0.681963 0.00816048 -0.810454 0.681045 0.00701825 -0.819544 0.680152 0.00591094 -0.827973 0.679291 0.00484537 -0.835801 0.678466 0.00382675 -0.843108 0.67768 0.00285754 -0.849991 0.676928 0.00193069 -0.85657 0.676195 0.00102907 -0.862977 0.675473 0.000133014 -0.869734 0.675462 0.000129899 -0.878026 0.675459 0.000129607 -0.891851 0.675458 0.000130308 -0.918639 0.675457 0.000133127 -0.970205 0.675459 0.000137852 -1.064 0.675461 0.000140399 -1.22469 0.675461 0.000138945 -1.48626 0.67546 0.000137325 -1.89458 0.675459 0.000138202 -2.51085 0.67546 0.000142235 -3.41594 0.675462 0.00015155 -4.7159 0.675515 0.000100193 -0.508436 0.691882 -0.0217586 -0.494647 0.691331 -0.0211142 -0.481574 0.690718 -0.0203815 -0.469282 0.690051 -0.0195676 -0.457823 0.689334 -0.0186793 -0.44724 0.688577 -0.017726 -0.437567 0.687788 -0.0167216 -0.428824 0.686984 -0.0156856 -0.421016 0.68618 -0.0146409 -0.414131 0.685392 -0.0136094 -0.408107 0.684544 -0.0124875 -0.402863 0.683478 -0.0110559 -0.39839 0.682133 -0.00922958 -0.39471 0.680581 -0.00710533 -0.391802 0.678927 -0.00481957 -0.389639 0.677235 -0.00243715 -0.388327 0.675626 1e-09 -0.389639 0.677235 0.00243716 -0.391802 0.678927 0.00481958 -0.39471 0.680581 0.00710533 -0.39839 0.682133 0.00922959 -0.402863 0.683478 0.0110559 -0.408107 0.684544 0.0124875 -0.414131 0.685392 0.0136094 -0.421016 0.68618 0.0146409 -0.428824 0.686984 0.0156856 -0.437567 0.687788 0.0167216 -0.44724 0.688577 0.017726 -0.457823 0.689334 0.0186793 -0.469282 0.690051 0.0195676 -0.481574 0.690718 0.0203815 -0.494647 0.69133 0.0211142 -0.508436 0.691882 0.0217586 -0.522867 0.692364 0.0223051 -0.53786 0.692764 0.0227393 -0.553324 0.693066 0.0230428 -0.569161 0.693252 0.0231941 -0.585273 0.693303 0.0231723 -0.601558 0.693205 0.022961 -0.617916 0.692948 0.0225521 -0.634251 0.692534 0.0219485 -0.650472 0.691972 0.0211652 -0.666493 0.69128 0.0202267 -0.682236 0.690483 0.0191652 -0.697625 0.689608 0.0180151 -0.712589 0.68868 0.0168088 -0.727063 0.687723 0.0155738 -0.740984 0.686752 0.01433 -0.754297 0.685778 0.0130907 -0.766953 0.684807 0.011863 -0.778917 0.683845 0.010651 -0.790161 0.682892 0.00945777 -0.800677 0.681955 0.00828733 -0.810468 0.681037 0.00714519 -0.819558 0.680144 0.00603805 -0.827988 0.679284 0.00497275 -0.835816 0.678459 0.00395455 -0.843124 0.677674 0.00298594 -0.850008 0.676922 0.00206003 -0.856586 0.676192 0.00116021 -0.862987 0.675482 0.000272778 -0.869736 0.67546 0.000262852 -0.878031 0.675454 0.000261314 -0.89186 0.675451 0.000261821 -0.918649 0.675451 0.00026627 -0.970218 0.675454 0.000274447 -1.06401 0.675457 0.000278723 -1.22471 0.675458 0.000275447 -1.48628 0.675456 0.000271948 -1.89461 0.675454 0.00027339 -2.51089 0.675454 0.000280814 -3.41597 0.675458 0.000297801 -4.7159 0.675562 0.000185263 -0.508427 0.691866 -0.0219564 -0.494637 0.691313 -0.0213084 -0.481564 0.690699 -0.0205717 -0.46927 0.69003 -0.0197535 -0.45781 0.689313 -0.0188604 -0.447227 0.688554 -0.0179019 -0.437554 0.687764 -0.016892 -0.428811 0.686959 -0.01585 -0.421005 0.686154 -0.0147987 -0.414123 0.685364 -0.0137587 -0.4081 0.684515 -0.0126268 -0.40285 0.683453 -0.0111873 -0.398364 0.682118 -0.00935437 -0.394664 0.680579 -0.00721911 -0.391731 0.678937 -0.00491061 -0.389546 0.677259 -0.00248684 -0.388275 0.675729 2e-09 -0.389546 0.677259 0.00248685 -0.391731 0.678937 0.00491062 -0.394664 0.680579 0.00721912 -0.398364 0.682118 0.00935438 -0.40285 0.683453 0.0111873 -0.4081 0.684515 0.0126268 -0.414123 0.685364 0.0137587 -0.421005 0.686154 0.0147987 -0.428811 0.686958 0.01585 -0.437554 0.687764 0.016892 -0.447227 0.688554 0.0179019 -0.45781 0.689312 0.0188604 -0.46927 0.69003 0.0197535 -0.481564 0.690699 0.0205717 -0.494637 0.691313 0.0213084 -0.508427 0.691865 0.0219564 -0.52286 0.692348 0.0225061 -0.537855 0.692749 0.0229432 -0.55332 0.693052 0.0232494 -0.569159 0.693238 0.023403 -0.585273 0.69329 0.0233834 -0.601561 0.693191 0.0231742 -0.617921 0.692935 0.0227672 -0.634258 0.692521 0.0221656 -0.650481 0.691958 0.0213841 -0.666505 0.691267 0.0204475 -0.682249 0.69047 0.0193877 -0.697639 0.689595 0.0182391 -0.712605 0.688667 0.0170343 -0.727079 0.68771 0.0158005 -0.741002 0.686739 0.0145578 -0.754316 0.685765 0.0133193 -0.766973 0.684794 0.0120923 -0.778938 0.683831 0.0108809 -0.790183 0.682878 0.00968819 -0.8007 0.681941 0.00851827 -0.810493 0.681022 0.00737672 -0.819584 0.68013 0.0062703 -0.828015 0.67927 0.00520594 -0.835844 0.678446 0.00418899 -0.843153 0.677662 0.00322198 -0.850038 0.676912 0.00229833 -0.856617 0.676187 0.00140269 -0.863006 0.675498 0.000533985 -0.86974 0.675457 0.000508573 -0.878042 0.675446 0.000503648 -0.891875 0.675439 0.000502726 -0.918667 0.675439 0.000508723 -0.97024 0.675444 0.000521814 -1.06404 0.675451 0.000528692 -1.22475 0.675452 0.000522075 -1.48632 0.675448 0.000515019 -1.89466 0.675444 0.000517176 -2.51094 0.675446 0.000530133 -3.41602 0.675453 0.000559467 -4.7159 0.675644 0.000326353 -0.508412 0.691838 -0.0222993 -0.49462 0.691284 -0.0216439 -0.481544 0.690668 -0.0208992 -0.469249 0.689997 -0.0200721 -0.457787 0.689277 -0.0191695 -0.447203 0.688515 -0.0182008 -0.43753 0.687724 -0.0171799 -0.428788 0.686917 -0.0161262 -0.420984 0.686112 -0.0150619 -0.414107 0.685319 -0.0140053 -0.408084 0.684468 -0.0128544 -0.402825 0.683414 -0.0113994 -0.398319 0.682096 -0.00955343 -0.394588 0.680577 -0.00739862 -0.391616 0.678952 -0.00505276 -0.3894 0.677296 -0.00256388 -0.388184 0.675877 4e-09 -0.3894 0.677296 0.00256389 -0.391616 0.678952 0.00505278 -0.394588 0.680577 0.00739864 -0.39832 0.682096 0.00955345 -0.402825 0.683414 0.0113994 -0.408084 0.684468 0.0128544 -0.414107 0.685319 0.0140053 -0.420985 0.686111 0.0150619 -0.428788 0.686917 0.0161262 -0.43753 0.687724 0.0171799 -0.447203 0.688515 0.0182008 -0.457787 0.689276 0.0191695 -0.469249 0.689997 0.0200721 -0.481544 0.690667 0.0208992 -0.49462 0.691283 0.021644 -0.508412 0.691838 0.0222993 -0.522848 0.692322 0.0228556 -0.537845 0.692724 0.0232987 -0.553313 0.693028 0.0236102 -0.569156 0.693215 0.0237688 -0.585273 0.693267 0.0237538 -0.601565 0.693168 0.023549 -0.617929 0.692912 0.0231463 -0.63427 0.692498 0.0225489 -0.650497 0.691936 0.0217714 -0.666524 0.691244 0.0208388 -0.682272 0.690447 0.0197828 -0.697665 0.689573 0.0186378 -0.712633 0.688646 0.0174363 -0.727109 0.687688 0.0162055 -0.741033 0.686716 0.0149654 -0.754349 0.685742 0.0137291 -0.767008 0.684771 0.0125041 -0.778975 0.683807 0.0112944 -0.790223 0.682854 0.0101033 -0.800742 0.681916 0.00893504 -0.810537 0.680997 0.0077953 -0.81963 0.680105 0.00669098 -0.828063 0.679245 0.00562914 -0.835895 0.678423 0.00461526 -0.843206 0.677641 0.00365201 -0.850093 0.676895 0.00273346 -0.856672 0.676178 0.00184703 -0.863043 0.675523 0.00101439 -0.869752 0.675451 0.000958525 -0.878066 0.675431 0.000945483 -0.891906 0.675419 0.000940042 -0.918702 0.675418 0.0009462 -0.97028 0.675428 0.000965534 -1.06409 0.675441 0.000976081 -1.22481 0.675442 0.000963534 -1.48639 0.675434 0.00094993 -1.89474 0.675428 0.000952857 -2.51105 0.67543 0.00097469 -3.41612 0.675443 0.00102353 -4.7159 0.675783 0.000559676 -0.508385 0.691793 -0.0228875 -0.494589 0.691235 -0.0222178 -0.48151 0.690616 -0.0214573 -0.469211 0.689942 -0.0206131 -0.457747 0.689218 -0.019692 -0.447161 0.688454 -0.0187036 -0.437486 0.68766 -0.0176619 -0.428745 0.686851 -0.0165857 -0.420946 0.686044 -0.0154967 -0.414074 0.685249 -0.0144093 -0.40805 0.684397 -0.0132235 -0.402778 0.683355 -0.0117394 -0.398241 0.682062 -0.00986867 -0.394462 0.680572 -0.00767956 -0.391433 0.678974 -0.00527297 -0.38917 0.677354 -0.00268262 -0.388021 0.676078 8e-09 -0.38917 0.677353 0.00268265 -0.391433 0.678974 0.00527301 -0.394462 0.680572 0.0076796 -0.398241 0.682062 0.00986871 -0.402778 0.683354 0.0117394 -0.40805 0.684397 0.0132235 -0.414074 0.685248 0.0144093 -0.420946 0.686044 0.0154967 -0.428745 0.686851 0.0165857 -0.437486 0.68766 0.0176619 -0.447161 0.688454 0.0187037 -0.457747 0.689218 0.0196921 -0.469212 0.689941 0.0206131 -0.48151 0.690616 0.0214574 -0.494589 0.691235 0.0222179 -0.508385 0.691793 0.0228876 -0.522825 0.69228 0.0234569 -0.537826 0.692683 0.0239118 -0.553299 0.692988 0.0242341 -0.569148 0.693176 0.0244026 -0.585272 0.693228 0.0243969 -0.60157 0.69313 0.024201 -0.617942 0.692874 0.023807 -0.634291 0.69246 0.0232182 -0.650524 0.691898 0.0224493 -0.666558 0.691206 0.021525 -0.682311 0.69041 0.0204772 -0.697708 0.689535 0.0193399 -0.71268 0.688608 0.0181456 -0.727161 0.68765 0.0169213 -0.741088 0.686678 0.015687 -0.754407 0.685703 0.0144559 -0.76707 0.684731 0.0132355 -0.77904 0.683766 0.0120302 -0.790291 0.682812 0.0108432 -0.800814 0.681873 0.00967921 -0.810614 0.680954 0.00854406 -0.819712 0.680062 0.0074449 -0.828149 0.679204 0.00638897 -0.835985 0.678384 0.00538202 -0.843299 0.677605 0.00442699 -0.85019 0.676866 0.00351935 -0.85677 0.676163 0.00265208 -0.863112 0.675558 0.00187969 -0.869785 0.675443 0.00177298 -0.878117 0.675405 0.00174214 -0.89197 0.675384 0.00172526 -0.918769 0.675382 0.00172695 -0.970355 0.675401 0.00175236 -1.06418 0.675423 0.00176728 -1.22491 0.675424 0.00174441 -1.48653 0.67541 0.00171906 -1.8949 0.675399 0.00172251 -2.51122 0.675403 0.00175828 -3.41629 0.675426 0.00183725 -4.7159 0.67602 0.000944618 -0.508335 0.69172 -0.0238845 -0.494533 0.691158 -0.0231874 -0.481448 0.690534 -0.0223971 -0.469143 0.689854 -0.0215206 -0.457674 0.689125 -0.0205651 -0.447084 0.688357 -0.0195401 -0.437407 0.687559 -0.0184594 -0.428667 0.686748 -0.0173418 -0.420872 0.685939 -0.0162072 -0.414006 0.68514 -0.0150649 -0.407978 0.684288 -0.0138179 -0.402683 0.683264 -0.0122811 -0.398099 0.682008 -0.0103642 -0.394249 0.680561 -0.00811556 -0.391134 0.679003 -0.0056112 -0.388807 0.677436 -0.00286454 -0.387724 0.67633 1.5e-08 -0.388807 0.677436 0.00286459 -0.391134 0.679003 0.00561126 -0.394249 0.680561 0.00811564 -0.398099 0.682008 0.0103643 -0.402683 0.683263 0.0122812 -0.407978 0.684288 0.013818 -0.414006 0.68514 0.0150649 -0.420872 0.685939 0.0162073 -0.428667 0.686748 0.0173418 -0.437407 0.687559 0.0184595 -0.447084 0.688356 0.0195401 -0.457674 0.689125 0.0205652 -0.469143 0.689853 0.0215207 -0.481448 0.690533 0.0223972 -0.494533 0.691158 0.0231875 -0.508335 0.69172 0.0238846 -0.522782 0.69221 0.0244789 -0.537791 0.692617 0.0249564 -0.553273 0.692924 0.0252994 -0.569132 0.693113 0.0254872 -0.585267 0.693166 0.0254997 -0.601577 0.693068 0.0253213 -0.617961 0.692812 0.0249446 -0.634322 0.692397 0.0243729 -0.650567 0.691835 0.023621 -0.666612 0.691144 0.0227136 -0.682375 0.690348 0.0216822 -0.697781 0.689473 0.0205608 -0.71276 0.688546 0.0193813 -0.727247 0.687588 0.0181706 -0.74118 0.686615 0.0169488 -0.754504 0.685638 0.015729 -0.767173 0.684664 0.0145189 -0.77915 0.683697 0.0133233 -0.790409 0.682741 0.0121459 -0.800939 0.681801 0.0109917 -0.810747 0.680881 0.00986703 -0.819853 0.67999 0.00877934 -0.828298 0.679133 0.00773623 -0.836142 0.678317 0.00674389 -0.843464 0.677545 0.00580582 -0.850362 0.676817 0.00492029 -0.856942 0.676141 0.00409024 -0.863246 0.675597 0.00340128 -0.869874 0.67543 0.0032258 -0.878236 0.675363 0.0031595 -0.892105 0.675325 0.00311703 -0.918904 0.675322 0.00310261 -0.970497 0.675357 0.00312908 -1.06434 0.675395 0.00314702 -1.2251 0.675396 0.00310635 -1.48675 0.67537 0.00306053 -1.89518 0.67535 0.00306354 -2.51153 0.675357 0.00312065 -3.41658 0.6754 0.00324479 -4.7159 0.676417 0.00157857 -0.50824 0.691605 -0.025551 -0.494427 0.691036 -0.0248035 -0.481331 0.690404 -0.0239584 -0.469017 0.689716 -0.0230232 -0.457539 0.68898 -0.0220049 -0.446941 0.688205 -0.0209136 -0.437259 0.687403 -0.0197629 -0.428517 0.686589 -0.0185708 -0.420726 0.685778 -0.0173552 -0.413863 0.684976 -0.0161181 -0.407824 0.684126 -0.014768 -0.40249 0.683127 -0.0131388 -0.397834 0.681921 -0.011138 -0.393879 0.680534 -0.00878692 -0.39064 0.679035 -0.0061265 -0.388222 0.677544 -0.00314168 -0.387191 0.676615 3e-08 -0.388222 0.677544 0.00314176 -0.39064 0.679034 0.00612662 -0.393879 0.680534 0.00878706 -0.397834 0.681921 0.0111381 -0.402491 0.683126 0.0131389 -0.407824 0.684126 0.0147681 -0.413863 0.684975 0.0161182 -0.420726 0.685778 0.0173553 -0.428517 0.686589 0.0185709 -0.437259 0.687403 0.0197631 -0.446941 0.688205 0.0209137 -0.457539 0.68898 0.0220051 -0.469017 0.689716 0.0230233 -0.481331 0.690403 0.0239586 -0.494427 0.691036 0.0248037 -0.50824 0.691605 0.0255512 -0.522699 0.692102 0.0261917 -0.537722 0.692513 0.0267117 -0.553219 0.692823 0.0270937 -0.569095 0.693013 0.0273178 -0.585249 0.693067 0.0273648 -0.601579 0.692969 0.0272199 -0.617984 0.692712 0.0268762 -0.634365 0.692297 0.0263374 -0.650631 0.691735 0.0256185 -0.666694 0.691043 0.0247438 -0.682474 0.690247 0.0237446 -0.697895 0.689373 0.0226541 -0.712887 0.688445 0.0215039 -0.727385 0.687486 0.0203206 -0.741329 0.686511 0.019124 -0.754664 0.685532 0.0179274 -0.767344 0.684554 0.016739 -0.779332 0.683584 0.0155642 -0.790603 0.682625 0.0144074 -0.801147 0.681681 0.0132742 -0.810969 0.680761 0.0121716 -0.82009 0.67987 0.0111078 -0.828551 0.679017 0.0100907 -0.836411 0.678207 0.00912724 -0.843749 0.677447 0.00822219 -0.850661 0.67674 0.00737861 -0.857243 0.676104 0.00661256 -0.863511 0.675619 0.00601514 -0.870103 0.675405 0.00576834 -0.878508 0.675295 0.00564062 -0.892401 0.67523 0.00554677 -0.919185 0.675225 0.0054911 -0.970773 0.675285 0.0055019 -1.06464 0.67535 0.00551518 -1.22544 0.675352 0.00544395 -1.48715 0.675306 0.00536344 -1.89565 0.675272 0.00536362 -2.51206 0.675284 0.0054524 -3.41708 0.675359 0.00564197 -4.7159 0.677083 0.00262128 -0.508056 0.69143 -0.028295 -0.494223 0.690851 -0.0274569 -0.481108 0.690207 -0.0265143 -0.468776 0.689508 -0.0254747 -0.457281 0.688761 -0.0243459 -0.446668 0.687977 -0.023138 -0.436974 0.687169 -0.0218648 -0.428224 0.686351 -0.020543 -0.420429 0.685539 -0.0191875 -0.413558 0.684735 -0.017793 -0.407491 0.683891 -0.0162751 -0.402095 0.682926 -0.0144892 -0.397329 0.681784 -0.0123397 -0.393222 0.680475 -0.00981399 -0.389809 0.679055 -0.00690597 -0.38726 0.677666 -0.00356141 -0.386245 0.676895 6e-08 -0.38726 0.677666 0.00356157 -0.389809 0.679055 0.00690618 -0.393222 0.680475 0.00981423 -0.39733 0.681783 0.01234 -0.402095 0.682925 0.0144894 -0.407491 0.683891 0.0162753 -0.413558 0.684734 0.0177932 -0.420429 0.685538 0.0191877 -0.428224 0.68635 0.0205433 -0.436974 0.687168 0.0218651 -0.446668 0.687976 0.0231383 -0.457281 0.68876 0.0243462 -0.468776 0.689507 0.0254751 -0.481109 0.690206 0.0265147 -0.494223 0.69085 0.0274574 -0.508056 0.691429 0.0282955 -0.522536 0.691935 0.0290195 -0.537582 0.692353 0.0296164 -0.553105 0.692667 0.0300696 -0.569009 0.69286 0.0303607 -0.585194 0.692914 0.0304715 -0.601557 0.692816 0.0303888 -0.617996 0.692558 0.0301065 -0.634413 0.692142 0.0296291 -0.650712 0.691579 0.0289717 -0.666807 0.690887 0.0281583 -0.682615 0.690091 0.0272194 -0.698061 0.689215 0.0261874 -0.713076 0.688287 0.0250931 -0.727594 0.687325 0.0239623 -0.741557 0.686347 0.0228148 -0.754911 0.685363 0.0216641 -0.76761 0.68438 0.0205191 -0.77962 0.683404 0.0193862 -0.790914 0.682439 0.018271 -0.801483 0.681491 0.0171803 -0.811332 0.680569 0.0161218 -0.820482 0.67968 0.0151044 -0.828974 0.678832 0.0141368 -0.836866 0.678035 0.0132268 -0.844237 0.677294 0.0123811 -0.851179 0.676619 0.0116085 -0.857777 0.676033 0.0109321 -0.864043 0.675592 0.0104137 -0.870648 0.675347 0.0101106 -0.879122 0.675187 0.00989725 -0.893046 0.675084 0.00971284 -0.919783 0.675075 0.00956898 -0.971326 0.675175 0.00952333 -1.0652 0.675287 0.00950893 -1.22605 0.675289 0.00938505 -1.48785 0.675211 0.00924754 -1.89646 0.675153 0.0092399 -2.51295 0.675175 0.00937402 -3.41791 0.675305 0.0096542 -4.7159 0.678194 0.00433471 -0.507684 0.691175 -0.0327396 -0.493815 0.690581 -0.0317438 -0.480667 0.689921 -0.0306321 -0.468301 0.689206 -0.0294128 -0.456773 0.688444 -0.0280944 -0.44613 0.687648 -0.0266876 -0.436408 0.686831 -0.0252061 -0.427633 0.686009 -0.0236653 -0.419812 0.685196 -0.0220766 -0.412906 0.684394 -0.0204294 -0.406778 0.683564 -0.0186471 -0.401277 0.682639 -0.0166034 -0.396352 0.681571 -0.0141973 -0.392029 0.680356 -0.011377 -0.388376 0.679037 -0.00807751 -0.38564 0.677766 -0.00419251 -0.384589 0.67711 1.23e-07 -0.38564 0.677766 0.00419281 -0.388376 0.679036 0.00807789 -0.392029 0.680356 0.0113775 -0.396352 0.68157 0.0141978 -0.401277 0.682638 0.0166038 -0.406778 0.683563 0.0186476 -0.412907 0.684392 0.0204298 -0.419812 0.685195 0.0220771 -0.427633 0.686008 0.0236658 -0.436408 0.68683 0.0252066 -0.44613 0.687646 0.0266882 -0.456773 0.688442 0.0280951 -0.468301 0.689204 0.0294136 -0.480667 0.68992 0.0306329 -0.493816 0.690579 0.0317446 -0.507684 0.691174 0.0327406 -0.522201 0.691692 0.0336112 -0.537287 0.692119 0.0343443 -0.552853 0.69244 0.0349247 -0.568804 0.692636 0.0353357 -0.58504 0.692692 0.0355616 -0.601458 0.692593 0.035591 -0.617953 0.692333 0.0354198 -0.634426 0.691916 0.0350534 -0.65078 0.691351 0.0345071 -0.666927 0.690658 0.0338045 -0.682783 0.68986 0.0329748 -0.698272 0.688984 0.0320492 -0.713327 0.688052 0.0310569 -0.727881 0.687087 0.030023 -0.741879 0.686102 0.028967 -0.755268 0.68511 0.027903 -0.768005 0.684118 0.026841 -0.780054 0.683132 0.0257888 -0.791392 0.682159 0.0247536 -0.802009 0.681206 0.0237435 -0.81191 0.680281 0.0227672 -0.821118 0.679395 0.0218341 -0.829674 0.678557 0.0209533 -0.837635 0.677777 0.0201331 -0.845079 0.677064 0.0193814 -0.852094 0.676428 0.0187079 -0.858764 0.675887 0.0181279 -0.865117 0.675472 0.0176662 -0.871833 0.675213 0.0173252 -0.880437 0.675014 0.017019 -0.89442 0.674872 0.0167015 -0.921053 0.674862 0.0163963 -0.972456 0.675025 0.0162126 -1.06627 0.675211 0.0161155 -1.22715 0.675217 0.0159005 -1.48906 0.675086 0.0156725 -1.89783 0.674991 0.0156478 -2.51445 0.67503 0.015844 -3.41929 0.675254 0.0162424 -4.7159 0.680041 0.00714858 -0.506908 0.690834 -0.0398145 -0.492974 0.690219 -0.0385513 -0.479761 0.689536 -0.0371555 -0.467331 0.688798 -0.0356359 -0.45574 0.688016 -0.034002 -0.445032 0.687203 -0.0322658 -0.435247 0.686375 -0.0304409 -0.426407 0.685547 -0.0285419 -0.418513 0.684734 -0.0265777 -0.411516 0.683937 -0.0245356 -0.405265 0.683128 -0.0223448 -0.399594 0.682251 -0.0198873 -0.394438 0.68126 -0.0170512 -0.389825 0.680144 -0.0137418 -0.385852 0.678933 -0.00982567 -0.382854 0.677774 -0.00513129 -0.381703 0.677176 2.54e-07 -0.382854 0.677773 0.00513188 -0.385852 0.678933 0.00982638 -0.389825 0.680143 0.0137426 -0.394438 0.681259 0.0170521 -0.399594 0.682249 0.0198881 -0.405265 0.683127 0.0223456 -0.411516 0.683936 0.0245364 -0.418513 0.684732 0.0265785 -0.426407 0.685545 0.0285429 -0.435247 0.686373 0.030442 -0.445033 0.687201 0.0322669 -0.45574 0.688014 0.0340033 -0.467331 0.688796 0.0356372 -0.479761 0.689534 0.037157 -0.492974 0.690216 0.038553 -0.506908 0.690831 0.0398163 -0.521492 0.691367 0.0409375 -0.536648 0.691809 0.0419052 -0.552288 0.692139 0.0427062 -0.568319 0.692341 0.0433268 -0.584639 0.692399 0.0437544 -0.601144 0.6923 0.0439808 -0.61773 0.692039 0.0440044 -0.634293 0.69162 0.0438322 -0.650736 0.691054 0.0434796 -0.666967 0.690359 0.0429696 -0.682903 0.689559 0.0423299 -0.698468 0.688679 0.0415895 -0.713592 0.687743 0.0407761 -0.728215 0.68677 0.0399134 -0.74228 0.685776 0.0390208 -0.755738 0.684772 0.038113 -0.768548 0.683766 0.0372014 -0.780677 0.682767 0.0362956 -0.792104 0.681783 0.0354044 -0.802819 0.680822 0.0345368 -0.81283 0.679895 0.0337018 -0.822161 0.679013 0.0329081 -0.830852 0.678187 0.0321636 -0.838964 0.677427 0.0314748 -0.846572 0.676742 0.0308466 -0.853767 0.676137 0.0302823 -0.860637 0.675624 0.0297845 -0.867225 0.675225 0.0293585 -0.874204 0.674965 0.0289875 -0.883069 0.674756 0.0285944 -0.897198 0.674601 0.0281162 -0.923687 0.674606 0.0275633 -0.974769 0.674863 0.027108 -1.06836 0.675165 0.0268177 -1.22919 0.675183 0.0264454 -1.4912 0.674976 0.0260787 -1.90017 0.674823 0.0260216 -2.51694 0.674894 0.0262985 -3.42154 0.675273 0.0268386 -4.7159 0.683107 0.0117677 -0.505252 0.690455 -0.0508714 -0.491195 0.689809 -0.0491686 -0.477858 0.689094 -0.047309 -0.465303 0.688324 -0.0453023 -0.453584 0.687513 -0.0431597 -0.442745 0.686675 -0.0408942 -0.432821 0.685828 -0.0385207 -0.423833 0.684989 -0.0360536 -0.415774 0.684172 -0.0335019 -0.408585 0.683384 -0.0308529 -0.402109 0.682599 -0.0280349 -0.396169 0.681767 -0.0249237 -0.390689 0.680845 -0.0213868 -0.385697 0.679816 -0.017283 -0.381321 0.678693 -0.0124046 -0.377978 0.677599 -0.00650537 -0.376663 0.676991 5.26e-07 -0.377978 0.677598 0.00650654 -0.381321 0.678692 0.0124059 -0.385697 0.679814 0.0172844 -0.390689 0.680843 0.0213884 -0.396169 0.681765 0.0249253 -0.402109 0.682596 0.0280364 -0.408586 0.683381 0.0308545 -0.415774 0.684169 0.0335036 -0.423833 0.684986 0.0360554 -0.432821 0.685824 0.0385226 -0.442745 0.686671 0.0408963 -0.453583 0.687509 0.043162 -0.465303 0.68832 0.0453048 -0.477858 0.68909 0.0473117 -0.491195 0.689805 0.0491716 -0.505252 0.69045 0.0508746 -0.519961 0.691013 0.0524114 -0.535243 0.691477 0.0537717 -0.551014 0.691824 0.0549452 -0.567179 0.692037 0.0559217 -0.583639 0.692102 0.0566928 -0.600288 0.692007 0.0572544 -0.61702 0.691749 0.0576082 -0.633729 0.69133 0.0577632 -0.650317 0.690765 0.0577354 -0.66669 0.69007 0.0575468 -0.682764 0.689268 0.0572231 -0.698463 0.688385 0.056791 -0.713719 0.687443 0.056276 -0.728474 0.686461 0.0557009 -0.742674 0.685454 0.0550843 -0.756276 0.684435 0.0544417 -0.769241 0.683413 0.0537857 -0.78154 0.682399 0.0531267 -0.793155 0.681401 0.052474 -0.804081 0.680431 0.0518357 -0.814326 0.6795 0.0512189 -0.823918 0.678621 0.0506294 -0.832899 0.677802 0.050071 -0.841329 0.677055 0.0495454 -0.849286 0.676384 0.0490521 -0.856859 0.675795 0.0485885 -0.864141 0.675296 0.0481512 -0.871177 0.674908 0.0477397 -0.878628 0.674665 0.0473313 -0.887965 0.674481 0.0468479 -0.90244 0.674364 0.0461939 -0.928855 0.674436 0.0453232 -0.979398 0.674831 0.0444304 -1.07243 0.675301 0.0437643 -1.23297 0.67535 0.0431268 -1.49498 0.675037 0.0425579 -1.90415 0.674805 0.0424458 -2.52104 0.67493 0.0428203 -3.42514 0.675561 0.0435068 -4.7159 0.688194 0.0193481 -0.5017 0.690253 -0.0678223 -0.487405 0.689558 -0.0654184 -0.473826 0.688792 -0.0628243 -0.461024 0.68797 -0.060051 -0.449048 0.68711 -0.0571111 -0.437942 0.686229 -0.0540195 -0.427737 0.685346 -0.050793 -0.418448 0.684478 -0.0474474 -0.410066 0.683644 -0.0439929 -0.402528 0.682852 -0.040415 -0.395675 0.682079 -0.0366316 -0.38933 0.681275 -0.0324972 -0.38341 0.680393 -0.0278466 -0.377946 0.679404 -0.0224876 -0.373092 0.678304 -0.0161368 -0.369334 0.677179 -0.00847135 -0.367803 0.676476 1.083e-06 -0.369334 0.677178 0.00847366 -0.373092 0.678303 0.0161393 -0.377946 0.679401 0.0224904 -0.38341 0.68039 0.0278494 -0.38933 0.681272 0.0325002 -0.395675 0.682075 0.0366346 -0.402528 0.682847 0.0404181 -0.410066 0.683639 0.0439962 -0.418448 0.684473 0.0474509 -0.427736 0.685339 0.0507967 -0.437941 0.686223 0.0540235 -0.449047 0.687103 0.0571154 -0.461023 0.687963 0.0600557 -0.473826 0.688784 0.0628294 -0.487404 0.68955 0.0654238 -0.501699 0.690245 0.0678283 -0.516643 0.690853 0.0700334 -0.53216 0.691356 0.0720307 -0.548167 0.691737 0.0738127 -0.564571 0.691979 0.0753732 -0.581272 0.692066 0.0767089 -0.598165 0.69199 0.0778201 -0.615144 0.691748 0.0787121 -0.632101 0.691343 0.0793962 -0.648938 0.69079 0.0798891 -0.66556 0.690105 0.0802118 -0.681883 0.689312 0.0803881 -0.697835 0.688434 0.0804424 -0.71335 0.687492 0.0803981 -0.728373 0.686506 0.0802763 -0.742858 0.685492 0.0800949 -0.756765 0.684463 0.0798688 -0.770061 0.683431 0.0796101 -0.782724 0.682405 0.0793281 -0.794739 0.681397 0.0790297 -0.806105 0.680419 0.0787199 -0.816833 0.679482 0.0784013 -0.826951 0.678598 0.0780746 -0.836501 0.677778 0.077739 -0.845539 0.67703 0.0773921 -0.85414 0.676361 0.0770305 -0.862391 0.675776 0.0766506 -0.870379 0.675286 0.0762487 -0.878146 0.674915 0.0758247 -0.886354 0.674709 0.0753532 -0.896466 0.674585 0.0747533 -0.91163 0.674564 0.073898 -0.938273 0.674775 0.0726697 -0.98821 0.675362 0.0712081 -1.08022 0.676051 0.0699434 -1.24 0.676163 0.0688885 -1.50169 0.67572 0.0680434 -1.9109 0.675385 0.0678485 -2.52774 0.675602 0.0683308 -3.43083 0.676639 0.0691237 -4.7159 0.696624 0.0317863 -0.494163 0.690878 -0.0932796 -0.479409 0.690089 -0.0897897 -0.465361 0.689226 -0.0860644 -0.452076 0.688308 -0.0821149 -0.439604 0.687354 -0.0779552 -0.427986 0.686383 -0.0736023 -0.417251 0.685416 -0.0690744 -0.407415 0.684476 -0.0643894 -0.398471 0.68358 -0.0595572 -0.390361 0.68274 -0.0545585 -0.382934 0.681933 -0.0492909 -0.376016 0.681102 -0.0435745 -0.369525 0.680187 -0.0372013 -0.363498 0.679142 -0.0299259 -0.358112 0.67794 -0.021391 -0.353903 0.676634 -0.0112054 -0.35212 0.675727 2.194e-06 -0.353903 0.676632 0.01121 -0.358112 0.677937 0.0213959 -0.363497 0.679138 0.0299311 -0.369524 0.680182 0.0372068 -0.376015 0.681096 0.0435801 -0.382933 0.681926 0.0492967 -0.39036 0.682732 0.0545644 -0.398469 0.683571 0.0595635 -0.407414 0.684466 0.064396 -0.41725 0.685407 0.0690814 -0.427984 0.686373 0.0736097 -0.439603 0.687343 0.0779632 -0.452074 0.688296 0.0821235 -0.465359 0.689214 0.0860736 -0.479407 0.690076 0.0897996 -0.494161 0.690864 0.0932903 -0.509556 0.691561 0.0965365 -0.525519 0.692148 0.0995318 -0.541967 0.692606 0.102272 -0.55881 0.692919 0.104753 -0.57595 0.693073 0.106979 -0.593284 0.693058 0.108951 -0.610706 0.692873 0.110681 -0.628113 0.692523 0.11218 -0.645405 0.69202 0.113466 -0.662492 0.691383 0.11456 -0.679295 0.690633 0.115483 -0.695743 0.689793 0.116257 -0.711778 0.688885 0.116904 -0.727351 0.687927 0.117442 -0.742421 0.686937 0.117887 -0.756956 0.685927 0.118251 -0.770928 0.68491 0.118545 -0.78432 0.683896 0.118773 -0.79712 0.682898 0.118939 -0.809327 0.681925 0.119043 -0.820953 0.680991 0.119084 -0.832018 0.680108 0.119059 -0.842559 0.679285 0.118965 -0.852627 0.678533 0.118798 -0.862287 0.677862 0.118557 -0.871622 0.677279 0.11824 -0.880714 0.676798 0.117846 -0.889599 0.676451 0.117378 -0.898958 0.676299 0.11681 -0.910275 0.67626 0.116059 -0.926641 0.676372 0.114974 -0.954118 0.676772 0.113384 -1.00383 0.677587 0.111336 -1.09451 0.678513 0.109329 -1.25281 0.678718 0.107706 -1.51355 0.678137 0.106523 -1.92233 0.677685 0.106223 -2.53863 0.678057 0.106809 -3.43971 0.679735 0.107578 -4.7159 0.71059 0.0521932 -0.478641 0.693974 -0.130604 -0.463021 0.692986 -0.125477 -0.448095 0.691922 -0.12005 -0.43392 0.690801 -0.114332 -0.420546 0.689646 -0.108339 -0.408019 0.688477 -0.102088 -0.396373 0.687319 -0.095601 -0.385632 0.686196 -0.0888953 -0.375798 0.685131 -0.0819812 -0.36683 0.684136 -0.0748321 -0.358589 0.683186 -0.0673195 -0.350906 0.682207 -0.05922 -0.343705 0.681116 -0.0502783 -0.33703 0.679847 -0.0401962 -0.331074 0.678346 -0.0285495 -0.326396 0.676655 -0.0148918 -0.324333 0.675412 4.341e-06 -0.326396 0.676652 0.0149008 -0.331073 0.678342 0.0285589 -0.337028 0.679841 0.0402061 -0.343703 0.681109 0.0502885 -0.350904 0.682198 0.0592306 -0.358586 0.683176 0.0673304 -0.366827 0.684125 0.0748434 -0.375795 0.685118 0.081993 -0.385628 0.686181 0.0889077 -0.396369 0.687303 0.0956141 -0.408015 0.68846 0.102102 -0.420542 0.689627 0.108354 -0.433915 0.690782 0.114348 -0.44809 0.691901 0.120067 -0.463017 0.692964 0.125496 -0.478637 0.69395 0.130623 -0.494886 0.694841 0.135442 -0.511693 0.695616 0.139946 -0.528977 0.696256 0.144135 -0.546651 0.696745 0.148008 -0.564621 0.697068 0.15157 -0.582787 0.697217 0.154829 -0.601049 0.697191 0.157795 -0.619309 0.696994 0.160483 -0.637473 0.696639 0.162911 -0.655458 0.696144 0.165097 -0.673189 0.695529 0.167063 -0.690605 0.694817 0.168827 -0.707654 0.694029 0.170408 -0.724293 0.693182 0.171822 -0.740487 0.692294 0.173083 -0.756208 0.691376 0.174199 -0.771431 0.690441 0.175178 -0.786139 0.689499 0.176023 -0.80032 0.68856 0.176734 -0.813968 0.687635 0.177311 -0.827087 0.686736 0.177751 -0.839692 0.685876 0.178052 -0.851809 0.685066 0.178212 -0.863482 0.68432 0.178232 -0.874771 0.683649 0.178112 -0.885751 0.683067 0.177855 -0.896504 0.682591 0.177465 -0.907065 0.682263 0.176948 -0.91815 0.682169 0.176278 -0.931306 0.682218 0.175376 -0.949631 0.682461 0.174081 -0.978903 0.683041 0.1722 -1.02943 0.684054 0.16971 -1.11916 0.685163 0.167055 -1.2754 0.685458 0.164844 -1.53423 0.684765 0.163329 -1.94159 0.684214 0.162928 -2.55623 0.684841 0.163592 -3.45343 0.687519 0.164039 -4.7159 0.733715 0.085672 -0.448174 0.703142 -0.183728 -0.431006 0.701736 -0.176197 -0.414536 0.700251 -0.168265 -0.398826 0.698708 -0.159944 -0.383934 0.697132 -0.151249 -0.369916 0.695547 -0.142201 -0.356819 0.69398 -0.132823 -0.344683 0.692461 -0.123137 -0.333529 0.691017 -0.113156 -0.323334 0.689665 -0.102846 -0.313974 0.688369 -0.0920525 -0.305286 0.687031 -0.0805041 -0.297193 0.685536 -0.0678976 -0.289748 0.683793 -0.0538873 -0.283148 0.681731 -0.0379901 -0.277956 0.67941 -0.0197165 -0.275572 0.677687 8.312e-06 -0.277955 0.679407 0.0197335 -0.283146 0.681725 0.0380077 -0.289745 0.683784 0.0539056 -0.29719 0.685525 0.0679166 -0.305282 0.687017 0.0805237 -0.313969 0.688354 0.0920728 -0.323328 0.689648 0.102867 -0.333522 0.690998 0.113178 -0.344676 0.692439 0.12316 -0.356811 0.693956 0.132847 -0.369908 0.69552 0.142227 -0.383925 0.697103 0.151277 -0.398817 0.698677 0.159973 -0.414527 0.700217 0.168296 -0.430997 0.7017 0.17623 -0.448165 0.703103 0.183763 -0.465962 0.704405 0.190888 -0.484316 0.705585 0.197601 -0.503146 0.706623 0.203902 -0.522368 0.707501 0.209793 -0.541891 0.708205 0.21528 -0.561621 0.708725 0.220374 -0.581465 0.70906 0.225085 -0.601331 0.709213 0.229429 -0.621134 0.709197 0.233423 -0.640797 0.709027 0.237085 -0.660256 0.708724 0.240435 -0.679453 0.708307 0.243492 -0.698343 0.707796 0.246272 -0.716887 0.707209 0.248793 -0.735054 0.706561 0.251066 -0.752815 0.705861 0.253101 -0.770146 0.705121 0.254908 -0.787027 0.70435 0.256489 -0.80344 0.703556 0.257849 -0.819374 0.702749 0.258989 -0.834825 0.701941 0.25991 -0.849801 0.701147 0.260615 -0.864321 0.70038 0.261104 -0.878423 0.699655 0.261383 -0.892162 0.698991 0.261456 -0.905617 0.698405 0.26133 -0.918868 0.697923 0.261014 -0.931953 0.6976 0.260514 -0.94565 0.697557 0.259808 -0.961615 0.697681 0.258832 -0.98304 0.698029 0.257442 -1.01554 0.698739 0.255455 -1.06865 0.699866 0.25283 -1.15903 0.701044 0.249913 -1.31355 0.701395 0.24738 -1.5695 0.700666 0.245701 -1.97385 0.700108 0.245276 -2.58471 0.701157 0.245963 -3.47459 0.705406 0.245484 -4.7159 0.772001 0.140595 -0.391722 0.725263 -0.257152 -0.371959 0.723058 -0.246181 -0.352941 0.720772 -0.234663 -0.334742 0.718432 -0.222613 -0.317436 0.716065 -0.210049 -0.301093 0.713701 -0.196998 -0.285781 0.711375 -0.183489 -0.271558 0.709122 -0.169552 -0.258469 0.706978 -0.155206 -0.246511 0.704963 -0.140416 -0.235572 0.70303 -0.125 -0.225488 0.701043 -0.108644 -0.216182 0.698849 -0.0909989 -0.207707 0.696334 -0.0716794 -0.200267 0.693423 -0.0501527 -0.194424 0.690229 -0.0258976 -0.191652 0.687892 1.5272e-05 -0.194422 0.690225 0.0259286 -0.200263 0.693416 0.0501847 -0.207703 0.696323 0.0717126 -0.216176 0.698835 0.0910333 -0.22548 0.701025 0.108679 -0.235562 0.703009 0.125037 -0.2465 0.704938 0.140455 -0.258457 0.70695 0.155246 -0.271545 0.709091 0.169594 -0.285767 0.71134 0.183534 -0.301079 0.713663 0.197046 -0.317421 0.716022 0.2101 -0.334726 0.718385 0.222666 -0.352925 0.720721 0.23472 -0.371943 0.723002 0.246241 -0.391707 0.725202 0.257216 -0.412139 0.727296 0.267636 -0.43316 0.72926 0.277498 -0.454685 0.73107 0.286801 -0.476629 0.732705 0.295549 -0.4989 0.734149 0.30375 -0.521407 0.735391 0.311413 -0.544061 0.736425 0.318552 -0.566775 0.737253 0.325183 -0.58947 0.737886 0.331323 -0.612074 0.738336 0.336993 -0.634527 0.738623 0.342213 -0.656777 0.738764 0.347005 -0.678781 0.738778 0.351389 -0.700502 0.73868 0.355384 -0.72191 0.738482 0.359009 -0.742977 0.738195 0.362277 -0.763677 0.737826 0.365203 -0.783985 0.737383 0.367796 -0.803881 0.736872 0.370065 -0.823349 0.736304 0.372019 -0.842381 0.735691 0.373663 -0.860978 0.735046 0.375004 -0.879157 0.734388 0.37605 -0.896955 0.733736 0.376809 -0.914428 0.733113 0.37729 -0.931658 0.732545 0.377504 -0.948736 0.732069 0.377461 -0.965705 0.731759 0.377167 -0.983438 0.731784 0.376602 -1.00376 0.731994 0.375744 -1.03005 0.732448 0.374489 -1.0679 0.733269 0.372706 -1.12625 0.734462 0.370383 -1.22029 0.735653 0.367801 -1.37525 0.736078 0.365538 -1.62838 0.735508 0.364115 -2.02772 0.735189 0.363869 -2.63112 0.736973 0.364472 -3.5075 0.743815 0.361877 -4.7159 0.835378 0.230697 -0.292003 0.77259 -0.357659 -0.268078 0.769027 -0.341849 -0.245014 0.765393 -0.325292 -0.222904 0.76172 -0.308004 -0.201839 0.758044 -0.290013 -0.181913 0.754405 -0.271349 -0.163216 0.750846 -0.252052 -0.14583 0.747415 -0.232164 -0.129826 0.744156 -0.211712 -0.115222 0.7411 -0.190667 -0.10192 0.738182 -0.168825 -0.0897492 0.735219 -0.145836 -0.0786284 0.732015 -0.12132 -0.068617 0.728435 -0.0948594 -0.0599333 0.72442 -0.0658851 -0.0531636 0.72016 -0.0338571 -0.0498902 0.717118 2.6804e-05 -0.0531607 0.720156 0.0339115 -0.0599275 0.724411 0.065941 -0.0686088 0.728422 0.0949174 -0.0786176 0.731997 0.12138 -0.0897362 0.735197 0.145899 -0.101904 0.738156 0.168891 -0.115205 0.741069 0.190736 -0.129807 0.74412 0.211785 -0.14581 0.747373 0.23224 -0.163194 0.750799 0.252134 -0.18189 0.754352 0.271436 -0.201816 0.757984 0.290105 -0.222879 0.761653 0.308103 -0.244989 0.765319 0.325397 -0.268054 0.768946 0.341962 -0.29198 0.7725 0.35778 -0.316677 0.775949 0.372841 -0.34205 0.77926 0.38714 -0.368006 0.782403 0.400679 -0.39445 0.785351 0.413461 -0.421285 0.788081 0.425497 -0.448416 0.790576 0.436797 -0.475751 0.792825 0.447378 -0.503204 0.794827 0.457256 -0.530695 0.796588 0.466454 -0.558155 0.798118 0.474995 -0.585524 0.799433 0.482903 -0.612751 0.80055 0.490206 -0.639797 0.801484 0.496929 -0.666625 0.80225 0.503098 -0.693205 0.802858 0.508739 -0.719511 0.803315 0.513875 -0.745516 0.803629 0.518526 -0.771197 0.803803 0.522711 -0.796531 0.803844 0.526448 -0.821502 0.803761 0.529751 -0.8461 0.803564 0.532634 -0.870329 0.803271 0.53511 -0.894206 0.802902 0.537192 -0.917771 0.802482 0.538892 -0.941091 0.80204 0.540224 -0.964261 0.801611 0.541201 -0.987387 0.801247 0.541834 -1.01053 0.801049 0.542125 -1.0347 0.801253 0.542054 -1.06195 0.801661 0.541672 -1.096 0.802332 0.540946 -1.14255 0.803374 0.53983 -1.21011 0.804752 0.538379 -1.31249 0.806106 0.536851 -1.4725 0.806854 0.53567 -1.72516 0.806885 0.535186 -2.11791 0.807364 0.535483 -2.70802 0.810573 0.535742 -3.55984 0.822106 0.528694 -4.7159 0.94028 0.378513 -0.120192 0.867146 -0.499267 -0.0896205 0.861446 -0.476602 -0.0601136 0.855698 -0.452906 -0.0317894 0.849949 -0.428199 -0.00476814 0.844248 -0.402508 --0.0208282 0.838649 -0.375872 --0.0448777 0.833208 -0.348341 --0.0672628 0.82799 -0.319966 --0.0878812 0.823056 -0.290789 --0.10668 0.818447 -0.260787 --0.123744 0.814084 -0.22975 --0.139242 0.809731 -0.197313 --0.153256 0.805145 -0.163078 --0.165706 0.800183 -0.126611 --0.176334 0.794821 -0.087323 --0.184491 0.789353 -0.0446698 --0.188439 0.78556 4.5038e-05 --0.184496 0.789348 0.044761 --0.176342 0.794811 0.0874169 --0.165718 0.800169 0.126709 --0.153273 0.805126 0.16318 --0.139262 0.809706 0.19742 --0.123767 0.814053 0.229864 --0.106706 0.81841 0.260908 --0.0879096 0.823012 0.290918 --0.0672931 0.827939 0.320104 --0.0449093 0.833149 0.348489 --0.0208605 0.838581 0.376032 -0.00473581 0.844171 0.40268 -0.0317578 0.849861 0.428385 -0.0600837 0.855599 0.453107 -0.0895932 0.861334 0.476819 -0.120168 0.867022 0.499501 -0.151694 0.872615 0.521145 -0.184056 0.87807 0.541747 -0.217142 0.883346 0.561314 -0.250841 0.888403 0.579854 -0.285044 0.893208 0.597382 -0.319646 0.897735 0.613913 -0.354547 0.901966 0.62947 -0.389654 0.905893 0.644074 -0.424885 0.909514 0.657752 -0.460166 0.912838 0.670534 -0.495437 0.915875 0.682449 -0.530648 0.91864 0.693533 -0.56576 0.921146 0.703818 -0.60074 0.923405 0.713339 -0.635562 0.925425 0.722131 -0.670202 0.927211 0.730226 -0.704639 0.928768 0.737655 -0.738854 0.930097 0.744447 -0.77283 0.931202 0.750628 -0.806557 0.932091 0.756222 -0.840032 0.932774 0.761252 -0.873266 0.933269 0.765737 -0.906289 0.9336 0.769696 -0.939155 0.933797 0.773149 -0.971951 0.933898 0.776112 -1.0048 0.933948 0.778602 -1.03784 0.934016 0.780631 -1.07117 0.934238 0.782184 -1.10598 0.934939 0.783242 -1.14468 0.935867 0.783966 -1.19141 0.937091 0.784426 -1.25212 0.938718 0.784679 -1.33504 0.94069 0.784859 -1.45269 0.942708 0.785214 -1.62497 0.944407 0.785995 -1.88253 0.945888 0.787222 -2.26844 0.948318 0.788417 -2.83649 0.954655 0.787506 -3.64438 0.975252 0.772005 -4.7159 1.1139 0.621015 --0.17359 1.04862 -0.71201 --0.215105 1.03947 -0.679239 --0.255232 1.0303 -0.644989 --0.293809 1.02117 -0.609273 --0.330668 1.01216 -0.572118 --0.365639 1.00334 -0.533564 --0.398545 0.994795 -0.493663 --0.429213 0.986616 -0.45248 --0.457484 0.978895 -0.410068 --0.48325 0.971698 -0.366421 --0.506553 0.964941 -0.321345 --0.52754 0.958347 -0.274493 --0.546266 0.951643 -0.225484 --0.562601 0.944704 -0.17389 --0.576215 0.937572 -0.119126 --0.586364 0.930681 -0.0606743 --0.591153 0.92611 7.151e-05 --0.586371 0.930677 0.0608191 --0.576228 0.937563 0.119276 --0.562619 0.94469 0.174047 --0.546289 0.951624 0.225649 --0.527568 0.958322 0.27467 --0.506584 0.964909 0.321534 --0.483284 0.971659 0.366625 --0.45752 0.978848 0.410289 --0.42925 0.986559 0.452721 --0.398581 0.994728 0.493926 --0.365673 1.00326 0.533851 --0.330699 1.01207 0.572433 --0.293834 1.02107 0.609618 --0.255249 1.03018 0.645365 --0.215113 1.03933 0.67965 --0.173587 1.04846 0.712459 --0.130826 1.0575 0.74379 --0.0869787 1.06639 0.773654 --0.0421899 1.07507 0.802067 -0.00340274 1.08349 0.829052 -0.0496678 1.09161 0.854637 -0.0964813 1.09938 0.878853 -0.143729 1.10678 0.901732 -0.191305 1.11378 0.923311 -0.239122 1.1204 0.943628 -0.2871 1.12662 0.962722 -0.335179 1.13246 0.980638 -0.38331 1.13792 0.997419 -0.431459 1.14302 1.01311 -0.479602 1.14777 1.02777 -0.52772 1.15218 1.04143 -0.575805 1.15624 1.05414 -0.623848 1.15996 1.06594 -0.671848 1.16334 1.07689 -0.719806 1.16639 1.08701 -0.767732 1.1691 1.09634 -0.815647 1.17149 1.10492 -0.863586 1.17358 1.11277 -0.911611 1.17539 1.11992 -0.95981 1.17696 1.1264 -1.00832 1.17834 1.13223 -1.05731 1.17958 1.13742 -1.10699 1.18077 1.142 -1.15752 1.18209 1.14592 -1.21033 1.18396 1.14915 -1.26824 1.18608 1.152 -1.33584 1.18856 1.15466 -1.41936 1.19151 1.15727 -1.5266 1.19488 1.16001 -1.66855 1.1985 1.16307 -1.86164 1.2023 1.16644 -2.13028 1.20672 1.16967 -2.50894 1.21336 1.17134 -3.0421 1.22669 1.16717 -3.77615 1.26256 1.14056 -4.7159 1.40126 1.01887 --0.67261 1.38672 -1.05499 --0.73286 1.37138 -1.0063 --0.79121 1.35598 -0.955323 --0.847413 1.34064 -0.902069 --0.90121 1.32546 -0.846554 --0.952331 1.31058 -0.788817 --1.0005 1.29614 -0.728918 --1.04544 1.28229 -0.666932 --1.08688 1.26918 -0.602937 --1.12462 1.25696 -0.536965 --1.15858 1.24557 -0.468886 --1.18881 1.23477 -0.398436 --1.21529 1.22432 -0.32532 --1.23777 1.21417 -0.249183 --1.25583 1.2045 -0.169527 --1.26863 1.1959 -0.0859472 --1.2743 1.19064 9.897e-05 --1.26864 1.1959 0.0861478 --1.25584 1.20449 0.169735 --1.23779 1.21416 0.249403 --1.21531 1.22431 0.325555 --1.18884 1.23476 0.398691 --1.15861 1.24555 0.469164 --1.12465 1.25693 0.537271 --1.08691 1.26914 0.603275 --1.04546 1.28224 0.667306 --1.00052 1.29608 0.729334 --0.952336 1.31051 0.78928 --0.901201 1.32538 0.847069 --0.847386 1.34054 0.902641 --0.791161 1.35586 0.955958 --0.732784 1.37123 1.007 --0.672503 1.38655 1.05577 --0.610552 1.40171 1.10229 --0.547151 1.41662 1.14658 --0.482507 1.43121 1.1887 --0.416812 1.4454 1.22868 --0.350243 1.45913 1.2666 --0.282963 1.47234 1.30252 --0.215115 1.48502 1.33649 --0.146826 1.49713 1.36859 --0.0782009 1.50867 1.39888 --0.00932482 1.51964 1.42744 -0.0597388 1.53004 1.45434 -0.128947 1.5399 1.47964 -0.198275 1.54922 1.50342 -0.267715 1.55802 1.52576 -0.337273 1.56631 1.54672 -0.406965 1.5741 1.56639 -0.476818 1.5814 1.58482 -0.546868 1.5882 1.60207 -0.617158 1.59452 1.61822 -0.687746 1.60037 1.6333 -0.758706 1.60577 1.64738 -0.83013 1.61073 1.66049 -0.902144 1.61529 1.67267 -0.97491 1.6195 1.68396 -1.04864 1.6234 1.69439 -1.1236 1.62707 1.70399 -1.20012 1.63062 1.71276 -1.27845 1.63423 1.72065 -1.36022 1.6384 1.72761 -1.44846 1.64285 1.73406 -1.5479 1.6477 1.74027 -1.66439 1.65312 1.74641 -1.80464 1.65915 1.75259 -1.97729 1.66584 1.75881 -2.19448 1.67351 1.76474 -2.47351 1.68317 1.76941 -2.83846 1.69719 1.77067 -3.3205 1.72122 1.76361 -3.9497 1.76969 1.73691 -4.7159 1.87684 1.67161 --1.50544 2.02028 -1.65638 --1.60139 1.99267 -1.58091 --1.69463 1.96476 -1.50144 --1.78471 1.93677 -1.41796 --1.87112 1.90893 -1.33049 --1.95338 1.88148 -1.23909 --2.03096 1.85471 -1.14385 --2.10337 1.82893 -1.04491 --2.1701 1.80447 -0.942427 --2.23072 1.78161 -0.836538 --2.2849 1.76053 -0.727296 --2.33245 1.74118 -0.614687 --2.37309 1.72355 -0.49867 --2.40643 1.70781 -0.379163 --2.43191 1.69433 -0.255991 --2.44872 1.68385 -0.129102 --2.45537 1.67836 9.4788e-05 --2.44873 1.68385 0.129294 --2.43192 1.69433 0.256192 --2.40644 1.7078 0.379378 --2.3731 1.72354 0.498903 --2.33246 1.74118 0.614945 --2.28491 1.76053 0.727584 --2.23072 1.78161 0.836862 --2.17009 1.80445 0.942794 --2.10335 1.82892 1.04533 --2.03092 1.85469 1.14432 --1.95332 1.88145 1.23962 --1.87103 1.90888 1.3311 --1.78458 1.93672 1.41865 --1.69446 1.96469 1.50222 --1.60116 1.99257 1.58179 --1.50516 2.02017 1.65737 --1.40689 2.04729 1.729 --1.30677 2.07379 1.79678 --1.20519 2.09952 1.86079 --1.10251 2.1244 1.92115 --0.999037 2.14832 1.97801 --0.895071 2.17123 2.0315 --0.790858 2.19309 2.08178 --0.686614 2.21387 2.12901 --0.582515 2.23358 2.17335 --0.478705 2.25223 2.21495 --0.37529 2.26984 2.254 --0.272342 2.28643 2.29064 --0.169904 2.30205 2.32503 --0.0679882 2.31674 2.35733 -0.0334183 2.33053 2.38768 -0.134353 2.34346 2.41624 -0.234879 2.35558 2.44313 -0.335081 2.36691 2.46848 -0.435072 2.3775 2.49241 -0.534993 2.3874 2.51501 -0.63502 2.39666 2.53639 -0.735367 2.40531 2.55662 -0.836296 2.41344 2.57578 -0.938124 2.42108 2.59392 -1.04124 2.42832 2.6111 -1.14609 2.43523 2.62735 -1.25322 2.44191 2.64269 -1.36318 2.44852 2.65709 -1.47748 2.45544 2.67051 -1.59876 2.46252 2.68331 -1.73082 2.46992 2.69573 -1.87823 2.47783 2.70789 -2.04611 2.4864 2.71983 -2.24105 2.49587 2.73145 -2.47214 2.50673 2.74243 -2.75219 2.52 2.75205 -3.09891 2.53758 2.75905 -3.53459 2.56304 2.76129 -4.07822 2.60264 2.75596 -4.7159 2.66391 2.74256 --2.8148 3.39427 -2.97195 --3.01762 3.33986 -2.85512 --3.21498 3.28542 -2.72803 --3.40558 3.23159 -2.59049 --3.58817 3.17896 -2.44242 --3.76152 3.12809 -2.28386 --3.9245 3.07946 -2.11501 --4.07605 3.03346 -1.93619 --4.2152 2.99041 -1.74787 --4.34109 2.9505 -1.55067 --4.45298 2.9138 -1.34535 --4.55028 2.88028 -1.13279 --4.63256 2.84973 -0.914007 --4.69956 2.82185 -0.690104 --4.75124 2.79615 -0.462283 --4.78776 2.77202 -0.23181 --4.8095 2.74867 0 --4.78776 2.77202 0.23181 --4.75124 2.79615 0.462283 --4.69956 2.82185 0.690104 --4.63256 2.84973 0.914007 --4.55028 2.88028 1.13279 --4.45298 2.9138 1.34535 --4.34109 2.9505 1.55067 --4.2152 2.99041 1.74787 --4.07605 3.03346 1.93619 --3.9245 3.07946 2.11501 --3.76152 3.12809 2.28386 --3.58817 3.17896 2.44242 --3.40558 3.23159 2.59049 --3.21498 3.28542 2.72803 --3.01762 3.33986 2.85512 --2.8148 3.39427 2.97195 --2.60788 3.44801 3.07886 --2.3982 3.50045 3.17623 --2.18715 3.551 3.26455 --1.97611 3.59908 3.34438 --1.76644 3.64423 3.41632 --1.55949 3.68602 3.48101 --1.35655 3.72417 3.5391 --1.15888 3.75844 3.59128 --0.967642 3.78875 3.63821 --0.783935 3.8151 3.68054 --0.608743 3.83759 3.7189 --0.442937 3.85642 3.75388 --0.287262 3.87186 3.78605 --0.142325 3.88425 3.81591 --0.00858836 3.89397 3.84394 -0.113636 3.90142 3.87056 -0.224199 3.90701 3.89678 -0.323116 3.91116 3.92299 -0.410556 3.91422 3.94921 -0.486849 3.91672 3.97543 -0.552493 3.91921 4.00164 -0.608155 3.9217 4.02786 -0.65467 3.92419 4.05407 -0.693058 3.92668 4.08029 -0.724527 3.92916 4.10651 -0.750489 3.93165 4.13272 -0.772562 3.93414 4.15894 -0.792586 3.93663 4.18515 -0.813139 3.93912 4.21137 -0.839476 3.94161 4.23759 -0.878887 3.9441 4.2638 -0.940737 3.94658 4.29002 -1.03705 3.94907 4.31623 -1.18326 3.95156 4.34245 -1.39919 3.95405 4.36867 -1.7103 3.95654 4.39488 -2.14926 3.95903 4.4211 -2.75804 3.96151 4.44731 -3.59053 3.964 4.47353 -4.7159 3.96649 4.49975 -0.543166 0.760567 -0.0205976 -0.529932 0.759963 -0.0199847 -0.517378 0.759292 -0.0192877 -0.505564 0.758561 -0.0185133 -0.494543 0.757776 -0.017668 -0.484357 0.756945 -0.0167608 -0.475036 0.756081 -0.0158048 -0.466602 0.755198 -0.0148188 -0.459061 0.754317 -0.0138249 -0.452403 0.753455 -0.0128451 -0.446566 0.752525 -0.0117801 -0.441465 0.751347 -0.0104163 -0.437089 0.749852 -0.00867336 -0.433466 0.748128 -0.00665129 -0.430584 0.746293 -0.0044907 -0.428407 0.74441 -0.00226475 -0.426938 0.7425 0 -0.428407 0.74441 0.00226475 -0.430584 0.746293 0.0044907 -0.433466 0.748128 0.00665129 -0.437089 0.749852 0.00867336 -0.441465 0.751347 0.0104163 -0.446566 0.752525 0.0117801 -0.452403 0.753455 0.0128451 -0.459061 0.754317 0.0138249 -0.466602 0.755198 0.0148188 -0.475036 0.756081 0.0158048 -0.484357 0.756945 0.0167608 -0.494543 0.757776 0.017668 -0.505564 0.758561 0.0185133 -0.517378 0.759292 0.0192877 -0.529932 0.759963 0.0199847 -0.543166 0.760567 0.0205976 -0.557009 0.761095 0.0211172 -0.571381 0.761534 0.0215298 -0.586196 0.761865 0.0218177 -0.601361 0.762068 0.0219604 -0.616778 0.762124 0.0219379 -0.632351 0.762016 0.0217345 -0.647984 0.761733 0.0213425 -0.663587 0.761277 0.0207646 -0.679073 0.760659 0.0200149 -0.694362 0.759898 0.0191171 -0.709381 0.759021 0.0181017 -0.724059 0.758059 0.0170015 -0.738332 0.757039 0.0158476 -0.752135 0.755987 0.0146662 -0.765412 0.754919 0.0134764 -0.778108 0.753848 0.0122907 -0.790179 0.752782 0.0111162 -0.801588 0.751724 0.00995664 -0.812311 0.750677 0.00881485 -0.822339 0.749647 0.00769474 -0.831675 0.748638 0.0066015 -0.840342 0.747656 0.00554145 -0.84838 0.74671 0.00452112 -0.855844 0.745803 0.00354546 -0.862812 0.744938 0.00261682 -0.869377 0.744109 0.00172839 -0.875651 0.743301 0.000863472 -0.88177 0.742494 0 -0.888257 0.742495 0 -0.896254 0.742495 0 -0.909752 0.742496 0 -0.936146 0.742496 0 -0.987201 0.742497 0 -1.0803 0.742497 0 -1.24001 0.742498 0 -1.50019 0.742498 0 -1.90654 0.742498 0 -2.52004 0.742499 0 -3.42126 0.742499 0 -4.7159 0.7425 0 -0.543165 0.760566 -0.0206182 -0.529931 0.759961 -0.0200052 -0.517377 0.75929 -0.019308 -0.505563 0.758559 -0.0185335 -0.494542 0.757773 -0.0176881 -0.484355 0.756943 -0.0167807 -0.475035 0.756078 -0.0158245 -0.4666 0.755196 -0.0148384 -0.459059 0.754314 -0.0138443 -0.452402 0.753451 -0.0128643 -0.446565 0.752522 -0.011799 -0.441463 0.751344 -0.0104349 -0.437085 0.749851 -0.00869172 -0.433459 0.748129 -0.00666855 -0.430572 0.746296 -0.00450495 -0.428391 0.744416 -0.0022723 -0.426934 0.742519 0 -0.428391 0.744416 0.00227231 -0.430572 0.746296 0.00450495 -0.433459 0.748129 0.00666856 -0.437085 0.749851 0.00869172 -0.441463 0.751344 0.0104349 -0.446565 0.752522 0.011799 -0.452402 0.753451 0.0128643 -0.459059 0.754314 0.0138443 -0.4666 0.755196 0.0148384 -0.475035 0.756078 0.0158245 -0.484355 0.756943 0.0167807 -0.494542 0.757773 0.0176881 -0.505563 0.758559 0.0185335 -0.517377 0.75929 0.019308 -0.529931 0.759961 0.0200052 -0.543165 0.760566 0.0206182 -0.557008 0.761094 0.0211378 -0.571381 0.761532 0.0215505 -0.586196 0.761864 0.0218385 -0.601361 0.762067 0.0219812 -0.616778 0.762123 0.0219587 -0.632351 0.762014 0.0217554 -0.647985 0.761732 0.0213633 -0.663587 0.761276 0.0207855 -0.679073 0.760657 0.0200358 -0.694363 0.759897 0.019138 -0.709382 0.75902 0.0181225 -0.724061 0.758058 0.0170223 -0.738333 0.757038 0.0158684 -0.752137 0.755985 0.0146869 -0.765413 0.754918 0.0134971 -0.77811 0.753847 0.0123113 -0.790181 0.752781 0.0111367 -0.80159 0.751723 0.00997707 -0.812313 0.750676 0.0088352 -0.822341 0.749646 0.007715 -0.831677 0.748637 0.00662166 -0.840345 0.747655 0.00556154 -0.848382 0.746709 0.00454113 -0.855847 0.745802 0.00356543 -0.862815 0.744937 0.00263676 -0.86938 0.744108 0.00174834 -0.875654 0.743301 0.000883478 -0.881771 0.742496 2.0219e-05 -0.888257 0.742494 2.0298e-05 -0.896255 0.742494 2.0377e-05 -0.909754 0.742495 2.0603e-05 -0.936148 0.742495 2.1207e-05 -0.987204 0.742496 2.2123e-05 -1.0803 0.742496 2.2621e-05 -1.24002 0.742497 2.2453e-05 -1.50019 0.742497 2.2263e-05 -1.90654 0.742498 2.2455e-05 -2.52005 0.742498 2.3186e-05 -3.42126 0.742499 2.4932e-05 -4.7159 0.74251 1.7168e-05 -0.543164 0.760563 -0.0206544 -0.529929 0.759958 -0.0200411 -0.517375 0.759287 -0.0193437 -0.505561 0.758555 -0.0185688 -0.494539 0.757769 -0.0177229 -0.484353 0.756938 -0.0168151 -0.475032 0.756074 -0.0158584 -0.466598 0.755191 -0.0148718 -0.459057 0.754309 -0.0138771 -0.4524 0.753446 -0.0128963 -0.446563 0.752516 -0.01183 -0.441459 0.751339 -0.0104652 -0.437078 0.749849 -0.00872123 -0.433447 0.74813 -0.00669598 -0.430554 0.746301 -0.00452728 -0.428367 0.744425 -0.00228397 -0.426929 0.74255 0 -0.428367 0.744425 0.00228398 -0.430554 0.746301 0.00452728 -0.433447 0.74813 0.00669599 -0.437078 0.749849 0.00872123 -0.441459 0.751339 0.0104652 -0.446563 0.752516 0.01183 -0.4524 0.753446 0.0128963 -0.459057 0.754309 0.0138771 -0.466598 0.755191 0.0148718 -0.475032 0.756074 0.0158584 -0.484353 0.756938 0.0168151 -0.494539 0.757769 0.0177229 -0.505561 0.758555 0.0185688 -0.517375 0.759287 0.0193437 -0.529929 0.759958 0.0200411 -0.543164 0.760563 0.0206544 -0.557007 0.761091 0.0211743 -0.57138 0.76153 0.0215872 -0.586195 0.761861 0.0218754 -0.60136 0.762065 0.0220183 -0.616778 0.762121 0.0219959 -0.632352 0.762012 0.0217927 -0.647986 0.76173 0.0214008 -0.663589 0.761274 0.020823 -0.679075 0.760655 0.0200734 -0.694365 0.759895 0.0191757 -0.709384 0.759018 0.0181602 -0.724063 0.758056 0.01706 -0.738336 0.757036 0.0159062 -0.75214 0.755984 0.0147247 -0.765416 0.754916 0.0135348 -0.778113 0.753845 0.0123491 -0.790184 0.752779 0.0111744 -0.801593 0.751721 0.0100146 -0.812317 0.750674 0.00887267 -0.822345 0.749644 0.00775237 -0.831681 0.748634 0.00665893 -0.840349 0.747653 0.00559871 -0.848386 0.746707 0.00457824 -0.855851 0.7458 0.00360251 -0.862819 0.744935 0.00267387 -0.869384 0.744107 0.00178555 -0.875659 0.7433 0.00092093 -0.881774 0.742499 5.8807e-05 -0.888257 0.742494 5.829e-05 -0.896256 0.742493 5.8354e-05 -0.909756 0.742493 5.8857e-05 -0.936151 0.742493 6.038e-05 -0.987207 0.742494 6.2702e-05 -1.0803 0.742495 6.3817e-05 -1.24002 0.742496 6.314e-05 -1.5002 0.742496 6.2514e-05 -1.90655 0.742496 6.2996e-05 -2.52006 0.742496 6.4938e-05 -3.42127 0.742498 6.9544e-05 -4.7159 0.742526 4.5683e-05 -0.543161 0.760558 -0.0207184 -0.529926 0.759953 -0.0201043 -0.517371 0.759281 -0.0194061 -0.505557 0.758549 -0.0186303 -0.494535 0.757763 -0.0177834 -0.484348 0.756931 -0.0168744 -0.475027 0.756066 -0.0159166 -0.466593 0.755183 -0.0149287 -0.459052 0.754301 -0.0139326 -0.452396 0.753437 -0.0129499 -0.446559 0.752506 -0.0118812 -0.441453 0.751331 -0.0105145 -0.437067 0.749845 -0.00876868 -0.433428 0.748132 -0.00673961 -0.430525 0.746308 -0.00456235 -0.428329 0.74444 -0.00230207 -0.426919 0.7426 1e-09 -0.428329 0.74444 0.00230207 -0.430525 0.746308 0.00456235 -0.433428 0.748132 0.00673961 -0.437067 0.749845 0.00876868 -0.441453 0.751331 0.0105145 -0.446559 0.752506 0.0118812 -0.452396 0.753437 0.0129499 -0.459052 0.754301 0.0139326 -0.466593 0.755183 0.0149287 -0.475027 0.756066 0.0159166 -0.484348 0.756931 0.0168744 -0.494535 0.757763 0.0177834 -0.505557 0.758549 0.0186303 -0.517371 0.759281 0.0194061 -0.529926 0.759953 0.0201043 -0.543161 0.760558 0.0207184 -0.557005 0.761087 0.0212389 -0.571378 0.761526 0.0216523 -0.586194 0.761857 0.021941 -0.60136 0.762061 0.0220843 -0.616778 0.762117 0.0220624 -0.632353 0.762008 0.0218595 -0.647987 0.761726 0.021468 -0.663591 0.76127 0.0208905 -0.679078 0.760652 0.0201412 -0.694369 0.759891 0.0192437 -0.709388 0.759014 0.0182285 -0.724068 0.758052 0.0171285 -0.738341 0.757033 0.0159748 -0.752145 0.75598 0.0147934 -0.765422 0.754912 0.0136036 -0.778119 0.753842 0.0124179 -0.79019 0.752775 0.0112432 -0.8016 0.751717 0.0100834 -0.812324 0.75067 0.00894141 -0.822352 0.74964 0.00782102 -0.831689 0.74863 0.0067275 -0.840356 0.747649 0.00566725 -0.848395 0.746703 0.0046468 -0.85586 0.745796 0.00367116 -0.862828 0.744932 0.00274271 -0.869393 0.744104 0.00185472 -0.875668 0.743299 0.000990802 -0.881779 0.742505 0.000132092 -0.888258 0.742494 0.000129147 -0.896259 0.742491 0.000128866 -0.90976 0.74249 0.00012958 -0.936156 0.74249 0.000132395 -0.987214 0.742492 0.000136865 -1.08031 0.742494 0.000138803 -1.24003 0.742494 0.000137029 -1.50021 0.742493 0.000135506 -1.90657 0.742493 0.000136417 -2.52008 0.742494 0.000140367 -3.42129 0.742496 0.000149655 -4.7159 0.742556 9.3029e-05 -0.543156 0.76055 -0.0208306 -0.529921 0.759945 -0.0202149 -0.517365 0.759272 -0.0195148 -0.50555 0.758539 -0.018737 -0.494528 0.757752 -0.0178879 -0.48434 0.75692 -0.0169765 -0.475019 0.756054 -0.0160161 -0.466584 0.75517 -0.0150253 -0.459045 0.754287 -0.0140261 -0.452389 0.753422 -0.0130392 -0.446552 0.75249 -0.0119655 -0.441443 0.751318 -0.0105946 -0.437049 0.74984 -0.00884482 -0.433398 0.748136 -0.00680884 -0.430479 0.746321 -0.00461733 -0.428271 0.744463 -0.00233014 -0.426902 0.74268 2e-09 -0.428271 0.744463 0.00233014 -0.43048 0.746321 0.00461733 -0.433398 0.748135 0.00680885 -0.437049 0.74984 0.00884483 -0.441443 0.751318 0.0105946 -0.446552 0.75249 0.0119655 -0.45239 0.753422 0.0130392 -0.459045 0.754287 0.0140261 -0.466584 0.75517 0.0150253 -0.475019 0.756054 0.0160161 -0.48434 0.75692 0.0169765 -0.494528 0.757752 0.0178879 -0.50555 0.758539 0.018737 -0.517365 0.759272 0.0195148 -0.529921 0.759945 0.0202149 -0.543156 0.76055 0.0208306 -0.557001 0.761079 0.0213526 -0.571375 0.761519 0.0217673 -0.586192 0.76185 0.0220571 -0.601359 0.762054 0.0222015 -0.616779 0.76211 0.0221805 -0.632354 0.762002 0.0219785 -0.64799 0.761719 0.0215878 -0.663595 0.761264 0.0210111 -0.679083 0.760645 0.0202626 -0.694375 0.759884 0.0193658 -0.709396 0.759008 0.0183513 -0.724076 0.758046 0.0172519 -0.738349 0.757027 0.0160987 -0.752154 0.755974 0.0149178 -0.765432 0.754906 0.0137284 -0.778129 0.753835 0.0125429 -0.790201 0.752769 0.0113684 -0.801611 0.75171 0.0102087 -0.812336 0.750664 0.00906679 -0.822364 0.749633 0.00794647 -0.831702 0.748624 0.00685306 -0.840371 0.747642 0.00579296 -0.848409 0.746696 0.00477277 -0.855875 0.74579 0.00379755 -0.862844 0.744926 0.0028697 -0.86941 0.7441 0.00198264 -0.875684 0.743297 0.00112049 -0.881789 0.742517 0.0002702 -0.88826 0.742493 0.000260603 -0.896265 0.742487 0.000259089 -0.909769 0.742484 0.000259611 -0.936166 0.742484 0.000264033 -0.987227 0.742487 0.000271703 -1.08033 0.74249 0.000274797 -1.24005 0.742491 0.000270903 -1.50024 0.742489 0.000267613 -1.9066 0.742487 0.000269135 -2.52011 0.742488 0.000276393 -3.42132 0.742493 0.000293289 -4.7159 0.742609 0.00017149 -0.543148 0.760537 -0.0210264 -0.529911 0.75993 -0.0204072 -0.517354 0.759256 -0.0197033 -0.505538 0.758522 -0.0189212 -0.494515 0.757734 -0.0180675 -0.484326 0.7569 -0.0171511 -0.475004 0.756033 -0.0161853 -0.46657 0.755149 -0.0151886 -0.459031 0.754265 -0.0141828 -0.452377 0.753398 -0.0131874 -0.446539 0.752465 -0.0121036 -0.441424 0.751298 -0.0107241 -0.437018 0.749832 -0.00896647 -0.433349 0.748141 -0.0069182 -0.430407 0.74634 -0.00470314 -0.428182 0.7445 -0.00237357 -0.42687 0.742804 3e-09 -0.428182 0.7445 0.00237358 -0.430407 0.74634 0.00470315 -0.433349 0.748141 0.00691821 -0.437018 0.749831 0.00896648 -0.441424 0.751298 0.0107241 -0.44654 0.752465 0.0121036 -0.452377 0.753398 0.0131874 -0.459031 0.754265 0.0141828 -0.46657 0.755149 0.0151886 -0.475004 0.756033 0.0161853 -0.484326 0.7569 0.0171511 -0.494515 0.757734 0.0180675 -0.505538 0.758522 0.0189212 -0.517354 0.759256 0.0197033 -0.529911 0.75993 0.0204073 -0.543148 0.760537 0.0210264 -0.556994 0.761067 0.0215515 -0.57137 0.761507 0.021969 -0.586189 0.761839 0.0222613 -0.601357 0.762043 0.0224079 -0.616779 0.762099 0.022389 -0.632357 0.761991 0.022189 -0.647995 0.761709 0.0218002 -0.663602 0.761253 0.0212253 -0.679092 0.760634 0.0204786 -0.694386 0.759874 0.0195835 -0.709408 0.758997 0.0185707 -0.72409 0.758035 0.0174728 -0.738365 0.757016 0.016321 -0.752171 0.755963 0.0151413 -0.765449 0.754896 0.0139529 -0.778148 0.753825 0.0127683 -0.79022 0.752758 0.0115944 -0.801632 0.751699 0.0104354 -0.812357 0.750652 0.00929393 -0.822387 0.749621 0.00817412 -0.831726 0.748611 0.00708129 -0.840396 0.74763 0.00602191 -0.848436 0.746684 0.00500265 -0.855903 0.745779 0.00402865 -0.862873 0.744916 0.00310237 -0.86944 0.744092 0.00221753 -0.875714 0.743294 0.0013595 -0.881809 0.742537 0.00052749 -0.888265 0.742492 0.000502742 -0.896276 0.74248 0.000497876 -0.909785 0.742474 0.000496971 -0.936185 0.742473 0.000502896 -0.987249 0.742479 0.00051506 -1.08035 0.742485 0.00051976 -1.24009 0.742484 0.000511969 -1.50028 0.74248 0.000505314 -1.90665 0.742478 0.000507647 -2.52017 0.742479 0.000520285 -3.42138 0.742487 0.000549381 -4.7159 0.742699 0.000301218 -0.543133 0.760515 -0.0213651 -0.529894 0.759907 -0.0207389 -0.517335 0.759231 -0.0200271 -0.505517 0.758494 -0.0192365 -0.494491 0.757704 -0.0183735 -0.484301 0.756869 -0.017447 -0.474977 0.756 -0.0164705 -0.466543 0.755115 -0.0154622 -0.459006 0.75423 -0.0144435 -0.452355 0.753361 -0.0134316 -0.446516 0.752426 -0.0123284 -0.441391 0.751267 -0.0109323 -0.436966 0.749819 -0.00915967 -0.433268 0.74815 -0.00708983 -0.430293 0.746369 -0.00483624 -0.428042 0.744557 -0.00244054 -0.426807 0.742987 5e-09 -0.428042 0.744557 0.00244056 -0.430293 0.746369 0.00483627 -0.433268 0.74815 0.00708986 -0.436966 0.749819 0.00915968 -0.441391 0.751267 0.0109323 -0.446516 0.752426 0.0123284 -0.452355 0.75336 0.0134317 -0.459006 0.75423 0.0144435 -0.466543 0.755115 0.0154622 -0.474977 0.756 0.0164705 -0.484301 0.756869 0.0174471 -0.494491 0.757704 0.0183735 -0.505517 0.758494 0.0192365 -0.517335 0.759231 0.0200271 -0.529894 0.759907 0.0207389 -0.543133 0.760515 0.0213651 -0.556982 0.761046 0.0218965 -0.57136 0.761487 0.0223197 -0.586182 0.76182 0.0226171 -0.601353 0.762025 0.0227684 -0.616779 0.762081 0.0227539 -0.63236 0.761973 0.0225581 -0.648003 0.76169 0.0221733 -0.663614 0.761234 0.0216024 -0.679108 0.760616 0.0208596 -0.694405 0.759855 0.0199684 -0.709431 0.758979 0.0189592 -0.724115 0.758017 0.0178648 -0.738392 0.756998 0.0167162 -0.7522 0.755945 0.0155393 -0.76548 0.754877 0.0143535 -0.77818 0.753806 0.013171 -0.790255 0.752739 0.011999 -0.801668 0.751679 0.0108417 -0.812396 0.750632 0.0097018 -0.822428 0.7496 0.00858361 -0.83177 0.748591 0.00749255 -0.840442 0.74761 0.00643524 -0.848484 0.746664 0.00541845 -0.855953 0.74576 0.00444746 -0.862925 0.7449 0.00352487 -0.869493 0.744079 0.00264504 -0.875769 0.74329 0.00179602 -0.881845 0.74257 0.000999141 -0.888277 0.742491 0.000944665 -0.8963 0.742469 0.000931778 -0.909816 0.742456 0.000926369 -0.936219 0.742456 0.000932388 -0.98729 0.742466 0.000950128 -1.0804 0.742476 0.000956818 -1.24015 0.742474 0.000942075 -1.50035 0.742466 0.000929177 -1.90674 0.74246 0.000932464 -2.52027 0.742463 0.000953708 -3.42148 0.742477 0.00100201 -4.7159 0.742854 0.000515282 -0.543106 0.760479 -0.0219448 -0.529863 0.759868 -0.0213048 -0.517301 0.759189 -0.0205778 -0.505479 0.75845 -0.0197706 -0.49445 0.757657 -0.0188896 -0.484256 0.756818 -0.017944 -0.474931 0.755948 -0.0169469 -0.466496 0.755061 -0.0159164 -0.45896 0.754175 -0.0148732 -0.452312 0.753302 -0.0138306 -0.44647 0.752366 -0.012692 -0.44133 0.75122 -0.0112649 -0.436875 0.749798 -0.00946437 -0.433134 0.748162 -0.0073572 -0.430109 0.746413 -0.00504119 -0.427825 0.744644 -0.00254346 -0.426682 0.743243 9e-09 -0.427825 0.744644 0.00254349 -0.430109 0.746413 0.00504124 -0.433134 0.748162 0.00735724 -0.436875 0.749798 0.00946441 -0.44133 0.75122 0.011265 -0.44647 0.752366 0.012692 -0.452312 0.753302 0.0138306 -0.45896 0.754175 0.0148732 -0.466496 0.75506 0.0159164 -0.474931 0.755948 0.0169469 -0.484256 0.756818 0.017944 -0.49445 0.757656 0.0188897 -0.505479 0.75845 0.0197706 -0.517301 0.759189 0.0205778 -0.529864 0.759868 0.0213048 -0.543106 0.760479 0.0219449 -0.556959 0.761013 0.0224888 -0.571342 0.761455 0.0229232 -0.586168 0.761789 0.0232309 -0.601346 0.761994 0.0233916 -0.616778 0.762051 0.0233859 -0.632366 0.761942 0.0231985 -0.648015 0.76166 0.022822 -0.663634 0.761204 0.0222593 -0.679135 0.760586 0.0215246 -0.694438 0.759825 0.0206414 -0.709469 0.758949 0.0196399 -0.724158 0.757987 0.018553 -0.738439 0.756968 0.0174113 -0.75225 0.755915 0.0162407 -0.765534 0.754847 0.0150605 -0.778237 0.753775 0.013883 -0.790315 0.752706 0.0127156 -0.801732 0.751646 0.0115623 -0.812463 0.750597 0.0104265 -0.8225 0.749565 0.00931248 -0.831845 0.748555 0.00822589 -0.840522 0.747574 0.0071736 -0.848568 0.746629 0.00616259 -0.856041 0.745727 0.00519838 -0.863017 0.744871 0.00428382 -0.869589 0.744057 0.00341465 -0.875865 0.743284 0.00258436 -0.881915 0.742618 0.00184582 -0.88831 0.742491 0.00174196 -0.896352 0.74245 0.00171154 -0.909879 0.742427 0.00169475 -0.936287 0.742425 0.00169623 -0.987364 0.742443 0.00171905 -1.08049 0.74246 0.00172741 -1.24025 0.742457 0.00170051 -1.50048 0.742442 0.00167633 -1.9069 0.742431 0.00168048 -2.52045 0.742436 0.00171521 -3.42165 0.74246 0.00179304 -4.7159 0.743115 0.000867949 -0.543057 0.760423 -0.0229253 -0.529807 0.759808 -0.022259 -0.517238 0.759124 -0.0215032 -0.50541 0.75838 -0.0206648 -0.494375 0.757582 -0.0197503 -0.484176 0.756739 -0.0187688 -0.474846 0.755865 -0.0177336 -0.466409 0.754976 -0.0166622 -0.458875 0.754089 -0.0155737 -0.452228 0.753212 -0.0144762 -0.446379 0.752276 -0.0132756 -0.441214 0.751148 -0.011793 -0.436713 0.749765 -0.00994163 -0.432908 0.748177 -0.00777044 -0.42981 0.746474 -0.00535437 -0.42748 0.74477 -0.00270112 -0.426437 0.743574 1.7e-08 -0.42748 0.74477 0.00270118 -0.42981 0.746474 0.00535445 -0.432908 0.748177 0.00777052 -0.436713 0.749765 0.00994171 -0.441214 0.751148 0.011793 -0.446379 0.752276 0.0132756 -0.452228 0.753212 0.0144763 -0.458875 0.754089 0.0155737 -0.466409 0.754976 0.0166622 -0.474846 0.755865 0.0177337 -0.484176 0.756739 0.0187689 -0.494375 0.757581 0.0197504 -0.50541 0.758379 0.0206649 -0.517238 0.759124 0.0215033 -0.529807 0.759807 0.0222591 -0.543057 0.760423 0.0229254 -0.556916 0.76096 0.0234932 -0.571307 0.761405 0.0239493 -0.586143 0.76174 0.0242766 -0.60133 0.761946 0.0244556 -0.616772 0.762003 0.0244671 -0.632372 0.761894 0.0242962 -0.648034 0.761611 0.023936 -0.663664 0.761155 0.0233896 -0.679177 0.760536 0.022671 -0.694491 0.759776 0.0218039 -0.709531 0.7589 0.0208182 -0.724228 0.757939 0.0197463 -0.738517 0.756919 0.0186188 -0.752334 0.755866 0.0174614 -0.765624 0.754797 0.016293 -0.778332 0.753723 0.0151264 -0.790416 0.752653 0.0139689 -0.80184 0.75159 0.0128251 -0.812578 0.75054 0.0116985 -0.822622 0.749506 0.010594 -0.831975 0.748495 0.00951754 -0.840659 0.747514 0.0084764 -0.848714 0.746572 0.00747786 -0.856195 0.745674 0.00652786 -0.863178 0.744824 0.00562981 -0.869758 0.744022 0.00478218 -0.876035 0.743277 0.00398809 -0.882049 0.742677 0.00332974 -0.8884 0.742493 0.00315954 -0.896471 0.74242 0.0030943 -0.910015 0.742379 0.00305216 -0.936421 0.742375 0.00303749 -0.987506 0.742407 0.00306006 -1.08065 0.742436 0.00306726 -1.24044 0.742429 0.00301942 -1.50071 0.742402 0.00297543 -1.90718 0.742383 0.00297977 -2.52076 0.74239 0.00303508 -3.42195 0.742434 0.00315704 -4.7159 0.743555 0.00144828 -0.542963 0.760336 -0.0245609 -0.529702 0.759714 -0.0238462 -0.517121 0.759024 -0.0230377 -0.505282 0.758272 -0.0221423 -0.494237 0.757467 -0.0211669 -0.484028 0.756619 -0.0201206 -0.47469 0.75574 -0.0190167 -0.466247 0.754849 -0.0178717 -0.458711 0.75396 -0.0167025 -0.452062 0.753079 -0.0155102 -0.446196 0.752145 -0.0142051 -0.440991 0.751042 -0.0126261 -0.43642 0.749712 -0.0106845 -0.43252 0.748188 -0.00840458 -0.429316 0.746552 -0.00582952 -0.426925 0.744943 -0.00294209 -0.425967 0.743962 3.3e-08 -0.426925 0.744943 0.00294218 -0.429316 0.746552 0.00582965 -0.43252 0.748188 0.00840472 -0.43642 0.749712 0.0106846 -0.440991 0.751042 0.0126262 -0.446196 0.752144 0.0142052 -0.452062 0.753079 0.0155103 -0.458711 0.75396 0.0167027 -0.466247 0.754848 0.0178718 -0.47469 0.75574 0.0190168 -0.484028 0.756618 0.0201208 -0.494237 0.757466 0.0211671 -0.505282 0.758271 0.0221425 -0.517121 0.759023 0.0230379 -0.529702 0.759714 0.0238464 -0.542963 0.760336 0.0245612 -0.556835 0.760878 0.0251732 -0.571239 0.761327 0.0256696 -0.586089 0.761665 0.0260339 -0.601293 0.761872 0.0262472 -0.616754 0.761928 0.0262913 -0.632373 0.761819 0.0261521 -0.648055 0.761536 0.025823 -0.663706 0.761078 0.0253077 -0.679238 0.760459 0.0246203 -0.69457 0.759699 0.0237843 -0.709627 0.758823 0.0228291 -0.724339 0.757861 0.0217868 -0.73864 0.756842 0.0206873 -0.752468 0.755788 0.0195559 -0.765768 0.754717 0.0184117 -0.778487 0.753641 0.0172673 -0.790582 0.752567 0.0161306 -0.802017 0.751501 0.0150067 -0.812767 0.750447 0.0138999 -0.822824 0.749411 0.0128157 -0.832192 0.748398 0.0117607 -0.840891 0.747419 0.0107426 -0.848961 0.74648 0.00976928 -0.856458 0.745588 0.00884728 -0.863457 0.74475 0.00798124 -0.870051 0.74397 0.00717427 -0.87633 0.743268 0.00644196 -0.882312 0.742731 0.00587089 -0.888629 0.742496 0.00563231 -0.896743 0.742375 0.00550708 -0.910308 0.742303 0.00541417 -0.936699 0.742296 0.00535842 -0.987779 0.74235 0.0053638 -1.08095 0.7424 0.00536044 -1.24078 0.742387 0.00527693 -1.50111 0.742338 0.00519912 -1.90765 0.742305 0.00520174 -2.5213 0.742319 0.00528753 -3.42245 0.742395 0.0054731 -4.7159 0.744292 0.00240242 -0.54278 0.760208 -0.0272487 -0.529498 0.759577 -0.0264471 -0.516898 0.758876 -0.0255446 -0.505039 0.758113 -0.0245483 -0.493975 0.757298 -0.0234653 -0.483747 0.756441 -0.0223053 -0.474393 0.755557 -0.0210809 -0.465936 0.754662 -0.0198078 -0.458388 0.753772 -0.0184993 -0.451723 0.752888 -0.0171493 -0.445823 0.751959 -0.0156744 -0.440551 0.75089 -0.0139333 -0.435876 0.749626 -0.0118346 -0.431838 0.748186 -0.00937182 -0.428486 0.746641 -0.006546 -0.426006 0.745155 -0.00330921 -0.425096 0.744365 6.6e-08 -0.426006 0.745155 0.00330938 -0.428486 0.746641 0.00654622 -0.431838 0.748186 0.00937209 -0.435876 0.749626 0.0118348 -0.440551 0.750889 0.0139335 -0.445823 0.751958 0.0156746 -0.451724 0.752888 0.0171495 -0.458388 0.753771 0.0184996 -0.465936 0.754661 0.019808 -0.474393 0.755556 0.0210812 -0.483747 0.756441 0.0223056 -0.493975 0.757297 0.0234657 -0.50504 0.758112 0.0245487 -0.516898 0.758875 0.0255451 -0.529499 0.759576 0.0264476 -0.54278 0.760208 0.0272493 -0.556673 0.760758 0.027941 -0.5711 0.761212 0.0285106 -0.585976 0.761553 0.0289424 -0.601207 0.761762 0.0292189 -0.616698 0.761819 0.0293231 -0.63235 0.761709 0.0292423 -0.648065 0.761424 0.0289711 -0.66375 0.760965 0.0285137 -0.679315 0.760345 0.0278845 -0.694678 0.759584 0.0271064 -0.709762 0.758708 0.0262085 -0.724499 0.757746 0.0252217 -0.738822 0.756726 0.0241753 -0.752671 0.75567 0.0230939 -0.765989 0.754596 0.0219964 -0.778727 0.753516 0.0208958 -0.790841 0.752437 0.0198005 -0.802296 0.751365 0.0187168 -0.81307 0.750306 0.01765 -0.823151 0.749265 0.0166065 -0.832545 0.748251 0.015594 -0.841273 0.747273 0.0146207 -0.849373 0.74634 0.0136951 -0.856902 0.745461 0.0128246 -0.863935 0.744643 0.0120158 -0.870559 0.743897 0.0112772 -0.876855 0.743247 0.0106306 -0.882839 0.742756 0.0101343 -0.889171 0.742486 0.0098419 -0.897352 0.742309 0.00963343 -0.910945 0.742194 0.00945131 -0.937287 0.74218 0.00930799 -0.988324 0.74227 0.00925563 -1.0815 0.742353 0.00921711 -1.24138 0.74233 0.00907327 -1.50181 0.742247 0.00893954 -1.90846 0.742192 0.00893621 -2.5222 0.742216 0.00906556 -3.4233 0.742348 0.00933878 -4.7159 0.745522 0.00397025 -0.542409 0.760034 -0.0315938 -0.529092 0.759389 -0.0306409 -0.516455 0.758672 -0.0295756 -0.504561 0.757894 -0.0284054 -0.49346 0.757065 -0.0271381 -0.483197 0.756197 -0.0257836 -0.473807 0.755304 -0.0243545 -0.465317 0.754404 -0.0228646 -0.457734 0.753512 -0.0213236 -0.451024 0.752628 -0.01972 -0.445054 0.75171 -0.0179777 -0.439675 0.750682 -0.015972 -0.434846 0.749494 -0.0136066 -0.430614 0.748153 -0.0108397 -0.427058 0.746719 -0.00762065 -0.424445 0.745374 -0.00386509 -0.423528 0.744721 1.32e-07 -0.424445 0.745374 0.00386542 -0.427058 0.746719 0.00762106 -0.430614 0.748153 0.0108402 -0.434847 0.749493 0.013607 -0.439675 0.750681 0.0159724 -0.445054 0.751709 0.0179781 -0.451024 0.752627 0.0197204 -0.457734 0.753511 0.0213241 -0.465317 0.754403 0.0228651 -0.473808 0.755303 0.0243551 -0.483197 0.756195 0.0257843 -0.49346 0.757064 0.0271388 -0.504561 0.757893 0.0284062 -0.516455 0.758671 0.0295765 -0.529092 0.759388 0.0306418 -0.542409 0.760033 0.0315948 -0.55634 0.760594 0.0324265 -0.570807 0.761057 0.0331255 -0.585725 0.761404 0.0336776 -0.601003 0.761615 0.0340672 -0.616544 0.761672 0.0342796 -0.632249 0.76156 0.0343042 -0.648019 0.761274 0.0341373 -0.663758 0.760814 0.0337843 -0.679376 0.760192 0.0332598 -0.69479 0.75943 0.0325863 -0.709922 0.758554 0.0317916 -0.724701 0.757591 0.0309054 -0.739062 0.756569 0.0299556 -0.752947 0.75551 0.0289662 -0.7663 0.75443 0.0279556 -0.779073 0.753343 0.0269373 -0.791223 0.752256 0.0259211 -0.802718 0.751176 0.0249143 -0.813534 0.750109 0.0239239 -0.823663 0.749063 0.0229576 -0.833109 0.748048 0.0220239 -0.841894 0.747073 0.0211315 -0.850057 0.746151 0.0202893 -0.857655 0.74529 0.019505 -0.864759 0.7445 0.0187863 -0.871456 0.743794 0.0181422 -0.877826 0.74319 0.0175871 -0.883898 0.742726 0.0171441 -0.890341 0.742437 0.0168148 -0.898649 0.742216 0.0165162 -0.912296 0.742055 0.0162031 -0.938531 0.742032 0.0158997 -0.989431 0.742176 0.015709 -1.08256 0.742315 0.01558 -1.24248 0.742278 0.0153347 -1.50302 0.74214 0.0151117 -1.90985 0.74205 0.0150944 -2.52371 0.742092 0.0152833 -3.42469 0.742319 0.0156701 -4.7159 0.74757 0.00654547 -0.541636 0.759834 -0.0384963 -0.528251 0.759169 -0.0372871 -0.515548 0.75843 -0.035948 -0.503586 0.757629 -0.034487 -0.492415 0.756779 -0.0329129 -0.482081 0.755893 -0.031236 -0.472619 0.754988 -0.0294689 -0.464053 0.75408 -0.0276238 -0.456385 0.753185 -0.025708 -0.449573 0.752303 -0.0237078 -0.443472 0.751402 -0.0215526 -0.437921 0.750419 -0.0191252 -0.432871 0.749308 -0.0163189 -0.428373 0.748069 -0.0130542 -0.424545 0.74675 -0.00922251 -0.421733 0.745529 -0.00469743 -0.420745 0.744943 2.68e-07 -0.421733 0.745529 0.00469805 -0.424545 0.746749 0.00922326 -0.428373 0.748068 0.013055 -0.432871 0.749307 0.0163198 -0.437921 0.750418 0.019126 -0.443472 0.751401 0.0215535 -0.449573 0.752301 0.0237087 -0.456386 0.753183 0.025709 -0.464053 0.754078 0.0276248 -0.472619 0.754986 0.02947 -0.482081 0.755891 0.0312373 -0.492415 0.756777 0.0329142 -0.503586 0.757627 0.0344885 -0.515548 0.758427 0.0359496 -0.528251 0.759166 0.0372889 -0.541636 0.759832 0.0384982 -0.555634 0.76041 0.039569 -0.570171 0.760886 0.0404908 -0.585163 0.761242 0.0412516 -0.600519 0.761458 0.0418386 -0.616142 0.761516 0.0422405 -0.631933 0.761405 0.04245 -0.647791 0.761116 0.0424658 -0.663619 0.760655 0.042295 -0.679324 0.760033 0.0419524 -0.694821 0.759271 0.0414601 -0.710032 0.758395 0.0408443 -0.724885 0.757431 0.0401328 -0.739316 0.756406 0.0393519 -0.753268 0.755341 0.0385242 -0.766687 0.754255 0.0376682 -0.779529 0.753157 0.036798 -0.791752 0.752059 0.0359245 -0.803326 0.750968 0.035057 -0.81423 0.749891 0.0342037 -0.824455 0.74884 0.0333734 -0.83401 0.747823 0.0325745 -0.842916 0.746855 0.0318153 -0.851213 0.745945 0.0311032 -0.858958 0.745106 0.0304443 -0.866225 0.744345 0.0298431 -0.873099 0.743671 0.0293025 -0.879667 0.743094 0.0288249 -0.88597 0.742643 0.0284148 -0.892671 0.74235 0.0280555 -0.901233 0.742112 0.0276717 -0.915017 0.741928 0.0271999 -0.941103 0.741908 0.02665 -0.99169 0.74213 0.0261888 -1.08461 0.742356 0.0258611 -1.24449 0.742304 0.0254467 -1.50515 0.742084 0.0250868 -1.91219 0.74194 0.0250421 -2.52622 0.742015 0.0253081 -3.42694 0.742398 0.0258296 -4.7159 0.750973 0.0107743 -0.539988 0.759706 -0.0492605 -0.526478 0.759009 -0.0476296 -0.513647 0.758236 -0.0458434 -0.501553 0.757402 -0.0439104 -0.490247 0.75652 -0.0418405 -0.479771 0.755606 -0.039645 -0.47016 0.754677 -0.0373367 -0.461433 0.753752 -0.034928 -0.453589 0.752846 -0.0324256 -0.446575 0.751965 -0.0298161 -0.440243 0.75108 -0.0270284 -0.434425 0.750135 -0.0239392 -0.429065 0.749086 -0.0204234 -0.424219 0.747925 -0.0163614 -0.420039 0.746687 -0.0115855 -0.416943 0.745525 -0.00592287 -0.41582 0.744925 5.47e-07 -0.416943 0.745524 0.00592408 -0.420039 0.746687 0.0115869 -0.424219 0.747923 0.0163629 -0.429065 0.749084 0.020425 -0.434426 0.750133 0.0239408 -0.440243 0.751077 0.02703 -0.446575 0.751962 0.0298178 -0.453589 0.752843 0.0324273 -0.461433 0.753749 0.0349299 -0.47016 0.754674 0.0373388 -0.479771 0.755602 0.0396473 -0.490246 0.756516 0.041843 -0.501553 0.757398 0.0439132 -0.513647 0.758232 0.0458464 -0.526478 0.759005 0.0476329 -0.539988 0.759702 0.0492641 -0.554112 0.760308 0.0507315 -0.568777 0.760806 0.0520264 -0.583898 0.761179 0.0531394 -0.599388 0.761407 0.0540617 -0.61515 0.761474 0.0547863 -0.631082 0.761368 0.0553099 -0.647084 0.761084 0.055635 -0.663057 0.760627 0.0557706 -0.678905 0.760009 0.0557323 -0.694542 0.759251 0.0555413 -0.709889 0.758378 0.0552222 -0.724875 0.757416 0.0548004 -0.739438 0.75639 0.0543004 -0.753521 0.755321 0.0537436 -0.767076 0.754227 0.053148 -0.780059 0.753119 0.0525284 -0.792435 0.75201 0.0518967 -0.804177 0.750907 0.051263 -0.815267 0.749822 0.0506361 -0.8257 0.748765 0.0500236 -0.835486 0.747749 0.0494322 -0.844648 0.746785 0.0488673 -0.853229 0.745885 0.0483321 -0.861286 0.745058 0.0478282 -0.868893 0.744313 0.0473547 -0.876138 0.743653 0.0469091 -0.883107 0.743087 0.0464879 -0.889846 0.742643 0.0460903 -0.897006 0.742361 0.0456924 -0.906027 0.74214 0.0452183 -0.920144 0.741983 0.0445708 -0.946144 0.74201 0.0437023 -0.996198 0.742341 0.0428045 -1.08859 0.742693 0.0421012 -1.24822 0.74263 0.0414126 -1.50891 0.742293 0.0408535 -1.91617 0.742074 0.0407614 -2.53033 0.742207 0.0411204 -3.43056 0.742844 0.0417778 -4.7159 0.756624 0.0177174 -0.536466 0.759961 -0.065722 -0.522713 0.759209 -0.0634176 -0.509633 0.758377 -0.0609222 -0.497283 0.757483 -0.0582451 -0.485711 0.756543 -0.055397 -0.474958 0.755575 -0.0523909 -0.465054 0.754597 -0.0492408 -0.456016 0.75363 -0.0459605 -0.447839 0.75269 -0.0425581 -0.44047 0.751788 -0.0390194 -0.433762 0.750896 -0.0352636 -0.427546 0.749958 -0.0311478 -0.421762 0.748923 -0.0265181 -0.416474 0.747775 -0.0212142 -0.411862 0.746528 -0.0150106 -0.4084 0.7453 -0.00768761 -0.407084 0.74459 1.112e-06 -0.4084 0.745299 0.00768997 -0.411862 0.746526 0.0150132 -0.416474 0.747772 0.021217 -0.421762 0.74892 0.0265211 -0.427546 0.749954 0.0311508 -0.433761 0.750892 0.0352667 -0.44047 0.751783 0.0390226 -0.447838 0.752685 0.0425615 -0.456015 0.753624 0.0459642 -0.465053 0.754591 0.0492447 -0.474957 0.755568 0.0523951 -0.48571 0.756536 0.0554016 -0.497283 0.757476 0.0582501 -0.509633 0.75837 0.0609276 -0.522712 0.759201 0.0634235 -0.536465 0.759954 0.0657284 -0.550828 0.760611 0.0678346 -0.565728 0.761154 0.0697352 -0.581087 0.761566 0.0714242 -0.596815 0.761828 0.0728971 -0.612817 0.761924 0.0741521 -0.628993 0.761844 0.0751906 -0.645241 0.761584 0.0760192 -0.66146 0.76115 0.0766494 -0.677556 0.760554 0.0770979 -0.693442 0.759816 0.0773852 -0.709038 0.758962 0.0775342 -0.724276 0.758015 0.0775683 -0.739097 0.757001 0.0775099 -0.753448 0.75594 0.0773789 -0.767285 0.75485 0.0771927 -0.780571 0.753744 0.0769654 -0.793275 0.752633 0.0767085 -0.805375 0.751529 0.0764309 -0.816858 0.750442 0.0761391 -0.827723 0.749385 0.0758377 -0.837981 0.748369 0.0755289 -0.847657 0.747406 0.0752133 -0.856793 0.746506 0.0748895 -0.865442 0.74568 0.074555 -0.873677 0.744934 0.0742062 -0.881579 0.744275 0.0738392 -0.889233 0.743712 0.07345 -0.896681 0.743278 0.0730378 -0.904575 0.743025 0.0725749 -0.914349 0.742853 0.0719823 -0.929132 0.742776 0.0711304 -0.955338 0.742915 0.0698987 -1.00479 0.743395 0.0684282 -1.0962 0.743905 0.0671324 -1.25513 0.743843 0.0660266 -1.51558 0.743355 0.0651978 -1.92293 0.743037 0.0650339 -2.53707 0.743267 0.0654946 -3.43629 0.744312 0.0662423 -4.7159 0.766 0.0291159 -0.529025 0.761432 -0.0903657 -0.514806 0.760564 -0.0870169 -0.501249 0.759614 -0.0834281 -0.488408 0.7586 -0.0796084 -0.476331 0.75754 -0.07557 -0.465055 0.756453 -0.071327 -0.454613 0.755362 -0.0668957 -0.445022 0.754287 -0.0622915 -0.436279 0.753251 -0.0575236 -0.428339 0.752261 -0.0525738 -0.421061 0.751293 -0.0473436 -0.414282 0.75028 -0.0416583 -0.407941 0.749157 -0.0353285 -0.402111 0.747889 -0.0281526 -0.396992 0.74647 -0.0198513 -0.393099 0.744997 -0.0101633 -0.391539 0.744063 2.236e-06 -0.393098 0.744996 0.0101679 -0.396992 0.746467 0.0198563 -0.402111 0.747885 0.0281579 -0.407941 0.749152 0.035334 -0.414281 0.750274 0.0416641 -0.421059 0.751287 0.0473495 -0.428337 0.752254 0.05258 -0.436277 0.753242 0.0575301 -0.44502 0.754279 0.0622984 -0.454611 0.755352 0.0669031 -0.465054 0.756443 0.0713349 -0.476329 0.757529 0.0755785 -0.488406 0.758589 0.0796176 -0.501247 0.759602 0.0834379 -0.514804 0.760552 0.0870275 -0.529023 0.761418 0.0903771 -0.543843 0.762185 0.0934797 -0.559193 0.762831 0.0963306 -0.574997 0.763339 0.0989273 -0.591167 0.763691 0.10127 -0.607611 0.763873 0.103361 -0.624229 0.763874 0.105207 -0.640922 0.763692 0.106819 -0.657591 0.763333 0.108211 -0.674145 0.76281 0.1094 -0.690496 0.762143 0.110407 -0.706572 0.761355 0.111254 -0.722306 0.76047 0.111961 -0.737645 0.759513 0.112549 -0.752542 0.758503 0.113036 -0.766959 0.757458 0.113438 -0.780865 0.756391 0.113765 -0.794235 0.755316 0.114028 -0.807051 0.754241 0.114231 -0.819304 0.75318 0.114377 -0.830992 0.752141 0.114467 -0.842125 0.751139 0.114498 -0.852725 0.750183 0.114469 -0.862825 0.749285 0.114374 -0.872475 0.748456 0.114211 -0.881738 0.747705 0.113976 -0.890692 0.747042 0.113668 -0.899417 0.74648 0.113284 -0.90795 0.746057 0.112826 -0.91696 0.745847 0.112263 -0.927905 0.745746 0.111515 -0.943855 0.74578 0.110425 -0.970859 0.746072 0.108818 -1.02006 0.746723 0.106747 -1.11019 0.747388 0.104714 -1.26776 0.747335 0.103054 -1.52739 0.746672 0.1019 -1.9344 0.746239 0.101645 -2.54804 0.746632 0.102201 -3.44524 0.748318 0.102898 -4.7159 0.78155 0.047828 -0.513769 0.76609 -0.126337 -0.498677 0.764971 -0.121415 -0.484234 0.763765 -0.116184 -0.470496 0.76249 -0.110651 -0.45751 0.761167 -0.104831 -0.445322 0.759818 -0.0987375 -0.433965 0.758468 -0.0923901 -0.423466 0.75714 -0.0858059 -0.413835 0.755858 -0.0789949 -0.405039 0.754636 -0.0719337 -0.39695 0.753441 -0.0645004 -0.389409 0.752187 -0.0564815 -0.382358 0.750788 -0.0476482 -0.375875 0.749187 -0.03776 -0.370173 0.747362 -0.0264889 -0.365789 0.745416 -0.0135382 -0.363938 0.74412 4.41e-06 -0.365789 0.745414 0.0135473 -0.370172 0.747358 0.0264985 -0.375873 0.749181 0.0377701 -0.382356 0.75078 0.0476586 -0.389406 0.752178 0.0564924 -0.396947 0.753431 0.0645116 -0.405036 0.754625 0.0719454 -0.413832 0.755846 0.0790071 -0.423463 0.757126 0.0858189 -0.433961 0.758452 0.0924038 -0.445317 0.759802 0.0987522 -0.457506 0.761149 0.104846 -0.470491 0.762471 0.110668 -0.484229 0.763744 0.116202 -0.498672 0.76495 0.121435 -0.513765 0.766068 0.126358 -0.529446 0.767078 0.130965 -0.545649 0.767962 0.135254 -0.562296 0.7687 0.139225 -0.579304 0.769275 0.142882 -0.596584 0.769673 0.146232 -0.614041 0.769884 0.149285 -0.631579 0.769908 0.152055 -0.649106 0.769749 0.154558 -0.666535 0.76942 0.156813 -0.683786 0.768941 0.15884 -0.70079 0.768332 0.160659 -0.71749 0.76762 0.16229 -0.733836 0.766824 0.163751 -0.749789 0.765966 0.165057 -0.765317 0.765061 0.166221 -0.780392 0.764123 0.167253 -0.794992 0.763162 0.168159 -0.809101 0.762189 0.168941 -0.822705 0.761213 0.169601 -0.835802 0.760243 0.170137 -0.848393 0.759293 0.170547 -0.860494 0.758372 0.170827 -0.872131 0.757495 0.170976 -0.883344 0.756674 0.170991 -0.894192 0.755922 0.170872 -0.904747 0.755252 0.170621 -0.915088 0.754685 0.170239 -0.925249 0.754268 0.16973 -0.935938 0.754101 0.169057 -0.948673 0.75407 0.168147 -0.966536 0.754209 0.166832 -0.995287 0.754642 0.164911 -1.04526 0.755425 0.16237 -1.13447 0.756183 0.159679 -1.29013 0.756126 0.157452 -1.54805 0.755293 0.155989 -1.9538 0.754758 0.155651 -2.56585 0.755418 0.15627 -3.45911 0.758097 0.156596 -4.7159 0.807332 0.0785459 -0.483906 0.778073 -0.177202 -0.467261 0.776424 -0.169982 -0.451271 0.77468 -0.16235 -0.435996 0.772864 -0.154316 -0.421493 0.770997 -0.145894 -0.407815 0.769105 -0.137103 -0.395009 0.767216 -0.127963 -0.383117 0.76536 -0.118496 -0.372166 0.763565 -0.108716 -0.36214 0.761848 -0.0985939 -0.352925 0.760166 -0.0879843 -0.344362 0.758406 -0.0766315 -0.336393 0.756451 -0.0642672 -0.3291 0.754225 -0.0506154 -0.322701 0.751703 -0.0353036 -0.317743 0.749025 -0.0180046 -0.315544 0.747222 8.444e-06 -0.317742 0.749022 0.0180218 -0.322699 0.751698 0.0353215 -0.329097 0.754217 0.0506341 -0.336389 0.75644 0.0642866 -0.344357 0.758394 0.0766517 -0.352919 0.760152 0.0880053 -0.362134 0.761831 0.0986159 -0.372159 0.763546 0.108739 -0.383109 0.765339 0.11852 -0.395 0.767193 0.127989 -0.407806 0.76908 0.13713 -0.421484 0.770969 0.145923 -0.435987 0.772834 0.154347 -0.451261 0.774648 0.162383 -0.467251 0.776389 0.170017 -0.483897 0.778036 0.17724 -0.501133 0.779567 0.184046 -0.51889 0.780962 0.190434 -0.537092 0.7822 0.196407 -0.555658 0.783263 0.201971 -0.5745 0.784138 0.207135 -0.593529 0.784814 0.211913 -0.612657 0.785289 0.216319 -0.631796 0.785569 0.220373 -0.650866 0.785664 0.224092 -0.669796 0.785592 0.227498 -0.688523 0.785374 0.23061 -0.706996 0.785032 0.233448 -0.72517 0.784586 0.236029 -0.743011 0.784055 0.238368 -0.760489 0.783453 0.240479 -0.777577 0.782791 0.242371 -0.794253 0.782078 0.244052 -0.810497 0.781323 0.245527 -0.826294 0.780533 0.246798 -0.841632 0.779718 0.247867 -0.85651 0.778889 0.248733 -0.870933 0.778058 0.249398 -0.884922 0.777241 0.249861 -0.898512 0.776452 0.250126 -0.911757 0.775711 0.250194 -0.924731 0.775036 0.25007 -0.937514 0.774456 0.249757 -0.950142 0.774034 0.249259 -0.963383 0.773907 0.248537 -0.978869 0.773936 0.247535 -0.999776 0.774159 0.246099 -1.0317 0.774686 0.244039 -1.08421 0.775527 0.241326 -1.17407 0.776286 0.238349 -1.32816 0.776214 0.235815 -1.58347 0.77529 0.234212 -1.98645 0.77474 0.233862 -2.59479 0.775841 0.234472 -3.48058 0.780065 0.23377 -4.7159 0.850068 0.128973 -0.428557 0.805059 -0.246821 -0.409325 0.802409 -0.236345 -0.3908 0.79966 -0.225316 -0.373053 0.796837 -0.213746 -0.356151 0.79397 -0.201653 -0.340164 0.791088 -0.189059 -0.325157 0.788228 -0.175992 -0.31119 0.785426 -0.162479 -0.298308 0.782722 -0.14854 -0.286517 0.780137 -0.134147 -0.275711 0.777616 -0.119128 -0.265729 0.775006 -0.10319 -0.256508 0.772157 -0.0860289 -0.248132 0.768979 -0.0673361 -0.240826 0.76546 -0.0466996 -0.235149 0.761808 -0.0237666 -0.232535 0.759373 1.5523e-05 -0.235147 0.761805 0.0237981 -0.240822 0.765453 0.0467322 -0.248126 0.768969 0.0673699 -0.256501 0.772143 0.0860641 -0.26572 0.77499 0.103227 -0.275701 0.777596 0.119166 -0.286506 0.780114 0.134186 -0.298295 0.782696 0.148582 -0.311176 0.785397 0.162524 -0.325142 0.788194 0.176039 -0.340148 0.791051 0.189109 -0.356135 0.793929 0.201706 -0.373036 0.796792 0.213803 -0.390783 0.799611 0.225377 -0.409309 0.802356 0.23641 -0.42854 0.805001 0.246891 -0.448405 0.807521 0.256813 -0.468826 0.809891 0.266176 -0.489724 0.812087 0.274983 -0.511013 0.814088 0.28324 -0.532607 0.815877 0.290959 -0.554418 0.817442 0.298154 -0.57636 0.818777 0.304843 -0.59835 0.819885 0.311043 -0.620313 0.820776 0.316777 -0.64218 0.821464 0.322065 -0.663895 0.821969 0.32693 -0.685408 0.82231 0.331394 -0.70668 0.822506 0.335477 -0.727677 0.822573 0.339198 -0.74837 0.822524 0.342575 -0.768732 0.82237 0.345623 -0.788741 0.822115 0.348355 -0.808373 0.821768 0.350781 -0.82761 0.821334 0.35291 -0.846437 0.820822 0.354748 -0.864845 0.820243 0.356301 -0.882839 0.81961 0.357573 -0.900435 0.818943 0.358571 -0.917666 0.81826 0.359298 -0.93459 0.817585 0.359761 -0.951283 0.816945 0.359966 -0.967835 0.816382 0.359918 -0.984286 0.815977 0.359614 -1.0015 0.815921 0.35901 -1.02128 0.816037 0.358097 -1.047 0.816362 0.356763 -1.08425 0.816988 0.354869 -1.14198 0.81788 0.352422 -1.23552 0.81865 0.349752 -1.39017 0.818662 0.347484 -1.64292 0.817894 0.346143 -2.04117 0.817591 0.345962 -2.64211 0.819454 0.346418 -3.51405 0.826221 0.343375 -4.7159 0.920901 0.211756 -0.330475 0.860434 -0.340798 -0.307144 0.856114 -0.3258 -0.284641 0.851702 -0.310065 -0.263054 0.847232 -0.293608 -0.242469 0.842744 -0.27645 -0.222973 0.838278 -0.258619 -0.204651 0.833883 -0.240149 -0.187585 0.829607 -0.221077 -0.171843 0.825503 -0.201428 -0.15745 0.821602 -0.181176 -0.144309 0.817833 -0.160133 -0.132256 0.814 -0.137975 -0.121222 0.809913 -0.11437 -0.111299 0.80548 -0.0889845 -0.102732 0.800713 -0.0613754 -0.0961108 0.795917 -0.0311733 -0.0929959 0.79277 2.7213e-05 -0.0961075 0.795913 0.0312284 -0.102726 0.800705 0.0614322 -0.11129 0.805468 0.0890435 -0.12121 0.809897 0.114431 -0.132241 0.81398 0.13804 -0.144293 0.817808 0.160201 -0.157431 0.821573 0.181247 -0.171822 0.825469 0.201503 -0.187562 0.829568 0.221157 -0.204627 0.833838 0.240235 -0.222948 0.838228 0.258711 -0.242443 0.842687 0.276548 -0.263028 0.847169 0.293714 -0.284615 0.851632 0.310179 -0.307119 0.856037 0.325922 -0.330452 0.860349 0.340929 -0.354526 0.864533 0.355193 -0.379254 0.868556 0.368711 -0.404543 0.872385 0.381488 -0.430303 0.875991 0.393531 -0.456438 0.879349 0.404852 -0.482857 0.88244 0.415467 -0.50947 0.885255 0.425393 -0.536192 0.88779 0.434651 -0.562947 0.89005 0.443265 -0.589666 0.892049 0.451258 -0.616294 0.8938 0.458656 -0.642781 0.895323 0.465485 -0.669088 0.896633 0.471772 -0.695182 0.897747 0.477542 -0.721036 0.898674 0.482819 -0.746622 0.899423 0.487627 -0.771918 0.899999 0.491987 -0.7969 0.900406 0.495916 -0.821549 0.90065 0.499433 -0.84585 0.900737 0.502551 -0.869795 0.900681 0.505282 -0.893387 0.900495 0.507638 -0.916645 0.900202 0.509628 -0.939607 0.899825 0.511261 -0.962339 0.899397 0.512547 -0.984932 0.898955 0.513492 -1.00749 0.898551 0.514101 -1.03007 0.8983 0.514359 -1.05366 0.898462 0.514213 -1.08034 0.898812 0.513737 -1.11379 0.899392 0.512892 -1.15974 0.900285 0.511627 -1.22673 0.901425 0.51002 -1.32867 0.902467 0.508376 -1.48847 0.90294 0.507159 -1.74095 0.902879 0.506708 -2.13283 0.903443 0.506993 -2.72044 0.90677 0.506945 -3.56712 0.918161 0.49897 -4.7159 1.03829 0.34766 -0.160792 0.96788 -0.470967 -0.131007 0.960976 -0.449641 -0.102267 0.954007 -0.427331 -0.0746807 0.947025 -0.404052 -0.0483587 0.940083 -0.379826 -0.0234127 0.93324 -0.354684 --4.4909e-05 0.926558 -0.328665 --0.0219047 0.920108 -0.301812 --0.0420693 0.913959 -0.274159 --0.0604856 0.908156 -0.245682 --0.0772348 0.902617 -0.216188 --0.0924821 0.897101 -0.185339 --0.106289 0.89138 -0.152791 --0.118541 0.885369 -0.118197 --0.128954 0.879124 -0.0810931 --0.13688 0.873055 -0.0411094 --0.140613 0.869159 4.5454e-05 --0.136885 0.873051 0.0412013 --0.128964 0.879115 0.0811878 --0.118555 0.885356 0.118295 --0.106307 0.891363 0.152895 --0.0925039 0.897079 0.185449 --0.07726 0.90259 0.216304 --0.0605137 0.908123 0.245806 --0.0420999 0.913919 0.274292 --0.0219373 0.920062 0.301955 --7.8764e-05 0.926505 0.32882 -0.0233783 0.933178 0.354851 -0.0483244 0.940013 0.380007 -0.0746474 0.946945 0.404248 -0.102236 0.953917 0.427544 -0.130979 0.960874 0.449872 -0.160768 0.967766 0.471217 -0.191495 0.974544 0.491573 -0.223052 0.981158 0.510942 -0.255333 0.987563 0.529328 -0.288229 0.993717 0.546744 -0.321636 0.999582 0.563204 -0.355448 1.00513 0.578727 -0.389567 1.01034 0.593332 -0.423903 1.0152 0.607044 -0.45837 1.0197 0.619888 -0.492899 1.02386 0.631891 -0.527427 1.02769 0.643082 -0.561906 1.0312 0.653494 -0.596295 1.0344 0.663158 -0.630562 1.03731 0.672107 -0.66468 1.03993 0.680374 -0.698626 1.04228 0.687991 -0.732379 1.04435 0.694989 -0.765921 1.04615 0.701396 -0.799236 1.04767 0.707239 -0.832314 1.04894 0.712541 -0.865155 1.04996 0.717323 -0.897769 1.05074 0.721602 -0.930186 1.05131 0.725395 -0.96246 1.0517 0.728716 -0.994675 1.05196 0.731577 -1.02695 1.05212 0.733988 -1.05943 1.05227 0.735949 -1.09218 1.05255 0.737427 -1.12641 1.05331 0.738349 -1.16452 1.05429 0.738917 -1.21068 1.05554 0.739197 -1.27086 1.05716 0.739248 -1.35331 1.05907 0.739224 -1.47062 1.06101 0.739407 -1.64274 1.0627 0.740061 -1.9001 1.06432 0.741171 -2.28509 1.06699 0.742136 -2.8503 1.07352 0.740557 -3.65204 1.09392 0.723292 -4.7159 1.23283 0.57078 --0.130431 1.17007 -0.663543 --0.170757 1.15911 -0.63297 --0.209695 1.14811 -0.601033 --0.247098 1.13717 -0.567741 --0.282816 1.12635 -0.533114 --0.316693 1.11574 -0.49718 --0.348573 1.10544 -0.459979 --0.378298 1.09553 -0.421558 --0.405723 1.08614 -0.381956 --0.430744 1.07732 -0.34116 --0.453406 1.069 -0.298988 --0.473847 1.0609 -0.255119 --0.492098 1.05279 -0.209222 --0.507993 1.0446 -0.160954 --0.52118 1.03646 -0.109857 --0.53093 1.02892 -0.0555846 --0.535417 1.02425 7.1305e-05 --0.530937 1.02892 0.0557288 --0.521193 1.03645 0.110006 --0.508012 1.04459 0.16111 --0.492123 1.05277 0.209387 --0.473876 1.06088 0.255296 --0.453439 1.06897 0.299177 --0.43078 1.07729 0.341365 --0.40576 1.0861 0.38218 --0.378337 1.09549 0.421802 --0.34861 1.10538 0.460247 --0.316728 1.11568 0.497474 --0.282847 1.12627 0.533436 --0.247123 1.13708 0.568095 --0.209712 1.14801 0.601421 --0.170764 1.15899 0.633396 --0.130426 1.16993 0.664009 --0.0888396 1.18078 0.693264 --0.0461441 1.19146 0.721168 --0.00247477 1.20191 0.747738 -0.0420365 1.21206 0.772996 -0.0872625 1.22186 0.796964 -0.133082 1.23128 0.819673 -0.17938 1.24026 0.841149 -0.226054 1.24881 0.861425 -0.273011 1.2569 0.880535 -0.320173 1.26453 0.898512 -0.367476 1.27171 0.915393 -0.414868 1.27845 0.931219 -0.462311 1.28476 0.94603 -0.509777 1.29065 0.959868 -0.557246 1.29612 0.972777 -0.604705 1.30119 0.984801 -0.652143 1.30585 0.995982 -0.699557 1.31011 1.00636 -0.746945 1.31396 1.01597 -0.794316 1.31741 1.02485 -0.84169 1.32047 1.03304 -0.889101 1.32317 1.04055 -0.936607 1.32552 1.04741 -0.984298 1.32757 1.05364 -1.0323 1.32937 1.05926 -1.08079 1.33099 1.06428 -1.12996 1.3325 1.0687 -1.17997 1.3341 1.07245 -1.23223 1.33625 1.07544 -1.28958 1.33866 1.07802 -1.35668 1.3414 1.08038 -1.43973 1.3446 1.08268 -1.54655 1.34821 1.0851 -1.68814 1.3521 1.08784 -1.88085 1.35624 1.09087 -2.14885 1.36111 1.09367 -2.52595 1.36821 1.09467 -3.05551 1.38181 1.08921 -3.78274 1.41746 1.06005 -4.7159 1.55521 0.937101 --0.6267 1.54315 -0.971235 --0.685102 1.52513 -0.926168 --0.741577 1.50708 -0.879062 --0.795901 1.4891 -0.829914 --0.84784 1.47134 -0.778736 --0.897154 1.45393 -0.725556 --0.943596 1.43703 -0.670413 --0.986918 1.4208 -0.61336 --1.02688 1.40541 -0.554452 --1.06328 1.39101 -0.493699 --1.09606 1.37756 -0.430971 --1.12528 1.36484 -0.366021 --1.15087 1.35265 -0.298586 --1.17257 1.34101 -0.22838 --1.18993 1.33019 -0.15502 --1.20216 1.32088 -0.0782576 --1.20747 1.31548 9.7027e-05 --1.20216 1.32088 0.078454 --1.18994 1.33019 0.155223 --1.17259 1.34101 0.228595 --1.15089 1.35264 0.298816 --1.12531 1.36483 0.36627 --1.09609 1.37755 0.431244 --1.0633 1.39099 0.493999 --1.0269 1.40538 0.554785 --0.98694 1.42077 0.61373 --0.943611 1.43699 0.670825 --0.897158 1.45389 0.726015 --0.84783 1.47129 0.779248 --0.795872 1.48904 0.830485 --0.741526 1.50699 0.879697 --0.685024 1.52503 0.926874 --0.626589 1.54303 0.972017 --0.566436 1.56088 1.01514 --0.504767 1.57848 1.05628 --0.441777 1.59573 1.09546 --0.377648 1.61256 1.13272 --0.312551 1.62888 1.16813 --0.246643 1.64465 1.20172 --0.180069 1.65981 1.23355 --0.112954 1.67433 1.26369 --0.0454071 1.68821 1.29217 -0.0224835 1.70143 1.31907 -0.0906491 1.714 1.34443 -0.159041 1.72593 1.36833 -0.227627 1.73724 1.39082 -0.296392 1.74793 1.41198 -0.365335 1.75802 1.43185 -0.434466 1.76751 1.45051 -0.503801 1.77642 1.46802 -0.573372 1.78474 1.48443 -0.643214 1.79248 1.49981 -0.713379 1.79966 1.5142 -0.783936 1.80629 1.52765 -0.854971 1.8124 1.54021 -0.926604 1.81803 1.55189 -0.998992 1.8232 1.56274 -1.07234 1.828 1.57278 -1.14691 1.83249 1.58203 -1.223 1.83678 1.59046 -1.30087 1.84108 1.59801 -1.38212 1.84594 1.60453 -1.46982 1.85105 1.61052 -1.56873 1.85656 1.61624 -1.68468 1.86263 1.62186 -1.82433 1.8693 1.62751 -1.99626 1.87666 1.63315 -2.21246 1.88505 1.63841 -2.48996 1.89546 1.64224 -2.8524 1.91015 1.64234 -3.33035 1.93462 1.63361 -3.95381 1.98307 1.60468 -4.7159 2.08943 1.53855 --1.45747 2.24006 -1.5088 --1.55047 2.20824 -1.43938 --1.64068 2.17617 -1.36644 --1.72765 2.14409 -1.28997 --1.81096 2.11224 -1.21001 --1.89013 2.08091 -1.12659 --1.96473 2.05039 -1.0398 --2.03429 2.02103 -0.949722 --2.09837 1.99317 -0.856487 --2.15657 1.96714 -0.760191 --2.20861 1.94311 -0.660857 --2.25429 1.92109 -0.558447 --2.29335 1.90112 -0.452912 --2.32538 1.88345 -0.344187 --2.34981 1.86854 -0.232152 --2.36588 1.85717 -0.116846 --2.37218 1.85144 9.0583e-05 --2.36589 1.85717 0.11703 --2.34981 1.86854 0.232344 --2.32538 1.88345 0.344391 --2.29337 1.90112 0.453135 --2.2543 1.9211 0.558693 --2.20862 1.94312 0.661131 --2.15657 1.96714 0.760501 --2.09836 1.99318 0.856838 --2.03427 2.02104 0.950121 --1.96469 2.0504 1.04025 --1.89007 2.08091 1.12711 --1.81086 2.11224 1.21059 --1.72752 2.14408 1.29064 --1.64051 2.17615 1.36719 --1.55025 2.20821 1.44023 --1.45718 2.24001 1.50976 --1.36172 2.27136 1.57581 --1.26425 2.30208 1.63844 --1.16514 2.33201 1.69773 --1.06475 2.36103 1.75377 --0.96337 2.38902 1.80668 --0.861304 2.41591 1.85656 --0.7588 2.44164 1.90355 --0.656081 2.46617 1.94778 --0.553332 2.4895 1.98939 --0.450707 2.51163 2.02852 --0.348323 2.53257 2.0653 --0.246267 2.55236 2.09988 --0.144594 2.57102 2.13239 --0.0433292 2.5886 2.16298 -0.0575265 2.60513 2.19178 -0.157998 2.62066 2.21892 -0.258136 2.63524 2.24451 -0.358013 2.64889 2.26869 -0.457729 2.66168 2.29154 -0.557415 2.67365 2.31318 -0.657233 2.68485 2.33367 -0.757389 2.69534 2.35311 -0.858131 2.70518 2.37154 -0.959765 2.71444 2.38903 -1.06266 2.7232 2.4056 -1.16727 2.73154 2.4213 -1.27411 2.73956 2.43613 -1.3837 2.74744 2.45001 -1.49756 2.75558 2.46285 -1.61833 2.76386 2.47507 -1.74982 2.77243 2.48689 -1.89656 2.78149 2.49845 -2.06362 2.79119 2.50976 -2.25748 2.80178 2.52072 -2.48714 2.81378 2.53096 -2.76523 2.82817 2.53974 -3.10926 2.84679 2.54575 -3.54138 2.87313 2.54683 -4.08097 2.91333 2.54028 -4.7159 2.97467 2.5261 --2.77527 3.75402 -2.684 --2.97251 3.69099 -2.5775 --3.16376 3.62794 -2.46189 --3.3478 3.56558 -2.33699 --3.52349 3.5046 -2.20273 --3.68975 3.44562 -2.05915 --3.84558 3.38919 -1.90642 --3.99008 3.33579 -1.74482 --4.12243 3.28575 -1.57479 --4.24192 3.23929 -1.39686 --4.34799 3.19652 -1.21171 --4.44019 3.15736 -1.02013 --4.51825 3.12161 -0.823016 --4.58207 3.0889 -0.62135 --4.63172 3.05869 -0.4162 --4.6675 3.03028 -0.208695 --4.68993 3.00276 0 --4.6675 3.03028 0.208695 --4.63172 3.05869 0.4162 --4.58207 3.0889 0.62135 --4.51825 3.12161 0.823016 --4.44019 3.15736 1.02013 --4.34799 3.19652 1.21171 --4.24192 3.23929 1.39686 --4.12243 3.28575 1.57479 --3.99008 3.33579 1.74482 --3.84558 3.38919 1.90642 --3.68975 3.44562 2.05915 --3.52349 3.5046 2.20273 --3.3478 3.56558 2.33699 --3.16376 3.62794 2.46189 --2.97251 3.69099 2.5775 --2.77527 3.75402 2.684 --2.5733 3.81628 2.78166 --2.3679 3.87705 2.87085 --2.16042 3.93566 2.952 --1.95222 3.99145 3.02561 --1.74466 4.04389 3.09219 --1.53913 4.09249 3.15233 --1.33697 4.13692 3.20662 --1.13948 4.17694 3.25564 --0.947911 4.21242 3.29999 --0.763435 4.24337 3.34026 --0.587126 4.26991 3.377 --0.419947 4.29227 3.41074 --0.262734 4.31076 3.44197 --0.116184 4.32576 3.47116 -0.019156 4.33771 3.49871 -0.142898 4.34706 3.52502 -0.254822 4.35429 3.55096 -0.354883 4.35987 3.57691 -0.443199 4.36421 3.60285 -0.520063 4.36791 3.6288 -0.58595 4.37159 3.65474 -0.641513 4.37528 3.68068 -0.68759 4.37896 3.70663 -0.725215 4.38265 3.73257 -0.755629 4.38633 3.75852 -0.780287 4.39001 3.78446 -0.800875 4.3937 3.8104 -0.819314 4.39738 3.83635 -0.838262 4.40107 3.86229 -0.862982 4.40475 3.88824 -0.90075 4.40843 3.91418 -0.960911 4.41212 3.94013 -1.05547 4.4158 3.96607 -1.19982 4.41948 3.99201 -1.41375 4.42317 4.01796 -1.72266 4.42685 4.0439 -2.15916 4.43054 4.06985 -2.76515 4.43422 4.09579 -3.59438 4.4379 4.12174 -4.7159 4.44159 4.14768 -0.573187 0.819942 -0.019796 -0.560432 0.819291 -0.0192078 -0.548325 0.818567 -0.0185389 -0.536925 0.817779 -0.0177956 -0.526282 0.816933 -0.0169842 -0.516437 0.816037 -0.0161131 -0.507421 0.815106 -0.0151951 -0.499255 0.814154 -0.0142482 -0.491947 0.813204 -0.0132935 -0.485489 0.812275 -0.0123523 -0.479815 0.811273 -0.011329 -0.474831 0.810003 -0.0100183 -0.470523 0.808391 -0.00834296 -0.466923 0.806532 -0.0063988 -0.464028 0.804554 -0.00432086 -0.461808 0.802524 -0.00217942 -0.460267 0.800465 0 -0.461808 0.802524 0.00217942 -0.464028 0.804554 0.00432086 -0.466923 0.806532 0.0063988 -0.470523 0.808391 0.00834296 -0.474831 0.810003 0.0100183 -0.479815 0.811273 0.011329 -0.485489 0.812275 0.0123523 -0.491947 0.813204 0.0132935 -0.499255 0.814154 0.0142482 -0.507421 0.815106 0.0151951 -0.516437 0.816037 0.0161131 -0.526282 0.816933 0.0169842 -0.536925 0.817779 0.0177956 -0.548325 0.818567 0.0185389 -0.560432 0.819291 0.0192078 -0.573187 0.819942 0.019796 -0.586522 0.820511 0.0202944 -0.600359 0.820984 0.0206902 -0.614615 0.821341 0.0209663 -0.629199 0.82156 0.0211031 -0.644017 0.82162 0.0210814 -0.658976 0.821503 0.0208861 -0.673985 0.821199 0.0205099 -0.688956 0.820707 0.0199553 -0.703808 0.82004 0.0192358 -0.718466 0.81922 0.0183741 -0.732861 0.818275 0.0173993 -0.746927 0.817237 0.0163431 -0.760602 0.816138 0.0152351 -0.773827 0.815002 0.0141006 -0.786547 0.813851 0.0129578 -0.798712 0.812697 0.0118188 -0.810277 0.811547 0.0106902 -0.821208 0.810406 0.00957593 -0.831482 0.809278 0.00847852 -0.841089 0.808167 0.00740176 -0.850033 0.807079 0.00635065 -0.858336 0.806021 0.0053313 -0.866036 0.805 0.00434999 -0.873187 0.804022 0.00341151 -0.879863 0.803089 0.00251813 -0.886153 0.802196 0.00166332 -0.892165 0.801325 0.000831013 -0.898027 0.800455 0 -0.904274 0.800455 0 -0.91202 0.800456 0 -0.925238 0.800457 0 -0.951293 0.800458 0 -1.00191 0.800459 0 -1.0944 0.80046 0 -1.25327 0.800461 0 -1.51225 0.800462 0 -1.91691 0.800462 0 -2.52802 0.800463 0 -3.42589 0.800464 0 -4.7159 0.800465 0 -0.573186 0.819941 -0.0198165 -0.560431 0.819289 -0.0192282 -0.548324 0.818566 -0.0185592 -0.536923 0.817778 -0.0178159 -0.52628 0.816931 -0.0170043 -0.516435 0.816036 -0.016133 -0.50742 0.815103 -0.0152149 -0.499254 0.814152 -0.0142678 -0.491946 0.813202 -0.0133129 -0.485487 0.812272 -0.0123715 -0.479813 0.81127 -0.0113479 -0.474828 0.81 -0.0100369 -0.470518 0.808391 -0.00836109 -0.466915 0.806534 -0.00641549 -0.464016 0.804559 -0.00433415 -0.461793 0.802532 -0.00218549 -0.460267 0.800484 0 -0.461793 0.802532 0.00218549 -0.464016 0.804559 0.00433415 -0.466915 0.806534 0.00641549 -0.470518 0.808391 0.00836109 -0.474828 0.81 0.0100369 -0.479813 0.81127 0.0113479 -0.485487 0.812272 0.0123715 -0.491946 0.813202 0.0133129 -0.499254 0.814152 0.0142678 -0.50742 0.815103 0.0152149 -0.516435 0.816036 0.016133 -0.52628 0.816931 0.0170043 -0.536923 0.817778 0.0178159 -0.548324 0.818566 0.0185592 -0.560431 0.819289 0.0192282 -0.573186 0.819941 0.0198165 -0.586521 0.82051 0.020315 -0.600359 0.820983 0.0207109 -0.614614 0.82134 0.020987 -0.629198 0.821559 0.0211238 -0.644017 0.821619 0.0211021 -0.658976 0.821502 0.0209069 -0.673985 0.821198 0.0205307 -0.688957 0.820706 0.0199761 -0.703809 0.820039 0.0192566 -0.718468 0.819219 0.0183949 -0.732862 0.818274 0.0174201 -0.746928 0.817236 0.0163638 -0.760603 0.816137 0.0152559 -0.773829 0.815002 0.0141212 -0.786549 0.81385 0.0129784 -0.798714 0.812696 0.0118393 -0.810279 0.811546 0.0107107 -0.82121 0.810405 0.00959636 -0.831484 0.809277 0.00849885 -0.841091 0.808166 0.007422 -0.850035 0.807078 0.00637081 -0.858339 0.80602 0.00535138 -0.866039 0.804999 0.00436999 -0.87319 0.804021 0.00343146 -0.879865 0.803089 0.00253805 -0.886155 0.802195 0.00168325 -0.892167 0.801325 0.000851 -0.898029 0.800457 2.0166e-05 -0.904274 0.800455 2.0279e-05 -0.912021 0.800456 2.0363e-05 -0.925239 0.800456 2.0598e-05 -0.951295 0.800457 2.1207e-05 -1.00191 0.800458 2.2066e-05 -1.0944 0.800459 2.2437e-05 -1.25328 0.80046 2.2214e-05 -1.51226 0.800461 2.2043e-05 -1.91691 0.800461 2.224e-05 -2.52802 0.800462 2.2959e-05 -3.42589 0.800463 2.4704e-05 -4.7159 0.800476 1.5878e-05 -0.573185 0.819939 -0.0198526 -0.560429 0.819287 -0.0192641 -0.548322 0.818563 -0.0185948 -0.536921 0.817775 -0.017851 -0.526278 0.816928 -0.017039 -0.516433 0.816032 -0.0161674 -0.507417 0.8151 -0.0152488 -0.49925 0.814149 -0.0143012 -0.491943 0.813198 -0.0133457 -0.485484 0.812268 -0.0124035 -0.47981 0.811265 -0.0113789 -0.474823 0.809997 -0.0100671 -0.47051 0.80839 -0.00839007 -0.466902 0.806537 -0.00644186 -0.463997 0.804566 -0.00435485 -0.461769 0.802545 -0.00219483 -0.460265 0.800517 0 -0.461769 0.802545 0.00219483 -0.463997 0.804566 0.00435486 -0.466902 0.806537 0.00644186 -0.47051 0.80839 0.00839007 -0.474823 0.809997 0.0100671 -0.47981 0.811265 0.0113789 -0.485484 0.812268 0.0124035 -0.491943 0.813198 0.0133457 -0.499251 0.814149 0.0143012 -0.507417 0.8151 0.0152488 -0.516433 0.816032 0.0161674 -0.526278 0.816928 0.017039 -0.536921 0.817775 0.017851 -0.548322 0.818563 0.0185948 -0.560429 0.819287 0.0192641 -0.573185 0.819939 0.0198526 -0.58652 0.820508 0.0203514 -0.600358 0.820981 0.0207474 -0.614614 0.821338 0.0210238 -0.629198 0.821558 0.0211607 -0.644017 0.821618 0.0211392 -0.658977 0.821501 0.0209441 -0.673986 0.821196 0.0205679 -0.688958 0.820704 0.0200134 -0.703811 0.820037 0.019294 -0.718469 0.819217 0.0184323 -0.732865 0.818272 0.0174576 -0.746931 0.817234 0.0164014 -0.760606 0.816135 0.0152934 -0.773831 0.815 0.0141588 -0.786552 0.813849 0.013016 -0.798717 0.812694 0.0118769 -0.810282 0.811545 0.0107482 -0.821214 0.810404 0.00963371 -0.831488 0.809275 0.00853612 -0.841095 0.808164 0.00745916 -0.850039 0.807076 0.00640786 -0.858343 0.806018 0.00538835 -0.866043 0.804997 0.0044069 -0.873194 0.804019 0.00346834 -0.87987 0.803087 0.00257495 -0.88616 0.802194 0.00172024 -0.892172 0.801324 0.000888225 -0.898032 0.800461 5.847e-05 -0.904275 0.800455 5.8041e-05 -0.912022 0.800455 5.8118e-05 -0.925242 0.800455 5.8641e-05 -0.951298 0.800455 6.0169e-05 -1.00191 0.800457 6.2322e-05 -1.09441 0.800458 6.3088e-05 -1.25328 0.800459 6.2282e-05 -1.51226 0.800459 6.1728e-05 -1.91692 0.80046 6.2229e-05 -2.52803 0.800461 6.4136e-05 -3.4259 0.800462 6.8726e-05 -4.7159 0.800494 4.2123e-05 -0.573182 0.819935 -0.019916 -0.560426 0.819283 -0.0193269 -0.548318 0.818559 -0.0186568 -0.536917 0.81777 -0.0179122 -0.526273 0.816923 -0.0170992 -0.516428 0.816027 -0.0162265 -0.507411 0.815094 -0.0153068 -0.499245 0.814143 -0.0143579 -0.491937 0.813192 -0.0134011 -0.48548 0.812261 -0.0124569 -0.479804 0.811258 -0.01143 -0.474815 0.809991 -0.0101159 -0.470496 0.808389 -0.00843642 -0.466881 0.806543 -0.00648354 -0.463967 0.804578 -0.00438717 -0.461733 0.802565 -0.00220925 -0.460263 0.800571 1e-09 -0.461733 0.802565 0.00220925 -0.463967 0.804578 0.00438717 -0.466881 0.806543 0.00648355 -0.470496 0.808389 0.00843643 -0.474815 0.809991 0.0101159 -0.479804 0.811258 0.01143 -0.48548 0.812261 0.0124569 -0.491937 0.813192 0.0134011 -0.499245 0.814143 0.0143579 -0.507411 0.815094 0.0153068 -0.516428 0.816027 0.0162265 -0.526274 0.816923 0.0170992 -0.536917 0.81777 0.0179122 -0.548318 0.818559 0.0186568 -0.560426 0.819283 0.0193269 -0.573182 0.819935 0.019916 -0.586518 0.820505 0.0204154 -0.600356 0.820978 0.020812 -0.614613 0.821335 0.0210888 -0.629198 0.821555 0.0212262 -0.644017 0.821615 0.021205 -0.658978 0.821498 0.0210102 -0.673988 0.821193 0.0206344 -0.68896 0.820701 0.0200802 -0.703814 0.820035 0.019361 -0.718473 0.819214 0.0184996 -0.732869 0.818269 0.0175251 -0.746935 0.817232 0.0164691 -0.760611 0.816132 0.0153613 -0.773837 0.814997 0.0142268 -0.786557 0.813846 0.013084 -0.798722 0.812692 0.011945 -0.810288 0.811542 0.0108163 -0.82122 0.810401 0.00970178 -0.831494 0.809272 0.00860412 -0.841101 0.808161 0.00752709 -0.850047 0.807073 0.00647572 -0.858351 0.806015 0.00545616 -0.866051 0.804994 0.00447472 -0.873203 0.804016 0.00353625 -0.879879 0.803085 0.00264304 -0.886169 0.802192 0.00178866 -0.892181 0.801324 0.000957326 -0.898037 0.800468 0.000130869 -0.904275 0.800455 0.000128114 -0.912026 0.800453 0.00012786 -0.925246 0.800452 0.000128611 -0.951303 0.800452 0.000131428 -1.00192 0.800455 0.000135531 -1.09442 0.800456 0.000136736 -1.2533 0.800457 0.000134718 -1.51228 0.800456 0.000133373 -1.91694 0.800456 0.000134335 -2.52805 0.800458 0.000138203 -3.42592 0.80046 0.000147435 -4.7159 0.800527 8.5426e-05 -0.573178 0.819929 -0.0200271 -0.560421 0.819277 -0.0194364 -0.548312 0.818552 -0.0187646 -0.53691 0.817762 -0.0180181 -0.526266 0.816915 -0.017203 -0.51642 0.816018 -0.0163279 -0.507402 0.815085 -0.0154057 -0.499236 0.814133 -0.014454 -0.491928 0.813182 -0.013494 -0.485471 0.812249 -0.0125458 -0.479794 0.811246 -0.0115137 -0.474801 0.809982 -0.0101949 -0.470474 0.808388 -0.00851042 -0.466848 0.806551 -0.00654932 -0.463921 0.804596 -0.00443749 -0.461677 0.802596 -0.00223153 -0.460256 0.800659 2e-09 -0.461677 0.802596 0.00223154 -0.463921 0.804596 0.0044375 -0.466848 0.806551 0.00654932 -0.470474 0.808388 0.00851042 -0.474801 0.809982 0.0101949 -0.479794 0.811246 0.0115137 -0.485471 0.812249 0.0125458 -0.491928 0.813182 0.013494 -0.499236 0.814133 0.014454 -0.507402 0.815085 0.0154057 -0.51642 0.816018 0.0163279 -0.526266 0.816915 0.017203 -0.53691 0.817762 0.0180181 -0.548312 0.818552 0.0187646 -0.560421 0.819277 0.0194364 -0.573178 0.819929 0.0200271 -0.586514 0.8205 0.0205279 -0.600353 0.820973 0.0209256 -0.614611 0.82133 0.0212035 -0.629197 0.82155 0.0213418 -0.644018 0.82161 0.0213216 -0.658979 0.821493 0.0211276 -0.673991 0.821188 0.0207526 -0.688964 0.820697 0.0201991 -0.703819 0.82003 0.0194807 -0.718479 0.819209 0.0186199 -0.732876 0.818264 0.0176461 -0.746943 0.817227 0.0165906 -0.760619 0.816127 0.0154834 -0.773846 0.814992 0.0143493 -0.786567 0.813841 0.0132069 -0.798732 0.812687 0.0120681 -0.810299 0.811536 0.0109396 -0.821231 0.810395 0.00982517 -0.831506 0.809267 0.00872759 -0.841114 0.808155 0.00765062 -0.85006 0.807067 0.00659934 -0.858365 0.806009 0.00557993 -0.866066 0.804989 0.00459874 -0.873218 0.804011 0.00366067 -0.879894 0.80308 0.00276804 -0.886185 0.802189 0.00191455 -0.892197 0.801323 0.00108495 -0.898047 0.800481 0.000266665 -0.904277 0.800456 0.000257468 -0.912031 0.80045 0.000256016 -0.925255 0.800447 0.000256608 -0.951313 0.800447 0.000261029 -1.00193 0.80045 0.000268006 -1.09443 0.800453 0.000269709 -1.25331 0.800453 0.000265373 -1.5123 0.800451 0.000262464 -1.91697 0.800451 0.000264101 -2.52808 0.800452 0.000271185 -3.42595 0.800457 0.000287928 -4.7159 0.800585 0.000156772 -0.573169 0.81992 -0.0202203 -0.560411 0.819267 -0.0196263 -0.548301 0.818541 -0.0189509 -0.536899 0.81775 -0.0182003 -0.526253 0.816901 -0.0173807 -0.516405 0.816003 -0.0165008 -0.507387 0.81507 -0.0155733 -0.49922 0.814117 -0.0146159 -0.491912 0.813165 -0.0136495 -0.485455 0.812232 -0.0126928 -0.479777 0.811227 -0.0116503 -0.474776 0.809968 -0.0103221 -0.470437 0.808386 -0.00862804 -0.466793 0.806564 -0.00665263 -0.463847 0.804624 -0.00451556 -0.461591 0.802645 -0.00226592 -0.460241 0.800801 3e-09 -0.461591 0.802645 0.00226593 -0.463847 0.804624 0.00451557 -0.466793 0.806564 0.00665265 -0.470437 0.808386 0.00862806 -0.474776 0.809968 0.0103221 -0.479777 0.811227 0.0116503 -0.485455 0.812232 0.0126928 -0.491912 0.813165 0.0136495 -0.49922 0.814117 0.0146159 -0.507387 0.81507 0.0155733 -0.516405 0.816003 0.0165009 -0.526253 0.816901 0.0173808 -0.536899 0.81775 0.0182003 -0.548301 0.818541 0.0189509 -0.560411 0.819267 0.0196264 -0.573169 0.81992 0.0202203 -0.586507 0.820491 0.020724 -0.600348 0.820964 0.0211244 -0.614607 0.821322 0.0214046 -0.629195 0.821542 0.021545 -0.644018 0.821602 0.0215266 -0.658982 0.821484 0.0213345 -0.673995 0.82118 0.0209612 -0.688971 0.820688 0.0204094 -0.703828 0.820021 0.0196927 -0.71849 0.819201 0.0188336 -0.732888 0.818256 0.0178613 -0.746957 0.817218 0.0168073 -0.760634 0.816119 0.0157013 -0.773862 0.814984 0.0145684 -0.786584 0.813833 0.013427 -0.798751 0.812678 0.012289 -0.810318 0.811528 0.0111611 -0.821251 0.810386 0.0100473 -0.831527 0.809257 0.00895018 -0.841137 0.808145 0.0078737 -0.850084 0.807057 0.00682297 -0.85839 0.805999 0.00580424 -0.866092 0.804979 0.00482394 -0.873245 0.804002 0.00388704 -0.879923 0.803072 0.00299593 -0.886215 0.802183 0.0021446 -0.892227 0.801322 0.00131901 -0.898067 0.800505 0.000518452 -0.904282 0.800457 0.000494567 -0.912043 0.800444 0.000489852 -0.92527 0.800438 0.00048909 -0.951332 0.800438 0.000495035 -1.00196 0.800444 0.000506003 -1.09446 0.800448 0.00050821 -1.25335 0.800447 0.000499617 -1.51234 0.800443 0.000493708 -1.91702 0.800441 0.000496283 -2.52814 0.800443 0.000508579 -3.42601 0.800451 0.000537308 -4.7159 0.800683 0.000274196 -0.573155 0.819904 -0.0205536 -0.560395 0.81925 -0.019953 -0.548283 0.818522 -0.0192701 -0.536877 0.81773 -0.0185113 -0.526229 0.816879 -0.0176829 -0.516379 0.81598 -0.0167933 -0.507359 0.815045 -0.0158554 -0.499191 0.814092 -0.0148866 -0.491884 0.81314 -0.0139074 -0.485428 0.812204 -0.0129343 -0.479746 0.811197 -0.011872 -0.474734 0.809947 -0.0105257 -0.470375 0.808383 -0.00881398 -0.466705 0.806584 -0.00681395 -0.46373 0.804668 -0.00463596 -0.461458 0.80272 -0.00231897 -0.460205 0.801018 5e-09 -0.461458 0.80272 0.00231899 -0.46373 0.804668 0.00463598 -0.466705 0.806584 0.00681398 -0.470375 0.808383 0.00881401 -0.474734 0.809947 0.0105257 -0.479746 0.811197 0.0118721 -0.485428 0.812204 0.0129343 -0.491884 0.81314 0.0139074 -0.499191 0.814092 0.0148866 -0.507359 0.815045 0.0158554 -0.516379 0.81598 0.0167934 -0.526229 0.816879 0.0176829 -0.536877 0.81773 0.0185114 -0.548283 0.818522 0.0192701 -0.560395 0.819249 0.019953 -0.573155 0.819904 0.0205536 -0.586495 0.820476 0.0210632 -0.600338 0.82095 0.0214689 -0.614601 0.821308 0.0217538 -0.629192 0.821528 0.0218985 -0.644018 0.821588 0.0218842 -0.658986 0.821471 0.0216959 -0.674003 0.821166 0.0213263 -0.688983 0.820674 0.0207782 -0.703843 0.820007 0.0200651 -0.718509 0.819187 0.0192096 -0.73291 0.818242 0.0182408 -0.746982 0.817205 0.0171901 -0.760661 0.816105 0.0160871 -0.773891 0.81497 0.0149569 -0.786614 0.813819 0.0138179 -0.798783 0.812663 0.0126819 -0.810352 0.811513 0.0115559 -0.821287 0.81037 0.0104436 -0.831565 0.809241 0.00934801 -0.841177 0.808129 0.00827306 -0.850126 0.80704 0.00722402 -0.858434 0.805982 0.00620726 -0.866139 0.804962 0.00522932 -0.873294 0.803987 0.00429532 -0.879974 0.803058 0.00340776 -0.886267 0.802173 0.00256127 -0.89228 0.801321 0.00174443 -0.898103 0.800544 0.000977841 -0.904294 0.800459 0.000925194 -0.912067 0.800435 0.000912684 -0.925302 0.800423 0.000907589 -0.951367 0.800422 0.000913733 -1.002 0.800432 0.000929572 -1.09451 0.800439 0.000931982 -1.25341 0.800436 0.000915791 -1.51242 0.800428 0.000904278 -1.91711 0.800423 0.000908054 -2.52825 0.800427 0.000928654 -3.42611 0.800441 0.00097616 -4.7159 0.800851 0.000467307 -0.573129 0.81988 -0.0211225 -0.560365 0.819223 -0.0205089 -0.548249 0.818493 -0.0198116 -0.53684 0.817698 -0.019037 -0.526188 0.816845 -0.0181913 -0.516334 0.815943 -0.0172832 -0.507311 0.815007 -0.0163252 -0.499141 0.814052 -0.0153347 -0.491833 0.8131 -0.0143312 -0.485377 0.812161 -0.0133275 -0.479689 0.811153 -0.0122293 -0.474659 0.809915 -0.0108497 -0.47027 0.808379 -0.009106 -0.466561 0.806614 -0.0070641 -0.463543 0.804733 -0.00482042 -0.461253 0.802836 -0.0024008 -0.46012 0.80133 1e-08 -0.461253 0.802836 0.00240083 -0.463543 0.804733 0.00482046 -0.466561 0.806614 0.00706415 -0.47027 0.808379 0.00910604 -0.474659 0.809915 0.0108497 -0.479689 0.811153 0.0122293 -0.485377 0.812161 0.0133276 -0.491833 0.8131 0.0143313 -0.499141 0.814052 0.0153347 -0.507311 0.815007 0.0163253 -0.516334 0.815943 0.0172833 -0.526188 0.816845 0.0181914 -0.53684 0.817698 0.019037 -0.548249 0.818493 0.0198116 -0.560365 0.819223 0.0205089 -0.573129 0.819879 0.0211226 -0.586473 0.820453 0.0216438 -0.600321 0.820928 0.0220599 -0.614588 0.821287 0.0223543 -0.629184 0.821507 0.0225076 -0.644017 0.821567 0.0225013 -0.658991 0.821449 0.0223208 -0.674015 0.821144 0.0219588 -0.689002 0.820651 0.0214183 -0.703869 0.819984 0.0207127 -0.718541 0.819164 0.0198646 -0.732947 0.818219 0.0189031 -0.747023 0.817182 0.0178593 -0.760707 0.816083 0.0167628 -0.773939 0.814947 0.0156385 -0.786667 0.813795 0.0145048 -0.798838 0.81264 0.0133735 -0.81041 0.811488 0.0122517 -0.821349 0.810345 0.0111434 -0.831631 0.809214 0.0100516 -0.841246 0.808101 0.00898055 -0.8502 0.807011 0.00793575 -0.858512 0.805953 0.00692378 -0.866221 0.804935 0.00595137 -0.87338 0.803961 0.00502386 -0.880064 0.803036 0.00414402 -0.886361 0.802157 0.00330782 -0.892374 0.801321 0.00250907 -0.898172 0.800602 0.00179867 -0.904328 0.800466 0.0016984 -0.912119 0.800422 0.0016689 -0.925365 0.800398 0.00165283 -0.951433 0.800396 0.00165476 -1.00207 0.800413 0.00167483 -1.0946 0.800425 0.00167616 -1.25351 0.800418 0.00164669 -1.51255 0.800403 0.00162498 -1.91727 0.800394 0.00163009 -2.52843 0.800399 0.00166365 -3.42628 0.800424 0.00173989 -4.7159 0.801136 0.000784726 -0.57308 0.819842 -0.022082 -0.560309 0.819182 -0.0214437 -0.548187 0.818448 -0.0207192 -0.536771 0.817649 -0.0199149 -0.526113 0.816792 -0.019037 -0.516253 0.815887 -0.0180944 -0.507224 0.814948 -0.0170993 -0.499049 0.813993 -0.0160686 -0.491739 0.813039 -0.0150203 -0.485281 0.812097 -0.0139618 -0.479581 0.811088 -0.0128006 -0.474523 0.809868 -0.011362 -0.470088 0.808371 -0.00956161 -0.46632 0.806655 -0.00744922 -0.463241 0.804826 -0.00510111 -0.460929 0.803008 -0.00252727 -0.45993 0.801745 1.8e-08 -0.460929 0.803007 0.00252733 -0.463241 0.804826 0.00510119 -0.46632 0.806655 0.0074493 -0.470088 0.808371 0.00956169 -0.474523 0.809868 0.0113621 -0.479581 0.811088 0.0128006 -0.485281 0.812096 0.0139619 -0.491739 0.813039 0.0150204 -0.499049 0.813992 0.0160686 -0.507224 0.814948 0.0170994 -0.516253 0.815887 0.0180944 -0.526113 0.816792 0.0190372 -0.536771 0.817648 0.019915 -0.548187 0.818448 0.0207193 -0.560309 0.819181 0.0214438 -0.57308 0.819842 0.0220821 -0.586431 0.820418 0.0226256 -0.600287 0.820895 0.0230617 -0.614562 0.821254 0.0233741 -0.629168 0.821475 0.0235441 -0.644011 0.821534 0.0235535 -0.658997 0.821415 0.0233881 -0.674033 0.821109 0.023041 -0.689031 0.820616 0.0225154 -0.703909 0.819949 0.0218247 -0.718591 0.819128 0.0209916 -0.733007 0.818183 0.0200446 -0.747091 0.817146 0.0190149 -0.760782 0.816047 0.0179318 -0.774021 0.814911 0.0168197 -0.786753 0.813758 0.0156971 -0.79893 0.812601 0.0145759 -0.810508 0.811448 0.0134634 -0.821453 0.810302 0.0123639 -0.831742 0.80917 0.0112808 -0.841364 0.808055 0.0102187 -0.850325 0.806965 0.00918355 -0.858645 0.805907 0.00818216 -0.866362 0.80489 0.00722163 -0.873529 0.80392 0.0063077 -0.88022 0.803001 0.00544369 -0.886525 0.802134 0.00462818 -0.892539 0.801327 0.00386423 -0.898304 0.800676 0.00323073 -0.904417 0.800479 0.00306672 -0.912237 0.800401 0.00300359 -0.925498 0.800358 0.00296306 -0.951565 0.800355 0.00294971 -1.00221 0.800383 0.00296881 -1.09476 0.800403 0.00296509 -1.2537 0.80039 0.00291284 -1.51278 0.800363 0.0028731 -1.91754 0.800346 0.00287926 -2.52874 0.800354 0.00293253 -3.42658 0.800399 0.00305148 -4.7159 0.801615 0.00130629 -0.572988 0.819787 -0.0236782 -0.560206 0.819121 -0.0229945 -0.548072 0.818381 -0.0222202 -0.536645 0.817576 -0.0213617 -0.525975 0.816713 -0.0204255 -0.516104 0.815804 -0.0194203 -0.507065 0.814862 -0.0183584 -0.498881 0.813905 -0.0172556 -0.491564 0.812951 -0.0161275 -0.485097 0.812004 -0.0149743 -0.479374 0.810997 -0.013707 -0.474272 0.809802 -0.012167 -0.469767 0.808358 -0.0102681 -0.465911 0.80671 -0.00803817 -0.462747 0.804956 -0.00552568 -0.460409 0.803251 -0.00272326 -0.459531 0.802247 3.4e-08 -0.460409 0.803251 0.00272336 -0.462747 0.804956 0.00552581 -0.465911 0.80671 0.00803832 -0.469767 0.808358 0.0102683 -0.474272 0.809802 0.0121672 -0.479375 0.810996 0.0137071 -0.485097 0.812004 0.0149744 -0.491564 0.81295 0.0161277 -0.498881 0.813904 0.0172557 -0.507065 0.814861 0.0183586 -0.516104 0.815804 0.0194205 -0.525975 0.816713 0.0204257 -0.536645 0.817576 0.0213619 -0.548072 0.818381 0.0222204 -0.560206 0.819121 0.0229948 -0.572988 0.819786 0.0236785 -0.586351 0.820366 0.0242631 -0.60022 0.820846 0.0247364 -0.61451 0.821207 0.0250827 -0.629132 0.821427 0.0252841 -0.643992 0.821486 0.0253231 -0.658997 0.821366 0.0251863 -0.674052 0.821059 0.0248676 -0.68907 0.820564 0.0243705 -0.703967 0.819896 0.0237085 -0.718667 0.819075 0.022904 -0.733099 0.81813 0.0219853 -0.747197 0.817092 0.020983 -0.7609 0.815993 0.0199258 -0.77415 0.814856 0.018838 -0.786892 0.813702 0.0177378 -0.799079 0.812543 0.0166374 -0.810667 0.811386 0.0155442 -0.821624 0.810238 0.0144633 -0.831924 0.809102 0.0133987 -0.84156 0.807984 0.0123557 -0.850535 0.806893 0.0113407 -0.858869 0.805836 0.0103612 -0.866601 0.804821 0.00942456 -0.873783 0.803858 0.00853728 -0.88049 0.80295 0.00770382 -0.886808 0.802105 0.0069272 -0.892826 0.801341 0.00622237 -0.898561 0.800755 0.00567234 -0.904642 0.800503 0.00544268 -0.912503 0.800375 0.00532181 -0.925785 0.8003 0.00523237 -0.951837 0.800291 0.00517992 -1.00248 0.800339 0.00518199 -1.09505 0.800372 0.00516284 -1.25404 0.800348 0.00507215 -1.51317 0.800301 0.00500146 -1.91802 0.800272 0.00500742 -2.52927 0.800287 0.00508979 -3.42708 0.800364 0.00527 -4.7159 0.802416 0.00216309 -0.572808 0.819713 -0.0262943 -0.560005 0.81904 -0.0255293 -0.547852 0.818291 -0.0246663 -0.536404 0.817477 -0.0237118 -0.525714 0.816606 -0.0226726 -0.515822 0.815689 -0.0215576 -0.506762 0.814743 -0.0203786 -0.498559 0.813783 -0.0191501 -0.491224 0.812828 -0.017884 -0.484733 0.811878 -0.0165729 -0.478968 0.810875 -0.0151334 -0.473794 0.809714 -0.0134247 -0.469186 0.808337 -0.011358 -0.465205 0.806777 -0.00893372 -0.461922 0.805124 -0.00616475 -0.459546 0.803571 -0.00302711 -0.458749 0.802792 6.5e-08 -0.459546 0.803571 0.00302728 -0.461922 0.805123 0.00616497 -0.465205 0.806776 0.00893397 -0.469186 0.808337 0.0113582 -0.473794 0.809713 0.013425 -0.478968 0.810875 0.0151336 -0.484733 0.811878 0.0165731 -0.491224 0.812827 0.0178843 -0.498559 0.813782 0.0191503 -0.506762 0.814742 0.020379 -0.515822 0.815689 0.021558 -0.525714 0.816605 0.0226731 -0.536404 0.817476 0.0237122 -0.547852 0.818291 0.0246667 -0.560006 0.819039 0.0255298 -0.572808 0.819712 0.0262949 -0.586192 0.820298 0.0269535 -0.600083 0.820782 0.0274942 -0.614398 0.821145 0.0279022 -0.629046 0.821365 0.0281609 -0.643936 0.821423 0.0282544 -0.658972 0.821301 0.0281706 -0.67406 0.820991 0.0279044 -0.68911 0.820495 0.02746 -0.704039 0.819825 0.0268512 -0.718769 0.819003 0.0260999 -0.733227 0.818058 0.025234 -0.747349 0.817021 0.0242829 -0.761074 0.815921 0.0232748 -0.774343 0.814783 0.0222332 -0.787104 0.813626 0.0211762 -0.799309 0.812462 0.0201163 -0.810916 0.811301 0.0190616 -0.821892 0.810147 0.018018 -0.832215 0.809006 0.0169907 -0.841874 0.807885 0.0159859 -0.850875 0.806792 0.0150108 -0.859237 0.805736 0.0140735 -0.866998 0.804727 0.013182 -0.874212 0.803775 0.0123436 -0.880951 0.802887 0.0115646 -0.887299 0.802075 0.010853 -0.893335 0.801364 0.01023 -0.899074 0.800826 0.00975145 -0.90517 0.800535 0.00946991 -0.913096 0.800346 0.009269 -0.926404 0.800225 0.00909371 -0.952407 0.800207 0.00895765 -1.00301 0.800284 0.00890459 -1.09559 0.80034 0.00884559 -1.25463 0.800298 0.00869096 -1.51386 0.800217 0.00856882 -1.91882 0.800168 0.00857152 -2.53017 0.800194 0.00869532 -3.42792 0.800327 0.00895941 -4.7159 0.803755 0.00357043 -0.572443 0.819632 -0.0305119 -0.559604 0.818948 -0.0296055 -0.547414 0.818186 -0.028589 -0.53593 0.817358 -0.0274694 -0.525201 0.816475 -0.0262537 -0.51527 0.815548 -0.0249511 -0.50617 0.814595 -0.0235728 -0.497927 0.813631 -0.0221313 -0.490548 0.812674 -0.0206346 -0.484002 0.811723 -0.0190693 -0.478158 0.81073 -0.0173586 -0.472871 0.809609 -0.0153767 -0.468113 0.808309 -0.0130302 -0.463956 0.806852 -0.0102887 -0.460511 0.805323 -0.00712307 -0.458065 0.80394 -0.00349533 -0.457293 0.803321 1.29e-07 -0.458065 0.80394 0.00349565 -0.460511 0.805323 0.00712346 -0.463957 0.806851 0.0102891 -0.468113 0.808308 0.0130307 -0.472871 0.809608 0.0153772 -0.478158 0.810729 0.017359 -0.484002 0.811722 0.0190698 -0.490548 0.812673 0.0206351 -0.497927 0.81363 0.0221318 -0.50617 0.814593 0.0235734 -0.51527 0.815547 0.0249518 -0.525201 0.816473 0.0262545 -0.53593 0.817357 0.0274702 -0.547414 0.818185 0.0285899 -0.559604 0.818947 0.0296065 -0.572443 0.819631 0.030513 -0.585864 0.820226 0.0313014 -0.599794 0.820717 0.0319611 -0.61415 0.821083 0.0324789 -0.628844 0.821303 0.0328402 -0.643782 0.82136 0.0330315 -0.658869 0.821235 0.0330429 -0.67401 0.820923 0.0328711 -0.689113 0.820424 0.0325215 -0.704094 0.819753 0.032008 -0.718872 0.81893 0.0313522 -0.733376 0.817985 0.0305808 -0.74754 0.816947 0.0297222 -0.761302 0.815846 0.0288029 -0.774606 0.814705 0.027846 -0.7874 0.813544 0.0268691 -0.799639 0.812375 0.0258852 -0.811282 0.811207 0.0249035 -0.822296 0.810045 0.0239312 -0.832661 0.808898 0.022975 -0.842366 0.807772 0.0220422 -0.851417 0.806677 0.0211409 -0.859835 0.805625 0.0202796 -0.867657 0.804626 0.0194667 -0.874937 0.803691 0.0187098 -0.881746 0.802832 0.0180161 -0.888166 0.802059 0.0173943 -0.894274 0.801395 0.0168584 -0.9001 0.800883 0.016431 -0.906303 0.80057 0.0161137 -0.914353 0.800331 0.0158259 -0.927709 0.800157 0.0155244 -0.953607 0.800123 0.0152351 -1.00408 0.800245 0.0150511 -1.09661 0.800337 0.0149002 -1.2557 0.80027 0.0146406 -1.51505 0.800135 0.0144361 -1.92018 0.800054 0.0144293 -2.53166 0.8001 0.0146095 -3.42929 0.800328 0.0149815 -4.7159 0.805984 0.00588188 -0.571681 0.819596 -0.0371935 -0.558776 0.818894 -0.0360475 -0.546518 0.818113 -0.0347731 -0.534964 0.817264 -0.0333772 -0.524162 0.816362 -0.0318675 -0.514155 0.815419 -0.0302534 -0.504976 0.814454 -0.0285457 -0.496647 0.813482 -0.0267548 -0.489173 0.812519 -0.0248856 -0.482514 0.811568 -0.0229226 -0.476531 0.810589 -0.0207935 -0.471069 0.809511 -0.0183796 -0.466098 0.808288 -0.0155783 -0.461704 0.806936 -0.012327 -0.458038 0.805532 -0.00855332 -0.455461 0.804292 -0.00420693 -0.454649 0.803751 2.59e-07 -0.455461 0.804292 0.00420752 -0.458038 0.805531 0.00855403 -0.461704 0.806935 0.0123278 -0.466099 0.808287 0.0155791 -0.471069 0.80951 0.0183805 -0.476531 0.810588 0.0207944 -0.482514 0.811566 0.0229235 -0.489173 0.812518 0.0248866 -0.496647 0.81348 0.0267558 -0.504976 0.814452 0.0285468 -0.514155 0.815418 0.0302547 -0.524162 0.81636 0.0318689 -0.534964 0.817262 0.0333787 -0.546518 0.81811 0.0347748 -0.558776 0.818892 0.0360494 -0.571681 0.819594 0.0371955 -0.585169 0.820204 0.0382053 -0.599168 0.820705 0.0390697 -0.613596 0.821077 0.0397777 -0.628367 0.821301 0.040318 -0.643385 0.821358 0.0406804 -0.658555 0.821233 0.0408584 -0.673782 0.820919 0.0408515 -0.688971 0.820419 0.0406665 -0.704036 0.819748 0.0403181 -0.718895 0.818926 0.0398272 -0.733476 0.817982 0.039219 -0.747711 0.816945 0.0385201 -0.761541 0.815843 0.0377554 -0.774911 0.8147 0.0369469 -0.78777 0.813534 0.0361119 -0.800076 0.812357 0.0352641 -0.811789 0.81118 0.034414 -0.82288 0.81001 0.0335704 -0.833329 0.808855 0.0327413 -0.843129 0.807725 0.0319349 -0.852284 0.806631 0.0311595 -0.860819 0.805585 0.0304229 -0.86877 0.804599 0.0297324 -0.876193 0.803686 0.0290937 -0.883159 0.802854 0.0285112 -0.88975 0.802113 0.0279878 -0.896049 0.801476 0.027526 -0.902099 0.800974 0.0271302 -0.908551 0.800651 0.0267835 -0.916845 0.800388 0.0264134 -0.93033 0.80018 0.0259584 -0.956076 0.800138 0.0254318 -1.00625 0.80032 0.0249919 -1.09859 0.800469 0.0246498 -1.25765 0.800366 0.0242209 -1.51713 0.800149 0.0238901 -1.92249 0.800021 0.023863 -2.53412 0.800103 0.024116 -3.43152 0.800486 0.0246142 -4.7159 0.809692 0.00967816 -0.570064 0.819764 -0.047582 -0.557032 0.819031 -0.0460419 -0.544645 0.818217 -0.0443458 -0.532956 0.817335 -0.0425009 -0.522014 0.8164 -0.0405157 -0.511859 0.815428 -0.0383997 -0.502522 0.814436 -0.0361636 -0.494023 0.813443 -0.0338174 -0.486362 0.812465 -0.0313651 -0.479492 0.811507 -0.0287915 -0.473273 0.810537 -0.026024 -0.467547 0.809491 -0.0229383 -0.462281 0.808323 -0.0194161 -0.457572 0.807044 -0.0153639 -0.453612 0.805718 -0.0106688 -0.450817 0.804535 -0.00526719 -0.449902 0.803984 5.26e-07 -0.450817 0.804535 0.00526835 -0.453612 0.805717 0.0106701 -0.457572 0.807043 0.0153653 -0.462281 0.808322 0.0194176 -0.467547 0.809489 0.0229399 -0.473273 0.810535 0.0260256 -0.479492 0.811505 0.0287932 -0.486362 0.812462 0.0313669 -0.494023 0.81344 0.0338193 -0.502522 0.814433 0.0361658 -0.511859 0.815424 0.038402 -0.522014 0.816396 0.0405182 -0.532956 0.817331 0.0425038 -0.544645 0.818213 0.0443488 -0.557032 0.819027 0.0460452 -0.570064 0.81976 0.0475856 -0.583677 0.820396 0.048963 -0.597802 0.820918 0.0501701 -0.612359 0.821307 0.0511993 -0.62726 0.821543 0.0520434 -0.642414 0.821608 0.0526969 -0.657723 0.82149 0.0531577 -0.67309 0.821182 0.0534292 -0.688421 0.820689 0.0535205 -0.703625 0.820025 0.0534471 -0.718622 0.819212 0.0532293 -0.733336 0.818275 0.0528907 -0.747702 0.817245 0.0524556 -0.761659 0.816148 0.0519472 -0.775157 0.815006 0.0513861 -0.788148 0.813838 0.0507895 -0.800591 0.812658 0.0501716 -0.812453 0.811475 0.0495437 -0.823707 0.810299 0.0489157 -0.834335 0.80914 0.0482958 -0.844334 0.808009 0.0476917 -0.853712 0.806918 0.0471096 -0.862493 0.805879 0.0465547 -0.870717 0.804905 0.0460304 -0.878439 0.804006 0.0455379 -0.885731 0.803189 0.0450766 -0.892677 0.802461 0.0446439 -0.899362 0.801831 0.0442364 -0.90583 0.80133 0.0438529 -0.912724 0.801012 0.0434688 -0.92146 0.800756 0.0430112 -0.935259 0.80056 0.0423856 -0.960909 0.800542 0.0415501 -1.01057 0.800803 0.0406948 -1.10242 0.801032 0.0400005 -1.26127 0.800883 0.0393064 -1.52081 0.800548 0.0387923 -1.92641 0.800353 0.0387288 -2.53818 0.800496 0.0390688 -3.43508 0.801132 0.0396913 -4.7159 0.815854 0.0159131 -0.566623 0.820562 -0.0634137 -0.553347 0.819769 -0.0612431 -0.540709 0.818891 -0.0588773 -0.528759 0.817943 -0.0563236 -0.517545 0.816943 -0.0535908 -0.507104 0.815908 -0.0506894 -0.497466 0.814856 -0.047631 -0.488647 0.813808 -0.0444267 -0.480647 0.812782 -0.041082 -0.473419 0.811786 -0.0375816 -0.466826 0.810791 -0.0338445 -0.460712 0.809731 -0.0297289 -0.455043 0.808557 -0.0250936 -0.449928 0.807264 -0.0198161 -0.445584 0.805899 -0.013748 -0.442474 0.804625 -0.00681092 -0.441394 0.803964 1.068e-06 -0.442474 0.804624 0.00681319 -0.445584 0.805897 0.0137505 -0.449927 0.807261 0.0198188 -0.455043 0.808554 0.0250964 -0.460712 0.809728 0.0297319 -0.466826 0.810787 0.0338476 -0.473419 0.811782 0.0375848 -0.480646 0.812777 0.0410855 -0.488647 0.813803 0.0444304 -0.497465 0.814851 0.047635 -0.507103 0.815902 0.0506937 -0.517544 0.816937 0.0535955 -0.528759 0.817937 0.0563287 -0.540708 0.818885 0.0588829 -0.553347 0.819763 0.0612491 -0.566623 0.820556 0.0634202 -0.580475 0.821247 0.0653903 -0.594835 0.821819 0.0671548 -0.609627 0.822251 0.0687099 -0.624764 0.822526 0.0700534 -0.640156 0.822626 0.0711856 -0.655705 0.82254 0.0721101 -0.671314 0.822264 0.0728344 -0.686888 0.821803 0.073371 -0.702336 0.821171 0.0737364 -0.717577 0.820389 0.0739508 -0.732535 0.819482 0.0740361 -0.747148 0.81848 0.0740147 -0.761357 0.817407 0.073908 -0.775115 0.816286 0.0737351 -0.78838 0.815134 0.0735124 -0.801116 0.813967 0.0732537 -0.813294 0.812794 0.0729699 -0.824892 0.811628 0.0726696 -0.835898 0.810478 0.0723596 -0.84631 0.809355 0.072044 -0.856141 0.808272 0.0717253 -0.865414 0.807241 0.071404 -0.874168 0.806271 0.0710786 -0.882457 0.805374 0.0707466 -0.890349 0.804557 0.0704044 -0.897926 0.803826 0.0700476 -0.905267 0.803193 0.069672 -0.912416 0.802694 0.0692757 -0.920016 0.802395 0.0688286 -0.929475 0.802175 0.0682561 -0.943911 0.802037 0.0674315 -0.969738 0.802096 0.066241 -1.01879 0.802456 0.0648345 -1.10974 0.802776 0.0635883 -1.26796 0.802573 0.0625038 -1.52733 0.802077 0.0617438 -1.93304 0.801792 0.0616243 -2.54481 0.802039 0.0620579 -3.44071 0.803079 0.0627544 -4.7159 0.826089 0.0261532 -0.559393 0.82304 -0.0870106 -0.545648 0.822111 -0.0838606 -0.532527 0.821093 -0.0804608 -0.520081 0.820002 -0.076818 -0.508355 0.818856 -0.0729417 -0.497386 0.817675 -0.0688437 -0.487204 0.816479 -0.0645375 -0.477828 0.815291 -0.0600362 -0.469261 0.814131 -0.0553474 -0.461465 0.81301 -0.0504535 -0.454311 0.811897 -0.045258 -0.447646 0.810714 -0.0395917 -0.44144 0.809397 -0.0332855 -0.435805 0.807924 -0.0261906 -0.430981 0.806326 -0.018127 -0.427462 0.80476 -0.0090026 -0.426157 0.803875 2.152e-06 -0.427461 0.804758 0.00900707 -0.43098 0.806324 0.0181318 -0.435805 0.807921 0.0261958 -0.441439 0.809392 0.0332909 -0.447645 0.810709 0.0395973 -0.454309 0.811891 0.0452639 -0.461464 0.813004 0.0504596 -0.469259 0.814124 0.0553539 -0.477826 0.815283 0.0600432 -0.487202 0.816471 0.0645449 -0.497384 0.817666 0.0688517 -0.508353 0.818847 0.0729503 -0.52008 0.819992 0.0768273 -0.532525 0.821082 0.0804708 -0.545646 0.8221 0.0838714 -0.559392 0.823028 0.0870222 -0.573703 0.823847 0.0899192 -0.588513 0.82454 0.0925604 -0.603749 0.825088 0.0949467 -0.619327 0.825471 0.0970815 -0.635157 0.825676 0.0989707 -0.651146 0.825692 0.100624 -0.667196 0.825515 0.102054 -0.683215 0.825151 0.103276 -0.699114 0.824615 0.104308 -0.714814 0.823927 0.105172 -0.730242 0.823112 0.105888 -0.74534 0.822196 0.106476 -0.760054 0.821205 0.106957 -0.774342 0.820159 0.107346 -0.788167 0.819077 0.10766 -0.801501 0.817973 0.107909 -0.814319 0.816857 0.108102 -0.826604 0.815741 0.108244 -0.838347 0.814635 0.10834 -0.849547 0.813548 0.108388 -0.860215 0.812492 0.108387 -0.870371 0.811478 0.108335 -0.880049 0.810517 0.108227 -0.889296 0.809621 0.108058 -0.898174 0.808798 0.107827 -0.906759 0.808058 0.107529 -0.915128 0.807418 0.107161 -0.923319 0.80692 0.106723 -0.931992 0.80665 0.106179 -0.942578 0.806482 0.105453 -0.958134 0.806428 0.104395 -0.984707 0.806597 0.102833 -1.03349 0.807055 0.100839 -1.1232 0.807442 0.0989 -1.28019 0.807168 0.0973092 -1.53886 0.806471 0.0962583 -1.94432 0.806081 0.0960681 -2.55563 0.806499 0.0965849 -3.44953 0.808166 0.0972074 -4.7159 0.843081 0.0429722 -0.544622 0.829538 -0.12125 -0.529999 0.828305 -0.116625 -0.515987 0.826974 -0.111673 -0.502638 0.825563 -0.106402 -0.49 0.824092 -0.100821 -0.478114 0.822583 -0.0949453 -0.467015 0.821059 -0.0887893 -0.456733 0.819545 -0.0823695 -0.44728 0.818064 -0.0756953 -0.438633 0.816632 -0.0687462 -0.430673 0.815207 -0.0614057 -0.423251 0.813694 -0.0534709 -0.416336 0.812003 -0.0447428 -0.410045 0.810097 -0.0350484 -0.404628 0.808001 -0.0241786 -0.400604 0.8059 -0.0120299 -0.399014 0.804659 4.265e-06 -0.400604 0.805898 0.0120387 -0.404627 0.807997 0.0241879 -0.410044 0.810092 0.0350581 -0.416334 0.811996 0.044753 -0.423249 0.813687 0.0534815 -0.43067 0.815198 0.0614168 -0.43863 0.816621 0.0687579 -0.447276 0.818053 0.0757077 -0.456729 0.819532 0.0823825 -0.467011 0.821045 0.0888032 -0.478109 0.822568 0.0949601 -0.489995 0.824076 0.100837 -0.502634 0.825546 0.106419 -0.515982 0.826955 0.111691 -0.529994 0.828286 0.116644 -0.544618 0.829518 0.121272 -0.559795 0.830634 0.125571 -0.575461 0.831613 0.129543 -0.591541 0.832439 0.133193 -0.607957 0.833092 0.13653 -0.624621 0.833559 0.139564 -0.641444 0.833831 0.142311 -0.658333 0.833905 0.144787 -0.6752 0.833788 0.147012 -0.691962 0.833492 0.149007 -0.708545 0.833038 0.150792 -0.724883 0.83245 0.152387 -0.740921 0.831751 0.153813 -0.756614 0.830966 0.155085 -0.771926 0.830115 0.15622 -0.786824 0.829214 0.15723 -0.801284 0.828277 0.158123 -0.815285 0.827313 0.158907 -0.828811 0.82633 0.159584 -0.841852 0.825339 0.160155 -0.854404 0.824347 0.160619 -0.866471 0.823365 0.160973 -0.878068 0.822404 0.161214 -0.889221 0.821477 0.161338 -0.89997 0.820595 0.161342 -0.910371 0.819773 0.161224 -0.920497 0.819024 0.160985 -0.930421 0.818371 0.160623 -0.940179 0.817866 0.160137 -0.950468 0.817625 0.159484 -0.962781 0.817507 0.158595 -0.980181 0.817528 0.157308 -1.00842 0.817785 0.155426 -1.05789 0.818297 0.152958 -1.1467 0.81868 0.150388 -1.30193 0.818311 0.148285 -1.55908 0.817399 0.146965 -1.96344 0.81691 0.146713 -2.57324 0.817606 0.147273 -3.46324 0.82023 0.147488 -4.7159 0.871282 0.0705975 -0.515705 0.844767 -0.169267 -0.499524 0.842891 -0.162491 -0.483962 0.840906 -0.155286 -0.469074 0.838833 -0.147656 -0.454917 0.836693 -0.139616 -0.44154 0.834513 -0.131179 -0.428993 0.83232 -0.122366 -0.417318 0.830145 -0.113198 -0.406545 0.828017 -0.103686 -0.396667 0.825955 -0.0938087 -0.387575 0.823909 -0.0834273 -0.379119 0.821751 -0.0723035 -0.371263 0.819362 -0.0602076 -0.364128 0.816699 -0.046944 -0.357969 0.813795 -0.0322752 -0.353328 0.810899 -0.0160852 -0.351388 0.809167 8.216e-06 -0.353327 0.810897 0.0161019 -0.357966 0.81379 0.0322926 -0.364125 0.816692 0.0469622 -0.371259 0.819353 0.0602266 -0.379114 0.82174 0.0723233 -0.387569 0.823896 0.0834481 -0.39666 0.82594 0.0938305 -0.406538 0.828 0.103709 -0.41731 0.830126 0.113222 -0.428985 0.832299 0.122392 -0.441531 0.83449 0.131207 -0.454907 0.836668 0.139645 -0.469065 0.838805 0.147688 -0.483952 0.840877 0.155319 -0.499515 0.84286 0.162528 -0.515696 0.844734 0.169306 -0.532431 0.846478 0.175653 -0.549654 0.848072 0.181571 -0.567291 0.849497 0.187069 -0.585262 0.850734 0.192158 -0.603484 0.85177 0.196853 -0.621871 0.852596 0.201174 -0.640336 0.853208 0.20514 -0.658797 0.853613 0.208774 -0.677177 0.853823 0.212097 -0.695409 0.853857 0.215133 -0.713433 0.853735 0.217902 -0.731201 0.853481 0.220423 -0.748673 0.853117 0.222714 -0.765817 0.85266 0.224789 -0.782603 0.852125 0.226661 -0.79901 0.851523 0.228341 -0.815015 0.850862 0.229835 -0.830603 0.850148 0.231148 -0.845758 0.849389 0.232284 -0.860473 0.848592 0.233242 -0.874745 0.847767 0.234023 -0.888583 0.846926 0.234625 -0.902006 0.846082 0.235048 -0.91505 0.845251 0.235291 -0.927768 0.844452 0.235355 -0.940231 0.843704 0.235241 -0.952517 0.843038 0.234949 -0.96466 0.842522 0.234475 -0.977416 0.84231 0.233764 -0.99239 0.842234 0.232773 -1.01274 0.842311 0.231351 -1.04405 0.842619 0.22931 -1.09594 0.843126 0.226645 -1.18532 0.843444 0.223781 -1.33908 0.842995 0.221402 -1.59387 0.841945 0.219972 -1.99568 0.841438 0.21972 -2.60192 0.842583 0.220236 -3.48448 0.846674 0.219356 -4.7159 0.918078 0.115974 -0.461846 0.877192 -0.234228 -0.443087 0.874121 -0.224432 -0.424997 0.870932 -0.214071 -0.407647 0.867651 -0.203153 -0.391102 0.864307 -0.191693 -0.37543 0.860933 -0.17971 -0.360693 0.857565 -0.167229 -0.346952 0.854243 -0.154275 -0.334254 0.851008 -0.140865 -0.322611 0.847886 -0.126976 -0.311921 0.844813 -0.112449 -0.302029 0.841624 -0.0970121 -0.292893 0.838171 -0.0804077 -0.284635 0.834408 -0.0624179 -0.277523 0.830398 -0.0427768 -0.272125 0.826479 -0.0213559 -0.269772 0.82414 1.5172e-05 -0.272123 0.826476 0.0213867 -0.277519 0.830392 0.0428087 -0.284629 0.834399 0.062451 -0.292885 0.838159 0.0804423 -0.30202 0.84161 0.0970483 -0.31191 0.844796 0.112487 -0.322599 0.847866 0.127016 -0.334241 0.850985 0.140907 -0.346937 0.854217 0.15432 -0.360678 0.857535 0.167277 -0.375414 0.8609 0.179761 -0.391086 0.86427 0.191748 -0.40763 0.86761 0.203212 -0.42498 0.870888 0.214134 -0.44307 0.874073 0.224499 -0.46183 0.877139 0.2343 -0.481189 0.880061 0.243534 -0.50107 0.882813 0.252204 -0.521396 0.885371 0.260319 -0.542083 0.887715 0.267891 -0.563045 0.889827 0.274938 -0.584198 0.891695 0.28148 -0.605455 0.893315 0.287539 -0.626739 0.89469 0.293139 -0.647976 0.89583 0.298305 -0.669102 0.896752 0.30306 -0.690063 0.897474 0.307428 -0.710814 0.898019 0.311432 -0.731317 0.898406 0.315092 -0.751543 0.89865 0.318427 -0.771466 0.898765 0.321454 -0.791061 0.89876 0.324188 -0.81031 0.89864 0.326641 -0.829191 0.898412 0.328825 -0.847689 0.89808 0.330748 -0.865793 0.897652 0.332415 -0.883496 0.897136 0.333831 -0.900803 0.896546 0.335 -0.917732 0.895899 0.335923 -0.934316 0.895213 0.336604 -0.950611 0.894514 0.337044 -0.966692 0.893827 0.337246 -0.982645 0.893196 0.337209 -0.998506 0.892709 0.33692 -1.01512 0.89257 0.336308 -1.03428 0.892579 0.335384 -1.05933 0.892748 0.334035 -1.09584 0.893141 0.332128 -1.15282 0.893686 0.329691 -1.24574 0.894025 0.327091 -1.40005 0.893678 0.324955 -1.65248 0.892782 0.323772 -2.04987 0.892527 0.323665 -2.64891 0.89443 0.323958 -3.51764 0.900908 0.320601 -4.7159 0.995723 0.190512 -0.36565 0.941232 -0.320616 -0.342838 0.936202 -0.306675 -0.320823 0.931058 -0.292003 -0.299689 0.925839 -0.276611 -0.279521 0.920585 -0.260515 -0.2604 0.915342 -0.243738 -0.242409 0.91016 -0.226307 -0.225627 0.905093 -0.208253 -0.21012 0.900199 -0.189597 -0.195918 0.895512 -0.170314 -0.182928 0.890957 -0.150231 -0.17099 0.886329 -0.129052 -0.160058 0.881448 -0.106494 -0.150267 0.876277 -0.0823229 -0.141903 0.870921 -0.0562467 -0.135571 0.865822 -0.028128 -0.132746 0.862803 2.6602e-05 -0.135568 0.865818 0.0281818 -0.141896 0.870914 0.0563021 -0.150257 0.876267 0.0823806 -0.160046 0.881435 0.106555 -0.170975 0.886312 0.129115 -0.182911 0.890936 0.150299 -0.195898 0.895487 0.170385 -0.210098 0.900169 0.189673 -0.225603 0.90506 0.208334 -0.242385 0.910121 0.226394 -0.260375 0.915298 0.243832 -0.279495 0.920536 0.260616 -0.299663 0.925784 0.27672 -0.320797 0.930997 0.292121 -0.342813 0.936134 0.306801 -0.365628 0.941157 0.320753 -0.389155 0.946029 0.333971 -0.413306 0.950714 0.346459 -0.437991 0.955179 0.358224 -0.463118 0.959393 0.36928 -0.488593 0.963331 0.379643 -0.514325 0.966973 0.389333 -0.540223 0.97031 0.398373 -0.566205 0.973337 0.406788 -0.592196 0.976062 0.414603 -0.61813 0.978497 0.421844 -0.643952 0.98066 0.428538 -0.669617 0.982567 0.434711 -0.695089 0.984239 0.44039 -0.720338 0.985688 0.445599 -0.745339 0.986929 0.450364 -0.77007 0.987967 0.454708 -0.79451 0.988809 0.45865 -0.818641 0.989457 0.462212 -0.842448 0.989917 0.465408 -0.865917 0.990196 0.468253 -0.889045 0.990302 0.470758 -0.911838 0.990252 0.472931 -0.934315 0.990065 0.474781 -0.956515 0.989765 0.476312 -0.978502 0.989383 0.477529 -1.00036 0.988956 0.478434 -1.0222 0.98854 0.479023 -1.04407 0.98825 0.479267 -1.06694 0.988364 0.479073 -1.09285 0.988638 0.478543 -1.12551 0.989096 0.477639 -1.1706 0.989797 0.476313 -1.23671 0.990662 0.474661 -1.3379 0.99139 0.473015 -1.49723 0.991637 0.47184 -1.74942 0.991537 0.47145 -2.14066 0.992184 0.471709 -2.72658 0.995522 0.471361 -3.57009 1.00634 0.462793 -4.7159 1.12454 0.312959 -0.19802 1.06202 -0.438434 -0.168891 1.05399 -0.418757 -0.140787 1.04588 -0.398137 -0.113814 1.03774 -0.376583 -0.0880742 1.02964 -0.354112 -0.063674 1.02163 -0.330746 -0.0407179 1.01379 -0.306514 -0.0193085 1.00619 -0.281446 --0.00046149 0.99891 -0.255566 --0.0185392 0.992 -0.228848 --0.0350023 0.985379 -0.201114 --0.0500069 0.978801 -0.172058 --0.0635886 0.972065 -0.141388 --0.0755894 0.965147 -0.108854 --0.0856847 0.958207 -0.0741503 --0.0932188 0.9518 -0.0371392 --0.0965903 0.948056 4.416e-05 --0.0932239 0.951796 0.0372285 --0.0856946 0.958201 0.0742422 --0.0756038 0.965136 0.10895 --0.0636072 0.972051 0.141489 --0.0500292 0.978783 0.172165 --0.035028 0.985357 0.201229 --0.0185678 0.991973 0.228971 --0.000492509 0.998877 0.255697 -0.0192758 1.00615 0.281588 -0.0406841 1.01375 0.306669 -0.0636399 1.02158 0.330915 -0.0880406 1.02958 0.354296 -0.113781 1.03768 0.376783 -0.140758 1.0458 0.398355 -0.168865 1.0539 0.418994 -0.197998 1.06192 0.438692 -0.228053 1.0698 0.457448 -0.258924 1.07748 0.475264 -0.290504 1.08493 0.49215 -0.322685 1.09209 0.50812 -0.355359 1.09892 0.523192 -0.388422 1.1054 0.537387 -0.421773 1.11149 0.550727 -0.455319 1.11719 0.563237 -0.488977 1.1225 0.574943 -0.522675 1.12742 0.585874 -0.556351 1.13196 0.596058 -0.589959 1.13614 0.605526 -0.623457 1.13998 0.614308 -0.656817 1.14348 0.622439 -0.690014 1.14665 0.629949 -0.723028 1.14952 0.636871 -0.755842 1.15206 0.643236 -0.788441 1.1543 0.649073 -0.820814 1.15624 0.654409 -0.852956 1.15787 0.659266 -0.884868 1.15922 0.663664 -0.916566 1.1603 0.66762 -0.948081 1.16112 0.671146 -0.979467 1.16173 0.674253 -1.01081 1.16217 0.676947 -1.04222 1.16247 0.679231 -1.07384 1.16272 0.681095 -1.10574 1.16307 0.682487 -1.13909 1.16387 0.683278 -1.17629 1.16487 0.68371 -1.22149 1.1661 0.683848 -1.28068 1.16765 0.68375 -1.36213 1.16946 0.683585 -1.47852 1.1713 0.683643 -1.64995 1.173 0.684175 -1.90681 1.17475 0.685143 -2.29111 1.17757 0.685859 -2.85475 1.18401 0.683722 -3.65347 1.20335 0.665411 -4.7159 1.33826 0.514116 --0.0909727 1.28481 -0.6106 --0.130367 1.27213 -0.5826 --0.168373 1.25941 -0.553338 --0.204853 1.24674 -0.522818 --0.239667 1.2342 -0.49105 --0.272672 1.22189 -0.458054 --0.303724 1.20991 -0.423855 --0.332679 1.19837 -0.388482 --0.359401 1.18738 -0.351957 --0.383796 1.17703 -0.314258 --0.405903 1.16724 -0.275216 --0.425848 1.15774 -0.234537 --0.443632 1.14834 -0.191943 --0.459046 1.13904 -0.147183 --0.471707 1.13008 -0.0999506 --0.480897 1.12214 -0.0501308 --0.48493 1.11762 6.8345e-05 --0.480903 1.12214 0.0502688 --0.47172 1.13007 0.100093 --0.459065 1.13903 0.147332 --0.443656 1.14833 0.192101 --0.425877 1.15773 0.234707 --0.405935 1.16722 0.275399 --0.383831 1.17701 0.314458 --0.359438 1.18735 0.352175 --0.332716 1.19834 0.388721 --0.30376 1.20987 0.424118 --0.272705 1.22185 0.458344 --0.239696 1.23415 0.491369 --0.204875 1.24667 0.52317 --0.168386 1.25934 0.553726 --0.130369 1.27204 0.583027 --0.0909619 1.2847 0.611069 --0.0503015 1.29725 0.637856 --0.00852298 1.3096 0.663397 -0.0342397 1.32169 0.687709 -0.0778543 1.33344 0.710812 -0.122191 1.34479 0.73273 -0.167127 1.3557 0.753489 -0.212542 1.36614 0.773116 -0.25833 1.37606 0.79164 -0.304394 1.38547 0.809094 -0.350653 1.39436 0.825508 -0.397038 1.40273 0.840917 -0.443497 1.41059 0.855357 -0.489989 1.41797 0.868867 -0.536485 1.42486 0.881487 -0.582966 1.43128 0.893259 -0.629418 1.43723 0.904227 -0.675834 1.44271 0.914431 -0.722212 1.44773 0.923914 -0.768555 1.4523 0.932712 -0.814874 1.45641 0.94086 -0.861195 1.46008 0.948388 -0.907554 1.46334 0.955321 -0.954013 1.4662 0.961681 -1.00066 1.46871 0.967483 -1.04763 1.47092 0.972738 -1.09508 1.47289 0.977449 -1.14322 1.47471 0.981601 -1.19218 1.47656 0.985109 -1.24334 1.47894 0.987794 -1.29957 1.48154 0.99007 -1.36551 1.48446 0.99212 -1.44737 1.4878 0.994093 -1.55298 1.49156 0.996185 -1.6934 1.49563 0.998579 -1.88506 1.50004 1.00123 -2.15207 1.5052 1.00358 -2.52809 1.51246 1.00397 -3.05605 1.52572 0.997587 -3.7811 1.55965 0.967004 -4.7159 1.6928 0.844598 --0.584708 1.69133 -0.883449 --0.641719 1.67072 -0.842464 --0.696776 1.65008 -0.799647 --0.74967 1.62955 -0.754996 --0.800184 1.60925 -0.708516 --0.8481 1.58936 -0.660222 --0.893192 1.57004 -0.610138 --0.935235 1.55147 -0.558292 --0.97401 1.53384 -0.504712 --1.00933 1.51731 -0.44939 --1.04115 1.50187 -0.392194 --1.06951 1.48729 -0.332896 --1.0943 1.47343 -0.27127 --1.11524 1.46042 -0.207104 --1.13185 1.4486 -0.140147 --1.14338 1.43878 -0.0703555 --1.14819 1.43348 9.1093e-05 --1.14339 1.43878 0.0705397 --1.13187 1.4486 0.140338 --1.11526 1.46042 0.207306 --1.09432 1.47343 0.271485 --1.06953 1.48729 0.33313 --1.04118 1.50186 0.39245 --1.00936 1.51731 0.449673 --0.974033 1.53384 0.505027 --0.935254 1.55146 0.558643 --0.893202 1.57003 0.61053 --0.848099 1.58935 0.660661 --0.800168 1.60923 0.709007 --0.749634 1.62951 0.755545 --0.696718 1.65004 0.80026 --0.641633 1.67067 0.843147 --0.584589 1.69126 0.884208 --0.525789 1.7117 0.923458 --0.465431 1.73186 0.960919 --0.403703 1.75164 0.99662 --0.34079 1.77095 1.0306 --0.276864 1.7897 1.06289 --0.212089 1.80782 1.09355 --0.146613 1.82526 1.12261 --0.0805725 1.84197 1.15012 --0.0140817 1.85796 1.17613 -0.0527627 1.87319 1.2007 -0.119885 1.88767 1.22387 -0.187228 1.90142 1.2457 -0.254756 1.91445 1.26624 -0.322448 1.92677 1.28556 -0.390299 1.9384 1.3037 -0.458316 1.94934 1.32075 -0.526516 1.9596 1.33674 -0.594928 1.9692 1.35175 -0.663591 1.97815 1.36583 -0.73256 1.98645 1.37902 -0.801903 1.99412 1.39137 -0.871713 2.00121 1.40292 -0.942112 2.00773 1.41371 -1.01326 2.01375 1.42374 -1.08536 2.01932 1.43305 -1.15866 2.02451 1.44164 -1.23348 2.02943 1.44949 -1.31006 2.0343 1.45648 -1.38995 2.03967 1.46239 -1.47626 2.04526 1.46777 -1.57376 2.05122 1.47288 -1.68828 2.05772 1.47788 -1.82648 2.06483 1.4829 -1.99696 2.07262 1.48788 -2.21174 2.08144 1.49243 -2.48779 2.0922 1.49546 -2.84878 2.10694 1.49462 -3.32546 2.1308 1.48469 -3.94887 2.17753 1.45427 -4.7159 2.28096 1.38758 --1.41314 2.44642 -1.35715 --1.5039 2.41048 -1.29441 --1.59178 2.37432 -1.22858 --1.67636 2.33819 -1.15966 --1.75724 2.30237 -1.08768 --1.83401 2.26717 -1.01266 --1.90624 2.23292 -0.934679 --1.97355 2.19998 -0.853788 --2.03551 2.16872 -0.770068 --2.09178 2.1395 -0.683576 --2.1421 2.11253 -0.594305 --2.18628 2.08784 -0.502201 --2.22403 2.06555 -0.407206 --2.25492 2.04599 -0.309274 --2.2784 2.02972 -0.208353 --2.29372 2.01759 -0.104606 --2.29958 2.0118 8.2288e-05 --2.29372 2.01759 0.104773 --2.2784 2.02972 0.208526 --2.25493 2.046 0.309459 --2.22404 2.06556 0.407408 --2.18628 2.08786 0.502424 --2.1421 2.11255 0.594555 --2.09178 2.13952 0.683858 --2.0355 2.16874 0.770388 --1.97352 2.20001 0.854153 --1.9062 2.23295 0.935095 --1.83394 2.2672 1.01314 --1.75715 2.3024 1.08822 --1.67623 2.33822 1.16028 --1.59161 2.37435 1.22928 --1.50368 2.41051 1.2952 --1.41285 2.44644 1.35804 --1.31951 2.48191 1.41782 --1.22405 2.51671 1.47457 --1.12683 2.55066 1.52835 --1.02819 2.58361 1.57925 --0.928463 2.61544 1.62733 --0.827936 2.64604 1.67271 --0.726878 2.67534 1.71548 --0.625524 2.70329 1.75577 --0.524075 2.72989 1.7937 --0.422694 2.75512 1.82937 --0.321513 2.779 1.86293 --0.220627 2.80157 1.89449 --0.120098 2.82286 1.92418 --0.0199577 2.84291 1.95213 -0.0797889 2.86177 1.97846 -0.179165 2.87949 2.00329 -0.278217 2.89612 2.02673 -0.37702 2.91172 2.0489 -0.475671 2.92632 2.06988 -0.574301 2.94 2.08977 -0.673072 2.95281 2.10865 -0.772183 2.96481 2.12658 -0.871883 2.97607 2.14363 -0.97247 2.98666 2.15983 -1.07431 2.99667 2.17521 -1.17784 3.00617 2.1898 -1.28357 3.01529 2.20359 -1.39201 3.02418 2.21649 -1.50465 3.03327 2.22833 -1.62416 3.04244 2.23958 -1.75435 3.05187 2.25045 -1.89972 3.06175 2.26106 -2.06533 3.07224 2.27144 -2.25766 3.08359 2.28145 -2.48567 3.09628 2.29072 -2.76206 3.11125 2.29846 -3.10449 3.13023 2.30335 -3.53566 3.15654 2.30317 -4.07623 3.19624 2.29519 -4.7159 3.25666 2.27973 --2.7411 4.0743 -2.38177 --2.93289 4.00272 -2.28651 --3.11815 3.9311 -2.18327 --3.29576 3.86025 -2.0719 --3.46469 3.79096 -1.95235 --3.624 3.72392 -1.82464 --3.77282 3.65976 -1.68891 --3.91039 3.599 -1.54544 --4.03607 3.54202 -1.39458 --4.14931 3.48907 -1.23681 --4.24969 3.44026 -1.07273 --4.33693 3.39552 -0.903015 --4.41091 3.35462 -0.728458 --4.47166 3.31713 -0.54992 --4.51942 3.28246 -0.368335 --4.5546 3.24981 -0.184688 --4.57784 3.21817 0 --4.5546 3.24981 0.184688 --4.51942 3.28246 0.368335 --4.47166 3.31713 0.54992 --4.41091 3.35462 0.728458 --4.33693 3.39552 0.903015 --4.24969 3.44026 1.07273 --4.14931 3.48907 1.23681 --4.03607 3.54202 1.39458 --3.91039 3.599 1.54544 --3.77282 3.65976 1.68891 --3.624 3.72392 1.82464 --3.46469 3.79096 1.95235 --3.29576 3.86025 2.0719 --3.11815 3.9311 2.18327 --2.93289 4.00272 2.28651 --2.7411 4.0743 2.38177 --2.54394 4.14503 2.46931 --2.34269 4.21409 2.54943 --2.13864 4.28071 2.62252 --1.93314 4.34416 2.689 --1.72757 4.40384 2.74934 --1.52333 4.45921 2.80405 --1.3218 4.50988 2.85362 --1.12436 4.55558 2.8986 --0.932325 4.59618 2.93949 --0.746946 4.63168 2.9768 --0.569386 4.66223 3.01103 --0.400701 4.68807 3.04263 --0.241817 4.70956 3.07204 --0.0935209 4.72712 3.09966 -0.0435573 4.74124 3.12585 -0.168951 4.75245 3.15094 -0.28237 4.76128 3.17572 -0.383708 4.76823 3.20051 -0.473034 4.7738 3.22529 -0.550603 4.77865 3.25007 -0.616866 4.78348 3.27485 -0.672464 4.78831 3.29963 -0.718236 4.79314 3.32441 -0.755233 4.79797 3.34919 -0.784724 4.8028 3.37397 -0.808213 4.80763 3.39875 -0.827449 4.81246 3.42353 -0.844437 4.81729 3.44832 -0.861914 4.82212 3.4731 -0.885151 4.82695 3.49788 -0.921409 4.83178 3.52266 -0.980016 4.83661 3.54744 -1.07294 4.84144 3.57222 -1.21557 4.84627 3.597 -1.42763 4.8511 3.62178 -1.73448 4.85593 3.64656 -2.16867 4.86076 3.67135 -2.77198 4.8656 3.69613 -3.59809 4.87043 3.72091 -4.7159 4.87526 3.74569 -0.598581 0.870174 -0.0191169 -0.586231 0.869482 -0.0185498 -0.574503 0.868714 -0.0179047 -0.563453 0.867877 -0.0171878 -0.55313 0.866979 -0.016405 -0.543574 0.866029 -0.0155645 -0.534817 0.86504 -0.0146787 -0.526879 0.86403 -0.0137649 -0.519768 0.863022 -0.0128434 -0.513478 0.862035 -0.0119347 -0.507942 0.860972 -0.0109467 -0.503058 0.859624 -0.00968112 -0.498807 0.857914 -0.00806304 -0.495227 0.855941 -0.00618487 -0.492322 0.853842 -0.00417695 -0.490065 0.851687 -0.00210712 -0.488464 0.849502 0 -0.490065 0.851687 0.00210712 -0.492322 0.853842 0.00417695 -0.495227 0.855941 0.00618487 -0.498807 0.857914 0.00806304 -0.503058 0.859624 0.00968112 -0.507942 0.860972 0.0109467 -0.513478 0.862035 0.0119347 -0.519768 0.863022 0.0128434 -0.526879 0.86403 0.0137649 -0.534817 0.86504 0.0146787 -0.543574 0.866029 0.0155645 -0.55313 0.866979 0.016405 -0.563453 0.867877 0.0171878 -0.574503 0.868714 0.0179047 -0.586231 0.869482 0.0185498 -0.598581 0.870174 0.0191169 -0.611485 0.870778 0.0195976 -0.62487 0.871279 0.0199791 -0.638652 0.871658 0.0202453 -0.652744 0.871891 0.020377 -0.667055 0.871955 0.020356 -0.681495 0.871831 0.0201676 -0.695974 0.871508 0.0198047 -0.710411 0.870986 0.0192698 -0.724726 0.870279 0.0185759 -0.73885 0.869408 0.0177447 -0.752716 0.868405 0.0168044 -0.766262 0.867304 0.0157854 -0.779431 0.866137 0.0147163 -0.792166 0.864933 0.0136214 -0.804415 0.863711 0.0125185 -0.816129 0.862486 0.0114189 -0.827265 0.861266 0.0103294 -0.837791 0.860055 0.00925338 -0.847684 0.858858 0.00819355 -0.856934 0.857679 0.00715351 -0.865546 0.856524 0.0061381 -0.873541 0.855401 0.00515323 -0.880954 0.854318 0.00420498 -0.887839 0.85328 0.003298 -0.894267 0.85229 0.00243449 -0.900324 0.851342 0.00160816 -0.906113 0.850418 0.000803505 -0.911758 0.849494 0 -0.917801 0.849495 0 -0.925335 0.849495 0 -0.938315 0.849496 0 -0.964083 0.849497 0 -1.01433 0.849497 0 -1.10631 0.849498 0 -1.26447 0.849499 0 -1.52244 0.849499 0 -1.92566 0.8495 0 -2.53475 0.849501 0 -3.42979 0.849501 0 -4.7159 0.849502 0 -0.59858 0.870173 -0.0191374 -0.58623 0.869481 -0.0185702 -0.574502 0.868713 -0.017925 -0.563452 0.867876 -0.017208 -0.553129 0.866978 -0.016425 -0.543573 0.866028 -0.0155845 -0.534815 0.865039 -0.0146985 -0.526877 0.864029 -0.0137845 -0.519766 0.86302 -0.0128628 -0.513476 0.862034 -0.011954 -0.50794 0.86097 -0.0109657 -0.503054 0.859623 -0.00969969 -0.498801 0.857915 -0.00808083 -0.495218 0.855944 -0.00620079 -0.492309 0.853848 -0.00418895 -0.49005 0.851697 -0.00211136 -0.488465 0.849521 0 -0.49005 0.851697 0.00211136 -0.492309 0.853848 0.00418895 -0.495218 0.855944 0.00620079 -0.498801 0.857915 0.00808083 -0.503054 0.859623 0.00969969 -0.50794 0.86097 0.0109657 -0.513476 0.862034 0.011954 -0.519766 0.86302 0.0128628 -0.526877 0.864029 0.0137845 -0.534815 0.865039 0.0146985 -0.543573 0.866028 0.0155845 -0.553129 0.866978 0.016425 -0.563452 0.867876 0.017208 -0.574502 0.868713 0.017925 -0.58623 0.869481 0.0185702 -0.59858 0.870173 0.0191374 -0.611485 0.870777 0.0196181 -0.624869 0.871279 0.0199997 -0.638652 0.871658 0.0202659 -0.652744 0.871891 0.0203977 -0.667055 0.871954 0.0203767 -0.681495 0.87183 0.0201883 -0.695975 0.871507 0.0198255 -0.710411 0.870986 0.0192906 -0.724727 0.870278 0.0185966 -0.738851 0.869407 0.0177654 -0.752717 0.868404 0.0168251 -0.766264 0.867303 0.0158061 -0.779432 0.866137 0.014737 -0.792168 0.864932 0.0136421 -0.804417 0.863711 0.0125391 -0.81613 0.862486 0.0114395 -0.827267 0.861265 0.0103499 -0.837793 0.860055 0.0092738 -0.847686 0.858857 0.00821388 -0.856936 0.857678 0.00717375 -0.865549 0.856523 0.00615825 -0.873543 0.8554 0.0051733 -0.880957 0.854317 0.00422497 -0.887842 0.853279 0.00331794 -0.89427 0.85229 0.0024544 -0.900326 0.851342 0.00162808 -0.906115 0.850418 0.000823472 -0.91176 0.849496 2.0122e-05 -0.917802 0.849495 2.0261e-05 -0.925335 0.849495 2.035e-05 -0.938316 0.849495 2.0595e-05 -0.964085 0.849496 2.1207e-05 -1.01433 0.849497 2.1985e-05 -1.10631 0.849497 2.2214e-05 -1.26448 0.849498 2.1953e-05 -1.52244 0.849498 2.181e-05 -1.92566 0.849499 2.2014e-05 -2.53475 0.8495 2.2721e-05 -3.4298 0.849501 2.446e-05 -4.7159 0.849514 1.451e-05 -0.598579 0.870171 -0.0191733 -0.586229 0.86948 -0.0186059 -0.5745 0.868711 -0.0179604 -0.563449 0.867874 -0.017243 -0.553126 0.866976 -0.0164597 -0.54357 0.866025 -0.0156187 -0.534812 0.865036 -0.0147323 -0.526873 0.864027 -0.0138178 -0.519762 0.863018 -0.0128956 -0.513473 0.862031 -0.011986 -0.507936 0.860967 -0.0109967 -0.503048 0.859621 -0.00972962 -0.498791 0.857916 -0.00810911 -0.495204 0.855949 -0.00622581 -0.492289 0.853858 -0.00420756 -0.490027 0.851712 -0.00211789 -0.488466 0.849555 0 -0.490027 0.851712 0.00211789 -0.492289 0.853858 0.00420756 -0.495204 0.855949 0.00622581 -0.498791 0.857916 0.00810912 -0.503048 0.859621 0.00972962 -0.507936 0.860967 0.0109967 -0.513473 0.862031 0.011986 -0.519762 0.863018 0.0128956 -0.526873 0.864027 0.0138178 -0.534812 0.865036 0.0147323 -0.54357 0.866025 0.0156187 -0.553126 0.866976 0.0164597 -0.563449 0.867874 0.017243 -0.5745 0.868711 0.0179604 -0.586229 0.86948 0.0186059 -0.598579 0.870171 0.0191733 -0.611484 0.870776 0.0196542 -0.624868 0.871277 0.020036 -0.638651 0.871656 0.0203024 -0.652744 0.871889 0.0204343 -0.667055 0.871953 0.0204134 -0.681496 0.871829 0.0202252 -0.695976 0.871506 0.0198624 -0.710413 0.870984 0.0193276 -0.724729 0.870277 0.0186337 -0.738853 0.869406 0.0178026 -0.752719 0.868403 0.0168624 -0.766266 0.867302 0.0158433 -0.779435 0.866135 0.0147743 -0.792171 0.864931 0.0136794 -0.80442 0.863709 0.0125763 -0.816134 0.862484 0.0114767 -0.82727 0.861264 0.010387 -0.837797 0.860053 0.00931089 -0.84769 0.858856 0.00825088 -0.85694 0.857676 0.00721065 -0.865552 0.856522 0.00619505 -0.873547 0.855399 0.00521001 -0.880961 0.854316 0.00426161 -0.887846 0.853278 0.00335455 -0.894274 0.852288 0.00249103 -0.900331 0.851341 0.00166479 -0.90612 0.850418 0.000860411 -0.911763 0.849501 5.8091e-05 -0.917802 0.849495 5.7735e-05 -0.925337 0.849494 5.7824e-05 -0.938319 0.849494 5.8372e-05 -0.964088 0.849494 5.9897e-05 -1.01433 0.849495 6.1816e-05 -1.10632 0.849496 6.2203e-05 -1.26448 0.849497 6.1325e-05 -1.52245 0.849497 6.0864e-05 -1.92567 0.849497 6.1385e-05 -2.53476 0.849498 6.3256e-05 -3.42981 0.849499 6.7819e-05 -4.7159 0.849534 3.834e-05 -0.598576 0.870169 -0.0192362 -0.586226 0.869477 -0.0186681 -0.574496 0.868709 -0.0180219 -0.563446 0.867871 -0.0173037 -0.553122 0.866973 -0.0165195 -0.543565 0.866022 -0.0156775 -0.534807 0.865032 -0.01479 -0.526868 0.864023 -0.0138743 -0.519756 0.863014 -0.0129507 -0.513467 0.862026 -0.0120393 -0.507929 0.860962 -0.0110475 -0.503037 0.859618 -0.00977788 -0.498775 0.857917 -0.00815414 -0.49518 0.855957 -0.00626515 -0.492258 0.853873 -0.00423644 -0.489992 0.851736 -0.00212798 -0.488469 0.849612 1e-09 -0.489992 0.851736 0.00212798 -0.492258 0.853873 0.00423645 -0.49518 0.855957 0.00626516 -0.498775 0.857917 0.00815414 -0.503037 0.859618 0.00977788 -0.507929 0.860962 0.0110475 -0.513467 0.862026 0.0120393 -0.519756 0.863014 0.0129507 -0.526868 0.864023 0.0138743 -0.534807 0.865032 0.01479 -0.543565 0.866022 0.0156775 -0.553122 0.866973 0.0165195 -0.563446 0.867871 0.0173037 -0.574496 0.868709 0.0180219 -0.586226 0.869477 0.0186681 -0.598576 0.870169 0.0192362 -0.611482 0.870773 0.0197176 -0.624867 0.871275 0.0200999 -0.63865 0.871654 0.0203667 -0.652743 0.871887 0.020499 -0.667056 0.871951 0.0204784 -0.681496 0.871827 0.0202905 -0.695977 0.871504 0.019928 -0.710415 0.870982 0.0193935 -0.724732 0.870274 0.0186998 -0.738856 0.869404 0.017869 -0.752723 0.868401 0.0169289 -0.76627 0.8673 0.0159101 -0.77944 0.866133 0.0148412 -0.792176 0.864928 0.0137464 -0.804425 0.863707 0.0126435 -0.816139 0.862482 0.0115439 -0.827276 0.861261 0.0104542 -0.837803 0.860051 0.00937804 -0.847696 0.858853 0.00831797 -0.856947 0.857674 0.00727766 -0.86556 0.856519 0.00626199 -0.873555 0.855396 0.0052769 -0.880969 0.854313 0.00432851 -0.887854 0.853275 0.00342152 -0.894283 0.852286 0.00255817 -0.90034 0.851339 0.00173225 -0.906129 0.850417 0.000928528 -0.911768 0.849509 0.0001294 -0.917803 0.849495 0.000126813 -0.92534 0.849492 0.00012659 -0.938323 0.849491 0.000127392 -0.964093 0.849491 0.000130194 -1.01434 0.849493 0.000133803 -1.10633 0.849495 0.000134232 -1.26449 0.849494 0.000132102 -1.52246 0.849494 0.000130984 -1.92569 0.849494 0.000131996 -2.53478 0.849495 0.000135777 -3.42983 0.849497 0.000144922 -4.7159 0.84957 7.7329e-05 -0.598572 0.870165 -0.0193458 -0.586221 0.869473 -0.0187763 -0.57449 0.868704 -0.0181285 -0.563439 0.867866 -0.0174085 -0.553114 0.866967 -0.0166223 -0.543557 0.866016 -0.0157781 -0.534798 0.865026 -0.0148882 -0.526858 0.864016 -0.0139697 -0.519746 0.863008 -0.013043 -0.513457 0.862019 -0.0121275 -0.507916 0.860954 -0.0111305 -0.50302 0.859613 -0.00985556 -0.498749 0.85792 -0.00822566 -0.495143 0.85597 -0.0063269 -0.492209 0.853896 -0.00428121 -0.489938 0.851773 -0.0021436 -0.488471 0.849707 1e-09 -0.489938 0.851773 0.00214361 -0.492209 0.853896 0.00428123 -0.495143 0.85597 0.00632691 -0.498749 0.85792 0.00822566 -0.50302 0.859613 0.00985556 -0.507916 0.860954 0.0111305 -0.513457 0.862019 0.0121275 -0.519746 0.863007 0.013043 -0.526858 0.864016 0.0139697 -0.534798 0.865026 0.0148882 -0.543557 0.866016 0.0157781 -0.553114 0.866967 0.0166223 -0.563439 0.867866 0.0174085 -0.57449 0.868704 0.0181285 -0.586221 0.869473 0.0187763 -0.598572 0.870165 0.0193458 -0.611478 0.87077 0.0198285 -0.624864 0.871272 0.0202118 -0.638648 0.871651 0.0204796 -0.652742 0.871884 0.0206127 -0.667056 0.871948 0.0205929 -0.681498 0.871823 0.0204057 -0.69598 0.8715 0.020044 -0.710419 0.870978 0.0195101 -0.724737 0.87027 0.0188172 -0.738862 0.8694 0.0179869 -0.75273 0.868397 0.0170475 -0.766278 0.867296 0.0160293 -0.779448 0.866129 0.0149609 -0.792185 0.864925 0.0138665 -0.804435 0.863703 0.0127639 -0.816149 0.862478 0.0116646 -0.827287 0.861257 0.010575 -0.837814 0.860046 0.00949898 -0.847708 0.858849 0.00843899 -0.856959 0.857669 0.00739874 -0.865573 0.856514 0.00638315 -0.873569 0.855391 0.00539819 -0.880983 0.854308 0.00445004 -0.887869 0.853271 0.00354342 -0.894298 0.852282 0.00268062 -0.900356 0.851336 0.00185556 -0.906145 0.850417 0.00105352 -0.911779 0.849523 0.000262297 -0.917805 0.849496 0.000253502 -0.925346 0.84949 0.000252129 -0.938332 0.849486 0.000252825 -0.964104 0.849487 0.000257231 -1.01435 0.84949 0.000263303 -1.10634 0.849491 0.000263567 -1.26451 0.84949 0.000259063 -1.52249 0.849489 0.000256637 -1.92572 0.849488 0.000258385 -2.53482 0.849489 0.000265283 -3.42986 0.849494 0.000281798 -4.7159 0.849632 0.000141068 -0.598564 0.870159 -0.0195357 -0.586211 0.869466 -0.0189632 -0.57448 0.868697 -0.018312 -0.563427 0.867858 -0.0175882 -0.553101 0.866958 -0.0167978 -0.543542 0.866006 -0.015949 -0.534782 0.865016 -0.015054 -0.526841 0.864006 -0.01413 -0.519729 0.862997 -0.013197 -0.513439 0.862008 -0.012273 -0.507895 0.860942 -0.0112655 -0.502991 0.859606 -0.0099801 -0.498706 0.857925 -0.00833883 -0.495084 0.855991 -0.00642343 -0.492133 0.853932 -0.00435034 -0.489855 0.851831 -0.00216784 -0.48847 0.849864 3e-09 -0.489855 0.851831 0.00216785 -0.492133 0.853932 0.00435035 -0.495084 0.85599 0.00642345 -0.498706 0.857925 0.00833884 -0.502991 0.859606 0.00998011 -0.507895 0.860942 0.0112655 -0.513439 0.862008 0.012273 -0.519729 0.862997 0.013197 -0.526841 0.864006 0.01413 -0.534782 0.865016 0.015054 -0.543542 0.866006 0.015949 -0.553101 0.866958 0.0167978 -0.563427 0.867858 0.0175882 -0.57448 0.868697 0.018312 -0.586211 0.869466 0.0189632 -0.598564 0.870159 0.0195357 -0.611471 0.870764 0.020021 -0.624859 0.871266 0.0204067 -0.638645 0.871645 0.0206765 -0.65274 0.871878 0.0208115 -0.667056 0.871942 0.0207934 -0.6815 0.871817 0.0206079 -0.695985 0.871494 0.0202477 -0.710426 0.870972 0.0197154 -0.724746 0.870264 0.019024 -0.738873 0.869393 0.0181953 -0.752742 0.86839 0.0172573 -0.766292 0.867289 0.0162404 -0.779463 0.866123 0.0151733 -0.792201 0.864918 0.01408 -0.804451 0.863696 0.0129783 -0.816167 0.862471 0.0118797 -0.827306 0.86125 0.0107909 -0.837834 0.860039 0.00971532 -0.847729 0.858841 0.00865579 -0.856981 0.857661 0.007616 -0.865596 0.856506 0.00660092 -0.873593 0.855383 0.00561661 -0.881009 0.8543 0.00466929 -0.887896 0.853263 0.00376378 -0.894326 0.852275 0.00290243 -0.900384 0.851331 0.00207944 -0.906174 0.850417 0.00128127 -0.911798 0.849549 0.000507165 -0.917809 0.849498 0.000484222 -0.925357 0.849485 0.000479715 -0.938348 0.849478 0.000479187 -0.964122 0.849478 0.000485174 -1.01438 0.849483 0.000494636 -1.10637 0.849486 0.000494316 -1.26455 0.849483 0.000485469 -1.52253 0.84948 0.000480514 -1.92577 0.849477 0.000483323 -2.53487 0.84948 0.000495242 -3.42992 0.849488 0.000523452 -4.7159 0.849738 0.00024531 -0.598549 0.870149 -0.0198621 -0.586195 0.869456 -0.0192835 -0.574461 0.868685 -0.0186255 -0.563406 0.867846 -0.0178941 -0.553078 0.866944 -0.0170953 -0.543517 0.865992 -0.0162373 -0.534754 0.865001 -0.0153323 -0.526811 0.86399 -0.0143971 -0.519698 0.862982 -0.0134516 -0.513407 0.86199 -0.0125113 -0.507858 0.860924 -0.0114837 -0.502941 0.859596 -0.0101787 -0.498636 0.857934 -0.00851694 -0.494989 0.856022 -0.00657348 -0.492013 0.853988 -0.00445649 -0.489729 0.851922 -0.0022056 -0.488458 0.850111 5e-09 -0.489729 0.851922 0.00220562 -0.492013 0.853988 0.00445652 -0.494989 0.856022 0.00657351 -0.498636 0.857933 0.00851697 -0.502941 0.859596 0.0101787 -0.507858 0.860924 0.0114837 -0.513407 0.86199 0.0125114 -0.519698 0.862982 0.0134516 -0.526811 0.86399 0.0143972 -0.534754 0.865001 0.0153323 -0.543517 0.865991 0.0162373 -0.553078 0.866944 0.0170953 -0.563406 0.867845 0.0178941 -0.574461 0.868685 0.0186255 -0.586195 0.869456 0.0192835 -0.598549 0.870149 0.0198621 -0.611459 0.870755 0.0203528 -0.624849 0.871258 0.0207432 -0.638638 0.871637 0.0210172 -0.652737 0.87187 0.021156 -0.667056 0.871933 0.0211415 -0.681504 0.871808 0.0209593 -0.695992 0.871484 0.0206024 -0.710437 0.870962 0.0200735 -0.724761 0.870254 0.0193854 -0.738891 0.869383 0.01856 -0.752764 0.86838 0.0176252 -0.766316 0.867279 0.0166114 -0.779489 0.866112 0.0155471 -0.792228 0.864908 0.0144563 -0.804481 0.863685 0.0133569 -0.816198 0.86246 0.0122602 -0.827338 0.861239 0.011173 -0.837868 0.860027 0.010099 -0.847765 0.858828 0.00904085 -0.85702 0.857648 0.00800249 -0.865637 0.856492 0.00698899 -0.873636 0.855369 0.00600653 -0.881054 0.854286 0.00506144 -0.887944 0.85325 0.00415868 -0.894375 0.852264 0.00330071 -0.900436 0.851323 0.00248237 -0.906226 0.850418 0.00169263 -0.911834 0.849591 0.000951174 -0.917822 0.849502 0.000900611 -0.925381 0.849477 0.000888637 -0.938379 0.849465 0.000884078 -0.964157 0.849464 0.000890499 -1.01442 0.849472 0.000904052 -1.10642 0.849476 0.000902225 -1.2646 0.849472 0.000885634 -1.5226 0.849464 0.000875922 -1.92586 0.84946 0.000880174 -2.53498 0.849463 0.000900051 -3.43002 0.849478 0.000946472 -4.7159 0.849919 0.000415934 -0.598524 0.870135 -0.0204172 -0.586165 0.86944 -0.0198268 -0.574428 0.868668 -0.0191555 -0.563369 0.867826 -0.0184094 -0.553037 0.866923 -0.0175944 -0.543471 0.865969 -0.0167187 -0.534705 0.864977 -0.0157945 -0.526759 0.863967 -0.0148382 -0.519644 0.862958 -0.0138688 -0.513351 0.861965 -0.0128982 -0.507793 0.860897 -0.011834 -0.502855 0.859581 -0.0104935 -0.498519 0.857946 -0.00879553 -0.494834 0.856069 -0.00680521 -0.491823 0.854072 -0.00461852 -0.489535 0.852063 -0.00226482 -0.48841 0.850476 9e-09 -0.489535 0.852063 0.00226485 -0.491823 0.854072 0.00461856 -0.494834 0.856069 0.00680526 -0.498519 0.857946 0.00879557 -0.502855 0.859581 0.0104935 -0.507793 0.860897 0.0118341 -0.513351 0.861965 0.0128982 -0.519644 0.862958 0.0138688 -0.526759 0.863967 0.0148383 -0.534705 0.864977 0.0157945 -0.543471 0.865969 0.0167188 -0.553037 0.866923 0.0175944 -0.563369 0.867826 0.0184094 -0.574428 0.868668 0.0191555 -0.586165 0.86944 0.0198268 -0.598524 0.870135 0.0204173 -0.611438 0.870742 0.0209184 -0.624832 0.871245 0.0213181 -0.638625 0.871624 0.0216004 -0.65273 0.871857 0.0217468 -0.667055 0.871919 0.0217394 -0.681509 0.871793 0.021564 -0.696004 0.871469 0.0212139 -0.710455 0.870946 0.0206917 -0.724785 0.870237 0.0200104 -0.738922 0.869366 0.0191918 -0.752799 0.868363 0.0182638 -0.766356 0.867262 0.0172563 -0.779533 0.866095 0.016198 -0.792275 0.864891 0.0151128 -0.804531 0.863668 0.0140182 -0.816251 0.862442 0.012926 -0.827395 0.86122 0.0118427 -0.837928 0.860007 0.0107723 -0.847829 0.858807 0.00971768 -0.857087 0.857626 0.00868296 -0.865708 0.856469 0.00767342 -0.873712 0.855346 0.00669545 -0.881133 0.854264 0.00575555 -0.888027 0.85323 0.00485893 -0.894462 0.852247 0.0040083 -0.900526 0.851311 0.00319979 -0.906317 0.850421 0.00242737 -0.911901 0.849653 0.00173977 -0.917855 0.849511 0.0016436 -0.925433 0.849466 0.00161541 -0.938441 0.849442 0.00160057 -0.964223 0.849441 0.00160345 -1.01449 0.849455 0.00162045 -1.10651 0.849462 0.00161501 -1.26471 0.849453 0.00158492 -1.52273 0.849438 0.0015665 -1.92602 0.84943 0.00157255 -2.53516 0.849436 0.00160477 -3.43019 0.849461 0.00167889 -4.7159 0.850224 0.000695455 -0.598476 0.870115 -0.0213501 -0.586111 0.869418 -0.0207373 -0.574367 0.868643 -0.020041 -0.563302 0.867798 -0.0192673 -0.552963 0.866893 -0.0184221 -0.54339 0.865936 -0.0175136 -0.534617 0.864943 -0.0165537 -0.526665 0.863933 -0.0155585 -0.519546 0.862925 -0.0145451 -0.513247 0.861929 -0.0135201 -0.507673 0.860861 -0.0123921 -0.502703 0.859563 -0.0109892 -0.49832 0.857966 -0.00922849 -0.494579 0.856138 -0.00716068 -0.49152 0.854198 -0.00486438 -0.489234 0.85228 -0.00235863 -0.488273 0.850974 1.6e-08 -0.489234 0.85228 0.00235868 -0.49152 0.854198 0.00486445 -0.494579 0.856138 0.00716076 -0.49832 0.857966 0.00922858 -0.502703 0.859563 0.0109893 -0.507673 0.86086 0.0123921 -0.513247 0.861929 0.0135201 -0.519546 0.862925 0.0145452 -0.526665 0.863933 0.0155586 -0.534617 0.864943 0.0165538 -0.543391 0.865936 0.0175137 -0.552963 0.866892 0.0184222 -0.563302 0.867798 0.0192674 -0.574367 0.868642 0.0200411 -0.586111 0.869418 0.0207374 -0.598476 0.870115 0.0213502 -0.611397 0.870723 0.0218713 -0.624799 0.871227 0.0222888 -0.6386 0.871607 0.0225869 -0.652714 0.871838 0.0227479 -0.667049 0.8719 0.0227541 -0.681514 0.871773 0.022592 -0.69602 0.871447 0.0222551 -0.710483 0.870923 0.0217462 -0.724823 0.870213 0.0210784 -0.73897 0.869342 0.0202733 -0.752856 0.868338 0.0193585 -0.766421 0.867237 0.018364 -0.779605 0.86607 0.0173179 -0.792353 0.864865 0.0162439 -0.804614 0.863642 0.0151596 -0.816339 0.862415 0.0140766 -0.827488 0.861191 0.0130019 -0.838028 0.859976 0.0119396 -0.847935 0.858774 0.010893 -0.857201 0.857591 0.00986659 -0.865829 0.856434 0.00886599 -0.87384 0.855311 0.0078979 -0.881269 0.85423 0.00696916 -0.88817 0.853198 0.00608535 -0.894613 0.85222 0.00524971 -0.900683 0.851296 0.00446087 -0.906475 0.850434 0.00372163 -0.912029 0.849736 0.00310766 -0.917941 0.849531 0.00295046 -0.925548 0.849452 0.0028903 -0.938571 0.849409 0.0028525 -0.964352 0.849405 0.00284176 -1.01463 0.849429 0.00285752 -1.10666 0.84944 0.00284367 -1.26489 0.849423 0.00279054 -1.52296 0.849398 0.00275661 -1.92629 0.849383 0.00276458 -2.53546 0.849392 0.0028155 -3.43048 0.849437 0.00293053 -4.7159 0.850738 0.00115372 -0.598386 0.870091 -0.0228967 -0.58601 0.86939 -0.0222427 -0.574254 0.868611 -0.0215008 -0.563177 0.867762 -0.0206768 -0.552826 0.866852 -0.0197769 -0.543242 0.865893 -0.0188091 -0.534457 0.864898 -0.0177851 -0.526494 0.863888 -0.0167199 -0.519364 0.862881 -0.0156282 -0.513051 0.861881 -0.014509 -0.507449 0.860814 -0.0132737 -0.502429 0.859541 -0.0117648 -0.497976 0.857998 -0.00989731 -0.494155 0.856239 -0.00770247 -0.491029 0.85438 -0.00523563 -0.488754 0.852598 -0.00250879 -0.487946 0.851589 3e-08 -0.488754 0.852598 0.00250888 -0.491029 0.854379 0.00523575 -0.494155 0.856238 0.00770261 -0.497976 0.857997 0.00989744 -0.502429 0.859541 0.0117649 -0.507449 0.860814 0.0132738 -0.513051 0.861881 0.0145091 -0.519364 0.86288 0.0156284 -0.526494 0.863888 0.0167201 -0.534457 0.864898 0.0177853 -0.543242 0.865892 0.0188093 -0.552826 0.866852 0.0197771 -0.563177 0.867761 0.0206771 -0.574255 0.86861 0.0215011 -0.58601 0.86939 0.022243 -0.598386 0.87009 0.022897 -0.611318 0.870701 0.0234548 -0.624733 0.871206 0.0239051 -0.638548 0.871585 0.0242329 -0.652678 0.871816 0.0244211 -0.66703 0.871876 0.0244531 -0.681513 0.871747 0.024316 -0.696038 0.871419 0.024004 -0.710519 0.870893 0.0235204 -0.724878 0.870182 0.0228782 -0.739042 0.869309 0.0220989 -0.752943 0.868306 0.0212098 -0.766521 0.867204 0.0202401 -0.779717 0.866037 0.0192177 -0.792476 0.864831 0.0181658 -0.804746 0.863607 0.017102 -0.816481 0.862377 0.0160379 -0.82764 0.861151 0.0149809 -0.83819 0.859933 0.0139356 -0.848109 0.858728 0.012906 -0.857387 0.857542 0.0118972 -0.866029 0.856383 0.0109153 -0.874053 0.85526 0.00996755 -0.881497 0.854181 0.00906122 -0.888413 0.853155 0.00820246 -0.894871 0.852187 0.00739567 -0.900955 0.851283 0.00664365 -0.906751 0.850463 0.00596058 -0.912277 0.849832 0.0054268 -0.918159 0.849569 0.0052065 -0.925806 0.849438 0.00509156 -0.938848 0.849363 0.00500786 -0.964616 0.849355 0.00496164 -1.01489 0.849395 0.00496191 -1.10695 0.849412 0.00492898 -1.26522 0.849382 0.00483728 -1.52334 0.849338 0.00477662 -1.92675 0.849312 0.00478599 -2.53598 0.849329 0.00486436 -3.43097 0.849407 0.00503765 -4.7159 0.851597 0.00190549 -0.598209 0.87007 -0.0254224 -0.585813 0.869364 -0.0246951 -0.574038 0.868579 -0.0238721 -0.56294 0.867723 -0.0229592 -0.552568 0.866808 -0.0219628 -0.542962 0.865844 -0.0208909 -0.534155 0.864847 -0.0197547 -0.526169 0.863836 -0.0185675 -0.519015 0.86283 -0.0173403 -0.512673 0.861828 -0.016064 -0.507021 0.860766 -0.0146546 -0.501924 0.859526 -0.0129707 -0.497368 0.858049 -0.0109247 -0.493434 0.85638 -0.00852368 -0.490219 0.854634 -0.00579447 -0.487956 0.853034 -0.00275 -0.48726 0.852283 5.8e-08 -0.487956 0.853034 0.00275015 -0.490219 0.854634 0.00579468 -0.493434 0.85638 0.00852392 -0.497368 0.858049 0.0109249 -0.501924 0.859526 0.0129709 -0.507021 0.860765 0.0146548 -0.512673 0.861828 0.0160643 -0.519015 0.862829 0.0173405 -0.526169 0.863836 0.0185678 -0.534155 0.864846 0.0197551 -0.542962 0.865843 0.0208913 -0.552568 0.866807 0.0219632 -0.56294 0.867723 0.0229597 -0.574038 0.868578 0.0238726 -0.585813 0.869364 0.0246957 -0.598209 0.87007 0.025423 -0.611162 0.870684 0.0260468 -0.624598 0.871191 0.0265565 -0.638438 0.87157 0.0269381 -0.652593 0.8718 0.027176 -0.666973 0.871857 0.0272551 -0.681487 0.871725 0.0271641 -0.696043 0.871393 0.026898 -0.710555 0.870865 0.0264609 -0.724944 0.870152 0.0258659 -0.739136 0.869278 0.0251343 -0.753064 0.868274 0.0242926 -0.766664 0.867172 0.0233693 -0.77988 0.866004 0.0223912 -0.792658 0.864797 0.0213812 -0.804946 0.863571 0.0203566 -0.816698 0.862338 0.0193293 -0.827875 0.861107 0.0183072 -0.838445 0.859885 0.0172959 -0.848385 0.858675 0.0163004 -0.857686 0.857486 0.0153267 -0.866352 0.856325 0.0143816 -0.874403 0.855202 0.0134731 -0.881875 0.854128 0.0126088 -0.888821 0.853111 0.0117959 -0.89531 0.852161 0.0110403 -0.901423 0.851289 0.0103498 -0.907237 0.850521 0.00974468 -0.912768 0.849938 0.00928008 -0.918664 0.849632 0.00900961 -0.926375 0.849439 0.00881859 -0.939441 0.849316 0.00865428 -0.965163 0.849298 0.00853157 -1.0154 0.849363 0.00848254 -1.10747 0.849391 0.00840767 -1.26579 0.84934 0.00825273 -1.52401 0.849264 0.00814748 -1.92753 0.849221 0.00815638 -2.53686 0.849251 0.00827361 -3.43179 0.849385 0.00852607 -4.7159 0.853032 0.00313932 -0.597852 0.870085 -0.0294802 -0.58542 0.86937 -0.0286255 -0.573609 0.868575 -0.0276624 -0.562474 0.867709 -0.0265967 -0.552063 0.866784 -0.025435 -0.542416 0.865814 -0.0241853 -0.533565 0.864812 -0.022858 -0.525534 0.8638 -0.0214641 -0.51833 0.862793 -0.02001 -0.511924 0.86179 -0.0184807 -0.506186 0.860738 -0.0167973 -0.500973 0.859538 -0.0148322 -0.496271 0.85814 -0.0124937 -0.492181 0.856579 -0.00976239 -0.488845 0.854972 -0.00663432 -0.486575 0.853576 -0.00313383 -0.48593 0.853003 1.14e-07 -0.486575 0.853576 0.00313411 -0.488845 0.854972 0.00663469 -0.492181 0.856579 0.0097628 -0.496271 0.858139 0.0124941 -0.500973 0.859538 0.0148326 -0.506186 0.860737 0.0167977 -0.511925 0.861789 0.0184811 -0.51833 0.862792 0.0200105 -0.525534 0.863799 0.0214647 -0.533565 0.864811 0.0228586 -0.542416 0.865812 0.024186 -0.552063 0.866784 0.0254358 -0.562474 0.867708 0.0265976 -0.573609 0.868574 0.0276633 -0.58542 0.869369 0.0286265 -0.597852 0.870084 0.0294813 -0.610841 0.870704 0.0302206 -0.624315 0.871214 0.0308347 -0.638195 0.871594 0.0313117 -0.652394 0.871822 0.0316383 -0.666821 0.871876 0.0318018 -0.681383 0.87174 0.0317931 -0.69599 0.871406 0.0316093 -0.710553 0.870874 0.0312552 -0.724992 0.870159 0.0307446 -0.739231 0.869285 0.0300979 -0.753202 0.86828 0.0293408 -0.766842 0.867178 0.0285004 -0.780094 0.86601 0.0276023 -0.792905 0.864802 0.0266685 -0.805226 0.863572 0.0257161 -0.817011 0.862334 0.0247574 -0.828222 0.861098 0.0238013 -0.838828 0.859869 0.0228547 -0.848808 0.858653 0.021924 -0.858152 0.85746 0.0210161 -0.866867 0.856298 0.020139 -0.874971 0.855178 0.0193009 -0.882501 0.854112 0.0185097 -0.88951 0.853111 0.0177731 -0.896066 0.852187 0.0170978 -0.902248 0.851353 0.0164926 -0.908131 0.850631 0.0159712 -0.913745 0.850073 0.0155568 -0.919743 0.849742 0.0152517 -0.927572 0.849494 0.0149779 -0.940684 0.849314 0.0146947 -0.966305 0.849279 0.0144308 -1.01642 0.849378 0.014265 -1.10845 0.849426 0.014102 -1.26682 0.849341 0.0138454 -1.52517 0.849216 0.0136686 -1.92886 0.849146 0.0136727 -2.5383 0.849198 0.0138426 -3.43312 0.849426 0.0141959 -4.7159 0.855422 0.00516505 -0.597109 0.870221 -0.0358852 -0.584611 0.869493 -0.034815 -0.572733 0.868681 -0.0336164 -0.561528 0.867799 -0.0322954 -0.551043 0.866858 -0.0308584 -0.541317 0.865874 -0.0293134 -0.532383 0.864863 -0.0276698 -0.524261 0.863844 -0.0259362 -0.516955 0.862831 -0.0241155 -0.510428 0.861828 -0.0221897 -0.504544 0.860788 -0.0200845 -0.499155 0.859631 -0.0176783 -0.49425 0.85831 -0.0148721 -0.489951 0.85686 -0.0116207 -0.486448 0.855392 -0.0078931 -0.484113 0.854163 -0.00373156 -0.483455 0.853678 2.31e-07 -0.484113 0.854163 0.00373209 -0.486448 0.855392 0.00789375 -0.489951 0.85686 0.0116214 -0.49425 0.85831 0.0148728 -0.499155 0.85963 0.0176791 -0.504544 0.860786 0.0200853 -0.510428 0.861826 0.0221906 -0.516955 0.86283 0.0241164 -0.524261 0.863842 0.0259373 -0.532383 0.864861 0.0276709 -0.541318 0.865872 0.0293147 -0.551043 0.866857 0.0308598 -0.561528 0.867797 0.032297 -0.572733 0.868679 0.0336181 -0.584611 0.869491 0.0348168 -0.597109 0.870219 0.0358872 -0.610164 0.870851 0.0368231 -0.623706 0.871369 0.0376167 -0.637656 0.871753 0.038259 -0.651929 0.871982 0.03874 -0.666433 0.872035 0.0390508 -0.681076 0.871898 0.0391858 -0.695766 0.871561 0.0391448 -0.710412 0.871029 0.0389346 -0.724932 0.870314 0.038569 -0.739249 0.869441 0.0380682 -0.753293 0.86844 0.0374562 -0.767003 0.86734 0.0367583 -0.78032 0.866174 0.0359985 -0.793194 0.864965 0.0351977 -0.805576 0.863733 0.0343726 -0.817425 0.862491 0.0335362 -0.828704 0.861248 0.0326987 -0.839383 0.860013 0.0318684 -0.849443 0.858792 0.0310531 -0.858877 0.857596 0.0302608 -0.867691 0.856435 0.0294993 -0.875905 0.855322 0.0287765 -0.883558 0.854269 0.0280993 -0.890702 0.853289 0.0274736 -0.897406 0.852392 0.0269038 -0.90375 0.851588 0.026393 -0.909815 0.850892 0.025944 -0.915641 0.850342 0.0255616 -0.921877 0.849997 0.025229 -0.929939 0.849717 0.0248769 -0.94317 0.849496 0.0244488 -0.968642 0.849442 0.0239647 -1.01848 0.849584 0.0235696 -1.11034 0.849662 0.0232328 -1.2687 0.849527 0.0228167 -1.52718 0.849325 0.0225302 -1.93109 0.849216 0.0225219 -2.54069 0.849306 0.022759 -3.43527 0.849689 0.0232284 -4.7159 0.859401 0.00849185 -0.595544 0.870712 -0.0458045 -0.58292 0.869955 -0.0443794 -0.570912 0.869112 -0.0427961 -0.559572 0.868198 -0.0410599 -0.548944 0.867226 -0.0391771 -0.539067 0.866212 -0.0371556 -0.52997 0.865175 -0.0350042 -0.521671 0.864132 -0.0327302 -0.514171 0.863101 -0.0303354 -0.507429 0.862085 -0.0278023 -0.501308 0.861049 -0.0250561 -0.495661 0.859919 -0.0219711 -0.490479 0.858651 -0.018436 -0.485902 0.857273 -0.0143845 -0.482162 0.855886 -0.00976532 -0.47967 0.854719 -0.00463759 -0.478934 0.85423 4.7e-07 -0.47967 0.854718 0.00463862 -0.482162 0.855885 0.00976652 -0.485902 0.857272 0.0143858 -0.490479 0.85865 0.0184374 -0.495661 0.859917 0.0219726 -0.501308 0.861047 0.0250576 -0.507429 0.862083 0.027804 -0.514171 0.863098 0.0303372 -0.521671 0.86413 0.0327322 -0.52997 0.865172 0.0350063 -0.539067 0.866209 0.0371579 -0.548944 0.867223 0.0391796 -0.559571 0.868195 0.0410627 -0.570912 0.869109 0.0427992 -0.58292 0.869952 0.0443827 -0.595544 0.870709 0.0458081 -0.608722 0.871365 0.0470704 -0.622388 0.871903 0.0481648 -0.636463 0.872303 0.0490861 -0.650864 0.872543 0.0498291 -0.665501 0.872606 0.0503903 -0.680279 0.872476 0.0507688 -0.695105 0.872148 0.0509684 -0.709888 0.871625 0.0509984 -0.724543 0.870922 0.0508734 -0.738993 0.870061 0.0506129 -0.753166 0.869072 0.0502393 -0.767 0.867985 0.0497757 -0.780441 0.866828 0.049244 -0.793437 0.865627 0.048664 -0.805945 0.864399 0.0480521 -0.817925 0.863159 0.0474217 -0.829344 0.861917 0.046784 -0.840176 0.860681 0.0461483 -0.850406 0.859462 0.0455229 -0.860028 0.85827 0.0449152 -0.86905 0.857116 0.0443316 -0.877497 0.856013 0.0437772 -0.885406 0.854974 0.0432554 -0.892832 0.854009 0.042768 -0.899844 0.853128 0.0423143 -0.906523 0.852336 0.0418921 -0.912952 0.851646 0.041498 -0.919177 0.851093 0.0411306 -0.925834 0.850746 0.040764 -0.934316 0.850464 0.0403305 -0.947842 0.850238 0.0397423 -0.973209 0.850186 0.0389693 -1.02256 0.850377 0.0381984 -1.11398 0.850491 0.03755 -1.27215 0.850285 0.0368922 -1.53072 0.849969 0.0364474 -1.93487 0.849803 0.0364147 -2.54462 0.84996 0.0367312 -3.43872 0.850593 0.0373107 -4.7159 0.866019 0.0139565 -0.592237 0.872124 -0.0608519 -0.57937 0.871302 -0.0588582 -0.56711 0.87039 -0.0566627 -0.555507 0.869404 -0.0542697 -0.544604 0.86836 -0.0516853 -0.534437 0.867275 -0.0489176 -0.525034 0.866167 -0.0459756 -0.516412 0.865058 -0.0428679 -0.50857 0.863965 -0.0395976 -0.50147 0.862897 -0.0361479 -0.494981 0.86182 -0.0324376 -0.488959 0.860659 -0.0283264 -0.4834 0.859365 -0.0236863 -0.478453 0.857952 -0.018435 -0.47438 0.856506 -0.0125073 -0.471618 0.855232 -0.00597453 -0.470744 0.854642 9.64e-07 -0.471617 0.855232 0.00597658 -0.474379 0.856504 0.0125096 -0.478453 0.85795 0.0184375 -0.483399 0.859362 0.0236889 -0.488959 0.860656 0.0283292 -0.494981 0.861817 0.0324406 -0.50147 0.862894 0.036151 -0.50857 0.863962 0.0396009 -0.516411 0.865054 0.0428715 -0.525034 0.866163 0.0459795 -0.534437 0.86727 0.0489218 -0.544604 0.868355 0.0516899 -0.555506 0.869399 0.0542747 -0.567109 0.870384 0.0566682 -0.579369 0.871296 0.0588641 -0.592236 0.872118 0.0608583 -0.605652 0.872835 0.0626484 -0.619552 0.873427 0.064233 -0.633859 0.873876 0.0656121 -0.648492 0.874161 0.066787 -0.663362 0.874265 0.0677605 -0.678374 0.874176 0.0685381 -0.693436 0.873888 0.0691286 -0.708456 0.873406 0.0695445 -0.723348 0.872745 0.069802 -0.738034 0.871927 0.0699202 -0.752443 0.87098 0.0699199 -0.766515 0.869933 0.0698221 -0.780196 0.868814 0.069647 -0.793441 0.867646 0.0694124 -0.806208 0.866448 0.0691341 -0.818465 0.865234 0.0688254 -0.830181 0.864016 0.0684969 -0.841337 0.862802 0.0681574 -0.851921 0.861604 0.0678136 -0.861931 0.86043 0.0674702 -0.871377 0.859294 0.0671297 -0.880285 0.858207 0.066793 -0.888692 0.85718 0.0664589 -0.896652 0.856222 0.066125 -0.90423 0.855343 0.0657876 -0.911505 0.854548 0.0654422 -0.918558 0.853852 0.0650843 -0.92543 0.853294 0.0647104 -0.932759 0.852957 0.0642873 -0.941932 0.852697 0.0637484 -0.956056 0.852507 0.0629749 -0.981567 0.852495 0.0618691 -1.03033 0.85273 0.0605928 -1.12091 0.852869 0.0594596 -1.27854 0.852565 0.0584576 -1.53697 0.852086 0.057803 -1.94128 0.851845 0.0577316 -2.55103 0.852113 0.0581308 -3.44416 0.85314 0.0587656 -4.7159 0.877018 0.0229341 -0.585333 0.87576 -0.0831499 -0.571995 0.874781 -0.0802695 -0.559251 0.873707 -0.0771262 -0.547148 0.872553 -0.0737229 -0.535729 0.871337 -0.0700654 -0.525031 0.870077 -0.0661627 -0.515081 0.868795 -0.0620258 -0.5059 0.867511 -0.0576658 -0.497494 0.866248 -0.0530888 -0.489832 0.865016 -0.0482776 -0.482793 0.86378 -0.0431386 -0.476238 0.862451 -0.0375089 -0.470162 0.860964 -0.0312415 -0.464722 0.85932 -0.0242417 -0.460193 0.857591 -0.0164326 -0.457045 0.855999 -0.00789588 -0.455971 0.855199 1.964e-06 -0.457045 0.855998 0.00789995 -0.460193 0.85759 0.016437 -0.464721 0.859317 0.0242464 -0.470161 0.860961 0.0312465 -0.476237 0.862447 0.0375142 -0.482792 0.863775 0.0431441 -0.489831 0.865011 0.0482835 -0.497493 0.866242 0.053095 -0.505899 0.867504 0.0576725 -0.515079 0.868787 0.0620331 -0.525029 0.870069 0.0661705 -0.535728 0.871328 0.0700738 -0.547146 0.872544 0.073732 -0.559249 0.873698 0.077136 -0.571994 0.874772 0.0802801 -0.585331 0.87575 0.0831614 -0.599206 0.876616 0.0857803 -0.613553 0.87735 0.0881405 -0.628302 0.877933 0.0902478 -0.64337 0.878347 0.0921103 -0.658672 0.878576 0.0937388 -0.674117 0.878608 0.0951456 -0.689611 0.878441 0.0963456 -0.705065 0.878079 0.0973555 -0.720395 0.877538 0.0981936 -0.735524 0.87684 0.0988795 -0.750385 0.87601 0.0994329 -0.764921 0.875076 0.0998729 -0.779083 0.874065 0.100218 -0.79283 0.872999 0.100483 -0.806127 0.871896 0.100684 -0.818945 0.870771 0.10083 -0.831263 0.869633 0.100931 -0.843063 0.868494 0.100993 -0.854337 0.867361 0.101019 -0.865085 0.866244 0.101011 -0.875318 0.865153 0.100966 -0.885056 0.8641 0.100882 -0.894333 0.863094 0.100755 -0.903197 0.862146 0.100581 -0.911708 0.861266 0.100355 -0.91994 0.860463 0.100074 -0.92797 0.859756 0.0997326 -0.935835 0.859191 0.0993276 -0.944186 0.858872 0.0988163 -0.954434 0.858645 0.0981358 -0.969621 0.858509 0.0971439 -0.99581 0.858554 0.0956885 -1.04426 0.85881 0.0938645 -1.13367 0.858927 0.0921181 -1.29019 0.858485 0.0906815 -1.54805 0.85779 0.0897843 -1.95216 0.857455 0.0896644 -2.56148 0.857904 0.090131 -3.45267 0.859535 0.0906672 -4.7159 0.895294 0.037685 -0.571259 0.884386 -0.115252 -0.557039 0.883047 -0.11103 -0.543398 0.8816 -0.106462 -0.530387 0.880064 -0.10155 -0.518051 0.878457 -0.0963002 -0.506431 0.8768 -0.0907234 -0.495563 0.875116 -0.0848334 -0.485476 0.873431 -0.078645 -0.476186 0.87177 -0.0721675 -0.467679 0.870147 -0.0653831 -0.459842 0.868517 -0.0581819 -0.452537 0.866772 -0.0503736 -0.445758 0.864822 -0.0417902 -0.439662 0.862658 -0.0323257 -0.434536 0.860362 -0.0218918 -0.430882 0.858204 -0.01058 -0.429541 0.857074 3.942e-06 -0.430882 0.858203 0.0105881 -0.434535 0.860359 0.0219003 -0.439661 0.862654 0.0323348 -0.445756 0.864817 0.0417997 -0.452535 0.866766 0.0503836 -0.459839 0.86851 0.0581924 -0.467676 0.870138 0.0653942 -0.476183 0.87176 0.0721794 -0.485472 0.873421 0.0786576 -0.495559 0.875105 0.0848469 -0.506427 0.876787 0.0907379 -0.518047 0.878443 0.0963157 -0.530383 0.880049 0.101567 -0.543394 0.881584 0.10648 -0.557035 0.88303 0.111049 -0.571256 0.884369 0.115273 -0.585999 0.885583 0.119154 -0.601201 0.886654 0.122702 -0.616791 0.887562 0.125927 -0.632691 0.888292 0.128845 -0.648817 0.888827 0.131473 -0.665081 0.88916 0.133832 -0.681396 0.889288 0.135942 -0.697677 0.889217 0.137825 -0.713843 0.888962 0.139503 -0.729824 0.888544 0.140994 -0.745557 0.887986 0.14232 -0.760992 0.887315 0.143498 -0.776084 0.886556 0.144543 -0.790799 0.885729 0.145471 -0.805109 0.884851 0.146293 -0.818988 0.883934 0.147017 -0.832419 0.882988 0.147651 -0.845386 0.88202 0.148198 -0.857881 0.881038 0.14866 -0.869902 0.880048 0.149035 -0.881455 0.879061 0.149321 -0.892555 0.878085 0.149514 -0.903228 0.877133 0.14961 -0.913516 0.876216 0.149605 -0.923474 0.875347 0.149496 -0.933172 0.87454 0.14928 -0.942684 0.873818 0.148955 -0.952044 0.873241 0.148514 -0.961937 0.872936 0.1479 -0.973832 0.872738 0.147065 -0.990774 0.872642 0.145856 -1.01852 0.872717 0.144092 -1.06755 0.872939 0.141815 -1.15604 0.872957 0.139497 -1.31095 0.87234 0.137628 -1.56746 0.8714 0.136516 -1.97061 0.870976 0.136357 -2.57852 0.87171 0.136842 -3.46591 0.874241 0.136939 -4.7159 0.925653 0.0619245 -0.543587 0.903315 -0.159783 -0.527803 0.901222 -0.153603 -0.512603 0.899005 -0.14697 -0.498044 0.896684 -0.139888 -0.484181 0.894282 -0.132363 -0.471066 0.891825 -0.124409 -0.458746 0.88934 -0.116044 -0.447264 0.88686 -0.107285 -0.436654 0.884418 -0.0981469 -0.426914 0.882033 -0.0886094 -0.417942 0.879651 -0.0785453 -0.409597 0.877132 -0.067735 -0.401863 0.874363 -0.0559879 -0.394903 0.871334 -0.0431859 -0.389011 0.868155 -0.0292259 -0.384726 0.865184 -0.0142071 -0.383054 0.863601 7.677e-06 -0.384725 0.865182 0.0142227 -0.389009 0.868151 0.0292421 -0.3949 0.871328 0.0432029 -0.401859 0.874355 0.0560058 -0.409592 0.877123 0.0677537 -0.417936 0.87964 0.0785651 -0.426908 0.88202 0.0886303 -0.436647 0.884403 0.098169 -0.447256 0.886844 0.107309 -0.458738 0.889322 0.116069 -0.471057 0.891805 0.124436 -0.484173 0.894261 0.132392 -0.498035 0.896662 0.139919 -0.512594 0.89898 0.147004 -0.527795 0.901196 0.153639 -0.543579 0.903287 0.159822 -0.559886 0.905234 0.165558 -0.576647 0.907017 0.170858 -0.59379 0.908618 0.175738 -0.611236 0.910019 0.180216 -0.628904 0.911208 0.184317 -0.64671 0.912175 0.188066 -0.66457 0.912919 0.191488 -0.682404 0.913447 0.194609 -0.70014 0.913773 0.197455 -0.717713 0.913915 0.200046 -0.735067 0.913897 0.202405 -0.752158 0.913742 0.204548 -0.768948 0.913471 0.206494 -0.785407 0.913104 0.208254 -0.801508 0.912654 0.209842 -0.817233 0.912133 0.211268 -0.832563 0.911546 0.212537 -0.847483 0.9109 0.213657 -0.861981 0.9102 0.214628 -0.876053 0.909451 0.215453 -0.889698 0.908662 0.216131 -0.902928 0.907843 0.216659 -0.915762 0.907007 0.217035 -0.928237 0.906168 0.217257 -0.940405 0.905343 0.217325 -0.952335 0.904552 0.217235 -0.964104 0.903826 0.216984 -0.975745 0.903237 0.21656 -0.987995 0.902951 0.21589 -1.00244 0.902775 0.214952 -1.0222 0.902703 0.213604 -1.05286 0.902777 0.211677 -1.10411 0.902931 0.209196 -1.19304 0.902826 0.206593 -1.34652 0.902074 0.20449 -1.6009 0.900965 0.203303 -2.00175 0.900526 0.203154 -2.60628 0.901704 0.203556 -3.48644 0.905584 0.202518 -4.7159 0.976075 0.101759 -0.491479 0.941759 -0.219158 -0.473114 0.938291 -0.210236 -0.455387 0.934682 -0.200737 -0.438366 0.930963 -0.190665 -0.42212 0.927162 -0.180028 -0.406714 0.923315 -0.168843 -0.392212 0.919461 -0.15713 -0.378673 0.915644 -0.14491 -0.366147 0.91191 -0.132199 -0.354648 0.908287 -0.118975 -0.344081 0.90471 -0.105094 -0.334298 0.901003 -0.0903091 -0.325278 0.89703 -0.0744069 -0.317187 0.892794 -0.0572544 -0.310335 0.888445 -0.0387304 -0.305296 0.88445 -0.0189378 -0.303241 0.882313 1.4263e-05 -0.305294 0.884448 0.0189667 -0.310331 0.888441 0.0387602 -0.317182 0.892786 0.0572855 -0.325271 0.897021 0.0744395 -0.334288 0.900992 0.0903434 -0.34407 0.904695 0.105131 -0.354636 0.90827 0.119014 -0.366134 0.911891 0.13224 -0.378659 0.915622 0.144954 -0.392197 0.919436 0.157177 -0.406699 0.923287 0.168893 -0.422104 0.927131 0.180082 -0.43835 0.930929 0.190723 -0.455371 0.934645 0.2008 -0.4731 0.93825 0.210304 -0.491465 0.941715 0.21923 -0.510396 0.945014 0.227584 -0.529814 0.948121 0.235374 -0.549639 0.951014 0.242617 -0.569788 0.953671 0.249333 -0.590176 0.956077 0.255547 -0.610717 0.958221 0.261286 -0.631329 0.960101 0.266577 -0.651934 0.961722 0.271451 -0.672463 0.963094 0.275933 -0.692855 0.964237 0.28005 -0.713059 0.965169 0.283824 -0.733034 0.965913 0.287279 -0.752746 0.966489 0.290434 -0.772169 0.966913 0.293306 -0.79128 0.967199 0.295913 -0.810061 0.967354 0.29827 -0.828494 0.967384 0.300388 -0.846565 0.967294 0.302279 -0.864261 0.967087 0.30395 -0.881575 0.96677 0.305407 -0.898503 0.966349 0.306655 -0.915054 0.965836 0.307694 -0.931248 0.965247 0.308527 -0.947117 0.964598 0.309152 -0.962718 0.963913 0.30957 -0.978124 0.963218 0.309777 -0.993416 0.962553 0.309769 -1.00863 0.962008 0.309521 -1.02459 0.961797 0.308934 -1.04305 0.961699 0.308047 -1.06734 0.961704 0.306755 -1.10299 0.961844 0.304936 -1.15909 0.962031 0.302642 -1.25129 0.961968 0.300251 -1.40518 0.961339 0.298353 -1.65734 0.960384 0.297382 -2.05405 0.960198 0.297347 -2.65171 0.962103 0.297461 -3.51844 0.96813 0.293893 -4.7159 1.05981 0.167229 -0.397186 1.01502 -0.29682 -0.374798 1.00934 -0.284175 -0.353179 1.00351 -0.270811 -0.332416 0.99759 -0.256732 -0.312593 0.991618 -0.241949 -0.293789 0.985646 -0.226478 -0.276087 0.979728 -0.210339 -0.259561 0.973925 -0.193555 -0.244279 0.9683 -0.176139 -0.230272 0.962894 -0.158067 -0.217452 0.957633 -0.13918 -0.205668 0.952306 -0.119212 -0.194901 0.946756 -0.0979309 -0.185326 0.941003 -0.0751883 -0.177275 0.935254 -0.0508437 -0.171361 0.930086 -0.0250017 -0.168889 0.927325 2.4987e-05 -0.171358 0.930083 0.0250521 -0.177269 0.935249 0.0508957 -0.185317 0.940995 0.0752425 -0.194888 0.946745 0.0979878 -0.205653 0.952293 0.119272 -0.217435 0.957616 0.139244 -0.230253 0.962874 0.158136 -0.244258 0.968276 0.176212 -0.259539 0.973898 0.193634 -0.276064 0.979696 0.210424 -0.293766 0.98561 0.22657 -0.312569 0.991578 0.242049 -0.332393 0.997545 0.256841 -0.353156 1.00346 0.270929 -0.374776 1.00928 0.284303 -0.397167 1.01496 0.296958 -0.42024 1.02047 0.308897 -0.443906 1.02576 0.320126 -0.46807 1.0308 0.33066 -0.492637 1.03556 0.340516 -0.517513 1.04002 0.349719 -0.542601 1.04415 0.358293 -0.567814 1.04795 0.366265 -0.593067 1.05141 0.373664 -0.618288 1.05455 0.380518 -0.643413 1.05737 0.386854 -0.66839 1.0599 0.3927 -0.693178 1.06215 0.398083 -0.717743 1.06415 0.403028 -0.742061 1.06591 0.40756 -0.76611 1.06744 0.411703 -0.789875 1.06875 0.415481 -0.813341 1.06984 0.418914 -0.836493 1.07073 0.422021 -0.859322 1.07141 0.42482 -0.881822 1.07189 0.427323 -0.903992 1.07218 0.42954 -0.925843 1.07229 0.43148 -0.947396 1.07223 0.433147 -0.968692 1.07205 0.434544 -0.989796 1.07175 0.435671 -1.01079 1.07138 0.436527 -1.03178 1.07099 0.437099 -1.0528 1.07068 0.437345 -1.0748 1.07075 0.437132 -1.0998 1.07095 0.436597 -1.13147 1.07126 0.435704 -1.17545 1.07175 0.434411 -1.24039 1.07233 0.432827 -1.34051 1.07277 0.43128 -1.49908 1.07285 0.43021 -1.75086 1.07275 0.429897 -2.14166 1.07347 0.430118 -2.72669 1.07672 0.429492 -3.56892 1.08662 0.420649 -4.7159 1.19887 0.274838 -0.231289 1.14951 -0.401277 -0.202672 1.14045 -0.38354 -0.175065 1.13129 -0.364907 -0.148572 1.12208 -0.345381 -0.123297 1.1129 -0.324971 -0.0993412 1.10381 -0.303691 -0.0768055 1.09489 -0.281558 -0.0557871 1.08622 -0.25859 -0.0363741 1.0779 -0.234798 -0.0186189 1.06998 -0.210152 -0.00244921 1.06238 -0.184486 --0.0122757 1.05487 -0.157527 --0.0255611 1.04727 -0.129036 --0.037207 1.03963 -0.0988489 --0.0468512 1.03222 -0.0668105 --0.0538414 1.02573 -0.0330292 --0.0567786 1.02228 4.1132e-05 --0.0538463 1.02573 0.0331122 --0.0468609 1.03222 0.0668958 --0.0372211 1.03962 0.0989381 --0.0255792 1.04726 0.12913 --0.0122974 1.05485 0.157627 -0.00242446 1.06236 0.184593 -0.0185915 1.06996 0.210268 -0.0363449 1.07787 0.234924 -0.0557566 1.08619 0.258728 -0.0767744 1.09485 0.281708 -0.0993103 1.10377 0.303855 -0.123267 1.11285 0.325151 -0.148544 1.12203 0.345578 -0.17504 1.13123 0.365123 -0.202652 1.14038 0.383776 -0.231274 1.14943 0.401535 -0.260801 1.15831 0.418401 -0.291122 1.16697 0.434382 -0.322126 1.17536 0.44949 -0.3537 1.18342 0.463743 -0.385732 1.19111 0.477162 -0.418112 1.1984 0.48977 -0.450736 1.20526 0.501591 -0.483508 1.2117 0.512654 -0.516343 1.21769 0.522985 -0.549166 1.22326 0.532614 -0.58192 1.22841 0.541569 -0.614555 1.23316 0.549881 -0.647037 1.23753 0.557581 -0.679338 1.24154 0.564701 -0.711438 1.24518 0.571273 -0.743325 1.24848 0.577331 -0.774985 1.25144 0.582904 -0.806411 1.25407 0.588023 -0.837599 1.25636 0.592713 -0.86855 1.25833 0.596998 -0.899273 1.25999 0.600897 -0.929789 1.26135 0.604424 -0.960132 1.26244 0.607591 -0.990361 1.26328 0.610404 -1.02056 1.26391 0.612865 -1.05084 1.26438 0.614973 -1.08134 1.26476 0.616708 -1.11212 1.26518 0.618 -1.1443 1.26601 0.618672 -1.18028 1.267 0.618998 -1.22418 1.26817 0.619044 -1.28193 1.26961 0.618865 -1.36184 1.27128 0.618629 -1.47675 1.27302 0.618609 -1.64692 1.27472 0.61903 -1.90294 1.27657 0.619841 -2.28679 1.27945 0.620314 -2.85015 1.28555 0.617772 -3.64892 1.30309 0.599174 -4.7159 1.42977 0.451721 --0.0560198 1.39283 -0.552524 --0.0947416 1.37855 -0.527447 --0.132072 1.36421 -0.501209 --0.167876 1.34991 -0.473809 --0.202015 1.33574 -0.44525 --0.234355 1.32181 -0.415543 --0.264759 1.30824 -0.384697 --0.293096 1.29514 -0.352723 --0.319238 1.28265 -0.319626 --0.343094 1.27085 -0.285371 --0.364701 1.25969 -0.249797 --0.384163 1.24892 -0.212645 --0.401445 1.23836 -0.173683 --0.416298 1.22814 -0.132739 --0.428313 1.21857 -0.0896521 --0.436797 1.21049 -0.0445447 --0.440307 1.20625 6.2634e-05 --0.436803 1.21049 0.0446711 --0.428325 1.21857 0.0897822 --0.416316 1.22813 0.132875 --0.401467 1.23836 0.173828 --0.38419 1.24891 0.212802 --0.364731 1.25968 0.249967 --0.343126 1.27084 0.285556 --0.31927 1.28263 0.31983 --0.293127 1.29513 0.352948 --0.264789 1.30822 0.384945 --0.234381 1.32179 0.415818 --0.202036 1.33571 0.445555 --0.167889 1.34987 0.474147 --0.132076 1.36416 0.501583 --0.0947339 1.37849 0.527861 --0.0559982 1.39276 0.55298 --0.0160068 1.40689 0.576945 -0.0251015 1.42078 0.599769 -0.0671873 1.43436 0.621465 -0.110111 1.44755 0.642054 -0.153736 1.46029 0.661559 -0.197928 1.47253 0.680006 -0.242562 1.48422 0.69742 -0.287521 1.49533 0.713831 -0.332703 1.50586 0.729269 -0.37802 1.51581 0.743765 -0.423401 1.52517 0.757351 -0.468788 1.53396 0.770064 -0.514142 1.5422 0.781941 -0.559434 1.54989 0.793022 -0.604647 1.55706 0.803349 -0.649771 1.56371 0.812965 -0.694806 1.56984 0.821912 -0.739756 1.57548 0.830232 -0.784631 1.58061 0.837962 -0.829453 1.58526 0.845138 -0.874253 1.58944 0.851789 -0.919078 1.59316 0.857939 -0.963996 1.59646 0.863608 -1.0091 1.59938 0.868808 -1.05453 1.60195 0.873544 -1.10044 1.60424 0.877815 -1.14704 1.60634 0.881595 -1.19443 1.60841 0.884779 -1.24398 1.61094 0.887125 -1.29852 1.61364 0.889081 -1.36268 1.61662 0.890821 -1.44264 1.62001 0.892487 -1.54625 1.62381 0.894265 -1.6847 1.62797 0.896312 -1.87458 1.63253 0.898566 -2.14027 1.63783 0.900474 -2.51568 1.64496 0.900398 -3.04407 1.65732 0.893534 -3.77151 1.68816 0.862746 -4.7159 1.81319 0.742494 --0.547756 1.83157 -0.790482 --0.603827 1.80846 -0.753999 --0.65791 1.7853 -0.715881 --0.709803 1.76226 -0.676125 --0.759299 1.73949 -0.634732 --0.806194 1.71715 -0.591706 --0.850281 1.69545 -0.547055 --0.891352 1.67457 -0.500784 --0.929209 1.65473 -0.452894 --0.963681 1.6361 -0.403353 --0.994717 1.61869 -0.352027 --1.02233 1.60232 -0.298708 --1.04639 1.5869 -0.243199 --1.06657 1.57263 -0.185351 --1.08238 1.55997 -0.12503 --1.0931 1.54985 -0.0624017 --1.09736 1.54476 8.143e-05 --1.09311 1.54985 0.0625661 --1.08239 1.55998 0.1252 --1.06658 1.57263 0.18553 --1.04641 1.58691 0.243392 --1.02235 1.60233 0.298917 --0.99474 1.6187 0.352258 --0.963702 1.63611 0.403609 --0.929226 1.65474 0.45318 --0.891364 1.67458 0.501104 --0.850283 1.69546 0.547414 --0.806184 1.71716 0.592109 --0.759274 1.73949 0.635185 --0.709757 1.76226 0.676634 --0.657841 1.7853 0.716452 --0.603729 1.80845 0.754637 --0.547625 1.83155 0.791194 --0.489731 1.85446 0.826132 --0.430246 1.87705 0.859469 --0.369367 1.89921 0.891226 --0.307288 1.92082 0.921433 --0.244193 1.94178 0.950123 --0.180261 1.96202 0.977332 --0.115655 1.98148 1.0031 --0.0505242 2.00011 1.02747 -0.0150016 2.01789 1.05048 -0.0808135 2.03481 1.07218 -0.146824 2.05088 1.09261 -0.21297 2.06611 1.11184 -0.279207 2.0805 1.1299 -0.345511 2.09409 1.14686 -0.411875 2.1069 1.16278 -0.478307 2.11893 1.17771 -0.544829 2.1302 1.19172 -0.611475 2.14074 1.20486 -0.678293 2.15056 1.21719 -0.745347 2.15968 1.22876 -0.812718 2.16812 1.23961 -0.880509 2.17593 1.24978 -0.948853 2.18312 1.2593 -1.01792 2.18976 1.2682 -1.08792 2.1959 1.27648 -1.15912 2.20162 1.28414 -1.23182 2.20701 1.29116 -1.30626 2.21227 1.2974 -1.38396 2.21795 1.30257 -1.46804 2.2238 1.30724 -1.56326 2.22999 1.31167 -1.67545 2.23669 1.31599 -1.81132 2.24397 1.32034 -1.97959 2.25193 1.32464 -2.19244 2.26089 1.32849 -2.46713 2.27158 1.33082 -2.82775 2.28579 1.32932 -3.30595 2.30809 1.31878 -3.93492 2.35144 1.28772 -4.7159 2.44984 1.22052 --1.37415 2.6401 -1.19986 --1.46338 2.60012 -1.14438 --1.54962 2.55991 -1.08621 --1.63248 2.51976 -1.02536 --1.71157 2.47998 -0.961848 --1.78652 2.4409 -0.895714 --1.85695 2.4029 -0.826992 --1.92251 2.36635 -0.755718 --1.98283 2.33166 -0.681924 --2.0376 2.29921 -0.605625 --2.08657 2.26924 -0.526776 --2.12957 2.24185 -0.445301 --2.16627 2.21721 -0.361126 --2.19622 2.19577 -0.274207 --2.21883 2.17817 -0.184546 --2.23341 2.16539 -0.0924323 --2.23882 2.15962 7.0675e-05 --2.23341 2.1654 0.0925753 --2.21884 2.17819 0.184695 --2.19622 2.19578 0.274365 --2.16628 2.21723 0.361299 --2.12957 2.24187 0.445492 --2.08658 2.26928 0.526991 --2.0376 2.29925 0.605869 --1.98282 2.3317 0.682202 --1.92248 2.3664 0.756036 --1.85691 2.40296 0.827356 --1.78645 2.44096 0.896131 --1.71148 2.48004 0.962325 --1.63235 2.51983 1.0259 --1.54945 2.55999 1.08683 --1.46316 2.6002 1.14508 --1.37387 2.64017 1.20066 --1.28196 2.67965 1.25355 --1.18783 2.71838 1.30379 --1.09184 2.75617 1.3514 --0.994361 2.79282 1.39646 --0.895731 2.8282 1.43901 --0.796272 2.86218 1.47915 --0.696274 2.89468 1.51697 --0.595996 2.92564 1.55256 --0.49566 2.95505 1.58603 --0.39545 2.98289 1.61749 --0.295508 3.0092 1.64704 --0.195942 3.03401 1.67481 --0.096819 3.05736 1.70092 -0.00182766 3.07932 1.72547 -0.0999963 3.09993 1.74859 -0.197715 3.11927 1.77038 -0.29504 3.1374 1.79096 -0.392054 3.15438 1.81042 -0.488868 3.17027 1.82886 -0.585621 3.18514 1.84636 -0.682486 3.19907 1.86299 -0.779673 3.21212 1.87882 -0.877434 3.22436 1.8939 -0.976074 3.23587 1.90826 -1.07596 3.24673 1.92193 -1.17753 3.25703 1.93492 -1.28128 3.26688 1.94722 -1.38772 3.27643 1.95872 -1.49833 3.2861 1.96921 -1.61578 3.2958 1.97916 -1.74389 3.30571 1.98878 -1.88716 3.31602 1.99819 -2.05067 3.32688 2.00739 -2.24097 3.33854 2.01625 -2.46712 3.35145 2.02437 -2.74206 3.36642 2.03098 -3.08402 3.38503 2.03471 -3.51689 3.4104 2.03328 -4.06363 3.44849 2.02375 -4.7159 3.50698 2.00643 --2.71481 4.35516 -2.06667 --2.90136 4.27519 -1.98344 --3.08083 4.19518 -1.89338 --3.25221 4.11604 -1.79635 --3.41458 4.03862 -1.6923 --3.56712 3.9637 -1.58126 --3.70913 3.89199 -1.46336 --3.83998 3.82404 -1.33881 --3.95919 3.76029 -1.20793 --4.06636 3.70104 -1.07113 --4.16125 3.64637 -0.928911 --4.24373 3.59623 -0.781871 --4.31382 3.55036 -0.630679 --4.37172 3.50828 -0.476075 --4.41778 3.46933 -0.318859 --4.45256 3.43262 -0.159875 --4.4768 3.39703 0 --4.45256 3.43262 0.159875 --4.41778 3.46933 0.318859 --4.37172 3.50828 0.476075 --4.31382 3.55036 0.630679 --4.24373 3.59623 0.781871 --4.16125 3.64637 0.928911 --4.06636 3.70104 1.07113 --3.95919 3.76029 1.20793 --3.83998 3.82404 1.33881 --3.70913 3.89199 1.46336 --3.56712 3.9637 1.58126 --3.41458 4.03862 1.6923 --3.25221 4.11604 1.79635 --3.08083 4.19518 1.89338 --2.90136 4.27519 1.98344 --2.71481 4.35516 2.06667 --2.52228 4.43418 2.14327 --2.32498 4.51134 2.21352 --2.12416 4.58578 2.27774 --1.92116 4.65672 2.33629 --1.71738 4.72345 2.38958 --1.51423 4.7854 2.43805 --1.31315 4.84213 2.48211 --1.11556 4.89334 2.52223 --0.922856 4.93888 2.55885 --0.736377 4.97876 2.59241 --0.557369 5.01313 2.62332 --0.38698 5.04227 2.65198 --0.226228 5.06658 2.67876 --0.0759879 5.08652 2.704 -0.0630255 5.10264 2.72802 -0.190268 5.11552 2.7511 -0.305379 5.12576 2.77392 -0.408191 5.13392 2.79673 -0.498726 5.14053 2.81954 -0.577197 5.14635 2.84235 -0.644033 5.15215 2.86517 -0.699863 5.15794 2.88798 -0.745528 5.16374 2.91079 -0.782093 5.16954 2.9336 -0.810859 5.17533 2.95642 -0.833377 5.18113 2.97923 -0.851459 5.18692 3.00204 -0.867192 5.19272 3.02486 -0.883395 5.19852 3.04767 -0.905346 5.20431 3.07048 -0.940293 5.21011 3.09329 -0.997542 5.21591 3.11611 -1.08904 5.2217 3.13892 -1.23014 5.2275 3.16173 -1.44053 5.23329 3.18454 -1.74551 5.23909 3.20736 -2.17758 5.24489 3.23017 -2.77842 5.25068 3.25298 -3.60161 5.25648 3.27579 -4.7159 5.26227 3.29861 -0.619572 0.911696 -0.0185557 -0.607558 0.910972 -0.0180059 -0.596142 0.910167 -0.0173804 -0.585382 0.90929 -0.0166853 -0.575324 0.908349 -0.0159262 -0.566007 0.907353 -0.0151111 -0.557463 0.906317 -0.0142519 -0.549713 0.905259 -0.0133653 -0.542765 0.904203 -0.0124713 -0.536615 0.903169 -0.0115896 -0.531193 0.902055 -0.0106308 -0.526391 0.900642 -0.00940241 -0.522188 0.898851 -0.00783165 -0.518624 0.896783 -0.00600804 -0.51571 0.894584 -0.00405799 -0.513423 0.892327 -0.00204735 -0.511771 0.890037 0 -0.513423 0.892327 0.00204735 -0.51571 0.894584 0.00405799 -0.518624 0.896783 0.00600804 -0.522188 0.898851 0.00783165 -0.526391 0.900642 0.00940241 -0.531193 0.902055 0.0106308 -0.536615 0.903169 0.0115896 -0.542765 0.904203 0.0124713 -0.549713 0.905259 0.0133653 -0.557463 0.906317 0.0142519 -0.566007 0.907353 0.0151111 -0.575324 0.908349 0.0159262 -0.585382 0.90929 0.0166853 -0.596142 0.910167 0.0173804 -0.607558 0.910972 0.0180059 -0.619572 0.911696 0.0185557 -0.632121 0.912329 0.0190215 -0.645131 0.912855 0.0193913 -0.658522 0.913252 0.0196492 -0.672207 0.913496 0.0197768 -0.686099 0.913563 0.0197563 -0.700109 0.913433 0.0195736 -0.714151 0.913095 0.0192218 -0.728146 0.912549 0.0187032 -0.742018 0.911807 0.0180303 -0.755699 0.910895 0.0172244 -0.769128 0.909844 0.0163126 -0.782245 0.908691 0.0153244 -0.794996 0.907469 0.0142875 -0.807326 0.906207 0.0132254 -0.819185 0.904927 0.0121553 -0.830526 0.903643 0.0110884 -0.841308 0.902365 0.0100311 -0.851499 0.901096 0.00898676 -0.861077 0.899842 0.00795799 -0.870032 0.898607 0.0069483 -0.87837 0.897397 0.00596239 -0.886109 0.89622 0.00500603 -0.893286 0.895085 0.0040851 -0.899951 0.893998 0.00320416 -0.906174 0.892961 0.00236535 -0.912038 0.891968 0.00156258 -0.917643 0.890999 0.000780766 -0.923109 0.890031 0 -0.928983 0.890032 0 -0.936341 0.890033 0 -0.949125 0.890033 0 -0.974655 0.890033 0 -1.02459 0.890034 0 -1.11616 0.890034 0 -1.27373 0.890035 0 -1.53086 0.890035 0 -1.93289 0.890036 0 -2.54031 0.890036 0 -3.43302 0.890037 0 -4.7159 0.890037 0 -0.619572 0.911695 -0.0185761 -0.607557 0.910971 -0.0180262 -0.596141 0.910166 -0.0174007 -0.58538 0.909289 -0.0167054 -0.575322 0.908348 -0.0159462 -0.566006 0.907353 -0.015131 -0.557461 0.906316 -0.0142717 -0.54971 0.905258 -0.013385 -0.542763 0.904202 -0.0124907 -0.536613 0.903168 -0.0116089 -0.53119 0.902054 -0.0106498 -0.526386 0.900642 -0.00942085 -0.522181 0.898852 -0.00784901 -0.518614 0.896788 -0.00602308 -0.515696 0.894592 -0.00406859 -0.513408 0.892338 -0.00204982 -0.511773 0.890057 0 -0.513408 0.892338 0.00204982 -0.515696 0.894592 0.0040686 -0.518614 0.896788 0.00602308 -0.522181 0.898852 0.00784901 -0.526386 0.900642 0.00942085 -0.53119 0.902054 0.0106498 -0.536613 0.903168 0.0116089 -0.542763 0.904202 0.0124907 -0.54971 0.905258 0.013385 -0.557461 0.906316 0.0142717 -0.566006 0.907353 0.015131 -0.575322 0.908348 0.0159462 -0.58538 0.909289 0.0167054 -0.596141 0.910166 0.0174007 -0.607557 0.910971 0.0180262 -0.619572 0.911695 0.0185761 -0.63212 0.912329 0.019042 -0.64513 0.912854 0.0194119 -0.658521 0.913251 0.0196698 -0.672207 0.913496 0.0197974 -0.686099 0.913563 0.019777 -0.700109 0.913433 0.0195943 -0.714152 0.913094 0.0192425 -0.728146 0.912548 0.0187239 -0.742019 0.911807 0.0180511 -0.7557 0.910894 0.0172451 -0.769129 0.909844 0.0163333 -0.782247 0.90869 0.015345 -0.794997 0.907468 0.0143081 -0.807327 0.906206 0.013246 -0.819187 0.904926 0.0121759 -0.830528 0.903643 0.011109 -0.84131 0.902364 0.0100515 -0.851501 0.901096 0.00900716 -0.861079 0.899841 0.00797831 -0.870035 0.898606 0.00696853 -0.878372 0.897396 0.00598254 -0.886111 0.89622 0.0050261 -0.893288 0.895085 0.00410509 -0.899953 0.893997 0.00322409 -0.906176 0.89296 0.00238525 -0.91204 0.891967 0.00158247 -0.917646 0.890999 0.000800712 -0.92311 0.890034 2.0089e-05 -0.928984 0.890032 2.0242e-05 -0.936342 0.890032 2.0335e-05 -0.949126 0.890032 2.0592e-05 -0.974657 0.890033 2.1202e-05 -1.02459 0.890033 2.1876e-05 -1.11616 0.890034 2.1969e-05 -1.27373 0.890034 2.1697e-05 -1.53086 0.890034 2.1587e-05 -1.9329 0.890035 2.1796e-05 -2.54032 0.890035 2.2491e-05 -3.43303 0.890036 2.4218e-05 -4.7159 0.89005 1.3047e-05 -0.61957 0.911695 -0.0186117 -0.607555 0.91097 -0.0180616 -0.596139 0.910165 -0.0174358 -0.585378 0.909288 -0.0167403 -0.57532 0.908347 -0.0159807 -0.566003 0.907351 -0.0151651 -0.557458 0.906315 -0.0143054 -0.549707 0.905257 -0.0134182 -0.542759 0.904201 -0.0125234 -0.536609 0.903166 -0.0116408 -0.531185 0.902052 -0.0106807 -0.526379 0.900642 -0.00945045 -0.522169 0.898855 -0.00787649 -0.518598 0.896795 -0.00604662 -0.515676 0.894603 -0.00408499 -0.513386 0.892354 -0.00205364 -0.511777 0.890091 0 -0.513386 0.892354 0.00205364 -0.515676 0.894603 0.00408499 -0.518598 0.896795 0.00604662 -0.522169 0.898855 0.0078765 -0.526379 0.900642 0.00945045 -0.531185 0.902052 0.0106807 -0.536609 0.903166 0.0116408 -0.542759 0.904201 0.0125234 -0.549707 0.905257 0.0134182 -0.557458 0.906315 0.0143054 -0.566003 0.907351 0.0151651 -0.57532 0.908347 0.0159807 -0.585378 0.909288 0.0167403 -0.596139 0.910165 0.0174358 -0.607555 0.91097 0.0180616 -0.61957 0.911695 0.0186117 -0.632119 0.912328 0.0190778 -0.64513 0.912853 0.0194478 -0.658521 0.913251 0.0197059 -0.672207 0.913495 0.0198337 -0.686099 0.913562 0.0198133 -0.70011 0.913432 0.0196308 -0.714153 0.913093 0.019279 -0.728148 0.912547 0.0187605 -0.74202 0.911806 0.0180878 -0.755702 0.910893 0.0172819 -0.769131 0.909843 0.0163701 -0.782249 0.908689 0.0153819 -0.795 0.907467 0.014345 -0.80733 0.906205 0.0132829 -0.81919 0.904925 0.0122128 -0.830531 0.903641 0.0111458 -0.841313 0.902363 0.0100884 -0.851505 0.901095 0.00904392 -0.861083 0.89984 0.00801499 -0.870038 0.898605 0.00700512 -0.878376 0.897395 0.00601903 -0.886116 0.896218 0.00506248 -0.893292 0.895083 0.00414141 -0.899958 0.893996 0.00326038 -0.906181 0.892959 0.00242154 -0.912045 0.891966 0.00161884 -0.91765 0.890999 0.000837303 -0.923113 0.890038 5.7683e-05 -0.928984 0.890032 5.7367e-05 -0.936343 0.890031 5.7468e-05 -0.949128 0.890031 5.8046e-05 -0.97466 0.890031 5.9555e-05 -1.0246 0.890032 6.1183e-05 -1.11616 0.890032 6.1219e-05 -1.27374 0.890033 6.0339e-05 -1.53087 0.890033 5.9982e-05 -1.93291 0.890033 6.052e-05 -2.54033 0.890033 6.2351e-05 -3.43304 0.890035 6.6867e-05 -4.7159 0.890072 3.4296e-05 -0.619568 0.911693 -0.0186737 -0.607552 0.910968 -0.0181231 -0.596136 0.910164 -0.0174966 -0.585374 0.909287 -0.0168004 -0.575315 0.908345 -0.01604 -0.565998 0.907349 -0.0152234 -0.557453 0.906313 -0.0143626 -0.549701 0.905255 -0.0134743 -0.542753 0.904199 -0.0125782 -0.536602 0.903164 -0.0116937 -0.531177 0.90205 -0.0107311 -0.526367 0.900642 -0.00949799 -0.522151 0.89886 -0.00792005 -0.518573 0.896806 -0.00608349 -0.515643 0.894621 -0.00411035 -0.513351 0.892381 -0.0020596 -0.511783 0.890149 1e-09 -0.513351 0.892381 0.0020596 -0.515643 0.894621 0.00411035 -0.518573 0.896806 0.00608349 -0.522151 0.89886 0.00792005 -0.526367 0.900642 0.00949799 -0.531177 0.90205 0.0107311 -0.536602 0.903164 0.0116937 -0.542753 0.904199 0.0125782 -0.549701 0.905255 0.0134743 -0.557453 0.906313 0.0143626 -0.565998 0.907349 0.0152234 -0.575315 0.908345 0.01604 -0.585374 0.909287 0.0168004 -0.596136 0.910164 0.0174966 -0.607552 0.910968 0.0181231 -0.619568 0.911693 0.0186737 -0.632117 0.912327 0.0191403 -0.645128 0.912852 0.0195107 -0.65852 0.913249 0.0197692 -0.672206 0.913493 0.0198973 -0.6861 0.91356 0.0198772 -0.700111 0.91343 0.0196949 -0.714154 0.913092 0.0193434 -0.72815 0.912545 0.0188252 -0.742023 0.911803 0.0181527 -0.755706 0.910891 0.0173471 -0.769135 0.909841 0.0164355 -0.782254 0.908687 0.0154475 -0.795005 0.907465 0.0144108 -0.807335 0.906203 0.0133488 -0.819195 0.904923 0.0122787 -0.830536 0.90364 0.0112118 -0.841319 0.902361 0.0101544 -0.851511 0.901092 0.00910992 -0.861089 0.899838 0.00808094 -0.870045 0.898602 0.007071 -0.878383 0.897392 0.00608484 -0.886123 0.896216 0.00512825 -0.8933 0.895081 0.00420718 -0.899966 0.893994 0.0033262 -0.906189 0.892957 0.00248752 -0.912054 0.891965 0.00168512 -0.917659 0.890999 0.000904226 -0.923119 0.890046 0.000127707 -0.928985 0.890032 0.000125242 -0.936346 0.890029 0.000125051 -0.949133 0.890028 0.000125918 -0.974666 0.890028 0.000128683 -1.0246 0.89003 0.000131692 -1.11617 0.89003 0.000131421 -1.27375 0.89003 0.000129333 -1.53088 0.890029 0.000128463 -1.93292 0.890029 0.000129516 -2.54035 0.89003 0.000133199 -3.43306 0.890033 0.000142209 -4.7159 0.890111 6.8687e-05 -0.619563 0.911691 -0.0187813 -0.607547 0.910966 -0.0182294 -0.59613 0.910161 -0.0176016 -0.585368 0.909284 -0.0169037 -0.575308 0.908342 -0.0161414 -0.565989 0.907346 -0.0153228 -0.557443 0.906309 -0.0144597 -0.549691 0.905252 -0.0135688 -0.542742 0.904196 -0.0126697 -0.536591 0.903161 -0.0117812 -0.531163 0.902046 -0.0108132 -0.526347 0.900641 -0.00957421 -0.522122 0.898867 -0.00798895 -0.518533 0.896823 -0.00614111 -0.515593 0.894648 -0.00414953 -0.513299 0.892422 -0.00206894 -0.511791 0.89025 1e-09 -0.513299 0.892422 0.00206895 -0.515593 0.894648 0.00414953 -0.518533 0.896823 0.00614112 -0.522122 0.898867 0.00798896 -0.526347 0.900641 0.00957422 -0.531163 0.902046 0.0108132 -0.536591 0.903161 0.0117812 -0.542742 0.904196 0.0126697 -0.549691 0.905252 0.0135688 -0.557443 0.906309 0.0144598 -0.565989 0.907346 0.0153229 -0.575308 0.908342 0.0161415 -0.585368 0.909284 0.0169037 -0.59613 0.910161 0.0176016 -0.607547 0.910966 0.0182294 -0.619563 0.911691 0.0187813 -0.632114 0.912324 0.019249 -0.645125 0.91285 0.0196204 -0.658518 0.913247 0.0198796 -0.672206 0.913491 0.0200084 -0.6861 0.913558 0.0199891 -0.700112 0.913427 0.0198074 -0.714157 0.913089 0.0194566 -0.728154 0.912542 0.0189389 -0.742028 0.9118 0.0182671 -0.755712 0.910888 0.0174621 -0.769142 0.909837 0.0165511 -0.782261 0.908684 0.0155636 -0.795013 0.907462 0.0145274 -0.807344 0.9062 0.0134658 -0.819204 0.90492 0.0123961 -0.830546 0.903636 0.0113295 -0.841329 0.902357 0.0102722 -0.851522 0.901089 0.00922786 -0.861101 0.899834 0.00819895 -0.870057 0.898598 0.00718908 -0.878396 0.897388 0.00620299 -0.886136 0.896212 0.00524653 -0.893314 0.895077 0.00432567 -0.899981 0.893989 0.00344504 -0.906204 0.892953 0.00260688 -0.912069 0.891962 0.0018053 -0.917674 0.890998 0.00102603 -0.923129 0.890061 0.000257165 -0.928987 0.890033 0.000248723 -0.936352 0.890026 0.000247442 -0.949141 0.890023 0.000248282 -0.974676 0.890023 0.000252651 -1.02462 0.890026 0.000257644 -1.11619 0.890027 0.000256638 -1.27377 0.890025 0.00025228 -1.53091 0.890024 0.000250378 -1.93295 0.890023 0.000252215 -2.54038 0.890024 0.000258898 -3.43309 0.890029 0.000275086 -4.7159 0.890177 0.000124333 -0.619555 0.911688 -0.0189669 -0.607538 0.910963 -0.0184124 -0.59612 0.910157 -0.0177815 -0.585356 0.90928 -0.0170802 -0.575295 0.908338 -0.0163141 -0.565975 0.907341 -0.0154913 -0.557427 0.906305 -0.0146234 -0.549673 0.905247 -0.0137271 -0.542723 0.904192 -0.0128218 -0.536571 0.903156 -0.011925 -0.531139 0.902041 -0.0109462 -0.526313 0.900641 -0.00969593 -0.522075 0.898879 -0.00809754 -0.518469 0.896849 -0.00623084 -0.515515 0.894691 -0.00420982 -0.513219 0.892487 -0.00208372 -0.511803 0.89042 2e-09 -0.513219 0.892487 0.00208373 -0.515515 0.894691 0.00420984 -0.518469 0.896849 0.00623086 -0.522075 0.898879 0.00809755 -0.526313 0.900641 0.00969594 -0.531139 0.902041 0.0109462 -0.536571 0.903156 0.011925 -0.542723 0.904192 0.0128218 -0.549673 0.905247 0.0137271 -0.557427 0.906305 0.0146234 -0.565975 0.907341 0.0154913 -0.575295 0.908338 0.0163141 -0.585356 0.90928 0.0170802 -0.59612 0.910157 0.0177815 -0.607538 0.910963 0.0184124 -0.619555 0.911688 0.0189669 -0.632107 0.912321 0.0194368 -0.64512 0.912847 0.0198102 -0.658514 0.913244 0.0200712 -0.672204 0.913488 0.0202016 -0.6861 0.913554 0.0201836 -0.700114 0.913423 0.0200034 -0.714162 0.913084 0.019654 -0.72816 0.912537 0.0191378 -0.742036 0.911795 0.0184673 -0.755722 0.910883 0.0176637 -0.769154 0.909832 0.0167541 -0.782274 0.908679 0.0157679 -0.795027 0.907456 0.0147329 -0.80736 0.906194 0.0136723 -0.81922 0.904914 0.0126036 -0.830563 0.90363 0.0115377 -0.841348 0.902351 0.010481 -0.851541 0.901083 0.00943717 -0.861121 0.899827 0.00840871 -0.870079 0.898591 0.00739927 -0.878419 0.897381 0.00641367 -0.88616 0.896204 0.0054578 -0.893339 0.895069 0.00453772 -0.900007 0.893983 0.00365814 -0.906231 0.892947 0.00282135 -0.912097 0.891957 0.00202176 -0.917702 0.890998 0.00124622 -0.923148 0.890087 0.000493814 -0.928991 0.890035 0.000471819 -0.936364 0.890022 0.000467569 -0.949157 0.890015 0.00046737 -0.974695 0.890015 0.000473411 -1.02464 0.890019 0.000481117 -1.11622 0.89002 0.000478614 -1.2738 0.890018 0.000470118 -1.53095 0.890014 0.000466201 -1.933 0.890012 0.000469196 -2.54044 0.890014 0.000480679 -3.43315 0.890023 0.000508172 -4.7159 0.89029 0.000214571 -0.619541 0.911683 -0.0192842 -0.607522 0.910958 -0.0187244 -0.596101 0.910152 -0.0180875 -0.585335 0.909273 -0.0173794 -0.575271 0.908331 -0.0166057 -0.565949 0.907334 -0.0157743 -0.557399 0.906298 -0.0148969 -0.549643 0.905241 -0.01399 -0.542691 0.904186 -0.0130725 -0.536537 0.90315 -0.0121596 -0.531098 0.902034 -0.0111606 -0.526258 0.900642 -0.00988929 -0.521997 0.898898 -0.00826778 -0.518368 0.896891 -0.00636982 -0.515393 0.894757 -0.00430216 -0.513099 0.89259 -0.00210741 -0.51181 0.890691 4e-09 -0.513099 0.89259 0.00210743 -0.515393 0.894757 0.00430219 -0.518368 0.896891 0.00636984 -0.521997 0.898898 0.0082678 -0.526258 0.900642 0.00988931 -0.531098 0.902034 0.0111606 -0.536537 0.90315 0.0121597 -0.542691 0.904186 0.0130725 -0.549643 0.905241 0.01399 -0.557399 0.906298 0.014897 -0.565949 0.907334 0.0157743 -0.575271 0.908331 0.0166057 -0.585335 0.909273 0.0173794 -0.596101 0.910152 0.0180876 -0.607522 0.910958 0.0187244 -0.619541 0.911683 0.0192842 -0.632095 0.912317 0.0197587 -0.645111 0.912843 0.0201361 -0.658508 0.913239 0.0204006 -0.6722 0.913482 0.0205342 -0.6861 0.913548 0.0205193 -0.700118 0.913417 0.020342 -0.714169 0.913077 0.0199955 -0.728171 0.91253 0.0194823 -0.742051 0.911788 0.0188148 -0.75574 0.910875 0.0180142 -0.769174 0.909824 0.0171076 -0.782297 0.90867 0.0161243 -0.795052 0.907448 0.0150919 -0.807386 0.906186 0.0140338 -0.819249 0.904905 0.0129671 -0.830593 0.903621 0.011903 -0.841379 0.902342 0.0108479 -0.851574 0.901072 0.00980549 -0.861156 0.899817 0.00877836 -0.870116 0.89858 0.00777026 -0.878458 0.897369 0.00678613 -0.886202 0.896192 0.00583199 -0.893383 0.895058 0.004914 -0.900052 0.893971 0.004037 -0.906279 0.892937 0.00320342 -0.912146 0.89195 0.00240826 -0.917752 0.890999 0.00164079 -0.923182 0.890129 0.000919635 -0.929003 0.890038 0.000871303 -0.936387 0.890014 0.000860007 -0.949188 0.890002 0.000856216 -0.974729 0.890002 0.000863046 -1.02468 0.890008 0.000874002 -1.11626 0.89001 0.000868594 -1.27386 0.890005 0.000852737 -1.53102 0.889998 0.000844996 -1.93309 0.889994 0.000849629 -2.54054 0.889997 0.000868667 -3.43324 0.890012 0.000913633 -4.7159 0.890482 0.000361317 -0.619516 0.911678 -0.0198213 -0.607493 0.910952 -0.0192513 -0.596068 0.910145 -0.0186028 -0.585298 0.909265 -0.0178815 -0.57523 0.908322 -0.017093 -0.565904 0.907325 -0.0162453 -0.55735 0.906288 -0.0153499 -0.549589 0.905232 -0.0144228 -0.542634 0.904179 -0.0134822 -0.536476 0.903141 -0.0125393 -0.531026 0.902026 -0.0115034 -0.526163 0.900646 -0.0101946 -0.52187 0.898928 -0.00853306 -0.518205 0.896954 -0.00658371 -0.515201 0.894859 -0.00444277 -0.512917 0.892753 -0.00214612 -0.511794 0.891103 7e-09 -0.512917 0.892753 0.00214614 -0.515201 0.894859 0.00444281 -0.518205 0.896954 0.00658375 -0.52187 0.898927 0.0085331 -0.526163 0.900646 0.0101946 -0.531026 0.902025 0.0115034 -0.536476 0.903141 0.0125394 -0.542635 0.904179 0.0134822 -0.549589 0.905232 0.0144229 -0.55735 0.906288 0.01535 -0.565904 0.907325 0.0162454 -0.57523 0.908322 0.0170931 -0.585298 0.909265 0.0178815 -0.596068 0.910145 0.0186028 -0.607493 0.910951 0.0192514 -0.619516 0.911678 0.0198214 -0.632074 0.912312 0.0203049 -0.645094 0.912837 0.02069 -0.658495 0.913233 0.0209615 -0.672193 0.913476 0.0211014 -0.686098 0.913541 0.0210925 -0.700123 0.913408 0.020921 -0.71418 0.913068 0.0205804 -0.728188 0.912519 0.0200731 -0.742074 0.911776 0.0194118 -0.755768 0.910863 0.0186174 -0.769208 0.909812 0.0177169 -0.782335 0.908658 0.0167394 -0.795094 0.907435 0.0157126 -0.807431 0.906173 0.0146596 -0.819296 0.904892 0.0135974 -0.830644 0.903608 0.0125374 -0.841433 0.902327 0.011486 -0.851631 0.901057 0.0104469 -0.861216 0.8998 0.00942308 -0.87018 0.898562 0.00841836 -0.878526 0.897351 0.00743792 -0.886274 0.896173 0.00648796 -0.893459 0.895039 0.00557483 -0.900132 0.893954 0.0047036 -0.906362 0.892922 0.00387696 -0.912233 0.891939 0.00309112 -0.917839 0.891003 0.00234013 -0.923247 0.890191 0.00167037 -0.929035 0.890047 0.00157866 -0.936437 0.890003 0.00155214 -0.949249 0.889981 0.00153905 -0.974794 0.889981 0.00154335 -1.02475 0.889992 0.00155699 -1.11635 0.889994 0.00154598 -1.27396 0.889984 0.00151733 -1.53114 0.889971 0.00150254 -1.93324 0.889964 0.00150935 -2.54071 0.88997 0.00154003 -3.43341 0.889996 0.00161137 -4.7159 0.890806 0.000600591 -0.61947 0.911673 -0.0207198 -0.60744 0.910946 -0.0201305 -0.596009 0.910137 -0.0194601 -0.585232 0.909257 -0.0187142 -0.575157 0.908312 -0.0178984 -0.565823 0.907314 -0.0170204 -0.557262 0.906278 -0.0160916 -0.549494 0.905223 -0.0151273 -0.542533 0.904172 -0.0141441 -0.536367 0.903133 -0.0131476 -0.530897 0.902018 -0.0120474 -0.525999 0.900656 -0.0106733 -0.521658 0.898975 -0.00894378 -0.517941 0.897051 -0.00691073 -0.5149 0.895015 -0.00465578 -0.512639 0.893011 -0.00221082 -0.511705 0.891674 1.3e-08 -0.512639 0.893011 0.00221086 -0.5149 0.895015 0.00465584 -0.517941 0.897051 0.0069108 -0.521658 0.898975 0.00894386 -0.525999 0.900656 0.0106734 -0.530897 0.902017 0.0120474 -0.536367 0.903133 0.0131476 -0.542533 0.904172 0.0141441 -0.549495 0.905223 0.0151274 -0.557262 0.906278 0.0160917 -0.565824 0.907314 0.0170205 -0.575157 0.908312 0.0178985 -0.585232 0.909257 0.0187143 -0.596009 0.910137 0.0194602 -0.60744 0.910945 0.0201307 -0.61947 0.911673 0.0207199 -0.632034 0.912307 0.0212203 -0.645061 0.912832 0.0216203 -0.658471 0.913228 0.021905 -0.672177 0.913469 0.022057 -0.686092 0.913532 0.0220595 -0.700127 0.913398 0.0218992 -0.714195 0.913056 0.0215699 -0.728214 0.912505 0.0210743 -0.74211 0.911761 0.0204249 -0.755814 0.910847 0.0196426 -0.769262 0.909795 0.0187542 -0.782396 0.908641 0.0177885 -0.795161 0.907418 0.0167728 -0.807504 0.906156 0.0157301 -0.819375 0.904874 0.0146774 -0.830727 0.903589 0.0136259 -0.841521 0.902307 0.0125823 -0.851725 0.901035 0.0115507 -0.861317 0.899776 0.0105342 -0.870287 0.898537 0.00953711 -0.87864 0.897324 0.00856492 -0.886395 0.896146 0.00762413 -0.893587 0.895012 0.0067214 -0.900268 0.893929 0.00586217 -0.906505 0.892901 0.00504963 -0.912382 0.891928 0.00428238 -0.91799 0.891017 0.00356278 -0.923369 0.890275 0.00296347 -0.929118 0.890068 0.00281357 -0.936548 0.889991 0.00275718 -0.949374 0.889951 0.00272323 -0.974919 0.889949 0.00271629 -1.02488 0.889968 0.00272872 -1.1165 0.889971 0.00270686 -1.27414 0.889953 0.00265646 -1.53136 0.88993 0.00262906 -1.9335 0.889917 0.00263853 -2.54101 0.889928 0.0026867 -3.43369 0.889974 0.00279668 -4.7159 0.891349 0.000991597 -0.619381 0.911675 -0.0222024 -0.60734 0.910946 -0.021578 -0.595898 0.910136 -0.0208677 -0.58511 0.909253 -0.0200772 -0.575023 0.908306 -0.0192119 -0.565677 0.907307 -0.0182793 -0.557102 0.906272 -0.0172905 -0.549322 0.905219 -0.0162595 -0.542347 0.90417 -0.0152003 -0.536163 0.903131 -0.0141111 -0.530661 0.902018 -0.012903 -0.52571 0.900681 -0.0114191 -0.521299 0.899053 -0.00957573 -0.517508 0.897198 -0.00740755 -0.514418 0.895248 -0.00497731 -0.512201 0.893401 -0.00232098 -0.511447 0.892397 2.5e-08 -0.512201 0.893401 0.00232105 -0.514418 0.895248 0.00497741 -0.517508 0.897198 0.00740767 -0.521299 0.899052 0.00957586 -0.52571 0.900681 0.0114193 -0.530662 0.902017 0.0129032 -0.536163 0.90313 0.0141112 -0.542347 0.90417 0.0152005 -0.549322 0.905219 0.0162597 -0.557102 0.906271 0.0172906 -0.565677 0.907307 0.0182795 -0.575023 0.908306 0.0192121 -0.58511 0.909253 0.0200774 -0.595898 0.910136 0.020868 -0.60734 0.910946 0.0215782 -0.619381 0.911675 0.0222027 -0.631957 0.91231 0.0227341 -0.644997 0.912835 0.0231614 -0.65842 0.913229 0.0234705 -0.672141 0.913468 0.023645 -0.686073 0.913529 0.0236689 -0.700125 0.913392 0.0235297 -0.71421 0.913047 0.0232216 -0.728248 0.912494 0.0227479 -0.742161 0.911748 0.0221211 -0.75588 0.910833 0.0213618 -0.769343 0.90978 0.0204964 -0.78249 0.908625 0.0195532 -0.795266 0.907402 0.0185589 -0.807619 0.906138 0.0175363 -0.819499 0.904856 0.0165021 -0.83086 0.903568 0.0154677 -0.841664 0.902284 0.0144402 -0.851878 0.901009 0.013424 -0.861481 0.899748 0.0124231 -0.870463 0.898506 0.0114421 -0.878829 0.897291 0.0104871 -0.886597 0.896113 0.00956507 -0.893803 0.89498 0.00868314 -0.900497 0.893901 0.00784731 -0.906748 0.892881 0.00706181 -0.912638 0.891925 0.00632921 -0.91825 0.891054 0.00566277 -0.923605 0.890379 0.00514086 -0.929324 0.890113 0.00493034 -0.936794 0.889985 0.00482279 -0.949639 0.889915 0.00474706 -0.975172 0.88991 0.0047098 -1.02513 0.889941 0.00470919 -1.11677 0.889946 0.00466609 -1.27445 0.889914 0.00457958 -1.53173 0.889874 0.00453033 -1.93395 0.889852 0.00454256 -2.54151 0.889872 0.00461624 -3.43416 0.889951 0.00478077 -4.7159 0.892259 0.00163165 -0.619209 0.911704 -0.0246126 -0.607148 0.910972 -0.0239255 -0.595686 0.910158 -0.0231448 -0.584878 0.909272 -0.0222756 -0.574769 0.908322 -0.0213232 -0.5654 0.907322 -0.020295 -0.556801 0.906286 -0.0192011 -0.548996 0.905236 -0.018054 -0.541995 0.904191 -0.0168635 -0.535776 0.903151 -0.0156196 -0.53022 0.902043 -0.0142368 -0.525188 0.900741 -0.012573 -0.520677 0.89918 -0.0105422 -0.516785 0.897418 -0.00815815 -0.513633 0.895592 -0.00546218 -0.511477 0.893959 -0.00250876 -0.510856 0.893237 4.8e-08 -0.511477 0.893959 0.00250888 -0.513633 0.895592 0.00546236 -0.516785 0.897418 0.00815836 -0.520677 0.899179 0.0105424 -0.525189 0.90074 0.0125732 -0.53022 0.902043 0.014237 -0.535776 0.90315 0.0156198 -0.541995 0.90419 0.0168638 -0.548996 0.905236 0.0180543 -0.556802 0.906286 0.0192015 -0.5654 0.907321 0.0202953 -0.574769 0.908322 0.0213236 -0.584878 0.909271 0.0222761 -0.595686 0.910158 0.0231453 -0.607148 0.910972 0.0239261 -0.619209 0.911703 0.0246132 -0.631805 0.91234 0.0251998 -0.644866 0.912864 0.0256763 -0.658312 0.913257 0.0260296 -0.672058 0.913493 0.0262449 -0.686017 0.91355 0.0263077 -0.700097 0.913409 0.0262069 -0.714212 0.91306 0.0259378 -0.728279 0.912504 0.0255042 -0.742221 0.911756 0.0249187 -0.755967 0.910838 0.0242014 -0.769455 0.909785 0.0233782 -0.782623 0.908629 0.0224764 -0.795419 0.907405 0.0215219 -0.807789 0.906141 0.0205369 -0.819685 0.904856 0.0195379 -0.831063 0.903566 0.0185367 -0.841884 0.902278 0.0175406 -0.852117 0.900999 0.0165551 -0.86174 0.899734 0.015585 -0.870743 0.898488 0.0146359 -0.879132 0.897271 0.0137146 -0.886925 0.896093 0.0128287 -0.894158 0.894963 0.0119858 -0.900881 0.893891 0.0111926 -0.907161 0.892886 0.0104551 -0.913079 0.891959 0.00978044 -0.918709 0.891138 0.00918838 -0.924068 0.890512 0.00873437 -0.9298 0.8902 0.00847523 -0.937331 0.89001 0.00829634 -0.9502 0.889895 0.00814704 -0.97569 0.889881 0.00804323 -1.02562 0.889931 0.00800144 -1.11726 0.889938 0.0079167 -1.27499 0.889883 0.00777168 -1.53237 0.889816 0.00768589 -1.9347 0.88978 0.00770012 -2.54234 0.889814 0.00780962 -3.43494 0.88995 0.00804752 -4.7159 0.893777 0.00268073 -0.618862 0.91181 -0.0284667 -0.606766 0.911074 -0.0276712 -0.595268 0.910254 -0.0267692 -0.584422 0.909361 -0.025765 -0.574274 0.908405 -0.0246637 -0.564863 0.907401 -0.0234722 -0.55622 0.906365 -0.0221996 -0.548366 0.905316 -0.0208556 -0.541311 0.904273 -0.0194453 -0.535023 0.903234 -0.0179518 -0.529376 0.902138 -0.0162944 -0.524226 0.900876 -0.0143439 -0.519575 0.899396 -0.0120108 -0.515547 0.897749 -0.00928683 -0.512316 0.89608 -0.00619414 -0.510209 0.894685 -0.00282195 -0.509659 0.894155 9.5e-08 -0.510209 0.894685 0.00282218 -0.512316 0.89608 0.00619445 -0.515547 0.897749 0.00928719 -0.519575 0.899396 0.0120111 -0.524226 0.900876 0.0143443 -0.529376 0.902137 0.0162948 -0.535024 0.903233 0.0179522 -0.541311 0.904272 0.0194458 -0.548367 0.905316 0.0208562 -0.55622 0.906364 0.0222002 -0.564863 0.9074 0.0234729 -0.574275 0.908404 0.0246645 -0.584422 0.90936 0.0257658 -0.595268 0.910253 0.0267701 -0.606766 0.911073 0.0276722 -0.618862 0.91181 0.0284677 -0.631494 0.912449 0.0291508 -0.644591 0.912975 0.0297135 -0.658077 0.913366 0.0301448 -0.671865 0.9136 0.0304325 -0.685868 0.913652 0.0305646 -0.699996 0.913507 0.0305323 -0.714159 0.913153 0.0303325 -0.728274 0.912594 0.02997 -0.742263 0.911843 0.0294575 -0.756054 0.910925 0.0288147 -0.769582 0.909871 0.0280661 -0.782789 0.908715 0.0272378 -0.795618 0.907491 0.0263546 -0.80802 0.906226 0.0254374 -0.819947 0.904939 0.0245029 -0.831356 0.903645 0.0235629 -0.842208 0.902353 0.0226258 -0.852476 0.901069 0.0216984 -0.862136 0.899798 0.0207866 -0.871181 0.898549 0.0198972 -0.879615 0.897331 0.0190379 -0.887458 0.896154 0.0182167 -0.894745 0.895031 0.0174415 -0.901527 0.893973 0.0167194 -0.90787 0.892991 0.0160575 -0.913852 0.892099 0.0154641 -0.919547 0.891323 0.0149536 -0.924983 0.890723 0.0145502 -0.93081 0.890382 0.0142579 -0.938455 0.890135 0.014001 -0.951366 0.889963 0.0137427 -0.976763 0.889933 0.0135145 -1.02659 0.890008 0.0133748 -1.11819 0.890019 0.0132096 -1.27597 0.889927 0.0129721 -1.53347 0.889816 0.0128277 -1.93596 0.889759 0.0128415 -2.54372 0.889817 0.012999 -3.43622 0.890048 0.013329 -4.7159 0.896308 0.00440183 -0.618148 0.912127 -0.0345207 -0.605987 0.911379 -0.0335424 -0.594422 0.910546 -0.0324368 -0.583506 0.909639 -0.0312073 -0.573283 0.908672 -0.0298581 -0.563792 0.907657 -0.0283955 -0.555063 0.906614 -0.0268269 -0.547115 0.905561 -0.0251592 -0.539952 0.904514 -0.0233933 -0.53354 0.903474 -0.0215091 -0.527743 0.902391 -0.0194301 -0.522421 0.901174 -0.0170334 -0.51758 0.899775 -0.0142242 -0.513375 0.898248 -0.0109756 -0.510031 0.896737 -0.00729858 -0.507916 0.895536 -0.00332509 -0.507371 0.895101 1.93e-07 -0.507916 0.895536 0.00332553 -0.51003 0.896737 0.00729913 -0.513375 0.898247 0.0109763 -0.51758 0.899775 0.0142249 -0.522421 0.901173 0.0170342 -0.527743 0.90239 0.0194309 -0.53354 0.903473 0.0215099 -0.539952 0.904513 0.0233942 -0.547115 0.90556 0.0251602 -0.555063 0.906613 0.026828 -0.563792 0.907656 0.0283967 -0.573283 0.90867 0.0298595 -0.583506 0.909638 0.0312088 -0.594422 0.910545 0.0324384 -0.605987 0.911378 0.0335442 -0.618148 0.912126 0.0345226 -0.630845 0.912774 0.0353698 -0.644008 0.913305 0.0360801 -0.657562 0.913699 0.0366463 -0.671422 0.913933 0.0370597 -0.685499 0.913984 0.0373124 -0.699704 0.913837 0.0373989 -0.713947 0.913482 0.0373189 -0.728141 0.912922 0.0370786 -0.742207 0.912172 0.036691 -0.756072 0.911256 0.036175 -0.76967 0.910206 0.0355536 -0.782942 0.909055 0.0348508 -0.795833 0.907834 0.0340897 -0.808294 0.90657 0.0332903 -0.820279 0.905284 0.0324687 -0.831747 0.903988 0.0316373 -0.842664 0.902693 0.0308057 -0.852999 0.901405 0.0299822 -0.862734 0.900131 0.0291741 -0.871862 0.898881 0.0283892 -0.880389 0.897665 0.0276354 -0.888334 0.896495 0.0269203 -0.895735 0.895385 0.026251 -0.902642 0.894345 0.0256333 -0.909124 0.893389 0.025072 -0.915257 0.892528 0.0245707 -0.92112 0.891778 0.024133 -0.926756 0.891185 0.023764 -0.932806 0.890827 0.0234469 -0.940671 0.890544 0.0231173 -0.953691 0.890323 0.022726 -0.978945 0.890269 0.0223017 -1.02851 0.890371 0.021968 -1.11997 0.890387 0.0216526 -1.27774 0.890239 0.0212736 -1.53537 0.890058 0.0210395 -1.93808 0.889969 0.021048 -2.546 0.89007 0.021266 -3.43827 0.890455 0.0216995 -4.7159 0.900522 0.00722733 -0.616659 0.912974 -0.0438476 -0.604373 0.912197 -0.0425682 -0.592678 0.911333 -0.0411297 -0.581626 0.910394 -0.0395336 -0.57126 0.909395 -0.0377829 -0.561615 0.908351 -0.0358824 -0.552721 0.907281 -0.0338381 -0.544594 0.906203 -0.0316553 -0.537234 0.905134 -0.0293331 -0.530605 0.90408 -0.0268521 -0.524573 0.902997 -0.0241364 -0.519003 0.901805 -0.0210607 -0.513908 0.900459 -0.0175223 -0.509465 0.899009 -0.0134833 -0.505941 0.897589 -0.00895318 -0.503719 0.89646 -0.00410233 -0.503119 0.896028 3.99e-07 -0.503719 0.89646 0.0041032 -0.50594 0.897589 0.0089542 -0.509465 0.899008 0.0134844 -0.513908 0.900458 0.0175236 -0.519003 0.901803 0.021062 -0.524573 0.902995 0.0241378 -0.530605 0.904078 0.0268536 -0.537234 0.905133 0.0293348 -0.544593 0.906201 0.0316571 -0.55272 0.907279 0.0338402 -0.561615 0.908349 0.0358846 -0.57126 0.909393 0.0377853 -0.581626 0.910392 0.0395363 -0.592678 0.911331 0.0411326 -0.604373 0.912195 0.0425713 -0.616659 0.912971 0.043851 -0.629478 0.913645 0.0449705 -0.642763 0.914197 0.0459284 -0.656439 0.914608 0.0467222 -0.670423 0.914855 0.0473488 -0.684629 0.914918 0.047806 -0.698963 0.914781 0.0480932 -0.713337 0.914437 0.0482139 -0.727663 0.91389 0.0481765 -0.741858 0.913155 0.0479946 -0.75585 0.912255 0.0476862 -0.76957 0.911222 0.0472722 -0.78296 0.910088 0.0467744 -0.795968 0.908882 0.0462138 -0.808543 0.907632 0.0456088 -0.820646 0.906356 0.0449753 -0.832236 0.905069 0.0443261 -0.843283 0.90378 0.043672 -0.85376 0.902498 0.0430221 -0.863651 0.901231 0.0423845 -0.872953 0.89999 0.0417669 -0.881671 0.898785 0.0411758 -0.88983 0.89763 0.0406167 -0.897468 0.896536 0.0400933 -0.904636 0.895516 0.0396077 -0.911402 0.894579 0.0391599 -0.917847 0.893732 0.038748 -0.924051 0.892989 0.038369 -0.930061 0.892392 0.0380207 -0.936508 0.892028 0.0376753 -0.94477 0.891733 0.0372731 -0.958061 0.891494 0.0367367 -0.983202 0.891423 0.0360531 -1.03232 0.891543 0.0353977 -1.12337 0.891555 0.0348213 -1.28099 0.89132 0.0342344 -1.53872 0.891033 0.0338721 -1.94167 0.890899 0.0338674 -2.54972 0.891073 0.0341551 -3.44154 0.891704 0.0346813 -4.7159 0.907533 0.0118682 -0.613546 0.915089 -0.0579104 -0.601017 0.914238 -0.0561466 -0.58907 0.913296 -0.0541769 -0.577754 0.912276 -0.0519995 -0.56711 0.911195 -0.0496155 -0.557173 0.910069 -0.0470285 -0.54797 0.908918 -0.0442441 -0.539517 0.90776 -0.0412681 -0.531816 0.906616 -0.0381015 -0.524833 0.905494 -0.034727 -0.518443 0.904356 -0.0310644 -0.512516 0.903118 -0.0269779 -0.507072 0.901733 -0.0223556 -0.502301 0.900235 -0.0171557 -0.498489 0.898746 -0.0113916 -0.496038 0.897509 -0.00526345 -0.495322 0.896987 8.28e-07 -0.496038 0.897509 0.0052652 -0.498489 0.898745 0.0113936 -0.502301 0.900234 0.0171579 -0.507072 0.901731 0.022358 -0.512516 0.903116 0.0269804 -0.518443 0.904353 0.0310671 -0.524832 0.905491 0.0347299 -0.531816 0.906613 0.0381046 -0.539517 0.907757 0.0412715 -0.547969 0.908914 0.0442478 -0.557172 0.910065 0.0470325 -0.567109 0.911191 0.0496199 -0.577753 0.912272 0.0520043 -0.589069 0.913292 0.0541821 -0.601016 0.914234 0.0561523 -0.613545 0.915084 0.0579164 -0.6266 0.915826 0.0594779 -0.640116 0.916441 0.0608408 -0.65402 0.916909 0.0620095 -0.668232 0.917208 0.0629885 -0.682664 0.917321 0.0637826 -0.697226 0.917233 0.0643982 -0.711828 0.916938 0.0648436 -0.726382 0.916443 0.0651305 -0.740804 0.91576 0.0652735 -0.755021 0.914915 0.06529 -0.768965 0.913936 0.0651988 -0.782579 0.912855 0.0650193 -0.795812 0.911701 0.0647701 -0.808619 0.910497 0.0644681 -0.820962 0.909265 0.0641282 -0.832807 0.908018 0.0637631 -0.844126 0.906766 0.0633836 -0.8549 0.905519 0.0629984 -0.865115 0.904286 0.0626147 -0.874772 0.903077 0.0622376 -0.883879 0.901903 0.0618706 -0.892462 0.900775 0.061515 -0.900559 0.899705 0.0611703 -0.90822 0.898701 0.0608344 -0.915512 0.897773 0.0605037 -0.922513 0.896929 0.0601739 -0.929302 0.896181 0.0598398 -0.935923 0.895577 0.0594961 -0.943006 0.895217 0.0591049 -0.951919 0.894933 0.0586117 -0.965767 0.894708 0.0579114 -0.991013 0.894636 0.0569294 -1.03956 0.894746 0.0558349 -1.12985 0.894724 0.0548575 -1.28699 0.894358 0.0539848 -1.54464 0.893913 0.0534558 -1.94774 0.893718 0.0534288 -2.5558 0.894011 0.0537851 -3.44669 0.895024 0.0543433 -4.7159 0.919195 0.0194933 -0.607093 0.920074 -0.0785896 -0.594091 0.919041 -0.0760643 -0.581656 0.917907 -0.0732666 -0.569835 0.91669 -0.0701909 -0.55867 0.915404 -0.0668364 -0.548197 0.91407 -0.0632063 -0.538444 0.912707 -0.0593079 -0.529432 0.911338 -0.0551498 -0.521169 0.909985 -0.0507372 -0.513631 0.908659 -0.0460546 -0.506705 0.907321 -0.0410135 -0.500264 0.905874 -0.0354616 -0.494329 0.904253 -0.0292767 -0.489093 0.902483 -0.0224164 -0.484854 0.90068 -0.0148976 -0.482043 0.899116 -0.006947 -0.48115 0.898404 1.716e-06 -0.482043 0.899115 0.00695055 -0.484853 0.900679 0.0149014 -0.489093 0.902481 0.0224206 -0.494328 0.90425 0.0292812 -0.500263 0.905871 0.0354664 -0.506704 0.907317 0.0410186 -0.51363 0.908655 0.04606 -0.521167 0.90998 0.050743 -0.52943 0.911333 0.0551561 -0.538442 0.912702 0.0593147 -0.548195 0.914064 0.0632137 -0.558669 0.915398 0.0668443 -0.569834 0.916683 0.0701995 -0.581654 0.9179 0.0732759 -0.59409 0.919033 0.0760744 -0.607091 0.920066 0.0786005 -0.620605 0.920982 0.0808629 -0.634566 0.921761 0.0828729 -0.648906 0.922385 0.0846434 -0.663545 0.922834 0.0861878 -0.6784 0.923092 0.08752 -0.693381 0.923146 0.0886544 -0.7084 0.922994 0.0896057 -0.723371 0.922641 0.09039 -0.738212 0.922102 0.0910236 -0.752849 0.921401 0.0915239 -0.76722 0.920564 0.0919083 -0.781269 0.919622 0.092194 -0.794949 0.918602 0.092397 -0.80822 0.917528 0.0925322 -0.82105 0.916417 0.0926126 -0.83341 0.915285 0.0926495 -0.845279 0.914141 0.092652 -0.856641 0.912995 0.0926266 -0.867488 0.911854 0.0925779 -0.877821 0.910726 0.0925076 -0.887651 0.909622 0.0924154 -0.896999 0.908551 0.0922989 -0.905901 0.907523 0.0921546 -0.914403 0.906546 0.0919778 -0.922566 0.905632 0.0917641 -0.930464 0.904788 0.0915086 -0.938173 0.904034 0.0912061 -0.945731 0.903422 0.0908483 -0.953778 0.903071 0.0903841 -0.963706 0.902803 0.0897689 -0.978547 0.9026 0.0888769 -1.00439 0.902526 0.0875828 -1.05257 0.902578 0.0860052 -1.14177 0.902453 0.0845189 -1.29793 0.901896 0.0832983 -1.55509 0.901231 0.0825835 -1.95805 0.90096 0.0825294 -2.56571 0.901442 0.0829321 -3.45474 0.903028 0.0833625 -4.7159 0.938585 0.0320249 -0.59393 0.93116 -0.108056 -0.580037 0.92971 -0.104363 -0.566694 0.928142 -0.100308 -0.553952 0.926476 -0.0958853 -0.541858 0.924729 -0.0910915 -0.530452 0.922922 -0.085932 -0.519772 0.92108 -0.0804169 -0.509849 0.919227 -0.0745591 -0.500703 0.917393 -0.0683684 -0.492325 0.915592 -0.0618308 -0.484609 0.913778 -0.0548457 -0.47743 0.911833 -0.0472406 -0.470802 0.909671 -0.0388808 -0.464919 0.907314 -0.0297219 -0.460091 0.9049 -0.0197815 -0.456791 0.90277 -0.00931237 -0.455657 0.901761 3.499e-06 -0.45679 0.902769 0.00931952 -0.46009 0.904898 0.019789 -0.464918 0.907311 0.02973 -0.4708 0.909666 0.0388893 -0.477427 0.911828 0.0472497 -0.484606 0.913772 0.0548554 -0.492322 0.915586 0.061841 -0.5007 0.917385 0.0683794 -0.509845 0.919219 0.0745708 -0.519768 0.92107 0.0804295 -0.530448 0.922913 0.0859456 -0.541854 0.924718 0.0911062 -0.553949 0.926465 0.0959012 -0.566691 0.92813 0.100326 -0.580034 0.929697 0.104381 -0.593927 0.931147 0.108076 -0.608313 0.932463 0.111424 -0.623128 0.933627 0.114443 -0.638303 0.93462 0.117154 -0.653762 0.935426 0.11958 -0.669423 0.936031 0.121746 -0.685201 0.936425 0.123673 -0.701013 0.936608 0.125384 -0.716775 0.936586 0.1269 -0.732411 0.936374 0.128241 -0.747854 0.935996 0.129425 -0.763044 0.935476 0.130469 -0.777931 0.934842 0.131389 -0.792474 0.934119 0.132198 -0.80664 0.933328 0.132909 -0.820401 0.932486 0.133533 -0.833736 0.931606 0.134079 -0.846626 0.930696 0.134553 -0.85906 0.929763 0.134962 -0.87103 0.928814 0.135307 -0.882536 0.927853 0.135587 -0.893586 0.92689 0.135801 -0.904197 0.925931 0.135946 -0.914398 0.924987 0.136016 -0.92423 0.924068 0.136008 -0.933749 0.923185 0.135916 -0.943024 0.922353 0.135738 -0.952129 0.921594 0.135468 -0.961099 0.92097 0.135092 -0.9706 0.920623 0.134541 -0.982081 0.92036 0.13379 -0.998567 0.920157 0.132704 -1.02583 0.920048 0.131133 -1.07445 0.919981 0.129148 -1.1627 0.919677 0.127178 -1.31738 0.918884 0.12562 -1.57336 0.91796 0.124753 -1.97549 0.917614 0.124681 -2.58183 0.918384 0.125072 -3.46723 0.920799 0.125031 -4.7159 0.970816 0.0526243 -0.567747 0.954267 -0.148362 -0.552272 0.951961 -0.142938 -0.537348 0.949513 -0.137049 -0.523036 0.946945 -0.130685 -0.509394 0.944278 -0.123847 -0.496474 0.941541 -0.116543 -0.484329 0.938763 -0.108785 -0.473002 0.935981 -0.100591 -0.46253 0.933232 -0.0919732 -0.452916 0.930539 -0.0829158 -0.444066 0.927848 -0.0733044 -0.435848 0.925013 -0.0629436 -0.42827 0.921929 -0.051683 -0.421526 0.918632 -0.0394721 -0.41594 0.915301 -0.0263229 -0.412031 0.912376 -0.012512 -0.4106 0.910965 6.895e-06 -0.41203 0.912374 0.012526 -0.415938 0.915298 0.0263374 -0.421523 0.918628 0.0394874 -0.428266 0.921924 0.0516992 -0.435843 0.925006 0.0629606 -0.444061 0.92784 0.0733225 -0.45291 0.93053 0.0829351 -0.462523 0.933221 0.0919939 -0.472995 0.935969 0.100613 -0.484321 0.938749 0.108809 -0.496466 0.941526 0.116568 -0.509386 0.944262 0.123874 -0.523028 0.946927 0.130715 -0.53734 0.949494 0.137081 -0.552265 0.95194 0.142973 -0.56774 0.954245 0.148399 -0.583703 0.956388 0.153373 -0.600083 0.95835 0.157917 -0.616808 0.960115 0.162057 -0.6338 0.961667 0.165822 -0.650978 0.962993 0.169243 -0.668262 0.964089 0.17235 -0.685571 0.964953 0.175173 -0.702829 0.965594 0.177738 -0.719965 0.966029 0.180069 -0.736919 0.966276 0.182187 -0.753639 0.96636 0.18411 -0.77008 0.966305 0.185853 -0.786209 0.966133 0.187432 -0.801998 0.965863 0.188859 -0.817424 0.96551 0.190143 -0.83247 0.965082 0.191296 -0.84712 0.964588 0.192324 -0.861364 0.964031 0.193233 -0.875193 0.963414 0.194027 -0.888605 0.962744 0.194706 -0.901604 0.962025 0.195271 -0.914203 0.961267 0.195718 -0.926426 0.960478 0.196046 -0.938309 0.959672 0.196251 -0.949906 0.958864 0.196329 -0.961285 0.958072 0.196277 -0.97252 0.957326 0.196087 -0.983644 0.956697 0.195738 -0.995369 0.956356 0.195137 -1.00925 0.956093 0.194293 -1.02839 0.955877 0.193082 -1.05836 0.955715 0.191359 -1.10896 0.955525 0.189179 -1.19744 0.955056 0.186949 -1.35071 0.954093 0.185209 -1.60476 0.952986 0.184303 -2.00481 0.952635 0.18425 -2.608 0.953832 0.184513 -3.48654 0.957444 0.183317 -4.7159 1.02439 0.0864905 -0.517465 0.999262 -0.20114 -0.499389 0.995421 -0.193285 -0.481918 0.991414 -0.184851 -0.465127 0.987273 -0.175834 -0.449089 0.98303 -0.166238 -0.433872 0.978725 -0.156072 -0.419544 0.974402 -0.14535 -0.406164 0.970109 -0.134089 -0.393785 0.9659 -0.1223 -0.382425 0.961811 -0.109962 -0.371995 0.957777 -0.0969455 -0.362358 0.953625 -0.0830337 -0.353522 0.949236 -0.0680587 -0.345683 0.944665 -0.0519569 -0.339181 0.940148 -0.0347281 -0.334574 0.93624 -0.0166667 -0.332813 0.934339 1.2858e-05 -0.334573 0.936238 0.0166927 -0.339177 0.940145 0.0347549 -0.345678 0.94466 0.0519849 -0.353515 0.949229 0.0680882 -0.36235 0.953616 0.083065 -0.371985 0.957766 0.0969788 -0.382414 0.961798 0.109997 -0.393773 0.965886 0.122338 -0.406152 0.970093 0.13413 -0.419531 0.974383 0.145395 -0.433859 0.978704 0.15612 -0.449075 0.983007 0.16629 -0.465113 0.987247 0.175891 -0.481905 0.991386 0.184912 -0.499377 0.99539 0.193351 -0.517455 0.999228 0.201211 -0.536059 1.00287 0.208505 -0.555109 1.00631 0.215251 -0.574522 1.0095 0.221474 -0.59421 1.01243 0.227202 -0.614089 1.01509 0.232467 -0.634074 1.01747 0.237303 -0.654084 1.01957 0.241742 -0.674045 1.0214 0.245815 -0.693889 1.02298 0.249548 -0.713561 1.02432 0.252968 -0.733012 1.02544 0.256098 -0.752205 1.02636 0.258956 -0.77111 1.02711 0.261561 -0.789705 1.02771 0.26393 -0.807973 1.02815 0.266079 -0.825897 1.02847 0.268021 -0.843467 1.02865 0.269769 -0.860672 1.02871 0.271334 -0.877506 1.02864 0.272723 -0.893966 1.02845 0.273944 -0.910054 1.02816 0.274999 -0.925781 1.02775 0.27589 -0.941171 1.02726 0.276616 -0.956259 1.02669 0.277177 -0.971101 1.02607 0.277569 -0.985769 1.02541 0.277787 -1.00034 1.02475 0.277821 -1.01486 1.02419 0.277636 -1.03009 1.02392 0.277108 -1.04779 1.02373 0.276307 -1.07122 1.02357 0.275143 -1.1059 1.02346 0.273512 -1.16098 1.02331 0.271481 -1.25234 1.0229 0.269407 -1.40576 1.02208 0.267821 -1.65764 1.02114 0.26709 -2.05388 1.02103 0.267116 -2.65066 1.0229 0.267039 -3.51653 1.02835 0.263343 -4.7159 1.11342 0.142174 -0.424793 1.08217 -0.268925 -0.402696 1.07588 -0.257801 -0.381345 1.06943 -0.245982 -0.360831 1.06285 -0.233468 -0.341243 1.05621 -0.220262 -0.322667 1.04956 -0.206373 -0.305183 1.04295 -0.191814 -0.288867 1.03646 -0.176595 -0.273787 1.03017 -0.160723 -0.259974 1.02411 -0.144169 -0.24735 1.01822 -0.126789 -0.235782 1.01231 -0.108351 -0.225278 1.00623 -0.0886714 -0.21605 1.00008 -0.0676707 -0.208454 0.994154 -0.0453313 -0.203076 0.989114 -0.0219581 -0.200971 0.986652 2.2406e-05 -0.203073 0.989112 0.0220033 -0.208448 0.99415 0.0453777 -0.216041 1.00008 0.0677192 -0.225267 1.00623 0.0887226 -0.235768 1.0123 0.108405 -0.247335 1.01821 0.126847 -0.259957 1.02409 0.144232 -0.273768 1.03015 0.160792 -0.288848 1.03645 0.17667 -0.305163 1.04293 0.191895 -0.322647 1.04953 0.206461 -0.341224 1.05618 0.220358 -0.360812 1.06282 0.233572 -0.381327 1.06939 0.246096 -0.402681 1.07584 0.257925 -0.42478 1.08213 0.26906 -0.44753 1.08821 0.279508 -0.470834 1.09404 0.289284 -0.494589 1.09958 0.298405 -0.518697 1.10482 0.306897 -0.543056 1.10972 0.314787 -0.56757 1.11426 0.322105 -0.592147 1.11844 0.328882 -0.616705 1.12227 0.335147 -0.641171 1.12574 0.340931 -0.665485 1.12888 0.346262 -0.689597 1.13172 0.351166 -0.713469 1.13426 0.35567 -0.737075 1.13652 0.359798 -0.760393 1.13854 0.363574 -0.783409 1.14031 0.367023 -0.806113 1.14185 0.370166 -0.828496 1.14317 0.373024 -0.850552 1.14426 0.375616 -0.872279 1.14514 0.377958 -0.893677 1.14582 0.380064 -0.914753 1.14629 0.381944 -0.935521 1.14657 0.383604 -0.95601 1.14668 0.385048 -0.976262 1.14663 0.386277 -0.996342 1.14646 0.387289 -1.01633 1.14618 0.388079 -1.03634 1.14585 0.38863 -1.05639 1.14558 0.388887 -1.07738 1.14561 0.388689 -1.10132 1.14572 0.388197 -1.1318 1.1459 0.387386 -1.17444 1.14617 0.386222 -1.23791 1.14648 0.38481 -1.33662 1.14668 0.383447 -1.49413 1.14664 0.382528 -1.74537 1.14658 0.382302 -2.13596 1.14735 0.382474 -2.72089 1.15041 0.381606 -3.5637 1.15911 0.37281 -4.7159 1.26138 0.233741 -0.260031 1.23057 -0.359003 -0.23174 1.22056 -0.343472 -0.204448 1.21043 -0.327105 -0.178265 1.20023 -0.309901 -0.153301 1.19004 -0.291863 -0.129657 1.17994 -0.272996 -0.107434 1.17002 -0.253306 -0.0867258 1.16037 -0.232796 -0.0676173 1.15108 -0.211463 -0.0501606 1.14224 -0.189267 -0.0342932 1.13377 -0.166057 -0.0198989 1.12546 -0.141597 -0.00700879 1.11716 -0.115694 --0.0041437 1.10902 -0.0882495 --0.01318 1.10137 -0.0592299 --0.0194917 1.09501 -0.028945 --0.0219753 1.0919 3.64e-05 --0.0194962 1.09501 0.0290183 --0.0131889 1.10137 0.0593053 --0.00415657 1.10901 0.0883283 -0.00699241 1.11716 0.115777 -0.0198795 1.12545 0.141686 -0.0342713 1.13376 0.166154 -0.0501369 1.14223 0.189373 -0.0675923 1.15107 0.211578 -0.0867003 1.16035 0.232923 -0.107409 1.17 0.253445 -0.129633 1.17992 0.27315 -0.153279 1.19001 0.292033 -0.178246 1.2002 0.310088 -0.204432 1.21039 0.327311 -0.231729 1.22052 0.343698 -0.260026 1.23052 0.359251 -0.289208 1.24031 0.373974 -0.319156 1.24984 0.387879 -0.34975 1.25905 0.40098 -0.380867 1.26789 0.413297 -0.412387 1.27631 0.424854 -0.444191 1.28429 0.435675 -0.47617 1.29179 0.445788 -0.508221 1.29882 0.45522 -0.540257 1.30536 0.464001 -0.572202 1.31144 0.47216 -0.603997 1.31706 0.479725 -0.635598 1.32225 0.486727 -0.66697 1.32702 0.493198 -0.698092 1.3314 0.499168 -0.728951 1.33539 0.50467 -0.759538 1.33902 0.509736 -0.789851 1.34229 0.514397 -0.819892 1.34521 0.518683 -0.849665 1.34778 0.522618 -0.879181 1.35002 0.526227 -0.908458 1.35194 0.529527 -0.937525 1.35355 0.532533 -0.966426 1.35488 0.535253 -0.995221 1.35594 0.537693 -1.024 1.35677 0.539853 -1.05288 1.35742 0.541727 -1.08198 1.35794 0.543292 -1.11137 1.35845 0.544465 -1.1421 1.3593 0.545032 -1.17656 1.36024 0.545288 -1.21879 1.36133 0.545297 -1.27467 1.36263 0.54511 -1.35252 1.36414 0.544877 -1.46532 1.36576 0.544828 -1.63366 1.36746 0.545155 -1.88852 1.36937 0.545809 -2.27219 1.37219 0.546066 -2.83657 1.37775 0.543301 -3.63847 1.39288 0.525227 -4.7159 1.50726 0.384328 --0.0263443 1.49434 -0.488613 --0.0646918 1.47855 -0.466777 --0.101637 1.46267 -0.44389 --0.137038 1.44681 -0.419949 --0.170758 1.43109 -0.394955 --0.202661 1.41561 -0.368907 --0.232619 1.40051 -0.341803 --0.260504 1.38592 -0.313636 --0.286201 1.37198 -0.284388 --0.309621 1.35881 -0.254011 --0.330791 1.34637 -0.22235 --0.349783 1.33443 -0.18918 --0.36652 1.32289 -0.154308 --0.380719 1.31192 -0.117621 --0.391966 1.30197 -0.0790701 --0.399631 1.29394 -0.0389683 --0.402608 1.29005 5.4308e-05 --0.399637 1.29394 0.0390776 --0.391977 1.30197 0.0791826 --0.380735 1.31192 0.117739 --0.366539 1.32289 0.154434 --0.349806 1.33443 0.189316 --0.330815 1.34637 0.222499 --0.309647 1.35881 0.254175 --0.286226 1.37198 0.28457 --0.260528 1.38592 0.313838 --0.232639 1.4005 0.342028 --0.202677 1.4156 0.369158 --0.170767 1.43108 0.395235 --0.137039 1.4468 0.420261 --0.101627 1.46266 0.444236 --0.0646698 1.47853 0.467162 --0.0263077 1.49431 0.48904 -0.0133133 1.50991 0.509875 -0.0540438 1.52521 0.529678 -0.095732 1.54015 0.548462 -0.138225 1.55462 0.566246 -0.181369 1.56857 0.583051 -0.225019 1.58194 0.598902 -0.269034 1.59468 0.613825 -0.313284 1.60677 0.627846 -0.357657 1.61819 0.640997 -0.402056 1.62895 0.653307 -0.446404 1.63905 0.664809 -0.49064 1.64852 0.675539 -0.534724 1.65736 0.685535 -0.578627 1.66561 0.694837 -0.622337 1.67327 0.703487 -0.665852 1.68038 0.711527 -0.709177 1.68694 0.719002 -0.752328 1.69296 0.725951 -0.795328 1.69846 0.732414 -0.83821 1.70346 0.738424 -0.88102 1.70798 0.744012 -0.923818 1.71202 0.749202 -0.966683 1.71564 0.754011 -1.00972 1.71885 0.75845 -1.05307 1.7217 0.762522 -1.09691 1.72425 0.766224 -1.14142 1.72657 0.769524 -1.18673 1.7288 0.772308 -1.23412 1.73138 0.774291 -1.28639 1.73409 0.775927 -1.34813 1.73704 0.777379 -1.42544 1.74037 0.778771 -1.52622 1.7441 0.780264 -1.66182 1.74823 0.781981 -1.84915 1.75281 0.783849 -2.11315 1.75807 0.785364 -2.48849 1.76484 0.784982 -3.01943 1.77584 0.778135 -3.75389 1.80245 0.748487 -4.7159 1.91586 0.631996 --0.516846 1.96426 -0.691137 --0.572464 1.93871 -0.659539 --0.626043 1.91308 -0.626507 --0.677378 1.88755 -0.592041 --0.72627 1.86231 -0.55614 --0.772521 1.83753 -0.518803 --0.815942 1.81344 -0.480021 --0.856343 1.79025 -0.43978 --0.893545 1.76819 -0.398051 --0.927392 1.74746 -0.354772 --0.95783 1.72809 -0.309805 --0.984838 1.70995 -0.262957 --1.00824 1.69302 -0.214053 --1.02767 1.6776 -0.162974 --1.04264 1.66425 -0.109674 --1.05251 1.65398 -0.0544774 --1.05621 1.64916 6.8547e-05 --1.05251 1.65398 0.0546156 --1.04265 1.66426 0.109816 --1.02768 1.67761 0.163125 --1.00826 1.69304 0.214215 --0.984854 1.70997 0.263134 --0.957845 1.72812 0.310001 --0.927405 1.74748 0.354991 --0.893553 1.76822 0.398297 --0.856345 1.79028 0.440058 --0.815933 1.81348 0.480335 --0.7725 1.83757 0.519157 --0.726232 1.86234 0.55654 --0.67732 1.88759 0.592492 --0.625961 1.91312 0.627016 --0.572353 1.93874 0.660111 --0.516704 1.96429 0.691777 --0.45922 1.9896 0.72202 --0.400116 2.01452 0.750847 --0.339606 2.03891 0.778274 --0.277901 2.06264 0.804321 --0.215213 2.08561 0.829013 --0.151741 2.10773 0.852381 --0.0876759 2.12892 0.874457 --0.02319 2.14915 0.895277 -0.0415646 2.16839 0.914881 -0.106459 2.18663 0.933309 -0.171391 2.20389 0.950608 -0.236281 2.22016 0.966827 -0.301078 2.23549 0.982018 -0.365753 2.24991 0.996237 -0.430298 2.26343 1.00954 -0.494723 2.2761 1.02199 -0.559058 2.28794 1.03365 -0.623348 2.29898 1.04458 -0.687656 2.30925 1.05482 -0.752062 2.31878 1.06443 -0.816666 2.32761 1.07346 -0.881594 2.33577 1.08194 -0.946999 2.34331 1.08991 -1.01307 2.35027 1.09738 -1.08004 2.35672 1.10437 -1.14819 2.36271 1.11088 -1.21783 2.36834 1.11686 -1.2892 2.37378 1.12219 -1.36378 2.37952 1.12651 -1.44467 2.38538 1.13041 -1.53662 2.39154 1.1341 -1.64545 2.39817 1.13773 -1.77799 2.40537 1.1414 -1.94316 2.41323 1.14502 -2.15349 2.42201 1.14822 -2.42681 2.43226 1.15002 -2.78816 2.44539 1.14821 -3.27086 2.4653 1.13775 -3.91126 2.50373 1.10711 -4.7159 2.59484 1.03937 --1.34197 2.82179 -1.03526 --1.4304 2.77779 -0.987553 --1.5157 2.73353 -0.937549 --1.59749 2.68933 -0.885273 --1.6754 2.64555 -0.830752 --1.74909 2.60256 -0.774015 --1.81822 2.56075 -0.715085 --1.88248 2.52054 -0.653969 --1.94156 2.48233 -0.590657 --1.9952 2.44656 -0.525112 --2.04318 2.4135 -0.457246 --2.08531 2.38329 -0.38695 --2.12124 2.3562 -0.314111 --2.15046 2.33281 -0.238652 --2.17237 2.31386 -0.160595 --2.18627 2.30045 -0.0803154 --2.19125 2.29469 5.6781e-05 --2.18627 2.30045 0.0804302 --2.17237 2.31387 0.160714 --2.15046 2.33283 0.23878 --2.12124 2.35623 0.31425 --2.08531 2.38332 0.387105 --2.04318 2.41354 0.457421 --1.99519 2.44661 0.525311 --1.94155 2.48239 0.590885 --1.88244 2.5206 0.654231 --1.81817 2.56082 0.715387 --1.74902 2.60264 0.774363 --1.67531 2.64564 0.831151 --1.59736 2.68943 0.885731 --1.51553 2.73364 0.938073 --1.43018 2.77791 0.98815 --1.3417 2.82191 1.03594 --1.25046 2.86533 1.08143 --1.15688 2.90791 1.12462 --1.06136 2.94938 1.16553 --0.964289 2.98953 1.2042 --0.866054 3.0282 1.24068 --0.767016 3.06523 1.27502 --0.667508 3.10054 1.30731 --0.567827 3.13406 1.33763 --0.468232 3.16576 1.36607 --0.368935 3.19566 1.39273 --0.270104 3.22378 1.41772 --0.17186 3.25018 1.44113 --0.0742801 3.27492 1.46308 -0.0226003 3.29807 1.48367 -0.118785 3.31973 1.50302 -0.214313 3.33996 1.52123 -0.309256 3.35886 1.5384 -0.403718 3.37651 1.55462 -0.497831 3.39299 1.56999 -0.591762 3.40839 1.58458 -0.685706 3.42278 1.59845 -0.779898 3.43625 1.61168 -0.874613 3.44888 1.6243 -0.970176 3.46075 1.63636 -1.06697 3.47193 1.64787 -1.16544 3.48253 1.65885 -1.26611 3.49263 1.66927 -1.36947 3.50239 1.67904 -1.477 3.51218 1.68789 -1.59138 3.52195 1.69629 -1.71643 3.53188 1.70444 -1.85669 3.54216 1.71244 -2.0173 3.55294 1.7203 -2.20494 3.56444 1.72787 -2.42894 3.57703 1.73476 -2.70269 3.5914 1.74022 -3.0454 3.60892 1.74289 -3.48297 3.63242 1.74037 -4.04173 3.66769 1.72933 -4.7159 3.72311 1.70946 --2.698 4.59744 -1.74022 --2.87954 4.5094 -1.66973 --3.05346 4.42133 -1.59356 --3.21885 4.3342 -1.51158 --3.37489 4.24897 -1.42375 --3.52091 4.16649 -1.33009 --3.65634 4.08753 -1.23071 --3.7807 4.01272 -1.12579 --3.89367 3.94254 -1.0156 --3.99502 3.87729 -0.900477 --4.08466 3.81709 -0.78084 --4.16261 3.76187 -0.657183 --4.22905 3.71134 -0.530065 --4.28433 3.66498 -0.400103 --4.32893 3.62207 -0.267965 --4.36354 3.58162 -0.134354 --4.38904 3.5424 0 --4.36354 3.58162 0.134354 --4.32893 3.62207 0.267965 --4.28433 3.66498 0.400103 --4.22905 3.71134 0.530065 --4.16261 3.76187 0.657183 --4.08466 3.81709 0.78084 --3.99502 3.87729 0.900477 --3.89367 3.94254 1.0156 --3.7807 4.01272 1.12579 --3.65634 4.08753 1.23071 --3.52091 4.16649 1.33009 --3.37489 4.24897 1.42375 --3.21885 4.3342 1.51158 --3.05346 4.42133 1.59356 --2.87954 4.5094 1.66973 --2.698 4.59744 1.74022 --2.50986 4.68442 1.80518 --2.31626 4.76937 1.86484 --2.11844 4.85133 1.91948 --1.91772 4.92942 1.9694 --1.71548 5.0029 2.01494 --1.51319 5.07111 2.05645 --1.31231 5.13358 2.09429 --1.11434 5.18998 2.12885 --0.920732 5.24014 2.16049 --0.732916 5.28408 2.18958 --0.552224 5.32196 2.21646 --0.379894 5.35408 2.24147 --0.217037 5.38088 2.26491 --0.0646154 5.40288 2.28707 -0.0765701 5.42069 2.30821 -0.205898 5.43493 2.32857 -0.322938 5.44625 2.34871 -0.427463 5.45529 2.36884 -0.519441 5.46264 2.38898 -0.599052 5.46911 2.40911 -0.666698 5.47555 2.42925 -0.722997 5.482 2.44938 -0.768792 5.48844 2.46952 -0.805162 5.49488 2.48965 -0.83344 5.50133 2.50979 -0.855223 5.50777 2.52992 -0.872388 5.51422 2.55006 -0.887104 5.52066 2.5702 -0.90227 5.5271 2.59033 -0.923173 5.53355 2.61047 -0.957044 5.53999 2.6306 -1.01317 5.54643 2.65074 -1.10348 5.55288 2.67087 -1.24328 5.55932 2.69101 -1.45224 5.56577 2.71114 -1.7556 5.57221 2.73128 -2.18578 5.57865 2.75141 -2.78439 5.5851 2.77155 -3.60489 5.59154 2.79168 -4.7159 5.59799 2.81182 -0.636529 0.945237 -0.0181023 -0.624785 0.944486 -0.0175665 -0.613622 0.943652 -0.0169569 -0.603096 0.942743 -0.0162794 -0.593251 0.941767 -0.0155394 -0.584128 0.940735 -0.0147447 -0.575756 0.93966 -0.013907 -0.568158 0.938563 -0.0130426 -0.561342 0.937468 -0.0121707 -0.555305 0.936396 -0.0113108 -0.549975 0.935241 -0.0103756 -0.545239 0.933777 -0.00917727 -0.541075 0.931919 -0.00764473 -0.537524 0.929776 -0.00586519 -0.534602 0.927496 -0.0039619 -0.532292 0.925155 -0.00199907 -0.530599 0.922781 0 -0.532292 0.925155 0.00199907 -0.534602 0.927496 0.0039619 -0.537524 0.929776 0.00586519 -0.541075 0.931919 0.00764473 -0.545239 0.933777 0.00917727 -0.549975 0.935241 0.0103756 -0.555305 0.936396 0.0113108 -0.561342 0.937468 0.0121707 -0.568158 0.938563 0.0130426 -0.575756 0.93966 0.013907 -0.584128 0.940735 0.0147447 -0.593251 0.941767 0.0155394 -0.603096 0.942743 0.0162794 -0.613622 0.943652 0.0169569 -0.624785 0.944486 0.0175665 -0.636529 0.945237 0.0181023 -0.64879 0.945894 0.0185562 -0.661498 0.946439 0.0189165 -0.674572 0.946851 0.0191677 -0.687929 0.947104 0.019292 -0.701483 0.947174 0.0192719 -0.715146 0.947039 0.0190938 -0.728835 0.946689 0.0187509 -0.742472 0.946122 0.0182454 -0.755985 0.945354 0.0175897 -0.76931 0.944408 0.0168042 -0.782386 0.943319 0.0159154 -0.795157 0.942123 0.0149519 -0.807569 0.940855 0.013941 -0.819572 0.939547 0.0129054 -0.831116 0.93822 0.0118619 -0.842156 0.93689 0.0108214 -0.852652 0.935564 0.00979011 -0.862573 0.934249 0.00877138 -0.871896 0.932949 0.0077677 -0.880613 0.931668 0.00678253 -0.888729 0.930413 0.00582046 -0.896262 0.929194 0.00488712 -0.903247 0.928017 0.00398827 -0.909735 0.92689 0.00312836 -0.915792 0.925815 0.0023095 -0.9215 0.924785 0.00152575 -0.926957 0.923781 0.000762398 -0.932278 0.922777 0 -0.938016 0.922778 0 -0.945231 0.922778 0 -0.957856 0.922778 0 -0.983196 0.922778 0 -1.03288 0.922779 0 -1.12411 0.922779 0 -1.2812 0.92278 0 -1.53766 0.92278 0 -1.93874 0.92278 0 -2.54481 0.922781 0 -3.43563 0.922781 0 -4.7159 0.922781 0 -0.636528 0.945237 -0.0181226 -0.624784 0.944486 -0.0175868 -0.613621 0.943652 -0.0169771 -0.603094 0.942743 -0.0162995 -0.59325 0.941767 -0.0155594 -0.584126 0.940734 -0.0147646 -0.575754 0.93966 -0.0139268 -0.568156 0.938563 -0.0130622 -0.561339 0.937468 -0.0121901 -0.555302 0.936396 -0.01133 -0.549971 0.935241 -0.0103945 -0.545234 0.933778 -0.00919553 -0.541067 0.931922 -0.00766162 -0.537513 0.929781 -0.00587936 -0.534589 0.927504 -0.00397121 -0.532277 0.925166 -0.0020001 -0.530602 0.922801 0 -0.532277 0.925166 0.0020001 -0.534589 0.927504 0.00397122 -0.537513 0.929781 0.00587936 -0.541067 0.931922 0.00766162 -0.545234 0.933778 0.00919553 -0.549971 0.935241 0.0103945 -0.555302 0.936396 0.01133 -0.561339 0.937468 0.0121901 -0.568156 0.938563 0.0130622 -0.575754 0.93966 0.0139268 -0.584126 0.940734 0.0147646 -0.59325 0.941767 0.0155594 -0.603094 0.942743 0.0162995 -0.613621 0.943652 0.0169771 -0.624784 0.944486 0.0175868 -0.636528 0.945237 0.0181226 -0.64879 0.945894 0.0185766 -0.661497 0.946439 0.018937 -0.674572 0.946851 0.0191882 -0.687929 0.947104 0.0193125 -0.701483 0.947174 0.0192925 -0.715146 0.947039 0.0191144 -0.728835 0.946688 0.0187715 -0.742473 0.946122 0.0182661 -0.755986 0.945353 0.0176103 -0.769311 0.944407 0.0168248 -0.782387 0.943318 0.015936 -0.795158 0.942122 0.0149726 -0.80757 0.940855 0.0139616 -0.819573 0.939547 0.012926 -0.831118 0.93822 0.0118825 -0.842158 0.936889 0.0108419 -0.852654 0.935564 0.00981057 -0.862574 0.934249 0.00879177 -0.871898 0.932948 0.00778802 -0.880615 0.931667 0.00680277 -0.888731 0.930413 0.00584061 -0.896264 0.929193 0.00490718 -0.903249 0.928016 0.00400826 -0.909737 0.926889 0.00314828 -0.915795 0.925814 0.00232938 -0.921503 0.924784 0.00154562 -0.926959 0.92378 0.000782317 -0.932279 0.92278 2.0069e-05 -0.938016 0.922778 2.0219e-05 -0.945232 0.922777 2.0318e-05 -0.957858 0.922777 2.0594e-05 -0.983198 0.922778 2.1195e-05 -1.03289 0.922778 2.1746e-05 -1.12411 0.922778 2.1729e-05 -1.28121 0.922779 2.1469e-05 -1.53766 0.922779 2.1392e-05 -1.93874 0.922779 2.1605e-05 -2.54481 0.922779 2.2287e-05 -3.43564 0.92278 2.3996e-05 -4.7159 0.922795 1.1472e-05 -0.636527 0.945237 -0.0181578 -0.624782 0.944486 -0.0176218 -0.613619 0.943651 -0.0170119 -0.603092 0.942742 -0.016334 -0.593247 0.941766 -0.0155936 -0.584124 0.940734 -0.0147985 -0.575751 0.939659 -0.0139603 -0.568152 0.938563 -0.0130952 -0.561335 0.937468 -0.0122226 -0.555298 0.936396 -0.0113618 -0.549966 0.935241 -0.0104252 -0.545225 0.933779 -0.00922471 -0.541054 0.931926 -0.00768825 -0.537496 0.929789 -0.00590146 -0.534567 0.927516 -0.00398559 -0.532255 0.925184 -0.00200173 -0.530607 0.922835 0 -0.532255 0.925184 0.00200173 -0.534567 0.927516 0.00398559 -0.537496 0.929789 0.00590146 -0.541054 0.931926 0.00768825 -0.545225 0.933779 0.00922471 -0.549966 0.935241 0.0104252 -0.555298 0.936396 0.0113618 -0.561335 0.937468 0.0122226 -0.568152 0.938563 0.0130952 -0.575751 0.939659 0.0139603 -0.584124 0.940734 0.0147985 -0.593247 0.941766 0.0155936 -0.603092 0.942742 0.016334 -0.613619 0.943651 0.0170119 -0.624782 0.944486 0.0176218 -0.636527 0.945237 0.0181578 -0.648788 0.945893 0.018612 -0.661496 0.946438 0.0189725 -0.674571 0.94685 0.0192239 -0.687929 0.947103 0.0193483 -0.701483 0.947173 0.0193283 -0.715146 0.947038 0.0191504 -0.728836 0.946687 0.0188075 -0.742474 0.946121 0.0183022 -0.755988 0.945352 0.0176465 -0.769313 0.944406 0.0168611 -0.782389 0.943317 0.0159723 -0.79516 0.942121 0.0150089 -0.807573 0.940854 0.0139981 -0.819576 0.939546 0.0129624 -0.831121 0.938218 0.0119189 -0.842161 0.936888 0.0108784 -0.852657 0.935562 0.00984697 -0.862578 0.934247 0.00882812 -0.871901 0.932947 0.0078243 -0.880619 0.931666 0.00683895 -0.888735 0.930411 0.00587671 -0.896268 0.929192 0.00494319 -0.903254 0.928015 0.00404419 -0.909742 0.926887 0.00318417 -0.915799 0.925813 0.00236527 -0.921508 0.924783 0.00158158 -0.926964 0.92378 0.00081849 -0.932282 0.922784 5.7239e-05 -0.938017 0.922777 5.6928e-05 -0.945234 0.922776 5.7046e-05 -0.95786 0.922776 5.7669e-05 -0.983201 0.922776 5.9145e-05 -1.03289 0.922777 6.0439e-05 -1.12412 0.922777 6.0204e-05 -1.28121 0.922777 5.9387e-05 -1.53767 0.922777 5.9134e-05 -1.93875 0.922777 5.9684e-05 -2.54482 0.922777 6.147e-05 -3.43565 0.922779 6.5918e-05 -4.7159 0.922819 2.9957e-05 -0.636524 0.945236 -0.0182186 -0.62478 0.944485 -0.0176821 -0.613616 0.943651 -0.0170717 -0.603088 0.942742 -0.0163932 -0.593243 0.941766 -0.0156521 -0.584119 0.940733 -0.0148562 -0.575746 0.939659 -0.014017 -0.568146 0.938563 -0.0131508 -0.561329 0.937468 -0.0122769 -0.555291 0.936396 -0.0114143 -0.549956 0.935241 -0.0104751 -0.545212 0.933781 -0.00927142 -0.541034 0.931933 -0.0077303 -0.537469 0.929802 -0.00593596 -0.534534 0.927536 -0.0040078 -0.532221 0.925211 -0.00200436 -0.530615 0.922895 0 -0.532221 0.925211 0.00200436 -0.534534 0.927536 0.0040078 -0.537469 0.929802 0.00593596 -0.541034 0.931933 0.00773031 -0.545212 0.933781 0.00927142 -0.549956 0.935241 0.0104751 -0.555291 0.936396 0.0114143 -0.561329 0.937468 0.0122769 -0.568146 0.938563 0.0131508 -0.575746 0.939659 0.014017 -0.584119 0.940733 0.0148562 -0.593243 0.941766 0.0156521 -0.603088 0.942742 0.0163932 -0.613616 0.943651 0.0170717 -0.62478 0.944485 0.0176821 -0.636524 0.945236 0.0182186 -0.648786 0.945893 0.0186732 -0.661495 0.946438 0.019034 -0.67457 0.94685 0.0192858 -0.687928 0.947102 0.0194104 -0.701483 0.947172 0.0193908 -0.715147 0.947037 0.019213 -0.728838 0.946686 0.0188704 -0.742476 0.946119 0.0183653 -0.755991 0.94535 0.0177099 -0.769316 0.944405 0.0169247 -0.782393 0.943315 0.0160362 -0.795164 0.942119 0.015073 -0.807578 0.940852 0.0140623 -0.819581 0.939544 0.0130269 -0.831126 0.938217 0.0119834 -0.842166 0.936886 0.010943 -0.852663 0.935561 0.00991159 -0.862584 0.934245 0.00889273 -0.871908 0.932944 0.00788887 -0.880625 0.931663 0.00690348 -0.888742 0.930409 0.00594117 -0.896276 0.929189 0.0050076 -0.903261 0.928013 0.00410859 -0.90975 0.926885 0.00324862 -0.915807 0.92581 0.00242986 -0.921516 0.924781 0.00164646 -0.926972 0.923779 0.000883995 -0.932287 0.922792 0.000125782 -0.938018 0.922777 0.000123382 -0.945237 0.922774 0.000123238 -0.957865 0.922773 0.000124199 -0.983206 0.922773 0.000126901 -1.0329 0.922774 0.000129237 -1.12413 0.922774 0.000128446 -1.28122 0.922774 0.000126541 -1.53768 0.922773 0.000125913 -1.93877 0.922773 0.000126992 -2.54484 0.922774 0.000130564 -3.43567 0.922776 0.000139388 -4.7159 0.92286 5.9454e-05 -0.63652 0.945236 -0.0183235 -0.624774 0.944484 -0.0177859 -0.61361 0.94365 -0.0171743 -0.603082 0.942741 -0.0164944 -0.593235 0.941765 -0.0157517 -0.58411 0.940732 -0.014954 -0.575736 0.939658 -0.0141127 -0.568135 0.938563 -0.0132441 -0.561317 0.937468 -0.0123673 -0.555278 0.936396 -0.0115007 -0.549941 0.935242 -0.0105561 -0.545189 0.933785 -0.00934603 -0.541002 0.931944 -0.00779659 -0.537427 0.929823 -0.00598973 -0.534483 0.927567 -0.00404203 -0.532169 0.925255 -0.00200866 -0.530628 0.923 1e-09 -0.532169 0.925255 0.00200867 -0.534483 0.927567 0.00404204 -0.537427 0.929823 0.00598973 -0.541002 0.931944 0.0077966 -0.545189 0.933785 0.00934604 -0.549941 0.935242 0.0105561 -0.555278 0.936396 0.0115008 -0.561317 0.937468 0.0123674 -0.568135 0.938563 0.0132441 -0.575736 0.939658 0.0141127 -0.58411 0.940732 0.014954 -0.593235 0.941765 0.0157517 -0.603082 0.942741 0.0164944 -0.61361 0.94365 0.0171744 -0.624774 0.944484 0.0177859 -0.63652 0.945236 0.0183235 -0.648783 0.945892 0.0187789 -0.661492 0.946437 0.0191405 -0.674568 0.946848 0.0193929 -0.687928 0.947101 0.0195182 -0.701483 0.94717 0.0194991 -0.715148 0.947035 0.019322 -0.72884 0.946684 0.0189799 -0.74248 0.946117 0.0184754 -0.755995 0.945348 0.0178206 -0.769322 0.944402 0.017036 -0.782399 0.943312 0.016148 -0.795172 0.942116 0.0151854 -0.807585 0.940849 0.0141752 -0.819589 0.939541 0.0131402 -0.831135 0.938214 0.0120971 -0.842175 0.936883 0.0110569 -0.852673 0.935557 0.0100258 -0.862594 0.934242 0.00900705 -0.871919 0.932941 0.00800329 -0.880637 0.93166 0.00701797 -0.888754 0.930405 0.00605574 -0.896289 0.929185 0.00512229 -0.903275 0.928008 0.00422348 -0.909764 0.926881 0.00336384 -0.915822 0.925807 0.00254557 -0.921531 0.924778 0.00176295 -0.926987 0.923778 0.00100206 -0.932297 0.922806 0.000251258 -0.93802 0.922777 0.000243113 -0.945243 0.922771 0.000241958 -0.957874 0.922768 0.000243007 -0.983217 0.922768 0.000247306 -1.03291 0.92277 0.00025111 -1.12414 0.92277 0.000249195 -1.28124 0.922769 0.00024526 -1.53771 0.922767 0.000243865 -1.9388 0.922766 0.000245758 -2.54487 0.922768 0.000252198 -3.4357 0.922772 0.000267949 -4.7159 0.92293 0.000106535 -0.636512 0.945235 -0.018503 -0.624765 0.944483 -0.0179633 -0.6136 0.943649 -0.0173493 -0.60307 0.94274 -0.0166665 -0.593222 0.941764 -0.0159204 -0.584095 0.940732 -0.0151189 -0.57572 0.939658 -0.0142733 -0.568117 0.938563 -0.0133997 -0.561298 0.937469 -0.0125171 -0.555257 0.936398 -0.0116424 -0.549914 0.935243 -0.0106869 -0.545153 0.933792 -0.00946476 -0.540951 0.931963 -0.00790071 -0.53736 0.929855 -0.0060732 -0.534403 0.927615 -0.00409463 -0.532092 0.925325 -0.00201589 -0.530647 0.923178 2e-09 -0.532092 0.925325 0.0020159 -0.534403 0.927615 0.00409464 -0.53736 0.929855 0.00607322 -0.540951 0.931963 0.00790072 -0.545153 0.933792 0.00946477 -0.549914 0.935243 0.010687 -0.555257 0.936398 0.0116424 -0.561298 0.937469 0.0125171 -0.568117 0.938563 0.0133998 -0.57572 0.939658 0.0142733 -0.584095 0.940732 0.0151189 -0.593222 0.941764 0.0159205 -0.60307 0.94274 0.0166665 -0.6136 0.943649 0.0173493 -0.624765 0.944483 0.0179633 -0.636512 0.945235 0.018503 -0.648776 0.945891 0.0189603 -0.661487 0.946436 0.0193235 -0.674565 0.946847 0.0195773 -0.687926 0.947099 0.0197039 -0.701483 0.947168 0.019686 -0.715151 0.947032 0.0195101 -0.728844 0.94668 0.0191693 -0.742486 0.946113 0.0186661 -0.756003 0.945344 0.0180126 -0.769332 0.944398 0.0172293 -0.782411 0.943308 0.0163427 -0.795184 0.942112 0.0153813 -0.807599 0.940844 0.0143723 -0.819604 0.939536 0.0133383 -0.83115 0.938209 0.0122961 -0.842192 0.936878 0.0112567 -0.85269 0.935552 0.0102262 -0.862613 0.934236 0.00920799 -0.871938 0.932935 0.00820469 -0.880658 0.931653 0.0072198 -0.888776 0.930399 0.00625804 -0.896311 0.929178 0.00532517 -0.903299 0.928002 0.00442709 -0.909789 0.926875 0.00356844 -0.915848 0.9258 0.00275146 -0.921558 0.924773 0.00197074 -0.927014 0.923777 0.00121344 -0.932315 0.92283 0.000478435 -0.938024 0.922778 0.000457378 -0.945254 0.922766 0.000453468 -0.957889 0.92276 0.000453743 -0.983235 0.92276 0.000459825 -1.03293 0.922763 0.000465611 -1.12417 0.922763 0.000461601 -1.28127 0.92276 0.000453978 -1.53775 0.922757 0.000451067 -1.93884 0.922755 0.000454177 -2.54493 0.922757 0.000465165 -3.43575 0.922766 0.000491729 -4.7159 0.923049 0.000182002 -0.636498 0.945234 -0.018808 -0.624749 0.944483 -0.018264 -0.613581 0.943648 -0.017645 -0.603049 0.942739 -0.0169565 -0.593199 0.941763 -0.0162039 -0.584069 0.940731 -0.0153949 -0.575691 0.939658 -0.0145408 -0.568086 0.938564 -0.0136574 -0.561264 0.937473 -0.0127631 -0.55522 0.936401 -0.0118728 -0.54987 0.935246 -0.010897 -0.545092 0.933803 -0.0096527 -0.540868 0.931991 -0.00806338 -0.537254 0.929906 -0.00620212 -0.53428 0.92769 -0.00417506 -0.531977 0.925437 -0.00202843 -0.530669 0.923468 3e-09 -0.531977 0.925437 0.00202844 -0.53428 0.92769 0.00417508 -0.537254 0.929906 0.00620214 -0.540868 0.931991 0.0080634 -0.545092 0.933803 0.00965272 -0.54987 0.935246 0.010897 -0.55522 0.936401 0.0118728 -0.561264 0.937472 0.0127632 -0.568086 0.938564 0.0136574 -0.575691 0.939658 0.0145408 -0.584069 0.940731 0.0153949 -0.593199 0.941763 0.016204 -0.603049 0.942739 0.0169565 -0.613581 0.943648 0.017645 -0.624749 0.944483 0.0182641 -0.636498 0.945234 0.018808 -0.648765 0.94589 0.019269 -0.661478 0.946435 0.0196353 -0.674558 0.946845 0.0198919 -0.687922 0.947097 0.0200211 -0.701483 0.947165 0.0200058 -0.715153 0.947029 0.0198323 -0.728851 0.946676 0.0194941 -0.742496 0.946108 0.0189935 -0.756017 0.945338 0.0183428 -0.769348 0.944391 0.0175623 -0.78243 0.943301 0.0166785 -0.795206 0.942105 0.0157199 -0.807623 0.940837 0.0147134 -0.819629 0.939529 0.0136818 -0.831177 0.938201 0.0126417 -0.84222 0.93687 0.011604 -0.85272 0.935543 0.010575 -0.862644 0.934227 0.00955823 -0.871972 0.932925 0.00855622 -0.880693 0.931643 0.00757263 -0.888813 0.930388 0.00661229 -0.896351 0.929168 0.00568104 -0.90334 0.927991 0.00478493 -0.909832 0.926864 0.00392871 -0.915893 0.92579 0.00311477 -0.921604 0.924765 0.00233827 -0.927062 0.923776 0.00158866 -0.932349 0.922869 0.000883445 -0.938036 0.92278 0.000837462 -0.945277 0.922757 0.000827039 -0.957919 0.922747 0.00082432 -0.983268 0.922747 0.000831629 -1.03297 0.922751 0.000839765 -1.12421 0.922751 0.000831972 -1.28133 0.922746 0.000817813 -1.53781 0.922739 0.000811993 -1.93893 0.922736 0.000816867 -2.54502 0.92274 0.000834947 -3.43585 0.922756 0.000878068 -4.7159 0.923251 0.000303617 -0.636473 0.945236 -0.0193208 -0.624721 0.944485 -0.0187687 -0.613549 0.94365 -0.0181401 -0.603013 0.942741 -0.0174407 -0.593158 0.941765 -0.0166756 -0.584024 0.940733 -0.0158523 -0.575641 0.939661 -0.014982 -0.568031 0.938569 -0.01408 -0.561206 0.93748 -0.0131638 -0.555156 0.936408 -0.0122443 -0.549793 0.935255 -0.0112316 -0.544991 0.933824 -0.0099483 -0.540734 0.932037 -0.00831602 -0.537086 0.929985 -0.00639997 -0.534089 0.927807 -0.00429736 -0.531805 0.925618 -0.00205104 -0.530677 0.923916 6e-09 -0.531805 0.925618 0.00205106 -0.534089 0.927807 0.00429739 -0.537086 0.929985 0.00640001 -0.540734 0.932037 0.00831605 -0.544991 0.933824 0.00994834 -0.549793 0.935255 0.0112317 -0.555156 0.936408 0.0122443 -0.561206 0.93748 0.0131638 -0.568031 0.938569 0.01408 -0.575641 0.939661 0.014982 -0.584024 0.940733 0.0158523 -0.593158 0.941765 0.0166756 -0.603013 0.942741 0.0174407 -0.613549 0.94365 0.0181402 -0.624721 0.944485 0.0187687 -0.636473 0.945236 0.0193209 -0.648744 0.945892 0.0197889 -0.661461 0.946435 0.0201614 -0.674546 0.946845 0.0204235 -0.687914 0.947096 0.0205578 -0.701481 0.947162 0.0205473 -0.715157 0.947025 0.0203787 -0.72886 0.946671 0.0200455 -0.742511 0.946101 0.0195503 -0.756038 0.94533 0.0189051 -0.769375 0.944383 0.0181303 -0.782461 0.943292 0.0172522 -0.795241 0.942096 0.0162991 -0.807661 0.940828 0.0152979 -0.819671 0.939519 0.0142711 -0.831221 0.938191 0.0132353 -0.842268 0.936859 0.0122015 -0.85277 0.935532 0.011176 -0.862698 0.934215 0.0101625 -0.872028 0.932912 0.00916358 -0.880754 0.931629 0.00818319 -0.888877 0.930372 0.0072263 -0.896419 0.929151 0.00629897 -0.903412 0.927974 0.00540741 -0.909907 0.926848 0.00455662 -0.915971 0.925776 0.00374923 -0.921686 0.924754 0.00298156 -0.927144 0.923778 0.00224756 -0.93241 0.922927 0.00159124 -0.938066 0.922787 0.0015043 -0.945325 0.922746 0.00147988 -0.957978 0.922727 0.00146916 -0.98333 0.922727 0.00147516 -1.03303 0.922734 0.00148516 -1.12429 0.922733 0.00147062 -1.28142 0.922723 0.00144514 -1.53793 0.922712 0.00143391 -1.93907 0.922706 0.00144123 -2.54519 0.922714 0.00147014 -3.43601 0.922741 0.00153801 -4.7159 0.92359 0.000500582 -0.636427 0.945244 -0.020173 -0.624668 0.944493 -0.0196056 -0.61349 0.943658 -0.0189593 -0.602947 0.942749 -0.0182395 -0.593086 0.941773 -0.0174512 -0.583944 0.940742 -0.0166016 -0.575553 0.939672 -0.0157014 -0.567935 0.938582 -0.0147651 -0.561102 0.937496 -0.0138087 -0.555042 0.936426 -0.0128372 -0.549657 0.935274 -0.0117606 -0.544818 0.933861 -0.0104101 -0.540513 0.932112 -0.00870579 -0.536817 0.930107 -0.00670158 -0.533791 0.927989 -0.0044825 -0.531549 0.925911 -0.00209318 -0.530628 0.924547 1e-08 -0.531549 0.925911 0.00209321 -0.533791 0.927989 0.00448255 -0.536817 0.930107 0.00670164 -0.540513 0.932111 0.00870586 -0.544818 0.933861 0.0104102 -0.549657 0.935274 0.0117607 -0.555042 0.936425 0.0128373 -0.561102 0.937496 0.0138088 -0.567935 0.938582 0.0147652 -0.575553 0.939672 0.0157015 -0.583944 0.940742 0.0166017 -0.593086 0.941773 0.0174513 -0.602947 0.942749 0.0182396 -0.613491 0.943658 0.0189595 -0.624668 0.944493 0.0196057 -0.636427 0.945244 0.0201732 -0.648704 0.9459 0.0206544 -0.661428 0.946442 0.0210385 -0.674521 0.946851 0.0213109 -0.687898 0.9471 0.0214547 -0.701474 0.947164 0.0214534 -0.71516 0.947024 0.0212941 -0.728873 0.946668 0.0209707 -0.742535 0.946097 0.0204856 -0.756071 0.945324 0.019851 -0.769417 0.944375 0.0190873 -0.782511 0.943284 0.0182203 -0.795298 0.942086 0.0172781 -0.807724 0.940818 0.0162872 -0.819739 0.939508 0.01527 -0.831294 0.938179 0.0142431 -0.842345 0.936846 0.0132173 -0.852853 0.935518 0.0121992 -0.862786 0.934199 0.0111925 -0.872123 0.932895 0.0102006 -0.880854 0.93161 0.00922729 -0.888984 0.930352 0.00827809 -0.896532 0.92913 0.00735931 -0.903532 0.927953 0.00647746 -0.910034 0.926828 0.0056379 -0.916105 0.925759 0.00484377 -0.921826 0.924744 0.00409361 -0.927285 0.923791 0.00338919 -0.932525 0.923008 0.00280021 -0.938143 0.922806 0.00265812 -0.945431 0.922735 0.00260634 -0.958097 0.9227 0.00257744 -0.983449 0.9227 0.00257513 -1.03316 0.922712 0.00258395 -1.12443 0.92271 0.00255737 -1.28159 0.922692 0.00251275 -1.53814 0.922673 0.0024918 -1.93932 0.922662 0.00250229 -2.54547 0.922675 0.00254732 -3.43628 0.922722 0.00265109 -4.7159 0.924159 0.000820912 -0.636341 0.945272 -0.0215702 -0.624572 0.944521 -0.020975 -0.613382 0.943686 -0.0202968 -0.602827 0.942775 -0.0195402 -0.592953 0.9418 -0.0187102 -0.583799 0.94077 -0.0178132 -0.575394 0.939702 -0.0168595 -0.567762 0.938616 -0.0158621 -0.560913 0.937535 -0.0148341 -0.554834 0.936466 -0.0137728 -0.549413 0.935318 -0.0125891 -0.544519 0.933931 -0.0111264 -0.540145 0.932233 -0.00930317 -0.536382 0.930298 -0.00715837 -0.533323 0.928272 -0.00476211 -0.531153 0.926368 -0.00217278 -0.530429 0.925362 1.9e-08 -0.531153 0.926368 0.00217284 -0.533323 0.928272 0.0047622 -0.536382 0.930298 0.00715847 -0.540145 0.932233 0.00930329 -0.544519 0.933931 0.0111265 -0.549413 0.935318 0.0125892 -0.554834 0.936465 0.0137729 -0.560913 0.937535 0.0148342 -0.567762 0.938616 0.0158623 -0.575394 0.939701 0.0168597 -0.583799 0.94077 0.0178134 -0.592954 0.9418 0.0187104 -0.602827 0.942775 0.0195405 -0.613382 0.943685 0.020297 -0.624572 0.944521 0.0209753 -0.636341 0.945272 0.0215705 -0.648629 0.945927 0.0220759 -0.661365 0.946468 0.022481 -0.674471 0.946875 0.0227723 -0.687863 0.947121 0.0229336 -0.701453 0.947182 0.0229494 -0.715156 0.947039 0.0228074 -0.728886 0.94668 0.022502 -0.742564 0.946105 0.0220359 -0.756117 0.94533 0.0214213 -0.769478 0.944379 0.0206781 -0.782585 0.943286 0.0198319 -0.795384 0.942087 0.0189102 -0.807821 0.940818 0.0179391 -0.819845 0.939507 0.0169403 -0.831409 0.938177 0.0159305 -0.842469 0.936842 0.0149206 -0.852985 0.935512 0.0139173 -0.862928 0.934191 0.0129249 -0.872275 0.932883 0.0119473 -0.881018 0.931596 0.0109888 -0.88916 0.930336 0.0100555 -0.89672 0.929113 0.00915417 -0.903733 0.927936 0.00829167 -0.910248 0.926813 0.00747395 -0.916332 0.92575 0.00670516 -0.922065 0.92475 0.00598754 -0.927529 0.923832 0.00533331 -0.932745 0.923116 0.00481945 -0.938335 0.922854 0.00461923 -0.945662 0.922736 0.0045206 -0.958346 0.922675 0.00445505 -0.983687 0.922674 0.00442865 -1.0334 0.922694 0.00442708 -1.12468 0.922689 0.0043789 -1.28188 0.922658 0.00430274 -1.53848 0.922624 0.00426489 -1.93973 0.922607 0.00427915 -2.54594 0.92263 0.00434745 -3.43672 0.922711 0.00450131 -4.7159 0.925111 0.00134356 -0.636175 0.945351 -0.0238267 -0.624386 0.944599 -0.0231824 -0.613177 0.943762 -0.0224479 -0.602601 0.942851 -0.0216271 -0.592705 0.941874 -0.0207239 -0.583527 0.940845 -0.0197443 -0.575098 0.93978 -0.0186971 -0.567439 0.938699 -0.0175933 -0.560561 0.937624 -0.0164415 -0.554443 0.936557 -0.0152305 -0.548964 0.935417 -0.0138738 -0.543989 0.934065 -0.0122289 -0.539518 0.932435 -0.0102126 -0.535667 0.930596 -0.00784618 -0.532573 0.928704 -0.00518496 -0.530501 0.927042 -0.00232026 -0.529928 0.926337 3.7e-08 -0.530501 0.927042 0.00232036 -0.532573 0.928704 0.0051851 -0.535667 0.930596 0.00784636 -0.539518 0.932434 0.0102128 -0.543989 0.934065 0.0122291 -0.548964 0.935417 0.013874 -0.554443 0.936556 0.0152308 -0.560561 0.937624 0.0164418 -0.567439 0.938699 0.0175936 -0.575098 0.939779 0.0186974 -0.583527 0.940845 0.0197447 -0.592705 0.941874 0.0207243 -0.602602 0.942851 0.0216275 -0.613177 0.943762 0.0224484 -0.624386 0.944599 0.0231829 -0.636175 0.945351 0.0238272 -0.648483 0.946006 0.0243753 -0.661239 0.946546 0.0248181 -0.674366 0.94695 0.0251432 -0.687782 0.947193 0.0253362 -0.701398 0.94725 0.0253828 -0.715128 0.947102 0.0252721 -0.728886 0.946738 0.0249992 -0.742592 0.946159 0.0245674 -0.756171 0.945381 0.0239889 -0.769557 0.944427 0.0232831 -0.782688 0.943332 0.0224747 -0.795507 0.942132 0.0215904 -0.807961 0.940861 0.0206553 -0.820002 0.939549 0.0196909 -0.831582 0.938217 0.0187132 -0.842657 0.93688 0.0177334 -0.853189 0.935546 0.0167588 -0.863149 0.934221 0.0157944 -0.872515 0.93291 0.0148449 -0.881278 0.931619 0.0139158 -0.889442 0.930357 0.0130134 -0.897025 0.929133 0.0121454 -0.904063 0.927957 0.0113191 -0.910605 0.92684 0.0105412 -0.916716 0.925788 0.00981734 -0.922474 0.924812 0.00915438 -0.927955 0.923941 0.00857142 -0.933175 0.923274 0.00812521 -0.938775 0.922967 0.00787788 -0.946161 0.922789 0.00771342 -0.958869 0.922688 0.00758298 -0.984171 0.92268 0.007502 -1.03385 0.922713 0.007468 -1.12514 0.922703 0.00738087 -1.28239 0.922651 0.00725415 -1.53907 0.922593 0.00718802 -1.94044 0.922566 0.00720618 -2.54672 0.922605 0.00730677 -3.43746 0.922743 0.00752702 -4.7159 0.926699 0.00219837 -0.635844 0.945562 -0.0274111 -0.62402 0.944806 -0.0266825 -0.612775 0.943964 -0.0258516 -0.602162 0.943048 -0.0249209 -0.592226 0.942068 -0.0238932 -0.583005 0.941037 -0.0227729 -0.574529 0.939973 -0.0215669 -0.56682 0.938897 -0.0202828 -0.559884 0.937826 -0.0189239 -0.553694 0.936762 -0.0174717 -0.548122 0.935635 -0.0158437 -0.543029 0.934326 -0.0139105 -0.538427 0.932779 -0.0115869 -0.534463 0.931063 -0.00887692 -0.531329 0.929346 -0.00582685 -0.529352 0.927955 -0.00258034 -0.528863 0.927452 7.4e-08 -0.529352 0.927955 0.00258053 -0.531329 0.929346 0.0058271 -0.534463 0.931062 0.00887722 -0.538427 0.932779 0.0115873 -0.543029 0.934326 0.0139108 -0.548122 0.935634 0.0158441 -0.553694 0.936761 0.0174721 -0.559884 0.937825 0.0189244 -0.56682 0.938896 0.0202834 -0.574529 0.939973 0.0215674 -0.583005 0.941037 0.0227735 -0.592226 0.942067 0.0238939 -0.602162 0.943048 0.0249217 -0.612776 0.943964 0.0258524 -0.62402 0.944805 0.0266834 -0.635844 0.945561 0.0274121 -0.648187 0.946218 0.0280341 -0.660979 0.946758 0.0285424 -0.674144 0.94716 0.028927 -0.687599 0.9474 0.0291758 -0.701258 0.947452 0.0292769 -0.715032 0.947299 0.0292214 -0.728835 0.946931 0.0290059 -0.742587 0.946348 0.0286346 -0.75621 0.945566 0.0281193 -0.769638 0.944611 0.0274788 -0.782807 0.943515 0.0267368 -0.795661 0.942314 0.0259182 -0.808148 0.941043 0.0250471 -0.820218 0.93973 0.0241438 -0.831826 0.938396 0.0232241 -0.842929 0.937056 0.0222997 -0.853491 0.935718 0.0213784 -0.863483 0.934389 0.0204665 -0.872884 0.933074 0.0195699 -0.881685 0.931779 0.0186952 -0.889891 0.930516 0.0178497 -0.89752 0.929293 0.0170413 -0.904608 0.928122 0.0162778 -0.911204 0.927015 0.0155665 -0.917373 0.925983 0.0149142 -0.923192 0.92504 0.0143293 -0.928732 0.924214 0.013827 -0.934022 0.923575 0.0134334 -0.939708 0.923237 0.0131545 -0.947201 0.923002 0.0129176 -0.959948 0.922848 0.0126903 -0.985164 0.922825 0.0125053 -1.03474 0.922872 0.012394 -1.126 0.922855 0.0122368 -1.28329 0.922766 0.0120315 -1.5401 0.92267 0.01192 -1.94161 0.922627 0.0119412 -2.54802 0.922694 0.0120844 -3.43865 0.922927 0.0123863 -4.7159 0.929347 0.00359888 -0.635173 0.946092 -0.0330027 -0.623285 0.945324 -0.0321324 -0.611972 0.94447 -0.0311404 -0.601288 0.94354 -0.0300268 -0.591276 0.942547 -0.0287921 -0.581974 0.941506 -0.0274384 -0.57341 0.940435 -0.0259694 -0.565603 0.939354 -0.024389 -0.558558 0.93828 -0.0226952 -0.552241 0.937215 -0.0208659 -0.546519 0.936102 -0.0188234 -0.541259 0.93484 -0.0164457 -0.536486 0.93338 -0.0136453 -0.532377 0.931794 -0.0104144 -0.529179 0.930259 -0.00680234 -0.527242 0.929087 -0.00301151 -0.526772 0.928686 1.54e-07 -0.527242 0.929087 0.00301186 -0.529179 0.930258 0.00680279 -0.532377 0.931794 0.0104149 -0.536486 0.93338 0.0136459 -0.54126 0.934839 0.0164463 -0.546519 0.936101 0.0188241 -0.552241 0.937214 0.0208667 -0.558558 0.938279 0.022696 -0.565603 0.939353 0.02439 -0.57341 0.940434 0.0259705 -0.581974 0.941505 0.0274396 -0.591276 0.942546 0.0287934 -0.601288 0.943539 0.0300282 -0.611972 0.944469 0.0311419 -0.623285 0.945323 0.032134 -0.635173 0.946091 0.0330044 -0.647579 0.946757 0.0337517 -0.660436 0.947304 0.0343719 -0.673667 0.94771 0.0348587 -0.68719 0.94795 0.0352038 -0.70092 0.948002 0.0353991 -0.714768 0.947848 0.0354388 -0.728646 0.947478 0.0353219 -0.742472 0.946896 0.0350533 -0.756169 0.946115 0.0346452 -0.769666 0.945162 0.0341152 -0.7829 0.94407 0.033485 -0.795816 0.942874 0.0327777 -0.80836 0.941607 0.0320153 -0.820484 0.940297 0.031217 -0.832146 0.938964 0.0303984 -0.843305 0.937624 0.0295711 -0.853925 0.936286 0.0287444 -0.863979 0.934955 0.027926 -0.873448 0.933639 0.0271231 -0.882325 0.932345 0.0263433 -0.890615 0.931084 0.0255944 -0.898338 0.929869 0.0248842 -0.90553 0.928711 0.02422 -0.91224 0.927623 0.0236078 -0.918535 0.926616 0.0230528 -0.924492 0.925705 0.0225597 -0.930186 0.924908 0.0221328 -0.935659 0.924278 0.0217783 -0.941552 0.923921 0.0214782 -0.94925 0.923647 0.0211751 -0.962095 0.923442 0.0208291 -0.987173 0.923391 0.0204774 -1.03652 0.923447 0.0202117 -1.12764 0.923415 0.0199311 -1.28493 0.923267 0.0196082 -1.54187 0.923111 0.0194281 -1.94359 0.923044 0.0194497 -2.55014 0.923159 0.0196453 -3.44056 0.923545 0.0200354 -4.7159 0.933756 0.0058963 -0.633795 0.947376 -0.0415522 -0.621782 0.946574 -0.0404487 -0.61034 0.945682 -0.0391933 -0.599519 0.944714 -0.0377822 -0.589361 0.943683 -0.0362119 -0.579902 0.942606 -0.0344808 -0.57117 0.941501 -0.0325889 -0.563181 0.94039 -0.0305367 -0.555937 0.939288 -0.0283201 -0.549403 0.938202 -0.0259177 -0.543452 0.937086 -0.0232542 -0.537957 0.935847 -0.0202083 -0.532956 0.934445 -0.0166903 -0.528652 0.932946 -0.0126907 -0.525327 0.931516 -0.0082728 -0.523325 0.930431 -0.00368813 -0.522815 0.93004 3.23e-07 -0.523325 0.930431 0.00368884 -0.525326 0.931516 0.00827364 -0.528652 0.932945 0.0126917 -0.532956 0.934444 0.0166914 -0.537957 0.935846 0.0202095 -0.543452 0.937084 0.0232555 -0.549403 0.938201 0.0259191 -0.555937 0.939287 0.0283216 -0.563181 0.940388 0.0305385 -0.57117 0.9415 0.0325908 -0.579902 0.942604 0.0344828 -0.589361 0.943681 0.0362142 -0.599519 0.944712 0.0377847 -0.61034 0.94568 0.039196 -0.621782 0.946572 0.0404515 -0.633795 0.947374 0.0415553 -0.646322 0.948071 0.0425103 -0.659298 0.948643 0.0433178 -0.672648 0.94907 0.0439769 -0.686292 0.949328 0.044485 -0.700145 0.949395 0.0448394 -0.714117 0.949255 0.0450387 -0.72812 0.9489 0.0450853 -0.74207 0.948333 0.044986 -0.755889 0.94757 0.0447526 -0.769505 0.946637 0.0444016 -0.782855 0.945565 0.0439522 -0.79588 0.94439 0.043425 -0.808531 0.943142 0.0428396 -0.820761 0.94185 0.0422136 -0.83253 0.940533 0.0415618 -0.843799 0.939206 0.0408965 -0.854537 0.93788 0.040228 -0.864719 0.936561 0.0395651 -0.874329 0.935257 0.0389161 -0.883362 0.933978 0.0382886 -0.891825 0.932735 0.0376895 -0.899741 0.931539 0.037125 -0.907146 0.930404 0.0365994 -0.914092 0.929341 0.0361157 -0.920646 0.92836 0.0356744 -0.926887 0.927469 0.0352747 -0.932895 0.926685 0.0349138 -0.938716 0.926055 0.0345887 -0.944978 0.92569 0.0342678 -0.953045 0.925399 0.0339029 -0.966134 0.925163 0.0334303 -0.99109 0.925075 0.0328563 -1.04002 0.925118 0.0323314 -1.13079 0.92505 0.0318446 -1.28795 0.924807 0.0313545 -1.54499 0.924554 0.031078 -1.94694 0.924455 0.0310958 -2.55361 0.924649 0.031349 -3.4436 0.925277 0.0318101 -4.7159 0.941097 0.00966831 -0.630955 0.950356 -0.0543314 -0.618698 0.949464 -0.0528505 -0.607001 0.948477 -0.0511723 -0.595912 0.947409 -0.0492865 -0.585471 0.946276 -0.0471841 -0.575714 0.945097 -0.0448591 -0.566667 0.94389 -0.0423085 -0.558349 0.942678 -0.0395317 -0.550762 0.94148 -0.0365264 -0.543877 0.940307 -0.0332749 -0.537578 0.939117 -0.0297011 -0.531748 0.937819 -0.0256787 -0.52643 0.936367 -0.0211168 -0.521841 0.934816 -0.0160127 -0.518274 0.933317 -0.0104461 -0.516078 0.93213 -0.00470622 -0.51547 0.931659 6.83e-07 -0.516078 0.932129 0.00470766 -0.518273 0.933316 0.0104477 -0.52184 0.934815 0.0160146 -0.52643 0.936365 0.0211188 -0.531748 0.937818 0.0256809 -0.537578 0.939115 0.0297034 -0.543877 0.940305 0.0332775 -0.550762 0.941478 0.0365292 -0.558349 0.942675 0.0395348 -0.566667 0.943887 0.0423119 -0.575714 0.945094 0.0448628 -0.585471 0.946274 0.0471882 -0.595911 0.947406 0.0492909 -0.607001 0.948474 0.0511771 -0.618698 0.949461 0.0528556 -0.630955 0.950353 0.0543369 -0.643716 0.951132 0.0556309 -0.656919 0.95178 0.0567464 -0.670492 0.952275 0.0576904 -0.684356 0.952596 0.058468 -0.698427 0.952723 0.0590839 -0.712617 0.95264 0.059543 -0.726838 0.952344 0.059852 -0.741005 0.951837 0.0600201 -0.755038 0.951137 0.0600597 -0.768865 0.950268 0.0599856 -0.782422 0.949261 0.0598145 -0.795654 0.94815 0.0595639 -0.808512 0.946965 0.0592507 -0.820952 0.945732 0.0588905 -0.832937 0.944471 0.0584973 -0.844434 0.943197 0.058083 -0.855415 0.941921 0.0576583 -0.865861 0.940651 0.0572321 -0.875759 0.939395 0.0568121 -0.885108 0.938164 0.0564042 -0.893919 0.936967 0.0560129 -0.902215 0.935815 0.0556406 -0.910034 0.93472 0.0552879 -0.917427 0.93369 0.0549533 -0.924462 0.932733 0.0546339 -0.931213 0.931859 0.0543256 -0.937762 0.93108 0.054023 -0.944152 0.930449 0.0537176 -0.951007 0.930085 0.0533647 -0.95968 0.929793 0.0529272 -0.973275 0.929547 0.052318 -0.998293 0.929415 0.0514903 -1.04667 0.929397 0.0506075 -1.13674 0.929245 0.0498109 -1.2935 0.92885 0.0491011 -1.55048 0.928449 0.0487041 -1.95259 0.928305 0.0487135 -2.55927 0.928626 0.0490171 -3.44839 0.929621 0.0494804 -4.7159 0.95331 0.0158652 -0.6251 0.956965 -0.072928 -0.612367 0.955859 -0.0708431 -0.600174 0.954645 -0.0684946 -0.588568 0.95334 -0.0658644 -0.577592 0.951962 -0.062938 -0.567284 0.950529 -0.0597056 -0.557675 0.949064 -0.0561641 -0.548788 0.947591 -0.0523152 -0.540635 0.946135 -0.0481615 -0.5332 0.94471 -0.0436896 -0.526377 0.943273 -0.03882 -0.520053 0.941723 -0.0334177 -0.514273 0.939997 -0.0273897 -0.509251 0.938143 -0.0207417 -0.50529 0.936315 -0.0135656 -0.502767 0.934808 -0.00618461 -0.502004 0.934168 1.44e-06 -0.502767 0.934807 0.00618758 -0.50529 0.936314 0.0135688 -0.50925 0.938141 0.0207452 -0.514272 0.939995 0.0273935 -0.520052 0.94172 0.0334218 -0.526375 0.94327 0.0388245 -0.533198 0.944707 0.0436944 -0.540634 0.946131 0.0481667 -0.548786 0.947587 0.0523209 -0.557673 0.94906 0.0561703 -0.567283 0.950524 0.0597124 -0.577591 0.951957 0.0629453 -0.588567 0.953335 0.0658724 -0.600173 0.95464 0.0685032 -0.612366 0.955854 0.0708523 -0.6251 0.95696 0.0729379 -0.638319 0.957941 0.074779 -0.651963 0.958778 0.0763944 -0.665963 0.959451 0.0778015 -0.680243 0.959941 0.0790156 -0.694721 0.960231 0.0800505 -0.709313 0.960309 0.0809193 -0.72393 0.960173 0.0816342 -0.738491 0.959828 0.0822081 -0.752915 0.959292 0.0826541 -0.767134 0.958589 0.0829862 -0.781084 0.957749 0.0832189 -0.794713 0.956801 0.0833664 -0.807975 0.955775 0.0834429 -0.820832 0.954696 0.0834614 -0.833251 0.953583 0.0834342 -0.845205 0.952451 0.0833722 -0.856673 0.95131 0.0832844 -0.867641 0.950169 0.0831785 -0.878099 0.949035 0.0830601 -0.88805 0.947916 0.0829323 -0.897506 0.94682 0.0827963 -0.90649 0.945756 0.082651 -0.915038 0.944732 0.0824937 -0.923197 0.943757 0.0823205 -0.931029 0.942839 0.0821267 -0.938608 0.941986 0.0819072 -0.94601 0.941216 0.0816553 -0.953274 0.940584 0.0813579 -0.961028 0.940222 0.0809525 -0.970644 0.93993 0.0804196 -0.985149 0.93967 0.0796555 -1.01067 0.939476 0.0785682 -1.05863 0.939327 0.0772882 -1.14769 0.93901 0.0761011 -1.30357 0.938391 0.0751376 -1.56016 0.937777 0.0746162 -1.96215 0.937576 0.0746168 -2.56846 0.938091 0.0749401 -3.45582 0.93962 0.0752379 -4.7159 0.973628 0.0260502 -0.613058 0.970898 -0.0990857 -0.599418 0.969322 -0.0960437 -0.586294 0.967615 -0.0926481 -0.573738 0.965795 -0.0888756 -0.561802 0.963882 -0.084709 -0.550531 0.961897 -0.0801399 -0.539969 0.959867 -0.0751678 -0.53015 0.957822 -0.0697995 -0.521102 0.955793 -0.0640427 -0.51282 0.953802 -0.057887 -0.505211 0.951802 -0.0512458 -0.49816 0.949671 -0.043971 -0.491706 0.947334 -0.0359642 -0.486061 0.944845 -0.0272338 -0.481541 0.942387 -0.0178773 -0.478565 0.940336 -0.00825253 -0.477592 0.939434 2.98e-06 -0.478565 0.940335 0.0082586 -0.48154 0.942386 0.0178838 -0.48606 0.944843 0.0272407 -0.491704 0.947331 0.0359716 -0.498158 0.949667 0.0439789 -0.505208 0.951798 0.0512542 -0.512818 0.953797 0.0578961 -0.521099 0.955788 0.0640525 -0.530147 0.957816 0.0698101 -0.539965 0.95986 0.0751793 -0.550528 0.96189 0.0801523 -0.561799 0.963874 0.0847226 -0.573735 0.965787 0.0888903 -0.586291 0.967607 0.092664 -0.599415 0.969313 0.0960609 -0.613056 0.970889 0.0991042 -0.627154 0.972316 0.101821 -0.64165 0.973578 0.104241 -0.656475 0.974656 0.106393 -0.671556 0.975536 0.108303 -0.686814 0.976203 0.109997 -0.702169 0.976652 0.111495 -0.717539 0.976882 0.112819 -0.732844 0.976902 0.113985 -0.748011 0.976729 0.115009 -0.762974 0.976386 0.115905 -0.777674 0.975902 0.116687 -0.792065 0.975303 0.117366 -0.806106 0.974615 0.117954 -0.819765 0.973863 0.118461 -0.833015 0.973061 0.118899 -0.845837 0.972225 0.119275 -0.858213 0.971361 0.119597 -0.870134 0.970478 0.119872 -0.881594 0.969581 0.120102 -0.892595 0.968674 0.120289 -0.903149 0.967763 0.120432 -0.913275 0.966855 0.12053 -0.923004 0.965956 0.120578 -0.932379 0.965076 0.120571 -0.941457 0.964222 0.120506 -0.950309 0.963408 0.120376 -0.959006 0.962652 0.120174 -0.967583 0.962017 0.119882 -0.976687 0.961648 0.119412 -0.987745 0.961336 0.118773 -1.00376 0.961035 0.117853 -1.03053 0.960742 0.116539 -1.07877 0.960406 0.11492 -1.16685 0.959853 0.113355 -1.32138 0.958966 0.112156 -1.57695 0.958099 0.111547 -1.97822 0.957843 0.111549 -2.58329 0.95864 0.111824 -3.46727 0.960913 0.111615 -4.7159 1.00742 0.0427953 -0.588503 0.998627 -0.134268 -0.57324 0.996112 -0.129755 -0.558488 0.99343 -0.124783 -0.544312 0.990605 -0.119332 -0.530778 0.98766 -0.113389 -0.517949 0.984626 -0.106951 -0.505883 0.981537 -0.100021 -0.494631 0.978435 -0.0926111 -0.484236 0.975364 -0.084729 -0.474709 0.972356 -0.0763617 -0.465963 0.969362 -0.067411 -0.457884 0.966239 -0.0577124 -0.450504 0.962903 -0.0471556 -0.444038 0.959429 -0.0357424 -0.438812 0.956053 -0.0235669 -0.435291 0.953253 -0.0110182 -0.434069 0.952 5.913e-06 -0.435291 0.953252 0.0110301 -0.43881 0.956051 0.0235793 -0.444035 0.959426 0.0357555 -0.4505 0.962899 0.0471695 -0.457879 0.966235 0.0577272 -0.465958 0.969356 0.0674269 -0.474704 0.97235 0.0763788 -0.48423 0.975356 0.0847474 -0.494625 0.978426 0.0926312 -0.505876 0.981527 0.100043 -0.517943 0.984615 0.106975 -0.530772 0.987649 0.113415 -0.544306 0.990592 0.11936 -0.558482 0.993417 0.124813 -0.573235 0.996097 0.129787 -0.588499 0.998611 0.134303 -0.604204 1.00094 0.13839 -0.62028 1.00307 0.14208 -0.636655 1.00498 0.14541 -0.653254 1.00666 0.148415 -0.67 1.0081 0.15113 -0.686815 1.0093 0.153585 -0.703623 1.01025 0.155808 -0.72035 1.01099 0.157823 -0.736929 1.01151 0.15965 -0.753302 1.01184 0.161304 -0.769419 1.01202 0.162802 -0.785237 1.01205 0.164155 -0.800726 1.01197 0.165375 -0.815858 1.01179 0.166472 -0.830615 1.01153 0.167457 -0.844981 1.01119 0.168337 -0.858944 1.0108 0.169122 -0.872497 1.01034 0.169817 -0.885637 1.00982 0.170426 -0.898365 1.00926 0.170954 -0.91069 1.00864 0.171399 -0.922628 1.00797 0.17176 -0.934207 1.00727 0.172035 -0.945466 1.00655 0.17222 -0.956459 1.0058 0.172312 -0.967256 1.00506 0.172303 -0.97793 1.00434 0.172186 -0.988509 1.00371 0.171931 -0.999678 1.00334 0.171427 -1.01297 1.003 0.170715 -1.03144 1.00265 0.169698 -1.06066 1.00226 0.168261 -1.11055 1.00177 0.166472 -1.19861 1.00103 0.164689 -1.35172 0.999961 0.163359 -1.60553 0.998922 0.162746 -2.00497 0.998674 0.162771 -2.60717 0.999867 0.162875 -3.48482 1.00315 0.161513 -4.7159 1.06362 0.0703322 -0.53985 1.05056 -0.179369 -0.521929 1.04637 -0.172753 -0.504573 1.04199 -0.165581 -0.487868 1.03744 -0.157839 -0.471898 1.03277 -0.149522 -0.456742 1.02802 -0.14063 -0.442475 1.02324 -0.131171 -0.429164 1.01848 -0.121151 -0.416865 1.01381 -0.110576 -0.405604 1.00928 -0.0994216 -0.395301 1.00483 -0.0875751 -0.385844 1.0003 -0.0748554 -0.377267 0.995594 -0.0611368 -0.36979 0.990826 -0.0464045 -0.36375 0.986289 -0.0307397 -0.35964 0.982574 -0.0145537 -0.358157 0.980894 1.0984e-05 -0.359639 0.982573 0.0145759 -0.363747 0.986287 0.0307625 -0.369785 0.990823 0.0464284 -0.377261 0.99559 0.0611621 -0.385837 1.00029 0.0748825 -0.395293 1.00482 0.0876042 -0.405595 1.00927 0.0994532 -0.416856 1.0138 0.11061 -0.429154 1.01847 0.121189 -0.442464 1.02323 0.131211 -0.456731 1.02801 0.140675 -0.471888 1.03276 0.14957 -0.487859 1.03743 0.157892 -0.504564 1.04197 0.165638 -0.521921 1.04635 0.172816 -0.539844 1.05054 0.179437 -0.558244 1.0545 0.185522 -0.577036 1.05821 0.191101 -0.59613 1.06165 0.196204 -0.615441 1.06481 0.200868 -0.634882 1.06767 0.205129 -0.654371 1.07024 0.209022 -0.67383 1.07251 0.212579 -0.693187 1.0745 0.21583 -0.712379 1.07623 0.2188 -0.731351 1.07771 0.221511 -0.75006 1.07898 0.223984 -0.768472 1.08004 0.226234 -0.786561 1.08093 0.228279 -0.804308 1.08166 0.230133 -0.8217 1.08225 0.23181 -0.838727 1.0827 0.233323 -0.855382 1.08302 0.234685 -0.871663 1.08321 0.235906 -0.887568 1.08328 0.236995 -0.903101 1.08324 0.237959 -0.918271 1.08307 0.238802 -0.933095 1.08281 0.239525 -0.947599 1.08244 0.240128 -0.961824 1.08199 0.240609 -0.975826 1.08146 0.240964 -0.989678 1.08089 0.241188 -1.00346 1.08029 0.241267 -1.0172 1.07975 0.24116 -1.03164 1.07945 0.240723 -1.04849 1.07917 0.240055 -1.07096 1.07887 0.239086 -1.10453 1.07853 0.237734 -1.15844 1.07809 0.236064 -1.24883 1.07744 0.234384 -1.40173 1.07653 0.233152 -1.65341 1.07566 0.232666 -2.04939 1.07565 0.232734 -2.64579 1.07743 0.232462 -3.51191 1.08219 0.22873 -4.7159 1.15708 0.115624 -0.448153 1.14332 -0.236155 -0.426175 1.13648 -0.226753 -0.404915 1.12945 -0.216705 -0.384478 1.12226 -0.206004 -0.364963 1.11499 -0.194648 -0.346466 1.1077 -0.18264 -0.329075 1.10045 -0.169981 -0.31287 1.09333 -0.156674 -0.297921 1.0864 -0.14271 -0.284262 1.07975 -0.128055 -0.271829 1.07332 -0.11258 -0.260517 1.06692 -0.0960936 -0.250374 1.06046 -0.0784541 -0.241631 1.05409 -0.059626 -0.234635 1.04816 -0.0396705 -0.229892 1.04338 -0.0190107 -0.228148 1.0412 1.8874e-05 -0.229889 1.04337 0.0190487 -0.23463 1.04816 0.0397095 -0.241624 1.05408 0.0596668 -0.250364 1.06045 0.0784975 -0.260506 1.06691 0.0961403 -0.271816 1.07331 0.112631 -0.284249 1.07974 0.12811 -0.297906 1.08639 0.142771 -0.312856 1.09331 0.15674 -0.32906 1.10044 0.170054 -0.346452 1.10768 0.18272 -0.36495 1.11498 0.194737 -0.384466 1.12224 0.206101 -0.404905 1.12942 0.216812 -0.426168 1.13646 0.22687 -0.448149 1.1433 0.236282 -0.470742 1.14989 0.245061 -0.493837 1.15619 0.253226 -0.517327 1.16217 0.2608 -0.541101 1.16779 0.267811 -0.565055 1.17304 0.274289 -0.589088 1.1779 0.280267 -0.613107 1.18238 0.285776 -0.637028 1.18646 0.290845 -0.660781 1.19018 0.295503 -0.684305 1.19355 0.299777 -0.707555 1.19659 0.303692 -0.730498 1.19932 0.307273 -0.753108 1.20177 0.310542 -0.775374 1.20396 0.313523 -0.797285 1.20589 0.316237 -0.818838 1.20759 0.318706 -0.840035 1.20907 0.32095 -0.860876 1.21032 0.322987 -0.881369 1.21136 0.324833 -0.901522 1.2122 0.326501 -0.921351 1.21283 0.328002 -0.940879 1.21328 0.329341 -0.960141 1.21355 0.330523 -0.979185 1.21366 0.331547 -0.998079 1.21362 0.332411 -1.01691 1.21348 0.333109 -1.03577 1.21325 0.333622 -1.05469 1.21303 0.333891 -1.07453 1.21304 0.333736 -1.09724 1.21308 0.333336 -1.12633 1.21314 0.332676 -1.16736 1.21321 0.331729 -1.22905 1.21329 0.330581 -1.32602 1.2133 0.329471 -1.48223 1.21321 0.328738 -1.73287 1.21321 0.328598 -2.12351 1.21401 0.328716 -2.70916 1.21679 0.327664 -3.55441 1.22408 0.319266 -4.7159 1.31249 0.190128 -0.283635 1.30569 -0.310848 -0.255436 1.29481 -0.297764 -0.228228 1.28376 -0.283927 -0.202136 1.27262 -0.269332 -0.177275 1.26148 -0.253979 -0.153757 1.25042 -0.237867 -0.131684 1.23955 -0.22099 -0.111152 1.22896 -0.203341 -0.0922444 1.21878 -0.184897 -0.0750126 1.20908 -0.165608 -0.0594096 1.19982 -0.145334 -0.0453576 1.19082 -0.12388 -0.032932 1.18199 -0.101091 -0.0223899 1.17351 -0.0769092 -0.0140939 1.16582 -0.0513722 -0.00855134 1.15973 -0.0249051 -0.00651111 1.15694 3.0048e-05 -0.00854767 1.15973 0.0249655 -0.0140866 1.16582 0.0514342 -0.0223794 1.17351 0.0769742 -0.0329188 1.18198 0.101161 -0.0453422 1.19082 0.123955 -0.0593926 1.19982 0.145416 -0.0749948 1.20908 0.165698 -0.0922263 1.21877 0.184997 -0.111135 1.22896 0.203452 -0.131668 1.23954 0.221114 -0.153742 1.25041 0.238004 -0.177263 1.26147 0.254132 -0.202128 1.27261 0.269502 -0.228226 1.28374 0.284115 -0.255439 1.29479 0.297972 -0.283644 1.30566 0.311077 -0.312714 1.31629 0.323436 -0.342515 1.32661 0.335062 -0.372914 1.33654 0.345972 -0.403774 1.34604 0.356187 -0.434963 1.35506 0.365729 -0.466351 1.36358 0.374624 -0.497818 1.37156 0.3829 -0.529256 1.37902 0.390583 -0.56057 1.38595 0.397702 -0.591683 1.39236 0.404285 -0.622533 1.39828 0.410361 -0.653076 1.40372 0.415959 -0.683283 1.40873 0.42111 -0.713136 1.41331 0.425844 -0.742628 1.41749 0.430192 -0.77176 1.42128 0.434187 -0.800539 1.42471 0.437856 -0.828977 1.42778 0.441229 -0.857092 1.43052 0.444331 -0.884908 1.43292 0.447184 -0.912456 1.435 0.449806 -0.939775 1.43679 0.452211 -0.966922 1.43829 0.454406 -0.993967 1.43954 0.456398 -1.02101 1.44055 0.458186 -1.04816 1.44136 0.459763 -1.07554 1.44202 0.461105 -1.10323 1.44262 0.46213 -1.13221 1.44346 0.462608 -1.16481 1.44434 0.46283 -1.20498 1.44532 0.462858 -1.2585 1.44647 0.462734 -1.33372 1.44781 0.462573 -1.4438 1.44932 0.462545 -1.60974 1.45097 0.462805 -1.86319 1.45288 0.463314 -2.24705 1.45557 0.463399 -2.81385 1.46042 0.460618 -3.622 1.47269 0.443939 -4.7159 1.5709 0.312702 --0.00273487 1.58981 -0.417879 --0.0410606 1.57255 -0.399572 --0.0779592 1.55517 -0.380346 --0.113278 1.53778 -0.360198 --0.146873 1.52051 -0.339128 --0.178608 1.50351 -0.317131 --0.208355 1.4869 -0.294194 --0.235997 1.47084 -0.270296 --0.261424 1.45549 -0.245398 --0.284556 1.44098 -0.219429 --0.305404 1.42729 -0.192242 --0.323998 1.41426 -0.163643 --0.340206 1.40183 -0.133468 --0.353718 1.39026 -0.101628 --0.364133 1.38009 -0.0681331 --0.370934 1.37223 -0.0334029 --0.373402 1.36865 4.3689e-05 --0.370938 1.37223 0.0334908 --0.364142 1.38009 0.0682233 --0.35373 1.39027 0.101722 --0.340221 1.40183 0.13357 --0.324014 1.41427 0.163754 --0.305421 1.42731 0.192365 --0.284573 1.44099 0.219565 --0.26144 1.4555 0.245551 --0.23601 1.47085 0.270468 --0.208364 1.48691 0.294388 --0.17861 1.50352 0.317348 --0.146868 1.52053 0.339372 --0.113264 1.53779 0.360472 --0.0779334 1.55518 0.380652 --0.0410217 1.57256 0.399915 --0.00268093 1.58981 0.41826 -0.0369289 1.60681 0.435692 -0.0776412 1.62345 0.452218 -0.119285 1.63963 0.467848 -0.161685 1.65525 0.482599 -0.204668 1.67025 0.496488 -0.248065 1.68456 0.509538 -0.291715 1.69813 0.521772 -0.335469 1.71095 0.533215 -0.379199 1.72301 0.543897 -0.422793 1.7343 0.553845 -0.466163 1.74485 0.563094 -0.509242 1.75469 0.571678 -0.551987 1.76383 0.579635 -0.594369 1.77231 0.587004 -0.63638 1.78017 0.593828 -0.678023 1.78742 0.600148 -0.719317 1.79409 0.606008 -0.760289 1.80022 0.611446 -0.800979 1.80582 0.616501 -0.841439 1.81091 0.621207 -0.881733 1.81553 0.625592 -0.921941 1.81969 0.629681 -0.962163 1.82342 0.633491 -1.00252 1.82677 0.637033 -1.04317 1.82976 0.640313 -1.08429 1.83244 0.643324 -1.12609 1.83487 0.646039 -1.16868 1.83717 0.648346 -1.21327 1.8397 0.649949 -1.26263 1.84231 0.651276 -1.32119 1.84512 0.652467 -1.39502 1.84827 0.653625 -1.49203 1.85182 0.654871 -1.62379 1.8558 0.656289 -1.80773 1.86026 0.657805 -2.06965 1.86531 0.65899 -2.44555 1.87149 0.658479 -2.98134 1.88082 0.65216 -3.7277 1.90235 0.625129 -4.7159 2.00059 0.514379 --0.492941 2.09003 -0.583893 --0.548654 2.062 -0.557536 --0.602246 2.03385 -0.529964 --0.653501 2.00578 -0.501181 --0.702219 1.97801 -0.471195 --0.748212 1.95074 -0.44 --0.791307 1.9242 -0.407583 --0.831338 1.89864 -0.373909 --0.868152 1.87431 -0.338922 --0.901616 1.85141 -0.30253 --0.931676 1.83003 -0.264581 --0.958273 1.81007 -0.224892 --0.981175 1.79161 -0.183285 --0.99997 1.77505 -0.139633 --1.01417 1.76105 -0.0939152 --1.0232 1.75068 -0.0465378 --1.0264 1.74607 5.3266e-05 --1.0232 1.75068 0.046645 --1.01417 1.76106 0.0940256 --0.999979 1.77507 0.13975 --0.981185 1.79164 0.183412 --0.958283 1.8101 0.225031 --0.931684 1.83006 0.264737 --0.901621 1.85145 0.302705 --0.868151 1.87434 0.339121 --0.831329 1.89869 0.374135 --0.791287 1.92425 0.407841 --0.748179 1.95079 0.440294 --0.702169 1.97806 0.471529 --0.65343 2.00584 0.501562 --0.602152 2.03392 0.530394 --0.548533 2.06207 0.558023 --0.492788 2.09009 0.584441 --0.435141 2.1178 0.609643 --0.375828 2.14501 0.633631 --0.315091 2.17156 0.656408 --0.253176 2.1973 0.677985 --0.190328 2.2221 0.698381 --0.126786 2.24587 0.717615 --0.0627792 2.26854 0.735714 -0.00148387 2.29005 0.752708 -0.0658162 2.31038 0.768631 -0.130058 2.32952 0.783522 -0.19408 2.3475 0.797424 -0.257783 2.36435 0.810384 -0.3211 2.3801 0.822454 -0.38399 2.39481 0.833688 -0.446442 2.40851 0.844145 -0.50847 2.42126 0.853883 -0.570111 2.43311 0.862962 -0.631424 2.44411 0.87144 -0.692492 2.4543 0.879372 -0.753421 2.46373 0.886808 -0.81434 2.47245 0.893794 -0.875406 2.48051 0.900367 -0.936807 2.48795 0.906559 -0.998766 2.49483 0.912393 -1.06155 2.50121 0.917882 -1.12546 2.50714 0.923027 -1.19085 2.5127 0.9278 -1.25798 2.51803 0.932069 -1.32826 2.52354 0.935482 -1.40478 2.52912 0.938571 -1.49221 2.53496 0.941527 -1.59639 2.54124 0.944464 -1.72429 2.54807 0.947454 -1.88518 2.55554 0.950429 -2.09218 2.56383 0.953054 -2.36404 2.5733 0.954485 -2.72733 2.58495 0.952752 -3.21786 2.60179 0.943156 -3.87629 2.6339 0.914341 -4.7159 2.71505 0.846241 --1.3179 2.99225 -0.861365 --1.40635 2.94413 -0.821899 --1.49146 2.89569 -0.780546 --1.57284 2.84733 -0.737345 --1.65015 2.79943 -0.692334 --1.72307 2.75242 -0.645545 --1.79132 2.70671 -0.596995 --1.85465 2.66273 -0.546671 --1.91282 2.62093 -0.494527 --1.96564 2.58171 -0.440472 --2.01293 2.5454 -0.38437 --2.0545 2.51219 -0.326061 --2.08999 2.48244 -0.265358 --2.11882 2.45686 -0.202093 --2.14031 2.43635 -0.136226 --2.15373 2.42216 -0.0681554 --2.15837 2.41633 4.1855e-05 --2.15373 2.42217 0.0682399 --2.14031 2.43637 0.136314 --2.11882 2.45688 0.202186 --2.08999 2.48247 0.265461 --2.0545 2.51223 0.326176 --2.01292 2.54545 0.384501 --1.96562 2.58177 0.440622 --1.9128 2.62099 0.494701 --1.85461 2.66281 0.546872 --1.79127 2.70679 0.597229 --1.723 2.75251 0.645817 --1.65006 2.79954 0.692648 --1.57272 2.84744 0.737707 --1.4913 2.89582 0.780964 --1.40615 2.94426 0.822377 --1.31765 2.99239 0.861911 --1.22621 3.03983 0.899534 --1.13226 3.08627 0.935232 --1.03625 3.13139 0.969004 --0.938632 3.17494 1.00086 --0.839845 3.21671 1.03085 --0.740318 3.25653 1.05899 --0.640452 3.29429 1.08536 --0.540607 3.32992 1.11003 --0.4411 3.36341 1.13306 --0.342195 3.39476 1.15456 --0.2441 3.42402 1.1746 --0.146968 3.45128 1.19329 --0.050896 3.47662 1.21073 -0.0440708 3.50016 1.22702 -0.137937 3.522 1.24225 -0.230751 3.54225 1.25652 -0.322605 3.56105 1.26993 -0.413629 3.57849 1.28256 -0.503991 3.59469 1.2945 -0.593895 3.60976 1.30582 -0.683581 3.62379 1.31658 -0.773328 3.63689 1.32685 -0.863458 3.64914 1.33666 -0.95434 3.66064 1.34606 -1.0464 3.67146 1.35507 -1.14012 3.6817 1.36371 -1.23606 3.69146 1.37195 -1.33476 3.70084 1.3797 -1.43767 3.71019 1.3867 -1.54748 3.71948 1.39338 -1.66806 3.72891 1.39991 -1.80397 3.73865 1.40638 -1.96051 3.74883 1.4128 -2.1446 3.75964 1.41901 -2.36598 3.77138 1.42466 -2.63882 3.78456 1.42907 -2.9838 3.80029 1.43091 -3.4297 3.82098 1.42769 -4.00778 3.85211 1.41548 -4.7159 3.90304 1.39237 --2.69125 4.80271 -1.4041 --2.86804 4.70707 -1.34696 --3.03666 4.61138 -1.28528 --3.1963 4.51673 -1.21895 --3.34628 4.42415 -1.14794 --3.48603 4.33458 -1.07227 --3.61512 4.24884 -0.99202 --3.73326 4.16762 -0.907341 --3.84024 4.09145 -0.818442 --3.93602 4.02066 -0.725598 --4.02065 3.95539 -0.629143 --4.09432 3.89555 -0.529472 --4.15737 3.84082 -0.427032 --4.21028 3.79065 -0.322318 --4.25367 3.74423 -0.215862 --4.28837 3.70049 -0.108228 --4.31536 3.65811 0 --4.28837 3.70049 0.108228 --4.25367 3.74423 0.215862 --4.21028 3.79065 0.322318 --4.15737 3.84082 0.427032 --4.09432 3.89555 0.529472 --4.02065 3.95539 0.629143 --3.93602 4.02066 0.725598 --3.84024 4.09145 0.818442 --3.73326 4.16762 0.907341 --3.61512 4.24884 0.99202 --3.48603 4.33458 1.07227 --3.34628 4.42415 1.14794 --3.1963 4.51673 1.21895 --3.03666 4.61138 1.28528 --2.86804 4.70707 1.34696 --2.69125 4.80271 1.4041 --2.50725 4.89721 1.45681 --2.31712 4.98948 1.50528 --2.12204 5.07849 1.54974 --1.92333 5.16329 1.59042 --1.72239 5.24305 1.6276 --1.5207 5.31707 1.66155 --1.31977 5.38482 1.69257 --1.12117 5.44595 1.72096 --0.92641 5.50027 1.74702 --0.737004 5.54781 1.77104 --0.554376 5.58873 1.79329 --0.379854 5.62338 1.81404 --0.21464 5.65222 1.83354 --0.0597859 5.67582 1.85201 -0.0838234 5.69485 1.86967 -0.215488 5.70999 1.8867 -0.334709 5.72195 1.90356 -0.441197 5.73141 1.92041 -0.534872 5.73903 1.93726 -0.615873 5.74569 1.95412 -0.684581 5.75232 1.97097 -0.741602 5.75896 1.98782 -0.787778 5.76559 2.00468 -0.824205 5.77222 2.02153 -0.852247 5.77886 2.03838 -0.873547 5.78549 2.05523 -0.890046 5.79212 2.07209 -0.903996 5.79875 2.08894 -0.918377 5.80539 2.10579 -0.938482 5.81202 2.12265 -0.97153 5.81865 2.1395 -1.02679 5.82529 2.15635 -1.11616 5.83192 2.17321 -1.25492 5.83855 2.19006 -1.4627 5.84518 2.20691 -1.76468 5.85182 2.22377 -2.19322 5.85845 2.24062 -2.78986 5.86508 2.25747 -3.60792 5.87172 2.27433 -4.7159 5.87835 2.29118 -0.649966 0.971817 -0.017743 -0.638437 0.971044 -0.0172183 -0.627474 0.970187 -0.0166213 -0.617133 0.969252 -0.0159577 -0.607458 0.968249 -0.0152329 -0.598488 0.967187 -0.0144545 -0.590253 0.966082 -0.0136338 -0.582774 0.964955 -0.0127868 -0.576063 0.963828 -0.0119325 -0.570115 0.962726 -0.0110899 -0.564858 0.961539 -0.0101734 -0.560175 0.960033 -0.00899886 -0.556041 0.958123 -0.00749662 -0.552501 0.95592 -0.00575199 -0.549574 0.953576 -0.00388575 -0.547243 0.951169 -0.00196081 -0.545519 0.948729 0 -0.547243 0.951169 0.00196081 -0.549574 0.953576 0.00388575 -0.552501 0.95592 0.00575199 -0.556041 0.958123 0.00749662 -0.560175 0.960033 0.00899886 -0.564858 0.961539 0.0101734 -0.570115 0.962726 0.0110899 -0.576063 0.963828 0.0119325 -0.582774 0.964955 0.0127868 -0.590253 0.966082 0.0136338 -0.598488 0.967187 0.0144545 -0.607458 0.968249 0.0152329 -0.617133 0.969252 0.0159577 -0.627474 0.970187 0.0166213 -0.638437 0.971044 0.0172183 -0.649966 0.971817 0.017743 -0.662 0.972492 0.0181875 -0.674467 0.973052 0.0185402 -0.687291 0.973476 0.0187862 -0.700388 0.973736 0.0189078 -0.713673 0.973808 0.0188881 -0.727061 0.97367 0.0187136 -0.74047 0.973309 0.0183777 -0.753825 0.972727 0.0178827 -0.767054 0.971937 0.0172405 -0.780096 0.970965 0.0164711 -0.792891 0.969845 0.0156006 -0.805388 0.968615 0.0146568 -0.817532 0.967312 0.0136665 -0.829276 0.965967 0.0126519 -0.84057 0.964603 0.0116294 -0.851372 0.963235 0.0106099 -0.861641 0.961873 0.00959916 -0.871347 0.96052 0.00860071 -0.880469 0.959183 0.00761691 -0.888997 0.957866 0.00665117 -0.896937 0.956577 0.00570799 -0.904307 0.955323 0.0047929 -0.911141 0.954113 0.00391154 -0.917488 0.952954 0.0030683 -0.923414 0.951849 0.00226525 -0.928998 0.95079 0.00149657 -0.934337 0.949758 0.000747842 -0.939543 0.948726 0 -0.945174 0.948726 0 -0.952277 0.948726 0 -0.964776 0.948727 0 -0.989963 0.948727 0 -1.03945 0.948727 0 -1.13041 0.948727 0 -1.28713 0.948727 0 -1.54305 0.948728 0 -1.94337 0.948728 0 -2.54837 0.948728 0 -3.4377 0.948728 0 -4.7159 0.948729 0 -0.649965 0.971817 -0.0177632 -0.638436 0.971045 -0.0172385 -0.627473 0.970187 -0.0166414 -0.617131 0.969252 -0.0159777 -0.607456 0.968249 -0.0152528 -0.598486 0.967187 -0.0144743 -0.590251 0.966083 -0.0136535 -0.582772 0.964955 -0.0128064 -0.57606 0.963829 -0.0119519 -0.570112 0.962727 -0.011109 -0.564854 0.96154 -0.0101921 -0.560169 0.960035 -0.00901686 -0.556032 0.958127 -0.00751299 -0.552489 0.955926 -0.00576536 -0.549559 0.953584 -0.00389402 -0.547229 0.951181 -0.00196084 -0.545522 0.948748 0 -0.547229 0.951181 0.00196084 -0.549559 0.953584 0.00389402 -0.55249 0.955926 0.00576536 -0.556032 0.958127 0.00751299 -0.560169 0.960035 0.00901686 -0.564854 0.96154 0.0101921 -0.570112 0.962727 0.011109 -0.57606 0.963829 0.0119519 -0.582772 0.964955 0.0128064 -0.590251 0.966083 0.0136535 -0.598486 0.967187 0.0144743 -0.607456 0.968249 0.0152528 -0.617131 0.969252 0.0159777 -0.627473 0.970187 0.0166414 -0.638436 0.971045 0.0172385 -0.649965 0.971817 0.0177632 -0.661999 0.972492 0.0182078 -0.674467 0.973053 0.0185606 -0.687291 0.973476 0.0188066 -0.700388 0.973736 0.0189282 -0.713673 0.973808 0.0189085 -0.727061 0.973669 0.0187341 -0.740471 0.973309 0.0183982 -0.753825 0.972727 0.0179032 -0.767055 0.971936 0.017261 -0.780097 0.970964 0.0164917 -0.792893 0.969844 0.0156211 -0.805389 0.968615 0.0146774 -0.817534 0.967312 0.0136871 -0.829277 0.965967 0.0126724 -0.840572 0.964603 0.01165 -0.851374 0.963234 0.0106303 -0.861643 0.961872 0.0096196 -0.871349 0.96052 0.00862109 -0.880471 0.959183 0.00763723 -0.889 0.957866 0.00667141 -0.896939 0.956576 0.00572815 -0.904309 0.955322 0.00481296 -0.911143 0.954112 0.00393153 -0.91749 0.952953 0.00308821 -0.923416 0.951848 0.00228511 -0.929001 0.950789 0.00151642 -0.93434 0.949757 0.000767741 -0.939545 0.948728 2.0067e-05 -0.945174 0.948726 2.0206e-05 -0.952277 0.948726 2.0318e-05 -0.964777 0.948726 2.0615e-05 -0.989965 0.948726 2.1188e-05 -1.03946 0.948726 2.1603e-05 -1.13041 0.948726 2.1517e-05 -1.28713 0.948726 2.1289e-05 -1.54305 0.948727 2.1244e-05 -1.94337 0.948727 2.146e-05 -2.54837 0.948727 2.2127e-05 -3.4377 0.948728 2.3813e-05 -4.7159 0.948743 9.764e-06 -0.649963 0.971817 -0.0177978 -0.638434 0.971045 -0.0172729 -0.627471 0.970187 -0.0166757 -0.617129 0.969252 -0.0160117 -0.607453 0.968249 -0.0152866 -0.598483 0.967188 -0.0145078 -0.590247 0.966083 -0.0136866 -0.582768 0.964956 -0.0128391 -0.576056 0.96383 -0.0119841 -0.570107 0.962728 -0.0111405 -0.564848 0.961541 -0.0102225 -0.56016 0.960038 -0.00904554 -0.556019 0.958133 -0.00753875 -0.552472 0.955935 -0.00578615 -0.549538 0.953598 -0.00390677 -0.547207 0.951199 -0.00196095 -0.545528 0.948782 0 -0.547207 0.951199 0.00196095 -0.549538 0.953598 0.00390677 -0.552472 0.955935 0.00578615 -0.556019 0.958133 0.00753875 -0.56016 0.960038 0.00904554 -0.564848 0.961541 0.0102225 -0.570107 0.962728 0.0111405 -0.576056 0.96383 0.0119841 -0.582768 0.964956 0.0128391 -0.590247 0.966083 0.0136866 -0.598483 0.967188 0.0145078 -0.607453 0.968249 0.0152866 -0.617129 0.969252 0.0160117 -0.627471 0.970187 0.0166757 -0.638434 0.971045 0.0172729 -0.649963 0.971817 0.0177978 -0.661997 0.972492 0.0182425 -0.674466 0.973053 0.0185954 -0.68729 0.973476 0.0188415 -0.700388 0.973736 0.0189632 -0.713673 0.973808 0.0189437 -0.727062 0.973669 0.0187693 -0.740471 0.973309 0.0184336 -0.753826 0.972726 0.0179387 -0.767056 0.971936 0.0172965 -0.780098 0.970963 0.0165273 -0.792895 0.969843 0.0156568 -0.805391 0.968614 0.0147131 -0.817536 0.967311 0.0137229 -0.82928 0.965966 0.0127083 -0.840575 0.964602 0.0116858 -0.851377 0.963233 0.0106662 -0.861646 0.961871 0.00965548 -0.871352 0.960519 0.00865693 -0.880474 0.959181 0.00767302 -0.889003 0.957864 0.00670713 -0.896943 0.956575 0.00576378 -0.904313 0.955321 0.00484851 -0.911147 0.954111 0.003967 -0.917495 0.952952 0.00312364 -0.923421 0.951847 0.00232053 -0.929006 0.950788 0.0015519 -0.934344 0.949757 0.000803429 -0.939548 0.948732 5.6765e-05 -0.945175 0.948726 5.6441e-05 -0.952279 0.948724 5.6593e-05 -0.96478 0.948724 5.7271e-05 -0.989968 0.948724 5.8665e-05 -1.03946 0.948724 5.9605e-05 -1.13042 0.948725 5.9212e-05 -1.28714 0.948724 5.851e-05 -1.54306 0.948724 5.8354e-05 -1.94338 0.948724 5.8911e-05 -2.54838 0.948725 6.0647e-05 -3.43772 0.948726 6.5006e-05 -4.7159 0.948769 2.5278e-05 -0.649961 0.971818 -0.0178569 -0.638431 0.971046 -0.0173316 -0.627467 0.970188 -0.016734 -0.617125 0.969253 -0.0160696 -0.607449 0.96825 -0.0153438 -0.598478 0.967189 -0.0145643 -0.590241 0.966084 -0.0137424 -0.582761 0.964958 -0.0128939 -0.576049 0.963832 -0.0120377 -0.570099 0.962731 -0.0111924 -0.564838 0.961544 -0.0102718 -0.560145 0.960043 -0.00909128 -0.555998 0.958142 -0.0075793 -0.552443 0.95595 -0.00581855 -0.549504 0.953619 -0.00392645 -0.547173 0.951227 -0.00196127 -0.545537 0.948843 0 -0.547173 0.951227 0.00196127 -0.549504 0.953619 0.00392645 -0.552443 0.95595 0.00581855 -0.555998 0.958142 0.0075793 -0.560145 0.960043 0.00909128 -0.564838 0.961544 0.0102718 -0.570099 0.962731 0.0111924 -0.576049 0.963832 0.0120377 -0.582761 0.964958 0.0128939 -0.590241 0.966084 0.0137424 -0.598478 0.967189 0.0145643 -0.607449 0.96825 0.0153438 -0.617125 0.969253 0.0160696 -0.627467 0.970188 0.016734 -0.638431 0.971046 0.0173316 -0.649961 0.971818 0.0178569 -0.661995 0.972493 0.0183019 -0.674464 0.973053 0.0186551 -0.687288 0.973476 0.0189014 -0.700387 0.973737 0.0190234 -0.713673 0.973808 0.0190041 -0.727062 0.973669 0.0188299 -0.740472 0.973308 0.0184944 -0.753828 0.972725 0.0179998 -0.767059 0.971935 0.0173579 -0.780102 0.970962 0.0165889 -0.792898 0.969842 0.0157187 -0.805395 0.968613 0.0147753 -0.817541 0.96731 0.0137852 -0.829285 0.965964 0.0127708 -0.84058 0.9646 0.0117485 -0.851382 0.963232 0.010729 -0.861652 0.961869 0.00971835 -0.871358 0.960517 0.00871984 -0.880481 0.959179 0.00773592 -0.88901 0.957862 0.00677 -0.89695 0.956573 0.00582661 -0.90432 0.955318 0.0049113 -0.911155 0.954109 0.00402978 -0.917502 0.952949 0.00318647 -0.923429 0.951844 0.00238349 -0.929014 0.950786 0.00161513 -0.934353 0.949755 0.00086728 -0.939553 0.948739 0.000123612 -0.945175 0.948725 0.000121255 -0.952282 0.948722 0.000121192 -0.964784 0.948721 0.000122275 -0.989974 0.948721 0.00012482 -1.03947 0.948722 0.000126455 -1.13043 0.948722 0.000125392 -1.28715 0.948721 0.000123775 -1.54307 0.948721 0.000123371 -1.9434 0.94872 0.000124462 -2.5484 0.948721 0.000127908 -3.43773 0.948724 0.000136492 -4.7159 0.948812 4.9568e-05 -0.649956 0.971819 -0.0179576 -0.638425 0.971047 -0.0174316 -0.627461 0.970189 -0.016833 -0.617118 0.969255 -0.0161676 -0.607441 0.968252 -0.0154406 -0.598469 0.96719 -0.0146596 -0.590231 0.966086 -0.0138359 -0.58275 0.96496 -0.0129853 -0.576037 0.963836 -0.0121265 -0.570086 0.962735 -0.0112774 -0.564821 0.961548 -0.0103514 -0.560121 0.960051 -0.0091641 -0.555964 0.958157 -0.00764304 -0.552399 0.955974 -0.00586892 -0.549452 0.953652 -0.00395676 -0.547122 0.951272 -0.00196209 -0.545552 0.94895 1e-09 -0.547122 0.951272 0.0019621 -0.549452 0.953652 0.00395677 -0.552399 0.955974 0.00586893 -0.555964 0.958157 0.00764304 -0.560121 0.960051 0.00916411 -0.564821 0.961548 0.0103514 -0.570086 0.962735 0.0112774 -0.576037 0.963836 0.0121265 -0.58275 0.96496 0.0129853 -0.590231 0.966086 0.0138359 -0.598469 0.96719 0.0146596 -0.607441 0.968252 0.0154406 -0.617118 0.969255 0.0161676 -0.627461 0.970189 0.0168331 -0.638425 0.971047 0.0174316 -0.649956 0.971819 0.0179576 -0.661991 0.972494 0.0184033 -0.67446 0.973054 0.0187571 -0.687286 0.973477 0.0190039 -0.700385 0.973737 0.0191264 -0.713672 0.973808 0.0191075 -0.727063 0.973669 0.018934 -0.740474 0.973307 0.018599 -0.753831 0.972724 0.0181049 -0.767063 0.971934 0.0174636 -0.780107 0.970961 0.0166953 -0.792904 0.96984 0.0158257 -0.805402 0.96861 0.0148829 -0.817548 0.967307 0.0138934 -0.829293 0.965962 0.0128795 -0.840588 0.964597 0.0118576 -0.851391 0.963229 0.0108385 -0.861661 0.961866 0.00982805 -0.871368 0.960514 0.00882975 -0.880491 0.959176 0.00784599 -0.889021 0.957859 0.0068802 -0.896962 0.956569 0.00593692 -0.904333 0.955314 0.00502176 -0.911168 0.954105 0.00414044 -0.917516 0.952945 0.00329744 -0.923443 0.95184 0.00249493 -0.929028 0.950782 0.00172733 -0.934367 0.949754 0.000981009 -0.939562 0.948752 0.000244523 -0.945177 0.948725 0.000236671 -0.952288 0.948719 0.000235712 -0.964792 0.948716 0.000237027 -0.989983 0.948716 0.000241102 -1.03948 0.948717 0.00024368 -1.13044 0.948717 0.00024134 -1.28716 0.948716 0.000238027 -1.5431 0.948714 0.000237098 -1.94342 0.948714 0.000239014 -2.54843 0.948715 0.000245175 -3.43776 0.94872 0.000260374 -4.7159 0.948885 8.7608e-05 -0.649947 0.971822 -0.0181283 -0.638415 0.97105 -0.0176008 -0.62745 0.970192 -0.0170004 -0.617105 0.969258 -0.0163327 -0.607427 0.968255 -0.0156032 -0.598453 0.967194 -0.0148192 -0.590214 0.966091 -0.0139919 -0.582731 0.964965 -0.013137 -0.576016 0.963842 -0.0122729 -0.570063 0.962741 -0.0114161 -0.564792 0.961556 -0.0104794 -0.560081 0.960063 -0.00927959 -0.555909 0.958181 -0.00774285 -0.55233 0.956011 -0.00594697 -0.549371 0.953704 -0.0040033 -0.547047 0.951344 -0.00196411 -0.545576 0.949133 1e-09 -0.547047 0.951344 0.00196412 -0.549371 0.953704 0.00400331 -0.55233 0.956011 0.00594698 -0.555909 0.958181 0.00774286 -0.560081 0.960063 0.0092796 -0.564792 0.961556 0.0104795 -0.570063 0.962741 0.0114162 -0.576016 0.963842 0.0122729 -0.582731 0.964965 0.013137 -0.590214 0.966091 0.0139919 -0.598453 0.967194 0.0148192 -0.607427 0.968255 0.0156032 -0.617105 0.969258 0.0163327 -0.62745 0.970192 0.0170004 -0.638415 0.97105 0.0176008 -0.649947 0.971822 0.0181284 -0.661984 0.972496 0.0185754 -0.674454 0.973056 0.0189303 -0.687281 0.973479 0.0191782 -0.700382 0.973738 0.0193017 -0.713672 0.973809 0.0192839 -0.727064 0.973669 0.0191113 -0.740478 0.973307 0.0187775 -0.753836 0.972723 0.0182847 -0.76707 0.971932 0.0176447 -0.780115 0.970958 0.0168777 -0.792915 0.969838 0.0160095 -0.805414 0.968607 0.015068 -0.817561 0.967304 0.0140798 -0.829306 0.965958 0.0130671 -0.840603 0.964593 0.0120462 -0.851406 0.963225 0.011028 -0.861677 0.961861 0.0100183 -0.871386 0.960509 0.00902061 -0.88051 0.959171 0.0080374 -0.88904 0.957853 0.00707211 -0.896983 0.956563 0.00612936 -0.904355 0.955308 0.00521478 -0.911191 0.954098 0.0043342 -0.91754 0.952939 0.00349216 -0.923467 0.951834 0.00269091 -0.929054 0.950777 0.00192514 -0.934393 0.949751 0.00118228 -0.939579 0.948774 0.000460903 -0.945181 0.948724 0.00044085 -0.952299 0.948713 0.000437415 -0.964807 0.948708 0.00043828 -0.99 0.948708 0.000444159 -1.0395 0.94871 0.000447976 -1.13046 0.948709 0.00044334 -1.28719 0.948706 0.000436963 -1.54313 0.948704 0.000434972 -1.94347 0.948703 0.000438131 -2.54848 0.948705 0.00044855 -3.43782 0.948714 0.000473957 -4.7159 0.94901 0.000147578 -0.649933 0.971827 -0.0184154 -0.638398 0.971055 -0.0178847 -0.627431 0.970198 -0.0172807 -0.617084 0.969264 -0.0166088 -0.607404 0.968261 -0.0158743 -0.598427 0.967201 -0.0150844 -0.590185 0.966099 -0.0142502 -0.582699 0.964975 -0.013387 -0.575981 0.963854 -0.0125125 -0.570025 0.962754 -0.011641 -0.564744 0.961569 -0.0106843 -0.560017 0.960085 -0.00946176 -0.555822 0.958218 -0.00789835 -0.552221 0.956069 -0.00606723 -0.549248 0.953785 -0.00407439 -0.546935 0.951462 -0.001969 -0.545606 0.949436 2e-09 -0.546935 0.951462 0.00196901 -0.549248 0.953785 0.0040744 -0.552221 0.956069 0.00606725 -0.555822 0.958218 0.00789837 -0.560017 0.960085 0.00946178 -0.564744 0.961569 0.0106843 -0.570025 0.962754 0.011641 -0.575981 0.963853 0.0125125 -0.582699 0.964975 0.013387 -0.590185 0.966099 0.0142503 -0.598427 0.967201 0.0150845 -0.607404 0.968261 0.0158743 -0.617084 0.969264 0.0166088 -0.627431 0.970198 0.0172807 -0.638398 0.971055 0.0178847 -0.649933 0.971827 0.0184154 -0.661971 0.972502 0.018865 -0.674444 0.973061 0.0192223 -0.687274 0.973483 0.0194723 -0.700377 0.973742 0.0195977 -0.71367 0.973811 0.0195819 -0.727065 0.97367 0.0194115 -0.740482 0.973307 0.01908 -0.753845 0.972723 0.0185897 -0.767082 0.97193 0.0179524 -0.78013 0.970956 0.0171882 -0.792932 0.969834 0.0163229 -0.805433 0.968603 0.0153842 -0.817582 0.967299 0.0143986 -0.829329 0.965953 0.0133883 -0.840627 0.964588 0.0123697 -0.851432 0.963219 0.0113534 -0.861705 0.961855 0.0103454 -0.871415 0.960501 0.00934928 -0.880541 0.959163 0.00836749 -0.889074 0.957844 0.0074036 -0.897018 0.956554 0.00646231 -0.904392 0.955299 0.00554937 -0.91123 0.954088 0.00467071 -0.917581 0.952929 0.00383103 -0.92351 0.951824 0.0030327 -0.929098 0.950768 0.00227098 -0.934437 0.949749 0.00153547 -0.939611 0.948809 0.00084237 -0.945192 0.948725 0.000798957 -0.95232 0.948705 0.000789665 -0.964835 0.948696 0.000788249 -0.990031 0.948696 0.00079568 -1.03953 0.948698 0.000800903 -1.1305 0.948697 0.000792263 -1.28724 0.948692 0.000780483 -1.5432 0.948687 0.000776425 -1.94355 0.948685 0.000781405 -2.54858 0.948689 0.000798387 -3.43791 0.948705 0.000839243 -4.7159 0.949219 0.00024293 -0.649907 0.97184 -0.0188931 -0.638369 0.971069 -0.0183566 -0.627398 0.970211 -0.0177458 -0.617047 0.969277 -0.0170659 -0.607362 0.968275 -0.016322 -0.598381 0.967216 -0.0155211 -0.590135 0.966115 -0.0146738 -0.582644 0.964993 -0.0137947 -0.57592 0.963875 -0.0129008 -0.569958 0.962777 -0.0120021 -0.564663 0.961594 -0.0110095 -0.55991 0.960122 -0.00974727 -0.555683 0.958279 -0.0081391 -0.552049 0.956161 -0.00625135 -0.549058 0.953915 -0.00418241 -0.546772 0.951657 -0.00198062 -0.545632 0.949908 4e-09 -0.546772 0.951657 0.00198064 -0.549058 0.953915 0.00418244 -0.552049 0.956161 0.00625138 -0.555683 0.958279 0.00813913 -0.55991 0.960122 0.0097473 -0.564663 0.961594 0.0110095 -0.569958 0.962777 0.0120022 -0.57592 0.963875 0.0129008 -0.582644 0.964993 0.0137948 -0.590135 0.966115 0.0146738 -0.598381 0.967216 0.0155211 -0.607362 0.968275 0.016322 -0.617047 0.969277 0.0170659 -0.627398 0.970211 0.0177458 -0.638369 0.971069 0.0183567 -0.649907 0.97184 0.0188932 -0.661949 0.972514 0.0193478 -0.674426 0.973073 0.0197094 -0.68726 0.973494 0.0199633 -0.700368 0.973751 0.0200926 -0.713665 0.973819 0.0200806 -0.727067 0.973677 0.0199143 -0.74049 0.973312 0.0195873 -0.753857 0.972725 0.0191019 -0.7671 0.971931 0.0184699 -0.780154 0.970955 0.0177113 -0.79296 0.969833 0.0168516 -0.805465 0.968601 0.0159185 -0.817617 0.967296 0.0149383 -0.829368 0.965948 0.013933 -0.840668 0.964582 0.0129189 -0.851476 0.963212 0.0119066 -0.861752 0.961847 0.0109023 -0.871464 0.960493 0.00990959 -0.880594 0.959153 0.00893107 -0.88913 0.957834 0.00797044 -0.897077 0.956542 0.00703263 -0.904455 0.955286 0.00612355 -0.911296 0.954075 0.00524931 -0.917651 0.952916 0.00441484 -0.923583 0.951812 0.00362278 -0.929174 0.950758 0.00286949 -0.934514 0.949749 0.00214875 -0.939668 0.948863 0.00150199 -0.94522 0.94873 0.00142028 -0.952366 0.948695 0.00139844 -0.96489 0.948679 0.00139054 -0.990088 0.948679 0.00139776 -1.03959 0.948682 0.00140393 -1.13058 0.948679 0.00138842 -1.28733 0.948671 0.00136733 -1.5433 0.948662 0.00135939 -1.94368 0.948657 0.00136695 -2.54873 0.948666 0.00139383 -3.43805 0.948693 0.0014575 -4.7159 0.949572 0.000395788 -0.64986 0.97187 -0.019679 -0.638316 0.971098 -0.0191318 -0.627339 0.970241 -0.0185084 -0.616982 0.969307 -0.0178138 -0.60729 0.968306 -0.0170527 -0.598301 0.967247 -0.0162316 -0.590046 0.966148 -0.0153604 -0.582546 0.96503 -0.0144526 -0.575815 0.963916 -0.013523 -0.56984 0.96282 -0.012576 -0.564522 0.96164 -0.0115213 -0.55973 0.960186 -0.0101915 -0.555456 0.958378 -0.00850929 -0.551778 0.956307 -0.00653129 -0.548766 0.95412 -0.00434587 -0.546534 0.951978 -0.00200746 -0.545611 0.950584 7e-09 -0.546534 0.951977 0.00200748 -0.548766 0.95412 0.00434591 -0.551778 0.956307 0.00653134 -0.555456 0.958378 0.00850935 -0.55973 0.960186 0.0101916 -0.564522 0.96164 0.0115214 -0.56984 0.96282 0.012576 -0.575815 0.963916 0.0135231 -0.582547 0.96503 0.0144526 -0.590046 0.966148 0.0153604 -0.598301 0.967247 0.0162317 -0.60729 0.968306 0.0170528 -0.616982 0.969307 0.0178139 -0.627339 0.970241 0.0185085 -0.638316 0.971098 0.0191319 -0.64986 0.97187 0.0196791 -0.661908 0.972543 0.0201429 -0.674392 0.973101 0.0205125 -0.687233 0.97352 0.0207738 -0.700349 0.973776 0.02091 -0.713655 0.973841 0.0209052 -0.727066 0.973696 0.0207467 -0.740498 0.973329 0.0204281 -0.753876 0.972739 0.0199519 -0.767128 0.971942 0.01933 -0.78019 0.970964 0.0185819 -0.793004 0.969839 0.017733 -0.805516 0.968605 0.0168107 -0.817674 0.967299 0.0158408 -0.829429 0.96595 0.0148452 -0.840735 0.964582 0.01384 -0.851547 0.963211 0.012836 -0.861828 0.961844 0.0118392 -0.871546 0.960488 0.0108536 -0.88068 0.959146 0.00988201 -0.889223 0.957825 0.0089285 -0.897176 0.956531 0.00799824 -0.90456 0.955274 0.00709744 -0.911408 0.954062 0.00623252 -0.917769 0.952903 0.00540878 -0.923707 0.951801 0.00462935 -0.929304 0.950753 0.00389268 -0.934646 0.949762 0.0031998 -0.939775 0.948942 0.00261738 -0.945291 0.94875 0.0024838 -0.952463 0.948689 0.00243747 -0.965001 0.94866 0.00241447 -0.990198 0.94866 0.00241621 -1.03971 0.948666 0.00242099 -1.1307 0.94866 0.0023938 -1.28748 0.948645 0.00235709 -1.54349 0.948629 0.00234213 -1.94391 0.948622 0.00235316 -2.54899 0.948637 0.0023946 -3.43831 0.948685 0.0024909 -4.7159 0.950161 0.000642541 -0.649774 0.971938 -0.0209542 -0.63822 0.971167 -0.0203879 -0.627232 0.970309 -0.0197421 -0.616864 0.969375 -0.0190214 -0.607159 0.968373 -0.0182297 -0.598157 0.967316 -0.0173726 -0.589888 0.96622 -0.0164588 -0.582373 0.965106 -0.0154999 -0.575624 0.963997 -0.0145073 -0.569627 0.962903 -0.013477 -0.564272 0.961728 -0.012319 -0.559424 0.960299 -0.0108774 -0.555083 0.958542 -0.00907437 -0.551346 0.956539 -0.00695389 -0.548315 0.954447 -0.00459288 -0.546174 0.952492 -0.0020664 -0.545461 0.951472 1.4e-08 -0.546174 0.952492 0.00206644 -0.548315 0.954447 0.00459295 -0.551346 0.956539 0.00695397 -0.555083 0.958542 0.00907446 -0.559424 0.960299 0.0108775 -0.564272 0.961728 0.0123191 -0.569627 0.962903 0.0134771 -0.575624 0.963997 0.0145074 -0.582373 0.965105 0.0155001 -0.589888 0.96622 0.016459 -0.598157 0.967316 0.0173728 -0.607159 0.968373 0.0182299 -0.616864 0.969375 0.0190216 -0.627232 0.970309 0.0197424 -0.63822 0.971167 0.0203881 -0.649774 0.971938 0.0209545 -0.661833 0.972611 0.0214347 -0.674328 0.973167 0.0218188 -0.687181 0.973585 0.0220932 -0.700311 0.973838 0.0222423 -0.713632 0.9739 0.0222506 -0.727058 0.973751 0.0221061 -0.740506 0.973379 0.021803 -0.7539 0.972785 0.0213439 -0.767167 0.971985 0.0207404 -0.780244 0.971003 0.0200118 -0.793071 0.969875 0.0191829 -0.805594 0.968638 0.0182804 -0.817762 0.967329 0.0173298 -0.829526 0.965978 0.0163525 -0.84084 0.964608 0.0153644 -0.85166 0.963233 0.0143761 -0.861949 0.961864 0.0133942 -0.871676 0.960504 0.0124227 -0.88082 0.95916 0.0114652 -0.889373 0.957835 0.0105262 -0.897338 0.956539 0.00961134 -0.904733 0.95528 0.00872724 -0.911593 0.954068 0.00788078 -0.917966 0.95291 0.00707781 -0.923917 0.951811 0.00632243 -0.929525 0.950774 0.00561653 -0.934871 0.949815 0.00497109 -0.939978 0.94906 0.00446203 -0.945466 0.948811 0.00427293 -0.952676 0.948708 0.00418459 -0.96523 0.948659 0.0041307 -0.990415 0.948657 0.00411467 -1.03992 0.948666 0.00411127 -1.13093 0.948656 0.00406424 -1.28774 0.948629 0.00400203 -1.5438 0.948601 0.00397484 -1.94429 0.94859 0.00399027 -2.54943 0.948616 0.00405242 -3.43872 0.948698 0.00419355 -4.7159 0.951146 0.00104304 -0.649614 0.972098 -0.0229924 -0.638041 0.971325 -0.0223928 -0.627034 0.970466 -0.0217082 -0.616645 0.969529 -0.0209421 -0.606918 0.968526 -0.0200973 -0.597892 0.967468 -0.019178 -0.589597 0.966374 -0.0181904 -0.582054 0.965264 -0.0171429 -0.575274 0.964162 -0.0160415 -0.569236 0.96307 -0.0148729 -0.56382 0.961903 -0.0135487 -0.558891 0.960508 -0.0119271 -0.554459 0.958818 -0.00993028 -0.550647 0.956913 -0.00758777 -0.547602 0.954964 -0.00496729 -0.545589 0.953271 -0.00218645 -0.545036 0.952565 2.7e-08 -0.545589 0.953271 0.00218652 -0.547602 0.954964 0.0049674 -0.550647 0.956913 0.00758791 -0.554459 0.958818 0.00993044 -0.558891 0.960508 0.0119273 -0.56382 0.961903 0.0135489 -0.569236 0.96307 0.0148731 -0.575274 0.964161 0.0160418 -0.582054 0.965264 0.0171432 -0.589597 0.966374 0.0181907 -0.597892 0.967468 0.0191783 -0.606918 0.968526 0.0200977 -0.616645 0.969529 0.0209425 -0.627034 0.970465 0.0217086 -0.638041 0.971325 0.0223932 -0.649614 0.972098 0.0229929 -0.661691 0.972772 0.0235019 -0.674205 0.973328 0.0239114 -0.687079 0.973744 0.0242092 -0.700231 0.973993 0.024381 -0.713576 0.974051 0.0244127 -0.727028 0.973897 0.0242934 -0.740503 0.973519 0.0240179 -0.753923 0.97292 0.0235892 -0.767215 0.972113 0.0230187 -0.780315 0.971127 0.0223249 -0.793164 0.969994 0.0215317 -0.805706 0.968754 0.020665 -0.817891 0.967441 0.0197492 -0.829671 0.966087 0.0188052 -0.840999 0.964713 0.0178485 -0.851833 0.963335 0.0168898 -0.862137 0.961961 0.0159358 -0.87188 0.960597 0.0149916 -0.881042 0.959248 0.0140615 -0.889613 0.95792 0.0131506 -0.897599 0.95662 0.0122653 -0.905016 0.95536 0.0114129 -0.911898 0.954148 0.0106009 -0.918295 0.952993 0.00983569 -0.924271 0.951903 0.00912302 -0.929904 0.950885 0.00846916 -0.935266 0.94997 0.00789251 -0.940374 0.949266 0.00745199 -0.945867 0.948972 0.00721721 -0.953133 0.948815 0.00706922 -0.965708 0.948732 0.00696008 -0.990856 0.948724 0.00690198 -1.04033 0.948738 0.00687424 -1.13134 0.948719 0.00679357 -1.2882 0.948673 0.00669096 -1.54434 0.948627 0.00664335 -1.94493 0.948608 0.00666393 -2.55015 0.948653 0.00675431 -3.4394 0.948792 0.00695361 -4.7159 0.952789 0.00169575 -0.649304 0.972472 -0.0261953 -0.637698 0.971692 -0.025539 -0.626655 0.970825 -0.0247887 -0.616228 0.969881 -0.023946 -0.606461 0.968871 -0.0230117 -0.597391 0.967808 -0.0219868 -0.589048 0.966711 -0.0208743 -0.581453 0.965601 -0.0196772 -0.574612 0.9645 -0.0183943 -0.568499 0.963409 -0.0170034 -0.562987 0.962253 -0.0154202 -0.557944 0.960901 -0.0135166 -0.553391 0.959295 -0.0112153 -0.549487 0.957518 -0.0085333 -0.546436 0.955761 -0.005538 -0.544553 0.954364 -0.00240947 -0.544095 0.953868 5.5e-08 -0.544553 0.954364 0.00240961 -0.546436 0.955761 0.00553819 -0.549487 0.957518 0.00853354 -0.553391 0.959295 0.0112156 -0.557944 0.960901 0.0135169 -0.562987 0.962253 0.0154206 -0.568499 0.963409 0.0170038 -0.574612 0.9645 0.0183947 -0.581453 0.965601 0.0196777 -0.589048 0.96671 0.0208748 -0.597391 0.967808 0.0219874 -0.606461 0.96887 0.0230123 -0.616228 0.969881 0.0239467 -0.626655 0.970825 0.0247895 -0.637698 0.971692 0.0255398 -0.649304 0.972471 0.0261961 -0.661416 0.973149 0.0267545 -0.673964 0.973708 0.0272079 -0.686874 0.974124 0.0275463 -0.700064 0.974371 0.0277578 -0.713449 0.974425 0.0278304 -0.726942 0.974266 0.0277549 -0.74046 0.973882 0.0275276 -0.753922 0.973277 0.0271517 -0.767256 0.972465 0.0266381 -0.780396 0.971473 0.0260044 -0.79328 0.970337 0.0252732 -0.805855 0.969093 0.0244685 -0.81807 0.967777 0.0236136 -0.829876 0.966419 0.0227283 -0.84123 0.965041 0.0218275 -0.852091 0.963658 0.020922 -0.862422 0.962279 0.0200193 -0.872195 0.96091 0.0191253 -0.881388 0.959557 0.0182456 -0.889994 0.958225 0.0173865 -0.898018 0.956924 0.0165552 -0.905476 0.955663 0.0157594 -0.912404 0.954455 0.0150072 -0.918851 0.953309 0.0143056 -0.92488 0.952236 0.0136618 -0.930566 0.95125 0.0130841 -0.935981 0.95038 0.0125887 -0.94115 0.949708 0.0122045 -0.946718 0.949384 0.0119398 -0.954083 0.949172 0.0117255 -0.966692 0.949041 0.011533 -0.991758 0.949017 0.0113926 -1.04114 0.949033 0.0113075 -1.13212 0.949 0.0111699 -1.28902 0.94892 0.0110057 -1.54527 0.948842 0.0109257 -1.94601 0.948814 0.0109516 -2.55133 0.948891 0.0110783 -3.44049 0.949124 0.0113467 -4.7159 0.955529 0.00276264 -0.648696 0.973328 -0.0311347 -0.637025 0.97253 -0.030384 -0.625916 0.971642 -0.0295248 -0.615417 0.970676 -0.0285555 -0.605573 0.969644 -0.0274729 -0.596419 0.968561 -0.0262737 -0.587985 0.967446 -0.0249546 -0.580289 0.966323 -0.0235115 -0.573335 0.965209 -0.0219355 -0.567091 0.964108 -0.0201991 -0.561429 0.962959 -0.0182232 -0.556226 0.96165 -0.0158899 -0.55152 0.960135 -0.0131234 -0.547504 0.958499 -0.00993589 -0.544434 0.956943 -0.00640883 -0.542626 0.955788 -0.00278803 -0.542197 0.955399 1.17e-07 -0.542626 0.955788 0.0027883 -0.544434 0.956943 0.00640918 -0.547504 0.958499 0.00993632 -0.55152 0.960134 0.0131239 -0.556226 0.96165 0.0158905 -0.561429 0.962959 0.0182239 -0.56709 0.964108 0.0201998 -0.573335 0.965208 0.0219363 -0.580289 0.966322 0.0235124 -0.587985 0.967446 0.0249555 -0.596419 0.96856 0.0262748 -0.605573 0.969643 0.0274741 -0.615417 0.970675 0.0285567 -0.625916 0.971641 0.0295261 -0.637025 0.972529 0.0303854 -0.648696 0.973327 0.0311362 -0.66087 0.97402 0.0317774 -0.67348 0.97459 0.0323052 -0.686454 0.975014 0.0327131 -0.699709 0.975266 0.0329926 -0.713161 0.975322 0.0331352 -0.726724 0.975162 0.0331346 -0.740312 0.974777 0.0329886 -0.753844 0.97417 0.0327012 -0.767246 0.973357 0.0322828 -0.78045 0.972365 0.0317494 -0.793396 0.97123 0.0311213 -0.806027 0.969988 0.0304203 -0.818294 0.968673 0.0296678 -0.830151 0.967315 0.0288818 -0.841553 0.965937 0.0280767 -0.852464 0.964553 0.0272633 -0.862847 0.963173 0.0264501 -0.872675 0.961803 0.0256444 -0.88193 0.960449 0.0248531 -0.890604 0.959119 0.0240837 -0.898702 0.957822 0.0233439 -0.906244 0.95657 0.0226416 -0.913265 0.955375 0.0219846 -0.919814 0.954249 0.0213794 -0.925956 0.953204 0.020832 -0.931765 0.952253 0.020348 -0.937316 0.95142 0.0199336 -0.94265 0.950765 0.0195956 -0.948403 0.950422 0.0193135 -0.955953 0.950169 0.0190399 -0.968645 0.949984 0.018745 -0.993579 0.949925 0.0184708 -1.04275 0.949933 0.0182712 -1.13361 0.949871 0.0180389 -1.29051 0.949734 0.0177852 -1.54689 0.949604 0.017657 -1.94782 0.949562 0.0176876 -2.55327 0.949692 0.0178569 -3.44224 0.950075 0.0181948 -4.7159 0.960092 0.0045102 -0.647481 0.97524 -0.0385937 -0.635687 0.974395 -0.0376878 -0.624446 0.973455 -0.0366506 -0.613808 0.972433 -0.035475 -0.603814 0.971343 -0.0341515 -0.594498 0.970203 -0.0326692 -0.585889 0.969033 -0.0310165 -0.578002 0.967856 -0.0291814 -0.570842 0.966692 -0.027149 -0.564377 0.96555 -0.0248916 -0.558488 0.964381 -0.0223348 -0.553062 0.963087 -0.0193662 -0.548156 0.961627 -0.0159139 -0.543989 0.960088 -0.0119973 -0.540839 0.958654 -0.00772227 -0.539001 0.9576 -0.00338633 -0.538543 0.957228 2.5e-07 -0.539001 0.9576 0.00338687 -0.540839 0.958654 0.00772293 -0.543988 0.960088 0.0119981 -0.548156 0.961627 0.0159148 -0.553062 0.963086 0.0193672 -0.558488 0.96438 0.0223359 -0.564376 0.965549 0.0248928 -0.570842 0.966691 0.0271504 -0.578002 0.967855 0.0291829 -0.585888 0.969032 0.0310182 -0.594498 0.970202 0.032671 -0.603814 0.971342 0.0341535 -0.613808 0.972432 0.0354772 -0.624446 0.973453 0.0366529 -0.635687 0.974394 0.0376903 -0.647481 0.975239 0.0385964 -0.659774 0.975974 0.0393751 -0.672501 0.97658 0.0400277 -0.685589 0.977033 0.0405529 -0.698959 0.977309 0.0409473 -0.712527 0.977384 0.0412073 -0.726207 0.977242 0.0413306 -0.739912 0.976874 0.0413176 -0.753561 0.976283 0.0411733 -0.767077 0.975488 0.0409074 -0.780391 0.974516 0.0405339 -0.793442 0.973401 0.0400698 -0.806174 0.972179 0.0395342 -0.818537 0.970884 0.0389452 -0.830488 0.969545 0.0383193 -0.841986 0.968183 0.0376696 -0.852993 0.966815 0.0370071 -0.863479 0.965449 0.0363412 -0.87342 0.964095 0.0356804 -0.882797 0.962758 0.0350329 -0.891607 0.961448 0.0344064 -0.899857 0.960176 0.0338085 -0.907568 0.958952 0.0332458 -0.914776 0.957789 0.032724 -0.921534 0.956698 0.032247 -0.927905 0.95569 0.0318169 -0.933967 0.954774 0.031434 -0.9398 0.953967 0.0310964 -0.945449 0.953323 0.0307996 -0.951539 0.952972 0.0305052 -0.959422 0.952694 0.0301816 -0.972323 0.952463 0.0297813 -0.997124 0.952345 0.0293284 -1.04592 0.952311 0.0289358 -1.13646 0.952191 0.0285532 -1.29326 0.951955 0.0281778 -1.54973 0.951741 0.0279851 -1.95087 0.95168 0.0280187 -2.55644 0.951895 0.0282304 -3.44501 0.952511 0.0286119 -4.7159 0.96769 0.0073769 -0.645017 0.979375 -0.0495964 -0.632978 0.978418 -0.0484352 -0.62148 0.977356 -0.0471071 -0.610567 0.976204 -0.0455964 -0.600279 0.974979 -0.0438839 -0.590651 0.973699 -0.0419487 -0.581711 0.972386 -0.0397703 -0.573478 0.971066 -0.0373302 -0.56596 0.969763 -0.0346124 -0.559137 0.968495 -0.031593 -0.552902 0.967218 -0.0282012 -0.547157 0.965839 -0.0243271 -0.541967 0.964313 -0.0199055 -0.537558 0.962716 -0.0149708 -0.534211 0.961215 -0.00965174 -0.532214 0.960069 -0.00428364 -0.531673 0.959629 5.39e-07 -0.532213 0.960069 0.00428477 -0.534211 0.961215 0.00965302 -0.537557 0.962715 0.0149722 -0.541966 0.964312 0.0199072 -0.547157 0.965838 0.024329 -0.552902 0.967217 0.0282033 -0.559136 0.968493 0.0315952 -0.56596 0.969762 0.0346149 -0.573477 0.971064 0.0373329 -0.58171 0.972385 0.0397733 -0.590651 0.973697 0.041952 -0.600279 0.974978 0.0438875 -0.610566 0.976202 0.0456003 -0.62148 0.977354 0.0471113 -0.632979 0.978416 0.0484396 -0.645017 0.979373 0.0496011 -0.657541 0.980209 0.050608 -0.670489 0.980905 0.0514691 -0.683792 0.98144 0.0521905 -0.697372 0.981789 0.0527762 -0.711148 0.981932 0.053229 -0.725033 0.981855 0.0535517 -0.738941 0.981552 0.0537484 -0.752791 0.981028 0.0538254 -0.766504 0.980302 0.0537918 -0.780012 0.979401 0.0536591 -0.793251 0.978357 0.0534412 -0.806168 0.977208 0.0531528 -0.818714 0.975983 0.052809 -0.830849 0.974712 0.0524234 -0.842534 0.973415 0.052008 -0.853738 0.97211 0.0515735 -0.864433 0.970807 0.0511296 -0.874599 0.969515 0.0506852 -0.884223 0.968242 0.0502483 -0.893304 0.966998 0.049826 -0.901854 0.965791 0.0494238 -0.909894 0.964633 0.0490458 -0.917463 0.963533 0.048694 -0.924613 0.9625 0.0483688 -0.93141 0.961542 0.0480684 -0.937929 0.960666 0.0477896 -0.944252 0.959885 0.0475267 -0.950421 0.959252 0.047268 -0.957049 0.958901 0.0469577 -0.965483 0.95861 0.0465833 -0.978828 0.95834 0.0460794 -1.00364 0.958135 0.0454279 -1.0519 0.957996 0.0447685 -1.14184 0.957758 0.0441689 -1.29828 0.957365 0.0436445 -1.55473 0.957017 0.043378 -1.95601 0.956928 0.0434136 -2.56156 0.957276 0.0436526 -3.44932 0.958238 0.0439975 -4.7159 0.980336 0.0120843 -0.639919 0.987975 -0.0653926 -0.627402 0.986772 -0.0638051 -0.615397 0.985447 -0.0619955 -0.603949 0.984016 -0.059936 -0.593101 0.982495 -0.0575962 -0.582889 0.980905 -0.0549462 -0.57335 0.979272 -0.0519597 -0.564514 0.977625 -0.0486181 -0.556402 0.975997 -0.0449095 -0.549009 0.974409 -0.0408165 -0.542245 0.972822 -0.0362707 -0.536017 0.971133 -0.031162 -0.53039 0.969289 -0.0254308 -0.525587 0.967359 -0.0191227 -0.521889 0.96552 -0.0123799 -0.519605 0.964069 -0.00557081 -0.518932 0.963477 1.151e-06 -0.519604 0.964069 0.00557318 -0.521888 0.96552 0.0123825 -0.525586 0.967358 0.0191255 -0.530389 0.969287 0.025434 -0.536016 0.971132 0.0311655 -0.542244 0.97282 0.0362745 -0.549008 0.974407 0.0408207 -0.556401 0.975995 0.044914 -0.564513 0.977623 0.048623 -0.573349 0.979269 0.0519651 -0.582888 0.980902 0.0549521 -0.5931 0.982492 0.0576027 -0.603949 0.984013 0.059943 -0.615397 0.985444 0.0620031 -0.627402 0.986769 0.0638133 -0.639919 0.987971 0.0654013 -0.652896 0.989035 0.0667911 -0.666276 0.989941 0.0680026 -0.679992 0.99067 0.069052 -0.69397 0.991203 0.0699527 -0.708131 0.991523 0.0707158 -0.722392 0.991619 0.0713504 -0.73667 0.99149 0.0718652 -0.750883 0.991143 0.0722686 -0.764954 0.990598 0.0725694 -0.778816 0.98988 0.0727772 -0.792407 0.989022 0.0729022 -0.805674 0.988057 0.0729554 -0.818574 0.987014 0.0729481 -0.831069 0.98592 0.072891 -0.843126 0.984796 0.0727943 -0.854719 0.983657 0.0726676 -0.865826 0.982517 0.0725198 -0.876434 0.981384 0.072359 -0.886533 0.980265 0.0721918 -0.896128 0.979168 0.0720232 -0.90523 0.9781 0.0718562 -0.913865 0.977069 0.071692 -0.922069 0.976081 0.0715298 -0.929893 0.975143 0.0713671 -0.937398 0.97426 0.0712004 -0.94466 0.973439 0.0710248 -0.951755 0.972692 0.070833 -0.958721 0.972074 0.0706064 -0.966168 0.971717 0.0702692 -0.975459 0.971406 0.0698332 -0.989611 0.971086 0.069222 -1.01481 0.970763 0.0683777 -1.06261 0.970441 0.0674232 -1.15161 0.970002 0.0665554 -1.30731 0.969378 0.0658735 -1.56343 0.968838 0.0655442 -1.96462 0.968713 0.065585 -2.56981 0.969255 0.0658103 -3.45594 0.970702 0.0659428 -4.7159 1.00138 0.0198196 -0.629136 1.00514 -0.0873009 -0.615693 1.00342 -0.084992 -0.602723 1.00155 -0.082378 -0.590278 0.999551 -0.0794209 -0.578409 0.997429 -0.0760845 -0.56717 0.995213 -0.0723377 -0.556612 0.992934 -0.0681583 -0.546786 0.990628 -0.0635351 -0.537729 0.988335 -0.058464 -0.529452 0.986087 -0.0529323 -0.52188 0.983843 -0.0468694 -0.514921 0.981491 -0.0401601 -0.508639 0.97897 -0.0327423 -0.503255 0.976366 -0.0246604 -0.499055 0.973896 -0.0160572 -0.496383 0.971932 -0.00733228 -0.495539 0.971109 2.398e-06 -0.496383 0.971932 0.00733716 -0.499054 0.973895 0.0160623 -0.503253 0.976365 0.0246659 -0.508637 0.978968 0.0327483 -0.514919 0.981489 0.0401666 -0.521877 0.983841 0.0468765 -0.52945 0.986084 0.0529401 -0.537726 0.988332 0.0584725 -0.546783 0.990624 0.0635444 -0.55661 0.99293 0.0681685 -0.567168 0.995209 0.0723488 -0.578407 0.997425 0.0760967 -0.590276 0.999547 0.0794341 -0.602722 1.00155 0.0823922 -0.615692 1.00342 0.0850074 -0.629135 1.00513 0.0873175 -0.642998 1.00667 0.0893587 -0.657222 1.00803 0.0911641 -0.671745 1.00919 0.0927628 -0.686497 1.01013 0.0941797 -0.701404 1.01085 0.0954357 -0.716387 1.01133 0.096548 -0.731368 1.01159 0.097531 -0.74627 1.01164 0.0983964 -0.76102 1.01148 0.0991539 -0.775554 1.01115 0.0998123 -0.789815 1.01068 0.10038 -0.803756 1.0101 0.100864 -0.817336 1.00943 0.101275 -0.830524 1.0087 0.101619 -0.843295 1.00793 0.101905 -0.855629 1.00713 0.102142 -0.867509 1.00631 0.102336 -0.878928 1.00547 0.102495 -0.889882 1.00464 0.102625 -0.900377 1.0038 0.102727 -0.910426 1.00297 0.102805 -0.920053 1.00214 0.102858 -0.929292 1.00132 0.102884 -0.938189 1.00053 0.102879 -0.946804 0.999748 0.10284 -0.955207 0.998999 0.102762 -0.963473 0.998295 0.102636 -0.971633 0.997689 0.102436 -0.980306 0.997314 0.102065 -0.990905 0.996961 0.101563 -1.00641 0.996564 0.100849 -1.03266 0.9961 0.0998445 -1.08053 0.995547 0.0986372 -1.16853 0.994849 0.0975049 -1.32301 0.993963 0.0966845 -1.57827 0.993203 0.0963294 -1.97884 0.993045 0.0963837 -2.58292 0.993851 0.0965198 -3.46599 0.995931 0.0961133 -4.7159 1.0364 0.032537 -0.606105 1.0378 -0.11625 -0.590969 1.03509 -0.112757 -0.576284 1.03217 -0.108856 -0.562123 1.02907 -0.104511 -0.548559 1.02583 -0.0996932 -0.535668 1.02247 -0.0943826 -0.523524 1.01903 -0.0885682 -0.512196 1.01557 -0.0822472 -0.50174 1.01214 -0.0754189 -0.492181 1.00878 -0.0680671 -0.483452 1.00545 -0.0601107 -0.475471 1.00204 -0.0514236 -0.468303 0.998471 -0.0419322 -0.46217 0.994873 -0.0316653 -0.457367 0.991512 -0.020753 -0.454261 0.988861 -0.00961922 -0.453231 0.987733 4.733e-06 -0.45426 0.98886 0.00962878 -0.457365 0.991511 0.0207629 -0.462167 0.994871 0.0316758 -0.468299 0.998469 0.0419435 -0.475468 1.00203 0.0514358 -0.483448 1.00545 0.060124 -0.492176 1.00877 0.0680816 -0.501735 1.01213 0.0754349 -0.512191 1.01557 0.0822647 -0.523519 1.01903 0.0885875 -0.535663 1.02246 0.0944037 -0.548555 1.02582 0.0997164 -0.562119 1.02907 0.104536 -0.576281 1.03216 0.108883 -0.590967 1.03508 0.112787 -0.606104 1.03779 0.116282 -0.621625 1.04029 0.11941 -0.637461 1.04256 0.12221 -0.653544 1.04459 0.124721 -0.669805 1.04637 0.12698 -0.686171 1.04789 0.129017 -0.702568 1.04915 0.13086 -0.718925 1.05017 0.132528 -0.735169 1.05096 0.134041 -0.751238 1.05153 0.135411 -0.767071 1.05191 0.13665 -0.782621 1.05214 0.137765 -0.797848 1.05222 0.138767 -0.812719 1.05219 0.139663 -0.82721 1.05207 0.140461 -0.841302 1.05188 0.14117 -0.854984 1.05162 0.141798 -0.868246 1.0513 0.142353 -0.881085 1.05093 0.142842 -0.893501 1.05052 0.143271 -0.905503 1.05006 0.143645 -0.917103 1.04955 0.143964 -0.928325 1.04901 0.144231 -0.9392 1.04843 0.144443 -0.949773 1.04782 0.144599 -0.960101 1.04719 0.144694 -0.970253 1.04654 0.144725 -0.980305 1.0459 0.144679 -0.990282 1.04532 0.144525 -1.00083 1.04493 0.144141 -1.01346 1.04454 0.1436 -1.03118 1.04407 0.142828 -1.05956 1.0435 0.141746 -1.10871 1.04277 0.140411 -1.19637 1.04188 0.13911 -1.34942 1.04083 0.138202 -1.60312 1.03994 0.137868 -2.00212 1.03981 0.137943 -2.60368 1.04095 0.137875 -3.48118 1.04383 0.136363 -4.7159 1.09467 0.0534526 -0.55845 1.09684 -0.152486 -0.540543 1.09233 -0.147256 -0.523147 1.08759 -0.141529 -0.506358 1.08264 -0.135282 -0.490277 1.07755 -0.128501 -0.474998 1.07235 -0.121177 -0.460614 1.06711 -0.113305 -0.447206 1.06189 -0.104884 -0.434842 1.05677 -0.0959058 -0.423557 1.0518 -0.0863427 -0.413294 1.04695 -0.0760983 -0.403981 1.04208 -0.0650338 -0.395692 1.03714 -0.0530597 -0.388659 1.03228 -0.0401804 -0.383181 1.02781 -0.0265032 -0.379629 1.02433 -0.012465 -0.37842 1.02283 8.625e-06 -0.379628 1.02433 0.0124824 -0.383178 1.02781 0.026521 -0.388656 1.03227 0.0401992 -0.395687 1.03714 0.0530799 -0.403975 1.04208 0.0650557 -0.413288 1.04695 0.0761223 -0.42355 1.0518 0.0863692 -0.434835 1.05676 0.095935 -0.4472 1.06188 0.104916 -0.460608 1.0671 0.113341 -0.474992 1.07234 0.121216 -0.490272 1.07754 0.128545 -0.506354 1.08264 0.13533 -0.523143 1.08757 0.141581 -0.540541 1.09232 0.147313 -0.558449 1.09682 0.152548 -0.576773 1.10106 0.157315 -0.595419 1.10502 0.16165 -0.614298 1.10866 0.165587 -0.633324 1.11199 0.169166 -0.652413 1.11499 0.172421 -0.671485 1.11768 0.175383 -0.690465 1.12005 0.178082 -0.709282 1.12213 0.18054 -0.727876 1.12394 0.182778 -0.746194 1.12549 0.184812 -0.764196 1.12682 0.186658 -0.781848 1.12796 0.188328 -0.799128 1.12892 0.189835 -0.816019 1.12972 0.191193 -0.832513 1.13037 0.192413 -0.848604 1.1309 0.193508 -0.864291 1.13131 0.194489 -0.879579 1.1316 0.195366 -0.894472 1.13178 0.19615 -0.908983 1.13185 0.196846 -0.923129 1.13182 0.197462 -0.936934 1.13168 0.197998 -0.950434 1.13146 0.198457 -0.963673 1.13115 0.198837 -0.976713 1.13076 0.199135 -0.989629 1.13031 0.199347 -1.0025 1.12982 0.199459 -1.01535 1.12934 0.199429 -1.02889 1.12903 0.199112 -1.04476 1.12869 0.198622 -1.06613 1.12828 0.197909 -1.09843 1.12777 0.196912 -1.15101 1.12712 0.195677 -1.24035 1.12633 0.194437 -1.39276 1.12545 0.193571 -1.64437 1.12472 0.19331 -2.04033 1.12482 0.193396 -2.63689 1.12644 0.192951 -3.50442 1.13039 0.189327 -4.7159 1.1916 0.0878603 -0.466638 1.19944 -0.19714 -0.444585 1.19209 -0.189654 -0.423219 1.18449 -0.181603 -0.402658 1.17672 -0.172977 -0.383018 1.16884 -0.163769 -0.364407 1.16092 -0.153974 -0.346927 1.15304 -0.143587 -0.330667 1.14531 -0.1326 -0.315701 1.13779 -0.120993 -0.302071 1.13058 -0.10872 -0.289732 1.12364 -0.0956714 -0.278629 1.11683 -0.0816972 -0.268859 1.11009 -0.0666919 -0.260669 1.10362 -0.050631 -0.254364 1.0978 -0.0335946 -0.250312 1.09332 -0.016022 -0.248923 1.09137 1.4427e-05 -0.25031 1.09332 0.0160509 -0.25436 1.0978 0.0336244 -0.260663 1.10362 0.0506623 -0.268852 1.11009 0.0667255 -0.278621 1.11683 0.081734 -0.289724 1.12364 0.0957119 -0.302062 1.13058 0.108766 -0.315692 1.13779 0.121043 -0.330659 1.1453 0.132656 -0.34692 1.15304 0.14365 -0.364401 1.16091 0.154044 -0.383013 1.16883 0.163847 -0.402656 1.17671 0.173064 -0.423219 1.18448 0.181699 -0.444589 1.19208 0.189759 -0.466645 1.19943 0.197255 -0.489266 1.20649 0.204205 -0.512333 1.21321 0.21063 -0.535726 1.21955 0.216557 -0.559329 1.22548 0.222014 -0.58303 1.23099 0.227031 -0.606722 1.23606 0.231638 -0.63031 1.24071 0.235861 -0.653707 1.24494 0.239727 -0.67684 1.24877 0.243261 -0.69965 1.25222 0.246484 -0.722091 1.25533 0.249418 -0.744132 1.25812 0.252083 -0.765752 1.26062 0.254501 -0.786941 1.26285 0.25669 -0.807697 1.26483 0.258672 -0.828023 1.26657 0.260466 -0.847927 1.2681 0.26209 -0.867423 1.26942 0.263561 -0.886526 1.27053 0.264894 -0.905258 1.27146 0.266103 -0.923647 1.2722 0.267197 -0.941727 1.27277 0.268183 -0.959544 1.27317 0.269066 -0.977155 1.27343 0.269848 -0.994636 1.27354 0.270526 -1.01208 1.27354 0.271096 -1.02957 1.27344 0.271543 -1.04716 1.2733 0.271809 -1.06564 1.27331 0.271722 -1.08689 1.2733 0.271456 -1.11434 1.27326 0.271006 -1.15345 1.27319 0.27035 -1.21302 1.2731 0.269538 -1.30795 1.273 0.268734 -1.4627 1.27291 0.268208 -1.71283 1.273 0.268147 -2.10391 1.27381 0.268211 -2.69118 1.27622 0.267065 -3.54081 1.28192 0.259496 -4.7159 1.35287 0.144474 -0.301186 1.37572 -0.255376 -0.272813 1.36398 -0.244982 -0.245432 1.35203 -0.233949 -0.21918 1.33995 -0.22227 -0.194188 1.32785 -0.209944 -0.170575 1.31583 -0.196966 -0.14845 1.30401 -0.183325 -0.127908 1.29251 -0.169002 -0.109032 1.28144 -0.153963 -0.0918712 1.27091 -0.138142 -0.0763977 1.2609 -0.121414 -0.0625865 1.25125 -0.103621 -0.0505721 1.24195 -0.0846401 -0.040636 1.23324 -0.06441 -0.0331055 1.22559 -0.042977 -0.0283451 1.21979 -0.0207745 -0.0267263 1.21726 2.2307e-05 -0.0283425 1.21979 0.0208192 -0.0331004 1.22559 0.043023 -0.0406289 1.23324 0.0644584 -0.0505634 1.24195 0.0846924 -0.0625767 1.25126 0.103679 -0.0763875 1.2609 0.121478 -0.0918611 1.27092 0.138214 -0.109022 1.28145 0.154044 -0.127901 1.29252 0.169094 -0.148444 1.30402 0.183428 -0.170573 1.31584 0.197081 -0.19419 1.32785 0.210074 -0.219187 1.33995 0.222416 -0.245444 1.35203 0.234111 -0.272832 1.36398 0.245162 -0.301212 1.37572 0.255576 -0.330441 1.38715 0.265359 -0.360369 1.39819 0.274525 -0.390846 1.40877 0.28309 -0.421717 1.41883 0.291075 -0.452834 1.42834 0.298499 -0.484052 1.43725 0.305387 -0.515234 1.44556 0.311761 -0.546261 1.45326 0.317646 -0.577027 1.46037 0.323065 -0.607445 1.4669 0.328044 -0.63745 1.4729 0.332606 -0.666993 1.47838 0.33678 -0.696045 1.48338 0.340593 -0.724591 1.48793 0.344073 -0.752628 1.49207 0.347249 -0.780166 1.49581 0.350149 -0.807222 1.49919 0.352802 -0.833822 1.50223 0.355232 -0.859999 1.50493 0.357464 -0.885792 1.50733 0.359519 -0.911252 1.50944 0.361413 -0.936437 1.51127 0.36316 -0.96142 1.51284 0.36477 -0.986289 1.51417 0.366249 -1.01115 1.51529 0.367597 -1.03614 1.51622 0.368812 -1.06138 1.51698 0.369875 -1.08694 1.51765 0.370712 -1.11375 1.51845 0.371108 -1.14406 1.51926 0.371327 -1.18168 1.52012 0.371419 -1.23227 1.52112 0.371413 -1.30422 1.52229 0.37138 -1.41093 1.52366 0.371422 -1.57399 1.52525 0.371646 -1.82593 1.5271 0.37203 -2.21056 1.52955 0.371998 -2.78135 1.53357 0.36943 -3.59906 1.54276 0.355089 -4.7159 1.62116 0.237641 -0.0137548 1.68007 -0.338575 --0.0249527 1.66131 -0.324093 --0.0621804 1.64236 -0.308853 --0.0977619 1.62337 -0.292857 --0.131545 1.6045 -0.276106 --0.163391 1.5859 -0.258596 --0.19318 1.56774 -0.240311 --0.220802 1.55017 -0.22122 --0.246167 1.53337 -0.201269 --0.269209 1.51749 -0.180369 --0.289932 1.50254 -0.158376 --0.308315 1.48838 -0.135126 --0.324161 1.47506 -0.110462 --0.337119 1.46289 -0.0842708 --0.346799 1.45248 -0.0565448 --0.352805 1.44476 -0.027699 --0.354812 1.4414 3.1415e-05 --0.352808 1.44476 0.027762 --0.346805 1.45249 0.0566095 --0.337127 1.4629 0.0843391 --0.324169 1.47507 0.110536 --0.308324 1.4884 0.135208 --0.28994 1.50255 0.158468 --0.269217 1.51751 0.180473 --0.246172 1.5334 0.201388 --0.220803 1.55019 0.221355 --0.193175 1.56776 0.240465 --0.16338 1.58593 0.258771 --0.131525 1.60453 0.276305 --0.0977314 1.6234 0.293083 --0.0621381 1.64239 0.309107 --0.024897 1.66134 0.324378 -0.0138254 1.6801 0.338894 -0.0538506 1.69853 0.352654 -0.0949892 1.71649 0.365663 -0.137044 1.73388 0.377928 -0.179811 1.75057 0.389461 -0.223086 1.7665 0.400276 -0.266667 1.78159 0.410388 -0.310363 1.7958 0.419819 -0.353996 1.8091 0.428588 -0.397407 1.82151 0.436718 -0.440464 1.83303 0.444236 -0.483057 1.8437 0.451172 -0.525107 1.85354 0.457558 -0.566556 1.8626 0.463428 -0.607374 1.87094 0.468821 -0.64755 1.87859 0.473776 -0.687095 1.88559 0.478331 -0.726035 1.892 0.482528 -0.764415 1.89785 0.486403 -0.802294 1.90318 0.489992 -0.839748 1.90803 0.493327 -0.87687 1.91242 0.496435 -0.913767 1.91639 0.499341 -0.95057 1.91998 0.502061 -0.987431 1.92321 0.50461 -1.02453 1.92612 0.506995 -1.06207 1.92874 0.509214 -1.10028 1.93112 0.511247 -1.1393 1.93335 0.513003 -1.18026 1.93569 0.514213 -1.22581 1.93806 0.515241 -1.28025 1.94061 0.516196 -1.34952 1.94346 0.517151 -1.4416 1.9467 0.518184 -1.56837 1.9504 0.519336 -1.74797 1.95456 0.520542 -2.00749 1.95923 0.521463 -2.38477 1.96466 0.520986 -2.92808 1.97213 0.515683 -3.69181 1.98809 0.492869 -4.7159 2.06749 0.390981 --0.477179 2.20977 -0.466442 --0.533622 2.1791 -0.445698 --0.587795 2.14825 -0.423985 --0.639472 2.11745 -0.401318 --0.688452 2.08696 -0.377712 --0.734556 2.05703 -0.353168 --0.777635 2.02791 -0.327674 --0.817557 1.99986 -0.301191 --0.854214 1.97314 -0.273646 --0.88752 1.94797 -0.244921 --0.91744 1.92445 -0.214854 --0.943895 1.90254 -0.183261 --0.966597 1.88238 -0.149937 --0.985073 1.86448 -0.114672 --0.998783 1.84962 -0.0773696 --1.0072 1.83896 -0.038399 --1.00997 1.83444 3.6809e-05 --1.0072 1.83896 0.0384728 --0.998786 1.84963 0.0774455 --0.985077 1.8645 0.114752 --0.966601 1.88241 0.150025 --0.943898 1.90257 0.18336 --0.917441 1.92449 0.214965 --0.887516 1.94801 0.245049 --0.854204 1.97319 0.273793 --0.817539 1.99992 0.301361 --0.777606 2.02797 0.327871 --0.734514 2.05709 0.353394 --0.688393 2.08703 0.377972 --0.639394 2.11752 0.401616 --0.587694 2.14833 0.424324 --0.533495 2.17919 0.446084 --0.477023 2.20986 0.466879 --0.418526 2.24011 0.486696 --0.358271 2.26972 0.505525 --0.29654 2.29848 0.523362 --0.233627 2.32621 0.540208 --0.169829 2.35278 0.556073 --0.105443 2.37806 0.570967 --0.040753 2.40197 0.584908 -0.0239745 2.42446 0.597917 -0.0884982 2.4455 0.610023 -0.152609 2.46512 0.621258 -0.216132 2.48334 0.631659 -0.278932 2.50021 0.64127 -0.34091 2.51579 0.650138 -0.402006 2.53016 0.658315 -0.462194 2.5434 0.665856 -0.521484 2.55557 0.672815 -0.579919 2.56676 0.67925 -0.637572 2.57705 0.685215 -0.69455 2.5865 0.690762 -0.750991 2.59519 0.695939 -0.807065 2.60318 0.700789 -0.862974 2.61055 0.705352 -0.918958 2.61734 0.709657 -0.975291 2.62361 0.713732 -1.03229 2.62943 0.717592 -1.09033 2.63485 0.721246 -1.14979 2.63993 0.724677 -1.21099 2.64478 0.727781 -1.27531 2.6497 0.730248 -1.34575 2.65467 0.732516 -1.42689 2.65986 0.734731 -1.52457 2.66547 0.736979 -1.64599 2.67161 0.739306 -1.80094 2.67836 0.741655 -2.00341 2.68584 0.743772 -2.27359 2.69422 0.744989 -2.64029 2.70407 0.743677 -3.14274 2.71742 0.735775 -3.8272 2.74208 0.710664 -4.7159 2.80998 0.643384 --1.30332 3.15226 -0.675531 --1.39271 3.09973 -0.644786 --1.47843 3.04683 -0.612587 --1.56008 2.99402 -0.578989 --1.63733 2.94177 -0.544042 --1.70991 2.89053 -0.50779 --1.77761 2.84077 -0.470253 --1.84024 2.79293 -0.431416 --1.89767 2.74744 -0.391215 --1.94981 2.7047 -0.349527 --1.99659 2.66502 -0.306176 --2.03788 2.62859 -0.260952 --2.0733 2.59584 -0.213559 --2.10225 2.56756 -0.163641 --2.1239 2.54492 -0.11095 --2.13732 2.52943 -0.0557469 --2.1418 2.52328 2.7289e-05 --2.13732 2.52944 0.0558018 --2.1239 2.54493 0.111007 --2.10225 2.56758 0.163702 --2.0733 2.59587 0.213626 --2.03787 2.62863 0.261028 --1.99658 2.66506 0.306264 --1.9498 2.70476 0.34963 --1.89765 2.7475 0.391336 --1.8402 2.793 0.431557 --1.77756 2.84085 0.470419 --1.70985 2.89062 0.507985 --1.63724 2.94187 0.544269 --1.55996 2.99414 0.579253 --1.47828 3.04696 0.612893 --1.39253 3.09987 0.645139 --1.3031 3.15241 0.675937 --1.21042 3.20415 0.705243 --1.11497 3.25467 0.733024 --1.01725 3.30361 0.759265 --0.917796 3.35064 0.783962 --0.817138 3.3955 0.80713 --0.715802 3.43799 0.828795 --0.61429 3.47797 0.848999 --0.513065 3.51535 0.867793 --0.412538 3.55014 0.885238 --0.313059 3.58235 0.901405 --0.21491 3.61206 0.916369 --0.118307 3.63939 0.930214 --0.0233931 3.66447 0.943024 -0.0697554 3.68745 0.954886 -0.161126 3.70849 0.965887 -0.250765 3.72775 0.976113 -0.338777 3.74539 0.985647 -0.425319 3.76157 0.994567 -0.510598 3.77644 1.00295 -0.594867 3.79013 1.01085 -0.678431 3.80279 1.01835 -0.761638 3.81452 1.02548 -0.844888 3.82544 1.0323 -0.928633 3.83565 1.03885 -1.01338 3.84525 1.04516 -1.09972 3.85432 1.05124 -1.18827 3.86295 1.0571 -1.27967 3.87125 1.06265 -1.3754 3.87947 1.06767 -1.47819 3.88765 1.07253 -1.59192 3.89596 1.07735 -1.7213 3.90456 1.08222 -1.87187 3.91358 1.08712 -2.05097 3.92316 1.09195 -2.269 3.93349 1.09642 -2.54127 3.94493 1.09993 -2.89059 3.95824 1.10129 -3.34975 3.97526 1.09804 -3.95691 4.00078 1.08562 -4.7159 4.04517 1.05889 --2.69419 4.97324 -1.06009 --2.86646 4.87059 -1.01681 --3.03003 4.7679 -0.970104 --3.18417 4.66632 -0.919917 --3.32831 4.56699 -0.86622 --3.46203 4.47091 -0.809028 --3.58504 4.37899 -0.748404 --3.69718 4.29197 -0.684456 --3.79842 4.21042 -0.617343 --3.88887 4.13469 -0.54727 --3.96873 4.06494 -0.47449 --4.03838 4.00108 -0.399298 --4.09827 3.94275 -0.32203 --4.14905 3.88936 -0.243055 --4.19148 3.84003 -0.162774 --4.2265 3.79362 -0.0816101 --4.25523 3.74867 0 --4.2265 3.79362 0.0816101 --4.19148 3.84003 0.162774 --4.14905 3.88936 0.243055 --4.09827 3.94275 0.32203 --4.03838 4.00108 0.399298 --3.96873 4.06494 0.47449 --3.88887 4.13469 0.54727 --3.79842 4.21042 0.617343 --3.69718 4.29197 0.684456 --3.58504 4.37899 0.748404 --3.46203 4.47091 0.809028 --3.32831 4.56699 0.86622 --3.18417 4.66632 0.919917 --3.03003 4.7679 0.970104 --2.86646 4.87059 1.01681 --2.69419 4.97324 1.06009 --2.51408 5.07465 1.10007 --2.32716 5.17365 1.13686 --2.13459 5.26911 1.17065 --1.93765 5.36002 1.20159 --1.73777 5.44546 1.22992 --1.53644 5.52468 1.25582 --1.33523 5.59712 1.27952 --1.13574 5.66237 1.30126 --0.939587 5.72026 1.32124 --0.74835 5.7708 1.33969 --0.563544 5.81417 1.35682 --0.386588 5.85074 1.37282 --0.218774 5.88102 1.38788 --0.0612459 5.90563 1.40217 -0.0850289 5.92528 1.41586 -0.219273 5.94071 1.42907 -0.340917 5.9527 1.44215 -0.44961 5.962 1.45523 -0.545222 5.96929 1.46831 -0.627857 5.97554 1.48139 -0.697869 5.98176 1.49446 -0.755852 5.98798 1.50754 -0.802651 5.99421 1.52062 -0.839377 6.00043 1.5337 -0.867425 6.00665 1.54678 -0.888483 6.01287 1.55986 -0.904559 6.0191 1.57294 -0.917985 6.02532 1.58602 -0.931823 6.03154 1.59909 -0.951373 6.03776 1.61217 -0.983839 6.04399 1.62525 -1.03847 6.05021 1.63833 -1.12714 6.05643 1.65141 -1.26511 6.06265 1.66449 -1.47194 6.06888 1.67757 -1.77279 6.0751 1.69065 -2.19994 6.08132 1.70373 -2.79484 6.08754 1.7168 -3.61071 6.09377 1.72988 -4.7159 6.09999 1.74296 -0.660545 0.992744 -0.0174601 -0.649185 0.991955 -0.0169442 -0.63838 0.991079 -0.0163571 -0.628185 0.990124 -0.0157045 -0.618643 0.989099 -0.0149916 -0.609794 0.988014 -0.0142259 -0.601666 0.986886 -0.0134186 -0.594282 0.985734 -0.0125855 -0.587653 0.984583 -0.011745 -0.581776 0.983457 -0.0109159 -0.576576 0.982244 -0.0100141 -0.571935 0.980706 -0.00885839 -0.567824 0.978755 -0.00738 -0.564293 0.976504 -0.00566287 -0.561361 0.974109 -0.00382579 -0.559016 0.971651 -0.00193068 -0.557266 0.969158 0 -0.559016 0.971651 0.00193068 -0.561361 0.974109 0.00382579 -0.564293 0.976504 0.00566287 -0.567824 0.978755 0.00738 -0.571935 0.980706 0.00885839 -0.576576 0.982244 0.0100141 -0.581776 0.983457 0.0109159 -0.587653 0.984583 0.011745 -0.594282 0.985734 0.0125855 -0.601666 0.986886 0.0134186 -0.609794 0.988014 0.0142259 -0.618643 0.989099 0.0149916 -0.628185 0.990124 0.0157045 -0.63838 0.991079 0.0163571 -0.649185 0.991955 0.0169442 -0.660545 0.992744 0.0174601 -0.6724 0.993434 0.0178972 -0.684679 0.994006 0.018244 -0.697305 0.994439 0.0184858 -0.710198 0.994705 0.0186053 -0.723271 0.994778 0.0185859 -0.736443 0.994637 0.0184143 -0.749632 0.994269 0.0180839 -0.762763 0.993674 0.0175971 -0.775769 0.992867 0.0169656 -0.788588 0.991874 0.0162089 -0.801163 0.99073 0.0153527 -0.813443 0.989474 0.0144245 -0.825377 0.988143 0.0134504 -0.836916 0.986769 0.0124523 -0.848015 0.985375 0.0114464 -0.858628 0.983978 0.0104433 -0.868719 0.982586 0.00944882 -0.878256 0.981205 0.00846633 -0.887219 0.979839 0.00749819 -0.895599 0.978494 0.00654775 -0.9034 0.977177 0.00561944 -0.910641 0.975896 0.00471871 -0.917356 0.97466 0.00385113 -0.923592 0.973476 0.00302101 -0.929415 0.972347 0.0022304 -0.934902 0.971265 0.00147359 -0.940148 0.97021 0.000736382 -0.945264 0.969157 0 -0.95081 0.969157 0 -0.957824 0.969157 0 -0.970224 0.969157 0 -0.995292 0.969157 0 -1.04463 0.969157 0 -1.13537 0.969157 0 -1.29179 0.969158 0 -1.54729 0.969158 0 -1.94701 0.969158 0 -2.55117 0.969158 0 -3.43933 0.969158 0 -4.7159 0.969158 0 -0.660544 0.992746 -0.01748 -0.649184 0.991957 -0.016964 -0.638379 0.99108 -0.0163769 -0.628183 0.990125 -0.0157242 -0.618641 0.9891 -0.0150112 -0.609792 0.988016 -0.0142455 -0.601664 0.986887 -0.0134381 -0.59428 0.985736 -0.0126048 -0.58765 0.984585 -0.0117641 -0.581773 0.983459 -0.0109349 -0.576572 0.982247 -0.0100326 -0.571928 0.980709 -0.008876 -0.567815 0.97876 -0.00739578 -0.564281 0.976511 -0.00567546 -0.561347 0.974119 -0.00383324 -0.559001 0.971663 -0.00193008 -0.557269 0.969177 0 -0.559001 0.971663 0.00193008 -0.561347 0.974119 0.00383324 -0.564281 0.976511 0.00567546 -0.567815 0.97876 0.00739578 -0.571928 0.980709 0.008876 -0.576572 0.982247 0.0100326 -0.581773 0.983459 0.0109349 -0.58765 0.984585 0.0117641 -0.59428 0.985736 0.0126048 -0.601664 0.986887 0.0134381 -0.609792 0.988016 0.0142455 -0.618641 0.9891 0.0150112 -0.628183 0.990125 0.0157242 -0.638379 0.99108 0.0163769 -0.649184 0.991957 0.016964 -0.660544 0.992746 0.01748 -0.672399 0.993436 0.0179171 -0.684678 0.994008 0.0182639 -0.697304 0.994441 0.0185058 -0.710197 0.994707 0.0186253 -0.723271 0.99478 0.0186059 -0.736443 0.994639 0.0184344 -0.749632 0.99427 0.0181041 -0.762763 0.993675 0.0176174 -0.77577 0.992868 0.0169858 -0.788589 0.991875 0.0162292 -0.801164 0.99073 0.0153731 -0.813444 0.989474 0.0144449 -0.825378 0.988143 0.0134708 -0.836918 0.986769 0.0124727 -0.848016 0.985375 0.0114668 -0.85863 0.983978 0.0104637 -0.868721 0.982586 0.0094692 -0.878258 0.981205 0.00848668 -0.887221 0.979839 0.00751849 -0.895601 0.978493 0.00656798 -0.903402 0.977176 0.00563961 -0.910644 0.975895 0.00473879 -0.917358 0.974659 0.00387113 -0.923594 0.973475 0.00304094 -0.929417 0.972346 0.00225029 -0.934905 0.971264 0.00149346 -0.940151 0.97021 0.000756289 -0.945265 0.969159 2.0082e-05 -0.95081 0.969157 2.0228e-05 -0.957824 0.969156 2.0357e-05 -0.970225 0.969156 2.0663e-05 -0.995293 0.969156 2.1162e-05 -1.04463 0.969156 2.1445e-05 -1.13538 0.969157 2.1334e-05 -1.2918 0.969157 2.1156e-05 -1.5473 0.969157 2.1143e-05 -1.94702 0.969157 2.136e-05 -2.55118 0.969157 2.201e-05 -3.43933 0.969158 2.3664e-05 -4.7159 0.969174 7.865e-06 -0.660542 0.992749 -0.0175132 -0.649181 0.99196 -0.0169972 -0.638376 0.991083 -0.0164099 -0.62818 0.990128 -0.0157571 -0.618638 0.989103 -0.015044 -0.609788 0.988019 -0.0142781 -0.60166 0.98689 -0.0134704 -0.594275 0.985738 -0.0126368 -0.587645 0.984588 -0.0117957 -0.581767 0.983463 -0.0109658 -0.576565 0.98225 -0.0100624 -0.571918 0.980714 -0.00890394 -0.567801 0.978767 -0.00742054 -0.564262 0.976522 -0.00569504 -0.561325 0.974133 -0.0038447 -0.558979 0.971681 -0.00192923 -0.557275 0.969212 0 -0.558979 0.971681 0.00192923 -0.561325 0.974133 0.0038447 -0.564262 0.976522 0.00569504 -0.567801 0.978767 0.00742054 -0.571918 0.980714 0.00890394 -0.576565 0.98225 0.0100625 -0.581767 0.983463 0.0109658 -0.587645 0.984588 0.0117957 -0.594275 0.985738 0.0126368 -0.60166 0.98689 0.0134704 -0.609788 0.988019 0.0142781 -0.618638 0.989103 0.015044 -0.62818 0.990128 0.0157571 -0.638376 0.991083 0.0164099 -0.649181 0.99196 0.0169972 -0.660542 0.992749 0.0175132 -0.672396 0.993439 0.0179503 -0.684676 0.994012 0.0182972 -0.697303 0.994444 0.0185391 -0.710196 0.99471 0.0186587 -0.72327 0.994783 0.0186394 -0.736442 0.994641 0.018468 -0.749632 0.994273 0.0181379 -0.762764 0.993677 0.0176513 -0.775771 0.99287 0.01702 -0.78859 0.991876 0.0162636 -0.801166 0.990732 0.0154076 -0.813446 0.989475 0.0144795 -0.825381 0.988144 0.0135056 -0.83692 0.98677 0.0125076 -0.848019 0.985376 0.0115018 -0.858633 0.983978 0.0104987 -0.868724 0.982586 0.0095043 -0.878261 0.981204 0.00852179 -0.887224 0.979838 0.00755359 -0.895605 0.978493 0.00660305 -0.903406 0.977175 0.00567462 -0.910648 0.975894 0.00477374 -0.917362 0.974658 0.00390603 -0.923599 0.973474 0.0030758 -0.929422 0.972345 0.00228514 -0.934909 0.971263 0.00152838 -0.940155 0.97021 0.000791417 -0.945268 0.969163 5.6215e-05 -0.95081 0.969156 5.5922e-05 -0.957826 0.969155 5.6124e-05 -0.970228 0.969155 5.6825e-05 -0.995296 0.969155 5.8025e-05 -1.04463 0.969155 5.8628e-05 -1.13538 0.969155 5.8206e-05 -1.2918 0.969155 5.766e-05 -1.5473 0.969155 5.7597e-05 -1.94703 0.969155 5.8156e-05 -2.55119 0.969155 5.9831e-05 -3.43934 0.969157 6.4073e-05 -4.7159 0.969201 2.0122e-05 -0.660538 0.992754 -0.0175687 -0.649177 0.991965 -0.0170526 -0.638371 0.991088 -0.0164651 -0.628175 0.990133 -0.015812 -0.618632 0.989108 -0.0150986 -0.609782 0.988023 -0.0143323 -0.601653 0.986895 -0.0135241 -0.594268 0.985743 -0.0126898 -0.587637 0.984593 -0.0118478 -0.581758 0.983468 -0.0110163 -0.576553 0.982256 -0.0101105 -0.571902 0.980722 -0.00894831 -0.567778 0.978779 -0.00745941 -0.564233 0.976538 -0.00572549 -0.56129 0.974155 -0.0038624 -0.558945 0.971709 -0.00192809 -0.557284 0.969273 0 -0.558945 0.971709 0.00192809 -0.56129 0.974155 0.0038624 -0.564233 0.976538 0.0057255 -0.567778 0.978779 0.00745942 -0.571902 0.980722 0.00894831 -0.576553 0.982256 0.0101105 -0.581758 0.983468 0.0110163 -0.587637 0.984593 0.0118478 -0.594268 0.985743 0.0126898 -0.601653 0.986895 0.0135241 -0.609782 0.988023 0.0143323 -0.618632 0.989108 0.0150986 -0.628175 0.990133 0.0158121 -0.638371 0.991088 0.0164651 -0.649177 0.991965 0.0170526 -0.660538 0.992754 0.0175687 -0.672393 0.993444 0.018006 -0.684673 0.994017 0.018353 -0.697301 0.99445 0.0185949 -0.710194 0.994716 0.0187147 -0.723269 0.994788 0.0186955 -0.736442 0.994646 0.0185244 -0.749632 0.994277 0.0181947 -0.762765 0.993681 0.0177085 -0.775772 0.992873 0.0170776 -0.788593 0.991879 0.0163217 -0.801169 0.990734 0.0154661 -0.81345 0.989477 0.0145384 -0.825384 0.988145 0.0135648 -0.836924 0.98677 0.0125672 -0.848023 0.985376 0.0115618 -0.858638 0.983978 0.0105589 -0.868729 0.982585 0.00956466 -0.878267 0.981204 0.00858229 -0.88723 0.979837 0.00761419 -0.895611 0.978492 0.00666371 -0.903413 0.977174 0.00573531 -0.910655 0.975893 0.00483446 -0.91737 0.974657 0.00396677 -0.923606 0.973472 0.00313662 -0.92943 0.972343 0.00234611 -0.934918 0.971262 0.00158962 -0.940163 0.970209 0.000853281 -0.945273 0.96917 0.000120999 -0.950811 0.969156 0.000118784 -0.957828 0.969154 0.000118835 -0.970232 0.969153 0.000119977 -0.995301 0.969153 0.000122149 -1.04464 0.969153 0.000123138 -1.13539 0.969153 0.000122075 -1.29181 0.969153 0.000120827 -1.54731 0.969152 0.000120634 -1.94704 0.969152 0.000121723 -2.5512 0.969153 0.000125016 -3.43936 0.969155 0.000133288 -4.7159 0.969246 3.8801e-05 -0.660531 0.992763 -0.0176614 -0.649169 0.991973 -0.017145 -0.638363 0.991097 -0.0165571 -0.628166 0.990141 -0.0159035 -0.618623 0.989116 -0.0151894 -0.609771 0.988031 -0.0144223 -0.601641 0.986903 -0.013613 -0.594255 0.985752 -0.0127773 -0.587624 0.984602 -0.0119333 -0.581743 0.983477 -0.0110986 -0.576534 0.982265 -0.0101877 -0.571875 0.980734 -0.00901866 -0.567743 0.978797 -0.00752035 -0.564187 0.976564 -0.00577278 -0.561238 0.97419 -0.00388966 -0.558895 0.971755 -0.0019267 -0.557301 0.969381 0 -0.558895 0.971755 0.0019267 -0.561238 0.97419 0.00388966 -0.564187 0.976564 0.00577278 -0.567743 0.978797 0.00752035 -0.571875 0.980734 0.00901867 -0.576534 0.982265 0.0101877 -0.581743 0.983477 0.0110986 -0.587624 0.984602 0.0119333 -0.594255 0.985752 0.0127773 -0.601641 0.986903 0.013613 -0.609771 0.988031 0.0144223 -0.618623 0.989116 0.0151894 -0.628166 0.990141 0.0159035 -0.638363 0.991097 0.0165571 -0.649169 0.991973 0.017145 -0.660531 0.992763 0.0176614 -0.672387 0.993453 0.0180988 -0.684668 0.994027 0.0184459 -0.697296 0.994459 0.018688 -0.710191 0.994725 0.018808 -0.723267 0.994798 0.0187893 -0.736441 0.994655 0.0186187 -0.749633 0.994285 0.0182897 -0.762767 0.993688 0.0178045 -0.775775 0.992878 0.0171747 -0.788597 0.991883 0.0164197 -0.801174 0.990737 0.0155651 -0.813456 0.98948 0.0146383 -0.825391 0.988147 0.0136656 -0.836932 0.986772 0.0126688 -0.848031 0.985377 0.0116641 -0.858646 0.983978 0.0106619 -0.868738 0.982585 0.0096681 -0.878276 0.981203 0.00868614 -0.88724 0.979836 0.0077184 -0.895622 0.97849 0.00676821 -0.903424 0.977172 0.00584007 -0.910667 0.97589 0.00493948 -0.917382 0.974654 0.00407209 -0.92362 0.97347 0.00324231 -0.929443 0.972341 0.00245232 -0.934932 0.971259 0.00169661 -0.940177 0.970208 0.00096178 -0.945282 0.969182 0.000236391 -0.950812 0.969157 0.000229027 -0.957833 0.969152 0.000228328 -0.970239 0.969149 0.000229804 -0.995309 0.969149 0.000233274 -1.04465 0.96915 0.000234747 -1.1354 0.969149 0.000232501 -1.29183 0.969148 0.00022996 -1.54733 0.969147 0.000229465 -1.94707 0.969147 0.000231371 -2.55123 0.969149 0.000237194 -3.43939 0.969154 0.000251683 -4.7159 0.969322 6.724e-05 -0.66052 0.992779 -0.0178152 -0.649157 0.991989 -0.0172983 -0.63835 0.991111 -0.0167096 -0.628151 0.990156 -0.016055 -0.618607 0.98913 -0.0153396 -0.609754 0.988045 -0.0145709 -0.601622 0.986916 -0.0137596 -0.594234 0.985766 -0.012921 -0.587601 0.984617 -0.0120731 -0.581718 0.983493 -0.011232 -0.576503 0.982281 -0.0103112 -0.571833 0.980754 -0.00912978 -0.567685 0.978827 -0.00761552 -0.564116 0.976606 -0.00584592 -0.561157 0.974244 -0.00393149 -0.55882 0.971828 -0.00192542 -0.557326 0.969567 1e-09 -0.55882 0.971828 0.00192543 -0.561157 0.974244 0.0039315 -0.564116 0.976606 0.00584592 -0.567685 0.978827 0.00761553 -0.571833 0.980754 0.00912979 -0.576503 0.982281 0.0103112 -0.581718 0.983493 0.011232 -0.587601 0.984617 0.0120731 -0.594234 0.985766 0.012921 -0.601622 0.986916 0.0137596 -0.609754 0.988045 0.0145709 -0.618607 0.98913 0.0153396 -0.628151 0.990156 0.016055 -0.63835 0.991111 0.0167096 -0.649157 0.991989 0.0172983 -0.66052 0.992779 0.0178152 -0.672378 0.99347 0.0182529 -0.68466 0.994043 0.0186002 -0.69729 0.994476 0.0188426 -0.710186 0.994742 0.018963 -0.723264 0.994814 0.0189451 -0.73644 0.99467 0.0187757 -0.749634 0.994299 0.0184482 -0.76277 0.9937 0.0179648 -0.77578 0.992889 0.0173371 -0.788604 0.991892 0.0165843 -0.801183 0.990745 0.0157316 -0.813466 0.989486 0.0148068 -0.825402 0.988152 0.0138359 -0.836944 0.986775 0.0128409 -0.848044 0.985379 0.0118377 -0.85866 0.983979 0.0108369 -0.868753 0.982585 0.00984429 -0.878292 0.981202 0.00886335 -0.887258 0.979835 0.00789651 -0.89564 0.978488 0.00694716 -0.903444 0.977169 0.00601983 -0.910687 0.975887 0.00512005 -0.917404 0.97465 0.00425355 -0.923642 0.973466 0.00342484 -0.929467 0.972337 0.00263617 -0.934956 0.971256 0.00188233 -0.940202 0.970206 0.00115089 -0.945298 0.969203 0.000439824 -0.950815 0.969158 0.000421147 -0.957843 0.969148 0.000418308 -0.970252 0.969145 0.000419602 -0.995324 0.969144 0.000424647 -1.04466 0.969145 0.000426709 -1.13542 0.969144 0.000422387 -1.29185 0.969142 0.000417529 -1.54737 0.96914 0.00041639 -1.94711 0.96914 0.000419527 -2.55128 0.969143 0.000429256 -3.43944 0.969151 0.000453192 -4.7159 0.96945 0.000110925 -0.660502 0.992807 -0.0180685 -0.649137 0.992016 -0.0175506 -0.638327 0.991138 -0.0169604 -0.628127 0.990181 -0.0163039 -0.61858 0.989155 -0.0155861 -0.609724 0.98807 -0.0148144 -0.60159 0.986941 -0.0139991 -0.594199 0.985791 -0.0131552 -0.587563 0.984643 -0.0122998 -0.581676 0.983519 -0.0114466 -0.576451 0.982308 -0.0105077 -0.571764 0.980788 -0.00930432 -0.567595 0.978874 -0.00776336 -0.564005 0.976672 -0.00595842 -0.561033 0.974332 -0.00399537 -0.558711 0.971951 -0.00192547 -0.557362 0.969877 1e-09 -0.558711 0.971951 0.00192548 -0.561033 0.974332 0.00399538 -0.564005 0.976672 0.00595843 -0.567595 0.978874 0.00776337 -0.571764 0.980788 0.00930434 -0.576451 0.982308 0.0105078 -0.581676 0.983519 0.0114467 -0.587563 0.984643 0.0122998 -0.594199 0.985791 0.0131552 -0.60159 0.986941 0.0139991 -0.609724 0.98807 0.0148144 -0.61858 0.989155 0.0155862 -0.628127 0.990181 0.0163039 -0.638327 0.991138 0.0169604 -0.649137 0.992016 0.0175506 -0.660502 0.992807 0.0180685 -0.672361 0.993499 0.0185068 -0.684646 0.994073 0.0188544 -0.697278 0.994506 0.0190973 -0.710177 0.994772 0.0192186 -0.723259 0.994842 0.0192021 -0.736438 0.994697 0.0190348 -0.749635 0.994324 0.0187103 -0.762775 0.993722 0.0182305 -0.775789 0.992908 0.0176068 -0.788615 0.991908 0.0168582 -0.801197 0.990759 0.0160094 -0.813482 0.989497 0.0150885 -0.825421 0.988162 0.0141214 -0.836965 0.986783 0.0131299 -0.848066 0.985385 0.01213 -0.858684 0.983983 0.0111321 -0.868778 0.982588 0.010142 -0.87832 0.981203 0.00916329 -0.887287 0.979834 0.00819853 -0.895671 0.978486 0.00725116 -0.903477 0.977167 0.00632577 -0.910722 0.975884 0.00542799 -0.917441 0.974646 0.00456369 -0.923681 0.973461 0.00373752 -0.929507 0.972332 0.00295189 -0.934997 0.971252 0.00220212 -0.940244 0.970207 0.0014778 -0.945327 0.969239 0.000793332 -0.950824 0.969162 0.000753145 -0.957862 0.969145 0.000745207 -0.970277 0.969138 0.000744875 -0.995351 0.969138 0.00075142 -1.04469 0.969138 0.000754063 -1.13545 0.969137 0.000746207 -1.2919 0.969133 0.000737298 -1.54742 0.96913 0.000734863 -1.94718 0.969128 0.000739811 -2.55137 0.969134 0.00075547 -3.43952 0.969149 0.000793475 -4.7159 0.969666 0.000178887 -0.660471 0.992858 -0.0184815 -0.649102 0.992066 -0.0179618 -0.638289 0.991186 -0.0173689 -0.628085 0.990228 -0.0167089 -0.618534 0.989201 -0.0159868 -0.609675 0.988114 -0.0152095 -0.601536 0.986985 -0.014387 -0.59414 0.985835 -0.0135332 -0.587499 0.984689 -0.012664 -0.581605 0.983565 -0.0117888 -0.576364 0.982355 -0.0108178 -0.571651 0.980844 -0.00957658 -0.56745 0.978951 -0.00799147 -0.563831 0.976776 -0.00613027 -0.560845 0.974471 -0.00409238 -0.558554 0.972155 -0.00193013 -0.557396 0.970363 2e-09 -0.558554 0.972155 0.00193014 -0.560845 0.974471 0.00409239 -0.563831 0.976776 0.00613029 -0.56745 0.978951 0.0079915 -0.571651 0.980844 0.0095766 -0.576364 0.982355 0.0108178 -0.581605 0.983565 0.0117888 -0.587499 0.984689 0.0126641 -0.59414 0.985835 0.0135333 -0.601536 0.986985 0.014387 -0.609675 0.988114 0.0152095 -0.618534 0.989201 0.0159868 -0.628085 0.990228 0.0167089 -0.638289 0.991186 0.0173689 -0.649102 0.992066 0.0179618 -0.660471 0.992858 0.0184815 -0.672334 0.993552 0.0189207 -0.684622 0.994127 0.0192691 -0.697259 0.99456 0.0195129 -0.710163 0.994825 0.0196358 -0.723249 0.994895 0.0196219 -0.736434 0.994747 0.0194587 -0.749637 0.99437 0.0191396 -0.762782 0.993765 0.0186665 -0.775802 0.992946 0.0180504 -0.788633 0.991942 0.0173096 -0.80122 0.990788 0.0164684 -0.81351 0.989523 0.0155549 -0.825452 0.988184 0.0145951 -0.836998 0.986801 0.0136107 -0.848103 0.9854 0.0126172 -0.858723 0.983996 0.011625 -0.86882 0.982598 0.01064 -0.878365 0.981211 0.00966591 -0.887335 0.97984 0.00870554 -0.895723 0.97849 0.00776245 -0.903532 0.977168 0.00684136 -0.910781 0.975884 0.00594806 -0.917503 0.974645 0.00508859 -0.923746 0.973459 0.0042679 -0.929575 0.97233 0.00348867 -0.935069 0.971251 0.00274727 -0.940316 0.970215 0.00203711 -0.94538 0.969296 0.00139625 -0.950848 0.969175 0.00132081 -0.957902 0.969146 0.00130195 -0.970325 0.969134 0.00129662 -0.995401 0.969132 0.00130353 -1.04475 0.969134 0.0013063 -1.13552 0.969131 0.00129255 -1.29197 0.969125 0.00127673 -1.54752 0.969118 0.00127182 -1.9473 0.969116 0.00127935 -2.55151 0.969125 0.00130381 -3.43966 0.969152 0.00136224 -4.7159 0.970028 0.000285975 -0.660419 0.992955 -0.0191467 -0.649044 0.992159 -0.0186238 -0.638225 0.991277 -0.0180261 -0.628015 0.990316 -0.01736 -0.618457 0.989286 -0.0166303 -0.60959 0.988197 -0.0158432 -0.601443 0.987067 -0.0150077 -0.594039 0.985917 -0.0141363 -0.587388 0.984773 -0.0132422 -0.581481 0.983648 -0.0123282 -0.576217 0.982437 -0.0113024 -0.571465 0.98094 -0.00999787 -0.567219 0.979076 -0.00834077 -0.56356 0.976944 -0.00639073 -0.560559 0.974697 -0.004239 -0.558329 0.972498 -0.00194721 -0.557395 0.971071 5e-09 -0.558329 0.972498 0.00194722 -0.560559 0.974697 0.00423903 -0.56356 0.976944 0.00639077 -0.567219 0.979076 0.00834082 -0.571465 0.98094 0.00999792 -0.576217 0.982437 0.0113024 -0.581481 0.983648 0.0123282 -0.587388 0.984772 0.0132423 -0.594039 0.985917 0.0141364 -0.601443 0.987067 0.0150078 -0.60959 0.988197 0.0158432 -0.618457 0.989286 0.0166304 -0.628015 0.990316 0.0173601 -0.638225 0.991277 0.0180262 -0.649044 0.992159 0.0186239 -0.660419 0.992955 0.0191468 -0.672288 0.99365 0.0195879 -0.684583 0.994227 0.0199378 -0.697227 0.994662 0.0201833 -0.710138 0.994926 0.0203092 -0.723233 0.994994 0.0203002 -0.736427 0.994842 0.0201442 -0.749639 0.99446 0.0198348 -0.762794 0.993848 0.0193738 -0.775822 0.993023 0.0187713 -0.788662 0.992011 0.0180448 -0.801257 0.990852 0.0172176 -0.813554 0.989581 0.016318 -0.825501 0.988235 0.015372 -0.837053 0.986847 0.0144007 -0.848162 0.985441 0.0134195 -0.858787 0.984032 0.0124383 -0.868889 0.982629 0.0114632 -0.878439 0.981239 0.0104983 -0.887415 0.979864 0.00954681 -0.895808 0.97851 0.00861247 -0.903623 0.977186 0.00770025 -0.910878 0.975899 0.00681619 -0.917606 0.974659 0.00596666 -0.923856 0.973472 0.00515705 -0.92969 0.972343 0.00439056 -0.935189 0.971267 0.00366547 -0.940439 0.970246 0.00298182 -0.945478 0.969391 0.00240234 -0.950911 0.969216 0.00227868 -0.957989 0.969165 0.00223854 -0.970423 0.969143 0.00222125 -0.995497 0.96914 0.00222484 -1.04485 0.969142 0.00222605 -1.13563 0.969137 0.0022026 -1.2921 0.969125 0.00217531 -1.54768 0.969113 0.00216587 -1.9475 0.96911 0.00217695 -2.55174 0.969127 0.00221412 -3.43989 0.969173 0.00230119 -4.7159 0.970632 0.000456622 -0.66033 0.99314 -0.0202034 -0.648945 0.99234 -0.0196749 -0.638115 0.991452 -0.019069 -0.627893 0.990486 -0.0183925 -0.618324 0.989451 -0.0176496 -0.609443 0.988357 -0.0168455 -0.601283 0.987223 -0.0159874 -0.593863 0.986071 -0.0150852 -0.587195 0.984927 -0.0141474 -0.581264 0.983799 -0.0131673 -0.57596 0.982587 -0.0120515 -0.571152 0.981107 -0.0106438 -0.566842 0.979286 -0.008871 -0.563131 0.977218 -0.00678221 -0.560122 0.975066 -0.00446035 -0.557998 0.97306 -0.00199273 -0.55728 0.972017 9e-09 -0.557998 0.97306 0.00199275 -0.560122 0.975066 0.00446039 -0.563131 0.977218 0.00678227 -0.566842 0.979286 0.00887108 -0.571152 0.981107 0.0106439 -0.57596 0.982587 0.0120516 -0.581264 0.983799 0.0131674 -0.587195 0.984926 0.0141476 -0.593863 0.986071 0.0150853 -0.601283 0.987223 0.0159876 -0.609443 0.988357 0.0168456 -0.618324 0.98945 0.0176498 -0.627893 0.990486 0.0183927 -0.638115 0.991452 0.0190692 -0.648945 0.992339 0.0196751 -0.66033 0.99314 0.0202036 -0.67221 0.99384 0.0206485 -0.684516 0.994421 0.0210014 -0.697171 0.994857 0.0212507 -0.710096 0.995121 0.0213822 -0.723204 0.995185 0.021382 -0.736413 0.995029 0.0212386 -0.74964 0.994639 0.0209461 -0.76281 0.994018 0.0205059 -0.775853 0.993182 0.0199272 -0.788707 0.992161 0.0192259 -0.801315 0.990992 0.0184238 -0.813622 0.989711 0.0175493 -0.82558 0.988357 0.0166283 -0.83714 0.98696 0.0156811 -0.848257 0.985545 0.0147225 -0.85889 0.984129 0.013762 -0.869001 0.98272 0.0128056 -0.878559 0.981323 0.0118583 -0.887544 0.979942 0.0109239 -0.895947 0.978583 0.0100067 -0.903773 0.977254 0.00911189 -0.911039 0.975964 0.00824593 -0.917778 0.974721 0.0074157 -0.924039 0.973534 0.00662725 -0.929885 0.972407 0.00588476 -0.935395 0.971339 0.00518972 -0.940648 0.970345 0.00455141 -0.945665 0.969554 0.00404416 -0.951066 0.969325 0.00386778 -0.958179 0.96924 0.00379099 -0.970626 0.969201 0.00374893 -0.995688 0.969195 0.00374038 -1.04503 0.969197 0.0037354 -1.13582 0.969187 0.00369619 -1.29233 0.969167 0.00365042 -1.54796 0.969147 0.00363311 -1.94785 0.969142 0.00364884 -2.55213 0.969171 0.00370367 -3.44026 0.96925 0.00382914 -4.7159 0.971641 0.000731024 -0.660176 0.993506 -0.0218565 -0.648772 0.992696 -0.0213178 -0.637923 0.991798 -0.0206982 -0.627681 0.990821 -0.0200041 -0.618089 0.989775 -0.0192389 -0.609185 0.988671 -0.0184058 -0.600997 0.987528 -0.0175092 -0.593549 0.986369 -0.016554 -0.586847 0.985219 -0.0155416 -0.580873 0.984082 -0.014453 -0.575505 0.982866 -0.0131944 -0.570616 0.981409 -0.0116233 -0.566221 0.979645 -0.0096678 -0.562447 0.977669 -0.00736562 -0.559443 0.975663 -0.00479563 -0.557467 0.973934 -0.00209421 -0.556917 0.973213 1.9e-08 -0.557467 0.973934 0.00209426 -0.559443 0.975663 0.00479571 -0.562447 0.977669 0.00736573 -0.566221 0.979645 0.00966793 -0.570616 0.981409 0.0116234 -0.575505 0.982866 0.0131946 -0.580873 0.984082 0.0144532 -0.586847 0.985219 0.0155418 -0.593549 0.986369 0.0165542 -0.600997 0.987528 0.0175095 -0.609185 0.988671 0.0184061 -0.618089 0.989774 0.0192392 -0.627681 0.990821 0.0200044 -0.637923 0.991798 0.0206985 -0.648772 0.992695 0.0213181 -0.660176 0.993506 0.0218568 -0.672075 0.994214 0.0223092 -0.6844 0.9948 0.0226686 -0.697075 0.99524 0.0229254 -0.710021 0.995504 0.0230676 -0.723152 0.995566 0.0230829 -0.736384 0.995402 0.0229613 -0.749635 0.995003 0.0226973 -0.762829 0.99437 0.0222919 -0.775896 0.993521 0.021753 -0.788773 0.992486 0.0210943 -0.801401 0.991304 0.0203358 -0.813727 0.990011 0.0195055 -0.8257 0.988643 0.0186285 -0.837275 0.987234 0.0177241 -0.848406 0.985807 0.0168057 -0.859053 0.984379 0.0158823 -0.869178 0.98296 0.0149602 -0.878751 0.981554 0.0140454 -0.887752 0.980164 0.013143 -0.896173 0.978798 0.0122579 -0.904017 0.977463 0.0113958 -0.911302 0.976169 0.0105636 -0.918063 0.974925 0.00976885 -0.924345 0.973739 0.00901864 -0.930215 0.972618 0.00831869 -0.935747 0.971567 0.00767474 -0.941014 0.970613 0.007104 -0.946027 0.969879 0.00666792 -0.951425 0.969605 0.00644723 -0.958587 0.969472 0.00631771 -0.971051 0.969404 0.00623099 -0.996078 0.969391 0.00619261 -1.04539 0.969392 0.00617071 -1.13619 0.969373 0.00610602 -1.29273 0.969337 0.00603162 -1.54844 0.969302 0.00600129 -1.94842 0.969295 0.00602276 -2.55278 0.969345 0.00610093 -3.44087 0.969478 0.00627442 -4.7159 0.973324 0.00117532 -0.659903 0.994235 -0.0243996 -0.648464 0.993407 -0.0238424 -0.637579 0.99249 -0.0231994 -0.627299 0.991492 -0.0224758 -0.617665 0.990423 -0.0216731 -0.608715 0.989297 -0.0207911 -0.600479 0.988133 -0.0198292 -0.592974 0.986956 -0.0187847 -0.586208 0.985787 -0.0176481 -0.580152 0.984628 -0.0163872 -0.574684 0.983401 -0.0149097 -0.56968 0.981966 -0.0130871 -0.565174 0.980272 -0.01085 -0.561329 0.97842 -0.00822755 -0.558348 0.976614 -0.00530597 -0.556527 0.975198 -0.00229016 -0.556079 0.974693 4e-08 -0.556527 0.975198 0.00229025 -0.558348 0.976614 0.00530611 -0.561329 0.97842 0.00822774 -0.565174 0.980272 0.0108502 -0.56968 0.981966 0.0130873 -0.574684 0.983401 0.01491 -0.580152 0.984628 0.0163875 -0.586208 0.985787 0.0176485 -0.592974 0.986956 0.0187851 -0.600479 0.988133 0.0198296 -0.608716 0.989297 0.0207916 -0.617665 0.990422 0.0216736 -0.627299 0.991491 0.0224764 -0.637579 0.99249 0.0232 -0.648464 0.993407 0.023843 -0.659903 0.994235 0.0244002 -0.671835 0.994958 0.0248676 -0.684193 0.995557 0.0252409 -0.696903 0.996004 0.0255132 -0.709884 0.996271 0.0256756 -0.723051 0.996331 0.0257182 -0.736322 0.996162 0.025633 -0.749612 0.995753 0.0254155 -0.762845 0.995107 0.0250663 -0.775949 0.994243 0.0245915 -0.788863 0.993193 0.0240025 -0.801525 0.991996 0.0233168 -0.813881 0.990687 0.0225607 -0.825881 0.989304 0.0217579 -0.83748 0.987879 0.0209257 -0.848635 0.986437 0.0200761 -0.859306 0.984996 0.019217 -0.869456 0.983564 0.0183553 -0.879055 0.982147 0.0174986 -0.888085 0.980748 0.0166536 -0.896537 0.979374 0.015826 -0.904416 0.978034 0.015022 -0.911739 0.976738 0.0142492 -0.918539 0.975497 0.0135158 -0.924866 0.974319 0.0128301 -0.930783 0.973214 0.0121994 -0.936362 0.972193 0.0116325 -0.941674 0.971288 0.0111461 -0.946734 0.970596 0.0107731 -0.95219 0.970292 0.0105242 -0.959435 0.970105 0.0103354 -0.971925 0.969991 0.0101809 -0.996877 0.969958 0.0100833 -1.04611 0.969954 0.0100228 -1.13688 0.969918 0.00991744 -1.29346 0.969852 0.00980073 -1.54926 0.969794 0.0097503 -1.94937 0.969783 0.00977837 -2.55383 0.969868 0.009885 -3.44184 0.970091 0.0101118 -4.7159 0.976128 0.00189834 -0.659398 0.995694 -0.0282454 -0.647895 0.994832 -0.0276537 -0.636942 0.993876 -0.0269695 -0.626589 0.992835 -0.0261948 -0.616876 0.991722 -0.0253276 -0.607839 0.990551 -0.0243622 -0.599505 0.989342 -0.0232898 -0.591893 0.988118 -0.0220964 -0.585003 0.986901 -0.0207585 -0.578804 0.985695 -0.0192323 -0.573175 0.984437 -0.0174285 -0.56801 0.983014 -0.0152307 -0.563364 0.98139 -0.0125738 -0.559438 0.979674 -0.00948735 -0.556476 0.978078 -0.00608033 -0.554759 0.976917 -0.00262586 -0.554347 0.976524 8.5e-08 -0.554759 0.976917 0.00262605 -0.556476 0.978078 0.00608059 -0.559438 0.979673 0.00948768 -0.563364 0.98139 0.0125742 -0.56801 0.983014 0.0152312 -0.573175 0.984436 0.017429 -0.578804 0.985694 0.0192329 -0.585003 0.986901 0.0207592 -0.591893 0.988118 0.0220971 -0.599505 0.989342 0.0232906 -0.607839 0.990551 0.0243631 -0.616876 0.991722 0.0253285 -0.626589 0.992835 0.0261958 -0.636942 0.993875 0.0269705 -0.647895 0.994831 0.0276548 -0.659398 0.995694 0.0282465 -0.671392 0.996446 0.0287441 -0.68381 0.997068 0.0291464 -0.696579 0.997532 0.0294501 -0.70962 0.997811 0.0296502 -0.722849 0.997876 0.0297402 -0.736182 0.997707 0.0297149 -0.749535 0.997294 0.0295711 -0.762831 0.996641 0.0293092 -0.775997 0.995769 0.0289339 -0.78897 0.994709 0.0284536 -0.801687 0.993502 0.0278828 -0.814094 0.992183 0.0272449 -0.826141 0.990789 0.0265603 -0.837784 0.989353 0.0258438 -0.848982 0.987899 0.0251052 -0.859697 0.986448 0.0243518 -0.869892 0.985007 0.0235912 -0.879541 0.983583 0.0228326 -0.888624 0.98218 0.0220843 -0.897134 0.980805 0.0213531 -0.905078 0.979469 0.0206456 -0.912473 0.978183 0.0199697 -0.919354 0.976958 0.0193341 -0.925769 0.975803 0.0187473 -0.931782 0.974731 0.0182166 -0.937467 0.973755 0.0177494 -0.942894 0.972902 0.0173538 -0.948093 0.97224 0.0170379 -0.953703 0.971917 0.0167763 -0.961106 0.971683 0.0165367 -0.973658 0.971508 0.0163003 -0.998486 0.97143 0.0161062 -1.04754 0.971404 0.0159699 -1.1382 0.971333 0.0158013 -1.29479 0.971215 0.0156264 -1.5507 0.971116 0.0155479 -1.95098 0.971101 0.015583 -2.55555 0.971242 0.0157197 -3.44339 0.971608 0.0159917 -4.7159 0.980799 0.00307917 -0.658422 0.99859 -0.0339615 -0.646797 0.997661 -0.0333034 -0.635714 0.99663 -0.0325424 -0.625219 0.995509 -0.0316753 -0.615352 0.994308 -0.0306933 -0.606145 0.993045 -0.029582 -0.597625 0.991739 -0.0283207 -0.589805 0.990413 -0.0268807 -0.582686 0.98909 -0.025224 -0.576241 0.987783 -0.0232988 -0.570365 0.986448 -0.0210197 -0.564971 0.984995 -0.0182807 -0.56014 0.983398 -0.0150255 -0.556097 0.981762 -0.0112958 -0.553098 0.980289 -0.00723029 -0.551379 0.979234 -0.00315109 -0.550948 0.978861 1.83e-07 -0.551378 0.979234 0.00315149 -0.553097 0.980288 0.00723078 -0.556097 0.981762 0.0112964 -0.56014 0.983397 0.0150262 -0.564971 0.984995 0.0182815 -0.570365 0.986448 0.0210207 -0.576241 0.987782 0.0232998 -0.582686 0.98909 0.0252251 -0.589805 0.990413 0.026882 -0.597625 0.991739 0.0283221 -0.606145 0.993045 0.0295835 -0.615352 0.994308 0.0306949 -0.625219 0.995508 0.031677 -0.635714 0.99663 0.0325443 -0.646797 0.99766 0.0333053 -0.658423 0.99859 0.0339635 -0.670531 0.999401 0.0345217 -0.68306 1.00007 0.0349827 -0.695936 1.00058 0.035348 -0.709082 1.00089 0.0356169 -0.722417 1.00098 0.0357879 -0.735855 1.00083 0.0358588 -0.749313 1.00043 0.0358287 -0.762714 0.999795 0.0356981 -0.775983 0.998936 0.03547 -0.789054 0.997891 0.0351502 -0.801866 0.996698 0.0347499 -0.81436 0.995393 0.0342869 -0.826491 0.994012 0.0337774 -0.838215 0.992588 0.0332327 -0.849495 0.991146 0.0326607 -0.860292 0.989706 0.0320683 -0.870575 0.988279 0.0314639 -0.880317 0.986871 0.0308576 -0.889502 0.985488 0.0302587 -0.898126 0.98414 0.0296744 -0.906196 0.982836 0.0291117 -0.913732 0.981589 0.028578 -0.92077 0.980409 0.028081 -0.92736 0.979307 0.0276277 -0.933567 0.978293 0.0272227 -0.939465 0.977376 0.0268686 -0.945132 0.976573 0.0265653 -0.950604 0.97594 0.0263061 -0.956503 0.975607 0.0260431 -0.964191 0.975336 0.0257688 -0.976909 0.975093 0.0254549 -1.0016 0.974932 0.0251346 -1.05031 0.974844 0.024873 -1.1407 0.974705 0.024611 -1.29721 0.974496 0.0243642 -1.55321 0.974328 0.0242526 -1.95367 0.974307 0.0242948 -2.55833 0.974538 0.0244539 -3.44579 0.97512 0.0247329 -4.7159 0.988578 0.00501258 -0.65643 1.00427 -0.0423026 -0.644568 1.00321 -0.0415144 -0.633229 1.00203 -0.0406055 -0.622458 1.00075 -0.0395637 -0.61229 0.999377 -0.0383701 -0.602755 0.997929 -0.0369974 -0.593878 0.996426 -0.0354098 -0.585674 0.994892 -0.0335634 -0.578152 0.993356 -0.0314098 -0.571302 0.991844 -0.0288956 -0.565042 0.99033 -0.0259417 -0.55931 0.988731 -0.022454 -0.554202 0.987019 -0.0183912 -0.549946 0.985291 -0.0138107 -0.546788 0.983731 -0.00886932 -0.544943 0.982581 -0.00391833 -0.544446 0.982146 3.95e-07 -0.544943 0.982581 0.00391916 -0.546787 0.98373 0.00887027 -0.549946 0.985291 0.0138118 -0.554202 0.987019 0.0183925 -0.55931 0.988731 0.0224555 -0.565041 0.99033 0.0259433 -0.571301 0.991843 0.0288974 -0.578152 0.993355 0.0314119 -0.585673 0.994892 0.0335657 -0.593877 0.996425 0.0354123 -0.602755 0.997928 0.0370002 -0.61229 0.999376 0.0383731 -0.622458 1.00075 0.0395669 -0.633229 1.00203 0.0406089 -0.644568 1.00321 0.041518 -0.65643 1.00427 0.0423064 -0.66876 1.0052 0.0429842 -0.681497 1.00597 0.04356 -0.694573 1.00657 0.0440412 -0.707913 1.00697 0.0444329 -0.721437 1.00713 0.0447386 -0.735061 1.00705 0.0449607 -0.748703 1.00673 0.0451005 -0.762284 1.00616 0.0451591 -0.77573 1.00537 0.0451382 -0.788973 1.0044 0.0450408 -0.801951 1.00329 0.0448735 -0.814607 1.00206 0.0446484 -0.826894 1.00075 0.0443762 -0.838774 0.999404 0.0440646 -0.850209 0.998036 0.0437201 -0.861168 0.996668 0.0433492 -0.87162 0.995316 0.0429602 -0.881545 0.993985 0.042563 -0.890929 0.992685 0.0421667 -0.899771 0.991424 0.0417784 -0.908083 0.990213 0.0414046 -0.915886 0.989061 0.0410513 -0.923219 0.987978 0.0407241 -0.930133 0.986971 0.0404265 -0.936693 0.986046 0.0401598 -0.942977 0.985206 0.0399231 -0.949063 0.984462 0.0397117 -0.954988 0.983861 0.0395105 -0.961356 0.983522 0.0392519 -0.969521 0.98322 0.0389552 -0.982602 0.982906 0.0385795 -1.00724 0.982622 0.0381279 -1.05547 0.982402 0.0376966 -1.14534 0.982137 0.0373081 -1.30157 0.981783 0.0369851 -1.55756 0.981506 0.0368456 -1.95813 0.981477 0.0368961 -2.56275 0.981839 0.0370527 -3.44946 0.982731 0.0372459 -4.7159 1.00153 0.00818367 -0.652127 1.01522 -0.0541942 -0.639796 1.01389 -0.0531528 -0.627951 1.01242 -0.0519568 -0.616634 1.01083 -0.0505812 -0.60588 1.00912 -0.0489927 -0.595719 1.00731 -0.0471491 -0.586182 1.00542 -0.0450012 -0.5773 1.00348 -0.0424977 -0.569103 1.00154 -0.0395909 -0.561605 0.999629 -0.0362357 -0.55475 0.997727 -0.0323642 -0.548491 0.995747 -0.0278967 -0.542933 0.993654 -0.0228052 -0.538301 0.991545 -0.01715 -0.534836 0.989619 -0.011084 -0.53276 0.988167 -0.00497451 -0.532161 0.987593 8.42e-07 -0.53276 0.988167 0.00497624 -0.534836 0.989619 0.0110859 -0.538301 0.991545 0.0171521 -0.542933 0.993654 0.0228076 -0.54849 0.995746 0.0278994 -0.554749 0.997726 0.0323672 -0.561604 0.999628 0.036239 -0.569102 1.00154 0.0395946 -0.577299 1.00348 0.0425018 -0.586181 1.00542 0.0450058 -0.595718 1.00731 0.0471541 -0.605879 1.00912 0.0489982 -0.616634 1.01083 0.0505871 -0.627951 1.01242 0.0519631 -0.639796 1.01389 0.0531596 -0.652127 1.01522 0.0542014 -0.664896 1.0164 0.0551095 -0.678044 1.0174 0.0559016 -0.691509 1.0182 0.056593 -0.70522 1.01879 0.0571959 -0.719101 1.01914 0.0577199 -0.733071 1.01925 0.0581719 -0.747051 1.01911 0.0585562 -0.760963 1.01873 0.0588749 -0.774732 1.01814 0.0591282 -0.788291 1.01737 0.0593163 -0.801577 1.01645 0.0594413 -0.814536 1.01543 0.0595098 -0.827124 1.01432 0.0595279 -0.839304 1.01317 0.0595003 -0.851045 1.012 0.0594315 -0.862317 1.01082 0.0593273 -0.873099 1.00966 0.0591952 -0.883372 1.00852 0.0590439 -0.893132 1.00741 0.0588815 -0.90238 1.00634 0.0587147 -0.91113 1.00531 0.0585491 -0.91941 1.00433 0.0583891 -0.927256 1.00341 0.0582374 -0.934722 1.00254 0.0580954 -0.941872 1.00174 0.0579623 -0.948783 1.001 0.0578354 -0.955531 1.00032 0.0577083 -0.96215 0.999758 0.05756 -0.969232 0.999408 0.057306 -0.978144 0.999068 0.0569901 -0.991902 0.998677 0.0565644 -1.01678 0.998239 0.0559986 -1.06451 0.997812 0.0553831 -1.15355 0.997347 0.0548422 -1.30917 0.996795 0.0544507 -1.56492 0.996368 0.0543036 -1.96541 0.996327 0.0543662 -2.56969 0.996869 0.0544719 -3.45497 0.998166 0.0544061 -4.7159 1.02309 0.013391 -0.6424 1.0359 -0.0705516 -0.629124 1.03403 -0.0690289 -0.616276 1.03198 -0.067288 -0.603899 1.02976 -0.0652898 -0.592039 1.02739 -0.0629888 -0.580743 1.02489 -0.0603361 -0.570068 1.02228 -0.0572836 -0.560072 1.01962 -0.05379 -0.550813 1.01694 -0.0498233 -0.542329 1.0143 -0.045352 -0.53458 1.01168 -0.0403168 -0.527534 1.00899 -0.0346452 -0.521305 1.00618 -0.02831 -0.516125 1.00338 -0.0213556 -0.512239 1.00083 -0.0139102 -0.509878 0.998897 -0.00634747 -0.509165 0.998116 1.727e-06 -0.509878 0.998897 0.00635098 -0.512238 1.00083 0.0139139 -0.516124 1.00338 0.0213596 -0.521304 1.00618 0.0283145 -0.527532 1.00899 0.0346502 -0.534579 1.01168 0.0403223 -0.542328 1.0143 0.0453582 -0.550812 1.01694 0.0498302 -0.56007 1.01961 0.0537978 -0.570066 1.02228 0.0572922 -0.580742 1.02489 0.0603455 -0.592038 1.02739 0.0629992 -0.603899 1.02976 0.0653011 -0.616276 1.03198 0.0673002 -0.629124 1.03403 0.069042 -0.642401 1.0359 0.0705655 -0.656057 1.03757 0.0719059 -0.67004 1.03905 0.0730936 -0.684293 1.0403 0.0741547 -0.698751 1.04131 0.0751107 -0.713345 1.04207 0.0759787 -0.727999 1.04258 0.076771 -0.742638 1.04284 0.0774954 -0.757187 1.04286 0.0781555 -0.771577 1.04268 0.078751 -0.785742 1.04231 0.0792802 -0.799622 1.0418 0.0797423 -0.813167 1.04118 0.0801405 -0.826338 1.04048 0.0804777 -0.839101 1.03971 0.0807568 -0.851431 1.03892 0.080981 -0.863305 1.03811 0.0811552 -0.874707 1.0373 0.0812862 -0.885629 1.03649 0.0813817 -0.896069 1.0357 0.0814492 -0.906034 1.03493 0.0814949 -0.915543 1.03418 0.0815239 -0.924623 1.03345 0.0815395 -0.933313 1.03274 0.0815434 -0.941666 1.03206 0.0815361 -0.949744 1.0314 0.081516 -0.957622 1.03077 0.0814804 -0.965375 1.03016 0.0814222 -0.973031 1.02963 0.0813161 -0.981184 1.02926 0.081064 -0.991239 1.02887 0.0807296 -1.00615 1.02839 0.0802633 -1.03183 1.0278 0.0796137 -1.0794 1.02713 0.0788424 -1.16744 1.02643 0.0781423 -1.32202 1.02566 0.0776898 -1.57709 1.02508 0.0775616 -1.97709 1.02503 0.0776411 -2.58041 1.0258 0.0776256 -3.46312 1.02758 0.0770237 -4.7159 1.05897 0.0219491 -0.620151 1.07365 -0.091805 -0.605073 1.07072 -0.0894248 -0.59038 1.06754 -0.0867348 -0.576139 1.06416 -0.0836934 -0.562428 1.06058 -0.0802606 -0.549331 1.05685 -0.0764001 -0.536934 1.05301 -0.0720826 -0.525326 1.04913 -0.0672855 -0.514583 1.04526 -0.0619901 -0.504753 1.04148 -0.0561679 -0.495806 1.03776 -0.0497544 -0.487723 1.034 -0.0426735 -0.480633 1.03019 -0.0348872 -0.474778 1.02644 -0.0264117 -0.470409 1.02307 -0.0173405 -0.467753 1.02052 -0.00804346 -0.466935 1.01947 3.299e-06 -0.467752 1.02052 0.00805011 -0.470408 1.02307 0.0173474 -0.474777 1.02644 0.0264191 -0.480631 1.03019 0.0348954 -0.487721 1.034 0.0426826 -0.495804 1.03776 0.0497647 -0.504751 1.04148 0.0561794 -0.514581 1.04526 0.062003 -0.525324 1.04913 0.0673 -0.536932 1.05301 0.0720987 -0.549329 1.05685 0.076418 -0.562428 1.06058 0.0802802 -0.576139 1.06416 0.083715 -0.59038 1.06754 0.0867583 -0.605075 1.07071 0.0894503 -0.620153 1.07365 0.0918324 -0.63555 1.07634 0.0939471 -0.651205 1.07876 0.0958356 -0.667056 1.08091 0.097535 -0.683041 1.08277 0.0990775 -0.699092 1.08435 0.100489 -0.715141 1.08565 0.101789 -0.73112 1.08667 0.102991 -0.746959 1.08744 0.104103 -0.762596 1.08799 0.105125 -0.777971 1.08834 0.106057 -0.793031 1.08852 0.1069 -0.807734 1.08857 0.107655 -0.822045 1.08851 0.108327 -0.835941 1.08836 0.108918 -0.849402 1.08815 0.109433 -0.862413 1.08788 0.109877 -0.874968 1.08758 0.110257 -0.887065 1.08725 0.110582 -0.89871 1.08689 0.110859 -0.909916 1.08651 0.111095 -0.920705 1.08611 0.111295 -0.931106 1.08568 0.111463 -0.94116 1.08523 0.111602 -0.950919 1.08475 0.111712 -0.960447 1.08426 0.111793 -0.969819 1.08376 0.111841 -0.979111 1.08324 0.111849 -0.988348 1.08275 0.111788 -0.998144 1.08238 0.111549 -1.00998 1.08196 0.111214 -1.02681 1.08142 0.110737 -1.05425 1.08073 0.110063 -1.10263 1.07991 0.109219 -1.19003 1.07902 0.108403 -1.34321 1.07814 0.107891 -1.59699 1.07748 0.10779 -1.99574 1.07748 0.107882 -2.59702 1.07852 0.107657 -3.47519 1.08084 0.106093 -4.7159 1.11869 0.0360221 -0.572056 1.13972 -0.117695 -0.554042 1.13487 -0.114023 -0.536481 1.12974 -0.109963 -0.51948 1.12438 -0.105489 -0.503147 1.11883 -0.100578 -0.487594 1.11315 -0.0952106 -0.472926 1.10742 -0.0893718 -0.459239 1.10171 -0.0830465 -0.446613 1.0961 -0.0762143 -0.435093 1.09068 -0.0688363 -0.424653 1.08542 -0.0608352 -0.415286 1.08023 -0.052126 -0.407138 1.07508 -0.0426551 -0.400467 1.07013 -0.0324061 -0.39553 1.06574 -0.0214344 -0.392552 1.06245 -0.0100989 -0.391634 1.06108 5.755e-06 -0.392552 1.06245 0.0101105 -0.395529 1.06574 0.0214463 -0.400465 1.07013 0.0324189 -0.407136 1.07508 0.0426692 -0.415283 1.08023 0.0521417 -0.42465 1.08542 0.060853 -0.435091 1.09068 0.0688565 -0.446611 1.09611 0.0762371 -0.459238 1.10171 0.0830723 -0.472925 1.10742 0.0894008 -0.487594 1.11315 0.095243 -0.503149 1.11883 0.100614 -0.519482 1.12438 0.105529 -0.536485 1.12974 0.110007 -0.554048 1.13487 0.114071 -0.572063 1.13971 0.117747 -0.59043 1.14425 0.12107 -0.609053 1.14844 0.124076 -0.627842 1.15227 0.126804 -0.646713 1.15574 0.129288 -0.665584 1.15884 0.131561 -0.684377 1.16157 0.133647 -0.703017 1.16396 0.135565 -0.721435 1.16601 0.137329 -0.739571 1.16777 0.138945 -0.757369 1.16927 0.140417 -0.774784 1.17053 0.141749 -0.79178 1.17159 0.14295 -0.808334 1.17247 0.144025 -0.824429 1.1732 0.144984 -0.840055 1.1738 0.145832 -0.85521 1.17428 0.146581 -0.869896 1.17467 0.147238 -0.884121 1.17495 0.147815 -0.897902 1.17516 0.148323 -0.911259 1.17528 0.148769 -0.92422 1.17532 0.149162 -0.936824 1.17528 0.149506 -0.949116 1.17518 0.149807 -0.961153 1.175 0.150065 -0.973007 1.17476 0.15028 -0.984761 1.17446 0.150452 -0.996498 1.17411 0.15057 -1.00825 1.17374 0.150603 -1.02066 1.17345 0.150428 -1.03537 1.1731 0.150151 -1.0554 1.17265 0.149743 -1.08621 1.17206 0.149158 -1.13732 1.17133 0.148406 -1.22564 1.17055 0.147626 -1.37779 1.16982 0.147109 -1.62962 1.16934 0.147028 -2.02592 1.16955 0.147105 -2.62325 1.17093 0.146553 -3.49349 1.17391 0.143317 -4.7159 1.21809 0.0591732 -0.478411 1.25197 -0.148899 -0.456119 1.24407 -0.14359 -0.434495 1.23588 -0.137846 -0.413672 1.22747 -0.131654 -0.393774 1.21893 -0.125003 -0.374921 1.21034 -0.117882 -0.35722 1.20181 -0.110279 -0.340764 1.19342 -0.102175 -0.325625 1.18529 -0.093541 -0.311846 1.17751 -0.0843217 -0.299399 1.17005 -0.0744257 -0.288295 1.16283 -0.0637586 -0.278703 1.15582 -0.0522473 -0.270906 1.14923 -0.0398363 -0.265187 1.14349 -0.0265376 -0.261778 1.13922 -0.0126931 -0.260737 1.13744 9.216e-06 -0.261777 1.13922 0.0127116 -0.265185 1.14349 0.0265566 -0.270904 1.14924 0.0398567 -0.278699 1.15582 0.0522697 -0.288291 1.16283 0.0637838 -0.299396 1.17006 0.0744545 -0.311843 1.17751 0.0843548 -0.325624 1.18529 0.0935787 -0.340763 1.19342 0.102218 -0.357222 1.20181 0.110328 -0.374925 1.21035 0.117937 -0.39378 1.21893 0.125065 -0.413681 1.22748 0.131723 -0.434508 1.23588 0.137923 -0.456135 1.24408 0.143674 -0.478431 1.25198 0.148992 -0.501263 1.25952 0.153897 -0.524498 1.26666 0.158414 -0.548007 1.27334 0.162572 -0.571664 1.27954 0.166401 -0.595349 1.28523 0.169926 -0.618947 1.29042 0.173174 -0.642354 1.29511 0.176162 -0.665476 1.29932 0.178906 -0.688231 1.30308 0.181416 -0.710552 1.30643 0.183701 -0.732384 1.3094 0.18577 -0.753691 1.31204 0.187638 -0.774448 1.31437 0.189317 -0.794646 1.31642 0.190823 -0.81428 1.31824 0.192167 -0.833359 1.31983 0.193367 -0.851896 1.32122 0.194436 -0.869914 1.32243 0.195392 -0.887442 1.32347 0.196247 -0.904516 1.32436 0.197016 -0.921181 1.32509 0.19771 -0.937492 1.32569 0.198338 -0.953511 1.32615 0.198905 -0.969314 1.32649 0.199418 -0.984992 1.32671 0.199876 -1.00065 1.32683 0.200279 -1.01639 1.32686 0.200619 -1.03226 1.32683 0.200855 -1.04901 1.32685 0.20085 -1.06845 1.32682 0.200746 -1.09386 1.32674 0.200544 -1.13065 1.32661 0.200223 -1.18772 1.32645 0.199793 -1.28042 1.32633 0.199329 -1.43381 1.32631 0.199017 -1.68384 1.32653 0.199017 -2.07601 1.32732 0.199033 -2.66599 1.32927 0.197937 -3.52217 1.33327 0.19178 -4.7159 1.38351 0.0972692 -0.310572 1.44208 -0.189373 -0.281772 1.42939 -0.182006 -0.253999 1.41642 -0.174158 -0.227404 1.4033 -0.165824 -0.202125 1.39013 -0.156999 -0.178282 1.37706 -0.147676 -0.155982 1.36421 -0.137842 -0.13531 1.35171 -0.127472 -0.116332 1.3397 -0.116523 -0.0990815 1.32828 -0.104923 -0.0835334 1.31747 -0.092563 -0.0697148 1.30713 -0.079339 -0.0578312 1.29731 -0.0651481 -0.0482145 1.28825 -0.0498779 -0.0412042 1.28049 -0.0334766 -0.0370726 1.2748 -0.0162561 -0.0358349 1.27242 1.3708e-05 -0.0370714 1.2748 0.0162835 -0.0412019 1.28049 0.0335048 -0.0482114 1.28826 0.049908 -0.0578275 1.29731 0.0651815 -0.0697111 1.30714 0.0793768 -0.0835302 1.31747 0.0926065 -0.0990795 1.3283 0.104973 -0.116332 1.33971 0.116581 -0.135313 1.35173 0.127538 -0.155987 1.36422 0.137918 -0.178292 1.37708 0.147763 -0.20214 1.39015 0.157098 -0.227425 1.40331 0.165936 -0.254026 1.41644 0.174284 -0.281806 1.42941 0.182146 -0.310614 1.44209 0.189528 -0.34029 1.4544 0.196441 -0.370669 1.46622 0.202899 -0.401577 1.47747 0.208923 -0.432843 1.48807 0.214534 -0.464293 1.49799 0.219751 -0.495757 1.50719 0.224595 -0.527079 1.51566 0.229079 -0.558112 1.52341 0.233218 -0.588729 1.53046 0.237021 -0.618822 1.53685 0.240499 -0.648305 1.54262 0.243663 -0.677113 1.54782 0.246533 -0.705207 1.5525 0.249129 -0.732566 1.5567 0.251471 -0.759184 1.56047 0.25358 -0.785071 1.56385 0.25548 -0.810252 1.56687 0.257192 -0.834765 1.56957 0.258739 -0.85866 1.57197 0.260144 -0.882 1.57411 0.261425 -0.90486 1.57599 0.262601 -0.927328 1.57766 0.263685 -0.949506 1.57911 0.264688 -0.971511 1.58037 0.26562 -0.993479 1.58145 0.266484 -1.01556 1.58238 0.267283 -1.03792 1.58316 0.268007 -1.06063 1.58384 0.268606 -1.08458 1.58456 0.268921 -1.1119 1.58526 0.269147 -1.1462 1.586 0.269321 -1.19306 1.58684 0.269457 -1.26094 1.58785 0.269578 -1.36363 1.58909 0.26972 -1.52352 1.59056 0.269935 -1.77426 1.59228 0.270212 -2.16069 1.5944 0.270124 -2.73745 1.5975 0.268029 -3.56849 1.60357 0.257072 -4.7159 1.65882 0.159971 -0.0210004 1.76658 -0.247063 --0.0185217 1.74608 -0.236823 --0.0564439 1.72533 -0.226027 --0.0925868 1.70451 -0.21468 --0.126795 1.68381 -0.202788 --0.158936 1.66342 -0.190348 --0.188906 1.64353 -0.177348 --0.216623 1.62432 -0.163756 --0.242034 1.60596 -0.149516 --0.265119 1.58861 -0.134534 --0.285907 1.57228 -0.118683 --0.304354 1.55689 -0.101839 --0.320213 1.54249 -0.0838529 --0.333073 1.52945 -0.0645159 --0.342472 1.51845 -0.043664 --0.348003 1.5105 -0.0215396 --0.349642 1.50719 1.8591e-05 --0.348004 1.5105 0.0215767 --0.342474 1.51845 0.0437021 --0.333076 1.52946 0.0645567 --0.320215 1.5425 0.0838983 --0.304356 1.55691 0.101891 --0.285908 1.5723 0.118743 --0.265118 1.58863 0.134604 --0.24203 1.60599 0.149597 --0.216613 1.62435 0.16385 --0.18889 1.64356 0.177457 --0.158913 1.66346 0.190474 --0.126763 1.68385 0.202932 --0.0925445 1.70455 0.214845 --0.0563899 1.72537 0.226214 --0.0184547 1.74612 0.237035 -0.0210815 1.76662 0.247301 -0.0620195 1.78669 0.257014 -0.104143 1.80615 0.266178 -0.147223 1.82486 0.274803 -0.191017 1.8427 0.282901 -0.235278 1.85955 0.290485 -0.279757 1.87534 0.297568 -0.324216 1.89003 0.304161 -0.368428 1.9036 0.310273 -0.41219 1.91606 0.315914 -0.455323 1.92746 0.321094 -0.497675 1.93783 0.325829 -0.539131 1.94724 0.330143 -0.579607 1.95575 0.334063 -0.619051 1.96343 0.337617 -0.65744 1.97036 0.340834 -0.694778 1.97661 0.343747 -0.731094 1.98224 0.346388 -0.766445 1.98731 0.34879 -0.800913 1.99189 0.350986 -0.834604 1.99602 0.353003 -0.867645 1.99974 0.354869 -0.900191 2.00311 0.356606 -0.932416 2.00616 0.358234 -0.964522 2.00891 0.359766 -0.996737 2.01141 0.361214 -1.02932 2.01369 0.362584 -1.06253 2.01577 0.363869 -1.09655 2.0177 0.36501 -1.13248 2.01966 0.365817 -1.17282 2.02163 0.366545 -1.22164 2.02376 0.367264 -1.28475 2.02615 0.368018 -1.37027 2.02893 0.368843 -1.49058 2.03215 0.369746 -1.66483 2.03582 0.370668 -1.92185 2.03989 0.371368 -2.3019 2.04439 0.371047 -2.8562 2.04993 0.367191 -3.64385 2.06028 0.350286 -4.7159 2.11699 0.263191 --0.47153 2.32494 -0.334651 --0.529435 2.29119 -0.320037 --0.584804 2.25719 -0.304736 --0.637397 2.22324 -0.288772 --0.687016 2.18965 -0.272165 --0.733503 2.15672 -0.254927 --0.776743 2.12475 -0.237054 --0.816659 2.09401 -0.218516 --0.853214 2.06474 -0.199245 --0.886411 2.03718 -0.179127 --0.916296 2.01139 -0.158011 --0.942829 1.98736 -0.135747 --0.965737 1.96521 -0.112105 --0.984514 1.94545 -0.0867209 --0.998478 1.92902 -0.0592298 --1.00688 1.91735 -0.0297056 --1.00942 1.91257 2.0838e-05 --1.00688 1.91735 0.0297472 --0.998479 1.92904 0.0592725 --0.984514 1.94547 0.0867667 --0.965736 1.96523 0.112156 --0.942827 1.98739 0.135806 --0.916292 2.01143 0.15808 --0.886402 2.03722 0.179208 --0.853199 2.06479 0.199341 --0.816636 2.09406 0.218628 --0.77671 2.12481 0.237185 --0.733459 2.15679 0.25508 --0.686957 2.18972 0.272342 --0.637321 2.22332 0.288977 --0.584708 2.25727 0.304973 --0.529317 2.29128 0.320308 --0.471387 2.32503 0.33496 --0.411194 2.35824 0.34891 --0.349045 2.3906 0.362147 --0.285275 2.42188 0.374667 --0.22024 2.45183 0.38647 --0.154313 2.48028 0.39756 --0.0878692 2.50707 0.407942 --0.0212799 2.5321 0.417625 -0.0451014 2.55533 0.426617 -0.110947 2.57674 0.43493 -0.175964 2.59637 0.442578 -0.239898 2.61428 0.449583 -0.302542 2.63053 0.455978 -0.363738 2.64525 0.4618 -0.423378 2.65853 0.467089 -0.4814 2.6705 0.471889 -0.53779 2.68128 0.476243 -0.592579 2.69099 0.480199 -0.645849 2.69974 0.483805 -0.697728 2.70764 0.487106 -0.74839 2.7148 0.490145 -0.798054 2.72129 0.492962 -0.846986 2.72722 0.495593 -0.895495 2.73266 0.498067 -0.943938 2.73767 0.500411 -0.992718 2.74231 0.502646 -1.04229 2.74664 0.504785 -1.09313 2.75071 0.506829 -1.14568 2.75459 0.508718 -1.2013 2.75848 0.510239 -1.26288 2.76241 0.511688 -1.33482 2.76657 0.513158 -1.423 2.7711 0.514704 -1.53499 2.77615 0.516352 -1.68135 2.78179 0.518067 -1.87744 2.78806 0.519686 -2.14559 2.79501 0.520753 -2.51777 2.80282 0.520093 -3.03774 2.81249 0.514629 -3.75888 2.82904 0.49559 -4.7159 2.87949 0.433131 --1.3001 3.30278 -0.473788 --1.39149 3.24521 -0.45238 --1.47868 3.18726 -0.429979 --1.56127 3.12948 -0.406646 --1.63896 3.07242 -0.38244 --1.71153 3.01661 -0.357411 --1.77883 2.96256 -0.331591 --1.84079 2.91073 -0.304979 --1.8974 2.86153 -0.277524 --1.94871 2.81532 -0.249112 --1.99484 2.77231 -0.21958 --2.03579 2.73264 -0.18873 --2.07138 2.69661 -0.156207 --2.10107 2.66496 -0.121426 --2.12392 2.63897 -0.0836916 --2.13843 2.62081 -0.0426958 --2.14323 2.61363 1.4499e-05 --2.13843 2.62081 0.0427247 --2.12391 2.63899 0.0837214 --2.10107 2.66498 0.121458 --2.07138 2.69664 0.156244 --2.03579 2.73267 0.188772 --1.99483 2.77235 0.219631 --1.9487 2.81536 0.249173 --1.89738 2.86158 0.277597 --1.84076 2.91079 0.305065 --1.77879 2.96263 0.331694 --1.71148 3.01669 0.357532 --1.63889 3.07251 0.382583 --1.56118 3.12958 0.406814 --1.47856 3.18737 0.430175 --1.39135 3.24533 0.452607 --1.29993 3.3029 0.474051 --1.20475 3.35954 0.494457 --1.10634 3.41473 0.51379 --1.00529 3.46799 0.532029 --0.902217 3.51892 0.549163 --0.797783 3.56716 0.565197 --0.692648 3.61245 0.580145 --0.587463 3.65462 0.594029 --0.482846 3.69356 0.606878 --0.37936 3.72927 0.618727 --0.277505 3.7618 0.629619 --0.177701 3.79126 0.639602 --0.0802816 3.81781 0.648737 -0.0145079 3.84166 0.657087 -0.106511 3.86301 0.664716 -0.195654 3.88211 0.671688 -0.281946 3.89916 0.678069 -0.365472 3.91441 0.683923 -0.446395 3.92807 0.689315 -0.524949 3.94035 0.694306 -0.601436 3.95142 0.698951 -0.676233 3.96147 0.703304 -0.749779 3.97065 0.707411 -0.822586 3.97909 0.711318 -0.895237 3.98692 0.715062 -0.968392 3.99424 0.718678 -1.04279 4.00115 0.722192 -1.11924 4.00773 0.725618 -1.19858 4.01407 0.728922 -1.28241 4.02034 0.731945 -1.37356 4.02663 0.734947 -1.476 4.03309 0.738024 -1.59469 4.03986 0.741229 -1.7357 4.04705 0.744571 -1.90713 4.05476 0.747984 -2.12049 4.06311 0.751278 -2.3928 4.07226 0.754016 -2.74984 4.0826 0.75524 -3.22975 4.09523 0.75284 -3.88027 4.11369 0.742112 -4.7159 4.14844 0.712955 --2.70548 5.11196 -0.710097 --2.87345 5.00304 -0.681029 --3.03217 4.89407 -0.649683 --3.18102 4.78631 -0.616015 --3.31954 4.68096 -0.580006 --3.44744 4.57913 -0.541668 --3.56457 4.48176 -0.501041 --3.67092 4.38968 -0.458199 --3.76664 4.30348 -0.413246 --3.85196 4.22356 -0.36632 --3.92727 4.15007 -0.31759 --3.99309 4.08292 -0.267251 --4.05004 4.02174 -0.215528 --4.0989 3.96587 -0.162668 --4.14057 3.91438 -0.108937 --4.17613 3.86602 -0.0546173 --4.20681 3.81924 0 --4.17613 3.86602 0.0546173 --4.14057 3.91438 0.108937 --4.0989 3.96587 0.162668 --4.05004 4.02174 0.215528 --3.99309 4.08292 0.267251 --3.92727 4.15007 0.31759 --3.85196 4.22356 0.36632 --3.76664 4.30348 0.413246 --3.67092 4.38968 0.458199 --3.56457 4.48176 0.501041 --3.44744 4.57913 0.541668 --3.31954 4.68096 0.580006 --3.18102 4.78631 0.616015 --3.03217 4.89407 0.649683 --2.87345 5.00304 0.681029 --2.70548 5.11196 0.710097 --2.52906 5.21954 0.736957 --2.34515 5.32452 0.761699 --2.15487 5.4257 0.78443 --1.9595 5.52197 0.805274 --1.76047 5.61236 0.824364 --1.55929 5.69605 0.841843 --1.35757 5.77242 0.857858 --1.157 5.84107 0.872557 --0.959246 5.90179 0.886089 --0.765969 5.95458 0.898599 --0.578775 5.99966 0.910227 --0.399176 6.03741 0.921106 --0.228554 6.06839 0.931358 --0.0681423 6.09327 0.941099 -0.0810073 6.1128 0.950431 -0.21804 6.12779 0.95945 -0.342315 6.13908 0.96838 -0.453423 6.14746 0.97731 -0.551182 6.15368 0.98624 -0.635659 6.15878 0.995169 -0.707183 6.16386 1.0041 -0.766338 6.16893 1.01303 -0.81397 6.174 1.02196 -0.851204 6.17907 1.03089 -0.879466 6.18415 1.03982 -0.900493 6.18922 1.04875 -0.916354 6.19429 1.05768 -0.929465 6.19936 1.06661 -0.942969 6.20444 1.07554 -0.962173 6.20951 1.08447 -0.994267 6.21458 1.0934 -1.04848 6.21965 1.10232 -1.13666 6.22473 1.11126 -1.27404 6.2298 1.12018 -1.48014 6.23487 1.12912 -1.78007 6.23994 1.13804 -2.20603 6.24502 1.14698 -2.7994 6.25009 1.1559 -3.61329 6.25516 1.16483 -4.7159 6.26023 1.17376 -0.668771 1.00901 -0.0141214 -0.657596 1.00832 -0.0140031 -0.64697 1.00753 -0.0138448 -0.636943 1.00666 -0.0136392 -0.627557 1.00571 -0.0133765 -0.618846 1.00469 -0.0130451 -0.610837 1.0036 -0.0126316 -0.603551 1.00247 -0.012123 -0.596998 1.00132 -0.0115073 -0.591179 1.00018 -0.0107752 -0.586026 0.998942 -0.00988571 -0.581418 0.997377 -0.00874512 -0.577327 0.995393 -0.00728596 -0.573802 0.993104 -0.00559099 -0.570867 0.990668 -0.00377745 -0.568509 0.988169 -0.00190639 -0.566739 0.985633 0 -0.568509 0.988169 0.00190639 -0.570867 0.990668 0.00377745 -0.573802 0.993104 0.00559099 -0.577327 0.995393 0.00728596 -0.581418 0.997377 0.00874512 -0.586026 0.998942 0.00988571 -0.591179 1.00018 0.0107752 -0.596998 1.00132 0.0115073 -0.603551 1.00247 0.012123 -0.610837 1.0036 0.0126316 -0.618846 1.00469 0.0130451 -0.627557 1.00571 0.0133765 -0.636943 1.00666 0.0136392 -0.64697 1.00753 0.0138448 -0.657596 1.00832 0.0140031 -0.668771 1.00901 0.0141214 -0.680437 1.00962 0.0142047 -0.692527 1.01011 0.0142559 -0.70497 1.01048 0.0142763 -0.717685 1.01071 0.0142656 -0.730592 1.01077 0.0142226 -0.743609 1.01065 0.0141451 -0.756655 1.01034 0.0140305 -0.769655 1.00982 0.0138754 -0.782537 1.00912 0.0136754 -0.795237 1.00825 0.0134251 -0.807693 1.00722 0.013118 -0.81985 1.00606 0.0127451 -0.831655 1.00481 0.0122949 -0.843057 1.00349 0.0117515 -0.854012 1.00211 0.0110928 -0.864479 1.0007 0.0102875 -0.874426 0.99929 0.00932758 -0.883827 0.997885 0.00835796 -0.892662 0.996496 0.00740245 -0.900922 0.995128 0.00646435 -0.908612 0.993788 0.00554803 -0.915749 0.992486 0.00465888 -0.922368 0.991229 0.00380241 -0.928515 0.990025 0.00298287 -0.934254 0.988876 0.0022023 -0.939663 0.987776 0.00145506 -0.944834 0.986704 0.00072714 -0.949877 0.985632 0 -0.955354 0.985632 0 -0.962297 0.985632 0 -0.974617 0.985632 0 -0.999589 0.985632 0 -1.0488 0.985633 0 -1.13938 0.985633 0 -1.29556 0.985633 0 -1.55072 0.985633 0 -1.94995 0.985633 0 -2.55343 0.985633 0 -3.44064 0.985633 0 -4.7159 0.985633 0 -0.66877 1.00903 -0.0141357 -0.657594 1.00833 -0.0140176 -0.646968 1.00754 -0.0138595 -0.636941 1.00668 -0.0136541 -0.627555 1.00573 -0.0133917 -0.618843 1.0047 -0.0130605 -0.610834 1.00361 -0.0126473 -0.603547 1.00248 -0.0121388 -0.596994 1.00133 -0.0115233 -0.591175 1.00018 -0.0107913 -0.58602 0.99895 -0.00990165 -0.58141 0.997385 -0.0087604 -0.577317 0.995401 -0.00729993 -0.57379 0.993112 -0.00560245 -0.570852 0.990678 -0.00378425 -0.568494 0.98818 -0.00190544 -0.566742 0.985652 0 -0.568494 0.98818 0.00190544 -0.570852 0.990678 0.00378425 -0.57379 0.993112 0.00560245 -0.577317 0.995401 0.00729994 -0.58141 0.997385 0.0087604 -0.58602 0.99895 0.00990165 -0.591175 1.00018 0.0107913 -0.596994 1.00133 0.0115233 -0.603547 1.00248 0.0121388 -0.610834 1.00361 0.0126473 -0.618843 1.0047 0.0130605 -0.627555 1.00573 0.0133917 -0.636941 1.00668 0.0136541 -0.646968 1.00754 0.0138595 -0.657594 1.00833 0.0140176 -0.66877 1.00903 0.0141357 -0.680436 1.00963 0.0142189 -0.692527 1.01012 0.0142701 -0.704969 1.0105 0.0142905 -0.717685 1.01072 0.0142798 -0.730592 1.01079 0.0142368 -0.743609 1.01067 0.0141596 -0.756655 1.01035 0.0140453 -0.769655 1.00984 0.0138904 -0.782538 1.00913 0.0136908 -0.795238 1.00826 0.013441 -0.807694 1.00723 0.0131343 -0.819851 1.00607 0.012762 -0.831656 1.00482 0.0123123 -0.843059 1.0035 0.0117695 -0.854014 1.00212 0.0111112 -0.864481 1.00071 0.0103063 -0.874429 0.999295 0.00934677 -0.88383 0.997889 0.00837745 -0.892665 0.996499 0.00742215 -0.900925 0.995131 0.00648417 -0.908614 0.99379 0.00556791 -0.915752 0.992487 0.00467876 -0.92237 0.99123 0.00382225 -0.928517 0.990026 0.00300268 -0.934257 0.988877 0.00222209 -0.939666 0.987777 0.00147485 -0.944837 0.986705 0.000746972 -0.949878 0.985636 1.9917e-05 -0.955354 0.985634 2.0174e-05 -0.962297 0.985633 2.0321e-05 -0.974618 0.985633 2.0585e-05 -0.99959 0.985633 2.0943e-05 -1.0488 0.985634 2.1109e-05 -1.13938 0.985634 2.1021e-05 -1.29556 0.985634 2.0911e-05 -1.55072 0.985634 2.0931e-05 -1.94996 0.985634 2.1145e-05 -2.55344 0.985634 2.1765e-05 -3.44064 0.985634 2.3375e-05 -4.7159 0.985649 5.542e-06 -0.668768 1.00905 -0.0141585 -0.657592 1.00835 -0.0140406 -0.646966 1.00757 -0.0138827 -0.636938 1.00669 -0.0136776 -0.627551 1.00574 -0.0134155 -0.618839 1.00472 -0.0130847 -0.61083 1.00363 -0.0126718 -0.603542 1.00249 -0.0121637 -0.596988 1.00134 -0.0115483 -0.591167 1.0002 -0.0108164 -0.586011 0.998963 -0.00992654 -0.581397 0.997397 -0.00878422 -0.577301 0.995412 -0.00732172 -0.57377 0.993124 -0.00562025 -0.570829 0.990692 -0.00379475 -0.568472 0.988198 -0.00190404 -0.566748 0.985687 0 -0.568472 0.988198 0.00190404 -0.570829 0.990692 0.00379475 -0.57377 0.993124 0.00562025 -0.577301 0.995412 0.00732173 -0.581397 0.997397 0.00878422 -0.586011 0.998963 0.00992654 -0.591167 1.0002 0.0108164 -0.596988 1.00134 0.0115483 -0.603542 1.00249 0.0121637 -0.61083 1.00363 0.0126718 -0.618839 1.00472 0.0130847 -0.627551 1.00574 0.0134155 -0.636938 1.00669 0.0136776 -0.646966 1.00757 0.0138827 -0.657592 1.00835 0.0140406 -0.668768 1.00905 0.0141585 -0.680434 1.00965 0.0142415 -0.692525 1.01015 0.0142926 -0.704968 1.01052 0.0143129 -0.717684 1.01075 0.0143024 -0.730591 1.01081 0.0142596 -0.743609 1.01069 0.0141826 -0.756656 1.01037 0.0140687 -0.769656 1.00986 0.0139144 -0.782539 1.00915 0.0137153 -0.795239 1.00828 0.0134663 -0.807696 1.00724 0.0131604 -0.819853 1.00609 0.012789 -0.831658 1.00484 0.0123402 -0.843061 1.00351 0.0117981 -0.854017 1.00213 0.0111407 -0.864485 1.00072 0.0103367 -0.874432 0.999303 0.00937805 -0.883834 0.997896 0.00840948 -0.892669 0.996505 0.00745478 -0.900929 0.995135 0.00651725 -0.908619 0.993794 0.00560128 -0.915756 0.99249 0.00471227 -0.922375 0.991233 0.00385583 -0.928522 0.990028 0.00303631 -0.934262 0.98888 0.0022558 -0.939671 0.987779 0.0015087 -0.944842 0.986707 0.000781066 -0.949881 0.985642 5.4881e-05 -0.955354 0.985636 5.4886e-05 -0.962299 0.985635 5.5138e-05 -0.97462 0.985635 5.5736e-05 -0.999593 0.985635 5.6577e-05 -1.0488 0.985635 5.6905e-05 -1.13938 0.985635 5.6585e-05 -1.29556 0.985635 5.6244e-05 -1.55072 0.985635 5.6277e-05 -1.94997 0.985635 5.6822e-05 -2.55345 0.985636 5.8401e-05 -3.44066 0.985637 6.2469e-05 -4.7159 0.985677 1.3937e-05 -0.668765 1.00908 -0.0141946 -0.657589 1.00838 -0.014077 -0.646961 1.0076 -0.0139195 -0.636933 1.00672 -0.0137148 -0.627546 1.00577 -0.0134531 -0.618833 1.00475 -0.0131227 -0.610822 1.00365 -0.0127103 -0.603533 1.00252 -0.0122026 -0.596978 1.00137 -0.0115876 -0.591156 1.00022 -0.0108558 -0.585996 0.998983 -0.00996544 -0.581377 0.997416 -0.00882138 -0.577276 0.99543 -0.00735572 -0.573739 0.993144 -0.00564791 -0.570795 0.990716 -0.00381098 -0.568438 0.988226 -0.00190207 -0.566758 0.985748 0 -0.568438 0.988226 0.00190207 -0.570795 0.990716 0.00381098 -0.573739 0.993144 0.00564792 -0.577276 0.99543 0.00735572 -0.581377 0.997416 0.00882138 -0.585996 0.998983 0.00996545 -0.591156 1.00022 0.0108558 -0.596978 1.00137 0.0115876 -0.603533 1.00252 0.0122026 -0.610822 1.00365 0.0127103 -0.618833 1.00475 0.0131227 -0.627546 1.00577 0.0134531 -0.636933 1.00672 0.0137148 -0.646961 1.0076 0.0139195 -0.657589 1.00838 0.014077 -0.668765 1.00908 0.0141946 -0.680432 1.00968 0.0142774 -0.692523 1.01018 0.0143284 -0.704967 1.01055 0.0143488 -0.717683 1.01078 0.0143384 -0.730591 1.01084 0.0142959 -0.743609 1.01072 0.0142194 -0.756656 1.0104 0.0141062 -0.769657 1.00989 0.0139526 -0.782541 1.00918 0.0137546 -0.795242 1.00831 0.0135067 -0.807699 1.00727 0.0132021 -0.819856 1.00612 0.012832 -0.831662 1.00486 0.0123847 -0.843065 1.00353 0.0118441 -0.854022 1.00215 0.0111882 -0.86449 1.00074 0.0103859 -0.874438 0.999317 0.00942907 -0.88384 0.997907 0.00846213 -0.892675 0.996514 0.00750881 -0.900936 0.995142 0.0065724 -0.908626 0.9938 0.00565725 -0.915764 0.992495 0.00476871 -0.922383 0.991237 0.00391256 -0.92853 0.990032 0.00309333 -0.93427 0.988883 0.00231316 -0.93968 0.987783 0.00156649 -0.944851 0.986711 0.00083958 -0.949886 0.985652 0.000116068 -0.955354 0.985641 0.000114512 -0.962301 0.985639 0.000114689 -0.974624 0.985638 0.000115658 -0.999597 0.985638 0.000117153 -1.04881 0.985639 0.000117645 -1.13939 0.985639 0.00011686 -1.29557 0.985638 0.000116083 -1.55073 0.985638 0.000116102 -1.94998 0.985638 0.000117154 -2.55346 0.985639 0.00012021 -3.44067 0.985642 0.000128017 -4.7159 0.985724 2.6202e-05 -0.66876 1.00913 -0.014252 -0.657583 1.00843 -0.0141347 -0.646955 1.00764 -0.0139776 -0.636926 1.00677 -0.0137734 -0.627537 1.00582 -0.0135123 -0.618823 1.00479 -0.0131825 -0.610811 1.0037 -0.0127708 -0.60352 1.00256 -0.0122638 -0.596962 1.0014 -0.0116493 -0.591137 1.00026 -0.0109176 -0.585972 0.999015 -0.0100262 -0.581346 0.997446 -0.00887926 -0.577236 0.995459 -0.00740861 -0.573692 0.993175 -0.0056908 -0.570741 0.990752 -0.003836 -0.568387 0.988271 -0.00189943 -0.566775 0.985857 0 -0.568387 0.988271 0.00189944 -0.570741 0.990752 0.003836 -0.573692 0.993175 0.0056908 -0.577236 0.995459 0.00740861 -0.581346 0.997446 0.00887927 -0.585972 0.999015 0.0100262 -0.591137 1.00026 0.0109176 -0.596962 1.0014 0.0116493 -0.60352 1.00256 0.0122638 -0.610811 1.0037 0.0127708 -0.618823 1.00479 0.0131826 -0.627537 1.00582 0.0135123 -0.636926 1.00677 0.0137734 -0.646955 1.00764 0.0139776 -0.657583 1.00843 0.0141347 -0.66876 1.00913 0.014252 -0.680428 1.00974 0.0143346 -0.69252 1.01023 0.0143855 -0.704964 1.01061 0.014406 -0.717681 1.01083 0.0143959 -0.73059 1.0109 0.0143539 -0.743609 1.01077 0.0142782 -0.756657 1.01046 0.014166 -0.769659 1.00994 0.0140138 -0.782544 1.00924 0.0138174 -0.795245 1.00835 0.0135713 -0.807703 1.00732 0.0132687 -0.819861 1.00616 0.0129008 -0.831668 1.0049 0.0124558 -0.843072 1.00357 0.0119178 -0.854029 1.00218 0.0112646 -0.864499 1.00076 0.0104653 -0.874448 0.999339 0.00951214 -0.88385 0.997927 0.00854847 -0.892686 0.99653 0.00759803 -0.900947 0.995155 0.00666404 -0.908637 0.99381 0.00575075 -0.915776 0.992504 0.00486339 -0.922396 0.991245 0.00400804 -0.928544 0.990039 0.00318963 -0.934284 0.98889 0.00241034 -0.939694 0.987789 0.00166478 -0.944865 0.986718 0.000939619 -0.949894 0.985671 0.000222478 -0.955354 0.985649 0.00021653 -0.962304 0.985645 0.000216146 -0.97463 0.985644 0.000217411 -0.999605 0.985644 0.000219765 -1.04882 0.985645 0.000220432 -1.1394 0.985645 0.000218814 -1.29558 0.985644 0.000217239 -1.55075 0.985644 0.000217177 -1.95 0.985644 0.000219 -2.55349 0.985646 0.000224313 -3.4407 0.98565 0.000237743 -4.7159 0.985803 4.401e-05 -0.668752 1.00922 -0.0143428 -0.657574 1.00852 -0.0142259 -0.646944 1.00772 -0.0140693 -0.636914 1.00685 -0.0138657 -0.627523 1.00589 -0.0136054 -0.618807 1.00486 -0.0132764 -0.610792 1.00376 -0.0128657 -0.603498 1.00262 -0.0123596 -0.596937 1.00146 -0.0117459 -0.591108 1.00031 -0.011014 -0.585935 0.999066 -0.0101207 -0.581297 0.997493 -0.00896904 -0.577173 0.995505 -0.00749047 -0.573617 0.993224 -0.00575689 -0.570658 0.99081 -0.00387439 -0.568312 0.988346 -0.0018963 -0.566801 0.986046 0 -0.568312 0.988346 0.0018963 -0.570658 0.99081 0.0038744 -0.573617 0.993224 0.0057569 -0.577173 0.995505 0.00749048 -0.581297 0.997493 0.00896905 -0.585935 0.999066 0.0101207 -0.591108 1.00031 0.011014 -0.596937 1.00146 0.0117459 -0.603499 1.00262 0.0123596 -0.610792 1.00376 0.0128657 -0.618807 1.00486 0.0132765 -0.627523 1.00589 0.0136054 -0.636914 1.00685 0.0138657 -0.646944 1.00772 0.0140693 -0.657574 1.00852 0.0142259 -0.668752 1.00922 0.0143428 -0.680421 1.00982 0.0144252 -0.692515 1.01032 0.0144762 -0.70496 1.01069 0.0144969 -0.717678 1.01092 0.0144873 -0.730589 1.01098 0.0144463 -0.743609 1.01086 0.0143719 -0.756659 1.01054 0.0142613 -0.769662 1.01002 0.0141113 -0.782548 1.00931 0.0139173 -0.795251 1.00843 0.0136741 -0.80771 1.00739 0.0133748 -0.81987 1.00622 0.0130104 -0.831677 1.00496 0.0125693 -0.843082 1.00362 0.0120355 -0.854041 1.00223 0.011387 -0.864513 1.00081 0.0105932 -0.874463 0.999377 0.00964684 -0.883866 0.997959 0.00868941 -0.892703 0.996557 0.00774461 -0.900965 0.995177 0.00681548 -0.908657 0.993828 0.00590604 -0.915797 0.99252 0.00502126 -0.922418 0.991259 0.00416779 -0.928567 0.990052 0.00335126 -0.934308 0.988902 0.00257404 -0.939719 0.9878 0.00183098 -0.94489 0.98673 0.00110962 -0.949909 0.985703 0.000405721 -0.955356 0.985664 0.000390012 -0.962312 0.985657 0.000387944 -0.974641 0.985655 0.000389143 -0.999617 0.985655 0.000392538 -1.04883 0.985656 0.000393382 -1.13942 0.985656 0.000390342 -1.29561 0.985655 0.00038736 -1.55078 0.985654 0.000387067 -1.95004 0.985654 0.000390044 -2.55354 0.985657 0.000398756 -3.44074 0.985665 0.000420507 -4.7159 0.985934 7.0116e-05 -0.668739 1.00935 -0.014486 -0.657559 1.00864 -0.0143694 -0.646927 1.00785 -0.0142134 -0.636894 1.00697 -0.0140105 -0.6275 1.00601 -0.013751 -0.618781 1.00497 -0.0134232 -0.610762 1.00387 -0.0130137 -0.603464 1.00272 -0.0125089 -0.596897 1.00156 -0.0118962 -0.59106 1.0004 -0.0111638 -0.585875 0.999147 -0.0102669 -0.581219 0.997568 -0.0091074 -0.577075 0.995578 -0.00761615 -0.573501 0.993302 -0.00585788 -0.570532 0.990902 -0.00393285 -0.568203 0.988471 -0.00189359 -0.56684 0.986362 1e-09 -0.568203 0.988471 0.00189359 -0.570532 0.990902 0.00393286 -0.573501 0.993302 0.0058579 -0.577075 0.995578 0.00761617 -0.581219 0.997568 0.00910741 -0.585875 0.999147 0.010267 -0.59106 1.0004 0.0111638 -0.596897 1.00156 0.0118962 -0.603464 1.00272 0.0125089 -0.610762 1.00387 0.0130137 -0.618781 1.00497 0.0134232 -0.6275 1.00601 0.013751 -0.636894 1.00697 0.0140105 -0.646927 1.00785 0.0142134 -0.657559 1.00864 0.0143695 -0.668739 1.00935 0.0144861 -0.68041 1.00996 0.0145684 -0.692505 1.01046 0.0146195 -0.704953 1.01084 0.0146407 -0.717673 1.01106 0.0146321 -0.730586 1.01113 0.0145927 -0.743609 1.011 0.0145203 -0.756661 1.01068 0.0144125 -0.769667 1.01016 0.0142658 -0.782556 1.00944 0.0140759 -0.795261 1.00855 0.0138372 -0.807721 1.0075 0.013543 -0.819882 1.00633 0.0131843 -0.831691 1.00506 0.0127495 -0.843099 1.00371 0.0122228 -0.85406 1.00231 0.0115824 -0.864536 1.00088 0.0107982 -0.874489 0.999442 0.00986407 -0.883893 0.998015 0.00891803 -0.892732 0.996604 0.0079837 -0.900996 0.995217 0.00706382 -0.90869 0.993863 0.00616188 -0.915832 0.99255 0.00528234 -0.922454 0.991287 0.00443287 -0.928605 0.990078 0.00362036 -0.934348 0.988926 0.00284751 -0.93976 0.987824 0.00210968 -0.944931 0.986756 0.00139613 -0.949937 0.985759 0.000716887 -0.955362 0.985693 0.000682564 -0.962327 0.985681 0.000676459 -0.974662 0.985677 0.000676578 -0.999641 0.985677 0.000680993 -1.04886 0.985679 0.000681949 -1.13944 0.985678 0.000676565 -1.29564 0.985676 0.000671164 -1.55083 0.985674 0.000670344 -1.9501 0.985675 0.000675009 -2.55361 0.985681 0.000688746 -3.44082 0.985694 0.00072254 -4.7159 0.986154 0.000109047 -0.668718 1.00956 -0.0147106 -0.657534 1.00885 -0.0145942 -0.646899 1.00805 -0.0144386 -0.636861 1.00716 -0.0142363 -0.627463 1.00619 -0.0139779 -0.618738 1.00514 -0.0136514 -0.610714 1.00403 -0.0132434 -0.603408 1.00288 -0.0127403 -0.596833 1.00171 -0.0121288 -0.590983 1.00054 -0.0113949 -0.585779 0.999276 -0.0104915 -0.581095 0.997687 -0.00931883 -0.57692 0.995695 -0.00780711 -0.57332 0.993428 -0.00601046 -0.57034 0.991051 -0.00402102 -0.568046 0.988683 -0.00189419 -0.566881 0.986864 1e-09 -0.568046 0.988683 0.0018942 -0.57034 0.991051 0.00402103 -0.57332 0.993428 0.00601048 -0.57692 0.995695 0.00780713 -0.581095 0.997687 0.00931885 -0.585779 0.999276 0.0104915 -0.590983 1.00054 0.011395 -0.596833 1.00171 0.0121288 -0.603408 1.00288 0.0127403 -0.610714 1.00403 0.0132435 -0.618738 1.00514 0.0136514 -0.627463 1.00619 0.0139779 -0.636861 1.00716 0.0142364 -0.646899 1.00805 0.0144386 -0.657534 1.00885 0.0145942 -0.668718 1.00956 0.0147106 -0.680392 1.01018 0.0147931 -0.69249 1.01068 0.0148447 -0.704941 1.01106 0.0148671 -0.717665 1.01129 0.0148603 -0.730581 1.01135 0.0148233 -0.743608 1.01122 0.0147544 -0.756665 1.0109 0.014651 -0.769675 1.01037 0.0145097 -0.782567 1.00965 0.014326 -0.795275 1.00875 0.0140946 -0.80774 1.00769 0.0138085 -0.819903 1.00651 0.0134591 -0.831715 1.00522 0.0130346 -0.843126 1.00386 0.0125196 -0.854092 1.00245 0.0118928 -0.864572 1.001 0.0111249 -0.87453 0.999552 0.0102119 -0.883938 0.998113 0.0092859 -0.892779 0.99669 0.00837023 -0.901046 0.995293 0.00746707 -0.908743 0.993929 0.00657899 -0.915889 0.99261 0.00570959 -0.922515 0.991343 0.00486817 -0.928669 0.990131 0.00406378 -0.934415 0.988977 0.0032997 -0.93983 0.987874 0.00257224 -0.945002 0.986811 0.00187393 -0.949986 0.985857 0.00123563 -0.955381 0.985753 0.00117063 -0.962361 0.985732 0.00115594 -0.974704 0.985724 0.00115265 -0.999684 0.985724 0.00115744 -1.0489 0.985726 0.0011582 -1.1395 0.985725 0.00114905 -1.29571 0.985722 0.00113961 -1.55092 0.985718 0.00113772 -1.95021 0.985719 0.00114479 -2.55373 0.985729 0.00116576 -3.44094 0.985752 0.00121647 -4.7159 0.986521 0.000168256 -0.668681 1.0099 -0.0150608 -0.657492 1.00918 -0.0149442 -0.646851 1.00836 -0.0147887 -0.636807 1.00746 -0.0145869 -0.627401 1.00648 -0.0143294 -0.618668 1.00542 -0.0140044 -0.610634 1.0043 -0.0135983 -0.603317 1.00314 -0.013097 -0.596727 1.00195 -0.0124863 -0.590858 1.00077 -0.0117488 -0.585623 0.999483 -0.0108332 -0.580897 0.997879 -0.00963863 -0.576676 0.995884 -0.00809348 -0.573038 0.993631 -0.00623771 -0.570048 0.991296 -0.00415258 -0.567824 0.989043 -0.00190524 -0.56689 0.987599 3e-09 -0.567824 0.989043 0.00190525 -0.570048 0.991296 0.0041526 -0.573038 0.993631 0.00623774 -0.576676 0.995884 0.00809352 -0.580897 0.997879 0.00963867 -0.585623 0.999483 0.0108333 -0.590858 1.00077 0.0117488 -0.596727 1.00195 0.0124864 -0.603317 1.00314 0.013097 -0.610634 1.0043 0.0135984 -0.618668 1.00542 0.0140044 -0.627401 1.00648 0.0143295 -0.636807 1.00746 0.014587 -0.646851 1.00836 0.0147888 -0.657492 1.00918 0.0149443 -0.668681 1.0099 0.0150609 -0.68036 1.01052 0.015144 -0.692464 1.01103 0.0151969 -0.70492 1.01142 0.0152214 -0.71765 1.01165 0.0152176 -0.730572 1.01171 0.0151849 -0.743606 1.01158 0.0151216 -0.756669 1.01125 0.0150252 -0.769686 1.01072 0.0148924 -0.782584 1.00998 0.0147189 -0.795299 1.00907 0.014499 -0.807768 1.008 0.014226 -0.819937 1.00679 0.0138913 -0.831753 1.00549 0.0134836 -0.84317 1.00411 0.0129877 -0.854142 1.00268 0.0123832 -0.864631 1.00122 0.0116427 -0.874596 0.999748 0.0107648 -0.884008 0.99829 0.00987241 -0.892855 0.99685 0.00898848 -0.901127 0.995437 0.00811415 -0.908831 0.99406 0.00725047 -0.915983 0.992732 0.00639976 -0.922616 0.99146 0.00557385 -0.928776 0.990243 0.0047851 -0.934527 0.989086 0.00403782 -0.939947 0.987982 0.00333007 -0.94512 0.986929 0.00265988 -0.950077 0.986033 0.00208123 -0.955434 0.98588 0.00197369 -0.962434 0.985842 0.00194246 -0.974788 0.985827 0.00193105 -0.999767 0.985827 0.0019341 -1.04899 0.98583 0.00193371 -1.13959 0.985828 0.00191863 -1.29582 0.985821 0.00190269 -1.55105 0.985815 0.00189879 -1.95038 0.985817 0.00190917 -2.55394 0.985834 0.0019402 -3.44114 0.985874 0.00201366 -4.7159 0.987135 0.000260003 -0.668617 1.01044 -0.0156042 -0.657419 1.00971 -0.0154865 -0.646769 1.00887 -0.0153304 -0.636714 1.00796 -0.0151286 -0.627297 1.00695 -0.0148716 -0.61855 1.00588 -0.0145477 -0.610499 1.00473 -0.0141432 -0.603163 1.00355 -0.0136432 -0.59655 1.00234 -0.0130317 -0.590647 1.00114 -0.0122856 -0.585363 0.999821 -0.0113481 -0.580573 0.998194 -0.0101164 -0.576285 0.996194 -0.00851633 -0.572596 0.993964 -0.00657036 -0.569603 0.991699 -0.00434677 -0.5675 0.98964 -0.00194112 -0.566789 0.98859 6e-09 -0.5675 0.98964 0.00194114 -0.569603 0.991699 0.0043468 -0.572596 0.993964 0.00657041 -0.576285 0.996194 0.00851639 -0.580573 0.998194 0.0101165 -0.585363 0.999821 0.0113481 -0.590647 1.00114 0.0122857 -0.59655 1.00234 0.0130317 -0.603163 1.00355 0.0136433 -0.610499 1.00473 0.0141433 -0.61855 1.00588 0.0145478 -0.627297 1.00695 0.0148717 -0.636714 1.00796 0.0151287 -0.646769 1.00887 0.0153306 -0.657419 1.00971 0.0154866 -0.668617 1.01044 0.0156043 -0.680304 1.01108 0.0156892 -0.692417 1.0116 0.0157447 -0.704881 1.01199 0.015773 -0.717621 1.01223 0.0157744 -0.730554 1.01229 0.0157488 -0.743598 1.01216 0.0156946 -0.756672 1.01182 0.0156095 -0.7697 1.01127 0.0154905 -0.78261 1.01053 0.015333 -0.795334 1.00959 0.0151316 -0.807813 1.0085 0.0148797 -0.81999 1.00727 0.0145688 -0.831814 1.00594 0.014188 -0.84324 1.00454 0.013723 -0.854222 1.00308 0.0131545 -0.864725 1.0016 0.012458 -0.874702 1.0001 0.011636 -0.884123 0.99862 0.0107978 -0.892977 0.997157 0.00996518 -0.90126 0.995722 0.009138 -0.908974 0.994328 0.00831509 -0.916138 0.992988 0.00749733 -0.922782 0.991708 0.0067001 -0.928952 0.990487 0.00594017 -0.934714 0.989326 0.00522365 -0.940143 0.988225 0.00455145 -0.945319 0.987192 0.00392953 -0.95025 0.986362 0.00342583 -0.955566 0.986155 0.00327096 -0.962595 0.986089 0.00321156 -0.974962 0.986061 0.00318362 -0.999933 0.986059 0.00317988 -1.04915 0.986062 0.00317587 -1.13976 0.986057 0.00315165 -1.29601 0.986044 0.00312569 -1.55129 0.986034 0.00311835 -1.95067 0.986037 0.00313308 -2.55427 0.986067 0.00317734 -3.44145 0.986135 0.00327945 -4.7159 0.988158 0.000404463 -0.668501 1.01133 -0.0164439 -0.657289 1.01056 -0.0163233 -0.646622 1.00971 -0.0161651 -0.636551 1.00876 -0.0159618 -0.627114 1.00772 -0.015704 -0.618344 1.00662 -0.01538 -0.610266 1.00544 -0.0149754 -0.602897 1.00423 -0.014474 -0.596243 1.00299 -0.0138564 -0.590285 1.00175 -0.0130914 -0.584923 1.00038 -0.012114 -0.580036 0.998717 -0.0108195 -0.57565 0.996711 -0.00912922 -0.571895 0.994518 -0.00704742 -0.568916 0.992365 -0.00463046 -0.566978 0.99058 -0.00202509 -0.566441 0.989856 1.1e-08 -0.566978 0.99058 0.00202512 -0.568916 0.992365 0.00463051 -0.571895 0.994518 0.0070475 -0.57565 0.996711 0.00912932 -0.580036 0.998717 0.0108196 -0.584923 1.00038 0.0121141 -0.590285 1.00175 0.0130916 -0.596243 1.00299 0.0138566 -0.602897 1.00423 0.0144742 -0.610266 1.00544 0.0149756 -0.618344 1.00662 0.0153802 -0.627114 1.00772 0.0157042 -0.636551 1.00876 0.015962 -0.646622 1.00971 0.0161653 -0.657289 1.01056 0.0163235 -0.668502 1.01133 0.0164441 -0.680203 1.01198 0.0165327 -0.69233 1.01252 0.0165934 -0.70481 1.01292 0.0166283 -0.717565 1.01316 0.0166388 -0.730515 1.01323 0.0166249 -0.743577 1.01309 0.0165855 -0.756671 1.01275 0.0165188 -0.769718 1.01219 0.0164218 -0.782646 1.01142 0.0162902 -0.795388 1.01047 0.0161186 -0.807882 1.00934 0.0159005 -0.820074 1.00808 0.0156277 -0.831913 1.00672 0.0152899 -0.843353 1.00529 0.0148736 -0.854352 1.0038 0.0143617 -0.864875 1.00228 0.0137334 -0.87487 1.00076 0.012996 -0.884306 0.999249 0.0122402 -0.893176 0.997759 0.011486 -0.901475 0.9963 0.0107315 -0.909208 0.994885 0.00997284 -0.916392 0.993533 0.00921032 -0.923056 0.992246 0.00846346 -0.929246 0.991021 0.00775394 -0.935027 0.989862 0.00709058 -0.940476 0.988772 0.00647822 -0.945662 0.987775 0.00593053 -0.950578 0.987011 0.00550861 -0.955872 0.986755 0.00531444 -0.962941 0.986645 0.00521516 -0.975323 0.986592 0.00515826 -1.00027 0.986582 0.00513784 -1.04946 0.986584 0.00512471 -1.14007 0.986572 0.00508676 -1.29635 0.986548 0.00504626 -1.55169 0.986529 0.00503359 -1.95115 0.986535 0.00505372 -2.55481 0.986586 0.00511388 -3.44196 0.986702 0.00524813 -4.7159 0.989862 0.000634836 -0.668284 1.01278 -0.0177368 -0.657045 1.01198 -0.0176098 -0.646351 1.01108 -0.0174463 -0.636248 1.01009 -0.0172383 -0.626777 1.00901 -0.0169763 -0.617967 1.00786 -0.0166479 -0.609842 1.00664 -0.0162378 -0.602416 1.00537 -0.0157271 -0.59569 1.00408 -0.0150905 -0.589636 1.00277 -0.0142852 -0.584148 1.00133 -0.0132356 -0.579118 0.999607 -0.0118344 -0.574597 0.997589 -0.00999783 -0.570758 0.995448 -0.00771544 -0.567809 0.993449 -0.0050399 -0.566041 0.991962 -0.00218533 -0.565607 0.991449 2.4e-08 -0.566041 0.991962 0.00218539 -0.567809 0.993449 0.00504 -0.570758 0.995448 0.00771557 -0.574597 0.997589 0.00999799 -0.579118 0.999607 0.0118346 -0.584148 1.00133 0.0132358 -0.589636 1.00277 0.0142855 -0.59569 1.00408 0.0150908 -0.602416 1.00537 0.0157274 -0.609842 1.00664 0.0162381 -0.617967 1.00786 0.0166482 -0.626777 1.00901 0.0169766 -0.636248 1.01009 0.0172386 -0.646351 1.01108 0.0174466 -0.657045 1.01198 0.0176102 -0.668284 1.01278 0.0177372 -0.680011 1.01347 0.0178336 -0.692163 1.01403 0.0179039 -0.704669 1.01445 0.017951 -0.717452 1.01471 0.0179769 -0.730432 1.01478 0.0179824 -0.743525 1.01465 0.0179674 -0.756651 1.0143 0.0179303 -0.76973 1.01372 0.0178686 -0.78269 1.01294 0.0177784 -0.795463 1.01195 0.0176545 -0.807986 1.01079 0.0174906 -0.820204 1.0095 0.0172781 -0.832068 1.0081 0.0170074 -0.843534 1.00663 0.0166662 -0.854561 1.00511 0.0162398 -0.865114 1.00356 0.0157124 -0.875139 1.00201 0.0150951 -0.8846 1.00048 0.0144567 -0.893496 0.99896 0.0138143 -0.901824 0.997479 0.013164 -0.90959 0.99605 0.0125003 -0.91681 0.994691 0.0118246 -0.923509 0.993404 0.0111602 -0.929737 0.992186 0.0105325 -0.935557 0.991043 0.0099535 -0.941043 0.989984 0.00943166 -0.946261 0.989044 0.0089826 -0.951202 0.98834 0.00864239 -0.95652 0.988046 0.00842776 -0.96365 0.987877 0.00828585 -0.976053 0.987778 0.00818715 -1.00094 0.987747 0.00813455 -1.05007 0.987742 0.00810174 -1.14065 0.987715 0.00804386 -1.29697 0.987669 0.00798412 -1.55238 0.987637 0.00796434 -1.95195 0.987647 0.00799066 -2.55567 0.987733 0.00806696 -3.44274 0.987928 0.00822913 -4.7159 0.992702 0.00100576 -0.667853 1.01524 -0.0197198 -0.656567 1.01438 -0.0195791 -0.645821 1.01342 -0.0194029 -0.635661 1.01236 -0.0191827 -0.626126 1.01121 -0.0189077 -0.617242 1.00998 -0.0185642 -0.60903 1.00868 -0.0181345 -0.601499 1.00734 -0.0175946 -0.594643 1.00595 -0.0169094 -0.588423 1.00452 -0.0160213 -0.582735 1.00296 -0.0148421 -0.577492 1.00116 -0.0132615 -0.572785 0.999111 -0.0111941 -0.56884 0.997025 -0.00862522 -0.565908 0.995176 -0.00561856 -0.564242 0.9939 -0.00244671 -0.563843 0.993481 5.1e-08 -0.564242 0.9939 0.00244682 -0.565908 0.995176 0.00561873 -0.56884 0.997025 0.00862545 -0.572785 0.999111 0.0111944 -0.577492 1.00116 0.0132619 -0.582735 1.00296 0.0148425 -0.588423 1.00452 0.0160217 -0.594643 1.00595 0.0169099 -0.601499 1.00734 0.0175951 -0.60903 1.00868 0.018135 -0.617242 1.00998 0.0185648 -0.626126 1.01121 0.0189083 -0.635661 1.01236 0.0191833 -0.645821 1.01342 0.0194036 -0.656567 1.01438 0.0195797 -0.667854 1.01524 0.0197205 -0.679627 1.01598 0.0198325 -0.691826 1.01658 0.0199209 -0.70438 1.01704 0.0199897 -0.717213 1.01732 0.0200422 -0.730245 1.01741 0.0200801 -0.743393 1.01729 0.0201045 -0.756575 1.01694 0.0201148 -0.769711 1.01636 0.0201092 -0.782727 1.01556 0.0200842 -0.795555 1.01456 0.020035 -0.808129 1.01337 0.0199552 -0.820395 1.01205 0.0198354 -0.832304 1.01062 0.0196657 -0.843815 1.00912 0.0194352 -0.854889 1.00758 0.0191316 -0.865491 1.00601 0.0187442 -0.875563 1.00444 0.0182849 -0.885068 1.00289 0.0178013 -0.894011 1.00137 0.0173056 -0.90239 0.999885 0.0167935 -0.910213 0.998462 0.0162597 -0.917494 0.997118 0.0157087 -0.924259 0.995855 0.0151657 -0.930556 0.994672 0.0146569 -0.93645 0.993574 0.0141961 -0.942016 0.992578 0.0137922 -0.947315 0.991717 0.0134551 -0.952352 0.991069 0.0131948 -0.957772 0.990748 0.0129818 -0.965016 0.990515 0.0128105 -0.97746 0.990345 0.0126663 -1.00224 0.990263 0.0125641 -1.05123 0.990234 0.0124949 -1.14173 0.990178 0.0124094 -1.29805 0.990093 0.0123277 -1.55356 0.990035 0.0123008 -1.95325 0.990053 0.0123337 -2.55705 0.990195 0.0124204 -3.44395 0.99051 0.0125896 -4.7159 0.997433 0.00160718 -0.666961 1.0195 -0.0227373 -0.655579 1.01855 -0.0225675 -0.644731 1.01748 -0.0223628 -0.634459 1.01631 -0.0221127 -0.624797 1.01504 -0.0218039 -0.615768 1.01369 -0.0214195 -0.607387 1.01226 -0.0209365 -0.599654 1.01077 -0.0203219 -0.592556 1.00922 -0.0195264 -0.586048 1.00761 -0.0184749 -0.580042 1.00586 -0.0170677 -0.574484 1.00391 -0.015195 -0.569518 1.0018 -0.0127809 -0.565411 0.999715 -0.00982433 -0.562417 0.997907 -0.00640824 -0.560738 0.996663 -0.00282678 -0.560322 0.996239 1.08e-07 -0.560738 0.996663 0.00282701 -0.562417 0.997907 0.00640854 -0.56541 0.999715 0.00982471 -0.569518 1.0018 0.0127814 -0.574484 1.00391 0.0151956 -0.580042 1.00586 0.0170684 -0.586048 1.00761 0.0184757 -0.592556 1.00922 0.0195272 -0.599654 1.01077 0.0203228 -0.607387 1.01226 0.0209375 -0.615768 1.01369 0.0214205 -0.624797 1.01504 0.021805 -0.634459 1.01631 0.0221138 -0.644731 1.01748 0.022364 -0.655579 1.01855 0.0225687 -0.666961 1.0195 0.0227386 -0.678826 1.02032 0.0228815 -0.691114 1.02101 0.023004 -0.703759 1.02153 0.0231117 -0.716684 1.02187 0.0232093 -0.729811 1.02201 0.0233005 -0.743057 1.02192 0.0233878 -0.75634 1.0216 0.0234719 -0.769577 1.02103 0.0235521 -0.782693 1.02025 0.0236256 -0.795617 1.01925 0.023688 -0.808284 1.01807 0.0237319 -0.820638 1.01675 0.0237459 -0.832631 1.01532 0.0237194 -0.844223 1.01382 0.0236416 -0.855379 1.01228 0.0235019 -0.866062 1.01073 0.0232931 -0.876215 1.00918 0.023024 -0.8858 1.00766 0.0227255 -0.894826 1.00617 0.0224054 -0.903296 1.00472 0.0220599 -0.911218 1.00335 0.0216868 -0.918606 1.00207 0.0212938 -0.925488 1.00088 0.0209052 -0.931911 0.999783 0.020544 -0.937944 0.998779 0.0202227 -0.943661 0.997883 0.0199475 -0.949131 0.997116 0.0197214 -0.954369 0.996525 0.0195383 -0.960002 0.996186 0.0193462 -0.967458 0.995896 0.0191693 -0.98001 0.995636 0.0189925 -1.00466 0.995461 0.0188316 -1.05338 0.99537 0.0187058 -1.14369 0.995259 0.0185843 -1.29996 0.99511 0.0184827 -1.55554 0.995011 0.0184534 -1.95535 0.995038 0.018493 -2.55918 0.995263 0.0185741 -3.44576 0.995752 0.0187016 -4.7159 1.00531 0.00258711 -0.665021 1.02707 -0.0272511 -0.65344 1.02595 -0.0270206 -0.642377 1.02471 -0.0267529 -0.631869 1.02334 -0.0264333 -0.621941 1.02187 -0.0260435 -0.61261 1.0203 -0.0255599 -0.603881 1.01863 -0.0249494 -0.59575 1.01687 -0.0241649 -0.588198 1.01504 -0.0231401 -0.581197 1.01311 -0.0217855 -0.574689 1.01108 -0.0199979 -0.568668 1.0089 -0.0176817 -0.563318 1.00661 -0.0147901 -0.558924 1.00438 -0.011348 -0.555734 1.0024 -0.0074393 -0.553935 1.00099 -0.00333794 -0.553473 1.00048 2.27e-07 -0.553935 1.00099 0.00333841 -0.555734 1.0024 0.00743986 -0.558923 1.00438 0.0113487 -0.563317 1.00661 0.0147909 -0.568668 1.0089 0.0176826 -0.574689 1.01108 0.0199991 -0.581197 1.01311 0.0217868 -0.588198 1.01504 0.0231415 -0.59575 1.01687 0.0241665 -0.603881 1.01863 0.0249511 -0.61261 1.0203 0.0255617 -0.621941 1.02187 0.0260455 -0.631869 1.02334 0.0264354 -0.642378 1.02471 0.0267551 -0.653441 1.02595 0.0270229 -0.665022 1.02708 0.0272535 -0.677075 1.02806 0.0274573 -0.689545 1.02888 0.0276432 -0.702367 1.02953 0.0278191 -0.71547 1.02999 0.0279921 -0.728777 1.03023 0.0281681 -0.742204 1.03023 0.0283514 -0.755668 1.02999 0.0285447 -0.769087 1.02951 0.0287483 -0.782382 1.0288 0.0289602 -0.795481 1.02787 0.0291755 -0.808317 1.02676 0.0293853 -0.820832 1.02551 0.0295754 -0.83298 1.02415 0.0297328 -0.844722 1.02273 0.0298456 -0.856025 1.02127 0.0299035 -0.866854 1.0198 0.0298991 -0.877151 1.01834 0.0298366 -0.886881 1.01692 0.0297365 -0.896058 1.01553 0.0296041 -0.904688 1.01421 0.029438 -0.912782 1.01296 0.0292388 -0.920356 1.01182 0.0290158 -0.927439 1.01077 0.0287897 -0.934084 1.00981 0.0285791 -0.940362 1.00894 0.0283933 -0.94635 1.00818 0.0282364 -0.952121 1.00752 0.0281074 -0.957698 1.00699 0.0279942 -0.96369 1.00664 0.0278355 -0.97151 1.0063 0.0276732 -0.984309 1.00595 0.0274866 -1.00886 1.00564 0.0272749 -1.05717 1.00543 0.0270771 -1.14711 1.00523 0.0269096 -1.3032 1.00498 0.0267953 -1.55878 1.00482 0.026775 -1.95867 1.00486 0.0268223 -2.56243 1.0052 0.0268692 -3.4484 1.00591 0.0268697 -4.7159 1.01843 0.00418927 -0.660613 1.04073 -0.0337843 -0.648595 1.03929 -0.0334302 -0.637057 1.03771 -0.0330272 -0.626025 1.03599 -0.0325534 -0.615518 1.03413 -0.0319813 -0.605543 1.03215 -0.0312751 -0.596105 1.03003 -0.0303877 -0.587205 1.0278 -0.0292571 -0.578851 1.02547 -0.0278074 -0.571052 1.02306 -0.0259514 -0.563791 1.02058 -0.0236024 -0.557099 1.018 -0.0206969 -0.551186 1.01533 -0.0172235 -0.54635 1.01272 -0.0132159 -0.542847 1.01037 -0.00872644 -0.540875 1.00864 -0.00398753 -0.540368 1.00798 4.63e-07 -0.540875 1.00864 0.00398848 -0.542847 1.01037 0.00872749 -0.54635 1.01272 0.0132172 -0.551186 1.01533 0.017225 -0.557099 1.018 0.0206987 -0.56379 1.02058 0.0236045 -0.571052 1.02306 0.0259537 -0.578851 1.02547 0.0278101 -0.587205 1.0278 0.0292601 -0.596105 1.03003 0.0303909 -0.605544 1.03215 0.0312786 -0.615519 1.03413 0.031985 -0.626026 1.03599 0.0325574 -0.637058 1.03771 0.0330313 -0.648596 1.03929 0.0334346 -0.660614 1.04073 0.0337889 -0.673075 1.042 0.0341101 -0.68593 1.04309 0.0344115 -0.699122 1.044 0.0347043 -0.712585 1.04468 0.0349988 -0.726243 1.04514 0.0353037 -0.740016 1.04536 0.0356257 -0.753822 1.04532 0.0359692 -0.767578 1.04503 0.0363357 -0.781203 1.04452 0.0367232 -0.794624 1.04378 0.0371263 -0.807771 1.04286 0.0375335 -0.820586 1.0418 0.0379278 -0.833024 1.04064 0.038293 -0.845046 1.03941 0.038615 -0.856623 1.03814 0.0388816 -0.86772 1.03686 0.0390836 -0.878281 1.03561 0.0392212 -0.888278 1.03439 0.0393099 -0.897729 1.03321 0.0393551 -0.906644 1.0321 0.0393572 -0.915038 1.03107 0.0393189 -0.92293 1.03014 0.0392487 -0.930357 1.02928 0.039164 -0.937377 1.02851 0.0390801 -0.944062 1.0278 0.0390045 -0.950493 1.02717 0.0389404 -0.956747 1.02662 0.0388865 -0.962849 1.02615 0.0388289 -0.969396 1.0258 0.0387054 -0.977799 1.02543 0.0385658 -0.991089 1.02501 0.038386 -1.01571 1.02455 0.0381433 -1.06354 1.02415 0.0378714 -1.15284 1.02381 0.0376449 -1.30854 1.02345 0.0375224 -1.56398 1.02322 0.0375253 -1.96382 1.02327 0.0375819 -2.56729 1.02375 0.037557 -3.45218 1.02472 0.0373079 -4.7159 1.04027 0.00681485 -0.650225 1.06521 -0.0427399 -0.637234 1.06318 -0.0421388 -0.624652 1.06095 -0.0414566 -0.6125 1.05854 -0.0406609 -0.6008 1.05595 -0.0397123 -0.589575 1.05319 -0.0385642 -0.578858 1.05028 -0.0371623 -0.568692 1.04723 -0.0354466 -0.559131 1.04411 -0.033354 -0.550223 1.04095 -0.0308196 -0.541974 1.03777 -0.0277822 -0.534435 1.03453 -0.0242028 -0.527823 1.03125 -0.0200821 -0.522446 1.02806 -0.0154358 -0.518571 1.02517 -0.0102712 -0.516409 1.023 -0.00477737 -0.515864 1.02216 8.86e-07 -0.516409 1.023 0.00477916 -0.518571 1.02517 0.0102731 -0.522446 1.02806 0.015438 -0.527823 1.03125 0.0200847 -0.534434 1.03453 0.0242059 -0.541974 1.03777 0.0277858 -0.550222 1.04095 0.0308238 -0.559131 1.04411 0.0333588 -0.568692 1.04723 0.035452 -0.578859 1.05028 0.0371683 -0.589576 1.05319 0.0385707 -0.600801 1.05595 0.0397194 -0.612502 1.05854 0.0406685 -0.624654 1.06096 0.0414647 -0.637237 1.06318 0.0421474 -0.650228 1.06522 0.042749 -0.663597 1.06705 0.0432945 -0.677305 1.06866 0.0438042 -0.691301 1.07006 0.0442954 -0.705529 1.0712 0.044783 -0.71992 1.0721 0.0452793 -0.734399 1.07273 0.045794 -0.748887 1.0731 0.0463335 -0.763302 1.07321 0.0469003 -0.777565 1.07307 0.0474928 -0.791601 1.07272 0.0481045 -0.805343 1.07217 0.0487221 -0.818733 1.07147 0.0493264 -0.831724 1.07067 0.0498986 -0.844281 1.06978 0.0504223 -0.856378 1.06886 0.0508835 -0.867983 1.06792 0.0512715 -0.879043 1.06699 0.0515847 -0.889538 1.06609 0.0518363 -0.89949 1.06523 0.0520323 -0.908918 1.06442 0.052175 -0.91784 1.06367 0.0522676 -0.926283 1.06298 0.0523182 -0.934293 1.06235 0.052342 -0.941931 1.06177 0.0523527 -0.949274 1.06123 0.0523574 -0.956405 1.06073 0.0523596 -0.963406 1.06027 0.0523586 -0.970302 1.05986 0.0523411 -0.977694 1.05952 0.0522471 -0.987005 1.05914 0.0521289 -1.00118 1.05866 0.0519624 -1.02628 1.05808 0.0517107 -1.07377 1.05748 0.0513819 -1.1622 1.05697 0.051083 -1.31716 1.0565 0.0509403 -1.5722 1.05621 0.0509708 -1.97173 1.0563 0.0510367 -2.57453 1.05692 0.0509 -3.45759 1.05817 0.050242 -4.7159 1.07662 0.0111244 -0.625931 1.1081 -0.0541119 -0.611006 1.1049 -0.0530508 -0.596446 1.10146 -0.0518547 -0.582301 1.09777 -0.0504864 -0.568631 1.09386 -0.0489053 -0.555504 1.08977 -0.0470695 -0.542999 1.08554 -0.0449366 -0.531196 1.08123 -0.0424639 -0.520173 1.07689 -0.0396076 -0.509981 1.07261 -0.0363175 -0.500623 1.06839 -0.0325405 -0.492142 1.06419 -0.0282414 -0.484756 1.06002 -0.0234134 -0.47877 1.05602 -0.0180454 -0.474466 1.05242 -0.0120998 -0.47208 1.04971 -0.00572394 -0.471491 1.04863 1.555e-06 -0.472079 1.04971 0.00572706 -0.474466 1.05242 0.0121031 -0.47877 1.05602 0.0180491 -0.484756 1.06002 0.0234178 -0.492142 1.06419 0.0282466 -0.500623 1.06839 0.0325467 -0.509981 1.07261 0.0363248 -0.520174 1.0769 0.0396161 -0.531198 1.08123 0.0424735 -0.543001 1.08554 0.0449474 -0.555508 1.08977 0.0470814 -0.568636 1.09386 0.0489184 -0.582307 1.09777 0.0505007 -0.596453 1.10146 0.0518702 -0.611014 1.10491 0.0530673 -0.62594 1.1081 0.0541296 -0.641181 1.11102 0.0550888 -0.656687 1.11365 0.0559728 -0.672405 1.116 0.056806 -0.688277 1.11803 0.0576095 -0.704238 1.11976 0.0584009 -0.720217 1.12118 0.0591941 -0.736139 1.12228 0.0599984 -0.751925 1.12309 0.0608187 -0.7675 1.12363 0.0616544 -0.782791 1.12391 0.0624992 -0.797734 1.12397 0.0633399 -0.812275 1.12386 0.0641565 -0.826369 1.12361 0.0649297 -0.839988 1.12326 0.0656425 -0.853108 1.12283 0.0662807 -0.865703 1.12237 0.0668338 -0.877728 1.12189 0.0673 -0.889169 1.1214 0.0676914 -0.900059 1.12093 0.068015 -0.910422 1.12046 0.0682744 -0.920289 1.12003 0.0684738 -0.929695 1.11962 0.0686213 -0.938693 1.11922 0.0687312 -0.947354 1.11885 0.0688169 -0.95576 1.11848 0.0688857 -0.964001 1.11811 0.068942 -0.972166 1.11776 0.0689857 -0.980287 1.11741 0.0690042 -0.988983 1.1171 0.0689403 -0.999724 1.11673 0.0688484 -1.01542 1.11624 0.0687076 -1.0418 1.11562 0.0684774 -1.08961 1.11492 0.0681391 -1.17723 1.11428 0.0677817 -1.33108 1.11376 0.0675936 -1.58527 1.11347 0.0676335 -1.98405 1.11363 0.0676997 -2.58551 1.11443 0.0674114 -3.4655 1.11594 0.0661252 -4.7159 1.13716 0.0182057 -0.574011 1.18085 -0.067574 -0.556023 1.17561 -0.0658184 -0.538516 1.17006 -0.0638837 -0.521582 1.16426 -0.0617392 -0.505316 1.15824 -0.0593539 -0.489813 1.15209 -0.0566978 -0.475165 1.14587 -0.0537405 -0.461455 1.13966 -0.0504491 -0.448748 1.13355 -0.0467853 -0.437078 1.12761 -0.0426987 -0.426429 1.12185 -0.0381326 -0.416835 1.11624 -0.0330473 -0.408503 1.11077 -0.0274228 -0.401743 1.10561 -0.0212166 -0.396865 1.10102 -0.0143433 -0.394153 1.09757 -0.00690119 -0.393493 1.09617 2.508e-06 -0.394153 1.09757 0.0069062 -0.396865 1.10103 0.0143486 -0.401743 1.10561 0.0212226 -0.408503 1.11078 0.0274299 -0.416835 1.11624 0.0330557 -0.42643 1.12186 0.0381426 -0.437079 1.12761 0.0427106 -0.448751 1.13355 0.0467992 -0.461459 1.13966 0.050465 -0.475171 1.14587 0.0537587 -0.48982 1.15209 0.0567183 -0.505325 1.15825 0.0593767 -0.521593 1.16426 0.0617644 -0.538529 1.17007 0.0639114 -0.556039 1.17562 0.0658486 -0.574029 1.18086 0.0676066 -0.592407 1.18575 0.0692139 -0.611083 1.19027 0.0706972 -0.629966 1.19439 0.0720825 -0.648968 1.19809 0.0733934 -0.667999 1.20137 0.0746511 -0.686969 1.20423 0.0758728 -0.705787 1.20666 0.0770714 -0.724367 1.2087 0.0782546 -0.742626 1.21037 0.0794243 -0.760488 1.21169 0.0805761 -0.777889 1.21272 0.0816984 -0.794775 1.21349 0.0827727 -0.811108 1.21405 0.0837812 -0.826863 1.21444 0.0847084 -0.842024 1.2147 0.0855417 -0.856572 1.21487 0.0862725 -0.870473 1.21495 0.0869005 -0.883725 1.21498 0.0874382 -0.896371 1.21497 0.0878947 -0.908452 1.21492 0.0882751 -0.92001 1.21485 0.0885849 -0.931098 1.21477 0.0888331 -0.941782 1.21467 0.0890346 -0.952148 1.21454 0.0892032 -0.962294 1.2144 0.0893473 -0.972326 1.21423 0.0894721 -0.98235 1.21403 0.0895785 -0.992411 1.21382 0.0896536 -1.00318 1.21361 0.0896407 -1.01622 1.21333 0.0896016 -1.0345 1.21297 0.0895233 -1.06351 1.21248 0.0893717 -1.1132 1.21191 0.0891148 -1.20101 1.21137 0.0887892 -1.35371 1.21099 0.0885717 -1.60651 1.21086 0.0885911 -2.00376 1.21119 0.0886321 -2.60271 1.2122 0.08814 -3.47747 1.21402 0.0858718 -4.7159 1.23793 0.0298499 -0.475927 1.30243 -0.0836612 -0.453551 1.29388 -0.0810447 -0.431935 1.28501 -0.0782253 -0.411196 1.2759 -0.0751796 -0.391439 1.26665 -0.071884 -0.372761 1.25735 -0.068315 -0.355247 1.24811 -0.0644468 -0.338964 1.23904 -0.0602485 -0.323958 1.23023 -0.0556803 -0.310239 1.22178 -0.0506862 -0.297773 1.2137 -0.0452034 -0.286576 1.20593 -0.039187 -0.276851 1.1985 -0.0325997 -0.268915 1.19156 -0.0253573 -0.263128 1.18546 -0.0173097 -0.25987 1.18087 -0.0084817 -0.259079 1.17899 3.781e-06 -0.25987 1.18087 0.00848923 -0.263128 1.18546 0.0173176 -0.268915 1.19156 0.0253663 -0.276851 1.1985 0.0326103 -0.286577 1.20594 0.0391998 -0.297774 1.21371 0.0452187 -0.310242 1.22179 0.0507044 -0.323962 1.23024 0.0557017 -0.338971 1.23905 0.0602734 -0.355256 1.24812 0.0644754 -0.372773 1.25736 0.0683476 -0.391454 1.26666 0.0719208 -0.411215 1.27591 0.0752209 -0.431958 1.28502 0.0782713 -0.453578 1.29389 0.0810955 -0.475959 1.30244 0.083717 -0.498976 1.31059 0.0861568 -0.522498 1.31827 0.0884362 -0.546389 1.32543 0.0905766 -0.570509 1.33203 0.092599 -0.594716 1.33802 0.0945229 -0.618872 1.3434 0.0963653 -0.642838 1.34817 0.0981396 -0.666486 1.35235 0.0998545 -0.689696 1.35595 0.101513 -0.712364 1.35903 0.103113 -0.734401 1.36163 0.104644 -0.75574 1.36381 0.106089 -0.776331 1.36563 0.107433 -0.796149 1.36715 0.108662 -0.815176 1.36842 0.109767 -0.833403 1.36948 0.110742 -0.850801 1.37037 0.11159 -0.867383 1.37112 0.112327 -0.883213 1.37174 0.112963 -0.898354 1.37227 0.113508 -0.91287 1.37272 0.113968 -0.926841 1.37311 0.114355 -0.940363 1.37344 0.114685 -0.953553 1.3737 0.114974 -0.966541 1.37391 0.115233 -0.979471 1.37407 0.115467 -0.992484 1.37417 0.11568 -1.00566 1.37424 0.115856 -1.01976 1.37429 0.115938 -1.03651 1.3743 0.116001 -1.05906 1.37427 0.116045 -1.09282 1.37421 0.116052 -1.14705 1.37415 0.115996 -1.23777 1.37416 0.115869 -1.39073 1.37432 0.115756 -1.6419 1.3747 0.115779 -2.03643 1.37545 0.115761 -2.63072 1.37682 0.114965 -3.49636 1.37907 0.111107 -4.7159 1.40568 0.0490069 -0.304417 1.50637 -0.104745 -0.27521 1.49249 -0.101046 -0.247204 1.47829 -0.0971192 -0.220531 1.46391 -0.0929484 -0.195307 1.44951 -0.0885156 -0.171625 1.43522 -0.0838022 -0.149561 1.4212 -0.0787857 -0.129163 1.40759 -0.0734356 -0.110452 1.39452 -0.0677094 -0.093411 1.38209 -0.0615437 -0.0779751 1.37032 -0.0548692 -0.0641393 1.35914 -0.0476356 -0.05209 1.34857 -0.0397819 -0.0421566 1.33881 -0.0311633 -0.0347754 1.33026 -0.021528 -0.0305035 1.32381 -0.0107699 -0.0294416 1.32112 5.372e-06 -0.0305037 1.32381 0.0107805 -0.0347755 1.33026 0.0215391 -0.0421566 1.33881 0.031176 -0.0520902 1.34858 0.0397969 -0.0641402 1.35915 0.0476537 -0.0779771 1.37033 0.054891 -0.0934149 1.3821 0.0615699 -0.110458 1.39453 0.0677404 -0.129172 1.40761 0.073472 -0.149574 1.42122 0.0788279 -0.171643 1.43524 0.083851 -0.19533 1.44953 0.0885713 -0.22056 1.46393 0.0930116 -0.247239 1.47831 0.0971904 -0.275252 1.49251 0.101125 -0.304466 1.50639 0.104834 -0.334725 1.51982 0.108331 -0.365858 1.53268 0.111631 -0.397676 1.54485 0.114752 -0.429982 1.55624 0.11771 -0.462566 1.56678 0.120521 -0.495215 1.57642 0.1232 -0.52772 1.58513 0.125757 -0.559876 1.59292 0.128202 -0.591495 1.5998 0.130538 -0.622407 1.60583 0.132761 -0.65247 1.61107 0.134863 -0.68157 1.6156 0.136828 -0.709623 1.61949 0.138642 -0.736575 1.62283 0.140295 -0.762399 1.6257 0.14178 -0.787075 1.62817 0.143095 -0.810578 1.6303 0.144248 -0.832935 1.63214 0.145259 -0.854233 1.63374 0.146144 -0.874568 1.63514 0.146916 -0.894045 1.63637 0.147584 -0.912787 1.63748 0.148161 -0.930944 1.63846 0.14867 -0.94869 1.63933 0.149128 -0.966223 1.64012 0.14955 -0.983756 1.64081 0.149944 -1.00151 1.64144 0.150313 -1.01964 1.64199 0.150643 -1.03904 1.64253 0.15087 -1.06171 1.64307 0.151089 -1.09106 1.64365 0.151315 -1.13262 1.64433 0.151552 -1.1952 1.64518 0.151788 -1.29335 1.64624 0.152006 -1.45058 1.64752 0.152202 -1.70165 1.64898 0.152371 -2.0921 1.65064 0.152288 -2.67785 1.65272 0.150993 -3.52721 1.65589 0.144669 -4.7159 1.68496 0.0805353 -0.0124636 1.85112 -0.13489 --0.0281597 1.8284 -0.129656 --0.0668857 1.80537 -0.124156 --0.103548 1.78229 -0.118383 --0.138014 1.75937 -0.112327 --0.170186 1.73685 -0.105978 --0.200001 1.71494 -0.0993182 --0.22743 1.69385 -0.0923212 --0.252484 1.67375 -0.084942 --0.275222 1.65478 -0.0771096 --0.295757 1.63695 -0.0687476 --0.314137 1.62019 -0.0598003 --0.330216 1.6045 -0.0501733 --0.343668 1.59012 -0.0396335 --0.353961 1.57754 -0.0277696 --0.360231 1.56797 -0.0142316 --0.361922 1.56388 6.985e-06 --0.360231 1.56797 0.0142453 --0.35396 1.57755 0.0277839 --0.343668 1.59013 0.0396498 --0.330215 1.60451 0.0501927 --0.314135 1.6202 0.0598238 --0.295753 1.63697 0.0687761 --0.275216 1.6548 0.077144 --0.252474 1.67378 0.0849831 --0.227416 1.69388 0.0923699 --0.199982 1.71497 0.0993754 --0.17016 1.73688 0.106044 --0.137981 1.75941 0.112404 --0.103506 1.78233 0.118472 --0.0668346 1.80541 0.124258 --0.0280984 1.82844 0.129771 -0.012536 1.85116 0.135021 -0.0548666 1.87336 0.140012 -0.0986596 1.89481 0.144754 -0.143652 1.91533 0.149255 -0.189555 1.93472 0.153526 -0.236063 1.95286 0.157579 -0.282854 1.96963 0.161425 -0.329606 1.98496 0.165073 -0.376002 1.99882 0.168529 -0.421741 2.01122 0.171796 -0.466546 2.02221 0.174873 -0.510177 2.03187 0.177752 -0.552435 2.0403 0.180419 -0.593165 2.04762 0.182863 -0.632257 2.05395 0.185078 -0.669639 2.05941 0.187063 -0.705268 2.06413 0.188822 -0.73911 2.0682 0.19037 -0.7712 2.07172 0.191734 -0.801656 2.07479 0.192936 -0.830619 2.07748 0.193994 -0.858256 2.07987 0.19492 -0.884767 2.08202 0.195735 -0.910389 2.08395 0.196463 -0.935406 2.08571 0.19713 -0.960133 2.08732 0.197753 -0.98492 2.08881 0.198344 -1.01014 2.0902 0.19891 -1.0361 2.0915 0.199436 -1.06393 2.0928 0.19985 -1.09596 2.09413 0.200268 -1.13599 2.09559 0.200717 -1.18977 2.09729 0.201217 -1.26587 2.09932 0.201774 -1.37758 2.10176 0.202379 -1.54564 2.10459 0.202983 -1.80116 2.1077 0.203444 -2.1871 2.11096 0.203331 -2.75787 2.11448 0.201273 -3.57853 2.11968 0.192003 -4.7159 2.14988 0.132438 --0.481216 2.43731 -0.180052 --0.541346 2.39965 -0.172477 --0.598432 2.3617 -0.164572 --0.652245 2.32386 -0.156341 --0.702615 2.28652 -0.147794 --0.749429 2.25004 -0.138934 --0.79263 2.21477 -0.129756 --0.832217 2.181 -0.120243 --0.868247 2.14899 -0.110352 --0.900838 2.11894 -0.100009 --0.930177 2.09088 -0.0891315 --0.956399 2.06474 -0.0776549 --0.979452 2.04053 -0.0654375 --0.999077 2.01847 -0.0521268 --1.01468 1.99917 -0.0370819 --1.02494 1.98428 -0.0195298 --1.02817 1.97768 7.43e-06 --1.02494 1.98429 0.0195444 --1.01467 1.99918 0.0370971 --0.999076 2.01848 0.0521441 --0.979449 2.04054 0.0654581 --0.956396 2.06476 0.0776801 --0.930172 2.09091 0.0891622 --0.90083 2.11897 0.100046 --0.868233 2.14902 0.110397 --0.832198 2.18103 0.120297 --0.792604 2.21481 0.129821 --0.749394 2.25009 0.13901 --0.70257 2.28657 0.147883 --0.652188 2.32392 0.156446 --0.598362 2.36176 0.164692 --0.541261 2.39971 0.172617 --0.481114 2.43738 0.180212 --0.41821 2.47437 0.18747 --0.352891 2.51032 0.194384 --0.285546 2.54488 0.200953 --0.216614 2.57773 0.207179 --0.146563 2.60863 0.213067 --0.0758861 2.63735 0.218621 --0.00508859 2.66377 0.223848 -0.0653304 2.6878 0.228753 -0.134889 2.70942 0.233338 -0.20314 2.72868 0.237607 -0.269679 2.74569 0.241557 -0.334163 2.76057 0.245179 -0.396311 2.77351 0.248472 -0.455907 2.78469 0.251436 -0.512801 2.79432 0.254081 -0.566897 2.80258 0.25642 -0.618132 2.80966 0.258477 -0.666547 2.81574 0.260292 -0.712295 2.82098 0.261896 -0.755582 2.82554 0.26331 -0.796671 2.82956 0.264557 -0.835883 2.83314 0.265663 -0.873609 2.83636 0.266659 -0.910312 2.8393 0.267578 -0.946521 2.84203 0.268442 -0.982832 2.84457 0.269269 -1.0199 2.84698 0.270072 -1.05835 2.8493 0.270838 -1.09969 2.85162 0.271494 -1.14666 2.85402 0.272166 -1.20347 2.85661 0.27289 -1.27612 2.85953 0.273694 -1.37289 2.86289 0.274596 -1.50578 2.86678 0.275589 -1.69237 2.87122 0.276601 -1.95832 2.87616 0.277405 -2.34003 2.88149 0.277371 -2.88691 2.88736 0.274782 -3.66091 2.89586 0.264386 -4.7159 2.92384 0.217898 --1.31191 3.44459 -0.249347 --1.4065 3.38094 -0.238242 --1.49603 3.31695 -0.226652 --1.58016 3.25332 -0.214613 --1.65863 3.19072 -0.202163 --1.7313 3.12976 -0.189337 --1.79811 3.07103 -0.176162 --1.85911 3.01503 -0.162648 --1.91442 2.96214 -0.148775 --1.96427 2.91268 -0.134483 --2.00896 2.86677 -0.119693 --2.04879 2.82436 -0.104317 --2.08392 2.78549 -0.08814 --2.11432 2.75036 -0.0706624 --2.13949 2.71967 -0.0509587 --2.15768 2.69559 -0.0276144 --2.16484 2.68438 4.767e-06 --2.15768 2.69559 0.0276237 --2.13949 2.71968 0.0509685 --2.11432 2.75038 0.0706737 --2.08392 2.78551 0.0881535 --2.04879 2.82438 0.104334 --2.00896 2.86679 0.119714 --1.96426 2.91271 0.134508 --1.91441 2.96217 0.148806 --1.85909 3.01506 0.162686 --1.79808 3.07107 0.176208 --1.73127 3.12981 0.189392 --1.65859 3.19077 0.202228 --1.58011 3.25338 0.214691 --1.49597 3.31702 0.226743 --1.40642 3.38101 0.238349 --1.31181 3.44466 0.249472 --1.21261 3.5073 0.26008 --1.10938 3.56825 0.27015 --1.00275 3.6269 0.279666 --0.893478 3.68269 0.288622 --0.782345 3.73515 0.297019 --0.670192 3.78391 0.304865 --0.557878 3.8287 0.312172 --0.446252 3.86939 0.318955 --0.336129 3.90592 0.32523 --0.228264 3.93838 0.331015 --0.12333 3.96691 0.336323 --0.0218978 3.99177 0.341165 -0.0755721 4.01324 0.345556 -0.168733 4.03164 0.349514 -0.257349 4.04732 0.353062 -0.34129 4.06063 0.356226 -0.420509 4.07189 0.359042 -0.49509 4.08142 0.361554 -0.56526 4.08952 0.3638 -0.631337 4.09645 0.365811 -0.693738 4.10246 0.367617 -0.752978 4.10775 0.369249 -0.809679 4.11246 0.370746 -0.864583 4.11674 0.372144 -0.918547 4.12068 0.373475 -0.972556 4.12438 0.374766 -1.02773 4.12791 0.376038 -1.08526 4.13135 0.377296 -1.14714 4.13478 0.378491 -1.21642 4.13831 0.379744 -1.29737 4.14203 0.381101 -1.39566 4.14609 0.382603 -1.51856 4.15056 0.38428 -1.67592 4.15552 0.386128 -1.88148 4.16104 0.38808 -2.15525 4.16714 0.389912 -2.52715 4.17387 0.391063 -3.04201 4.18152 0.390195 -3.75969 4.19172 0.383922 -4.7159 4.21227 0.358636 --2.72298 5.22248 -0.356064 --2.8868 5.10818 -0.341466 --3.04082 4.99381 -0.32573 --3.18454 4.88075 -0.308833 --3.31759 4.77027 -0.290765 --3.43983 4.66354 -0.271532 --3.55124 4.56162 -0.251155 --3.65196 4.46534 -0.22967 --3.7423 4.37538 -0.207131 --3.82265 4.29214 -0.183605 --3.89357 4.2158 -0.159176 --3.95572 4.14624 -0.133943 --4.00988 4.08308 -0.108018 --4.05697 4.02561 -0.0815245 --4.09804 3.97283 -0.0545956 --4.13429 3.92341 -0.0273721 --4.16708 3.87568 0 --4.13429 3.92341 0.0273721 --4.09804 3.97283 0.0545956 --4.05697 4.02561 0.0815245 --4.00988 4.08308 0.108018 --3.95572 4.14624 0.133943 --3.89357 4.2158 0.159176 --3.82265 4.29214 0.183605 --3.7423 4.37538 0.207131 --3.65196 4.46534 0.22967 --3.55124 4.56162 0.251155 --3.43983 4.66354 0.271532 --3.31759 4.77027 0.290765 --3.18454 4.88075 0.308833 --3.04082 4.99381 0.32573 --2.8868 5.10818 0.341466 --2.72298 5.22248 0.356064 --2.55009 5.33536 0.369557 --2.36903 5.44545 0.381992 --2.18089 5.55147 0.393421 --1.98694 5.65222 0.403906 --1.78859 5.74667 0.413515 --1.58741 5.83395 0.422318 --1.38504 5.91339 0.430388 --1.18323 5.98455 0.437801 --0.983713 6.04721 0.444631 --0.788241 6.10138 0.45095 --0.598505 6.14729 0.456827 --0.416107 6.18536 0.46233 --0.242522 6.21616 0.467519 --0.0790716 6.24042 0.472453 -0.0731078 6.25895 0.477183 -0.213084 6.27263 0.481756 -0.340146 6.28233 0.486284 -0.453823 6.28892 0.490812 -0.553885 6.29319 0.495341 -0.640358 6.29627 0.499869 -0.713551 6.29932 0.504398 -0.774033 6.30236 0.508926 -0.822651 6.30541 0.513454 -0.860549 6.30845 0.517982 -0.889181 6.31149 0.522511 -0.910331 6.31454 0.527039 -0.926132 6.31758 0.531567 -0.939084 6.32063 0.536096 -0.952408 6.32367 0.540624 -0.971422 6.32672 0.545152 -1.0033 6.32976 0.549681 -1.05725 6.33281 0.554209 -1.1451 6.33585 0.558737 -1.28204 6.33889 0.563265 -1.48757 6.34194 0.567794 -1.78672 6.34498 0.572322 -2.21166 6.34803 0.57685 -2.80365 6.35107 0.581379 -3.61571 6.35412 0.585907 -4.7159 6.35716 0.590435 -0.672047 1.01549 0 -0.661018 1.01498 0 -0.650555 1.0144 0 -0.640707 1.01377 0 -0.631519 1.0131 0 -0.623024 1.01239 0 -0.61525 1.01164 0 -0.608214 1.01089 0 -0.601921 1.01013 0 -0.596364 1.00939 0 -0.59149 1.0086 0 -0.587225 1.00759 0 -0.583559 1.0063 0 -0.580517 1.00483 0 -0.57809 1.00325 0 -0.576251 1.00164 0 -0.575 1 0 -0.683581 1.01595 0 -0.695555 1.01632 0 -0.707896 1.01661 0 -0.720526 1.01678 0 -0.733365 1.01683 0 -0.746332 1.01674 0 -0.759347 1.0165 0 -0.772335 1.01611 0 -0.785224 1.01557 0 -0.797949 1.01492 0 -0.810448 1.01417 0 -0.822662 1.01335 0 -0.834539 1.01247 0 -0.846025 1.01157 0 -0.857073 1.01065 0 -0.867639 1.00974 0 -0.877683 1.00882 0 -0.887177 1.00791 0 -0.8961 1.00702 0 -0.904444 1.00613 0 -0.912214 1.00527 0 -0.919426 1.00443 0 -0.926114 1.00361 0 -0.932326 1.00284 0 -0.938124 1.00209 0 -0.943587 1.00138 0 -0.948809 1.00069 0 -0.9539 1 0 -0.959318 1 0 -0.966198 1 0 -0.978449 1 0 -1.00334 1 0 -1.05244 1 0 -1.14286 1 0 -1.29884 1 0 -1.5537 1 0 -1.95252 1 0 -2.5554 1 0 -3.44178 1 0 -4.7159 1 0 -0.672046 1.01551 0 -0.661018 1.01499 0 -0.650554 1.01441 0 -0.640706 1.01379 0 -0.631518 1.01311 0 -0.623023 1.0124 0 -0.615249 1.01166 0 -0.608212 1.0109 0 -0.601919 1.01015 0 -0.596362 1.00941 0 -0.591487 1.00861 0 -0.58722 1.0076 0 -0.583553 1.00632 0 -0.58051 1.00484 0 -0.578082 1.00326 0 -0.576241 1.00165 0 -0.574989 1.00001 0 -0.683581 1.01596 0 -0.695554 1.01634 0 -0.707896 1.01662 0 -0.720526 1.0168 0 -0.733365 1.01684 0 -0.746332 1.01675 0 -0.759347 1.01651 0 -0.772335 1.01612 0 -0.785225 1.01559 0 -0.79795 1.01494 0 -0.810448 1.01418 0 -0.822663 1.01336 0 -0.83454 1.01249 0 -0.846026 1.01158 0 -0.857074 1.01067 0 -0.86764 1.00975 0 -0.877684 1.00883 0 -0.887178 1.00793 0 -0.896102 1.00703 0 -0.904446 1.00615 0 -0.912215 1.00528 0 -0.919428 1.00444 0 -0.926116 1.00363 0 -0.932327 1.00285 0 -0.938126 1.00211 0 -0.943589 1.0014 0 -0.948811 1.00071 0 -0.953903 1.00001 0 -0.959321 1.00001 0 -0.966201 1.00001 0 -0.978452 1.00001 0 -1.00334 1.00001 0 -1.05244 1.00001 0 -1.14287 1.00001 0 -1.29884 1.00001 0 -1.5537 1.00001 0 -1.95252 1.00001 0 -2.5554 1.00002 0 -3.44178 1.00002 0 -4.7159 1.00002 0 -0.672045 1.01553 0 -0.661016 1.01501 0 -0.650552 1.01443 0 -0.640704 1.01381 0 -0.631515 1.01313 0 -0.62302 1.01242 0 -0.615246 1.01168 0 -0.608209 1.01092 0 -0.601915 1.01017 0 -0.596356 1.00943 0 -0.59148 1.00863 0 -0.587212 1.00762 0 -0.583543 1.00633 0 -0.580498 1.00486 0 -0.578067 1.00328 0 -0.576224 1.00166 0 -0.57497 1.00002 0 -0.683579 1.01598 0 -0.695553 1.01636 0 -0.707895 1.01664 0 -0.720525 1.01682 0 -0.733364 1.01687 0 -0.746332 1.01677 0 -0.759347 1.01653 0 -0.772335 1.01614 0 -0.785225 1.01561 0 -0.79795 1.01496 0 -0.810449 1.01421 0 -0.822665 1.01338 0 -0.834541 1.01251 0 -0.846028 1.01161 0 -0.857076 1.01069 0 -0.867641 1.00977 0 -0.877686 1.00886 0 -0.887181 1.00795 0 -0.896104 1.00705 0 -0.904448 1.00617 0 -0.912218 1.0053 0 -0.91943 1.00446 0 -0.926118 1.00365 0 -0.93233 1.00287 0 -0.938129 1.00213 0 -0.943593 1.00142 0 -0.948815 1.00073 0 -0.953907 1.00004 0 -0.959326 1.00004 0 -0.966206 1.00004 0 -0.978457 1.00004 0 -1.00334 1.00004 0 -1.05245 1.00004 0 -1.14287 1.00004 0 -1.29884 1.00004 0 -1.55371 1.00004 0 -1.95252 1.00004 0 -2.55541 1.00004 0 -3.44179 1.00004 0 -4.7159 1.00005 0 -0.67204 1.01557 0 -0.661011 1.01505 0 -0.650546 1.01447 0 -0.640698 1.01384 0 -0.631509 1.01317 0 -0.623013 1.01246 0 -0.615238 1.01172 0 -0.6082 1.01096 0 -0.601905 1.0102 0 -0.596345 1.00946 0 -0.591467 1.00866 0 -0.587197 1.00765 0 -0.583525 1.00637 0 -0.580476 1.00489 0 -0.578042 1.00331 0 -0.576195 1.00168 0 -0.574939 1.00004 0 -0.683575 1.01602 0 -0.695549 1.0164 0 -0.707891 1.01668 0 -0.720522 1.01686 0 -0.733362 1.0169 0 -0.74633 1.01681 0 -0.759346 1.01657 0 -0.772335 1.01618 0 -0.785225 1.01565 0 -0.79795 1.015 0 -0.81045 1.01425 0 -0.822665 1.01342 0 -0.834542 1.01255 0 -0.84603 1.01164 0 -0.857078 1.01073 0 -0.867644 1.00981 0 -0.877689 1.0089 0 -0.887183 1.00799 0 -0.896107 1.00709 0 -0.904451 1.00621 0 -0.912221 1.00534 0 -0.919434 1.0045 0 -0.926122 1.00369 0 -0.932335 1.00291 0 -0.938134 1.00217 0 -0.943598 1.00146 0 -0.948821 1.00077 0 -0.953914 1.00007 0 -0.959333 1.00007 0 -0.966214 1.00007 0 -0.978465 1.00007 0 -1.00335 1.00007 0 -1.05245 1.00007 0 -1.14288 1.00008 0 -1.29885 1.00008 0 -1.55371 1.00008 0 -1.95253 1.00008 0 -2.55541 1.00008 0 -3.44179 1.00009 0 -4.7159 1.00009 0 -0.672026 1.01563 0 -0.660997 1.01511 0 -0.650532 1.01453 0 -0.640682 1.0139 0 -0.631492 1.01323 0 -0.622996 1.01252 0 -0.615219 1.01177 0 -0.60818 1.01101 0 -0.601884 1.01026 0 -0.596322 1.00952 0 -0.591441 1.00872 0 -0.587167 1.00771 0 -0.58349 1.00642 0 -0.580437 1.00493 0 -0.577998 1.00335 0 -0.576146 1.00172 0 -0.574885 1.00007 0 -0.683562 1.01608 0 -0.695538 1.01646 0 -0.707881 1.01674 0 -0.720513 1.01692 0 -0.733354 1.01697 0 -0.746323 1.01687 0 -0.75934 1.01663 0 -0.77233 1.01624 0 -0.785221 1.01571 0 -0.797948 1.01506 0 -0.810448 1.01431 0 -0.822664 1.01349 0 -0.834542 1.01261 0 -0.84603 1.01171 0 -0.857079 1.01079 0 -0.867646 1.00988 0 -0.877691 1.00896 0 -0.887186 1.00805 0 -0.896111 1.00716 0 -0.904456 1.00627 0 -0.912226 1.00541 0 -0.919439 1.00457 0 -0.926128 1.00376 0 -0.932341 1.00298 0 -0.93814 1.00224 0 -0.943605 1.00153 0 -0.948829 1.00083 0 -0.953923 1.00014 0 -0.959343 1.00014 0 -0.966225 1.00014 0 -0.978476 1.00014 0 -1.00336 1.00014 0 -1.05246 1.00014 0 -1.14289 1.00014 0 -1.29886 1.00014 0 -1.55372 1.00015 0 -1.95254 1.00015 0 -2.55542 1.00016 0 -3.44179 1.00016 0 -4.7159 1.00018 0 -0.671996 1.01573 0 -0.660964 1.01521 0 -0.650497 1.01463 0 -0.640647 1.014 0 -0.631455 1.01332 0 -0.622957 1.01261 0 -0.615178 1.01187 0 -0.608137 1.01111 0 -0.601838 1.01035 0 -0.596273 1.00961 0 -0.591388 1.0088 0 -0.587109 1.00779 0 -0.583426 1.0065 0 -0.580366 1.00501 0 -0.57792 1.00342 0 -0.576061 1.00179 0 -0.574794 1.00013 0 -0.683534 1.01618 0 -0.695511 1.01656 0 -0.707856 1.01685 0 -0.72049 1.01702 0 -0.733333 1.01707 0 -0.746304 1.01698 0 -0.759324 1.01674 0 -0.772316 1.01635 0 -0.785209 1.01582 0 -0.797938 1.01517 0 -0.81044 1.01442 0 -0.822658 1.0136 0 -0.834538 1.01272 0 -0.846028 1.01182 0 -0.857078 1.01091 0 -0.867646 1.00999 0 -0.877693 1.00907 0 -0.887189 1.00817 0 -0.896115 1.00727 0 -0.904461 1.00639 0 -0.912231 1.00552 0 -0.919445 1.00468 0 -0.926135 1.00387 0 -0.932349 1.00309 0 -0.938149 1.00235 0 -0.943616 1.00164 0 -0.94884 1.00095 0 -0.953936 1.00025 0 -0.959357 1.00025 0 -0.966239 1.00025 0 -0.978492 1.00025 0 -1.00338 1.00025 0 -1.05248 1.00026 0 -1.14291 1.00026 0 -1.29888 1.00026 0 -1.55374 1.00026 0 -1.95255 1.00027 0 -2.55543 1.00028 0 -3.4418 1.00029 0 -4.7159 1.00031 0 -0.671931 1.01589 0 -0.660896 1.01537 0 -0.650426 1.01479 0 -0.640572 1.01415 0 -0.631377 1.01348 0 -0.622876 1.01276 0 -0.615095 1.01201 0 -0.60805 1.01125 0 -0.601747 1.01049 0 -0.596177 1.00975 0 -0.591286 1.00894 0 -0.587 1.00792 0 -0.583309 1.00663 0 -0.58024 1.00513 0 -0.577784 1.00354 0 -0.575917 1.00189 0 -0.574642 1.00022 0 -0.683472 1.01635 0 -0.695453 1.01673 0 -0.707802 1.01702 0 -0.72044 1.0172 0 -0.733287 1.01725 0 -0.746263 1.01716 0 -0.759286 1.01692 0 -0.772283 1.01653 0 -0.78518 1.01601 0 -0.797913 1.01536 0 -0.810419 1.01461 0 -0.822642 1.01378 0 -0.834525 1.01291 0 -0.846017 1.01201 0 -0.857071 1.0111 0 -0.867642 1.01018 0 -0.877691 1.00927 0 -0.88719 1.00836 0 -0.896117 1.00746 0 -0.904465 1.00658 0 -0.912238 1.00571 0 -0.919453 1.00487 0 -0.926144 1.00406 0 -0.932359 1.00329 0 -0.938161 1.00255 0 -0.943629 1.00184 0 -0.948855 1.00114 0 -0.953953 1.00045 0 -0.959375 1.00045 0 -0.966259 1.00045 0 -0.978512 1.00045 0 -1.0034 1.00045 0 -1.0525 1.00045 0 -1.14293 1.00046 0 -1.2989 1.00046 0 -1.55376 1.00047 0 -1.95257 1.00048 0 -2.55544 1.00049 0 -3.44181 1.00051 0 -4.7159 1.00053 0 -0.671802 1.01616 0 -0.66076 1.01563 0 -0.650284 1.01505 0 -0.640424 1.01441 0 -0.631224 1.01373 0 -0.622718 1.013 0 -0.614931 1.01225 0 -0.607881 1.01149 0 -0.601572 1.01072 0 -0.595995 1.00997 0 -0.591096 1.00917 0 -0.5868 1.00814 0 -0.583098 1.00684 0 -0.580017 1.00533 0 -0.577549 1.00373 0 -0.575669 1.00207 0 -0.574384 1.00038 0 -0.68335 1.01662 0 -0.695338 1.01701 0 -0.707694 1.0173 0 -0.72034 1.01749 0 -0.733195 1.01754 0 -0.746178 1.01746 0 -0.75921 1.01723 0 -0.772214 1.01684 0 -0.785119 1.01632 0 -0.79786 1.01567 0 -0.810374 1.01492 0 -0.822603 1.0141 0 -0.834493 1.01323 0 -0.845992 1.01233 0 -0.857051 1.01142 0 -0.867627 1.0105 0 -0.877682 1.00959 0 -0.887185 1.00869 0 -0.896116 1.00779 0 -0.904467 1.00691 0 -0.912243 1.00604 0 -0.919461 1.0052 0 -0.926154 1.00439 0 -0.932371 1.00362 0 -0.938175 1.00288 0 -0.943645 1.00217 0 -0.948874 1.00147 0 -0.953974 1.00078 0 -0.959399 1.00078 0 -0.966284 1.00078 0 -0.978539 1.00078 0 -1.00343 1.00079 0 -1.05253 1.00079 0 -1.14296 1.00079 0 -1.29893 1.0008 0 -1.55378 1.00081 0 -1.95259 1.00082 0 -2.55546 1.00084 0 -3.44182 1.00087 0 -4.7159 1.0009 0 -0.671557 1.01661 0 -0.660504 1.01607 0 -0.650017 1.01548 0 -0.640147 1.01483 0 -0.630937 1.01414 0 -0.622422 1.01341 0 -0.614626 1.01265 0 -0.607568 1.01187 0 -0.601249 1.0111 0 -0.595662 1.01034 0 -0.590751 1.00952 0 -0.586441 1.00849 0 -0.582725 1.00717 0 -0.579627 1.00566 0 -0.577143 1.00404 0 -0.575247 1.00236 0 -0.573947 1.00065 0 -0.683117 1.01708 0 -0.695118 1.01748 0 -0.707487 1.01778 0 -0.720147 1.01798 0 -0.733016 1.01804 0 -0.746014 1.01796 0 -0.759061 1.01774 0 -0.77208 1.01736 0 -0.785 1.01684 0 -0.797755 1.0162 0 -0.810282 1.01546 0 -0.822524 1.01464 0 -0.834427 1.01377 0 -0.845937 1.01288 0 -0.857008 1.01197 0 -0.867594 1.01105 0 -0.877657 1.01014 0 -0.887169 1.00924 0 -0.896107 1.00835 0 -0.904465 1.00746 0 -0.912245 1.0066 0 -0.919468 1.00576 0 -0.926165 1.00495 0 -0.932385 1.00418 0 -0.938192 1.00344 0 -0.943666 1.00273 0 -0.948898 1.00204 0 -0.954001 1.00135 0 -0.959429 1.00135 0 -0.966317 1.00135 0 -0.978573 1.00135 0 -1.00347 1.00136 0 -1.05257 1.00136 0 -1.143 1.00137 0 -1.29897 1.00138 0 -1.55383 1.00139 0 -1.95263 1.00141 0 -2.5555 1.00144 0 -3.44184 1.00147 0 -4.7159 1.00152 0 -0.671109 1.01736 0 -0.660036 1.0168 0 -0.64953 1.01619 0 -0.639641 1.01552 0 -0.630414 1.01481 0 -0.621883 1.01406 0 -0.614073 1.01329 0 -0.606999 1.0125 0 -0.600666 1.01171 0 -0.595063 1.01094 0 -0.590135 1.0101 0 -0.585807 1.00905 0 -0.58207 1.00773 0 -0.578951 1.00619 0 -0.576445 1.00455 0 -0.574529 1.00285 0 -0.573211 1.00111 0 -0.682691 1.01785 0 -0.694715 1.01826 0 -0.707108 1.01858 0 -0.719793 1.01879 0 -0.732688 1.01887 0 -0.745711 1.01881 0 -0.758784 1.01859 0 -0.771829 1.01823 0 -0.784776 1.01772 0 -0.797556 1.01709 0 -0.810108 1.01635 0 -0.822374 1.01554 0 -0.834299 1.01469 0 -0.84583 1.01379 0 -0.85692 1.01289 0 -0.867524 1.01198 0 -0.877604 1.01107 0 -0.88713 1.01017 0 -0.896082 1.00928 0 -0.90445 1.0084 0 -0.912241 1.00754 0 -0.919471 1.0067 0 -0.926175 1.0059 0 -0.9324 1.00513 0 -0.938212 1.00439 0 -0.94369 1.00368 0 -0.948927 1.00299 0 -0.954033 1.0023 0 -0.959465 1.00231 0 -0.966357 1.00231 0 -0.978617 1.00232 0 -1.00351 1.00232 0 -1.05262 1.00233 0 -1.14305 1.00234 0 -1.29903 1.00236 0 -1.55389 1.00238 0 -1.9527 1.0024 0 -2.55555 1.00244 0 -3.44188 1.00248 0 -4.7159 1.00254 0 -0.67031 1.0186 0 -0.6592 1.01801 0 -0.64866 1.01737 0 -0.63874 1.01667 0 -0.629484 1.01593 0 -0.620925 1.01515 0 -0.613089 1.01435 0 -0.605991 1.01353 0 -0.599634 1.01271 0 -0.594007 1.01192 0 -0.589054 1.01106 0 -0.584699 1.00998 0 -0.580935 1.00863 0 -0.577787 1.00707 0 -0.575252 1.00539 0 -0.573309 1.00366 0 -0.571966 1.00188 0 -0.68193 1.01912 0 -0.693994 1.01957 0 -0.706429 1.01992 0 -0.719157 1.02015 0 -0.732097 1.02026 0 -0.745167 1.02022 0 -0.758286 1.02003 0 -0.771377 1.01969 0 -0.784369 1.0192 0 -0.797194 1.01858 0 -0.80979 1.01787 0 -0.822097 1.01707 0 -0.834062 1.01622 0 -0.845631 1.01534 0 -0.856755 1.01444 0 -0.867391 1.01354 0 -0.8775 1.01264 0 -0.887052 1.01174 0 -0.896026 1.01086 0 -0.904414 1.00998 0 -0.912221 1.00913 0 -0.919465 1.00829 0 -0.92618 1.00749 0 -0.932414 1.00672 0 -0.938234 1.00599 0 -0.943718 1.00529 0 -0.948961 1.0046 0 -0.954073 1.00392 0 -0.95951 1.00392 0 -0.966406 1.00393 0 -0.978672 1.00394 0 -1.00357 1.00395 0 -1.05269 1.00396 0 -1.14313 1.00398 0 -1.29912 1.004 0 -1.55398 1.00403 0 -1.95279 1.00406 0 -2.55564 1.00411 0 -3.44194 1.00417 0 -4.7159 1.00425 0 -0.668905 1.02068 0 -0.657733 1.02003 0 -0.647134 1.01933 0 -0.637159 1.01858 0 -0.627852 1.01779 0 -0.619247 1.01696 0 -0.611367 1.0161 0 -0.604229 1.01524 0 -0.597833 1.01438 0 -0.592168 1.01353 0 -0.587177 1.01263 0 -0.582784 1.01152 0 -0.57898 1.01012 0 -0.575793 1.00852 0 -0.57322 1.0068 0 -0.571239 1.00502 0 -0.569863 1.00319 0 -0.680592 1.02125 0 -0.692726 1.02175 0 -0.705234 1.02215 0 -0.718038 1.02244 0 -0.731056 1.02259 0 -0.744205 1.0226 0 -0.757404 1.02245 0 -0.770576 1.02214 0 -0.783647 1.02169 0 -0.79655 1.0211 0 -0.809222 1.02041 0 -0.821602 1.01963 0 -0.833636 1.0188 0 -0.84527 1.01794 0 -0.856455 1.01706 0 -0.867147 1.01617 0 -0.877306 1.01527 0 -0.886902 1.01439 0 -0.895916 1.01351 0 -0.904338 1.01264 0 -0.912174 1.01179 0 -0.919441 1.01097 0 -0.926175 1.01017 0 -0.932424 1.00941 0 -0.938256 1.00868 0 -0.94375 1.00799 0 -0.949001 1.00731 0 -0.954121 1.00663 0 -0.959564 1.00664 0 -0.966468 1.00665 0 -0.978743 1.00666 0 -1.00366 1.00668 0 -1.05279 1.0067 0 -1.14325 1.00673 0 -1.29925 1.00676 0 -1.55413 1.0068 0 -1.95294 1.00685 0 -2.55578 1.00691 0 -3.44204 1.00699 0 -4.7159 1.0071 0 -0.666467 1.02414 0 -0.655187 1.02341 0 -0.644487 1.02261 0 -0.634418 1.02177 0 -0.625024 1.02088 0 -0.616339 1.01996 0 -0.608386 1.01902 0 -0.601179 1.01807 0 -0.59472 1.01713 0 -0.588994 1.01622 0 -0.583945 1.01525 0 -0.579495 1.01407 0 -0.575635 1.01261 0 -0.572392 1.01094 0 -0.569765 1.00915 0 -0.567733 1.0073 0 -0.56631 1.0054 0 -0.678268 1.02482 0 -0.690523 1.0254 0 -0.703157 1.0259 0 -0.716092 1.02627 0 -0.729244 1.0265 0 -0.74253 1.02658 0 -0.755868 1.0265 0 -0.769178 1.02626 0 -0.782386 1.02586 0 -0.795424 1.02533 0 -0.808226 1.02468 0 -0.820732 1.02394 0 -0.832885 1.02314 0 -0.844632 1.02231 0 -0.855921 1.02145 0 -0.866709 1.02058 0 -0.876955 1.0197 0 -0.886629 1.01883 0 -0.895711 1.01796 0 -0.904192 1.0171 0 -0.912076 1.01627 0 -0.919384 1.01545 0 -0.926149 1.01467 0 -0.932424 1.01392 0 -0.938275 1.0132 0 -0.943784 1.01251 0 -0.949047 1.01185 0 -0.954176 1.01117 0 -0.95963 1.0112 0 -0.966545 1.01122 0 -0.978835 1.01124 0 -1.00377 1.01127 0 -1.05293 1.0113 0 -1.14342 1.01134 0 -1.29945 1.01139 0 -1.55436 1.01144 0 -1.95319 1.01151 0 -2.55601 1.0116 0 -3.4422 1.0117 0 -4.7159 1.01183 0 -0.66227 1.02995 0 -0.650806 1.02905 0 -0.639933 1.02809 0 -0.629704 1.02709 0 -0.620162 1.02605 0 -0.61134 1.02497 0 -0.603263 1.02389 0 -0.595942 1.0228 0 -0.589378 1.02173 0 -0.583554 1.0207 0 -0.578413 1.01961 0 -0.573875 1.01832 0 -0.569931 1.01676 0 -0.566607 1.01498 0 -0.563902 1.01309 0 -0.561798 1.01114 0 -0.560307 1.00913 0 -0.674268 1.03078 0 -0.686729 1.03153 0 -0.69958 1.03217 0 -0.712738 1.03269 0 -0.72612 1.03306 0 -0.739641 1.03327 0 -0.753215 1.03331 0 -0.766762 1.03317 0 -0.780205 1.03287 0 -0.793474 1.03242 0 -0.806499 1.03184 0 -0.819221 1.03117 0 -0.831579 1.03043 0 -0.843518 1.02964 0 -0.854987 1.02882 0 -0.865939 1.02798 0 -0.876335 1.02713 0 -0.886142 1.02628 0 -0.89534 1.02543 0 -0.903921 1.02459 0 -0.91189 1.02377 0 -0.919266 1.02297 0 -0.926086 1.02221 0 -0.932402 1.02147 0 -0.938284 1.02077 0 -0.943816 1.0201 0 -0.949097 1.01945 0 -0.954241 1.01879 0 -0.959709 1.01883 0 -0.966642 1.01887 0 -0.978957 1.01891 0 -1.00393 1.01895 0 -1.05313 1.019 0 -1.14367 1.01906 0 -1.29977 1.01913 0 -1.55473 1.01921 0 -1.95359 1.0193 0 -2.55638 1.01942 0 -3.44246 1.01955 0 -4.7159 1.01972 0 -0.65509 1.03969 0 -0.64331 1.03851 0 -0.632143 1.03728 0 -0.621641 1.036 0 -0.611846 1.03469 0 -0.602794 1.03337 0 -0.594506 1.03203 0 -0.586994 1.03071 0 -0.580254 1.02943 0 -0.574271 1.02818 0 -0.568982 1.0269 0 -0.564306 1.02543 0 -0.560233 1.0237 0 -0.556787 1.02176 0 -0.553968 1.01971 0 -0.551757 1.0176 0 -0.550167 1.01543 0 -0.667422 1.04079 0 -0.680236 1.0418 0 -0.693454 1.0427 0 -0.706994 1.04347 0 -0.720769 1.04407 0 -0.734689 1.04449 0 -0.748667 1.04473 0 -0.762618 1.04477 0 -0.776462 1.04463 0 -0.790123 1.04432 0 -0.803531 1.04387 0 -0.81662 1.04331 0 -0.829327 1.04266 0 -0.841596 1.04194 0 -0.853371 1.04118 0 -0.864604 1.04039 0 -0.875254 1.03959 0 -0.885289 1.03877 0 -0.894686 1.03795 0 -0.903437 1.03714 0 -0.911548 1.03635 0 -0.919041 1.03558 0 -0.925953 1.03484 0 -0.932339 1.03413 0 -0.938273 1.03345 0 -0.943843 1.03281 0 -0.949151 1.03218 0 -0.954317 1.03155 0 -0.959804 1.03161 0 -0.966766 1.03167 0 -0.979123 1.03174 0 -1.00415 1.03181 0 -1.05343 1.03188 0 -1.14407 1.03197 0 -1.30027 1.03207 0 -1.55533 1.03218 0 -1.95423 1.03231 0 -2.557 1.03247 0 -3.4429 1.03265 0 -4.7159 1.03286 0 -0.642854 1.05602 0 -0.630539 1.05438 0 -0.618871 1.05268 0 -0.607904 1.05095 0 -0.597683 1.04919 0 -0.588239 1.04743 0 -0.579595 1.04568 0 -0.57176 1.04397 0 -0.564728 1.04231 0 -0.55848 1.04072 0 -0.552949 1.03913 0 -0.548053 1.03736 0 -0.543777 1.03535 0 -0.540145 1.03315 0 -0.537151 1.03085 0 -0.534778 1.02849 0 -0.533035 1.02607 0 -0.655755 1.05758 0 -0.669168 1.05904 0 -0.683012 1.06037 0 -0.697201 1.06154 0 -0.711642 1.06254 0 -0.726242 1.06332 0 -0.740906 1.06389 0 -0.755544 1.06424 0 -0.770068 1.06437 0 -0.784397 1.0643 0 -0.798454 1.06405 0 -0.812168 1.06366 0 -0.82547 1.06316 0 -0.838299 1.06257 0 -0.850595 1.06191 0 -0.862306 1.0612 0 -0.873389 1.06046 0 -0.883809 1.0597 0 -0.893544 1.05893 0 -0.902585 1.05816 0 -0.910938 1.05741 0 -0.918628 1.05668 0 -0.925696 1.05598 0 -0.9322 1.05531 0 -0.93822 1.05468 0 -0.943851 1.05407 0 -0.949202 1.05348 0 -0.954401 1.05289 0 -0.959921 1.05298 0 -0.966928 1.05308 0 -0.979356 1.05318 0 -1.00449 1.05329 0 -1.05391 1.05341 0 -1.14471 1.05354 0 -1.30109 1.05368 0 -1.5563 1.05384 0 -1.9553 1.05402 0 -2.55802 1.05423 0 -3.44362 1.05446 0 -4.7159 1.05473 0 -0.622061 1.08342 0 -0.608837 1.081 0 -0.59632 1.07853 0 -0.584566 1.07603 0 -0.57362 1.07352 0 -0.563514 1.07103 0 -0.554268 1.06859 0 -0.545889 1.06622 0 -0.538367 1.06394 0 -0.531678 1.06178 0 -0.52575 1.05965 0 -0.520496 1.05739 0 -0.515895 1.05493 0 -0.511966 1.05231 0 -0.508701 1.04961 0 -0.506074 1.04686 0 -0.504091 1.04406 0 -0.635926 1.08575 0 -0.650356 1.08796 0 -0.665262 1.09002 0 -0.680552 1.09188 0 -0.696124 1.09353 0 -0.711876 1.09492 0 -0.727704 1.09605 0 -0.743506 1.0969 0 -0.759184 1.09748 0 -0.774646 1.0978 0 -0.789805 1.0979 0 -0.804579 1.0978 0 -0.818891 1.09754 0 -0.832669 1.09715 0 -0.845848 1.09665 0 -0.858371 1.09608 0 -0.870188 1.09545 0 -0.881262 1.09477 0 -0.89157 1.09407 0 -0.901102 1.09336 0 -0.909867 1.09267 0 -0.917892 1.092 0 -0.925222 1.09136 0 -0.931926 1.09075 0 -0.93809 1.09017 0 -0.943821 1.08962 0 -0.949241 1.08909 0 -0.954492 1.08856 0 -0.960064 1.08871 0 -0.967146 1.08886 0 -0.979693 1.08902 0 -1.005 1.08918 0 -1.05465 1.08936 0 -1.14574 1.08954 0 -1.30242 1.08975 0 -1.5579 1.08997 0 -1.95707 1.09022 0 -2.55971 1.09051 0 -3.44482 1.09081 0 -4.7159 1.09115 0 -0.586795 1.12942 0 -0.572032 1.1257 0 -0.558077 1.12193 0 -0.54499 1.11814 0 -0.532817 1.11437 0 -0.52159 1.11067 0 -0.511328 1.10706 0 -0.502031 1.10359 0 -0.493685 1.10028 0 -0.486257 1.09716 0 -0.47967 1.09414 0 -0.473826 1.09107 0 -0.468697 1.08786 0 -0.464291 1.08455 0 -0.46059 1.08121 0 -0.457559 1.07784 0 -0.455193 1.07444 0 -0.602295 1.13304 0 -0.618446 1.13651 0 -0.635151 1.13979 0 -0.652305 1.14281 0 -0.669794 1.14555 0 -0.687497 1.14796 0 -0.705295 1.15001 0 -0.723069 1.1517 0 -0.740702 1.15302 0 -0.758084 1.154 0 -0.775109 1.15466 0 -0.791678 1.15504 0 -0.807699 1.15518 0 -0.823087 1.15511 0 -0.837762 1.15488 0 -0.851659 1.15451 0 -0.86472 1.15404 0 -0.876903 1.1535 0 -0.88818 1.1529 0 -0.898544 1.15228 0 -0.908006 1.15168 0 -0.916596 1.15109 0 -0.924372 1.15054 0 -0.931412 1.15002 0 -0.937818 1.14953 0 -0.943716 1.14907 0 -0.949249 1.14862 0 -0.954584 1.14817 0 -0.960238 1.1484 0 -0.967446 1.14862 0 -0.980193 1.14886 0 -1.0058 1.1491 0 -1.05585 1.14936 0 -1.14742 1.14963 0 -1.30461 1.14993 0 -1.56055 1.15024 0 -1.95999 1.15059 0 -2.56253 1.15097 0 -3.44681 1.15137 0 -4.7159 1.1518 0 -0.527061 1.20668 0 -0.509693 1.20078 0 -0.493304 1.19482 0 -0.477961 1.18888 0 -0.463713 1.183 0 -0.450591 1.17726 0 -0.438609 1.17171 0 -0.427763 1.1664 0 -0.418029 1.16137 0 -0.409364 1.15665 0 -0.401675 1.15216 0 -0.394854 1.14774 0 -0.388854 1.14331 0 -0.383669 1.13888 0 -0.379259 1.13449 0 -0.375573 1.13014 0 -0.372582 1.12577 0 -0.545326 1.21246 0 -0.564391 1.21804 0 -0.584141 1.22334 0 -0.60445 1.22831 0 -0.62518 1.23286 0 -0.646186 1.23696 0 -0.667319 1.24056 0 -0.688428 1.24365 0 -0.709369 1.24621 0 -0.729998 1.24827 0 -0.750179 1.24986 0 -0.769787 1.25102 0 -0.7887 1.25181 0 -0.806809 1.25227 0 -0.824018 1.25245 0 -0.840239 1.25242 0 -0.855405 1.2522 0 -0.869463 1.25184 0 -0.882382 1.25139 0 -0.894153 1.2509 0 -0.904791 1.25042 0 -0.91434 1.24996 0 -0.922869 1.24954 0 -0.930476 1.24914 0 -0.93729 1.24877 0 -0.943467 1.24842 0 -0.949187 1.2481 0 -0.954659 1.24777 0 -0.960451 1.2481 0 -0.967868 1.24844 0 -0.980954 1.24878 0 -1.00706 1.24913 0 -1.05779 1.2495 0 -1.15017 1.24989 0 -1.30823 1.25031 0 -1.56497 1.25075 0 -1.96488 1.25122 0 -2.56722 1.25173 0 -3.45013 1.25225 0 -4.7159 1.25279 0 -0.425969 1.33645 0 -0.404195 1.3269 0 -0.383691 1.3173 0 -0.364533 1.30775 0 -0.346774 1.29835 0 -0.330448 1.28921 0 -0.315562 1.28041 0 -0.302101 1.27203 0 -0.290028 1.26412 0 -0.279279 1.25674 0 -0.269744 1.24981 0 -0.261291 1.24317 0 -0.253847 1.23671 0 -0.247373 1.23044 0 -0.241799 1.22436 0 -0.237036 1.2184 0 -0.233016 1.21248 0 -0.448912 1.34584 0 -0.472905 1.35494 0 -0.497804 1.36364 0 -0.523449 1.37184 0 -0.549661 1.37944 0 -0.57625 1.38635 0 -0.603021 1.39253 0 -0.629772 1.39792 0 -0.656304 1.40254 0 -0.682422 1.40639 0 -0.707942 1.4095 0 -0.732685 1.41195 0 -0.756488 1.41379 0 -0.7792 1.41509 0 -0.80069 1.41594 0 -0.820842 1.41642 0 -0.839566 1.41658 0 -0.856794 1.41651 0 -0.872488 1.41628 0 -0.886638 1.41596 0 -0.899268 1.41565 0 -0.910437 1.41536 0 -0.920238 1.4151 0 -0.928804 1.41486 0 -0.936306 1.41466 0 -0.942951 1.41448 0 -0.948984 1.41432 0 -0.954685 1.41415 0 -0.960706 1.41462 0 -0.968475 1.4151 0 -0.982135 1.41558 0 -1.0091 1.41608 0 -1.06097 1.4166 0 -1.15472 1.41714 0 -1.31426 1.41771 0 -1.57232 1.41831 0 -1.97302 1.41895 0 -2.57503 1.41961 0 -3.45564 1.42029 0 -4.7159 1.42095 0 -0.254986 1.55447 0 -0.225765 1.53882 0 -0.198302 1.52312 0 -0.172694 1.50754 0 -0.149003 1.49226 0 -0.12726 1.47744 0 -0.107466 1.46322 0 -0.0895897 1.44972 0 -0.0735685 1.43703 0 -0.0593113 1.42522 0 -0.0466742 1.41424 0 -0.0354868 1.40391 0 -0.0256304 1.39412 0 -0.017012 1.38483 0 -0.00950465 1.37597 0 -0.0029564 1.36742 0 --0.00277277 1.35899 0 -0.285839 1.56988 0 -0.318163 1.58486 0 -0.351766 1.59924 0 -0.38643 1.61283 0 -0.421907 1.62549 0 -0.457935 1.6371 0 -0.494233 1.64755 0 -0.530517 1.65679 0 -0.566498 1.6648 0 -0.601895 1.6716 0 -0.636434 1.67723 0 -0.669856 1.68177 0 -0.701922 1.68531 0 -0.732413 1.68798 0 -0.761137 1.68988 0 -0.787932 1.69115 0 -0.812668 1.69189 0 -0.835254 1.69224 0 -0.855637 1.69228 0 -0.873807 1.69218 0 -0.889803 1.69209 0 -0.90371 1.69202 0 -0.915663 1.69197 0 -0.925849 1.69195 0 -0.934513 1.69196 0 -0.941949 1.69199 0 -0.948508 1.69203 0 -0.954593 1.69206 0 -0.960998 1.69271 0 -0.969363 1.69336 0 -0.983993 1.69402 0 -1.0124 1.69469 0 -1.0662 1.69538 0 -1.16228 1.69611 0 -1.3243 1.69686 0 -1.58459 1.69765 0 -1.98661 1.69848 0 -2.58805 1.69933 0 -3.46481 1.70018 0 -4.7159 1.70098 0 --0.0340919 1.92079 0 --0.0759015 1.89495 0 --0.115125 1.86906 0 --0.151635 1.84342 0 --0.185353 1.81831 0 --0.216249 1.794 0 --0.244335 1.77073 0 --0.26967 1.7487 0 --0.292355 1.72805 0 --0.312528 1.70888 0 --0.33039 1.69116 0 --0.346172 1.67474 0 --0.360073 1.65945 0 --0.372277 1.64518 0 --0.383012 1.63178 0 --0.392539 1.619 0 --0.401123 1.60649 0 -0.0101279 1.94626 0 -0.0565317 1.97106 0 -0.104845 1.9949 0 -0.154749 2.01749 0 -0.205884 2.03859 0 -0.257858 2.05799 0 -0.310255 2.07555 0 -0.362644 2.09117 0 -0.414589 2.1048 0 -0.46566 2.11645 0 -0.515436 2.1262 0 -0.56352 2.13416 0 -0.609545 2.14047 0 -0.653175 2.14531 0 -0.694121 2.14887 0 -0.732136 2.15136 0 -0.76703 2.15297 0 -0.798666 2.15389 0 -0.826971 2.1543 0 -0.851934 2.15446 0 -0.873618 2.15462 0 -0.892152 2.15479 0 -0.907741 2.15499 0 -0.920668 2.15521 0 -0.931295 2.15546 0 -0.940068 2.15572 0 -0.947514 2.156 0 -0.954248 2.15627 0 -0.961303 2.15709 0 -0.970675 2.15791 0 -0.986947 2.15875 0 -1.0178 2.15959 0 -1.07486 2.16047 0 -1.17487 2.16138 0 -1.34108 2.16232 0 -1.60511 2.1633 0 -2.00932 2.16431 0 -2.60979 2.16533 0 -3.48007 2.16634 0 -4.7159 2.16727 0 --0.522706 2.53632 0 --0.585788 2.49347 0 --0.644885 2.45057 0 --0.699818 2.40812 0 --0.750481 2.36661 0 --0.796843 2.32648 0 --0.83894 2.28812 0 --0.876876 2.25186 0 --0.910812 2.21794 0 --0.940968 2.18654 0 --0.967636 2.15766 0 --0.991155 2.13113 0 --1.01185 2.10676 0 --1.03008 2.08432 0 --1.04622 2.06348 0 --1.06074 2.04379 0 --1.07411 2.02464 0 --0.455899 2.5786 0 --0.385705 2.6198 0 --0.312537 2.65941 0 --0.236884 2.697 0 --0.159298 2.73215 0 --0.0803855 2.76454 0 --0.000794174 2.7939 0 -0.0788004 2.82008 0 -0.157711 2.84299 0 -0.235254 2.86265 0 -0.310766 2.87916 0 -0.383614 2.89269 0 -0.453213 2.90347 0 -0.519036 2.91179 0 -0.580622 2.91795 0 -0.637588 2.9223 0 -0.689636 2.92516 0 -0.736559 2.92685 0 -0.778244 2.92769 0 -0.814682 2.92808 0 -0.845974 2.92847 0 -0.872328 2.92887 0 -0.894064 2.92929 0 -0.911624 2.92973 0 -0.925573 2.93018 0 -0.936608 2.93065 0 -0.945557 2.93113 0 -0.953388 2.9316 0 -0.961546 2.93253 0 -0.972626 2.93345 0 -0.99168 2.93439 0 -1.02666 2.93535 0 -1.08924 2.93633 0 -1.19586 2.93734 0 -1.36912 2.93838 0 -1.63943 2.93946 0 -2.0473 2.94057 0 -2.64607 2.94168 0 -3.50546 2.94276 0 -4.7159 2.94372 0 --1.34845 3.57073 0 --1.44747 3.49947 0 --1.54015 3.42816 0 --1.62621 3.35765 0 --1.70551 3.28876 0 --1.778 3.22222 0 --1.84377 3.1587 0 --1.90299 3.09874 0 --1.95593 3.04276 0 --2.00294 2.99102 0 --2.04447 2.94359 0 --2.08102 2.90034 0 --2.11317 2.86097 0 --2.14152 2.82507 0 --2.16676 2.79204 0 --2.18967 2.76105 0 --2.21108 2.73107 0 --1.24348 3.64106 0 --1.13309 3.70961 0 --1.01793 3.77555 0 --0.898782 3.83813 0 --0.776514 3.89668 0 --0.652099 3.95064 0 --0.526575 3.99961 0 --0.401032 4.04328 0 --0.276581 4.08153 0 --0.15433 4.11438 0 --0.0353574 4.14196 0 -0.0793092 4.16456 0 -0.188719 4.18255 0 -0.292015 4.1964 0 -0.388456 4.20663 0 -0.477423 4.21378 0 -0.55844 4.21843 0 -0.631177 4.2211 0 -0.695461 4.22232 0 -0.751281 4.22279 0 -0.798805 4.22323 0 -0.838371 4.22369 0 -0.870497 4.22415 0 -0.895891 4.22463 0 -0.915461 4.22511 0 -0.930326 4.22561 0 -0.941823 4.22611 0 -0.951521 4.22661 0 -0.961554 4.22739 0 -0.975534 4.22817 0 -0.999297 4.22896 0 -1.04126 4.22976 0 -1.11315 4.23058 0 -1.23093 4.23143 0 -1.41604 4.2323 0 -1.69687 4.23319 0 -2.1108 4.23411 0 -2.70663 4.23502 0 -3.54772 4.23589 0 -4.7159 4.23665 0 --2.74376 5.30917 0 --2.90351 5.19049 0 --3.05292 5.07175 0 --3.19158 4.9544 0 --3.31925 4.8398 0 --3.4359 4.72921 0 --3.54167 4.62373 0 --3.63685 4.52429 0 --3.72189 4.43157 0 --3.79736 4.34603 0 --3.86396 4.26785 0 --3.92252 4.1969 0 --3.97398 4.13277 0 --4.01938 4.07472 0 --4.05994 4.02167 0 --4.09696 3.97221 0 --4.13193 3.92454 0 --2.57432 5.42633 0 --2.39603 5.54051 0 --2.20995 5.65035 0 --2.01732 5.75457 0 --1.81958 5.85207 0 --1.61831 5.94192 0 --1.41521 6.02341 0 --1.21208 6.09607 0 --1.01072 6.15966 0 --0.81297 6.21419 0 --0.62061 6.25992 0 --0.435331 6.29727 0 --0.258701 6.32688 0 --0.09213 6.34951 0 -0.0631611 6.36603 0 -0.206162 6.37737 0 -0.336093 6.38447 0 -0.452422 6.38825 0 -0.554867 6.38956 0 -0.64342 6.3896 0 -0.718362 6.3896 0 -0.780253 6.3896 0 -0.829941 6.3896 0 -0.868584 6.3896 0 -0.897667 6.3896 0 -0.919022 6.3896 0 -0.934846 6.3896 0 -0.94772 6.3896 0 -0.960947 6.3896 0 -0.979851 6.3896 0 -1.01159 6.3896 0 -1.06536 6.3896 0 -1.15296 6.3896 0 -1.28955 6.3896 0 -1.49458 6.3896 0 -1.79305 6.3896 0 -2.21704 6.3896 0 -2.80774 6.3896 0 -3.61805 6.3896 0 -4.7159 6.3896 0 -CELLS 1408 7040 -4 987 17677 15852 0 -4 988 987 0 1 -4 989 988 1 2 -4 990 989 2 3 -4 991 990 3 4 -4 992 991 4 5 -4 993 992 5 6 -4 994 993 6 7 -4 995 994 7 8 -4 996 995 8 9 -4 997 996 9 10 -4 998 997 10 11 -4 999 998 11 12 -4 1000 999 12 13 -4 1001 1000 13 14 -4 1002 1001 14 15 -4 1003 1002 15 16 -4 1004 1003 16 17 -4 1005 1004 17 18 -4 1006 1005 18 19 -4 1007 1006 19 20 -4 1008 1007 20 21 -4 1009 1008 21 22 -4 1010 1009 22 23 -4 1011 1010 23 24 -4 1012 1011 24 25 -4 1013 1012 25 26 -4 17617 1013 26 15792 -4 1974 19502 17677 987 -4 1975 1974 987 988 -4 1976 1975 988 989 -4 1977 1976 989 990 -4 1978 1977 990 991 -4 1979 1978 991 992 -4 1980 1979 992 993 -4 1981 1980 993 994 -4 1982 1981 994 995 -4 1983 1982 995 996 -4 1984 1983 996 997 -4 1985 1984 997 998 -4 1986 1985 998 999 -4 1987 1986 999 1000 -4 1988 1987 1000 1001 -4 1989 1988 1001 1002 -4 1990 1989 1002 1003 -4 1991 1990 1003 1004 -4 1992 1991 1004 1005 -4 1993 1992 1005 1006 -4 1994 1993 1006 1007 -4 1995 1994 1007 1008 -4 1996 1995 1008 1009 -4 1997 1996 1009 1010 -4 1998 1997 1010 1011 -4 1999 1998 1011 1012 -4 2000 1999 1012 1013 -4 19442 2000 1013 17617 -4 2961 21327 19502 1974 -4 2962 2961 1974 1975 -4 2963 2962 1975 1976 -4 2964 2963 1976 1977 -4 2965 2964 1977 1978 -4 2966 2965 1978 1979 -4 2967 2966 1979 1980 -4 2968 2967 1980 1981 -4 2969 2968 1981 1982 -4 2970 2969 1982 1983 -4 2971 2970 1983 1984 -4 2972 2971 1984 1985 -4 2973 2972 1985 1986 -4 2974 2973 1986 1987 -4 2975 2974 1987 1988 -4 2976 2975 1988 1989 -4 2977 2976 1989 1990 -4 2978 2977 1990 1991 -4 2979 2978 1991 1992 -4 2980 2979 1992 1993 -4 2981 2980 1993 1994 -4 2982 2981 1994 1995 -4 2983 2982 1995 1996 -4 2984 2983 1996 1997 -4 2985 2984 1997 1998 -4 2986 2985 1998 1999 -4 2987 2986 1999 2000 -4 21267 2987 2000 19442 -4 3948 23152 21327 2961 -4 3949 3948 2961 2962 -4 3950 3949 2962 2963 -4 3951 3950 2963 2964 -4 3952 3951 2964 2965 -4 3953 3952 2965 2966 -4 3954 3953 2966 2967 -4 3955 3954 2967 2968 -4 3956 3955 2968 2969 -4 3957 3956 2969 2970 -4 3958 3957 2970 2971 -4 3959 3958 2971 2972 -4 3960 3959 2972 2973 -4 3961 3960 2973 2974 -4 3962 3961 2974 2975 -4 3963 3962 2975 2976 -4 3964 3963 2976 2977 -4 3965 3964 2977 2978 -4 3966 3965 2978 2979 -4 3967 3966 2979 2980 -4 3968 3967 2980 2981 -4 3969 3968 2981 2982 -4 3970 3969 2982 2983 -4 3971 3970 2983 2984 -4 3972 3971 2984 2985 -4 3973 3972 2985 2986 -4 3974 3973 2986 2987 -4 23092 3974 2987 21267 -4 4935 24977 23152 3948 -4 4936 4935 3948 3949 -4 4937 4936 3949 3950 -4 4938 4937 3950 3951 -4 4939 4938 3951 3952 -4 4940 4939 3952 3953 -4 4941 4940 3953 3954 -4 4942 4941 3954 3955 -4 4943 4942 3955 3956 -4 4944 4943 3956 3957 -4 4945 4944 3957 3958 -4 4946 4945 3958 3959 -4 4947 4946 3959 3960 -4 4948 4947 3960 3961 -4 4949 4948 3961 3962 -4 4950 4949 3962 3963 -4 4951 4950 3963 3964 -4 4952 4951 3964 3965 -4 4953 4952 3965 3966 -4 4954 4953 3966 3967 -4 4955 4954 3967 3968 -4 4956 4955 3968 3969 -4 4957 4956 3969 3970 -4 4958 4957 3970 3971 -4 4959 4958 3971 3972 -4 4960 4959 3972 3973 -4 4961 4960 3973 3974 -4 24917 4961 3974 23092 -4 5922 26802 24977 4935 -4 5923 5922 4935 4936 -4 5924 5923 4936 4937 -4 5925 5924 4937 4938 -4 5926 5925 4938 4939 -4 5927 5926 4939 4940 -4 5928 5927 4940 4941 -4 5929 5928 4941 4942 -4 5930 5929 4942 4943 -4 5931 5930 4943 4944 -4 5932 5931 4944 4945 -4 5933 5932 4945 4946 -4 5934 5933 4946 4947 -4 5935 5934 4947 4948 -4 5936 5935 4948 4949 -4 5937 5936 4949 4950 -4 5938 5937 4950 4951 -4 5939 5938 4951 4952 -4 5940 5939 4952 4953 -4 5941 5940 4953 4954 -4 5942 5941 4954 4955 -4 5943 5942 4955 4956 -4 5944 5943 4956 4957 -4 5945 5944 4957 4958 -4 5946 5945 4958 4959 -4 5947 5946 4959 4960 -4 5948 5947 4960 4961 -4 26742 5948 4961 24917 -4 6909 28627 26802 5922 -4 6910 6909 5922 5923 -4 6911 6910 5923 5924 -4 6912 6911 5924 5925 -4 6913 6912 5925 5926 -4 6914 6913 5926 5927 -4 6915 6914 5927 5928 -4 6916 6915 5928 5929 -4 6917 6916 5929 5930 -4 6918 6917 5930 5931 -4 6919 6918 5931 5932 -4 6920 6919 5932 5933 -4 6921 6920 5933 5934 -4 6922 6921 5934 5935 -4 6923 6922 5935 5936 -4 6924 6923 5936 5937 -4 6925 6924 5937 5938 -4 6926 6925 5938 5939 -4 6927 6926 5939 5940 -4 6928 6927 5940 5941 -4 6929 6928 5941 5942 -4 6930 6929 5942 5943 -4 6931 6930 5943 5944 -4 6932 6931 5944 5945 -4 6933 6932 5945 5946 -4 6934 6933 5946 5947 -4 6935 6934 5947 5948 -4 28567 6935 5948 26742 -4 7896 30452 28627 6909 -4 7897 7896 6909 6910 -4 7898 7897 6910 6911 -4 7899 7898 6911 6912 -4 7900 7899 6912 6913 -4 7901 7900 6913 6914 -4 7902 7901 6914 6915 -4 7903 7902 6915 6916 -4 7904 7903 6916 6917 -4 7905 7904 6917 6918 -4 7906 7905 6918 6919 -4 7907 7906 6919 6920 -4 7908 7907 6920 6921 -4 7909 7908 6921 6922 -4 7910 7909 6922 6923 -4 7911 7910 6923 6924 -4 7912 7911 6924 6925 -4 7913 7912 6925 6926 -4 7914 7913 6926 6927 -4 7915 7914 6927 6928 -4 7916 7915 6928 6929 -4 7917 7916 6929 6930 -4 7918 7917 6930 6931 -4 7919 7918 6931 6932 -4 7920 7919 6932 6933 -4 7921 7920 6933 6934 -4 7922 7921 6934 6935 -4 30392 7922 6935 28567 -4 8883 32277 30452 7896 -4 8884 8883 7896 7897 -4 8885 8884 7897 7898 -4 8886 8885 7898 7899 -4 8887 8886 7899 7900 -4 8888 8887 7900 7901 -4 8889 8888 7901 7902 -4 8890 8889 7902 7903 -4 8891 8890 7903 7904 -4 8892 8891 7904 7905 -4 8893 8892 7905 7906 -4 8894 8893 7906 7907 -4 8895 8894 7907 7908 -4 8896 8895 7908 7909 -4 8897 8896 7909 7910 -4 8898 8897 7910 7911 -4 8899 8898 7911 7912 -4 8900 8899 7912 7913 -4 8901 8900 7913 7914 -4 8902 8901 7914 7915 -4 8903 8902 7915 7916 -4 8904 8903 7916 7917 -4 8905 8904 7917 7918 -4 8906 8905 7918 7919 -4 8907 8906 7919 7920 -4 8908 8907 7920 7921 -4 8909 8908 7921 7922 -4 32217 8909 7922 30392 -4 9870 34102 32277 8883 -4 9871 9870 8883 8884 -4 9872 9871 8884 8885 -4 9873 9872 8885 8886 -4 9874 9873 8886 8887 -4 9875 9874 8887 8888 -4 9876 9875 8888 8889 -4 9877 9876 8889 8890 -4 9878 9877 8890 8891 -4 9879 9878 8891 8892 -4 9880 9879 8892 8893 -4 9881 9880 8893 8894 -4 9882 9881 8894 8895 -4 9883 9882 8895 8896 -4 9884 9883 8896 8897 -4 9885 9884 8897 8898 -4 9886 9885 8898 8899 -4 9887 9886 8899 8900 -4 9888 9887 8900 8901 -4 9889 9888 8901 8902 -4 9890 9889 8902 8903 -4 9891 9890 8903 8904 -4 9892 9891 8904 8905 -4 9893 9892 8905 8906 -4 9894 9893 8906 8907 -4 9895 9894 8907 8908 -4 9896 9895 8908 8909 -4 34042 9896 8909 32217 -4 10857 35927 34102 9870 -4 10858 10857 9870 9871 -4 10859 10858 9871 9872 -4 10860 10859 9872 9873 -4 10861 10860 9873 9874 -4 10862 10861 9874 9875 -4 10863 10862 9875 9876 -4 10864 10863 9876 9877 -4 10865 10864 9877 9878 -4 10866 10865 9878 9879 -4 10867 10866 9879 9880 -4 10868 10867 9880 9881 -4 10869 10868 9881 9882 -4 10870 10869 9882 9883 -4 10871 10870 9883 9884 -4 10872 10871 9884 9885 -4 10873 10872 9885 9886 -4 10874 10873 9886 9887 -4 10875 10874 9887 9888 -4 10876 10875 9888 9889 -4 10877 10876 9889 9890 -4 10878 10877 9890 9891 -4 10879 10878 9891 9892 -4 10880 10879 9892 9893 -4 10881 10880 9893 9894 -4 10882 10881 9894 9895 -4 10883 10882 9895 9896 -4 35867 10883 9896 34042 -4 11844 37752 35927 10857 -4 11845 11844 10857 10858 -4 11846 11845 10858 10859 -4 11847 11846 10859 10860 -4 11848 11847 10860 10861 -4 11849 11848 10861 10862 -4 11850 11849 10862 10863 -4 11851 11850 10863 10864 -4 11852 11851 10864 10865 -4 11853 11852 10865 10866 -4 11854 11853 10866 10867 -4 11855 11854 10867 10868 -4 11856 11855 10868 10869 -4 11857 11856 10869 10870 -4 11858 11857 10870 10871 -4 11859 11858 10871 10872 -4 11860 11859 10872 10873 -4 11861 11860 10873 10874 -4 11862 11861 10874 10875 -4 11863 11862 10875 10876 -4 11864 11863 10876 10877 -4 11865 11864 10877 10878 -4 11866 11865 10878 10879 -4 11867 11866 10879 10880 -4 11868 11867 10880 10881 -4 11869 11868 10881 10882 -4 11870 11869 10882 10883 -4 37692 11870 10883 35867 -4 12831 39577 37752 11844 -4 12832 12831 11844 11845 -4 12833 12832 11845 11846 -4 12834 12833 11846 11847 -4 12835 12834 11847 11848 -4 12836 12835 11848 11849 -4 12837 12836 11849 11850 -4 12838 12837 11850 11851 -4 12839 12838 11851 11852 -4 12840 12839 11852 11853 -4 12841 12840 11853 11854 -4 12842 12841 11854 11855 -4 12843 12842 11855 11856 -4 12844 12843 11856 11857 -4 12845 12844 11857 11858 -4 12846 12845 11858 11859 -4 12847 12846 11859 11860 -4 12848 12847 11860 11861 -4 12849 12848 11861 11862 -4 12850 12849 11862 11863 -4 12851 12850 11863 11864 -4 12852 12851 11864 11865 -4 12853 12852 11865 11866 -4 12854 12853 11866 11867 -4 12855 12854 11867 11868 -4 12856 12855 11868 11869 -4 12857 12856 11869 11870 -4 39517 12857 11870 37692 -4 13818 41402 39577 12831 -4 13819 13818 12831 12832 -4 13820 13819 12832 12833 -4 13821 13820 12833 12834 -4 13822 13821 12834 12835 -4 13823 13822 12835 12836 -4 13824 13823 12836 12837 -4 13825 13824 12837 12838 -4 13826 13825 12838 12839 -4 13827 13826 12839 12840 -4 13828 13827 12840 12841 -4 13829 13828 12841 12842 -4 13830 13829 12842 12843 -4 13831 13830 12843 12844 -4 13832 13831 12844 12845 -4 13833 13832 12845 12846 -4 13834 13833 12846 12847 -4 13835 13834 12847 12848 -4 13836 13835 12848 12849 -4 13837 13836 12849 12850 -4 13838 13837 12850 12851 -4 13839 13838 12851 12852 -4 13840 13839 12852 12853 -4 13841 13840 12853 12854 -4 13842 13841 12854 12855 -4 13843 13842 12855 12856 -4 13844 13843 12856 12857 -4 41342 13844 12857 39517 -4 14805 43227 41402 13818 -4 14806 14805 13818 13819 -4 14807 14806 13819 13820 -4 14808 14807 13820 13821 -4 14809 14808 13821 13822 -4 14810 14809 13822 13823 -4 14811 14810 13823 13824 -4 14812 14811 13824 13825 -4 14813 14812 13825 13826 -4 14814 14813 13826 13827 -4 14815 14814 13827 13828 -4 14816 14815 13828 13829 -4 14817 14816 13829 13830 -4 14818 14817 13830 13831 -4 14819 14818 13831 13832 -4 14820 14819 13832 13833 -4 14821 14820 13833 13834 -4 14822 14821 13834 13835 -4 14823 14822 13835 13836 -4 14824 14823 13836 13837 -4 14825 14824 13837 13838 -4 14826 14825 13838 13839 -4 14827 14826 13839 13840 -4 14828 13841 13840 14827 -4 14829 13842 13841 14828 -4 14830 13843 13842 14829 -4 14831 13844 13843 14830 -4 43167 41342 13844 14831 -4 45035 14805 43227 45036 -4 45034 45035 14805 14806 -4 45033 45034 14806 14807 -4 45032 45033 14807 14808 -4 45031 45032 14808 14809 -4 45030 45031 14809 14810 -4 45029 45030 14810 14811 -4 45028 45029 14811 14812 -4 45027 45028 14812 14813 -4 45026 45027 14813 14814 -4 45025 45026 14814 14815 -4 45024 45025 14815 14816 -4 45023 45024 14816 14817 -4 45022 45023 14817 14818 -4 45021 45022 14818 14819 -4 45020 45021 14819 14820 -4 45019 45020 14820 14821 -4 45018 45019 14821 14822 -4 45017 45018 14822 14823 -4 45016 45017 14823 14824 -4 45015 45016 14824 14825 -4 45014 45015 14825 14826 -4 45013 45014 14826 14827 -4 45012 45013 14827 14828 -4 45011 14829 14828 45012 -4 45010 14830 14829 45011 -4 45009 14831 14830 45010 -4 44992 43167 14831 45009 -4 17618 17617 15792 15793 -4 17619 17618 15793 15794 -4 17620 17619 15794 15795 -4 17621 17620 15795 15796 -4 17622 17621 15796 15797 -4 17623 17622 15797 15798 -4 17624 17623 15798 15799 -4 17625 17624 15799 15800 -4 17626 17625 15800 15801 -4 17627 17626 15801 15802 -4 17628 17627 15802 15803 -4 17629 17628 15803 15804 -4 17630 17629 15804 15805 -4 17631 17630 15805 15806 -4 17632 17631 15806 15807 -4 17633 17632 15807 15808 -4 17634 17633 15808 15809 -4 17635 17634 15809 15810 -4 17636 17635 15810 15811 -4 17637 17636 15811 15812 -4 17638 17637 15812 15813 -4 17639 17638 15813 15814 -4 17640 17639 15814 15815 -4 17641 17640 15815 15816 -4 17642 17641 15816 15817 -4 17643 17642 15817 15818 -4 17644 17643 15818 15819 -4 17645 17644 15819 15820 -4 17646 17645 15820 15821 -4 17647 17646 15821 15822 -4 17648 17647 15822 15823 -4 17649 17648 15823 15824 -4 17650 17649 15824 15825 -4 17651 17650 15825 15826 -4 17652 17651 15826 15827 -4 17653 17652 15827 15828 -4 17654 17653 15828 15829 -4 17655 17654 15829 15830 -4 17656 17655 15830 15831 -4 17657 17656 15831 15832 -4 17658 17657 15832 15833 -4 17659 17658 15833 15834 -4 17660 17659 15834 15835 -4 17661 17660 15835 15836 -4 17662 17661 15836 15837 -4 17663 17662 15837 15838 -4 17664 17663 15838 15839 -4 17665 17664 15839 15840 -4 17666 17665 15840 15841 -4 17667 17666 15841 15842 -4 17668 17667 15842 15843 -4 17669 17668 15843 15844 -4 17670 17669 15844 15845 -4 17671 17670 15845 15846 -4 17672 17671 15846 15847 -4 17673 17672 15847 15848 -4 17674 17673 15848 15849 -4 17675 17674 15849 15850 -4 17676 17675 15850 15851 -4 17677 17676 15851 15852 -4 19443 19442 17617 17618 -4 19444 19443 17618 17619 -4 19445 19444 17619 17620 -4 19446 19445 17620 17621 -4 19447 19446 17621 17622 -4 19448 19447 17622 17623 -4 19449 19448 17623 17624 -4 19450 19449 17624 17625 -4 19451 19450 17625 17626 -4 19452 19451 17626 17627 -4 19453 19452 17627 17628 -4 19454 19453 17628 17629 -4 19455 19454 17629 17630 -4 19456 19455 17630 17631 -4 19457 19456 17631 17632 -4 19458 19457 17632 17633 -4 19459 19458 17633 17634 -4 19460 19459 17634 17635 -4 19461 19460 17635 17636 -4 19462 19461 17636 17637 -4 19463 19462 17637 17638 -4 19464 19463 17638 17639 -4 19465 19464 17639 17640 -4 19466 19465 17640 17641 -4 19467 19466 17641 17642 -4 19468 19467 17642 17643 -4 19469 19468 17643 17644 -4 19470 19469 17644 17645 -4 19471 19470 17645 17646 -4 19472 19471 17646 17647 -4 19473 19472 17647 17648 -4 19474 19473 17648 17649 -4 19475 19474 17649 17650 -4 19476 19475 17650 17651 -4 19477 19476 17651 17652 -4 19478 19477 17652 17653 -4 19479 19478 17653 17654 -4 19480 19479 17654 17655 -4 19481 19480 17655 17656 -4 19482 19481 17656 17657 -4 19483 19482 17657 17658 -4 19484 19483 17658 17659 -4 19485 19484 17659 17660 -4 19486 19485 17660 17661 -4 19487 19486 17661 17662 -4 19488 19487 17662 17663 -4 19489 19488 17663 17664 -4 19490 19489 17664 17665 -4 19491 19490 17665 17666 -4 19492 19491 17666 17667 -4 19493 19492 17667 17668 -4 19494 19493 17668 17669 -4 19495 19494 17669 17670 -4 19496 19495 17670 17671 -4 19497 19496 17671 17672 -4 19498 19497 17672 17673 -4 19499 19498 17673 17674 -4 19500 19499 17674 17675 -4 19501 19500 17675 17676 -4 19502 19501 17676 17677 -4 21268 21267 19442 19443 -4 21269 21268 19443 19444 -4 21270 21269 19444 19445 -4 21271 21270 19445 19446 -4 21272 21271 19446 19447 -4 21273 21272 19447 19448 -4 21274 21273 19448 19449 -4 21275 21274 19449 19450 -4 21276 21275 19450 19451 -4 21277 21276 19451 19452 -4 21278 21277 19452 19453 -4 21279 21278 19453 19454 -4 21280 21279 19454 19455 -4 21281 21280 19455 19456 -4 21282 21281 19456 19457 -4 21283 21282 19457 19458 -4 21284 21283 19458 19459 -4 21285 21284 19459 19460 -4 21286 21285 19460 19461 -4 21287 21286 19461 19462 -4 21288 21287 19462 19463 -4 21289 21288 19463 19464 -4 21290 21289 19464 19465 -4 21291 21290 19465 19466 -4 21292 21291 19466 19467 -4 21293 21292 19467 19468 -4 21294 21293 19468 19469 -4 21295 21294 19469 19470 -4 21296 21295 19470 19471 -4 21297 21296 19471 19472 -4 21298 21297 19472 19473 -4 21299 21298 19473 19474 -4 21300 21299 19474 19475 -4 21301 21300 19475 19476 -4 21302 21301 19476 19477 -4 21303 21302 19477 19478 -4 21304 21303 19478 19479 -4 21305 21304 19479 19480 -4 21306 21305 19480 19481 -4 21307 21306 19481 19482 -4 21308 21307 19482 19483 -4 21309 21308 19483 19484 -4 21310 21309 19484 19485 -4 21311 21310 19485 19486 -4 21312 21311 19486 19487 -4 21313 21312 19487 19488 -4 21314 21313 19488 19489 -4 21315 21314 19489 19490 -4 21316 21315 19490 19491 -4 21317 21316 19491 19492 -4 21318 21317 19492 19493 -4 21319 21318 19493 19494 -4 21320 21319 19494 19495 -4 21321 21320 19495 19496 -4 21322 21321 19496 19497 -4 21323 21322 19497 19498 -4 21324 21323 19498 19499 -4 21325 21324 19499 19500 -4 21326 21325 19500 19501 -4 21327 21326 19501 19502 -4 23093 23092 21267 21268 -4 23094 23093 21268 21269 -4 23095 23094 21269 21270 -4 23096 23095 21270 21271 -4 23097 23096 21271 21272 -4 23098 23097 21272 21273 -4 23099 23098 21273 21274 -4 23100 23099 21274 21275 -4 23101 23100 21275 21276 -4 23102 23101 21276 21277 -4 23103 23102 21277 21278 -4 23104 23103 21278 21279 -4 23105 23104 21279 21280 -4 23106 23105 21280 21281 -4 23107 23106 21281 21282 -4 23108 23107 21282 21283 -4 23109 23108 21283 21284 -4 23110 23109 21284 21285 -4 23111 23110 21285 21286 -4 23112 23111 21286 21287 -4 23113 23112 21287 21288 -4 23114 23113 21288 21289 -4 23115 23114 21289 21290 -4 23116 23115 21290 21291 -4 23117 23116 21291 21292 -4 23118 23117 21292 21293 -4 23119 23118 21293 21294 -4 23120 23119 21294 21295 -4 23121 23120 21295 21296 -4 23122 23121 21296 21297 -4 23123 23122 21297 21298 -4 23124 23123 21298 21299 -4 23125 23124 21299 21300 -4 23126 23125 21300 21301 -4 23127 23126 21301 21302 -4 23128 23127 21302 21303 -4 23129 23128 21303 21304 -4 23130 23129 21304 21305 -4 23131 23130 21305 21306 -4 23132 23131 21306 21307 -4 23133 23132 21307 21308 -4 23134 23133 21308 21309 -4 23135 23134 21309 21310 -4 23136 23135 21310 21311 -4 23137 23136 21311 21312 -4 23138 23137 21312 21313 -4 23139 23138 21313 21314 -4 23140 23139 21314 21315 -4 23141 23140 21315 21316 -4 23142 23141 21316 21317 -4 23143 23142 21317 21318 -4 23144 23143 21318 21319 -4 23145 23144 21319 21320 -4 23146 23145 21320 21321 -4 23147 23146 21321 21322 -4 23148 23147 21322 21323 -4 23149 23148 21323 21324 -4 23150 23149 21324 21325 -4 23151 23150 21325 21326 -4 23152 23151 21326 21327 -4 24918 24917 23092 23093 -4 24919 24918 23093 23094 -4 24920 24919 23094 23095 -4 24921 24920 23095 23096 -4 24922 24921 23096 23097 -4 24923 24922 23097 23098 -4 24924 24923 23098 23099 -4 24925 24924 23099 23100 -4 24926 24925 23100 23101 -4 24927 24926 23101 23102 -4 24928 24927 23102 23103 -4 24929 24928 23103 23104 -4 24930 24929 23104 23105 -4 24931 24930 23105 23106 -4 24932 24931 23106 23107 -4 24933 24932 23107 23108 -4 24934 24933 23108 23109 -4 24935 24934 23109 23110 -4 24936 24935 23110 23111 -4 24937 24936 23111 23112 -4 24938 24937 23112 23113 -4 24939 24938 23113 23114 -4 24940 24939 23114 23115 -4 24941 24940 23115 23116 -4 24942 24941 23116 23117 -4 24943 24942 23117 23118 -4 24944 24943 23118 23119 -4 24945 24944 23119 23120 -4 24946 24945 23120 23121 -4 24947 24946 23121 23122 -4 24948 24947 23122 23123 -4 24949 24948 23123 23124 -4 24950 24949 23124 23125 -4 24951 24950 23125 23126 -4 24952 24951 23126 23127 -4 24953 24952 23127 23128 -4 24954 24953 23128 23129 -4 24955 24954 23129 23130 -4 24956 24955 23130 23131 -4 24957 24956 23131 23132 -4 24958 24957 23132 23133 -4 24959 24958 23133 23134 -4 24960 24959 23134 23135 -4 24961 24960 23135 23136 -4 24962 24961 23136 23137 -4 24963 24962 23137 23138 -4 24964 24963 23138 23139 -4 24965 24964 23139 23140 -4 24966 24965 23140 23141 -4 24967 24966 23141 23142 -4 24968 24967 23142 23143 -4 24969 24968 23143 23144 -4 24970 24969 23144 23145 -4 24971 24970 23145 23146 -4 24972 24971 23146 23147 -4 24973 24972 23147 23148 -4 24974 24973 23148 23149 -4 24975 24974 23149 23150 -4 24976 24975 23150 23151 -4 24977 24976 23151 23152 -4 26743 26742 24917 24918 -4 26744 26743 24918 24919 -4 26745 26744 24919 24920 -4 26746 26745 24920 24921 -4 26747 26746 24921 24922 -4 26748 26747 24922 24923 -4 26749 26748 24923 24924 -4 26750 26749 24924 24925 -4 26751 26750 24925 24926 -4 26752 26751 24926 24927 -4 26753 26752 24927 24928 -4 26754 26753 24928 24929 -4 26755 26754 24929 24930 -4 26756 26755 24930 24931 -4 26757 26756 24931 24932 -4 26758 26757 24932 24933 -4 26759 26758 24933 24934 -4 26760 26759 24934 24935 -4 26761 26760 24935 24936 -4 26762 26761 24936 24937 -4 26763 26762 24937 24938 -4 26764 26763 24938 24939 -4 26765 26764 24939 24940 -4 26766 26765 24940 24941 -4 26767 26766 24941 24942 -4 26768 26767 24942 24943 -4 26769 26768 24943 24944 -4 26770 26769 24944 24945 -4 26771 26770 24945 24946 -4 26772 26771 24946 24947 -4 26773 26772 24947 24948 -4 26774 26773 24948 24949 -4 26775 26774 24949 24950 -4 26776 26775 24950 24951 -4 26777 26776 24951 24952 -4 26778 26777 24952 24953 -4 26779 26778 24953 24954 -4 26780 26779 24954 24955 -4 26781 26780 24955 24956 -4 26782 26781 24956 24957 -4 26783 26782 24957 24958 -4 26784 26783 24958 24959 -4 26785 26784 24959 24960 -4 26786 26785 24960 24961 -4 26787 26786 24961 24962 -4 26788 26787 24962 24963 -4 26789 26788 24963 24964 -4 26790 26789 24964 24965 -4 26791 26790 24965 24966 -4 26792 26791 24966 24967 -4 26793 26792 24967 24968 -4 26794 26793 24968 24969 -4 26795 26794 24969 24970 -4 26796 26795 24970 24971 -4 26797 26796 24971 24972 -4 26798 26797 24972 24973 -4 26799 26798 24973 24974 -4 26800 26799 24974 24975 -4 26801 26800 24975 24976 -4 26802 26801 24976 24977 -4 28568 28567 26742 26743 -4 28569 28568 26743 26744 -4 28570 28569 26744 26745 -4 28571 28570 26745 26746 -4 28572 28571 26746 26747 -4 28573 28572 26747 26748 -4 28574 28573 26748 26749 -4 28575 28574 26749 26750 -4 28576 28575 26750 26751 -4 28577 28576 26751 26752 -4 28578 28577 26752 26753 -4 28579 28578 26753 26754 -4 28580 28579 26754 26755 -4 28581 28580 26755 26756 -4 28582 28581 26756 26757 -4 28583 28582 26757 26758 -4 28584 28583 26758 26759 -4 28585 28584 26759 26760 -4 28586 28585 26760 26761 -4 28587 28586 26761 26762 -4 28588 28587 26762 26763 -4 28589 28588 26763 26764 -4 28590 28589 26764 26765 -4 28591 28590 26765 26766 -4 28592 28591 26766 26767 -4 28593 28592 26767 26768 -4 28594 28593 26768 26769 -4 28595 28594 26769 26770 -4 28596 28595 26770 26771 -4 28597 28596 26771 26772 -4 28598 28597 26772 26773 -4 28599 28598 26773 26774 -4 28600 28599 26774 26775 -4 28601 28600 26775 26776 -4 28602 28601 26776 26777 -4 28603 28602 26777 26778 -4 28604 28603 26778 26779 -4 28605 28604 26779 26780 -4 28606 28605 26780 26781 -4 28607 28606 26781 26782 -4 28608 28607 26782 26783 -4 28609 28608 26783 26784 -4 28610 28609 26784 26785 -4 28611 28610 26785 26786 -4 28612 28611 26786 26787 -4 28613 28612 26787 26788 -4 28614 28613 26788 26789 -4 28615 28614 26789 26790 -4 28616 28615 26790 26791 -4 28617 28616 26791 26792 -4 28618 28617 26792 26793 -4 28619 28618 26793 26794 -4 28620 28619 26794 26795 -4 28621 28620 26795 26796 -4 28622 28621 26796 26797 -4 28623 28622 26797 26798 -4 28624 28623 26798 26799 -4 28625 28624 26799 26800 -4 28626 28625 26800 26801 -4 28627 28626 26801 26802 -4 30393 30392 28567 28568 -4 30394 30393 28568 28569 -4 30395 30394 28569 28570 -4 30396 30395 28570 28571 -4 30397 30396 28571 28572 -4 30398 30397 28572 28573 -4 30399 30398 28573 28574 -4 30400 30399 28574 28575 -4 30401 30400 28575 28576 -4 30402 30401 28576 28577 -4 30403 30402 28577 28578 -4 30404 30403 28578 28579 -4 30405 30404 28579 28580 -4 30406 30405 28580 28581 -4 30407 30406 28581 28582 -4 30408 30407 28582 28583 -4 30409 30408 28583 28584 -4 30410 30409 28584 28585 -4 30411 30410 28585 28586 -4 30412 30411 28586 28587 -4 30413 30412 28587 28588 -4 30414 30413 28588 28589 -4 30415 30414 28589 28590 -4 30416 30415 28590 28591 -4 30417 30416 28591 28592 -4 30418 30417 28592 28593 -4 30419 30418 28593 28594 -4 30420 30419 28594 28595 -4 30421 30420 28595 28596 -4 30422 30421 28596 28597 -4 30423 30422 28597 28598 -4 30424 30423 28598 28599 -4 30425 30424 28599 28600 -4 30426 30425 28600 28601 -4 30427 30426 28601 28602 -4 30428 30427 28602 28603 -4 30429 30428 28603 28604 -4 30430 30429 28604 28605 -4 30431 30430 28605 28606 -4 30432 30431 28606 28607 -4 30433 30432 28607 28608 -4 30434 30433 28608 28609 -4 30435 30434 28609 28610 -4 30436 30435 28610 28611 -4 30437 30436 28611 28612 -4 30438 30437 28612 28613 -4 30439 30438 28613 28614 -4 30440 30439 28614 28615 -4 30441 30440 28615 28616 -4 30442 30441 28616 28617 -4 30443 30442 28617 28618 -4 30444 30443 28618 28619 -4 30445 30444 28619 28620 -4 30446 30445 28620 28621 -4 30447 30446 28621 28622 -4 30448 30447 28622 28623 -4 30449 30448 28623 28624 -4 30450 30449 28624 28625 -4 30451 30450 28625 28626 -4 30452 30451 28626 28627 -4 32218 32217 30392 30393 -4 32219 32218 30393 30394 -4 32220 32219 30394 30395 -4 32221 32220 30395 30396 -4 32222 32221 30396 30397 -4 32223 32222 30397 30398 -4 32224 32223 30398 30399 -4 32225 32224 30399 30400 -4 32226 32225 30400 30401 -4 32227 32226 30401 30402 -4 32228 32227 30402 30403 -4 32229 32228 30403 30404 -4 32230 32229 30404 30405 -4 32231 32230 30405 30406 -4 32232 32231 30406 30407 -4 32233 32232 30407 30408 -4 32234 32233 30408 30409 -4 32235 32234 30409 30410 -4 32236 32235 30410 30411 -4 32237 32236 30411 30412 -4 32238 32237 30412 30413 -4 32239 32238 30413 30414 -4 32240 32239 30414 30415 -4 32241 32240 30415 30416 -4 32242 32241 30416 30417 -4 32243 32242 30417 30418 -4 32244 32243 30418 30419 -4 32245 32244 30419 30420 -4 32246 32245 30420 30421 -4 32247 32246 30421 30422 -4 32248 32247 30422 30423 -4 32249 32248 30423 30424 -4 32250 32249 30424 30425 -4 32251 32250 30425 30426 -4 32252 32251 30426 30427 -4 32253 32252 30427 30428 -4 32254 32253 30428 30429 -4 32255 32254 30429 30430 -4 32256 32255 30430 30431 -4 32257 32256 30431 30432 -4 32258 32257 30432 30433 -4 32259 32258 30433 30434 -4 32260 32259 30434 30435 -4 32261 32260 30435 30436 -4 32262 32261 30436 30437 -4 32263 32262 30437 30438 -4 32264 32263 30438 30439 -4 32265 32264 30439 30440 -4 32266 32265 30440 30441 -4 32267 32266 30441 30442 -4 32268 32267 30442 30443 -4 32269 32268 30443 30444 -4 32270 32269 30444 30445 -4 32271 32270 30445 30446 -4 32272 32271 30446 30447 -4 32273 32272 30447 30448 -4 32274 32273 30448 30449 -4 32275 32274 30449 30450 -4 32276 32275 30450 30451 -4 32277 32276 30451 30452 -4 34043 34042 32217 32218 -4 34044 34043 32218 32219 -4 34045 34044 32219 32220 -4 34046 34045 32220 32221 -4 34047 34046 32221 32222 -4 34048 34047 32222 32223 -4 34049 34048 32223 32224 -4 34050 34049 32224 32225 -4 34051 34050 32225 32226 -4 34052 34051 32226 32227 -4 34053 34052 32227 32228 -4 34054 34053 32228 32229 -4 34055 34054 32229 32230 -4 34056 34055 32230 32231 -4 34057 34056 32231 32232 -4 34058 34057 32232 32233 -4 34059 34058 32233 32234 -4 34060 34059 32234 32235 -4 34061 34060 32235 32236 -4 34062 34061 32236 32237 -4 34063 34062 32237 32238 -4 34064 34063 32238 32239 -4 34065 34064 32239 32240 -4 34066 34065 32240 32241 -4 34067 34066 32241 32242 -4 34068 34067 32242 32243 -4 34069 34068 32243 32244 -4 34070 34069 32244 32245 -4 34071 34070 32245 32246 -4 34072 34071 32246 32247 -4 34073 34072 32247 32248 -4 34074 34073 32248 32249 -4 34075 34074 32249 32250 -4 34076 34075 32250 32251 -4 34077 34076 32251 32252 -4 34078 34077 32252 32253 -4 34079 34078 32253 32254 -4 34080 34079 32254 32255 -4 34081 34080 32255 32256 -4 34082 34081 32256 32257 -4 34083 34082 32257 32258 -4 34084 34083 32258 32259 -4 34085 34084 32259 32260 -4 34086 34085 32260 32261 -4 34087 34086 32261 32262 -4 34088 34087 32262 32263 -4 34089 34088 32263 32264 -4 34090 34089 32264 32265 -4 34091 34090 32265 32266 -4 34092 34091 32266 32267 -4 34093 34092 32267 32268 -4 34094 34093 32268 32269 -4 34095 34094 32269 32270 -4 34096 34095 32270 32271 -4 34097 34096 32271 32272 -4 34098 34097 32272 32273 -4 34099 34098 32273 32274 -4 34100 34099 32274 32275 -4 34101 34100 32275 32276 -4 34102 34101 32276 32277 -4 35868 35867 34042 34043 -4 35869 35868 34043 34044 -4 35870 35869 34044 34045 -4 35871 35870 34045 34046 -4 35872 35871 34046 34047 -4 35873 35872 34047 34048 -4 35874 35873 34048 34049 -4 35875 35874 34049 34050 -4 35876 35875 34050 34051 -4 35877 35876 34051 34052 -4 35878 35877 34052 34053 -4 35879 35878 34053 34054 -4 35880 35879 34054 34055 -4 35881 35880 34055 34056 -4 35882 35881 34056 34057 -4 35883 35882 34057 34058 -4 35884 35883 34058 34059 -4 35885 35884 34059 34060 -4 35886 35885 34060 34061 -4 35887 35886 34061 34062 -4 35888 35887 34062 34063 -4 35889 35888 34063 34064 -4 35890 35889 34064 34065 -4 35891 35890 34065 34066 -4 35892 35891 34066 34067 -4 35893 35892 34067 34068 -4 35894 35893 34068 34069 -4 35895 35894 34069 34070 -4 35896 35895 34070 34071 -4 35897 35896 34071 34072 -4 35898 35897 34072 34073 -4 35899 35898 34073 34074 -4 35900 35899 34074 34075 -4 35901 35900 34075 34076 -4 35902 35901 34076 34077 -4 35903 35902 34077 34078 -4 35904 35903 34078 34079 -4 35905 35904 34079 34080 -4 35906 35905 34080 34081 -4 35907 35906 34081 34082 -4 35908 35907 34082 34083 -4 35909 35908 34083 34084 -4 35910 35909 34084 34085 -4 35911 35910 34085 34086 -4 35912 35911 34086 34087 -4 35913 35912 34087 34088 -4 35914 35913 34088 34089 -4 35915 35914 34089 34090 -4 35916 35915 34090 34091 -4 35917 35916 34091 34092 -4 35918 35917 34092 34093 -4 35919 35918 34093 34094 -4 35920 35919 34094 34095 -4 35921 35920 34095 34096 -4 35922 35921 34096 34097 -4 35923 35922 34097 34098 -4 35924 35923 34098 34099 -4 35925 35924 34099 34100 -4 35926 35925 34100 34101 -4 35927 35926 34101 34102 -4 37693 37692 35867 35868 -4 37694 37693 35868 35869 -4 37695 37694 35869 35870 -4 37696 37695 35870 35871 -4 37697 37696 35871 35872 -4 37698 37697 35872 35873 -4 37699 37698 35873 35874 -4 37700 37699 35874 35875 -4 37701 37700 35875 35876 -4 37702 37701 35876 35877 -4 37703 37702 35877 35878 -4 37704 37703 35878 35879 -4 37705 37704 35879 35880 -4 37706 37705 35880 35881 -4 37707 37706 35881 35882 -4 37708 37707 35882 35883 -4 37709 37708 35883 35884 -4 37710 37709 35884 35885 -4 37711 37710 35885 35886 -4 37712 37711 35886 35887 -4 37713 37712 35887 35888 -4 37714 37713 35888 35889 -4 37715 37714 35889 35890 -4 37716 37715 35890 35891 -4 37717 37716 35891 35892 -4 37718 37717 35892 35893 -4 37719 37718 35893 35894 -4 37720 37719 35894 35895 -4 37721 37720 35895 35896 -4 37722 37721 35896 35897 -4 37723 37722 35897 35898 -4 37724 37723 35898 35899 -4 37725 37724 35899 35900 -4 37726 37725 35900 35901 -4 37727 37726 35901 35902 -4 37728 37727 35902 35903 -4 37729 37728 35903 35904 -4 37730 37729 35904 35905 -4 37731 37730 35905 35906 -4 37732 37731 35906 35907 -4 37733 37732 35907 35908 -4 37734 37733 35908 35909 -4 37735 37734 35909 35910 -4 37736 37735 35910 35911 -4 37737 37736 35911 35912 -4 37738 37737 35912 35913 -4 37739 37738 35913 35914 -4 37740 37739 35914 35915 -4 37741 37740 35915 35916 -4 37742 37741 35916 35917 -4 37743 37742 35917 35918 -4 37744 37743 35918 35919 -4 37745 37744 35919 35920 -4 37746 37745 35920 35921 -4 37747 37746 35921 35922 -4 37748 37747 35922 35923 -4 37749 37748 35923 35924 -4 37750 37749 35924 35925 -4 37751 37750 35925 35926 -4 37752 37751 35926 35927 -4 39518 39517 37692 37693 -4 39519 39518 37693 37694 -4 39520 39519 37694 37695 -4 39521 39520 37695 37696 -4 39522 39521 37696 37697 -4 39523 39522 37697 37698 -4 39524 39523 37698 37699 -4 39525 39524 37699 37700 -4 39526 39525 37700 37701 -4 39527 39526 37701 37702 -4 39528 39527 37702 37703 -4 39529 39528 37703 37704 -4 39530 39529 37704 37705 -4 39531 39530 37705 37706 -4 39532 39531 37706 37707 -4 39533 39532 37707 37708 -4 39534 39533 37708 37709 -4 39535 39534 37709 37710 -4 39536 39535 37710 37711 -4 39537 39536 37711 37712 -4 39538 39537 37712 37713 -4 39539 39538 37713 37714 -4 39540 39539 37714 37715 -4 39541 39540 37715 37716 -4 39542 39541 37716 37717 -4 39543 39542 37717 37718 -4 39544 39543 37718 37719 -4 39545 39544 37719 37720 -4 39546 39545 37720 37721 -4 39547 39546 37721 37722 -4 39548 39547 37722 37723 -4 39549 39548 37723 37724 -4 39550 39549 37724 37725 -4 39551 39550 37725 37726 -4 39552 39551 37726 37727 -4 39553 39552 37727 37728 -4 39554 39553 37728 37729 -4 39555 39554 37729 37730 -4 39556 39555 37730 37731 -4 39557 39556 37731 37732 -4 39558 39557 37732 37733 -4 39559 39558 37733 37734 -4 39560 39559 37734 37735 -4 39561 39560 37735 37736 -4 39562 39561 37736 37737 -4 39563 39562 37737 37738 -4 39564 39563 37738 37739 -4 39565 39564 37739 37740 -4 39566 39565 37740 37741 -4 39567 39566 37741 37742 -4 39568 39567 37742 37743 -4 39569 39568 37743 37744 -4 39570 39569 37744 37745 -4 39571 39570 37745 37746 -4 39572 39571 37746 37747 -4 39573 39572 37747 37748 -4 39574 39573 37748 37749 -4 39575 39574 37749 37750 -4 39576 39575 37750 37751 -4 39577 39576 37751 37752 -4 41343 41342 39517 39518 -4 41344 41343 39518 39519 -4 41345 41344 39519 39520 -4 41346 41345 39520 39521 -4 41347 41346 39521 39522 -4 41348 41347 39522 39523 -4 41349 41348 39523 39524 -4 41350 41349 39524 39525 -4 41351 41350 39525 39526 -4 41352 41351 39526 39527 -4 41353 41352 39527 39528 -4 41354 41353 39528 39529 -4 41355 41354 39529 39530 -4 41356 41355 39530 39531 -4 41357 41356 39531 39532 -4 41358 41357 39532 39533 -4 41359 41358 39533 39534 -4 41360 41359 39534 39535 -4 41361 41360 39535 39536 -4 41362 41361 39536 39537 -4 41363 41362 39537 39538 -4 41364 41363 39538 39539 -4 41365 41364 39539 39540 -4 41366 41365 39540 39541 -4 41367 41366 39541 39542 -4 41368 41367 39542 39543 -4 41369 41368 39543 39544 -4 41370 41369 39544 39545 -4 41371 41370 39545 39546 -4 41372 41371 39546 39547 -4 41373 41372 39547 39548 -4 41374 41373 39548 39549 -4 41375 41374 39549 39550 -4 41376 41375 39550 39551 -4 41377 41376 39551 39552 -4 41378 41377 39552 39553 -4 41379 41378 39553 39554 -4 41380 41379 39554 39555 -4 41381 41380 39555 39556 -4 41382 41381 39556 39557 -4 41383 41382 39557 39558 -4 41384 41383 39558 39559 -4 41385 41384 39559 39560 -4 41386 41385 39560 39561 -4 41387 41386 39561 39562 -4 41388 41387 39562 39563 -4 41389 41388 39563 39564 -4 41390 41389 39564 39565 -4 41391 41390 39565 39566 -4 41392 41391 39566 39567 -4 41393 41392 39567 39568 -4 41394 41393 39568 39569 -4 41395 41394 39569 39570 -4 41396 41395 39570 39571 -4 41397 41396 39571 39572 -4 41398 41397 39572 39573 -4 41399 41398 39573 39574 -4 41400 41399 39574 39575 -4 41401 41400 39575 39576 -4 41402 41401 39576 39577 -4 43168 41343 41342 43167 -4 43169 41344 41343 43168 -4 43170 41345 41344 43169 -4 43171 41346 41345 43170 -4 43172 41347 41346 43171 -4 43173 41348 41347 43172 -4 43174 41349 41348 43173 -4 43175 41350 41349 43174 -4 43176 41351 41350 43175 -4 43177 43176 41351 41352 -4 43178 43177 41352 41353 -4 43179 43178 41353 41354 -4 43180 43179 41354 41355 -4 43181 43180 41355 41356 -4 43182 43181 41356 41357 -4 43183 43182 41357 41358 -4 43184 43183 41358 41359 -4 43185 43184 41359 41360 -4 43186 43185 41360 41361 -4 43187 43186 41361 41362 -4 43188 43187 41362 41363 -4 43189 43188 41363 41364 -4 43190 43189 41364 41365 -4 43191 43190 41365 41366 -4 43192 43191 41366 41367 -4 43193 43192 41367 41368 -4 43194 43193 41368 41369 -4 43195 43194 41369 41370 -4 43196 43195 41370 41371 -4 43197 43196 41371 41372 -4 43198 43197 41372 41373 -4 43199 43198 41373 41374 -4 43200 43199 41374 41375 -4 43201 43200 41375 41376 -4 43202 43201 41376 41377 -4 43203 43202 41377 41378 -4 43204 43203 41378 41379 -4 43205 41380 41379 43204 -4 43206 41381 41380 43205 -4 43207 41382 41381 43206 -4 43208 41383 41382 43207 -4 43209 41384 41383 43208 -4 43210 41385 41384 43209 -4 43211 41386 41385 43210 -4 43212 41387 41386 43211 -4 43213 41388 41387 43212 -4 43214 41389 41388 43213 -4 43215 41390 41389 43214 -4 43216 41391 41390 43215 -4 43217 43216 41391 41392 -4 43218 43217 41392 41393 -4 43219 43218 41393 41394 -4 43220 43219 41394 41395 -4 43221 43220 41395 41396 -4 43222 43221 41396 41397 -4 43223 43222 41397 41398 -4 43224 43223 41398 41399 -4 43225 43224 41399 41400 -4 43226 43225 41400 41401 -4 43227 43226 41401 41402 -4 44993 43168 43167 44992 -4 44994 43169 43168 44993 -4 44995 43170 43169 44994 -4 44996 43171 43170 44995 -4 44997 43172 43171 44996 -4 44998 43173 43172 44997 -4 44999 43174 43173 44998 -4 45000 43175 43174 44999 -4 45001 43176 43175 45000 -4 45002 43177 43176 45001 -4 45003 43178 43177 45002 -4 45004 43179 43178 45003 -4 45005 43180 43179 45004 -4 45006 43181 43180 45005 -4 45007 43182 43181 45006 -4 45008 43183 43182 45007 -4 45007 43184 43183 45008 -4 45006 45007 43184 43185 -4 45005 45006 43185 43186 -4 45004 45005 43186 43187 -4 45003 45004 43187 43188 -4 45002 45003 43188 43189 -4 45001 45002 43189 43190 -4 45000 45001 43190 43191 -4 44999 45000 43191 43192 -4 44998 44999 43192 43193 -4 44997 44998 43193 43194 -4 44996 44997 43194 43195 -4 44995 44996 43195 43196 -4 44994 44995 43196 43197 -4 44993 44994 43197 43198 -4 44992 44993 43198 43199 -4 45009 44992 43199 43200 -4 45010 45009 43200 43201 -4 45011 45010 43201 43202 -4 45012 45011 43202 43203 -4 45013 45012 43203 43204 -4 45014 43205 43204 45013 -4 45015 43206 43205 45014 -4 45016 43207 43206 45015 -4 45017 43208 43207 45016 -4 45018 43209 43208 45017 -4 45019 43210 43209 45018 -4 45020 43211 43210 45019 -4 45021 43212 43211 45020 -4 45022 43213 43212 45021 -4 45023 43214 43213 45022 -4 45024 43215 43214 45023 -4 45025 43216 43215 45024 -4 45026 43217 43216 45025 -4 45027 43218 43217 45026 -4 45028 43219 43218 45027 -4 45029 43220 43219 45028 -4 45030 43221 43220 45029 -4 45031 43222 43221 45030 -4 45032 43223 43222 45031 -4 45033 43224 43223 45032 -4 45034 43225 43224 45033 -4 45035 43226 43225 45034 -4 45036 43227 43226 45035 -CELL_TYPES 1408 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -9 -POINT_DATA 46417 -SCALARS Pressure_Coefficient float 1 -LOOKUP_TABLE default -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -SCALARS |Skin_Friction_Coefficient| float 1 -LOOKUP_TABLE default -0.0335459111706149 -0.0335678055171776 -0.0335590338145995 -0.0335465798044954 -0.0335260699516724 -0.0334991147240953 -0.0334893183511938 -0.0334532966884132 -0.0334250773625082 -0.0334074934843625 -0.0333888087027207 -0.0333698942423975 -0.0333621490496438 -0.0333665021823076 -0.033362434892888 -0.0333594191803281 -0.0333735561490624 -0.0333780827924229 -0.0333899363074895 -0.0334012900217038 -0.0334133592998128 -0.0334255347317556 -0.0334327688954802 -0.0334397855197794 -0.0334493149802641 -0.0334567580827626 -0.0334724051602121 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.033146566594278 -0.0332057968349999 -0.0332024169026486 -0.0331384082615562 -0.0330411020429036 -0.0329076303368986 -0.0327871100040511 -0.0326491702517328 -0.0325246189335933 -0.0324173697400149 -0.0323314302804481 -0.0322581077827243 -0.032200133779918 -0.0321508848421026 -0.0321262587012147 -0.0321022037296666 -0.0320985360701917 -0.0321053188245224 -0.032118554742291 -0.0321417991762558 -0.0321732673045276 -0.0322093280366278 -0.0322457027721747 -0.0322920233149022 -0.0323469070999646 -0.0324121750230376 -0.0324879886240789 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0333029605563588 -0.0333681436338262 -0.0333598192558212 -0.03329466532115 -0.0331882085775321 -0.0330417361901831 -0.0329001107932416 -0.0327502309792755 -0.0326088292023393 -0.0324819297658194 -0.0323729907195026 -0.0322823073317372 -0.03221616020233 -0.0321492371214598 -0.0321140048757811 -0.0320831615958612 -0.032076167314015 -0.0320781971348306 -0.0320924487371151 -0.0321152528437783 -0.0321503253518288 -0.0321883097053675 -0.0322295052966816 -0.0322853817300478 -0.0323465644928004 -0.0324284300373873 -0.0325164945789941 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0334370007266664 -0.0335337855953611 -0.0335207893663262 -0.0334684032100036 -0.0333721378751807 -0.0332453429174047 -0.0331088572216034 -0.0329640429716464 -0.0328289469732344 -0.0326922215912302 -0.0325803861927835 -0.0324750371116373 -0.0324033958643997 -0.0323373529231889 -0.0322834115899083 -0.0322488772684063 -0.032222503513871 -0.0322260228056916 -0.0322311399635648 -0.0322501299677246 -0.0322808610490227 -0.0323184053144136 -0.0323625160538084 -0.0324214985417838 -0.0324871719402379 -0.0325660708414549 -0.03266040264976 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0335318191444339 -0.0336153643580819 -0.0336319769048336 -0.0335804371564061 -0.0334970759367771 -0.0333811548857514 -0.0332628381548864 -0.0331239023721637 -0.0329983030428319 -0.0328562591303976 -0.032745458938149 -0.0326372138645686 -0.0325568132736245 -0.0324755270273051 -0.0324249492024181 -0.0323862615411212 -0.0323577603308546 -0.0323434804840805 -0.0323511793022662 -0.0323725907239466 -0.0323938753440731 -0.0324324604420232 -0.0324798271033817 -0.0325367879860075 -0.0326059557399073 -0.0326934345930025 -0.0327969167873299 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0336041292299588 -0.0336762059993964 -0.0337018650856827 -0.0336615203670852 -0.0335888374423168 -0.033489159786547 -0.0333717773351852 -0.0332502881113461 -0.0331123172283781 -0.03297506547973 -0.032868937358218 -0.032762994379836 -0.0326776666692339 -0.0326087526630318 -0.0325465761779026 -0.0325040137597775 -0.0324722311631971 -0.0324649442952703 -0.0324690255694745 -0.032478937146803 -0.032500471440779 -0.0325363445326403 -0.0325857373726697 -0.0326436641791861 -0.0327167842294548 -0.0328024001908014 -0.0329098513647938 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0336605750472916 -0.0337340003540983 -0.0337504033879759 -0.0337255407478812 -0.033650502837519 -0.0335581347057986 -0.0334479025677181 -0.0333263015717779 -0.0331963587762054 -0.0330757317618337 -0.0329641303147925 -0.0328647442982921 -0.0327767088235698 -0.0327054933132202 -0.0326416896257324 -0.0326040405214836 -0.0325656538806335 -0.0325532645708459 -0.0325624243011762 -0.0325717727330069 -0.0325938599261358 -0.0326253155633535 -0.0326718500655183 -0.0327287307243627 -0.0327990203756927 -0.0328840409299066 -0.0329871896819132 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0337068111883745 -0.0337529658613639 -0.0337892924418551 -0.0337705759750886 -0.0336998219350225 -0.0336228854588012 -0.0335184306257731 -0.0333933395882585 -0.0332549771854295 -0.0331413615195651 -0.0330293882449406 -0.0329314022323606 -0.0328417335860702 -0.0327702266129535 -0.0327131336417817 -0.0326775940429351 -0.0326479903408615 -0.0326313252973106 -0.0326349564400184 -0.0326434787075581 -0.0326642002993685 -0.0326932521269207 -0.0327313261845518 -0.0327844313843871 -0.0328533531937416 -0.0329369196407941 -0.0330350562965471 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0337488414945599 -0.0337971191304089 -0.0338237762913668 -0.0338046536043626 -0.0337344948943494 -0.0336457777958544 -0.0335493233329388 -0.033419311688132 -0.0333020293982779 -0.0331950362253491 -0.0330735948344832 -0.0329793084367457 -0.0328913949549437 -0.0328323147451831 -0.0327808771484557 -0.0327325925547818 -0.0327091609269968 -0.0326954409193587 -0.0326948056830305 -0.0327040515615023 -0.0327284236088667 -0.032754548495734 -0.0327895525302574 -0.0328326467901207 -0.0328963546310342 -0.0329707187492721 -0.0330621193678445 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0337892134522672 -0.0338461533618528 -0.0338584825522701 -0.0338321783411376 -0.0337583828280444 -0.0336682220778442 -0.0335613443745959 -0.0334433878543909 -0.0333352079519801 -0.0332174829833895 -0.0331095099035947 -0.0330186327979162 -0.0329414253629308 -0.0328752573243385 -0.0328290914700691 -0.0327857435186166 -0.0327654376888237 -0.0327561578768679 -0.0327598869800552 -0.0327629340663957 -0.0327835189275698 -0.032814433588039 -0.0328480167730314 -0.0328893502446991 -0.032942801238027 -0.0330110396876121 -0.0330883738719198 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0338430773487118 -0.0338684785645876 -0.0338709366971144 -0.0338414422748578 -0.0337753223845305 -0.0336834383836475 -0.0335764412324101 -0.0334562882314007 -0.0333428578625173 -0.033237227918267 -0.0331402582375199 -0.0330479485022969 -0.0329781183232608 -0.0329262945466232 -0.0328794102851469 -0.032846373933195 -0.0328349128535538 -0.0328325854050727 -0.0328306895253612 -0.0328427858752291 -0.0328591625771206 -0.0328890974792772 -0.0329204570255413 -0.0329590884795786 -0.0330072567725488 -0.0330695754266845 -0.0331354695097981 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.033856914153744 -0.0338907552961495 -0.0338917983233442 -0.0338606216260357 -0.0337889546969344 -0.0336957141678141 -0.033596410281874 -0.033475217216065 -0.033355035863467 -0.0332573335020464 -0.0331715789481046 -0.0330898853268228 -0.0330343160643271 -0.032987830701711 -0.032942611962334 -0.0329201269271013 -0.0329184822265103 -0.0329155090168643 -0.0329258892025674 -0.032943519374251 -0.0329612017211005 -0.0329923060686261 -0.0330241986884135 -0.0330641261286644 -0.0331101098413481 -0.0331606210786815 -0.0332224091452959 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0338991722949892 -0.0339258578581225 -0.0339218008415118 -0.0338804254608098 -0.0338001104902405 -0.0337017567490143 -0.0335931380927903 -0.0334779866658101 -0.0333706516196626 -0.0332844608603935 -0.0331993836682827 -0.0331356847956867 -0.033085894510362 -0.033054183952035 -0.0330229394242142 -0.0330181964723238 -0.0330194016362694 -0.0330276219292974 -0.0330506613283774 -0.0330762450063119 -0.0331017315991272 -0.0331325519694758 -0.0331689298242261 -0.0332019821708822 -0.0332428879710551 -0.0332938999343416 -0.0333498034454894 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0339319868760703 -0.0339394878939949 -0.0339472281491607 -0.0338852970451587 -0.0338014534889572 -0.0336956036352764 -0.0335825342663948 -0.0334788375426161 -0.0333836564298023 -0.0333040933123758 -0.0332344744060629 -0.0331902219249831 -0.0331603793354028 -0.033149603251584 -0.0331468550995718 -0.0331527115829733 -0.0331728205608232 -0.0332014273874971 -0.0332414105177573 -0.0332835477527747 -0.0333275919603964 -0.0333621770820683 -0.0333968283890394 -0.0334298682270019 -0.0334657362427831 -0.0335000352066467 -0.0335429553053507 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0339398322914869 -0.0339579915624834 -0.0339484919758536 -0.0339003951318119 -0.033832542138635 -0.03373262616984 -0.0336444317823221 -0.0335770158128715 -0.0335488878259327 -0.0335392079917939 -0.0335529283985962 -0.0336087933484393 -0.0336837589885512 -0.0337508010789895 -0.0338140739633008 -0.0338812073140116 -0.0339473879234468 -0.0340002314822201 -0.0340837584034905 -0.0341504198450659 -0.034191513467633 -0.0342459301878039 -0.0267862020919271 -0.0150510718082648 -0.0151723280311434 -0.0154024660938104 -0.0157386240505721 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0295214427449083 -0.0379882465677554 -0.0377318852535292 -0.0374134524275205 -0.0370909123431351 -0.0368080581367615 -0.0365153584320607 -0.0362581630837257 -0.0360205873314962 -0.0357849490758666 -0.0355588361899231 -0.0354565698288841 -0.0349796801821459 -0.0352646465449004 -0.0347975116944101 -0.0352340738771109 -0.0352306261878855 -0.035103192256031 -0.0354340128293945 -0.0359101257426772 -0.035652788336137 -0.0358018877625006 -0.0256161279849461 -0.00588231892219138 -1.14001335048986e-16 -1.46460253531517e-16 -8.89337138421309e-17 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0334902109365439 -0.0335041663725448 -0.033526491494125 -0.0335392018866714 -0.0335506139632932 -0.0335564537797731 -0.0335643970912508 -0.0335747779788974 -0.0336109439155711 -0.0336329157414235 -0.0333543151403565 -0.0323029408649302 -0.0302675719127236 -0.0274026903488717 -0.0239446681681095 -0.0205423438220803 -0.0194263880462979 -0.0222373348660255 -0.0262437619932982 -0.029612715094397 -0.0320826292174711 -0.033616756830602 -0.0342408488746103 -0.0342761521849012 -0.0341511687714873 -0.0340527796972311 -0.0339834205393824 -0.0339200534106184 -0.0338633505956411 -0.0338061543028138 -0.0337526049423405 -0.033693468515111 -0.0336454293701753 -0.0335945094342224 -0.0335451258915427 -0.033502053266638 -0.033454323950529 -0.0334066633984231 -0.0333571723409615 -0.0333025883084879 -0.0332497135517817 -0.0332008396119231 -0.033156075595295 -0.0331239044256061 -0.0330874543230526 -0.0330725146632714 -0.0330618254221126 -0.0330444774928396 -0.0330393353310263 -0.0330443538285414 -0.0330476387432702 -0.0330481691761974 -0.0330581453843225 -0.033077583430634 -0.0330704802673365 -0.0330829629737122 -0.0330927400681459 -0.0330974062161219 -0.0330985583826326 -0.0330674598928798 -0.000648539139974175 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0325751137338313 -0.0326857086912623 -0.0328005174259471 -0.0329207890870407 -0.0330569594499366 -0.0332025548268744 -0.0333587851375046 -0.0335284622680743 -0.0337148943259643 -0.0338964030532427 -0.033835928701765 -0.0329960620891342 -0.0310174178768354 -0.0280227315641217 -0.0242790768624494 -0.0205596182584707 -0.0189819225848343 -0.0222551140687841 -0.0266093810756558 -0.0302809473222538 -0.0328770509100445 -0.0343379710390313 -0.0347352207760935 -0.0345446545802416 -0.0342567733001873 -0.0340057911633783 -0.0337752315507868 -0.0335623127335192 -0.0333650890510748 -0.0331828150385849 -0.0330217319819825 -0.0328705076248775 -0.0327265405638503 -0.0326066061864699 -0.0324977830596062 -0.0323979072149519 -0.0323060628485964 -0.0322205242765519 -0.0321434530671152 -0.0320666071245281 -0.0319959376786682 -0.0319366572386998 -0.0318917754521776 -0.0318584202355505 -0.0318404864129386 -0.0318470780077555 -0.0318573057910614 -0.0318935241208686 -0.0319385581404411 -0.03199788027563 -0.0320681766166074 -0.0321576782260916 -0.0322617900956279 -0.0323861719486006 -0.0324868038388236 -0.0326043981634927 -0.032690083921647 -0.0327456872729321 -0.0327416046469089 -0.0326738049920146 -0.000633175674139263 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0326106845272389 -0.0327363716036192 -0.032871208889804 -0.0330344402619135 -0.0332111300652432 -0.0333996643173885 -0.0336253768005541 -0.0338578348824291 -0.0341440940450636 -0.0344664357548016 -0.0346750296791158 -0.0341964005075562 -0.0324847926785442 -0.0295093067189955 -0.0255757023357003 -0.0214440472933331 -0.0190991171749388 -0.0232123974490602 -0.0280306382576755 -0.0318889990914823 -0.0344326475468338 -0.0355871473201154 -0.035596637784013 -0.035125595176184 -0.0346928732492494 -0.0343398562900163 -0.0340451531146955 -0.0337615584991505 -0.0335206991368032 -0.0332973718044059 -0.0330929008089716 -0.0329218393071263 -0.032765068357942 -0.0326355401340157 -0.0325140813397576 -0.0323975642688011 -0.03229954325324 -0.0322048524854763 -0.0321226706761019 -0.032043751822498 -0.0319695111104956 -0.0319106981343731 -0.0318648331808453 -0.0318362181561253 -0.0318215984468605 -0.0318349298935495 -0.0318556728798794 -0.0319093972058872 -0.0319625169975692 -0.0320390110759323 -0.032132040714986 -0.0322412131381773 -0.0323636447382251 -0.0324952444370529 -0.0326188223924357 -0.0327495590818974 -0.0328442548073886 -0.032901039314502 -0.0329017110015071 -0.0328279688113508 -0.000636589908056837 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0327693290042715 -0.0329087241818685 -0.0330762149456275 -0.0332627685431366 -0.0334764745490529 -0.0337121299678641 -0.0339913873779865 -0.0343026258036236 -0.0346933417121833 -0.0352219463033673 -0.0357694515172817 -0.0357151758586319 -0.0342409226573134 -0.0312247101796082 -0.0271327952951502 -0.0225082043163546 -0.0192510115396809 -0.0243642349687744 -0.0297372668496306 -0.033743090674705 -0.0362942053774881 -0.0371677196334997 -0.0367201620115002 -0.0358955564122058 -0.0352509498345251 -0.034790982052422 -0.0344158801226093 -0.0340779486248212 -0.0337888336111502 -0.0335281923917748 -0.0332994443606298 -0.0330949242625867 -0.0329221967590436 -0.0327797802456386 -0.0326520865234088 -0.0325383936945293 -0.0324361141473745 -0.0323409293536499 -0.0322533204361221 -0.0321738870836357 -0.0321037757916054 -0.0320486036825959 -0.0320116752831084 -0.031981459856066 -0.0319859636988077 -0.0320028648892009 -0.0320421899792163 -0.0320953327316501 -0.0321534632919592 -0.0322442676794561 -0.0323400680138148 -0.0324589478746702 -0.032575228475642 -0.0327010307237417 -0.0328196950712646 -0.0329311893129065 -0.0330163066418343 -0.0330608237419247 -0.0330651735965588 -0.0329600982029368 -0.000639625167351437 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0329236518115578 -0.0330784363192079 -0.0332542449427799 -0.0334676745977348 -0.0337056130817322 -0.0339978231143239 -0.0343286849406857 -0.0347150927720875 -0.03522536032732 -0.0359424683830232 -0.0368207483346014 -0.0370888869711401 -0.0356975078218575 -0.0324372953721482 -0.0279926968803892 -0.0229205642908401 -0.0191783814961326 -0.0248105393103262 -0.0306797198619696 -0.0350535026825541 -0.0378381693818401 -0.0385973209303528 -0.0377994132166461 -0.0366298602988529 -0.0357915194024955 -0.0352093220520471 -0.0347578613476444 -0.0343702131241796 -0.0340211217336955 -0.0337390459554611 -0.0334791696936017 -0.0332658873624655 -0.0330800851572037 -0.0329174618049341 -0.0327798763791202 -0.0326573648031868 -0.0325510716375472 -0.0324550358948282 -0.032366336448869 -0.0322864938087854 -0.032225680563123 -0.0321679626133348 -0.0321284715412292 -0.0321161836377072 -0.0321223498957903 -0.0321431725544232 -0.0321794827558005 -0.0322503843786909 -0.0323144354724361 -0.032407727579788 -0.0325027082676174 -0.0326264930342879 -0.0327332023514981 -0.032853115102961 -0.0329537694275631 -0.033054893072398 -0.0331302941211442 -0.0331711930654604 -0.0331456486901071 -0.0330535661411562 -0.000640677748008049 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0330454369862495 -0.0331986470014897 -0.0333915770363113 -0.0336138792460487 -0.0338766852169555 -0.0341822464445081 -0.0345498202613212 -0.0349879344122525 -0.0355503959246559 -0.0363721809926143 -0.0374394442523359 -0.0378838941081759 -0.0363595140092887 -0.0327819168684285 -0.0279511733753597 -0.0227552586246412 -0.0192441287147624 -0.0246315891211298 -0.0306342222181706 -0.0354259782150746 -0.0385399361370866 -0.0394246869786233 -0.0384345641534076 -0.0370677998670544 -0.0361217805339843 -0.0354860485630746 -0.0349813066266728 -0.0345532400078415 -0.0341928144871447 -0.0338821879893334 -0.0336169532098662 -0.0333863709395419 -0.0331996132458578 -0.0330329108434525 -0.0328894190112653 -0.0327683686506703 -0.0326578572112565 -0.032560318086053 -0.0324698713224156 -0.0323927361598722 -0.0323315433295112 -0.0322851401579657 -0.0322495113863623 -0.032232886356486 -0.032239534845917 -0.0322637405116425 -0.0323111235616544 -0.0323670548781703 -0.0324385814292875 -0.0325302178554708 -0.0326226081644335 -0.0327395306459745 -0.0328580930121882 -0.0329607072845058 -0.0330603862769479 -0.0331450354578702 -0.0332067654954013 -0.0332385918580857 -0.0332054783199612 -0.0331248369481623 -0.0006413348385902 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0331178125050017 -0.0332743918483898 -0.0334697833738089 -0.0336856113980761 -0.033952094613726 -0.0342664519592359 -0.0346235245146981 -0.0350436929790712 -0.0356012665064284 -0.0364190290686626 -0.0374814505335217 -0.0379011109018498 -0.0363056045043759 -0.0324464959034103 -0.027372905948161 -0.0222048842193818 -0.0201746344946826 -0.024035737583653 -0.030000451534596 -0.0350635334820073 -0.0384828391629142 -0.039442624743537 -0.038477699632277 -0.0371155562637438 -0.0361734743709892 -0.0355426028490287 -0.0350557695924895 -0.0346377443579835 -0.0342685742591959 -0.0339537311306466 -0.0336955165927703 -0.0334623975432063 -0.0332714254073801 -0.0331079641900625 -0.0329709985900198 -0.0328507349493865 -0.0327430027933714 -0.0326465784163309 -0.0325591328724013 -0.0324858482489182 -0.0324239559930661 -0.0323780078301183 -0.0323368715855232 -0.0323225890634404 -0.0323383652395241 -0.0323580247236586 -0.0324068456994802 -0.0324646042394225 -0.0325391807111082 -0.0326241484803315 -0.0327198635944008 -0.0328223211816422 -0.032933205356978 -0.0330358908853695 -0.0331284732522851 -0.0332057367174077 -0.033269294267528 -0.0332862431384337 -0.0332624469282233 -0.0331804775230453 -0.000643075294572533 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0331628019638184 -0.0333084208436239 -0.0334908748140287 -0.0337052290797912 -0.0339618905322407 -0.0342405484858701 -0.0345628334496271 -0.0349375585901254 -0.035438466052814 -0.0361811329299015 -0.0371064657617763 -0.0373201898339915 -0.0354999284621112 -0.0315348289729141 -0.0263246882695336 -0.0217169440016572 -0.0223150613136899 -0.02350731443796 -0.0288529518330603 -0.0340840755806831 -0.0376302146840752 -0.0388381163571354 -0.0380927616554477 -0.0368731123045186 -0.0360080573951101 -0.0354349578322098 -0.0349943216753998 -0.0346115628529816 -0.0342784627555545 -0.0339735040660843 -0.0337167501062073 -0.0334966197083876 -0.0333165051545435 -0.0331555673544397 -0.033023916320096 -0.0329051532035914 -0.0327988604487027 -0.0327068062401168 -0.0326265782512192 -0.0325559215907231 -0.0324953369930674 -0.0324501296466202 -0.0324142790579555 -0.0324037612639541 -0.032411123791168 -0.0324286106388372 -0.0324709272948483 -0.0325290126800437 -0.0326052998318332 -0.0326891193852631 -0.0327844940228024 -0.0328803004468949 -0.0329999778266749 -0.0331056915918883 -0.0331924006912442 -0.0332544114744779 -0.0333138198440627 -0.0333253512524995 -0.0332812526085664 -0.033226060909962 -0.000644876802202055 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0331772117296111 -0.0333169546455191 -0.033474502928357 -0.0336671587032064 -0.0339023107399808 -0.0341518053225178 -0.0344461955345268 -0.0347640833722419 -0.0351652621214011 -0.035766340623621 -0.0364531416437954 -0.0363581880062004 -0.0344122663860205 -0.0303730699514375 -0.0252506305579602 -0.0212101669179748 -0.0250328573373253 -0.0229586417252498 -0.0276799208522803 -0.0328631496927787 -0.0364813692537037 -0.0378370088522586 -0.0374220914076118 -0.0364505468191945 -0.0357310308190413 -0.0352591465572782 -0.0348762265280696 -0.0345218586558566 -0.0342183291110536 -0.0339351319208938 -0.0337002686646042 -0.0335052013375621 -0.0333309824426415 -0.0331827299988804 -0.0330578050604737 -0.0329482229884174 -0.0328469689548955 -0.0327641031216277 -0.0326875872019799 -0.0326199193509898 -0.0325556338686528 -0.0325096391839946 -0.0324779671651445 -0.0324644729987534 -0.0324654750179815 -0.0324941519478423 -0.0325322354974355 -0.032578200864081 -0.0326531238060924 -0.0327360724547883 -0.0328380103981306 -0.0329272357102549 -0.0330290685679949 -0.0331366571057243 -0.0332150015422185 -0.0332886304513881 -0.0333473529506388 -0.0333586354056531 -0.0333246974758503 -0.0332674947412877 -0.000646252226434286 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0331956044973874 -0.0333193272405956 -0.0334627826473952 -0.0336186243165014 -0.0338161492404487 -0.0340351505471132 -0.0342833347494395 -0.0345410423238308 -0.0348574249025224 -0.0353188623533177 -0.0357570838642966 -0.0353594124765112 -0.0331961296363597 -0.0292333083054917 -0.0243278571733189 -0.0209935825301838 -0.027725129365497 -0.0227243312605082 -0.0266642727138122 -0.0315970440750452 -0.0351883354918027 -0.0367976254978648 -0.0367075439034506 -0.0359950231055469 -0.0354219229122026 -0.0350333594278897 -0.0347113328880783 -0.0344039383444101 -0.0341313638023196 -0.0338862121519034 -0.0336884699041396 -0.0335075870860696 -0.0333494597037225 -0.0332090800052174 -0.0330982325416849 -0.0329947425845709 -0.0329036506185638 -0.0328223679955067 -0.0327473190288807 -0.0326748322673494 -0.0326142499569358 -0.0325743200680913 -0.0325381357894333 -0.0325202898921679 -0.0325183803131144 -0.0325435059987858 -0.0325749876947006 -0.032627758428151 -0.0326916902392199 -0.0327685138810475 -0.0328598244391907 -0.0329596529141625 -0.0330495404109168 -0.0331481098011265 -0.0332371668395417 -0.0333122072622257 -0.033374480252825 -0.0333927414137089 -0.0333730192037029 -0.0333072975232063 -0.000647125287953526 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.033224659062065 -0.0333283836521967 -0.0334608364570607 -0.0336041719912897 -0.0337601937186333 -0.0339419083276285 -0.0341516801430445 -0.0343640646408335 -0.0346058987198897 -0.0349340657029864 -0.0351762524459239 -0.034490014137376 -0.0321604563189356 -0.0283429729338136 -0.0237727799580238 -0.0211186749473006 -0.0304786803950803 -0.0228593739362117 -0.0260526982878237 -0.0306284230609284 -0.0340891173623006 -0.0358929015712165 -0.0361112794408907 -0.035602383692705 -0.0351627785071672 -0.0348537304578485 -0.0345790067270181 -0.0343099068577259 -0.0340748896790404 -0.0338716471066357 -0.0336865105252955 -0.0335166957461281 -0.0333786505475116 -0.0332563487123936 -0.033156923538203 -0.0330593002647943 -0.0329734195346284 -0.0328947516711903 -0.0328218380630716 -0.0327502353679196 -0.0326937348783005 -0.0326446006778085 -0.0326130275782745 -0.0325890982997246 -0.0325785839665204 -0.0325936803291298 -0.0326256315267942 -0.0326640962140864 -0.0327205710385736 -0.0327983600648375 -0.0328791993344823 -0.0329670608221997 -0.0330616617436452 -0.0331628506691442 -0.0332521769395314 -0.0333289113270477 -0.0333836053415147 -0.033405011231114 -0.0333950223223453 -0.0333603787893006 -0.000647662357604529 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0332964082743945 -0.0333846466767407 -0.0334983259358383 -0.0336089363862024 -0.0337457874649099 -0.0338843939426526 -0.0340514713793846 -0.0342339742535131 -0.0344229707034573 -0.0346538540818056 -0.0347213029551359 -0.0338507684947153 -0.0314316635058738 -0.0277448936219988 -0.0234798104060175 -0.0214230418619215 -0.0324343691363371 -0.0231888875736743 -0.0257312108255044 -0.0299799598774586 -0.0333163372684098 -0.0352276873049256 -0.0356442447656106 -0.0353166293660165 -0.0349762533225086 -0.0347225625332898 -0.0344840745323425 -0.0342525210229192 -0.0340603499851962 -0.0338764502023134 -0.0337242542816339 -0.0335732767416744 -0.0334506088697651 -0.0333431261469051 -0.0332480925145805 -0.0331623161060629 -0.0330785027418432 -0.0329984118041414 -0.0329248586896045 -0.0328519660890055 -0.0327939937156802 -0.0327393675821641 -0.0326963750421136 -0.0326721730208554 -0.0326517344287604 -0.0326563326607871 -0.0326866062736081 -0.0327197583229463 -0.0327620919976836 -0.0328293570504039 -0.0328990867770698 -0.0329791023410588 -0.0330803690242465 -0.0331825722830274 -0.0332642925642933 -0.0333423623790901 -0.0334025259633066 -0.033425586494636 -0.0334169857138219 -0.0333740169100241 -0.00064837537881498 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0334116252342087 -0.0334897807590643 -0.0335776399862338 -0.0336744955962972 -0.0337898185322342 -0.0339017680974302 -0.0340236923528009 -0.0341666193034694 -0.0343175524193758 -0.0344819796848864 -0.0343760525164752 -0.0333802486659058 -0.0309345521283474 -0.0273290419135896 -0.0234067053778532 -0.0217355869011352 -0.0340159588410177 -0.0235271866953862 -0.0256545021104906 -0.0295444356401534 -0.0327925081278344 -0.0347380314298697 -0.0352898321298629 -0.0351414770205603 -0.0348691370737444 -0.0346533825520732 -0.0344496462379936 -0.0342693859185935 -0.0341047912711641 -0.0339425310073856 -0.033804104067492 -0.0336790058034341 -0.0335659215660912 -0.0334676391191591 -0.0333813067742664 -0.0332953036094306 -0.0332164190856391 -0.0331430298436458 -0.0330647926553395 -0.0329919863440577 -0.032926011802992 -0.0328628967016531 -0.0328072415875662 -0.0327718118634436 -0.0327488877467286 -0.0327359613915947 -0.0327523522395209 -0.0327708458324847 -0.03280743802333 -0.0328568746972635 -0.0329259219171506 -0.0329945400499737 -0.0330831044577018 -0.0331793412642248 -0.0332702575709703 -0.03335337052299 -0.0334220622213688 -0.0334551742477548 -0.0334515985527415 -0.0334156727973698 -0.000648895506845003 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0335901246571542 -0.0336522223012953 -0.0337231770672008 -0.0337952811485854 -0.0338821231963257 -0.0339624942513959 -0.0340532033106174 -0.0341552167449018 -0.0342810610059523 -0.0343959719252496 -0.0342035195575476 -0.0330997112954255 -0.0307082902058372 -0.0271262284296771 -0.0234555127712914 -0.0219185689497813 -0.0346858242227706 -0.0237253754754027 -0.0257203831023732 -0.0294067882871398 -0.032562465075828 -0.03444608414399 -0.0351127272208811 -0.035053827301869 -0.0348320551557498 -0.0346414858396165 -0.034478336501048 -0.0343305024136499 -0.0341979569154475 -0.0340642784382762 -0.0339506230321006 -0.0338423651183908 -0.0337456511038571 -0.0336646062675839 -0.0335880077820301 -0.0335184145144008 -0.0334444041709728 -0.0333707506420172 -0.0332938519091699 -0.0332167450549512 -0.0331318722827763 -0.0330488623238637 -0.0329757831502509 -0.0329204004059785 -0.0328818857603851 -0.0328587993430267 -0.0328468997203947 -0.0328446217664175 -0.0328614338175472 -0.0328916036564378 -0.0329453436891958 -0.0330073987121432 -0.0330839436454802 -0.0331688673271875 -0.033264186497171 -0.0333546683068929 -0.0334267587965532 -0.0334802234893045 -0.0334650367815148 -0.0334480193817068 -0.000648906754641713 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0161561404678629 -0.0166725307750971 -0.0172563298321229 -0.0178317674977526 -0.0183554693305789 -0.0187305868027165 -0.0189301145383593 -0.01902783510299 -0.0191117867032257 -0.0262496624870245 -0.0343200740863768 -0.0330390284938389 -0.0305572888706981 -0.0271165591836969 -0.0235004178204628 -0.0221357277795003 -0.0354489595244784 -0.0239605726149014 -0.0257600893054916 -0.0293184639227375 -0.0323931267258386 -0.0343828632303322 -0.0352323484735581 -0.035374657823134 -0.0353050280903447 -0.0352189310359735 -0.0351128545861097 -0.0350359235821327 -0.0349480849442844 -0.0348456553410919 -0.0347741893346552 -0.0346781737233455 -0.0346096471507676 -0.0345770148756334 -0.0344996772427773 -0.0344185947128549 -0.034319637819215 -0.0266626218878024 -0.0152095251033135 -0.0154599944428295 -0.0158313320635035 -0.0162900309639107 -0.0168090521583844 -0.0173570592232711 -0.0178357811003897 -0.0181775399792969 -0.0183582807397612 -0.0184185653183247 -0.0184346154673012 -0.0256094324426701 -0.0331779262121323 -0.0331707666491009 -0.0331809629270637 -0.0332300045172264 -0.0333007357320767 -0.0333852525559657 -0.0334408555730399 -0.0334812222693114 -0.0334832458022687 -0.0334557564530124 -0.000649141694037324 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -9.63587254890155e-17 -5.88460180475972e-17 -1.46654563779251e-16 -2.21003538141883e-16 -2.323772802066e-16 -3.18920155809917e-17 -1.07377549585732e-16 -1.45403824748644e-16 -4.90590946124033e-17 -0.00728847764271084 -0.00854460302076674 -0.00679250605863781 -0.00548241628540754 -0.00878848139145259 -0.018096778244474 -0.00686213874439409 -0.0195880455124259 -0.0221412637588211 -0.0271549161431967 -0.0305586679970819 -0.0333250838552583 -0.035373294545926 -0.0363581519232028 -0.0365792412054856 -0.0365045995777324 -0.0365717497852077 -0.0359497845886921 -0.0356806563564567 -0.0359170716045017 -0.0354338838960178 -0.0355828012878431 -0.0358647507386254 -0.0358687249397364 -0.0365844446053282 -0.0361841963020983 -0.0359329629625624 -0.0353648528365536 -0.00614000389608794 -4.81766488584501e-17 -9.50049565445509e-17 -5.33429884164797e-17 -1.38399488001625e-17 -7.28595543344423e-17 -1.71228758652398e-16 -1.50242678984267e-16 -1.57522124924834e-16 -1.39335081175922e-16 -1.17030693239251e-16 -1.67222681202927e-16 -0.00779537251328066 -0.0141253065312393 -0.0144583485718913 -0.0148398650942955 -0.0152900183076992 -0.0158302326109607 -0.0164514916646285 -0.0171623124675991 -0.0178975081551846 -0.0184746922949545 -0.0184922751622846 -0.000909799847588748 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0.0100672745862324 -0.0110635604299863 -0.0110543347672817 -0.0114492280651523 -0.0124473668694271 -0.0125604318950945 -0.0129198735172637 -0.0148587527161009 -0.0159593094304321 -0.0164483312558586 -0.0172619504220599 -0.0182091977169874 -0.0183657553859129 -0.0191273552218307 -0.0178861422895836 -0.0104657946598834 -3.02630033541996e-18 -0.00991162625181136 -0.0100286924904939 -0.00962664614296426 -0.0337572470936356 -0.0328759365785469 -0.0101413163774927 -0.0104205174737122 -0.0107629913337287 -0.0108085142453836 -0.0116961691537404 -0.012548020573678 -0.0134104999852698 -0.0139773850886476 -0.0158028314332005 -0.0168940956605254 -0.0194735161629021 -0.0213769528506595 -0.0247082373451399 -0.027819792051951 -0.0310413648420219 -0.0345178410655399 -0.0381712025348336 -0.0413837529478692 -0.0457459573626872 -0.0506545772039872 -0.0562843994627458 -0.030613547012381 -2.14384446360665e-16 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 -0 diff --git a/SU2_CFD/include/CMarkerProfileReaderFVM.hpp b/SU2_CFD/include/CMarkerProfileReaderFVM.hpp index d44929296e4..f28a0f0b8a0 100644 --- a/SU2_CFD/include/CMarkerProfileReaderFVM.hpp +++ b/SU2_CFD/include/CMarkerProfileReaderFVM.hpp @@ -3,7 +3,7 @@ * \brief Header file for the class CMarkerProfileReaderFVM. * The implementations are in the CMarkerProfileReaderFVM.cpp file. * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -71,6 +71,8 @@ class CMarkerProfileReaderFVM { vector numberOfRowsInProfile; /*!< \brief Auxiliary structure for holding the number of rows for a particular marker in a profile file. */ vector numberOfColumnsInProfile; /*!< \brief Auxiliary structure for holding the number of columns for a particular marker in a profile file. */ + vector totalColumnNames; /*!< \brief Names of the columns for the profile, one for each inlet marker. */ + vector totalColumnValues; /*!< \brief Initial values for the profile, constructed from MARKER_INLET. */ vector > profileData; /*!< \brief Auxiliary structure for holding the data values from a profile file. */ vector > > profileCoords; /*!< \brief Data structure for holding the merged inlet boundary coordinates from all ranks. */ diff --git a/SU2_CFD/include/SU2_CFD.hpp b/SU2_CFD/include/SU2_CFD.hpp index c23920bb9e4..77d13f58dd7 100644 --- a/SU2_CFD/include/SU2_CFD.hpp +++ b/SU2_CFD/include/SU2_CFD.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines of the code SU2_CFD. * The subroutines and functions are in the SU2_CFD.cpp file. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/definition_structure.hpp b/SU2_CFD/include/definition_structure.hpp index 0b21e892130..bf826f6338e 100644 --- a/SU2_CFD/include/definition_structure.hpp +++ b/SU2_CFD/include/definition_structure.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines used by SU2_CFD. * The subroutines and functions are in the definition_structure.cpp file. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp b/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp index 7e417e70349..eeac90dcc11 100644 --- a/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp +++ b/SU2_CFD/include/drivers/CDiscAdjMultizoneDriver.hpp @@ -2,7 +2,7 @@ * \class CDiscAdjMultizoneDriver.hpp * \brief Class for driving adjoint multi-zone problems. * \author O. Burghardt, P. Gomes, T. Albring, R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -141,8 +141,6 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver { */ void StartSolver() override; -protected: - /*! * \brief Preprocess the multizone iteration */ @@ -153,6 +151,8 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver { */ void Run() override; +protected: + /*! * \brief Run one inner iteration for a given zone. * \return The result of "monitor". @@ -211,7 +211,7 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver { /*! * \brief Initialize the adjoint value of the objective function. */ - void SetAdj_ObjFunction(); + void SetAdjObjFunction(); /*! * \brief Summary of all routines to evaluate the adjoints in iZone. @@ -236,31 +236,31 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver { * \brief Add Solution vector to External. * \param[in] iZone - Zone index. */ - void Add_Solution_To_External(unsigned short iZone); + void AddSolutionToExternal(unsigned short iZone); /*! * \brief Puts dual time derivative vector to External. */ - void Set_External_To_DualTimeDer(); + void SetExternalToDualTimeDer(); /*! * \brief Add External_Old vector to Solution. * \param[in] iZone - Zone index. */ - void Add_External_To_Solution(unsigned short iZone); + void AddExternalToSolution(unsigned short iZone); /*! * \brief Puts Solution into SolutionOld. * \param[in] iZone - Zone index. */ - void Set_SolutionOld_To_Solution(unsigned short iZone); + void SetSolutionOldToSolution(unsigned short iZone); /*! * \brief Extract contribution of iZone to jZone with BGS relaxation. * \param[in] iZone - Source zone (the one that was initialized). * \param[in] jZone - Target zone (the one that transfers to iZone in the primal problem). */ - void Update_Cross_Term(unsigned short iZone, unsigned short jZone); + void UpdateCrossTerm(unsigned short iZone, unsigned short jZone); /*! * \brief Compute BGS residuals. @@ -272,7 +272,7 @@ class CDiscAdjMultizoneDriver : public CMultizoneDriver { * \brief gets Convergence on physical time scale, (deactivated in adjoint case) * \return false */ - inline bool GetTimeConvergence() const override {return false;} + inline bool GetTimeConvergence() const override { return false; } /*! * \brief Get the external of all adjoint solvers in a zone. diff --git a/SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp b/SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp index 8b0960565a4..d30fc5ac9d2 100644 --- a/SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp +++ b/SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for driving single or multi-zone problems. * The subroutines and functions are in the driver_structure.cpp file. * \author T. Economon, H. Kline, R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \ingroup DiscAdj * \brief Class for driving single-zone adjoint solvers. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CDiscAdjSinglezoneDriver : public CSinglezoneDriver { protected: @@ -55,42 +55,6 @@ class CDiscAdjSinglezoneDriver : public CSinglezoneDriver { COutput *direct_output; CNumerics ***numerics; /*!< \brief Container vector with all the numerics. */ - COutputLegacy* output_legacy; - -public: - - /*! - * \brief Constructor of the class. - * \param[in] confFile - Configuration file name. - * \param[in] val_nZone - Total number of zones. - * \param[in] val_nDim - Total number of dimensions. - * \param[in] MPICommunicator - MPI communicator for SU2. - */ - CDiscAdjSinglezoneDriver(char* confFile, - unsigned short val_nZone, - SU2_Comm MPICommunicator); - - /*! - * \brief Destructor of the class. - */ - ~CDiscAdjSinglezoneDriver(void) override; - - /*! - * \brief Preprocess the single-zone iteration - * \param[in] TimeIter - index of the current time-step. - */ - void Preprocess(unsigned long TimeIter) override; - - /*! - * \brief Run a single iteration of the discrete adjoint solver with a single zone. - */ - void Run(void) override; - - /*! - * \brief Postprocess the adjoint iteration for ZONE_0. - */ - void Postprocess(void) override; - /*! * \brief Record one iteration of a flow iteration in within multiple zones. * \param[in] kind_recording - Type of recording (full list in ENUM_RECORDING, option_structure.hpp) @@ -111,7 +75,7 @@ class CDiscAdjSinglezoneDriver : public CSinglezoneDriver { /*! * \brief Initialize the adjoint value of the objective function. */ - void SetAdj_ObjFunction(void); + void SetAdjObjFunction(void); /*! * \brief Record the main computational path. @@ -127,6 +91,39 @@ class CDiscAdjSinglezoneDriver : public CSinglezoneDriver { * \brief gets Convergence on physical time scale, (deactivated in adjoint case) * \return false */ - inline bool GetTimeConvergence() const override {return false;}; + inline bool GetTimeConvergence() const override { return false; } + +public: + + /*! + * \brief Constructor of the class. + * \param[in] confFile - Configuration file name. + * \param[in] val_nZone - Total number of zones. + * \param[in] val_nDim - Total number of dimensions. + * \param[in] MPICommunicator - MPI communicator for SU2. + */ + CDiscAdjSinglezoneDriver(char* confFile, + unsigned short val_nZone, + SU2_Comm MPICommunicator); + + /*! + * \brief Destructor of the class. + */ + ~CDiscAdjSinglezoneDriver(void) override; + /*! + * \brief Preprocess the single-zone iteration + * \param[in] TimeIter - index of the current time-step. + */ + void Preprocess(unsigned long TimeIter) override; + + /*! + * \brief Run a single iteration of the discrete adjoint solver with a single zone. + */ + void Run(void) override; + + /*! + * \brief Postprocess the adjoint iteration for ZONE_0. + */ + void Postprocess(void) override; }; diff --git a/SU2_CFD/include/drivers/CDriver.hpp b/SU2_CFD/include/drivers/CDriver.hpp index 5481a8e9a97..5ac33896849 100644 --- a/SU2_CFD/include/drivers/CDriver.hpp +++ b/SU2_CFD/include/drivers/CDriver.hpp @@ -1,9 +1,9 @@ -/*! - * \file driver_structure.hpp +/*! + * \file CDriver.hpp * \brief Headers of the main subroutines for driving single or multi-zone problems. * The subroutines and functions are in the driver_structure.cpp file. * \author T. Economon, H. Kline, R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -28,17 +28,15 @@ #pragma once +#include "../../../Common/include/geometry/CGeometry.hpp" #include "../../../Common/include/parallelization/mpi_structure.hpp" - #include "../integration/CIntegration.hpp" -#include "../solvers/CSolver.hpp" #include "../interfaces/CInterface.hpp" - -#include "../../../Common/include/geometry/CGeometry.hpp" +#include "../solvers/CSolver.hpp" +#include "CDriverBase.hpp" using namespace std; -class COutputLegacy; class CInterpolator; class CIteration; class COutput; @@ -49,259 +47,287 @@ class COutput; * \brief Parent class for driving an iteration of a single or multi-zone problem. * \author T. Economon */ -class CDriver { -protected: - int rank, /*!< \brief MPI Rank. */ - size; /*!< \brief MPI Size. */ - char* config_file_name; /*!< \brief Configuration file name of the problem.*/ - char runtime_file_name[MAX_STRING_SIZE]; - su2double StartTime, /*!< \brief Start point of the timer for performance benchmarking.*/ - StopTime, /*!< \brief Stop point of the timer for performance benchmarking.*/ - UsedTimePreproc, /*!< \brief Elapsed time between Start and Stop point of the timer for tracking preprocessing phase.*/ - UsedTimeCompute, /*!< \brief Elapsed time between Start and Stop point of the timer for tracking compute phase.*/ - UsedTimeOutput, /*!< \brief Elapsed time between Start and Stop point of the timer for tracking output phase.*/ - UsedTime; /*!< \brief Elapsed time between Start and Stop point of the timer.*/ - su2double BandwidthSum = 0.0; /*!< \brief Aggregate value of the bandwidth for writing restarts (to be average later).*/ - unsigned long IterCount, /*!< \brief Iteration count stored for performance benchmarking.*/ - OutputCount; /*!< \brief Output count stored for performance benchmarking.*/ - unsigned long DOFsPerPoint; /*!< \brief Number of unknowns at each vertex, i.e., number of equations solved. */ - su2double Mpoints; /*!< \brief Total number of grid points in millions in the calculation (including ghost points).*/ - su2double MpointsDomain; /*!< \brief Total number of grid points in millions in the calculation (excluding ghost points).*/ - su2double MDOFs; /*!< \brief Total number of DOFs in millions in the calculation (including ghost points).*/ - su2double MDOFsDomain; /*!< \brief Total number of DOFs in millions in the calculation (excluding ghost points).*/ - unsigned long TimeIter; /*!< \brief External iteration.*/ - ofstream **ConvHist_file; /*!< \brief Convergence history file.*/ - ofstream FSIHist_file; /*!< \brief FSI convergence history file.*/ - unsigned short iMesh, /*!< \brief Iterator on mesh levels.*/ - iZone, /*!< \brief Iterator on zones.*/ - nZone, /*!< \brief Total number of zones in the problem. */ - nDim, /*!< \brief Number of dimensions.*/ - iInst, /*!< \brief Iterator on instance levels.*/ - *nInst, /*!< \brief Total number of instances in the problem (per zone). */ - **interface_types; /*!< \brief Type of coupling between the distinct (physical) zones.*/ - bool StopCalc, /*!< \brief Stop computation flag.*/ - mixingplane, /*!< \brief mixing-plane simulation flag.*/ - fsi, /*!< \brief FSI simulation flag.*/ - fem_solver; /*!< \brief FEM fluid solver simulation flag. */ - CIteration ***iteration_container; /*!< \brief Container vector with all the iteration methods. */ - COutput **output_container; /*!< \brief Pointer to the COutput class. */ - CIntegration ****integration_container; /*!< \brief Container vector with all the integration methods. */ - CGeometry ****geometry_container; /*!< \brief Geometrical definition of the problem. */ - CSolver *****solver_container; /*!< \brief Container vector with all the solutions. */ - CNumerics ******numerics_container; /*!< \brief Description of the numerical method (the way in which the equations are solved). */ - CConfig **config_container; /*!< \brief Definition of the particular problem. */ - CConfig *driver_config; /*!< \brief Definition of the driver configuration. */ - COutput *driver_output; /*!< \brief Definition of the driver output. */ - CSurfaceMovement **surface_movement; /*!< \brief Surface movement classes of the problem. */ - CVolumetricMovement ***grid_movement; /*!< \brief Volume grid movement classes of the problem. */ - CFreeFormDefBox*** FFDBox; /*!< \brief FFD FFDBoxes of the problem. */ - vector > > - interpolator_container; /*!< \brief Definition of the interpolation method between non-matching discretizations of the interface. */ - CInterface ***interface_container; /*!< \brief Definition of the interface of information and physics. */ - bool dry_run; /*!< \brief Flag if SU2_CFD was started as dry-run via "SU2_CFD -d .cfg" */ - -public: +class CDriver : public CDriverBase { + protected: + su2double + UsedTimeOutput; /*!< \brief Elapsed time between Start and Stop point of the timer for tracking output phase.*/ + + su2double BandwidthSum = + 0.0; /*!< \brief Aggregate value of the bandwidth for writing restarts (to be average later).*/ + unsigned long IterCount, /*!< \brief Iteration count stored for performance benchmarking.*/ + OutputCount; /*!< \brief Output count stored for performance benchmarking.*/ + unsigned long DOFsPerPoint; /*!< \brief Number of unknowns at each vertex, i.e., number of equations solved. */ + su2double Mpoints; /*!< \brief Total number of grid points in millions in the calculation (including ghost points).*/ + su2double + MpointsDomain; /*!< \brief Total number of grid points in millions in the calculation (excluding ghost points).*/ + su2double MDOFs; /*!< \brief Total number of DOFs in millions in the calculation (including ghost points).*/ + su2double MDOFsDomain; /*!< \brief Total number of DOFs in millions in the calculation (excluding ghost points).*/ + + bool StopCalc, /*!< \brief Stop computation flag.*/ + mixingplane, /*!< \brief mixing-plane simulation flag.*/ + fsi, /*!< \brief FSI simulation flag.*/ + fem_solver; /*!< \brief FEM fluid solver simulation flag. */ + + CFreeFormDefBox*** FFDBox; /*!< \brief FFD FFDBoxes of the problem. */ + + CIteration*** iteration_container; /*!< \brief Container vector with all the iteration methods. */ + CIntegration**** integration_container; /*!< \brief Container vector with all the integration methods. */ + vector>> + interpolator_container; /*!< \brief Definition of the interpolation method between non-matching discretizations of + the interface. */ + CInterface*** interface_container; /*!< \brief Definition of the interface of information and physics. */ + bool dry_run; /*!< \brief Flag if SU2_CFD was started as dry-run via "SU2_CFD -d .cfg" */ + + public: /*! * \brief Constructor of the class. * \param[in] confFile - Configuration file name. * \param[in] val_nZone - Total number of zones. - * \param[in] val_nDim - Number of dimensions. * \param[in] MPICommunicator - MPI communicator for SU2. + * \param[in] dummy_geo - Dummy geometric definition of the problem. */ - CDriver(char* confFile, - unsigned short val_nZone, - SU2_Comm MPICommunicator, bool dummy_geo); + CDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator, bool dummy_geo); /*! * \brief Destructor of the class. */ - virtual ~CDriver(void); + ~CDriver(void) override; /*! * \brief A virtual member. */ - virtual void Run() { }; - -protected: + void Run() override{}; + protected: /*! - * \brief Init_Containers + * \brief Initialize containers. */ - void SetContainers_Null(); + void InitializeContainers(); /*! * \brief Read in the config and mesh files. + * \param[in] config - Definition of the particular problem. + * \param[in] driver_config - Definition of the driver configuration. */ - void Input_Preprocessing(CConfig **&config, CConfig *&driver_config); + void PreprocessInput(CConfig**& config, CConfig*& driver_config); /*! - * \brief Construction of the edge-based data structure and the multigrid structure. + * \brief Construction of the edge-based data structure and the multi-grid structure. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] dummy - Definition of the dummy driver. */ - void Geometrical_Preprocessing(CConfig *config, CGeometry **&geometry, bool dummy); + void InitializeGeometry(CConfig* config, CGeometry**& geometry, bool dummy); /*! * \brief Do the geometrical preprocessing for the DG FEM solver. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. */ - void Geometrical_Preprocessing_DGFEM(CConfig *config, CGeometry **&geometry); + void InitializeGeometryDGFEM(CConfig* config, CGeometry**& geometry); /*! - * \brief Geometrical_Preprocessing_FVM + * \brief InitializeGeometryFVM + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. */ - void Geometrical_Preprocessing_FVM(CConfig *config, CGeometry **&geometry); + void InitializeGeometryFVM(CConfig* config, CGeometry**& geometry); /*! * \brief Definition of the physics iteration class or within a single zone. - * \param[in] iteration_container - Pointer to the iteration container to be instantiated. * \param[in] config - Definition of the particular problem. - * \param[in] iZone - Index of the zone. + * \param[in] iteration - Pointer to the iteration container to be instantiated. */ - void Iteration_Preprocessing(CConfig *config, CIteration *&iteration) const; + void PreprocessIteration(CConfig* config, CIteration*& iteration) const; /*! * \brief Definition and allocation of all solution classes. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - Container vector with all the solutions. + */ + void InitializeSolver(CConfig* config, CGeometry** geometry, CSolver***& solver); + + /*! + * \brief Preprocess the inlets via file input for all solvers. * \param[in] solver_container - Container vector with all the solutions. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void Solver_Preprocessing(CConfig *config, CGeometry **geometry, CSolver ***&solver); + void PreprocessInlet(CSolver*** solver, CGeometry** geometry, CConfig* config) const; /*! * \brief Restart of the solvers from the restart files. - * \param[in] solver_container - Container vector with all the solutions. + * \param[in] solver - Container vector with all the solutions. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. + * \param[in] update_geo - Boolean to indicate if geometry should be updated. */ - void Solver_Restart(CSolver ***solver, CGeometry **geometry, CConfig *config, bool update_geo); + void RestartSolver(CSolver*** solver, CGeometry** geometry, CConfig* config, bool update_geo); /*! * \brief Definition and allocation of all solution classes. - * \param[in] solver_container - Container vector with all the solutions. + * \param[in] solver - Container vector with all the solutions. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. + * \param[in] val_iInst - Current solver instance. */ - void Solver_Postprocessing(CSolver ****solver, CGeometry **geometry, CConfig *config, unsigned short val_iInst); + void FinalizeSolver(CSolver**** solver, CGeometry** geometry, CConfig* config, unsigned short val_iInst); /*! * \brief Definition and allocation of all integration classes. * \param[in] config - Definition of the particular problem. * \param[in] solver - Container vector with all the solutions. - * \param[out] integration - Container vector with all the integration methods. + * \param[in] integration - Container vector with all the integration methods. */ - void Integration_Preprocessing(CConfig *config, CSolver **solver, CIntegration **&integration) const; + void InitializeIntegration(CConfig* config, CSolver** solver, CIntegration**& integration) const; /*! * \brief Definition and allocation of all integration classes. - * \param[in] integration_container - Container vector with all the integration methods. + * \param[in] integration - Container vector with all the integration methods. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. + * \param[in] val_iInst - Current solver instance. */ - void Integration_Postprocessing(CIntegration ***integration, CGeometry **geometry, CConfig *config, unsigned short val_iInst); + void FinalizeIntegration(CIntegration*** integration, CGeometry** geometry, CConfig* config, + unsigned short val_iInst); /*! * \brief Definition and allocation of all interface classes. + * \param[in] config - Definition of the particular problem. + * \param[in] solver - Container vector with all the solutions. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] interface_types - Type of coupling between the distinct (physical) zones. + * \param[in] interface - Class defining the physical transfer of information. + * \param[in] interpolation - Object defining the interpolation. */ - void Interface_Preprocessing(CConfig **config, CSolver *****solver, CGeometry ****geometry, - unsigned short **interface_types, CInterface ***interface, - vector > > &interpolation); + void InitializeInterface(CConfig** config, CSolver***** solver, CGeometry**** geometry, + unsigned short** interface_types, CInterface*** interface, + vector>>& interpolation); /*! * \brief Definition and allocation of all solver classes. - * \param[in] numerics_container - Description of the numerical method (the way in which the equations are solved). - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - Container vector with all the solutions. + * \param[in] numerics - Description of the numerical method (the way in which the equations are solved). */ - void Numerics_Preprocessing(CConfig *config, CGeometry **geometry, CSolver ***solver, CNumerics ****&numerics) const; + void InitializeNumerics(CConfig* config, CGeometry** geometry, CSolver*** solver, CNumerics****& numerics) const; /*! * \brief Helper to instantiate turbulence numerics specialized for different flow solvers. */ template - void InstantiateTurbulentNumerics(unsigned short nVar_Turb, int offset, const CConfig *config, - const CSolver* turb_solver, CNumerics ****&numerics) const; + void InstantiateTurbulentNumerics(unsigned short nVar_Turb, int offset, const CConfig* config, + const CSolver* turb_solver, CNumerics****& numerics) const; /*! * \brief Helper to instantiate transition numerics specialized for different flow solvers. */ template - void InstantiateTransitionNumerics(unsigned short nVar_Trans, int offset, const CConfig *config, - const CSolver* trans_solver, CNumerics ****&numerics) const; + void InstantiateTransitionNumerics(unsigned short nVar_Trans, int offset, const CConfig* config, + const CSolver* trans_solver, CNumerics****& numerics) const; /*! * \brief Helper to instantiate species transport numerics specialized for different flow solvers. */ template - void InstantiateSpeciesNumerics(unsigned short nVar_Species, int offset, const CConfig *config, - const CSolver* species_solver, CNumerics ****&numerics) const; + void InstantiateSpeciesNumerics(unsigned short nVar_Species, int offset, const CConfig* config, + const CSolver* species_solver, CNumerics****& numerics) const; /*! * \brief Definition and allocation of all solver classes. - * \param[in] numerics_container - Description of the numerical method (the way in which the equations are solved). - * \param[in] solver_container - Container vector with all the solutions. + * \param[in] numerics - Description of the numerical method (the way in which the equations are solved). + * \param[in] solver - Container vector with all the solutions. * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. + * \param[in] val_iInst - Current solver instance. */ - void Numerics_Postprocessing(CNumerics *****numerics, CSolver ***solver, CGeometry **geometry, CConfig *config, unsigned short val_iInst); + void FinalizeNumerics(CNumerics***** numerics, CSolver*** solver, CGeometry** geometry, CConfig* config, + unsigned short val_iInst); /*! * \brief GridMovement_Preprocessing - * \param config - * \param geometry - * \param solver - * \param iteration - * \param grid_movement - * \param surface_movement + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - Container vector with all the solutions. + * \param[in] iteration - Container vector with all the iteration methods. + * \param[in] grid_movement - Volume grid movement classes of the problem. + * \param[in] surface_movement - Surface movement classes of the problem. */ - void DynamicMesh_Preprocessing(CConfig *config, CGeometry **geometry, CSolver ***solver, CIteration *iteration, CVolumetricMovement *&grid_movement, CSurfaceMovement *&surface_movement) const; + void PreprocessDynamicMesh(CConfig* config, CGeometry** geometry, CSolver*** solver, CIteration* iteration, + CVolumetricMovement*& grid_movement, CSurfaceMovement*& surface_movement) const; /*! - * \brief Initialize Python interface functionalities + * \brief Initialize Python interface functionalities. When using multigrid, + * it is important to call this after modifying custom boundary values. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - Container vector with all the solutions. */ - void PythonInterface_Preprocessing(CConfig** config, CGeometry**** geometry, CSolver***** solver); + void PreprocessPythonInterface(CConfig** config, CGeometry**** geometry, CSolver***** solver); /*! * \brief Preprocess the output container. + * \param[in] config - Definition of the particular problem. + * \param[in] driver_config - Definition of the driver configuration. + * \param[in] output_container - Container vector with all the outputs. + * \param[in] driver_output - Definition of the driver output. */ - void Output_Preprocessing(CConfig **config, CConfig *driver_config, COutput **&output_container, COutput *&driver_output); + void PreprocessOutput(CConfig** config, CConfig* driver_config, COutput**& output_container, + COutput*& driver_output); /*! * \brief Initiate value for static mesh movement such as the gridVel for the ROTATING frame. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. */ - void StaticMesh_Preprocessing(const CConfig *config, CGeometry **geometry); + void PreprocessStaticMesh(const CConfig* config, CGeometry** geometry); /*! * \brief Initiate value for static mesh movement such as the gridVel for the ROTATING frame. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - Container vector with all the solutions. + * \param[in] interface - Class defining the physical transfer of information. */ - void Turbomachinery_Preprocessing(CConfig** config, CGeometry**** geometry, CSolver***** solver, + void PreprocessTurbomachinery(CConfig** config, CGeometry**** geometry, CSolver***** solver, CInterface*** interface); + /*! + * \brief Ramp some simulation settings for turbomachinery problems. + * \param[in] iter - Iteration for the ramp (can be outer or time depending on type of simulation). + * \note TODO This is not compatible with inner iterations because they are delegated to the iteration class. + */ + void RampTurbomachineryValues(unsigned long iter); + /*! * \brief A virtual member. * \param[in] donorZone - zone in which the displacements will be predicted. * \param[in] targetZone - zone which receives the predicted displacements. */ - virtual void Predict_Displacements(unsigned short donorZone, unsigned short targetZone) {} + virtual void PredictDisplacements(unsigned short donorZone, unsigned short targetZone) {} /*! * \brief A virtual member. * \param[in] donorZone - zone in which the tractions will be predicted. * \param[in] targetZone - zone which receives the predicted traction. */ - virtual void Predict_Tractions(unsigned short donorZone, unsigned short targetZone) {} + virtual void PredictTractions(unsigned short donorZone, unsigned short targetZone) {} /*! * \brief A virtual member. * \param[in] donorZone - zone in which the displacements will be transferred. * \param[in] targetZone - zone which receives the tractions transferred. */ - virtual void Transfer_Displacements(unsigned short donorZone, unsigned short targetZone) {} + virtual void TransferDisplacements(unsigned short donorZone, unsigned short targetZone) {} /*! * \brief A virtual member. * \param[in] donorZone - zone from which the tractions will be transferred. * \param[in] targetZone - zone which receives the tractions transferred. */ - virtual void Transfer_Tractions(unsigned short donorZone, unsigned short targetZone) {} + virtual void TransferTractions(unsigned short donorZone, unsigned short targetZone) {} /*! * \brief A virtual member. @@ -309,7 +335,7 @@ class CDriver { * \param[in] targetZone - destination of the information. * \param[in] iOuterIter - Fluid-Structure Interaction subiteration. */ - virtual void Relaxation_Displacements(unsigned short donorZone, unsigned short targetZone, unsigned long iOuterIter) {} + virtual void RelaxationDisplacements(unsigned short donorZone, unsigned short targetZone, unsigned long iOuterIter) {} /*! * \brief A virtual member. @@ -317,31 +343,82 @@ class CDriver { * \param[in] targetZone - destination of the information. * \param[in] iOuterIter - Fluid-Structure Interaction subiteration. */ - virtual void Relaxation_Tractions(unsigned short donorZone, unsigned short targetZone, unsigned long iOuterIter) {} + virtual void RelaxationTractions(unsigned short donorZone, unsigned short targetZone, unsigned long iOuterIter) {} /*! - * \brief A virtual member to run a Block Gauss-Seidel iteration in multizone problems. + * \brief Print out the direct residuals. + * \param[in] kind_recording - Type of recording (full list in ENUM_RECORDING, option_structure.hpp) */ - virtual void Run_GaussSeidel(){} + void PrintDirectResidual(RECORDING kind_recording); /*! - * \brief A virtual member to run a Block-Jacobi iteration in multizone problems. + * \brief Set the solution of all solvers (adjoint or primal) in a zone. + * \param[in] iZone - Index of the zone. + * \param[in] adjoint - True to consider adjoint solvers instead of primal. + * \param[in] solution - Solution object with interface (iPoint,iVar). + * \tparam Old - If true set "old solutions" instead. */ - virtual void Run_Jacobi(){} + template + void SetAllSolutions(unsigned short iZone, bool adjoint, const Container& solution) { + const auto nPoint = geometry_container[iZone][INST_0][MESH_0]->GetnPoint(); + for (auto iSol = 0u, offset = 0u; iSol < MAX_SOLS; ++iSol) { + auto solver = solver_container[iZone][INST_0][MESH_0][iSol]; + if (!(solver && (solver->GetAdjoint() == adjoint))) continue; + for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) + for (auto iVar = 0ul; iVar < solver->GetnVar(); ++iVar) + if (!Old) { + solver->GetNodes()->SetSolution(iPoint, iVar, solution(iPoint, offset + iVar)); + } else { + solver->GetNodes()->SetSolution_Old(iPoint, iVar, solution(iPoint, offset + iVar)); + } + offset += solver->GetnVar(); + } + } /*! - * \brief A virtual member. + * \brief Set the "old solution" of all solvers (adjoint or primal) in a zone. */ - virtual void Update() {} + template + void SetAllSolutionsOld(unsigned short iZone, bool adjoint, const Container& solution) { + SetAllSolutions(iZone, adjoint, solution); + } /*! - * \brief Print out the direct residuals. - * \param[in] kind_recording - Type of recording (full list in ENUM_RECORDING, option_structure.hpp) + * \brief Get the solution of all solvers (adjoint or primal) in a zone. + * \param[in] iZone - Index of the zone. + * \param[in] adjoint - True to consider adjoint solvers instead of primal. + * \param[out] solution - Solution object with interface (iPoint,iVar). */ - void Print_DirectResidual(RECORDING kind_recording); + template + void GetAllSolutions(unsigned short iZone, bool adjoint, Container& solution) const { + const auto nPoint = geometry_container[iZone][INST_0][MESH_0]->GetnPoint(); + for (auto iSol = 0u, offset = 0u; iSol < MAX_SOLS; ++iSol) { + auto solver = solver_container[iZone][INST_0][MESH_0][iSol]; + if (!(solver && (solver->GetAdjoint() == adjoint))) continue; + const auto& sol = solver->GetNodes()->GetSolution(); + for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) + for (auto iVar = 0ul; iVar < solver->GetnVar(); ++iVar) + solution(iPoint, offset + iVar) = SU2_TYPE::GetValue(sol(iPoint, iVar)); + offset += solver->GetnVar(); + } + } -public: + /*! + * \brief Sum the number of primal or adjoint variables for all solvers in a given zone. + * \param[in] iZone - Index of the zone. + * \param[in] adjoint - True to consider adjoint solvers instead of primal. + * \return Total number of solution variables. + */ + unsigned short GetTotalNumberOfVariables(unsigned short iZone, bool adjoint) const { + unsigned short nVar = 0; + for (auto iSol = 0u; iSol < MAX_SOLS; iSol++) { + auto solver = solver_container[iZone][INST_0][MESH_0][iSol]; + if (solver && (solver->GetAdjoint() == adjoint)) nVar += solver->GetnVar(); + } + return nVar; + } + public: /*! * \brief Launch the computation for all zones and all physics. */ @@ -350,129 +427,64 @@ class CDriver { /*! * \brief Deallocation routine */ - void Postprocessing(); - - /*! - * \brief A virtual member. - */ - virtual void ResetConvergence(); + void Finalize() override; /*! * \brief Perform some pre-processing before an iteration of the physics. */ - virtual void Preprocess(unsigned long TimeIter){ } + virtual void Preprocess(unsigned long TimeIter) {} /*! * \brief Monitor the computation. */ - virtual bool Monitor(unsigned long TimeIter){ return false; } + virtual bool Monitor(unsigned long TimeIter) { return false; } /*! * \brief Output the solution in solution file. */ - virtual void Output(unsigned long TimeIter){ } + virtual void Output(unsigned long TimeIter) {} /*! - * \brief Perform a dynamic mesh deformation, including grid velocity computation and update of the multigrid structure. + * \brief Perform a dynamic mesh deformation, including grid velocity computation and update of the multi-grid + * structure. */ - virtual void DynamicMeshUpdate(unsigned long TimeIter) { } + virtual void DynamicMeshUpdate(unsigned long TimeIter) {} /*! - * \brief Perform a dynamic mesh deformation, including grid velocity computation and update of the multigrid structure. + * \brief Update the dual-time solution. */ - virtual void DynamicMeshUpdate(unsigned short val_iZone, unsigned long TimeIter) { } + virtual void Update() {} /*! * \brief Perform a mesh deformation as initial condition. */ - virtual void SetInitialMesh() { } + virtual void SetInitialMesh() {} - /*! - * \brief Process the boundary conditions and update the multigrid structure. - */ - void BoundaryConditionsUpdate(); +/// \addtogroup PySU2 +/// \{ /*! - * \brief Get the total drag. - * \return Total drag. + * \brief Process the boundary conditions and update the multi-grid structure. */ - passivedouble Get_Drag() const; - - /*! - * \brief Get the total lift. - * \return Total lift. - */ - passivedouble Get_Lift() const; - - /*! - * \brief Get the total x moment. - * \return Total x moment. - */ - passivedouble Get_Mx() const; - - /*! - * \brief Get the total y moment. - * \return Total y moment. - */ - passivedouble Get_My() const; - - /*! - * \brief Get the total z moment. - * \return Total z moment. - */ - passivedouble Get_Mz() const; - - /*! - * \brief Get the total drag coefficient. - * \return Total drag coefficient. - */ - passivedouble Get_DragCoeff() const; - - /*! - * \brief Get the total lift coefficient. - * \return Total lift coefficient. - */ - passivedouble Get_LiftCoeff() const; - - /*! - * \brief Get the number of vertices (halo nodes included) from a specified marker. - * \param[in] iMarker - Marker identifier. - * \return Number of vertices. - */ - unsigned long GetNumberVertices(unsigned short iMarker) const; - - /*! - * \brief Get the number of halo vertices from a specified marker. - * \param[in] iMarker - Marker identifier. - * \return Number of vertices. - */ - unsigned long GetNumberHaloVertices(unsigned short iMarker) const; - - /*! - * \brief Check if a vertex is physical or not (halo node) on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return True if the specified vertex is a halo node. - */ - bool IsAHaloNode(unsigned short iMarker, unsigned long iVertex) const; + void BoundaryConditionsUpdate(); /*! - * \brief Get the number of external iterations. - * \return Number of external iterations. + * \brief Get the number of time iterations. + * \return Number of time iterations. */ - unsigned long GetnTimeIter() const; + unsigned long GetNumberTimeIter() const; /*! - * \brief Get the current external iteration. - * \return Current external iteration. + * \brief Get the current time iteration. + * \return Current time iteration. */ - unsigned long GetTime_Iter() const; + unsigned long GetTimeIter() const; /*! * \brief Get the unsteady time step. * \return Unsteady time step. */ - passivedouble GetUnsteady_TimeStep() const; + passivedouble GetUnsteadyTimeStep() const; /*! * \brief Get the name of the output file for the surface. @@ -480,234 +492,6 @@ class CDriver { */ string GetSurfaceFileName() const; - /*! - * \brief Get the global index of a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return Vertex global index. - */ - unsigned long GetVertexGlobalIndex(unsigned short iMarker, unsigned long iVertex) const; - - /*! - * \brief Get undeformed coordinates from the mesh solver. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return x,y,z coordinates of the vertex. - */ - vector GetInitialMeshCoord(unsigned short iMarker, unsigned long iVertex) const; - - /*! - * \brief Get the temperature at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return Temperature of the vertex. - */ - passivedouble GetVertexTemperature(unsigned short iMarker, unsigned long iVertex) const; - - /*! - * \brief Set the temperature of a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] val_WallTemp - Value of the temperature. - */ - void SetVertexTemperature(unsigned short iMarker, unsigned long iVertex, passivedouble val_WallTemp); - - /*! - * \brief Get the heat flux at a vertex on a specified marker (3 components). - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return True if the vertex is a halo node. - */ - vector GetVertexHeatFluxes(unsigned short iMarker, unsigned long iVertex) const; - - /*! - * \brief Get the wall normal component of the heat flux at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return Wall normal component of the heat flux at the vertex. - */ - passivedouble GetVertexNormalHeatFlux(unsigned short iMarker, unsigned long iVertex) const; - - /*! - * \brief Set the wall normal component of the heat flux at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] val_WallHeatFlux - Value of the normal heat flux. - */ - void SetVertexNormalHeatFlux(unsigned short iMarker, unsigned long iVertex, passivedouble val_WallHeatFlux); - - /*! - * \brief Get the thermal conductivity at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return Thermal conductivity at the vertex. - */ - passivedouble GetThermalConductivity(unsigned short iMarker, unsigned long iVertex) const; - - /*! - * \brief Preprocess the inlets via file input for all solvers. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - */ - void Inlet_Preprocessing(CSolver ***solver, CGeometry **geometry, CConfig *config) const; - - /*! - * \brief Get the normal (vector) at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] unitNormal - Bool to normalise the vector. - * \return Normal (vector) at the vertex. - */ - vector GetVertexNormal(unsigned short iMarker, unsigned long iVertex, bool unitNormal = false) const; - - /*! - * \brief Get the unit normal (vector) at a vertex on a specified marker. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return Unit normal (vector) at the vertex. - */ - inline vector GetVertexUnitNormal(unsigned short iMarker, unsigned long iVertex) const { - return GetVertexNormal(iMarker, iVertex, true); - } - - /*! - * \brief Get all the boundary markers tags. - * \return List of boundary markers tags. - */ - vector GetAllBoundaryMarkersTag() const; - - /*! - * \brief Get all the deformable boundary marker tags. - * \return List of deformable boundary markers tags. - */ - vector GetAllDeformMeshMarkersTag() const; - - /*! - * \brief Get all the heat transfer boundary markers tags. - * \return List of heat transfer boundary markers tags. - */ - vector GetAllCHTMarkersTag() const; - - /*! - * \brief Get all the (subsonic) inlet boundary markers tags. - * \return List of inlet boundary markers tags. - */ - vector GetAllInletMarkersTag() const; - - /*! - * \brief Get all the boundary markers tags with their associated indices. - * \return List of boundary markers tags with their indices. - */ - map GetAllBoundaryMarkers() const; - - /*! - * \brief Get all the boundary markers tags with their associated types. - * \return List of boundary markers tags with their types. - */ - map GetAllBoundaryMarkersType() const; - - /*! - * \brief Set the mesh displacement for the elasticity mesh solver. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] DispX - Value of the mesh displacement in the direction X. - * \param[in] DispY - Value of the mesh displacement in the direction Y. - * \param[in] DispZ - Value of the mesh displacement in the direction Z. - */ - void SetMeshDisplacement(unsigned short iMarker, unsigned long iVertex, passivedouble DispX, passivedouble DispY, passivedouble DispZ); - - /*! - * \brief Communicate the boundary mesh displacements in a python call - */ - void CommunicateMeshDisplacement(void); - - /*! - * \brief Return the sensitivities of the mesh boundary vertices. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return Vector of sensitivities. - */ - vector GetMeshDisp_Sensitivity(unsigned short iMarker, unsigned long iVertex) const; - - /*! - * \brief Set the load in X direction for the structural solver. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] LoadX - Value of the load in the direction X. - * \param[in] LoadX - Value of the load in the direction Y. - * \param[in] LoadX - Value of the load in the direction Z. - */ - void SetFEA_Loads(unsigned short iMarker, unsigned long iVertex, passivedouble LoadX, - passivedouble LoadY, passivedouble LoadZ); - - /*! - * \brief Return the displacements from the FEA solver. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return Vector of displacements. - */ - vector GetFEA_Displacements(unsigned short iMarker, unsigned long iVertex) const; - - /*! - * \brief Return the velocities from the FEA Solver. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return Vector of velocities. - */ - vector GetFEA_Velocity(unsigned short iMarker, unsigned long iVertex) const; - - /*! - * \brief Return the velocities from the FEA Solver. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \return Vector of velocities at time n. - */ - vector GetFEA_Velocity_n(unsigned short iMarker, unsigned long iVertex) const; - - /*! - * \brief Get the sensitivity of the flow loads for the structural solver. - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] LoadX - Value of the load in the direction X. - * \param[in] LoadX - Value of the load in the direction Y. - * \param[in] LoadX - Value of the load in the direction Z. - */ - vector GetFlowLoad_Sensitivity(unsigned short iMarker, unsigned long iVertex) const; - - /*! - * \brief Get the flow load (from the extra step - the repeated methods should be unified once the postprocessing - * strategy is in place). - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - */ - vector GetFlowLoad(unsigned short iMarker, unsigned long iVertex) const; - - /*! - * \brief Set the adjoint of the flow tractions (from the extra step - - * the repeated methods should be unified once the postprocessing strategy is in place). - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] val_AdjointX - Value of the adjoint in the direction X. - * \param[in] val_AdjointY - Value of the adjoint in the direction Y. - * \param[in] val_AdjointZ - Value of the adjoint in the direction Z. - */ - void SetFlowLoad_Adjoint(unsigned short iMarker, unsigned long iVertex, passivedouble val_AdjointX, - passivedouble val_AdjointY, passivedouble val_AdjointZ); - - /*! - * \brief Set the adjoint of the structural displacements (from an outside source) - * \param[in] iMarker - Marker identifier. - * \param[in] iVertex - Vertex identifier. - * \param[in] val_AdjointX - Value of the adjoint in the direction X. - * \param[in] val_AdjointY - Value of the adjoint in the direction Y. - * \param[in] val_AdjointZ - Value of the adjoint in the direction Z. - */ - void SetSourceTerm_DispAdjoint(unsigned short iMarker, unsigned long iVertex, passivedouble val_AdjointX, - passivedouble val_AdjointY, passivedouble val_AdjointZ); - void SetSourceTerm_VelAdjoint(unsigned short iMarker, unsigned long iVertex, passivedouble val_AdjointX, - passivedouble val_AdjointY, passivedouble val_AdjointZ); - /*! * \brief Set the position of the heat source. * \param[in] alpha - Angle of rotation respect to Z axis. @@ -715,79 +499,44 @@ class CDriver { * \param[in] pos_y - Position Y. * \param[in] pos_z - Position Z. */ - void SetHeatSource_Position(passivedouble alpha, passivedouble pos_x, passivedouble pos_y, passivedouble pos_z); + void SetHeatSourcePosition(passivedouble alpha, passivedouble pos_x, passivedouble pos_y, passivedouble pos_z); /*! * \brief Set the direction of the inlet. * \param[in] iMarker - Marker index. * \param[in] alpha - Angle (Zpos). */ - void SetInlet_Angle(unsigned short iMarker, passivedouble alpha); + void SetInletAngle(unsigned short iMarker, passivedouble alpha); /*! - * \brief Sum the number of primal or adjoint variables for all solvers in a given zone. - * \param[in] iZone - Index of the zone. - * \param[in] adjoint - True to consider adjoint solvers instead of primal. - * \return Total number of solution variables. + * \brief Set the angle of attack of the farfield. + * \param[in] alpha - Angle (degree). */ - unsigned short GetTotalNumberOfVariables(unsigned short iZone, bool adjoint) const { - unsigned short nVar = 0; - for (auto iSol = 0u; iSol < MAX_SOLS; iSol++) { - auto solver = solver_container[iZone][INST_0][MESH_0][iSol]; - if (solver && (solver->GetAdjoint() == adjoint)) nVar += solver->GetnVar(); - } - return nVar; - } + void SetFarFieldAoA(passivedouble alpha); /*! - * \brief Set the solution of all solvers (adjoint or primal) in a zone. - * \param[in] iZone - Index of the zone. - * \param[in] adjoint - True to consider adjoint solvers instead of primal. - * \param[in] solution - Solution object with interface (iPoint,iVar). - * \tparam Old - If true set "old solutions" instead. + * \brief Set the angle of sideslip of the farfield. + * \param[in] beta - Angle (degree). */ - template - void SetAllSolutions(unsigned short iZone, bool adjoint, const Container& solution) { - const auto nPoint = geometry_container[iZone][INST_0][MESH_0]->GetnPoint(); - for (auto iSol = 0u, offset = 0u; iSol < MAX_SOLS; ++iSol) { - auto solver = solver_container[iZone][INST_0][MESH_0][iSol]; - if (!(solver && (solver->GetAdjoint() == adjoint))) continue; - for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) - for (auto iVar = 0ul; iVar < solver->GetnVar(); ++iVar) - if (!Old) solver->GetNodes()->SetSolution(iPoint, iVar, solution(iPoint,offset+iVar)); - else solver->GetNodes()->SetSolution_Old(iPoint, iVar, solution(iPoint,offset+iVar)); - offset += solver->GetnVar(); - } - } + void SetFarFieldAoS(passivedouble beta); /*! - * \brief Set the "old solution" of all solvers (adjoint or primal) in a zone. + * \brief Set the dynamic mesh translation rates. + * \param[in] xDot - Value of translational velocity in x-direction. + * \param[in] yDot - Value of translational velocity in y-direction. + * \param[in] zDot - Value of translational velocity in z-direction. */ - template - void SetAllSolutionsOld(unsigned short iZone, bool adjoint, const Container& solution) { - SetAllSolutions(iZone, adjoint, solution); - } + void SetTranslationRate(passivedouble xDot, passivedouble yDot, passivedouble zDot); /*! - * \brief Get the solution of all solvers (adjoint or primal) in a zone. - * \param[in] iZone - Index of the zone. - * \param[in] adjoint - True to consider adjoint solvers instead of primal. - * \param[out] solution - Solution object with interface (iPoint,iVar). + * \brief Set the dynamic mesh rotation rates. + * \param[in] rot_x - Value of Angular velocity about x-axes. + * \param[in] rot_y - Value of Angular velocity about y-axes. + * \param[in] rot_z - Value of Angular velocity about z-axes. */ - template - void GetAllSolutions(unsigned short iZone, bool adjoint, Container& solution) const { - const auto nPoint = geometry_container[iZone][INST_0][MESH_0]->GetnPoint(); - for (auto iSol = 0u, offset = 0u; iSol < MAX_SOLS; ++iSol) { - auto solver = solver_container[iZone][INST_0][MESH_0][iSol]; - if (!(solver && (solver->GetAdjoint() == adjoint))) continue; - const auto& sol = solver->GetNodes()->GetSolution(); - for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) - for (auto iVar = 0ul; iVar < solver->GetnVar(); ++iVar) - solution(iPoint,offset+iVar) = SU2_TYPE::GetValue(sol(iPoint,iVar)); - offset += solver->GetnVar(); - } - } + void SetRotationRate(passivedouble rot_x, passivedouble rot_y, passivedouble rot_z); +/// \} }; /*! @@ -797,24 +546,23 @@ class CDriver { * \author T. Economon, G. Gori */ class CFluidDriver : public CDriver { - -protected: - unsigned long Max_Iter; - -protected: + protected: + unsigned long Max_Iter; /*! * \brief Constructor of the class. * \param[in] confFile - Configuration file name. * \param[in] val_nZone - Total number of zones. - * \param[in] val_nDim - Number of dimensions. * \param[in] MPICommunicator - MPI communicator for SU2. */ - CFluidDriver(char* confFile, - unsigned short val_nZone, - SU2_Comm MPICommunicator); + CFluidDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator); + + /*! + * \brief Transfer data among different zones (multiple zone). + */ + void TransferData(unsigned short donorZone, unsigned short targetZone); -public: + public: /*! * \brief Destructor of the class. */ @@ -851,97 +599,50 @@ class CFluidDriver : public CDriver { void Preprocess(unsigned long Iter) override; /*! - * \brief Perform a dynamic mesh deformation, included grid velocity computation and the update of the multigrid structure (multiple zone). + * \brief Perform a dynamic mesh deformation, included grid velocity computation and the update of the multi-grid + * structure (multiple zone). */ void DynamicMeshUpdate(unsigned long TimeIter) override; - - /*! - * \brief Transfer data among different zones (multiple zone). - */ - void Transfer_Data(unsigned short donorZone, unsigned short targetZone); - }; - /*! - * \class CTurbomachineryDriver + * \class CHBDriver * \ingroup Drivers - * \brief Class for driving an iteration for turbomachinery flow analysis. - * \author S. Vitale + * \brief Class for driving an iteration of Harmonic Balance (HB) method problem using multiple time zones. + * \author T. Economon */ -class CTurbomachineryDriver : public CFluidDriver { -private: - COutputLegacy* output_legacy; - -public: - - /*! - * \brief Constructor of the class. - * \param[in] confFile - Configuration file name. - * \param[in] val_nZone - Total number of zones. - * \param[in] val_nDim - Number of dimensions. - * \param[in] val_periodic - Bool for periodic BCs. - * \param[in] MPICommunicator - MPI communicator for SU2. - */ - CTurbomachineryDriver(char* confFile, - unsigned short val_nZone, - SU2_Comm MPICommunicator); - - /*! - * \brief Destructor of the class. - */ - ~CTurbomachineryDriver(void) override; - - /*! - * \brief Run a single iteration of the physics within multiple zones. - */ - - void Run() override; +class CHBDriver : public CFluidDriver { + private: + unsigned short nInstHB; + su2double** D; /*!< \brief Harmonic Balance operator. */ /*! - * \brief Set Mixing Plane interface within multiple zones. + * \brief Computation and storage of the Harmonic Balance method source terms. + * \author T. Economon, K. Naik + * \param[in] iZone - Current zone number. */ - void SetMixingPlane(unsigned short iZone); + void SetHarmonicBalance(unsigned short iZone); /*! - * \brief Set Mixing Plane interface within multiple zones. + * \brief Precondition Harmonic Balance source term for stability + * \author J. Howison */ - void SetTurboPerformance(unsigned short targetZone); + void StabilizeHarmonicBalance(); /*! - * \brief Monitor the computation. + * \brief Computation of the Harmonic Balance operator matrix for harmonic balance. + * \author A. Rubino, S. Nimmagadda */ - bool Monitor(unsigned long TimeIter) override; - - - -}; - -/*! - * \class CHBDriver - * \ingroup Drivers - * \brief Class for driving an iteration of Harmonic Balance (HB) method problem using multiple time zones. - * \author T. Economon - */ -class CHBDriver : public CFluidDriver { - -private: - COutputLegacy* output_legacy; - unsigned short nInstHB; - su2double **D; /*!< \brief Harmonic Balance operator. */ - -public: + void ComputeHBOperator(); + public: /*! * \brief Constructor of the class. * \param[in] confFile - Configuration file name. * \param[in] val_nZone - Total number of zones. - * \param[in] val_nDim - Number of dimensions. * \param[in] MPICommunicator - MPI communicator for SU2. */ - CHBDriver(char* confFile, - unsigned short val_nZone, - SU2_Comm MPICommunicator); + CHBDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator); /*! * \brief Destructor of the class. @@ -953,32 +654,8 @@ class CHBDriver : public CFluidDriver { */ void Run() override; - /*! - * \brief Computation and storage of the Harmonic Balance method source terms. - * \author T. Economon, K. Naik - * \param[in] iZone - Current zone number. - */ - void SetHarmonicBalance(unsigned short iZone); - - /*! - * \brief Precondition Harmonic Balance source term for stability - * \author J. Howison - */ - void StabilizeHarmonicBalance(); - - /*! - * \brief Computation of the Harmonic Balance operator matrix for harmonic balance. - * \author A. Rubino, S. Nimmagadda - */ - void ComputeHB_Operator(); - /*! * \brief Update the solution for the Harmonic Balance. */ void Update() override; - - /*! - * \brief Reset the convergence flag (set to false) of the solver for the Harmonic Balance. - */ - void ResetConvergence() override; }; diff --git a/SU2_CFD/include/drivers/CDriverBase.hpp b/SU2_CFD/include/drivers/CDriverBase.hpp new file mode 100644 index 00000000000..1aaaed47349 --- /dev/null +++ b/SU2_CFD/include/drivers/CDriverBase.hpp @@ -0,0 +1,771 @@ +/*! + * \file CDriverBase.hpp + * \brief Base class for all drivers. + * \author H. Patel, A. Gastaldi + * \version 8.0.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include +#include "../../../Common/include/CConfig.hpp" +#include "../../../Common/include/containers/CPyWrapperMatrixView.hpp" +#include "../numerics/CNumerics.hpp" +#include "../output/COutput.hpp" +#include "../solvers/CSolver.hpp" + +/*! + * \class CDriverBase + * \ingroup Drivers + * \brief Base class for all drivers. + * \author H. Patel, A. Gastaldi + */ +class CDriverBase { + protected: + int rank, /*!< \brief MPI Rank. */ + size; /*!< \brief MPI Size. */ + char* config_file_name; /*!< \brief Configuration file name of the problem. */ + + su2double StartTime, /*!< \brief Start point of the timer for performance benchmarking. */ + StopTime, /*!< \brief Stop point of the timer for performance benchmarking. */ + UsedTimePreproc, /*!< \brief Elapsed time between Start and Stop point of the timer for tracking preprocessing + phase. */ + UsedTimeCompute, /*!< \brief Elapsed time between Start and Stop point of the timer for tracking compute phase. */ + UsedTime; /*!< \brief Elapsed time between Start and Stop point of the timer. */ + + unsigned long TimeIter; + unsigned short selected_zone = ZONE_0; /*!< \brief Selected zone for the driver. Defaults to ZONE_0 */ + unsigned short iMesh, /*!< \brief Iterator on mesh levels. */ + iZone, /*!< \brief Iterator on zones. */ + nZone, /*!< \brief Total number of zones in the problem. */ + nDim, /*!< \brief Number of dimensions. */ + iInst, /*!< \brief Iterator on instance levels. */ + *nInst, /*!< \brief Total number of instances in the problem (per zone). */ + **interface_types; /*!< \brief Type of coupling between the distinct (physical) zones. */ + + CConfig* driver_config = nullptr; /*!< \brief Definition of the driver configuration. */ + COutput* driver_output = nullptr; /*!< \brief Definition of the driver output. */ + + CConfig** config_container; /*!< \brief Definition of the particular problem. */ + COutput** output_container; /*!< \brief Pointer to the COutput class. */ + CGeometry**** geometry_container; /*!< \brief Geometrical definition of the problem. */ + CSolver***** solver_container; /*!< \brief Container vector with all the solutions. */ + CNumerics****** numerics_container; /*!< \brief Description of the numerical method (the way in which the equations + are solved). */ + CSurfaceMovement** surface_movement; /*!< \brief Surface movement classes of the problem. */ + CVolumetricMovement*** grid_movement; /*!< \brief Volume grid movement classes of the problem. */ + + CConfig* main_config = nullptr; /*!< \brief Reference to base (i.e. ZONE 0) configuration (used in driver API). */ + CGeometry* main_geometry = nullptr; /*!< \brief Reference to base (i.e. ZONE, INST, MESH 0) geometry (used in driver API). */ + + public: + /*! + * \brief Constructor of the class. + * \param[in] confFile - Configuration file name. + * \param[in] val_nZone - Total number of zones. + * \param[in] MPICommunicator - MPI communicator for SU2. + */ + CDriverBase(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator); + + /*! + * \brief Destructor of the class. + */ + virtual ~CDriverBase(void); + + /*! + * \brief A virtual member. + */ + virtual void Run(){} + + /*! + * \brief A virtual member. + */ + virtual void Finalize(){} + +/// \addtogroup PySU2 +/// @{ + + /*! + * \brief Get the list of available outputs. + * \return List of output names. + */ + inline vector GetOutputNames() const { return output_container[MESH_0]->GetHistoryOutputList(); } + + /*! + * \brief Get the value of one of the available history outputs. + * \return Value of the output. + */ + inline passivedouble GetOutputValue(const std::string& output_name) const { + return SU2_TYPE::GetValue(output_container[MESH_0]->GetHistoryFieldValue(output_name)); + } + + /*! + * \brief Get the list of available surface outputs on **both** MARKER_MONITORING and MARKER_ANALYZE. + * \return List of surface output names. + */ + inline vector GetMarkerOutputNames() const { + return output_container[MESH_0]->GetHistoryOutputPerSurfaceList(); + } + + /*! + * \brief Get the value of one of the available surface outputs at a given MARKER_MONITORING. + * \return Value of the output. + */ + inline passivedouble GetMarkerMonitoringOutputValue(const std::string& output_name, + const std::string& marker_monitoring) const { + for (auto iMarker = 0u; iMarker < main_config->GetnMarker_Monitoring(); ++iMarker) { + if (marker_monitoring == main_config->GetMarker_Monitoring_TagBound(iMarker)) + return SU2_TYPE::GetValue(output_container[MESH_0]->GetHistoryFieldValuePerSurface(output_name, iMarker)); + } + SU2_MPI::Error(marker_monitoring + " is not in MARKER_MONITORING.", CURRENT_FUNCTION); + return 0; + } + + /*! + * \brief Get the value of one of the available surface outputs at a given MARKER_ANALYZE. + * \return Value of the output. + */ + inline passivedouble GetMarkerAnalyzeOutputValue(const std::string& output_name, + const std::string& marker_analyze) const { + for (auto iMarker = 0u; iMarker < main_config->GetnMarker_Analyze(); ++iMarker) { + if (marker_analyze == main_config->GetMarker_Analyze_TagBound(iMarker)) + return SU2_TYPE::GetValue(output_container[MESH_0]->GetHistoryFieldValuePerSurface(output_name, iMarker)); + } + SU2_MPI::Error(marker_analyze + " is not in MARKER_ANALYZE.", CURRENT_FUNCTION); + return 0; + } + + /*! + * \brief Get the number of design variables. + * \return Number of design variables. + */ + unsigned short GetNumberDesignVariables() const; + + /*! + * \brief Get the number of FFD boxes. + * \return Number of FFD boxes. + */ + unsigned short GetNumberFFDBoxes() const; + + /*! + * \brief Get the number of dimensions of the mesh. + * \return Number of dimensions. + */ + unsigned long GetNumberDimensions() const; + + /*! + * \brief Get the number of elements in the mesh. + * \return Number of elements. + */ + unsigned long GetNumberElements() const; + + /*! + * \brief Get the global index of a mesh element. + * \param[in] iElem - Mesh element index. + * \return Global element index. + */ + unsigned long GetElementGlobalIndex(unsigned long iElem) const; + + /*! + * \brief Get the node indices of a mesh element. + * \param[in] iElem - Mesh element index. + * \return Element node indices (nNode). + */ + vector GetElementNodes(unsigned long iElem) const; + + /*! + * \brief Get the number of nodes in the mesh (including halos). + * \return Number of nodes. + */ + unsigned long GetNumberNodes() const; + + /*! + * \brief Get the number of halo nodes in the mesh. + * \return Number of halo nodes. + */ + unsigned long GetNumberHaloNodes() const; + + /*! + * \brief Get the global node index. + * \param[in] iPoint - Mesh node index. + * \return Global node index. + */ + unsigned long GetNodeGlobalIndex(unsigned long iPoint) const; + + /*! + * \brief Get the halo flag of a mesh node. + * \param[in] iPoint - Mesh node index. + * \return Node domain flag. + */ + bool GetNodeDomain(unsigned long iPoint) const; + + /*! + * \brief Get a read-only view of the initial (undeformed) coordinates of all mesh nodes. + */ + inline CPyWrapperMatrixView InitialCoordinates() const { + if (!main_config->GetDeform_Mesh()) { + SU2_MPI::Error("Initial coordinates are only available with DEFORM_MESH= YES", CURRENT_FUNCTION); + } + auto* coords = + const_cast(solver_container[selected_zone][INST_0][MESH_0][MESH_SOL]->GetNodes()->GetMesh_Coord()); + return CPyWrapperMatrixView(*coords, "InitialCoordinates", true); + } + + /*! + * \brief Get a read-only view of the initial (undeformed) coordinates of the mesh nodes of a marker. + */ + inline CPyWrapperMarkerMatrixView MarkerInitialCoordinates(unsigned short iMarker) const { + if (!main_config->GetDeform_Mesh()) { + SU2_MPI::Error("Initial coordinates are only available with DEFORM_MESH= YES", CURRENT_FUNCTION); + } + if (iMarker >= GetNumberMarkers()) SU2_MPI::Error("Marker index exceeds size.", CURRENT_FUNCTION); + + auto* coords = + const_cast(solver_container[selected_zone][INST_0][MESH_0][MESH_SOL]->GetNodes()->GetMesh_Coord()); + return CPyWrapperMarkerMatrixView(*coords, main_geometry->vertex[iMarker], main_geometry->GetnVertex(iMarker), + "MarkerInitialCoordinates", true); + } + + /*! + * \brief Get a read/write view of the current coordinates of all mesh nodes. + */ + inline CPyWrapperMatrixView Coordinates() { + auto& coords = const_cast(main_geometry->nodes->GetCoord()); + return CPyWrapperMatrixView(coords, "Coordinates", false); + } + + /*! + * \brief Get a read/write view of the current coordinates of the mesh nodes of a marker. + */ + inline CPyWrapperMarkerMatrixView MarkerCoordinates(unsigned short iMarker) { + if (iMarker >= GetNumberMarkers()) SU2_MPI::Error("Marker index exceeds size.", CURRENT_FUNCTION); + auto& coords = const_cast(main_geometry->nodes->GetCoord()); + return CPyWrapperMarkerMatrixView(coords, main_geometry->vertex[iMarker], main_geometry->GetnVertex(iMarker), + "MarkerCoordinates", false); + } + + /*! + * \brief Get the number of markers in the mesh. + * \return Number of markers. + */ + unsigned short GetNumberMarkers() const; + + /*! + * \brief Get all the boundary markers tags with their associated indices. + * \return Map of boundary markers tags to their indices. + */ + map GetMarkerIndices() const; + + /*! + * \brief Get all the boundary markers tags with their associated types. + * \return Map of boundary markers tags to their types. + */ + map GetMarkerTypes() const; + + /*! + * \brief Get all the boundary marker tags. + * \return List of boundary markers tags. + */ + vector GetMarkerTags() const; + + /*! + * \brief Get all the deformable boundary marker tags. + * \return List of deformable boundary markers tags. + */ + vector GetDeformableMarkerTags() const; + + /*! + * \brief Get all the CHT boundary marker tags. + * \return List of CHT boundary markers tags. + */ + vector GetCHTMarkerTags() const; + + /*! + * \brief Get all the inlet boundary marker tags. + * \return List of inlet boundary markers tags. + */ + vector GetInletMarkerTags() const; + + /*! + * \brief Get the number of elements in the marker. + * \param[in] iMarker - Marker index. + * \return Number of elements. + */ + unsigned long GetNumberMarkerElements(unsigned short iMarker) const; + + /*! + * \brief Get the global index of a marker element. + * \param[in] iMarker - Marker index. + * \param[in] iElem - Marker element index. + * \return Global element index. + */ + unsigned long GetMarkerElementGlobalIndex(unsigned short iMarker, unsigned long iElem) const; + + /*! + * \brief Get the node indices of a marker element. + * \param[in] iMarker - Marker index. + * \param[in] iElem - Marker element index. + * \return Element node indices. + */ + vector GetMarkerElementNodes(unsigned short iMarker, unsigned long iElem) const; + + /*! + * \brief Get the number of nodes in the marker. + * \param[in] iMarker - Marker index. + * \return Number of nodes. + */ + unsigned long GetNumberMarkerNodes(unsigned short iMarker) const; + + /*! + * \brief Get the node index of a marker. + * \param[in] iMarker - Marker index. + * \param[in] iVertex - Marker vertex index. + * \return Marker vertex. + */ + unsigned long GetMarkerNode(unsigned short iMarker, unsigned long iVertex) const; + + /*! + * \brief Get the normal vector of a marker vertex. + * \param[in] iMarker - Marker index. + * \param[in] iVertex - Marker vertex index. + * \param[in] normalize - If true, the unit (i.e. normalized) normal vector is returned. + * \return Node normal vector (nDim). + */ + vector GetMarkerVertexNormals(unsigned short iMarker, unsigned long iVertex, + bool normalize = false) const; + + /*! + * \brief Get the displacements currently imposed of a marker vertex. + * \param[in] iMarker - Marker index. + * \param[in] iVertex - Marker vertex index. + * \return Node displacements (nDim). + */ + inline vector GetMarkerDisplacement(unsigned short iMarker, unsigned long iVertex) const { + vector disp(GetNumberDimensions(), 0.0); + const auto iPoint = GetMarkerNode(iMarker, iVertex); + auto* nodes = GetSolverAndCheckMarker(MESH_SOL)->GetNodes(); + + for (auto iDim = 0u; iDim < GetNumberDimensions(); ++iDim) { + disp[iDim] = SU2_TYPE::GetValue(nodes->GetBound_Disp(iPoint, iDim)); + } + return disp; + } + + /*! + * \brief Set the mesh displacements of a marker vertex. + * \note This can be the input of the flow solver in an FSI setting. + * \param[in] iMarker - Marker index. + * \param[in] iVertex - Marker vertex index. + * \param[in] values - Node displacements (nDim). + */ + inline void SetMarkerCustomDisplacement(unsigned short iMarker, unsigned long iVertex, vector values) { + const auto iPoint = GetMarkerNode(iMarker, iVertex); + auto* nodes = GetSolverAndCheckMarker(MESH_SOL)->GetNodes(); + + for (auto iDim = 0u; iDim < GetNumberDimensions(); iDim++) { + nodes->SetBound_Disp(iPoint, iDim, values[iDim]); + } + } + + /*! + * \brief Get the mesh velocities currently imposed on a marker vertex. + * \param[in] iMarker - Marker index. + * \param[in] iVertex - Marker vertex index. + * \return Node velocities (nDim). + */ + inline vector GetMarkerMeshVelocity(unsigned short iMarker, unsigned long iVertex) const { + vector vel(GetNumberDimensions(), 0.0); + const auto iPoint = GetMarkerNode(iMarker, iVertex); + auto* nodes = GetSolverAndCheckMarker(MESH_SOL)->GetNodes(); + + for (auto iDim = 0u; iDim < GetNumberDimensions(); ++iDim) { + vel[iDim] = SU2_TYPE::GetValue(nodes->GetBound_Vel(iPoint, iDim)); + } + return vel; + } + + /*! + * \brief Set the velocities of a marker vertex. + * \note This can be the input of the flow solver in an unsteady FSI setting. + * \param[in] iMarker - Marker index. + * \param[in] iVertex - Marker vertex index. + * \param[in] values - Node velocities (nDim). + */ + inline void SetMarkerCustomMeshVelocity(unsigned short iMarker, unsigned long iVertex, vector values) { + const auto iPoint = GetMarkerNode(iMarker, iVertex); + auto* nodes = GetSolverAndCheckMarker(MESH_SOL)->GetNodes(); + + for (auto iDim = 0u; iDim < GetNumberDimensions(); iDim++) { + nodes->SetBound_Vel(iPoint, iDim, values[iDim]); + } + } + + /*! + * \brief Communicate the boundary mesh displacements. + */ + void CommunicateMeshDisplacements(void); + + /*! + * \brief Get all the active solver names with their associated indices (which can be used to access their data). + */ + map GetSolverIndices() const; + + /*! + * \brief Get the structural solver solution variable names with their associated indices. + * These correspond to the column indices in the matrix returned by e.g. Solution(). + */ + map GetFEASolutionIndices() const; + + /*! + * \brief Get a read/write view of the current solution on all mesh nodes of a solver. + */ + inline CPyWrapperMatrixView Solution(unsigned short iSolver) { + auto* solver = GetSolverAndCheckMarker(iSolver); + return CPyWrapperMatrixView(solver->GetNodes()->GetSolution(), "Solution of " + solver->GetSolverName(), false); + } + + /*! + * \brief Get a read/write view of the current solution on the mesh nodes of a marker. + */ + inline CPyWrapperMarkerMatrixView MarkerSolution(unsigned short iSolver, unsigned short iMarker) { + auto* solver = GetSolverAndCheckMarker(iSolver, iMarker); + return CPyWrapperMarkerMatrixView( + solver->GetNodes()->GetSolution(), main_geometry->vertex[iMarker], main_geometry->GetnVertex(iMarker), + "MarkerSolution of " + solver->GetSolverName(), false); + } + + /*! + * \brief Get a read/write view of the solution at time N on all mesh nodes of a solver. + */ + inline CPyWrapperMatrixView SolutionTimeN(unsigned short iSolver) { + auto* solver = GetSolverAndCheckMarker(iSolver); + return CPyWrapperMatrixView( + solver->GetNodes()->GetSolution_time_n(), "SolutionTimeN of " + solver->GetSolverName(), false); + } + + /*! + * \brief Get a read/write view of the solution at time N on the mesh nodes of a marker. + */ + inline CPyWrapperMarkerMatrixView MarkerSolutionTimeN(unsigned short iSolver, unsigned short iMarker) { + auto* solver = GetSolverAndCheckMarker(iSolver, iMarker); + return CPyWrapperMarkerMatrixView( + solver->GetNodes()->GetSolution_time_n(), main_geometry->vertex[iMarker], main_geometry->GetnVertex(iMarker), + "MarkerSolutionTimeN of " + solver->GetSolverName(), false); + } + + /*! + * \brief Get a read/write view of the solution at time N-1 on all mesh nodes of a solver. + */ + inline CPyWrapperMatrixView SolutionTimeN1(unsigned short iSolver) { + auto* solver = GetSolverAndCheckMarker(iSolver); + return CPyWrapperMatrixView( + solver->GetNodes()->GetSolution_time_n1(), "SolutionTimeN1 of " + solver->GetSolverName(), false); + } + + /*! + * \brief Get a read/write view of the solution at time N-1 on the mesh nodes of a marker. + */ + inline CPyWrapperMarkerMatrixView MarkerSolutionTimeN1(unsigned short iSolver, unsigned short iMarker) { + auto* solver = GetSolverAndCheckMarker(iSolver, iMarker); + return CPyWrapperMarkerMatrixView( + solver->GetNodes()->GetSolution_time_n1(), main_geometry->vertex[iMarker], main_geometry->GetnVertex(iMarker), + "MarkerSolutionTimeN1 of " + solver->GetSolverName(), false); + } + + /*! + * \brief Get the flow solver primitive variable names with their associated indices. + * These correspond to the column indices in the matrix returned by Primitives. + */ + map GetPrimitiveIndices() const; + + /*! + * \brief Get a read/write view of the current primitive variables on all mesh nodes of the flow solver. + * \warning Primitive variables are only available for flow solvers. + */ + inline CPyWrapperMatrixView Primitives() { + auto* solver = GetSolverAndCheckMarker(FLOW_SOL); + return CPyWrapperMatrixView(const_cast(solver->GetNodes()->GetPrimitive()), "Primitives", false); + } + + /*! + * \brief Get a read/write view of the current primitive variables on the mesh nodes of a marker. + * \warning Primitive variables are only available for flow solvers. + */ + inline CPyWrapperMarkerMatrixView MarkerPrimitives(unsigned short iMarker) { + auto* solver = GetSolverAndCheckMarker(FLOW_SOL, iMarker); + return CPyWrapperMarkerMatrixView( + const_cast(solver->GetNodes()->GetPrimitive()), main_geometry->vertex[iMarker], + main_geometry->GetnVertex(iMarker), "MarkerPrimitives", false); + } + + /*! + * \brief Get a read-only view of the geometry sensitivity of a discrete adjoint solver. + */ + inline CPyWrapperMatrixView Sensitivity(unsigned short iSolver) { + auto* solver = GetSolverAndCheckMarker(iSolver); + auto& sensitivity = const_cast(solver->GetNodes()->GetSensitivity()); + return CPyWrapperMatrixView(sensitivity, "Sensitivity", true); + } + + /*! + * \brief Set the temperature of a vertex on a specified marker (MARKER_PYTHON_CUSTOM). + * \note This can be the input of a heat or flow solver in a CHT setting. + * \param[in] iMarker - Marker identifier. + * \param[in] iVertex - Vertex identifier. + * \param[in] WallTemp - Value of the temperature. + */ + inline void SetMarkerCustomTemperature(unsigned short iMarker, unsigned long iVertex, passivedouble WallTemp) { + main_geometry->SetCustomBoundaryTemperature(iMarker, iVertex, WallTemp); + } + + /*! + * \brief Set the wall normal heat flux at a vertex on a specified marker (MARKER_PYTHON_CUSTOM). + * \note This can be the input of a heat or flow solver in a CHT setting. + * \param[in] iMarker - Marker identifier. + * \param[in] iVertex - Vertex identifier. + * \param[in] WallHeatFlux - Value of the normal heat flux. + */ + inline void SetMarkerCustomNormalHeatFlux(unsigned short iMarker, unsigned long iVertex, passivedouble WallHeatFlux) { + main_geometry->SetCustomBoundaryHeatFlux(iMarker, iVertex, WallHeatFlux); + } + + /*! + * \brief Selects zone to be used for python driver operations. + * \param[in] iZone - Zone identifier. + */ + inline void SelectZone(unsigned short iZone) { + if (iZone >= nZone) SU2_MPI::Error("Zone index out of range", CURRENT_FUNCTION); + selected_zone = iZone; + main_geometry = geometry_container[selected_zone][INST_0][MESH_0]; + main_config = config_container[selected_zone]; + } + + /*! + * \brief Returns the index of the zone selected for python driver operations. + */ + inline unsigned short SelectedZone() const { return selected_zone; } + + /*! + * \brief Get the wall normal heat flux at a vertex on a specified marker of the flow or heat solver. + * \note This can be the output of a heat or flow solver in a CHT setting. + * \param[in] iSolver - Solver identifier, should be either a flow solver or the heat solver. + * \param[in] iMarker - Marker identifier. + * \param[in] iVertex - Vertex identifier. + * \return Wall normal component of the heat flux at the vertex. + */ + inline passivedouble GetMarkerNormalHeatFlux(unsigned short iSolver, unsigned short iMarker, unsigned long iVertex) const { + if (iSolver != HEAT_SOL && iSolver != FLOW_SOL) { + SU2_MPI::Error("Normal heat flux is only available for flow or heat solvers.", CURRENT_FUNCTION); + } + return SU2_TYPE::GetValue(GetSolverAndCheckMarker(iSolver, iMarker)->GetHeatFlux(iMarker, iVertex)); + } + + /*! + * \brief Sets the nodal force for the structural solver at a vertex of a marker. + * \note This can be the input of the FEA solver in an FSI setting. + * \param[in] iMarker - Marker identifier. + * \param[in] iVertex - Vertex identifier. + * \param[in] force - Force vector. + */ + inline void SetMarkerCustomFEALoad(unsigned short iMarker, unsigned long iVertex, std::vector force) { + auto* solver = GetSolverAndCheckMarker(FEA_SOL, iMarker); + std::array load{}; + for (auto iDim = 0u; iDim < GetNumberDimensions(); ++iDim) load[iDim] = force[iDim]; + const auto iPoint = GetMarkerNode(iMarker, iVertex); + solver->GetNodes()->Set_FlowTraction(iPoint, load.data()); + } + + /*! + * \brief Get the fluid force at a vertex of a solid wall marker of the flow solver. + * \note This can be the output of the flow solver in an FSI setting to then apply it to a structural solver. + * \param[in] iMarker - Marker identifier. + * \param[in] iVertex - Vertex identifier. + * \return Vector of loads. + */ + inline vector GetMarkerFlowLoad(unsigned short iMarker, unsigned long iVertex) const { + vector FlowLoad(GetNumberDimensions(), 0.0); + const auto* solver = GetSolverAndCheckMarker(FLOW_SOL, iMarker); + + if (main_config->GetSolid_Wall(iMarker)) { + for (auto iDim = 0u; iDim < GetNumberDimensions(); ++iDim) { + FlowLoad[iDim] = SU2_TYPE::GetValue(solver->GetVertexTractions(iMarker, iVertex, iDim)); + } + } + return FlowLoad; + } + + /*! + * \brief Set the adjoint of the flow tractions of the flow solver. + * \note This can be the input of the flow solver in an adjoint FSI setting. + * \param[in] iMarker - Marker identifier. + * \param[in] iVertex - Vertex identifier. + * \param[in] adjointLoad - Vector of adjoint loads. + */ + inline void SetMarkerCustomFlowLoadAdjoint(unsigned short iMarker, unsigned long iVertex, + vector adjointLoad) { + auto* solver = GetSolverAndCheckMarker(FLOW_SOL, iMarker); + for (auto iDim = 0u; iDim < GetNumberDimensions(); ++iDim) { + solver->StoreVertexTractionsAdjoint(iMarker, iVertex, iDim, adjointLoad[iDim]); + } + } + + /*! + * \brief Get the sensitivities of the displacements of the mesh boundary vertices. + * \note This can be the output of the flow solver in an adjoint FSI setting. + * \param[in] iMarker - Marker identifier. + * \param[in] iVertex - Vertex identifier. + * \return Vector of sensitivities. + */ + inline vector GetMarkerDisplacementSensitivity(unsigned short iMarker, unsigned long iVertex) const { + const auto nDim = GetNumberDimensions(); + const auto iPoint = GetMarkerNode(iMarker, iVertex); + auto* nodes = GetSolverAndCheckMarker(ADJMESH_SOL)->GetNodes(); + + vector sens(nDim, 0.0); + for (auto iDim = 0u; iDim < nDim; ++iDim) { + sens[iDim] = SU2_TYPE::GetValue(nodes->GetBoundDisp_Sens(iPoint, iDim)); + } + return sens; + } + + /*! + * \brief Get the sensitivity of the FEA loads of the structural solver (via the adjoint structural solver). + * \note This can be the output of the FEA solver in an adjoint FSI setting. + * \param[in] iMarker - Marker identifier. + * \param[in] iVertex - Vertex identifier. + * \returns Vector of sensitivities. + */ + inline vector GetMarkerFEALoadSensitivity(unsigned short iMarker, unsigned long iVertex) const { + const auto nDim = GetNumberDimensions(); + const auto iPoint = GetMarkerNode(iMarker, iVertex); + auto* nodes = GetSolverAndCheckMarker(ADJFEA_SOL)->GetNodes(); + + vector sens(nDim, 0.0); + for (auto iDim = 0u; iDim < nDim; ++iDim) { + sens[iDim] = SU2_TYPE::GetValue(nodes->GetFlowTractionSensitivity(iPoint, iDim)); + } + return sens; + } + + /*! + * \brief Set the adjoint of the structural displacements. + * \note This can be the input of the FEA solver in an adjoint FSI setting. + * \param[in] iMarker - Marker identifier. + * \param[in] iVertex - Vertex identifier. + * \param[in] adjointDisplacement - Vector of adjoint displacements. + */ + inline void SetMarkerCustomFEADisplacementAdjoint(unsigned short iMarker, unsigned long iVertex, + vector adjointDisplacement) { + const auto iPoint = GetMarkerNode(iMarker, iVertex); + auto* nodes = GetSolverAndCheckMarker(ADJFEA_SOL)->GetNodes(); + + for (auto iDim = 0u; iDim < GetNumberDimensions(); ++iDim) { + nodes->SetSourceTerm_DispAdjoint(iPoint, iDim, adjointDisplacement[iDim]); + } + } + + /*! + * \brief Set the adjoint of the structural velocities. + * \note This can be the input of the FEA solver in an unsteady adjoint FSI setting. + * \param[in] iMarker - Marker identifier. + * \param[in] iVertex - Vertex identifier. + * \param[in] adjointVelocity - Vector of adjoint velocities. + */ + inline void SetMarkerCustomFEAVelocityAdjoint(unsigned short iMarker, unsigned long iVertex, + vector adjointVelocity) { + const auto iPoint = GetMarkerNode(iMarker, iVertex); + auto* nodes = GetSolverAndCheckMarker(ADJFEA_SOL)->GetNodes(); + + for (auto iDim = 0u; iDim < GetNumberDimensions(); ++iDim) { + nodes->SetSourceTerm_VelAdjoint(iPoint, iDim, adjointVelocity[iDim]); + } + } + +/// \} + + protected: + /*! + * \brief Automates some boilerplate of accessing solution fields for the python wrapper. + */ + inline CSolver* GetSolverAndCheckMarker(unsigned short iSolver, + unsigned short iMarker = std::numeric_limits::max()) const { + if (iMarker < std::numeric_limits::max() && iMarker > GetNumberMarkers()) { + SU2_MPI::Error("Marker index exceeds size.", CURRENT_FUNCTION); + } + auto* solver = solver_container[selected_zone][INST_0][MESH_0][iSolver]; + if (solver == nullptr) SU2_MPI::Error("The selected solver does not exist.", CURRENT_FUNCTION); + return solver; + } + + /*! + * \brief Initialize containers. + */ + void InitializeContainers(); + + /*! + * \brief Delete containers. + */ + void CommonFinalize(); + + /*! + * \brief Read in the config and mesh files. + * \param[in] config - Definition of the particular problem. + * \param[in] driver_config - Definition of the driver configuration. + */ + void InputPreprocessing(CConfig**& config, CConfig*& driver_config); + + /*! + * \brief Construction of the edge-based data structure and the multi-grid structure. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] dummy - Definition of the dummy driver. + */ + void InitializeGeometry(CConfig* config, CGeometry**& geometry, bool dummy); + + /*! + * \brief Definition and allocation of all solution classes. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - Container vector with all the solutions. + */ + void InitializeSolver(CConfig* config, CGeometry** geometry, CSolver***& solver); + + /*! + * \brief Definition and allocation of all solver classes. + * \param[in] config - Definition of the particular problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver - Container vector with all the solutions. + * \param[in] numerics - Description of the numerical method (the way in which the equations are solved). + */ + void InitializeNumerics(CConfig* config, CGeometry** geometry, CSolver*** solver, CNumerics****& numerics) const; + + /*! + * \brief Preprocess the output container. + * \param[in] config - Definition of the particular problem. + * \param[in] driver_config - Definition of the driver configuration. + * \param[in] output_container - Container vector with all the outputs. + * \param[in] driver_output - Definition of the driver output. + */ + void OutputPreprocessing(CConfig** config, CConfig* driver_config, COutput**& output_container, + COutput*& driver_output); +}; diff --git a/SU2_CFD/include/drivers/CDummyDriver.hpp b/SU2_CFD/include/drivers/CDummyDriver.hpp index 3f1d959f44c..d11c0285e7c 100644 --- a/SU2_CFD/include/drivers/CDummyDriver.hpp +++ b/SU2_CFD/include/drivers/CDummyDriver.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for driving single or multi-zone problems. * The subroutines and functions are in the driver_structure.cpp file. * \author T. Economon, H. Kline, R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/drivers/CMultizoneDriver.hpp b/SU2_CFD/include/drivers/CMultizoneDriver.hpp index 91fe6234a71..9779f0dc410 100644 --- a/SU2_CFD/include/drivers/CMultizoneDriver.hpp +++ b/SU2_CFD/include/drivers/CMultizoneDriver.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for driving single or multi-zone problems. * The subroutines and functions are in the driver_structure.cpp file. * \author T. Economon, H. Kline, R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -35,7 +35,7 @@ * \ingroup Drivers * \brief Class for driving zone-specific iterations. * \author R. Sanchez, O. Burghardt - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CMultizoneDriver : public CDriver { protected: @@ -57,6 +57,56 @@ class CMultizoneDriver : public CDriver { bool *prefixed_motion; /*!< \brief Determines if a fixed motion is imposed in the config file. */ + /*! + * \brief Perform a dynamic mesh deformation, including grid velocity computation and update of the multigrid structure. + */ + void DynamicMeshUpdate(unsigned short val_iZone, unsigned long TimeIter); + + /*! + * \brief Use a corrector step to prevent convergence issues. + */ + void Corrector(unsigned short val_iZone); + + /*! + * \brief Run a Block Gauss-Seidel iteration in all physical zones. + */ + void RunGaussSeidel(); + + /*! + * \brief Run a Block-Jacobi iteration in all physical zones. + */ + void RunJacobi(); + + /*! + * \brief Routine to provide all the desired physical transfers between the different zones during one iteration. + * \return Boolean that determines whether the mesh needs to be updated for this particular transfer + */ + bool TransferData(unsigned short donorZone, unsigned short targetZone); + + /*! + * \brief Set Mixing Plane interface within multiple zones. + */ + void SetMixingPlane(unsigned short donorZone); + + /*! + * \brief Transfer the local turboperfomance quantities (for each blade row) from all the donorZones to the + * targetZone (ZONE_0). + * \note IMPORTANT: This approach of multi-zone performances rely upon the fact that turbomachinery markers follow + * the natural (stator-rotor) development of the real machine. + */ + void SetTurboPerformance(); + + /*! + * \brief Check the convergence at the outer level. + */ + bool OuterConvergence(unsigned long OuterIter); + + /*! + * \brief Returns whether all specified windowed-time-averaged ouputs have been converged + * \return Boolean indicating whether the problem is converged. + */ + virtual bool GetTimeConvergence() const; + public: /*! @@ -72,7 +122,7 @@ class CMultizoneDriver : public CDriver { /*! * \brief Destructor of the class. */ - ~CMultizoneDriver(void) override; + ~CMultizoneDriver() override; /*! * \brief [Overload] Launch the computation for multizone problems. @@ -80,24 +130,25 @@ class CMultizoneDriver : public CDriver { void StartSolver() override; /*! - * \brief Preprocess the multizone iteration + * \brief Preprocess the multizone iteration. */ void Preprocess(unsigned long TimeIter) override; /*! - * \brief Use a corrector step to prevent convergence issues. + * \brief Solves one time iteration. */ - void Corrector(unsigned short val_iZone); + void Run() override { + switch (driver_config->GetKind_MZSolver()){ + case ENUM_MULTIZONE::MZ_BLOCK_GAUSS_SEIDEL: RunGaussSeidel(); break; // Block Gauss-Seidel iteration + case ENUM_MULTIZONE::MZ_BLOCK_JACOBI: RunJacobi(); break; // Block-Jacobi iteration + } + } /*! - * \brief Run a Block Gauss-Seidel iteration in all physical zones. + * \brief Placeholder for post processing operations to make the interface + * of this driver identical to CSinglezoneDriver. */ - void Run_GaussSeidel() override; - - /*! - * \brief Run a Block-Jacobi iteration in all physical zones. - */ - void Run_Jacobi() override; + void Postprocess() {} /*! * \brief Update the dual-time solution within multiple zones. @@ -109,37 +160,15 @@ class CMultizoneDriver : public CDriver { */ void Output(unsigned long TimeIter) override; - /*! - * \brief Check the convergence at the outer level. - */ - bool OuterConvergence(unsigned long OuterIter); - /*! * \brief Perform a dynamic mesh deformation, included grid velocity computation and the update of the multigrid structure (multiple zone). */ void DynamicMeshUpdate(unsigned long TimeIter) override; - /*! - * \brief Perform a dynamic mesh deformation, including grid velocity computation and update of the multigrid structure. - */ - void DynamicMeshUpdate(unsigned short val_iZone, unsigned long TimeIter) override; - - /*! - * \brief Routine to provide all the desired physical transfers between the different zones during one iteration. - * \return Boolean that determines whether the mesh needs to be updated for this particular transfer - */ - bool Transfer_Data(unsigned short donorZone, unsigned short targetZone); - /*! * \brief Check if simulation converged and return appropriate boolean. * \param[in] TimeIter - Current time iteration. * \return Boolean that indicates to stop the iteration loop. */ bool Monitor(unsigned long TimeIter) override; - - /*! - * \brief Returns whether all specified windowed-time-averaged ouputs have been converged - * \return Boolean indicating whether the problem is converged. - */ - virtual bool GetTimeConvergence() const; }; diff --git a/SU2_CFD/include/drivers/CSinglezoneDriver.hpp b/SU2_CFD/include/drivers/CSinglezoneDriver.hpp index 5cfd90acb01..c1292ea6290 100644 --- a/SU2_CFD/include/drivers/CSinglezoneDriver.hpp +++ b/SU2_CFD/include/drivers/CSinglezoneDriver.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines for driving single or multi-zone problems. * The subroutines and functions are in the driver_structure.cpp file. * \author T. Economon, H. Kline, R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -34,13 +34,19 @@ * \ingroup Drivers * \brief Class for driving single-zone solvers. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CSinglezoneDriver : public CDriver { protected: unsigned long TimeIter; + /*! + * \brief Returns whether all specified windowed-time-averaged ouputs have been converged + * \return Boolean indicating whether the problem is converged. + */ + virtual bool GetTimeConvergence() const; + public: /*! @@ -104,15 +110,4 @@ class CSinglezoneDriver : public CDriver { */ bool Monitor(unsigned long TimeIter) override; - /*! - * \brief Returns whether all specified windowed-time-averaged ouputs have been converged - * \return Boolean indicating whether the problem is converged. - */ - virtual bool GetTimeConvergence() const; - - /*! - * \brief Runtime_Parsing - */ - virtual void Runtime_Options(); - }; diff --git a/SU2_CFD/include/fluid/CConductivityModel.hpp b/SU2_CFD/include/fluid/CConductivityModel.hpp index e22104e3a9b..3267ae86468 100644 --- a/SU2_CFD/include/fluid/CConductivityModel.hpp +++ b/SU2_CFD/include/fluid/CConductivityModel.hpp @@ -2,7 +2,7 @@ * \file CConductivityModel.hpp * \brief Defines an interface class for thermal conductivity models. * \author S. Vitale, M. Pini, G. Gori, A. Guardone, P. Colonna, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CConstantConductivity.hpp b/SU2_CFD/include/fluid/CConstantConductivity.hpp index c82f322cd91..4fd94570e7f 100644 --- a/SU2_CFD/include/fluid/CConstantConductivity.hpp +++ b/SU2_CFD/include/fluid/CConstantConductivity.hpp @@ -2,7 +2,7 @@ * \file CConstantConductivity.hpp * \brief Defines a constant laminar thermal conductivity model. * \author S. Vitale, M. Pini, G. Gori, A. Guardone, P. Colonna, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CConstantConductivityRANS.hpp b/SU2_CFD/include/fluid/CConstantConductivityRANS.hpp index ce5d2a0f9b2..3a1e2b896c2 100644 --- a/SU2_CFD/include/fluid/CConstantConductivityRANS.hpp +++ b/SU2_CFD/include/fluid/CConstantConductivityRANS.hpp @@ -2,7 +2,7 @@ * \file CConstantConductivityRANS.hpp * \brief Defines a constant conductivity model for RANS problems. * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CConstantDensity.hpp b/SU2_CFD/include/fluid/CConstantDensity.hpp index ed9a1236f22..98cdcd37b59 100644 --- a/SU2_CFD/include/fluid/CConstantDensity.hpp +++ b/SU2_CFD/include/fluid/CConstantDensity.hpp @@ -2,7 +2,7 @@ * \file CConstantDensity.hpp * \brief Defines the incompressible constant density model. * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CConstantDiffusivity.hpp b/SU2_CFD/include/fluid/CConstantDiffusivity.hpp index 5dd4ebeb25a..8f88d28c881 100644 --- a/SU2_CFD/include/fluid/CConstantDiffusivity.hpp +++ b/SU2_CFD/include/fluid/CConstantDiffusivity.hpp @@ -2,7 +2,7 @@ * \file CConstantDiffusivity.hpp * \brief Defines constant mass diffusivity. * \author T. Economon, Cristopher Morales Ubal - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -44,6 +44,5 @@ class CConstantDiffusivity final : public CDiffusivityModel { /*! * \brief Set diffusivity. */ - void SetDiffusivity(su2double T, su2double rho, su2double mu_lam, su2double mu_turb, su2double cp, - su2double kt) override {} + void SetDiffusivity(su2double rho, su2double mu_lam, su2double cp, su2double kt) override {} }; diff --git a/SU2_CFD/include/fluid/CConstantLewisDiffusivity.hpp b/SU2_CFD/include/fluid/CConstantLewisDiffusivity.hpp index 0f49225fdec..e42c05cbbd0 100644 --- a/SU2_CFD/include/fluid/CConstantLewisDiffusivity.hpp +++ b/SU2_CFD/include/fluid/CConstantLewisDiffusivity.hpp @@ -2,7 +2,7 @@ * \file CConstantLewisDiffusivity.hpp * \brief Defines Constant Lewis mass diffusivity. * \author M.Heimgartner, C.Morales - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -44,8 +44,7 @@ class CConstantLewisDiffusivity final : public CDiffusivityModel { /*! * \brief Set diffusivity. */ - void SetDiffusivity(su2double T, su2double rho, su2double mu_lam, su2double mu_turb, su2double cp, - su2double kt) override { + void SetDiffusivity(su2double rho, su2double mu_lam, su2double cp, su2double kt) override { diff_ = kt / (Lewis_ * rho * cp); } diff --git a/SU2_CFD/include/fluid/CConstantPrandtl.hpp b/SU2_CFD/include/fluid/CConstantPrandtl.hpp index d10849a2282..eef1499e4c1 100644 --- a/SU2_CFD/include/fluid/CConstantPrandtl.hpp +++ b/SU2_CFD/include/fluid/CConstantPrandtl.hpp @@ -2,7 +2,7 @@ * \file CConstantPrandtl.hpp * \brief Defines a non-constant laminar Prandtl number thermal conductivity model. * \author S. Vitale, M. Pini, G. Gori, A. Guardone, P. Colonna, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CConstantPrandtlRANS.hpp b/SU2_CFD/include/fluid/CConstantPrandtlRANS.hpp index ab1eb2c13c7..2a966a3cc8e 100644 --- a/SU2_CFD/include/fluid/CConstantPrandtlRANS.hpp +++ b/SU2_CFD/include/fluid/CConstantPrandtlRANS.hpp @@ -2,7 +2,7 @@ * \file CConstantPrandtlRANS.hpp * \brief Defines a non-constant effective thermal conductivity for RANS problems using Prandtl numbers. * \author S. Vitale, M. Pini, G. Gori, A. Guardone, P. Colonna, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CConstantSchmidt.hpp b/SU2_CFD/include/fluid/CConstantSchmidt.hpp index 966754870e6..a888089ca31 100644 --- a/SU2_CFD/include/fluid/CConstantSchmidt.hpp +++ b/SU2_CFD/include/fluid/CConstantSchmidt.hpp @@ -2,7 +2,7 @@ * \file CConstantSchmidt.hpp * \brief Defines a mass diffusivity model with constant Schmidt numbers. * \author S. Vitale, M. Pini, G. Gori, A. Guardone, P. Colonna, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -45,8 +45,7 @@ class CConstantSchmidt final : public CDiffusivityModel { /*! * \brief Set diffusivity. */ - void SetDiffusivity(su2double T, su2double rho, su2double mu_lam, su2double mu_turb, su2double cp, - su2double kt) override { + void SetDiffusivity(su2double rho, su2double mu_lam, su2double cp, su2double kt) override { diff_ = mu_lam / (rho * sc_lam_); } diff --git a/SU2_CFD/include/fluid/CConstantViscosity.hpp b/SU2_CFD/include/fluid/CConstantViscosity.hpp index 4ceca83970e..187cbae36fc 100644 --- a/SU2_CFD/include/fluid/CConstantViscosity.hpp +++ b/SU2_CFD/include/fluid/CConstantViscosity.hpp @@ -2,7 +2,7 @@ * \file CConstantViscosity.hpp * \brief Defines a constant laminar viscosity model. * \author S. Vitale, M. Pini, G. Gori, A. Guardone, P. Colonna, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CCoolProp.hpp b/SU2_CFD/include/fluid/CCoolProp.hpp index 5caec075b5e..76550e9302c 100644 --- a/SU2_CFD/include/fluid/CCoolProp.hpp +++ b/SU2_CFD/include/fluid/CCoolProp.hpp @@ -2,7 +2,7 @@ * \file CCoolProp.hpp * \brief Defines the state-of-the-art fluid model from CoolProp library. * \author P. Yan, G. Gori, A. Guardone - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -30,12 +30,11 @@ #if defined(HAVE_COOLPROP) && !defined(CODI_FORWARD_TYPE) && !defined(CODI_REVERSE_TYPE) #define USE_COOLPROP namespace CoolProp { - class AbstractState; +class AbstractState; } #endif #include - /*! * \class CCoolProp * \brief Child class for defining fluid model from CoolProp library. @@ -43,20 +42,44 @@ namespace CoolProp { */ class CCoolProp final : public CFluidModel { private: - su2double Gamma{1.4}; /*!< \brief Ratio of Specific Heats. */ - su2double Gas_Constant{297}; /*!< \brief specific Gas Constant. */ - su2double Pressure_Critical{0.0}; /*!< \brief critical pressure */ - su2double Temperature_Critical{0.0}; /*!< \brief critical temperature */ + su2double Gamma{1.4}; /*!< \brief Ratio of Specific Heats. */ + su2double Gas_Constant{297}; /*!< \brief specific Gas Constant. */ + su2double Pressure_Critical{0.0}; /*!< \brief critical pressure */ + su2double Temperature_Critical{0.0}; /*!< \brief critical temperature */ su2double acentric_factor{0.0}; /*!< \brief acentric factor */ + const su2double dp{0.01}; /*!< threshold for pressure */ + const su2double dt{0.01}; /*!< threshold for temperature */ #ifdef USE_COOLPROP - std::unique_ptr fluid_entity; /*!< \brief fluid entity */ + std::unique_ptr fluid_entity; /*!< \brief fluid entity */ #endif + /*! + * \brief Avoid critical pressure + * \param[in,out] Pressure: Modified so that it is not too close to critical pressure to avoid issues in CoolProp. + */ + void CheckPressure(su2double& Pressure) const { + if (Pressure > Pressure_Critical) + Pressure = fmax(Pressure, (1 + dp) * Pressure_Critical); + else + Pressure = fmin(Pressure, (1 - dp) * Pressure_Critical); + } + + /*! + * \brief Avoid critical temperature + * \param[in,out] Temperature: Modified so that it is not too close to critical temperature to avoid issues in + * CoolProp. + */ + void CheckTemperature(su2double& Temperature) const { + if (Temperature > Temperature_Critical) + Temperature = fmax(Temperature, (1 + dt) * Temperature_Critical); + else + Temperature = fmin(Temperature, (1 + dt) * Temperature_Critical); + } public: /*! * \brief Constructor of the class. */ - CCoolProp(string fluidname); + CCoolProp(const string& fluidname); #ifdef USE_COOLPROP /*! @@ -145,5 +168,4 @@ class CCoolProp final : public CFluidModel { * \return Value of the constant: Gamma */ su2double GetGamma(void) const { return Gamma; } - -}; +}; \ No newline at end of file diff --git a/SU2_CFD/include/fluid/CCoolPropConductivity.hpp b/SU2_CFD/include/fluid/CCoolPropConductivity.hpp index 416d76759c8..66f8e9d8f5b 100644 --- a/SU2_CFD/include/fluid/CCoolPropConductivity.hpp +++ b/SU2_CFD/include/fluid/CCoolPropConductivity.hpp @@ -2,7 +2,7 @@ * \file CCoolPropConductivity.hpp * \brief Defines laminar thermal conductivity model from CoolProp. * \author P.YAn, G. Gori, A. Guardone - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CCoolPropViscosity.hpp b/SU2_CFD/include/fluid/CCoolPropViscosity.hpp index 72f9be4ee0b..89e8a5ef430 100644 --- a/SU2_CFD/include/fluid/CCoolPropViscosity.hpp +++ b/SU2_CFD/include/fluid/CCoolPropViscosity.hpp @@ -2,7 +2,7 @@ * \file CCoolPropViscosity.hpp * \brief Defines CoolPropviscosity model. * \author P.Yan, G. Gori, A. Guardone, - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CDataDrivenFluid.hpp b/SU2_CFD/include/fluid/CDataDrivenFluid.hpp new file mode 100644 index 00000000000..6c067bc92aa --- /dev/null +++ b/SU2_CFD/include/fluid/CDataDrivenFluid.hpp @@ -0,0 +1,220 @@ +/*! + * \file CDataDrivenFluid.hpp + * \brief Defines a template fluid model class using multilayer perceptrons + * for theromodynamic state definition + * \author E.C.Bunschoten + * \version 8.0.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include +#include "../../../Common/include/containers/CLookUpTable.hpp" +#if defined(HAVE_MLPCPP) +#define MLP_CUSTOM_TYPE su2double +#include "../../../subprojects/MLPCpp/include/CLookUp_ANN.hpp" +#define USE_MLPCPP +#endif +#include "CFluidModel.hpp" + +/*! + * \class CDataDrivenFluid + * \brief Template class for fluid model definition using multi-layer perceptrons for + * fluid dynamic state definition. + * \author: E.C.Bunschoten. + */ +class CDataDrivenFluid final : public CFluidModel { + protected: + int rank{MASTER_NODE}; /*!< \brief MPI Rank. */ + ENUM_DATADRIVEN_METHOD Kind_DataDriven_Method = + ENUM_DATADRIVEN_METHOD::LUT; /*!< \brief Interpolation method for data set evaluation. */ + + string varname_rho, /*!< \brief Controlling variable name for density. */ + varname_e; /*!< \brief Controlling variable name for static energy. */ + + size_t idx_rho, /*!< \brief Interpolator index for density input. */ + idx_e; /*!< \brief Interpolator index for energy input. */ + + su2double Newton_Relaxation, /*!< \brief Relaxation factor for Newton solvers. */ + rho_start, /*!< \brief Starting value for the density in Newton solver processes. */ + e_start, /*!< \brief Starting value for the energy in Newton solver processes. */ + Newton_Tolerance, /*!< \brief Normalized tolerance for Newton solvers. */ + rho_min, rho_max, /*!< \brief Minimum and maximum density values in data set. */ + e_min, e_max; /*!< \brief Minimum and maximum energy values in data set. */ + + unsigned long MaxIter_Newton; /*!< \brief Maximum number of iterations for Newton solvers. */ + + su2double dsde_rho, /*!< \brief Entropy derivative w.r.t. density. */ + dsdrho_e, /*!< \brief Entropy derivative w.r.t. static energy. */ + d2sde2, /*!< \brief Entropy second derivative w.r.t. static energy. */ + d2sdedrho, /*!< \brief Entropy second derivative w.r.t. density and static energy. */ + d2sdrho2; /*!< \brief Entropy second derivative w.r.t. static density. */ + + su2double R_idealgas, /*!< \brief Approximated ideal gas constant. */ + Cp_idealgas, /*!< \brief Approximated ideal gas specific heat at constant pressure. */ + gamma_idealgas, /*!< \brief Approximated ideal gas specific heat ratio. */ + Cv_idealgas, /*!< \brief Approximated ideal gas specific heat at constant volume. */ + P_middle, /*!< \brief Pressure computed from the centre of the data set. */ + T_middle; /*!< \brief Temperature computed from the centre of the data set. */ + + su2double Enthalpy, /*!< \brief Fluid enthalpy value [J kg^-1] */ + dhdrho_e, /*!< \brief Enthalpy derivative w.r.t. density. */ + dhde_rho; /*!< \brief Enthalpy derivative w.r.t. static energy. */ + + vector input_names_rhoe, /*!< \brief Data-driven method input variable names of the independent variables + (density, energy). */ + output_names_rhoe; /*!< \brief Output variable names listed in the data-driven method input file name. */ + + vector outputs_rhoe; /*!< \brief Pointers to output variables. */ + + /*--- Class variables for the multi-layer perceptron method ---*/ +#ifdef USE_MLPCPP + MLPToolbox::CLookUp_ANN* lookup_mlp; /*!< \brief Multi-layer perceptron collection. */ + MLPToolbox::CIOMap* iomap_rhoe; /*!< \brief Input-output map. */ +#endif + vector MLP_inputs; /*!< \brief Inputs for the multi-layer perceptron look-up operation. */ + + CLookUpTable* lookup_table; /*!< \brief Look-up table regression object. */ + + unsigned long outside_dataset, /*!< \brief Density-energy combination lies outside data set. */ + nIter_Newton; /*!< \brief Number of Newton solver iterations. */ + + /*! + * \brief Map dataset variables to specific look-up operations. + */ + void MapInputs_to_Outputs(); + + /*! + * \brief Evaluate dataset through multi-layer perceptron. + * \param[in] rho - Density value. + * \param[in] e - Static energy value. + * \return Query point lies outside MLP normalization range (0 is inside, 1 is outside). + */ + unsigned long Predict_MLP(su2double rho, su2double e); + + /*! + * \brief Evaluate dataset through look-up table. + * \param[in] rho - Density value. + * \param[in] e - Static energy value. + * \return Query point lies outside table data range (0 is inside, 1 is outside). + */ + unsigned long Predict_LUT(su2double rho, su2double e); + + /*! + * \brief Evaluate the data set. + * \param[in] rho - Density value. + * \param[in] e - Static energy value. + */ + void Evaluate_Dataset(su2double rho, su2double e); + + /*! + * \brief 2D Newton solver for computing the density and energy corresponding to Y1_target and Y2_target. + * \param[in] Y1_target - Target value for output quantity 1. + * \param[in] Y2_target - Target value for output quantity 2. + * \param[in] Y1 - Pointer to output quantity 1. + * \param[in] Y2 - Pointer to output quantity 2. + * \param[in] dY1drho - Pointer to the partial derivative of quantity 1 w.r.t. density at constant energy. + * \param[in] dY1de - Pointer to the partial derivative of quantity 1 w.r.t. energy at constant density. + * \param[in] dY2drho - Pointer to the partial derivative of quantity 2 w.r.t. density at constant energy. + * \param[in] dY2de - Pointer to the partial derivative of quantity 2 w.r.t. energy at constant density. + */ + void Run_Newton_Solver(su2double Y1_target, su2double Y2_target, su2double* Y1, su2double* Y2, su2double* dY1drho, + su2double* dY1de, su2double* dY2drho, su2double* dY2de); + + /*! + * \brief 1D Newton solver for computing the density or energy corresponding to Y_target. + * \param[in] Y_target - Target quantity value. + * \param[in] Y - Pointer to output quantity. + * \param[in] X - Pointer to controlling variable (density or energy). + * \param[in] dYdX - Pointer to the partial derivative of target quantity w.r.t. controlling variable. + */ + void Run_Newton_Solver(su2double Y_target, su2double* Y, su2double* X, su2double* dYdX); + + void ComputeIdealGasQuantities(); + public: + /*! + * \brief Constructor of the class. + */ + CDataDrivenFluid(const CConfig* config, bool display = true); + + ~CDataDrivenFluid(); + /*! + * \brief Set the Dimensionless State using Density and Internal Energy. + * \param[in] rho - first thermodynamic variable (density). + * \param[in] e - second thermodynamic variable (static energy). + */ + void SetTDState_rhoe(su2double rho, su2double e) override; + + /*! + * \brief Set the Dimensionless State using Pressure and Temperature. + * \param[in] P - first thermodynamic variable (pressure). + * \param[in] T - second thermodynamic variable (temperature). + */ + void SetTDState_PT(su2double P, su2double T) override; + + /*! + * \brief Set the Dimensionless State using Pressure and Density. + * \param[in] P - first thermodynamic variable (pressure). + * \param[in] rho - second thermodynamic variable (density). + */ + void SetTDState_Prho(su2double P, su2double rho) override; + + /*! + * \brief Set the Dimensionless Internal Energy using Pressure and Density. + * \param[in] P - first thermodynamic variable (pressure). + * \param[in] rho - second thermodynamic variable (density). + */ + void SetEnergy_Prho(su2double P, su2double rho) override; + + /*! + * \brief Set the Dimensionless Internal Energy using Pressure and Density. + * \param[in] rho - second thermodynamic variable (density). + */ + void SetTDState_rhoT(su2double rho, su2double T) override; + + /*! + * \brief Set the Dimensionless State using Enthalpy and Entropy. + * \param[in] h - first thermodynamic variable (h). + * \param[in] s - second thermodynamic variable (s). + */ + void SetTDState_hs(su2double h, su2double s) override; + + /*! + * \brief Set the Dimensionless State using Pressure and Entropy. + * \param[in] P - first thermodynamic variable (P). + * \param[in] s - second thermodynamic variable (s). + */ + void SetTDState_Ps(su2double P, su2double s) override; + + /*! + * \brief Get fluid model extrapolation instance. + * \return Query point lies outside fluid model data range. + */ + unsigned long GetExtrapolation() const override { return outside_dataset; } + + /*! + * \brief Get number of Newton solver iterations. + * \return Newton solver iteration count at termination. + */ + unsigned long GetnIter_Newton() override { return nIter_Newton; } +}; diff --git a/SU2_CFD/include/fluid/CDiffusivityModel.hpp b/SU2_CFD/include/fluid/CDiffusivityModel.hpp index 413c970a1e2..b02b7ea95e0 100644 --- a/SU2_CFD/include/fluid/CDiffusivityModel.hpp +++ b/SU2_CFD/include/fluid/CDiffusivityModel.hpp @@ -2,7 +2,7 @@ * \file CDiffusivityModel.hpp * \brief Interface class for defining mass diffusivity models. * \author T. Economon, C. Morales - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -46,8 +46,7 @@ class CDiffusivityModel { /*! * \brief Set mass diffusivity */ - virtual void SetDiffusivity(su2double T, su2double rho, su2double mu_lam, su2double mu_turb, su2double cp, - su2double kt) = 0; + virtual void SetDiffusivity(su2double rho, su2double mu_lam, su2double cp, su2double kt) = 0; protected: su2double diff_{0.0}; /*!< \brief mass diffusivity. */ diff --git a/SU2_CFD/include/fluid/CFluidFlamelet.hpp b/SU2_CFD/include/fluid/CFluidFlamelet.hpp new file mode 100644 index 00000000000..9520a432a44 --- /dev/null +++ b/SU2_CFD/include/fluid/CFluidFlamelet.hpp @@ -0,0 +1,130 @@ +/*! + * \file CFluidFlamelet.hpp + * \brief Defines the flamelet fluid model + * \author D. Mayer, T. Economon, N. Beishuizen, E. Bunschoten + * \version 8.0.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "../../Common/include/containers/CLookUpTable.hpp" +#if defined(HAVE_MLPCPP) +#define MLP_CUSTOM_TYPE su2double +#include "../../../subprojects/MLPCpp/include/CLookUp_ANN.hpp" +#define USE_MLPCPP +#endif +#include "CFluidModel.hpp" + +class CFluidFlamelet final : public CFluidModel { + private: + ENUM_DATADRIVEN_METHOD Kind_DataDriven_Method = + ENUM_DATADRIVEN_METHOD::LUT; /*!< \brief Interpolation method for data set evaluation. */ + + enum LOOKUP_TD { TEMPERATURE, HEATCAPACITY, VISCOSITY, CONDUCTIVITY, DIFFUSIONCOEFFICIENT, MOLARWEIGHT, SIZE }; + + int rank; + + bool include_mixture_fraction = false; /*!< \brief include mixture fraction in controlling variables. */ + + unsigned short n_scalars, n_lookups, n_user_scalars, /*!< \brief number of passive reactant species. */ + n_control_vars; /*!< \brief number of controlling variables. */ + + unsigned long extrapolation; + + INC_DENSITYMODEL density_model; + vector controlling_variable_names, passive_specie_names; + vector table_scalar_names; /*!< \brief vector to store names of scalar variables. */ + + su2double mass_diffusivity, /*!< \brief local mass diffusivity of the mixture */ + molar_weight; /*!< \brief local molar weight of the mixture */ + + CLookUpTable* look_up_table; + + /*--- Class variables for the multi-layer perceptron method ---*/ +#ifdef USE_MLPCPP + MLPToolbox::CLookUp_ANN* lookup_mlp; /*!< \brief Multi-layer perceptron collection. */ + MLPToolbox::CIOMap* iomap_TD; /*!< \brief Input-output map for thermochemical properties. */ + MLPToolbox::CIOMap* iomap_Sources; /*!< \brief Input-output map for species source terms. */ + MLPToolbox::CIOMap* iomap_LookUp; /*!< \brief Input-output map for passive look-up terms. */ + MLPToolbox::CIOMap* iomap_Current; +#endif + + vector scalars_vector; + + vector varnames_TD, /*!< \brief Lookup names for thermodynamic state variables. */ + varnames_Sources, varnames_LookUp; + + vector val_vars_TD, /*!< \brief References to thermodynamic state variables. */ + val_vars_Sources, val_vars_LookUp; + + void PreprocessLookUp(CConfig* config); + + public: + CFluidFlamelet(CConfig* config, su2double value_pressure_operating); + + ~CFluidFlamelet(); + + /*! + * \brief Set the thermodynamic state. + * \param[in] val_temperature - temperature + * \param[in] val_scalars - pointer to species mass fractions + */ + void SetTDState_T(su2double val_temperature, const su2double* val_scalars = nullptr) override; + + /*! + * \brief Evaluate the flamelet manifold. + * \param[in] input_scalar - scalar solution. + * \param[in] input_varnames - names of variables to evaluate. + * \param[in] output_refs - output data. + * \param[out] Extrapolation - scalar solution is within bounds (0) or out of bounds (1). + */ + inline unsigned long EvaluateDataSet(const vector& input_scalar, unsigned short lookup_type, + vector& output_refs) override; + + /*! + * \brief Check for out-of-bounds condition for data set interpolation. + * \return - within bounds (0) or out of bounds (1). + */ + unsigned long GetExtrapolation() const override { return extrapolation; } + + /*! + * \brief Get the mass diffusivity of the species. + * \param[in] iVar - index to the species + * \param[out] mass_diffusivity - value of the mass diffusivity + */ + inline su2double GetMassDiffusivity(int iVar) override { return mass_diffusivity; } + + /*! + * \brief Get the thermal conductivity of the species. + * \param[in] iVar - index to the species + * \param[out] Kt - value of the thermal conductivity + */ + inline su2double GetThermalConductivity() override { return Kt; } + + /*! + * \brief Get the laminar viscosity of the species. + * \param[in] iVar - index to the species + * \param[out] Mu - value of the laminar viscosity + */ + inline su2double GetLaminarViscosity() override { return Mu; } +}; diff --git a/SU2_CFD/include/fluid/CFluidModel.hpp b/SU2_CFD/include/fluid/CFluidModel.hpp index ba52958f3a9..682e4366b49 100644 --- a/SU2_CFD/include/fluid/CFluidModel.hpp +++ b/SU2_CFD/include/fluid/CFluidModel.hpp @@ -2,7 +2,7 @@ * \file CFluidModel.hpp * \brief Defines the main fluid model class for thermophysical properties. * \author S. Vitale, G. Gori, M. Pini, A. Guardone, P. Colonna, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -38,6 +38,7 @@ using namespace std; +class CLookUpTable; /*! * \class CFluidModel * \brief Main class for defining the Thermo-Physical Model @@ -137,6 +138,17 @@ class CFluidModel { */ su2double GetCv() const { return Cv; } + /*! + * \brief Flamelet LUT - Get the number of transported scalars. + */ + virtual inline unsigned short GetNScalars() const { return 0; } + + /*! + * \brief Evaluate data manifold for flamelet or data-driven fluid problems. + * \param[in] input - input data for manifold regression. + */ + virtual unsigned long EvaluateDataSet(const vector &input_scalar, unsigned short lookup_type, vector &output_refs) { return 0; } + /*! * \brief Get fluid dynamic viscosity. */ @@ -163,7 +175,7 @@ class CFluidModel { * \brief Get fluid mass diffusivity. */ inline virtual su2double GetMassDiffusivity(int iVar) { - MassDiffusivity->SetDiffusivity(Temperature, Density, Mu, Mu_Turb, Cp, Kt); + MassDiffusivity->SetDiffusivity(Density, Mu, Cp, Kt); mass_diffusivity = MassDiffusivity->GetDiffusivity(); return mass_diffusivity; } @@ -319,10 +331,22 @@ class CFluidModel { * \brief Virtual member. * \param[in] T - Temperature value at the point. */ - virtual void SetTDState_T(su2double val_Temperature, const su2double* val_scalars = nullptr) {} + virtual void SetTDState_T(su2double val_Temperature, const su2double* val_scalars = nullptr) { } /*! * \brief Set fluid eddy viscosity provided by a turbulence model needed for computing effective thermal conductivity. */ void SetEddyViscosity(su2double val_Mu_Turb) { Mu_Turb = val_Mu_Turb; } + + /*! + * \brief Get fluid model extrapolation instance + * \return Query point lies outside fluid model data range. + */ + virtual unsigned long GetExtrapolation() const { return 0; } + + /*! + * \brief Get number of Newton solver iterations. + * \return Newton solver iteration count at termination. + */ + virtual unsigned long GetnIter_Newton() { return 0; } }; diff --git a/SU2_CFD/include/fluid/CFluidScalar.hpp b/SU2_CFD/include/fluid/CFluidScalar.hpp index 37456084f44..d530de01f35 100644 --- a/SU2_CFD/include/fluid/CFluidScalar.hpp +++ b/SU2_CFD/include/fluid/CFluidScalar.hpp @@ -2,7 +2,7 @@ * \file CFluidScalar.hpp * \brief Defines the multicomponent incompressible Ideal Gas model for mixtures. * \author T. Economon, Mark Heimgartner, Cristopher Morales Ubal - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -44,6 +44,7 @@ class CFluidScalar final : public CFluidModel { const su2double Gamma; /*!< \brief Ratio of specific heats of the gas. */ const su2double Pressure_Thermodynamic; /*!< \brief Constant pressure thermodynamic. */ const su2double GasConstant_Ref; /*!< \brief Gas constant reference needed for Nondimensional problems. */ + const su2double Prandtl_Number; /*!< \brief Prandlt number.*/ const bool wilke; const bool davidson; @@ -96,6 +97,11 @@ class CFluidScalar final : public CFluidModel { */ su2double ComputeGasConstant(); + /*! + * \brief Compute mass diffusivity for species. + */ + void ComputeMassDiffusivity(); + public: /*! * \brief Constructor of the class. @@ -125,12 +131,12 @@ class CFluidScalar final : public CFluidModel { /*! * \brief Get fluid thermal conductivity. */ - inline su2double GetThermalConductivity() override { return Kt; } + inline su2double GetThermalConductivity() override { return Kt + Mu_Turb * Cp / Prandtl_Number; } /*! * \brief Get fluid mass diffusivity. */ - inline su2double GetMassDiffusivity(int ivar) override; + inline su2double GetMassDiffusivity(int ivar) override { return massDiffusivity[ivar]; } /*! * \brief Set the Dimensionless State using Temperature. diff --git a/SU2_CFD/include/fluid/CIdealGas.hpp b/SU2_CFD/include/fluid/CIdealGas.hpp index be28ee4dfd9..de6044961a7 100644 --- a/SU2_CFD/include/fluid/CIdealGas.hpp +++ b/SU2_CFD/include/fluid/CIdealGas.hpp @@ -2,7 +2,7 @@ * \file CIdealGas.hpp * \brief Defines the ideal gas model. * \author S. Vitale, G. Gori, M. Pini, A. Guardone, P. Colonna - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CIncIdealGas.hpp b/SU2_CFD/include/fluid/CIncIdealGas.hpp index f7a7bc7c241..2b51afc3f45 100644 --- a/SU2_CFD/include/fluid/CIncIdealGas.hpp +++ b/SU2_CFD/include/fluid/CIncIdealGas.hpp @@ -2,7 +2,7 @@ * \file CIncIdealGas.hpp * \brief Defines the incompressible Ideal Gas model. * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp b/SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp index 1d19436c404..8c7ab29bb66 100644 --- a/SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp +++ b/SU2_CFD/include/fluid/CIncIdealGasPolynomial.hpp @@ -2,7 +2,7 @@ * \file CIncIdealGasPolynomial.hpp * \brief Defines the incompressible Ideal Gas model with polynomial Cp. * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CMutationTCLib.hpp b/SU2_CFD/include/fluid/CMutationTCLib.hpp index 3fb90dd7886..071658e50ce 100644 --- a/SU2_CFD/include/fluid/CMutationTCLib.hpp +++ b/SU2_CFD/include/fluid/CMutationTCLib.hpp @@ -2,7 +2,7 @@ * \file CMutationTCLib.hpp * \brief Defines the class for the link to Mutation++ ThermoChemistry library. * \author C. Garbacz - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CNEMOGas.hpp b/SU2_CFD/include/fluid/CNEMOGas.hpp index f8a17a600bf..038ce2ca6b3 100644 --- a/SU2_CFD/include/fluid/CNEMOGas.hpp +++ b/SU2_CFD/include/fluid/CNEMOGas.hpp @@ -2,7 +2,7 @@ * \file CNEMOGas.hpp * \brief Defines the nonequilibrium gas model. * \author C. Garbacz, W. Maier, S. R. Copeland - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CPengRobinson.hpp b/SU2_CFD/include/fluid/CPengRobinson.hpp index 5ae07b2cbd6..cdd836d835e 100644 --- a/SU2_CFD/include/fluid/CPengRobinson.hpp +++ b/SU2_CFD/include/fluid/CPengRobinson.hpp @@ -2,7 +2,7 @@ * \file CPengRobinson.hpp * \brief Defines the Peng-Robinson model. * \author S. Vitale, G. Gori, M. Pini, A. Guardone, P. Colonna - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CPolynomialConductivity.hpp b/SU2_CFD/include/fluid/CPolynomialConductivity.hpp index 242893818d3..2b016e39f69 100644 --- a/SU2_CFD/include/fluid/CPolynomialConductivity.hpp +++ b/SU2_CFD/include/fluid/CPolynomialConductivity.hpp @@ -2,7 +2,7 @@ * \file CPolynomialConductivity.hpp * \brief Defines a non-constant laminar thermal conductivity using a polynomial function of temperature. * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CPolynomialConductivityRANS.hpp b/SU2_CFD/include/fluid/CPolynomialConductivityRANS.hpp index 1671944faf1..a58587a4a74 100644 --- a/SU2_CFD/include/fluid/CPolynomialConductivityRANS.hpp +++ b/SU2_CFD/include/fluid/CPolynomialConductivityRANS.hpp @@ -3,7 +3,7 @@ * \brief Defines a non-constant thermal conductivity using a polynomial function of temperature * for RANS problems with the addition of a turbulent component based on a turbulent Prandtl number. * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CPolynomialViscosity.hpp b/SU2_CFD/include/fluid/CPolynomialViscosity.hpp index 6099de8442d..7742458c163 100644 --- a/SU2_CFD/include/fluid/CPolynomialViscosity.hpp +++ b/SU2_CFD/include/fluid/CPolynomialViscosity.hpp @@ -2,7 +2,7 @@ * \file CPolynomialViscosity.hpp * \brief Defines a laminar viscosity model as a polynomial function of temperature. * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CSU2TCLib.hpp b/SU2_CFD/include/fluid/CSU2TCLib.hpp index f0db983bc20..3200ab9554e 100644 --- a/SU2_CFD/include/fluid/CSU2TCLib.hpp +++ b/SU2_CFD/include/fluid/CSU2TCLib.hpp @@ -2,7 +2,7 @@ * \file CSU2TCLib.hpp * \brief Defines the classes for different user defined ThermoChemistry libraries. * \author C. Garbacz, W. Maier, S. R. Copeland - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -70,6 +70,24 @@ class CSU2TCLib : public CNEMOGas { std::array Sk_ref; /*!< \brief Vector containing Sutherland's constant for thermal conductivities */ const su2double T_ref_suth = 273.15; /*!<\brief Reference temperature for Sutherland's model [K] */ + + // Coulomb potential constant values source: Scalabrin, NUMERICAL SIMULATION OF WEAKLY IONIZED HYPERSONIC + // FLOW OVER REENTRY CAPSULES, 2007. + /*--- Attractive Coulombic potential constants ---*/ + const su2double D1_a = 0.784; + const su2double C1_a = -0.476; + const su2double c1_a = 0.0313; + const su2double D2_a = 1.262; + const su2double C2_a = -0.146; + const su2double c2_a = 0.0377; + + /*--- Repulsive Coulombic potential constants ---*/ + const su2double D1_r = 0.765; + const su2double C1_r = 0.138; + const su2double c1_r = 0.0106; + const su2double D2_r = 1.235; + const su2double C2_r = 0.157; + const su2double c2_r = 0.0274; su2activematrix CharElTemp, /*!< \brief Characteristic temperature of electron states. */ ElDegeneracy, /*!< \brief Degeneracy of electron states. */ @@ -77,8 +95,8 @@ class CSU2TCLib : public CNEMOGas { Blottner, /*!< \brief Blottner viscosity coefficients */ Dij; /*!< \brief Binary diffusion coefficients. */ - C3DDoubleMatrix Omega00, /*!< \brief Collision integrals (Omega(0,0)) */ - Omega11; /*!< \brief Collision integrals (Omega(1,1)) */ + C3DDoubleMatrix Omega11, /*!< \brief Collision integrals (Omega^(1,1)) */ + Omega22; /*!< \brief Collision integrals (Omega^(2,2)) */ /*--- Implicit variables ---*/ su2double /*!< \brief Derivatives w.r.t. conservative variables */ @@ -249,6 +267,29 @@ class CSU2TCLib : public CNEMOGas { */ void ThermalConductivitiesSuth(); + /*! + *\brief Compute the collision terms (deltas) + *\param[in] iSpecies - Species of gas + *\param[in] jSpecies - Collision partner of species i + *\param[in] Mi - Molar mass of species i + *\param[in] Mj - Molar mass of species j + *\param[in] T - Temperature of gas + *\param[in] d1 - Whether delta_1 or delta_2 is computed + *\param[out] Delta_1 or Delta_2 - Collision term between species i and j + */ + su2double ComputeCollisionDelta(unsigned iSpecies, unsigned jSpecies, su2double Mi, su2double Mj, su2double T, bool d1); + + /*! + *\brief Compute the collision cross section + *\param[in] iSpecies - Species of gas + *\param[in] jSpecies - Collision partner of species i + *\param[in] T - Temperature of gas + *\param[in] d1 - Whether omega^(1,1) or omega^(2,2) + *\param[in] coulomb - Whether to use Coulomb potential + *\param[out] Omega_ij - collision cross section + */ + su2double ComputeCollisionCrossSection(unsigned iSpecies, unsigned jSpecies, su2double T, bool d1, bool coulomb); + /*! * \brief Get reference temperature. */ diff --git a/SU2_CFD/include/fluid/CSutherland.hpp b/SU2_CFD/include/fluid/CSutherland.hpp index ff9c16f3c3a..74050242138 100644 --- a/SU2_CFD/include/fluid/CSutherland.hpp +++ b/SU2_CFD/include/fluid/CSutherland.hpp @@ -2,7 +2,7 @@ * \file CSutherland.hpp * \brief Defines Sutherland's Law for laminar viscosity. * \author S. Vitale, M. Pini, G. Gori, A. Guardone, P. Colonna, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CVanDerWaalsGas.hpp b/SU2_CFD/include/fluid/CVanDerWaalsGas.hpp index 121d5befc10..83279025158 100644 --- a/SU2_CFD/include/fluid/CVanDerWaalsGas.hpp +++ b/SU2_CFD/include/fluid/CVanDerWaalsGas.hpp @@ -2,7 +2,7 @@ * \file CVanDerWaalsGas.hpp * \brief Declaration of the Polytropic Van der Waals model. * \author S. Vitale, G. Gori, M. Pini, A. Guardone, P. Colonna - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/fluid/CViscosityModel.hpp b/SU2_CFD/include/fluid/CViscosityModel.hpp index 41fb37164bd..cc5c46541be 100644 --- a/SU2_CFD/include/fluid/CViscosityModel.hpp +++ b/SU2_CFD/include/fluid/CViscosityModel.hpp @@ -2,7 +2,7 @@ * \file CViscosityModel.hpp * \brief Interface class for defining laminar viscosity models. * \author S. Vitale, M. Pini, G. Gori, A. Guardone, P. Colonna, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp b/SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp index 23543a63e3c..d2e3762997f 100644 --- a/SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp +++ b/SU2_CFD/include/gradients/computeGradientsGreenGauss.hpp @@ -4,7 +4,7 @@ * \note This allows the same implementation to be used for conservative * and primitive variables of any solver. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/gradients/computeGradientsLeastSquares.hpp b/SU2_CFD/include/gradients/computeGradientsLeastSquares.hpp index 62a46cfab7e..da6b6f08327 100644 --- a/SU2_CFD/include/gradients/computeGradientsLeastSquares.hpp +++ b/SU2_CFD/include/gradients/computeGradientsLeastSquares.hpp @@ -3,7 +3,7 @@ * \brief Generic implementation of Least-Squares gradient computation. * \note This allows the same implementation to be used for conservative * and primitive variables of any solver. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/integration/CFEM_DG_Integration.hpp b/SU2_CFD/include/integration/CFEM_DG_Integration.hpp index ae78b4be5fa..b0679c118b0 100644 --- a/SU2_CFD/include/integration/CFEM_DG_Integration.hpp +++ b/SU2_CFD/include/integration/CFEM_DG_Integration.hpp @@ -2,7 +2,7 @@ * \file CFEM_DG_Integration.hpp * \brief Declaration of class for integration with the FEM DG solver. * \author E. van der Weide, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -32,7 +32,7 @@ * \ingroup Drivers * \brief Class for integration with the FEM DG solver. * \author E. van der Weide, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CFEM_DG_Integration final : public CIntegration { public: diff --git a/SU2_CFD/include/integration/CIntegration.hpp b/SU2_CFD/include/integration/CIntegration.hpp index a8908178aaf..29538908d4f 100644 --- a/SU2_CFD/include/integration/CIntegration.hpp +++ b/SU2_CFD/include/integration/CIntegration.hpp @@ -2,7 +2,7 @@ * \file CIntegration.hpp * \brief Declaration of the main routines to orchestrate space and time integration. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -48,9 +48,6 @@ class CIntegration { protected: int rank, /*!< \brief MPI Rank. */ size; /*!< \brief MPI Size. */ - bool Convergence, /*!< \brief To indicate if the flow solver (direct, adjoint, or linearized) has converged or not. */ - Convergence_FSI, /*!< \brief To indicate if the FSI problem has converged or not. */ - Convergence_FullMG; /*!< \brief To indicate if the full multigrid has converged or not. */ /*! * \brief Do the space integration of the numerical system. @@ -88,41 +85,6 @@ class CIntegration { */ virtual ~CIntegration(void) = default; - /*! - * \brief Get the indicator of the convergence for the direct, adjoint and linearized problem. - * \return TRUE means that the convergence criteria is satisfied; - * otherwise FALSE. - */ - inline bool GetConvergence(void) const { return Convergence; } - - /*! - * \brief Get the indicator of the convergence for the Fluid-Structure Interaction problem. - * \return TRUE means that the convergence criteria is satisfied; - * otherwise FALSE. - */ - inline bool GetConvergence_FSI(void) const { return Convergence_FSI; } - - /*! - * \brief Set the indicator of the convergence. - * \param[in] value - TRUE means that the convergence criteria is satisfied; - * otherwise FALSE. - */ - inline void SetConvergence(bool value) { Convergence = value; } - - /*! - * \brief Set the indicator of the convergence for FSI. - * \param[in] valueFSI - TRUE means that the convergence criteria for FSI is satisfied; - * otherwise FALSE. - */ - inline void SetConvergence_FSI(bool valueFSI) { Convergence_FSI = valueFSI; } - - /*! - * \brief Get the indicator of the convergence for the full multigrid problem. - * \return TRUE means that the convergence criteria is satisfied; - * otherwise FALSE. - */ - inline bool GetConvergence_FullMG(void) const { return Convergence_FullMG; } - /*! * \brief Save the geometry at different time steps. * \param[in] geometry - Geometrical definition of the problem. diff --git a/SU2_CFD/include/integration/CIntegrationFactory.hpp b/SU2_CFD/include/integration/CIntegrationFactory.hpp index 98e45f4fee1..908b0497aef 100644 --- a/SU2_CFD/include/integration/CIntegrationFactory.hpp +++ b/SU2_CFD/include/integration/CIntegrationFactory.hpp @@ -2,7 +2,7 @@ * \file CIntegrationFactory.hpp * \brief Headers of the CIntegrationFactory class * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/integration/CMultiGridIntegration.hpp b/SU2_CFD/include/integration/CMultiGridIntegration.hpp index e7745f7e563..16499903961 100644 --- a/SU2_CFD/include/integration/CMultiGridIntegration.hpp +++ b/SU2_CFD/include/integration/CMultiGridIntegration.hpp @@ -2,7 +2,7 @@ * \file CMultiGridIntegration.hpp * \brief Declaration of class for time integration using a multigrid method. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/integration/CNewtonIntegration.hpp b/SU2_CFD/include/integration/CNewtonIntegration.hpp index c76a3140743..c55b667b6a0 100644 --- a/SU2_CFD/include/integration/CNewtonIntegration.hpp +++ b/SU2_CFD/include/integration/CNewtonIntegration.hpp @@ -2,7 +2,7 @@ * \file CNewtonIntegration.hpp * \brief Newton-Krylov integration. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/integration/CSingleGridIntegration.hpp b/SU2_CFD/include/integration/CSingleGridIntegration.hpp index ffc6ecfb070..6a51e11bd80 100644 --- a/SU2_CFD/include/integration/CSingleGridIntegration.hpp +++ b/SU2_CFD/include/integration/CSingleGridIntegration.hpp @@ -2,7 +2,7 @@ * \file CSingleGridIntegration.hpp * \brief Declaration of class for numerical integration of fine grid-only problems. * \author A. Bueno. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/integration/CStructuralIntegration.hpp b/SU2_CFD/include/integration/CStructuralIntegration.hpp index a0edd77c8df..757ddf583e9 100644 --- a/SU2_CFD/include/integration/CStructuralIntegration.hpp +++ b/SU2_CFD/include/integration/CStructuralIntegration.hpp @@ -2,7 +2,7 @@ * \file CStructuralIntegration.hpp * \brief Declaration of class for numerical integration of structural problems. * \author R. Sanchez. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/interfaces/CInterface.hpp b/SU2_CFD/include/interfaces/CInterface.hpp index 49deb7dbe31..7830e091085 100644 --- a/SU2_CFD/include/interfaces/CInterface.hpp +++ b/SU2_CFD/include/interfaces/CInterface.hpp @@ -3,7 +3,7 @@ * \brief Declarations and inlines of the transfer structure. * The subroutines and functions are in the physics folders. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -51,7 +51,7 @@ using namespace std; * \ingroup Interfaces * \brief Main class for defining the physical transfer of information. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CInterface { diff --git a/SU2_CFD/include/interfaces/cfd/CConservativeVarsInterface.hpp b/SU2_CFD/include/interfaces/cfd/CConservativeVarsInterface.hpp index dfc8523a171..43300f1f336 100644 --- a/SU2_CFD/include/interfaces/cfd/CConservativeVarsInterface.hpp +++ b/SU2_CFD/include/interfaces/cfd/CConservativeVarsInterface.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer conservative variables * from a generic zone into another one. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/interfaces/cfd/CMixingPlaneInterface.hpp b/SU2_CFD/include/interfaces/cfd/CMixingPlaneInterface.hpp index de3fe45340a..8eb2ee0aa0f 100644 --- a/SU2_CFD/include/interfaces/cfd/CMixingPlaneInterface.hpp +++ b/SU2_CFD/include/interfaces/cfd/CMixingPlaneInterface.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer average variables * needed for MixingPlane computation from a generic zone into another one. * \author S. Vitale - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/interfaces/cfd/CSlidingInterface.hpp b/SU2_CFD/include/interfaces/cfd/CSlidingInterface.hpp index 1bf80223ebd..d2adc4f21e4 100644 --- a/SU2_CFD/include/interfaces/cfd/CSlidingInterface.hpp +++ b/SU2_CFD/include/interfaces/cfd/CSlidingInterface.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer conservative variables * from a generic zone into another * \author G. Gori Politecnico di Milano - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/interfaces/cht/CConjugateHeatInterface.hpp b/SU2_CFD/include/interfaces/cht/CConjugateHeatInterface.hpp index 9cc42f8d20f..093675bb5dc 100644 --- a/SU2_CFD/include/interfaces/cht/CConjugateHeatInterface.hpp +++ b/SU2_CFD/include/interfaces/cht/CConjugateHeatInterface.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer temperature and heatflux * density for conjugate heat interfaces between structure and fluid zones. * \author O. Burghardt - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/interfaces/fsi/CDiscAdjFlowTractionInterface.hpp b/SU2_CFD/include/interfaces/fsi/CDiscAdjFlowTractionInterface.hpp index d6e86015a83..5959bb91cf2 100644 --- a/SU2_CFD/include/interfaces/fsi/CDiscAdjFlowTractionInterface.hpp +++ b/SU2_CFD/include/interfaces/fsi/CDiscAdjFlowTractionInterface.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer flow tractions * from a fluid zone into a structural zone in a discrete adjoint simulation. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/interfaces/fsi/CDisplacementsInterface.hpp b/SU2_CFD/include/interfaces/fsi/CDisplacementsInterface.hpp index f8388331945..1674a6aeca7 100644 --- a/SU2_CFD/include/interfaces/fsi/CDisplacementsInterface.hpp +++ b/SU2_CFD/include/interfaces/fsi/CDisplacementsInterface.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer boundary displacements * from a structural zone into a fluid zone. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/interfaces/fsi/CFlowTractionInterface.hpp b/SU2_CFD/include/interfaces/fsi/CFlowTractionInterface.hpp index 2074319c110..b0d808a5580 100644 --- a/SU2_CFD/include/interfaces/fsi/CFlowTractionInterface.hpp +++ b/SU2_CFD/include/interfaces/fsi/CFlowTractionInterface.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer flow tractions * from a fluid zone into a structural zone. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -43,8 +43,11 @@ class CFlowTractionInterface : public CInterface { /*! * \brief Sets the dimensional factor for pressure and the consistent_interpolation flag. * \param[in] flow_config - Definition of the fluid (donor) problem. + * \param[in] struct_config - Definition of the structural (target) problem. + * \param[in] geometry - FEA geometry. + * \param[in] solution - FEA solver. */ - void Preprocess(const CConfig *flow_config); + void Preprocess(const CConfig *flow_config, const CConfig *struct_config, CGeometry *geometry, CSolver *solution); /*! * \brief Computes vertex areas (FEA side) for when tractions need to be integrated. diff --git a/SU2_CFD/include/iteration/CAdjFluidIteration.hpp b/SU2_CFD/include/iteration/CAdjFluidIteration.hpp index 685b86400bf..47dca3c765d 100644 --- a/SU2_CFD/include/iteration/CAdjFluidIteration.hpp +++ b/SU2_CFD/include/iteration/CAdjFluidIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/iteration/CDiscAdjFEAIteration.hpp b/SU2_CFD/include/iteration/CDiscAdjFEAIteration.hpp index 86e9073f5ea..9fec0cbd75b 100644 --- a/SU2_CFD/include/iteration/CDiscAdjFEAIteration.hpp +++ b/SU2_CFD/include/iteration/CDiscAdjFEAIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/iteration/CDiscAdjFluidIteration.hpp b/SU2_CFD/include/iteration/CDiscAdjFluidIteration.hpp index 65c37ad3c9b..1e496031f2e 100644 --- a/SU2_CFD/include/iteration/CDiscAdjFluidIteration.hpp +++ b/SU2_CFD/include/iteration/CDiscAdjFluidIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -94,25 +94,6 @@ class CDiscAdjFluidIteration final : public CIteration { void IterateDiscAdj(CGeometry**** geometry, CSolver***** solver, CConfig** config, unsigned short val_iZone, unsigned short val_iInst, bool CrossTerm) override; - /*! - * \brief Updates the containers for the discrete adjoint fluid system. - * \param[in] output - Pointer to the COutput class. - * \param[in] integration - Container vector with all the integration methods. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method (the way in which the equations are solved). - * \param[in] config - Definition of the particular problem. - * \param[in] surface_movement - Surface movement classes of the problem. - * \param[in] grid_movement - Volume grid movement classes of the problem. - * \param[in] FFDBox - FFD FFDBoxes of the problem. - * \param[in] val_iZone - Index of the zone. - * \param[in] val_iInst - Index of the instance - */ - void Update(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver, - CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement, - CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, - unsigned short val_iInst) override; - /*! * \brief Monitors the convergence and other metrics for the discrete adjoint fluid system. * \param[in] output - Pointer to the COutput class. diff --git a/SU2_CFD/include/iteration/CDiscAdjHeatIteration.hpp b/SU2_CFD/include/iteration/CDiscAdjHeatIteration.hpp index c5d0c0c2b02..c2d110ade8b 100644 --- a/SU2_CFD/include/iteration/CDiscAdjHeatIteration.hpp +++ b/SU2_CFD/include/iteration/CDiscAdjHeatIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -88,25 +88,6 @@ class CDiscAdjHeatIteration final : public CIteration { void IterateDiscAdj(CGeometry**** geometry, CSolver***** solver, CConfig** config, unsigned short val_iZone, unsigned short val_iInst, bool CrossTerm) override; - /*! - * \brief Perform a single iteration of the adjoint heat problem. - * \param[in] output - Pointer to the COutput class. - * \param[in] integration - Container vector with all the integration methods. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver - Container vector with all the solutions. - * \param[in] numerics - Description of the numerical method (the way in which the equations are solved). - * \param[in] config - Definition of the particular problem. - * \param[in] surface_movement - Surface movement classes of the problem. - * \param[in] grid_movement - Volume grid movement classes of the problem. - * \param[in] FFDBox - FFD FFDBoxes of the problem. - * \param[in] val_iZone - Index of the zone. - * \param[in] val_iInst - Index of the instance layer. - */ - void Update(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver, - CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement, - CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, - unsigned short val_iInst) override; - /*! * \brief Monitors the convergence and other metrics for the discrete adjoint heat problem. */ diff --git a/SU2_CFD/include/iteration/CFEAIteration.hpp b/SU2_CFD/include/iteration/CFEAIteration.hpp index d5f9a654c45..8a7ff42a40d 100644 --- a/SU2_CFD/include/iteration/CFEAIteration.hpp +++ b/SU2_CFD/include/iteration/CFEAIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -35,7 +35,7 @@ * \ingroup Drivers * \brief Class for driving an iteration of structural analysis. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CFEAIteration : public CIteration { public: diff --git a/SU2_CFD/include/iteration/CFEMFluidIteration.hpp b/SU2_CFD/include/iteration/CFEMFluidIteration.hpp index a2f42b6453c..964ca966250 100644 --- a/SU2_CFD/include/iteration/CFEMFluidIteration.hpp +++ b/SU2_CFD/include/iteration/CFEMFluidIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -35,7 +35,7 @@ * \ingroup Drivers * \brief Class for driving an iteration of the finite element flow system. * \author T. Economon, E. van der Weide - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CFEMFluidIteration : public CFluidIteration { public: diff --git a/SU2_CFD/include/iteration/CFluidIteration.hpp b/SU2_CFD/include/iteration/CFluidIteration.hpp index 6346c716929..c960b635e35 100644 --- a/SU2_CFD/include/iteration/CFluidIteration.hpp +++ b/SU2_CFD/include/iteration/CFluidIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/iteration/CHeatIteration.hpp b/SU2_CFD/include/iteration/CHeatIteration.hpp index 6c548788960..b994521267d 100644 --- a/SU2_CFD/include/iteration/CHeatIteration.hpp +++ b/SU2_CFD/include/iteration/CHeatIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/iteration/CIteration.hpp b/SU2_CFD/include/iteration/CIteration.hpp index eed41a39a15..da807245967 100644 --- a/SU2_CFD/include/iteration/CIteration.hpp +++ b/SU2_CFD/include/iteration/CIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/iteration/CIterationFactory.hpp b/SU2_CFD/include/iteration/CIterationFactory.hpp index 5aa270d0594..271ca8b9e3f 100644 --- a/SU2_CFD/include/iteration/CIterationFactory.hpp +++ b/SU2_CFD/include/iteration/CIterationFactory.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/iteration/CTurboIteration.hpp b/SU2_CFD/include/iteration/CTurboIteration.hpp index ad52aaa04b4..438e23bfd1d 100644 --- a/SU2_CFD/include/iteration/CTurboIteration.hpp +++ b/SU2_CFD/include/iteration/CTurboIteration.hpp @@ -3,7 +3,7 @@ * \brief Headers of the iteration classes used by SU2_CFD. * Each CIteration class represents an available physics package. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/limiters/CLimiterDetails.hpp b/SU2_CFD/include/limiters/CLimiterDetails.hpp index 09f8b34d21e..8311bb31697 100644 --- a/SU2_CFD/include/limiters/CLimiterDetails.hpp +++ b/SU2_CFD/include/limiters/CLimiterDetails.hpp @@ -3,7 +3,7 @@ * \brief A class template that allows defining limiters via * specialization of particular details. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -87,6 +87,36 @@ struct LimiterHelpers Type factor = 0.5*(1.0+dist+sin(PI_NUMBER*dist)/PI_NUMBER); return max(0.0, min(factor, 1.0)); } + + FORCEINLINE static Type r3Function(const Type& proj, const Type& delta, const Type& epsp) + { + Type Dp = fabs(delta); + Type Dm = fabs(proj); + if(Dp>(2.0*Dm)) return 1.0; + Type y = pow(Dp, 3) + epsp; + Type S3 = 4.0*Dm*Dm; + return (y + Dp*S3) / (y + Dm*(delta*delta+S3)); + } + + FORCEINLINE static Type r4Function(const Type& proj, const Type& delta, const Type& epsp) + { + Type Dp = fabs(delta); + Type Dm = fabs(proj); + if(Dp>(2.0*Dm)) return 1.0; + Type y = pow(Dp, 4) + epsp; + Type S4 = 2.0*Dm*(Dp*Dp-2.0*Dm*(Dp-2.0*Dm)); + return (y + Dp*S4) / (y + Dm*(pow(delta,3)+S4)); + } + + FORCEINLINE static Type r5Function(const Type& proj, const Type& delta, const Type& epsp) + { + Type Dp = fabs(delta); + Type Dm = fabs(proj); + if(Dp>(2.0*Dm)) return 1.0; + Type y = pow(Dp, 5) + epsp; + Type S5 = 8.0*Dm*Dm*(Dp*Dp-2.0*Dm*(Dp-Dm)); + return (y + Dp*S5) / (y + Dm*(pow(delta,4)+S5)); + } }; @@ -159,6 +189,119 @@ struct CLimiterDetails }; +/*! + * \brief Nishikawa's R3 limiter specialization. + * \ingroup FvmAlgos + */ +template<> +struct CLimiterDetails +{ + su2double epsp; + + /*! + * \brief Store the reference lenght based eps^3 parameter, + * limited to a small number to avoid divisions by 0. + */ + template + inline void preprocess(CGeometry&, const CConfig& config, Ts&...) + { + su2double L = config.GetRefElemLength(); + su2double K = config.GetVenkat_LimiterCoeff(); + su2double eps1 = fabs(L*K); + epsp = max(pow(eps1, 4), LimiterHelpers<>::epsilon()); + } + + /*! + * \brief No geometric modification for this kind of limiter. + */ + template + inline su2double geometricFactor(Ts&...) const {return 1.0;} + + /*! + * \brief Smooth function that disables limiting in smooth regions. + */ + inline su2double limiterFunction(size_t, su2double proj, su2double delta) const + { + return LimiterHelpers<>::r3Function(proj, delta, epsp); + } +}; + + +/*! + * \brief Nishikawa's R4 limiter specialization. + * \ingroup FvmAlgos + */ +template<> +struct CLimiterDetails +{ + su2double epsp; + + /*! + * \brief Store the reference lenght based eps^4 parameter, + * limited to a small number to avoid divisions by 0. + */ + template + inline void preprocess(CGeometry&, const CConfig& config, Ts&...) + { + su2double L = config.GetRefElemLength(); + su2double K = config.GetVenkat_LimiterCoeff(); + su2double eps1 = fabs(L*K); + epsp = max(pow(eps1, 5), LimiterHelpers<>::epsilon()); + } + + /*! + * \brief No geometric modification for this kind of limiter. + */ + template + inline su2double geometricFactor(Ts&...) const {return 1.0;} + + /*! + * \brief Smooth function that disables limiting in smooth regions. + */ + inline su2double limiterFunction(size_t, su2double proj, su2double delta) const + { + return LimiterHelpers<>::r4Function(proj, delta, epsp); + } +}; + + +/*! + * \brief Nishikawa's R5 limiter specialization. + * \ingroup FvmAlgos + */ +template<> +struct CLimiterDetails +{ + su2double epsp; + + /*! + * \brief Store the reference lenght based eps^5 parameter, + * limited to a small number to avoid divisions by 0. + */ + template + inline void preprocess(CGeometry&, const CConfig& config, Ts&...) + { + su2double L = config.GetRefElemLength(); + su2double K = config.GetVenkat_LimiterCoeff(); + su2double eps1 = fabs(L*K); + epsp = max(pow(eps1, 6), LimiterHelpers<>::epsilon()); + } + + /*! + * \brief No geometric modification for this kind of limiter. + */ + template + inline su2double geometricFactor(Ts&...) const {return 1.0;} + + /*! + * \brief Smooth function that disables limiting in smooth regions. + */ + inline su2double limiterFunction(size_t, su2double proj, su2double delta) const + { + return LimiterHelpers<>::r5Function(proj, delta, epsp); + } +}; + /*! * \brief Venkatakrishnan-Wang specialization. * \ingroup FvmAlgos diff --git a/SU2_CFD/include/limiters/computeLimiters.hpp b/SU2_CFD/include/limiters/computeLimiters.hpp index 3dab84c6c07..f33439d5294 100644 --- a/SU2_CFD/include/limiters/computeLimiters.hpp +++ b/SU2_CFD/include/limiters/computeLimiters.hpp @@ -2,7 +2,7 @@ * \file computeLimiters.hpp * \brief Compute limiters wrapper function. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -82,6 +82,21 @@ if (geometry.GetnDim() == 2) {\ INSTANTIATE(LIMITER::VENKATAKRISHNAN); break; } + case LIMITER::NISHIKAWA_R3: + { + INSTANTIATE(LIMITER::NISHIKAWA_R3); + break; + } + case LIMITER::NISHIKAWA_R4: + { + INSTANTIATE(LIMITER::NISHIKAWA_R4); + break; + } + case LIMITER::NISHIKAWA_R5: + { + INSTANTIATE(LIMITER::NISHIKAWA_R5); + break; + } case LIMITER::VENKATAKRISHNAN_WANG: { INSTANTIATE(LIMITER::VENKATAKRISHNAN_WANG); diff --git a/SU2_CFD/include/limiters/computeLimiters_impl.hpp b/SU2_CFD/include/limiters/computeLimiters_impl.hpp index f683bc5ed77..5cc8007eb00 100644 --- a/SU2_CFD/include/limiters/computeLimiters_impl.hpp +++ b/SU2_CFD/include/limiters/computeLimiters_impl.hpp @@ -4,7 +4,7 @@ * \note Common methods are derived by defining small details * via specialization of CLimiterDetails. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/CGradSmoothing.hpp b/SU2_CFD/include/numerics/CGradSmoothing.hpp index 8213ce959c6..0a07d87ea30 100644 --- a/SU2_CFD/include/numerics/CGradSmoothing.hpp +++ b/SU2_CFD/include/numerics/CGradSmoothing.hpp @@ -2,7 +2,7 @@ * \file CGradSmoothing.hpp * \brief Declarations and inlines of the numerics class for gradient smoothing. * \author T.Dick - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/CNumerics.hpp b/SU2_CFD/include/numerics/CNumerics.hpp index e8682cc8da5..14088f021cd 100644 --- a/SU2_CFD/include/numerics/CNumerics.hpp +++ b/SU2_CFD/include/numerics/CNumerics.hpp @@ -3,7 +3,7 @@ * \brief Declaration of the base numerics class, the * implementation is in the CNumerics.cpp file. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -171,9 +171,7 @@ class CNumerics { su2double vel2_inf; /*!< \brief value of the square of freestream speed. */ const su2double *WindGust_i, /*!< \brief Wind gust at point i. */ - *WindGust_j, /*!< \brief Wind gust at point j. */ - *WindGustDer_i, /*!< \brief Wind gust derivatives at point i. */ - *WindGustDer_j; /*!< \brief Wind gust derivatives at point j. */ + *WindGust_j; /*!< \brief Wind gust at point j. */ const su2double *Vorticity_i, *Vorticity_j; /*!< \brief Vorticity. */ su2double StrainMag_i, StrainMag_j; /*!< \brief Strain rate magnitude. */ su2double Dissipation_i, Dissipation_j; /*!< \brief Dissipation. */ @@ -860,26 +858,6 @@ class CNumerics { GridVel_j = val_gridvel_j; } - /*! - * \brief Set the wind gust value. - * \param[in] val_windgust_i - Wind gust of the point i. - * \param[in] val_windgust_j - Wind gust of the point j. - */ - inline void SetWindGust(const su2double *val_windgust_i, const su2double *val_windgust_j) { - WindGust_i = val_windgust_i; - WindGust_j = val_windgust_j; - } - - /*! - * \brief Set the wind gust derivatives values. - * \param[in] val_windgust_i - Wind gust derivatives of the point i. - * \param[in] val_windgust_j - Wind gust derivatives of the point j. - */ - inline void SetWindGustDer(const su2double *val_windgustder_i, const su2double *val_windgustder_j) { - WindGustDer_i = val_windgustder_i; - WindGustDer_j = val_windgustder_j; - } - /*! * \brief Set the value of the pressure. * \param[in] val_pressure_i - Value of the pressure at point i. diff --git a/SU2_CFD/include/numerics/NEMO/CNEMONumerics.hpp b/SU2_CFD/include/numerics/NEMO/CNEMONumerics.hpp index 3cdf113f633..895ffb304f9 100644 --- a/SU2_CFD/include/numerics/NEMO/CNEMONumerics.hpp +++ b/SU2_CFD/include/numerics/NEMO/CNEMONumerics.hpp @@ -2,7 +2,7 @@ * \file CNEMONumerics.hpp * \brief Base class template NEMO numerics. * \author C. Garbacz, W. Maier, S. R. Copeland - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/NEMO/NEMO_diffusion.hpp b/SU2_CFD/include/numerics/NEMO/NEMO_diffusion.hpp index 5a8a10c128a..9acd5cd9d51 100644 --- a/SU2_CFD/include/numerics/NEMO/NEMO_diffusion.hpp +++ b/SU2_CFD/include/numerics/NEMO/NEMO_diffusion.hpp @@ -2,7 +2,7 @@ * \file NEMO_diffusion.hpp * \brief Declarations of numerics classes for viscous flux computation. * \author S.R. Copeland, W. Maier, C. Garbacz. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \brief Class for computing viscous term using the average of gradients. * \ingroup ViscDiscr * \author S.R. Copeland, W. Maier, C. Garbacz - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CAvgGrad_NEMO : public CNEMONumerics { private: @@ -90,11 +90,11 @@ class CAvgGrad_NEMO : public CNEMONumerics { * \brief Class for computing viscous term using the average of gradients. * \ingroup ViscDiscr * \author C. Garbacz, W. Maier, S.R. Copeland. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CAvgGradCorrected_NEMO : public CNEMONumerics { private: - unsigned short iDim, iVar, + unsigned short nPrimVar, nPrimVarGrad; /*!< \brief Iterators in dimension an variable. */ su2double *Mean_PrimVar, /*!< \brief Mean primitive variables. */ diff --git a/SU2_CFD/include/numerics/NEMO/NEMO_sources.hpp b/SU2_CFD/include/numerics/NEMO/NEMO_sources.hpp index 810be475ef3..df11b67212f 100644 --- a/SU2_CFD/include/numerics/NEMO/NEMO_sources.hpp +++ b/SU2_CFD/include/numerics/NEMO/NEMO_sources.hpp @@ -2,7 +2,7 @@ * \file NEMO_sources.hpp * \brief Declarations of numerics classes for source-term integration. * \author C. Garbacz, W. Maier, S. Copeland. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \brief Class for two-temperature model source terms. * \ingroup SourceDiscr * \author C. Garbacz, W. Maier, S. Copeland. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CSource_NEMO : public CNEMONumerics { private: diff --git a/SU2_CFD/include/numerics/NEMO/convection/ausm_slau.hpp b/SU2_CFD/include/numerics/NEMO/convection/ausm_slau.hpp index ce4216a7ffe..0d01c9a37ad 100644 --- a/SU2_CFD/include/numerics/NEMO/convection/ausm_slau.hpp +++ b/SU2_CFD/include/numerics/NEMO/convection/ausm_slau.hpp @@ -2,7 +2,7 @@ * \file ausm_slau.hpp * \brief Declaration of numerics classes for the AUSM and SLAU family of schemes in NEMO. * \author F. Palacios, S.R. Copeland, W. Maier, C. Garbacz - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/NEMO/convection/lax.hpp b/SU2_CFD/include/numerics/NEMO/convection/lax.hpp index 421fa2d58e2..ccf44fbfafd 100644 --- a/SU2_CFD/include/numerics/NEMO/convection/lax.hpp +++ b/SU2_CFD/include/numerics/NEMO/convection/lax.hpp @@ -2,7 +2,7 @@ * \file lax.hpp * \brief Declaration of numerics classes for Lax centered scheme. * \author F. Palacios, S.R. Copeland, W. Maier, C. Garbacz - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/NEMO/convection/msw.hpp b/SU2_CFD/include/numerics/NEMO/convection/msw.hpp index 5a20de595e6..8968a27ea0a 100644 --- a/SU2_CFD/include/numerics/NEMO/convection/msw.hpp +++ b/SU2_CFD/include/numerics/NEMO/convection/msw.hpp @@ -2,7 +2,7 @@ * \file msw.hpp * \brief Declaration of numerics classes for modified Steger-Warming scheme. * \author ADL Stanford, S.R. Copeland, W. Maier, C. Garbacz - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \brief Class for solving a flux-vector splitting method by Steger & Warming, modified version. * \ingroup ConvDiscr * \author ADL Stanford, S.R. Copeland, W. Maier, C. Garbacz - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CUpwMSW_NEMO : public CNEMONumerics { private: diff --git a/SU2_CFD/include/numerics/NEMO/convection/roe.hpp b/SU2_CFD/include/numerics/NEMO/convection/roe.hpp index d043354c9be..004e0036e08 100644 --- a/SU2_CFD/include/numerics/NEMO/convection/roe.hpp +++ b/SU2_CFD/include/numerics/NEMO/convection/roe.hpp @@ -2,7 +2,7 @@ * \file roe.hpp * \brief Declarations of numerics classes for Roe-type schemes in NEMO. * \author S.R. Copeland, W. Maier, C. Garbacz - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \brief Class for evaluating the Riemann problem using Roe's scheme for a two-temperature model. * \ingroup ConvDiscr * \author S. R. Copeland, W. Maier, C. Garbacz - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CUpwRoe_NEMO : public CNEMONumerics { private: diff --git a/SU2_CFD/include/numerics/continuous_adjoint/adj_convection.hpp b/SU2_CFD/include/numerics/continuous_adjoint/adj_convection.hpp index 0b439dd9d8e..0f619cc3ec3 100644 --- a/SU2_CFD/include/numerics/continuous_adjoint/adj_convection.hpp +++ b/SU2_CFD/include/numerics/continuous_adjoint/adj_convection.hpp @@ -3,7 +3,7 @@ * \brief Declarations of numerics classes for continuous adjoint * convective discretization. Implemented in adj_convection.cpp. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/continuous_adjoint/adj_diffusion.hpp b/SU2_CFD/include/numerics/continuous_adjoint/adj_diffusion.hpp index 3bd89c5f65e..e236a4e1b8b 100644 --- a/SU2_CFD/include/numerics/continuous_adjoint/adj_diffusion.hpp +++ b/SU2_CFD/include/numerics/continuous_adjoint/adj_diffusion.hpp @@ -3,7 +3,7 @@ * \brief Declarations of numerics classes for continuous adjoint * diffusion discretization. Implemented in adj_diffusion.cpp. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/continuous_adjoint/adj_sources.hpp b/SU2_CFD/include/numerics/continuous_adjoint/adj_sources.hpp index 158d7de27df..24b87d49d1a 100644 --- a/SU2_CFD/include/numerics/continuous_adjoint/adj_sources.hpp +++ b/SU2_CFD/include/numerics/continuous_adjoint/adj_sources.hpp @@ -3,7 +3,7 @@ * \brief Declarations of numerics classes for continuous adjoint * source term integration. Implemented in adj_sources.cpp. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/elasticity/CFEAElasticity.hpp b/SU2_CFD/include/numerics/elasticity/CFEAElasticity.hpp index 61ccff82d17..f0f450af2c1 100644 --- a/SU2_CFD/include/numerics/elasticity/CFEAElasticity.hpp +++ b/SU2_CFD/include/numerics/elasticity/CFEAElasticity.hpp @@ -2,7 +2,7 @@ * \file CFEAElasticity.hpp * \brief Declaration and inlines of the base class for elasticity problems. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -38,7 +38,7 @@ * The methods we override in this class with an empty implementation are here just to better * document the public interface of this class hierarchy. * \author R.Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CFEAElasticity : public CNumerics { diff --git a/SU2_CFD/include/numerics/elasticity/CFEALinearElasticity.hpp b/SU2_CFD/include/numerics/elasticity/CFEALinearElasticity.hpp index 0b39730e8de..a874286ae21 100644 --- a/SU2_CFD/include/numerics/elasticity/CFEALinearElasticity.hpp +++ b/SU2_CFD/include/numerics/elasticity/CFEALinearElasticity.hpp @@ -2,7 +2,7 @@ * \file CFEALinearElasticity.hpp * \brief Declaration and inlines of the linear elasticity FE numerics class. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -35,7 +35,7 @@ * \brief Class for computing the stiffness matrix of a linear, elastic problem. * \ingroup Elasticity_Equations * \author R.Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CFEALinearElasticity : public CFEAElasticity { protected: @@ -90,7 +90,7 @@ class CFEALinearElasticity : public CFEAElasticity { * \brief Particular case of linear elasticity used for mesh deformation. * \ingroup Elasticity_Equations * \author R.Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CFEAMeshElasticity final : public CFEALinearElasticity { diff --git a/SU2_CFD/include/numerics/elasticity/CFEANonlinearElasticity.hpp b/SU2_CFD/include/numerics/elasticity/CFEANonlinearElasticity.hpp index f624abf6bf3..4309d9308c3 100644 --- a/SU2_CFD/include/numerics/elasticity/CFEANonlinearElasticity.hpp +++ b/SU2_CFD/include/numerics/elasticity/CFEANonlinearElasticity.hpp @@ -2,7 +2,7 @@ * \file CFEANonlinearElasticity.hpp * \brief Declaration and inlines of the nonlinear elasticity FE numerics class. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -37,7 +37,7 @@ * Compute_Plane_Stress_Term and Compute_Stress_Tensor. * \ingroup Elasticity_Equations * \author R.Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CFEANonlinearElasticity : public CFEAElasticity { diff --git a/SU2_CFD/include/numerics/elasticity/nonlinear_models.hpp b/SU2_CFD/include/numerics/elasticity/nonlinear_models.hpp index 81fc5a7715a..8ff904987d0 100644 --- a/SU2_CFD/include/numerics/elasticity/nonlinear_models.hpp +++ b/SU2_CFD/include/numerics/elasticity/nonlinear_models.hpp @@ -2,7 +2,7 @@ * \file nonlinear_models.hpp * \brief Declarations of nonlinear constitutive models. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -35,7 +35,7 @@ * \brief Class for computing the constitutive and stress tensors for a neo-Hookean material model, compressible. * \ingroup Elasticity_Equations * \author R.Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CFEM_NeoHookean_Comp final : public CFEANonlinearElasticity { @@ -83,7 +83,7 @@ class CFEM_NeoHookean_Comp final : public CFEANonlinearElasticity { * \brief Constitutive and stress tensors for a Knowles stored-energy function, nearly incompressible. * \ingroup Elasticity_Equations * \author R.Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CFEM_Knowles_NearInc final : public CFEANonlinearElasticity { @@ -134,7 +134,7 @@ class CFEM_Knowles_NearInc final : public CFEANonlinearElasticity { * \brief Class for computing the constitutive and stress tensors for a dielectric elastomer. * \ingroup Elasticity_Equations * \author R.Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CFEM_DielectricElastomer final : public CFEANonlinearElasticity { @@ -182,7 +182,7 @@ class CFEM_DielectricElastomer final : public CFEANonlinearElasticity { * \brief Class for computing the constitutive and stress tensors for a nearly-incompressible ideal DE. * \ingroup Elasticity_Equations * \author R.Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CFEM_IdealDE final : public CFEANonlinearElasticity { diff --git a/SU2_CFD/include/numerics/flow/convection/ausm_slau.hpp b/SU2_CFD/include/numerics/flow/convection/ausm_slau.hpp index 1dcefbf237a..5fbc59f5c85 100644 --- a/SU2_CFD/include/numerics/flow/convection/ausm_slau.hpp +++ b/SU2_CFD/include/numerics/flow/convection/ausm_slau.hpp @@ -3,7 +3,7 @@ * \brief Declaration of numerics classes for the AUSM family of schemes, * including SLAU. The implementation is in ausm.cpp. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/flow/convection/centered.hpp b/SU2_CFD/include/numerics/flow/convection/centered.hpp index 3c890b492ce..808ab86bc06 100644 --- a/SU2_CFD/include/numerics/flow/convection/centered.hpp +++ b/SU2_CFD/include/numerics/flow/convection/centered.hpp @@ -3,7 +3,7 @@ * \brief Declaration of numerics classes for centered schemes, * the implementation is in centered.cpp. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/flow/convection/cusp.hpp b/SU2_CFD/include/numerics/flow/convection/cusp.hpp deleted file mode 100644 index 526e0d412f2..00000000000 --- a/SU2_CFD/include/numerics/flow/convection/cusp.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/*! - * \file cusp.hpp - * \brief Declaration of the CUSP numerics class. - * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" - * - * SU2 Project Website: https://su2code.github.io - * - * The SU2 Project is maintained by the SU2 Foundation - * (http://su2foundation.org) - * - * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) - * - * SU2 is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * SU2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with SU2. If not, see . - */ - -#pragma once - -#include "../../CNumerics.hpp" - -/*! - * \class CUpwCUSP_Flow - * \brief Class for centered scheme - CUSP. - * \ingroup ConvDiscr - * \author F. Palacios - */ -class CUpwCUSP_Flow final : public CNumerics { - -private: - su2double Velocity_i[MAXNDIM], Velocity_j[MAXNDIM], *ProjFlux_i, *ProjFlux_j; - bool implicit; - - su2double* Flux; /*!< \brief The flux accross the face. */ - su2double** Jacobian_i; /*!< \brief The Jacobian w.r.t. point i after computation. */ - su2double** Jacobian_j; /*!< \brief The Jacobian w.r.t. point j after computation. */ -public: - - /*! - * \brief Constructor of the class. - * \param[in] val_nDim - Number of dimension of the problem. - * \param[in] val_nVar - Number of variables of the problem. - * \param[in] config - Definition of the particular problem. - */ - CUpwCUSP_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config); - - /*! - * \brief Destructor of the class. - */ - ~CUpwCUSP_Flow(void) override; - - /*! - * \brief Compute the flow residual using a JST method. - * \param[in] config - Definition of the particular problem. - * \return A lightweight const-view (read-only) of the residual/flux and Jacobians. - */ - ResidualType<> ComputeResidual(const CConfig* config) override; - -}; diff --git a/SU2_CFD/include/numerics/flow/convection/fds.hpp b/SU2_CFD/include/numerics/flow/convection/fds.hpp index f5c79c7e648..77d155c8509 100644 --- a/SU2_CFD/include/numerics/flow/convection/fds.hpp +++ b/SU2_CFD/include/numerics/flow/convection/fds.hpp @@ -3,7 +3,7 @@ * \brief Declarations of classes for Flux-Difference-Spliting schemes, * the implementations are in fds.cpp * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/flow/convection/fvs.hpp b/SU2_CFD/include/numerics/flow/convection/fvs.hpp index a509a6fcaea..dd8091fa67b 100644 --- a/SU2_CFD/include/numerics/flow/convection/fvs.hpp +++ b/SU2_CFD/include/numerics/flow/convection/fvs.hpp @@ -3,7 +3,7 @@ * \brief Declarations of classes for Flux-Vector-Spliting schemes, * the implementations are in fvs.cpp. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/flow/convection/hllc.hpp b/SU2_CFD/include/numerics/flow/convection/hllc.hpp index f3e2c6e99ce..5765b566101 100644 --- a/SU2_CFD/include/numerics/flow/convection/hllc.hpp +++ b/SU2_CFD/include/numerics/flow/convection/hllc.hpp @@ -2,7 +2,7 @@ * \file hllc.hpp * \brief Declaration of HLLC numerics classes, implemented in hllc.cpp. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \brief Class for solving an approximate Riemann HLLC. * \ingroup ConvDiscr * \author G. Gori, Politecnico di Milano - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CUpwHLLC_Flow final : public CNumerics { private: @@ -86,7 +86,7 @@ class CUpwHLLC_Flow final : public CNumerics { * \brief Class for solving an approximate Riemann HLLC. * \ingroup ConvDiscr * \author G. Gori, Politecnico di Milano - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CUpwGeneralHLLC_Flow final : public CNumerics { private: diff --git a/SU2_CFD/include/numerics/flow/convection/roe.hpp b/SU2_CFD/include/numerics/flow/convection/roe.hpp index 7b43d1adac3..02c0d6a4236 100644 --- a/SU2_CFD/include/numerics/flow/convection/roe.hpp +++ b/SU2_CFD/include/numerics/flow/convection/roe.hpp @@ -3,7 +3,7 @@ * \brief Declarations of numerics classes for Roe-type schemes, * implemented in roe.cpp. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -119,7 +119,7 @@ class CUpwRoe_Flow final : public CUpwRoeBase_Flow { * \brief Class for solving an approximate Riemann solver of L2Roe for the flow equations. * \ingroup ConvDiscr * \author E. Molina, A. Bueno, F. Palacios, P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CUpwL2Roe_Flow final : public CUpwRoeBase_Flow { private: @@ -149,7 +149,7 @@ class CUpwL2Roe_Flow final : public CUpwRoeBase_Flow { * \brief Class for solving an approximate Riemann solver of LMRoe for the flow equations. * \ingroup ConvDiscr * \author E. Molina, A. Bueno, F. Palacios, P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CUpwLMRoe_Flow final : public CUpwRoeBase_Flow { private: diff --git a/SU2_CFD/include/numerics/flow/flow_diffusion.hpp b/SU2_CFD/include/numerics/flow/flow_diffusion.hpp index ec5da1248a1..4cdcccac404 100644 --- a/SU2_CFD/include/numerics/flow/flow_diffusion.hpp +++ b/SU2_CFD/include/numerics/flow/flow_diffusion.hpp @@ -2,7 +2,7 @@ * \file flow_diffusion.hpp * \brief Declarations of numerics classes for viscous flux computation. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/flow/flow_sources.hpp b/SU2_CFD/include/numerics/flow/flow_sources.hpp index c8efe27d223..39e6bd25d09 100644 --- a/SU2_CFD/include/numerics/flow/flow_sources.hpp +++ b/SU2_CFD/include/numerics/flow/flow_sources.hpp @@ -2,7 +2,7 @@ * \file flow_sources.hpp * \brief Declarations of numerics classes for source-term integration. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -177,7 +177,7 @@ class CSourceBodyForce final : public CSourceBase_Flow { * \brief Class for the source term integration of a body force in the incompressible solver. * \ingroup SourceDiscr * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CSourceIncBodyForce final : public CSourceBase_Flow { su2double Body_Force_Vector[3]; @@ -204,7 +204,7 @@ class CSourceIncBodyForce final : public CSourceBase_Flow { * \brief Class for the source term integration of the Boussinesq approximation for incompressible flow. * \ingroup SourceDiscr * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CSourceBoussinesq final : public CSourceBase_Flow { su2double Gravity_Vector[3]; diff --git a/SU2_CFD/include/numerics/heat.hpp b/SU2_CFD/include/numerics/heat.hpp index 7578a8cb842..5aff4bed14f 100644 --- a/SU2_CFD/include/numerics/heat.hpp +++ b/SU2_CFD/include/numerics/heat.hpp @@ -2,7 +2,7 @@ * \file heat.hpp * \brief Declarations of numerics classes for heat transfer problems. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -36,7 +36,7 @@ * \brief Class for doing a scalar upwind solver for the heat convection equation. * \ingroup ConvDiscr * \author O. Burghardt. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CUpwSca_Heat final : public CUpwScalar> { public: @@ -70,7 +70,7 @@ class CUpwSca_Heat final : public CUpwScalar { public: diff --git a/SU2_CFD/include/numerics/radiation.hpp b/SU2_CFD/include/numerics/radiation.hpp index 92c66dc1004..08adecd8936 100644 --- a/SU2_CFD/include/numerics/radiation.hpp +++ b/SU2_CFD/include/numerics/radiation.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the classes used to compute * residual terms in radiation problems. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/scalar/scalar_convection.hpp b/SU2_CFD/include/numerics/scalar/scalar_convection.hpp index cd629510b13..5c4d7fadf5b 100644 --- a/SU2_CFD/include/numerics/scalar/scalar_convection.hpp +++ b/SU2_CFD/include/numerics/scalar/scalar_convection.hpp @@ -3,7 +3,7 @@ * \brief Declarations of numerics classes for discretization of * convective fluxes in scalar problems. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/scalar/scalar_diffusion.hpp b/SU2_CFD/include/numerics/scalar/scalar_diffusion.hpp index 91b55547251..eb615aed053 100644 --- a/SU2_CFD/include/numerics/scalar/scalar_diffusion.hpp +++ b/SU2_CFD/include/numerics/scalar/scalar_diffusion.hpp @@ -3,7 +3,7 @@ * \brief Declarations of numerics classes for discretization of * viscous fluxes in scalar problems. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/scalar/scalar_sources.hpp b/SU2_CFD/include/numerics/scalar/scalar_sources.hpp index e6caa00b4e2..2505ff6af3b 100644 --- a/SU2_CFD/include/numerics/scalar/scalar_sources.hpp +++ b/SU2_CFD/include/numerics/scalar/scalar_sources.hpp @@ -1,7 +1,7 @@ /*! * \file scalar_sources.hpp * \brief Declarations of numerics classes for integration of source terms in scalar problems. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/species/species_convection.hpp b/SU2_CFD/include/numerics/species/species_convection.hpp index 4f44cd9c451..df210050ed3 100644 --- a/SU2_CFD/include/numerics/species/species_convection.hpp +++ b/SU2_CFD/include/numerics/species/species_convection.hpp @@ -3,7 +3,7 @@ * \brief Declarations of numerics classes for discretization of * convective fluxes in species problems. * \author T. Kattmann - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/species/species_diffusion.hpp b/SU2_CFD/include/numerics/species/species_diffusion.hpp index e100496b135..afe9a93e61f 100644 --- a/SU2_CFD/include/numerics/species/species_diffusion.hpp +++ b/SU2_CFD/include/numerics/species/species_diffusion.hpp @@ -3,7 +3,7 @@ * \brief Declarations of numerics classes for discretization of * viscous fluxes in species problems. * \author T. Kattmann - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -71,8 +71,8 @@ class CAvgGrad_Species final : public CAvgGrad_Scalar { void FinishResidualCalc(const CConfig* config) override { for (auto iVar = 0u; iVar < nVar; iVar++) { - /* --- in case of species transport, Diffusion_Coeff is the binary diffusion coefficient --- */ const su2double Diffusivity_Lam = 0.5 * (Density_i * Diffusion_Coeff_i[iVar] + Density_j * Diffusion_Coeff_j[iVar]); + su2double Diffusivity_Turb = 0.0; if (turbulence) { diff --git a/SU2_CFD/include/numerics/species/species_sources.hpp b/SU2_CFD/include/numerics/species/species_sources.hpp index 7dd564720ef..3c1dd09e596 100644 --- a/SU2_CFD/include/numerics/species/species_sources.hpp +++ b/SU2_CFD/include/numerics/species/species_sources.hpp @@ -3,7 +3,7 @@ * \brief Declarations of numerics classes for integration of source * terms in species problems. * \author T. Kattmann - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -89,4 +89,5 @@ class CSourceAxisymmetric_Species : public CSourceBase_Species { * \return Lightweight const-view of residual and Jacobian. */ ResidualType<> ComputeResidual(const CConfig* config) override; + }; diff --git a/SU2_CFD/include/numerics/template.hpp b/SU2_CFD/include/numerics/template.hpp index e80b696e902..aafe52f0b9e 100644 --- a/SU2_CFD/include/numerics/template.hpp +++ b/SU2_CFD/include/numerics/template.hpp @@ -5,7 +5,7 @@ * new schemes in SU2, in practice you should look for a similar * scheme and try to re-use functionality (not by copy-paste). * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/turbulent/transition/trans_convection.hpp b/SU2_CFD/include/numerics/turbulent/transition/trans_convection.hpp index b9328d43f63..c48c7556e32 100644 --- a/SU2_CFD/include/numerics/turbulent/transition/trans_convection.hpp +++ b/SU2_CFD/include/numerics/turbulent/transition/trans_convection.hpp @@ -3,7 +3,7 @@ * \brief Delarations of numerics classes for discretization of * convective fluxes in transition problems. * \author S. Kang - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/turbulent/transition/trans_correlations.hpp b/SU2_CFD/include/numerics/turbulent/transition/trans_correlations.hpp index 253e35c4dc4..c429ab764d9 100644 --- a/SU2_CFD/include/numerics/turbulent/transition/trans_correlations.hpp +++ b/SU2_CFD/include/numerics/turbulent/transition/trans_correlations.hpp @@ -1,7 +1,7 @@ /*! * \file trans_correlations.hpp * \brief Numerics class for the LM model's correlation functions. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/turbulent/transition/trans_diffusion.hpp b/SU2_CFD/include/numerics/turbulent/transition/trans_diffusion.hpp index d2155a82e93..9a56ccfb82d 100644 --- a/SU2_CFD/include/numerics/turbulent/transition/trans_diffusion.hpp +++ b/SU2_CFD/include/numerics/turbulent/transition/trans_diffusion.hpp @@ -3,7 +3,7 @@ * \brief Declarations of numerics classes for discretization of * viscous fluxes in transition problems. * \author S. Kang - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/turbulent/transition/trans_sources.hpp b/SU2_CFD/include/numerics/turbulent/transition/trans_sources.hpp index 3e47e8172e1..715dbbfdb86 100644 --- a/SU2_CFD/include/numerics/turbulent/transition/trans_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/transition/trans_sources.hpp @@ -1,7 +1,7 @@ /*! * \file trans_sources.hpp * \brief Numerics classes for integration of source terms in transition problems. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/turbulent/turb_convection.hpp b/SU2_CFD/include/numerics/turbulent/turb_convection.hpp index 2a6501ff46f..50bd2ff190d 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_convection.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_convection.hpp @@ -3,7 +3,7 @@ * \brief Declarations of numerics classes for discretization of * convective fluxes in turbulence problems. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/turbulent/turb_diffusion.hpp b/SU2_CFD/include/numerics/turbulent/turb_diffusion.hpp index e1a009a297a..8e1bad1c3b5 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_diffusion.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_diffusion.hpp @@ -3,7 +3,7 @@ * \brief Declarations of numerics classes for discretization of * viscous fluxes in turbulence problems. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp index 704403746fc..af920cd34c1 100644 --- a/SU2_CFD/include/numerics/turbulent/turb_sources.hpp +++ b/SU2_CFD/include/numerics/turbulent/turb_sources.hpp @@ -1,7 +1,7 @@ /*! * \file turb_sources.hpp * \brief Numerics classes for integration of source terms in turbulence problems. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -48,6 +48,8 @@ struct CSAVariables { const su2double cb2_sigma = cb2 / sigma; const su2double cw1 = cb1 / k2 + (1 + cb2) / sigma; const su2double cr1 = 0.5; + const su2double CRot = 1.0; + const su2double c2 = 0.7, c3 = 0.9; /*--- List of auxiliary functions ---*/ su2double ft2, d_ft2, r, d_r, g, d_g, glim, fw, d_fw, Ji, d_Ji, S, Shat, d_Shat, fv1, d_fv1, fv2, d_fv2; @@ -122,7 +124,9 @@ class CSourceBase_TurbSA : public CNumerics { /*--- Dacles-Mariani et. al. rotation correction ("-R"). ---*/ if (options.rot) { - var.Omega += 2.0 * min(0.0, StrainMag_i - var.Omega); + var.Omega += var.CRot * min(0.0, StrainMag_i - var.Omega); + /*--- Do not allow negative production for SA-neg. ---*/ + if (ScalarVar_i[0] < 0) var.Omega = abs(var.Omega); } if (dist_i > 1e-10) { @@ -303,9 +307,19 @@ struct ModVort { struct Bsl { static void get(const su2double& nue, const su2double& nu, CSAVariables& var) { const su2double Sbar = nue * var.fv2 * var.inv_k2_d2; - var.Shat = var.S + Sbar; - var.Shat = max(var.Shat, 1.0e-10); - if (var.Shat <= 1.0e-10) { + const su2double c2 = 0.7, c3 = 0.9; + + /*--- Limiting of \hat{S} based on "Modifications and Clarifications for the Implementation of the Spalart-Allmaras Turbulence Model" + * Note 1 option c in https://turbmodels.larc.nasa.gov/spalart.html ---*/ + if (Sbar >= - c2 * var.S) { + var.Shat = var.S + Sbar; + } else { + const su2double Num = var.S * (c2 * c2 * var.S + c3 * Sbar); + const su2double Den = (c3 - 2 * c2) * var.S - Sbar; + var.Shat = var.S + Num / Den; + } + if (var.Shat <= 1e-10) { + var.Shat = 1e-10; var.d_Shat = 0.0; } else { var.d_Shat = (var.fv2 + nue * var.d_fv2) * var.inv_k2_d2; @@ -791,11 +805,6 @@ class CSourcePieceWise_TurbSST final : public CNumerics { const su2double prod_limit = prod_lim_const * beta_star * Density_i * ScalarVar_i[1] * ScalarVar_i[0]; su2double P = Eddy_Viscosity_i * pow(P_Base, 2); - - if (sstParsedOptions.version == SST_OPTIONS::V1994) { - /*--- INTRODUCE THE SST-V1994m BUG WHERE DIVERGENCE TERM WILL BE REMOVED ---*/ - P -= 2.0 / 3.0 * Density_i * ScalarVar_i[0] * diverg; - } su2double pk = max(0.0, min(P, prod_limit)); const auto& eddy_visc_var = sstParsedOptions.version == SST_OPTIONS::V1994 ? VorticityMag : StrainMag_i; @@ -804,8 +813,7 @@ class CSourcePieceWise_TurbSST final : public CNumerics { /*--- Production limiter only for V2003, recompute for V1994. ---*/ su2double pw; if (sstParsedOptions.version == SST_OPTIONS::V1994) { - /*--- INTRODUCE THE SST-V1994m BUG WHERE DIVERGENCE TERM WILL BE REMOVED ---*/ - pw = alfa_blended * Density_i * max(pow(P_Base, 2) - 2.0 / 3.0 * zeta * diverg, 0.0); + pw = alfa_blended * Density_i * pow(P_Base, 2); } else { pw = (alfa_blended * Density_i / Eddy_Viscosity_i) * pk; } diff --git a/SU2_CFD/include/numerics_simd/CNumericsSIMD.cpp b/SU2_CFD/include/numerics_simd/CNumericsSIMD.cpp index 9b580c0bfbb..a4b64527892 100644 --- a/SU2_CFD/include/numerics_simd/CNumericsSIMD.cpp +++ b/SU2_CFD/include/numerics_simd/CNumericsSIMD.cpp @@ -4,7 +4,7 @@ * \note This should be the only cpp for this family of classes * (which are all templates). All compilation takes place here. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics_simd/CNumericsSIMD.hpp b/SU2_CFD/include/numerics_simd/CNumericsSIMD.hpp index 23116500854..fc242dd3aea 100644 --- a/SU2_CFD/include/numerics_simd/CNumericsSIMD.hpp +++ b/SU2_CFD/include/numerics_simd/CNumericsSIMD.hpp @@ -2,7 +2,7 @@ * \file CNumericsSIMD.hpp * \brief Vectorized (SIMD) numerics classes. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp b/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp index d3fef128a18..49e03b333e5 100644 --- a/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp +++ b/SU2_CFD/include/numerics_simd/flow/convection/centered.hpp @@ -2,7 +2,7 @@ * \file centered.hpp * \brief Centered convective schemes. * \author P. Gomes, F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics_simd/flow/convection/common.hpp b/SU2_CFD/include/numerics_simd/flow/convection/common.hpp index 52219e305bc..6037e2c15e1 100644 --- a/SU2_CFD/include/numerics_simd/flow/convection/common.hpp +++ b/SU2_CFD/include/numerics_simd/flow/convection/common.hpp @@ -2,7 +2,7 @@ * \file common.hpp * \brief Common convection-related methods. * \author P. Gomes, F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp b/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp index caece76b62b..cdb2e091ed8 100644 --- a/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp +++ b/SU2_CFD/include/numerics_simd/flow/convection/roe.hpp @@ -2,7 +2,7 @@ * \file roe.hpp * \brief Roe-family of convective schemes. * \author P. Gomes, A. Bueno, F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp index bf0cd3b513d..1b8ace29209 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/common.hpp @@ -2,7 +2,7 @@ * \file common.hpp * \brief Helper functions for viscous methods. * \author P. Gomes, C. Pederson, A. Bueno, F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp index 753deb9e1c0..2de5572555e 100644 --- a/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp +++ b/SU2_CFD/include/numerics_simd/flow/diffusion/viscous_fluxes.hpp @@ -2,7 +2,7 @@ * \file viscous_fluxes.hpp * \brief Decorator classes for computation of viscous fluxes. * \author P. Gomes, C. Pederson, A. Bueno, F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics_simd/flow/variables.hpp b/SU2_CFD/include/numerics_simd/flow/variables.hpp index 9a41722cc0c..380ee975907 100644 --- a/SU2_CFD/include/numerics_simd/flow/variables.hpp +++ b/SU2_CFD/include/numerics_simd/flow/variables.hpp @@ -2,7 +2,7 @@ * \file variables.hpp * \brief Collection of types to store physical variables. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/numerics_simd/util.hpp b/SU2_CFD/include/numerics_simd/util.hpp index 9698804ef63..3a0f8a68841 100644 --- a/SU2_CFD/include/numerics_simd/util.hpp +++ b/SU2_CFD/include/numerics_simd/util.hpp @@ -2,7 +2,7 @@ * \file util.hpp * \brief Generic auxiliary functions. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CAdjElasticityOutput.hpp b/SU2_CFD/include/output/CAdjElasticityOutput.hpp index ec67f09077b..36f0c63b723 100644 --- a/SU2_CFD/include/output/CAdjElasticityOutput.hpp +++ b/SU2_CFD/include/output/CAdjElasticityOutput.hpp @@ -2,7 +2,7 @@ * \file CAdjElasticityOutput.hpp * \brief Headers of the adjoint elasticity output class. * \author T. Albring, R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CAdjFlowCompOutput.hpp b/SU2_CFD/include/output/CAdjFlowCompOutput.hpp index ffa0759cb63..36d6655ad92 100644 --- a/SU2_CFD/include/output/CAdjFlowCompOutput.hpp +++ b/SU2_CFD/include/output/CAdjFlowCompOutput.hpp @@ -2,7 +2,7 @@ * \file CAdjFlowCompOutput.hpp * \brief Headers of the adjoint compressible flow output. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -92,6 +92,6 @@ class CAdjFlowCompOutput final: public CAdjFlowOutput { * \param[in] config - Definition of the particular problem. * \return if the residuals should be initialized. */ - bool SetInit_Residuals(const CConfig *config) override; + bool SetInitResiduals(const CConfig *config) override ; }; diff --git a/SU2_CFD/include/output/CAdjFlowIncOutput.hpp b/SU2_CFD/include/output/CAdjFlowIncOutput.hpp index fb70e926778..6ec4b7b3851 100644 --- a/SU2_CFD/include/output/CAdjFlowIncOutput.hpp +++ b/SU2_CFD/include/output/CAdjFlowIncOutput.hpp @@ -2,7 +2,7 @@ * \file CAdjFlowIncOutput.hpp * \brief Headers of the adjoint incompressible flow output. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -99,6 +99,6 @@ class CAdjFlowIncOutput final: public CAdjFlowOutput { * \param[in] config - Definition of the particular problem. * \return if the residuals should be initialized. */ - bool SetInit_Residuals(const CConfig *config) override; + bool SetInitResiduals(const CConfig *config) override ; }; diff --git a/SU2_CFD/include/output/CAdjFlowOutput.hpp b/SU2_CFD/include/output/CAdjFlowOutput.hpp index 6a1bbd83a20..18477f28672 100644 --- a/SU2_CFD/include/output/CAdjFlowOutput.hpp +++ b/SU2_CFD/include/output/CAdjFlowOutput.hpp @@ -2,7 +2,7 @@ * \file CAdjFlowOutput.hpp * \brief Headers of the adjoint flow output. * \author T. Kattmann - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -64,26 +64,26 @@ class CAdjFlowOutput : public COutput { /*! * \brief Add scalar (turbulence/species) history fields for the linear solver (FVMComp, FVMInc, FVMNEMO). */ - void AddHistoryOutputFields_AdjScalarLinsol(const CConfig* config); + void AddHistoryOutputFieldsAdjScalarLinsol(const CConfig* config); /*! * \brief Set all scalar (turbulence/species) history field values. */ - void LoadHistoryData_AdjScalar(const CConfig* config, const CSolver* const* solver); + void LoadHistoryDataAdjScalar(const CConfig* config, const CSolver* const* solver); /*! * \brief Add scalar (turbulence/species) volume solution fields for a point (FVMComp, FVMInc, FVMNEMO). * \note The order of fields in restart files is fixed. Therefore the split-up. * \param[in] config - Definition of the particular problem. */ - void SetVolumeOutputFields_AdjScalarSolution(const CConfig* config); + void SetVolumeOutputFieldsAdjScalarSolution(const CConfig* config); /*! * \brief Add scalar (turbulence/species) volume solution fields for a point (FVMComp, FVMInc, FVMNEMO). * \note The order of fields in restart files is fixed. Therefore the split-up. * \param[in] config - Definition of the particular problem. */ - void SetVolumeOutputFields_AdjScalarResidual(const CConfig* config); + void SetVolumeOutputFieldsAdjScalarResidual(const CConfig* config); /*! * \brief Set all scalar (turbulence/species) volume field values for a point. @@ -91,5 +91,5 @@ class CAdjFlowOutput : public COutput { * \param[in] solver - The container holding all solution data. * \param[in] iPoint - Index of the point. */ - void LoadVolumeData_AdjScalar(const CConfig* config, const CSolver* const* solver, const unsigned long iPoint); + void LoadVolumeDataAdjScalar(const CConfig* config, const CSolver* const* solver, const unsigned long iPoint); }; diff --git a/SU2_CFD/include/output/CAdjHeatOutput.hpp b/SU2_CFD/include/output/CAdjHeatOutput.hpp index af433e6e438..9b995aec1f0 100644 --- a/SU2_CFD/include/output/CAdjHeatOutput.hpp +++ b/SU2_CFD/include/output/CAdjHeatOutput.hpp @@ -2,7 +2,7 @@ * \file CAdjHeatOutput.hpp * \brief Headers of the adjoint heat output. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CBaselineOutput.hpp b/SU2_CFD/include/output/CBaselineOutput.hpp index 02db86324e6..4134972a73a 100644 --- a/SU2_CFD/include/output/CBaselineOutput.hpp +++ b/SU2_CFD/include/output/CBaselineOutput.hpp @@ -2,7 +2,7 @@ * \file CBaselineOutput.hpp * \brief Headers of the baseline output. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CElasticityOutput.hpp b/SU2_CFD/include/output/CElasticityOutput.hpp index 3ae1f695c0c..2e6581f59db 100644 --- a/SU2_CFD/include/output/CElasticityOutput.hpp +++ b/SU2_CFD/include/output/CElasticityOutput.hpp @@ -2,7 +2,7 @@ * \file CElasticityOutput.hpp * \brief Headers of the elasticity output. * \author F. Palacios, T. Economon, M. Colonno - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -82,6 +82,6 @@ class CElasticityOutput final: public COutput { * \param[in] config - Definition of the particular problem. * \return if the residuals should be initialized. */ - bool SetInit_Residuals(const CConfig *config) override; + bool SetInitResiduals(const CConfig *config) override ; }; diff --git a/SU2_CFD/include/output/CFVMOutput.hpp b/SU2_CFD/include/output/CFVMOutput.hpp index 8512942aa38..f47790e5a8e 100644 --- a/SU2_CFD/include/output/CFVMOutput.hpp +++ b/SU2_CFD/include/output/CFVMOutput.hpp @@ -2,7 +2,7 @@ * \file CFVMOutput.hpp * \brief Headers of the Finite Volume Method output. * \author T. Kattmann - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CFlowCompFEMOutput.hpp b/SU2_CFD/include/output/CFlowCompFEMOutput.hpp index 73d5f4ca1f9..657551f0caf 100644 --- a/SU2_CFD/include/output/CFlowCompFEMOutput.hpp +++ b/SU2_CFD/include/output/CFlowCompFEMOutput.hpp @@ -2,7 +2,7 @@ * \file CFlowCompFEMOutput.hpp * \brief Headers of the compressible FEM flow output. * \author R. Sanchez, T. Albring. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -89,6 +89,6 @@ class CFlowCompFEMOutput final: public CFlowOutput { * \param[in] config - Definition of the particular problem. * \return if the residuals should be initialized. */ - bool SetInit_Residuals(const CConfig *config) override; + bool SetInitResiduals(const CConfig *config) override ; }; diff --git a/SU2_CFD/include/output/CFlowCompOutput.hpp b/SU2_CFD/include/output/CFlowCompOutput.hpp index e509ad1e01f..e458e78b161 100644 --- a/SU2_CFD/include/output/CFlowCompOutput.hpp +++ b/SU2_CFD/include/output/CFlowCompOutput.hpp @@ -2,7 +2,7 @@ * \file CFlowCompOutput.hpp * \brief Headers of the compressible flow output. * \author R. Sanchez, T. Albring. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -79,7 +79,7 @@ class CFlowCompOutput final: public CFlowOutput { * \param[in] config - Definition of the particular problem. * \return if the residuals should be initialized. */ - bool SetInit_Residuals(const CConfig *config) override; + bool SetInitResiduals(const CConfig *config) override ; /*! * \brief Write any additional output defined for the current solver. @@ -91,5 +91,5 @@ class CFlowCompOutput final: public CFlowOutput { * \brief Determines if the history file output. * \param[in] config - Definition of the particular problem. */ - bool WriteHistoryFile_Output(const CConfig *config) override; + bool WriteHistoryFileOutput(const CConfig *config) override ; }; diff --git a/SU2_CFD/include/output/CFlowIncOutput.hpp b/SU2_CFD/include/output/CFlowIncOutput.hpp index 7578f3a7cd2..caa3197c8bb 100644 --- a/SU2_CFD/include/output/CFlowIncOutput.hpp +++ b/SU2_CFD/include/output/CFlowIncOutput.hpp @@ -2,7 +2,7 @@ * \file CFlowIncOutput.hpp * \brief Headers of the incompressible flow output. * \author T. Albring, R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -41,6 +41,7 @@ class CFlowIncOutput final: public CFlowOutput { TURB_MODEL turb_model; /*!< \brief The kind of turbulence model*/ bool heat; /*!< \brief Boolean indicating whether have a heat problem*/ bool weakly_coupled_heat; /*!< \brief Boolean indicating whether have a weakly coupled heat equation*/ + bool flamelet; /*!< \brief Boolean indicating whether we solve the flamelet equations */ unsigned short streamwisePeriodic; /*!< \brief Boolean indicating whether it is a streamwise periodic simulation. */ bool streamwisePeriodic_temperature; /*!< \brief Boolean indicating streamwise periodic temperature is used. */ @@ -83,6 +84,6 @@ class CFlowIncOutput final: public CFlowOutput { * \param[in] config - Definition of the particular problem. * \return if the residuals should be initialized. */ - bool SetInit_Residuals(const CConfig *config) override; + bool SetInitResiduals(const CConfig *config) override ; }; diff --git a/SU2_CFD/include/output/CFlowOutput.hpp b/SU2_CFD/include/output/CFlowOutput.hpp index 9f9b3e029b8..c9b63cb1ed6 100644 --- a/SU2_CFD/include/output/CFlowOutput.hpp +++ b/SU2_CFD/include/output/CFlowOutput.hpp @@ -2,7 +2,7 @@ * \file CFlowOutput.hpp * \brief Headers of the flow output. * \author F. Palacios, T. Economon, M. Colonno - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -30,6 +30,10 @@ #include "CFVMOutput.hpp" #include "../variables/CVariable.hpp" +/*--- Forward declare to avoid including here. ---*/ +template +struct CPrimitiveIndices; + class CFlowOutput : public CFVMOutput{ protected: unsigned long lastInnerIter; @@ -76,7 +80,7 @@ class CFlowOutput : public CFVMOutput{ * \param[in] Surface_MassFlow_Abs_Total - Massflow on all Marker_Analyze * \param[in] Surface_Area_Total - Area of all Marker_Analyze */ - void SetAnalyzeSurface_SpeciesVariance(const CSolver* const*solver, const CGeometry *geometry, CConfig *config, + void SetAnalyzeSurfaceSpeciesVariance(const CSolver* const*solver, const CGeometry *geometry, CConfig *config, const su2activematrix& Surface_Species_Total, const vector& Surface_MassFlow_Abs_Total, const vector& Surface_Area_Total); @@ -99,32 +103,56 @@ class CFlowOutput : public CFVMOutput{ /*! * \brief Add scalar (turbulence/species) history fields for the linear solver (FVMComp, FVMInc, FVMNEMO). */ - void AddHistoryOutputFields_ScalarLinsol(const CConfig* config); + void AddHistoryOutputFieldsScalarLinsol(const CConfig* config); /*! * \brief Set all scalar (turbulence/species) history field values. */ - void LoadHistoryData_Scalar(const CConfig* config, const CSolver* const* solver); + void LoadHistoryDataScalar(const CConfig* config, const CSolver* const* solver); /*! * \brief Add scalar (turbulence/species) volume solution fields for a point (FVMComp, FVMInc, FVMNEMO). * \note The order of fields in restart files is fixed. Therefore the split-up. * \param[in] config - Definition of the particular problem. */ - void SetVolumeOutputFields_ScalarSolution(const CConfig* config); + void SetVolumeOutputFieldsScalarSolution(const CConfig* config); /*! * \brief Add scalar (turbulence/species) volume solution fields for a point (FVMComp, FVMInc, FVMNEMO). * \note The order of fields in restart files is fixed. Therefore the split-up. * \param[in] config - Definition of the particular problem. */ - void SetVolumeOutputFields_ScalarResidual(const CConfig* config); + void SetVolumeOutputFieldsScalarResidual(const CConfig* config); + + /*! + * \brief Add scalar (turbulence/species) volume primitive fields for a point (FVMComp, FVMInc, FVMNEMO). + * \param[in] config - Definition of the particular problem. + */ + void SetVolumeOutputFieldsScalarPrimitive(const CConfig* config); + + /*! + * \brief Add scalar (turbulence/species) volume limiter fields for a point (FVMComp, FVMInc, FVMNEMO). + * \param[in] config - Definition of the particular problem. + */ + void SetVolumeOutputFieldsScalarLimiter(const CConfig* config); + + /*! + * \brief Add flamelet volume source term fields for a point (FVMComp, FVMInc, FVMNEMO). + * \param[in] config - Definition of the particular problem. + */ + void SetVolumeOutputFieldsScalarSource(const CConfig* config); /*! - * \brief Add scalar (turbulence/species) volume limiter fields (and more) for a point (FVMComp, FVMInc, FVMNEMO). + * \brief Add flamelet volume lookup value fields for a point (FVMComp, FVMInc, FVMNEMO). * \param[in] config - Definition of the particular problem. */ - void SetVolumeOutputFields_ScalarLimiter(const CConfig* config); + void SetVolumeOutputFieldsScalarLookup(const CConfig* config); + + /*! + * \brief Add miscellaneous scalar volume fields for a point (FVMComp, FVMInc, FVMNEMO). + * \param[in] config - Definition of the particular problem. + */ + void SetVolumeOutputFieldsScalarMisc(const CConfig* config); /*! * \brief Set all scalar (turbulence/species) volume field values for a point. @@ -133,7 +161,7 @@ class CFlowOutput : public CFVMOutput{ * \param[in] geometry - Geometrical definition of the problem. * \param[in] iPoint - Index of the point. */ - void LoadVolumeData_Scalar(const CConfig* config, const CSolver* const* solver, const CGeometry* geometry, + void LoadVolumeDataScalar(const CConfig* config, const CSolver* const* solver, const CGeometry* geometry, const unsigned long iPoint); /*! @@ -176,7 +204,7 @@ class CFlowOutput : public CFVMOutput{ /*! * \brief Add CP inverse design output as history fields */ - void Add_CpInverseDesignOutput(); + void AddCpInverseDesignOutput(); /*! * \brief Set CP inverse design output field values (and also into the solver). @@ -184,12 +212,12 @@ class CFlowOutput : public CFVMOutput{ * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void Set_CpInverseDesign(CSolver *solver, const CGeometry *geometry, const CConfig *config); + void SetCpInverseDesign(CSolver *solver, const CGeometry *geometry, const CConfig *config); /*! * \brief Add nearfield inverse design output as history fields */ - void Add_NearfieldInverseDesignOutput(); + void AddNearfieldInverseDesignOutput(); /*! * \brief Set nearfield inverse design output field values (and also into the solver). @@ -197,7 +225,7 @@ class CFlowOutput : public CFVMOutput{ * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void Set_NearfieldInverseDesign(CSolver *solver, const CGeometry *geometry, const CConfig *config); + void SetNearfieldInverseDesign(CSolver *solver, const CGeometry *geometry, const CConfig *config); /*! * \brief Compute the custom outputs. @@ -211,71 +239,8 @@ class CFlowOutput : public CFVMOutput{ * \brief Helper for custom outputs, converts variable names to indices and pointers which are then used * to evaluate the custom expressions. */ - template - void ConvertVariableSymbolsToIndices(const FlowIndices& idx, CustomOutput& output) const { - - static const auto knownVariables = - "TEMPERATURE, TEMPERATURE_VE, VELOCITY_X, VELOCITY_Y, VELOCITY_Z, PRESSURE,\n" - "DENSITY, ENTHALPY, SOUND_SPEED, LAMINAR_VISCOSITY, EDDY_VISCOSITY, THERMAL_CONDUCTIVITY\n" - "TURB[0,1,...], RAD[0,1,...], SPECIES[0,1,...]"; - - auto IndexOfVariable = [&](const FlowIndices& idx, const std::string& var) { - /*--- Primitives of the flow solver. ---*/ - const auto flow_offset = FLOW_SOL * CustomOutput::MAX_VARS_PER_SOLVER; - - if ("TEMPERATURE" == var) return flow_offset + idx.Temperature(); - if ("TEMPERATURE_VE" == var) return flow_offset + idx.Temperature_ve(); - if ("VELOCITY_X" == var) return flow_offset + idx.Velocity(); - if ("VELOCITY_Y" == var) return flow_offset + idx.Velocity() + 1; - if ("VELOCITY_Z" == var) return flow_offset + idx.Velocity() + 2; - if ("PRESSURE" == var) return flow_offset + idx.Pressure(); - if ("DENSITY" == var) return flow_offset + idx.Density(); - if ("ENTHALPY" == var) return flow_offset + idx.Enthalpy(); - if ("SOUND_SPEED" == var) return flow_offset + idx.SoundSpeed(); - if ("LAMINAR_VISCOSITY" == var) return flow_offset + idx.LaminarViscosity(); - if ("EDDY_VISCOSITY" == var) return flow_offset + idx.EddyViscosity(); - if ("THERMAL_CONDUCTIVITY" == var) return flow_offset + idx.ThermalConductivity(); - - /*--- Index-based (no name) access to variables of other solvers. ---*/ - auto GetIndex = [](const std::string& s, int nameLen) { - /*--- Extract an int from "name[int]", nameLen is the length of "name". ---*/ - return std::stoi(std::string(s.begin() + nameLen + 1, s.end() - 1)); - }; - if (var.rfind("SPECIES", 0) == 0) return SPECIES_SOL * CustomOutput::MAX_VARS_PER_SOLVER + GetIndex(var, 7); - if (var.rfind("TURB", 0) == 0) return TURB_SOL * CustomOutput::MAX_VARS_PER_SOLVER + GetIndex(var, 4); - if (var.rfind("RAD", 0) == 0) return RAD_SOL * CustomOutput::MAX_VARS_PER_SOLVER + GetIndex(var, 3); - - return CustomOutput::NOT_A_VARIABLE; - }; - - output.otherOutputs.clear(); - output.varIndices.clear(); - output.varIndices.reserve(output.varSymbols.size()); - - for (const auto& var : output.varSymbols) { - output.varIndices.push_back(IndexOfVariable(idx, var)); - - if (output.type == OperationType::FUNCTION && output.varIndices.back() != CustomOutput::NOT_A_VARIABLE) { - SU2_MPI::Error("Custom outputs of type 'Function' cannot reference solver variables.", CURRENT_FUNCTION); - } - /*--- Symbol is a valid solver variable. ---*/ - if (output.varIndices.back() < CustomOutput::NOT_A_VARIABLE) continue; - - /*--- An index above NOT_A_VARIABLE is not valid with current solver settings. ---*/ - if (output.varIndices.back() > CustomOutput::NOT_A_VARIABLE) { - SU2_MPI::Error("Inactive solver variable (" + var + ") used in function " + output.name + "\n" - "E.g. this may only be a variable of the compressible solver.", CURRENT_FUNCTION); - } - - /*--- An index equal to NOT_A_VARIABLE may refer to a history output. ---*/ - output.varIndices.back() += output.otherOutputs.size(); - output.otherOutputs.push_back(GetPtrToHistoryOutput(var)); - if (output.otherOutputs.back() == nullptr) { - SU2_MPI::Error("Invalid history output or solver variable (" + var + ") used in function " + output.name + - "\nValid solvers variables: " + knownVariables, CURRENT_FUNCTION); - } - } - } + void ConvertVariableSymbolsToIndices(const CPrimitiveIndices& idx, bool allowSkip, + CustomOutput& output) const; /*! * \brief Compute value of the Q criteration for vortex idenfitication @@ -283,7 +248,7 @@ class CFlowOutput : public CFVMOutput{ * \return Value of the Q criteration at the node */ template - su2double GetQ_Criterion(const T& VelocityGradient) const { + su2double GetQCriterion(const T& VelocityGradient) const { /*--- Make a 3D copy of the gradient so we do not have worry about nDim ---*/ @@ -356,8 +321,7 @@ class CFlowOutput : public CFVMOutput{ * \param[in] force_writing - boolean that forces writing of volume output * \param[in] iFile - index to the file that we need to consider for volume output */ - bool WriteVolume_Output(CConfig *config, unsigned long Iter, bool force_writing, unsigned short iFile) override; - + bool WriteVolumeOutput(CConfig *config, unsigned long Iter, bool force_writing, unsigned short iFile) override; /*! * \brief Write the forces breakdown file * \param[in] config - Definition of the particular problem per zone. diff --git a/SU2_CFD/include/output/CHeatOutput.hpp b/SU2_CFD/include/output/CHeatOutput.hpp index c488fcf15fa..7c6276a5df3 100644 --- a/SU2_CFD/include/output/CHeatOutput.hpp +++ b/SU2_CFD/include/output/CHeatOutput.hpp @@ -2,7 +2,7 @@ * \file CHeatOutput.hpp * \brief Headers of the heat output. * \author R. Sanchez, T. Albring. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CMeshOutput.hpp b/SU2_CFD/include/output/CMeshOutput.hpp index 023cca0420c..7fe2fc5cef9 100644 --- a/SU2_CFD/include/output/CMeshOutput.hpp +++ b/SU2_CFD/include/output/CMeshOutput.hpp @@ -2,7 +2,7 @@ * \file CMeshOutput.hpp * \brief Headers of the mesh output. * \author R. Sanchez, T. Albring. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/CMultizoneOutput.hpp b/SU2_CFD/include/output/CMultizoneOutput.hpp index 920683b5455..1057978fb99 100644 --- a/SU2_CFD/include/output/CMultizoneOutput.hpp +++ b/SU2_CFD/include/output/CMultizoneOutput.hpp @@ -2,7 +2,7 @@ * \file CMultizoneOutput.hpp * \brief Headers of the main subroutines for screen and history output in multizone problems. * \author R. Sanchez, T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -80,17 +80,17 @@ class CMultizoneOutput final: public COutput { * \brief Determines if the history file output. * \param[in] config - Definition of the particular problem. */ - bool WriteHistoryFile_Output(const CConfig *config) override; + bool WriteHistoryFileOutput(const CConfig *config) override ; /*! * \brief Determines if the screen header should be written. * \param[in] config - Definition of the particular problem. */ - bool WriteScreen_Header(const CConfig *config) override; + bool WriteScreenHeader(const CConfig *config) override ; /*! * \brief Determines if the screen header should be written. * \param[in] config - Definition of the particular problem. */ - bool WriteScreen_Output(const CConfig *config) override; + bool WriteScreenOutput(const CConfig *config) override ; }; diff --git a/SU2_CFD/include/output/CNEMOCompOutput.hpp b/SU2_CFD/include/output/CNEMOCompOutput.hpp index 86700af74cb..eb7c26e099c 100644 --- a/SU2_CFD/include/output/CNEMOCompOutput.hpp +++ b/SU2_CFD/include/output/CNEMOCompOutput.hpp @@ -2,7 +2,7 @@ * \file CNEMOCompOutput.hpp * \brief Headers of the compressible flow output. * \author R. Sanchez, W. Maier. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -79,7 +79,7 @@ class CNEMOCompOutput final: public CFlowOutput { * \param[in] config - Definition of the particular problem. * \return if the residuals should be initialized. */ - bool SetInit_Residuals(const CConfig *config) override; + bool SetInitResiduals(const CConfig *config) override ; /*! * \brief Write any additional output defined for the current solver. @@ -91,5 +91,5 @@ class CNEMOCompOutput final: public CFlowOutput { * \brief Determines if the history file output. * \param[in] config - Definition of the particular problem. */ - bool WriteHistoryFile_Output(const CConfig *config) override; + bool WriteHistoryFileOutput(const CConfig *config) override ; }; diff --git a/SU2_CFD/include/output/COutput.hpp b/SU2_CFD/include/output/COutput.hpp index 2dfe0683563..0060e60501f 100644 --- a/SU2_CFD/include/output/COutput.hpp +++ b/SU2_CFD/include/output/COutput.hpp @@ -2,7 +2,7 @@ * \file COutput.hpp * \brief Headers of the output class. * \author T.Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -179,7 +179,7 @@ class COutput { std::vector symbolValues; bool ready = false; - su2double eval() const { + su2double Eval() const { return mel::Eval(expression, [&](int i) {return *symbolValues[i];}); } }; @@ -223,11 +223,15 @@ class COutput { We store pointers to the required outputs to speed-up access. ---*/ std::vector otherOutputs; + /*--- For discrete adjoint we may need to skip some expressions because there is one output class + for the primal solver and one for the discrete adjoint (each with different variables). ---*/ + bool skip = false; + /*--- For evaluation, "vars" is a functor (i.e. has operator()) that returns the value of a variable at a given point. For example, it can be a wrapper to the primitives pointer, in which case varIndices needs to be setup with primitive indices. ---*/ template - su2double eval(const Variables& vars) const { + su2double Eval(const Variables& vars) const { return mel::Eval(expression, [&](int iSymbol) {return vars(varIndices[iSymbol]);}); } }; @@ -342,7 +346,7 @@ class COutput { * \param[in] config - Definition of the particular problem. * \param[in] solver_container - The container holding all solution data. */ - void Load_Data(CGeometry *geometry, CConfig *config, CSolver **solver_container); + void LoadData(CGeometry *geometry, CConfig *config, CSolver **solver_container); /*! * \brief Preprocess the history output by setting the history fields and opening the history file. @@ -369,7 +373,7 @@ class COutput { * \param[in] OuterIter - Value of outer iteration index * \param[in] InnerIter - Value of the inner iteration index */ - void SetHistory_Output(CGeometry *geometry, CSolver **solver_container, CConfig *config, + void SetHistoryOutput(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned long TimeIter, unsigned long OuterIter, unsigned long InnerIter); /*! @@ -378,7 +382,7 @@ class COutput { * \param[in] solver_container - Container vector with all the solutions. * \param[in] config - Definition of the particular problem. */ - void SetHistory_Output(CGeometry *geometry, CSolver **solver_container, CConfig *config); + void SetHistoryOutput(CGeometry *geometry, CSolver **solver_container, CConfig *config); /*! * Collects history data from the individual output per zone, @@ -390,44 +394,44 @@ class COutput { * \param[in] TimeIter - Value of the time iteration index * \param[in] OuterIter - Value of outer iteration index */ - void SetMultizoneHistory_Output(COutput** output, CConfig **config, CConfig *driver_config, + void SetMultizoneHistoryOutput(COutput** output, CConfig **config, CConfig *driver_config, unsigned long TimeIter, unsigned long OuterIter); /*! * \brief Sets the volume output filename * \param[in] filename - the new filename */ - inline void SetVolume_Filename(string filename) {volumeFilename = filename;} + inline void SetVolumeFilename(string filename) {volumeFilename = filename;} /*! * \brief Sets the surface output filename * \param[in] filename - the new filename */ - inline void SetSurface_Filename(string filename) {surfaceFilename = filename;} + inline void SetSurfaceFilename(string filename) {surfaceFilename = filename;} /*! * \brief Returns the current volume filename * \return - The current volume filename */ - inline string GetVolume_Filename() {return volumeFilename;} + inline string GetVolumeFilename() {return volumeFilename;} /*! * \brief Returns the current surface filename * \return - The current surface filename */ - inline string GetSurface_Filename() {return surfaceFilename;} + inline string GetSurfaceFilename() {return surfaceFilename;} /*! * \brief Sets the restart filename * \param[in] filename - the new filename */ - inline void SetRestart_Filename(string filename) {restartFilename = filename;} + inline void SetRestartFilename(string filename) {restartFilename = filename;} /*! * \brief Returns the current restart filename * \return - The current restart filename */ - inline string GetRestart_Filename() {return restartFilename;} + inline string GetRestartFilename() {return restartFilename;} /*! * \brief Set the current iteration indices @@ -446,8 +450,11 @@ class COutput { * \param[in] field - Name of the field * \return Value of the field */ - su2double GetHistoryFieldValue(const string& field) const { - return historyOutput_Map.at(field).value; + su2double GetHistoryFieldValue(const string& name) const { + auto it = historyOutput_Map.find(name); + if (it != historyOutput_Map.end()) return it->second.value; + SU2_MPI::Error("Cannot find output field with name " + name, CURRENT_FUNCTION); + return 0; } /*! @@ -456,8 +463,11 @@ class COutput { * \param[in] iMarker - Index of the surface marker * \return Value of the field */ - su2double GetHistoryFieldValuePerSurface(const string& field, unsigned short iMarker) const { - return historyOutputPerSurface_Map.at(field)[iMarker].value; + su2double GetHistoryFieldValuePerSurface(const string& name, unsigned short iMarker) const { + auto it = historyOutputPerSurface_Map.find(name); + if (it != historyOutputPerSurface_Map.end()) return it->second[iMarker].value; + SU2_MPI::Error("Cannot find output field with name " + name, CURRENT_FUNCTION); + return 0; } /*! @@ -479,7 +489,7 @@ class COutput { * \brief Get the list of all output fields * \return Vector container all output fields */ - const vector& GetHistoryOutput_List() const { + const vector& GetHistoryOutputList() const { return historyOutput_List; } @@ -487,7 +497,7 @@ class COutput { * \brief Get the list of all per-surface fields * \return Vector container all output per-surface fields */ - const vector& GetHistoryOutputPerSurface_List() const { + const vector& GetHistoryOutputPerSurfaceList() const { return historyOutputPerSurface_List; } @@ -513,7 +523,7 @@ class COutput { * \param[in] Iteration - Index of the current iteration. * \return Boolean indicating whether the problem is converged. */ - bool Convergence_Monitoring(CConfig *config, unsigned long Iteration); + bool ConvergenceMonitoring(CConfig *config, unsigned long Iteration); /*! * \brief Print a summary of the convergence to screen. @@ -559,7 +569,7 @@ class COutput { * \param[in] force_writing - If , writing of output files is forced without checking the output frequency. * \return if output files have been written to disk. */ - bool SetResult_Files(CGeometry *geometry, CConfig *config, CSolver** solver_container, + bool SetResultFiles(CGeometry *geometry, CConfig *config, CSolver** solver_container, unsigned long iter, bool force_writing = false); /*! @@ -588,25 +598,25 @@ class COutput { * \brief Set the history file header * \param[in] config - Definition of the particular problem. */ - void SetHistoryFile_Header(const CConfig *config); + void SetHistoryFileHeader(const CConfig *config); /*! * \brief Write the history file output * \param[in] config - Definition of the particular problem. */ - void SetHistoryFile_Output(const CConfig *config); + void SetHistoryFileOutput(const CConfig *config); /*! * \brief Write the screen header. * \param[in] config - Definition of the particular problem. */ - void SetScreen_Header(const CConfig *config); + void SetScreenHeader(const CConfig *config); /*! * \brief Write the screen output. * \param[in] config - Definition of the particular problem. */ - void SetScreen_Output(const CConfig *config); + void SetScreenOutput(const CConfig *config); /*! * \brief Add a new field to the history output. @@ -619,7 +629,7 @@ class COutput { */ inline void AddHistoryOutput(string name, string field_name, ScreenOutputFormat format, string groupname, string description, - HistoryFieldType field_type = HistoryFieldType::DEFAULT ){ + HistoryFieldType field_type = HistoryFieldType::DEFAULT) { historyOutput_Map[name] = HistoryOutputField(field_name, format, groupname, field_type, description); historyOutput_List.push_back(name); } @@ -634,7 +644,7 @@ class COutput { if (it != historyOutput_Map.end()){ it->second.value = value; } else { - SU2_MPI::Error(string("Cannot find output field with name ") + name, CURRENT_FUNCTION); + SU2_MPI::Error("Cannot find output field with name " + name, CURRENT_FUNCTION); } } @@ -718,13 +728,12 @@ class COutput { volumeOutput_List.push_back(name); } - /*! * \brief Set the value of a volume output field * \param[in] name - Name of the field. * \param[in] iPoint - The point location in the field. */ - su2double GetVolumeOutputValue(string name, unsigned long iPoint); + su2double GetVolumeOutputValue(const string& name, unsigned long iPoint); /*! * \brief Set the value of a volume output field @@ -732,7 +741,7 @@ class COutput { * \param[in] iPoint - The point location in the field. * \param[in] value - The new value of this field. */ - void SetVolumeOutputValue(string name, unsigned long iPoint, su2double value); + void SetVolumeOutputValue(const string& name, unsigned long iPoint, su2double value); /*! * \brief Set the value of a volume output field @@ -740,7 +749,7 @@ class COutput { * \param[in] iPoint - The point location in the field. * \param[in] value - The new value of this field. */ - void SetAvgVolumeOutputValue(string name, unsigned long iPoint, su2double value); + void SetAvgVolumeOutputValue(const string& name, unsigned long iPoint, su2double value); /*! * \brief CheckHistoryOutput @@ -765,13 +774,13 @@ class COutput { * \brief Postprocess_HistoryData * \param[in] config - Definition of the particular problem. */ - void Postprocess_HistoryData(CConfig *config); + void PostprocessHistoryData(CConfig *config); /*! * \brief Postprocess_HistoryFields * \param[in] config - Definition of the particular problem. */ - void Postprocess_HistoryFields(CConfig *config); + void PostprocessHistoryFields(CConfig *config); /*! * \brief Check whether we should print output. @@ -802,6 +811,14 @@ class COutput { */ void SetCustomOutputs(const CConfig *config); + /*! + * \brief Evaluates function-type custom outputs. + * Derived classes can use this to compute simple expressions of other outputs if they + * do not implement surface averages. This should be called just before evaluating the + * custom objective function. + */ + void ComputeSimpleCustomOutputs(const CConfig *config); + /*! * \brief Load values of the history fields common for all solvers. * \param[in] config - Definition of the particular problem. @@ -838,19 +855,19 @@ class COutput { * \brief Determines if the history file output. * \param[in] config - Definition of the particular problem. */ - virtual bool WriteHistoryFile_Output(const CConfig *config); + virtual bool WriteHistoryFileOutput(const CConfig *config); /*! * \brief Determines if the screen header should be written. * \param[in] config - Definition of the particular problem. */ - virtual bool WriteScreen_Header(const CConfig *config); + virtual bool WriteScreenHeader(const CConfig *config); /*! * \brief Determines if the screen header should be written. * \param[in] config - Definition of the particular problem. */ - virtual bool WriteScreen_Output(const CConfig *config); + virtual bool WriteScreenOutput(const CConfig *config); /*! * \brief Determines if the the volume output should be written. @@ -859,7 +876,7 @@ class COutput { * \param[in] force_writing - boolean that forces writing of volume output * \param[in] iFile - index to the file that we need to consider for volume output */ - virtual bool WriteVolume_Output(CConfig *config, unsigned long Iter, bool force_writing, unsigned short iFile); + virtual bool WriteVolumeOutput(CConfig *config, unsigned long Iter, bool force_writing, unsigned short iFile); /*! * \brief Set the values of the volume output fields for a point. @@ -887,7 +904,7 @@ class COutput { * \param[in] config - Definition of the particular problem. * \return if the residuals should be initialized. */ - inline virtual bool SetInit_Residuals(const CConfig *config) {return false;} + inline virtual bool SetInitResiduals(const CConfig *config) {return false;} /*! * \brief Set the values of the volume output fields for a surface point. diff --git a/SU2_CFD/include/output/COutputFactory.hpp b/SU2_CFD/include/output/COutputFactory.hpp index 88a9994013b..1268ff2161d 100644 --- a/SU2_CFD/include/output/COutputFactory.hpp +++ b/SU2_CFD/include/output/COutputFactory.hpp @@ -2,7 +2,7 @@ * \file COutputFactory.hpp * \brief Headers of the output class. * \author T.Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -29,7 +29,6 @@ class COutput; class CConfig; -class COutputLegacy; class COutputFactory{ @@ -57,11 +56,4 @@ class COutputFactory{ * \return - Pointer to the allocated multizone output */ static COutput* CreateMultizoneOutput(CConfig *driverConfig, CConfig** config_container, int nDim); - - /*! - * \brief Create legacy output - * \param config - Pointer to the config - * \return - Pointer to the allocated legacy output - */ - static COutputLegacy* CreateLegacyOutput(CConfig *config); }; diff --git a/SU2_CFD/include/output/COutputLegacy.hpp b/SU2_CFD/include/output/COutputLegacy.hpp deleted file mode 100644 index d3ee97c6251..00000000000 --- a/SU2_CFD/include/output/COutputLegacy.hpp +++ /dev/null @@ -1,284 +0,0 @@ -/*! - * \file COutputLegacy.hpp - * \brief Headers of the main subroutines for generating the file outputs. - * The subroutines and functions are in the output_structure_legacy.cpp file. - * \author F. Palacios, T. Economon, M. Colonno - * \version 7.5.1 "Blackbird" - * - * SU2 Project Website: https://su2code.github.io - * - * The SU2 Project is maintained by the SU2 Foundation - * (http://su2foundation.org) - * - * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) - * - * SU2 is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * SU2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with SU2. If not, see . - */ - -#pragma once - -#include "../../../Common/include/parallelization/mpi_structure.hpp" - -#ifdef HAVE_CGNS - #include "cgnslib.h" -#endif -#ifdef HAVE_TECIO - #include "TECIO.h" -#endif -#include -#include -#include - -#include "../../../Common/include/option_structure.hpp" -class CGeometry; -class CConfig; -class CSolver; -class CIntegration; - -using namespace std; - -/*! - * \class COutputLegacy - * \brief Class for writing the flow, adjoint and linearized solver - * solution (including the history solution, and parallel stuff). - * \author F. Palacios, T. Economon, M. Colonno. - */ -class COutputLegacy { - - su2double Sum_Total_RadialDistortion, Sum_Total_CircumferentialDistortion; // Add all the distortion to compute a run average. - bool turbo; - unsigned short nSpanWiseSections, nMarkerTurboPerf; - - su2double **TotalStaticEfficiency, - **TotalTotalEfficiency, - **KineticEnergyLoss, - **TRadius, - **TotalPressureLoss, - **MassFlowIn, - **MassFlowOut, - **FlowAngleIn, - **FlowAngleIn_BC, - **FlowAngleOut, - **EulerianWork, - **TotalEnthalpyIn, - **TotalEnthalpyIn_BC, - **EntropyIn, - **EntropyOut, - **EntropyIn_BC, - **PressureRatio, - **TotalTemperatureIn, - **EnthalpyOut, - ***MachIn, - ***MachOut, - **VelocityOutIs, - **DensityIn, - **PressureIn, - ***TurboVelocityIn, - **DensityOut, - **PressureOut, - ***TurboVelocityOut, - **EnthalpyOutIs, - **EntropyGen, - **AbsFlowAngleIn, - **TotalEnthalpyOut, - **RothalpyIn, - **RothalpyOut, - **TotalEnthalpyOutIs, - **AbsFlowAngleOut, - **PressureOut_BC, - **TemperatureIn, - **TemperatureOut, - **TotalPressureIn, - **TotalPressureOut, - **TotalTemperatureOut, - **EnthalpyIn, - **TurbIntensityIn, - **Turb2LamViscRatioIn, - **TurbIntensityOut, - **Turb2LamViscRatioOut, - **NuFactorIn, - **NuFactorOut; - -protected: - - int rank, /*!< \brief MPI Rank. */ - size; /*!< \brief MPI Size. */ - -public: - - /*! - * \brief Constructor of the class. - */ - COutputLegacy(CConfig *config); - - /*! - * \brief Destructor of the class. - */ - ~COutputLegacy(void); - - /*! - * \brief Writes inverse design. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] iExtIter - Current external (time) iteration. - */ - void SetCp_InverseDesign(CSolver *solver_container, CGeometry *geometry, CConfig *config, - unsigned long iExtIter); - - /*! - * \brief Writes inverse design. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] iExtIter - Current external (time) iteration. - */ - void SetHeatFlux_InverseDesign(CSolver *solver_container, CGeometry *geometry, CConfig *config, - unsigned long iExtIter); - - /*! - * \brief Writes forces at different sections. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] output - Create output files. - */ - void SpecialOutput_SpanLoad(CSolver *solver, CGeometry *geometry, CConfig *config, bool output) const; - - /*! - * \brief Writes one dimensional output. - * \author H. Kline - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] output - Create output files. - */ - void SpecialOutput_AnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfig *config, bool output) const; - - /*! - * \brief Create and write the file with the flow coefficient on the surface. - * \param[in] config - Definition of the particular problem. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] FlowSolution - Flow solution. - * \param[in] iExtIter - Current external (time) iteration. - * \param[in] val_iZone - Current zone number in the grid file. - * \param[in] output - Create output files. - */ - void SpecialOutput_Distortion(CSolver *solver, CGeometry *geometry, CConfig *config, bool output) const; - - /*! - * \brief Write the header of the history file. - * \param[in] ConvHist_file - Pointer to the convergence history file (which is defined in the main subroutine). - * \param[in] config - Definition of the particular problem. - */ - void SetConvHistory_Header(ofstream *ConvHist_file, CConfig *config, unsigned short val_iZone, unsigned short val_iInst); - - /*! - * \brief Write the history file and the convergence on the screen for serial computations. - * \param[in] ConvHist_file - Pointer to the convergence history file (which is defined in the main subroutine). - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] integration - Generic subroutines for space integration, time integration, and monitoring. - * \param[in] iExtIter - Current external (time) iteration. - * \param[in] timeused - Current number of clock tick in the computation (related with total time). - * \param[in] val_nZone - iZone index. - */ - void SetConvHistory_Body(ofstream *ConvHist_file, CGeometry ****geometry, CSolver *****solver_container, CConfig **config, - CIntegration ****integration, bool DualTime, su2double timeused, unsigned short val_iZone, unsigned short val_iInst); - - /*! - * \brief Write the history file and the convergence on the screen for serial computations. - * \param[in] solver - Container vector with all the solutions. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] output - Create output files. - */ - void SpecialOutput_ForcesBreakdown(CSolver *****solver, CGeometry ****geometry, CConfig **config, unsigned short val_iZone, bool output) const; - - /*! - * \brief Compute . - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] iExtIter - Current external (time) iteration. - */ - void ComputeTurboPerformance(CSolver *solver_container, CGeometry *geometry, CConfig *config); - - /*! - * \brief Compute . - * \param[in] config - Definition of the particular problem. - */ - void WriteTurboPerfConvHistory(CConfig *config); - - /*! - * \brief Write the output file for spanwise turboperformance. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] val_nZone - iZone index. - * \param[in] output - Create output files. - */ - void SpecialOutput_Turbo(CSolver *****solver_container, CGeometry ****geometry, CConfig **config, unsigned short val_iZone, bool output); - - /*! - * \brief Give the Entropy Generation performance parameters for turbomachinery. - * \param[in] iMarkerTP - Marker turbo-performance. - * \param[in] iSpan - span section. - */ - su2double GetEntropyGen(unsigned short iMarkerTP, unsigned short iSpan); - - /*! - * \brief Give the Entropy Generation performance parameters for turbomachinery. - * \param[in] iMarkerTP - Marker turbo-performance. - * \param[in] iSpan - span section. - */ - su2double GetFlowAngleOut(unsigned short iMarkerTP, unsigned short iSpan); - - /*! - * \brief Give the Entropy Generation performance parameters for turbomachinery. - * \param[in] iMarkerTP - Marker turbo-performance. - * \param[in] iSpan - span section. - */ - su2double GetMassFlowIn(unsigned short iMarkerTP, unsigned short iSpan); - - /*! - * \brief Write the output file for harmonic balance for each time-instance. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] config - Definition of the particular problem. - * \param[in] val_nZone - Number of Zones. - * \param[in] val_iZone - Zone index. - * \param[in] output - Create output files. - */ - void SpecialOutput_HarmonicBalance(CSolver *****solver, CGeometry ****geometry, CConfig **config, unsigned short iZone, unsigned short val_nZone, bool output) const; - - /*! - * \brief Writes the special output files. - * \param[in] solver_container - Container vector with all the solutions. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] iExtIter - Current external (time) iteration. - * \param[in] val_iZone - Total number of domains in the grid file. - * \param[in] val_nZone - Total number of domains in the grid file. - */ - void SetSpecial_Output(CSolver *****solver_container, CGeometry ****geometry, CConfig **config, - unsigned long iExtIter, unsigned short val_nZone); - -}; - -inline su2double COutputLegacy::GetEntropyGen(unsigned short iMarkerTP, unsigned short iSpan) { return EntropyGen[iMarkerTP][iSpan]; } - -inline su2double COutputLegacy::GetFlowAngleOut(unsigned short iMarkerTP, unsigned short iSpan) { return FlowAngleOut[iMarkerTP][iSpan]*180.0/PI_NUMBER; } - -inline su2double COutputLegacy::GetMassFlowIn(unsigned short iMarkerTP, unsigned short iSpan) { return MassFlowIn[iMarkerTP][iSpan]; } diff --git a/SU2_CFD/include/output/filewriter/CCGNSFileWriter.hpp b/SU2_CFD/include/output/filewriter/CCGNSFileWriter.hpp index e31a81ea60c..4a8ddfa3b98 100644 --- a/SU2_CFD/include/output/filewriter/CCGNSFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CCGNSFileWriter.hpp @@ -2,7 +2,7 @@ * \file CCGNSFileWriter.hpp * \brief Headers for CGNS file writer class. * \author G. Baldan - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -81,14 +81,14 @@ class CCGNSFileWriter final : public CFileWriter { * \brief Write sorted data to file in CGNS file format. * \param[in] val_filename - The name of the file. */ - void Write_Data(string val_filename) override; + void WriteData(string val_filename) override ; private: #ifdef HAVE_CGNS /*! * \brief Initialize CGNS mesh file. */ - void InitializeMeshFile(string val_filename); + void InitializeMeshFile(const string& val_filename); /*! * \brief Write i-th coordinate to file in CGNS file format. diff --git a/SU2_CFD/include/output/filewriter/CCSVFileWriter.hpp b/SU2_CFD/include/output/filewriter/CCSVFileWriter.hpp index 9cdd7ad57f6..1ef1b905f65 100644 --- a/SU2_CFD/include/output/filewriter/CCSVFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CCSVFileWriter.hpp @@ -2,7 +2,7 @@ * \file CCSVFileWriter.hpp * \brief Headers fo the CSV file writer class. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -54,7 +54,7 @@ class CCSVFileWriter final: public CFileWriter{ * \brief Write sorted data to file in CSV file format * \param[in] val_filename - The name of the file */ - void Write_Data(string val_filename) override; + void WriteData(string val_filename) override ; }; diff --git a/SU2_CFD/include/output/filewriter/CFEMDataSorter.hpp b/SU2_CFD/include/output/filewriter/CFEMDataSorter.hpp index 90fbbb768c4..152abb97dbf 100644 --- a/SU2_CFD/include/output/filewriter/CFEMDataSorter.hpp +++ b/SU2_CFD/include/output/filewriter/CFEMDataSorter.hpp @@ -2,7 +2,7 @@ * \file CFEMDataSorter.hpp * \brief Headers fo the FEM data sorter class. * \author T. Albring, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CFVMDataSorter.hpp b/SU2_CFD/include/output/filewriter/CFVMDataSorter.hpp index a227d35eb3f..9a70396f1ad 100644 --- a/SU2_CFD/include/output/filewriter/CFVMDataSorter.hpp +++ b/SU2_CFD/include/output/filewriter/CFVMDataSorter.hpp @@ -2,7 +2,7 @@ * \file CFVMDataSorter.hpp * \brief Headers fo the FVM data sorter class. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CFileWriter.hpp b/SU2_CFD/include/output/filewriter/CFileWriter.hpp index 9ff8b88593e..9349e6dc27b 100644 --- a/SU2_CFD/include/output/filewriter/CFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CFileWriter.hpp @@ -2,7 +2,7 @@ * \file CFileWriter.hpp * \brief Headers fo the file writer class. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -67,7 +67,7 @@ class CFileWriter{ * \param[in] filename - Name of the file. * \return */ - inline unsigned long Determine_Filesize(std::string filename){ + inline unsigned long DetermineFilesize(std::string filename){ struct stat stat_buf; int rc = stat(filename.c_str(), &stat_buf); return rc == 0 ? stat_buf.st_size : -1; @@ -119,23 +119,23 @@ class CFileWriter{ * \brief Write sorted data to file * \param[in] val_filename - The name of the file */ - virtual void Write_Data(string val_filename){} + virtual void WriteData(string val_filename){} /*! * \brief Get the bandwith used for the last writing */ - su2double Get_Bandwidth() const {return bandwidth;} + su2double GetBandwidth() const {return bandwidth;} /*! * \brief Get the filesize of the last written file. */ - su2double Get_Filesize() const {return fileSize;} + su2double GetFilesize() const {return fileSize;} /*! * \brief Get the used time of the last file writing. * \return The time used to write to file. */ - su2double Get_UsedTime() const {return usedTime;} + su2double GetUsedTime() const {return usedTime;} protected: diff --git a/SU2_CFD/include/output/filewriter/CParallelDataSorter.hpp b/SU2_CFD/include/output/filewriter/CParallelDataSorter.hpp index 6b82833ae5c..53a98e7ff8c 100644 --- a/SU2_CFD/include/output/filewriter/CParallelDataSorter.hpp +++ b/SU2_CFD/include/output/filewriter/CParallelDataSorter.hpp @@ -2,7 +2,7 @@ * \file CParallelDataSorter.hpp * \brief Headers fo the data sorter class. * \author T. Albring, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -246,7 +246,7 @@ class CParallelDataSorter{ * \input iNode - The node ID * \return the connected node. */ - unsigned long GetElem_Connectivity(GEO_TYPE type, unsigned long iElem, unsigned long iNode) const ; + unsigned long GetElemConnectivity(GEO_TYPE type, unsigned long iElem, unsigned long iNode) const ; /*! * \brief Beginning node ID of the linear partition owned by a specific processor. @@ -315,11 +315,11 @@ class CParallelDataSorter{ * \param[in] iField - Index of the field * \param[in] data - Value of the field */ - void SetUnsorted_Data(unsigned long iPoint, unsigned short iField, su2double data){ + void SetUnsortedData(unsigned long iPoint, unsigned short iField, su2double data){ connSend[Index[iPoint] + iField] = SU2_TYPE::GetValue(data); } - passivedouble GetUnsorted_Data(unsigned long iPoint, unsigned short iField) const { + passivedouble GetUnsortedData(unsigned long iPoint, unsigned short iField) const { return connSend[Index[iPoint] + iField]; } diff --git a/SU2_CFD/include/output/filewriter/CParaviewBinaryFileWriter.hpp b/SU2_CFD/include/output/filewriter/CParaviewBinaryFileWriter.hpp index 1e7680d8763..24fdbfb8c1e 100644 --- a/SU2_CFD/include/output/filewriter/CParaviewBinaryFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CParaviewBinaryFileWriter.hpp @@ -2,7 +2,7 @@ * \file CParaviewBinaryFileWriter.hpp * \brief Headers fo paraview binary file writer class. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -59,7 +59,7 @@ class CParaviewBinaryFileWriter final: public CFileWriter{ * \brief Write sorted data to file in paraview binary file format * \param[in] val_filename - The name of the file */ - void Write_Data(string val_filename) override; + void WriteData(string val_filename) override ; private: diff --git a/SU2_CFD/include/output/filewriter/CParaviewFileWriter.hpp b/SU2_CFD/include/output/filewriter/CParaviewFileWriter.hpp index e09b2c37c8f..2d87ab3f6fb 100644 --- a/SU2_CFD/include/output/filewriter/CParaviewFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CParaviewFileWriter.hpp @@ -2,7 +2,7 @@ * \file CParaviewFileWriter.hpp * \brief Headers fo the paraview file writer class. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -52,7 +52,7 @@ class CParaviewFileWriter final: public CFileWriter{ * \brief Write sorted data to file in paraview file format * \param[in] val_filename - The name of the file */ - void Write_Data(string val_filename) override; + void WriteData(string val_filename) override ; }; diff --git a/SU2_CFD/include/output/filewriter/CParaviewVTMFileWriter.hpp b/SU2_CFD/include/output/filewriter/CParaviewVTMFileWriter.hpp index 86b8cfe2350..f80527bb1b4 100644 --- a/SU2_CFD/include/output/filewriter/CParaviewVTMFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CParaviewVTMFileWriter.hpp @@ -2,7 +2,7 @@ * \file CParaviewVTMFileWriter.hpp * \brief Headers fo paraview binary file writer class. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -99,7 +99,7 @@ class CParaviewVTMFileWriter final: public CFileWriter{ * \brief Write sorted data to file in paraview binary file format * \param[in] val_filename - The name of the file */ - void Write_Data(string val_filename) override; + void WriteData(string val_filename) override ; /*! * \brief Write all data of the zones, boundaries into the folder @@ -110,7 +110,7 @@ class CParaviewVTMFileWriter final: public CFileWriter{ * \param[in] surfaceDataSorter - sorted surface data * \param[in] geometry - the geometry of the problem */ - void WriteFolderData(string foldername, CConfig *config, + void WriteFolderData(const string& foldername, CConfig *config, string multiZoneHeaderString, CParallelDataSorter* volumeDataSorter, CParallelDataSorter* surfaceDataSorter, @@ -124,7 +124,7 @@ class CParaviewVTMFileWriter final: public CFileWriter{ * \param[in] dataSorter - Datasorter object containing the actual data. Note, data must be sorted. */ //void AddDataset(string name, string file, CParallelDataSorter* dataSorter); - void AddDataset(string foldername, string name, string file, CParallelDataSorter* dataSorter); + void AddDataset(const string& foldername, string name, const string& file, CParallelDataSorter* dataSorter); /*! * \brief Start a new block diff --git a/SU2_CFD/include/output/filewriter/CParaviewXMLFileWriter.hpp b/SU2_CFD/include/output/filewriter/CParaviewXMLFileWriter.hpp index ea0546bd97f..d411993e880 100644 --- a/SU2_CFD/include/output/filewriter/CParaviewXMLFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CParaviewXMLFileWriter.hpp @@ -2,7 +2,7 @@ * \file CParaviewXMLFileWriter.hpp * \brief Headers fo paraview binary file writer class. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -80,7 +80,7 @@ class CParaviewXMLFileWriter final: public CFileWriter{ /*! * \brief Write sorted data to file in paraview binary file format */ - void Write_Data(string val_filename) override; + void WriteData(string val_filename) override ; private: diff --git a/SU2_CFD/include/output/filewriter/CSTLFileWriter.hpp b/SU2_CFD/include/output/filewriter/CSTLFileWriter.hpp index 53029423523..072aadc1b45 100644 --- a/SU2_CFD/include/output/filewriter/CSTLFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CSTLFileWriter.hpp @@ -2,7 +2,7 @@ * \file CSTLFileWriter.hpp * \brief Headers fo the STL file writer class. * \author T. Kattmann, T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -33,7 +33,7 @@ * \class CSTLFileWriter * \brief Class for writing STL output files. * \author T. Kattmann, T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CSTLFileWriter final : public CFileWriter{ private: @@ -115,7 +115,7 @@ class CSTLFileWriter final : public CFileWriter{ * \brief Write sorted data to file in STL file format * \param[in] val_filename - The name of the file */ - void Write_Data(string val_filename) override; + void WriteData(string val_filename) override ; }; diff --git a/SU2_CFD/include/output/filewriter/CSU2BinaryFileWriter.hpp b/SU2_CFD/include/output/filewriter/CSU2BinaryFileWriter.hpp index 19f95172ec2..d5ae0b76f10 100644 --- a/SU2_CFD/include/output/filewriter/CSU2BinaryFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CSU2BinaryFileWriter.hpp @@ -2,7 +2,7 @@ * \file CSU2BinaryFileWriter.hpp * \brief Headers fo the SU2 binary file writer class. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -53,6 +53,6 @@ class CSU2BinaryFileWriter final: public CFileWriter{ * \brief Write sorted data to file in SU2 binary file format * \param[in] filename - The filename to write */ - void Write_Data(string filename) override; + void WriteData(string filename) override ; }; diff --git a/SU2_CFD/include/output/filewriter/CSU2FileWriter.hpp b/SU2_CFD/include/output/filewriter/CSU2FileWriter.hpp index c7ae345e9ac..8d360e3f7c3 100644 --- a/SU2_CFD/include/output/filewriter/CSU2FileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CSU2FileWriter.hpp @@ -2,7 +2,7 @@ * \file CSU2FileWriter.hpp * \brief Headers fo the CSV file writer class. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -47,7 +47,7 @@ class CSU2FileWriter final: public CFileWriter{ * \brief Write sorted data to file in SU2 ASCII file format * \param[in] val_filename - The name of the file */ - void Write_Data(string val_filename) override; + void WriteData(string val_filename) override ; }; diff --git a/SU2_CFD/include/output/filewriter/CSU2MeshFileWriter.hpp b/SU2_CFD/include/output/filewriter/CSU2MeshFileWriter.hpp index 1a2ff43f252..87910dd88e4 100644 --- a/SU2_CFD/include/output/filewriter/CSU2MeshFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CSU2MeshFileWriter.hpp @@ -2,7 +2,7 @@ * \file CSU2MeshFileWriter.hpp * \brief Headers fo the CSV file writer class. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -53,7 +53,7 @@ class CSU2MeshFileWriter final: public CFileWriter{ * \brief Write sorted data to file in SU2 mesh file format * \param[in] val_filename - The name of the file */ - void Write_Data(string val_filename) override; + void WriteData(string val_filename) override ; }; diff --git a/SU2_CFD/include/output/filewriter/CSurfaceFEMDataSorter.hpp b/SU2_CFD/include/output/filewriter/CSurfaceFEMDataSorter.hpp index 51cc27b33b6..fdda43a2d92 100644 --- a/SU2_CFD/include/output/filewriter/CSurfaceFEMDataSorter.hpp +++ b/SU2_CFD/include/output/filewriter/CSurfaceFEMDataSorter.hpp @@ -2,7 +2,7 @@ * \file CSurfaceFEMDataSorter.hpp * \brief Headers fo the surface FEM data sorter class. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CSurfaceFVMDataSorter.hpp b/SU2_CFD/include/output/filewriter/CSurfaceFVMDataSorter.hpp index 636e15d39c4..99c755699e3 100644 --- a/SU2_CFD/include/output/filewriter/CSurfaceFVMDataSorter.hpp +++ b/SU2_CFD/include/output/filewriter/CSurfaceFVMDataSorter.hpp @@ -2,7 +2,7 @@ * \file CSurfaceFVMDataSorter.hpp * \brief Headers for the surface FVM data sorter class. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/output/filewriter/CTecplotBinaryFileWriter.hpp b/SU2_CFD/include/output/filewriter/CTecplotBinaryFileWriter.hpp index 2975cd2c727..da464f972ef 100644 --- a/SU2_CFD/include/output/filewriter/CTecplotBinaryFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CTecplotBinaryFileWriter.hpp @@ -2,7 +2,7 @@ * \file CTecplotBinaryFileWriter.hpp * \brief Headers fo the tecplot binary writer class. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -61,7 +61,7 @@ class CTecplotBinaryFileWriter final: public CFileWriter{ * \brief Write sorted data to file in tecplot binary file format * \param[in] val_filename - The name of the file */ - void Write_Data(string val_filename) override; + void WriteData(string val_filename) override ; /*! * \brief Calculate the partitioning of nodes to determine: diff --git a/SU2_CFD/include/output/filewriter/CTecplotFileWriter.hpp b/SU2_CFD/include/output/filewriter/CTecplotFileWriter.hpp index 1c9a49b0ac1..27b0506a80b 100644 --- a/SU2_CFD/include/output/filewriter/CTecplotFileWriter.hpp +++ b/SU2_CFD/include/output/filewriter/CTecplotFileWriter.hpp @@ -2,7 +2,7 @@ * \file CTecplotFileWriter.hpp * \brief Headers fo the tecplot ASCII writer class. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -58,7 +58,7 @@ class CTecplotFileWriter final: public CFileWriter{ * \brief Write sorted data to file in tecplot ASCII file format * \param[in] val_filename - The name of the file */ - void Write_Data(string val_filename) override; + void WriteData(string val_filename) override ; }; diff --git a/SU2_CFD/include/output/tools/CWindowingTools.hpp b/SU2_CFD/include/output/tools/CWindowingTools.hpp index 5fc3e22fc3c..d3bcec9d29d 100644 --- a/SU2_CFD/include/output/tools/CWindowingTools.hpp +++ b/SU2_CFD/include/output/tools/CWindowingTools.hpp @@ -2,7 +2,7 @@ * \file signal_processing_toolbox.hpp * \brief Header file for the signal processing toolbox. * \author S. Schotthöfer - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -105,7 +105,7 @@ class CWindowedAverage:CWindowingTools{ * \param currentIter - current time Iteration * \param startIter - iteration to start the windowed-time average. */ - void addValue(su2double valIn, unsigned long curTimeIter,unsigned long startIter = 0); + void AddValue(su2double valIn, unsigned long curTimeIter,unsigned long startIter = 0); private: /*! diff --git a/SU2_CFD/include/sgs_model.hpp b/SU2_CFD/include/sgs_model.hpp index 34e75bdad35..374a3a14010 100644 --- a/SU2_CFD/include/sgs_model.hpp +++ b/SU2_CFD/include/sgs_model.hpp @@ -2,7 +2,7 @@ * \file sgs_model.hpp * \brief Headers of the LES subgrid scale models of the SU2 solvers. * \author E. van der Weide, T. Economon, P. Urbanczyk - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -38,7 +38,7 @@ using namespace std; * \class CSGSModel * \brief Base class for defining the LES subgrid scale model. * \author: E. van der Weide, T. Economon, P. Urbanczyk - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CSGSModel { @@ -224,7 +224,7 @@ class CSGSModel { * \class CSmagorinskyModel * \brief Derived class for defining the Smagorinsky SGS model. * \author: E. van der Weide, T. Economon, P. Urbanczyk - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CSmagorinskyModel : public CSGSModel { @@ -413,7 +413,7 @@ class CSmagorinskyModel : public CSGSModel { * \class CWALEModel * \brief Derived class for defining the WALE SGS model. * \author: E. van der Weide, T. Economon, P. Urbanczyk - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CWALEModel : public CSGSModel { @@ -601,7 +601,7 @@ class CWALEModel : public CSGSModel { * \class CVremanModel * \brief Derived class for defining the WALE SGS model. * \author: E. van der Weide, T. Economon, P. Urbanczyk, E. Molina - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CVremanModel : public CSGSModel { diff --git a/SU2_CFD/include/sgs_model.inl b/SU2_CFD/include/sgs_model.inl index 1c3023782e7..55af9414684 100644 --- a/SU2_CFD/include/sgs_model.inl +++ b/SU2_CFD/include/sgs_model.inl @@ -2,7 +2,7 @@ * \file sgs_model.inl * \brief In-Line subroutines of the sgs_model.hpp file. * \author E. van der Weide, T. Economon, P. Urbanczyk - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CAdjEulerSolver.hpp b/SU2_CFD/include/solvers/CAdjEulerSolver.hpp index 79e0dc20701..97e46646b9d 100644 --- a/SU2_CFD/include/solvers/CAdjEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CAdjEulerSolver.hpp @@ -2,7 +2,7 @@ * \file CAdjEulerSolver.hpp * \brief Headers of the CAdjEulerSolver class * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CAdjNSSolver.hpp b/SU2_CFD/include/solvers/CAdjNSSolver.hpp index 9f1ada35c44..22c8246b71b 100644 --- a/SU2_CFD/include/solvers/CAdjNSSolver.hpp +++ b/SU2_CFD/include/solvers/CAdjNSSolver.hpp @@ -2,7 +2,7 @@ * \file CAdjNSSolver.hpp * \brief Headers of the CAdjNSSolver class * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CAdjTurbSolver.hpp b/SU2_CFD/include/solvers/CAdjTurbSolver.hpp index d5eee6c5d39..aa45ea72eee 100644 --- a/SU2_CFD/include/solvers/CAdjTurbSolver.hpp +++ b/SU2_CFD/include/solvers/CAdjTurbSolver.hpp @@ -2,7 +2,7 @@ * \file CAdjTurbSolver.hpp * \brief Headers of the CAdjTurbSolver class * \author F. Palacios, A. Bueno. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CBaselineSolver.hpp b/SU2_CFD/include/solvers/CBaselineSolver.hpp index e2747f94af3..45d76a22489 100644 --- a/SU2_CFD/include/solvers/CBaselineSolver.hpp +++ b/SU2_CFD/include/solvers/CBaselineSolver.hpp @@ -2,7 +2,7 @@ * \file CBaslineSolver.hpp * \brief Headers of the CBaselineSolver class * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CBaselineSolver_FEM.hpp b/SU2_CFD/include/solvers/CBaselineSolver_FEM.hpp index 216efa3249d..f831d2cee9d 100644 --- a/SU2_CFD/include/solvers/CBaselineSolver_FEM.hpp +++ b/SU2_CFD/include/solvers/CBaselineSolver_FEM.hpp @@ -2,7 +2,7 @@ * \file CBaslineSolver_FEM.hpp * \brief Headers of the CBaselineSolver class * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -31,7 +31,7 @@ * \class CBaselineSolver_FEM * \brief Main class for defining a baseline solution from a restart file for the DG-FEM solver output. * \author T. Economon. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CBaselineSolver_FEM final : public CSolver { protected: diff --git a/SU2_CFD/include/solvers/CDiscAdjFEASolver.hpp b/SU2_CFD/include/solvers/CDiscAdjFEASolver.hpp index abd8fcddfb0..296500b6112 100644 --- a/SU2_CFD/include/solvers/CDiscAdjFEASolver.hpp +++ b/SU2_CFD/include/solvers/CDiscAdjFEASolver.hpp @@ -2,7 +2,7 @@ * \file CDiscAdjFEASolver.hpp * \brief Headers of the CDiscAdjFEASolver class * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -50,7 +50,8 @@ class CDiscAdjFEASolver final : public CSolver { su2double* val = nullptr; /*!< \brief Value of the variable. */ su2double* LocalSens = nullptr; /*!< \brief Local sensitivity (domain). */ su2double* GlobalSens = nullptr; /*!< \brief Global sensitivity (mpi). */ - su2double* TotalSens = nullptr; /*!< \brief Total sensitivity (time domain). */ + su2double* OldSens = nullptr; /*!< \brief Previous global sensitivity, used to update the total. */ + su2double* TotalSens = nullptr; /*!< \brief Total sensitivity (integrated over time). */ su2double& operator[] (unsigned short i) { return val[i]; } const su2double& operator[] (unsigned short i) const { return val[i]; } @@ -61,6 +62,7 @@ class CDiscAdjFEASolver final : public CSolver { val = new su2double[n](); LocalSens = new su2double[n](); GlobalSens = new su2double[n](); + OldSens = new su2double[n](); TotalSens = new su2double[n](); } @@ -69,6 +71,7 @@ class CDiscAdjFEASolver final : public CSolver { delete [] val; delete [] LocalSens; delete [] GlobalSens; + delete [] OldSens; delete [] TotalSens; } @@ -80,10 +83,19 @@ class CDiscAdjFEASolver final : public CSolver { for (auto i = 0u; i < size; ++i) LocalSens[i] = SU2_TYPE::GetDerivative(val[i]); SU2_MPI::Allreduce(LocalSens, GlobalSens, size, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + + for (auto i = 0u; i < size; ++i) { + /*--- Update the total by subtracting the old and adding the new value. + * Then update the old value for the next call to this function. ---*/ + TotalSens[i] += GlobalSens[i] - OldSens[i]; + OldSens[i] = GlobalSens[i]; + } } - void UpdateTotal() { - for (auto i = 0u; i < size; ++i) TotalSens[i] += GlobalSens[i]; + void Store() { + /*--- Clears the old values such that on the next time step the total is + * incremented instead of updated. ---*/ + for (auto i = 0u; i < size; ++i) OldSens[i] = 0.0; } ~SensData() { clear(); } @@ -213,42 +225,6 @@ class CDiscAdjFEASolver final : public CSolver { */ inline su2double GetTotal_Sens_DVFEA(unsigned short iDVFEA) const override { return DV.TotalSens[iDVFEA]; } - /*! - * \brief A virtual member. - * \return Value of the sensitivity coefficient for the Young Modulus E - */ - inline su2double GetGlobal_Sens_E(unsigned short iVal) const override { return E.GlobalSens[iVal]; } - - /*! - * \brief A virtual member. - * \return Value of the Mach sensitivity for the Poisson's ratio Nu - */ - inline su2double GetGlobal_Sens_Nu(unsigned short iVal) const override { return Nu.GlobalSens[iVal]; } - - /*! - * \brief A virtual member. - * \return Value of the sensitivity coefficient for the Electric Field in the region iEField - */ - inline su2double GetGlobal_Sens_EField(unsigned short iEField) const override { return EField.GlobalSens[iEField]; } - - /*! - * \brief A virtual member. - * \return Value of the sensitivity coefficient for the FEA DV in the region iDVFEA - */ - inline su2double GetGlobal_Sens_DVFEA(unsigned short iDVFEA) const override { return DV.GlobalSens[iDVFEA]; } - - /*! - * \brief Get the total sensitivity for the structural density - * \return Value of the structural density sensitivity - */ - inline su2double GetGlobal_Sens_Rho(unsigned short iVal) const override { return Rho.GlobalSens[iVal]; } - - /*! - * \brief Get the total sensitivity for the structural weight - * \return Value of the structural weight sensitivity - */ - inline su2double GetGlobal_Sens_Rho_DL(unsigned short iVal) const override { return Rho_DL.GlobalSens[iVal]; } - /*! * \brief Get the value of the Young modulus from the adjoint solver * \return Value of the Young modulus from the adjoint solver diff --git a/SU2_CFD/include/solvers/CDiscAdjMeshSolver.hpp b/SU2_CFD/include/solvers/CDiscAdjMeshSolver.hpp index 20bb3ac28c5..7505ae5275d 100644 --- a/SU2_CFD/include/solvers/CDiscAdjMeshSolver.hpp +++ b/SU2_CFD/include/solvers/CDiscAdjMeshSolver.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to compute the * the discrete adjoint of the linear-elastic mesh solver. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CDiscAdjSolver.hpp b/SU2_CFD/include/solvers/CDiscAdjSolver.hpp index 0b4488ba9f3..7ea1653b1f1 100644 --- a/SU2_CFD/include/solvers/CDiscAdjSolver.hpp +++ b/SU2_CFD/include/solvers/CDiscAdjSolver.hpp @@ -2,7 +2,7 @@ * \file CDiscAdjSolver.hpp * \brief Headers of the CDiscAdjSolver class * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CEulerSolver.hpp b/SU2_CFD/include/solvers/CEulerSolver.hpp index eecc7a292a0..04b49d9c523 100644 --- a/SU2_CFD/include/solvers/CEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CEulerSolver.hpp @@ -2,7 +2,7 @@ * \file CEulerSolver.hpp * \brief Headers of the CEulerSolver class * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CFEASolver.hpp b/SU2_CFD/include/solvers/CFEASolver.hpp index ed0aee60236..81465f94d01 100644 --- a/SU2_CFD/include/solvers/CFEASolver.hpp +++ b/SU2_CFD/include/solvers/CFEASolver.hpp @@ -2,7 +2,7 @@ * \file CFEASolver.hpp * \brief Finite element solver for elasticity problems. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -682,28 +682,9 @@ class CFEASolver : public CFEASolverBase { inline su2double GetFSI_ConvValue(unsigned short val_index) const final { return FSI_Conv[val_index]; } /*! - * \brief Retrieve the value of the dynamic Aitken relaxation factor. - * \return Value of the dynamic Aitken relaxation factor. + * \brief Store the value of the last Aitken relaxation factor in the current time step. */ - inline su2double GetWAitken_Dyn(void) const final { return WAitken_Dyn; } - - /*! - * \brief Retrieve the value of the last Aitken relaxation factor in the previous time step. - * \return Value of the last Aitken relaxation factor in the previous time step. - */ - inline su2double GetWAitken_Dyn_tn1(void) const final { return WAitken_Dyn_tn1; } - - /*! - * \brief Set the value of the dynamic Aitken relaxation factor - * \param[in] Value of the dynamic Aitken relaxation factor - */ - inline void SetWAitken_Dyn(su2double waitk) final { WAitken_Dyn = waitk; } - - /*! - * \brief Set the value of the last Aitken relaxation factor in the current time step. - * \param[in] Value of the last Aitken relaxation factor in the current time step. - */ - inline void SetWAitken_Dyn_tn1(su2double waitk_tn1) final { WAitken_Dyn_tn1 = waitk_tn1; } + inline void SetWAitken_Dyn_tn1() final { WAitken_Dyn_tn1 = WAitken_Dyn; } /*! * \brief Set the value of the load increment for nonlinear structural analysis diff --git a/SU2_CFD/include/solvers/CFEASolverBase.hpp b/SU2_CFD/include/solvers/CFEASolverBase.hpp index 6a94f8aaa8b..83fe976ffa9 100644 --- a/SU2_CFD/include/solvers/CFEASolverBase.hpp +++ b/SU2_CFD/include/solvers/CFEASolverBase.hpp @@ -2,7 +2,7 @@ * \file CFEASolver.hpp * \brief Base class template for all FEA solvers using the SU2 internal finite elements. * \author T. Dick - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CFEM_DG_EulerSolver.hpp b/SU2_CFD/include/solvers/CFEM_DG_EulerSolver.hpp index 87a30af9ce3..48c1e373eeb 100644 --- a/SU2_CFD/include/solvers/CFEM_DG_EulerSolver.hpp +++ b/SU2_CFD/include/solvers/CFEM_DG_EulerSolver.hpp @@ -2,7 +2,7 @@ * \file CFEM_DG_EulerSolver.hpp * \brief Headers of the CFEM_DG_EulerSolver class * \author E. van der Weide, T. Economon, J. Alonso - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -35,7 +35,7 @@ * \brief Main class for defining the Euler Discontinuous Galerkin finite element flow solver. * \ingroup Euler_Equations * \author E. van der Weide, T. Economon, J. Alonso - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CFEM_DG_EulerSolver : public CSolver { protected: diff --git a/SU2_CFD/include/solvers/CFEM_DG_NSSolver.hpp b/SU2_CFD/include/solvers/CFEM_DG_NSSolver.hpp index da9e533cbbb..4a270d16b76 100644 --- a/SU2_CFD/include/solvers/CFEM_DG_NSSolver.hpp +++ b/SU2_CFD/include/solvers/CFEM_DG_NSSolver.hpp @@ -2,7 +2,7 @@ * \file CFEM_DG_NSSolver.hpp * \brief Headers of the CFEM_DG_NSSolver class * \author E. van der Weide, T. Economon, J. Alonso - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -35,7 +35,7 @@ * \brief Main class for defining the Navier-Stokes Discontinuous Galerkin finite element flow solver. * \ingroup Navier_Stokes_Equations * \author E. van der Weide, T. Economon, J. Alonso - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CFEM_DG_NSSolver final : public CFEM_DG_EulerSolver { private: diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp index 1fa8f1fb8b0..6953dd1bc59 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.hpp @@ -1,7 +1,7 @@ /*! * \file CFVMFlowSolverBase.hpp * \brief Base class template for all FVM flow solvers. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -2198,6 +2198,29 @@ class CFVMFlowSolverBase : public CSolver { Inlet_FlowDir[val_marker][val_vertex][val_dim] = val_flowdir; } + /*! + * \brief Updates the components of the farfield velocity vector. + */ + inline void UpdateFarfieldVelocity(const CConfig* config) final { + /*--- Retrieve the AoA and AoS (degrees) ---*/ + const su2double AoA = config->GetAoA() * PI_NUMBER / 180.0; + const su2double AoS = config->GetAoS() * PI_NUMBER / 180.0; + /*--- Update the freestream velocity vector at the farfield + * Compute the new freestream velocity with the updated AoA, + * "Velocity_Inf" is shared with config. ---*/ + + const su2double Vel_Infty_Mag = GeometryToolbox::Norm(nDim, Velocity_Inf); + + if (nDim == 2) { + Velocity_Inf[0] = cos(AoA) * Vel_Infty_Mag; + Velocity_Inf[1] = sin(AoA) * Vel_Infty_Mag; + } else { + Velocity_Inf[0] = cos(AoA) * cos(AoS) * Vel_Infty_Mag; + Velocity_Inf[1] = sin(AoS) * Vel_Infty_Mag; + Velocity_Inf[2] = sin(AoA) * cos(AoS) * Vel_Infty_Mag; + } + } + /*! * \brief Compute the global error measures (L2, Linf) for verification cases. * \param[in] geometry - Geometrical definition. diff --git a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl index bab8f187cae..40af46827be 100644 --- a/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl +++ b/SU2_CFD/include/solvers/CFVMFlowSolverBase.inl @@ -1,7 +1,7 @@ /*! * \file CFVMFlowSolverBase.inl * \brief Base class template for all FVM flow solvers. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CGradientSmoothingSolver.hpp b/SU2_CFD/include/solvers/CGradientSmoothingSolver.hpp index a594aef11e7..4ff452ef94e 100644 --- a/SU2_CFD/include/solvers/CGradientSmoothingSolver.hpp +++ b/SU2_CFD/include/solvers/CGradientSmoothingSolver.hpp @@ -2,7 +2,7 @@ * \file CGradientSmoothingSolver.hpp * \brief SOlver class for Sobolev smoothing of sensitivities. * \author T. Dick - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CHeatSolver.hpp b/SU2_CFD/include/solvers/CHeatSolver.hpp index 2074d479a6a..cbce9cd622e 100644 --- a/SU2_CFD/include/solvers/CHeatSolver.hpp +++ b/SU2_CFD/include/solvers/CHeatSolver.hpp @@ -2,7 +2,7 @@ * \file CHeatSolver.hpp * \brief Headers of the CHeatSolver class * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \class CHeatSolver * \brief Main class for defining the finite-volume heat solver. * \author O. Burghardt - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CHeatSolver final : public CScalarSolver { protected: @@ -401,5 +401,7 @@ class CHeatSolver final : public CScalarSolver { * \param[in] val_vertex - Vertex of the marker val_marker where the coefficient is evaluated. * \return Value of the heat flux. */ - inline su2double GetHeatFlux(unsigned short val_marker, unsigned long val_vertex) const override { return HeatFlux[val_marker][val_vertex]; } + inline su2double GetHeatFlux(unsigned short val_marker, unsigned long val_vertex) const override { + return HeatFlux[val_marker][val_vertex]; + } }; diff --git a/SU2_CFD/include/solvers/CIncEulerSolver.hpp b/SU2_CFD/include/solvers/CIncEulerSolver.hpp index 818ffb6bdd2..972d49f6413 100644 --- a/SU2_CFD/include/solvers/CIncEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CIncEulerSolver.hpp @@ -2,7 +2,7 @@ * \file CIncEulerSolver.hpp * \brief Headers of the CIncEulerSolver class * \author F. Palacios, T. Economon, T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CIncNSSolver.hpp b/SU2_CFD/include/solvers/CIncNSSolver.hpp index 1c3a3588799..7827458f4dd 100644 --- a/SU2_CFD/include/solvers/CIncNSSolver.hpp +++ b/SU2_CFD/include/solvers/CIncNSSolver.hpp @@ -2,7 +2,7 @@ * \file CIncNSSolver.hpp * \brief Headers of the CIncNSSolver class * \author F. Palacios, T. Economon, T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CMeshSolver.hpp b/SU2_CFD/include/solvers/CMeshSolver.hpp index d03a841f5e3..852066ad643 100644 --- a/SU2_CFD/include/solvers/CMeshSolver.hpp +++ b/SU2_CFD/include/solvers/CMeshSolver.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to compute the deformation of * the volumetric numerical grid using the linear elasticity solver. * \author Ruben Sanchez, based on CVolumetricMovement developments (F. Palacios, A. Bueno, T. Economon, S. Padron) - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -125,6 +125,7 @@ class CMeshSolver final : public CFEASolver { /*! * \brief Grid deformation using the linear elasticity equations. * \param[in] geometry - Geometrical definition of the problem. + * \param[in] numerics - Numerics used in the solution. * \param[in] config - Definition of the particular problem. */ void DeformMesh(CGeometry **geometry, @@ -133,11 +134,10 @@ class CMeshSolver final : public CFEASolver { /*! * \brief Set the stiffness of the mesh. - * \param[in] geometry - Geometrical definition of the problem. + * \param[in] numerics - Numerics used in the solution. * \param[in] config - Definition of the particular problem. */ - void SetMesh_Stiffness(CGeometry **geometry, - CNumerics **numerics, + void SetMesh_Stiffness(CNumerics **numerics, CConfig *config) override; /*! diff --git a/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp b/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp index 268b7a9bbc0..5369647e6bf 100644 --- a/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp +++ b/SU2_CFD/include/solvers/CNEMOEulerSolver.hpp @@ -2,7 +2,7 @@ * \file CNEMOEulerSolver.hpp * \brief Headers of the CNEMOEulerSolver class * \author S. R. Copeland, F. Palacios, W. Maier. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -36,7 +36,7 @@ * \brief Main class for defining the NEMO Euler's flow solver. * \ingroup Euler_Equations * \author S. R. Copeland, F. Palacios, W. Maier. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CNEMOEulerSolver : public CFVMFlowSolverBase { protected: diff --git a/SU2_CFD/include/solvers/CNEMONSSolver.hpp b/SU2_CFD/include/solvers/CNEMONSSolver.hpp index 4368c20c5cc..0f120901e46 100644 --- a/SU2_CFD/include/solvers/CNEMONSSolver.hpp +++ b/SU2_CFD/include/solvers/CNEMONSSolver.hpp @@ -2,7 +2,7 @@ * \file CNEMONSSolver.hpp * \brief Headers of the CNEMONSSolver class * \author S. R. Copeland, F. Palacios, W. Maier. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CNSSolver.hpp b/SU2_CFD/include/solvers/CNSSolver.hpp index 1b1321c4fb6..bea8562388e 100644 --- a/SU2_CFD/include/solvers/CNSSolver.hpp +++ b/SU2_CFD/include/solvers/CNSSolver.hpp @@ -2,7 +2,7 @@ * \file CNSSolver.hpp * \brief Headers of the CNSSolver class * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CRadP1Solver.hpp b/SU2_CFD/include/solvers/CRadP1Solver.hpp index f1130481973..aeea803c4fe 100644 --- a/SU2_CFD/include/solvers/CRadP1Solver.hpp +++ b/SU2_CFD/include/solvers/CRadP1Solver.hpp @@ -2,7 +2,7 @@ * \file CRadP1Solver.hpp * \brief Declaration and inlines of the class to compute a P1 radiation problem. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CRadSolver.hpp b/SU2_CFD/include/solvers/CRadSolver.hpp index 3e41bbdb5d2..034c9a3c9de 100644 --- a/SU2_CFD/include/solvers/CRadSolver.hpp +++ b/SU2_CFD/include/solvers/CRadSolver.hpp @@ -2,7 +2,7 @@ * \file CRadSolver.hpp * \brief Declaration and inlines of the class to compute a generic radiation solver. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CScalarSolver.hpp b/SU2_CFD/include/solvers/CScalarSolver.hpp index fd217446b1e..bd854d4e51c 100644 --- a/SU2_CFD/include/solvers/CScalarSolver.hpp +++ b/SU2_CFD/include/solvers/CScalarSolver.hpp @@ -1,7 +1,7 @@ /*! * \file CScalarSolver.hpp * \brief Headers of the CScalarSolver class - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CScalarSolver.inl b/SU2_CFD/include/solvers/CScalarSolver.inl index 0f4ab4baf57..5b6415d65b0 100644 --- a/SU2_CFD/include/solvers/CScalarSolver.inl +++ b/SU2_CFD/include/solvers/CScalarSolver.inl @@ -1,7 +1,7 @@ /*! * \file CScalarSolver.inl * \brief Main subroutines of CScalarSolver class - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CSolver.hpp b/SU2_CFD/include/solvers/CSolver.hpp index f87fcf58c44..44eb07c3465 100644 --- a/SU2_CFD/include/solvers/CSolver.hpp +++ b/SU2_CFD/include/solvers/CSolver.hpp @@ -2,7 +2,7 @@ * \file CSolver.hpp * \brief Headers of the CSolver class which is inherited by all of the other solvers * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -560,7 +560,7 @@ class CSolver { * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void SetGridVel_Gradient(CGeometry *geometry, const CConfig *config); + void SetGridVel_Gradient(CGeometry *geometry, const CConfig *config) const; /*! * \brief Compute slope limiter. @@ -592,7 +592,7 @@ class CSolver { * \param[in] geometry - Geometrical definition of the problem. * \param[in] config - Definition of the particular problem. */ - void Restart_OldGeometry(CGeometry *geometry, CConfig *config); + void Restart_OldGeometry(CGeometry *geometry, CConfig *config) const; /*! * \brief A virtual member. @@ -2871,6 +2871,11 @@ class CSolver { unsigned short val_dim, su2double val_flowdir) { } + /*! + * \brief Updates the components of the farfield velocity vector. + */ + inline virtual void UpdateFarfieldVelocity(const CConfig* config) {} + /*! * \brief A virtual member * \param[in] iMarker - Marker identifier. @@ -3201,42 +3206,6 @@ class CSolver { */ inline virtual su2double GetTotal_Sens_DVFEA(unsigned short iDVFEA) const { return 0.0; } - /*! - * \brief A virtual member. - * \return Value of the sensitivity coefficient for the Young Modulus E - */ - inline virtual su2double GetGlobal_Sens_E(unsigned short iVal) const { return 0.0; } - - /*! - * \brief A virtual member. - * \return Value of the sensitivity coefficient for the Poisson's ratio Nu - */ - inline virtual su2double GetGlobal_Sens_Nu(unsigned short iVal) const { return 0.0; } - - /*! - * \brief A virtual member. - * \return Value of the structural density sensitivity - */ - inline virtual su2double GetGlobal_Sens_Rho(unsigned short iVal) const { return 0.0; } - - /*! - * \brief A virtual member. - * \return Value of the structural weight sensitivity - */ - inline virtual su2double GetGlobal_Sens_Rho_DL(unsigned short iVal) const { return 0.0; } - - /*! - * \brief A virtual member. - * \return Value of the sensitivity coefficient for the Electric Field in the region iEField - */ - inline virtual su2double GetGlobal_Sens_EField(unsigned short iEField) const { return 0.0; } - - /*! - * \brief A virtual member. - * \return Value of the sensitivity coefficient for the FEA DV in the region iDVFEA - */ - inline virtual su2double GetGlobal_Sens_DVFEA(unsigned short iDVFEA) const { return 0.0; } - /*! * \brief A virtual member. * \return Value of the Young modulus from the adjoint solver @@ -3434,7 +3403,7 @@ class CSolver { void Read_SU2_Restart_Metadata(CGeometry *geometry, CConfig *config, bool adjoint_run, - string val_filename) const; + const string& val_filename) const; /*! * \brief Load a inlet profile data from file into a particular solver. @@ -3698,27 +3667,8 @@ class CSolver { /*! * \brief A virtual member. - * \return Value of the dynamic Aitken relaxation factor - */ - inline virtual su2double GetWAitken_Dyn(void) const { return 0; } - - /*! - * \brief A virtual member. - * \return Value of the last Aitken relaxation factor in the previous time step. - */ - inline virtual su2double GetWAitken_Dyn_tn1(void) const { return 0; } - - /*! - * \brief A virtual member. - * \param[in] Value of the dynamic Aitken relaxation factor */ - inline virtual void SetWAitken_Dyn(su2double waitk) { } - - /*! - * \brief A virtual member. - * \param[in] Value of the last Aitken relaxation factor in the previous time step. - */ - inline virtual void SetWAitken_Dyn_tn1(su2double waitk_tn1) { } + inline virtual void SetWAitken_Dyn_tn1() { } /*! * \brief A virtual member. @@ -4167,8 +4117,16 @@ class CSolver { * \param[in] config - Definition of the particular problem. * \param[in] referenceCoord - Determine if the mesh is deformed from the reference or from the current coordinates. */ - inline virtual void SetMesh_Stiffness(CGeometry **geometry, - CNumerics **numerics, + inline virtual void DeformMesh(CGeometry *geometry, + CNumerics **numerics, + CConfig *config) { } + + /*! + * \brief A virtual member. + * \param[in] config - Definition of the particular problem. + * \param[in] referenceCoord - Determine if the mesh is deformed from the reference or from the current coordinates. + */ + inline virtual void SetMesh_Stiffness(CNumerics **numerics, CConfig *config) { } /*! @@ -4238,9 +4196,9 @@ class CSolver { /*! * \brief Retrieve the solver name for output purposes. - * \param[out] val_solvername - Name of the solver. + * \returns Name of the solver. */ - inline string GetSolverName(void) {return SolverName;} + inline const string& GetSolverName() const { return SolverName; } /*! * \brief Get the solution fields. diff --git a/SU2_CFD/include/solvers/CSolverFactory.hpp b/SU2_CFD/include/solvers/CSolverFactory.hpp index bdf8300619f..ab8d757c280 100644 --- a/SU2_CFD/include/solvers/CSolverFactory.hpp +++ b/SU2_CFD/include/solvers/CSolverFactory.hpp @@ -2,7 +2,7 @@ * \file CSolverFactory.hpp * \brief Headers of the CSolverFactory class * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CSpeciesFlameletSolver.hpp b/SU2_CFD/include/solvers/CSpeciesFlameletSolver.hpp new file mode 100644 index 00000000000..f3a957dbc42 --- /dev/null +++ b/SU2_CFD/include/solvers/CSpeciesFlameletSolver.hpp @@ -0,0 +1,178 @@ +/*! + * \file CSpeciesFlameletSolver.hpp + * \brief Headers of the CSpeciesFlameletSolver class + * \author D. Mayer, N. Beishuizen, T. Economon, E. Bunschoten + * \version 8.0.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "CSpeciesSolver.hpp" + +/*! + * \class CSpeciesFlameletSolver + * \brief Main class for defining the flamelet model solver. + * \author N. Beishuizen + * \ingroup Scalar_Transport + */ +class CSpeciesFlameletSolver final : public CSpeciesSolver { + private: + vector conjugate_var; /*!< \brief CHT variables for each boundary and vertex. */ + bool include_mixture_fraction = false; /*!< \brief include mixture fraction as a controlling variable. */ + /*! + * \brief Compute the preconditioner for low-Mach flows. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] config - Definition of the particular problem. + */ + void SetPreconditioner(CGeometry* geometry, CSolver** solver_container, CConfig* config); + + /*! + * \brief Generic implementation of the isothermal wall also covering CHT cases, + * for which the wall temperature is given by GetConjugateHeatVariable. + */ + void BC_Isothermal_Wall_Generic(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics, + CNumerics* visc_numerics, CConfig* config, unsigned short val_marker, + bool cht_mode = false); + + /*! + * \brief Reverse look-up to retrieve enthalpy value based on temperature and other controlling variables. + * \param[in] fluid_model - pointer to flamelet fluid model. + * \param[in] val_temp - temperature value used for reverse look-up. + * \param[in] scalar_solution - local scalar solution. + * \param[in] val_enth_out - pointer to output enthalpy variable. + * \param[out] Converged - 0 if Newton solver converged, 1 if not. + */ + unsigned long GetEnthFromTemp(CFluidModel* fluid_model, su2double const val_temp, + const su2double* scalar_solution, su2double* val_enth_out); + + /*! + * \brief Find maximum progress variable value within the manifold for the current solution. + * \param[in] fluid_model - pointer to flamelet fluid model. + * \param[in] scalars - local scalar solution. + * \return - maximum progress variable value within manifold bounds. + */ + su2double GetBurntProgressVariable(CFluidModel* fluid_model, const su2double* scalars); + + /*! + * \brief Retrieve scalar source terms from manifold. + * \param[in] config - definition of particular problem. + * \param[in] fluid_model_local - pointer to flamelet fluid model. + * \param[in] iPoint - node ID. + * \param[in] scalars - local scalar solution. + * \param[in] table_source_names - variable names of scalar source terms. + * \return - within manifold bounds (0) or outside manifold bounds (1). + */ + unsigned long SetScalarSources(const CConfig* config, CFluidModel* fluid_model_local, unsigned long iPoint, + const vector& scalars); + + /*! + * \brief Retrieve passive look-up data from manifold. + * \param[in] config - definition of particular problem. + * \param[in] fluid_model_local - pointer to flamelet fluid model. + * \param[in] iPoint - node ID. + * \param[in] scalars - local scalar solution. + * \return - within manifold bounds (0) or outside manifold bounds (1). + */ + unsigned long SetScalarLookUps(const CConfig* config, CFluidModel* fluid_model_local, unsigned long iPoint, + const vector& scalars); + + public: + /*! + * \brief Constructor. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] config - Definition of the particular problem. + * \param[in] iMesh - Index of the mesh in multigrid computations. + * \param[in] FluidModel + */ + CSpeciesFlameletSolver(CGeometry* geometry, CConfig* config, unsigned short iMesh); + + /*! + * \brief Restart residual and compute gradients. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] config - Definition of the particular problem. + * \param[in] iMesh - Index of the mesh in multigrid computations. + * \param[in] iRKStep - Current step of the Runge-Kutta iteration. + * \param[in] RunTime_EqSystem - System of equations which is going to be solved. + * \param[in] Output - Boolean to determine whether to print output. + */ + void Preprocessing(CGeometry* geometry, CSolver** solver_container, CConfig* config, unsigned short iMesh, + unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) override; + + /*! + * \brief Set the initial condition for the scalar transport problem. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container with all the solutions. + * \param[in] config - Definition of the particular problem. + * \param[in] ExtIter - External iteration. + */ + void SetInitialCondition(CGeometry** geometry, CSolver*** solver_container, CConfig* config, + unsigned long ExtIter) override; + + /*! + * \brief Source term computation. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] numerics - Description of the numerical method. + * \param[in] config - Definition of the particular problem. + * \param[in] iMesh - Index of the mesh in multigrid computations. + */ + void Source_Residual(CGeometry* geometry, CSolver** solver_container, CNumerics** numerics_container, CConfig* config, + unsigned short iMesh) override; + + /*! + * \brief Impose the Navier-Stokes wall boundary condition. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] conv_numerics - Description of the numerical method. + * \param[in] visc_numerics - Description of the numerical method. + * \param[in] config - Definition of the particular problem. + * \param[in] val_marker - Surface marker where the boundary condition is applied. + */ + void BC_Isothermal_Wall(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics, + CNumerics* visc_numerics, CConfig* config, unsigned short val_marker) override; + + /*! + * \brief Impose the inlet boundary condition. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] conv_numerics - Description of the numerical method. + * \param[in] visc_numerics - Description of the numerical method. + * \param[in] config - Definition of the particular problem. + * \param[in] val_marker - Surface marker where the boundary condition is applied. + */ + void BC_Inlet(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics, CNumerics* visc_numerics, + CConfig* config, unsigned short val_marker) override; + + /*! + * \brief Impose the (received) conjugate heat variables. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] solver_container - Container vector with all the solutions. + * \param[in] numerics - Description of the numerical method. + * \param[in] config - Definition of the particular problem. + * \param[in] val_marker - Surface marker where the boundary condition is applied. + */ + void BC_ConjugateHeat_Interface(CGeometry* geometry, CSolver** solver_container, CNumerics* numerics, CConfig* config, + unsigned short val_marker) override; +}; diff --git a/SU2_CFD/include/solvers/CSpeciesSolver.hpp b/SU2_CFD/include/solvers/CSpeciesSolver.hpp index d4d751e3ff5..5b78696d9ac 100644 --- a/SU2_CFD/include/solvers/CSpeciesSolver.hpp +++ b/SU2_CFD/include/solvers/CSpeciesSolver.hpp @@ -2,7 +2,7 @@ * \file CSpeciesSolver.hpp * \brief Headers of the CSpeciesSolver class * \author T. Kattmann. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -65,6 +65,8 @@ class CSpeciesSolver : public CScalarSolver { */ void LoadRestart(CGeometry** geometry, CSolver*** solver, CConfig* config, int val_iter, bool val_update_geo) final; + void Initialize(CGeometry* geometry, CConfig* config, unsigned short iMesh, unsigned short nVar); + /*! * \brief Restart residual and compute gradients. * \param[in] geometry - Geometrical definition of the problem. @@ -76,7 +78,7 @@ class CSpeciesSolver : public CScalarSolver { * \param[in] Output - boolean to determine whether to print output. */ void Preprocessing(CGeometry* geometry, CSolver** solver_container, CConfig* config, unsigned short iMesh, - unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) final; + unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) override; /*! * \brief Compute the viscous flux for the turbulent equation at a particular edge. @@ -100,7 +102,7 @@ class CSpeciesSolver : public CScalarSolver { * \param[in] val_marker - Surface marker where the boundary condition is applied. */ void BC_Inlet(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics, CNumerics* visc_numerics, - CConfig* config, unsigned short val_marker) final; + CConfig* config, unsigned short val_marker) override; /*! * \brief Store of a set of provided inlet profile values at a vertex. diff --git a/SU2_CFD/include/solvers/CTemplateSolver.hpp b/SU2_CFD/include/solvers/CTemplateSolver.hpp index 4e61f0d55a2..0083cf778fb 100644 --- a/SU2_CFD/include/solvers/CTemplateSolver.hpp +++ b/SU2_CFD/include/solvers/CTemplateSolver.hpp @@ -2,7 +2,7 @@ * \file CTemplateSolver.hpp * \brief Headers of the CTemplateSolver class * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CTransLMSolver.hpp b/SU2_CFD/include/solvers/CTransLMSolver.hpp index 039fb94aa0f..613be3b6da6 100644 --- a/SU2_CFD/include/solvers/CTransLMSolver.hpp +++ b/SU2_CFD/include/solvers/CTransLMSolver.hpp @@ -2,7 +2,7 @@ * \file CTransLMSolver.hpp * \brief Headers of the CTransLMSolver class * \author A. Aranake - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CTurbSASolver.hpp b/SU2_CFD/include/solvers/CTurbSASolver.hpp index 9cf498c59aa..35f403b13c1 100644 --- a/SU2_CFD/include/solvers/CTurbSASolver.hpp +++ b/SU2_CFD/include/solvers/CTurbSASolver.hpp @@ -2,7 +2,7 @@ * \file CTurbSASolver.hpp * \brief Headers of the CTurbSASolver class * \author A. Bueno. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CTurbSSTSolver.hpp b/SU2_CFD/include/solvers/CTurbSSTSolver.hpp index 23b202a6c10..6dbed05fd9d 100644 --- a/SU2_CFD/include/solvers/CTurbSSTSolver.hpp +++ b/SU2_CFD/include/solvers/CTurbSSTSolver.hpp @@ -2,7 +2,7 @@ * \file CTurbSSTSolver.hpp * \brief Headers of the CTurbSSTSolver class * \author A. Campos, F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/solvers/CTurbSolver.hpp b/SU2_CFD/include/solvers/CTurbSolver.hpp index 9a0341a942f..b1a46887617 100644 --- a/SU2_CFD/include/solvers/CTurbSolver.hpp +++ b/SU2_CFD/include/solvers/CTurbSolver.hpp @@ -2,7 +2,7 @@ * \file CTurbSolver.hpp * \brief Headers of the CTurbSolver class * \author A. Bueno. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/task_definition.hpp b/SU2_CFD/include/task_definition.hpp index 4706be540be..ee97b080141 100644 --- a/SU2_CFD/include/task_definition.hpp +++ b/SU2_CFD/include/task_definition.hpp @@ -2,7 +2,7 @@ * \file task_definition.hpp * \brief Header of the task definition class for the SU2 solvers. * \author E. van der Weide, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -37,7 +37,7 @@ using namespace std; * \class CTaskDefinition * \brief Class for defining a task to be carried out * \author: E. van der Weide, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CTaskDefinition { diff --git a/SU2_CFD/include/task_definition.inl b/SU2_CFD/include/task_definition.inl index 0a50f212f49..5d9d9e939f7 100644 --- a/SU2_CFD/include/task_definition.inl +++ b/SU2_CFD/include/task_definition.inl @@ -2,7 +2,7 @@ * \file task_definition.inl * \brief In-Line subroutines of the task_definition.hpp file. * \author E. van der Weide, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CAdjEulerVariable.hpp b/SU2_CFD/include/variables/CAdjEulerVariable.hpp index 9cd33a3d1ef..4d00e9a5b1b 100644 --- a/SU2_CFD/include/variables/CAdjEulerVariable.hpp +++ b/SU2_CFD/include/variables/CAdjEulerVariable.hpp @@ -2,7 +2,7 @@ * \file CAdjEulerVariable.hpp * \brief Main class for defining the variables of the adjoint Euler solver. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CAdjNSVariable.hpp b/SU2_CFD/include/variables/CAdjNSVariable.hpp index 7d0a81e0702..f5f6c996bb6 100644 --- a/SU2_CFD/include/variables/CAdjNSVariable.hpp +++ b/SU2_CFD/include/variables/CAdjNSVariable.hpp @@ -2,7 +2,7 @@ * \file CAdjNSVariable.hpp * \brief Main class for defining the variables of the adjoint Navier-Stokes solver. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CAdjTurbVariable.hpp b/SU2_CFD/include/variables/CAdjTurbVariable.hpp index 9afb2c4550b..30620b8b084 100644 --- a/SU2_CFD/include/variables/CAdjTurbVariable.hpp +++ b/SU2_CFD/include/variables/CAdjTurbVariable.hpp @@ -2,7 +2,7 @@ * \file CAdjTurbVariable.hpp * \brief Main class for defining the variables of the adjoint turbulence model. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CBaselineVariable.hpp b/SU2_CFD/include/variables/CBaselineVariable.hpp index 68912d4b2a3..03c60788972 100644 --- a/SU2_CFD/include/variables/CBaselineVariable.hpp +++ b/SU2_CFD/include/variables/CBaselineVariable.hpp @@ -2,7 +2,7 @@ * \file CBaselineVariable.hpp * \brief Main class for defining the variables of a baseline solution from a restart file (for output). * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CDiscAdjFEABoundVariable.hpp b/SU2_CFD/include/variables/CDiscAdjFEABoundVariable.hpp index 35f8738d951..e77c33d8898 100644 --- a/SU2_CFD/include/variables/CDiscAdjFEABoundVariable.hpp +++ b/SU2_CFD/include/variables/CDiscAdjFEABoundVariable.hpp @@ -2,7 +2,7 @@ * \file CDiscAdjFEABoundVariable.hpp * \brief Main class for defining the variables of the adjoint FEA solver at the boundary. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -35,7 +35,7 @@ * \ingroup DiscAdj * \brief Main class for defining the variables on the FEA boundaries for adjoint applications. * \author R. Sanchez. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CDiscAdjFEABoundVariable final : public CDiscAdjVariable { private: diff --git a/SU2_CFD/include/variables/CDiscAdjMeshBoundVariable.hpp b/SU2_CFD/include/variables/CDiscAdjMeshBoundVariable.hpp index 88aa26cf1a0..f889f48c38a 100644 --- a/SU2_CFD/include/variables/CDiscAdjMeshBoundVariable.hpp +++ b/SU2_CFD/include/variables/CDiscAdjMeshBoundVariable.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class * to define the adjoint variables of the mesh movement. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CDiscAdjVariable.hpp b/SU2_CFD/include/variables/CDiscAdjVariable.hpp index 72ca67f9c24..5dba843fdfe 100644 --- a/SU2_CFD/include/variables/CDiscAdjVariable.hpp +++ b/SU2_CFD/include/variables/CDiscAdjVariable.hpp @@ -2,7 +2,7 @@ * \file CDiscAdjVariable.hpp * \brief Main class for defining the variables of the adjoint solver. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -72,6 +72,7 @@ class CDiscAdjVariable : public CVariable { inline su2double GetSensitivity(unsigned long iPoint, unsigned long iDim) const final { return Sensitivity(iPoint,iDim); } + inline const MatrixType& GetSensitivity() const final { return Sensitivity; } /*! * \brief Set/store the dual time contributions to the adjoint variable. diff --git a/SU2_CFD/include/variables/CEulerVariable.hpp b/SU2_CFD/include/variables/CEulerVariable.hpp index 25e992da2e1..e9445674273 100644 --- a/SU2_CFD/include/variables/CEulerVariable.hpp +++ b/SU2_CFD/include/variables/CEulerVariable.hpp @@ -2,7 +2,7 @@ * \file CEulerVariable.hpp * \brief Class for defining the variables of the compressible Euler solver. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -46,6 +46,8 @@ class CEulerVariable : public CFlowVariable { struct CIndices { const IndexType nDim; CIndices(IndexType ndim, IndexType) : nDim(ndim) {} + inline IndexType NDim() const { return nDim; } + inline IndexType NSpecies() const { return 0; } inline IndexType Temperature() const { return 0; } inline IndexType Velocity() const { return 1; } inline IndexType Pressure() const { return nDim+1; } @@ -58,6 +60,7 @@ class CEulerVariable : public CFlowVariable { inline IndexType CpTotal() const { return nDim+8; } /*--- For compatible interface with NEMO. ---*/ + inline IndexType SpeciesDensities() const { return std::numeric_limits::max(); } inline IndexType Temperature_ve() const { return std::numeric_limits::max(); } }; @@ -69,7 +72,11 @@ class CEulerVariable : public CFlowVariable { MatrixType Secondary; MatrixType WindGust; /*! < \brief Wind gust value */ - MatrixType WindGustDer; /*! < \brief Wind gust derivatives value */ + + bool DataDrivenFluid = false; /*!< \brief Usage of data-driven fluid model. DatasetExtrapolation and FluidEntropy will not be sized if disabled. */ + su2vector DatasetExtrapolation; /*!< \brief Stores instances of dataset bounds violation when using data-driven fluid models. */ + su2vector NIterNewtonsolver; /*!< \brief Stores number of Newton solver iterations when using data-driven fluid models. */ + VectorType FluidEntropy; /*!< \brief Stores the fluid entropy value as computed by the data-driven fluid model. */ public: /*! @@ -283,42 +290,56 @@ class CEulerVariable : public CFlowVariable { } /*! - * \brief Get the value of the wind gust - * \return Value of the wind gust + * \brief Specify a vector to set the velocity components of the solution. Multiplied by density for compressible cases. + * \param[in] iPoint - Point index. + * \param[in] val_vector - Pointer to the vector. */ - inline su2double* GetWindGust(unsigned long iPoint) final { return WindGust[iPoint]; } + inline void SetVelSolutionVector(unsigned long iPoint, const su2double *val_vector) final { + for (unsigned long iDim = 0; iDim < nDim; iDim++) Solution(iPoint, iDim+1) = GetDensity(iPoint) * val_vector[iDim]; + } /*! - * \brief Set the value of the wind gust - * \param[in] Value of the wind gust + * \brief Set fluid entropy + * \param[in] iPoint - Node index + * \param[in] entropy - fluid entropy value. */ - inline void SetWindGust(unsigned long iPoint, const su2double* val_WindGust) final { - for (unsigned long iDim = 0; iDim < nDim; iDim++) - WindGust(iPoint,iDim) = val_WindGust[iDim]; - } + inline void SetEntropy(unsigned long iPoint, su2double entropy) final { FluidEntropy[iPoint] = entropy; }; /*! - * \brief Get the value of the derivatives of the wind gust - * \return Value of the derivatives of the wind gust + * \brief Get fluid entropy + * \param[in] iPoint - Node index + * \return Entropy - Fluid entropy value */ - inline su2double* GetWindGustDer(unsigned long iPoint) final { return WindGustDer[iPoint]; } + inline su2double GetEntropy(unsigned long iPoint) const final { return FluidEntropy[iPoint]; } /*! - * \brief Set the value of the derivatives of the wind gust - * \param[in] Value of the derivatives of the wind gust + * \brief Set dataset extrapolation instance + * \param[in] iPoint - Node index + * \param[in] extrapolation - Extrapolation instance (0 = within dataset, 1 = outside dataset) */ - inline void SetWindGustDer(unsigned long iPoint, const su2double* val_WindGustDer) final { - for (unsigned long iDim = 0; iDim < nDim+1; iDim++) - WindGustDer(iPoint,iDim) = val_WindGustDer[iDim]; - } + inline void SetDataExtrapolation(unsigned long iPoint, unsigned short extrapolation) final { + DatasetExtrapolation[iPoint] = extrapolation; + }; /*! - * \brief Specify a vector to set the velocity components of the solution. Multiplied by density for compressible cases. - * \param[in] iPoint - Point index. - * \param[in] val_vector - Pointer to the vector. + * \brief Get dataset extrapolation instance + * \param[in] iPoint - Node index + * \return extrapolation - Extrapolation instance (0 = within dataset, 1 = outside dataset) */ - inline void SetVelSolutionVector(unsigned long iPoint, const su2double *val_vector) final { - for (unsigned long iDim = 0; iDim < nDim; iDim++) Solution(iPoint, iDim+1) = GetDensity(iPoint) * val_vector[iDim]; - } + inline unsigned short GetDataExtrapolation(unsigned long iPoint) const final { return DatasetExtrapolation[iPoint]; } + + /*! + * \brief Set the number of iterations required by a Newton solver used by the fluid model. + * \param[in] iPoint - Node index + * \param[in] nIter - Number of iterations evaluated by the Newton solver + */ + inline void SetNewtonSolverIterations(unsigned long iPoint, unsigned long nIter) final { NIterNewtonsolver[iPoint] = nIter; } + + /*! + * \brief Get the number of iterations required by a Newton solver used by the fluid model. + * \param[in] iPoint - Node index + * \return Number of iterations evaluated by the Newton solver + */ + inline unsigned long GetNewtonSolverIterations(unsigned long iPoint) const final { return NIterNewtonsolver[iPoint]; } }; diff --git a/SU2_CFD/include/variables/CFEABoundVariable.hpp b/SU2_CFD/include/variables/CFEABoundVariable.hpp index e04d40467c1..43f3ca6602e 100644 --- a/SU2_CFD/include/variables/CFEABoundVariable.hpp +++ b/SU2_CFD/include/variables/CFEABoundVariable.hpp @@ -2,7 +2,7 @@ * \file CFEABoundVariable.hpp * \brief Class for defining the variables on the FEA boundaries for FSI applications. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -37,7 +37,7 @@ * A map is constructed so that variables can be referenced by iPoint instead of iVertex. * \ingroup Structural Finite Element Analysis Variables * \author R. Sanchez. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CFEABoundVariable final : public CFEAVariable { protected: @@ -149,20 +149,15 @@ class CFEABoundVariable final : public CFEAVariable { return FlowTraction_n(iPoint,iVar); } - /*! - * \brief Clear the flow traction residual - */ - void Clear_FlowTraction() override; - /*! * \brief Register the flow tractions as input variable. */ - void RegisterFlowTraction() override; + void RegisterFlowTraction(bool reset) override; /*! * \brief Extract the flow traction derivatives. */ - inline su2double ExtractFlowTraction_Sensitivity(unsigned long iPoint, unsigned long iDim) const override { + inline su2double ExtractFlowTractionSensitivity(unsigned long iPoint, unsigned long iDim) const override { if (!fsi_analysis) return 0.0; if (!VertexMap.GetVertexIndex(iPoint)) return 0.0; return SU2_TYPE::GetDerivative(FlowTraction(iPoint,iDim)); diff --git a/SU2_CFD/include/variables/CFEAVariable.hpp b/SU2_CFD/include/variables/CFEAVariable.hpp index 6d3ea11a633..0a353a7a04f 100644 --- a/SU2_CFD/include/variables/CFEAVariable.hpp +++ b/SU2_CFD/include/variables/CFEAVariable.hpp @@ -2,7 +2,7 @@ * \file CFEAVariable.hpp * \brief Class for defining the variables of the FEM structural problem. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ * \brief Class for defining the variables of the FEM structural problem. * \ingroup Structural Finite Element Analysis Variables * \author F. Palacios, R. Sanchez. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CFEAVariable : public CVariable { protected: diff --git a/SU2_CFD/include/variables/CFlowVariable.hpp b/SU2_CFD/include/variables/CFlowVariable.hpp index a6937fcf586..d13c386456b 100644 --- a/SU2_CFD/include/variables/CFlowVariable.hpp +++ b/SU2_CFD/include/variables/CFlowVariable.hpp @@ -1,7 +1,7 @@ /*! * \file CFlowVariable.hpp * \brief Class for defining the common variables of flow solvers. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CHeatVariable.hpp b/SU2_CFD/include/variables/CHeatVariable.hpp index 4bc2d0c1909..4192b85508d 100644 --- a/SU2_CFD/include/variables/CHeatVariable.hpp +++ b/SU2_CFD/include/variables/CHeatVariable.hpp @@ -2,7 +2,7 @@ * \file CHeatVariable.hpp * \brief Class for defining the variables of the finite-volume heat equation solver. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -33,7 +33,7 @@ * \class CHeatVariable * \brief Class for defining the variables of the finite-volume heat equation solver. * \author O. Burghardt - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" */ class CHeatVariable final : public CScalarVariable { public: diff --git a/SU2_CFD/include/variables/CIncEulerVariable.hpp b/SU2_CFD/include/variables/CIncEulerVariable.hpp index 61341177faa..f72e2ef9c69 100644 --- a/SU2_CFD/include/variables/CIncEulerVariable.hpp +++ b/SU2_CFD/include/variables/CIncEulerVariable.hpp @@ -2,7 +2,7 @@ * \file CIncEulerVariable.hpp * \brief Class for defining the variables of the incompressible Euler solver. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -46,6 +46,8 @@ class CIncEulerVariable : public CFlowVariable { struct CIndices { const IndexType nDim; CIndices(IndexType ndim, IndexType) : nDim(ndim) {} + inline IndexType NDim() const { return nDim; } + inline IndexType NSpecies() const { return 0; } inline IndexType Pressure() const { return 0; } inline IndexType Velocity() const { return 1; } inline IndexType Temperature() const { return nDim+1; } @@ -59,6 +61,7 @@ class CIncEulerVariable : public CFlowVariable { inline IndexType CvTotal() const { return nDim+8; } /*--- For compatible interface with NEMO. ---*/ + inline IndexType SpeciesDensities() const { return std::numeric_limits::max(); } inline IndexType Temperature_ve() const { return std::numeric_limits::max(); } inline IndexType Enthalpy() const { return std::numeric_limits::max(); } }; diff --git a/SU2_CFD/include/variables/CIncNSVariable.hpp b/SU2_CFD/include/variables/CIncNSVariable.hpp index 9a561e1e70c..a5b42a512cc 100644 --- a/SU2_CFD/include/variables/CIncNSVariable.hpp +++ b/SU2_CFD/include/variables/CIncNSVariable.hpp @@ -3,7 +3,7 @@ * \brief Class for defining the variables of the incompressible Navier-Stokes solver. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CMeshBoundVariable.hpp b/SU2_CFD/include/variables/CMeshBoundVariable.hpp index b57ce56e6da..3b26d60ac37 100644 --- a/SU2_CFD/include/variables/CMeshBoundVariable.hpp +++ b/SU2_CFD/include/variables/CMeshBoundVariable.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class * to define the variables of the mesh movement at the moving boundaries. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CMeshElement.hpp b/SU2_CFD/include/variables/CMeshElement.hpp index c166356c2ce..eda6615ef29 100644 --- a/SU2_CFD/include/variables/CMeshElement.hpp +++ b/SU2_CFD/include/variables/CMeshElement.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class * to define the variables of the mesh movement. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CMeshVariable.hpp b/SU2_CFD/include/variables/CMeshVariable.hpp index 1c5c185c222..145cbc81968 100644 --- a/SU2_CFD/include/variables/CMeshVariable.hpp +++ b/SU2_CFD/include/variables/CMeshVariable.hpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class * to define the variables of the mesh movement. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -63,6 +63,11 @@ class CMeshVariable : public CVariable { */ inline const su2double *GetMesh_Coord(unsigned long iPoint) const final { return Mesh_Coord[iPoint]; } + /*! + * \brief Get the undeformed coordinates for the entire domain. + */ + inline const MatrixType* GetMesh_Coord() const final { return &Mesh_Coord; } + /*! * \brief Set the value of the undeformed coordinates. * \param[in] iDim - Index of Mesh_Coord[nDim] diff --git a/SU2_CFD/include/variables/CNEMOEulerVariable.hpp b/SU2_CFD/include/variables/CNEMOEulerVariable.hpp index d68d90529da..d41ae5e73e1 100644 --- a/SU2_CFD/include/variables/CNEMOEulerVariable.hpp +++ b/SU2_CFD/include/variables/CNEMOEulerVariable.hpp @@ -2,7 +2,7 @@ * \file CNEMOEulerVariable.hpp * \brief Class for defining the variables of the compressible NEMO Euler solver. * \author C. Garbacz, W. Maier, S.R. Copeland - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -48,6 +48,8 @@ class CNEMOEulerVariable : public CFlowVariable { struct CIndices { const IndexType nDim, nSpecies; CIndices(IndexType ndim, IndexType nspecies) : nDim(ndim), nSpecies(nspecies) {} + inline IndexType NDim() const {return nDim;} + inline IndexType NSpecies() const {return nSpecies;} inline IndexType SpeciesDensities() const {return 0;} inline IndexType Temperature() const {return nSpecies;} inline IndexType Temperature_ve() const {return nSpecies+1;} @@ -61,6 +63,7 @@ class CNEMOEulerVariable : public CFlowVariable { inline IndexType LaminarViscosity() const {return nSpecies+nDim+8;} inline IndexType EddyViscosity() const {return nSpecies+nDim+9;} + inline IndexType CpTotal() const {return std::numeric_limits::max();} inline IndexType ThermalConductivity() const {return std::numeric_limits::max();} }; diff --git a/SU2_CFD/include/variables/CNEMONSVariable.hpp b/SU2_CFD/include/variables/CNEMONSVariable.hpp index 4166590068f..a54291fb0b7 100644 --- a/SU2_CFD/include/variables/CNEMONSVariable.hpp +++ b/SU2_CFD/include/variables/CNEMONSVariable.hpp @@ -2,7 +2,7 @@ * \file CNEMONSVariable.hpp * \brief Class for defining the variables of the compressible NEMO Navier-Stokes solver. * \author C. Garbacz, W. Maier, S.R. Copeland. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CNSVariable.hpp b/SU2_CFD/include/variables/CNSVariable.hpp index 116b06ad6d3..d23b7a16eb4 100644 --- a/SU2_CFD/include/variables/CNSVariable.hpp +++ b/SU2_CFD/include/variables/CNSVariable.hpp @@ -2,7 +2,7 @@ * \file CNSVariable.hpp * \brief Class for defining the variables of the compressible Navier-Stokes solver. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CPrimitiveIndices.hpp b/SU2_CFD/include/variables/CPrimitiveIndices.hpp index c07643a7139..1ffbaa341f6 100644 --- a/SU2_CFD/include/variables/CPrimitiveIndices.hpp +++ b/SU2_CFD/include/variables/CPrimitiveIndices.hpp @@ -1,7 +1,7 @@ /*! * \file CPrimitiveIndices.hpp * \brief Abstract representation of flow primitive variable indices that tries to be efficient. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -28,6 +28,9 @@ #include #include +#include +#include + #include "CEulerVariable.hpp" #include "CIncEulerVariable.hpp" #include "CNEMOEulerVariable.hpp" @@ -67,6 +70,9 @@ struct CPrimitiveIndices { return reinterpret_cast*>(data_)->NAME(); \ } \ } + GET_INDEX_IMPL(NDim) + GET_INDEX_IMPL(NSpecies) + GET_INDEX_IMPL(SpeciesDensities) GET_INDEX_IMPL(Temperature) GET_INDEX_IMPL(Velocity) GET_INDEX_IMPL(Pressure) @@ -78,6 +84,7 @@ struct CPrimitiveIndices { GET_INDEX_IMPL(ThermalConductivity) GET_INDEX_IMPL(CpTotal) GET_INDEX_IMPL(Temperature_ve) +#undef GET_INDEX_IMPL private: template @@ -89,4 +96,37 @@ struct CPrimitiveIndices { alignas(sizeof(IndexType)) char data_[2 * sizeof(IndexType)]{}; /*!< \brief Space for the largest CIndices class. */ uint8_t type_; -}; \ No newline at end of file +}; + +/*! + * \brief Maps primitive variable names to their indices based on a CPrimitiveIndices object. + * \note The variables names we try to map here must be kept in sync with CPrimitiveIndices. + * All index classes should use numeric_limits::max for variables that are not available. + */ +template +std::map PrimitiveNameToIndexMap(const CPrimitiveIndices& idx) { + std::map nameToIndex; + const auto notAvailable = std::numeric_limits::max(); +#define INSERT_VAR_INDEX_PAIR(STRING, FUNCTION) \ + if (idx.FUNCTION() != notAvailable) nameToIndex[STRING] = idx.FUNCTION(); + INSERT_VAR_INDEX_PAIR("TEMPERATURE", Temperature) + INSERT_VAR_INDEX_PAIR("TEMPERATURE_VE", Temperature_ve) + INSERT_VAR_INDEX_PAIR("PRESSURE", Pressure) + INSERT_VAR_INDEX_PAIR("DENSITY", Density) + INSERT_VAR_INDEX_PAIR("ENTHALPY", Enthalpy) + INSERT_VAR_INDEX_PAIR("SOUND_SPEED", SoundSpeed) + INSERT_VAR_INDEX_PAIR("LAMINAR_VISCOSITY", LaminarViscosity) + INSERT_VAR_INDEX_PAIR("EDDY_VISCOSITY", EddyViscosity) + INSERT_VAR_INDEX_PAIR("THERMAL_CONDUCTIVITY", ThermalConductivity) + INSERT_VAR_INDEX_PAIR("CP_TOTAL", CpTotal) +#undef INSERT_VAR_INDEX_PAIR + nameToIndex["VELOCITY_X"] = idx.Velocity(); + nameToIndex["VELOCITY_Y"] = idx.Velocity() + 1; + if (idx.NDim() == 3) { + nameToIndex["VELOCITY_Z"] = idx.Velocity() + 2; + } + for (IndexType iSpecies = 0; iSpecies < idx.NSpecies(); ++iSpecies) { + nameToIndex["DENSITY_" + std::to_string(iSpecies)] = idx.SpeciesDensities() + iSpecies; + } + return nameToIndex; +} diff --git a/SU2_CFD/include/variables/CRadP1Variable.hpp b/SU2_CFD/include/variables/CRadP1Variable.hpp index 0594e8e29f9..bcfd89f9a31 100644 --- a/SU2_CFD/include/variables/CRadP1Variable.hpp +++ b/SU2_CFD/include/variables/CRadP1Variable.hpp @@ -2,7 +2,7 @@ * \file CRadP1Variable.hpp * \brief Class for defining the variables of the P1 radiation model. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CRadVariable.hpp b/SU2_CFD/include/variables/CRadVariable.hpp index d0c38df88c3..1fa9c735b7c 100644 --- a/SU2_CFD/include/variables/CRadVariable.hpp +++ b/SU2_CFD/include/variables/CRadVariable.hpp @@ -2,7 +2,7 @@ * \file CRadVariable.hpp * \brief Class for defining the variables of the radiation solver. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CScalarVariable.hpp b/SU2_CFD/include/variables/CScalarVariable.hpp index f68041d74a1..bd255208c2d 100644 --- a/SU2_CFD/include/variables/CScalarVariable.hpp +++ b/SU2_CFD/include/variables/CScalarVariable.hpp @@ -2,7 +2,7 @@ * \file CScalarVariable.hpp * \brief Base class for defining the shared variables of scalar solvers. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -87,4 +87,12 @@ class CScalarVariable : public CVariable { inline su2double GetHarmonicBalance_Source(unsigned long iPoint, unsigned long iVar) const final { return HB_Source(iPoint, iVar); } + + /*! + * \brief Get the value of the mass diffusivity + * \param[in] iPoint - Point index. + * \param[in] val_ivar - eqn. index to the mass diffusivity. + * \return Value of the mass diffusivity + */ + inline virtual su2double GetDiffusivity(unsigned long iPoint, unsigned short val_ivar) const { return 0.0; } }; diff --git a/SU2_CFD/include/variables/CSobolevSmoothingVariable.hpp b/SU2_CFD/include/variables/CSobolevSmoothingVariable.hpp index ba4d4e1bb1c..cee4cb26ce6 100644 --- a/SU2_CFD/include/variables/CSobolevSmoothingVariable.hpp +++ b/SU2_CFD/include/variables/CSobolevSmoothingVariable.hpp @@ -2,7 +2,7 @@ * \file CSobolevSmoothingVariable.hpp * \brief Class for defining the variables of the gradient smoothing. * \author T.Dick - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CSpeciesFlameletVariable.hpp b/SU2_CFD/include/variables/CSpeciesFlameletVariable.hpp new file mode 100644 index 00000000000..9a569e15c36 --- /dev/null +++ b/SU2_CFD/include/variables/CSpeciesFlameletVariable.hpp @@ -0,0 +1,90 @@ +/*! + * \file CSpeciesFlameletVariable.hpp + * \brief Base class for defining the variables of the flamelet transport model. + * \author D. Mayer, T. Economon, N. Beishuizen + * \version 8.0.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "CSpeciesVariable.hpp" + +/*! + * \class CSpeciesFlameletVariable + * \brief Base class for defining the variables of the flamelet model. + */ +class CSpeciesFlameletVariable final : public CSpeciesVariable { + protected: + MatrixType source_scalar; /*!< \brief Vector of the source terms from the lookup table for each scalar equation */ + MatrixType lookup_scalar; /*!< \brief Vector of the source terms from the lookup table for each scalar equation */ + su2vector table_misses; /*!< \brief Vector of lookup table misses. */ + + public: + /*! + * \brief Constructor of the class. + * \param[in] species_inf - species variable values (initialization value). + * \param[in] npoint - Number of points/nodes/vertices in the domain. + * \param[in] ndim - Number of dimensions of the problem. + * \param[in] nvar - Number of variables of the problem. + * \param[in] config - Definition of the particular problem. + */ + CSpeciesFlameletVariable(const su2double* species_inf, unsigned long npoint, unsigned long ndim, unsigned long nvar, + const CConfig* config); + + /*! + * \brief Set the value of the transported scalar source term. + * \param[in] iPoint - the location where the value has to be set. + * \param[in] val_lookup_scalar - the value of the scalar to set. + * \param[in] val_ivar - Eqn. index to the transport equation. + */ + inline void SetLookupScalar(unsigned long iPoint, su2double val_lookup_scalar, unsigned short val_ivar) override { + lookup_scalar(iPoint, val_ivar) = val_lookup_scalar; + } + + /*! + + * \brief Set a source term for the specie transport equation. + * \param[in] iPoint - Node index. + * \param[in] val_ivar - Species index. + * \param[in] val_source - Source term value. + */ + inline void SetScalarSource(unsigned long iPoint, unsigned short val_ivar, su2double val_source) override { + source_scalar(iPoint, val_ivar) = val_source; + } + + /*! + * \brief Get the value of the transported scalars source term. + * \return Pointer to the transported scalars source term. + */ + inline const su2double* GetScalarSources(unsigned long iPoint) const override { return source_scalar[iPoint]; } + + /*! + * \brief Get the value of the looked up table based on the transported scalar. + * \return Pointer to the transported scalars source term. + */ + inline const su2double* GetScalarLookups(unsigned long iPoint) const override { return lookup_scalar[iPoint]; } + + inline void SetTableMisses(unsigned long iPoint, unsigned short misses) override { table_misses[iPoint] = misses; } + + inline unsigned short GetTableMisses(unsigned long iPoint) const override { return table_misses[iPoint]; } +}; diff --git a/SU2_CFD/include/variables/CSpeciesVariable.hpp b/SU2_CFD/include/variables/CSpeciesVariable.hpp index ac9b6fa4488..2c1b4a25f10 100644 --- a/SU2_CFD/include/variables/CSpeciesVariable.hpp +++ b/SU2_CFD/include/variables/CSpeciesVariable.hpp @@ -2,7 +2,7 @@ * \file CSpeciesVariable.hpp * \brief Base class for defining the variables of the species transport model. * \author T. Kattmann - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -38,7 +38,7 @@ class CSpeciesVariable : public CScalarVariable { MatrixType Diffusivity; /*!< \brief Matrix (nPoint,nVar) of mass diffusivities for scalar transport. */ public: - static constexpr size_t MAXNVAR = 4; /*!< \brief Max number of variables for static arrays. Increase, if necessary. */ + static constexpr size_t MAXNVAR = 20; /*!< \brief Max number of variables for static arrays. Increase, if necessary. */ /*! * \brief Constructor of the class. @@ -65,7 +65,7 @@ class CSpeciesVariable : public CScalarVariable { * \param[in] val_ivar - eqn. index to the mass diffusivity. * \return Value of the mass diffusivity */ - inline su2double GetDiffusivity(unsigned long iPoint, unsigned short val_ivar) { + inline su2double GetDiffusivity(unsigned long iPoint, unsigned short val_ivar) const { return Diffusivity(iPoint, val_ivar); } diff --git a/SU2_CFD/include/variables/CTransLMVariable.hpp b/SU2_CFD/include/variables/CTransLMVariable.hpp index 315e03fbba3..cb4cd0d8f97 100644 --- a/SU2_CFD/include/variables/CTransLMVariable.hpp +++ b/SU2_CFD/include/variables/CTransLMVariable.hpp @@ -2,7 +2,7 @@ * \file CTransLMVariable.hpp * \brief Declaration of the variables of the transition model. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CTurbSAVariable.hpp b/SU2_CFD/include/variables/CTurbSAVariable.hpp index 04794ff3622..569e416fa15 100644 --- a/SU2_CFD/include/variables/CTurbSAVariable.hpp +++ b/SU2_CFD/include/variables/CTurbSAVariable.hpp @@ -2,7 +2,7 @@ * \file CTurbSAVariable.hpp * \brief Declaration of the variables of the SA turbulence model. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CTurbSSTVariable.hpp b/SU2_CFD/include/variables/CTurbSSTVariable.hpp index 9abf005f367..0113a0ead3a 100644 --- a/SU2_CFD/include/variables/CTurbSSTVariable.hpp +++ b/SU2_CFD/include/variables/CTurbSSTVariable.hpp @@ -2,7 +2,7 @@ * \file CTurbSSTVariable.hpp * \brief Declaration of the variables of the SST turbulence model. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CTurbVariable.hpp b/SU2_CFD/include/variables/CTurbVariable.hpp index 368fd330824..1a476fdac70 100644 --- a/SU2_CFD/include/variables/CTurbVariable.hpp +++ b/SU2_CFD/include/variables/CTurbVariable.hpp @@ -2,7 +2,7 @@ * \file CTurbVariable.hpp * \brief Base class for defining the variables of the turbulence model. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/include/variables/CVariable.hpp b/SU2_CFD/include/variables/CVariable.hpp index f80faebdd10..050be2b7787 100644 --- a/SU2_CFD/include/variables/CVariable.hpp +++ b/SU2_CFD/include/variables/CVariable.hpp @@ -4,7 +4,7 @@ variables, function definitions in file CVariable.cpp. All variables are children of at least this class. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -492,6 +492,7 @@ class CVariable { * \return Pointer to the solution (at time n) vector. */ inline su2double *GetSolution_time_n(unsigned long iPoint) { return Solution_time_n[iPoint]; } + inline MatrixType& GetSolution_time_n() { return Solution_time_n; } /*! * \brief Get the solution at time n-1. @@ -499,6 +500,7 @@ class CVariable { * \return Pointer to the solution (at time n-1) vector. */ inline su2double *GetSolution_time_n1(unsigned long iPoint) { return Solution_time_n1[iPoint]; } + inline MatrixType& GetSolution_time_n1() { return Solution_time_n1; } /*! * \brief Set the value of the old residual. @@ -792,34 +794,6 @@ class CVariable { inline MatrixType& GetSolution_Min() { return Solution_Min; } inline const MatrixType& GetSolution_Min() const { return Solution_Min; } - /*! - * \brief Get the value of the wind gust - * \param[in] iPoint - Point index. - * \return Value of the wind gust - */ - inline virtual su2double* GetWindGust(unsigned long iPoint) { return nullptr; } - - /*! - * \brief Set the value of the wind gust - * \param[in] iPoint - Point index. - * \param[in] val_WindGust - Value of the wind gust - */ - inline virtual void SetWindGust(unsigned long iPoint, const su2double* val_WindGust) {} - - /*! - * \brief Get the value of the derivatives of the wind gust - * \param[in] iPoint - Point index. - * \return Value of the derivatives of the wind gust - */ - inline virtual su2double* GetWindGustDer(unsigned long iPoint) { return nullptr;} - - /*! - * \brief Set the value of the derivatives of the wind gust - * \param[in] iPoint - Point index. - * \param[in] val_WindGust - Value of the derivatives of the wind gust - */ - inline virtual void SetWindGustDer(unsigned long iPoint, const su2double* val_WindGust) {} - /*! * \brief Set the value of the time step. * \param[in] iPoint - Point index. @@ -1113,6 +1087,13 @@ class CVariable { */ inline virtual su2double GetThermalConductivity(unsigned long iPoint) const { return 0.0; } + /*! + * \brief A virtual member. + * \param[in] iPoint - Point index. + * \return Value of the mass diffusivity. + */ + inline virtual su2double GetDiffusivity(unsigned long iPoint, unsigned short val_ivar) const { return 0.0; } + /*! * \brief A virtual member. * \param[in] iPoint - Point index. @@ -1527,11 +1508,6 @@ class CVariable { */ inline virtual su2double Get_FlowTraction_n(unsigned long iPoint, unsigned long iVar) const { return 0.0; } - /*! - * \brief A virtual member. - */ - inline virtual void Clear_FlowTraction() {} - /*! * \brief A virtual member. */ @@ -1898,10 +1874,10 @@ class CVariable { inline virtual su2double GetSolution_Vel(unsigned long iPoint, unsigned long iVar) const { return 0.0; } /*! - * \brief Get the solution of the problem. - * \return Pointer to the solution vector. + * \brief Get the velocity (Structural Analysis). + * \return Pointer to the velocity vector at a point. */ - inline virtual su2double *GetSolution_Vel(unsigned long iPoint) {return nullptr; } + inline virtual su2double* GetSolution_Vel(unsigned long iPoint) { return nullptr; } /*! * \brief Get the velocity of the nodes (Structural Analysis) at time n. @@ -1911,11 +1887,10 @@ class CVariable { inline virtual su2double GetSolution_Vel_time_n(unsigned long iPoint, unsigned long iVar) const { return 0.0; } /*! - * \brief Get the solution at time n. - * \return Pointer to the solution (at time n) vector. + * \brief Get the velocity of the nodes (Structural Analysis) at time n. + * \return Pointer to the velocity vector at a point. */ - inline virtual su2double *GetSolution_Vel_time_n(unsigned long iPoint) { return nullptr; } - + inline virtual su2double* GetSolution_Vel_time_n(unsigned long iPoint) { return nullptr; } /*! * \brief Set the value of the acceleration (Structural Analysis). @@ -2042,6 +2017,11 @@ class CVariable { */ inline virtual const su2double *GetMesh_Coord(unsigned long iPoint) const { return nullptr; } + /*! + * \brief A virtual member. Get the undeformed coordinates for the entire domain. + */ + inline virtual const MatrixType *GetMesh_Coord() const { return nullptr; } + /*! * \brief A virtual member. Set the value of the undeformed coordinates. * \param[in] iDim - Index of Mesh_Coord[nDim] @@ -2148,12 +2128,12 @@ class CVariable { /*! * \brief A virtual member. */ - inline virtual void RegisterFlowTraction() { } + inline virtual void RegisterFlowTraction(bool reset) { } /*! * \brief A virtual member. */ - inline virtual su2double ExtractFlowTraction_Sensitivity(unsigned long iPoint, unsigned long iDim) const { return 0.0; } + inline virtual su2double ExtractFlowTractionSensitivity(unsigned long iPoint, unsigned long iDim) const { return 0.0; } /*! * \brief Register the variables in the solution array as input/output variable. @@ -2212,6 +2192,7 @@ class CVariable { * \return value of the Sensitivity */ inline virtual su2double GetSensitivity(unsigned long iPoint, unsigned long iDim) const { return 0.0; } + inline virtual const MatrixType& GetSensitivity() const { AssertOverride(); return Solution; } inline virtual void SetTau_Wall(unsigned long iPoint, su2double tau_wall) {} @@ -2298,4 +2279,59 @@ class CVariable { virtual su2double GetSourceTerm_DispAdjoint(unsigned long iPoint, unsigned long iDim) const { return 0.0; } virtual su2double GetSourceTerm_VelAdjoint(unsigned long iPoint, unsigned long iDim) const { return 0.0; } + /*! + * \brief Set fluid entropy + * \param[in] iPoint - Node index + * \param[in] entropy - fluid entropy value. + */ + inline virtual void SetEntropy(unsigned long iPoint, su2double entropy) { }; + + /*! + * \brief Get fluid entropy + * \param[in] iPoint - Node index + * \return Entropy - Fluid entropy value + */ + inline virtual su2double GetEntropy(unsigned long iPoint) const { return 0; } + + /*! + * \brief Set dataset extrapolation instance + * \param[in] iPoint - Node index + * \param[in] extrapolation - Extrapolation instance (0 = within dataset, 1 = outside dataset) + */ + inline virtual void SetDataExtrapolation(unsigned long iPoint, unsigned short extrapolation) { }; + + /*! + * \brief Get dataset extrapolation instance + * \param[in] iPoint - Node index + * \return extrapolation - Extrapolation instance (0 = within dataset, 1 = outside dataset) + */ + inline virtual unsigned short GetDataExtrapolation(unsigned long iPoint) const { return 0; } + + /*! + * \brief Set the number of iterations required by a Newton solver used by the fluid model. + * \param[in] iPoint - Node index + * \param[in] nIter - Number of iterations evaluated by the Newton solver + */ + inline virtual void SetNewtonSolverIterations(unsigned long iPoint, unsigned long nIter) { } + + /*! + * \brief Get the number of iterations required by a Newton solver used by the fluid model. + * \param[in] iPoint - Node index + * \return Number of iterations evaluated by the Newton solver + */ + inline virtual unsigned long GetNewtonSolverIterations(unsigned long iPoint) const { return 0; } + + /*! + * \brief LUT premixed flamelet: virtual functions for the speciesflameletvariable LUT + */ + inline virtual void SetLookupScalar(unsigned long iPoint, su2double val_lookup_scalar, unsigned short val_ivar) { } + + inline virtual void SetScalarSource(unsigned long iPoint, unsigned short val_ivar, su2double val_source) { } + + inline virtual void SetTableMisses(unsigned long iPoint, unsigned short misses) { } + + inline virtual unsigned short GetTableMisses(unsigned long iPoint) const { return 0; } + + inline virtual const su2double *GetScalarSources(unsigned long iPoint) const { return nullptr; } + inline virtual const su2double *GetScalarLookups(unsigned long iPoint) const { return nullptr; } }; diff --git a/SU2_CFD/obj/Makefile.am b/SU2_CFD/obj/Makefile.am deleted file mode 100644 index 6926cadc38d..00000000000 --- a/SU2_CFD/obj/Makefile.am +++ /dev/null @@ -1,277 +0,0 @@ -################################################################################ -# -# \file Makefile.am -# \brief Makefile for SU2_CFD -# \author M. Colonno, T. Economon, F. Palacios -# \version 7.5.1 "Blackbird" -# -# SU2 Project Website: https://su2code.github.io -# -# The SU2 Project is maintained by the SU2 Foundation -# (http://su2foundation.org) -# -# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) -# -# SU2 is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# SU2 is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with SU2. If not, see . -# -################################################################################ - -AUTOMAKE_OPTIONS = subdir-objects -ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} - -bin_PROGRAMS = -noinst_LIBRARIES = - -if BUILD_NORMAL -bin_PROGRAMS += ../bin/SU2_CFD -noinst_LIBRARIES+= libSU2Core.a -endif - -if BUILD_DIRECTDIFF -bin_PROGRAMS += ../bin/SU2_CFD_DIRECTDIFF -noinst_LIBRARIES+= libSU2Core_DIRECTDIFF.a -endif - -if BUILD_REVERSE -bin_PROGRAMS += ../bin/SU2_CFD_AD -noinst_LIBRARIES+= libSU2Core_AD.a -endif - -libSU2Core_sources = ../src/definition_structure.cpp \ - ../src/fluid/CFluidModel.cpp \ - ../src/fluid/CIdealGas.cpp \ - ../src/fluid/CFluidScalar.cpp \ - ../src/fluid/CPengRobinson.cpp \ - ../src/fluid/CVanDerWaalsGas.cpp \ - ../src/fluid/CCoolProp.cpp \ - ../src/fluid/CNEMOGas.cpp \ - ../src/fluid/CSU2TCLib.cpp \ - ../src/fluid/CMutationTCLib.cpp \ - ../src/integration/CIntegration.cpp \ - ../src/integration/CSingleGridIntegration.cpp \ - ../src/integration/CMultiGridIntegration.cpp \ - ../src/integration/CNewtonIntegration.cpp \ - ../src/integration/CStructuralIntegration.cpp \ - ../src/integration/CFEM_DG_Integration.cpp \ - ../src/integration/CIntegrationFactory.cpp \ - ../src/drivers/CMultizoneDriver.cpp \ - ../src/drivers/CSinglezoneDriver.cpp \ - ../src/drivers/CDiscAdjSinglezoneDriver.cpp \ - ../src/drivers/CDiscAdjMultizoneDriver.cpp \ - ../src/drivers/CDriver.cpp \ - ../src/drivers/CDummyDriver.cpp \ - ../src/iteration/CIteration.cpp \ - ../src/iteration/CIterationFactory.cpp \ - ../src/iteration/CAdjFluidIteration.cpp \ - ../src/iteration/CDiscAdjFluidIteration.cpp \ - ../src/iteration/CDiscAdjHeatIteration.cpp \ - ../src/iteration/CDiscAdjFEAIteration.cpp \ - ../src/iteration/CFEAIteration.cpp \ - ../src/iteration/CFEMFluidIteration.cpp \ - ../src/iteration/CFluidIteration.cpp \ - ../src/iteration/CHeatIteration.cpp \ - ../src/iteration/CTurboIteration.cpp \ - ../src/numerics/CNumerics.cpp \ - ../src/numerics/template.cpp \ - ../src/numerics/transition.cpp \ - ../src/numerics/radiation.cpp \ - ../src/numerics/CLookUpTable.cpp \ - ../src/numerics/CTrapezoidalMap.cpp \ - ../src/numerics/CFileReaderLUT.cpp \ - ../src/numerics/flow/convection/roe.cpp \ - ../src/numerics/flow/convection/fds.cpp \ - ../src/numerics/flow/convection/fvs.cpp \ - ../src/numerics/flow/convection/cusp.cpp \ - ../src/numerics/flow/convection/hllc.cpp \ - ../src/numerics/flow/convection/ausm_slau.cpp \ - ../src/numerics/flow/convection/centered.cpp \ - ../src/numerics/flow/flow_diffusion.cpp \ - ../src/numerics/flow/flow_sources.cpp \ - ../src/numerics/NEMO/convection/roe.cpp \ - ../src/numerics/NEMO/convection/ausm_slau.cpp \ - ../src/numerics/NEMO/convection/lax.cpp \ - ../src/numerics/NEMO/convection/msw.cpp \ - ../src/numerics/NEMO/CNEMONumerics.cpp \ - ../src/numerics/NEMO/NEMO_diffusion.cpp \ - ../src/numerics/NEMO/NEMO_sources.cpp \ - ../src/numerics/continuous_adjoint/adj_convection.cpp \ - ../src/numerics/continuous_adjoint/adj_diffusion.cpp \ - ../src/numerics/continuous_adjoint/adj_sources.cpp \ - ../src/numerics/scalar/scalar_sources.cpp \ - ../src/numerics/species/species_sources.cpp \ - ../src/numerics/elasticity/CFEAElasticity.cpp \ - ../src/numerics/elasticity/CFEALinearElasticity.cpp \ - ../src/numerics/elasticity/CFEANonlinearElasticity.cpp \ - ../src/numerics/elasticity/nonlinear_models.cpp \ - ../include/numerics_simd/CNumericsSIMD.cpp \ - ../src/output/filewriter/CCSVFileWriter.cpp \ - ../src/output/filewriter/CSTLFileWriter.cpp \ - ../src/output/filewriter/CFEMDataSorter.cpp \ - ../src/output/filewriter/CFVMDataSorter.cpp \ - ../src/output/filewriter/CParallelDataSorter.cpp \ - ../src/output/filewriter/CParallelFileWriter.cpp \ - ../src/output/filewriter/CParaviewBinaryFileWriter.cpp \ - ../src/output/filewriter/CParaviewXMLFileWriter.cpp \ - ../src/output/filewriter/CParaviewVTMFileWriter.cpp \ - ../src/output/filewriter/CParaviewFileWriter.cpp \ - ../src/output/filewriter/CSurfaceFEMDataSorter.cpp \ - ../src/output/filewriter/CSurfaceFVMDataSorter.cpp \ - ../src/output/filewriter/CSU2BinaryFileWriter.cpp \ - ../src/output/filewriter/CSU2FileWriter.cpp \ - ../src/output/filewriter/CSU2MeshFileWriter.cpp \ - ../src/output/filewriter/CTecplotFileWriter.cpp \ - ../src/output/filewriter/CTecplotBinaryFileWriter.cpp \ - ../src/output/filewriter/CCGNSFileWriter.cpp \ - ../src/output/tools/CWindowingTools.cpp \ - ../src/output/COutput.cpp \ - ../src/output/output_physics.cpp \ - ../src/output/CMeshOutput.cpp \ - ../src/output/CElasticityOutput.cpp \ - ../src/output/CFVMOutput.cpp \ - ../src/output/CFlowOutput.cpp \ - ../src/output/CFlowCompOutput.cpp \ - ../src/output/CFlowCompFEMOutput.cpp \ - ../src/output/CFlowIncOutput.cpp \ - ../src/output/CHeatOutput.cpp \ - ../src/output/CBaselineOutput.cpp \ - ../src/output/CAdjElasticityOutput.cpp \ - ../src/output/CAdjHeatOutput.cpp \ - ../src/output/CAdjFlowOutput.cpp \ - ../src/output/CAdjFlowCompOutput.cpp \ - ../src/output/CAdjFlowIncOutput.cpp \ - ../src/output/CMultizoneOutput.cpp \ - ../src/output/CNEMOCompOutput.cpp \ - ../src/output/COutputFactory.cpp \ - ../src/output/output_structure_legacy.cpp \ - ../src/python_wrapper_structure.cpp \ - ../src/solvers/CAdjEulerSolver.cpp \ - ../src/solvers/CAdjNSSolver.cpp \ - ../src/solvers/CAdjTurbSolver.cpp \ - ../src/solvers/CBaselineSolver.cpp \ - ../src/solvers/CBaselineSolver_FEM.cpp \ - ../src/solvers/CDiscAdjFEASolver.cpp \ - ../src/solvers/CDiscAdjMeshSolver.cpp \ - ../src/solvers/CDiscAdjSolver.cpp \ - ../src/solvers/CEulerSolver.cpp \ - ../src/solvers/CFEASolver.cpp \ - ../src/solvers/CFEM_DG_EulerSolver.cpp \ - ../src/solvers/CFEM_DG_NSSolver.cpp \ - ../src/solvers/CHeatSolver.cpp \ - ../src/solvers/CIncEulerSolver.cpp \ - ../src/solvers/CIncNSSolver.cpp \ - ../src/solvers/CMeshSolver.cpp \ - ../src/solvers/CRadSolver.cpp \ - ../src/solvers/CRadP1Solver.cpp \ - ../src/solvers/CNEMOEulerSolver.cpp \ - ../src/solvers/CNEMONSSolver.cpp \ - ../src/solvers/CNSSolver.cpp \ - ../src/solvers/CSolver.cpp \ - ../src/solvers/CTemplateSolver.cpp \ - ../src/solvers/CTransLMSolver.cpp \ - ../src/solvers/CSpeciesSolver.cpp \ - ../src/solvers/CTurbSolver.cpp \ - ../src/solvers/CTurbSASolver.cpp \ - ../src/solvers/CTurbSSTSolver.cpp \ - ../src/solvers/CSolverFactory.cpp \ - ../src/limiters/CLimiterDetails.cpp \ - ../src/CMarkerProfileReaderFVM.cpp \ - ../src/interfaces/CInterface.cpp \ - ../src/interfaces/cfd/CConservativeVarsInterface.cpp \ - ../src/interfaces/cfd/CMixingPlaneInterface.cpp \ - ../src/interfaces/cfd/CSlidingInterface.cpp \ - ../src/interfaces/cht/CConjugateHeatInterface.cpp \ - ../src/interfaces/fsi/CDisplacementsInterface.cpp \ - ../src/interfaces/fsi/CFlowTractionInterface.cpp \ - ../src/interfaces/fsi/CDiscAdjFlowTractionInterface.cpp \ - ../src/variables/CFEABoundVariable.cpp \ - ../src/variables/CRadVariable.cpp \ - ../src/variables/CRadP1Variable.cpp \ - ../src/variables/CDiscAdjMeshBoundVariable.cpp \ - ../src/variables/CMeshBoundVariable.cpp \ - ../src/variables/CMeshElement.cpp \ - ../src/variables/CMeshVariable.cpp \ - ../src/variables/CHeatVariable.cpp \ - ../src/variables/CVariable.cpp \ - ../src/variables/CAdjNSVariable.cpp \ - ../src/variables/CTurbSSTVariable.cpp \ - ../src/variables/CAdjTurbVariable.cpp \ - ../src/variables/CTransLMVariable.cpp \ - ../src/variables/CDiscAdjFEABoundVariable.cpp \ - ../src/variables/CIncEulerVariable.cpp \ - ../src/variables/CScalarVariable.cpp \ - ../src/variables/CSpeciesVariable.cpp \ - ../src/variables/CTurbVariable.cpp \ - ../src/variables/CNSVariable.cpp \ - ../src/variables/CNEMOEulerVariable.cpp \ - ../src/variables/CNEMONSVariable.cpp \ - ../src/variables/CBaselineVariable.cpp \ - ../src/variables/CTurbSAVariable.cpp \ - ../src/variables/CFEAVariable.cpp \ - ../src/variables/CAdjEulerVariable.cpp \ - ../src/variables/CDiscAdjVariable.cpp \ - ../src/variables/CIncNSVariable.cpp \ - ../src/variables/CEulerVariable.cpp \ - ../src/variables/CFlowVariable.cpp - -su2_cfd_sources = \ - ../src/SU2_CFD.cpp - -libSU2Core_cxx_flags = -fPIC -std=c++11 -libSU2Core_libadd = - -su2_cfd_cxx_flags = -fPIC -std=c++11 -su2_cfd_ldadd = - -# always link to built dependencies from ./externals -su2_cfd_cxx_flags += @su2_externals_INCLUDES@ -su2_cfd_ldadd += @su2_externals_LIBS@ -su2_cfd_ldadd += @su2_externals_LIBPTHREAD@ -libSU2Core_cxx_flags += @su2_externals_INCLUDES@ - -# if BUILD_MUTATIONPP -su2_cfd_cxx_flags += @MUTATIONPP_CXX@ -su2_cfd_ldadd += @MUTATIONPP_LD@ -# endif - - -su2_cfd_cxx_flags += @CoolProp_CXX@ -su2_cfd_ldadd += @CoolProp_LD@ - - -if BUILD_NORMAL -libSU2Core_a_SOURCES = $(libSU2Core_sources) -libSU2Core_a_CXXFLAGS = $(libSU2Core_cxx_flags) -libSU2Core_a_LIBADD = $(libSU2Core_libadd) -___bin_SU2_CFD_SOURCES = $(su2_cfd_sources) -___bin_SU2_CFD_CXXFLAGS = ${su2_cfd_cxx_flags} -___bin_SU2_CFD_LDADD = libSU2Core.a ../../Common/lib/libSU2.a ${su2_cfd_ldadd} -endif - -if BUILD_DIRECTDIFF -libSU2Core_DIRECTDIFF_a_SOURCES = $(libSU2Core_sources) -libSU2Core_DIRECTDIFF_a_CXXFLAGS = @DIRECTDIFF_CXX@ $(libSU2Core_cxx_flags) -libSU2Core_DIRECTDIFF_a_LIBADD = @DIRECTDIFF_LIBS@ $(libSU2Core_libadd) -___bin_SU2_CFD_DIRECTDIFF_SOURCES = $(su2_cfd_sources) -___bin_SU2_CFD_DIRECTDIFF_CXXFLAGS = @DIRECTDIFF_CXX@ ${su2_cfd_cxx_flags} -___bin_SU2_CFD_DIRECTDIFF_LDADD = libSU2Core_DIRECTDIFF.a @DIRECTDIFF_LIBS@ ../../Common/lib/libSU2_DIRECTDIFF.a ${su2_cfd_ldadd} -endif - -if BUILD_REVERSE -libSU2Core_AD_a_SOURCES = $(libSU2Core_sources) -libSU2Core_AD_a_CXXFLAGS = @REVERSE_CXX@ $(libSU2Core_cxx_flags) -libSU2Core_AD_a_LIBADD = @REVERSE_LIBS@ $(libSU2Core_libadd) -___bin_SU2_CFD_AD_SOURCES = $(su2_cfd_sources) -___bin_SU2_CFD_AD_CXXFLAGS = @REVERSE_CXX@ ${su2_cfd_cxx_flags} -___bin_SU2_CFD_AD_LDADD = libSU2Core_AD.a @REVERSE_LIBS@ ../../Common/lib/libSU2_AD.a ${su2_cfd_ldadd} -endif diff --git a/SU2_CFD/src/CMarkerProfileReaderFVM.cpp b/SU2_CFD/src/CMarkerProfileReaderFVM.cpp index cf6090d15c7..485b004be9b 100644 --- a/SU2_CFD/src/CMarkerProfileReaderFVM.cpp +++ b/SU2_CFD/src/CMarkerProfileReaderFVM.cpp @@ -2,7 +2,7 @@ * \file CMarkerProfileReaderFVM.cpp * \brief Class that handles the reading of marker profile files. * \author T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -25,6 +25,8 @@ * License along with SU2. If not, see . */ +#include + #include "../include/CMarkerProfileReaderFVM.hpp" CMarkerProfileReaderFVM::CMarkerProfileReaderFVM(CGeometry *val_geometry, @@ -44,11 +46,11 @@ CMarkerProfileReaderFVM::CMarkerProfileReaderFVM(CGeometry *val_geometry, this->geometry = val_geometry; dimension = geometry->GetnDim(); - filename = val_filename; + filename = std::move(val_filename); markerType = val_kind_marker; numberOfVars = val_number_vars; - columnNames = val_columnNames; - columnValues = val_columnValues; + columnNames = std::move(val_columnNames); + columnValues = std::move(val_columnValues); /* Attempt to open the specified file. */ ifstream profile_file; @@ -68,7 +70,7 @@ CMarkerProfileReaderFVM::CMarkerProfileReaderFVM(CGeometry *val_geometry, } -CMarkerProfileReaderFVM::~CMarkerProfileReaderFVM(void) { } +CMarkerProfileReaderFVM::~CMarkerProfileReaderFVM() = default; void CMarkerProfileReaderFVM::ReadMarkerProfile() { @@ -100,11 +102,11 @@ void CMarkerProfileReaderFVM::ReadMarkerProfile() { getline (profile_file, text_line); text_line.erase (0,11); for (unsigned short iChar = 0; iChar < 20; iChar++) { - position = text_line.find( " ", 0 ); if (position != string::npos) text_line.erase (position,1); - position = text_line.find( "\r", 0 ); if (position != string::npos) text_line.erase (position,1); - position = text_line.find( "\n", 0 ); if (position != string::npos) text_line.erase (position,1); + position = text_line.find( ' ', 0 ); if (position != string::npos) text_line.erase (position,1); + position = text_line.find( '\r', 0 ); if (position != string::npos) text_line.erase (position,1); + position = text_line.find( '\n', 0 ); if (position != string::npos) text_line.erase (position,1); } - profileTags.push_back(text_line.c_str()); + profileTags.emplace_back(text_line.c_str()); /*--- read NROW ---*/ getline (profile_file, text_line); @@ -134,7 +136,7 @@ void CMarkerProfileReaderFVM::ReadMarkerProfile() { profile_file.close(); - if (nmarkFound==false) { + if (!nmarkFound) { SU2_MPI::Error("While opening profile file, no \"NMARK=\" specification was found", CURRENT_FUNCTION); } @@ -207,6 +209,9 @@ void CMarkerProfileReaderFVM::MergeProfileMarkers() { unsigned long index, iChar; char str_buf[MAX_STRING_SIZE]; + char name_buf[MAX_STRING_SIZE]; + char value_buf[MAX_STRING_SIZE]; + vector Marker_Tags; vector nRowCum_Counter; @@ -219,6 +224,7 @@ void CMarkerProfileReaderFVM::MergeProfileMarkers() { nLocalPoint = 0; numberOfProfiles = 0; for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { if (config->GetMarker_All_KindBC(iMarker) == markerType) { + numberOfProfiles++; for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); @@ -238,14 +244,15 @@ void CMarkerProfileReaderFVM::MergeProfileMarkers() { SU2_MPI::Gather(&Buffer_Send_nPoin, 1, MPI_UNSIGNED_LONG, Buffer_Recv_nPoin, 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&nLocalPoint, &MaxLocalPoint, 1, MPI_UNSIGNED_LONG, MPI_MAX, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(&numberOfProfiles, &maxProfiles, 1, MPI_UNSIGNED_LONG, MPI_MAX, SU2_MPI::GetComm()); + SU2_MPI::Reduce(&numberOfProfiles, &maxProfiles, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, + SU2_MPI::GetComm()); /*--- Send and Recv buffers. ---*/ - su2double *Buffer_Send_X = new su2double[MaxLocalPoint]; + auto *Buffer_Send_X = new su2double[MaxLocalPoint]; su2double *Buffer_Recv_X = nullptr; - su2double *Buffer_Send_Y = new su2double[MaxLocalPoint]; + auto *Buffer_Send_Y = new su2double[MaxLocalPoint]; su2double *Buffer_Recv_Y = nullptr; su2double *Buffer_Send_Z = nullptr, *Buffer_Recv_Z = nullptr; @@ -254,6 +261,12 @@ void CMarkerProfileReaderFVM::MergeProfileMarkers() { char *Buffer_Send_Str = new char[MaxLocalPoint*MAX_STRING_SIZE]; char *Buffer_Recv_Str = nullptr; + char *Buffer_Send_Name = new char[MaxLocalPoint*MAX_STRING_SIZE]; + char *Buffer_Recv_Name = nullptr; + + char *Buffer_Send_Value = new char[MaxLocalPoint*MAX_STRING_SIZE]; + char *Buffer_Recv_Value = nullptr; + /*--- Prepare the receive buffers in the master node only. ---*/ if (rank == MASTER_NODE) { @@ -261,7 +274,10 @@ void CMarkerProfileReaderFVM::MergeProfileMarkers() { Buffer_Recv_X = new su2double[nProcessor*MaxLocalPoint]; Buffer_Recv_Y = new su2double[nProcessor*MaxLocalPoint]; if (dimension == 3) Buffer_Recv_Z = new su2double[nProcessor*MaxLocalPoint]; + Buffer_Recv_Str = new char[nProcessor*MaxLocalPoint*MAX_STRING_SIZE]; + Buffer_Recv_Name = new char[nProcessor*MaxLocalPoint*MAX_STRING_SIZE]; + Buffer_Recv_Value = new char[nProcessor*MaxLocalPoint*MAX_STRING_SIZE]; /*--- Sum total number of nodes to be written and allocate arrays ---*/ @@ -275,6 +291,9 @@ void CMarkerProfileReaderFVM::MergeProfileMarkers() { profileCoords[iMarker].resize(dimension); } + totalColumnNames.resize(maxProfiles); + totalColumnValues.resize(maxProfiles); + } /*--- Main communication routine. Loop over each coordinate and perform @@ -316,6 +335,16 @@ void CMarkerProfileReaderFVM::MergeProfileMarkers() { SPRINTF(&Buffer_Send_Str[jPoint*MAX_STRING_SIZE], "%s", config->GetMarker_All_TagBound(iMarker).c_str()); + /*--- Store the column names ---*/ + + SPRINTF(&Buffer_Send_Name[jPoint*MAX_STRING_SIZE], "%s", + columnNames[iMarker].c_str()); + + /*--- Store the column values ---*/ + + SPRINTF(&Buffer_Send_Value[jPoint*MAX_STRING_SIZE], "%s", + columnValues[iMarker].c_str()); + /*--- Increment jPoint as the counter. We need this because iPoint may include halo nodes that we skip over during this loop. ---*/ @@ -339,11 +368,18 @@ void CMarkerProfileReaderFVM::MergeProfileMarkers() { SU2_MPI::Gather(Buffer_Send_Str, (int)MaxLocalPoint*MAX_STRING_SIZE, MPI_CHAR, Buffer_Recv_Str, (int)MaxLocalPoint*MAX_STRING_SIZE, MPI_CHAR, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_Name, (int)MaxLocalPoint*MAX_STRING_SIZE, MPI_CHAR, + Buffer_Recv_Name, (int)MaxLocalPoint*MAX_STRING_SIZE, MPI_CHAR, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(Buffer_Send_Value, (int)MaxLocalPoint*MAX_STRING_SIZE, MPI_CHAR, + Buffer_Recv_Value, (int)MaxLocalPoint*MAX_STRING_SIZE, MPI_CHAR, MASTER_NODE, SU2_MPI::GetComm()); + /*--- The master node unpacks and sorts this variable by marker tag. ---*/ if (rank == MASTER_NODE) { profileTags.clear(); + totalColumnNames.clear(); + totalColumnValues.clear(); /*--- First, parse the marker tags to count how many total profile markers we have now on the master. ---*/ @@ -353,30 +389,34 @@ void CMarkerProfileReaderFVM::MergeProfileMarkers() { index = (iProcessor*MaxLocalPoint + iPoint)*MAX_STRING_SIZE; for (iChar = 0; iChar < MAX_STRING_SIZE; iChar++) { str_buf[iChar] = Buffer_Recv_Str[index + iChar]; + name_buf[iChar] = Buffer_Recv_Name[index + iChar]; + value_buf[iChar] = Buffer_Recv_Value[index + iChar]; } + Marker_Tags.push_back(str_buf); - profileTags.push_back(str_buf); - } - } - /*--- Remove the duplicate profile marker strings. From 1 per point to 1 per marker. ---*/ + /*--- only add if not already in the list ---*/ + if (std::find(profileTags.begin(), profileTags.end(), str_buf) == profileTags.end()) { + profileTags.push_back(str_buf); + totalColumnNames.push_back(name_buf); + totalColumnValues.push_back(value_buf); + } - profileTags.erase(unique(profileTags.begin(), - profileTags.end()), - profileTags.end()); + } - /*--- Store the unique number of markers for writing later. ---*/ + } numberOfProfiles = profileTags.size(); /*--- Count the number of rows (nodes) per marker. ---*/ - numberOfRowsInProfile.resize(numberOfProfiles,0.0); + numberOfRowsInProfile.resize(maxProfiles,0.0); jPoint = 0; for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) { for (iPoint = 0; iPoint < Buffer_Recv_nPoin[iProcessor]; iPoint++) { - for (iMarker = 0; iMarker < numberOfProfiles; iMarker++) { + for (iMarker = 0; iMarker < maxProfiles; iMarker++) { if (profileTags[iMarker] == Marker_Tags[jPoint]) { + numberOfRowsInProfile[iMarker]++; } } @@ -389,7 +429,7 @@ void CMarkerProfileReaderFVM::MergeProfileMarkers() { jPoint = 0; kPoint = 0; for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) { for (iPoint = 0; iPoint < Buffer_Recv_nPoin[iProcessor]; iPoint++) { - for (iMarker = 0; iMarker < numberOfProfiles; iMarker++) { + for (iMarker = 0; iMarker < maxProfiles; iMarker++) { if (profileTags[iMarker] == Marker_Tags[kPoint]) { @@ -415,22 +455,26 @@ void CMarkerProfileReaderFVM::MergeProfileMarkers() { jPoint = (iProcessor+1)*MaxLocalPoint; } + } /*--- Immediately release the temporary data buffers. ---*/ - delete [] Buffer_Send_X; delete [] Buffer_Send_Y; delete [] Buffer_Send_Z; delete [] Buffer_Send_Str; + delete [] Buffer_Send_Name; + delete [] Buffer_Send_Value; + if (rank == MASTER_NODE) { delete [] Buffer_Recv_X; delete [] Buffer_Recv_Y; delete [] Buffer_Recv_Z; delete [] Buffer_Recv_nPoin; delete [] Buffer_Recv_Str; + delete [] Buffer_Recv_Name; + delete [] Buffer_Recv_Value; } - } void CMarkerProfileReaderFVM::WriteMarkerProfileTemplate() { @@ -448,43 +492,38 @@ void CMarkerProfileReaderFVM::WriteMarkerProfileTemplate() { if (rank == MASTER_NODE) { ofstream node_file("example_"+filename); - node_file << "NMARK= " << numberOfProfiles << endl; - unsigned short iMarkerCounter = 0; - for (unsigned short iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if (config->GetMarker_All_KindBC(iMarker) == markerType) { + for (unsigned long iMarker = 0; iMarker < numberOfProfiles; iMarker++) { /*--- Access the default data for this marker. ---*/ - - string Marker_Tag = profileTags[iMarkerCounter]; + string Marker_Tag = profileTags[iMarker]; /*--- Header information for this marker. ---*/ node_file << "MARKER_TAG= " << Marker_Tag << endl; - node_file << "NROW=" << numberOfRowsInProfile[iMarkerCounter] << endl; + node_file << "NROW=" << numberOfRowsInProfile[iMarker] << endl; node_file << "NCOL=" << nColumns << endl; + /*--- header line (names of the columns) --- */ - node_file << columnNames[iMarkerCounter] << endl; + node_file << totalColumnNames[iMarker] << endl; node_file << setprecision(15); node_file << std::scientific; /*--- Loop over the data structure and write the coords and vars. ---*/ - for (unsigned long iPoint = 0; iPoint < numberOfRowsInProfile[iMarkerCounter]; iPoint++) { - + for (unsigned long iPoint = 0; iPoint < numberOfRowsInProfile[iMarker]; iPoint++) { for (unsigned short iDim = 0; iDim < dimension; iDim++) { - node_file << profileCoords[iMarkerCounter][iDim][iPoint] << "\t"; + node_file << profileCoords[iMarker][iDim][iPoint] << "\t"; } - node_file << columnValues[iMarkerCounter] << endl; + node_file << totalColumnValues[iMarker] << endl; } - iMarkerCounter++; - } + } // iMarker node_file.close(); diff --git a/SU2_CFD/src/SU2_CFD.cpp b/SU2_CFD/src/SU2_CFD.cpp index 8737975e716..8cbd711ec99 100644 --- a/SU2_CFD/src/SU2_CFD.cpp +++ b/SU2_CFD/src/SU2_CFD.cpp @@ -2,7 +2,7 @@ * \file SU2_CFD.cpp * \brief Main file of the SU2 Computational Fluid Dynamics code * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) { /*--- Command line parsing ---*/ - CLI::App app{"SU2 v7.5.1 \"Blackbird\", The Open-Source CFD Code"}; + CLI::App app{"SU2 v8.0.0 \"Harrier\", The Open-Source CFD Code"}; app.add_flag("-d,--dryrun", dry_run, "Enable dry run mode.\n" "Only execute preprocessing steps using a dummy geometry."); app.add_option("-t,--threads", num_threads, "Number of OpenMP threads per MPI rank."); @@ -56,9 +56,7 @@ int main(int argc, char *argv[]) { CLI11_PARSE(app, argc, argv) - /*--- OpenMP initialization ---*/ - - omp_initialize(); + /*--- OpenMP setup ---*/ omp_set_num_threads(num_threads); @@ -73,6 +71,9 @@ int main(int argc, char *argv[]) { #endif SU2_MPI::Comm MPICommunicator = SU2_MPI::GetComm(); + /*--- Further initializations are placed in the constructor of CDriverBase, to ensure that they are also seen by the + python wrapper. */ + /*--- Uncomment the following line if runtime NaN catching is desired. ---*/ // feenableexcept(FE_INVALID | FE_OVERFLOW | FE_DIVBYZERO ); @@ -95,7 +96,6 @@ int main(int argc, char *argv[]) { const CConfig config(config_file_name, SU2_COMPONENT::SU2_CFD); const unsigned short nZone = config.GetnZone(); - const bool turbo = config.GetBoolTurbomachinery(); /*--- First, given the basic information about the number of zones and the solver types from the config, instantiate the appropriate driver for the problem @@ -111,7 +111,7 @@ int main(int argc, char *argv[]) { driver = new CDummyDriver(config_file_name, nZone, MPICommunicator); } - else if ((!multizone && !harmonic_balance && !turbo) || (turbo && disc_adj)) { + else if (!multizone && !harmonic_balance) { /*--- Generic single zone problem: instantiate the single zone driver class. ---*/ if (nZone != 1) @@ -125,7 +125,7 @@ int main(int argc, char *argv[]) { } } - else if (multizone && !turbo) { + else if (multizone) { /*--- Generic multizone problems. ---*/ if (disc_adj) { @@ -136,26 +136,21 @@ int main(int argc, char *argv[]) { } } - else if (harmonic_balance) { + else { + assert(harmonic_balance); /*--- Harmonic balance problem: instantiate the Harmonic Balance driver class. ---*/ driver = new CHBDriver(config_file_name, nZone, MPICommunicator); } - else if (turbo) { - - /*--- Turbomachinery problem. ---*/ - driver = new CTurbomachineryDriver(config_file_name, nZone, MPICommunicator); - - } /*--- These are all the possible cases ---*/ /*--- Launch the main external loop of the solver. ---*/ driver->StartSolver(); - /*--- Postprocess all the containers, close history file, exit SU2. ---*/ + /*--- Finalize solver, delete all the containers, close history file, exit SU2. ---*/ - driver->Postprocessing(); + driver->Finalize(); delete driver; @@ -164,10 +159,8 @@ int main(int argc, char *argv[]) { libxsmm_finalize(); #endif - /*--- Finalize AD, if necessary. ---*/ -#ifdef HAVE_OPDI - AD::getGlobalTape().finalize(); -#endif + /*--- Finalize AD. ---*/ + AD::Finalize(); /*--- Finalize MPI parallelization. ---*/ SU2_MPI::Finalize(); diff --git a/SU2_CFD/src/definition_structure.cpp b/SU2_CFD/src/definition_structure.cpp index 9a56d219a89..bc3c4bcc191 100644 --- a/SU2_CFD/src/definition_structure.cpp +++ b/SU2_CFD/src/definition_structure.cpp @@ -2,7 +2,7 @@ * \file definition_structure.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -116,7 +116,7 @@ void Partition_Analysis(CGeometry *geometry, CConfig *config) { /*--- Prepare and open the file ---*/ Profile_File.open("partitioning.csv"); /*--- Create the CSV header ---*/ - Profile_File << "\"Rank\", \"nNeighbors\", \"nPointTotal\", \"nEdge\", \"nPointGhost\", \"nSendTotal\", \"nRecvTotal\", \"nElemTotal\", \"nElemBoundary\", \"nElemHalo\", \"nnz\"" << endl; + Profile_File << R"("Rank", "nNeighbors", "nPointTotal", "nEdge", "nPointGhost", "nSendTotal", "nRecvTotal", "nElemTotal", "nElemBoundary", "nElemHalo", "nnz")" << endl; Profile_File.close(); } SU2_MPI::Barrier(SU2_MPI::GetComm()); @@ -157,7 +157,7 @@ void Partition_Analysis_FEM(CGeometry *geometry, CConfig *config) { /*--- Create an object of the class CMeshFEM_DG and retrieve the necessary geometrical information for the FEM DG solver. ---*/ - CMeshFEM_DG *DGGeometry = dynamic_cast(geometry); + auto *DGGeometry = dynamic_cast(geometry); unsigned long nVolElemOwned = DGGeometry->GetNVolElemOwned(); CVolumeElementFEM *volElem = DGGeometry->GetVolElem(); @@ -182,7 +182,7 @@ void Partition_Analysis_FEM(CGeometry *geometry, CConfig *config) { /*--- Determine the total number of elements and DOFS to be send. ---*/ for(unsigned long i=0; iGetnOuter_Iter(); const bool time_domain = driver_config->GetTime_Domain(); + driver_config->Set_StartTime(SU2_MPI::Wtime()); /*--- If the gradient of the objective function is 0 so are the adjoint variables. * Unless in unsteady problems where there are other contributions to the RHS. ---*/ @@ -388,7 +388,7 @@ void CDiscAdjMultizoneDriver::Run() { /*--- Add off-diagonal contribution (including the OF gradient) to Solution. ---*/ if (no_restart || (iInnerIter > 0)) { - Add_External_To_Solution(iZone); + AddExternalToSolution(iZone); } else { /*--- If we restarted, Solution already has all contributions, @@ -424,7 +424,7 @@ void CDiscAdjMultizoneDriver::Run() { /*--- Extract the cross-term performing a relaxed update of it and of the sum (External) for jZone. ---*/ - Update_Cross_Term(iZone, jZone); + UpdateCrossTerm(iZone, jZone); } } @@ -436,7 +436,7 @@ void CDiscAdjMultizoneDriver::Run() { /*--- Set the multizone output. ---*/ - driver_output->SetMultizoneHistory_Output(output_container, config_container, driver_config, TimeIter, iOuterIter); + driver_output->SetMultizoneHistoryOutput(output_container, config_container, driver_config, TimeIter, iOuterIter); /*--- Check for convergence. ---*/ @@ -470,7 +470,7 @@ bool CDiscAdjMultizoneDriver::EvaluateObjectiveFunctionGradient() { RecordingState = RECORDING::CLEAR_INDICES; AD::ClearAdjoints(); - SetAdj_ObjFunction(); + SetAdjObjFunction(); AD::ComputeAdjoint(OBJECTIVE_FUNCTION, START); /*--- Initialize External with the objective function gradient. ---*/ @@ -481,7 +481,7 @@ bool CDiscAdjMultizoneDriver::EvaluateObjectiveFunctionGradient() { iteration_container[iZone][INST_0]->IterateDiscAdj(geometry_container, solver_container, config_container, iZone, INST_0, false); - Add_Solution_To_External(iZone); + AddSolutionToExternal(iZone); for (unsigned short iSol=0; iSol < MAX_SOLS; iSol++) { auto solver = solver_container[iZone][INST_0][MESH_0][iSol]; @@ -512,7 +512,7 @@ void CDiscAdjMultizoneDriver::EvaluateSensitivities(unsigned long Iter, bool for Set_Solution_To_BGSSolution_k(iZone); - Add_External_To_Solution(iZone); + AddExternalToSolution(iZone); iteration_container[iZone][INST_0]->InitializeAdjoint(solver_container, geometry_container, config_container, iZone, INST_0); @@ -520,7 +520,7 @@ void CDiscAdjMultizoneDriver::EvaluateSensitivities(unsigned long Iter, bool for /*--- Initialize the adjoint of the objective function with 1.0. ---*/ - SetAdj_ObjFunction(); + SetAdjObjFunction(); /*--- Interpret the stored information by calling the corresponding routine of the AD tool. ---*/ @@ -666,14 +666,14 @@ void CDiscAdjMultizoneDriver::SetRecording(RECORDING kind_recording, Kind_Tape t config_container, iZone, INST_0); AD::Push_TapePosition(); /// leave_zone } - Print_DirectResidual(kind_recording); + PrintDirectResidual(kind_recording); } if (kind_recording != RECORDING::CLEAR_INDICES && driver_config->GetWrt_AD_Statistics()) { if (rank == MASTER_NODE) AD::PrintStatistics(); #ifdef CODI_REVERSE_TYPE if (size > SINGLE_NODE) { - su2double myMem = AD::getGlobalTape().getTapeValues().getUsedMemorySize(), totMem = 0.0; + su2double myMem = AD::getTape().getTapeValues().getUsedMemorySize(), totMem = 0.0; SU2_MPI::Allreduce(&myMem, &totMem, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); if (rank == MASTER_NODE) { cout << "MPI\n"; @@ -729,19 +729,19 @@ void CDiscAdjMultizoneDriver::SetObjFunction(RECORDING kind_recording) { solvers[HEAT_SOL]->Heat_Fluxes(geometry, solvers, config); } - direct_output[iZone]->SetHistory_Output(geometry, solvers, config); + direct_output[iZone]->SetHistoryOutput(geometry, solvers, config); ObjFunc += solvers[FLOW_SOL]->GetTotal_ComboObj(); break; case MAIN_SOLVER::DISC_ADJ_HEAT: solvers[HEAT_SOL]->Heat_Fluxes(geometry, solvers, config); - direct_output[iZone]->SetHistory_Output(geometry, solvers, config); + direct_output[iZone]->SetHistoryOutput(geometry, solvers, config); ObjFunc += solvers[HEAT_SOL]->GetTotal_ComboObj(); break; case MAIN_SOLVER::DISC_ADJ_FEM: solvers[FEA_SOL]->Postprocessing(geometry, config, numerics_container[iZone][INST_0][MESH_0][FEA_SOL], true); - direct_output[iZone]->SetHistory_Output(geometry, solvers, config); + direct_output[iZone]->SetHistoryOutput(geometry, solvers, config); ObjFunc += solvers[FEA_SOL]->GetTotal_ComboObj(); break; @@ -763,16 +763,16 @@ void CDiscAdjMultizoneDriver::SetObjFunction(RECORDING kind_recording) { } } -void CDiscAdjMultizoneDriver::SetAdj_ObjFunction() { - - const auto IterAvg_Obj = config_container[ZONE_0]->GetIter_Avg_Objective(); +void CDiscAdjMultizoneDriver::SetAdjObjFunction() { su2double seeding = 1.0; - if (config_container[ZONE_0]->GetTime_Marching() != TIME_MARCHING::STEADY){ - if (TimeIter < IterAvg_Obj){ - // Default behavior (in case no specific window is chosen) is to use Square-Windowing, i.e. the numerator equals 1.0 + if (config_container[ZONE_0]->GetTime_Domain()) { + const auto IterAvg_Obj = config_container[ZONE_0]->GetIter_Avg_Objective(); + if (TimeIter < IterAvg_Obj) { + /*--- Default behavior when no window is chosen is to use Square-Windowing, i.e. the numerator equals 1.0 ---*/ auto windowEvaluator = CWindowingTools(); - su2double weight = windowEvaluator.GetWndWeight(config_container[ZONE_0]->GetKindWindow(), TimeIter, IterAvg_Obj-1); + const su2double weight = + windowEvaluator.GetWndWeight(config_container[ZONE_0]->GetKindWindow(), TimeIter, IterAvg_Obj - 1); seeding = weight / IterAvg_Obj; } else { @@ -780,15 +780,16 @@ void CDiscAdjMultizoneDriver::SetAdj_ObjFunction() { } } if (rank == MASTER_NODE) { + AD::ResizeAdjoints(); AD::SetDerivative(ObjFunc_Index, SU2_TYPE::GetValue(seeding)); } } void CDiscAdjMultizoneDriver::ComputeAdjoints(unsigned short iZone, bool eval_transfer) { -#if defined(CODI_INDEX_TAPE) || defined(HAVE_OPDI) +#if defined(CODI_INDEX_REUSE) if (nZone > 1 && rank == MASTER_NODE) { - std::cout << "WARNING: Index AD types do not support multiple zones." << std::endl; + std::cout << "WARNING: AD types that reuse indices do not support multiple zones." << std::endl; } #endif @@ -861,7 +862,7 @@ void CDiscAdjMultizoneDriver::HandleDataTransfer() { for (unsigned short jZone = 0; jZone < nZone; jZone++){ /*--- The target zone is iZone ---*/ if (jZone != iZone && interface_container[jZone][iZone] != nullptr) { - DeformMesh |= Transfer_Data(jZone, iZone); + DeformMesh |= TransferData(jZone, iZone); } } @@ -873,7 +874,7 @@ void CDiscAdjMultizoneDriver::HandleDataTransfer() { } } -void CDiscAdjMultizoneDriver::Add_Solution_To_External(unsigned short iZone) { +void CDiscAdjMultizoneDriver::AddSolutionToExternal(unsigned short iZone) { for (unsigned short iSol=0; iSol < MAX_SOLS; iSol++) { auto solver = solver_container[iZone][INST_0][MESH_0][iSol]; @@ -882,7 +883,7 @@ void CDiscAdjMultizoneDriver::Add_Solution_To_External(unsigned short iZone) { } } -void CDiscAdjMultizoneDriver::Set_External_To_DualTimeDer() { +void CDiscAdjMultizoneDriver::SetExternalToDualTimeDer() { for (unsigned short iZone = 0; iZone < nZone; iZone++) { for (unsigned short iSol=0; iSol < MAX_SOLS; iSol++) { @@ -893,7 +894,7 @@ void CDiscAdjMultizoneDriver::Set_External_To_DualTimeDer() { } } -void CDiscAdjMultizoneDriver::Add_External_To_Solution(unsigned short iZone) { +void CDiscAdjMultizoneDriver::AddExternalToSolution(unsigned short iZone) { for (unsigned short iSol=0; iSol < MAX_SOLS; iSol++) { auto solver = solver_container[iZone][INST_0][MESH_0][iSol]; @@ -902,7 +903,7 @@ void CDiscAdjMultizoneDriver::Add_External_To_Solution(unsigned short iZone) { } } -void CDiscAdjMultizoneDriver::Set_SolutionOld_To_Solution(unsigned short iZone) { +void CDiscAdjMultizoneDriver::SetSolutionOldToSolution(unsigned short iZone) { for (unsigned short iSol=0; iSol < MAX_SOLS; iSol++) { auto solver = solver_container[iZone][INST_0][MESH_0][iSol]; @@ -911,7 +912,7 @@ void CDiscAdjMultizoneDriver::Set_SolutionOld_To_Solution(unsigned short iZone) } } -void CDiscAdjMultizoneDriver::Update_Cross_Term(unsigned short iZone, unsigned short jZone) { +void CDiscAdjMultizoneDriver::UpdateCrossTerm(unsigned short iZone, unsigned short jZone) { for (unsigned short iSol=0; iSol < MAX_SOLS; iSol++) { auto solver = solver_container[jZone][INST_0][MESH_0][iSol]; diff --git a/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp b/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp index 41262b913df..9511f87a7fd 100644 --- a/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp +++ b/SU2_CFD/src/drivers/CDiscAdjSinglezoneDriver.cpp @@ -2,7 +2,7 @@ * \file driver_adjoint_singlezone.cpp * \brief The main subroutines for driving adjoint single-zone problems. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -28,7 +28,6 @@ #include "../../include/drivers/CDiscAdjSinglezoneDriver.hpp" #include "../../include/output/tools/CWindowingTools.hpp" #include "../../include/output/COutputFactory.hpp" -#include "../../include/output/COutputLegacy.hpp" #include "../../include/output/COutput.hpp" #include "../../include/iteration/CIterationFactory.hpp" #include "../../include/iteration/CTurboIteration.hpp" @@ -66,7 +65,6 @@ CDiscAdjSinglezoneDriver::CDiscAdjSinglezoneDriver(char* confFile, if (config->GetBoolTurbomachinery()) { direct_iteration = new CTurboIteration(config); - output_legacy = COutputFactory::CreateLegacyOutput(config_container[ZONE_0]); } else { direct_iteration = CIterationFactory::CreateIteration(MAIN_SOLVER::EULER, config); } @@ -122,7 +120,7 @@ CDiscAdjSinglezoneDriver::CDiscAdjSinglezoneDriver(char* confFile, } -CDiscAdjSinglezoneDriver::~CDiscAdjSinglezoneDriver(void) { +CDiscAdjSinglezoneDriver::~CDiscAdjSinglezoneDriver() { delete direct_iteration; delete direct_output; @@ -131,6 +129,10 @@ CDiscAdjSinglezoneDriver::~CDiscAdjSinglezoneDriver(void) { void CDiscAdjSinglezoneDriver::Preprocess(unsigned long TimeIter) { + /*--- Set the current time iteration in the config and also in the driver + * because the python interface doesn't offer an explicit way of doing it. ---*/ + + this->TimeIter = TimeIter; config_container[ZONE_0]->SetTimeIter(TimeIter); /*--- Preprocess the adjoint iteration ---*/ @@ -173,7 +175,7 @@ void CDiscAdjSinglezoneDriver::Run() { /*--- Initialize the adjoint of the objective function with 1.0. ---*/ - SetAdj_ObjFunction(); + SetAdjObjFunction(); /*--- Interpret the stored information by calling the corresponding routine of the AD tool. ---*/ @@ -304,7 +306,7 @@ void CDiscAdjSinglezoneDriver::SetRecording(RECORDING kind_recording){ if (rank == MASTER_NODE) AD::PrintStatistics(); #ifdef CODI_REVERSE_TYPE if (size > SINGLE_NODE) { - su2double myMem = AD::getGlobalTape().getTapeValues().getUsedMemorySize(), totMem = 0.0; + su2double myMem = AD::getTape().getTapeValues().getUsedMemorySize(), totMem = 0.0; SU2_MPI::Allreduce(&myMem, &totMem, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); if (rank == MASTER_NODE) { cout << "MPI\n"; @@ -320,24 +322,22 @@ void CDiscAdjSinglezoneDriver::SetRecording(RECORDING kind_recording){ } -void CDiscAdjSinglezoneDriver::SetAdj_ObjFunction(){ - - const auto IterAvg_Obj = config->GetIter_Avg_Objective(); +void CDiscAdjSinglezoneDriver::SetAdjObjFunction(){ su2double seeding = 1.0; - CWindowingTools windowEvaluator = CWindowingTools(); - - if (config->GetTime_Marching() != TIME_MARCHING::STEADY){ - if (TimeIter < IterAvg_Obj){ - /*--- Default behavior (in case no specific window is chosen) is to use Square-Windowing, i.e. the numerator equals 1.0 ---*/ - seeding = windowEvaluator.GetWndWeight(config->GetKindWindow(),TimeIter, IterAvg_Obj-1)/ (static_cast(IterAvg_Obj)); + if (config->GetTime_Domain()) { + const auto IterAvg_Obj = config->GetIter_Avg_Objective(); + if (TimeIter < IterAvg_Obj) { + /*--- Default behavior when no window is chosen is to use Square-Windowing, i.e. the numerator equals 1.0 ---*/ + auto windowEvaluator = CWindowingTools(); + const su2double weight = windowEvaluator.GetWndWeight(config->GetKindWindow(), TimeIter, IterAvg_Obj - 1); + seeding = weight / IterAvg_Obj; } else { seeding = 0.0; } } - - if (rank == MASTER_NODE){ + if (rank == MASTER_NODE) { SU2_TYPE::SetDerivative(ObjFunc, SU2_TYPE::GetValue(seeding)); } else { SU2_TYPE::SetDerivative(ObjFunc, 0.0); @@ -357,36 +357,13 @@ void CDiscAdjSinglezoneDriver::SetObjFunction(){ /*--- Surface based obj. function ---*/ - direct_output->SetHistory_Output(geometry, solver, config, config->GetTimeIter(), + direct_output->SetHistoryOutput(geometry, solver, config, config->GetTimeIter(), config->GetOuterIter(), config->GetInnerIter()); ObjFunc += solver[FLOW_SOL]->GetTotal_ComboObj(); - - /*--- These calls to be moved to a generic framework at a next stage ---*/ - /*--- Some things that are currently hacked into output must be reorganized ---*/ - if (config->GetBoolTurbomachinery()) { - output_legacy->ComputeTurboPerformance(solver[FLOW_SOL], geometry, config); - - unsigned short nMarkerTurboPerf = config->GetnMarker_TurboPerformance(); - unsigned short nSpanSections = config->GetnSpanWiseSections(); - - switch (config_container[ZONE_0]->GetKind_ObjFunc()){ - case ENTROPY_GENERATION: - ObjFunc += output_legacy->GetEntropyGen(nMarkerTurboPerf-1, nSpanSections); - break; - case FLOW_ANGLE_OUT: - ObjFunc += output_legacy->GetFlowAngleOut(nMarkerTurboPerf-1, nSpanSections); - break; - case MASS_FLOW_IN: - ObjFunc += output_legacy->GetMassFlowIn(nMarkerTurboPerf-1, nSpanSections); - break; - default: - break; - } - } break; case MAIN_SOLVER::DISC_ADJ_HEAT: - direct_output->SetHistory_Output(geometry, solver, config, config->GetTimeIter(), + direct_output->SetHistoryOutput(geometry, solver, config, config->GetTimeIter(), config->GetOuterIter(), config->GetInnerIter()); ObjFunc = solver[HEAT_SOL]->GetTotal_ComboObj(); break; @@ -394,7 +371,7 @@ void CDiscAdjSinglezoneDriver::SetObjFunction(){ case MAIN_SOLVER::DISC_ADJ_FEM: solver[FEA_SOL]->Postprocessing(geometry, config, numerics_container[ZONE_0][INST_0][MESH_0][FEA_SOL], true); - direct_output->SetHistory_Output(geometry, solver, config, config->GetTimeIter(), + direct_output->SetHistoryOutput(geometry, solver, config, config->GetTimeIter(), config->GetOuterIter(), config->GetInnerIter()); ObjFunc = solver[FEA_SOL]->GetTotal_ComboObj(); break; @@ -429,7 +406,7 @@ void CDiscAdjSinglezoneDriver::DirectRun(RECORDING kind_recording){ /*--- Print the direct residual to screen ---*/ - Print_DirectResidual(kind_recording); + PrintDirectResidual(kind_recording); } @@ -462,7 +439,7 @@ void CDiscAdjSinglezoneDriver::SecondaryRecording(){ /*--- Initialize the adjoint of the objective function with 1.0. ---*/ - SetAdj_ObjFunction(); + SetAdjObjFunction(); /*--- Interpret the stored information by calling the corresponding routine of the AD tool. ---*/ diff --git a/SU2_CFD/src/drivers/CDriver.cpp b/SU2_CFD/src/drivers/CDriver.cpp index 121cd94e9a5..c33977ad33f 100644 --- a/SU2_CFD/src/drivers/CDriver.cpp +++ b/SU2_CFD/src/drivers/CDriver.cpp @@ -2,7 +2,7 @@ * \file CDriver.cpp * \brief The main subroutines for driving single or multi-zone problems. * \author T. Economon, H. Kline, R. Sanchez, F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -38,8 +38,6 @@ #include "../../include/output/COutputFactory.hpp" #include "../../include/output/COutput.hpp" -#include "../../include/output/COutputLegacy.hpp" - #include "../../../Common/include/interface_interpolation/CInterpolator.hpp" #include "../../../Common/include/interface_interpolation/CInterpolatorFactory.hpp" @@ -61,7 +59,6 @@ #include "../../include/numerics/flow/convection/roe.hpp" #include "../../include/numerics/flow/convection/fds.hpp" #include "../../include/numerics/flow/convection/fvs.hpp" -#include "../../include/numerics/flow/convection/cusp.hpp" #include "../../include/numerics/flow/convection/hllc.hpp" #include "../../include/numerics/flow/convection/ausm_slau.hpp" #include "../../include/numerics/flow/convection/centered.hpp" @@ -104,23 +101,10 @@ #ifdef VTUNEPROF #include #endif -#include +#include CDriver::CDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator, bool dummy_geo) : - config_file_name(confFile), StartTime(0.0), StopTime(0.0), UsedTime(0.0), - TimeIter(0), nZone(val_nZone), StopCalc(false), fsi(false), fem_solver(false), dry_run(dummy_geo) { - - /*--- Initialize Medipack (must also be here so it is initialized from python) ---*/ -#ifdef HAVE_MPI - #if defined(CODI_REVERSE_TYPE) || defined(CODI_FORWARD_TYPE) - SU2_MPI::Init_AMPI(); - #endif -#endif - - SU2_MPI::SetComm(MPICommunicator); - - rank = SU2_MPI::GetRank(); - size = SU2_MPI::GetSize(); +CDriverBase(confFile, val_nZone, MPICommunicator), StopCalc(false), fsi(false), fem_solver(false), dry_run(dummy_geo) { /*--- Start timer to track preprocessing for benchmarking. ---*/ @@ -128,11 +112,11 @@ CDriver::CDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunica /*--- Initialize containers with null --- */ - SetContainers_Null(); + InitializeContainers(); /*--- Preprocessing of the config files. ---*/ - Input_Preprocessing(config_container, driver_config); + PreprocessInput(config_container, driver_config); /*--- Retrieve dimension from mesh file ---*/ @@ -141,7 +125,7 @@ CDriver::CDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunica /*--- Output preprocessing ---*/ - Output_Preprocessing(config_container, driver_config, output_container, driver_output); + PreprocessOutput(config_container, driver_config, output_container, driver_output); for (iZone = 0; iZone < nZone; iZone++) { @@ -171,7 +155,7 @@ CDriver::CDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunica identified and linked, face areas and volumes of the dual mesh cells are computed, and the multigrid levels are created using an agglomeration procedure. ---*/ - Geometrical_Preprocessing(config_container[iZone], geometry_container[iZone][iInst], dry_run); + InitializeGeometry(config_container[iZone], geometry_container[iZone][iInst], dry_run); } } @@ -194,7 +178,7 @@ CDriver::CDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunica fluxes, loops over the nodes to compute source terms, and routines for imposing various boundary condition type for the PDE. ---*/ - Solver_Preprocessing(config_container[iZone], geometry_container[iZone][iInst], solver_container[iZone][iInst]); + InitializeSolver(config_container[iZone], geometry_container[iZone][iInst], solver_container[iZone][iInst]); /*--- Definition of the numerical method class: numerics_container[#ZONES][#INSTANCES][#MG_GRIDS][#EQ_SYSTEMS][#EQ_TERMS]. @@ -203,7 +187,7 @@ CDriver::CDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunica data structure (centered, upwind, galerkin), as well as any source terms (piecewise constant reconstruction) evaluated in each dual mesh volume. ---*/ - Numerics_Preprocessing(config_container[iZone], geometry_container[iZone][iInst], + InitializeNumerics(config_container[iZone], geometry_container[iZone][iInst], solver_container[iZone][iInst], numerics_container[iZone][iInst]); /*--- Definition of the integration class: integration_container[#ZONES][#INSTANCES][#EQ_SYSTEMS]. @@ -212,7 +196,7 @@ CDriver::CDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunica the residual at each node, R(U) and then integrates the equations to a steady state or time-accurately. ---*/ - Integration_Preprocessing(config_container[iZone], solver_container[iZone][iInst][MESH_0], + InitializeIntegration(config_container[iZone], solver_container[iZone][iInst][MESH_0], integration_container[iZone][iInst]); /*--- Instantiate the type of physics iteration to be executed within each zone. For @@ -220,16 +204,16 @@ CDriver::CDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunica different physics in different zones (fluid-structure interaction), or couple multiple systems tightly within a single zone by creating a new iteration class (e.g., RANS). ---*/ - Iteration_Preprocessing(config_container[iZone], iteration_container[iZone][iInst]); + PreprocessIteration(config_container[iZone], iteration_container[iZone][iInst]); /*--- Dynamic mesh processing. ---*/ - DynamicMesh_Preprocessing(config_container[iZone], geometry_container[iZone][iInst], solver_container[iZone][iInst], + PreprocessDynamicMesh(config_container[iZone], geometry_container[iZone][iInst], solver_container[iZone][iInst], iteration_container[iZone][iInst], grid_movement[iZone][iInst], surface_movement[iZone]); /*--- Static mesh processing. ---*/ - StaticMesh_Preprocessing(config_container[iZone], geometry_container[iZone][iInst]); + PreprocessStaticMesh(config_container[iZone], geometry_container[iZone][iInst]); } @@ -246,14 +230,14 @@ CDriver::CDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunica if (rank == MASTER_NODE) cout << endl <<"------------------- Multizone Interface Preprocessing -------------------" << endl; - Interface_Preprocessing(config_container, solver_container, geometry_container, + InitializeInterface(config_container, solver_container, geometry_container, interface_types, interface_container, interpolator_container); } if (fsi) { for (iZone = 0; iZone < nZone; iZone++) { for (iInst = 0; iInst < nInst[iZone]; iInst++){ - Solver_Restart(solver_container[iZone][iInst], geometry_container[iZone][iInst], + RestartSolver(solver_container[iZone][iInst], geometry_container[iZone][iInst], config_container[iZone], true); } } @@ -263,11 +247,11 @@ CDriver::CDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunica if (rank == MASTER_NODE) cout << endl <<"---------------------- Turbomachinery Preprocessing ---------------------" << endl; - Turbomachinery_Preprocessing(config_container, geometry_container, solver_container, interface_container); + PreprocessTurbomachinery(config_container, geometry_container, solver_container, interface_container); } - PythonInterface_Preprocessing(config_container, geometry_container, solver_container); + PreprocessPythonInterface(config_container, geometry_container, solver_container); /*--- Preprocessing time is reported now, but not included in the next compute portion. ---*/ @@ -308,14 +292,13 @@ CDriver::CDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunica } -void CDriver::SetContainers_Null(){ +void CDriver::InitializeContainers(){ /*--- Create pointers to all of the classes that may be used throughout the SU2_CFD code. In general, the pointers are instantiated down a hierarchy over all zones, multigrid levels, equation sets, and equation terms as described in the comments below. ---*/ - ConvHist_file = nullptr; iteration_container = nullptr; output_container = nullptr; integration_container = nullptr; @@ -354,12 +337,10 @@ void CDriver::SetContainers_Null(){ nInst[iZone] = 1; } - strcpy(runtime_file_name, "runtime.dat"); - } -void CDriver::Postprocessing() { +void CDriver::Finalize() { const bool wrt_perf = config_container[ZONE_0]->GetWrt_Performance(); @@ -376,11 +357,11 @@ void CDriver::Postprocessing() { } if (rank == MASTER_NODE) - cout << endl <<"------------------------- Solver Postprocessing -------------------------" << endl; + cout <<"\n--------------------------- Finalizing Solver ---------------------------" << endl; for (iZone = 0; iZone < nZone; iZone++) { for (iInst = 0; iInst < nInst[iZone]; iInst++){ - Numerics_Postprocessing(numerics_container[iZone], solver_container[iZone][iInst], + FinalizeNumerics(numerics_container[iZone], solver_container[iZone][iInst], geometry_container[iZone][iInst], config_container[iZone], iInst); } delete [] numerics_container[iZone]; @@ -390,7 +371,7 @@ void CDriver::Postprocessing() { for (iZone = 0; iZone < nZone; iZone++) { for (iInst = 0; iInst < nInst[iZone]; iInst++){ - Integration_Postprocessing(integration_container[iZone], + FinalizeIntegration(integration_container[iZone], geometry_container[iZone][iInst], config_container[iZone], iInst); @@ -402,7 +383,7 @@ void CDriver::Postprocessing() { for (iZone = 0; iZone < nZone; iZone++) { for (iInst = 0; iInst < nInst[iZone]; iInst++){ - Solver_Postprocessing(solver_container[iZone], + FinalizeSolver(solver_container[iZone], geometry_container[iZone][iInst], config_container[iZone], iInst); @@ -562,7 +543,7 @@ void CDriver::Postprocessing() { } -void CDriver::Input_Preprocessing(CConfig **&config, CConfig *&driver_config) { +void CDriver::PreprocessInput(CConfig **&config, CConfig *&driver_config) { char zone_file_name[MAX_STRING_SIZE]; @@ -602,6 +583,10 @@ void CDriver::Input_Preprocessing(CConfig **&config, CConfig *&driver_config) { } } + /*--- Keep a reference to the main (ZONE 0) config. ---*/ + + main_config = config_container[ZONE_0]; + /*--- Determine whether or not the FEM solver is used, which decides the type of * geometry classes that are instantiated. Only adapted for single-zone problems ---*/ @@ -610,7 +595,7 @@ void CDriver::Input_Preprocessing(CConfig **&config, CConfig *&driver_config) { fsi = config_container[ZONE_0]->GetFSI_Simulation(); } -void CDriver::Geometrical_Preprocessing(CConfig* config, CGeometry **&geometry, bool dummy){ +void CDriver::InitializeGeometry(CConfig* config, CGeometry **&geometry, bool dummy){ if (!dummy){ if (rank == MASTER_NODE) @@ -619,13 +604,13 @@ void CDriver::Geometrical_Preprocessing(CConfig* config, CGeometry **&geometry, if( fem_solver ) { switch( config->GetKind_FEM_Flow() ) { case DG: { - Geometrical_Preprocessing_DGFEM(config, geometry); + InitializeGeometryDGFEM(config, geometry); break; } } } else { - Geometrical_Preprocessing_FVM(config, geometry); + InitializeGeometryFVM(config, geometry); } } else { if (rank == MASTER_NODE) @@ -706,9 +691,12 @@ void CDriver::Geometrical_Preprocessing(CConfig* config, CGeometry **&geometry, } + /*--- Keep a reference to the main (ZONE_0, INST_0, MESH_0) geometry. ---*/ + + main_geometry = geometry_container[ZONE_0][INST_0][MESH_0]; } -void CDriver::Geometrical_Preprocessing_FVM(CConfig *config, CGeometry **&geometry) { +void CDriver::InitializeGeometryFVM(CConfig *config, CGeometry **&geometry) { unsigned short iZone = config->GetiZone(), iMGlevel; unsigned short requestedMGlevels = config->GetnMGLevels(); @@ -928,7 +916,7 @@ void CDriver::Geometrical_Preprocessing_FVM(CConfig *config, CGeometry **&geomet } -void CDriver::Geometrical_Preprocessing_DGFEM(CConfig* config, CGeometry **&geometry) { +void CDriver::InitializeGeometryDGFEM(CConfig* config, CGeometry **&geometry) { /*--- Definition of the geometry class to store the primal grid in the partitioning process. ---*/ /*--- All ranks process the grid and call ParMETIS for partitioning ---*/ @@ -968,7 +956,7 @@ void CDriver::Geometrical_Preprocessing_DGFEM(CConfig* config, CGeometry **&geom /*--- Carry out a dynamic cast to CMeshFEM_DG, such that it is not needed to define all virtual functions in the base class CGeometry. ---*/ - CMeshFEM_DG *DGMesh = dynamic_cast(geometry[MESH_0]); + auto *DGMesh = dynamic_cast(geometry[MESH_0]); /*--- Determine the standard elements for the volume elements. ---*/ if (rank == MASTER_NODE) cout << "Creating standard volume elements." << endl; @@ -1014,13 +1002,13 @@ void CDriver::Geometrical_Preprocessing_DGFEM(CConfig* config, CGeometry **&geom for(unsigned short iMGlevel=1; iMGlevel<=config->GetnMGLevels(); iMGlevel++) { - SU2_MPI::Error("Geometrical_Preprocessing_DGFEM: Coarse grid levels not implemented yet.", + SU2_MPI::Error("InitializeGeometryDGFEM: Coarse grid levels not implemented yet.", CURRENT_FUNCTION); } } -void CDriver::Solver_Preprocessing(CConfig* config, CGeometry** geometry, CSolver ***&solver) { +void CDriver::InitializeSolver(CConfig* config, CGeometry** geometry, CSolver ***&solver) { MAIN_SOLVER kindSolver = config->GetKind_Solver(); @@ -1043,16 +1031,15 @@ void CDriver::Solver_Preprocessing(CConfig* config, CGeometry** geometry, CSolve /*--- Restart solvers, for FSI the geometry cannot be updated because the interpolation classes * should always use the undeformed mesh (otherwise the results would not be repeatable). ---*/ - if (!fsi) Solver_Restart(solver, geometry, config, true); + if (!fsi) RestartSolver(solver, geometry, config, true); /*--- Set up any necessary inlet profiles ---*/ - Inlet_Preprocessing(solver, geometry, config); + PreprocessInlet(solver, geometry, config); } -void CDriver::Inlet_Preprocessing(CSolver ***solver, CGeometry **geometry, - CConfig *config) const { +void CDriver::PreprocessInlet(CSolver ***solver, CGeometry **geometry, CConfig *config) const { /*--- Adjust iteration number for unsteady restarts. ---*/ @@ -1123,7 +1110,7 @@ void CDriver::Inlet_Preprocessing(CSolver ***solver, CGeometry **geometry, } -void CDriver::Solver_Restart(CSolver ***solver, CGeometry **geometry, +void CDriver::RestartSolver(CSolver ***solver, CGeometry **geometry, CConfig *config, bool update_geo) { /*--- Check for restarts and use the LoadRestart() routines. ---*/ @@ -1178,7 +1165,7 @@ void CDriver::Solver_Restart(CSolver ***solver, CGeometry **geometry, } -void CDriver::Solver_Postprocessing(CSolver ****solver, CGeometry **geometry, +void CDriver::FinalizeSolver(CSolver ****solver, CGeometry **geometry, CConfig *config, unsigned short val_iInst) { for (int iMGlevel = 0; iMGlevel <= config->GetnMGLevels(); iMGlevel++) { @@ -1193,7 +1180,7 @@ void CDriver::Solver_Postprocessing(CSolver ****solver, CGeometry **geometry, } -void CDriver::Integration_Preprocessing(CConfig *config, CSolver **solver, CIntegration **&integration) const { +void CDriver::InitializeIntegration(CConfig *config, CSolver **solver, CIntegration **&integration) const { if (rank == MASTER_NODE) cout << endl <<"----------------- Integration Preprocessing ( Zone " << config->GetiZone() <<" ) ------------------" << endl; @@ -1204,7 +1191,7 @@ void CDriver::Integration_Preprocessing(CConfig *config, CSolver **solver, CInte } -void CDriver::Integration_Postprocessing(CIntegration ***integration, CGeometry **geometry, CConfig *config, unsigned short val_iInst) { +void CDriver::FinalizeIntegration(CIntegration ***integration, CGeometry **geometry, CConfig *config, unsigned short val_iInst) { for (unsigned int iSol = 0; iSol < MAX_SOLS; iSol++){ delete integration[val_iInst][iSol]; @@ -1443,6 +1430,7 @@ void CDriver::InstantiateSpeciesNumerics(unsigned short nVar_Species, int offset numerics[iMGlevel][SPECIES_SOL][source_second_term] = new CSourceNothing(nDim, nVar_Species, config); } } + /*--- Explicit instantiation of the template above, needed because it is defined in a cpp file, instead of hpp. ---*/ template void CDriver::InstantiateSpeciesNumerics>( unsigned short, int, const CConfig*, const CSolver*, CNumerics****&) const; @@ -1453,7 +1441,7 @@ template void CDriver::InstantiateSpeciesNumerics>( unsigned short, int, const CConfig*, const CSolver*, CNumerics****&) const; -void CDriver::Numerics_Preprocessing(CConfig *config, CGeometry **geometry, CSolver ***solver, CNumerics ****&numerics) const { +void CDriver::InitializeNumerics(CConfig *config, CGeometry **geometry, CSolver ***solver, CNumerics ****&numerics) const { if (rank == MASTER_NODE) cout << endl <<"------------------- Numerics Preprocessing ( Zone " << config->GetiZone() <<" ) -------------------" << endl; @@ -1789,13 +1777,6 @@ void CDriver::Numerics_Preprocessing(CConfig *config, CGeometry **geometry, CSol } break; - case UPWIND::CUSP: - for (iMGlevel = 0; iMGlevel <= config->GetnMGLevels(); iMGlevel++) { - numerics[iMGlevel][FLOW_SOL][conv_term] = new CUpwCUSP_Flow(nDim, nVar_Flow, config); - numerics[iMGlevel][FLOW_SOL][conv_bound_term] = new CUpwCUSP_Flow(nDim, nVar_Flow, config); - } - break; - default: SU2_MPI::Error("Invalid upwind scheme or not implemented.", CURRENT_FUNCTION); break; @@ -1892,9 +1873,6 @@ void CDriver::Numerics_Preprocessing(CConfig *config, CGeometry **geometry, CSol else if (config->GetGravityForce() == YES) { numerics[iMGlevel][FLOW_SOL][source_first_term] = new CSourceGravity(nDim, nVar_Flow, config); } - else if (config->GetWind_Gust() == YES) { - numerics[iMGlevel][FLOW_SOL][source_first_term] = new CSourceWindGust(nDim, nVar_Flow, config); - } else { numerics[iMGlevel][FLOW_SOL][source_first_term] = new CSourceNothing(nDim, nVar_Flow, config); } @@ -2054,13 +2032,6 @@ void CDriver::Numerics_Preprocessing(CConfig *config, CGeometry **geometry, CSol } break; - case UPWIND::CUSP: - for (iMGlevel = 0; iMGlevel <= config->GetnMGLevels(); iMGlevel++) { - numerics[iMGlevel][FLOW_SOL][conv_term] = new CUpwCUSP_Flow(nDim, nVar_Flow, config); - numerics[iMGlevel][FLOW_SOL][conv_bound_term] = new CUpwCUSP_Flow(nDim, nVar_Flow, config); - } - break; - default: SU2_MPI::Error("Riemann solver not implemented.", CURRENT_FUNCTION); break; @@ -2376,7 +2347,7 @@ void CDriver::Numerics_Preprocessing(CConfig *config, CGeometry **geometry, CSol } -void CDriver::Numerics_Postprocessing(CNumerics *****numerics, CSolver***, CGeometry**, +void CDriver::FinalizeNumerics(CNumerics *****numerics, CSolver***, CGeometry**, CConfig *config, unsigned short val_iInst) { for (unsigned short iMGlevel = 0; iMGlevel <= config->GetnMGLevels(); iMGlevel++) { @@ -2395,7 +2366,7 @@ void CDriver::Numerics_Postprocessing(CNumerics *****numerics, CSolver***, CGeom } -void CDriver::Iteration_Preprocessing(CConfig* config, CIteration *&iteration) const { +void CDriver::PreprocessIteration(CConfig* config, CIteration *&iteration) const { if (rank == MASTER_NODE) cout << endl <<"------------------- Iteration Preprocessing ( Zone " << config->GetiZone() <<" ) ------------------" << endl; @@ -2404,7 +2375,7 @@ void CDriver::Iteration_Preprocessing(CConfig* config, CIteration *&iteration) c } -void CDriver::DynamicMesh_Preprocessing(CConfig *config, CGeometry **geometry, CSolver ***solver, CIteration* iteration, +void CDriver::PreprocessDynamicMesh(CConfig *config, CGeometry **geometry, CSolver ***solver, CIteration* iteration, CVolumetricMovement *&grid_movement, CSurfaceMovement *&surface_movement) const{ /*--- Instantiate the geometry movement classes for the solution of unsteady @@ -2445,7 +2416,7 @@ void CDriver::DynamicMesh_Preprocessing(CConfig *config, CGeometry **geometry, C } -void CDriver::Interface_Preprocessing(CConfig **config, CSolver***** solver, CGeometry**** geometry, +void CDriver::InitializeInterface(CConfig **config, CSolver***** solver, CGeometry**** geometry, unsigned short** interface_types, CInterface ***interface, vector > >& interpolation) { @@ -2526,7 +2497,8 @@ void CDriver::Interface_Preprocessing(CConfig **config, CSolver***** solver, CGe const auto fluidZone = heat_target? donor : target; - if (config[fluidZone]->GetEnergy_Equation() || (config[fluidZone]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE)) + if (config[fluidZone]->GetEnergy_Equation() || (config[fluidZone]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) + || (config[fluidZone]->GetKind_FluidModel() == ENUM_FLUIDMODEL::FLUID_FLAMELET)) interface_type = heat_target? CONJUGATE_HEAT_FS : CONJUGATE_HEAT_SF; else if (config[fluidZone]->GetWeakly_Coupled_Heat()) interface_type = heat_target? CONJUGATE_HEAT_WEAKLY_FS : CONJUGATE_HEAT_WEAKLY_SF; @@ -2571,59 +2543,14 @@ void CDriver::Interface_Preprocessing(CConfig **config, CSolver***** solver, CGe } -void CDriver::StaticMesh_Preprocessing(const CConfig *config, CGeometry** geometry){ +void CDriver::PreprocessStaticMesh(const CConfig *config, CGeometry** geometry){ unsigned short iMGlevel, iMGfine; - unsigned short Kind_Grid_Movement; unsigned short iZone = config->GetiZone(); - Kind_Grid_Movement = config->GetKind_GridMovement(); - if (!fem_solver) { - switch (Kind_Grid_Movement) { - - case ROTATING_FRAME: - - /*--- Steadily rotating frame: set the grid velocities just once - before the first iteration flow solver. ---*/ - - if (rank == MASTER_NODE) { - cout << endl << " Setting rotating frame grid velocities"; - cout << " for zone " << iZone << "." << endl; - } - - /*--- Set the grid velocities on all multigrid levels for a steadily - rotating reference frame. ---*/ - - for (iMGlevel = 0; iMGlevel <= config_container[ZONE_0]->GetnMGLevels(); iMGlevel++){ - geometry[iMGlevel]->SetRotationalVelocity(config, true); - geometry[iMGlevel]->SetShroudVelocity(config); - } - - break; - - case STEADY_TRANSLATION: - - /*--- Set the translational velocity and hold the grid fixed during - the calculation (similar to rotating frame, but there is no extra - source term for translation). ---*/ - - if (rank == MASTER_NODE) - cout << endl << " Setting translational grid velocities." << endl; - - /*--- Set the translational velocity on all grid levels. ---*/ - - for (iMGlevel = 0; iMGlevel <= config_container[ZONE_0]->GetnMGLevels(); iMGlevel++) - geometry_container[iZone][INST_0][iMGlevel]->SetTranslationalVelocity(config, true); - - break; - - default: - break; - } - if (config->GetnMarker_Moving() > 0) { /*--- Fixed wall velocities: set the grid velocities only one time @@ -2644,7 +2571,7 @@ void CDriver::StaticMesh_Preprocessing(const CConfig *config, CGeometry** geomet /*--- Carry out a dynamic cast to CMeshFEM_DG, such that it is not needed to define all virtual functions in the base class CGeometry. ---*/ - CMeshFEM_DG *DGMesh = dynamic_cast(geometry[MESH_0]); + auto *DGMesh = dynamic_cast(geometry[MESH_0]); /*--- Initialize the static mesh movement, if necessary. ---*/ const unsigned short Kind_Grid_Movement = config->GetKind_GridMovement(); @@ -2661,7 +2588,7 @@ void CDriver::StaticMesh_Preprocessing(const CConfig *config, CGeometry** geomet } -void CDriver::Output_Preprocessing(CConfig **config, CConfig *driver_config, COutput **&output, COutput *&driver_output){ +void CDriver::PreprocessOutput(CConfig **config, CConfig *driver_config, COutput **&output, COutput *&driver_output){ /*--- Definition of the output class (one for each zone). The output class manages the writing of all restart, volume solution, surface solution, @@ -2700,7 +2627,7 @@ void CDriver::Output_Preprocessing(CConfig **config, CConfig *driver_config, COu } -void CDriver::Turbomachinery_Preprocessing(CConfig** config, CGeometry**** geometry, CSolver***** solver, +void CDriver::PreprocessTurbomachinery(CConfig** config, CGeometry**** geometry, CSolver***** solver, CInterface*** interface){ unsigned short donorZone,targetZone, nMarkerInt, iMarkerInt; @@ -2742,7 +2669,7 @@ void CDriver::Turbomachinery_Preprocessing(CConfig** config, CGeometry**** geome solver[iZone][INST_0][MESH_0][FLOW_SOL]->InitTurboContainers(geometry[iZone][INST_0][MESH_0],config[iZone]); } -//TODO(turbo) make it general for turbo HB + // TODO(turbo): make it general for turbo HB if (rank == MASTER_NODE) cout<<"Compute inflow and outflow average geometric quantities." << endl; for (iZone = 0; iZone < nZone; iZone++) { geometry[iZone][INST_0][MESH_0]->SetAvgTurboValue(config[iZone], iZone, INFLOW, true); @@ -2830,11 +2757,11 @@ void CDriver::Turbomachinery_Preprocessing(CConfig** config, CGeometry**** geome } -CDriver::~CDriver(void) {} +CDriver::~CDriver() = default; -void CDriver::Print_DirectResidual(RECORDING kind_recording) { +void CDriver::PrintDirectResidual(RECORDING kind_recording) { - if (!(rank == MASTER_NODE && kind_recording == RECORDING::SOLUTION_VARIABLES)) return; + if (rank != MASTER_NODE || kind_recording != RECORDING::SOLUTION_VARIABLES) return; const bool multizone = config_container[ZONE_0]->GetMultizone_Problem(); @@ -2842,8 +2769,7 @@ void CDriver::Print_DirectResidual(RECORDING kind_recording) { auto iVar_iZone2string = [&](unsigned short ivar, unsigned short izone) { if (multizone) return "[" + std::to_string(ivar) + "][" + std::to_string(izone) + "]"; - else - return "[" + std::to_string(ivar) + "]"; + return "[" + std::to_string(ivar) + "]"; }; /*--- Print residuals in the first iteration ---*/ @@ -2947,11 +2873,87 @@ void CDriver::Print_DirectResidual(RECORDING kind_recording) { } +void CDriver::RampTurbomachineryValues(unsigned long iter) { + auto* config = config_container[ZONE_0]; + + /*--- ROTATING FRAME Ramp: Compute the updated rotational velocity. ---*/ + if (config->GetGrid_Movement() && config->GetRampRotatingFrame()) { + const unsigned long rampFreq = SU2_TYPE::Int(config->GetRampRotatingFrame_Coeff(1)); + const unsigned long finalRamp_Iter = SU2_TYPE::Int(config->GetRampRotatingFrame_Coeff(2)); + const su2double rot_z_ini = config->GetRampRotatingFrame_Coeff(0); + const bool print = false; + + if(iter % rampFreq == 0 && iter <= finalRamp_Iter){ + + for (auto iZone = 0u; iZone < nZone; iZone++) { + const su2double rot_z_final = config_container[iZone]->GetFinalRotation_Rate_Z(); + + if (fabs(rot_z_final) > 0.0) { + const su2double rot_z = rot_z_ini + iter * ( rot_z_final - rot_z_ini) / finalRamp_Iter; + config_container[iZone]->SetRotation_Rate(2, rot_z); + if (rank == MASTER_NODE && print && iter > 0) { + cout << "\nUpdated rotating frame grid velocities for zone " << iZone << ".\n"; + } + geometry_container[iZone][INST_0][MESH_0]->SetRotationalVelocity(config_container[iZone], print); + geometry_container[iZone][INST_0][MESH_0]->SetShroudVelocity(config_container[iZone]); + } + } + + for (auto iZone = 0u; iZone < nZone; iZone++) { + geometry_container[iZone][INST_0][MESH_0]->SetAvgTurboValue(config_container[iZone], iZone, INFLOW, false); + geometry_container[iZone][INST_0][MESH_0]->SetAvgTurboValue(config_container[iZone],iZone, OUTFLOW, false); + geometry_container[iZone][INST_0][MESH_0]->GatherInOutAverageValues(config_container[iZone], false); + } + + for (auto iZone = 1u; iZone < nZone; iZone++) { + interface_container[iZone][ZONE_0]->GatherAverageTurboGeoValues( + geometry_container[iZone][INST_0][MESH_0], geometry_container[ZONE_0][INST_0][MESH_0], iZone); + } + } + } + + /*--- Outlet Pressure Ramp: Compute the updated pressure. ---*/ + if (config->GetRampOutletPressure()) { + const unsigned long rampFreq = SU2_TYPE::Int(config->GetRampOutletPressure_Coeff(1)); + const unsigned long finalRamp_Iter = SU2_TYPE::Int(config->GetRampOutletPressure_Coeff(2)); + const su2double outPres_ini = config->GetRampOutletPressure_Coeff(0); + const su2double outPres_final = config->GetFinalOutletPressure(); + + if (iter % rampFreq == 0 && iter <= finalRamp_Iter) { + const su2double outPres = outPres_ini + iter * (outPres_final - outPres_ini) / finalRamp_Iter; + if (rank == MASTER_NODE) config->SetMonitotOutletPressure(outPres); + + for (auto iZone = 0u; iZone < nZone; iZone++) { + for (auto iMarker = 0; iMarker < config_container[iZone]->GetnMarker_All(); iMarker++) { + const auto KindBC = config_container[iZone]->GetMarker_All_KindBC(iMarker); + const auto Marker_Tag = config_container[iZone]->GetMarker_All_TagBound(iMarker); + unsigned short KindBCOption; + switch (KindBC) { + case RIEMANN_BOUNDARY: + KindBCOption = config_container[iZone]->GetKind_Data_Riemann(Marker_Tag); + if (KindBCOption == STATIC_PRESSURE || KindBCOption == RADIAL_EQUILIBRIUM) { + SU2_MPI::Error("Outlet pressure ramp only implemented for NRBC", CURRENT_FUNCTION); + } + break; + case GILES_BOUNDARY: + KindBCOption = config_container[iZone]->GetKind_Data_Giles(Marker_Tag); + if (KindBCOption == STATIC_PRESSURE || KindBCOption == STATIC_PRESSURE_1D || + KindBCOption == RADIAL_EQUILIBRIUM ) { + config_container[iZone]->SetGiles_Var1(outPres, Marker_Tag); + } + break; + } + } + } + } + } +} + CFluidDriver::CFluidDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator) : CDriver(confFile, val_nZone, MPICommunicator, false) { Max_Iter = config_container[ZONE_0]->GetnInner_Iter(); } -CFluidDriver::~CFluidDriver(void) { } +CFluidDriver::~CFluidDriver() = default; void CFluidDriver::StartSolver(){ @@ -3031,6 +3033,8 @@ void CFluidDriver::Preprocess(unsigned long Iter) { if (config_container[iZone]->GetFluidProblem()) { for (iInst = 0; iInst < nInst[iZone]; iInst++) { solver_container[iZone][iInst][MESH_0][FLOW_SOL]->SetInitialCondition(geometry_container[iZone][INST_0], solver_container[iZone][iInst], config_container[iZone], Iter); + if (config_container[iZone]->GetKind_Species_Model() != SPECIES_MODEL::NONE) + solver_container[iZone][iInst][MESH_0][SPECIES_SOL]->SetInitialCondition(geometry_container[iZone][INST_0], solver_container[iZone][iInst], config_container[iZone], Iter); } } } @@ -3039,7 +3043,7 @@ void CFluidDriver::Preprocess(unsigned long Iter) { void CFluidDriver::Run() { - unsigned short iZone, jZone, checkConvergence; + unsigned short iZone, jZone; unsigned long IntIter, nIntIter; bool unsteady; @@ -3081,7 +3085,7 @@ void CFluidDriver::Run() { for (iZone = 0; iZone < nZone; iZone++) for (jZone = 0; jZone < nZone; jZone++) if(jZone != iZone && interface_container[iZone][jZone] != nullptr) - Transfer_Data(iZone, jZone); + TransferData(iZone, jZone); /*--- For each zone runs one single iteration ---*/ @@ -3091,20 +3095,12 @@ void CFluidDriver::Run() { config_container, surface_movement, grid_movement, FFDBox, iZone, INST_0); } - /*--- Check convergence in each zone --*/ - - checkConvergence = 0; - for (iZone = 0; iZone < nZone; iZone++) - checkConvergence += (int) integration_container[iZone][INST_0][FLOW_SOL]->GetConvergence(); - - /*--- If convergence was reached in every zone --*/ - - if (checkConvergence == nZone) break; + /// TODO: Check convergence in each zone. } } -void CFluidDriver::Transfer_Data(unsigned short donorZone, unsigned short targetZone) { +void CFluidDriver::TransferData(unsigned short donorZone, unsigned short targetZone) { auto BroadcastData = [&](unsigned int solIdx) { interface_container[donorZone][targetZone]->BroadcastData(*interpolator_container[donorZone][targetZone].get(), @@ -3143,6 +3139,7 @@ void CFluidDriver::DynamicMeshUpdate(unsigned long TimeIter) { } } + bool CFluidDriver::Monitor(unsigned long ExtIter) { /*--- Synchronization point after a single solver iteration. Compute the @@ -3153,33 +3150,10 @@ bool CFluidDriver::Monitor(unsigned long ExtIter) { IterCount++; UsedTime = (StopTime - StartTime) + UsedTimeCompute; - /*--- Check if there is any change in the runtime parameters ---*/ - - CConfig *runtime = nullptr; - strcpy(runtime_file_name, "runtime.dat"); - runtime = new CConfig(runtime_file_name, config_container[ZONE_0]); - runtime->SetTimeIter(ExtIter); - delete runtime; - /*--- Check whether the current simulation has reached the specified convergence criteria, and set StopCalc to true, if so. ---*/ - switch (config_container[ZONE_0]->GetKind_Solver()) { - case MAIN_SOLVER::EULER: case MAIN_SOLVER::NAVIER_STOKES: case MAIN_SOLVER::RANS: - case MAIN_SOLVER::NEMO_EULER: case MAIN_SOLVER::NEMO_NAVIER_STOKES: - StopCalc = integration_container[ZONE_0][INST_0][FLOW_SOL]->GetConvergence(); break; - case MAIN_SOLVER::HEAT_EQUATION: - StopCalc = integration_container[ZONE_0][INST_0][HEAT_SOL]->GetConvergence(); break; - case MAIN_SOLVER::FEM_ELASTICITY: - StopCalc = integration_container[ZONE_0][INST_0][FEA_SOL]->GetConvergence(); break; - case MAIN_SOLVER::ADJ_EULER: case MAIN_SOLVER::ADJ_NAVIER_STOKES: case MAIN_SOLVER::ADJ_RANS: - case MAIN_SOLVER::DISC_ADJ_EULER: case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_RANS: - case MAIN_SOLVER::DISC_ADJ_INC_EULER: case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_INC_RANS: - case MAIN_SOLVER::DISC_ADJ_FEM_EULER: case MAIN_SOLVER::DISC_ADJ_FEM_NS: case MAIN_SOLVER::DISC_ADJ_FEM_RANS: - StopCalc = integration_container[ZONE_0][INST_0][ADJFLOW_SOL]->GetConvergence(); break; - default: - break; - } + /// TODO: Get convergence from the output class /*--- Set StopCalc to true if max. number of iterations has been reached ---*/ @@ -3189,7 +3163,6 @@ bool CFluidDriver::Monitor(unsigned long ExtIter) { } - void CFluidDriver::Output(unsigned long InnerIter) { for (iZone = 0; iZone < nZone; iZone++) { @@ -3197,7 +3170,7 @@ void CFluidDriver::Output(unsigned long InnerIter) { for (iInst = 0; iInst < nInst[iZone]; ++iInst) { config_container[iZone]->SetiInst(iInst); - output_container[iZone]->SetResult_Files(geometry_container[iZone][iInst][MESH_0], + output_container[iZone]->SetResultFiles(geometry_container[iZone][iInst][MESH_0], config_container[iZone], solver_container[iZone][iInst][MESH_0], InnerIter, StopCalc); @@ -3207,249 +3180,6 @@ void CFluidDriver::Output(unsigned long InnerIter) { } - -CTurbomachineryDriver::CTurbomachineryDriver(char* confFile, unsigned short val_nZone, - SU2_Comm MPICommunicator): - CFluidDriver(confFile, val_nZone, MPICommunicator) { - - output_legacy = COutputFactory::CreateLegacyOutput(config_container[ZONE_0]); - - /*--- LEGACY OUTPUT (going to be removed soon) --- */ - - /*--- Open the convergence history file ---*/ - ConvHist_file = nullptr; - ConvHist_file = new ofstream*[nZone]; - for (iZone = 0; iZone < nZone; iZone++) { - ConvHist_file[iZone] = nullptr; - if (rank == MASTER_NODE){ - ConvHist_file[iZone] = new ofstream[nInst[iZone]]; - for (iInst = 0; iInst < nInst[iZone]; iInst++) { - output_legacy->SetConvHistory_Header(&ConvHist_file[iZone][iInst], config_container[iZone], iZone, iInst); - } - } - } - - if (nZone > 1){ - Max_Iter = config_container[ZONE_0]->GetnOuter_Iter(); - } -} - -CTurbomachineryDriver::~CTurbomachineryDriver(void) { - if (rank == MASTER_NODE){ - /*--- Close the convergence history file. ---*/ - for (iZone = 0; iZone < nZone; iZone++) { - for (iInst = 0; iInst < 1; iInst++) { - ConvHist_file[iZone][iInst].close(); - } - delete [] ConvHist_file[iZone]; - } - delete [] ConvHist_file; - } -} - -void CTurbomachineryDriver::Run() { - - /*--- Run a single iteration of a multi-zone problem by looping over all - zones and executing the iterations. Note that data transers between zones - and other intermediate procedures may be required. ---*/ - - for (iZone = 0; iZone < nZone; iZone++) { - iteration_container[iZone][INST_0]->Preprocess(output_container[iZone], integration_container, geometry_container, - solver_container, numerics_container, config_container, - surface_movement, grid_movement, FFDBox, iZone, INST_0); - } - - /* --- Update the mixing-plane interface ---*/ - for (iZone = 0; iZone < nZone; iZone++) { - if(mixingplane)SetMixingPlane(iZone); - } - - for (iZone = 0; iZone < nZone; iZone++) { - iteration_container[iZone][INST_0]->Iterate(output_container[iZone], integration_container, geometry_container, - solver_container, numerics_container, config_container, - surface_movement, grid_movement, FFDBox, iZone, INST_0); - } - - for (iZone = 0; iZone < nZone; iZone++) { - iteration_container[iZone][INST_0]->Postprocess(output_container[iZone], integration_container, geometry_container, - solver_container, numerics_container, config_container, - surface_movement, grid_movement, FFDBox, iZone, INST_0); - } - - if (rank == MASTER_NODE){ - SetTurboPerformance(ZONE_0); - } - - -} - -void CTurbomachineryDriver::SetMixingPlane(unsigned short donorZone){ - - unsigned short targetZone, nMarkerInt, iMarkerInt ; - nMarkerInt = config_container[donorZone]->GetnMarker_MixingPlaneInterface()/2; - - /* --- transfer the average value from the donorZone to the targetZone*/ - for (iMarkerInt = 1; iMarkerInt <= nMarkerInt; iMarkerInt++){ - for (targetZone = 0; targetZone < nZone; targetZone++) { - if (targetZone != donorZone){ - interface_container[donorZone][targetZone]->AllgatherAverage(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], - geometry_container[donorZone][INST_0][MESH_0],geometry_container[targetZone][INST_0][MESH_0], - config_container[donorZone], config_container[targetZone], iMarkerInt ); - } - } - } -} - -void CTurbomachineryDriver::SetTurboPerformance(unsigned short targetZone){ - - unsigned short donorZone; - //IMPORTANT this approach of multi-zone performances rely upon the fact that turbomachinery markers follow the natural (stator-rotor) development of the real machine. - /* --- transfer the local turboperfomance quantities (for each blade) from all the donorZones to the targetZone (ZONE_0) ---*/ - for (donorZone = 1; donorZone < nZone; donorZone++) { - interface_container[donorZone][targetZone]->GatherAverageValues(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL],solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], donorZone); - } - - /* --- compute turboperformance for each stage and the global machine ---*/ - - output_legacy->ComputeTurboPerformance(solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], geometry_container[targetZone][INST_0][MESH_0], config_container[targetZone]); - -} - - -bool CTurbomachineryDriver::Monitor(unsigned long ExtIter) { - - su2double rot_z_ini, rot_z_final ,rot_z; - su2double outPres_ini, outPres_final, outPres; - unsigned long rampFreq, finalRamp_Iter; - unsigned short iMarker, KindBC, KindBCOption; - string Marker_Tag; - - bool print; - - /*--- Synchronization point after a single solver iteration. Compute the - wall clock time required. ---*/ - - StopTime = SU2_MPI::Wtime(); - - IterCount++; - UsedTime = (StopTime - StartTime); - - - /*--- Check if there is any change in the runtime parameters ---*/ - CConfig *runtime = nullptr; - strcpy(runtime_file_name, "runtime.dat"); - runtime = new CConfig(runtime_file_name, config_container[ZONE_0]); - runtime->SetInnerIter(ExtIter); - delete runtime; - - /*--- Update the convergence history file (serial and parallel computations). ---*/ - - for (iZone = 0; iZone < nZone; iZone++) { - for (iInst = 0; iInst < nInst[iZone]; iInst++) - output_legacy->SetConvHistory_Body(&ConvHist_file[iZone][iInst], geometry_container, solver_container, - config_container, integration_container, false, UsedTime, iZone, iInst); - } - - /*--- ROTATING FRAME Ramp: Compute the updated rotational velocity. ---*/ - if (config_container[ZONE_0]->GetGrid_Movement() && config_container[ZONE_0]->GetRampRotatingFrame()) { - rampFreq = SU2_TYPE::Int(config_container[ZONE_0]->GetRampRotatingFrame_Coeff(1)); - finalRamp_Iter = SU2_TYPE::Int(config_container[ZONE_0]->GetRampRotatingFrame_Coeff(2)); - rot_z_ini = config_container[ZONE_0]->GetRampRotatingFrame_Coeff(0); - print = false; - if(ExtIter % rampFreq == 0 && ExtIter <= finalRamp_Iter){ - - for (iZone = 0; iZone < nZone; iZone++) { - rot_z_final = config_container[iZone]->GetFinalRotation_Rate_Z(); - if(abs(rot_z_final) > 0.0){ - rot_z = rot_z_ini + ExtIter*( rot_z_final - rot_z_ini)/finalRamp_Iter; - config_container[iZone]->SetRotation_Rate(2, rot_z); - if(rank == MASTER_NODE && print && ExtIter > 0) { - cout << endl << " Updated rotating frame grid velocities"; - cout << " for zone " << iZone << "." << endl; - } - geometry_container[iZone][INST_0][MESH_0]->SetRotationalVelocity(config_container[iZone], print); - geometry_container[iZone][INST_0][MESH_0]->SetShroudVelocity(config_container[iZone]); - } - } - - for (iZone = 0; iZone < nZone; iZone++) { - geometry_container[iZone][INST_0][MESH_0]->SetAvgTurboValue(config_container[iZone], iZone, INFLOW, false); - geometry_container[iZone][INST_0][MESH_0]->SetAvgTurboValue(config_container[iZone],iZone, OUTFLOW, false); - geometry_container[iZone][INST_0][MESH_0]->GatherInOutAverageValues(config_container[iZone], false); - - } - - for (iZone = 1; iZone < nZone; iZone++) { - interface_container[iZone][ZONE_0]->GatherAverageTurboGeoValues(geometry_container[iZone][INST_0][MESH_0],geometry_container[ZONE_0][INST_0][MESH_0], iZone); - } - - } - } - - - /*--- Outlet Pressure Ramp: Compute the updated rotational velocity. ---*/ - if (config_container[ZONE_0]->GetRampOutletPressure()) { - rampFreq = SU2_TYPE::Int(config_container[ZONE_0]->GetRampOutletPressure_Coeff(1)); - finalRamp_Iter = SU2_TYPE::Int(config_container[ZONE_0]->GetRampOutletPressure_Coeff(2)); - outPres_ini = config_container[ZONE_0]->GetRampOutletPressure_Coeff(0); - outPres_final = config_container[ZONE_0]->GetFinalOutletPressure(); - - if(ExtIter % rampFreq == 0 && ExtIter <= finalRamp_Iter){ - outPres = outPres_ini + ExtIter*(outPres_final - outPres_ini)/finalRamp_Iter; - if(rank == MASTER_NODE) config_container[ZONE_0]->SetMonitotOutletPressure(outPres); - - for (iZone = 0; iZone < nZone; iZone++) { - for (iMarker = 0; iMarker < config_container[iZone]->GetnMarker_All(); iMarker++) { - KindBC = config_container[iZone]->GetMarker_All_KindBC(iMarker); - switch (KindBC) { - case RIEMANN_BOUNDARY: - Marker_Tag = config_container[iZone]->GetMarker_All_TagBound(iMarker); - KindBCOption = config_container[iZone]->GetKind_Data_Riemann(Marker_Tag); - if(KindBCOption == STATIC_PRESSURE || KindBCOption == RADIAL_EQUILIBRIUM ){ - SU2_MPI::Error("Outlet pressure ramp only implemented for NRBC", CURRENT_FUNCTION); - } - break; - case GILES_BOUNDARY: - Marker_Tag = config_container[iZone]->GetMarker_All_TagBound(iMarker); - KindBCOption = config_container[iZone]->GetKind_Data_Giles(Marker_Tag); - if(KindBCOption == STATIC_PRESSURE || KindBCOption == STATIC_PRESSURE_1D || KindBCOption == RADIAL_EQUILIBRIUM ){ - config_container[iZone]->SetGiles_Var1(outPres, Marker_Tag); - } - break; - } - } - } - } - } - - - /*--- Check whether the current simulation has reached the specified - convergence criteria, and set StopCalc to true, if so. ---*/ - - switch (config_container[ZONE_0]->GetKind_Solver()) { - case MAIN_SOLVER::EULER: case MAIN_SOLVER::NAVIER_STOKES: case MAIN_SOLVER::RANS: - case MAIN_SOLVER::INC_EULER: case MAIN_SOLVER::INC_NAVIER_STOKES: case MAIN_SOLVER::INC_RANS: - case MAIN_SOLVER::NEMO_EULER: case MAIN_SOLVER::NEMO_NAVIER_STOKES: - StopCalc = integration_container[ZONE_0][INST_0][FLOW_SOL]->GetConvergence(); - break; - case MAIN_SOLVER::DISC_ADJ_EULER: case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_RANS: - case MAIN_SOLVER::DISC_ADJ_INC_EULER: case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_INC_RANS: - case MAIN_SOLVER::DISC_ADJ_FEM_EULER: case MAIN_SOLVER::DISC_ADJ_FEM_NS: case MAIN_SOLVER::DISC_ADJ_FEM_RANS: - StopCalc = integration_container[ZONE_0][INST_0][ADJFLOW_SOL]->GetConvergence(); - break; - default: - break; - - } - - /*--- Set StopCalc to true if max. number of iterations has been reached ---*/ - - StopCalc = StopCalc || (ExtIter == Max_Iter - 1); - - return StopCalc; - -} - CHBDriver::CHBDriver(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator) : CFluidDriver(confFile, @@ -3459,46 +3189,18 @@ CHBDriver::CHBDriver(char* confFile, nInstHB = nInst[ZONE_0]; - D = nullptr; /*--- allocate dynamic memory for the Harmonic Balance operator ---*/ - D = new su2double*[nInstHB]; for (kInst = 0; kInst < nInstHB; kInst++) D[kInst] = new su2double[nInstHB]; - - output_legacy = COutputFactory::CreateLegacyOutput(config_container[ZONE_0]); - - /*--- Open the convergence history file ---*/ - ConvHist_file = nullptr; - ConvHist_file = new ofstream*[nZone]; - for (iZone = 0; iZone < nZone; iZone++) { - ConvHist_file[iZone] = nullptr; - if (rank == MASTER_NODE){ - ConvHist_file[iZone] = new ofstream[nInst[iZone]]; - for (iInst = 0; iInst < nInst[iZone]; iInst++) { - output_legacy->SetConvHistory_Header(&ConvHist_file[iZone][iInst], config_container[iZone], iZone, iInst); - } - } - } - - + D = new su2double*[nInstHB]; + for (kInst = 0; kInst < nInstHB; kInst++) D[kInst] = new su2double[nInstHB]; } -CHBDriver::~CHBDriver(void) { +CHBDriver::~CHBDriver() { unsigned short kInst; /*--- delete dynamic memory for the Harmonic Balance operator ---*/ for (kInst = 0; kInst < nInstHB; kInst++) delete [] D[kInst]; delete [] D; - - if (rank == MASTER_NODE){ - /*--- Close the convergence history file. ---*/ - for (iZone = 0; iZone < nZone; iZone++) { - for (iInst = 0; iInst < nInstHB; iInst++) { - ConvHist_file[iZone][iInst].close(); - } - delete [] ConvHist_file[iZone]; - } - delete [] ConvHist_file; - } } @@ -3517,13 +3219,10 @@ void CHBDriver::Run() { solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, ZONE_0, iInst); - /*--- Update the convergence history file (serial and parallel computations). ---*/ - - for (iZone = 0; iZone < nZone; iZone++) { - for (iInst = 0; iInst < nInst[iZone]; iInst++) - output_legacy->SetConvHistory_Body(&ConvHist_file[iZone][iInst], geometry_container, solver_container, - config_container, integration_container, false, UsedTime, iZone, iInst); - } + for (iInst = 0; iInst < nInstHB; iInst++) + iteration_container[ZONE_0][iInst]->Monitor(output_container[ZONE_0], integration_container, geometry_container, + solver_container, numerics_container, config_container, + surface_movement, grid_movement, FFDBox, ZONE_0, iInst); } @@ -3552,34 +3251,6 @@ void CHBDriver::Update() { } -void CHBDriver::ResetConvergence() { - - for(iInst = 0; iInst < nZone; iInst++) { - switch (config_container[ZONE_0]->GetKind_Solver()) { - - case MAIN_SOLVER::EULER: case MAIN_SOLVER::NAVIER_STOKES: case MAIN_SOLVER::RANS: - integration_container[ZONE_0][iInst][FLOW_SOL]->SetConvergence(false); - if (config_container[ZONE_0]->GetKind_Solver() == MAIN_SOLVER::RANS) integration_container[ZONE_0][iInst][TURB_SOL]->SetConvergence(false); - if(config_container[ZONE_0]->GetKind_Trans_Model() == TURB_TRANS_MODEL::LM) integration_container[ZONE_0][iInst][TRANS_SOL]->SetConvergence(false); - break; - - case MAIN_SOLVER::FEM_ELASTICITY: - integration_container[ZONE_0][iInst][FEA_SOL]->SetConvergence(false); - break; - - case MAIN_SOLVER::ADJ_EULER: case MAIN_SOLVER::ADJ_NAVIER_STOKES: case MAIN_SOLVER::ADJ_RANS: case MAIN_SOLVER::DISC_ADJ_EULER: case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_RANS: - integration_container[ZONE_0][iInst][ADJFLOW_SOL]->SetConvergence(false); - if( (config_container[ZONE_0]->GetKind_Solver() == MAIN_SOLVER::ADJ_RANS) || (config_container[ZONE_0]->GetKind_Solver() == MAIN_SOLVER::DISC_ADJ_RANS) ) - integration_container[ZONE_0][iInst][ADJTURB_SOL]->SetConvergence(false); - break; - - default: - SU2_MPI::Error("Harmonic Balance has not been set up for this solver.", CURRENT_FUNCTION); - } - } - -} - void CHBDriver::SetHarmonicBalance(unsigned short iInst) { unsigned short iVar, jInst, iMGlevel; @@ -3594,11 +3265,11 @@ void CHBDriver::SetHarmonicBalance(unsigned short iInst) { unsigned long InnerIter = config_container[ZONE_0]->GetInnerIter(); /*--- Retrieve values from the config file ---*/ - su2double *U = new su2double[nVar]; - su2double *U_old = new su2double[nVar]; - su2double *Psi = new su2double[nVar]; - su2double *Psi_old = new su2double[nVar]; - su2double *Source = new su2double[nVar]; + auto *U = new su2double[nVar]; + auto *U_old = new su2double[nVar]; + auto *Psi = new su2double[nVar]; + auto *Psi_old = new su2double[nVar]; + auto *Source = new su2double[nVar]; su2double deltaU, deltaPsi; /*--- Compute period of oscillation ---*/ @@ -3608,7 +3279,7 @@ void CHBDriver::SetHarmonicBalance(unsigned short iInst) { period /= config_container[ZONE_0]->GetTime_Ref(); if (InnerIter == 0) - ComputeHB_Operator(); + ComputeHBOperator(); /*--- Compute various source terms for explicit direct, implicit direct, and adjoint problems ---*/ /*--- Loop over all grid levels ---*/ @@ -3670,8 +3341,8 @@ void CHBDriver::SetHarmonicBalance(unsigned short iInst) { /*--- Extra variables needed if we have a turbulence model. ---*/ unsigned short nVar_Turb = solver_container[ZONE_0][INST_0][MESH_0][TURB_SOL]->GetnVar(); - su2double *U_Turb = new su2double[nVar_Turb]; - su2double *Source_Turb = new su2double[nVar_Turb]; + auto *U_Turb = new su2double[nVar_Turb]; + auto *Source_Turb = new su2double[nVar_Turb]; /*--- Loop over only the finest mesh level (turbulence is always solved on the original grid only). ---*/ @@ -3711,12 +3382,12 @@ void CHBDriver::StabilizeHarmonicBalance() { bool adjoint = (config_container[ZONE_0]->GetContinuous_Adjoint()); /*--- Retrieve values from the config file ---*/ - su2double *Source = new su2double[nInstHB]; - su2double *Source_old = new su2double[nInstHB]; + auto *Source = new su2double[nInstHB]; + auto *Source_old = new su2double[nInstHB]; su2double Delta; - su2double **Pinv = new su2double*[nInstHB]; - su2double **P = new su2double*[nInstHB]; + auto **Pinv = new su2double*[nInstHB]; + auto **P = new su2double*[nInstHB]; for (iInst = 0; iInst < nInstHB; iInst++) { Pinv[iInst] = new su2double[nInstHB]; P[iInst] = new su2double[nInstHB]; @@ -3746,7 +3417,7 @@ void CHBDriver::StabilizeHarmonicBalance() { /*--- Invert stabilization matrix Pinv with Gauss elimination---*/ /*-- A temporary matrix to hold the inverse, dynamically allocated ---*/ - su2double **temp = new su2double*[nInstHB]; + auto **temp = new su2double*[nInstHB]; for (i = 0; i < nInstHB; i++) { temp[i] = new su2double[2 * nInstHB]; } @@ -3863,15 +3534,15 @@ void CHBDriver::StabilizeHarmonicBalance() { } -void CHBDriver::ComputeHB_Operator() { +void CHBDriver::ComputeHBOperator() { const complex J(0.0,1.0); unsigned short i, j, k, iInst; - su2double *Omega_HB = new su2double[nInstHB]; - complex **E = new complex*[nInstHB]; - complex **Einv = new complex*[nInstHB]; - complex **DD = new complex*[nInstHB]; + auto *Omega_HB = new su2double[nInstHB]; + auto **E = new complex*[nInstHB]; + auto **Einv = new complex*[nInstHB]; + auto **DD = new complex*[nInstHB]; for (iInst = 0; iInst < nInstHB; iInst++) { E[iInst] = new complex[nInstHB]; Einv[iInst] = new complex[nInstHB]; @@ -3910,7 +3581,7 @@ void CHBDriver::ComputeHB_Operator() { /*--- Invert inverse harmonic balance Einv with Gauss elimination ---*/ /*-- A temporary matrix to hold the inverse, dynamically allocated ---*/ - complex **temp = new complex*[nInstHB]; + auto **temp = new complex*[nInstHB]; for (i = 0; i < nInstHB; i++) { temp[i] = new complex[2 * nInstHB]; } @@ -3984,10 +3655,10 @@ void CHBDriver::ComputeHB_Operator() { /*--- Temporary matrix for performing product ---*/ - complex **Temp = new complex*[nInstHB]; + auto **Temp = new complex*[nInstHB]; /*--- Temporary complex HB operator ---*/ - complex **Dcpx = new complex*[nInstHB]; + auto **Dcpx = new complex*[nInstHB]; for (iInst = 0; iInst < nInstHB; iInst++){ Temp[iInst] = new complex[nInstHB]; diff --git a/SU2_CFD/src/drivers/CDriverBase.cpp b/SU2_CFD/src/drivers/CDriverBase.cpp new file mode 100644 index 00000000000..0a9e02bb8c4 --- /dev/null +++ b/SU2_CFD/src/drivers/CDriverBase.cpp @@ -0,0 +1,438 @@ +/*! + * \file CDriverBase.hpp + * \brief Base class template for all drivers. + * \author H. Patel, A. Gastaldi + * \version 8.0.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser/ General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/drivers/CDriverBase.hpp" + +#include "../../../Common/include/geometry/CPhysicalGeometry.hpp" +#include "../../../Common/include/toolboxes/geometry_toolbox.hpp" +#include "../../include/variables/CPrimitiveIndices.hpp" + +using namespace std; + +CDriverBase::CDriverBase(char* confFile, unsigned short val_nZone, SU2_Comm MPICommunicator) + : config_file_name(confFile), StartTime(0.0), StopTime(0.0), UsedTime(0.0), TimeIter(0), nZone(val_nZone) { + + /*--- Some initializations are placed here so that they are also seen by the python wrapper. Note that the python + * wrapper instantiates a driver directly. ---*/ + + /*--- MPI is required to be initialized already, e.g, via SU2_MPI::Init, SU2_MPI::Init_thread, or via mpi4py in the + * python wrapper. ---*/ + + /*--- Initialize MeDiPack ---*/ +#ifdef HAVE_MPI +#if defined(CODI_REVERSE_TYPE) || defined(CODI_FORWARD_TYPE) + SU2_MPI::Init_AMPI(); +#endif +#endif + + /*--- Set up MPI ---*/ + SU2_MPI::SetComm(MPICommunicator); + + rank = SU2_MPI::GetRank(); + size = SU2_MPI::GetSize(); + + /*--- OpenMP initialization ---*/ + omp_initialize(); + + /*--- Initialize AD ---*/ + AD::Initialize(); +} + +CDriverBase::~CDriverBase() = default; + +void CDriverBase::InitializeContainers() { + /*--- Create pointers to all the classes that may be used by drivers. In general, the pointers are instantiated + * down a hierarchy over all zones, multi-grid levels, equation sets, and equation terms as described in the comments + * below. ---*/ + + config_container = new CConfig*[nZone](); + output_container = new COutput*[nZone](); + geometry_container = new CGeometry***[nZone](); + solver_container = new CSolver****[nZone](); + numerics_container = new CNumerics*****[nZone](); + surface_movement = new CSurfaceMovement*[nZone](); + grid_movement = new CVolumetricMovement**[nZone](); + + nInst = new unsigned short[nZone]; + + for (iZone = 0; iZone < nZone; iZone++) { + nInst[iZone] = 1; + } +} + +void CDriverBase::CommonFinalize() { + + if (numerics_container != nullptr) { + for (iZone = 0; iZone < nZone; iZone++) { + delete[] numerics_container[iZone]; + } + delete[] numerics_container; + } + if (rank == MASTER_NODE) cout << "Deleted CNumerics container." << endl; + + if (solver_container != nullptr) { + for (iZone = 0; iZone < nZone; iZone++) { + delete[] solver_container[iZone]; + } + delete[] solver_container; + } + if (rank == MASTER_NODE) cout << "Deleted CSolver container." << endl; + + if (geometry_container != nullptr) { + for (iZone = 0; iZone < nZone; iZone++) { + if (geometry_container[iZone] != nullptr) { + for (iInst = 0; iInst < nInst[iZone]; iInst++) { + delete geometry_container[iZone][iInst][MESH_0]; + delete[] geometry_container[iZone][iInst]; + } + delete[] geometry_container[iZone]; + } + } + delete[] geometry_container; + } + if (rank == MASTER_NODE) cout << "Deleted CGeometry container." << endl; + + if (surface_movement != nullptr) { + for (iZone = 0; iZone < nZone; iZone++) { + delete surface_movement[iZone]; + } + delete[] surface_movement; + } + if (rank == MASTER_NODE) cout << "Deleted CSurfaceMovement class." << endl; + + if (grid_movement != nullptr) { + for (iZone = 0; iZone < nZone; iZone++) { + if (grid_movement[iZone] != nullptr) { + for (iInst = 0; iInst < nInst[iZone]; iInst++) { + delete grid_movement[iZone][iInst]; + } + delete[] grid_movement[iZone]; + } + } + delete[] grid_movement; + } + if (rank == MASTER_NODE) cout << "Deleted CVolumetricMovement class." << endl; + + if (config_container != nullptr) { + for (iZone = 0; iZone < nZone; iZone++) { + delete config_container[iZone]; + } + delete[] config_container; + } + delete driver_config; + if (rank == MASTER_NODE) cout << "Deleted CConfig container." << endl; + + if (output_container != nullptr) { + for (iZone = 0; iZone < nZone; iZone++) { + delete output_container[iZone]; + } + delete[] output_container; + } + if (rank == MASTER_NODE) cout << "Deleted COutput class." << endl; + + delete[] nInst; +} + +unsigned short CDriverBase::GetNumberDesignVariables() const { return main_config->GetnDV(); } + +unsigned short CDriverBase::GetNumberFFDBoxes() const { return main_config->GetnFFDBox(); } + +unsigned long CDriverBase::GetNumberDimensions() const { return main_geometry->GetnDim(); } + +unsigned long CDriverBase::GetNumberElements() const { return main_geometry->GetnElem(); } + +unsigned long CDriverBase::GetElementGlobalIndex(unsigned long iElem) const { + if (iElem >= GetNumberElements()) { + SU2_MPI::Error("Element index exceeds size.", CURRENT_FUNCTION); + } + return main_geometry->elem[iElem]->GetGlobalIndex(); +} + +vector CDriverBase::GetElementNodes(unsigned long iElem) const { + if (iElem >= GetNumberElements()) { + SU2_MPI::Error("Element index exceeds size.", CURRENT_FUNCTION); + } + const auto nNode = main_geometry->elem[iElem]->GetnNodes(); + vector values(nNode); + + for (auto iNode = 0u; iNode < nNode; iNode++) { + values[iNode] = main_geometry->elem[iElem]->GetNode(iNode); + } + return values; +} + +unsigned long CDriverBase::GetNumberNodes() const { return main_geometry->GetnPoint(); } + +unsigned long CDriverBase::GetNumberHaloNodes() const { + return main_geometry->GetnPoint() - main_geometry->GetnPointDomain(); +} + +unsigned long CDriverBase::GetNodeGlobalIndex(unsigned long iPoint) const { + if (iPoint >= GetNumberNodes()) { + SU2_MPI::Error("Node index exceeds mesh size.", CURRENT_FUNCTION); + } + return main_geometry->nodes->GetGlobalIndex(iPoint); +} + +bool CDriverBase::GetNodeDomain(unsigned long iPoint) const { + if (iPoint >= GetNumberNodes()) { + SU2_MPI::Error("Node index exceeds mesh size.", CURRENT_FUNCTION); + } + return main_geometry->nodes->GetDomain(iPoint); +} + +unsigned short CDriverBase::GetNumberMarkers() const { return main_config->GetnMarker_All(); } + +map CDriverBase::GetMarkerIndices() const { + const auto nMarker = main_config->GetnMarker_All(); + map indexMap; + + for (auto iMarker = 0u; iMarker < nMarker; iMarker++) { + indexMap[main_config->GetMarker_All_TagBound(iMarker)] = iMarker; + } + return indexMap; +} + +map CDriverBase::GetMarkerTypes() const { + map typeMap; + string type; + + for (auto iMarker = 0u; iMarker < main_config->GetnMarker_All(); iMarker++) { + auto tag = main_config->GetMarker_All_TagBound(iMarker); + auto kindBC = main_config->GetMarker_All_KindBC(iMarker); + + switch (kindBC) { + case EULER_WALL: + type = "EULER_WALL"; + break; + case FAR_FIELD: + type = "FARFIELD"; + break; + case ISOTHERMAL: + type = "ISOTHERMAL"; + break; + case HEAT_FLUX: + type = "HEAT_FLUX"; + break; + case HEAT_TRANSFER: + type = "HEAT_TRANSFER"; + break; + case INLET_FLOW: + type = "INLET_FLOW"; + break; + case OUTLET_FLOW: + type = "OUTLET_FLOW"; + break; + case SUPERSONIC_INLET: + type = "SUPERSONIC_INLET"; + break; + case SUPERSONIC_OUTLET: + type = "SUPERSONIC_OUTLET"; + break; + case RIEMANN_BOUNDARY: + type = "RIEMANN"; + break; + case GILES_BOUNDARY: + type = "GILES"; + break; + case DISPLACEMENT_BOUNDARY: + type = "DISPLACEMENT"; + break; + case LOAD_BOUNDARY: + type = "LOAD"; + break; + case PERIODIC_BOUNDARY: + type = "PERIODIC"; + break; + case SYMMETRY_PLANE: + type = "SYMMETRY"; + break; + case SEND_RECEIVE: + type = "SEND_RECEIVE"; + break; + default: + type = "UNKNOWN_TYPE"; + } + typeMap[tag] = type; + } + + return typeMap; +} + +vector CDriverBase::GetMarkerTags() const { + const auto nMarker = main_config->GetnMarker_All(); + vector tags(nMarker); + + for (auto iMarker = 0u; iMarker < nMarker; iMarker++) { + tags[iMarker] = main_config->GetMarker_All_TagBound(iMarker); + } + return tags; +} + +vector CDriverBase::GetDeformableMarkerTags() const { + const auto nMarker = main_config->GetnMarker_Deform_Mesh(); + vector tags(nMarker); + + for (auto iMarker = 0u; iMarker < nMarker; iMarker++) { + tags[iMarker] = main_config->GetMarker_Deform_Mesh_TagBound(iMarker); + } + return tags; +} + +vector CDriverBase::GetCHTMarkerTags() const { + vector tags; + const auto nMarker = main_config->GetnMarker_All(); + + // The CHT markers can be identified as the markers that are customizable with a BC type HEAT_FLUX or ISOTHERMAL. + for (auto iMarker = 0u; iMarker < nMarker; iMarker++) { + if ((main_config->GetMarker_All_KindBC(iMarker) == HEAT_FLUX || + main_config->GetMarker_All_KindBC(iMarker) == ISOTHERMAL) && + main_config->GetMarker_All_PyCustom(iMarker)) { + tags.push_back(main_config->GetMarker_All_TagBound(iMarker)); + } + } + return tags; +} + +vector CDriverBase::GetInletMarkerTags() const { + vector tags; + const auto nMarker = main_config->GetnMarker_All(); + + for (auto iMarker = 0u; iMarker < nMarker; iMarker++) { + bool isCustomizable = main_config->GetMarker_All_PyCustom(iMarker); + bool isInlet = (main_config->GetMarker_All_KindBC(iMarker) == INLET_FLOW); + + if (isCustomizable && isInlet) { + tags.push_back(main_config->GetMarker_All_TagBound(iMarker)); + } + } + return tags; +} + +unsigned long CDriverBase::GetNumberMarkerElements(unsigned short iMarker) const { + if (iMarker >= GetNumberMarkers()) { + SU2_MPI::Error("Marker index exceeds size.", CURRENT_FUNCTION); + } + return main_geometry->GetnElem_Bound(iMarker); +} + +unsigned long CDriverBase::GetMarkerElementGlobalIndex(unsigned short iMarker, unsigned long iElem) const { + if (iElem >= GetNumberMarkerElements(iMarker)) { + SU2_MPI::Error("Marker element index exceeds size.", CURRENT_FUNCTION); + } + return main_geometry->bound[iMarker][iElem]->GetGlobalIndex(); +} + +vector CDriverBase::GetMarkerElementNodes(unsigned short iMarker, unsigned long iElem) const { + if (iElem >= GetNumberMarkerElements(iMarker)) { + SU2_MPI::Error("Marker element index exceeds size.", CURRENT_FUNCTION); + } + unsigned short nNode = main_geometry->bound[iMarker][iElem]->GetnNodes(); + vector values(nNode); + + for (auto iNode = 0u; iNode < nNode; iNode++) { + values[iNode] = main_geometry->bound[iMarker][iElem]->GetNode(iNode); + } + return values; +} + +unsigned long CDriverBase::GetNumberMarkerNodes(unsigned short iMarker) const { + if (iMarker >= GetNumberMarkers()) { + SU2_MPI::Error("Marker index exceeds size.", CURRENT_FUNCTION); + } + return main_geometry->GetnVertex(iMarker); +} + +unsigned long CDriverBase::GetMarkerNode(unsigned short iMarker, unsigned long iVertex) const { + if (iVertex >= GetNumberMarkerNodes(iMarker)) { + SU2_MPI::Error("Vertex index exceeds marker size.", CURRENT_FUNCTION); + } + return main_geometry->vertex[iMarker][iVertex]->GetNode(); +} + +vector CDriverBase::GetMarkerVertexNormals(unsigned short iMarker, unsigned long iVertex, + bool normalize) const { + if (iVertex >= GetNumberMarkerNodes(iMarker)) { + SU2_MPI::Error("Vertex index exceeds marker size.", CURRENT_FUNCTION); + } + const auto* normal = main_geometry->vertex[iMarker][iVertex]->GetNormal(); + const su2double area = normalize ? GeometryToolbox::Norm(nDim, normal) : 1.0; + + vector values(nDim, 0.0); + + for (auto iDim = 0u; iDim < nDim; iDim++) { + values[iDim] = SU2_TYPE::GetValue(normal[iDim] / area); + } + return values; +} + +void CDriverBase::CommunicateMeshDisplacements() { + solver_container[selected_zone][INST_0][MESH_0][MESH_SOL]->InitiateComms(main_geometry, main_config, MESH_DISPLACEMENTS); + solver_container[selected_zone][INST_0][MESH_0][MESH_SOL]->CompleteComms(main_geometry, main_config, MESH_DISPLACEMENTS); +} + +map CDriverBase::GetSolverIndices() const { + map indexMap; + for (auto iSol = 0u; iSol < MAX_SOLS; iSol++) { + const auto* solver = solver_container[selected_zone][INST_0][MESH_0][iSol]; + if (solver != nullptr) { + if (solver->GetSolverName().empty()) SU2_MPI::Error("Solver name was not defined.", CURRENT_FUNCTION); + indexMap[solver->GetSolverName()] = iSol; + } + } + return indexMap; +} + +std::map CDriverBase::GetFEASolutionIndices() const { + if (solver_container[selected_zone][INST_0][MESH_0][FEA_SOL] == nullptr) { + SU2_MPI::Error("The FEA solver does not exist.", CURRENT_FUNCTION); + } + const auto nDim = main_geometry->GetnDim(); + std::map names; + names["DISPLACEMENT_X"] = 0; + names["DISPLACEMENT_Y"] = 1; + if (nDim == 3) names["DISPLACEMENT_Z"] = 2; + + if (main_config->GetTime_Domain()) { + names["VELOCITY_X"] = nDim; + names["VELOCITY_Y"] = nDim + 1; + if (nDim == 3) names["VELOCITY_Z"] = nDim + 2; + names["ACCELERATION_X"] = 2 * nDim; + names["ACCELERATION_Y"] = 2 * nDim + 1; + if (nDim == 3) names["ACCELERATION_Z"] = 2 * nDim + 2; + } + return names; +} + +map CDriverBase::GetPrimitiveIndices() const { + if (solver_container[selected_zone][INST_0][MESH_0][FLOW_SOL] == nullptr) { + SU2_MPI::Error("The flow solver does not exist.", CURRENT_FUNCTION); + } + return PrimitiveNameToIndexMap(CPrimitiveIndices( + main_config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE, + main_config->GetNEMOProblem(), nDim, main_config->GetnSpecies())); +} diff --git a/SU2_CFD/src/drivers/CDummyDriver.cpp b/SU2_CFD/src/drivers/CDummyDriver.cpp index 8f5d68ae15c..fba8430bdc7 100644 --- a/SU2_CFD/src/drivers/CDummyDriver.cpp +++ b/SU2_CFD/src/drivers/CDummyDriver.cpp @@ -2,7 +2,7 @@ * \file CDummyDriver.cpp * \brief Dummy driver class for running the preprocessing without geometry preprocessing. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/drivers/CMultizoneDriver.cpp b/SU2_CFD/src/drivers/CMultizoneDriver.cpp index 99c64c233f5..49a9c58e724 100644 --- a/SU2_CFD/src/drivers/CMultizoneDriver.cpp +++ b/SU2_CFD/src/drivers/CMultizoneDriver.cpp @@ -2,7 +2,7 @@ * \file driver_structure.cpp * \brief The main subroutines for driving multi-zone problems. * \author R. Sanchez, O. Burghardt - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -117,7 +117,7 @@ CMultizoneDriver::CMultizoneDriver(char* confFile, unsigned short val_nZone, SU2 } -CMultizoneDriver::~CMultizoneDriver(void) { +CMultizoneDriver::~CMultizoneDriver() { for (iZone = 0; iZone < nZone; iZone++){ delete [] init_res[iZone]; @@ -160,11 +160,11 @@ void CMultizoneDriver::StartSolver() { /*--- Main external loop of the solver. Runs for the number of time steps required. ---*/ if (rank == MASTER_NODE){ - cout << endl <<"------------------------------ Begin Solver -----------------------------" << endl; + cout << "\n------------------------------ Begin Solver -----------------------------" << endl; } if (rank == MASTER_NODE){ - cout << endl <<"Simulation Run using the Multizone Driver" << endl; + cout << "\nSimulation Run using the Multizone Driver" << endl; if (driver_config->GetTime_Domain()) cout << "The simulation will run until time step " << driver_config->GetnTime_Iter() - driver_config->GetRestart_Iter() << "." << endl; } @@ -182,10 +182,7 @@ void CMultizoneDriver::StartSolver() { /*--- Run a block iteration of the multizone problem. ---*/ - switch (driver_config->GetKind_MZSolver()){ - case ENUM_MULTIZONE::MZ_BLOCK_GAUSS_SEIDEL: Run_GaussSeidel(); break; // Block Gauss-Seidel iteration - case ENUM_MULTIZONE::MZ_BLOCK_JACOBI: Run_Jacobi(); break; // Block-Jacobi iteration - } + Run(); /*--- Update the solution for dual time stepping strategy ---*/ @@ -245,6 +242,19 @@ void CMultizoneDriver::Preprocess(unsigned long TimeIter) { solver_container[iZone][INST_0], config_container[iZone], TimeIter); } + if (!fsi && (config_container[iZone]->GetKind_Species_Model() != SPECIES_MODEL::NONE)) { + /*--- Set the initial condition for SPECIES solver (species or flamelet) ----------------------*/ + solver_container[iZone][INST_0][MESH_0][SPECIES_SOL]->SetInitialCondition(geometry_container[ZONE_0][INST_0], + solver_container[ZONE_0][INST_0], + config_container[ZONE_0], TimeIter); + } + + + } + + /*--- Ramp turbo values for unsteady problems here, otherwise do it over outer iterations. ---*/ + if (config_container[ZONE_0]->GetTime_Domain()) { + RampTurbomachineryValues(TimeIter); } SU2_MPI::Barrier(SU2_MPI::GetComm()); @@ -273,20 +283,28 @@ void CMultizoneDriver::Preprocess(unsigned long TimeIter) { } -void CMultizoneDriver::Run_GaussSeidel() { +void CMultizoneDriver::RunGaussSeidel() { unsigned short UpdateMesh; bool DeformMesh = false; for (iZone = 0; iZone < nZone; iZone++) { config_container[iZone]->SetOuterIter(0ul); + /*--- This is required for correct restarts with mixing plane interfaces and GS iterations, + * for Jacobi we always do all the transfers before iterating all zones. ---*/ + if (mixingplane) SetMixingPlane(iZone); } /*--- Loop over the number of outer iterations ---*/ - for (auto iOuter_Iter = 0ul; iOuter_Iter < driver_config->GetnOuter_Iter(); iOuter_Iter++){ + for (auto iOuter_Iter = 0ul; iOuter_Iter < driver_config->GetnOuter_Iter(); iOuter_Iter++) { + + /*--- Ramp turbo values for steady problems here, otherwise do it over time steps. ---*/ + if (!config_container[ZONE_0]->GetTime_Domain()) { + RampTurbomachineryValues(iOuter_Iter); + } /*--- Loop over the number of zones (IZONE) ---*/ - for (iZone = 0; iZone < nZone; iZone++){ + for (iZone = 0; iZone < nZone; iZone++) { /*--- In principle, the mesh does not need to be updated ---*/ UpdateMesh = 0; @@ -300,10 +318,11 @@ void CMultizoneDriver::Run_GaussSeidel() { for (auto jZone = 0u; jZone < nZone; jZone++){ /*--- The target zone is iZone ---*/ if (jZone != iZone){ - DeformMesh = Transfer_Data(jZone, iZone); + DeformMesh = TransferData(jZone, iZone); if (DeformMesh) UpdateMesh+=1; } } + /*--- If a mesh update is required due to the transfer of data ---*/ if (UpdateMesh > 0) DynamicMeshUpdate(iZone, TimeIter); @@ -312,6 +331,8 @@ void CMultizoneDriver::Run_GaussSeidel() { solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, iZone, INST_0); + if (mixingplane) SetMixingPlane(iZone); + /*--- A corrector step can help preventing numerical instabilities ---*/ Corrector(iZone); @@ -323,7 +344,7 @@ void CMultizoneDriver::Run_GaussSeidel() { } -void CMultizoneDriver::Run_Jacobi() { +void CMultizoneDriver::RunJacobi() { unsigned short UpdateMesh; bool DeformMesh = false; @@ -335,6 +356,11 @@ void CMultizoneDriver::Run_Jacobi() { /*--- Loop over the number of outer iterations ---*/ for (auto iOuter_Iter = 0ul; iOuter_Iter < driver_config->GetnOuter_Iter(); iOuter_Iter++){ + /*--- Ramp turbo values for steady problems here, otherwise do it over time steps. ---*/ + if (!config_container[ZONE_0]->GetTime_Domain()) { + RampTurbomachineryValues(iOuter_Iter); + } + /*--- Transfer from all zones ---*/ for (iZone = 0; iZone < nZone; iZone++){ @@ -349,17 +375,18 @@ void CMultizoneDriver::Run_Jacobi() { for (auto jZone = 0u; jZone < nZone; jZone++){ /*--- The target zone is iZone ---*/ if (jZone != iZone && interface_container[iZone][jZone] != nullptr){ - DeformMesh = Transfer_Data(jZone, iZone); + DeformMesh = TransferData(jZone, iZone); if (DeformMesh) UpdateMesh+=1; } } /*--- If a mesh update is required due to the transfer of data ---*/ if (UpdateMesh > 0) DynamicMeshUpdate(iZone, TimeIter); + if (mixingplane) SetMixingPlane(iZone); } /*--- Loop over the number of zones (IZONE) ---*/ - for (iZone = 0; iZone < nZone; iZone++){ + for (iZone = 0; iZone < nZone; iZone++) { /*--- Set the OuterIter ---*/ config_container[iZone]->SetOuterIter(iOuter_Iter); @@ -409,13 +436,13 @@ bool CMultizoneDriver::OuterConvergence(unsigned long OuterIter) { /*--- Make sure that everything is loaded into the output container. ---*/ - output_container[iZone]->SetHistory_Output(geometry_container[iZone][INST_0][MESH_0], solvers, config_container[iZone]); + output_container[iZone]->SetHistoryOutput(geometry_container[iZone][INST_0][MESH_0], solvers, config_container[iZone]); } /*--- Print out the convergence data to screen and history file. ---*/ - driver_output->SetMultizoneHistory_Output(output_container, config_container, driver_config, + driver_output->SetMultizoneHistoryOutput(output_container, config_container, driver_config, driver_config->GetTimeIter(), driver_config->GetOuterIter()); return driver_output->GetConvergence(); @@ -434,7 +461,7 @@ void CMultizoneDriver::Update() { for (auto jZone = 0u; jZone < nZone; jZone++){ /*--- The target zone is iZone ---*/ if (jZone != iZone){ - UpdateMesh += Transfer_Data(jZone, iZone); + UpdateMesh += TransferData(jZone, iZone); } } /*--- If a mesh update is required due to the transfer of data ---*/ @@ -443,13 +470,6 @@ void CMultizoneDriver::Update() { iteration_container[iZone][INST_0]->Update(output_container[iZone], integration_container, geometry_container, solver_container, numerics_container, config_container, surface_movement, grid_movement, FFDBox, iZone, INST_0); - - /*--- Set the Convergence_FSI boolean to false for the next time step ---*/ - for (unsigned short iSol = 0; iSol < MAX_SOLS-1; iSol++){ - if (integration_container[iZone][INST_0][iSol] != nullptr){ - integration_container[iZone][INST_0][iSol]->SetConvergence_FSI(false); - } - } } } @@ -467,7 +487,7 @@ void CMultizoneDriver::Output(unsigned long TimeIter) { bool wrote_files = false; for (iZone = 0; iZone < nZone; iZone++){ - wrote_files = output_container[iZone]->SetResult_Files(geometry_container[iZone][INST_0][MESH_0], + wrote_files = output_container[iZone]->SetResultFiles(geometry_container[iZone][INST_0][MESH_0], config_container[iZone], solver_container[iZone][INST_0][MESH_0], TimeIter, StopCalc ); } @@ -532,7 +552,7 @@ void CMultizoneDriver::DynamicMeshUpdate(unsigned short val_iZone, unsigned long } } -bool CMultizoneDriver::Transfer_Data(unsigned short donorZone, unsigned short targetZone) { +bool CMultizoneDriver::TransferData(unsigned short donorZone, unsigned short targetZone) { bool UpdateMesh = false; @@ -584,6 +604,7 @@ bool CMultizoneDriver::Transfer_Data(unsigned short donorZone, unsigned short ta case FLOW_TRACTION: BroadcastData(FLOW_SOL, FEA_SOL); break; + case MIXING_PLANE: case NO_TRANSFER: case ZONES_ARE_EQUAL: case NO_COMMON_INTERFACE: @@ -598,11 +619,35 @@ bool CMultizoneDriver::Transfer_Data(unsigned short donorZone, unsigned short ta return UpdateMesh; } -bool CMultizoneDriver::Monitor(unsigned long TimeIter){ +void CMultizoneDriver::SetMixingPlane(unsigned short donorZone) { + + const auto nMarkerInt = config_container[donorZone]->GetnMarker_MixingPlaneInterface() / 2; + + /*--- Transfer the average value from the donor zones to the target zones ---*/ + for (auto iMarkerInt = 1; iMarkerInt <= nMarkerInt; iMarkerInt++) { + for (auto targetZone = 0u; targetZone < nZone; targetZone++) { + if (targetZone == donorZone) continue; + interface_container[donorZone][targetZone]->AllgatherAverage( + solver_container[donorZone][INST_0][MESH_0][FLOW_SOL], solver_container[targetZone][INST_0][MESH_0][FLOW_SOL], + geometry_container[donorZone][INST_0][MESH_0], geometry_container[targetZone][INST_0][MESH_0], + config_container[donorZone], config_container[targetZone], iMarkerInt); + } + } +} + +void CMultizoneDriver::SetTurboPerformance() { + for (auto donorZone = 1u; donorZone < nZone; donorZone++) { + interface_container[donorZone][ZONE_0]->GatherAverageValues(solver_container[donorZone][INST_0][MESH_0][FLOW_SOL], + solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL], + donorZone); + } +} + +bool CMultizoneDriver::Monitor(unsigned long TimeIter) { /*--- Check whether the inner solver has converged --- */ - if (driver_config->GetTime_Domain() == NO){ + if (driver_config->GetTime_Domain() == NO) { const auto OuterIter = driver_config->GetOuterIter(); const auto nOuterIter = driver_config->GetnOuter_Iter(); @@ -611,40 +656,40 @@ bool CMultizoneDriver::Monitor(unsigned long TimeIter){ const bool MaxIterationsReached = (OuterIter+1 >= nOuterIter); if ((MaxIterationsReached || InnerConvergence) && (rank == MASTER_NODE)) { - cout << endl << "----------------------------- Solver Exit -------------------------------" << endl; + cout << "\n----------------------------- Solver Exit -------------------------------" << endl; if (InnerConvergence) cout << "All convergence criteria satisfied." << endl; - else cout << endl << "Maximum number of iterations reached (OUTER_ITER = " << OuterIter+1 << ") before convergence." << endl; + else cout << "\nMaximum number of iterations reached (OUTER_ITER = " << OuterIter+1 << ") before convergence." << endl; driver_output->PrintConvergenceSummary(); cout << "-------------------------------------------------------------------------" << endl; } return (MaxIterationsReached || InnerConvergence); } - else { // i.e. unsteady simulation + // i.e. unsteady simulation - /*--- Check whether the outer time integration has reached the final time ---*/ - const auto TimeConvergence = GetTimeConvergence(); + /*--- Check whether the outer time integration has reached the final time. ---*/ + const auto TimeConvergence = GetTimeConvergence(); - const auto nTimeIter = driver_config->GetnTime_Iter(); - const auto MaxTime = driver_config->GetMax_Time(); - const auto CurTime = driver_output->GetHistoryFieldValue("CUR_TIME"); + const auto nTimeIter = driver_config->GetnTime_Iter(); + const auto MaxTime = driver_config->GetMax_Time(); + const auto CurTime = driver_output->GetHistoryFieldValue("CUR_TIME"); - const bool FinalTimeReached = (CurTime >= MaxTime); - const bool MaxIterationsReached = (TimeIter+1 >= nTimeIter); + const bool FinalTimeReached = (CurTime >= MaxTime); + const bool MaxIterationsReached = (TimeIter+1 >= nTimeIter); - if ((TimeConvergence || FinalTimeReached || MaxIterationsReached) && (rank == MASTER_NODE)){ - cout << endl << "----------------------------- Solver Exit -------------------------------"; - if (TimeConvergence) cout << endl << "All windowed time-averaged convergence criteria are fullfilled." << endl; - if (FinalTimeReached) cout << endl << "Maximum time reached (MAX_TIME = " << MaxTime << "s)." << endl; - else cout << endl << "Maximum number of time iterations reached (TIME_ITER = " << nTimeIter << ")." << endl; - cout << "-------------------------------------------------------------------------" << endl; - } - - return (FinalTimeReached || MaxIterationsReached); + if ((TimeConvergence || FinalTimeReached || MaxIterationsReached) && (rank == MASTER_NODE)){ + cout << "\n----------------------------- Solver Exit -------------------------------"; + if (TimeConvergence) cout << "\nAll windowed time-averaged convergence criteria are fullfilled." << endl; + if (FinalTimeReached) cout << "\nMaximum time reached (MAX_TIME = " << MaxTime << "s)." << endl; + else cout << "\nMaximum number of time iterations reached (TIME_ITER = " << nTimeIter << ")." << endl; + cout << "-------------------------------------------------------------------------" << endl; } + if (rank == MASTER_NODE && driver_config->GetBoolTurbomachinery()) SetTurboPerformance(); + + return (FinalTimeReached || MaxIterationsReached); } bool CMultizoneDriver::GetTimeConvergence() const{ - return output_container[ZONE_0]->GetCauchyCorrectedTimeConvergence(config_container[ZONE_0]); + return output_container[ZONE_0]->GetCauchyCorrectedTimeConvergence(config_container[ZONE_0]); } diff --git a/SU2_CFD/src/drivers/CSinglezoneDriver.cpp b/SU2_CFD/src/drivers/CSinglezoneDriver.cpp index fe4bd854e1a..c35d6b8eac5 100644 --- a/SU2_CFD/src/drivers/CSinglezoneDriver.cpp +++ b/SU2_CFD/src/drivers/CSinglezoneDriver.cpp @@ -2,7 +2,7 @@ * \file driver_direct_singlezone.cpp * \brief The main subroutines for driving single-zone problems. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -41,9 +41,7 @@ CSinglezoneDriver::CSinglezoneDriver(char* confFile, TimeIter = 0; } -CSinglezoneDriver::~CSinglezoneDriver(void) { - -} +CSinglezoneDriver::~CSinglezoneDriver() = default; void CSinglezoneDriver::StartSolver() { @@ -94,12 +92,6 @@ void CSinglezoneDriver::StartSolver() { Output(TimeIter); - /*--- Save iteration solution for libROM ---*/ - if (config_container[MESH_0]->GetSave_libROM()) { - solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SavelibROM(geometry_container[ZONE_0][INST_0][MESH_0], - config_container[ZONE_0], StopCalc); - } - /*--- If the convergence criteria has been met, terminate the simulation. ---*/ if (StopCalc) break; @@ -112,12 +104,10 @@ void CSinglezoneDriver::StartSolver() { void CSinglezoneDriver::Preprocess(unsigned long TimeIter) { - /*--- Set runtime option ---*/ - - Runtime_Options(); - - /*--- Set the current time iteration in the config ---*/ + /*--- Set the current time iteration in the config and also in the driver + * because the python interface doesn't offer an explicit way of doing it. ---*/ + this->TimeIter = TimeIter; config_container[ZONE_0]->SetTimeIter(TimeIter); /*--- Store the current physical time in the config container, as @@ -129,12 +119,20 @@ void CSinglezoneDriver::Preprocess(unsigned long TimeIter) { else config_container[ZONE_0]->SetPhysicalTime(0.0); + /*--- Ramp turbo BCs for this time step. ---*/ + RampTurbomachineryValues(TimeIter); + /*--- Set the initial condition for EULER/N-S/RANS ---------------------------------------------*/ if (config_container[ZONE_0]->GetFluidProblem()) { solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SetInitialCondition(geometry_container[ZONE_0][INST_0], solver_container[ZONE_0][INST_0], config_container[ZONE_0], TimeIter); } + if (config_container[ZONE_0]->GetKind_Species_Model() != SPECIES_MODEL::NONE) { + solver_container[ZONE_0][INST_0][MESH_0][SPECIES_SOL]->SetInitialCondition(geometry_container[ZONE_0][INST_0], + solver_container[ZONE_0][INST_0], + config_container[ZONE_0], TimeIter); + } else if (config_container[ZONE_0]->GetHeatProblem()) { /*--- Set the initial condition for HEAT equation ---------------------------------------------*/ solver_container[ZONE_0][INST_0][MESH_0][HEAT_SOL]->SetInitialCondition(geometry_container[ZONE_0][INST_0], @@ -199,12 +197,19 @@ void CSinglezoneDriver::Output(unsigned long TimeIter) { StartTime = SU2_MPI::Wtime(); - bool wrote_files = output_container[ZONE_0]->SetResult_Files(geometry_container[ZONE_0][INST_0][MESH_0], + bool wrote_files = output_container[ZONE_0]->SetResultFiles(geometry_container[ZONE_0][INST_0][MESH_0], config_container[ZONE_0], solver_container[ZONE_0][INST_0][MESH_0], TimeIter, StopCalc); - if (wrote_files){ + /*--- Save iteration solution for libROM ---*/ + if (config_container[MESH_0]->GetSave_libROM()) { + solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SavelibROM(geometry_container[ZONE_0][INST_0][MESH_0], + config_container[ZONE_0], StopCalc); + wrote_files = true; + } + + if (wrote_files) { StopTime = SU2_MPI::Wtime(); @@ -262,13 +267,13 @@ bool CSinglezoneDriver::Monitor(unsigned long TimeIter){ if (TimeDomain == NO){ - InnerConvergence = output_container[ZONE_0]->GetConvergence(); + InnerConvergence = output_container[ZONE_0]->GetConvergence(); MaxIterationsReached = InnerIter+1 >= nInnerIter; if ((MaxIterationsReached || InnerConvergence) && (rank == MASTER_NODE)) { - cout << endl << "----------------------------- Solver Exit -------------------------------" << endl; + cout << "\n----------------------------- Solver Exit -------------------------------" << endl; if (InnerConvergence) cout << "All convergence criteria satisfied." << endl; - else cout << endl << "Maximum number of iterations reached (ITER = " << nInnerIter << ") before convergence." << endl; + else cout << "\nMaximum number of iterations reached (ITER = " << nInnerIter << ") before convergence." << endl; output_container[ZONE_0]->PrintConvergenceSummary(); cout << "-------------------------------------------------------------------------" << endl; } @@ -276,25 +281,23 @@ bool CSinglezoneDriver::Monitor(unsigned long TimeIter){ StopCalc = MaxIterationsReached || InnerConvergence; } - - if (TimeDomain == YES) { /*--- Check whether the outer time integration has reached the final time ---*/ TimeConvergence = GetTimeConvergence(); - FinalTimeReached = CurTime >= MaxTime; + FinalTimeReached = CurTime >= MaxTime; MaxIterationsReached = TimeIter+1 >= nTimeIter; if ((FinalTimeReached || MaxIterationsReached || TimeConvergence) && (rank == MASTER_NODE)){ - cout << endl << "----------------------------- Solver Exit -------------------------------"; - if (TimeConvergence) cout << endl << "All windowed time-averaged convergence criteria are fullfilled." << endl; - if (FinalTimeReached) cout << endl << "Maximum time reached (MAX_TIME = " << MaxTime << "s)." << endl; - if (MaxIterationsReached) cout << endl << "Maximum number of time iterations reached (TIME_ITER = " << nTimeIter << ")." << endl; + cout << "\n----------------------------- Solver Exit -------------------------------"; + if (TimeConvergence) cout << "\nAll windowed time-averaged convergence criteria are fullfilled." << endl; + if (FinalTimeReached) cout << "\nMaximum time reached (MAX_TIME = " << MaxTime << "s)." << endl; + if (MaxIterationsReached) cout << "\nMaximum number of time iterations reached (TIME_ITER = " << nTimeIter << ")." << endl; cout << "-------------------------------------------------------------------------" << endl; } - StopCalc = FinalTimeReached || MaxIterationsReached|| TimeConvergence; + StopCalc = FinalTimeReached || MaxIterationsReached || TimeConvergence; } /*--- Reset the inner convergence --- */ @@ -308,23 +311,6 @@ bool CSinglezoneDriver::Monitor(unsigned long TimeIter){ return StopCalc; } -void CSinglezoneDriver::Runtime_Options(){ - - ifstream runtime_configfile; - - /*--- Try to open the runtime config file ---*/ - - runtime_configfile.open(runtime_file_name, ios::in); - - /*--- If succeeded create a temporary config object ---*/ - - if (runtime_configfile.good()){ - CConfig *runtime = new CConfig(runtime_file_name, config_container[ZONE_0]); - delete runtime; - } - -} - bool CSinglezoneDriver::GetTimeConvergence() const{ return output_container[ZONE_0]->GetCauchyCorrectedTimeConvergence(config_container[ZONE_0]); } diff --git a/SU2_CFD/src/fluid/CCoolProp.cpp b/SU2_CFD/src/fluid/CCoolProp.cpp index 8fe0103964c..9c48b1da6ba 100644 --- a/SU2_CFD/src/fluid/CCoolProp.cpp +++ b/SU2_CFD/src/fluid/CCoolProp.cpp @@ -2,7 +2,7 @@ * \file CCoolProp.cpp * \brief Source of the fluid model from CoolProp. * \author P. Yan, G. Gori, A. Guardone - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -28,12 +28,12 @@ #include "../../include/fluid/CCoolProp.hpp" #ifdef USE_COOLPROP -#include "CoolProp.h" #include "AbstractState.h" +#include "CoolProp.h" -CCoolProp::CCoolProp(string fluidname) : CFluidModel() { - fluid_entity = std::unique_ptr(CoolProp::AbstractState::factory("HEOS",fluidname)); - Gas_Constant = fluid_entity->gas_constant()/fluid_entity->molar_mass(); +CCoolProp::CCoolProp(const string &fluidname) : CFluidModel() { + fluid_entity = std::unique_ptr(CoolProp::AbstractState::factory("HEOS", fluidname)); + Gas_Constant = fluid_entity->gas_constant() / fluid_entity->molar_mass(); Pressure_Critical = fluid_entity->p_critical(); Temperature_Critical = fluid_entity->T_critical(); acentric_factor = fluid_entity->acentric_factor(); @@ -55,16 +55,21 @@ void CCoolProp::SetTDState_rhoe(su2double rho, su2double e) { dPde_rho = fluid_entity->first_partial_deriv(CoolProp::iP, CoolProp::iUmass, CoolProp::iDmass); dTdrho_e = fluid_entity->first_partial_deriv(CoolProp::iT, CoolProp::iDmass, CoolProp::iUmass); dTde_rho = fluid_entity->first_partial_deriv(CoolProp::iT, CoolProp::iUmass, CoolProp::iDmass); - if (fluid_entity->phase() == 6) { - fluid_entity->specify_phase(CoolProp::iphase_gas); - SetTDState_PT(Pressure,Temperature); - } - else{ - SoundSpeed2 = pow(fluid_entity->speed_sound(), 2); + if (fluid_entity->phase() == CoolProp::iphase_twophase) { + // impose gas phase + Temperature = Temperature + 0.1; + CheckPressure(Pressure); + CheckTemperature(Temperature); + fluid_entity->update(CoolProp::PT_INPUTS, Pressure, Temperature); + SoundSpeed2 = pow(fluid_entity->speed_sound(), 2); + } else { + SoundSpeed2 = pow(fluid_entity->speed_sound(), 2); } } void CCoolProp::SetTDState_PT(su2double P, su2double T) { + CheckPressure(P); + CheckTemperature(T); fluid_entity->update(CoolProp::PT_INPUTS, P, T); su2double rho = fluid_entity->rhomass(); su2double e = fluid_entity->umass(); @@ -72,12 +77,14 @@ void CCoolProp::SetTDState_PT(su2double P, su2double T) { } void CCoolProp::SetTDState_Prho(su2double P, su2double rho) { + CheckPressure(P); fluid_entity->update(CoolProp::DmassP_INPUTS, rho, P); su2double e = fluid_entity->umass(); SetTDState_rhoe(rho, e); } void CCoolProp::SetEnergy_Prho(su2double P, su2double rho) { + CheckPressure(P); fluid_entity->update(CoolProp::DmassP_INPUTS, rho, P); StaticEnergy = fluid_entity->umass(); } @@ -89,30 +96,33 @@ void CCoolProp::SetTDState_hs(su2double h, su2double s) { SetTDState_rhoe(rho, e); } -void CCoolProp::SetTDState_Ps(su2double P, su2double s) { +void CCoolProp::SetTDState_Ps(su2double P, su2double s) { + CheckPressure(P); fluid_entity->update(CoolProp::PSmass_INPUTS, P, s); - su2double Rho = fluid_entity->rhomass(); + su2double rho = fluid_entity->rhomass(); su2double e = fluid_entity->umass(); - SetTDState_rhoe(Rho, e); + SetTDState_rhoe(rho, e); } void CCoolProp::SetTDState_rhoT(su2double rho, su2double T) { fluid_entity->update(CoolProp::DmassT_INPUTS, rho, T); - su2double Rho = fluid_entity->rhomass(); su2double e = fluid_entity->umass(); - SetTDState_rhoe(Rho, e); + SetTDState_rhoe(rho, e); } -void CCoolProp::ComputeDerivativeNRBC_Prho(su2double P, su2double rho) { +void CCoolProp::ComputeDerivativeNRBC_Prho(su2double P, su2double rho) { SetTDState_Prho(P, rho); - dhdrho_P = fluid_entity->first_partial_deriv(CoolProp::iHmass,CoolProp::iDmass,CoolProp::iP); - dhdP_rho = fluid_entity->first_partial_deriv(CoolProp::iHmass,CoolProp::iP,CoolProp::iDmass); - dsdP_rho = fluid_entity->first_partial_deriv(CoolProp::iSmass,CoolProp::iP,CoolProp::iDmass); - dsdrho_P = fluid_entity->first_partial_deriv(CoolProp::iSmass,CoolProp::iDmass,CoolProp::iP); + dhdrho_P = fluid_entity->first_partial_deriv(CoolProp::iHmass, CoolProp::iDmass, CoolProp::iP); + dhdP_rho = fluid_entity->first_partial_deriv(CoolProp::iHmass, CoolProp::iP, CoolProp::iDmass); + dsdP_rho = fluid_entity->first_partial_deriv(CoolProp::iSmass, CoolProp::iP, CoolProp::iDmass); + dsdrho_P = fluid_entity->first_partial_deriv(CoolProp::iSmass, CoolProp::iDmass, CoolProp::iP); } #else -CCoolProp::CCoolProp(string fluidname) { - SU2_MPI::Error("SU2 was not compiled with CoolProp (-Denable-coolprop=true). Note that CoolProp cannot be used with directdiff or autodiff", CURRENT_FUNCTION); +CCoolProp::CCoolProp(const string& fluidname) { + SU2_MPI::Error( + "SU2 was not compiled with CoolProp (-Denable-coolprop=true). Note that CoolProp cannot be used with directdiff " + "or autodiff", + CURRENT_FUNCTION); } #endif \ No newline at end of file diff --git a/SU2_CFD/src/fluid/CDataDrivenFluid.cpp b/SU2_CFD/src/fluid/CDataDrivenFluid.cpp new file mode 100644 index 00000000000..40f8e1234c7 --- /dev/null +++ b/SU2_CFD/src/fluid/CDataDrivenFluid.cpp @@ -0,0 +1,383 @@ +/*! + * \file CDataDrivenFluid.cpp + * \brief Source of the data-driven fluid model class + * \author E.C.Bunschoten M.Mayer A.Capiello + * \version 8.0.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/fluid/CDataDrivenFluid.hpp" +#if defined(HAVE_MLPCPP) +#include "../../../subprojects/MLPCpp/include/CLookUp_ANN.hpp" +#define USE_MLPCPP +#endif + +CDataDrivenFluid::CDataDrivenFluid(const CConfig* config, bool display) : CFluidModel() { + rank = SU2_MPI::GetRank(); + Kind_DataDriven_Method = config->GetKind_DataDriven_Method(); + + varname_rho = "Density"; + varname_e = "Energy"; + + /*--- Set up interpolation algorithm according to data-driven method. Currently only MLP's are supported. ---*/ + switch (Kind_DataDriven_Method) { + case ENUM_DATADRIVEN_METHOD::MLP: +#ifdef USE_MLPCPP + lookup_mlp = new MLPToolbox::CLookUp_ANN(config->GetNDataDriven_Files(), config->GetDataDriven_FileNames()); + if ((rank == MASTER_NODE) && display) lookup_mlp->DisplayNetworkInfo(); +#else + SU2_MPI::Error("SU2 was not compiled with MLPCpp enabled (-Denable-mlpcpp=true).", CURRENT_FUNCTION); +#endif + break; + case ENUM_DATADRIVEN_METHOD::LUT: + lookup_table = new CLookUpTable(config->GetDataDriven_FileNames()[0], varname_rho, varname_e); + break; + default: + break; + } + + /*--- Relaxation factor and tolerance for Newton solvers. ---*/ + Newton_Relaxation = config->GetRelaxation_DataDriven(); + Newton_Tolerance = 1e-10; + MaxIter_Newton = 50; + + /*--- Preprocessing of inputs and outputs for the interpolation method. ---*/ + MapInputs_to_Outputs(); + + /*--- Compute approximate ideal gas properties ---*/ + ComputeIdealGasQuantities(); +} + +CDataDrivenFluid::~CDataDrivenFluid() { + switch (Kind_DataDriven_Method) { + case ENUM_DATADRIVEN_METHOD::MLP: +#ifdef USE_MLPCPP + delete iomap_rhoe; + delete lookup_mlp; +#endif + break; + case ENUM_DATADRIVEN_METHOD::LUT: + delete lookup_table; + break; + default: + break; + } +} +void CDataDrivenFluid::MapInputs_to_Outputs() { + /*--- Inputs of the data-driven method are density and internal energy. ---*/ + input_names_rhoe.resize(2); + idx_rho = 0; + idx_e = 1; + input_names_rhoe[idx_rho] = varname_rho; + input_names_rhoe[idx_e] = varname_e; + + /*--- Required outputs for the interpolation method are entropy and its partial derivatives with respect to energy and + * density. ---*/ + size_t n_outputs = 6; + size_t idx_s = 0, idx_dsde_rho = 1, idx_dsdrho_e = 2, idx_d2sde2 = 3, idx_d2sdedrho = 4, idx_d2sdrho2 = 5; + + outputs_rhoe.resize(n_outputs); + output_names_rhoe.resize(n_outputs); + output_names_rhoe[idx_s] = "s"; + outputs_rhoe[idx_s] = &Entropy; + output_names_rhoe[idx_dsde_rho] = "dsde_rho"; + outputs_rhoe[idx_dsde_rho] = &dsde_rho; + output_names_rhoe[idx_dsdrho_e] = "dsdrho_e"; + outputs_rhoe[idx_dsdrho_e] = &dsdrho_e; + output_names_rhoe[idx_d2sde2] = "d2sde2"; + outputs_rhoe[idx_d2sde2] = &d2sde2; + output_names_rhoe[idx_d2sdedrho] = "d2sdedrho"; + outputs_rhoe[idx_d2sdedrho] = &d2sdedrho; + output_names_rhoe[idx_d2sdrho2] = "d2sdrho2"; + outputs_rhoe[idx_d2sdrho2] = &d2sdrho2; + + /*--- Further preprocessing of input and output variables. ---*/ + if (Kind_DataDriven_Method == ENUM_DATADRIVEN_METHOD::MLP) { +/*--- Map MLP inputs to outputs. ---*/ +#ifdef USE_MLPCPP + iomap_rhoe = new MLPToolbox::CIOMap(input_names_rhoe, output_names_rhoe); + lookup_mlp->PairVariableswithMLPs(*iomap_rhoe); + MLP_inputs.resize(2); +#endif + } +} + +void CDataDrivenFluid::SetTDState_rhoe(su2double rho, su2double e) { + /*--- Compute thermodynamic state based on density and energy. ---*/ + Density = rho; + StaticEnergy = e; + + /*--- Clip density and energy values to prevent extrapolation. ---*/ + Density = min(rho_max, max(rho_min, Density)); + StaticEnergy = min(e_max, max(e_min, StaticEnergy)); + + Evaluate_Dataset(Density, StaticEnergy); + + /*--- Compute speed of sound. ---*/ + auto blue_term = (dsdrho_e * (2 - rho * pow(dsde_rho, -1) * d2sdedrho) + rho * d2sdrho2); + auto green_term = (-pow(dsde_rho, -1) * d2sde2 * dsdrho_e + d2sdedrho); + + SoundSpeed2 = -rho * pow(dsde_rho, -1) * (blue_term - rho * green_term * (dsdrho_e / dsde_rho)); + + /*--- Compute primary flow variables. ---*/ + Temperature = 1.0 / dsde_rho; + Pressure = -pow(rho, 2) * Temperature * dsdrho_e; + Density = rho; + StaticEnergy = e; + Enthalpy = e + Pressure / rho; + + /*--- Compute secondary flow variables ---*/ + dTde_rho = -pow(dsde_rho, -2) * d2sde2; + dTdrho_e = -pow(dsde_rho, -2) * d2sdedrho; + + dPde_rho = -pow(rho, 2) * (dTde_rho * dsdrho_e + Temperature * d2sdedrho); + dPdrho_e = -2 * rho * Temperature * dsdrho_e - pow(rho, 2) * (dTdrho_e * dsdrho_e + Temperature * d2sdrho2); + + /*--- Compute enthalpy and entropy derivatives required for Giles boundary conditions. ---*/ + dhdrho_e = -Pressure * pow(rho, -2) + dPdrho_e / rho; + dhde_rho = 1 + dPde_rho / rho; + + dhdrho_P = dhdrho_e - dhde_rho * (1 / dPde_rho) * dPdrho_e; + dhdP_rho = dhde_rho * (1 / dPde_rho); + dsdrho_P = dsdrho_e - dPdrho_e * (1 / dPde_rho) * dsde_rho; + dsdP_rho = dsde_rho / dPde_rho; +} + +void CDataDrivenFluid::SetTDState_PT(su2double P, su2double T) { + + /*--- Approximate density and static energy with ideal gas law. ---*/ + rho_start = P / (R_idealgas * T); + e_start = Cv_idealgas * T; + + /*--- Run 2D Newton solver for pressure and temperature ---*/ + Run_Newton_Solver(P, T, &Pressure, &Temperature, &dPdrho_e, &dPde_rho, &dTdrho_e, &dTde_rho); +} + +void CDataDrivenFluid::SetTDState_Prho(su2double P, su2double rho) { + /*--- Computing static energy according to pressure and density. ---*/ + SetEnergy_Prho(P, rho); +} + +void CDataDrivenFluid::SetEnergy_Prho(su2double P, su2double rho) { + /*--- Run 1D Newton solver for pressure at constant density. ---*/ + Density = rho; + + /*--- Approximate static energy through ideal gas law. ---*/ + su2double e_idealgas = Cv_idealgas * (P / (R_idealgas * rho)); + StaticEnergy = min(e_max, max(e_idealgas, e_min)); + + Run_Newton_Solver(P, &Pressure, &StaticEnergy, &dPde_rho); +} + +void CDataDrivenFluid::SetTDState_rhoT(su2double rho, su2double T) { + /*--- Run 1D Newton solver for temperature at constant density. ---*/ + Density = rho; + + /*--- Approximate static energy through ideal gas law. ---*/ + StaticEnergy = Cv_idealgas * T; + + Run_Newton_Solver(T, &Temperature, &StaticEnergy, &dTde_rho); +} + +void CDataDrivenFluid::SetTDState_hs(su2double h, su2double s) { + /*--- Run 2D Newton solver for enthalpy and entropy. ---*/ + + /*--- Approximate density and static energy through ideal gas law under isentropic assumption. ---*/ + su2double T_init = h / Cp_idealgas; + su2double P_init = P_middle * pow(T_init / T_middle, gamma_idealgas/(gamma_idealgas - 1)); + + e_start = h * Cv_idealgas / Cp_idealgas; + rho_start = P_init / (R_idealgas * T_init); + Run_Newton_Solver(h, s, &Enthalpy, &Entropy, &dhdrho_e, &dhde_rho, &dsdrho_e, &dsde_rho); +} + +void CDataDrivenFluid::SetTDState_Ps(su2double P, su2double s) { + /*--- Run 2D Newton solver for pressure and entropy ---*/ + + /*--- Approximate initial state through isentropic assumption and ideal gas law. ---*/ + su2double T_init = T_middle * pow(P / P_middle, (gamma_idealgas - 1)/gamma_idealgas); + e_start = Cv_idealgas * T_init; + rho_start = P / (R_idealgas * T_init); + + Run_Newton_Solver(P, s, &Pressure, &Entropy, &dPdrho_e, &dPde_rho, &dsdrho_e, &dsde_rho); +} + +unsigned long CDataDrivenFluid::Predict_MLP(su2double rho, su2double e) { + unsigned long exit_code = 0; +/*--- Evaluate MLP collection for the given values for density and energy. ---*/ +#ifdef USE_MLPCPP + MLP_inputs[idx_rho] = rho; + MLP_inputs[idx_e] = e; + exit_code = lookup_mlp->PredictANN(iomap_rhoe, MLP_inputs, outputs_rhoe); +#endif + return exit_code; +} + +unsigned long CDataDrivenFluid::Predict_LUT(su2double rho, su2double e) { + unsigned long exit_code; + std::vector output_names_rhoe_LUT; + std::vector outputs_LUT; + output_names_rhoe_LUT.resize(output_names_rhoe.size()); + for (auto iOutput = 0u; iOutput < output_names_rhoe.size(); iOutput++) { + output_names_rhoe_LUT[iOutput] = output_names_rhoe[iOutput]; + } + + outputs_LUT.resize(outputs_rhoe.size()); + for (auto iOutput = 0u; iOutput < outputs_rhoe.size(); iOutput++) { + outputs_LUT[iOutput] = outputs_rhoe[iOutput]; + } + + exit_code = lookup_table->LookUp_XY(output_names_rhoe_LUT, outputs_LUT, rho, e); + return exit_code; +} + +void CDataDrivenFluid::Evaluate_Dataset(su2double rho, su2double e) { + /*--- Evaluate dataset based on regression method. ---*/ + switch (Kind_DataDriven_Method) { + case ENUM_DATADRIVEN_METHOD::LUT: + outside_dataset = Predict_LUT(rho, e); + break; + case ENUM_DATADRIVEN_METHOD::MLP: + outside_dataset = Predict_MLP(rho, e); + break; + default: + break; + } +} + +void CDataDrivenFluid::Run_Newton_Solver(su2double Y1_target, su2double Y2_target, su2double* Y1, su2double* Y2, + su2double* dY1drho, su2double* dY1de, su2double* dY2drho, su2double* dY2de) { + /*--- 2D Newton solver, computing the density and internal energy values corresponding to Y1_target and Y2_target. + * ---*/ + + /*--- Setting initial values for density and energy. ---*/ + su2double rho = rho_start, e = e_start; + + bool converged = false; + unsigned long Iter = 0; + + su2double delta_Y1, delta_Y2, delta_rho, delta_e, determinant; + + /*--- Initiating Newton solver ---*/ + while (!converged && (Iter < MaxIter_Newton)) { + /*--- Determine thermodynamic state based on current density and energy. ---*/ + SetTDState_rhoe(rho, e); + + /*--- Determine residuals. ---*/ + delta_Y1 = *Y1 - Y1_target; + delta_Y2 = *Y2 - Y2_target; + + /*--- Continue iterative process if residuals are outside tolerances. ---*/ + if ((abs(delta_Y1 / *Y1) < Newton_Tolerance) && (abs(delta_Y2 / *Y2) < Newton_Tolerance)) { + converged = true; + } else { + /*--- Compute step size for density and energy. ---*/ + determinant = (*dY1drho) * (*dY2de) - (*dY1de) * (*dY2drho); + + delta_rho = (*dY2de * delta_Y1 - *dY1de * delta_Y2) / determinant; + delta_e = (-*dY2drho * delta_Y1 + *dY1drho * delta_Y2) / determinant; + + /*--- Update density and energy values. ---*/ + rho -= Newton_Relaxation * delta_rho; + e -= Newton_Relaxation * delta_e; + } + Iter++; + } + nIter_Newton = Iter; + + /*--- Evaluation of final state. ---*/ + SetTDState_rhoe(rho, e); +} + +void CDataDrivenFluid::Run_Newton_Solver(su2double Y_target, su2double* Y, su2double* X, su2double* dYdX) { + /*--- 1D Newton solver, computing the density or internal energy value corresponding to Y_target. ---*/ + + bool converged = false; + unsigned long Iter = 0; + + su2double delta_Y, delta_X; + + /*--- Initiating Newton solver. ---*/ + while (!converged && (Iter < MaxIter_Newton)) { + /*--- Determine thermodynamic state based on current density and energy. ---*/ + SetTDState_rhoe(Density, StaticEnergy); + + /*--- Determine residual ---*/ + delta_Y = Y_target - *Y; + + /*--- Continue iterative process if residuals are outside tolerances. ---*/ + if (abs(delta_Y / *Y) < Newton_Tolerance) { + converged = true; + } else { + delta_X = delta_Y / *dYdX; + + /*--- Update energy value ---*/ + *X += Newton_Relaxation * delta_X; + } + Iter++; + } + + /*--- Calculate thermodynamic state based on converged values for density and energy. ---*/ + SetTDState_rhoe(Density, StaticEnergy); + + nIter_Newton = Iter; +} + +void CDataDrivenFluid::ComputeIdealGasQuantities() { + /*--- Compute approximate ideal gas properties from the middle of the reference data set. These properties are used to approximate the initial condition of the Newton solvers using the ideal gas law. ---*/ + su2double rho_average = 1.0, e_average = 1.0; + + /*--- Obtain minimum and maximum density and static energy from data set. ---*/ + switch (Kind_DataDriven_Method) + { + case ENUM_DATADRIVEN_METHOD::LUT: + rho_min = *lookup_table->GetTableLimitsX().first; + e_min = *lookup_table->GetTableLimitsY().first; + rho_max = *lookup_table->GetTableLimitsX().second; + e_max = *lookup_table->GetTableLimitsY().second; + rho_average = 0.5*(*lookup_table->GetTableLimitsX().first + *lookup_table->GetTableLimitsX().second); + e_average = 0.5*(*lookup_table->GetTableLimitsY().first + *lookup_table->GetTableLimitsY().second); + break; + case ENUM_DATADRIVEN_METHOD::MLP: +#ifdef USE_MLPCPP + rho_min = lookup_mlp->GetInputNorm(iomap_rhoe, idx_rho).first; + e_min = lookup_mlp->GetInputNorm(iomap_rhoe, idx_e).first; + rho_max = lookup_mlp->GetInputNorm(iomap_rhoe, idx_rho).second; + e_max = lookup_mlp->GetInputNorm(iomap_rhoe, idx_e).second; + rho_average = 0.5*(lookup_mlp->GetInputNorm(iomap_rhoe, idx_rho).first + lookup_mlp->GetInputNorm(iomap_rhoe, idx_rho).second); + e_average = 0.5*(lookup_mlp->GetInputNorm(iomap_rhoe, idx_e).first + lookup_mlp->GetInputNorm(iomap_rhoe, idx_e).second); +#endif + break; + default: + break; + } + + /*--- Compute thermodynamic state from middle of data set. ---*/ + SetTDState_rhoe(rho_average, e_average); + P_middle = Pressure; + T_middle = Temperature; + + R_idealgas = P_middle / (rho_average * T_middle); + Cv_idealgas = e_average / T_middle; + Cp_idealgas = Enthalpy / T_middle; + gamma_idealgas = (R_idealgas / Cv_idealgas) + 1; +} \ No newline at end of file diff --git a/SU2_CFD/src/fluid/CFluidFlamelet.cpp b/SU2_CFD/src/fluid/CFluidFlamelet.cpp new file mode 100644 index 00000000000..0dbdee37c5e --- /dev/null +++ b/SU2_CFD/src/fluid/CFluidFlamelet.cpp @@ -0,0 +1,256 @@ +/*! + * \file CfluidFlamelet.cpp + * \brief Main subroutines of CFluidFlamelet class + * \author D. Mayer, T. Economon, N. Beishuizen, E. Bunschoten + * \version 8.0.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../include/fluid/CFluidFlamelet.hpp" +#include "../../../Common/include/containers/CLookUpTable.hpp" +#if defined(HAVE_MLPCPP) +#include "../../../subprojects/MLPCpp/include/CLookUp_ANN.hpp" +#define USE_MLPCPP +#endif + +CFluidFlamelet::CFluidFlamelet(CConfig* config, su2double value_pressure_operating) : CFluidModel() { + rank = SU2_MPI::GetRank(); + Kind_DataDriven_Method = config->GetKind_DataDriven_Method(); + + /* -- number of auxiliary species transport equations, e.g. 1=CO, 2=NOx --- */ + n_user_scalars = config->GetNUserScalars(); + n_control_vars = config->GetNControlVars(); + include_mixture_fraction = (n_control_vars == 3); + n_scalars = config->GetNScalars(); + + if (rank == MASTER_NODE) { + cout << "Number of scalars: " << n_scalars << endl; + cout << "Number of user scalars: " << n_user_scalars << endl; + cout << "Number of control variables: " << n_control_vars << endl; + } + + scalars_vector.resize(n_scalars); + + table_scalar_names.resize(n_scalars); + for (auto iCV = 0u; iCV < n_control_vars; iCV++) table_scalar_names[iCV] = config->GetControllingVariableName(iCV); + + /*--- auxiliary species transport equations---*/ + for (size_t i_aux = 0; i_aux < n_user_scalars; i_aux++) { + table_scalar_names[n_control_vars + i_aux] = config->GetUserScalarName(i_aux); + } + + controlling_variable_names.resize(n_control_vars); + for (auto iCV = 0u; iCV < n_control_vars; iCV++) + controlling_variable_names[iCV] = config->GetControllingVariableName(iCV); + + passive_specie_names.resize(n_user_scalars); + for (auto i_aux = 0u; i_aux < n_user_scalars; i_aux++) passive_specie_names[i_aux] = config->GetUserScalarName(i_aux); + + switch (Kind_DataDriven_Method) { + case ENUM_DATADRIVEN_METHOD::LUT: + if (rank == MASTER_NODE) { + cout << "*****************************************" << endl; + cout << "*** initializing the lookup table ***" << endl; + cout << "*****************************************" << endl; + } + look_up_table = new CLookUpTable(config->GetDataDriven_FileNames()[0], table_scalar_names[I_PROGVAR], + table_scalar_names[I_ENTH]); + break; + default: + if (rank == MASTER_NODE) { + cout << "***********************************************" << endl; + cout << "*** initializing the multi-layer perceptron ***" << endl; + cout << "***********************************************" << endl; + } +#ifdef USE_MLPCPP + lookup_mlp = new MLPToolbox::CLookUp_ANN(config->GetNDataDriven_Files(), config->GetDataDriven_FileNames()); + if ((rank == MASTER_NODE)) lookup_mlp->DisplayNetworkInfo(); +#else + SU2_MPI::Error("SU2 was not compiled with MLPCpp enabled (-Denable-mlpcpp=true).", CURRENT_FUNCTION); +#endif + break; + } + + Pressure = value_pressure_operating; + + PreprocessLookUp(config); +} + +CFluidFlamelet::~CFluidFlamelet() { + switch (Kind_DataDriven_Method) { + case ENUM_DATADRIVEN_METHOD::LUT: + delete look_up_table; + break; + case ENUM_DATADRIVEN_METHOD::MLP: +#ifdef USE_MLPCPP + delete iomap_TD; + delete iomap_Sources; + delete iomap_LookUp; + delete lookup_mlp; +#endif + break; + default: + break; + } +} + +void CFluidFlamelet::SetTDState_T(su2double val_temperature, const su2double* val_scalars) { + for (auto iVar = 0u; iVar < n_scalars; iVar++) scalars_vector[iVar] = val_scalars[iVar]; + + /*--- Add all quantities and their names to the look up vectors. ---*/ + EvaluateDataSet(scalars_vector, FLAMELET_LOOKUP_OPS::TD, val_vars_TD); + + Temperature = val_vars_TD[LOOKUP_TD::TEMPERATURE]; + Cp = val_vars_TD[LOOKUP_TD::HEATCAPACITY]; + Mu = val_vars_TD[LOOKUP_TD::VISCOSITY]; + Kt = val_vars_TD[LOOKUP_TD::CONDUCTIVITY]; + mass_diffusivity = val_vars_TD[LOOKUP_TD::DIFFUSIONCOEFFICIENT]; + switch (density_model) { + case INC_DENSITYMODEL::FLAMELET: + Density = val_vars_TD[LOOKUP_TD::MOLARWEIGHT]; + molar_weight = Pressure / (Density * UNIVERSAL_GAS_CONSTANT * Temperature); + break; + case INC_DENSITYMODEL::VARIABLE: + molar_weight = val_vars_TD[LOOKUP_TD::MOLARWEIGHT]; + Density = (molar_weight / 1000) * Pressure / (UNIVERSAL_GAS_CONSTANT * Temperature); + break; + default: + break; + } + /*--- Compute Cv from Cp and molar weight of the mixture (ideal gas). ---*/ + Cv = Cp - UNIVERSAL_GAS_CONSTANT / molar_weight; +} + +void CFluidFlamelet::PreprocessLookUp(CConfig* config) { + density_model = config->GetKind_DensityModel(); + /*--- Thermodynamic state variables and names. ---*/ + varnames_TD.resize(LOOKUP_TD::SIZE); + val_vars_TD.resize(LOOKUP_TD::SIZE); + + /*--- The string in varnames_TD as it appears in the LUT file. ---*/ + varnames_TD[LOOKUP_TD::TEMPERATURE] = "Temperature"; + varnames_TD[LOOKUP_TD::HEATCAPACITY] = "Cp"; + varnames_TD[LOOKUP_TD::VISCOSITY] = "ViscosityDyn"; + varnames_TD[LOOKUP_TD::CONDUCTIVITY] = "Conductivity"; + varnames_TD[LOOKUP_TD::DIFFUSIONCOEFFICIENT] = "DiffusionCoefficient"; + + /*--- In case of FLAMELET density model, the density is directly interpolated from the manifold.---*/ + switch (density_model) { + case INC_DENSITYMODEL::FLAMELET: + varnames_TD[LOOKUP_TD::MOLARWEIGHT] = "Density"; + break; + case INC_DENSITYMODEL::VARIABLE: + varnames_TD[LOOKUP_TD::MOLARWEIGHT] = "MolarWeightMix"; + break; + default: + break; + } + /*--- Scalar source term variables and names. ---*/ + size_t n_sources = n_control_vars + 2 * n_user_scalars; + varnames_Sources.resize(n_sources); + val_vars_Sources.resize(n_sources); + for (auto iCV = 0u; iCV < n_control_vars; iCV++) + varnames_Sources[iCV] = config->GetControllingVariableSourceName(iCV); + /*--- No source term for enthalpy ---*/ + + /*--- For the auxiliary equations, we use a positive (production) and a negative (consumption) term: + S_tot = S_PROD + S_CONS * Y ---*/ + + for (size_t i_aux = 0; i_aux < n_user_scalars; i_aux++) { + /*--- Order of the source terms: S_prod_1, S_cons_1, S_prod_2, S_cons_2, ...---*/ + varnames_Sources[n_control_vars + 2 * i_aux] = config->GetUserSourceName(2 * i_aux); + varnames_Sources[n_control_vars + 2 * i_aux + 1] = config->GetUserSourceName(2 * i_aux + 1); + } + + /*--- Passive look-up terms ---*/ + size_t n_lookups = config->GetNLookups(); + varnames_LookUp.resize(n_lookups); + val_vars_LookUp.resize(n_lookups); + for (auto iLookup = 0u; iLookup < n_lookups; iLookup++) varnames_LookUp[iLookup] = config->GetLookupName(iLookup); + + if (Kind_DataDriven_Method == ENUM_DATADRIVEN_METHOD::MLP) { +#ifdef USE_MLPCPP + iomap_TD = new MLPToolbox::CIOMap(controlling_variable_names, varnames_TD); + iomap_Sources = new MLPToolbox::CIOMap(controlling_variable_names, varnames_Sources); + iomap_LookUp = new MLPToolbox::CIOMap(controlling_variable_names, varnames_LookUp); + lookup_mlp->PairVariableswithMLPs(*iomap_TD); + lookup_mlp->PairVariableswithMLPs(*iomap_Sources); + lookup_mlp->PairVariableswithMLPs(*iomap_LookUp); +#endif + } +} + +unsigned long CFluidFlamelet::EvaluateDataSet(const vector& input_scalar, unsigned short lookup_type, + vector& output_refs) { + su2double val_enth = input_scalar[I_ENTH]; + su2double val_prog = input_scalar[I_PROGVAR]; + su2double val_mixfrac = include_mixture_fraction ? input_scalar[I_MIXFRAC] : 0.0; + vector varnames; + vector val_vars; + vector refs_vars; + switch (lookup_type) { + case FLAMELET_LOOKUP_OPS::TD: + varnames = varnames_TD; +#ifdef USE_MLPCPP + iomap_Current = iomap_TD; +#endif + break; + case FLAMELET_LOOKUP_OPS::SOURCES: + varnames = varnames_Sources; +#ifdef USE_MLPCPP + iomap_Current = iomap_Sources; +#endif + break; + case FLAMELET_LOOKUP_OPS::LOOKUP: + varnames = varnames_LookUp; +#ifdef USE_MLPCPP + iomap_Current = iomap_LookUp; +#endif + break; + default: + break; + } + if (output_refs.size() != varnames.size()) + SU2_MPI::Error(string("Output vector size incompatible with manifold lookup operation."), CURRENT_FUNCTION); + + /*--- Add all quantities and their names to the look up vectors. ---*/ + switch (Kind_DataDriven_Method) { + case ENUM_DATADRIVEN_METHOD::LUT: + if (include_mixture_fraction) { + extrapolation = look_up_table->LookUp_XYZ(varnames, output_refs, val_prog, val_enth, val_mixfrac); + } else { + extrapolation = look_up_table->LookUp_XY(varnames, output_refs, val_prog, val_enth); + } + break; + case ENUM_DATADRIVEN_METHOD::MLP: + refs_vars.resize(output_refs.size()); + for (auto iVar = 0u; iVar < output_refs.size(); iVar++) refs_vars[iVar] = &output_refs[iVar]; +#ifdef USE_MLPCPP + extrapolation = lookup_mlp->PredictANN(iomap_Current, input_scalar, refs_vars); +#endif + break; + default: + break; + } + + return extrapolation; +} diff --git a/SU2_CFD/src/fluid/CFluidModel.cpp b/SU2_CFD/src/fluid/CFluidModel.cpp index 15ab39b24e2..4c199cb117a 100644 --- a/SU2_CFD/src/fluid/CFluidModel.cpp +++ b/SU2_CFD/src/fluid/CFluidModel.cpp @@ -2,7 +2,7 @@ * \file CFluidModel.cpp * \brief Source of the fluid model base class containing thermo-physical subroutines. * \author S.Vitale, M.Pini, G.Gori, A.Guardone, P.Colonna, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -41,6 +41,7 @@ #include "../../include/fluid/CPolynomialConductivityRANS.hpp" #include "../../include/fluid/CPolynomialViscosity.hpp" #include "../../include/fluid/CSutherland.hpp" +#include "../../include/fluid/CFluidFlamelet.hpp" #include "../../include/fluid/CCoolPropViscosity.hpp" #include "../../include/fluid/CConstantLewisDiffusivity.hpp" #include "../../include/fluid/CCoolPropConductivity.hpp" @@ -58,6 +59,9 @@ unique_ptr CFluidModel::MakeLaminarViscosityModel(const CConfig case VISCOSITYMODEL::POLYNOMIAL: return unique_ptr>( new CPolynomialViscosity(config->GetMu_PolyCoeffND())); + case VISCOSITYMODEL::FLAMELET: + /*--- Viscosity is obtained from the LUT ---*/ + return nullptr; default: SU2_MPI::Error("Viscosity model not available.", CURRENT_FUNCTION); return nullptr; @@ -108,10 +112,12 @@ unique_ptr CFluidModel::MakeThermalConductivityModel(const C new CPolynomialConductivity(config->GetKt_PolyCoeffND())); } break; + case CONDUCTIVITYMODEL::FLAMELET: + /*--- Conductivity is obtained from the LUT ---*/ + return nullptr; default: SU2_MPI::Error("Conductivity model not available.", CURRENT_FUNCTION); return nullptr; - break; } } @@ -134,6 +140,10 @@ unique_ptr CFluidModel::MakeMassDiffusivityModel(const CConfi return unique_ptr( new CConstantLewisDiffusivity(config->GetConstant_Lewis_Number(iSpecies))); break; + case DIFFUSIVITYMODEL::FLAMELET: + /*--- Diffusivity is obtained from the LUT ---*/ + return nullptr; + break; default: SU2_MPI::Error("Diffusivity model not available.", CURRENT_FUNCTION); return nullptr; diff --git a/SU2_CFD/src/fluid/CFluidScalar.cpp b/SU2_CFD/src/fluid/CFluidScalar.cpp index 1d0700cea35..8171e2a515e 100644 --- a/SU2_CFD/src/fluid/CFluidScalar.cpp +++ b/SU2_CFD/src/fluid/CFluidScalar.cpp @@ -2,7 +2,7 @@ * \file CFluidScalar.cpp * \brief Defines the multicomponent incompressible Ideal Gas model for mixtures. * \author T. Economon, Mark Heimgartner, Cristopher Morales Ubal - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,9 +27,8 @@ #include "../../include/fluid/CFluidScalar.hpp" -#include - #include + #include #include "../../include/fluid/CConstantConductivity.hpp" @@ -50,6 +49,7 @@ CFluidScalar::CFluidScalar(su2double val_Cp, su2double val_gas_constant, su2doub Gamma(config->GetGamma()), Pressure_Thermodynamic(value_pressure_operating), GasConstant_Ref(config->GetGas_Constant_Ref()), + Prandtl_Number(config->GetPrandtl_Turb()), wilke(config->GetKind_MixingViscosityModel() == MIXINGVISCOSITYMODEL::WILKE), davidson(config->GetKind_MixingViscosityModel() == MIXINGVISCOSITYMODEL::DAVIDSON) { if (n_species_mixture > ARRAYSIZE) { @@ -63,6 +63,7 @@ CFluidScalar::CFluidScalar(su2double val_Cp, su2double val_gas_constant, su2doub SetLaminarViscosityModel(config); SetThermalConductivityModel(config); + SetMassDiffusivityModel(config); } void CFluidScalar::SetLaminarViscosityModel(const CConfig* config) { @@ -83,9 +84,11 @@ void CFluidScalar::SetMassDiffusivityModel(const CConfig* config) { } } -su2double CFluidScalar::GetMassDiffusivity(int iVar) { - MassDiffusivityPointers[iVar]->SetDiffusivity(Temperature, Density, Mu, Mu_Turb, Cp, Kt); - return MassDiffusivityPointers[iVar]->GetDiffusivity(); +void CFluidScalar::ComputeMassDiffusivity() { + for (int iVar = 0; iVar < n_species_mixture; iVar++) { + MassDiffusivityPointers[iVar]->SetDiffusivity(Density, Mu, Cp, Kt); + massDiffusivity[iVar] = MassDiffusivityPointers[iVar]->GetDiffusivity(); + } } void CFluidScalar::MassToMoleFractions(const su2double* val_scalars) { @@ -168,7 +171,7 @@ su2double CFluidScalar::DavidsonViscosity(const su2double* val_scalars) { su2double CFluidScalar::WilkeConductivity(const su2double* val_scalars) { for (int iVar = 0; iVar < n_species_mixture; iVar++) { - ThermalConductivityPointers[iVar]->SetConductivity(Temperature, Density, Mu, Mu_Turb, Cp, 0.0, 0.0); + ThermalConductivityPointers[iVar]->SetConductivity(Temperature, Density, Mu, 0.0, 0.0, 0.0, 0.0); laminarThermalConductivity[iVar] = ThermalConductivityPointers[iVar]->GetConductivity(); } @@ -227,4 +230,5 @@ void CFluidScalar::SetTDState_T(const su2double val_temperature, const su2double } Kt = WilkeConductivity(val_scalars); + ComputeMassDiffusivity(); } diff --git a/SU2_CFD/src/fluid/CIdealGas.cpp b/SU2_CFD/src/fluid/CIdealGas.cpp index 2afc1b36e69..433fc059a78 100644 --- a/SU2_CFD/src/fluid/CIdealGas.cpp +++ b/SU2_CFD/src/fluid/CIdealGas.cpp @@ -2,7 +2,7 @@ * \file CIdealGas.cpp * \brief Source of the ideal gas model. * \author S. Vitale, G. Gori, M. Pini, A. Guardone, P. Colonna - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/fluid/CMutationTCLib.cpp b/SU2_CFD/src/fluid/CMutationTCLib.cpp index e0ad74b04d1..58629d9f327 100644 --- a/SU2_CFD/src/fluid/CMutationTCLib.cpp +++ b/SU2_CFD/src/fluid/CMutationTCLib.cpp @@ -2,7 +2,7 @@ * \file CMutationTCLib.cpp * \brief Source of the Mutation++ 2T nonequilibrium gas model. * \author C. Garbacz - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -58,43 +58,38 @@ CMutationTCLib::CMutationTCLib(const CConfig* config, unsigned short val_nDim): /* Initialize mixture object */ mix.reset(new Mutation::Mixture(opt)); - for(iSpecies = 0; iSpecies < nSpecies; iSpecies++) MolarMass[iSpecies] = 1000* mix->speciesMw(iSpecies); // x1000 to have Molar Mass in kg/kmol + // x1000 to have Molar Mass in kg/kmol + for(iSpecies = 0; iSpecies < nSpecies; iSpecies++) + MolarMass[iSpecies] = 1000* mix->speciesMw(iSpecies); - if (mix->hasElectrons()) { - if (config->GetViscous()) { - SU2_MPI::Error("Ionization is not yet operational for a viscous flow in the NEMO solver.", CURRENT_FUNCTION); - } else { - nHeavy = nSpecies-1; - nEl = 1; - } - } - else { nHeavy = nSpecies; nEl = 0; } + if (mix->hasElectrons()) { nHeavy = nSpecies-1; nEl = 1; } + else { nHeavy = nSpecies; nEl = 0; } /*--- Set up catalytic recombination table. ---*/ // Creation/Destruction (+1/-1), Index of monoatomic reactants - // Monoatomic species (N,O) recombine into diaatomic (N2, O2) + // Monoatomic species (N,O) recombine into diaatomic (N2, O2) species if (gas_model == "N2") { - CatRecombTable(0,0) = 1; CatRecombTable(0,1) = 1; - CatRecombTable(1,0) = -1; CatRecombTable(1,1) = 1; + CatRecombTable(0,0) = 1; CatRecombTable(0,1) = 1; // N2 + CatRecombTable(1,0) = -1; CatRecombTable(1,1) = 1; // N } else if (gas_model == "air_5"){ - CatRecombTable(0,0) = -1; CatRecombTable(0,1) = 0; - CatRecombTable(1,0) = -1; CatRecombTable(1,1) = 1; - CatRecombTable(2,0) = 0; CatRecombTable(2,1) = 4; - CatRecombTable(3,0) = 1; CatRecombTable(3,1) = 0; - CatRecombTable(4,0) = 1; CatRecombTable(4,1) = 1; + CatRecombTable(0,0) = -1; CatRecombTable(0,1) = 0; // N + CatRecombTable(1,0) = -1; CatRecombTable(1,1) = 1; // O + CatRecombTable(2,0) = 0; CatRecombTable(2,1) = 4; // NO + CatRecombTable(3,0) = 1; CatRecombTable(3,1) = 0; // N2 + CatRecombTable(4,0) = 1; CatRecombTable(4,1) = 1; // O2 } else if (gas_model == "air_6") { - CatRecombTable(0,0) = -1; CatRecombTable(0,1) = 0; - CatRecombTable(1,0) = -1; CatRecombTable(1,1) = 1; - CatRecombTable(2,0) = 0; CatRecombTable(2,1) = 4; - CatRecombTable(3,0) = 1; CatRecombTable(3,1) = 0; - CatRecombTable(4,0) = 1; CatRecombTable(4,1) = 1; - CatRecombTable(5,0) = 0; CatRecombTable(5,1) = 4; + CatRecombTable(0,0) = -1; CatRecombTable(0,1) = 0; // N + CatRecombTable(1,0) = -1; CatRecombTable(1,1) = 1; // O + CatRecombTable(2,0) = 0; CatRecombTable(2,1) = 4; // NO + CatRecombTable(3,0) = 1; CatRecombTable(3,1) = 0; // N2 + CatRecombTable(4,0) = 1; CatRecombTable(4,1) = 1; // O2 + CatRecombTable(5,0) = 0; CatRecombTable(5,1) = 4; // Ar } else { if (config->GetCatalytic()) - SU2_MPI::Error("Cataylic wall recombination not implemented for specified Mutation gas model.", CURRENT_FUNCTION); + SU2_MPI::Error("Catalytic wall recombination not implemented for specified Mutation gas model.", CURRENT_FUNCTION); } } diff --git a/SU2_CFD/src/fluid/CNEMOGas.cpp b/SU2_CFD/src/fluid/CNEMOGas.cpp index 55319a34add..929a09dc63c 100644 --- a/SU2_CFD/src/fluid/CNEMOGas.cpp +++ b/SU2_CFD/src/fluid/CNEMOGas.cpp @@ -2,7 +2,7 @@ * \file CNEMOGas.cpp * \brief Source of the nonequilibrium gas model. * \author C. Garbacz, W. Maier, S. R. Copeland - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -157,7 +157,7 @@ void CNEMOGas::ComputedPdU(const su2double *V, const vector& val_eves // Note: Electron energy not included properly. - if (val_dPdU == NULL) { + if (val_dPdU == nullptr) { SU2_MPI::Error("Array dPdU not allocated!", CURRENT_FUNCTION); } diff --git a/SU2_CFD/src/fluid/CPengRobinson.cpp b/SU2_CFD/src/fluid/CPengRobinson.cpp index 445854b55cb..4b93a28da70 100644 --- a/SU2_CFD/src/fluid/CPengRobinson.cpp +++ b/SU2_CFD/src/fluid/CPengRobinson.cpp @@ -2,7 +2,7 @@ * \file CPengRobinson.cpp * \brief Source of the Peng-Robinson model. * \author S. Vitale, G. Gori, M. Pini, A. Guardone, P. Colonna - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/fluid/CSU2TCLib.cpp b/SU2_CFD/src/fluid/CSU2TCLib.cpp index 7a1b81aaabf..40b39a449f7 100644 --- a/SU2_CFD/src/fluid/CSU2TCLib.cpp +++ b/SU2_CFD/src/fluid/CSU2TCLib.cpp @@ -1,8 +1,8 @@ /*! * \file CSU2TCLib.cpp * \brief Source of user defined 2T nonequilibrium gas model. - * \author C. Garbacz, W. Maier, S. R. Copeland - * \version 7.5.1 "Blackbird" + * \author C. Garbacz, W. Maier, S. R. Copeland, J. Needels + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -44,8 +44,8 @@ CSU2TCLib::CSU2TCLib(const CConfig* config, unsigned short val_nDim, bool viscou RotationModes.resize(nSpecies,0.0); Diss.resize(nSpecies,0.0); A.resize(5,0.0); - Omega00.resize(nSpecies,nSpecies,4,0.0); Omega11.resize(nSpecies,nSpecies,4,0.0); + Omega22.resize(nSpecies,nSpecies,4,0.0); RxnConstantTable.resize(6,5) = su2double(0.0); CatRecombTable.resize(nSpecies,2) = 0; Blottner.resize(nSpecies,3) = su2double(0.0); @@ -111,7 +111,7 @@ CSU2TCLib::CSU2TCLib(const CConfig* config, unsigned short val_nDim, bool viscou ElDegeneracy(0,5) = 5; ElDegeneracy(0,6) = 15; - /*--- Catayltic wall table---*/ + /*--- Catalytic wall table ---*/ // Creation/Destruction (+1/-1), Index of monoatomic reactants. // Argon not used. CatRecombTable(0,0) = 0; CatRecombTable(0,1) = 0; @@ -254,20 +254,25 @@ CSU2TCLib::CSU2TCLib(const CConfig* config, unsigned short val_nDim, bool viscou // Others: a = 1, b = 0 Tcf_a[0] = 0.5; Tcf_b[0] = 0.5; Tcb_a[0] = 1; Tcb_b[0] = 0; Tcf_a[1] = 0.5; Tcf_b[1] = 0.5; Tcb_a[1] = 1; Tcb_b[1] = 0; + /*--- Dissociation potential [KJ/kg] ---*/ Diss[0] = 3.36E4; Diss[1] = 0.0; + /*--- Collision integral data ---*/ - Omega00(0,0,0) = -6.0614558E-03; Omega00(0,0,1) = 1.2689102E-01; Omega00(0,0,2) = -1.0616948E+00; Omega00(0,0,3) = 8.0955466E+02; - Omega00(0,1,0) = -1.0796249E-02; Omega00(0,1,1) = 2.2656509E-01; Omega00(0,1,2) = -1.7910602E+00; Omega00(0,1,3) = 4.0455218E+03; - Omega00(1,0,0) = -1.0796249E-02; Omega00(1,0,1) = 2.2656509E-01; Omega00(1,0,2) = -1.7910602E+00; Omega00(1,0,3) = 4.0455218E+03; - Omega00(1,1,0) = -9.6083779E-03; Omega00(1,1,1) = 2.0938971E-01; Omega00(1,1,2) = -1.7386904E+00; Omega00(1,1,3) = 3.3587983E+03; - Omega11(0,0,0) = -7.6303990E-03; Omega11(0,0,1) = 1.6878089E-01; Omega11(0,0,2) = -1.4004234E+00; Omega11(0,0,3) = 2.1427708E+03; - Omega11(0,1,0) = -8.3493693E-03; Omega11(0,1,1) = 1.7808911E-01; Omega11(0,1,2) = -1.4466155E+00; Omega11(0,1,3) = 1.9324210E+03; - Omega11(1,0,0) = -8.3493693E-03; Omega11(1,0,1) = 1.7808911E-01; Omega11(1,0,2) = -1.4466155E+00; Omega11(1,0,3) = 1.9324210E+03; - Omega11(1,1,0) = -7.7439615E-03; Omega11(1,1,1) = 1.7129007E-01; Omega11(1,1,2) = -1.4809088E+00; Omega11(1,1,3) = 2.1284951E+03; - - /*--- Catayltic wall table---*/ + // Index 1: collider + // Index 2: partner + // Index 3: A1, A2, A3 + Omega11(0,0,0) = -6.0614558E-03; Omega11(0,0,1) = 1.2689102E-01; Omega11(0,0,2) = -1.0616948E+00; Omega11(0,0,3) = 8.0955466E+02; + Omega11(0,1,0) = -1.0796249E-02; Omega11(0,1,1) = 2.2656509E-01; Omega11(0,1,2) = -1.7910602E+00; Omega11(0,1,3) = 4.0455218E+03; + Omega11(1,0,0) = -1.0796249E-02; Omega11(1,0,1) = 2.2656509E-01; Omega11(1,0,2) = -1.7910602E+00; Omega11(1,0,3) = 4.0455218E+03; + Omega11(1,1,0) = -9.6083779E-03; Omega11(1,1,1) = 2.0938971E-01; Omega11(1,1,2) = -1.7386904E+00; Omega11(1,1,3) = 3.3587983E+03; + Omega22(0,0,0) = -7.6303990E-03; Omega22(0,0,1) = 1.6878089E-01; Omega22(0,0,2) = -1.4004234E+00; Omega22(0,0,3) = 2.1427708E+03; + Omega22(0,1,0) = -8.3493693E-03; Omega22(0,1,1) = 1.7808911E-01; Omega22(0,1,2) = -1.4466155E+00; Omega22(0,1,3) = 1.9324210E+03; + Omega22(1,0,0) = -8.3493693E-03; Omega22(1,0,1) = 1.7808911E-01; Omega22(1,0,2) = -1.4466155E+00; Omega22(1,0,3) = 1.9324210E+03; + Omega22(1,1,0) = -7.7439615E-03; Omega22(1,1,1) = 1.7129007E-01; Omega22(1,1,2) = -1.4809088E+00; Omega22(1,1,3) = 2.1284951E+03; + + /*--- Catalytic wall table ---*/ // Creation/Destruction (+1/-1), Index of monoatomic reactants. // Monoatomic species (N,O) recombine into diaatomic (N2, O2) CatRecombTable(0,0) = 1; CatRecombTable(0,1) = 1; @@ -564,69 +569,72 @@ CSU2TCLib::CSU2TCLib(const CConfig* config, unsigned short val_nDim, bool viscou Tcf_a[15] = 1.0; Tcf_b[15] = 0.0; Tcb_a[15] = 1; Tcb_b[15] = 0; Tcf_a[16] = 1.0; Tcf_b[16] = 0.0; Tcb_a[16] = 1; Tcb_b[16] = 0; /*--- Collision integral data ---*/ - // Omega(0,0) ---------------------- + // Index 1: collider + // Index 2: partner + // Index 3: A1, A2, A3 + // Omega^(1,1) ---------------------- //N2 - Omega00(0,0,0) = -6.0614558E-03; Omega00(0,0,1) = 1.2689102E-01; Omega00(0,0,2) = -1.0616948E+00; Omega00(0,0,3) = 8.0955466E+02; - Omega00(0,1,0) = -3.7959091E-03; Omega00(0,1,1) = 9.5708295E-02; Omega00(0,1,2) = -1.0070611E+00; Omega00(0,1,3) = 8.9392313E+02; - Omega00(0,2,0) = -1.9295666E-03; Omega00(0,2,1) = 2.7995735E-02; Omega00(0,2,2) = -3.1588514E-01; Omega00(0,2,3) = 1.2880734E+02; - Omega00(0,3,0) = -1.0796249E-02; Omega00(0,3,1) = 2.2656509E-01; Omega00(0,3,2) = -1.7910602E+00; Omega00(0,3,3) = 4.0455218E+03; - Omega00(0,4,0) = -2.7244269E-03; Omega00(0,4,1) = 6.9587171E-02; Omega00(0,4,2) = -7.9538667E-01; Omega00(0,4,3) = 4.0673730E+02; + Omega11(0,0,0) = -6.0614558E-03; Omega11(0,0,1) = 1.2689102E-01; Omega11(0,0,2) = -1.0616948E+00; Omega11(0,0,3) = 8.0955466E+02; + Omega11(0,1,0) = -3.7959091E-03; Omega11(0,1,1) = 9.5708295E-02; Omega11(0,1,2) = -1.0070611E+00; Omega11(0,1,3) = 8.9392313E+02; + Omega11(0,2,0) = -1.9295666E-03; Omega11(0,2,1) = 2.7995735E-02; Omega11(0,2,2) = -3.1588514E-01; Omega11(0,2,3) = 1.2880734E+02; + Omega11(0,3,0) = -1.0796249E-02; Omega11(0,3,1) = 2.2656509E-01; Omega11(0,3,2) = -1.7910602E+00; Omega11(0,3,3) = 4.0455218E+03; + Omega11(0,4,0) = -2.7244269E-03; Omega11(0,4,1) = 6.9587171E-02; Omega11(0,4,2) = -7.9538667E-01; Omega11(0,4,3) = 4.0673730E+02; //O2 - Omega00(1,0,0) = -3.7959091E-03; Omega00(1,0,1) = 9.5708295E-02; Omega00(1,0,2) = -1.0070611E+00; Omega00(1,0,3) = 8.9392313E+02; - Omega00(1,1,0) = -8.0682650E-04; Omega00(1,1,1) = 1.6602480E-02; Omega00(1,1,2) = -3.1472774E-01; Omega00(1,1,3) = 1.4116458E+02; - Omega00(1,2,0) = -6.4433840E-04; Omega00(1,2,1) = 8.5378580E-03; Omega00(1,2,2) = -2.3225102E-01; Omega00(1,2,3) = 1.1371608E+02; - Omega00(1,3,0) = -1.1453028E-03; Omega00(1,3,1) = 1.2654140E-02; Omega00(1,3,2) = -2.2435218E-01; Omega00(1,3,3) = 7.7201588E+01; - Omega00(1,4,0) = -4.8405803E-03; Omega00(1,4,1) = 1.0297688E-01; Omega00(1,4,2) = -9.6876576E-01; Omega00(1,4,3) = 6.1629812E+02; + Omega11(1,0,0) = -3.7959091E-03; Omega11(1,0,1) = 9.5708295E-02; Omega11(1,0,2) = -1.0070611E+00; Omega11(1,0,3) = 8.9392313E+02; + Omega11(1,1,0) = -8.0682650E-04; Omega11(1,1,1) = 1.6602480E-02; Omega11(1,1,2) = -3.1472774E-01; Omega11(1,1,3) = 1.4116458E+02; + Omega11(1,2,0) = -6.4433840E-04; Omega11(1,2,1) = 8.5378580E-03; Omega11(1,2,2) = -2.3225102E-01; Omega11(1,2,3) = 1.1371608E+02; + Omega11(1,3,0) = -1.1453028E-03; Omega11(1,3,1) = 1.2654140E-02; Omega11(1,3,2) = -2.2435218E-01; Omega11(1,3,3) = 7.7201588E+01; + Omega11(1,4,0) = -4.8405803E-03; Omega11(1,4,1) = 1.0297688E-01; Omega11(1,4,2) = -9.6876576E-01; Omega11(1,4,3) = 6.1629812E+02; //NO - Omega00(2,0,0) = -1.9295666E-03; Omega00(2,0,1) = 2.7995735E-02; Omega00(2,0,2) = -3.1588514E-01; Omega00(2,0,3) = 1.2880734E+02; - Omega00(2,1,0) = -6.4433840E-04; Omega00(2,1,1) = 8.5378580E-03; Omega00(2,1,2) = -2.3225102E-01; Omega00(2,1,3) = 1.1371608E+02; - Omega00(2,2,0) = -0.0000000E+00; Omega00(2,2,1) = -1.1056066E-02; Omega00(2,2,2) = -5.9216250E-02; Omega00(2,2,3) = 7.2542367E+01; - Omega00(2,3,0) = -1.5770918E-03; Omega00(2,3,1) = 1.9578381E-02; Omega00(2,3,2) = -2.7873624E-01; Omega00(2,3,3) = 9.9547944E+01; - Omega00(2,4,0) = -1.0885815E-03; Omega00(2,4,1) = 1.1883688E-02; Omega00(2,4,2) = -2.1844909E-01; Omega00(2,4,3) = 7.5512560E+01; + Omega11(2,0,0) = -1.9295666E-03; Omega11(2,0,1) = 2.7995735E-02; Omega11(2,0,2) = -3.1588514E-01; Omega11(2,0,3) = 1.2880734E+02; + Omega11(2,1,0) = -6.4433840E-04; Omega11(2,1,1) = 8.5378580E-03; Omega11(2,1,2) = -2.3225102E-01; Omega11(2,1,3) = 1.1371608E+02; + Omega11(2,2,0) = -0.0000000E+00; Omega11(2,2,1) = -1.1056066E-02; Omega11(2,2,2) = -5.9216250E-02; Omega11(2,2,3) = 7.2542367E+01; + Omega11(2,3,0) = -1.5770918E-03; Omega11(2,3,1) = 1.9578381E-02; Omega11(2,3,2) = -2.7873624E-01; Omega11(2,3,3) = 9.9547944E+01; + Omega11(2,4,0) = -1.0885815E-03; Omega11(2,4,1) = 1.1883688E-02; Omega11(2,4,2) = -2.1844909E-01; Omega11(2,4,3) = 7.5512560E+01; //N - Omega00(3,0,0) = -1.0796249E-02; Omega00(3,0,1) = 2.2656509E-01; Omega00(3,0,2) = -1.7910602E+00; Omega00(3,0,3) = 4.0455218E+03; - Omega00(3,1,0) = -1.1453028E-03; Omega00(3,1,1) = 1.2654140E-02; Omega00(3,1,2) = -2.2435218E-01; Omega00(3,1,3) = 7.7201588E+01; - Omega00(3,2,0) = -1.5770918E-03; Omega00(3,2,1) = 1.9578381E-02; Omega00(3,2,2) = -2.7873624E-01; Omega00(3,2,3) = 9.9547944E+01; - Omega00(3,3,0) = -9.6083779E-03; Omega00(3,3,1) = 2.0938971E-01; Omega00(3,3,2) = -1.7386904E+00; Omega00(3,3,3) = 3.3587983E+03; - Omega00(3,4,0) = -7.8147689E-03; Omega00(3,4,1) = 1.6792705E-01; Omega00(3,4,2) = -1.4308628E+00; Omega00(3,4,3) = 1.6628859E+03; + Omega11(3,0,0) = -1.0796249E-02; Omega11(3,0,1) = 2.2656509E-01; Omega11(3,0,2) = -1.7910602E+00; Omega11(3,0,3) = 4.0455218E+03; + Omega11(3,1,0) = -1.1453028E-03; Omega11(3,1,1) = 1.2654140E-02; Omega11(3,1,2) = -2.2435218E-01; Omega11(3,1,3) = 7.7201588E+01; + Omega11(3,2,0) = -1.5770918E-03; Omega11(3,2,1) = 1.9578381E-02; Omega11(3,2,2) = -2.7873624E-01; Omega11(3,2,3) = 9.9547944E+01; + Omega11(3,3,0) = -9.6083779E-03; Omega11(3,3,1) = 2.0938971E-01; Omega11(3,3,2) = -1.7386904E+00; Omega11(3,3,3) = 3.3587983E+03; + Omega11(3,4,0) = -7.8147689E-03; Omega11(3,4,1) = 1.6792705E-01; Omega11(3,4,2) = -1.4308628E+00; Omega11(3,4,3) = 1.6628859E+03; //O - Omega00(4,0,0) = -2.7244269E-03; Omega00(4,0,1) = 6.9587171E-02; Omega00(4,0,2) = -7.9538667E-01; Omega00(4,0,3) = 4.0673730E+02; - Omega00(4,1,0) = -4.8405803E-03; Omega00(4,1,1) = 1.0297688E-01; Omega00(4,1,2) = -9.6876576E-01; Omega00(4,1,3) = 6.1629812E+02; - Omega00(4,2,0) = -1.0885815E-03; Omega00(4,2,1) = 1.1883688E-02; Omega00(4,2,2) = -2.1844909E-01; Omega00(4,2,3) = 7.5512560E+01; - Omega00(4,3,0) = -7.8147689E-03; Omega00(4,3,1) = 1.6792705E-01; Omega00(4,3,2) = -1.4308628E+00; Omega00(4,3,3) = 1.6628859E+03; - Omega00(4,4,0) = -6.4040535E-03; Omega00(4,4,1) = 1.4629949E-01; Omega00(4,4,2) = -1.3892121E+00; Omega00(4,4,3) = 2.0903441E+03; - - // Omega(1,1) ---------------------- + Omega11(4,0,0) = -2.7244269E-03; Omega11(4,0,1) = 6.9587171E-02; Omega11(4,0,2) = -7.9538667E-01; Omega11(4,0,3) = 4.0673730E+02; + Omega11(4,1,0) = -4.8405803E-03; Omega11(4,1,1) = 1.0297688E-01; Omega11(4,1,2) = -9.6876576E-01; Omega11(4,1,3) = 6.1629812E+02; + Omega11(4,2,0) = -1.0885815E-03; Omega11(4,2,1) = 1.1883688E-02; Omega11(4,2,2) = -2.1844909E-01; Omega11(4,2,3) = 7.5512560E+01; + Omega11(4,3,0) = -7.8147689E-03; Omega11(4,3,1) = 1.6792705E-01; Omega11(4,3,2) = -1.4308628E+00; Omega11(4,3,3) = 1.6628859E+03; + Omega11(4,4,0) = -6.4040535E-03; Omega11(4,4,1) = 1.4629949E-01; Omega11(4,4,2) = -1.3892121E+00; Omega11(4,4,3) = 2.0903441E+03; + + // Omega^(2,2) ---------------------- //N2 - Omega11(0,0,0) = -7.6303990E-03; Omega11(0,0,1) = 1.6878089E-01; Omega11(0,0,2) = -1.4004234E+00; Omega11(0,0,3) = 2.1427708E+03; - Omega11(0,1,0) = -8.0457321E-03; Omega11(0,1,1) = 1.9228905E-01; Omega11(0,1,2) = -1.7102854E+00; Omega11(0,1,3) = 5.2213857E+03; - Omega11(0,2,0) = -6.8237776E-03; Omega11(0,2,1) = 1.4360616E-01; Omega11(0,2,2) = -1.1922240E+00; Omega11(0,2,3) = 1.2433086E+03; - Omega11(0,3,0) = -8.3493693E-03; Omega11(0,3,1) = 1.7808911E-01; Omega11(0,3,2) = -1.4466155E+00; Omega11(0,3,3) = 1.9324210E+03; - Omega11(0,4,0) = -8.3110691E-03; Omega11(0,4,1) = 1.9617877E-01; Omega11(0,4,2) = -1.7205427E+00; Omega11(0,4,3) = 4.0812829E+03; + Omega22(0,0,0) = -7.6303990E-03; Omega22(0,0,1) = 1.6878089E-01; Omega22(0,0,2) = -1.4004234E+00; Omega22(0,0,3) = 2.1427708E+03; + Omega22(0,1,0) = -8.0457321E-03; Omega22(0,1,1) = 1.9228905E-01; Omega22(0,1,2) = -1.7102854E+00; Omega22(0,1,3) = 5.2213857E+03; + Omega22(0,2,0) = -6.8237776E-03; Omega22(0,2,1) = 1.4360616E-01; Omega22(0,2,2) = -1.1922240E+00; Omega22(0,2,3) = 1.2433086E+03; + Omega22(0,3,0) = -8.3493693E-03; Omega22(0,3,1) = 1.7808911E-01; Omega22(0,3,2) = -1.4466155E+00; Omega22(0,3,3) = 1.9324210E+03; + Omega22(0,4,0) = -8.3110691E-03; Omega22(0,4,1) = 1.9617877E-01; Omega22(0,4,2) = -1.7205427E+00; Omega22(0,4,3) = 4.0812829E+03; //O2 - Omega11(1,0,0) = -8.0457321E-03; Omega11(1,0,1) = 1.9228905E-01; Omega11(1,0,2) = -1.7102854E+00; Omega11(1,0,3) = 5.2213857E+03; - Omega11(1,1,0) = -6.2931612E-03; Omega11(1,1,1) = 1.4624645E-01; Omega11(1,1,2) = -1.3006927E+00; Omega11(1,1,3) = 1.8066892E+03; - Omega11(1,2,0) = -6.8508672E-03; Omega11(1,2,1) = 1.5524564E-01; Omega11(1,2,2) = -1.3479583E+00; Omega11(1,2,3) = 2.0037890E+03; - Omega11(1,3,0) = -1.0608832E-03; Omega11(1,3,1) = 1.1782595E-02; Omega11(1,3,2) = -2.1246301E-01; Omega11(1,3,3) = 8.4561598E+01; - Omega11(1,4,0) = -3.7969686E-03; Omega11(1,4,1) = 7.6789981E-02; Omega11(1,4,2) = -7.3056809E-01; Omega11(1,4,3) = 3.3958171E+02; + Omega22(1,0,0) = -8.0457321E-03; Omega22(1,0,1) = 1.9228905E-01; Omega22(1,0,2) = -1.7102854E+00; Omega22(1,0,3) = 5.2213857E+03; + Omega22(1,1,0) = -6.2931612E-03; Omega22(1,1,1) = 1.4624645E-01; Omega22(1,1,2) = -1.3006927E+00; Omega22(1,1,3) = 1.8066892E+03; + Omega22(1,2,0) = -6.8508672E-03; Omega22(1,2,1) = 1.5524564E-01; Omega22(1,2,2) = -1.3479583E+00; Omega22(1,2,3) = 2.0037890E+03; + Omega22(1,3,0) = -1.0608832E-03; Omega22(1,3,1) = 1.1782595E-02; Omega22(1,3,2) = -2.1246301E-01; Omega22(1,3,3) = 8.4561598E+01; + Omega22(1,4,0) = -3.7969686E-03; Omega22(1,4,1) = 7.6789981E-02; Omega22(1,4,2) = -7.3056809E-01; Omega22(1,4,3) = 3.3958171E+02; //NO - Omega11(2,0,0) = -6.8237776E-03; Omega11(2,0,1) = 1.4360616E-01; Omega11(2,0,2) = -1.1922240E+00; Omega11(2,0,3) = 1.2433086E+03; - Omega11(2,1,0) = -6.8508672E-03; Omega11(2,1,1) = 1.5524564E-01; Omega11(2,1,2) = -1.3479583E+00; Omega11(2,1,3) = 2.0037890E+03; - Omega11(2,2,0) = -7.4942466E-03; Omega11(2,2,1) = 1.6626193E-01; Omega11(2,2,2) = -1.4107027E+00; Omega11(2,2,3) = 2.3097604E+03; - Omega11(2,3,0) = -1.4719259E-03; Omega11(2,3,1) = 1.8446968E-02; Omega11(2,3,2) = -2.6460411E-01; Omega11(2,3,3) = 1.0911124E+02; - Omega11(2,4,0) = -1.0066279E-03; Omega11(2,4,1) = 1.1029264E-02; Omega11(2,4,2) = -2.0671266E-01; Omega11(2,4,3) = 8.2644384E+01; + Omega22(2,0,0) = -6.8237776E-03; Omega22(2,0,1) = 1.4360616E-01; Omega22(2,0,2) = -1.1922240E+00; Omega22(2,0,3) = 1.2433086E+03; + Omega22(2,1,0) = -6.8508672E-03; Omega22(2,1,1) = 1.5524564E-01; Omega22(2,1,2) = -1.3479583E+00; Omega22(2,1,3) = 2.0037890E+03; + Omega22(2,2,0) = -7.4942466E-03; Omega22(2,2,1) = 1.6626193E-01; Omega22(2,2,2) = -1.4107027E+00; Omega22(2,2,3) = 2.3097604E+03; + Omega22(2,3,0) = -1.4719259E-03; Omega22(2,3,1) = 1.8446968E-02; Omega22(2,3,2) = -2.6460411E-01; Omega22(2,3,3) = 1.0911124E+02; + Omega22(2,4,0) = -1.0066279E-03; Omega22(2,4,1) = 1.1029264E-02; Omega22(2,4,2) = -2.0671266E-01; Omega22(2,4,3) = 8.2644384E+01; //N - Omega11(3,0,0) = -8.3493693E-03; Omega11(3,0,1) = 1.7808911E-01; Omega11(3,0,2) = -1.4466155E+00; Omega11(3,0,3) = 1.9324210E+03; - Omega11(3,1,0) = -1.0608832E-03; Omega11(3,1,1) = 1.1782595E-02; Omega11(3,1,2) = -2.1246301E-01; Omega11(3,1,3) = 8.4561598E+01; - Omega11(3,2,0) = -1.4719259E-03; Omega11(3,2,1) = 1.8446968E-02; Omega11(3,2,2) = -2.6460411E-01; Omega11(3,2,3) = 1.0911124E+02; - Omega11(3,3,0) = -7.7439615E-03; Omega11(3,3,1) = 1.7129007E-01; Omega11(3,3,2) = -1.4809088E+00; Omega11(3,3,3) = 2.1284951E+03; - Omega11(3,4,0) = -5.0478143E-03; Omega11(3,4,1) = 1.0236186E-01; Omega11(3,4,2) = -9.0058935E-01; Omega11(3,4,3) = 4.4472565E+02; + Omega22(3,0,0) = -8.3493693E-03; Omega22(3,0,1) = 1.7808911E-01; Omega22(3,0,2) = -1.4466155E+00; Omega22(3,0,3) = 1.9324210E+03; + Omega22(3,1,0) = -1.0608832E-03; Omega22(3,1,1) = 1.1782595E-02; Omega22(3,1,2) = -2.1246301E-01; Omega22(3,1,3) = 8.4561598E+01; + Omega22(3,2,0) = -1.4719259E-03; Omega22(3,2,1) = 1.8446968E-02; Omega22(3,2,2) = -2.6460411E-01; Omega22(3,2,3) = 1.0911124E+02; + Omega22(3,3,0) = -7.7439615E-03; Omega22(3,3,1) = 1.7129007E-01; Omega22(3,3,2) = -1.4809088E+00; Omega22(3,3,3) = 2.1284951E+03; + Omega22(3,4,0) = -5.0478143E-03; Omega22(3,4,1) = 1.0236186E-01; Omega22(3,4,2) = -9.0058935E-01; Omega22(3,4,3) = 4.4472565E+02; //O - Omega11(4,0,0) = -8.3110691E-03; Omega11(4,0,1) = 1.9617877E-01; Omega11(4,0,2) = -1.7205427E+00; Omega11(4,0,3) = 4.0812829E+03; - Omega11(4,1,0) = -3.7969686E-03; Omega11(4,1,1) = 7.6789981E-02; Omega11(4,1,2) = -7.3056809E-01; Omega11(4,1,3) = 3.3958171E+02; - Omega11(4,2,0) = -1.0066279E-03; Omega11(4,2,1) = 1.1029264E-02; Omega11(4,2,2) = -2.0671266E-01; Omega11(4,2,3) = 8.2644384E+01; - Omega11(4,3,0) = -5.0478143E-03; Omega11(4,3,1) = 1.0236186E-01; Omega11(4,3,2) = -9.0058935E-01; Omega11(4,3,3) = 4.4472565E+02; - Omega11(4,4,0) = -4.2451096E-03; Omega11(4,4,1) = 9.6820337E-02; Omega11(4,4,2) = -9.9770795E-01; Omega11(4,4,3) = 8.3320644E+02; + Omega22(4,0,0) = -8.3110691E-03; Omega22(4,0,1) = 1.9617877E-01; Omega22(4,0,2) = -1.7205427E+00; Omega22(4,0,3) = 4.0812829E+03; + Omega22(4,1,0) = -3.7969686E-03; Omega22(4,1,1) = 7.6789981E-02; Omega22(4,1,2) = -7.3056809E-01; Omega22(4,1,3) = 3.3958171E+02; + Omega22(4,2,0) = -1.0066279E-03; Omega22(4,2,1) = 1.1029264E-02; Omega22(4,2,2) = -2.0671266E-01; Omega22(4,2,3) = 8.2644384E+01; + Omega22(4,3,0) = -5.0478143E-03; Omega22(4,3,1) = 1.0236186E-01; Omega22(4,3,2) = -9.0058935E-01; Omega22(4,3,3) = 4.4472565E+02; + Omega22(4,4,0) = -4.2451096E-03; Omega22(4,4,1) = 9.6820337E-02; Omega22(4,4,2) = -9.9770795E-01; Omega22(4,4,3) = 8.3320644E+02; // Creation/Destruction (+1/-1), Index of monoatomic reactants // Monoatomic species (N,O) recombine into diaatomic (N2, O2) @@ -745,6 +753,10 @@ CSU2TCLib::CSU2TCLib(const CConfig* config, unsigned short val_nDim, bool viscou CharElTemp.resize(nSpecies,maxEl) = su2double(0.0); ElDegeneracy.resize(nSpecies,maxEl) = su2double(0.0); + // e: 1 state + CharElTemp(0,0) = 0.000000000000000E+00; + ElDegeneracy(0,0) = 1; + //N2: 15 states CharElTemp(1,0) = 0.000000000000000E+00; CharElTemp(1,1) = 7.223156514095200E+04; @@ -859,9 +871,6 @@ CSU2TCLib::CSU2TCLib(const CConfig* config, unsigned short val_nDim, bool viscou ElDegeneracy(6,5) = 1; ElDegeneracy(6,6) = 2; ElDegeneracy(6,7) = 2; - // e: 1 state - CharElTemp(0,0) = 0.000000000000000E+00; - ElDegeneracy(0,0) = 1; /*--- Set reaction maps ---*/ // N2 dissociation @@ -1008,72 +1017,124 @@ CSU2TCLib::CSU2TCLib(const CConfig* config, unsigned short val_nDim, bool viscou Tcf_a[20] = 1.0; Tcf_b[20] = 0.0; Tcb_a[20] = 0.5; Tcb_b[20] = 0.5; Tcf_a[21] = 0.0; Tcf_b[21] = 1.0; Tcb_a[21] = 0; Tcb_b[21] = 1; - //TODO: Implement Collision Integral Data for AIR-7 (JN) /*--- Collision integral data ---*/ - //TODO: ELECTRONS HAvE NO OMEGAS....NEED TO ALTER LOOPS? or add dummy vector..... - // Omega(0,0) ---------------------- + // Index 1: collider + // Index 2: partner + // Index 3: A1, A2, A3 + + // Omega^(1,1) ---------------------- + Omega11(0,0,0) = -1.000000E+00; Omega11(0,0,1) = -1.000000E+00; Omega11(0,0,2) = -1.000000E+00; Omega11(0,0,3) = -1.000000E+00; + Omega11(0,1,0) = -1.0525124E-02; Omega11(0,1,1) = 1.3498950E-01; Omega11(0,1,2) = 1.2524805E-01; Omega11(0,1,3) = 1.5066506E-01; + Omega11(0,2,0) = 2.3527001E-02; Omega11(0,2,1) = -6.9632323E-01; Omega11(0,2,2) = 6.8035475E+00; Omega11(0,2,3) = 1.8335509E-09; + Omega11(0,3,0) = 1.0414818E-01; Omega11(0,3,1) = -2.8369126E+00; Omega11(0,3,2) = 2.5323135E+01; Omega11(0,3,3) = 7.7138358E-32; + Omega11(0,4,0) = 0.0000000E+00; Omega11(0,4,1) = 1.6554247E-01; Omega11(0,4,2) = -3.4986344E+00; Omega11(0,4,3) = 5.9268038E+08; + Omega11(0,5,0) = 9.9865506E-03; Omega11(0,5,1) = -2.7407431E-01; Omega11(0,5,2) = 2.6561032E+00; Omega11(0,5,3) = 4.3080676E-04; + Omega11(0,6,0) = 1.0000000E+00; Omega11(0,6,1) = 1.0000000E+00; Omega11(0,6,2) = 1.0000000E+00; Omega11(0,6,3) = 1.0000000E+00; //N2 - Omega00(0,0,0) = -6.0614558E-03; Omega00(0,0,1) = 1.2689102E-01; Omega00(0,0,2) = -1.0616948E+00; Omega00(0,0,3) = 8.0955466E+02; - Omega00(0,1,0) = -3.7959091E-03; Omega00(0,1,1) = 9.5708295E-02; Omega00(0,1,2) = -1.0070611E+00; Omega00(0,1,3) = 8.9392313E+02; - Omega00(0,2,0) = -1.9295666E-03; Omega00(0,2,1) = 2.7995735E-02; Omega00(0,2,2) = -3.1588514E-01; Omega00(0,2,3) = 1.2880734E+02; - Omega00(0,3,0) = -1.0796249E-02; Omega00(0,3,1) = 2.2656509E-01; Omega00(0,3,2) = -1.7910602E+00; Omega00(0,3,3) = 4.0455218E+03; - Omega00(0,4,0) = -2.7244269E-03; Omega00(0,4,1) = 6.9587171E-02; Omega00(0,4,2) = -7.9538667E-01; Omega00(0,4,3) = 4.0673730E+02; + Omega11(1,0,0) = -1.0525124E-02; Omega11(1,0,1) = 1.3498950E-01; Omega11(1,0,2) = 1.2524805E-01; Omega11(1,0,3) = 1.5066506E-01; + Omega11(1,1,0) = -6.0614558E-03; Omega11(1,1,1) = 1.2689102E-01; Omega11(1,1,2) = -1.0616948E+00; Omega11(1,1,3) = 8.0955466E+02; + Omega11(1,2,0) = -3.7959091E-03; Omega11(1,2,1) = 9.5708295E-02; Omega11(1,2,2) = -1.0070611E+00; Omega11(1,2,3) = 8.9392313E+02; + Omega11(1,3,0) = -1.9295666E-03; Omega11(1,3,1) = 2.7995735E-02; Omega11(1,3,2) = -3.1588514E-01; Omega11(1,3,3) = 1.2880734E+02; + Omega11(1,4,0) = -1.0796249E-02; Omega11(1,4,1) = 2.2656509E-01; Omega11(1,4,2) = -1.7910602E+00; Omega11(1,4,3) = 4.0455218E+03; + Omega11(1,5,0) = -2.7244269E-03; Omega11(1,5,1) = 6.9587171E-02; Omega11(1,5,2) = -7.9538667E-01; Omega11(1,5,3) = 4.0673730E+02; + Omega11(1,6,0) = 0.0000000E+00; Omega11(1,6,1) = 9.1205839E-02; Omega11(1,6,2) = -1.8728231E+00; Omega11(1,6,3) = 2.4432020E+05; //O2 - Omega00(2,0,0) = -3.7959091E-03; Omega00(1,0,1) = 9.5708295E-02; Omega00(1,0,2) = -1.0070611E+00; Omega00(1,0,3) = 8.9392313E+02; - Omega00(2,1,0) = -8.0682650E-04; Omega00(1,1,1) = 1.6602480E-02; Omega00(1,1,2) = -3.1472774E-01; Omega00(1,1,3) = 1.4116458E+02; - Omega00(2,2,0) = -6.4433840E-04; Omega00(1,2,1) = 8.5378580E-03; Omega00(1,2,2) = -2.3225102E-01; Omega00(1,2,3) = 1.1371608E+02; - Omega00(2,3,0) = -1.1453028E-03; Omega00(1,3,1) = 1.2654140E-02; Omega00(1,3,2) = -2.2435218E-01; Omega00(1,3,3) = 7.7201588E+01; - Omega00(2,4,0) = -4.8405803E-03; Omega00(1,4,1) = 1.0297688E-01; Omega00(1,4,2) = -9.6876576E-01; Omega00(1,4,3) = 6.1629812E+02; + Omega11(2,0,0) = 2.3527001E-02; Omega11(2,0,1) = -6.9632323E-01; Omega11(2,0,2) = 6.8035475E+00; Omega11(2,0,3) = 1.8335509E-09; + Omega11(2,1,0) = -3.7959091E-03; Omega11(2,1,1) = 9.5708295E-02; Omega11(2,1,2) = -1.0070611E+00; Omega11(2,1,3) = 8.9392313E+02; + Omega11(2,2,0) = -8.0682650E-04; Omega11(2,2,1) = 1.6602480E-02; Omega11(2,2,2) = -3.1472774E-01; Omega11(2,2,3) = 1.4116458E+02; + Omega11(2,3,0) = -6.4433840E-04; Omega11(2,3,1) = 8.5378580E-03; Omega11(2,3,2) = -2.3225102E-01; Omega11(2,3,3) = 1.1371608E+02; + Omega11(2,4,0) = -1.1453028E-03; Omega11(2,4,1) = 1.2654140E-02; Omega11(2,4,2) = -2.2435218E-01; Omega11(2,4,3) = 7.7201588E+01; + Omega11(2,5,0) = -4.8405803E-03; Omega11(2,5,1) = 1.0297688E-01; Omega11(2,5,2) = -9.6876576E-01; Omega11(2,5,3) = 6.1629812E+02; + Omega11(2,6,0) = -3.7822765E-03; Omega11(2,6,1) = 1.7967016E-01; Omega11(2,6,2) = -2.5409098E+00; Omega11(2,6,3) = 1.1840435E+06; //NO - Omega00(2,0,0) = -1.9295666E-03; Omega00(2,0,1) = 2.7995735E-02; Omega00(2,0,2) = -3.1588514E-01; Omega00(2,0,3) = 1.2880734E+02; - Omega00(2,1,0) = -6.4433840E-04; Omega00(2,1,1) = 8.5378580E-03; Omega00(2,1,2) = -2.3225102E-01; Omega00(2,1,3) = 1.1371608E+02; - Omega00(2,2,0) = -0.0000000E+00; Omega00(2,2,1) = -1.1056066E-02; Omega00(2,2,2) = -5.9216250E-02; Omega00(2,2,3) = 7.2542367E+01; - Omega00(2,3,0) = -1.5770918E-03; Omega00(2,3,1) = 1.9578381E-02; Omega00(2,3,2) = -2.7873624E-01; Omega00(2,3,3) = 9.9547944E+01; - Omega00(2,4,0) = -1.0885815E-03; Omega00(2,4,1) = 1.1883688E-02; Omega00(2,4,2) = -2.1844909E-01; Omega00(2,4,3) = 7.5512560E+01; + Omega11(3,0,0) = 1.0414818E-01; Omega11(3,0,1) = -2.8369126E+00; Omega11(3,0,2) = 2.5323135E+01; Omega11(3,0,3) = 7.7138358E-32; + Omega11(3,1,0) = -1.9295666E-03; Omega11(3,1,1) = 2.7995735E-02; Omega11(3,1,2) = -3.1588514E-01; Omega11(3,1,3) = 1.2880734E+02; + Omega11(3,2,0) = -6.4433840E-04; Omega11(3,2,1) = 8.5378580E-03; Omega11(3,2,2) = -2.3225102E-01; Omega11(3,2,3) = 1.1371608E+02; + Omega11(3,3,0) = -0.0000000E+00; Omega11(3,3,1) = -1.1056066E-02; Omega11(3,3,2) = -5.9216250E-02; Omega11(3,3,3) = 7.2542367E+01; + Omega11(3,4,0) = -1.5770918E-03; Omega11(3,4,1) = 1.9578381E-02; Omega11(3,4,2) = -2.7873624E-01; Omega11(3,4,3) = 9.9547944E+01; + Omega11(3,5,0) = -1.0885815E-03; Omega11(3,5,1) = 1.1883688E-02; Omega11(3,5,2) = -2.1844909E-01; Omega11(3,5,3) = 7.5512560E+01; + Omega11(3,6,0) = -8.1158474E-03; Omega11(3,6,1) = 2.1474280E-01; Omega11(3,6,2) = -2.0148450E+00; Omega11(3,6,3) = 6.2986385E+04; //N - Omega00(3,0,0) = -1.0796249E-02; Omega00(3,0,1) = 2.2656509E-01; Omega00(3,0,2) = -1.7910602E+00; Omega00(3,0,3) = 4.0455218E+03; - Omega00(3,1,0) = -1.1453028E-03; Omega00(3,1,1) = 1.2654140E-02; Omega00(3,1,2) = -2.2435218E-01; Omega00(3,1,3) = 7.7201588E+01; - Omega00(3,2,0) = -1.5770918E-03; Omega00(3,2,1) = 1.9578381E-02; Omega00(3,2,2) = -2.7873624E-01; Omega00(3,2,3) = 9.9547944E+01; - Omega00(3,3,0) = -9.6083779E-03; Omega00(3,3,1) = 2.0938971E-01; Omega00(3,3,2) = -1.7386904E+00; Omega00(3,3,3) = 3.3587983E+03; - Omega00(3,4,0) = -7.8147689E-03; Omega00(3,4,1) = 1.6792705E-01; Omega00(3,4,2) = -1.4308628E+00; Omega00(3,4,3) = 1.6628859E+03; + Omega11(4,0,0) = 0.0000000E+00; Omega11(4,0,1) = 1.6554247E-01; Omega11(4,0,2) = -3.4986344E+00; Omega11(4,0,3) = 5.9268038E+08; + Omega11(4,1,0) = -1.0796249E-02; Omega11(4,1,1) = 2.2656509E-01; Omega11(4,1,2) = -1.7910602E+00; Omega11(4,1,3) = 4.0455218E+03; + Omega11(4,2,0) = -1.1453028E-03; Omega11(4,2,1) = 1.2654140E-02; Omega11(4,2,2) = -2.2435218E-01; Omega11(4,2,3) = 7.7201588E+01; + Omega11(4,3,0) = -1.5770918E-03; Omega11(4,3,1) = 1.9578381E-02; Omega11(4,3,2) = -2.7873624E-01; Omega11(4,3,3) = 9.9547944E+01; + Omega11(4,4,0) = -9.6083779E-03; Omega11(4,4,1) = 2.0938971E-01; Omega11(4,4,2) = -1.7386904E+00; Omega11(4,4,3) = 3.3587983E+03; + Omega11(4,5,0) = -7.8147689E-03; Omega11(4,5,1) = 1.6792705E-01; Omega11(4,5,2) = -1.4308628E+00; Omega11(4,5,3) = 1.6628859E+03; + Omega11(4,6,0) = -1.9605234E-02; Omega11(4,6,1) = 5.5570872E-01; Omega11(4,6,2) = -5.4285702E+00; Omega11(4,6,3) = 1.3574446E+09; //O - Omega00(4,0,0) = -2.7244269E-03; Omega00(4,0,1) = 6.9587171E-02; Omega00(4,0,2) = -7.9538667E-01; Omega00(4,0,3) = 4.0673730E+02; - Omega00(4,1,0) = -4.8405803E-03; Omega00(4,1,1) = 1.0297688E-01; Omega00(4,1,2) = -9.6876576E-01; Omega00(4,1,3) = 6.1629812E+02; - Omega00(4,2,0) = -1.0885815E-03; Omega00(4,2,1) = 1.1883688E-02; Omega00(4,2,2) = -2.1844909E-01; Omega00(4,2,3) = 7.5512560E+01; - Omega00(4,3,0) = -7.8147689E-03; Omega00(4,3,1) = 1.6792705E-01; Omega00(4,3,2) = -1.4308628E+00; Omega00(4,3,3) = 1.6628859E+03; - Omega00(4,4,0) = -6.4040535E-03; Omega00(4,4,1) = 1.4629949E-01; Omega00(4,4,2) = -1.3892121E+00; Omega00(4,4,3) = 2.0903441E+03; - - // Omega(1,1) ---------------------- + Omega11(5,0,0) = 9.9865506E-03; Omega11(5,0,1) = -2.7407431E-01; Omega11(5,0,2) = 2.6561032E+00; Omega11(5,0,3) = 4.3080676E-04; + Omega11(5,1,0) = -2.7244269E-03; Omega11(5,1,1) = 6.9587171E-02; Omega11(5,1,2) = -7.9538667E-01; Omega11(5,1,3) = 4.0673730E+02; + Omega11(5,2,0) = -4.8405803E-03; Omega11(5,2,1) = 1.0297688E-01; Omega11(5,2,2) = -9.6876576E-01; Omega11(5,2,3) = 6.1629812E+02; + Omega11(5,3,0) = -1.0885815E-03; Omega11(5,3,1) = 1.1883688E-02; Omega11(5,3,2) = -2.1844909E-01; Omega11(5,3,3) = 7.5512560E+01; + Omega11(5,4,0) = -7.8147689E-03; Omega11(5,4,1) = 1.6792705E-01; Omega11(5,4,2) = -1.4308628E+00; Omega11(5,4,3) = 1.6628859E+03; + Omega11(5,5,0) = -6.4040535E-03; Omega11(5,5,1) = 1.4629949E-01; Omega11(5,5,2) = -1.3892121E+00; Omega11(5,5,3) = 2.0903441E+03; + Omega11(5,6,0) = -1.6409054E-02; Omega11(5,6,1) = 4.6352852E-01; Omega11(5,6,2) = -4.5479735E+00; Omega11(5,6,3) = 7.4250671E+07; + //NO+ + Omega11(6,0,0) = 1.0000000E+00; Omega11(6,0,1) = 1.0000000E+00; Omega11(6,0,2) = 1.0000000E+00; Omega11(6,0,3) = 1.0000000E+00; + Omega11(6,1,0) = 0.0000000E+00; Omega11(6,1,1) = 9.1205839E-02; Omega11(6,1,2) = -1.8728231E+00; Omega11(6,1,3) = 2.4432020E+05; + Omega11(6,2,0) = -3.7822765E-03; Omega11(6,2,1) = 1.7967016E-01; Omega11(6,2,2) = -2.5409098E+00; Omega11(6,2,3) = 1.1840435E+06; + Omega11(6,3,0) = -8.1158474E-03; Omega11(6,3,1) = 2.1474280E-01; Omega11(6,3,2) = -2.0148450E+00; Omega11(6,3,3) = 6.2986385E+04; + Omega11(6,4,0) = -1.9605234E-02; Omega11(6,4,1) = 5.5570872E-01; Omega11(6,4,2) = -5.4285702E+00; Omega11(6,4,3) = 1.3574446E+09; + Omega11(6,5,0) = -1.6409054E-02; Omega11(6,5,1) = 4.6352852E-01; Omega11(6,5,2) = -4.5479735E+00; Omega11(6,5,3) = 7.4250671E+07; + Omega11(6,6,0) = -1.000000E+00; Omega11(6,6,1) = -1.000000E+00; Omega11(6,6,2) = -1.000000E+00; Omega11(6,6,3) = -1.000000E+00; + + // Omega^(2,2) ---------------------- + Omega22(0,0,0) = -1.000000E+00; Omega22(0,0,1) = -1.000000E+00; Omega22(0,0,2) = -1.000000E+00; Omega22(0,0,3) = -1.000000E+00; + Omega22(0,1,0) = -4.2254948E-03; Omega22(0,1,1) = -5.2965163E-02; Omega22(0,1,2) = 1.9157708E+00; Omega22(0,1,3) = 6.3263309E-04; + Omega22(0,2,0) = 9.6744867E-03; Omega22(0,2,1) = -3.3759583E-01; Omega22(0,2,2) = 3.7952121E+00; Omega22(0,2,3) = 6.8468036E-06; + Omega22(0,3,0) = 0.0000000E+00; Omega22(0,3,1) = 5.4444485E-02; Omega22(0,3,2) = -1.2854128E+00; Omega22(0,3,3) = 1.3857556E+04; + Omega22(0,4,0) = -1.0903638E-01; Omega22(0,4,1) = 2.8678381E+00; Omega22(0,4,2) = -2.5297550E+01; Omega22(0,4,3) = 3.4838798E+33; + Omega22(0,5,0) = -1.7924100E-02; Omega22(0,5,1) = 4.0402656E-01; Omega22(0,5,2) = -2.6712374E+00; Omega22(0,5,3) = 4.1447669E+02; + Omega22(0,6,0) = 1.0000000E+00; Omega22(0,6,1) = 1.0000000E+00; Omega22(0,6,2) = 1.0000000E+00; Omega22(0,6,3) = 1.0000000E+00; //N2 - Omega11(0,0,0) = -7.6303990E-03; Omega11(0,0,1) = 1.6878089E-01; Omega11(0,0,2) = -1.4004234E+00; Omega11(0,0,3) = 2.1427708E+03; - Omega11(0,1,0) = -8.0457321E-03; Omega11(0,1,1) = 1.9228905E-01; Omega11(0,1,2) = -1.7102854E+00; Omega11(0,1,3) = 5.2213857E+03; - Omega11(0,2,0) = -6.8237776E-03; Omega11(0,2,1) = 1.4360616E-01; Omega11(0,2,2) = -1.1922240E+00; Omega11(0,2,3) = 1.2433086E+03; - Omega11(0,3,0) = -8.3493693E-03; Omega11(0,3,1) = 1.7808911E-01; Omega11(0,3,2) = -1.4466155E+00; Omega11(0,3,3) = 1.9324210E+03; - Omega11(0,4,0) = -8.3110691E-03; Omega11(0,4,1) = 1.9617877E-01; Omega11(0,4,2) = -1.7205427E+00; Omega11(0,4,3) = 4.0812829E+03; + Omega22(1,0,0) = -4.2254948E-03; Omega22(1,0,1) = -5.2965163E-02; Omega22(1,0,2) = 1.9157708E+00; Omega22(1,0,3) = 6.3263309E-04; + Omega22(1,1,0) = -7.6303990E-03; Omega22(1,1,1) = 1.6878089E-01; Omega22(1,1,2) = -1.4004234E+00; Omega22(1,1,3) = 2.1427708E+03; + Omega22(1,2,0) = -8.0457321E-03; Omega22(1,2,1) = 1.9228905E-01; Omega22(1,2,2) = -1.7102854E+00; Omega22(1,2,3) = 5.2213857E+03; + Omega22(1,3,0) = -6.8237776E-03; Omega22(1,3,1) = 1.4360616E-01; Omega22(1,3,2) = -1.1922240E+00; Omega22(1,3,3) = 1.2433086E+03; + Omega22(1,4,0) = -8.3493693E-03; Omega22(1,4,1) = 1.7808911E-01; Omega22(1,4,2) = -1.4466155E+00; Omega22(1,4,3) = 1.9324210E+03; + Omega22(1,5,0) = -8.3110691E-03; Omega22(1,5,1) = 1.9617877E-01; Omega22(1,5,2) = -1.7205427E+00; Omega22(1,5,3) = 4.0812829E+03; + Omega22(1,6,0) = 0.0000000E+00; Omega22(1,6,1) = 8.5112236E-02; Omega22(1,6,2) = -1.7460044E+00; Omega22(1,6,3) = 1.4498969E+05; //O2 - Omega11(1,0,0) = -8.0457321E-03; Omega11(1,0,1) = 1.9228905E-01; Omega11(1,0,2) = -1.7102854E+00; Omega11(1,0,3) = 5.2213857E+03; - Omega11(1,1,0) = -6.2931612E-03; Omega11(1,1,1) = 1.4624645E-01; Omega11(1,1,2) = -1.3006927E+00; Omega11(1,1,3) = 1.8066892E+03; - Omega11(1,2,0) = -6.8508672E-03; Omega11(1,2,1) = 1.5524564E-01; Omega11(1,2,2) = -1.3479583E+00; Omega11(1,2,3) = 2.0037890E+03; - Omega11(1,3,0) = -1.0608832E-03; Omega11(1,3,1) = 1.1782595E-02; Omega11(1,3,2) = -2.1246301E-01; Omega11(1,3,3) = 8.4561598E+01; - Omega11(1,4,0) = -3.7969686E-03; Omega11(1,4,1) = 7.6789981E-02; Omega11(1,4,2) = -7.3056809E-01; Omega11(1,4,3) = 3.3958171E+02; + Omega22(2,0,0) = 9.6744867E-03; Omega22(2,0,1) = -3.3759583E-01; Omega22(2,0,2) = 3.7952121E+00; Omega22(2,0,3) = 6.8468036E-06; + Omega22(2,1,0) = -8.0457321E-03; Omega22(2,1,1) = 1.9228905E-01; Omega22(2,1,2) = -1.7102854E+00; Omega22(2,1,3) = 5.2213857E+03; + Omega22(2,2,0) = -6.2931612E-03; Omega22(2,2,1) = 1.4624645E-01; Omega22(2,2,2) = -1.3006927E+00; Omega22(2,2,3) = 1.8066892E+03; + Omega22(2,3,0) = -6.8508672E-03; Omega22(2,3,1) = 1.5524564E-01; Omega22(2,3,2) = -1.3479583E+00; Omega22(2,3,3) = 2.0037890E+03; + Omega22(2,4,0) = -1.0608832E-03; Omega22(2,4,1) = 1.1782595E-02; Omega22(2,4,2) = -2.1246301E-01; Omega22(2,4,3) = 8.4561598E+01; + Omega22(2,5,0) = -3.7969686E-03; Omega22(2,5,1) = 7.6789981E-02; Omega22(2,5,2) = -7.3056809E-01; Omega22(2,5,3) = 3.3958171E+02; + Omega22(2,6,0) = 0.0000000E+00; Omega22(2,6,1) = 8.4737359E-02; Omega22(2,6,2) = -1.7290488E+00; Omega22(2,6,3) = 1.2485194E+05; //NO - Omega11(2,0,0) = -6.8237776E-03; Omega11(2,0,1) = 1.4360616E-01; Omega11(2,0,2) = -1.1922240E+00; Omega11(2,0,3) = 1.2433086E+03; - Omega11(2,1,0) = -6.8508672E-03; Omega11(2,1,1) = 1.5524564E-01; Omega11(2,1,2) = -1.3479583E+00; Omega11(2,1,3) = 2.0037890E+03; - Omega11(2,2,0) = -7.4942466E-03; Omega11(2,2,1) = 1.6626193E-01; Omega11(2,2,2) = -1.4107027E+00; Omega11(2,2,3) = 2.3097604E+03; - Omega11(2,3,0) = -1.4719259E-03; Omega11(2,3,1) = 1.8446968E-02; Omega11(2,3,2) = -2.6460411E-01; Omega11(2,3,3) = 1.0911124E+02; - Omega11(2,4,0) = -1.0066279E-03; Omega11(2,4,1) = 1.1029264E-02; Omega11(2,4,2) = -2.0671266E-01; Omega11(2,4,3) = 8.2644384E+01; + Omega22(3,0,0) = 0.0000000E+00; Omega22(0,3,1) = 5.4444485E-02; Omega22(0,3,2) = -1.2854128E+00; Omega22(0,3,3) = 1.3857556E+04; + Omega22(3,1,0) = -6.8237776E-03; Omega22(3,1,1) = 1.4360616E-01; Omega22(3,1,2) = -1.1922240E+00; Omega22(3,1,3) = 1.2433086E+03; + Omega22(3,2,0) = -6.8508672E-03; Omega22(3,2,1) = 1.5524564E-01; Omega22(3,2,2) = -1.3479583E+00; Omega22(3,2,3) = 2.0037890E+03; + Omega22(3,3,0) = -7.4942466E-03; Omega22(3,3,1) = 1.6626193E-01; Omega22(3,3,2) = -1.4107027E+00; Omega22(3,3,3) = 2.3097604E+03; + Omega22(3,4,0) = -1.4719259E-03; Omega22(3,4,1) = 1.8446968E-02; Omega22(3,4,2) = -2.6460411E-01; Omega22(3,4,3) = 1.0911124E+02; + Omega22(3,5,0) = -1.0066279E-03; Omega22(3,5,1) = 1.1029264E-02; Omega22(3,5,2) = -2.0671266E-01; Omega22(3,5,3) = 8.2644384E+01; + Omega22(3,6,0) = 1.1055777E-02; Omega22(3,6,1) = -1.6621846E-01; Omega22(3,6,2) = 1.4372166E-01; Omega22(3,6,3) = 1.3182061E+03; //N - Omega11(3,0,0) = -8.3493693E-03; Omega11(3,0,1) = 1.7808911E-01; Omega11(3,0,2) = -1.4466155E+00; Omega11(3,0,3) = 1.9324210E+03; - Omega11(3,1,0) = -1.0608832E-03; Omega11(3,1,1) = 1.1782595E-02; Omega11(3,1,2) = -2.1246301E-01; Omega11(3,1,3) = 8.4561598E+01; - Omega11(3,2,0) = -1.4719259E-03; Omega11(3,2,1) = 1.8446968E-02; Omega11(3,2,2) = -2.6460411E-01; Omega11(3,2,3) = 1.0911124E+02; - Omega11(3,3,0) = -7.7439615E-03; Omega11(3,3,1) = 1.7129007E-01; Omega11(3,3,2) = -1.4809088E+00; Omega11(3,3,3) = 2.1284951E+03; - Omega11(3,4,0) = -5.0478143E-03; Omega11(3,4,1) = 1.0236186E-01; Omega11(3,4,2) = -9.0058935E-01; Omega11(3,4,3) = 4.4472565E+02; + Omega22(4,0,0) = -1.0903638E-01; Omega22(4,0,1) = 2.8678381E+00; Omega22(4,0,2) = -2.5297550E+01; Omega22(4,0,3) = 3.4838798E+33; + Omega22(4,1,0) = -8.3493693E-03; Omega22(4,1,1) = 1.7808911E-01; Omega22(4,1,2) = -1.4466155E+00; Omega22(4,1,3) = 1.9324210E+03; + Omega22(4,2,0) = -1.0608832E-03; Omega22(4,2,1) = 1.1782595E-02; Omega22(4,2,2) = -2.1246301E-01; Omega22(4,2,3) = 8.4561598E+01; + Omega22(4,3,0) = -1.4719259E-03; Omega22(4,3,1) = 1.8446968E-02; Omega22(4,3,2) = -2.6460411E-01; Omega22(4,3,3) = 1.0911124E+02; + Omega22(4,4,0) = -7.7439615E-03; Omega22(4,4,1) = 1.7129007E-01; Omega22(4,4,2) = -1.4809088E+00; Omega22(4,4,3) = 2.1284951E+03; + Omega22(4,5,0) = -5.0478143E-03; Omega22(4,5,1) = 1.0236186E-01; Omega22(4,5,2) = -9.0058935E-01; Omega22(4,5,3) = 4.4472565E+02; + Omega22(4,6,0) = -2.1009546E-02; Omega22(4,6,1) = 5.8910426E-01; Omega22(4,6,2) = -5.6681361E+00; Omega22(4,6,3) = 2.4486594E+09; //O - Omega11(4,0,0) = -8.3110691E-03; Omega11(4,0,1) = 1.9617877E-01; Omega11(4,0,2) = -1.7205427E+00; Omega11(4,0,3) = 4.0812829E+03; - Omega11(4,1,0) = -3.7969686E-03; Omega11(4,1,1) = 7.6789981E-02; Omega11(4,1,2) = -7.3056809E-01; Omega11(4,1,3) = 3.3958171E+02; - Omega11(4,2,0) = -1.0066279E-03; Omega11(4,2,1) = 1.1029264E-02; Omega11(4,2,2) = -2.0671266E-01; Omega11(4,2,3) = 8.2644384E+01; - Omega11(4,3,0) = -5.0478143E-03; Omega11(4,3,1) = 1.0236186E-01; Omega11(4,3,2) = -9.0058935E-01; Omega11(4,3,3) = 4.4472565E+02; - Omega11(4,4,0) = -4.2451096E-03; Omega11(4,4,1) = 9.6820337E-02; Omega11(4,4,2) = -9.9770795E-01; Omega11(4,4,3) = 8.3320644E+02; + Omega22(5,0,0) = -1.7924100E-02; Omega22(5,0,1) = 4.0402656E-01; Omega22(5,0,2) = -2.6712374E+00; Omega22(5,0,3) = 4.1447669E+02; + Omega22(5,1,0) = -8.3110691E-03; Omega22(5,1,1) = 1.9617877E-01; Omega22(5,1,2) = -1.7205427E+00; Omega22(5,1,3) = 4.0812829E+03; + Omega22(5,2,0) = -3.7969686E-03; Omega22(5,2,1) = 7.6789981E-02; Omega22(5,2,2) = -7.3056809E-01; Omega22(5,2,3) = 3.3958171E+02; + Omega22(5,3,0) = -1.0066279E-03; Omega22(5,3,1) = 1.1029264E-02; Omega22(5,3,2) = -2.0671266E-01; Omega22(5,3,3) = 8.2644384E+01; + Omega22(5,4,0) = -5.0478143E-03; Omega22(5,4,1) = 1.0236186E-01; Omega22(5,4,2) = -9.0058935E-01; Omega22(5,4,3) = 4.4472565E+02; + Omega22(5,5,0) = -4.2451096E-03; Omega22(5,5,1) = 9.6820337E-02; Omega22(5,5,2) = -9.9770795E-01; Omega22(5,5,3) = 8.3320644E+02; + Omega22(5,6,0) = -1.5315132E-02; Omega22(5,6,1) = 4.3541627E-01; Omega22(5,6,2) = -4.2864279E+00; Omega22(5,6,3) = 3.5125207E+07; + //NO+ + Omega22(6,0,0) = 1.0000000E+00; Omega22(6,0,1) = 1.0000000E+00; Omega22(6,0,2) = 1.0000000E+00; Omega22(6,0,3) = 1.0000000E+00; + Omega22(6,1,0) = 0.0000000E+00; Omega22(6,1,1) = 8.5112236E-02; Omega22(6,1,2) = -1.7460044E+00; Omega22(6,1,3) = 1.4498969E+05; + Omega22(6,2,0) = 0.0000000E+00; Omega22(6,2,1) = 8.4737359E-02; Omega22(6,2,2) = -1.7290488E+00; Omega22(6,2,3) = 1.2485194E+05; + Omega22(6,3,0) = 1.1055777E-02; Omega22(6,3,1) = -1.6621846E-01; Omega22(6,3,2) = 1.4372166E-01; Omega22(6,3,3) = 1.3182061E+03; + Omega22(6,4,0) = -2.1009546E-02; Omega22(6,4,1) = 5.8910426E-01; Omega22(6,4,2) = -5.6681361E+00; Omega22(6,4,3) = 2.4486594E+09; + Omega22(6,5,0) = -1.5315132E-02; Omega22(6,5,1) = 4.3541627E-01; Omega22(6,5,2) = -4.2864279E+00; Omega22(6,5,3) = 3.5125207E+07; + Omega22(6,6,0) = -1.000000E+00; Omega22(6,6,1) = -1.000000E+00; Omega22(6,6,2) = -1.000000E+00; Omega22(6,6,3) = -1.000000E+00; // Creation/Destruction (+1/-1), Index of monoatomic reactants // Monoatomic species (N,O) recombine into diaatomic (N2, O2) @@ -1099,7 +1160,7 @@ CSU2TCLib::CSU2TCLib(const CConfig* config, unsigned short val_nDim, bool viscou else { nHeavy = nSpecies; nEl = 0; } } -CSU2TCLib::~CSU2TCLib(){} +CSU2TCLib::~CSU2TCLib()= default; void CSU2TCLib::SetTDStateRhosTTv(vector& val_rhos, su2double val_temperature, su2double val_temperature_ve){ @@ -1266,7 +1327,7 @@ vector& CSU2TCLib::ComputeSpeciesEve(su2double val_T, bool vibe_only) } Eel = Ru/MolarMass[iSpecies] * (num/denom); } - if (vibe_only == true) {eves[iSpecies] = Ev;} + if (vibe_only) {eves[iSpecies] = Ev;} else {eves[iSpecies] = Ev + Eel;} } @@ -1283,7 +1344,6 @@ vector& CSU2TCLib::ComputeNetProductionRates(bool implicit, const su2 /*--- Initialize variables ---*/ unsigned short ii, iReaction; - su2double Keq; ws.resize(nSpecies,0.0); for (iSpecies = 0; iSpecies < nSpecies; iSpecies ++) ws[iSpecies] = 0.0; @@ -1292,8 +1352,8 @@ vector& CSU2TCLib::ComputeNetProductionRates(bool implicit, const su2 // Note: These parameters artificially increase the rate-controlling reaction // temperature. This relaxes some of the stiffness in the chemistry // source term. - su2double T_min = 800.0; - su2double epsilon = 80; + const su2double T_min = 800.0; + const su2double epsilon = 80; /*--- Define preferential dissociation coefficient ---*/ //alpha = 0.3; //TODO: make this a config option? @@ -1317,7 +1377,7 @@ vector& CSU2TCLib::ComputeNetProductionRates(bool implicit, const su2 ComputeKeqConstants(iReaction); /*--- Calculate Keq ---*/ - Keq = exp( A[0]*(Thb/1E4) + A[1] + A[2]*log(1E4/Thb) + const su2double Keq = exp( A[0]*(Thb/1E4) + A[1] + A[2]*log(1E4/Thb) + A[3]*(1E4/Thb) + A[4]*(1E4/Thb)*(1E4/Thb) ); /*--- Calculate rate coefficients ---*/ @@ -1521,7 +1581,7 @@ void CSU2TCLib::ComputeKeqConstants(unsigned short val_Reaction) { for (ii = 0; ii < 5; ii++) A[ii] = RxnConstantTable(0,ii); return; - } else if (iIndex >= 5) { + } if (iIndex >= 5) { for (ii = 0; ii < 5; ii++) A[ii] = RxnConstantTable(5,ii); return; @@ -1554,9 +1614,8 @@ su2double CSU2TCLib::ComputeEveSourceTerm(){ // Note: Millikan & White relaxation time (requires P in Atm.) // Note: Park limiting cross section - su2double A_sr, B_sr, num, denom, Cs, sig_s, tau_sr, tauP, tauMW; - vector MolarFrac; su2activematrix mu; + vector MolarFrac; MolarFrac.resize(nSpecies,0.0); mu.resize(nSpecies,nSpecies)=su2double(0.0); @@ -1571,6 +1630,7 @@ su2double CSU2TCLib::ComputeEveSourceTerm(){ conc += rhos[iSpecies] / MolarMass[iSpecies]; N += rhos[iSpecies] / MolarMass[iSpecies] * AVOGAD_CONSTANT; } + for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) MolarFrac[iSpecies] = (rhos[iSpecies] / MolarMass[iSpecies]) / conc; @@ -1582,25 +1642,25 @@ su2double CSU2TCLib::ComputeEveSourceTerm(){ for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { /*--- Millikan & White relaxation time ---*/ - num = 0.0; - denom = 0.0; + su2double num = 0.0; + su2double denom = 0.0; for (jSpecies = 0; jSpecies < nSpecies; jSpecies++) { mu(iSpecies,jSpecies) = MolarMass[iSpecies]*MolarMass[jSpecies] / (MolarMass[iSpecies] + MolarMass[jSpecies]); - A_sr = 1.16 * 1E-3 * sqrt(mu(iSpecies,jSpecies)) * pow(CharVibTemp[iSpecies], 4.0/3.0); - B_sr = 0.015 * pow(mu(iSpecies,jSpecies), 0.25); - tau_sr = 101325.0/Pressure * exp(A_sr*(pow(T,-1.0/3.0) - B_sr) - 18.42); + const su2double A_sr = 1.16 * 1E-3 * sqrt(mu(iSpecies,jSpecies)) * pow(CharVibTemp[iSpecies], 4.0/3.0); + const su2double B_sr = 0.015 * pow(mu(iSpecies,jSpecies), 0.25); + const su2double tau_sr = 101325.0/Pressure * exp(A_sr*(pow(T,-1.0/3.0) - B_sr) - 18.42); num += MolarFrac[jSpecies]; denom += MolarFrac[jSpecies] / tau_sr; } - tauMW = num / denom; + const su2double tauMW = num / denom; /*--- Park limiting cross section ---*/ - Cs = sqrt((8.0*Ru*T)/(PI_NUMBER*MolarMass[iSpecies])); - sig_s = 3E-21*(2.5E9)/(T*T); + const su2double Cs = sqrt((8.0*Ru*T)/(PI_NUMBER*MolarMass[iSpecies])); + const su2double sig_s = 3E-21*(2.5E9)/(T*T); - tauP = 1/(sig_s*Cs*N); + const su2double tauP = 1/(sig_s*Cs*N); /*--- Species relaxation time ---*/ taus[iSpecies] = tauMW + tauP; @@ -1699,16 +1759,11 @@ vector& CSU2TCLib::GetThermalConductivities(){ void CSU2TCLib::DiffusionCoeffWBE(){ - su2double Mi, Mj, Omega_ij, denom; - su2activematrix Dij; - - Dij.resize(nSpecies, nSpecies) = su2double(0.0); - /*--- Calculate species mole fraction ---*/ su2double conc = 0.0; for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { MolarFracWBE[iSpecies] = rhos[iSpecies]/MolarMass[iSpecies]; - conc += MolarFracWBE[iSpecies]; + conc += MolarFracWBE[iSpecies]; } for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) MolarFracWBE[iSpecies] = MolarFracWBE[iSpecies]/conc; @@ -1726,16 +1781,27 @@ void CSU2TCLib::DiffusionCoeffWBE(){ /*--- Solve for binary diffusion coefficients ---*/ // Note: Dij = Dji, so only loop through req'd indices // Note: Correlation requires kg/mol, hence 1E-3 conversion from kg/kmol + su2activematrix Dij; + Dij.resize(nSpecies, nSpecies) = su2double(0.0); + for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { - Mi = MolarMass[iSpecies]*1E-3; + const su2double Mi = MolarMass[iSpecies]*1E-3; for (jSpecies = iSpecies; jSpecies < nSpecies; jSpecies++) { - Mj = MolarMass[jSpecies]*1E-3; + const su2double Mj = MolarMass[jSpecies]*1E-3; + + /*--- Calculate the Omega^(1,1)_ij collision cross section ---*/ + + /*--- If collisions between electrons/ion, used Coloumb potentials ---*/ + bool coulomb = false; + if (abs(Omega11(iSpecies, jSpecies, 0)) == 1.0 && ionization) coulomb = true; + + // Used Tve for electron collisions + const su2double T_col = (iSpecies == 0 && ionization) ? Tve : T; + + /*--- Compute the collisional cross section (omega_ij) ---*/ + const su2double Omega_ij = ComputeCollisionCrossSection(iSpecies, jSpecies, T_col, true, coulomb) / PI_NUMBER; - /*--- Calculate the Omega^(0,0)_ij collision cross section ---*/ - Omega_ij = 1E-20/PI_NUMBER * Omega00(iSpecies,jSpecies,3) - * pow(T, Omega00(iSpecies,jSpecies,0)*log(T)*log(T) - + Omega00(iSpecies,jSpecies,1)*log(T) - + Omega00(iSpecies,jSpecies,2)); + /*--- Calculate and populate diffusion coefficients ---*/ Dij(iSpecies,jSpecies) = 7.1613E-25*M*sqrt(T*(1/Mi+1/Mj))/(Density*Omega_ij); Dij(jSpecies,iSpecies) = 7.1613E-25*M*sqrt(T*(1/Mi+1/Mj))/(Density*Omega_ij); } @@ -1744,7 +1810,7 @@ void CSU2TCLib::DiffusionCoeffWBE(){ /*--- Calculate species-mixture diffusion coefficient --*/ for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { DiffusionCoeff[iSpecies] = 0.0; - denom = 0.0; + su2double denom = 0.0; for (jSpecies = 0; jSpecies < nSpecies; jSpecies++) { if (jSpecies != iSpecies) { denom += MolarFracWBE[jSpecies]/Dij(iSpecies,jSpecies); @@ -1758,13 +1824,11 @@ void CSU2TCLib::DiffusionCoeffWBE(){ void CSU2TCLib::ViscosityWBE(){ - su2double tmp1, tmp2; - /*--- Calculate species mole fraction ---*/ su2double conc = 0.0; for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { MolarFracWBE[iSpecies] = rhos[iSpecies]/MolarMass[iSpecies]; - conc += MolarFracWBE[iSpecies]; + conc += MolarFracWBE[iSpecies]; } for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) MolarFracWBE[iSpecies] = MolarFracWBE[iSpecies]/conc; @@ -1778,8 +1842,8 @@ void CSU2TCLib::ViscosityWBE(){ for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { phis[iSpecies] = 0.0; for (jSpecies = 0; jSpecies < nSpecies; jSpecies++) { - tmp1 = 1.0 + sqrt(mus[iSpecies]/mus[jSpecies])*pow(MolarMass[jSpecies]/MolarMass[iSpecies], 0.25); - tmp2 = sqrt(8.0*(1.0+MolarMass[iSpecies]/MolarMass[jSpecies])); + const su2double tmp1 = 1.0 + sqrt(mus[iSpecies]/mus[jSpecies])*pow(MolarMass[jSpecies]/MolarMass[iSpecies], 0.25); + const su2double tmp2 = sqrt(8.0*(1.0+MolarMass[iSpecies]/MolarMass[jSpecies])); phis[iSpecies] += MolarFracWBE[jSpecies]*tmp1*tmp1/tmp2; } } @@ -1817,10 +1881,63 @@ void CSU2TCLib::ThermalConductivitiesWBE(){ ThermalConductivities[1] = ThermalCond_ve; } -void CSU2TCLib::DiffusionCoeffGY(){ +su2double CSU2TCLib::ComputeCollisionCrossSection(unsigned iSpecies, unsigned jSpecies, su2double T, bool d1, bool coulomb) { + + const su2double pi = PI_NUMBER; + const su2double Na = AVOGAD_CONSTANT; + + if (coulomb) { + + const su2double e_cgs = FUND_ELEC_CHARGE_CGS; // CGS unit of fundamental electric charge + const su2double kb_cgs = BOLTZMANN_CONSTANT * 1E7; // CGS unit of Boltzmann Constant + const su2double ne_cgs = Na * rhos[0] / MolarMass[0] * 1E-6; // CGS unit of electron number density + + const su2double debyeLength = sqrt(kb_cgs * T / 4 / pi / ne_cgs / pow(e_cgs,2)); + const su2double T_star = debyeLength / (pow(e_cgs,2) / (kb_cgs * T)); + + /*--- Compute the collisionion cross section ---*/ + // Note: Omega11 is used for diffusion, viscosity, translational, internal, and reaction components of + // thermal conductivity + // Omega22 is used for viscosity and translational components of thermal conductivity + + if (Omega11(iSpecies, jSpecies, 0) == 1.0 && d1) { + return 1E-20 * 5E15 * pi * pow((debyeLength / T), 2) * log(D1_a*T_star*(1 - C1_a * exp(-c1_a * T_star))+1); + } if (Omega11(iSpecies, jSpecies, 0) == -1.0 && d1) { + return 1E-20 * 5E15 * pi * pow((debyeLength / T), 2) * log(D1_r*T_star*(1 - C1_r * exp(-c1_r * T_star))+1); + } else if (Omega22(iSpecies, jSpecies, 0) == 1.0 && !d1) { + return 1E-20 * 5E15 * pi * pow((debyeLength / T), 2) * log(D2_a*T_star*(1 - C2_a * exp(-c2_a * T_star))+1); + } else { + return 1E-20 * 5E15 * pi * pow((debyeLength / T), 2) * log(D2_r*T_star*(1 - C2_r * exp(-c2_r * T_star))+1); + } + + } else { + if (d1) { + return 1E-20 * Omega11(iSpecies,jSpecies,3) * pow(T, Omega11(iSpecies,jSpecies,0)*log(T)*log(T) + Omega11(iSpecies,jSpecies,1)*log(T) + Omega11(iSpecies,jSpecies,2)); + } return 1E-20 * Omega22(iSpecies,jSpecies,3) * pow(T, Omega22(iSpecies,jSpecies,0)*log(T)*log(T) + Omega22(iSpecies,jSpecies,1)*log(T) + Omega22(iSpecies,jSpecies,2)); + + } +} + +su2double CSU2TCLib::ComputeCollisionDelta(unsigned iSpecies, unsigned jSpecies, su2double Mi, su2double Mj, su2double T, bool d1) { - su2double pi = PI_NUMBER; - su2double kb = BOLTZMANN_CONSTANT; + bool coulomb = false; + if (abs(Omega11(iSpecies, jSpecies, 0)) == 1.0 && ionization) { + coulomb = true; + } + + const su2double Omega_ij = ComputeCollisionCrossSection(iSpecies, jSpecies, T, d1, coulomb); + const su2double pi = PI_NUMBER; + su2double delta = 0.0; + + if (d1) { + delta = 8.0/3.0 * sqrt((2.0*Mi*Mj) / (pi*Ru*T*(Mi+Mj))) * Omega_ij; // d1_ij + } else { + delta = 16.0/5.0 * sqrt((2.0*Mi*Mj) / (pi*Ru*T*(Mi+Mj))) * Omega_ij; // d2_ij + } + return fmin(delta, 1E16); +} + +void CSU2TCLib::DiffusionCoeffGY(){ /*--- Calculate mixture gas constant ---*/ su2double gam_t = 0.0; @@ -1829,227 +1946,130 @@ void CSU2TCLib::DiffusionCoeffGY(){ } /*--- Mixture thermal conductivity via Gupta-Yos approximation ---*/ - for (iSpecies = 0; iSpecies < nHeavy; iSpecies++) { + for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { /*--- Initialize the species diffusion coefficient ---*/ DiffusionCoeff[iSpecies] = 0.0; /*--- Calculate molar concentration ---*/ - su2double Mi = MolarMass[iSpecies]; - su2double gam_i = rhos[iSpecies] / (Density*Mi); + const su2double Mi = (MolarMass[iSpecies] + EPS); + const su2double gam_i = rhos[iSpecies] / (Density*Mi); su2double denom = 0.0; - for (jSpecies = 0; jSpecies < nHeavy; jSpecies++) { - if (jSpecies != iSpecies) { - su2double Mj = MolarMass[jSpecies]; - su2double gam_j = rhos[iSpecies] / (Density*Mj); + for (jSpecies = 0; jSpecies < nSpecies; jSpecies++) { + if (jSpecies != iSpecies) { + + const su2double Mj = (MolarMass[jSpecies] + EPS); + const su2double gam_j = rhos[jSpecies] / (Density*Mj); - /*--- Calculate the Omega^(0,0)_ij collision cross section ---*/ - su2double Omega_ij = 1E-20 * Omega00(iSpecies,jSpecies,3) - * pow(T, Omega00(iSpecies,jSpecies,0)*log(T)*log(T) - + Omega00(iSpecies,jSpecies,1)*log(T) - + Omega00(iSpecies,jSpecies,2)); - /*--- Calculate "delta1_ij" ---*/ - su2double d1_ij = 8.0/3.0 * sqrt((2.0*Mi*Mj) / (pi*Ru*T*(Mi+Mj))) * Omega_ij; + const su2double kb = BOLTZMANN_CONSTANT; - /*--- Calculate heavy-particle binary diffusion coefficient ---*/ - su2double D_ij = kb*T/(Pressure*d1_ij); + const su2double T_col = (iSpecies == 0 && ionization) ? Tve : T; + + su2double d1_ij = ComputeCollisionDelta(iSpecies, jSpecies, Mi, Mj, T_col, true); + + const su2double D_ij = kb*T_col/(Pressure*d1_ij); denom += gam_j/D_ij; } } - //if (ionization) { - //TODO UPDATE WITH PROPER iElectron value..... - // jSpecies = nSpecies-1; - // su2double Mj = MolarMass[jSpecies]; - // su2double gam_j = rhos[iSpecies] / (Density*Mj); - - /*--- Calculate the Omega^(0,0)_ij collision cross section ---*/ - // su2double Omega_ij = 1E-20 * Omega00(iSpecies,jSpecies,3) - // * pow(Tve, Omega00(iSpecies,jSpecies,0)*log(Tve)*log(Tve) - // + Omega00(iSpecies,jSpecies,1)*log(Tve) - // + Omega00(iSpecies,jSpecies,2)); - - // /*--- Calculate "delta1_ij" ---*/ - // su2double d1_ij = 8.0/3.0 * sqrt((2.0*Mi*Mj) / (pi*Ru*Tve*(Mi+Mj))) * Omega_ij; - //} - - /*--- Assign species diffusion coefficient ---*/ - DiffusionCoeff[iSpecies] = (denom > EPS) ? (gam_t*gam_t*Mi*(1-Mi*gam_i) / denom) : su2double(0.0); + /*--- Calculate species diffusion coefficient ---*/ + DiffusionCoeff[iSpecies] = (gam_t*gam_t*Mi*(1-Mi*gam_i) / denom); } - // if (ionization) { - //TODO: Update correct iElectron.... - // iSpecies = nSpecies-1; - - // /*--- Initialize the species diffusion coefficient ---*/ - // DiffusionCoeff[iSpecies] = 0.0; - - // /*--- Calculate molar concentration ---*/ - // Mi = MolarMass[iSpecies]; - // gam_i = rhos[iSpecies] / (Density*Mi); - // denom = 0.0; - // for (jSpecies = 0; jSpecies < nHeavy; jSpecies++) { - // if (iSpecies != jSpecies) { - // Mj = MolarMass[jSpecies]; - // gam_j = rhos[iSpecies] / (Density*Mj); - - // /*--- Calculate the Omega^(0,0)_ij collision cross section ---*/ - // Omega_ij = 1E-20 * Omega00(iSpecies,jSpecies,3) - // * pow(Tve, Omega00(iSpecies,jSpecies,0)*log(Tve)*log(Tve) - // + Omega00(iSpecies,jSpecies,1)*log(Tve) - // + Omega00(iSpecies,jSpecies,2)); - - // /*--- Calculate "delta1_ij" ---*/ - // d1_ij = 8.0/3.0 * sqrt((2.0*Mi*Mj) / (pi*Ru*Tve*(Mi+Mj))) * Omega_ij; - - // /*--- Calculate heavy-particle binary diffusion coefficient ---*/ - // D_ij = kb*Tve/(Pressure*d1_ij); - // denom += gam_j/D_ij; - // } - // } - // DiffusionCoeff[iSpecies] = gam_t*gam_t*MolarMass[iSpecies]*(1-MolarMass[iSpecies]*gam_i) / denom; - // } } void CSU2TCLib::ViscosityGY(){ - su2double pi = PI_NUMBER; - su2double Na = AVOGAD_CONSTANT; - su2double Mu = 0.0; + const su2double Na = AVOGAD_CONSTANT; + Mu = 0.0; /*--- Mixture viscosity via Gupta-Yos approximation ---*/ - for (iSpecies = 0; iSpecies < nHeavy; iSpecies++) { + for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { su2double denom = 0.0; /*--- Calculate molar concentration ---*/ - su2double Mi = MolarMass[iSpecies]; - su2double gam_i = rhos[iSpecies] / (Density*Mi); + const su2double Mi = (MolarMass[iSpecies] + EPS); + const su2double gam_i = rhos[iSpecies] / (Density*Mi); - for (jSpecies = 0; jSpecies < nHeavy; jSpecies++) { - su2double Mj = MolarMass[jSpecies]; - su2double gam_j = rhos[jSpecies] / (Density*Mj); + for (jSpecies = 0; jSpecies < nSpecies; jSpecies++) { + const su2double Mj = (MolarMass[jSpecies] + EPS); + const su2double gam_j = rhos[jSpecies] / (Density*Mj); - /*--- Calculate "delta" quantities ---*/ - su2double Omega_ij = 1E-20 * Omega11(iSpecies,jSpecies,3) - * pow(T, Omega11(iSpecies,jSpecies,0)*log(T)*log(T) - + Omega11(iSpecies,jSpecies,1)*log(T) - + Omega11(iSpecies,jSpecies,2)); - su2double d2_ij = 16.0/5.0 * sqrt((2.0*Mi*Mj) / (pi*Ru*T*(Mi+Mj))) * Omega_ij; + const su2double T_col = (iSpecies == 0 && ionization) ? Tve : T; + + su2double d2_ij = ComputeCollisionDelta(iSpecies, jSpecies, Mi, Mj, T_col, false); - /*--- Add to denominator of viscosity ---*/ - denom += gam_j*d2_ij; - } - if (ionization) { - jSpecies = nSpecies-1; - su2double Mj = MolarMass[jSpecies]; - su2double gam_j = rhos[jSpecies] / (Density*Mj); - - /*--- Calculate "delta" quantities ---*/ - su2double Omega_ij = 1E-20 * Omega11(iSpecies,jSpecies,3) - * pow(Tve, Omega11(iSpecies,jSpecies,0)*log(Tve)*log(Tve) - + Omega11(iSpecies,jSpecies,1)*log(Tve) - + Omega11(iSpecies,jSpecies,2)); - su2double d2_ij = 16.0/5.0 * sqrt((2.0*Mi*Mj) / (pi*Ru*Tve*(Mi+Mj))) * Omega_ij; denom += gam_j*d2_ij; } - /*--- Calculate species laminar viscosity ---*/ Mu += (Mi/Na * gam_i) / denom; } - // if (ionization) { - //TODO iElectron value!!!! - // iSpecies = nSpecies-1; - // denom = 0.0; - // /*--- Calculate molar concentration ---*/ - // Mi = MolarMass[iSpecies]; - // gam_i = rhos[iSpecies] / (Density*Mi); - // for (jSpecies = 0; jSpecies < nSpecies; jSpecies++) { - // Mj = MolarMass[jSpecies]; - // gam_j = rhos[jSpecies] / (Density*Mj); - // /*--- Calculate "delta" quantities ---*/ - // Omega_ij = 1E-20 * Omega11(iSpecies,jSpecies,3) - // * pow(Tve, Omega11(iSpecies,jSpecies,0)*log(Tve)*log(Tve) - // + Omega11(iSpecies,jSpecies,1)*log(Tve) - // + Omega11(iSpecies,jSpecies,2)); - // d2_ij = 16.0/5.0 * sqrt((2.0*Mi*Mj) / (pi*Ru*Tve*(Mi+Mj))) * Omega_ij; - // /*--- Add to denominator of viscosity ---*/ - // denom += gam_j*d2_ij; - // } - // Mu += (Mi/Na * gam_i) / denom; - // } } void CSU2TCLib::ThermalConductivitiesGY(){ - su2double Mi, Mj, mi, mj, gam_i, gam_j, denom_t, denom_r, d1_ij, d2_ij, a_ij, Omega_ij; - - su2double pi = PI_NUMBER; - su2double Na = AVOGAD_CONSTANT; - su2double kb = BOLTZMANN_CONSTANT; - - if (ionization) { - SU2_MPI::Error("NEEDS REVISION w/ IONIZATION",CURRENT_FUNCTION); - } + const su2double Na = AVOGAD_CONSTANT; + const su2double kb = BOLTZMANN_CONSTANT; /*--- Mixture vibrational-electronic specific heat ---*/ - Cvves = ComputeSpeciesCvVibEle(Tve); + const auto Cvves = ComputeSpeciesCvVibEle(Tve); su2double rhoCvve = 0.0; for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) rhoCvve += rhos[iSpecies]*Cvves[iSpecies]; - su2double Cvve = rhoCvve/Density; + const su2double Cvve = rhoCvve/Density; /*--- Calculate mixture gas constant ---*/ su2double R = 0.0; for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { - R += Ru * rhos[iSpecies]/Density; + R += Ru / MolarMass[iSpecies] * rhos[iSpecies]/Density; } /*--- Mixture thermal conductivity via Gupta-Yos approximation ---*/ - ThermalCond_tr = 0.0; - ThermalCond_ve = 0.0; + su2double ThermalCond_tr = 0.0; + su2double ThermalCond_ve = 0.0; for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { /*--- Calculate molar concentration ---*/ - Mi = MolarMass[iSpecies]; - mi = Mi/Na; - gam_i = rhos[iSpecies] / (Density*Mi); - denom_t = 0.0; - denom_r = 0.0; + const su2double Mi = (MolarMass[iSpecies] + EPS); + const su2double mi = Mi/Na; + const su2double gam_i = rhos[iSpecies] / (Density*Mi); + su2double denom_t = 0.0; + su2double denom_r = 0.0; + su2double denom_re = 0.0; + for (jSpecies = 0; jSpecies < nSpecies; jSpecies++) { - Mj = MolarMass[jSpecies]; - mj = Mj/Na; - gam_j = rhos[iSpecies] / (Density*Mj); - a_ij = 1.0 + (1.0 - mi/mj)*(0.45 - 2.54*mi/mj) / ((1.0 + mi/mj)*(1.0 + mi/mj)); + const su2double Mj = (MolarMass[jSpecies] + EPS); + const su2double mj = Mj/Na; + const su2double gam_j = rhos[iSpecies] / (Density*Mj); + const su2double a_ij = 1.0 + (1.0 - mi/mj)*(0.45 - 2.54*mi/mj) / ((1.0 + mi/mj)*(1.0 + mi/mj)); - /*--- Calculate the Omega^(0,0)_ij collision cross section ---*/ - Omega_ij = 1E-20 * Omega00(iSpecies,jSpecies,3) - * pow(T, Omega00(iSpecies,jSpecies,0)*log(T)*log(T) - + Omega00(iSpecies,jSpecies,1)*log(T) - + Omega00(iSpecies,jSpecies,2)); + const su2double T_col = ((iSpecies == 0 && ionization) || (jSpecies == 0 && ionization)) ? Tve : T; - /*--- Calculate "delta1_ij" ---*/ - d1_ij = 8.0/3.0 * sqrt((2.0*Mi*Mj) / (pi*Ru*T*(Mi+Mj))) * Omega_ij; + su2double d1_ij = ComputeCollisionDelta(iSpecies, jSpecies, Mi, Mj, T_col, true); + su2double d2_ij = ComputeCollisionDelta(iSpecies, jSpecies, Mi, Mj, T_col, false); + + if (jSpecies == 0 && ionization) { denom_t += 3.54*gam_j*d2_ij; } + else { denom_t += a_ij*gam_j*d2_ij; } - /*--- Calculate the Omega^(1,1)_ij collision cross section ---*/ - Omega_ij = 1E-20 * Omega11(iSpecies,jSpecies,3) - * pow(T, Omega11(iSpecies,jSpecies,0)*log(T)*log(T) - + Omega11(iSpecies,jSpecies,1)*log(T) - + Omega11(iSpecies,jSpecies,2)); - - /*--- Calculate "delta2_ij" ---*/ - d2_ij = 16.0/5.0 * sqrt((2.0*Mi*Mj) / (pi*Ru*T*(Mi+Mj))) * Omega_ij; - denom_t += a_ij*gam_j*d2_ij; denom_r += gam_j*d1_ij; + denom_re += gam_j*d2_ij; } - /*--- Translational contribution to thermal conductivity ---*/ - ThermalCond_tr += (denom_t > EPS) ? ((15.0/4.0)*kb*gam_i/denom_t) : su2double(0.0); + /*--- Prevent divide by 0 ---*/ + if (denom_t <= 0.0) denom_t = EPS; + if (denom_r <= 0.0) denom_r = EPS; + if (denom_re <= 0.0) denom_re = EPS; /*--- Translational contribution to thermal conductivity ---*/ - if (RotationModes[iSpecies] != 0.0) ThermalCond_tr += (denom_r > EPS) ? (kb*gam_i/denom_r) : su2double(0.0); + if (!ionization || iSpecies != 0) ThermalCond_tr += ((15.0/4.0)*kb*gam_i/denom_t); + + /*--- Rotational contribution to thermal conductivity ---*/ + if (RotationModes[iSpecies] != 0.0) ThermalCond_tr += (kb*gam_i/denom_r); /*--- Vibrational-electronic contribution to thermal conductivity ---*/ - ThermalCond_ve += (denom_r > EPS) ? (kb*Cvve/R*gam_i / denom_r) : su2double(0.0); + if ((!ionization || iSpecies != 0) && RotationModes[iSpecies] != 0.0) ThermalCond_ve += (kb*Cvve/R*gam_i / denom_r); + + if (ionization && iSpecies == 0) ThermalCond_ve += ((15.0/4.0)*kb*gam_i/(1.45*denom_re)); } ThermalConductivities[0] = ThermalCond_tr; @@ -2062,7 +2082,6 @@ void CSU2TCLib::ViscositySuth(){ /*--- Calculate mixture laminar viscosity ---*/ Mu = mu_ref[0] * T_nd * sqrt(T_nd) * ((T_ref_suth + Sm_ref[0]) / (T + Sm_ref[0])); - } void CSU2TCLib::ThermalConductivitiesSuth(){ @@ -2085,7 +2104,6 @@ void CSU2TCLib::ThermalConductivitiesSuth(){ ThermalConductivities[0] = k; ThermalConductivities[1] = kve; - } vector& CSU2TCLib::ComputeTemperatures(vector& val_rhos, su2double rhoE, su2double rhoEve, su2double rhoEvel, su2double Tve_old) { @@ -2117,8 +2135,8 @@ vector& CSU2TCLib::ComputeTemperatures(vector& val_rhos, s /*--- Set vibrational temperature algorithm parameters ---*/ const su2double NRtol = 1.0E-6; // Tolerance for the Newton-Raphson method const su2double Btol = 1.0E-6; // Tolerance for the Bisection method - const unsigned short maxBIter = 50; // Maximum Bisection method iterations - const unsigned short maxNIter = 50; // Maximum Newton-Raphson iterations + const unsigned short maxBIter = 100; // Maximum Bisection method iterations + const unsigned short maxNIter = 100; // Maximum Newton-Raphson iterations const su2double scale = 0.9; // Scaling factor for Newton-Raphson step /*--- Execute a Newton-Raphson root-finding method for Tve ---*/ @@ -2150,9 +2168,8 @@ vector& CSU2TCLib::ComputeTemperatures(vector& val_rhos, s NRconvg = true; Tve = Tve2; break; - } else { - Tve = Tve2; - } + } Tve = Tve2; + } // If the Newton-Raphson method has converged, assign the value of Tve. @@ -2167,24 +2184,21 @@ vector& CSU2TCLib::ComputeTemperatures(vector& val_rhos, s if (fabs(rhoEve_t - rhoEve) < Btol) { Bconvg = true; break; - } else { - if (rhoEve_t > rhoEve) Tve2 = Tve; + } if (rhoEve_t > rhoEve) Tve2 = Tve; else Tve_o = Tve; - } + } } // If absolutely no convergence, then assign to the TR temperature if (!NRconvg && !Bconvg ) { Tve = T; - cout <<"Warning: temperatures did not converge, error= "<< fabs(rhoEve_t-rhoEve)<BC_Custom(geometry, solver_container, conv_bound_numerics, visc_bound_numerics, config, iMarker); break; case CHT_WALL_INTERFACE: - if ((MainSolver == HEAT_SOL) || ((MainSolver == FLOW_SOL) && ((config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) || config->GetEnergy_Equation()))) { + + if ( MainSolver == FLOW_SOL && (config->GetKind_FluidModel() == FLUID_FLAMELET) ){ + solver_container[MainSolver]->BC_Isothermal_Wall(geometry, solver_container, conv_bound_numerics, visc_bound_numerics, config, iMarker); + break; + } + if ((MainSolver == SPECIES_SOL) || (MainSolver == HEAT_SOL) || ((MainSolver == FLOW_SOL) && ((config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) || config->GetEnergy_Equation()))) { solver_container[MainSolver]->BC_ConjugateHeat_Interface(geometry, solver_container, conv_bound_numerics, config, iMarker); } else { diff --git a/SU2_CFD/src/integration/CIntegrationFactory.cpp b/SU2_CFD/src/integration/CIntegrationFactory.cpp index d9fe95cfa40..9352b75b98c 100644 --- a/SU2_CFD/src/integration/CIntegrationFactory.cpp +++ b/SU2_CFD/src/integration/CIntegrationFactory.cpp @@ -2,7 +2,7 @@ * \file CIntegrationFactory.cpp * \brief Main subroutines for CIntegrationFactory . * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -35,7 +35,7 @@ CIntegration** CIntegrationFactory::CreateIntegrationContainer(MAIN_SOLVER kindMainSolver, const CSolver* const* solver_container){ - CIntegration **integration = new CIntegration* [MAX_SOLS](); + auto **integration = new CIntegration* [MAX_SOLS](); for (unsigned int iSol = 0; iSol < MAX_SOLS; iSol++){ if (solver_container[iSol] != nullptr){ diff --git a/SU2_CFD/src/integration/CMultiGridIntegration.cpp b/SU2_CFD/src/integration/CMultiGridIntegration.cpp index 36c75cb525f..8f5b4f01de8 100644 --- a/SU2_CFD/src/integration/CMultiGridIntegration.cpp +++ b/SU2_CFD/src/integration/CMultiGridIntegration.cpp @@ -2,7 +2,7 @@ * \file CMultiGridIntegration.cpp * \brief Implementation of the multigrid integration class. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -83,6 +83,9 @@ void CMultiGridIntegration::MultiGrid_Iteration(CGeometry ****geometry, unsigned short FinestMesh = config[iZone]->GetFinestMesh(); + /// TODO: This was always false. + const bool Convergence_FullMG = false; + if (!config[iZone]->GetRestart() && FullMG && direct && ( Convergence_FullMG && (FinestMesh != MESH_0 ))) { SetProlongated_Solution(RunTime_EqSystem, @@ -311,7 +314,7 @@ void CMultiGridIntegration::GetProlongated_Correction(unsigned short RunTime_EqS const unsigned short nVar = sol_coarse->GetnVar(); - su2double *Solution = new su2double[nVar]; + auto *Solution = new su2double[nVar]; SU2_OMP_FOR_STAT(roundUpDiv(geo_coarse->GetnPointDomain(), omp_get_num_threads())) for (Point_Coarse = 0; Point_Coarse < geo_coarse->GetnPointDomain(); Point_Coarse++) { @@ -506,7 +509,7 @@ void CMultiGridIntegration::SetForcing_Term(CSolver *sol_fine, CSolver *sol_coar const unsigned short nVar = sol_coarse->GetnVar(); su2double factor = config->GetDamp_Res_Restric(); - su2double *Residual = new su2double[nVar]; + auto *Residual = new su2double[nVar]; SU2_OMP_FOR_STAT(roundUpDiv(geo_coarse->GetnPointDomain(), omp_get_num_threads())) for (Point_Coarse = 0; Point_Coarse < geo_coarse->GetnPointDomain(); Point_Coarse++) { @@ -619,7 +622,7 @@ void CMultiGridIntegration::SetRestricted_Gradient(unsigned short RunTime_EqSyst const unsigned short nDim = geo_coarse->GetnDim(); const unsigned short nVar = sol_coarse->GetnVar(); - su2double **Gradient = new su2double* [nVar]; + auto **Gradient = new su2double* [nVar]; for (iVar = 0; iVar < nVar; iVar++) Gradient[iVar] = new su2double [nDim]; diff --git a/SU2_CFD/src/integration/CNewtonIntegration.cpp b/SU2_CFD/src/integration/CNewtonIntegration.cpp index 78fd23b2d66..69aaa4d1883 100644 --- a/SU2_CFD/src/integration/CNewtonIntegration.cpp +++ b/SU2_CFD/src/integration/CNewtonIntegration.cpp @@ -2,7 +2,7 @@ * \file CNewtonIntegration.cpp * \brief Newton-Krylov integration. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/integration/CSingleGridIntegration.cpp b/SU2_CFD/src/integration/CSingleGridIntegration.cpp index e43b4518c26..f31493cddb5 100644 --- a/SU2_CFD/src/integration/CSingleGridIntegration.cpp +++ b/SU2_CFD/src/integration/CSingleGridIntegration.cpp @@ -2,7 +2,7 @@ * \file CSingleGridIntegration.cpp * \brief Single (fine) grid integration class implementation. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/integration/CStructuralIntegration.cpp b/SU2_CFD/src/integration/CStructuralIntegration.cpp index 1dd5573923c..c4a6dd10405 100644 --- a/SU2_CFD/src/integration/CStructuralIntegration.cpp +++ b/SU2_CFD/src/integration/CStructuralIntegration.cpp @@ -2,7 +2,7 @@ * \file CStructuralIntegration.cpp * \brief Space and time integration for structural problems. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -134,9 +134,6 @@ void CStructuralIntegration::Time_Integration_FEM(CGeometry *geometry, CSolver * /*--- Set the Jacobian according to the different time integration methods ---*/ switch (config->GetKind_TimeIntScheme_FEA()) { - case (STRUCT_TIME_INT::CD_EXPLICIT): - solver_container[MainSolver]->ImplicitNewmark_Iteration(geometry, numerics, config); - break; case (STRUCT_TIME_INT::NEWMARK_IMPLICIT): solver_container[MainSolver]->ImplicitNewmark_Iteration(geometry, numerics, config); break; @@ -161,16 +158,13 @@ void CStructuralIntegration::Time_Integration_FEM(CGeometry *geometry, CSolver * } } - /*--- Solver linear system ---*/ + /*--- Solve linear system ---*/ solver_container[MainSolver]->Solve_System(geometry, config); /*--- Update solution ---*/ switch (config->GetKind_TimeIntScheme_FEA()) { - case (STRUCT_TIME_INT::CD_EXPLICIT): - solver_container[MainSolver]->ImplicitNewmark_Update(geometry, config); - break; case (STRUCT_TIME_INT::NEWMARK_IMPLICIT): solver_container[MainSolver]->ImplicitNewmark_Update(geometry, config); break; @@ -193,15 +187,13 @@ void CStructuralIntegration::Time_Integration_FEM(CGeometry *geometry, CSolver * void CStructuralIntegration::SetDualTime_Solver(const CGeometry *geometry, CSolver *solver, const CConfig *config, unsigned short iMesh) { - bool fsi = config->GetFSI_Simulation(); + const bool fsi = config->GetFSI_Simulation(); /*--- Update the solution according to the integration scheme used ---*/ switch (config->GetKind_TimeIntScheme_FEA()) { - case (STRUCT_TIME_INT::CD_EXPLICIT): - break; case (STRUCT_TIME_INT::NEWMARK_IMPLICIT): - if (fsi) solver->ImplicitNewmark_Relaxation(geometry, config); + if (fsi && config->GetRelaxation()) solver->ImplicitNewmark_Relaxation(geometry, config); break; case (STRUCT_TIME_INT::GENERALIZED_ALPHA): solver->GeneralizedAlpha_UpdateSolution(geometry, config); @@ -215,12 +207,5 @@ void CStructuralIntegration::SetDualTime_Solver(const CGeometry *geometry, CSolv /*--- If FSI problem, save the last Aitken relaxation parameter of the previous time step ---*/ - if (fsi) { - - su2double WAitk=0.0; - - WAitk = solver->GetWAitken_Dyn(); - solver->SetWAitken_Dyn_tn1(WAitk); - - } + if (fsi) solver->SetWAitken_Dyn_tn1(); } diff --git a/SU2_CFD/src/interfaces/CInterface.cpp b/SU2_CFD/src/interfaces/CInterface.cpp index 1507e004c25..4d8d33b3ecf 100644 --- a/SU2_CFD/src/interfaces/CInterface.cpp +++ b/SU2_CFD/src/interfaces/CInterface.cpp @@ -2,7 +2,7 @@ * \file CInterface.cpp * \brief Main subroutines for MPI transfer of information between zones * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -31,7 +31,7 @@ #include "../../../Common/include/geometry/CGeometry.hpp" #include "../../include/solvers/CSolver.hpp" -CInterface::CInterface(void) : +CInterface::CInterface() : rank(SU2_MPI::GetRank()), size(SU2_MPI::GetSize()) { } @@ -49,7 +49,7 @@ CInterface::CInterface(unsigned short val_nVar, unsigned short val_nConst) : valAggregated = true; } -CInterface::~CInterface(void) { +CInterface::~CInterface() { delete [] Physical_Constants; delete [] Donor_Variable; @@ -227,11 +227,10 @@ void CInterface::PreprocessAverage(CGeometry *donor_geometry, CGeometry *target_ /*--- Exit the for loop: we have found the local index for Mixing-Plane interface ---*/ break; } - else { - /*--- If the tag hasn't matched any tag within the donor markers ---*/ + /*--- If the tag hasn't matched any tag within the donor markers ---*/ Marker_Donor = -1; Donor_Flag = -1; - } + } #ifdef HAVE_MPI @@ -273,10 +272,9 @@ void CInterface::PreprocessAverage(CGeometry *donor_geometry, CGeometry *target_ /*--- Exit the for loop: we have found the local index for iMarkerFSI on the FEA side ---*/ break; } - else { - /*--- If the tag hasn't matched any tag within the Flow markers ---*/ + /*--- If the tag hasn't matched any tag within the Flow markers ---*/ Marker_Target = -1; - } + } if (Marker_Target != -1 && Marker_Donor != -1){ @@ -343,9 +341,9 @@ void CInterface::AllgatherAverage(CSolver *donor_solution, CSolver *target_solut #ifdef HAVE_MPI int iSize; - su2double *BuffAvgPressureDonor = NULL, *BuffAvgDensityDonor = NULL, *BuffAvgNormalVelDonor = NULL, - *BuffAvg3DVelDonor = NULL, *BuffAvgTangVelDonor = NULL, *BuffAvgNuDonor = NULL, - *BuffAvgKineDonor = NULL, *BuffAvgOmegaDonor = NULL; + su2double *BuffAvgPressureDonor = nullptr, *BuffAvgDensityDonor = nullptr, *BuffAvgNormalVelDonor = nullptr, + *BuffAvg3DVelDonor = nullptr, *BuffAvgTangVelDonor = nullptr, *BuffAvgNuDonor = nullptr, + *BuffAvgKineDonor = nullptr, *BuffAvgOmegaDonor = nullptr; int nSpanSize, *BuffMarkerDonor; #endif @@ -418,10 +416,9 @@ void CInterface::AllgatherAverage(CSolver *donor_solution, CSolver *target_solut /*--- Exit the for loop: we have found the local index for Mixing-Plane interface ---*/ break; } - else { - /*--- If the tag hasn't matched any tag within the donor markers ---*/ + /*--- If the tag hasn't matched any tag within the donor markers ---*/ Marker_Donor = -1; - } + } /*--- Here we want to make available the quantities for all the processors and collect them in a buffer * for each span of the donor the span-wise height vector also so @@ -534,10 +531,9 @@ void CInterface::AllgatherAverage(CSolver *donor_solution, CSolver *target_solut /*--- Exit the for loop: we have found the local index for iMarkerFSI on the FEA side ---*/ break; } - else { - /*--- If the tag hasn't matched any tag within the Flow markers ---*/ + /*--- If the tag hasn't matched any tag within the Flow markers ---*/ Marker_Target = -1; - } + } diff --git a/SU2_CFD/src/interfaces/cfd/CConservativeVarsInterface.cpp b/SU2_CFD/src/interfaces/cfd/CConservativeVarsInterface.cpp index 31ca92974d4..85a4a72d4e7 100644 --- a/SU2_CFD/src/interfaces/cfd/CConservativeVarsInterface.cpp +++ b/SU2_CFD/src/interfaces/cfd/CConservativeVarsInterface.cpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer conservative variables * from a generic zone into another one. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/interfaces/cfd/CMixingPlaneInterface.cpp b/SU2_CFD/src/interfaces/cfd/CMixingPlaneInterface.cpp index ab7de26be09..76e7509edce 100644 --- a/SU2_CFD/src/interfaces/cfd/CMixingPlaneInterface.cpp +++ b/SU2_CFD/src/interfaces/cfd/CMixingPlaneInterface.cpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer average variables * needed for MixingPlane computation from a generic zone into another one. * \author S. Vitale - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/interfaces/cfd/CSlidingInterface.cpp b/SU2_CFD/src/interfaces/cfd/CSlidingInterface.cpp index 73a0144c9ee..5eb7437bdfd 100644 --- a/SU2_CFD/src/interfaces/cfd/CSlidingInterface.cpp +++ b/SU2_CFD/src/interfaces/cfd/CSlidingInterface.cpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer conservative variables * from a generic zone into another * \author G. Gori Politecnico di Milano - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp index 56fcea263e2..5aa6772907f 100644 --- a/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp +++ b/SU2_CFD/src/interfaces/cht/CConjugateHeatInterface.cpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer temperature and heatflux * density for conjugate heat interfaces between structure and fluid zones. * \author O. Burghardt - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -70,7 +70,8 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet su2double conductivity_over_dist = 0.0; const bool compressible_flow = (donor_config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); - const bool incompressible_flow = (donor_config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE) && donor_config->GetEnergy_Equation(); + const bool incompressible_flow = (donor_config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE) && + (donor_config->GetEnergy_Equation() || (donor_config->GetKind_FluidModel() == ENUM_FLUIDMODEL::FLUID_FLAMELET)); if (compressible_flow) { @@ -104,6 +105,7 @@ void CConjugateHeatInterface::GetDonor_Variable(CSolver *donor_solution, CGeomet switch (donor_config->GetKind_ConductivityModel()) { case CONDUCTIVITYMODEL::CONSTANT: + case CONDUCTIVITYMODEL::FLAMELET: case CONDUCTIVITYMODEL::COOLPROP: thermal_conductivity = thermal_conductivityND*donor_config->GetThermal_Conductivity_Ref(); break; diff --git a/SU2_CFD/src/interfaces/fsi/CDiscAdjFlowTractionInterface.cpp b/SU2_CFD/src/interfaces/fsi/CDiscAdjFlowTractionInterface.cpp index b8a48ae8fc4..84ddc14f79f 100644 --- a/SU2_CFD/src/interfaces/fsi/CDiscAdjFlowTractionInterface.cpp +++ b/SU2_CFD/src/interfaces/fsi/CDiscAdjFlowTractionInterface.cpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer flow tractions * from a fluid zone into a structural zone in a discrete adjoint simulation. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -40,11 +40,7 @@ void CDiscAdjFlowTractionInterface::GetPhysical_Constants(CSolver *flow_solution CGeometry *flow_geometry, CGeometry *struct_geometry, const CConfig *flow_config, const CConfig *struct_config){ - /*--- We have to clear the traction before applying it, because we are "adding" to node and not "setting" ---*/ - - struct_solution->GetNodes()->Clear_FlowTraction(); - - Preprocess(flow_config); + Preprocess(flow_config, struct_config, struct_geometry, struct_solution); if (!conservative) ComputeVertexAreas(struct_config, struct_geometry, struct_solution); diff --git a/SU2_CFD/src/interfaces/fsi/CDisplacementsInterface.cpp b/SU2_CFD/src/interfaces/fsi/CDisplacementsInterface.cpp index bea9e316c0f..d05fb1f55c0 100644 --- a/SU2_CFD/src/interfaces/fsi/CDisplacementsInterface.cpp +++ b/SU2_CFD/src/interfaces/fsi/CDisplacementsInterface.cpp @@ -2,7 +2,7 @@ * \file CDisplacementsInterface.cpp * \brief Main subroutines for transferring boundary displacements. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp b/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp index d95bb5a9841..f3ca34dcbe0 100644 --- a/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp +++ b/SU2_CFD/src/interfaces/fsi/CFlowTractionInterface.cpp @@ -3,7 +3,7 @@ * \brief Declaration and inlines of the class to transfer flow tractions * from a fluid zone into a structural zone. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -31,6 +31,7 @@ #include "../../../../Common/include/geometry/CGeometry.hpp" #include "../../../include/solvers/CSolver.hpp" #include "../../../../Common/include/toolboxes/geometry_toolbox.hpp" +#include "../../../Common/include/interface_interpolation/CInterpolator.hpp" #include CFlowTractionInterface::CFlowTractionInterface(unsigned short val_nVar, unsigned short val_nConst, @@ -39,7 +40,26 @@ CFlowTractionInterface::CFlowTractionInterface(unsigned short val_nVar, unsigned conservative(conservative_) { } -void CFlowTractionInterface::Preprocess(const CConfig *flow_config) { +void CFlowTractionInterface::Preprocess(const CConfig *flow_config, const CConfig *struct_config, + CGeometry *struct_geometry, CSolver *struct_solution) { + + /*--- Clear the tractions only on the markers involved in interface, fluid tractions + * on other markers can be specified via e.g. the python wrapper. ---*/ + + for (auto iMarkerInt = 0u; iMarkerInt < struct_config->GetMarker_n_ZoneInterface()/2; iMarkerInt++) { + const auto markDonor = flow_config->FindInterfaceMarker(iMarkerInt); + const auto markTarget = struct_config->FindInterfaceMarker(iMarkerInt); + + if(!CInterpolator::CheckInterfaceBoundary(markDonor, markTarget)) continue; + if (markTarget < 0) continue; + + for (auto iVertex = 0ul; iVertex < struct_geometry->GetnVertex(markTarget); iVertex++) { + const auto iPoint = struct_geometry->vertex[markTarget][iVertex]->GetNode(); + if (!struct_geometry->nodes->GetDomain(iPoint)) continue; + su2double zeros[3] = {}; + struct_solution->GetNodes()->Set_FlowTraction(iPoint, zeros); + } + } /*--- Compute the constant factor to dimensionalize pressure and shear stress. ---*/ const su2double *Velocity_ND, *Velocity_Real; @@ -121,18 +141,14 @@ void CFlowTractionInterface::GetPhysical_Constants(CSolver *flow_solution, CSolv CGeometry *flow_geometry, CGeometry *struct_geometry, const CConfig *flow_config, const CConfig *struct_config) { - /*--- We have to clear the traction before applying it, because we are "adding" to node and not "setting" ---*/ - - struct_solution->GetNodes()->Clear_FlowTraction(); - - Preprocess(flow_config); + Preprocess(flow_config, struct_config, struct_geometry, struct_solution); if (!conservative) ComputeVertexAreas(struct_config, struct_geometry, struct_solution); /*--- Apply a ramp to the transfer of the fluid loads ---*/ su2double ModAmpl = 0.0; - su2double CurrentTime = struct_config->GetCurrent_DynTime(); + su2double CurrentTime = struct_config->GetCurrent_UnstTime(); bool Ramp_Load = struct_config->GetRamp_Load(); su2double Ramp_Time = struct_config->GetRamp_Time(); diff --git a/SU2_CFD/src/iteration/CAdjFluidIteration.cpp b/SU2_CFD/src/iteration/CAdjFluidIteration.cpp index 282223b46ad..df2be8f0884 100644 --- a/SU2_CFD/src/iteration/CAdjFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CAdjFluidIteration.cpp @@ -2,7 +2,7 @@ * \file CAdjFluidIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -162,17 +162,13 @@ void CAdjFluidIteration::Update(COutput* output, CIntegration**** integration, C CSolver***** solver, CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement, CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst) { - su2double Physical_dt, Physical_t; - unsigned short iMesh; - unsigned long TimeIter = config[ZONE_0]->GetTimeIter(); - /*--- Dual time stepping strategy ---*/ if ((config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || (config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)) { /*--- Update dual time solver ---*/ - for (iMesh = 0; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { + for (unsigned short iMesh = 0; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { integration[val_iZone][val_iInst][ADJFLOW_SOL]->SetDualTime_Solver( geometry[val_iZone][val_iInst][iMesh], solver[val_iZone][val_iInst][iMesh][ADJFLOW_SOL], config[val_iZone], iMesh); @@ -180,13 +176,6 @@ void CAdjFluidIteration::Update(COutput* output, CIntegration**** integration, C integration[val_iZone][val_iInst][ADJFLOW_SOL]->SetDualTime_Geometry( geometry[val_iZone][val_iInst][iMesh], solver[val_iZone][val_iInst][iMesh][MESH_SOL], config[val_iZone], iMesh); - - integration[val_iZone][val_iInst][ADJFLOW_SOL]->SetConvergence(false); } - - Physical_dt = config[val_iZone]->GetDelta_UnstTime(); - Physical_t = (TimeIter + 1) * Physical_dt; - if (Physical_t >= config[val_iZone]->GetTotal_UnstTime()) - integration[val_iZone][val_iInst][ADJFLOW_SOL]->SetConvergence(true); } } diff --git a/SU2_CFD/src/iteration/CDiscAdjFEAIteration.cpp b/SU2_CFD/src/iteration/CDiscAdjFEAIteration.cpp index 83090a045fb..2887abf7d8c 100644 --- a/SU2_CFD/src/iteration/CDiscAdjFEAIteration.cpp +++ b/SU2_CFD/src/iteration/CDiscAdjFEAIteration.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjFEAIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -32,80 +32,62 @@ CDiscAdjFEAIteration::CDiscAdjFEAIteration(const CConfig *config) : CIteration(config), CurrentRecording(NONE) { fem_iteration = new CFEAIteration(config); - - // TEMPORARY output only for standalone structural problems - if ((!config->GetFSI_Simulation()) && (rank == MASTER_NODE)) { - bool de_effects = config->GetDE_Effects(); - unsigned short iVar; - - /*--- Header of the temporary output file ---*/ - ofstream myfile_res; - myfile_res.open("Results_Reverse_Adjoint.txt"); - - myfile_res << "Obj_Func" - << " "; - for (iVar = 0; iVar < config->GetnElasticityMod(); iVar++) myfile_res << "Sens_E_" << iVar << "\t"; - - for (iVar = 0; iVar < config->GetnPoissonRatio(); iVar++) myfile_res << "Sens_Nu_" << iVar << "\t"; - - if (config->GetTime_Domain()) { - for (iVar = 0; iVar < config->GetnMaterialDensity(); iVar++) myfile_res << "Sens_Rho_" << iVar << "\t"; - } - - if (de_effects) { - for (iVar = 0; iVar < config->GetnElectric_Field(); iVar++) myfile_res << "Sens_EField_" << iVar << "\t"; - } - - myfile_res << endl; - - myfile_res.close(); - } } -CDiscAdjFEAIteration::~CDiscAdjFEAIteration(void) {} +CDiscAdjFEAIteration::~CDiscAdjFEAIteration() = default; void CDiscAdjFEAIteration::Preprocess(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver, CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement, CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short iZone, unsigned short iInst) { - unsigned long iPoint; auto solvers0 = solver[iZone][iInst][MESH_0]; auto geometry0 = geometry[iZone][iInst][MESH_0]; auto dirNodes = solvers0[FEA_SOL]->GetNodes(); auto adjNodes = solvers0[ADJFEA_SOL]->GetNodes(); - /*--- For the dynamic adjoint, load direct solutions from restart files. ---*/ + auto StoreDirectSolution = [&]() { + for (auto iPoint = 0ul; iPoint < geometry0->GetnPoint(); iPoint++) { + adjNodes->SetSolution_Direct(iPoint, dirNodes->GetSolution(iPoint)); + } + }; + + /*--- For the dynamic adjoint, load direct solutions from restart files. + * For steady, store the direct solution to be able to reset it later. ---*/ if (config[iZone]->GetTime_Domain()) { const int TimeIter = config[iZone]->GetTimeIter(); const int Direct_Iter = SU2_TYPE::Int(config[iZone]->GetUnst_AdjointIter()) - TimeIter - 1; - /*--- We want to load the already converged solution at timesteps n and n-1 ---*/ - - /*--- Load solution at timestep n-1 ---*/ + /*--- We need the already converged solution at timesteps n and n-1. On the first + * adjoint time step we load both, then n-1 becomes "n" and we only load n-2. ---*/ - LoadDynamic_Solution(geometry, solver, config, iZone, iInst, Direct_Iter - 1); + if (TimeIter > 0) { + /*--- Save n-1 to become n. ---*/ + for (auto iPoint = 0ul; iPoint < geometry0->GetnPoint(); iPoint++) { + adjNodes->SetSolution_Direct(iPoint, dirNodes->GetSolution_time_n(iPoint)); + } + } - /*--- Push solution back to correct array ---*/ + /*--- Load solution at timestep n-1 and push back to correct array. ---*/ + LoadDynamic_Solution(geometry, solver, config, iZone, iInst, Direct_Iter - 1); dirNodes->Set_Solution_time_n(); - /*--- Load solution timestep n ---*/ + /*--- Load or set solution at timestep n. ---*/ - LoadDynamic_Solution(geometry, solver, config, iZone, iInst, Direct_Iter); - - /*--- Store FEA solution also in the adjoint solver in order to be able to reset it later ---*/ - - for (iPoint = 0; iPoint < geometry0->GetnPoint(); iPoint++) { - adjNodes->SetSolution_Direct(iPoint, dirNodes->GetSolution(iPoint)); + if (TimeIter == 0) { + LoadDynamic_Solution(geometry, solver, config, iZone, iInst, Direct_Iter); + StoreDirectSolution(); + } else { + /*--- Set n-1 as n. ---*/ + for (auto iPoint = 0ul; iPoint < geometry0->GetnPoint(); iPoint++) + for (auto iVar = 0u; iVar < solvers0[ADJFEA_SOL]->GetnVar(); iVar++) + dirNodes->SetSolution(iPoint, iVar, adjNodes->GetSolution_Direct(iPoint)[iVar]); } } else { - /*--- Store FEA solution also in the adjoint solver in order to be able to reset it later ---*/ - - for (iPoint = 0; iPoint < geometry0->GetnPoint(); iPoint++) { - adjNodes->SetSolution_Direct(iPoint, dirNodes->GetSolution(iPoint)); - } + /*--- Steady. ---*/ + StoreDirectSolution(); } solvers0[ADJFEA_SOL]->Preprocessing(geometry0, solvers0, config[iZone], MESH_0, 0, RUNTIME_ADJFEA_SYS, false); @@ -115,27 +97,19 @@ void CDiscAdjFEAIteration::Preprocess(COutput* output, CIntegration**** integrat void CDiscAdjFEAIteration::LoadDynamic_Solution(CGeometry**** geometry, CSolver***** solver, CConfig** config, unsigned short iZone, unsigned short iInst, int val_DirectIter) { - unsigned short iVar; - unsigned long iPoint; - bool update_geo = false; // TODO: check + /*--- Set to false to prevent updating Solution_time_n when loading primal solutions of unsteady cases. ---*/ + const bool update_geo = false; + auto*** solvers = solver[iZone][iInst]; if (val_DirectIter >= 0) { if (rank == MASTER_NODE && iZone == ZONE_0) - cout << " Loading FEA solution from direct iteration " << val_DirectIter << "." << endl; - solver[iZone][iInst][MESH_0][FEA_SOL]->LoadRestart( - geometry[iZone][iInst], solver[iZone][iInst], config[iZone], val_DirectIter, update_geo); + cout << " Loading FEA solution from direct iteration " << val_DirectIter << ".\n"; + solvers[MESH_0][FEA_SOL]->LoadRestart(geometry[iZone][iInst], solvers, config[iZone], val_DirectIter, update_geo); } else { - /*--- If there is no solution file we set the freestream condition ---*/ + /*--- If there is no solution file we set the initial conditions. ---*/ if (rank == MASTER_NODE && iZone == ZONE_0) - cout << " Setting static conditions at direct iteration " << val_DirectIter << "." << endl; - /*--- Push solution back to correct array ---*/ - for (iPoint = 0; iPoint < geometry[iZone][iInst][MESH_0]->GetnPoint(); iPoint++) { - for (iVar = 0; iVar < solver[iZone][iInst][MESH_0][FEA_SOL]->GetnVar(); iVar++) { - solver[iZone][iInst][MESH_0][FEA_SOL]->GetNodes()->SetSolution(iPoint, iVar, 0.0); - solver[iZone][iInst][MESH_0][FEA_SOL]->GetNodes()->SetSolution_Accel(iPoint, iVar, 0.0); - solver[iZone][iInst][MESH_0][FEA_SOL]->GetNodes()->SetSolution_Vel(iPoint, iVar, 0.0); - } - } + cout << " Setting static conditions at direct iteration " << val_DirectIter << ".\n"; + solvers[MESH_0][FEA_SOL]->SetInitialCondition(geometry[iZone][iInst], solvers, config[iZone], val_DirectIter); } } @@ -196,7 +170,7 @@ void CDiscAdjFEAIteration::SetDependencies(CSolver***** solver, CGeometry**** ge const int mat_knowles = MAT_KNOWLES+offset; const int de_term = DE_TERM+offset; - for (unsigned short iProp = 0; iProp < config[iZone]->GetnElasticityMod(); iProp++) { + for (unsigned short iProp = 0; iProp < config[iZone]->GetnElasticityMat(); iProp++) { su2double E = adj_solver->GetVal_Young(iProp); su2double nu = adj_solver->GetVal_Poisson(iProp); su2double rho = adj_solver->GetVal_Rho(iProp); @@ -300,6 +274,7 @@ void CDiscAdjFEAIteration::InitializeAdjoint(CSolver***** solver, CGeometry**** unsigned short iZone, unsigned short iInst) { /*--- Initialize the adjoints the conservative variables ---*/ + AD::ResizeAdjoints(); solver[iZone][iInst][MESH_0][ADJFEA_SOL]->SetAdjoint_Output(geometry[iZone][iInst][MESH_0], config[iZone]); } @@ -309,7 +284,7 @@ bool CDiscAdjFEAIteration::Monitor(COutput* output, CIntegration**** integration CFreeFormDefBox*** FFDBox, unsigned short iZone, unsigned short iInst) { /*--- Write the convergence history (only screen output) ---*/ - output->SetHistory_Output(geometry[iZone][INST_0][MESH_0], solver[iZone][INST_0][MESH_0], config[iZone], + output->SetHistoryOutput(geometry[iZone][INST_0][MESH_0], solver[iZone][INST_0][MESH_0], config[iZone], config[iZone]->GetTimeIter(), config[iZone]->GetOuterIter(), config[iZone]->GetInnerIter()); @@ -320,70 +295,27 @@ void CDiscAdjFEAIteration::Postprocess(COutput* output, CIntegration**** integra CSolver***** solver, CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement, CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short iZone, unsigned short iInst) { - const bool dynamic = (config[iZone]->GetTime_Domain()); auto solvers0 = solver[iZone][iInst][MESH_0]; - // TEMPORARY output only for standalone structural problems - if (config[iZone]->GetAdvanced_FEAElementBased() && (rank == MASTER_NODE)) { - unsigned short iVar; - - const bool de_effects = config[iZone]->GetDE_Effects(); - - /*--- Header of the temporary output file ---*/ - ofstream myfile_res; - myfile_res.open("Results_Reverse_Adjoint.txt", ios::app); - - myfile_res.precision(15); - - myfile_res << config[iZone]->GetTimeIter() << "\t"; - - solvers0[FEA_SOL]->Evaluate_ObjFunc(config[iZone], solvers0); - myfile_res << scientific << solvers0[FEA_SOL]->GetTotal_ComboObj() << "\t"; - - for (iVar = 0; iVar < config[iZone]->GetnElasticityMod(); iVar++) - myfile_res << scientific << solvers0[ADJFEA_SOL]->GetTotal_Sens_E(iVar) << "\t"; - for (iVar = 0; iVar < config[iZone]->GetnPoissonRatio(); iVar++) - myfile_res << scientific << solvers0[ADJFEA_SOL]->GetTotal_Sens_Nu(iVar) << "\t"; - if (dynamic) { - for (iVar = 0; iVar < config[iZone]->GetnMaterialDensity(); iVar++) - myfile_res << scientific << solvers0[ADJFEA_SOL]->GetTotal_Sens_Rho(iVar) << "\t"; - } - if (de_effects) { - for (iVar = 0; iVar < config[iZone]->GetnElectric_Field(); iVar++) - myfile_res << scientific << solvers0[ADJFEA_SOL]->GetTotal_Sens_EField(iVar) << "\t"; - } - for (iVar = 0; iVar < solvers0[ADJFEA_SOL]->GetnDVFEA(); iVar++) { - myfile_res << scientific << solvers0[ADJFEA_SOL]->GetTotal_Sens_DVFEA(iVar) << "\t"; - } - - myfile_res << endl; - - myfile_res.close(); - } - // TEST: for implementation of python framework in standalone structural problems if (config[iZone]->GetAdvanced_FEAElementBased() && (rank == MASTER_NODE)) { /*--- Header of the temporary output file ---*/ ofstream myfile_res; - bool outputDVFEA = false; + bool outputDVFEA = true; switch (config[iZone]->GetDV_FEA()) { case YOUNG_MODULUS: myfile_res.open("grad_young.opt"); - outputDVFEA = true; break; case POISSON_RATIO: myfile_res.open("grad_poisson.opt"); - outputDVFEA = true; break; case DENSITY_VAL: case DEAD_WEIGHT: myfile_res.open("grad_density.opt"); - outputDVFEA = true; break; case ELECTRIC_FIELD: myfile_res.open("grad_efield.opt"); - outputDVFEA = true; break; default: outputDVFEA = false; @@ -391,23 +323,14 @@ void CDiscAdjFEAIteration::Postprocess(COutput* output, CIntegration**** integra } if (outputDVFEA) { - unsigned short iDV; - unsigned short nDV = solvers0[ADJFEA_SOL]->GetnDVFEA(); - - myfile_res << "INDEX" - << "\t" - << "GRAD" << endl; - + const auto nDV = solvers0[ADJFEA_SOL]->GetnDVFEA(); + myfile_res << "INDEX\tGRAD\n"; myfile_res.precision(15); - for (iDV = 0; iDV < nDV; iDV++) { - myfile_res << iDV; - myfile_res << "\t"; - myfile_res << scientific << solvers0[ADJFEA_SOL]->GetTotal_Sens_DVFEA(iDV); - myfile_res << endl; + for (auto iDV = 0u; iDV < nDV; iDV++) { + myfile_res << iDV << "\t"; + myfile_res << scientific << solvers0[ADJFEA_SOL]->GetTotal_Sens_DVFEA(iDV) << "\n"; } - - myfile_res.close(); } } } diff --git a/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp b/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp index 2776d3c19ab..3e5c8b8d85f 100644 --- a/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CDiscAdjFluidIteration.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjFluidIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -41,74 +41,68 @@ void CDiscAdjFluidIteration::Preprocess(COutput* output, CIntegration**** integr const bool grid_IsMoving = config[iZone]->GetGrid_Movement(); const bool species = config[iZone]->GetKind_Species_Model() != SPECIES_MODEL::NONE; const bool heat = config[iZone]->GetWeakly_Coupled_Heat(); + const bool radiation = config[iZone]->AddRadiation(); auto solvers0 = solver[iZone][iInst][MESH_0]; auto geometries = geometry[iZone][iInst]; + unsigned long nSolvers = 1; + std::array solversToProcess{{FLOW_SOL}}; + if (turbulent) solversToProcess[nSolvers++] = TURB_SOL; + if (species) solversToProcess[nSolvers++] = SPECIES_SOL; + if (heat) solversToProcess[nSolvers++] = HEAT_SOL; + if (radiation) solversToProcess[nSolvers++] = RAD_SOL; + /*--- For the unsteady adjoint, load direct solutions from restart files. ---*/ if (config[iZone]->GetTime_Marching() != TIME_MARCHING::STEADY) { - const int Direct_Iter = static_cast(config[iZone]->GetUnst_AdjointIter()) - static_cast(TimeIter) - 2 + dual_time; + const int Direct_Iter = static_cast(config[iZone]->GetUnst_AdjointIter()) - + static_cast(TimeIter) - 2 + dual_time; - /*--- For dual-time stepping we want to load the already converged solution at timestep n ---*/ + /*--- For dual-time stepping we want to load the already converged solution at previous timesteps. + * In general we only load one file and shift the previously loaded solutions, on the first we + * load one or two more (depending on dual time order). ---*/ - if (TimeIter == 0) { - if (dual_time_2nd) { - /*--- Load solution at timestep n-2 ---*/ - LoadUnsteady_Solution(geometry, solver, config, iZone, iInst, Direct_Iter - 2); + if (dual_time_2nd) { + LoadUnsteady_Solution(geometry, solver, config, iZone, iInst, Direct_Iter - 2); + } else if (dual_time_1st) { + LoadUnsteady_Solution(geometry, solver, config, iZone, iInst, Direct_Iter - 1); + } - /*--- Push solution back to correct array ---*/ + if (TimeIter == 0) { + /*--- Push solution back one level. ---*/ + if (dual_time) { for (auto iMesh = 0u; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) { - auto solvers = solver[iZone][iInst][iMesh]; - - solvers[FLOW_SOL]->GetNodes()->Set_Solution_time_n(); - solvers[FLOW_SOL]->GetNodes()->Set_Solution_time_n1(); - if (turbulent) { - solvers[TURB_SOL]->GetNodes()->Set_Solution_time_n(); - solvers[TURB_SOL]->GetNodes()->Set_Solution_time_n1(); - } - if (species) { - solvers[SPECIES_SOL]->GetNodes()->Set_Solution_time_n(); - solvers[SPECIES_SOL]->GetNodes()->Set_Solution_time_n1(); - } - if (heat) { - solvers[HEAT_SOL]->GetNodes()->Set_Solution_time_n(); - solvers[HEAT_SOL]->GetNodes()->Set_Solution_time_n1(); + for (auto iSol = 0ul; iSol < nSolvers; ++iSol) { + solver[iZone][iInst][iMesh][solversToProcess[iSol]]->GetNodes()->Set_Solution_time_n(); } if (grid_IsMoving) { geometries[iMesh]->nodes->SetCoord_n(); - geometries[iMesh]->nodes->SetCoord_n1(); } if (config[iZone]->GetDynamic_Grid()) { geometries[iMesh]->nodes->SetVolume_n(); - geometries[iMesh]->nodes->SetVolume_nM1(); } } } - if (dual_time) { - /*--- Load solution at timestep n-1 ---*/ - LoadUnsteady_Solution(geometry, solver, config, iZone, iInst, Direct_Iter - 1); - /*--- Push solution back to correct array ---*/ + /*--- If required load another time step. Push the previous time step to n-1 and the + loaded time step to n. ---*/ - for (auto iMesh = 0u; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) { - auto solvers = solver[iZone][iInst][iMesh]; + if (dual_time_2nd) { + LoadUnsteady_Solution(geometry, solver, config, iZone, iInst, Direct_Iter - 1); - solvers[FLOW_SOL]->GetNodes()->Set_Solution_time_n(); - if (turbulent) { - solvers[TURB_SOL]->GetNodes()->Set_Solution_time_n(); - } - if (species) { - solvers[SPECIES_SOL]->GetNodes()->Set_Solution_time_n(); - } - if (heat) { - solvers[HEAT_SOL]->GetNodes()->Set_Solution_time_n(); + for (auto iMesh = 0u; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) { + for (auto iSol = 0ul; iSol < nSolvers; ++iSol) { + solver[iZone][iInst][iMesh][solversToProcess[iSol]]->GetNodes()->Set_Solution_time_n1(); + solver[iZone][iInst][iMesh][solversToProcess[iSol]]->GetNodes()->Set_Solution_time_n(); } if (grid_IsMoving) { + geometries[iMesh]->nodes->SetCoord_n1(); geometries[iMesh]->nodes->SetCoord_n(); } if (config[iZone]->GetDynamic_Grid()) { + geometries[iMesh]->nodes->SetVolume_nM1(); geometries[iMesh]->nodes->SetVolume_n(); } } @@ -123,15 +117,13 @@ void CDiscAdjFluidIteration::Preprocess(COutput* output, CIntegration**** integr } } - else if ((TimeIter > 0) && dual_time) { - /*--- - Here the primal solutions (only working variables) are loaded and put in the correct order - into containers. For ALE the mesh coordinates have to be put into the - correct containers as well, i.e. follow the same logic for the solution. - Afterwards the GridVelocity is computed based on the Coordinates. - ---*/ - - /*--- Temporarily store the loaded volumes into old containers ---*/ + if ((TimeIter > 0) && dual_time) { + /*--- Here the primal solutions (only working variables) are loaded and put in the correct order + into containers. For ALE the mesh coordinates have to be put into the correct containers as well, + i.e. follow the same logic for the solution. Afterwards the GridVelocity is computed based on + the Coordinates. ---*/ + + /*--- Temporarily store the loaded volumes into old containers. ---*/ if (config[iZone]->GetDynamic_Grid()) { for (auto iMesh=0; iMesh<=config[iZone]->GetnMGLevels();iMesh++) { geometries[iMesh]->nodes->SetVolume_Old(); @@ -140,155 +132,80 @@ void CDiscAdjFluidIteration::Preprocess(COutput* output, CIntegration**** integr } } - /*-- Load mesh solver ---*/ + /*--- Load mesh solver. ---*/ if (config[iZone]->GetDeform_Mesh()) { solvers0[MESH_SOL]->LoadRestart(geometries, solver[iZone][iInst], config[iZone], Direct_Iter, true); } - /*--- Load solution timestep n-1 | n-2 for DualTimestepping 1st | 2nd order ---*/ - if (dual_time_1st) { - LoadUnsteady_Solution(geometry, solver, config, iZone, iInst, Direct_Iter - 1); - } else { - LoadUnsteady_Solution(geometry, solver, config, iZone, iInst, Direct_Iter - 2); - - /*--- Set volumes into correct containers ---*/ - if (config[iZone]->GetDynamic_Grid()) { - for (auto iMesh=0; iMesh<=config[iZone]->GetnMGLevels();iMesh++) { - /*--- If negative iteration number, set default ---*/ - if (Direct_Iter - 2 < 0) { - for(auto iPoint=0ul; iPointGetnPoint();iPoint++) { - geometries[iMesh]->nodes->SetVolume(iPoint,0.0); - } + /*--- Set volumes into correct containers ---*/ + if (config[iZone]->GetDynamic_Grid()) { + for (auto iMesh = 0; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) { + /*--- If negative iteration number, set default. ---*/ + if (Direct_Iter - 1 - dual_time_2nd < 0) { + for(auto iPoint = 0ul; iPoint < geometries[iMesh]->GetnPoint(); iPoint++) { + geometries[iMesh]->nodes->SetVolume(iPoint, 0.0); } + } - /*--- Set currently loaded volume to Volume_nM1 ---*/ - geometries[iMesh]->nodes->SetVolume_n(); - geometries[iMesh]->nodes->SetVolume_nM1(); + /*--- Set currently loaded volume to Volume_nM1 ---*/ + geometries[iMesh]->nodes->SetVolume_n(); + geometries[iMesh]->nodes->SetVolume_nM1(); - /*--- Set Volume_n and Volume from old containers ---*/ - geometries[iMesh]->nodes->SetVolume_n_from_OldnM1(); - geometries[iMesh]->nodes->SetVolume_from_Oldn(); - } + /*--- Set Volume_n and Volume from old containers ---*/ + geometries[iMesh]->nodes->SetVolume_n_from_OldnM1(); + geometries[iMesh]->nodes->SetVolume_from_Oldn(); } } - /*--- Temporarily store the loaded solution in the Solution_Old array ---*/ + /*--- Temporarily store the loaded solution and coordinates in the "Old" arrays. ---*/ for (auto iMesh = 0u; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) { - auto solvers = solver[iZone][iInst][iMesh]; - - solvers[FLOW_SOL]->Set_OldSolution(); - if (turbulent) { - solvers[TURB_SOL]->Set_OldSolution(); - } - if (species) { - solvers[SPECIES_SOL]->Set_OldSolution(); - } - if (heat) { - solvers[HEAT_SOL]->Set_OldSolution(); + for (auto iSol = 0ul; iSol < nSolvers; ++iSol) { + solver[iZone][iInst][iMesh][solversToProcess[iSol]]->Set_OldSolution(); } if (grid_IsMoving) { geometries[iMesh]->nodes->SetCoord_Old(); } } - /*--- Set Solution at timestep n to solution at n-1 ---*/ + /*--- Move timestep n to current solution. ---*/ for (auto iMesh = 0u; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) { - auto solvers = solver[iZone][iInst][iMesh]; - - for (auto iPoint = 0ul; iPoint < geometries[iMesh]->GetnPoint(); iPoint++) { - solvers[FLOW_SOL]->GetNodes()->SetSolution(iPoint, solvers[FLOW_SOL]->GetNodes()->GetSolution_time_n(iPoint)); - - if (grid_IsMoving) { - geometries[iMesh]->nodes->SetCoord(iPoint, geometries[iMesh]->nodes->GetCoord_n(iPoint)); - } - if (turbulent) { - solvers[TURB_SOL]->GetNodes()->SetSolution(iPoint, solvers[TURB_SOL]->GetNodes()->GetSolution_time_n(iPoint)); - } - if (species) { - solvers[SPECIES_SOL]->GetNodes()->SetSolution(iPoint, solvers[SPECIES_SOL]->GetNodes()->GetSolution_time_n(iPoint)); - } - if (heat) { - solvers[HEAT_SOL]->GetNodes()->SetSolution(iPoint, solvers[HEAT_SOL]->GetNodes()->GetSolution_time_n(iPoint)); + for (auto iSol = 0ul; iSol < nSolvers; ++iSol) { + auto* s = solver[iZone][iInst][iMesh][solversToProcess[iSol]]; + for (auto iPoint = 0ul; iPoint < geometries[iMesh]->GetnPoint(); iPoint++) { + s->GetNodes()->SetSolution(iPoint, s->GetNodes()->GetSolution_time_n(iPoint)); } } - } - if (dual_time_1st) { - /*--- Set Solution at timestep n-1 to the previously loaded solution ---*/ - for (auto iMesh = 0u; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) { - auto solvers = solver[iZone][iInst][iMesh]; - + if (grid_IsMoving) { for (auto iPoint = 0ul; iPoint < geometries[iMesh]->GetnPoint(); iPoint++) { - solvers[FLOW_SOL]->GetNodes()->Set_Solution_time_n( - iPoint, solvers[FLOW_SOL]->GetNodes()->GetSolution_Old(iPoint)); - - if (grid_IsMoving) { - geometries[iMesh]->nodes->SetCoord_n(iPoint, geometries[iMesh]->nodes->GetCoord_Old(iPoint)); - } - if (turbulent) { - solvers[TURB_SOL]->GetNodes()->Set_Solution_time_n( - iPoint, solvers[TURB_SOL]->GetNodes()->GetSolution_Old(iPoint)); - } - if (species) { - solvers[SPECIES_SOL]->GetNodes()->Set_Solution_time_n( - iPoint, solvers[SPECIES_SOL]->GetNodes()->GetSolution_Old(iPoint)); - } - if (heat) { - solvers[HEAT_SOL]->GetNodes()->Set_Solution_time_n( - iPoint, solvers[HEAT_SOL]->GetNodes()->GetSolution_Old(iPoint)); - } + geometries[iMesh]->nodes->SetCoord(iPoint, geometries[iMesh]->nodes->GetCoord_n(iPoint)); } } } - if (dual_time_2nd) { - /*--- Set Solution at timestep n-1 to solution at n-2 ---*/ - for (auto iMesh = 0u; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) { - auto solvers = solver[iZone][iInst][iMesh]; - for (auto iPoint = 0ul; iPoint < geometries[iMesh]->GetnPoint(); iPoint++) { - solvers[FLOW_SOL]->GetNodes()->Set_Solution_time_n( - iPoint, solvers[FLOW_SOL]->GetNodes()->GetSolution_time_n1(iPoint)); + /*--- Finally, place the loaded solution in the correct place (n or n-1 depending on order). ---*/ - if (grid_IsMoving) { - geometries[iMesh]->nodes->SetCoord_n(iPoint, geometries[iMesh]->nodes->GetCoord_n1(iPoint)); - } - if (turbulent) { - solvers[TURB_SOL]->GetNodes()->Set_Solution_time_n( - iPoint, solvers[TURB_SOL]->GetNodes()->GetSolution_time_n1(iPoint)); - } - if (species) { - solvers[SPECIES_SOL]->GetNodes()->Set_Solution_time_n( - iPoint, solvers[SPECIES_SOL]->GetNodes()->GetSolution_time_n1(iPoint)); - } - if (heat) { - solvers[HEAT_SOL]->GetNodes()->Set_Solution_time_n( - iPoint, solvers[HEAT_SOL]->GetNodes()->GetSolution_time_n1(iPoint)); + for (auto iMesh = 0u; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) { + for (auto iSol = 0ul; iSol < nSolvers; ++iSol) { + auto* s = solver[iZone][iInst][iMesh][solversToProcess[iSol]]; + for (auto iPoint = 0ul; iPoint < geometries[iMesh]->GetnPoint(); iPoint++) { + if (dual_time_2nd) { + /*--- If required also move timestep n-1 to timestep n. ---*/ + s->GetNodes()->Set_Solution_time_n(iPoint, s->GetNodes()->GetSolution_time_n1(iPoint)); + s->GetNodes()->Set_Solution_time_n1(iPoint, s->GetNodes()->GetSolution_Old(iPoint)); + } else { + s->GetNodes()->Set_Solution_time_n(iPoint, s->GetNodes()->GetSolution_Old(iPoint)); } } } - /*--- Set Solution at timestep n-2 to the previously loaded solution ---*/ - for (auto iMesh = 0u; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) { - auto solvers = solver[iZone][iInst][iMesh]; - + if (grid_IsMoving) { for (auto iPoint = 0ul; iPoint < geometries[iMesh]->GetnPoint(); iPoint++) { - solvers[FLOW_SOL]->GetNodes()->Set_Solution_time_n1( - iPoint, solvers[FLOW_SOL]->GetNodes()->GetSolution_Old(iPoint)); - - if (grid_IsMoving) { + if (dual_time_2nd) { + geometries[iMesh]->nodes->SetCoord_n(iPoint, geometries[iMesh]->nodes->GetCoord_n1(iPoint)); geometries[iMesh]->nodes->SetCoord_n1(iPoint, geometries[iMesh]->nodes->GetCoord_Old(iPoint)); - } - if (turbulent) { - solvers[TURB_SOL]->GetNodes()->Set_Solution_time_n1( - iPoint, solvers[TURB_SOL]->GetNodes()->GetSolution_Old(iPoint)); - } - if (species) { - solvers[SPECIES_SOL]->GetNodes()->Set_Solution_time_n1( - iPoint, solvers[SPECIES_SOL]->GetNodes()->GetSolution_Old(iPoint)); - } - if (heat) { - solvers[HEAT_SOL]->GetNodes()->Set_Solution_time_n1( - iPoint, solvers[HEAT_SOL]->GetNodes()->GetSolution_Old(iPoint)); + } else { + geometries[iMesh]->nodes->SetCoord_n(iPoint, geometries[iMesh]->nodes->GetCoord_Old(iPoint)); } } } @@ -297,9 +214,10 @@ void CDiscAdjFluidIteration::Preprocess(COutput* output, CIntegration**** integr } // else if TimeIter > 0 /*--- Compute & set Grid Velocity via finite differences of the Coordinates. ---*/ - if (grid_IsMoving) + if (grid_IsMoving) { for (auto iMesh = 0u; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) geometries[iMesh]->SetGridVelocity(config[iZone]); + } } // if unsteady @@ -308,36 +226,28 @@ void CDiscAdjFluidIteration::Preprocess(COutput* output, CIntegration**** integr /*--- Store flow solution also in the adjoint solver in order to be able to reset it later ---*/ if (TimeIter == 0 || dual_time) { - for (auto iMesh = 0u; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) { - auto solvers = solver[iZone][iInst][iMesh]; + auto SetSolutionDirect = [&](CSolver** solvers, int adj, int primal, unsigned long nPoint) { SU2_OMP_FOR_STAT(1024) - for (auto iPoint = 0ul; iPoint < geometries[iMesh]->GetnPoint(); iPoint++) - solvers[ADJFLOW_SOL]->GetNodes()->SetSolution_Direct(iPoint, solvers[FLOW_SOL]->GetNodes()->GetSolution(iPoint)); + for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) + solvers[adj]->GetNodes()->SetSolution_Direct(iPoint, solvers[primal]->GetNodes()->GetSolution(iPoint)); END_SU2_OMP_FOR + }; + + for (auto iMesh = 0u; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) { + auto solvers = solver[iZone][iInst][iMesh]; + SetSolutionDirect(solvers, ADJFLOW_SOL, FLOW_SOL, geometries[iMesh]->GetnPoint()); } if (turbulent && !config[iZone]->GetFrozen_Visc_Disc()) { - SU2_OMP_FOR_STAT(1024) - for (auto iPoint = 0ul; iPoint < geometries[MESH_0]->GetnPoint(); iPoint++) - solvers0[ADJTURB_SOL]->GetNodes()->SetSolution_Direct(iPoint, solvers0[TURB_SOL]->GetNodes()->GetSolution(iPoint)); - END_SU2_OMP_FOR + SetSolutionDirect(solvers0, ADJTURB_SOL, TURB_SOL, geometries[MESH_0]->GetnPoint()); } if (species) { - SU2_OMP_FOR_STAT(1024) - for (auto iPoint = 0ul; iPoint < geometries[MESH_0]->GetnPoint(); iPoint++) - solvers0[ADJSPECIES_SOL]->GetNodes()->SetSolution_Direct(iPoint, solvers0[SPECIES_SOL]->GetNodes()->GetSolution(iPoint)); - END_SU2_OMP_FOR + SetSolutionDirect(solvers0, ADJSPECIES_SOL, SPECIES_SOL, geometries[MESH_0]->GetnPoint()); } if (heat) { - SU2_OMP_FOR_STAT(1024) - for (auto iPoint = 0ul; iPoint < geometries[MESH_0]->GetnPoint(); iPoint++) - solvers0[ADJHEAT_SOL]->GetNodes()->SetSolution_Direct(iPoint, solvers0[HEAT_SOL]->GetNodes()->GetSolution(iPoint)); - END_SU2_OMP_FOR + SetSolutionDirect(solvers0, ADJHEAT_SOL, HEAT_SOL, geometries[MESH_0]->GetnPoint()); } - if (config[iZone]->AddRadiation()) { - SU2_OMP_FOR_STAT(1024) - for (auto iPoint = 0ul; iPoint < geometries[MESH_0]->GetnPoint(); iPoint++) - solvers0[ADJRAD_SOL]->GetNodes()->SetSolution_Direct(iPoint, solvers0[RAD_SOL]->GetNodes()->GetSolution(iPoint)); - END_SU2_OMP_FOR + if (radiation) { + SetSolutionDirect(solvers0, ADJRAD_SOL, RAD_SOL, geometries[MESH_0]->GetnPoint()); } } @@ -356,7 +266,7 @@ void CDiscAdjFluidIteration::Preprocess(COutput* output, CIntegration**** integr solvers0[ADJHEAT_SOL]->Preprocessing(geometries[MESH_0], solvers0, config[iZone], MESH_0, 0, RUNTIME_ADJHEAT_SYS, false); } - if (config[iZone]->AddRadiation()) { + if (radiation) { solvers0[ADJRAD_SOL]->Preprocessing(geometries[MESH_0], solvers0, config[iZone], MESH_0, 0, RUNTIME_ADJRAD_SYS, false); } @@ -369,22 +279,23 @@ void CDiscAdjFluidIteration::LoadUnsteady_Solution(CGeometry**** geometry, CSolv unsigned short iZone, unsigned short iInst, int DirectIter) { auto solvers = solver[iZone][iInst]; + auto geometries = geometry[iZone][iInst]; const bool species = config[iZone]->GetKind_Species_Model() != SPECIES_MODEL::NONE; if (DirectIter >= 0) { if (rank == MASTER_NODE) cout << " Loading flow solution from direct iteration " << DirectIter << " for zone " << iZone << "." << endl; - solvers[MESH_0][FLOW_SOL]->LoadRestart(geometry[iZone][iInst], solvers, config[iZone], DirectIter, true); + solvers[MESH_0][FLOW_SOL]->LoadRestart(geometries, solvers, config[iZone], DirectIter, true); if (turbulent) { - solvers[MESH_0][TURB_SOL]->LoadRestart(geometry[iZone][iInst], solvers, config[iZone], DirectIter, false); + solvers[MESH_0][TURB_SOL]->LoadRestart(geometries, solvers, config[iZone], DirectIter, false); } if (species) { - solvers[MESH_0][SPECIES_SOL]->LoadRestart(geometry[iZone][iInst], solvers, config[iZone], DirectIter, false); + solvers[MESH_0][SPECIES_SOL]->LoadRestart(geometries, solvers, config[iZone], DirectIter, false); } if (config[iZone]->GetWeakly_Coupled_Heat()) { - solvers[MESH_0][HEAT_SOL]->LoadRestart(geometry[iZone][iInst], solvers, config[iZone], DirectIter, false); + solvers[MESH_0][HEAT_SOL]->LoadRestart(geometries, solvers, config[iZone], DirectIter, false); } } else { /*--- If there is no solution file we set the freestream condition ---*/ @@ -393,19 +304,19 @@ void CDiscAdjFluidIteration::LoadUnsteady_Solution(CGeometry**** geometry, CSolv for (auto iMesh = 0u; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) { solvers[iMesh][FLOW_SOL]->SetFreeStream_Solution(config[iZone]); - solvers[iMesh][FLOW_SOL]->Preprocessing(geometry[iZone][iInst][iMesh], solvers[iMesh], config[iZone], iMesh, + solvers[iMesh][FLOW_SOL]->Preprocessing(geometries[iMesh], solvers[iMesh], config[iZone], iMesh, DirectIter, RUNTIME_FLOW_SYS, false); if (turbulent) { solvers[iMesh][TURB_SOL]->SetFreeStream_Solution(config[iZone]); - solvers[iMesh][TURB_SOL]->Postprocessing(geometry[iZone][iInst][iMesh], solvers[iMesh], config[iZone], iMesh); + solvers[iMesh][TURB_SOL]->Postprocessing(geometries[iMesh], solvers[iMesh], config[iZone], iMesh); } if (species) { solvers[iMesh][SPECIES_SOL]->SetFreeStream_Solution(config[iZone]); - solvers[iMesh][SPECIES_SOL]->Postprocessing(geometry[iZone][iInst][iMesh], solvers[iMesh], config[iZone], iMesh); + solvers[iMesh][SPECIES_SOL]->Postprocessing(geometries[iMesh], solvers[iMesh], config[iZone], iMesh); } if (config[iZone]->GetWeakly_Coupled_Heat()) { solvers[iMesh][HEAT_SOL]->SetFreeStream_Solution(config[iZone]); - solvers[iMesh][HEAT_SOL]->Postprocessing(geometry[iZone][iInst][iMesh], solvers[iMesh], config[iZone], iMesh); + solvers[iMesh][HEAT_SOL]->Postprocessing(geometries[iMesh], solvers[iMesh], config[iZone], iMesh); } } } @@ -413,29 +324,31 @@ void CDiscAdjFluidIteration::LoadUnsteady_Solution(CGeometry**** geometry, CSolv void CDiscAdjFluidIteration::IterateDiscAdj(CGeometry**** geometry, CSolver***** solver, CConfig** config, unsigned short iZone, unsigned short iInst, bool CrossTerm) { + auto solvers0 = solver[iZone][iInst][MESH_0]; + auto geometry0 = geometry[iZone][iInst][MESH_0]; - SU2_OMP_PARALLEL_(if(solver[iZone][iInst][MESH_0][ADJFLOW_SOL]->GetHasHybridParallel())) { + SU2_OMP_PARALLEL_(if(solvers0[ADJFLOW_SOL]->GetHasHybridParallel())) { /*--- Extract the adjoints of the conservative input variables and store them for the next iteration ---*/ if (config[iZone]->GetFluidProblem()) { - solver[iZone][iInst][MESH_0][ADJFLOW_SOL]->ExtractAdjoint_Solution(geometry[iZone][iInst][MESH_0], config[iZone], CrossTerm); + solvers0[ADJFLOW_SOL]->ExtractAdjoint_Solution(geometry0, config[iZone], CrossTerm); - solver[iZone][iInst][MESH_0][ADJFLOW_SOL]->ExtractAdjoint_Variables(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJFLOW_SOL]->ExtractAdjoint_Variables(geometry0, config[iZone]); } if (turbulent && !config[iZone]->GetFrozen_Visc_Disc()) { - solver[iZone][iInst][MESH_0][ADJTURB_SOL]->ExtractAdjoint_Solution(geometry[iZone][iInst][MESH_0], config[iZone], CrossTerm); + solvers0[ADJTURB_SOL]->ExtractAdjoint_Solution(geometry0, config[iZone], CrossTerm); } if (config[iZone]->GetKind_Species_Model() != SPECIES_MODEL::NONE) { - solver[iZone][iInst][MESH_0][ADJSPECIES_SOL]->ExtractAdjoint_Solution(geometry[iZone][iInst][MESH_0], config[iZone], CrossTerm); + solvers0[ADJSPECIES_SOL]->ExtractAdjoint_Solution(geometry0, config[iZone], CrossTerm); } if (config[iZone]->GetWeakly_Coupled_Heat()) { - solver[iZone][iInst][MESH_0][ADJHEAT_SOL]->ExtractAdjoint_Solution(geometry[iZone][iInst][MESH_0], config[iZone], CrossTerm); + solvers0[ADJHEAT_SOL]->ExtractAdjoint_Solution(geometry0, config[iZone], CrossTerm); } if (config[iZone]->AddRadiation()) { - solver[iZone][iInst][MESH_0][ADJRAD_SOL]->ExtractAdjoint_Solution(geometry[iZone][iInst][MESH_0], config[iZone], CrossTerm); + solvers0[ADJRAD_SOL]->ExtractAdjoint_Solution(geometry0, config[iZone], CrossTerm); - solver[iZone][iInst][MESH_0][ADJRAD_SOL]->ExtractAdjoint_Variables(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJRAD_SOL]->ExtractAdjoint_Variables(geometry0, config[iZone]); } } @@ -444,33 +357,37 @@ void CDiscAdjFluidIteration::IterateDiscAdj(CGeometry**** geometry, CSolver***** void CDiscAdjFluidIteration::InitializeAdjoint(CSolver***** solver, CGeometry**** geometry, CConfig** config, unsigned short iZone, unsigned short iInst) { + auto solvers0 = solver[iZone][iInst][MESH_0]; + auto geometry0 = geometry[iZone][iInst][MESH_0]; + + AD::ResizeAdjoints(); - SU2_OMP_PARALLEL_(if(solver[iZone][iInst][MESH_0][ADJFLOW_SOL]->GetHasHybridParallel())) { + SU2_OMP_PARALLEL_(if(solvers0[ADJFLOW_SOL]->GetHasHybridParallel())) { /*--- Initialize the adjoints the conservative variables ---*/ if (config[iZone]->GetFluidProblem()) { - solver[iZone][iInst][MESH_0][ADJFLOW_SOL]->SetAdjoint_Output(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJFLOW_SOL]->SetAdjoint_Output(geometry0, config[iZone]); } if (turbulent && !config[iZone]->GetFrozen_Visc_Disc()) { - solver[iZone][iInst][MESH_0][ADJTURB_SOL]->SetAdjoint_Output(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJTURB_SOL]->SetAdjoint_Output(geometry0, config[iZone]); } if (config[iZone]->GetKind_Species_Model() != SPECIES_MODEL::NONE) { - solver[iZone][iInst][MESH_0][ADJSPECIES_SOL]->SetAdjoint_Output(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJSPECIES_SOL]->SetAdjoint_Output(geometry0, config[iZone]); } if (config[iZone]->GetWeakly_Coupled_Heat()) { - solver[iZone][iInst][MESH_0][ADJHEAT_SOL]->SetAdjoint_Output(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJHEAT_SOL]->SetAdjoint_Output(geometry0, config[iZone]); } if (config[iZone]->AddRadiation()) { - solver[iZone][iInst][MESH_0][ADJRAD_SOL]->SetAdjoint_Output(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJRAD_SOL]->SetAdjoint_Output(geometry0, config[iZone]); } - if (config[iZone]->GetFluidProblem() && config[iZone]->GetSinglezone_Driver()) { - solver[iZone][iInst][MESH_0][FLOW_SOL]->SetVertexTractionsAdjoint(geometry[iZone][iInst][MESH_0], config[iZone]); + if (config[iZone]->GetFluidProblem() && !config[iZone]->GetMultizone_Problem()) { + solvers0[FLOW_SOL]->SetVertexTractionsAdjoint(geometry0, config[iZone]); } } @@ -479,46 +396,48 @@ void CDiscAdjFluidIteration::InitializeAdjoint(CSolver***** solver, CGeometry*** void CDiscAdjFluidIteration::RegisterInput(CSolver***** solver, CGeometry**** geometry, CConfig** config, unsigned short iZone, unsigned short iInst, RECORDING kind_recording) { + auto solvers0 = solver[iZone][iInst][MESH_0]; + auto geometry0 = geometry[iZone][iInst][MESH_0]; - SU2_OMP_PARALLEL_(if(solver[iZone][iInst][MESH_0][ADJFLOW_SOL]->GetHasHybridParallel())) { + SU2_OMP_PARALLEL_(if(solvers0[ADJFLOW_SOL]->GetHasHybridParallel())) { if (kind_recording == RECORDING::SOLUTION_VARIABLES || kind_recording == RECORDING::SOLUTION_AND_MESH) { /*--- Register flow and turbulent variables as input ---*/ if (config[iZone]->GetFluidProblem()) { - solver[iZone][iInst][MESH_0][ADJFLOW_SOL]->RegisterSolution(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJFLOW_SOL]->RegisterSolution(geometry0, config[iZone]); - solver[iZone][iInst][MESH_0][ADJFLOW_SOL]->RegisterVariables(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJFLOW_SOL]->RegisterVariables(geometry0, config[iZone]); } if (turbulent && !config[iZone]->GetFrozen_Visc_Disc()) { - solver[iZone][iInst][MESH_0][ADJTURB_SOL]->RegisterSolution(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJTURB_SOL]->RegisterSolution(geometry0, config[iZone]); } if (config[iZone]->GetKind_Species_Model() != SPECIES_MODEL::NONE) { - solver[iZone][iInst][MESH_0][ADJSPECIES_SOL]->RegisterSolution(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJSPECIES_SOL]->RegisterSolution(geometry0, config[iZone]); } if (config[iZone]->GetWeakly_Coupled_Heat()) { - solver[iZone][iInst][MESH_0][ADJHEAT_SOL]->RegisterSolution(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJHEAT_SOL]->RegisterSolution(geometry0, config[iZone]); } if (config[iZone]->AddRadiation()) { - solver[iZone][iInst][MESH_0][ADJRAD_SOL]->RegisterSolution(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJRAD_SOL]->RegisterSolution(geometry0, config[iZone]); - solver[iZone][iInst][MESH_0][ADJRAD_SOL]->RegisterVariables(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJRAD_SOL]->RegisterVariables(geometry0, config[iZone]); } } if (kind_recording == RECORDING::MESH_COORDS || kind_recording == RECORDING::SOLUTION_AND_MESH) { /*--- Register node coordinates as input ---*/ - geometry[iZone][iInst][MESH_0]->RegisterCoordinates(); + geometry0->RegisterCoordinates(); } if (kind_recording == RECORDING::MESH_DEFORM) { /*--- Undeformed mesh coordinates ---*/ - solver[iZone][iInst][MESH_0][ADJMESH_SOL]->RegisterSolution(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJMESH_SOL]->RegisterSolution(geometry0, config[iZone]); /*--- Boundary displacements ---*/ - solver[iZone][iInst][MESH_0][ADJMESH_SOL]->RegisterVariables(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJMESH_SOL]->RegisterVariables(geometry0, config[iZone]); } } END_SU2_OMP_PARALLEL @@ -527,6 +446,8 @@ void CDiscAdjFluidIteration::RegisterInput(CSolver***** solver, CGeometry**** ge void CDiscAdjFluidIteration::SetDependencies(CSolver***** solver, CGeometry**** geometry, CNumerics****** numerics, CConfig** config, unsigned short iZone, unsigned short iInst, RECORDING kind_recording) { + auto solvers0 = solver[iZone][iInst][MESH_0]; + auto geometry0 = geometry[iZone][iInst][MESH_0]; if ((kind_recording == RECORDING::MESH_COORDS) || (kind_recording == RECORDING::CLEAR_INDICES) || @@ -538,91 +459,74 @@ void CDiscAdjFluidIteration::SetDependencies(CSolver***** solver, CGeometry**** CGeometry::ComputeWallDistance(config, geometry); } - SU2_OMP_PARALLEL_(if(solver[iZone][iInst][MESH_0][ADJFLOW_SOL]->GetHasHybridParallel())) { + SU2_OMP_PARALLEL_(if(solvers0[ADJFLOW_SOL]->GetHasHybridParallel())) { /*--- Compute coupling between flow, turbulent and species equations ---*/ - solver[iZone][iInst][MESH_0][FLOW_SOL]->Preprocessing(geometry[iZone][iInst][MESH_0], solver[iZone][iInst][MESH_0], - config[iZone], MESH_0, NO_RK_ITER, RUNTIME_FLOW_SYS, true); - solver[iZone][iInst][MESH_0][FLOW_SOL]->InitiateComms(geometry[iZone][iInst][MESH_0], config[iZone], SOLUTION); - solver[iZone][iInst][MESH_0][FLOW_SOL]->CompleteComms(geometry[iZone][iInst][MESH_0], config[iZone], SOLUTION); + solvers0[FLOW_SOL]->Preprocessing(geometry0, solvers0, config[iZone], MESH_0, NO_RK_ITER, RUNTIME_FLOW_SYS, true); + solvers0[FLOW_SOL]->InitiateComms(geometry0, config[iZone], SOLUTION); + solvers0[FLOW_SOL]->CompleteComms(geometry0, config[iZone], SOLUTION); if (turbulent && !config[iZone]->GetFrozen_Visc_Disc()) { - solver[iZone][iInst][MESH_0][TURB_SOL]->Postprocessing(geometry[iZone][iInst][MESH_0], solver[iZone][iInst][MESH_0], + solvers0[TURB_SOL]->Postprocessing(geometry0, solvers0, config[iZone], MESH_0); - solver[iZone][iInst][MESH_0][TURB_SOL]->InitiateComms(geometry[iZone][iInst][MESH_0], config[iZone], SOLUTION); - solver[iZone][iInst][MESH_0][TURB_SOL]->CompleteComms(geometry[iZone][iInst][MESH_0], config[iZone], SOLUTION); + solvers0[TURB_SOL]->InitiateComms(geometry0, config[iZone], SOLUTION); + solvers0[TURB_SOL]->CompleteComms(geometry0, config[iZone], SOLUTION); } if (config[iZone]->GetKind_Species_Model() != SPECIES_MODEL::NONE) { - solver[iZone][iInst][MESH_0][SPECIES_SOL]->Preprocessing(geometry[iZone][iInst][MESH_0], solver[iZone][iInst][MESH_0], - config[iZone], MESH_0, NO_RK_ITER, RUNTIME_FLOW_SYS, true); - solver[iZone][iInst][MESH_0][SPECIES_SOL]->InitiateComms(geometry[iZone][iInst][MESH_0], config[iZone], SOLUTION); - solver[iZone][iInst][MESH_0][SPECIES_SOL]->CompleteComms(geometry[iZone][iInst][MESH_0], config[iZone], SOLUTION); + solvers0[SPECIES_SOL]->Preprocessing(geometry0, solvers0, config[iZone], MESH_0, NO_RK_ITER, RUNTIME_FLOW_SYS, true); + solvers0[SPECIES_SOL]->InitiateComms(geometry0, config[iZone], SOLUTION); + solvers0[SPECIES_SOL]->CompleteComms(geometry0, config[iZone], SOLUTION); } } END_SU2_OMP_PARALLEL if (config[iZone]->GetWeakly_Coupled_Heat()) { - solver[iZone][iInst][MESH_0][HEAT_SOL]->Set_Heatflux_Areas(geometry[iZone][iInst][MESH_0], config[iZone]); - solver[iZone][iInst][MESH_0][HEAT_SOL]->Preprocessing(geometry[iZone][iInst][MESH_0], solver[iZone][iInst][MESH_0], - config[iZone], MESH_0, NO_RK_ITER, RUNTIME_HEAT_SYS, true); - solver[iZone][iInst][MESH_0][HEAT_SOL]->Postprocessing(geometry[iZone][iInst][MESH_0], solver[iZone][iInst][MESH_0], - config[iZone], MESH_0); - solver[iZone][iInst][MESH_0][HEAT_SOL]->InitiateComms(geometry[iZone][iInst][MESH_0], config[iZone], SOLUTION); - solver[iZone][iInst][MESH_0][HEAT_SOL]->CompleteComms(geometry[iZone][iInst][MESH_0], config[iZone], SOLUTION); + solvers0[HEAT_SOL]->Set_Heatflux_Areas(geometry0, config[iZone]); + solvers0[HEAT_SOL]->Preprocessing(geometry0, solvers0, config[iZone], MESH_0, NO_RK_ITER, RUNTIME_HEAT_SYS, true); + solvers0[HEAT_SOL]->Postprocessing(geometry0, solvers0, config[iZone], MESH_0); + solvers0[HEAT_SOL]->InitiateComms(geometry0, config[iZone], SOLUTION); + solvers0[HEAT_SOL]->CompleteComms(geometry0, config[iZone], SOLUTION); } if (config[iZone]->AddRadiation()) { - solver[iZone][iInst][MESH_0][RAD_SOL]->Postprocessing(geometry[iZone][iInst][MESH_0], solver[iZone][iInst][MESH_0], - config[iZone], MESH_0); - solver[iZone][iInst][MESH_0][RAD_SOL]->InitiateComms(geometry[iZone][iInst][MESH_0], config[iZone], SOLUTION); - solver[iZone][iInst][MESH_0][RAD_SOL]->CompleteComms(geometry[iZone][iInst][MESH_0], config[iZone], SOLUTION); + solvers0[RAD_SOL]->Postprocessing(geometry0, solvers0, config[iZone], MESH_0); + solvers0[RAD_SOL]->InitiateComms(geometry0, config[iZone], SOLUTION); + solvers0[RAD_SOL]->CompleteComms(geometry0, config[iZone], SOLUTION); } } void CDiscAdjFluidIteration::RegisterOutput(CSolver***** solver, CGeometry**** geometry, CConfig** config, unsigned short iZone, unsigned short iInst) { + auto solvers0 = solver[iZone][iInst][MESH_0]; + auto geometry0 = geometry[iZone][iInst][MESH_0]; - SU2_OMP_PARALLEL_(if(solver[iZone][iInst][MESH_0][ADJFLOW_SOL]->GetHasHybridParallel())) { + SU2_OMP_PARALLEL_(if(solvers0[ADJFLOW_SOL]->GetHasHybridParallel())) { /*--- Register conservative variables as output of the iteration ---*/ if (config[iZone]->GetFluidProblem()) { - solver[iZone][iInst][MESH_0][ADJFLOW_SOL]->RegisterOutput(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJFLOW_SOL]->RegisterOutput(geometry0, config[iZone]); } if (turbulent && !config[iZone]->GetFrozen_Visc_Disc()) { - solver[iZone][iInst][MESH_0][ADJTURB_SOL]->RegisterOutput(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJTURB_SOL]->RegisterOutput(geometry0, config[iZone]); } if (config[iZone]->GetKind_Species_Model() != SPECIES_MODEL::NONE) { - solver[iZone][iInst][MESH_0][ADJSPECIES_SOL]->RegisterOutput(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJSPECIES_SOL]->RegisterOutput(geometry0, config[iZone]); } if (config[iZone]->GetWeakly_Coupled_Heat()) { - solver[iZone][iInst][MESH_0][ADJHEAT_SOL]->RegisterOutput(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJHEAT_SOL]->RegisterOutput(geometry0, config[iZone]); } if (config[iZone]->AddRadiation()) { - solver[iZone][iInst][MESH_0][ADJRAD_SOL]->RegisterOutput(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJRAD_SOL]->RegisterOutput(geometry0, config[iZone]); } - if (config[iZone]->GetFluidProblem() && config[iZone]->GetSinglezone_Driver()) { - solver[iZone][iInst][MESH_0][FLOW_SOL]->RegisterVertexTractions(geometry[iZone][iInst][MESH_0], config[iZone]); + if (config[iZone]->GetFluidProblem() && !config[iZone]->GetMultizone_Problem()) { + solvers0[FLOW_SOL]->RegisterVertexTractions(geometry0, config[iZone]); } } END_SU2_OMP_PARALLEL } -void CDiscAdjFluidIteration::Update(COutput* output, CIntegration**** integration, CGeometry**** geometry, - CSolver***** solver, CNumerics****** numerics, CConfig** config, - CSurfaceMovement** surface_movement, CVolumetricMovement*** grid_movement, - CFreeFormDefBox*** FFDBox, unsigned short iZone, unsigned short iInst) { - /*--- Dual time stepping strategy ---*/ - - if ((config[iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || - (config[iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)) { - for (unsigned short iMesh = 0; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) { - integration[iZone][iInst][ADJFLOW_SOL]->SetConvergence(false); - } - } -} - bool CDiscAdjFluidIteration::Monitor(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver, CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement, CVolumetricMovement*** grid_movement, @@ -633,7 +537,7 @@ bool CDiscAdjFluidIteration::Monitor(COutput* output, CIntegration**** integrati /*--- Write the convergence history for the fluid (only screen output) ---*/ - output->SetHistory_Output(geometry[iZone][INST_0][MESH_0], solver[iZone][INST_0][MESH_0], config[iZone], + output->SetHistoryOutput(geometry[iZone][INST_0][MESH_0], solver[iZone][INST_0][MESH_0], config[iZone], config[iZone]->GetTimeIter(), config[iZone]->GetOuterIter(), config[iZone]->GetInnerIter()); diff --git a/SU2_CFD/src/iteration/CDiscAdjHeatIteration.cpp b/SU2_CFD/src/iteration/CDiscAdjHeatIteration.cpp index 67c2f8fe863..90d7c5ab85d 100644 --- a/SU2_CFD/src/iteration/CDiscAdjHeatIteration.cpp +++ b/SU2_CFD/src/iteration/CDiscAdjHeatIteration.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjHeatIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -43,79 +43,64 @@ void CDiscAdjHeatIteration::Preprocess(COutput* output, CIntegration**** integra /*--- For the unsteady adjoint, load direct solutions from restart files. ---*/ if (config[val_iZone]->GetTime_Marching() != TIME_MARCHING::STEADY) { - const int Direct_Iter = static_cast(config[val_iZone]->GetUnst_AdjointIter()) - static_cast(TimeIter) - 2 + dual_time; + const int Direct_Iter = static_cast(config[val_iZone]->GetUnst_AdjointIter()) - + static_cast(TimeIter) - 2 + dual_time; - /*--- For dual-time stepping we want to load the already converged solution at timestep n ---*/ + /*--- For dual-time stepping we want to load the already converged solution at previous timesteps. + * In general we only load one file and shift the previously loaded solutions, on the first we + * load one or two more (depending on dual time order). ---*/ - if (TimeIter == 0) { - if (dual_time_2nd) { - /*--- Load solution at timestep n-2 ---*/ - - LoadUnsteady_Solution(geometry, solver, config, val_iZone, val_iInst, Direct_Iter - 2); - - /*--- Push solution back to correct array ---*/ + if (dual_time_2nd) { + LoadUnsteady_Solution(geometry, solver, config, val_iZone, val_iInst, Direct_Iter - 2); + } else if (dual_time_1st) { + LoadUnsteady_Solution(geometry, solver, config, val_iZone, val_iInst, Direct_Iter - 1); + } + if (TimeIter == 0) { + /*--- Push solution back one level. ---*/ + if (dual_time) { for (auto iMesh = 0u; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { solvers[iMesh][HEAT_SOL]->GetNodes()->Set_Solution_time_n(); - solvers[iMesh][HEAT_SOL]->GetNodes()->Set_Solution_time_n1(); } } - if (dual_time) { - /*--- Load solution at timestep n-1 ---*/ + /*--- If required load another time step. Push the previous time step to n-1 and the + loaded time step to n. ---*/ + if (dual_time_2nd) { LoadUnsteady_Solution(geometry, solver, config, val_iZone, val_iInst, Direct_Iter - 1); - /*--- Push solution back to correct array ---*/ - for (auto iMesh = 0u; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { + solvers[iMesh][HEAT_SOL]->GetNodes()->Set_Solution_time_n1(); solvers[iMesh][HEAT_SOL]->GetNodes()->Set_Solution_time_n(); } } - /*--- Load solution timestep n ---*/ - + /*--- Load current solution. ---*/ LoadUnsteady_Solution(geometry, solver, config, val_iZone, val_iInst, Direct_Iter); } if ((TimeIter > 0) && dual_time) { - /*--- Load solution timestep n - 2 ---*/ - - LoadUnsteady_Solution(geometry, solver, config, val_iZone, val_iInst, Direct_Iter - 2); - /*--- Temporarily store the loaded solution in the Solution_Old array ---*/ - for (auto iMesh = 0u; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) solvers[iMesh][HEAT_SOL]->Set_OldSolution(); - /*--- Set Solution at timestep n to solution at n-1 ---*/ - + /*--- Move timestep n to current solution. ---*/ for (auto iMesh = 0u; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { for (auto iPoint = 0ul; iPoint < geometry[val_iZone][val_iInst][iMesh]->GetnPoint(); iPoint++) { solvers[iMesh][HEAT_SOL]->GetNodes()->SetSolution( iPoint, solvers[iMesh][HEAT_SOL]->GetNodes()->GetSolution_time_n(iPoint)); } } - if (dual_time_1st) { - /*--- Set Solution at timestep n-1 to the previously loaded solution ---*/ - for (auto iMesh = 0u; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { - for (auto iPoint = 0ul; iPoint < geometry[val_iZone][val_iInst][iMesh]->GetnPoint(); iPoint++) { - solvers[iMesh][HEAT_SOL]->GetNodes()->Set_Solution_time_n( - iPoint, solvers[iMesh][HEAT_SOL]->GetNodes()->GetSolution_time_n1(iPoint)); - } - } - } - if (dual_time_2nd) { - /*--- Set Solution at timestep n-1 to solution at n-2 ---*/ - for (auto iMesh = 0u; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { - for (auto iPoint = 0ul; iPoint < geometry[val_iZone][val_iInst][iMesh]->GetnPoint(); iPoint++) { - solvers[iMesh][HEAT_SOL]->GetNodes()->Set_Solution_time_n( - iPoint, solvers[iMesh][HEAT_SOL]->GetNodes()->GetSolution_time_n1(iPoint)); - } - } - /*--- Set Solution at timestep n-2 to the previously loaded solution ---*/ - for (auto iMesh = 0u; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { - for (auto iPoint = 0ul; iPoint < geometry[val_iZone][val_iInst][iMesh]->GetnPoint(); iPoint++) { - solvers[iMesh][HEAT_SOL]->GetNodes()->Set_Solution_time_n1( - iPoint, solvers[iMesh][HEAT_SOL]->GetNodes()->GetSolution_Old(iPoint)); + + /*--- Finally, place the loaded solution in the correct place (n or n-1 depending on order). ---*/ + for (auto iMesh = 0u; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { + auto* heatSol = solvers[iMesh][HEAT_SOL]; + for (auto iPoint = 0ul; iPoint < geometry[val_iZone][val_iInst][iMesh]->GetnPoint(); iPoint++) { + if (dual_time_2nd) { + /*--- If required also move timestep n-1 to timestep n. ---*/ + heatSol->GetNodes()->Set_Solution_time_n(iPoint, heatSol->GetNodes()->GetSolution_time_n1(iPoint)); + heatSol->GetNodes()->Set_Solution_time_n1(iPoint, heatSol->GetNodes()->GetSolution_Old(iPoint)); + } else { + heatSol->GetNodes()->Set_Solution_time_n(iPoint, heatSol->GetNodes()->GetSolution_Old(iPoint)); } } } @@ -140,13 +125,14 @@ void CDiscAdjHeatIteration::Preprocess(COutput* output, CIntegration**** integra void CDiscAdjHeatIteration::LoadUnsteady_Solution(CGeometry**** geometry, CSolver***** solver, CConfig** config, unsigned short val_iZone, unsigned short val_iInst, int val_DirectIter) { + auto solvers = solver[val_iZone][val_iInst]; + auto geometries = geometry[val_iZone][val_iInst]; if (val_DirectIter >= 0) { if (rank == MASTER_NODE) cout << " Loading heat solution from direct iteration " << val_DirectIter << " for zone " << val_iZone << "." << endl; - solver[val_iZone][val_iInst][MESH_0][HEAT_SOL]->LoadRestart( - geometry[val_iZone][val_iInst], solver[val_iZone][val_iInst], config[val_iZone], val_DirectIter, false); + solvers[MESH_0][HEAT_SOL]->LoadRestart(geometries, solvers, config[val_iZone], val_DirectIter, false); } else { /*--- If there is no solution file we set the freestream condition ---*/ @@ -154,9 +140,8 @@ void CDiscAdjHeatIteration::LoadUnsteady_Solution(CGeometry**** geometry, CSolve cout << " Setting freestream conditions at direct iteration " << val_DirectIter << " for zone " << val_iZone << "." << endl; for (auto iMesh = 0u; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { - solver[val_iZone][val_iInst][iMesh][HEAT_SOL]->SetFreeStream_Solution(config[val_iZone]); - solver[val_iZone][val_iInst][iMesh][HEAT_SOL]->Postprocessing( - geometry[val_iZone][val_iInst][iMesh], solver[val_iZone][val_iInst][iMesh], config[val_iZone], iMesh); + solvers[iMesh][HEAT_SOL]->SetFreeStream_Solution(config[val_iZone]); + solvers[iMesh][HEAT_SOL]->Postprocessing(geometries[iMesh], solvers[iMesh], config[val_iZone], iMesh); } } } @@ -172,31 +157,35 @@ void CDiscAdjHeatIteration::InitializeAdjoint(CSolver***** solver, CGeometry**** unsigned short iZone, unsigned short iInst) { /*--- Initialize the adjoints the solution variables ---*/ + + AD::ResizeAdjoints(); solver[iZone][iInst][MESH_0][ADJHEAT_SOL]->SetAdjoint_Output(geometry[iZone][iInst][MESH_0], config[iZone]); } void CDiscAdjHeatIteration::RegisterInput(CSolver***** solver, CGeometry**** geometry, CConfig** config, unsigned short iZone, unsigned short iInst, RECORDING kind_recording) { + auto solvers0 = solver[iZone][iInst][MESH_0]; + auto geometry0 = geometry[iZone][iInst][MESH_0]; if (kind_recording == RECORDING::SOLUTION_VARIABLES || kind_recording == RECORDING::SOLUTION_AND_MESH) { /*--- Register flow and turbulent variables as input ---*/ - solver[iZone][iInst][MESH_0][ADJHEAT_SOL]->RegisterSolution(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJHEAT_SOL]->RegisterSolution(geometry0, config[iZone]); - solver[iZone][iInst][MESH_0][ADJHEAT_SOL]->RegisterVariables(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJHEAT_SOL]->RegisterVariables(geometry0, config[iZone]); } else if (kind_recording == RECORDING::MESH_COORDS) { /*--- Register node coordinates as input ---*/ - geometry[iZone][iInst][MESH_0]->RegisterCoordinates(); + geometry0->RegisterCoordinates(); } else if (kind_recording == RECORDING::MESH_DEFORM) { /*--- Register the variables of the mesh deformation ---*/ /*--- Undeformed mesh coordinates ---*/ - solver[iZone][iInst][MESH_0][ADJMESH_SOL]->RegisterSolution(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJMESH_SOL]->RegisterSolution(geometry0, config[iZone]); /*--- Boundary displacements ---*/ - solver[iZone][iInst][MESH_0][ADJMESH_SOL]->RegisterVariables(geometry[iZone][iInst][MESH_0], config[iZone]); + solvers0[ADJMESH_SOL]->RegisterVariables(geometry0, config[iZone]); } } @@ -232,27 +221,12 @@ void CDiscAdjHeatIteration::RegisterOutput(CSolver***** solver, CGeometry**** ge solver[iZone][iInst][MESH_0][ADJHEAT_SOL]->RegisterOutput(geometry[iZone][iInst][MESH_0], config[iZone]); } -void CDiscAdjHeatIteration::Update(COutput* output, CIntegration**** integration, CGeometry**** geometry, - CSolver***** solver, CNumerics****** numerics, CConfig** config, - CSurfaceMovement** surface_movement, CVolumetricMovement*** grid_movement, - CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst) { - - /*--- Dual time stepping strategy ---*/ - - if ((config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || - (config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)) { - for (auto iMesh = 0u; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) { - integration[val_iZone][val_iInst][ADJHEAT_SOL]->SetConvergence(false); - } - } -} - bool CDiscAdjHeatIteration::Monitor(COutput* output, CIntegration**** integration, CGeometry**** geometry, CSolver***** solver, CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement, CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst) { - output->SetHistory_Output(geometry[val_iZone][INST_0][MESH_0], solver[val_iZone][INST_0][MESH_0], config[val_iZone], + output->SetHistoryOutput(geometry[val_iZone][INST_0][MESH_0], solver[val_iZone][INST_0][MESH_0], config[val_iZone], config[val_iZone]->GetTimeIter(), config[val_iZone]->GetOuterIter(), config[val_iZone]->GetInnerIter()); diff --git a/SU2_CFD/src/iteration/CFEAIteration.cpp b/SU2_CFD/src/iteration/CFEAIteration.cpp index 2f560f05cf8..3d1b5fd857e 100644 --- a/SU2_CFD/src/iteration/CFEAIteration.cpp +++ b/SU2_CFD/src/iteration/CFEAIteration.cpp @@ -2,7 +2,7 @@ * \file CFEAIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -48,9 +48,6 @@ void CFEAIteration::Iterate(COutput* output, CIntegration**** integration, CGeom CIntegration* feaIntegration = integration[val_iZone][val_iInst][FEA_SOL]; CSolver* feaSolver = solver[val_iZone][val_iInst][MESH_0][FEA_SOL]; - /*--- Set the convergence monitor to false, to prevent the solver to stop in intermediate FSI subiterations ---*/ - feaIntegration->SetConvergence(false); - /*--- FEA equations ---*/ config[val_iZone]->SetGlobalParam(MAIN_SOLVER::FEM_ELASTICITY, RUNTIME_FEA_SYS); @@ -72,8 +69,8 @@ void CFEAIteration::Iterate(COutput* output, CIntegration**** integration, CGeom } else if (nonlinear && !incremental_load) { /*--- THIS IS THE DIRECT APPROACH (NO INCREMENTAL LOAD APPLIED) ---*/ - /*--- Keep the current inner iter, we need to restore it in discrete adjoint cases as file output depends on it - * ---*/ + /*--- Keep the current inner iter, we need to restore it in discrete adjoint cases + * because file output depends on it. ---*/ const auto CurIter = config[val_iZone]->GetInnerIter(); /*--- Newton-Raphson subiterations ---*/ @@ -87,12 +84,11 @@ void CFEAIteration::Iterate(COutput* output, CIntegration**** integration, CGeom if (disc_adj_fem) { config[val_iZone]->SetInnerIter(CurIter); break; - } else { - StopCalc = Monitor(output, integration, geometry, solver, numerics, config, surface_movement, grid_movement, - FFDBox, val_iZone, INST_0); - - if (StopCalc && (IntIter > 0)) break; } + StopCalc = Monitor(output, integration, geometry, solver, numerics, config, surface_movement, grid_movement, + FFDBox, val_iZone, INST_0); + + if (StopCalc && (IntIter > 0)) break; } } else { @@ -105,13 +101,16 @@ void CFEAIteration::Iterate(COutput* output, CIntegration**** integration, CGeom /*--- Run two nonlinear iterations to check if incremental loading can be skipped ---*/ - for (IntIter = 0; IntIter < 2; ++IntIter) { + auto Iterate = [&](unsigned long IntIter) { config[val_iZone]->SetInnerIter(IntIter); - feaIntegration->Structural_Iteration(geometry, solver, numerics, config, RUNTIME_FEA_SYS, val_iZone, val_iInst); StopCalc = Monitor(output, integration, geometry, solver, numerics, config, surface_movement, grid_movement, FFDBox, val_iZone, INST_0); + }; + + for (IntIter = 0; IntIter < 2; ++IntIter) { + Iterate(IntIter); } /*--- Early return if we already meet the convergence criteria. ---*/ @@ -129,13 +128,7 @@ void CFEAIteration::Iterate(COutput* output, CIntegration**** integration, CGeom /*--- Newton-Raphson subiterations ---*/ for (IntIter = 2; IntIter < config[val_iZone]->GetnInner_Iter(); IntIter++) { - config[val_iZone]->SetInnerIter(IntIter); - - feaIntegration->Structural_Iteration(geometry, solver, numerics, config, RUNTIME_FEA_SYS, val_iZone, val_iInst); - - StopCalc = Monitor(output, integration, geometry, solver, numerics, config, surface_movement, grid_movement, - FFDBox, val_iZone, INST_0); - + Iterate(IntIter); if (StopCalc) break; } @@ -166,14 +159,7 @@ void CFEAIteration::Iterate(COutput* output, CIntegration**** integration, CGeom /*--- Newton-Raphson subiterations ---*/ for (IntIter = 0; IntIter < config[val_iZone]->GetnInner_Iter(); IntIter++) { - config[val_iZone]->SetInnerIter(IntIter); - - feaIntegration->Structural_Iteration(geometry, solver, numerics, config, RUNTIME_FEA_SYS, val_iZone, - val_iInst); - - StopCalc = Monitor(output, integration, geometry, solver, numerics, config, surface_movement, grid_movement, - FFDBox, val_iZone, INST_0); - + Iterate(IntIter); if (StopCalc && (IntIter > 0)) break; } } @@ -187,30 +173,16 @@ void CFEAIteration::Update(COutput* output, CIntegration**** integration, CGeome CNumerics****** numerics, CConfig** config, CSurfaceMovement** surface_movement, CVolumetricMovement*** grid_movement, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst) { - const auto TimeIter = config[val_iZone]->GetTimeIter(); - const bool dynamic = (config[val_iZone]->GetTime_Domain()); - const bool fsi = config[val_iZone]->GetFSI_Simulation(); - CSolver* feaSolver = solver[val_iZone][val_iInst][MESH_0][FEA_SOL]; /*----------------- Update structural solver ----------------------*/ - if (dynamic) { - integration[val_iZone][val_iInst][FEA_SOL]->SetDualTime_Solver( - geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0][FEA_SOL], config[val_iZone], - MESH_0); - integration[val_iZone][val_iInst][FEA_SOL]->SetConvergence(false); - - /*--- Verify convergence criteria (based on total time) ---*/ - - const su2double Physical_dt = config[val_iZone]->GetDelta_DynTime(); - const su2double Physical_t = (TimeIter + 1) * Physical_dt; - if (Physical_t >= config[val_iZone]->GetTotal_DynTime()) - integration[val_iZone][val_iInst][FEA_SOL]->SetConvergence(true); - - } else if (fsi) { - /*--- For FSI problems, output the relaxed result, which is the one transferred into the fluid domain (for restart - * purposes) ---*/ + if (config[val_iZone]->GetTime_Domain()) { + integration[val_iZone][val_iInst][FEA_SOL]->SetDualTime_Solver(geometry[val_iZone][val_iInst][MESH_0], feaSolver, + config[val_iZone], MESH_0); + } else if (config[val_iZone]->GetFSI_Simulation() && config[val_iZone]->GetRelaxation()) { + /*--- For FSI problems with relaxation, output the relaxed result, which is the one transferred into the fluid + * domain (for consistent restart purposes). ---*/ if (config[val_iZone]->GetKind_TimeIntScheme_FEA() == STRUCT_TIME_INT::NEWMARK_IMPLICIT) { feaSolver->ImplicitNewmark_Relaxation(geometry[val_iZone][val_iInst][MESH_0], config[val_iZone]); } @@ -252,11 +224,9 @@ bool CFEAIteration::Monitor(COutput* output, CIntegration**** integration, CGeom UsedTime = StopTime - StartTime; - if (config[val_iZone]->GetMultizone_Problem() || config[val_iZone]->GetSinglezone_Driver()) { - output->SetHistory_Output(geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0], - config[val_iZone], config[val_iZone]->GetTimeIter(), config[val_iZone]->GetOuterIter(), - config[val_iZone]->GetInnerIter()); - } + output->SetHistoryOutput(geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0], + config[val_iZone], config[val_iZone]->GetTimeIter(), config[val_iZone]->GetOuterIter(), + config[val_iZone]->GetInnerIter()); return output->GetConvergence(); } @@ -272,7 +242,4 @@ void CFEAIteration::Solve(COutput* output, CIntegration**** integration, CGeomet if (multizone && !config[val_iZone]->GetTime_Domain()) { Output(output, geometry, solver, config, config[val_iZone]->GetOuterIter(), false, val_iZone, val_iInst); } - - /*--- Set the structural convergence to false (to make sure outer subiterations converge) ---*/ - integration[val_iZone][val_iInst][FEA_SOL]->SetConvergence(false); } diff --git a/SU2_CFD/src/iteration/CFEMFluidIteration.cpp b/SU2_CFD/src/iteration/CFEMFluidIteration.cpp index 8fb9b09c420..a599fec41a3 100644 --- a/SU2_CFD/src/iteration/CFEMFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CFEMFluidIteration.cpp @@ -2,7 +2,7 @@ * \file CFEMFluidIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/iteration/CFluidIteration.cpp b/SU2_CFD/src/iteration/CFluidIteration.cpp index db7a7a18be4..f879606b66e 100644 --- a/SU2_CFD/src/iteration/CFluidIteration.cpp +++ b/SU2_CFD/src/iteration/CFluidIteration.cpp @@ -2,7 +2,7 @@ * \file CFluidIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -98,7 +98,7 @@ void CFluidIteration::Iterate(COutput* output, CIntegration**** integration, CGe RUNTIME_TURB_SYS, val_iZone, val_iInst); } - if (config[val_iZone]->GetKind_Species_Model() != SPECIES_MODEL::NONE){ + if (config[val_iZone]->GetKind_Species_Model() != SPECIES_MODEL::NONE) { config[val_iZone]->SetGlobalParam(main_solver, RUNTIME_SPECIES_SYS); integration[val_iZone][val_iInst][SPECIES_SOL]->SingleGrid_Iteration(geometry, solver, numerics, config, RUNTIME_SPECIES_SYS, val_iZone, val_iInst); @@ -171,8 +171,6 @@ void CFluidIteration::Update(COutput* output, CIntegration**** integration, CGeo integration[val_iZone][val_iInst][FLOW_SOL]->SetDualTime_Geometry(geometry[val_iZone][val_iInst][iMesh], solver[val_iZone][val_iInst][iMesh][MESH_SOL], config[val_iZone], iMesh); - - integration[val_iZone][val_iInst][FLOW_SOL]->SetConvergence(false); } SetDualTime_Aeroelastic(config[val_iZone]); @@ -185,7 +183,6 @@ void CFluidIteration::Update(COutput* output, CIntegration**** integration, CGeo integration[val_iZone][val_iInst][TURB_SOL]->SetDualTime_Solver(geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0][TURB_SOL], config[val_iZone], MESH_0); - integration[val_iZone][val_iInst][TURB_SOL]->SetConvergence(false); } /*--- Update dual time solver for the transition model ---*/ @@ -194,7 +191,6 @@ void CFluidIteration::Update(COutput* output, CIntegration**** integration, CGeo integration[val_iZone][val_iInst][TRANS_SOL]->SetDualTime_Solver(geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0][TRANS_SOL], config[val_iZone], MESH_0); - integration[val_iZone][val_iInst][TRANS_SOL]->SetConvergence(false); } /*--- Update dual time solver for the weakly coupled energy equation ---*/ @@ -203,7 +199,6 @@ void CFluidIteration::Update(COutput* output, CIntegration**** integration, CGeo integration[val_iZone][val_iInst][HEAT_SOL]->SetDualTime_Solver(geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0][HEAT_SOL], config[val_iZone], MESH_0); - integration[val_iZone][val_iInst][HEAT_SOL]->SetConvergence(false); } } } @@ -218,11 +213,9 @@ bool CFluidIteration::Monitor(COutput* output, CIntegration**** integration, CGe UsedTime = StopTime - StartTime; - if (config[val_iZone]->GetMultizone_Problem() || config[val_iZone]->GetSinglezone_Driver()) { - output->SetHistory_Output(geometry[val_iZone][INST_0][MESH_0], solver[val_iZone][INST_0][MESH_0], config[val_iZone], - config[val_iZone]->GetTimeIter(), config[val_iZone]->GetOuterIter(), - config[val_iZone]->GetInnerIter()); - } + output->SetHistoryOutput(geometry[val_iZone][val_iInst][MESH_0], solver[val_iZone][val_iInst][MESH_0], + config[val_iZone], config[val_iZone]->GetTimeIter(), config[val_iZone]->GetOuterIter(), + config[val_iZone]->GetInnerIter()); /*--- If convergence was reached --*/ StopCalc = output->GetConvergence(); @@ -243,7 +236,7 @@ void CFluidIteration::Postprocess(COutput* output, CIntegration**** integration, CFreeFormDefBox*** FFDBox, unsigned short val_iZone, unsigned short val_iInst) { /*--- Temporary: enable only for single-zone driver. This should be removed eventually when generalized. ---*/ - if (config[val_iZone]->GetSinglezone_Driver()) { + if (!config[val_iZone]->GetMultizone_Problem()) { /*--- Compute the tractions at the vertices ---*/ solver[val_iZone][val_iInst][MESH_0][FLOW_SOL]->ComputeVertexTractions(geometry[val_iZone][val_iInst][MESH_0], @@ -296,15 +289,6 @@ void CFluidIteration::Solve(COutput* output, CIntegration**** integration, CGeom if (multizone && steady) { Output(output, geometry, solver, config, config[val_iZone]->GetOuterIter(), StopCalc, val_iZone, val_iInst); - - /*--- Set the convergence to false (to make sure outer subiterations converge) ---*/ - - if (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::HEAT_EQUATION) { - integration[val_iZone][INST_0][HEAT_SOL]->SetConvergence(false); - } - else { - integration[val_iZone][INST_0][FLOW_SOL]->SetConvergence(false); - } } } @@ -313,18 +297,7 @@ void CFluidIteration::SetWind_GustField(CConfig* config, CGeometry** geometry, C // described in the NASA TM–2012-217771 - Development, Verification and Use of Gust Modeling in the NASA Computational // Fluid Dynamics Code FUN3D the desired gust is prescribed as the negative of the grid velocity. - // If a source term is included to account for the gust field, the method is described by Jones et al. as the Split - // Velocity Method in Simulation of Airfoil Gust Responses Using Prescribed Velocities. In this routine the gust - // derivatives needed for the source term are calculated when applicable. If the gust derivatives are zero the source - // term is also zero. The source term itself is implemented in the class CSourceWindGust - - if (rank == MASTER_NODE) cout << endl << "Running simulation with a Wind Gust." << endl; - unsigned short iDim, nDim = geometry[MESH_0]->GetnDim(); // We assume nDim = 2 - if (nDim != 2) { - if (rank == MASTER_NODE) { - cout << endl << "WARNING - Wind Gust capability is only verified for 2 dimensional simulations." << endl; - } - } + unsigned short iDim, nDim = geometry[MESH_0]->GetnDim(); /*--- Gust Parameters from config ---*/ unsigned short Gust_Type = config->GetGust_Type(); @@ -340,8 +313,8 @@ void CFluidIteration::SetWind_GustField(CConfig* config, CGeometry** geometry, C unsigned long iPoint; unsigned short iMGlevel, nMGlevel = config->GetnMGLevels(); - su2double x, y, x_gust, dgust_dx, dgust_dy, dgust_dt; - su2double *Gust, *GridVel, *NewGridVel, *GustDer; + su2double x, y, x_gust, Gust[3] = {0.0}, NewGridVel[3] = {0.0}; + const su2double* GridVel = nullptr; su2double Physical_dt = config->GetDelta_UnstTime(); unsigned long TimeIter = config->GetTimeIter(); @@ -351,16 +324,13 @@ void CFluidIteration::SetWind_GustField(CConfig* config, CGeometry** geometry, C su2double Uinf = solver[MESH_0][FLOW_SOL]->GetVelocity_Inf(0); // Assumption gust moves at infinity velocity - Gust = new su2double[nDim]; - NewGridVel = new su2double[nDim]; - for (iDim = 0; iDim < nDim; iDim++) { - Gust[iDim] = 0.0; - NewGridVel[iDim] = 0.0; - } - - GustDer = new su2double[3]; - for (unsigned short i = 0; i < 3; i++) { - GustDer[i] = 0.0; + // Print some information to check that we are doing the right thing. Not sure how to convert the index back to a string... + if (rank == MASTER_NODE) { + cout << endl << "Setting up a wind gust type " << Gust_Type << " with amplitude of " << gust_amp << " in direction " << GustDir << endl; + cout << " U_inf = " << Uinf << endl; + cout << " Physical_t = " << Physical_t << endl; + su2double loc_x = (xbegin + L + Uinf * (Physical_t - tbegin)); + cout << " Location_x = " << loc_x << endl; } // Vortex variables @@ -382,7 +352,7 @@ void CFluidIteration::SetWind_GustField(CConfig* config, CGeometry** geometry, C for (iPoint = 0; iPoint < geometry[iMGlevel]->GetnPoint(); iPoint++) { /*--- Reset the Grid Velocity to zero if there is no grid movement ---*/ - if (Kind_Grid_Movement == GUST && !(config->GetFSI_Simulation())) { + if (Kind_Grid_Movement == GUST && !(config->GetFSI_Simulation()) && !(config->GetDeform_Mesh())) { for (iDim = 0; iDim < nDim; iDim++) geometry[iMGlevel]->nodes->SetGridVel(iPoint, iDim, 0.0); } @@ -391,9 +361,6 @@ void CFluidIteration::SetWind_GustField(CConfig* config, CGeometry** geometry, C for (iDim = 0; iDim < nDim; iDim++) { Gust[iDim] = 0.0; } - dgust_dx = 0.0; - dgust_dy = 0.0; - dgust_dt = 0.0; /*--- Begin applying the gust ---*/ @@ -418,23 +385,13 @@ void CFluidIteration::SetWind_GustField(CConfig* config, CGeometry** geometry, C // Check if we are in the region where the gust is active if (x_gust > 0 && x_gust < n) { Gust[GustDir] = gust_amp * (sin(2 * PI_NUMBER * x_gust)); - - // Gust derivatives - // dgust_dx = gust_amp*2*PI_NUMBER*(cos(2*PI_NUMBER*x_gust))/L; - // dgust_dy = 0; - // dgust_dt = gust_amp*2*PI_NUMBER*(cos(2*PI_NUMBER*x_gust))*(-Uinf)/L; } break; case ONE_M_COSINE: // Check if we are in the region where the gust is active if (x_gust > 0 && x_gust < n) { - Gust[GustDir] = gust_amp * (1 - cos(2 * PI_NUMBER * x_gust)); - - // Gust derivatives - // dgust_dx = gust_amp*2*PI_NUMBER*(sin(2*PI_NUMBER*x_gust))/L; - // dgust_dy = 0; - // dgust_dt = gust_amp*2*PI_NUMBER*(sin(2*PI_NUMBER*x_gust))*(-Uinf)/L; + Gust[GustDir] = gust_amp * 0.5 * (1 - cos(2 * PI_NUMBER * x_gust)); } break; @@ -469,15 +426,6 @@ void CFluidIteration::SetWind_GustField(CConfig* config, CGeometry** geometry, C } } - /*--- Set the Wind Gust, Wind Gust Derivatives and the Grid Velocities ---*/ - - GustDer[0] = dgust_dx; - GustDer[1] = dgust_dy; - GustDer[2] = dgust_dt; - - solver[iMGlevel][FLOW_SOL]->GetNodes()->SetWindGust(iPoint, Gust); - solver[iMGlevel][FLOW_SOL]->GetNodes()->SetWindGustDer(iPoint, GustDer); - GridVel = geometry[iMGlevel]->nodes->GetGridVel(iPoint); /*--- Store new grid velocity ---*/ @@ -488,10 +436,6 @@ void CFluidIteration::SetWind_GustField(CConfig* config, CGeometry** geometry, C } } } - - delete[] Gust; - delete[] GustDer; - delete[] NewGridVel; } void CFluidIteration::InitializeVortexDistribution(unsigned long& nVortex, vector& x0, vector& y0, @@ -512,7 +456,7 @@ void CFluidIteration::InitializeVortexDistribution(unsigned long& nVortex, vecto while (file.good()) { getline(file, line); std::stringstream ss(line); - if (line.size() != 0) { // ignore blank lines if they exist. + if (!line.empty()) { // ignore blank lines if they exist. ss >> x_temp; ss >> y_temp; ss >> vort_strength_temp; @@ -541,7 +485,7 @@ bool CFluidIteration::MonitorFixed_CL(COutput *output, CGeometry *geometry, CSol /* --- Print convergence history and volume files since fixed CL mode has converged--- */ if (rank == MASTER_NODE) output->PrintConvergenceSummary(); - output->SetResult_Files(geometry, config, solver, + output->SetResultFiles(geometry, config, solver, config->GetInnerIter(), true); /* --- Set finite difference mode in config (disables output) --- */ @@ -588,9 +532,8 @@ void CFluidIteration::SetDualTime_Aeroelastic(CConfig* config) const { Monitoring_Tag = config->GetMarker_Monitoring_TagBound(iMarker_Monitoring); Marker_Tag = config->GetMarker_All_TagBound(iMarker); if (Marker_Tag == Monitoring_Tag) { owner = 1; break; - } else { - owner = 0; - } + } owner = 0; + } plunge = config->GetAeroelastic_plunge(iMarker_Monitoring); diff --git a/SU2_CFD/src/iteration/CHeatIteration.cpp b/SU2_CFD/src/iteration/CHeatIteration.cpp index e90bcde5144..6ca18523335 100644 --- a/SU2_CFD/src/iteration/CHeatIteration.cpp +++ b/SU2_CFD/src/iteration/CHeatIteration.cpp @@ -2,7 +2,7 @@ * \file CHeatIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -58,8 +58,6 @@ void CHeatIteration::Update(COutput* output, CIntegration**** integration, CGeom integration[val_iZone][val_iInst][HEAT_SOL]->SetDualTime_Geometry(geometry[val_iZone][val_iInst][iMesh], solver[val_iZone][val_iInst][iMesh][MESH_SOL], config[val_iZone], iMesh); - - integration[val_iZone][val_iInst][HEAT_SOL]->SetConvergence(false); } } } diff --git a/SU2_CFD/src/iteration/CIteration.cpp b/SU2_CFD/src/iteration/CIteration.cpp index 337e24edaea..98190ef3972 100644 --- a/SU2_CFD/src/iteration/CIteration.cpp +++ b/SU2_CFD/src/iteration/CIteration.cpp @@ -2,7 +2,7 @@ * \file iteration_structure.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -60,9 +60,33 @@ void CIteration::SetGrid_Movement(CGeometry** geometry, CSurfaceMovement* surfac break; - /*--- Already initialized in the static mesh movement routine at driver level. ---*/ case STEADY_TRANSLATION: + /*--- Set or update the translating frame mesh movement with the current translation rates, + * which might be altered via the python interface. ---*/ + + if (rank == MASTER_NODE) cout << "\n Setting translational grid velocities." << endl; + + /*--- Set the translational velocity on all grid levels. ---*/ + + for (auto iMGlevel = 0u; iMGlevel <= config->GetnMGLevels(); iMGlevel++) + geometry[iMGlevel]->SetTranslationalVelocity(config, iMGlevel == 0); + + break; + case ROTATING_FRAME: + /*--- Set or update the rotating frame mesh movement with the current translation and rotation + * rates, which might be altered via the python interface. ---*/ + + if (rank == MASTER_NODE) cout << "\n Setting rotating frame grid velocities." << endl; + + /*--- Set the grid velocities on all multigrid levels for a steadily + rotating reference frame. ---*/ + + for (auto iMGlevel = 0u; iMGlevel <= config->GetnMGLevels(); iMGlevel++){ + geometry[iMGlevel]->SetRotationalVelocity(config, iMGlevel == 0); + geometry[iMGlevel]->SetShroudVelocity(config); + } + break; } @@ -163,7 +187,7 @@ void CIteration::SetMesh_Deformation(CGeometry** geometry, CSolver** solver, CNu /*--- Set the stiffness of each element mesh into the mesh numerics ---*/ - solver[MESH_SOL]->SetMesh_Stiffness(geometry, numerics[MESH_SOL], config); + solver[MESH_SOL]->SetMesh_Stiffness(numerics[MESH_SOL], config); /*--- Deform the volume grid around the new boundary locations ---*/ @@ -175,6 +199,6 @@ void CIteration::SetMesh_Deformation(CGeometry** geometry, CSolver** solver, CNu void CIteration::Output(COutput* output, CGeometry**** geometry, CSolver***** solver, CConfig** config, unsigned long InnerIter, bool StopCalc, unsigned short val_iZone, unsigned short val_iInst) { - output->SetResult_Files(geometry[val_iZone][INST_0][MESH_0], config[val_iZone], solver[val_iZone][INST_0][MESH_0], + output->SetResultFiles(geometry[val_iZone][INST_0][MESH_0], config[val_iZone], solver[val_iZone][INST_0][MESH_0], InnerIter); } diff --git a/SU2_CFD/src/iteration/CIterationFactory.cpp b/SU2_CFD/src/iteration/CIterationFactory.cpp index 8e9fd4e86b8..159d8133c51 100644 --- a/SU2_CFD/src/iteration/CIterationFactory.cpp +++ b/SU2_CFD/src/iteration/CIterationFactory.cpp @@ -2,7 +2,7 @@ * \file CAdjFluidIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/iteration/CTurboIteration.cpp b/SU2_CFD/src/iteration/CTurboIteration.cpp index 464ae8186ea..0028df639f7 100644 --- a/SU2_CFD/src/iteration/CTurboIteration.cpp +++ b/SU2_CFD/src/iteration/CTurboIteration.cpp @@ -2,7 +2,7 @@ * \file CTurboIteration.cpp * \brief Main subroutines used by SU2_CFD * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/limiters/CLimiterDetails.cpp b/SU2_CFD/src/limiters/CLimiterDetails.cpp index 646139d2ff0..22636efe0b8 100644 --- a/SU2_CFD/src/limiters/CLimiterDetails.cpp +++ b/SU2_CFD/src/limiters/CLimiterDetails.cpp @@ -3,7 +3,7 @@ * \brief A class template that allows defining limiters via * specialization of particular details. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/meson.build b/SU2_CFD/src/meson.build index fd5a5252d0e..946227cd305 100644 --- a/SU2_CFD/src/meson.build +++ b/SU2_CFD/src/meson.build @@ -6,12 +6,14 @@ su2_cfd_src = files(['definition_structure.cpp', su2_cfd_src += files(['fluid/CFluidModel.cpp', 'fluid/CIdealGas.cpp', 'fluid/CFluidScalar.cpp', + 'fluid/CFluidFlamelet.cpp', 'fluid/CPengRobinson.cpp', 'fluid/CVanDerWaalsGas.cpp', 'fluid/CCoolProp.cpp', 'fluid/CNEMOGas.cpp', 'fluid/CMutationTCLib.cpp', - 'fluid/CSU2TCLib.cpp']) + 'fluid/CSU2TCLib.cpp', + 'fluid/CDataDrivenFluid.cpp']) su2_cfd_src += files(['output/COutputFactory.cpp', 'output/CAdjElasticityOutput.cpp', @@ -30,9 +32,7 @@ su2_cfd_src += files(['output/COutputFactory.cpp', 'output/CHeatOutput.cpp', 'output/CMeshOutput.cpp', 'output/CNEMOCompOutput.cpp', - 'output/output_physics.cpp', 'output/COutput.cpp', - 'output/output_structure_legacy.cpp', 'output/filewriter/CParallelDataSorter.cpp', 'output/filewriter/CFVMDataSorter.cpp', 'output/filewriter/CFEMDataSorter.cpp', @@ -60,6 +60,7 @@ su2_cfd_src += files(['variables/CIncNSVariable.cpp', 'variables/CTurbVariable.cpp', 'variables/CScalarVariable.cpp', 'variables/CSpeciesVariable.cpp', + 'variables/CSpeciesFlameletVariable.cpp', 'variables/CAdjNSVariable.cpp', 'variables/CBaselineVariable.cpp', 'variables/CDiscAdjFEABoundVariable.cpp', @@ -109,6 +110,7 @@ su2_cfd_src += files(['solvers/CSolverFactory.cpp', 'solvers/CSolver.cpp', 'solvers/CTemplateSolver.cpp', 'solvers/CSpeciesSolver.cpp', + 'solvers/CSpeciesFlameletSolver.cpp', 'solvers/CTransLMSolver.cpp', 'solvers/CTurbSolver.cpp', 'solvers/CTurbSASolver.cpp', @@ -122,7 +124,6 @@ su2_cfd_src += files(['numerics/CNumerics.cpp', 'numerics/flow/convection/roe.cpp', 'numerics/flow/convection/fds.cpp', 'numerics/flow/convection/fvs.cpp', - 'numerics/flow/convection/cusp.cpp', 'numerics/flow/convection/hllc.cpp', 'numerics/flow/convection/ausm_slau.cpp', 'numerics/flow/convection/centered.cpp', @@ -162,7 +163,8 @@ su2_cfd_src += files(['drivers/CDriver.cpp', 'drivers/CSinglezoneDriver.cpp', 'drivers/CDiscAdjMultizoneDriver.cpp', 'drivers/CDiscAdjSinglezoneDriver.cpp', - 'drivers/CDummyDriver.cpp']) + 'drivers/CDummyDriver.cpp', + 'drivers/CDriverBase.cpp']) su2_cfd_src += files(['integration/CIntegration.cpp', 'integration/CIntegrationFactory.cpp', diff --git a/SU2_CFD/src/numerics/CGradSmoothing.cpp b/SU2_CFD/src/numerics/CGradSmoothing.cpp index 84685c722ed..7ce9c56d2ab 100644 --- a/SU2_CFD/src/numerics/CGradSmoothing.cpp +++ b/SU2_CFD/src/numerics/CGradSmoothing.cpp @@ -2,7 +2,7 @@ * \file CGradSmoothing.cpp * \brief Numerics for gradient smoothing problems. * \author T.Dick - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/CNumerics.cpp b/SU2_CFD/src/numerics/CNumerics.cpp index 12a83bf7daa..19a73d8edeb 100644 --- a/SU2_CFD/src/numerics/CNumerics.cpp +++ b/SU2_CFD/src/numerics/CNumerics.cpp @@ -4,7 +4,7 @@ * Contains methods for common tasks, e.g. compute flux * Jacobians. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -31,7 +31,7 @@ #include "../../include/numerics/CNumerics.hpp" #include "../../include/fluid/CFluidModel.hpp" -CNumerics::CNumerics(void) { +CNumerics::CNumerics() { Proj_Flux_Tensor = nullptr; @@ -75,7 +75,7 @@ CNumerics::CNumerics(unsigned short val_nDim, unsigned short val_nVar, } -CNumerics::~CNumerics(void) { +CNumerics::~CNumerics() { // visc delete [] Proj_Flux_Tensor; diff --git a/SU2_CFD/src/numerics/NEMO/CNEMONumerics.cpp b/SU2_CFD/src/numerics/NEMO/CNEMONumerics.cpp index fe2ab39173d..f1219a0c7f2 100644 --- a/SU2_CFD/src/numerics/NEMO/CNEMONumerics.cpp +++ b/SU2_CFD/src/numerics/NEMO/CNEMONumerics.cpp @@ -4,7 +4,7 @@ * Contains methods for common tasks, e.g. compute flux * Jacobians. * \author S.R. Copeland, W. Maier, C. Garbacz - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -75,7 +75,7 @@ CNEMONumerics::CNEMONumerics(unsigned short val_nDim, unsigned short val_nVar, } } -CNEMONumerics::~CNEMONumerics(void) { +CNEMONumerics::~CNEMONumerics() { delete fluidmodel; } @@ -84,28 +84,27 @@ void CNEMONumerics::GetInviscidProjFlux(const su2double *val_U, const su2double *val_V, const su2double *val_normal, su2double *val_Proj_Flux) { - unsigned short iSpecies, iVar; - su2double rho, u, v, w, rhoEve, P, H; + const su2double *rhos; /*--- Initialize vectors ---*/ - for (iVar = 0; iVar < nVar; iVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) val_Proj_Flux[iVar] = 0.0; /*--- Rename for convienience ---*/ - rho = val_V[RHO_INDEX]; - u = val_V[VEL_INDEX]; - v = val_V[VEL_INDEX+1]; - w = val_V[VEL_INDEX+2]; - P = val_V[P_INDEX]; - H = val_V[H_INDEX]; - rhoEve = val_U[nSpecies+nDim+1]; + const su2double rho = val_V[RHO_INDEX]; + const su2double u = val_V[VEL_INDEX]; + const su2double v = val_V[VEL_INDEX+1]; + const su2double w = val_V[VEL_INDEX+2]; + const su2double P = val_V[P_INDEX]; + const su2double H = val_V[H_INDEX]; + const su2double rhoEve = val_U[nSpecies+nDim+1]; rhos = &val_V[RHOS_INDEX]; if (nDim == 2) { /*--- iDim = 0 (x-direction) ---*/ - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) val_Proj_Flux[iSpecies] = (rhos[iSpecies]*u) * val_normal[0]; val_Proj_Flux[nSpecies] = (rho*u*u + P) * val_normal[0]; val_Proj_Flux[nSpecies+1] = (rho*u*v) * val_normal[0]; @@ -113,7 +112,7 @@ void CNEMONumerics::GetInviscidProjFlux(const su2double *val_U, val_Proj_Flux[nSpecies+3] = (rhoEve*u) * val_normal[0]; /*---- iDim = 1 (y-direction) ---*/ - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) val_Proj_Flux[iSpecies] += (rhos[iSpecies]*v) * val_normal[1]; val_Proj_Flux[nSpecies] += (rho*v*u) * val_normal[1]; val_Proj_Flux[nSpecies+1] += (rho*v*v + P) * val_normal[1]; @@ -123,7 +122,7 @@ void CNEMONumerics::GetInviscidProjFlux(const su2double *val_U, else { /*--- iDim = 0 (x-direction) ---*/ - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) val_Proj_Flux[iSpecies] = (rhos[iSpecies]*u) * val_normal[0]; val_Proj_Flux[nSpecies] = (rho*u*u + P) * val_normal[0]; val_Proj_Flux[nSpecies+1] = (rho*u*v) * val_normal[0]; @@ -132,7 +131,7 @@ void CNEMONumerics::GetInviscidProjFlux(const su2double *val_U, val_Proj_Flux[nSpecies+4] = (rhoEve*u) * val_normal[0]; /*--- iDim = 0 (y-direction) ---*/ - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) val_Proj_Flux[iSpecies] += (rhos[iSpecies]*v) * val_normal[1]; val_Proj_Flux[nSpecies] += (rho*v*u) * val_normal[1]; val_Proj_Flux[nSpecies+1] += (rho*v*v + P) * val_normal[1]; @@ -141,7 +140,7 @@ void CNEMONumerics::GetInviscidProjFlux(const su2double *val_U, val_Proj_Flux[nSpecies+4] += (rhoEve*v) * val_normal[1]; /*--- iDim = 0 (z-direction) ---*/ - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) val_Proj_Flux[iSpecies] += (rhos[iSpecies]*w) * val_normal[2]; val_Proj_Flux[nSpecies] += (rho*w*u) * val_normal[2]; val_Proj_Flux[nSpecies+1] += (rho*w*v) * val_normal[2]; @@ -157,33 +156,32 @@ void CNEMONumerics::GetInviscidProjJac(const su2double *val_U, const su2doubl su2double **val_Proj_Jac_Tensor) { const su2double *rhos; - rhos = &val_V[RHOS_INDEX]; /*--- Initialize the Jacobian tensor ---*/ - for (unsigned short iVar = 0; iVar < nVar; iVar++) - for (unsigned short jVar = 0; jVar < nVar; jVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) + for (auto jVar = 0ul; jVar < nVar; jVar++) val_Proj_Jac_Tensor[iVar][jVar] = 0.0; /*--- Rename for convenience ---*/ - su2double rho = val_V[RHO_INDEX]; - su2double H = val_V[H_INDEX]; - su2double rhoEve = val_U[nSpecies+nDim+1]; + const su2double rho = val_V[RHO_INDEX]; + const su2double H = val_V[H_INDEX]; + const su2double rhoEve = val_U[nSpecies+nDim+1]; su2double u[MAXNDIM]; - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) u[iDim] = val_V[VEL_INDEX+iDim]; /*--- Calculate projected velocity ---*/ su2double proj_vel = GeometryToolbox::DotProduct(nDim, u, val_normal); /*--- Species density rows ---*/ - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) { - for (unsigned short jSpecies = 0; jSpecies < nSpecies; jSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { + for (auto jSpecies = 0ul; jSpecies < nSpecies; jSpecies++) { val_Proj_Jac_Tensor[iSpecies][jSpecies] += -(rhos[iSpecies]/rho) * proj_vel; } val_Proj_Jac_Tensor[iSpecies][iSpecies] += proj_vel; - for (unsigned short iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { val_Proj_Jac_Tensor[iSpecies][nSpecies+iDim] += (rhos[iSpecies]/rho) * val_normal[iDim]; val_Proj_Jac_Tensor[nSpecies+iDim][iSpecies] += val_dPdU[iSpecies]*val_normal[iDim] - proj_vel*u[iDim]; } @@ -192,8 +190,8 @@ void CNEMONumerics::GetInviscidProjJac(const su2double *val_U, const su2doubl } /*--- Momentum rows ---*/ - for (unsigned short iDim = 0; iDim < nDim; iDim++) { - for (unsigned short jDim = 0; jDim < nDim; jDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { + for (auto jDim = 0ul; jDim < nDim; jDim++) { val_Proj_Jac_Tensor[nSpecies+iDim][nSpecies+jDim] += val_dPdU[nSpecies+jDim]*val_normal[iDim] + u[iDim]*val_normal[jDim]; } val_Proj_Jac_Tensor[nSpecies+iDim][nSpecies+iDim] += proj_vel; @@ -202,18 +200,18 @@ void CNEMONumerics::GetInviscidProjJac(const su2double *val_U, const su2doubl } /*--- Total energy row ---*/ - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) val_Proj_Jac_Tensor[nSpecies+nDim][nSpecies+iDim] += val_dPdU[nSpecies+iDim]*proj_vel + H*val_normal[iDim]; val_Proj_Jac_Tensor[nSpecies+nDim][nSpecies+nDim] += (1+val_dPdU[nSpecies+nDim])*proj_vel; val_Proj_Jac_Tensor[nSpecies+nDim][nSpecies+nDim+1] += val_dPdU[nSpecies+nDim+1] *proj_vel; /*--- Vib.-el. energy row ---*/ - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) val_Proj_Jac_Tensor[nSpecies+nDim+1][nSpecies+iDim] = rhoEve/rho*val_normal[iDim]; val_Proj_Jac_Tensor[nSpecies+nDim+1][nSpecies+nDim+1] = proj_vel; - for (unsigned short iVar = 0; iVar < nVar; iVar++) - for (unsigned short jVar = 0; jVar < nVar; jVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) + for (auto jVar = 0ul; jVar < nVar; jVar++) val_Proj_Jac_Tensor[iVar][jVar] = val_scale * val_Proj_Jac_Tensor[iVar][jVar]; } @@ -228,10 +226,6 @@ void CNEMONumerics::GetViscousProjFlux(const su2double *val_primvar, su2double val_therm_conductivity_ve, const CConfig *config) { - if (ionization) { - SU2_MPI::Error("NEED TO IMPLEMENT IONIZED FUNCTIONALITY!!!",CURRENT_FUNCTION); - } - // Requires a slightly non-standard primitive vector: // Assumes - V = [Y1, ... , Yn, T, Tve, ... ] // and gradient GV = [GY1, ... , GYn, GT, GTve, ... ] @@ -240,17 +234,17 @@ void CNEMONumerics::GetViscousProjFlux(const su2double *val_primvar, su2activematrix Flux_Tensor(nVar,nDim); /*--- Initialize ---*/ - for (auto iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { Proj_Flux_Tensor[iVar] = 0.0; - for (auto iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) Flux_Tensor[iVar][iDim] = 0.0; } /*--- Rename variables for convenience ---*/ const auto& Ds = val_diffusioncoeff; const su2double mu = val_lam_viscosity+val_eddy_viscosity; - su2double ktr = val_therm_conductivity; - su2double kve = val_therm_conductivity_ve; + const su2double ktr = val_therm_conductivity; + const su2double kve = val_therm_conductivity_ve; const su2double rho = val_primvar[RHO_INDEX]; const su2double T = val_primvar[T_INDEX]; const su2double Tve = val_primvar[TVE_INDEX]; @@ -260,8 +254,8 @@ void CNEMONumerics::GetViscousProjFlux(const su2double *val_primvar, /*--- Pre-compute mixture quantities ---*/ //TODO su2double Vector[MAXNDIM] = {0.0}; - for (auto iDim = 0; iDim < nDim; iDim++) { - for (auto iSpecies = 0; iSpecies < nHeavy; iSpecies++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { + for (auto iSpecies = 0ul; iSpecies < nHeavy; iSpecies++) { Vector[iDim] += rho*Ds[iSpecies]*GV[RHOS_INDEX+iSpecies][iDim]; } } @@ -270,23 +264,23 @@ void CNEMONumerics::GetViscousProjFlux(const su2double *val_primvar, ComputeStressTensor(nDim,tau,val_gradprimvar+VEL_INDEX, mu); /*--- Populate entries in the viscous flux vector ---*/ - for (auto iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { /*--- Species diffusion velocity ---*/ - for (auto iSpecies = 0; iSpecies < nHeavy; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nHeavy; iSpecies++) { Flux_Tensor[iSpecies][iDim] = rho*Ds[iSpecies]*GV[RHOS_INDEX+iSpecies][iDim] - V[RHOS_INDEX+iSpecies]*Vector[iDim]; } /*--- Shear-stress/momentum related terms ---*/ Flux_Tensor[nSpecies+nDim][iDim] = 0.0; - for (auto jDim = 0; jDim < nDim; jDim++) { + for (auto jDim = 0ul; jDim < nDim; jDim++) { Flux_Tensor[nSpecies+jDim][iDim] = tau[iDim][jDim]; Flux_Tensor[nSpecies+nDim][iDim] += tau[iDim][jDim]*val_primvar[VEL_INDEX+jDim]; } /*--- Diffusion terms ---*/ - for (auto iSpecies = 0; iSpecies < nHeavy; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nHeavy; iSpecies++) { Flux_Tensor[nSpecies+nDim][iDim] += Flux_Tensor[iSpecies][iDim] * hs[iSpecies]; Flux_Tensor[nSpecies+nDim+1][iDim] += Flux_Tensor[iSpecies][iDim] * val_eve[iSpecies]; } @@ -296,8 +290,8 @@ void CNEMONumerics::GetViscousProjFlux(const su2double *val_primvar, Flux_Tensor[nSpecies+nDim+1][iDim] += kve*GV[TVE_INDEX][iDim]; } - for (auto iVar = 0; iVar < nVar; iVar++) { - for (auto iDim = 0; iDim < nDim; iDim++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { Proj_Flux_Tensor[iVar] += Flux_Tensor[iVar][iDim]*val_normal[iDim]; } } @@ -345,6 +339,12 @@ void CNEMONumerics::GetViscousProjJacs(const su2double *val_Mean_PrimVar, case 10: return COMPUTE_VISCOUS_JACS(10, 5); + case 11: + return COMPUTE_VISCOUS_JACS(11, 7); + + case 12: + return COMPUTE_VISCOUS_JACS(12, 7); + default: return COMPUTE_VISCOUS_JACS(DynamicSize,DynamicSize); @@ -356,32 +356,28 @@ void CNEMONumerics::GetPMatrix(const su2double *U, const su2double *V, const su2 const su2double *val_normal, const su2double *l, const su2double *m, su2double **val_p_tensor) const { - // P matrix is equivalent to the L matrix in Gnoffo - unsigned short iSpecies, iDim, iVar, jVar; - su2double sqvel, rho, a, a2, eve; - su2double vU, vV, vW; - /*--- Initialize the P matrix to zero ---*/ - for (iVar = 0; iVar < nVar; iVar++) - for (jVar = 0; jVar < nVar; jVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) + for (auto jVar = 0ul; jVar < nVar; jVar++) val_p_tensor[iVar][jVar] = 0.0; /*--- Pre-compute useful quantities ---*/ - sqvel = 0.0; - rho = V[RHO_INDEX]; - eve = U[nSpecies+nDim+1]/rho; - vU = 0.0; vV = 0.0; vW = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { + su2double sqvel = 0.0; + const su2double rho = V[RHO_INDEX]; + const su2double eve = U[nSpecies+nDim+1]/rho; + su2double vU, vV, vW; + vU = vV = vW = 0.0; + for (auto iDim = 0ul; iDim < nDim; iDim++) { vU += V[VEL_INDEX+iDim] * val_normal[iDim]; vV += V[VEL_INDEX+iDim] * l[iDim]; vW += V[VEL_INDEX+iDim] * m[iDim]; sqvel += V[VEL_INDEX+iDim] * V[VEL_INDEX+iDim]; } - a = V[A_INDEX]; - a2 = V[A_INDEX]*V[A_INDEX]; + const su2double a = V[A_INDEX]; + const su2double a2 = V[A_INDEX]*V[A_INDEX]; if(nDim == 2) { - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { val_p_tensor[iSpecies][iSpecies] += 1.0/a2; val_p_tensor[iSpecies][nSpecies] += 0.0; val_p_tensor[iSpecies][nSpecies+1] += V[RHOS_INDEX+iSpecies] / (2.0*rho*a2); @@ -395,7 +391,7 @@ void CNEMONumerics::GetPMatrix(const su2double *U, const su2double *V, const su2 val_p_tensor[nSpecies+3][iSpecies] += 0.0; } - for (iDim = 0; iDim < nDim; iDim++){ + for (auto iDim = 0ul; iDim < nDim; iDim++){ val_p_tensor[nSpecies+iDim][nSpecies] += l[iDim]; val_p_tensor[nSpecies+iDim][nSpecies+1] += (V[VEL_INDEX+iDim]+a*val_normal[iDim]) / (2.0*a2); val_p_tensor[nSpecies+iDim][nSpecies+2] += (V[VEL_INDEX+iDim]-a*val_normal[iDim]) / (2.0*a2); @@ -414,7 +410,7 @@ void CNEMONumerics::GetPMatrix(const su2double *U, const su2double *V, const su2 } else { - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { val_p_tensor[iSpecies][iSpecies] = 1.0/a2; val_p_tensor[iSpecies][nSpecies] = 0.0; val_p_tensor[iSpecies][nSpecies+1] = 0.0; @@ -430,7 +426,7 @@ void CNEMONumerics::GetPMatrix(const su2double *U, const su2double *V, const su2 val_p_tensor[nSpecies+4][iSpecies] = 0.0; } - for (iDim = 0; iDim < nDim; iDim++){ + for (auto iDim = 0ul; iDim < nDim; iDim++){ val_p_tensor[nSpecies+iDim][nSpecies] = l[iDim]; val_p_tensor[nSpecies+iDim][nSpecies+1] = m[iDim]; val_p_tensor[nSpecies+iDim][nSpecies+2] = (V[VEL_INDEX+iDim]+a*val_normal[iDim]) / (2.0*a2); @@ -456,30 +452,27 @@ void CNEMONumerics::GetPMatrix_inv(const su2double *U, const su2double *V, const const su2double *val_normal, const su2double *l, const su2double *m, su2double **val_invp_tensor) const { - unsigned short iSpecies, jSpecies, iDim, iVar, jVar; - su2double rho, a, a2, eve; - su2double vU, vV, vW; - - for (iVar = 0; iVar < nVar; iVar++) - for (jVar = 0; jVar < nVar; jVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) + for (auto jVar = 0ul; jVar < nVar; jVar++) val_invp_tensor[iVar][jVar] = 0.0; /*--- Pre-compute useful quantities ---*/ - rho = V[RHO_INDEX]; - eve = U[nSpecies+nDim+1]/rho; - vU = 0.0; vV = 0.0; vW = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { + const su2double rho = V[RHO_INDEX]; + const su2double eve = U[nSpecies+nDim+1]/rho; + su2double vU, vV, vW; + vU = vV = vW = 0.0; + for (auto iDim = 0ul; iDim < nDim; iDim++) { vU += V[VEL_INDEX+iDim] * val_normal[iDim]; vV += V[VEL_INDEX+iDim] * l[iDim]; vW += V[VEL_INDEX+iDim] * m[iDim]; } - a = V[A_INDEX]; - a2 = V[A_INDEX]*V[A_INDEX]; + const su2double a = V[A_INDEX]; + const su2double a2 = V[A_INDEX]*V[A_INDEX]; if (nDim == 2) { - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { - for (jSpecies = 0; jSpecies < nSpecies; jSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { + for (auto jSpecies = 0ul; jSpecies < nSpecies; jSpecies++) { val_invp_tensor[iSpecies][jSpecies] += -(V[RHOS_INDEX+iSpecies]/rho) * val_dPdU[jSpecies]; } val_invp_tensor[iSpecies][iSpecies] += a2; @@ -516,8 +509,8 @@ void CNEMONumerics::GetPMatrix_inv(const su2double *U, const su2double *V, const } else { - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { - for (jSpecies = 0; jSpecies < nSpecies; jSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { + for (auto jSpecies = 0ul; jSpecies < nSpecies; jSpecies++) { val_invp_tensor[iSpecies][jSpecies] += -(V[RHOS_INDEX+iSpecies]/rho) * val_dPdU[jSpecies]; } val_invp_tensor[iSpecies][iSpecies] += a2; diff --git a/SU2_CFD/src/numerics/NEMO/NEMO_diffusion.cpp b/SU2_CFD/src/numerics/NEMO/NEMO_diffusion.cpp index cc64e14d1e2..8de786c08a9 100644 --- a/SU2_CFD/src/numerics/NEMO/NEMO_diffusion.cpp +++ b/SU2_CFD/src/numerics/NEMO/NEMO_diffusion.cpp @@ -3,7 +3,7 @@ * \brief Implementation of numerics classes for discretization * of viscous fluxes in fluid flow NEMO problems. * \author S.R. Copeland, W. Maier, C. Garbacz - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -37,7 +37,7 @@ CAvgGrad_NEMO::CAvgGrad_NEMO(unsigned short val_nDim, val_nPrimVar, val_nPrimVarGrad, config) { - /*--- Compressible flow, primitive variables nDim+3, (T,vx,vy,vz,P,rho) ---*/ + /*--- Compressible flow, primitive variables ---*/ PrimVar_i = new su2double [nPrimVar]; PrimVar_j = new su2double [nPrimVar]; Mean_PrimVar = new su2double [nPrimVar]; @@ -49,26 +49,27 @@ CAvgGrad_NEMO::CAvgGrad_NEMO(unsigned short val_nDim, Mean_Eve = new su2double[nSpecies]; Mean_Cvve = new su2double[nSpecies]; Mean_GU = new su2double*[nVar]; - for (auto iVar = 0; iVar < nVar; iVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) Mean_GU[iVar] = new su2double[nDim]; Mean_Diffusion_Coeff = new su2double[nSpecies]; - /*--- Compressible flow, primitive gradient variables nDim+3, (T,vx,vy,vz) ---*/ + /*--- Compressible flow, primitive gradient variables ---*/ Mean_GradPrimVar = new su2double* [nPrimVarGrad]; - for (auto iVar = 0; iVar < nPrimVarGrad; iVar++) + for (auto iVar = 0ul; iVar < nPrimVarGrad; iVar++) Mean_GradPrimVar[iVar] = new su2double [nDim]; Flux = new su2double[nVar]; Jacobian_i = new su2double* [nVar]; Jacobian_j = new su2double* [nVar]; - for (auto iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { Jacobian_i[iVar] = new su2double [nVar]; Jacobian_j[iVar] = new su2double [nVar]; } + } -CAvgGrad_NEMO::~CAvgGrad_NEMO(void) { +CAvgGrad_NEMO::~CAvgGrad_NEMO() { delete [] PrimVar_i; delete [] PrimVar_j; @@ -81,23 +82,24 @@ CAvgGrad_NEMO::~CAvgGrad_NEMO(void) { delete [] Mean_dTvedU; delete [] Mean_Eve; delete [] Mean_Cvve; - for (auto iVar = 0; iVar < nVar; iVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) delete [] Mean_GU[iVar]; delete [] Mean_GU; - for (auto iVar = 0; iVar < nPrimVarGrad; iVar++) + for (auto iVar = 0ul; iVar < nPrimVarGrad; iVar++) delete [] Mean_GradPrimVar[iVar]; delete [] Mean_GradPrimVar; delete [] Flux; if (Jacobian_i != nullptr) { - for (auto iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { delete [] Jacobian_i[iVar]; delete [] Jacobian_j[iVar]; } delete [] Jacobian_i; delete [] Jacobian_j; } + } CNumerics::ResidualType<> CAvgGrad_NEMO::ComputeResidual(const CConfig *config) { @@ -105,11 +107,11 @@ CNumerics::ResidualType<> CAvgGrad_NEMO::ComputeResidual(const CConfig *config) /*--- Normalized normal vector ---*/ Area = GeometryToolbox::Norm(nDim, Normal); - for (auto iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) UnitNormal[iDim] = Normal[iDim]/Area; /*--- Mean transport coefficients ---*/ - for (auto iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) Mean_Diffusion_Coeff[iSpecies] = 0.5*(Diffusion_Coeff_i[iSpecies] + Diffusion_Coeff_j[iSpecies]); Mean_Laminar_Viscosity = 0.5*(Laminar_Viscosity_i + @@ -123,11 +125,11 @@ CNumerics::ResidualType<> CAvgGrad_NEMO::ComputeResidual(const CConfig *config) /*--- Mean gradient approximation ---*/ // Mass fraction - for (auto iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { PrimVar_i[iSpecies] = V_i[iSpecies]/V_i[RHO_INDEX]; PrimVar_j[iSpecies] = V_j[iSpecies]/V_j[RHO_INDEX]; Mean_PrimVar[iSpecies] = 0.5*(PrimVar_i[iSpecies] + PrimVar_j[iSpecies]); - for (auto iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { Mean_GradPrimVar[iSpecies][iDim] = 0.5*(1.0/V_i[RHO_INDEX] * (PrimVar_Grad_i[iSpecies][iDim] - PrimVar_i[iSpecies] * PrimVar_Grad_i[RHO_INDEX][iDim]) + 1.0/V_j[RHO_INDEX] * (PrimVar_Grad_j[iSpecies][iDim] - @@ -146,7 +148,7 @@ CNumerics::ResidualType<> CAvgGrad_NEMO::ComputeResidual(const CConfig *config) PrimVar_Grad_j[iVar][iDim]); } } - for (auto iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { Mean_Eve[iSpecies] = 0.5*(eve_i[iSpecies] + eve_j[iSpecies]); Mean_Cvve[iSpecies] = 0.5*(Cvve_i[iSpecies] + Cvve_j[iSpecies]); } @@ -159,18 +161,18 @@ CNumerics::ResidualType<> CAvgGrad_NEMO::ComputeResidual(const CConfig *config) /*--- Update viscous residual ---*/ - for (auto iVar = 0; iVar < nVar; iVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) Flux[iVar] = Proj_Flux_Tensor[iVar]; /*--- Compute the implicit part ---*/ if (implicit) { - dist_ij = 0.0; - for (auto iDim = 0; iDim < nDim; iDim++) - dist_ij += (Coord_j[iDim]-Coord_i[iDim])*(Coord_j[iDim]-Coord_i[iDim]); - dist_ij = sqrt(dist_ij); - for (auto iVar = 0; iVar < nVar; iVar++) { - for (auto jVar = 0; jVar < nVar; jVar++) { + su2double dist_ij_2[MAXNDIM] = {0.0}; + GeometryToolbox::Distance(nDim, Coord_j, Coord_i, dist_ij_2); + dist_ij = GeometryToolbox::SquaredNorm(nDim, dist_ij_2); + + for (auto iVar = 0ul; iVar < nVar; iVar++) { + for (auto jVar = 0ul; jVar < nVar; jVar++) { Jacobian_i[iVar][jVar] = 0.0; Jacobian_j[iVar][jVar] = 0.0; } @@ -183,6 +185,7 @@ CNumerics::ResidualType<> CAvgGrad_NEMO::ComputeResidual(const CConfig *config) } return ResidualType<>(Flux, Jacobian_i, Jacobian_j); + } CAvgGradCorrected_NEMO::CAvgGradCorrected_NEMO(unsigned short val_nDim, @@ -200,7 +203,7 @@ CAvgGradCorrected_NEMO::CAvgGradCorrected_NEMO(unsigned short val_nDim, nPrimVar = val_nPrimVar; nPrimVarGrad = val_nPrimVarGrad; - /*--- Compressible flow, primitive variables nDim+3, (T,vx,vy,vz,P,rho) ---*/ + /*--- Compressible flow, primitive variables ---*/ PrimVar_i = new su2double [nPrimVar]; PrimVar_j = new su2double [nPrimVar]; Mean_PrimVar = new su2double [nPrimVar]; @@ -210,9 +213,9 @@ CAvgGradCorrected_NEMO::CAvgGradCorrected_NEMO(unsigned short val_nDim, Mean_Diffusion_Coeff = new su2double[nSpecies]; - /*--- Compressible flow, primitive gradient variables nDim+3, (T,vx,vy,vz) ---*/ + /*--- Compressible flow, primitive gradient variables ---*/ Mean_GradPrimVar = new su2double* [nPrimVarGrad]; - for (auto iVar = 0; iVar < nPrimVarGrad; iVar++) + for (auto iVar = 0ul; iVar < nPrimVarGrad; iVar++) Mean_GradPrimVar[iVar] = new su2double [nDim]; Proj_Mean_GradPrimVar_Edge = new su2double[nPrimVarGrad]; @@ -220,13 +223,14 @@ CAvgGradCorrected_NEMO::CAvgGradCorrected_NEMO(unsigned short val_nDim, Flux = new su2double[nVar]; Jacobian_i = new su2double* [nVar]; Jacobian_j = new su2double* [nVar]; - for (auto iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { Jacobian_i[iVar] = new su2double [nVar]; Jacobian_j[iVar] = new su2double [nVar]; } + } -CAvgGradCorrected_NEMO::~CAvgGradCorrected_NEMO(void) { +CAvgGradCorrected_NEMO::~CAvgGradCorrected_NEMO() { delete [] PrimVar_i; delete [] PrimVar_j; @@ -237,7 +241,7 @@ CAvgGradCorrected_NEMO::~CAvgGradCorrected_NEMO(void) { delete [] Mean_Diffusion_Coeff; - for (auto iVar = 0; iVar < nPrimVarGrad; iVar++) + for (auto iVar = 0ul; iVar < nPrimVarGrad; iVar++) delete [] Mean_GradPrimVar[iVar]; delete [] Mean_GradPrimVar; @@ -246,13 +250,14 @@ CAvgGradCorrected_NEMO::~CAvgGradCorrected_NEMO(void) { delete [] Flux; if (Jacobian_i != nullptr) { - for (auto iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { delete [] Jacobian_i[iVar]; delete [] Jacobian_j[iVar]; } delete [] Jacobian_i; delete [] Jacobian_j; } + } CNumerics::ResidualType<> CAvgGradCorrected_NEMO::ComputeResidual(const CConfig *config) { @@ -260,23 +265,23 @@ CNumerics::ResidualType<> CAvgGradCorrected_NEMO::ComputeResidual(const CConfig /*--- Normalized normal vector ---*/ Area = GeometryToolbox::Norm(nDim, Normal); - for (auto iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) UnitNormal[iDim] = Normal[iDim]/Area; /*--- Compute vector going from iPoint to jPoint ---*/ - for (auto iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { Edge_Vector[iDim] = Coord_j[iDim]-Coord_i[iDim]; } - su2double dist_ij_2 = GeometryToolbox::SquaredNorm(nDim, Edge_Vector); + const su2double dist_ij_2 = GeometryToolbox::SquaredNorm(nDim, Edge_Vector); /*--- Make a local copy of the primitive variables ---*/ // NOTE: We are transforming the species density terms to species mass fractions // Mass fraction - for (auto iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { PrimVar_i[iSpecies] = V_i[iSpecies]/V_i[RHO_INDEX]; PrimVar_j[iSpecies] = V_j[iSpecies]/V_j[RHO_INDEX]; Mean_PrimVar[iSpecies] = 0.5*(PrimVar_i[iSpecies] + PrimVar_j[iSpecies]); - for (auto iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { Mean_GradPrimVar[iSpecies][iDim] = 0.5*(1.0/V_i[RHO_INDEX] * (PrimVar_Grad_i[iSpecies][iDim] - PrimVar_i[iSpecies] * @@ -293,18 +298,18 @@ CNumerics::ResidualType<> CAvgGradCorrected_NEMO::ComputeResidual(const CConfig Mean_PrimVar[iVar] = 0.5*(PrimVar_i[iVar]+PrimVar_j[iVar]); } for (auto iVar = nSpecies; iVar < nPrimVarGrad; iVar++) { - for (iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { Mean_GradPrimVar[iVar][iDim] = 0.5*(PrimVar_Grad_i[iVar][iDim] + PrimVar_Grad_j[iVar][iDim]); } } - for (auto iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { Mean_Eve[iSpecies] = 0.5*(eve_i[iSpecies] + eve_j[iSpecies]); Mean_Cvve[iSpecies] = 0.5*(Cvve_i[iSpecies] + Cvve_j[iSpecies]); } /*--- Mean transport coefficients ---*/ - for (auto iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) Mean_Diffusion_Coeff[iSpecies] = 0.5*(Diffusion_Coeff_i[iSpecies] + Diffusion_Coeff_j[iSpecies]); Mean_Laminar_Viscosity = 0.5*(Laminar_Viscosity_i + @@ -317,9 +322,9 @@ CNumerics::ResidualType<> CAvgGradCorrected_NEMO::ComputeResidual(const CConfig Thermal_Conductivity_ve_j); /*--- Projection of the mean gradient in the direction of the edge ---*/ - for (auto iVar = 0; iVar < nPrimVarGrad; iVar++) { + for (auto iVar = 0ul; iVar < nPrimVarGrad; iVar++) { Proj_Mean_GradPrimVar_Edge[iVar] = GeometryToolbox::DotProduct(nDim, Mean_GradPrimVar[iVar], Edge_Vector); - for (auto iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { Mean_GradPrimVar[iVar][iDim] -= (Proj_Mean_GradPrimVar_Edge[iVar] - (PrimVar_j[iVar]-PrimVar_i[iVar]))*Edge_Vector[iDim] / dist_ij_2; } @@ -335,14 +340,14 @@ CNumerics::ResidualType<> CAvgGradCorrected_NEMO::ComputeResidual(const CConfig config); /*--- Update viscous residual ---*/ - for (auto iVar = 0; iVar < nVar; iVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) Flux[iVar] = Proj_Flux_Tensor[iVar]; /*--- Compute the implicit part ---*/ if (implicit) { dist_ij = sqrt(dist_ij_2); - for (auto iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { for (unsigned short jVar = 0; jVar < nVar; jVar++) { Jacobian_i[iVar][jVar] = 0.0; Jacobian_j[iVar][jVar] = 0.0; @@ -357,4 +362,5 @@ CNumerics::ResidualType<> CAvgGradCorrected_NEMO::ComputeResidual(const CConfig } return ResidualType<>(Flux, Jacobian_j, Jacobian_j); + } diff --git a/SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp b/SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp index 26a476f4672..c49dae47bd1 100644 --- a/SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp +++ b/SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp @@ -3,7 +3,7 @@ * \brief Implementation of numerics classes for integration * of source terms in fluid flow NEMO problems. * \author C. Garbacz, W. Maier, S. Copeland. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -35,36 +35,32 @@ CSource_NEMO::CSource_NEMO(unsigned short val_nDim, CConfig *config) : CNEMONumerics(val_nDim, val_nVar, val_nPrimVar, val_nPrimVarGrad, config) { - unsigned short iSpecies; - /*--- Allocate arrays ---*/ Y = new su2double[nSpecies]; dYdr = new su2double*[nSpecies]; - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { dYdr[iSpecies] = new su2double[nSpecies]; } residual = new su2double[nVar](); jacobian = new su2double* [nVar]; - for(unsigned short iVar = 0; iVar < nVar; ++iVar) + for(auto iVar = 0ul; iVar < nVar; ++iVar) jacobian[iVar] = new su2double [nVar](); - } -CSource_NEMO::~CSource_NEMO(void) { - unsigned short iSpecies; +CSource_NEMO::~CSource_NEMO() { /*--- Deallocate arrays ---*/ - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) delete [] dYdr[iSpecies]; delete [] dYdr; delete [] Y; delete [] residual; if (jacobian) { - for(unsigned short iVar = 0; iVar < nVar; ++iVar) + for(auto iVar = 0ul; iVar < nVar; ++iVar) delete [] jacobian[iVar]; delete [] jacobian; } @@ -73,25 +69,22 @@ CSource_NEMO::~CSource_NEMO(void) { CNumerics::ResidualType<> CSource_NEMO::ComputeChemistry(const CConfig *config) { /*--- Nonequilibrium chemistry ---*/ - unsigned short iSpecies, iVar; - unsigned short jVar; - vector rhos; rhos.resize(nSpecies,0.0); /*--- Initialize residual and Jacobian arrays ---*/ - for (iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) residual[iVar] = 0.0; - } + if (implicit) - for (iVar = 0; iVar < nVar; iVar++) - for (jVar = 0; jVar < nVar; jVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) + for (auto jVar = 0ul; jVar < nVar; jVar++) jacobian[iVar][jVar] = 0.0; /*--- Rename for convenience ---*/ - su2double T = V_i[T_INDEX]; + su2double T = V_i[T_INDEX]; su2double Tve = V_i[TVE_INDEX]; - for(iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) rhos[iSpecies]=V_i[RHOS_INDEX+iSpecies]; /*--- Set mixture state ---*/ @@ -101,12 +94,12 @@ CNumerics::ResidualType<> CSource_NEMO::ComputeChemistry(const CConfig *config) const auto& ws = fluidmodel->ComputeNetProductionRates(implicit, V_i, eve_i, Cvve_i, dTdU_i, dTvedU_i, jacobian); - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++){ + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++){ residual[iSpecies] = ws[iSpecies] * Volume;} if (implicit) { - for (iVar = 0; iVar CSource_NEMO::ComputeVibRelaxation(const CConfig *conf // Note: Landau-Teller formulation // Note: Millikan & White relaxation time (requires P in Atm.) // Note: Park limiting cross section - unsigned short iSpecies, iVar; - unsigned short jVar; - su2double res_min = -1E6; - su2double res_max = 1E6; + const su2double res_min = -1E6; + const su2double res_max = 1E6; vector rhos; rhos.resize(nSpecies,0.0); /*--- Initialize residual and Jacobian arrays ---*/ - for (iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { residual[iVar] = 0.0; } if (implicit) { - for (iVar = 0; iVar < nVar; iVar++) - for (jVar = 0; jVar < nVar; jVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) + for (auto jVar = 0ul; jVar < nVar; jVar++) jacobian[iVar][jVar] = 0.0; } /*--- Rename for convenience ---*/ - su2double T = V_i[T_INDEX]; - su2double Tve = V_i[TVE_INDEX]; - for(iSpecies = 0; iSpecies < nSpecies; iSpecies++) + const su2double T = V_i[T_INDEX]; + const su2double Tve = V_i[TVE_INDEX]; + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) rhos[iSpecies]=V_i[RHOS_INDEX+iSpecies]; /*--- Set fluid state ---*/ fluidmodel->SetTDStateRhosTTv(rhos, T, Tve); /*--- Compute residual and jacobians ---*/ - su2double VTterm = fluidmodel -> ComputeEveSourceTerm(); + const su2double VTterm = fluidmodel -> ComputeEveSourceTerm(); if (implicit) { fluidmodel->GetEveSourceTermJacobian(V_i, eve_i, Cvve_i, dTdU_i, dTvedU_i, jacobian); @@ -160,17 +151,17 @@ CNumerics::ResidualType<> CSource_NEMO::ComputeVibRelaxation(const CConfig *conf residual[nSpecies+nDim+1] = VTterm * Volume; if (implicit) { - for (iVar = 0; iVarGetVTTransferResidualLimiting()){ - if(residual[nSpecies+nDim+1]>res_max) residual[nSpecies+nDim+1]=res_max; - if(residual[nSpecies+nDim+1]GetVTTransferResidualLimiting()) { + if (residual[nSpecies+nDim+1]>res_max) residual[nSpecies+nDim+1]=res_max; + if (residual[nSpecies+nDim+1](residual, jacobian, nullptr); @@ -178,66 +169,59 @@ CNumerics::ResidualType<> CSource_NEMO::ComputeVibRelaxation(const CConfig *conf CNumerics::ResidualType<> CSource_NEMO::ComputeAxisymmetric(const CConfig *config) { - unsigned short iDim, iSpecies, iVar; - unsigned short jSpecies, jVar; - /*--- Rename for convenience ---*/ - auto Ds = Diffusion_Coeff_i; - auto GV = PrimVar_Grad_i; - su2double ktr = Thermal_Conductivity_i; - su2double kve = Thermal_Conductivity_ve_i; - su2double rho = V_i[RHO_INDEX]; - su2double RuSI = UNIVERSAL_GAS_CONSTANT; - su2double Ru = 1000.0*RuSI; - su2double rhou = U_i[nSpecies]; - su2double rhov = U_i[nSpecies+1]; - su2double H = V_i[H_INDEX]; - su2double rhoEve = U_i[nVar-1]; + const auto Ds = Diffusion_Coeff_i; + const auto GV = PrimVar_Grad_i; + const su2double ktr = Thermal_Conductivity_i; + const su2double kve = Thermal_Conductivity_ve_i; + const su2double rho = V_i[RHO_INDEX]; + const su2double RuSI = UNIVERSAL_GAS_CONSTANT; + const su2double Ru = 1000.0*RuSI; + const su2double rhou = U_i[nSpecies]; + const su2double rhov = U_i[nSpecies+1]; + const su2double H = V_i[H_INDEX]; + const su2double rhoEve = U_i[nVar-1]; const auto& Ms = fluidmodel->GetSpeciesMolarMass(); const auto& hs = fluidmodel->ComputeSpeciesEnthalpy(V_i[T_INDEX], V_i[TVE_INDEX], eve_i ); - bool viscous = config->GetViscous(); - bool rans = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); + const bool viscous = config->GetViscous(); + const bool rans = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); /*--- Initialize residual and Jacobian arrays ---*/ - for (iVar = 0; iVar < nVar; iVar++) { - residual[iVar] = 0.0; - } + for (auto iVar = 0ul; iVar < nVar; iVar++) residual[iVar] = 0.0; /*--- Calculate inverse of y coordinate ---*/ su2double yinv = 0.0; if (Coord_i[1]!= 0.0) yinv = 1.0/Coord_i[1]; else yinv = 0.0; - /*--- Rename for convenience ---*/ - su2double vel2 = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - vel2 += V_i[VEL_INDEX+iDim]*V_i[VEL_INDEX+iDim]; - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + /*--- Rename mass flux for convenience ---*/ + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) Y[iSpecies] = V_i[RHOS_INDEX+iSpecies] / rho; /*--- Compute residual for inviscid axisym flow---*/ - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) residual[iSpecies] = yinv*rhov*Y[iSpecies]*Volume; - residual[nSpecies] = yinv*rhov*U_i[nSpecies]/rho*Volume; - residual[nSpecies+1] = yinv*rhov*U_i[nSpecies+1]/rho*Volume; + residual[nSpecies] = yinv*rhov*rhou/rho*Volume; + residual[nSpecies+1] = yinv*rhov*rhov/rho*Volume; residual[nSpecies+2] = yinv*rhov*H*Volume; - residual[nSpecies+3] = yinv*rhov*U_i[nSpecies+nDim+1]/rho*Volume; + residual[nSpecies+3] = yinv*rhov*rhoEve/rho*Volume; /*---Compute Jacobian for inviscid axisym flow ---*/ if (implicit) { - /*--- Initialize ---*/ - for (iVar = 0; iVar < nVar; iVar++) - for (jVar = 0; jVar < nVar; jVar++) + /*--- Initialize matrices ---*/ + for (auto iVar = 0ul; iVar < nVar; iVar++) + for (auto jVar = 0ul; jVar < nVar; jVar++) jacobian[iVar][jVar] = 0.0; - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) - for (jSpecies = 0; jSpecies < nSpecies; jSpecies++) + + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) + for (auto jSpecies = 0ul; jSpecies < nSpecies; jSpecies++) dYdr[iSpecies][jSpecies] = 0.0; /*--- Calculate additional quantities ---*/ - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { - for (jSpecies = 0; jSpecies < nSpecies; jSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { + for (auto jSpecies = 0ul; jSpecies < nSpecies; jSpecies++) { dYdr[iSpecies][jSpecies] += -1/rho*Y[iSpecies]; } dYdr[iSpecies][iSpecies] += 1/rho; @@ -246,26 +230,26 @@ CNumerics::ResidualType<> CSource_NEMO::ComputeAxisymmetric(const CConfig *confi /*--- Populate Jacobian ---*/ // Species density - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { - for (jSpecies = 0; jSpecies < nSpecies; jSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { + for (auto jSpecies = 0ul; jSpecies < nSpecies; jSpecies++) { jacobian[iSpecies][jSpecies] = dYdr[iSpecies][jSpecies]*rhov; } jacobian[iSpecies][nSpecies+1] = Y[iSpecies]; } // X-momentum - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) jacobian[nSpecies][iSpecies] = -rhou*rhov/(rho*rho); jacobian[nSpecies][nSpecies] = rhov/rho; jacobian[nSpecies][nSpecies+1] = rhou/rho; // Y-momentum - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) jacobian[nSpecies+1][iSpecies] = -rhov*rhov/(rho*rho); jacobian[nSpecies+1][nSpecies+1] = 2*rhov/rho; // Energy - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) jacobian[nSpecies+nDim][iSpecies] = -H*rhov/rho + dPdU_i[iSpecies]*rhov/rho; jacobian[nSpecies+nDim][nSpecies] = dPdU_i[nSpecies]*rhov/rho; jacobian[nSpecies+nDim][nSpecies+1] = H + dPdU_i[nSpecies+1]*rhov/rho; @@ -273,13 +257,13 @@ CNumerics::ResidualType<> CSource_NEMO::ComputeAxisymmetric(const CConfig *confi jacobian[nSpecies+nDim][nSpecies+nDim+1] = dPdU_i[nSpecies+nDim+1]*rhov/rho; // Vib-el energy - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) jacobian[nSpecies+nDim+1][iSpecies] = -rhoEve*rhov/(rho*rho); jacobian[nSpecies+nDim+1][nSpecies+1] = rhoEve/rho; jacobian[nSpecies+nDim+1][nSpecies+nDim+1] = rhov/rho; - for (iVar = 0; iVar < nVar; iVar++) - for (jVar = 0; jVar < nVar; jVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) + for (auto jVar = 0ul; jVar < nVar; jVar++) jacobian[iVar][jVar] *= yinv*Volume; } @@ -288,31 +272,30 @@ CNumerics::ResidualType<> CSource_NEMO::ComputeAxisymmetric(const CConfig *confi if (!rans){ turb_ke_i = 0.0; } su2double Vector = 0.0; - for (iSpecies = 0; iSpecies < nHeavy; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nHeavy; iSpecies++) Vector += rho*Ds[iSpecies]*GV[RHOS_INDEX+iSpecies][1]; - su2double sumJhs_y = 0.0; - su2double sumJeve_y = 0.0; - su2double Mass = 0.0; - - for (iSpecies=0; iSpecies= 0) { /*--- Jacobian contribution: dFc terms ---*/ - for (auto iVar = 0u; iVar < nSpecies + nDim; iVar++) { - for (unsigned short jVar = 0; jVar < nVar; jVar++) { + for (auto iVar = 0ul; iVar < nSpecies + nDim; iVar++) { + for (auto jVar = 0ul; jVar < nVar; jVar++) { Jacobian_i[iVar][jVar] += M_F * Fc_L[iVar] * da_L[jVar]; } Jacobian_i[iVar][iVar] += M_F * SoundSpeed_i; } - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { Jacobian_i[nSpecies + nDim][iSpecies] += M_F * (dPdU_i[iSpecies] * SoundSpeed_i + Density_i * Enthalpy_i * da_L[iSpecies]); } - for (unsigned short iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { Jacobian_i[nSpecies + nDim][nSpecies + iDim] += M_F * (-dPdU_i[nSpecies + nDim] * Velocity_i[iDim] * SoundSpeed_i + Density_i * Enthalpy_i * da_L[nSpecies + iDim]); @@ -181,7 +181,7 @@ void CUpwAUSM_SLAU_Base_NEMO::ComputeJacobian(su2double** val_Jacobian_i, su2dou M_F * ((1.0 + dPdU_i[nSpecies + nDim]) * SoundSpeed_i + Density_i * Enthalpy_i * da_L[nSpecies + nDim]); Jacobian_i[nSpecies + nDim][nSpecies + nDim + 1] += M_F * (dPdU_i[nSpecies + nDim + 1] * SoundSpeed_i + Density_i * Enthalpy_i * da_L[nSpecies + nDim + 1]); - for (unsigned short jVar = 0; jVar < nVar; jVar++) { + for (auto jVar = 0ul; jVar < nVar; jVar++) { Jacobian_i[nSpecies + nDim + 1][jVar] += M_F * Fc_L[nSpecies + nDim + 1] * da_L[jVar]; } Jacobian_i[nSpecies + nDim + 1][nSpecies + nDim + 1] += M_F * SoundSpeed_i; @@ -191,11 +191,11 @@ void CUpwAUSM_SLAU_Base_NEMO::ComputeJacobian(su2double** val_Jacobian_i, su2dou if ((M_F >= 0) || ((M_F < 0) && (fabs(M_F) <= 1.0))) { if (fabs(M_L) <= 1.0) { /*--- Mach number ---*/ - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) dM_LP[iSpecies] = 0.5 * (M_L + 1.0) * (-ProjVelocity_i / (Density_i * SoundSpeed_i) - ProjVelocity_i * da_L[iSpecies] / (pow(SoundSpeed_i, 2))); - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) dM_LP[nSpecies + iDim] = 0.5 * (M_L + 1.0) * (-ProjVelocity_i / (pow(SoundSpeed_i, 2)) * da_L[nSpecies + iDim] + UnitNormal[iDim] / (Density_i * SoundSpeed_i)); @@ -204,14 +204,14 @@ void CUpwAUSM_SLAU_Base_NEMO::ComputeJacobian(su2double** val_Jacobian_i, su2dou 0.5 * (M_L + 1.0) * (-ProjVelocity_i / (pow(SoundSpeed_i, 2)) * da_L[nSpecies + nDim + 1]); /*--- Pressure ---*/ - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) dP_LP[iSpecies] = 0.25 * (M_L + 1.0) * (dPdU_i[iSpecies] * (M_L + 1.0) * (2.0 - M_L) + Pressure_i * (-ProjVelocity_i / (Density_i * SoundSpeed_i) - ProjVelocity_i * da_L[iSpecies] / (pow(SoundSpeed_i, 2))) * (3.0 - 3.0 * M_L)); - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) dP_LP[nSpecies + iDim] = 0.25 * (M_L + 1.0) * (-Velocity_i[iDim] * dPdU_i[nSpecies + nDim] * (M_L + 1.0) * (2.0 - M_L) + Pressure_i * @@ -228,33 +228,33 @@ void CUpwAUSM_SLAU_Base_NEMO::ComputeJacobian(su2double** val_Jacobian_i, su2dou Pressure_i * (-ProjVelocity_i / (pow(SoundSpeed_i, 2)) * da_L[nSpecies + nDim + 1]) * (3.0 - 3.0 * M_L)); } else { /*--- Mach number ---*/ - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) dM_LP[iSpecies] = -ProjVelocity_i / (Density_i * SoundSpeed_i) - ProjVelocity_i * da_L[iSpecies] / (pow(SoundSpeed_i, 2)); - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) dM_LP[nSpecies + iDim] = -ProjVelocity_i / (pow(SoundSpeed_i, 2)) * da_L[nSpecies + iDim] + UnitNormal[iDim] / (Density_i * SoundSpeed_i); dM_LP[nSpecies + nDim] = -ProjVelocity_i / (pow(SoundSpeed_i, 2)) * da_L[nSpecies + nDim]; dM_LP[nSpecies + nDim + 1] = -ProjVelocity_i / (pow(SoundSpeed_i, 2)) * da_L[nSpecies + nDim + 1]; /*--- Pressure ---*/ - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) dP_LP[iSpecies] = dPdU_i[iSpecies]; - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) dP_LP[iSpecies] = dPdU_i[iSpecies]; + for (auto iDim = 0ul; iDim < nDim; iDim++) dP_LP[nSpecies + iDim] = (-Velocity_i[iDim] * dPdU_i[nSpecies + nDim]); dP_LP[nSpecies + nDim] = dPdU_i[nSpecies + nDim]; dP_LP[nSpecies + nDim + 1] = dPdU_i[nSpecies + nDim + 1]; } /*--- dM contribution ---*/ - for (unsigned short iVar = 0; iVar < nVar; iVar++) { - for (unsigned short jVar = 0; jVar < nVar; jVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { + for (auto jVar = 0ul; jVar < nVar; jVar++) { Jacobian_i[iVar][jVar] += dM_LP[jVar] * Fc_LR[iVar] * A_LR; } } /*--- Jacobian contribution: dP terms ---*/ - for (unsigned short iDim = 0; iDim < nDim; iDim++) { - for (unsigned short iVar = 0; iVar < nVar; iVar++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { Jacobian_i[nSpecies + iDim][iVar] += dP_LP[iVar] * UnitNormal[iDim]; } } @@ -263,17 +263,17 @@ void CUpwAUSM_SLAU_Base_NEMO::ComputeJacobian(su2double** val_Jacobian_i, su2dou /*--- Right state Jacobian ---*/ if (M_F < 0) { /*--- Jacobian contribution: dFc terms ---*/ - for (auto iVar = 0u; iVar < nSpecies + nDim; iVar++) { - for (unsigned short jVar = 0; jVar < nVar; jVar++) { + for (auto iVar = 0ul; iVar < nSpecies + nDim; iVar++) { + for (auto jVar = 0ul; jVar < nVar; jVar++) { Jacobian_j[iVar][jVar] += M_F * Fc_R[iVar] * da_R[jVar]; } Jacobian_j[iVar][iVar] += M_F * SoundSpeed_j; } - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { Jacobian_j[nSpecies + nDim][iSpecies] += M_F * (dPdU_j[iSpecies] * SoundSpeed_j + Density_j * Enthalpy_j * da_R[iSpecies]); } - for (unsigned short iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { Jacobian_j[nSpecies + nDim][nSpecies + iDim] += M_F * (-dPdU_j[nSpecies + nDim] * Velocity_j[iDim] * SoundSpeed_j + Density_j * Enthalpy_j * da_R[nSpecies + iDim]); @@ -282,7 +282,7 @@ void CUpwAUSM_SLAU_Base_NEMO::ComputeJacobian(su2double** val_Jacobian_i, su2dou M_F * ((1.0 + dPdU_j[nSpecies + nDim]) * SoundSpeed_j + Density_j * Enthalpy_j * da_R[nSpecies + nDim]); Jacobian_j[nSpecies + nDim][nSpecies + nDim + 1] += M_F * (dPdU_j[nSpecies + nDim + 1] * SoundSpeed_j + Density_j * Enthalpy_j * da_R[nSpecies + nDim + 1]); - for (unsigned short jVar = 0; jVar < nVar; jVar++) { + for (auto jVar = 0ul; jVar < nVar; jVar++) { Jacobian_j[nSpecies + nDim + 1][jVar] += M_F * Fc_R[nSpecies + nDim + 1] * da_R[jVar]; } Jacobian_j[nSpecies + nDim + 1][nSpecies + nDim + 1] += M_F * SoundSpeed_j; @@ -292,11 +292,11 @@ void CUpwAUSM_SLAU_Base_NEMO::ComputeJacobian(su2double** val_Jacobian_i, su2dou if ((M_F < 0) || ((M_F >= 0) && (fabs(M_F) <= 1.0))) { if (fabs(M_R) <= 1.0) { /*--- Mach ---*/ - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) dM_RM[iSpecies] = -0.5 * (M_R - 1.0) * (-ProjVelocity_j / (Density_j * SoundSpeed_j) - ProjVelocity_j * da_R[iSpecies] / (pow(SoundSpeed_j, 2))); - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) dM_RM[nSpecies + iDim] = -0.5 * (M_R - 1.0) * (-ProjVelocity_j / (pow(SoundSpeed_j, 2)) * da_R[nSpecies + iDim] + UnitNormal[iDim] / (Density_j * SoundSpeed_j)); @@ -305,14 +305,14 @@ void CUpwAUSM_SLAU_Base_NEMO::ComputeJacobian(su2double** val_Jacobian_i, su2dou -0.5 * (M_R - 1.0) * (-ProjVelocity_j / (pow(SoundSpeed_j, 2)) * da_R[nSpecies + nDim + 1]); /*--- Pressure ---*/ - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) dP_RM[iSpecies] = 0.25 * (M_R - 1.0) * (dPdU_j[iSpecies] * (M_R - 1.0) * (2.0 + M_R) + Pressure_j * (-ProjVelocity_j / (Density_j * SoundSpeed_j) - ProjVelocity_j * da_R[iSpecies] / (pow(SoundSpeed_j, 2))) * (3.0 + 3.0 * M_R)); - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) dP_RM[nSpecies + iDim] = 0.25 * (M_R - 1.0) * ((-Velocity_j[iDim] * dPdU_j[nSpecies + nDim]) * (M_R - 1.0) * (2.0 + M_R) + Pressure_j * @@ -330,41 +330,41 @@ void CUpwAUSM_SLAU_Base_NEMO::ComputeJacobian(su2double** val_Jacobian_i, su2dou } else { /*--- Mach ---*/ - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) dM_RM[iSpecies] = -ProjVelocity_j / (Density_j * SoundSpeed_j) - ProjVelocity_j * da_R[iSpecies] / (pow(SoundSpeed_j, 2)); - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) dM_RM[nSpecies + iDim] = -ProjVelocity_j / (pow(SoundSpeed_j, 2)) * da_R[nSpecies + iDim] + UnitNormal[iDim] / (Density_j * SoundSpeed_j); dM_RM[nSpecies + nDim] = -ProjVelocity_j / (pow(SoundSpeed_j, 2)) * da_R[nSpecies + nDim]; dM_RM[nSpecies + nDim + 1] = -ProjVelocity_j / (pow(SoundSpeed_j, 2)) * da_R[nSpecies + nDim + 1]; /*--- Pressure ---*/ - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) dP_RM[iSpecies] = dPdU_j[iSpecies]; - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) dP_RM[iSpecies] = dPdU_j[iSpecies]; + for (auto iDim = 0ul; iDim < nDim; iDim++) dP_RM[nSpecies + iDim] = -Velocity_j[iDim] * dPdU_j[nSpecies + nDim]; dP_RM[nSpecies + nDim] = dPdU_j[nSpecies + nDim]; dP_RM[nSpecies + nDim + 1] = dPdU_j[nSpecies + nDim + 1]; } /*--- Jacobian contribution: dM terms ---*/ - for (unsigned short iVar = 0; iVar < nVar; iVar++) { - for (unsigned short jVar = 0; jVar < nVar; jVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { + for (auto jVar = 0ul; jVar < nVar; jVar++) { Jacobian_j[iVar][jVar] += dM_RM[jVar] * Fc_LR[iVar] * A_LR; } } /*--- Jacobian contribution: dP terms ---*/ - for (unsigned short iDim = 0; iDim < nDim; iDim++) { - for (unsigned short iVar = 0; iVar < nVar; iVar++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { Jacobian_j[nSpecies + iDim][iVar] += dP_RM[iVar] * UnitNormal[iDim]; } } } /*--- Integrate over dual-face area ---*/ - for (unsigned short iVar = 0; iVar < nVar; iVar++) { - for (unsigned short jVar = 0; jVar < nVar; jVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { + for (auto jVar = 0ul; jVar < nVar; jVar++) { Jacobian_i[iVar][jVar] *= Area; Jacobian_j[iVar][jVar] *= Area; } @@ -375,15 +375,15 @@ CNumerics::ResidualType<> CUpwAUSM_SLAU_Base_NEMO::ComputeResidual(const CConfig /*--- Compute geometric quantities ---*/ Area = GeometryToolbox::Norm(nDim, Normal); - for (unsigned short iDim = 0; iDim < nDim; iDim++) UnitNormal[iDim] = Normal[iDim] / Area; + for (auto iDim = 0ul; iDim < nDim; iDim++) UnitNormal[iDim] = Normal[iDim] / Area; /*--- Pull stored primitive variables ---*/ // Primitives: [rho1,...,rhoNs, T, Tve, u, v, w, P, rho, h, a, c] - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { rhos_i[iSpecies] = V_i[RHOS_INDEX + iSpecies]; rhos_j[iSpecies] = V_j[RHOS_INDEX + iSpecies]; } - for (unsigned short iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { Velocity_i[iDim] = V_i[VEL_INDEX + iDim]; Velocity_j[iDim] = V_j[VEL_INDEX + iDim]; } @@ -398,9 +398,8 @@ CNumerics::ResidualType<> CUpwAUSM_SLAU_Base_NEMO::ComputeResidual(const CConfig Density_j = V_j[RHO_INDEX]; SoundSpeed_j = V_j[A_INDEX]; - e_ve_i = 0; - e_ve_j = 0; - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + e_ve_i = e_ve_j = 0; + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { e_ve_i += (V_i[RHOS_INDEX + iSpecies] * eve_i[iSpecies]) / Density_i; e_ve_j += (V_j[RHOS_INDEX + iSpecies] * eve_j[iSpecies]) / Density_j; } @@ -412,18 +411,18 @@ CNumerics::ResidualType<> CUpwAUSM_SLAU_Base_NEMO::ComputeResidual(const CConfig /*--- Compute mass and pressure fluxes of specific scheme ---*/ ComputeInterfaceQuantities(config, PressureFlux, M_F, A_F); - su2double MassFlux_i = M_F * A_F[0]; - su2double MassFlux_j = M_F * A_F[1]; + const su2double MassFlux_i = M_F * A_F[0]; + const su2double MassFlux_j = M_F * A_F[1]; - su2double DissFlux_i = fabs(MassFlux_i); - su2double DissFlux_j = fabs(MassFlux_j); + const su2double DissFlux_i = fabs(MassFlux_i); + const su2double DissFlux_j = fabs(MassFlux_j); /*--- Assign left & right convective flux vectors ---*/ - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { Fc_L[iSpecies] = rhos_i[iSpecies]; Fc_R[iSpecies] = rhos_j[iSpecies]; } - for (unsigned short iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { Fc_L[nSpecies + iDim] = Density_i * Velocity_i[iDim]; Fc_R[nSpecies + iDim] = Density_j * Velocity_j[iDim]; } @@ -433,10 +432,10 @@ CNumerics::ResidualType<> CUpwAUSM_SLAU_Base_NEMO::ComputeResidual(const CConfig Fc_R[nSpecies + nDim + 1] = Density_j * e_ve_j; /*--- Compute numerical flux ---*/ - for (unsigned short iVar = 0; iVar < nVar; iVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) Flux[iVar] = 0.5 * ((MassFlux_i + DissFlux_i) * Fc_L[iVar] + (MassFlux_j - DissFlux_j) * Fc_R[iVar]) * Area; - for (unsigned short iDim = 0; iDim < nDim; iDim++) Flux[nSpecies + iDim] += PressureFlux[iDim] * Area; + for (auto iDim = 0ul; iDim < nDim; iDim++) Flux[nSpecies + iDim] += PressureFlux[iDim] * Area; /*--- If required, compute Jacobians (approximated using AUSM) ---*/ if (implicit) ComputeJacobian(Jacobian_i, Jacobian_j); diff --git a/SU2_CFD/src/numerics/NEMO/convection/lax.cpp b/SU2_CFD/src/numerics/NEMO/convection/lax.cpp index 482512d462b..f7b4922c4c6 100644 --- a/SU2_CFD/src/numerics/NEMO/convection/lax.cpp +++ b/SU2_CFD/src/numerics/NEMO/convection/lax.cpp @@ -2,7 +2,7 @@ * \file lax.cpp * \brief Implementations of Lax centered scheme. * \author F. Palacios, S.R. Copeland, W. Maier, C. Garbacz - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -51,13 +51,13 @@ CCentLax_NEMO::CCentLax_NEMO(unsigned short val_nDim, Jacobian_i = new su2double* [nVar]; Jacobian_j = new su2double* [nVar]; - for (unsigned short iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { Jacobian_i[iVar] = new su2double [nVar]; Jacobian_j[iVar] = new su2double [nVar]; } } -CCentLax_NEMO::~CCentLax_NEMO(void) { +CCentLax_NEMO::~CCentLax_NEMO() { delete [] Diff_U; delete [] MeanU; @@ -65,7 +65,7 @@ CCentLax_NEMO::~CCentLax_NEMO(void) { delete [] MeandPdU; delete [] ProjFlux; delete [] Flux; - for (unsigned short iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { delete [] Jacobian_i[iVar]; delete [] Jacobian_j[iVar]; } @@ -78,7 +78,7 @@ CNumerics::ResidualType<> CCentLax_NEMO::ComputeResidual(const CConfig *config) /*--- Calculate geometrical quantities ---*/ Area = GeometryToolbox::Norm(nDim, Normal); - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) UnitNormal[iDim] = Normal[iDim]/Area; /*--- Rename for convenience ---*/ @@ -87,9 +87,9 @@ CNumerics::ResidualType<> CCentLax_NEMO::ComputeResidual(const CConfig *config) SoundSpeed_i = V_i[A_INDEX]; SoundSpeed_j = V_j[A_INDEX]; /*--- Compute mean quantities for the variables ---*/ - for (unsigned short iVar = 0; iVar < nVar; iVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) MeanU[iVar] = 0.5*(U_i[iVar]+U_j[iVar]); - for (unsigned short iVar = 0; iVar < nPrimVar; iVar++) + for (auto iVar = 0ul; iVar < nPrimVar; iVar++) MeanV[iVar] = 0.5*(V_i[iVar]+V_j[iVar]); /*--- Compute NonEq specific variables ---*/ @@ -103,8 +103,8 @@ CNumerics::ResidualType<> CCentLax_NEMO::ComputeResidual(const CConfig *config) if (implicit) { GetInviscidProjJac(MeanU, MeanV, MeandPdU, Normal, 0.5, Jacobian_i); - for (unsigned short iVar = 0; iVar < nVar; iVar++) - for (unsigned short jVar = 0; jVar < nVar; jVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) + for (auto jVar = 0ul; jVar < nVar; jVar++) Jacobian_j[iVar][jVar] = Jacobian_i[iVar][jVar]; } @@ -122,7 +122,7 @@ CNumerics::ResidualType<> CCentLax_NEMO::ComputeResidual(const CConfig *config) StretchingFactor = 4.0*Phi_i*Phi_j/(Phi_i+Phi_j+EPS); /*--- Computes differences btw. conservative variables ---*/ - for (unsigned short iVar = 0; iVar < nVar; iVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) Diff_U[iVar] = U_i[iVar] - U_j[iVar]; Diff_U[nSpecies+nDim] = Density_i*Enthalpy_i - Density_j*Enthalpy_j; @@ -131,7 +131,7 @@ CNumerics::ResidualType<> CCentLax_NEMO::ComputeResidual(const CConfig *config) Epsilon_0 = Param_Kappa_0*sc0*su2double(nDim)/3.0; /*--- Compute viscous part of the residual ---*/ - for (unsigned short iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { Flux[iVar] = ProjFlux[iVar]+Epsilon_0*Diff_U[iVar]*StretchingFactor*MeanLambda; } @@ -145,18 +145,18 @@ CNumerics::ResidualType<> CCentLax_NEMO::ComputeResidual(const CConfig *config) } /*--- Last rows: CAREFUL!! You have differences of \rho_Enthalpy, not differences of \rho_Energy ---*/ - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) Jacobian_i[nSpecies+nDim][iSpecies] += cte*dPdU_i[iSpecies]; - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) Jacobian_i[nSpecies+nDim][nSpecies+iDim] += cte*dPdU_i[nSpecies+iDim]; Jacobian_i[nSpecies+nDim][nSpecies+nDim] += cte*(1+dPdU_i[nSpecies+nDim]); Jacobian_i[nSpecies+nDim][nSpecies+nDim+1] += cte*dPdU_i[nSpecies+nDim+1]; Jacobian_i[nSpecies+nDim+1][nSpecies+nDim+1] += cte; /*--- Last row of Jacobian_j ---*/ - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) Jacobian_j[nSpecies+nDim][iSpecies] -= cte*dPdU_j[iSpecies]; - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) Jacobian_j[nSpecies+nDim][nSpecies+iDim] -= cte*dPdU_j[nSpecies+nDim]; Jacobian_j[nSpecies+nDim][nSpecies+nDim] -= cte*(1+dPdU_j[nSpecies+nDim]); Jacobian_j[nSpecies+nDim][nSpecies+nDim+1] -= cte*dPdU_j[nSpecies+nDim+1]; diff --git a/SU2_CFD/src/numerics/NEMO/convection/msw.cpp b/SU2_CFD/src/numerics/NEMO/convection/msw.cpp index 5f9869f9126..5941a4793d3 100644 --- a/SU2_CFD/src/numerics/NEMO/convection/msw.cpp +++ b/SU2_CFD/src/numerics/NEMO/convection/msw.cpp @@ -2,7 +2,7 @@ * \file msw.cpp * \brief Implementations of the modified Steger-Warming scheme. * \author ADL Stanford, S.R. Copeland, W. Maier, C. Garbacz - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -55,7 +55,7 @@ CUpwMSW_NEMO::CUpwMSW_NEMO(unsigned short val_nDim, unsigned short val_nVar, P_Tensor = new su2double* [nVar]; invP_Tensor = new su2double* [nVar]; - for (unsigned short iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { P_Tensor[iVar] = new su2double [nVar]; invP_Tensor[iVar] = new su2double [nVar]; } @@ -64,13 +64,13 @@ CUpwMSW_NEMO::CUpwMSW_NEMO(unsigned short val_nDim, unsigned short val_nVar, Flux = new su2double[nVar]; Jacobian_i = new su2double* [nVar]; Jacobian_j = new su2double* [nVar]; - for (unsigned short iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { Jacobian_i[iVar] = new su2double [nVar]; Jacobian_j[iVar] = new su2double [nVar]; } } -CUpwMSW_NEMO::~CUpwMSW_NEMO(void) { +CUpwMSW_NEMO::~CUpwMSW_NEMO() { delete [] Diff_U; delete [] Fc_i; @@ -91,14 +91,14 @@ CUpwMSW_NEMO::~CUpwMSW_NEMO(void) { delete [] dPdUst_i; delete [] dPdUst_j; - for (unsigned short iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { delete [] P_Tensor[iVar]; delete [] invP_Tensor[iVar]; } delete [] P_Tensor; delete [] invP_Tensor; delete [] Flux; - for (unsigned short iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { delete [] Jacobian_i[iVar]; delete [] Jacobian_j[iVar]; } @@ -115,17 +115,17 @@ CNumerics::ResidualType<> CUpwMSW_NEMO::ComputeResidual(const CConfig *config) { /*--- Calculate supporting geometry parameters ---*/ Area = GeometryToolbox::Norm(nDim, Normal); - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) UnitNormal[iDim] = Normal[iDim]/Area; /*--- Initialize flux & Jacobian vectors ---*/ - for (unsigned short iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { Fc_i[iVar] = 0.0; Fc_j[iVar] = 0.0; } if (implicit) { - for (unsigned short iVar = 0; iVar < nVar; iVar++) { - for (unsigned short jVar = 0; jVar < nVar; jVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { + for (auto jVar = 0ul; jVar < nVar; jVar++) { Jacobian_i[iVar][jVar] = 0.0; Jacobian_j[iVar][jVar] = 0.0; } @@ -133,11 +133,11 @@ CNumerics::ResidualType<> CUpwMSW_NEMO::ComputeResidual(const CConfig *config) { } /*--- Load variables from nodes i & j ---*/ - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { rhos_i[iSpecies] = V_i[RHOS_INDEX+iSpecies]; rhos_j[iSpecies] = V_j[RHOS_INDEX+iSpecies]; } - for (unsigned short iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { Velocity_i[iDim] = V_i[VEL_INDEX+iDim]; Velocity_j[iDim] = V_j[VEL_INDEX+iDim]; } @@ -149,21 +149,21 @@ CNumerics::ResidualType<> CUpwMSW_NEMO::ComputeResidual(const CConfig *config) { ProjVelocity_j = GeometryToolbox::DotProduct(nDim, Velocity_j, UnitNormal); /*--- Calculate the state weighting function ---*/ - su2double dp = fabs(Pressure_j-Pressure_i) / min(Pressure_j, Pressure_i); - su2double w = 0.5 * (1.0/(pow(alpha*dp,2.0) +1.0)); - su2double onemw = 1.0 - w; + const su2double dp = fabs(Pressure_j-Pressure_i) / min(Pressure_j, Pressure_i); + const su2double w = 0.5 * (1.0/(pow(alpha*dp,2.0) +1.0)); + const su2double onemw = 1.0 - w; /*--- Calculate weighted state vector (*) for i & j ---*/ - for (unsigned short iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { Ust_i[iVar] = onemw*U_i[iVar] + w*U_j[iVar]; Ust_j[iVar] = onemw*U_j[iVar] + w*U_i[iVar]; } - for (unsigned short iVar = 0; iVar < nPrimVar; iVar++) { + for (auto iVar = 0ul; iVar < nPrimVar; iVar++) { Vst_i[iVar] = onemw*V_i[iVar] + w*V_j[iVar]; Vst_j[iVar] = onemw*V_j[iVar] + w*V_i[iVar]; } - su2double ProjVelst_i = onemw*ProjVelocity_i + w*ProjVelocity_j; - su2double ProjVelst_j = onemw*ProjVelocity_j + w*ProjVelocity_i; + const su2double ProjVelst_i = onemw*ProjVelocity_i + w*ProjVelocity_j; + const su2double ProjVelst_j = onemw*ProjVelocity_j + w*ProjVelocity_i; const auto& eves_st_i = fluidmodel->ComputeSpeciesEve(Vst_i[TVE_INDEX]); const auto& eves_st_j = fluidmodel->ComputeSpeciesEve(Vst_j[TVE_INDEX]); @@ -172,7 +172,7 @@ CNumerics::ResidualType<> CUpwMSW_NEMO::ComputeResidual(const CConfig *config) { fluidmodel->ComputedPdU(Vst_j, eves_st_j, dPdUst_j); /*--- Flow eigenvalues at i (Lambda+) ---*/ - for (unsigned short iVar = 0; iVar < nSpecies+nDim-1; iVar++) + for (auto iVar = 0; iVar < nSpecies+nDim-1; iVar++) Lambda_i[iVar] = 0.5*(ProjVelst_i + sqrt(ProjVelst_i*ProjVelst_i + epsilon*epsilon)); Lambda_i[nSpecies+nDim-1] = 0.5*(ProjVelst_i + Vst_i[A_INDEX] + @@ -194,12 +194,12 @@ CNumerics::ResidualType<> CUpwMSW_NEMO::ComputeResidual(const CConfig *config) { /*--- Projected flux (f+) at i ---*/ su2double Proj_ModJac_Tensor_i; - for (unsigned short iVar = 0; iVar < nVar; iVar++) { - for (unsigned short jVar = 0; jVar < nVar; jVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { + for (auto jVar = 0ul; jVar < nVar; jVar++) { Proj_ModJac_Tensor_i = 0.0; /*--- Compute Proj_ModJac_Tensor = P x Lambda+ x inverse P ---*/ - for (unsigned short kVar = 0; kVar < nVar; kVar++) + for (auto kVar = 0ul; kVar < nVar; kVar++) Proj_ModJac_Tensor_i += P_Tensor[iVar][kVar]*Lambda_i[kVar]*invP_Tensor[kVar][jVar]; Fc_i[iVar] += Proj_ModJac_Tensor_i*U_i[jVar]*Area; if (implicit) @@ -208,7 +208,7 @@ CNumerics::ResidualType<> CUpwMSW_NEMO::ComputeResidual(const CConfig *config) { } /*--- Flow eigenvalues at j (Lambda-) ---*/ - for (unsigned short iVar = 0; iVar < nSpecies+nDim-1; iVar++) + for (auto iVar = 0; iVar < nSpecies+nDim-1; iVar++) Lambda_j[iVar] = 0.5*(ProjVelst_j - sqrt(ProjVelst_j*ProjVelst_j + epsilon*epsilon)); Lambda_j[nSpecies+nDim-1] = 0.5*(ProjVelst_j + Vst_j[A_INDEX] - @@ -229,12 +229,12 @@ CNumerics::ResidualType<> CUpwMSW_NEMO::ComputeResidual(const CConfig *config) { /*--- Projected flux (f-) ---*/ su2double Proj_ModJac_Tensor_j; - for (unsigned short iVar = 0; iVar < nVar; iVar++) { - for (unsigned short jVar = 0; jVar < nVar; jVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { + for (auto jVar = 0ul; jVar < nVar; jVar++) { Proj_ModJac_Tensor_j = 0.0; /*--- Compute Proj_ModJac_Tensor = P x Lambda- x inverse P ---*/ - for (unsigned short kVar = 0; kVar < nVar; kVar++) + for (auto kVar = 0ul; kVar < nVar; kVar++) Proj_ModJac_Tensor_j += P_Tensor[iVar][kVar]*Lambda_j[kVar]*invP_Tensor[kVar][jVar]; Fc_j[iVar] += Proj_ModJac_Tensor_j*U_j[jVar]*Area; if (implicit) @@ -243,7 +243,7 @@ CNumerics::ResidualType<> CUpwMSW_NEMO::ComputeResidual(const CConfig *config) { } /*--- Flux splitting ---*/ - for (unsigned short iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { Flux[iVar] = Fc_i[iVar]+Fc_j[iVar]; } diff --git a/SU2_CFD/src/numerics/NEMO/convection/roe.cpp b/SU2_CFD/src/numerics/NEMO/convection/roe.cpp index 0adcdd8dfd1..8ff004f79af 100644 --- a/SU2_CFD/src/numerics/NEMO/convection/roe.cpp +++ b/SU2_CFD/src/numerics/NEMO/convection/roe.cpp @@ -2,7 +2,7 @@ * \file roe.cpp * \brief Implementations of Roe-type schemes in NEMO. * \author S. R. Copeland, W. Maier, C. Garbacz - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -44,7 +44,7 @@ CUpwRoe_NEMO::CUpwRoe_NEMO(unsigned short val_nDim, unsigned short val_nVar, P_Tensor = new su2double* [nVar]; invP_Tensor = new su2double* [nVar]; - for (unsigned short iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { P_Tensor[iVar] = new su2double [nVar]; invP_Tensor[iVar] = new su2double [nVar]; } @@ -56,13 +56,13 @@ CUpwRoe_NEMO::CUpwRoe_NEMO(unsigned short val_nDim, unsigned short val_nVar, Jacobian_i = new su2double* [nVar]; Jacobian_j = new su2double* [nVar]; - for (unsigned short iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { Jacobian_i[iVar] = new su2double [nVar]; Jacobian_j[iVar] = new su2double [nVar]; } } -CUpwRoe_NEMO::~CUpwRoe_NEMO(void) { +CUpwRoe_NEMO::~CUpwRoe_NEMO() { delete [] Diff_U; delete [] RoeU; @@ -71,7 +71,7 @@ CUpwRoe_NEMO::~CUpwRoe_NEMO(void) { delete [] Lambda; delete [] Epsilon; - for (unsigned short iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { delete [] P_Tensor[iVar]; delete [] invP_Tensor[iVar]; } @@ -81,7 +81,7 @@ CUpwRoe_NEMO::~CUpwRoe_NEMO(void) { delete [] ProjFlux_i; delete [] ProjFlux_j; delete [] Flux; - for (unsigned short iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { delete [] Jacobian_i[iVar]; delete [] Jacobian_j[iVar]; } @@ -95,16 +95,16 @@ CNumerics::ResidualType<> CUpwRoe_NEMO::ComputeResidual(const CConfig *config) { Area = GeometryToolbox::Norm(nDim, Normal); /*--- Unit Normal ---*/ - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) UnitNormal[iDim] = Normal[iDim]/Area; /*--- Calculate Roe averaged variables ---*/ - su2double R = sqrt(abs(V_j[RHO_INDEX]/V_i[RHO_INDEX])); + const su2double R = sqrt(abs(V_j[RHO_INDEX]/V_i[RHO_INDEX])); - for (unsigned short iVar = 0; iVar < nVar; iVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) RoeU[iVar] = (R*U_j[iVar] + U_i[iVar])/(R+1); - for (unsigned short iVar = 0; iVar < nPrimVar; iVar++) + for (auto iVar = 0ul; iVar < nPrimVar; iVar++) RoeV[iVar] = (R*V_j[iVar] + V_i[iVar])/(R+1); const auto& roe_eves = fluidmodel->ComputeSpeciesEve(RoeV[TVE_INDEX]); @@ -125,18 +125,18 @@ CNumerics::ResidualType<> CUpwRoe_NEMO::ComputeResidual(const CConfig *config) { GetPMatrix_inv(RoeU, RoeV, RoedPdU, UnitNormal, l, m, invP_Tensor); /*--- Compute projected velocities ---*/ - su2double ProjVelocity = GeometryToolbox::DotProduct(nDim, &RoeV[VEL_INDEX], UnitNormal); - su2double ProjVelocity_i = GeometryToolbox::DotProduct(nDim, &V_i[VEL_INDEX], UnitNormal); - su2double ProjVelocity_j = GeometryToolbox::DotProduct(nDim, &V_j[VEL_INDEX], UnitNormal); + const su2double ProjVelocity = GeometryToolbox::DotProduct(nDim, &RoeV[VEL_INDEX], UnitNormal); + const su2double ProjVelocity_i = GeometryToolbox::DotProduct(nDim, &V_i[VEL_INDEX], UnitNormal); + const su2double ProjVelocity_j = GeometryToolbox::DotProduct(nDim, &V_j[VEL_INDEX], UnitNormal); - su2double RoeSoundSpeed = sqrt((1.0+RoedPdU[nSpecies+nDim])* - RoeV[P_INDEX]/RoeV[RHO_INDEX]); + const su2double RoeSoundSpeed = sqrt((1.0+RoedPdU[nSpecies+nDim])* + RoeV[P_INDEX]/RoeV[RHO_INDEX]); /*--- Calculate eigenvalues ---*/ - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) Lambda[iSpecies] = ProjVelocity; - for (unsigned short iDim = 0; iDim < nDim-1; iDim++) + for (auto iDim = 0; iDim < nDim-1; iDim++) Lambda[nSpecies+iDim] = ProjVelocity; Lambda[nSpecies+nDim-1] = ProjVelocity + RoeSoundSpeed; @@ -144,10 +144,10 @@ CNumerics::ResidualType<> CUpwRoe_NEMO::ComputeResidual(const CConfig *config) { Lambda[nSpecies+nDim+1] = ProjVelocity; /*--- Harten and Hyman (1983) entropy correction ---*/ - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) Epsilon[iSpecies] = 4.0*max(0.0, max(Lambda[iSpecies]-ProjVelocity_i, ProjVelocity_j-Lambda[iSpecies] )); - for (unsigned short iDim = 0; iDim < nDim-1; iDim++) + for (auto iDim = 0; iDim < nDim-1; iDim++) Epsilon[nSpecies+iDim] = 4.0*max(0.0, max(Lambda[iDim]-ProjVelocity_i, ProjVelocity_j-Lambda[iDim] )); Epsilon[nSpecies+nDim-1] = 4.0*max(0.0, max(Lambda[nSpecies+nDim-1]-(ProjVelocity_i+V_i[A_INDEX]), @@ -156,13 +156,13 @@ CNumerics::ResidualType<> CUpwRoe_NEMO::ComputeResidual(const CConfig *config) { (ProjVelocity_j-V_j[A_INDEX])-Lambda[nSpecies+nDim])); Epsilon[nSpecies+nDim+1] = 4.0*max(0.0, max(Lambda[nSpecies+nDim+1]-ProjVelocity_i, ProjVelocity_j-Lambda[nSpecies+nDim+1] )); - for (unsigned short iVar = 0; iVar < nVar; iVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) if ( fabs(Lambda[iVar]) < Epsilon[iVar] ) Lambda[iVar] = (Lambda[iVar]*Lambda[iVar] + Epsilon[iVar]*Epsilon[iVar])/(2.0*Epsilon[iVar]); else Lambda[iVar] = fabs(Lambda[iVar]); - for (unsigned short iVar = 0; iVar < nVar; iVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) Lambda[iVar] = fabs(Lambda[iVar]); /*--- Calculate inviscid projected Jacobians ---*/ @@ -173,17 +173,17 @@ CNumerics::ResidualType<> CUpwRoe_NEMO::ComputeResidual(const CConfig *config) { } /*--- Difference of conserved variables at iPoint and jPoint ---*/ - for (unsigned short iVar = 0; iVar < nVar; iVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) Diff_U[iVar] = U_j[iVar]-U_i[iVar]; /*--- Roe's Flux approximation ---*/ - for (unsigned short iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { Flux[iVar] = 0.5 * (ProjFlux_i[iVar] + ProjFlux_j[iVar]); - for (unsigned short jVar = 0; jVar < nVar; jVar++) { + for (auto jVar = 0ul; jVar < nVar; jVar++) { /*--- Compute |Proj_ModJac_Tensor| = P x |Lambda| x inverse P ---*/ Proj_ModJac_Tensor_ij = 0.0; - for (unsigned short kVar = 0; kVar < nVar; kVar++) + for (auto kVar = 0ul; kVar < nVar; kVar++) Proj_ModJac_Tensor_ij += P_Tensor[iVar][kVar]*Lambda[kVar]*invP_Tensor[kVar][jVar]; Flux[iVar] -= 0.5*Proj_ModJac_Tensor_ij*Diff_U[jVar]*Area; diff --git a/SU2_CFD/src/numerics/continuous_adjoint/adj_convection.cpp b/SU2_CFD/src/numerics/continuous_adjoint/adj_convection.cpp index 86074441ca1..2e17ae0db6c 100644 --- a/SU2_CFD/src/numerics/continuous_adjoint/adj_convection.cpp +++ b/SU2_CFD/src/numerics/continuous_adjoint/adj_convection.cpp @@ -2,7 +2,7 @@ * \file adj_convection.cpp * \brief Implementation of adjoint convection numerics classes. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -45,7 +45,7 @@ CCentLax_AdjFlow::CCentLax_AdjFlow(unsigned short val_nDim, unsigned short val_n } -CCentLax_AdjFlow::~CCentLax_AdjFlow(void) { +CCentLax_AdjFlow::~CCentLax_AdjFlow() { delete [] Diff_Psi; delete [] MeanPhi; delete [] Velocity_i; delete [] Velocity_j; @@ -253,7 +253,7 @@ CCentJST_AdjFlow::CCentJST_AdjFlow(unsigned short val_nDim, unsigned short val_n } -CCentJST_AdjFlow::~CCentJST_AdjFlow(void) { +CCentJST_AdjFlow::~CCentJST_AdjFlow() { delete [] Diff_Psi; delete [] Diff_Lapl; delete [] Velocity_i; delete [] Velocity_j; @@ -483,7 +483,7 @@ CUpwRoe_AdjFlow::CUpwRoe_AdjFlow(unsigned short val_nDim, unsigned short val_nVa } -CUpwRoe_AdjFlow::~CUpwRoe_AdjFlow(void) { +CUpwRoe_AdjFlow::~CUpwRoe_AdjFlow() { delete [] Residual_Roe; delete [] RoeVelocity; @@ -769,7 +769,7 @@ CUpwLin_AdjTurb::CUpwLin_AdjTurb(unsigned short val_nDim, unsigned short val_nVa Velocity_i = new su2double [nDim]; } -CUpwLin_AdjTurb::~CUpwLin_AdjTurb(void) { +CUpwLin_AdjTurb::~CUpwLin_AdjTurb() { delete [] Velocity_i; } @@ -808,7 +808,7 @@ CUpwSca_AdjTurb::CUpwSca_AdjTurb(unsigned short val_nDim, unsigned short val_nVa Velocity_j = new su2double [nDim]; } -CUpwSca_AdjTurb::~CUpwSca_AdjTurb(void) { +CUpwSca_AdjTurb::~CUpwSca_AdjTurb() { delete [] Velocity_i; delete [] Velocity_j; } diff --git a/SU2_CFD/src/numerics/continuous_adjoint/adj_diffusion.cpp b/SU2_CFD/src/numerics/continuous_adjoint/adj_diffusion.cpp index a2a450e457a..8a407c2caa8 100644 --- a/SU2_CFD/src/numerics/continuous_adjoint/adj_diffusion.cpp +++ b/SU2_CFD/src/numerics/continuous_adjoint/adj_diffusion.cpp @@ -2,7 +2,7 @@ * \file adj_diffusion.cpp * \brief Implementation of adjoint diffusion numerics classes. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -46,7 +46,7 @@ CAvgGrad_AdjFlow::CAvgGrad_AdjFlow(unsigned short val_nDim, unsigned short val_n } -CAvgGrad_AdjFlow::~CAvgGrad_AdjFlow(void) { +CAvgGrad_AdjFlow::~CAvgGrad_AdjFlow() { delete [] Velocity_i; delete [] Velocity_j; delete [] Mean_Velocity; @@ -164,7 +164,7 @@ CAvgGradCorrected_AdjFlow::CAvgGradCorrected_AdjFlow(unsigned short val_nDim, un } -CAvgGradCorrected_AdjFlow::~CAvgGradCorrected_AdjFlow(void) { +CAvgGradCorrected_AdjFlow::~CAvgGradCorrected_AdjFlow() { delete [] Velocity_i; delete [] Velocity_j; @@ -298,7 +298,7 @@ CAvgGrad_AdjTurb::CAvgGrad_AdjTurb(unsigned short val_nDim, unsigned short val_n Mean_GradTurbPsi[iVar] = new su2double [nDim]; } -CAvgGrad_AdjTurb::~CAvgGrad_AdjTurb(void) { +CAvgGrad_AdjTurb::~CAvgGrad_AdjTurb() { delete [] Edge_Vector; delete [] Proj_Mean_GradTurbPsi_Kappa; delete [] Proj_Mean_GradTurbPsi_Edge; @@ -419,7 +419,7 @@ CAvgGradCorrected_AdjTurb::CAvgGradCorrected_AdjTurb(unsigned short val_nDim, un Mean_GradTurbPsi[iVar] = new su2double [nDim]; } -CAvgGradCorrected_AdjTurb::~CAvgGradCorrected_AdjTurb(void) { +CAvgGradCorrected_AdjTurb::~CAvgGradCorrected_AdjTurb() { delete [] Edge_Vector; delete [] Proj_Mean_GradTurbPsi_Kappa; delete [] Proj_Mean_GradTurbPsi_Edge; diff --git a/SU2_CFD/src/numerics/continuous_adjoint/adj_sources.cpp b/SU2_CFD/src/numerics/continuous_adjoint/adj_sources.cpp index 276321ff978..061772e4ffb 100644 --- a/SU2_CFD/src/numerics/continuous_adjoint/adj_sources.cpp +++ b/SU2_CFD/src/numerics/continuous_adjoint/adj_sources.cpp @@ -2,7 +2,7 @@ * \file adj_sources.cpp * \brief Implementation of adjoint source numerics classes. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -29,7 +29,7 @@ CSourceAxisymmetric_AdjFlow::CSourceAxisymmetric_AdjFlow(unsigned short val_nDim, unsigned short val_nVar, CConfig *config) : CNumerics(val_nDim, val_nVar, config) { } -CSourceAxisymmetric_AdjFlow::~CSourceAxisymmetric_AdjFlow(void) { } +CSourceAxisymmetric_AdjFlow::~CSourceAxisymmetric_AdjFlow() = default; void CSourceAxisymmetric_AdjFlow::ComputeResidual(su2double *val_residual, su2double **Jacobian_ii, CConfig *config) { @@ -88,7 +88,7 @@ CSourceConservative_AdjFlow::CSourceConservative_AdjFlow(unsigned short val_nDim Mean_PrimVar_Grad[iVar] = new su2double [nDim]; } -CSourceConservative_AdjFlow::~CSourceConservative_AdjFlow(void) { +CSourceConservative_AdjFlow::~CSourceConservative_AdjFlow() { delete [] Mean_Residual; delete [] Residual_j; delete [] Residual_i; @@ -238,7 +238,7 @@ void CSourceConservative_AdjFlow::ComputeResidual (su2double *val_residual, CCon CSourceRotatingFrame_AdjFlow::CSourceRotatingFrame_AdjFlow(unsigned short val_nDim, unsigned short val_nVar, CConfig *config) : CNumerics(val_nDim, val_nVar, config) { } -CSourceRotatingFrame_AdjFlow::~CSourceRotatingFrame_AdjFlow(void) { } +CSourceRotatingFrame_AdjFlow::~CSourceRotatingFrame_AdjFlow() = default; void CSourceRotatingFrame_AdjFlow::ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, CConfig *config) { @@ -325,7 +325,7 @@ CSourceViscous_AdjFlow::CSourceViscous_AdjFlow(unsigned short val_nDim, unsigned } -CSourceViscous_AdjFlow::~CSourceViscous_AdjFlow(void) { +CSourceViscous_AdjFlow::~CSourceViscous_AdjFlow() { unsigned short iDim; for (iDim = 0; iDim < nDim; iDim++) { @@ -615,8 +615,7 @@ CSourceConservative_AdjTurb::CSourceConservative_AdjTurb(unsigned short val_nDim } -CSourceConservative_AdjTurb::~CSourceConservative_AdjTurb(void) { -} +CSourceConservative_AdjTurb::~CSourceConservative_AdjTurb() = default; void CSourceConservative_AdjTurb::ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, su2double **val_Jacobian_j, CConfig *config) { @@ -658,7 +657,7 @@ CSourcePieceWise_AdjTurb::CSourcePieceWise_AdjTurb(unsigned short val_nDim, unsi tau[iDim] = new su2double [nDim]; } -CSourcePieceWise_AdjTurb::~CSourcePieceWise_AdjTurb(void) { +CSourcePieceWise_AdjTurb::~CSourcePieceWise_AdjTurb() { delete [] Velocity; for (unsigned short iDim = 0; iDim < nDim; iDim++) diff --git a/SU2_CFD/src/numerics/elasticity/CFEAElasticity.cpp b/SU2_CFD/src/numerics/elasticity/CFEAElasticity.cpp index 70fc75c3b9c..ac2cd9fef96 100644 --- a/SU2_CFD/src/numerics/elasticity/CFEAElasticity.cpp +++ b/SU2_CFD/src/numerics/elasticity/CFEAElasticity.cpp @@ -2,7 +2,7 @@ * \file CFEAElasticity.cpp * \brief Base class for all elasticity problems. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -38,23 +38,19 @@ CFEAElasticity::CFEAElasticity(unsigned short val_nDim, unsigned short val_nVar, bool body_forces = config->GetDeadLoad(); // Body forces (dead loads). bool pseudo_static = config->GetPseudoStatic(); - unsigned short iVar, nProp; + unsigned short iVar; /*--- Initialize vector structures for multiple material definition ---*/ - nProp = config->GetnElasticityMod(); + const auto nProp = config->GetnElasticityMat(); E_i = new su2double[nProp]; for (iVar = 0; iVar < nProp; iVar++) E_i[iVar] = config->GetElasticyMod(iVar); - nProp = config->GetnPoissonRatio(); - Nu_i = new su2double[nProp]; for (iVar = 0; iVar < nProp; iVar++) Nu_i[iVar] = config->GetPoissonRatio(iVar); - nProp = config->GetnMaterialDensity(); - Rho_s_i = new su2double[nProp]; // For inertial effects Rho_s_DL_i = new su2double[nProp]; // For dead loads @@ -139,7 +135,7 @@ CFEAElasticity::CFEAElasticity(unsigned short val_nDim, unsigned short val_nVar, } } -CFEAElasticity::~CFEAElasticity(void) { +CFEAElasticity::~CFEAElasticity() { unsigned short iVar; unsigned short nStrain = (nDim==2) ? DIM_STRAIN_2D : DIM_STRAIN_3D; diff --git a/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp b/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp index a9ae91c1d12..06dade2a629 100644 --- a/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp +++ b/SU2_CFD/src/numerics/elasticity/CFEALinearElasticity.cpp @@ -2,7 +2,7 @@ * \file CFEALinearElasticity.cpp * \brief Classes for linear elasticity problems. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp b/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp index 82829b1d510..418566611f9 100644 --- a/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp +++ b/SU2_CFD/src/numerics/elasticity/CFEANonlinearElasticity.cpp @@ -3,7 +3,7 @@ * \brief This file contains the routines for setting the tangent matrix and * residual of a FEM nonlinear elastic structural problem. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -86,7 +86,7 @@ CFEANonlinearElasticity::CFEANonlinearElasticity(unsigned short val_nDim, unsign EField_Ref_Mod = nullptr; EField_Curr_Unit = nullptr; - if (maxwell_stress == true) { + if (maxwell_stress) { const su2double *Electric_Field_Dir = config->Get_Electric_Field_Dir(); unsigned short iVar, iDim; @@ -168,7 +168,7 @@ CFEANonlinearElasticity::CFEANonlinearElasticity(unsigned short val_nDim, unsign } -CFEANonlinearElasticity::~CFEANonlinearElasticity(void) { +CFEANonlinearElasticity::~CFEANonlinearElasticity() { unsigned short iVar; @@ -642,7 +642,7 @@ void CFEANonlinearElasticity::SetElectric_Properties(const CElement *element, co } -void CFEANonlinearElasticity::Compute_FmT_Mat(void) { +void CFEANonlinearElasticity::Compute_FmT_Mat() { FmT_Mat[0][0] = (F_Mat[1][1]*F_Mat[2][2] - F_Mat[1][2]*F_Mat[2][1]) / J_F; FmT_Mat[0][1] = (F_Mat[1][2]*F_Mat[2][0] - F_Mat[2][2]*F_Mat[1][0]) / J_F; @@ -658,7 +658,7 @@ void CFEANonlinearElasticity::Compute_FmT_Mat(void) { } -void CFEANonlinearElasticity::Compute_Isochoric_F_b(void) { +void CFEANonlinearElasticity::Compute_Isochoric_F_b() { unsigned short iVar, jVar, kVar; @@ -684,7 +684,7 @@ void CFEANonlinearElasticity::Compute_Isochoric_F_b(void) { } -void CFEANonlinearElasticity::Assign_cijkl_D_Mat(void) { +void CFEANonlinearElasticity::Assign_cijkl_D_Mat() { unsigned short iVar, jVar; diff --git a/SU2_CFD/src/numerics/elasticity/nonlinear_models.cpp b/SU2_CFD/src/numerics/elasticity/nonlinear_models.cpp index 3443e02a424..7e870386678 100644 --- a/SU2_CFD/src/numerics/elasticity/nonlinear_models.cpp +++ b/SU2_CFD/src/numerics/elasticity/nonlinear_models.cpp @@ -2,7 +2,7 @@ * \file nonlinear_models.cpp * \brief Definition of nonlinear constitutive models. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/flow/convection/ausm_slau.cpp b/SU2_CFD/src/numerics/flow/convection/ausm_slau.cpp index 8cd12d5184f..525dcaae823 100644 --- a/SU2_CFD/src/numerics/flow/convection/ausm_slau.cpp +++ b/SU2_CFD/src/numerics/flow/convection/ausm_slau.cpp @@ -2,7 +2,7 @@ * \file ausm_slau.cpp * \brief Implementations of the AUSM-family of schemes. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -60,7 +60,7 @@ CUpwAUSMPLUS_SLAU_Base_Flow::CUpwAUSMPLUS_SLAU_Base_Flow(unsigned short val_nDim } } -CUpwAUSMPLUS_SLAU_Base_Flow::~CUpwAUSMPLUS_SLAU_Base_Flow(void) { +CUpwAUSMPLUS_SLAU_Base_Flow::~CUpwAUSMPLUS_SLAU_Base_Flow() { delete [] psi_i; delete [] psi_j; @@ -812,7 +812,7 @@ CUpwAUSM_Flow::CUpwAUSM_Flow(unsigned short val_nDim, unsigned short val_nVar, c } } -CUpwAUSM_Flow::~CUpwAUSM_Flow(void) { +CUpwAUSM_Flow::~CUpwAUSM_Flow() { delete [] Flux; delete [] Diff_U; diff --git a/SU2_CFD/src/numerics/flow/convection/centered.cpp b/SU2_CFD/src/numerics/flow/convection/centered.cpp index 62fb21fa4de..c4568903172 100644 --- a/SU2_CFD/src/numerics/flow/convection/centered.cpp +++ b/SU2_CFD/src/numerics/flow/convection/centered.cpp @@ -2,7 +2,7 @@ * \file centered.cpp * \brief Implementations of centered schemes. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -31,7 +31,7 @@ CCentLaxInc_Flow::CCentLaxInc_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config) : CNumerics(val_nDim, val_nVar, config) { implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - variable_density = (config->GetKind_DensityModel() == INC_DENSITYMODEL::VARIABLE); + variable_density = ((config->GetKind_DensityModel() == INC_DENSITYMODEL::VARIABLE) || (config->GetKind_DensityModel() == INC_DENSITYMODEL::FLAMELET)); /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); fix_factor = config->GetCent_Inc_Jac_Fix_Factor(); @@ -60,7 +60,7 @@ CCentLaxInc_Flow::CCentLaxInc_Flow(unsigned short val_nDim, unsigned short val_n } -CCentLaxInc_Flow::~CCentLaxInc_Flow(void) { +CCentLaxInc_Flow::~CCentLaxInc_Flow() { delete [] Diff_V; delete [] Velocity_i; @@ -251,7 +251,7 @@ CNumerics::ResidualType<> CCentLaxInc_Flow::ComputeResidual(const CConfig* confi CCentJSTInc_Flow::CCentJSTInc_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config) : CNumerics(val_nDim, val_nVar, config) { implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - variable_density = (config->GetKind_DensityModel() == INC_DENSITYMODEL::VARIABLE); + variable_density = (config->GetVariable_Density_Model()); energy = config->GetEnergy_Equation(); /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); @@ -282,7 +282,7 @@ CCentJSTInc_Flow::CCentJSTInc_Flow(unsigned short val_nDim, unsigned short val_n } -CCentJSTInc_Flow::~CCentJSTInc_Flow(void) { +CCentJSTInc_Flow::~CCentJSTInc_Flow() { delete [] Diff_V; delete [] Diff_Lapl; diff --git a/SU2_CFD/src/numerics/flow/convection/cusp.cpp b/SU2_CFD/src/numerics/flow/convection/cusp.cpp deleted file mode 100644 index 030844cb352..00000000000 --- a/SU2_CFD/src/numerics/flow/convection/cusp.cpp +++ /dev/null @@ -1,187 +0,0 @@ -/*! - * \file cusp.cpp - * \brief Implementation of the CUSP scheme. - * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" - * - * SU2 Project Website: https://su2code.github.io - * - * The SU2 Project is maintained by the SU2 Foundation - * (http://su2foundation.org) - * - * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) - * - * SU2 is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * SU2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with SU2. If not, see . - */ - -#include "../../../../include/numerics/flow/convection/cusp.hpp" -#include "../../../../../Common/include/toolboxes/geometry_toolbox.hpp" - -CUpwCUSP_Flow::CUpwCUSP_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config) : CNumerics(val_nDim, val_nVar, config) { - - implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - - Gamma = config->GetGamma(); - Gamma_Minus_One = Gamma - 1.0; - - if (config->GetDynamic_Grid() && (SU2_MPI::GetRank() == MASTER_NODE)) - cout << "WARNING: Grid velocities are NOT yet considered by the CUSP scheme." << endl; - - /*--- Allocate some structures ---*/ - Flux = new su2double [nVar]; - ProjFlux_i = new su2double [nVar]; - ProjFlux_j = new su2double [nVar]; - Jacobian_i = new su2double* [nVar]; - Jacobian_j = new su2double* [nVar]; - for (unsigned short iVar = 0; iVar < nVar; iVar++) { - Jacobian_i[iVar] = new su2double [nVar]; - Jacobian_j[iVar] = new su2double [nVar]; - } -} - -CUpwCUSP_Flow::~CUpwCUSP_Flow(void) { - delete [] Flux; - delete [] ProjFlux_i; - delete [] ProjFlux_j; - for (unsigned short iVar = 0; iVar < nVar; iVar++) { - delete [] Jacobian_i[iVar]; - delete [] Jacobian_j[iVar]; - } - delete [] Jacobian_i; - delete [] Jacobian_j; -} - -CNumerics::ResidualType<> CUpwCUSP_Flow::ComputeResidual(const CConfig* config) { - - implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - - unsigned short iDim, iVar; - su2double Diff_U[5] = {0.0}; - - AD::SetPreaccIn(Normal, nDim); - AD::SetPreaccIn(V_i, nDim+4); - AD::SetPreaccIn(V_j, nDim+4); - - /*--- Pressure, density, enthalpy, energy, and velocity at points i and j ---*/ - - Pressure_i = V_i[nDim+1]; Pressure_j = V_j[nDim+1]; - Density_i = V_i[nDim+2]; Density_j = V_j[nDim+2]; - Enthalpy_i = V_i[nDim+3]; Enthalpy_j = V_j[nDim+3]; - su2double Energy_i = Enthalpy_i - Pressure_i/Density_i; - su2double Energy_j = Enthalpy_j - Pressure_j/Density_j; - - su2double sq_vel_i = 0.0, sq_vel_j = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - Velocity_i[iDim] = V_i[iDim+1]; - Velocity_j[iDim] = V_j[iDim+1]; - sq_vel_i += Velocity_i[iDim]*Velocity_i[iDim]; - sq_vel_j += Velocity_j[iDim]*Velocity_j[iDim]; - } - - /*-- Face area and unit normal ---*/ - - Area = GeometryToolbox::Norm(nDim, Normal); - - for (iDim = 0; iDim < nDim; iDim++) - UnitNormal[iDim] = Normal[iDim]/Area; - - /*--- Computes differences of conservative variables, with a correction for the enthalpy ---*/ - - Diff_U[0] = Density_i - Density_j; - for (iDim = 0; iDim < nDim; iDim++) - Diff_U[iDim+1] = Density_i*Velocity_i[iDim] - Density_j*Velocity_j[iDim]; - Diff_U[nVar-1] = Density_i*Enthalpy_i - Density_j*Enthalpy_j; - - /*--- Get left and right fluxes ---*/ - - GetInviscidProjFlux(&Density_i, Velocity_i, &Pressure_i, &Enthalpy_i, UnitNormal, ProjFlux_i); - GetInviscidProjFlux(&Density_j, Velocity_j, &Pressure_j, &Enthalpy_j, UnitNormal, ProjFlux_j); - - /*--- Compute dissipation parameters based on Roe-averaged values ---*/ - - su2double Beta, Nu_c; - - su2double R = sqrt(Density_j/Density_i), ProjVelocity = 0.0, sq_vel = 0.0; - - for (iDim = 0; iDim < nDim; iDim++) { - su2double MeanVel = (R*Velocity_j[iDim]+Velocity_i[iDim])/(R+1.0); - ProjVelocity += MeanVel*UnitNormal[iDim]; - sq_vel += MeanVel*MeanVel; - } - su2double MeanEnthalpy = (R*Enthalpy_j+Enthalpy_i)/(R+1.0); - su2double MeanSoundSpeed = sqrt(Gamma_Minus_One*fabs(MeanEnthalpy-0.5*sq_vel)); - - su2double Mach = ProjVelocity / MeanSoundSpeed; - - su2double tmp1 = 0.5*(Gamma+1.0)/Gamma*ProjVelocity; - su2double tmp2 = sqrt(pow(tmp1-ProjVelocity/Gamma, 2.0) + pow(MeanSoundSpeed,2.0)/Gamma); - su2double LamdaNeg = tmp1 - tmp2, LamdaPos = tmp1 + tmp2; - - if (fabs(Mach) >= 1.0) Beta = Mach/fabs(Mach); - else if (Mach >= 0.0) Beta = max(0.0, (ProjVelocity + LamdaNeg)/(ProjVelocity - LamdaNeg)); - else Beta =-max(0.0, (ProjVelocity + LamdaPos)/(ProjVelocity - LamdaPos)); - - if (fabs(Mach) >= 1.0) Nu_c = 0.0; - else { - if (Beta > 0.0) Nu_c =-(1.0+Beta)*LamdaNeg; - else if (Beta < 0.0) Nu_c = (1.0-Beta)*LamdaPos; - /*--- Limit the minimum scalar dissipation ---*/ - else Nu_c = max(fabs(ProjVelocity), config->GetEntropyFix_Coeff()*MeanSoundSpeed); - } - - /*--- Compute the residual ---*/ - - for (iVar = 0; iVar < nVar; iVar++) - Flux[iVar] = 0.5*((1.0+Beta)*ProjFlux_i[iVar] + (1.0-Beta)*ProjFlux_j[iVar] + Nu_c*Diff_U[iVar])*Area; - - /*--- Jacobian computation ---*/ - - if (implicit) { - - /*--- Flux average and difference contributions ---*/ - - GetInviscidProjJac(Velocity_i, &Energy_i, Normal, 0.5*(1.0+Beta), Jacobian_i); - GetInviscidProjJac(Velocity_j, &Energy_j, Normal, 0.5*(1.0-Beta), Jacobian_j); - - /*--- Solution difference (scalar dissipation) contribution ---*/ - - su2double cte_0 = 0.5*Nu_c*Area*config->GetCent_Jac_Fix_Factor(); - - /*--- n-1 diagonal entries ---*/ - - for (iVar = 0; iVar < (nVar-1); iVar++) { - Jacobian_i[iVar][iVar] += cte_0; - Jacobian_j[iVar][iVar] -= cte_0; - } - - /*--- Last rows ---*/ - - Jacobian_i[nVar-1][0] += cte_0*Gamma_Minus_One*0.5*sq_vel_i; - for (iDim = 0; iDim < nDim; iDim++) - Jacobian_i[nVar-1][iDim+1] -= cte_0*Gamma_Minus_One*Velocity_i[iDim]; - Jacobian_i[nVar-1][nVar-1] += cte_0*Gamma; - - Jacobian_j[nVar-1][0] -= cte_0*Gamma_Minus_One*0.5*sq_vel_j; - for (iDim = 0; iDim < nDim; iDim++) - Jacobian_j[nVar-1][iDim+1] += cte_0*Gamma_Minus_One*Velocity_j[iDim]; - Jacobian_j[nVar-1][nVar-1] -= cte_0*Gamma; - - } - - AD::SetPreaccOut(Flux, nVar); - AD::EndPreacc(); - - return ResidualType<>(Flux, Jacobian_i, Jacobian_j); - -} diff --git a/SU2_CFD/src/numerics/flow/convection/fds.cpp b/SU2_CFD/src/numerics/flow/convection/fds.cpp index 5277d3834e8..358d844e5a2 100644 --- a/SU2_CFD/src/numerics/flow/convection/fds.cpp +++ b/SU2_CFD/src/numerics/flow/convection/fds.cpp @@ -2,7 +2,7 @@ * \file fds.cpp * \brief Implementation of Flux-Difference-Splitting schemes. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -31,7 +31,7 @@ CUpwFDSInc_Flow::CUpwFDSInc_Flow(unsigned short val_nDim, unsigned short val_nVar, const CConfig *config) : CNumerics(val_nDim, val_nVar, config) { implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - variable_density = (config->GetKind_DensityModel() == INC_DENSITYMODEL::VARIABLE); + variable_density = (config->GetVariable_Density_Model()); energy = config->GetEnergy_Equation(); /* A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain */ dynamic_grid = config->GetDynamic_Grid(); @@ -58,7 +58,7 @@ CUpwFDSInc_Flow::CUpwFDSInc_Flow(unsigned short val_nDim, unsigned short val_nVa } -CUpwFDSInc_Flow::~CUpwFDSInc_Flow(void) { +CUpwFDSInc_Flow::~CUpwFDSInc_Flow() { delete [] Flux; delete [] Diff_V; diff --git a/SU2_CFD/src/numerics/flow/convection/fvs.cpp b/SU2_CFD/src/numerics/flow/convection/fvs.cpp index 6e16b7dba1d..171a781a54c 100644 --- a/SU2_CFD/src/numerics/flow/convection/fvs.cpp +++ b/SU2_CFD/src/numerics/flow/convection/fvs.cpp @@ -2,7 +2,7 @@ * \file fvs.cpp * \brief Implementations of Flux-Vector-Splitting schemes. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -65,7 +65,7 @@ CUpwMSW_Flow::CUpwMSW_Flow(unsigned short val_nDim, unsigned short val_nVar, con } -CUpwMSW_Flow::~CUpwMSW_Flow(void) { +CUpwMSW_Flow::~CUpwMSW_Flow() { delete [] Fc_i; delete [] Fc_j; diff --git a/SU2_CFD/src/numerics/flow/convection/hllc.cpp b/SU2_CFD/src/numerics/flow/convection/hllc.cpp index 6fa329f1221..e5893bced0d 100644 --- a/SU2_CFD/src/numerics/flow/convection/hllc.cpp +++ b/SU2_CFD/src/numerics/flow/convection/hllc.cpp @@ -2,7 +2,7 @@ * \file hllc.cpp * \brief Implementations of HLLC schemes. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -59,7 +59,7 @@ CUpwHLLC_Flow::CUpwHLLC_Flow(unsigned short val_nDim, unsigned short val_nVar, c } } -CUpwHLLC_Flow::~CUpwHLLC_Flow(void) { +CUpwHLLC_Flow::~CUpwHLLC_Flow() { delete [] IntermediateState; delete [] dSm_dU; @@ -583,7 +583,7 @@ CUpwGeneralHLLC_Flow::CUpwGeneralHLLC_Flow(unsigned short val_nDim, unsigned sho } } -CUpwGeneralHLLC_Flow::~CUpwGeneralHLLC_Flow(void) { +CUpwGeneralHLLC_Flow::~CUpwGeneralHLLC_Flow() { delete [] IntermediateState; delete [] dSm_dU; diff --git a/SU2_CFD/src/numerics/flow/convection/roe.cpp b/SU2_CFD/src/numerics/flow/convection/roe.cpp index 5dbce713115..67ef74124f3 100644 --- a/SU2_CFD/src/numerics/flow/convection/roe.cpp +++ b/SU2_CFD/src/numerics/flow/convection/roe.cpp @@ -2,7 +2,7 @@ * \file roe.cpp * \brief Implementations of Roe-type schemes. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -61,7 +61,7 @@ CUpwRoeBase_Flow::CUpwRoeBase_Flow(unsigned short val_nDim, unsigned short val_n } -CUpwRoeBase_Flow::~CUpwRoeBase_Flow(void) { +CUpwRoeBase_Flow::~CUpwRoeBase_Flow() { delete [] Flux; delete [] Diff_U; @@ -477,7 +477,7 @@ CUpwTurkel_Flow::CUpwTurkel_Flow(unsigned short val_nDim, unsigned short val_nVa } } -CUpwTurkel_Flow::~CUpwTurkel_Flow(void) { +CUpwTurkel_Flow::~CUpwTurkel_Flow() { delete [] Flux; delete [] Diff_U; @@ -709,7 +709,7 @@ CUpwGeneralRoe_Flow::CUpwGeneralRoe_Flow(unsigned short val_nDim, unsigned short } } -CUpwGeneralRoe_Flow::~CUpwGeneralRoe_Flow(void) { +CUpwGeneralRoe_Flow::~CUpwGeneralRoe_Flow() { delete [] Flux; delete [] Diff_U; diff --git a/SU2_CFD/src/numerics/flow/flow_diffusion.cpp b/SU2_CFD/src/numerics/flow/flow_diffusion.cpp index 20d49fa469f..d99fcb04b88 100644 --- a/SU2_CFD/src/numerics/flow/flow_diffusion.cpp +++ b/SU2_CFD/src/numerics/flow/flow_diffusion.cpp @@ -3,7 +3,7 @@ * \brief Implementation of numerics classes for discretization * of viscous fluxes in fluid flow problems. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/flow/flow_sources.cpp b/SU2_CFD/src/numerics/flow/flow_sources.cpp index 2fb164f3d1f..5ebcbf3096e 100644 --- a/SU2_CFD/src/numerics/flow/flow_sources.cpp +++ b/SU2_CFD/src/numerics/flow/flow_sources.cpp @@ -3,7 +3,7 @@ * \brief Implementation of numerics classes for integration * of source terms in fluid flow problems. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -405,7 +405,7 @@ CNumerics::ResidualType<> CSourceIncBodyForce::ComputeResidual(const CConfig* co unsigned short iDim; su2double DensityInc_0 = 0.0; su2double Force_Ref = config->GetForce_Ref(); - bool variable_density = (config->GetKind_DensityModel() == INC_DENSITYMODEL::VARIABLE); + bool variable_density = (config->GetVariable_Density_Model()); /*--- Check for variable density. If we have a variable density problem, we should subtract out the hydrostatic pressure component. ---*/ @@ -715,85 +715,6 @@ CNumerics::ResidualType<> CSourceVorticityConfinement::ComputeResidual(const CCo return ResidualType<>(residual, jacobian, nullptr); } -CSourceWindGust::CSourceWindGust(unsigned short val_nDim, unsigned short val_nVar, const CConfig* config) : - CSourceBase_Flow(val_nDim, val_nVar, config) { } - -CNumerics::ResidualType<> CSourceWindGust::ComputeResidual(const CConfig* config) { - - su2double u_gust, v_gust, du_gust_dx, du_gust_dy, du_gust_dt, dv_gust_dx, dv_gust_dy, dv_gust_dt; - su2double smx, smy, se, rho, u, v, p; - unsigned short GustDir = config->GetGust_Dir(); //Gust direction - - u_gust = WindGust_i[0]; - v_gust = WindGust_i[1]; -// w_gust = WindGust_i[2]; - - if (GustDir == X_DIR) { - du_gust_dx = WindGustDer_i[0]; - du_gust_dy = WindGustDer_i[1]; - //du_gust_dz = WindGustDer_i[2]; - du_gust_dt = WindGustDer_i[2]; - - dv_gust_dx = 0.0; - dv_gust_dy = 0.0; - //dv_gust_dz = 0.0; - dv_gust_dt = 0.0; - - //dw_gust_dx = 0.0; - //dw_gust_dy = 0.0; - //dw_gust_dz = 0.0; - //dw_gust_dt = 0.0; - } else { - du_gust_dx = 0.0; - du_gust_dy = 0.0; - //du_gust_dz = 0.0; - du_gust_dt = 0.0; - dv_gust_dx = WindGustDer_i[0]; - dv_gust_dy = WindGustDer_i[1]; - //dv_gust_dz = WindGustDer_i[2] - dv_gust_dt = WindGustDer_i[2]; - - //dw_gust_dx = 0.0; - //dw_gust_dy = 0.0; - //dw_gust_dz = 0.0; - //dw_gust_dt = 0.0; - // - - } - - /*--- Primitive variables at point i ---*/ - u = V_i[1]; - v = V_i[2]; - // w = V_i[3] - - p = V_i[nDim+1]; - rho = V_i[nDim+2]; - - /*--- Source terms ---*/ - smx = rho*(du_gust_dt + (u+u_gust)*du_gust_dx + (v+v_gust)*du_gust_dy); - smy = rho*(dv_gust_dt + (u+u_gust)*dv_gust_dx + (v+v_gust)*dv_gust_dy); - //smz = rho*(dw_gust_dt + (u+u_gust)*dw_gust_dx + (v+v_gust)*dw_gust_dy) + (w+w_gust)*dw_gust_dz; - - se = u*smx + v*smy + p*(du_gust_dx + dv_gust_dy); - //se = u*smx + v*smy + w*smz + p*(du_gust_dx + dv_gust_dy + dw_gust_dz); - - if (nDim == 2) { - residual[0] = 0.0; - residual[1] = smx*Volume; - residual[2] = smy*Volume; - //residual[3] = smz*Volume; - residual[3] = se*Volume; - } else { - SU2_MPI::Error("You should only be in the gust source term in two dimensions", CURRENT_FUNCTION); - } - - /*--- For now the source term Jacobian is just set to zero ---*/ - //bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); - - return ResidualType<>(residual, jacobian, nullptr); -} - - CSourceIncStreamwise_Periodic::CSourceIncStreamwise_Periodic(unsigned short val_nDim, unsigned short val_nVar, CConfig *config) : diff --git a/SU2_CFD/src/numerics/radiation.cpp b/SU2_CFD/src/numerics/radiation.cpp index fcc036a0e9a..c6f7fc009bd 100644 --- a/SU2_CFD/src/numerics/radiation.cpp +++ b/SU2_CFD/src/numerics/radiation.cpp @@ -3,7 +3,7 @@ * \brief This file contains the implementation of the numerical * methods for radiation. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/scalar/scalar_sources.cpp b/SU2_CFD/src/numerics/scalar/scalar_sources.cpp index 135cf32f568..b2ab84650a1 100644 --- a/SU2_CFD/src/numerics/scalar/scalar_sources.cpp +++ b/SU2_CFD/src/numerics/scalar/scalar_sources.cpp @@ -1,7 +1,7 @@ /*! * \file scalar_sources.cpp * \brief Implementation of numerics classes for integration of scalar source-terms. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/numerics/species/species_sources.cpp b/SU2_CFD/src/numerics/species/species_sources.cpp index 06a26902b8a..7ae364ce941 100644 --- a/SU2_CFD/src/numerics/species/species_sources.cpp +++ b/SU2_CFD/src/numerics/species/species_sources.cpp @@ -3,7 +3,7 @@ * \brief Implementation of numerics classes for integration of * species transport source-terms. * \author T. Kattmann - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -90,7 +90,6 @@ CNumerics::ResidualType<> CSourceAxisymmetric_Species::ComputeResidual(const /*--- Contribution due to 2D axisymmetric formulation ---*/ if (Coord_i[1] > EPS) { - AD::SetPreaccIn(Coord_i[1]); AD::SetPreaccIn(Diffusion_Coeff_i, nVar); AD::SetPreaccIn(ScalarVar_Grad_i, nVar, nDim); @@ -123,7 +122,7 @@ CNumerics::ResidualType<> CSourceAxisymmetric_Species::ComputeResidual(const if (turbulence) Mass_Diffusivity_Tur = V_i[idx.EddyViscosity()] / Sc_t; - for (auto iVar=0u; iVar < nVar; iVar++){ + for (auto iVar = 0u; iVar < nVar; iVar++) { residual[iVar] += yinv * Volume * (Density_i * Diffusion_Coeff_i[iVar] + Mass_Diffusivity_Tur) * ScalarVar_Grad_i[iVar][1]; } } diff --git a/SU2_CFD/src/numerics/template.cpp b/SU2_CFD/src/numerics/template.cpp index d81bba8d32f..40459ad02d1 100644 --- a/SU2_CFD/src/numerics/template.cpp +++ b/SU2_CFD/src/numerics/template.cpp @@ -2,7 +2,7 @@ * \file template.cpp * \brief Empty implementation of numerics templates, see .hpp file. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -32,9 +32,7 @@ CConvective_Template::CConvective_Template(unsigned short val_nDim, unsigned sho } -CConvective_Template::~CConvective_Template(void) { - -} +CConvective_Template::~CConvective_Template() = default; void CConvective_Template::ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, su2double **val_Jacobian_j, CConfig *config) { @@ -46,9 +44,7 @@ CViscous_Template::CViscous_Template(unsigned short val_nDim, unsigned short val } -CViscous_Template::~CViscous_Template(void) { - -} +CViscous_Template::~CViscous_Template() = default; void CViscous_Template::ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, su2double **val_Jacobian_j, CConfig *config) { @@ -61,9 +57,7 @@ CSource_Template::CSource_Template(unsigned short val_nDim, unsigned short val_n } -CSource_Template::~CSource_Template(void) { - -} +CSource_Template::~CSource_Template() = default; void CSource_Template::ComputeResidual(su2double *val_residual, su2double **val_Jacobian_i, CConfig *config) { diff --git a/SU2_CFD/src/output/CAdjElasticityOutput.cpp b/SU2_CFD/src/output/CAdjElasticityOutput.cpp index d0a1e00d0f8..6b6be57f485 100644 --- a/SU2_CFD/src/output/CAdjElasticityOutput.cpp +++ b/SU2_CFD/src/output/CAdjElasticityOutput.cpp @@ -2,7 +2,7 @@ * \file CAdjElasticityOutput.cpp * \brief Main subroutines for elasticity discrete adjoint output * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,6 +27,7 @@ #include "../../include/output/CAdjElasticityOutput.hpp" +#include #include "../../../Common/include/geometry/CGeometry.hpp" #include "../../include/solvers/CSolver.hpp" @@ -50,8 +51,8 @@ CAdjElasticityOutput::CAdjElasticityOutput(CConfig *config, unsigned short nDim) requestedScreenFields.emplace_back("INNER_ITER"); requestedScreenFields.emplace_back("ADJOINT_DISP_X"); requestedScreenFields.emplace_back("ADJOINT_DISP_Y"); - requestedScreenFields.emplace_back("SENS_E"); - requestedScreenFields.emplace_back("SENS_NU"); + requestedScreenFields.emplace_back("SENS_E_0"); + requestedScreenFields.emplace_back("SENS_NU_0"); nRequestedScreenFields = requestedScreenFields.size(); } @@ -62,9 +63,9 @@ CAdjElasticityOutput::CAdjElasticityOutput(CConfig *config, unsigned short nDim) nRequestedVolumeFields = requestedVolumeFields.size(); } - if (find(requestedVolumeFields.begin(), requestedVolumeFields.end(), string("SENSITIVITY")) == requestedVolumeFields.end()) { + if (find(requestedVolumeFields.begin(), requestedVolumeFields.end(), "SENSITIVITY") == requestedVolumeFields.end()) { requestedVolumeFields.emplace_back("SENSITIVITY"); - nRequestedVolumeFields ++; + nRequestedVolumeFields++; } stringstream ss; @@ -93,51 +94,73 @@ CAdjElasticityOutput::CAdjElasticityOutput(CConfig *config, unsigned short nDim) } -CAdjElasticityOutput::~CAdjElasticityOutput(void) {} +CAdjElasticityOutput::~CAdjElasticityOutput() = default; void CAdjElasticityOutput::SetHistoryOutputFields(CConfig *config){ - // Residuals + /*--- Residuals ---*/ AddHistoryOutput("ADJOINT_DISP_X", "rms[Ux_adj]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint of the X displacements.", HistoryFieldType::RESIDUAL); AddHistoryOutput("ADJOINT_DISP_Y", "rms[Uy_adj]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint of the Y displacements.", HistoryFieldType::RESIDUAL); - AddHistoryOutput("ADJOINT_DISP_Z", "rms[Uz_adj]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint of the Z displacements.", HistoryFieldType::RESIDUAL); + if (nVar_FEM == 3) { + AddHistoryOutput("ADJOINT_DISP_Z", "rms[Uz_adj]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint of the Z displacements.", HistoryFieldType::RESIDUAL); + } - //Sensitivities - AddHistoryOutput("SENS_E", "Sens[E]", ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", "d Objective / d Elasticity modulus"); - AddHistoryOutput("SENS_NU", "Sens[Nu]", ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", "d Objective / d Poisson ratio"); + /*--- Sensitivities ---*/ + for (auto iVar = 0u; iVar < config->GetnElasticityMat(); iVar++) { + const auto iVarS = std::to_string(iVar); + AddHistoryOutput("SENS_E_" + iVarS, "Sens[E" + iVarS + ']', ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", "d Objective / d Elasticity modulus"); + AddHistoryOutput("SENS_NU_" + iVarS, "Sens[Nu" + iVarS + ']', ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", "d Objective / d Poisson ratio"); + if (config->GetTime_Domain() && !config->GetPseudoStatic()) { + AddHistoryOutput("SENS_RHO_" + iVarS, "Sens[Rho" + iVarS + ']', ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", "d Objective / d Material density"); + } + if (config->GetDeadLoad()) { + AddHistoryOutput("SENS_RHO_DL_" + iVarS, "Sens[RhoDL" + iVarS + ']', ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", "d Objective / d Dead load density"); + } + } + if (config->GetDE_Effects()) { + for (auto iVar = 0u; iVar < config->GetnElectric_Field(); iVar++) { + const auto iVarS = std::to_string(iVar); + AddHistoryOutput("SENS_EFIELD_" + iVarS, "Sens[EField" + iVarS + ']', ScreenOutputFormat::SCIENTIFIC, "SENSITIVITY", "d Objective / d Electric field"); + } + } AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver."); AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver."); - AddHistoryOutput("BGS_ADJ_DISP_X", "bgs[A_Ux]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint X displacement.", HistoryFieldType::RESIDUAL); - AddHistoryOutput("BGS_ADJ_DISP_Y", "bgs[A_Uy]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint Y displacement.", HistoryFieldType::RESIDUAL); - AddHistoryOutput("BGS_ADJ_DISP_Z", "bgs[A_Uz]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint Z displacement.", HistoryFieldType::RESIDUAL); - + if (multiZone) { + AddHistoryOutput("BGS_ADJ_DISP_X", "bgs[A_Ux]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint X displacement.", HistoryFieldType::RESIDUAL); + AddHistoryOutput("BGS_ADJ_DISP_Y", "bgs[A_Uy]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint Y displacement.", HistoryFieldType::RESIDUAL); + if (nVar_FEM == 3) { + AddHistoryOutput("BGS_ADJ_DISP_Z", "bgs[A_Uz]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint Z displacement.", HistoryFieldType::RESIDUAL); + } + } } inline void CAdjElasticityOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) { SetHistoryOutputValue("ADJOINT_DISP_X", log10(solver[ADJFEA_SOL]->GetRes_RMS(0))); SetHistoryOutputValue("ADJOINT_DISP_Y", log10(solver[ADJFEA_SOL]->GetRes_RMS(1))); - if (nVar_FEM == 3){ + if (nVar_FEM == 3) { SetHistoryOutputValue("ADJOINT_DISP_Z", log10(solver[ADJFEA_SOL]->GetRes_RMS(2))); } - su2double Total_SensE = 0.0; su2double Total_SensNu = 0.0; - if (config->GetnElasticityMod() == 1) { - Total_SensE = solver[ADJFEA_SOL]->GetGlobal_Sens_E(0); - Total_SensNu = solver[ADJFEA_SOL]->GetGlobal_Sens_Nu(0); + for (unsigned short iVar = 0; iVar < config->GetnElasticityMat(); iVar++) { + const auto iVarS = std::to_string(iVar); + SetHistoryOutputValue("SENS_E_" + iVarS, solver[ADJFEA_SOL]->GetTotal_Sens_E(iVar)); + SetHistoryOutputValue("SENS_NU_" + iVarS, solver[ADJFEA_SOL]->GetTotal_Sens_Nu(iVar)); + if (config->GetTime_Domain() && !config->GetPseudoStatic()) { + SetHistoryOutputValue("SENS_RHO_" + iVarS, solver[ADJFEA_SOL]->GetTotal_Sens_Rho(iVar)); + } + if (config->GetDeadLoad()) { + SetHistoryOutputValue("SENS_RHO_DL_" + iVarS, solver[ADJFEA_SOL]->GetTotal_Sens_Rho_DL(iVar)); + } } - else { - for (unsigned short iVar = 0; iVar < config->GetnElasticityMod(); iVar++){ - Total_SensE += pow(solver[ADJFEA_SOL]->GetGlobal_Sens_E(iVar),2); - Total_SensNu += pow(solver[ADJFEA_SOL]->GetGlobal_Sens_Nu(iVar),2); + if (config->GetDE_Effects()) { + for (auto iVar = 0u; iVar < config->GetnElectric_Field(); iVar++) { + const auto iVarS = std::to_string(iVar); + SetHistoryOutputValue("SENS_EFIELD_" + iVarS, solver[ADJFEA_SOL]->GetTotal_Sens_EField(iVar)); } - Total_SensE = sqrt(Total_SensE); - Total_SensNu = sqrt(Total_SensNu); } - SetHistoryOutputValue("SENS_E", Total_SensE); - SetHistoryOutputValue("SENS_NU", Total_SensNu); SetHistoryOutputValue("LINSOL_ITER", solver[ADJFEA_SOL]->GetIterLinSolver()); SetHistoryOutputValue("LINSOL_RESIDUAL", log10(solver[ADJFEA_SOL]->GetResLinSolver())); @@ -149,6 +172,8 @@ inline void CAdjElasticityOutput::LoadHistoryData(CConfig *config, CGeometry *ge SetHistoryOutputValue("BGS_ADJ_DISP_Z", log10(solver[ADJFEA_SOL]->GetRes_BGS(2))); } } + + ComputeSimpleCustomOutputs(config); } void CAdjElasticityOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ @@ -170,6 +195,23 @@ void CAdjElasticityOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, SetVolumeOutputValue("SENSITIVITY-Y", iPoint, Node_Struc->GetSensitivity(iPoint, 1)); if (nDim == 3) SetVolumeOutputValue("SENSITIVITY-Z", iPoint, Node_Struc->GetSensitivity(iPoint, 2)); + + if (!config->GetTime_Domain()) return; + + SetVolumeOutputValue("SENS_DISP-X", iPoint, Node_Struc->GetSolution_time_n(iPoint, 0)); + SetVolumeOutputValue("SENS_DISP-Y", iPoint, Node_Struc->GetSolution_time_n(iPoint, 1)); + if (nDim == 3) + SetVolumeOutputValue("SENS_DISP-Z", iPoint, Node_Struc->GetSolution_time_n(iPoint, 2)); + + SetVolumeOutputValue("SENS_VEL-X", iPoint, Node_Struc->GetSolution_time_n(iPoint, nDim)); + SetVolumeOutputValue("SENS_VEL-Y", iPoint, Node_Struc->GetSolution_time_n(iPoint, nDim + 1)); + if (nDim == 3) + SetVolumeOutputValue("SENS_VEL-Z", iPoint, Node_Struc->GetSolution_time_n(iPoint, 5)); + + SetVolumeOutputValue("SENS_ACCEL-X", iPoint, Node_Struc->GetSolution_time_n(iPoint, 2 * nDim)); + SetVolumeOutputValue("SENS_ACCEL-Y", iPoint, Node_Struc->GetSolution_time_n(iPoint, 2 * nDim + 1)); + if (nDim == 3) + SetVolumeOutputValue("SENS_ACCEL-Z", iPoint, Node_Struc->GetSolution_time_n(iPoint, 8)); } void CAdjElasticityOutput::SetVolumeOutputFields(CConfig *config){ @@ -200,4 +242,23 @@ void CAdjElasticityOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("SENSITIVITY-Z", "Sensitivity_z", "SENSITIVITY", "geometric sensitivity in the z direction"); /// END_GROUP + if (!config->GetTime_Domain()) return; + + /*--- Sensitivities with respect to initial conditions. ---*/ + + AddVolumeOutput("SENS_DISP-X", "SensitivityDispN_x", "SENSITIVITY_N", "sensitivity to the previous x displacement"); + AddVolumeOutput("SENS_DISP-Y", "SensitivityDispN_y", "SENSITIVITY_N", "sensitivity to the previous y displacement"); + if (nDim == 3) + AddVolumeOutput("SENS_DISP-Z", "SensitivityDispN_z", "SENSITIVITY_N", "sensitivity to the previous z displacement"); + + AddVolumeOutput("SENS_VEL-X", "SensitivityVelN_x", "SENSITIVITY_N", "sensitivity to the previous x velocity"); + AddVolumeOutput("SENS_VEL-Y", "SensitivityVelN_y", "SENSITIVITY_N", "sensitivity to the previous y velocity"); + if (nDim == 3) + AddVolumeOutput("SENS_VEL-Z", "SensitivityVelN_z", "SENSITIVITY_N", "sensitivity to the previous z velocity"); + + AddVolumeOutput("SENS_ACCEL-X", "SensitivityAccelN_x", "SENSITIVITY_N", "sensitivity to the previous x acceleration"); + AddVolumeOutput("SENS_ACCEL-Y", "SensitivityAccelN_y", "SENSITIVITY_N", "sensitivity to the previous y acceleration"); + if (nDim == 3) + AddVolumeOutput("SENS_ACCEL-Z", "SensitivityAccelN_z", "SENSITIVITY_N", "sensitivity to the previous z acceleration"); + } diff --git a/SU2_CFD/src/output/CAdjFlowCompOutput.cpp b/SU2_CFD/src/output/CAdjFlowCompOutput.cpp index 3f15fdf4910..92c09dd01f4 100644 --- a/SU2_CFD/src/output/CAdjFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowCompOutput.cpp @@ -2,7 +2,7 @@ * \file CAdjFlowCompOutput.cpp * \brief Main subroutines for flow discrete adjoint output * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -35,14 +35,14 @@ CAdjFlowCompOutput::CAdjFlowCompOutput(CConfig *config, unsigned short nDim) : C /*--- Set the default history fields if nothing is set in the config file ---*/ - if (nRequestedHistoryFields == 0){ + if (nRequestedHistoryFields == 0) { requestedHistoryFields.emplace_back("ITER"); requestedHistoryFields.emplace_back("RMS_RES"); requestedHistoryFields.emplace_back("SENSITIVITY"); nRequestedHistoryFields = requestedHistoryFields.size(); } - if (nRequestedScreenFields == 0){ + if (nRequestedScreenFields == 0) { if (config->GetTime_Domain()) requestedScreenFields.emplace_back("TIME_ITER"); if (multiZone) requestedScreenFields.emplace_back("OUTER_ITER"); requestedScreenFields.emplace_back("INNER_ITER"); @@ -53,7 +53,7 @@ CAdjFlowCompOutput::CAdjFlowCompOutput(CConfig *config, unsigned short nDim) : C nRequestedScreenFields = requestedScreenFields.size(); } - if (nRequestedVolumeFields == 0){ + if (nRequestedVolumeFields == 0) { requestedVolumeFields.emplace_back("COORDINATES"); requestedVolumeFields.emplace_back("SOLUTION"); requestedVolumeFields.emplace_back("SENSITIVITY"); @@ -91,9 +91,9 @@ CAdjFlowCompOutput::CAdjFlowCompOutput(CConfig *config, unsigned short nDim) : C } -CAdjFlowCompOutput::~CAdjFlowCompOutput(void) {} +CAdjFlowCompOutput::~CAdjFlowCompOutput() = default; -void CAdjFlowCompOutput::SetHistoryOutputFields(CConfig *config){ +void CAdjFlowCompOutput::SetHistoryOutputFields(CConfig *config) { /// BEGIN_GROUP: RMS_RES, DESCRIPTION: The root-mean-square residuals of the SOLUTION variables. /// DESCRIPTION: Root-mean square residual of the adjoint density. @@ -103,10 +103,13 @@ void CAdjFlowCompOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Root-mean square residual of the adjoint momentum y-component. AddHistoryOutput("RMS_ADJ_MOMENTUM-Y", "rms[A_RhoV]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint momentum y-component.", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Root-mean square residual of the adjoint momentum z-component. - AddHistoryOutput("RMS_ADJ_MOMENTUM-Z", "rms[A_RhoW]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint momentum z-component.", HistoryFieldType::RESIDUAL); + if (nDim == 3) { + AddHistoryOutput("RMS_ADJ_MOMENTUM-Z", "rms[A_RhoW]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint momentum z-component.", HistoryFieldType::RESIDUAL); + } /// DESCRIPTION: Root-mean square residual of the adjoint energy. AddHistoryOutput("RMS_ADJ_ENERGY", "rms[A_E]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint energy.", HistoryFieldType::RESIDUAL); + AddHistoryOutputFields_AdjScalarRMS_RES(config); /// END_GROUP @@ -118,7 +121,9 @@ void CAdjFlowCompOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Maximum residual of the adjoint momentum y-component AddHistoryOutput("MAX_ADJ_MOMENTUM-Y", "max[A_RhoV]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint momentum y-component", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Maximum residual of the adjoint momentum z-component - AddHistoryOutput("MAX_ADJ_MOMENTUM-Z", "max[A_RhoW]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint momentum z-component", HistoryFieldType::RESIDUAL); + if (nDim == 3) { + AddHistoryOutput("MAX_ADJ_MOMENTUM-Z", "max[A_RhoW]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint momentum z-component", HistoryFieldType::RESIDUAL); + } /// DESCRIPTION: Maximum residual of the adjoint energy. AddHistoryOutput("MAX_ADJ_ENERGY", "max[A_E]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint energy.", HistoryFieldType::RESIDUAL); @@ -134,7 +139,9 @@ void CAdjFlowCompOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: BGS residual of the adjoint momentum y-component AddHistoryOutput("BGS_ADJ_MOMENTUM-Y", "bgs[A_RhoV]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint momentum y-component", HistoryFieldType::RESIDUAL); /// DESCRIPTION: BGS residual of the adjoint momentum z-component - AddHistoryOutput("BGS_ADJ_MOMENTUM-Z", "bgs[A_RhoW]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint momentum z-component", HistoryFieldType::RESIDUAL); + if (nDim == 3) { + AddHistoryOutput("BGS_ADJ_MOMENTUM-Z", "bgs[A_RhoW]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint momentum z-component", HistoryFieldType::RESIDUAL); + } /// DESCRIPTION: BGS residual of the adjoint energy. AddHistoryOutput("BGS_ADJ_ENERGY", "bgs[A_E]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint energy.", HistoryFieldType::RESIDUAL); @@ -157,16 +164,16 @@ void CAdjFlowCompOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver."); AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver."); - AddHistoryOutputFields_AdjScalarLinsol(config); + AddHistoryOutputFieldsAdjScalarLinsol(config); - if (config->GetDeform_Mesh()){ + if (config->GetDeform_Mesh()) { AddHistoryOutput("DEFORM_ITER", "DeformIter", ScreenOutputFormat::INTEGER, "DEFORM", "Linear solver iterations for the mesh deformation"); AddHistoryOutput("DEFORM_RESIDUAL", "DeformRes", ScreenOutputFormat::FIXED, "DEFORM", "Residual of the linear solver for the mesh deformation"); } } -void CAdjFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver){ +void CAdjFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) { CSolver* adjflow_solver = solver[ADJFLOW_SOL]; CSolver* mesh_solver = solver[MESH_SOL]; @@ -191,7 +198,7 @@ void CAdjFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, C SetHistoryOutputValue("MAX_ADJ_ENERGY", log10(adjflow_solver->GetRes_Max(3))); } - if (multiZone){ + if (multiZone) { SetHistoryOutputValue("BGS_ADJ_DENSITY", log10(adjflow_solver->GetRes_BGS(0))); SetHistoryOutputValue("BGS_ADJ_MOMENTUM-X", log10(adjflow_solver->GetRes_BGS(1))); SetHistoryOutputValue("BGS_ADJ_MOMENTUM-Y", log10(adjflow_solver->GetRes_BGS(2))); @@ -217,10 +224,12 @@ void CAdjFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, C SetHistoryOutputValue("DEFORM_RESIDUAL", log10(mesh_solver->System.GetResidual())); } - LoadHistoryData_AdjScalar(config, solver); + LoadHistoryDataAdjScalar(config, solver); + + ComputeSimpleCustomOutputs(config); } -void CAdjFlowCompOutput::SetVolumeOutputFields(CConfig *config){ +void CAdjFlowCompOutput::SetVolumeOutputFields(CConfig *config) { // Grid coordinates AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); @@ -241,7 +250,7 @@ void CAdjFlowCompOutput::SetVolumeOutputFields(CConfig *config){ /// DESCRIPTION: Adjoint energy. AddVolumeOutput("ADJ_ENERGY", "Adjoint_Energy", "SOLUTION", "Adjoint energy"); - SetVolumeOutputFields_AdjScalarSolution(config); + SetVolumeOutputFieldsAdjScalarSolution(config); /// END_GROUP /// BEGIN_GROUP: RESIDUAL, DESCRIPTION: Residuals of the SOLUTION variables. @@ -257,7 +266,7 @@ void CAdjFlowCompOutput::SetVolumeOutputFields(CConfig *config){ /// DESCRIPTION: Residual of the adjoint energy. AddVolumeOutput("RES_ADJ_ENERGY", "Residual_Adjoint_Energy", "RESIDUAL", "Residual of the adjoint energy"); - SetVolumeOutputFields_AdjScalarResidual(config); + SetVolumeOutputFieldsAdjScalarResidual(config); /// END_GROUP /// BEGIN_GROUP: SENSITIVITY, DESCRIPTION: Geometrical sensitivities of the current objective function. @@ -274,7 +283,7 @@ void CAdjFlowCompOutput::SetVolumeOutputFields(CConfig *config){ } -void CAdjFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ +void CAdjFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint) { CVariable* Node_AdjFlow = solver[ADJFLOW_SOL]->GetNodes(); CPoint* Node_Geo = geometry->nodes; @@ -287,7 +296,7 @@ void CAdjFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CS SetVolumeOutputValue("ADJ_DENSITY", iPoint, Node_AdjFlow->GetSolution(iPoint, 0)); SetVolumeOutputValue("ADJ_MOMENTUM-X", iPoint, Node_AdjFlow->GetSolution(iPoint, 1)); SetVolumeOutputValue("ADJ_MOMENTUM-Y", iPoint, Node_AdjFlow->GetSolution(iPoint, 2)); - if (nDim == 3){ + if (nDim == 3) { SetVolumeOutputValue("ADJ_MOMENTUM-Z", iPoint, Node_AdjFlow->GetSolution(iPoint, 3)); SetVolumeOutputValue("ADJ_ENERGY", iPoint, Node_AdjFlow->GetSolution(iPoint, 4)); } else { @@ -298,7 +307,7 @@ void CAdjFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CS SetVolumeOutputValue("RES_ADJ_DENSITY", iPoint, Node_AdjFlow->GetSolution(iPoint, 0) - Node_AdjFlow->GetSolution_Old(iPoint, 0)); SetVolumeOutputValue("RES_ADJ_MOMENTUM-X", iPoint, Node_AdjFlow->GetSolution(iPoint, 1) - Node_AdjFlow->GetSolution_Old(iPoint, 1)); SetVolumeOutputValue("RES_ADJ_MOMENTUM-Y", iPoint, Node_AdjFlow->GetSolution(iPoint, 2) - Node_AdjFlow->GetSolution_Old(iPoint, 2)); - if (nDim == 3){ + if (nDim == 3) { SetVolumeOutputValue("RES_ADJ_MOMENTUM-Z", iPoint, Node_AdjFlow->GetSolution(iPoint, 3) - Node_AdjFlow->GetSolution_Old(iPoint, 3)); SetVolumeOutputValue("RES_ADJ_ENERGY", iPoint, Node_AdjFlow->GetSolution(iPoint, 4) - Node_AdjFlow->GetSolution_Old(iPoint, 4)); } else { @@ -310,17 +319,17 @@ void CAdjFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CS if (nDim == 3) SetVolumeOutputValue("SENSITIVITY-Z", iPoint, Node_AdjFlow->GetSensitivity(iPoint, 2)); - LoadVolumeData_AdjScalar(config, solver, iPoint); + LoadVolumeDataAdjScalar(config, solver, iPoint); } -void CAdjFlowCompOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint, unsigned short iMarker, unsigned long iVertex){ +void CAdjFlowCompOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint, unsigned short iMarker, unsigned long iVertex) { SetVolumeOutputValue("SENSITIVITY", iPoint, solver[ADJFLOW_SOL]->GetCSensitivity(iMarker, iVertex)); } -bool CAdjFlowCompOutput::SetInit_Residuals(const CConfig *config){ +bool CAdjFlowCompOutput::SetInitResiduals(const CConfig *config) { return ((config->GetTime_Marching() != TIME_MARCHING::STEADY) && (curInnerIter == 0)) || ((config->GetTime_Marching() == TIME_MARCHING::STEADY) && (curInnerIter < 2)); diff --git a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp index 74dfbebcfd1..b279d0fbfe1 100644 --- a/SU2_CFD/src/output/CAdjFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowIncOutput.cpp @@ -2,7 +2,7 @@ * \file CAdjFlowIncOutput.cpp * \brief Main subroutines for flow discrete adjoint output * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -41,14 +41,14 @@ CAdjFlowIncOutput::CAdjFlowIncOutput(CConfig *config, unsigned short nDim) : CAd /*--- Set the default history fields if nothing is set in the config file ---*/ - if (nRequestedHistoryFields == 0){ + if (nRequestedHistoryFields == 0) { requestedHistoryFields.emplace_back("ITER"); requestedHistoryFields.emplace_back("RMS_RES"); requestedHistoryFields.emplace_back("SENSITIVITY"); nRequestedHistoryFields = requestedHistoryFields.size(); } - if (nRequestedScreenFields == 0){ + if (nRequestedScreenFields == 0) { if (config->GetTime_Domain()) requestedScreenFields.emplace_back("TIME_ITER"); if (multiZone) requestedScreenFields.emplace_back("OUTER_ITER"); requestedScreenFields.emplace_back("INNER_ITER"); @@ -59,7 +59,7 @@ CAdjFlowIncOutput::CAdjFlowIncOutput(CConfig *config, unsigned short nDim) : CAd nRequestedScreenFields = requestedScreenFields.size(); } - if (nRequestedVolumeFields == 0){ + if (nRequestedVolumeFields == 0) { requestedVolumeFields.emplace_back("COORDINATES"); requestedVolumeFields.emplace_back("SOLUTION"); requestedVolumeFields.emplace_back("SENSITIVITY"); @@ -97,9 +97,9 @@ CAdjFlowIncOutput::CAdjFlowIncOutput(CConfig *config, unsigned short nDim) : CAd } -CAdjFlowIncOutput::~CAdjFlowIncOutput(void) {} +CAdjFlowIncOutput::~CAdjFlowIncOutput() = default; -void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config){ +void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config) { /// BEGIN_GROUP: RMS_RES, DESCRIPTION: The root-mean-square residuals of the SOLUTION variables. /// DESCRIPTION: Root-mean square residual of the adjoint Pressure. @@ -109,9 +109,13 @@ void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Root-mean square residual of the adjoint Velocity y-component. AddHistoryOutput("RMS_ADJ_VELOCITY-Y", "rms[A_V]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint Velocity y-component.", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Root-mean square residual of the adjoint Velocity z-component. - AddHistoryOutput("RMS_ADJ_VELOCITY-Z", "rms[A_W]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint Velocity z-component.", HistoryFieldType::RESIDUAL); + if (nDim == 3) { + AddHistoryOutput("RMS_ADJ_VELOCITY-Z", "rms[A_W]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint Velocity z-component.", HistoryFieldType::RESIDUAL); + } /// DESCRIPTION: Maximum residual of the temperature. - AddHistoryOutput("RMS_ADJ_TEMPERATURE", "rms[A_T]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint temperature.", HistoryFieldType::RESIDUAL); + if (heat || weakly_coupled_heat) { + AddHistoryOutput("RMS_ADJ_TEMPERATURE", "rms[A_T]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint temperature.", HistoryFieldType::RESIDUAL); + } if (config->GetKind_Streamwise_Periodic() == ENUM_STREAMWISE_PERIODIC::MASSFLOW) { AddHistoryOutput("ADJOINT_SOLEXTRA", "Adjoint_SolExtra", ScreenOutputFormat::FIXED, "ADJOINT_SOLEXTRA", "Adjoint value of the first extra Solution.", HistoryFieldType::COEFFICIENT); @@ -119,7 +123,7 @@ void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutputFields_AdjScalarRMS_RES(config); - if (config->AddRadiation()){ + if (config->AddRadiation()) { /// DESCRIPTION: Root-mean square residual of the adjoint radiative energy tilde. AddHistoryOutput("RMS_ADJ_RAD_ENERGY", "rms[A_P1]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the P1 radiative energy.",HistoryFieldType::RESIDUAL); } @@ -133,9 +137,13 @@ void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Maximum residual of the adjoint Velocity y-component AddHistoryOutput("MAX_ADJ_VELOCITY-Y", "max[A_RhoV]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint Velocity y-component", HistoryFieldType::RESIDUAL); /// DESCRIPTION: Maximum residual of the adjoint Velocity z-component - AddHistoryOutput("MAX_ADJ_VELOCITY-Z", "max[A_RhoW]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint Velocity z-component", HistoryFieldType::RESIDUAL); + if (nDim == 3) { + AddHistoryOutput("MAX_ADJ_VELOCITY-Z", "max[A_RhoW]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint Velocity z-component", HistoryFieldType::RESIDUAL); + } /// DESCRIPTION: Maximum residual of the temperature. - AddHistoryOutput("MAX_ADJ_TEMPERATURE", "max[A_T]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the temperature.", HistoryFieldType::RESIDUAL); + if (heat || weakly_coupled_heat) { + AddHistoryOutput("MAX_ADJ_TEMPERATURE", "max[A_T]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the temperature.", HistoryFieldType::RESIDUAL); + } AddHistoryOutputFields_AdjScalarMAX_RES(config); /// END_GROUP @@ -148,13 +156,17 @@ void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: BGS residual of the adjoint Velocity y-component AddHistoryOutput("BGS_ADJ_VELOCITY-Y", "bgs[A_RhoV]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint Velocity y-component", HistoryFieldType::RESIDUAL); /// DESCRIPTION: BGS residual of the adjoint Velocity z-component - AddHistoryOutput("BGS_ADJ_VELOCITY-Z", "bgs[A_RhoW]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint Velocity z-component", HistoryFieldType::RESIDUAL); + if (nDim == 3) { + AddHistoryOutput("BGS_ADJ_VELOCITY-Z", "bgs[A_RhoW]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint Velocity z-component", HistoryFieldType::RESIDUAL); + } /// DESCRIPTION: BGS residual of the temperature. - AddHistoryOutput("BGS_ADJ_TEMPERATURE", "bgs[A_T]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint temperature.", HistoryFieldType::RESIDUAL); + if (heat || weakly_coupled_heat) { + AddHistoryOutput("BGS_ADJ_TEMPERATURE", "bgs[A_T]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint temperature.", HistoryFieldType::RESIDUAL); + } AddHistoryOutputFields_AdjScalarBGS_RES(config); - if (config->AddRadiation()){ + if (config->AddRadiation()) { /// DESCRIPTION: Root-mean square residual of the adjoint radiative energy tilde. AddHistoryOutput("BGS_ADJ_RAD_ENERGY", "bgs[A_P1]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the P1 radiative energy.",HistoryFieldType::RESIDUAL); } @@ -176,9 +188,9 @@ void CAdjFlowIncOutput::SetHistoryOutputFields(CConfig *config){ AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver."); AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver."); - AddHistoryOutputFields_AdjScalarLinsol(config); + AddHistoryOutputFieldsAdjScalarLinsol(config); - if (config->GetDeform_Mesh()){ + if (config->GetDeform_Mesh()) { AddHistoryOutput("DEFORM_ITER", "DeformIter", ScreenOutputFormat::INTEGER, "DEFORM", "Linear solver iterations for the mesh deformation"); AddHistoryOutput("DEFORM_RESIDUAL", "DeformRes", ScreenOutputFormat::FIXED, "DEFORM", "Residual of the linear solver for the mesh deformation"); } @@ -198,15 +210,15 @@ void CAdjFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CS if (nDim == 3) { SetHistoryOutputValue("RMS_ADJ_VELOCITY-Z", log10(adjflow_solver->GetRes_RMS(3))); } - if (weakly_coupled_heat){ + if (weakly_coupled_heat) { SetHistoryOutputValue("RMS_ADJ_TEMPERATURE", log10(adjheat_solver->GetRes_RMS(0))); } - if (heat){ + if (heat) { if (nDim == 3) SetHistoryOutputValue("RMS_ADJ_TEMPERATURE", log10(adjflow_solver->GetRes_RMS(4))); else SetHistoryOutputValue("RMS_ADJ_TEMPERATURE", log10(adjflow_solver->GetRes_RMS(3))); } - if (config->AddRadiation()){ + if (config->AddRadiation()) { SetHistoryOutputValue("RMS_ADJ_RAD_ENERGY", log10(adjrad_solver->GetRes_RMS(0))); } @@ -220,30 +232,30 @@ void CAdjFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CS if (nDim == 3) { SetHistoryOutputValue("MAX_ADJ_VELOCITY-Z", log10(adjflow_solver->GetRes_Max(3))); } - if (weakly_coupled_heat){ + if (weakly_coupled_heat) { SetHistoryOutputValue("MAX_ADJ_TEMPERATURE", log10(adjheat_solver->GetRes_Max(0))); } - if (heat){ + if (heat) { if (nDim == 3) SetHistoryOutputValue("MAX_ADJ_TEMPERATURE", log10(adjflow_solver->GetRes_Max(4))); else SetHistoryOutputValue("MAX_ADJ_TEMPERATURE", log10(adjflow_solver->GetRes_Max(3))); } - if (multiZone){ + if (multiZone) { SetHistoryOutputValue("BGS_ADJ_PRESSURE", log10(adjflow_solver->GetRes_BGS(0))); SetHistoryOutputValue("BGS_ADJ_VELOCITY-X", log10(adjflow_solver->GetRes_BGS(1))); SetHistoryOutputValue("BGS_ADJ_VELOCITY-Y", log10(adjflow_solver->GetRes_BGS(2))); if (nDim == 3) { SetHistoryOutputValue("BGS_ADJ_VELOCITY-Z", log10(adjflow_solver->GetRes_BGS(3))); } - if (weakly_coupled_heat){ + if (weakly_coupled_heat) { SetHistoryOutputValue("BGS_ADJ_TEMPERATURE", log10(adjheat_solver->GetRes_BGS(0))); } - if (heat){ + if (heat) { if (nDim == 3) SetHistoryOutputValue("BGS_ADJ_TEMPERATURE", log10(adjflow_solver->GetRes_BGS(4))); else SetHistoryOutputValue("BGS_ADJ_TEMPERATURE", log10(adjflow_solver->GetRes_BGS(3))); } - if (config->AddRadiation()){ + if (config->AddRadiation()) { SetHistoryOutputValue("BGS_ADJ_RAD_ENERGY", log10(adjrad_solver->GetRes_BGS(0))); } } @@ -262,18 +274,20 @@ void CAdjFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CS SetHistoryOutputValue("DEFORM_RESIDUAL", log10(mesh_solver->System.GetResidual())); } - LoadHistoryData_AdjScalar(config, solver); + LoadHistoryDataAdjScalar(config, solver); + + ComputeSimpleCustomOutputs(config); } -void CAdjFlowIncOutput::SetVolumeOutputFields(CConfig *config){ +void CAdjFlowIncOutput::SetVolumeOutputFields(CConfig *config) { // Grid coordinates AddVolumeOutput("COORD-X", "x", "COORDINATES", "x-component of the coordinate vector"); AddVolumeOutput("COORD-Y", "y", "COORDINATES", "y-component of the coordinate vector"); - if (nDim == 3) + if (nDim == 3) { AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector"); - + } /// BEGIN_GROUP: SOLUTION, DESCRIPTION: The SOLUTION variables of the adjoint solver. /// DESCRIPTION: Adjoint Pressure. AddVolumeOutput("ADJ_PRESSURE", "Adjoint_Pressure", "SOLUTION", "Adjoint pressure"); @@ -281,25 +295,26 @@ void CAdjFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("ADJ_VELOCITY-X", "Adjoint_Velocity_x", "SOLUTION", "x-component of the adjoint velocity vector"); /// DESCRIPTION: Adjoint Velocity y-component. AddVolumeOutput("ADJ_VELOCITY-Y", "Adjoint_Velocity_y", "SOLUTION", "y-component of the adjoint velocity vector"); - if (nDim == 3) + if (nDim == 3) { /// DESCRIPTION: Adjoint Velocity z-component. AddVolumeOutput("ADJ_VELOCITY-Z", "Adjoint_Velocity_z", "SOLUTION", "z-component of the adjoint velocity vector"); - + } AddVolumeOutput("ADJ_TEMPERATURE", "Adjoint_Temperature", "SOLUTION", "Adjoint temperature"); - SetVolumeOutputFields_AdjScalarSolution(config); + SetVolumeOutputFieldsAdjScalarSolution(config); - if (config->AddRadiation()){ + if (config->AddRadiation()) { AddVolumeOutput("ADJ_P1_ENERGY", "Adjoint_Energy(P1)", "SOLUTION", "Adjoint radiative energy"); } /// END_GROUP // Grid velocity - if (config->GetDynamic_Grid()){ + if (config->GetDynamic_Grid()) { AddVolumeOutput("GRID_VELOCITY-X", "Grid_Velocity_x", "GRID_VELOCITY", "x-component of the grid velocity vector"); AddVolumeOutput("GRID_VELOCITY-Y", "Grid_Velocity_y", "GRID_VELOCITY", "y-component of the grid velocity vector"); - if (nDim == 3 ) + if (nDim == 3 ) { AddVolumeOutput("GRID_VELOCITY-Z", "Grid_Velocity_z", "GRID_VELOCITY", "z-component of the grid velocity vector"); + } } /// BEGIN_GROUP: RESIDUAL, DESCRIPTION: Residuals of the SOLUTION variables. @@ -309,15 +324,16 @@ void CAdjFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("RES_ADJ_VELOCITY-X", "Residual_Adjoint_Velocity_x", "RESIDUAL", "Residual of the adjoint x-velocity"); /// DESCRIPTION: Residual of the adjoint Velocity y-component. AddVolumeOutput("RES_ADJ_VELOCITY-Y", "Residual_Adjoint_Velocity_y", "RESIDUAL", "Residual of the adjoint y-velocity"); - if (nDim == 3) + if (nDim == 3) { /// DESCRIPTION: Residual of the adjoint Velocity z-component. AddVolumeOutput("RES_ADJ_VELOCITY-Z", "Residual_Adjoint_Velocity_z", "RESIDUAL", "Residual of the adjoint z-velocity"); + } /// DESCRIPTION: Residual of the adjoint energy. AddVolumeOutput("RES_ADJ_TEMPERATURE", "Residual_Adjoint_Heat", "RESIDUAL", "Residual of the adjoint temperature"); - SetVolumeOutputFields_AdjScalarResidual(config); + SetVolumeOutputFieldsAdjScalarResidual(config); - if (config->AddRadiation()){ + if (config->AddRadiation()) { AddVolumeOutput("RES_P1_ENERGY", "Residual_Adjoint_Energy_P1", "RESIDUAL", "Residual of adjoint radiative energy"); } /// END_GROUP @@ -327,42 +343,44 @@ void CAdjFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("SENSITIVITY-X", "Sensitivity_x", "SENSITIVITY", "x-component of the sensitivity vector"); /// DESCRIPTION: Sensitivity y-component. AddVolumeOutput("SENSITIVITY-Y", "Sensitivity_y", "SENSITIVITY", "y-component of the sensitivity vector"); - if (nDim == 3) + if (nDim == 3) { /// DESCRIPTION: Sensitivity z-component. AddVolumeOutput("SENSITIVITY-Z", "Sensitivity_z", "SENSITIVITY", "z-component of the sensitivity vector"); + } /// DESCRIPTION: Sensitivity in normal direction. AddVolumeOutput("SENSITIVITY", "Surface_Sensitivity", "SENSITIVITY", "sensitivity in normal direction"); /// END_GROUP } -void CAdjFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ +void CAdjFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint) { CVariable* Node_AdjFlow = solver[ADJFLOW_SOL]->GetNodes(); CVariable* Node_AdjHeat = nullptr; CVariable* Node_AdjRad = nullptr; CPoint* Node_Geo = geometry->nodes; - if (weakly_coupled_heat){ + if (weakly_coupled_heat) { Node_AdjHeat = solver[ADJHEAT_SOL]->GetNodes(); } - if (config->GetKind_RadiationModel() != RADIATION_MODEL::NONE){ + if (config->GetKind_RadiationModel() != RADIATION_MODEL::NONE) { Node_AdjRad = solver[ADJRAD_SOL]->GetNodes(); } SetVolumeOutputValue("COORD-X", iPoint, Node_Geo->GetCoord(iPoint, 0)); SetVolumeOutputValue("COORD-Y", iPoint, Node_Geo->GetCoord(iPoint, 1)); - if (nDim == 3) + if (nDim == 3) { SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(iPoint, 2)); + } SetVolumeOutputValue("ADJ_PRESSURE", iPoint, Node_AdjFlow->GetSolution(iPoint, 0)); SetVolumeOutputValue("ADJ_VELOCITY-X", iPoint, Node_AdjFlow->GetSolution(iPoint, 1)); SetVolumeOutputValue("ADJ_VELOCITY-Y", iPoint, Node_AdjFlow->GetSolution(iPoint, 2)); - if (nDim == 3){ + if (nDim == 3) { SetVolumeOutputValue("ADJ_VELOCITY-Z", iPoint, Node_AdjFlow->GetSolution(iPoint, 3)); } - if (weakly_coupled_heat){ + if (weakly_coupled_heat) { SetVolumeOutputValue("ADJ_TEMPERATURE", iPoint, Node_AdjHeat->GetSolution(iPoint, 0)); } else { @@ -371,7 +389,7 @@ void CAdjFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSo } // Radiation - if (config->AddRadiation()){ + if (config->AddRadiation()) { SetVolumeOutputValue("ADJ_P1_ENERGY", iPoint, Node_AdjRad->GetSolution(iPoint, 0)); } @@ -379,33 +397,34 @@ void CAdjFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSo SetVolumeOutputValue("RES_ADJ_PRESSURE", iPoint, Node_AdjFlow->GetSolution(iPoint, 0) - Node_AdjFlow->GetSolution_Old(iPoint, 0)); SetVolumeOutputValue("RES_ADJ_VELOCITY-X", iPoint, Node_AdjFlow->GetSolution(iPoint, 1) - Node_AdjFlow->GetSolution_Old(iPoint, 1)); SetVolumeOutputValue("RES_ADJ_VELOCITY-Y", iPoint, Node_AdjFlow->GetSolution(iPoint, 2) - Node_AdjFlow->GetSolution_Old(iPoint, 2)); - if (nDim == 3){ + if (nDim == 3) { SetVolumeOutputValue("RES_ADJ_VELOCITY-Z", iPoint, Node_AdjFlow->GetSolution(iPoint, 3) - Node_AdjFlow->GetSolution_Old(iPoint, 3)); SetVolumeOutputValue("RES_ADJ_TEMPERATURE", iPoint, Node_AdjFlow->GetSolution(iPoint, 4) - Node_AdjFlow->GetSolution_Old(iPoint, 4)); } else { SetVolumeOutputValue("RES_ADJ_TEMPERATURE", iPoint, Node_AdjFlow->GetSolution(iPoint, 3) - Node_AdjFlow->GetSolution_Old(iPoint, 3)); } - if (config->AddRadiation()){ + if (config->AddRadiation()) { SetVolumeOutputValue("RES_P1_ENERGY", iPoint, Node_AdjRad->GetSolution(iPoint, 0) - Node_AdjRad->GetSolution_Old(iPoint, 0)); } SetVolumeOutputValue("SENSITIVITY-X", iPoint, Node_AdjFlow->GetSensitivity(iPoint, 0)); SetVolumeOutputValue("SENSITIVITY-Y", iPoint, Node_AdjFlow->GetSensitivity(iPoint, 1)); - if (nDim == 3) + if (nDim == 3) { SetVolumeOutputValue("SENSITIVITY-Z", iPoint, Node_AdjFlow->GetSensitivity(iPoint, 2)); + } - LoadVolumeData_AdjScalar(config, solver, iPoint); + LoadVolumeDataAdjScalar(config, solver, iPoint); } -void CAdjFlowIncOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint, unsigned short iMarker, unsigned long iVertex){ +void CAdjFlowIncOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint, unsigned short iMarker, unsigned long iVertex) { SetVolumeOutputValue("SENSITIVITY", iPoint, solver[ADJFLOW_SOL]->GetCSensitivity(iMarker, iVertex)); } -bool CAdjFlowIncOutput::SetInit_Residuals(const CConfig *config){ +bool CAdjFlowIncOutput::SetInitResiduals(const CConfig *config) { return (config->GetTime_Marching() != TIME_MARCHING::STEADY && (curInnerIter == 0))|| (config->GetTime_Marching() == TIME_MARCHING::STEADY && (curTimeIter < 2)); diff --git a/SU2_CFD/src/output/CAdjFlowOutput.cpp b/SU2_CFD/src/output/CAdjFlowOutput.cpp index 647fe42fcbd..f20f9c9bcad 100644 --- a/SU2_CFD/src/output/CAdjFlowOutput.cpp +++ b/SU2_CFD/src/output/CAdjFlowOutput.cpp @@ -2,7 +2,7 @@ * \file CAdjFlowOutput.cpp * \brief Main subroutines for flow discrete adjoint output * \author T. Kattmann - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -55,11 +55,22 @@ void CAdjFlowOutput::AddHistoryOutputFields_AdjScalarRMS_RES(const CConfig* conf } } - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { + if (config->GetKind_Species_Model() == SPECIES_MODEL::SPECIES_TRANSPORT) { for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { AddHistoryOutput("RMS_ADJ_SPECIES_" + std::to_string(iVar), "rms[A_rho*Y_" + std::to_string(iVar) + "]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint transported species.", HistoryFieldType::RESIDUAL); } } + + if (config->GetKind_Species_Model() == SPECIES_MODEL::FLAMELET) { + for (auto iCV=0u; iCV < config->GetNControlVars(); iCV++) { + const auto& cv_name = config->GetControllingVariableName(iCV); + AddHistoryOutput("RMS_ADJ_"+cv_name, "rms[" + cv_name + "]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint " + cv_name, HistoryFieldType::RESIDUAL); + } + for (unsigned short i_scalar = 0; i_scalar < config->GetNUserScalars(); i_scalar++) { + const auto& scalar_name = config->GetUserScalarName(i_scalar); + AddHistoryOutput("RMS_ADJ_" + scalar_name, "rms[" + scalar_name + "]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the adjoint of " + scalar_name + " .", HistoryFieldType::RESIDUAL); + } + } } void CAdjFlowOutput::AddHistoryOutputFields_AdjScalarMAX_RES(const CConfig* config) { @@ -80,11 +91,22 @@ void CAdjFlowOutput::AddHistoryOutputFields_AdjScalarMAX_RES(const CConfig* conf } } - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { + if (config->GetKind_Species_Model() == SPECIES_MODEL::SPECIES_TRANSPORT) { for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { AddHistoryOutput("MAX_ADJ_SPECIES_" + std::to_string(iVar), "max[A_rho*Y_" + std::to_string(iVar) + "]",ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint transported species.", HistoryFieldType::RESIDUAL); } } + + if (config->GetKind_Species_Model() == SPECIES_MODEL::FLAMELET) { + for (auto iCV=0u; iCV < config->GetNControlVars(); iCV++) { + const auto& cv_name = config->GetControllingVariableName(iCV); + AddHistoryOutput("MAX_ADJ_" + cv_name, "max["+cv_name +"]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint " + cv_name, HistoryFieldType::RESIDUAL); + } + for (unsigned short i_scalar = 0; i_scalar < config->GetNUserScalars(); i_scalar++) { + const auto& scalar_name = config->GetUserScalarName(i_scalar); + AddHistoryOutput("MAX_ADJ_" + scalar_name, "max[scalar_" + scalar_name + "]",ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the adjoint of " + scalar_name + " .", HistoryFieldType::RESIDUAL); + } + } } void CAdjFlowOutput::AddHistoryOutputFields_AdjScalarBGS_RES(const CConfig* config) { @@ -107,27 +129,44 @@ void CAdjFlowOutput::AddHistoryOutputFields_AdjScalarBGS_RES(const CConfig* conf } } - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { + if (config->GetKind_Species_Model() == SPECIES_MODEL::SPECIES_TRANSPORT) { for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { AddHistoryOutput("BGS_ADJ_SPECIES_" + std::to_string(iVar), "bgs[A_rho*Y_" + std::to_string(iVar) + "]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint transported species.", HistoryFieldType::RESIDUAL); } } + + if (config->GetKind_Species_Model() == SPECIES_MODEL::FLAMELET) { + for (auto iCV=0u; iCV < config->GetNControlVars(); iCV++) { + const auto& cv_name = config->GetControllingVariableName(iCV); + AddHistoryOutput("BGS_ADJ_" + cv_name, "bgs[" + cv_name + "]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint " + cv_name, HistoryFieldType::RESIDUAL); + } + + for (unsigned short i_scalar = 0; i_scalar < config->GetNUserScalars(); i_scalar++) { + const auto& scalar_name = config->GetUserScalarName(i_scalar); + AddHistoryOutput("BGS_ADJ_" + scalar_name, "bgs[" + scalar_name + "]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the adjoint of " + scalar_name + " .", HistoryFieldType::RESIDUAL); + } + } } -void CAdjFlowOutput::AddHistoryOutputFields_AdjScalarLinsol(const CConfig* config) { +void CAdjFlowOutput::AddHistoryOutputFieldsAdjScalarLinsol(const CConfig* config) { if ((turb_model != TURB_MODEL::NONE) && !frozen_visc) { AddHistoryOutput("LINSOL_ITER_TURB", "LinSolIterTurb", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver for turbulence."); AddHistoryOutput("LINSOL_RESIDUAL_TURB", "LinSolResTurb", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver for turbulence."); } - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { + if (config->GetKind_Species_Model() == SPECIES_MODEL::SPECIES_TRANSPORT) { AddHistoryOutput("LINSOL_ITER_SPECIES", "LinSolIterSpecies", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver for species solver."); AddHistoryOutput("LINSOL_RESIDUAL_SPECIES", "LinSolResSpecies", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver for species solver."); } + + if (config->GetKind_Species_Model() == SPECIES_MODEL::FLAMELET) { + AddHistoryOutput("LINSOL_ITER_FLAMELET", "LinSolIterScalar", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver for scalar solver."); + AddHistoryOutput("LINSOL_RESIDUAL_FLAMELET", "LinSolResScalar", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver for scalar solver."); + } } // clang-format on -void CAdjFlowOutput::LoadHistoryData_AdjScalar(const CConfig* config, const CSolver* const* solver) { +void CAdjFlowOutput::LoadHistoryDataAdjScalar(const CConfig* config, const CSolver* const* solver) { const auto adjturb_solver = solver[ADJTURB_SOL]; const auto adjspecies_solver = solver[ADJSPECIES_SOL]; @@ -160,7 +199,7 @@ void CAdjFlowOutput::LoadHistoryData_AdjScalar(const CConfig* config, const CSol } } - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { + if (config->GetKind_Species_Model() == SPECIES_MODEL::SPECIES_TRANSPORT) { for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { SetHistoryOutputValue("RMS_ADJ_SPECIES_" + std::to_string(iVar), log10(adjspecies_solver->GetRes_RMS(iVar))); SetHistoryOutputValue("MAX_ADJ_SPECIES_" + std::to_string(iVar), log10(adjspecies_solver->GetRes_Max(iVar))); @@ -172,9 +211,33 @@ void CAdjFlowOutput::LoadHistoryData_AdjScalar(const CConfig* config, const CSol SetHistoryOutputValue("LINSOL_ITER_SPECIES", adjspecies_solver->GetIterLinSolver()); SetHistoryOutputValue("LINSOL_RESIDUAL_SPECIES", log10(adjspecies_solver->GetResLinSolver())); } + + if (config->GetKind_Species_Model() == SPECIES_MODEL::FLAMELET) { + for (auto iCV=0u; iCV < config->GetNControlVars(); iCV++) { + const auto& cv_name = config->GetControllingVariableName(iCV); + SetHistoryOutputValue("RMS_ADJ_"+cv_name, log10(adjspecies_solver->GetRes_RMS(iCV))); + SetHistoryOutputValue("MAX_ADJ_"+cv_name, log10(adjspecies_solver->GetRes_Max(iCV))); + if (multiZone) + SetHistoryOutputValue("BGS_ADJ_" + cv_name, log10(adjspecies_solver->GetRes_BGS(iCV))); + } + + for (unsigned short i_scalar = 0; i_scalar < config->GetNUserScalars(); i_scalar++) { + const auto& scalar_name = config->GetUserScalarName(i_scalar); + SetHistoryOutputValue("RMS_ADJ_" + scalar_name, log10(adjspecies_solver->GetRes_RMS(2 + i_scalar))); + SetHistoryOutputValue("MAX_ADJ_" + scalar_name, log10(adjspecies_solver->GetRes_Max(2 + i_scalar))); + if (multiZone) { + SetHistoryOutputValue("BGS_ADJ_" + scalar_name, log10(adjspecies_solver->GetRes_BGS(2 + i_scalar))); + } + } + + SetHistoryOutputValue("LINSOL_ITER_FLAMELET", adjspecies_solver->GetIterLinSolver()); + SetHistoryOutputValue("LINSOL_RESIDUAL_FLAMELET", log10(adjspecies_solver->GetResLinSolver())); + } + + ComputeSimpleCustomOutputs(config); } -void CAdjFlowOutput::SetVolumeOutputFields_AdjScalarSolution(const CConfig* config) { +void CAdjFlowOutput::SetVolumeOutputFieldsAdjScalarSolution(const CConfig* config) { if (!frozen_visc) { switch (TurbModelFamily(turb_model)) { case TURB_FAMILY::SA: @@ -192,15 +255,27 @@ void CAdjFlowOutput::SetVolumeOutputFields_AdjScalarSolution(const CConfig* conf } } - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { + if (config->GetKind_Species_Model() == SPECIES_MODEL::SPECIES_TRANSPORT) { for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { AddVolumeOutput("ADJ_SPECIES_" + std::to_string(iVar), "Adjoint_Species_" + std::to_string(iVar), "SOLUTION", "Adjoint Species variable"); } } + + if (config->GetKind_Species_Model() == SPECIES_MODEL::FLAMELET) { + for (auto iCV=0u; iCV < config->GetNControlVars(); iCV++) { + const auto& cv_name = config->GetControllingVariableName(iCV); + AddVolumeOutput("ADJ_" + cv_name, "Adjoint_" + cv_name, "SOLUTION", "Adjoint of the " + cv_name + " controlling variable."); + } + + for (unsigned short i_scalar = 0; i_scalar < config->GetNUserScalars(); i_scalar++) { + const auto& scalar_name = config->GetUserScalarName(i_scalar); + AddVolumeOutput("ADJ_" + scalar_name, "Adjoint_" + scalar_name, "SOLUTION", "Adjoint of " + scalar_name); + } + } } -void CAdjFlowOutput::SetVolumeOutputFields_AdjScalarResidual(const CConfig* config) { +void CAdjFlowOutput::SetVolumeOutputFieldsAdjScalarResidual(const CConfig* config) { if (!frozen_visc) { switch (TurbModelFamily(turb_model)) { case TURB_FAMILY::SA: @@ -221,15 +296,26 @@ void CAdjFlowOutput::SetVolumeOutputFields_AdjScalarResidual(const CConfig* conf } } - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { + if (config->GetKind_Species_Model() == SPECIES_MODEL::SPECIES_TRANSPORT) { for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { AddVolumeOutput("RES_ADJ_SPECIES_" + std::to_string(iVar), "Residual_Adjoint_Species_" + std::to_string(iVar), "RESIDUAL", "Residual of the adjoint Species variable"); } } + + if (config->GetKind_Species_Model() == SPECIES_MODEL::FLAMELET) { + for(auto iCV=0u; iCV < config->GetNControlVars(); iCV++) { + const auto& cv_name = config->GetControllingVariableName(iCV); + AddVolumeOutput("RES_ADJ_" + cv_name, "Residual_Adjoint_" + cv_name, "RESIDUAL", "Residual of the adjoint of " + cv_name); + } + for (unsigned short i_scalar = 0; i_scalar < config->GetNUserScalars(); i_scalar++) { + const auto& scalar_name = config->GetUserScalarName(i_scalar); + AddVolumeOutput("RES_ADJ_" + scalar_name, "Residual_Adjoint_" + scalar_name, "RESIDUAL", "Residual of the adjoint of " + scalar_name); + } + } } -void CAdjFlowOutput::LoadVolumeData_AdjScalar(const CConfig* config, const CSolver* const* solver, +void CAdjFlowOutput::LoadVolumeDataAdjScalar(const CConfig* config, const CSolver* const* solver, const unsigned long iPoint) { const auto Node_AdjTurb = ((turb_model != TURB_MODEL::NONE) && !frozen_visc) ? solver[ADJTURB_SOL]->GetNodes() : nullptr; @@ -256,11 +342,26 @@ void CAdjFlowOutput::LoadVolumeData_AdjScalar(const CConfig* config, const CSolv } } - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { + if (config->GetKind_Species_Model() == SPECIES_MODEL::SPECIES_TRANSPORT) { for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { SetVolumeOutputValue("ADJ_SPECIES_" + std::to_string(iVar), iPoint, Node_AdjSpecies->GetSolution(iPoint, iVar)); SetVolumeOutputValue("RES_ADJ_SPECIES_" + std::to_string(iVar), iPoint, Node_AdjSpecies->GetSolution(iPoint, iVar) - Node_AdjSpecies->GetSolution_Old(iPoint, iVar)); } } + + if (config->GetKind_Species_Model() == SPECIES_MODEL::FLAMELET) { + + for (auto iCV=0u; iCV < config->GetNControlVars(); iCV++) { + const auto& cv_name = config->GetControllingVariableName(iCV); + SetVolumeOutputValue("ADJ_" + cv_name, iPoint, Node_AdjSpecies->GetSolution(iPoint, iCV)); + SetVolumeOutputValue("RES_ADJ_" + cv_name, iPoint, Node_AdjSpecies->GetSolution(iPoint, iCV) - Node_AdjSpecies->GetSolution_Old(iPoint, iCV)); + } + for (unsigned short i_scalar = 0; i_scalar < config->GetNUserScalars(); i_scalar++) { + const auto& scalar_name = config->GetUserScalarName(i_scalar); + SetVolumeOutputValue("ADJ_" + scalar_name, iPoint, Node_AdjSpecies->GetSolution(iPoint, config->GetNControlVars() + i_scalar)); + SetVolumeOutputValue("RES_ADJ_" + scalar_name, iPoint, Node_AdjSpecies->GetSolution(iPoint, config->GetNControlVars() + i_scalar) - Node_AdjSpecies->GetSolution_Old(iPoint, config->GetNControlVars() + i_scalar)); + } + } + } diff --git a/SU2_CFD/src/output/CAdjHeatOutput.cpp b/SU2_CFD/src/output/CAdjHeatOutput.cpp index a908ee6e059..2b856ef793b 100644 --- a/SU2_CFD/src/output/CAdjHeatOutput.cpp +++ b/SU2_CFD/src/output/CAdjHeatOutput.cpp @@ -2,7 +2,7 @@ * \file CAdjHeatOutput.cpp * \brief Main subroutines for flow discrete adjoint output * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -88,7 +88,7 @@ CAdjHeatOutput::CAdjHeatOutput(CConfig *config, unsigned short nDim) : COutput(c } -CAdjHeatOutput::~CAdjHeatOutput(void) {} +CAdjHeatOutput::~CAdjHeatOutput() = default; void CAdjHeatOutput::SetHistoryOutputFields(CConfig *config){ @@ -142,6 +142,7 @@ void CAdjHeatOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv SetHistoryOutputValue("DEFORM_RESIDUAL", log10(solver[MESH_SOL]->System.GetResidual())); } + ComputeSimpleCustomOutputs(config); } void CAdjHeatOutput::SetVolumeOutputFields(CConfig *config){ @@ -176,6 +177,14 @@ void CAdjHeatOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("SENSITIVITY", "Surface_Sensitivity", "SENSITIVITY", "sensitivity in normal direction"); /// END_GROUP + if (!config->GetTime_Domain()) return; + + /*--- Sensitivities with respect to initial conditions. ---*/ + + AddVolumeOutput("SENS_TEMP_N", "SensitivityTempN", "SENSITIVITY_N", "sensitivity to the previous temperature"); + if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND) { + AddVolumeOutput("SENS_TEMP_N1", "SensitivityTempN1", "SENSITIVITY_N", "sensitivity to the previous-1 temperature"); + } } void CAdjHeatOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ @@ -199,6 +208,13 @@ void CAdjHeatOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve if (nDim == 3) SetVolumeOutputValue("SENSITIVITY-Z", iPoint, Node_AdjHeat->GetSensitivity(iPoint, 2)); + if (!config->GetTime_Domain()) return; + + SetVolumeOutputValue("SENS_TEMP_N", iPoint, Node_AdjHeat->GetSolution_time_n(iPoint, 0)); + if (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND) { + SetVolumeOutputValue("SENS_TEMP_N1", iPoint, Node_AdjHeat->GetSolution_time_n1(iPoint, 0)); + } + } void CAdjHeatOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint, unsigned short iMarker, unsigned long iVertex){ diff --git a/SU2_CFD/src/output/CBaselineOutput.cpp b/SU2_CFD/src/output/CBaselineOutput.cpp index 167173fa183..b17250c29e3 100644 --- a/SU2_CFD/src/output/CBaselineOutput.cpp +++ b/SU2_CFD/src/output/CBaselineOutput.cpp @@ -2,7 +2,7 @@ * \file CBaselineOutput.cpp * \brief Main subroutines for flow discrete adjoint output * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -67,7 +67,7 @@ CBaselineOutput::CBaselineOutput(CConfig *config, unsigned short nDim, CSolver* } -CBaselineOutput::~CBaselineOutput(void) {} +CBaselineOutput::~CBaselineOutput() = default; void CBaselineOutput::SetVolumeOutputFields(CConfig *config){ diff --git a/SU2_CFD/src/output/CElasticityOutput.cpp b/SU2_CFD/src/output/CElasticityOutput.cpp index 9bdf5d5eabf..288fd8adbf8 100644 --- a/SU2_CFD/src/output/CElasticityOutput.cpp +++ b/SU2_CFD/src/output/CElasticityOutput.cpp @@ -2,7 +2,7 @@ * \file CElasticityOutput.cpp * \brief Main subroutines for FEA output * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -98,8 +98,10 @@ CElasticityOutput::CElasticityOutput(CConfig *config, unsigned short nDim) : COu /*--- Set the default convergence field --- */ - if (convFields.empty() ) convFields.emplace_back("RMS_DISP_X"); - + if (convFields.empty()) { + if (linear_analysis) convFields.emplace_back("RMS_DISP_X"); + if (nonlinear_analysis) convFields.emplace_back("RMS_UTOL"); + } } void CElasticityOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver **solver) { @@ -146,6 +148,9 @@ void CElasticityOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CS SetHistoryOutputValue("VOLUME_FRACTION", fea_solver->GetTotal_OFVolFrac()); SetHistoryOutputValue("TOPOL_DISCRETENESS", fea_solver->GetTotal_OFDiscreteness()); } + + ComputeSimpleCustomOutputs(config); + /*--- Keep this as last, since it uses the history values that were set. ---*/ SetCustomAndComboObjectives(FEA_SOL, config, solver); @@ -266,7 +271,7 @@ void CElasticityOutput::SetVolumeOutputFields(CConfig *config){ } } -bool CElasticityOutput::SetInit_Residuals(const CConfig *config){ +bool CElasticityOutput::SetInitResiduals(const CConfig *config){ return (config->GetTime_Domain() == NO && (curInnerIter == 0)); diff --git a/SU2_CFD/src/output/CFVMOutput.cpp b/SU2_CFD/src/output/CFVMOutput.cpp index 554d6ae5e85..c9c3047aefd 100644 --- a/SU2_CFD/src/output/CFVMOutput.cpp +++ b/SU2_CFD/src/output/CFVMOutput.cpp @@ -2,7 +2,7 @@ * \file CFVMOutput.cpp * \brief Main subroutines for Finite Volume Method output * \author T. Kattmann - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/output/CFlowCompFEMOutput.cpp b/SU2_CFD/src/output/CFlowCompFEMOutput.cpp index 50212107c17..d6ed5b9dc48 100644 --- a/SU2_CFD/src/output/CFlowCompFEMOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompFEMOutput.cpp @@ -2,7 +2,7 @@ * \file CFlowCompFEMOutput.cpp * \brief Main subroutines for compressible flow output * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -81,7 +81,7 @@ CFlowCompFEMOutput::CFlowCompFEMOutput(CConfig *config, unsigned short nDim) : C } -CFlowCompFEMOutput::~CFlowCompFEMOutput(void) {} +CFlowCompFEMOutput::~CFlowCompFEMOutput() = default; @@ -165,7 +165,7 @@ void CFlowCompFEMOutput::LoadVolumeDataFEM(CConfig *config, CGeometry *geometry, /*--- Create an object of the class CMeshFEM_DG and retrieve the necessary geometrical information for the FEM DG solver. ---*/ - CMeshFEM_DG *DGGeometry = dynamic_cast(geometry); + auto *DGGeometry = dynamic_cast(geometry); CVolumeElementFEM *volElem = DGGeometry->GetVolElem(); @@ -263,9 +263,10 @@ void CFlowCompFEMOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, C SetAerodynamicCoefficients(config, flow_solver); + ComputeSimpleCustomOutputs(config); } -bool CFlowCompFEMOutput::SetInit_Residuals(const CConfig *config){ +bool CFlowCompFEMOutput::SetInitResiduals(const CConfig *config){ return (config->GetTime_Marching() != TIME_MARCHING::STEADY && (curInnerIter == 0))|| (config->GetTime_Marching() == TIME_MARCHING::STEADY && (curTimeIter < 2)); diff --git a/SU2_CFD/src/output/CFlowCompOutput.cpp b/SU2_CFD/src/output/CFlowCompOutput.cpp index 953c1d9015f..8e39772f9c1 100644 --- a/SU2_CFD/src/output/CFlowCompOutput.cpp +++ b/SU2_CFD/src/output/CFlowCompOutput.cpp @@ -2,7 +2,7 @@ * \file CFlowCompOutput.cpp * \brief Main subroutines for compressible flow output * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -162,7 +162,7 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Linear solver iterations AddHistoryOutput("LINSOL_ITER", "Linear_Solver_Iterations", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver."); AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver."); - AddHistoryOutputFields_ScalarLinsol(config); + AddHistoryOutputFieldsScalarLinsol(config); AddHistoryOutput("MIN_DELTA_TIME", "Min DT", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current minimum local time step"); AddHistoryOutput("MAX_DELTA_TIME", "Max DT", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current maximum local time step"); @@ -203,9 +203,9 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){ AddRotatingFrameCoefficients(); - Add_CpInverseDesignOutput(); + AddCpInverseDesignOutput(); - Add_NearfieldInverseDesignOutput(); + AddNearfieldInverseDesignOutput(); } @@ -218,11 +218,12 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("DENSITY", "Density", "SOLUTION", "Density"); AddVolumeOutput("MOMENTUM-X", "Momentum_x", "SOLUTION", "x-component of the momentum vector"); AddVolumeOutput("MOMENTUM-Y", "Momentum_y", "SOLUTION", "y-component of the momentum vector"); + if (nDim == 3) AddVolumeOutput("MOMENTUM-Z", "Momentum_z", "SOLUTION", "z-component of the momentum vector"); AddVolumeOutput("ENERGY", "Energy", "SOLUTION", "Energy"); - SetVolumeOutputFields_ScalarSolution(config); + SetVolumeOutputFieldsScalarSolution(config); // Grid velocity if (gridMovement){ @@ -237,6 +238,18 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("TEMPERATURE", "Temperature", "PRIMITIVE", "Temperature"); AddVolumeOutput("MACH", "Mach", "PRIMITIVE", "Mach number"); AddVolumeOutput("PRESSURE_COEFF", "Pressure_Coefficient", "PRIMITIVE", "Pressure coefficient"); + AddVolumeOutput("VELOCITY-X", "Velocity_x", "PRIMITIVE", "x-component of the velocity vector"); + AddVolumeOutput("VELOCITY-Y", "Velocity_y", "PRIMITIVE", "y-component of the velocity vector"); + + if (nDim == 3) + AddVolumeOutput("VELOCITY-Z", "Velocity_z", "PRIMITIVE", "z-component of the velocity vector"); + + // Datadriven fluid model + if(config->GetKind_FluidModel() == DATADRIVEN_FLUID){ + AddVolumeOutput("EXTRAPOLATION", "Extrapolation", "PRIMITIVE", "Density, energy outside data range"); + AddVolumeOutput("FLUIDMODEL_NEWTONITER", "nIter_Newton", "PRIMITIVE", "Number of iterations evaluated by the Newton solver"); + AddVolumeOutput("ENTROPY", "Entropy", "PRIMITIVE", "Fluid entropy value"); + } if (config->GetViscous()) { AddVolumeOutput("LAMINAR_VISCOSITY", "Laminar_Viscosity", "PRIMITIVE", "Laminar viscosity"); @@ -250,6 +263,8 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("Y_PLUS", "Y_Plus", "PRIMITIVE", "Non-dim. wall distance (Y-Plus)"); } + SetVolumeOutputFieldsScalarPrimitive(config); + //Residuals AddVolumeOutput("RES_DENSITY", "Residual_Density", "RESIDUAL", "Residual of the density"); AddVolumeOutput("RES_MOMENTUM-X", "Residual_Momentum_x", "RESIDUAL", "Residual of the x-momentum component"); @@ -258,7 +273,7 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("RES_MOMENTUM-Z", "Residual_Momentum_z", "RESIDUAL", "Residual of the z-momentum component"); AddVolumeOutput("RES_ENERGY", "Residual_Energy", "RESIDUAL", "Residual of the energy"); - SetVolumeOutputFields_ScalarResidual(config); + SetVolumeOutputFieldsScalarResidual(config); if (config->GetKind_SlopeLimit_Flow() != LIMITER::NONE && config->GetKind_SlopeLimit_Flow() != LIMITER::VAN_ALBADA_EDGE) { AddVolumeOutput("LIMITER_VELOCITY-X", "Limiter_Velocity_x", "LIMITER", "Limiter value of the x-velocity"); @@ -271,7 +286,13 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("LIMITER_ENTHALPY", "Limiter_Enthalpy", "LIMITER", "Limiter value of the enthalpy"); } - SetVolumeOutputFields_ScalarLimiter(config); + SetVolumeOutputFieldsScalarLimiter(config); + + SetVolumeOutputFieldsScalarSource(config); + + SetVolumeOutputFieldsScalarLookup(config); + + SetVolumeOutputFieldsScalarMisc(config); // Roe Low Dissipation if (config->GetKind_RoeLowDiss() != NO_ROELOWDISS) { @@ -280,7 +301,7 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){ AddCommonFVMOutputs(config); - if (config->GetTime_Domain()){ + if (config->GetTime_Domain()) { SetTimeAveragedFields(); } } @@ -315,6 +336,17 @@ void CFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv const su2double factor = solver[FLOW_SOL]->GetReferenceDynamicPressure(); SetVolumeOutputValue("PRESSURE_COEFF", iPoint, (Node_Flow->GetPressure(iPoint) - solver[FLOW_SOL]->GetPressure_Inf())/factor); + SetVolumeOutputValue("VELOCITY-X", iPoint, Node_Flow->GetVelocity(iPoint, 0)); + SetVolumeOutputValue("VELOCITY-Y", iPoint, Node_Flow->GetVelocity(iPoint, 1)); + if (nDim == 3){ + SetVolumeOutputValue("VELOCITY-Z", iPoint, Node_Flow->GetVelocity(iPoint, 2)); + } + + if(config->GetKind_FluidModel() == DATADRIVEN_FLUID){ + SetVolumeOutputValue("EXTRAPOLATION", iPoint, Node_Flow->GetDataExtrapolation(iPoint)); + SetVolumeOutputValue("FLUIDMODEL_NEWTONITER", iPoint, Node_Flow->GetNewtonSolverIterations(iPoint)); + SetVolumeOutputValue("ENTROPY", iPoint, Node_Flow->GetEntropy(iPoint)); + } if (config->GetKind_Solver() == MAIN_SOLVER::RANS || config->GetKind_Solver() == MAIN_SOLVER::NAVIER_STOKES){ SetVolumeOutputValue("LAMINAR_VISCOSITY", iPoint, Node_Flow->GetLaminarViscosity(iPoint)); @@ -345,11 +377,11 @@ void CFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv SetVolumeOutputValue("ROE_DISSIPATION", iPoint, Node_Flow->GetRoe_Dissipation(iPoint)); } - LoadVolumeData_Scalar(config, solver, geometry, iPoint); + LoadVolumeDataScalar(config, solver, geometry, iPoint); LoadCommonFVMOutputs(config, geometry, iPoint); - if (config->GetTime_Domain()){ + if (config->GetTime_Domain()) { LoadTimeAveragedData(iPoint, Node_Flow); } } @@ -413,7 +445,7 @@ void CFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol SetHistoryOutputValue("CL_DRIVER_COMMAND", flow_solver->GetAoA_inc()); } - LoadHistoryData_Scalar(config, solver); + LoadHistoryDataScalar(config, solver); /*--- Set the analyse surface history values --- */ @@ -435,11 +467,11 @@ void CFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol /*--- Set Cp diff fields ---*/ - Set_CpInverseDesign(flow_solver, geometry, config); + SetCpInverseDesign(flow_solver, geometry, config); /*--- Set nearfield diff fields ---*/ - if (config->GetEquivArea()) Set_NearfieldInverseDesign(flow_solver, geometry, config); + if (config->GetEquivArea()) SetNearfieldInverseDesign(flow_solver, geometry, config); /*--- Keep this as last, since it uses the history values that were set. ---*/ @@ -449,7 +481,7 @@ void CFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol } -bool CFlowCompOutput::SetInit_Residuals(const CConfig *config){ +bool CFlowCompOutput::SetInitResiduals(const CConfig *config){ return (config->GetTime_Marching() != TIME_MARCHING::STEADY && (curInnerIter == 0))|| (config->GetTime_Marching() == TIME_MARCHING::STEADY && (curInnerIter < 2)); @@ -463,6 +495,6 @@ void CFlowCompOutput::SetAdditionalScreenOutput(const CConfig *config){ } } -bool CFlowCompOutput::WriteHistoryFile_Output(const CConfig *config) { - return !config->GetFinite_Difference_Mode() && COutput::WriteHistoryFile_Output(config); +bool CFlowCompOutput::WriteHistoryFileOutput(const CConfig *config) { + return !config->GetFinite_Difference_Mode() && COutput::WriteHistoryFileOutput(config); } diff --git a/SU2_CFD/src/output/CFlowIncOutput.cpp b/SU2_CFD/src/output/CFlowIncOutput.cpp index ec2b2e108d2..f729dfed82e 100644 --- a/SU2_CFD/src/output/CFlowIncOutput.cpp +++ b/SU2_CFD/src/output/CFlowIncOutput.cpp @@ -2,7 +2,7 @@ * \file CFlowIncOutput.cpp * \brief Main subroutines for incompressible flow output * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -38,6 +38,7 @@ CFlowIncOutput::CFlowIncOutput(CConfig *config, unsigned short nDim) : CFlowOutp heat = config->GetEnergy_Equation(); weakly_coupled_heat = config->GetWeakly_Coupled_Heat(); + flamelet = (config->GetKind_Species_Model() == SPECIES_MODEL::FLAMELET); streamwisePeriodic = (config->GetKind_Streamwise_Periodic() != ENUM_STREAMWISE_PERIODIC::NONE); streamwisePeriodic_temperature = config->GetStreamwise_Periodic_Temperature(); @@ -158,7 +159,7 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Linear solver iterations AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver."); AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver."); - AddHistoryOutputFields_ScalarLinsol(config); + AddHistoryOutputFieldsScalarLinsol(config); AddHistoryOutput("MIN_DELTA_TIME", "Min DT", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current minimum local time step"); AddHistoryOutput("MAX_DELTA_TIME", "Max DT", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current maximum local time step"); @@ -256,7 +257,7 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv SetHistoryOutputValue("MAX_CFL", flow_solver->GetMax_CFL_Local()); SetHistoryOutputValue("AVG_CFL", flow_solver->GetAvg_CFL_Local()); - LoadHistoryData_Scalar(config, solver); + LoadHistoryDataScalar(config, solver); if(streamwisePeriodic) { SetHistoryOutputValue("STREAMWISE_MASSFLOW", flow_solver->GetStreamwisePeriodicValues().Streamwise_Periodic_MassFlow); @@ -295,10 +296,10 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("VELOCITY-Y", "Velocity_y", "SOLUTION", "y-component of the velocity vector"); if (nDim == 3) AddVolumeOutput("VELOCITY-Z", "Velocity_z", "SOLUTION", "z-component of the velocity vector"); - if (heat || weakly_coupled_heat) + if (heat || weakly_coupled_heat || flamelet) AddVolumeOutput("TEMPERATURE", "Temperature","SOLUTION", "Temperature"); - SetVolumeOutputFields_ScalarSolution(config); + SetVolumeOutputFieldsScalarSolution(config); // Radiation variables if (config->AddRadiation()) @@ -318,6 +319,8 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ if (config->GetKind_Solver() == MAIN_SOLVER::INC_RANS || config->GetKind_Solver() == MAIN_SOLVER::INC_NAVIER_STOKES){ AddVolumeOutput("LAMINAR_VISCOSITY", "Laminar_Viscosity", "PRIMITIVE", "Laminar viscosity"); + AddVolumeOutput("HEAT_CAPACITY", "Heat_Capacity", "PRIMITIVE", "Heat capacity"); + AddVolumeOutput("THERMAL_CONDUCTIVITY", "Thermal_Conductivity", "PRIMITIVE", "Thermal conductivity"); AddVolumeOutput("SKIN_FRICTION-X", "Skin_Friction_Coefficient_x", "PRIMITIVE", "x-component of the skin friction vector"); AddVolumeOutput("SKIN_FRICTION-Y", "Skin_Friction_Coefficient_y", "PRIMITIVE", "y-component of the skin friction vector"); @@ -329,6 +332,8 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ } + SetVolumeOutputFieldsScalarPrimitive(config); + if (config->GetSAParsedOptions().bc) { AddVolumeOutput("INTERMITTENCY", "gamma_BC", "INTERMITTENCY", "Intermittency"); } @@ -342,7 +347,7 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ if (config->GetEnergy_Equation()) AddVolumeOutput("RES_TEMPERATURE", "Residual_Temperature", "RESIDUAL", "Residual of the temperature"); - SetVolumeOutputFields_ScalarResidual(config); + SetVolumeOutputFieldsScalarResidual(config); if (config->GetKind_SlopeLimit_Flow() != LIMITER::NONE && config->GetKind_SlopeLimit_Flow() != LIMITER::VAN_ALBADA_EDGE) { AddVolumeOutput("LIMITER_PRESSURE", "Limiter_Pressure", "LIMITER", "Limiter value of the pressure"); @@ -350,11 +355,17 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("LIMITER_VELOCITY-Y", "Limiter_Velocity_y", "LIMITER", "Limiter value of the y-velocity"); if (nDim == 3) AddVolumeOutput("LIMITER_VELOCITY-Z", "Limiter_Velocity_z", "LIMITER", "Limiter value of the z-velocity"); - if (heat || weakly_coupled_heat) + if (heat || weakly_coupled_heat || flamelet) AddVolumeOutput("LIMITER_TEMPERATURE", "Limiter_Temperature", "LIMITER", "Limiter value of the temperature"); } - SetVolumeOutputFields_ScalarLimiter(config); + SetVolumeOutputFieldsScalarLimiter(config); + + SetVolumeOutputFieldsScalarSource(config); + + SetVolumeOutputFieldsScalarLookup(config); + + SetVolumeOutputFieldsScalarMisc(config); // Streamwise Periodicity if(streamwisePeriodic) { @@ -364,6 +375,10 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){ } AddCommonFVMOutputs(config); + + if (config->GetTime_Domain()) { + SetTimeAveragedFields(); + } } void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){ @@ -385,7 +400,7 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve if (nDim == 3) SetVolumeOutputValue("VELOCITY-Z", iPoint, Node_Flow->GetSolution(iPoint, 3)); - if (heat) SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Flow->GetSolution(iPoint, nDim+1)); + if (heat || flamelet) SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Flow->GetSolution(iPoint, nDim+1)); if (weakly_coupled_heat) SetVolumeOutputValue("TEMPERATURE", iPoint, Node_Heat->GetSolution(iPoint, 0)); // Radiation solver @@ -407,6 +422,8 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve if (config->GetKind_Solver() == MAIN_SOLVER::INC_RANS || config->GetKind_Solver() == MAIN_SOLVER::INC_NAVIER_STOKES){ SetVolumeOutputValue("LAMINAR_VISCOSITY", iPoint, Node_Flow->GetLaminarViscosity(iPoint)); + SetVolumeOutputValue("HEAT_CAPACITY", iPoint, Node_Flow->GetSpecificHeatCp(iPoint)); + SetVolumeOutputValue("THERMAL_CONDUCTIVITY", iPoint, Node_Flow->GetThermalConductivity(iPoint)); } SetVolumeOutputValue("RES_PRESSURE", iPoint, solver[FLOW_SOL]->LinSysRes(iPoint, 0)); @@ -428,19 +445,23 @@ void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolve } // All turbulence and species outputs. - LoadVolumeData_Scalar(config, solver, geometry, iPoint); + LoadVolumeDataScalar(config, solver, geometry, iPoint); // Streamwise Periodicity - if(streamwisePeriodic) { + if (streamwisePeriodic) { SetVolumeOutputValue("RECOVERED_PRESSURE", iPoint, Node_Flow->GetStreamwise_Periodic_RecoveredPressure(iPoint)); if (heat && streamwisePeriodic_temperature) SetVolumeOutputValue("RECOVERED_TEMPERATURE", iPoint, Node_Flow->GetStreamwise_Periodic_RecoveredTemperature(iPoint)); } LoadCommonFVMOutputs(config, geometry, iPoint); + + if (config->GetTime_Domain()) { + LoadTimeAveragedData(iPoint, Node_Flow); + } } -bool CFlowIncOutput::SetInit_Residuals(const CConfig *config){ +bool CFlowIncOutput::SetInitResiduals(const CConfig *config){ return (config->GetTime_Marching() != TIME_MARCHING::STEADY && (curInnerIter == 0))|| (config->GetTime_Marching() == TIME_MARCHING::STEADY && (curInnerIter < 2)); diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index d24bedd03bf..75bd80feebb 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -2,7 +2,7 @@ * \file CFlowOutput.cpp * \brief Common functions for flow output. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -27,15 +27,15 @@ #include #include +#include +#include #include "../../include/output/CFlowOutput.hpp" #include "../../../Common/include/geometry/CGeometry.hpp" #include "../../../Common/include/toolboxes/geometry_toolbox.hpp" #include "../../include/solvers/CSolver.hpp" -#include "../../include/variables/CEulerVariable.hpp" -#include "../../include/variables/CIncEulerVariable.hpp" -#include "../../include/variables/CNEMOEulerVariable.hpp" +#include "../../include/variables/CPrimitiveIndices.hpp" #include "../../include/fluid/CCoolProp.hpp" CFlowOutput::CFlowOutput(const CConfig *config, unsigned short nDim, bool fem_output) : @@ -79,7 +79,7 @@ void CFlowOutput::AddAnalyzeSurfaceOutput(const CConfig *config){ } else if (rank == MASTER_NODE) { cout << "\nWARNING: SURFACE_PRESSURE_DROP can only be computed for at least 2 surfaces (outlet, inlet, ...)\n" << endl; } - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { + if (config->GetKind_Species_Model() == SPECIES_MODEL::SPECIES_TRANSPORT) { /// DESCRIPTION: Average Species for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { AddHistoryOutput("SURFACE_SPECIES_" + std::to_string(iVar), "Avg_Species_" + std::to_string(iVar), ScreenOutputFormat::FIXED, "SPECIES_COEFF", "Total average species " + std::to_string(iVar) + " on all markers set in MARKER_ANALYZE", HistoryFieldType::COEFFICIENT); @@ -121,7 +121,7 @@ void CFlowOutput::AddAnalyzeSurfaceOutput(const CConfig *config){ AddHistoryOutputPerSurface("SURFACE_TOTAL_TEMPERATURE","Avg_TotalTemp", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT); /// DESCRIPTION: Average total pressure AddHistoryOutputPerSurface("SURFACE_TOTAL_PRESSURE", "Avg_TotalPress", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT); - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { + if (config->GetKind_Species_Model() == SPECIES_MODEL::SPECIES_TRANSPORT) { /// DESCRIPTION: Average Species for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { AddHistoryOutputPerSurface("SURFACE_SPECIES_" + std::to_string(iVar), "Avg_Species_" + std::to_string(iVar), ScreenOutputFormat::FIXED, "SPECIES_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT); @@ -129,7 +129,6 @@ void CFlowOutput::AddAnalyzeSurfaceOutput(const CConfig *config){ /// DESCRIPTION: Species Variance AddHistoryOutputPerSurface("SURFACE_SPECIES_VARIANCE", "Species_Variance", ScreenOutputFormat::SCIENTIFIC, "SPECIES_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT); } - /// END_GROUP } // clang-format on @@ -151,7 +150,7 @@ void CFlowOutput::SetAnalyzeSurface(const CSolver* const*solver, const CGeometry const bool incompressible = config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE; const bool energy = config->GetEnergy_Equation(); const bool streamwisePeriodic = (config->GetKind_Streamwise_Periodic() != ENUM_STREAMWISE_PERIODIC::NONE); - const bool species = config->GetKind_Species_Model() != SPECIES_MODEL::NONE; + const bool species = config->GetKind_Species_Model() == SPECIES_MODEL::SPECIES_TRANSPORT; const auto nSpecies = config->GetnSpecies(); const bool axisymmetric = config->GetAxisymmetric(); @@ -233,7 +232,7 @@ void CFlowOutput::SetAnalyzeSurface(const CSolver* const*solver, const CGeometry } if (incompressible){ - if (config->GetKind_DensityModel() == INC_DENSITYMODEL::VARIABLE) { + if (config->GetVariable_Density_Model()) { Mach = sqrt(flow_nodes->GetVelocity2(iPoint))/ sqrt(flow_nodes->GetSpecificHeatCp(iPoint)*config->GetPressure_ThermodynamicND()/(flow_nodes->GetSpecificHeatCv(iPoint)*flow_nodes->GetDensity(iPoint))); } else { @@ -380,7 +379,6 @@ void CFlowOutput::SetAnalyzeSurface(const CSolver* const*solver, const CGeometry Allreduce(Surface_MassFlow_Abs_Local, Surface_MassFlow_Abs_Total); Allreduce_su2activematrix(Surface_Species_Local, Surface_Species_Total); - /*--- Compute the value of Surface_Area_Total, and Surface_Pressure_Total, and set the value in the config structure for future use ---*/ @@ -545,7 +543,7 @@ void CFlowOutput::SetAnalyzeSurface(const CSolver* const*solver, const CGeometry for (unsigned short iVar = 0; iVar < nSpecies; iVar++) SetHistoryOutputValue("SURFACE_SPECIES_" + std::to_string(iVar), Tot_Surface_Species[iVar]); - SetAnalyzeSurface_SpeciesVariance(solver, geometry, config, Surface_Species_Total, Surface_MassFlow_Abs_Total, + SetAnalyzeSurfaceSpeciesVariance(solver, geometry, config, Surface_Species_Total, Surface_MassFlow_Abs_Total, Surface_Area_Total); } @@ -633,7 +631,7 @@ void CFlowOutput::SetAnalyzeSurface(const CSolver* const*solver, const CGeometry std::cout << std::resetiosflags(std::cout.flags()); } -void CFlowOutput::SetAnalyzeSurface_SpeciesVariance(const CSolver* const*solver, const CGeometry *geometry, +void CFlowOutput::SetAnalyzeSurfaceSpeciesVariance(const CSolver* const*solver, const CGeometry *geometry, CConfig *config, const su2activematrix& Surface_Species_Total, const vector& Surface_MassFlow_Abs_Total, const vector& Surface_Area_Total) { @@ -641,7 +639,7 @@ void CFlowOutput::SetAnalyzeSurface_SpeciesVariance(const CSolver* const*solver, const unsigned short nMarker = config->GetnMarker_All(); const unsigned short Kind_Average = config->GetKind_Average(); - const bool species = config->GetKind_Species_Model() != SPECIES_MODEL::NONE; + const bool species = config->GetKind_Species_Model() == SPECIES_MODEL::SPECIES_TRANSPORT; const auto nSpecies = config->GetnSpecies(); const bool axisymmetric = config->GetAxisymmetric(); @@ -741,31 +739,97 @@ void CFlowOutput::SetAnalyzeSurface_SpeciesVariance(const CSolver* const*solver, for (unsigned short iMarker_Analyze = 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) { su2double SpeciesVariance = Surface_SpeciesVariance_Total[iMarker_Analyze]; SetHistoryOutputPerSurfaceValue("SURFACE_SPECIES_VARIANCE", SpeciesVariance, iMarker_Analyze); + config->SetSurface_Species_Variance(iMarker_Analyze, SpeciesVariance); Tot_Surface_SpeciesVariance += SpeciesVariance; - config->SetSurface_Species_Variance(iMarker_Analyze, Tot_Surface_SpeciesVariance); } SetHistoryOutputValue("SURFACE_SPECIES_VARIANCE", Tot_Surface_SpeciesVariance); } +void CFlowOutput::ConvertVariableSymbolsToIndices(const CPrimitiveIndices& idx, const bool allowSkip, + CustomOutput& output) const { + const auto nameToIndex = PrimitiveNameToIndexMap(idx); + + std::stringstream knownVariables; + for (const auto& items : nameToIndex) { + knownVariables << items.first + '\n'; + } + knownVariables << "TURB[0,1,...]\nRAD[0,1,...]\nSPECIES[0,1,...]\nSCALAR[0,1,...]\n"; + + auto IndexOfVariable = [](const map& nameToIndex, const std::string& var) { + /*--- Primitives of the flow solver. ---*/ + const auto flowOffset = FLOW_SOL * CustomOutput::MAX_VARS_PER_SOLVER; + const auto it = nameToIndex.find(var); + if (it != nameToIndex.end()) return flowOffset + it->second; + + /*--- Index-based (no name) access to variables of other solvers. ---*/ + auto GetIndex = [](const std::string& s, int nameLen) { + /*--- Extract an int from "name[int]", nameLen is the length of "name". ---*/ + return std::stoi(std::string(s.begin() + nameLen + 1, s.end() - 1)); + }; + + if (var.rfind("SPECIES", 0) == 0) return SPECIES_SOL * CustomOutput::MAX_VARS_PER_SOLVER + GetIndex(var, 7); + if (var.rfind("SCALAR", 0) == 0) return SPECIES_SOL * CustomOutput::MAX_VARS_PER_SOLVER + GetIndex(var, 6); + if (var.rfind("TURB", 0) == 0) return TURB_SOL * CustomOutput::MAX_VARS_PER_SOLVER + GetIndex(var, 4); + if (var.rfind("RAD", 0) == 0) return RAD_SOL * CustomOutput::MAX_VARS_PER_SOLVER + GetIndex(var, 3); + return CustomOutput::NOT_A_VARIABLE; + }; + + output.otherOutputs.clear(); + output.varIndices.clear(); + output.varIndices.reserve(output.varSymbols.size()); + + for (const auto& var : output.varSymbols) { + output.varIndices.push_back(IndexOfVariable(nameToIndex, var)); + + if (output.type == OperationType::FUNCTION && output.varIndices.back() != CustomOutput::NOT_A_VARIABLE) { + SU2_MPI::Error("Custom outputs of type 'Function' cannot reference solver variables.", CURRENT_FUNCTION); + } + /*--- Symbol is a valid solver variable. ---*/ + if (output.varIndices.back() < CustomOutput::NOT_A_VARIABLE) continue; + + /*--- An index above NOT_A_VARIABLE is not valid with current solver settings. ---*/ + if (output.varIndices.back() > CustomOutput::NOT_A_VARIABLE) { + SU2_MPI::Error("Inactive solver variable (" + var + ") used in function " + output.name + "\n" + "E.g. this may only be a variable of the compressible solver.", CURRENT_FUNCTION); + } + + /*--- An index equal to NOT_A_VARIABLE may refer to a history output. ---*/ + output.varIndices.back() += output.otherOutputs.size(); + output.otherOutputs.push_back(GetPtrToHistoryOutput(var)); + if (output.otherOutputs.back() == nullptr) { + if (!allowSkip) { + SU2_MPI::Error("Invalid history output or solver variable (" + var + ") used in function " + output.name + + "\nValid solvers variables:\n" + knownVariables.str(), CURRENT_FUNCTION); + } else { + if (rank == MASTER_NODE) { + std::cout << "Info: Ignoring function " + output.name + " because it may be used by the primal/adjoint " + "solver.\n If the function is ignored twice it is invalid." << std::endl; + } + output.skip = true; + break; + } + } + } +} + void CFlowOutput::SetCustomOutputs(const CSolver* const* solver, const CGeometry *geometry, const CConfig *config) { + const bool adjoint = config->GetDiscrete_Adjoint(); const bool axisymmetric = config->GetAxisymmetric(); const auto* flowNodes = su2staticcast_p(solver[FLOW_SOL]->GetNodes()); for (auto& output : customOutputs) { + if (output.skip) continue; + if (output.varIndices.empty()) { + const bool allowSkip = adjoint && (output.type == OperationType::FUNCTION); + /*--- Setup indices for the symbols in the expression. ---*/ + const auto primIdx = CPrimitiveIndices(config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE, + config->GetNEMOProblem(), nDim, config->GetnSpecies()); + ConvertVariableSymbolsToIndices(primIdx, allowSkip, output); + if (output.skip) continue; - if (config->GetNEMOProblem()) { - ConvertVariableSymbolsToIndices( - CNEMOEulerVariable::template CIndices(nDim, config->GetnSpecies()), output); - } else if (config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) { - ConvertVariableSymbolsToIndices(CEulerVariable::template CIndices(nDim, 0), output); - } else if (config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE) { - ConvertVariableSymbolsToIndices(CIncEulerVariable::template CIndices(nDim, 0), output); - } else { - SU2_MPI::Error("Unknown flow solver type.", CURRENT_FUNCTION); - } /*--- Convert marker names to their index (if any) in this rank. Or probe locations to nearest points. ---*/ if (output.type != OperationType::PROBE) { @@ -810,7 +874,7 @@ void CFlowOutput::SetCustomOutputs(const CSolver* const* solver, const CGeometry /*--- Functions only reference other history outputs. ---*/ return *output.otherOutputs[i - CustomOutput::NOT_A_VARIABLE]; }; - SetHistoryOutputValue(output.name, output.eval(Functor)); + SetHistoryOutputValue(output.name, output.Eval(Functor)); continue; } @@ -825,9 +889,8 @@ void CFlowOutput::SetCustomOutputs(const CSolver* const* solver, const CGeometry const auto varIdx = i % CustomOutput::MAX_VARS_PER_SOLVER; if (solIdx == FLOW_SOL) { return flowNodes->GetPrimitive(iPoint, varIdx); - } else { - return solver[solIdx]->GetNodes()->GetSolution(iPoint, varIdx); } + return solver[solIdx]->GetNodes()->GetSolution(iPoint, varIdx); } else { return *output.otherOutputs[i - CustomOutput::NOT_A_VARIABLE]; } @@ -837,7 +900,7 @@ void CFlowOutput::SetCustomOutputs(const CSolver* const* solver, const CGeometry if (output.type == OperationType::PROBE) { su2double value = std::numeric_limits::max(); if (output.iPoint != CustomOutput::PROBE_NOT_OWNED) { - value = output.eval(MakeFunctor(output.iPoint)); + value = output.Eval(MakeFunctor(output.iPoint)); } su2double tmp = value; SU2_MPI::Allreduce(&tmp, &value, 1, MPI_DOUBLE, MPI_MIN, SU2_MPI::GetComm()); @@ -870,7 +933,7 @@ void CFlowOutput::SetCustomOutputs(const CSolver* const* solver, const CGeometry } weight *= GetAxiFactor(axisymmetric, *geometry->nodes, iPoint, iMarker); local_integral[1] += weight; - local_integral[0] += weight * output.eval(MakeFunctor(iPoint)); + local_integral[0] += weight * output.Eval(MakeFunctor(iPoint)); } END_SU2_OMP_FOR } @@ -895,6 +958,7 @@ void CFlowOutput::SetCustomOutputs(const CSolver* const* solver, const CGeometry // The "AddHistoryOutput(" must not be split over multiple lines to ensure proper python parsing // clang-format off void CFlowOutput::AddHistoryOutputFields_ScalarRMS_RES(const CConfig* config) { + switch (TurbModelFamily(config->GetKind_Turb_Model())) { case TURB_FAMILY::SA: /// DESCRIPTION: Root-mean square residual of nu tilde (SA model). @@ -922,14 +986,33 @@ void CFlowOutput::AddHistoryOutputFields_ScalarRMS_RES(const CConfig* config) { case TURB_TRANS_MODEL::NONE: break; } - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { - for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { - AddHistoryOutput("RMS_SPECIES_" + std::to_string(iVar), "rms[rho*Y_" + std::to_string(iVar)+"]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of transported species.", HistoryFieldType::RESIDUAL); + switch (config->GetKind_Species_Model()) { + case SPECIES_MODEL::SPECIES_TRANSPORT: { + for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { + AddHistoryOutput("RMS_SPECIES_" + std::to_string(iVar), "rms[rho*Y_" + std::to_string(iVar)+"]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of transported species.", HistoryFieldType::RESIDUAL); + } + break; } + case SPECIES_MODEL::FLAMELET: { + /*--- Controlling variable transport. ---*/ + for (auto iCV = 0u; iCV < config->GetNControlVars(); iCV++){ + const auto& CV_name = config->GetControllingVariableName(iCV); + AddHistoryOutput("RMS_"+CV_name, "rms["+CV_name+"]",ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean squared residual of " + CV_name + " controlling variable equation.", HistoryFieldType::RESIDUAL); + } + + /*--- auxiliary species transport ---*/ + for (auto i_scalar = 0u; i_scalar < config->GetNUserScalars(); i_scalar++){ + const auto& scalar_name = config->GetUserScalarName(i_scalar); + AddHistoryOutput("RMS_"+scalar_name, "rms["+scalar_name+"]", ScreenOutputFormat::FIXED , "RMS_RES", "Root-mean squared residual of the "+scalar_name+" mass fraction equation." , HistoryFieldType::RESIDUAL); + } + break; + } + case SPECIES_MODEL::NONE: break; } } void CFlowOutput::AddHistoryOutputFields_ScalarMAX_RES(const CConfig* config) { + switch (TurbModelFamily(config->GetKind_Turb_Model())) { case TURB_FAMILY::SA: /// DESCRIPTION: Maximum residual of nu tilde (SA model). @@ -960,10 +1043,28 @@ void CFlowOutput::AddHistoryOutputFields_ScalarMAX_RES(const CConfig* config) { break; } - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { - for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { - AddHistoryOutput("MAX_SPECIES_" + std::to_string(iVar), "max[rho*Y_" + std::to_string(iVar)+"]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of transported species.", HistoryFieldType::RESIDUAL); + switch (config->GetKind_Species_Model()) { + case SPECIES_MODEL::SPECIES_TRANSPORT: { + for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { + AddHistoryOutput("MAX_SPECIES_" + std::to_string(iVar), "max[rho*Y_" + std::to_string(iVar)+"]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of transported species.", HistoryFieldType::RESIDUAL); + } + break; + } + case SPECIES_MODEL::FLAMELET: { + /*--- Controlling variable transport. ---*/ + for (auto iCV=0u; iCV < config->GetNControlVars(); iCV++){ + const auto& cv_name = config->GetControllingVariableName(iCV); + AddHistoryOutput("MAX_" + cv_name, "max[" + cv_name + "]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the " + cv_name + " equation.", HistoryFieldType::RESIDUAL); + } + + /*--- auxiliary species transport ---*/ + for (auto i_scalar = 0u; i_scalar < config->GetNUserScalars(); i_scalar++){ + const auto& scalar_name = config->GetUserScalarName(i_scalar); + AddHistoryOutput("MAX_" + scalar_name, "max[" + scalar_name + "]", ScreenOutputFormat::FIXED , "MAX_RES", "Maximum residual of the " + scalar_name + " mass fraction equation." , HistoryFieldType::RESIDUAL); + } + break; } + case SPECIES_MODEL::NONE: break; } } @@ -997,14 +1098,32 @@ void CFlowOutput::AddHistoryOutputFields_ScalarBGS_RES(const CConfig* config) { case TURB_TRANS_MODEL::NONE: break; } - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { - for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { - AddHistoryOutput("BGS_SPECIES_" + std::to_string(iVar), "bgs[rho*Y_" + std::to_string(iVar)+"]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of transported species.", HistoryFieldType::RESIDUAL); + switch (config->GetKind_Species_Model()) { + case SPECIES_MODEL::SPECIES_TRANSPORT: { + for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { + AddHistoryOutput("BGS_SPECIES_" + std::to_string(iVar), "bgs[rho*Y_" + std::to_string(iVar)+"]", ScreenOutputFormat::FIXED, "BGS_RES", "Maximum residual of transported species.", HistoryFieldType::RESIDUAL); + } + break; } + case SPECIES_MODEL::FLAMELET: { + /*--- Controlling variable transport. ---*/ + for (auto iCV=0u; iCV < config->GetNControlVars(); iCV++){ + const auto& cv_name = config->GetControllingVariableName(iCV); + AddHistoryOutput("BGS_" + cv_name, "bgs[" + cv_name + "]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the " + cv_name + " controlling variable equation.", HistoryFieldType::RESIDUAL); + } + + /*--- auxiliary species transport ---*/ + for (auto i_scalar = 0u; i_scalar < config->GetNUserScalars(); i_scalar++){ + const auto& scalar_name = config->GetUserScalarName(i_scalar); + AddHistoryOutput("BGS_"+scalar_name, "bgs["+scalar_name+"]", ScreenOutputFormat::FIXED , "BGS_RES", "BGS residual of the "+scalar_name+" mass fraction equation." , HistoryFieldType::RESIDUAL); + } + break; + } + case SPECIES_MODEL::NONE: break; } } -void CFlowOutput::AddHistoryOutputFields_ScalarLinsol(const CConfig* config) { +void CFlowOutput::AddHistoryOutputFieldsScalarLinsol(const CConfig* config) { if (config->GetKind_Turb_Model() != TURB_MODEL::NONE) { AddHistoryOutput("LINSOL_ITER_TURB", "LinSolIterTurb", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver for turbulence solver."); AddHistoryOutput("LINSOL_RESIDUAL_TURB", "LinSolResTurb", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver for turbulence solver."); @@ -1015,14 +1134,24 @@ void CFlowOutput::AddHistoryOutputFields_ScalarLinsol(const CConfig* config) { AddHistoryOutput("LINSOL_RESIDUAL_TRANS", "LinSolResTrans", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver for transition solver."); } - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { - AddHistoryOutput("LINSOL_ITER_SPECIES", "LinSolIterSpecies", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver for species solver."); - AddHistoryOutput("LINSOL_RESIDUAL_SPECIES", "LinSolResSpecies", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver for species solver."); + switch (config->GetKind_Species_Model()) { + case SPECIES_MODEL::SPECIES_TRANSPORT: { + AddHistoryOutput("LINSOL_ITER_SPECIES", "LinSolIterSpecies", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver for species solver."); + AddHistoryOutput("LINSOL_RESIDUAL_SPECIES", "LinSolResSpecies", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver for species solver."); + break; + } + case SPECIES_MODEL::FLAMELET: { + AddHistoryOutput("LINSOL_ITER_FLAMELET", "LinSolIterSpecies", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver for flamelet solver."); + AddHistoryOutput("LINSOL_RESIDUAL_FLAMELET", "LinSolResSpecies", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver for flamelet solver."); + break; + } + case SPECIES_MODEL::NONE: break; } } // clang-format on -void CFlowOutput::LoadHistoryData_Scalar(const CConfig* config, const CSolver* const* solver) { +void CFlowOutput::LoadHistoryDataScalar(const CConfig* config, const CSolver* const* solver) { + switch (TurbModelFamily(config->GetKind_Turb_Model())) { case TURB_FAMILY::SA: SetHistoryOutputValue("RMS_NU_TILDE", log10(solver[TURB_SOL]->GetRes_RMS(0))); @@ -1068,21 +1197,49 @@ void CFlowOutput::LoadHistoryData_Scalar(const CConfig* config, const CSolver* c case TURB_TRANS_MODEL::NONE: break; } - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { - for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { - SetHistoryOutputValue("RMS_SPECIES_" + std::to_string(iVar), log10(solver[SPECIES_SOL]->GetRes_RMS(iVar))); - SetHistoryOutputValue("MAX_SPECIES_" + std::to_string(iVar), log10(solver[SPECIES_SOL]->GetRes_Max(iVar))); - if (multiZone) { - SetHistoryOutputValue("BGS_SPECIES_" + std::to_string(iVar), log10(solver[SPECIES_SOL]->GetRes_BGS(iVar))); + switch(config->GetKind_Species_Model()) { + case SPECIES_MODEL::SPECIES_TRANSPORT: { + for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { + SetHistoryOutputValue("RMS_SPECIES_" + std::to_string(iVar), log10(solver[SPECIES_SOL]->GetRes_RMS(iVar))); + SetHistoryOutputValue("MAX_SPECIES_" + std::to_string(iVar), log10(solver[SPECIES_SOL]->GetRes_Max(iVar))); + if (multiZone) { + SetHistoryOutputValue("BGS_SPECIES_" + std::to_string(iVar), log10(solver[SPECIES_SOL]->GetRes_BGS(iVar))); + } } + SetHistoryOutputValue("LINSOL_ITER_SPECIES", solver[SPECIES_SOL]->GetIterLinSolver()); + SetHistoryOutputValue("LINSOL_RESIDUAL_SPECIES", log10(solver[SPECIES_SOL]->GetResLinSolver())); + break; } - SetHistoryOutputValue("LINSOL_ITER_SPECIES", solver[SPECIES_SOL]->GetIterLinSolver()); - SetHistoryOutputValue("LINSOL_RESIDUAL_SPECIES", log10(solver[SPECIES_SOL]->GetResLinSolver())); + case SPECIES_MODEL::FLAMELET: { + /*--- Controlling variable transport. ---*/ + for (auto iCV=0u; iCV < config->GetNControlVars(); iCV++){ + const auto& cv_name = config->GetControllingVariableName(iCV); + SetHistoryOutputValue("RMS_" + cv_name, log10(solver[SPECIES_SOL]->GetRes_RMS(iCV))); + SetHistoryOutputValue("MAX_" + cv_name, log10(solver[SPECIES_SOL]->GetRes_Max(iCV))); + } + /*--- auxiliary species transport ---*/ + for (unsigned short iReactant=0; iReactantGetNUserScalars(); iReactant++){ + const auto& species_name = config->GetUserScalarName(iReactant); + SetHistoryOutputValue("RMS_" + species_name, log10(solver[SPECIES_SOL]->GetRes_RMS(config->GetNControlVars() + iReactant))); + SetHistoryOutputValue("MAX_" + species_name, log10(solver[SPECIES_SOL]->GetRes_Max(config->GetNControlVars() + iReactant))); + if (multiZone) { + SetHistoryOutputValue("BGS_" + species_name, log10(solver[SPECIES_SOL]->GetRes_BGS(config->GetNControlVars() + iReactant))); + } + } + + SetHistoryOutputValue("LINSOL_ITER_FLAMELET", solver[SPECIES_SOL]->GetIterLinSolver()); + SetHistoryOutputValue("LINSOL_RESIDUAL_FLAMELET", log10(solver[SPECIES_SOL]->GetResLinSolver())); + break; + } + + case SPECIES_MODEL::NONE: break; } } -void CFlowOutput::SetVolumeOutputFields_ScalarSolution(const CConfig* config){ +void CFlowOutput::SetVolumeOutputFieldsScalarSolution(const CConfig* config){ + /*--- Only place outputs of the "SOLUTION" group here. ---*/ + switch (TurbModelFamily(config->GetKind_Turb_Model())) { case TURB_FAMILY::SA: AddVolumeOutput("NU_TILDE", "Nu_Tilde", "SOLUTION", "Spalart-Allmaras variable"); @@ -1101,22 +1258,39 @@ void CFlowOutput::SetVolumeOutputFields_ScalarSolution(const CConfig* config){ case TURB_TRANS_MODEL::LM: AddVolumeOutput("INTERMITTENCY", "LM_gamma", "SOLUTION", "LM intermittency"); AddVolumeOutput("RE_THETA_T", "LM_Re_t", "SOLUTION", "LM RE_THETA_T"); - AddVolumeOutput("INTERMITTENCY_SEP", "LM_gamma_sep", "PRIMITIVE", "LM intermittency"); - AddVolumeOutput("INTERMITTENCY_EFF", "LM_gamma_eff", "PRIMITIVE", "LM RE_THETA_T"); - AddVolumeOutput("TURB_INDEX", "Turb_index", "PRIMITIVE", "Turbulence index"); break; case TURB_TRANS_MODEL::NONE: break; } - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { - for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) - AddVolumeOutput("SPECIES_" + std::to_string(iVar), "Species_" + std::to_string(iVar), "SOLUTION", "Species_" + std::to_string(iVar) + " mass fraction"); + switch (config->GetKind_Species_Model()) { + case SPECIES_MODEL::SPECIES_TRANSPORT: + for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++){ + AddVolumeOutput("SPECIES_" + std::to_string(iVar), "Species_" + std::to_string(iVar), "SOLUTION", "Species_" + std::to_string(iVar) + " mass fraction"); + } + break; + case SPECIES_MODEL::FLAMELET: + /*--- Controlling variables. ---*/ + for (auto iCV=0u; iCVGetNControlVars(); iCV++) { + const auto& cv_name = config->GetControllingVariableName(iCV); + AddVolumeOutput(cv_name, cv_name, "SOLUTION", cv_name + " solution."); + } + /*--- auxiliary species ---*/ + for (auto iReactant=0u; iReactantGetNUserScalars(); iReactant++) { + const auto& species_name = config->GetUserScalarName(iReactant); + AddVolumeOutput(species_name, species_name, "SOLUTION", species_name + "Mass fraction solution"); + } + + break; + case SPECIES_MODEL::NONE: + break; } } -void CFlowOutput::SetVolumeOutputFields_ScalarResidual(const CConfig* config) { +void CFlowOutput::SetVolumeOutputFieldsScalarResidual(const CConfig* config) { + /*--- Only place outputs of the "RESIDUAL" group here. ---*/ + switch (TurbModelFamily(config->GetKind_Turb_Model())){ case TURB_FAMILY::SA: AddVolumeOutput("RES_NU_TILDE", "Residual_Nu_Tilde", "RESIDUAL", "Residual of the Spalart-Allmaras variable"); @@ -1131,6 +1305,28 @@ void CFlowOutput::SetVolumeOutputFields_ScalarResidual(const CConfig* config) { break; } + switch (config->GetKind_Species_Model()) { + case SPECIES_MODEL::SPECIES_TRANSPORT: + for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++){ + AddVolumeOutput("RES_SPECIES_" + std::to_string(iVar), "Residual_Species_" + std::to_string(iVar), "RESIDUAL", "Residual of the transported species " + std::to_string(iVar)); + } + break; + case SPECIES_MODEL::FLAMELET: + /*--- Residuals for controlling variable transport equations. ---*/ + for (auto iCV=0u; iCVGetNControlVars(); iCV++) { + const auto& cv_name = config->GetControllingVariableName(iCV); + AddVolumeOutput("RES_"+cv_name, "Residual_"+cv_name, "RESIDUAL", "Residual of " + cv_name + " controlling variable."); + } + /*--- residuals for auxiliary species transport equations ---*/ + for (unsigned short iReactant=0; iReactantGetNUserScalars(); iReactant++){ + const auto& species_name = config->GetUserScalarName(iReactant); + AddVolumeOutput("RES_" + species_name, "Residual_" + species_name, "RESIDUAL", "Residual of the " + species_name + " equation"); + } + break; + case SPECIES_MODEL::NONE: + break; + } + switch (config->GetKind_Trans_Model()) { case TURB_TRANS_MODEL::LM: AddVolumeOutput("RES_INTERMITTENCY", "Residual_LM_intermittency", "RESIDUAL", "Residual of LM intermittency"); @@ -1140,14 +1336,13 @@ void CFlowOutput::SetVolumeOutputFields_ScalarResidual(const CConfig* config) { case TURB_TRANS_MODEL::NONE: break; } - - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { - for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) - AddVolumeOutput("RES_SPECIES_" + std::to_string(iVar), "Residual_Species_" + std::to_string(iVar), "RESIDUAL", "Residual of the transported species " + std::to_string(iVar)); - } } -void CFlowOutput::SetVolumeOutputFields_ScalarLimiter(const CConfig* config) { + +void CFlowOutput::SetVolumeOutputFieldsScalarLimiter(const CConfig* config) { + /*--- Only place outputs of the "SOLUTION" group for species transport here. ---*/ + + if (config->GetKind_SlopeLimit_Turb() != LIMITER::NONE) { switch (TurbModelFamily(config->GetKind_Turb_Model())) { case TURB_FAMILY::SA: @@ -1164,17 +1359,103 @@ void CFlowOutput::SetVolumeOutputFields_ScalarLimiter(const CConfig* config) { } } - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { - if (config->GetKind_SlopeLimit_Species() != LIMITER::NONE) { - for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) - AddVolumeOutput("LIMITER_SPECIES_" + std::to_string(iVar), "Limiter_Species_" + std::to_string(iVar), "LIMITER", "Limiter value of the transported species " + std::to_string(iVar)); + if (config->GetKind_SlopeLimit_Species() != LIMITER::NONE) { + switch (config->GetKind_Species_Model()) { + case SPECIES_MODEL::SPECIES_TRANSPORT: + for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) + AddVolumeOutput("LIMITER_SPECIES_" + std::to_string(iVar), "Limiter_Species_" + std::to_string(iVar), "LIMITER", "Limiter value of the transported species " + std::to_string(iVar)); + break; + case SPECIES_MODEL::FLAMELET: + /*--- Limiter for controlling variables transport. ---*/ + for (auto iCV=0u; iCV < config->GetNControlVars(); iCV++) { + const auto& cv_name = config->GetControllingVariableName(iCV); + AddVolumeOutput("LIMITER_" + cv_name, "Limiter_" + cv_name, "LIMITER", "Limiter of " + cv_name + " controlling variable."); + } + /*--- limiter for auxiliary species transport ---*/ + for (unsigned short iReactant=0; iReactant < config->GetNUserScalars(); iReactant++) { + const auto& species_name = config->GetUserScalarName(iReactant); + AddVolumeOutput("LIMITER_" + species_name, "LIMITER_" + species_name, "LIMITER", "Limiter value for the " + species_name + " equation"); + } + break; + default: + break; } } +} + +void CFlowOutput::SetVolumeOutputFieldsScalarPrimitive(const CConfig* config) { + /*--- Only place outputs of the "PRIMITIVE" group for scalar transport here. ---*/ + + switch (config->GetKind_Species_Model()) { + case SPECIES_MODEL::SPECIES_TRANSPORT: + for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++){ + AddVolumeOutput("DIFFUSIVITY_" + std::to_string(iVar), "Diffusivity_" + std::to_string(iVar), "PRIMITIVE", "Diffusivity of the transported species " + std::to_string(iVar)); + } + break; + default: + break; + } + + switch (config->GetKind_Trans_Model()) { + case TURB_TRANS_MODEL::LM: + AddVolumeOutput("INTERMITTENCY_SEP", "LM_gamma_sep", "PRIMITIVE", "LM intermittency"); + AddVolumeOutput("INTERMITTENCY_EFF", "LM_gamma_eff", "PRIMITIVE", "LM RE_THETA_T"); + AddVolumeOutput("TURB_INDEX", "Turb_index", "PRIMITIVE", "Turbulence index"); + break; + + case TURB_TRANS_MODEL::NONE: + break; + } if (config->GetKind_Turb_Model() != TURB_MODEL::NONE) { AddVolumeOutput("EDDY_VISCOSITY", "Eddy_Viscosity", "PRIMITIVE", "Turbulent eddy viscosity"); } +} + +void CFlowOutput::SetVolumeOutputFieldsScalarSource(const CConfig* config) { + /*--- Only place outputs of the "SOURCE" group for scalar transport here. ---*/ + + switch (config->GetKind_Species_Model()) { + case SPECIES_MODEL::FLAMELET: + for (auto iCV=0u; iCV < config->GetNControlVars(); iCV++) { + const auto& cv_source_name = config->GetControllingVariableSourceName(iCV); + const auto& cv_name = config->GetControllingVariableName(iCV); + if (cv_source_name.compare("NULL") != 0) + AddVolumeOutput("SOURCE_"+cv_name, "Source_" + cv_name, "SOURCE", "Source " + cv_name); + } + /*--- no source term for enthalpy ---*/ + /*--- auxiliary species source terms ---*/ + for (auto iReactant=0u; iReactantGetNUserScalars(); iReactant++) { + const auto& species_name = config->GetUserScalarName(iReactant); + AddVolumeOutput("SOURCE_" + species_name, "Source_" + species_name, "SOURCE", "Source " + species_name); + } + break; + default: + break; + } +} + + +void CFlowOutput::SetVolumeOutputFieldsScalarLookup(const CConfig* config) { + /*--- Only place outputs of the "LOOKUP" group for scalar transport here. ---*/ + + switch (config->GetKind_Species_Model()) { + case SPECIES_MODEL::FLAMELET: + for (auto i_lookup = 0u; i_lookup < config->GetNLookups(); ++i_lookup) { + string strname1 = "lookup_" + config->GetLookupName(i_lookup); + AddVolumeOutput(config->GetLookupName(i_lookup), strname1,"LOOKUP", config->GetLookupName(i_lookup)); + } + AddVolumeOutput("TABLE_MISSES" , "Table_misses" , "LOOKUP", "Lookup table misses"); + break; + default: + break; + } +} + +void CFlowOutput::SetVolumeOutputFieldsScalarMisc(const CConfig* config) { + /*--- Only place outputs of the group for scalar transport here that do not fit in other categories. ---*/ + if (config->GetSAParsedOptions().bc) { AddVolumeOutput("INTERMITTENCY", "gamma_BC", "INTERMITTENCY", "Intermittency"); } @@ -1195,9 +1476,18 @@ void CFlowOutput::SetVolumeOutputFields_ScalarLimiter(const CConfig* config) { } AddVolumeOutput("Q_CRITERION", "Q_Criterion", "VORTEX_IDENTIFICATION", "Value of the Q-Criterion"); } + + // Timestep info + AddVolumeOutput("DELTA_TIME", "Delta_Time", "TIMESTEP", "Value of the local timestep for the flow variables"); + AddVolumeOutput("CFL", "CFL", "TIMESTEP", "Value of the local CFL for the flow variables"); + if (config->GetKind_Turb_Model() != TURB_MODEL::NONE) + { + AddVolumeOutput("TURB_DELTA_TIME", "Turb_Delta_Time", "TIMESTEP", "Value of the local timestep for the turbulence variables"); + AddVolumeOutput("TURB_CFL", "Turb_CFL", "TIMESTEP", "Value of the local CFL for the turbulence variables"); + } } -void CFlowOutput::LoadVolumeData_Scalar(const CConfig* config, const CSolver* const* solver, const CGeometry* geometry, +void CFlowOutput::LoadVolumeDataScalar(const CConfig* config, const CSolver* const* solver, const CGeometry* geometry, const unsigned long iPoint) { const auto* turb_solver = solver[TURB_SOL]; const auto* trans_solver = solver[TRANS_SOL]; @@ -1206,6 +1496,9 @@ void CFlowOutput::LoadVolumeData_Scalar(const CConfig* config, const CSolver* co const auto* Node_Trans = (config->GetKind_Trans_Model() != TURB_TRANS_MODEL::NONE) ? trans_solver->GetNodes() : nullptr; const auto* Node_Geo = geometry->nodes; + SetVolumeOutputValue("DELTA_TIME", iPoint, Node_Flow->GetDelta_Time(iPoint)); + SetVolumeOutputValue("CFL", iPoint, Node_Flow->GetLocalCFL(iPoint)); + if (config->GetViscous()) { if (nDim == 3){ SetVolumeOutputValue("VORTICITY_X", iPoint, Node_Flow->GetVorticity(iPoint)[0]); @@ -1214,7 +1507,7 @@ void CFlowOutput::LoadVolumeData_Scalar(const CConfig* config, const CSolver* co } else { SetVolumeOutputValue("VORTICITY", iPoint, Node_Flow->GetVorticity(iPoint)[2]); } - SetVolumeOutputValue("Q_CRITERION", iPoint, GetQ_Criterion(Node_Flow->GetVelocityGradient(iPoint))); + SetVolumeOutputValue("Q_CRITERION", iPoint, GetQCriterion(Node_Flow->GetVelocityGradient(iPoint))); } const bool limiter = (config->GetKind_SlopeLimit_Turb() != LIMITER::NONE); @@ -1245,6 +1538,8 @@ void CFlowOutput::LoadVolumeData_Scalar(const CConfig* config, const CSolver* co /*--- If we got here a turbulence model is being used, therefore there is eddy viscosity. ---*/ if (config->GetKind_Turb_Model() != TURB_MODEL::NONE) { SetVolumeOutputValue("EDDY_VISCOSITY", iPoint, Node_Flow->GetEddyViscosity(iPoint)); + SetVolumeOutputValue("TURB_DELTA_TIME", iPoint, Node_Turb->GetDelta_Time(iPoint)); + SetVolumeOutputValue("TURB_CFL", iPoint, Node_Turb->GetLocalCFL(iPoint)); } if (config->GetSAParsedOptions().bc) { @@ -1270,15 +1565,64 @@ void CFlowOutput::LoadVolumeData_Scalar(const CConfig* config, const CSolver* co SetVolumeOutputValue("WALL_DISTANCE", iPoint, Node_Geo->GetWall_Distance(iPoint)); } - if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { - const auto Node_Species = solver[SPECIES_SOL]->GetNodes(); + switch (config->GetKind_Species_Model()) { - for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { - SetVolumeOutputValue("SPECIES_" + std::to_string(iVar), iPoint, Node_Species->GetSolution(iPoint, iVar)); - SetVolumeOutputValue("RES_SPECIES_" + std::to_string(iVar), iPoint, solver[SPECIES_SOL]->LinSysRes(iPoint, iVar)); - if (config->GetKind_SlopeLimit_Species() != LIMITER::NONE) - SetVolumeOutputValue("LIMITER_SPECIES_" + std::to_string(iVar), iPoint, Node_Species->GetLimiter(iPoint, iVar)); + case SPECIES_MODEL::SPECIES_TRANSPORT: { + const auto Node_Species = solver[SPECIES_SOL]->GetNodes(); + for (unsigned short iVar = 0; iVar < config->GetnSpecies(); iVar++) { + SetVolumeOutputValue("SPECIES_" + std::to_string(iVar), iPoint, Node_Species->GetSolution(iPoint, iVar)); + SetVolumeOutputValue("RES_SPECIES_" + std::to_string(iVar), iPoint, solver[SPECIES_SOL]->LinSysRes(iPoint, iVar)); + SetVolumeOutputValue("DIFFUSIVITY_"+ std::to_string(iVar), iPoint, Node_Species->GetDiffusivity(iPoint,iVar)); + if (config->GetKind_SlopeLimit_Species() != LIMITER::NONE) + SetVolumeOutputValue("LIMITER_SPECIES_" + std::to_string(iVar), iPoint, Node_Species->GetLimiter(iPoint, iVar)); + } + break; } + + case SPECIES_MODEL::FLAMELET: { + const auto Node_Species = solver[SPECIES_SOL]->GetNodes(); + + /*--- Controlling variables transport equations. ---*/ + for (auto iCV=0u; iCV < config->GetNControlVars(); iCV++) { + const auto& cv_name = config->GetControllingVariableName(iCV); + SetVolumeOutputValue(cv_name, iPoint, Node_Species->GetSolution(iPoint, iCV)); + SetVolumeOutputValue("RES_" + cv_name, iPoint, solver[SPECIES_SOL]->LinSysRes(iPoint, iCV)); + const auto& source_name = config->GetControllingVariableSourceName(iCV); + if (source_name.compare("NULL") != 0) + SetVolumeOutputValue("SOURCE_" + cv_name, iPoint, Node_Species->GetScalarSources(iPoint)[iCV]); + } + /*--- auxiliary species transport equations ---*/ + for (unsigned short i_scalar=0; i_scalarGetNUserScalars(); i_scalar++) { + const auto& scalar_name = config->GetUserScalarName(i_scalar); + SetVolumeOutputValue(scalar_name, iPoint, Node_Species->GetSolution(iPoint, config->GetNControlVars() + i_scalar)); + SetVolumeOutputValue("SOURCE_" + scalar_name, iPoint, Node_Species->GetScalarSources(iPoint)[config->GetNControlVars() + i_scalar]); + SetVolumeOutputValue("RES_" + scalar_name, iPoint, solver[SPECIES_SOL]->LinSysRes(iPoint, config->GetNControlVars() + i_scalar)); + } + + if (config->GetKind_SlopeLimit_Species() != LIMITER::NONE) { + /*--- Limiter for controlling variable transport equations. ---*/ + for (auto iCV=0u; iCVGetNControlVars(); iCV++) { + const auto& cv_name = config->GetControllingVariableName(iCV); + SetVolumeOutputValue("LIMITER_" + cv_name, iPoint, Node_Species->GetLimiter(iPoint, iCV)); + } + /*--- limiter for auxiliary species transport equations ---*/ + for (unsigned short i_scalar=0; i_scalarGetNUserScalars(); i_scalar++) { + const auto& scalar_name = config->GetUserScalarName(i_scalar); + SetVolumeOutputValue("LIMITER_" + scalar_name, iPoint, Node_Species->GetLimiter(iPoint, config->GetNControlVars() + i_scalar)); + } + } + + /*--- variables that we look up from the LUT ---*/ + for (int i_lookup = 0; i_lookup < config->GetNLookups(); ++i_lookup) { + if (config->GetLookupName(i_lookup)!="NULL") + SetVolumeOutputValue(config->GetLookupName(i_lookup), iPoint, Node_Species->GetScalarLookups(iPoint)[i_lookup]); + } + + SetVolumeOutputValue("TABLE_MISSES", iPoint, Node_Species->GetTableMisses(iPoint)); + + break; + } + case SPECIES_MODEL::NONE: break; } } @@ -1300,6 +1644,8 @@ void CFlowOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver void CFlowOutput::AddAerodynamicCoefficients(const CConfig* config) { /// BEGIN_GROUP: AERO_COEFF, DESCRIPTION: Sum of the aerodynamic coefficients and forces on all surfaces (markers) set with MARKER_MONITORING. + /// DESCRIPTION: Reference force for aerodynamic coefficients + AddHistoryOutput("REFERENCE_FORCE", "RefForce", ScreenOutputFormat::FIXED, "AERO_COEFF", "Reference force used to compute aerodynamic coefficients", HistoryFieldType::COEFFICIENT); /// DESCRIPTION: Drag coefficient AddHistoryOutput("DRAG", "CD", ScreenOutputFormat::FIXED, "AERO_COEFF", "Total drag coefficient on all surfaces set with MARKER_MONITORING", HistoryFieldType::COEFFICIENT); /// DESCRIPTION: Lift coefficient @@ -1357,6 +1703,7 @@ void CFlowOutput::AddAerodynamicCoefficients(const CConfig* config) { void CFlowOutput::SetAerodynamicCoefficients(const CConfig* config, const CSolver* flow_solver){ + SetHistoryOutputValue("REFERENCE_FORCE", flow_solver->GetAeroCoeffsReferenceForce()); SetHistoryOutputValue("DRAG", flow_solver->GetTotal_CD()); SetHistoryOutputValue("LIFT", flow_solver->GetTotal_CL()); if (nDim == 3) @@ -1408,7 +1755,8 @@ void CFlowOutput::AddHeatCoefficients(const CConfig* config) { AddHistoryOutput("MAXIMUM_HEATFLUX", "maxHF", ScreenOutputFormat::SCIENTIFIC, "HEAT", "Maximum heatflux across all surfaces set with MARKER_MONITORING.", HistoryFieldType::COEFFICIENT); vector Marker_Monitoring; - for (auto iMarker = 0u; iMarker < config->GetnMarker_Monitoring(); iMarker++) { + Marker_Monitoring.reserve(config->GetnMarker_Monitoring()); +for (auto iMarker = 0u; iMarker < config->GetnMarker_Monitoring(); iMarker++) { Marker_Monitoring.push_back(config->GetMarker_Monitoring_TagBound(iMarker)); } /// DESCRIPTION: Total heatflux @@ -1449,12 +1797,12 @@ void CFlowOutput::SetRotatingFrameCoefficients(const CSolver* flow_solver) { SetHistoryOutputValue("FIGURE_OF_MERIT", flow_solver->GetTotal_CMerit()); } -void CFlowOutput::Add_CpInverseDesignOutput(){ +void CFlowOutput::AddCpInverseDesignOutput(){ AddHistoryOutput("INVERSE_DESIGN_PRESSURE", "Cp_Diff", ScreenOutputFormat::FIXED, "CP_DIFF", "Cp difference for inverse design", HistoryFieldType::COEFFICIENT); } -void CFlowOutput::Set_CpInverseDesign(CSolver *solver, const CGeometry *geometry, const CConfig *config){ +void CFlowOutput::SetCpInverseDesign(CSolver *solver, const CGeometry *geometry, const CConfig *config){ /*--- Prepare to read the surface pressure files (CSV) ---*/ @@ -1542,12 +1890,12 @@ void CFlowOutput::Set_CpInverseDesign(CSolver *solver, const CGeometry *geometry } -void CFlowOutput::Add_NearfieldInverseDesignOutput(){ +void CFlowOutput::AddNearfieldInverseDesignOutput(){ AddHistoryOutput("EQUIVALENT_AREA", "CEquiv_Area", ScreenOutputFormat::SCIENTIFIC, "EQUIVALENT_AREA", "Equivalent area", HistoryFieldType::COEFFICIENT); } -void CFlowOutput::Set_NearfieldInverseDesign(CSolver *solver, const CGeometry *geometry, const CConfig *config){ +void CFlowOutput::SetNearfieldInverseDesign(CSolver *solver, const CGeometry *geometry, const CConfig *config){ ofstream EquivArea_file; su2double auxXCoord, auxYCoord, auxZCoord, InverseDesign = 0.0, DeltaX, @@ -2074,7 +2422,7 @@ void CFlowOutput::WriteForcesBreakdown(const CConfig* config, const CSolver* flo auto fileName = config->GetBreakdown_FileName(); if (unsteady) { - const auto lastindex = fileName.find_last_of("."); + const auto lastindex = fileName.find_last_of('.'); const auto ext = fileName.substr(lastindex, fileName.size()); fileName = fileName.substr(0, lastindex); fileName = config->GetFilename(fileName, ext, curTimeIter); @@ -2246,13 +2594,13 @@ void CFlowOutput::WriteForcesBreakdown(const CConfig* config, const CSolver* flo ofstream file; file.open(fileName); - file << "\n-------------------------------------------------------------------------\n"; + file << "\n"; + file << "-------------------------------------------------------------------------\n"; file << "| ___ _ _ ___ |\n"; - file << "| / __| | | |_ ) Release 7.5.1 \"Blackbird\" |\n"; + file << "| / __| | | |_ ) Release 8.0.0 \"Harrier\" |\n"; file << "| \\__ \\ |_| |/ / |\n"; file << "| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |\n"; file << "| |\n"; - // file << "| Local date and time: " << dt << " |\n"; file << "-------------------------------------------------------------------------\n"; file << "| SU2 Project Website: https://su2code.github.io |\n"; file << "| |\n"; @@ -2428,6 +2776,10 @@ void CFlowOutput::WriteForcesBreakdown(const CConfig* config, const CSolver* flo << config->GetTemperature_Critical() / config->GetTemperature_Ref() << "\n"; break; + case FLUID_FLAMELET: + file << "Fluid Model: FLAMELET \n"; + break; + case COOLPROP: { CCoolProp auxFluidModel(config->GetFluid_Name()); file << "Fluid Model: CoolProp library \n"; @@ -2709,6 +3061,10 @@ void CFlowOutput::WriteForcesBreakdown(const CConfig* config, const CSolver* flo case INC_DENSITYMODEL::VARIABLE: if (energy) file << "Energy equation is active and coupled for variable density.\n"; break; + + case INC_DENSITYMODEL::FLAMELET: + file << "Density is obtained through flamelet manifold.\n"; + break; } file << "-- Input conditions:\n"; @@ -2747,6 +3103,12 @@ void CFlowOutput::WriteForcesBreakdown(const CConfig* config, const CSolver* flo else file << " psf.\n"; break; + case FLUID_FLAMELET: + file << "Fluid model: FLUID_FLAMELET \n"; + if (si_units) file << " Pa.\n"; + else file << " psf.\n"; + break; + case INC_IDEAL_GAS_POLY: file << "Fluid Model: INC_IDEAL_GAS_POLY \n"; file << "Variable density incompressible flow using ideal gas law.\n"; @@ -2781,6 +3143,13 @@ void CFlowOutput::WriteForcesBreakdown(const CConfig* config, const CSolver* flo file << "Laminar Viscosity (non-dim): " << config->GetMu_ConstantND() << "\n"; break; + case VISCOSITYMODEL::FLAMELET: + file << "Viscosity Model: FLAMELET \n"; + if (si_units) file << " N.s/m^2.\n"; + else file << " lbf.s/ft^2.\n"; + file << "Laminar Viscosity (non-dim): " << config->GetMu_ConstantND() << "\n"; + break; + case VISCOSITYMODEL::COOLPROP: file << "Viscosity Model: CoolProp \n"; break; @@ -2834,6 +3203,12 @@ void CFlowOutput::WriteForcesBreakdown(const CConfig* config, const CSolver* flo file << "Conductivity Model: COOLPROP \n"; break; + case CONDUCTIVITYMODEL::FLAMELET: + file << "Conductivity Model: FLAMELET \n"; + file << "Molecular Conductivity units: " << " W/m^2.K.\n"; + file << "Molecular Conductivity (non-dim): " << config->GetThermal_Conductivity_ConstantND() << "\n"; + break; + case CONDUCTIVITYMODEL::POLYNOMIAL: file << "Viscosity Model: POLYNOMIAL \n"; file << "Kt(T) polynomial coefficients: \n ("; @@ -3536,7 +3911,7 @@ void CFlowOutput::WriteForcesBreakdown(const CConfig* config, const CSolver* flo // clang-format on } -bool CFlowOutput::WriteVolume_Output(CConfig *config, unsigned long Iter, bool force_writing, unsigned short iFile){ +bool CFlowOutput::WriteVolumeOutput(CConfig *config, unsigned long Iter, bool force_writing, unsigned short iFile){ bool writeRestart = false; auto FileFormat = config->GetVolumeOutputFiles(); @@ -3555,8 +3930,8 @@ bool CFlowOutput::WriteVolume_Output(CConfig *config, unsigned long Iter, bool f /* only write 'double' files for the restart files */ if ((config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND) && ((Iter == 0) || (Iter % config->GetVolumeOutputFrequency(iFile) == 0) || - (((Iter+1) % config->GetVolumeOutputFrequency(iFile) == 0) && writeRestart==true) || // Restarts need 2 old solutions. - (((Iter+2) == config->GetnTime_Iter()) && writeRestart==true))){ // The last timestep is written anyway but one needs the step before for restarts. + (((Iter+1) % config->GetVolumeOutputFrequency(iFile) == 0) && writeRestart) || // Restarts need 2 old solutions. + (((Iter+2) == config->GetnTime_Iter()) && writeRestart))){ // The last timestep is written anyway but one needs the step before for restarts. return true; } } else { @@ -3564,10 +3939,10 @@ bool CFlowOutput::WriteVolume_Output(CConfig *config, unsigned long Iter, bool f return ((Iter > 0) && Iter % config->GetVolumeOutputFrequency(iFile) == 0) || force_writing; } - return false || force_writing; + return force_writing; } -void CFlowOutput::SetTimeAveragedFields(){ +void CFlowOutput::SetTimeAveragedFields() { AddVolumeOutput("MEAN_DENSITY", "MeanDensity", "TIME_AVERAGE", "Mean density"); AddVolumeOutput("MEAN_VELOCITY-X", "MeanVelocity_x", "TIME_AVERAGE", "Mean velocity x-component"); AddVolumeOutput("MEAN_VELOCITY-Y", "MeanVelocity_y", "TIME_AVERAGE", "Mean velocity y-component"); @@ -3653,7 +4028,7 @@ void CFlowOutput::SetFixedCLScreenOutput(const CConfig *config){ else FixedCLSummary << "Changed AoA by" << historyOutput_Map["CL_DRIVER_COMMAND"].value; FixedCLSummary.PrintFooter(); - SetScreen_Header(config); + SetScreenHeader(config); } else if (config->GetFinite_Difference_Mode() && historyOutput_Map["AOA"].value == historyOutput_Map["PREV_AOA"].value){ diff --git a/SU2_CFD/src/output/CHeatOutput.cpp b/SU2_CFD/src/output/CHeatOutput.cpp index 6150f253480..39d5ee3796f 100644 --- a/SU2_CFD/src/output/CHeatOutput.cpp +++ b/SU2_CFD/src/output/CHeatOutput.cpp @@ -2,7 +2,7 @@ * \file CHeatOutput.cpp * \brief Main subroutines for the heat solver output * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -89,6 +89,8 @@ void CHeatOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolver SetHistoryOutputValue("LINSOL_RESIDUAL", log10(heat_solver->GetResLinSolver())); SetHistoryOutputValue("CFL_NUMBER", config->GetCFL(MESH_0)); + ComputeSimpleCustomOutputs(config); + /*--- Keep this as last, since it uses the history values that were set. ---*/ SetCustomAndComboObjectives(HEAT_SOL, config, solver); } diff --git a/SU2_CFD/src/output/CMeshOutput.cpp b/SU2_CFD/src/output/CMeshOutput.cpp index b06c2441463..eb00dfbe6f9 100644 --- a/SU2_CFD/src/output/CMeshOutput.cpp +++ b/SU2_CFD/src/output/CMeshOutput.cpp @@ -2,7 +2,7 @@ * \file CMeshOutput.cpp * \brief Main subroutines for the heat solver output * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -46,7 +46,7 @@ CMeshOutput::CMeshOutput(CConfig *config, unsigned short nDim) : COutput(config, } -CMeshOutput::~CMeshOutput(void) {} +CMeshOutput::~CMeshOutput() = default; void CMeshOutput::SetVolumeOutputFields(CConfig *config){ diff --git a/SU2_CFD/src/output/CMultizoneOutput.cpp b/SU2_CFD/src/output/CMultizoneOutput.cpp index f157fb39d74..a30acca6268 100644 --- a/SU2_CFD/src/output/CMultizoneOutput.cpp +++ b/SU2_CFD/src/output/CMultizoneOutput.cpp @@ -2,7 +2,7 @@ * \file CMultizoneOutput.cpp * \brief Main subroutines for multizone output * \author R. Sanchez, T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -123,7 +123,7 @@ void CMultizoneOutput::SetMultizoneHistoryOutputFields(const COutput* const* out zoneIndex = "[" + PrintingToolbox::to_string(iZone) + "]"; /*--- For all the variables per solver ---*/ - for (const auto& nameSinglezone : output[iZone]->GetHistoryOutput_List()) { + for (const auto& nameSinglezone : output[iZone]->GetHistoryOutputList()) { if (nameSinglezone != "TIME_ITER" && nameSinglezone != "OUTER_ITER") { @@ -151,7 +151,7 @@ void CMultizoneOutput::SetMultizoneHistoryOutputFields(const COutput* const* out /*--- Add the PerSurface outputs. ---*/ const auto& ZoneHistoryPerSurfaceFields = output[iZone]->GetHistoryPerSurfaceFields(); - for (const auto& nameSinglezone : output[iZone]->GetHistoryOutputPerSurface_List()) { + for (const auto& nameSinglezone : output[iZone]->GetHistoryOutputPerSurfaceList()) { const auto& field = ZoneHistoryPerSurfaceFields.at(nameSinglezone); @@ -173,7 +173,7 @@ void CMultizoneOutput::SetMultizoneHistoryOutputFields(const COutput* const* out /*--- Determine whether Maker_Analyze/Monitoring has to be used. ---*/ auto* Marker = &Marker_Monitoring; - if ((group == "FLOW_COEFF_SURF") || (group == "SPECIES_COEFF_SURF")) + if ((group == "FLOW_COEFF_SURF") || (group == "SPECIES_COEFF_SURF") ) Marker = &Marker_Analyze; else if (group != "AERO_COEFF_SURF" && group != "HEAT_SURF") SU2_MPI::Error("Per Surface output group unknown: " + group, CURRENT_FUNCTION); @@ -186,7 +186,7 @@ void CMultizoneOutput::SetMultizoneHistoryOutputFields(const COutput* const* out AddHistoryOutput("COMBO", "ComboObj", ScreenOutputFormat::SCIENTIFIC, "COMBO", "Combined obj. function value.", HistoryFieldType::COEFFICIENT); } -bool CMultizoneOutput::WriteScreen_Header(const CConfig *config) { +bool CMultizoneOutput::WriteScreenHeader(const CConfig *config) { /*--- Print header if the outer iteration is zero or zonal convergence is printed ---*/ @@ -202,7 +202,7 @@ bool CMultizoneOutput::WriteScreen_Header(const CConfig *config) { return false; } -bool CMultizoneOutput::WriteScreen_Output(const CConfig *config) { +bool CMultizoneOutput::WriteScreenOutput(const CConfig *config) { unsigned long ScreenWrt_Freq_Outer = config->GetScreen_Wrt_Freq(1); unsigned long ScreenWrt_Freq_Time = config->GetScreen_Wrt_Freq(0); @@ -228,7 +228,7 @@ bool CMultizoneOutput::WriteScreen_Output(const CConfig *config) { return true; } -bool CMultizoneOutput::WriteHistoryFile_Output(const CConfig *config){ +bool CMultizoneOutput::WriteHistoryFileOutput(const CConfig *config){ unsigned long HistoryWrt_Freq_Outer = config->GetHistory_Wrt_Freq(1); unsigned long HistoryWrt_Freq_Time = config->GetHistory_Wrt_Freq(0); diff --git a/SU2_CFD/src/output/CNEMOCompOutput.cpp b/SU2_CFD/src/output/CNEMOCompOutput.cpp index e2c799e269f..67adfe1559e 100644 --- a/SU2_CFD/src/output/CNEMOCompOutput.cpp +++ b/SU2_CFD/src/output/CNEMOCompOutput.cpp @@ -2,7 +2,7 @@ * \file CNEMOCompOutput.cpp * \brief Main subroutines for compressible flow output * \author W. Maier, R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -169,7 +169,7 @@ void CNEMOCompOutput::SetHistoryOutputFields(CConfig *config){ /// DESCRIPTION: Linear solver iterations AddHistoryOutput("LINSOL_ITER", "Linear_Solver_Iterations", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver."); AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver."); - AddHistoryOutputFields_ScalarLinsol(config); + AddHistoryOutputFieldsScalarLinsol(config); AddHistoryOutput("MIN_CFL", "Min CFL", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current minimum of the local CFL numbers"); AddHistoryOutput("MAX_CFL", "Max CFL", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current maximum of the local CFL numbers"); @@ -202,7 +202,7 @@ void CNEMOCompOutput::SetHistoryOutputFields(CConfig *config){ AddRotatingFrameCoefficients(); - Add_CpInverseDesignOutput(); + AddCpInverseDesignOutput(); } @@ -224,7 +224,7 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("ENERGY", "Energy", "SOLUTION", "Energy"); AddVolumeOutput("ENERGY_VE", "Energy_ve", "SOLUTION", "Energy_ve"); - SetVolumeOutputFields_ScalarSolution(config); + SetVolumeOutputFieldsScalarSolution(config); //Auxiliary variables for post-processment for(iSpecies = 0; iSpecies < nSpecies; iSpecies++) @@ -242,6 +242,10 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("PRESSURE", "Pressure", "PRIMITIVE", "Pressure"); AddVolumeOutput("TEMPERATURE_TR", "Temperature_tr", "PRIMITIVE", "Temperature_tr"); AddVolumeOutput("TEMPERATURE_VE", "Temperature_ve", "PRIMITIVE", "Temperature_ve"); + AddVolumeOutput("VELOCITY-X", "Velocity_x", "PRIMITIVE", "x-component of the velocity vector"); + AddVolumeOutput("VELOCITY-Y", "Velocity_y", "PRIMITIVE", "y-component of the velocity vector"); + if (nDim == 3) + AddVolumeOutput("VELOCITY-Z", "Velocity_z", "PRIMITIVE", "z-component of the velocity vector"); AddVolumeOutput("MACH", "Mach", "PRIMITIVE", "Mach number"); AddVolumeOutput("PRESSURE_COEFF", "Pressure_Coefficient", "PRIMITIVE", "Pressure coefficient"); @@ -261,6 +265,8 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ } + SetVolumeOutputFieldsScalarPrimitive(config); + //Residuals for(iSpecies = 0; iSpecies < nSpecies; iSpecies++) AddVolumeOutput("RES_DENSITY_" + std::to_string(iSpecies), "Residual_Density_" + std::to_string(iSpecies), "RESIDUAL", "Residual of species density " + std::to_string(iSpecies)); @@ -271,7 +277,7 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("RES_ENERGY", "Residual_Energy", "RESIDUAL", "Residual of the energy"); AddVolumeOutput("RES_ENERGY_VE", "Residual_Energy_ve", "RESIDUAL", "Residual of the energy_ve"); - SetVolumeOutputFields_ScalarResidual(config); + SetVolumeOutputFieldsScalarResidual(config); if (config->GetKind_SlopeLimit_Flow() != LIMITER::NONE && config->GetKind_SlopeLimit_Flow() != LIMITER::VAN_ALBADA_EDGE) { // Limiter values @@ -283,11 +289,17 @@ void CNEMOCompOutput::SetVolumeOutputFields(CConfig *config){ AddVolumeOutput("LIMITER_ENERGY", "Limiter_Energy", "LIMITER", "Limiter value of the energy"); } - SetVolumeOutputFields_ScalarLimiter(config); + SetVolumeOutputFieldsScalarLimiter(config); + + SetVolumeOutputFieldsScalarSource(config); + + SetVolumeOutputFieldsScalarLookup(config); + + SetVolumeOutputFieldsScalarMisc(config); AddCommonFVMOutputs(config); - if (config->GetTime_Domain()){ + if (config->GetTime_Domain()) { SetTimeAveragedFields(); } } @@ -327,6 +339,11 @@ void CNEMOCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv SetVolumeOutputValue("PRESSURE", iPoint, Node_Flow->GetPressure(iPoint)); SetVolumeOutputValue("TEMPERATURE_TR", iPoint, Node_Flow->GetTemperature(iPoint)); SetVolumeOutputValue("TEMPERATURE_VE", iPoint, Node_Flow->GetTemperature_ve(iPoint)); + SetVolumeOutputValue("VELOCITY-X", iPoint, Node_Flow->GetVelocity(iPoint, 0)); + SetVolumeOutputValue("VELOCITY-Y", iPoint, Node_Flow->GetVelocity(iPoint, 1)); + if (nDim == 3) + SetVolumeOutputValue("VELOCITY-Z", iPoint, Node_Flow->GetVelocity(iPoint, 2)); + SetVolumeOutputValue("MACH", iPoint, sqrt(Node_Flow->GetVelocity2(iPoint))/Node_Flow->GetSoundSpeed(iPoint)); const su2double factor = solver[FLOW_SOL]->GetReferenceDynamicPressure(); @@ -364,7 +381,7 @@ void CNEMOCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv } } - LoadVolumeData_Scalar(config, solver, geometry, iPoint); + LoadVolumeDataScalar(config, solver, geometry, iPoint); LoadCommonFVMOutputs(config, geometry, iPoint); @@ -434,7 +451,7 @@ void CNEMOCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol SetHistoryOutputValue("CL_DRIVER_COMMAND", NEMO_solver->GetAoA_inc()); } - LoadHistoryData_Scalar(config, solver); + LoadHistoryDataScalar(config, solver); /*--- Set the analyse surface history values --- */ @@ -450,7 +467,7 @@ void CNEMOCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol /*--- Set Cp diff fields ---*/ - Set_CpInverseDesign(NEMO_solver, geometry, config); + SetCpInverseDesign(NEMO_solver, geometry, config); /*--- Keep this as last, since it uses the history values that were set. ---*/ @@ -460,7 +477,7 @@ void CNEMOCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol } -bool CNEMOCompOutput::SetInit_Residuals(const CConfig *config){ +bool CNEMOCompOutput::SetInitResiduals(const CConfig *config){ return (config->GetTime_Marching() != TIME_MARCHING::STEADY && (curInnerIter == 0))|| (config->GetTime_Marching() == TIME_MARCHING::STEADY && (curInnerIter < 2)); @@ -474,6 +491,6 @@ void CNEMOCompOutput::SetAdditionalScreenOutput(const CConfig *config){ } } -bool CNEMOCompOutput::WriteHistoryFile_Output(const CConfig *config) { - return !config->GetFinite_Difference_Mode() && COutput::WriteHistoryFile_Output(config); +bool CNEMOCompOutput::WriteHistoryFileOutput(const CConfig *config) { + return !config->GetFinite_Difference_Mode() && COutput::WriteHistoryFileOutput(config); } diff --git a/SU2_CFD/src/output/COutput.cpp b/SU2_CFD/src/output/COutput.cpp index 9423831de01..4f52cd64fdb 100644 --- a/SU2_CFD/src/output/COutput.cpp +++ b/SU2_CFD/src/output/COutput.cpp @@ -2,7 +2,7 @@ * \file COutput.cpp * \brief Main subroutines for output solver information * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -172,7 +172,7 @@ COutput::COutput(const CConfig *config, unsigned short ndim, bool fem_output): } -COutput::~COutput(void) { +COutput::~COutput() { delete convergenceTable; delete multiZoneHeaderTable; @@ -183,7 +183,7 @@ COutput::~COutput(void) { } -void COutput::SetHistory_Output(CGeometry *geometry, +void COutput::SetHistoryOutput(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned long TimeIter, @@ -201,9 +201,9 @@ void COutput::SetHistory_Output(CGeometry *geometry, LoadHistoryData(config, geometry, solver_container); - Convergence_Monitoring(config, curInnerIter); + ConvergenceMonitoring(config, curInnerIter); - Postprocess_HistoryData(config); + PostprocessHistoryData(config); MonitorTimeConvergence(config, curTimeIter); @@ -211,7 +211,7 @@ void COutput::SetHistory_Output(CGeometry *geometry, } -void COutput::SetHistory_Output(CGeometry *geometry, +void COutput::SetHistoryOutput(CGeometry *geometry, CSolver **solver_container, CConfig *config) { @@ -221,13 +221,13 @@ void COutput::SetHistory_Output(CGeometry *geometry, LoadHistoryData(config, geometry, solver_container); - Convergence_Monitoring(config, curInnerIter); + ConvergenceMonitoring(config, curInnerIter); - Postprocess_HistoryData(config); + PostprocessHistoryData(config); } -void COutput::SetMultizoneHistory_Output(COutput **output, CConfig **config, CConfig *driver_config, unsigned long TimeIter, unsigned long OuterIter){ +void COutput::SetMultizoneHistoryOutput(COutput **output, CConfig **config, CConfig *driver_config, unsigned long TimeIter, unsigned long OuterIter){ curTimeIter = TimeIter; curAbsTimeIter = TimeIter - driver_config->GetRestart_Iter(); @@ -239,9 +239,9 @@ void COutput::SetMultizoneHistory_Output(COutput **output, CConfig **config, CCo LoadMultizoneHistoryData(output, config); - Convergence_Monitoring(driver_config, curOuterIter); + ConvergenceMonitoring(driver_config, curOuterIter); - Postprocess_HistoryData(driver_config); + PostprocessHistoryData(driver_config); MonitorTimeConvergence(driver_config, curTimeIter); @@ -253,17 +253,16 @@ void COutput::OutputScreenAndHistory(CConfig *config) { if (rank == MASTER_NODE && !noWriting) { - if (WriteHistoryFile_Output(config)) SetHistoryFile_Output(config); + if (WriteHistoryFileOutput(config)) SetHistoryFileOutput(config); - if (WriteScreen_Header(config)) SetScreen_Header(config); + if (WriteScreenHeader(config)) SetScreenHeader(config); - if (WriteScreen_Output(config)) SetScreen_Output(config); + if (WriteScreenOutput(config)) SetScreenOutput(config); } } void COutput::SetupCustomHistoryOutput(const std::string& expression, CustomHistoryOutput& output) const { - std::vector symbols; output.expression = mel::Parse(expression, symbols); @@ -285,7 +284,7 @@ void COutput::SetCustomAndComboObjectives(int idxSol, const CConfig *config, CSo if (!customObjFunc.ready) { SetupCustomHistoryOutput(config->GetCustomObjFunc(), customObjFunc); } - solver[idxSol]->SetTotal_Custom_ObjFunc(customObjFunc.eval()); + solver[idxSol]->SetTotal_Custom_ObjFunc(customObjFunc.Eval()); } solver[idxSol]->Evaluate_ObjFunc(config, solver); SetHistoryOutputValue("COMBO", solver[idxSol]->GetTotal_ComboObj()); @@ -318,7 +317,7 @@ void COutput::AllocateDataSorters(CConfig *config, CGeometry *geometry){ } -void COutput::Load_Data(CGeometry *geometry, CConfig *config, CSolver** solver_container){ +void COutput::LoadData(CGeometry *geometry, CConfig *config, CSolver** solver_container){ /*--- Check if the data sorters are allocated, if not, allocate them. --- */ @@ -336,14 +335,26 @@ void COutput::Load_Data(CGeometry *geometry, CConfig *config, CSolver** solver_c void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE format, string fileName){ + /*--- File writer that will later be used to write the file to disk. Created below in the "switch" ---*/ CFileWriter *fileWriter = nullptr; - /*--- if it is still present, strip the extension (suffix) from the filename ---*/ - unsigned short lastindex = fileName.find_last_of("."); + /*--- If it is still present, strip the extension (suffix) from the filename ---*/ + const auto lastindex = fileName.find_last_of('.'); fileName = fileName.substr(0, lastindex); + /*--- If the filename with appended iteration is set (depending on the WRT_*_OVERWRITE options) + * two files are writen, the normal one and a copy to avoid overwriting previous outputs. ---*/ string filename_iter, extension; + /*--- Write output information to screen ---*/ + + auto LogOutputFiles = [&](const std::string& message) { + if (rank == MASTER_NODE) { + (*fileWritingTable) << message << fileName + extension; + if (!filename_iter.empty()) (*fileWritingTable) << message + " + iter" << filename_iter + extension; + } + }; + /*--- Write files depending on the format --- */ switch (format) { @@ -356,18 +367,12 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form fileName = config->GetFilename(surfaceFilename, "", curTimeIter); if (!config->GetWrt_Surface_Overwrite()) - filename_iter = config->GetFilename_Iter(fileName,curInnerIter, curOuterIter); + filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter); surfaceDataSorter->SortConnectivity(config, geometry); surfaceDataSorter->SortOutputData(); - if (rank == MASTER_NODE) { - (*fileWritingTable) << "CSV file" << fileName + extension; - - if (!config->GetWrt_Surface_Overwrite()) - (*fileWritingTable) << "CSV file + iter" << filename_iter + extension; - } - + LogOutputFiles("CSV file"); fileWriter = new CSU2FileWriter(surfaceDataSorter); break; @@ -380,16 +385,9 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form fileName = config->GetFilename(restartFilename, "", curTimeIter); if (!config->GetWrt_Restart_Overwrite()) - filename_iter = config->GetFilename_Iter(fileName,curInnerIter, curOuterIter); - - - if (rank == MASTER_NODE) { - (*fileWritingTable) << "SU2 ASCII restart" << fileName + extension; - - if (!config->GetWrt_Restart_Overwrite()) - (*fileWritingTable) << "SU2 ASCII restart + iter" << filename_iter + extension; - } + filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter); + LogOutputFiles("SU2 ASCII restart"); fileWriter = new CSU2FileWriter(volumeDataSorter); break; @@ -402,20 +400,11 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form fileName = config->GetFilename(restartFilename, "", curTimeIter); if (!config->GetWrt_Restart_Overwrite()) - filename_iter = config->GetFilename_Iter(fileName,curInnerIter, curOuterIter); - - - if (rank == MASTER_NODE) { - (*fileWritingTable) << "SU2 binary restart" << fileName + extension; - - if (!config->GetWrt_Restart_Overwrite()) - (*fileWritingTable) << "SU2 binary restart + iter" << filename_iter + extension; - - } + filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter); + LogOutputFiles("SU2 binary restart"); fileWriter = new CSU2BinaryFileWriter(volumeDataSorter); - break; case OUTPUT_TYPE::MESH: @@ -426,23 +415,14 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form fileName = volumeFilename; if (!config->GetWrt_Volume_Overwrite()) - filename_iter = config->GetFilename_Iter(fileName,curInnerIter, curOuterIter); + filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter); /*--- Load and sort the output data and connectivity. ---*/ volumeDataSorter->SortConnectivity(config, geometry, true); - /*--- Set the mesh ASCII format ---*/ - if (rank == MASTER_NODE) { - (*fileWritingTable) << "SU2 mesh" << fileName + extension; - - if (!config->GetWrt_Volume_Overwrite()) - (*fileWritingTable) << "SU2 mesh + iter" << filename_iter + extension; - } - - fileWriter = new CSU2MeshFileWriter(volumeDataSorter, - config->GetiZone(), config->GetnZone()); - + LogOutputFiles("SU2 mesh"); + fileWriter = new CSU2MeshFileWriter(volumeDataSorter, config->GetiZone(), config->GetnZone()); break; @@ -454,22 +434,14 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form fileName = config->GetFilename(volumeFilename, "", curTimeIter); if (!config->GetWrt_Volume_Overwrite()) - filename_iter = config->GetFilename_Iter(fileName,curInnerIter, curOuterIter); + filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter); /*--- Load and sort the output data and connectivity. ---*/ volumeDataSorter->SortConnectivity(config, geometry, false); - /*--- Write tecplot binary ---*/ - if (rank == MASTER_NODE) { - (*fileWritingTable) << "Tecplot binary" << fileName + extension; - - if (!config->GetWrt_Volume_Overwrite()) - (*fileWritingTable) << "Tecplot binary + iter" << filename_iter + extension; - } - - fileWriter = new CTecplotBinaryFileWriter(volumeDataSorter, - curTimeIter, GetHistoryFieldValue("TIME_STEP")); + LogOutputFiles("Tecplot binary"); + fileWriter = new CTecplotBinaryFileWriter(volumeDataSorter, curTimeIter, GetHistoryFieldValue("TIME_STEP")); break; @@ -481,22 +453,14 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form fileName = config->GetFilename(volumeFilename, "", curTimeIter); if (!config->GetWrt_Volume_Overwrite()) - filename_iter = config->GetFilename_Iter(fileName,curInnerIter, curOuterIter); + filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter); /*--- Load and sort the output data and connectivity. ---*/ volumeDataSorter->SortConnectivity(config, geometry, true); - /*--- Write tecplot ascii ---*/ - if (rank == MASTER_NODE) { - (*fileWritingTable) << "Tecplot ASCII" << fileName + extension; - - if (!config->GetWrt_Volume_Overwrite()) - (*fileWritingTable) << "Tecplot ASCII + iter" << filename_iter + extension; - } - - fileWriter = new CTecplotFileWriter(volumeDataSorter, - curTimeIter, GetHistoryFieldValue("TIME_STEP")); + LogOutputFiles("Tecplot ASCII"); + fileWriter = new CTecplotFileWriter(volumeDataSorter, curTimeIter, GetHistoryFieldValue("TIME_STEP")); break; @@ -508,20 +472,13 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form fileName = config->GetFilename(volumeFilename, "", curTimeIter); if (!config->GetWrt_Volume_Overwrite()) - filename_iter = config->GetFilename_Iter(fileName,curInnerIter, curOuterIter); + filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter); /*--- Load and sort the output data and connectivity. ---*/ volumeDataSorter->SortConnectivity(config, geometry, true); - /*--- Write paraview binary ---*/ - if (rank == MASTER_NODE) { - (*fileWritingTable) << "Paraview" << fileName + extension; - - if (!config->GetWrt_Volume_Overwrite()) - (*fileWritingTable) << "Paraview + iter" << filename_iter + extension; - } - + LogOutputFiles("Paraview"); fileWriter = new CParaviewXMLFileWriter(volumeDataSorter); break; @@ -534,65 +491,44 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form fileName = config->GetFilename(volumeFilename, "", curTimeIter); if (!config->GetWrt_Volume_Overwrite()) - filename_iter = config->GetFilename_Iter(fileName,curInnerIter, curOuterIter); + filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter); /*--- Load and sort the output data and connectivity. ---*/ volumeDataSorter->SortConnectivity(config, geometry, true); - /*--- Write paraview binary ---*/ - if (rank == MASTER_NODE) { - (*fileWritingTable) << "Paraview binary (legacy)" << fileName + extension; - - if (!config->GetWrt_Volume_Overwrite()) - (*fileWritingTable) << "Paraview binary + iter" << filename_iter + extension; - } - + LogOutputFiles("Paraview binary (legacy)"); fileWriter = new CParaviewBinaryFileWriter(volumeDataSorter); break; case OUTPUT_TYPE::PARAVIEW_MULTIBLOCK: { - extension = CParaviewVTMFileWriter::fileExt; - /*--- The file name of the multiblock file is the case name (i.e. the config file name w/o ext.) ---*/ - - fileName = config->GetUnsteady_FileName(config->GetCaseName(), curTimeIter, ""); + if (fileName.empty()) + fileName = config->GetUnsteady_FileName(volumeFilename, curTimeIter, ""); if (!config->GetWrt_Volume_Overwrite()) - filename_iter = config->GetFilename_Iter(fileName,curInnerIter, curOuterIter); + filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter); /*--- Sort volume connectivity ---*/ volumeDataSorter->SortConnectivity(config, geometry, true); - if (rank == MASTER_NODE) { - (*fileWritingTable) << "Paraview Multiblock" << fileName + extension; - - if (!config->GetWrt_Volume_Overwrite()) - (*fileWritingTable) << "Paraview Multiblock + iter" << filename_iter + extension; - } - - /*--- Allocate the vtm file writer (using fileName as the folder name) ---*/ - - fileWriter = new CParaviewVTMFileWriter(GetHistoryFieldValue("CUR_TIME"), - config->GetiZone(), config->GetnZone()); + LogOutputFiles("Paraview Multiblock"); + fileWriter = new CParaviewVTMFileWriter(GetHistoryFieldValue("CUR_TIME"), config->GetiZone(), config->GetnZone()); /*--- We cast the pointer to its true type, to avoid virtual functions ---*/ - - CParaviewVTMFileWriter* vtmWriter = dynamic_cast(fileWriter); + auto* vtmWriter = dynamic_cast(fileWriter); /*--- then we write the data into the folder---*/ - vtmWriter->WriteFolderData(fileName, config, multiZoneHeaderString, volumeDataSorter,surfaceDataSorter, geometry); + vtmWriter->WriteFolderData(fileName, config, multiZoneHeaderString, volumeDataSorter, surfaceDataSorter, geometry); /*--- and we write the data into the folder with the iteration number ---*/ if (!config->GetWrt_Volume_Overwrite()) - vtmWriter->WriteFolderData(filename_iter, config, multiZoneHeaderString, volumeDataSorter,surfaceDataSorter, geometry); - + vtmWriter->WriteFolderData(filename_iter, config, multiZoneHeaderString, volumeDataSorter, surfaceDataSorter, geometry); } - break; case OUTPUT_TYPE::PARAVIEW_ASCII: @@ -603,21 +539,13 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form fileName = config->GetFilename(volumeFilename, "", curTimeIter); if (!config->GetWrt_Volume_Overwrite()) - filename_iter = config->GetFilename_Iter(fileName,curInnerIter, curOuterIter); - + filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter); /*--- Load and sort the output data and connectivity. ---*/ volumeDataSorter->SortConnectivity(config, geometry, true); - /*--- Write paraview ascii ---*/ - if (rank == MASTER_NODE) { - (*fileWritingTable) << "Paraview ASCII" << fileName + extension; - - if (!config->GetWrt_Volume_Overwrite()) - (*fileWritingTable) << "Paraview ASCII + iter" << filename_iter + extension; - } - + LogOutputFiles("Paraview ASCII"); fileWriter = new CParaviewFileWriter(volumeDataSorter); break; @@ -630,50 +558,34 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form fileName = config->GetFilename(surfaceFilename, "", curTimeIter); if (!config->GetWrt_Surface_Overwrite()) - filename_iter = config->GetFilename_Iter(fileName,curInnerIter, curOuterIter); - + filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter); /*--- Load and sort the output data and connectivity. ---*/ surfaceDataSorter->SortConnectivity(config, geometry); surfaceDataSorter->SortOutputData(); - /*--- Write surface paraview ascii ---*/ - if (rank == MASTER_NODE) { - (*fileWritingTable) << "Paraview ASCII surface" << fileName + extension; - - if (!config->GetWrt_Surface_Overwrite()) - (*fileWritingTable) << "Paraview ASCII + iter" << filename_iter + extension; - } - + LogOutputFiles("Paraview ASCII surface"); fileWriter = new CParaviewFileWriter(surfaceDataSorter); break; case OUTPUT_TYPE::SURFACE_PARAVIEW_LEGACY_BINARY: - extension = CParaviewBinaryFileWriter::fileExt; + extension = CParaviewBinaryFileWriter::fileExt; if (fileName.empty()) fileName = config->GetFilename(surfaceFilename, "", curTimeIter); if (!config->GetWrt_Surface_Overwrite()) - filename_iter = config->GetFilename_Iter(fileName,curInnerIter, curOuterIter); - + filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter); /*--- Load and sort the output data and connectivity. ---*/ surfaceDataSorter->SortConnectivity(config, geometry); surfaceDataSorter->SortOutputData(); - /*--- Write surface paraview binary ---*/ - if (rank == MASTER_NODE) { - (*fileWritingTable) << "Paraview binary surface (legacy)" << fileName + extension; - - if (!config->GetWrt_Surface_Overwrite()) - (*fileWritingTable) << "Paraview binary surface + iter" << filename_iter + extension; - } - + LogOutputFiles("Paraview binary surface (legacy)"); fileWriter = new CParaviewBinaryFileWriter(surfaceDataSorter); break; @@ -686,53 +598,35 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form fileName = config->GetFilename(surfaceFilename, "", curTimeIter); if (!config->GetWrt_Surface_Overwrite()) - filename_iter = config->GetFilename_Iter(fileName,curInnerIter, curOuterIter); - + filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter); /*--- Load and sort the output data and connectivity. ---*/ surfaceDataSorter->SortConnectivity(config, geometry); surfaceDataSorter->SortOutputData(); - /*--- Write paraview binary ---*/ - if (rank == MASTER_NODE) { - (*fileWritingTable) << "Paraview surface" << fileName + extension; - - if (!config->GetWrt_Surface_Overwrite()) - (*fileWritingTable) << "Paraview surface + iter" << filename_iter + extension; - } - + LogOutputFiles("Paraview surface"); fileWriter = new CParaviewXMLFileWriter(surfaceDataSorter); break; case OUTPUT_TYPE::SURFACE_TECPLOT_ASCII: - extension = CTecplotFileWriter::fileExt; + extension = CTecplotFileWriter::fileExt; if (fileName.empty()) fileName = config->GetFilename(surfaceFilename, "", curTimeIter); if (!config->GetWrt_Surface_Overwrite()) - filename_iter = config->GetFilename_Iter(fileName,curInnerIter, curOuterIter); - + filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter); /*--- Load and sort the output data and connectivity. ---*/ surfaceDataSorter->SortConnectivity(config, geometry); surfaceDataSorter->SortOutputData(); - /*--- Write surface tecplot ascii ---*/ - if (rank == MASTER_NODE) { - (*fileWritingTable) << "Tecplot ASCII surface" << fileName + extension; - - if (!config->GetWrt_Surface_Overwrite()) - (*fileWritingTable) << "Tecplot ASCII surface + iter" << filename_iter + extension; - - } - - fileWriter = new CTecplotFileWriter(surfaceDataSorter, - curTimeIter, GetHistoryFieldValue("TIME_STEP")); + LogOutputFiles("Tecplot ASCII surface"); + fileWriter = new CTecplotFileWriter(surfaceDataSorter, curTimeIter, GetHistoryFieldValue("TIME_STEP")); break; @@ -744,25 +638,15 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form fileName = config->GetFilename(surfaceFilename, "", curTimeIter); if (!config->GetWrt_Surface_Overwrite()) - filename_iter = config->GetFilename_Iter(fileName,curInnerIter, curOuterIter); - + filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter); /*--- Load and sort the output data and connectivity. ---*/ surfaceDataSorter->SortConnectivity(config, geometry); surfaceDataSorter->SortOutputData(); - /*--- Write surface tecplot binary ---*/ - if (rank == MASTER_NODE) { - (*fileWritingTable) << "Tecplot binary surface" << fileName + extension; - - if (!config->GetWrt_Surface_Overwrite()) - (*fileWritingTable) << "Tecplot binary surface + iter" << filename_iter + extension; - - } - - fileWriter = new CTecplotBinaryFileWriter(surfaceDataSorter, - curTimeIter, GetHistoryFieldValue("TIME_STEP")); + LogOutputFiles("Tecplot binary surface"); + fileWriter = new CTecplotBinaryFileWriter(surfaceDataSorter, curTimeIter, GetHistoryFieldValue("TIME_STEP")); break; @@ -774,23 +658,13 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form fileName = config->GetFilename(surfaceFilename, "", curTimeIter); if (!config->GetWrt_Surface_Overwrite()) - filename_iter = config->GetFilename_Iter(fileName,curInnerIter, curOuterIter); - + filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter); /*--- Load and sort the output data and connectivity. ---*/ - surfaceDataSorter->SortConnectivity(config, geometry); surfaceDataSorter->SortOutputData(); - /*--- Write ASCII STL ---*/ - if (rank == MASTER_NODE) { - (*fileWritingTable) << "STL ASCII" << fileName + extension; - - if (!config->GetWrt_Surface_Overwrite()) - (*fileWritingTable) << "STL ASCII + iter" << filename_iter + extension; - - } - + LogOutputFiles("STL ASCII"); fileWriter = new CSTLFileWriter(surfaceDataSorter); break; @@ -803,21 +677,12 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form fileName = config->GetFilename(volumeFilename, "", curTimeIter); if (!config->GetWrt_Volume_Overwrite()) - filename_iter = config->GetFilename_Iter(fileName,curInnerIter, curOuterIter); - + filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter); /*--- Load and sort the output data and connectivity. ---*/ volumeDataSorter->SortConnectivity(config, geometry, true); - /*--- Write CGNS ---*/ - if (rank == MASTER_NODE) { - (*fileWritingTable) << "CGNS" << fileName + extension; - - if (!config->GetWrt_Volume_Overwrite()) - (*fileWritingTable) << "CGNS + iter" << filename_iter + extension; - - } - + LogOutputFiles("CGNS"); fileWriter = new CCGNSFileWriter(volumeDataSorter); break; @@ -830,22 +695,13 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form fileName = config->GetFilename(surfaceFilename, "", curTimeIter); if (!config->GetWrt_Surface_Overwrite()) - filename_iter = config->GetFilename_Iter(fileName,curInnerIter, curOuterIter); - + filename_iter = config->GetFilename_Iter(fileName, curInnerIter, curOuterIter); /*--- Load and sort the output data and connectivity. ---*/ surfaceDataSorter->SortConnectivity(config, geometry); surfaceDataSorter->SortOutputData(); - /*--- Write SURFACE_CGNS ---*/ - if (rank == MASTER_NODE) { - (*fileWritingTable) << "CGNS surface" << fileName + extension; - - if (!config->GetWrt_Surface_Overwrite()) - (*fileWritingTable) << "CGNS surface + iter" << filename_iter + extension; - - } - + LogOutputFiles("CGNS surface"); fileWriter = new CCGNSFileWriter(surfaceDataSorter, true); break; @@ -854,29 +710,27 @@ void COutput::WriteToFile(CConfig *config, CGeometry *geometry, OUTPUT_TYPE form break; } - if (fileWriter != nullptr){ + if (fileWriter != nullptr) { /*--- Write data to file ---*/ - fileWriter->Write_Data(fileName); - - su2double BandWidth = fileWriter->Get_Bandwidth(); + fileWriter->WriteData(fileName); - /*--- Write data with iteration number to file ---*/ + su2double BandWidth = fileWriter->GetBandwidth(); - if (!filename_iter.empty() && !config->GetWrt_Restart_Overwrite()){ - fileWriter->Write_Data(filename_iter); + /*--- Write data with iteration number to file if required ---*/ - /*--- overwrite bandwidth ---*/ - BandWidth = fileWriter->Get_Bandwidth(); + if (!filename_iter.empty()) { + fileWriter->WriteData(filename_iter); + /*--- Average bandwidth ---*/ + BandWidth = (BandWidth + fileWriter->GetBandwidth()) / 2; } + /*--- Compute and store the bandwidth ---*/ - /*--- Compute and store the bandwidth ---*/ - - if (format == OUTPUT_TYPE::RESTART_BINARY){ - config->SetRestart_Bandwidth_Agg(config->GetRestart_Bandwidth_Agg()+BandWidth); + if (format == OUTPUT_TYPE::RESTART_BINARY) { + config->SetRestart_Bandwidth_Agg(config->GetRestart_Bandwidth_Agg() + BandWidth); } if (config->GetWrt_Performance() && (rank == MASTER_NODE)){ @@ -903,7 +757,7 @@ bool COutput::GetCauchyCorrectedTimeConvergence(const CConfig *config){ return TimeConvergence; } -bool COutput::SetResult_Files(CGeometry *geometry, CConfig *config, CSolver** solver_container, +bool COutput::SetResultFiles(CGeometry *geometry, CConfig *config, CSolver** solver_container, unsigned long iter, bool force_writing) { bool isFileWrite = false, dataIsLoaded = false; @@ -918,7 +772,7 @@ bool COutput::SetResult_Files(CGeometry *geometry, CConfig *config, CSolver** so /*--- Collect the volume data from the solvers. * If time-domain is enabled, we also load the data although we don't output it, * since we might want to do time-averaging. ---*/ - const bool write_file = WriteVolume_Output(config, iter, force_writing || cauchyTimeConverged, iFile); + const bool write_file = WriteVolumeOutput(config, iter, force_writing || cauchyTimeConverged, iFile); if ((write_file || config->GetTime_Domain()) && !dataIsLoaded) { LoadDataIntoSorter(config, geometry, solver_container); @@ -987,7 +841,7 @@ void COutput::PrintConvergenceSummary(){ ConvSummary.PrintFooter(); } -bool COutput::Convergence_Monitoring(CConfig *config, unsigned long Iteration) { +bool COutput::ConvergenceMonitoring(CConfig *config, unsigned long Iteration) { convergence = true; @@ -1124,8 +978,7 @@ bool COutput::MonitorTimeConvergence(CConfig *config, unsigned long TimeIteratio } WndCauchy_Value /= nWndCauchy_Elems; } - if (WndCauchy_Value >= wndCauchyEps){fieldConverged = false;} - else{fieldConverged = true;} + fieldConverged = WndCauchy_Value < wndCauchyEps; /*--- Start monitoring only if the current iteration is larger than the * number of cauchy elements and the number of start-up iterations ---*/ @@ -1146,7 +999,7 @@ bool COutput::MonitorTimeConvergence(CConfig *config, unsigned long TimeIteratio return TimeConvergence; } -void COutput::SetHistoryFile_Header(const CConfig *config) { +void COutput::SetHistoryFileHeader(const CConfig *config) { unsigned short iField_Output = 0, iReqField = 0, @@ -1190,7 +1043,7 @@ void COutput::SetHistoryFile_Header(const CConfig *config) { } -void COutput::SetHistoryFile_Output(const CConfig *config) { +void COutput::SetHistoryFileOutput(const CConfig *config) { if (requestedHistoryFieldCache.empty()) { for (const auto& fieldIdentifier : historyOutput_List){ @@ -1222,14 +1075,14 @@ void COutput::SetHistoryFile_Output(const CConfig *config) { histFile.flush(); } -void COutput::SetScreen_Header(const CConfig *config) { +void COutput::SetScreenHeader(const CConfig *config) { if (config->GetMultizone_Problem()) multiZoneHeaderTable->PrintHeader(); convergenceTable->PrintHeader(); } -void COutput::SetScreen_Output(const CConfig *config) { +void COutput::SetScreenOutput(const CConfig *config) { if (requestedScreenFieldCache.empty()) { for (const auto& RequestedField : requestedScreenFields) { @@ -1287,7 +1140,7 @@ void COutput::PreprocessHistoryOutput(CConfig *config, bool wrt){ /*--- Postprocess the history fields. Creates new fields based on the ones set in the child classes ---*/ - Postprocess_HistoryFields(config); + PostprocessHistoryFields(config); /*--- We use a fixed size of the file output summary table ---*/ @@ -1334,7 +1187,7 @@ void COutput::PreprocessMultizoneHistoryOutput(COutput **output, CConfig **confi /*--- Postprocess the history fields. Creates new fields based on the ones set in the child classes ---*/ - Postprocess_HistoryFields(driver_config); + PostprocessHistoryFields(driver_config); /*--- We use a fixed size of the file output summary table ---*/ @@ -1383,7 +1236,7 @@ void COutput::PrepareHistoryFile(CConfig *config){ /*--- Add the header to the history file. ---*/ - SetHistoryFile_Header(config); + SetHistoryFileHeader(config); } @@ -1596,13 +1449,13 @@ void COutput::PreprocessVolumeOutput(CConfig *config){ /*---Coordinates and solution groups must be always in the output. * If they are not requested, add them here. ---*/ - vector::iterator itCoord = std::find(requestedVolumeFields.begin(), + auto itCoord = std::find(requestedVolumeFields.begin(), requestedVolumeFields.end(), "COORDINATES"); if (itCoord == requestedVolumeFields.end()){ requestedVolumeFields.emplace_back("COORDINATES"); nRequestedVolumeFields++; } - vector::iterator itSol = std::find(requestedVolumeFields.begin(), + auto itSol = std::find(requestedVolumeFields.begin(), requestedVolumeFields.end(), "SOLUTION"); if (itSol == requestedVolumeFields.end()){ requestedVolumeFields.emplace_back("SOLUTION"); @@ -1699,7 +1552,7 @@ void COutput::LoadDataIntoSorter(CConfig* config, CGeometry* geometry, CSolver** /*--- Create an object of the class CMeshFEM_DG and retrieve the necessary geometrical information for the FEM DG solver. ---*/ - CMeshFEM_DG *DGGeometry = dynamic_cast(geometry); + auto *DGGeometry = dynamic_cast(geometry); unsigned long nVolElemOwned = DGGeometry->GetNVolElemOwned(); @@ -1762,7 +1615,7 @@ void COutput::LoadDataIntoSorter(CConfig* config, CGeometry* geometry, CSolver** } } -void COutput::SetVolumeOutputValue(string name, unsigned long iPoint, su2double value){ +void COutput::SetVolumeOutputValue(const string& name, unsigned long iPoint, su2double value){ if (buildFieldIndexCache){ @@ -1774,7 +1627,7 @@ void COutput::SetVolumeOutputValue(string name, unsigned long iPoint, su2double const short Offset = volumeOutput_Map.at(name).offset; fieldIndexCache.push_back(Offset); if (Offset != -1){ - volumeDataSorter->SetUnsorted_Data(iPoint, Offset, value); + volumeDataSorter->SetUnsortedData(iPoint, Offset, value); } } else { SU2_MPI::Error(string("Cannot find output field with name ") + name, CURRENT_FUNCTION); @@ -1785,7 +1638,7 @@ void COutput::SetVolumeOutputValue(string name, unsigned long iPoint, su2double const short Offset = fieldIndexCache[cachePosition++]; if (Offset != -1){ - volumeDataSorter->SetUnsorted_Data(iPoint, Offset, value); + volumeDataSorter->SetUnsortedData(iPoint, Offset, value); } if (cachePosition == fieldIndexCache.size()){ cachePosition = 0; @@ -1794,7 +1647,7 @@ void COutput::SetVolumeOutputValue(string name, unsigned long iPoint, su2double } -su2double COutput::GetVolumeOutputValue(string name, unsigned long iPoint){ +su2double COutput::GetVolumeOutputValue(const string& name, unsigned long iPoint){ if (buildFieldIndexCache){ @@ -1806,7 +1659,7 @@ su2double COutput::GetVolumeOutputValue(string name, unsigned long iPoint){ const short Offset = volumeOutput_Map.at(name).offset; fieldGetIndexCache.push_back(Offset); if (Offset != -1){ - return volumeDataSorter->GetUnsorted_Data(iPoint, Offset); + return volumeDataSorter->GetUnsortedData(iPoint, Offset); } } else { SU2_MPI::Error(string("Cannot find output field with name ") + name, CURRENT_FUNCTION); @@ -1821,14 +1674,14 @@ su2double COutput::GetVolumeOutputValue(string name, unsigned long iPoint){ curGetFieldIndex = 0; } if (Offset != -1){ - return volumeDataSorter->GetUnsorted_Data(iPoint, Offset); + return volumeDataSorter->GetUnsortedData(iPoint, Offset); } } return 0.0; } -void COutput::SetAvgVolumeOutputValue(string name, unsigned long iPoint, su2double value){ +void COutput::SetAvgVolumeOutputValue(const string& name, unsigned long iPoint, su2double value){ const su2double scaling = 1.0 / su2double(curAbsTimeIter + 1); @@ -1843,10 +1696,10 @@ void COutput::SetAvgVolumeOutputValue(string name, unsigned long iPoint, su2doub fieldIndexCache.push_back(Offset); if (Offset != -1){ - const su2double old_value = volumeDataSorter->GetUnsorted_Data(iPoint, Offset); + const su2double old_value = volumeDataSorter->GetUnsortedData(iPoint, Offset); const su2double new_value = value * scaling + old_value *( 1.0 - scaling); - volumeDataSorter->SetUnsorted_Data(iPoint, Offset, new_value); + volumeDataSorter->SetUnsortedData(iPoint, Offset, new_value); } } else { SU2_MPI::Error(string("Cannot find output field with name ") + name, CURRENT_FUNCTION); @@ -1858,10 +1711,10 @@ void COutput::SetAvgVolumeOutputValue(string name, unsigned long iPoint, su2doub const short Offset = fieldIndexCache[cachePosition++]; if (Offset != -1){ - const su2double old_value = volumeDataSorter->GetUnsorted_Data(iPoint, Offset); + const su2double old_value = volumeDataSorter->GetUnsortedData(iPoint, Offset); const su2double new_value = value * scaling + old_value *( 1.0 - scaling); - volumeDataSorter->SetUnsorted_Data(iPoint, Offset, new_value); + volumeDataSorter->SetUnsortedData(iPoint, Offset, new_value); } if (cachePosition == fieldIndexCache.size()){ cachePosition = 0; @@ -1870,7 +1723,7 @@ void COutput::SetAvgVolumeOutputValue(string name, unsigned long iPoint, su2doub } -void COutput::Postprocess_HistoryData(CConfig *config){ +void COutput::PostprocessHistoryData(CConfig *config){ map > Average; map Count; @@ -1879,7 +1732,7 @@ void COutput::Postprocess_HistoryData(CConfig *config){ const string &fieldIdentifier = historyOutput_List[iField]; const HistoryOutputField ¤tField = historyOutput_Map.at(fieldIdentifier); if (currentField.fieldType == HistoryFieldType::RESIDUAL){ - if ( SetInit_Residuals(config) || (currentField.value > initialResiduals[fieldIdentifier]) ) { + if ( SetInitResiduals(config) || (currentField.value > initialResiduals[fieldIdentifier]) ) { initialResiduals[fieldIdentifier] = currentField.value; } SetHistoryOutputValue("REL_" + fieldIdentifier, @@ -1897,7 +1750,7 @@ void COutput::Postprocess_HistoryData(CConfig *config){ it = windowedTimeAverages.insert({fieldIdentifier, CWindowedAverage(config->GetKindWindow())}).first; } auto& timeAverage = it->second; - timeAverage.addValue(currentField.value,config->GetTimeIter(), config->GetStartWindowIteration()); //Collecting Values for Windowing + timeAverage.AddValue(currentField.value,config->GetTimeIter(), config->GetStartWindowIteration()); //Collecting Values for Windowing SetHistoryOutputValue("TAVG_" + fieldIdentifier, timeAverage.GetVal()); if (config->GetDirectDiff() != NO_DERIVATIVE) { SetHistoryOutputValue("D_TAVG_" + fieldIdentifier, SU2_TYPE::GetDerivative(timeAverage.GetVal())); @@ -1909,7 +1762,7 @@ void COutput::Postprocess_HistoryData(CConfig *config){ } } - map >::iterator it = Average.begin(); + auto it = Average.begin(); for (it = Average.begin(); it != Average.end(); it++){ const su2double& value = it->second.first; const int& count = it->second.second; @@ -1919,7 +1772,7 @@ void COutput::Postprocess_HistoryData(CConfig *config){ } } -void COutput::Postprocess_HistoryFields(CConfig *config){ +void COutput::PostprocessHistoryFields(CConfig *config){ map Average; map AverageGroupName = {{"BGS_RES", "bgs"},{"RMS_RES","rms"},{"MAX_RES", "max"}}; @@ -1934,7 +1787,7 @@ void COutput::Postprocess_HistoryFields(CConfig *config){ } } - map::iterator it = Average.begin(); + auto it = Average.begin(); for (it = Average.begin(); it != Average.end(); it++){ if (AverageGroupName.count(it->first) > 0) { AddHistoryOutput("AVG_" + it->first, "avg[" + AverageGroupName[it->first] + "]", ScreenOutputFormat::FIXED, @@ -1996,7 +1849,7 @@ void COutput::Postprocess_HistoryFields(CConfig *config){ } } -bool COutput::WriteScreen_Header(const CConfig *config) { +bool COutput::WriteScreenHeader(const CConfig *config) { unsigned long RestartIter = 0; @@ -2048,7 +1901,7 @@ bool COutput::WriteScreen_Header(const CConfig *config) { return false; } -bool COutput::WriteScreen_Output(const CConfig *config) { +bool COutput::WriteScreenOutput(const CConfig *config) { unsigned long ScreenWrt_Freq_Inner = config->GetScreen_Wrt_Freq(2); unsigned long ScreenWrt_Freq_Outer = config->GetScreen_Wrt_Freq(1); @@ -2089,7 +1942,7 @@ bool COutput::WriteScreen_Output(const CConfig *config) { } -bool COutput::WriteHistoryFile_Output(const CConfig *config) { +bool COutput::WriteHistoryFileOutput(const CConfig *config) { unsigned long HistoryWrt_Freq_Inner = config->GetHistory_Wrt_Freq(2); unsigned long HistoryWrt_Freq_Outer = config->GetHistory_Wrt_Freq(1); @@ -2130,15 +1983,14 @@ bool COutput::WriteHistoryFile_Output(const CConfig *config) { } -bool COutput::WriteVolume_Output(CConfig *config, unsigned long Iter, bool force_writing, unsigned short iFile){ +bool COutput::WriteVolumeOutput(CConfig *config, unsigned long Iter, bool force_writing, unsigned short iFile){ if (config->GetTime_Domain()){ return ((Iter % config->GetVolumeOutputFrequency(iFile) == 0)) || force_writing; } - else { - return ((Iter > 0) && (Iter % config->GetVolumeOutputFrequency(iFile) == 0)) || force_writing; - } + return ((Iter > 0) && (Iter % config->GetVolumeOutputFrequency(iFile) == 0)) || force_writing; + } void COutput::SetCommonHistoryFields() { @@ -2255,7 +2107,7 @@ void COutput::SetCustomOutputs(const CConfig* config) { break; } - customOutputs.push_back(CustomOutput()); + customOutputs.emplace_back(); auto& output = customOutputs.back(); output.name = std::move(name); @@ -2267,7 +2119,7 @@ void COutput::SetCustomOutputs(const CConfig* config) { #endif if (type == OperationType::FUNCTION) { - AddHistoryOutput(output.name, output.name, ScreenOutputFormat::SCIENTIFIC, "CUSTOM", "Custom output"); + AddHistoryOutput(output.name, output.name, ScreenOutputFormat::SCIENTIFIC, "CUSTOM", "Custom output", HistoryFieldType::COEFFICIENT); break; } @@ -2284,12 +2136,52 @@ void COutput::SetCustomOutputs(const CConfig* config) { /*--- Skip the terminating "]". ---*/ if (it != last) ++it; - AddHistoryOutput(output.name, output.name, ScreenOutputFormat::SCIENTIFIC, "CUSTOM", "Custom output"); + AddHistoryOutput(output.name, output.name, ScreenOutputFormat::SCIENTIFIC, "CUSTOM", "Custom output", HistoryFieldType::COEFFICIENT); } } } +void COutput::ComputeSimpleCustomOutputs(const CConfig *config) { + const bool adjoint = config->GetDiscrete_Adjoint(); + + for (auto& output : customOutputs) { + if (output.type != OperationType::FUNCTION) { + if (adjoint) continue; + SU2_MPI::Error("The current solver can only use 'Function' custom outputs.", CURRENT_FUNCTION); + } + + if (output.varIndices.empty()) { + output.varIndices.reserve(output.varSymbols.size()); + output.otherOutputs.reserve(output.varSymbols.size()); + + for (const auto& var : output.varSymbols) { + output.varIndices.push_back(output.varIndices.size()); + output.otherOutputs.push_back(GetPtrToHistoryOutput(var)); + if (output.otherOutputs.back() == nullptr) { + if (!adjoint) { + // In primal mode all functions must be valid. + SU2_MPI::Error("Invalid history output (" + var + ") used in function " + output.name, CURRENT_FUNCTION); + } else { + if (rank == MASTER_NODE) { + std::cout << "Info: Ignoring function " + output.name + " because it may be used by the primal/adjoint " + "solver.\n If the function is ignored twice it is invalid." << std::endl; + } + output.skip = true; + break; + } + } + } + } + if (output.skip) continue; + + auto Functor = [&](unsigned long i) { + return *output.otherOutputs[i]; + }; + SetHistoryOutputValue(output.name, output.Eval(Functor)); + } +} + void COutput::LoadCommonHistoryData(const CConfig *config) { SetHistoryOutputValue("TIME_STEP", config->GetDelta_UnstTimeND()*config->GetTime_Ref()); @@ -2332,7 +2224,7 @@ void COutput::PrintHistoryFields() const { if (!perSurf) { Field = &historyOutput_Map.at(outputName); } else { - Field = &historyOutputPerSurface_Map.at(outputName)[0]; + Field = historyOutputPerSurface_Map.at(outputName).data(); } if (perSurf || !Field->description.empty()) { NameSize = std::max(NameSize, outputName.size()); @@ -2361,7 +2253,7 @@ void COutput::PrintHistoryFields() const { if (!perSurf) { Field = &historyOutput_Map.at(outputName); } else { - Field = &historyOutputPerSurface_Map.at(outputName)[0]; + Field = historyOutputPerSurface_Map.at(outputName).data(); } if (!perSurf && Field->description.empty()) continue; @@ -2420,7 +2312,7 @@ void COutput::PrintHistoryFields() const { break; } - if (Field.description != "") + if (!Field.description.empty()) ModifierTable << historyOutput_List[iField] << Field.outputGroup << type << Field.description; GroupVisited[Field.outputGroup] = true; @@ -2443,7 +2335,7 @@ void COutput::PrintVolumeFields(){ VolumeOutputField &Field = volumeOutput_Map.at(volumeOutput_List[iField]); - if (Field.description != ""){ + if (!Field.description.empty()){ if (volumeOutput_List[iField].size() > NameSize){ NameSize = volumeOutput_List[iField].size(); } @@ -2469,7 +2361,7 @@ void COutput::PrintVolumeFields(){ VolumeOutputField &Field = volumeOutput_Map.at(volumeOutput_List[iField]); - if (Field.description != "") + if (!Field.description.empty()) VolumeFieldTable << volumeOutput_List[iField] << Field.outputGroup << Field.description; } diff --git a/SU2_CFD/src/output/COutputFactory.cpp b/SU2_CFD/src/output/COutputFactory.cpp index fe0de7c9397..e0cab769441 100644 --- a/SU2_CFD/src/output/COutputFactory.cpp +++ b/SU2_CFD/src/output/COutputFactory.cpp @@ -2,7 +2,7 @@ * \file COutputFactory.cpp * \brief Main subroutines for output solver information * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,7 +26,6 @@ */ #include "../../include/output/COutputFactory.hpp" -#include "../../include/output/COutputLegacy.hpp" #include "../../include/output/COutput.hpp" #include "../../include/output/CMultizoneOutput.hpp" #include "../../include/output/CElasticityOutput.hpp" @@ -90,12 +89,3 @@ COutput* COutputFactory::CreateMultizoneOutput(CConfig *driverConfig, CConfig** return output; } - -COutputLegacy* COutputFactory::CreateLegacyOutput(CConfig *config){ - - COutputLegacy* output = new COutputLegacy(config); - - return output; - -} - diff --git a/SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp b/SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp index 4f1cfcb41cd..34f75473b61 100644 --- a/SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CCGNSFileWriter.cpp @@ -2,7 +2,7 @@ * \file CCGNSFileWriter.cpp * \brief Filewriter class for CGNS format. * \author G. Baldan - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -32,7 +32,7 @@ const string CCGNSFileWriter::fileExt = ".cgns"; CCGNSFileWriter::CCGNSFileWriter(CParallelDataSorter* valDataSorter, bool isSurf) : CFileWriter(valDataSorter, fileExt), isSurface(isSurf) {} -void CCGNSFileWriter::Write_Data(string val_filename) { +void CCGNSFileWriter::WriteData(string val_filename) { #ifdef HAVE_CGNS @@ -77,7 +77,7 @@ void CCGNSFileWriter::Write_Data(string val_filename) { } #ifdef HAVE_CGNS -void CCGNSFileWriter::InitializeMeshFile(string val_filename) { +void CCGNSFileWriter::InitializeMeshFile(const string& val_filename) { if (!dataSorter->GetConnectivitySorted()) { SU2_MPI::Error("Connectivity must be sorted.", CURRENT_FUNCTION); } @@ -131,7 +131,7 @@ void CCGNSFileWriter::WriteField(int iField, const string& FieldName) { /*--- Coordinate vector is written in blocks, one for each process. ---*/ cgsize_t nodeBegin = 1; - cgsize_t nodeEnd = static_cast(nLocalPoints); + auto nodeEnd = static_cast(nLocalPoints); if (isCoord) { int CoordinateNumber; @@ -199,7 +199,7 @@ void CCGNSFileWriter::WriteConnectivity(GEO_TYPE type, const string& SectionName for (unsigned long iElem = 0; iElem < nLocalElem; iElem++) { for (unsigned long iPoint = 0; iPoint < nPointsElem; iPoint++) { sendBufferConnectivity[iPoint + nPointsElem * iElem] = - static_cast(dataSorter->GetElem_Connectivity(type, iElem, iPoint)); + static_cast(dataSorter->GetElemConnectivity(type, iElem, iPoint)); } } diff --git a/SU2_CFD/src/output/filewriter/CCSVFileWriter.cpp b/SU2_CFD/src/output/filewriter/CCSVFileWriter.cpp index b1dfef3f5d2..254bb48fce3 100644 --- a/SU2_CFD/src/output/filewriter/CCSVFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CCSVFileWriter.cpp @@ -2,7 +2,7 @@ * \file CCSVFileWriter.cpp * \brief CSV Writer output class * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -29,14 +29,12 @@ #include "../../../include/output/filewriter/CParallelDataSorter.hpp" CCSVFileWriter::CCSVFileWriter(CParallelDataSorter *valDataSorter) : - CFileWriter(valDataSorter, std::move(".csv")){} + CFileWriter(valDataSorter, ".csv"){} -CCSVFileWriter::~CCSVFileWriter(){ +CCSVFileWriter::~CCSVFileWriter()= default; -} - -void CCSVFileWriter::Write_Data(string val_filename){ +void CCSVFileWriter::WriteData(string val_filename){ /*--- Routine to write the surface CSV files (ASCII). We assume here that, as an ASCII file, it is safer to merge the @@ -79,10 +77,10 @@ void CCSVFileWriter::Write_Data(string val_filename){ /*--- Allocate buffers for send/recv of the data and global IDs. ---*/ - su2double *bufD_Send = new su2double[MaxLocalVertex_Surface*fieldNames.size()](); + auto *bufD_Send = new su2double[MaxLocalVertex_Surface*fieldNames.size()](); su2double *bufD_Recv = nullptr; - unsigned long *bufL_Send = new unsigned long [MaxLocalVertex_Surface](); + auto *bufL_Send = new unsigned long [MaxLocalVertex_Surface](); unsigned long *bufL_Recv = nullptr; /*--- Load send buffers with the local data on this rank. ---*/ diff --git a/SU2_CFD/src/output/filewriter/CFEMDataSorter.cpp b/SU2_CFD/src/output/filewriter/CFEMDataSorter.cpp index 0bb123b0c50..6d59f44fb71 100644 --- a/SU2_CFD/src/output/filewriter/CFEMDataSorter.cpp +++ b/SU2_CFD/src/output/filewriter/CFEMDataSorter.cpp @@ -2,7 +2,7 @@ * \file CFEMDataSorter.cpp * \brief Datasorter class for FEM solvers. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -37,7 +37,7 @@ CFEMDataSorter::CFEMDataSorter(CConfig *config, CGeometry *geometry, const vecto /*--- Create an object of the class CMeshFEM_DG and retrieve the necessary geometrical information for the FEM DG solver. ---*/ - CMeshFEM_DG *DGGeometry = dynamic_cast(geometry); + auto *DGGeometry = dynamic_cast(geometry); unsigned long nVolElemOwned = DGGeometry->GetNVolElemOwned(); CVolumeElementFEM *volElem = DGGeometry->GetVolElem(); @@ -126,7 +126,7 @@ void CFEMDataSorter::SortVolumetricConnectivity(CConfig *config, CGeometry *geom /*--- Create an object of the class CMeshFEM_DG and retrieve the necessary geometrical information for the FEM DG solver. ---*/ - CMeshFEM_DG *DGGeometry = dynamic_cast(geometry); + auto *DGGeometry = dynamic_cast(geometry); unsigned long nVolElemOwned = DGGeometry->GetNVolElemOwned(); CVolumeElementFEM *volElem = DGGeometry->GetVolElem(); diff --git a/SU2_CFD/src/output/filewriter/CFVMDataSorter.cpp b/SU2_CFD/src/output/filewriter/CFVMDataSorter.cpp index fc7c0f6c811..3e0a675eb93 100644 --- a/SU2_CFD/src/output/filewriter/CFVMDataSorter.cpp +++ b/SU2_CFD/src/output/filewriter/CFVMDataSorter.cpp @@ -2,7 +2,7 @@ * \file CFVMDataSorter.cpp * \brief Datasorter class for FVM solvers. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -258,10 +258,10 @@ void CFVMDataSorter::SortVolumetricConnectivity(CConfig *config, /*--- Create an index variable to keep track of our index position as we load up the send buffer. ---*/ - unsigned long *index = new unsigned long[size](); + auto *index = new unsigned long[size](); for (int ii=0; ii < size; ii++) index[ii] = NODES_PER_ELEMENT*nElem_Send[ii]; - unsigned long *haloIndex = new unsigned long[size](); + auto *haloIndex = new unsigned long[size](); for (int ii=0; ii < size; ii++) haloIndex[ii] = nElem_Send[ii]; /*--- Loop through our elements and load the elems and their diff --git a/SU2_CFD/src/output/filewriter/CParallelDataSorter.cpp b/SU2_CFD/src/output/filewriter/CParallelDataSorter.cpp index b11a4b24cde..69cc4182fb1 100644 --- a/SU2_CFD/src/output/filewriter/CParallelDataSorter.cpp +++ b/SU2_CFD/src/output/filewriter/CParallelDataSorter.cpp @@ -2,7 +2,7 @@ * \file CParallelDataSorter.cpp * \brief Datasorter base class. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -32,7 +32,7 @@ CParallelDataSorter::CParallelDataSorter(CConfig *config, const vector &valFieldNames) : rank(SU2_MPI::GetRank()), size(SU2_MPI::GetSize()), - fieldNames(std::move(valFieldNames)) { + fieldNames(valFieldNames) { GlobalField_Counter = fieldNames.size(); @@ -330,7 +330,7 @@ void CParallelDataSorter::PrepareSendBuffers(std::vector& globalI } -unsigned long CParallelDataSorter::GetElem_Connectivity(GEO_TYPE type, unsigned long iElem, unsigned long iNode) const { +unsigned long CParallelDataSorter::GetElemConnectivity(GEO_TYPE type, unsigned long iElem, unsigned long iNode) const { switch (type) { case LINE: diff --git a/SU2_CFD/src/output/filewriter/CParallelFileWriter.cpp b/SU2_CFD/src/output/filewriter/CParallelFileWriter.cpp index 1a4f8c5d5cb..c959a171615 100644 --- a/SU2_CFD/src/output/filewriter/CParallelFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CParallelFileWriter.cpp @@ -2,7 +2,7 @@ * \file CParallelFileWriter.cpp * \brief Filewriter base class. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -25,10 +25,12 @@ * License along with SU2. If not, see . */ +#include + #include "../../../include/output/filewriter/CFileWriter.hpp" CFileWriter::CFileWriter(CParallelDataSorter *valDataSorter, string valFileExt): - fileExt(valFileExt), + fileExt(std::move(valFileExt)), dataSorter(valDataSorter){ rank = SU2_MPI::GetRank(); @@ -40,7 +42,7 @@ CFileWriter::CFileWriter(CParallelDataSorter *valDataSorter, string valFileExt): } CFileWriter::CFileWriter(string valFileExt): - fileExt(valFileExt){ + fileExt(std::move(valFileExt)){ rank = SU2_MPI::GetRank(); size = SU2_MPI::GetSize(); @@ -50,9 +52,7 @@ CFileWriter::CFileWriter(string valFileExt): } -CFileWriter::~CFileWriter(){ - -} +CFileWriter::~CFileWriter()= default; bool CFileWriter::WriteMPIBinaryDataAll(const void *data, unsigned long sizeInBytes, unsigned long totalSizeInBytes, unsigned long offsetInBytes){ diff --git a/SU2_CFD/src/output/filewriter/CParaviewBinaryFileWriter.cpp b/SU2_CFD/src/output/filewriter/CParaviewBinaryFileWriter.cpp index aa22fb41f52..7675fdb7bd1 100644 --- a/SU2_CFD/src/output/filewriter/CParaviewBinaryFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CParaviewBinaryFileWriter.cpp @@ -2,7 +2,7 @@ * \file CParaviewBinaryFileWriter.cpp * \brief Filewriter class for Paraview binary format. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -39,16 +39,13 @@ CParaviewBinaryFileWriter::CParaviewBinaryFileWriter(CParallelDataSorter *valDat bigEndian = false; unsigned int i = 1; char *c = (char*)&i; - if (*c) bigEndian = false; - else bigEndian = true; + bigEndian = *c == 0; } -CParaviewBinaryFileWriter::~CParaviewBinaryFileWriter(){ +CParaviewBinaryFileWriter::~CParaviewBinaryFileWriter()= default; -} - -void CParaviewBinaryFileWriter::Write_Data(string val_filename){ +void CParaviewBinaryFileWriter::WriteData(string val_filename){ if (!dataSorter->GetConnectivitySorted()){ SU2_MPI::Error("Connectivity must be sorted.", CURRENT_FUNCTION); @@ -97,7 +94,7 @@ void CParaviewBinaryFileWriter::Write_Data(string val_filename){ if (nDim == 2 && iDim == 2) { dataBufferFloat[iPoint*NCOORDS + iDim] = 0.0; } else { - float val = (float)dataSorter->GetData(iDim, iPoint); + auto val = (float)dataSorter->GetData(iDim, iPoint); dataBufferFloat[iPoint*NCOORDS + iDim] = val; } } @@ -146,7 +143,7 @@ void CParaviewBinaryFileWriter::Write_Data(string val_filename){ for (iElem = 0; iElem < nElem; iElem++) { connBuf[iStorage+0] = nPoints; for (iNode = 0; iNode < nPoints; iNode++){ - connBuf[iStorage+iNode+1] = int(dataSorter->GetElem_Connectivity(type, iElem, iNode)-1); + connBuf[iStorage+iNode+1] = int(dataSorter->GetElemConnectivity(type, iElem, iNode)-1); } iStorage += nPoints + 1; } @@ -178,7 +175,7 @@ void CParaviewBinaryFileWriter::Write_Data(string val_filename){ /*--- Load/write the cell type for all elements in the file. ---*/ vector typeBuf(myElem); - vector::iterator typeIter = typeBuf.begin(); + auto typeIter = typeBuf.begin(); std::fill(typeIter, typeIter+nParallel_Line, LINE); typeIter += nParallel_Line; std::fill(typeIter, typeIter+nParallel_Tria, TRIANGLE); typeIter += nParallel_Tria; @@ -285,7 +282,7 @@ void CParaviewBinaryFileWriter::Write_Data(string val_filename){ This will be replaced with a derived data type most likely. ---*/ for (iPoint = 0; iPoint < myPoint; iPoint++) { - float val = (float)dataSorter->GetData(VarCounter,iPoint); + auto val = (float)dataSorter->GetData(VarCounter,iPoint); dataBufferFloat[iPoint] = val; } diff --git a/SU2_CFD/src/output/filewriter/CParaviewFileWriter.cpp b/SU2_CFD/src/output/filewriter/CParaviewFileWriter.cpp index 0b9d0ff41e0..d1d3f78a6bb 100644 --- a/SU2_CFD/src/output/filewriter/CParaviewFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CParaviewFileWriter.cpp @@ -2,7 +2,7 @@ * \file CParaviewFileWriter.cpp * \brief Filewriter class for Paraview ASCII format. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -33,9 +33,9 @@ CParaviewFileWriter::CParaviewFileWriter(CParallelDataSorter *valDataSorter) : CFileWriter(valDataSorter, fileExt){} -CParaviewFileWriter::~CParaviewFileWriter(){} +CParaviewFileWriter::~CParaviewFileWriter()= default; -void CParaviewFileWriter::Write_Data(string val_filename){ +void CParaviewFileWriter::WriteData(string val_filename){ /*--- We append the pre-defined suffix (extension) to the filename (prefix) ---*/ val_filename.append(fileExt); @@ -139,63 +139,63 @@ void CParaviewFileWriter::Write_Data(string val_filename){ for (iElem = 0; iElem < nParallel_Line; iElem++) { Paraview_File << N_POINTS_LINE << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(LINE, iElem, 0)-1 << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(LINE, iElem, 1)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(LINE, iElem, 0)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(LINE, iElem, 1)-1 << "\t"; } for (iElem = 0; iElem < nParallel_Tria; iElem++) { Paraview_File << N_POINTS_TRIANGLE << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 0)-1 << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 1)-1 << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(TRIANGLE, iElem, 0)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(TRIANGLE, iElem, 1)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(TRIANGLE, iElem, 2)-1 << "\t"; } for (iElem = 0; iElem < nParallel_Quad; iElem++) { Paraview_File << N_POINTS_QUADRILATERAL << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 0)-1 << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 1)-1 << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 2)-1 << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 3)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 0)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 1)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 2)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 3)-1 << "\t"; } for (iElem = 0; iElem < nParallel_Tetr; iElem++) { Paraview_File << N_POINTS_TETRAHEDRON << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 0)-1 << "\t" - << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 1)-1 << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 2)-1 << "\t" - << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 0)-1 << "\t" + << dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 1)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 2)-1 << "\t" + << dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 3)-1 << "\t"; } for (iElem = 0; iElem < nParallel_Hexa; iElem++) { Paraview_File << N_POINTS_HEXAHEDRON << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 0)-1 << "\t" - << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 1)-1 << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 2)-1 << "\t" - << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 3)-1 << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 4)-1 << "\t" - << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 5)-1 << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 6)-1 << "\t" - << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 7)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 0)-1 << "\t" + << dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 1)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 2)-1 << "\t" + << dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 3)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 4)-1 << "\t" + << dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 5)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 6)-1 << "\t" + << dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 7)-1 << "\t"; } for (iElem = 0; iElem < nParallel_Pris; iElem++) { Paraview_File << N_POINTS_PRISM << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(PRISM, iElem, 0)-1 << "\t" - << dataSorter->GetElem_Connectivity(PRISM, iElem, 1)-1 << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(PRISM, iElem, 2)-1 << "\t" - << dataSorter->GetElem_Connectivity(PRISM, iElem, 3)-1 << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(PRISM, iElem, 4)-1 << "\t" - << dataSorter->GetElem_Connectivity(PRISM, iElem, 5)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(PRISM, iElem, 0)-1 << "\t" + << dataSorter->GetElemConnectivity(PRISM, iElem, 1)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(PRISM, iElem, 2)-1 << "\t" + << dataSorter->GetElemConnectivity(PRISM, iElem, 3)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(PRISM, iElem, 4)-1 << "\t" + << dataSorter->GetElemConnectivity(PRISM, iElem, 5)-1 << "\t"; } for (iElem = 0; iElem < nParallel_Pyra; iElem++) { Paraview_File << N_POINTS_PYRAMID << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 0)-1 << "\t" - << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 1)-1 << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 2)-1 << "\t" - << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 3)-1 << "\t"; - Paraview_File << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(PYRAMID, iElem, 0)-1 << "\t" + << dataSorter->GetElemConnectivity(PYRAMID, iElem, 1)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(PYRAMID, iElem, 2)-1 << "\t" + << dataSorter->GetElemConnectivity(PYRAMID, iElem, 3)-1 << "\t"; + Paraview_File << dataSorter->GetElemConnectivity(PYRAMID, iElem, 4)-1 << "\t"; } } Paraview_File.flush(); @@ -362,7 +362,7 @@ void CParaviewFileWriter::Write_Data(string val_filename){ usedTime = stopTime-startTime; - fileSize = Determine_Filesize(val_filename); + fileSize = DetermineFilesize(val_filename); /*--- Compute and store the bandwidth ---*/ diff --git a/SU2_CFD/src/output/filewriter/CParaviewVTMFileWriter.cpp b/SU2_CFD/src/output/filewriter/CParaviewVTMFileWriter.cpp index 6e17ec84a01..5b4ba4299db 100644 --- a/SU2_CFD/src/output/filewriter/CParaviewVTMFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CParaviewVTMFileWriter.cpp @@ -2,7 +2,7 @@ * \file CParaviewVTMFileWriter.cpp * \brief Filewriter class for Paraview binary format. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -25,6 +25,8 @@ * License along with SU2. If not, see . */ +#include + #include "../../../include/output/filewriter/CParaviewVTMFileWriter.hpp" #include "../../../include/output/filewriter/CParaviewXMLFileWriter.hpp" #include "../../../../Common/include/toolboxes/printing_toolbox.hpp" @@ -43,11 +45,9 @@ CParaviewVTMFileWriter::CParaviewVTMFileWriter(su2double valTime, } -CParaviewVTMFileWriter::~CParaviewVTMFileWriter(){ - -} +CParaviewVTMFileWriter::~CParaviewVTMFileWriter()= default; -void CParaviewVTMFileWriter::Write_Data(string val_filename){ +void CParaviewVTMFileWriter::WriteData(string val_filename){ /*--- We append the pre-defined suffix (extension) to the filename (prefix) ---*/ val_filename.append(fileExt); @@ -63,7 +63,7 @@ void CParaviewVTMFileWriter::Write_Data(string val_filename){ multiBlockFile.open(val_filename.c_str(), ios::app); if (iZone == 0){ - multiBlockFile << "" << endl; + multiBlockFile << R"()" << endl; multiBlockFile << "" << endl; } @@ -87,7 +87,7 @@ void CParaviewVTMFileWriter::Write_Data(string val_filename){ } -void CParaviewVTMFileWriter::AddDataset(string foldername, string name, string file, CParallelDataSorter* dataSorter){ +void CParaviewVTMFileWriter::AddDataset(const string& foldername, string name, const string& file, CParallelDataSorter* dataSorter){ /*--- Construct the full file name incl. folder ---*/ /*--- Note that the folder name is simply the filename ---*/ @@ -97,24 +97,24 @@ void CParaviewVTMFileWriter::AddDataset(string foldername, string name, string f /*--- Create an XML writer and dump data into file ---*/ CParaviewXMLFileWriter XMLWriter(dataSorter); - XMLWriter.Write_Data(fullFilename); + XMLWriter.WriteData(fullFilename); /*--- Add the dataset to the vtm file ---*/ - AddDataset(name, fullFilename + CParaviewXMLFileWriter::fileExt); + AddDataset(std::move(name), fullFilename + CParaviewXMLFileWriter::fileExt); /*--- Update the bandwidth ---*/ nWrittenDatasets++; - accumulatedBandwidth += XMLWriter.Get_Bandwidth(); + accumulatedBandwidth += XMLWriter.GetBandwidth(); bandwidth = accumulatedBandwidth/nWrittenDatasets; } -void CParaviewVTMFileWriter::WriteFolderData(string foldername, CConfig *config, +void CParaviewVTMFileWriter::WriteFolderData(const string& foldername, CConfig *config, string multiZoneHeaderString, CParallelDataSorter* volumeDataSorter, CParallelDataSorter* surfaceDataSorter, @@ -133,7 +133,7 @@ void CParaviewVTMFileWriter::WriteFolderData(string foldername, CConfig *config, /*--- Open a block for the zone ---*/ - StartBlock(multiZoneHeaderString); + StartBlock(std::move(multiZoneHeaderString)); StartBlock("Internal"); AddDataset(foldername,"Internal", "Internal", volumeDataSorter); diff --git a/SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp b/SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp index fb1572744e8..df4ac46a176 100644 --- a/SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CParaviewXMLFileWriter.cpp @@ -2,7 +2,7 @@ * \file CParaviewXMLFileWriter.cpp * \brief Filewriter class for Paraview binary format. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -40,16 +40,13 @@ CParaviewXMLFileWriter::CParaviewXMLFileWriter(CParallelDataSorter *valDataSorte bigEndian = false; unsigned int i = 1; char *c = (char*)&i; - if (*c) bigEndian = false; - else bigEndian = true; + bigEndian = *c == 0; } -CParaviewXMLFileWriter::~CParaviewXMLFileWriter(){ +CParaviewXMLFileWriter::~CParaviewXMLFileWriter()= default; -} - -void CParaviewXMLFileWriter::Write_Data(string val_filename){ +void CParaviewXMLFileWriter::WriteData(string val_filename){ if (!dataSorter->GetConnectivitySorted()){ SU2_MPI::Error("Connectivity must be sorted.", CURRENT_FUNCTION); @@ -197,7 +194,7 @@ void CParaviewXMLFileWriter::Write_Data(string val_filename){ if (nDim == 2 && iDim == 2) { dataBufferFloat[iPoint*NCOORDS + iDim] = 0.0; } else { - float val = (float)dataSorter->GetData(iDim, iPoint); + auto val = (float)dataSorter->GetData(iDim, iPoint); dataBufferFloat[iPoint*NCOORDS + iDim] = val; } } @@ -216,7 +213,7 @@ void CParaviewXMLFileWriter::Write_Data(string val_filename){ auto copyToBuffer = [&](GEO_TYPE type, unsigned long nElem, unsigned short nPoints){ for (iElem = 0; iElem < nElem; iElem++) { for (iNode = 0; iNode < nPoints; iNode++){ - connBuf[iStorage+iNode] = int(dataSorter->GetElem_Connectivity(type, iElem, iNode)-1); + connBuf[iStorage+iNode] = int(dataSorter->GetElemConnectivity(type, iElem, iNode)-1); } iStorage += nPoints; offsetBuf[iElemID++] = int(iStorage + dataSorter->GetnElemConnCumulative(rank)); @@ -238,7 +235,7 @@ void CParaviewXMLFileWriter::Write_Data(string val_filename){ /*--- Load/write the cell type for all elements in the file. ---*/ vector typeBuf(myElem); - vector::iterator typeIter = typeBuf.begin(); + auto typeIter = typeBuf.begin(); std::fill(typeIter, typeIter+nParallel_Line, LINE); typeIter += nParallel_Line; std::fill(typeIter, typeIter+nParallel_Tria, TRIANGLE); typeIter += nParallel_Tria; @@ -306,7 +303,7 @@ void CParaviewXMLFileWriter::Write_Data(string val_filename){ This will be replaced with a derived data type most likely. ---*/ for (iPoint = 0; iPoint < myPoint; iPoint++) { - float val = (float)dataSorter->GetData(VarCounter,iPoint); + auto val = (float)dataSorter->GetData(VarCounter,iPoint); dataBufferFloat[iPoint] = val; } diff --git a/SU2_CFD/src/output/filewriter/CSTLFileWriter.cpp b/SU2_CFD/src/output/filewriter/CSTLFileWriter.cpp index 673e7727666..f9049f8f2f1 100644 --- a/SU2_CFD/src/output/filewriter/CSTLFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CSTLFileWriter.cpp @@ -2,7 +2,7 @@ * \file CSTLFileWriter.cpp * \brief STL Writer output class * \author T. Kattmann, T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -38,10 +38,10 @@ CSTLFileWriter::CSTLFileWriter(CParallelDataSorter *valDataSorter) : CFileWriter(valDataSorter, fileExt){} -CSTLFileWriter::~CSTLFileWriter(){} +CSTLFileWriter::~CSTLFileWriter()= default; -void CSTLFileWriter::Write_Data(string val_filename){ +void CSTLFileWriter::WriteData(string val_filename){ /*--- We append the pre-defined suffix (extension) to the filename (prefix) ---*/ val_filename.append(fileExt); @@ -133,12 +133,12 @@ void CSTLFileWriter::ReprocessElementConnectivity(){ /* Gather a list of nodes we refer to but are not outputting, because they are not present on this rank. */ for (unsigned long i = 0; i < nParallel_Tria * N_POINTS_TRIANGLE; ++i) - if (dataSorter->FindProcessor(dataSorter->GetElem_Connectivity(TRIANGLE, 0, i)-1) != rank) - halo_nodes.push_back(dataSorter->GetElem_Connectivity(TRIANGLE, 0, i)-1); + if (dataSorter->FindProcessor(dataSorter->GetElemConnectivity(TRIANGLE, 0, i)-1) != rank) + halo_nodes.push_back(dataSorter->GetElemConnectivity(TRIANGLE, 0, i)-1); for (unsigned long i = 0; i < nParallel_Quad * N_POINTS_QUADRILATERAL; ++i) - if (dataSorter->FindProcessor(dataSorter->GetElem_Connectivity(QUADRILATERAL, 0, i)-1) != rank) - halo_nodes.push_back(dataSorter->GetElem_Connectivity(QUADRILATERAL, 0, i)-1); + if (dataSorter->FindProcessor(dataSorter->GetElemConnectivity(QUADRILATERAL, 0, i)-1) != rank) + halo_nodes.push_back(dataSorter->GetElemConnectivity(QUADRILATERAL, 0, i)-1); /* Sorted list of halo nodes for this MPI rank. */ sorted_halo_nodes.assign(halo_nodes.begin(), halo_nodes.end()); @@ -161,7 +161,7 @@ void CSTLFileWriter::ReprocessElementConnectivity(){ for (unsigned long i = 0; i < num_halo_nodes; ++i) ++num_nodes_to_receive[neighbor_partitions[i]]; num_nodes_to_send.resize(size); - SU2_MPI::Alltoall(&num_nodes_to_receive[0], 1, MPI_INT, &num_nodes_to_send[0], 1, MPI_INT, SU2_MPI::GetComm()); + SU2_MPI::Alltoall(num_nodes_to_receive.data(), 1, MPI_INT, num_nodes_to_send.data(), 1, MPI_INT, SU2_MPI::GetComm()); /* Now send the global node numbers whose data we need, and receive the same from all other ranks. @@ -184,8 +184,8 @@ void CSTLFileWriter::ReprocessElementConnectivity(){ (sorted_halo_nodes) whose data we need to receive, and receiving lists of nodes whose data we need to send. */ if (sorted_halo_nodes.empty()) sorted_halo_nodes.resize(1); /* Avoid crash. */ - SU2_MPI::Alltoallv(&sorted_halo_nodes[0], &num_nodes_to_receive[0], &nodes_to_receive_displacements[0], MPI_UNSIGNED_LONG, - &nodes_to_send[0], &num_nodes_to_send[0], &nodes_to_send_displacements[0], MPI_UNSIGNED_LONG, + SU2_MPI::Alltoallv(sorted_halo_nodes.data(), num_nodes_to_receive.data(), nodes_to_receive_displacements.data(), MPI_UNSIGNED_LONG, + nodes_to_send.data(), num_nodes_to_send.data(), nodes_to_send_displacements.data(), MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); /* Now actually send and receive the data */ @@ -213,8 +213,8 @@ void CSTLFileWriter::ReprocessElementConnectivity(){ } - SU2_MPI::Alltoallv(&data_to_send[0], &num_values_to_send[0], &values_to_send_displacements[0], MPI_DOUBLE, - &halo_var_data[0], &num_values_to_receive[0], &values_to_receive_displacements[0], MPI_DOUBLE, + SU2_MPI::Alltoallv(data_to_send.data(), num_values_to_send.data(), values_to_send_displacements.data(), MPI_DOUBLE, + halo_var_data.data(), num_values_to_receive.data(), values_to_receive_displacements.data(), MPI_DOUBLE, SU2_MPI::GetComm()); } @@ -294,7 +294,7 @@ void CSTLFileWriter::StoreCoordData(enum GEO_TYPE elemType, /*--- Write Triangle-Point-Coordinates subsequently in a local send buffer. ---*/ for (iElem = 0; iElem < nLocalElements; iElem++) { for (auto node : nodeList) { - globalNodeNumber = dataSorter->GetElem_Connectivity(elemType, iElem, node) - 1; + globalNodeNumber = dataSorter->GetElemConnectivity(elemType, iElem, node) - 1; localNodeNumber = globalNodeNumber - dataSorter->GetNodeBegin(rank); for (auto iVar = 0; iVar < 3; iVar++){ @@ -313,7 +313,7 @@ void CSTLFileWriter::StoreCoordData(enum GEO_TYPE elemType, passivedouble CSTLFileWriter::GetHaloNodeValue(unsigned long global_node_number, unsigned short iVar) { - vector::iterator it = lower_bound(sorted_halo_nodes.begin(), sorted_halo_nodes.end(), global_node_number); + auto it = lower_bound(sorted_halo_nodes.begin(), sorted_halo_nodes.end(), global_node_number); int offset = distance(sorted_halo_nodes.begin(), it); int id = 0; diff --git a/SU2_CFD/src/output/filewriter/CSU2BinaryFileWriter.cpp b/SU2_CFD/src/output/filewriter/CSU2BinaryFileWriter.cpp index c782050d288..a3183266cd8 100644 --- a/SU2_CFD/src/output/filewriter/CSU2BinaryFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CSU2BinaryFileWriter.cpp @@ -2,7 +2,7 @@ * \file CSU2BinaryFileWriter.cpp * \brief Filewriter class SU2 native binary format. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -33,11 +33,9 @@ CSU2BinaryFileWriter::CSU2BinaryFileWriter(CParallelDataSorter *valDataSorter) CFileWriter(valDataSorter, fileExt){} -CSU2BinaryFileWriter::~CSU2BinaryFileWriter(){ +CSU2BinaryFileWriter::~CSU2BinaryFileWriter()= default; -} - -void CSU2BinaryFileWriter::Write_Data(string val_filename){ +void CSU2BinaryFileWriter::WriteData(string val_filename){ /*--- Local variables ---*/ diff --git a/SU2_CFD/src/output/filewriter/CSU2FileWriter.cpp b/SU2_CFD/src/output/filewriter/CSU2FileWriter.cpp index abffd7d7a55..455f6c7f984 100644 --- a/SU2_CFD/src/output/filewriter/CSU2FileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CSU2FileWriter.cpp @@ -2,7 +2,7 @@ * \file CSU2FileWriter.cpp * \brief Filewriter class SU2 native ASCII (CSV) format. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -32,7 +32,7 @@ const string CSU2FileWriter::fileExt = ".csv"; CSU2FileWriter::CSU2FileWriter(CParallelDataSorter *valDataSorter) : CFileWriter(valDataSorter, fileExt){} -void CSU2FileWriter::Write_Data(string val_filename){ +void CSU2FileWriter::WriteData(string val_filename){ ofstream restart_file; const vector fieldNames = dataSorter->GetFieldNames(); @@ -89,7 +89,7 @@ void CSU2FileWriter::Write_Data(string val_filename){ /*--- Determine the file size ---*/ - fileSize = Determine_Filesize(val_filename); + fileSize = DetermineFilesize(val_filename); /*--- Compute and store the bandwidth ---*/ diff --git a/SU2_CFD/src/output/filewriter/CSU2MeshFileWriter.cpp b/SU2_CFD/src/output/filewriter/CSU2MeshFileWriter.cpp index 6ffbfd63304..39bc185252a 100644 --- a/SU2_CFD/src/output/filewriter/CSU2MeshFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CSU2MeshFileWriter.cpp @@ -2,7 +2,7 @@ * \file CSU2MeshFileWriter.cpp * \brief Filewriter class SU2 native mesh format. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -34,7 +34,7 @@ CSU2MeshFileWriter::CSU2MeshFileWriter(CParallelDataSorter *valDataSorter, unsigned short valiZone, unsigned short valnZone) : CFileWriter(valDataSorter, fileExt), iZone(valiZone), nZone(valnZone) {} -void CSU2MeshFileWriter::Write_Data(string val_filename) { +void CSU2MeshFileWriter::WriteData(string val_filename) { ofstream output_file; @@ -78,38 +78,38 @@ void CSU2MeshFileWriter::Write_Data(string val_filename) { for (auto iElem = 0ul; iElem < dataSorter->GetnElem(TRIANGLE); iElem++) { output_file << "5\t"; for (auto iNode = 0u; iNode < N_POINTS_TRIANGLE; ++iNode) - output_file << dataSorter->GetElem_Connectivity(TRIANGLE, iElem, iNode) - 1 << "\t"; + output_file << dataSorter->GetElemConnectivity(TRIANGLE, iElem, iNode) - 1 << "\t"; output_file << nElem + offset << "\n"; nElem++; } for (auto iElem = 0ul; iElem < dataSorter->GetnElem(QUADRILATERAL); iElem++) { output_file << "9\t"; for (auto iNode = 0u; iNode < N_POINTS_QUADRILATERAL; ++iNode) - output_file << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, iNode) - 1 << "\t"; + output_file << dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, iNode) - 1 << "\t"; output_file << nElem + offset << "\n"; nElem++; } for (auto iElem = 0ul; iElem < dataSorter->GetnElem(TETRAHEDRON); iElem++) { output_file << "10\t"; for (auto iNode = 0u; iNode < N_POINTS_TETRAHEDRON; ++iNode) - output_file << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, iNode) - 1 << "\t"; + output_file << dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, iNode) - 1 << "\t"; output_file << nElem + offset << "\n"; nElem++; } for (auto iElem = 0ul; iElem < dataSorter->GetnElem(HEXAHEDRON); iElem++) { output_file << "12\t"; for (auto iNode = 0u; iNode < N_POINTS_HEXAHEDRON; ++iNode) - output_file << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, iNode) - 1 << "\t"; + output_file << dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, iNode) - 1 << "\t"; output_file << nElem + offset << "\n"; nElem++; } for (auto iElem = 0ul; iElem < dataSorter->GetnElem(PRISM); iElem++) { output_file << "13\t"; for (auto iNode = 0u; iNode < N_POINTS_PRISM; ++iNode) - output_file << dataSorter->GetElem_Connectivity(PRISM, iElem, iNode) - 1 << "\t"; + output_file << dataSorter->GetElemConnectivity(PRISM, iElem, iNode) - 1 << "\t"; output_file << nElem + offset << "\n"; nElem++; } for (auto iElem = 0ul; iElem < dataSorter->GetnElem(PYRAMID); iElem++) { output_file << "14\t"; for (auto iNode = 0u; iNode < N_POINTS_PYRAMID; ++iNode) - output_file << dataSorter->GetElem_Connectivity(PYRAMID, iElem, iNode) - 1 << "\t"; + output_file << dataSorter->GetElemConnectivity(PYRAMID, iElem, iNode) - 1 << "\t"; output_file << nElem + offset << "\n"; nElem++; } @@ -193,11 +193,11 @@ void CSU2MeshFileWriter::Write_Data(string val_filename) { getline(input_file, text_line); text_line.erase(0,11); for (int iChar = 0; iChar < 20; iChar++) { - position = text_line.find(" ", 0); + position = text_line.find(' ', 0); if (position != string::npos) text_line.erase(position,1); - position = text_line.find("\r", 0); + position = text_line.find('\r', 0); if (position != string::npos) text_line.erase(position,1); - position = text_line.find("\n", 0); + position = text_line.find('\n', 0); if (position != string::npos) text_line.erase(position,1); } string Marker_Tag = text_line; diff --git a/SU2_CFD/src/output/filewriter/CSurfaceFEMDataSorter.cpp b/SU2_CFD/src/output/filewriter/CSurfaceFEMDataSorter.cpp index d8cdda2b214..ef19eebf145 100644 --- a/SU2_CFD/src/output/filewriter/CSurfaceFEMDataSorter.cpp +++ b/SU2_CFD/src/output/filewriter/CSurfaceFEMDataSorter.cpp @@ -2,7 +2,7 @@ * \file CSurfaceFEMDataSorter.cpp * \brief Datasorter for FEM surfaces. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -41,7 +41,7 @@ CSurfaceFEMDataSorter::CSurfaceFEMDataSorter(CConfig *config, CGeometry *geometr /*--- Create an object of the class CMeshFEM_DG and retrieve the necessary geometrical information for the FEM DG solver. ---*/ - CMeshFEM_DG *DGGeometry = dynamic_cast(geometry); + auto *DGGeometry = dynamic_cast(geometry); unsigned long nVolElemOwned = DGGeometry->GetNVolElemOwned(); CVolumeElementFEM *volElem = DGGeometry->GetVolElem(); @@ -371,7 +371,7 @@ void CSurfaceFEMDataSorter::SortSurfaceConnectivity(CConfig *config, CGeometry * /*--- Create an object of the class CMeshFEM_DG and retrieve the necessary geometrical information for the FEM DG solver. ---*/ - CMeshFEM_DG *DGGeometry = dynamic_cast(geometry); + auto *DGGeometry = dynamic_cast(geometry); unsigned long nVolElemOwned = DGGeometry->GetNVolElemOwned(); CVolumeElementFEM *volElem = DGGeometry->GetVolElem(); diff --git a/SU2_CFD/src/output/filewriter/CSurfaceFVMDataSorter.cpp b/SU2_CFD/src/output/filewriter/CSurfaceFVMDataSorter.cpp index 7031c11190e..77cc2567e90 100644 --- a/SU2_CFD/src/output/filewriter/CSurfaceFVMDataSorter.cpp +++ b/SU2_CFD/src/output/filewriter/CSurfaceFVMDataSorter.cpp @@ -2,7 +2,7 @@ * \file CSurfaceFVMDataSorter.cpp * \brief Datasorter for FVM surfaces. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -188,12 +188,12 @@ void CSurfaceFVMDataSorter::SortOutputData() { /*--- Allocate arrays for sending the global ID. ---*/ - unsigned long *idSend = new unsigned long[nElem_Send[size]](); + auto *idSend = new unsigned long[nElem_Send[size]](); /*--- Create an index variable to keep track of our index positions as we load up the send buffer. ---*/ - unsigned long *idIndex = new unsigned long[size](); + auto *idIndex = new unsigned long[size](); for (int ii=0; ii < size; ii++) idIndex[ii] = nElem_Send[ii]; /*--- Now loop back through the local connectivities for the surface @@ -304,7 +304,7 @@ void CSurfaceFVMDataSorter::SortOutputData() { we do not include our own rank in the communications. We will directly copy our own data later. ---*/ - unsigned long *idRecv = new unsigned long[nElem_Recv[size]](); + auto *idRecv = new unsigned long[nElem_Recv[size]](); #ifdef HAVE_MPI /*--- We need double the number of messages to send both the conn. @@ -454,8 +454,8 @@ void CSurfaceFVMDataSorter::SortOutputData() { create a new mapping using two arrays, which will need to be communicated. We use our mask again here. ---*/ - unsigned long *globalP = new unsigned long[nPoints](); - unsigned long *renumbP = new unsigned long[nPoints](); + auto *globalP = new unsigned long[nPoints](); + auto *renumbP = new unsigned long[nPoints](); count = 0; for (iPoint = 0; iPoint < volumeSorter->GetnPoints(); iPoint++) { @@ -545,7 +545,7 @@ void CSurfaceFVMDataSorter::SortOutputData() { /*--- Create an index variable to keep track of our index position as we load up the send buffer. ---*/ - unsigned long *index = new unsigned long[size](); + auto *index = new unsigned long[size](); for (int ii=0; ii < size; ii++) index[ii] = nElem_Send[ii]; /*--- Loop back through and load up the buffers for the global IDs @@ -1241,10 +1241,10 @@ void CSurfaceFVMDataSorter::SortSurfaceConnectivity(CConfig *config, CGeometry * /*--- Create an index variable to keep track of our index position as we load up the send buffer. ---*/ - unsigned long *index = new unsigned long[size]; + auto *index = new unsigned long[size]; for (int ii=0; ii < size; ii++) index[ii] = NODES_PER_ELEMENT*nElem_Send[ii]; - unsigned long *haloIndex = new unsigned long[size]; + auto *haloIndex = new unsigned long[size]; for (int ii=0; ii < size; ii++) haloIndex[ii] = nElem_Send[ii]; /*--- Loop through our elements and load the elems and their diff --git a/SU2_CFD/src/output/filewriter/CTecplotBinaryFileWriter.cpp b/SU2_CFD/src/output/filewriter/CTecplotBinaryFileWriter.cpp index 1342cb73cbc..ec01ad31428 100644 --- a/SU2_CFD/src/output/filewriter/CTecplotBinaryFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CTecplotBinaryFileWriter.cpp @@ -2,7 +2,7 @@ * \file CTecplotBinaryFileWriter.cpp * \brief Filewriter class for Tecplot binary format. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -37,9 +37,9 @@ CTecplotBinaryFileWriter::CTecplotBinaryFileWriter(CParallelDataSorter *valDataS unsigned long valTimeIter, su2double valTimeStep) : CFileWriter(valDataSorter, fileExt), timeIter(valTimeIter), timeStep(valTimeStep){} -CTecplotBinaryFileWriter::~CTecplotBinaryFileWriter(){} +CTecplotBinaryFileWriter::~CTecplotBinaryFileWriter()= default; -void CTecplotBinaryFileWriter::Write_Data(string val_filename){ +void CTecplotBinaryFileWriter::WriteData(string val_filename){ /*--- We append the pre-defined suffix (extension) to the filename (prefix) ---*/ val_filename.append(fileExt); @@ -81,9 +81,9 @@ void CTecplotBinaryFileWriter::Write_Data(string val_filename){ } tecplot_variable_names << fieldNames[fieldNames.size()-1]; - void* file_handle = NULL; + void* file_handle = nullptr; int32_t err = tecFileWriterOpen(val_filename.c_str(), data_set_title.c_str(), tecplot_variable_names.str().c_str(), - FILEFORMAT_SZL, FILETYPE_FULL, (int32_t)FieldDataType_Double, NULL, &file_handle); + FILEFORMAT_SZL, FILETYPE_FULL, (int32_t)FieldDataType_Double, nullptr, &file_handle); if (err) cout << "Error opening Tecplot file '" << val_filename << "'" << endl; #ifdef HAVE_MPI @@ -128,7 +128,7 @@ void CTecplotBinaryFileWriter::Write_Data(string val_filename){ int32_t zone; vector value_locations(fieldNames.size(), 1); /* Nodal variables. */ - err = tecZoneCreateFE(file_handle, "Zone", zone_type, num_nodes, num_cells, NULL, NULL, &value_locations[0], NULL, 0, 0, 0, &zone); + err = tecZoneCreateFE(file_handle, "Zone", zone_type, num_nodes, num_cells, nullptr, nullptr, value_locations.data(), nullptr, 0, 0, 0, &zone); if (err) cout << rank << ": Error creating Tecplot zone." << endl; if (is_unsteady) { err = tecZoneSetUnsteadyOptions(file_handle, zone, solution_time, timeIter + 1); @@ -154,40 +154,40 @@ void CTecplotBinaryFileWriter::Write_Data(string val_filename){ partition_owners.reserve(size); for (int32_t iRank = 0; iRank < size; ++iRank) partition_owners.push_back(iRank); - err = tecZoneMapPartitionsToMPIRanks(file_handle, zone, size, &partition_owners[0]); + err = tecZoneMapPartitionsToMPIRanks(file_handle, zone, size, partition_owners.data()); if (err) cout << rank << ": Error assigning MPI ranks for Tecplot zone partitions." << endl; /* Gather a list of nodes we refer to but are not outputting. */ for (unsigned long i = 0; i < nParallel_Tria * N_POINTS_TRIANGLE; ++i) - if ((unsigned long)dataSorter->GetElem_Connectivity(TRIANGLE, 0, i) <= dataSorter->GetNodeBegin(rank) || - dataSorter->GetNodeEnd(rank) < (unsigned long)dataSorter->GetElem_Connectivity(TRIANGLE, 0, i)) - halo_nodes.insert(dataSorter->GetElem_Connectivity(TRIANGLE, 0, i)); + if ((unsigned long)dataSorter->GetElemConnectivity(TRIANGLE, 0, i) <= dataSorter->GetNodeBegin(rank) || + dataSorter->GetNodeEnd(rank) < (unsigned long)dataSorter->GetElemConnectivity(TRIANGLE, 0, i)) + halo_nodes.insert(dataSorter->GetElemConnectivity(TRIANGLE, 0, i)); for (unsigned long i = 0; i < nParallel_Quad * N_POINTS_QUADRILATERAL; ++i) - if ((unsigned long)dataSorter->GetElem_Connectivity(QUADRILATERAL, 0, i) <= dataSorter->GetNodeBegin(rank) || - dataSorter->GetNodeEnd(rank) < (unsigned long)dataSorter->GetElem_Connectivity(QUADRILATERAL, 0, i)) - halo_nodes.insert(dataSorter->GetElem_Connectivity(QUADRILATERAL, 0, i)); + if ((unsigned long)dataSorter->GetElemConnectivity(QUADRILATERAL, 0, i) <= dataSorter->GetNodeBegin(rank) || + dataSorter->GetNodeEnd(rank) < (unsigned long)dataSorter->GetElemConnectivity(QUADRILATERAL, 0, i)) + halo_nodes.insert(dataSorter->GetElemConnectivity(QUADRILATERAL, 0, i)); for (unsigned long i = 0; i < nParallel_Tetr * N_POINTS_TETRAHEDRON; ++i) - if ((unsigned long)dataSorter->GetElem_Connectivity(TETRAHEDRON, 0, i) <= dataSorter->GetNodeBegin(rank) || - dataSorter->GetNodeEnd(rank) < (unsigned long)dataSorter->GetElem_Connectivity(TETRAHEDRON, 0, i)) - halo_nodes.insert(dataSorter->GetElem_Connectivity(TETRAHEDRON, 0, i)); + if ((unsigned long)dataSorter->GetElemConnectivity(TETRAHEDRON, 0, i) <= dataSorter->GetNodeBegin(rank) || + dataSorter->GetNodeEnd(rank) < (unsigned long)dataSorter->GetElemConnectivity(TETRAHEDRON, 0, i)) + halo_nodes.insert(dataSorter->GetElemConnectivity(TETRAHEDRON, 0, i)); for (unsigned long i = 0; i < nParallel_Hexa * N_POINTS_HEXAHEDRON; ++i) - if ((unsigned long)dataSorter->GetElem_Connectivity(HEXAHEDRON, 0, i) <= dataSorter->GetNodeBegin(rank) || - dataSorter->GetNodeEnd(rank) < (unsigned long)dataSorter->GetElem_Connectivity(HEXAHEDRON, 0, i)) - halo_nodes.insert(dataSorter->GetElem_Connectivity(HEXAHEDRON, 0, i)); + if ((unsigned long)dataSorter->GetElemConnectivity(HEXAHEDRON, 0, i) <= dataSorter->GetNodeBegin(rank) || + dataSorter->GetNodeEnd(rank) < (unsigned long)dataSorter->GetElemConnectivity(HEXAHEDRON, 0, i)) + halo_nodes.insert(dataSorter->GetElemConnectivity(HEXAHEDRON, 0, i)); for (unsigned long i = 0; i < nParallel_Pris * N_POINTS_PRISM; ++i) - if ((unsigned long)dataSorter->GetElem_Connectivity(PRISM, 0, i) <= dataSorter->GetNodeBegin(rank) || - dataSorter->GetNodeEnd(rank) < (unsigned long)dataSorter->GetElem_Connectivity(PRISM, 0, i)) - halo_nodes.insert(dataSorter->GetElem_Connectivity(PRISM, 0, i)); + if ((unsigned long)dataSorter->GetElemConnectivity(PRISM, 0, i) <= dataSorter->GetNodeBegin(rank) || + dataSorter->GetNodeEnd(rank) < (unsigned long)dataSorter->GetElemConnectivity(PRISM, 0, i)) + halo_nodes.insert(dataSorter->GetElemConnectivity(PRISM, 0, i)); for (unsigned long i = 0; i < nParallel_Pyra * N_POINTS_PYRAMID; ++i) - if ((unsigned long)dataSorter->GetElem_Connectivity(PYRAMID, 0, i) <= dataSorter->GetNodeBegin(rank) || - dataSorter->GetNodeEnd(rank) < (unsigned long)dataSorter->GetElem_Connectivity(PYRAMID, 0, i)) - halo_nodes.insert(dataSorter->GetElem_Connectivity(PYRAMID, 0, i)); + if ((unsigned long)dataSorter->GetElemConnectivity(PYRAMID, 0, i) <= dataSorter->GetNodeBegin(rank) || + dataSorter->GetNodeEnd(rank) < (unsigned long)dataSorter->GetElemConnectivity(PYRAMID, 0, i)) + halo_nodes.insert(dataSorter->GetElemConnectivity(PYRAMID, 0, i)); /* Sorted list of halo nodes for this MPI rank. */ sorted_halo_nodes.assign(halo_nodes.begin(), halo_nodes.end()); @@ -211,14 +211,14 @@ void CTecplotBinaryFileWriter::Write_Data(string val_filename){ neighbor_nodes[i] = static_cast(node_number); } err = tecFEPartitionCreate64(file_handle, zone, rank + 1, partition_num_nodes, partition_num_cells, - static_cast(num_halo_nodes), &halo_node_local_numbers[0], &neighbor_partitions[0], &neighbor_nodes[0], 0, NULL); + static_cast(num_halo_nodes), halo_node_local_numbers.data(), neighbor_partitions.data(), neighbor_nodes.data(), 0, nullptr); if (err) cout << rank << ": Error creating Tecplot zone partition." << endl; /* Gather halo node data. First, tell each rank how many nodes' worth of data we need from them. */ for (size_t i = 0; i < num_halo_nodes; ++i) ++num_nodes_to_receive[neighbor_partitions[i] - 1]; vector num_nodes_to_send(size); - SU2_MPI::Alltoall(&num_nodes_to_receive[0], 1, MPI_INT, &num_nodes_to_send[0], 1, MPI_INT, SU2_MPI::GetComm()); + SU2_MPI::Alltoall(num_nodes_to_receive.data(), 1, MPI_INT, num_nodes_to_send.data(), 1, MPI_INT, SU2_MPI::GetComm()); /* Now send the global node numbers whose data we need, and receive the same from all other ranks. @@ -239,8 +239,8 @@ void CTecplotBinaryFileWriter::Write_Data(string val_filename){ (sorted_halo_nodes) whose data we need to receive, and receiving lists of nodes whose data we need to send. */ if (sorted_halo_nodes.empty()) sorted_halo_nodes.resize(1); /* Avoid crash. */ - SU2_MPI::Alltoallv(&sorted_halo_nodes[0], &num_nodes_to_receive[0], &nodes_to_receive_displacements[0], MPI_UNSIGNED_LONG, - &nodes_to_send[0], &num_nodes_to_send[0], &nodes_to_send_displacements[0], MPI_UNSIGNED_LONG, + SU2_MPI::Alltoallv(sorted_halo_nodes.data(), num_nodes_to_receive.data(), nodes_to_receive_displacements.data(), MPI_UNSIGNED_LONG, + nodes_to_send.data(), num_nodes_to_send.data(), nodes_to_send_displacements.data(), MPI_UNSIGNED_LONG, SU2_MPI::GetComm()); /* Now actually send and receive the data */ @@ -262,8 +262,8 @@ void CTecplotBinaryFileWriter::Write_Data(string val_filename){ data_to_send[index++] =dataSorter->GetData(iVar,node_offset); } } - CBaseMPIWrapper::Alltoallv(&data_to_send[0], &num_values_to_send[0], &values_to_send_displacements[0], MPI_DOUBLE, - &halo_var_data[0], &num_values_to_receive[0], &values_to_receive_displacements[0], MPI_DOUBLE, + CBaseMPIWrapper::Alltoallv(data_to_send.data(), num_values_to_send.data(), values_to_send_displacements.data(), MPI_DOUBLE, + halo_var_data.data(), num_values_to_receive.data(), values_to_receive_displacements.data(), MPI_DOUBLE, SU2_MPI::GetComm()); } else { @@ -279,7 +279,7 @@ void CTecplotBinaryFileWriter::Write_Data(string val_filename){ for (iVar = 0; err == 0 && iVar < fieldNames.size(); iVar++) { for(unsigned long i = 0; i < dataSorter->GetnPoints(); ++i) values_to_write[i] = dataSorter->GetData(iVar, i); - err = tecZoneVarWriteDoubleValues(file_handle, zone, iVar + 1, rank + 1, dataSorter->GetnPoints(), &values_to_write[0]); + err = tecZoneVarWriteDoubleValues(file_handle, zone, iVar + 1, rank + 1, dataSorter->GetnPoints(), values_to_write.data()); if (err) cout << rank << ": Error outputting Tecplot variable values." << endl; for (int iRank = 0; err == 0 && iRank < size; ++iRank) { if (num_nodes_to_receive[iRank] > 0) { @@ -294,7 +294,7 @@ void CTecplotBinaryFileWriter::Write_Data(string val_filename){ vector var_data; unsigned long nPoint = dataSorter->GetnPoints(); vector num_points(size); - SU2_MPI::Gather(&nPoint, 1, MPI_UNSIGNED_LONG, &num_points[0], 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(&nPoint, 1, MPI_UNSIGNED_LONG, num_points.data(), 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); for(int iRank = 0; iRank < size; ++iRank) { int64_t rank_num_points = num_points[iRank]; @@ -306,13 +306,13 @@ void CTecplotBinaryFileWriter::Write_Data(string val_filename){ values_to_write.resize(rank_num_points); for(unsigned long i = 0; i < (unsigned long)rank_num_points; ++i) values_to_write[i] = dataSorter->GetData(iVar,i); - err = tecZoneVarWriteDoubleValues(file_handle, zone, iVar + 1, 0, rank_num_points, &values_to_write[0]); + err = tecZoneVarWriteDoubleValues(file_handle, zone, iVar + 1, 0, rank_num_points, values_to_write.data()); if (err) cout << rank << ": Error outputting Tecplot variable values." << endl; } } else { /* Receive data from other rank. */ var_data.resize(max((int64_t)1, (int64_t)fieldNames.size() * rank_num_points)); - CBaseMPIWrapper::Recv(&var_data[0], fieldNames.size() * rank_num_points, MPI_DOUBLE, iRank, iRank, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); + CBaseMPIWrapper::Recv(var_data.data(), fieldNames.size() * rank_num_points, MPI_DOUBLE, iRank, iRank, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); for (iVar = 0; err == 0 && iVar < fieldNames.size(); iVar++) { err = tecZoneVarWriteDoubleValues(file_handle, zone, iVar + 1, 0, rank_num_points, &var_data[iVar * rank_num_points]); if (err) cout << rank << ": Error outputting Tecplot surface variable values." << endl; @@ -324,7 +324,7 @@ void CTecplotBinaryFileWriter::Write_Data(string val_filename){ else { /* Send data to MASTER_NODE */ unsigned long nPoint = dataSorter->GetnPoints(); - SU2_MPI::Gather(&nPoint, 1, MPI_UNSIGNED_LONG, NULL, 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(&nPoint, 1, MPI_UNSIGNED_LONG, nullptr, 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); vector var_data; size_t var_data_size = fieldNames.size() * dataSorter->GetnPoints(); @@ -333,8 +333,8 @@ void CTecplotBinaryFileWriter::Write_Data(string val_filename){ for(unsigned long i = 0; i < dataSorter->GetnPoints(); ++i) var_data.push_back(dataSorter->GetData(iVar,i)); - if (var_data.size() > 0) - CBaseMPIWrapper::Send(&var_data[0], static_cast(var_data.size()), MPI_DOUBLE, MASTER_NODE, rank, SU2_MPI::GetComm()); + if (!var_data.empty()) + CBaseMPIWrapper::Send(var_data.data(), static_cast(var_data.size()), MPI_DOUBLE, MASTER_NODE, rank, SU2_MPI::GetComm()); } } @@ -376,11 +376,11 @@ void CTecplotBinaryFileWriter::Write_Data(string val_filename){ : GetHaloNodeNumber(n, dataSorter->GetNodeEnd(rank) - dataSorter->GetNodeBegin(rank), sorted_halo_nodes) for (iElem = 0; err == 0 && iElem < nParallel_Tetr; iElem++) { - nodes[0] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 0)); - nodes[1] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 1)); - nodes[2] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 2)); + nodes[0] = MAKE_LOCAL(dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 0)); + nodes[1] = MAKE_LOCAL(dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 1)); + nodes[2] = MAKE_LOCAL(dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 2)); nodes[3] = nodes[2]; - nodes[4] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3)); + nodes[4] = MAKE_LOCAL(dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 3)); nodes[5] = nodes[4]; nodes[6] = nodes[4]; nodes[7] = nodes[4]; @@ -389,37 +389,37 @@ void CTecplotBinaryFileWriter::Write_Data(string val_filename){ } for (iElem = 0; err == 0 && iElem < nParallel_Hexa; iElem++) { - nodes[0] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 0)); - nodes[1] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 1)); - nodes[2] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 2)); - nodes[3] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 3)); - nodes[4] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 4)); - nodes[5] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 5)); - nodes[6] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 6)); - nodes[7] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 7)); + nodes[0] = MAKE_LOCAL(dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 0)); + nodes[1] = MAKE_LOCAL(dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 1)); + nodes[2] = MAKE_LOCAL(dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 2)); + nodes[3] = MAKE_LOCAL(dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 3)); + nodes[4] = MAKE_LOCAL(dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 4)); + nodes[5] = MAKE_LOCAL(dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 5)); + nodes[6] = MAKE_LOCAL(dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 6)); + nodes[7] = MAKE_LOCAL(dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 7)); err = tecZoneNodeMapWrite64(file_handle, zone, rank + 1, 1, 8, nodes); if (err) cout << rank << ": Error outputting Tecplot node values." << endl; } for (iElem = 0; err == 0 && iElem < nParallel_Pris; iElem++) { - nodes[0] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PRISM, iElem, 0)); - nodes[1] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PRISM, iElem, 1)); + nodes[0] = MAKE_LOCAL(dataSorter->GetElemConnectivity(PRISM, iElem, 0)); + nodes[1] = MAKE_LOCAL(dataSorter->GetElemConnectivity(PRISM, iElem, 1)); nodes[2] = nodes[1]; - nodes[3] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PRISM, iElem, 2)); - nodes[4] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PRISM, iElem, 3)); - nodes[5] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PRISM, iElem, 4)); + nodes[3] = MAKE_LOCAL(dataSorter->GetElemConnectivity(PRISM, iElem, 2)); + nodes[4] = MAKE_LOCAL(dataSorter->GetElemConnectivity(PRISM, iElem, 3)); + nodes[5] = MAKE_LOCAL(dataSorter->GetElemConnectivity(PRISM, iElem, 4)); nodes[6] = nodes[5]; - nodes[7] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PRISM, iElem, 5)); + nodes[7] = MAKE_LOCAL(dataSorter->GetElemConnectivity(PRISM, iElem, 5)); err = tecZoneNodeMapWrite64(file_handle, zone, rank + 1, 1, 8, nodes); if (err) cout << rank << ": Error outputting Tecplot node values." << endl; } for (iElem = 0; err == 0 && iElem < nParallel_Pyra; iElem++) { - nodes[0] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PYRAMID, iElem, 0)); - nodes[1] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PYRAMID, iElem, 1)); - nodes[2] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PYRAMID, iElem, 2)); - nodes[3] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PYRAMID, iElem, 3)); - nodes[4] = MAKE_LOCAL(dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4)); + nodes[0] = MAKE_LOCAL(dataSorter->GetElemConnectivity(PYRAMID, iElem, 0)); + nodes[1] = MAKE_LOCAL(dataSorter->GetElemConnectivity(PYRAMID, iElem, 1)); + nodes[2] = MAKE_LOCAL(dataSorter->GetElemConnectivity(PYRAMID, iElem, 2)); + nodes[3] = MAKE_LOCAL(dataSorter->GetElemConnectivity(PYRAMID, iElem, 3)); + nodes[4] = MAKE_LOCAL(dataSorter->GetElemConnectivity(PYRAMID, iElem, 4)); nodes[5] = nodes[4]; nodes[6] = nodes[4]; nodes[7] = nodes[4]; @@ -435,39 +435,39 @@ void CTecplotBinaryFileWriter::Write_Data(string val_filename){ vector connectivity_sizes(size); unsigned long unused = 0; - SU2_MPI::Gather(&unused, 1, MPI_UNSIGNED_LONG, &connectivity_sizes[0], 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(&unused, 1, MPI_UNSIGNED_LONG, connectivity_sizes.data(), 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); vector connectivity; for(int iRank = 0; iRank < size; ++iRank) { if (iRank == rank) { for (iElem = 0; err == 0 && iElem < nParallel_Line; iElem++) { - nodes[0] = dataSorter->GetElem_Connectivity(LINE, iElem, 0); - nodes[1] = dataSorter->GetElem_Connectivity(LINE, iElem, 1); + nodes[0] = dataSorter->GetElemConnectivity(LINE, iElem, 0); + nodes[1] = dataSorter->GetElemConnectivity(LINE, iElem, 1); err = tecZoneNodeMapWrite64(file_handle, zone, 0, 1, 2, nodes); if (err) cout << rank << ": Error outputting Tecplot node values." << endl; } for (iElem = 0; err == 0 && iElem < nParallel_Tria; iElem++) { - nodes[0] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 0); - nodes[1] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 1); - nodes[2] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2); - nodes[3] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2); + nodes[0] = dataSorter->GetElemConnectivity(TRIANGLE, iElem, 0); + nodes[1] = dataSorter->GetElemConnectivity(TRIANGLE, iElem, 1); + nodes[2] = dataSorter->GetElemConnectivity(TRIANGLE, iElem, 2); + nodes[3] = dataSorter->GetElemConnectivity(TRIANGLE, iElem, 2); err = tecZoneNodeMapWrite64(file_handle, zone, 0, 1, 4, nodes); if (err) cout << rank << ": Error outputting Tecplot node values." << endl; } for (iElem = 0; err == 0 && iElem < nParallel_Quad; iElem++) { - nodes[0] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 0); - nodes[1] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 1); - nodes[2] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 2); - nodes[3] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 3); + nodes[0] = dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 0); + nodes[1] = dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 1); + nodes[2] = dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 2); + nodes[3] = dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 3); err = tecZoneNodeMapWrite64(file_handle, zone, 0, 1, 4, nodes); if (err) cout << rank << ": Error outputting Tecplot node values." << endl; } } else { /* Receive node map and write out. */ connectivity.resize(max((unsigned long)1, connectivity_sizes[iRank])); - SU2_MPI::Recv(&connectivity[0], connectivity_sizes[iRank], MPI_UNSIGNED_LONG, iRank, iRank, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); - err = tecZoneNodeMapWrite64(file_handle, zone, 0, 1, connectivity_sizes[iRank], &connectivity[0]); + SU2_MPI::Recv(connectivity.data(), connectivity_sizes[iRank], MPI_UNSIGNED_LONG, iRank, iRank, SU2_MPI::GetComm(), MPI_STATUS_IGNORE); + err = tecZoneNodeMapWrite64(file_handle, zone, 0, 1, connectivity_sizes[iRank], connectivity.data()); if (err) cout << rank << ": Error outputting Tecplot node values." << endl; } } @@ -477,30 +477,30 @@ void CTecplotBinaryFileWriter::Write_Data(string val_filename){ unsigned long connectivity_size; connectivity_size = 2 * nParallel_Line + 4 * (nParallel_Tria + nParallel_Quad); - SU2_MPI::Gather(&connectivity_size, 1, MPI_UNSIGNED_LONG, NULL, 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); + SU2_MPI::Gather(&connectivity_size, 1, MPI_UNSIGNED_LONG, nullptr, 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); vector connectivity; connectivity.reserve(connectivity_size); for (iElem = 0; err == 0 && iElem < nParallel_Line; iElem++) { - connectivity.push_back(dataSorter->GetElem_Connectivity(LINE, iElem, 0)); - connectivity.push_back(dataSorter->GetElem_Connectivity(LINE, iElem, 0)); + connectivity.push_back(dataSorter->GetElemConnectivity(LINE, iElem, 0)); + connectivity.push_back(dataSorter->GetElemConnectivity(LINE, iElem, 0)); } for (iElem = 0; err == 0 && iElem < nParallel_Tria; iElem++) { - connectivity.push_back(dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 0)); - connectivity.push_back(dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 1)); - connectivity.push_back(dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2)); - connectivity.push_back(dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2)); + connectivity.push_back(dataSorter->GetElemConnectivity(TRIANGLE, iElem, 0)); + connectivity.push_back(dataSorter->GetElemConnectivity(TRIANGLE, iElem, 1)); + connectivity.push_back(dataSorter->GetElemConnectivity(TRIANGLE, iElem, 2)); + connectivity.push_back(dataSorter->GetElemConnectivity(TRIANGLE, iElem, 2)); } for (iElem = 0; err == 0 && iElem < nParallel_Quad; iElem++) { - connectivity.push_back(dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 0)); - connectivity.push_back(dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 1)); - connectivity.push_back(dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 2)); - connectivity.push_back(dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 3)); + connectivity.push_back(dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 0)); + connectivity.push_back(dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 1)); + connectivity.push_back(dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 2)); + connectivity.push_back(dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 3)); } if (connectivity.empty()) connectivity.resize(1); /* Avoid crash */ - SU2_MPI::Send(&connectivity[0], connectivity_size, MPI_UNSIGNED_LONG, MASTER_NODE, rank, SU2_MPI::GetComm()); + SU2_MPI::Send(connectivity.data(), connectivity_size, MPI_UNSIGNED_LONG, MASTER_NODE, rank, SU2_MPI::GetComm()); } } #else @@ -508,71 +508,71 @@ void CTecplotBinaryFileWriter::Write_Data(string val_filename){ int64_t nodes[8]; for (iElem = 0; err == 0 && iElem < nParallel_Tria; iElem++) { - nodes[0] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 0); - nodes[1] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 1); - nodes[2] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2); - nodes[3] = dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2); + nodes[0] = dataSorter->GetElemConnectivity(TRIANGLE, iElem, 0); + nodes[1] = dataSorter->GetElemConnectivity(TRIANGLE, iElem, 1); + nodes[2] = dataSorter->GetElemConnectivity(TRIANGLE, iElem, 2); + nodes[3] = dataSorter->GetElemConnectivity(TRIANGLE, iElem, 2); err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 4, nodes); if (err) cout << rank << ": Error outputting Tecplot node values." << endl; } for (iElem = 0; err == 0 && iElem < nParallel_Quad; iElem++) { - nodes[0] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 0); - nodes[1] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 1); - nodes[2] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 2); - nodes[3] = dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 3); + nodes[0] = dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 0); + nodes[1] = dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 1); + nodes[2] = dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 2); + nodes[3] = dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 3); err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 4, nodes); if (err) cout << rank << ": Error outputting Tecplot node values." << endl; } for (iElem = 0; err == 0 && iElem < nParallel_Tetr; iElem++) { - nodes[0] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 0); - nodes[1] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 1); - nodes[2] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 2); - nodes[3] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 2); - nodes[4] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3); - nodes[5] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3); - nodes[6] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3); - nodes[7] = dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3); + nodes[0] = dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 0); + nodes[1] = dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 1); + nodes[2] = dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 2); + nodes[3] = dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 2); + nodes[4] = dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 3); + nodes[5] = dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 3); + nodes[6] = dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 3); + nodes[7] = dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 3); err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 8, nodes); if (err) cout << rank << ": Error outputting Tecplot node values." << endl; } for (iElem = 0; err == 0 && iElem < nParallel_Hexa; iElem++) { - nodes[0] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 0); - nodes[1] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 1); - nodes[2] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 2); - nodes[3] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 3); - nodes[4] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 4); - nodes[5] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 5); - nodes[6] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 6); - nodes[7] = dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 7); + nodes[0] = dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 0); + nodes[1] = dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 1); + nodes[2] = dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 2); + nodes[3] = dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 3); + nodes[4] = dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 4); + nodes[5] = dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 5); + nodes[6] = dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 6); + nodes[7] = dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 7); err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 8, nodes); if (err) cout << rank << ": Error outputting Tecplot node values." << endl; } for (iElem = 0; err == 0 && iElem < nParallel_Pris; iElem++) { - nodes[0] = dataSorter->GetElem_Connectivity(PRISM, iElem, 0); - nodes[1] = dataSorter->GetElem_Connectivity(PRISM, iElem, 1); - nodes[2] = dataSorter->GetElem_Connectivity(PRISM, iElem, 1); - nodes[3] = dataSorter->GetElem_Connectivity(PRISM, iElem, 2); - nodes[4] = dataSorter->GetElem_Connectivity(PRISM, iElem, 3); - nodes[5] = dataSorter->GetElem_Connectivity(PRISM, iElem, 4); - nodes[6] = dataSorter->GetElem_Connectivity(PRISM, iElem, 4); - nodes[7] = dataSorter->GetElem_Connectivity(PRISM, iElem, 5); + nodes[0] = dataSorter->GetElemConnectivity(PRISM, iElem, 0); + nodes[1] = dataSorter->GetElemConnectivity(PRISM, iElem, 1); + nodes[2] = dataSorter->GetElemConnectivity(PRISM, iElem, 1); + nodes[3] = dataSorter->GetElemConnectivity(PRISM, iElem, 2); + nodes[4] = dataSorter->GetElemConnectivity(PRISM, iElem, 3); + nodes[5] = dataSorter->GetElemConnectivity(PRISM, iElem, 4); + nodes[6] = dataSorter->GetElemConnectivity(PRISM, iElem, 4); + nodes[7] = dataSorter->GetElemConnectivity(PRISM, iElem, 5); err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 8, nodes); if (err) cout << rank << ": Error outputting Tecplot node values." << endl; } for (iElem = 0; err == 0 && iElem < nParallel_Pyra; iElem++) { - nodes[0] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 0); - nodes[1] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 1); - nodes[2] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 2); - nodes[3] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 3); - nodes[4] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4); - nodes[5] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4); - nodes[6] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4); - nodes[7] = dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4); + nodes[0] = dataSorter->GetElemConnectivity(PYRAMID, iElem, 0); + nodes[1] = dataSorter->GetElemConnectivity(PYRAMID, iElem, 1); + nodes[2] = dataSorter->GetElemConnectivity(PYRAMID, iElem, 2); + nodes[3] = dataSorter->GetElemConnectivity(PYRAMID, iElem, 3); + nodes[4] = dataSorter->GetElemConnectivity(PYRAMID, iElem, 4); + nodes[5] = dataSorter->GetElemConnectivity(PYRAMID, iElem, 4); + nodes[6] = dataSorter->GetElemConnectivity(PYRAMID, iElem, 4); + nodes[7] = dataSorter->GetElemConnectivity(PYRAMID, iElem, 4); err = tecZoneNodeMapWrite64(file_handle, zone, rank, 1, 8, nodes); if (err) cout << rank << ": Error outputting Tecplot node values." << endl; } @@ -592,7 +592,7 @@ void CTecplotBinaryFileWriter::Write_Data(string val_filename){ usedTime = stopTime-startTime; - fileSize = Determine_Filesize(val_filename); + fileSize = DetermineFilesize(val_filename); /*--- Compute and store the bandwidth ---*/ @@ -602,7 +602,7 @@ void CTecplotBinaryFileWriter::Write_Data(string val_filename){ int64_t CTecplotBinaryFileWriter::GetHaloNodeNumber(unsigned long global_node_number, unsigned long last_local_node, vector const &halo_node_list) { - vector::const_iterator it = lower_bound(halo_node_list.begin(), halo_node_list.end(), global_node_number); + auto it = lower_bound(halo_node_list.begin(), halo_node_list.end(), global_node_number); assert(it != halo_node_list.end()); assert(*it == global_node_number); /* When C++11 is universally available, replace the following mouthful with "auto" */ diff --git a/SU2_CFD/src/output/filewriter/CTecplotFileWriter.cpp b/SU2_CFD/src/output/filewriter/CTecplotFileWriter.cpp index 52fd61e6aa9..58a02741f28 100644 --- a/SU2_CFD/src/output/filewriter/CTecplotFileWriter.cpp +++ b/SU2_CFD/src/output/filewriter/CTecplotFileWriter.cpp @@ -2,7 +2,7 @@ * \file CTecplotFileWriter.cpp * \brief Filewriter class for Tecplot ASCII format. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -33,9 +33,9 @@ CTecplotFileWriter::CTecplotFileWriter(CParallelDataSorter *valDataSorter, unsigned long valTimeIter, su2double valTimeStep) : CFileWriter(valDataSorter, fileExt), timeIter(valTimeIter), timeStep(valTimeStep){} -CTecplotFileWriter::~CTecplotFileWriter(){} +CTecplotFileWriter::~CTecplotFileWriter()= default; -void CTecplotFileWriter::Write_Data(string val_filename){ +void CTecplotFileWriter::WriteData(string val_filename){ /*--- We append the pre-defined suffix (extension) to the filename (prefix) ---*/ val_filename.append(fileExt); @@ -156,51 +156,51 @@ void CTecplotFileWriter::Write_Data(string val_filename){ if (rank == iProcessor) { for (iElem = 0; iElem < nParallel_Line; iElem++) { - Tecplot_File << dataSorter->GetElem_Connectivity(LINE, iElem, 0) << "\t"; - Tecplot_File << dataSorter->GetElem_Connectivity(LINE, iElem, 1)<< "\n"; + Tecplot_File << dataSorter->GetElemConnectivity(LINE, iElem, 0) << "\t"; + Tecplot_File << dataSorter->GetElemConnectivity(LINE, iElem, 1)<< "\n"; } for (iElem = 0; iElem < nParallel_Tria; iElem++) { - Tecplot_File << dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 0) << "\t"; - Tecplot_File << dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 1) << "\t"; - Tecplot_File << dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2) << "\t"; - Tecplot_File << dataSorter->GetElem_Connectivity(TRIANGLE, iElem, 2) << "\n"; + Tecplot_File << dataSorter->GetElemConnectivity(TRIANGLE, iElem, 0) << "\t"; + Tecplot_File << dataSorter->GetElemConnectivity(TRIANGLE, iElem, 1) << "\t"; + Tecplot_File << dataSorter->GetElemConnectivity(TRIANGLE, iElem, 2) << "\t"; + Tecplot_File << dataSorter->GetElemConnectivity(TRIANGLE, iElem, 2) << "\n"; } for (iElem = 0; iElem < nParallel_Quad; iElem++) { - Tecplot_File << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 0) << "\t"; - Tecplot_File << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 1) << "\t"; - Tecplot_File << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 2) << "\t"; - Tecplot_File << dataSorter->GetElem_Connectivity(QUADRILATERAL, iElem, 3) << "\n"; + Tecplot_File << dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 0) << "\t"; + Tecplot_File << dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 1) << "\t"; + Tecplot_File << dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 2) << "\t"; + Tecplot_File << dataSorter->GetElemConnectivity(QUADRILATERAL, iElem, 3) << "\n"; } for (iElem = 0; iElem < nParallel_Tetr; iElem++) { - Tecplot_File << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 0) << "\t" << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 1) << "\t"; - Tecplot_File << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 2) << "\t" << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 2) << "\t"; - Tecplot_File << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3) << "\t" << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3) << "\t"; - Tecplot_File << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3) << "\t" << dataSorter->GetElem_Connectivity(TETRAHEDRON, iElem, 3) << "\n"; + Tecplot_File << dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 0) << "\t" << dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 1) << "\t"; + Tecplot_File << dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 2) << "\t" << dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 2) << "\t"; + Tecplot_File << dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 3) << "\t" << dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 3) << "\t"; + Tecplot_File << dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 3) << "\t" << dataSorter->GetElemConnectivity(TETRAHEDRON, iElem, 3) << "\n"; } for (iElem = 0; iElem < nParallel_Hexa; iElem++) { - Tecplot_File << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 0) << "\t" << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 1) << "\t"; - Tecplot_File << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 2) << "\t" << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 3) << "\t"; - Tecplot_File << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 4) << "\t" << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 5) << "\t"; - Tecplot_File << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 6) << "\t" << dataSorter->GetElem_Connectivity(HEXAHEDRON, iElem, 7) << "\n"; + Tecplot_File << dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 0) << "\t" << dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 1) << "\t"; + Tecplot_File << dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 2) << "\t" << dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 3) << "\t"; + Tecplot_File << dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 4) << "\t" << dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 5) << "\t"; + Tecplot_File << dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 6) << "\t" << dataSorter->GetElemConnectivity(HEXAHEDRON, iElem, 7) << "\n"; } for (iElem = 0; iElem < nParallel_Pris; iElem++) { - Tecplot_File << dataSorter->GetElem_Connectivity(PRISM, iElem, 0) << "\t" << dataSorter->GetElem_Connectivity(PRISM, iElem, 1) << "\t"; - Tecplot_File << dataSorter->GetElem_Connectivity(PRISM, iElem, 1) << "\t" << dataSorter->GetElem_Connectivity(PRISM, iElem, 2) << "\t"; - Tecplot_File << dataSorter->GetElem_Connectivity(PRISM, iElem, 3) << "\t" << dataSorter->GetElem_Connectivity(PRISM, iElem, 4) << "\t"; - Tecplot_File << dataSorter->GetElem_Connectivity(PRISM, iElem, 4) << "\t" << dataSorter->GetElem_Connectivity(PRISM, iElem, 5) << "\n"; + Tecplot_File << dataSorter->GetElemConnectivity(PRISM, iElem, 0) << "\t" << dataSorter->GetElemConnectivity(PRISM, iElem, 1) << "\t"; + Tecplot_File << dataSorter->GetElemConnectivity(PRISM, iElem, 1) << "\t" << dataSorter->GetElemConnectivity(PRISM, iElem, 2) << "\t"; + Tecplot_File << dataSorter->GetElemConnectivity(PRISM, iElem, 3) << "\t" << dataSorter->GetElemConnectivity(PRISM, iElem, 4) << "\t"; + Tecplot_File << dataSorter->GetElemConnectivity(PRISM, iElem, 4) << "\t" << dataSorter->GetElemConnectivity(PRISM, iElem, 5) << "\n"; } for (iElem = 0; iElem < nParallel_Pyra; iElem++) { - Tecplot_File << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 0) << "\t" << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 1) << "\t"; - Tecplot_File << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 2) << "\t" << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 3) << "\t"; - Tecplot_File << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4) << "\t" << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4) << "\t"; - Tecplot_File << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4) << "\t" << dataSorter->GetElem_Connectivity(PYRAMID, iElem, 4) << "\n"; + Tecplot_File << dataSorter->GetElemConnectivity(PYRAMID, iElem, 0) << "\t" << dataSorter->GetElemConnectivity(PYRAMID, iElem, 1) << "\t"; + Tecplot_File << dataSorter->GetElemConnectivity(PYRAMID, iElem, 2) << "\t" << dataSorter->GetElemConnectivity(PYRAMID, iElem, 3) << "\t"; + Tecplot_File << dataSorter->GetElemConnectivity(PYRAMID, iElem, 4) << "\t" << dataSorter->GetElemConnectivity(PYRAMID, iElem, 4) << "\t"; + Tecplot_File << dataSorter->GetElemConnectivity(PYRAMID, iElem, 4) << "\t" << dataSorter->GetElemConnectivity(PYRAMID, iElem, 4) << "\n"; } @@ -219,7 +219,7 @@ void CTecplotFileWriter::Write_Data(string val_filename){ usedTime = stopTime-startTime; - fileSize = Determine_Filesize(val_filename); + fileSize = DetermineFilesize(val_filename); /*--- Compute and store the bandwidth ---*/ diff --git a/SU2_CFD/src/output/output_physics.cpp b/SU2_CFD/src/output/output_physics.cpp deleted file mode 100644 index 47fc5203d35..00000000000 --- a/SU2_CFD/src/output/output_physics.cpp +++ /dev/null @@ -1,296 +0,0 @@ -/*! - * \file output_physics.cpp - * \brief Main subroutines to compute physical output quantities such as CL, CD, entropy generation, mass flow, ecc... . - * \author S. Vitale - * \version 7.5.1 "Blackbird" - * - * SU2 Project Website: https://su2code.github.io - * - * The SU2 Project is maintained by the SU2 Foundation - * (http://su2foundation.org) - * - * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) - * - * SU2 is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * SU2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with SU2. If not, see . - */ - - -#include "../../include/output/COutputLegacy.hpp" - -#include "../../../Common/include/geometry/CGeometry.hpp" -#include "../../include/solvers/CSolver.hpp" - -void COutputLegacy::ComputeTurboPerformance(CSolver *solver_container, CGeometry *geometry, CConfig *config) { - - CFluidModel *FluidModel; - unsigned short nDim = geometry->GetnDim(); - unsigned short iMarkerTP, iSpan, iDim, iStage, iBlade; - unsigned short nMarkerTP = config->GetnMarker_Turbomachinery(); - FluidModel = solver_container->GetFluidModel(); - su2double area, absVel2, soundSpeed, mach, tangVel, tangVel2, *relVel, relVel2; - su2double relPressureIn, relPressureOut, enthalpyOutIs, relVelOutIs2; - relVel = new su2double[nDim]; - su2double muLam, kine, omega, nu; - bool turbulent = ((config->GetKind_Solver() == MAIN_SOLVER::RANS) || (config->GetKind_Solver() == MAIN_SOLVER::DISC_ADJ_RANS)); - bool menter_sst = (config->GetKind_Turb_Model() == TURB_MODEL::SST); - - unsigned short nBladesRow, nStages; - - nBladesRow = config->GetnMarker_Turbomachinery(); - nStages = SU2_TYPE::Int(nBladesRow/2); - - - /*--- Compute BC imposed value for convergence monitoring ---*/ - for(iMarkerTP = 0; iMarkerTP < nMarkerTP; iMarkerTP++ ){ - for(iSpan = 0; iSpan < config->GetnSpan_iZones(iMarkerTP) + 1; iSpan++){ - if(config->GetRampOutletPressure() && config->GetInnerIter() > 0){ - PressureOut_BC[iMarkerTP][iSpan] = config->GetMonitorOutletPressure()/config->GetPressure_Ref(); - } - FluidModel->SetTDState_PT(config->GetTotalPressureIn_BC(), config->GetTotalTemperatureIn_BC()); - TotalEnthalpyIn_BC[iMarkerTP][iSpan] = FluidModel->GetStaticEnergy()+ FluidModel->GetPressure()/FluidModel->GetDensity(); - EntropyIn_BC[iMarkerTP][iSpan] = FluidModel->GetEntropy(); - } - } - - /*--- Compute performance for each blade ---*/ - for(iMarkerTP = 0; iMarkerTP < nMarkerTP; iMarkerTP++ ){ - for(iSpan = 0; iSpan < config->GetnSpan_iZones(iMarkerTP) + 1; iSpan++){ - - - /*--- INFLOW ---*/ - /*--- Retrieve Inflow primitive quantities ---*/ - DensityIn[iMarkerTP][iSpan] = solver_container->GetDensityIn(iMarkerTP, iSpan); - PressureIn[iMarkerTP][iSpan] = solver_container->GetPressureIn(iMarkerTP, iSpan); - - absVel2 = 0.0; - - for (iDim = 0; iDim < nDim; iDim++){ - TurboVelocityIn[iMarkerTP][iSpan][iDim] = solver_container->GetTurboVelocityIn(iMarkerTP, iSpan)[iDim]; - absVel2 += TurboVelocityIn[iMarkerTP][iSpan][iDim]*TurboVelocityIn[iMarkerTP][iSpan][iDim]; - } - TurboVelocityIn[iMarkerTP][iSpan][nDim] = sqrt(absVel2); - - TRadius[iMarkerTP][iSpan] = geometry->GetTurboRadiusIn(iMarkerTP, iSpan); - area = geometry->GetSpanAreaIn(iMarkerTP, iSpan); - - /*--- Compute static Inflow quantities ---*/ - FluidModel->SetTDState_Prho(PressureIn[iMarkerTP][iSpan], DensityIn[iMarkerTP][iSpan]); - EntropyIn[iMarkerTP][iSpan] = FluidModel->GetEntropy(); - MassFlowIn[iMarkerTP][iSpan] = config->GetnBlades(iMarkerTP)*DensityIn[iMarkerTP][iSpan]*TurboVelocityIn[iMarkerTP][iSpan][0]*area; - AbsFlowAngleIn[iMarkerTP][iSpan] = atan(TurboVelocityIn[iMarkerTP][iSpan][1]/TurboVelocityIn[iMarkerTP][iSpan][0]); - EnthalpyIn[iMarkerTP][iSpan] = FluidModel->GetStaticEnergy() + PressureIn[iMarkerTP][iSpan]/DensityIn[iMarkerTP][iSpan]; - soundSpeed = FluidModel->GetSoundSpeed(); - - - /*--- Compute Total Inflow quantities ---*/ - TotalEnthalpyIn[iMarkerTP][iSpan] = EnthalpyIn[iMarkerTP][iSpan] + 0.5*absVel2; - FluidModel->SetTDState_hs(TotalEnthalpyIn[iMarkerTP][iSpan], EntropyIn[iMarkerTP][iSpan]); - TotalPressureIn[iMarkerTP][iSpan] = FluidModel->GetPressure(); - TotalTemperatureIn[iMarkerTP][iSpan] = FluidModel->GetTemperature(); - - /*--- Retrieve Inflow relative quantities ---*/ - tangVel = geometry->GetTangGridVelIn(iMarkerTP, iSpan); - tangVel2 = tangVel*tangVel; - - for (iDim = 0; iDim < nDim; iDim++){ - relVel[iDim] = TurboVelocityIn[iMarkerTP][iSpan][iDim]; - } - relVel[1] -= tangVel; - - relVel2 = 0.0; - for (iDim = 0; iDim < nDim; iDim++){ - relVel2 += relVel[iDim]*relVel[iDim]; - } - - /*--- Compute Total relative Inflow quantities ---*/ - RothalpyIn[iMarkerTP][iSpan] = EnthalpyIn[iMarkerTP][iSpan] + 0.5*relVel2 - 0.5*tangVel2; - FluidModel->SetTDState_hs(RothalpyIn[iMarkerTP][iSpan], EntropyIn[iMarkerTP][iSpan]); - relPressureIn = FluidModel->GetPressure(); - - /*--- Compute kinematic relative Inflow quantities ---*/ - FlowAngleIn[iMarkerTP][iSpan] = atan(relVel[1]/relVel[0]); - mach = 0.0; - for (iDim = 0; iDim < nDim; iDim++){ - MachIn[iMarkerTP][iSpan][iDim] = relVel[iDim]/soundSpeed; - mach = MachIn[iMarkerTP][iSpan][iDim]*MachIn[iMarkerTP][iSpan][iDim]; - } - MachIn[iMarkerTP][iSpan][nDim] = sqrt(mach); - - /*--- Compute Turbulent Inflow quantities ---*/ - if(turbulent){ - FluidModel->SetTDState_Prho(PressureIn[iMarkerTP][iSpan], DensityIn[iMarkerTP][iSpan]); - muLam = FluidModel->GetLaminarViscosity(); - if(menter_sst){ - kine = solver_container->GetKineIn(iMarkerTP, iSpan); - omega = solver_container->GetOmegaIn(iMarkerTP, iSpan); - TurbIntensityIn[iMarkerTP][iSpan] = sqrt(2.0/3.0*kine/absVel2); - Turb2LamViscRatioIn[iMarkerTP][iSpan] = DensityIn[iMarkerTP][iSpan]*kine/(muLam*omega); -// TurbIntensityIn[iMarkerTP][iSpan] = kine; -// Turb2LamViscRatioIn[iMarkerTP][iSpan] = omega; - } - else{ - nu = solver_container->GetNuIn(iMarkerTP, iSpan); - NuFactorIn[iMarkerTP][iSpan] = nu*DensityIn[iMarkerTP][iSpan]/muLam; - if (config->GetSAParsedOptions().bc) { - NuFactorIn[iMarkerTP][iSpan] = nu*DensityIn[iMarkerTP][iSpan]/muLam/0.005; - } - } - } - - /*--- OUTFLOW ---*/ - /*--- Retrieve Outflow primitive quantities ---*/ - DensityOut[iMarkerTP][iSpan] = solver_container->GetDensityOut(iMarkerTP, iSpan); - PressureOut[iMarkerTP][iSpan] = solver_container->GetPressureOut(iMarkerTP, iSpan); - absVel2 = 0.0; - - for (iDim = 0; iDim < nDim; iDim++){ - TurboVelocityOut[iMarkerTP][iSpan][iDim] = solver_container->GetTurboVelocityOut(iMarkerTP, iSpan)[iDim]; - absVel2 += TurboVelocityOut[iMarkerTP][iSpan][iDim]*TurboVelocityOut[iMarkerTP][iSpan][iDim]; - } - TurboVelocityOut[iMarkerTP][iSpan][nDim] = sqrt(absVel2); - - - for (iDim = 0; iDim < 3; iDim++){ - } - area = geometry->GetSpanAreaOut(iMarkerTP, iSpan); - - - /*--- Compute all the Outflow quantities ---*/ - FluidModel->SetTDState_Prho(PressureOut[iMarkerTP][iSpan], DensityOut[iMarkerTP][iSpan]); - EntropyOut[iMarkerTP][iSpan] = FluidModel->GetEntropy(); - MassFlowOut[iMarkerTP][iSpan] = config->GetnBlades(iMarkerTP)*DensityOut[iMarkerTP][iSpan]*TurboVelocityOut[iMarkerTP][iSpan][0]*area; - AbsFlowAngleOut[iMarkerTP][iSpan] = atan(TurboVelocityOut[iMarkerTP][iSpan][1]/TurboVelocityOut[iMarkerTP][iSpan][0]); - EnthalpyOut[iMarkerTP][iSpan] = FluidModel->GetStaticEnergy() + PressureOut[iMarkerTP][iSpan]/DensityOut[iMarkerTP][iSpan]; - soundSpeed = FluidModel->GetSoundSpeed(); - - /*--- Compute Total Outflow quantities ---*/ - TotalEnthalpyOut[iMarkerTP][iSpan] = EnthalpyOut[iMarkerTP][iSpan] + 0.5*absVel2; - FluidModel->SetTDState_hs(TotalEnthalpyOut[iMarkerTP][iSpan], EntropyOut[iMarkerTP][iSpan]); - TotalPressureOut[iMarkerTP][iSpan] = FluidModel->GetPressure(); - TotalTemperatureOut[iMarkerTP][iSpan] = FluidModel->GetTemperature(); - - /*--- Retrieve relative Outflow quantities ---*/ - tangVel = geometry->GetTangGridVelOut(iMarkerTP, iSpan); - tangVel2 = tangVel*tangVel; - - for (iDim = 0; iDim < nDim; iDim++){ - relVel[iDim] = TurboVelocityOut[iMarkerTP][iSpan][iDim]; - } - relVel[1] -= tangVel; - - relVel2 = 0.0; - for (iDim = 0; iDim < nDim; iDim++){ - relVel2 += relVel[iDim]*relVel[iDim]; - } - - /*--- Compute Total relative Outflow quantities ---*/ - RothalpyOut[iMarkerTP][iSpan] = EnthalpyOut[iMarkerTP][iSpan] + 0.5*relVel2 - 0.5*tangVel2; - FluidModel->SetTDState_hs(RothalpyOut[iMarkerTP][iSpan], EntropyOut[iMarkerTP][iSpan]); - relPressureOut = FluidModel->GetPressure(); - - /*--- Compute isentropic Outflow quantities ---*/ - FluidModel->SetTDState_Ps(PressureOut[iMarkerTP][iSpan], EntropyIn[iMarkerTP][iSpan]); - enthalpyOutIs = FluidModel->GetStaticEnergy() + PressureOut[iMarkerTP][iSpan]/FluidModel->GetDensity(); - relVelOutIs2 = 2*(RothalpyOut[iMarkerTP][iSpan] - enthalpyOutIs) + tangVel2; - - - /*--- Compute kinematic relative Outflow quantities ---*/ - FlowAngleOut[iMarkerTP][iSpan] = atan(relVel[1]/relVel[0]); - mach = 0.0; - for (iDim = 0; iDim < nDim; iDim++){ - MachOut[iMarkerTP][iSpan][iDim] = relVel[iDim]/soundSpeed; - mach = MachOut[iMarkerTP][iSpan][iDim]*MachOut[iMarkerTP][iSpan][iDim]; - } - MachOut[iMarkerTP][iSpan][nDim] = sqrt(mach); - - /*--- Compute Turbulent Outflow quantities ---*/ - if(turbulent){ - FluidModel->SetTDState_Prho(PressureOut[iMarkerTP][iSpan], DensityOut[iMarkerTP][iSpan]); - muLam = FluidModel->GetLaminarViscosity(); - if(menter_sst){ - kine = solver_container->GetKineOut(iMarkerTP, iSpan); - omega = solver_container->GetOmegaOut(iMarkerTP, iSpan); - TurbIntensityOut[iMarkerTP][iSpan] = sqrt(2.0/3.0*kine/absVel2); - Turb2LamViscRatioOut[iMarkerTP][iSpan] = DensityOut[iMarkerTP][iSpan]*kine/(muLam*omega); -// TurbIntensityOut[iMarkerTP][iSpan] = kine; -// Turb2LamViscRatioOut[iMarkerTP][iSpan] = omega; - } - else{ - nu = solver_container->GetNuOut(iMarkerTP, iSpan); - NuFactorOut[iMarkerTP][iSpan] = nu*DensityOut[iMarkerTP][iSpan]/muLam; - if (config->GetSAParsedOptions().bc) { - NuFactorOut[iMarkerTP][iSpan] = nu*DensityOut[iMarkerTP][iSpan]/muLam/0.005; - } - } - } - - /*--- TURBO-PERFORMANCE---*/ - EntropyGen[iMarkerTP][iSpan] = (EntropyOut[iMarkerTP][iSpan] - EntropyIn[iMarkerTP][iSpan])/abs(EntropyIn_BC[iMarkerTP][iSpan] + 1); - EulerianWork[iMarkerTP][iSpan] = TotalEnthalpyIn[iMarkerTP][iSpan] - TotalEnthalpyOut[iMarkerTP][iSpan]; - TotalPressureLoss[iMarkerTP][iSpan] = (relPressureIn - relPressureOut)/(relPressureIn - PressureOut[iMarkerTP][iSpan]); - KineticEnergyLoss[iMarkerTP][iSpan] = 2*(EnthalpyOut[iMarkerTP][iSpan] - enthalpyOutIs)/relVelOutIs2; - PressureRatio[iMarkerTP][iSpan] = TotalPressureOut[iMarkerTP][iSpan]/TotalPressureIn[iMarkerTP][iSpan]; - EnthalpyOutIs[iMarkerTP][iSpan] = (pow(TotalPressureOut[iMarkerTP][iSpan]/TotalPressureIn[iMarkerTP][iSpan], 0.4/1.4) - 1.0)/(TotalTemperatureOut[iMarkerTP][iSpan]/TotalTemperatureIn[iMarkerTP][iSpan] -1.0); - } - } - - if(nBladesRow > 1){ - /*--- Compute performance for each stage ---*/ - - EulerianWork[nBladesRow + nStages][nSpanWiseSections] = 0.0; - /*---Comnpute performance for each stage---*/ - for(iStage = 0; iStage < nStages; iStage++ ){ - FluidModel->SetTDState_Ps(PressureOut[iStage*2 +1][config->GetnSpan_iZones(iStage*2 +1)], EntropyIn[iStage*2][config->GetnSpan_iZones(iStage*2)]); - EnthalpyOutIs[nBladesRow + iStage][nSpanWiseSections] = FluidModel->GetStaticEnergy() + PressureOut[iStage*2 +1][config->GetnSpan_iZones(iStage*2 +1)]/FluidModel->GetDensity(); - FluidModel->SetTDState_Prho(PressureOut[iStage*2 +1][config->GetnSpan_iZones(iStage*2 +1)], DensityOut[iStage*2 +1][config->GetnSpan_iZones(iStage*2 +1)]); - absVel2 = 0.0; - for (iDim = 0; iDimGetnSpan_iZones(iStage*2 +1)][iDim]*TurboVelocityOut[iStage*2 +1][config->GetnSpan_iZones(iStage*2 +1)][iDim]; - TotalEnthalpyOutIs[nBladesRow + iStage][nSpanWiseSections] = EnthalpyOutIs[nBladesRow + iStage][nSpanWiseSections] + 0.5*absVel2; - - TotalTotalEfficiency[nBladesRow + iStage][nSpanWiseSections] = (TotalEnthalpyIn[iStage*2][config->GetnSpan_iZones(iStage*2)] - TotalEnthalpyOut[iStage*2 + 1][config->GetnSpan_iZones(iStage*2 +1)]); - TotalTotalEfficiency[nBladesRow + iStage][nSpanWiseSections] /= (TotalEnthalpyIn[iStage*2][config->GetnSpan_iZones(iStage*2)] - TotalEnthalpyOutIs[nBladesRow + iStage][nSpanWiseSections]); - TotalStaticEfficiency[nBladesRow + iStage][nSpanWiseSections] = (TotalEnthalpyIn[iStage*2][config->GetnSpan_iZones(iStage*2)] - TotalEnthalpyOut[iStage*2 + 1][config->GetnSpan_iZones(iStage*2+1)]); - TotalStaticEfficiency[nBladesRow + iStage][nSpanWiseSections] /= (TotalEnthalpyIn[iStage*2][config->GetnSpan_iZones(iStage*2)] - EnthalpyOutIs[nBladesRow + iStage][nSpanWiseSections]); - PressureRatio[nBladesRow + iStage][nSpanWiseSections] = (PressureRatio[iStage*2][config->GetnSpan_iZones(iStage*2)]*PressureOut[iStage*2][config->GetnSpan_iZones(iStage*2)]/PressureOut[iStage*2 + 1][config->GetnSpan_iZones(iStage*2+1)]); - MassFlowIn[nBladesRow + iStage][nSpanWiseSections] = MassFlowIn[iStage*2][config->GetnSpan_iZones(iStage*2)]; - MassFlowOut[nBladesRow + iStage][nSpanWiseSections] = MassFlowOut[iStage*2 + 1][config->GetnSpan_iZones(iStage*2+1)]; - EntropyGen[nBladesRow + iStage][nSpanWiseSections] = EntropyGen[iStage*2 + 1][config->GetnSpan_iZones(iStage*2 +1)] + EntropyGen[iStage*2][config->GetnSpan_iZones(iStage*2)]; - - } - - /*---Compute turbo performance for full machine---*/ - FluidModel->SetTDState_Ps(PressureOut[nBladesRow-1][config->GetnSpan_iZones(nBladesRow-1)], EntropyIn[0][config->GetnSpan_iZones(0)]); - EnthalpyOutIs[nBladesRow + nStages][nSpanWiseSections] = FluidModel->GetStaticEnergy() + PressureOut[nBladesRow-1][config->GetnSpan_iZones(nBladesRow-1)]/FluidModel->GetDensity(); - FluidModel->SetTDState_Prho(PressureOut[nBladesRow-1][config->GetnSpan_iZones(nBladesRow-1)], DensityOut[nBladesRow-1][config->GetnSpan_iZones(nBladesRow-1)]); - absVel2 = 0.0; - for (iDim = 0; iDimGetnSpan_iZones(nBladesRow-1)][iDim]*TurboVelocityOut[nBladesRow-1][config->GetnSpan_iZones(nBladesRow-1)][iDim]; - TotalEnthalpyOutIs[nBladesRow + nStages][nSpanWiseSections] = EnthalpyOutIs[nBladesRow + nStages][nSpanWiseSections] + 0.5*absVel2; - - TotalTotalEfficiency[nBladesRow + nStages][nSpanWiseSections] = (TotalEnthalpyIn[0][config->GetnSpan_iZones(0)] - TotalEnthalpyOut[nBladesRow-1][config->GetnSpan_iZones(nBladesRow-1)]); - TotalTotalEfficiency[nBladesRow + nStages][nSpanWiseSections] /= (TotalEnthalpyIn[0][config->GetnSpan_iZones(0)] - TotalEnthalpyOutIs[nBladesRow + nStages][nSpanWiseSections]); - TotalStaticEfficiency[nBladesRow +nStages][nSpanWiseSections] = (TotalEnthalpyIn[0][config->GetnSpan_iZones(0)] - TotalEnthalpyOut[nBladesRow-1][config->GetnSpan_iZones(nBladesRow-1)]); - TotalStaticEfficiency[nBladesRow +nStages][nSpanWiseSections] /= (TotalEnthalpyIn[0][config->GetnSpan_iZones(0)] - EnthalpyOutIs[nBladesRow + nStages][nSpanWiseSections]); - PressureRatio[nBladesRow + nStages][nSpanWiseSections] = PressureRatio[0][config->GetnSpan_iZones(0)]*PressureOut[0][config->GetnSpan_iZones(0)]/PressureOut[nBladesRow-1][config->GetnSpan_iZones(nBladesRow-1)]; - MassFlowIn[nBladesRow + nStages][nSpanWiseSections] = MassFlowIn[0][config->GetnSpan_iZones(0)]; - MassFlowOut[nBladesRow + nStages][nSpanWiseSections] = MassFlowOut[nBladesRow-1][config->GetnSpan_iZones(nBladesRow-1)]; - - EntropyGen[nBladesRow + nStages][nSpanWiseSections] = 0.0; - for(iBlade = 0; iBlade < nBladesRow; iBlade++ ){ - EntropyGen[nBladesRow + nStages][nSpanWiseSections] += EntropyGen[iBlade][config->GetnSpan_iZones(iBlade)]; - } - } - - delete [] relVel; -} diff --git a/SU2_CFD/src/output/output_structure_legacy.cpp b/SU2_CFD/src/output/output_structure_legacy.cpp deleted file mode 100644 index cdf6a468c74..00000000000 --- a/SU2_CFD/src/output/output_structure_legacy.cpp +++ /dev/null @@ -1,7227 +0,0 @@ -/*! - * \file output_structure_legacy.cpp - * \brief Main subroutines for output solver information - * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" - * - * SU2 Project Website: https://su2code.github.io - * - * The SU2 Project is maintained by the SU2 Foundation - * (http://su2foundation.org) - * - * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) - * - * SU2 is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * SU2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with SU2. If not, see . - */ - - -#include "../../include/output/COutputLegacy.hpp" - -#include "../../../Common/include/geometry/CGeometry.hpp" -#include "../../include/solvers/CBaselineSolver.hpp" -#include "../../include/fluid/CCoolProp.hpp" - -COutputLegacy::COutputLegacy(CConfig *config) { - - rank = SU2_MPI::GetRank(); - size = SU2_MPI::GetSize(); - - unsigned short iDim, iSpan, iMarker; - - /*--- Initialize point and connectivity counters to zero. ---*/ - - /*--- Initialize turbo flag ---*/ - turbo = config->GetBoolTurbomachinery(); - - if(turbo){ - /*--- Initializate quantities for turboperformace ---*/ - nSpanWiseSections = config->GetnSpanMaxAllZones(); - nMarkerTurboPerf = config->GetnMarker_TurboPerformance(); - - - TotalStaticEfficiency = new su2double*[nMarkerTurboPerf]; - TotalTotalEfficiency = new su2double*[nMarkerTurboPerf]; - KineticEnergyLoss = new su2double*[nMarkerTurboPerf]; - TRadius = new su2double*[nMarkerTurboPerf]; - TotalPressureLoss = new su2double*[nMarkerTurboPerf]; - MassFlowIn = new su2double*[nMarkerTurboPerf]; - MassFlowOut = new su2double*[nMarkerTurboPerf]; - FlowAngleIn = new su2double*[nMarkerTurboPerf]; - FlowAngleIn_BC = new su2double*[nMarkerTurboPerf]; - FlowAngleOut = new su2double*[nMarkerTurboPerf]; - EulerianWork = new su2double*[nMarkerTurboPerf]; - TotalEnthalpyIn = new su2double*[nMarkerTurboPerf]; - TotalEnthalpyIn_BC = new su2double*[nMarkerTurboPerf]; - EntropyIn = new su2double*[nMarkerTurboPerf]; - EntropyOut = new su2double*[nMarkerTurboPerf]; - EntropyIn_BC = new su2double*[nMarkerTurboPerf]; - PressureRatio = new su2double*[nMarkerTurboPerf]; - TotalTemperatureIn = new su2double*[nMarkerTurboPerf]; - EnthalpyOut = new su2double*[nMarkerTurboPerf]; - MachIn = new su2double**[nMarkerTurboPerf]; - MachOut = new su2double**[nMarkerTurboPerf]; - VelocityOutIs = new su2double*[nMarkerTurboPerf]; - DensityIn = new su2double*[nMarkerTurboPerf]; - PressureIn = new su2double*[nMarkerTurboPerf]; - TurboVelocityIn = new su2double**[nMarkerTurboPerf]; - DensityOut = new su2double*[nMarkerTurboPerf]; - PressureOut = new su2double*[nMarkerTurboPerf]; - TurboVelocityOut = new su2double**[nMarkerTurboPerf]; - EnthalpyOutIs = new su2double*[nMarkerTurboPerf]; - EntropyGen = new su2double*[nMarkerTurboPerf]; - AbsFlowAngleIn = new su2double*[nMarkerTurboPerf]; - TotalEnthalpyOut = new su2double*[nMarkerTurboPerf]; - TotalEnthalpyOutIs = new su2double*[nMarkerTurboPerf]; - RothalpyIn = new su2double*[nMarkerTurboPerf]; - RothalpyOut = new su2double*[nMarkerTurboPerf]; - AbsFlowAngleOut = new su2double*[nMarkerTurboPerf]; - PressureOut_BC = new su2double*[nMarkerTurboPerf]; - TemperatureIn = new su2double*[nMarkerTurboPerf]; - TemperatureOut = new su2double*[nMarkerTurboPerf]; - TotalPressureIn = new su2double*[nMarkerTurboPerf]; - TotalPressureOut = new su2double*[nMarkerTurboPerf]; - TotalTemperatureOut = new su2double*[nMarkerTurboPerf]; - EnthalpyIn = new su2double*[nMarkerTurboPerf]; - TurbIntensityIn = new su2double*[nMarkerTurboPerf]; - Turb2LamViscRatioIn = new su2double*[nMarkerTurboPerf]; - TurbIntensityOut = new su2double*[nMarkerTurboPerf]; - Turb2LamViscRatioOut = new su2double*[nMarkerTurboPerf]; - NuFactorIn = new su2double*[nMarkerTurboPerf]; - NuFactorOut = new su2double*[nMarkerTurboPerf]; - - for (iMarker = 0; iMarker < nMarkerTurboPerf; iMarker++){ - TotalStaticEfficiency [iMarker] = new su2double [nSpanWiseSections + 1]; - TotalTotalEfficiency [iMarker] = new su2double [nSpanWiseSections + 1]; - KineticEnergyLoss [iMarker] = new su2double [nSpanWiseSections + 1]; - TRadius [iMarker] = new su2double [nSpanWiseSections + 1]; - TotalPressureLoss [iMarker] = new su2double [nSpanWiseSections + 1]; - MassFlowIn [iMarker] = new su2double [nSpanWiseSections + 1]; - MassFlowOut [iMarker] = new su2double [nSpanWiseSections + 1]; - FlowAngleIn [iMarker] = new su2double [nSpanWiseSections + 1]; - FlowAngleIn_BC [iMarker] = new su2double [nSpanWiseSections + 1]; - FlowAngleOut [iMarker] = new su2double [nSpanWiseSections + 1]; - EulerianWork [iMarker] = new su2double [nSpanWiseSections + 1]; - TotalEnthalpyIn [iMarker] = new su2double [nSpanWiseSections + 1]; - TotalEnthalpyIn_BC [iMarker] = new su2double [nSpanWiseSections + 1]; - EntropyIn [iMarker] = new su2double [nSpanWiseSections + 1]; - EntropyOut [iMarker] = new su2double [nSpanWiseSections + 1]; - EntropyIn_BC [iMarker] = new su2double [nSpanWiseSections + 1]; - PressureRatio [iMarker] = new su2double [nSpanWiseSections + 1]; - TotalTemperatureIn [iMarker] = new su2double [nSpanWiseSections + 1]; - EnthalpyOut [iMarker] = new su2double [nSpanWiseSections + 1]; - MachIn [iMarker] = new su2double*[nSpanWiseSections + 1]; - MachOut [iMarker] = new su2double*[nSpanWiseSections + 1]; - VelocityOutIs [iMarker] = new su2double [nSpanWiseSections + 1]; - DensityIn [iMarker] = new su2double [nSpanWiseSections + 1]; - PressureIn [iMarker] = new su2double [nSpanWiseSections + 1]; - TurboVelocityIn [iMarker] = new su2double*[nSpanWiseSections + 1]; - DensityOut [iMarker] = new su2double [nSpanWiseSections + 1]; - PressureOut [iMarker] = new su2double [nSpanWiseSections + 1]; - TurboVelocityOut [iMarker] = new su2double*[nSpanWiseSections + 1]; - EnthalpyOutIs [iMarker] = new su2double [nSpanWiseSections + 1]; - EntropyGen [iMarker] = new su2double [nSpanWiseSections + 1]; - AbsFlowAngleIn [iMarker] = new su2double [nSpanWiseSections + 1]; - TotalEnthalpyOut [iMarker] = new su2double [nSpanWiseSections + 1]; - TotalEnthalpyOutIs [iMarker] = new su2double [nSpanWiseSections + 1]; - RothalpyIn [iMarker] = new su2double [nSpanWiseSections + 1]; - RothalpyOut [iMarker] = new su2double [nSpanWiseSections + 1]; - AbsFlowAngleOut [iMarker] = new su2double [nSpanWiseSections + 1]; - PressureOut_BC [iMarker] = new su2double [nSpanWiseSections + 1]; - TemperatureIn [iMarker] = new su2double [nSpanWiseSections + 1]; - TemperatureOut [iMarker] = new su2double [nSpanWiseSections + 1]; - TotalPressureIn [iMarker] = new su2double [nSpanWiseSections + 1]; - TotalPressureOut [iMarker] = new su2double [nSpanWiseSections + 1]; - TotalTemperatureOut [iMarker] = new su2double [nSpanWiseSections + 1]; - EnthalpyIn [iMarker] = new su2double [nSpanWiseSections + 1]; - TurbIntensityIn [iMarker] = new su2double [nSpanWiseSections + 1]; - Turb2LamViscRatioIn [iMarker] = new su2double [nSpanWiseSections + 1]; - TurbIntensityOut [iMarker] = new su2double [nSpanWiseSections + 1]; - Turb2LamViscRatioOut [iMarker] = new su2double [nSpanWiseSections + 1]; - NuFactorIn [iMarker] = new su2double [nSpanWiseSections + 1]; - NuFactorOut [iMarker] = new su2double [nSpanWiseSections + 1]; - - - for (iSpan = 0; iSpan < nSpanWiseSections + 1; iSpan++){ - TotalStaticEfficiency [iMarker][iSpan] = 0.0; - TotalTotalEfficiency [iMarker][iSpan] = 0.0; - KineticEnergyLoss [iMarker][iSpan] = 0.0; - TRadius [iMarker][iSpan] = 0.0; - TotalPressureLoss [iMarker][iSpan] = 0.0; - MassFlowIn [iMarker][iSpan] = 0.0; - MassFlowOut [iMarker][iSpan] = 0.0; - FlowAngleIn [iMarker][iSpan] = 0.0; - FlowAngleIn_BC [iMarker][iSpan] = config->GetFlowAngleIn_BC(); - FlowAngleOut [iMarker][iSpan] = 0.0; - EulerianWork [iMarker][iSpan] = 0.0; - TotalEnthalpyIn [iMarker][iSpan] = 0.0; - TotalEnthalpyIn_BC [iMarker][iSpan] = 0.0; - EntropyIn [iMarker][iSpan] = 0.0; - EntropyOut [iMarker][iSpan] = 0.0; - EntropyIn_BC [iMarker][iSpan] = 0.0; - PressureRatio [iMarker][iSpan] = 0.0; - TotalTemperatureIn [iMarker][iSpan] = 0.0; - EnthalpyOut [iMarker][iSpan] = 0.0; - - - VelocityOutIs [iMarker][iSpan] = 0.0; - DensityIn [iMarker][iSpan] = 0.0; - PressureIn [iMarker][iSpan] = 0.0; - - DensityOut [iMarker][iSpan] = 0.0; - PressureOut [iMarker][iSpan] = 0.0; - - EnthalpyOutIs [iMarker][iSpan] = 0.0; - EntropyGen [iMarker][iSpan] = 0.0; - AbsFlowAngleIn [iMarker][iSpan] = 0.0; - TotalEnthalpyOut [iMarker][iSpan] = 0.0; - TotalEnthalpyOutIs [iMarker][iSpan] = 0.0; - RothalpyIn [iMarker][iSpan] = 0.0; - RothalpyOut [iMarker][iSpan] = 0.0; - AbsFlowAngleOut [iMarker][iSpan] = 0.0; - PressureOut_BC [iMarker][iSpan] = config->GetPressureOut_BC(); - - TemperatureIn [iMarker][iSpan] = 0.0; - TemperatureOut [iMarker][iSpan] = 0.0; - TotalPressureIn [iMarker][iSpan] = 0.0; - TotalPressureOut [iMarker][iSpan] = 0.0; - TotalTemperatureOut [iMarker][iSpan] = 0.0; - EnthalpyIn [iMarker][iSpan] = 0.0; - TurbIntensityIn [iMarker][iSpan] = 0.0; - Turb2LamViscRatioIn [iMarker][iSpan] = 0.0; - TurbIntensityOut [iMarker][iSpan] = 0.0; - Turb2LamViscRatioOut [iMarker][iSpan] = 0.0; - NuFactorIn [iMarker][iSpan] = 0.0; - NuFactorOut [iMarker][iSpan] = 0.0; - MachIn [iMarker][iSpan] = new su2double[4]; - MachOut [iMarker][iSpan] = new su2double[4]; - TurboVelocityIn [iMarker][iSpan] = new su2double[4]; - TurboVelocityOut [iMarker][iSpan] = new su2double[4]; - - for (iDim = 0; iDim < 4; iDim++){ - MachIn [iMarker][iSpan][iDim] = 0.0; - MachOut [iMarker][iSpan][iDim] = 0.0; - TurboVelocityIn [iMarker][iSpan][iDim] = 0.0; - TurboVelocityOut [iMarker][iSpan][iDim] = 0.0; - } - } - } - } -} - -COutputLegacy::~COutputLegacy(void) { - /* delete pointers initialized at construction*/ - /* Coords and Conn_*(Connectivity) have their own dealloc functions */ - /* Data is taken care of in DeallocateSolution function */ - - /*--- Delete turboperformance pointers initiliazed at constrction ---*/ - unsigned short iMarker, iSpan; - if(turbo){ - for(iMarker = 0; iMarker< nMarkerTurboPerf; iMarker++){ - for(iSpan=0; iSpanGetRotating_Frame(); - bool aeroelastic = config->GetAeroelastic_Simulation(); - bool equiv_area = config->GetEquivArea(); - bool buffet = (config->GetViscous() || config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); - bool engine = ((config->GetnMarker_EngineInflow() != 0) || (config->GetnMarker_EngineExhaust() != 0)); - bool actuator_disk = ((config->GetnMarker_ActDiskInlet() != 0) || (config->GetnMarker_ActDiskOutlet() != 0)); - bool turbulent = ((config->GetKind_Solver() == MAIN_SOLVER::RANS) || (config->GetKind_Solver() == MAIN_SOLVER::ADJ_RANS) || - (config->GetKind_Solver() == MAIN_SOLVER::DISC_ADJ_RANS) || (config->GetKind_Solver() == MAIN_SOLVER::DISC_ADJ_INC_RANS) || - (config->GetKind_Solver() == MAIN_SOLVER::INC_RANS)); - bool cont_adj = config->GetContinuous_Adjoint(); - bool disc_adj = config->GetDiscrete_Adjoint(); - bool frozen_visc = (cont_adj && config->GetFrozen_Visc_Cont()) ||( disc_adj && config->GetFrozen_Visc_Disc()); - bool inv_design = (config->GetInvDesign_Cp() || config->GetInvDesign_HeatFlux()); - - bool output_surface = (config->GetnMarker_Analyze() != 0); - bool output_comboObj = (config->GetnObj() > 1); - bool output_per_surface = true; - bool turbo = config->GetBoolTurbomachinery(); - unsigned short direct_diff = config->GetDirectDiff(); - - bool compressible = (config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); - bool incompressible = (config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE); - bool incload = config->GetIncrementalLoad(); - - bool thermal = false; /* Flag for whether to print heat flux values */ - bool weakly_coupled_heat = config->GetWeakly_Coupled_Heat(); - bool radiation = config->AddRadiation(); - - if (config->GetKind_Solver() == MAIN_SOLVER::RANS || config->GetKind_Solver() == MAIN_SOLVER::NAVIER_STOKES || - config->GetKind_Solver() == MAIN_SOLVER::INC_RANS || config->GetKind_Solver() == MAIN_SOLVER::INC_NAVIER_STOKES) { - thermal = true; - } - - /*--- Write file name with extension ---*/ - string filename = config->GetConv_FileName(); - string hist_ext = ".csv"; - if (config->GetTabular_FileFormat() == TAB_OUTPUT::TAB_TECPLOT) hist_ext = ".dat"; - - if(config->GetnZone() > 1){ - filename = config->GetMultizone_HistoryFileName(filename, val_iZone, hist_ext); - } - if(config->GetnTimeInstances() > 1){ - filename = config->GetMultiInstance_HistoryFileName(filename, val_iInst); - } - - if (config->GetTime_Domain() && config->GetRestart()) { - filename = config->GetUnsteady_FileName(filename, config->GetRestart_Iter(), hist_ext); - } - - strcpy (cstr, filename.data()); - - ConvHist_file->open(cstr, ios::out); - ConvHist_file->precision(15); - - /*--- Begin of the header ---*/ - - char begin[]= "\"Iteration\""; - - /*--- Header for the coefficients ---*/ - - char flow_coeff[]= ",\"CL\",\"CD\",\"CSF\",\"CMx\",\"CMy\",\"CMz\",\"CFx\",\"CFy\",\"CFz\",\"CL/CD\",\"AoA\",\"Custom_ObjFunc\""; - char heat_coeff[]= ",\"HeatFlux_Total\",\"HeatFlux_Maximum\",\"Temperature_Total\""; - char equivalent_area_coeff[]= ",\"CEquivArea\",\"CNearFieldOF\""; - char buffet_coeff[]= ",\"Buffet_Metric\""; - char engine_coeff[]= ",\"NetThrust\",\"Power\",\"AeroCDrag\",\"SolidCDrag\",\"Radial_Distortion\",\"Circumferential_Distortion\""; - char rotating_frame_coeff[]= ",\"CMerit\",\"CT\",\"CQ\""; - char fem_coeff[]= ",\"VM_Stress\",\"Force_Coeff\""; - char fem_incload[]= ",\"IncLoad\""; - char adj_coeff[]= ",\"Sens_Geo\",\"Sens_Mach\",\"Sens_AoA\",\"Sens_Press\",\"Sens_Temp\",\"Sens_AoS\""; - char adj_inc_coeff[]=",\"Sens_Geo\",\"Sens_Vin\",\"Sens_Pout\",\"Sens_Temp\""; - char adj_turbo_coeff[]=",\"Sens_Geo\",\"Sens_PressOut\",\"Sens_TotTempIn\""; - char surface_outputs[]= ",\"Avg_MassFlow\",\"Avg_Mach\",\"Avg_Temp\",\"Avg_Press\",\"Avg_Density\",\"Avg_Enthalpy\",\"Avg_NormalVel\",\"Uniformity\",\"Secondary_Strength\",\"Momentum_Distortion\",\"Secondary_Over_Uniformity\",\"Avg_TotalTemp\",\"Avg_TotalPress\",\"Pressure_Drop\""; - char Cp_inverse_design[]= ",\"Cp_Diff\""; - char Heat_inverse_design[]= ",\"HeatFlux_Diff\""; - char d_flow_coeff[] = ",\"D(CL)\",\"D(CD)\",\"D(CSF)\",\"D(CMx)\",\"D(CMy)\",\"D(CMz)\",\"D(CFx)\",\"D(CFy)\",\"D(CFz)\",\"D(CL/CD)\",\"D(Custom_ObjFunc)\""; - char d_thermal_coeff[] = ",\"D(HeatFlux_Total)\",\"D(HeatFlux_Maximum)\""; - char d_engine[] = ",\"D(NetThrust)\",\"D(Power)\",\"D(AeroCDrag)\",\"D(SolidCDrag)\",\"D(Radial_Distortion)\",\"D(Circumferential_Distortion)\""; - char d_turbo_coeff[] = ",\"D(TotalPressureLoss_0)\",\"D(FlowAngleOut_0)\",\"D(TotalEfficency)\",\"D(TotalStaticEfficiency)\", \"D(EntropyGen)\""; - char d_surface_outputs[]= ",\"D(Uniformity)\",\"D(Secondary_Strength)\",\"D(Momentum_Distortion)\",\"D(Secondary_Over_Uniformity)\",\"D(Pressure_Drop)\""; - - /*--- Find the markers being monitored and create a header for them ---*/ - - for (iMarker_Monitoring = 0; iMarker_Monitoring < config->GetnMarker_Monitoring(); iMarker_Monitoring++) { - Monitoring_Tag = config->GetMarker_Monitoring_TagBound(iMarker_Monitoring); - monitoring_coeff += ",\"CL_" + Monitoring_Tag + "\""; - monitoring_coeff += ",\"CD_" + Monitoring_Tag + "\""; - monitoring_coeff += ",\"CSF_" + Monitoring_Tag + "\""; - monitoring_coeff += ",\"CL/CD_" + Monitoring_Tag + "\""; - monitoring_coeff += ",\"CFx_" + Monitoring_Tag + "\""; - monitoring_coeff += ",\"CFy_" + Monitoring_Tag + "\""; - monitoring_coeff += ",\"CFz_" + Monitoring_Tag + "\""; - monitoring_coeff += ",\"CMx_" + Monitoring_Tag + "\""; - monitoring_coeff += ",\"CMy_" + Monitoring_Tag + "\""; - monitoring_coeff += ",\"CMz_" + Monitoring_Tag + "\""; - if(buffet) monitoring_coeff += ",\"Buffet_Metric_" + Monitoring_Tag + "\""; - aeroelastic_coeff += ",\"plunge_" + Monitoring_Tag + "\""; - aeroelastic_coeff += ",\"pitch_" + Monitoring_Tag + "\""; - } - - if (turbo){ - for (iMarker_Monitoring = 0; iMarker_Monitoring < config->GetnMarker_TurboPerformance(); iMarker_Monitoring++) { - - stringstream tag; - tag << iMarker_Monitoring + 1; - - turbo_coeff += ",\"TotalPressureLoss_" + tag.str() + "\""; - turbo_coeff += ",\"KineticEnergyLoss_" + tag.str() + "\""; - turbo_coeff += ",\"EntropyGen_" + tag.str() + "\""; - turbo_coeff += ",\"EulerianWork_" + tag.str() + "\""; - turbo_coeff += ",\"PressureRatio_" + tag.str() + "\""; - turbo_coeff += ",\"FlowAngleIn_" + tag.str() + "\""; - turbo_coeff += ",\"FlowAngleOut_" + tag.str() + "\""; - turbo_coeff += ",\"AbsFlowAngleIn_" + tag.str() + "\""; - turbo_coeff += ",\"AbsFlowAngleOut_" + tag.str() + "\""; - turbo_coeff += ",\"MassFlowIn_" + tag.str() + "\""; - turbo_coeff += ",\"MassFlowOut_" + tag.str() + "\""; - turbo_coeff += ",\"MachIn_" + tag.str() + "\""; - turbo_coeff += ",\"MachOut_" + tag.str() + "\""; - // different from zero only in multi-zone computation - turbo_coeff += ",\"TotalEfficiency_" + tag.str() + "\""; - turbo_coeff += ",\"TotalStaticEfficiency_" + tag.str() + "\""; - - } - } - - char combo_obj[] = ",\"ComboObj\""; - - /*--- Header for the residuals ---*/ - - char flow_resid[]= ",\"Res_Flow[0]\",\"Res_Flow[1]\",\"Res_Flow[2]\",\"Res_Flow[3]\",\"Res_Flow[4]\""; - char adj_flow_resid[]= ",\"Res_AdjFlow[0]\",\"Res_AdjFlow[1]\",\"Res_AdjFlow[2]\",\"Res_AdjFlow[3]\",\"Res_AdjFlow[4]\""; - switch (config->GetKind_Turb_Model()) { - case TURB_MODEL::SA: - SPRINTF (turb_resid, ",\"Res_Turb[0]\""); - break; - case TURB_MODEL::SST: - SPRINTF (turb_resid, ",\"Res_Turb[0]\",\"Res_Turb[1]\""); - break; - default: break; - } - switch (config->GetKind_Turb_Model()) { - case TURB_MODEL::SA: - SPRINTF (adj_turb_resid, ",\"Res_AdjTurb[0]\""); - break; - case TURB_MODEL::SST: - SPRINTF (adj_turb_resid, ",\"Res_AdjTurb[0]\",\"Res_AdjTurb[1]\""); - break; - default: break; - } - char fem_resid[]= ",\"Res_FEM[0]\",\"Res_FEM[1]\",\"Res_FEM[2]\""; - char heat_resid[]= ",\"Res_Heat\""; - char rad_resid[]= ",\"Res_P1-rad\""; - - /*--- End of the header ---*/ - - char end[]= ",\"Linear_Solver_Iterations\",\"CFL_Number\",\"Time(min)\"\n"; - char endfea[]= ",\"Linear_Solver_Iterations\",\"Time(min)\"\n"; - - if ((config->GetTabular_FileFormat() == TAB_OUTPUT::TAB_TECPLOT)) { - ConvHist_file[0] << "TITLE = \"SU2 Simulation\"" << endl; - ConvHist_file[0] << "VARIABLES = "; - } - - /*--- Write the header, case depending ---*/ - - switch (config->GetKind_Solver()) { - - case MAIN_SOLVER::EULER : case MAIN_SOLVER::NAVIER_STOKES: case MAIN_SOLVER::RANS : - case MAIN_SOLVER::INC_EULER : case MAIN_SOLVER::INC_NAVIER_STOKES: case MAIN_SOLVER::INC_RANS : - case MAIN_SOLVER::FEM_EULER : case MAIN_SOLVER::FEM_NAVIER_STOKES: case MAIN_SOLVER::FEM_RANS : case MAIN_SOLVER::FEM_LES: - ConvHist_file[0] << begin; - if (!turbo) ConvHist_file[0] << flow_coeff; - if (buffet) ConvHist_file[0] << buffet_coeff; - if (turbo) ConvHist_file[0] << turbo_coeff; - if (thermal && !turbo) ConvHist_file[0] << heat_coeff; - if (equiv_area) ConvHist_file[0] << equivalent_area_coeff; - if (engine || actuator_disk) ConvHist_file[0] << engine_coeff; - if (inv_design) { - ConvHist_file[0] << Cp_inverse_design; - if (thermal && !turbo) ConvHist_file[0] << Heat_inverse_design; - } - if (rotating_frame && !turbo) ConvHist_file[0] << rotating_frame_coeff; - - ConvHist_file[0] << flow_resid; - if (turbulent) ConvHist_file[0] << turb_resid; - if (weakly_coupled_heat) ConvHist_file[0] << heat_resid; - if (radiation) ConvHist_file[0] << rad_resid; - if (aeroelastic) ConvHist_file[0] << aeroelastic_coeff; - if (output_per_surface) ConvHist_file[0] << monitoring_coeff; - if (output_surface) ConvHist_file[0] << surface_outputs; - if (direct_diff != NO_DERIVATIVE) { - if (!turbo) ConvHist_file[0] << d_flow_coeff; - else ConvHist_file[0] << d_turbo_coeff; - if (engine || actuator_disk) ConvHist_file[0] << d_engine; - if (thermal) ConvHist_file[0] << d_thermal_coeff; - if (output_surface) ConvHist_file[0] << d_surface_outputs; - } - if (output_comboObj) ConvHist_file[0] << combo_obj; - ConvHist_file[0] << end; - - break; - - case MAIN_SOLVER::ADJ_EULER : case MAIN_SOLVER::ADJ_NAVIER_STOKES : case MAIN_SOLVER::ADJ_RANS: - case MAIN_SOLVER::DISC_ADJ_EULER: case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_RANS: - case MAIN_SOLVER::DISC_ADJ_INC_EULER: case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_INC_RANS: - if (!turbo) { - if (compressible) { - ConvHist_file[0] << begin << adj_coeff << adj_flow_resid; - } - if (incompressible) { - ConvHist_file[0] << begin << adj_inc_coeff << adj_flow_resid; - } - } - else ConvHist_file[0] << begin << adj_turbo_coeff << adj_flow_resid; - if ((turbulent) && (!frozen_visc)) ConvHist_file[0] << adj_turb_resid; - ConvHist_file[0] << end; - break; - - case MAIN_SOLVER::HEAT_EQUATION: - ConvHist_file[0] << begin << heat_coeff; - ConvHist_file[0] << heat_resid << end; - break; - - case MAIN_SOLVER::FEM_ELASTICITY: - ConvHist_file[0] << begin << fem_coeff; - if (incload) ConvHist_file[0] << fem_incload; - ConvHist_file[0] << fem_resid << endfea; - break; - - case MAIN_SOLVER::DISC_ADJ_FEM: - ConvHist_file[0] << begin << fem_coeff; - ConvHist_file[0] << fem_resid << endfea; - break; - - default: - break; - } - - if (config->GetTabular_FileFormat() == TAB_OUTPUT::TAB_TECPLOT) { - ConvHist_file[0] << "ZONE T= \"Convergence history\"" << endl; - } - -} - - -void COutputLegacy::SetConvHistory_Body(ofstream *ConvHist_file, - CGeometry ****geometry, - CSolver *****solver_container, - CConfig **config, - CIntegration ****integration, - bool DualTime_Iteration, - su2double timeused, - unsigned short val_iZone, - unsigned short val_iInst) { - - bool output_surface = (config[val_iZone]->GetnMarker_Analyze() != 0); - bool output_comboObj = (config[val_iZone]->GetnObj() > 1); - bool fluid_structure = (config[val_iZone]->GetFSI_Simulation()); - bool fea = ((config[val_iZone]->GetKind_Solver()== MAIN_SOLVER::FEM_ELASTICITY)||(config[val_iZone]->GetKind_Solver()== MAIN_SOLVER::DISC_ADJ_FEM)); - unsigned long iIntIter = config[val_iZone]->GetInnerIter(); - unsigned long iExtIter = config[val_iZone]->GetInnerIter(); - unsigned short FinestMesh = config[val_iZone]->GetFinestMesh(); - unsigned short nZone = config[val_iZone]->GetnZone(); - unsigned short nInst = config[val_iZone]->GetnTimeInstances(); - bool cont_adj = config[val_iZone]->GetContinuous_Adjoint(); - bool disc_adj = config[val_iZone]->GetDiscrete_Adjoint(); - bool energy = config[val_iZone]->GetEnergy_Equation(); - bool incload = config[val_iZone]->GetIncrementalLoad(); - bool fixed_cl = config[val_iZone]->GetFixed_CL_Mode(); - bool output_files = true; - - bool radiation = config[val_iZone]->AddRadiation(); - - bool compressible = (config[val_iZone]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); - bool incompressible = (config[val_iZone]->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE); - - if (!disc_adj && !cont_adj && !DualTime_Iteration) { - - if (fixed_cl && - (solver_container[val_iZone][val_iInst][MESH_0][FLOW_SOL]->GetStart_AoA_FD()) && - (iExtIter != solver_container[val_iZone][val_iInst][MESH_0][FLOW_SOL]->GetIter_Update_AoA())) { - output_files = false; - } - - if (fea || fluid_structure) output_files = false; - - /*--- We need to evaluate some of the objective functions to write the value on the history file ---*/ - - if (((iExtIter % (config[val_iZone]->GetVolumeOutputFrequency(0) )) == 0) || - (!fixed_cl && (iExtIter == (config[val_iZone]->GetnInner_Iter()-1))) || - /*--- If CL mode we need to compute the complete solution at two very particular iterations ---*/ - (fixed_cl && (iExtIter == (config[val_iZone]->GetnInner_Iter()-2) || - (solver_container[val_iZone][val_iInst][MESH_0][FLOW_SOL]->GetStart_AoA_FD() && - iExtIter == solver_container[val_iZone][val_iInst][MESH_0][FLOW_SOL]->GetIter_Update_AoA())))) { - - - if ((rank == MASTER_NODE) && output_files) cout << endl << "------------------------ Evaluate Special Output ------------------------"; - - switch (config[val_iZone]->GetKind_Solver()) { - - case MAIN_SOLVER::EULER: case MAIN_SOLVER::NAVIER_STOKES: case MAIN_SOLVER::RANS: - case MAIN_SOLVER::INC_EULER: case MAIN_SOLVER::INC_NAVIER_STOKES: case MAIN_SOLVER::INC_RANS: - /*--- For specific applications, evaluate and plot the surface. ---*/ - - if (config[val_iZone]->GetnMarker_Analyze() != 0) { - SpecialOutput_AnalyzeSurface(solver_container[val_iZone][val_iInst][MESH_0][FLOW_SOL], - geometry[val_iZone][val_iInst][MESH_0], config[val_iZone], output_files); - } - - /*--- For specific applications, evaluate and plot the surface. ---*/ - - if ((config[val_iZone]->GetnMarker_Analyze() != 0) && compressible) { - SpecialOutput_Distortion(solver_container[val_iZone][val_iInst][MESH_0][FLOW_SOL], - geometry[val_iZone][val_iInst][MESH_0], config[val_iZone], output_files); - } - - /*--- For specific applications, evaluate and plot the cp coefficent at different stations. ---*/ - - if (config[val_iZone]->GetPlot_Section_Forces()) { - SpecialOutput_SpanLoad(solver_container[val_iZone][val_iInst][MESH_0][FLOW_SOL], - geometry[val_iZone][val_iInst][MESH_0], config[val_iZone], output_files); - } - - break; - - default: - break; - } - - /*--- Output a file with the forces breakdown. ---*/ - - if (config[val_iZone]->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE) { - SpecialOutput_HarmonicBalance(solver_container, geometry, config, val_iInst, nInst, output_files); - } - - /*--- Compute span-wise values file for turbomachinery. ---*/ - - if (config[val_iZone]->GetBoolTurbomachinery()) { - SpecialOutput_Turbo(solver_container, geometry, config, val_iZone, output_files); - } - - /*--- Output a file with the forces breakdown. ---*/ - - SpecialOutput_ForcesBreakdown(solver_container, geometry, config, val_iZone, output_files); - - if ((rank == MASTER_NODE) && output_files) cout << "-------------------------------------------------------------------------" << endl << endl; - - } - - } - - /*--- Output using only the master node ---*/ - - if (rank == MASTER_NODE) { - - /*-- Compute the total objective if a "combo" objective is used ---*/ - - if (output_comboObj) { - switch (config[val_iZone]->GetKind_Solver()) { - case MAIN_SOLVER::EULER: case MAIN_SOLVER::NAVIER_STOKES: case MAIN_SOLVER::RANS: - case MAIN_SOLVER::INC_EULER: case MAIN_SOLVER::INC_NAVIER_STOKES: case MAIN_SOLVER::INC_RANS: - solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->Evaluate_ObjFunc(config[val_iZone], - solver_container[val_iZone][val_iInst][FinestMesh]); - break; - default: - break; - } - } - - unsigned long ExtIter_OffSet = config[val_iZone]->GetExtIter_OffSet(); - if (config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST || - config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND) - ExtIter_OffSet = 0; - - /*--- WARNING: These buffers have hard-coded lengths. Note that you - may have to adjust them to be larger if adding more entries. ---*/ - - char begin[1000], direct_coeff[1000], heat_coeff[1000], equivalent_area_coeff[1000], engine_coeff[1000], rotating_frame_coeff[1000], Cp_inverse_design[1000], Heat_inverse_design[1000], surface_coeff[1000], aeroelastic_coeff[1000], monitoring_coeff[10000], buffet_coeff[1000], - adjoint_coeff[1000], flow_resid[1000], adj_flow_resid[1000], turb_resid[1000], trans_resid[1000], - adj_turb_resid[1000], rad_resid[1000], - begin_fem[1000], fem_coeff[1000], heat_resid[1000], combo_obj[1000], - fem_resid[1000], end[1000], end_fem[1000], surface_outputs[1000], d_surface_outputs[1000], d_direct_coeff[1000], turbo_coeff[10000]; - - - su2double dummy = 0.0; - const su2double *Coord = nullptr; - unsigned short iVar, iMarker_Monitoring; - - unsigned long LinSolvIter = 0, iPointMaxResid; - su2double timeiter = timeused/su2double(iExtIter+1); - - unsigned short nDim = geometry[val_iZone][val_iInst][FinestMesh]->GetnDim(); - - - bool rotating_frame = config[val_iZone]->GetRotating_Frame(); - bool aeroelastic = config[val_iZone]->GetAeroelastic_Simulation(); - bool equiv_area = config[val_iZone]->GetEquivArea(); - bool engine = ((config[val_iZone]->GetnMarker_EngineInflow() != 0) || (config[val_iZone]->GetnMarker_EngineExhaust() != 0)); - bool actuator_disk = ((config[val_iZone]->GetnMarker_ActDiskInlet() != 0) || (config[val_iZone]->GetnMarker_ActDiskOutlet() != 0)); - bool inv_design = (config[val_iZone]->GetInvDesign_Cp() || config[val_iZone]->GetInvDesign_HeatFlux()); - bool transition = (config[val_iZone]->GetKind_Trans_Model() == TURB_TRANS_MODEL::LM); - bool thermal = (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::RANS || config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::NAVIER_STOKES || - config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::INC_NAVIER_STOKES || config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::INC_RANS ); - bool turbulent = ((config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::RANS) || (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::ADJ_RANS) || - (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::DISC_ADJ_RANS) || config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::INC_RANS || - config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::DISC_ADJ_INC_RANS); - bool adjoint = cont_adj || disc_adj; - bool frozen_visc = (cont_adj && config[val_iZone]->GetFrozen_Visc_Cont()) ||( disc_adj && config[val_iZone]->GetFrozen_Visc_Disc()); - bool heat = ((config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::HEAT_EQUATION) || (config[val_iZone]->GetWeakly_Coupled_Heat())); - bool weakly_coupled_heat = config[val_iZone]->GetWeakly_Coupled_Heat(); - bool flow = (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::EULER) || (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::NAVIER_STOKES) || - (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::RANS) || (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::FEM_EULER) || - (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::FEM_NAVIER_STOKES) || (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::FEM_RANS) || - (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::FEM_LES) || (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::ADJ_EULER) || - (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::ADJ_NAVIER_STOKES) || (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::ADJ_RANS) || - (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::INC_EULER) || (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::INC_NAVIER_STOKES) || - (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::INC_RANS); - bool buffet = (config[val_iZone]->GetViscous() || config[val_iZone]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); - - bool fem = ((config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::FEM_ELASTICITY) || // FEM structural solver. - (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::DISC_ADJ_FEM)); - bool linear_analysis = (config[val_iZone]->GetGeometricConditions() == STRUCT_DEFORMATION::SMALL); - bool nonlinear_analysis = (config[val_iZone]->GetGeometricConditions() == STRUCT_DEFORMATION::LARGE); - bool fsi = (config[val_iZone]->GetFSI_Simulation()); - bool discadj_fem = (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::DISC_ADJ_FEM); - - bool turbo = config[val_iZone]->GetBoolTurbomachinery(); - - unsigned short nTurboPerf = config[val_iZone]->GetnMarker_TurboPerformance(); - - bool output_per_surface = true; - - unsigned short direct_diff = config[val_iZone]->GetDirectDiff(); - - long ExtraHeatOutputZone = config[val_iZone]->GetExtraHeatOutputZone() - 1; - bool extra_heat_output = false; - su2double Extra_Total_Heat = 0.0; - //su2double Extra_Total_Temperature = 0.0; - su2double Extra_Heat_Residual = 0.0; - - if (ExtraHeatOutputZone > -1) { - if (ExtraHeatOutputZone > nZone) { - SU2_MPI::Error("Error in output routine: Extra output zone number exceeds total number of zones.", CURRENT_FUNCTION); - } - else if ((config[ExtraHeatOutputZone]->GetKind_Solver() != MAIN_SOLVER::HEAT_EQUATION)) { - SU2_MPI::Error("Error in output routine: No heat solver in extra output zone.", CURRENT_FUNCTION); - } - else { - extra_heat_output = true; - } - } - - /*--- Initialize variables to store information from all domains (direct solution) ---*/ - - su2double Total_CL = 0.0, Total_CD = 0.0, Total_CSF = 0.0, Total_CMx = 0.0, Total_CMy = 0.0, Total_CMz = 0.0, Total_CEff = 0.0, - Total_CEquivArea = 0.0, Total_CNearFieldOF = 0.0, Total_CFx = 0.0, Total_CFy = 0.0, Total_CFz = 0.0, Total_CMerit = 0.0, - Total_CT = 0.0, Total_CQ = 0.0, - Total_Heat = 0.0, Total_MaxHeat = 0.0, Total_Temperature = 0.0, Total_Custom_ObjFunc = 0.0, - Total_ComboObj = 0.0, Total_NetThrust = 0.0, Total_Power = 0.0, Total_AeroCD = 0.0, Total_SolidCD = 0.0, Total_IDR = 0.0, Total_IDC = 0.0, - Total_AoA = 0.0, Total_Buffet_Metric = 0.0; - su2double Surface_MassFlow = 0.0, Surface_Mach = 0.0, Surface_Temperature = 0.0, Surface_Pressure = 0.0, Surface_Density = 0.0, Surface_Enthalpy = 0.0, Surface_NormalVelocity = 0.0, Surface_TotalTemperature = 0.0, Surface_TotalPressure = 0.0, Surface_Uniformity = 0.0, Surface_SecondaryStrength = 0.0,Surface_MomentumDistortion = 0.0, Surface_SecondOverUniform = 0.0, Surface_PressureDrop = 0.0; - - su2double Total_ForceCoeff = 0.0, Total_VMStress = 0.0, Total_IncLoad = 0.0; - su2double Total_SensE = 0.0, Total_SensNu = 0.0; - - unsigned short iSpan; - - /*--- Initialize variables to store information from all domains (adjoint solution) ---*/ - su2double Total_Sens_Geo = 0.0, Total_Sens_Mach = 0.0, Total_Sens_AoA = 0.0; - su2double Total_Sens_Press = 0.0, Total_Sens_Temp = 0.0; - - su2double Total_Sens_BPressure = 0.0; - su2double Total_Sens_ModVel = 0.0; - - /*--- Initialize variables to store information from all domains (direct differentiation) ---*/ - su2double D_Total_CL = 0.0, D_Total_CD = 0.0, D_Total_CSF = 0.0, D_Total_CMx = 0.0, D_Total_CMy = 0.0, D_Total_CMz = 0.0, D_Total_CEff = 0.0, D_Total_CFx = 0.0, - D_Total_CFy = 0.0, D_Total_CFz = 0.0, D_Total_NetThrust = 0.0, D_Total_Power = 0.0, D_Total_AeroCD = 0.0, D_Total_SolidCD = 0.0, D_Total_IDR = 0.0, D_Total_IDC = 0.0, D_Total_Custom_ObjFunc = 0.0, D_Total_Heat = 0.0, D_Total_MaxHeat = 0.0, - D_TotalPressure_Loss = 0.0, D_FlowAngle_Out = 0.0, D_TotalStaticEfficiency = 0.0, - D_TotalTotalEfficiency = 0.0, D_EntropyGen = 0.0, - D_Surface_Uniformity = 0.0, D_Surface_SecondaryStrength = 0.0, D_Surface_MomentumDistortion = 0.0, D_Surface_SecondOverUniform = 0.0, D_Surface_PressureDrop = 0.0; - - /*--- Residual arrays ---*/ - su2double *residual_flow = nullptr, - *residual_turbulent = nullptr, - *residual_transition = nullptr; - su2double *residual_adjflow = nullptr, - *residual_adjturbulent = nullptr, - *residual_adjheat = nullptr; - su2double *residual_fea = nullptr; - su2double *residual_fem = nullptr; - su2double *residual_heat = nullptr; - su2double *residual_rad = nullptr; - - /*--- Coefficients Monitored arrays ---*/ - su2double *aeroelastic_plunge = nullptr, - *aeroelastic_pitch = nullptr, - *Surface_CL = nullptr, - *Surface_CD = nullptr, - *Surface_CSF = nullptr, - *Surface_CEff = nullptr, - *Surface_CFx = nullptr, - *Surface_CFy = nullptr, - *Surface_CFz = nullptr, - *Surface_CMx = nullptr, - *Surface_CMy = nullptr, - *Surface_CMz = nullptr, - *Surface_Buffet_Metric = nullptr; - - /*--- Initialize number of variables ---*/ - unsigned short nVar_Flow = 0, nVar_Turb = 0, - nVar_Trans = 0, nVar_Heat = 0, - nVar_AdjFlow = 0, nVar_AdjTurb = 0, nVar_AdjHeat = 0, - nVar_FEM = 0, nVar_Rad = 0; - - /*--- Direct problem variables ---*/ - if (compressible) nVar_Flow = nDim+2; else nVar_Flow = nDim+2; - if (turbulent) { - switch (config[val_iZone]->GetKind_Turb_Model()) { - case TURB_MODEL::SA: nVar_Turb = 1; break; - case TURB_MODEL::SST: nVar_Turb = 2; break; - default: break; - } - } - if (transition) nVar_Trans = 2; - if (heat) nVar_Heat = 1; - - if (fem) { - if (linear_analysis) nVar_FEM = nDim; - if (nonlinear_analysis) nVar_FEM = 3; - - if (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::DISC_ADJ_FEM) nVar_FEM = nDim; - - } - - if (radiation) nVar_Rad = 1; - - /*--- Adjoint problem variables ---*/ - if (compressible) nVar_AdjFlow = nDim+2; else nVar_AdjFlow = nDim+2; - if (turbulent) { - switch (config[val_iZone]->GetKind_Turb_Model()) { - case TURB_MODEL::SA: nVar_AdjTurb = 1; break; - case TURB_MODEL::SST: nVar_AdjTurb = 2; break; - default: break; - } - } - if (weakly_coupled_heat) nVar_AdjHeat = 1; - - /*--- Allocate memory for the residual ---*/ - residual_flow = new su2double[nVar_Flow]; - residual_turbulent = new su2double[nVar_Turb]; - residual_transition = new su2double[nVar_Trans]; - residual_heat = new su2double[nVar_Heat]; - residual_fem = new su2double[nVar_FEM]; - residual_rad = new su2double[nVar_Rad]; - residual_adjflow = new su2double[nVar_AdjFlow]; - residual_adjturbulent = new su2double[nVar_AdjTurb]; - residual_adjheat = new su2double[nVar_AdjHeat]; - - /*--- Allocate memory for the coefficients being monitored ---*/ - aeroelastic_plunge = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - aeroelastic_pitch = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CL = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CD = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CSF = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CEff = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CFx = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CFy = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CFz = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CMx = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CMy = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CMz = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - if(buffet) Surface_Buffet_Metric = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - - /*--- Write information from nodes ---*/ - - switch (config[val_iZone]->GetKind_Solver()) { - - case MAIN_SOLVER::EULER: case MAIN_SOLVER::NAVIER_STOKES: case MAIN_SOLVER::RANS: - case MAIN_SOLVER::INC_EULER: case MAIN_SOLVER::INC_NAVIER_STOKES: case MAIN_SOLVER::INC_RANS: - case MAIN_SOLVER::FEM_EULER: case MAIN_SOLVER::FEM_NAVIER_STOKES: case MAIN_SOLVER::FEM_RANS: case MAIN_SOLVER::FEM_LES: - case MAIN_SOLVER::ADJ_EULER: case MAIN_SOLVER::ADJ_NAVIER_STOKES: case MAIN_SOLVER::ADJ_RANS: - case MAIN_SOLVER::DISC_ADJ_EULER: case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_RANS: - case MAIN_SOLVER::DISC_ADJ_INC_EULER: case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_INC_RANS: - - /*--- Flow solution coefficients ---*/ - - Total_CL = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_CL(); - Total_CD = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_CD(); - Total_CSF = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_CSF(); - Total_CEff = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_CEff(); - Total_CMx = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_CMx(); - Total_CMy = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_CMy(); - Total_CMz = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_CMz(); - Total_CFx = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_CFx(); - Total_CFy = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_CFy(); - Total_CFz = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_CFz(); - Total_ComboObj = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_ComboObj(); - Total_AoA = config[val_iZone]->GetAoA() - config[val_iZone]->GetAoA_Offset(); - - if (thermal) { - Total_Heat = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_HeatFlux(); - Total_MaxHeat = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_MaxHeatFlux(); - Total_Temperature = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_AvgTemperature(); - - if(weakly_coupled_heat) { - Total_Heat = solver_container[val_iZone][val_iInst][FinestMesh][HEAT_SOL]->GetTotal_HeatFlux(); - Total_MaxHeat = solver_container[val_iZone][val_iInst][FinestMesh][HEAT_SOL]->GetTotal_MaxHeatFlux(); - Total_Temperature = solver_container[val_iZone][val_iInst][FinestMesh][HEAT_SOL]->GetTotal_AvgTemperature(); - } - } - - if(buffet){ - Total_Buffet_Metric = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_Buffet_Metric(); - } - - if (direct_diff != NO_DERIVATIVE) { - D_Total_CL = SU2_TYPE::GetDerivative(Total_CL); - D_Total_CD = SU2_TYPE::GetDerivative(Total_CD); - D_Total_CSF = SU2_TYPE::GetDerivative(Total_CSF); - D_Total_CEff = SU2_TYPE::GetDerivative(Total_CEff); - D_Total_CMx = SU2_TYPE::GetDerivative(Total_CMx); - D_Total_CMy = SU2_TYPE::GetDerivative(Total_CMy); - D_Total_CMz = SU2_TYPE::GetDerivative(Total_CMz); - D_Total_CFx = SU2_TYPE::GetDerivative(Total_CFx); - D_Total_CFy = SU2_TYPE::GetDerivative(Total_CFy); - D_Total_CFz = SU2_TYPE::GetDerivative(Total_CFz); - D_Total_Custom_ObjFunc = SU2_TYPE::GetDerivative(Total_Custom_ObjFunc); - - if (thermal) { - D_Total_Heat = SU2_TYPE::GetDerivative(Total_Heat); - D_Total_MaxHeat = SU2_TYPE::GetDerivative(Total_MaxHeat); - //Davg Temp - } - - if (engine || actuator_disk) { - D_Total_NetThrust = SU2_TYPE::GetDerivative(Total_NetThrust); - D_Total_Power = SU2_TYPE::GetDerivative(Total_Power); - D_Total_AeroCD = SU2_TYPE::GetDerivative(Total_AeroCD); - D_Total_SolidCD = SU2_TYPE::GetDerivative(Total_SolidCD); - D_Total_IDR = SU2_TYPE::GetDerivative(Total_IDR); - D_Total_IDC = SU2_TYPE::GetDerivative(Total_IDC); - } - - } - - if (equiv_area) { - Total_CEquivArea = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_CEquivArea(); - Total_CNearFieldOF = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_CNearFieldOF(); - - Total_CEquivArea = config[val_iZone]->GetWeightCd()*Total_CD + (1.0-config[val_iZone]->GetWeightCd())*Total_CEquivArea; - Total_CNearFieldOF = config[val_iZone]->GetWeightCd()*Total_CD + (1.0-config[val_iZone]->GetWeightCd())*Total_CNearFieldOF; - } - - if (engine || actuator_disk) { - Total_NetThrust = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_NetThrust(); - Total_Power = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_Power(); - Total_AeroCD = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_AeroCD(); - Total_SolidCD = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_SolidCD(); - Total_IDR = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_IDR(); - Total_IDC = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_IDC(); - } - - if (rotating_frame) { - Total_CT = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_CT(); - Total_CQ = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_CQ(); - Total_CMerit = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_CMerit(); - } - - if (aeroelastic) { - /*--- Look over the markers being monitored and get the desired values ---*/ - for (iMarker_Monitoring = 0; iMarker_Monitoring < config[ZONE_0]->GetnMarker_Monitoring(); iMarker_Monitoring++) { - aeroelastic_plunge[iMarker_Monitoring] = config[val_iZone]->GetAeroelastic_plunge(iMarker_Monitoring); - aeroelastic_pitch[iMarker_Monitoring] = config[val_iZone]->GetAeroelastic_pitch(iMarker_Monitoring); - } - } - - if (output_per_surface) { - /*--- Look over the markers being monitored and get the desired values ---*/ - for (iMarker_Monitoring = 0; iMarker_Monitoring < config[ZONE_0]->GetnMarker_Monitoring(); iMarker_Monitoring++) { - Surface_CL[iMarker_Monitoring] = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetSurface_CL(iMarker_Monitoring); - Surface_CD[iMarker_Monitoring] = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetSurface_CD(iMarker_Monitoring); - Surface_CSF[iMarker_Monitoring] = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetSurface_CSF(iMarker_Monitoring); - Surface_CEff[iMarker_Monitoring] = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetSurface_CEff(iMarker_Monitoring); - Surface_CFx[iMarker_Monitoring] = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetSurface_CFx(iMarker_Monitoring); - Surface_CFy[iMarker_Monitoring] = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetSurface_CFy(iMarker_Monitoring); - Surface_CFz[iMarker_Monitoring] = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetSurface_CFz(iMarker_Monitoring); - Surface_CMx[iMarker_Monitoring] = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetSurface_CMx(iMarker_Monitoring); - Surface_CMy[iMarker_Monitoring] = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetSurface_CMy(iMarker_Monitoring); - Surface_CMz[iMarker_Monitoring] = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetSurface_CMz(iMarker_Monitoring); - - if(buffet) Surface_Buffet_Metric[iMarker_Monitoring] = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetSurface_Buffet_Metric(iMarker_Monitoring); - } - } - - if (turbo) { - /*--- Loop over the nMarker of turboperformance and get the desired values ---*/ - for (iMarker_Monitoring = 0; iMarker_Monitoring < nTurboPerf; iMarker_Monitoring++) { - for(iSpan=0; iSpanGetSurface_MassFlow(iMarker_Analyze); - Surface_Mach = config[ZONE_0]->GetSurface_Mach(iMarker_Analyze); - Surface_Temperature = config[ZONE_0]->GetSurface_Temperature(iMarker_Analyze); - Surface_Pressure = config[ZONE_0]->GetSurface_Pressure(iMarker_Analyze); - Surface_Density = config[ZONE_0]->GetSurface_Density(iMarker_Analyze); - Surface_Enthalpy = config[ZONE_0]->GetSurface_Enthalpy(iMarker_Analyze); - Surface_NormalVelocity = config[ZONE_0]->GetSurface_NormalVelocity(iMarker_Analyze); - Surface_Uniformity = config[ZONE_0]->GetSurface_Uniformity(iMarker_Analyze); - Surface_SecondaryStrength = config[ZONE_0]->GetSurface_SecondaryStrength(iMarker_Analyze); - Surface_MomentumDistortion = config[ZONE_0]->GetSurface_MomentumDistortion(iMarker_Analyze); - Surface_SecondOverUniform = config[ZONE_0]->GetSurface_SecondOverUniform(iMarker_Analyze); - Surface_TotalTemperature = config[ZONE_0]->GetSurface_TotalTemperature(iMarker_Analyze); - Surface_TotalPressure = config[ZONE_0]->GetSurface_TotalPressure(iMarker_Analyze); - Surface_PressureDrop = config[ZONE_0]->GetSurface_PressureDrop(iMarker_Analyze); - - if (direct_diff != NO_DERIVATIVE){ - D_Surface_Uniformity = SU2_TYPE::GetDerivative(Surface_Uniformity); - D_Surface_SecondaryStrength = SU2_TYPE::GetDerivative(Surface_SecondaryStrength); - D_Surface_MomentumDistortion = SU2_TYPE::GetDerivative(Surface_MomentumDistortion); - D_Surface_SecondOverUniform = SU2_TYPE::GetDerivative(Surface_SecondOverUniform); - D_Surface_PressureDrop = SU2_TYPE::GetDerivative(Surface_PressureDrop); - } - } - - /*--- Flow Residuals ---*/ - - for (iVar = 0; iVar < nVar_Flow; iVar++) - residual_flow[iVar] = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetRes_RMS(iVar); - - /*--- Turbulent residual ---*/ - - if (turbulent) { - for (iVar = 0; iVar < nVar_Turb; iVar++) - residual_turbulent[iVar] = solver_container[val_iZone][val_iInst][FinestMesh][TURB_SOL]->GetRes_RMS(iVar); - } - - if (weakly_coupled_heat) { - for (iVar = 0; iVar < nVar_Heat; iVar++) { - residual_heat[iVar] = solver_container[val_iZone][val_iInst][FinestMesh][HEAT_SOL]->GetRes_RMS(iVar); - } - - } - - /*--- Transition residual ---*/ - - if (transition) { - for (iVar = 0; iVar < nVar_Trans; iVar++) - residual_transition[iVar] = solver_container[val_iZone][val_iInst][FinestMesh][TRANS_SOL]->GetRes_RMS(iVar); - } - - - /*--- FEA residual ---*/ - // if (fluid_structure) { - // for (iVar = 0; iVar < nVar_FEA; iVar++) - // residual_fea[iVar] = solver_container[ZONE_0][FinestMesh][FEA_SOL]->GetRes_RMS(iVar); - // } - - /*--- Iterations of the linear solver ---*/ - - LinSolvIter = (unsigned long) solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetIterLinSolver(); - - /*--- Adjoint solver ---*/ - - if (adjoint) { - - /*--- Adjoint solution coefficients ---*/ - - Total_Sens_Geo = solver_container[val_iZone][val_iInst][FinestMesh][ADJFLOW_SOL]->GetTotal_Sens_Geo(); - Total_Sens_Mach = solver_container[val_iZone][val_iInst][FinestMesh][ADJFLOW_SOL]->GetTotal_Sens_Mach(); - Total_Sens_AoA = solver_container[val_iZone][val_iInst][FinestMesh][ADJFLOW_SOL]->GetTotal_Sens_AoA() * PI_NUMBER / 180.0; - Total_Sens_Press = solver_container[val_iZone][val_iInst][FinestMesh][ADJFLOW_SOL]->GetTotal_Sens_Press(); - Total_Sens_Temp = solver_container[val_iZone][val_iInst][FinestMesh][ADJFLOW_SOL]->GetTotal_Sens_Temp(); - Total_Sens_BPressure = solver_container[val_iZone][val_iInst][FinestMesh][ADJFLOW_SOL]->GetTotal_Sens_BPress(); - Total_Sens_ModVel = solver_container[val_iZone][val_iInst][FinestMesh][ADJFLOW_SOL]->GetTotal_Sens_ModVel(); - - if (radiation){ - Total_Sens_Temp += solver_container[val_iZone][val_iInst][FinestMesh][ADJRAD_SOL]->GetTotal_Sens_Temp(); - } - - /*--- Adjoint flow residuals ---*/ - - for (iVar = 0; iVar < nVar_AdjFlow; iVar++) { - residual_adjflow[iVar] = solver_container[val_iZone][val_iInst][FinestMesh][ADJFLOW_SOL]->GetRes_RMS(iVar); - } - - /*--- Adjoint turbulent residuals ---*/ - - if (turbulent) { - if (!frozen_visc) { - for (iVar = 0; iVar < nVar_AdjTurb; iVar++) - residual_adjturbulent[iVar] = solver_container[val_iZone][val_iInst][FinestMesh][ADJTURB_SOL]->GetRes_RMS(iVar); - } - } - - if (weakly_coupled_heat) { - for (iVar = 0; iVar < nVar_Heat; iVar++) { - residual_adjheat[iVar] = solver_container[val_iZone][val_iInst][FinestMesh][ADJHEAT_SOL]->GetRes_RMS(iVar); - } - } - - } - - break; - - - case MAIN_SOLVER::HEAT_EQUATION: - - /*--- Heat coefficients ---*/ - - Total_Heat = solver_container[val_iZone][val_iInst][FinestMesh][HEAT_SOL]->GetTotal_HeatFlux(); - Total_MaxHeat = solver_container[val_iZone][val_iInst][FinestMesh][HEAT_SOL]->GetTotal_MaxHeatFlux(); - Total_Temperature = solver_container[val_iZone][val_iInst][FinestMesh][HEAT_SOL]->GetTotal_AvgTemperature(); - - /*--- Heat Residuals ---*/ - - for (iVar = 0; iVar < nVar_Heat; iVar++) { - residual_heat[iVar] = solver_container[val_iZone][val_iInst][FinestMesh][HEAT_SOL]->GetRes_RMS(iVar); - } - - break; - - case MAIN_SOLVER::FEM_ELASTICITY: - - /*--- FEM coefficients -- As of now, this is the Von Mises Stress ---*/ - - Total_VMStress = solver_container[val_iZone][val_iInst][FinestMesh][FEA_SOL]->GetTotal_CFEA(); - - Total_ForceCoeff = solver_container[val_iZone][val_iInst][FinestMesh][FEA_SOL]->GetForceCoeff(); - - Total_IncLoad = solver_container[val_iZone][val_iInst][FinestMesh][FEA_SOL]->GetLoad_Increment(); - - LinSolvIter = (unsigned long) solver_container[val_iZone][val_iInst][FinestMesh][FEA_SOL]->GetIterLinSolver(); - - /*--- Residuals: ---*/ - /*--- Linear analysis: RMS of the displacements in the nDim coordinates ---*/ - /*--- Nonlinear analysis: UTOL, RTOL and DTOL (defined in the Postprocessing function) ---*/ - - if (linear_analysis) { - for (iVar = 0; iVar < nVar_FEM; iVar++) { - residual_fem[iVar] = solver_container[val_iZone][val_iInst][FinestMesh][FEA_SOL]->GetRes_RMS(iVar); - } - } - else if (nonlinear_analysis) { - for (iVar = 0; iVar < nVar_FEM; iVar++) { - residual_fem[iVar] = solver_container[val_iZone][val_iInst][FinestMesh][FEA_SOL]->GetRes_FEM(iVar); - } - } - - break; - - case MAIN_SOLVER::DISC_ADJ_FEM: - - /*--- FEM coefficients -- As of now, this is the Von Mises Stress ---*/ - - Total_VMStress = solver_container[val_iZone][val_iInst][FinestMesh][FEA_SOL]->GetTotal_CFEA(); - - /*--- Residuals: ---*/ - /*--- Linear analysis: RMS of the displacements in the nDim coordinates ---*/ - /*--- Nonlinear analysis: UTOL, RTOL and DTOL (defined in the Postprocessing function) ---*/ - for (iVar = 0; iVar < nVar_FEM; iVar++) { - residual_fem[iVar] = solver_container[val_iZone][val_iInst][FinestMesh][ADJFEA_SOL]->GetRes_RMS(iVar); - } - - break; - - default: - break; - - } - - if (extra_heat_output) { - Extra_Total_Heat = solver_container[ExtraHeatOutputZone][val_iInst][FinestMesh][HEAT_SOL]->GetTotal_HeatFlux(); - //Extra_Total_Temperature = solver_container[ExtraHeatOutputZone][val_iInst][FinestMesh][HEAT_SOL]->GetTotal_Temperature(); - Extra_Heat_Residual = log10(solver_container[ExtraHeatOutputZone][val_iInst][FinestMesh][HEAT_SOL]->GetRes_RMS(0)); - } - - if (radiation){ - if (disc_adj){ - for (iVar = 0; iVar < nVar_Rad; iVar++) { - residual_rad[iVar] = solver_container[val_iZone][val_iInst][FinestMesh][ADJRAD_SOL]->GetRes_RMS(iVar); - } - } - else{ - for (iVar = 0; iVar < nVar_Rad; iVar++) { - residual_rad[iVar] = solver_container[val_iZone][val_iInst][FinestMesh][RAD_SOL]->GetRes_RMS(iVar); - } - } - } - - /*--- Header frequency ---*/ - - bool Unsteady = ((config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || - (config[val_iZone]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)); - bool In_NoDualTime = (!DualTime_Iteration && (iExtIter % config[val_iZone]->GetScreen_Wrt_Freq(2) == 0)); - bool In_DualTime_0 = (DualTime_Iteration && (iIntIter % config[val_iZone]->GetScreen_Wrt_Freq(0) == 0)); - bool In_DualTime_1 = (!DualTime_Iteration && Unsteady); - bool In_DualTime_2 = (Unsteady && DualTime_Iteration && (iExtIter % config[val_iZone]->GetScreen_Wrt_Freq(2) == 0)); - bool In_DualTime_3 = (Unsteady && !DualTime_Iteration && (iExtIter % config[val_iZone]->GetScreen_Wrt_Freq(2) == 0)); - - /*--- Header frequency: analogy for dynamic structural analysis ---*/ - /*--- DualTime_Iteration is a bool we receive, which is true if it comes from FEM_StructuralIteration and false from SU2_CFD ---*/ - /*--- We maintain the name, as it is an input of the function ---*/ - /*--- dynamic determines if the problem is, or not, time dependent ---*/ - bool dynamic = (config[val_iZone]->GetTime_Domain()); // Dynamic simulations. - bool In_NoDynamic = (!DualTime_Iteration && (iExtIter % config[val_iZone]->GetScreen_Wrt_Freq(2) == 0)); - bool In_Dynamic_0 = (DualTime_Iteration && (iIntIter % config[val_iZone]->GetScreen_Wrt_Freq(0) == 0)); - bool In_Dynamic_1 = (!DualTime_Iteration && nonlinear_analysis); - bool In_Dynamic_2 = (nonlinear_analysis && DualTime_Iteration && (iExtIter % config[val_iZone]->GetScreen_Wrt_Freq(2) == 0)); - bool In_Dynamic_3 = (nonlinear_analysis && !DualTime_Iteration && (iExtIter % config[val_iZone]->GetScreen_Wrt_Freq(2) == 0)); - - bool write_heads; - if (Unsteady) write_heads = (iIntIter == 0); - else write_heads = (((iExtIter % (config[val_iZone]->GetScreen_Wrt_Freq(2)*40)) == 0)); - - bool write_turbo = (((iExtIter % (config[val_iZone]->GetScreen_Wrt_Freq(2)*40)) == 0) || (iExtIter == (config[val_iZone]->GetnInner_Iter() -1))); - - /*--- Analogous for dynamic problems (as of now I separate the problems, it may be worthy to do all together later on ---*/ - bool write_heads_FEM; - if (nonlinear_analysis) write_heads_FEM = (iIntIter == 0); - else write_heads_FEM = (((iExtIter % (config[val_iZone]->GetScreen_Wrt_Freq(2)*40)) == 0)); - - if ( (!fem && ((In_NoDualTime || In_DualTime_0 || In_DualTime_1) && (In_NoDualTime || In_DualTime_2 || In_DualTime_3))) || - (fem && ( (In_NoDynamic || In_Dynamic_0 || In_Dynamic_1) && (In_NoDynamic || In_Dynamic_2 || In_Dynamic_3))) - ) { - - - /*--- Prepare the history file output, note that the dual - time output don't write to the history file ---*/ - if (!DualTime_Iteration) { - - /*--- Write the begining of the history file ---*/ - SPRINTF(begin, "%12d", SU2_TYPE::Int(iExtIter+ExtIter_OffSet)); - - /*--- Write the end of the history file ---*/ - SPRINTF (end, ", %12.10f, %12.10f, %12.10f\n", su2double(LinSolvIter), config[val_iZone]->GetCFL(MESH_0), timeused/60.0); - - /*--- Write the solution and residual of the history file ---*/ - switch (config[val_iZone]->GetKind_Solver()) { - - case MAIN_SOLVER::EULER : case MAIN_SOLVER::NAVIER_STOKES: case MAIN_SOLVER::RANS: - case MAIN_SOLVER::INC_EULER : case MAIN_SOLVER::INC_NAVIER_STOKES: case MAIN_SOLVER::INC_RANS: - case MAIN_SOLVER::FEM_EULER : case MAIN_SOLVER::FEM_NAVIER_STOKES: case MAIN_SOLVER::FEM_RANS: case MAIN_SOLVER::FEM_LES: - case MAIN_SOLVER::ADJ_EULER: case MAIN_SOLVER::ADJ_NAVIER_STOKES: case MAIN_SOLVER::ADJ_RANS: case MAIN_SOLVER::DISC_ADJ_EULER: - case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_RANS: - case MAIN_SOLVER::DISC_ADJ_INC_EULER: case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_INC_RANS: - - /*--- Direct coefficients ---*/ - SPRINTF (direct_coeff, ", %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e", - Total_CL, Total_CD, Total_CSF, Total_CMx, Total_CMy, Total_CMz, Total_CFx, Total_CFy, - Total_CFz, Total_CEff, Total_AoA, Total_Custom_ObjFunc); - if (buffet) SPRINTF (buffet_coeff, ", %14.8e", Total_Buffet_Metric); - if (thermal || heat) SPRINTF (heat_coeff, ", %14.8e, %14.8e, %14.8e", Total_Heat, Total_MaxHeat, Total_Temperature); - if (equiv_area) SPRINTF (equivalent_area_coeff, ", %14.8e, %14.8e", Total_CEquivArea, Total_CNearFieldOF); - if (engine || actuator_disk) SPRINTF (engine_coeff, ", %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e", Total_NetThrust, Total_Power, Total_AeroCD, Total_SolidCD, Total_IDR, Total_IDC); - if (rotating_frame) SPRINTF (rotating_frame_coeff, ", %14.8e, %14.8e, %14.8e", Total_CMerit, Total_CT, Total_CQ); - if (inv_design) { - SPRINTF (Cp_inverse_design, ", %14.8e", solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_CpDiff()); - if (thermal && !turbo) SPRINTF (Heat_inverse_design, ", %14.8e", solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetTotal_HeatFluxDiff()); - } - - if (direct_diff != NO_DERIVATIVE) { - if (!turbo) - SPRINTF (d_direct_coeff, ", %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e", - D_Total_CL, D_Total_CD, D_Total_CSF, D_Total_CMx, D_Total_CMy, D_Total_CMz, D_Total_CFx, D_Total_CFy, - D_Total_CFz, D_Total_CEff, D_Total_Custom_ObjFunc); - else - SPRINTF (d_direct_coeff, ", %12.10f, %12.10f, %12.10f, %12.10f, %12.10f", D_TotalPressure_Loss, D_FlowAngle_Out, - D_TotalTotalEfficiency, D_TotalStaticEfficiency, D_EntropyGen); - if (engine || actuator_disk) - SPRINTF (d_direct_coeff, ", %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e", - D_Total_CL, D_Total_CD, D_Total_CSF, D_Total_CMx, D_Total_CMy, D_Total_CMz, D_Total_CFx, D_Total_CFy, - D_Total_CFz, D_Total_CEff, D_Total_Custom_ObjFunc, D_Total_NetThrust, D_Total_Power, D_Total_AeroCD, D_Total_SolidCD, D_Total_IDR, D_Total_IDC); - if (thermal) - SPRINTF (d_direct_coeff, ", %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e", - D_Total_CL, D_Total_CD, D_Total_CSF, D_Total_CMx, D_Total_CMy, D_Total_CMz, D_Total_CFx, D_Total_CFy, - D_Total_CFz, D_Total_CEff, D_Total_Custom_ObjFunc, D_Total_Heat, D_Total_MaxHeat); - } - - if (aeroelastic) { - for (iMarker_Monitoring = 0; iMarker_Monitoring < config[ZONE_0]->GetnMarker_Monitoring(); iMarker_Monitoring++) { - //Append one by one the surface coeff to aeroelastic coeff. (Think better way do this, maybe use string) - if (iMarker_Monitoring == 0) { - SPRINTF(aeroelastic_coeff, ", %12.10f", aeroelastic_plunge[iMarker_Monitoring]); - } - else { - SPRINTF(surface_coeff, ", %12.10f", aeroelastic_plunge[iMarker_Monitoring]); - strcat(aeroelastic_coeff, surface_coeff); - } - SPRINTF(surface_coeff, ", %12.10f", aeroelastic_pitch[iMarker_Monitoring]); - strcat(aeroelastic_coeff, surface_coeff); - } - } - - if (output_per_surface) { - for (iMarker_Monitoring = 0; iMarker_Monitoring < config[ZONE_0]->GetnMarker_Monitoring(); iMarker_Monitoring++) { - //Append one by one the surface coeff to monitoring coeff. (Think better way do this, maybe use string) - if (iMarker_Monitoring == 0) { - SPRINTF(monitoring_coeff, ", %12.10f", Surface_CL[iMarker_Monitoring]); - } - else { - SPRINTF(surface_coeff, ", %12.10f", Surface_CL[iMarker_Monitoring]); - strcat(monitoring_coeff, surface_coeff); - } - SPRINTF(surface_coeff, ", %12.10f", Surface_CD[iMarker_Monitoring]); - strcat(monitoring_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", Surface_CSF[iMarker_Monitoring]); - strcat(monitoring_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", Surface_CEff[iMarker_Monitoring]); - strcat(monitoring_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", Surface_CFx[iMarker_Monitoring]); - strcat(monitoring_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", Surface_CFy[iMarker_Monitoring]); - strcat(monitoring_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", Surface_CFz[iMarker_Monitoring]); - strcat(monitoring_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", Surface_CMx[iMarker_Monitoring]); - strcat(monitoring_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", Surface_CMy[iMarker_Monitoring]); - strcat(monitoring_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", Surface_CMz[iMarker_Monitoring]); - strcat(monitoring_coeff, surface_coeff); - - if(buffet){ - SPRINTF(surface_coeff, ", %12.10f", Surface_Buffet_Metric[iMarker_Monitoring]); - strcat(monitoring_coeff, surface_coeff); - } - } - } - - if (turbo){ - for (iMarker_Monitoring = 0; iMarker_Monitoring < config[ZONE_0]->GetnMarker_TurboPerformance(); iMarker_Monitoring++){ - if (iMarker_Monitoring == 0){ - SPRINTF(turbo_coeff, ", %12.10f", TotalPressureLoss[iMarker_Monitoring][nSpanWiseSections]); - }else{ - SPRINTF(surface_coeff, ", %12.10f", TotalPressureLoss[iMarker_Monitoring][nSpanWiseSections]); - strcat(turbo_coeff, surface_coeff); - } - SPRINTF(surface_coeff, ", %12.10f", KineticEnergyLoss[iMarker_Monitoring][nSpanWiseSections]); - strcat(turbo_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", EntropyGen[iMarker_Monitoring][nSpanWiseSections]); - strcat(turbo_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", EulerianWork[iMarker_Monitoring][nSpanWiseSections]); - strcat(turbo_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", PressureRatio[iMarker_Monitoring][nSpanWiseSections]); - strcat(turbo_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", 180.0/PI_NUMBER*FlowAngleIn[iMarker_Monitoring][nSpanWiseSections]); - strcat(turbo_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", 180.0/PI_NUMBER*FlowAngleOut[iMarker_Monitoring][nSpanWiseSections]); - strcat(turbo_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", 180.0/PI_NUMBER*AbsFlowAngleIn[iMarker_Monitoring][nSpanWiseSections]); - strcat(turbo_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", 180.0/PI_NUMBER*AbsFlowAngleOut[iMarker_Monitoring][nSpanWiseSections]); - strcat(turbo_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", MassFlowIn[iMarker_Monitoring][nSpanWiseSections]); - strcat(turbo_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", MassFlowOut[iMarker_Monitoring][nSpanWiseSections]); - strcat(turbo_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", sqrt(MachIn[iMarker_Monitoring][nSpanWiseSections][1]*MachIn[iMarker_Monitoring][nSpanWiseSections][1] + MachIn[iMarker_Monitoring][nSpanWiseSections][0]*MachIn[iMarker_Monitoring][nSpanWiseSections][0])); - strcat(turbo_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", sqrt(MachOut[iMarker_Monitoring][nSpanWiseSections][1]*MachOut[iMarker_Monitoring][nSpanWiseSections][1] + MachOut[iMarker_Monitoring][nSpanWiseSections][0]*MachOut[iMarker_Monitoring][nSpanWiseSections][0])); - strcat(turbo_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", TotalTotalEfficiency[iMarker_Monitoring][nSpanWiseSections]); - strcat(turbo_coeff, surface_coeff); - SPRINTF(surface_coeff, ", %12.10f", TotalStaticEfficiency[iMarker_Monitoring][nSpanWiseSections]); - strcat(turbo_coeff, surface_coeff); - - } - } - - - /*--- Flow residual ---*/ - if (nDim == 2) { - if (compressible) SPRINTF (flow_resid, ", %14.8e, %14.8e, %14.8e, %14.8e, %14.8e", log10 (residual_flow[0]), log10 (residual_flow[1]), log10 (residual_flow[2]), log10 (residual_flow[3]), dummy); - if (incompressible) SPRINTF (flow_resid, ", %14.8e, %14.8e, %14.8e, %14.8e, %14.8e", log10 (residual_flow[0]), log10 (residual_flow[1]), log10 (residual_flow[2]), log10 (residual_flow[3]), dummy); - } - else { - if (compressible) SPRINTF (flow_resid, ", %14.8e, %14.8e, %14.8e, %14.8e, %14.8e", log10 (residual_flow[0]), log10 (residual_flow[1]), log10 (residual_flow[2]), log10 (residual_flow[3]), log10 (residual_flow[4]) ); - if (incompressible) SPRINTF (flow_resid, ", %14.8e, %14.8e, %14.8e, %14.8e, %14.8e", log10 (residual_flow[0]), log10 (residual_flow[1]), log10 (residual_flow[2]), log10 (residual_flow[3]), log10 (residual_flow[4])); - } - - /*--- Turbulent residual ---*/ - if (turbulent) { - switch(nVar_Turb) { - case 1: SPRINTF (turb_resid, ", %12.10f", log10 (residual_turbulent[0])); break; - case 2: SPRINTF (turb_resid, ", %12.10f, %12.10f", log10(residual_turbulent[0]), log10(residual_turbulent[1])); break; - } - } - - /*---- Averaged stagnation pressure at an exit ----*/ - - if (output_surface) { - SPRINTF( surface_outputs, ", %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, %14.8e", Surface_MassFlow, Surface_Mach, Surface_Temperature, Surface_Pressure, Surface_Density, Surface_Enthalpy, Surface_NormalVelocity, Surface_Uniformity, Surface_SecondaryStrength, Surface_MomentumDistortion, Surface_SecondOverUniform, Surface_TotalTemperature, Surface_TotalPressure, Surface_PressureDrop); - - if (direct_diff != NO_DERIVATIVE) { - SPRINTF( d_surface_outputs, ", %14.8e, %14.8e, %14.8e, %14.8e, %14.8e", - D_Surface_Uniformity, D_Surface_SecondaryStrength, D_Surface_MomentumDistortion, D_Surface_SecondOverUniform, D_Surface_PressureDrop); - } - } - - /*--- Transition residual ---*/ - if (transition) { - SPRINTF (trans_resid, ", %12.10f, %12.10f", log10(residual_transition[0]), log10(residual_transition[1])); - } - - /*--- Combo objective ---*/ - if (output_comboObj) { - SPRINTF(combo_obj,", %12.10f", Total_ComboObj); - } - - /*--- Fluid structure residual ---*/ - // if (fluid_structure) { - // if (nDim == 2) SPRINTF (levelset_resid, ", %12.10f, %12.10f, 0.0", log10 (residual_fea[0]), log10 (residual_fea[1])); - // else SPRINTF (levelset_resid, ", %12.10f, %12.10f, %12.10f", log10 (residual_fea[0]), log10 (residual_fea[1]), log10 (residual_fea[2])); - // } - - if (adjoint) { - - /*--- Adjoint coefficients ---*/ - if (!turbo) { - if (compressible) { - SPRINTF (adjoint_coeff, ", %14.8e, %14.8e, %14.8e, %14.8e, %14.8e, 0.0", Total_Sens_Geo, Total_Sens_Mach, Total_Sens_AoA, Total_Sens_Press, Total_Sens_Temp); - } - if (incompressible) { - SPRINTF (adjoint_coeff, ", %14.8e, %14.8e, %14.8e, %14.8e", Total_Sens_Geo, Total_Sens_ModVel, Total_Sens_BPressure, Total_Sens_Temp); - } - } else - SPRINTF (adjoint_coeff, ", %14.8e, %14.8e, %14.8e", Total_Sens_Geo, Total_Sens_BPressure, Total_Sens_Temp); - - /*--- Adjoint flow residuals ---*/ - if (nDim == 2) { - if (compressible) SPRINTF (adj_flow_resid, ", %14.8e, %14.8e, %14.8e, %14.8e, 0.0", log10 (residual_adjflow[0]), log10 (residual_adjflow[1]), log10 (residual_adjflow[2]), log10 (residual_adjflow[3]) ); - if (incompressible) SPRINTF (adj_flow_resid, ", %14.8e, %14.8e, %14.8e, %14.8e, 0.0", log10 (residual_adjflow[0]), log10 (residual_adjflow[1]), log10 (residual_adjflow[2]), log10 (residual_adjflow[3]) ); - } - else { - if (compressible) SPRINTF (adj_flow_resid, ", %14.8e, %14.8e, %14.8e, %14.8e, %14.8e", log10 (residual_adjflow[0]), log10 (residual_adjflow[1]), log10 (residual_adjflow[2]), log10 (residual_adjflow[3]), log10 (residual_adjflow[4]) ); - if (incompressible) SPRINTF (adj_flow_resid, ", %14.8e, %14.8e, %14.8e, %14.8e, %14.8e", log10 (residual_adjflow[0]), log10 (residual_adjflow[1]), log10 (residual_adjflow[2]), log10 (residual_adjflow[3]), log10 (residual_adjflow[4])); - } - - /*--- Adjoint turbulent residuals ---*/ - if (turbulent) - if (!frozen_visc) { - if (nVar_AdjTurb == 1) { - SPRINTF (adj_turb_resid, ", %14.8e", log10 (residual_adjturbulent[0])); - } else if (nVar_AdjTurb > 1) { - SPRINTF (adj_turb_resid, ", %14.8e, %14.8e", log10 (residual_adjturbulent[0]), log10 (residual_adjturbulent[1])); - } - } - - } - - if (weakly_coupled_heat) { - SPRINTF (heat_resid, ", %14.8e", log10 (residual_heat[0])); - } - - if (radiation){ - SPRINTF (rad_resid, ", %14.8e", log10 (residual_rad[0])); - } - - break; - - case MAIN_SOLVER::HEAT_EQUATION: - - SPRINTF (direct_coeff, ", %14.8e, %14.8e, %14.8e", Total_Heat, Total_MaxHeat, Total_Temperature); - SPRINTF (heat_resid, ", %14.8e", log10 (residual_heat[0])); - - break; - - case MAIN_SOLVER::FEM_ELASTICITY: - - SPRINTF (begin_fem, ", %14.8e", 0.0); - - if (incload) SPRINTF (fem_coeff, ", %14.8e, %14.8e, %14.8e", Total_VMStress, Total_ForceCoeff, Total_IncLoad); - else SPRINTF (fem_coeff, ", %14.8e, %14.8e", Total_VMStress, Total_ForceCoeff); - /*--- FEM residual ---*/ - if (nDim == 2) { - if (linear_analysis) SPRINTF (fem_resid, ", %14.8e, %14.8e, %14.8e", log10 (residual_fem[0]), log10 (residual_fem[1]), dummy); - if (nonlinear_analysis) SPRINTF (fem_resid, ", %14.8e, %14.8e, %14.8e", log10 (residual_fem[0]), log10 (residual_fem[1]), log10 (residual_fem[2])); - } - else { - SPRINTF (fem_resid, ", %14.8e, %14.8e, %14.8e", log10 (residual_fem[0]), log10 (residual_fem[1]), log10 (residual_fem[2])); - } - SPRINTF (end_fem, ", %lu, %12.10f\n", LinSolvIter, timeused/60.0); - - break; - - case MAIN_SOLVER::DISC_ADJ_FEM: - - SPRINTF (direct_coeff, ", %12.10f", Total_VMStress); - if (nDim == 2) { - SPRINTF (fem_resid, ", %14.8e, %14.8e, %14.8e, %14.8e, %14.8e", log10 (residual_fem[0]), log10 (residual_fem[1]), dummy, dummy, dummy); - } - else { - SPRINTF (fem_resid, ", %14.8e, %14.8e, %14.8e, %14.8e, %14.8e", log10 (residual_fem[0]), log10 (residual_fem[1]), log10 (residual_fem[2]), dummy, dummy); - } - - break; - default: - break; - } - } - if ((val_iZone == 0 && val_iInst == 0)|| fluid_structure){ - /*--- Write the screen header---*/ - if ( (!fem && ((write_heads) && !(!DualTime_Iteration && Unsteady))) || - (fem && ((write_heads_FEM) && !(!DualTime_Iteration && nonlinear_analysis))) - ) { - - if (!fem) { - if (!Unsteady && (config[val_iZone]->GetTime_Marching() != TIME_MARCHING::TIME_STEPPING)) { - switch (config[val_iZone]->GetKind_Solver()) { - case MAIN_SOLVER::EULER : case MAIN_SOLVER::NAVIER_STOKES: case MAIN_SOLVER::RANS: - case MAIN_SOLVER::INC_EULER : case MAIN_SOLVER::INC_NAVIER_STOKES: case MAIN_SOLVER::INC_RANS: - case MAIN_SOLVER::FEM_EULER : case MAIN_SOLVER::FEM_NAVIER_STOKES: case MAIN_SOLVER::FEM_RANS: case MAIN_SOLVER::FEM_LES: - case MAIN_SOLVER::ADJ_EULER : case MAIN_SOLVER::ADJ_NAVIER_STOKES: case MAIN_SOLVER::ADJ_RANS: - - cout << endl << "---------------------- Local Time Stepping Summary ----------------------" << endl; - - for (unsigned short iMesh = FinestMesh; iMesh <= config[val_iZone]->GetnMGLevels(); iMesh++) - cout << "MG level: "<< iMesh << " -> Min. DT: " << solver_container[val_iZone][val_iInst][iMesh][FLOW_SOL]->GetMin_Delta_Time()<< - ". Max. DT: " << solver_container[val_iZone][val_iInst][iMesh][FLOW_SOL]->GetMax_Delta_Time() << - ". CFL: " << config[val_iZone]->GetCFL(iMesh) << "." << endl; - - if (nZone > 1) - cout << "CFL in zone 2: " << config[1]->GetCFL(MESH_0) << endl; - - cout << "-------------------------------------------------------------------------" << endl; - - if (direct_diff != NO_DERIVATIVE) { - cout << endl << "---------------------- Direct Differentiation Summary -------------------" << endl; - cout << "Coefficients are differentiated with respect to "; - switch (direct_diff) { - case D_MACH: - cout << "Mach number." << endl; - break; - case D_AOA: - cout << "AoA." << endl; - break; - case D_SIDESLIP: - cout << "AoS." << endl; - break; - case D_REYNOLDS: - cout << "Reynolds number." << endl; - break; - case D_TURB2LAM: - cout << "Turb/Lam ratio." << endl; - break; - case D_PRESSURE: - cout << "Freestream Pressure." << endl; - break; - case D_TEMPERATURE: - cout << "Freestream Temperature." << endl; - break; - case D_DENSITY: - cout << "Freestream Density." << endl; - break; - case D_VISCOSITY: - cout << "Freestream Viscosity." << endl; - break; - case D_DESIGN: - cout << "Design Variables." << endl; - break; - default: - break; - } - - cout << " D_CLift(Total)" << " D_CDrag(Total)" << " D_CMz(Total)" <<" D_CEff(Total)" << endl; - cout.width(18); cout << D_Total_CL; - cout.width(18); cout << D_Total_CD; - cout.width(18); cout << D_Total_CMz; - cout.width(18); cout << D_Total_CEff; - cout << endl << "-------------------------------------------------------------------------" << endl; - cout << endl; - } - if (turbo && write_turbo && val_iZone== 0){ - WriteTurboPerfConvHistory(config[val_iZone]); - } - break; - - case MAIN_SOLVER::DISC_ADJ_EULER: case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_RANS: - case MAIN_SOLVER::DISC_ADJ_INC_EULER: case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_INC_RANS: - - cout << endl; - cout << "------------------------ Discrete Adjoint Summary -----------------------" << endl; - cout << "Total Geometry Sensitivity (updated every " << config[val_iZone]->GetVolumeOutputFrequency(0) << " iterations): "; - cout.precision(4); - cout.setf(ios::scientific, ios::floatfield); - cout << Total_Sens_Geo; - cout << endl << "-------------------------------------------------------------------------" << endl; - break; - default: - break; - } - } - else { - if (flow) { - if ((config[val_iZone]->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING) && (config[val_iZone]->GetUnst_CFL()== 0.0)) - { - cout << endl << "Min DT: " << solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetMin_Delta_Time()<< ".Max DT: " << solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetMax_Delta_Time() << ".Time step: " << config[val_iZone]->GetDelta_UnstTimeND() << "."; - } else if ((config[val_iZone]->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING) && (config[val_iZone]->GetUnst_CFL()!= 0.0)) { - cout << endl << "Min DT: " << solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetMin_Delta_Time()<< ".Max DT: " << solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetMax_Delta_Time() << ". Time step: " << solver_container[val_iZone][val_iInst][config[val_iZone]->GetFinestMesh()][FLOW_SOL]->GetMin_Delta_Time() << ". CFL: " << config[val_iZone]->GetUnst_CFL()<<"."; - } else { - cout << endl << "Min DT: " << solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetMin_Delta_Time()<< ".Max DT: " << solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetMax_Delta_Time() << ".Dual Time step: " << config[val_iZone]->GetDelta_UnstTimeND() << "."; - } - } else { - cout << endl << "Dual Time step: " << config[val_iZone]->GetDelta_UnstTimeND() << "."; - } - } - } - else if (fem && !fsi) { - if (dynamic) { - cout << endl << "Simulation time: " << config[val_iZone]->GetCurrent_DynTime() << ". Time step: " << config[val_iZone]->GetDelta_DynTime() << "."; - } - } - - switch (config[val_iZone]->GetKind_Solver()) { - case MAIN_SOLVER::EULER : case MAIN_SOLVER::NAVIER_STOKES: - case MAIN_SOLVER::INC_EULER : case MAIN_SOLVER::INC_NAVIER_STOKES: - case MAIN_SOLVER::FEM_EULER : case MAIN_SOLVER::FEM_NAVIER_STOKES: case MAIN_SOLVER::FEM_LES: - - /*--- Visualize the maximum residual ---*/ - iPointMaxResid = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetPoint_Max(0); - Coord = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetPoint_Max_Coord(0); - - cout << endl << "----------------------- Residual Evolution Summary ----------------------" << endl; - - cout << "log10[Maximum residual]: " << log10(solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetRes_Max(0)) << "." << endl; - - if (config[val_iZone]->GetSystemMeasurements() == SI) { - cout <<"Maximum residual point " << iPointMaxResid << ", located at (" << Coord[0] << ", " << Coord[1]; - if (nDim == 3) cout << ", " << Coord[2]; - cout << ")." << endl; - } - else { - cout <<"Maximum residual point " << iPointMaxResid << ", located at (" << Coord[0]*12.0 << ", " << Coord[1]*12.0; - if (nDim == 3) cout << ", " << Coord[2]*12.0; - cout << ")." << endl; - } - - /*--- Print out the number of non-physical points and reconstructions ---*/ - - if (config[val_iZone]->GetNonphysical_Points() > 0) - cout << "There are " << config[val_iZone]->GetNonphysical_Points() << " non-physical points in the solution." << endl; - if (config[val_iZone]->GetNonphysical_Reconstr() > 0) - cout << "There are " << config[val_iZone]->GetNonphysical_Reconstr() << " non-physical states in the upwind reconstruction." << endl; - - cout << "-------------------------------------------------------------------------" << endl; - - if (!Unsteady) cout << endl << " Iter" << " Time(s)"; - else cout << endl << " IntIter" << " ExtIter"; - - // if (!fluid_structure) { - if (incompressible && !weakly_coupled_heat) { - if (energy) {cout << " Res[Press]" << " Res[Temp]" << " CLift(Total)" << " CDrag(Total)" << endl;} - else {cout << " Res[Press]" << " Res[Velx]" << " CLift(Total)" << " CDrag(Total)" << endl;} - } - else if (incompressible && weakly_coupled_heat) cout << " Res[Press]" << " Res[Heat]" << " HFlux(Total)"; - else if (rotating_frame && nDim == 3 && !turbo) cout << " Res[Rho]" << " Res[RhoE]" << " CThrust(Total)" << " CTorque(Total)" << endl; - else if (aeroelastic) cout << " Res[Rho]" << " Res[RhoE]" << " CLift(Total)" << " CDrag(Total)" << " plunge" << " pitch" << endl; - else if (equiv_area) cout << " Res[Rho]" << " CLift(Total)" << " CDrag(Total)" << " CPress(N-F)" << endl; - - else if (turbo){ - - if(nZone < 2){ - /*--- single zone output ---*/ - cout << " Res[Rho]" << " Res[RhoE]" << " TotPresLoss(%)" << " Entropy Gen.(%)"; - } - else{ - /* --- multi-zone output ---*/ - cout << " Res[Rho]" << " Res[RhoE]" << " TTEfficiency(%)" << " Entropy Gen.(%)"; - } - } - - else if (actuator_disk) cout << " Res[Rho]" << " Res[RhoE]" << " CL(Total)" << " CD-CT(Total)"; - else if (engine) cout << " Res[Rho]" << " Res[RhoE]" << " CL(Total)" << " CD-CT(Total)"; - else cout << " Res[Rho]" << " Res[RhoE]" << " CL(Total)" << " CD(Total)"; - - if(extra_heat_output) { - cout << " Res[Heat]" << " HFlux(Total)"; - } - - if (radiation){ - cout << " Res[P1-RAD]"; - } - - cout << endl; - - break; - - case MAIN_SOLVER::RANS : case MAIN_SOLVER::INC_RANS: - - /*--- Visualize the maximum residual ---*/ - iPointMaxResid = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetPoint_Max(0); - Coord = solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetPoint_Max_Coord(0); - - cout << endl << "----------------------- Residual Evolution Summary ----------------------" << endl; - - cout << "log10[Maximum residual]: " << log10(solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetRes_Max(0)) << "." << endl; - if (config[val_iZone]->GetSystemMeasurements() == SI) { - cout <<"Maximum residual point " << iPointMaxResid << ", located at (" << Coord[0] << ", " << Coord[1]; - if (nDim == 3) cout << ", " << Coord[2]; - cout << ")." << endl; - } - else { - cout <<"Maximum residual point " << iPointMaxResid << ", located at (" << Coord[0]*12.0 << ", " << Coord[1]*12.0; - if (nDim == 3) cout << ", " << Coord[2]*12.0; - cout << ")." << endl; - } - cout <<"Maximum Omega " << solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetOmega_Max() << ", maximum Strain Rate " << solver_container[val_iZone][val_iInst][FinestMesh][FLOW_SOL]->GetStrainMag_Max() << "." << endl; - - /*--- Print out the number of non-physical points and reconstructions ---*/ - if (config[val_iZone]->GetNonphysical_Points() > 0) - cout << "There are " << config[val_iZone]->GetNonphysical_Points() << " non-physical points in the solution." << endl; - if (config[val_iZone]->GetNonphysical_Reconstr() > 0) - cout << "There are " << config[val_iZone]->GetNonphysical_Reconstr() << " non-physical states in the upwind reconstruction." << endl; - - cout << "-------------------------------------------------------------------------" << endl; - - if (!Unsteady) cout << endl << " Iter" << " Time(s)"; - else cout << endl << " IntIter" << " ExtIter"; - if (incompressible) cout << " Res[Press]"; - else cout << " Res[Rho]";//, cout << " Res[RhoE]"; - - switch (config[val_iZone]->GetKind_Turb_Model()) { - case TURB_MODEL::SA: cout << " Res[nu]"; break; - case TURB_MODEL::SST: cout << " Res[kine]" << " Res[omega]"; break; - default: break; - } - - if (weakly_coupled_heat) { - cout << " Res[Heat]"; - } - - if (transition) { cout << " Res[Int]" << " Res[Re]"; } - else if (rotating_frame && nDim == 3 && !turbo ) cout << " CThrust(Total)" << " CTorque(Total)"; - else if (aeroelastic) cout << " CLift(Total)" << " CDrag(Total)" << " plunge" << " pitch"; - else if (equiv_area) cout << " CLift(Total)" << " CDrag(Total)" << " CPress(N-F)"; - else if (turbo){ - if (nZone < 2){ - /*--- single zone output ---*/ - cout << " TotPresLoss(%)" << " Entropy Gen.(%)"; - } - else{ - /*--- multi zone output ---*/ - cout << " TTEfficiency(%)" << " Entropy Gen.(%)"; - - } - } - else if (weakly_coupled_heat) { - cout << " HFlux(Total)"; - } - else cout << " CLift(Total)" << " CDrag(Total)"; - - if(extra_heat_output) { - cout << " Res[Heat]" << " HFlux(Total)"; - } - - if (radiation){ - cout << " Res[P1-RAD]"; - } - - cout << endl; - - break; - - case MAIN_SOLVER::HEAT_EQUATION : - if (!Unsteady) cout << endl << " Iter" << " Time(s)"; - else cout << endl << " IntIter" << " ExtIter"; - - cout << " Res[Heat]" << " HFlux(Total)"; - break; - - case MAIN_SOLVER::FEM_ELASTICITY : - if (!nonlinear_analysis) cout << endl << " Iter" << " Time(s)"; - else cout << endl << " IntIter" << " ExtIter"; - - if (linear_analysis) { - if (nDim == 2) cout << " Res[Displx]" << " Res[Disply]" << " VMS(Max)"<< endl; - if (nDim == 3) cout << " Res[Displx]" << " Res[Disply]" << " Res[Displz]" << " VMS(Max)"<< endl; - } - else if (nonlinear_analysis) { - cout << " Res[UTOL]" << " Res[RTOL]" << " Res[ETOL]" << " VMS(Max)"<< endl; - } - break; - - case MAIN_SOLVER::ADJ_EULER : case MAIN_SOLVER::ADJ_NAVIER_STOKES : - case MAIN_SOLVER::DISC_ADJ_EULER: case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: - case MAIN_SOLVER::DISC_ADJ_INC_EULER: case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: - - /*--- Visualize the maximum residual ---*/ - iPointMaxResid = solver_container[val_iZone][val_iInst][FinestMesh][ADJFLOW_SOL]->GetPoint_Max(0); - Coord = solver_container[val_iZone][val_iInst][FinestMesh][ADJFLOW_SOL]->GetPoint_Max_Coord(0); - cout << endl << "log10[Maximum residual]: " << log10(solver_container[val_iZone][val_iInst][FinestMesh][ADJFLOW_SOL]->GetRes_Max(0)) << "." << endl; - if (config[val_iZone]->GetSystemMeasurements() == SI) { - cout <<"Maximum residual point " << iPointMaxResid << ", located at (" << Coord[0] << ", " << Coord[1]; - if (nDim == 3) cout << ", " << Coord[2]; - cout << ")." << endl; - } - else { - cout <<"Maximum residual point " << iPointMaxResid << ", located at (" << Coord[0]*12.0 << ", " << Coord[1]*12.0; - if (nDim == 3) cout << ", " << Coord[2]*12.0; - cout << ")." << endl; - } - - /*--- Print out the number of non-physical points and reconstructions ---*/ - if (config[val_iZone]->GetNonphysical_Points() > 0) - cout << "There are " << config[val_iZone]->GetNonphysical_Points() << " non-physical points in the solution." << endl; - - if (!Unsteady) cout << endl << " Iter" << " Time(s)"; - else cout << endl << " IntIter" << " ExtIter"; - - if (incompressible) { - if (energy) {cout << " Res[Psi_Press]" << " Res[Psi_Temp]";} - else {cout << " Res[Psi_Press]" << " Res[Psi_Velx]";} - } - else cout << " Res[Psi_Rho]" << " Res[Psi_E]"; - - if (radiation){ - cout << " Res[Psi_P1]"; - } - - if (disc_adj) { - if (!turbo){ - if (compressible) { - cout << " Sens_Press" << " Sens_AoA" << endl; - } - if (incompressible) { - if (energy) { - cout << " Sens_Vin" << " Sens_Temp" << endl; - } else { - cout << " Sens_Vin" << " Sens_Pout" << endl; - } - } } else { - cout << " Sens_PressOut" << " Sens_TotTempIn" << endl; - } - } else { - cout << " Sens_Geo" << " Sens_AoA" << endl; - } - break; - - case MAIN_SOLVER::ADJ_RANS : case MAIN_SOLVER::DISC_ADJ_RANS: case MAIN_SOLVER::DISC_ADJ_INC_RANS: - - /*--- Visualize the maximum residual ---*/ - iPointMaxResid = solver_container[val_iZone][val_iInst][FinestMesh][ADJFLOW_SOL]->GetPoint_Max(0); - Coord = solver_container[val_iZone][val_iInst][FinestMesh][ADJFLOW_SOL]->GetPoint_Max_Coord(0); - cout << endl << "log10[Maximum residual]: " << log10(solver_container[val_iZone][val_iInst][FinestMesh][ADJFLOW_SOL]->GetRes_Max(0)) << "." << endl; - if (config[val_iZone]->GetSystemMeasurements() == SI) { - cout <<"Maximum residual point " << iPointMaxResid << ", located at (" << Coord[0] << ", " << Coord[1]; - if (nDim == 3) cout << ", " << Coord[2]; - cout << ")." << endl; - } - else { - cout <<"Maximum residual point " << iPointMaxResid << ", located at (" << Coord[0]*12.0 << ", " << Coord[1]*12.0; - if (nDim == 3) cout << ", " << Coord[2]*12.0; - cout << ")." << endl; - } - - /*--- Print out the number of non-physical points and reconstructions ---*/ - if (config[val_iZone]->GetNonphysical_Points() > 0) - cout << "There are " << config[val_iZone]->GetNonphysical_Points() << " non-physical points in the solution." << endl; - - if (!Unsteady) cout << endl << " Iter" << " Time(s)"; - else cout << endl << " IntIter" << " ExtIter"; - - if (incompressible) cout << " Res[Psi_Press]"; - else cout << " Res[Psi_Rho]"; - - if (!frozen_visc) { - cout << " Res[Psi_Turb[0]]"; - } - else { - if (incompressible) {if (energy) {cout << " Res[Psi_Temp]";} - else {cout << " Res[Psi_Velx]";}} - else cout << " Res[Psi_E]"; - } - if (weakly_coupled_heat) { - cout << " Res[Psi_E]"; - } - if (radiation){ - cout << " Res[Psi_P1]"; - } - if (disc_adj) { - if (!turbo){ - if (compressible) { - cout << " Sens_Press" << " Sens_AoA" << endl; - } - if (incompressible) { - cout << " Sens_Vin" << " Sens_Pout" << endl; - } - } else { - cout << " Sens_PressOut" << " Sens_TotTempIn" << endl; } - } else { - cout << " Sens_Geo" << " Sens_AoA" << endl; - } - break; - - case MAIN_SOLVER::DISC_ADJ_FEM : - cout << endl << " IntIter" << " ExtIter"; - - if (nDim == 2) cout << " Res[Ux_adj]" << " Res[Uy_adj]" << " Sens[E]" << " Sens[Nu]"<< endl; - if (nDim == 3) cout << " Res[Ux_adj]" << " Res[Uy_adj]" << " Res[Uz_adj]" << " Sens[E]" << " Sens[Nu]"<< endl; - - break; - - default: - break; - } - } - } - - /*--- Write the solution on the screen ---*/ - - if ((val_iZone == 0 && val_iInst == 0)|| fluid_structure){ - cout.precision(6); - cout.setf(ios::fixed, ios::floatfield); - if (!fem) { - if (!Unsteady) { - cout.width(5); cout << iExtIter + ExtIter_OffSet; - cout.width(11); cout << timeiter; - - } else if (Unsteady && DualTime_Iteration) { - cout.width(8); cout << iIntIter; - cout.width(8); cout << iExtIter; - } - } - else if (fem) { - if (!DualTime_Iteration) { - if (!nonlinear_analysis) { - cout.width(5); cout << iExtIter; - cout.width(11); cout << timeiter; - - } else { - cout.width(8); cout << iIntIter; - cout.width(8); cout << iExtIter; - } - } - else if (discadj_fem){ - cout.width(8); cout << iIntIter; - cout.width(8); cout << iExtIter; - } - } - } - - switch (config[val_iZone]->GetKind_Solver()) { - case MAIN_SOLVER::EULER : case MAIN_SOLVER::NAVIER_STOKES: - case MAIN_SOLVER::INC_EULER : case MAIN_SOLVER::INC_NAVIER_STOKES: - case MAIN_SOLVER::FEM_EULER : case MAIN_SOLVER::FEM_NAVIER_STOKES: case MAIN_SOLVER::FEM_LES: - - /*--- Write history file ---*/ - - if ((!DualTime_Iteration) && (output_files)) { - if (!turbo) { - ConvHist_file[0] << begin << direct_coeff; - if (buffet) ConvHist_file[0] << buffet_coeff; - if (thermal) ConvHist_file[0] << heat_coeff; - if (equiv_area) ConvHist_file[0] << equivalent_area_coeff; - if (engine || actuator_disk) ConvHist_file[0] << engine_coeff; - if (inv_design) { - ConvHist_file[0] << Cp_inverse_design; - if (thermal) ConvHist_file[0] << Heat_inverse_design; - } - if (rotating_frame && !turbo) ConvHist_file[0] << rotating_frame_coeff; - ConvHist_file[0] << flow_resid; - if (weakly_coupled_heat) ConvHist_file[0] << heat_resid; - if (radiation) ConvHist_file[0] << rad_resid; - } - else { - ConvHist_file[0] << begin << turbo_coeff << flow_resid; - } - - if (aeroelastic) ConvHist_file[0] << aeroelastic_coeff; - if (output_per_surface) ConvHist_file[0] << monitoring_coeff; - if (output_surface) ConvHist_file[0] << surface_outputs; - if (direct_diff != NO_DERIVATIVE) { - ConvHist_file[0] << d_direct_coeff; - if (output_surface) ConvHist_file[0] << d_surface_outputs; - } - if (output_comboObj) ConvHist_file[0] << combo_obj; - ConvHist_file[0] << end; - ConvHist_file[0].flush(); - } - - /*--- Write screen output ---*/ - if ((val_iZone == 0 && val_iInst == 0)|| fluid_structure) { - if(DualTime_Iteration || !Unsteady) { - cout.precision(6); - cout.setf(ios::fixed, ios::floatfield); - cout.width(13); cout << log10(residual_flow[0]); - if (!equiv_area) { - if (compressible) { - if (nDim == 2 ) { cout.width(14); cout << log10(residual_flow[3]); } - else { cout.width(14); cout << log10(residual_flow[4]); } - } - if (incompressible && !weakly_coupled_heat) { - if (energy) {cout.width(14); cout << log10(residual_flow[nDim+1]);} - else {cout.width(14); cout << log10(residual_flow[1]);} - } - if (incompressible && weakly_coupled_heat) { cout.width(14); cout << log10(residual_heat[0]);} - - } - - if (rotating_frame && nDim == 3 && !turbo ) { - cout.setf(ios::scientific, ios::floatfield); - cout.width(15); cout << Total_CT; - cout.width(15); cout << Total_CQ; - cout.unsetf(ios_base::floatfield); - } - else if (equiv_area) { cout.width(15); cout << min(10000.0, max(-10000.0, Total_CL)); cout.width(15); cout << min(10000.0, max(-10000.0, Total_CD)); cout.width(15); - cout.precision(4); - cout.setf(ios::scientific, ios::floatfield); - cout << Total_CNearFieldOF; } - else if (turbo) { - cout.setf(ios::scientific, ios::floatfield); - - if (nZone < 2) { - cout.width(15); cout << TotalPressureLoss[0][nSpanWiseSections]*100.0; - cout.width(15); cout << EntropyGen[0][nSpanWiseSections]*100.0; - } - else { - cout.width(15); cout << TotalTotalEfficiency[nTurboPerf -1][nSpanWiseSections]*100.0; - cout.width(15); cout << EntropyGen[nTurboPerf -1][nSpanWiseSections]*100.0; - } - - cout.unsetf(ios_base::floatfield); - - } - else if (weakly_coupled_heat) { cout.width(14); cout << log10(Total_Heat); } - else { cout.width(15); cout << min(10000.0, max(-10000.0, Total_CL)); cout.width(15); cout << min(10000.0, max(-10000.0, Total_CD)); } - if (aeroelastic) { - cout.setf(ios::scientific, ios::floatfield); - cout.width(15); cout << aeroelastic_plunge[0]; //Only output the first marker being monitored to the console. - cout.width(15); cout << aeroelastic_pitch[0]; - cout.unsetf(ios_base::floatfield); - } - - if (extra_heat_output) { cout.width(15); cout << Extra_Heat_Residual; cout.width(15); cout << Extra_Total_Heat; } - if (radiation) { cout.width(15); cout << log10(residual_rad[0]); } - } - cout << endl; - } - break; - - case MAIN_SOLVER::RANS : case MAIN_SOLVER::INC_RANS: - - /*--- Write history file ---*/ - - if ((!DualTime_Iteration) && (output_files)) { - - if (!turbo) { - ConvHist_file[0] << begin << direct_coeff; - if (buffet) ConvHist_file[0] << buffet_coeff; - if (thermal) ConvHist_file[0] << heat_coeff; - if (equiv_area) ConvHist_file[0] << equivalent_area_coeff; - if (engine || actuator_disk) ConvHist_file[0] << engine_coeff; - if (inv_design) { - ConvHist_file[0] << Cp_inverse_design; - if (thermal) ConvHist_file[0] << Heat_inverse_design; - } - if (rotating_frame && !turbo) ConvHist_file[0] << rotating_frame_coeff; - ConvHist_file[0] << flow_resid << turb_resid; - if (weakly_coupled_heat) ConvHist_file[0] << heat_resid; - } - else { - ConvHist_file[0] << begin << turbo_coeff << flow_resid << turb_resid; - } - - if (aeroelastic) ConvHist_file[0] << aeroelastic_coeff; - if (output_per_surface) ConvHist_file[0] << monitoring_coeff; - if (output_surface) ConvHist_file[0] << surface_outputs; - if (direct_diff != NO_DERIVATIVE) { - ConvHist_file[0] << d_direct_coeff; - if (output_surface) ConvHist_file[0] << d_surface_outputs; - } - if (output_comboObj) ConvHist_file[0] << combo_obj; - ConvHist_file[0] << end; - ConvHist_file[0].flush(); - } - - /*--- Write screen output ---*/ - - if ((val_iZone == 0 && val_iInst == 0)|| fluid_structure){ - if(DualTime_Iteration || !Unsteady) { - cout.precision(6); - cout.setf(ios::fixed, ios::floatfield); - - if (incompressible) cout.width(13); - else cout.width(14); - cout << log10(residual_flow[0]); - switch(nVar_Turb) { - case 1: cout.width(14); cout << log10(residual_turbulent[0]); break; - case 2: cout.width(14); cout << log10(residual_turbulent[0]); - cout.width(15); cout << log10(residual_turbulent[1]); break; - } - - if (weakly_coupled_heat) { - cout.width(14); cout << log10(residual_heat[0]); - } - - if (transition) { cout.width(14); cout << log10(residual_transition[0]); cout.width(14); cout << log10(residual_transition[1]); } - - if (rotating_frame && nDim == 3 && !turbo ) { - cout.setf(ios::scientific, ios::floatfield); - cout.width(15); cout << Total_CT; cout.width(15); - cout << Total_CQ; - cout.unsetf(ios_base::floatfield); - } - else if (equiv_area) { cout.width(15); cout << min(10000.0, max(-10000.0, Total_CL)); cout.width(15); cout << min(10000.0, max(-10000.0, Total_CD)); cout.width(15); - cout.precision(4); - cout.setf(ios::scientific, ios::floatfield); - cout << Total_CNearFieldOF; } - else if (turbo) { - cout.setf(ios::scientific, ios::floatfield); - if (nZone < 2){ - /*--- single zone output ---*/ - cout.width(15); cout << TotalPressureLoss[0][nSpanWiseSections]*100.0; - cout.width(15); cout << EntropyGen[0][nSpanWiseSections]*100.0; - } - else{ - /*--- multi zone output ---*/ - cout.width(15); cout << TotalTotalEfficiency[nTurboPerf - 1][nSpanWiseSections]*100.0; - cout.width(15); cout << EntropyGen[nTurboPerf -1][nSpanWiseSections]*100.0; - if (direct_diff){ - cout.width(15); cout << D_EntropyGen; - } - } - cout.unsetf(ios_base::floatfield); - } - else if (weakly_coupled_heat) { cout.width(15); cout << Total_Heat; } - else { cout.width(15); cout << min(10000.0, max(-10000.0, Total_CL)); cout.width(15); cout << min(10000.0, max(-10000.0, Total_CD)); } - - if (aeroelastic) { - cout.setf(ios::scientific, ios::floatfield); - cout.width(15); cout << aeroelastic_plunge[0]; //Only output the first marker being monitored to the console. - cout.width(15); cout << aeroelastic_pitch[0]; - cout.unsetf(ios_base::floatfield); - } - - if (extra_heat_output) { cout.width(15); cout << Extra_Heat_Residual; cout.width(15); cout << Extra_Total_Heat; } - cout << endl; - } - } - break; - - - case MAIN_SOLVER::HEAT_EQUATION: - - if (!DualTime_Iteration) { - ConvHist_file[0] << begin << direct_coeff << heat_resid << end; - ConvHist_file[0].flush(); - } - break; - - case MAIN_SOLVER::FEM_ELASTICITY: - - if (!DualTime_Iteration) { - ConvHist_file[0] << begin << fem_coeff << fem_resid << end_fem; - ConvHist_file[0].flush(); - - cout.precision(6); - cout.setf(ios::fixed, ios::floatfield); - if (linear_analysis) { - cout.width(14); cout << log10(residual_fem[0]); - cout.width(14); cout << log10(residual_fem[1]); - if (nDim == 3) { cout.width(14); cout << log10(residual_fem[2]); } - } - else if (nonlinear_analysis) { - cout.width(14); cout << log10(residual_fem[0]); - cout.width(14); cout << log10(residual_fem[1]); - cout.width(14); cout << log10(residual_fem[2]); - } - - cout.precision(4); - cout.setf(ios::scientific, ios::floatfield); - cout.width(14); cout << Total_VMStress; - cout << endl; - } - break; - - case MAIN_SOLVER::DISC_ADJ_FEM: - - cout.precision(6); - cout.setf(ios::fixed, ios::floatfield); - - cout.width(15); cout << log10(residual_fem[0]); - cout.width(15); cout << log10(residual_fem[1]); - if (nDim == 3) { cout.width(15); cout << log10(residual_fem[2]); } - - cout.precision(4); - cout.setf(ios::scientific, ios::floatfield); - - - if (config[val_iZone]->GetnElasticityMod() == 1){ - cout.width(14); cout << solver_container[val_iZone][val_iInst][FinestMesh][ADJFEA_SOL]->GetGlobal_Sens_E(0); - cout.width(14); cout << solver_container[val_iZone][val_iInst][FinestMesh][ADJFEA_SOL]->GetGlobal_Sens_Nu(0); - } - else{ - Total_SensE = 0.0; Total_SensNu = 0.0; - for (unsigned short iVar = 0; iVar < config[val_iZone]->GetnElasticityMod(); iVar++){ - Total_SensE += solver_container[val_iZone][val_iInst][FinestMesh][ADJFEA_SOL]->GetGlobal_Sens_E(0) - *solver_container[val_iZone][val_iInst][FinestMesh][ADJFEA_SOL]->GetGlobal_Sens_E(0); - Total_SensNu += solver_container[val_iZone][val_iInst][FinestMesh][ADJFEA_SOL]->GetGlobal_Sens_Nu(0) - *solver_container[val_iZone][val_iInst][FinestMesh][ADJFEA_SOL]->GetGlobal_Sens_Nu(0); - } - Total_SensE = sqrt(Total_SensE); - Total_SensNu = sqrt(Total_SensNu); - cout.width(14); cout << Total_SensE; - cout.width(14); cout << Total_SensNu; - } - - cout << endl; - break; - - case MAIN_SOLVER::ADJ_EULER : case MAIN_SOLVER::ADJ_NAVIER_STOKES : - case MAIN_SOLVER::DISC_ADJ_EULER: case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: - case MAIN_SOLVER::DISC_ADJ_INC_EULER: case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: - - if (!DualTime_Iteration) { - ConvHist_file[0] << begin << adjoint_coeff << adj_flow_resid << end; - ConvHist_file[0].flush(); - } - if ((val_iZone == 0 && val_iInst == 0)|| fluid_structure){ - if (DualTime_Iteration || !Unsteady){ - cout.precision(6); - cout.setf(ios::fixed, ios::floatfield); - if (compressible) { - cout.width(15); cout << log10(residual_adjflow[0]); - cout.width(15); cout << log10(residual_adjflow[nDim+1]); - } - if (incompressible) { - cout.width(17); cout << log10(residual_adjflow[0]); - if (energy) {cout.width(16); cout << log10(residual_adjflow[nDim+1]);} - else {cout.width(16); cout << log10(residual_adjflow[1]);} - } - - if (radiation) { cout.width(15); cout << log10(residual_rad[0]); } - - if (disc_adj) { - cout.precision(4); - cout.setf(ios::scientific, ios::floatfield); - if (!turbo){ - if (compressible) { - cout.width(14); cout << Total_Sens_Press; - cout.width(14); cout << Total_Sens_AoA; - } - if (incompressible) { - cout.width(14); cout << Total_Sens_ModVel; - if (energy) { - cout.width(14); cout << Total_Sens_Temp; - } else { - cout.width(14); cout << Total_Sens_BPressure; - } - } - } else { - cout.width(14); cout << Total_Sens_BPressure; - cout.width(15); cout << Total_Sens_Temp; - } - }else { - cout.precision(4); - cout.setf(ios::scientific, ios::floatfield); - cout.width(14); cout << Total_Sens_Geo; - cout.width(14); cout << Total_Sens_AoA; - } - cout << endl; - cout.unsetf(ios_base::floatfield); - } - } - break; - - case MAIN_SOLVER::ADJ_RANS : case MAIN_SOLVER::DISC_ADJ_RANS: case MAIN_SOLVER::DISC_ADJ_INC_RANS: - - if (!DualTime_Iteration) { - ConvHist_file[0] << begin << adjoint_coeff << adj_flow_resid; - if (!frozen_visc) - ConvHist_file[0] << adj_turb_resid; - ConvHist_file[0] << end; - ConvHist_file[0].flush(); - } - if ((val_iZone == 0 && val_iInst == 0)|| fluid_structure){ - if (DualTime_Iteration || !Unsteady){ - cout.precision(6); - cout.setf(ios::fixed, ios::floatfield); - cout.width(17); cout << log10(residual_adjflow[0]); - if (!frozen_visc) { - cout.width(17); cout << log10(residual_adjturbulent[0]); - } - else { - if (compressible) { - if (geometry[val_iZone][val_iInst][FinestMesh]->GetnDim() == 2 ) { cout.width(15); cout << log10(residual_adjflow[3]); } - else { cout.width(15); cout << log10(residual_adjflow[4]); } - } - if (incompressible) { - if (energy) {cout.width(15); cout << log10(residual_adjflow[nDim+1]);} - else {cout.width(15); cout << log10(residual_adjflow[1]);} - } - } - if (weakly_coupled_heat) { - cout.width(17); cout << log10(residual_adjheat[0]); - } - - if (radiation) { cout.width(15); cout << log10(residual_rad[0]); } - - if (disc_adj) { - if (!turbo){ - if (compressible) { - cout.width(14); cout << Total_Sens_Press; - cout.width(14); cout << Total_Sens_AoA; - } - if (incompressible) { - cout.width(14); cout << Total_Sens_ModVel; - if (energy) { - cout.width(14); cout << Total_Sens_Temp; - } else { - cout.width(14); cout << Total_Sens_BPressure; - } } - } else { - cout.width(14); cout << Total_Sens_BPressure; - cout.width(15); cout << Total_Sens_Temp; - } - }else { - cout.precision(4); - cout.setf(ios::scientific, ios::floatfield); - cout.width(14); cout << Total_Sens_Geo; - cout.width(14); cout << Total_Sens_AoA; - } - cout << endl; - cout.unsetf(ios_base::floatfield); - } - } - break; - - default: - break; - } - cout.unsetf(ios::fixed); - - } - - - delete [] residual_flow; - delete [] residual_turbulent; - delete [] residual_transition; - delete [] residual_fea; - delete [] residual_fem; - delete [] residual_heat; - delete [] residual_rad; - - delete [] residual_adjflow; - delete [] residual_adjturbulent; - - delete [] Surface_CL; - delete [] Surface_CD; - delete [] Surface_CSF; - delete [] Surface_CEff; - delete [] Surface_CFx; - delete [] Surface_CFy; - delete [] Surface_CFz; - delete [] Surface_CMx; - delete [] Surface_CMy; - delete [] Surface_CMz; - delete [] aeroelastic_pitch; - delete [] aeroelastic_plunge; - - } -} - -void COutputLegacy::SpecialOutput_ForcesBreakdown(CSolver *****solver, CGeometry ****geometry, CConfig **config, unsigned short val_iZone, bool output) const { - - char cstr[200]; - unsigned short iDim, iMarker_Monitoring; - ofstream Breakdown_file; - - bool compressible = (config[val_iZone]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); - bool incompressible = (config[val_iZone]->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE); - bool unsteady = (config[val_iZone]->GetTime_Marching() != TIME_MARCHING::STEADY); - bool viscous = config[val_iZone]->GetViscous(); - bool dynamic_grid = config[val_iZone]->GetDynamic_Grid(); - bool gravity = config[val_iZone]->GetGravityForce(); - bool turbulent = config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::RANS; - bool fixed_cl = config[val_iZone]->GetFixed_CL_Mode(); - MAIN_SOLVER Kind_Solver = config[val_iZone]->GetKind_Solver(); - TURB_MODEL Kind_Turb_Model = config[val_iZone]->GetKind_Turb_Model(); - unsigned short Ref_NonDim = config[val_iZone]->GetRef_NonDim(); - - unsigned short FinestMesh = config[val_iZone]->GetFinestMesh(); - unsigned short nDim = geometry[val_iZone][INST_0][FinestMesh]->GetnDim(); - bool flow = ((config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::EULER) || - (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::NAVIER_STOKES) || - (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::RANS) || - (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::INC_EULER) || - (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::INC_NAVIER_STOKES) || - (config[val_iZone]->GetKind_Solver() == MAIN_SOLVER::INC_RANS)); - - /*--- Output the mean flow solution using only the master node ---*/ - - if ((rank == MASTER_NODE) && (flow) && (output)) { - - cout << endl << "Writing the forces breakdown file ("<< config[val_iZone]->GetBreakdown_FileName() << ")." << endl; - - /*--- Initialize variables to store information from all domains (direct solution) ---*/ - - su2double Total_CL = 0.0, Total_CD = 0.0, Total_CSF = 0.0, - Total_CMx = 0.0, Total_CMy = 0.0, Total_CMz = 0.0, Total_CEff = 0.0, - Total_CoPx = 0.0, Total_CoPy = 0.0, Total_CoPz = 0.0, - Total_CFx = 0.0, Total_CFy = 0.0, Total_CFz = 0.0, Inv_CL = 0.0, - Inv_CD = 0.0, Inv_CSF = 0.0, Inv_CMx = 0.0, Inv_CMy = 0.0, - Inv_CMz = 0.0, Inv_CEff = 0.0, Inv_CFx = 0.0, Inv_CFy = 0.0, Inv_CFz = - 0.0, Mnt_CL = 0.0, - Mnt_CD = 0.0, Mnt_CSF = 0.0, Mnt_CMx = 0.0, Mnt_CMy = 0.0, - Mnt_CMz = 0.0, Mnt_CEff = 0.0, Mnt_CFx = 0.0, Mnt_CFy = 0.0, Mnt_CFz = - 0.0, Visc_CL = 0.0, - Visc_CD = 0.0, Visc_CSF = 0.0, Visc_CMx = 0.0, Visc_CMy = 0.0, - Visc_CMz = 0.0, Visc_CEff = 0.0, Visc_CFx = 0.0, Visc_CFy = 0.0, Visc_CFz = - 0.0, *Surface_CL = nullptr, *Surface_CD = nullptr, - *Surface_CSF = nullptr, *Surface_CEff = nullptr, *Surface_CFx = nullptr, - *Surface_CFy = nullptr, *Surface_CFz = nullptr, - *Surface_CMx = nullptr, *Surface_CMy = nullptr, *Surface_CMz = nullptr, - *Surface_CL_Inv = nullptr, - *Surface_CD_Inv = nullptr, *Surface_CSF_Inv = nullptr, - *Surface_CEff_Inv = nullptr, *Surface_CFx_Inv = nullptr, *Surface_CFy_Inv = - nullptr, *Surface_CFz_Inv = nullptr, *Surface_CMx_Inv = nullptr, - *Surface_CMy_Inv = nullptr, *Surface_CMz_Inv = nullptr, - *Surface_CL_Visc = nullptr, - *Surface_CD_Visc = nullptr, *Surface_CSF_Visc = nullptr, - *Surface_CEff_Visc = nullptr, *Surface_CFx_Visc = nullptr, *Surface_CFy_Visc = - nullptr, *Surface_CFz_Visc = nullptr, *Surface_CMx_Visc = nullptr, - *Surface_CMy_Visc = nullptr, *Surface_CMz_Visc = nullptr, - *Surface_CL_Mnt = nullptr, - *Surface_CD_Mnt = nullptr, *Surface_CSF_Mnt = nullptr, - *Surface_CEff_Mnt = nullptr, *Surface_CFx_Mnt = nullptr, *Surface_CFy_Mnt = - nullptr, *Surface_CFz_Mnt = nullptr, *Surface_CMx_Mnt = nullptr, - *Surface_CMy_Mnt = nullptr, *Surface_CMz_Mnt = nullptr; - - /*--- Allocate memory for the coefficients being monitored ---*/ - - Surface_CL = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CD = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CSF = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CEff = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CFx = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CFy = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CFz = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CMx = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CMy = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CMz = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - - Surface_CL_Inv = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CD_Inv = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CSF_Inv = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CEff_Inv = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CFx_Inv = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CFy_Inv = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CFz_Inv = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CMx_Inv = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CMy_Inv = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CMz_Inv = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - - Surface_CL_Visc = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CD_Visc = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CSF_Visc = - new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CEff_Visc = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CFx_Visc = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CFy_Visc = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CFz_Visc = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CMx_Visc = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CMy_Visc = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CMz_Visc = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - - - Surface_CL_Mnt = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CD_Mnt = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CSF_Mnt = - new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CEff_Mnt = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CFx_Mnt = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CFy_Mnt = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CFz_Mnt = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CMx_Mnt = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CMy_Mnt = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - Surface_CMz_Mnt = new su2double[config[ZONE_0]->GetnMarker_Monitoring()]; - - /*--- Flow solution coefficients ---*/ - - Total_CL = solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CL(); - Total_CD = solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CD(); - Total_CSF = solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CSF(); - Total_CEff = solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CEff(); - Total_CMx = solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CMx(); - Total_CMy = solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CMy(); - Total_CMz = solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CMz(); - Total_CFx = solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CFx(); - Total_CFy = solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CFy(); - Total_CFz = solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CFz(); - - if (nDim == 2) { - Total_CoPx = solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CoPx() / solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CFy(); - Total_CoPy = solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CoPy() / solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CFx(); - Total_CoPz = 0.0; - } - if (nDim == 3) { - Total_CoPx = solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CoPx() / solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CFz(); - Total_CoPy = 0.0; - Total_CoPz = solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CoPz() / solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CFx(); - } - - if (config[ZONE_0]->GetSystemMeasurements() == US) { Total_CoPx *= 12.0; Total_CoPy *= 12.0; Total_CoPz *= 12.0; } - - /*--- Flow inviscid solution coefficients ---*/ - - Inv_CL = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CL_Inv(); - Inv_CD = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CD_Inv(); - Inv_CSF = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CSF_Inv(); - Inv_CEff = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CEff_Inv(); - Inv_CMx = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CMx_Inv(); - Inv_CMy = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CMy_Inv(); - Inv_CMz = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CMz_Inv(); - Inv_CFx = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CFx_Inv(); - Inv_CFy = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CFy_Inv(); - Inv_CFz = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CFz_Inv(); - - /*--- Flow viscous solution coefficients ---*/ - - Visc_CL = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CL_Visc(); - Visc_CD = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CD_Visc(); - Visc_CSF = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CSF_Visc(); - Visc_CEff = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CEff_Visc(); - Visc_CMx = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CMx_Visc(); - Visc_CMy = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CMy_Visc(); - Visc_CMz = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CMz_Visc(); - Visc_CFx = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CFx_Visc(); - Visc_CFy = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CFy_Visc(); - Visc_CFz = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CFz_Visc(); - - /*--- Flow momentum solution coefficients ---*/ - - Mnt_CL = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CL_Mnt(); - Mnt_CD = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CD_Mnt(); - Mnt_CSF = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CSF_Mnt(); - Mnt_CEff = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CEff_Mnt(); - Mnt_CMx = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CMx_Mnt(); - Mnt_CMy = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CMy_Mnt(); - Mnt_CMz = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CMz_Mnt(); - Mnt_CFx = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CFx_Mnt(); - Mnt_CFy = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CFy_Mnt(); - Mnt_CFz = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAllBound_CFz_Mnt(); - - - /*--- Look over the markers being monitored and get the desired values ---*/ - - for (iMarker_Monitoring = 0; - iMarker_Monitoring < config[ZONE_0]->GetnMarker_Monitoring(); - iMarker_Monitoring++) { - Surface_CL[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CL( - iMarker_Monitoring); - Surface_CD[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CD( - iMarker_Monitoring); - Surface_CSF[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CSF( - iMarker_Monitoring); - Surface_CEff[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CEff( - iMarker_Monitoring); - Surface_CMx[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CMx( - iMarker_Monitoring); - Surface_CMy[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CMy( - iMarker_Monitoring); - Surface_CMz[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CMz( - iMarker_Monitoring); - Surface_CFx[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CFx( - iMarker_Monitoring); - Surface_CFy[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CFy( - iMarker_Monitoring); - Surface_CFz[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CFz( - iMarker_Monitoring); - - Surface_CL_Inv[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CL_Inv( - iMarker_Monitoring); - Surface_CD_Inv[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CD_Inv( - iMarker_Monitoring); - Surface_CSF_Inv[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CSF_Inv( - iMarker_Monitoring); - Surface_CEff_Inv[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CEff_Inv( - iMarker_Monitoring); - Surface_CMx_Inv[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CMx_Inv( - iMarker_Monitoring); - Surface_CMy_Inv[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CMy_Inv( - iMarker_Monitoring); - Surface_CMz_Inv[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CMz_Inv( - iMarker_Monitoring); - Surface_CFx_Inv[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CFx_Inv( - iMarker_Monitoring); - Surface_CFy_Inv[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CFy_Inv( - iMarker_Monitoring); - Surface_CFz_Inv[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CFz_Inv( - iMarker_Monitoring); - Surface_CL_Visc[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CL_Visc( - iMarker_Monitoring); - Surface_CD_Visc[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CD_Visc( - iMarker_Monitoring); - Surface_CSF_Visc[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CSF_Visc( - iMarker_Monitoring); - Surface_CEff_Visc[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CEff_Visc( - iMarker_Monitoring); - Surface_CMx_Visc[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CMx_Visc( - iMarker_Monitoring); - Surface_CMy_Visc[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CMy_Visc( - iMarker_Monitoring); - Surface_CMz_Visc[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CMz_Visc( - iMarker_Monitoring); - Surface_CFx_Visc[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CFx_Visc( - iMarker_Monitoring); - Surface_CFy_Visc[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CFy_Visc( - iMarker_Monitoring); - Surface_CFz_Visc[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CFz_Visc( - iMarker_Monitoring); - - Surface_CL_Mnt[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CL_Mnt( - iMarker_Monitoring); - Surface_CD_Mnt[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CD_Mnt( - iMarker_Monitoring); - Surface_CSF_Mnt[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CSF_Mnt( - iMarker_Monitoring); - Surface_CEff_Mnt[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CEff_Mnt( - iMarker_Monitoring); - Surface_CMx_Mnt[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CMx_Mnt( - iMarker_Monitoring); - Surface_CMy_Mnt[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CMy_Mnt( - iMarker_Monitoring); - Surface_CMz_Mnt[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CMz_Mnt( - iMarker_Monitoring); - Surface_CFx_Mnt[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CFx_Mnt( - iMarker_Monitoring); - Surface_CFy_Mnt[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CFy_Mnt( - iMarker_Monitoring); - Surface_CFz_Mnt[iMarker_Monitoring] = - solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetSurface_CFz_Mnt( - iMarker_Monitoring); - - } - - - /*--- Write file name with extension ---*/ - - string filename = config[val_iZone]->GetBreakdown_FileName(); - strcpy (cstr, filename.data()); - - Breakdown_file.open(cstr, ios::out); - - Breakdown_file << "\n" <<"-------------------------------------------------------------------------" << "\n"; - Breakdown_file <<"| ___ _ _ ___ |" << "\n"; - Breakdown_file <<"| / __| | | |_ ) Release 7.5.0 \"Blackbird\" |" << "\n"; - Breakdown_file <<"| \\__ \\ |_| |/ / |" << "\n"; - Breakdown_file <<"| |___/\\___//___| Suite (Computational Fluid Dynamics Code) |" << "\n"; - Breakdown_file << "| |" << "\n"; - Breakdown_file <<"-------------------------------------------------------------------------" << "\n"; - Breakdown_file << "| SU2 Project Website: https://su2code.github.io |" << "\n"; - Breakdown_file << "| |" << "\n"; - Breakdown_file << "| The SU2 Project is maintained by the SU2 Foundation |" << "\n"; - Breakdown_file << "| (http://su2foundation.org) |" << "\n"; - Breakdown_file <<"-------------------------------------------------------------------------" << "\n"; - Breakdown_file << "| Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) |" << "\n"; - Breakdown_file << "| |" << "\n"; - Breakdown_file << "| SU2 is free software; you can redistribute it and/or |" << "\n"; - Breakdown_file << "| modify it under the terms of the GNU Lesser General Public |" << "\n"; - Breakdown_file << "| License as published by the Free Software Foundation; either |" << "\n"; - Breakdown_file << "| version 2.1 of the License, or (at your option) any later version. |" << "\n"; - Breakdown_file << "| |" << "\n"; - Breakdown_file << "| SU2 is distributed in the hope that it will be useful, |" << "\n"; - Breakdown_file << "| but WITHOUT ANY WARRANTY; without even the implied warranty of |" << "\n"; - Breakdown_file << "| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |" << "\n"; - Breakdown_file << "| Lesser General Public License for more details. |" << "\n"; - Breakdown_file << "| |" << "\n"; - Breakdown_file << "| You should have received a copy of the GNU Lesser General Public |" << "\n"; - Breakdown_file << "| License along with SU2. If not, see . |" << "\n"; - Breakdown_file <<"-------------------------------------------------------------------------" << "\n"; - - Breakdown_file.precision(6); - - Breakdown_file << "\n" << "\n" << "Problem definition:" << "\n" << "\n"; - - switch (Kind_Solver) { - case MAIN_SOLVER::EULER: case MAIN_SOLVER::INC_EULER: - if (compressible) Breakdown_file << "Compressible Euler equations." << "\n"; - if (incompressible) Breakdown_file << "Incompressible Euler equations." << "\n"; - break; - case MAIN_SOLVER::NAVIER_STOKES: case MAIN_SOLVER::INC_NAVIER_STOKES: - if (compressible) Breakdown_file << "Compressible Laminar Navier-Stokes' equations." << "\n"; - if (incompressible) Breakdown_file << "Incompressible Laminar Navier-Stokes' equations." << "\n"; - break; - case MAIN_SOLVER::RANS: case MAIN_SOLVER::INC_RANS: - if (compressible) Breakdown_file << "Compressible RANS equations." << "\n"; - if (incompressible) Breakdown_file << "Incompressible RANS equations." << "\n"; - Breakdown_file << "Turbulence model: "; - switch (Kind_Turb_Model) { - case TURB_MODEL::SA: Breakdown_file << "Spalart Allmaras" << "\n"; break; - case TURB_MODEL::SST: Breakdown_file << "Menter's SST" << "\n"; break; - default: break; - } - break; - default: - break; - } - - - /*--- Compressible version of console output ---*/ - - if (compressible) { - - - if ((compressible) && (Kind_Solver != MAIN_SOLVER::FEM_ELASTICITY)) { - Breakdown_file << "Mach number: " << config[val_iZone]->GetMach() <<"."<< "\n"; - Breakdown_file << "Angle of attack (AoA): " << config[val_iZone]->GetAoA() <<" deg, and angle of sideslip (AoS): " << config[val_iZone]->GetAoS() <<" deg."<< "\n"; - if ((Kind_Solver == MAIN_SOLVER::NAVIER_STOKES) || (Kind_Solver == MAIN_SOLVER::ADJ_NAVIER_STOKES) || - (Kind_Solver == MAIN_SOLVER::RANS) || (Kind_Solver == MAIN_SOLVER::ADJ_RANS)) - Breakdown_file << "Reynolds number: " << config[val_iZone]->GetReynolds() <<"."<< "\n"; - } - - if (fixed_cl) { - Breakdown_file << "Simulation at a cte. CL: " << config[val_iZone]->GetTarget_CL() << ".\n"; - Breakdown_file << "Approx. Delta CL / Delta AoA: " << config[val_iZone]->GetdCL_dAlpha() << " (1/deg).\n"; - Breakdown_file << "Approx. Delta CD / Delta CL: " << config[val_iZone]->GetdCD_dCL() << ".\n"; - if (nDim == 3 ) { - Breakdown_file << "Approx. Delta CMx / Delta CL: " << config[val_iZone]->GetdCMx_dCL() << ".\n"; - Breakdown_file << "Approx. Delta CMy / Delta CL: " << config[val_iZone]->GetdCMy_dCL() << ".\n"; - } - Breakdown_file << "Approx. Delta CMz / Delta CL: " << config[val_iZone]->GetdCMz_dCL() << ".\n"; - } - - if (Ref_NonDim == DIMENSIONAL) { Breakdown_file << "Dimensional simulation." << "\n"; } - else if (Ref_NonDim == FREESTREAM_PRESS_EQ_ONE) { Breakdown_file << "Non-Dimensional simulation (P=1.0, Rho=1.0, T=1.0 at the farfield)." << "\n"; } - else if (Ref_NonDim == FREESTREAM_VEL_EQ_MACH) { Breakdown_file << "Non-Dimensional simulation (V=Mach, Rho=1.0, T=1.0 at the farfield)." << "\n"; } - else if (Ref_NonDim == FREESTREAM_VEL_EQ_ONE) { Breakdown_file << "Non-Dimensional simulation (V=1.0, Rho=1.0, T=1.0 at the farfield)." << "\n"; } - - if (config[val_iZone]->GetSystemMeasurements() == SI) { - Breakdown_file << "The reference area is " << config[val_iZone]->GetRefArea() << " m^2." << "\n"; - Breakdown_file << "The reference length is " << config[val_iZone]->GetRefLength() << " m." << "\n"; - } - - if (config[val_iZone]->GetSystemMeasurements() == US) { - Breakdown_file << "The reference area is " << config[val_iZone]->GetRefArea()*12.0*12.0 << " in^2." << "\n"; - Breakdown_file << "The reference length is " << config[val_iZone]->GetRefLength()*12.0 << " in." << "\n"; - } - Breakdown_file << "\n" << "\n" <<"Problem definition:" << "\n" << "\n"; - if (compressible) { - if (viscous) { - Breakdown_file << "Viscous flow: Computing pressure using the ideal gas law" << "\n"; - Breakdown_file << "based on the free-stream temperature and a density computed" << "\n"; - Breakdown_file << "from the Reynolds number." << "\n"; - } else { - Breakdown_file << "Inviscid flow: Computing density based on free-stream" << "\n"; - Breakdown_file << "temperature and pressure using the ideal gas law." << "\n"; - } - } - - if (dynamic_grid) Breakdown_file << "Force coefficients computed using MACH_MOTION." << "\n"; - else Breakdown_file << "Force coefficients computed using free-stream values." << "\n"; - - if (incompressible) { - Breakdown_file << "Viscous and Inviscid flow: rho_ref, and vel_ref" << "\n"; - Breakdown_file << "are based on the free-stream values, p_ref = rho_ref*vel_ref^2." << "\n"; - Breakdown_file << "The free-stream value of the pressure is 0." << "\n"; - Breakdown_file << "Mach number: "<< config[val_iZone]->GetMach() << ", computed using the Bulk modulus." << "\n"; - Breakdown_file << "Angle of attack (deg): "<< config[val_iZone]->GetAoA() << ", computed using the the free-stream velocity." << "\n"; - Breakdown_file << "Side slip angle (deg): "<< config[val_iZone]->GetAoS() << ", computed using the the free-stream velocity." << "\n"; - if (viscous) Breakdown_file << "Reynolds number: " << config[val_iZone]->GetReynolds() << ", computed using free-stream values."<< "\n"; - Breakdown_file << "Only dimensional computation, the grid should be dimensional." << "\n"; - } - - Breakdown_file <<"-- Input conditions:"<< "\n"; - - if (compressible) { - switch (config[val_iZone]->GetKind_FluidModel()) { - - case STANDARD_AIR: - Breakdown_file << "Fluid Model: STANDARD_AIR "<< "\n"; - Breakdown_file << "Specific gas constant: " << config[val_iZone]->GetGas_Constant(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " N.m/kg.K." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " lbf.ft/slug.R." << "\n"; - Breakdown_file << "Specific gas constant (non-dim): " << config[val_iZone]->GetGas_ConstantND()<< "\n"; - Breakdown_file << "Specific Heat Ratio: 1.4000 "<< "\n"; - break; - - case IDEAL_GAS: - Breakdown_file << "Fluid Model: IDEAL_GAS "<< "\n"; - Breakdown_file << "Specific gas constant: " << config[val_iZone]->GetGas_Constant() << " N.m/kg.K." << "\n"; - Breakdown_file << "Specific gas constant (non-dim): " << config[val_iZone]->GetGas_ConstantND()<< "\n"; - Breakdown_file << "Specific Heat Ratio: "<< config[val_iZone]->GetGamma() << "\n"; - break; - - case VW_GAS: - Breakdown_file << "Fluid Model: Van der Waals "<< "\n"; - Breakdown_file << "Specific gas constant: " << config[val_iZone]->GetGas_Constant() << " N.m/kg.K." << "\n"; - Breakdown_file << "Specific gas constant (non-dim): " << config[val_iZone]->GetGas_ConstantND()<< "\n"; - Breakdown_file << "Specific Heat Ratio: "<< config[val_iZone]->GetGamma() << "\n"; - Breakdown_file << "Critical Pressure: " << config[val_iZone]->GetPressure_Critical() << " Pa." << "\n"; - Breakdown_file << "Critical Temperature: " << config[val_iZone]->GetTemperature_Critical() << " K." << "\n"; - Breakdown_file << "Critical Pressure (non-dim): " << config[val_iZone]->GetPressure_Critical() /config[val_iZone]->GetPressure_Ref() << "\n"; - Breakdown_file << "Critical Temperature (non-dim) : " << config[val_iZone]->GetTemperature_Critical() /config[val_iZone]->GetTemperature_Ref() << "\n"; - break; - - case PR_GAS: - Breakdown_file << "Fluid Model: Peng-Robinson "<< "\n"; - Breakdown_file << "Specific gas constant: " << config[val_iZone]->GetGas_Constant() << " N.m/kg.K." << "\n"; - Breakdown_file << "Specific gas constant(non-dim): " << config[val_iZone]->GetGas_ConstantND()<< "\n"; - Breakdown_file << "Specific Heat Ratio: "<< config[val_iZone]->GetGamma() << "\n"; - Breakdown_file << "Critical Pressure: " << config[val_iZone]->GetPressure_Critical() << " Pa." << "\n"; - Breakdown_file << "Critical Temperature: " << config[val_iZone]->GetTemperature_Critical() << " K." << "\n"; - Breakdown_file << "Critical Pressure (non-dim): " << config[val_iZone]->GetPressure_Critical() /config[val_iZone]->GetPressure_Ref() << "\n"; - Breakdown_file << "Critical Temperature (non-dim) : " << config[val_iZone]->GetTemperature_Critical() /config[val_iZone]->GetTemperature_Ref() << "\n"; - break; - case COOLPROP: { - CCoolProp auxFluidModel(config[val_iZone]->GetFluid_Name()); - Breakdown_file << "Fluid Model: CoolProp library \n"; - Breakdown_file << "Specific gas constant: " << auxFluidModel.GetGas_Constant()<< " N.m/kg.K.\n"; - Breakdown_file << "Specific gas constant(non-dim): " << config[val_iZone]->GetGas_ConstantND() << "\n"; - Breakdown_file << "Specific Heat Ratio: " << auxFluidModel.GetGamma() << "\n"; - Breakdown_file << "Critical Pressure: " << auxFluidModel.GetPressure_Critical() << " Pa.\n"; - Breakdown_file << "Critical Temperature: " << auxFluidModel.GetTemperature_Critical()<< " K.\n"; - Breakdown_file << "Critical Pressure (non-dim): " << auxFluidModel.GetPressure_Critical()/ config[val_iZone]->GetPressure_Ref()<< "\n"; - Breakdown_file << "Critical Temperature (non-dim) : " << auxFluidModel.GetTemperature_Critical() / config[val_iZone]->GetTemperature_Ref() << "\n"; - } break; - } - - if (viscous) { - - switch (config[val_iZone]->GetKind_ViscosityModel()) { - - case VISCOSITYMODEL::CONSTANT: - Breakdown_file << "Viscosity Model: CONSTANT_VISCOSITY "<< "\n"; - Breakdown_file << "Laminar Viscosity: " << config[val_iZone]->GetMu_Constant(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " N.s/m^2." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " lbf.s/ft^2." << "\n"; - Breakdown_file << "Laminar Viscosity (non-dim): " << config[val_iZone]->GetMu_ConstantND()<< "\n"; - break; - - case VISCOSITYMODEL::SUTHERLAND: - Breakdown_file << "Viscosity Model: SUTHERLAND "<< "\n"; - Breakdown_file << "Ref. Laminar Viscosity: " << config[val_iZone]->GetMu_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " N.s/m^2." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " lbf.s/ft^2." << "\n"; - Breakdown_file << "Ref. Temperature: " << config[val_iZone]->GetMu_Temperature_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " K." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " R." << "\n"; - Breakdown_file << "Sutherland Constant: "<< config[val_iZone]->GetMu_S(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " K." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " R." << "\n"; - Breakdown_file << "Laminar Viscosity (non-dim): " << config[val_iZone]->GetMu_ConstantND()<< "\n"; - Breakdown_file << "Ref. Temperature (non-dim): " << config[val_iZone]->GetMu_Temperature_RefND()<< "\n"; - Breakdown_file << "Sutherland constant (non-dim): "<< config[val_iZone]->GetMu_SND()<< "\n"; - break; - - case VISCOSITYMODEL::COOLPROP: - Breakdown_file << "Viscosity Model: CoolProp"<< "\n"; - break; - - default: - break; - - } - switch (config[val_iZone]->GetKind_ConductivityModel()) { - - case CONDUCTIVITYMODEL::CONSTANT_PRANDTL: - Breakdown_file << "Conductivity Model: CONSTANT_PRANDTL "<< "\n"; - Breakdown_file << "Prandtl: " << config[val_iZone]->GetPrandtl_Lam()<< "\n"; - break; - - case CONDUCTIVITYMODEL::CONSTANT: - Breakdown_file << "Conductivity Model: CONSTANT "<< "\n"; - Breakdown_file << "Molecular Conductivity: " << config[val_iZone]->GetThermal_Conductivity_Constant()<< " W/m^2.K." << "\n"; - Breakdown_file << "Molecular Conductivity (non-dim): " << config[val_iZone]->GetThermal_Conductivity_ConstantND()<< "\n"; - break; - - case CONDUCTIVITYMODEL::COOLPROP: - Breakdown_file << "Conductivity Model: COOLPROP "<< "\n"; - break; - - default: - break; - - } - - if ((Kind_Solver == MAIN_SOLVER::RANS) || (Kind_Solver == MAIN_SOLVER::ADJ_RANS) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS)) { - switch (config[val_iZone]->GetKind_ConductivityModel_Turb()) { - case CONDUCTIVITYMODEL_TURB::CONSTANT_PRANDTL: - Breakdown_file << "Turbulent Conductivity Model: CONSTANT_PRANDTL "<< "\n"; - Breakdown_file << "Turbulent Prandtl: " << config[val_iZone]->GetPrandtl_Turb()<< "\n"; - break; - case CONDUCTIVITYMODEL_TURB::NONE: - Breakdown_file << "Turbulent Conductivity Model: NONE "<< "\n"; - Breakdown_file << "No turbulent component in effective thermal conductivity." << "\n"; - break; - } - } - - } - } - - if (incompressible) { - Breakdown_file << "Bulk modulus: " << config[val_iZone]->GetBulk_Modulus(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " psf." << "\n"; - Breakdown_file << "Epsilon^2 multiplier of Beta for incompressible preconditioner: " << config[val_iZone]->GetBeta_Factor(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " psf." << "\n"; - } - - Breakdown_file << "Free-stream static pressure: " << config[val_iZone]->GetPressure_FreeStream(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " psf." << "\n"; - - Breakdown_file << "Free-stream total pressure: " << config[val_iZone]->GetPressure_FreeStream() * pow( 1.0+config[val_iZone]->GetMach()*config[val_iZone]->GetMach()*0.5*(config[val_iZone]->GetGamma()-1.0), config[val_iZone]->GetGamma()/(config[val_iZone]->GetGamma()-1.0) ); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " psf." << "\n"; - - if (compressible) { - Breakdown_file << "Free-stream temperature: " << config[val_iZone]->GetTemperature_FreeStream(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " K." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " R." << "\n"; - - Breakdown_file << "Free-stream total temperature: " << config[val_iZone]->GetTemperature_FreeStream() * (1.0 + config[val_iZone]->GetMach() * config[val_iZone]->GetMach() * 0.5 * (config[val_iZone]->GetGamma() - 1.0)); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " K." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " R." << "\n"; - } - - Breakdown_file << "Free-stream density: " << config[val_iZone]->GetDensity_FreeStream(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " kg/m^3." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " slug/ft^3." << "\n"; - - if (nDim == 2) { - Breakdown_file << "Free-stream velocity: (" << config[val_iZone]->GetVelocity_FreeStream()[0] << ", "; - Breakdown_file << config[val_iZone]->GetVelocity_FreeStream()[1] << ")"; - } - if (nDim == 3) { - Breakdown_file << "Free-stream velocity: (" << config[val_iZone]->GetVelocity_FreeStream()[0] << ", "; - Breakdown_file << config[val_iZone]->GetVelocity_FreeStream()[1] << ", " << config[val_iZone]->GetVelocity_FreeStream()[2] << ")"; - } - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " m/s. "; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " ft/s. "; - - Breakdown_file << "Magnitude: " << config[val_iZone]->GetModVel_FreeStream(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " m/s." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " ft/s." << "\n"; - - if (compressible) { - Breakdown_file << "Free-stream total energy per unit mass: " << config[val_iZone]->GetEnergy_FreeStream(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " m^2/s^2." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " ft^2/s^2." << "\n"; - } - - if (viscous) { - Breakdown_file << "Free-stream viscosity: " << config[val_iZone]->GetViscosity_FreeStream(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " N.s/m^2." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " lbf.s/ft^2." << "\n"; - if (turbulent) { - Breakdown_file << "Free-stream turb. kinetic energy per unit mass: " << config[val_iZone]->GetTke_FreeStream(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " m^2/s^2." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " ft^2/s^2." << "\n"; - Breakdown_file << "Free-stream specific dissipation: " << config[val_iZone]->GetOmega_FreeStream(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " 1/s." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " 1/s." << "\n"; - } - } - - if (unsteady) { Breakdown_file << "Total time: " << config[val_iZone]->GetTotal_UnstTime() << " s. Time step: " << config[val_iZone]->GetDelta_UnstTime() << " s." << "\n"; } - - /*--- Print out reference values. ---*/ - - Breakdown_file <<"-- Reference values:"<< "\n"; - - if (compressible) { - Breakdown_file << "Reference specific gas constant: " << config[val_iZone]->GetGas_Constant_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " N.m/kg.K." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " lbf.ft/slug.R." << "\n"; - } - - Breakdown_file << "Reference pressure: " << config[val_iZone]->GetPressure_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " psf." << "\n"; - - if (compressible) { - Breakdown_file << "Reference temperature: " << config[val_iZone]->GetTemperature_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " K." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " R." << "\n"; - } - - Breakdown_file << "Reference density: " << config[val_iZone]->GetDensity_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " kg/m^3." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " slug/ft^3." << "\n"; - - Breakdown_file << "Reference velocity: " << config[val_iZone]->GetVelocity_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " m/s." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " ft/s." << "\n"; - - if (compressible) { - Breakdown_file << "Reference energy per unit mass: " << config[val_iZone]->GetEnergy_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " m^2/s^2." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " ft^2/s^2." << "\n"; - } - - if (incompressible) { - Breakdown_file << "Reference length: " << config[val_iZone]->GetLength_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " m." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " in." << "\n"; - } - - if (viscous) { - Breakdown_file << "Reference viscosity: " << config[val_iZone]->GetViscosity_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " N.s/m^2." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " lbf.s/ft^2." << "\n"; - if (compressible){ - Breakdown_file << "Reference conductivity: " << config[val_iZone]->GetThermal_Conductivity_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " W/m^2.K." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " lbf/ft.s.R." << "\n"; - } - } - - - if (unsteady) Breakdown_file << "Reference time: " << config[val_iZone]->GetTime_Ref() <<" s." << "\n"; - - /*--- Print out resulting non-dim values here. ---*/ - - Breakdown_file << "-- Resulting non-dimensional state:" << "\n"; - Breakdown_file << "Mach number (non-dim): " << config[val_iZone]->GetMach() << "\n"; - if (viscous) { - Breakdown_file << "Reynolds number (non-dim): " << config[val_iZone]->GetReynolds() <<". Re length: " << config[val_iZone]->GetLength_Reynolds(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " m." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " ft." << "\n"; - } - if (gravity) { - Breakdown_file << "Froude number (non-dim): " << config[val_iZone]->GetFroude() << "\n"; - Breakdown_file << "Lenght of the baseline wave (non-dim): " << 2.0*PI_NUMBER*config[val_iZone]->GetFroude()*config[val_iZone]->GetFroude() << "\n"; - } - - if (compressible) { - Breakdown_file << "Specific gas constant (non-dim): " << config[val_iZone]->GetGas_ConstantND() << "\n"; - Breakdown_file << "Free-stream temperature (non-dim): " << config[val_iZone]->GetTemperature_FreeStreamND() << "\n"; - } - - Breakdown_file << "Free-stream pressure (non-dim): " << config[val_iZone]->GetPressure_FreeStreamND() << "\n"; - - Breakdown_file << "Free-stream density (non-dim): " << config[val_iZone]->GetDensity_FreeStreamND() << "\n"; - - if (nDim == 2) { - Breakdown_file << "Free-stream velocity (non-dim): (" << config[val_iZone]->GetVelocity_FreeStreamND()[0] << ", "; - Breakdown_file << config[val_iZone]->GetVelocity_FreeStreamND()[1] << "). "; - } else { - Breakdown_file << "Free-stream velocity (non-dim): (" << config[val_iZone]->GetVelocity_FreeStreamND()[0] << ", "; - Breakdown_file << config[val_iZone]->GetVelocity_FreeStreamND()[1] << ", " << config[val_iZone]->GetVelocity_FreeStreamND()[2] << "). "; - } - Breakdown_file << "Magnitude: " << config[val_iZone]->GetModVel_FreeStreamND() << "\n"; - - if (compressible) - Breakdown_file << "Free-stream total energy per unit mass (non-dim): " << config[val_iZone]->GetEnergy_FreeStreamND() << "\n"; - - if (viscous) { - Breakdown_file << "Free-stream viscosity (non-dim): " << config[val_iZone]->GetViscosity_FreeStreamND() << "\n"; - if (turbulent) { - Breakdown_file << "Free-stream turb. kinetic energy (non-dim): " << config[val_iZone]->GetTke_FreeStreamND() << "\n"; - Breakdown_file << "Free-stream specific dissipation (non-dim): " << config[val_iZone]->GetOmega_FreeStreamND() << "\n"; - } - } - - if (unsteady) { - Breakdown_file << "Total time (non-dim): " << config[val_iZone]->GetTotal_UnstTimeND() << "\n"; - Breakdown_file << "Time step (non-dim): " << config[val_iZone]->GetDelta_UnstTimeND() << "\n"; - } - - } else { - - /*--- Incompressible version of the console output ---*/ - - bool energy = config[val_iZone]->GetEnergy_Equation(); - bool boussinesq = (config[val_iZone]->GetKind_DensityModel() == INC_DENSITYMODEL::BOUSSINESQ); - - if (config[val_iZone]->GetRef_Inc_NonDim() == DIMENSIONAL) { - Breakdown_file << "Viscous and Inviscid flow: rho_ref, vel_ref, temp_ref, p_ref" << "\n"; - Breakdown_file << "are set to 1.0 in order to perform a dimensional calculation." << "\n"; - if (dynamic_grid) Breakdown_file << "Force coefficients computed using MACH_MOTION." << "\n"; - else Breakdown_file << "Force coefficients computed using initial values." << "\n"; - } - else if (config[val_iZone]->GetRef_Inc_NonDim() == INITIAL_VALUES) { - Breakdown_file << "Viscous and Inviscid flow: rho_ref, vel_ref, and temp_ref" << "\n"; - Breakdown_file << "are based on the initial values, p_ref = rho_ref*vel_ref^2." << "\n"; - if (dynamic_grid) Breakdown_file << "Force coefficients computed using MACH_MOTION." << "\n"; - else Breakdown_file << "Force coefficients computed using initial values." << "\n"; - } - else if (config[val_iZone]->GetRef_Inc_NonDim() == REFERENCE_VALUES) { - Breakdown_file << "Viscous and Inviscid flow: rho_ref, vel_ref, and temp_ref" << "\n"; - Breakdown_file << "are user-provided reference values, p_ref = rho_ref*vel_ref^2." << "\n"; - if (dynamic_grid) Breakdown_file << "Force coefficients computed using MACH_MOTION." << "\n"; - else Breakdown_file << "Force coefficients computed using reference values." << "\n"; - } - Breakdown_file << "The reference area for force coeffs. is " << config[val_iZone]->GetRefArea() << " m^2." << "\n"; - Breakdown_file << "The reference length for force coeffs. is " << config[val_iZone]->GetRefLength() << " m." << "\n"; - - Breakdown_file << "The pressure is decomposed into thermodynamic and dynamic components." << "\n"; - Breakdown_file << "The initial value of the dynamic pressure is 0." << "\n"; - - Breakdown_file << "Mach number: "<< config[val_iZone]->GetMach(); - if (config[val_iZone]->GetKind_FluidModel() == CONSTANT_DENSITY) { - Breakdown_file << ", computed using the Bulk modulus." << "\n"; - } else { - Breakdown_file << ", computed using fluid speed of sound." << "\n"; - } - - Breakdown_file << "For external flows, the initial state is imposed at the far-field." << "\n"; - Breakdown_file << "Angle of attack (deg): "<< config[val_iZone]->GetAoA() << ", computed using the initial velocity." << "\n"; - Breakdown_file << "Side slip angle (deg): "<< config[val_iZone]->GetAoS() << ", computed using the initial velocity." << "\n"; - - if (viscous) { - Breakdown_file << "Reynolds number per meter: " << config[val_iZone]->GetReynolds() << ", computed using initial values."<< "\n"; - Breakdown_file << "Reynolds number is a byproduct of inputs only (not used internally)." << "\n"; - } - Breakdown_file << "SI units only. The grid should be dimensional (meters)." << "\n"; - - switch (config[val_iZone]->GetKind_DensityModel()) { - - case INC_DENSITYMODEL::CONSTANT: - if (energy) Breakdown_file << "Energy equation is active and decoupled." << "\n"; - else Breakdown_file << "No energy equation." << "\n"; - break; - - case INC_DENSITYMODEL::BOUSSINESQ: - if (energy) Breakdown_file << "Energy equation is active and coupled through Boussinesq approx." << "\n"; - break; - - case INC_DENSITYMODEL::VARIABLE: - if (energy) Breakdown_file << "Energy equation is active and coupled for variable density." << "\n"; - break; - - } - - Breakdown_file <<"-- Input conditions:"<< "\n"; - - switch (config[val_iZone]->GetKind_FluidModel()) { - - case CONSTANT_DENSITY: - Breakdown_file << "Fluid Model: CONSTANT_DENSITY "<< "\n"; - if (energy) { - Breakdown_file << "Specific heat at constant pressure (Cp): " << config[val_iZone]->GetSpecific_Heat_Cp() << " N.m/kg.K." << "\n"; - } - if (boussinesq) Breakdown_file << "Thermal expansion coefficient: " << config[val_iZone]->GetThermal_Expansion_Coeff() << " K^-1." << "\n"; - Breakdown_file << "Thermodynamic pressure not required." << "\n"; - break; - - case INC_IDEAL_GAS: - Breakdown_file << "Fluid Model: INC_IDEAL_GAS "<< endl; - Breakdown_file << "Variable density incompressible flow using ideal gas law." << endl; - Breakdown_file << "Density is a function of temperature (constant thermodynamic pressure)." << endl; - Breakdown_file << "Specific heat at constant pressure (Cp): " << config[val_iZone]->GetSpecific_Heat_Cp() << " N.m/kg.K." << endl; - Breakdown_file << "Molecular weight : "<< config[val_iZone]->GetMolecular_Weight() << " g/mol" << endl; - Breakdown_file << "Specific gas constant: " << config[val_iZone]->GetGas_Constant() << " N.m/kg.K." << endl; - Breakdown_file << "Thermodynamic pressure: " << config[val_iZone]->GetPressure_Thermodynamic(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << endl; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " psf." << endl; - break; - - case INC_IDEAL_GAS_POLY: - Breakdown_file << "Fluid Model: INC_IDEAL_GAS_POLY "<< endl; - Breakdown_file << "Variable density incompressible flow using ideal gas law." << endl; - Breakdown_file << "Density is a function of temperature (constant thermodynamic pressure)." << endl; - Breakdown_file << "Molecular weight: " << config[val_iZone]->GetMolecular_Weight() << " g/mol." << endl; - Breakdown_file << "Specific gas constant: " << config[val_iZone]->GetGas_Constant() << " N.m/kg.K." << endl; - Breakdown_file << "Specific gas constant (non-dim): " << config[val_iZone]->GetGas_ConstantND() << endl; - Breakdown_file << "Thermodynamic pressure: " << config[val_iZone]->GetPressure_Thermodynamic(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << endl; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " psf." << endl; - Breakdown_file << "Cp(T) polynomial coefficients: \n ("; - for (unsigned short iVar = 0; iVar < config[val_iZone]->GetnPolyCoeffs(); iVar++) { - Breakdown_file << config[val_iZone]->GetCp_PolyCoeff(iVar); - if (iVar < config[val_iZone]->GetnPolyCoeffs()-1) Breakdown_file << ", "; - } - Breakdown_file << ")." << endl; - Breakdown_file << "Cp(T) polynomial coefficients (non-dim.): \n ("; - for (unsigned short iVar = 0; iVar < config[val_iZone]->GetnPolyCoeffs(); iVar++) { - Breakdown_file << config[val_iZone]->GetCp_PolyCoeffND(iVar); - if (iVar < config[val_iZone]->GetnPolyCoeffs()-1) Breakdown_file << ", "; - } - Breakdown_file << ")." << endl; - break; - - } - if (viscous) { - switch (config[val_iZone]->GetKind_ViscosityModel()) { - - case VISCOSITYMODEL::CONSTANT: - Breakdown_file << "Viscosity Model: CONSTANT_VISCOSITY "<< "\n"; - Breakdown_file << "Constant Laminar Viscosity: " << config[val_iZone]->GetMu_Constant(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " N.s/m^2." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " lbf.s/ft^2." << "\n"; - Breakdown_file << "Laminar Viscosity (non-dim): " << config[val_iZone]->GetMu_ConstantND()<< "\n"; - break; - - case VISCOSITYMODEL::SUTHERLAND: - Breakdown_file << "Viscosity Model: SUTHERLAND "<< "\n"; - Breakdown_file << "Ref. Laminar Viscosity: " << config[val_iZone]->GetMu_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " N.s/m^2." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " lbf.s/ft^2." << "\n"; - Breakdown_file << "Ref. Temperature: " << config[val_iZone]->GetMu_Temperature_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " K." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " R." << "\n"; - Breakdown_file << "Sutherland Constant: "<< config[val_iZone]->GetMu_S(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " K." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " R." << "\n"; - Breakdown_file << "Laminar Viscosity (non-dim): " << config[val_iZone]->GetMu_ConstantND()<< "\n"; - Breakdown_file << "Ref. Temperature (non-dim): " << config[val_iZone]->GetMu_Temperature_RefND()<< "\n"; - Breakdown_file << "Sutherland constant (non-dim): "<< config[val_iZone]->GetMu_SND()<< "\n"; - break; - - case VISCOSITYMODEL::POLYNOMIAL: - Breakdown_file << "Viscosity Model: POLYNOMIAL_VISCOSITY "<< endl; - Breakdown_file << "Mu(T) polynomial coefficients: \n ("; - for (unsigned short iVar = 0; iVar < config[val_iZone]->GetnPolyCoeffs(); iVar++) { - Breakdown_file << config[val_iZone]->GetMu_PolyCoeff(iVar); - if (iVar < config[val_iZone]->GetnPolyCoeffs()-1) Breakdown_file << ", "; - } - Breakdown_file << ")." << endl; - Breakdown_file << "Mu(T) polynomial coefficients (non-dim.): \n ("; - for (unsigned short iVar = 0; iVar < config[val_iZone]->GetnPolyCoeffs(); iVar++) { - Breakdown_file << config[val_iZone]->GetMu_PolyCoeffND(iVar); - if (iVar < config[val_iZone]->GetnPolyCoeffs()-1) Breakdown_file << ", "; - } - Breakdown_file << ")." << endl; - break; - - case VISCOSITYMODEL::COOLPROP: - Breakdown_file << "Viscosity Model: CoolProp"<< "\n"; - break; - - } - - if (energy) { - switch (config[val_iZone]->GetKind_ConductivityModel()) { - - case CONDUCTIVITYMODEL::CONSTANT_PRANDTL: - Breakdown_file << "Conductivity Model: CONSTANT_PRANDTL "<< "\n"; - Breakdown_file << "Prandtl (Laminar): " << config[val_iZone]->GetPrandtl_Lam()<< "\n"; - break; - - case CONDUCTIVITYMODEL::CONSTANT: - Breakdown_file << "Conductivity Model: CONSTANT "<< "\n"; - Breakdown_file << "Molecular Conductivity: " << config[val_iZone]->GetThermal_Conductivity_Constant()<< " W/m^2.K." << "\n"; - Breakdown_file << "Molecular Conductivity (non-dim): " << config[val_iZone]->GetThermal_Conductivity_ConstantND()<< "\n"; - break; - - case CONDUCTIVITYMODEL::COOLPROP: - Breakdown_file << "Conductivity Model: COOLPROP "<< "\n"; - break; - - case CONDUCTIVITYMODEL::POLYNOMIAL: - Breakdown_file << "Viscosity Model: POLYNOMIAL "<< endl; - Breakdown_file << "Kt(T) polynomial coefficients: \n ("; - for (unsigned short iVar = 0; iVar < config[val_iZone]->GetnPolyCoeffs(); iVar++) { - Breakdown_file << config[val_iZone]->GetKt_PolyCoeff(iVar); - if (iVar < config[val_iZone]->GetnPolyCoeffs()-1) Breakdown_file << ", "; - } - Breakdown_file << ")." << endl; - Breakdown_file << "Kt(T) polynomial coefficients (non-dim.): \n ("; - for (unsigned short iVar = 0; iVar < config[val_iZone]->GetnPolyCoeffs(); iVar++) { - Breakdown_file << config[val_iZone]->GetKt_PolyCoeffND(iVar); - if (iVar < config[val_iZone]->GetnPolyCoeffs()-1) Breakdown_file << ", "; - } - Breakdown_file << ")." << endl; - break; - - } - - if ((Kind_Solver == MAIN_SOLVER::RANS) || (Kind_Solver == MAIN_SOLVER::ADJ_RANS) || (Kind_Solver == MAIN_SOLVER::DISC_ADJ_RANS)) { - switch (config[val_iZone]->GetKind_ConductivityModel_Turb()) { - case CONDUCTIVITYMODEL_TURB::CONSTANT_PRANDTL: - Breakdown_file << "Turbulent Conductivity Model: CONSTANT_PRANDTL "<< "\n"; - Breakdown_file << "Turbulent Prandtl: " << config[val_iZone]->GetPrandtl_Turb()<< "\n"; - break; - case CONDUCTIVITYMODEL_TURB::NONE: - Breakdown_file << "Turbulent Conductivity Model: NONE "<< "\n"; - Breakdown_file << "No turbulent component in effective thermal conductivity." << "\n"; - break; - } - } - - } - - } - - if (config[val_iZone]->GetKind_FluidModel() == CONSTANT_DENSITY) { - Breakdown_file << "Bulk modulus: " << config[val_iZone]->GetBulk_Modulus(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " psf." << "\n"; - } - - Breakdown_file << "Initial dynamic pressure: " << config[val_iZone]->GetPressure_FreeStream(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " psf." << "\n"; - - Breakdown_file << "Initial total pressure: " << config[val_iZone]->GetPressure_FreeStream() + 0.5*config[val_iZone]->GetDensity_FreeStream()*config[val_iZone]->GetModVel_FreeStream()*config[val_iZone]->GetModVel_FreeStream(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " psf." << "\n"; - - if (energy) { - Breakdown_file << "Initial temperature: " << config[val_iZone]->GetTemperature_FreeStream(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " K." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " R." << "\n"; - } - - Breakdown_file << "Initial density: " << config[val_iZone]->GetDensity_FreeStream(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " kg/m^3." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " slug/ft^3." << "\n"; - - if (nDim == 2) { - Breakdown_file << "Initial velocity: (" << config[val_iZone]->GetVelocity_FreeStream()[0] << ", "; - Breakdown_file << config[val_iZone]->GetVelocity_FreeStream()[1] << ")"; - } - if (nDim == 3) { - Breakdown_file << "Initial velocity: (" << config[val_iZone]->GetVelocity_FreeStream()[0] << ", "; - Breakdown_file << config[val_iZone]->GetVelocity_FreeStream()[1] << ", " << config[val_iZone]->GetVelocity_FreeStream()[2] << ")"; - } - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " m/s. "; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " ft/s. "; - - Breakdown_file << "Magnitude: " << config[val_iZone]->GetModVel_FreeStream(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " m/s." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " ft/s." << "\n"; - - if (viscous) { - Breakdown_file << "Initial laminar viscosity: " << config[val_iZone]->GetViscosity_FreeStream(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " N.s/m^2." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " lbf.s/ft^2." << "\n"; - if (turbulent) { - Breakdown_file << "Initial turb. kinetic energy per unit mass: " << config[val_iZone]->GetTke_FreeStream(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " m^2/s^2." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " ft^2/s^2." << "\n"; - Breakdown_file << "Initial specific dissipation: " << config[val_iZone]->GetOmega_FreeStream(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " 1/s." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " 1/s." << "\n"; - } - } - - if (unsteady) { Breakdown_file << "Total time: " << config[val_iZone]->GetTotal_UnstTime() << " s. Time step: " << config[val_iZone]->GetDelta_UnstTime() << " s." << "\n"; } - - /*--- Print out reference values. ---*/ - - Breakdown_file <<"-- Reference values:"<< "\n"; - - if (config[val_iZone]->GetKind_FluidModel() != CONSTANT_DENSITY) { - Breakdown_file << "Reference specific gas constant: " << config[val_iZone]->GetGas_Constant_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " N.m/kg.K." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " lbf.ft/slug.R." << "\n"; - } else { - if (energy) { - Breakdown_file << "Reference specific heat: " << config[val_iZone]->GetGas_Constant_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " N.m/kg.K." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " lbf.ft/slug.R." << "\n"; - } - } - - Breakdown_file << "Reference pressure: " << config[val_iZone]->GetPressure_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " Pa." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " psf." << "\n"; - - if (energy) { - Breakdown_file << "Reference temperature: " << config[val_iZone]->GetTemperature_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " K." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " R." << "\n"; - } - - Breakdown_file << "Reference density: " << config[val_iZone]->GetDensity_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " kg/m^3." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " slug/ft^3." << "\n"; - - Breakdown_file << "Reference velocity: " << config[val_iZone]->GetVelocity_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " m/s." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " ft/s." << "\n"; - - Breakdown_file << "Reference length: " << config[val_iZone]->GetLength_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " m." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " in." << "\n"; - - if (viscous) { - Breakdown_file << "Reference viscosity: " << config[val_iZone]->GetViscosity_Ref(); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " N.s/m^2." << "\n"; - else if (config[val_iZone]->GetSystemMeasurements() == US) Breakdown_file << " lbf.s/ft^2." << "\n"; - } - - if (unsteady) Breakdown_file << "Reference time: " << config[val_iZone]->GetTime_Ref() <<" s." << "\n"; - - /*--- Print out resulting non-dim values here. ---*/ - - Breakdown_file << "-- Resulting non-dimensional state:" << "\n"; - Breakdown_file << "Mach number (non-dim): " << config[val_iZone]->GetMach() << "\n"; - if (viscous) { - Breakdown_file << "Reynolds number (per m): " << config[val_iZone]->GetReynolds() << "\n"; - } - - if (config[val_iZone]->GetKind_FluidModel() != CONSTANT_DENSITY) { - Breakdown_file << "Specific gas constant (non-dim): " << config[val_iZone]->GetGas_ConstantND() << "\n"; - Breakdown_file << "Initial thermodynamic pressure (non-dim): " << config[val_iZone]->GetPressure_ThermodynamicND() << "\n"; - } else { - if (energy) { - Breakdown_file << "Specific heat at constant pressure (non-dim): " << config[val_iZone]->GetSpecific_Heat_CpND() << "\n"; - if (boussinesq) Breakdown_file << "Thermal expansion coefficient (non-dim.): " << config[val_iZone]->GetThermal_Expansion_CoeffND() << " K^-1." << "\n"; - } - } - - if (energy) Breakdown_file << "Initial temperature (non-dim): " << config[val_iZone]->GetTemperature_FreeStreamND() << "\n"; - Breakdown_file << "Initial pressure (non-dim): " << config[val_iZone]->GetPressure_FreeStreamND() << "\n"; - Breakdown_file << "Initial density (non-dim): " << config[val_iZone]->GetDensity_FreeStreamND() << "\n"; - - if (nDim == 2) { - Breakdown_file << "Initial velocity (non-dim): (" << config[val_iZone]->GetVelocity_FreeStreamND()[0] << ", "; - Breakdown_file << config[val_iZone]->GetVelocity_FreeStreamND()[1] << "). "; - } else { - Breakdown_file << "Initial velocity (non-dim): (" << config[val_iZone]->GetVelocity_FreeStreamND()[0] << ", "; - Breakdown_file << config[val_iZone]->GetVelocity_FreeStreamND()[1] << ", " << config[val_iZone]->GetVelocity_FreeStreamND()[2] << "). "; - } - Breakdown_file << "Magnitude: " << config[val_iZone]->GetModVel_FreeStreamND() << "\n"; - - if (viscous) { - Breakdown_file << "Initial viscosity (non-dim): " << config[val_iZone]->GetViscosity_FreeStreamND() << "\n"; - if (turbulent) { - Breakdown_file << "Initial turb. kinetic energy (non-dim): " << config[val_iZone]->GetTke_FreeStreamND() << "\n"; - Breakdown_file << "Initial specific dissipation (non-dim): " << config[val_iZone]->GetOmega_FreeStreamND() << "\n"; - } - } - - if (unsteady) { - Breakdown_file << "Total time (non-dim): " << config[val_iZone]->GetTotal_UnstTimeND() << "\n"; - Breakdown_file << "Time step (non-dim): " << config[val_iZone]->GetDelta_UnstTimeND() << "\n"; - } - - } - - /*--- Begin forces breakdown info. ---*/ - - Breakdown_file << fixed; - Breakdown_file << "\n" << "\n" <<"Forces breakdown:" << "\n" << "\n"; - - if (nDim == 3) { - su2double m = solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CFz()/solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CFx(); - su2double term = (Total_CoPz/m)-Total_CoPx; - - if (term > 0) Breakdown_file << "Center of Pressure: X=" << 1/m <<"Z-"<< term << "." << "\n\n"; - else Breakdown_file << "Center of Pressure: X=" << 1/m <<"Z+"<< fabs(term); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " m." << "\n\n"; - else Breakdown_file << " in." << "\n\n"; - } - else { - su2double m = solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CFy()/solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CFx(); - su2double term = (Total_CoPy/m)-Total_CoPx; - if (term > 0) Breakdown_file << "Center of Pressure: X=" << 1/m <<"Y-"<< term << "." << "\n\n"; - else Breakdown_file << "Center of Pressure: X=" << 1/m <<"Y+"<< fabs(term); - if (config[val_iZone]->GetSystemMeasurements() == SI) Breakdown_file << " m." << "\n\n"; - else Breakdown_file << " in." << "\n\n"; - } - - /*--- Reference area and force factors. ---*/ - - su2double RefDensity, RefArea, RefVel, Factor, Ref; - RefArea = config[val_iZone]->GetRefArea(); - if (compressible) { - RefDensity = solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetDensity_Inf(); - RefVel = solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetModVelocity_Inf(); - } else { - if ((config[val_iZone]->GetRef_Inc_NonDim() == DIMENSIONAL) || - (config[val_iZone]->GetRef_Inc_NonDim() == INITIAL_VALUES)) { - RefDensity = solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetDensity_Inf(); - RefVel = 0.0; - for (iDim = 0; iDim < nDim; iDim++) - RefVel += solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetVelocity_Inf(iDim)*solver[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetVelocity_Inf(iDim); - RefVel = sqrt(RefVel); - } else { - RefDensity = config[val_iZone]->GetInc_Density_Ref(); - RefVel = config[val_iZone]->GetInc_Velocity_Ref(); - } - } - Factor = (0.5*RefDensity*RefArea*RefVel*RefVel); - Ref = config[val_iZone]->GetDensity_Ref() * config[val_iZone]->GetVelocity_Ref() * config[val_iZone]->GetVelocity_Ref() * 1.0 * 1.0; - - Breakdown_file << "NOTE: Multiply forces by the non-dimensional factor: " << Factor << ", and the reference factor: " << Ref << "\n"; - Breakdown_file << "to obtain the dimensional force." << "\n" << "\n"; - - Breakdown_file << "Total CL: "; - Breakdown_file.width(11); - Breakdown_file << Total_CL; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Inv_CL * 100.0) / (Total_CL + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Inv_CL; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Visc_CL * 100.0) / (Total_CL + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Visc_CL; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Mnt_CL * 100.0) / (Total_CL + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Mnt_CL << "\n"; - - Breakdown_file << "Total CD: "; - Breakdown_file.width(11); - Breakdown_file << Total_CD; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Inv_CD * 100.0) / (Total_CD + EPS)) << "%): "; - Breakdown_file.width(11); - Breakdown_file << Inv_CD; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Visc_CD * 100.0) / (Total_CD + EPS)) << "%): "; - Breakdown_file.width(11); - Breakdown_file << Visc_CD; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Mnt_CD * 100.0) / (Total_CD + EPS)) << "%): "; - Breakdown_file.width(11); - Breakdown_file << Mnt_CD << "\n"; - - if (nDim == 3) { - Breakdown_file << "Total CSF: "; - Breakdown_file.width(11); - Breakdown_file << Total_CSF; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Inv_CSF * 100.0) / (Total_CSF + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Inv_CSF; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Visc_CSF * 100.0) / (Total_CSF + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Visc_CSF; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Mnt_CSF * 100.0) / (Total_CSF + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Mnt_CSF << "\n"; - } - - Breakdown_file << "Total CL/CD: "; - Breakdown_file.width(11); - Breakdown_file << Total_CEff; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Inv_CEff * 100.0) / (Total_CEff + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Inv_CEff; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Visc_CEff * 100.0) / (Total_CEff + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Visc_CEff; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Mnt_CEff * 100.0) / (Total_CEff + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Mnt_CEff << "\n"; - - if (nDim == 3) { - Breakdown_file << "Total CMx: "; - Breakdown_file.width(11); - Breakdown_file << Total_CMx; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Inv_CMx * 100.0) / (Total_CMx + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Inv_CMx; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Visc_CMx * 100.0) / (Total_CMx + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Visc_CMx; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Mnt_CMx * 100.0) / (Total_CMx + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Mnt_CMx << "\n"; - - Breakdown_file << "Total CMy: "; - Breakdown_file.width(11); - Breakdown_file << Total_CMy; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Inv_CMy * 100.0) / (Total_CMy + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Inv_CMy; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Visc_CMy * 100.0) / (Total_CMy + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Visc_CMy; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Mnt_CMz * 100.0) / (Total_CMz + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Mnt_CMy << "\n"; - } - - Breakdown_file << "Total CMz: "; - Breakdown_file.width(11); - Breakdown_file << Total_CMz; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Inv_CMz * 100.0) / (Total_CMz + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Inv_CMz; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Visc_CMz * 100.0) / (Total_CMz + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Visc_CMz; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Mnt_CMz * 100.0) / (Total_CMz + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Mnt_CMz << "\n"; - - Breakdown_file << "Total CFx: "; - Breakdown_file.width(11); - Breakdown_file << Total_CFx; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Inv_CFx * 100.0) / (Total_CFx + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Inv_CFx; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Visc_CFx * 100.0) / (Total_CFx + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Visc_CFx; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Mnt_CFx * 100.0) / (Total_CFx + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Mnt_CFx << "\n"; - - Breakdown_file << "Total CFy: "; - Breakdown_file.width(11); - Breakdown_file << Total_CFy; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Inv_CFy * 100.0) / (Total_CFy + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Inv_CFy; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Visc_CFy * 100.0) / (Total_CFy + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Visc_CFy; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Mnt_CFy * 100.0) / (Total_CFy + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Mnt_CFy << "\n"; - - if (nDim == 3) { - Breakdown_file << "Total CFz: "; - Breakdown_file.width(11); - Breakdown_file << Total_CFz; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Inv_CFz * 100.0) / (Total_CFz + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Inv_CFz; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Visc_CFz * 100.0) / (Total_CFz + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Visc_CFz; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file << SU2_TYPE::Int((Mnt_CFz * 100.0) / (Total_CFz + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Mnt_CFz << "\n"; - } - - Breakdown_file << "\n" << "\n"; - - for (iMarker_Monitoring = 0; - iMarker_Monitoring < config[val_iZone]->GetnMarker_Monitoring(); - iMarker_Monitoring++) { - - Breakdown_file << "Surface name: " - << config[val_iZone]->GetMarker_Monitoring_TagBound( - iMarker_Monitoring) << "\n" << "\n"; - - Breakdown_file << "Total CL ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CL[iMarker_Monitoring] * 100.0) - / (Total_CL + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CL[iMarker_Monitoring]; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CL_Inv[iMarker_Monitoring] * 100.0) - / (Surface_CL[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CL_Inv[iMarker_Monitoring]; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CL_Visc[iMarker_Monitoring] * 100.0) - / (Surface_CL[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CL_Visc[iMarker_Monitoring]; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CL_Mnt[iMarker_Monitoring] * 100.0) - / (Surface_CL[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CL_Mnt[iMarker_Monitoring] << "\n"; - - Breakdown_file << "Total CD ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CD[iMarker_Monitoring] * 100.0) - / (Total_CD + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CD[iMarker_Monitoring]; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CD_Inv[iMarker_Monitoring] * 100.0) - / (Surface_CD[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CD_Inv[iMarker_Monitoring]; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CD_Visc[iMarker_Monitoring] * 100.0) - / (Surface_CD[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CD_Visc[iMarker_Monitoring]; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CD_Mnt[iMarker_Monitoring] * 100.0) - / (Surface_CD[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CD_Mnt[iMarker_Monitoring] << "\n"; - - if (nDim == 3) { - Breakdown_file << "Total CSF ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CSF[iMarker_Monitoring] * 100.0) - / (Total_CSF + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CSF[iMarker_Monitoring]; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CSF_Inv[iMarker_Monitoring] * 100.0) - / (Surface_CSF[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CSF_Inv[iMarker_Monitoring]; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CSF_Visc[iMarker_Monitoring] * 100.0) - / (Surface_CSF[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file - << Surface_CSF_Visc[iMarker_Monitoring]; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CSF_Mnt[iMarker_Monitoring] * 100.0) - / (Surface_CSF[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file - << Surface_CSF_Mnt[iMarker_Monitoring] << "\n"; - } - - Breakdown_file << "Total CL/CD ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CEff[iMarker_Monitoring] * 100.0) / (Total_CEff + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CEff[iMarker_Monitoring]; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CEff_Inv[iMarker_Monitoring] * 100.0) - / (Surface_CEff[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CEff_Inv[iMarker_Monitoring]; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CEff_Visc[iMarker_Monitoring] * 100.0) - / (Surface_CEff[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file - << Surface_CEff_Visc[iMarker_Monitoring]; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CEff_Mnt[iMarker_Monitoring] * 100.0) - / (Surface_CEff[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file - << Surface_CEff_Mnt[iMarker_Monitoring] << "\n"; - - if (nDim == 3) { - - Breakdown_file << "Total CMx ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CMx[iMarker_Monitoring] * 100.0) / (Total_CMx + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CMx[iMarker_Monitoring]; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CMx_Inv[iMarker_Monitoring] * 100.0) - / (Surface_CMx[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CMx_Inv[iMarker_Monitoring]; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CMx_Visc[iMarker_Monitoring] * 100.0) - / (Surface_CMx[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file - << Surface_CMx_Visc[iMarker_Monitoring]; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CMx_Mnt[iMarker_Monitoring] * 100.0) - / (Surface_CMx[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file - << Surface_CMx_Mnt[iMarker_Monitoring] << "\n"; - - Breakdown_file << "Total CMy ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CMy[iMarker_Monitoring] * 100.0) / (Total_CMy + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CMy[iMarker_Monitoring]; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CMy_Inv[iMarker_Monitoring] * 100.0) - / (Surface_CMy[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CMy_Inv[iMarker_Monitoring]; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CMy_Visc[iMarker_Monitoring] * 100.0) - / (Surface_CMy[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file - << Surface_CMy_Visc[iMarker_Monitoring]; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CMy_Mnt[iMarker_Monitoring] * 100.0) - / (Surface_CMy[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file - << Surface_CMy_Mnt[iMarker_Monitoring] << "\n"; - } - - Breakdown_file << "Total CMz ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int((Surface_CMz[iMarker_Monitoring] * 100.0) / (Total_CMz + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CMz[iMarker_Monitoring]; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CMz_Inv[iMarker_Monitoring] * 100.0) - / (Surface_CMz[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CMz_Inv[iMarker_Monitoring]; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CMz_Visc[iMarker_Monitoring] * 100.0) - / (Surface_CMz[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file - << Surface_CMz_Visc[iMarker_Monitoring]; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CMz_Mnt[iMarker_Monitoring] * 100.0) - / (Surface_CMz[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file - << Surface_CMz_Mnt[iMarker_Monitoring] << "\n"; - - Breakdown_file << "Total CFx ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int((Surface_CFx[iMarker_Monitoring] * 100.0) / (Total_CFx + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CFx[iMarker_Monitoring]; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CFx_Inv[iMarker_Monitoring] * 100.0) - / (Surface_CFx[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CFx_Inv[iMarker_Monitoring]; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CFx_Visc[iMarker_Monitoring] * 100.0) - / (Surface_CFx[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file - << Surface_CFx_Visc[iMarker_Monitoring]; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CFx_Mnt[iMarker_Monitoring] * 100.0) - / (Surface_CFx[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file - << Surface_CFx_Mnt[iMarker_Monitoring] << "\n"; - - Breakdown_file << "Total CFy ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int((Surface_CFy[iMarker_Monitoring] * 100.0) / (Total_CFy + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CFy[iMarker_Monitoring]; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CFy_Inv[iMarker_Monitoring] * 100.0) - / (Surface_CFy[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CFy_Inv[iMarker_Monitoring]; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CFy_Visc[iMarker_Monitoring] * 100.0) - / (Surface_CFy[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file - << Surface_CFy_Visc[iMarker_Monitoring]; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CFy_Mnt[iMarker_Monitoring] * 100.0) - / (Surface_CFy[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file - << Surface_CFy_Mnt[iMarker_Monitoring] << "\n"; - - if (nDim == 3) { - Breakdown_file << "Total CFz ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CFz[iMarker_Monitoring] * 100.0) / (Total_CFz + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CFz[iMarker_Monitoring]; - Breakdown_file << " | Pressure ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CFz_Inv[iMarker_Monitoring] * 100.0) - / (Surface_CFz[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file << Surface_CFz_Inv[iMarker_Monitoring]; - Breakdown_file << " | Friction ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CFz_Visc[iMarker_Monitoring] * 100.0) - / (Surface_CFz[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file - << Surface_CFz_Visc[iMarker_Monitoring]; - Breakdown_file << " | Momentum ("; - Breakdown_file.width(5); - Breakdown_file - << SU2_TYPE::Int( - (Surface_CFz_Mnt[iMarker_Monitoring] * 100.0) - / (Surface_CFz[iMarker_Monitoring] + EPS)); - Breakdown_file << "%): "; - Breakdown_file.width(11); - Breakdown_file - << Surface_CFz_Mnt[iMarker_Monitoring] << "\n"; - - } - - Breakdown_file << "\n"; - - - } - - delete [] Surface_CL; - delete [] Surface_CD; - delete [] Surface_CSF; - delete [] Surface_CEff; - delete [] Surface_CFx; - delete [] Surface_CFy; - delete [] Surface_CFz; - delete [] Surface_CMx; - delete [] Surface_CMy; - delete [] Surface_CMz; - - delete [] Surface_CL_Inv; - delete [] Surface_CD_Inv; - delete [] Surface_CSF_Inv; - delete [] Surface_CEff_Inv; - delete [] Surface_CFx_Inv; - delete [] Surface_CFy_Inv; - delete [] Surface_CFz_Inv; - delete [] Surface_CMx_Inv; - delete [] Surface_CMy_Inv; - delete [] Surface_CMz_Inv; - - delete [] Surface_CL_Visc; - delete [] Surface_CD_Visc; - delete [] Surface_CSF_Visc; - delete [] Surface_CEff_Visc; - delete [] Surface_CFx_Visc; - delete [] Surface_CFy_Visc; - delete [] Surface_CFz_Visc; - delete [] Surface_CMx_Visc; - delete [] Surface_CMy_Visc; - delete [] Surface_CMz_Visc; - - delete [] Surface_CL_Mnt; - delete [] Surface_CD_Mnt; - delete [] Surface_CSF_Mnt; - delete [] Surface_CEff_Mnt; - delete [] Surface_CFx_Mnt; - delete [] Surface_CFy_Mnt; - delete [] Surface_CFz_Mnt; - delete [] Surface_CMx_Mnt; - delete [] Surface_CMy_Mnt; - delete [] Surface_CMz_Mnt; - - Breakdown_file.close(); - - } - -} - -void COutputLegacy::SpecialOutput_SpanLoad(CSolver *solver, CGeometry *geometry, CConfig *config, bool output) const { - - short iSection, nSection; - unsigned long iVertex, iPoint, Trailing_Point; - su2double *Plane_P0, *Plane_P0_, *Plane_Normal, *Plane_Normal_, *CPressure, - Force[3], ForceInviscid[3], MomentInviscid[3] = - { 0.0, 0.0, 0.0 }, MomentDist[3] = { 0.0, 0.0, 0.0 }, RefDensity, - RefPressure, RefArea, *Velocity_Inf, Gas_Constant, Mach2Vel, - Mach_Motion, Gamma, RefVel2 = 0.0, factor, NDPressure, - RefLength, Alpha, CL_Inv, - Xcoord_LeadingEdge = 0.0, Ycoord_LeadingEdge = 0.0, Zcoord_LeadingEdge = 0.0, - Xcoord_TrailingEdge = 0.0, Ycoord_TrailingEdge = 0.0, Zcoord_TrailingEdge = 0.0, - Xcoord_LeadingEdge_ = 0.0, - Xcoord_TrailingEdge_ = 0.0, Ycoord_TrailingEdge_ = 0.0, Zcoord_TrailingEdge_ = 0.0, - MaxDistance, Distance, Chord, Aux, Dihedral_Trailing; - - su2double B, Y, C_L, C_L0, Elliptic_Spanload; - - vector Xcoord_Airfoil, Ycoord_Airfoil, Zcoord_Airfoil, - CPressure_Airfoil; - vector Xcoord_Airfoil_, Ycoord_Airfoil_, Zcoord_Airfoil_, - CPressure_Airfoil_; - string Marker_Tag, Slice_Filename, Slice_Ext; - ofstream Cp_File; - unsigned short iDim; - - bool dynamic_grid = config->GetDynamic_Grid(); - - Plane_P0 = new su2double[3]; - Plane_P0_ = new su2double[3]; - Plane_Normal = new su2double[3]; - Plane_Normal_ = new su2double[3]; - CPressure = new su2double[geometry->GetnPoint()]; - - if ((rank == MASTER_NODE) && (output)) { - cout << endl << "Writing the spanload file (load_distribution.dat)."; - } - - /*--- Compute some reference quantities and necessary values ---*/ - - RefDensity = solver->GetDensity_Inf(); - RefPressure = solver->GetPressure_Inf(); - RefArea = config->GetRefArea(); - Velocity_Inf = solver->GetVelocity_Inf(); - Gamma = config->GetGamma(); - const auto Origin = config->GetRefOriginMoment(0); - RefLength = config->GetRefLength(); - Alpha = config->GetAoA() * PI_NUMBER / 180.0; - - if (dynamic_grid) { - Gas_Constant = config->GetGas_ConstantND(); - Mach2Vel = sqrt( - Gamma * Gas_Constant * config->GetTemperature_FreeStreamND()); - Mach_Motion = config->GetMach_Motion(); - RefVel2 = (Mach_Motion * Mach2Vel) * (Mach_Motion * Mach2Vel); - } else { - RefVel2 = 0.0; - for (iDim = 0; iDim < geometry->GetnDim(); iDim++) - RefVel2 += Velocity_Inf[iDim] * Velocity_Inf[iDim]; - } - factor = 1.0 / (0.5 * RefDensity * RefArea * RefVel2); - - if (geometry->GetnDim() == 3) { - - /*--- Copy the pressure to an auxiliar structure ---*/ - - for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) { - CPressure[iPoint] = (solver->GetNodes()->GetPressure(iPoint) - - RefPressure) * factor * RefArea; - } - - nSection = config->GetnLocationStations(); - - for (iSection = 0; iSection < nSection; iSection++) { - - /*--- Read the values from the config file ---*/ - - Plane_Normal[0] = 0.0; Plane_P0[0] = 0.0; - Plane_Normal[1] = 0.0; Plane_P0[1] = 0.0; - Plane_Normal[2] = 0.0; Plane_P0[2] = 0.0; - - if (config->GetGeo_Description() == FUSELAGE) { - Plane_Normal[0] = 1.0; - Plane_P0[0] = config->GetLocationStations(iSection); - } - else if (config->GetGeo_Description() == NACELLE) { - Plane_Normal[0] = 0.0; - Plane_Normal[1] = -sin(config->GetLocationStations(iSection)*PI_NUMBER/180.0); - Plane_Normal[2] = cos(config->GetLocationStations(iSection)*PI_NUMBER/180.0); - - /*--- Apply tilt angle to the plane ---*/ - - su2double Tilt_Angle = config->GetNacelleLocation(3)*PI_NUMBER/180; - su2double Plane_NormalX_Tilt = Plane_Normal[0]*cos(Tilt_Angle) + Plane_Normal[2]*sin(Tilt_Angle); - su2double Plane_NormalY_Tilt = Plane_Normal[1]; - su2double Plane_NormalZ_Tilt = Plane_Normal[2]*cos(Tilt_Angle) - Plane_Normal[0]*sin(Tilt_Angle); - - /*--- Apply toe angle to the plane ---*/ - - su2double Toe_Angle = config->GetNacelleLocation(4)*PI_NUMBER/180; - su2double Plane_NormalX_Tilt_Toe = Plane_NormalX_Tilt*cos(Toe_Angle) - Plane_NormalY_Tilt*sin(Toe_Angle); - su2double Plane_NormalY_Tilt_Toe = Plane_NormalX_Tilt*sin(Toe_Angle) + Plane_NormalY_Tilt*cos(Toe_Angle); - su2double Plane_NormalZ_Tilt_Toe = Plane_NormalZ_Tilt; - - /*--- Update normal vector ---*/ - - Plane_Normal[0] = Plane_NormalX_Tilt_Toe; - Plane_Normal[1] = Plane_NormalY_Tilt_Toe; - Plane_Normal[2] = Plane_NormalZ_Tilt_Toe; - - } - else { - Plane_Normal[1] = 1.0; - Plane_P0[1] = config->GetLocationStations(iSection); - } - - /*--- Compute the airfoil sections (note that we feed in the Cp) ---*/ - - geometry->ComputeAirfoil_Section(Plane_P0, Plane_Normal, -1E6, 1E6, -1E6, 1E6, -1E6, 1E6, - CPressure, Xcoord_Airfoil, Ycoord_Airfoil, Zcoord_Airfoil, - CPressure_Airfoil, true, config); - - if ((rank == MASTER_NODE) && (Xcoord_Airfoil.size() == 0)) { - if ((config->GetGeo_Description() == FUSELAGE) || (config->GetGeo_Description() == WING)) - cout << endl << "Please check the config file, the section (" << Plane_P0[0] <<", " << Plane_P0[1] <<", " << Plane_P0[2] << ") has not been detected." << endl; - if (config->GetGeo_Description() == NACELLE) - cout << endl << "Please check the config file, the section (" << Plane_Normal[0] <<", " << Plane_Normal[1] <<", " << Plane_Normal[2] << ") has not been detected." << endl; - } - - - /*--- Compute dihedral using a step in the station value ---*/ - - Plane_P0_[0] = 0.0; Plane_Normal_[0] = 0.0; - Plane_P0_[1] = 0.0; Plane_Normal_[1] = 0.0; - Plane_P0_[2] = 0.0; Plane_Normal_[2] = 0.0; - - if (config->GetGeo_Description() == FUSELAGE) { - Plane_Normal_[0] = 1.0; - if (iSection == 0) Plane_P0_[0] = config->GetLocationStations(iSection) + 0.01; - else Plane_P0_[0] = config->GetLocationStations(iSection) - 0.01; - } - else if (config->GetGeo_Description() == NACELLE) { - if (iSection == 0) { - Plane_Normal_[0] = 0.0; - Plane_Normal_[1] = -sin((config->GetLocationStations(iSection) + 0.01)*PI_NUMBER/180.0); - Plane_Normal_[2] = cos((config->GetLocationStations(iSection) + 0.01)*PI_NUMBER/180.0); - - /*--- Apply tilt angle to the plane ---*/ - - su2double Tilt_Angle = config->GetNacelleLocation(3)*PI_NUMBER/180; - su2double Plane_NormalX_Tilt = Plane_Normal[0]*cos(Tilt_Angle) + Plane_Normal[2]*sin(Tilt_Angle); - su2double Plane_NormalY_Tilt = Plane_Normal[1]; - su2double Plane_NormalZ_Tilt = Plane_Normal[2]*cos(Tilt_Angle) - Plane_Normal[0]*sin(Tilt_Angle); - - /*--- Apply toe angle to the plane ---*/ - - su2double Toe_Angle = config->GetNacelleLocation(4)*PI_NUMBER/180; - su2double Plane_NormalX_Tilt_Toe = Plane_NormalX_Tilt*cos(Toe_Angle) - Plane_NormalY_Tilt*sin(Toe_Angle); - su2double Plane_NormalY_Tilt_Toe = Plane_NormalX_Tilt*sin(Toe_Angle) + Plane_NormalY_Tilt*cos(Toe_Angle); - su2double Plane_NormalZ_Tilt_Toe = Plane_NormalZ_Tilt; - - /*--- Update normal vector ---*/ - - Plane_Normal[0] = Plane_NormalX_Tilt_Toe; - Plane_Normal[1] = Plane_NormalY_Tilt_Toe; - Plane_Normal[2] = Plane_NormalZ_Tilt_Toe; - - } - else { - Plane_Normal_[0] = 0.0; - Plane_Normal_[1] = -sin((config->GetLocationStations(iSection) - 0.01)*PI_NUMBER/180.0); - Plane_Normal_[2] = cos((config->GetLocationStations(iSection) - 0.01)*PI_NUMBER/180.0); - - /*--- Apply tilt angle to the plane ---*/ - - su2double Tilt_Angle = config->GetNacelleLocation(3)*PI_NUMBER/180; - su2double Plane_NormalX_Tilt = Plane_Normal[0]*cos(Tilt_Angle) + Plane_Normal[2]*sin(Tilt_Angle); - su2double Plane_NormalY_Tilt = Plane_Normal[1]; - su2double Plane_NormalZ_Tilt = Plane_Normal[2]*cos(Tilt_Angle) - Plane_Normal[0]*sin(Tilt_Angle); - - /*--- Apply toe angle to the plane ---*/ - - su2double Toe_Angle = config->GetNacelleLocation(4)*PI_NUMBER/180; - su2double Plane_NormalX_Tilt_Toe = Plane_NormalX_Tilt*cos(Toe_Angle) - Plane_NormalY_Tilt*sin(Toe_Angle); - su2double Plane_NormalY_Tilt_Toe = Plane_NormalX_Tilt*sin(Toe_Angle) + Plane_NormalY_Tilt*cos(Toe_Angle); - su2double Plane_NormalZ_Tilt_Toe = Plane_NormalZ_Tilt; - - /*--- Update normal vector ---*/ - - Plane_Normal[0] = Plane_NormalX_Tilt_Toe; - Plane_Normal[1] = Plane_NormalY_Tilt_Toe; - Plane_Normal[2] = Plane_NormalZ_Tilt_Toe; - - } - } - else { - Plane_Normal_[1] = 1.0; - if (iSection == 0) Plane_P0_[1] = config->GetLocationStations(iSection) + 0.01; - else Plane_P0_[1] = config->GetLocationStations(iSection) - 0.01; - } - - geometry->ComputeAirfoil_Section(Plane_P0_, Plane_Normal_, -1E6, 1E6, -1E6, 1E6, -1E6, 1E6, - CPressure, Xcoord_Airfoil_, Ycoord_Airfoil_, Zcoord_Airfoil_, - CPressure_Airfoil_, true, config); - - /*--- Output the pressure on each section (tecplot format) ---*/ - - if ((rank == MASTER_NODE) && (Xcoord_Airfoil.size() != 0)) { - - /*--- Find leading and trailing edge ---*/ - - Xcoord_LeadingEdge = 1E6; Xcoord_TrailingEdge = -1E6; - for (iVertex = 0; iVertex < Xcoord_Airfoil.size(); iVertex++) { - if (Xcoord_Airfoil[iVertex] < Xcoord_LeadingEdge) { - Xcoord_LeadingEdge = Xcoord_Airfoil[iVertex]; - Ycoord_LeadingEdge = Ycoord_Airfoil[iVertex]; - Zcoord_LeadingEdge = Zcoord_Airfoil[iVertex]; - } - if (Xcoord_Airfoil[iVertex] > Xcoord_TrailingEdge) { - Xcoord_TrailingEdge = Xcoord_Airfoil[iVertex]; - Ycoord_TrailingEdge = Ycoord_Airfoil[iVertex]; - Zcoord_TrailingEdge = Zcoord_Airfoil[iVertex]; - } - } - - Chord = (Xcoord_TrailingEdge-Xcoord_LeadingEdge); - - /*--- Compute dihedral ---*/ - - Xcoord_LeadingEdge_ = 1E6; Xcoord_TrailingEdge_ = -1E6; - for (iVertex = 0; iVertex < Xcoord_Airfoil_.size(); iVertex++) { - if (Xcoord_Airfoil_[iVertex] < Xcoord_LeadingEdge_) { - Xcoord_LeadingEdge_ = Xcoord_Airfoil_[iVertex]; - } - if (Xcoord_Airfoil_[iVertex] > Xcoord_TrailingEdge_) { - Xcoord_TrailingEdge_ = Xcoord_Airfoil_[iVertex]; - Ycoord_TrailingEdge_ = Ycoord_Airfoil_[iVertex]; - Zcoord_TrailingEdge_ = Zcoord_Airfoil_[iVertex]; - } - } - - if (iSection == 0) { - Dihedral_Trailing = atan((Zcoord_TrailingEdge_ - Zcoord_TrailingEdge) / (Ycoord_TrailingEdge_ - Ycoord_TrailingEdge))*180/PI_NUMBER; - } - else { - Dihedral_Trailing = atan((Zcoord_TrailingEdge - Zcoord_TrailingEdge_) / (Ycoord_TrailingEdge - Ycoord_TrailingEdge_))*180/PI_NUMBER; - } - - /*--- Write Cp at each section (tecplot format) ---*/ - - if (output) { - - ofstream Cp_File; - - if (iSection == 0) { - Cp_File.open("cp_sections.dat", ios::out); - Cp_File << "TITLE = \"Airfoil sections\"" << endl; - Cp_File << "VARIABLES = \"x/c\",\"Cp\",\"x\",\"y\",\"z\",\"y/c\",\"z/c\"" << endl; - } else - Cp_File.open("cp_sections.dat", ios::app); - - if (config->GetGeo_Description() == NACELLE) { - su2double theta_deg = atan2(Plane_Normal[1], -Plane_Normal[2])/PI_NUMBER*180 + 180; - Cp_File << "ZONE T=\"Theta = " << theta_deg << " deg\", I= " << Xcoord_Airfoil.size() << ", F=POINT" << "\n"; - } - else { - if (config->GetSystemMeasurements() == SI) Cp_File << "ZONE T=\"y = " << Plane_P0[1] << " m\", I= " - << Xcoord_Airfoil.size() << ", F=POINT" << "\n"; - - if (config->GetSystemMeasurements() == US) Cp_File << "ZONE T=\"y = " << Plane_P0[1]*12.0 << " in\", I= " - << Xcoord_Airfoil.size() << ", F=POINT" << "\n"; - } - - - - /*--- Coordinates and pressure value ---*/ - - for (iVertex = 0; iVertex < Xcoord_Airfoil.size(); iVertex++) { - - su2double XCoord = Xcoord_Airfoil[iVertex]; - su2double YCoord = Ycoord_Airfoil[iVertex]; - su2double ZCoord = Zcoord_Airfoil[iVertex]; - - /*--- Undo the transformation based on the Theta angle ---*/ - - if (config->GetGeo_Description() == NACELLE) { - su2double theta_deg = atan2(Plane_Normal[1],-Plane_Normal[2])/PI_NUMBER*180 + 180; - su2double Angle = theta_deg*PI_NUMBER/180 - 0.5*PI_NUMBER; - - XCoord = Xcoord_Airfoil[iVertex] + config->GetNacelleLocation(0); - YCoord = (Ycoord_Airfoil[iVertex]*cos(Angle) - Zcoord_Airfoil[iVertex]*sin(Angle)) + config->GetNacelleLocation(1); - ZCoord = (Zcoord_Airfoil[iVertex]*cos(Angle) + Ycoord_Airfoil[iVertex]*sin(Angle)) + config->GetNacelleLocation(2); - - } - - if (config->GetSystemMeasurements() == US) { - Cp_File << (Xcoord_Airfoil[iVertex] - Xcoord_LeadingEdge) / Chord << " " << CPressure_Airfoil[iVertex] - << " " << XCoord * 12.0 << " " << YCoord * 12.0 << " " << ZCoord * 12.0 - << " " << (Ycoord_Airfoil[iVertex] - Ycoord_LeadingEdge) / Chord << " " << (Zcoord_Airfoil[iVertex] - Zcoord_LeadingEdge) / Chord << "\n"; - } - else { - Cp_File << (Xcoord_Airfoil[iVertex] - Xcoord_LeadingEdge) / Chord << " " << CPressure_Airfoil[iVertex] - << " " << XCoord << " " << YCoord << " " << ZCoord - << " " << (Ycoord_Airfoil[iVertex] - Ycoord_LeadingEdge) / Chord << " " << (Zcoord_Airfoil[iVertex] - Zcoord_LeadingEdge) / Chord << "\n"; - } - - } - - Cp_File.close(); - - } - - /*--- Compute load distribution ---*/ - - ForceInviscid[0] = 0.0; ForceInviscid[1] = 0.0; ForceInviscid[2] = 0.0; MomentInviscid[1] = 0.0; - - for (iVertex = 0; iVertex < Xcoord_Airfoil.size() - 1; iVertex++) { - - NDPressure = 0.5 * (CPressure_Airfoil[iVertex] + CPressure_Airfoil[iVertex + 1]); - - Force[0] = -(Zcoord_Airfoil[iVertex + 1] - Zcoord_Airfoil[iVertex]) * NDPressure; - Force[1] = 0.0; - Force[2] = (Xcoord_Airfoil[iVertex + 1] - Xcoord_Airfoil[iVertex]) * NDPressure; - - ForceInviscid[0] += Force[0]; - ForceInviscid[1] += Force[1]; - ForceInviscid[2] += Force[2]; - - MomentDist[0] = 0.5 * (Xcoord_Airfoil[iVertex] + Xcoord_Airfoil[iVertex + 1]) - Origin[0]; - MomentDist[1] = 0.5 * (Ycoord_Airfoil[iVertex] + Ycoord_Airfoil[iVertex + 1]) - Origin[1]; - MomentDist[2] = 0.5 * (Zcoord_Airfoil[iVertex] + Zcoord_Airfoil[iVertex + 1]) - Origin[3]; - - MomentInviscid[1] += (Force[0] * MomentDist[2] - Force[2] * MomentDist[0]) / RefLength; - - } - - /*--- Compute local chord, for the nondimensionalization ---*/ - - MaxDistance = 0.0; Trailing_Point = 0; - - for (iVertex = 1; iVertex < Xcoord_Airfoil.size(); iVertex++) { - - Distance = sqrt(pow(Xcoord_Airfoil[iVertex] - Xcoord_Airfoil[Trailing_Point], 2.0) + - pow(Ycoord_Airfoil[iVertex] - Ycoord_Airfoil[Trailing_Point], 2.0) + - pow(Zcoord_Airfoil[iVertex] - Zcoord_Airfoil[Trailing_Point], 2.0)); - - if (MaxDistance < Distance) { MaxDistance = Distance; } - - } - - Chord = MaxDistance; - - CL_Inv = cos(Dihedral_Trailing * PI_NUMBER / 180.0) * fabs( -ForceInviscid[0] * sin(Alpha) + ForceInviscid[2] * cos(Alpha) )/ Chord; - - /*--- Compute sectional lift at the root ---*/ - - B = 2.0*config->GetSemiSpan(); - RefArea = config->GetRefArea(); - C_L = solver->GetTotal_CL(); - C_L0 = 8.0*C_L*RefArea/(B*PI_NUMBER); - Y = Ycoord_Airfoil[0]; - Aux = Y/(0.5*B); - Elliptic_Spanload = (C_L0 / RefLength) * sqrt(fabs(1.0-Aux*Aux)); - - - /*--- Write load distribution ---*/ - - if (output) { - - ofstream Load_File; - if (iSection == 0) { - - if ((config->GetTabular_FileFormat() == TAB_OUTPUT::TAB_CSV)) { - Load_File.open("load_distribution.csv", ios::out); - Load_File << "\"Percent Semispan\",\"Sectional C_L\",\"Spanload (c C_L / c_ref) \",\"Elliptic Spanload\"" << endl; - } - else { - Load_File.open("load_distribution.dat", ios::out); - Load_File << "TITLE = \"Load distribution\"" << endl; - Load_File << "VARIABLES = \"Percent Semispan\",\"Sectional CL\",\"Spanload (c CL / cref) \",\"Elliptic Spanload\"" << endl; - Load_File << "ZONE T=\"Wing load distribution\"" << endl; - } - } else { - if ((config->GetTabular_FileFormat() == TAB_OUTPUT::TAB_CSV)) Load_File.open("load_distribution.csv", ios::app); - else Load_File.open("load_distribution.dat", ios::app); - } - - - /*--- CL and spanload ---*/ - - if ((config->GetTabular_FileFormat() == TAB_OUTPUT::TAB_CSV)) - Load_File << 100.0*Ycoord_Airfoil[0]/(0.5*B) << ", " << CL_Inv << ", " << Chord*CL_Inv / RefLength <<", " << Elliptic_Spanload << endl; - else - Load_File << 100.0*Ycoord_Airfoil[0]/(0.5*B) << " " << CL_Inv << " " << Chord*CL_Inv / RefLength <<" " << Elliptic_Spanload << endl; - - Load_File.close(); - - } - - } - - } - - } - - /*--- Delete dynamically allocated memory ---*/ - - delete[] Plane_P0; - delete[] Plane_P0_; - delete[] Plane_Normal; - delete[] Plane_Normal_; - delete[] CPressure; - -} - - -void COutputLegacy::SetCp_InverseDesign(CSolver *solver_container, CGeometry *geometry, CConfig *config, unsigned long iExtIter) { - - unsigned short iMarker, icommas, Boundary, iDim; - unsigned long iVertex, iPoint, (*Point2Vertex)[2], nPointLocal = 0, nPointGlobal = 0; - su2double XCoord, YCoord, ZCoord, Pressure, PressureCoeff = 0, Cp, CpTarget, *Normal = nullptr, Area, PressDiff; - bool *PointInDomain; - string text_line, surfCp_filename; - ifstream Surface_file; - char buffer[50], cstr[200]; - - - nPointLocal = geometry->GetnPoint(); -#ifdef HAVE_MPI - SU2_MPI::Allreduce(&nPointLocal, &nPointGlobal, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); -#else - nPointGlobal = nPointLocal; -#endif - - Point2Vertex = new unsigned long[nPointGlobal][2]; - PointInDomain = new bool[nPointGlobal]; - - for (iPoint = 0; iPoint < nPointGlobal; iPoint ++) - PointInDomain[iPoint] = false; - - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - Boundary = config->GetMarker_All_KindBC(iMarker); - - if ((Boundary == EULER_WALL ) || - (Boundary == HEAT_FLUX ) || - (Boundary == ISOTHERMAL ) || - (Boundary == NEARFIELD_BOUNDARY)) { - for (iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { - - /*--- The Pressure file uses the global numbering ---*/ - -#ifndef HAVE_MPI - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); -#else - iPoint = geometry->nodes->GetGlobalIndex(geometry->vertex[iMarker][iVertex]->GetNode()); -#endif - - if (geometry->vertex[iMarker][iVertex]->GetNode() < geometry->GetnPointDomain()) { - Point2Vertex[iPoint][0] = iMarker; - Point2Vertex[iPoint][1] = iVertex; - PointInDomain[iPoint] = true; - solver_container->SetCPressureTarget(iMarker, iVertex, 0.0); - } - - } - } - } - - /*--- Prepare to read the surface pressure files (CSV) ---*/ - - surfCp_filename = "TargetCp"; - strcpy (cstr, surfCp_filename.c_str()); - - /*--- Write file name with extension if unsteady or steady ---*/ - - if (((config->GetTime_Marching() != TIME_MARCHING::STEADY) && config->GetTime_Domain()) || - (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE)) { - if ((SU2_TYPE::Int(iExtIter) >= 0) && (SU2_TYPE::Int(iExtIter) < 10)) SPRINTF (buffer, "_0000%d.dat", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.dat", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.dat", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 1000) && (SU2_TYPE::Int(iExtIter) < 10000)) SPRINTF (buffer, "_0%d.dat", SU2_TYPE::Int(iExtIter)); - if (SU2_TYPE::Int(iExtIter) >= 10000) SPRINTF (buffer, "_%d.dat", SU2_TYPE::Int(iExtIter)); - } - else - SPRINTF (buffer, ".dat"); - - strcat (cstr, buffer); - - /*--- Read the surface pressure file ---*/ - - string::size_type position; - - Surface_file.open(cstr, ios::in); - - if (!(Surface_file.fail())) { - - getline(Surface_file, text_line); - - while (getline(Surface_file, text_line)) { - for (icommas = 0; icommas < 50; icommas++) { - position = text_line.find( ",", 0 ); - if (position!=string::npos) text_line.erase (position,1); - } - stringstream point_line(text_line); - - if (geometry->GetnDim() == 2) point_line >> iPoint >> XCoord >> YCoord >> Pressure >> PressureCoeff; - if (geometry->GetnDim() == 3) point_line >> iPoint >> XCoord >> YCoord >> ZCoord >> Pressure >> PressureCoeff; - - if (PointInDomain[iPoint]) { - - /*--- Find the vertex for the Point and Marker ---*/ - - iMarker = Point2Vertex[iPoint][0]; - iVertex = Point2Vertex[iPoint][1]; - - solver_container->SetCPressureTarget(iMarker, iVertex, PressureCoeff); - - } - - } - - Surface_file.close(); - - } - - /*--- Compute the pressure difference ---*/ - - PressDiff = 0.0; - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - Boundary = config->GetMarker_All_KindBC(iMarker); - - if ((Boundary == EULER_WALL ) || - (Boundary == HEAT_FLUX ) || - (Boundary == ISOTHERMAL ) || - (Boundary == NEARFIELD_BOUNDARY)) { - for (iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { - - Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); - - Cp = solver_container->GetCPressure(iMarker, iVertex); - CpTarget = solver_container->GetCPressureTarget(iMarker, iVertex); - - Area = 0.0; - for (iDim = 0; iDim < geometry->GetnDim(); iDim++) - Area += Normal[iDim]*Normal[iDim]; - Area = sqrt(Area); - - PressDiff += Area * (CpTarget - Cp) * (CpTarget - Cp); - } - - } - } - -#ifdef HAVE_MPI - su2double MyPressDiff = PressDiff; PressDiff = 0.0; - SU2_MPI::Allreduce(&MyPressDiff, &PressDiff, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); -#endif - - /*--- Update the total Cp difference coeffient ---*/ - - solver_container->SetTotal_CpDiff(PressDiff); - - delete [] Point2Vertex; - delete [] PointInDomain; - -} - -void COutputLegacy::SetHeatFlux_InverseDesign(CSolver *solver_container, CGeometry *geometry, CConfig *config, unsigned long iExtIter) { - - unsigned short iMarker, icommas, Boundary, iDim; - unsigned long iVertex, iPoint, (*Point2Vertex)[2], nPointLocal = 0, nPointGlobal = 0; - su2double XCoord, YCoord, ZCoord, PressureCoeff, HeatFlux = 0.0, HeatFluxDiff, HeatFluxTarget, *Normal = nullptr, Area, - Pressure, Cf; - bool *PointInDomain; - string text_line, surfHeatFlux_filename; - ifstream Surface_file; - char buffer[50], cstr[200]; - - - nPointLocal = geometry->GetnPoint(); -#ifdef HAVE_MPI - SU2_MPI::Allreduce(&nPointLocal, &nPointGlobal, 1, MPI_UNSIGNED_LONG, MPI_SUM, SU2_MPI::GetComm()); -#else - nPointGlobal = nPointLocal; -#endif - - Point2Vertex = new unsigned long[nPointGlobal][2]; - PointInDomain = new bool[nPointGlobal]; - - for (iPoint = 0; iPoint < nPointGlobal; iPoint ++) - PointInDomain[iPoint] = false; - - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - Boundary = config->GetMarker_All_KindBC(iMarker); - - if ((Boundary == EULER_WALL ) || - (Boundary == HEAT_FLUX ) || - (Boundary == ISOTHERMAL ) || - (Boundary == NEARFIELD_BOUNDARY)) { - for (iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { - - /*--- The Pressure file uses the global numbering ---*/ - -#ifndef HAVE_MPI - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); -#else - iPoint = geometry->nodes->GetGlobalIndex(geometry->vertex[iMarker][iVertex]->GetNode()); -#endif - - if (geometry->vertex[iMarker][iVertex]->GetNode() < geometry->GetnPointDomain()) { - Point2Vertex[iPoint][0] = iMarker; - Point2Vertex[iPoint][1] = iVertex; - PointInDomain[iPoint] = true; - solver_container->SetHeatFluxTarget(iMarker, iVertex, 0.0); - } - } - } - } - - /*--- Prepare to read the surface pressure files (CSV) ---*/ - - surfHeatFlux_filename = "TargetHeatFlux"; - strcpy (cstr, surfHeatFlux_filename.c_str()); - - /*--- Write file name with extension if unsteady or steady ---*/ - - if (((config->GetTime_Marching() != TIME_MARCHING::STEADY) && config->GetTime_Domain()) || - (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE)) { - if ((SU2_TYPE::Int(iExtIter) >= 0) && (SU2_TYPE::Int(iExtIter) < 10)) SPRINTF (buffer, "_0000%d.dat", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 10) && (SU2_TYPE::Int(iExtIter) < 100)) SPRINTF (buffer, "_000%d.dat", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 100) && (SU2_TYPE::Int(iExtIter) < 1000)) SPRINTF (buffer, "_00%d.dat", SU2_TYPE::Int(iExtIter)); - if ((SU2_TYPE::Int(iExtIter) >= 1000) && (SU2_TYPE::Int(iExtIter) < 10000)) SPRINTF (buffer, "_0%d.dat", SU2_TYPE::Int(iExtIter)); - if (SU2_TYPE::Int(iExtIter) >= 10000) SPRINTF (buffer, "_%d.dat", SU2_TYPE::Int(iExtIter)); - } - else - SPRINTF (buffer, ".dat"); - - strcat (cstr, buffer); - - /*--- Read the surface pressure file ---*/ - - string::size_type position; - - Surface_file.open(cstr, ios::in); - - if (!(Surface_file.fail())) { - - getline(Surface_file, text_line); - - while (getline(Surface_file, text_line)) { - for (icommas = 0; icommas < 50; icommas++) { - position = text_line.find( ",", 0 ); - if (position!=string::npos) text_line.erase (position,1); - } - stringstream point_line(text_line); - - if (geometry->GetnDim() == 2) point_line >> iPoint >> XCoord >> YCoord >> Pressure >> PressureCoeff >> Cf >> HeatFlux; - if (geometry->GetnDim() == 3) point_line >> iPoint >> XCoord >> YCoord >> ZCoord >> Pressure >> PressureCoeff >> Cf >> HeatFlux; - - if (PointInDomain[iPoint]) { - - /*--- Find the vertex for the Point and Marker ---*/ - - iMarker = Point2Vertex[iPoint][0]; - iVertex = Point2Vertex[iPoint][1]; - - solver_container->SetHeatFluxTarget(iMarker, iVertex, HeatFlux); - - } - - } - - Surface_file.close(); - } - - /*--- Compute the pressure difference ---*/ - - HeatFluxDiff = 0.0; - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - Boundary = config->GetMarker_All_KindBC(iMarker); - - if ((Boundary == EULER_WALL ) || - (Boundary == HEAT_FLUX ) || - (Boundary == ISOTHERMAL ) || - (Boundary == NEARFIELD_BOUNDARY)) { - for (iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { - - Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); - - HeatFlux = solver_container->GetHeatFlux(iMarker, iVertex); - HeatFluxTarget = solver_container->GetHeatFluxTarget(iMarker, iVertex); - - Area = 0.0; - for (iDim = 0; iDim < geometry->GetnDim(); iDim++) - Area += Normal[iDim]*Normal[iDim]; - Area = sqrt(Area); - - HeatFluxDiff += Area * (HeatFluxTarget - HeatFlux) * (HeatFluxTarget - HeatFlux); - - } - - } - } - -#ifdef HAVE_MPI - su2double MyHeatFluxDiff = HeatFluxDiff; HeatFluxDiff = 0.0; - SU2_MPI::Allreduce(&MyHeatFluxDiff, &HeatFluxDiff, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); -#endif - - /*--- Update the total HeatFlux difference coeffient ---*/ - - solver_container->SetTotal_HeatFluxDiff(HeatFluxDiff); - - delete [] Point2Vertex; - delete [] PointInDomain; - -} - - - -void COutputLegacy::SpecialOutput_Distortion(CSolver *solver, CGeometry *geometry, CConfig *config, bool output) const { - - unsigned short iMarker, iDim, iMarker_Analyze; - unsigned long iPoint, iVertex; - su2double xCoord = 0.0, yCoord = 0.0, zCoord = 0.0, Area = 0.0, *Vector, TotalArea = 0.0; - su2double xCoord_CG = 0.0, yCoord_CG = 0.0, zCoord_CG = 0.0, TipRadius, HubRadius, Distance = 0.0, Distance_Mirror = 0.0; - su2double *r, MinDistance, xCoord_ = 0.0, yCoord_ = 0.0, zCoord_ = 0; - unsigned short iStation, iAngle, nAngle; - char cstr[200]; - su2double *** ProbeArray, dx = 0.0, dy = 0.0, dz = 0.0, dx_ = 0.0, dy_ = 0.0, dz_ = 0.0, UpVector[3], radians, RotatedVector[3]; - su2double Pressure, SoundSpeed, Velocity2, Mach, Gamma, TotalPressure, Mach_Inf, TotalPressure_Inf, - Temperature, TotalTemperature, Pressure_Inf, Temperature_Inf, TotalTemperature_Inf, Velocity_Inf, Density; - unsigned short nDim = geometry->GetnDim(); - unsigned short Theta, nStation; - unsigned long nVertex_Surface, nLocalVertex_Surface, MaxLocalVertex_Surface; - unsigned long Buffer_Send_nVertex[1], *Buffer_Recv_nVertex = nullptr; - unsigned long Total_Index; - unsigned short Theta_DC60 = 60, nStation_DC60 = 5; - su2double PT_Mean, Mach_Mean, q_Mean, PT, q, *PT_Sector, PT_Sector_Min, DC60, *PT_Station, *PT_Station_Min, *Mach_Station, *Mach_Station_Min, IDR, IDC, IDC_Mach; - - - bool Engine_HalfModel = config->GetEngine_HalfModel(); - su2double SignFlip = 1.0; - su2double Beta, Alpha; - su2double Mach_ij, Mach_ip1j, Mach_im1j, Mach_ijp1, Mach_ijm1, Filtered_Mach; - su2double Alpha_ij, Alpha_ip1j, Alpha_im1j, Alpha_ijp1, Alpha_ijm1, Filtered_Alpha; - su2double Beta_ij, Beta_ip1j, Beta_im1j, Beta_ijp1, Beta_ijm1, Filtered_Beta; - su2double a, b, c, d; - - int iProcessor, nProcessor; - nProcessor = size; - - - if (rank == MASTER_NODE && !config->GetDiscrete_Adjoint()) cout << endl << "Writing Surface Analysis file (surface_analysis.dat)."; - - /*--- Open and rrite file name with extension if unsteady ---*/ - - ofstream SurfFlow_file; - - if (output && (rank == MASTER_NODE)) { - - if ((config->GetTabular_FileFormat() == TAB_OUTPUT::TAB_CSV)) strcpy (cstr, "surface_analysis.vtk"); - else strcpy (cstr, "surface_analysis.dat"); - - SurfFlow_file.precision(15); - - SurfFlow_file.open(cstr, ios::out); - - if ((config->GetTabular_FileFormat() == TAB_OUTPUT::TAB_CSV)) { - SurfFlow_file << "# vtk DataFile Version 3.0" << endl; - SurfFlow_file << "vtk output" << endl; - SurfFlow_file << "ASCII" << endl; - } - else { - SurfFlow_file <<"TITLE = \"Surface Analysis\"" <inf\", \"TT/TTinf\", \"P/Pinf\", \"T/Tinf\", \"vx/vinf\", \"vy/vinf\", \"vz/vinf\", \"a (deg)\", \"b (deg)\", \"Mach\", \"Filtered a (deg)\", \"Filtered b (deg)\", \"Filtered Mach\"" << endl; - } - - } - - /*--- Loop over all the markers to analyze ---*/ - - for (iMarker_Analyze = 0; iMarker_Analyze < config->GetnMarker_Analyze(); iMarker_Analyze++) { - - string Analyze_TagBound = config->GetMarker_Analyze_TagBound(iMarker_Analyze); - - nVertex_Surface = 0; nLocalVertex_Surface = 0; MaxLocalVertex_Surface = 0; - - /*--- Find the max number of surface vertices among all - partitions and set up buffers. The master node will handle the - writing of the CSV file after gathering all of the data. ---*/ - - nLocalVertex_Surface = 0; - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - string Marker_TagBound = config->GetMarker_All_TagBound(iMarker); - if (Marker_TagBound == Analyze_TagBound) { - for (iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - if (geometry->nodes->GetDomain(iPoint)) nLocalVertex_Surface++; - } - } - } - - /*--- Communicate the number of local vertices on each partition - to the master node ---*/ - - Buffer_Send_nVertex[0] = nLocalVertex_Surface; - if (rank == MASTER_NODE) Buffer_Recv_nVertex = new unsigned long [nProcessor]; - -#ifdef HAVE_MPI - SU2_MPI::Allreduce(&nLocalVertex_Surface, &MaxLocalVertex_Surface, 1, MPI_UNSIGNED_LONG, MPI_MAX, SU2_MPI::GetComm()); - SU2_MPI::Gather(&Buffer_Send_nVertex, 1, MPI_UNSIGNED_LONG, Buffer_Recv_nVertex, 1, MPI_UNSIGNED_LONG, MASTER_NODE, SU2_MPI::GetComm()); -#else - MaxLocalVertex_Surface = nLocalVertex_Surface; - Buffer_Recv_nVertex[MASTER_NODE] = Buffer_Send_nVertex[MASTER_NODE]; -#endif - - /*--- Send and Recv buffers ---*/ - - su2double *Buffer_Send_Coord_x = nullptr, *Buffer_Recv_Coord_x = nullptr; - Buffer_Send_Coord_x = new su2double [MaxLocalVertex_Surface]; - - su2double *Buffer_Send_Coord_y = nullptr, *Buffer_Recv_Coord_y = nullptr; - Buffer_Send_Coord_y = new su2double [MaxLocalVertex_Surface]; - - su2double *Buffer_Send_Coord_z = nullptr, *Buffer_Recv_Coord_z = nullptr; - if (nDim == 3) Buffer_Send_Coord_z = new su2double [MaxLocalVertex_Surface]; - - su2double *Buffer_Send_PT = nullptr, *Buffer_Recv_PT = nullptr; - Buffer_Send_PT = new su2double [MaxLocalVertex_Surface]; - - su2double *Buffer_Send_TT = nullptr, *Buffer_Recv_TT = nullptr; - Buffer_Send_TT = new su2double [MaxLocalVertex_Surface]; - - su2double *Buffer_Send_P = nullptr, *Buffer_Recv_P = nullptr; - Buffer_Send_P = new su2double [MaxLocalVertex_Surface]; - - su2double *Buffer_Send_T = nullptr, *Buffer_Recv_T = nullptr; - Buffer_Send_T = new su2double [MaxLocalVertex_Surface]; - - su2double *Buffer_Send_Mach = nullptr, *Buffer_Recv_Mach = nullptr; - Buffer_Send_Mach = new su2double [MaxLocalVertex_Surface]; - - su2double *Buffer_Send_Vel_x = nullptr, *Buffer_Recv_Vel_x = nullptr; - Buffer_Send_Vel_x = new su2double [MaxLocalVertex_Surface]; - - su2double *Buffer_Send_Vel_y = nullptr, *Buffer_Recv_Vel_y = nullptr; - Buffer_Send_Vel_y = new su2double [MaxLocalVertex_Surface]; - - su2double *Buffer_Send_Vel_z = nullptr, *Buffer_Recv_Vel_z = nullptr; - if (nDim == 3) Buffer_Send_Vel_z = new su2double [MaxLocalVertex_Surface]; - - su2double *Buffer_Send_q = nullptr, *Buffer_Recv_q = nullptr; - Buffer_Send_q = new su2double [MaxLocalVertex_Surface]; - - su2double *Buffer_Send_Area = nullptr, *Buffer_Recv_Area = nullptr; - Buffer_Send_Area = new su2double [MaxLocalVertex_Surface]; - - /*--- Prepare the receive buffers on the master node only. ---*/ - - if (rank == MASTER_NODE) { - Buffer_Recv_Coord_x = new su2double [nProcessor*MaxLocalVertex_Surface]; - Buffer_Recv_Coord_y = new su2double [nProcessor*MaxLocalVertex_Surface]; - if (nDim == 3) Buffer_Recv_Coord_z = new su2double [nProcessor*MaxLocalVertex_Surface]; - Buffer_Recv_PT = new su2double [nProcessor*MaxLocalVertex_Surface]; - Buffer_Recv_TT = new su2double [nProcessor*MaxLocalVertex_Surface]; - Buffer_Recv_P = new su2double [nProcessor*MaxLocalVertex_Surface]; - Buffer_Recv_T = new su2double [nProcessor*MaxLocalVertex_Surface]; - Buffer_Recv_Mach = new su2double [nProcessor*MaxLocalVertex_Surface]; - Buffer_Recv_Vel_x = new su2double [nProcessor*MaxLocalVertex_Surface]; - Buffer_Recv_Vel_y = new su2double [nProcessor*MaxLocalVertex_Surface]; - if (nDim == 3) { - Buffer_Recv_Vel_z = new su2double [nProcessor*MaxLocalVertex_Surface]; - } - Buffer_Recv_q = new su2double [nProcessor*MaxLocalVertex_Surface]; - Buffer_Recv_Area = new su2double [nProcessor*MaxLocalVertex_Surface]; - } - - /*--- Loop over all vertices in this partition and load the - data of the specified type into the buffer to be sent to - the master node. ---*/ - - nVertex_Surface = 0; - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - string Marker_TagBound = config->GetMarker_All_TagBound(iMarker); - if (Marker_TagBound == Analyze_TagBound) { - - for (iVertex = 0; iVertex < geometry->GetnVertex(iMarker); iVertex++) { - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - - if (geometry->nodes->GetDomain(iPoint)) { - - Buffer_Send_Coord_x[nVertex_Surface] = geometry->nodes->GetCoord(iPoint, 0); - Buffer_Send_Coord_y[nVertex_Surface] = geometry->nodes->GetCoord(iPoint, 1); - if (nDim == 3) { Buffer_Send_Coord_z[nVertex_Surface] = geometry->nodes->GetCoord(iPoint, 2); } - - Pressure = solver->GetNodes()->GetPressure(iPoint); - Density = solver->GetNodes()->GetDensity(iPoint); - Temperature = solver->GetNodes()->GetTemperature(iPoint); - SoundSpeed = solver->GetNodes()->GetSoundSpeed(iPoint); - Velocity2 = solver->GetNodes()->GetVelocity2(iPoint); - Mach = sqrt(Velocity2)/SoundSpeed; - Gamma = config->GetGamma(); - - Mach_Inf = config->GetMach(); - Pressure_Inf = config->GetPressure_FreeStreamND(); - Temperature_Inf = config->GetTemperature_FreeStreamND(); - Velocity_Inf = sqrt(config->GetVelocity_FreeStreamND()[0]*config->GetVelocity_FreeStreamND()[0] - + config->GetVelocity_FreeStreamND()[1]*config->GetVelocity_FreeStreamND()[1] - + config->GetVelocity_FreeStreamND()[2]*config->GetVelocity_FreeStreamND()[2]); - - Buffer_Send_P[nVertex_Surface] = Pressure / Pressure_Inf; - Buffer_Send_T[nVertex_Surface] = Temperature / Temperature_Inf; - Buffer_Send_Mach[nVertex_Surface] = Mach; - - TotalPressure = Pressure * pow( 1.0 + Mach * Mach * 0.5 * (Gamma - 1.0), Gamma / (Gamma - 1.0)); - TotalPressure_Inf = Pressure_Inf * pow( 1.0 + Mach_Inf * Mach_Inf * 0.5 * (Gamma - 1.0), Gamma / (Gamma - 1.0)); - Buffer_Send_PT[nVertex_Surface] = TotalPressure / TotalPressure_Inf; - - TotalTemperature = Temperature * (1.0 + Mach * Mach * 0.5 * (Gamma - 1.0)); - TotalTemperature_Inf = Temperature_Inf * (1.0 + Mach * Mach * 0.5 * (Gamma - 1.0)); - Buffer_Send_TT[nVertex_Surface] = TotalTemperature / TotalTemperature_Inf; - - Buffer_Send_Vel_x[nVertex_Surface] = solver->GetNodes()->GetVelocity(iPoint,0) / Velocity_Inf; - Buffer_Send_Vel_y[nVertex_Surface] = solver->GetNodes()->GetVelocity(iPoint,1) / Velocity_Inf; - if (nDim == 3) { - Buffer_Send_Vel_z[nVertex_Surface] = solver->GetNodes()->GetVelocity(iPoint,2) / Velocity_Inf; - } - - Buffer_Send_q[nVertex_Surface] = 0.5*Density*Velocity2; - - Vector = geometry->vertex[iMarker][iVertex]->GetNormal(); - Area = 0.0; for (iDim = 0; iDim < nDim; iDim++) { Area += Vector[iDim]*Vector[iDim]; } Area = sqrt(Area); - Buffer_Send_Area[nVertex_Surface] = Area; - - /*--- If US system, the output should be in inches ---*/ - - if (config->GetSystemMeasurements() == US) { - - Buffer_Send_Coord_x[nVertex_Surface] *= 12.0; - Buffer_Send_Coord_y[nVertex_Surface] *= 12.0; - if (nDim == 3) Buffer_Send_Coord_z[nVertex_Surface] *= 12.0; - Buffer_Send_Area[nVertex_Surface] *= 144.0; - - } - - nVertex_Surface++; - - } - } - break; - } - } - - /*--- Send the information to the master node ---*/ - -#ifdef HAVE_MPI - - SU2_MPI::Gather(Buffer_Send_Coord_x, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Coord_x, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(Buffer_Send_Coord_y, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Coord_y, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - if (nDim == 3) SU2_MPI::Gather(Buffer_Send_Coord_z, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Coord_z, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(Buffer_Send_PT, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_PT, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(Buffer_Send_TT, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_TT, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(Buffer_Send_P, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_P, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(Buffer_Send_T, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_T, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(Buffer_Send_Mach, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Mach, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(Buffer_Send_Vel_x, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Vel_x, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(Buffer_Send_Vel_y, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Vel_y, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - if (nDim == 3) SU2_MPI::Gather(Buffer_Send_Vel_z, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Vel_z, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(Buffer_Send_q, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_q, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - SU2_MPI::Gather(Buffer_Send_Area, MaxLocalVertex_Surface, MPI_DOUBLE, Buffer_Recv_Area, MaxLocalVertex_Surface, MPI_DOUBLE, MASTER_NODE, SU2_MPI::GetComm()); - -#else - - for (iVertex = 0; iVertex < MaxLocalVertex_Surface; iVertex++) { - Buffer_Recv_Coord_x[iVertex] = Buffer_Send_Coord_x[iVertex]; - Buffer_Recv_Coord_y[iVertex] = Buffer_Send_Coord_y[iVertex]; - if (nDim == 3) Buffer_Recv_Coord_z[iVertex] = Buffer_Send_Coord_z[iVertex]; - Buffer_Recv_PT[iVertex] = Buffer_Send_PT[iVertex]; - Buffer_Recv_TT[iVertex] = Buffer_Send_TT[iVertex]; - Buffer_Recv_P[iVertex] = Buffer_Send_P[iVertex]; - Buffer_Recv_T[iVertex] = Buffer_Send_T[iVertex]; - Buffer_Recv_Mach[iVertex] = Buffer_Send_Mach[iVertex]; - Buffer_Recv_Vel_x[iVertex] = Buffer_Send_Vel_x[iVertex]; - Buffer_Recv_Vel_y[iVertex] = Buffer_Send_Vel_y[iVertex]; - if (nDim == 3) Buffer_Recv_Vel_z[iVertex] = Buffer_Send_Vel_z[iVertex]; - Buffer_Recv_q[iVertex] = Buffer_Send_q[iVertex]; - Buffer_Recv_Area[iVertex] = Buffer_Send_Area[iVertex]; - } - -#endif - - if (rank == MASTER_NODE) { - - /*--- Compute the location of the critical points of the distortion measure, and center of gravity ---*/ - - TotalArea = 0.0; xCoord_CG = 0.0; yCoord_CG = 0.0; zCoord_CG = 0.0; PT_Mean = 0.0; Mach_Mean = 0.0; q_Mean = 0.0; - - for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) { - for (iVertex = 0; iVertex < Buffer_Recv_nVertex[iProcessor]; iVertex++) { - - /*--- Current index position and global index ---*/ - - Total_Index = iProcessor*MaxLocalVertex_Surface+iVertex; - - /*--- Retrieve the merged data for this node ---*/ - - xCoord = Buffer_Recv_Coord_x[Total_Index]; - yCoord = Buffer_Recv_Coord_y[Total_Index]; - if (nDim == 3) zCoord = Buffer_Recv_Coord_z[Total_Index]; - PT = Buffer_Recv_PT[Total_Index]; - Mach = Buffer_Recv_Mach[Total_Index]; - q = Buffer_Recv_q[Total_Index]; - - Area = Buffer_Recv_Area[Total_Index]; - TotalArea += Area; - xCoord_CG += xCoord*Area; - yCoord_CG += yCoord*Area; - zCoord_CG += zCoord*Area; - PT_Mean += PT*Area; - Mach_Mean += PT*Area; - q_Mean += q*Area; - - } - } - - /*--- Evaluate the area averaged pressure and CG ---*/ - - xCoord_CG = xCoord_CG / TotalArea; - yCoord_CG = yCoord_CG / TotalArea; - zCoord_CG = zCoord_CG / TotalArea; - PT_Mean /= TotalArea; - Mach_Mean /= TotalArea; - q_Mean /= TotalArea; - - /*--- If it is a half model, CGy = 0 ---*/ - - if (Engine_HalfModel) { yCoord_CG = 0.0; } - - /*--- Compute hub and tip radius ---*/ - - TipRadius = 1E-6; HubRadius = 1E6; - for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) { - for (iVertex = 0; iVertex < Buffer_Recv_nVertex[iProcessor]; iVertex++) { - - /*--- Current index position and global index ---*/ - - Total_Index = iProcessor*MaxLocalVertex_Surface+iVertex; - - /*--- Retrieve the merged data for this node ---*/ - - xCoord = Buffer_Recv_Coord_x[Total_Index]; - yCoord = Buffer_Recv_Coord_y[Total_Index]; - if (nDim == 3) zCoord = Buffer_Recv_Coord_z[Total_Index]; - - if (nDim == 2) - Distance = sqrt((xCoord_CG-xCoord)*(xCoord_CG-xCoord) + - (yCoord_CG-yCoord)*(yCoord_CG-yCoord)); - - if (nDim == 3) - Distance = sqrt((xCoord_CG-xCoord)*(xCoord_CG-xCoord) + - (yCoord_CG-yCoord)*(yCoord_CG-yCoord) + - (zCoord_CG-zCoord)*(zCoord_CG-zCoord)); - - if (Distance > TipRadius) TipRadius = Distance; - if (Distance < HubRadius) HubRadius = Distance; - - } - } - - if (HubRadius/TipRadius < 0.05) HubRadius = 0.0; - - /*--- Evaluate the DC60 parameter ---*/ - - Theta = Theta_DC60; - nStation = nStation_DC60; - - nAngle = SU2_TYPE::Int(360/float(Theta)); - r = new su2double [nStation+1]; - - /*--- Allocate memory ---*/ - - PT_Sector = new su2double [nAngle]; - ProbeArray = new su2double ** [nAngle]; - for (iAngle = 0; iAngle < nAngle; iAngle++) { - ProbeArray[iAngle] = new su2double * [nStation]; - for (iStation = 0; iStation < nStation; iStation++) { - ProbeArray[iAngle][iStation] = new su2double [5]; - } - } - - /*--- Define the radius for each probe ---*/ - - r[0] = HubRadius; r[nStation] = TipRadius; - for (iStation = 1; iStation < nStation; iStation++) { - r[iStation] = sqrt( r[iStation-1]*r[iStation-1] + (r[nStation]*r[nStation] - r[0]*r[0])/float(nStation) ); - } - - /*--- Define the probe rack ---*/ - - UpVector[0] = 0.0; UpVector[1] = 0.0; UpVector[2] = 1.0; - - for (iAngle = 0; iAngle < nAngle; iAngle++) { - - radians = -iAngle*Theta*2.0*PI_NUMBER/360; - RotatedVector[0] = UpVector[0]; - RotatedVector[1] = UpVector[1] * cos(radians) - UpVector[2] * sin(radians); - RotatedVector[2] = UpVector[1] * sin(radians) + UpVector[2] * cos(radians); - - for (iStation = 1; iStation <= nStation; iStation++) { - ProbeArray[iAngle][iStation-1][0] = xCoord_CG+RotatedVector[0]*sqrt(0.5*(r[iStation]*r[iStation]+r[iStation-1]*r[iStation-1])); - ProbeArray[iAngle][iStation-1][1] = yCoord_CG+RotatedVector[1]*sqrt(0.5*(r[iStation]*r[iStation]+r[iStation-1]*r[iStation-1])); - ProbeArray[iAngle][iStation-1][2] = zCoord_CG+RotatedVector[2]*sqrt(0.5*(r[iStation]*r[iStation]+r[iStation-1]*r[iStation-1])); - } - - } - - /*--- Compute the Total pressure at each probe, closes grid point to the location ---*/ - - for (iAngle = 0; iAngle < nAngle; iAngle++) { - - for (iStation = 0; iStation < nStation; iStation++) { - xCoord_ = ProbeArray[iAngle][iStation][0]; - yCoord_ = ProbeArray[iAngle][iStation][1]; - zCoord_ = ProbeArray[iAngle][iStation][2]; - - MinDistance = 1E6; - - for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) { - for (iVertex = 0; iVertex < Buffer_Recv_nVertex[iProcessor]; iVertex++) { - - Total_Index = iProcessor*MaxLocalVertex_Surface+iVertex; - xCoord = Buffer_Recv_Coord_x[Total_Index]; - yCoord = Buffer_Recv_Coord_y[Total_Index]; - if (nDim == 3) zCoord = Buffer_Recv_Coord_z[Total_Index]; - - dx = (xCoord_ - xCoord); dy = (yCoord_ - yCoord); - if (nDim == 3) dz = (zCoord_ - zCoord); - - Distance = dx*dx + dy*dy; if (nDim == 3) Distance += dz*dz; Distance = sqrt(Distance); - - if (Engine_HalfModel) { - - yCoord = -yCoord; - - dx_ = (xCoord_ - xCoord); dy_ = (yCoord_ - yCoord); - if (nDim == 3) dz_ = (zCoord_ - zCoord); - - Distance_Mirror = dx_*dx_ + dy_*dy_; - if (nDim == 3) Distance_Mirror += dz_*dz_; - Distance_Mirror = sqrt(Distance_Mirror); - - if (Distance_Mirror < Distance) { - Distance = Distance_Mirror; - dx = dx_; dy = dy_; - if (nDim == 3) dz = dz_; - } - - } - - if (Distance <= MinDistance) { - MinDistance = Distance; - ProbeArray[iAngle][iStation][3] = Buffer_Recv_PT[Total_Index]; - ProbeArray[iAngle][iStation][4] = Buffer_Recv_q[Total_Index]; - } - - } - } - - } - - } - - /*--- Evaluate the average pressure at each sector, fan face and dynamic pressure ---*/ - - PT_Mean = 0.0; q_Mean = 0.0; - for (iAngle = 0; iAngle < nAngle; iAngle++) { - PT_Sector[iAngle] = 0.0; - for (iStation = 0; iStation < nStation; iStation++) { - PT_Sector[iAngle] += ProbeArray[iAngle][iStation][3]/float(nStation); - PT_Mean += ProbeArray[iAngle][iStation][3]/float(nStation*nAngle); - q_Mean += ProbeArray[iAngle][iStation][4]/float(nStation*nAngle); - } - } - - /*--- Compute the min value of the averaged pressure at each sector ---*/ - - PT_Sector_Min = PT_Sector[0]; - for (iAngle = 1; iAngle < nAngle; iAngle++) { - if (PT_Sector[iAngle] <= PT_Sector_Min) PT_Sector_Min = PT_Sector[iAngle]; - } - - /*--- Set the value of the distortion, it only works for one surface ---*/ - - Mach_Inf = config->GetMach(); - Gamma = config->GetGamma(); - TotalPressure_Inf = config->GetPressure_FreeStreamND() * pow( 1.0 + Mach_Inf * Mach_Inf * - 0.5 * (Gamma - 1.0), Gamma / (Gamma - 1.0)); - - if (q_Mean != 0.0) DC60 = ((PT_Mean - PT_Sector_Min)*TotalPressure_Inf)/q_Mean; - else DC60 = 0.0; - - config->SetSurface_DC60(iMarker_Analyze, DC60); - - solver->SetTotal_DC60(DC60); - - /*--- Deallocate the memory ---*/ - - delete[] r; - - delete [] PT_Sector; - - for (iAngle = 0; iAngle < nAngle; iAngle++) { - for (iStation = 0; iStation < nStation; iStation++) { - delete[] ProbeArray[iAngle][iStation]; - } - } - delete[] ProbeArray; - - - /*--- Evaluate the IDC, and IDR parameters ---*/ - - nStation = SU2_TYPE::Int(config->GetDistortionRack()[0]); - Theta = SU2_TYPE::Int(config->GetDistortionRack()[1]); - nAngle = SU2_TYPE::Int(360/float(Theta)); - - /*--- Allocate memory ---*/ - - r = new su2double [nStation+1]; - ProbeArray = new su2double ** [nAngle]; - for (iAngle = 0; iAngle < nAngle; iAngle++) { - ProbeArray[iAngle] = new su2double * [nStation]; - for (iStation = 0; iStation < nStation; iStation++) { - ProbeArray[iAngle][iStation] = new su2double [4]; - } - } - - /*--- Define the radius for each probe ---*/ - - r[0] = HubRadius; r[nStation] = TipRadius; - for (iStation = 1; iStation < nStation; iStation++) { - r[iStation] = sqrt( r[iStation-1]*r[iStation-1] + (r[nStation]*r[nStation] - r[0]*r[0])/float(nStation) ); - } - - /*--- Define the probe rack ---*/ - - UpVector[0] = 0.0; UpVector[1] = 0.0; UpVector[2] = 1.0; - - for (iAngle = 0; iAngle < nAngle; iAngle++) { - - radians = -iAngle*Theta*2.0*PI_NUMBER/360; - RotatedVector[0] = UpVector[0]; - RotatedVector[1] = UpVector[1] * cos(radians) - UpVector[2] * sin(radians); - RotatedVector[2] = UpVector[1] * sin(radians) + UpVector[2] * cos(radians); - - for (iStation = 1; iStation <= nStation; iStation++) { - ProbeArray[iAngle][iStation-1][0] = xCoord_CG+RotatedVector[0]*sqrt(0.5*(r[iStation]*r[iStation]+r[iStation-1]*r[iStation-1])); - ProbeArray[iAngle][iStation-1][1] = yCoord_CG+RotatedVector[1]*sqrt(0.5*(r[iStation]*r[iStation]+r[iStation-1]*r[iStation-1])); - ProbeArray[iAngle][iStation-1][2] = zCoord_CG+RotatedVector[2]*sqrt(0.5*(r[iStation]*r[iStation]+r[iStation-1]*r[iStation-1])); - } - - } - - /*--- Compute the Total pressure at each probe, closes grid point to the location ---*/ - - for (iAngle = 0; iAngle < nAngle; iAngle++) { - for (iStation = 0; iStation < nStation; iStation++) { - xCoord_ = ProbeArray[iAngle][iStation][0]; - yCoord_ = ProbeArray[iAngle][iStation][1]; - zCoord_ = ProbeArray[iAngle][iStation][2]; - - MinDistance = 1E6; - - for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) { - for (iVertex = 0; iVertex < Buffer_Recv_nVertex[iProcessor]; iVertex++) { - - Total_Index = iProcessor*MaxLocalVertex_Surface+iVertex; - xCoord = Buffer_Recv_Coord_x[Total_Index]; - yCoord = Buffer_Recv_Coord_y[Total_Index]; - if (nDim == 3) zCoord = Buffer_Recv_Coord_z[Total_Index]; - - dx = (xCoord_ - xCoord); dy = (yCoord_ - yCoord); - if (nDim == 3) dz = (zCoord_ - zCoord); - - Distance = dx*dx + dy*dy; if (nDim == 3) Distance += dz*dz; Distance = sqrt(Distance); - - if (Engine_HalfModel) { - - yCoord = -yCoord; - - dx_ = (xCoord_ - xCoord); dy_ = (yCoord_ - yCoord); - if (nDim == 3) dz_ = (zCoord_ - zCoord); - - Distance_Mirror = dx_*dx_ + dy_*dy_; - if (nDim == 3) Distance_Mirror += dz_*dz_; - Distance_Mirror = sqrt(Distance_Mirror); - - if (Distance_Mirror < Distance) { - Distance = Distance_Mirror; - dx = dx_; dy = dy_; - if (nDim == 3) dz = dz_; - } - - } - - if (Distance <= MinDistance) { - MinDistance = Distance; - ProbeArray[iAngle][iStation][3] = Buffer_Recv_PT[Total_Index]; - } - - } - } - - } - - } - - /*--- Evaluate the average and min. pressure at each station/radius and fan ---*/ - - PT_Station = new su2double [nStation]; - PT_Station_Min = new su2double [nStation]; - - PT_Mean = 0.0; - for (iStation = 0; iStation < nStation; iStation++) { - PT_Station[iStation] = 0.0; - PT_Station_Min[iStation] = ProbeArray[0][iStation][3]; - for (iAngle = 0; iAngle < nAngle; iAngle++) { - PT = ProbeArray[iAngle][iStation][3]; - PT_Station[iStation] += PT / float(nAngle); - if (PT <= PT_Station_Min[iStation] ) PT_Station_Min[iStation] = PT; - PT_Mean += ProbeArray[iAngle][iStation][3]/float(nStation*nAngle); - } - } - - /*--- Set the value of the distortion, it only works for one surface ---*/ - - IDC = 0.0; - for (iStation = 0; iStation < nStation-1; iStation++) { - IDC = max (IDC, 0.5*((PT_Station[iStation] - PT_Station_Min[iStation])/PT_Mean - + (PT_Station[iStation+1] - PT_Station_Min[iStation+1])/PT_Mean) ); - - } - - config->SetSurface_IDC(iMarker_Analyze, IDC); - solver->SetTotal_IDC(IDC); - - IDR = 0.0; - for (iStation = 0; iStation < nStation; iStation++) { - IDR = max (IDR, (PT_Mean-PT_Station[iStation])/PT_Mean); - } - - config->SetSurface_IDR(iMarker_Analyze, IDR); - - solver->SetTotal_IDR(IDR); - - /*--- Release IDX parameters ---*/ - - delete [] PT_Station_Min; - delete [] PT_Station; - - /*--- Evaluate the IDC Mach parameter ---*/ - - /*--- Compute the Mach number at each probe, closes grid point to the location ---*/ - - for (iAngle = 0; iAngle < nAngle; iAngle++) { - for (iStation = 0; iStation < nStation; iStation++) { - xCoord_ = ProbeArray[iAngle][iStation][0]; - yCoord_ = ProbeArray[iAngle][iStation][1]; - zCoord_ = ProbeArray[iAngle][iStation][2]; - - MinDistance = 1E6; - - for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) { - for (iVertex = 0; iVertex < Buffer_Recv_nVertex[iProcessor]; iVertex++) { - - Total_Index = iProcessor*MaxLocalVertex_Surface+iVertex; - - xCoord = Buffer_Recv_Coord_x[Total_Index]; - yCoord = Buffer_Recv_Coord_y[Total_Index]; - if (nDim == 3) zCoord = Buffer_Recv_Coord_z[Total_Index]; - - dx = (xCoord_ - xCoord); dy = (yCoord_ - yCoord); - if (nDim == 3) dz = (zCoord_ - zCoord); - - Distance = dx*dx + dy*dy; - if (nDim == 3) Distance += dz*dz; - Distance = sqrt(Distance); - - if (Engine_HalfModel) { - - yCoord = -yCoord; - - dx_ = (xCoord_ - xCoord); dy_ = (yCoord_ - yCoord); - if (nDim == 3) dz_ = (zCoord_ - zCoord); - - Distance_Mirror = dx_*dx_ + dy_*dy_; - if (nDim == 3) Distance_Mirror += dz_*dz_; - Distance_Mirror = sqrt(Distance_Mirror); - - if (Distance_Mirror < Distance) { - Distance = Distance_Mirror; - dx = dx_; dy = dy_; - if (nDim == 3) dz = dz_; - } - - } - - if (Distance <= MinDistance) { - MinDistance = Distance; - ProbeArray[iAngle][iStation][3] = Buffer_Recv_Mach[Total_Index]; - } - - } - } - - } - - } - - /*--- Evaluate the average and min. pressure at each station/radius and fan face ---*/ - - Mach_Station = new su2double [nStation]; - Mach_Station_Min = new su2double [nStation]; - - Mach_Mean = 0.0; - for (iStation = 0; iStation < nStation; iStation++) { - Mach_Station[iStation] = 0.0; - Mach_Station_Min[iStation] = ProbeArray[0][iStation][3]; - for (iAngle = 0; iAngle < nAngle; iAngle++) { - Mach = ProbeArray[iAngle][iStation][3]; - Mach_Station[iStation] += Mach / float(nAngle); - if (Mach <= Mach_Station_Min[iStation] ) Mach_Station_Min[iStation] = Mach; - Mach_Mean += ProbeArray[iAngle][iStation][3]/float(nStation*nAngle); - } - } - - /*--- Set the value of the distortion, it only works for one surface ---*/ - - IDC_Mach = 0.0; - for (iStation = 0; iStation < nStation-1; iStation++) { - if (Mach_Mean != 0) - IDC_Mach = max (IDC_Mach, 0.5*((Mach_Station[iStation] - Mach_Station_Min[iStation])/Mach_Mean - + (Mach_Station[iStation+1] - Mach_Station_Min[iStation+1])/Mach_Mean) ); - - } - - config->SetSurface_IDC_Mach(iMarker_Analyze, IDC_Mach); - - solver->SetTotal_IDC_Mach(IDC_Mach); - - delete [] Mach_Station_Min; - delete [] Mach_Station; - - /*--- Release distortion parameters ---*/ - - delete[] r; - for (iAngle = 0; iAngle < nAngle; iAngle++) { - for (iStation = 0; iStation < nStation; iStation++) { - delete[] ProbeArray[iAngle][iStation]; - } - } - delete[] ProbeArray; - - /*--- Create the distortion plot ---*/ - - Theta = 10; nStation = 20; - - nAngle = SU2_TYPE::Int(360/float(Theta)); - r = new su2double [nStation+1]; - - /*--- Allocate memory ---*/ - - ProbeArray = new su2double ** [nAngle]; - for (iAngle = 0; iAngle < nAngle; iAngle++) { - ProbeArray[iAngle] = new su2double * [nStation]; - for (iStation = 0; iStation < nStation; iStation++) { - ProbeArray[iAngle][iStation] = new su2double [11]; - } - } - - /*--- Define the radius for each probe ---*/ - - r[0] = HubRadius; - r[nStation] = TipRadius; - - for (iStation = 1; iStation < nStation; iStation++) { - r[iStation] = sqrt( r[iStation-1]*r[iStation-1] + (r[nStation]*r[nStation] - r[0]*r[0])/float(nStation) ); - } - - /*--- Define the probe rack ---*/ - - UpVector[0] = 0.0; UpVector[1] = 0.0; UpVector[2] = 1.0; - - for (iAngle = 0; iAngle < nAngle; iAngle++) { - - radians = -iAngle*Theta*2.0*PI_NUMBER/360; - RotatedVector[0] = UpVector[0]; - RotatedVector[1] = UpVector[1] * cos(radians) - UpVector[2] * sin(radians); - RotatedVector[2] = UpVector[1] * sin(radians) + UpVector[2] * cos(radians); - - for (iStation = 1; iStation <= nStation; iStation++) { - ProbeArray[iAngle][iStation-1][0] = xCoord_CG+RotatedVector[0]*sqrt(0.5*(r[iStation]*r[iStation]+r[iStation-1]*r[iStation-1])); - ProbeArray[iAngle][iStation-1][1] = yCoord_CG+RotatedVector[1]*sqrt(0.5*(r[iStation]*r[iStation]+r[iStation-1]*r[iStation-1])); - ProbeArray[iAngle][iStation-1][2] = zCoord_CG+RotatedVector[2]*sqrt(0.5*(r[iStation]*r[iStation]+r[iStation-1]*r[iStation-1])); - } - - } - - /*--- Compute the primitieve variables, closest grid point to the location + gradient ---*/ - - for (iAngle = 0; iAngle < nAngle; iAngle++) { - for (iStation = 0; iStation < nStation; iStation++) { - xCoord_ = ProbeArray[iAngle][iStation][0]; - yCoord_ = ProbeArray[iAngle][iStation][1]; - zCoord_ = ProbeArray[iAngle][iStation][2]; - - MinDistance = 1E6; - - for (iProcessor = 0; iProcessor < nProcessor; iProcessor++) { - for (iVertex = 0; iVertex < Buffer_Recv_nVertex[iProcessor]; iVertex++) { - - Total_Index = iProcessor*MaxLocalVertex_Surface+iVertex; - xCoord = Buffer_Recv_Coord_x[Total_Index]; - yCoord = Buffer_Recv_Coord_y[Total_Index]; - if (nDim == 3) zCoord = Buffer_Recv_Coord_z[Total_Index]; - - dx = (xCoord_ - xCoord); dy = (yCoord_ - yCoord); - if (nDim == 3) dz = (zCoord_ - zCoord); - - Distance = dx*dx + dy*dy; if (nDim == 3) Distance += dz*dz; Distance = sqrt(Distance); - - SignFlip = 1.0; - - if (Engine_HalfModel) { - - yCoord = -yCoord; - - dx_ = (xCoord_ - xCoord); - dy_ = (yCoord_ - yCoord); - if (nDim == 3) dz_ = (zCoord_ - zCoord); - - Distance_Mirror = dx_*dx_ + dy_*dy_; - if (nDim == 3) Distance_Mirror += dz_*dz_; - Distance_Mirror = sqrt(Distance_Mirror); - - if (Distance_Mirror < Distance) { - SignFlip = -1.0; - Distance = Distance_Mirror; - dx = dx_; dy = dy_; - if (nDim == 3) dz = dz_; - } - - } - - - if (Distance <= MinDistance) { - MinDistance = Distance; - ProbeArray[iAngle][iStation][3] = Buffer_Recv_PT[Total_Index]; - ProbeArray[iAngle][iStation][4] = Buffer_Recv_TT[Total_Index]; - ProbeArray[iAngle][iStation][5] = Buffer_Recv_P[Total_Index]; - ProbeArray[iAngle][iStation][6] = Buffer_Recv_T[Total_Index]; - ProbeArray[iAngle][iStation][7] = Buffer_Recv_Mach[Total_Index]; - ProbeArray[iAngle][iStation][8] = Buffer_Recv_Vel_x[Total_Index]; - ProbeArray[iAngle][iStation][9] = SignFlip * Buffer_Recv_Vel_y[Total_Index]; - if (nDim == 3) ProbeArray[iAngle][iStation][10] = Buffer_Recv_Vel_z[Total_Index]; - } - - } - } - - } - - } - - /*--- Reverse in the Y direction to move the solution from 3D to 2D ---*/ - - yCoord_CG = -yCoord_CG; - for (iAngle = 0; iAngle < nAngle; iAngle++) { - for (iStation = 0; iStation < nStation; iStation++) { - ProbeArray[iAngle][iStation][9] = -ProbeArray[iAngle][iStation][9]; - ProbeArray[iAngle][iStation][1] = -ProbeArray[iAngle][iStation][1]; - } - } - - if (output) { - - if (config->GetTabular_FileFormat() == TAB_OUTPUT::TAB_CSV) { - - SurfFlow_file << "\nDATASET UNSTRUCTURED_GRID" << endl; - SurfFlow_file <<"POINTS " << nAngle*nStation << " float" << endl; - for (iAngle = 0; iAngle < nAngle; iAngle++) { - for (iStation = 0; iStation < nStation; iStation++) { - SurfFlow_file << ProbeArray[iAngle][iStation][1]-yCoord_CG << " " << ProbeArray[iAngle][iStation][2]-zCoord_CG << " 0.0 " <<" "; - } - } - - SurfFlow_file <<"\nCELLS " << nAngle*(nStation-1) <<" "<< nAngle*(nStation-1)*5 << endl; - for (iAngle = 0; iAngle < nAngle; iAngle++) { - for (iStation = 0; iStation < nStation-1; iStation++) { - a = iAngle*nStation+iStation; b = a + nStation; c = b+1; d = a +1; - if (iAngle == nAngle-1) { b = iStation; c = b+1; } - SurfFlow_file << "4 " << a <<" "<< b <<" "<< c <<" "<< d <<" "; - } - } - - SurfFlow_file <<"\nCELL_TYPES " << nAngle*(nStation-1) << endl; - for (iAngle = 0; iAngle < nAngle; iAngle++) { - for (iStation = 0; iStation < nStation-1; iStation++) { - SurfFlow_file << "9 " ; - } - } - - SurfFlow_file <<"\nPOINT_DATA " << nAngle*nStation << endl; - SurfFlow_file <<"SCALARS PT/PT_inf float" << endl; - SurfFlow_file <<"LOOKUP_TABLE default" << endl; - - for (iAngle = 0; iAngle < nAngle; iAngle++) { - for (iStation = 0; iStation < nStation; iStation++) { - SurfFlow_file << ProbeArray[iAngle][iStation][3] << " "; - } - } - - SurfFlow_file <<"SCALARS TT/TT_inf float" << endl; - SurfFlow_file <<"LOOKUP_TABLE default" << endl; - - for (iAngle = 0; iAngle < nAngle; iAngle++) { - for (iStation = 0; iStation < nStation; iStation++) { - SurfFlow_file << ProbeArray[iAngle][iStation][4] << " "; - } - } - - SurfFlow_file <<"SCALARS Alpha float" << endl; - SurfFlow_file <<"LOOKUP_TABLE default" << endl; - - for (iAngle = 0; iAngle < nAngle; iAngle++) { - for (iStation = 0; iStation < nStation; iStation++) { - Alpha = atan(ProbeArray[iAngle][iStation][10]/ProbeArray[iAngle][iStation][8])*360.0/(2.0*PI_NUMBER); - SurfFlow_file << Alpha << " "; - } - } - - SurfFlow_file <<"SCALARS Beta float" << endl; - SurfFlow_file <<"LOOKUP_TABLE default" << endl; - - for (iAngle = 0; iAngle < nAngle; iAngle++) { - for (iStation = 0; iStation < nStation; iStation++) { - Beta = atan(ProbeArray[iAngle][iStation][9]/ProbeArray[iAngle][iStation][8])*360.0/(2.0*PI_NUMBER); - SurfFlow_file << Beta << " "; - } - } - - SurfFlow_file <<"SCALARS Mach float" << endl; - SurfFlow_file <<"LOOKUP_TABLE default" << endl; - - for (iAngle = 0; iAngle < nAngle; iAngle++) { - for (iStation = 0; iStation < nStation; iStation++) { - SurfFlow_file << ProbeArray[iAngle][iStation][7] << " "; - } - } - - SurfFlow_file <<"VECTORS Velocity float" << endl; - - for (iAngle = 0; iAngle < nAngle; iAngle++) { - for (iStation = 0; iStation < nStation; iStation++) { - SurfFlow_file << ProbeArray[iAngle][iStation][8] << " " << ProbeArray[iAngle][iStation][9] << " " << ProbeArray[iAngle][iStation][10] << " "; - } - } - - } - else { - - SurfFlow_file <<"ZONE T= \"" << Analyze_TagBound <<"\", NODES=" << nAngle*nStation << " , ELEMENTS= " << nAngle*(nStation-1) <<", DATAPACKING=POINT, ZONETYPE=FEQUADRILATERAL" << endl; - - for (iAngle = 0; iAngle < nAngle; iAngle++) { - for (iStation = 0; iStation < nStation; iStation++) { - - Alpha = atan(ProbeArray[iAngle][iStation][10]/ProbeArray[iAngle][iStation][8])*360.0/(2.0*PI_NUMBER); - Beta = atan(ProbeArray[iAngle][iStation][9]/ProbeArray[iAngle][iStation][8])*360.0/(2.0*PI_NUMBER); - - Mach_ij = ProbeArray[iAngle][iStation][7]; - if (iAngle+1 != nAngle) Mach_ip1j = ProbeArray[iAngle+1][iStation][7]; - else Mach_ip1j = ProbeArray[0][iStation][7]; - if (iAngle-1 != -1) Mach_im1j = ProbeArray[iAngle-1][iStation][7]; - else Mach_im1j = ProbeArray[nAngle-1][iStation][7]; - if (iStation+1 != nStation) Mach_ijp1 = ProbeArray[iAngle][iStation+1][7]; - else Mach_ijp1 = ProbeArray[iAngle][0][7]; - if (iStation-1 != -1) Mach_ijm1 = ProbeArray[iAngle][iStation-1][7]; - else Mach_ijm1 = ProbeArray[iAngle][nStation-1][7]; - Filtered_Mach = (4.0*Mach_ij+Mach_ip1j+Mach_im1j+Mach_ijp1+Mach_ijm1)/8.0; - - Alpha_ij = atan(ProbeArray[iAngle][iStation][10]/ProbeArray[iAngle][iStation][8])*360.0/(2.0*PI_NUMBER); - if (iAngle+1 != nAngle) Alpha_ip1j = atan(ProbeArray[iAngle+1][iStation][10]/ProbeArray[iAngle+1][iStation][8])*360.0/(2.0*PI_NUMBER); - else Alpha_ip1j = atan(ProbeArray[0][iStation][10]/ProbeArray[0][iStation][8])*360.0/(2.0*PI_NUMBER); - if (iAngle-1 != -1) Alpha_im1j = atan(ProbeArray[iAngle-1][iStation][10]/ProbeArray[iAngle-1][iStation][8])*360.0/(2.0*PI_NUMBER); - else Alpha_im1j = atan(ProbeArray[nAngle-1][iStation][10]/ProbeArray[nAngle-1][iStation][8])*360.0/(2.0*PI_NUMBER); - if (iStation+1 != nStation) Alpha_ijp1 = atan(ProbeArray[iAngle][iStation+1][10]/ProbeArray[iAngle][iStation+1][8])*360.0/(2.0*PI_NUMBER); - else Alpha_ijp1 = atan(ProbeArray[iAngle][0][10]/ProbeArray[iAngle][0][8])*360.0/(2.0*PI_NUMBER); - if (iStation-1 != -1) Alpha_ijm1 = atan(ProbeArray[iAngle][iStation-1][10]/ProbeArray[iAngle][iStation-1][8])*360.0/(2.0*PI_NUMBER); - else Alpha_ijm1 = atan(ProbeArray[iAngle][nStation-1][10]/ProbeArray[iAngle][nStation-1][8])*360.0/(2.0*PI_NUMBER); - Filtered_Alpha = (4.0*Alpha_ij+Alpha_ip1j+Alpha_im1j+Alpha_ijp1+Alpha_ijm1)/8.0; - - Beta_ij = atan(ProbeArray[iAngle][iStation][9]/ProbeArray[iAngle][iStation][8])*360.0/(2.0*PI_NUMBER); - if (iAngle+1 != nAngle) Beta_ip1j = atan(ProbeArray[iAngle+1][iStation][9]/ProbeArray[iAngle+1][iStation][8])*360.0/(2.0*PI_NUMBER); - else Beta_ip1j = atan(ProbeArray[0][iStation][9]/ProbeArray[0][iStation][8])*360.0/(2.0*PI_NUMBER); - if (iAngle-1 != -1) Beta_im1j = atan(ProbeArray[iAngle-1][iStation][9]/ProbeArray[iAngle-1][iStation][8])*360.0/(2.0*PI_NUMBER); - else Beta_im1j = atan(ProbeArray[nAngle-1][iStation][9]/ProbeArray[nAngle-1][iStation][8])*360.0/(2.0*PI_NUMBER); - if (iStation+1 != nStation) Beta_ijp1 = atan(ProbeArray[iAngle][iStation+1][9]/ProbeArray[iAngle][iStation+1][8])*360.0/(2.0*PI_NUMBER); - else Beta_ijp1 = atan(ProbeArray[iAngle][0][9]/ProbeArray[iAngle][0][8])*360.0/(2.0*PI_NUMBER); - if (iStation-1 != -1) Beta_ijm1 = atan(ProbeArray[iAngle][iStation-1][9]/ProbeArray[iAngle][iStation-1][8])*360.0/(2.0*PI_NUMBER); - else Beta_ijm1 = atan(ProbeArray[iAngle][nStation-1][9]/ProbeArray[iAngle][nStation-1][8])*360.0/(2.0*PI_NUMBER); - Filtered_Beta = (4.0*Beta_ij+Beta_ip1j+Beta_im1j+Beta_ijp1+Beta_ijm1)/8.0; - - - SurfFlow_file - << " " << ProbeArray[iAngle][iStation][1]-yCoord_CG - <<" " << ProbeArray[iAngle][iStation][2]-zCoord_CG - <<" " << ProbeArray[iAngle][iStation][3] <<" " << ProbeArray[iAngle][iStation][4] - <<" " << ProbeArray[iAngle][iStation][5] <<" " << ProbeArray[iAngle][iStation][6] - <<" " << ProbeArray[iAngle][iStation][8] <<" " << ProbeArray[iAngle][iStation][9] - <<" " << ProbeArray[iAngle][iStation][10] - <<" " << Alpha <<" " << Beta << " " << ProbeArray[iAngle][iStation][7] - <<" " << Filtered_Alpha <<" " << Filtered_Beta << " " << Filtered_Mach << endl; - - } - } - - for (iAngle = 0; iAngle < nAngle; iAngle++) { - for (iStation = 0; iStation < nStation-1; iStation++) { - a = iAngle*nStation+iStation; b = a + nStation; c = b+1; d = a +1; - if (iAngle == nAngle-1) { b = iStation; c = b+1; } - SurfFlow_file << a+1 <<" "<< b+1 <<" "<< c+1 <<" "<< d+1 << endl; - } - } - - /*--- Add extra info ---*/ - - SurfFlow_file << "TEXT X=14, Y=86, F=HELV-BOLD, C=BLUE, H=2.0, "; - unsigned short RackProbes = SU2_TYPE::Int(config->GetDistortionRack()[0]); - unsigned short RackAngle = SU2_TYPE::Int(config->GetDistortionRack()[1]); - SurfFlow_file << "T=\"Rack Size: " << RackProbes << " probes at "<< RackAngle << "deg." << "\\" << "\\n"; - SurfFlow_file << "Mach " << config->GetMach() << ", Reynolds " << config->GetReynolds() << ", a " - << config->GetAoA() << "deg, b " << config->GetAoS() << "deg." << "\\" << "\\n"; - SurfFlow_file.precision(1); - SurfFlow_file << fixed << "Net Thrust " << solver->GetTotal_NetThrust() << "lbs, Power " << solver->GetTotal_Power() << "HP"; - SurfFlow_file.precision(4); - SurfFlow_file << ", MassFlow " << config->GetSurface_MassFlow(iMarker_Analyze) << ",\\" << "\\n"; - SurfFlow_file << "IDC " << config->GetSurface_IDC(iMarker_Analyze)*100 << "%, IDCM " << config->GetSurface_IDC_Mach(iMarker_Analyze)*100 << "%, IDR " << config->GetSurface_IDR(iMarker_Analyze)*100 << "%,\\" << "\\n"; - SurfFlow_file << "DC60 " << config->GetSurface_DC60(iMarker_Analyze) << ".\"" << endl; - - } - - } - - /*--- Release the recv buffers on the master node ---*/ - - delete [] Buffer_Recv_Coord_x; - delete [] Buffer_Recv_Coord_y; - if (nDim == 3) delete [] Buffer_Recv_Coord_z; - - delete [] Buffer_Recv_PT; - delete [] Buffer_Recv_TT; - delete [] Buffer_Recv_P; - delete [] Buffer_Recv_T; - delete [] Buffer_Recv_Mach; - delete [] Buffer_Recv_Vel_x; - delete [] Buffer_Recv_Vel_y; - if (nDim == 3) delete [] Buffer_Recv_Vel_z; - delete [] Buffer_Recv_q; - - delete [] Buffer_Recv_Area; - - delete [] Buffer_Recv_nVertex; - - delete[] r; - for (iAngle = 0; iAngle < nAngle; iAngle++) { - for (iStation = 0; iStation < nStation; iStation++) { - delete[] ProbeArray[iAngle][iStation]; - } - } - delete[] ProbeArray; - - } - -// if ((rank == MASTER_NODE) && !config->GetDiscrete_Adjoint()) { -// -// cout << "Surface ("<< Analyze_TagBound << "): "; -// cout.precision(4); -// cout.setf(ios::fixed, ios::floatfield); -// cout << setprecision(1) << "IDC " << 100*config->GetSurface_IDC(iMarker_Analyze) -// << "%. IDC Mach " << 100*config->GetSurface_IDC_Mach(iMarker_Analyze) -// << "%. IDR " << 100*config->GetSurface_IDR(iMarker_Analyze) -// << "%. DC60 " << config->GetSurface_DC60(iMarker_Analyze) << "." << endl; -// -// } - - /*--- Release the memory for the remaining buffers and exit ---*/ - - delete [] Buffer_Send_Coord_x; - delete [] Buffer_Send_Coord_y; - if (nDim == 3) delete [] Buffer_Send_Coord_z; - - delete [] Buffer_Send_PT; - delete [] Buffer_Send_TT; - delete [] Buffer_Send_P; - delete [] Buffer_Send_T; - delete [] Buffer_Send_Mach; - delete [] Buffer_Send_Vel_x; - delete [] Buffer_Send_Vel_y; - if (nDim == 3) delete [] Buffer_Send_Vel_z; - delete [] Buffer_Send_q; - - delete [] Buffer_Send_Area; - - } - - /*--- Close the tecplot file ---*/ - - if (output) { - SurfFlow_file.close(); - } - -} - -void COutputLegacy::WriteTurboPerfConvHistory(CConfig *config){ - - unsigned short iMarker_Monitoring; - string inMarker_Tag, outMarker_Tag, inMarkerTag_Mix; - unsigned short nZone = config->GetnZone(); - bool turbulent = ((config->GetKind_Solver() == MAIN_SOLVER::RANS) || (config->GetKind_Solver() == MAIN_SOLVER::DISC_ADJ_RANS)); - bool menter_sst = (config->GetKind_Turb_Model() == TURB_MODEL::SST); - - unsigned short nBladesRow, nStages; - unsigned short iStage; - nBladesRow = config->GetnMarker_Turbomachinery(); - nStages = SU2_TYPE::Int(nBladesRow/2); - - cout << endl << "------------------------- Turbomachinery Summary ------------------------" << endl; - cout << endl; - for (iMarker_Monitoring = 0; iMarker_Monitoring < config->GetnMarker_Turbomachinery(); iMarker_Monitoring++){ - cout << endl << "----------------------------- Blade " << iMarker_Monitoring + 1 << " -----------------------------------" << endl; - inMarker_Tag = config->GetMarker_TurboPerf_BoundIn(iMarker_Monitoring); - outMarker_Tag = config->GetMarker_TurboPerf_BoundOut(iMarker_Monitoring); - if(iMarker_Monitoring == 0){ - cout << "BC Inlet convergence monitoring marker " << inMarker_Tag << " : "<GetnSpan_iZones(iMarker_Monitoring)]*config->GetEnergy_Ref(); - cout.width(25); cout << TotalEnthalpyIn_BC[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]*config->GetEnergy_Ref(); - cout.width(25); cout << abs((TotalEnthalpyIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)] - TotalEnthalpyIn_BC[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)])/TotalEnthalpyIn_BC[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)])*100.0; - cout << endl; - cout << endl; - cout << " Inlet Entropy" << " Inlet Entropy BC" << " err(%)" << endl; - cout.width(25); cout << EntropyIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]*config->GetEnergy_Ref()/config->GetTemperature_Ref(); - cout.width(25); cout << EntropyIn_BC[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]*config->GetEnergy_Ref()/config->GetTemperature_Ref(); - cout.width(25); cout << abs((EntropyIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)] - EntropyIn_BC[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)])/EntropyIn_BC[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)])*100.0; - cout << endl; - cout << endl; - cout << " Inlet Absolute Angle" << " Inlet Absolute Angle BC" << " err(%)" << endl; - cout.width(25); cout << 180.0/PI_NUMBER*AbsFlowAngleIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]; - cout.width(25); cout << 180.0/PI_NUMBER*FlowAngleIn_BC[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]; - cout.width(25); cout << abs((AbsFlowAngleIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)] - FlowAngleIn_BC[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)])/FlowAngleIn_BC[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)])*100.0; - cout << endl; - cout << endl; - if(turbulent){ - if(menter_sst){ - cout << " Inlet TurbIntensity" << " Inlet TurbIntensity BC" << " err(%)" << endl; - cout.width(25); cout << TurbIntensityIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]; - cout.width(25); cout << config->GetTurbulenceIntensity_FreeStream(); - cout.width(25); cout << abs((TurbIntensityIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)] - config->GetTurbulenceIntensity_FreeStream())/config->GetTurbulenceIntensity_FreeStream())*100.0; - cout << endl; - cout << endl; - cout << " Inlet Turb2LamRatio" << " Inlet Turb2LamRatio BC" << " err(%)" << endl; - cout.width(25); cout << Turb2LamViscRatioIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]; - cout.width(25); cout << config->GetTurb2LamViscRatio_FreeStream(); - cout.width(25); cout << abs((Turb2LamViscRatioIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)] - config->GetTurb2LamViscRatio_FreeStream())/config->GetTurb2LamViscRatio_FreeStream())*100.0; - cout << endl; - cout << endl; - } - else{ - cout << " Inlet Nu Factor" << " Inlet Nu Factor BC" << " err(%)" << endl; - cout.width(25); cout << NuFactorIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]; - cout.width(25); cout << config->GetNuFactor_FreeStream(); - cout.width(25); cout << abs((NuFactorIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)] - config->GetNuFactor_FreeStream())/config->GetNuFactor_FreeStream())*100.0; - cout << endl; - cout << endl; - } - } - } - if(iMarker_Monitoring == config->GetnMarker_Turbomachinery() -1 ){ - // if BC outlet - cout << "BC outlet convergence monitoring marker " << outMarker_Tag << " : "<GetnSpan_iZones(iMarker_Monitoring)]*config->GetPressure_Ref(); - cout.width(25); cout << PressureOut_BC[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]*config->GetPressure_Ref(); - cout.width(25); cout << abs((PressureOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)] - PressureOut_BC[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)])/PressureOut_BC[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)])*100.0; - cout << endl; - cout << endl; - } - - cout << "Convergence monitoring for integral quantities between markers " << inMarker_Tag << " and "<< outMarker_Tag << " : "<GetnSpan_iZones(iMarker_Monitoring)]*config->GetVelocity_Ref()*config->GetDensity_Ref(); - cout.width(25); cout << MassFlowOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]*config->GetVelocity_Ref()*config->GetDensity_Ref(); - cout.width(25); cout << abs((MassFlowIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)] - MassFlowOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)])/MassFlowIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)])*100.0; - cout << endl; - cout << endl; - //if(stator) - //cout << " Inlet Total Enthalpy " << " Outlet Total Enthalpy" << " err(%)" << endl; - //else - cout << " Inlet Total Rothalpy " << " Outlet Total Rothalpy" << " err(%)" << endl; - cout.width(25); cout << RothalpyIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]*config->GetEnergy_Ref(); - cout.width(25); cout << RothalpyOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]*config->GetEnergy_Ref(); - cout.width(25); cout << abs((RothalpyIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)] - RothalpyOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)])/RothalpyIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)])*100.0; - cout << endl; - cout << endl; - cout << "Blade performance between boundaries " << inMarker_Tag << " and "<< outMarker_Tag << " : "<GetnSpan_iZones(iMarker_Monitoring)]*100.0; - cout.width(25); cout << KineticEnergyLoss[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]*100.0; - cout.width(25); cout << EntropyGen[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]*100.0; - cout << endl; - cout << endl; - cout << " Total Inlet Enthalpy" << " Eulerian Work" << " Pressure Ratio" << endl; - cout.width(25); cout << TotalEnthalpyIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]*config->GetEnergy_Ref(); - cout.width(25); cout << EulerianWork[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]*config->GetEnergy_Ref(); - cout.width(25); cout << PressureRatio[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]; - cout << endl; - cout << endl; - cout << " Inlet Entropy" << " Outlet Entropy" << " Outlet Is. Enthalpy" << endl; - cout.width(25); cout << EntropyIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]*config->GetEnergy_Ref()/config->GetTemperature_Ref(); - cout.width(25); cout << EntropyOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]*config->GetEnergy_Ref()/config->GetTemperature_Ref(); - cout.width(25); cout << EnthalpyOutIs[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]*config->GetEnergy_Ref(); - cout << endl; - cout << endl; - cout << "Cinematic quantities between boundaries " << inMarker_Tag << " and "<< outMarker_Tag << " : "<GetnSpan_iZones(iMarker_Monitoring)][0]*MachIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)][0] +MachIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)][1]*MachIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)][1]); - cout.width(25); cout << MachIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)][0]; - cout.width(25); cout << MachIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)][1]; - cout << endl; - cout << endl; - cout << " Outlet Mach"<< " Outlet Normal Mach" << " Outlet Tang. Mach" << endl; - cout.width(25); cout << sqrt(MachOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)][0]*MachOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)][0] +MachOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)][1]*MachOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)][1]); - cout.width(25); cout << MachOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)][0]; - cout.width(25); cout << MachOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)][1];cout << endl; - cout << endl; - cout << " Inlet Flow Angle" << " Outlet flow Angle " << endl; - cout.width(25); cout << 180.0/PI_NUMBER*FlowAngleIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]; - cout.width(25); cout << 180.0/PI_NUMBER*FlowAngleOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]; - cout << endl; - cout << endl; - // if gridmov - cout << " Inlet Abs Flow Angle" << " Outlet Abs Flow Angle " << endl; - cout.width(25); cout << 180.0/PI_NUMBER*AbsFlowAngleIn[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]; - cout.width(25); cout << 180.0/PI_NUMBER*AbsFlowAngleOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]; - cout << endl; - cout << endl << "-------------------------------------------------------------------------" << endl; - cout << endl; - if(nZone > 0 && iMarker_Monitoring < config->GetnMarker_Turbomachinery() -1){ - cout << endl << "---------- Mixing-Plane Interface between Blade " << iMarker_Monitoring + 1 << " and Blade " << iMarker_Monitoring + 2 << " -----------" << endl; - cout << endl; - inMarkerTag_Mix = config->GetMarker_TurboPerf_BoundIn(iMarker_Monitoring + 1); - cout << "Convergence monitoring for the outlet " << outMarker_Tag << " and the inlet "<< inMarkerTag_Mix << " : "<GetnSpan_iZones(iMarker_Monitoring)]*config->GetDensity_Ref(); - cout.width(25); cout << DensityIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring + 1)]*config->GetDensity_Ref(); - cout.width(25); cout << abs((DensityIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring +1)] - DensityOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)])/DensityIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring +1)])*100.0; - cout << endl; - cout << endl; - cout << " Outlet Pressure " << " Inlet Pressure" << " err(%)" << endl; - cout.width(25); cout << PressureOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]*config->GetPressure_Ref(); - cout.width(25); cout << PressureIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring +1)]*config->GetPressure_Ref(); - cout.width(25); cout << abs((PressureIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring +1)] - PressureOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)])/PressureIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring +1)])*100.0; - cout << endl; - cout << endl; - cout << " Outlet Normal Velocity " << " Inlet Normal Velocity" << " err(%)" << endl; - cout.width(25); cout << TurboVelocityOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)][0]*config->GetVelocity_Ref(); - cout.width(25); cout << TurboVelocityIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring +1)][0]*config->GetVelocity_Ref(); - cout.width(25); cout << abs((TurboVelocityIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring +1)][0] - TurboVelocityOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)][0])/TurboVelocityIn[iMarker_Monitoring+1][config->GetnSpan_iZones(iMarker_Monitoring +1)][0])*100.0; - cout << endl; - cout << endl; - cout << " Outlet Tang. Velocity " << " Inlet Tang. Velocity" << " err(%)" << endl; - cout.width(25); cout << TurboVelocityOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)][1]*config->GetVelocity_Ref(); - cout.width(25); cout << TurboVelocityIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring +1)][1]*config->GetVelocity_Ref(); - cout.width(25); cout << abs((TurboVelocityIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring +1)][1] - TurboVelocityOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)][1])/TurboVelocityIn[iMarker_Monitoring+1][config->GetnSpan_iZones(iMarker_Monitoring +1)][1])*100.0; - cout << endl; - cout << endl; - cout << " Outlet Entropy " << " Inlet Entropy" << " err(%)" << endl; - cout.width(25); cout << EntropyOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]*config->GetEnergy_Ref()/config->GetTemperature_Ref(); - cout.width(25); cout << EntropyIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring +1)]*config->GetEnergy_Ref()/config->GetTemperature_Ref(); - cout.width(25); cout << abs((EntropyIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring+1)] - EntropyOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)])/EntropyIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring+1)])*100.0; - if(turbulent){ - cout << endl; - cout << endl; - if(menter_sst){ - cout << " Outlet TurbIntensity " << " Inlet TurbIntensity" << " err(%)" << endl; - cout.width(25); cout << TurbIntensityOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]; - cout.width(25); cout << TurbIntensityIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring +1)]; - cout.width(25); cout << abs((TurbIntensityIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring+1)] - TurbIntensityOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)])/TurbIntensityIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring+1)])*100.0; - cout << endl; - cout << endl; - cout << " Outlet Turb2LamRatio " << " Inlet Turb2LamRatio" << " err(%)" << endl; - cout.width(25); cout << Turb2LamViscRatioOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]; - cout.width(25); cout << Turb2LamViscRatioIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring +1)]; - cout.width(25); cout << abs((Turb2LamViscRatioIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring+1)] - Turb2LamViscRatioOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)])/Turb2LamViscRatioIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring+1)])*100.0; - } - else{ - cout << " Outlet Nu Factor " << " Inlet Nu Factor" << " err(%)" << endl; - cout.width(25); cout << NuFactorOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)]; - cout.width(25); cout << NuFactorIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring +1)]; - cout.width(25); cout << abs((NuFactorIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring+1)] - NuFactorOut[iMarker_Monitoring][config->GetnSpan_iZones(iMarker_Monitoring)])/NuFactorIn[iMarker_Monitoring + 1][config->GetnSpan_iZones(iMarker_Monitoring+1)])*100.0; - } - } - cout << endl; - cout << endl << "-------------------------------------------------------------------------" << endl; - cout << endl; - } - - } - if(nZone > 1){ - /*--- Stage Performance ---*/ - for(iStage = 0; iStage < nStages; iStage++ ){ - cout << endl << "----------------------------- Stage " << iStage + 1 << " -----------------------------------" << endl; - inMarker_Tag = config->GetMarker_TurboPerf_BoundIn(iStage*2); - outMarker_Tag = config->GetMarker_TurboPerf_BoundOut(iStage*2+1); - cout << "Stage performance between boundaries " << inMarker_Tag << " and "<< outMarker_Tag << " : "<GetEnergy_Ref(); - cout.width(25); cout << abs((MassFlowIn[nBladesRow + iStage][nSpanWiseSections] - MassFlowOut[nBladesRow + iStage][nSpanWiseSections])/MassFlowIn[nBladesRow + iStage][nSpanWiseSections])*100.0; - } - cout << endl; - cout << endl << "-------------------------------------------------------------------------" << endl; - cout << endl; - - /*--- Full Machine Performance ---*/ - // if(turbine) - cout << endl << "---------------------------- Turbine ------------------------------------" << endl; - inMarker_Tag = config->GetMarker_TurboPerf_BoundIn(0); - outMarker_Tag = config->GetMarker_TurboPerf_BoundOut(nBladesRow-1); - cout << "Turbine performance between boundaries " << inMarker_Tag << " and "<< outMarker_Tag << " : "<GetEnergy_Ref();; - cout.width(25); cout << abs((MassFlowIn[nBladesRow + nStages][nSpanWiseSections] - MassFlowOut[nBladesRow + nStages][nSpanWiseSections])/MassFlowIn[nBladesRow + nStages][nSpanWiseSections])*100.0; - cout << endl; - cout << endl << "-------------------------------------------------------------------------" << endl; - cout << endl; - } - -} - -void COutputLegacy::SpecialOutput_Turbo(CSolver *****solver, CGeometry ****geometry, CConfig **config, - unsigned short val_iZone, bool output) { - - string inMarker_Tag, outMarker_Tag, inMarkerTag_Mix; - unsigned short nZone = config[val_iZone]->GetnZone(); - - unsigned short iDim, iSpan; - - unsigned long iExtIter = config[val_iZone]->GetInnerIter(); - const su2double* SpanWiseValuesIn, *SpanWiseValuesOut; - ofstream myfile; - string spanwise_performance_filename; - - - /*--- Start of write file turboperformance spanwise ---*/ - if (rank == MASTER_NODE){ - SpanWiseValuesIn = geometry[val_iZone][INST_0][MESH_0]->GetSpanWiseValue(1); - SpanWiseValuesOut = geometry[val_iZone][INST_0][MESH_0]->GetSpanWiseValue(2); - - - - /*--- Writing Span wise inflow thermodynamic quantities. ---*/ - spanwise_performance_filename = "TURBOMACHINERY/inflow_spanwise_thermodynamic_values.dat"; - char buffer[50]; - if (nZone > 1){ - unsigned short lastindex = spanwise_performance_filename.find_last_of("."); - spanwise_performance_filename = spanwise_performance_filename.substr(0, lastindex); - SPRINTF (buffer, "_%d.dat", SU2_TYPE::Int(val_iZone)); - spanwise_performance_filename.append(string(buffer)); - } - - - myfile.open (spanwise_performance_filename.data(), ios::out | ios::trunc); - myfile.setf(ios::scientific); - myfile.precision(12); - - myfile << "TITLE = \"Inflow Spanwise Thermodynamic Values. iExtIter = " << iExtIter << " \"" << endl; - myfile << "VARIABLES =" << endl; - - myfile.width(30); myfile << "\"SpanWise Value[m]\""; - myfile.width(15); myfile << "\"iSpan\""; - myfile.width(30); myfile << "\"Pressure[Pa]\""; - myfile.width(30); myfile << "\"TotalPressure[Pa]\""; - myfile.width(30); myfile << "\"Temperature[K]\""; - myfile.width(30); myfile << "\"TotalTemperature[K]\""; - myfile.width(30); myfile << "\"Enthalpy[J]\""; - myfile.width(30); myfile << "\"TotalEnthalpy[J]\""; - myfile.width(30); myfile << "\"Density[kg/m3]\""; - myfile.width(30); myfile << "\"Entropy[J/K]\""; - myfile.width(30); myfile << "\"TurbIntensity[-]\""; - myfile.width(30); myfile << "\"Turb2LamViscRatio[-]\""; - myfile.width(30); myfile << "\"NuFactor[-]\""; - myfile << endl; - - for(iSpan = 0; iSpan < config[ZONE_0]->GetnSpan_iZones(val_iZone); iSpan++){ - - myfile.width(30); myfile << SpanWiseValuesIn[iSpan]; - myfile.width(15); myfile << iSpan; - myfile.width(30); myfile << PressureIn [val_iZone][iSpan]*config[ZONE_0]->GetPressure_Ref(); - myfile.width(30); myfile << TotalPressureIn [val_iZone][iSpan]*config[ZONE_0]->GetPressure_Ref(); - myfile.width(30); myfile << TemperatureIn [val_iZone][iSpan]*config[ZONE_0]->GetTemperature_Ref(); - myfile.width(30); myfile << TotalTemperatureIn [val_iZone][iSpan]*config[ZONE_0]->GetTemperature_Ref(); - myfile.width(30); myfile << EnthalpyIn [val_iZone][iSpan]*config[ZONE_0]->GetEnergy_Ref(); - myfile.width(30); myfile << TotalEnthalpyIn [val_iZone][iSpan]*config[ZONE_0]->GetEnergy_Ref(); - myfile.width(30); myfile << DensityIn [val_iZone][iSpan]*config[ZONE_0]->GetDensity_Ref(); - myfile.width(30); myfile << EntropyIn [val_iZone][iSpan]*config[ZONE_0]->GetEnergy_Ref()/config[ZONE_0]->GetTemperature_Ref(); - if(TurbIntensityIn[val_iZone][iSpan] > 1.0){ - myfile.width(30); myfile << TurbIntensityIn [val_iZone][config[ZONE_0]->GetnSpan_iZones(val_iZone)/2]; - }else{ - myfile.width(30); myfile << TurbIntensityIn [val_iZone][iSpan]; - } - myfile.width(30); myfile << Turb2LamViscRatioIn [val_iZone][iSpan]; - myfile.width(30); myfile << NuFactorIn [val_iZone][iSpan]; - myfile << endl; - } - - myfile.close(); - - /*--- Writing Span wise outflow thermodynamic quantities. ---*/ - spanwise_performance_filename = "TURBOMACHINERY/outflow_spanwise_thermodynamic_values.dat"; - if (nZone > 1){ - unsigned short lastindex = spanwise_performance_filename.find_last_of("."); - spanwise_performance_filename = spanwise_performance_filename.substr(0, lastindex); - SPRINTF (buffer, "_%d.dat", SU2_TYPE::Int(val_iZone)); - spanwise_performance_filename.append(string(buffer)); - } - - myfile.open (spanwise_performance_filename.data(), ios::out | ios::trunc); - myfile.setf(ios::scientific); - myfile.precision(12); - - myfile << "TITLE = \"Outflow Span-wise Thermodynamic Values. iExtIter = " << iExtIter << " \"" << endl; - myfile << "VARIABLES =" << endl; - - myfile.width(30); myfile << "\"SpanWise Value[m]\""; - myfile.width(15); myfile << "\"iSpan\""; - myfile.width(30); myfile << "\"Pressure[Pa]\""; - myfile.width(30); myfile << "\"TotalPressure[Pa]\""; - myfile.width(30); myfile << "\"Temperature[K]\""; - myfile.width(30); myfile << "\"TotalTemperature[K]\""; - myfile.width(30); myfile << "\"Enthalpy[J]\""; - myfile.width(30); myfile << "\"TotalEnthalpy[J]\""; - myfile.width(30); myfile << "\"Density[kg/m3]\""; - myfile.width(30); myfile << "\"Entropy[J/K]\""; - myfile.width(30); myfile << "\"TurbIntensity[-]\""; - myfile.width(30); myfile << "\"Turb2LamViscRatio[-]\""; - myfile.width(30); myfile << "\"NuFactor[-]\""; - myfile << endl; - - - for(iSpan = 0; iSpan < config[ZONE_0]->GetnSpan_iZones(val_iZone); iSpan++){ - - myfile.width(30); myfile << SpanWiseValuesOut[iSpan]; - myfile.width(15); myfile << iSpan; - myfile.width(30); myfile << PressureOut [val_iZone][iSpan]*config[ZONE_0]->GetPressure_Ref(); - myfile.width(30); myfile << TotalPressureOut [val_iZone][iSpan]*config[ZONE_0]->GetPressure_Ref(); - myfile.width(30); myfile << TemperatureOut [val_iZone][iSpan]*config[ZONE_0]->GetTemperature_Ref(); - myfile.width(30); myfile << TotalTemperatureOut [val_iZone][iSpan]*config[ZONE_0]->GetTemperature_Ref(); - myfile.width(30); myfile << EnthalpyOut [val_iZone][iSpan]*config[ZONE_0]->GetEnergy_Ref(); - myfile.width(30); myfile << TotalEnthalpyOut [val_iZone][iSpan]*config[ZONE_0]->GetEnergy_Ref(); - myfile.width(30); myfile << DensityOut [val_iZone][iSpan]*config[ZONE_0]->GetDensity_Ref(); - myfile.width(30); myfile << EntropyOut [val_iZone][iSpan]*config[ZONE_0]->GetEnergy_Ref()/config[ZONE_0]->GetTemperature_Ref(); - if(TurbIntensityOut[val_iZone][iSpan] > 1.0){ - myfile.width(30); myfile << TurbIntensityOut [val_iZone][config[ZONE_0]->GetnSpan_iZones(val_iZone)/2]; - }else{ - myfile.width(30); myfile << TurbIntensityOut [val_iZone][iSpan]; - } - myfile.width(30); myfile << Turb2LamViscRatioOut [val_iZone][iSpan]; - myfile.width(30); myfile << NuFactorOut [val_iZone][iSpan]; - myfile << endl; - } - - myfile.close(); - - /*--- Writing Span wise inflow kinematic quantities. ---*/ - spanwise_performance_filename = "TURBOMACHINERY/inflow_spanwise_kinematic_values.dat"; - if (nZone > 1){ - unsigned short lastindex = spanwise_performance_filename.find_last_of("."); - spanwise_performance_filename = spanwise_performance_filename.substr(0, lastindex); - SPRINTF (buffer, "_%d.dat", SU2_TYPE::Int(val_iZone)); - spanwise_performance_filename.append(string(buffer)); - } - - myfile.open (spanwise_performance_filename.data(), ios::out | ios::trunc); - myfile.setf(ios::scientific); - myfile.precision(12); - - myfile << "TITLE = \"Inflow Span-wise Kinematic Values. iExtIter = " << iExtIter << " \"" << endl; - myfile << "VARIABLES =" << endl; - - myfile.width(30); myfile << "\"SpanWise Value[m]\""; - myfile.width(15); myfile << "\"iSpan\""; - myfile.width(30); myfile << "\"Normal Mach[-]\""; - myfile.width(30); myfile << "\"Tangential Mach[-]\""; - myfile.width(30); myfile << "\"3rd Component Mach[-]\""; - myfile.width(30); myfile << "\"Mach Module[-]\""; - myfile.width(30); myfile << "\"Normal Velocity[m/s]\""; - myfile.width(30); myfile << "\"Tangential Velocity[m/s]\""; - myfile.width(30); myfile << "\"3rd Component Velocity[m/s]\""; - myfile.width(30); myfile << "\"Velocity Module[m/s]\""; - myfile.width(30); myfile << "\"Absolute Flow Angle[deg]\""; - myfile.width(30); myfile << "\"Relative Flow Angle[deg]\""; - myfile << endl; - - - for(iSpan = 0; iSpan < config[ZONE_0]->GetnSpan_iZones(val_iZone); iSpan++){ - - myfile.width(30); myfile << SpanWiseValuesIn[iSpan]; - myfile.width(15); myfile << iSpan; - for (iDim = 0; iDim < 4; iDim++){ - myfile.width(30); myfile << MachIn [val_iZone][iSpan][iDim]; - } - for (iDim = 0; iDim < 4; iDim++){ - myfile.width(30); myfile << TurboVelocityIn [val_iZone][iSpan][iDim]*config[ZONE_0]->GetVelocity_Ref(); - } - if(AbsFlowAngleIn[val_iZone][iSpan] != AbsFlowAngleIn[val_iZone][iSpan]){ - myfile.width(30); myfile << "0.0000"; - } - else{ - myfile.width(30); myfile << AbsFlowAngleIn [val_iZone][iSpan]*180.0/PI_NUMBER; - } - if(FlowAngleIn[val_iZone][iSpan] != FlowAngleIn[val_iZone][iSpan]){ - myfile.width(30); myfile << "0.0000"; - } - else{ - myfile.width(30); myfile << FlowAngleIn [val_iZone][iSpan]*180.0/PI_NUMBER; - } - myfile << endl; - } - - myfile.close(); - - /*--- Writing Span wise outflow thermodynamic quantities. ---*/ - spanwise_performance_filename = "TURBOMACHINERY/outflow_spanwise_kinematic_values.dat"; - if (nZone > 1){ - unsigned short lastindex = spanwise_performance_filename.find_last_of("."); - spanwise_performance_filename = spanwise_performance_filename.substr(0, lastindex); - SPRINTF (buffer, "_%d.dat", SU2_TYPE::Int(val_iZone)); - spanwise_performance_filename.append(string(buffer)); - } - - myfile.open (spanwise_performance_filename.data(), ios::out | ios::trunc); - myfile.setf(ios::scientific); - myfile.precision(12); - - myfile << "TITLE = \"Outflow Span-wise Kinematic Values. iExtIter = " << iExtIter << " \"" << endl; - myfile << "VARIABLES =" << endl; - - myfile.width(30); myfile << "\"SpanWise Value[m]\""; - myfile.width(15); myfile << "\"iSpan\""; - myfile.width(30); myfile << "\"Normal Mach[-]\""; - myfile.width(30); myfile << "\"Tangential Mach[-]\""; - myfile.width(30); myfile << "\"3rd Component Mach[-]\""; - myfile.width(30); myfile << "\"Mach Module[-]\""; - myfile.width(30); myfile << "\"Normal Velocity[m/s]\""; - myfile.width(30); myfile << "\"Tangential Velocity[m/s]\""; - myfile.width(30); myfile << "\"3rd Component Velocity[m/s]\""; - myfile.width(30); myfile << "\"Velocity Module[m/s]\""; - myfile.width(30); myfile << "\"Absolute Flow Angle[deg]\""; - myfile.width(30); myfile << "\"Relative Flow Angle[deg]\""; - myfile << endl; - - - for(iSpan = 0; iSpan < config[ZONE_0]->GetnSpan_iZones(val_iZone); iSpan++){ - - myfile.width(30); myfile << SpanWiseValuesOut[iSpan]; - myfile.width(15); myfile << iSpan; - for (iDim = 0; iDim < 4; iDim++){ - myfile.width(30); myfile << MachOut [val_iZone][iSpan][iDim]; - } - for (iDim = 0; iDim < 4; iDim++){ - myfile.width(30); myfile << TurboVelocityOut [val_iZone][iSpan][iDim]*config[ZONE_0]->GetVelocity_Ref(); - } - if(AbsFlowAngleOut[val_iZone][iSpan] != AbsFlowAngleOut[val_iZone][iSpan]){ - myfile.width(30); myfile << "0.0000"; - } - else{ - myfile.width(30); myfile << AbsFlowAngleOut [val_iZone][iSpan]*180.0/PI_NUMBER; - } - if(FlowAngleOut[val_iZone][iSpan] != FlowAngleOut[val_iZone][iSpan]){ - myfile.width(30); myfile << "0.0000"; - } - else{ - myfile.width(30); myfile << FlowAngleOut [val_iZone][iSpan]*180.0/PI_NUMBER; - } - myfile << endl; - } - - myfile.close(); - - } -} - -void COutputLegacy::SpecialOutput_HarmonicBalance(CSolver *****solver, CGeometry ****geometry, CConfig **config, unsigned short iInst, unsigned short val_nInst, bool output) const { - - /*--- Write file with flow quantities for harmonic balance HB ---*/ - ofstream HB_output_file; - ofstream mean_HB_file; - - /*--- MPI Send/Recv buffers ---*/ - su2double *sbuf_var = nullptr, *rbuf_var = nullptr; - - /*--- Other variables ---*/ - unsigned short iVar, kInst; - unsigned short nVar_output = 5; - unsigned long current_iter = config[ZONE_0]->GetInnerIter(); - - /*--- Allocate memory for send buffer ---*/ - sbuf_var = new su2double[nVar_output]; - - su2double *averages = new su2double[nVar_output]; - for (iVar = 0; iVar < nVar_output; iVar++) - averages[iVar] = 0; - - /*--- Allocate memory for receive buffer ---*/ - if (rank == MASTER_NODE) { - rbuf_var = new su2double[nVar_output]; - - HB_output_file.precision(15); - HB_output_file.open("HB_output.csv", ios::out); - HB_output_file << "\"time_instance\",\"CL\",\"CD\",\"CMx\",\"CMy\",\"CMz\"" << endl; - - mean_HB_file.precision(15); - if (current_iter == 0 && iInst == 1) { - mean_HB_file.open("history_HB.plt", ios::trunc); - mean_HB_file << "TITLE = \"SU2 HARMONIC BALANCE SIMULATION\"" << endl; - mean_HB_file << "VARIABLES = \"Iteration\",\"CL\",\"CD\",\"CMx\",\"CMy\",\"CMz\",\"CT\",\"CQ\",\"CMerit\"" << endl; - mean_HB_file << "ZONE T= \"Average Convergence History\"" << endl; - } - else - mean_HB_file.open("history_HB.plt", ios::out | ios::app); - } - - if (rank == MASTER_NODE) { - - /*--- Run through the zones, collecting the output variables - N.B. Summing across processors within a given zone is being done - elsewhere. ---*/ - for (kInst = 0; kInst < val_nInst; kInst++) { - - /*--- Flow solution coefficients (parallel) ---*/ - sbuf_var[0] = solver[ZONE_0][kInst][MESH_0][FLOW_SOL]->GetTotal_CL(); - sbuf_var[1] = solver[ZONE_0][kInst][INST_0][FLOW_SOL]->GetTotal_CD(); - sbuf_var[2] = solver[ZONE_0][kInst][INST_0][FLOW_SOL]->GetTotal_CMx(); - sbuf_var[3] = solver[ZONE_0][kInst][INST_0][FLOW_SOL]->GetTotal_CMy(); - sbuf_var[4] = solver[ZONE_0][kInst][INST_0][FLOW_SOL]->GetTotal_CMz(); - - for (iVar = 0; iVar < nVar_output; iVar++) { - rbuf_var[iVar] = sbuf_var[iVar]; - } - - HB_output_file << kInst << ", "; - for (iVar = 0; iVar < nVar_output; iVar++) - HB_output_file << rbuf_var[iVar] << ", "; - HB_output_file << endl; - - /*--- Increment the total contributions from each zone, dividing by nZone as you go ---*/ - for (iVar = 0; iVar < nVar_output; iVar++) { - averages[iVar] += (1.0/su2double(val_nInst))*rbuf_var[iVar]; - } - } - } - - if (rank == MASTER_NODE && iInst == INST_0) { - - mean_HB_file << current_iter << ", "; - for (iVar = 0; iVar < nVar_output; iVar++) { - mean_HB_file << averages[iVar]; - if (iVar < nVar_output-1) - mean_HB_file << ", "; - } - mean_HB_file << endl; - } - - if (rank == MASTER_NODE) { - HB_output_file.close(); - mean_HB_file.close(); - delete [] rbuf_var; - } - - delete [] sbuf_var; - delete [] averages; -} - -void COutputLegacy::SetSpecial_Output(CSolver *****solver_container, - CGeometry ****geometry, - CConfig **config, - unsigned long iExtIter, - unsigned short val_nZone) { - - bool special_output = false; - unsigned short iZone; - - for (iZone = 0; iZone < val_nZone; iZone++){ - - special_output = config[iZone]->GetSpecial_Output(); - - /*--- Output a file with the forces breakdown. ---*/ - if (config[iZone]->GetWrt_ForcesBreakdown()) - SpecialOutput_ForcesBreakdown(solver_container, geometry, config, iZone, special_output); - - } - -} - -void COutputLegacy::SpecialOutput_AnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfig *config, bool output) const { - - unsigned short iDim, iMarker, iMarker_Analyze; - unsigned long iVertex, iPoint; - su2double Mach = 0.0, Pressure, Temperature = 0.0, TotalPressure = 0.0, TotalTemperature = 0.0, - Enthalpy, Velocity[3]= {0.0}, TangVel[3], Velocity2, MassFlow, Density, Area, - AxiFactor = 1.0, SoundSpeed, Vn, Vn2, Vtang2, Weight = 1.0; - - su2double Gas_Constant = config->GetGas_ConstantND(); - su2double Gamma = config->GetGamma(); - unsigned short nMarker = config->GetnMarker_All(); - unsigned short nDim = geometry->GetnDim(); - unsigned short Kind_Average = config->GetKind_Average(); - - bool compressible = config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE; - bool incompressible = config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE; - bool energy = config->GetEnergy_Equation(); - - - bool axisymmetric = config->GetAxisymmetric(); - unsigned short nMarker_Analyze = config->GetnMarker_Analyze(); - - su2double *Vector = new su2double[nDim]; - su2double *Surface_MassFlow = new su2double[nMarker]; - su2double *Surface_Mach = new su2double[nMarker]; - su2double *Surface_Temperature = new su2double[nMarker]; - su2double *Surface_Density = new su2double[nMarker]; - su2double *Surface_Enthalpy = new su2double[nMarker]; - su2double *Surface_NormalVelocity = new su2double[nMarker]; - su2double *Surface_StreamVelocity2 = new su2double[nMarker]; - su2double *Surface_TransvVelocity2 = new su2double[nMarker]; - su2double *Surface_Pressure = new su2double[nMarker]; - su2double *Surface_TotalTemperature = new su2double[nMarker]; - su2double *Surface_TotalPressure = new su2double[nMarker]; - su2double *Surface_VelocityIdeal = new su2double[nMarker]; - su2double *Surface_Area = new su2double[nMarker]; - su2double *Surface_MassFlow_Abs = new su2double[nMarker]; - - /*--- Compute the numerical fan face Mach number, and the total area of the inflow ---*/ - - for (iMarker = 0; iMarker < nMarker; iMarker++) { - - Surface_MassFlow[iMarker] = 0.0; - Surface_Mach[iMarker] = 0.0; - Surface_Temperature[iMarker] = 0.0; - Surface_Density[iMarker] = 0.0; - Surface_Enthalpy[iMarker] = 0.0; - Surface_NormalVelocity[iMarker] = 0.0; - Surface_StreamVelocity2[iMarker] = 0.0; - Surface_TransvVelocity2[iMarker] = 0.0; - Surface_Pressure[iMarker] = 0.0; - Surface_TotalTemperature[iMarker] = 0.0; - Surface_TotalPressure[iMarker] = 0.0; - Surface_VelocityIdeal[iMarker] = 0.0; - Surface_Area[iMarker] = 0.0; - Surface_MassFlow_Abs[iMarker] = 0.0; - - if (config->GetMarker_All_Analyze(iMarker) == YES) { - - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - - if (geometry->nodes->GetDomain(iPoint)) { - - geometry->vertex[iMarker][iVertex]->GetNormal(Vector); - - if (axisymmetric) { - if (geometry->nodes->GetCoord(iPoint, 1) != 0.0) - AxiFactor = 2.0*PI_NUMBER*geometry->nodes->GetCoord(iPoint, 1); - else - AxiFactor = 1.0; - } else { - AxiFactor = 1.0; - } - - Density = solver->GetNodes()->GetDensity(iPoint); - Velocity2 = 0.0; Area = 0.0; MassFlow = 0.0; Vn = 0.0; Vtang2 = 0.0; - - for (iDim = 0; iDim < nDim; iDim++) { - Area += (Vector[iDim] * AxiFactor) * (Vector[iDim] * AxiFactor); - Velocity[iDim] = solver->GetNodes()->GetVelocity(iPoint,iDim); - Velocity2 += Velocity[iDim] * Velocity[iDim]; - Vn += Velocity[iDim] * Vector[iDim] * AxiFactor; - MassFlow += Vector[iDim] * AxiFactor * Density * Velocity[iDim]; - } - - Area = sqrt (Area); - if (AxiFactor == 0.0) Vn = 0.0; else Vn /= Area; - Vn2 = Vn * Vn; - Pressure = solver->GetNodes()->GetPressure(iPoint); - SoundSpeed = solver->GetNodes()->GetSoundSpeed(iPoint); - - for (iDim = 0; iDim < nDim; iDim++) { - TangVel[iDim] = Velocity[iDim] - Vn*Vector[iDim]*AxiFactor/Area; - Vtang2 += TangVel[iDim]*TangVel[iDim]; - } - - if (incompressible){ - if (config->GetKind_DensityModel() == INC_DENSITYMODEL::VARIABLE) { - Mach = sqrt(solver->GetNodes()->GetVelocity2(iPoint))/ - sqrt(solver->GetNodes()->GetSpecificHeatCp(iPoint)*config->GetPressure_ThermodynamicND()/(solver->GetNodes()->GetSpecificHeatCv(iPoint)*solver->GetNodes()->GetDensity(iPoint))); - } else { - Mach = sqrt(solver->GetNodes()->GetVelocity2(iPoint))/ - sqrt(config->GetBulk_Modulus()/(solver->GetNodes()->GetDensity(iPoint))); - } - Temperature = solver->GetNodes()->GetTemperature(iPoint); - Enthalpy = solver->GetNodes()->GetSpecificHeatCp(iPoint)*Temperature; - TotalTemperature = Temperature + 0.5*Velocity2/solver->GetNodes()->GetSpecificHeatCp(iPoint); - TotalPressure = Pressure + 0.5*Density*Velocity2; - } - else{ - Mach = sqrt(Velocity2)/SoundSpeed; - Temperature = Pressure / (Gas_Constant * Density); - Enthalpy = solver->GetNodes()->GetEnthalpy(iPoint); - TotalTemperature = Temperature * (1.0 + Mach * Mach * 0.5 * (Gamma - 1.0)); - TotalPressure = Pressure * pow( 1.0 + Mach * Mach * 0.5 * (Gamma - 1.0), Gamma / (Gamma - 1.0)); - } - - /*--- Compute the mass Surface_MassFlow ---*/ - - Surface_Area[iMarker] += Area; - Surface_MassFlow[iMarker] += MassFlow; - Surface_MassFlow_Abs[iMarker] += abs(MassFlow); - - if (Kind_Average == AVERAGE_MASSFLUX) Weight = abs(MassFlow); - else if (Kind_Average == AVERAGE_AREA) Weight = abs(Area); - else Weight = 1.0; - - Surface_Mach[iMarker] += Mach*Weight; - Surface_Temperature[iMarker] += Temperature*Weight; - Surface_Density[iMarker] += Density*Weight; - Surface_Enthalpy[iMarker] += Enthalpy*Weight; - Surface_NormalVelocity[iMarker] += Vn*Weight; - Surface_Pressure[iMarker] += Pressure*Weight; - Surface_TotalTemperature[iMarker] += TotalTemperature*Weight; - Surface_TotalPressure[iMarker] += TotalPressure*Weight; - - /*--- For now, always used the area to weight the uniformities. ---*/ - - Weight = abs(Area); - - Surface_StreamVelocity2[iMarker] += Vn2*Weight; - Surface_TransvVelocity2[iMarker] += Vtang2*Weight; - - } - } - - } - - } - - /*--- Copy to the appropriate structure ---*/ - - su2double *Surface_MassFlow_Local = new su2double [nMarker_Analyze]; - su2double *Surface_Mach_Local = new su2double [nMarker_Analyze]; - su2double *Surface_Temperature_Local = new su2double [nMarker_Analyze]; - su2double *Surface_Density_Local = new su2double [nMarker_Analyze]; - su2double *Surface_Enthalpy_Local = new su2double [nMarker_Analyze]; - su2double *Surface_NormalVelocity_Local = new su2double [nMarker_Analyze]; - su2double *Surface_StreamVelocity2_Local = new su2double [nMarker_Analyze]; - su2double *Surface_TransvVelocity2_Local = new su2double [nMarker_Analyze]; - su2double *Surface_Pressure_Local = new su2double [nMarker_Analyze]; - su2double *Surface_TotalTemperature_Local = new su2double [nMarker_Analyze]; - su2double *Surface_TotalPressure_Local = new su2double [nMarker_Analyze]; - su2double *Surface_Area_Local = new su2double [nMarker_Analyze]; - su2double *Surface_MassFlow_Abs_Local = new su2double [nMarker_Analyze]; - - su2double *Surface_MassFlow_Total = new su2double [nMarker_Analyze]; - su2double *Surface_Mach_Total = new su2double [nMarker_Analyze]; - su2double *Surface_Temperature_Total = new su2double [nMarker_Analyze]; - su2double *Surface_Density_Total = new su2double [nMarker_Analyze]; - su2double *Surface_Enthalpy_Total = new su2double [nMarker_Analyze]; - su2double *Surface_NormalVelocity_Total = new su2double [nMarker_Analyze]; - su2double *Surface_StreamVelocity2_Total = new su2double [nMarker_Analyze]; - su2double *Surface_TransvVelocity2_Total = new su2double [nMarker_Analyze]; - su2double *Surface_Pressure_Total = new su2double [nMarker_Analyze]; - su2double *Surface_TotalTemperature_Total = new su2double [nMarker_Analyze]; - su2double *Surface_TotalPressure_Total = new su2double [nMarker_Analyze]; - su2double *Surface_Area_Total = new su2double [nMarker_Analyze]; - su2double *Surface_MassFlow_Abs_Total = new su2double [nMarker_Analyze]; - - su2double *Surface_MomentumDistortion_Total = new su2double [nMarker_Analyze]; - - for (iMarker_Analyze = 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) { - Surface_MassFlow_Local[iMarker_Analyze] = 0.0; - Surface_Mach_Local[iMarker_Analyze] = 0.0; - Surface_Temperature_Local[iMarker_Analyze] = 0.0; - Surface_Density_Local[iMarker_Analyze] = 0.0; - Surface_Enthalpy_Local[iMarker_Analyze] = 0.0; - Surface_NormalVelocity_Local[iMarker_Analyze] = 0.0; - Surface_StreamVelocity2_Local[iMarker_Analyze] = 0.0; - Surface_TransvVelocity2_Local[iMarker_Analyze] = 0.0; - Surface_Pressure_Local[iMarker_Analyze] = 0.0; - Surface_TotalTemperature_Local[iMarker_Analyze] = 0.0; - Surface_TotalPressure_Local[iMarker_Analyze] = 0.0; - Surface_Area_Local[iMarker_Analyze] = 0.0; - Surface_MassFlow_Abs_Local[iMarker_Analyze] = 0.0; - - Surface_MassFlow_Total[iMarker_Analyze] = 0.0; - Surface_Mach_Total[iMarker_Analyze] = 0.0; - Surface_Temperature_Total[iMarker_Analyze] = 0.0; - Surface_Density_Total[iMarker_Analyze] = 0.0; - Surface_Enthalpy_Total[iMarker_Analyze] = 0.0; - Surface_NormalVelocity_Total[iMarker_Analyze] = 0.0; - Surface_StreamVelocity2_Total[iMarker_Analyze] = 0.0; - Surface_TransvVelocity2_Total[iMarker_Analyze] = 0.0; - Surface_Pressure_Total[iMarker_Analyze] = 0.0; - Surface_TotalTemperature_Total[iMarker_Analyze] = 0.0; - Surface_TotalPressure_Total[iMarker_Analyze] = 0.0; - Surface_Area_Total[iMarker_Analyze] = 0.0; - Surface_MassFlow_Abs_Total[iMarker_Analyze] = 0.0; - - Surface_MomentumDistortion_Total[iMarker_Analyze] = 0.0; - - } - - /*--- Compute the numerical fan face Mach number, mach number, temperature and the total area ---*/ - - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - - if (config->GetMarker_All_Analyze(iMarker) == YES) { - - for (iMarker_Analyze= 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) { - - /*--- Add the Surface_MassFlow, and Surface_Area to the particular boundary ---*/ - - if (config->GetMarker_All_TagBound(iMarker) == config->GetMarker_Analyze_TagBound(iMarker_Analyze)) { - Surface_MassFlow_Local[iMarker_Analyze] += Surface_MassFlow[iMarker]; - Surface_Mach_Local[iMarker_Analyze] += Surface_Mach[iMarker]; - Surface_Temperature_Local[iMarker_Analyze] += Surface_Temperature[iMarker]; - Surface_Density_Local[iMarker_Analyze] += Surface_Density[iMarker]; - Surface_Enthalpy_Local[iMarker_Analyze] += Surface_Enthalpy[iMarker]; - Surface_NormalVelocity_Local[iMarker_Analyze] += Surface_NormalVelocity[iMarker]; - Surface_StreamVelocity2_Local[iMarker_Analyze] += Surface_StreamVelocity2[iMarker]; - Surface_TransvVelocity2_Local[iMarker_Analyze] += Surface_TransvVelocity2[iMarker]; - Surface_Pressure_Local[iMarker_Analyze] += Surface_Pressure[iMarker]; - Surface_TotalTemperature_Local[iMarker_Analyze] += Surface_TotalTemperature[iMarker]; - Surface_TotalPressure_Local[iMarker_Analyze] += Surface_TotalPressure[iMarker]; - Surface_Area_Local[iMarker_Analyze] += Surface_Area[iMarker]; - Surface_MassFlow_Abs_Local[iMarker_Analyze] += Surface_MassFlow_Abs[iMarker]; - } - - } - - } - - } - -#ifdef HAVE_MPI - if (config->GetComm_Level() == COMM_FULL) { - SU2_MPI::Allreduce(Surface_MassFlow_Local, Surface_MassFlow_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_Mach_Local, Surface_Mach_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_Temperature_Local, Surface_Temperature_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_Density_Local, Surface_Density_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_Enthalpy_Local, Surface_Enthalpy_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_NormalVelocity_Local, Surface_NormalVelocity_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_StreamVelocity2_Local, Surface_StreamVelocity2_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_TransvVelocity2_Local, Surface_TransvVelocity2_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_Pressure_Local, Surface_Pressure_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_TotalTemperature_Local, Surface_TotalTemperature_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_TotalPressure_Local, Surface_TotalPressure_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_Area_Local, Surface_Area_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - SU2_MPI::Allreduce(Surface_MassFlow_Abs_Local, Surface_MassFlow_Abs_Total, nMarker_Analyze, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - } -#else - - for (iMarker_Analyze = 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) { - Surface_MassFlow_Total[iMarker_Analyze] = Surface_MassFlow_Local[iMarker_Analyze]; - Surface_Mach_Total[iMarker_Analyze] = Surface_Mach_Local[iMarker_Analyze]; - Surface_Temperature_Total[iMarker_Analyze] = Surface_Temperature_Local[iMarker_Analyze]; - Surface_Density_Total[iMarker_Analyze] = Surface_Density_Local[iMarker_Analyze]; - Surface_Enthalpy_Total[iMarker_Analyze] = Surface_Enthalpy_Local[iMarker_Analyze]; - Surface_NormalVelocity_Total[iMarker_Analyze] = Surface_NormalVelocity_Local[iMarker_Analyze]; - Surface_StreamVelocity2_Total[iMarker_Analyze] = Surface_StreamVelocity2_Local[iMarker_Analyze]; - Surface_TransvVelocity2_Total[iMarker_Analyze] = Surface_TransvVelocity2_Local[iMarker_Analyze]; - Surface_Pressure_Total[iMarker_Analyze] = Surface_Pressure_Local[iMarker_Analyze]; - Surface_TotalTemperature_Total[iMarker_Analyze] = Surface_TotalTemperature_Local[iMarker_Analyze]; - Surface_TotalPressure_Total[iMarker_Analyze] = Surface_TotalPressure_Local[iMarker_Analyze]; - Surface_Area_Total[iMarker_Analyze] = Surface_Area_Local[iMarker_Analyze]; - Surface_MassFlow_Abs_Total[iMarker_Analyze] = Surface_MassFlow_Abs_Local[iMarker_Analyze]; - } - -#endif - - /*--- Compute the value of Surface_Area_Total, and Surface_Pressure_Total, and - set the value in the config structure for future use ---*/ - - for (iMarker_Analyze = 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) { - - if (Kind_Average == AVERAGE_MASSFLUX) Weight = Surface_MassFlow_Abs_Total[iMarker_Analyze]; - else if (Kind_Average == AVERAGE_AREA) Weight = abs(Surface_Area_Total[iMarker_Analyze]); - else Weight = 1.0; - - if (Weight != 0.0) { - Surface_Mach_Total[iMarker_Analyze] /= Weight; - Surface_Temperature_Total[iMarker_Analyze] /= Weight; - Surface_Density_Total[iMarker_Analyze] /= Weight; - Surface_Enthalpy_Total[iMarker_Analyze] /= Weight; - Surface_NormalVelocity_Total[iMarker_Analyze] /= Weight; - Surface_Pressure_Total[iMarker_Analyze] /= Weight; - Surface_TotalTemperature_Total[iMarker_Analyze] /= Weight; - Surface_TotalPressure_Total[iMarker_Analyze] /= Weight; - } - else { - Surface_Mach_Total[iMarker_Analyze] = 0.0; - Surface_Temperature_Total[iMarker_Analyze] = 0.0; - Surface_Density_Total[iMarker_Analyze] = 0.0; - Surface_Enthalpy_Total[iMarker_Analyze] = 0.0; - Surface_NormalVelocity_Total[iMarker_Analyze] = 0.0; - Surface_Pressure_Total[iMarker_Analyze] = 0.0; - Surface_TotalTemperature_Total[iMarker_Analyze] = 0.0; - Surface_TotalPressure_Total[iMarker_Analyze] = 0.0; - } - - /*--- Compute flow uniformity parameters separately (always area for now). ---*/ - - Area = fabs(Surface_Area_Total[iMarker_Analyze]); - - if (Area != 0.0) { - Surface_MomentumDistortion_Total[iMarker_Analyze] = Surface_StreamVelocity2_Total[iMarker_Analyze]/(Surface_NormalVelocity_Total[iMarker_Analyze]*Surface_NormalVelocity_Total[iMarker_Analyze]*Area) - 1.0; - Surface_StreamVelocity2_Total[iMarker_Analyze] /= Area; - Surface_TransvVelocity2_Total[iMarker_Analyze] /= Area; - } - else { - Surface_MomentumDistortion_Total[iMarker_Analyze] = 0.0; - Surface_StreamVelocity2_Total[iMarker_Analyze] = 0.0; - Surface_TransvVelocity2_Total[iMarker_Analyze] = 0.0; - } - - } - - for (iMarker_Analyze = 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) { - - su2double MassFlow = Surface_MassFlow_Total[iMarker_Analyze] * config->GetDensity_Ref() * config->GetVelocity_Ref(); - if (config->GetSystemMeasurements() == US) MassFlow *= 32.174; - config->SetSurface_MassFlow(iMarker_Analyze, MassFlow); - - su2double Mach = Surface_Mach_Total[iMarker_Analyze]; - config->SetSurface_Mach(iMarker_Analyze, Mach); - - su2double Temperature = Surface_Temperature_Total[iMarker_Analyze] * config->GetTemperature_Ref(); - config->SetSurface_Temperature(iMarker_Analyze, Temperature); - - su2double Pressure = Surface_Pressure_Total[iMarker_Analyze] * config->GetPressure_Ref(); - config->SetSurface_Pressure(iMarker_Analyze, Pressure); - - su2double Density = Surface_Density_Total[iMarker_Analyze] * config->GetDensity_Ref(); - config->SetSurface_Density(iMarker_Analyze, Density); - - su2double Enthalpy = Surface_Enthalpy_Total[iMarker_Analyze]; - config->SetSurface_Enthalpy(iMarker_Analyze, Enthalpy); - - su2double NormalVelocity = Surface_NormalVelocity_Total[iMarker_Analyze] * config->GetVelocity_Ref(); - config->SetSurface_NormalVelocity(iMarker_Analyze, NormalVelocity); - - su2double Uniformity = sqrt(Surface_StreamVelocity2_Total[iMarker_Analyze]) * config->GetVelocity_Ref(); - config->SetSurface_Uniformity(iMarker_Analyze, Uniformity); - - su2double SecondaryStrength = sqrt(Surface_TransvVelocity2_Total[iMarker_Analyze]) * config->GetVelocity_Ref(); - config->SetSurface_SecondaryStrength(iMarker_Analyze, SecondaryStrength); - - su2double MomentumDistortion = Surface_MomentumDistortion_Total[iMarker_Analyze]; - config->SetSurface_MomentumDistortion(iMarker_Analyze, MomentumDistortion); - - su2double SecondOverUniform = SecondaryStrength/Uniformity; - config->SetSurface_SecondOverUniform(iMarker_Analyze, SecondOverUniform); - - su2double TotalTemperature = Surface_TotalTemperature_Total[iMarker_Analyze] * config->GetTemperature_Ref(); - config->SetSurface_TotalTemperature(iMarker_Analyze, TotalTemperature); - - su2double TotalPressure = Surface_TotalPressure_Total[iMarker_Analyze] * config->GetPressure_Ref(); - config->SetSurface_TotalPressure(iMarker_Analyze, TotalPressure); - - } - - /*--- Compute the average static pressure drop between two surfaces. Note - that this assumes we have two surfaces being analyzed and that the outlet - is first followed by the inlet. This is because we may also want to choose - outlet values (temperature, uniformity, etc.) for our design problems, - which require the outlet to be listed first. This is a simple first version - that could be generalized to a different orders/lists/etc. ---*/ - - for (iMarker_Analyze = 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) { - if (nMarker_Analyze == 2) { - su2double Pressure_Drop = (Surface_Pressure_Total[1]-Surface_Pressure_Total[0]) * config->GetPressure_Ref(); - config->SetSurface_PressureDrop(iMarker_Analyze, Pressure_Drop); - } else { - config->SetSurface_PressureDrop(iMarker_Analyze, 0.0); - } - } - - if ((rank == MASTER_NODE) && !config->GetDiscrete_Adjoint() && output) { - - cout.precision(6); - cout.setf(ios::scientific, ios::floatfield); - cout << endl << "Computing surface mean values." << endl << endl; - - for (iMarker_Analyze = 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) { - cout << "Surface "<< config->GetMarker_Analyze_TagBound(iMarker_Analyze) << ":" << endl; - - if (nDim == 3) { if (config->GetSystemMeasurements() == SI) cout << setw(20) << "Area (m^2): "; else cout << setw(20) << "Area (ft^2): "; } - else { if (config->GetSystemMeasurements() == SI) cout << setw(20) << "Area (m): "; else cout << setw(20) << "Area (ft): "; } - - if (config->GetSystemMeasurements() == SI) cout << setw(15) << fabs(Surface_Area_Total[iMarker_Analyze]); - else if (config->GetSystemMeasurements() == US) cout << setw(15) << fabs(Surface_Area_Total[iMarker_Analyze])*12.0*12.0; - - cout << endl; - - su2double MassFlow = config->GetSurface_MassFlow(iMarker_Analyze); - if (config->GetSystemMeasurements() == SI) cout << setw(20) << "Mf (kg/s): " << setw(15) << MassFlow; - else if (config->GetSystemMeasurements() == US) cout << setw(20) << "Mf (lbs/s): " << setw(15) << MassFlow; - - su2double NormalVelocity = config->GetSurface_NormalVelocity(iMarker_Analyze); - if (config->GetSystemMeasurements() == SI) cout << setw(20) << "Vn (m/s): " << setw(15) << NormalVelocity; - else if (config->GetSystemMeasurements() == US) cout << setw(20) << "Vn (ft/s): " << setw(15) << NormalVelocity; - - cout << endl; - - su2double Uniformity = config->GetSurface_Uniformity(iMarker_Analyze); - if (config->GetSystemMeasurements() == SI) cout << setw(20) << "Uniformity (m/s): " << setw(15) << Uniformity; - else if (config->GetSystemMeasurements() == US) cout << setw(20) << "Uniformity (ft/s): " << setw(15) << Uniformity; - - su2double SecondaryStrength = config->GetSurface_SecondaryStrength(iMarker_Analyze); - if (config->GetSystemMeasurements() == SI) cout << setw(20) << "Secondary (m/s): " << setw(15) << SecondaryStrength; - else if (config->GetSystemMeasurements() == US) cout << setw(20) << "Secondary (ft/s): " << setw(15) << SecondaryStrength; - - cout << endl; - - su2double MomentumDistortion = config->GetSurface_MomentumDistortion(iMarker_Analyze); - cout << setw(20) << "Mom. Distortion: " << setw(15) << MomentumDistortion; - - su2double SecondOverUniform = config->GetSurface_SecondOverUniform(iMarker_Analyze); - cout << setw(20) << "Second/Uniform: " << setw(15) << SecondOverUniform; - - cout << endl; - - su2double Pressure = config->GetSurface_Pressure(iMarker_Analyze); - if (config->GetSystemMeasurements() == SI) cout << setw(20) << "P (Pa): " << setw(15) << Pressure; - else if (config->GetSystemMeasurements() == US) cout << setw(20) << "P (psf): " << setw(15) << Pressure; - - su2double TotalPressure = config->GetSurface_TotalPressure(iMarker_Analyze); - if (config->GetSystemMeasurements() == SI) cout << setw(20) << "PT (Pa): " << setw(15) <GetSystemMeasurements() == US) cout << setw(20) << "PT (psf): " << setw(15) <GetSurface_Mach(iMarker_Analyze); - cout << setw(20) << "Mach: " << setw(15) << Mach; - - su2double Density = config->GetSurface_Density(iMarker_Analyze); - if (config->GetSystemMeasurements() == SI) cout << setw(20) << "Rho (kg/m^3): " << setw(15) << Density; - else if (config->GetSystemMeasurements() == US) cout << setw(20) << "Rho (lb/ft^3): " << setw(15) << Density*32.174; - - cout << endl; - - if (compressible || energy) { - su2double Temperature = config->GetSurface_Temperature(iMarker_Analyze); - if (config->GetSystemMeasurements() == SI) cout << setw(20) << "T (K): " << setw(15) << Temperature; - else if (config->GetSystemMeasurements() == US) cout << setw(20) << "T (R): " << setw(15) << Temperature; - - su2double TotalTemperature = config->GetSurface_TotalTemperature(iMarker_Analyze); - if (config->GetSystemMeasurements() == SI) cout << setw(20) << "TT (K): " << setw(15) << TotalTemperature; - else if (config->GetSystemMeasurements() == US) cout << setw(20) << "TT (R): " << setw(15) << TotalTemperature; - - cout << endl; - } - - } - cout.unsetf(ios_base::floatfield); - - } - - delete [] Surface_MassFlow_Local; - delete [] Surface_Mach_Local; - delete [] Surface_Temperature_Local; - delete [] Surface_Density_Local; - delete [] Surface_Enthalpy_Local; - delete [] Surface_NormalVelocity_Local; - delete [] Surface_Pressure_Local; - delete [] Surface_TotalTemperature_Local; - delete [] Surface_TotalPressure_Local; - delete [] Surface_Area_Local; - delete [] Surface_MassFlow_Abs_Local; - - delete [] Surface_MassFlow_Total; - delete [] Surface_Mach_Total; - delete [] Surface_Temperature_Total; - delete [] Surface_Density_Total; - delete [] Surface_Enthalpy_Total; - delete [] Surface_NormalVelocity_Total; - delete [] Surface_Pressure_Total; - delete [] Surface_TotalTemperature_Total; - delete [] Surface_TotalPressure_Total; - delete [] Surface_Area_Total; - delete [] Surface_MassFlow_Abs_Total; - - delete [] Surface_MassFlow; - delete [] Surface_Mach; - delete [] Surface_Temperature; - delete [] Surface_Density; - delete [] Surface_Enthalpy; - delete [] Surface_NormalVelocity; - delete [] Surface_Pressure; - delete [] Surface_TotalTemperature; - delete [] Surface_TotalPressure; - delete [] Surface_Area; - delete [] Vector; - delete [] Surface_VelocityIdeal; - delete [] Surface_MassFlow_Abs; - -} diff --git a/SU2_CFD/src/output/tools/CWindowingTools.cpp b/SU2_CFD/src/output/tools/CWindowingTools.cpp index 1178fb06db4..f3b228fd8f6 100644 --- a/SU2_CFD/src/output/tools/CWindowingTools.cpp +++ b/SU2_CFD/src/output/tools/CWindowingTools.cpp @@ -2,7 +2,7 @@ * \file signal_processing_toolbox.cpp * \brief Signal processing tools * \author S. Schotthöfer - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -40,17 +40,17 @@ su2double CWindowingTools::GetWndWeight(WINDOW_FUNCTION windowId, unsigned long } su2double CWindowingTools::HannWindow(unsigned long curTimeIter, unsigned long endTimeIter) { - su2double currTimeDouble = static_cast(curTimeIter); + auto currTimeDouble = static_cast(curTimeIter); if(endTimeIter==0) return 0; //Catch div by zero error, if window length is zero - su2double endTimeDouble = static_cast(endTimeIter); + auto endTimeDouble = static_cast(endTimeIter); su2double tau = currTimeDouble/endTimeDouble; return 1.0-cos(2*PI_NUMBER*tau); } su2double CWindowingTools::HannSquaredWindow(unsigned long curTimeIter, unsigned long endTimeIter) { - su2double currTimeDouble = static_cast(curTimeIter); + auto currTimeDouble = static_cast(curTimeIter); if(endTimeIter==0) return 0; //Catch div by zero error, if window length is zero - su2double endTimeDouble = static_cast(endTimeIter); + auto endTimeDouble = static_cast(endTimeIter); su2double tau = currTimeDouble/endTimeDouble; return 2.0/3.0*(1-cos(2*PI_NUMBER*tau))*(1-cos(2*PI_NUMBER*tau)); } @@ -58,15 +58,15 @@ su2double CWindowingTools::HannSquaredWindow(unsigned long curTimeIter, unsigned su2double CWindowingTools::BumpWindow(unsigned long curTimeIter, unsigned long endTimeIter) { if(curTimeIter==0) return 0; if(curTimeIter==endTimeIter) return 0; - su2double currTimeDouble = static_cast(curTimeIter); - su2double endTimeDouble = static_cast(endTimeIter); + auto currTimeDouble = static_cast(curTimeIter); + auto endTimeDouble = static_cast(endTimeIter); su2double tau = currTimeDouble/endTimeDouble; return 1.0/0.00702986*(exp(-1/(tau-tau*tau))); /* 0.00702986 equals the integral of exp(-1/(tau-tau*tau)) from 0 to 1, * and it acts as a normalization constant */ } -void CWindowedAverage::addValue(su2double valIn, unsigned long curTimeIter,unsigned long startIter){ +void CWindowedAverage::AddValue(su2double valIn, unsigned long curTimeIter,unsigned long startIter){ if (curTimeIter < startIter) return; // Averaging not yet started. const unsigned long windowWidth = curTimeIter - startIter + 1; // Calculate total width of window for this iteration if (curTimeIter != lastTimeIter) { // Handle new timestep diff --git a/SU2_CFD/src/python_wrapper_structure.cpp b/SU2_CFD/src/python_wrapper_structure.cpp index 32672e87eef..490cc193953 100644 --- a/SU2_CFD/src/python_wrapper_structure.cpp +++ b/SU2_CFD/src/python_wrapper_structure.cpp @@ -2,7 +2,7 @@ * \file python_wrapper_structure.cpp * \brief Driver subroutines that are used by the Python wrapper. Those routines are usually called from an external Python environment. * \author D. Thomas - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -25,22 +25,18 @@ * License along with SU2. If not, see . */ - +#include "../../Common/include/toolboxes/geometry_toolbox.hpp" #include "../include/drivers/CDriver.hpp" #include "../include/drivers/CSinglezoneDriver.hpp" -#include "../../Common/include/toolboxes/geometry_toolbox.hpp" - -void CDriver::PythonInterface_Preprocessing(CConfig **config, CGeometry ****geometry, CSolver *****solver){ +void CDriver::PreprocessPythonInterface(CConfig** config, CGeometry**** geometry, CSolver***** solver) { int rank = MASTER_NODE; SU2_MPI::Comm_rank(SU2_MPI::GetComm(), &rank); - /* --- Initialize boundary conditions customization, this is achieve through the Python wrapper --- */ - for(iZone=0; iZone < nZone; iZone++){ - - if (config[iZone]->GetnMarker_PyCustom() > 0){ - - if (rank == MASTER_NODE) cout << endl << "----------------- Python Interface Preprocessing ( Zone "<< iZone <<" ) -----------------" << endl; + /*--- Initialize boundary conditions customization, this is achieved through the Python wrapper. --- */ + for (iZone = 0; iZone < nZone; iZone++) { + if (config[iZone]->GetnMarker_PyCustom() > 0) { + if (rank == MASTER_NODE) cout << "----------------- Python Interface Preprocessing ( Zone " << iZone << " ) -----------------" << endl; if (rank == MASTER_NODE) cout << "Setting customized boundary conditions for zone " << iZone << endl; for (iMesh = 0; iMesh <= config[iZone]->GetnMGLevels(); iMesh++) { @@ -50,846 +46,120 @@ void CDriver::PythonInterface_Preprocessing(CConfig **config, CGeometry ****geom if ((config[iZone]->GetKind_Solver() == MAIN_SOLVER::EULER) || (config[iZone]->GetKind_Solver() == MAIN_SOLVER::NAVIER_STOKES) || - (config[iZone]->GetKind_Solver() == MAIN_SOLVER::RANS)) { - + (config[iZone]->GetKind_Solver() == MAIN_SOLVER::RANS) || + (config[iZone]->GetKind_Solver() == MAIN_SOLVER::INC_EULER) || + (config[iZone]->GetKind_Solver() == MAIN_SOLVER::INC_NAVIER_STOKES) || + (config[iZone]->GetKind_Solver() == MAIN_SOLVER::INC_RANS) || + (config[iZone]->GetKind_Solver() == MAIN_SOLVER::NEMO_EULER) || + (config[iZone]->GetKind_Solver() == MAIN_SOLVER::NEMO_NAVIER_STOKES)) { solver[iZone][INST_0][MESH_0][FLOW_SOL]->UpdateCustomBoundaryConditions(geometry[iZone][INST_0], config[iZone]); } } } - -} - -///////////////////////////////////////////////////////////////////////////// -/* Functions related to the global performance indices (Lift, Drag, ecc..) */ -///////////////////////////////////////////////////////////////////////////// - -passivedouble CDriver::Get_Drag() const { - - unsigned short val_iZone = ZONE_0; - unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CDrag, factor, val_Drag; - - /*--- Calculate drag force based on drag coefficient ---*/ - factor = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAeroCoeffsReferenceForce(); - CDrag = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CD(); - - val_Drag = CDrag*factor; - - return SU2_TYPE::GetValue(val_Drag); -} - -passivedouble CDriver::Get_Lift() const { - - unsigned short val_iZone = ZONE_0; - unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CLift, factor, val_Lift; - - /*--- Calculate drag force based on drag coefficient ---*/ - factor = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAeroCoeffsReferenceForce(); - CLift = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CL(); - - val_Lift = CLift*factor; - - return SU2_TYPE::GetValue(val_Lift); -} - -passivedouble CDriver::Get_Mx() const { - - unsigned short val_iZone = ZONE_0; - unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CMx, RefLengthCoeff, factor, val_Mx; - - RefLengthCoeff = config_container[val_iZone]->GetRefLength(); - - /*--- Calculate moment around x-axis based on coefficients ---*/ - factor = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAeroCoeffsReferenceForce(); - CMx = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CMx(); - - val_Mx = CMx*factor*RefLengthCoeff; - - return SU2_TYPE::GetValue(val_Mx); -} - -passivedouble CDriver::Get_My() const { - - unsigned short val_iZone = ZONE_0; - unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CMy, RefLengthCoeff, factor, val_My; - - RefLengthCoeff = config_container[val_iZone]->GetRefLength(); - - /*--- Calculate moment around x-axis based on coefficients ---*/ - factor = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAeroCoeffsReferenceForce(); - CMy = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CMy(); - - val_My = CMy*factor*RefLengthCoeff; - - return SU2_TYPE::GetValue(val_My); -} - -passivedouble CDriver::Get_Mz() const { - - unsigned short val_iZone = ZONE_0; - unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CMz, RefLengthCoeff, factor, val_Mz; - - RefLengthCoeff = config_container[val_iZone]->GetRefLength(); - - /*--- Calculate moment around z-axis based on coefficients ---*/ - factor = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetAeroCoeffsReferenceForce(); - CMz = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CMz(); - - val_Mz = CMz*factor*RefLengthCoeff; - - return SU2_TYPE::GetValue(val_Mz); -} - -passivedouble CDriver::Get_DragCoeff() const { - - unsigned short val_iZone = ZONE_0; - unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CDrag; - - CDrag = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CD(); - - return SU2_TYPE::GetValue(CDrag); -} - -passivedouble CDriver::Get_LiftCoeff() const { - - unsigned short val_iZone = ZONE_0; - unsigned short FinestMesh = config_container[val_iZone]->GetFinestMesh(); - su2double CLift; - - CLift = solver_container[val_iZone][INST_0][FinestMesh][FLOW_SOL]->GetTotal_CL(); - - return SU2_TYPE::GetValue(CLift); -} - -///////////////////////////////////////////////////////////////////////////// -/* Functions to obtain information from the geometry/mesh */ -///////////////////////////////////////////////////////////////////////////// - -unsigned long CDriver::GetNumberVertices(unsigned short iMarker) const { - - return geometry_container[ZONE_0][INST_0][MESH_0]->nVertex[iMarker]; - -} - -unsigned long CDriver::GetNumberHaloVertices(unsigned short iMarker) const { - - unsigned long nHaloVertices, iVertex, iPoint; - - nHaloVertices = 0; - for(iVertex = 0; iVertex < geometry_container[ZONE_0][INST_0][MESH_0]->nVertex[iMarker]; iVertex++){ - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - if(!(geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetDomain(iPoint))) nHaloVertices += 1; - } - - return nHaloVertices; - -} - -unsigned long CDriver::GetVertexGlobalIndex(unsigned short iMarker, unsigned long iVertex) const { - - unsigned long iPoint, GlobalIndex; - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - GlobalIndex = geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetGlobalIndex(iPoint); - - return GlobalIndex; - -} - -bool CDriver::IsAHaloNode(unsigned short iMarker, unsigned long iVertex) const { - - unsigned long iPoint; - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - if(geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetDomain(iPoint)) return false; - else return true; - -} - -vector CDriver::GetInitialMeshCoord(unsigned short iMarker, unsigned long iVertex) const { - - vector coord(3,0.0); - vector coord_passive(3, 0.0); - - auto iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - for (auto iDim = 0 ; iDim < nDim ; iDim++){ - coord[iDim] = solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->GetMesh_Coord(iPoint,iDim); - } - - coord_passive[0] = SU2_TYPE::GetValue(coord[0]); - coord_passive[1] = SU2_TYPE::GetValue(coord[1]); - coord_passive[2] = SU2_TYPE::GetValue(coord[2]); - - return coord_passive; -} - -vector CDriver::GetVertexNormal(unsigned short iMarker, unsigned long iVertex, bool unitNormal) const { - - su2double *Normal; - su2double Area; - vector ret_Normal(3, 0.0); - vector ret_Normal_passive(3, 0.0); - - Normal = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNormal(); - - if (!unitNormal) { - - ret_Normal_passive[0] = SU2_TYPE::GetValue(Normal[0]); - ret_Normal_passive[1] = SU2_TYPE::GetValue(Normal[1]); - if(nDim>2) ret_Normal_passive[2] = SU2_TYPE::GetValue(Normal[2]); - - return ret_Normal_passive; - } - - Area = GeometryToolbox::Norm(nDim, Normal); - - ret_Normal[0] = Normal[0]/Area; - ret_Normal[1] = Normal[1]/Area; - if(nDim>2) ret_Normal[2] = Normal[2]/Area; - - ret_Normal_passive[0] = SU2_TYPE::GetValue(ret_Normal[0]); - ret_Normal_passive[1] = SU2_TYPE::GetValue(ret_Normal[1]); - ret_Normal_passive[2] = SU2_TYPE::GetValue(ret_Normal[2]); - - return ret_Normal_passive; } ////////////////////////////////////////////////////////////////////////////////// -/* Functions to obtain global parameters from SU2 (time steps, delta t, ecc...) */ +/* Functions to obtain global parameters from SU2 (time steps, delta t, etc.) */ ////////////////////////////////////////////////////////////////////////////////// -unsigned long CDriver::GetnTimeIter() const { - - return config_container[ZONE_0]->GetnTime_Iter(); -} - -unsigned long CDriver::GetTime_Iter() const{ - - return TimeIter; -} - -passivedouble CDriver::GetUnsteady_TimeStep() const { - - return SU2_TYPE::GetValue(config_container[ZONE_0]->GetTime_Step()); -} +unsigned long CDriver::GetNumberTimeIter() const { return config_container[selected_zone]->GetnTime_Iter(); } -string CDriver::GetSurfaceFileName() const { +unsigned long CDriver::GetTimeIter() const { return TimeIter; } - return config_container[ZONE_0]->GetSurfCoeff_FileName(); +passivedouble CDriver::GetUnsteadyTimeStep() const { + return SU2_TYPE::GetValue(config_container[selected_zone]->GetTime_Step()); } -/////////////////////////////////////////////////////////////////////////////// -/* Functions related to CHT solver */ -/////////////////////////////////////////////////////////////////////////////// - -passivedouble CDriver::GetVertexTemperature(unsigned short iMarker, unsigned long iVertex) const { - - unsigned long iPoint; - su2double vertexWallTemp(0.0); - - bool compressible = (config_container[ZONE_0]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - - if(geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetDomain(iPoint) && compressible){ - vertexWallTemp = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetNodes()->GetTemperature(iPoint); - } - - return SU2_TYPE::GetValue(vertexWallTemp); - -} - -void CDriver::SetVertexTemperature(unsigned short iMarker, unsigned long iVertex, passivedouble val_WallTemp){ - - geometry_container[ZONE_0][INST_0][MESH_0]->SetCustomBoundaryTemperature(iMarker, iVertex, val_WallTemp); -} - -vector CDriver::GetVertexHeatFluxes(unsigned short iMarker, unsigned long iVertex) const { - - unsigned long iPoint; - unsigned short iDim; - su2double Prandtl_Lam = config_container[ZONE_0]->GetPrandtl_Lam(); - su2double Gas_Constant = config_container[ZONE_0]->GetGas_ConstantND(); - su2double Gamma = config_container[ZONE_0]->GetGamma(); - su2double Gamma_Minus_One = Gamma - 1.0; - su2double Cp = (Gamma / Gamma_Minus_One) * Gas_Constant; - su2double laminar_viscosity, thermal_conductivity; - vector GradT (3,0.0); - vector HeatFlux (3,0.0); - vector HeatFluxPassive (3,0.0); - - bool compressible = (config_container[ZONE_0]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - - if(compressible){ - laminar_viscosity = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetNodes()->GetLaminarViscosity(iPoint); - thermal_conductivity = Cp * (laminar_viscosity/Prandtl_Lam); - for(iDim=0; iDim < nDim; iDim++){ - GradT[iDim] = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetNodes()->GetGradient_Primitive(iPoint, 0, iDim); - HeatFlux[iDim] = -thermal_conductivity*GradT[iDim]; - } - } - - HeatFluxPassive[0] = SU2_TYPE::GetValue(HeatFlux[0]); - HeatFluxPassive[1] = SU2_TYPE::GetValue(HeatFlux[1]); - HeatFluxPassive[2] = SU2_TYPE::GetValue(HeatFlux[2]); - - return HeatFluxPassive; -} - -passivedouble CDriver::GetVertexNormalHeatFlux(unsigned short iMarker, unsigned long iVertex) const{ - - unsigned long iPoint; - unsigned short iDim; - su2double vertexWallHeatFlux; - su2double Prandtl_Lam = config_container[ZONE_0]->GetPrandtl_Lam(); - su2double Gas_Constant = config_container[ZONE_0]->GetGas_ConstantND(); - su2double Gamma = config_container[ZONE_0]->GetGamma(); - su2double Gamma_Minus_One = Gamma - 1.0; - su2double Cp = (Gamma / Gamma_Minus_One) * Gas_Constant; - su2double Area; - su2double laminar_viscosity, thermal_conductivity, dTdn; - su2double *Normal, GradT[3] = {0.0,0.0,0.0}, UnitNormal[3] = {0.0,0.0,0.0}; - - bool compressible = (config_container[ZONE_0]->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE); - - vertexWallHeatFlux = 0.0; - dTdn = 0.0; - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - - if(geometry_container[ZONE_0][INST_0][MESH_0]->nodes->GetDomain(iPoint) && compressible){ - Normal = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNormal(); - - Area = GeometryToolbox::Norm(nDim, Normal); - - for (iDim = 0; iDim < nDim; iDim++) - UnitNormal[iDim] = Normal[iDim]/Area; - - laminar_viscosity = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetNodes()->GetLaminarViscosity(iPoint); - thermal_conductivity = Cp * (laminar_viscosity/Prandtl_Lam); - /*Compute wall heat flux (normal to the wall) based on computed temperature gradient*/ - for(iDim=0; iDim < nDim; iDim++){ - GradT[iDim] = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetNodes()->GetGradient_Primitive(iPoint, 0, iDim); - dTdn += GradT[iDim]*UnitNormal[iDim]; - } - - vertexWallHeatFlux = -thermal_conductivity*dTdn; - } - - return SU2_TYPE::GetValue(vertexWallHeatFlux); -} - -void CDriver::SetVertexNormalHeatFlux(unsigned short iMarker, unsigned long iVertex, passivedouble val_WallHeatFlux){ - - geometry_container[ZONE_0][INST_0][MESH_0]->SetCustomBoundaryHeatFlux(iMarker, iVertex, val_WallHeatFlux); -} - -passivedouble CDriver::GetThermalConductivity(unsigned short iMarker, unsigned long iVertex) const { - - unsigned long iPoint; - su2double Prandtl_Lam = config_container[ZONE_0]->GetPrandtl_Lam(); - su2double Gas_Constant = config_container[ZONE_0]->GetGas_ConstantND(); - su2double Gamma = config_container[ZONE_0]->GetGamma(); - su2double Gamma_Minus_One = Gamma - 1.0; - su2double Cp = (Gamma / Gamma_Minus_One) * Gas_Constant; - su2double laminar_viscosity, thermal_conductivity; - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - laminar_viscosity = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->GetNodes()->GetLaminarViscosity(iPoint); - thermal_conductivity = Cp * (laminar_viscosity/Prandtl_Lam); - - return SU2_TYPE::GetValue(thermal_conductivity); - -} +string CDriver::GetSurfaceFileName() const { return config_container[selected_zone]->GetSurfCoeff_FileName(); } //////////////////////////////////////////////////////////////////////////////// /* Functions related to the management of markers */ //////////////////////////////////////////////////////////////////////////////// -vector CDriver::GetAllBoundaryMarkersTag() const { - - vector boundariesTagList; - unsigned short iMarker,nBoundariesMarkers; - string Marker_Tag; - - nBoundariesMarkers = config_container[ZONE_0]->GetnMarker_All(); - boundariesTagList.resize(nBoundariesMarkers); - - for(iMarker=0; iMarker < nBoundariesMarkers; iMarker++){ - Marker_Tag = config_container[ZONE_0]->GetMarker_All_TagBound(iMarker); - boundariesTagList[iMarker] = Marker_Tag; - } - - return boundariesTagList; -} - -vector CDriver::GetAllDeformMeshMarkersTag() const { - - vector interfaceBoundariesTagList; - unsigned short iMarker, nBoundariesMarker; - string Marker_Tag; - - nBoundariesMarker = config_container[ZONE_0]->GetnMarker_Deform_Mesh(); - interfaceBoundariesTagList.resize(nBoundariesMarker); +void CDriver::SetHeatSourcePosition(passivedouble alpha, passivedouble pos_x, passivedouble pos_y, + passivedouble pos_z) { + CSolver* solver = solver_container[selected_zone][INST_0][MESH_0][RAD_SOL]; - for(iMarker=0; iMarker < nBoundariesMarker; iMarker++){ - Marker_Tag = config_container[ZONE_0]->GetMarker_Deform_Mesh_TagBound(iMarker); - interfaceBoundariesTagList[iMarker] = Marker_Tag; - } - - return interfaceBoundariesTagList; -} - -vector CDriver::GetAllCHTMarkersTag() const { - - vector CHTBoundariesTagList; - unsigned short iMarker, nBoundariesMarker; - string Marker_Tag; - - nBoundariesMarker = config_container[ZONE_0]->GetnMarker_All(); - - //The CHT markers can be identified as the markers that are customizable with a BC type HEAT_FLUX or ISOTHERMAL. - for(iMarker=0; iMarkerGetMarker_All_KindBC(iMarker) == HEAT_FLUX || config_container[ZONE_0]->GetMarker_All_KindBC(iMarker) == ISOTHERMAL) && config_container[ZONE_0]->GetMarker_All_PyCustom(iMarker)){ - Marker_Tag = config_container[ZONE_0]->GetMarker_All_TagBound(iMarker); - CHTBoundariesTagList.push_back(Marker_Tag); - } - } + config_container[selected_zone]->SetHeatSource_Rot_Z(alpha); + config_container[selected_zone]->SetHeatSource_Center(pos_x, pos_y, pos_z); - return CHTBoundariesTagList; + solver->SetVolumetricHeatSource(geometry_container[selected_zone][INST_0][MESH_0], config_container[selected_zone]); } -vector CDriver::GetAllInletMarkersTag() const { +void CDriver::SetInletAngle(unsigned short iMarker, passivedouble alpha) { + su2double alpha_rad = alpha * PI_NUMBER / 180.0; - vector BoundariesTagList; - unsigned short iMarker, nBoundariesMarker; - string Marker_Tag; - - nBoundariesMarker = config_container[ZONE_0]->GetnMarker_All(); + unsigned long iVertex; - for(iMarker=0; iMarkerGetMarker_All_PyCustom(iMarker); - bool isInlet = (config_container[ZONE_0]->GetMarker_All_KindBC(iMarker) == INLET_FLOW); - if(isCustomizable && isInlet) { - Marker_Tag = config_container[ZONE_0]->GetMarker_All_TagBound(iMarker); - BoundariesTagList.push_back(Marker_Tag); - } + for (iVertex = 0; iVertex < geometry_container[selected_zone][INST_0][MESH_0]->nVertex[iMarker]; iVertex++) { + solver_container[selected_zone][INST_0][MESH_0][FLOW_SOL]->SetInlet_FlowDir(iMarker, iVertex, 0, cos(alpha_rad)); + solver_container[selected_zone][INST_0][MESH_0][FLOW_SOL]->SetInlet_FlowDir(iMarker, iVertex, 1, sin(alpha_rad)); } - - return BoundariesTagList; } -map CDriver::GetAllBoundaryMarkers() const { - - map allBoundariesMap; - unsigned short iMarker, nBoundaryMarkers; - string Marker_Tag; - - nBoundaryMarkers = config_container[ZONE_0]->GetnMarker_All(); - - for(iMarker=0; iMarker < nBoundaryMarkers; iMarker++){ - Marker_Tag = config_container[ZONE_0]->GetMarker_All_TagBound(iMarker); - allBoundariesMap[Marker_Tag] = iMarker; - } - - return allBoundariesMap; +void CDriver::SetFarFieldAoA(const passivedouble AoA) { + config_container[selected_zone]->SetAoA(AoA); + solver_container[selected_zone][INST_0][MESH_0][FLOW_SOL]->UpdateFarfieldVelocity(config_container[selected_zone]); } -map CDriver::GetAllBoundaryMarkersType() const { - - map allBoundariesTypeMap; - unsigned short iMarker, KindBC; - string Marker_Tag, Marker_Type; - - for(iMarker=0; iMarker < config_container[ZONE_0]->GetnMarker_All(); iMarker++){ - Marker_Tag = config_container[ZONE_0]->GetMarker_All_TagBound(iMarker); - KindBC = config_container[ZONE_0]->GetMarker_All_KindBC(iMarker); - switch(KindBC){ - case EULER_WALL: - Marker_Type = "EULER_WALL"; - break; - case FAR_FIELD: - Marker_Type = "FARFIELD"; - break; - case ISOTHERMAL: - Marker_Type = "ISOTHERMAL"; - break; - case HEAT_FLUX: - Marker_Type = "HEATFLUX"; - break; - case INLET_FLOW: - Marker_Type = "INLET_FLOW"; - break; - case OUTLET_FLOW: - Marker_Type = "OUTLET_FLOW"; - break; - case SYMMETRY_PLANE: - Marker_Type = "SYMMETRY"; - break; - case SEND_RECEIVE: - Marker_Type = "SEND_RECEIVE"; - break; - default: - Marker_Type = "UNKNOWN_TYPE"; - } - allBoundariesTypeMap[Marker_Tag] = Marker_Type; - } - - return allBoundariesTypeMap; -} - -void CDriver::SetHeatSource_Position(passivedouble alpha, passivedouble pos_x, passivedouble pos_y, passivedouble pos_z){ - - CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][RAD_SOL]; - - config_container[ZONE_0]->SetHeatSource_Rot_Z(alpha); - config_container[ZONE_0]->SetHeatSource_Center(pos_x, pos_y, pos_z); - - solver->SetVolumetricHeatSource(geometry_container[ZONE_0][INST_0][MESH_0], config_container[ZONE_0]); - -} - -void CDriver::SetInlet_Angle(unsigned short iMarker, passivedouble alpha){ - - su2double alpha_rad = alpha * PI_NUMBER/180.0; - - unsigned long iVertex; - - for (iVertex = 0; iVertex < geometry_container[ZONE_0][INST_0][MESH_0]->nVertex[iMarker]; iVertex++){ - solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SetInlet_FlowDir(iMarker, iVertex, 0, cos(alpha_rad)); - solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]->SetInlet_FlowDir(iMarker, iVertex, 1, sin(alpha_rad)); - } - +void CDriver::SetFarFieldAoS(const passivedouble AoS) { + config_container[selected_zone]->SetAoS(AoS); + solver_container[selected_zone][INST_0][MESH_0][FLOW_SOL]->UpdateFarfieldVelocity(config_container[selected_zone]); } ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// -/* Functions related to simulation control, high level functions (reset convergence, set initial mesh, ecc...) */ +/* Functions related to simulation control, high level functions (reset convergence, set initial mesh, etc.) */ ///////////////////////////////////////////////////////////////////////////////////////////////////////////////// -void CDriver::ResetConvergence() { - - for(iZone = 0; iZone < nZone; iZone++) { - switch (config_container[iZone]->GetKind_Solver()) { - - case MAIN_SOLVER::EULER: case MAIN_SOLVER::NAVIER_STOKES: case MAIN_SOLVER::RANS: - case MAIN_SOLVER::INC_EULER: case MAIN_SOLVER::INC_NAVIER_STOKES: case MAIN_SOLVER::INC_RANS: - integration_container[iZone][INST_0][FLOW_SOL]->SetConvergence(false); - if (config_container[iZone]->GetKind_Solver() == MAIN_SOLVER::RANS) integration_container[iZone][INST_0][TURB_SOL]->SetConvergence(false); - if(config_container[iZone]->GetKind_Trans_Model() == TURB_TRANS_MODEL::LM) integration_container[iZone][INST_0][TRANS_SOL]->SetConvergence(false); - break; - - case MAIN_SOLVER::FEM_ELASTICITY: - integration_container[iZone][INST_0][FEA_SOL]->SetConvergence(false); - break; - - case MAIN_SOLVER::ADJ_EULER: case MAIN_SOLVER::ADJ_NAVIER_STOKES: case MAIN_SOLVER::ADJ_RANS: case MAIN_SOLVER::DISC_ADJ_EULER: case MAIN_SOLVER::DISC_ADJ_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_RANS: - case MAIN_SOLVER::DISC_ADJ_INC_EULER: case MAIN_SOLVER::DISC_ADJ_INC_NAVIER_STOKES: case MAIN_SOLVER::DISC_ADJ_INC_RANS: - integration_container[iZone][INST_0][ADJFLOW_SOL]->SetConvergence(false); - if( (config_container[iZone]->GetKind_Solver() == MAIN_SOLVER::ADJ_RANS) || (config_container[iZone]->GetKind_Solver() == MAIN_SOLVER::DISC_ADJ_RANS) ) - integration_container[iZone][INST_0][ADJTURB_SOL]->SetConvergence(false); - break; - - default: - break; - } - } - -} - void CSinglezoneDriver::SetInitialMesh() { - DynamicMeshUpdate(0); SU2_OMP_PARALLEL { - // Overwrite fictious velocities - for (iMesh = 0u; iMesh <= config_container[ZONE_0]->GetnMGLevels(); iMesh++) { - SU2_OMP_FOR_STAT(roundUpDiv(geometry_container[ZONE_0][INST_0][iMesh]->GetnPoint(),omp_get_max_threads())) - for (unsigned long iPoint = 0; iPoint < geometry_container[ZONE_0][INST_0][iMesh]->GetnPoint(); iPoint++) { - - /*--- Overwrite fictitious velocities ---*/ + for (iMesh = 0u; iMesh <= main_config->GetnMGLevels(); iMesh++) { + SU2_OMP_FOR_STAT(roundUpDiv(geometry_container[selected_zone][INST_0][iMesh]->GetnPoint(), omp_get_max_threads())) + for (auto iPoint = 0ul; iPoint < geometry_container[selected_zone][INST_0][iMesh]->GetnPoint(); iPoint++) { + /*--- Overwrite fictitious velocities. ---*/ su2double Grid_Vel[3] = {0.0, 0.0, 0.0}; /*--- Set the grid velocity for this coarse node. ---*/ - geometry_container[ZONE_0][INST_0][iMesh]->nodes->SetGridVel(iPoint, Grid_Vel); + geometry_container[selected_zone][INST_0][iMesh]->nodes->SetGridVel(iPoint, Grid_Vel); } END_SU2_OMP_FOR /*--- Push back the volume. ---*/ - geometry_container[ZONE_0][INST_0][iMesh]->nodes->SetVolume_n(); - geometry_container[ZONE_0][INST_0][iMesh]->nodes->SetVolume_nM1(); + geometry_container[selected_zone][INST_0][iMesh]->nodes->SetVolume_n(); + geometry_container[selected_zone][INST_0][iMesh]->nodes->SetVolume_nM1(); } - /*--- Push back the solution so that there is no fictious velocity at the next step. ---*/ - solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->Set_Solution_time_n(); - solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->Set_Solution_time_n1(); + /*--- Push back the solution so that there is no fictitious velocity at the next step. ---*/ + solver_container[selected_zone][INST_0][MESH_0][MESH_SOL]->GetNodes()->Set_Solution_time_n(); + solver_container[selected_zone][INST_0][MESH_0][MESH_SOL]->GetNodes()->Set_Solution_time_n1(); } END_SU2_OMP_PARALLEL } -void CDriver::BoundaryConditionsUpdate(){ - +void CDriver::BoundaryConditionsUpdate() { int rank = MASTER_NODE; - unsigned short iZone; SU2_MPI::Comm_rank(SU2_MPI::GetComm(), &rank); - if(rank == MASTER_NODE) cout << "Updating boundary conditions." << endl; - for(iZone = 0; iZone < nZone; iZone++){ + if (rank == MASTER_NODE) cout << "Updating boundary conditions." << endl; + for (auto iZone = 0u; iZone < nZone; iZone++) { geometry_container[iZone][INST_0][MESH_0]->UpdateCustomBoundaryConditions(geometry_container[iZone][INST_0], config_container[iZone]); } } //////////////////////////////////////////////////////////////////////////////// -/* Functions related to finite elements */ -//////////////////////////////////////////////////////////////////////////////// - -void CDriver::SetFEA_Loads(unsigned short iMarker, unsigned long iVertex, passivedouble LoadX, - passivedouble LoadY, passivedouble LoadZ) { - - unsigned long iPoint; - su2double NodalForce[3] = {0.0,0.0,0.0}; - NodalForce[0] = LoadX; - NodalForce[1] = LoadY; - NodalForce[2] = LoadZ; - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - solver_container[ZONE_0][INST_0][MESH_0][FEA_SOL]->GetNodes()->Set_FlowTraction(iPoint,NodalForce); - -} - -vector CDriver::GetFEA_Displacements(unsigned short iMarker, unsigned long iVertex) const { - - unsigned long iPoint; - vector Displacements(3, 0.0); - vector Displacements_passive(3, 0.0); - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][FEA_SOL]; - CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; - - Displacements[0] = solver->GetNodes()->GetSolution(iPoint, 0); - Displacements[1] = solver->GetNodes()->GetSolution(iPoint, 1); - if (geometry->GetnDim() == 3) - Displacements[2] = solver->GetNodes()->GetSolution(iPoint, 2); - else - Displacements[2] = 0.0; - - Displacements_passive[0] = SU2_TYPE::GetValue(Displacements[0]); - Displacements_passive[1] = SU2_TYPE::GetValue(Displacements[1]); - Displacements_passive[2] = SU2_TYPE::GetValue(Displacements[2]); - - return Displacements_passive; -} - - -vector CDriver::GetFEA_Velocity(unsigned short iMarker, unsigned long iVertex) const { - - unsigned long iPoint; - vector Velocity(3, 0.0); - vector Velocity_passive(3,0.0); - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][FEA_SOL]; - CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; - - if (config_container[ZONE_0]->GetDynamic_Analysis() == DYNAMIC){ - Velocity[0] = solver->GetNodes()->GetSolution_Vel(iPoint, 0); - Velocity[1] = solver->GetNodes()->GetSolution_Vel(iPoint, 1); - if (geometry->GetnDim() == 3) - Velocity[2] = solver->GetNodes()->GetSolution_Vel(iPoint, 2); - else - Velocity[2] = 0.0; - } - - Velocity_passive[0] = SU2_TYPE::GetValue(Velocity[0]); - Velocity_passive[1] = SU2_TYPE::GetValue(Velocity[1]); - Velocity_passive[2] = SU2_TYPE::GetValue(Velocity[2]); - - return Velocity_passive; -} - -vector CDriver::GetFEA_Velocity_n(unsigned short iMarker, unsigned long iVertex) const { - - unsigned long iPoint; - vector Velocity_n(3, 0.0); - vector Velocity_n_passive(3, 0.0); - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][FEA_SOL]; - CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; - - if (config_container[ZONE_0]->GetDynamic_Analysis() == DYNAMIC){ - Velocity_n[0] = solver->GetNodes()->GetSolution_Vel_time_n(iPoint, 0); - Velocity_n[1] = solver->GetNodes()->GetSolution_Vel_time_n(iPoint, 1); - if (geometry->GetnDim() == 3) - Velocity_n[2] = solver->GetNodes()->GetSolution_Vel_time_n(iPoint, 2); - else - Velocity_n[2] = 0.0; - } - - Velocity_n_passive[0] = SU2_TYPE::GetValue(Velocity_n[0]); - Velocity_n_passive[1] = SU2_TYPE::GetValue(Velocity_n[1]); - Velocity_n_passive[2] = SU2_TYPE::GetValue(Velocity_n[2]); - - return Velocity_n_passive; - -} - -//////////////////////////////////////////////////////////////////////////////// -/* Functions related to adjoint simulations */ +/* Functions related to dynamic mesh */ //////////////////////////////////////////////////////////////////////////////// -vector CDriver::GetMeshDisp_Sensitivity(unsigned short iMarker, unsigned long iVertex) const { - - unsigned long iPoint; - vector Disp_Sens(3, 0.0); - vector Disp_Sens_passive(3, 0.0); - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][ADJMESH_SOL]; - CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; - - Disp_Sens[0] = solver->GetNodes()->GetBoundDisp_Sens(iPoint, 0); - Disp_Sens[1] = solver->GetNodes()->GetBoundDisp_Sens(iPoint, 1); - if (geometry->GetnDim() == 3) - Disp_Sens[2] = solver->GetNodes()->GetBoundDisp_Sens(iPoint, 2); - else - Disp_Sens[2] = 0.0; - - Disp_Sens_passive[0] = SU2_TYPE::GetValue(Disp_Sens[0]); - Disp_Sens_passive[1] = SU2_TYPE::GetValue(Disp_Sens[1]); - Disp_Sens_passive[2] = SU2_TYPE::GetValue(Disp_Sens[2]); - - return Disp_Sens_passive; - -} - -vector CDriver::GetFlowLoad_Sensitivity(unsigned short iMarker, unsigned long iVertex) const { - - unsigned long iPoint; - vector FlowLoad_Sens(3, 0.0); - vector FlowLoad_Sens_passive(3, 0.0); - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][ADJFEA_SOL]; - CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; - - FlowLoad_Sens[0] = solver->GetNodes()->GetFlowTractionSensitivity(iPoint, 0); - FlowLoad_Sens[1] = solver->GetNodes()->GetFlowTractionSensitivity(iPoint, 1); - if (geometry->GetnDim() == 3) - FlowLoad_Sens[2] = solver->GetNodes()->GetFlowTractionSensitivity(iPoint, 2); - else - FlowLoad_Sens[2] = 0.0; - - FlowLoad_Sens_passive[0] = SU2_TYPE::GetValue(FlowLoad_Sens[0]); - FlowLoad_Sens_passive[1] = SU2_TYPE::GetValue(FlowLoad_Sens[1]); - FlowLoad_Sens_passive[2] = SU2_TYPE::GetValue(FlowLoad_Sens[2]); - - return FlowLoad_Sens_passive; - +void CDriver::SetTranslationRate(passivedouble xDot, passivedouble yDot, passivedouble zDot) { + main_config->SetTranslation_Rate(0, xDot); + main_config->SetTranslation_Rate(1, yDot); + main_config->SetTranslation_Rate(2, zDot); } -void CDriver::SetFlowLoad_Adjoint(unsigned short iMarker, unsigned long iVertex, passivedouble val_AdjointX, - passivedouble val_AdjointY, passivedouble val_AdjointZ) { - - CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]; - CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; - - solver->StoreVertexTractionsAdjoint(iMarker, iVertex, 0, val_AdjointX); - solver->StoreVertexTractionsAdjoint(iMarker, iVertex, 1, val_AdjointY); - if (geometry->GetnDim() == 3) - solver->StoreVertexTractionsAdjoint(iMarker, iVertex, 2, val_AdjointZ); - +void CDriver::SetRotationRate(passivedouble rot_x, passivedouble rot_y, passivedouble rot_z) { + main_config->SetRotation_Rate(0, rot_x); + main_config->SetRotation_Rate(1, rot_y); + main_config->SetRotation_Rate(2, rot_z); } -void CDriver::SetSourceTerm_DispAdjoint(unsigned short iMarker, unsigned long iVertex, passivedouble val_AdjointX, - passivedouble val_AdjointY, passivedouble val_AdjointZ) { - - unsigned long iPoint; - - CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][ADJFEA_SOL]; - CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - - solver->GetNodes()->SetSourceTerm_DispAdjoint(iPoint, 0, val_AdjointX); - solver->GetNodes()->SetSourceTerm_DispAdjoint(iPoint, 1, val_AdjointY); - if (geometry->GetnDim() == 3) - solver->GetNodes()->SetSourceTerm_DispAdjoint(iPoint, 2, val_AdjointZ); - -} - -void CDriver::SetSourceTerm_VelAdjoint(unsigned short iMarker, unsigned long iVertex, passivedouble val_AdjointX, - passivedouble val_AdjointY, passivedouble val_AdjointZ) { - - CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][ADJFEA_SOL]; - CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; - const auto iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - - solver->GetNodes()->SetSourceTerm_VelAdjoint(iPoint, 0, val_AdjointX); - solver->GetNodes()->SetSourceTerm_VelAdjoint(iPoint, 1, val_AdjointY); - if (geometry->GetnDim() == 3) - solver->GetNodes()->SetSourceTerm_VelAdjoint(iPoint, 2, val_AdjointZ); - -} - -//////////////////////////////////////////////////////////////////////////////// -/* Functions related to mesh deformation */ -//////////////////////////////////////////////////////////////////////////////// - -void CDriver::SetMeshDisplacement(unsigned short iMarker, unsigned long iVertex, passivedouble DispX, passivedouble DispY, passivedouble DispZ) { - - unsigned long iPoint; - su2double MeshDispl[3] = {0.0,0.0,0.0}; - - MeshDispl[0] = DispX; - MeshDispl[1] = DispY; - MeshDispl[2] = DispZ; - - iPoint = geometry_container[ZONE_0][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); - - solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->GetNodes()->SetBound_Disp(iPoint,MeshDispl); - -} - -void CDriver::CommunicateMeshDisplacement(void) { - - solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->InitiateComms(geometry_container[ZONE_0][INST_0][MESH_0], - config_container[ZONE_0], MESH_DISPLACEMENTS); - solver_container[ZONE_0][INST_0][MESH_0][MESH_SOL]->CompleteComms(geometry_container[ZONE_0][INST_0][MESH_0], - config_container[ZONE_0], MESH_DISPLACEMENTS); - -} - -//////////////////////////////////////////////////////////////////////////////// -/* Functions related to flow loads */ -//////////////////////////////////////////////////////////////////////////////// - -vector CDriver::GetFlowLoad(unsigned short iMarker, unsigned long iVertex) const { - - vector FlowLoad(3, 0.0); - vector FlowLoad_passive(3, 0.0); - - CSolver *solver = solver_container[ZONE_0][INST_0][MESH_0][FLOW_SOL]; - CGeometry *geometry = geometry_container[ZONE_0][INST_0][MESH_0]; - - if (config_container[ZONE_0]->GetSolid_Wall(iMarker)) { - FlowLoad[0] = solver->GetVertexTractions(iMarker, iVertex, 0); - FlowLoad[1] = solver->GetVertexTractions(iMarker, iVertex, 1); - if (geometry->GetnDim() == 3) - FlowLoad[2] = solver->GetVertexTractions(iMarker, iVertex, 2); - else - FlowLoad[2] = 0.0; - } - - FlowLoad_passive[0] = SU2_TYPE::GetValue(FlowLoad[0]); - FlowLoad_passive[1] = SU2_TYPE::GetValue(FlowLoad[1]); - FlowLoad_passive[2] = SU2_TYPE::GetValue(FlowLoad[2]); - - return FlowLoad_passive; - -} diff --git a/SU2_CFD/src/solvers/CAdjEulerSolver.cpp b/SU2_CFD/src/solvers/CAdjEulerSolver.cpp index fde3afc43fa..4e7ff5b2098 100644 --- a/SU2_CFD/src/solvers/CAdjEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CAdjEulerSolver.cpp @@ -2,7 +2,7 @@ * \file CAdjEulerSolver.cpp * \brief Main subroutines for solving Euler adjoint problems. * \author F. Palacios, T. Economon, H. Kline - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -29,7 +29,7 @@ #include "../../include/solvers/CAdjEulerSolver.hpp" #include "../../../Common/include/toolboxes/geometry_toolbox.hpp" -CAdjEulerSolver::CAdjEulerSolver(void) : CSolver() { +CAdjEulerSolver::CAdjEulerSolver() : CSolver() { /*--- Array initialization ---*/ Phi_Inf = nullptr; @@ -271,8 +271,7 @@ CAdjEulerSolver::CAdjEulerSolver(CGeometry *geometry, CConfig *config, unsigned /*--- Define solver parameters needed for execution of destructor ---*/ - if (config->GetKind_ConvNumScheme_AdjFlow() == SPACE_CENTERED) space_centered = true; - else space_centered = false; + space_centered = config->GetKind_ConvNumScheme_AdjFlow() == SPACE_CENTERED; /*--- Calculate area monitored for area-averaged-outflow-quantity-based objectives ---*/ @@ -345,9 +344,10 @@ CAdjEulerSolver::CAdjEulerSolver(CGeometry *geometry, CConfig *config, unsigned InitiateComms(geometry, config, SOLUTION); CompleteComms(geometry, config, SOLUTION); + SolverName = "ADJ.FLOW"; } -CAdjEulerSolver::~CAdjEulerSolver(void) { +CAdjEulerSolver::~CAdjEulerSolver() { unsigned short iVar, iMarker; delete [] Phi_Inf; @@ -399,10 +399,10 @@ void CAdjEulerSolver::Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geo /*--- Define buffer vector interior domain ---*/ su2double *Buffer_Send_AdjVar = nullptr; - su2double *iAdjVar = new su2double [nVar]; + auto *iAdjVar = new su2double [nVar]; - unsigned long *nPointTotal_s = new unsigned long[size]; - unsigned long *nPointTotal_r = new unsigned long[size]; + auto *nPointTotal_s = new unsigned long[size]; + auto *nPointTotal_r = new unsigned long[size]; unsigned long Buffer_Size_AdjVar = 0; unsigned long PointTotal_Counter = 0; diff --git a/SU2_CFD/src/solvers/CAdjNSSolver.cpp b/SU2_CFD/src/solvers/CAdjNSSolver.cpp index 8ad4ef3e7cf..50ca5438e92 100644 --- a/SU2_CFD/src/solvers/CAdjNSSolver.cpp +++ b/SU2_CFD/src/solvers/CAdjNSSolver.cpp @@ -2,7 +2,7 @@ * \file CAdjNSSolver.cpp * \brief Main subroutines for solving Navier-Stokes adjoint problems. * \author F. Palacios, T. Economon, H. Kline - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -30,7 +30,7 @@ #include "../../include/variables/CAdjNSVariable.hpp" #include "../../../Common/include/toolboxes/geometry_toolbox.hpp" -CAdjNSSolver::CAdjNSSolver(void) : CAdjEulerSolver() { } +CAdjNSSolver::CAdjNSSolver() : CAdjEulerSolver() { } CAdjNSSolver::CAdjNSSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh) : CAdjEulerSolver() { unsigned long iPoint, iVertex; @@ -292,9 +292,7 @@ CAdjNSSolver::CAdjNSSolver(CGeometry *geometry, CConfig *config, unsigned short } -CAdjNSSolver::~CAdjNSSolver(void) { - -} +CAdjNSSolver::~CAdjNSSolver() = default; void CAdjNSSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_container, CConfig *config, @@ -600,25 +598,25 @@ void CAdjNSSolver::Viscous_Sensitivity(CGeometry *geometry, CSolver **solver_con dp_drv, dp_drw, dp_drE, dH_dr, dH_dru, dH_drv, dH_drw, dH_drE, H, D[3][3], Dd[3], Mach_Inf, eps, scale = 1.0, RefVel2, RefDensity, Mach2Vel, *Velocity_Inf, factor; - su2double *USens = new su2double[nVar]; - su2double *UnitNormal = new su2double[nDim]; - su2double *normal_grad_vel = new su2double[nDim]; - su2double *tang_deriv_psi5 = new su2double[nDim]; - su2double *tang_deriv_T = new su2double[nDim]; - su2double **Sigma = new su2double* [nDim]; + auto *USens = new su2double[nVar]; + auto *UnitNormal = new su2double[nDim]; + auto *normal_grad_vel = new su2double[nDim]; + auto *tang_deriv_psi5 = new su2double[nDim]; + auto *tang_deriv_T = new su2double[nDim]; + auto **Sigma = new su2double* [nDim]; for (iDim = 0; iDim < nDim; iDim++) Sigma[iDim] = new su2double [nDim]; - su2double *normal_grad_gridvel = new su2double[nDim]; - su2double *normal_grad_v_ux =new su2double[nDim]; - su2double **Sigma_Psi5v = new su2double* [nDim]; + auto *normal_grad_gridvel = new su2double[nDim]; + auto *normal_grad_v_ux =new su2double[nDim]; + auto **Sigma_Psi5v = new su2double* [nDim]; for (iDim = 0; iDim < nDim; iDim++) Sigma_Psi5v[iDim] = new su2double [nDim]; - su2double **tau = new su2double* [nDim]; + auto **tau = new su2double* [nDim]; for (iDim = 0; iDim < nDim; iDim++) tau[iDim] = new su2double [nDim]; - su2double *Velocity = new su2double[nDim]; + auto *Velocity = new su2double[nDim]; bool rotating_frame = config->GetRotating_Frame(); bool grid_movement = config->GetGrid_Movement(); @@ -768,12 +766,8 @@ void CAdjNSSolver::Viscous_Sensitivity(CGeometry *geometry, CSolver **solver_con Enthalpy = solver_container[FLOW_SOL]->GetNodes()->GetEnthalpy(iPoint); /*--- Turbulent kinetic energy ---*/ - /// TODO: This does not seem to be consistent with the primal treatment. - if (config->GetKind_Turb_Model() == TURB_MODEL::SST) - val_turb_ke = solver_container[TURB_SOL]->GetNodes()->GetSolution(iPoint,0); - else - val_turb_ke = 0.0; - + // turb_ke is not considered in the stress tensor, see #797 + val_turb_ke = 0.0; CNumerics::ComputeStressTensor(nDim, tau, PrimVar_Grad+1, Laminar_Viscosity, Density, val_turb_ke); /*--- Form normal_grad_gridvel = \partial_n (u_omega) ---*/ @@ -1200,17 +1194,17 @@ void CAdjNSSolver::BC_HeatFlux_Wall(CGeometry *geometry, CSolver **solver_contai su2double Prandtl_Lam = config->GetPrandtl_Lam(); su2double Prandtl_Turb = config->GetPrandtl_Turb(); - su2double *Psi = new su2double[nVar]; - su2double **Tau = new su2double*[nDim]; + auto *Psi = new su2double[nVar]; + auto **Tau = new su2double*[nDim]; for (iDim = 0; iDim < nDim; iDim++) Tau[iDim] = new su2double [nDim]; - su2double *Velocity = new su2double[nDim]; - su2double *Normal = new su2double[nDim]; - su2double *Edge_Vector = new su2double[nDim]; - su2double **GradPhi = new su2double*[nDim]; + auto *Velocity = new su2double[nDim]; + auto *Normal = new su2double[nDim]; + auto *Edge_Vector = new su2double[nDim]; + auto **GradPhi = new su2double*[nDim]; for (iDim = 0; iDim < nDim; iDim++) GradPhi[iDim] = new su2double [nDim]; - su2double *GradPsiE = new su2double [nDim]; + auto *GradPsiE = new su2double [nDim]; /*--- Loop over all of the vertices on this boundary marker ---*/ @@ -1551,21 +1545,21 @@ void CAdjNSSolver::BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_cont Sigma_yz5, eta_xx, eta_yy, eta_zz, eta_xy, eta_xz, eta_yz; su2double kGTdotn=0.0, Area=0.0, Xi=0.0; - su2double *Psi = new su2double[nVar]; - su2double **Tau = new su2double* [nDim]; + auto *Psi = new su2double[nVar]; + auto **Tau = new su2double* [nDim]; for (iDim = 0; iDim < nDim; iDim++) Tau[iDim] = new su2double [nDim]; - su2double *Velocity = new su2double[nDim]; - su2double *Normal = new su2double[nDim]; + auto *Velocity = new su2double[nDim]; + auto *Normal = new su2double[nDim]; - su2double **GradPhi = new su2double* [nDim]; + auto **GradPhi = new su2double* [nDim]; for (iDim = 0; iDim < nDim; iDim++) GradPhi[iDim] = new su2double [nDim]; - su2double *GradPsiE = new su2double [nDim]; + auto *GradPsiE = new su2double [nDim]; su2double *GradT;// = new su2double[nDim]; su2double *GradP; su2double *GradDens; - su2double *dPoRho2 = new su2double[nDim]; + auto *dPoRho2 = new su2double[nDim]; bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); bool grid_movement = config->GetGrid_Movement(); diff --git a/SU2_CFD/src/solvers/CAdjTurbSolver.cpp b/SU2_CFD/src/solvers/CAdjTurbSolver.cpp index e6e9ad5724e..33ea1f11841 100644 --- a/SU2_CFD/src/solvers/CAdjTurbSolver.cpp +++ b/SU2_CFD/src/solvers/CAdjTurbSolver.cpp @@ -2,7 +2,7 @@ * \file CAdjTurbVariable.cpp * \brief Main subroutines for solving turbulent adjoint problems. * \author F. Palacios, A. Bueno, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -28,7 +28,7 @@ #include "../../include/solvers/CAdjTurbSolver.hpp" -CAdjTurbSolver::CAdjTurbSolver(void) : CSolver() {} +CAdjTurbSolver::CAdjTurbSolver() : CSolver() {} CAdjTurbSolver::CAdjTurbSolver(CGeometry *geometry, CConfig *config, unsigned short iMesh) : CSolver() { @@ -163,7 +163,7 @@ CAdjTurbSolver::CAdjTurbSolver(CGeometry *geometry, CConfig *config, unsigned sh } -CAdjTurbSolver::~CAdjTurbSolver(void) { +CAdjTurbSolver::~CAdjTurbSolver() { delete nodes; } diff --git a/SU2_CFD/src/solvers/CBaselineSolver.cpp b/SU2_CFD/src/solvers/CBaselineSolver.cpp index 03a305abc42..7d9e483d633 100644 --- a/SU2_CFD/src/solvers/CBaselineSolver.cpp +++ b/SU2_CFD/src/solvers/CBaselineSolver.cpp @@ -2,7 +2,7 @@ * \file CBaselineSolver.cpp * \brief Main subroutines for CBaselineSolver class. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,10 +26,12 @@ */ +#include + #include "../../include/solvers/CBaselineSolver.hpp" #include "../../../Common/include/toolboxes/printing_toolbox.hpp" -CBaselineSolver::CBaselineSolver(void) : CSolver() { } +CBaselineSolver::CBaselineSolver() : CSolver() { } CBaselineSolver::CBaselineSolver(CGeometry *geometry, CConfig *config) { @@ -61,7 +63,7 @@ CBaselineSolver::CBaselineSolver(CGeometry *geometry, CConfig *config, unsigned nPoint = geometry->GetnPoint(); nDim = geometry->GetnDim(); nVar = val_nvar; - fields = field_names; + fields = std::move(field_names); /*--- Allocate the node variables ---*/ @@ -210,7 +212,7 @@ void CBaselineSolver::SetOutputVariables(CGeometry *geometry, CConfig *config) { SU2_MPI::Bcast(mpi_str_buf, nVar*CGNS_STRING_SIZE, MPI_CHAR, MASTER_NODE, SU2_MPI::GetComm()); - fields.push_back("Point_ID"); + fields.emplace_back("Point_ID"); for (iVar = 0; iVar < nVar; iVar++) { index = iVar*CGNS_STRING_SIZE; @@ -220,7 +222,7 @@ void CBaselineSolver::SetOutputVariables(CGeometry *geometry, CConfig *config) { } field_buf.append(str_buf); field_buf.append("\""); - fields.push_back(field_buf.c_str()); + fields.emplace_back(field_buf.c_str()); field_buf.clear(); } @@ -359,7 +361,7 @@ void CBaselineSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConf bool steady_restart = config->GetSteadyRestart(); TURB_MODEL turb_model = config->GetKind_Turb_Model(); - su2double *Coord = new su2double [nDim]; + auto *Coord = new su2double [nDim]; for (iDim = 0; iDim < nDim; iDim++) Coord[iDim] = 0.0; @@ -519,7 +521,7 @@ void CBaselineSolver::LoadRestart_FSI(CGeometry *geometry, CConfig *config, int } unsigned short nVar_Local = Restart_Vars[1]; - su2double *Solution_Local = new su2double[nVar_Local]; + auto *Solution_Local = new su2double[nVar_Local]; int counter = 0; long iPoint_Local = 0; unsigned long iPoint_Global = 0; @@ -554,6 +556,6 @@ void CBaselineSolver::LoadRestart_FSI(CGeometry *geometry, CConfig *config, int } -CBaselineSolver::~CBaselineSolver(void) { +CBaselineSolver::~CBaselineSolver() { delete nodes; } diff --git a/SU2_CFD/src/solvers/CBaselineSolver_FEM.cpp b/SU2_CFD/src/solvers/CBaselineSolver_FEM.cpp index a15877d0d4e..19247b9ced1 100644 --- a/SU2_CFD/src/solvers/CBaselineSolver_FEM.cpp +++ b/SU2_CFD/src/solvers/CBaselineSolver_FEM.cpp @@ -2,7 +2,7 @@ * \file CBaselineSolver_FEM.cpp * \brief Main subroutines for CBaselineSolver_FEM class. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -29,7 +29,7 @@ #include "../../include/solvers/CBaselineSolver_FEM.hpp" -CBaselineSolver_FEM::CBaselineSolver_FEM(void) : CSolver() { } +CBaselineSolver_FEM::CBaselineSolver_FEM() : CSolver() { } CBaselineSolver_FEM::CBaselineSolver_FEM(CGeometry *geometry, CConfig *config) { @@ -43,7 +43,7 @@ CBaselineSolver_FEM::CBaselineSolver_FEM(CGeometry *geometry, CConfig *config) { the computation of the external faces may be more efficient when using multiple threads. ---*/ - CMeshFEM_DG *DGGeometry = dynamic_cast(geometry); + auto *DGGeometry = dynamic_cast(geometry); nVolElemTot = DGGeometry->GetNVolElemTot(); nVolElemOwned = DGGeometry->GetNVolElemOwned(); @@ -385,4 +385,4 @@ void CBaselineSolver_FEM::LoadRestart(CGeometry **geometry, CSolver ***solver, C } -CBaselineSolver_FEM::~CBaselineSolver_FEM(void) { } +CBaselineSolver_FEM::~CBaselineSolver_FEM() = default; diff --git a/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp b/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp index 025cb20e82e..a297039ea3a 100644 --- a/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjFEASolver.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjFEASolver.cpp * \brief Main subroutines for solving adjoint FEM elasticity problems. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -84,16 +84,7 @@ CDiscAdjFEASolver::CDiscAdjFEASolver(CGeometry *geometry, CConfig *config, CSolv /*--- Initialize vector structures for multiple material definition ---*/ - nMPROP = config->GetnElasticityMod(); - - /*--- For a material to be fully defined, we need to have the same number for all three parameters ---*/ - bool checkDef = ((config->GetnElasticityMod() == config->GetnPoissonRatio()) && - (config->GetnElasticityMod() == config->GetnMaterialDensity()) && - (config->GetnMaterialDensity() == config->GetnPoissonRatio())); - - if (!checkDef){ - SU2_MPI::Error("WARNING: For a material to be fully defined, E, Nu and Rho need to have the same dimensions.", CURRENT_FUNCTION); - } + nMPROP = config->GetnElasticityMat(); E.resize(nMPROP); Nu.resize(nMPROP); @@ -126,34 +117,28 @@ CDiscAdjFEASolver::CDiscAdjFEASolver(CGeometry *geometry, CConfig *config, CSolv if (fea_dv) ReadDV(config); + SolverName = "ADJ.FEA"; } CDiscAdjFEASolver::~CDiscAdjFEASolver() { delete nodes; } void CDiscAdjFEASolver::SetRecording(CGeometry* geometry, CConfig *config){ - unsigned long iPoint; - unsigned short iVar; - /*--- Reset the solution to the initial (converged) solution ---*/ - for (iPoint = 0; iPoint < nPoint; iPoint++) - for (iVar = 0; iVar < nVar; iVar++) + for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { + for (auto iVar = 0u; iVar < nVar; iVar++) direct_solver->GetNodes()->SetSolution(iPoint, iVar, nodes->GetSolution_Direct(iPoint)[iVar]); + } /*--- Reset the input for time n ---*/ if (config->GetTime_Domain()) { - for (iPoint = 0; iPoint < nPoint; iPoint++) - for (iVar = 0; iVar < nVar; iVar++) + for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) + for (auto iVar = 0u; iVar < nVar; iVar++) AD::ResetInput(direct_solver->GetNodes()->GetSolution_time_n(iPoint)[iVar]); } - /*--- Set the Jacobian to zero since this is not done inside the meanflow iteration - * when running the discrete adjoint solver. ---*/ - - direct_solver->Jacobian.SetValZero(); - /*--- Set indices to zero ---*/ RegisterVariables(geometry, config, true); @@ -213,10 +198,11 @@ void CDiscAdjFEASolver::RegisterVariables(CGeometry *geometry, CConfig *config, Rho_DL.Register(); if (de_effects) EField.Register(); if (fea_dv) DV.Register(); + } - /*--- Register the flow tractions ---*/ - if (config->GetnMarker_Fluid_Load() > 0) - direct_solver->GetNodes()->RegisterFlowTraction(); + /*--- Register or reset the flow tractions ---*/ + if (config->GetnMarker_Fluid_Load() > 0) { + direct_solver->GetNodes()->RegisterFlowTraction(reset); } } @@ -302,7 +288,7 @@ void CDiscAdjFEASolver::ExtractAdjoint_Variables(CGeometry *geometry, CConfig *c if (config->GetnMarker_Fluid_Load() > 0) { for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++){ for (unsigned short iDim = 0; iDim < nDim; iDim++){ - su2double val_sens = direct_solver->GetNodes()->ExtractFlowTraction_Sensitivity(iPoint,iDim); + su2double val_sens = direct_solver->GetNodes()->ExtractFlowTractionSensitivity(iPoint,iDim); nodes->SetFlowTractionSensitivity(iPoint, iDim, val_sens); } } @@ -354,12 +340,17 @@ void CDiscAdjFEASolver::Preprocessing(CGeometry *geometry, CSolver **solver_cont void CDiscAdjFEASolver::SetSensitivity(CGeometry *geometry, CConfig *config, CSolver*){ - E.UpdateTotal(); - Nu.UpdateTotal(); - Rho.UpdateTotal(); - Rho_DL.UpdateTotal(); - if (de_effects) EField.UpdateTotal(); - if (fea_dv) DV.UpdateTotal(); + const bool time_domain = config->GetTime_Domain(); + + /*--- Store the final material sensitivities for the time step to increment them on the next time step. ---*/ + if (time_domain) { + E.Store(); + Nu.Store(); + Rho.Store(); + Rho_DL.Store(); + if (de_effects) EField.Store(); + if (fea_dv) DV.Store(); + } /*--- Extract the topology optimization density sensitivities. ---*/ @@ -367,8 +358,6 @@ void CDiscAdjFEASolver::SetSensitivity(CGeometry *geometry, CConfig *config, CSo /*--- Extract the geometric sensitivities ---*/ - const bool time_domain = config->GetTime_Domain(); - for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) { auto Coord = geometry->nodes->GetCoord(iPoint); @@ -450,7 +439,7 @@ void CDiscAdjFEASolver::ReadDV(const CConfig *config) { nDV = values.size(); DV.resize(nDV); unsigned short iDV = 0; - for (auto x : values) DV[iDV++] = x; + for (const auto& x : values) DV[iDV++] = x; } diff --git a/SU2_CFD/src/solvers/CDiscAdjMeshSolver.cpp b/SU2_CFD/src/solvers/CDiscAdjMeshSolver.cpp index d676990d8df..c23df05b762 100644 --- a/SU2_CFD/src/solvers/CDiscAdjMeshSolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjMeshSolver.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjMeshSolver.cpp * \brief Main subroutines for solving the discrete adjoint mesh problem. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -80,6 +80,7 @@ CDiscAdjMeshSolver::CDiscAdjMeshSolver(CGeometry *geometry, CConfig *config, CSo } static_cast(nodes)->AllocateBoundaryVariables(config); + SolverName = "ADJ.MESH"; } CDiscAdjMeshSolver::~CDiscAdjMeshSolver() { delete nodes; } diff --git a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp index 29f42b3fc94..c42e2b4925f 100644 --- a/SU2_CFD/src/solvers/CDiscAdjSolver.cpp +++ b/SU2_CFD/src/solvers/CDiscAdjSolver.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjSolver.cpp * \brief Main subroutines for solving the discrete adjoint problem. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -112,7 +112,7 @@ CDiscAdjSolver::CDiscAdjSolver(CGeometry *geometry, CConfig *config, CSolver *di } } -CDiscAdjSolver::~CDiscAdjSolver(void) { delete nodes; } +CDiscAdjSolver::~CDiscAdjSolver() { delete nodes; } void CDiscAdjSolver::SetRecording(CGeometry* geometry, CConfig *config){ @@ -146,11 +146,6 @@ void CDiscAdjSolver::SetRecording(CGeometry* geometry, CConfig *config){ END_SU2_OMP_FOR } - /*--- Set the Jacobian to zero since this is not done inside the fluid iteration - * when running the discrete adjoint solver. ---*/ - - direct_solver->Jacobian.SetValZero(); - /*--- Set indices to zero ---*/ RegisterVariables(geometry, config, true); diff --git a/SU2_CFD/src/solvers/CEulerSolver.cpp b/SU2_CFD/src/solvers/CEulerSolver.cpp index f44f76817fa..e665fbe06e1 100644 --- a/SU2_CFD/src/solvers/CEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CEulerSolver.cpp @@ -2,7 +2,7 @@ * \file CEulerSolver.cpp * \brief Main subroutines for solving Finite-Volume Euler flow problems. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -32,6 +32,7 @@ #include "../../include/fluid/CIdealGas.hpp" #include "../../include/fluid/CVanDerWaalsGas.hpp" #include "../../include/fluid/CPengRobinson.hpp" +#include "../../include/fluid/CDataDrivenFluid.hpp" #include "../../include/fluid/CCoolProp.hpp" #include "../../include/numerics_simd/CNumericsSIMD.hpp" #include "../../include/limiters/CLimiterDetails.hpp" @@ -77,7 +78,7 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, /*--- Check for a restart file to evaluate if there is a change in the angle of attack before computing all the non-dimesional quantities. ---*/ - if (!(!restart || (iMesh != MESH_0) || nZone > 1) && config->GetFixed_CL_Mode()) { + if (restart && (iMesh == MESH_0) && nZone <= 1 && config->GetFixed_CL_Mode()) { /*--- Modify file name for a dual-time unsteady restart ---*/ @@ -326,7 +327,7 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, CommunicateInitialState(geometry, config); - /*--- Add the solver name (max 8 characters). ---*/ + /*--- Add the solver name.. ---*/ SolverName = "C.FLOW"; /*--- Finally, check that the static arrays will be large enough (keep this @@ -335,7 +336,7 @@ CEulerSolver::CEulerSolver(CGeometry *geometry, CConfig *config, SU2_MPI::Error("Oops! The CEulerSolver static array sizes are not large enough.",CURRENT_FUNCTION); } -CEulerSolver::~CEulerSolver(void) { +CEulerSolver::~CEulerSolver() { for(auto& model : FluidModel) delete model; } @@ -458,9 +459,9 @@ void CEulerSolver::Set_MPI_ActDisk(CSolver **solver_container, CGeometry *geomet su2double *Buffer_Send_PrimVar = nullptr; long *Buffer_Send_Data = nullptr; - unsigned long *nPointTotal_s = new unsigned long[size]; - unsigned long *nPointTotal_r = new unsigned long[size]; - su2double *iPrimVar = new su2double [nPrimVar_]; + auto *nPointTotal_s = new unsigned long[size]; + auto *nPointTotal_r = new unsigned long[size]; + auto *iPrimVar = new su2double [nPrimVar_]; unsigned long Buffer_Size_PrimVar = 0; unsigned long Buffer_Size_Data = 0; @@ -852,6 +853,12 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes auxFluidModel = new CPengRobinson(Gamma, config->GetGas_Constant(), config->GetPressure_Critical(), config->GetTemperature_Critical(), config->GetAcentric_Factor()); break; + + case DATADRIVEN_FLUID: + + auxFluidModel = new CDataDrivenFluid(config); + + break; case COOLPROP: auxFluidModel = new CCoolProp(config->GetFluid_Name()); @@ -1084,6 +1091,10 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes config->GetAcentric_Factor()); break; + case DATADRIVEN_FLUID: + FluidModel[thread] = new CDataDrivenFluid(config, false); + break; + case COOLPROP: FluidModel[thread] = new CCoolProp(config->GetFluid_Name()); break; @@ -1093,6 +1104,7 @@ void CEulerSolver::SetNondimensionalization(CConfig *config, unsigned short iMes if (viscous) { GetFluidModel()->SetLaminarViscosityModel(config); GetFluidModel()->SetThermalConductivityModel(config); + GetFluidModel()->SetMassDiffusivityModel(config); } } @@ -2009,7 +2021,6 @@ void CEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_contain const bool axisymmetric = config->GetAxisymmetric(); const bool gravity = (config->GetGravityForce() == YES); const bool harmonic_balance = (config->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE); - const bool windgust = config->GetWind_Gust(); const bool body_force = config->GetBody_Force(); const bool vorticity_confinement = config->GetVorticityConfinement(); const bool ideal_gas = (config->GetKind_FluidModel() == STANDARD_AIR) || @@ -2179,37 +2190,6 @@ void CEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_contain END_SU2_OMP_FOR } - if (windgust) { - - /*--- Loop over all points ---*/ - SU2_OMP_FOR_DYN(omp_chunk_size) - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { - - /*--- Load the wind gust ---*/ - numerics->SetWindGust(nodes->GetWindGust(iPoint), nodes->GetWindGust(iPoint)); - - /*--- Load the wind gust derivatives ---*/ - numerics->SetWindGustDer(nodes->GetWindGustDer(iPoint), nodes->GetWindGustDer(iPoint)); - - /*--- Load the primitive variables ---*/ - numerics->SetPrimitive(nodes->GetPrimitive(iPoint), nodes->GetPrimitive(iPoint)); - - /*--- Load the volume of the dual mesh cell ---*/ - numerics->SetVolume(geometry->nodes->GetVolume(iPoint)); - - /*--- Compute the rotating frame source residual ---*/ - auto residual = numerics->ComputeResidual(config); - - /*--- Add the source residual to the total ---*/ - LinSysRes.AddBlock(iPoint, residual); - - /*--- Add the implicit Jacobian contribution ---*/ - if (implicit) Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); - - } - END_SU2_OMP_FOR - } - if (vorticity_confinement) { CNumerics* second_numerics = numerics_container[SOURCE_SECOND_TERM + omp_get_thread_num()*MAX_TERMS]; @@ -2559,32 +2539,32 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns if (Evaluate_BC) { - su2double *Inlet_MassFlow = new su2double [config->GetnMarker_All()](); - su2double *Inlet_ReverseMassFlow = new su2double [config->GetnMarker_All()](); - su2double *Inlet_Pressure = new su2double [config->GetnMarker_All()](); - su2double *Inlet_Mach = new su2double [config->GetnMarker_All()](); - su2double *Inlet_MaxPressure = new su2double [config->GetnMarker_All()](); - su2double *Inlet_MinPressure = new su2double [config->GetnMarker_All()](); - su2double *Inlet_TotalPressure = new su2double [config->GetnMarker_All()](); - su2double *Inlet_Temperature = new su2double [config->GetnMarker_All()](); - su2double *Inlet_TotalTemperature = new su2double [config->GetnMarker_All()](); - su2double *Inlet_Area = new su2double [config->GetnMarker_All()](); - su2double *Inlet_RamDrag = new su2double [config->GetnMarker_All()](); - su2double *Inlet_Force = new su2double [config->GetnMarker_All()](); - su2double *Inlet_Power = new su2double [config->GetnMarker_All()](); - su2double *Inlet_XCG = new su2double [config->GetnMarker_All()](); - su2double *Inlet_YCG = new su2double [config->GetnMarker_All()](); - su2double *Inlet_ZCG = new su2double [config->GetnMarker_All()](); - - su2double *Outlet_MassFlow = new su2double [config->GetnMarker_All()](); - su2double *Outlet_Pressure = new su2double [config->GetnMarker_All()](); - su2double *Outlet_TotalPressure = new su2double [config->GetnMarker_All()](); - su2double *Outlet_Temperature = new su2double [config->GetnMarker_All()](); - su2double *Outlet_TotalTemperature = new su2double [config->GetnMarker_All()](); - su2double *Outlet_Area = new su2double [config->GetnMarker_All()](); - su2double *Outlet_GrossThrust = new su2double [config->GetnMarker_All()](); - su2double *Outlet_Force = new su2double [config->GetnMarker_All()](); - su2double *Outlet_Power = new su2double [config->GetnMarker_All()](); + auto *Inlet_MassFlow = new su2double [config->GetnMarker_All()](); + auto *Inlet_ReverseMassFlow = new su2double [config->GetnMarker_All()](); + auto *Inlet_Pressure = new su2double [config->GetnMarker_All()](); + auto *Inlet_Mach = new su2double [config->GetnMarker_All()](); + auto *Inlet_MaxPressure = new su2double [config->GetnMarker_All()](); + auto *Inlet_MinPressure = new su2double [config->GetnMarker_All()](); + auto *Inlet_TotalPressure = new su2double [config->GetnMarker_All()](); + auto *Inlet_Temperature = new su2double [config->GetnMarker_All()](); + auto *Inlet_TotalTemperature = new su2double [config->GetnMarker_All()](); + auto *Inlet_Area = new su2double [config->GetnMarker_All()](); + auto *Inlet_RamDrag = new su2double [config->GetnMarker_All()](); + auto *Inlet_Force = new su2double [config->GetnMarker_All()](); + auto *Inlet_Power = new su2double [config->GetnMarker_All()](); + auto *Inlet_XCG = new su2double [config->GetnMarker_All()](); + auto *Inlet_YCG = new su2double [config->GetnMarker_All()](); + auto *Inlet_ZCG = new su2double [config->GetnMarker_All()](); + + auto *Outlet_MassFlow = new su2double [config->GetnMarker_All()](); + auto *Outlet_Pressure = new su2double [config->GetnMarker_All()](); + auto *Outlet_TotalPressure = new su2double [config->GetnMarker_All()](); + auto *Outlet_Temperature = new su2double [config->GetnMarker_All()](); + auto *Outlet_TotalTemperature = new su2double [config->GetnMarker_All()](); + auto *Outlet_Area = new su2double [config->GetnMarker_All()](); + auto *Outlet_GrossThrust = new su2double [config->GetnMarker_All()](); + auto *Outlet_Force = new su2double [config->GetnMarker_All()](); + auto *Outlet_Power = new su2double [config->GetnMarker_All()](); /*--- Comute MassFlow, average temp, press, etc. ---*/ @@ -2723,59 +2703,59 @@ void CEulerSolver::GetPower_Properties(CGeometry *geometry, CConfig *config, uns /*--- Copy to the appropriate structure ---*/ - su2double *Inlet_MassFlow_Local = new su2double [nMarker_Inlet](); - su2double *Inlet_ReverseMassFlow_Local = new su2double [nMarker_Inlet](); - su2double *Inlet_Temperature_Local = new su2double [nMarker_Inlet](); - su2double *Inlet_TotalTemperature_Local = new su2double [nMarker_Inlet](); - su2double *Inlet_Pressure_Local = new su2double [nMarker_Inlet](); - su2double *Inlet_Mach_Local = new su2double [nMarker_Inlet](); - su2double *Inlet_MinPressure_Local = new su2double [nMarker_Inlet](); - su2double *Inlet_MaxPressure_Local = new su2double [nMarker_Inlet](); - su2double *Inlet_Power_Local = new su2double [nMarker_Inlet](); - su2double *Inlet_TotalPressure_Local = new su2double [nMarker_Inlet](); - su2double *Inlet_RamDrag_Local = new su2double [nMarker_Inlet](); - su2double *Inlet_Force_Local = new su2double [nMarker_Inlet](); - su2double *Inlet_Area_Local = new su2double [nMarker_Inlet](); - su2double *Inlet_XCG_Local = new su2double [nMarker_Inlet](); - su2double *Inlet_YCG_Local = new su2double [nMarker_Inlet](); - su2double *Inlet_ZCG_Local = new su2double [nMarker_Inlet](); - - su2double *Inlet_MassFlow_Total = new su2double [nMarker_Inlet](); - su2double *Inlet_ReverseMassFlow_Total = new su2double [nMarker_Inlet](); - su2double *Inlet_Pressure_Total = new su2double [nMarker_Inlet](); - su2double *Inlet_Mach_Total = new su2double [nMarker_Inlet](); - su2double *Inlet_MinPressure_Total = new su2double [nMarker_Inlet](); - su2double *Inlet_MaxPressure_Total = new su2double [nMarker_Inlet](); - su2double *Inlet_Power_Total = new su2double [nMarker_Inlet](); - su2double *Inlet_TotalPressure_Total = new su2double [nMarker_Inlet](); - su2double *Inlet_Temperature_Total = new su2double [nMarker_Inlet](); - su2double *Inlet_TotalTemperature_Total = new su2double [nMarker_Inlet](); - su2double *Inlet_RamDrag_Total = new su2double [nMarker_Inlet](); - su2double *Inlet_Force_Total = new su2double [nMarker_Inlet](); - su2double *Inlet_Area_Total = new su2double [nMarker_Inlet](); - su2double *Inlet_XCG_Total = new su2double [nMarker_Inlet](); - su2double *Inlet_YCG_Total = new su2double [nMarker_Inlet](); - su2double *Inlet_ZCG_Total = new su2double [nMarker_Inlet](); - - su2double *Outlet_MassFlow_Local = new su2double [nMarker_Outlet](); - su2double *Outlet_Pressure_Local = new su2double [nMarker_Outlet](); - su2double *Outlet_TotalPressure_Local = new su2double [nMarker_Outlet](); - su2double *Outlet_Temperature_Local = new su2double [nMarker_Outlet](); - su2double *Outlet_TotalTemperature_Local = new su2double [nMarker_Outlet](); - su2double *Outlet_GrossThrust_Local = new su2double [nMarker_Outlet](); - su2double *Outlet_Force_Local = new su2double [nMarker_Outlet](); - su2double *Outlet_Power_Local = new su2double [nMarker_Outlet](); - su2double *Outlet_Area_Local = new su2double [nMarker_Outlet](); - - su2double *Outlet_MassFlow_Total = new su2double [nMarker_Outlet](); - su2double *Outlet_Pressure_Total = new su2double [nMarker_Outlet](); - su2double *Outlet_TotalPressure_Total = new su2double [nMarker_Outlet](); - su2double *Outlet_Temperature_Total = new su2double [nMarker_Outlet](); - su2double *Outlet_TotalTemperature_Total = new su2double [nMarker_Outlet](); - su2double *Outlet_GrossThrust_Total = new su2double [nMarker_Outlet](); - su2double *Outlet_Force_Total = new su2double [nMarker_Outlet](); - su2double *Outlet_Power_Total = new su2double [nMarker_Outlet](); - su2double *Outlet_Area_Total = new su2double [nMarker_Outlet](); + auto *Inlet_MassFlow_Local = new su2double [nMarker_Inlet](); + auto *Inlet_ReverseMassFlow_Local = new su2double [nMarker_Inlet](); + auto *Inlet_Temperature_Local = new su2double [nMarker_Inlet](); + auto *Inlet_TotalTemperature_Local = new su2double [nMarker_Inlet](); + auto *Inlet_Pressure_Local = new su2double [nMarker_Inlet](); + auto *Inlet_Mach_Local = new su2double [nMarker_Inlet](); + auto *Inlet_MinPressure_Local = new su2double [nMarker_Inlet](); + auto *Inlet_MaxPressure_Local = new su2double [nMarker_Inlet](); + auto *Inlet_Power_Local = new su2double [nMarker_Inlet](); + auto *Inlet_TotalPressure_Local = new su2double [nMarker_Inlet](); + auto *Inlet_RamDrag_Local = new su2double [nMarker_Inlet](); + auto *Inlet_Force_Local = new su2double [nMarker_Inlet](); + auto *Inlet_Area_Local = new su2double [nMarker_Inlet](); + auto *Inlet_XCG_Local = new su2double [nMarker_Inlet](); + auto *Inlet_YCG_Local = new su2double [nMarker_Inlet](); + auto *Inlet_ZCG_Local = new su2double [nMarker_Inlet](); + + auto *Inlet_MassFlow_Total = new su2double [nMarker_Inlet](); + auto *Inlet_ReverseMassFlow_Total = new su2double [nMarker_Inlet](); + auto *Inlet_Pressure_Total = new su2double [nMarker_Inlet](); + auto *Inlet_Mach_Total = new su2double [nMarker_Inlet](); + auto *Inlet_MinPressure_Total = new su2double [nMarker_Inlet](); + auto *Inlet_MaxPressure_Total = new su2double [nMarker_Inlet](); + auto *Inlet_Power_Total = new su2double [nMarker_Inlet](); + auto *Inlet_TotalPressure_Total = new su2double [nMarker_Inlet](); + auto *Inlet_Temperature_Total = new su2double [nMarker_Inlet](); + auto *Inlet_TotalTemperature_Total = new su2double [nMarker_Inlet](); + auto *Inlet_RamDrag_Total = new su2double [nMarker_Inlet](); + auto *Inlet_Force_Total = new su2double [nMarker_Inlet](); + auto *Inlet_Area_Total = new su2double [nMarker_Inlet](); + auto *Inlet_XCG_Total = new su2double [nMarker_Inlet](); + auto *Inlet_YCG_Total = new su2double [nMarker_Inlet](); + auto *Inlet_ZCG_Total = new su2double [nMarker_Inlet](); + + auto *Outlet_MassFlow_Local = new su2double [nMarker_Outlet](); + auto *Outlet_Pressure_Local = new su2double [nMarker_Outlet](); + auto *Outlet_TotalPressure_Local = new su2double [nMarker_Outlet](); + auto *Outlet_Temperature_Local = new su2double [nMarker_Outlet](); + auto *Outlet_TotalTemperature_Local = new su2double [nMarker_Outlet](); + auto *Outlet_GrossThrust_Local = new su2double [nMarker_Outlet](); + auto *Outlet_Force_Local = new su2double [nMarker_Outlet](); + auto *Outlet_Power_Local = new su2double [nMarker_Outlet](); + auto *Outlet_Area_Local = new su2double [nMarker_Outlet](); + + auto *Outlet_MassFlow_Total = new su2double [nMarker_Outlet](); + auto *Outlet_Pressure_Total = new su2double [nMarker_Outlet](); + auto *Outlet_TotalPressure_Total = new su2double [nMarker_Outlet](); + auto *Outlet_Temperature_Total = new su2double [nMarker_Outlet](); + auto *Outlet_TotalTemperature_Total = new su2double [nMarker_Outlet](); + auto *Outlet_GrossThrust_Total = new su2double [nMarker_Outlet](); + auto *Outlet_Force_Total = new su2double [nMarker_Outlet](); + auto *Outlet_Power_Total = new su2double [nMarker_Outlet](); + auto *Outlet_Area_Total = new su2double [nMarker_Outlet](); /*--- Copy the values to the local array for MPI ---*/ @@ -3519,12 +3499,11 @@ void CEulerSolver::SetActDisk_BCThrust(CGeometry *geometry, CSolver **solver_con if ((InnerIter % Iter_Fixed_NetThrust == 0) && (InnerIter != 0)) { BCThrust_Counter++; - if ((BCThrust_Counter != 0) && + Update_BCThrust_Bool = (BCThrust_Counter != 0) && (BCThrust_Counter != 1) && (BCThrust_Counter != Update_BCThrust) && (BCThrust_Counter != Update_BCThrust + 2) && - (BCThrust_Counter != Update_BCThrust + 4) ) Update_BCThrust_Bool = true; - else Update_BCThrust_Bool = false; + (BCThrust_Counter != Update_BCThrust + 4); } /*--- Store the update boolean for use on other mesh levels in the MG ---*/ @@ -4062,8 +4041,6 @@ void CEulerSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_contain CConfig *config, unsigned short iMesh, bool Output) { const auto InnerIter = config->GetInnerIter(); - const su2double AoS = config->GetAoS()*PI_NUMBER/180.0; - /* --- Initialize values at first iteration --- */ if (InnerIter == 0) { @@ -4102,24 +4079,7 @@ void CEulerSolver::SetFarfield_AoA(CGeometry *geometry, CSolver **solver_contain AoA = AoA + AoA_inc; config->SetAoA(AoA); } - - AoA *= PI_NUMBER/180.0; - - /*--- Update the freestream velocity vector at the farfield - * Compute the new freestream velocity with the updated AoA, - * "Velocity_Inf" is shared with config. ---*/ - - const su2double Vel_Infty_Mag = GeometryToolbox::Norm(nDim, Velocity_Inf); - - if (nDim == 2) { - Velocity_Inf[0] = cos(AoA)*Vel_Infty_Mag; - Velocity_Inf[1] = sin(AoA)*Vel_Infty_Mag; - } - else { - Velocity_Inf[0] = cos(AoA)*cos(AoS)*Vel_Infty_Mag; - Velocity_Inf[1] = sin(AoS)*Vel_Infty_Mag; - Velocity_Inf[2] = sin(AoA)*cos(AoS)*Vel_Infty_Mag; - } + UpdateFarfieldVelocity(config); } } @@ -4342,7 +4302,7 @@ void CEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_container, bool viscous = config->GetViscous(); bool tkeNeeded = config->GetKind_Turb_Model() == TURB_MODEL::SST; - su2double *Normal = new su2double[nDim]; + auto *Normal = new su2double[nDim]; /*--- Loop over all the vertices on this boundary marker ---*/ @@ -4883,6 +4843,11 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, Energy_b = u_b[nVar-1]/Density_b; StaticEnergy_b = Energy_b - 0.5*Velocity2_b; GetFluidModel()->SetTDState_rhoe(Density_b, StaticEnergy_b); + + /*--- Store number of Newton iterations at BC ---*/ + if(config->GetKind_FluidModel() == DATADRIVEN_FLUID) + nodes->SetNewtonSolverIterations(iPoint, GetFluidModel()->GetnIter_Newton()); + Pressure_b = GetFluidModel()->GetPressure(); Temperature_b = GetFluidModel()->GetTemperature(); Enthalpy_b = Energy_b + Pressure_b/Density_b; @@ -5053,6 +5018,9 @@ void CEulerSolver::BC_Riemann(CGeometry *geometry, CSolver **solver_container, Jacobian.SubtractBlock2Diag(iPoint, residual.jacobian_i); } + /*--- Store number of Newton iterations at BC ---*/ + if(config->GetKind_FluidModel() == DATADRIVEN_FLUID) + nodes->SetNewtonSolverIterations(iPoint, GetFluidModel()->GetnIter_Newton()); } } @@ -5651,6 +5619,7 @@ void CEulerSolver::PreprocessBC_Giles(CGeometry *geometry, CConfig *config, CNum { Velocity_i[iDim] = nodes->GetVelocity(iPoint,iDim); } + ComputeTurboVelocity(Velocity_i, turboNormal, turboVelocity, marker_flag, config->GetKind_TurboMachinery(iZone)); if(nDim ==2){ @@ -6474,6 +6443,9 @@ void CEulerSolver::BC_Giles(CGeometry *geometry, CSolver **solver_container, CNu Jacobian.SubtractBlock2Diag(iPoint, residual.jacobian_i); } + /*--- Store number of Newton iterations at BC ---*/ + if(config->GetKind_FluidModel() == DATADRIVEN_FLUID) + nodes->SetNewtonSolverIterations(iPoint, GetFluidModel()->GetnIter_Newton()); } END_SU2_OMP_FOR @@ -6829,7 +6801,7 @@ void CEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, bool gravity = (config->GetGravityForce()); bool tkeNeeded = (config->GetKind_Turb_Model() == TURB_MODEL::SST); - su2double *Normal = new su2double[nDim]; + auto *Normal = new su2double[nDim]; /*--- Loop over all the vertices on this boundary marker ---*/ @@ -7085,7 +7057,7 @@ void CEulerSolver::BC_Supersonic_Outlet(CGeometry *geometry, CSolver **solver_co bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); string Marker_Tag = config->GetMarker_All_TagBound(val_marker); - su2double *Normal = new su2double[nDim]; + auto *Normal = new su2double[nDim]; /*--- Supersonic outlet flow: there are no ingoing characteristics, so all flow variables can should be interpolated from the domain. ---*/ @@ -7213,7 +7185,7 @@ void CEulerSolver::BC_Engine_Inflow(CGeometry *geometry, CSolver **solver_contai su2double Baseline_Press = 0.75 * config->GetPressure_FreeStreamND(); bool Engine_HalfModel = config->GetEngine_HalfModel(); - su2double *Normal = new su2double[nDim]; + auto *Normal = new su2double[nDim]; if (Kind_Engine_Inflow == FAN_FACE_MACH) { @@ -7429,7 +7401,7 @@ void CEulerSolver::BC_Engine_Exhaust(CGeometry *geometry, CSolver **solver_conta su2double DampingFactor = config->GetDamp_Engine_Exhaust(); su2double Baseline_Press = 0.75 * config->GetPressure_FreeStreamND(); - su2double *Normal = new su2double[nDim]; + auto *Normal = new su2double[nDim]; /*--- Retrieve the specified exhaust pressure in the engine (non-dimensional). ---*/ @@ -7719,8 +7691,8 @@ void CEulerSolver::BC_ActDisk(CGeometry *geometry, CSolver **solver_container, C bool ratio = (config->GetActDisk_Jump() == RATIO); su2double SecondaryFlow = config->GetSecondaryFlow_ActDisk(); - su2double *Normal = new su2double[nDim]; - su2double *Flow_Dir = new su2double[nDim]; + auto *Normal = new su2double[nDim]; + auto *Flow_Dir = new su2double[nDim]; /*--- Loop over all the vertices on this boundary marker ---*/ @@ -8519,7 +8491,7 @@ void CEulerSolver::PreprocessAverage(CSolver **solver, CGeometry *geometry, CCon SU2_MPI::Allreduce(&MyTotalAreaDensity, &TotalAreaDensity, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&MyTotalAreaPressure, &TotalAreaPressure, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - su2double* MyTotalAreaVelocity = new su2double[nDim]; + auto* MyTotalAreaVelocity = new su2double[nDim]; for (iDim = 0; iDim < nDim; iDim++) { MyTotalAreaVelocity[iDim] = TotalAreaVelocity[iDim]; @@ -8867,7 +8839,7 @@ void CEulerSolver::TurboAverageProcess(CSolver **solver, CGeometry *geometry, CC TotalMassKine = Allreduce(TotalMassKine); TotalMassOmega = Allreduce(TotalMassOmega); - su2double* buffer = new su2double[max(nVar,nDim)]; + auto* buffer = new su2double[max(nVar,nDim)]; auto Allreduce_inplace = [buffer](int size, su2double* x) { SU2_MPI::Allreduce(x, buffer, size, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); @@ -9267,9 +9239,9 @@ void CEulerSolver::GatherInOutAverageValues(CConfig *config, CGeometry *geometry #ifdef HAVE_MPI unsigned short i, n1, n2, n1t,n2t; - su2double *TurbPerfIn= NULL,*TurbPerfOut= NULL; - su2double *TotTurbPerfIn = NULL,*TotTurbPerfOut = NULL; - int *TotMarkerTP = NULL; + su2double *TurbPerfIn= nullptr,*TurbPerfOut= nullptr; + su2double *TotTurbPerfIn = nullptr,*TotTurbPerfOut = nullptr; + int *TotMarkerTP = nullptr; n1 = 8; n2 = 8; diff --git a/SU2_CFD/src/solvers/CFEASolver.cpp b/SU2_CFD/src/solvers/CFEASolver.cpp index 69b93a180e3..507ebbf4d47 100644 --- a/SU2_CFD/src/solvers/CFEASolver.cpp +++ b/SU2_CFD/src/solvers/CFEASolver.cpp @@ -2,7 +2,7 @@ * \file CFEASolver.cpp * \brief Main subroutines for solving direct FEM elasticity problems. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -50,6 +50,7 @@ CFEASolver::CFEASolver(LINEAR_SOLVER_MODE mesh_deform_mode) : CFEASolverBase(mes CFEASolver::CFEASolver(CGeometry *geometry, CConfig *config) : CFEASolverBase(geometry, config) { bool dynamic = (config->GetTime_Domain()); + config->SetDelta_UnstTimeND(config->GetDelta_UnstTime()); /*--- Test whether we consider dielectric elastomers ---*/ bool de_effects = config->GetDE_Effects(); @@ -119,7 +120,7 @@ CFEASolver::CFEASolver(CGeometry *geometry, CConfig *config) : CFEASolverBase(ge if (dynamic) nSolVar = 3 * nVar; else nSolVar = nVar; - su2double* SolInit = new su2double[nSolVar](); + auto* SolInit = new su2double[nSolVar](); /*--- Initialize from zero everywhere ---*/ @@ -211,11 +212,11 @@ CFEASolver::CFEASolver(CGeometry *geometry, CConfig *config) : CFEASolverBase(ge Set_VertexEliminationSchedule(geometry, essentialMarkers); } - /*--- Add the solver name (max 8 characters) ---*/ + /*--- Add the solver name. ---*/ SolverName = "FEA"; } -CFEASolver::~CFEASolver(void) { +CFEASolver::~CFEASolver() { if (element_properties != nullptr) { for (unsigned long iElem = 0; iElem < nElement; iElem++) @@ -382,8 +383,8 @@ void CFEASolver::Set_ElementProperties(CGeometry *geometry, CConfig *config) { /*--- Detect a wrong solution file ---*/ if (iElem_Global_Local != nElement) { - SU2_MPI::Error(string("The properties file ") + filename + string(" doesn't match with the mesh file!\n") + - string("It could be empty lines at the end of the file."), CURRENT_FUNCTION); + SU2_MPI::Error("The properties file " + filename + " doesn't match with the mesh file!\n" + "It could be empty lines at the end of the file.", CURRENT_FUNCTION); } } @@ -614,8 +615,8 @@ void CFEASolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_con SU2_OMP_PARALLEL { + su2double zeros[MAXNVAR] = {0.0}; if (!config->GetPrestretch()) { - su2double zeros[MAXNVAR] = {0.0}; SU2_OMP_FOR_STAT(omp_chunk_size) for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) nodes->SetSolution(iPoint, zeros); @@ -627,6 +628,14 @@ void CFEASolver::SetInitialCondition(CGeometry **geometry, CSolver ***solver_con nodes->SetSolution(iPoint, nodes->GetPrestretch(iPoint)); END_SU2_OMP_FOR } + if (config->GetTime_Domain()) { + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) { + nodes->SetSolution_Vel(iPoint, zeros); + nodes->SetSolution_Accel(iPoint, zeros); + } + END_SU2_OMP_FOR + } } END_SU2_OMP_PARALLEL } @@ -1282,7 +1291,7 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, if (outputReactions) { - bool dynamic = (config->GetDynamic_Analysis() == DYNAMIC); + const bool dynamic = config->GetTime_Domain(); ofstream myfile; myfile.open ("Reactions.txt"); @@ -1331,9 +1340,6 @@ void CFEASolver::Compute_NodalStress(CGeometry *geometry, CNumerics **numerics, else if (dynamic) { switch (config->GetKind_TimeIntScheme_FEA()) { - case (STRUCT_TIME_INT::CD_EXPLICIT): - cout << "NOT IMPLEMENTED YET" << endl; - break; case (STRUCT_TIME_INT::NEWMARK_IMPLICIT): /*--- Loop over all points, and set aux vector TimeRes_Aux = a0*U+a2*U'+a3*U'' ---*/ @@ -1481,14 +1487,11 @@ void CFEASolver::Compute_DeadLoad(CGeometry *geometry, CNumerics **numerics, con void CFEASolver::Compute_IntegrationConstants(const CConfig *config) { - su2double Delta_t= config->GetDelta_DynTime(); + su2double Delta_t= config->GetDelta_UnstTime(); su2double gamma = config->GetNewmark_gamma(), beta = config->GetNewmark_beta(); switch (config->GetKind_TimeIntScheme_FEA()) { - case (STRUCT_TIME_INT::CD_EXPLICIT): - cout << "NOT IMPLEMENTED YET" << endl; - break; case (STRUCT_TIME_INT::NEWMARK_IMPLICIT): /*--- Integration constants for Newmark scheme ---*/ @@ -1652,7 +1655,7 @@ void CFEASolver::BC_DispDir(CGeometry *geometry, const CConfig *config, unsigned const su2double *DispDirLocal = config->GetDisp_Dir(TagBound); su2double DispDirMod = Norm(nDim, DispDirLocal); - su2double CurrentTime = config->GetCurrent_DynTime(); + su2double CurrentTime = config->GetCurrent_UnstTime(); su2double RampTime = config->GetRamp_Time(); su2double ModAmpl = Compute_LoadCoefficient(CurrentTime, RampTime, config); @@ -1818,7 +1821,7 @@ void CFEASolver::BC_Normal_Load(CGeometry *geometry, const CConfig *config, unsi /*--- Retrieve the normal pressure and the application conditions for the considered boundary. ---*/ - su2double CurrentTime = config->GetCurrent_DynTime(); + su2double CurrentTime = config->GetCurrent_UnstTime(); su2double Ramp_Time = config->GetRamp_Time(); su2double ModAmpl = Compute_LoadCoefficient(CurrentTime, Ramp_Time, config); @@ -1914,7 +1917,7 @@ void CFEASolver::BC_Dir_Load(CGeometry *geometry, const CConfig *config, unsigne /*--- Compute the norm of the vector that was passed in the config file. ---*/ su2double LoadNorm = Norm(nDim, Load_Dir_Local); - su2double CurrentTime=config->GetCurrent_DynTime(); + su2double CurrentTime=config->GetCurrent_UnstTime(); su2double Ramp_Time = config->GetRamp_Time(); su2double ModAmpl = Compute_LoadCoefficient(CurrentTime, Ramp_Time, config); @@ -2036,7 +2039,7 @@ su2double CFEASolver::Compute_LoadCoefficient(su2double CurrentTime, su2double R /*--- This offset introduces the ramp load in dynamic cases starting from the restart point. ---*/ bool offset = (restart && fsi && (!stat_fsi)); - su2double DeltaT = config->GetDelta_DynTime(); + su2double DeltaT = config->GetDelta_UnstTime(); su2double OffsetTime = offset? DeltaT * (config->GetRestart_Iter()-1) : su2double(0.0); /*--- Polynomial functions from https://en.wikipedia.org/wiki/Smoothstep ---*/ @@ -2507,7 +2510,7 @@ void CFEASolver::Solve_System(CGeometry *geometry, CConfig *config) { void CFEASolver::PredictStruct_Displacement(CGeometry *geometry, const CConfig *config) { const unsigned short predOrder = config->GetPredictorOrder(); - const su2double Delta_t = config->GetDelta_DynTime(); + const su2double Delta_t = config->GetDelta_UnstTime(); const bool dynamic = config->GetTime_Domain(); if(predOrder > 2 && rank == MASTER_NODE) @@ -2575,26 +2578,26 @@ void CFEASolver::ComputeAitken_Coefficient(CGeometry *geometry, const CConfig *c if (RelaxMethod_FSI == BGS_RELAXATION::NONE) { - SetWAitken_Dyn(1.0); + WAitken_Dyn = 1.0; } else if (RelaxMethod_FSI == BGS_RELAXATION::FIXED) { - SetWAitken_Dyn(config->GetAitkenStatRelax()); + WAitken_Dyn = config->GetAitkenStatRelax(); } else if (RelaxMethod_FSI == BGS_RELAXATION::AITKEN) { if (iOuterIter == 0) { - WAitkDyn_tn1 = GetWAitken_Dyn_tn1(); + WAitkDyn_tn1 = WAitken_Dyn_tn1; WAitkDyn_Max = config->GetAitkenDynMaxInit(); WAitkDyn_Min = config->GetAitkenDynMinInit(); WAitkDyn = min(WAitkDyn_tn1, WAitkDyn_Max); WAitkDyn = max(WAitkDyn, WAitkDyn_Min); - SetWAitken_Dyn(WAitkDyn); + WAitken_Dyn = WAitkDyn; } else { @@ -2625,7 +2628,7 @@ void CFEASolver::ComputeAitken_Coefficient(CGeometry *geometry, const CConfig *c SU2_MPI::Allreduce(&sbuf_numAitk, &rbuf_numAitk, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); SU2_MPI::Allreduce(&sbuf_denAitk, &rbuf_denAitk, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - WAitkDyn = GetWAitken_Dyn(); + WAitkDyn = WAitken_Dyn; if (rbuf_denAitk > EPS) { WAitkDyn = - 1.0 * WAitkDyn * rbuf_numAitk / rbuf_denAitk ; @@ -2634,7 +2637,7 @@ void CFEASolver::ComputeAitken_Coefficient(CGeometry *geometry, const CConfig *c WAitkDyn = max(WAitkDyn, 0.1); WAitkDyn = min(WAitkDyn, 1.0); - SetWAitken_Dyn(WAitkDyn); + WAitken_Dyn = WAitkDyn; } @@ -2647,7 +2650,7 @@ void CFEASolver::ComputeAitken_Coefficient(CGeometry *geometry, const CConfig *c void CFEASolver::SetAitken_Relaxation(CGeometry *geometry, const CConfig *config) { - const su2double WAitken = GetWAitken_Dyn(); + const su2double WAitken = WAitken_Dyn; const bool dynamic = config->GetTime_Domain(); /*--- To nPoint to avoid communication. ---*/ @@ -3107,8 +3110,8 @@ void CFEASolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *c /*--- Detect a wrong solution file. ---*/ if (counter != nPointDomain) { - SU2_MPI::Error(string("The solution file ") + filename + string(" doesn't match with the mesh file!\n") + - string("It could be empty lines at the end of the file."), CURRENT_FUNCTION); + SU2_MPI::Error("The solution file " + filename + " doesn't match with the mesh file!\n" + "It could be empty lines at the end of the file.", CURRENT_FUNCTION); } /*--- MPI. If dynamic, we also need to communicate the old solution. ---*/ @@ -3116,7 +3119,9 @@ void CFEASolver::LoadRestart(CGeometry **geometry, CSolver ***solver, CConfig *c InitiateComms(geometry[MESH_0], config, SOLUTION_FEA); CompleteComms(geometry[MESH_0], config, SOLUTION_FEA); - if (dynamic) nodes->Set_Solution_time_n(); + /*--- It's important to not push back the solution when this function is used to load solutions for + * unsteady discrete adjoints, otherwise we overwrite one of the two solutions needed. ---*/ + if (dynamic && val_update_geo) nodes->Set_Solution_time_n(); if (fluid_structure) { for (auto iPoint = 0ul; iPoint < nPoint; ++iPoint) { @@ -3213,13 +3218,13 @@ void CFEASolver::FilterElementDensities(CGeometry *geometry, const CConfig *conf { ENUM_FILTER_KERNEL type; config->GetTopology_Optim_Kernel(iKernel,type,param,radius); - kernels.push_back(make_pair(type,param)); + kernels.emplace_back(type,param); filter_radius.push_back(radius); } search_lim = config->GetTopology_Search_Limit(); config->GetTopology_Optim_Projection(type,param); - su2double *physical_rho = new su2double [nElement]; + auto *physical_rho = new su2double [nElement]; /*--- "Rectify" the input, initialize the physical density with the design density (the filter function works in-place). ---*/ diff --git a/SU2_CFD/src/solvers/CFEASolverBase.cpp b/SU2_CFD/src/solvers/CFEASolverBase.cpp index 23bd6af4cb8..1280baf9bc6 100644 --- a/SU2_CFD/src/solvers/CFEASolverBase.cpp +++ b/SU2_CFD/src/solvers/CFEASolverBase.cpp @@ -2,7 +2,7 @@ * \file CFEASolverBase.cpp * \brief Common class template for FEA solvers * \author T. Dick - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp index 7acc893e986..42562cf6ba0 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_EulerSolver.cpp @@ -2,7 +2,7 @@ * \file CFEM_DG_EulerSolver.cpp * \brief Main subroutines for solving finite element Euler flow problems * \author J. Alonso, E. van der Weide, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -32,10 +32,13 @@ #include "../../include/fluid/CVanDerWaalsGas.hpp" #include "../../include/fluid/CPengRobinson.hpp" #include "../../include/fluid/CCoolProp.hpp" +#include "../../include/fluid/CDataDrivenFluid.hpp" -#define SIZE_ARR_NORM 8 +enum { +SIZE_ARR_NORM = 8 +}; -CFEM_DG_EulerSolver::CFEM_DG_EulerSolver(void) : CSolver() { +CFEM_DG_EulerSolver::CFEM_DG_EulerSolver() : CSolver() { /*--- Basic array initialization ---*/ @@ -153,7 +156,7 @@ CFEM_DG_EulerSolver::CFEM_DG_EulerSolver(CGeometry *geometry, CConfig *config, u /*--- Create an object of the class CMeshFEM_DG and retrieve the necessary geometrical information for the FEM DG solver. ---*/ - CMeshFEM_DG *DGGeometry = dynamic_cast(geometry); + auto *DGGeometry = dynamic_cast(geometry); nVolElemTot = DGGeometry->GetNVolElemTot(); nVolElemOwned = DGGeometry->GetNVolElemOwned(); @@ -723,11 +726,11 @@ CFEM_DG_EulerSolver::CFEM_DG_EulerSolver(CGeometry *geometry, CConfig *config, u the tasks to be done for one space time step. */ SetUpTaskList(config); - /*--- Add the solver name (max 8 characters) ---*/ - SolverName = "DG FLOW"; + /*--- Add the solver name. ---*/ + SolverName = "DG.FLOW"; } -CFEM_DG_EulerSolver::~CFEM_DG_EulerSolver(void) { +CFEM_DG_EulerSolver::~CFEM_DG_EulerSolver() { delete FluidModel; delete blasFunctions; @@ -895,6 +898,20 @@ void CFEM_DG_EulerSolver::SetNondimensionalization(CConfig *config, } break; + case DATADRIVEN_FLUID: + FluidModel = new CDataDrivenFluid(config, false); + if (free_stream_temp) { + FluidModel->SetTDState_PT(Pressure_FreeStream, Temperature_FreeStream); + Density_FreeStream = FluidModel->GetDensity(); + config->SetDensity_FreeStream(Density_FreeStream); + } + else { + FluidModel->SetTDState_Prho(Pressure_FreeStream, Density_FreeStream ); + Temperature_FreeStream = FluidModel->GetTemperature(); + config->SetTemperature_FreeStream(Temperature_FreeStream); + } + + break; } Mach2Vel_FreeStream = FluidModel->GetSoundSpeed(); @@ -1083,6 +1100,11 @@ void CFEM_DG_EulerSolver::SetNondimensionalization(CConfig *config, FluidModel = new CCoolProp(config->GetFluid_Name()); FluidModel->SetEnergy_Prho(Pressure_FreeStreamND, Density_FreeStreamND); break; + + case DATADRIVEN_FLUID: + FluidModel = new CDataDrivenFluid(config); + FluidModel->SetEnergy_Prho(Pressure_FreeStreamND, Density_FreeStreamND); + break; } Energy_FreeStreamND = FluidModel->GetStaticEnergy() + 0.5*ModVel_FreeStreamND*ModVel_FreeStreamND; @@ -1090,6 +1112,7 @@ void CFEM_DG_EulerSolver::SetNondimensionalization(CConfig *config, if (viscous) { FluidModel->SetLaminarViscosityModel(config); FluidModel->SetThermalConductivityModel(config); + FluidModel->SetMassDiffusivityModel(config); // nijso: TODO, needs to be tested } if (tkeNeeded) { Energy_FreeStreamND += Tke_FreeStreamND; }; config->SetEnergy_FreeStreamND(Energy_FreeStreamND); @@ -1961,13 +1984,13 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { if(elemEnd > elemBeg) { prevInd[0] = indexInList[CTaskDefinition::ADER_UPDATE_SOLUTION][0]; indexInList[CTaskDefinition::ADER_PREDICTOR_STEP_COMM_ELEMENTS][0] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::ADER_PREDICTOR_STEP_COMM_ELEMENTS, 0, prevInd[0])); + tasksList.emplace_back(CTaskDefinition::ADER_PREDICTOR_STEP_COMM_ELEMENTS, 0, prevInd[0]); } /* Initiate the communication of elements of level 0, if there is something to be communicated. */ #ifdef HAVE_MPI - if( commRequests[0].size() ) { + if( !commRequests[0].empty() ) { if(elemEnd > elemBeg) // Data needs to be computed before sending. prevInd[0] = indexInList[CTaskDefinition::ADER_PREDICTOR_STEP_COMM_ELEMENTS][0]; else // Data only needs to be received. @@ -1978,8 +2001,8 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { /* Create the task. */ indexInList[CTaskDefinition::INITIATE_MPI_COMMUNICATION][0] = tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::INITIATE_MPI_COMMUNICATION, 0, - prevInd[0], prevInd[1])); + tasksList.emplace_back(CTaskDefinition::INITIATE_MPI_COMMUNICATION, 0, + prevInd[0], prevInd[1]); } #endif @@ -1997,13 +2020,13 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { if(elemEnd > elemBeg) { prevInd[0] = indexInList[CTaskDefinition::ADER_UPDATE_SOLUTION][nL]; indexInList[CTaskDefinition::ADER_PREDICTOR_STEP_COMM_ELEMENTS][nL] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::ADER_PREDICTOR_STEP_COMM_ELEMENTS, nL, prevInd[0])); + tasksList.emplace_back(CTaskDefinition::ADER_PREDICTOR_STEP_COMM_ELEMENTS, nL, prevInd[0]); } /* Initiate the communication of elements of level nL, if there is something to be communicated. */ #ifdef HAVE_MPI - if( commRequests[nL].size() ) { + if( !commRequests[nL].empty() ) { if(elemEnd > elemBeg) // Data needs to be computed before sending. prevInd[0] = indexInList[CTaskDefinition::ADER_PREDICTOR_STEP_COMM_ELEMENTS][nL]; else // Data only needs to be received. @@ -2014,8 +2037,8 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { /* Create the actual task. */ indexInList[CTaskDefinition::INITIATE_MPI_COMMUNICATION][nL] = tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::INITIATE_MPI_COMMUNICATION, nL, - prevInd[0], prevInd[1])); + tasksList.emplace_back(CTaskDefinition::INITIATE_MPI_COMMUNICATION, nL, + prevInd[0], prevInd[1]); } #endif } @@ -2028,18 +2051,18 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { if(elemEnd > elemBeg) { prevInd[0] = indexInList[CTaskDefinition::ADER_UPDATE_SOLUTION][0]; indexInList[CTaskDefinition::ADER_PREDICTOR_STEP_INTERNAL_ELEMENTS][0] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::ADER_PREDICTOR_STEP_INTERNAL_ELEMENTS, 0, prevInd[0])); + tasksList.emplace_back(CTaskDefinition::ADER_PREDICTOR_STEP_INTERNAL_ELEMENTS, 0, prevInd[0]); } /* Determine the tasks to be completed before the communication of time level 0 can be completed. */ prevInd[0] = prevInd[1] = prevInd[2] = -1; #ifdef HAVE_MPI - if( commRequests[0].size() ) + if( !commRequests[0].empty() ) prevInd[0] = indexInList[CTaskDefinition::INITIATE_MPI_COMMUNICATION][0]; #endif - if( elementsSendSelfComm[0].size() ) { + if( !elementsSendSelfComm[0].empty() ) { prevInd[1] = indexInList[CTaskDefinition::ADER_PREDICTOR_STEP_COMM_ELEMENTS][0]; prevInd[2] = indexInList[CTaskDefinition::ADER_PREDICTOR_STEP_INTERNAL_ELEMENTS][0]; } @@ -2051,8 +2074,8 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { to be completed. */ if(prevInd[0] > -1) { indexInList[CTaskDefinition::COMPLETE_MPI_COMMUNICATION][0] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::COMPLETE_MPI_COMMUNICATION, 0, - prevInd[0], prevInd[1], prevInd[2])); + tasksList.emplace_back(CTaskDefinition::COMPLETE_MPI_COMMUNICATION, 0, + prevInd[0], prevInd[1], prevInd[2]); } /* Check if the time level is not nTimeLevels-1. In that case carry out @@ -2070,18 +2093,18 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { if(elemEnd > elemBeg) { prevInd[0] = indexInList[CTaskDefinition::ADER_UPDATE_SOLUTION][nL]; indexInList[CTaskDefinition::ADER_PREDICTOR_STEP_INTERNAL_ELEMENTS][nL] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::ADER_PREDICTOR_STEP_INTERNAL_ELEMENTS, nL, prevInd[0])); + tasksList.emplace_back(CTaskDefinition::ADER_PREDICTOR_STEP_INTERNAL_ELEMENTS, nL, prevInd[0]); } /* Determine the tasks to be completed before the communication of time level nL can be completed. */ prevInd[0] = prevInd[1] = prevInd[2] = -1; #ifdef HAVE_MPI - if( commRequests[nL].size() ) + if( !commRequests[nL].empty() ) prevInd[0] = indexInList[CTaskDefinition::INITIATE_MPI_COMMUNICATION][nL]; #endif - if( elementsSendSelfComm[nL].size() ) { + if( !elementsSendSelfComm[nL].empty() ) { prevInd[1] = indexInList[CTaskDefinition::ADER_PREDICTOR_STEP_COMM_ELEMENTS][nL]; prevInd[2] = indexInList[CTaskDefinition::ADER_PREDICTOR_STEP_INTERNAL_ELEMENTS][nL]; } @@ -2093,8 +2116,8 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { to be completed. */ if(prevInd[0] > -1) { indexInList[CTaskDefinition::COMPLETE_MPI_COMMUNICATION][nL] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::COMPLETE_MPI_COMMUNICATION, nL, - prevInd[0], prevInd[1], prevInd[2])); + tasksList.emplace_back(CTaskDefinition::COMPLETE_MPI_COMMUNICATION, nL, + prevInd[0], prevInd[1], prevInd[2]); } } @@ -2160,8 +2183,8 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { /* Create the task. */ indexInList[CTaskDefinition::ADER_TIME_INTERPOLATE_OWNED_ELEMENTS][level] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::ADER_TIME_INTERPOLATE_OWNED_ELEMENTS, - level, prevInd[0], prevInd[1], prevInd[2], prevInd[3], prevInd[4])); + tasksList.emplace_back(CTaskDefinition::ADER_TIME_INTERPOLATE_OWNED_ELEMENTS, + level, prevInd[0], prevInd[1], prevInd[2], prevInd[3], prevInd[4]); /* The info on the integration point and whether or not this time integration corresponds to the second part for the @@ -2174,8 +2197,8 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { including the adjacent ones. */ prevInd[0] = indexInList[CTaskDefinition::ADER_TIME_INTERPOLATE_OWNED_ELEMENTS][level]; indexInList[CTaskDefinition::SHOCK_CAPTURING_VISCOSITY_OWNED_ELEMENTS][level] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::SHOCK_CAPTURING_VISCOSITY_OWNED_ELEMENTS, - level, prevInd[0])); + tasksList.emplace_back(CTaskDefinition::SHOCK_CAPTURING_VISCOSITY_OWNED_ELEMENTS, + level, prevInd[0]); } /* The solution of the halo elements of the current time level and @@ -2220,8 +2243,8 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { /* Create the task. */ indexInList[CTaskDefinition::ADER_TIME_INTERPOLATE_HALO_ELEMENTS][level] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::ADER_TIME_INTERPOLATE_HALO_ELEMENTS, - level, prevInd[0], prevInd[1])); + tasksList.emplace_back(CTaskDefinition::ADER_TIME_INTERPOLATE_HALO_ELEMENTS, + level, prevInd[0], prevInd[1]); /* The info on the integration point and whether or not this time integration corresponds to the second part for the @@ -2234,8 +2257,8 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { including the adjacent ones. */ prevInd[0] = indexInList[CTaskDefinition::ADER_TIME_INTERPOLATE_HALO_ELEMENTS][level]; indexInList[CTaskDefinition::SHOCK_CAPTURING_VISCOSITY_HALO_ELEMENTS][level] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::SHOCK_CAPTURING_VISCOSITY_HALO_ELEMENTS, - level, prevInd[0])); + tasksList.emplace_back(CTaskDefinition::SHOCK_CAPTURING_VISCOSITY_HALO_ELEMENTS, + level, prevInd[0]); } /* Check whether there are boundary conditions that involve halo elements. */ @@ -2247,8 +2270,8 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { /* Create the task for the boundary conditions that involve halo elements. */ indexInList[CTaskDefinition::BOUNDARY_CONDITIONS_DEPEND_ON_HALO][level] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::BOUNDARY_CONDITIONS_DEPEND_ON_HALO, - level, prevInd[0], prevInd[1])); + tasksList.emplace_back(CTaskDefinition::BOUNDARY_CONDITIONS_DEPEND_ON_HALO, + level, prevInd[0], prevInd[1]); } /* Compute the surface residuals for this time level that involve @@ -2271,15 +2294,15 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { /* Create the task for the surface residual. */ indexInList[CTaskDefinition::SURFACE_RESIDUAL_HALO_ELEMENTS][level] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::SURFACE_RESIDUAL_HALO_ELEMENTS, - level, prevInd[0], prevInd[1], prevInd[2])); + tasksList.emplace_back(CTaskDefinition::SURFACE_RESIDUAL_HALO_ELEMENTS, + level, prevInd[0], prevInd[1], prevInd[2]); /* Create the task to accumulate the surface residuals of the halo elements. Make sure to set the integration point for this task. */ prevInd[0] = indexInList[CTaskDefinition::SURFACE_RESIDUAL_HALO_ELEMENTS][level]; indexInList[CTaskDefinition::ADER_ACCUMULATE_SPACETIME_RESIDUAL_HALO_ELEMENTS][level] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::ADER_ACCUMULATE_SPACETIME_RESIDUAL_HALO_ELEMENTS, - level, prevInd[0])); + tasksList.emplace_back(CTaskDefinition::ADER_ACCUMULATE_SPACETIME_RESIDUAL_HALO_ELEMENTS, + level, prevInd[0]); tasksList.back().intPointADER = intPoint; } @@ -2295,14 +2318,14 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { bool commData = false; #ifdef HAVE_MPI - if( commRequests[level].size() ) commData = true; + if( !commRequests[level].empty() ) commData = true; #endif - if(commData || elementsSendSelfComm[level].size()) { + if(commData || !elementsSendSelfComm[level].empty()) { /* Determine the dependencies before the reverse communication can start. */ prevInd[0] = indexInList[CTaskDefinition::ADER_ACCUMULATE_SPACETIME_RESIDUAL_HALO_ELEMENTS][level]; - if( haloElemAdjLowTimeLevel[level].size() ) + if( !haloElemAdjLowTimeLevel[level].empty() ) prevInd[1] = indexInList[CTaskDefinition::ADER_ACCUMULATE_SPACETIME_RESIDUAL_HALO_ELEMENTS][level-1]; else prevInd[1] = -1; @@ -2311,8 +2334,8 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { /* Create the task. */ indexInList[CTaskDefinition::INITIATE_REVERSE_MPI_COMMUNICATION][level] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::INITIATE_REVERSE_MPI_COMMUNICATION, - level, prevInd[0], prevInd[1], prevInd[2])); + tasksList.emplace_back(CTaskDefinition::INITIATE_REVERSE_MPI_COMMUNICATION, + level, prevInd[0], prevInd[1], prevInd[2]); } } @@ -2333,18 +2356,18 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { /* Create the tasks. */ indexInList[CTaskDefinition::VOLUME_RESIDUAL][level] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::VOLUME_RESIDUAL, level, - prevInd[0], prevInd[1])); + tasksList.emplace_back(CTaskDefinition::VOLUME_RESIDUAL, level, + prevInd[0], prevInd[1]); indexInList[CTaskDefinition::BOUNDARY_CONDITIONS_DEPEND_ON_OWNED][level] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::BOUNDARY_CONDITIONS_DEPEND_ON_OWNED, level, - prevInd[0], prevInd[1])); + tasksList.emplace_back(CTaskDefinition::BOUNDARY_CONDITIONS_DEPEND_ON_OWNED, level, + prevInd[0], prevInd[1]); if(nMatchingInternalFacesLocalElem[level+1] > nMatchingInternalFacesLocalElem[level]) { indexInList[CTaskDefinition::SURFACE_RESIDUAL_OWNED_ELEMENTS][level] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::SURFACE_RESIDUAL_OWNED_ELEMENTS, - level, prevInd[0], prevInd[1])); + tasksList.emplace_back(CTaskDefinition::SURFACE_RESIDUAL_OWNED_ELEMENTS, + level, prevInd[0], prevInd[1]); } } @@ -2361,8 +2384,8 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { /* Create the task. */ indexInList[CTaskDefinition::ADER_ACCUMULATE_SPACETIME_RESIDUAL_OWNED_ELEMENTS][level] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::ADER_ACCUMULATE_SPACETIME_RESIDUAL_OWNED_ELEMENTS, - level, prevInd[0], prevInd[1], prevInd[2], prevInd[3], prevInd[4])); + tasksList.emplace_back(CTaskDefinition::ADER_ACCUMULATE_SPACETIME_RESIDUAL_OWNED_ELEMENTS, + level, prevInd[0], prevInd[1], prevInd[2], prevInd[3], prevInd[4]); tasksList.back().intPointADER = intPoint; } @@ -2374,23 +2397,23 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { bool commData = false; #ifdef HAVE_MPI - if( commRequests[level].size() ) commData = true; + if( !commRequests[level].empty() ) commData = true; #endif - if(commData || elementsSendSelfComm[level].size()) { + if(commData || !elementsSendSelfComm[level].empty()) { /* Determine the dependencies before the reverse communication can be completed. */ prevInd[0] = indexInList[CTaskDefinition::INITIATE_REVERSE_MPI_COMMUNICATION][level]; prevInd[1] = indexInList[CTaskDefinition::ADER_ACCUMULATE_SPACETIME_RESIDUAL_OWNED_ELEMENTS][level]; - if( ownedElemAdjLowTimeLevel[level].size() ) + if( !ownedElemAdjLowTimeLevel[level].empty() ) prevInd[2] = indexInList[CTaskDefinition::ADER_ACCUMULATE_SPACETIME_RESIDUAL_OWNED_ELEMENTS][level-1]; else prevInd[2] = -1; /* Create the task. */ indexInList[CTaskDefinition::COMPLETE_REVERSE_MPI_COMMUNICATION][level] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::COMPLETE_REVERSE_MPI_COMMUNICATION, - level, prevInd[0], prevInd[1], prevInd[2])); + tasksList.emplace_back(CTaskDefinition::COMPLETE_REVERSE_MPI_COMMUNICATION, + level, prevInd[0], prevInd[1], prevInd[2]); } } @@ -2411,20 +2434,20 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { added to the dependency list. */ prevInd[0] = indexInList[CTaskDefinition::COMPLETE_REVERSE_MPI_COMMUNICATION][level]; prevInd[1] = indexInList[CTaskDefinition::ADER_ACCUMULATE_SPACETIME_RESIDUAL_OWNED_ELEMENTS][level]; - if( ownedElemAdjLowTimeLevel[level].size() ) + if( !ownedElemAdjLowTimeLevel[level].empty() ) prevInd[2] = indexInList[CTaskDefinition::ADER_ACCUMULATE_SPACETIME_RESIDUAL_OWNED_ELEMENTS][level-1]; else prevInd[2] = -1; indexInList[CTaskDefinition::MULTIPLY_INVERSE_MASS_MATRIX][level] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::MULTIPLY_INVERSE_MASS_MATRIX, - level, prevInd[0], prevInd[1], prevInd[2])); + tasksList.emplace_back(CTaskDefinition::MULTIPLY_INVERSE_MASS_MATRIX, + level, prevInd[0], prevInd[1], prevInd[2]); /* Compute the new state vector for this time level. */ prevInd[0] = indexInList[CTaskDefinition::MULTIPLY_INVERSE_MASS_MATRIX][level]; indexInList[CTaskDefinition::ADER_UPDATE_SOLUTION][level] = (int)tasksList.size(); - tasksList.push_back(CTaskDefinition(CTaskDefinition::ADER_UPDATE_SOLUTION, - level, prevInd[0])); + tasksList.emplace_back(CTaskDefinition::ADER_UPDATE_SOLUTION, + level, prevInd[0]); } } @@ -2495,20 +2518,20 @@ void CFEM_DG_EulerSolver::SetUpTaskList(CConfig *config) { /* relatively short tasks list, which can be set easily. */ /*------------------------------------------------------------------------*/ - tasksList.push_back(CTaskDefinition(CTaskDefinition::INITIATE_MPI_COMMUNICATION, 0)); // Task 0 - tasksList.push_back(CTaskDefinition(CTaskDefinition::SHOCK_CAPTURING_VISCOSITY_OWNED_ELEMENTS, 0)); // Task 1 - tasksList.push_back(CTaskDefinition(CTaskDefinition::VOLUME_RESIDUAL, 0, 1)); // Task 2 - tasksList.push_back(CTaskDefinition(CTaskDefinition::COMPLETE_MPI_COMMUNICATION, 0, 0)); // Task 3 - tasksList.push_back(CTaskDefinition(CTaskDefinition::SHOCK_CAPTURING_VISCOSITY_HALO_ELEMENTS, 0, 3)); // Task 4 - tasksList.push_back(CTaskDefinition(CTaskDefinition::SURFACE_RESIDUAL_HALO_ELEMENTS, 0, 1, 4)); // Task 5 - tasksList.push_back(CTaskDefinition(CTaskDefinition::BOUNDARY_CONDITIONS_DEPEND_ON_HALO, 0, 1, 3)); // Task 6 - tasksList.push_back(CTaskDefinition(CTaskDefinition::SUM_UP_RESIDUAL_CONTRIBUTIONS_HALO_ELEMENTS, 0, 5)); // Task 7 - tasksList.push_back(CTaskDefinition(CTaskDefinition::INITIATE_REVERSE_MPI_COMMUNICATION, 0, 7)); // Task 8 - tasksList.push_back(CTaskDefinition(CTaskDefinition::SURFACE_RESIDUAL_OWNED_ELEMENTS, 0, 1)); // Task 9 - tasksList.push_back(CTaskDefinition(CTaskDefinition::BOUNDARY_CONDITIONS_DEPEND_ON_OWNED, 0, 1)); // Task 10 - tasksList.push_back(CTaskDefinition(CTaskDefinition::COMPLETE_REVERSE_MPI_COMMUNICATION, 0, 2, 8)); // Task 11 - tasksList.push_back(CTaskDefinition(CTaskDefinition::SUM_UP_RESIDUAL_CONTRIBUTIONS_OWNED_ELEMENTS, 0, 2, 6, 9, 10, 11)); // Task 12 - tasksList.push_back(CTaskDefinition(CTaskDefinition::MULTIPLY_INVERSE_MASS_MATRIX, 0, 12)); // Task 13 + tasksList.emplace_back(CTaskDefinition::INITIATE_MPI_COMMUNICATION, 0); // Task 0 + tasksList.emplace_back(CTaskDefinition::SHOCK_CAPTURING_VISCOSITY_OWNED_ELEMENTS, 0); // Task 1 + tasksList.emplace_back(CTaskDefinition::VOLUME_RESIDUAL, 0, 1); // Task 2 + tasksList.emplace_back(CTaskDefinition::COMPLETE_MPI_COMMUNICATION, 0, 0); // Task 3 + tasksList.emplace_back(CTaskDefinition::SHOCK_CAPTURING_VISCOSITY_HALO_ELEMENTS, 0, 3); // Task 4 + tasksList.emplace_back(CTaskDefinition::SURFACE_RESIDUAL_HALO_ELEMENTS, 0, 1, 4); // Task 5 + tasksList.emplace_back(CTaskDefinition::BOUNDARY_CONDITIONS_DEPEND_ON_HALO, 0, 1, 3); // Task 6 + tasksList.emplace_back(CTaskDefinition::SUM_UP_RESIDUAL_CONTRIBUTIONS_HALO_ELEMENTS, 0, 5); // Task 7 + tasksList.emplace_back(CTaskDefinition::INITIATE_REVERSE_MPI_COMMUNICATION, 0, 7); // Task 8 + tasksList.emplace_back(CTaskDefinition::SURFACE_RESIDUAL_OWNED_ELEMENTS, 0, 1); // Task 9 + tasksList.emplace_back(CTaskDefinition::BOUNDARY_CONDITIONS_DEPEND_ON_OWNED, 0, 1); // Task 10 + tasksList.emplace_back(CTaskDefinition::COMPLETE_REVERSE_MPI_COMMUNICATION, 0, 2, 8); // Task 11 + tasksList.emplace_back(CTaskDefinition::SUM_UP_RESIDUAL_CONTRIBUTIONS_OWNED_ELEMENTS, 0, 2, 6, 9, 10, 11); // Task 12 + tasksList.emplace_back(CTaskDefinition::MULTIPLY_INVERSE_MASS_MATRIX, 0, 12); // Task 13 } } @@ -2622,14 +2645,14 @@ void CFEM_DG_EulerSolver::Prepare_MPI_Communication(const CMeshFEM *FEMGeometry, for this time level. Self communication is excluded. */ int nRankRecv = 0; for(unsigned long i=0; iSetTDState_PT(P_Total, T_Total); + const su2double Enthalpy_e = FluidModel->GetStaticEnergy() + FluidModel->GetPressure()/FluidModel->GetDensity(); const su2double Entropy_e = FluidModel->GetEntropy(); @@ -9497,7 +9521,7 @@ void CFEM_DG_EulerSolver::LoadRestart(CGeometry **geometry, CSolver ***solver, C #endif if (rbuf_NotMatching != 0) - SU2_MPI::Error(string("The solution file ") + restart_filename.data() + + SU2_MPI::Error(string("The solution file ") + restart_filename + string(" doesn't match with the mesh file!\n") + string("It could be empty lines at the end of the file."), CURRENT_FUNCTION); diff --git a/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp b/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp index 414983c6679..cc8e1a9511e 100644 --- a/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp +++ b/SU2_CFD/src/solvers/CFEM_DG_NSSolver.cpp @@ -2,7 +2,7 @@ * \file CFEM_DG_NSSolver.cpp * \brief Main subroutines for solving finite element Navier-Stokes flow problems * \author J. Alonso, E. van der Weide, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -29,9 +29,11 @@ #include "../../include/solvers/CFEM_DG_NSSolver.hpp" #include "../../../Common/include/toolboxes/printing_toolbox.hpp" -#define SIZE_ARR_NORM 8 +enum { +SIZE_ARR_NORM = 8 +}; -CFEM_DG_NSSolver::CFEM_DG_NSSolver(void) : CFEM_DG_EulerSolver() { +CFEM_DG_NSSolver::CFEM_DG_NSSolver() : CFEM_DG_EulerSolver() { /*--- Basic array initialization ---*/ CD_Visc = nullptr; CL_Visc = nullptr; CSF_Visc = nullptr; CEff_Visc = nullptr; @@ -150,7 +152,7 @@ CFEM_DG_NSSolver::CFEM_DG_NSSolver(CGeometry *geometry, CConfig *config, unsigne } } -CFEM_DG_NSSolver::~CFEM_DG_NSSolver(void) { +CFEM_DG_NSSolver::~CFEM_DG_NSSolver() { delete [] CD_Visc; delete [] CL_Visc; diff --git a/SU2_CFD/src/solvers/CGradientSmoothingSolver.cpp b/SU2_CFD/src/solvers/CGradientSmoothingSolver.cpp index 226d49962f0..83e61cb7a9a 100644 --- a/SU2_CFD/src/solvers/CGradientSmoothingSolver.cpp +++ b/SU2_CFD/src/solvers/CGradientSmoothingSolver.cpp @@ -2,7 +2,7 @@ * \file CGradientSmoothing.cpp * \brief Main solver routines for the gradient smoothing problem. * \author T. Dick - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -163,7 +163,7 @@ CGradientSmoothingSolver::CGradientSmoothingSolver(CGeometry *geometry, CConfig SolverName = "SOBOLEV"; } -CGradientSmoothingSolver::~CGradientSmoothingSolver(void) { +CGradientSmoothingSolver::~CGradientSmoothingSolver() { delete nodes; @@ -1001,7 +1001,7 @@ void CGradientSmoothingSolver::Complete_Surface_StiffMatrix(const CGeometry* geo /*--- Assembling the stiffness matrix on the design surface means the Jacobian is the identity for nodes inside the domain. ---*/ for (unsigned long iPoint = 0ul; iPoint < geometry->GetnPointDomain(); iPoint++){ - if (visited[iPoint]==false) { + if (!visited[iPoint]) { Jacobian.AddVal2Diag(iPoint, 1.0); } } diff --git a/SU2_CFD/src/solvers/CHeatSolver.cpp b/SU2_CFD/src/solvers/CHeatSolver.cpp index a7a3b1e30d3..c0005bfa792 100644 --- a/SU2_CFD/src/solvers/CHeatSolver.cpp +++ b/SU2_CFD/src/solvers/CHeatSolver.cpp @@ -2,7 +2,7 @@ * \file CHeatSolver.cpp * \brief Main subroutines for solving the heat equation * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -167,7 +167,7 @@ CHeatSolver::CHeatSolver(CGeometry *geometry, CConfig *config, unsigned short iM Max_CFL_Local = CFL; Avg_CFL_Local = CFL; - /*--- Add the solver name (max 8 characters) ---*/ + /*--- Add the solver name. ---*/ SolverName = "HEAT"; } @@ -377,7 +377,7 @@ void CHeatSolver::BC_Isothermal_Wall(CGeometry *geometry, CSolver **solver_conta SU2_OMP_FOR_STAT(OMP_MIN_SIZE) for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { if (IsPyCustom) { - Twall = geometry->GetCustomBoundaryTemperature(val_marker, iVertex); + Twall = geometry->GetCustomBoundaryTemperature(val_marker, iVertex) / config->GetTemperature_Ref(); } IsothermalBoundaryCondition(geometry, solver_container[FLOW_SOL], config, val_marker, iVertex, Twall); } @@ -400,7 +400,7 @@ void CHeatSolver::BC_HeatFlux_Wall(CGeometry* geometry, CSolver** solver_contain if (!geometry->nodes->GetDomain(iPoint)) continue; if (IsPyCustom) { - Wall_HeatFlux = geometry->GetCustomBoundaryHeatFlux(val_marker, iVertex); + Wall_HeatFlux = geometry->GetCustomBoundaryHeatFlux(val_marker, iVertex) / config->GetHeat_Flux_Ref(); } /*--- Viscous contribution to the residual at the wall. ---*/ const auto* Normal = geometry->vertex[val_marker][iVertex]->GetNormal(); diff --git a/SU2_CFD/src/solvers/CIncEulerSolver.cpp b/SU2_CFD/src/solvers/CIncEulerSolver.cpp index 1749ae096f2..d8f53845622 100644 --- a/SU2_CFD/src/solvers/CIncEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CIncEulerSolver.cpp @@ -2,7 +2,7 @@ * \file CIncEulerSolver.cpp * \brief Main subroutines for solving incompressible flow (Euler, Navier-Stokes, etc.). * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -34,6 +34,7 @@ #include "../../include/limiters/CLimiterDetails.hpp" #include "../../../Common/include/toolboxes/geometry_toolbox.hpp" #include "../../include/fluid/CFluidScalar.hpp" +#include "../../include/fluid/CFluidFlamelet.hpp" #include "../../include/fluid/CFluidModel.hpp" @@ -65,7 +66,7 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned /*--- Check for a restart file to evaluate if there is a change in the angle of attack before computing all the non-dimesional quantities. ---*/ - if (!(!restart || (iMesh != MESH_0) || nZone > 1)) { + if (restart && (iMesh == MESH_0) && nZone <= 1) { /*--- Multizone problems require the number of the zone to be appended. ---*/ @@ -221,7 +222,7 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned if (config->GetBounded_Scalar()) EdgeMassFluxes.resize(geometry->GetnEdge()) = su2double(0.0); - /*--- Add the solver name (max 8 characters) ---*/ + /*--- Add the solver name. ---*/ SolverName = "INC.FLOW"; /*--- Finally, check that the static arrays will be large enough (keep this @@ -230,7 +231,7 @@ CIncEulerSolver::CIncEulerSolver(CGeometry *geometry, CConfig *config, unsigned SU2_MPI::Error("Oops! The CIncEulerSolver static array sizes are not large enough.", CURRENT_FUNCTION); } -CIncEulerSolver::~CIncEulerSolver(void) { +CIncEulerSolver::~CIncEulerSolver() { for(auto& model : FluidModel) delete model; } @@ -328,6 +329,15 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i auxFluidModel->SetTDState_T(Temperature_FreeStream, config->GetSpecies_Init()); break; + case FLUID_FLAMELET: + + config->SetGas_Constant(UNIVERSAL_GAS_CONSTANT / (config->GetMolecular_Weight() / 1000.0)); + Pressure_Thermodynamic = config->GetPressure_Thermodynamic(); + auxFluidModel = new CFluidFlamelet(config, Pressure_Thermodynamic); + config->SetPressure_Thermodynamic(Pressure_Thermodynamic); + auxFluidModel->SetTDState_T(Temperature_FreeStream, config->GetSpecies_Init()); + break; + default: SU2_MPI::Error("Fluid model not implemented for incompressible solver.", CURRENT_FUNCTION); @@ -403,6 +413,9 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i if (tkeNeeded) { Energy_FreeStream += Tke_FreeStream; }; config->SetEnergy_FreeStream(Energy_FreeStream); + /*--- Auxilary (dimensional) FluidModel no longer needed. ---*/ + delete auxFluidModel; + /*--- Compute Mach number ---*/ if (config->GetKind_FluidModel() == CONSTANT_DENSITY) { @@ -449,11 +462,6 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i const su2double MassDiffusivityND = config->GetDiffusivity_Constant() / (Velocity_Ref * Length_Ref); config->SetDiffusivity_ConstantND(MassDiffusivityND); - - /*--- Delete the original (dimensional) FluidModel object. No fluid is used for inscompressible cases. ---*/ - - delete auxFluidModel; - /*--- Create one final fluid model object per OpenMP thread to be able to use them in parallel. * GetFluidModel() should be used to automatically access the "right" object of each thread. ---*/ @@ -478,6 +486,11 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i fluidModel->SetTDState_T(Temperature_FreeStreamND, config->GetSpecies_Init()); break; + case FLUID_FLAMELET: + fluidModel = new CFluidFlamelet(config, Pressure_Thermodynamic); + fluidModel->SetTDState_T(Temperature_FreeStreamND, config->GetSpecies_Init()); + break; + case INC_IDEAL_GAS_POLY: fluidModel = new CIncIdealGasPolynomial(Gas_ConstantND, Pressure_ThermodynamicND); if (viscous) { @@ -510,7 +523,7 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i fluidModel->SetLaminarViscosityModel(config); fluidModel->SetThermalConductivityModel(config); - + fluidModel->SetMassDiffusivityModel(config); } } @@ -586,6 +599,9 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i if (energy) cout << "Energy equation is active and coupled for variable density." << endl; break; + case INC_DENSITYMODEL::FLAMELET: + cout << "Energy equation is disabled and density is obtained through flamelet manifold." << endl; + break; } stringstream NonDimTableOut, ModelTableOut; @@ -625,6 +641,15 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i NonDimTable.PrintFooter(); break; + case VISCOSITYMODEL::FLAMELET: + ModelTable << "FLAMELET"; + if (config->GetSystemMeasurements() == SI) Unit << "N.s/m^2"; + else if (config->GetSystemMeasurements() == US) Unit << "lbf.s/ft^2"; + NonDimTable << "Viscosity" << "--" << "--" << Unit.str() << config->GetMu_ConstantND(); + Unit.str(""); + NonDimTable.PrintFooter(); + break; + case VISCOSITYMODEL::COOLPROP: ModelTable << "COOLPROP_VISCOSITY"; if (config->GetSystemMeasurements() == SI) Unit << "N.s/m^2"; @@ -682,6 +707,13 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i NonDimTable.PrintFooter(); break; + case CONDUCTIVITYMODEL::FLAMELET: + ModelTable << "FLAMELET"; + Unit << "W/m^2.K"; + NonDimTable << "Molecular Cond." << "--" << "--" << Unit.str() << config->GetThermal_Conductivity_ConstantND(); + Unit.str(""); + break; + case CONDUCTIVITYMODEL::COOLPROP: ModelTable << "COOLPROP"; Unit << "W/m^2.K"; @@ -759,6 +791,23 @@ void CIncEulerSolver::SetNondimensionalization(CConfig *config, unsigned short i NonDimTable.PrintFooter(); break; + case FLUID_FLAMELET: + ModelTable << "FLAMELET"; + Unit << "N.m/kg.K"; + NonDimTable << "Spec. Heat (Cp)" << "--" << "--" << Unit.str() << config->GetSpecific_Heat_CpND(); + Unit.str(""); + Unit << "g/mol"; + NonDimTable << "Molecular weight" << "--" << "--" << Unit.str() << config->GetMolecular_Weight(); + Unit.str(""); + Unit << "N.m/kg.K"; + NonDimTable << "Gas Constant" << "--" << config->GetGas_Constant_Ref() << Unit.str() << config->GetGas_ConstantND(); + Unit.str(""); + Unit << "Pa"; + NonDimTable << "Therm. Pressure" << config->GetPressure_Thermodynamic() << config->GetPressure_Ref() << Unit.str() << config->GetPressure_ThermodynamicND(); + Unit.str(""); + NonDimTable.PrintFooter(); + break; + case INC_IDEAL_GAS_POLY: ModelTable << "INC_IDEAL_GAS_POLY"; Unit.str(""); @@ -1927,7 +1976,7 @@ void CIncEulerSolver::SetPreconditioner(const CConfig *config, unsigned long iPo su2double BetaInc2, Density, dRhodT, Temperature, oneOverCp, Cp; su2double Velocity[MAXNDIM] = {0.0}; - bool variable_density = (config->GetKind_DensityModel() == INC_DENSITYMODEL::VARIABLE); + bool variable_density = (config->GetVariable_Density_Model()); bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); bool energy = config->GetEnergy_Equation(); @@ -2884,9 +2933,9 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, if (Evaluate_BC) { - su2double *Outlet_MassFlow = new su2double[config->GetnMarker_All()]; - su2double *Outlet_Density = new su2double[config->GetnMarker_All()]; - su2double *Outlet_Area = new su2double[config->GetnMarker_All()]; + auto *Outlet_MassFlow = new su2double[config->GetnMarker_All()]; + auto *Outlet_Density = new su2double[config->GetnMarker_All()]; + auto *Outlet_Area = new su2double[config->GetnMarker_All()]; /*--- Comute MassFlow, average temp, press, etc. ---*/ @@ -2904,8 +2953,6 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, if (geometry->nodes->GetDomain(iPoint)) { - V_outlet = nodes->GetPrimitive(iPoint); - geometry->vertex[iMarker][iVertex]->GetNormal(Vector); su2double AxiFactor = 1.0; @@ -2921,7 +2968,9 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, } } - Density = V_outlet[prim_idx.Density()]; + V_outlet = nodes->GetPrimitive(iPoint); + + Density = V_outlet[prim_idx.Density()]; Velocity2 = 0.0; Area = 0.0; MassFlow = 0.0; @@ -2931,6 +2980,7 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, Velocity2 += Velocity[iDim] * Velocity[iDim]; MassFlow += Vector[iDim] * AxiFactor * Density * Velocity[iDim]; } + Area = sqrt (Area); Outlet_MassFlow[iMarker] += MassFlow; @@ -2944,13 +2994,13 @@ void CIncEulerSolver::GetOutlet_Properties(CGeometry *geometry, CConfig *config, /*--- Copy to the appropriate structure ---*/ - su2double *Outlet_MassFlow_Local = new su2double[nMarker_Outlet]; - su2double *Outlet_Density_Local = new su2double[nMarker_Outlet]; - su2double *Outlet_Area_Local = new su2double[nMarker_Outlet]; + auto *Outlet_MassFlow_Local = new su2double[nMarker_Outlet]; + auto *Outlet_Density_Local = new su2double[nMarker_Outlet]; + auto *Outlet_Area_Local = new su2double[nMarker_Outlet]; - su2double *Outlet_MassFlow_Total = new su2double[nMarker_Outlet]; - su2double *Outlet_Density_Total = new su2double[nMarker_Outlet]; - su2double *Outlet_Area_Total = new su2double[nMarker_Outlet]; + auto *Outlet_MassFlow_Total = new su2double[nMarker_Outlet]; + auto *Outlet_Density_Total = new su2double[nMarker_Outlet]; + auto *Outlet_Area_Total = new su2double[nMarker_Outlet]; for (iMarker_Outlet = 0; iMarker_Outlet < nMarker_Outlet; iMarker_Outlet++) { Outlet_MassFlow_Local[iMarker_Outlet] = 0.0; diff --git a/SU2_CFD/src/solvers/CIncNSSolver.cpp b/SU2_CFD/src/solvers/CIncNSSolver.cpp index ea9fc7a1bdb..659a3eebef6 100644 --- a/SU2_CFD/src/solvers/CIncNSSolver.cpp +++ b/SU2_CFD/src/solvers/CIncNSSolver.cpp @@ -2,7 +2,7 @@ * \file CIncNSSolver.cpp * \brief Main subroutines for solving Navier-Stokes incompressible flow. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -219,7 +219,7 @@ void CIncNSSolver::GetStreamwise_Periodic_Properties(const CGeometry *geometry, const su2double FaceArea = GeometryToolbox::Norm(nDim, AreaNormal); - HeatFlow_Local += FaceArea * (-1.0) * Wall_HeatFlux/config->GetHeat_Flux_Ref();; + HeatFlow_Local += FaceArea * (-1.0) * Wall_HeatFlux/config->GetHeat_Flux_Ref(); } // loop Vertices } // loop Heatflux marker } // loop AllMarker @@ -336,13 +336,13 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); const bool energy = config->GetEnergy_Equation(); + const bool py_custom = config->GetMarker_All_PyCustom(val_marker); /*--- Variables for streamwise periodicity ---*/ const bool streamwise_periodic = (config->GetKind_Streamwise_Periodic() != ENUM_STREAMWISE_PERIODIC::NONE); const bool streamwise_periodic_temperature = config->GetStreamwise_Periodic_Temperature(); su2double Cp, thermal_conductivity, dot_product, scalar_factor; - /*--- Identify the boundary by string name ---*/ const auto Marker_Tag = config->GetMarker_All_TagBound(val_marker); @@ -426,6 +426,9 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con /*--- Apply a weak boundary condition for the energy equation. Compute the residual due to the prescribed heat flux. ---*/ + if (py_custom) { + Wall_HeatFlux = geometry->GetCustomBoundaryHeatFlux(val_marker, iVertex) / config->GetHeat_Flux_Ref(); + } LinSysRes(iPoint, nDim+1) -= Wall_HeatFlux*Area; /*--- With streamwise periodic flow and heatflux walls an additional term is introduced in the boundary formulation ---*/ @@ -460,7 +463,9 @@ void CIncNSSolver::BC_Wall_Generic(const CGeometry *geometry, const CConfig *con break; case ISOTHERMAL: - + if (py_custom) { + Twall = geometry->GetCustomBoundaryTemperature(val_marker, iVertex) / config->GetTemperature_Ref(); + } const auto Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); /*--- Get coordinates of i & nearest normal and compute distance ---*/ diff --git a/SU2_CFD/src/solvers/CMeshSolver.cpp b/SU2_CFD/src/solvers/CMeshSolver.cpp index 77470e620fb..20b8269e118 100644 --- a/SU2_CFD/src/solvers/CMeshSolver.cpp +++ b/SU2_CFD/src/solvers/CMeshSolver.cpp @@ -2,7 +2,7 @@ * \file CMeshSolver.cpp * \brief Main subroutines to solve moving meshes using a pseudo-linear elastic approach. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -165,6 +165,8 @@ CMeshSolver::CMeshSolver(CGeometry *geometry, CConfig *config) : CFEASolver(LINE } Set_VertexEliminationSchedule(geometry, essentialMarkers); } + + SolverName = "MESH"; } void CMeshSolver::SetMinMaxVolume(CGeometry *geometry, CConfig *config, bool updated) { @@ -415,7 +417,7 @@ void CMeshSolver::SetWallDistance(CGeometry *geometry, CConfig *config) { END_SU2_OMP_PARALLEL } -void CMeshSolver::SetMesh_Stiffness(CGeometry **geometry, CNumerics **numerics, CConfig *config){ +void CMeshSolver::SetMesh_Stiffness(CNumerics **numerics, CConfig *config){ if (stiffness_set) return; @@ -753,7 +755,7 @@ void CMeshSolver::SetBoundaryDisplacements(CGeometry *geometry, CConfig *config, } -void CMeshSolver::SetDualTime_Mesh(void){ +void CMeshSolver::SetDualTime_Mesh(){ nodes->Set_Solution_time_n1(); nodes->Set_Solution_time_n(); @@ -967,7 +969,6 @@ void CMeshSolver::RestartOldGeometry(CGeometry *geometry, const CConfig *config) void CMeshSolver::Surface_Pitching(CGeometry *geometry, CConfig *config, unsigned long iter) { su2double deltaT, time_new, time_old, Lref; - const su2double* Coord = nullptr; su2double Center[3] = {0.0}, VarCoord[3] = {0.0}, Omega[3] = {0.0}, Ampl[3] = {0.0}, Phase[3] = {0.0}; su2double VarCoordAbs[3] = {0.0}; su2double rotCoord[3] = {0.0}, r[3] = {0.0}; @@ -1050,10 +1051,14 @@ void CMeshSolver::Surface_Pitching(CGeometry *geometry, CConfig *config, unsigne for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - /*--- Index and coordinates of the current point ---*/ + /*--- Index and coordinates of the current point accounting for other + * motions that may be applied, e.g. plunging. ---*/ iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - Coord = geometry->nodes->GetCoord(iPoint); + su2double Coord[3] = {0.0}; + for (iDim = 0; iDim < nDim; ++iDim) { + Coord[iDim] = nodes->GetMesh_Coord(iPoint, iDim) + nodes->GetBound_Disp(iPoint, iDim); + } /*--- Calculate non-dim. position from rotation center ---*/ @@ -1084,7 +1089,6 @@ void CMeshSolver::Surface_Pitching(CGeometry *geometry, CConfig *config, unsigne void CMeshSolver::Surface_Rotating(CGeometry *geometry, CConfig *config, unsigned long iter) { su2double deltaT, time_new, time_old, Lref; - const su2double* Coord = nullptr; su2double VarCoordAbs[3] = {0.0}; su2double Center[3] = {0.0}, VarCoord[3] = {0.0}, Omega[3] = {0.0}, rotCoord[3] = {0.0}, r[3] = {0.0}, Center_Aux[3] = {0.0}; @@ -1156,10 +1160,14 @@ void CMeshSolver::Surface_Rotating(CGeometry *geometry, CConfig *config, unsigne for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - /*--- Index and coordinates of the current point ---*/ + /*--- Index and coordinates of the current point accounting for other + * motions that may be applied, e.g. plunging. ---*/ iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - Coord = geometry->nodes->GetCoord(iPoint); + su2double Coord[3] = {0.0}; + for (iDim = 0; iDim < nDim; ++iDim) { + Coord[iDim] = nodes->GetMesh_Coord(iPoint, iDim) + nodes->GetBound_Disp(iPoint, iDim); + } /*--- Calculate non-dim. position from rotation center ---*/ diff --git a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp index dcca84abbeb..9b52b1d07b9 100644 --- a/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMOEulerSolver.cpp @@ -2,7 +2,7 @@ * \file CNEMOEulerSolver.cpp * \brief Headers of the CNEMOEulerSolver class * \author S. R. Copeland, F. Palacios, W. Maier, C. Garbacz, J. Needels - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -56,8 +56,6 @@ CNEMOEulerSolver::CNEMOEulerSolver(CGeometry *geometry, CConfig *config, const bool adjoint = config->GetContinuous_Adjoint() || config->GetDiscrete_Adjoint(); int Unst_RestartIter = 0; - unsigned long iMarker; - su2double *Mvec_Inf, Alpha, Beta; /*--- A grid is defined as dynamic if there's rigid grid movement or grid deformation AND the problem is time domain ---*/ dynamic_grid = config->GetDynamic_Grid(); @@ -67,7 +65,7 @@ CNEMOEulerSolver::CNEMOEulerSolver(CGeometry *geometry, CConfig *config, /*--- Check for a restart file to evaluate if there is a change in the AoA before non-dimensionalizing ---*/ - if (!(!restart || (iMesh != MESH_0) || nZone >1 )) { + if (restart && (iMesh == MESH_0) && nZone <=1 ) { /*--- Modify file name for a dual-time unsteady restart ---*/ if (dual_time) { @@ -113,7 +111,7 @@ CNEMOEulerSolver::CNEMOEulerSolver(CGeometry *geometry, CConfig *config, /*--- Store the number of vertices on each marker for deallocation ---*/ nVertex.resize(nMarker); - for (iMarker = 0; iMarker < nMarker; iMarker++) + for (auto iMarker = 0ul; iMarker < nMarker; iMarker++) nVertex[iMarker] = geometry->nVertex[iMarker]; MassFrac_Inf = config->GetGas_Composition(); @@ -175,9 +173,10 @@ CNEMOEulerSolver::CNEMOEulerSolver(CGeometry *geometry, CConfig *config, SetReferenceValues(*config); /*--- Vectorize free stream Mach number based on AoA & AoS ---*/ + su2double *Mvec_Inf; Mvec_Inf = new su2double[nDim]; - Alpha = config->GetAoA()*PI_NUMBER/180.0; - Beta = config->GetAoS()*PI_NUMBER/180.0; + const su2double Alpha = config->GetAoA()*PI_NUMBER/180.0; + const su2double Beta = config->GetAoS()*PI_NUMBER/180.0; if (nDim == 2) { Mvec_Inf[0] = cos(Alpha)*Mach_Inf; Mvec_Inf[1] = sin(Alpha)*Mach_Inf; @@ -217,7 +216,7 @@ CNEMOEulerSolver::CNEMOEulerSolver(CGeometry *geometry, CConfig *config, CommunicateInitialState(geometry, config); - /*--- Add the solver name (max 8 characters) ---*/ + /*--- Add the solver name. ---*/ SolverName = "NEMO.FLOW"; /*--- Finally, check that the static arrays will be large enough (keep this @@ -230,7 +229,7 @@ CNEMOEulerSolver::CNEMOEulerSolver(CGeometry *geometry, CConfig *config, } -CNEMOEulerSolver::~CNEMOEulerSolver(void) { +CNEMOEulerSolver::~CNEMOEulerSolver() { delete node_infty; delete FluidModel; @@ -240,10 +239,10 @@ CNEMOEulerSolver::~CNEMOEulerSolver(void) { void CNEMOEulerSolver::CommonPreprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { - bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - bool center = (config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED); - bool center_jst = (config->GetKind_Centered_Flow() == CENTERED::JST) && (iMesh == MESH_0); - bool center_jst_ke = (config->GetKind_Centered_Flow() == CENTERED::JST_KE) && (iMesh == MESH_0); + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const bool center = (config->GetKind_ConvNumScheme_Flow() == SPACE_CENTERED); + const bool center_jst = (config->GetKind_Centered_Flow() == CENTERED::JST) && (iMesh == MESH_0); + const bool center_jst_ke = (config->GetKind_Centered_Flow() == CENTERED::JST_KE) && (iMesh == MESH_0); /*--- Set the primitive variables ---*/ ompMasterAssignBarrier(ErrorCounter,0); @@ -318,10 +317,10 @@ void CNEMOEulerSolver::Preprocessing(CGeometry *geometry, CSolver **solver_conta unsigned long CNEMOEulerSolver::SetPrimitive_Variables(CSolver **solver_container, CConfig *config, bool Output) { - unsigned long iPoint, nonPhysicalPoints = 0; + unsigned long nonPhysicalPoints = 0; bool nonphysical = true; - for (iPoint = 0; iPoint < nPoint; iPoint ++) { + for (auto iPoint = 0ul; iPoint < nPoint; iPoint ++) { /*--- Incompressible flow, primitive variables ---*/ @@ -359,27 +358,27 @@ void CNEMOEulerSolver::SetTime_Step(CGeometry *geometry, CSolver **solver_contai struct LambdaVisc { FORCEINLINE su2double lambda(su2double lamVisc, su2double eddyVisc, su2double rho, su2double k, su2double cv) const { /*--- Determine the viscous spectral radius and apply it to the control volume ---*/ - su2double Lambda_1 = (4.0/3.0)*(lamVisc + eddyVisc); + const su2double Lambda_1 = (4.0/3.0)*(lamVisc + eddyVisc); return (Lambda_1 + k/cv)/rho; } FORCEINLINE su2double operator() (const CNEMOEulerVariable& nodes, unsigned long iPoint, unsigned long jPoint) const { - su2double lamVisc = 0.5*(nodes.GetLaminarViscosity(iPoint) + nodes.GetLaminarViscosity(jPoint)); - su2double eddyVisc = 0.5*(nodes.GetEddyViscosity(iPoint) + nodes.GetEddyViscosity(jPoint)); - su2double thermalCond = 0.5*(nodes.GetThermalConductivity(iPoint) + nodes.GetThermalConductivity(jPoint) + + const su2double lamVisc = 0.5*(nodes.GetLaminarViscosity(iPoint) + nodes.GetLaminarViscosity(jPoint)); + const su2double eddyVisc = 0.5*(nodes.GetEddyViscosity(iPoint) + nodes.GetEddyViscosity(jPoint)); + const su2double thermalCond = 0.5*(nodes.GetThermalConductivity(iPoint) + nodes.GetThermalConductivity(jPoint) + nodes.GetThermalConductivity_ve(iPoint) + nodes.GetThermalConductivity_ve(jPoint)); - su2double density = 0.5*(nodes.GetDensity(iPoint) + nodes.GetDensity(jPoint)); - su2double cv = 0.5*(nodes.GetRhoCv_tr(iPoint) + nodes.GetRhoCv_ve(iPoint) + + const su2double density = 0.5*(nodes.GetDensity(iPoint) + nodes.GetDensity(jPoint)); + const su2double cv = 0.5*(nodes.GetRhoCv_tr(iPoint) + nodes.GetRhoCv_ve(iPoint) + nodes.GetRhoCv_tr(jPoint) + nodes.GetRhoCv_ve(jPoint))/ density; return lambda(lamVisc, eddyVisc, density, thermalCond, cv); } FORCEINLINE su2double operator() (const CNEMOEulerVariable& nodes, unsigned long iPoint) const { - su2double lamVisc = nodes.GetLaminarViscosity(iPoint); - su2double eddyVisc = nodes.GetEddyViscosity(iPoint); - su2double thermalCond = nodes.GetThermalConductivity(iPoint) + nodes.GetThermalConductivity_ve(iPoint); - su2double density = nodes.GetDensity(iPoint); - su2double cv = (nodes.GetRhoCv_tr(iPoint) + nodes.GetRhoCv_ve(iPoint))/ density; + const su2double lamVisc = nodes.GetLaminarViscosity(iPoint); + const su2double eddyVisc = nodes.GetEddyViscosity(iPoint); + const su2double thermalCond = nodes.GetThermalConductivity(iPoint) + nodes.GetThermalConductivity_ve(iPoint); + const su2double density = nodes.GetDensity(iPoint); + const su2double cv = (nodes.GetRhoCv_tr(iPoint) + nodes.GetRhoCv_ve(iPoint))/ density; return lambda(lamVisc, eddyVisc, density, thermalCond, cv); } @@ -413,18 +412,17 @@ void CNEMOEulerSolver::SetMax_Eigenvalue(CGeometry *geometry, CConfig *config) { void CNEMOEulerSolver::Centered_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep) { - unsigned long iEdge, iPoint, jPoint; CNumerics* numerics = numerics_container[CONV_TERM]; /*--- Set booleans based on config settings ---*/ - bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - for (iEdge = 0; iEdge < geometry->GetnEdge(); iEdge++) { + for (auto iEdge = 0ul; iEdge < geometry->GetnEdge(); iEdge++) { /*--- Points in edge, set normal vectors, and number of neighbors ---*/ - iPoint = geometry->edges->GetNode(iEdge, 0); - jPoint = geometry->edges->GetNode(iEdge, 1); + const auto iPoint = geometry->edges->GetNode(iEdge, 0); + const auto jPoint = geometry->edges->GetNode(iEdge, 1); numerics->SetNormal(geometry->edges->GetNormal(iEdge)); numerics->SetNeighbor(geometry->nodes->GetnNeighbor(iPoint), geometry->nodes->GetnNeighbor(jPoint)); @@ -491,18 +489,16 @@ void CNEMOEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_con su2double Gamma_i = 0.0, Gamma_j = 0.0; /*--- Loop over edges and calculate convective fluxes ---*/ - for(unsigned long iEdge = 0; iEdge < geometry->GetnEdge(); iEdge++) { - - unsigned short iDim, iVar; + for(auto iEdge = 0ul; iEdge < geometry->GetnEdge(); iEdge++) { /*--- Retrieve node numbers and pass edge normal to CNumerics ---*/ - auto iPoint = geometry->edges->GetNode(iEdge, 0); - auto jPoint = geometry->edges->GetNode(iEdge, 1); + const auto iPoint = geometry->edges->GetNode(iEdge, 0); + const auto jPoint = geometry->edges->GetNode(iEdge, 1); numerics->SetNormal(geometry->edges->GetNormal(iEdge)); - auto Coord_i = geometry->nodes->GetCoord(iPoint); - auto Coord_j = geometry->nodes->GetCoord(jPoint); + const auto Coord_i = geometry->nodes->GetCoord(iPoint); + const auto Coord_j = geometry->nodes->GetCoord(jPoint); /*--- Get conserved & primitive variables from CVariable ---*/ auto U_i = nodes->GetSolution(iPoint); auto U_j = nodes->GetSolution(jPoint); @@ -524,7 +520,7 @@ void CNEMOEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_con /*--- High order reconstruction using MUSCL strategy ---*/ su2double Vector_ij[MAXNDIM] = {0.0}; - for (iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { Vector_ij[iDim] = 0.5*(Coord_j[iDim] - Coord_i[iDim]); } @@ -543,10 +539,10 @@ void CNEMOEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_con su2double lim_i = 2.0; su2double lim_j = 2.0; - for (iVar = 0; iVar < nPrimVarGrad; iVar++) { + for (auto iVar = 0ul; iVar < nPrimVarGrad; iVar++) { Project_Grad_i[iVar] = 0.0; Project_Grad_j[iVar] = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { Project_Grad_i[iVar] += Vector_ij[iDim]*Gradient_i[iVar][iDim]; Project_Grad_j[iVar] -= Vector_ij[iDim]*Gradient_j[iVar][iDim]; } @@ -568,7 +564,7 @@ void CNEMOEulerSolver::Upwind_Residual(CGeometry *geometry, CSolver **solver_con } su2double lim_ij = min(lim_i, lim_j); - for (iVar = 0; iVar < nPrimVarGrad; iVar++) { + for (auto iVar = 0ul; iVar < nPrimVarGrad; iVar++) { Primitive_i[iVar] = V_i[iVar] + lim_ij*Project_Grad_i[iVar]; Primitive_j[iVar] = V_j[iVar] + lim_ij*Project_Grad_j[iVar]; } @@ -650,16 +646,15 @@ su2double CNEMOEulerSolver::ComputeConsistentExtrapolation(CNEMOGas *fluidmodel, su2double* val_eves, su2double *val_Cvves) { //NOTE: TODO - this doesnt compute Cvves/ dPdU,etc.yet - su2double val_gamma; - vector rhos; /*--- Rename index information ---*/ - unsigned short T_INDEX = nSpecies; - unsigned short TVE_INDEX = nSpecies+1; + const unsigned short T_INDEX = nSpecies; + const unsigned short TVE_INDEX = nSpecies+1; /*--- Rename density vector ---*/ + vector rhos; rhos.resize(nSpecies,0.0); - for (unsigned short iSpecies=0; iSpecies < nSpecies; iSpecies++ ){ + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++ ){ rhos[iSpecies] = V[iSpecies]; } @@ -670,11 +665,11 @@ su2double CNEMOEulerSolver::ComputeConsistentExtrapolation(CNEMOGas *fluidmodel, // This block of code copies a vector to corresponding pointer. auto it = val_eves; auto& ref = fluidmodel->ComputeSpeciesEve(V[TVE_INDEX]); - for (auto v : ref) { + for (const auto& v : ref) { *it = v; ++it; } - val_gamma = fluidmodel->ComputeGamma(); + const su2double val_gamma = fluidmodel->ComputeGamma(); return val_gamma; } @@ -686,24 +681,23 @@ void CNEMOEulerSolver::RecomputeConservativeVector(su2double *U, const su2double rhos.resize(nSpecies,0.0); /*--- Set Indices ---*/ - //Make these in a general location - unsigned short RHO_INDEX = nodes->GetRhoIndex(); - unsigned short T_INDEX = nodes->GetTIndex(); - unsigned short TVE_INDEX = nodes->GetTveIndex(); - unsigned short VEL_INDEX = nodes->GetVelIndex(); + //TODO: Move these to a general location + const unsigned short RHO_INDEX = nodes->GetRhoIndex(); + const unsigned short T_INDEX = nodes->GetTIndex(); + const unsigned short TVE_INDEX = nodes->GetTveIndex(); + const unsigned short VEL_INDEX = nodes->GetVelIndex(); /*--- Set densities and mass fraction ---*/ - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++){ + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++){ U[iSpecies] = V[iSpecies]; rhos[iSpecies] = V[iSpecies]; } /*--- Set momentum and compute v^2 ---*/ - //TODO: geometry toolbox su2double sqvel = 0.0; - for (unsigned short iDim = 0; iDim < nDim; iDim++){ + for (auto iDim = 0ul; iDim < nDim; iDim++){ U[nSpecies+iDim] = V[RHO_INDEX]*V[VEL_INDEX+iDim]; - sqvel += V[VEL_INDEX+iDim]*V[VEL_INDEX+iDim]; + sqvel += V[VEL_INDEX+iDim]*V[VEL_INDEX+iDim]; } /*--- Set the fluidmodel and recompute energies ---*/ @@ -718,25 +712,23 @@ void CNEMOEulerSolver::RecomputeConservativeVector(su2double *U, const su2double bool CNEMOEulerSolver::CheckNonPhys(const su2double *V) const { - su2double Tmin, Tmax, Tvemin, Tvemax; - /*--- Set booleans ---*/ bool nonPhys = false; /*--- Set Indices ---*/ - //Make these in a general location - unsigned short RHOS_INDEX = nodes->GetRhosIndex(); - unsigned short T_INDEX = nodes->GetTIndex(); - unsigned short TVE_INDEX = nodes->GetTveIndex(); - unsigned short P_INDEX = nodes->GetPIndex(); - unsigned short A_INDEX = nodes->GetAIndex(); + //TODO: Move these to a general location + const unsigned short RHOS_INDEX = nodes->GetRhosIndex(); + const unsigned short T_INDEX = nodes->GetTIndex(); + const unsigned short TVE_INDEX = nodes->GetTveIndex(); + const unsigned short P_INDEX = nodes->GetPIndex(); + const unsigned short A_INDEX = nodes->GetAIndex(); /*--- Set temperature clipping values ---*/ - Tmin = 50.0; Tmax = 8E4; - Tvemin = 50.0; Tvemax = 8E4; + const su2double Tmin = 50.0; const su2double Tmax = 8E4; + const su2double Tvemin = 50.0; const su2double Tvemax = 8E4; /*--- Check whether state makes sense ---*/ - for (unsigned short iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) if (V[RHOS_INDEX+iSpecies] < 0.0) nonPhys = true; if (V[P_INDEX] < 0.0) nonPhys = true; @@ -753,17 +745,14 @@ bool CNEMOEulerSolver::CheckNonPhys(const su2double *V) const { void CNEMOEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_container, CNumerics **numerics_container, CConfig *config, unsigned short iMesh) { - unsigned short iVar; - unsigned long iPoint; - /*--- Assign booleans ---*/ bool err = false; - bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); - bool frozen = config->GetFrozen(); - bool monoatomic = config->GetMonoatomic(); - bool axisymm = config->GetAxisymmetric(); - bool viscous = config->GetViscous(); - bool rans = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const bool frozen = config->GetFrozen(); + const bool monoatomic = config->GetMonoatomic(); + const bool axisymm = config->GetAxisymmetric(); + const bool viscous = config->GetViscous(); + const bool rans = (config->GetKind_Turb_Model() != TURB_MODEL::NONE); CNumerics* numerics = numerics_container[SOURCE_FIRST_TERM]; @@ -773,7 +762,7 @@ void CNEMOEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_con unsigned long eVib_local = 0; /*--- Initialize the source residual to zero ---*/ - for (iVar = 0; iVar < nVar; iVar++) Residual[iVar] = 0.0; + for (auto iVar = 0ul; iVar < nVar; iVar++) Residual[iVar] = 0.0; /*--- Preprocess viscous axisymm variables (if necessary) ---*/ if (axisymm && viscous) { @@ -784,7 +773,7 @@ void CNEMOEulerSolver::Source_Residual(CGeometry *geometry, CSolver **solver_con /*--- loop over interior points ---*/ SU2_OMP_FOR_DYN(omp_chunk_size) - for (iPoint = 0; iPoint < nPointDomain; iPoint++) { + for (auto iPoint = 0ul; iPoint < nPointDomain; iPoint++) { /*--- Set conserved & primitive variables ---*/ numerics->SetConservative(nodes->GetSolution(iPoint), nullptr); @@ -947,13 +936,13 @@ void CNEMOEulerSolver::ComputeUnderRelaxationFactor(const CConfig *config) { const su2double allowableRatio = 0.2; SU2_OMP_FOR_STAT(omp_chunk_size) - for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { + for (auto iPoint = 0ul; iPoint < nPointDomain; iPoint++) { su2double localUnderRelaxation = 1.0; su2double num = 0.0; su2double denom = 0.0; - for (unsigned short iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0; iVar < nVar; iVar++) { /* We impose a limit on the maximum percentage that the density (sum of all species) and energy can change over a nonlinear iteration. */ @@ -1013,20 +1002,17 @@ void CNEMOEulerSolver::SetNondimensionalization(CConfig *config, unsigned short su2double Velocity_FreeStreamND[3] = {0.0, 0.0, 0.0}; - unsigned short iDim; - /*--- Local variables ---*/ - su2double Alpha = config->GetAoA()*PI_NUMBER/180.0; - su2double Beta = config->GetAoS()*PI_NUMBER/180.0; - su2double Mach = config->GetMach(); - su2double Reynolds = config->GetReynolds(); - - bool unsteady = (config->GetTime_Marching() != TIME_MARCHING::STEADY); - bool viscous = config->GetViscous(); - bool gravity = config->GetGravityForce(); - bool turbulent = false; - bool tkeNeeded = ((turbulent) && (config->GetKind_Turb_Model() == TURB_MODEL::SST)); - bool reynolds_init = (config->GetKind_InitOption() == REYNOLDS); + const su2double Alpha= config->GetAoA()*PI_NUMBER/180.0; + const su2double Beta = config->GetAoS()*PI_NUMBER/180.0; + const su2double Mach = config->GetMach(); + + const bool unsteady = (config->GetTime_Marching() != TIME_MARCHING::STEADY); + const bool viscous = config->GetViscous(); + const bool gravity = config->GetGravityForce(); + const bool turbulent = false; + const bool tkeNeeded = ((turbulent) && (config->GetKind_Turb_Model() == TURB_MODEL::SST)); + const bool reynolds_init = (config->GetKind_InitOption() == REYNOLDS); /*--- The dimensional viscosity is needed to determine the free-stream conditions. To accomplish this, simply set the non-dimensional coefficients to the @@ -1086,7 +1072,7 @@ void CNEMOEulerSolver::SetNondimensionalization(CConfig *config, unsigned short /*--- Compute the modulus of the free stream velocity ---*/ ModVel_FreeStream = 0.0; - for (iDim = 0; iDim < nDim; iDim++){ + for (auto iDim = 0ul; iDim < nDim; iDim++){ ModVel_FreeStream += config->GetVelocity_FreeStream()[iDim]*config->GetVelocity_FreeStream()[iDim]; } sqvel = ModVel_FreeStream; @@ -1119,7 +1105,7 @@ void CNEMOEulerSolver::SetNondimensionalization(CConfig *config, unsigned short config->SetViscosity_FreeStream(Viscosity_FreeStream); /*--- Compute Reynolds number ---*/ - Reynolds = (Density_FreeStream*Velocity_Reynolds*config->GetLength_Reynolds())/Viscosity_FreeStream; + const su2double Reynolds = (Density_FreeStream*Velocity_Reynolds*config->GetLength_Reynolds())/Viscosity_FreeStream; config->SetReynolds(Reynolds); /*--- Turbulence kinetic energy ---*/ @@ -1186,7 +1172,7 @@ void CNEMOEulerSolver::SetNondimensionalization(CConfig *config, unsigned short Pressure_FreeStreamND = Pressure_FreeStream/config->GetPressure_Ref(); config->SetPressure_FreeStreamND(Pressure_FreeStreamND); Density_FreeStreamND = Density_FreeStream/config->GetDensity_Ref(); config->SetDensity_FreeStreamND(Density_FreeStreamND); - for (iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { Velocity_FreeStreamND[iDim] = config->GetVelocity_FreeStream()[iDim]/Velocity_Ref; config->SetVelocity_FreeStreamND(Velocity_FreeStreamND[iDim], iDim); } @@ -1195,7 +1181,7 @@ void CNEMOEulerSolver::SetNondimensionalization(CConfig *config, unsigned short Gas_ConstantND = config->GetGas_Constant()/Gas_Constant_Ref; config->SetGas_ConstantND(Gas_ConstantND); ModVel_FreeStreamND = 0.0; - for (iDim = 0; iDim < nDim; iDim++) ModVel_FreeStreamND += Velocity_FreeStreamND[iDim]*Velocity_FreeStreamND[iDim]; + for (auto iDim = 0ul; iDim < nDim; iDim++) ModVel_FreeStreamND += Velocity_FreeStreamND[iDim]*Velocity_FreeStreamND[iDim]; ModVel_FreeStreamND = sqrt(ModVel_FreeStreamND); config->SetModVel_FreeStreamND(ModVel_FreeStreamND); Viscosity_FreeStreamND = Viscosity_FreeStream / Viscosity_Ref; config->SetViscosity_FreeStreamND(Viscosity_FreeStreamND); @@ -1411,17 +1397,14 @@ void CNEMOEulerSolver::SetReferenceValues(const CConfig& config) { void CNEMOEulerSolver::BC_Sym_Plane(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { - unsigned short iDim, jDim, iSpecies, iVar, jVar; - unsigned long iPoint, iVertex; - /*--- Allocate the necessary vector structures ---*/ su2double Normal[MAXNDIM] = {0.0}, UnitNormal[MAXNDIM] = {0.0}; - bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); /*--- Loop over all the vertices on this boundary (val_marker) ---*/ - for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { - iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); + for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { + const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); /*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ if (geometry->nodes->GetDomain(iPoint)) { @@ -1430,19 +1413,19 @@ void CNEMOEulerSolver::BC_Sym_Plane(CGeometry *geometry, CSolver **solver_contai geometry->vertex[val_marker][iVertex]->GetNormal(Normal); /*--- Calculate parameters from the geometry ---*/ - su2double Area = GeometryToolbox::Norm(nDim, Normal); + const su2double Area = GeometryToolbox::Norm(nDim, Normal); - for (iDim = 0; iDim < nDim; iDim++){ + for (auto iDim = 0ul; iDim < nDim; iDim++){ UnitNormal[iDim] = -Normal[iDim]/Area; } /*--- Retrieve the pressure on the vertex ---*/ - su2double P = nodes->GetPressure(iPoint); + const su2double P = nodes->GetPressure(iPoint); /*--- Apply the flow-tangency b.c. to the convective flux ---*/ - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) Residual[iSpecies] = 0.0; - for (iDim = 0; iDim < nDim; iDim++){ + for (auto iDim = 0ul; iDim < nDim; iDim++){ Residual[nSpecies+iDim] = P * UnitNormal[iDim] * Area; } Residual[nSpecies+nDim] = 0.0; @@ -1461,31 +1444,31 @@ void CNEMOEulerSolver::BC_Sym_Plane(CGeometry *geometry, CSolver **solver_contai auto& Ms = FluidModel->GetSpeciesMolarMass(); /*--- Initialize Jacobian ---*/ - for (iVar = 0; iVar < nVar; iVar++) - for (jVar = 0; jVar < nVar; jVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) + for (auto jVar = 0ul; jVar < nVar; jVar++) Jacobian_i[iVar][jVar] = 0.0; /*--- Calculate state i ---*/ - su2double rho = nodes->GetDensity(iPoint); - su2double rhoE = nodes->GetSolution(iPoint,nSpecies+nDim); - su2double rhoEve = nodes->GetSolution(iPoint,nSpecies+nDim+1); - auto dPdU = nodes->GetdPdU(iPoint); - for (iDim = 0; iDim < nDim; iDim++) + const su2double rho = nodes->GetDensity(iPoint); + const su2double rhoE = nodes->GetSolution(iPoint,nSpecies+nDim); + const su2double rhoEve = nodes->GetSolution(iPoint,nSpecies+nDim+1); + const auto dPdU = nodes->GetdPdU(iPoint); + for (auto iDim = 0ul; iDim < nDim; iDim++) Velocity[iDim] = nodes->GetVelocity(iPoint,iDim); su2double conc = 0.0; - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { - su2double cs = nodes->GetMassFraction(iPoint,iSpecies); + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { + const su2double cs = nodes->GetMassFraction(iPoint,iSpecies); conc += cs * rho/Ms[iSpecies]; - for (iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { Jacobian_i[nSpecies+iDim][iSpecies] = dPdU[iSpecies] * UnitNormal[iDim]; Jacobian_i[iSpecies][nSpecies+iDim] = cs * UnitNormal[iDim]; } } - for (iDim = 0; iDim < nDim; iDim++) { - for (jDim = 0; jDim < nDim; jDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { + for (auto jDim = 0ul; jDim < nDim; jDim++) { Jacobian_i[nSpecies+iDim][nSpecies+jDim] = Velocity[iDim]*UnitNormal[jDim] + dPdU[nSpecies+jDim]*UnitNormal[iDim]; } @@ -1497,8 +1480,8 @@ void CNEMOEulerSolver::BC_Sym_Plane(CGeometry *geometry, CSolver **solver_contai } /*--- Integrate over the dual-grid area ---*/ - for (iVar = 0; iVar < nVar; iVar++) - for (jVar = 0; jVar < nVar; jVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) + for (auto jVar = 0ul; jVar < nVar; jVar++) Jacobian_i[iVar][jVar] = Jacobian_i[iVar][jVar] * Area; /*--- Apply the contribution to the system ---*/ @@ -1519,7 +1502,7 @@ void CNEMOEulerSolver::BC_Far_Field(CGeometry *geometry, su2double Normal[MAXNDIM] = {0.0}; /*--- Loop over all the vertices on this boundary (val_marker) ---*/ - for (unsigned long iVertex = 0; iVertex < geometry->nVertex[val_marker]; + for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); @@ -1532,7 +1515,7 @@ void CNEMOEulerSolver::BC_Far_Field(CGeometry *geometry, /*--- Pass boundary node normal to CNumerics ---*/ geometry->vertex[val_marker][iVertex]->GetNormal(Normal); - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) Normal[iDim] = -Normal[iDim]; conv_numerics->SetNormal(Normal); @@ -1565,7 +1548,7 @@ void CNEMOEulerSolver::BC_Far_Field(CGeometry *geometry, Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); /*--- Viscous contribution ---*/ - bool viscous = config->GetViscous(); + const bool viscous = config->GetViscous(); if (viscous) { su2double Coord_Reflected[MAXNDIM]; GeometryToolbox::PointPointReflect( @@ -1629,9 +1612,8 @@ void CNEMOEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { SU2_MPI::Error("BC_INLET: Not operational in NEMO.", CURRENT_FUNCTION); - unsigned short iVar, iDim, iSpecies, RHO_INDEX, nSpecies; + unsigned short RHO_INDEX, nSpecies; - unsigned long iVertex, iPoint; su2double T_Total, P_Total, Velocity[3], Velocity2, H_Total, Temperature, Riemann, Pressure, Density, Energy, Mach2, SoundSpeed2, SoundSpeed_Total2, Vel_Mag, alpha, aa, bb, cc, dd, Area, UnitNormal[3] = {0.0}; @@ -1645,37 +1627,37 @@ void CNEMOEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, INLET_TYPE Kind_Inlet = config->GetKind_Inlet(); string Marker_Tag = config->GetMarker_All_TagBound(val_marker); - su2double *U_domain = new su2double[nVar]; su2double *U_inlet = new su2double[nVar]; - su2double *V_domain = new su2double[nPrimVar]; su2double *V_inlet = new su2double[nPrimVar]; - su2double *Normal = new su2double[nDim]; + auto *U_domain = new su2double[nVar]; auto *U_inlet = new su2double[nVar]; + auto *V_domain = new su2double[nPrimVar]; auto *V_inlet = new su2double[nPrimVar]; + auto *Normal = new su2double[nDim]; nSpecies = config->GetnSpecies(); - su2double *Spec_Density = new su2double[nSpecies]; - for(iSpecies=0; iSpeciesGetRhoIndex(); /*--- Loop over all the vertices on this boundary marker ---*/ - for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { - iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); + for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { + const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); /*--- Check if the node belongs to the domain (i.e., not a halo node) ---*/ if (geometry->nodes->GetDomain(iPoint)) { /*--- Normal vector for this vertex (negate for outward convention) ---*/ geometry->vertex[val_marker][iVertex]->GetNormal(Normal); - for (iDim = 0; iDim < nDim; iDim++) Normal[iDim] = -Normal[iDim]; + for (auto iDim = 0ul; iDim < nDim; iDim++) Normal[iDim] = -Normal[iDim]; conv_numerics->SetNormal(Normal); Area = GeometryToolbox::Norm(nDim, Normal); - for (iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) UnitNormal[iDim] = Normal[iDim]/Area; /*--- Retrieve solution at this boundary node ---*/ - for (iVar = 0; iVar < nVar; iVar++) U_domain[iVar] = nodes->GetSolution(iPoint, iVar); - for (iVar = 0; iVar < nPrimVar; iVar++) V_domain[iVar] = nodes->GetPrimitive(iPoint,iVar); + for (auto iVar = 0ul; iVar < nVar; iVar++) U_domain[iVar] = nodes->GetSolution(iPoint, iVar); + for (auto iVar = 0ul; iVar < nPrimVar; iVar++) V_domain[iVar] = nodes->GetPrimitive(iPoint,iVar); /*--- Build the fictitious intlet state based on characteristics ---*/ @@ -1702,7 +1684,7 @@ void CNEMOEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, /*--- Store primitives and set some variables for clarity. ---*/ Density = V_domain[RHO_INDEX]; - for (iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) Velocity[iDim] = U_domain[nSpecies+iDim]/Density; Velocity2 = GeometryToolbox::SquaredNorm(nDim, Velocity); @@ -1714,7 +1696,7 @@ void CNEMOEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, /*--- Compute the acoustic Riemann invariant that is extrapolated from the domain interior. ---*/ Riemann = 2.0*sqrt(SoundSpeed2)/Gamma_Minus_One; - for (iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) Riemann += Velocity[iDim]*UnitNormal[iDim]; /*--- Total speed of sound ---*/ @@ -1749,7 +1731,7 @@ void CNEMOEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, SoundSpeed2 = SoundSpeed_Total2 - 0.5*Gamma_Minus_One*Velocity2; /*--- Compute new velocity vector at the inlet ---*/ - for (iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) Velocity[iDim] = Vel_Mag*Flow_Dir[iDim]; /*--- Static temperature from the speed of sound relation ---*/ @@ -1768,19 +1750,19 @@ void CNEMOEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, //NEED EVE AS WELL /*--- Conservative variables, using the derived quantities ---*/ - for (iSpecies=0; iSpeciesGetVelocity_Ref(); /*--- Get primitives from current inlet state. ---*/ - for (iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) Velocity[iDim] = nodes->GetVelocity(iPoint, iDim); Pressure = nodes->GetPressure(iPoint); SoundSpeed2 = Gamma*Pressure/U_domain[0]; @@ -1812,12 +1794,12 @@ void CNEMOEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, /*--- Compute the acoustic Riemann invariant that is extrapolated from the domain interior. ---*/ Riemann = Two_Gamma_M1*sqrt(SoundSpeed2); - for (iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) Riemann += Velocity[iDim]*UnitNormal[iDim]; /*--- Speed of sound squared for fictitious inlet state ---*/ SoundSpeed2 = Riemann; - for (iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) SoundSpeed2 -= Vel_Mag*Flow_Dir[iDim]*UnitNormal[iDim]; SoundSpeed2 = max(0.0,0.5*Gamma_Minus_One*SoundSpeed2); @@ -1831,13 +1813,13 @@ void CNEMOEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, /*--- Conservative variables, using the derived quantities ---*/ U_inlet[0] = Density; - for (iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) U_inlet[iDim+1] = Vel_Mag*Flow_Dir[iDim]*Density; U_inlet[nDim+1] = Energy*Density; /*--- Primitive variables, using the derived quantities ---*/ V_inlet[0] = Pressure / ( Gas_Constant * Density); - for (iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) V_inlet[iDim+1] = Vel_Mag*Flow_Dir[iDim]; V_inlet[nDim+1] = Pressure; V_inlet[nDim+2] = Density; @@ -1903,38 +1885,34 @@ void CNEMOEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, void CNEMOEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container, CNumerics *conv_numerics, CNumerics *visc_numerics, CConfig *config, unsigned short val_marker) { - unsigned short iVar, iDim, iSpecies; - unsigned long iVertex, iPoint; - su2double Pressure, P_Exit, Velocity[3], Temperature, Tve, Velocity2, Entropy, Density, - Riemann, Vn, SoundSpeed, Mach_Exit, Vn_Exit, Area, UnitNormal[3]; + su2double UnitNormal[MAXNDIM] = {0.0}; vector rhos; - rhos.resize(nSpecies,0.0); string Marker_Tag = config->GetMarker_All_TagBound(val_marker); - bool dynamic_grid = config->GetGrid_Movement(); - bool gravity = config->GetGravityForce(); - bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const bool dynamic_grid = config->GetGrid_Movement(); + const bool gravity = config->GetGravityForce(); + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); su2double *U_domain; - su2double *U_outlet = new su2double[nVar]; + auto *U_outlet = new su2double[nVar]; su2double *V_domain, *V_outlet; - su2double *Normal = new su2double[nDim]; - su2double *Ys = new su2double[nSpecies]; - - unsigned short T_INDEX = nodes->GetTIndex(); - unsigned short TVE_INDEX = nodes->GetTveIndex(); - unsigned short VEL_INDEX = nodes->GetVelIndex(); - unsigned short P_INDEX = nodes->GetPIndex(); - unsigned short RHO_INDEX = nodes->GetRhoIndex(); - unsigned short H_INDEX = nodes->GetHIndex(); - unsigned short A_INDEX = nodes->GetAIndex(); - unsigned short RHOCVTR_INDEX = nodes->GetRhoCvtrIndex(); - unsigned short RHOCVVE_INDEX = nodes->GetRhoCvveIndex(); + auto *Normal = new su2double[nDim]; + auto *Ys = new su2double[nSpecies]; + + const unsigned short T_INDEX = nodes->GetTIndex(); + const unsigned short TVE_INDEX = nodes->GetTveIndex(); + const unsigned short VEL_INDEX = nodes->GetVelIndex(); + const unsigned short P_INDEX = nodes->GetPIndex(); + const unsigned short RHO_INDEX = nodes->GetRhoIndex(); + const unsigned short H_INDEX = nodes->GetHIndex(); + const unsigned short A_INDEX = nodes->GetAIndex(); + const unsigned short RHOCVTR_INDEX = nodes->GetRhoCvtrIndex(); + const unsigned short RHOCVVE_INDEX = nodes->GetRhoCvveIndex(); /*--- Loop over all the vertices on this boundary marker ---*/ - for (iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { - iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); + for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { + const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); /*--- Allocate the value at the outlet ---*/ V_outlet = GetCharacPrimVar(val_marker, iVertex); @@ -1944,12 +1922,12 @@ void CNEMOEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container /*--- Normal vector for this vertex (negate for outward convention) ---*/ geometry->vertex[val_marker][iVertex]->GetNormal(Normal); - for (iDim = 0; iDim < nDim; iDim++) Normal[iDim] = -Normal[iDim]; + for (auto iDim = 0ul; iDim < nDim; iDim++) Normal[iDim] = -Normal[iDim]; conv_numerics->SetNormal(Normal); - Area = GeometryToolbox::Norm(nDim, Normal); + const su2double Area = GeometryToolbox::Norm(nDim, Normal); - for (iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) UnitNormal[iDim] = Normal[iDim]/Area; /*--- Current solution at this boundary node ---*/ @@ -1957,8 +1935,8 @@ void CNEMOEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container V_domain = nodes->GetPrimitive(iPoint); /*--- Initialize solution at outlet ---*/ - for (iVar = 0; iVar < nVar; iVar++) U_outlet[iVar] = 0.0; - for (iVar = 0; iVar < nPrimVar; iVar++) V_outlet[iVar] = 0.0; + for (auto iVar = 0ul; iVar < nVar; iVar++) U_outlet[iVar] = 0.0; + for (auto iVar = 0ul; iVar < nPrimVar; iVar++) V_outlet[iVar] = 0.0; /*--- Build the fictitious intlet state based on characteristics ---*/ @@ -1967,6 +1945,7 @@ void CNEMOEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container Gamma_Minus_One = Gamma - 1.0; /*--- Retrieve the specified back pressure for this outlet. ---*/ + su2double P_Exit; if (gravity) P_Exit = config->GetOutlet_Pressure(Marker_Tag) - geometry->nodes->GetCoord(iPoint, nDim-1)*STANDARD_GRAVITY; else P_Exit = config->GetOutlet_Pressure(Marker_Tag); @@ -1975,21 +1954,23 @@ void CNEMOEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container /*--- Check whether the flow is supersonic at the exit. The type of boundary update depends on this. ---*/ - Density = V_domain[RHO_INDEX]; - Velocity2 = 0.0; Vn = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { + su2double Density = V_domain[RHO_INDEX]; + su2double Velocity2 = 0.0; + su2double Vn = 0.0; + su2double Velocity[MAXNDIM] = {0.0}; + for (auto iDim = 0ul; iDim < nDim; iDim++) { Velocity[iDim] = V_domain[VEL_INDEX+iDim]; Velocity2 += Velocity[iDim]*Velocity[iDim]; Vn += Velocity[iDim]*UnitNormal[iDim]; } - Temperature = V_domain[T_INDEX]; - Tve = V_domain[TVE_INDEX]; - Pressure = V_domain[P_INDEX]; - SoundSpeed = V_domain[A_INDEX]; - Mach_Exit = sqrt(Velocity2)/SoundSpeed; + su2double Temperature = V_domain[T_INDEX]; + su2double Tve = V_domain[TVE_INDEX]; + su2double Pressure = V_domain[P_INDEX]; + su2double SoundSpeed = V_domain[A_INDEX]; + su2double Mach_Exit = sqrt(Velocity2)/SoundSpeed; /*--- Compute Species Concentrations ---*/ - for (iSpecies =0; iSpeciesComputeMixtureEnergies(); /*--- Conservative variables, using the derived quantities ---*/ - for (iSpecies = 0; iSpecies < nSpecies; iSpecies ++){ + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies ++){ U_outlet[iSpecies] = V_outlet[iSpecies]; } - for (iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) U_outlet[nSpecies+iDim] = Velocity[iDim]*Density; U_outlet[nVar-2] = (energies[0] + 0.5*Velocity2) * Density; @@ -2181,7 +2162,7 @@ void CNEMOEulerSolver::BC_Supersonic_Inlet( su2double Mvec[MAXNDIM] = {0.0}; - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) Mvec[iDim] = Velocity[iDim] / soundspeed; /*--- Allocate inlet node to compute gradients for numerics ---*/ @@ -2193,7 +2174,7 @@ void CNEMOEulerSolver::BC_Supersonic_Inlet( su2double Normal[MAXNDIM] = {0.0}; /*--- Loop over all the vertices on this boundary marker ---*/ - for (unsigned long iVertex = 0; iVertex < geometry->nVertex[val_marker]; + for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); @@ -2207,7 +2188,7 @@ void CNEMOEulerSolver::BC_Supersonic_Inlet( /*--- Normal vector for this vertex (negate for outward convention) ---*/ geometry->vertex[val_marker][iVertex]->GetNormal(Normal); - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) Normal[iDim] = -Normal[iDim]; /*--- Set various quantities in the solver class ---*/ @@ -2239,7 +2220,7 @@ void CNEMOEulerSolver::BC_Supersonic_Inlet( Jacobian.AddBlock2Diag(iPoint, residual.jacobian_i); /*--- Viscous contribution ---*/ - bool viscous = config->GetViscous(); + const bool viscous = config->GetViscous(); if (viscous) { /*--- Set the normal vector and the coordinates ---*/ @@ -2308,7 +2289,7 @@ void CNEMOEulerSolver::BC_Supersonic_Outlet( const string Marker_Tag = config->GetMarker_All_TagBound(val_marker); /*--- Loop over all the vertices on this boundary marker ---*/ - for (unsigned long iVertex = 0; iVertex < geometry->nVertex[val_marker]; + for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); @@ -2319,7 +2300,7 @@ void CNEMOEulerSolver::BC_Supersonic_Outlet( /*--- Normal vector for this vertex (negate for outward convention) ---*/ geometry->vertex[val_marker][iVertex]->GetNormal(Normal); - for (unsigned short iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) Normal[iDim] = -Normal[iDim]; /*--- Set various quantities in the solver class, outlet properties are @@ -2359,7 +2340,7 @@ void CNEMOEulerSolver::SetPressureDiffusionSensor(CGeometry *geometry, CConfig * const auto P_INDEX = nodes->GetPIndex(); - for (unsigned long iPoint = 0; iPoint < nPointDomain; iPoint++) { + for (auto iPoint = 0ul; iPoint < nPointDomain; iPoint++) { su2double Sensor = 1.0; diff --git a/SU2_CFD/src/solvers/CNEMONSSolver.cpp b/SU2_CFD/src/solvers/CNEMONSSolver.cpp index 98d960b76f1..14335d45df9 100644 --- a/SU2_CFD/src/solvers/CNEMONSSolver.cpp +++ b/SU2_CFD/src/solvers/CNEMONSSolver.cpp @@ -2,7 +2,7 @@ * \file CNEMONSSolver.cpp * \brief Headers of the CNEMONSSolver class * \author S. R. Copeland, F. Palacios, W. Maier. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -117,7 +117,7 @@ unsigned long CNEMONSSolver::SetPrimitive_Variables(CSolver **solver_container,C //const bool tkeNeeded = (turb_model == TURB_MODEL::SST); SU2_OMP_FOR_STAT(omp_chunk_size) - for (unsigned long iPoint = 0; iPoint < nPoint; iPoint ++) { + for (auto iPoint = 0ul; iPoint < nPoint; iPoint ++) { /*--- Retrieve the value of the kinetic energy (if needed). ---*/ @@ -145,8 +145,6 @@ unsigned long CNEMONSSolver::SetPrimitive_Variables(CSolver **solver_container,C void CNEMONSSolver::SetPrimitive_Gradient_GG(CGeometry *geometry, const CConfig *config, bool reconstruction) { - unsigned long iPoint, iVar; - unsigned short iSpecies; auto& gradient = reconstruction ? nodes->GetGradient_Reconstruction() : nodes->GetGradient_Primitive(); const auto comm = reconstruction? PRIMITIVE_GRAD_REC : PRIMITIVE_GRADIENT; const auto commPer = reconstruction? PERIODIC_PRIM_GG_R : PERIODIC_PRIM_GG; @@ -156,13 +154,13 @@ void CNEMONSSolver::SetPrimitive_Gradient_GG(CGeometry *geometry, const CConfig const unsigned short RHO_INDEX = nodes->GetRhoIndex(); /*--- Modify species density to mass concentration ---*/ - for ( iPoint = 0; iPoint < nPoint; iPoint++){ + for (auto iPoint = 0ul; iPoint < nPoint; iPoint++) { su2double primitives_aux[MAXNVAR] = {0.0}; - for( iVar = 0; iVar < nPrimVar; iVar++) + for (auto iVar = 0ul; iVar < nPrimVar; iVar++) primitives_aux[iVar] = nodes->GetPrimitive(iPoint, iVar); - for ( iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) primitives_aux[RHOS_INDEX+iSpecies] = primitives_aux[RHOS_INDEX+iSpecies]/primitives_aux[RHO_INDEX]; - for( iVar = 0; iVar < nPrimVar; iVar++) + for (auto iVar = 0ul; iVar < nPrimVar; iVar++) nodes->SetPrimitive_Aux(iPoint, iVar, primitives_aux[iVar] ); } @@ -177,14 +175,14 @@ void CNEMONSSolver::Viscous_Residual(CGeometry *geometry, CConfig *config, unsigned short iMesh, unsigned short iRKStep) { - bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); + const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); CNumerics* numerics = numerics_container[VISC_TERM]; - for (unsigned long iEdge = 0; iEdge < geometry->GetnEdge(); iEdge++) { + for (auto iEdge = 0ul; iEdge < geometry->GetnEdge(); iEdge++) { /*--- Points, coordinates and normal vector in edge ---*/ - auto iPoint = geometry->edges->GetNode(iEdge, 0); - auto jPoint = geometry->edges->GetNode(iEdge, 1); + const auto iPoint = geometry->edges->GetNode(iEdge, 0); + const auto jPoint = geometry->edges->GetNode(iEdge, 1); numerics->SetCoord(geometry->nodes->GetCoord(iPoint), geometry->nodes->GetCoord(jPoint) ); numerics->SetNormal(geometry->edges->GetNormal(iEdge)); @@ -260,12 +258,12 @@ void CNEMONSSolver::BC_HeatFluxNonCatalytic_Wall(CGeometry *geometry, const su2double pcontrol = 1.0; /*--- Get the locations of the primitive variables ---*/ - const unsigned short T_INDEX = nodes->GetTIndex(); - const unsigned short TVE_INDEX = nodes->GetTveIndex(); + const unsigned short T_INDEX = nodes->GetTIndex(); + const unsigned short TVE_INDEX = nodes->GetTveIndex(); /*--- Loop over all of the vertices on this boundary marker ---*/ SU2_OMP_FOR_DYN(OMP_MIN_SIZE) - for(auto iVertex = 0u; iVertex < geometry->nVertex[val_marker]; iVertex++) { + for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); @@ -274,10 +272,10 @@ void CNEMONSSolver::BC_HeatFluxNonCatalytic_Wall(CGeometry *geometry, /*--- Compute dual-grid area and boundary normal ---*/ const auto Normal = geometry->vertex[val_marker][iVertex]->GetNormal(); - su2double Area = GeometryToolbox::Norm(nDim, Normal); + const su2double Area = GeometryToolbox::Norm(nDim, Normal); /*--- Initialize the convective & viscous residuals to zero ---*/ - for (auto iVar = 0u; iVar < nVar; iVar++) {Res_Visc[iVar] = 0.0;} + for (auto iVar = 0ul; iVar < nVar; iVar++) {Res_Visc[iVar] = 0.0;} /*--- Set the residual on the boundary with the specified heat flux ---*/ // TODO: Look into this! @@ -286,12 +284,12 @@ void CNEMONSSolver::BC_HeatFluxNonCatalytic_Wall(CGeometry *geometry, const auto GradV = nodes->GetGradient_Primitive(iPoint); su2double dTdn = 0.0; su2double dTvedn = 0.0; - for (auto iDim = 0u; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { dTdn += GradV[T_INDEX][iDim]*Normal[iDim]; dTvedn += GradV[TVE_INDEX][iDim]*Normal[iDim]; } - su2double ktr = nodes->GetThermalConductivity(iPoint); - su2double kve = nodes->GetThermalConductivity_ve(iPoint); + const su2double ktr = nodes->GetThermalConductivity(iPoint); + const su2double kve = nodes->GetThermalConductivity_ve(iPoint); /*--- Compute residual ---*/ Res_Visc[nSpecies+nDim] += pcontrol*(ktr*dTdn+kve*dTvedn) + @@ -305,7 +303,7 @@ void CNEMONSSolver::BC_HeatFluxNonCatalytic_Wall(CGeometry *geometry, su2double zero[MAXNDIM] = {0.0}; nodes->SetVelocity_Old(iPoint, zero); - for (auto iDim = 0u; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) LinSysRes(iPoint, nSpecies+iDim) = 0.0; nodes->SetVel_ResTruncError_Zero(iPoint); @@ -351,8 +349,7 @@ void CNEMONSSolver::BC_HeatFluxCatalytic_Wall(CGeometry *geometry, SU2_MPI::Error("BC_HEATFLUX with catalytic wall: Not operational in NEMO.", CURRENT_FUNCTION); //TODO: SCALE WITH EDDY VISC /*--- Local variables ---*/ - unsigned short iDim, iSpecies, iVar; - unsigned long iVertex, iPoint, total_index; + unsigned long iPoint, total_index; su2double rho, Ys; su2double *Normal, Area; su2double *Ds, *dYdn, SdYdn; @@ -383,11 +380,11 @@ void CNEMONSSolver::BC_HeatFluxCatalytic_Wall(CGeometry *geometry, /*--- Allocate arrays ---*/ dYdn = new su2double[nSpecies]; GradY = new su2double*[nSpecies]; - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) GradY[iSpecies] = new su2double[nDim]; /*--- Loop over all of the vertices on this boundary marker ---*/ - for(iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { + for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); /*--- Check if the node belongs to the domain (i.e, not a halo node) ---*/ @@ -398,17 +395,17 @@ void CNEMONSSolver::BC_HeatFluxCatalytic_Wall(CGeometry *geometry, Area = GeometryToolbox::Norm(nDim, Normal); /*--- Initialize the convective & viscous residuals to zero ---*/ - for (iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { Res_Visc[iVar] = 0.0; Res_Sour[iVar] = 0.0; } /*--- Assign wall velocity to "Vector" array ---*/ - for (iDim = 0; iDim < nDim; iDim++) Vector[iDim] = 0.0; + for (auto iDim = 0ul; iDim < nDim; iDim++) Vector[iDim] = 0.0; /*--- Set the residual, truncation error, and velocity value ---*/ nodes->SetVelocity_Old(iPoint,Vector); - for (iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { LinSysRes(iPoint, nSpecies+iDim) = 0.0; nodes->SetVal_ResTruncError_Zero(iPoint,nSpecies+iDim); } @@ -418,7 +415,7 @@ void CNEMONSSolver::BC_HeatFluxCatalytic_Wall(CGeometry *geometry, const auto GradV = nodes->GetGradient_Primitive(iPoint); su2double dTdn = 0.0; su2double dTvedn = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { dTdn += GradV[T_INDEX][iDim]*Normal[iDim]; dTvedn += GradV[TVE_INDEX][iDim]*Normal[iDim]; } @@ -433,20 +430,20 @@ void CNEMONSSolver::BC_HeatFluxCatalytic_Wall(CGeometry *geometry, Ds = nodes->GetDiffusionCoeff(iPoint); /*--- Calculate normal derivative of mass fraction ---*/ - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { Ys = V[RHOS_INDEX+iSpecies]/rho; dYdn[iSpecies] = 0.0; - for (iDim = 0; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) dYdn[iSpecies] += 1.0/rho * (GradV[RHOS_INDEX+iSpecies][iDim] - Ys*GradV[RHO_INDEX][iDim])*Normal[iDim]; } /*--- Calculate supplementary quantities ---*/ SdYdn = 0.0; - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) SdYdn += rho*Ds[iSpecies]*dYdn[iSpecies]; - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { Ys = V[RHOS_INDEX+iSpecies]/rho; //eves = nodes->CalcEve(config, V[TVE_INDEX], iSpecies); //hs = nodes->CalcHs(config, V[T_INDEX], eves, iSpecies); @@ -495,7 +492,7 @@ void CNEMONSSolver::BC_HeatFluxCatalytic_Wall(CGeometry *geometry, Note that we need to add a contribution for moving walls to the Jacobian. ---*/ if (implicit) { /*--- Enforce the no-slip boundary condition in a strong way ---*/ - for (iVar = nSpecies; iVar < nSpecies+nDim; iVar++) { + for (auto iVar = nSpecies; iVar < nSpecies+nDim; iVar++) { total_index = iPoint*nVar+iVar; Jacobian.DeleteValsRowi(total_index); } @@ -504,7 +501,7 @@ void CNEMONSSolver::BC_HeatFluxCatalytic_Wall(CGeometry *geometry, } } - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) delete [] GradY[iSpecies]; delete [] GradY; delete [] dYdn; @@ -546,18 +543,18 @@ void CNEMONSSolver::BC_IsothermalNonCatalytic_Wall(CGeometry *geometry, const auto Marker_Tag = config->GetMarker_All_TagBound(val_marker); /*--- Retrieve the specified wall temperature ---*/ - su2double Twall = config->GetIsothermal_Temperature(Marker_Tag); + const su2double Twall = config->GetIsothermal_Temperature(Marker_Tag); su2double **Jacobian_i = nullptr; if (implicit) { Jacobian_i = new su2double* [nVar]; - for (auto iVar = 0u; iVar < nVar; iVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) Jacobian_i[iVar] = new su2double [nVar] (); } /*--- Loop over boundary points to calculate energy flux ---*/ SU2_OMP_FOR_DYN(OMP_MIN_SIZE) - for (auto iVertex = 0u; iVertex < geometry->nVertex[val_marker]; iVertex++) { + for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); @@ -565,8 +562,8 @@ void CNEMONSSolver::BC_IsothermalNonCatalytic_Wall(CGeometry *geometry, /*--- Compute dual-grid area and boundary normal ---*/ const auto Normal = geometry->vertex[val_marker][iVertex]->GetNormal(); - su2double Area = GeometryToolbox::Norm(nDim, Normal); - for (auto iDim = 0u; iDim < nDim; iDim++) + const su2double Area = GeometryToolbox::Norm(nDim, Normal); + for (auto iDim = 0ul; iDim < nDim; iDim++) UnitNormal[iDim] = Normal[iDim]/Area; /*--- Compute closest normal neighbor ---*/ @@ -576,7 +573,7 @@ void CNEMONSSolver::BC_IsothermalNonCatalytic_Wall(CGeometry *geometry, const auto Coord_i = geometry->nodes->GetCoord(iPoint); const auto Coord_j = geometry->nodes->GetCoord(Point_Normal); - su2double dist_ij = GeometryToolbox::Distance(nDim, Coord_i, Coord_j); + const su2double dist_ij = GeometryToolbox::Distance(nDim, Coord_i, Coord_j); /*--- Store the corrected velocity at the wall which will be zero (v = 0), unless there is grid motion (v = u_wall)---*/ @@ -584,21 +581,21 @@ void CNEMONSSolver::BC_IsothermalNonCatalytic_Wall(CGeometry *geometry, nodes->SetVelocity_Old(iPoint, zero); /*--- Initialize viscous residual to zero ---*/ - for (auto iVar = 0u; iVar < nVar; iVar ++) {Res_Visc[iVar] = 0.0;} + for (auto iVar = 0ul; iVar < nVar; iVar ++) {Res_Visc[iVar] = 0.0;} - for (auto iDim = 0u; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) LinSysRes(iPoint, nSpecies+iDim) = 0.0; nodes->SetVel_ResTruncError_Zero(iPoint); /*--- Calculate the gradient of temperature ---*/ - su2double Ti = nodes->GetTemperature(iPoint); - su2double Tj = nodes->GetTemperature(Point_Normal); - su2double Tvei = nodes->GetTemperature_ve(iPoint); - su2double Tvej = nodes->GetTemperature_ve(Point_Normal); + const su2double Ti = nodes->GetTemperature(iPoint); + const su2double Tj = nodes->GetTemperature(Point_Normal); + const su2double Tvei = nodes->GetTemperature_ve(iPoint); + const su2double Tvej = nodes->GetTemperature_ve(Point_Normal); /*--- Rename variables for convenience ---*/ - su2double ktr = nodes->GetThermalConductivity(iPoint); - su2double kve = nodes->GetThermalConductivity_ve(iPoint); + const su2double ktr = nodes->GetThermalConductivity(iPoint); + const su2double kve = nodes->GetThermalConductivity_ve(iPoint); /*--- Apply to the linear system ---*/ Res_Visc[nSpecies+nDim] = ((ktr*(Ti-Tj) + kve*(Tvei-Tvej)) + @@ -609,8 +606,8 @@ void CNEMONSSolver::BC_IsothermalNonCatalytic_Wall(CGeometry *geometry, if (implicit) { /*--- Initialize Jacobian to zero ---*/ - for (auto iVar = 0u; iVar < nVar; iVar++) - for (auto jVar = 0u; jVar < nVar; jVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) + for (auto jVar = 0ul; jVar < nVar; jVar++) Jacobian_i[iVar][jVar] = 0.0; /*--- Add contributions to the Jacobian from the weak enforcement of the energy equations. ---*/ @@ -618,7 +615,7 @@ void CNEMONSSolver::BC_IsothermalNonCatalytic_Wall(CGeometry *geometry, const auto dTvedU = nodes->GetdTvedU(iPoint); const su2double theta = GeometryToolbox::SquaredNorm(nDim, UnitNormal); - for (auto iVar = 0u; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { Jacobian_i[nSpecies+nDim][iVar] = -(ktr*theta/dist_ij*dTdU[iVar] + kve*theta/dist_ij*dTvedU[iVar])*Area; Jacobian_i[nSpecies+nDim+1][iVar] = - kve*theta/dist_ij*dTvedU[iVar]*Area; @@ -643,7 +640,7 @@ void CNEMONSSolver::BC_IsothermalNonCatalytic_Wall(CGeometry *geometry, END_SU2_OMP_FOR if (Jacobian_i) - for (auto iVar = 0u; iVar < nVar; iVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) delete [] Jacobian_i[iVar]; delete [] Jacobian_i; @@ -661,7 +658,6 @@ void CNEMONSSolver::BC_IsothermalCatalytic_Wall(CGeometry *geometry, sour_numerics, config, val_marker); /*--- Local variables ---*/ - unsigned short iSpecies, jSpecies, iVar, jVar, kVar; su2double **GradY, **dVdU; /*--- Assign booleans ---*/ @@ -681,14 +677,14 @@ void CNEMONSSolver::BC_IsothermalCatalytic_Wall(CGeometry *geometry, /*--- Allocate arrays ---*/ GradY = new su2double*[nSpecies]; - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) GradY[iSpecies] = new su2double[nDim]; dVdU = new su2double*[nVar]; - for (iVar = 0; iVar < nVar; iVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) dVdU[iVar] = new su2double[nVar]; /*--- Loop over all of the vertices on this boundary marker ---*/ - for (auto iVertex = 0u; iVertex < geometry->nVertex[val_marker]; iVertex++) { + for (auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); @@ -708,7 +704,7 @@ void CNEMONSSolver::BC_IsothermalCatalytic_Wall(CGeometry *geometry, const su2double Area = GeometryToolbox::Norm(nDim, Normal); /*--- Initialize the viscous residual to zero ---*/ - for (iVar = 0; iVar < nVar; iVar++) Res_Visc[iVar] = 0.0; + for (auto iVar = 0ul; iVar < nVar; iVar++) Res_Visc[iVar] = 0.0; /*--- Get primitive information ---*/ const auto& Vi = nodes->GetPrimitive(iPoint); @@ -726,21 +722,21 @@ void CNEMONSSolver::BC_IsothermalCatalytic_Wall(CGeometry *geometry, /*--- Calculate supplementary quantities ---*/ su2double dYdn = 0.0, SdYdn = 0.0; - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { dYdn = (Yst[iSpecies]-Vj[RHOS_INDEX+iSpecies]/Vj[RHO_INDEX])/dij; SdYdn += rho*Di[iSpecies]*dYdn; } /*--- Calculate species residual at wall ---*/ - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { dYdn = (Yst[iSpecies]-Vj[RHOS_INDEX+iSpecies]/Vj[RHO_INDEX])/dij; Res_Visc[iSpecies] = -(-rho*Di[iSpecies]*dYdn+Yst[iSpecies]*SdYdn)*Area; } if (implicit) { /*--- Initialize the transformation matrix ---*/ - for (iVar = 0; iVar < nVar; iVar++) - for (jVar = 0; jVar < nVar; jVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) + for (auto jVar = 0ul; jVar < nVar; jVar++) { dVdU[iVar][jVar] = 0.0; Jacobian_j[iVar][jVar] = 0.0; Jacobian_i[iVar][jVar] = 0.0; @@ -748,12 +744,12 @@ void CNEMONSSolver::BC_IsothermalCatalytic_Wall(CGeometry *geometry, /*--- Populate transformation matrix ---*/ // dYsdrk - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { - for (jSpecies = 0; jSpecies < nSpecies; jSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { + for (auto jSpecies = 0ul; jSpecies < nSpecies; jSpecies++) dVdU[iSpecies][jSpecies] += -1.0/rho*Yst[iSpecies]; dVdU[iSpecies][iSpecies] += 1.0/rho; } - for (iVar = 0; iVar < nVar; iVar++) { + for (auto iVar = 0ul; iVar < nVar; iVar++) { dVdU[nSpecies+nDim][iVar] = dTdU[iVar]; dVdU[nSpecies+nDim+1][iVar] = dTvedU[iVar]; } @@ -764,15 +760,15 @@ void CNEMONSSolver::BC_IsothermalCatalytic_Wall(CGeometry *geometry, /*--- Take the primitive var. Jacobian & store in Jac. jj ---*/ // Species mass fraction - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { - for (jSpecies = 0; jSpecies < nSpecies; jSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { + for (auto jSpecies = 0ul; jSpecies < nSpecies; jSpecies++) Jacobian_j[iSpecies][jSpecies] += -Yst[iSpecies]*rho*Di[jSpecies]/dij; Jacobian_j[iSpecies][iSpecies] += rho*Di[iSpecies]/dij - SdYdn; } // Temperature - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { - for (jSpecies = 0; jSpecies < nSpecies; jSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { + for (auto jSpecies = 0ul; jSpecies < nSpecies; jSpecies++) { Jacobian_j[nSpecies+nDim][iSpecies] += Jacobian_j[jSpecies][iSpecies]*hs[iSpecies]; } Jacobian_j[nSpecies+nDim][nSpecies+nDim] += Res_Visc[iSpecies]/Area*(Ru/Ms[iSpecies] + @@ -781,16 +777,16 @@ void CNEMONSSolver::BC_IsothermalCatalytic_Wall(CGeometry *geometry, } // Vib.-El. Temperature - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { - for (jSpecies = 0; jSpecies < nSpecies; jSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { + for (auto jSpecies = 0ul; jSpecies < nSpecies; jSpecies++) Jacobian_j[nSpecies+nDim+1][iSpecies] += Jacobian_j[jSpecies][iSpecies]*eves[iSpecies]; Jacobian_j[nSpecies+nDim+1][nSpecies+nDim+1] += Res_Visc[iSpecies]/Area*Cvve[iSpecies]; } /*--- Multiply by the transformation matrix and store in Jac. ii ---*/ - for (iVar = 0; iVar < nVar; iVar++) - for (jVar = 0; jVar < nVar; jVar++) - for (kVar = 0; kVar < nVar; kVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) + for (auto jVar = 0ul; jVar < nVar; jVar++) + for (auto kVar = 0ul; kVar < nVar; kVar++) Jacobian_i[iVar][jVar] += Jacobian_j[iVar][kVar]*dVdU[kVar][jVar]*Area; /*--- Apply to the linear system ---*/ @@ -821,13 +817,13 @@ void CNEMONSSolver::BC_IsothermalCatalytic_Wall(CGeometry *geometry, /*--- Compute catalytic recombination flux ---*/ // Ref: 10.2514/6.2022-1636 // ws = gam_s*Ys*rho_wall*sqrt(Ru*Tw/(2*Pi*M_combine)*Area - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { int Index = SU2_TYPE::Int(RxnTable(iSpecies,1)); Res_Visc[iSpecies] = RxnTable(iSpecies,0)*factor*Vi[Index]/Vi[RHO_INDEX]*sqrt(1/Ms[Index]); } } - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) { Res_Visc[nSpecies+nDim] += (Res_Visc[iSpecies]*hs[iSpecies])*Area; Res_Visc[nSpecies+nDim+1] += (Res_Visc[iSpecies]*eves[iSpecies])*Area; } @@ -837,10 +833,10 @@ void CNEMONSSolver::BC_IsothermalCatalytic_Wall(CGeometry *geometry, } } - for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) + for (auto iSpecies = 0ul; iSpecies < nSpecies; iSpecies++) delete [] GradY[iSpecies]; delete [] GradY; - for (iVar = 0; iVar < nVar; iVar++) + for (auto iVar = 0ul; iVar < nVar; iVar++) delete [] dVdU[iVar]; delete [] dVdU; } @@ -853,26 +849,26 @@ void CNEMONSSolver::BC_Smoluchowski_Maxwell(CGeometry *geometry, unsigned short val_marker) { - bool ionization = config->GetIonization(); + const bool ionization = config->GetIonization(); if (ionization) { SU2_MPI::Error("NEED TO TAKE A CLOSER LOOK AT THE JACOBIAN W/ IONIZATION", CURRENT_FUNCTION); } /*--- Define 'proportional control' constant ---*/ - su2double C = 1; + const su2double C = 1; /*---Define under-relaxation factors --- */ - su2double alpha_V = 0.1; - su2double alpha_T = 1.0; + const su2double alpha_V = 0.1; + const su2double alpha_T = 1.0; /*--- Identify the boundary ---*/ string Marker_Tag = config->GetMarker_All_TagBound(val_marker); /*--- Retrieve the specified wall temperature and accomodation coefficients---*/ - su2double Twall = config->GetIsothermal_Temperature(Marker_Tag); - su2double TMAC = 1.0; - su2double TAC = 1.0; + const su2double Twall = config->GetIsothermal_Temperature(Marker_Tag); + const su2double TMAC = 1.0; + const su2double TAC = 1.0; /*--- Extract necessary indices ---*/ const unsigned short T_INDEX = nodes->GetTIndex(); @@ -881,7 +877,7 @@ void CNEMONSSolver::BC_Smoluchowski_Maxwell(CGeometry *geometry, /*--- Loop over boundary points to calculate energy flux ---*/ SU2_OMP_FOR_DYN(OMP_MIN_SIZE) - for(auto iVertex = 0u; iVertex < geometry->nVertex[val_marker]; iVertex++) { + for(auto iVertex = 0ul; iVertex < geometry->nVertex[val_marker]; iVertex++) { const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); @@ -889,10 +885,10 @@ void CNEMONSSolver::BC_Smoluchowski_Maxwell(CGeometry *geometry, /*--- Compute dual-grid area and boundary normal ---*/ const auto Normal = geometry->vertex[val_marker][iVertex]->GetNormal(); - su2double Area = GeometryToolbox::Norm(nDim, Normal); + const su2double Area = GeometryToolbox::Norm(nDim, Normal); su2double UnitNormal[MAXNDIM] = {0.0}; - for (auto iDim = 0u; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) UnitNormal[iDim] = Normal[iDim]/Area; /*--- Compute closest normal neighbor ---*/ @@ -902,42 +898,42 @@ void CNEMONSSolver::BC_Smoluchowski_Maxwell(CGeometry *geometry, const auto Coord_i = geometry->nodes->GetCoord(iPoint); const auto Coord_j = geometry->nodes->GetCoord(jPoint); - su2double dij = GeometryToolbox::Distance(nDim, Coord_i, Coord_j); + const su2double dij = GeometryToolbox::Distance(nDim, Coord_i, Coord_j); /*--- Calculate Pressure ---*/ - su2double Pi = nodes->GetPressure(iPoint); + const su2double Pi = nodes->GetPressure(iPoint); /*--- Calculate the gradient of temperature ---*/ - su2double Ti = nodes->GetTemperature(iPoint); - su2double Tj = nodes->GetTemperature(jPoint); - su2double Tvei = nodes->GetTemperature_ve(iPoint); - su2double Tvej = nodes->GetTemperature_ve(jPoint); + const su2double Ti = nodes->GetTemperature(iPoint); + const su2double Tj = nodes->GetTemperature(jPoint); + const su2double Tvei = nodes->GetTemperature_ve(iPoint); + const su2double Tvej = nodes->GetTemperature_ve(jPoint); /*--- Rename variables for convenience ---*/ - su2double ktr = nodes->GetThermalConductivity(iPoint); - su2double kve = nodes->GetThermalConductivity_ve(iPoint); + const su2double ktr = nodes->GetThermalConductivity(iPoint); + const su2double kve = nodes->GetThermalConductivity_ve(iPoint); /*--- Retrieve Cv*density ---*/ - su2double rhoCvtr = nodes->GetRhoCv_tr(iPoint); - su2double rhoCvve = nodes->GetRhoCv_ve(iPoint); + const su2double rhoCvtr = nodes->GetRhoCv_tr(iPoint); + const su2double rhoCvve = nodes->GetRhoCv_ve(iPoint); /*--- Retrieve Flow Data ---*/ - su2double Viscosity = nodes->GetLaminarViscosity(iPoint); - su2double Density = nodes->GetDensity(iPoint); - su2double Gamma = nodes->GetGamma(iPoint); + const su2double Viscosity = nodes->GetLaminarViscosity(iPoint); + const su2double Density = nodes->GetDensity(iPoint); + const su2double Gamma = nodes->GetGamma(iPoint); /*--- Retrieve Primitive Gradients ---*/ const auto Grad_PrimVar = nodes->GetGradient_Primitive(iPoint); /*--- Calculate specific gas constant --- */ - su2double GasConstant = FluidModel->ComputeGasConstant(); + const su2double GasConstant = FluidModel->ComputeGasConstant(); /*--- Calculate temperature gradients normal to surface---*/ //Doubt about minus sign - su2double dTn = GeometryToolbox::DotProduct(nDim, Grad_PrimVar[T_INDEX], UnitNormal); - su2double dTven = GeometryToolbox::DotProduct(nDim, Grad_PrimVar[TVE_INDEX], UnitNormal); + const su2double dTn = GeometryToolbox::DotProduct(nDim, Grad_PrimVar[T_INDEX], UnitNormal); + const su2double dTven = GeometryToolbox::DotProduct(nDim, Grad_PrimVar[TVE_INDEX], UnitNormal); /*--- Calculate molecular mean free path ---*/ - su2double Lambda = Viscosity/Density*sqrt(PI_NUMBER/(2.0*GasConstant*Ti)); + const su2double Lambda = Viscosity/Density*sqrt(PI_NUMBER/(2.0*GasConstant*Ti)); /*--- Calculate Temperature Slip ---*/ su2double Tslip = ((2.0-TAC)/TAC)*2.0*Gamma/(Gamma+1.0)/Prandtl_Lam*Lambda*dTn+Twall; @@ -947,18 +943,18 @@ void CNEMONSSolver::BC_Smoluchowski_Maxwell(CGeometry *geometry, /*--- Calculate temperature gradients tangent to surface ---*/ su2double Vector_Tangent_dT[MAXNDIM] = {0.0}, Vector_Tangent_dTve[MAXNDIM] = {0.0}; - for (auto iDim = 0u; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { Vector_Tangent_dT[iDim] = Grad_PrimVar[T_INDEX][iDim] - dTn * UnitNormal[iDim]; Vector_Tangent_dTve[iDim] = Grad_PrimVar[TVE_INDEX][iDim] - dTven * UnitNormal[iDim]; } /*--- Calculate Heatflux tangent to surface ---*/ su2double Vector_Tangent_HF[MAXNDIM] = {0.0}; - for (auto iDim = 0u; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) Vector_Tangent_HF[iDim] = -ktr*Vector_Tangent_dT[iDim]-kve*Vector_Tangent_dTve[iDim]; /*--- Initialize viscous residual to zero ---*/ - for (auto iVar = 0u; iVar < nVar; iVar ++) Res_Visc[iVar] = 0.0; + for (auto iVar = 0ul; iVar < nVar; iVar ++) Res_Visc[iVar] = 0.0; /*--- Compute wall shear stress (using the stress tensor) ---*/ su2double Tau[MAXNDIM][MAXNDIM] = {{0.0}}; @@ -968,20 +964,20 @@ void CNEMONSSolver::BC_Smoluchowski_Maxwell(CGeometry *geometry, GeometryToolbox::TangentProjection(nDim,Tau,UnitNormal,TauTangent); /*--- Store the Slip Velocity at the wall */ - for (auto iDim = 0u; iDim < nDim; iDim++) + for (auto iDim = 0ul; iDim < nDim; iDim++) Vector[iDim] = Lambda/Viscosity*(2.0-TMAC)/TMAC*(TauTangent[iDim])-3.0/4.0*(Gamma-1.0)/Gamma*Prandtl_Lam/Pi*Vector_Tangent_HF[iDim]; /*--- Apply under-relaxation ---*/ Tslip = (1.0-alpha_T)*nodes->GetTemperature(iPoint)+(alpha_T)*Tslip; Tslip_ve = (1.0-alpha_T)*nodes->GetTemperature_ve(iPoint)+(alpha_T)*Tslip_ve; - for (auto iDim = 0u; iDim < nDim; iDim++){ + for (auto iDim = 0ul; iDim < nDim; iDim++){ Vector[iDim] = (1.0-alpha_V)*nodes->GetVelocity(iPoint,iDim)+(alpha_V)*Vector[iDim]; } nodes->SetVelocity_Old(iPoint,Vector); - for (auto iDim = 0u; iDim < nDim; iDim++) { + for (auto iDim = 0ul; iDim < nDim; iDim++) { LinSysRes(iPoint, nSpecies+iDim) = 0.0; nodes->SetVal_ResTruncError_Zero(iPoint,nSpecies+iDim); } diff --git a/SU2_CFD/src/solvers/CNSSolver.cpp b/SU2_CFD/src/solvers/CNSSolver.cpp index dcbedda2907..b544abccff6 100644 --- a/SU2_CFD/src/solvers/CNSSolver.cpp +++ b/SU2_CFD/src/solvers/CNSSolver.cpp @@ -2,7 +2,7 @@ * \file CNSSolver.cpp * \brief Main subroutines for solving Finite-Volume Navier-Stokes flow problems. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -472,7 +472,7 @@ void CNSSolver::BC_HeatFlux_Wall_Generic(const CGeometry* geometry, const CConfi /*--- If it is a customizable patch, retrieve the specified wall heat flux. ---*/ if (config->GetMarker_All_PyCustom(val_marker)) - Wall_HeatFlux = geometry->GetCustomBoundaryHeatFlux(val_marker, iVertex); + Wall_HeatFlux = geometry->GetCustomBoundaryHeatFlux(val_marker, iVertex) / config->GetHeat_Flux_Ref(); else if (kind_boundary == HEAT_TRANSFER) { const su2double Twall = nodes->GetTemperature(iPoint); Wall_HeatFlux = Transfer_Coefficient * (Tinfinity - Twall); @@ -710,7 +710,7 @@ void CNSSolver::BC_Isothermal_Wall_Generic(CGeometry *geometry, CSolver **solver thermal_conductivity, There, Temperature_Ref); } else if (config->GetMarker_All_PyCustom(val_marker)) { - Twall = geometry->GetCustomBoundaryTemperature(val_marker, iVertex); + Twall = geometry->GetCustomBoundaryTemperature(val_marker, iVertex) / Temperature_Ref; } /*--- Compute the normal gradient in temperature using Twall ---*/ diff --git a/SU2_CFD/src/solvers/CRadP1Solver.cpp b/SU2_CFD/src/solvers/CRadP1Solver.cpp index f25d41fa945..49611daeb5e 100644 --- a/SU2_CFD/src/solvers/CRadP1Solver.cpp +++ b/SU2_CFD/src/solvers/CRadP1Solver.cpp @@ -2,7 +2,7 @@ * \file CRadP1Solver.cpp * \brief Main subroutines for solving P1 radiation problems. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -29,7 +29,7 @@ #include "../../include/variables/CRadP1Variable.hpp" #include "../../../Common/include/toolboxes/geometry_toolbox.hpp" -CRadP1Solver::CRadP1Solver(void) : CRadSolver() { +CRadP1Solver::CRadP1Solver() : CRadSolver() { } @@ -127,9 +127,10 @@ CRadP1Solver::CRadP1Solver(CGeometry* geometry, CConfig *config) : CRadSolver(ge SetVolumetricHeatSource(geometry, config); } + SolverName = "RAD"; } -CRadP1Solver::~CRadP1Solver(void) { +CRadP1Solver::~CRadP1Solver() { delete nodes; diff --git a/SU2_CFD/src/solvers/CRadSolver.cpp b/SU2_CFD/src/solvers/CRadSolver.cpp index 5b03fa966e0..26256446773 100644 --- a/SU2_CFD/src/solvers/CRadSolver.cpp +++ b/SU2_CFD/src/solvers/CRadSolver.cpp @@ -2,7 +2,7 @@ * \file CRadP1Solver.cpp * \brief Main subroutines for solving generic radiation problems (P1, M1, discrete ordinates...) * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -28,7 +28,7 @@ #include "../../include/solvers/CRadSolver.hpp" #include "../../include/variables/CRadVariable.hpp" -CRadSolver::CRadSolver(void) : CSolver() { +CRadSolver::CRadSolver() : CSolver() { } diff --git a/SU2_CFD/src/solvers/CSolver.cpp b/SU2_CFD/src/solvers/CSolver.cpp index 357b43dee86..5cd2fd93425 100644 --- a/SU2_CFD/src/solvers/CSolver.cpp +++ b/SU2_CFD/src/solvers/CSolver.cpp @@ -2,7 +2,7 @@ * \file CSolver.cpp * \brief Main subroutines for CSolver class. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -121,7 +121,7 @@ CSolver::CSolver(LINEAR_SOLVER_MODE linear_solver_mode) : System(linear_solver_m } -CSolver::~CSolver(void) { +CSolver::~CSolver() { unsigned short iVar; @@ -362,12 +362,12 @@ void CSolver::InitiatePeriodicComms(CGeometry *geometry, unsigned long iPoint, msg_offset, buf_offset, iPeriodic; - su2double *Diff = new su2double[nVar]; - su2double *Und_Lapl = new su2double[nVar]; - su2double *Sol_Min = new su2double[nPrimVarGrad]; - su2double *Sol_Max = new su2double[nPrimVarGrad]; - su2double *rotPrim_i = new su2double[nPrimVar]; - su2double *rotPrim_j = new su2double[nPrimVar]; + auto *Diff = new su2double[nVar]; + auto *Und_Lapl = new su2double[nVar]; + auto *Sol_Min = new su2double[nPrimVarGrad]; + auto *Sol_Max = new su2double[nPrimVarGrad]; + auto *rotPrim_i = new su2double[nPrimVar]; + auto *rotPrim_j = new su2double[nPrimVar]; su2double Sensor_i = 0.0, Sensor_j = 0.0, Pressure_i, Pressure_j; const su2double *Coord_i, *Coord_j; @@ -638,7 +638,7 @@ void CSolver::InitiatePeriodicComms(CGeometry *geometry, /*--- Both points inside the domain, or both in the boundary ---*/ /*--- iPoint inside the domain, jPoint on the boundary ---*/ - if (!(boundary_i && !boundary_j)) { + if (!boundary_i || boundary_j) { if (geometry->nodes->GetDomain(iPoint)){ for (iVar = 0; iVar< nVar; iVar++) Und_Lapl[iVar] -= Diff[iVar]; @@ -698,7 +698,7 @@ void CSolver::InitiatePeriodicComms(CGeometry *geometry, /*--- Both points inside domain, or both on boundary ---*/ /*--- iPoint inside the domain, jPoint on the boundary ---*/ - if (!(boundary_i && !boundary_j)) { + if (!boundary_i || boundary_j) { if (geometry->nodes->GetDomain(iPoint)) { Sensor_i += (Pressure_j - Pressure_i); Sensor_j += (Pressure_i + Pressure_j); @@ -1020,7 +1020,7 @@ void CSolver::CompletePeriodicComms(CGeometry *geometry, /*--- Status is global so all threads can see the result of Waitany. ---*/ static SU2_MPI::Status status; - su2double *Diff = new su2double[nVar]; + auto *Diff = new su2double[nVar]; su2double Time_Step, Volume; @@ -1802,7 +1802,7 @@ void CSolver::AdaptCFLNumber(CGeometry **geometry, unsigned long signChanges = 0; su2double totalChange = 0.0; auto prev = NonLinRes_Series.front(); - for (auto val : NonLinRes_Series) { + for (const auto& val : NonLinRes_Series) { totalChange += val; signChanges += (prev > 0) ^ (val > 0); prev = val; @@ -2231,7 +2231,7 @@ void CSolver::Update_Cross_Term(CConfig *config, su2passivematrix &cross_term) { } } -void CSolver::SetGridVel_Gradient(CGeometry *geometry, const CConfig *config) { +void CSolver::SetGridVel_Gradient(CGeometry *geometry, const CConfig *config) const { /// TODO: No comms needed for this gradient? The Rmatrix should be allocated somewhere. @@ -2570,7 +2570,7 @@ void CSolver::SolveTypicalSectionWingModel(CGeometry *geometry, su2double Cl, su } -void CSolver::Restart_OldGeometry(CGeometry *geometry, CConfig *config) { +void CSolver::Restart_OldGeometry(CGeometry *geometry, CConfig *config) const { BEGIN_SU2_OMP_SAFE_GLOBAL_ACCESS { @@ -3026,7 +3026,7 @@ void CSolver::Read_SU2_Restart_Binary(CGeometry *geometry, const CConfig *config /*--- Now parse the string names and load into the config class in case we need them for writing visualization files (SU2_SOL). ---*/ - fields.push_back("Point_ID"); + fields.emplace_back("Point_ID"); for (auto iVar = 0u; iVar < nFields; iVar++) { const auto index = iVar*CGNS_STRING_SIZE; string field_buf("\""); @@ -3035,7 +3035,7 @@ void CSolver::Read_SU2_Restart_Binary(CGeometry *geometry, const CConfig *config } field_buf.append(str_buf); field_buf.append("\""); - fields.push_back(field_buf.c_str()); + fields.emplace_back(field_buf.c_str()); } /*--- Free string buffer memory. ---*/ @@ -3321,7 +3321,7 @@ void CSolver::InterpolateRestartData(const CGeometry *geometry, const CConfig *c } } -void CSolver::Read_SU2_Restart_Metadata(CGeometry *geometry, CConfig *config, bool adjoint, string val_filename) const { +void CSolver::Read_SU2_Restart_Metadata(CGeometry *geometry, CConfig *config, bool adjoint, const string& val_filename) const { su2double AoA_ = config->GetAoA(); su2double AoS_ = config->GetAoS(); @@ -3430,7 +3430,7 @@ void CSolver::Read_SU2_Restart_Metadata(CGeometry *geometry, CConfig *config, bo /*--- Angle of attack ---*/ - if (config->GetDiscard_InFiles() == false) { + if (!config->GetDiscard_InFiles()) { if ((config->GetAoA() != AoA_) && (rank == MASTER_NODE)) { cout.precision(6); cout <<"WARNING: AoA in the solution file (" << AoA_ << " deg.) +" << endl; @@ -3446,7 +3446,7 @@ void CSolver::Read_SU2_Restart_Metadata(CGeometry *geometry, CConfig *config, bo /*--- Sideslip angle ---*/ - if (config->GetDiscard_InFiles() == false) { + if (!config->GetDiscard_InFiles()) { if ((config->GetAoS() != AoS_) && (rank == MASTER_NODE)) { cout.precision(6); cout <<"WARNING: AoS in the solution file (" << AoS_ << " deg.) +" << endl; @@ -3461,7 +3461,7 @@ void CSolver::Read_SU2_Restart_Metadata(CGeometry *geometry, CConfig *config, bo /*--- BCThrust ---*/ - if (config->GetDiscard_InFiles() == false) { + if (!config->GetDiscard_InFiles()) { if ((config->GetInitial_BCThrust() != BCThrust_) && (rank == MASTER_NODE)) cout <<"WARNING: SU2 will use the initial BC Thrust provided in the solution file: " << BCThrust_ << " lbs." << endl; config->SetInitial_BCThrust(BCThrust_); @@ -3472,7 +3472,7 @@ void CSolver::Read_SU2_Restart_Metadata(CGeometry *geometry, CConfig *config, bo } - if (config->GetDiscard_InFiles() == false) { + if (!config->GetDiscard_InFiles()) { if ((config->GetdCD_dCL() != dCD_dCL_) && (rank == MASTER_NODE)) cout <<"WARNING: SU2 will use the dCD/dCL provided in the direct solution file: " << dCD_dCL_ << "." << endl; @@ -3508,7 +3508,7 @@ void CSolver::Read_SU2_Restart_Metadata(CGeometry *geometry, CConfig *config, bo } - if (config->GetDiscard_InFiles() == false) { + if (!config->GetDiscard_InFiles()) { if ((config->GetStreamwise_Periodic_PressureDrop() != SPPressureDrop_) && (rank == MASTER_NODE)) cout <<"WARNING: SU2 will use the STREAMWISE_PERIODIC_PRESSURE_DROP provided in the direct solution file: " << std::setprecision(16) << SPPressureDrop_ << endl; config->SetStreamwise_Periodic_PressureDrop(SPPressureDrop_); @@ -3520,7 +3520,7 @@ void CSolver::Read_SU2_Restart_Metadata(CGeometry *geometry, CConfig *config, bo /*--- External iteration ---*/ - if ((config->GetDiscard_InFiles() == false) && (!adjoint || (adjoint && config->GetRestart()))) + if ((!config->GetDiscard_InFiles()) && (!adjoint || (adjoint && config->GetRestart()))) config->SetExtIter_OffSet(InnerIter_); } @@ -3659,6 +3659,16 @@ void CSolver::LoadInletProfile(CGeometry **geometry, columnValue << config->GetInlet_SpeciesVal(Marker_Tag)[iVar] << "\t"; } break; + case SPECIES_MODEL::FLAMELET: + /*--- 2-equation flamelet model ---*/ + columnName << "PROGRESSVAR" << setw(24) << "ENTHALPYTOT" << setw(24); + columnValue << config->GetInlet_SpeciesVal(Marker_Tag)[0] << "\t" << config->GetInlet_SpeciesVal(Marker_Tag)[1]<<"\t"; + /*--- auxiliary species transport equations ---*/ + for (unsigned short iReactant = 0; iReactant < config->GetNUserScalars(); iReactant++) { + columnName << config->GetUserScalarName(iReactant) << setw(24); + columnValue << config->GetInlet_SpeciesVal(Marker_Tag)[config->GetNControlVars() + iReactant] << "\t"; + } + break; } columnNames.push_back(columnName.str()); @@ -4045,6 +4055,7 @@ void CSolver::SetVertexTractionsAdjoint(CGeometry *geometry, const CConfig *conf unsigned short iMarker, iDim; unsigned long iVertex, iPoint; + int index; /*--- Loop over all the markers ---*/ for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { @@ -4064,8 +4075,8 @@ void CSolver::SetVertexTractionsAdjoint(CGeometry *geometry, const CConfig *conf /*--- Set the adjoint of the vertex traction from the value received ---*/ for (iDim = 0; iDim < nDim; iDim++) { - SU2_TYPE::SetDerivative(VertexTraction[iMarker][iVertex][iDim], - SU2_TYPE::GetValue(VertexTractionAdjoint[iMarker][iVertex][iDim])); + AD::SetIndex(index, VertexTraction[iMarker][iVertex][iDim]); + AD::SetDerivative(index, SU2_TYPE::GetValue(VertexTractionAdjoint[iMarker][iVertex][iDim])); } } END_SU2_OMP_FOR diff --git a/SU2_CFD/src/solvers/CSolverFactory.cpp b/SU2_CFD/src/solvers/CSolverFactory.cpp index 02843124a4f..cf252ba018d 100644 --- a/SU2_CFD/src/solvers/CSolverFactory.cpp +++ b/SU2_CFD/src/solvers/CSolverFactory.cpp @@ -2,7 +2,7 @@ * \file CSolverFactory.cpp * \brief Main subroutines for CSolverFactoryclass. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -52,6 +52,7 @@ #include "../../include/solvers/CBaselineSolver_FEM.hpp" #include "../../include/solvers/CRadP1Solver.hpp" #include "../../include/solvers/CSpeciesSolver.hpp" +#include "../../include/solvers/CSpeciesFlameletSolver.hpp" map CSolverFactory::allocatedSolvers; @@ -398,7 +399,10 @@ CSolver* CSolverFactory::CreateSpeciesSolver(CSolver **solver, CGeometry *geomet if (adjoint){ speciesSolver = new CDiscAdjSolver(geometry, config, solver[SPECIES_SOL], RUNTIME_SPECIES_SYS, iMGLevel); } else { - speciesSolver = new CSpeciesSolver(geometry, config, iMGLevel); + if (config->GetKind_Species_Model() == SPECIES_MODEL::SPECIES_TRANSPORT) + speciesSolver = new CSpeciesSolver(geometry, config, iMGLevel); + else if (config->GetKind_Species_Model() == SPECIES_MODEL::FLAMELET) + speciesSolver = new CSpeciesFlameletSolver(geometry, config, iMGLevel); } } return speciesSolver; @@ -411,9 +415,9 @@ CSolver* CSolverFactory::CreateHeatSolver(CSolver **solver, CGeometry *geometry, /*--- Only allocate a heat solver if it should run standalone * or if the weakly coupled heat solver is enabled and no energy equation is included ---*/ - if ((config->GetWeakly_Coupled_Heat() && !config->GetEnergy_Equation()) || config->GetHeatProblem()){ - if (adjoint){ - if (config->GetDiscrete_Adjoint()){ + if ((config->GetWeakly_Coupled_Heat() && !config->GetEnergy_Equation()) || config->GetHeatProblem()) { + if (adjoint) { + if (config->GetDiscrete_Adjoint()) { heatSolver = new CDiscAdjSolver(geometry, config, solver[HEAT_SOL], RUNTIME_HEAT_SYS, iMGLevel); } else { @@ -424,24 +428,24 @@ CSolver* CSolverFactory::CreateHeatSolver(CSolver **solver, CGeometry *geometry, heatSolver = new CHeatSolver(geometry, config, iMGLevel); } } - return heatSolver; + return heatSolver; } CSolver* CSolverFactory::CreateMeshSolver(CSolver **solver, CGeometry *geometry, CConfig *config, int iMGLevel, bool adjoint){ CSolver *meshSolver = nullptr; - if (config->GetDeform_Mesh() && iMGLevel == MESH_0){ - if (!adjoint){ + if (config->GetDeform_Mesh() && iMGLevel == MESH_0) { + if (!adjoint) { meshSolver = new CMeshSolver(geometry, config); } - if (adjoint && config->GetDiscrete_Adjoint()){ + if (adjoint && config->GetDiscrete_Adjoint()) { meshSolver = new CDiscAdjMeshSolver(geometry, config, solver[MESH_SOL]); } } - return meshSolver; + return meshSolver; } CSolver* CSolverFactory::CreateDGSolver(SUB_SOLVER_TYPE kindDGSolver, CGeometry *geometry, CConfig *config, int iMGLevel){ diff --git a/SU2_CFD/src/solvers/CSpeciesFlameletSolver.cpp b/SU2_CFD/src/solvers/CSpeciesFlameletSolver.cpp new file mode 100644 index 00000000000..58c20ca3cc7 --- /dev/null +++ b/SU2_CFD/src/solvers/CSpeciesFlameletSolver.cpp @@ -0,0 +1,531 @@ +/*! + * \file CSpeciesFlameletSolver.cpp + * \brief Main subroutines of CSpeciesFlameletSolver class + * \author D. Mayer, T. Economon, N. Beishuizen, E. Bunschoten + * \version 8.0.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/solvers/CSpeciesFlameletSolver.hpp" + +#include "../../../Common/include/parallelization/omp_structure.hpp" +#include "../../../Common/include/toolboxes/geometry_toolbox.hpp" +#include "../../include/fluid/CFluidFlamelet.hpp" +#include "../../include/solvers/CSpeciesSolver.hpp" +#include "../../include/variables/CFlowVariable.hpp" +#include "../../include/variables/CSpeciesFlameletVariable.hpp" + +CSpeciesFlameletSolver::CSpeciesFlameletSolver(CGeometry* geometry, CConfig* config, unsigned short iMesh) + : CSpeciesSolver(geometry, config, true) { + /*--- Dimension of the problem. ---*/ + nVar = config->GetNScalars(); + include_mixture_fraction = (config->GetNControlVars() == 3); + + Initialize(geometry, config, iMesh, nVar); + + /*--- Initialize the solution to the far-field state everywhere. ---*/ + + nodes = new CSpeciesFlameletVariable(Solution_Inf, nPoint, nDim, nVar, config); + SetBaseClassPointerToNodes(); + + /*--- Store the initial CFL number for all grid points. ---*/ + + const su2double CFL = config->GetCFL(MGLevel) * config->GetCFLRedCoeff_Species(); + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto iPoint = 0u; iPoint < nPoint; iPoint++) { + nodes->SetLocalCFL(iPoint, CFL); + } + END_SU2_OMP_FOR + Min_CFL_Local = CFL; + Max_CFL_Local = CFL; + Avg_CFL_Local = CFL; + + /*--- Add the solver name. ---*/ + SolverName = "FLAMELET"; +} + +void CSpeciesFlameletSolver::Preprocessing(CGeometry* geometry, CSolver** solver_container, CConfig* config, + unsigned short iMesh, unsigned short iRKStep, + unsigned short RunTime_EqSystem, bool Output) { + unsigned long n_not_in_domain_local = 0, n_not_in_domain_global = 0; + vector scalars_vector(nVar); + + auto* flowNodes = su2staticcast_p(solver_container[FLOW_SOL]->GetNodes()); + + SU2_OMP_SAFE_GLOBAL_ACCESS(config->SetGlobalParam(config->GetKind_Solver(), RunTime_EqSystem);) + + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto i_point = 0u; i_point < nPoint; i_point++) { + CFluidModel* fluid_model_local = solver_container[FLOW_SOL]->GetFluidModel(); + su2double* scalars = nodes->GetSolution(i_point); + for (auto iVar = 0u; iVar < nVar; iVar++) scalars_vector[iVar] = scalars[iVar]; + + /*--- Compute total source terms from the production and consumption. ---*/ + unsigned long misses = SetScalarSources(config, fluid_model_local, i_point, scalars_vector); + nodes->SetTableMisses(i_point, misses); + n_not_in_domain_local += misses; + /*--- Obtain passive look-up scalars. ---*/ + SetScalarLookUps(config, fluid_model_local, i_point, scalars_vector); + + /*--- Set mass diffusivity based on thermodynamic state. ---*/ + su2double T = flowNodes->GetTemperature(i_point); + fluid_model_local->SetTDState_T(T, scalars); + /*--- set the diffusivity in the fluid model to the diffusivity obtained from the lookup table ---*/ + for (auto i_scalar = 0u; i_scalar < nVar; ++i_scalar) { + nodes->SetDiffusivity(i_point, fluid_model_local->GetMassDiffusivity(i_scalar), i_scalar); + } + + if (!Output) LinSysRes.SetBlock_Zero(i_point); + } + END_SU2_OMP_FOR + /* --- Sum up some global counters over processes. --- */ + SU2_MPI::Reduce(&n_not_in_domain_local, &n_not_in_domain_global, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, + SU2_MPI::GetComm()); + if ((rank == MASTER_NODE) && (n_not_in_domain_global > 0)) + cout << "Number of points outside manifold domain: " << n_not_in_domain_global << endl; + /*--- Clear Residual and Jacobian. Upwind second order reconstruction and gradients ---*/ + CommonPreprocessing(geometry, config, Output); +} + +void CSpeciesFlameletSolver::SetInitialCondition(CGeometry** geometry, CSolver*** solver_container, CConfig* config, + unsigned long ExtIter) { + const bool Restart = (config->GetRestart() || config->GetRestart_Flow()); + + if ((!Restart) && ExtIter == 0) { + if (rank == MASTER_NODE) { + cout << "Initializing progress variable and total enthalpy (using temperature)" << endl; + } + + const su2double* flame_init = config->GetFlameInit(); + const su2double flame_offset[3] = {flame_init[0], flame_init[1], flame_init[2]}; + const su2double flame_normal[3] = {flame_init[3], flame_init[4], flame_init[5]}; + const su2double flame_thickness = flame_init[6]; + const su2double flame_burnt_thickness = flame_init[7]; + + const su2double flamenorm = GeometryToolbox::Norm(nDim, flame_normal); + const su2double temp_inlet = config->GetInc_Temperature_Init(); + su2double enth_inlet = config->GetSpecies_Init()[I_ENTH]; + + su2double prog_burnt = 0, prog_unburnt, point_loc; + su2double scalar_init[MAXNVAR]; + + if (rank == MASTER_NODE) { + cout << "initial condition: T = " << temp_inlet << endl; + for (auto iCV = 0u; iCV < config->GetNControlVars(); iCV++) { + const auto& cv_name = config->GetControllingVariableName(iCV); + cout << "initial condition: " << cv_name << " = " << config->GetSpecies_Init()[iCV] << endl; + } + } + + CFluidModel* fluid_model_local; + + unsigned long n_not_iterated_local = 0, n_not_in_domain_local = 0, n_points_unburnt_local = 0, + n_points_burnt_local = 0, n_points_flame_local = 0, n_not_iterated_global, n_not_in_domain_global, + n_points_burnt_global, n_points_flame_global, n_points_unburnt_global; + + for (unsigned long i_mesh = 0; i_mesh <= config->GetnMGLevels(); i_mesh++) { + fluid_model_local = solver_container[i_mesh][FLOW_SOL]->GetFluidModel(); + + for (auto iVar = 0u; iVar < nVar; iVar++) scalar_init[iVar] = config->GetSpecies_Init()[iVar]; + + /*--- Set enthalpy based on initial temperature and scalars. ---*/ + n_not_iterated_local += GetEnthFromTemp(fluid_model_local, temp_inlet, config->GetSpecies_Init(), &enth_inlet); + scalar_init[I_ENTH] = enth_inlet; + + prog_unburnt = config->GetSpecies_Init()[I_PROGVAR]; + prog_burnt = GetBurntProgressVariable(fluid_model_local, scalar_init); + SU2_OMP_FOR_STAT(omp_chunk_size) + for (unsigned long i_point = 0; i_point < nPoint; i_point++) { + auto coords = geometry[i_mesh]->nodes->GetCoord(i_point); + + /*--- Determine if point is above or below the plane, assuming the normal + is pointing towards the burned region. ---*/ + point_loc = 0.0; + for (unsigned short i_dim = 0; i_dim < geometry[i_mesh]->GetnDim(); i_dim++) { + point_loc += flame_normal[i_dim] * (coords[i_dim] - flame_offset[i_dim]); + } + + /*--- Compute the exact distance from point to plane. ---*/ + point_loc = point_loc / flamenorm; + + /* --- Unburnt region upstream of the flame. --- */ + if (point_loc <= 0) { + scalar_init[I_PROGVAR] = prog_unburnt; + n_points_unburnt_local++; + + /* --- Flame zone where we lineary increase from unburnt to burnt conditions. --- */ + } else if ((point_loc > 0) && (point_loc <= flame_thickness)) { + scalar_init[I_PROGVAR] = prog_unburnt + point_loc * (prog_burnt - prog_unburnt) / flame_thickness; + n_points_flame_local++; + + /* --- Burnt region behind the flame zone. --- */ + } else if ((point_loc > flame_thickness) && (point_loc <= flame_thickness + flame_burnt_thickness)) { + scalar_init[I_PROGVAR] = prog_burnt; + n_points_burnt_local++; + + /* --- Unburnt region downstream of the flame and burnt region. --- */ + } else { + scalar_init[I_PROGVAR] = prog_unburnt; + n_points_unburnt_local++; + } + + /* --- Perform manifold evaluation to check whether initial scalar is out-of-bounds. --- */ + fluid_model_local->SetTDState_T(temp_inlet, scalar_init); + n_not_in_domain_local += fluid_model_local->GetExtrapolation(); + + /* --- Initialize the auxiliary transported scalars (not controlling variables). --- */ + for (int i_scalar = config->GetNControlVars(); i_scalar < config->GetNScalars(); ++i_scalar) { + scalar_init[i_scalar] = config->GetSpecies_Init()[i_scalar]; + } + + solver_container[i_mesh][SPECIES_SOL]->GetNodes()->SetSolution(i_point, scalar_init); + } + + solver_container[i_mesh][SPECIES_SOL]->InitiateComms(geometry[i_mesh], config, SOLUTION); + solver_container[i_mesh][SPECIES_SOL]->CompleteComms(geometry[i_mesh], config, SOLUTION); + + solver_container[i_mesh][FLOW_SOL]->InitiateComms(geometry[i_mesh], config, SOLUTION); + solver_container[i_mesh][FLOW_SOL]->CompleteComms(geometry[i_mesh], config, SOLUTION); + + solver_container[i_mesh][FLOW_SOL]->Preprocessing(geometry[i_mesh], solver_container[i_mesh], config, i_mesh, + NO_RK_ITER, RUNTIME_FLOW_SYS, false); + END_SU2_OMP_FOR + } + + /* --- Sum up some global counters over processes. --- */ + SU2_MPI::Reduce(&n_not_in_domain_local, &n_not_in_domain_global, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, + SU2_MPI::GetComm()); + SU2_MPI::Reduce(&n_not_iterated_local, &n_not_iterated_global, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, + SU2_MPI::GetComm()); + SU2_MPI::Reduce(&n_points_unburnt_local, &n_points_unburnt_global, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, + SU2_MPI::GetComm()); + SU2_MPI::Reduce(&n_points_burnt_local, &n_points_burnt_global, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, + SU2_MPI::GetComm()); + SU2_MPI::Reduce(&n_points_flame_local, &n_points_flame_global, 1, MPI_UNSIGNED_LONG, MPI_SUM, MASTER_NODE, + SU2_MPI::GetComm()); + + if (rank == MASTER_NODE) { + cout << endl; + cout << " Number of points in unburnt region: " << n_points_unburnt_global << "." << endl; + cout << " Number of points in burnt region : " << n_points_burnt_global << "." << endl; + cout << " Number of points in flame zone : " << n_points_flame_global << "." << endl; + + if (n_not_in_domain_global > 0) + cout << " Initial condition: Number of points outside of table domain: " << n_not_in_domain_global << " !!!" + << endl; + + if (n_not_iterated_global > 0) + cout << " Initial condition: Number of points in which enthalpy could not be iterated: " + << n_not_iterated_global << " !!!" << endl; + } + } +} + +void CSpeciesFlameletSolver::SetPreconditioner(CGeometry* geometry, CSolver** solver_container, CConfig* config) { + const bool variable_density = (config->GetVariable_Density_Model()); + const bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); + + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto iPoint = 0u; iPoint < nPointDomain; iPoint++) { + /*--- Access the primitive variables at this node. ---*/ + + su2double Density = solver_container[FLOW_SOL]->GetNodes()->GetDensity(iPoint); + su2double BetaInc2 = solver_container[FLOW_SOL]->GetNodes()->GetBetaInc2(iPoint); + su2double Temperature = solver_container[FLOW_SOL]->GetNodes()->GetTemperature(iPoint); + + su2double SolP = solver_container[FLOW_SOL]->LinSysSol(iPoint, prim_idx.Pressure()); + su2double SolT = solver_container[FLOW_SOL]->LinSysSol(iPoint, prim_idx.Temperature()); + + /*--- We need the derivative of the equation of state to build the + preconditioning matrix. For now, the only option is the ideal gas + law, but in the future, dRhodT should be in the fluid model. ---*/ + + su2double dRhodT = 0.0; + if (variable_density) { + dRhodT = -Density / Temperature; + } + + /*--- Passive scalars have no impact on the density. ---*/ + + su2double dRhodC = 0.0; + + /*--- Modify matrix diagonal with term including volume and time step. ---*/ + + su2double Vol = geometry->nodes->GetVolume(iPoint); + su2double Delta = + Vol / (config->GetCFLRedCoeff_Species() * solver_container[FLOW_SOL]->GetNodes()->GetDelta_Time(iPoint)); + + /*--- Calculating the inverse of the preconditioning matrix + that multiplies the time derivative during time integration. ---*/ + + if (implicit) { + for (unsigned short iVar = 0; iVar < nVar; iVar++) { + su2double scalar = nodes->GetSolution(iPoint, iVar); + + /*--- Compute the lag terms for the decoupled linear system from + the mean flow equations and add to the residual for the scalar. + In short, we are effectively making these terms explicit. ---*/ + + su2double artcompc1 = SolP * scalar / (Density * BetaInc2); + su2double artcompc2 = SolT * dRhodT * scalar / (Density); + + LinSysRes(iPoint, iVar) += artcompc1 + artcompc2; + + /*--- Add the extra Jacobian term to the scalar system. ---*/ + + su2double Jaccomp = scalar * dRhodC + Density; + su2double JacTerm = Jaccomp * Delta; + + Jacobian.AddVal2Diag(iPoint, iVar, JacTerm); + } + } + } + END_SU2_OMP_FOR +} + +void CSpeciesFlameletSolver::Source_Residual(CGeometry* geometry, CSolver** solver_container, + CNumerics** numerics_container, CConfig* config, unsigned short iMesh) { + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto i_point = 0u; i_point < nPointDomain; i_point++) { + /*--- Add source terms from the lookup table directly to the residual. ---*/ + for (auto i_var = 0; i_var < nVar; i_var++) { + LinSysRes(i_point, i_var) -= nodes->GetScalarSources(i_point)[i_var] * geometry->nodes->GetVolume(i_point); + } + } + END_SU2_OMP_FOR + + /*--- call the species solver for the shared sources (axisymmetric) ---*/ + CSpeciesSolver::Source_Residual(geometry, solver_container, numerics_container, config, iMesh); +} + +void CSpeciesFlameletSolver::BC_Inlet(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics, + CNumerics* visc_numerics, CConfig* config, unsigned short val_marker) { + string Marker_Tag = config->GetMarker_All_TagBound(val_marker); + + su2double temp_inlet = config->GetInlet_Ttotal(Marker_Tag); + + /*--- We compute inlet enthalpy from the temperature and progress variable. ---*/ + su2double enth_inlet; + GetEnthFromTemp(solver_container[FLOW_SOL]->GetFluidModel(), temp_inlet, config->GetInlet_SpeciesVal(Marker_Tag), + &enth_inlet); + + SU2_OMP_FOR_STAT(OMP_MIN_SIZE) + for (auto iVertex = 0u; iVertex < geometry->nVertex[val_marker]; iVertex++) { + Inlet_SpeciesVars[val_marker][iVertex][I_ENTH] = enth_inlet; + END_SU2_OMP_FOR + } + + /*--- Call the general inlet boundary condition implementation. ---*/ + CSpeciesSolver::BC_Inlet(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker); +} + +void CSpeciesFlameletSolver::BC_Isothermal_Wall_Generic(CGeometry* geometry, CSolver** solver_container, + CNumerics* conv_numerics, CNumerics* visc_numerics, + CConfig* config, unsigned short val_marker, bool cht_mode) { + const bool implicit = config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT; + const string Marker_Tag = config->GetMarker_All_TagBound(val_marker); + su2double temp_wall; + CFluidModel* fluid_model_local = solver_container[FLOW_SOL]->GetFluidModel(); + auto* flowNodes = su2staticcast_p(solver_container[FLOW_SOL]->GetNodes()); + su2double enth_wall; + unsigned long n_not_iterated = 0; + + /*--- Loop over all the vertices on this boundary marker. ---*/ + SU2_OMP_FOR_STAT(OMP_MIN_SIZE) + for (unsigned long iVertex = 0; iVertex < geometry->nVertex[val_marker]; iVertex++) { + unsigned long iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); + + if (cht_mode) + temp_wall = solver_container[FLOW_SOL]->GetConjugateHeatVariable(val_marker, iVertex, 0); + else + temp_wall = config->GetIsothermal_Temperature(Marker_Tag); + + /*--- Check if the node belongs to the domain (i.e., not a halo node). ---*/ + + if (geometry->nodes->GetDomain(iPoint)) { + if (config->GetMarker_StrongBC(Marker_Tag) == true) { + /*--- Initial guess for enthalpy value. ---*/ + enth_wall = nodes->GetSolution(iPoint, I_ENTH); + + /*--- Set enthalpy on the wall. ---*/ + n_not_iterated += GetEnthFromTemp(fluid_model_local, temp_wall, nodes->GetSolution(iPoint), &enth_wall); + + /*--- Impose the value of the enthalpy as a strong boundary + condition (Dirichlet) and remove any + contribution to the residual at this node. ---*/ + + nodes->SetSolution(iPoint, I_ENTH, enth_wall); + nodes->SetSolution_Old(iPoint, I_ENTH, enth_wall); + + LinSysRes(iPoint, I_ENTH) = 0.0; + + nodes->SetVal_ResTruncError_Zero(iPoint, I_ENTH); + + if (implicit) { + unsigned long total_index = iPoint * nVar + I_ENTH; + Jacobian.DeleteValsRowi(total_index); + } + } else { + /*--- Weak BC formulation. ---*/ + const auto Normal = geometry->vertex[val_marker][iVertex]->GetNormal(); + + const su2double Area = GeometryToolbox::Norm(nDim, Normal); + + const auto Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); + + /*--- Get coordinates of i & nearest normal and compute distance. ---*/ + + const auto Coord_i = geometry->nodes->GetCoord(iPoint); + const auto Coord_j = geometry->nodes->GetCoord(Point_Normal); + su2double Edge_Vector[MAXNDIM]; + GeometryToolbox::Distance(nDim, Coord_j, Coord_i, Edge_Vector); + su2double dist_ij_2 = GeometryToolbox::SquaredNorm(nDim, Edge_Vector); + su2double dist_ij = sqrt(dist_ij_2); + + /*--- Compute the normal gradient in temperature using Twall. ---*/ + + su2double dTdn = -(flowNodes->GetTemperature(Point_Normal) - temp_wall) / dist_ij; + + /*--- Get thermal conductivity. ---*/ + + su2double thermal_conductivity = flowNodes->GetThermalConductivity(iPoint); + + /*--- Apply a weak boundary condition for the energy equation. + Compute the residual due to the prescribed heat flux. ---*/ + + LinSysRes(iPoint, I_ENTH) -= thermal_conductivity * dTdn * Area; + } + } + } + END_SU2_OMP_FOR + + if (rank == MASTER_NODE && n_not_iterated > 0) { + cout << " !!! Wall bc (" << Marker_Tag + << "): Number of points in which enthalpy could not be iterated: " << n_not_iterated << " !!!" << endl; + } +} + +void CSpeciesFlameletSolver::BC_Isothermal_Wall(CGeometry* geometry, CSolver** solver_container, + CNumerics* conv_numerics, CNumerics* visc_numerics, CConfig* config, + unsigned short val_marker) { + BC_Isothermal_Wall_Generic(geometry, solver_container, conv_numerics, visc_numerics, config, val_marker); +} + +void CSpeciesFlameletSolver::BC_ConjugateHeat_Interface(CGeometry* geometry, CSolver** solver_container, + CNumerics* conv_numerics, CConfig* config, + unsigned short val_marker) { + BC_Isothermal_Wall_Generic(geometry, solver_container, conv_numerics, nullptr, config, val_marker, true); +} + +unsigned long CSpeciesFlameletSolver::SetScalarSources(const CConfig* config, CFluidModel* fluid_model_local, + unsigned long iPoint, const vector& scalars) { + /*--- Compute total source terms from the production and consumption. ---*/ + + vector table_sources(config->GetNControlVars() + 2 * config->GetNUserScalars()); + unsigned long misses = fluid_model_local->EvaluateDataSet(scalars, FLAMELET_LOOKUP_OPS::SOURCES, table_sources); + nodes->SetTableMisses(iPoint, misses); + + /*--- The source term for progress variable is always positive, we clip from below to makes sure. --- */ + + vector source_scalar(config->GetNScalars()); + for (auto iCV = 0u; iCV < config->GetNControlVars(); iCV++) source_scalar[iCV] = table_sources[iCV]; + source_scalar[I_PROGVAR] = fmax(EPS, source_scalar[I_PROGVAR]); + + /*--- Source term for the auxiliary species transport equations. ---*/ + for (size_t i_aux = 0; i_aux < config->GetNUserScalars(); i_aux++) { + /*--- The source term for the auxiliary equations consists of a production term and a consumption term: + S_TOT = S_PROD + S_CONS * Y ---*/ + su2double y_aux = scalars[config->GetNControlVars() + i_aux]; + su2double source_prod = table_sources[config->GetNControlVars() + 2 * i_aux]; + su2double source_cons = table_sources[config->GetNControlVars() + 2 * i_aux + 1]; + source_scalar[config->GetNControlVars() + i_aux] = source_prod + source_cons * y_aux; + } + for (auto i_scalar = 0u; i_scalar < nVar; i_scalar++) + nodes->SetScalarSource(iPoint, i_scalar, source_scalar[i_scalar]); + return misses; +} + +unsigned long CSpeciesFlameletSolver::SetScalarLookUps(const CConfig* config, CFluidModel* fluid_model_local, + unsigned long iPoint, const vector& scalars) { + /*--- Compute total source terms from the production and consumption. ---*/ + + vector lookup_scalar(config->GetNLookups()); + unsigned long misses = fluid_model_local->EvaluateDataSet(scalars, FLAMELET_LOOKUP_OPS::LOOKUP, lookup_scalar); + + for (auto i_lookup = 0u; i_lookup < config->GetNLookups(); i_lookup++) { + nodes->SetLookupScalar(iPoint, lookup_scalar[i_lookup], i_lookup); + } + return misses; +} + +unsigned long CSpeciesFlameletSolver::GetEnthFromTemp(CFluidModel* fluid_model, su2double const val_temp, + const su2double* scalar_solution, su2double* val_enth) { + /*--- convergence criterion for temperature in [K], high accuracy needed for restarts. ---*/ + su2double delta_temp_final = 0.001; + su2double enth_iter = scalar_solution[I_ENTH]; + su2double delta_enth; + su2double delta_temp_iter = 1e10; + unsigned long exit_code = 0; + const int counter_limit = 1000; + + int counter = 0; + + su2double val_scalars[MAXNVAR]; + for (auto iVar = 0u; iVar < nVar; iVar++) val_scalars[iVar] = scalar_solution[iVar]; + + while ((abs(delta_temp_iter) > delta_temp_final) && (counter++ < counter_limit)) { + /*--- Add all quantities and their names to the look up vectors. ---*/ + val_scalars[I_ENTH] = enth_iter; + fluid_model->SetTDState_T(val_temp, val_scalars); + + su2double Temperature = fluid_model->GetTemperature(); + su2double Cp = fluid_model->GetCp(); + + delta_temp_iter = val_temp - Temperature; + + delta_enth = Cp * delta_temp_iter; + + enth_iter += delta_enth; + } + + *val_enth = enth_iter; + + if (counter >= counter_limit) { + exit_code = 1; + } + + return exit_code; +} + +su2double CSpeciesFlameletSolver::GetBurntProgressVariable(CFluidModel* fluid_model, const su2double* scalar_solution) { + su2double scalars[MAXNVAR], delta = 1e-3; + for (auto iVar = 0u; iVar < nVar; iVar++) scalars[iVar] = scalar_solution[iVar]; + + bool outside = false; + while (!outside) { + fluid_model->SetTDState_T(300, scalars); + if (fluid_model->GetExtrapolation() == 1) outside = true; + scalars[I_PROGVAR] += delta; + } + su2double pv_burnt = scalars[I_PROGVAR] - delta; + return pv_burnt; +} diff --git a/SU2_CFD/src/solvers/CSpeciesSolver.cpp b/SU2_CFD/src/solvers/CSpeciesSolver.cpp index 690de424eee..3d5c5406a3b 100644 --- a/SU2_CFD/src/solvers/CSpeciesSolver.cpp +++ b/SU2_CFD/src/solvers/CSpeciesSolver.cpp @@ -2,7 +2,7 @@ * \file CSpeciesSolver.cpp * \brief Main subroutines of CSpeciesSolver class * \author T. Kattmann - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -36,12 +36,64 @@ template class CScalarSolver; CSpeciesSolver::CSpeciesSolver(CGeometry* geometry, CConfig* config, unsigned short iMesh) : CScalarSolver(geometry, config, true) { - /*--- Store if an implicit scheme is used, for use during periodic boundary conditions. ---*/ - SetImplicitPeriodic(config->GetKind_TimeIntScheme_Species() == EULER_IMPLICIT); /*--- Dimension of the problem. ---*/ nVar = config->GetnSpecies(); + + Initialize(geometry, config, iMesh, nVar); + + /*--- Initialize the solution to the far-field state everywhere. ---*/ + + nodes = new CSpeciesVariable(Solution_Inf, nPoint, nDim, nVar, config); + SetBaseClassPointerToNodes(); + + /*--- Initialize the mass diffusivity. Nondimensionalization done in the flow solver. ---*/ + SU2_OMP_FOR_STAT(omp_chunk_size) + for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) { + for (auto iVar = 0u; iVar <= nVar; iVar++) { + const auto MassDiffusivity = config->GetDiffusivity_ConstantND(); + nodes->SetDiffusivity(iPoint, MassDiffusivity, iVar); + } + } + END_SU2_OMP_FOR + + /*--- MPI solution ---*/ + + InitiateComms(geometry, config, SOLUTION); + CompleteComms(geometry, config, SOLUTION); + + SlidingState.resize(nMarker); + SlidingStateNodes.resize(nMarker); + + for (unsigned long iMarker = 0; iMarker < nMarker; iMarker++) { + if (config->GetMarker_All_KindBC(iMarker) == FLUID_INTERFACE) { + SlidingState[iMarker].resize(nVertex[iMarker], nPrimVar+1) = nullptr; + SlidingStateNodes[iMarker].resize(nVertex[iMarker],0); + } + } + + /*--- Store the initial CFL number for all grid points. ---*/ + + const su2double CFL = config->GetCFL(MGLevel) * config->GetCFLRedCoeff_Species(); + SU2_OMP_FOR_STAT(omp_chunk_size) + for (auto iPoint = 0u; iPoint < nPoint; iPoint++) { + nodes->SetLocalCFL(iPoint, CFL); + } + END_SU2_OMP_FOR + Min_CFL_Local = CFL; + Max_CFL_Local = CFL; + Avg_CFL_Local = CFL; + + /*--- Add the solver name. ---*/ + SolverName = "SPECIES"; +} + + +void CSpeciesSolver::Initialize(CGeometry* geometry, CConfig* config, unsigned short iMesh, unsigned short nVar) { + /*--- Store if an implicit scheme is used, for use during periodic boundary conditions. ---*/ + SetImplicitPeriodic(config->GetKind_TimeIntScheme_Species() == EULER_IMPLICIT); + nPrimVar = nVar; if (nVar > MAXNVAR) @@ -58,9 +110,8 @@ CSpeciesSolver::CSpeciesSolver(CGeometry* geometry, CConfig* config, unsigned sh nDim = geometry->GetnDim(); - /*--- Single grid simulation ---*/ - if (iMesh == MESH_0 || config->GetMGCycle() == FULLMG_CYCLE) { +if (iMesh == MESH_0 || config->GetMGCycle() == FULLMG_CYCLE) { /*--- Define some auxiliary vector related with the residual ---*/ @@ -108,41 +159,11 @@ CSpeciesSolver::CSpeciesSolver(CGeometry* geometry, CConfig* config, unsigned sh Solution_Inf[iVar] = config->GetSpecies_Init()[iVar]; } - /*--- Initialize the solution to the far-field state everywhere. ---*/ - - nodes = new CSpeciesVariable(Solution_Inf, nPoint, nDim, nVar, config); - SetBaseClassPointerToNodes(); - - /*--- Initialize the mass diffusivity. Nondimensionalization done in the flow solver. ---*/ - SU2_OMP_FOR_STAT(omp_chunk_size) - for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) { - for (auto iVar = 0u; iVar < nVar; iVar++) { - const auto MassDiffusivity = config->GetDiffusivity_ConstantND(); - nodes->SetDiffusivity(iPoint, MassDiffusivity, iVar); - } - } - END_SU2_OMP_FOR - - /*--- MPI solution ---*/ - - InitiateComms(geometry, config, SOLUTION); - CompleteComms(geometry, config, SOLUTION); - - SlidingState.resize(nMarker); - SlidingStateNodes.resize(nMarker); - - for (unsigned long iMarker = 0; iMarker < nMarker; iMarker++) { - if (config->GetMarker_All_KindBC(iMarker) == FLUID_INTERFACE) { - SlidingState[iMarker].resize(nVertex[iMarker], nPrimVar+1) = nullptr; - SlidingStateNodes[iMarker].resize(nVertex[iMarker],0); - } - } - /*--- Set the column number for species in inlet-files. * e.g. Coords(nDim), Temp(1), VelMag(1), Normal(nDim), Turb(1 or 2), Species(arbitrary) ---*/ Inlet_Position = nDim + 2 + nDim + config->GetnTurbVar(); - /*-- Allocation of inlet-values. Will be filled either by an inlet files, + /*-- Allocation of inlet-values. Will be filled either by an inlet file, * or uniformly by a uniform boundary condition. ---*/ Inlet_SpeciesVars.resize(nMarker); @@ -154,23 +175,9 @@ CSpeciesSolver::CSpeciesSolver(CGeometry* geometry, CConfig* config, unsigned sh } } } - - /*--- Store the initial CFL number for all grid points. ---*/ - - const su2double CFL = config->GetCFL(MGLevel) * config->GetCFLRedCoeff_Species(); - SU2_OMP_FOR_STAT(omp_chunk_size) - for (auto iPoint = 0u; iPoint < nPoint; iPoint++) { - nodes->SetLocalCFL(iPoint, CFL); - } - END_SU2_OMP_FOR - Min_CFL_Local = CFL; - Max_CFL_Local = CFL; - Avg_CFL_Local = CFL; - - /*--- Add the solver name (max 8 characters) ---*/ - SolverName = "SPECIES"; } + void CSpeciesSolver::LoadRestart(CGeometry** geometry, CSolver*** solver, CConfig* config, int val_iter, bool val_update_geo) { /*--- Restart the solution from file information ---*/ @@ -199,9 +206,12 @@ void CSpeciesSolver::LoadRestart(CGeometry** geometry, CSolver*** solver, CConfi const bool incompressible = (config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE); const bool energy = config->GetEnergy_Equation(); + const bool flamelet = (config->GetKind_FluidModel() == FLUID_FLAMELET); const bool weakly_coupled_heat = config->GetWeakly_Coupled_Heat(); - if (incompressible && ((!energy) && (!weakly_coupled_heat))) skipVars--; + /*--- for the flamelet model, the temperature is saved to file, but the energy equation is off ---*/ + + if (incompressible && ((!energy) && (!weakly_coupled_heat) && (!flamelet))) skipVars--; /*--- Load data from the restart into correct containers. ---*/ @@ -290,9 +300,12 @@ void CSpeciesSolver::Preprocessing(CGeometry* geometry, CSolver** solver_contain /*--- Set the laminar mass Diffusivity for the species solver. ---*/ SU2_OMP_FOR_STAT(omp_chunk_size) for (auto iPoint = 0u; iPoint < nPoint; iPoint++) { - for (auto iVar = 0u; iVar < nVar; iVar++) { - solver_container[FLOW_SOL]->GetFluidModel()->SetMassDiffusivityModel(config); - su2double mass_diffusivity = solver_container[FLOW_SOL]->GetFluidModel()->GetMassDiffusivity(iVar); + const su2double temperature = solver_container[FLOW_SOL]->GetNodes()->GetTemperature(iPoint); + const su2double* scalar = solver_container[SPECIES_SOL]->GetNodes()->GetSolution(iPoint); + solver_container[FLOW_SOL]->GetFluidModel()->SetMassDiffusivityModel(config); + solver_container[FLOW_SOL]->GetFluidModel()->SetTDState_T(temperature, scalar); + for (auto iVar = 0u; iVar <= nVar; iVar++) { + const su2double mass_diffusivity = solver_container[FLOW_SOL]->GetFluidModel()->GetMassDiffusivity(iVar); nodes->SetDiffusivity(iPoint, mass_diffusivity, iVar); } @@ -319,7 +332,6 @@ void CSpeciesSolver::Viscous_Residual(unsigned long iEdge, CGeometry* geometry, void CSpeciesSolver::BC_Inlet(CGeometry* geometry, CSolver** solver_container, CNumerics* conv_numerics, CNumerics* visc_numerics, CConfig* config, unsigned short val_marker) { - string Marker_Tag = config->GetMarker_All_TagBound(val_marker); const bool implicit = (config->GetKind_TimeIntScheme() == EULER_IMPLICIT); @@ -333,7 +345,10 @@ void CSpeciesSolver::BC_Inlet(CGeometry* geometry, CSolver** solver_container, C if (!geometry->nodes->GetDomain(iPoint)) continue; - if (config->GetSpecies_StrongBC()) { + /*--- Identify the boundary by string name ---*/ + string Marker_Tag = config->GetMarker_All_TagBound(val_marker); + + if (config->GetMarker_StrongBC(Marker_Tag)==true) { nodes->SetSolution_Old(iPoint, Inlet_SpeciesVars[val_marker][iVertex]); LinSysRes.SetBlock_Zero(iPoint); @@ -423,7 +438,7 @@ su2double CSpeciesSolver::GetInletAtVertex(su2double *val_inlet, if ((config->GetMarker_All_KindBC(iMarker) == INLET_FLOW) && (config->GetMarker_All_TagBound(iMarker) == val_marker)) { - for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++){ + for (iVertex = 0; iVertex < nVertex[iMarker]; iVertex++) { iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); @@ -478,14 +493,17 @@ void CSpeciesSolver::BC_Outlet(CGeometry* geometry, CSolver** solver_container, SU2_OMP_FOR_STAT(OMP_MIN_SIZE) for (auto iVertex = 0u; iVertex < geometry->nVertex[val_marker]; iVertex++) { - /* strong zero flux Neumann boundary condition at the outlet */ + /*--- Strong zero flux Neumann boundary condition at the outlet ---*/ const auto iPoint = geometry->vertex[val_marker][iVertex]->GetNode(); /*--- Check if the node belongs to the domain (i.e., not a halo node) ---*/ if (!geometry->nodes->GetDomain(iPoint)) continue; - if (config->GetSpecies_StrongBC()) { + /*--- Identify the boundary by string name ---*/ + string Marker_Tag = config->GetMarker_All_TagBound(val_marker); + + if (config->GetMarker_StrongBC(Marker_Tag)==true) { /*--- Allocate the value at the outlet ---*/ auto Point_Normal = geometry->vertex[val_marker][iVertex]->GetNormal_Neighbor(); @@ -565,7 +583,7 @@ void CSpeciesSolver::Source_Residual(CGeometry *geometry, CSolver **solver_conta numerics->SetScalarVar(nodes->GetSolution(iPoint), nullptr); - numerics->SetDiffusionCoeff(nodes->GetDiffusivity(iPoint), 0); + numerics->SetDiffusionCoeff(nodes->GetDiffusivity(iPoint), nullptr); /*--- Set volume of the dual cell. ---*/ diff --git a/SU2_CFD/src/solvers/CTemplateSolver.cpp b/SU2_CFD/src/solvers/CTemplateSolver.cpp index 133e441cd03..df1e6e2946a 100644 --- a/SU2_CFD/src/solvers/CTemplateSolver.cpp +++ b/SU2_CFD/src/solvers/CTemplateSolver.cpp @@ -2,7 +2,7 @@ * \file CTemplateSolver.cpp * \brief Subroutines to be implemented for any new solvers * \author F. Palacios - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -28,11 +28,11 @@ #include "../../include/solvers/CTemplateSolver.hpp" -CTemplateSolver::CTemplateSolver(void) : CSolver() { } +CTemplateSolver::CTemplateSolver() : CSolver() { } CTemplateSolver::CTemplateSolver(CGeometry *geometry, CConfig *config) : CSolver() { } -CTemplateSolver::~CTemplateSolver(void) { } +CTemplateSolver::~CTemplateSolver() = default; void CTemplateSolver::Preprocessing(CGeometry *geometry, CSolver **solver_container, CConfig *config, unsigned short iMesh, unsigned short iRKStep, unsigned short RunTime_EqSystem, bool Output) { } diff --git a/SU2_CFD/src/solvers/CTransLMSolver.cpp b/SU2_CFD/src/solvers/CTransLMSolver.cpp index 209f07c87c8..7d8fb2485a9 100644 --- a/SU2_CFD/src/solvers/CTransLMSolver.cpp +++ b/SU2_CFD/src/solvers/CTransLMSolver.cpp @@ -2,7 +2,7 @@ * \file CTransLMSolver.cpp * \brief Main subroutines for Langtry-Menter Transition model solver. * \author A. Aranake, S. Kang. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -167,7 +167,7 @@ CTransLMSolver::CTransLMSolver(CGeometry *geometry, CConfig *config, unsigned sh Max_CFL_Local = CFL; Avg_CFL_Local = CFL; - /*--- Add the solver name (max 8 characters) ---*/ + /*--- Add the solver name. ---*/ SolverName = "LM model"; } diff --git a/SU2_CFD/src/solvers/CTurbSASolver.cpp b/SU2_CFD/src/solvers/CTurbSASolver.cpp index adb7ac7c009..2d301dc7722 100644 --- a/SU2_CFD/src/solvers/CTurbSASolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSASolver.cpp @@ -2,7 +2,7 @@ * \file CTurbSASolver.cpp * \brief Main subroutines of CTurbSASolver class * \author F. Palacios, A. Bueno - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -166,7 +166,7 @@ CTurbSASolver::CTurbSASolver(CGeometry *geometry, CConfig *config, unsigned shor Max_CFL_Local = CFL; Avg_CFL_Local = CFL; - /*--- Add the solver name (max 8 characters) ---*/ + /*--- Add the solver name. ---*/ SolverName = "SA"; } @@ -235,7 +235,7 @@ void CTurbSASolver::Postprocessing(CGeometry *geometry, CSolver **solver_contain su2double muT = rho*fv1*nu_hat; - if (neg_spalart_allmaras) muT = max(muT,0.0); + if (neg_spalart_allmaras && nu_hat < 0) muT = 0.0; nodes->SetmuT(iPoint,muT); @@ -547,7 +547,32 @@ void CTurbSASolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container, CN su2double Inlet_Vars[MAXNVAR]; Inlet_Vars[0] = Inlet_TurbVars[val_marker][iVertex][0]; if (config->GetInlet_Profile_From_File()) { - Inlet_Vars[0] *= config->GetDensity_Ref() / config->GetViscosity_Ref(); + Inlet_Vars[0] *= config->GetDensity_Ref() / config->GetViscosity_Ref(); + } else { + /*--- Obtain fluid model for computing the nu tilde to impose at the inlet boundary. ---*/ + CFluidModel* FluidModel = solver_container[FLOW_SOL]->GetFluidModel(); + + /*--- Obtain density and laminar viscosity at inlet boundary node ---*/ + + su2double Density_Inlet; + if (config->GetKind_Regime() == ENUM_REGIME::COMPRESSIBLE) { + Density_Inlet = V_inlet[prim_idx.Density()]; + FluidModel->SetTDState_Prho(V_inlet[prim_idx.Pressure()], Density_Inlet); + } else { + const su2double* Scalar_Inlet = nullptr; + if (config->GetKind_Species_Model() != SPECIES_MODEL::NONE) { + Scalar_Inlet = config->GetInlet_SpeciesVal(config->GetMarker_All_TagBound(val_marker)); + } + FluidModel->SetTDState_T(V_inlet[prim_idx.Temperature()], Scalar_Inlet); + Density_Inlet = FluidModel->GetDensity(); + } + const su2double Laminar_Viscosity_Inlet = FluidModel->GetLaminarViscosity(); + const su2double* Turb_Properties = config->GetInlet_TurbVal(config->GetMarker_All_TagBound(val_marker)); + const su2double Nu_Factor = Turb_Properties[0]; + Inlet_Vars[0] = Nu_Factor * Laminar_Viscosity_Inlet / Density_Inlet; + if (config->GetSAParsedOptions().bc) { + Inlet_Vars[0] *= 0.005; + } } /*--- Load the inlet turbulence variable (uniform by default). ---*/ diff --git a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp index f9fdd16dffb..e1e9ef644c7 100644 --- a/SU2_CFD/src/solvers/CTurbSSTSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSSTSolver.cpp @@ -2,7 +2,7 @@ * \file CTurbSSTSolver.cpp * \brief Main subroutines of CTurbSSTSolver class * \author F. Palacios, A. Bueno - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -179,8 +179,8 @@ CTurbSSTSolver::CTurbSSTSolver(CGeometry *geometry, CConfig *config, unsigned sh Max_CFL_Local = CFL; Avg_CFL_Local = CFL; - /*--- Add the solver name (max 8 characters) ---*/ - SolverName = "K-W SST"; + /*--- Add the solver name. ---*/ + SolverName = "SST"; } diff --git a/SU2_CFD/src/solvers/CTurbSolver.cpp b/SU2_CFD/src/solvers/CTurbSolver.cpp index d68c550d185..3277cd443e0 100644 --- a/SU2_CFD/src/solvers/CTurbSolver.cpp +++ b/SU2_CFD/src/solvers/CTurbSolver.cpp @@ -2,7 +2,7 @@ * \file CTurbSolver.cpp * \brief Main subroutines of CTurbSolver class * \author F. Palacios, A. Bueno - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -129,8 +129,9 @@ void CTurbSolver::LoadRestart(CGeometry** geometry, CSolver*** solver, CConfig* const bool incompressible = (config->GetKind_Regime() == ENUM_REGIME::INCOMPRESSIBLE); const bool energy = config->GetEnergy_Equation(); const bool weakly_coupled_heat = config->GetWeakly_Coupled_Heat(); + const bool flamelet = (config->GetKind_FluidModel() == FLUID_FLAMELET); - if (incompressible && ((!energy) && (!weakly_coupled_heat))) skipVars--; + if (incompressible && ((!energy) && (!weakly_coupled_heat) && (!flamelet))) skipVars--; /*--- Load data from the restart into correct containers. ---*/ diff --git a/SU2_CFD/src/variables/CAdjEulerVariable.cpp b/SU2_CFD/src/variables/CAdjEulerVariable.cpp index b574543155b..48591ed0aa2 100644 --- a/SU2_CFD/src/variables/CAdjEulerVariable.cpp +++ b/SU2_CFD/src/variables/CAdjEulerVariable.cpp @@ -2,7 +2,7 @@ * \file CAdjEulerVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CAdjNSVariable.cpp b/SU2_CFD/src/variables/CAdjNSVariable.cpp index f15985ddc67..1753ae9eb4d 100644 --- a/SU2_CFD/src/variables/CAdjNSVariable.cpp +++ b/SU2_CFD/src/variables/CAdjNSVariable.cpp @@ -2,7 +2,7 @@ * \file CAdjNSVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CAdjTurbVariable.cpp b/SU2_CFD/src/variables/CAdjTurbVariable.cpp index 73a170b57c0..ff454b08c38 100644 --- a/SU2_CFD/src/variables/CAdjTurbVariable.cpp +++ b/SU2_CFD/src/variables/CAdjTurbVariable.cpp @@ -2,7 +2,7 @@ * \file CAdjTurbVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, A. Bueno - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CBaselineVariable.cpp b/SU2_CFD/src/variables/CBaselineVariable.cpp index 4787d900518..8c8745758b9 100644 --- a/SU2_CFD/src/variables/CBaselineVariable.cpp +++ b/SU2_CFD/src/variables/CBaselineVariable.cpp @@ -2,7 +2,7 @@ * \file CBaselineVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CDiscAdjFEABoundVariable.cpp b/SU2_CFD/src/variables/CDiscAdjFEABoundVariable.cpp index 2dbe42cc2fc..d3454b8df60 100644 --- a/SU2_CFD/src/variables/CDiscAdjFEABoundVariable.cpp +++ b/SU2_CFD/src/variables/CDiscAdjFEABoundVariable.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjFEAVariable.cpp * \brief Definition of the variables for FEM adjoint elastic structural problems. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CDiscAdjMeshBoundVariable.cpp b/SU2_CFD/src/variables/CDiscAdjMeshBoundVariable.cpp index 1fd7a9bdc7d..8c56d503579 100644 --- a/SU2_CFD/src/variables/CDiscAdjMeshBoundVariable.cpp +++ b/SU2_CFD/src/variables/CDiscAdjMeshBoundVariable.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjMeshVariable.cpp * \brief Main subroutines for the discrete adjoint mesh variable structure. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CDiscAdjVariable.cpp b/SU2_CFD/src/variables/CDiscAdjVariable.cpp index a08a0cf88e0..2a6aa681f3a 100644 --- a/SU2_CFD/src/variables/CDiscAdjVariable.cpp +++ b/SU2_CFD/src/variables/CDiscAdjVariable.cpp @@ -2,7 +2,7 @@ * \file CDiscAdjVariable.cpp * \brief Main subroutines for the discrete adjoint variable structure. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CEulerVariable.cpp b/SU2_CFD/src/variables/CEulerVariable.cpp index 4a666042c96..84cb00eb67c 100644 --- a/SU2_CFD/src/variables/CEulerVariable.cpp +++ b/SU2_CFD/src/variables/CEulerVariable.cpp @@ -2,7 +2,7 @@ * \file CEulerVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -70,7 +70,6 @@ CEulerVariable::CEulerVariable(su2double density, const su2double *velocity, su2 if (config->GetWind_Gust()) { WindGust.resize(nPoint,nDim); - WindGustDer.resize(nPoint,nDim+1); } if (config->GetVorticityConfinement()) { @@ -78,6 +77,13 @@ CEulerVariable::CEulerVariable(su2double density, const su2double *velocity, su2 Grad_AuxVar.resize(nPoint, nAuxVar, nDim, 0.0); AuxVar.resize(nPoint, nAuxVar) = su2double(0.0); } + + if (config->GetKind_FluidModel() == ENUM_FLUIDMODEL::DATADRIVEN_FLUID){ + DataDrivenFluid = true; + DatasetExtrapolation.resize(nPoint) = 0; + NIterNewtonsolver.resize(nPoint) = 0; + FluidEntropy.resize(nPoint) = su2double(0.0); + } } bool CEulerVariable::SetPrimVar(unsigned long iPoint, CFluidModel *FluidModel) { @@ -125,6 +131,12 @@ bool CEulerVariable::SetPrimVar(unsigned long iPoint, CFluidModel *FluidModel) { SetEnthalpy(iPoint); // Requires pressure computation. + /*--- Set look-up variables in case of data-driven fluid model ---*/ + if (DataDrivenFluid) { + SetDataExtrapolation(iPoint, FluidModel->GetExtrapolation()); + SetEntropy(iPoint, FluidModel->GetEntropy()); + } + return RightVol; } diff --git a/SU2_CFD/src/variables/CFEABoundVariable.cpp b/SU2_CFD/src/variables/CFEABoundVariable.cpp index d61f6b2e524..a1ab96467d3 100644 --- a/SU2_CFD/src/variables/CFEABoundVariable.cpp +++ b/SU2_CFD/src/variables/CFEABoundVariable.cpp @@ -2,7 +2,7 @@ * \file CFEABoundVariable.cpp * \brief Definition of the variables for FEM elastic structural problems. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -65,13 +65,12 @@ void CFEABoundVariable::Set_FlowTraction_n() { FlowTraction_n = FlowTraction; } void CFEABoundVariable::Set_SurfaceLoad_Res_n() { Residual_Ext_Surf_n = Residual_Ext_Surf; } -void CFEABoundVariable::Clear_FlowTraction() { FlowTraction.setConstant(0.0); } - void CFEABoundVariable::Clear_SurfaceLoad_Res() { Residual_Ext_Surf.setConstant(0.0); } -void CFEABoundVariable::RegisterFlowTraction() { +void CFEABoundVariable::RegisterFlowTraction(bool reset) { if (!fsi_analysis) return; for (unsigned long iVertex = 0; iVertex < FlowTraction.rows(); iVertex++) for (unsigned long iVar = 0; iVar < nVar; iVar++) - AD::RegisterInput(FlowTraction(iVertex,iVar)); + if (reset) AD::ResetInput(FlowTraction(iVertex,iVar)); + else AD::RegisterInput(FlowTraction(iVertex,iVar)); } diff --git a/SU2_CFD/src/variables/CFEAVariable.cpp b/SU2_CFD/src/variables/CFEAVariable.cpp index a49a9d49c66..8e3c32c36fc 100644 --- a/SU2_CFD/src/variables/CFEAVariable.cpp +++ b/SU2_CFD/src/variables/CFEAVariable.cpp @@ -2,7 +2,7 @@ * \file CFEAVariable.cpp * \brief Definition of the variables for FEM elastic structural problems. * \author R. Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CFlowVariable.cpp b/SU2_CFD/src/variables/CFlowVariable.cpp index 09bc5e0f889..050f3e862d1 100644 --- a/SU2_CFD/src/variables/CFlowVariable.cpp +++ b/SU2_CFD/src/variables/CFlowVariable.cpp @@ -1,7 +1,7 @@ /*! * \file CFlowVariable.cpp * \brief Definition of common solution fields for flow solvers. - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -50,7 +50,7 @@ CFlowVariable::CFlowVariable(unsigned long npoint, unsigned long ndim, unsigned Primitive.resize(nPoint, nPrimVar) = su2double(0.0); - if (config->GetMUSCL_Flow() || config->GetViscous()) { + if (config->GetMUSCL_Flow() || config->GetViscous() || config->GetContinuous_Adjoint()) { Gradient_Primitive.resize(nPoint, nPrimVarGrad, nDim, 0.0); } diff --git a/SU2_CFD/src/variables/CHeatVariable.cpp b/SU2_CFD/src/variables/CHeatVariable.cpp index f87420cea98..158aec9bcc6 100644 --- a/SU2_CFD/src/variables/CHeatVariable.cpp +++ b/SU2_CFD/src/variables/CHeatVariable.cpp @@ -2,7 +2,7 @@ * \file CHeatVariable.cpp * \brief Definition of the variables for heat equation problems. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CIncEulerVariable.cpp b/SU2_CFD/src/variables/CIncEulerVariable.cpp index c1bc702e54a..4fca7f5c357 100644 --- a/SU2_CFD/src/variables/CIncEulerVariable.cpp +++ b/SU2_CFD/src/variables/CIncEulerVariable.cpp @@ -2,7 +2,7 @@ * \file CIncEulerVariable.cpp * \brief Definition of the variable classes for incompressible flow. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CIncNSVariable.cpp b/SU2_CFD/src/variables/CIncNSVariable.cpp index c000575c218..e32b8d6dd73 100644 --- a/SU2_CFD/src/variables/CIncNSVariable.cpp +++ b/SU2_CFD/src/variables/CIncNSVariable.cpp @@ -2,7 +2,7 @@ * \file CIncNSVariable.cpp * \brief Definition of the variable classes for incompressible flow. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -58,8 +58,8 @@ bool CIncNSVariable::SetPrimVar(unsigned long iPoint, su2double eddy_visc, su2do /*--- Set the value of the temperature directly ---*/ - su2double Temperature = Solution(iPoint, nDim+1); - const auto check_temp = SetTemperature(iPoint,Temperature); + su2double Temperature = Solution(iPoint, indices.Temperature()); + auto check_temp = SetTemperature(iPoint, Temperature); /*--- Use the fluid model to compute the new value of density. Note that the thermodynamic pressure is constant and decoupled @@ -69,6 +69,12 @@ bool CIncNSVariable::SetPrimVar(unsigned long iPoint, su2double eddy_visc, su2do FluidModel->SetTDState_T(Temperature, scalar); + /*--- for FLAMELET: copy the LUT temperature into the solution ---*/ + Solution(iPoint,nDim+1) = FluidModel->GetTemperature(); + /*--- for FLAMELET: update the local temperature using LUT variables ---*/ + Temperature = Solution(iPoint,indices.Temperature()); + check_temp = SetTemperature(iPoint, Temperature); + /*--- Set the value of the density ---*/ const auto check_dens = SetDensity(iPoint, FluidModel->GetDensity()); @@ -84,7 +90,7 @@ bool CIncNSVariable::SetPrimVar(unsigned long iPoint, su2double eddy_visc, su2do /*--- Recompute the primitive variables ---*/ - Temperature = Solution(iPoint, nDim+1); + Temperature = Solution(iPoint, indices.Temperature()); SetTemperature(iPoint, Temperature); FluidModel->SetTDState_T(Temperature, scalar); SetDensity(iPoint, FluidModel->GetDensity()); diff --git a/SU2_CFD/src/variables/CMeshBoundVariable.cpp b/SU2_CFD/src/variables/CMeshBoundVariable.cpp index 6095b8c74d0..8a981ef16d1 100644 --- a/SU2_CFD/src/variables/CMeshBoundVariable.cpp +++ b/SU2_CFD/src/variables/CMeshBoundVariable.cpp @@ -2,7 +2,7 @@ * \file CMeshBoundVariable.cpp * \brief Definition of the boundary variables for mesh motion using a pseudo-elastic approach. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CMeshElement.cpp b/SU2_CFD/src/variables/CMeshElement.cpp index f0ddf7ab66b..78794d873fc 100644 --- a/SU2_CFD/src/variables/CMeshElement.cpp +++ b/SU2_CFD/src/variables/CMeshElement.cpp @@ -2,7 +2,7 @@ * \file CMeshElement.cpp * \brief Definition of the mesh elements for mesh deformation using a pseudo-elastic approach. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -28,7 +28,7 @@ #include "../../include/variables/CMeshElement.hpp" -CMeshElement::CMeshElement(void){ +CMeshElement::CMeshElement(){ Ref_Volume = 1.0; /*!< \brief Store the reference volume of the element. */ Curr_Volume = 1.0; /*!< \brief Store the current volume of the element. */ diff --git a/SU2_CFD/src/variables/CMeshVariable.cpp b/SU2_CFD/src/variables/CMeshVariable.cpp index aebd29bbf2e..c494d0447f7 100644 --- a/SU2_CFD/src/variables/CMeshVariable.cpp +++ b/SU2_CFD/src/variables/CMeshVariable.cpp @@ -2,7 +2,7 @@ * \file CMeshVariable.cpp * \brief Definition of the variables for mesh motion using a pseudo-elastic approach. * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CNEMOEulerVariable.cpp b/SU2_CFD/src/variables/CNEMOEulerVariable.cpp index 268219fec5a..2d8690c3ffb 100644 --- a/SU2_CFD/src/variables/CNEMOEulerVariable.cpp +++ b/SU2_CFD/src/variables/CNEMOEulerVariable.cpp @@ -2,7 +2,7 @@ * \file CNEMOEulerVariable.cpp * \brief Definition of the solution fields. * \author C. Garbacz, W. Maier, S.R. Copeland - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,7 +26,7 @@ */ #include "../../include/variables/CNEMOEulerVariable.hpp" -#include +#include CNEMOEulerVariable::CNEMOEulerVariable(su2double val_pressure, const su2double *val_massfrac, @@ -228,12 +228,12 @@ bool CNEMOEulerVariable::Cons2PrimVar(su2double *U, su2double *V, // Determine if the temperature lies within the acceptable range if (V[T_INDEX] <= Tmin) { nonPhys = true; return nonPhys;} - else if (V[T_INDEX] >= Tmax) { nonPhys = true; return nonPhys;} + if (V[T_INDEX] >= Tmax) { nonPhys = true; return nonPhys;} else if (V[T_INDEX] != V[T_INDEX]){ nonPhys = true; return nonPhys;} if (!monoatomic){ if (V[TVE_INDEX] <= Tvemin) { nonPhys = true; return nonPhys;} - else if (V[TVE_INDEX] >= Tvemax) { nonPhys = true; return nonPhys;} + if (V[TVE_INDEX] >= Tvemax) { nonPhys = true; return nonPhys;} else if (V[TVE_INDEX] != V[TVE_INDEX]){ nonPhys = true; return nonPhys;} } else {V[TVE_INDEX] = Tve_Freestream;} diff --git a/SU2_CFD/src/variables/CNEMONSVariable.cpp b/SU2_CFD/src/variables/CNEMONSVariable.cpp index d0f09b4bf65..360d996eb72 100644 --- a/SU2_CFD/src/variables/CNEMONSVariable.cpp +++ b/SU2_CFD/src/variables/CNEMONSVariable.cpp @@ -2,7 +2,7 @@ * \file CNEMONSVariable.cpp * \brief Definition of the solution fields. * \author C. Garbacz, W. Maier, S.R. Copeland - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,7 +26,7 @@ */ #include "../../include/variables/CNEMONSVariable.hpp" -#include +#include CNEMONSVariable::CNEMONSVariable(su2double val_pressure, const su2double *val_massfrac, diff --git a/SU2_CFD/src/variables/CNSVariable.cpp b/SU2_CFD/src/variables/CNSVariable.cpp index ec278b27ae1..b2fe70b35cc 100644 --- a/SU2_CFD/src/variables/CNSVariable.cpp +++ b/SU2_CFD/src/variables/CNSVariable.cpp @@ -2,7 +2,7 @@ * \file CNSVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -198,6 +198,12 @@ bool CNSVariable::SetPrimVar(unsigned long iPoint, su2double eddy_visc, su2doubl SetSpecificHeatCp(iPoint, FluidModel->GetCp()); + /*--- Set look-up variables in case of data-driven fluid model ---*/ + if (DataDrivenFluid) { + SetDataExtrapolation(iPoint, FluidModel->GetExtrapolation()); + SetEntropy(iPoint, FluidModel->GetEntropy()); + } + return RightVol; } diff --git a/SU2_CFD/src/variables/CRadP1Variable.cpp b/SU2_CFD/src/variables/CRadP1Variable.cpp index 7d8a3f7f43c..529fe578dec 100644 --- a/SU2_CFD/src/variables/CRadP1Variable.cpp +++ b/SU2_CFD/src/variables/CRadP1Variable.cpp @@ -2,7 +2,7 @@ * \file CRadP1Variable.cpp * \brief Definition of the P1 model variables * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CRadVariable.cpp b/SU2_CFD/src/variables/CRadVariable.cpp index b50a054c41f..97bcdf1e934 100644 --- a/SU2_CFD/src/variables/CRadVariable.cpp +++ b/SU2_CFD/src/variables/CRadVariable.cpp @@ -2,7 +2,7 @@ * \file CRadVariable.cpp * \brief Definition of the radiation variables * \author Ruben Sanchez - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CScalarVariable.cpp b/SU2_CFD/src/variables/CScalarVariable.cpp index e516cfa7c2e..fcb9a491eaa 100644 --- a/SU2_CFD/src/variables/CScalarVariable.cpp +++ b/SU2_CFD/src/variables/CScalarVariable.cpp @@ -2,7 +2,7 @@ * \file CScalarVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, A. Bueno - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CSobolevSmoothingVariable.cpp b/SU2_CFD/src/variables/CSobolevSmoothingVariable.cpp index 523c1dd78a8..d332aa71720 100644 --- a/SU2_CFD/src/variables/CSobolevSmoothingVariable.cpp +++ b/SU2_CFD/src/variables/CSobolevSmoothingVariable.cpp @@ -2,7 +2,7 @@ * \file CSobolevSmoothingVariable.cpp * \brief Definition of the variables for gradient smoothing problems. * \author T. Dick - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CSpeciesFlameletVariable.cpp b/SU2_CFD/src/variables/CSpeciesFlameletVariable.cpp new file mode 100644 index 00000000000..658d5c85722 --- /dev/null +++ b/SU2_CFD/src/variables/CSpeciesFlameletVariable.cpp @@ -0,0 +1,56 @@ +/*! + * \file CSpeciesFlameletVariable.cpp + * \brief Definition of the variable fields for the flamelet class. + * \author D. Mayer, T. Economon, N. Beishuizen + * \version 8.0.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/variables/CSpeciesFlameletVariable.hpp" + +CSpeciesFlameletVariable::CSpeciesFlameletVariable(const su2double* species_inf, unsigned long npoint, + unsigned long ndim, unsigned long nvar, const CConfig* config) + : CSpeciesVariable(species_inf, npoint, ndim, nvar, config) { + for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) + for (unsigned long iVar = 0; iVar < nVar; iVar++) Solution(iPoint, iVar) = species_inf[iVar]; + + Solution_Old = Solution; + + /*--- Allocate and initialize solution for the dual time strategy ---*/ + bool dual_time = ((config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || + (config->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)); + + if (dual_time) { + Solution_time_n = Solution; + Solution_time_n1 = Solution; + } + + /*--- Allocate residual structures ---*/ + + Res_TruncError.resize(nPoint, nVar) = su2double(0.0); + + /* Allocate space for the source and scalars for visualization */ + + source_scalar.resize(nPoint, config->GetNScalars()) = su2double(0.0); + lookup_scalar.resize(nPoint, config->GetNLookups()) = su2double(0.0); + table_misses.resize(nPoint) = 0; +} diff --git a/SU2_CFD/src/variables/CSpeciesVariable.cpp b/SU2_CFD/src/variables/CSpeciesVariable.cpp index 67e07ca2c88..ddf9f1dd726 100644 --- a/SU2_CFD/src/variables/CSpeciesVariable.cpp +++ b/SU2_CFD/src/variables/CSpeciesVariable.cpp @@ -2,7 +2,7 @@ * \file CSpeciesVariable.cpp * \brief Definition of the solution fields. * \author T. Kattmann - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -31,7 +31,7 @@ CSpeciesVariable::CSpeciesVariable(const su2double* species_inf, unsigned long n unsigned long nvar, const CConfig* config) : CScalarVariable(npoint, ndim, nvar, config) { /*--- Allocate space for the mass diffusivity. ---*/ - Diffusivity.resize(nPoint, nVar) = su2double(0.0); + Diffusivity.resize(nPoint, nVar + 1) = su2double(0.0); for (unsigned long iPoint = 0; iPoint < nPoint; iPoint++) for (unsigned long iVar = 0; iVar < nVar; iVar++) diff --git a/SU2_CFD/src/variables/CTransLMVariable.cpp b/SU2_CFD/src/variables/CTransLMVariable.cpp index 31610502131..c5a4a503fa6 100644 --- a/SU2_CFD/src/variables/CTransLMVariable.cpp +++ b/SU2_CFD/src/variables/CTransLMVariable.cpp @@ -2,7 +2,7 @@ * \file CTransLMVariable.cpp * \brief Definition of the solution fields. * \author A. Aranake, S. Kang - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CTurbSAVariable.cpp b/SU2_CFD/src/variables/CTurbSAVariable.cpp index c49c261b46d..454ce5734a8 100644 --- a/SU2_CFD/src/variables/CTurbSAVariable.cpp +++ b/SU2_CFD/src/variables/CTurbSAVariable.cpp @@ -2,7 +2,7 @@ * \file CTurbSAVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, A. Bueno - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CTurbSSTVariable.cpp b/SU2_CFD/src/variables/CTurbSSTVariable.cpp index 3a54562e438..9778f1e37cc 100644 --- a/SU2_CFD/src/variables/CTurbSSTVariable.cpp +++ b/SU2_CFD/src/variables/CTurbSSTVariable.cpp @@ -2,7 +2,7 @@ * \file CTurbSSTVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, A. Bueno - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CTurbVariable.cpp b/SU2_CFD/src/variables/CTurbVariable.cpp index 9a139f8490f..54bede5033f 100644 --- a/SU2_CFD/src/variables/CTurbVariable.cpp +++ b/SU2_CFD/src/variables/CTurbVariable.cpp @@ -2,7 +2,7 @@ * \file CTurbVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, A. Bueno - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_CFD/src/variables/CVariable.cpp b/SU2_CFD/src/variables/CVariable.cpp index 01d22d7e0af..601a25f62bc 100644 --- a/SU2_CFD/src/variables/CVariable.cpp +++ b/SU2_CFD/src/variables/CVariable.cpp @@ -2,7 +2,7 @@ * \file CVariable.cpp * \brief Definition of the solution fields. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * diff --git a/SU2_DEF/bin/.gitignore b/SU2_DEF/bin/.gitignore deleted file mode 100644 index fe891329eff..00000000000 --- a/SU2_DEF/bin/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Do not track compiled execuatables -SU2* diff --git a/SU2_DEF/include/SU2_DEF.hpp b/SU2_DEF/include/SU2_DEF.hpp deleted file mode 100644 index 395fcc804e5..00000000000 --- a/SU2_DEF/include/SU2_DEF.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/*! - * \file SU2_DEF.hpp - * \brief Headers of the main subroutines of the code SU2_DEF. - * The subroutines and functions are in the SU2_DEF.cpp file. - * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" - * - * SU2 Project Website: https://su2code.github.io - * - * The SU2 Project is maintained by the SU2 Foundation - * (http://su2foundation.org) - * - * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) - * - * SU2 is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * SU2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with SU2. If not, see . - */ - - -#pragma once - -#include "../../Common/include/parallelization/mpi_structure.hpp" -#include "../../Common/include/parallelization/omp_structure.hpp" - -#include -#include -#include -#include - -#include "../../SU2_CFD/include/solvers/CSolver.hpp" -#include "../../SU2_CFD/include/output/CMeshOutput.hpp" -#include "../../Common/include/geometry/CPhysicalGeometry.hpp" -#include "../../Common/include/CConfig.hpp" - -using namespace std; diff --git a/SU2_DEF/include/drivers/CDeformationDriver.hpp b/SU2_DEF/include/drivers/CDeformationDriver.hpp new file mode 100644 index 00000000000..ae731d601e7 --- /dev/null +++ b/SU2_DEF/include/drivers/CDeformationDriver.hpp @@ -0,0 +1,101 @@ +/*! + * \file CDeformationDriver.hpp + * \brief Headers of the main subroutines for driving the mesh deformation. + * \author A. Gastaldi, H. Patel + * \version 8.0.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "../../../Common/include/CConfig.hpp" +#include "../../../Common/include/geometry/CGeometry.hpp" +#include "../../../Common/include/grid_movement/CSurfaceMovement.hpp" +#include "../../../Common/include/grid_movement/CVolumetricMovement.hpp" +#include "../../../Common/include/parallelization/mpi_structure.hpp" +#include "../../../SU2_CFD/include/drivers/CDriverBase.hpp" +#include "../../../SU2_CFD/include/numerics/CNumerics.hpp" +#include "../../../SU2_CFD/include/output/COutput.hpp" + +class CDeformationDriver : public CDriverBase { + protected: + bool haveSurfaceDeformation = false; // flag used to determine whether surface deformation is available for output + + public: + /*! + * \brief Constructor of the class. + * \param[in] confFile - Configuration file name. + * \param[in] MPICommunicator - MPI communicator for SU2. + */ + CDeformationDriver(char* confFile, SU2_Comm MPICommunicator); + + /*! + * \brief Launch the driver computation. + */ + void Run() override; + + /*! + * \brief Deallocation routine. + */ + void Finalize() override; + + protected: + /*! + * \brief Read in the config and mesh files. + */ + void PreprocessInput(); + + /*! + * \brief Construction of the edge-based data structure. + */ + void InitializeGeometry(); + + /*! + * \brief Preprocess the output container. + */ + void PreprocessOutput(); + + /*! + * \brief Preprocess the mesh solver container. + */ + void InitializeSolver(); + + /*! + * \brief Preprocess the numerics container. + */ + void InitializeNumerics(); + + /*! + * \brief Output the mesh. + */ + void OutputFiles(); + + /*! + * \brief Mesh deformation based on linear elasticity solver (CMeshSolver). + */ + void DeformMesh(); + + /*! + * \brief Mesh deformation based on legacy implementation. + */ + void DeformLegacy(); +}; diff --git a/SU2_DEF/include/drivers/CDiscAdjDeformationDriver.hpp b/SU2_DEF/include/drivers/CDiscAdjDeformationDriver.hpp new file mode 100644 index 00000000000..2feddd82224 --- /dev/null +++ b/SU2_DEF/include/drivers/CDiscAdjDeformationDriver.hpp @@ -0,0 +1,131 @@ +/*! + * \file CDiscAdjDeformationDriver.cpp + * \brief Headers of the main subroutines for driving the projection of sensitivities. + * \author T. Economon, H. Kline, R. Sanchez, A. Gastaldi, H. Patel + * \version 8.0.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#pragma once + +#include "../../../Common/include/fem/fem_geometry_structure.hpp" +#include "../../../Common/include/parallelization/mpi_structure.hpp" +#include "../../../Common/include/parallelization/omp_structure.hpp" +#include "../../../SU2_CFD/include/drivers/CDriverBase.hpp" + +class CDiscAdjDeformationDriver : public CDriverBase { + protected: + su2double** Gradient; + + public: + /*! + * \brief Constructor of the class. + * \param[in] confFile - Configuration file name. + * \param[in] MPICommunicator - MPI communicator for SU2. + */ + CDiscAdjDeformationDriver(char* confFile, SU2_Comm MPICommunicator); + + /*! + * \brief Preprocess the driver data (includes solution allocation and initialization). + */ + void Preprocess(); + + /*! + * \brief Launch the driver computation. + */ + void Run() override; + + /*! + * \brief Deallocation routine. + */ + void Finalize() override; + + protected: + /*! + * \brief Read in the config and mesh files. + */ + void Input_Preprocessing(); + + /*! + * \brief Construction of the edge-based data structure. + */ + void Geometrical_Preprocessing(); + + /*! + * \brief Preprocess the output container. + */ + void Output_Preprocessing(); + + /*! + * \brief Projection of the surface sensitivity using finite differences (FD). + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] config - Definition of the particular problem. + * \param[in] surface_movement - Surface movement class of the problem. + * \param[in] Gradient_file - Output file to store the gradient data. + */ + void SetProjection_FD(CGeometry* geometry, CConfig* config, CSurfaceMovement* surface_movement, su2double** Gradient); + + /*! + * \brief Projection of the surface sensitivity using algorithmic differentiation (AD). + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] config - Definition of the particular problem. + * \param[in] surface_movement - Surface movement class of the problem. + * \param[in] Gradient_file - Output file to store the gradient data. + */ + void SetProjection_AD(CGeometry* geometry, CConfig* config, CSurfaceMovement* surface_movement, su2double** Gradient); + + /*! + * \brief Prints the gradient information to a file. + * \param[in] Gradient - The gradient data. + * \param[in] config - Definition of the particular problem. + * \param[in] Gradient_file - Output file to store the gradient data. + */ + void OutputGradient(su2double** Gradient, CConfig* config, ofstream& Gradient_file); + + /*! + * \brief Write the sensitivity (including mesh sensitivity) computed with the discrete adjoint method + * on the surface and in the volume to a file. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] config - Definition of the particular problem. + * \param[in] val_nZone - Number of Zones. + */ + void SetSensitivity_Files(CGeometry**** geometry, CConfig** config, unsigned short val_nZone); + + /*! + * \brief Treatment of derivatives with the Sobolev smoothing solver. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] config - Definition of the particular problem. + * \param[in] grid_movement - Volumetric movement class of the problem. + */ + void DerivativeTreatment_MeshSensitivity(CGeometry* geometry, CConfig* config, CVolumetricMovement* grid_movement); + + /*! + * \brief Treatment of derivatives with the Sobolev smoothing solver. + * \param[in] geometry - Geometrical definition of the problem. + * \param[in] config - Definition of the particular problem. + * \param[in] grid_movement - Volumetric movement class of the problem. + * \param[in] surface_movement - Surface movement class of the problem. + * \param[in] Gradient - Output array to store the gradient data. + */ + void DerivativeTreatment_Gradient(CGeometry* geometry, CConfig* config, CVolumetricMovement* grid_movement, + CSurfaceMovement* surface_movement, su2double** Gradient); +}; diff --git a/SU2_DEF/obj/Makefile.am b/SU2_DEF/obj/Makefile.am deleted file mode 100644 index 0704502da65..00000000000 --- a/SU2_DEF/obj/Makefile.am +++ /dev/null @@ -1,53 +0,0 @@ -################################################################################ -# -# \file Makefile.am -# \brief Makefile for SU2_DEF -# \author M. Colonno, T. Economon, F. Palacios -# \version 7.5.1 "Blackbird" -# -# SU2 Project Website: https://su2code.github.io -# -# The SU2 Project is maintained by the SU2 Foundation -# (http://su2foundation.org) -# -# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) -# -# SU2 is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# SU2 is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with SU2. If not, see . -# -################################################################################ - -AUTOMAKE_OPTIONS = subdir-objects -ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} - -bin_PROGRAMS = ../bin/SU2_DEF - -___bin_SU2_DEF_SOURCES = \ - ../include/SU2_DEF.hpp \ - ../src/SU2_DEF.cpp - - -___bin_SU2_DEF_CXXFLAGS = -___bin_SU2_DEF_LDADD = \ - ../../SU2_CFD/obj/libSU2Core.a \ - ../../Common/lib/libSU2.a - -# always link to built dependencies from ./externals -___bin_SU2_DEF_CXXFLAGS += @su2_externals_INCLUDES@ -___bin_SU2_DEF_LDADD += @su2_externals_LIBS@ -___bin_SU2_DEF_LDADD += @su2_externals_LIBPTHREAD@ - -# if BUILD_MUTATIONPP -___bin_SU2_DEF_CXXFLAGS += @MUTATIONPP_CXX@ -___bin_SU2_DEF_LDADD += @MUTATIONPP_LD@ -# endif diff --git a/SU2_DEF/src/SU2_DEF.cpp b/SU2_DEF/src/SU2_DEF.cpp index 77bee3b5fab..2597ec778c0 100644 --- a/SU2_DEF/src/SU2_DEF.cpp +++ b/SU2_DEF/src/SU2_DEF.cpp @@ -2,7 +2,7 @@ * \file SU2_DEF.cpp * \brief Main file of Mesh Deformation Code (SU2_DEF). * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -25,17 +25,10 @@ * License along with SU2. If not, see . */ +#include "../include/drivers/CDeformationDriver.hpp" -#include "../include/SU2_DEF.hpp" -using namespace std; - -int main(int argc, char *argv[]) { - - unsigned short iZone, nZone = SINGLE_ZONE; - su2double StartTime = 0.0, StopTime = 0.0, UsedTime = 0.0; +int main(int argc, char* argv[]) { char config_file_name[MAX_STRING_SIZE]; - int rank, size; - string str; /*--- MPI initialization ---*/ @@ -45,461 +38,32 @@ int main(int argc, char *argv[]) { #else SU2_MPI::Init(&argc, &argv); #endif - SU2_MPI::Comm MPICommunicator = SU2_MPI::GetComm(); - - rank = SU2_MPI::GetRank(); - size = SU2_MPI::GetSize(); - - /*--- Pointer to different structures that will be used throughout - the entire code ---*/ - - CConfig **config_container = nullptr; - CGeometry **geometry_container = nullptr; - CSurfaceMovement **surface_movement = nullptr; - CVolumetricMovement **grid_movement = nullptr; - COutput **output = nullptr; - CConfig *driver_config = nullptr; + SU2_MPI::Comm comm = SU2_MPI::GetComm(); /*--- Load in the number of zones and spatial dimensions in the mesh file - (if no config file is specified, default.cfg is used) ---*/ - - if (argc == 2) { strcpy(config_file_name, argv[1]); } - else { strcpy(config_file_name, "default.cfg"); } - - /*--- Read the name and format of the input mesh file to get from the mesh - file the number of zones and dimensions from the numerical grid (required - for variables allocation) ---*/ - - CConfig *config = nullptr; - config = new CConfig(config_file_name, SU2_COMPONENT::SU2_DEF); - - nZone = config->GetnZone(); - - /*--- Definition of the containers per zones ---*/ - - config_container = new CConfig*[nZone]; - geometry_container = new CGeometry*[nZone]; - surface_movement = new CSurfaceMovement*[nZone]; - grid_movement = new CVolumetricMovement*[nZone]; - output = new COutput*[nZone]; - - driver_config = nullptr; - - for (iZone = 0; iZone < nZone; iZone++) { - config_container[iZone] = nullptr; - geometry_container[iZone] = nullptr; - surface_movement[iZone] = nullptr; - grid_movement[iZone] = nullptr; - output[iZone] = nullptr; - } - - /*--- Initialize the configuration of the driver ---*/ - driver_config = new CConfig(config_file_name, SU2_COMPONENT::SU2_DEF, false); - - /*--- Initialize a char to store the zone filename ---*/ - char zone_file_name[MAX_STRING_SIZE]; - - /*--- Loop over all zones to initialize the various classes. In most - cases, nZone is equal to one. This represents the solution of a partial - differential equation on a single block, unstructured mesh. ---*/ - - for (iZone = 0; iZone < nZone; iZone++) { - - /*--- Definition of the configuration option class for all zones. In this - constructor, the input configuration file is parsed and all options are - read and stored. ---*/ - - if (driver_config->GetnConfigFiles() > 0){ - strcpy(zone_file_name, driver_config->GetConfigFilename(iZone).c_str()); - config_container[iZone] = new CConfig(driver_config, zone_file_name, SU2_COMPONENT::SU2_DEF, iZone, nZone, true); - } - else{ - config_container[iZone] = new CConfig(driver_config, config_file_name, SU2_COMPONENT::SU2_DEF, iZone, nZone, true); - } - config_container[iZone]->SetMPICommunicator(MPICommunicator); - } - - /*--- Set the multizone part of the problem. ---*/ - if (driver_config->GetMultizone_Problem()){ - for (iZone = 0; iZone < nZone; iZone++) { - /*--- Set the interface markers for multizone ---*/ - config_container[iZone]->SetMultizone(driver_config, config_container); - } - } - - for (iZone = 0; iZone < nZone; iZone++) { - - /*--- Definition of the geometry class to store the primal grid in the partitioning process. ---*/ - - CGeometry *geometry_aux = nullptr; - - /*--- All ranks process the grid and call ParMETIS for partitioning ---*/ - - geometry_aux = new CPhysicalGeometry(config_container[iZone], iZone, nZone); - - /*--- Color the initial grid and set the send-receive domains (ParMETIS) ---*/ - - geometry_aux->SetColorGrid_Parallel(config_container[iZone]); - - /*--- Build the grid data structures using the ParMETIS coloring. ---*/ - - geometry_container[iZone] = new CPhysicalGeometry(geometry_aux, config_container[iZone]); - - /*--- Deallocate the memory of geometry_aux ---*/ - - delete geometry_aux; - - /*--- Add the Send/Receive boundaries ---*/ - - geometry_container[iZone]->SetSendReceive(config_container[iZone]); - - /*--- Add the Send/Receive boundaries ---*/ - - geometry_container[iZone]->SetBoundaries(config_container[iZone]); - - } - - /*--- Set up a timer for performance benchmarking (preprocessing time is included) ---*/ - - StartTime = SU2_MPI::Wtime(); - - for (iZone = 0; iZone < nZone; iZone++) { - - /*--- Computational grid preprocesing ---*/ - - if (rank == MASTER_NODE) cout << endl << "----------------------- Preprocessing computations ----------------------" << endl; - - /*--- Compute elements surrounding points, points surrounding points ---*/ - - if (rank == MASTER_NODE) cout << "Setting local point connectivity." <SetPoint_Connectivity(); - - /*--- Check the orientation before computing geometrical quantities ---*/ - - geometry_container[iZone]->SetBoundVolume(); - if (config_container[iZone]->GetReorientElements()) { - if (rank == MASTER_NODE) cout << "Checking the numerical grid orientation of the interior elements." <Check_IntElem_Orientation(config_container[iZone]); - geometry_container[iZone]->Check_BoundElem_Orientation(config_container[iZone]); - } - - /*--- Create the edge structure ---*/ - - if (rank == MASTER_NODE) cout << "Identify edges and vertices." <SetEdges(); - geometry_container[iZone]->SetVertex(config_container[iZone]); - - if (config_container[iZone]->GetDesign_Variable(0) != NO_DEFORMATION) { - - /*--- Create the dual control volume structures ---*/ - - if (rank == MASTER_NODE) cout << "Setting the bound control volume structure." << endl; - geometry_container[iZone]->SetControlVolume(config_container[iZone], ALLOCATE); - geometry_container[iZone]->SetBoundControlVolume(config_container[iZone], ALLOCATE); - - } - /*--- Create the point-to-point MPI communication structures. ---*/ - - geometry_container[iZone]->PreprocessP2PComms(geometry_container[iZone], config_container[iZone]); - - /*--- Allocate the mesh output ---*/ - - output[iZone] = new CMeshOutput(config_container[iZone], geometry_container[iZone]->GetnDim()); - - /*--- Preprocess the volume output ---*/ - - output[iZone]->PreprocessVolumeOutput(config_container[iZone]); - - /*--- Preprocess history --- */ - - output[iZone]->PreprocessHistoryOutput(config_container[iZone], false); - - } - - - /*--- Surface grid deformation using design variables ---*/ - - for (iZone = 0; iZone < nZone; iZone++){ - - if (config_container[iZone]->GetDesign_Variable(0) != NO_DEFORMATION) { - - /*--- Definition of the Class for grid movement ---*/ - grid_movement[iZone] = new CVolumetricMovement(geometry_container[iZone], config_container[iZone]); - - /*--- Save original coordinates to be reused in convexity checking procedure ---*/ - auto OriginalCoordinates = geometry_container[iZone]->nodes->GetCoord(); - - /*--- First check for volumetric grid deformation/transformations ---*/ - - if (config_container[iZone]->GetDesign_Variable(0) == SCALE_GRID) { - - if (rank == MASTER_NODE) - cout << endl << "--------------------- Volumetric grid scaling (ZONE " << iZone <<") ------------------" << endl; - grid_movement[iZone]->SetVolume_Scaling(geometry_container[iZone], config_container[iZone], false); + (if no config file is specified, default.cfg is used). ---*/ - } else if (config_container[iZone]->GetDesign_Variable(0) == TRANSLATE_GRID) { - - if (rank == MASTER_NODE) - cout << endl << "------------------- Volumetric grid translation (ZONE " << iZone <<") ----------------" << endl; - grid_movement[iZone]->SetVolume_Translation(geometry_container[iZone], config_container[iZone], false); - - } else if (config_container[iZone]->GetDesign_Variable(0) == ROTATE_GRID) { - - if (rank == MASTER_NODE) - cout << endl << "--------------------- Volumetric grid rotation (ZONE " << iZone <<") -----------------" << endl; - grid_movement[iZone]->SetVolume_Rotation(geometry_container[iZone], config_container[iZone], false); - - } else { - - /*--- If no volume-type deformations are requested, then this is a - surface-based deformation or FFD set up. ---*/ - - if (rank == MASTER_NODE) - cout << endl << "--------------------- Surface grid deformation (ZONE " << iZone <<") -----------------" << endl; - - /*--- Definition and initialization of the surface deformation class ---*/ - - surface_movement[iZone] = new CSurfaceMovement(); - - /*--- Copy coordinates to the surface structure ---*/ - - surface_movement[iZone]->CopyBoundary(geometry_container[iZone], config_container[iZone]); - - /*--- Surface grid deformation ---*/ - - if (rank == MASTER_NODE) cout << "Performing the deformation of the surface grid." << endl; - auto TotalDeformation = surface_movement[iZone]->SetSurface_Deformation(geometry_container[iZone], config_container[iZone]); - - if (config_container[iZone]->GetDesign_Variable(0) != FFD_SETTING) { - - if (rank == MASTER_NODE) - cout << endl << "------------------- Volumetric grid deformation (ZONE " << iZone <<") ----------------" << endl; - - if (rank == MASTER_NODE) - cout << "Performing the deformation of the volumetric grid." << endl; - grid_movement[iZone]->SetVolume_Deformation(geometry_container[iZone], config_container[iZone], false); - - /*--- Get parameters for convexity check ---*/ - bool ConvexityCheck; - unsigned short ConvexityCheck_MaxIter, ConvexityCheck_MaxDepth; - - tie(ConvexityCheck, ConvexityCheck_MaxIter, ConvexityCheck_MaxDepth) = config_container[iZone]->GetConvexityCheck(); - - /*--- Recursively change deformations if there are nonconvex elements. ---*/ - - if (ConvexityCheck && geometry_container[iZone]->GetnNonconvexElements() > 0) { - if (rank == MASTER_NODE) { - cout << "Nonconvex elements present after deformation. " << endl; - cout << "Recursively lowering deformation magnitude." << endl; - } - - /*--- Load initial deformation values ---*/ - auto InitialDeformation = TotalDeformation; - - unsigned short ConvexityCheckIter, RecursionDepth = 0; - su2double DeformationFactor = 1.0, DeformationDifference = 1.0; - for (ConvexityCheckIter = 1; ConvexityCheckIter <= ConvexityCheck_MaxIter; ConvexityCheckIter++) { - - /*--- Recursively change deformation magnitude: - decrease if there are nonconvex elements, increase otherwise ---*/ - DeformationDifference /= 2.0; - - if (geometry_container[iZone]->GetnNonconvexElements() > 0) { - DeformationFactor -= DeformationDifference; - } else { - RecursionDepth += 1; - - if (RecursionDepth == ConvexityCheck_MaxDepth) { - if (rank == MASTER_NODE) { - cout << "Maximum recursion depth reached." << endl; - cout << "Remaining amount of original deformation: "; - cout << DeformationFactor*100.0 << " percent. " << endl; - } - break; - } - - DeformationFactor += DeformationDifference; - } - - /*--- Load mesh to start every iteration with an undeformed grid ---*/ - for (auto iPoint = 0ul; iPoint < OriginalCoordinates.rows(); iPoint++) { - for (auto iDim = 0ul; iDim < OriginalCoordinates.cols(); iDim++) { - geometry_container[iZone]->nodes->SetCoord(iPoint, iDim, OriginalCoordinates(iPoint,iDim)); - } - } - - /*--- Set deformation magnitude as percentage of initial deformation ---*/ - for (auto iDV = 0u; iDV < config->GetnDV(); iDV++) { - for (auto iDV_Value = 0u; iDV_Value < config->GetnDV_Value(iDV); iDV_Value++) { - config_container[iZone]->SetDV_Value(iDV, iDV_Value, InitialDeformation[iDV][iDV_Value]*DeformationFactor); - } - } - - /*--- Surface grid deformation ---*/ - if (rank == MASTER_NODE) cout << "Performing the deformation of the surface grid." << endl; - - TotalDeformation = surface_movement[iZone]->SetSurface_Deformation(geometry_container[iZone], config_container[iZone]); - - if (rank == MASTER_NODE) - cout << endl << "------------------- Volumetric grid deformation (ZONE " << iZone <<") ----------------" << endl; - - if (rank == MASTER_NODE) - cout << "Performing the deformation of the volumetric grid." << endl; - grid_movement[iZone]->SetVolume_Deformation(geometry_container[iZone], config_container[iZone], false); - - if (rank == MASTER_NODE) { - cout << "Number of nonconvex elements for iteration " << ConvexityCheckIter << ": "; - cout << geometry_container[iZone]->GetnNonconvexElements() << endl; - cout << "Remaining amount of original deformation: "; - cout << DeformationFactor*100.0 << " percent. " << endl; - } - - } - - } - - } - - } - - } - - } - - /*--- Computational grid preprocesing ---*/ - - if (rank == MASTER_NODE) cout << endl << "----------------------- Write deformed grid files -----------------------" << endl; - - /*--- Output deformed grid for visualization, if requested (surface and volumetric), in parallel - requires to move all the data to the master node---*/ - - for (iZone = 0; iZone < nZone; iZone++){ - - /*--- Compute Mesh Quality if requested. Necessary geometry preprocessing re-done beforehand. ---*/ - - if (config_container[iZone]->GetWrt_MeshQuality() && !config->GetStructuralProblem()) { - - if (rank == MASTER_NODE) cout << "Recompute geometry properties necessary to evaluate mesh quality statistics.\n"; - - geometry_container[iZone]->SetPoint_Connectivity(); - geometry_container[iZone]->SetBoundVolume(); - geometry_container[iZone]->SetEdges(); - geometry_container[iZone]->SetVertex(config_container[iZone]); - geometry_container[iZone]->SetControlVolume(config_container[iZone], ALLOCATE); - geometry_container[iZone]->SetBoundControlVolume(config_container[iZone], ALLOCATE); - - if (rank == MASTER_NODE) cout << "Computing mesh quality statistics for the dual control volumes.\n"; - geometry_container[iZone]->ComputeMeshQualityStatistics(config_container[iZone]); - }// Mesh Quality Output - - /*--- Load the data --- */ - - output[iZone]->Load_Data(geometry_container[iZone], config_container[iZone], nullptr); - - output[iZone]->WriteToFile(config_container[iZone], geometry_container[iZone], OUTPUT_TYPE::MESH, config->GetMesh_Out_FileName()); - - /*--- Set the file names for the visualization files ---*/ - - output[iZone]->SetVolume_Filename("volume_deformed"); - output[iZone]->SetSurface_Filename("surface_deformed"); - - for (unsigned short iFile = 0; iFile < config_container[iZone]->GetnVolumeOutputFiles(); iFile++){ - auto FileFormat = config_container[iZone]->GetVolumeOutputFiles(); - if (FileFormat[iFile] != OUTPUT_TYPE::RESTART_ASCII && FileFormat[iFile] != OUTPUT_TYPE::RESTART_BINARY) - output[iZone]->WriteToFile(config_container[iZone], geometry_container[iZone], FileFormat[iFile]); - } - } - - - if ((config_container[ZONE_0]->GetDesign_Variable(0) != NO_DEFORMATION) && - (config_container[ZONE_0]->GetDesign_Variable(0) != SCALE_GRID) && - (config_container[ZONE_0]->GetDesign_Variable(0) != TRANSLATE_GRID) && - (config_container[ZONE_0]->GetDesign_Variable(0) != ROTATE_GRID)) { - - /*--- Write the the free-form deformation boxes after deformation. ---*/ - - if (rank == MASTER_NODE) cout << "Adding any FFD information to the SU2 file." << endl; - - surface_movement[ZONE_0]->WriteFFDInfo(surface_movement, geometry_container, config_container); - - } - - delete config; - config = nullptr; - if (rank == MASTER_NODE) - cout << endl <<"------------------------- Solver Postprocessing -------------------------" << endl; - - if (geometry_container != nullptr) { - for (iZone = 0; iZone < nZone; iZone++) { - if (geometry_container[iZone] != nullptr) { - delete geometry_container[iZone]; - } - } - delete [] geometry_container; + if (argc == 2) { + strcpy(config_file_name, argv[1]); + } else { + strcpy(config_file_name, "default.cfg"); } - if (rank == MASTER_NODE) cout << "Deleted CGeometry container." << endl; - if (surface_movement != nullptr) { - for (iZone = 0; iZone < nZone; iZone++) { - if (surface_movement[iZone] != nullptr) { - delete surface_movement[iZone]; - } - } - delete [] surface_movement; - } - if (rank == MASTER_NODE) cout << "Deleted CSurfaceMovement class." << endl; + /*--- Initialize the mesh deformation driver. ---*/ - if (grid_movement != nullptr) { - for (iZone = 0; iZone < nZone; iZone++) { - if (grid_movement[iZone] != nullptr) { - delete grid_movement[iZone]; - } - } - delete [] grid_movement; - } - if (rank == MASTER_NODE) cout << "Deleted CVolumetricMovement class." << endl; + CDeformationDriver driver(config_file_name, comm); - if (config_container != nullptr) { - for (iZone = 0; iZone < nZone; iZone++) { - if (config_container[iZone] != nullptr) { - delete config_container[iZone]; - } - } - delete [] config_container; - } - if (output != nullptr) { - for (iZone = 0; iZone < nZone; iZone++) { - if (output[iZone] != nullptr) { - delete output[iZone]; - } - } - delete [] output; - } - if (rank == MASTER_NODE) cout << "Deleted CConfig container." << endl; + /*--- Launch the main external loop of the solver. ---*/ - if (rank == MASTER_NODE) cout << "Deleted COutput class." << endl; + driver.Run(); - /*--- Synchronization point after a single solver iteration. Compute the - wall clock time required. ---*/ + /*--- Postprocess all the containers, close history file, and exit SU2. ---*/ - StopTime = SU2_MPI::Wtime(); + driver.Finalize(); - /*--- Compute/print the total time for performance benchmarking. ---*/ + /*--- Finalize MPI parallelization. ---*/ - UsedTime = StopTime-StartTime; - if (rank == MASTER_NODE) { - cout << "\nCompleted in " << fixed << UsedTime << " seconds on "<< size; - if (size == 1) cout << " core." << endl; else cout << " cores." << endl; - } - - /*--- Exit the solver cleanly ---*/ - - if (rank == MASTER_NODE) - cout << endl << "------------------------- Exit Success (SU2_DEF) ------------------------" << endl << endl; - - /*--- Finalize MPI parallelization ---*/ SU2_MPI::Finalize(); return EXIT_SUCCESS; - } diff --git a/SU2_DEF/src/drivers/CDeformationDriver.cpp b/SU2_DEF/src/drivers/CDeformationDriver.cpp new file mode 100644 index 00000000000..4a147ff55ac --- /dev/null +++ b/SU2_DEF/src/drivers/CDeformationDriver.cpp @@ -0,0 +1,567 @@ +/*! + * \file CDeformationDriver.cpp + * \brief Main subroutines for driving the mesh deformation. + * \author A. Gastaldi, H. Patel + * \version 8.0.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser/ General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#include "../../include/drivers/CDeformationDriver.hpp" + +#include "../../../Common/include/geometry/CPhysicalGeometry.hpp" +#include "../../../SU2_CFD/include/numerics/elasticity/CFEALinearElasticity.hpp" +#include "../../../SU2_CFD/include/output/CMeshOutput.hpp" +#include "../../../SU2_CFD/include/solvers/CMeshSolver.hpp" + +using namespace std; + +CDeformationDriver::CDeformationDriver(char* confFile, SU2_Comm MPICommunicator) + : CDriverBase(confFile, 1, MPICommunicator) { + /*--- Preprocessing of the config files. ---*/ + + PreprocessInput(); + + /*--- Set up a timer for performance benchmarking. ---*/ + + StartTime = SU2_MPI::Wtime(); + + /*--- Preprocessing of the geometry for all zones. ---*/ + + InitializeGeometry(); + + /*--- Preprocessing of the output for all zones. ---*/ + + PreprocessOutput(); + + if (driver_config->GetDeform_Mesh()) { + /*--- Preprocessing of the mesh solver for all zones. ---*/ + + InitializeSolver(); + + /*--- Preprocessing of the mesh solver for all zones. ---*/ + + InitializeNumerics(); + } + + /*--- Preprocessing time is reported now, but not included in the next compute portion. ---*/ + + StopTime = SU2_MPI::Wtime(); + + /*--- Compute the total time for performance benchmarking. ---*/ + + UsedTime = StopTime - StartTime; + UsedTimePreproc = UsedTime; + UsedTimeCompute = 0.0; +} + +void CDeformationDriver::PreprocessInput() { + /*--- Initialize a char to store the zone filename. ---*/ + + char zone_file_name[MAX_STRING_SIZE]; + + /*--- Initialize the configuration of the driver. ---*/ + + driver_config = new CConfig(config_file_name, SU2_COMPONENT::SU2_DEF); + + nZone = driver_config->GetnZone(); + + /*--- Initialize containers. --- */ + + InitializeContainers(); + + /*--- Loop over all zones to initialize the various classes. In most + cases, nZone is equal to one. This represents the solution of a partial + differential equation on a single block, unstructured mesh. ---*/ + + for (iZone = 0; iZone < nZone; iZone++) { + /*--- Definition of the configuration option class for all zones. In this + constructor, the input configuration file is parsed and all options are + read and stored. ---*/ + + if (driver_config->GetnConfigFiles() > 0) { + strcpy(zone_file_name, driver_config->GetConfigFilename(iZone).c_str()); + config_container[iZone] = new CConfig(driver_config, zone_file_name, SU2_COMPONENT::SU2_DEF, iZone, nZone, true); + } else { + config_container[iZone] = + new CConfig(driver_config, config_file_name, SU2_COMPONENT::SU2_DEF, iZone, nZone, true); + } + + config_container[iZone]->SetMPICommunicator(SU2_MPI::GetComm()); + } + + /*--- Set the multi-zone part of the problem. ---*/ + + if (driver_config->GetMultizone_Problem()) { + for (iZone = 0; iZone < nZone; iZone++) { + /*--- Set the interface markers for multi-zone. ---*/ + + config_container[iZone]->SetMultizone(driver_config, config_container); + } + } + + /*--- Keep a reference to the main (ZONE 0) config. ---*/ + + main_config = config_container[ZONE_0]; +} + +void CDeformationDriver::InitializeGeometry() { + for (iZone = 0; iZone < nZone; iZone++) { + /*--- Definition of the geometry class to store the primal grid in the partitioning process. ---*/ + + CGeometry* geometry_aux = nullptr; + + /*--- All ranks process the grid and call ParMETIS for partitioning. ---*/ + + geometry_aux = new CPhysicalGeometry(config_container[iZone], iZone, nZone); + + /*--- Color the initial grid and set the send-receive domains (ParMETIS). ---*/ + + geometry_aux->SetColorGrid_Parallel(config_container[iZone]); + + /*--- Build the grid data structures using the ParMETIS coloring. ---*/ + + unsigned short nInst_Zone = nInst[iZone]; + unsigned short nMesh = 1; + + geometry_container[iZone] = new CGeometry**[nInst_Zone](); + geometry_container[iZone][INST_0] = new CGeometry*[nMesh](); + geometry_container[iZone][INST_0][MESH_0] = new CPhysicalGeometry(geometry_aux, config_container[iZone]); + + /*--- Deallocate the memory of geometry_aux. ---*/ + + delete geometry_aux; + + /*--- Add the Send/Receive boundaries. ---*/ + + geometry_container[iZone][INST_0][MESH_0]->SetSendReceive(config_container[iZone]); + + /*--- Add the Send/Receive boundaries. ---*/ + + geometry_container[iZone][INST_0][MESH_0]->SetBoundaries(config_container[iZone]); + + /*--- Computational grid preprocessing. ---*/ + + if (rank == MASTER_NODE) + cout << "\n----------------------- Preprocessing computations ----------------------" << endl; + + /*--- Compute elements surrounding points, points surrounding points. ---*/ + + if (rank == MASTER_NODE) cout << "Setting local point connectivity." << endl; + geometry_container[iZone][INST_0][MESH_0]->SetPoint_Connectivity(); + + /*--- Check the orientation before computing geometrical quantities. ---*/ + + geometry_container[iZone][INST_0][MESH_0]->SetBoundVolume(); + if (config_container[iZone]->GetReorientElements()) { + if (rank == MASTER_NODE) cout << "Checking the numerical grid orientation of the interior elements." << endl; + geometry_container[iZone][INST_0][MESH_0]->Check_IntElem_Orientation(config_container[iZone]); + geometry_container[iZone][INST_0][MESH_0]->Check_BoundElem_Orientation(config_container[iZone]); + } + + /*--- Create the edge structure. ---*/ + + if (rank == MASTER_NODE) cout << "Identify edges and vertices." << endl; + geometry_container[iZone][INST_0][MESH_0]->SetEdges(); + geometry_container[iZone][INST_0][MESH_0]->SetVertex(config_container[iZone]); + + if (config_container[iZone]->GetDesign_Variable(0) != NO_DEFORMATION) { + /*--- Create the dual control volume structures. ---*/ + + if (rank == MASTER_NODE) cout << "Setting the bound control volume structure." << endl; + geometry_container[iZone][INST_0][MESH_0]->SetControlVolume(config_container[iZone], ALLOCATE); + geometry_container[iZone][INST_0][MESH_0]->SetBoundControlVolume(config_container[iZone], ALLOCATE); + } + + /*--- Create the point-to-point MPI communication structures. ---*/ + + geometry_container[iZone][INST_0][MESH_0]->PreprocessP2PComms(geometry_container[iZone][INST_0][MESH_0], + config_container[iZone]); + } + + /*--- Get the number of dimensions. ---*/ + + nDim = geometry_container[ZONE_0][INST_0][MESH_0]->GetnDim(); + + /*--- Keep a reference to the main (ZONE_0, INST_0, MESH_0) geometry. ---*/ + + main_geometry = geometry_container[ZONE_0][INST_0][MESH_0]; +} + +void CDeformationDriver::PreprocessOutput() { + for (iZone = 0; iZone < nZone; iZone++) { + /*--- Allocate the mesh output. ---*/ + + output_container[iZone] = + new CMeshOutput(config_container[iZone], geometry_container[iZone][INST_0][MESH_0]->GetnDim()); + + /*--- Preprocess the volume output. ---*/ + + output_container[iZone]->PreprocessVolumeOutput(config_container[iZone]); + + /*--- Preprocess history. --- */ + + output_container[iZone]->PreprocessHistoryOutput(config_container[iZone], false); + } +} + +void CDeformationDriver::InitializeSolver() { + for (iZone = 0; iZone < nZone; iZone++) { + unsigned short nInst_Zone = nInst[iZone]; + unsigned short nMesh = 1; + unsigned short nSols = MAX_SOLS; + + solver_container[iZone] = new CSolver***[nInst_Zone](); + solver_container[iZone][INST_0] = new CSolver**[nMesh](); + solver_container[iZone][INST_0][MESH_0] = new CSolver*[nSols](); + solver_container[iZone][INST_0][MESH_0][MESH_SOL] = + new CMeshSolver(geometry_container[iZone][INST_0][MESH_0], config_container[iZone]); + } +} + +void CDeformationDriver::InitializeNumerics() { + for (iZone = 0; iZone < nZone; iZone++) { + unsigned short nInst_Zone = nInst[iZone]; + unsigned short nMesh = 1; + unsigned short nSols = MAX_SOLS; + unsigned int nTerm = omp_get_num_threads() * MAX_TERMS; + + numerics_container[iZone] = new CNumerics****[nInst_Zone](); + numerics_container[iZone][INST_0] = new CNumerics***[nMesh](); + numerics_container[iZone][INST_0][MESH_0] = new CNumerics**[nSols](); + numerics_container[iZone][INST_0][MESH_0][MESH_SOL] = new CNumerics*[nTerm](); + + for (int thread = 0; thread < omp_get_max_threads(); ++thread) { + const int iTerm = FEA_TERM + thread * MAX_TERMS; + const int nDim = geometry_container[iZone][INST_0][MESH_0]->GetnDim(); + + numerics_container[iZone][INST_0][MESH_0][MESH_SOL][iTerm] = new CFEAMeshElasticity( + nDim, nDim, geometry_container[iZone][INST_0][MESH_0]->GetnElem(), config_container[iZone]); + } + } +} + +void CDeformationDriver::Run() { + /* --- Start measuring computation time. ---*/ + + StartTime = SU2_MPI::Wtime(); + + /*--- Surface grid deformation using design variables. ---*/ + + DeformMesh(); + + /*--- Synchronization point after a single solver iteration. Compute the wall clock time required. ---*/ + + StopTime = SU2_MPI::Wtime(); + + UsedTimeCompute = StopTime - StartTime; + if (rank == MASTER_NODE) { + cout << "\nCompleted in " << fixed << UsedTimeCompute << " seconds on " << size; + + if (size == 1) + cout << " core." << endl; + else + cout << " cores." << endl; + } + + /*--- Output the deformed mesh. ---*/ + + OutputFiles(); +} + +void CDeformationDriver::DeformMesh() { + if (!driver_config->GetDeform_Mesh()) return DeformLegacy(); + + for (iZone = 0; iZone < nZone; iZone++) { + /*--- Set the stiffness of each element mesh into the mesh numerics. ---*/ + + solver_container[iZone][INST_0][MESH_0][MESH_SOL]->SetMesh_Stiffness( + numerics_container[iZone][INST_0][MESH_0][MESH_SOL], config_container[iZone]); + + /*--- Deform the volume grid around the new boundary locations. ---*/ + /*--- Force the number of levels to be 0 because in this driver we do not build MG levels. ---*/ + const auto nMGLevels = config_container[iZone]->GetnMGLevels(); + config_container[iZone]->SetMGLevels(0); + solver_container[iZone][INST_0][MESH_0][MESH_SOL]->DeformMesh(geometry_container[iZone][INST_0], + numerics_container[iZone][INST_0][MESH_0][MESH_SOL], + config_container[iZone]); + config_container[iZone]->SetMGLevels(nMGLevels); + } +} + +void CDeformationDriver::DeformLegacy() { + for (iZone = 0; iZone < nZone; iZone++) { + if (config_container[iZone]->GetDesign_Variable(0) != NO_DEFORMATION) { + unsigned short nInst_Zone = nInst[iZone]; + + /*--- Definition of the Class for grid movement. ---*/ + + grid_movement[iZone] = new CVolumetricMovement*[nInst_Zone](); + grid_movement[iZone][INST_0] = + new CVolumetricMovement(geometry_container[iZone][INST_0][MESH_0], config_container[iZone]); + + /*--- Save original coordinates to be reused in convexity checking procedure. ---*/ + + auto OriginalCoordinates = geometry_container[iZone][INST_0][MESH_0]->nodes->GetCoord(); + + /*--- First check for volumetric grid deformation/transformations. ---*/ + + if (config_container[iZone]->GetDesign_Variable(0) == SCALE_GRID) { + if (rank == MASTER_NODE) + cout << endl + << "--------------------- Volumetric grid scaling (ZONE " << iZone << ") ------------------" << endl; + grid_movement[iZone][INST_0]->SetVolume_Scaling(geometry_container[iZone][INST_0][MESH_0], + config_container[iZone], false); + + } else if (config_container[iZone]->GetDesign_Variable(0) == TRANSLATE_GRID) { + if (rank == MASTER_NODE) + cout << endl + << "------------------- Volumetric grid translation (ZONE " << iZone << ") ----------------" << endl; + grid_movement[iZone][INST_0]->SetVolume_Translation(geometry_container[iZone][INST_0][MESH_0], + config_container[iZone], false); + + } else if (config_container[iZone]->GetDesign_Variable(0) == ROTATE_GRID) { + if (rank == MASTER_NODE) + cout << endl + << "--------------------- Volumetric grid rotation (ZONE " << iZone << ") -----------------" << endl; + grid_movement[iZone][INST_0]->SetVolume_Rotation(geometry_container[iZone][INST_0][MESH_0], + config_container[iZone], false); + + } else { + /*--- If no volume-type deformations are requested, then this is a + * surface-based deformation or FFD set up. ---*/ + + if (rank == MASTER_NODE) + cout << endl + << "--------------------- Surface grid deformation (ZONE " << iZone << ") -----------------" << endl; + + /*--- Definition and initialization of the surface deformation class. ---*/ + + surface_movement[iZone] = new CSurfaceMovement(); + haveSurfaceDeformation = true; + + /*--- Copy coordinates to the surface structure. ---*/ + + surface_movement[iZone]->CopyBoundary(geometry_container[iZone][INST_0][MESH_0], config_container[iZone]); + + /*--- Surface grid deformation. ---*/ + + if (rank == MASTER_NODE) cout << "Performing the deformation of the surface grid." << endl; + auto TotalDeformation = surface_movement[iZone]->SetSurface_Deformation( + geometry_container[iZone][INST_0][MESH_0], config_container[iZone]); + + if (config_container[iZone]->GetDesign_Variable(0) != FFD_SETTING) { + if (rank == MASTER_NODE) + cout << endl + << "------------------- Volumetric grid deformation (ZONE " << iZone << ") ----------------" << endl; + + if (rank == MASTER_NODE) cout << "Performing the deformation of the volumetric grid." << endl; + grid_movement[iZone][INST_0]->SetVolume_Deformation(geometry_container[iZone][INST_0][MESH_0], + config_container[iZone], false); + + /*--- Get parameters for convexity check. ---*/ + bool ConvexityCheck; + unsigned short ConvexityCheck_MaxIter, ConvexityCheck_MaxDepth; + + tie(ConvexityCheck, ConvexityCheck_MaxIter, ConvexityCheck_MaxDepth) = + config_container[iZone]->GetConvexityCheck(); + + /*--- Recursively change deformations if there are non-convex elements. ---*/ + + if (ConvexityCheck && geometry_container[iZone][INST_0][MESH_0]->GetnNonconvexElements() > 0) { + if (rank == MASTER_NODE) { + cout << "Non-convex elements present after deformation." << endl; + cout << "Recursively lowering deformation magnitude." << endl; + } + + /*--- Load initial deformation values. ---*/ + + auto InitialDeformation = TotalDeformation; + + unsigned short ConvexityCheckIter, RecursionDepth = 0; + su2double DeformationFactor = 1.0, DeformationDifference = 1.0; + for (ConvexityCheckIter = 1; ConvexityCheckIter <= ConvexityCheck_MaxIter; ConvexityCheckIter++) { + /*--- Recursively change deformation magnitude (decrease for non-convex elements, increase otherwise). + * ---*/ + + DeformationDifference /= 2.0; + + if (geometry_container[iZone][INST_0][MESH_0]->GetnNonconvexElements() > 0) { + DeformationFactor -= DeformationDifference; + } else { + RecursionDepth += 1; + + if (RecursionDepth == ConvexityCheck_MaxDepth) { + if (rank == MASTER_NODE) { + cout << "Maximum recursion depth reached." << endl; + cout << "Remaining amount of original deformation: "; + cout << DeformationFactor * 100.0 << " percent. " << endl; + } + break; + } + + DeformationFactor += DeformationDifference; + } + + /*--- Load mesh to start every iteration with an undeformed grid. ---*/ + + for (auto iPoint = 0ul; iPoint < OriginalCoordinates.rows(); iPoint++) { + for (auto iDim = 0ul; iDim < OriginalCoordinates.cols(); iDim++) { + geometry_container[iZone][INST_0][MESH_0]->nodes->SetCoord(iPoint, iDim, + OriginalCoordinates(iPoint, iDim)); + } + } + + /*--- Set deformation magnitude as percentage of initial deformation. ---*/ + + for (auto iDV = 0u; iDV < driver_config->GetnDV(); iDV++) { + for (auto iDV_Value = 0u; iDV_Value < driver_config->GetnDV_Value(iDV); iDV_Value++) { + config_container[iZone]->SetDV_Value(iDV, iDV_Value, + InitialDeformation[iDV][iDV_Value] * DeformationFactor); + } + } + + /*--- Surface grid deformation. ---*/ + + if (rank == MASTER_NODE) cout << "Performing the deformation of the surface grid." << endl; + + TotalDeformation = surface_movement[iZone]->SetSurface_Deformation( + geometry_container[iZone][INST_0][MESH_0], config_container[iZone]); + + if (rank == MASTER_NODE) + cout << endl + << "------------------- Volumetric grid deformation (ZONE " << iZone << ") ----------------" + << endl; + + if (rank == MASTER_NODE) cout << "Performing the deformation of the volumetric grid." << endl; + grid_movement[iZone][INST_0]->SetVolume_Deformation(geometry_container[iZone][INST_0][MESH_0], + config_container[iZone], false); + + if (rank == MASTER_NODE) { + cout << "Number of non-convex elements for iteration " << ConvexityCheckIter << ": "; + cout << geometry_container[iZone][INST_0][MESH_0]->GetnNonconvexElements() << endl; + cout << "Remaining amount of original deformation: "; + cout << DeformationFactor * 100.0 << " percent. " << endl; + } + } + } + } + } + } + } +} + +void CDeformationDriver::OutputFiles() { + /*--- Output deformed grid for visualization, if requested (surface and volumetric), in parallel + requires to move all the data to the master node. ---*/ + + if (rank == MASTER_NODE) + cout << endl << "----------------------- Write deformed grid files -----------------------" << endl; + + for (iZone = 0; iZone < nZone; iZone++) { + /*--- Compute Mesh Quality if requested. Necessary geometry preprocessing re-done beforehand. ---*/ + + if (config_container[iZone]->GetWrt_MeshQuality() && !driver_config->GetStructuralProblem()) { + if (rank == MASTER_NODE) cout << "Recompute geometry properties necessary to evaluate mesh quality statistics.\n"; + + geometry_container[iZone][INST_0][MESH_0]->SetPoint_Connectivity(); + geometry_container[iZone][INST_0][MESH_0]->SetBoundVolume(); + geometry_container[iZone][INST_0][MESH_0]->SetEdges(); + geometry_container[iZone][INST_0][MESH_0]->SetVertex(config_container[iZone]); + geometry_container[iZone][INST_0][MESH_0]->SetControlVolume(config_container[iZone], ALLOCATE); + geometry_container[iZone][INST_0][MESH_0]->SetBoundControlVolume(config_container[iZone], ALLOCATE); + + if (rank == MASTER_NODE) cout << "Computing mesh quality statistics for the dual control volumes.\n"; + geometry_container[iZone][INST_0][MESH_0]->ComputeMeshQualityStatistics(config_container[iZone]); + } + + /*--- Load the data. --- */ + + output_container[iZone]->LoadData(geometry_container[iZone][INST_0][MESH_0], config_container[iZone], nullptr); + + output_container[iZone]->WriteToFile(config_container[iZone], geometry_container[iZone][INST_0][MESH_0], + OUTPUT_TYPE::MESH, driver_config->GetMesh_Out_FileName()); + + /*--- Set the file names for the visualization files. ---*/ + + output_container[iZone]->SetVolumeFilename("volume_deformed"); + output_container[iZone]->SetSurfaceFilename("surface_deformed"); + + for (unsigned short iFile = 0; iFile < config_container[iZone]->GetnVolumeOutputFiles(); iFile++) { + auto FileFormat = config_container[iZone]->GetVolumeOutputFiles(); + if (FileFormat[iFile] != OUTPUT_TYPE::RESTART_ASCII && FileFormat[iFile] != OUTPUT_TYPE::RESTART_BINARY && + FileFormat[iFile] != OUTPUT_TYPE::CSV) + output_container[iZone]->WriteToFile(config_container[iZone], geometry_container[iZone][INST_0][MESH_0], + FileFormat[iFile]); + } + } + + if (!driver_config->GetDeform_Mesh()) { + if ((config_container[ZONE_0]->GetDesign_Variable(0) != NO_DEFORMATION) && + (config_container[ZONE_0]->GetDesign_Variable(0) != SCALE_GRID) && + (config_container[ZONE_0]->GetDesign_Variable(0) != TRANSLATE_GRID) && + (config_container[ZONE_0]->GetDesign_Variable(0) != ROTATE_GRID)) { + /*--- Write the free form deformation boxes after deformation if defined. ---*/ + if (!haveSurfaceDeformation) { + if (rank == MASTER_NODE) cout << "No FFD information available." << endl; + } else { + if (rank == MASTER_NODE) cout << "Adding any FFD information to the SU2 file." << endl; + + surface_movement[ZONE_0]->WriteFFDInfo(surface_movement, geometry_container, config_container); + } + } + } +} + +void CDeformationDriver::Finalize() { + if (rank == MASTER_NODE) cout << "\n------------------------- Finalize Solver -------------------------" << endl; + + if (driver_config->GetDeform_Mesh()) { + for (iZone = 0; iZone < nZone; iZone++) { + if (numerics_container[iZone] != nullptr) { + for (int thread = 0; thread < omp_get_max_threads(); thread++) { + const int iTerm = FEA_TERM + thread * MAX_TERMS; + delete numerics_container[iZone][INST_0][MESH_0][MESH_SOL][iTerm]; + } + delete[] numerics_container[iZone][INST_0][MESH_0][MESH_SOL]; + delete[] numerics_container[iZone][INST_0][MESH_0]; + delete[] numerics_container[iZone][INST_0]; + } + /*--- The remaining levels in the container are deleted in CommonFinalize ---*/ + } + + for (iZone = 0; iZone < nZone; iZone++) { + if (solver_container[iZone] != nullptr) { + delete solver_container[iZone][INST_0][MESH_0][MESH_SOL]; + delete[] solver_container[iZone][INST_0][MESH_0]; + delete[] solver_container[iZone][INST_0]; + } + /*--- The remaining levels in the container are deleted in CommonFinalize ---*/ + } + } + + CommonFinalize(); + + /*--- Exit the solver cleanly. ---*/ + + if (rank == MASTER_NODE) + cout << "\n------------------------- Exit Success (SU2_DEF) ------------------------" << endl << endl; +} diff --git a/SU2_DEF/src/drivers/CDiscAdjDeformationDriver.cpp b/SU2_DEF/src/drivers/CDiscAdjDeformationDriver.cpp new file mode 100644 index 00000000000..99c3546389b --- /dev/null +++ b/SU2_DEF/src/drivers/CDiscAdjDeformationDriver.cpp @@ -0,0 +1,999 @@ +/*! + * \file CDiscAdjDeformationDriver.cpp + * \brief Main subroutines for driving the projection of sensitivities. + * \author T. Economon, H. Kline, R. Sanchez, A. Gastaldi, H. Patel + * \version 8.0.0 "Harrier" + * + * SU2 Project Website: https://su2code.github.io + * + * The SU2 Project is maintained by the SU2 Foundation + * (http://su2foundation.org) + * + * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) + * + * SU2 is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * SU2 is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with SU2. If not, see . + */ + +#define ENABLE_MAPS +#include "../../../Common/include/CConfig.hpp" +#undef ENABLE_MAPS + +#include "../../../Common/include/geometry/CPhysicalGeometry.hpp" +#include "../../../Common/include/grid_movement/CSurfaceMovement.hpp" +#include "../../../Common/include/grid_movement/CVolumetricMovement.hpp" +#include "../../../SU2_CFD/include/numerics/CGradSmoothing.hpp" +#include "../../../SU2_CFD/include/output/CBaselineOutput.hpp" +#include "../../../SU2_CFD/include/solvers/CBaselineSolver.hpp" +#include "../../../SU2_CFD/include/solvers/CGradientSmoothingSolver.hpp" +#include "../../include/drivers/CDiscAdjDeformationDriver.hpp" + +using namespace std; + +CDiscAdjDeformationDriver::CDiscAdjDeformationDriver(char* confFile, SU2_Comm MPICommunicator) + : CDriverBase(confFile, 1, MPICommunicator) { + /*--- Preprocessing of the config files. ---*/ + + Input_Preprocessing(); + + /*--- Initialize structure to store the gradient. ---*/ + + unsigned short nDV = config_container[ZONE_0]->GetnDV(); + Gradient = new su2double*[nDV]; + + for (auto iDV = 0u; iDV < nDV; iDV++) { + /*--- Initialize to zero ---*/ + unsigned short nValue = config_container[ZONE_0]->GetnDV_Value(iDV); + + Gradient[iDV] = new su2double[nValue]; + } + + /*--- Set up a timer for performance benchmarking. ---*/ + + StartTime = SU2_MPI::Wtime(); + + /*--- Preprocessing of the geometry for all zones. ---*/ + + Geometrical_Preprocessing(); + + /*--- Preprocessing of the outputs for all zones. ---*/ + + Output_Preprocessing(); + + /*--- Preprocessing time is reported now, but not included in the next compute portion. ---*/ + + StopTime = SU2_MPI::Wtime(); + + /*--- Compute the total time for performance benchmarking. ---*/ + + UsedTime = StopTime - StartTime; + UsedTimePreproc = UsedTime; + UsedTimeCompute = 0.0; +} + +void CDiscAdjDeformationDriver::Input_Preprocessing() { + /*--- Initialize a char to store the zone filename. ---*/ + + char zone_file_name[MAX_STRING_SIZE]; + + /*--- Initialize the configuration of the driver. ---*/ + + driver_config = new CConfig(config_file_name, SU2_COMPONENT::SU2_DEF); + + nZone = driver_config->GetnZone(); + + /*--- Initialize containers. --- */ + + InitializeContainers(); + + /*--- Loop over all zones to initialize the various classes. In most + * cases, nZone is equal to one. This represents the solution of a partial + * differential equation on a single block, unstructured mesh. ---*/ + + for (iZone = 0; iZone < nZone; iZone++) { + /*--- Definition of the configuration option class for all zones. In this + * constructor, the input configuration file is parsed and all options are + * read and stored. ---*/ + + if (driver_config->GetnConfigFiles() > 0) { + strcpy(zone_file_name, driver_config->GetConfigFilename(iZone).c_str()); + config_container[iZone] = new CConfig(driver_config, zone_file_name, SU2_COMPONENT::SU2_DOT, iZone, nZone, true); + } else { + config_container[iZone] = + new CConfig(driver_config, config_file_name, SU2_COMPONENT::SU2_DOT, iZone, nZone, true); + } + + config_container[iZone]->SetMPICommunicator(SU2_MPI::GetComm()); + + if (!config_container[iZone]->GetDiscrete_Adjoint() && !config_container[iZone]->GetContinuous_Adjoint()) { + SU2_MPI::Error("An adjoint solver (discrete or continuous) was not specified in the configuration file.", + CURRENT_FUNCTION); + } + } + + /*--- Set the multi-zone part of the problem. ---*/ + + if (driver_config->GetMultizone_Problem()) { + for (iZone = 0; iZone < nZone; iZone++) { + /*--- Set the interface markers for multi-zone. ---*/ + + config_container[iZone]->SetMultizone(driver_config, config_container); + } + } + + /*--- Keep a reference to the main (ZONE 0) config. ---*/ + + main_config = config_container[ZONE_0]; +} + +void CDiscAdjDeformationDriver::Geometrical_Preprocessing() { + /*--- Loop over all zones to initialize the various classes. In most + * cases, nZone is equal to one. This represents the solution of a partial + * differential equation on a single block, unstructured mesh. ---*/ + + unsigned short nMesh = 1; + + for (iZone = 0; iZone < nZone; iZone++) { + /*--- Determine if the FEM solver is used, which decides the type of geometry classes that are instantiated. ---*/ + + const bool fem_solver = config_container[iZone]->GetFEMSolver(); + + /*--- Read the number of instances for each zone. ---*/ + + nInst[iZone] = config_container[iZone]->GetnTimeInstances(); + + geometry_container[iZone] = new CGeometry**[nInst[iZone]]; + + for (iInst = 0; iInst < nInst[iZone]; iInst++) { + /*--- Definition of the geometry class to store the primal grid in the partitioning process. ---*/ + + CGeometry* geometry_aux = nullptr; + + /*--- All ranks process the grid and call ParMETIS for partitioning. ---*/ + + geometry_aux = new CPhysicalGeometry(config_container[iZone], iZone, nZone); + + /*--- Color the initial grid and set the send-receive domains (ParMETIS). ---*/ + + if (fem_solver) { + geometry_aux->SetColorFEMGrid_Parallel(config_container[iZone]); + } else { + geometry_aux->SetColorGrid_Parallel(config_container[iZone]); + } + + /*--- Build the grid data structures using the ParMETIS coloring. ---*/ + + if (fem_solver) { + switch (config_container[iZone]->GetKind_FEM_Flow()) { + case DG: + geometry_container[iZone][iInst] = new CGeometry*[nMesh]; + geometry_container[iZone][iInst][MESH_0] = new CMeshFEM_DG(geometry_aux, config_container[iZone]); + break; + } + } else { + geometry_container[iZone][iInst] = new CGeometry*[nMesh]; + geometry_container[iZone][iInst][MESH_0] = new CPhysicalGeometry(geometry_aux, config_container[iZone]); + } + + /*--- Deallocate the memory of geometry_aux. ---*/ + + delete geometry_aux; + + /*--- Add the Send/Receive boundaries. ---*/ + + geometry_container[iZone][iInst][MESH_0]->SetSendReceive(config_container[iZone]); + + /*--- Add the Send/Receive boundaries. ---*/ + + geometry_container[iZone][iInst][MESH_0]->SetBoundaries(config_container[iZone]); + + /*--- Create the vertex structure (required for MPI). ---*/ + + if (rank == MASTER_NODE) cout << "Identify vertices." << endl; + geometry_container[iZone][iInst][MESH_0]->SetVertex(config_container[iZone]); + + /*--- Store the global to local mapping after preprocessing. ---*/ + + if (rank == MASTER_NODE) cout << "Storing a mapping from global to local point index." << endl; + geometry_container[iZone][iInst][MESH_0]->SetGlobal_to_Local_Point(); + + /*--- Test for a fem solver, because some more work must be done. ---*/ + + if (fem_solver) { + /*--- Carry out a dynamic cast to CMeshFEM_DG, such that it is not needed to + * define all virtual functions in the base class CGeometry. ---*/ + + auto* DGMesh = dynamic_cast(geometry_container[iZone][iInst][MESH_0]); + + /*--- Determine the standard elements for the volume elements. ---*/ + + if (rank == MASTER_NODE) cout << "Creating standard volume elements." << endl; + DGMesh->CreateStandardVolumeElements(config_container[iZone]); + + /*--- Create the face information needed to compute the contour integral + * for the elements in the Discontinuous Galerkin formulation. ---*/ + + if (rank == MASTER_NODE) cout << "Creating face information." << endl; + DGMesh->CreateFaces(config_container[iZone]); + } + } + + if (rank == MASTER_NODE) + cout << "\n----------------------- Preprocessing computations ----------------------" << endl; + + /*--- Compute elements surrounding points, points surrounding points. ---*/ + + if (rank == MASTER_NODE) cout << "Setting local point connectivity." << endl; + geometry_container[iZone][INST_0][MESH_0]->SetPoint_Connectivity(); + + /*--- Check the orientation before computing geometrical quantities. ---*/ + + geometry_container[iZone][INST_0][MESH_0]->SetBoundVolume(); + if (config_container[iZone]->GetReorientElements()) { + if (rank == MASTER_NODE) cout << "Checking the numerical grid orientation of the elements." << endl; + geometry_container[iZone][INST_0][MESH_0]->Check_IntElem_Orientation(config_container[iZone]); + geometry_container[iZone][INST_0][MESH_0]->Check_BoundElem_Orientation(config_container[iZone]); + } + + /*--- Create the edge structure. ---*/ + + if (rank == MASTER_NODE) cout << "Identify edges and vertices." << endl; + geometry_container[iZone][INST_0][MESH_0]->SetEdges(); + geometry_container[iZone][INST_0][MESH_0]->SetVertex(config_container[iZone]); + + /*--- Create the dual control volume structures. ---*/ + + if (rank == MASTER_NODE) cout << "Setting the bound control volume structure." << endl; + geometry_container[iZone][INST_0][MESH_0]->SetBoundControlVolume(config_container[ZONE_0], ALLOCATE); + + /*--- Store the global to local mapping after preprocessing. ---*/ + + if (rank == MASTER_NODE) cout << "Storing a mapping from global to local point index." << endl; + geometry_container[iZone][INST_0][MESH_0]->SetGlobal_to_Local_Point(); + + /*--- Create the point-to-point MPI communication structures. ---*/ + + geometry_container[iZone][INST_0][MESH_0]->PreprocessP2PComms(geometry_container[iZone][INST_0][MESH_0], + config_container[iZone]); + } + + /*--- Keep a reference to the main (ZONE_0, INST_0, MESH_0) geometry. ---*/ + + main_geometry = geometry_container[ZONE_0][INST_0][MESH_0]; +} + +void CDiscAdjDeformationDriver::Output_Preprocessing() {} + +void CDiscAdjDeformationDriver::Preprocess() { + for (iZone = 0; iZone < nZone; iZone++) { + if (!config_container[iZone]->GetDiscrete_Adjoint()) { + if (rank == MASTER_NODE) cout << "Reading surface sensitivities at each node from file." << endl; + geometry_container[iZone][INST_0][MESH_0]->SetBoundSensitivity(config_container[iZone]); + + } else { + if (rank == MASTER_NODE) cout << "Reading volume sensitivities at each node from file." << endl; + unsigned short nInst_Zone = nInst[iZone]; + + grid_movement[iZone] = new CVolumetricMovement*[nInst_Zone](); + grid_movement[iZone][INST_0] = + new CVolumetricMovement(geometry_container[iZone][INST_0][MESH_0], config_container[iZone]); + + /*--- Read in sensitivities from file. ---*/ + + if (config_container[ZONE_0]->GetSensitivity_Format() == UNORDERED_ASCII) + geometry_container[iZone][INST_0][MESH_0]->ReadUnorderedSensitivity(config_container[iZone]); + else + geometry_container[iZone][INST_0][MESH_0]->SetSensitivity(config_container[iZone]); + } + } +} + +void CDiscAdjDeformationDriver::Run() { + for (iZone = 0; iZone < nZone; iZone++) { + if (!config_container[iZone]->GetDiscrete_Adjoint()) { + continue; + } + if (rank == MASTER_NODE) + cout << "\n---------------------- Mesh sensitivity computation ---------------------" << endl; + if (config_container[iZone]->GetDiscrete_Adjoint() && config_container[iZone]->GetSmoothGradient() && + config_container[iZone]->GetSobMode() == ENUM_SOBOLEV_MODUS::MESH_LEVEL) { + DerivativeTreatment_MeshSensitivity(geometry_container[iZone][INST_0][MESH_0], config_container[iZone], + grid_movement[iZone][INST_0]); + } else { + grid_movement[iZone][INST_0]->SetVolume_Deformation(geometry_container[iZone][INST_0][MESH_0], + config_container[iZone], false, true); + } + } + + if (config_container[ZONE_0]->GetDiscrete_Adjoint()) { + if (rank == MASTER_NODE) + cout << "\n------------------------ Mesh sensitivity Output ------------------------" << endl; + SetSensitivity_Files(geometry_container, config_container, nZone); + } + + ofstream Gradient_file; + Gradient_file.precision(driver_config->OptionIsSet("OUTPUT_PRECISION") ? driver_config->GetOutput_Precision() : 6); + + /*--- For multi-zone computations the gradient contributions are summed up and written into one file. ---*/ + + for (iZone = 0; iZone < nZone; iZone++) { + if ((config_container[iZone]->GetDesign_Variable(0) != NONE) && + (config_container[iZone]->GetDesign_Variable(0) != SURFACE_FILE)) { + if (rank == MASTER_NODE) + cout << "\n---------- Start gradient evaluation using sensitivity information ----------" << endl; + + /*--- Definition of the Class for surface deformation. ---*/ + + surface_movement[iZone] = new CSurfaceMovement(); + + /*--- Copy coordinates to the surface structure. ---*/ + + surface_movement[iZone]->CopyBoundary(geometry_container[iZone][INST_0][MESH_0], config_container[iZone]); + + /*--- If AD mode is enabled we can use it to compute the projection, otherwise we use finite differences. ---*/ + + if (config_container[iZone]->GetAD_Mode()) { + if (config_container[iZone]->GetSmoothGradient()) { + DerivativeTreatment_Gradient(geometry_container[iZone][INST_0][MESH_0], config_container[iZone], + grid_movement[iZone][INST_0], surface_movement[iZone], Gradient); + } else { + SetProjection_AD(geometry_container[iZone][INST_0][MESH_0], config_container[iZone], surface_movement[iZone], + Gradient); + } + } else { + SetProjection_FD(geometry_container[iZone][INST_0][MESH_0], config_container[iZone], surface_movement[iZone], + Gradient); + } + } + } + + /*--- Write the gradient to a file. ---*/ + + if (rank == MASTER_NODE) Gradient_file.open(config_container[ZONE_0]->GetObjFunc_Grad_FileName().c_str(), ios::out); + + /*--- Print gradients to screen and writes to file. ---*/ + + OutputGradient(Gradient, config_container[ZONE_0], Gradient_file); +} + +void CDiscAdjDeformationDriver::Finalize() { + for (auto iDV = 0u; iDV < config_container[ZONE_0]->GetnDV(); iDV++) { + delete[] Gradient[iDV]; + } + delete[] Gradient; + + if (rank == MASTER_NODE) cout << "\n------------------------- Finalize Solver -------------------------" << endl; + + CommonFinalize(); + + /*--- Exit the solver cleanly. ---*/ + + if (rank == MASTER_NODE) + cout << "\n------------------------- Exit Success (SU2_DOT) ------------------------" << endl << endl; +} + +void CDiscAdjDeformationDriver::SetProjection_FD(CGeometry* geometry, CConfig* config, + CSurfaceMovement* surface_movement, su2double** Gradient) { + unsigned short iDV, nDV, iFFDBox, nDV_Value, iMarker, iDim; + unsigned long iVertex, iPoint; + su2double delta_eps, my_Gradient, localGradient, *Normal, dS, *VarCoord, Sensitivity, dalpha[3], deps[3], dalpha_deps; + bool *UpdatePoint, MoveSurface, Local_MoveSurface; + CFreeFormDefBox** FFDBox; + + int rank = SU2_MPI::GetRank(); + + nDV = config->GetnDV(); + + /*--- Boolean controlling points to be updated. ---*/ + + UpdatePoint = new bool[geometry->GetnPoint()]; + + /*--- Definition of the FFD deformation class. ---*/ + + unsigned short nFFDBox = MAX_NUMBER_FFD; + FFDBox = new CFreeFormDefBox*[nFFDBox]; + for (iFFDBox = 0; iFFDBox < MAX_NUMBER_FFD; iFFDBox++) FFDBox[iFFDBox] = nullptr; + + for (iDV = 0; iDV < nDV; iDV++) { + nDV_Value = config->GetnDV_Value(iDV); + if (nDV_Value != 1) { + SU2_MPI::Error( + "The projection using finite differences currently only supports a fixed direction of movement for FFD " + "points.", + CURRENT_FUNCTION); + } + } + + /*--- Continuous adjoint gradient computation. ---*/ + + if (rank == MASTER_NODE) cout << "Evaluate functional gradient using Finite Differences." << endl; + + for (iDV = 0; iDV < nDV; iDV++) { + MoveSurface = true; + Local_MoveSurface = true; + + /*--- Free form deformation based. ---*/ + + if ((config->GetDesign_Variable(iDV) == FFD_CONTROL_POINT_2D) || + (config->GetDesign_Variable(iDV) == FFD_CAMBER_2D) || (config->GetDesign_Variable(iDV) == FFD_THICKNESS_2D) || + (config->GetDesign_Variable(iDV) == FFD_CONTROL_POINT) || (config->GetDesign_Variable(iDV) == FFD_NACELLE) || + (config->GetDesign_Variable(iDV) == FFD_GULL) || (config->GetDesign_Variable(iDV) == FFD_TWIST) || + (config->GetDesign_Variable(iDV) == FFD_ROTATION) || (config->GetDesign_Variable(iDV) == FFD_CAMBER) || + (config->GetDesign_Variable(iDV) == FFD_THICKNESS) || + (config->GetDesign_Variable(iDV) == FFD_ANGLE_OF_ATTACK)) { + /*--- Read the FFD information in the first iteration. ---*/ + + if (iDV == 0) { + if (rank == MASTER_NODE) cout << "Read the FFD information from mesh file." << endl; + + /*--- Read the FFD information from the grid file. ---*/ + + surface_movement->ReadFFDInfo(geometry, config, FFDBox, config->GetMesh_FileName()); + + /*--- If the FFDBox was not defined in the input file. ---*/ + + if (!surface_movement->GetFFDBoxDefinition()) { + SU2_MPI::Error("The input grid doesn't have the entire FFD information!", CURRENT_FUNCTION); + } + + for (iFFDBox = 0; iFFDBox < surface_movement->GetnFFDBox(); iFFDBox++) { + if (rank == MASTER_NODE) cout << "Checking FFD box dimension." << endl; + surface_movement->CheckFFDDimension(geometry, config, FFDBox[iFFDBox], iFFDBox); + + if (rank == MASTER_NODE) cout << "Check the FFD box intersections with the solid surfaces." << endl; + surface_movement->CheckFFDIntersections(geometry, config, FFDBox[iFFDBox], iFFDBox); + } + + if (rank == MASTER_NODE) + cout << "-------------------------------------------------------------------------" << endl; + } + + if (rank == MASTER_NODE) { + cout << endl << "Design variable number " << iDV << "." << endl; + cout << "Performing 3D deformation of the surface." << endl; + } + + /*--- Apply the control point change. ---*/ + + MoveSurface = false; + + for (iFFDBox = 0; iFFDBox < surface_movement->GetnFFDBox(); iFFDBox++) { + /*--- Reset FFD box. ---*/ + + switch (config->GetDesign_Variable(iDV)) { + case FFD_CONTROL_POINT_2D: + Local_MoveSurface = + surface_movement->SetFFDCPChange_2D(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_CAMBER_2D: + Local_MoveSurface = surface_movement->SetFFDCamber_2D(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_THICKNESS_2D: + Local_MoveSurface = + surface_movement->SetFFDThickness_2D(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_CONTROL_POINT: + Local_MoveSurface = surface_movement->SetFFDCPChange(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_NACELLE: + Local_MoveSurface = surface_movement->SetFFDNacelle(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_GULL: + Local_MoveSurface = surface_movement->SetFFDGull(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_TWIST: + Local_MoveSurface = surface_movement->SetFFDTwist(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_ROTATION: + Local_MoveSurface = surface_movement->SetFFDRotation(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_CAMBER: + Local_MoveSurface = surface_movement->SetFFDCamber(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_THICKNESS: + Local_MoveSurface = surface_movement->SetFFDThickness(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_CONTROL_SURFACE: + Local_MoveSurface = + surface_movement->SetFFDControl_Surface(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_ANGLE_OF_ATTACK: + Gradient[iDV][0] = config->GetAoA_Sens(); + break; + } + + /*--- Recompute cartesian coordinates using the new control points position. ---*/ + + if (Local_MoveSurface) { + MoveSurface = true; + surface_movement->SetCartesianCoord(geometry, config, FFDBox[iFFDBox], iFFDBox, true); + } + } + } + + /*--- Hicks-Henne design variable. ---*/ + + else if (config->GetDesign_Variable(iDV) == HICKS_HENNE) { + surface_movement->SetHicksHenne(geometry, config, iDV, true); + } + + /*--- Surface bump design variable. ---*/ + + else if (config->GetDesign_Variable(iDV) == SURFACE_BUMP) { + surface_movement->SetSurface_Bump(geometry, config, iDV, true); + } + + /*--- Kulfan (CST) design variable. ---*/ + + else if (config->GetDesign_Variable(iDV) == CST) { + surface_movement->SetCST(geometry, config, iDV, true); + } + + /*--- Displacement design variable. ---*/ + + else if (config->GetDesign_Variable(iDV) == TRANSLATION) { + surface_movement->SetTranslation(geometry, config, iDV, true); + } + + /*--- Angle of Attack design variable. ---*/ + + else if (config->GetDesign_Variable(iDV) == ANGLE_OF_ATTACK) { + Gradient[iDV][0] = config->GetAoA_Sens(); + } + + /*--- Scale design variable. ---*/ + + else if (config->GetDesign_Variable(iDV) == SCALE) { + surface_movement->SetScale(geometry, config, iDV, true); + } + + /*--- Rotation design variable. ---*/ + + else if (config->GetDesign_Variable(iDV) == ROTATION) { + surface_movement->SetRotation(geometry, config, iDV, true); + } + + /*--- NACA_4Digits design variable. ---*/ + + else if (config->GetDesign_Variable(iDV) == NACA_4DIGITS) { + surface_movement->SetNACA_4Digits(geometry, config); + } + + /*--- Parabolic design variable. ---*/ + + else if (config->GetDesign_Variable(iDV) == PARABOLIC) { + surface_movement->SetParabolic(geometry, config); + } + + /*--- Design variable not implemented. ---*/ + + else { + if (rank == MASTER_NODE) cout << "Design Variable not implemented yet" << endl; + } + + /*--- Load the delta change in the design variable (finite difference step). ---*/ + + if ((config->GetDesign_Variable(iDV) != ANGLE_OF_ATTACK) && + (config->GetDesign_Variable(iDV) != FFD_ANGLE_OF_ATTACK)) { + /*--- If the Angle of attack is not involved, reset the value of the gradient. ---*/ + + my_Gradient = 0.0; + Gradient[iDV][0] = 0.0; + + if (MoveSurface) { + delta_eps = config->GetDV_Value(iDV); + + for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) UpdatePoint[iPoint] = true; + + for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { + if (config->GetMarker_All_DV(iMarker) == YES) { + for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + if ((iPoint < geometry->GetnPointDomain()) && UpdatePoint[iPoint]) { + Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); + VarCoord = geometry->vertex[iMarker][iVertex]->GetVarCoord(); + Sensitivity = geometry->vertex[iMarker][iVertex]->GetAuxVar(); + + dS = 0.0; + for (iDim = 0; iDim < geometry->GetnDim(); iDim++) { + dS += Normal[iDim] * Normal[iDim]; + deps[iDim] = VarCoord[iDim] / delta_eps; + } + dS = sqrt(dS); + + dalpha_deps = 0.0; + for (iDim = 0; iDim < geometry->GetnDim(); iDim++) { + dalpha[iDim] = Normal[iDim] / dS; + dalpha_deps -= dalpha[iDim] * deps[iDim]; + } + + my_Gradient += Sensitivity * dalpha_deps; + UpdatePoint[iPoint] = false; + } + } + } + } + } + + SU2_MPI::Allreduce(&my_Gradient, &localGradient, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + Gradient[iDV][0] += localGradient; + } + } + + /*--- Delete memory for parameterization. ---*/ + + if (FFDBox != nullptr) { + for (iFFDBox = 0; iFFDBox < MAX_NUMBER_FFD; iFFDBox++) { + if (FFDBox[iFFDBox] != nullptr) { + delete FFDBox[iFFDBox]; + } + } + delete[] FFDBox; + } + + delete[] UpdatePoint; +} + +void CDiscAdjDeformationDriver::SetProjection_AD(CGeometry* geometry, CConfig* config, + CSurfaceMovement* surface_movement, su2double** Gradient) { + su2double *VarCoord = nullptr, Sensitivity, my_Gradient, localGradient, *Normal, Area = 0.0; + unsigned short iDV_Value = 0, iMarker, nMarker, iDim, nDim, iDV, nDV; + unsigned long iVertex, nVertex, iPoint; + + const int rank = SU2_MPI::GetRank(); + + nMarker = config->GetnMarker_All(); + nDim = geometry->GetnDim(); + nDV = config->GetnDV(); + + /*--- Discrete adjoint gradient computation. ---*/ + + if (rank == MASTER_NODE) + cout << endl + << "Evaluate functional gradient using Algorithmic Differentiation (ZONE " << config->GetiZone() << ")." + << endl; + + /*--- Start recording of operations. ---*/ + + AD::StartRecording(); + + /*--- Register design variables as input and set them to zero + * (since we want to have the derivative at alpha = 0, i.e. for the current design). ---*/ + + for (iDV = 0; iDV < nDV; iDV++) { + for (iDV_Value = 0; iDV_Value < config->GetnDV_Value(iDV); iDV_Value++) { + config->SetDV_Value(iDV, iDV_Value, 0.0); + + AD::RegisterInput(config->GetDV_Value(iDV, iDV_Value)); + } + } + + /*--- Call the surface deformation routine. ---*/ + + surface_movement->SetSurface_Deformation(geometry, config); + + /*--- Stop the recording. --- */ + + AD::StopRecording(); + + /*--- Create a structure to identify points that have been already visited. + * We need that to make sure to set the sensitivity of surface points only once. + * Markers share points, so we would visit them more than once in the loop over the markers below). ---*/ + + vector visited(geometry->GetnPoint(), false); + + /*--- Initialize the derivatives of the output of the surface deformation routine + * with the discrete adjoints from the CFD solution. ---*/ + + for (iMarker = 0; iMarker < nMarker; iMarker++) { + if (config->GetMarker_All_DV(iMarker) == YES) { + nVertex = geometry->nVertex[iMarker]; + for (iVertex = 0; iVertex < nVertex; iVertex++) { + iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); + if (!visited[iPoint]) { + VarCoord = geometry->vertex[iMarker][iVertex]->GetVarCoord(); + Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); + + Area = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + Area += Normal[iDim] * Normal[iDim]; + } + Area = sqrt(Area); + + for (iDim = 0; iDim < nDim; iDim++) { + if (config->GetDiscrete_Adjoint()) { + Sensitivity = geometry->GetSensitivity(iPoint, iDim); + } else { + Sensitivity = -Normal[iDim] * geometry->vertex[iMarker][iVertex]->GetAuxVar() / Area; + } + SU2_TYPE::SetDerivative(VarCoord[iDim], SU2_TYPE::GetValue(Sensitivity)); + } + visited[iPoint] = true; + } + } + } + } + + /*--- Compute derivatives and extract gradient. ---*/ + + AD::ComputeAdjoint(); + + for (iDV = 0; iDV < nDV; iDV++) { + for (iDV_Value = 0; iDV_Value < config->GetnDV_Value(iDV); iDV_Value++) { + my_Gradient = SU2_TYPE::GetDerivative(config->GetDV_Value(iDV, iDV_Value)); + + SU2_MPI::Allreduce(&my_Gradient, &localGradient, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); + + /*--- Angle of Attack design variable (this is different, the value comes form the input file). ---*/ + + if ((config->GetDesign_Variable(iDV) == ANGLE_OF_ATTACK) || + (config->GetDesign_Variable(iDV) == FFD_ANGLE_OF_ATTACK)) { + Gradient[iDV][iDV_Value] = config->GetAoA_Sens(); + } + + Gradient[iDV][iDV_Value] += localGradient; + } + } + + AD::Reset(); +} + +void CDiscAdjDeformationDriver::OutputGradient(su2double** Gradient, CConfig* config, ofstream& Gradient_file) { + unsigned short nDV, iDV, iDV_Value, nDV_Value; + + int rank = SU2_MPI::GetRank(); + + nDV = config->GetnDV(); + + /*--- Loop through all design variables and their gradients. ---*/ + + for (iDV = 0; iDV < nDV; iDV++) { + nDV_Value = config->GetnDV_Value(iDV); + if (rank == MASTER_NODE) { + /*--- Print the kind of design variable on screen. ---*/ + + cout << endl << "Design variable ("; + for (auto it = Param_Map.begin(); it != Param_Map.end(); ++it) { + if (it->second == config->GetDesign_Variable(iDV)) { + cout << it->first << ") number " << iDV << "." << endl; + } + } + + /*--- Print the kind of objective function to screen. ---*/ + + for (auto it = Objective_Map.begin(); it != Objective_Map.end(); ++it) { + if (it->second == config->GetKind_ObjFunc()) { + cout << it->first << " gradient : "; + if (iDV == 0) Gradient_file << it->first << " gradient " << endl; + } + } + + /*--- Print the gradient to file and screen. ---*/ + + for (iDV_Value = 0; iDV_Value < nDV_Value; iDV_Value++) { + cout << Gradient[iDV][iDV_Value]; + if (iDV_Value != nDV_Value - 1) { + cout << ", "; + } + Gradient_file << Gradient[iDV][iDV_Value] << endl; + } + cout << endl; + cout << "-------------------------------------------------------------------------" << endl; + } + } +} + +void CDiscAdjDeformationDriver::SetSensitivity_Files(CGeometry**** geometry, CConfig** config, + unsigned short val_nZone) { + unsigned short iMarker, iDim, nDim, nMarker, nVar; + unsigned long iVertex, iPoint, nPoint, nVertex; + su2double *Normal, Prod, Sens = 0.0, SensDim, Area; + + unsigned short iZone; + + CSolver* solver = nullptr; + COutput* output = nullptr; + + for (iZone = 0; iZone < val_nZone; iZone++) { + nPoint = geometry[iZone][INST_0][MESH_0]->GetnPoint(); + nDim = geometry[iZone][INST_0][MESH_0]->GetnDim(); + nMarker = config[iZone]->GetnMarker_All(); + nVar = nDim + 1; + + /*--- We create a baseline solver to easily merge the sensitivity information. ---*/ + + vector fieldnames; + fieldnames.emplace_back("\"Point\""); + fieldnames.emplace_back("\"x\""); + fieldnames.emplace_back("\"y\""); + if (nDim == 3) { + fieldnames.emplace_back("\"z\""); + } + fieldnames.emplace_back("\"Sensitivity_x\""); + fieldnames.emplace_back("\"Sensitivity_y\""); + if (nDim == 3) { + fieldnames.emplace_back("\"Sensitivity_z\""); + } + fieldnames.emplace_back("\"Surface_Sensitivity\""); + + solver = new CBaselineSolver(geometry[iZone][INST_0][MESH_0], config[iZone], nVar + nDim, fieldnames); + + for (iPoint = 0; iPoint < nPoint; iPoint++) { + for (iDim = 0; iDim < nDim; iDim++) { + solver->GetNodes()->SetSolution(iPoint, iDim, geometry[iZone][INST_0][MESH_0]->nodes->GetCoord(iPoint, iDim)); + solver->GetNodes()->SetSolution(iPoint, iDim + nDim, + geometry[iZone][INST_0][MESH_0]->GetSensitivity(iPoint, iDim)); + } + } + + /*--- Compute the sensitivity in normal direction. ---*/ + + for (iMarker = 0; iMarker < nMarker; iMarker++) { + if (config[iZone]->GetSolid_Wall(iMarker) || (config[iZone]->GetMarker_All_DV(iMarker) == YES)) { + nVertex = geometry[iZone][INST_0][MESH_0]->GetnVertex(iMarker); + + for (iVertex = 0; iVertex < nVertex; iVertex++) { + iPoint = geometry[iZone][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNode(); + Normal = geometry[iZone][INST_0][MESH_0]->vertex[iMarker][iVertex]->GetNormal(); + Prod = 0.0; + Area = 0.0; + for (iDim = 0; iDim < nDim; iDim++) { + /*--- Retrieve the gradient calculated with discrete adjoint method. ---*/ + + SensDim = geometry[iZone][INST_0][MESH_0]->GetSensitivity(iPoint, iDim); + + /*--- Calculate scalar product for projection onto the normal vector. ---*/ + + Prod += Normal[iDim] * SensDim; + + Area += Normal[iDim] * Normal[iDim]; + } + + Area = sqrt(Area); + + /*--- Projection of the gradient onto the normal vector of the surface. ---*/ + + Sens = Prod / Area; + + solver->GetNodes()->SetSolution(iPoint, 2 * nDim, Sens); + } + } + } + + output = new CBaselineOutput(config[iZone], nDim, solver); + output->PreprocessVolumeOutput(config[iZone]); + output->PreprocessHistoryOutput(config[iZone], false); + + /*--- Load the data. --- */ + + output->LoadData(geometry[iZone][INST_0][MESH_0], config[iZone], &solver); + + /*--- Set the surface filename. ---*/ + + output->SetSurfaceFilename(config[iZone]->GetSurfSens_FileName()); + + /*--- Set the volume filename. ---*/ + + output->SetVolumeFilename(config[iZone]->GetVolSens_FileName()); + + /*--- Write to file. ---*/ + + for (unsigned short iFile = 0; iFile < config[iZone]->GetnVolumeOutputFiles(); iFile++) { + auto FileFormat = config[iZone]->GetVolumeOutputFiles(); + if (FileFormat[iFile] != OUTPUT_TYPE::RESTART_ASCII && FileFormat[iFile] != OUTPUT_TYPE::RESTART_BINARY && + FileFormat[iFile] != OUTPUT_TYPE::CSV) + output->WriteToFile(config[iZone], geometry[iZone][INST_0][MESH_0], FileFormat[iFile]); + } + + /*--- Free memory. ---*/ + + delete output; + delete solver; + } +} + +void CDiscAdjDeformationDriver::DerivativeTreatment_MeshSensitivity(CGeometry* geometry, CConfig* config, + CVolumetricMovement* grid_movement) { + int rank = SU2_MPI::GetRank(); + + /*--- Warning if chosen smoothing mode is unsupported. + * This is the default option if the user has not specified a mode in the config file. ---*/ + + if (config->GetSobMode() == ENUM_SOBOLEV_MODUS::NONE) { + SU2_MPI::Error("Unsupported operation modus for the Sobolev Smoothing Solver.", CURRENT_FUNCTION); + } + + /*-- Construct the smoothing solver and numerics. ---*/ + + std::unique_ptr solver(new CGradientSmoothingSolver(geometry, config)); + unsigned dim = (config->GetSmoothOnSurface() ? geometry->GetnDim() - 1 : geometry->GetnDim()); + std::unique_ptr numerics(new CGradSmoothing(dim, config)); + + if (rank == MASTER_NODE) cout << "Sobolev Smoothing of derivatives is active." << endl; + + /*--- Apply the smoothing procedure on the mesh level. ---*/ + + if (config->GetSobMode() == ENUM_SOBOLEV_MODUS::MESH_LEVEL) { + if (rank == MASTER_NODE) cout << " working on mesh level" << endl; + + /*--- Work with the surface derivatives. ---*/ + if (config->GetSmoothOnSurface()) { + /*--- Project to surface and then smooth on surface. ---*/ + + grid_movement->SetVolume_Deformation(geometry, config, false, true); + + /*--- Get the sensitivities from the geometry class to work with. ---*/ + + solver->ReadSensFromGeometry(geometry); + + /*--- Perform the smoothing procedure on all boundaries marked as DV marker. ---*/ + + solver->ApplyGradientSmoothingSurface(geometry, numerics.get(), config); + + /*--- After applying the solver write the results back. ---*/ + + solver->WriteSensToGeometry(geometry); + + /*--- Work with the volume derivatives. ---*/ + } else { + /*--- Get the sensitivities from the geometry class to work with. ---*/ + + solver->ReadSensFromGeometry(geometry); + + solver->ApplyGradientSmoothingVolume(geometry, numerics.get(), config); + + /*--- After applying the solver write the results back. ---*/ + + solver->WriteSensToGeometry(geometry); + + /*--- Projection is applied after smoothing. ---*/ + + grid_movement->SetVolume_Deformation(geometry, config, false, true); + } + } +} + +void CDiscAdjDeformationDriver::DerivativeTreatment_Gradient(CGeometry* geometry, CConfig* config, + CVolumetricMovement* grid_movement, + CSurfaceMovement* surface_movement, su2double** Gradient) { + int rank = SU2_MPI::GetRank(); + + /*--- Error if chosen smoothing mode is unsupported. + * This is the default option if the user has not specified a mode in the config file. ---*/ + + if (config->GetSobMode() == ENUM_SOBOLEV_MODUS::NONE) { + SU2_MPI::Error("Unsupported operation modus for the Sobolev Smoothing Solver.", CURRENT_FUNCTION); + } + + /*-- Construct the smoothing solver and numerics. ---*/ + + std::unique_ptr solver(new CGradientSmoothingSolver(geometry, config)); + unsigned dim = (config->GetSmoothOnSurface() ? geometry->GetnDim() - 1 : geometry->GetnDim()); + std::unique_ptr numerics(new CGradSmoothing(dim, config)); + + if (rank == MASTER_NODE) cout << "Sobolev Smoothing of derivatives is active." << endl; + + /*--- Get the sensitivities from the geometry class to work with. ---*/ + + solver->ReadSensFromGeometry(geometry); + + /*--- Apply the smoothing procedure on the DV level. ---*/ + if (config->GetSobMode() == ENUM_SOBOLEV_MODUS::PARAM_LEVEL_COMPLETE) { + solver->ApplyGradientSmoothingDV(geometry, numerics.get(), surface_movement, grid_movement, config, Gradient); + + /*--- If smoothing already took place on the mesh level, or none is requested, just do standard projection. ---*/ + } else if (config->GetSobMode() == ENUM_SOBOLEV_MODUS::ONLY_GRAD || + config->GetSobMode() == ENUM_SOBOLEV_MODUS::MESH_LEVEL) { + solver->RecordTapeAndCalculateOriginalGradient(geometry, surface_movement, grid_movement, config, Gradient); + } +} diff --git a/SU2_DEF/src/meson.build b/SU2_DEF/src/meson.build index e4f3705111d..3fcca7809d7 100644 --- a/SU2_DEF/src/meson.build +++ b/SU2_DEF/src/meson.build @@ -1,4 +1,9 @@ -su2_def_src = ['SU2_DEF.cpp'] +su2_def_include = include_directories('./') +su2_def_src = files([ + 'SU2_DEF.cpp', + 'drivers/CDeformationDriver.cpp', + 'drivers/CDiscAdjDeformationDriver.cpp' +]) if get_option('enable-normal') su2_def = executable('SU2_DEF', @@ -6,4 +11,27 @@ if get_option('enable-normal') install: true, dependencies: [su2_deps, common_dep, su2_cfd_dep], cpp_args :[default_warning_flags, su2_cpp_args]) + + su2_def_lib = static_library('SU2core_DEF', + su2_def_src, + install : false, + dependencies : [su2_deps, common_dep, su2_cfd_dep], + cpp_args: [default_warning_flags, su2_cpp_args]) + + su2_def_dep = declare_dependency(link_with: su2_def_lib, + include_directories: su2_def_include) + +endif + +if get_option('enable-autodiff') + + su2_def_lib_ad = static_library('SU2core_DEF_AD', + su2_def_src, + install : false, + dependencies : [su2_deps, codi_dep, commonAD_dep, su2_cfd_dep_ad], + cpp_args: [default_warning_flags, su2_cpp_args, codi_rev_args]) + + su2_def_dep_ad = declare_dependency(link_with: su2_def_lib_ad, + include_directories: su2_def_include) + endif diff --git a/SU2_DOT/bin/.gitignore b/SU2_DOT/bin/.gitignore deleted file mode 100644 index fe891329eff..00000000000 --- a/SU2_DOT/bin/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Do not track compiled execuatables -SU2* diff --git a/SU2_DOT/include/SU2_DOT.hpp b/SU2_DOT/include/SU2_DOT.hpp deleted file mode 100644 index 0a0d9b2482b..00000000000 --- a/SU2_DOT/include/SU2_DOT.hpp +++ /dev/null @@ -1,112 +0,0 @@ -/*! - * \file SU2_DOT.hpp - * \brief Headers of the main subroutines of the code SU2_DOT. - * The subroutines and functions are in the SU2_DOT.cpp file. - * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" - * - * SU2 Project Website: https://su2code.github.io - * - * The SU2 Project is maintained by the SU2 Foundation - * (http://su2foundation.org) - * - * Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) - * - * SU2 is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * SU2 is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with SU2. If not, see . - */ - - -#pragma once - -#define ENABLE_MAPS -#include "../../Common/include/CConfig.hpp" -#undef ENABLE_MAPS - -#include "../../Common/include/parallelization/mpi_structure.hpp" -#include "../../Common/include/parallelization/omp_structure.hpp" - -#include -#include -#include -#include - -#include "../../Common/include/geometry/CPhysicalGeometry.hpp" -#include "../../Common/include/fem/fem_geometry_structure.hpp" -#include "../../SU2_CFD/include/output/CBaselineOutput.hpp" -#include "../../SU2_CFD/include/solvers/CBaselineSolver.hpp" - -#include "../../SU2_CFD/include/solvers/CGradientSmoothingSolver.hpp" -#include "../../SU2_CFD/include/numerics/CGradSmoothing.hpp" - -using namespace std; - - -/*! - * \brief Projection of the surface sensitivity using finite differences (FD). - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] surface_movement - Surface movement class of the problem. - * \param[in] Gradient_file - Output file to store the gradient data. - */ - -void SetProjection_FD(CGeometry *geometry, CConfig *config, CSurfaceMovement *surface_movement, su2double **Gradient); - -/*! - * \brief Projection of the surface sensitivity using algorithmic differentiation (AD). - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] surface_movement - Surface movement class of the problem. - * \param[in] Gradient_file - Output file to store the gradient data. - */ - -void SetProjection_AD(CGeometry *geometry, CConfig *config, CSurfaceMovement *surface_movement, su2double **Gradient); - -/*! - * \brief Prints the gradient information to a file. - * \param[in] Gradient - The gradient data. - * \param[in] config - Definition of the particular problem. - * \param[in] Gradient_file - Output file to store the gradient data. - */ - -void OutputGradient(su2double** Gradient, CConfig* config, ofstream& Gradient_file); - -/*! - * \brief Write the sensitivity (including mesh sensitivity) computed with the discrete adjoint method - * on the surface and in the volume to a file. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] val_nZone - Number of Zones. - */ - -void SetSensitivity_Files(CGeometry ***geometry, CConfig **config, unsigned short val_nZone); - -/*! - * \brief Treatment of derivatives with the Sobolev smoothing solver. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] grid_movement - Volumetric movement class of the problem. - */ - -void DerivativeTreatment_MeshSensitivity(CGeometry *geometry, CConfig *config, CVolumetricMovement *grid_movement); - -/*! - * \brief Treatment of derivatives with the Sobolev smoothing solver. - * \param[in] geometry - Geometrical definition of the problem. - * \param[in] config - Definition of the particular problem. - * \param[in] grid_movement - Volumetric movement class of the problem. - * \param[in] surface_movement - Surface movement class of the problem. - * \param[in] Gradient - Output array to store the gradient data. - */ - -void DerivativeTreatment_Gradient(CGeometry *geometry, CConfig *config, CVolumetricMovement *grid_movement, CSurfaceMovement *surface_movement, su2double **Gradient); diff --git a/SU2_DOT/obj/Makefile.am b/SU2_DOT/obj/Makefile.am deleted file mode 100644 index 238b66fd3a4..00000000000 --- a/SU2_DOT/obj/Makefile.am +++ /dev/null @@ -1,81 +0,0 @@ -################################################################################ -# -# \file Makefile.am -# \brief Makefile for SU2_DOT -# \author M. Colonno, T. Economon, F. Palacios -# \version 7.5.1 "Blackbird" -# -# SU2 Project Website: https://su2code.github.io -# -# The SU2 Project is maintained by the SU2 Foundation -# (http://su2foundation.org) -# -# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) -# -# SU2 is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# SU2 is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with SU2. If not, see . -# -################################################################################ - -AUTOMAKE_OPTIONS = subdir-objects -ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} - -bin_PROGRAMS = - -if BUILD_NORMAL -bin_PROGRAMS += ../bin/SU2_DOT -endif - -if BUILD_REVERSE -bin_PROGRAMS += ../bin/SU2_DOT_AD -endif - -su2_dot_sources = ../include/SU2_DOT.hpp \ - ../src/SU2_DOT.cpp - -su2_dot_ldadd = -su2_dot_cxx_flags = -std=c++11 - -if BUILD_NORMAL -su2_dot_ldadd += \ - ../../SU2_CFD/obj/libSU2Core.a \ - ../../Common/lib/libSU2.a -endif - -if BUILD_REVERSE -su2_dot_ldadd += \ - ../../SU2_CFD/obj/libSU2Core_AD.a \ - ../../Common/lib/libSU2_AD.a -endif - -# always link to built dependencies from ./externals -su2_dot_cxx_flags += @su2_externals_INCLUDES@ -su2_dot_ldadd += @su2_externals_LIBS@ -su2_dot_ldadd += @su2_externals_LIBPTHREAD@ - -# if BUILD_MUTATIONPP -su2_dot_cxx_flags += @MUTATIONPP_CXX@ -su2_dot_ldadd += @MUTATIONPP_LD@ -# endif - -if BUILD_NORMAL -___bin_SU2_DOT_SOURCES = ${su2_dot_sources} -___bin_SU2_DOT_CXXFLAGS = ${su2_dot_cxx_flags} -___bin_SU2_DOT_LDADD = ${su2_dot_ldadd} -endif - -if BUILD_REVERSE -___bin_SU2_DOT_AD_SOURCES = ${su2_dot_sources} -___bin_SU2_DOT_AD_CXXFLAGS = @REVERSE_CXX@ ${su2_dot_cxx_flags} -___bin_SU2_DOT_AD_LDADD = @REVERSE_LIBS@ ${su2_dot_ldadd} -endif diff --git a/SU2_DOT/src/SU2_DOT.cpp b/SU2_DOT/src/SU2_DOT.cpp index 75e057d319d..92b063447f6 100644 --- a/SU2_DOT/src/SU2_DOT.cpp +++ b/SU2_DOT/src/SU2_DOT.cpp @@ -2,7 +2,7 @@ * \file SU2_DOT.cpp * \brief Main file of the Gradient Projection Code (SU2_DOT). * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -25,22 +25,12 @@ * License along with SU2. If not, see . */ +#include "../../SU2_DEF/include/drivers/CDiscAdjDeformationDriver.hpp" -#include "../include/SU2_DOT.hpp" -using namespace std; - -int main(int argc, char *argv[]) { - - unsigned short iZone, iInst; - su2double StartTime = 0.0, StopTime = 0.0, UsedTime = 0.0; - +int main(int argc, char* argv[]) { char config_file_name[MAX_STRING_SIZE]; - /*--- OpenMP initialization ---*/ - - omp_initialize(); - - /*--- MPI initialization, and buffer setting ---*/ + /*--- MPI initialization. ---*/ #if defined(HAVE_OMP) && defined(HAVE_MPI) int provided; @@ -48,1009 +38,43 @@ int main(int argc, char *argv[]) { #else SU2_MPI::Init(&argc, &argv); #endif - SU2_MPI::Comm MPICommunicator = SU2_MPI::GetComm(); - - const int rank = SU2_MPI::GetRank(); - const int size = SU2_MPI::GetSize(); - - /*--- AD initialization ---*/ -#ifdef HAVE_OPDI - AD::getGlobalTape().initialize(); -#endif - - /*--- Pointer to different structures that will be used throughout the entire code ---*/ - - CConfig **config_container = nullptr; - CConfig *driver_config = nullptr; - CGeometry ***geometry_container = nullptr; - CSurfaceMovement **surface_movement = nullptr; - CVolumetricMovement **grid_movement = nullptr; - unsigned short *nInst = nullptr; - - /*--- Load in the number of zones and spatial dimensions in the mesh file (if no config - file is specified, default.cfg is used) ---*/ - - if (argc == 2) { strcpy(config_file_name,argv[1]); } - else { strcpy(config_file_name, "default.cfg"); } - - /*--- Read the name and format of the input mesh file to get from the mesh - file the number of zones and dimensions from the numerical grid (required - for variables allocation) ---*/ - - CConfig *config = nullptr; - config = new CConfig(config_file_name, SU2_COMPONENT::SU2_DOT); - - const auto nZone = config->GetnZone(); - - /*--- Definition of the containers per zones ---*/ - - config_container = new CConfig*[nZone] (); - geometry_container = new CGeometry**[nZone] (); - surface_movement = new CSurfaceMovement*[nZone] (); - grid_movement = new CVolumetricMovement*[nZone] (); - - nInst = new unsigned short[nZone]; - driver_config = nullptr; - - for (iZone = 0; iZone < nZone; iZone++) { - nInst[iZone] = 1; - } - - /*--- Initialize the configuration of the driver ---*/ - driver_config = new CConfig(config_file_name, SU2_COMPONENT::SU2_DOT, false); - - /*--- Initialize a char to store the zone filename ---*/ - char zone_file_name[MAX_STRING_SIZE]; - - /*--- Loop over all zones to initialize the various classes. In most - cases, nZone is equal to one. This represents the solution of a partial - differential equation on a single block, unstructured mesh. ---*/ - - for (iZone = 0; iZone < nZone; iZone++) { - - /*--- Definition of the configuration option class for all zones. In this - constructor, the input configuration file is parsed and all options are - read and stored. ---*/ - - if (driver_config->GetnConfigFiles() > 0){ - strcpy(zone_file_name, driver_config->GetConfigFilename(iZone).c_str()); - config_container[iZone] = new CConfig(driver_config, zone_file_name, SU2_COMPONENT::SU2_DOT, iZone, nZone, true); - } - else{ - config_container[iZone] = new CConfig(driver_config, config_file_name, SU2_COMPONENT::SU2_DOT, iZone, nZone, true); - } - config_container[iZone]->SetMPICommunicator(MPICommunicator); - - } - - /*--- Set the multizone part of the problem. ---*/ - if (driver_config->GetMultizone_Problem()){ - for (iZone = 0; iZone < nZone; iZone++) { - /*--- Set the interface markers for multizone ---*/ - config_container[iZone]->SetMultizone(driver_config, config_container); - } - } - - /*--- Loop over all zones to initialize the various classes. In most - cases, nZone is equal to one. This represents the solution of a partial - differential equation on a single block, unstructured mesh. ---*/ - - for (iZone = 0; iZone < nZone; iZone++) { - - /*--- Determine whether or not the FEM solver is used, which decides the - type of geometry classes that are instantiated. ---*/ - const bool fem_solver = config_container[iZone]->GetFEMSolver(); - - /*--- Read the number of instances for each zone ---*/ - - nInst[iZone] = config_container[iZone]->GetnTimeInstances(); - - geometry_container[iZone] = new CGeometry*[nInst[iZone]]; - - for (iInst = 0; iInst < nInst[iZone]; iInst++){ - - /*--- Definition of the geometry class to store the primal grid in the partitioning process. ---*/ - - CGeometry *geometry_aux = nullptr; - - /*--- All ranks process the grid and call ParMETIS for partitioning ---*/ - - geometry_aux = new CPhysicalGeometry(config_container[iZone], iZone, nZone); - - /*--- Color the initial grid and set the send-receive domains (ParMETIS) ---*/ - - if ( fem_solver ) geometry_aux->SetColorFEMGrid_Parallel(config_container[iZone]); - else geometry_aux->SetColorGrid_Parallel(config_container[iZone]); - - /*--- Build the grid data structures using the ParMETIS coloring. ---*/ - - if( fem_solver ) { - switch( config_container[iZone]->GetKind_FEM_Flow() ) { - case DG: { - geometry_container[iZone][iInst] = new CMeshFEM_DG(geometry_aux, config_container[iZone]); - break; - } - } - } - else { - geometry_container[iZone][iInst] = new CPhysicalGeometry(geometry_aux, config_container[iZone]); - } - - /*--- Deallocate the memory of geometry_aux ---*/ - - delete geometry_aux; - - /*--- Add the Send/Receive boundaries ---*/ - - geometry_container[iZone][iInst]->SetSendReceive(config_container[iZone]); - - /*--- Add the Send/Receive boundaries ---*/ - - geometry_container[iZone][iInst]->SetBoundaries(config_container[iZone]); - - /*--- Create the vertex structure (required for MPI) ---*/ - - if (rank == MASTER_NODE) cout << "Identify vertices." << endl; - geometry_container[iZone][iInst]->SetVertex(config_container[iZone]); - - /*--- Store the global to local mapping after preprocessing. ---*/ - - if (rank == MASTER_NODE) cout << "Storing a mapping from global to local point index." << endl; - geometry_container[iZone][iInst]->SetGlobal_to_Local_Point(); - - /* Test for a fem solver, because some more work must be done. */ - - if (fem_solver) { - - /*--- Carry out a dynamic cast to CMeshFEM_DG, such that it is not needed to - define all virtual functions in the base class CGeometry. ---*/ - CMeshFEM_DG *DGMesh = dynamic_cast(geometry_container[iZone][iInst]); - - /*--- Determine the standard elements for the volume elements. ---*/ - if (rank == MASTER_NODE) cout << "Creating standard volume elements." << endl; - DGMesh->CreateStandardVolumeElements(config_container[iZone]); - - /*--- Create the face information needed to compute the contour integral - for the elements in the Discontinuous Galerkin formulation. ---*/ - if (rank == MASTER_NODE) cout << "Creating face information." << endl; - DGMesh->CreateFaces(config_container[iZone]); - } - } - } - - /*--- Set up a timer for performance benchmarking (preprocessing time is included) ---*/ - - StartTime = SU2_MPI::Wtime(); - - for (iZone = 0; iZone < nZone; iZone++) { - - if (rank == MASTER_NODE) - cout << "\n----------------------- Preprocessing computations ----------------------" << endl; - - /*--- Compute elements surrounding points, points surrounding points ---*/ - - if (rank == MASTER_NODE) cout << "Setting local point connectivity." << endl; - geometry_container[iZone][INST_0]->SetPoint_Connectivity(); - - /*--- Check the orientation before computing geometrical quantities ---*/ - - geometry_container[iZone][INST_0]->SetBoundVolume(); - if (config_container[iZone]->GetReorientElements()) { - if (rank == MASTER_NODE) cout << "Checking the numerical grid orientation of the elements." << endl; - geometry_container[iZone][INST_0]->Check_IntElem_Orientation(config_container[iZone]); - geometry_container[iZone][INST_0]->Check_BoundElem_Orientation(config_container[iZone]); - } - - /*--- Create the edge structure ---*/ - - if (rank == MASTER_NODE) cout << "Identify edges and vertices." << endl; - geometry_container[iZone][INST_0]->SetEdges(); geometry_container[iZone][INST_0]->SetVertex(config_container[iZone]); - - /*--- Create the dual control volume structures ---*/ - - if (rank == MASTER_NODE) cout << "Setting the bound control volume structure." << endl; - geometry_container[iZone][INST_0]->SetBoundControlVolume(config_container[ZONE_0], ALLOCATE); - - /*--- Store the global to local mapping after preprocessing. ---*/ - - if (rank == MASTER_NODE) cout << "Storing a mapping from global to local point index." << endl; - geometry_container[iZone][INST_0]->SetGlobal_to_Local_Point(); - - /*--- Create the point-to-point MPI communication structures. ---*/ - - geometry_container[iZone][INST_0]->PreprocessP2PComms(geometry_container[iZone][INST_0], config_container[iZone]); - - /*--- Load the surface sensitivities from file. This is done only - once: if this is an unsteady problem, a time-average of the surface - sensitivities at each node is taken within this routine. ---*/ - - if (!config_container[iZone]->GetDiscrete_Adjoint()) { - if (rank == MASTER_NODE) cout << "Reading surface sensitivities at each node from file." << endl; - geometry_container[iZone][INST_0]->SetBoundSensitivity(config_container[iZone]); - } - else { - if (rank == MASTER_NODE) cout << "Reading volume sensitivities at each node from file." << endl; - grid_movement[iZone] = new CVolumetricMovement(geometry_container[iZone][INST_0], config_container[iZone]); - - /*--- Read in sensitivities from file. ---*/ - if (config_container[ZONE_0]->GetSensitivity_Format() == UNORDERED_ASCII) - geometry_container[iZone][INST_0]->ReadUnorderedSensitivity(config_container[iZone]); - else - geometry_container[iZone][INST_0]->SetSensitivity(config_container[iZone]); + SU2_MPI::Comm comm = SU2_MPI::GetComm(); - if (rank == MASTER_NODE) - cout << "\n---------------------- Mesh sensitivity computation ---------------------" << endl; + /*--- Further initializations are placed in the constructor of CDriverBase, to ensure that they are also seen by the + python wrapper. */ - if(config_container[iZone]->GetDiscrete_Adjoint() && config_container[iZone]->GetSmoothGradient() && - config_container[iZone]->GetSobMode() == ENUM_SOBOLEV_MODUS::MESH_LEVEL) { - DerivativeTreatment_MeshSensitivity(geometry_container[iZone][INST_0], config_container[iZone], grid_movement[iZone]); - } else { - grid_movement[iZone]->SetVolume_Deformation(geometry_container[iZone][INST_0], config_container[iZone], false, true); - } + /*--- Load in the number of zones and spatial dimensions in the mesh file + (if no config file is specified, default.cfg is used). ---*/ - } + if (argc == 2) { + strcpy(config_file_name, argv[1]); + } else { + strcpy(config_file_name, "default.cfg"); } + /*--- Initialize the mesh deformation driver. ---*/ - if (config_container[ZONE_0]->GetDiscrete_Adjoint()) { - if (rank == MASTER_NODE) - cout << "\n------------------------ Mesh sensitivity Output ------------------------" << endl; - SetSensitivity_Files(geometry_container, config_container, nZone); - } - - /*--- Initialize structure to store the gradient ---*/ - su2double** Gradient = new su2double*[config_container[ZONE_0]->GetnDV()]; - - for (auto iDV = 0u; iDV < config_container[ZONE_0]->GetnDV(); iDV++) { - /*--- Initialize to zero ---*/ - Gradient[iDV] = new su2double[config_container[ZONE_0]->GetnDV_Value(iDV)](); - } - - ofstream Gradient_file; - Gradient_file.precision(config->OptionIsSet("OUTPUT_PRECISION") ? config->GetOutput_Precision() : 6); - - /*--- For multizone computations the gradient contributions are summed up and written into one file. ---*/ - for (iZone = 0; iZone < nZone; iZone++){ - if ((config_container[iZone]->GetDesign_Variable(0) != NONE) && - (config_container[iZone]->GetDesign_Variable(0) != SURFACE_FILE)) { - - if (rank == MASTER_NODE) - cout << "\n---------- Start gradient evaluation using sensitivity information ----------" << endl; - - /*--- Definition of the Class for surface deformation ---*/ - - surface_movement[iZone] = new CSurfaceMovement(); - - /*--- Copy coordinates to the surface structure ---*/ - - surface_movement[iZone]->CopyBoundary(geometry_container[iZone][INST_0], config_container[iZone]); - - /*--- If AD mode is enabled we can use it to compute the projection, - * otherwise we use finite differences. ---*/ - - if (config_container[iZone]->GetAD_Mode()) { - if (config_container[iZone]->GetSmoothGradient()) { - DerivativeTreatment_Gradient(geometry_container[iZone][INST_0], config_container[iZone], grid_movement[iZone], surface_movement[iZone] , Gradient); - } else { - SetProjection_AD(geometry_container[iZone][INST_0], config_container[iZone], surface_movement[iZone] , Gradient); - } - } else { - SetProjection_FD(geometry_container[iZone][INST_0], config_container[iZone], surface_movement[iZone] , Gradient); - } - } - } // for iZone - - /*--- Write the gradient to a file ---*/ - - if (rank == MASTER_NODE) - Gradient_file.open(config_container[ZONE_0]->GetObjFunc_Grad_FileName().c_str(), ios::out); - - /*--- Print gradients to screen and writes to file ---*/ - - OutputGradient(Gradient, config_container[ZONE_0], Gradient_file); - - for (auto iDV = 0u; iDV < config_container[ZONE_0]->GetnDV(); iDV++){ - delete [] Gradient[iDV]; - } - delete [] Gradient; - - delete config; - config = nullptr; + CDiscAdjDeformationDriver driver(config_file_name, comm); - if (rank == MASTER_NODE) - cout << "\n------------------------- Solver Postprocessing -------------------------" << endl; + /*--- Preprocess the solver data. ---*/ - if (geometry_container != nullptr) { - for (iZone = 0; iZone < nZone; iZone++) { - if (geometry_container[iZone] != nullptr) { - for (iInst = 0; iInst < nInst[iZone]; iInst++){ - if (geometry_container[iZone][iInst] != nullptr) { - delete geometry_container[iZone][iInst]; - } - } - delete geometry_container[iZone]; - } - } - delete [] geometry_container; - } - if (rank == MASTER_NODE) cout << "Deleted CGeometry container." << endl; - - if (surface_movement != nullptr) { - for (iZone = 0; iZone < nZone; iZone++) { - if (surface_movement[iZone] != nullptr) { - delete surface_movement[iZone]; - } - } - delete [] surface_movement; - } - if (rank == MASTER_NODE) cout << "Deleted CSurfaceMovement class." << endl; - - if (grid_movement != nullptr) { - for (iZone = 0; iZone < nZone; iZone++) { - if (grid_movement[iZone] != nullptr) { - delete grid_movement[iZone]; - } - } - delete [] grid_movement; - } - if (rank == MASTER_NODE) cout << "Deleted CVolumetricMovement class." << endl; + driver.Preprocess(); - delete config; - config = nullptr; - if (config_container != nullptr) { - for (iZone = 0; iZone < nZone; iZone++) { - if (config_container[iZone] != nullptr) { - delete config_container[iZone]; - } - } - delete [] config_container; - } - if (rank == MASTER_NODE) cout << "Deleted CConfig container." << endl; - - /*--- Synchronization point after a single solver iteration. Compute the - wall clock time required. ---*/ + /*--- Launch the main external loop of the solver. ---*/ - StopTime = SU2_MPI::Wtime(); + driver.Run(); - /*--- Compute/print the total time for performance benchmarking. ---*/ + /*--- Postprocess all the containers, close history file, and exit SU2. ---*/ - UsedTime = StopTime-StartTime; - if (rank == MASTER_NODE) { - cout << "\nCompleted in " << fixed << UsedTime << " seconds on "<< size; - if (size == 1) cout << " core." << endl; else cout << " cores." << endl; - } + driver.Finalize(); - /*--- Exit the solver cleanly ---*/ + /*--- Finalize AD. ---*/ - if (rank == MASTER_NODE) - cout << "\n------------------------- Exit Success (SU2_DOT) ------------------------\n" << endl; - - /*--- Finalize AD, if necessary. ---*/ -#ifdef HAVE_OPDI - AD::getGlobalTape().finalize(); -#endif + AD::Finalize(); /*--- Finalize MPI parallelization. ---*/ - SU2_MPI::Finalize(); - /*--- Finalize OpenMP. ---*/ - omp_finalize(); + SU2_MPI::Finalize(); return EXIT_SUCCESS; - -} - -void SetProjection_FD(CGeometry *geometry, CConfig *config, CSurfaceMovement *surface_movement, su2double** Gradient){ - - unsigned short iDV, nDV, iFFDBox, nDV_Value, iMarker, iDim; - unsigned long iVertex, iPoint; - su2double delta_eps, my_Gradient, localGradient, *Normal, dS, *VarCoord, Sensitivity, - dalpha[3], deps[3], dalpha_deps; - bool *UpdatePoint, MoveSurface, Local_MoveSurface; - CFreeFormDefBox **FFDBox; - - int rank = SU2_MPI::GetRank(); - - nDV = config->GetnDV(); - - /*--- Boolean controlling points to be updated ---*/ - - UpdatePoint = new bool[geometry->GetnPoint()]; - - /*--- Definition of the FFD deformation class ---*/ - - unsigned short nFFDBox = MAX_NUMBER_FFD; - FFDBox = new CFreeFormDefBox*[nFFDBox]; - for (iFFDBox = 0; iFFDBox < MAX_NUMBER_FFD; iFFDBox++) FFDBox[iFFDBox] = nullptr; - - for (iDV = 0; iDV < nDV; iDV++){ - nDV_Value = config->GetnDV_Value(iDV); - if (nDV_Value != 1){ - SU2_MPI::Error("The projection using finite differences currently only supports a fixed direction of movement for FFD points.", CURRENT_FUNCTION); - } - } - - /*--- Continuous adjoint gradient computation ---*/ - - if (rank == MASTER_NODE) - cout << "Evaluate functional gradient using Finite Differences." << endl; - - for (iDV = 0; iDV < nDV; iDV++) { - - MoveSurface = true; - Local_MoveSurface = true; - - /*--- Free Form deformation based ---*/ - - if ((config->GetDesign_Variable(iDV) == FFD_CONTROL_POINT_2D) || - (config->GetDesign_Variable(iDV) == FFD_CAMBER_2D) || - (config->GetDesign_Variable(iDV) == FFD_THICKNESS_2D) || - (config->GetDesign_Variable(iDV) == FFD_TWIST_2D) || - (config->GetDesign_Variable(iDV) == FFD_CONTROL_POINT) || - (config->GetDesign_Variable(iDV) == FFD_NACELLE) || - (config->GetDesign_Variable(iDV) == FFD_GULL) || - (config->GetDesign_Variable(iDV) == FFD_TWIST) || - (config->GetDesign_Variable(iDV) == FFD_ROTATION) || - (config->GetDesign_Variable(iDV) == FFD_CAMBER) || - (config->GetDesign_Variable(iDV) == FFD_THICKNESS) || - (config->GetDesign_Variable(iDV) == FFD_ANGLE_OF_ATTACK)) { - - /*--- Read the FFD information in the first iteration ---*/ - - if (iDV == 0) { - - if (rank == MASTER_NODE) - cout << "Read the FFD information from mesh file." << endl; - - /*--- Read the FFD information from the grid file ---*/ - - surface_movement->ReadFFDInfo(geometry, config, FFDBox, config->GetMesh_FileName()); - - /*--- If the FFDBox was not defined in the input file ---*/ - if (!surface_movement->GetFFDBoxDefinition()) { - SU2_MPI::Error("The input grid doesn't have the entire FFD information!", CURRENT_FUNCTION); - } - - for (iFFDBox = 0; iFFDBox < surface_movement->GetnFFDBox(); iFFDBox++) { - - if (rank == MASTER_NODE) cout << "Checking FFD box dimension." << endl; - surface_movement->CheckFFDDimension(geometry, config, FFDBox[iFFDBox], iFFDBox); - - if (rank == MASTER_NODE) cout << "Check the FFD box intersections with the solid surfaces." << endl; - surface_movement->CheckFFDIntersections(geometry, config, FFDBox[iFFDBox], iFFDBox); - - } - - if (rank == MASTER_NODE) - cout <<"-------------------------------------------------------------------------" << endl; - - } - - if (rank == MASTER_NODE) { - cout << endl << "Design variable number "<< iDV <<"." << endl; - cout << "Performing 3D deformation of the surface." << endl; - } - - /*--- Apply the control point change ---*/ - - MoveSurface = false; - - for (iFFDBox = 0; iFFDBox < surface_movement->GetnFFDBox(); iFFDBox++) { - - /*--- Reset FFD box ---*/ - - switch (config->GetDesign_Variable(iDV) ) { - case FFD_CONTROL_POINT_2D : Local_MoveSurface = surface_movement->SetFFDCPChange_2D(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_CAMBER_2D : Local_MoveSurface = surface_movement->SetFFDCamber_2D(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_THICKNESS_2D : Local_MoveSurface = surface_movement->SetFFDThickness_2D(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_TWIST_2D : Local_MoveSurface = surface_movement->SetFFDTwist_2D(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_CONTROL_POINT : Local_MoveSurface = surface_movement->SetFFDCPChange(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_NACELLE : Local_MoveSurface = surface_movement->SetFFDNacelle(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_GULL : Local_MoveSurface = surface_movement->SetFFDGull(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_TWIST : Local_MoveSurface = surface_movement->SetFFDTwist(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_ROTATION : Local_MoveSurface = surface_movement->SetFFDRotation(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_CAMBER : Local_MoveSurface = surface_movement->SetFFDCamber(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_THICKNESS : Local_MoveSurface = surface_movement->SetFFDThickness(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_CONTROL_SURFACE : Local_MoveSurface = surface_movement->SetFFDControl_Surface(geometry, config, FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_ANGLE_OF_ATTACK : Gradient[iDV][0] = config->GetAoA_Sens(); break; - } - - /*--- Recompute cartesian coordinates using the new control points position ---*/ - - if (Local_MoveSurface) { - MoveSurface = true; - surface_movement->SetCartesianCoord(geometry, config, FFDBox[iFFDBox], iFFDBox, true); - } - - } - - } - - /*--- Hicks Henne design variable ---*/ - - else if (config->GetDesign_Variable(iDV) == HICKS_HENNE) { - surface_movement->SetHicksHenne(geometry, config, iDV, true); - } - - /*--- Surface bump design variable ---*/ - - else if (config->GetDesign_Variable(iDV) == SURFACE_BUMP) { - surface_movement->SetSurface_Bump(geometry, config, iDV, true); - } - - /*--- Kulfan (CST) design variable ---*/ - - else if (config->GetDesign_Variable(iDV) == CST) { - surface_movement->SetCST(geometry, config, iDV, true); - } - - /*--- Displacement design variable ---*/ - - else if (config->GetDesign_Variable(iDV) == TRANSLATION) { - surface_movement->SetTranslation(geometry, config, iDV, true); - } - - /*--- Angle of Attack design variable ---*/ - - else if (config->GetDesign_Variable(iDV) == ANGLE_OF_ATTACK) { - Gradient[iDV][0] = config->GetAoA_Sens(); - } - - /*--- Scale design variable ---*/ - - else if (config->GetDesign_Variable(iDV) == SCALE) { - surface_movement->SetScale(geometry, config, iDV, true); - } - - /*--- Rotation design variable ---*/ - - else if (config->GetDesign_Variable(iDV) == ROTATION) { - surface_movement->SetRotation(geometry, config, iDV, true); - } - - /*--- NACA_4Digits design variable ---*/ - - else if (config->GetDesign_Variable(iDV) == NACA_4DIGITS) { - surface_movement->SetNACA_4Digits(geometry, config); - } - - /*--- Parabolic design variable ---*/ - - else if (config->GetDesign_Variable(iDV) == PARABOLIC) { - surface_movement->SetParabolic(geometry, config); - } - - /*--- Design variable not implemented ---*/ - - else { - if (rank == MASTER_NODE) - cout << "Design Variable not implemented yet" << endl; - } - - /*--- Load the delta change in the design variable (finite difference step). ---*/ - - if ((config->GetDesign_Variable(iDV) != ANGLE_OF_ATTACK) && - (config->GetDesign_Variable(iDV) != FFD_ANGLE_OF_ATTACK)) { - - /*--- If the Angle of attack is not involved, reset the value of the gradient ---*/ - - my_Gradient = 0.0; Gradient[iDV][0] = 0.0; - - if (MoveSurface) { - - delta_eps = config->GetDV_Value(iDV); - - for (iPoint = 0; iPoint < geometry->GetnPoint(); iPoint++) - UpdatePoint[iPoint] = true; - - for (iMarker = 0; iMarker < config->GetnMarker_All(); iMarker++) { - if (config->GetMarker_All_DV(iMarker) == YES) { - for (iVertex = 0; iVertex < geometry->nVertex[iMarker]; iVertex++) { - - iPoint = geometry->vertex[iMarker][iVertex]->GetNode(); - if ((iPoint < geometry->GetnPointDomain()) && UpdatePoint[iPoint]) { - - Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); - VarCoord = geometry->vertex[iMarker][iVertex]->GetVarCoord(); - Sensitivity = geometry->vertex[iMarker][iVertex]->GetAuxVar(); - - dS = 0.0; - for (iDim = 0; iDim < geometry->GetnDim(); iDim++) { - dS += Normal[iDim]*Normal[iDim]; - deps[iDim] = VarCoord[iDim] / delta_eps; - } - dS = sqrt(dS); - - dalpha_deps = 0.0; - for (iDim = 0; iDim < geometry->GetnDim(); iDim++) { - dalpha[iDim] = Normal[iDim] / dS; - dalpha_deps -= dalpha[iDim]*deps[iDim]; - } - - my_Gradient += Sensitivity*dalpha_deps; - UpdatePoint[iPoint] = false; - } - } - } - } - } - - SU2_MPI::Allreduce(&my_Gradient, &localGradient, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - Gradient[iDV][0] += localGradient; - } - } - - /*--- Delete memory for parameterization. ---*/ - - if (FFDBox != nullptr) { - for (iFFDBox = 0; iFFDBox < MAX_NUMBER_FFD; iFFDBox++) { - if (FFDBox[iFFDBox] != nullptr) { - delete FFDBox[iFFDBox]; - } - } - delete [] FFDBox; - } - - delete [] UpdatePoint; - -} - - -void SetProjection_AD(CGeometry *geometry, CConfig *config, CSurfaceMovement *surface_movement, su2double** Gradient){ - - su2double *VarCoord = nullptr, Sensitivity, my_Gradient, localGradient, *Normal, Area = 0.0; - unsigned short iDV_Value = 0, iMarker, nMarker, iDim, nDim, iDV, nDV; - unsigned long iVertex, nVertex, iPoint; - - const int rank = SU2_MPI::GetRank(); - - nMarker = config->GetnMarker_All(); - nDim = geometry->GetnDim(); - nDV = config->GetnDV(); - - /*--- Discrete adjoint gradient computation ---*/ - - if (rank == MASTER_NODE) - cout << endl << "Evaluate functional gradient using Algorithmic Differentiation (ZONE " << config->GetiZone() << ")." << endl; - - /*--- Start recording of operations ---*/ - - AD::StartRecording(); - - /*--- Register design variables as input and set them to zero - * (since we want to have the derivative at alpha = 0, i.e. for the current design) ---*/ - - for (iDV = 0; iDV < nDV; iDV++){ - - for (iDV_Value = 0; iDV_Value < config->GetnDV_Value(iDV); iDV_Value++){ - - config->SetDV_Value(iDV, iDV_Value, 0.0); - - AD::RegisterInput(config->GetDV_Value(iDV, iDV_Value)); - } - } - - /*--- Call the surface deformation routine ---*/ - - surface_movement->SetSurface_Deformation(geometry, config); - - /*--- Stop the recording --- */ - - AD::StopRecording(); - - /*--- Create a structure to identify points that have been already visited. - * We need that to make sure to set the sensitivity of surface points only once - * (Markers share points, so we would visit them more than once in the loop over the markers below) ---*/ - - vector visited(geometry->GetnPoint(), false); - - /*--- Initialize the derivatives of the output of the surface deformation routine - * with the discrete adjoints from the CFD solution ---*/ - - for (iMarker = 0; iMarker < nMarker; iMarker++) { - if (config->GetMarker_All_DV(iMarker) == YES) { - nVertex = geometry->nVertex[iMarker]; - for (iVertex = 0; iVertex vertex[iMarker][iVertex]->GetNode(); - if (!visited[iPoint]){ - VarCoord = geometry->vertex[iMarker][iVertex]->GetVarCoord(); - Normal = geometry->vertex[iMarker][iVertex]->GetNormal(); - - Area = 0.0; - for (iDim = 0; iDim < nDim; iDim++){ - Area += Normal[iDim]*Normal[iDim]; - } - Area = sqrt(Area); - - for (iDim = 0; iDim < nDim; iDim++){ - if (config->GetDiscrete_Adjoint()){ - Sensitivity = geometry->GetSensitivity(iPoint, iDim); - } else { - Sensitivity = -Normal[iDim]*geometry->vertex[iMarker][iVertex]->GetAuxVar()/Area; - } - SU2_TYPE::SetDerivative(VarCoord[iDim], SU2_TYPE::GetValue(Sensitivity)); - } - visited[iPoint] = true; - } - } - } - } - - /*--- Compute derivatives and extract gradient ---*/ - - AD::ComputeAdjoint(); - - for (iDV = 0; iDV < nDV; iDV++){ - - for (iDV_Value = 0; iDV_Value < config->GetnDV_Value(iDV); iDV_Value++){ - - my_Gradient = SU2_TYPE::GetDerivative(config->GetDV_Value(iDV, iDV_Value)); - - SU2_MPI::Allreduce(&my_Gradient, &localGradient, 1, MPI_DOUBLE, MPI_SUM, SU2_MPI::GetComm()); - - /*--- Angle of Attack design variable (this is different, - the value comes form the input file) ---*/ - - if ((config->GetDesign_Variable(iDV) == ANGLE_OF_ATTACK) || - (config->GetDesign_Variable(iDV) == FFD_ANGLE_OF_ATTACK)) { - Gradient[iDV][iDV_Value] = config->GetAoA_Sens(); - } - - Gradient[iDV][iDV_Value] += localGradient; - } - } - - AD::Reset(); - -} - -void OutputGradient(su2double** Gradient, CConfig* config, ofstream& Gradient_file){ - - unsigned short nDV, iDV, iDV_Value, nDV_Value; - - int rank = SU2_MPI::GetRank(); - - nDV = config->GetnDV(); - - /*--- Loop through all design variables and their gradients ---*/ - - for (iDV = 0; iDV < nDV; iDV++){ - nDV_Value = config->GetnDV_Value(iDV); - if (rank == MASTER_NODE){ - - /*--- Print the kind of design variable on screen ---*/ - - cout << endl << "Design variable ("; - for (std::map::const_iterator it = Param_Map.begin(); it != Param_Map.end(); ++it ){ - if (it->second == config->GetDesign_Variable(iDV)){ - cout << it->first << ") number "<< iDV << "." << endl; - } - } - - /*--- Print the kind of objective function to screen ---*/ - - for (std::map::const_iterator it = Objective_Map.begin(); it != Objective_Map.end(); ++it ){ - if (it->second == config->GetKind_ObjFunc()){ - cout << it->first << " gradient : "; - if (iDV == 0) Gradient_file << it->first << " gradient " << endl; - } - } - - /*--- Print the gradient to file and screen ---*/ - - for (iDV_Value = 0; iDV_Value < nDV_Value; iDV_Value++){ - cout << Gradient[iDV][iDV_Value]; - if (iDV_Value != nDV_Value-1 ){ - cout << ", "; - } - Gradient_file << Gradient[iDV][iDV_Value] << endl; - } - cout << endl; - cout <<"-------------------------------------------------------------------------" << endl; - } - } -} - - -void SetSensitivity_Files(CGeometry ***geometry, CConfig **config, unsigned short val_nZone) { - - unsigned short iMarker,iDim, nDim, nMarker, nVar; - unsigned long iVertex, iPoint, nPoint, nVertex; - su2double *Normal, Prod, Sens = 0.0, SensDim, Area; - - unsigned short iZone; - - CSolver *solver = nullptr; - COutput *output = nullptr; - - for (iZone = 0; iZone < val_nZone; iZone++) { - - nPoint = geometry[iZone][INST_0]->GetnPoint(); - nDim = geometry[iZone][INST_0]->GetnDim(); - nMarker = config[iZone]->GetnMarker_All(); - nVar = nDim + 1; - - /*--- We create a baseline solver to easily merge the sensitivity information ---*/ - - vector fieldnames; - fieldnames.push_back("\"Point\""); - fieldnames.push_back("\"x\""); - fieldnames.push_back("\"y\""); - if (nDim == 3) { - fieldnames.push_back("\"z\""); - } - fieldnames.push_back("\"Sensitivity_x\""); - fieldnames.push_back("\"Sensitivity_y\""); - if (nDim == 3) { - fieldnames.push_back("\"Sensitivity_z\""); - } - fieldnames.push_back("\"Surface_Sensitivity\""); - - solver = new CBaselineSolver(geometry[iZone][INST_0], config[iZone], nVar+nDim, fieldnames); - - for (iPoint = 0; iPoint < nPoint; iPoint++) { - for (iDim = 0; iDim < nDim; iDim++) { - solver->GetNodes()->SetSolution(iPoint, iDim, geometry[iZone][INST_0]->nodes->GetCoord(iPoint, iDim)); - solver->GetNodes()->SetSolution(iPoint, iDim+nDim, geometry[iZone][INST_0]->GetSensitivity(iPoint, iDim)); - } - } - - /*--- Compute the sensitivity in normal direction ---*/ - - for (iMarker = 0; iMarker < nMarker; iMarker++) { - - if(config[iZone]->GetSolid_Wall(iMarker) || (config[iZone]->GetMarker_All_DV(iMarker) == YES )) { - - nVertex = geometry[iZone][INST_0]->GetnVertex(iMarker); - - for (iVertex = 0; iVertex < nVertex; iVertex++) { - iPoint = geometry[iZone][INST_0]->vertex[iMarker][iVertex]->GetNode(); - Normal = geometry[iZone][INST_0]->vertex[iMarker][iVertex]->GetNormal(); - Prod = 0.0; - Area = 0.0; - for (iDim = 0; iDim < nDim; iDim++) { - - /*--- Retrieve the gradient calculated with discrete adjoint method ---*/ - - SensDim = geometry[iZone][INST_0]->GetSensitivity(iPoint, iDim); - - /*--- Calculate scalar product for projection onto the normal vector ---*/ - - Prod += Normal[iDim]*SensDim; - - Area += Normal[iDim]*Normal[iDim]; - } - - Area = sqrt(Area); - - /*--- Projection of the gradient onto the normal vector of the surface ---*/ - - Sens = Prod/Area; - - solver->GetNodes()->SetSolution(iPoint, 2*nDim, Sens); - - } - } - } - - output = new CBaselineOutput(config[iZone], nDim, solver); - output->PreprocessVolumeOutput(config[iZone]); - output->PreprocessHistoryOutput(config[iZone], false); - - /*--- Load the data --- */ - - output->Load_Data(geometry[iZone][INST_0], config[iZone], &solver); - - /*--- Set the surface filename ---*/ - - output->SetSurface_Filename(config[iZone]->GetSurfSens_FileName()); - - /*--- Set the volume filename ---*/ - - output->SetVolume_Filename(config[iZone]->GetVolSens_FileName()); - - /*--- Write to file ---*/ - - for (unsigned short iFile = 0; iFile < config[iZone]->GetnVolumeOutputFiles(); iFile++){ - auto FileFormat = config[iZone]->GetVolumeOutputFiles(); - if (FileFormat[iFile] != OUTPUT_TYPE::RESTART_ASCII && - FileFormat[iFile] != OUTPUT_TYPE::RESTART_BINARY && - FileFormat[iFile] != OUTPUT_TYPE::CSV) - output->WriteToFile(config[iZone], geometry[iZone][INST_0], FileFormat[iFile]); - } - - /*--- Free memory ---*/ - - delete output; - delete solver; - - } - -} - -void DerivativeTreatment_MeshSensitivity(CGeometry *geometry, CConfig *config, CVolumetricMovement *grid_movement) { - - int rank = SU2_MPI::GetRank(); - - /*--- Warning if choosen smoothing mode is unsupported. - * This is the default option if the user has not specified a mode in the config file. ---*/ - if (config->GetSobMode() == ENUM_SOBOLEV_MODUS::NONE) { - SU2_MPI::Error("Unsupported operation modus for the Sobolev Smoothing Solver.", CURRENT_FUNCTION); - } - - /*-- Construct the smoothing solver and numerics ---*/ - std::unique_ptr solver(new CGradientSmoothingSolver(geometry, config)); - unsigned dim = (config->GetSmoothOnSurface() ? geometry->GetnDim() - 1 : geometry->GetnDim()); - std::unique_ptr numerics(new CGradSmoothing(dim, config)); - - if (rank == MASTER_NODE) cout << "Sobolev Smoothing of derivatives is active." << endl; - - /*--- Apply the smoothing procedure on the mesh level. ---*/ - if (config->GetSobMode() == ENUM_SOBOLEV_MODUS::MESH_LEVEL) { - if (rank == MASTER_NODE) cout << " working on mesh level" << endl; - - /*--- Work with the surface derivatives. ---*/ - if (config->GetSmoothOnSurface()) { - - /*--- Project to surface and then smooth on surface. ---*/ - grid_movement->SetVolume_Deformation(geometry, config, false, true); - - /*--- Get the sensitivities from the geometry class to work with. ---*/ - solver->ReadSensFromGeometry(geometry); - - /*--- Perform the smoothing procedure on all boundaries marked as DV marker. ---*/ - solver->ApplyGradientSmoothingSurface(geometry, numerics.get(), config); - - /*--- After appling the solver write the results back ---*/ - solver->WriteSensToGeometry(geometry); - - /*--- Work with the volume derivatives. ---*/ - } else { - - /*--- Get the sensitivities from the geometry class to work with. ---*/ - solver->ReadSensFromGeometry(geometry); - - solver->ApplyGradientSmoothingVolume(geometry, numerics.get(), config); - - /*--- After appling the solver write the results back ---*/ - solver->WriteSensToGeometry(geometry); - - /*--- Projection is applied after smoothing. ---*/ - grid_movement->SetVolume_Deformation(geometry, config, false, true); - } - - } - -} - -void DerivativeTreatment_Gradient(CGeometry *geometry, CConfig *config, CVolumetricMovement* grid_movement, CSurfaceMovement *surface_movement, su2double** Gradient) { - - int rank = SU2_MPI::GetRank(); - - /*--- Error if choosen smoothing mode is unsupported. - * This is the default option if the user has not specified a mode in the config file. ---*/ - if (config->GetSobMode() == ENUM_SOBOLEV_MODUS::NONE) { - SU2_MPI::Error("Unsupported operation modus for the Sobolev Smoothing Solver.", CURRENT_FUNCTION); - } - - /*-- Construct the smoothing solver and numerics ---*/ - std::unique_ptr solver(new CGradientSmoothingSolver(geometry, config)); - unsigned dim = (config->GetSmoothOnSurface() ? geometry->GetnDim() - 1 : geometry->GetnDim()); - std::unique_ptr numerics(new CGradSmoothing(dim, config)); - - if (rank == MASTER_NODE) cout << "Sobolev Smoothing of derivatives is active." << endl; - - /*--- Get the sensitivities from the geometry class to work with. ---*/ - solver->ReadSensFromGeometry(geometry); - - /*--- Apply the smoothing procedure on the DV level. ---*/ - if (config->GetSobMode() == ENUM_SOBOLEV_MODUS::PARAM_LEVEL_COMPLETE) { - solver->ApplyGradientSmoothingDV(geometry, numerics.get(), surface_movement, grid_movement, config, Gradient); - - /*--- If smoothing already took place on the mesh level, or none is requested, just do standard projection. ---*/ - } else if (config->GetSobMode() == ENUM_SOBOLEV_MODUS::ONLY_GRAD || - config->GetSobMode() == ENUM_SOBOLEV_MODUS::MESH_LEVEL) { - solver->RecordTapeAndCalculateOriginalGradient(geometry, surface_movement, grid_movement, config, Gradient); - } - } diff --git a/SU2_DOT/src/meson.build b/SU2_DOT/src/meson.build index e6a92e38a64..3cda6c961ed 100644 --- a/SU2_DOT/src/meson.build +++ b/SU2_DOT/src/meson.build @@ -1,11 +1,11 @@ -su2_dot_src = ['SU2_DOT.cpp'] +su2_dot_src = 'SU2_DOT.cpp' if get_option('enable-normal') su2_dot = executable('SU2_DOT', su2_dot_src, install: true, - dependencies: [su2_deps, common_dep, su2_cfd_dep], + dependencies: [su2_deps, common_dep, su2_cfd_dep, su2_def_dep], cpp_args :[default_warning_flags, su2_cpp_args]) endif @@ -15,7 +15,7 @@ if get_option('enable-autodiff') su2_dot_ad = executable('SU2_DOT_AD', su2_dot_src, install: true, - dependencies: [su2_deps, codi_dep, commonAD_dep, su2_cfd_dep_ad], - cpp_args : [default_warning_flags, su2_cpp_args, codi_rev_args]) + dependencies: [su2_deps, codi_dep, commonAD_dep, su2_cfd_dep_ad, su2_def_dep_ad], + cpp_args : [default_warning_flags, su2_cpp_args, codi_rev_args]) endif diff --git a/SU2_GEO/bin/.gitignore b/SU2_GEO/bin/.gitignore deleted file mode 100644 index fe891329eff..00000000000 --- a/SU2_GEO/bin/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Do not track compiled execuatables -SU2* diff --git a/SU2_GEO/include/SU2_GEO.hpp b/SU2_GEO/include/SU2_GEO.hpp index 9752149364e..55e4aa2a3fe 100644 --- a/SU2_GEO/include/SU2_GEO.hpp +++ b/SU2_GEO/include/SU2_GEO.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines of the code SU2_GEO. * The subroutines and functions are in the SU2_GEO.cpp file. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,7 +26,6 @@ * License along with SU2. If not, see . */ - #pragma once #include "../../Common/include/parallelization/mpi_structure.hpp" @@ -38,7 +37,7 @@ #include "../../Common/include/geometry/CPhysicalGeometry.hpp" #include "../../Common/include/CConfig.hpp" -#include "../../../Common/include/grid_movement/CSurfaceMovement.hpp" -#include "../../../Common/include/grid_movement/CFreeFormDefBox.hpp" +#include "../../Common/include/grid_movement/CSurfaceMovement.hpp" +#include "../../Common/include/grid_movement/CFreeFormDefBox.hpp" using namespace std; diff --git a/SU2_GEO/obj/Makefile.am b/SU2_GEO/obj/Makefile.am deleted file mode 100644 index 16676446325..00000000000 --- a/SU2_GEO/obj/Makefile.am +++ /dev/null @@ -1,49 +0,0 @@ -################################################################################ -# -# \file Makefile.am -# \brief Makefile for SU2_GEO -# \author M. Colonno, T. Economon, F. Palacios -# \version 7.5.1 "Blackbird" -# -# SU2 Project Website: https://su2code.github.io -# -# The SU2 Project is maintained by the SU2 Foundation -# (http://su2foundation.org) -# -# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) -# -# SU2 is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# SU2 is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with SU2. If not, see . -# -################################################################################ - -AUTOMAKE_OPTIONS = subdir-objects -ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} - -bin_PROGRAMS = ../bin/SU2_GEO - -___bin_SU2_GEO_SOURCES = \ - ../include/SU2_GEO.hpp \ - ../src/SU2_GEO.cpp - -___bin_SU2_GEO_CXXFLAGS = -___bin_SU2_GEO_LDADD = ../../Common/lib/libSU2.a - -# always link to built dependencies from ./externals -___bin_SU2_GEO_CXXFLAGS += @su2_externals_INCLUDES@ -___bin_SU2_GEO_LDADD += @su2_externals_LIBS@ - -# if BUILD_MUTATIONPP -___bin_SU2_GEO_CXXFLAGS += @MUTATIONPP_CXX@ -___bin_SU2_GEO_LDADD += @MUTATIONPP_LD@ -# endif diff --git a/SU2_GEO/src/SU2_GEO.cpp b/SU2_GEO/src/SU2_GEO.cpp index ffe89dd510a..a509fbadac8 100644 --- a/SU2_GEO/src/SU2_GEO.cpp +++ b/SU2_GEO/src/SU2_GEO.cpp @@ -2,7 +2,7 @@ * \file SU2_GEO.cpp * \brief Main file of the Geometry Definition Code (SU2_GEO). * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -25,31 +25,48 @@ * License along with SU2. If not, see . */ - #include "../include/SU2_GEO.hpp" using namespace std; -int main(int argc, char *argv[]) { - +int main(int argc, char* argv[]) { unsigned short iZone, nZone = SINGLE_ZONE; su2double StartTime = 0.0, StopTime = 0.0, UsedTime = 0.0; unsigned short iDV, iFFDBox, iPlane, nPlane, iVar; - su2double *ObjectiveFunc, *ObjectiveFunc_New, *Gradient, delta_eps, - **Plane_P0, **Plane_Normal, - - Fuselage_Volume = 0.0, Fuselage_WettedArea = 0.0, Fuselage_MinWidth = 0.0, Fuselage_MaxWidth = 0.0, Fuselage_MinWaterLineWidth = 0.0, Fuselage_MaxWaterLineWidth = 0.0, Fuselage_MinHeight = 0.0, Fuselage_MaxHeight = 0.0, Fuselage_MaxCurvature = 0.0, - Fuselage_Volume_New = 0.0, Fuselage_WettedArea_New = 0.0, Fuselage_MinWidth_New = 0.0, Fuselage_MaxWidth_New = 0.0, Fuselage_MinWaterLineWidth_New = 0.0, Fuselage_MaxWaterLineWidth_New = 0.0, Fuselage_MinHeight_New = 0.0, Fuselage_MaxHeight_New = 0.0, Fuselage_MaxCurvature_New = 0.0, - Fuselage_Volume_Grad = 0.0, Fuselage_WettedArea_Grad = 0.0, Fuselage_MinWidth_Grad = 0.0, Fuselage_MaxWidth_Grad = 0.0, Fuselage_MinWaterLineWidth_Grad = 0.0, Fuselage_MaxWaterLineWidth_Grad = 0.0, Fuselage_MinHeight_Grad = 0.0, Fuselage_MaxHeight_Grad = 0.0, Fuselage_MaxCurvature_Grad = 0.0, - - Wing_Volume = 0.0, Wing_MinThickness = 0.0, Wing_MaxThickness = 0.0, Wing_MinChord = 0.0, Wing_MaxChord = 0.0, Wing_MinLERadius = 0.0, Wing_MaxLERadius = 0.0, Wing_MinToC = 0.0, Wing_MaxToC = 0.0, Wing_ObjFun_MinToC = 0.0, Wing_MaxTwist = 0.0, Wing_MaxCurvature = 0.0, Wing_MaxDihedral = 0.0, - Wing_Volume_New = 0.0, Wing_MinThickness_New = 0.0, Wing_MaxThickness_New = 0.0, Wing_MinChord_New = 0.0, Wing_MaxChord_New = 0.0, Wing_MinLERadius_New = 0.0, Wing_MaxLERadius_New = 0.0, Wing_MinToC_New = 0.0, Wing_MaxToC_New = 0.0, Wing_ObjFun_MinToC_New = 0.0, Wing_MaxTwist_New = 0.0, Wing_MaxCurvature_New = 0.0, Wing_MaxDihedral_New = 0.0, - Wing_Volume_Grad = 0.0, Wing_MinThickness_Grad = 0.0, Wing_MaxThickness_Grad = 0.0, Wing_MinChord_Grad = 0.0, Wing_MaxChord_Grad = 0.0, Wing_MinLERadius_Grad = 0.0, Wing_MaxLERadius_Grad = 0.0, Wing_MinToC_Grad = 0.0, Wing_MaxToC_Grad = 0.0, Wing_ObjFun_MinToC_Grad = 0.0, Wing_MaxTwist_Grad = 0.0, Wing_MaxCurvature_Grad = 0.0, Wing_MaxDihedral_Grad = 0.0, - - Nacelle_Volume = 0.0, Nacelle_MinThickness = 0.0, Nacelle_MaxThickness = 0.0, Nacelle_MinChord = 0.0, Nacelle_MaxChord = 0.0, Nacelle_MinLERadius = 0.0, Nacelle_MaxLERadius = 0.0, Nacelle_MinToC = 0.0, Nacelle_MaxToC = 0.0, Nacelle_ObjFun_MinToC = 0.0, Nacelle_MaxTwist = 0.0, - Nacelle_Volume_New = 0.0, Nacelle_MinThickness_New = 0.0, Nacelle_MaxThickness_New = 0.0, Nacelle_MinChord_New = 0.0, Nacelle_MaxChord_New = 0.0, Nacelle_MinLERadius_New = 0.0, Nacelle_MaxLERadius_New = 0.0, Nacelle_MinToC_New = 0.0, Nacelle_MaxToC_New = 0.0, Nacelle_ObjFun_MinToC_New = 0.0, Nacelle_MaxTwist_New = 0.0, - Nacelle_Volume_Grad = 0.0, Nacelle_MinThickness_Grad = 0.0, Nacelle_MaxThickness_Grad = 0.0, Nacelle_MinChord_Grad = 0.0, Nacelle_MaxChord_Grad = 0.0, Nacelle_MinLERadius_Grad = 0.0, Nacelle_MaxLERadius_Grad = 0.0, Nacelle_MinToC_Grad = 0.0, Nacelle_MaxToC_Grad = 0.0, Nacelle_ObjFun_MinToC_Grad = 0.0, Nacelle_MaxTwist_Grad = 0.0; - - vector *Xcoord_Airfoil, *Ycoord_Airfoil, *Zcoord_Airfoil, *Variable_Airfoil; + su2double *ObjectiveFunc, *ObjectiveFunc_New, *Gradient, delta_eps, **Plane_P0, **Plane_Normal, + + Fuselage_Volume = 0.0, Fuselage_WettedArea = 0.0, Fuselage_MinWidth = 0.0, Fuselage_MaxWidth = 0.0, + Fuselage_MinWaterLineWidth = 0.0, Fuselage_MaxWaterLineWidth = 0.0, Fuselage_MinHeight = 0.0, + Fuselage_MaxHeight = 0.0, Fuselage_MaxCurvature = 0.0, Fuselage_Volume_New = 0.0, Fuselage_WettedArea_New = 0.0, + Fuselage_MinWidth_New = 0.0, Fuselage_MaxWidth_New = 0.0, Fuselage_MinWaterLineWidth_New = 0.0, + Fuselage_MaxWaterLineWidth_New = 0.0, Fuselage_MinHeight_New = 0.0, Fuselage_MaxHeight_New = 0.0, + Fuselage_MaxCurvature_New = 0.0, Fuselage_Volume_Grad = 0.0, Fuselage_WettedArea_Grad = 0.0, + Fuselage_MinWidth_Grad = 0.0, Fuselage_MaxWidth_Grad = 0.0, Fuselage_MinWaterLineWidth_Grad = 0.0, + Fuselage_MaxWaterLineWidth_Grad = 0.0, Fuselage_MinHeight_Grad = 0.0, Fuselage_MaxHeight_Grad = 0.0, + Fuselage_MaxCurvature_Grad = 0.0, + + Wing_Volume = 0.0, Wing_MinThickness = 0.0, Wing_MaxThickness = 0.0, Wing_MinChord = 0.0, Wing_MaxChord = 0.0, + Wing_MinLERadius = 0.0, Wing_MaxLERadius = 0.0, Wing_MinToC = 0.0, Wing_MaxToC = 0.0, Wing_ObjFun_MinToC = 0.0, + Wing_MaxTwist = 0.0, Wing_MaxCurvature = 0.0, Wing_MaxDihedral = 0.0, Wing_Volume_New = 0.0, + Wing_MinThickness_New = 0.0, Wing_MaxThickness_New = 0.0, Wing_MinChord_New = 0.0, Wing_MaxChord_New = 0.0, + Wing_MinLERadius_New = 0.0, Wing_MaxLERadius_New = 0.0, Wing_MinToC_New = 0.0, Wing_MaxToC_New = 0.0, + Wing_ObjFun_MinToC_New = 0.0, Wing_MaxTwist_New = 0.0, Wing_MaxCurvature_New = 0.0, Wing_MaxDihedral_New = 0.0, + Wing_Volume_Grad = 0.0, Wing_MinThickness_Grad = 0.0, Wing_MaxThickness_Grad = 0.0, Wing_MinChord_Grad = 0.0, + Wing_MaxChord_Grad = 0.0, Wing_MinLERadius_Grad = 0.0, Wing_MaxLERadius_Grad = 0.0, Wing_MinToC_Grad = 0.0, + Wing_MaxToC_Grad = 0.0, Wing_ObjFun_MinToC_Grad = 0.0, Wing_MaxTwist_Grad = 0.0, Wing_MaxCurvature_Grad = 0.0, + Wing_MaxDihedral_Grad = 0.0, + + Nacelle_Volume = 0.0, Nacelle_MinThickness = 0.0, Nacelle_MaxThickness = 0.0, Nacelle_MinChord = 0.0, + Nacelle_MaxChord = 0.0, Nacelle_MinLERadius = 0.0, Nacelle_MaxLERadius = 0.0, Nacelle_MinToC = 0.0, + Nacelle_MaxToC = 0.0, Nacelle_ObjFun_MinToC = 0.0, Nacelle_MaxTwist = 0.0, Nacelle_Volume_New = 0.0, + Nacelle_MinThickness_New = 0.0, Nacelle_MaxThickness_New = 0.0, Nacelle_MinChord_New = 0.0, + Nacelle_MaxChord_New = 0.0, Nacelle_MinLERadius_New = 0.0, Nacelle_MaxLERadius_New = 0.0, + Nacelle_MinToC_New = 0.0, Nacelle_MaxToC_New = 0.0, Nacelle_ObjFun_MinToC_New = 0.0, Nacelle_MaxTwist_New = 0.0, + Nacelle_Volume_Grad = 0.0, Nacelle_MinThickness_Grad = 0.0, Nacelle_MaxThickness_Grad = 0.0, + Nacelle_MinChord_Grad = 0.0, Nacelle_MaxChord_Grad = 0.0, Nacelle_MinLERadius_Grad = 0.0, + Nacelle_MaxLERadius_Grad = 0.0, Nacelle_MinToC_Grad = 0.0, Nacelle_MaxToC_Grad = 0.0, + Nacelle_ObjFun_MinToC_Grad = 0.0, Nacelle_MaxTwist_Grad = 0.0; + + vector*Xcoord_Airfoil, *Ycoord_Airfoil, *Zcoord_Airfoil, *Variable_Airfoil; vector Xcoord_Fan, Ycoord_Fan, Zcoord_Fan; char config_file_name[MAX_STRING_SIZE]; bool Local_MoveSurface, MoveSurface = false; @@ -58,7 +75,7 @@ int main(int argc, char *argv[]) { /*--- MPI initialization ---*/ - SU2_MPI::Init(&argc,&argv); + SU2_MPI::Init(&argc, &argv); SU2_MPI::Comm MPICommunicator = SU2_MPI::GetComm(); rank = SU2_MPI::GetRank(); @@ -66,25 +83,28 @@ int main(int argc, char *argv[]) { /*--- Pointer to different structures that will be used throughout the entire code ---*/ - CConfig **config_container = nullptr; - CGeometry **geometry_container = nullptr; - CSurfaceMovement *surface_movement = nullptr; - CFreeFormDefBox** FFDBox = nullptr; + CConfig** config_container = nullptr; + CGeometry** geometry_container = nullptr; + CSurfaceMovement* surface_movement = nullptr; + CFreeFormDefBox** FFDBox = nullptr; /*--- Load in the number of zones and spatial dimensions in the mesh file (if no config file is specified, default.cfg is used) ---*/ - if (argc == 2) { strcpy(config_file_name,argv[1]); } - else { strcpy(config_file_name, "default.cfg"); } + if (argc == 2) { + strcpy(config_file_name, argv[1]); + } else { + strcpy(config_file_name, "default.cfg"); + } /*--- Read the name and format of the input mesh file to get from the mesh file the number of zones and dimensions from the numerical grid (required for variables allocation) ---*/ - CConfig *config = nullptr; + CConfig* config = nullptr; config = new CConfig(config_file_name, SU2_COMPONENT::SU2_GEO); - nZone = config->GetnZone(); + nZone = config->GetnZone(); /*--- Definition of the containers per zones ---*/ @@ -92,8 +112,8 @@ int main(int argc, char *argv[]) { geometry_container = new CGeometry*[nZone]; for (iZone = 0; iZone < nZone; iZone++) { - config_container[iZone] = nullptr; - geometry_container[iZone] = nullptr; + config_container[iZone] = nullptr; + geometry_container[iZone] = nullptr; } /*--- Loop over all zones to initialize the various classes. In most @@ -101,7 +121,6 @@ int main(int argc, char *argv[]) { differential equation on a single block, unstructured mesh. ---*/ for (iZone = 0; iZone < nZone; iZone++) { - /*--- Definition of the configuration option class for all zones. In this constructor, the input configuration file is parsed and all options are read and stored. ---*/ @@ -111,7 +130,7 @@ int main(int argc, char *argv[]) { /*--- Definition of the geometry class to store the primal grid in the partitioning process. ---*/ - CGeometry *geometry_aux = nullptr; + CGeometry* geometry_aux = nullptr; /*--- All ranks process the grid and call ParMETIS for partitioning ---*/ @@ -136,7 +155,6 @@ int main(int argc, char *argv[]) { /*--- Add the Send/Receive boundaries ---*/ geometry_container[iZone]->SetBoundaries(config_container[iZone]); - } bool tabTecplot = config_container[ZONE_0]->GetTabular_FileFormat() == TAB_OUTPUT::TAB_TECPLOT; @@ -148,12 +166,14 @@ int main(int argc, char *argv[]) { /*--- Evaluation of the objective function ---*/ if (rank == MASTER_NODE) - cout << endl <<"----------------------- Preprocessing computations ----------------------" << endl; + cout << endl << "----------------------- Preprocessing computations ----------------------" << endl; /*--- Set the number of sections, and allocate the memory ---*/ - if (geometry_container[ZONE_0]->GetnDim() == 2) nPlane = 1; - else nPlane = config_container[ZONE_0]->GetnLocationStations(); + if (geometry_container[ZONE_0]->GetnDim() == 2) + nPlane = 1; + else + nPlane = config_container[ZONE_0]->GetnLocationStations(); Xcoord_Airfoil = new vector[nPlane]; Ycoord_Airfoil = new vector[nPlane]; @@ -162,38 +182,38 @@ int main(int argc, char *argv[]) { Plane_P0 = new su2double*[nPlane]; Plane_Normal = new su2double*[nPlane]; - for(iPlane = 0; iPlane < nPlane; iPlane++ ) { + for (iPlane = 0; iPlane < nPlane; iPlane++) { Plane_P0[iPlane] = new su2double[3]; Plane_Normal[iPlane] = new su2double[3]; } - ObjectiveFunc = new su2double[nPlane*20]; - ObjectiveFunc_New = new su2double[nPlane*20]; - Gradient = new su2double[nPlane*20]; + ObjectiveFunc = new su2double[nPlane * 20]; + ObjectiveFunc_New = new su2double[nPlane * 20]; + Gradient = new su2double[nPlane * 20]; - for (iVar = 0; iVar < nPlane*20; iVar++) { + for (iVar = 0; iVar < nPlane * 20; iVar++) { ObjectiveFunc[iVar] = 0.0; ObjectiveFunc_New[iVar] = 0.0; Gradient[iVar] = 0.0; } - /*--- Compute elements surrounding points, points surrounding points ---*/ - if (rank == MASTER_NODE) cout << "Setting local point connectivity." <SetPoint_Connectivity(); /*--- Check the orientation before computing geometrical quantities ---*/ if (config_container[ZONE_0]->GetReorientElements()) { - if (rank == MASTER_NODE) cout << "Checking the numerical grid orientation of the interior elements." <Check_IntElem_Orientation(config_container[ZONE_0]); } /*--- Create the edge structure ---*/ - if (rank == MASTER_NODE) cout << "Identify edges and vertices." <SetEdges(); geometry_container[ZONE_0]->SetVertex(config_container[ZONE_0]); + if (rank == MASTER_NODE) cout << "Identify edges and vertices." << endl; + geometry_container[ZONE_0]->SetEdges(); + geometry_container[ZONE_0]->SetVertex(config_container[ZONE_0]); /*--- Create the dual control volume structures ---*/ @@ -218,37 +238,43 @@ int main(int argc, char *argv[]) { if (rank == MASTER_NODE) cout << "Set plane structure." << endl; if (geometry_container[ZONE_0]->GetnDim() == 2) { - Plane_Normal[0][0] = 0.0; Plane_P0[0][0] = 0.0; - Plane_Normal[0][1] = 1.0; Plane_P0[0][1] = 0.0; - Plane_Normal[0][2] = 0.0; Plane_P0[0][2] = 0.0; - } - else if (geometry_container[ZONE_0]->GetnDim() == 3) { + Plane_Normal[0][0] = 0.0; + Plane_P0[0][0] = 0.0; + Plane_Normal[0][1] = 1.0; + Plane_P0[0][1] = 0.0; + Plane_Normal[0][2] = 0.0; + Plane_P0[0][2] = 0.0; + } else if (geometry_container[ZONE_0]->GetnDim() == 3) { for (iPlane = 0; iPlane < nPlane; iPlane++) { - Plane_Normal[iPlane][0] = 0.0; Plane_P0[iPlane][0] = 0.0; - Plane_Normal[iPlane][1] = 0.0; Plane_P0[iPlane][1] = 0.0; - Plane_Normal[iPlane][2] = 0.0; Plane_P0[iPlane][2] = 0.0; + Plane_Normal[iPlane][0] = 0.0; + Plane_P0[iPlane][0] = 0.0; + Plane_Normal[iPlane][1] = 0.0; + Plane_P0[iPlane][1] = 0.0; + Plane_Normal[iPlane][2] = 0.0; + Plane_P0[iPlane][2] = 0.0; if (config_container[ZONE_0]->GetGeo_Description() == FUSELAGE) { Plane_Normal[iPlane][0] = 1.0; Plane_P0[iPlane][0] = config_container[ZONE_0]->GetLocationStations(iPlane); - } - else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { + } else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { Plane_Normal[iPlane][0] = 0.0; - Plane_Normal[iPlane][1] = -sin(config_container[ZONE_0]->GetLocationStations(iPlane)*PI_NUMBER/180.0); - Plane_Normal[iPlane][2] = cos(config_container[ZONE_0]->GetLocationStations(iPlane)*PI_NUMBER/180.0); + Plane_Normal[iPlane][1] = -sin(config_container[ZONE_0]->GetLocationStations(iPlane) * PI_NUMBER / 180.0); + Plane_Normal[iPlane][2] = cos(config_container[ZONE_0]->GetLocationStations(iPlane) * PI_NUMBER / 180.0); /*--- Apply tilt angle to the plane ---*/ - su2double Tilt_Angle = config_container[ZONE_0]->GetNacelleLocation(3)*PI_NUMBER/180; - su2double Plane_NormalX_Tilt = Plane_Normal[iPlane][0]*cos(Tilt_Angle) + Plane_Normal[iPlane][2]*sin(Tilt_Angle); + su2double Tilt_Angle = config_container[ZONE_0]->GetNacelleLocation(3) * PI_NUMBER / 180; + su2double Plane_NormalX_Tilt = + Plane_Normal[iPlane][0] * cos(Tilt_Angle) + Plane_Normal[iPlane][2] * sin(Tilt_Angle); su2double Plane_NormalY_Tilt = Plane_Normal[iPlane][1]; - su2double Plane_NormalZ_Tilt = Plane_Normal[iPlane][2]*cos(Tilt_Angle) - Plane_Normal[iPlane][0]*sin(Tilt_Angle); + su2double Plane_NormalZ_Tilt = + Plane_Normal[iPlane][2] * cos(Tilt_Angle) - Plane_Normal[iPlane][0] * sin(Tilt_Angle); /*--- Apply toe angle to the plane ---*/ - su2double Toe_Angle = config_container[ZONE_0]->GetNacelleLocation(4)*PI_NUMBER/180; - su2double Plane_NormalX_Tilt_Toe = Plane_NormalX_Tilt*cos(Toe_Angle) - Plane_NormalY_Tilt*sin(Toe_Angle); - su2double Plane_NormalY_Tilt_Toe = Plane_NormalX_Tilt*sin(Toe_Angle) + Plane_NormalY_Tilt*cos(Toe_Angle); + su2double Toe_Angle = config_container[ZONE_0]->GetNacelleLocation(4) * PI_NUMBER / 180; + su2double Plane_NormalX_Tilt_Toe = Plane_NormalX_Tilt * cos(Toe_Angle) - Plane_NormalY_Tilt * sin(Toe_Angle); + su2double Plane_NormalY_Tilt_Toe = Plane_NormalX_Tilt * sin(Toe_Angle) + Plane_NormalY_Tilt * cos(Toe_Angle); su2double Plane_NormalZ_Tilt_Toe = Plane_NormalZ_Tilt; /*--- Update normal vector ---*/ @@ -262,321 +288,432 @@ int main(int argc, char *argv[]) { Plane_P0[iPlane][0] = config_container[ZONE_0]->GetNacelleLocation(0); Plane_P0[iPlane][1] = config_container[ZONE_0]->GetNacelleLocation(1); Plane_P0[iPlane][2] = config_container[ZONE_0]->GetNacelleLocation(2); - } - else { + } else { Plane_Normal[iPlane][1] = 1.0; Plane_P0[iPlane][1] = config_container[ZONE_0]->GetLocationStations(iPlane); } - } } /*--- Compute the wing and fan description (only 3D). ---*/ if (geometry_container[ZONE_0]->GetnDim() == 3) { - if (config_container[ZONE_0]->GetGeo_Description() == FUSELAGE) { - if (rank == MASTER_NODE) { cout << "Computing the fuselage continuous description." << endl << endl; } - geometry_container[ZONE_0]->Compute_Fuselage(config_container[ZONE_0], true, - Fuselage_Volume, Fuselage_WettedArea, Fuselage_MinWidth, Fuselage_MaxWidth, - Fuselage_MinWaterLineWidth, Fuselage_MaxWaterLineWidth, - Fuselage_MinHeight, Fuselage_MaxHeight, + geometry_container[ZONE_0]->Compute_Fuselage(config_container[ZONE_0], true, Fuselage_Volume, Fuselage_WettedArea, + Fuselage_MinWidth, Fuselage_MaxWidth, Fuselage_MinWaterLineWidth, + Fuselage_MaxWaterLineWidth, Fuselage_MinHeight, Fuselage_MaxHeight, Fuselage_MaxCurvature); /*--- Screen output for the wing definition ---*/ if (rank == MASTER_NODE) { - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Fuselage volume: " << Fuselage_Volume << " in^3. "; - else cout << "Fuselage volume: " << Fuselage_Volume << " m^3. "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Fuselage wetted area: " << Fuselage_WettedArea << " in^2. " << endl; - else cout << "Fuselage wetted area: " << Fuselage_WettedArea << " m^2. " << endl; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Fuselage min. width: " << Fuselage_MinWidth << " in. "; - else cout << "Fuselage min. width: " << Fuselage_MinWidth << " m. "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Fuselage max. width: " << Fuselage_MaxWidth << " in. " << endl; - else cout << "Fuselage max. width: " << Fuselage_MaxWidth << " m. " << endl; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Fuselage min. waterline width: " << Fuselage_MinWaterLineWidth << " in. "; - else cout << "Fuselage min. waterline width: " << Fuselage_MinWaterLineWidth << " m. "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Fuselage max. waterline width: " << Fuselage_MaxWaterLineWidth << " in. " << endl; - else cout << "Fuselage max. waterline width: " << Fuselage_MaxWaterLineWidth << " m. " << endl; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Fuselage min. height: " << Fuselage_MinHeight << " in. "; - else cout << "Fuselage min. height: " << Fuselage_MinHeight << " m. "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Fuselage max. height: " << Fuselage_MaxHeight << " in. " << endl; - else cout << "Fuselage max. height: " << Fuselage_MaxHeight << " m. " << endl; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Fuselage max. curvature: " << Fuselage_MaxCurvature << " 1/in. " << endl; - else cout << "Fuselage max. curvature: " << Fuselage_MaxCurvature << " 1/m. " << endl; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Fuselage volume: " << Fuselage_Volume << " in^3. "; + else + cout << "Fuselage volume: " << Fuselage_Volume << " m^3. "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Fuselage wetted area: " << Fuselage_WettedArea << " in^2. " << endl; + else + cout << "Fuselage wetted area: " << Fuselage_WettedArea << " m^2. " << endl; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Fuselage min. width: " << Fuselage_MinWidth << " in. "; + else + cout << "Fuselage min. width: " << Fuselage_MinWidth << " m. "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Fuselage max. width: " << Fuselage_MaxWidth << " in. " << endl; + else + cout << "Fuselage max. width: " << Fuselage_MaxWidth << " m. " << endl; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Fuselage min. waterline width: " << Fuselage_MinWaterLineWidth << " in. "; + else + cout << "Fuselage min. waterline width: " << Fuselage_MinWaterLineWidth << " m. "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Fuselage max. waterline width: " << Fuselage_MaxWaterLineWidth << " in. " << endl; + else + cout << "Fuselage max. waterline width: " << Fuselage_MaxWaterLineWidth << " m. " << endl; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Fuselage min. height: " << Fuselage_MinHeight << " in. "; + else + cout << "Fuselage min. height: " << Fuselage_MinHeight << " m. "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Fuselage max. height: " << Fuselage_MaxHeight << " in. " << endl; + else + cout << "Fuselage max. height: " << Fuselage_MaxHeight << " m. " << endl; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Fuselage max. curvature: " << Fuselage_MaxCurvature << " 1/in. " << endl; + else + cout << "Fuselage max. curvature: " << Fuselage_MaxCurvature << " 1/m. " << endl; } } else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { - if (rank == MASTER_NODE) { cout << "Computing the nacelle continuous description." << endl << endl; } - geometry_container[ZONE_0]->Compute_Nacelle(config_container[ZONE_0], true, - Nacelle_Volume, Nacelle_MinThickness, Nacelle_MaxThickness, Nacelle_MinChord, Nacelle_MaxChord, - Nacelle_MinLERadius, Nacelle_MaxLERadius, Nacelle_MinToC, Nacelle_MaxToC, Nacelle_ObjFun_MinToC, - Nacelle_MaxTwist); + geometry_container[ZONE_0]->Compute_Nacelle(config_container[ZONE_0], true, Nacelle_Volume, Nacelle_MinThickness, + Nacelle_MaxThickness, Nacelle_MinChord, Nacelle_MaxChord, + Nacelle_MinLERadius, Nacelle_MaxLERadius, Nacelle_MinToC, + Nacelle_MaxToC, Nacelle_ObjFun_MinToC, Nacelle_MaxTwist); /*--- Screen output for the wing definition ---*/ if (rank == MASTER_NODE) { - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Nacelle volume: " << Nacelle_Volume << " in^3. "; - else cout << "Nacelle volume: " << Nacelle_Volume << " m^3. "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Nacelle min. thickness: " << Nacelle_MinThickness << " in. "; - else cout << "Nacelle min. thickness: " << Nacelle_MinThickness << " m. "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Nacelle max. thickness: " << Nacelle_MaxThickness << " in. " << endl; - else cout << "Nacelle max. thickness: " << Nacelle_MaxThickness << " m. " << endl; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Nacelle min. chord: " << Nacelle_MinChord << " in. "; - else cout << "Nacelle min. chord: " << Nacelle_MinChord << " m. "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Nacelle max. chord: " << Nacelle_MaxChord << " in. "; - else cout << "Nacelle max. chord: " << Nacelle_MaxChord << " m. "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Nacelle min. LE radius: " << Nacelle_MinLERadius << " 1/in. "; - else cout << "Nacelle min. LE radius: " << Nacelle_MinLERadius << " 1/m. "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Nacelle max. LE radius: " << Nacelle_MaxLERadius << " 1/in. " << endl; - else cout << "Nacelle max. LE radius: " << Nacelle_MaxLERadius << " 1/m. " << endl; - cout << "Nacelle min. ToC: " << Nacelle_MinToC << ". "; - cout << "Nacelle max. ToC: " << Nacelle_MaxToC << ". "; - cout << "Nacelle delta ToC: " << Nacelle_ObjFun_MinToC << ". "; - cout << "Nacelle max. twist: " << Nacelle_MaxTwist << " deg. "<< endl; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Nacelle volume: " << Nacelle_Volume << " in^3. "; + else + cout << "Nacelle volume: " << Nacelle_Volume << " m^3. "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Nacelle min. thickness: " << Nacelle_MinThickness << " in. "; + else + cout << "Nacelle min. thickness: " << Nacelle_MinThickness << " m. "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Nacelle max. thickness: " << Nacelle_MaxThickness << " in. " << endl; + else + cout << "Nacelle max. thickness: " << Nacelle_MaxThickness << " m. " << endl; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Nacelle min. chord: " << Nacelle_MinChord << " in. "; + else + cout << "Nacelle min. chord: " << Nacelle_MinChord << " m. "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Nacelle max. chord: " << Nacelle_MaxChord << " in. "; + else + cout << "Nacelle max. chord: " << Nacelle_MaxChord << " m. "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Nacelle min. LE radius: " << Nacelle_MinLERadius << " 1/in. "; + else + cout << "Nacelle min. LE radius: " << Nacelle_MinLERadius << " 1/m. "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Nacelle max. LE radius: " << Nacelle_MaxLERadius << " 1/in. " << endl; + else + cout << "Nacelle max. LE radius: " << Nacelle_MaxLERadius << " 1/m. " << endl; + cout << "Nacelle min. ToC: " << Nacelle_MinToC << ". "; + cout << "Nacelle max. ToC: " << Nacelle_MaxToC << ". "; + cout << "Nacelle delta ToC: " << Nacelle_ObjFun_MinToC << ". "; + cout << "Nacelle max. twist: " << Nacelle_MaxTwist << " deg. " << endl; } } else { - if (rank == MASTER_NODE) { cout << "Computing the wing continuous description." << endl << endl; } - geometry_container[ZONE_0]->Compute_Wing(config_container[ZONE_0], true, - Wing_Volume, Wing_MinThickness, Wing_MaxThickness, Wing_MinChord, Wing_MaxChord, - Wing_MinLERadius, Wing_MaxLERadius, Wing_MinToC, Wing_MaxToC, Wing_ObjFun_MinToC, + geometry_container[ZONE_0]->Compute_Wing(config_container[ZONE_0], true, Wing_Volume, Wing_MinThickness, + Wing_MaxThickness, Wing_MinChord, Wing_MaxChord, Wing_MinLERadius, + Wing_MaxLERadius, Wing_MinToC, Wing_MaxToC, Wing_ObjFun_MinToC, Wing_MaxTwist, Wing_MaxCurvature, Wing_MaxDihedral); /*--- Screen output for the wing definition ---*/ if (rank == MASTER_NODE) { - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Wing volume: " << Wing_Volume << " in^3. "; - else cout << "Wing volume: " << Wing_Volume << " m^3. "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Wing min. thickness: " << Wing_MinThickness << " in. "; - else cout << "Wing min. thickness: " << Wing_MinThickness << " m. "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Wing max. thickness: " << Wing_MaxThickness << " in. " << endl; - else cout << "Wing max. thickness: " << Wing_MaxThickness << " m. " << endl; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Wing min. chord: " << Wing_MinChord << " in. "; - else cout << "Wing min. chord: " << Wing_MinChord << " m. "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Wing max. chord: " << Wing_MaxChord << " in. "; - else cout << "Wing max. chord: " << Wing_MaxChord << " m. "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Wing min. LE radius: " << Wing_MinLERadius << " 1/in. "; - else cout << "Wing min. LE radius: " << Wing_MinLERadius << " 1/m. "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Wing max. LE radius: " << Wing_MaxLERadius << " 1/in. " << endl; - else cout << "Wing max. LE radius: " << Wing_MaxLERadius << " 1/m. " << endl; - cout << "Wing min. ToC: " << Wing_MinToC << ". "; - cout << "Wing max. ToC: " << Wing_MaxToC << ". "; - cout << "Wing delta ToC: " << Wing_ObjFun_MinToC << ". "; - cout << "Wing max. twist: " << Wing_MaxTwist << " deg. "<< endl; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Wing max. curvature: " << Wing_MaxCurvature << " 1/in. "; - else cout << "Wing max. curvature: " << Wing_MaxCurvature << " 1/m. "; - cout << "Wing max. dihedral: " << Wing_MaxDihedral << " deg." << endl; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Wing volume: " << Wing_Volume << " in^3. "; + else + cout << "Wing volume: " << Wing_Volume << " m^3. "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Wing min. thickness: " << Wing_MinThickness << " in. "; + else + cout << "Wing min. thickness: " << Wing_MinThickness << " m. "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Wing max. thickness: " << Wing_MaxThickness << " in. " << endl; + else + cout << "Wing max. thickness: " << Wing_MaxThickness << " m. " << endl; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Wing min. chord: " << Wing_MinChord << " in. "; + else + cout << "Wing min. chord: " << Wing_MinChord << " m. "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Wing max. chord: " << Wing_MaxChord << " in. "; + else + cout << "Wing max. chord: " << Wing_MaxChord << " m. "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Wing min. LE radius: " << Wing_MinLERadius << " 1/in. "; + else + cout << "Wing min. LE radius: " << Wing_MinLERadius << " 1/m. "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Wing max. LE radius: " << Wing_MaxLERadius << " 1/in. " << endl; + else + cout << "Wing max. LE radius: " << Wing_MaxLERadius << " 1/m. " << endl; + cout << "Wing min. ToC: " << Wing_MinToC << ". "; + cout << "Wing max. ToC: " << Wing_MaxToC << ". "; + cout << "Wing delta ToC: " << Wing_ObjFun_MinToC << ". "; + cout << "Wing max. twist: " << Wing_MaxTwist << " deg. " << endl; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Wing max. curvature: " << Wing_MaxCurvature << " 1/in. "; + else + cout << "Wing max. curvature: " << Wing_MaxCurvature << " 1/m. "; + cout << "Wing max. dihedral: " << Wing_MaxDihedral << " deg." << endl; } - } - } for (iPlane = 0; iPlane < nPlane; iPlane++) { - - geometry_container[ZONE_0]->ComputeAirfoil_Section(Plane_P0[iPlane], Plane_Normal[iPlane], -1E6, 1E6, -1E6, 1E6, -1E6, 1E6, nullptr, - Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane], - Variable_Airfoil[iPlane], true, config_container[ZONE_0]); + geometry_container[ZONE_0]->ComputeAirfoil_Section( + Plane_P0[iPlane], Plane_Normal[iPlane], -1E6, 1E6, -1E6, 1E6, -1E6, 1E6, nullptr, Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane], Variable_Airfoil[iPlane], true, config_container[ZONE_0]); } if (rank == MASTER_NODE) - cout << endl <<"-------------------- Objective function evaluation ----------------------" << endl; + cout << endl << "-------------------- Objective function evaluation ----------------------" << endl; if (rank == MASTER_NODE) { - /*--- Evaluate objective function ---*/ for (iPlane = 0; iPlane < nPlane; iPlane++) { - if (Xcoord_Airfoil[iPlane].size() > 1) { - - cout << "\nStation " << (iPlane+1); + cout << "\nStation " << (iPlane + 1); if (config_container[ZONE_0]->GetGeo_Description() == FUSELAGE) { - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << ". XCoord: " << Plane_P0[iPlane][0] << " in, "; - else cout << ". XCoord: " << Plane_P0[iPlane][0] << " m, "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << ". XCoord: " << Plane_P0[iPlane][0] << " in, "; + else + cout << ". XCoord: " << Plane_P0[iPlane][0] << " m, "; } if (config_container[ZONE_0]->GetGeo_Description() == WING) { - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << ". YCoord: " << Plane_P0[iPlane][1] << " in, "; - else cout << ". YCoord: " << Plane_P0[iPlane][1] << " m, "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << ". YCoord: " << Plane_P0[iPlane][1] << " in, "; + else + cout << ". YCoord: " << Plane_P0[iPlane][1] << " m, "; } if (config_container[ZONE_0]->GetGeo_Description() == TWOD_AIRFOIL) { - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << ". ZCoord: " << Plane_P0[iPlane][2] << " in, "; - else cout << ". ZCoord: " << Plane_P0[iPlane][2] << " m, "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << ". ZCoord: " << Plane_P0[iPlane][2] << " in, "; + else + cout << ". ZCoord: " << Plane_P0[iPlane][2] << " m, "; } - if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) cout << ". Theta: " << atan2(Plane_Normal[iPlane][1], -Plane_Normal[iPlane][2])/PI_NUMBER*180 + 180 << " deg, "; + if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) + cout << ". Theta: " << atan2(Plane_Normal[iPlane][1], -Plane_Normal[iPlane][2]) / PI_NUMBER * 180 + 180 + << " deg, "; if (config_container[ZONE_0]->GetGeo_Description() == FUSELAGE) { - ObjectiveFunc[0*nPlane+iPlane] = geometry_container[ZONE_0]->Compute_Area(Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - ObjectiveFunc[1*nPlane+iPlane] = geometry_container[ZONE_0]->Compute_Length(Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - ObjectiveFunc[2*nPlane+iPlane] = geometry_container[ZONE_0]->Compute_Width(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - ObjectiveFunc[3*nPlane+iPlane] = geometry_container[ZONE_0]->Compute_WaterLineWidth(Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - ObjectiveFunc[4*nPlane+iPlane] = geometry_container[ZONE_0]->Compute_Height(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Area: " << ObjectiveFunc[0*nPlane+iPlane] << " in^2, "; - else cout << "Area: " << ObjectiveFunc[0*nPlane+iPlane] << " m^2, "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Length: " << ObjectiveFunc[1*nPlane+iPlane] << " in, "; - else cout << "Length: " << ObjectiveFunc[1*nPlane+iPlane] << " m, "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Width: " << ObjectiveFunc[2*nPlane+iPlane] << " in, "; - else cout << "Width: " << ObjectiveFunc[2*nPlane+iPlane] << " m, "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Waterline width: " << ObjectiveFunc[3*nPlane+iPlane] << " in, "; - else cout << "Waterline width: " << ObjectiveFunc[3*nPlane+iPlane] << " m, "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Height: " << ObjectiveFunc[4*nPlane+iPlane] << " in."; - else cout << "Height: " << ObjectiveFunc[4*nPlane+iPlane] << " m."; - } - else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { - ObjectiveFunc[0*nPlane+iPlane] = geometry_container[ZONE_0]->Compute_Area(Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - ObjectiveFunc[1*nPlane+iPlane] = geometry_container[ZONE_0]->Compute_MaxThickness(Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - ObjectiveFunc[2*nPlane+iPlane] = geometry_container[ZONE_0]->Compute_Chord(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - ObjectiveFunc[3*nPlane+iPlane] = geometry_container[ZONE_0]->Compute_LERadius(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - ObjectiveFunc[4*nPlane+iPlane] = ObjectiveFunc[1*nPlane+iPlane]/ObjectiveFunc[2*nPlane+iPlane]; - ObjectiveFunc[5*nPlane+iPlane] = geometry_container[ZONE_0]->Compute_Twist(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Area: " << ObjectiveFunc[0*nPlane+iPlane] << " in^2, "; - else cout << "Area: " << ObjectiveFunc[0*nPlane+iPlane] << " m^2, "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Thickness: " << ObjectiveFunc[1*nPlane+iPlane] << " in, " << endl; - else cout << "Thickness: " << ObjectiveFunc[1*nPlane+iPlane] << " m, " << endl; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Chord: " << ObjectiveFunc[2*nPlane+iPlane] << " in, "; - else cout << "Chord: " << ObjectiveFunc[2*nPlane+iPlane] << " m, "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "LE radius: " << ObjectiveFunc[3*nPlane+iPlane] << " 1/in, "; - else cout << "LE radius: " << ObjectiveFunc[3*nPlane+iPlane] << " 1/m, "; - cout << "ToC: " << ObjectiveFunc[4*nPlane+iPlane] << ", "; - if (geometry_container[ZONE_0]->GetnDim() == 2) cout << "Alpha: " << ObjectiveFunc[5*nPlane+iPlane] <<" deg."; - else if (geometry_container[ZONE_0]->GetnDim() == 3) cout << "Twist angle: " << ObjectiveFunc[5*nPlane+iPlane] <<" deg."; + ObjectiveFunc[0 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Area( + Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + ObjectiveFunc[1 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Length( + Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + ObjectiveFunc[2 * nPlane + iPlane] = + geometry_container[ZONE_0]->Compute_Width(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + ObjectiveFunc[3 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_WaterLineWidth( + Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + ObjectiveFunc[4 * nPlane + iPlane] = + geometry_container[ZONE_0]->Compute_Height(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Area: " << ObjectiveFunc[0 * nPlane + iPlane] << " in^2, "; + else + cout << "Area: " << ObjectiveFunc[0 * nPlane + iPlane] << " m^2, "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Length: " << ObjectiveFunc[1 * nPlane + iPlane] << " in, "; + else + cout << "Length: " << ObjectiveFunc[1 * nPlane + iPlane] << " m, "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Width: " << ObjectiveFunc[2 * nPlane + iPlane] << " in, "; + else + cout << "Width: " << ObjectiveFunc[2 * nPlane + iPlane] << " m, "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Waterline width: " << ObjectiveFunc[3 * nPlane + iPlane] << " in, "; + else + cout << "Waterline width: " << ObjectiveFunc[3 * nPlane + iPlane] << " m, "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Height: " << ObjectiveFunc[4 * nPlane + iPlane] << " in."; + else + cout << "Height: " << ObjectiveFunc[4 * nPlane + iPlane] << " m."; + } else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { + ObjectiveFunc[0 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Area( + Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + ObjectiveFunc[1 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_MaxThickness( + Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + ObjectiveFunc[2 * nPlane + iPlane] = + geometry_container[ZONE_0]->Compute_Chord(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + ObjectiveFunc[3 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_LERadius( + Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], + Zcoord_Airfoil[iPlane]); + ObjectiveFunc[4 * nPlane + iPlane] = ObjectiveFunc[1 * nPlane + iPlane] / ObjectiveFunc[2 * nPlane + iPlane]; + ObjectiveFunc[5 * nPlane + iPlane] = + geometry_container[ZONE_0]->Compute_Twist(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Area: " << ObjectiveFunc[0 * nPlane + iPlane] << " in^2, "; + else + cout << "Area: " << ObjectiveFunc[0 * nPlane + iPlane] << " m^2, "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Thickness: " << ObjectiveFunc[1 * nPlane + iPlane] << " in, " << endl; + else + cout << "Thickness: " << ObjectiveFunc[1 * nPlane + iPlane] << " m, " << endl; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Chord: " << ObjectiveFunc[2 * nPlane + iPlane] << " in, "; + else + cout << "Chord: " << ObjectiveFunc[2 * nPlane + iPlane] << " m, "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "LE radius: " << ObjectiveFunc[3 * nPlane + iPlane] << " 1/in, "; + else + cout << "LE radius: " << ObjectiveFunc[3 * nPlane + iPlane] << " 1/m, "; + cout << "ToC: " << ObjectiveFunc[4 * nPlane + iPlane] << ", "; + if (geometry_container[ZONE_0]->GetnDim() == 2) + cout << "Alpha: " << ObjectiveFunc[5 * nPlane + iPlane] << " deg."; + else if (geometry_container[ZONE_0]->GetnDim() == 3) + cout << "Twist angle: " << ObjectiveFunc[5 * nPlane + iPlane] << " deg."; + } else { + ObjectiveFunc[0 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Area( + Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + ObjectiveFunc[1 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_MaxThickness( + Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + ObjectiveFunc[2 * nPlane + iPlane] = + geometry_container[ZONE_0]->Compute_Chord(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + ObjectiveFunc[3 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_LERadius( + Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], + Zcoord_Airfoil[iPlane]); + ObjectiveFunc[4 * nPlane + iPlane] = ObjectiveFunc[1 * nPlane + iPlane] / ObjectiveFunc[2 * nPlane + iPlane]; + ObjectiveFunc[5 * nPlane + iPlane] = + geometry_container[ZONE_0]->Compute_Twist(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Area: " << ObjectiveFunc[0 * nPlane + iPlane] << " in^2, "; + else + cout << "Area: " << ObjectiveFunc[0 * nPlane + iPlane] << " m^2, "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Thickness: " << ObjectiveFunc[1 * nPlane + iPlane] << " in, " << endl; + else + cout << "Thickness: " << ObjectiveFunc[1 * nPlane + iPlane] << " m, " << endl; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "Chord: " << ObjectiveFunc[2 * nPlane + iPlane] << " in, "; + else + cout << "Chord: " << ObjectiveFunc[2 * nPlane + iPlane] << " m, "; + if (config_container[ZONE_0]->GetSystemMeasurements() == US) + cout << "LE radius: " << ObjectiveFunc[3 * nPlane + iPlane] << " 1/in, "; + else + cout << "LE radius: " << ObjectiveFunc[3 * nPlane + iPlane] << " 1/m, "; + cout << "ToC: " << ObjectiveFunc[4 * nPlane + iPlane] << ", "; + if (geometry_container[ZONE_0]->GetnDim() == 2) + cout << "Alpha: " << ObjectiveFunc[5 * nPlane + iPlane] << " deg."; + else if (geometry_container[ZONE_0]->GetnDim() == 3) + cout << "Twist angle: " << ObjectiveFunc[5 * nPlane + iPlane] << " deg."; } - else { - ObjectiveFunc[0*nPlane+iPlane] = geometry_container[ZONE_0]->Compute_Area(Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - ObjectiveFunc[1*nPlane+iPlane] = geometry_container[ZONE_0]->Compute_MaxThickness(Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - ObjectiveFunc[2*nPlane+iPlane] = geometry_container[ZONE_0]->Compute_Chord(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - ObjectiveFunc[3*nPlane+iPlane] = geometry_container[ZONE_0]->Compute_LERadius(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - ObjectiveFunc[4*nPlane+iPlane] = ObjectiveFunc[1*nPlane+iPlane]/ObjectiveFunc[2*nPlane+iPlane]; - ObjectiveFunc[5*nPlane+iPlane] = geometry_container[ZONE_0]->Compute_Twist(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Area: " << ObjectiveFunc[0*nPlane+iPlane] << " in^2, "; - else cout << "Area: " << ObjectiveFunc[0*nPlane+iPlane] << " m^2, "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Thickness: " << ObjectiveFunc[1*nPlane+iPlane] << " in, " << endl; - else cout << "Thickness: " << ObjectiveFunc[1*nPlane+iPlane] << " m, " << endl; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "Chord: " << ObjectiveFunc[2*nPlane+iPlane] << " in, "; - else cout << "Chord: " << ObjectiveFunc[2*nPlane+iPlane] << " m, "; - if (config_container[ZONE_0]->GetSystemMeasurements() == US) cout << "LE radius: " << ObjectiveFunc[3*nPlane+iPlane] << " 1/in, "; - else cout << "LE radius: " << ObjectiveFunc[3*nPlane+iPlane] << " 1/m, "; - cout << "ToC: " << ObjectiveFunc[4*nPlane+iPlane] << ", "; - if (geometry_container[ZONE_0]->GetnDim() == 2) cout << "Alpha: " << ObjectiveFunc[5*nPlane+iPlane] <<" deg."; - else if (geometry_container[ZONE_0]->GetnDim() == 3) cout << "Twist angle: " << ObjectiveFunc[5*nPlane+iPlane] <<" deg."; - } - } - } /*--- Write the objective function in a external file ---*/ string filename = config_container[ZONE_0]->GetObjFunc_Value_FileName(); - unsigned short lastindex = filename.find_last_of("."); + unsigned short lastindex = filename.find_last_of('.'); filename = filename.substr(0, lastindex); - if (tabTecplot) filename += ".dat"; - else filename += ".csv"; + if (tabTecplot) + filename += ".dat"; + else + filename += ".csv"; ObjFunc_file.open(filename.c_str(), ios::out); if (tabTecplot) ObjFunc_file << "TITLE = \"SU2_GEO Evaluation\"" << endl; if (geometry_container[ZONE_0]->GetnDim() == 2) { if (tabTecplot) ObjFunc_file << "VARIABLES =//" << endl; - ObjFunc_file << "\"AIRFOIL_AREA\",\"AIRFOIL_THICKNESS\",\"AIRFOIL_CHORD\",\"AIRFOIL_LE_RADIUS\",\"AIRFOIL_TOC\",\"AIRFOIL_ALPHA\""; - } - else if (geometry_container[ZONE_0]->GetnDim() == 3) { - + ObjFunc_file << "\"AIRFOIL_AREA\",\"AIRFOIL_THICKNESS\",\"AIRFOIL_CHORD\",\"AIRFOIL_LE_RADIUS\",\"AIRFOIL_TOC\"," + "\"AIRFOIL_ALPHA\""; + } else if (geometry_container[ZONE_0]->GetnDim() == 3) { if (tabTecplot) ObjFunc_file << "VARIABLES = //" << endl; if (config_container[ZONE_0]->GetGeo_Description() == FUSELAGE) { - ObjFunc_file << "\"FUSELAGE_VOLUME\",\"FUSELAGE_WETTED_AREA\",\"FUSELAGE_MIN_WIDTH\",\"FUSELAGE_MAX_WIDTH\",\"FUSELAGE_MIN_WATERLINE_WIDTH\",\"FUSELAGE_MAX_WATERLINE_WIDTH\",\"FUSELAGE_MIN_HEIGHT\",\"FUSELAGE_MAX_HEIGHT\",\"FUSELAGE_MAX_CURVATURE\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION"<< (iPlane+1) << "_AREA\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION"<< (iPlane+1) << "_LENGTH\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION"<< (iPlane+1) << "_WIDTH\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION"<< (iPlane+1) << "_WATERLINE_WIDTH\","; + ObjFunc_file << "\"FUSELAGE_VOLUME\",\"FUSELAGE_WETTED_AREA\",\"FUSELAGE_MIN_WIDTH\",\"FUSELAGE_MAX_WIDTH\"," + "\"FUSELAGE_MIN_WATERLINE_WIDTH\",\"FUSELAGE_MAX_WATERLINE_WIDTH\",\"FUSELAGE_MIN_HEIGHT\"," + "\"FUSELAGE_MAX_HEIGHT\",\"FUSELAGE_MAX_CURVATURE\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION" << (iPlane + 1) << "_AREA\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION" << (iPlane + 1) << "_LENGTH\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION" << (iPlane + 1) << "_WIDTH\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) + ObjFunc_file << "\"STATION" << (iPlane + 1) << "_WATERLINE_WIDTH\","; for (iPlane = 0; iPlane < nPlane; iPlane++) { - ObjFunc_file << "\"STATION" << (iPlane+1) << "_HEIGHT\""; - if (iPlane != nPlane-1) ObjFunc_file << ","; + ObjFunc_file << "\"STATION" << (iPlane + 1) << "_HEIGHT\""; + if (iPlane != nPlane - 1) ObjFunc_file << ","; } - } - else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { - ObjFunc_file << "\"NACELLE_VOLUME\",\"NACELLE_MIN_THICKNESS\",\"NACELLE_MAX_THICKNESS\",\"NACELLE_MIN_CHORD\",\"NACELLE_MAX_CHORD\",\"NACELLE_MIN_LE_RADIUS\",\"NACELLE_MAX_LE_RADIUS\",\"NACELLE_MIN_TOC\",\"NACELLE_MAX_TOC\",\"NACELLE_OBJFUN_MIN_TOC\",\"NACELLE_MAX_TWIST\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION"<< (iPlane+1) << "_AREA\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION"<< (iPlane+1) << "_THICKNESS\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION"<< (iPlane+1) << "_CHORD\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION"<< (iPlane+1) << "_LE_RADIUS\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION"<< (iPlane+1) << "_TOC\","; + } else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { + ObjFunc_file << "\"NACELLE_VOLUME\",\"NACELLE_MIN_THICKNESS\",\"NACELLE_MAX_THICKNESS\",\"NACELLE_MIN_CHORD\"," + "\"NACELLE_MAX_CHORD\",\"NACELLE_MIN_LE_RADIUS\",\"NACELLE_MAX_LE_RADIUS\",\"NACELLE_MIN_TOC\"," + "\"NACELLE_MAX_TOC\",\"NACELLE_OBJFUN_MIN_TOC\",\"NACELLE_MAX_TWIST\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION" << (iPlane + 1) << "_AREA\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION" << (iPlane + 1) << "_THICKNESS\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION" << (iPlane + 1) << "_CHORD\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION" << (iPlane + 1) << "_LE_RADIUS\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION" << (iPlane + 1) << "_TOC\","; for (iPlane = 0; iPlane < nPlane; iPlane++) { - ObjFunc_file << "\"STATION" << (iPlane+1) << "_TWIST\""; - if (iPlane != nPlane-1) ObjFunc_file << ","; + ObjFunc_file << "\"STATION" << (iPlane + 1) << "_TWIST\""; + if (iPlane != nPlane - 1) ObjFunc_file << ","; } - } - else { - ObjFunc_file << "\"WING_VOLUME\",\"WING_MIN_THICKNESS\",\"WING_MAX_THICKNESS\",\"WING_MIN_CHORD\",\"WING_MAX_CHORD\",\"WING_MIN_LE_RADIUS\",\"WING_MAX_LE_RADIUS\",\"WING_MIN_TOC\",\"WING_MAX_TOC\",\"WING_OBJFUN_MIN_TOC\",\"WING_MAX_TWIST\",\"WING_MAX_CURVATURE\",\"WING_MAX_DIHEDRAL\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION"<< (iPlane+1) << "_AREA\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION"<< (iPlane+1) << "_THICKNESS\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION"<< (iPlane+1) << "_CHORD\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION"<< (iPlane+1) << "_LE_RADIUS\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION"<< (iPlane+1) << "_TOC\","; + } else { + ObjFunc_file << "\"WING_VOLUME\",\"WING_MIN_THICKNESS\",\"WING_MAX_THICKNESS\",\"WING_MIN_CHORD\",\"WING_MAX_" + "CHORD\",\"WING_MIN_LE_RADIUS\",\"WING_MAX_LE_RADIUS\",\"WING_MIN_TOC\",\"WING_MAX_TOC\"," + "\"WING_OBJFUN_MIN_TOC\",\"WING_MAX_TWIST\",\"WING_MAX_CURVATURE\",\"WING_MAX_DIHEDRAL\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION" << (iPlane + 1) << "_AREA\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION" << (iPlane + 1) << "_THICKNESS\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION" << (iPlane + 1) << "_CHORD\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION" << (iPlane + 1) << "_LE_RADIUS\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) ObjFunc_file << "\"STATION" << (iPlane + 1) << "_TOC\","; for (iPlane = 0; iPlane < nPlane; iPlane++) { - ObjFunc_file << "\"STATION" << (iPlane+1) << "_TWIST\""; - if (iPlane != nPlane-1) ObjFunc_file << ","; + ObjFunc_file << "\"STATION" << (iPlane + 1) << "_TWIST\""; + if (iPlane != nPlane - 1) ObjFunc_file << ","; } } - } - if (tabTecplot) ObjFunc_file << "\nZONE T= \"Geometrical variables (value)\"" << endl; - else ObjFunc_file << endl; + if (tabTecplot) + ObjFunc_file << "\nZONE T= \"Geometrical variables (value)\"" << endl; + else + ObjFunc_file << endl; if (config_container[ZONE_0]->GetGeo_Description() == FUSELAGE) { if (geometry_container[ZONE_0]->GetnDim() == 3) { - ObjFunc_file << Fuselage_Volume <<", "<< Fuselage_WettedArea <<", "<< Fuselage_MinWidth <<", "<< Fuselage_MaxWidth <<", "<< Fuselage_MinWaterLineWidth <<", "<< Fuselage_MaxWaterLineWidth<<", "<< Fuselage_MinHeight <<", "<< Fuselage_MaxHeight <<", "<< Fuselage_MaxCurvature <<", "; + ObjFunc_file << Fuselage_Volume << ", " << Fuselage_WettedArea << ", " << Fuselage_MinWidth << ", " + << Fuselage_MaxWidth << ", " << Fuselage_MinWaterLineWidth << ", " << Fuselage_MaxWaterLineWidth + << ", " << Fuselage_MinHeight << ", " << Fuselage_MaxHeight << ", " << Fuselage_MaxCurvature + << ", "; } - for (iPlane = 0; iPlane < nPlane*5; iPlane++) { + for (iPlane = 0; iPlane < nPlane * 5; iPlane++) { ObjFunc_file << ObjectiveFunc[iPlane]; - if (iPlane != (nPlane*5)-1) ObjFunc_file <<", "; + if (iPlane != (nPlane * 5) - 1) ObjFunc_file << ", "; } - } - else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { + } else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { if (geometry_container[ZONE_0]->GetnDim() == 3) { - ObjFunc_file << Nacelle_Volume <<", "<< Nacelle_MinThickness <<", "<< Nacelle_MaxThickness <<", "<< Nacelle_MinChord <<", "<< Nacelle_MaxChord <<", "<< Nacelle_MinLERadius <<", "<< Nacelle_MaxLERadius<<", "<< Nacelle_MinToC <<", "<< Nacelle_MaxToC <<", "<< Nacelle_ObjFun_MinToC <<", "<< Nacelle_MaxTwist <<", "; + ObjFunc_file << Nacelle_Volume << ", " << Nacelle_MinThickness << ", " << Nacelle_MaxThickness << ", " + << Nacelle_MinChord << ", " << Nacelle_MaxChord << ", " << Nacelle_MinLERadius << ", " + << Nacelle_MaxLERadius << ", " << Nacelle_MinToC << ", " << Nacelle_MaxToC << ", " + << Nacelle_ObjFun_MinToC << ", " << Nacelle_MaxTwist << ", "; } - for (iPlane = 0; iPlane < nPlane*6; iPlane++) { + for (iPlane = 0; iPlane < nPlane * 6; iPlane++) { ObjFunc_file << ObjectiveFunc[iPlane]; - if (iPlane != (nPlane*6)-1) ObjFunc_file <<", "; + if (iPlane != (nPlane * 6) - 1) ObjFunc_file << ", "; } - } - else { + } else { if (geometry_container[ZONE_0]->GetnDim() == 3) { - ObjFunc_file << Wing_Volume <<", "<< Wing_MinThickness <<", "<< Wing_MaxThickness <<", "<< Wing_MinChord <<", "<< Wing_MaxChord <<", "<< Wing_MinLERadius <<", "<< Wing_MaxLERadius<<", "<< Wing_MinToC <<", "<< Wing_MaxToC <<", "<< Wing_ObjFun_MinToC <<", "<< Wing_MaxTwist <<", "<< Wing_MaxCurvature <<", "<< Wing_MaxDihedral <<", "; + ObjFunc_file << Wing_Volume << ", " << Wing_MinThickness << ", " << Wing_MaxThickness << ", " << Wing_MinChord + << ", " << Wing_MaxChord << ", " << Wing_MinLERadius << ", " << Wing_MaxLERadius << ", " + << Wing_MinToC << ", " << Wing_MaxToC << ", " << Wing_ObjFun_MinToC << ", " << Wing_MaxTwist + << ", " << Wing_MaxCurvature << ", " << Wing_MaxDihedral << ", "; } - for (iPlane = 0; iPlane < nPlane*6; iPlane++) { + for (iPlane = 0; iPlane < nPlane * 6; iPlane++) { ObjFunc_file << ObjectiveFunc[iPlane]; - if (iPlane != (nPlane*6)-1) ObjFunc_file <<", "; + if (iPlane != (nPlane * 6) - 1) ObjFunc_file << ", "; } } ObjFunc_file.close(); - } if (config_container[ZONE_0]->GetGeometryMode() == GRADIENT) { - /*--- Definition of the Class for surface deformation ---*/ surface_movement = new CSurfaceMovement(); @@ -593,38 +730,37 @@ int main(int argc, char *argv[]) { /*--- Write the gradient in a external file ---*/ if (rank == MASTER_NODE) { string filename = config_container[ZONE_0]->GetObjFunc_Grad_FileName(); - unsigned short lastindex = filename.find_last_of("."); + unsigned short lastindex = filename.find_last_of('.'); filename = filename.substr(0, lastindex); - if (tabTecplot) filename += ".dat"; - else filename += ".csv"; + if (tabTecplot) + filename += ".dat"; + else + filename += ".csv"; Gradient_file.open(filename.c_str(), ios::out); } for (iDV = 0; iDV < config_container[ZONE_0]->GetnDV(); iDV++) { - /*--- Free Form deformation based ---*/ if ((config_container[ZONE_0]->GetDesign_Variable(iDV) == FFD_CONTROL_POINT_2D) || (config_container[ZONE_0]->GetDesign_Variable(iDV) == FFD_CAMBER_2D) || (config_container[ZONE_0]->GetDesign_Variable(iDV) == FFD_THICKNESS_2D) || - (config_container[ZONE_0]->GetDesign_Variable(iDV) == FFD_TWIST_2D) || (config_container[ZONE_0]->GetDesign_Variable(iDV) == FFD_CONTROL_POINT) || (config_container[ZONE_0]->GetDesign_Variable(iDV) == FFD_NACELLE) || (config_container[ZONE_0]->GetDesign_Variable(iDV) == FFD_GULL) || (config_container[ZONE_0]->GetDesign_Variable(iDV) == FFD_TWIST) || (config_container[ZONE_0]->GetDesign_Variable(iDV) == FFD_ROTATION) || (config_container[ZONE_0]->GetDesign_Variable(iDV) == FFD_CAMBER) || - (config_container[ZONE_0]->GetDesign_Variable(iDV) == FFD_THICKNESS) ) { - + (config_container[ZONE_0]->GetDesign_Variable(iDV) == FFD_THICKNESS)) { /*--- Read the FFD information in the first iteration ---*/ if (iDV == 0) { - if (rank == MASTER_NODE) cout << "Read the FFD information from mesh file." << endl; /*--- Read the FFD information from the grid file ---*/ - surface_movement->ReadFFDInfo(geometry_container[ZONE_0], config_container[ZONE_0], FFDBox, config_container[ZONE_0]->GetMesh_FileName()); + surface_movement->ReadFFDInfo(geometry_container[ZONE_0], config_container[ZONE_0], FFDBox, + config_container[ZONE_0]->GetMesh_FileName()); /*--- Modify the control points for polar based computations ---*/ @@ -632,13 +768,11 @@ int main(int argc, char *argv[]) { for (iFFDBox = 0; iFFDBox < surface_movement->GetnFFDBox(); iFFDBox++) { FFDBox[iFFDBox]->SetCart2Cyl_ControlPoints(config_container[ZONE_0]); } - } - else if (config_container[ZONE_0]->GetFFD_CoordSystem() == SPHERICAL) { + } else if (config_container[ZONE_0]->GetFFD_CoordSystem() == SPHERICAL) { for (iFFDBox = 0; iFFDBox < surface_movement->GetnFFDBox(); iFFDBox++) { FFDBox[iFFDBox]->SetCart2Sphe_ControlPoints(config_container[ZONE_0]); } - } - else if (config_container[ZONE_0]->GetFFD_CoordSystem() == POLAR) { + } else if (config_container[ZONE_0]->GetFFD_CoordSystem() == POLAR) { for (iFFDBox = 0; iFFDBox < surface_movement->GetnFFDBox(); iFFDBox++) { FFDBox[iFFDBox]->SetCart2Sphe_ControlPoints(config_container[ZONE_0]); } @@ -651,23 +785,21 @@ int main(int argc, char *argv[]) { } for (iFFDBox = 0; iFFDBox < surface_movement->GetnFFDBox(); iFFDBox++) { - if (rank == MASTER_NODE) cout << "Checking FFD box dimension." << endl; - surface_movement->CheckFFDDimension(geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], iFFDBox); - + surface_movement->CheckFFDDimension(geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], + iFFDBox); if (rank == MASTER_NODE) cout << "Check the FFD box intersections with the solid surfaces." << endl; - surface_movement->CheckFFDIntersections(geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], iFFDBox); - + surface_movement->CheckFFDIntersections(geometry_container[ZONE_0], config_container[ZONE_0], + FFDBox[iFFDBox], iFFDBox); } if (rank == MASTER_NODE) - cout <<"-------------------------------------------------------------------------" << endl; - + cout << "-------------------------------------------------------------------------" << endl; } if (rank == MASTER_NODE) { - cout << endl << "Design variable number "<< iDV <<"." << endl; + cout << endl << "Design variable number " << iDV << "." << endl; cout << "Perform 3D deformation of the surface." << endl; } @@ -676,31 +808,62 @@ int main(int argc, char *argv[]) { MoveSurface = false; for (iFFDBox = 0; iFFDBox < surface_movement->GetnFFDBox(); iFFDBox++) { - Local_MoveSurface = false; - switch ( config_container[ZONE_0]->GetDesign_Variable(iDV) ) { - case FFD_CONTROL_POINT_2D : Local_MoveSurface = surface_movement->SetFFDCPChange_2D(geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_CAMBER_2D : Local_MoveSurface = surface_movement->SetFFDCamber_2D(geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_THICKNESS_2D : Local_MoveSurface = surface_movement->SetFFDThickness_2D(geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_TWIST_2D : Local_MoveSurface = surface_movement->SetFFDTwist_2D(geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_CONTROL_POINT : Local_MoveSurface = surface_movement->SetFFDCPChange(geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_NACELLE : Local_MoveSurface = surface_movement->SetFFDNacelle(geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_GULL : Local_MoveSurface = surface_movement->SetFFDGull(geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_TWIST : Local_MoveSurface = surface_movement->SetFFDTwist(geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_ROTATION : Local_MoveSurface = surface_movement->SetFFDRotation(geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_CAMBER : Local_MoveSurface = surface_movement->SetFFDCamber(geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_THICKNESS : Local_MoveSurface = surface_movement->SetFFDThickness(geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], FFDBox, iDV, true); break; - case FFD_CONTROL_SURFACE : Local_MoveSurface = surface_movement->SetFFDControl_Surface(geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], FFDBox, iDV, true); break; + switch (config_container[ZONE_0]->GetDesign_Variable(iDV)) { + case FFD_CONTROL_POINT_2D: + Local_MoveSurface = surface_movement->SetFFDCPChange_2D( + geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_CAMBER_2D: + Local_MoveSurface = surface_movement->SetFFDCamber_2D( + geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_THICKNESS_2D: + Local_MoveSurface = surface_movement->SetFFDThickness_2D( + geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_CONTROL_POINT: + Local_MoveSurface = surface_movement->SetFFDCPChange(geometry_container[ZONE_0], config_container[ZONE_0], + FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_NACELLE: + Local_MoveSurface = surface_movement->SetFFDNacelle(geometry_container[ZONE_0], config_container[ZONE_0], + FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_GULL: + Local_MoveSurface = surface_movement->SetFFDGull(geometry_container[ZONE_0], config_container[ZONE_0], + FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_TWIST: + Local_MoveSurface = surface_movement->SetFFDTwist(geometry_container[ZONE_0], config_container[ZONE_0], + FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_ROTATION: + Local_MoveSurface = surface_movement->SetFFDRotation(geometry_container[ZONE_0], config_container[ZONE_0], + FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_CAMBER: + Local_MoveSurface = surface_movement->SetFFDCamber(geometry_container[ZONE_0], config_container[ZONE_0], + FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_THICKNESS: + Local_MoveSurface = surface_movement->SetFFDThickness( + geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], FFDBox, iDV, true); + break; + case FFD_CONTROL_SURFACE: + Local_MoveSurface = surface_movement->SetFFDControl_Surface( + geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], FFDBox, iDV, true); + break; } /*--- Recompute cartesian coordinates using the new control points position ---*/ if (Local_MoveSurface) { MoveSurface = true; - surface_movement->SetCartesianCoord(geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], iFFDBox, true); + surface_movement->SetCartesianCoord(geometry_container[ZONE_0], config_container[ZONE_0], FFDBox[iFFDBox], + iFFDBox, true); } - } } @@ -709,7 +872,7 @@ int main(int argc, char *argv[]) { else if (config_container[ZONE_0]->GetDesign_Variable(iDV) == HICKS_HENNE) { if (rank == MASTER_NODE) { - cout << endl << "Design variable number "<< iDV <<"." << endl; + cout << endl << "Design variable number " << iDV << "." << endl; cout << "Perform 2D deformation of the surface." << endl; } MoveSurface = true; @@ -720,7 +883,7 @@ int main(int argc, char *argv[]) { else if (config_container[ZONE_0]->GetDesign_Variable(iDV) == SURFACE_BUMP) { if (rank == MASTER_NODE) { - cout << endl << "Design variable number "<< iDV <<"." << endl; + cout << endl << "Design variable number " << iDV << "." << endl; cout << "Perform 2D deformation of the surface." << endl; } MoveSurface = true; @@ -731,7 +894,7 @@ int main(int argc, char *argv[]) { else if (config_container[ZONE_0]->GetDesign_Variable(iDV) == CST) { if (rank == MASTER_NODE) { - cout << endl << "Design variable number "<< iDV <<"." << endl; + cout << endl << "Design variable number " << iDV << "." << endl; cout << "Perform 2D deformation of the surface." << endl; } MoveSurface = true; @@ -742,7 +905,7 @@ int main(int argc, char *argv[]) { else if (config_container[ZONE_0]->GetDesign_Variable(iDV) == TRANSLATION) { if (rank == MASTER_NODE) { - cout << endl << "Design variable number "<< iDV <<"." << endl; + cout << endl << "Design variable number " << iDV << "." << endl; cout << "Perform 2D deformation of the surface." << endl; } MoveSurface = true; @@ -753,7 +916,7 @@ int main(int argc, char *argv[]) { else if (config_container[ZONE_0]->GetDesign_Variable(iDV) == SCALE) { if (rank == MASTER_NODE) { - cout << endl << "Design variable number "<< iDV <<"." << endl; + cout << endl << "Design variable number " << iDV << "." << endl; cout << "Perform 2D deformation of the surface." << endl; } MoveSurface = true; @@ -764,7 +927,7 @@ int main(int argc, char *argv[]) { else if (config_container[ZONE_0]->GetDesign_Variable(iDV) == ROTATION) { if (rank == MASTER_NODE) { - cout << endl << "Design variable number "<< iDV <<"." << endl; + cout << endl << "Design variable number " << iDV << "." << endl; cout << "Perform 2D deformation of the surface." << endl; } MoveSurface = true; @@ -775,7 +938,7 @@ int main(int argc, char *argv[]) { else if (config_container[ZONE_0]->GetDesign_Variable(iDV) == NACA_4DIGITS) { if (rank == MASTER_NODE) { - cout << endl << "Design variable number "<< iDV <<"." << endl; + cout << endl << "Design variable number " << iDV << "." << endl; cout << "Perform 2D deformation of the surface." << endl; } MoveSurface = true; @@ -786,7 +949,7 @@ int main(int argc, char *argv[]) { else if (config_container[ZONE_0]->GetDesign_Variable(iDV) == PARABOLIC) { if (rank == MASTER_NODE) { - cout << endl << "Design variable number "<< iDV <<"." << endl; + cout << endl << "Design variable number " << iDV << "." << endl; cout << "Perform 2D deformation of the surface." << endl; } MoveSurface = true; @@ -796,53 +959,46 @@ int main(int argc, char *argv[]) { /*--- Design variable not implement ---*/ else { - if (rank == MASTER_NODE) - cout << "Design Variable not implemented yet" << endl; + if (rank == MASTER_NODE) cout << "Design Variable not implemented yet" << endl; } if (MoveSurface) { - /*--- Compute the gradient for the volume. In 2D this is just the gradient of the area. ---*/ if (geometry_container[ZONE_0]->GetnDim() == 3) { - if (config_container[ZONE_0]->GetGeo_Description() == FUSELAGE) { - geometry_container[ZONE_0]->Compute_Fuselage(config_container[ZONE_0], false, - Fuselage_Volume_New, Fuselage_WettedArea_New, Fuselage_MinWidth_New, Fuselage_MaxWidth_New, - Fuselage_MinWaterLineWidth_New, Fuselage_MaxWaterLineWidth_New, - Fuselage_MinHeight_New, Fuselage_MaxHeight_New, - Fuselage_MaxCurvature_New); - } - else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { - geometry_container[ZONE_0]->Compute_Nacelle(config_container[ZONE_0], false, - Nacelle_Volume_New, Nacelle_MinThickness_New, Nacelle_MaxThickness_New, Nacelle_MinChord_New, - Nacelle_MaxChord_New, Nacelle_MinLERadius_New, Nacelle_MaxLERadius_New, Nacelle_MinToC_New, - Nacelle_MaxToC_New, Nacelle_ObjFun_MinToC_New, Nacelle_MaxTwist_New); - } - else { - geometry_container[ZONE_0]->Compute_Wing(config_container[ZONE_0], false, - Wing_Volume_New, Wing_MinThickness_New, Wing_MaxThickness_New, Wing_MinChord_New, - Wing_MaxChord_New, Wing_MinLERadius_New, Wing_MaxLERadius_New, Wing_MinToC_New, Wing_MaxToC_New, - Wing_ObjFun_MinToC_New, Wing_MaxTwist_New, Wing_MaxCurvature_New, Wing_MaxDihedral_New); + geometry_container[ZONE_0]->Compute_Fuselage( + config_container[ZONE_0], false, Fuselage_Volume_New, Fuselage_WettedArea_New, Fuselage_MinWidth_New, + Fuselage_MaxWidth_New, Fuselage_MinWaterLineWidth_New, Fuselage_MaxWaterLineWidth_New, + Fuselage_MinHeight_New, Fuselage_MaxHeight_New, Fuselage_MaxCurvature_New); + } else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { + geometry_container[ZONE_0]->Compute_Nacelle( + config_container[ZONE_0], false, Nacelle_Volume_New, Nacelle_MinThickness_New, Nacelle_MaxThickness_New, + Nacelle_MinChord_New, Nacelle_MaxChord_New, Nacelle_MinLERadius_New, Nacelle_MaxLERadius_New, + Nacelle_MinToC_New, Nacelle_MaxToC_New, Nacelle_ObjFun_MinToC_New, Nacelle_MaxTwist_New); + } else { + geometry_container[ZONE_0]->Compute_Wing(config_container[ZONE_0], false, Wing_Volume_New, + Wing_MinThickness_New, Wing_MaxThickness_New, Wing_MinChord_New, + Wing_MaxChord_New, Wing_MinLERadius_New, Wing_MaxLERadius_New, + Wing_MinToC_New, Wing_MaxToC_New, Wing_ObjFun_MinToC_New, + Wing_MaxTwist_New, Wing_MaxCurvature_New, Wing_MaxDihedral_New); } - } /*--- Create airfoil structure ---*/ for (iPlane = 0; iPlane < nPlane; iPlane++) { - geometry_container[ZONE_0]->ComputeAirfoil_Section(Plane_P0[iPlane], Plane_Normal[iPlane], -1E6, 1E6, -1E6, 1E6, -1E6, 1E6, nullptr, - Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane], + geometry_container[ZONE_0]->ComputeAirfoil_Section(Plane_P0[iPlane], Plane_Normal[iPlane], -1E6, 1E6, -1E6, + 1E6, -1E6, 1E6, nullptr, Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane], Variable_Airfoil[iPlane], false, config_container[ZONE_0]); } - } /*--- Compute gradient ---*/ if (rank == MASTER_NODE) { - delta_eps = config_container[ZONE_0]->GetDV_Value(iDV); if (delta_eps == 0) { @@ -850,7 +1006,6 @@ int main(int argc, char *argv[]) { } if (MoveSurface) { - if (config_container[ZONE_0]->GetGeo_Description() == FUSELAGE) { Fuselage_Volume_Grad = (Fuselage_Volume_New - Fuselage_Volume) / delta_eps; Fuselage_WettedArea_Grad = (Fuselage_WettedArea_New - Fuselage_WettedArea) / delta_eps; @@ -862,8 +1017,7 @@ int main(int argc, char *argv[]) { Fuselage_MaxHeight_Grad = (Fuselage_MaxHeight_New - Fuselage_MaxHeight) / delta_eps; Fuselage_MaxCurvature_Grad = (Fuselage_MaxCurvature_New - Fuselage_MaxCurvature) / delta_eps; - } - else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { + } else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { Nacelle_Volume_Grad = (Nacelle_Volume_New - Nacelle_Volume) / delta_eps; Nacelle_MinThickness_Grad = (Nacelle_MinThickness_New - Nacelle_MinThickness) / delta_eps; Nacelle_MaxThickness_Grad = (Nacelle_MaxThickness_New - Nacelle_MaxThickness) / delta_eps; @@ -875,8 +1029,7 @@ int main(int argc, char *argv[]) { Nacelle_MaxToC_Grad = (Nacelle_MaxToC_New - Nacelle_MaxToC) / delta_eps; Nacelle_ObjFun_MinToC_Grad = (Nacelle_ObjFun_MinToC_New - Nacelle_ObjFun_MinToC) / delta_eps; Nacelle_MaxTwist_Grad = (Nacelle_MaxTwist_New - Nacelle_MaxTwist) / delta_eps; - } - else { + } else { Wing_Volume_Grad = (Wing_Volume_New - Wing_Volume) / delta_eps; Wing_MinThickness_Grad = (Wing_MinThickness_New - Wing_MinThickness) / delta_eps; Wing_MaxThickness_Grad = (Wing_MaxThickness_New - Wing_MaxThickness) / delta_eps; @@ -894,356 +1047,412 @@ int main(int argc, char *argv[]) { for (iPlane = 0; iPlane < nPlane; iPlane++) { if (Xcoord_Airfoil[iPlane].size() > 1) { - if (config_container[ZONE_0]->GetGeo_Description() == FUSELAGE) { - - ObjectiveFunc_New[0*nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Area(Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Gradient[0*nPlane + iPlane] = (ObjectiveFunc_New[0*nPlane + iPlane] - ObjectiveFunc[0*nPlane + iPlane]) / delta_eps; - - ObjectiveFunc_New[1*nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Length(Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Gradient[1*nPlane + iPlane] = (ObjectiveFunc_New[1*nPlane + iPlane] - ObjectiveFunc[1*nPlane + iPlane]) / delta_eps; - - ObjectiveFunc_New[2*nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Width(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Gradient[2*nPlane + iPlane] = (ObjectiveFunc_New[2*nPlane + iPlane] - ObjectiveFunc[2*nPlane + iPlane]) / delta_eps; - - ObjectiveFunc_New[3*nPlane + iPlane] = geometry_container[ZONE_0]->Compute_WaterLineWidth(Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Gradient[3*nPlane + iPlane] = (ObjectiveFunc_New[3*nPlane + iPlane] - ObjectiveFunc[3*nPlane + iPlane]) / delta_eps; - - ObjectiveFunc_New[4*nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Height(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Gradient[4*nPlane + iPlane] = (ObjectiveFunc_New[4*nPlane + iPlane] - ObjectiveFunc[4*nPlane + iPlane]) / delta_eps; + ObjectiveFunc_New[0 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Area( + Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + Gradient[0 * nPlane + iPlane] = + (ObjectiveFunc_New[0 * nPlane + iPlane] - ObjectiveFunc[0 * nPlane + iPlane]) / delta_eps; + + ObjectiveFunc_New[1 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Length( + Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + Gradient[1 * nPlane + iPlane] = + (ObjectiveFunc_New[1 * nPlane + iPlane] - ObjectiveFunc[1 * nPlane + iPlane]) / delta_eps; + + ObjectiveFunc_New[2 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Width( + Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], + Zcoord_Airfoil[iPlane]); + Gradient[2 * nPlane + iPlane] = + (ObjectiveFunc_New[2 * nPlane + iPlane] - ObjectiveFunc[2 * nPlane + iPlane]) / delta_eps; + + ObjectiveFunc_New[3 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_WaterLineWidth( + Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + Gradient[3 * nPlane + iPlane] = + (ObjectiveFunc_New[3 * nPlane + iPlane] - ObjectiveFunc[3 * nPlane + iPlane]) / delta_eps; + + ObjectiveFunc_New[4 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Height( + Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], + Zcoord_Airfoil[iPlane]); + Gradient[4 * nPlane + iPlane] = + (ObjectiveFunc_New[4 * nPlane + iPlane] - ObjectiveFunc[4 * nPlane + iPlane]) / delta_eps; } else if (config_container[ZONE_0]->GetGeo_Description() == FUSELAGE) { - - ObjectiveFunc_New[0*nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Area(Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Gradient[0*nPlane + iPlane] = (ObjectiveFunc_New[0*nPlane + iPlane] - ObjectiveFunc[0*nPlane + iPlane]) / delta_eps; - - ObjectiveFunc_New[1*nPlane + iPlane] = geometry_container[ZONE_0]->Compute_MaxThickness(Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Gradient[1*nPlane + iPlane] = (ObjectiveFunc_New[1*nPlane + iPlane] - ObjectiveFunc[1*nPlane + iPlane]) / delta_eps; - - ObjectiveFunc_New[2*nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Chord(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Gradient[2*nPlane + iPlane] = (ObjectiveFunc_New[2*nPlane + iPlane] - ObjectiveFunc[2*nPlane + iPlane]) / delta_eps; - - ObjectiveFunc_New[3*nPlane + iPlane] = geometry_container[ZONE_0]->Compute_LERadius(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Gradient[3*nPlane + iPlane] = (ObjectiveFunc_New[3*nPlane + iPlane] - ObjectiveFunc[3*nPlane + iPlane]) / delta_eps; - - ObjectiveFunc_New[4*nPlane + iPlane] = ObjectiveFunc_New[1*nPlane + iPlane] / ObjectiveFunc_New[2*nPlane + iPlane]; - Gradient[4*nPlane + iPlane] = (ObjectiveFunc_New[4*nPlane + iPlane] - ObjectiveFunc[4*nPlane + iPlane]) / delta_eps; - - ObjectiveFunc_New[5*nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Twist(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Gradient[5*nPlane + iPlane] = (ObjectiveFunc_New[5*nPlane + iPlane] - ObjectiveFunc[5*nPlane + iPlane]) / delta_eps; + ObjectiveFunc_New[0 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Area( + Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + Gradient[0 * nPlane + iPlane] = + (ObjectiveFunc_New[0 * nPlane + iPlane] - ObjectiveFunc[0 * nPlane + iPlane]) / delta_eps; + + ObjectiveFunc_New[1 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_MaxThickness( + Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + Gradient[1 * nPlane + iPlane] = + (ObjectiveFunc_New[1 * nPlane + iPlane] - ObjectiveFunc[1 * nPlane + iPlane]) / delta_eps; + + ObjectiveFunc_New[2 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Chord( + Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], + Zcoord_Airfoil[iPlane]); + Gradient[2 * nPlane + iPlane] = + (ObjectiveFunc_New[2 * nPlane + iPlane] - ObjectiveFunc[2 * nPlane + iPlane]) / delta_eps; + + ObjectiveFunc_New[3 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_LERadius( + Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], + Zcoord_Airfoil[iPlane]); + Gradient[3 * nPlane + iPlane] = + (ObjectiveFunc_New[3 * nPlane + iPlane] - ObjectiveFunc[3 * nPlane + iPlane]) / delta_eps; + + ObjectiveFunc_New[4 * nPlane + iPlane] = + ObjectiveFunc_New[1 * nPlane + iPlane] / ObjectiveFunc_New[2 * nPlane + iPlane]; + Gradient[4 * nPlane + iPlane] = + (ObjectiveFunc_New[4 * nPlane + iPlane] - ObjectiveFunc[4 * nPlane + iPlane]) / delta_eps; + + ObjectiveFunc_New[5 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Twist( + Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], + Zcoord_Airfoil[iPlane]); + Gradient[5 * nPlane + iPlane] = + (ObjectiveFunc_New[5 * nPlane + iPlane] - ObjectiveFunc[5 * nPlane + iPlane]) / delta_eps; } else { - - ObjectiveFunc_New[0*nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Area(Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Gradient[0*nPlane + iPlane] = (ObjectiveFunc_New[0*nPlane + iPlane] - ObjectiveFunc[0*nPlane + iPlane]) / delta_eps; - - ObjectiveFunc_New[1*nPlane + iPlane] = geometry_container[ZONE_0]->Compute_MaxThickness(Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Gradient[1*nPlane + iPlane] = (ObjectiveFunc_New[1*nPlane + iPlane] - ObjectiveFunc[1*nPlane + iPlane]) / delta_eps; - - ObjectiveFunc_New[2*nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Chord(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Gradient[2*nPlane + iPlane] = (ObjectiveFunc_New[2*nPlane + iPlane] - ObjectiveFunc[2*nPlane + iPlane]) / delta_eps; - - ObjectiveFunc_New[3*nPlane + iPlane] = geometry_container[ZONE_0]->Compute_LERadius(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Gradient[3*nPlane + iPlane] = (ObjectiveFunc_New[3*nPlane + iPlane] - ObjectiveFunc[3*nPlane + iPlane]) / delta_eps; - - ObjectiveFunc_New[4*nPlane + iPlane] = ObjectiveFunc_New[1*nPlane + iPlane] / ObjectiveFunc_New[2*nPlane + iPlane]; - Gradient[4*nPlane + iPlane] = (ObjectiveFunc_New[4*nPlane + iPlane] - ObjectiveFunc[4*nPlane + iPlane]) / delta_eps; - - ObjectiveFunc_New[5*nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Twist(Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); - Gradient[5*nPlane + iPlane] = (ObjectiveFunc_New[5*nPlane + iPlane] - ObjectiveFunc[5*nPlane + iPlane]) / delta_eps; - + ObjectiveFunc_New[0 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Area( + Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + Gradient[0 * nPlane + iPlane] = + (ObjectiveFunc_New[0 * nPlane + iPlane] - ObjectiveFunc[0 * nPlane + iPlane]) / delta_eps; + + ObjectiveFunc_New[1 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_MaxThickness( + Plane_P0[iPlane], Plane_Normal[iPlane], config_container[ZONE_0], Xcoord_Airfoil[iPlane], + Ycoord_Airfoil[iPlane], Zcoord_Airfoil[iPlane]); + Gradient[1 * nPlane + iPlane] = + (ObjectiveFunc_New[1 * nPlane + iPlane] - ObjectiveFunc[1 * nPlane + iPlane]) / delta_eps; + + ObjectiveFunc_New[2 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Chord( + Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], + Zcoord_Airfoil[iPlane]); + Gradient[2 * nPlane + iPlane] = + (ObjectiveFunc_New[2 * nPlane + iPlane] - ObjectiveFunc[2 * nPlane + iPlane]) / delta_eps; + + ObjectiveFunc_New[3 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_LERadius( + Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], + Zcoord_Airfoil[iPlane]); + Gradient[3 * nPlane + iPlane] = + (ObjectiveFunc_New[3 * nPlane + iPlane] - ObjectiveFunc[3 * nPlane + iPlane]) / delta_eps; + + ObjectiveFunc_New[4 * nPlane + iPlane] = + ObjectiveFunc_New[1 * nPlane + iPlane] / ObjectiveFunc_New[2 * nPlane + iPlane]; + Gradient[4 * nPlane + iPlane] = + (ObjectiveFunc_New[4 * nPlane + iPlane] - ObjectiveFunc[4 * nPlane + iPlane]) / delta_eps; + + ObjectiveFunc_New[5 * nPlane + iPlane] = geometry_container[ZONE_0]->Compute_Twist( + Plane_P0[iPlane], Plane_Normal[iPlane], Xcoord_Airfoil[iPlane], Ycoord_Airfoil[iPlane], + Zcoord_Airfoil[iPlane]); + Gradient[5 * nPlane + iPlane] = + (ObjectiveFunc_New[5 * nPlane + iPlane] - ObjectiveFunc[5 * nPlane + iPlane]) / delta_eps; } - } } } else { - if (config_container[ZONE_0]->GetGeo_Description() == FUSELAGE) { - Fuselage_Volume_Grad = 0.0; - Fuselage_WettedArea_Grad = 0.0; - Fuselage_MinWidth_Grad = 0.0; - Fuselage_MaxWidth_Grad = 0.0; + Fuselage_Volume_Grad = 0.0; + Fuselage_WettedArea_Grad = 0.0; + Fuselage_MinWidth_Grad = 0.0; + Fuselage_MaxWidth_Grad = 0.0; Fuselage_MinWaterLineWidth_Grad = 0.0; Fuselage_MaxWaterLineWidth_Grad = 0.0; - Fuselage_MinHeight_Grad = 0.0; - Fuselage_MaxHeight_Grad = 0.0; - Fuselage_MaxCurvature_Grad = 0.0; + Fuselage_MinHeight_Grad = 0.0; + Fuselage_MaxHeight_Grad = 0.0; + Fuselage_MaxCurvature_Grad = 0.0; for (iPlane = 0; iPlane < nPlane; iPlane++) { - Gradient[0*nPlane + iPlane] = 0.0; - Gradient[1*nPlane + iPlane] = 0.0; - Gradient[2*nPlane + iPlane] = 0.0; - Gradient[3*nPlane + iPlane] = 0.0; - Gradient[4*nPlane + iPlane] = 0.0; + Gradient[0 * nPlane + iPlane] = 0.0; + Gradient[1 * nPlane + iPlane] = 0.0; + Gradient[2 * nPlane + iPlane] = 0.0; + Gradient[3 * nPlane + iPlane] = 0.0; + Gradient[4 * nPlane + iPlane] = 0.0; } - } - else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { - Nacelle_Volume_Grad = 0.0; - Nacelle_MinThickness_Grad = 0.0; - Nacelle_MaxThickness_Grad = 0.0; - Nacelle_MinChord_Grad = 0.0; - Nacelle_MaxChord_Grad = 0.0; - Nacelle_MinLERadius_Grad = 0.0; - Nacelle_MaxLERadius_Grad = 0.0; - Nacelle_MinToC_Grad = 0.0; - Nacelle_MaxToC_Grad = 0.0; - Nacelle_ObjFun_MinToC_Grad = 0.0; - Nacelle_MaxTwist_Grad = 0.0; + } else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { + Nacelle_Volume_Grad = 0.0; + Nacelle_MinThickness_Grad = 0.0; + Nacelle_MaxThickness_Grad = 0.0; + Nacelle_MinChord_Grad = 0.0; + Nacelle_MaxChord_Grad = 0.0; + Nacelle_MinLERadius_Grad = 0.0; + Nacelle_MaxLERadius_Grad = 0.0; + Nacelle_MinToC_Grad = 0.0; + Nacelle_MaxToC_Grad = 0.0; + Nacelle_ObjFun_MinToC_Grad = 0.0; + Nacelle_MaxTwist_Grad = 0.0; for (iPlane = 0; iPlane < nPlane; iPlane++) { - Gradient[0*nPlane + iPlane] = 0.0; - Gradient[1*nPlane + iPlane] = 0.0; - Gradient[2*nPlane + iPlane] = 0.0; - Gradient[3*nPlane + iPlane] = 0.0; - Gradient[4*nPlane + iPlane] = 0.0; - Gradient[5*nPlane + iPlane] = 0.0; + Gradient[0 * nPlane + iPlane] = 0.0; + Gradient[1 * nPlane + iPlane] = 0.0; + Gradient[2 * nPlane + iPlane] = 0.0; + Gradient[3 * nPlane + iPlane] = 0.0; + Gradient[4 * nPlane + iPlane] = 0.0; + Gradient[5 * nPlane + iPlane] = 0.0; } - } - else { - Wing_Volume_Grad = 0.0; - Wing_MinThickness_Grad = 0.0; - Wing_MaxThickness_Grad = 0.0; - Wing_MinChord_Grad = 0.0; - Wing_MaxChord_Grad = 0.0; - Wing_MinLERadius_Grad = 0.0; - Wing_MaxLERadius_Grad = 0.0; - Wing_MinToC_Grad = 0.0; - Wing_MaxToC_Grad = 0.0; - Wing_ObjFun_MinToC_Grad = 0.0; - Wing_MaxTwist_Grad = 0.0; - Wing_MaxCurvature_Grad = 0.0; - Wing_MaxDihedral_Grad = 0.0; + } else { + Wing_Volume_Grad = 0.0; + Wing_MinThickness_Grad = 0.0; + Wing_MaxThickness_Grad = 0.0; + Wing_MinChord_Grad = 0.0; + Wing_MaxChord_Grad = 0.0; + Wing_MinLERadius_Grad = 0.0; + Wing_MaxLERadius_Grad = 0.0; + Wing_MinToC_Grad = 0.0; + Wing_MaxToC_Grad = 0.0; + Wing_ObjFun_MinToC_Grad = 0.0; + Wing_MaxTwist_Grad = 0.0; + Wing_MaxCurvature_Grad = 0.0; + Wing_MaxDihedral_Grad = 0.0; for (iPlane = 0; iPlane < nPlane; iPlane++) { - Gradient[0*nPlane + iPlane] = 0.0; - Gradient[1*nPlane + iPlane] = 0.0; - Gradient[2*nPlane + iPlane] = 0.0; - Gradient[3*nPlane + iPlane] = 0.0; - Gradient[4*nPlane + iPlane] = 0.0; - Gradient[5*nPlane + iPlane] = 0.0; + Gradient[0 * nPlane + iPlane] = 0.0; + Gradient[1 * nPlane + iPlane] = 0.0; + Gradient[2 * nPlane + iPlane] = 0.0; + Gradient[3 * nPlane + iPlane] = 0.0; + Gradient[4 * nPlane + iPlane] = 0.0; + Gradient[5 * nPlane + iPlane] = 0.0; } } - } /*--- Screen output ---*/ if (config_container[ZONE_0]->GetGeo_Description() == FUSELAGE) { if (geometry_container[ZONE_0]->GetnDim() == 3) { - cout << "\nFuselage volume grad.: " << Fuselage_Volume_Grad << ". "; - cout << "Fuselage wetted area grad.: " << Fuselage_WettedArea_Grad << ". "; - cout << "Fuselage min. width grad.: " << Fuselage_MinWidth_Grad << ". "; - cout << "Fuselage max. width grad.: " << Fuselage_MaxWidth_Grad << "." << endl; - cout << "Fuselage min. waterline width grad.: " << Fuselage_MinWaterLineWidth_Grad << ". "; - cout << "Fuselage max. waterline width grad.: " << Fuselage_MaxWaterLineWidth_Grad << "." << endl; + cout << "\nFuselage volume grad.: " << Fuselage_Volume_Grad << ". "; + cout << "Fuselage wetted area grad.: " << Fuselage_WettedArea_Grad << ". "; + cout << "Fuselage min. width grad.: " << Fuselage_MinWidth_Grad << ". "; + cout << "Fuselage max. width grad.: " << Fuselage_MaxWidth_Grad << "." << endl; + cout << "Fuselage min. waterline width grad.: " << Fuselage_MinWaterLineWidth_Grad << ". "; + cout << "Fuselage max. waterline width grad.: " << Fuselage_MaxWaterLineWidth_Grad << "." << endl; cout << "Fuselage min. height grad.: " << Fuselage_MinHeight_Grad << ". "; cout << "Fuselage max. height grad.: " << Fuselage_MaxHeight_Grad << ". "; - cout << "Fuselage max. curv. grad.: " << Fuselage_MaxCurvature_Grad << "."; + cout << "Fuselage max. curv. grad.: " << Fuselage_MaxCurvature_Grad << "."; } for (iPlane = 0; iPlane < nPlane; iPlane++) { if (Xcoord_Airfoil[iPlane].size() > 1) { - cout << "\nStation " << (iPlane+1) << ". XCoord: " << Plane_P0[iPlane][0] << ". "; - cout << "Area grad.: " << Gradient[0*nPlane + iPlane] << ". "; - cout << "Length grad.: " << Gradient[1*nPlane + iPlane] << ". "; - cout << "Width grad.: " << Gradient[2*nPlane + iPlane] << ". "; - cout << "Waterline width grad.: " << Gradient[3*nPlane + iPlane] << ". "; - cout << "Height grad.: " << Gradient[4*nPlane + iPlane] << ". "; + cout << "\nStation " << (iPlane + 1) << ". XCoord: " << Plane_P0[iPlane][0] << ". "; + cout << "Area grad.: " << Gradient[0 * nPlane + iPlane] << ". "; + cout << "Length grad.: " << Gradient[1 * nPlane + iPlane] << ". "; + cout << "Width grad.: " << Gradient[2 * nPlane + iPlane] << ". "; + cout << "Waterline width grad.: " << Gradient[3 * nPlane + iPlane] << ". "; + cout << "Height grad.: " << Gradient[4 * nPlane + iPlane] << ". "; } } - } - else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { + } else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { if (geometry_container[ZONE_0]->GetnDim() == 3) { - cout << "\nNacelle volume grad.: " << Nacelle_Volume_Grad << ". "; - cout << "Nacelle min. thickness grad.: " << Nacelle_MinThickness_Grad << ". "; - cout << "Nacelle max. thickness grad.: " << Nacelle_MaxThickness_Grad << ". "; - cout << "Nacelle min. chord grad.: " << Nacelle_MinChord_Grad << ". "; - cout << "Nacelle max. chord grad.: " << Nacelle_MaxChord_Grad << "." << endl; - cout << "Nacelle min. LE radius grad.: " << Nacelle_MinChord_Grad << ". "; - cout << "Nacelle max. LE radius grad.: " << Nacelle_MaxChord_Grad << ". "; - cout << "Nacelle min. ToC grad.: " << Nacelle_MinToC_Grad << ". "; - cout << "Nacelle max. ToC grad.: " << Nacelle_MaxToC_Grad << ". "; - cout << "Nacelle delta ToC grad.: " << Nacelle_ObjFun_MinToC_Grad << "." << endl; - cout << "Nacelle max. twist grad.: " << Nacelle_MaxTwist_Grad << ". "; + cout << "\nNacelle volume grad.: " << Nacelle_Volume_Grad << ". "; + cout << "Nacelle min. thickness grad.: " << Nacelle_MinThickness_Grad << ". "; + cout << "Nacelle max. thickness grad.: " << Nacelle_MaxThickness_Grad << ". "; + cout << "Nacelle min. chord grad.: " << Nacelle_MinChord_Grad << ". "; + cout << "Nacelle max. chord grad.: " << Nacelle_MaxChord_Grad << "." << endl; + cout << "Nacelle min. LE radius grad.: " << Nacelle_MinChord_Grad << ". "; + cout << "Nacelle max. LE radius grad.: " << Nacelle_MaxChord_Grad << ". "; + cout << "Nacelle min. ToC grad.: " << Nacelle_MinToC_Grad << ". "; + cout << "Nacelle max. ToC grad.: " << Nacelle_MaxToC_Grad << ". "; + cout << "Nacelle delta ToC grad.: " << Nacelle_ObjFun_MinToC_Grad << "." << endl; + cout << "Nacelle max. twist grad.: " << Nacelle_MaxTwist_Grad << ". "; } for (iPlane = 0; iPlane < nPlane; iPlane++) { if (Xcoord_Airfoil[iPlane].size() > 1) { - cout << "\nStation " << (iPlane+1) << ". YCoord: " << Plane_P0[iPlane][1] << ". "; - cout << "Area grad.: " << Gradient[0*nPlane + iPlane] << ". "; - cout << "Thickness grad.: " << Gradient[1*nPlane + iPlane] << ". "; - cout << "Chord grad.: " << Gradient[2*nPlane + iPlane] << ". "; - cout << "LE radius grad.: " << Gradient[3*nPlane + iPlane] << ". "; - cout << "ToC grad.: " << Gradient[4*nPlane + iPlane] << ". "; - cout << "Twist angle grad.: " << Gradient[5*nPlane + iPlane] << ". "; + cout << "\nStation " << (iPlane + 1) << ". YCoord: " << Plane_P0[iPlane][1] << ". "; + cout << "Area grad.: " << Gradient[0 * nPlane + iPlane] << ". "; + cout << "Thickness grad.: " << Gradient[1 * nPlane + iPlane] << ". "; + cout << "Chord grad.: " << Gradient[2 * nPlane + iPlane] << ". "; + cout << "LE radius grad.: " << Gradient[3 * nPlane + iPlane] << ". "; + cout << "ToC grad.: " << Gradient[4 * nPlane + iPlane] << ". "; + cout << "Twist angle grad.: " << Gradient[5 * nPlane + iPlane] << ". "; } } - } - else { + } else { if (geometry_container[ZONE_0]->GetnDim() == 3) { - cout << "\nWing volume grad.: " << Wing_Volume_Grad << ". "; - cout << "Wing min. thickness grad.: " << Wing_MinThickness_Grad << ". "; - cout << "Wing max. thickness grad.: " << Wing_MaxThickness_Grad << ". "; - cout << "Wing min. chord grad.: " << Wing_MinChord_Grad << ". "; - cout << "Wing max. chord grad.: " << Wing_MaxChord_Grad << "." << endl; - cout << "Wing min. LE radius grad.: " << Wing_MinChord_Grad << ". "; - cout << "Wing max. LE radius grad.: " << Wing_MaxChord_Grad << ". "; - cout << "Wing min. ToC grad.: " << Wing_MinToC_Grad << ". "; - cout << "Wing max. ToC grad.: " << Wing_MaxToC_Grad << ". "; - cout << "Wing delta ToC grad.: " << Wing_ObjFun_MinToC_Grad << "." << endl; - cout << "Wing max. twist grad.: " << Wing_MaxTwist_Grad << ". "; - cout << "Wing max. curv. grad.: " << Wing_MaxCurvature_Grad << ". "; - cout << "Wing max. dihedral grad.: " << Wing_MaxDihedral_Grad << "." << endl; + cout << "\nWing volume grad.: " << Wing_Volume_Grad << ". "; + cout << "Wing min. thickness grad.: " << Wing_MinThickness_Grad << ". "; + cout << "Wing max. thickness grad.: " << Wing_MaxThickness_Grad << ". "; + cout << "Wing min. chord grad.: " << Wing_MinChord_Grad << ". "; + cout << "Wing max. chord grad.: " << Wing_MaxChord_Grad << "." << endl; + cout << "Wing min. LE radius grad.: " << Wing_MinChord_Grad << ". "; + cout << "Wing max. LE radius grad.: " << Wing_MaxChord_Grad << ". "; + cout << "Wing min. ToC grad.: " << Wing_MinToC_Grad << ". "; + cout << "Wing max. ToC grad.: " << Wing_MaxToC_Grad << ". "; + cout << "Wing delta ToC grad.: " << Wing_ObjFun_MinToC_Grad << "." << endl; + cout << "Wing max. twist grad.: " << Wing_MaxTwist_Grad << ". "; + cout << "Wing max. curv. grad.: " << Wing_MaxCurvature_Grad << ". "; + cout << "Wing max. dihedral grad.: " << Wing_MaxDihedral_Grad << "." << endl; } for (iPlane = 0; iPlane < nPlane; iPlane++) { if (Xcoord_Airfoil[iPlane].size() > 1) { - cout << "\nStation " << (iPlane+1) << ". YCoord: " << Plane_P0[iPlane][1] << ". "; - cout << "Area grad.: " << Gradient[0*nPlane + iPlane] << ". "; - cout << "Thickness grad.: " << Gradient[1*nPlane + iPlane] << ". "; - cout << "Chord grad.: " << Gradient[2*nPlane + iPlane] << ". "; - cout << "LE radius grad.: " << Gradient[3*nPlane + iPlane] << ". "; - cout << "ToC grad.: " << Gradient[4*nPlane + iPlane] << ". "; - cout << "Twist angle grad.: " << Gradient[5*nPlane + iPlane] << ". "; + cout << "\nStation " << (iPlane + 1) << ". YCoord: " << Plane_P0[iPlane][1] << ". "; + cout << "Area grad.: " << Gradient[0 * nPlane + iPlane] << ". "; + cout << "Thickness grad.: " << Gradient[1 * nPlane + iPlane] << ". "; + cout << "Chord grad.: " << Gradient[2 * nPlane + iPlane] << ". "; + cout << "LE radius grad.: " << Gradient[3 * nPlane + iPlane] << ". "; + cout << "ToC grad.: " << Gradient[4 * nPlane + iPlane] << ". "; + cout << "Twist angle grad.: " << Gradient[5 * nPlane + iPlane] << ". "; } } } cout << endl; - if (iDV == 0) { if (tabTecplot) Gradient_file << "TITLE = \"SU2_GEO Gradient\"" << endl; if (tabTecplot) Gradient_file << "VARIABLES = //" << endl; if (geometry_container[ZONE_0]->GetnDim() == 2) { - Gradient_file << "\"DESIGN_VARIABLE\",\"AIRFOIL_AREA\",\"AIRFOIL_THICKNESS\",\"AIRFOIL_CHORD\",\"AIRFOIL_LE_RADIUS\",\"AIRFOIL_TOC\",\"AIRFOIL_ALPHA\""; - } - else if (geometry_container[ZONE_0]->GetnDim() == 3) { - + Gradient_file << "\"DESIGN_VARIABLE\",\"AIRFOIL_AREA\",\"AIRFOIL_THICKNESS\",\"AIRFOIL_CHORD\",\"AIRFOIL_" + "LE_RADIUS\",\"AIRFOIL_TOC\",\"AIRFOIL_ALPHA\""; + } else if (geometry_container[ZONE_0]->GetnDim() == 3) { if (config_container[ZONE_0]->GetGeo_Description() == FUSELAGE) { Gradient_file << "\"DESIGN_VARIABLE\","; - Gradient_file << "\"FUSELAGE_VOLUME\",\"FUSELAGE_WETTED_AREA\",\"FUSELAGE_MIN_WIDTH\",\"FUSELAGE_MAX_WIDTH\",\"FUSELAGE_MIN_WATERLINE_WIDTH\",\"FUSELAGE_MAX_WATERLINE_WIDTH\",\"FUSELAGE_MIN_HEIGHT\",\"FUSELAGE_MAX_HEIGHT\",\"FUSELAGE_MAX_CURVATURE\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_AREA\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_LENGTH\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_WIDTH\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_WATERLINE_WIDTH\","; + Gradient_file << "\"FUSELAGE_VOLUME\",\"FUSELAGE_WETTED_AREA\",\"FUSELAGE_MIN_WIDTH\",\"FUSELAGE_MAX_" + "WIDTH\",\"FUSELAGE_MIN_WATERLINE_WIDTH\",\"FUSELAGE_MAX_WATERLINE_WIDTH\",\"FUSELAGE_" + "MIN_HEIGHT\",\"FUSELAGE_MAX_HEIGHT\",\"FUSELAGE_MAX_CURVATURE\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION" << (iPlane + 1) << "_AREA\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION" << (iPlane + 1) << "_LENGTH\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION" << (iPlane + 1) << "_WIDTH\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) + Gradient_file << "\"STATION" << (iPlane + 1) << "_WATERLINE_WIDTH\","; for (iPlane = 0; iPlane < nPlane; iPlane++) { - Gradient_file << "\"STATION"<< (iPlane+1) << "_HEIGHT\""; - if (iPlane != nPlane-1) Gradient_file << ","; + Gradient_file << "\"STATION" << (iPlane + 1) << "_HEIGHT\""; + if (iPlane != nPlane - 1) Gradient_file << ","; } - } - else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { + } else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { Gradient_file << "\"DESIGN_VARIABLE\","; - Gradient_file << "\"NACELLE_VOLUME\",\"NACELLE_MIN_THICKNESS\",\"NACELLE_MAX_THICKNESS\",\"NACELLE_MIN_CHORD\",\"NACELLE_MAX_CHORD\",\"NACELLE_MIN_LE_RADIUS\",\"NACELLE_MAX_LE_RADIUS\",\"NACELLE_MIN_TOC\",\"NACELLE_MAX_TOC\",\"NACELLE_OBJFUN_MIN_TOC\",\"NACELLE_MAX_TWIST\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_AREA\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_THICKNESS\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_CHORD\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_LE_RADIUS\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_TOC\","; + Gradient_file + << "\"NACELLE_VOLUME\",\"NACELLE_MIN_THICKNESS\",\"NACELLE_MAX_THICKNESS\",\"NACELLE_MIN_CHORD\"," + "\"NACELLE_MAX_CHORD\",\"NACELLE_MIN_LE_RADIUS\",\"NACELLE_MAX_LE_RADIUS\",\"NACELLE_MIN_TOC\"," + "\"NACELLE_MAX_TOC\",\"NACELLE_OBJFUN_MIN_TOC\",\"NACELLE_MAX_TWIST\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION" << (iPlane + 1) << "_AREA\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) + Gradient_file << "\"STATION" << (iPlane + 1) << "_THICKNESS\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION" << (iPlane + 1) << "_CHORD\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) + Gradient_file << "\"STATION" << (iPlane + 1) << "_LE_RADIUS\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION" << (iPlane + 1) << "_TOC\","; for (iPlane = 0; iPlane < nPlane; iPlane++) { - Gradient_file << "\"STATION"<< (iPlane+1) << "_TWIST\""; - if (iPlane != nPlane-1) Gradient_file << ","; + Gradient_file << "\"STATION" << (iPlane + 1) << "_TWIST\""; + if (iPlane != nPlane - 1) Gradient_file << ","; } - } - else { + } else { Gradient_file << "\"DESIGN_VARIABLE\","; - Gradient_file << "\"WING_VOLUME\",\"WING_MIN_THICKNESS\",\"WING_MAX_THICKNESS\",\"WING_MIN_CHORD\",\"WING_MAX_CHORD\",\"WING_MIN_LE_RADIUS\",\"WING_MAX_LE_RADIUS\",\"WING_MIN_TOC\",\"WING_MAX_TOC\",\"WING_OBJFUN_MIN_TOC\",\"WING_MAX_TWIST\",\"WING_MAX_CURVATURE\",\"WING_MAX_DIHEDRAL\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_AREA\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_THICKNESS\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_CHORD\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_LE_RADIUS\","; - for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION"<< (iPlane+1) << "_TOC\","; + Gradient_file + << "\"WING_VOLUME\",\"WING_MIN_THICKNESS\",\"WING_MAX_THICKNESS\",\"WING_MIN_CHORD\",\"WING_MAX_" + "CHORD\",\"WING_MIN_LE_RADIUS\",\"WING_MAX_LE_RADIUS\",\"WING_MIN_TOC\",\"WING_MAX_TOC\",\"WING_" + "OBJFUN_MIN_TOC\",\"WING_MAX_TWIST\",\"WING_MAX_CURVATURE\",\"WING_MAX_DIHEDRAL\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION" << (iPlane + 1) << "_AREA\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) + Gradient_file << "\"STATION" << (iPlane + 1) << "_THICKNESS\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION" << (iPlane + 1) << "_CHORD\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) + Gradient_file << "\"STATION" << (iPlane + 1) << "_LE_RADIUS\","; + for (iPlane = 0; iPlane < nPlane; iPlane++) Gradient_file << "\"STATION" << (iPlane + 1) << "_TOC\","; for (iPlane = 0; iPlane < nPlane; iPlane++) { - Gradient_file << "\"STATION"<< (iPlane+1) << "_TWIST\""; - if (iPlane != nPlane-1) Gradient_file << ","; + Gradient_file << "\"STATION" << (iPlane + 1) << "_TWIST\""; + if (iPlane != nPlane - 1) Gradient_file << ","; } } - } - if (tabTecplot) Gradient_file << "\nZONE T= \"Geometrical variables (gradient)\"" << endl; - else Gradient_file << endl; + if (tabTecplot) + Gradient_file << "\nZONE T= \"Geometrical variables (gradient)\"" << endl; + else + Gradient_file << endl; } - Gradient_file << (iDV) <<","; + Gradient_file << (iDV) << ","; if (config_container[ZONE_0]->GetGeo_Description() == FUSELAGE) { if (geometry_container[ZONE_0]->GetnDim() == 3) { - Gradient_file << Fuselage_Volume_Grad <<","<< Fuselage_WettedArea_Grad <<","<< Fuselage_MinWidth_Grad <<","<< Fuselage_MaxWidth_Grad <<","<< Fuselage_MinWaterLineWidth_Grad <<","<< Fuselage_MaxWaterLineWidth_Grad <<","<< Fuselage_MinHeight_Grad <<","<< Fuselage_MaxHeight_Grad <<","<< Fuselage_MaxCurvature_Grad <<","; + Gradient_file << Fuselage_Volume_Grad << "," << Fuselage_WettedArea_Grad << "," << Fuselage_MinWidth_Grad + << "," << Fuselage_MaxWidth_Grad << "," << Fuselage_MinWaterLineWidth_Grad << "," + << Fuselage_MaxWaterLineWidth_Grad << "," << Fuselage_MinHeight_Grad << "," + << Fuselage_MaxHeight_Grad << "," << Fuselage_MaxCurvature_Grad << ","; } - for (iPlane = 0; iPlane < nPlane*5; iPlane++) { + for (iPlane = 0; iPlane < nPlane * 5; iPlane++) { Gradient_file << Gradient[iPlane]; - if (iPlane != (nPlane*5)-1) Gradient_file <<","; + if (iPlane != (nPlane * 5) - 1) Gradient_file << ","; } - } - else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { + } else if (config_container[ZONE_0]->GetGeo_Description() == NACELLE) { if (geometry_container[ZONE_0]->GetnDim() == 3) { - Gradient_file << Nacelle_Volume_Grad <<","<< Nacelle_MinThickness_Grad <<","<< Nacelle_MaxThickness_Grad <<","<< Nacelle_MinChord_Grad <<","<< Nacelle_MaxChord_Grad <<","<< Nacelle_MinLERadius_Grad <<","<< Nacelle_MaxLERadius_Grad<<","<< Nacelle_MinToC_Grad <<","<< Nacelle_MaxToC_Grad <<","<< Nacelle_ObjFun_MinToC_Grad <<","<< Nacelle_MaxTwist_Grad <<","; + Gradient_file << Nacelle_Volume_Grad << "," << Nacelle_MinThickness_Grad << "," << Nacelle_MaxThickness_Grad + << "," << Nacelle_MinChord_Grad << "," << Nacelle_MaxChord_Grad << "," + << Nacelle_MinLERadius_Grad << "," << Nacelle_MaxLERadius_Grad << "," << Nacelle_MinToC_Grad + << "," << Nacelle_MaxToC_Grad << "," << Nacelle_ObjFun_MinToC_Grad << "," + << Nacelle_MaxTwist_Grad << ","; } - for (iPlane = 0; iPlane < nPlane*6; iPlane++) { + for (iPlane = 0; iPlane < nPlane * 6; iPlane++) { Gradient_file << Gradient[iPlane]; - if (iPlane != (nPlane*6)-1) Gradient_file <<","; + if (iPlane != (nPlane * 6) - 1) Gradient_file << ","; } - } - else { + } else { if (geometry_container[ZONE_0]->GetnDim() == 3) { - Gradient_file << Wing_Volume_Grad <<","<< Wing_MinThickness_Grad <<","<< Wing_MaxThickness_Grad <<","<< Wing_MinChord_Grad <<","<< Wing_MaxChord_Grad <<","<< Wing_MinLERadius_Grad <<","<< Wing_MaxLERadius_Grad<<","<< Wing_MinToC_Grad <<","<< Wing_MaxToC_Grad <<","<< Wing_ObjFun_MinToC_Grad <<","<< Wing_MaxTwist_Grad <<","<< Wing_MaxCurvature_Grad <<","<< Wing_MaxDihedral_Grad <<","; + Gradient_file << Wing_Volume_Grad << "," << Wing_MinThickness_Grad << "," << Wing_MaxThickness_Grad << "," + << Wing_MinChord_Grad << "," << Wing_MaxChord_Grad << "," << Wing_MinLERadius_Grad << "," + << Wing_MaxLERadius_Grad << "," << Wing_MinToC_Grad << "," << Wing_MaxToC_Grad << "," + << Wing_ObjFun_MinToC_Grad << "," << Wing_MaxTwist_Grad << "," << Wing_MaxCurvature_Grad + << "," << Wing_MaxDihedral_Grad << ","; } - for (iPlane = 0; iPlane < nPlane*6; iPlane++) { + for (iPlane = 0; iPlane < nPlane * 6; iPlane++) { Gradient_file << Gradient[iPlane]; - if (iPlane != (nPlane*6)-1) Gradient_file <<","; + if (iPlane != (nPlane * 6) - 1) Gradient_file << ","; } } Gradient_file << endl; - if (iDV != (config_container[ZONE_0]->GetnDV()-1)) cout <<"-------------------------------------------------------------------------" << endl; - + if (iDV != (config_container[ZONE_0]->GetnDV() - 1)) + cout << "-------------------------------------------------------------------------" << endl; } - } - if (rank == MASTER_NODE) - Gradient_file.close(); - + if (rank == MASTER_NODE) Gradient_file.close(); } if (rank == MASTER_NODE) - cout << endl <<"------------------------- Solver Postprocessing -------------------------" << endl; + cout << endl << "------------------------- Finalize Solver -------------------------" << endl; - delete [] Xcoord_Airfoil; delete [] Ycoord_Airfoil; delete [] Zcoord_Airfoil; + delete[] Xcoord_Airfoil; + delete[] Ycoord_Airfoil; + delete[] Zcoord_Airfoil; - delete [] ObjectiveFunc; delete [] ObjectiveFunc_New; delete [] Gradient; + delete[] ObjectiveFunc; + delete[] ObjectiveFunc_New; + delete[] Gradient; - for(iPlane = 0; iPlane < nPlane; iPlane++ ) { + for (iPlane = 0; iPlane < nPlane; iPlane++) { delete Plane_P0[iPlane]; delete Plane_Normal[iPlane]; } - delete [] Plane_P0; - delete [] Plane_Normal; + delete[] Plane_P0; + delete[] Plane_Normal; delete config; config = nullptr; if (rank == MASTER_NODE) cout << "Deleted main variables." << endl; - if (geometry_container != nullptr) { for (iZone = 0; iZone < nZone; iZone++) { if (geometry_container[iZone] != nullptr) { delete geometry_container[iZone]; } } - delete [] geometry_container; + delete[] geometry_container; } if (rank == MASTER_NODE) cout << "Deleted CGeometry container." << endl; @@ -1256,7 +1465,7 @@ int main(int argc, char *argv[]) { delete FFDBox[iFFDBox]; } } - delete [] FFDBox; + delete[] FFDBox; } if (rank == MASTER_NODE) cout << "Deleted CFreeFormDefBox class." << endl; @@ -1266,7 +1475,7 @@ int main(int argc, char *argv[]) { delete config_container[iZone]; } } - delete [] config_container; + delete[] config_container; } if (rank == MASTER_NODE) cout << "Deleted CConfig container." << endl; @@ -1277,21 +1486,22 @@ int main(int argc, char *argv[]) { /*--- Compute/print the total time for performance benchmarking. ---*/ - UsedTime = StopTime-StartTime; + UsedTime = StopTime - StartTime; if (rank == MASTER_NODE) { - cout << "\n\nCompleted in " << fixed << UsedTime << " seconds on "<< size; - if (size == 1) cout << " core." << endl; else cout << " cores." << endl; + cout << "\n\nCompleted in " << fixed << UsedTime << " seconds on " << size; + if (size == 1) + cout << " core." << endl; + else + cout << " cores." << endl; } /*--- Exit the solver cleanly ---*/ if (rank == MASTER_NODE) - cout << endl <<"------------------------- Exit Success (SU2_GEO) ------------------------" << endl << endl; - + cout << endl << "------------------------- Exit Success (SU2_GEO) ------------------------" << endl << endl; /*--- Finalize MPI parallelization ---*/ SU2_MPI::Finalize(); return EXIT_SUCCESS; - } diff --git a/SU2_GEO/src/meson.build b/SU2_GEO/src/meson.build index 13e7e6f8875..dbbbbd25333 100644 --- a/SU2_GEO/src/meson.build +++ b/SU2_GEO/src/meson.build @@ -4,6 +4,6 @@ if get_option('enable-normal') su2_geo = executable('SU2_GEO', su2_geo_src, install: true, - dependencies: [su2_deps, common_dep], + dependencies: [su2_deps, common_dep], cpp_args : [default_warning_flags, su2_cpp_args]) endif diff --git a/SU2_IDE/Eclipse/README b/SU2_IDE/Eclipse/README index 454e31b4ebc..07c6b1c46f5 100644 --- a/SU2_IDE/Eclipse/README +++ b/SU2_IDE/Eclipse/README @@ -2,10 +2,10 @@ This README file includes instructions on how to use Eclipse with the SU2 github repository. It is assumed that Eclipse has already been installed. ------------------------------------------------------------------------------- 1. Initial Eclipse Set-up -In order to view files with helpful text highlighting and code navigation +In order to view files with helpful text highlighting and code navigation tools, install the packages for C++, Python, and Git: Help -> Install New Software - Install packages for Git, C++ and Python, for example: + Install packages for Git, C++ and Python, for example: C/C++ Development Tools SDK Eclipse EGit PyDev for Eclipse @@ -13,8 +13,8 @@ tools, install the packages for C++, Python, and Git: ------------------------------------------------------------------------------- 2. Get the code -2a.If you have already cloned the SU2 source code, or prefer to clone via the -command line, you will need to import this project into the Eclipse Workspace: +2a.If you have already cloned the SU2 source code, or prefer to clone via the +command line, you will need to import this project into the Eclipse Workspace: File -> New -> Makefile project with existing code Name the project and navigate to the appropriate directory. Make sure "C++" is checked and select "finish" @@ -37,13 +37,13 @@ command line, you will need to import this project into the Eclipse Workspace: If you did not clone the repository using Egit: Window -> open perspective -> Git Repository Exploring Window -> Show View -> Git Repositories - Add the repository: + Add the repository: In the Git repositories window, select "add an existing local git - repository to this view". + repository to this view". Browse to the location where you cloned the repository, select "finish" - When in the Git perspective, you will be able to see your local github - repositories and graphically explore the branch structure. + When in the Git perspective, you will be able to see your local github + repositories and graphically explore the branch structure. ------------------------------------------------------------------------------- @@ -54,7 +54,3 @@ If you did not clone the repository using Egit: Select Project-> Properties to edit Eclipse behavior ------------------------------------------------------------------------------- - - - - diff --git a/SU2_PY/FSI_tools/FSIInterface.py b/SU2_PY/FSI_tools/FSIInterface.py index 7e2f19403e2..4375d53c58d 100644 --- a/SU2_PY/FSI_tools/FSIInterface.py +++ b/SU2_PY/FSI_tools/FSIInterface.py @@ -3,7 +3,7 @@ ## \file FSIInterface.py # \brief FSI interface class that handles fluid/solid solvers synchronisation and communication. # \authors Nicola Fonzi, Vittorio Cavalieri based on the work of David Thomas -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -41,6 +41,7 @@ # FSI Interface Class # ---------------------------------------------------------------------- + class Interface: """ FSI interface class that handles fluid/solid solvers synchronisation and communication @@ -52,161 +53,239 @@ def __init__(self, FSI_config, FluidSolver, SolidSolver, have_MPI): """ if have_MPI: - from mpi4py import MPI - self.MPI = MPI - self.comm = MPI.COMM_WORLD #MPI World communicator - self.have_MPI = True - myid = self.comm.Get_rank() - else: - self.comm = 0 - self.have_MPI = False - myid = 0 - - self.rootProcess = 0 #the root process is chosen to be MPI rank = 0 - - self.nDim = FSI_config['NDIM'] #problem dimension - - self.haveFluidSolver = False #True if the fluid solver is initialized on the current rank - self.haveSolidSolver = False #True if the solid solver is initialized on the current rank - self.haveFluidInterface = False #True if the current rank owns at least one fluid interface node - self.haveSolidInterface = False #True if the current rank owns at least one solid interface node - - self.fluidSolverProcessors = list() #list of partitions where the fluid solver is initialized - self.solidSolverProcessors = list() #list of partitions where the solid solver is initialized - self.fluidInterfaceProcessors = list() #list of partitions where there are fluid interface nodes - self.solidInterfaceProcessors = list() #list of partitions where there are solid interface nodes - - self.fluidInterfaceIdentifier = None #object that can identify the f/s interface within the fluid solver - self.solidInterfaceIdentifier = None #object that can identify the f/s interface within the solid solver - - self.fluidGlobalIndexRange = {} #contains the global FSI indexing of each fluid interface node for all partitions - self.solidGlobalIndexRange = {} #contains the global FSI indexing of each solid interface node for all partitions - - self.FluidHaloNodeList = {} #contains the the indices (fluid solver indexing) of the halo nodes for each partition - self.fluidIndexing = {} #links between the fluid solver indexing and the FSI indexing for the interface nodes - self.SolidHaloNodeList = {} #contains the the indices (solid solver indexing) of the halo nodes for each partition - self.solidIndexing = {} #links between the solid solver indexing and the FSI indexing for the interface nodes - - self.nLocalFluidInterfaceNodes = 0 #number of nodes (halo nodes included) on the fluid interface, on each partition - self.nLocalFluidInterfaceHaloNode = 0 #number of halo nodes on the fluid intrface, on each partition - self.nLocalFluidInterfacePhysicalNodes = 0 #number of physical (= non halo) nodes on the fluid interface, on each partition - self.nFluidInterfaceNodes = np.array(int(0)) #number of nodes on the fluid interface, sum over all the partitions - self.nFluidInterfacePhysicalNodes = np.array(int(0)) #number of physical nodes on the fluid interface, sum over all partitions - - self.nLocalSolidInterfaceNodes = 0 #number of physical nodes on the solid interface, on each partition - self.nLocalSolidInterfaceHaloNode = 0 #number of halo nodes on the solid intrface, on each partition - self.nLocalSolidInterfacePhysicalNodes = 0 #number of physical (= non halo) nodes on the solid interface, on each partition - self.nSolidInterfaceNodes = np.array(int(0)) #number of nodes on the solid interface, sum over all partitions - self.nSolidInterfacePhysicalNodes = np.array(int(0)) #number of physical nodes on the solid interface, sum over all partitions - - if FSI_config['MATCHING_MESH'] == 'NO' and (FSI_config['MESH_INTERP_METHOD'] == 'RBF' or FSI_config['MESH_INTERP_METHOD'] == 'TPS'): - self.MappingMatrixA = None - self.MappingMatrixA_T = None - self.MappingMatrixB = None - self.MappingMatrixB_T = None - self.d_RBF = self.nDim+1 - else: - self.MappingMatrix = None #interpolation/mapping matrix for meshes interpolation/mapping - self.MappingMatrix_T = None #transposed interpolation/mapping matrix for meshes interpolation/mapping - self.d_RBF = 0 - - self.localFluidInterface_array_X_init = None #initial fluid interface position on each partition (used for the meshes mapping) + from mpi4py import MPI + + self.MPI = MPI + self.comm = MPI.COMM_WORLD # MPI World communicator + self.have_MPI = True + myid = self.comm.Get_rank() + else: + self.comm = 0 + self.have_MPI = False + myid = 0 + + self.rootProcess = 0 # the root process is chosen to be MPI rank = 0 + + self.nDim = FSI_config["NDIM"] # problem dimension + + self.haveFluidSolver = ( + False # True if the fluid solver is initialized on the current rank + ) + self.haveSolidSolver = ( + False # True if the solid solver is initialized on the current rank + ) + self.haveFluidInterface = ( + False # True if the current rank owns at least one fluid interface node + ) + self.haveSolidInterface = ( + False # True if the current rank owns at least one solid interface node + ) + + self.fluidSolverProcessors = ( + list() + ) # list of partitions where the fluid solver is initialized + self.solidSolverProcessors = ( + list() + ) # list of partitions where the solid solver is initialized + self.fluidInterfaceProcessors = ( + list() + ) # list of partitions where there are fluid interface nodes + self.solidInterfaceProcessors = ( + list() + ) # list of partitions where there are solid interface nodes + + self.fluidInterfaceIdentifier = ( + None # object that can identify the f/s interface within the fluid solver + ) + self.solidInterfaceIdentifier = ( + None # object that can identify the f/s interface within the solid solver + ) + + self.fluidGlobalIndexRange = ( + {} + ) # contains the global FSI indexing of each fluid interface node for all partitions + self.solidGlobalIndexRange = ( + {} + ) # contains the global FSI indexing of each solid interface node for all partitions + + self.FluidHaloNodeList = ( + {} + ) # contains the the indices (fluid solver indexing) of the halo nodes for each partition + self.fluidIndexing = ( + {} + ) # links between the fluid solver indexing and the FSI indexing for the interface nodes + self.SolidHaloNodeList = ( + {} + ) # contains the the indices (solid solver indexing) of the halo nodes for each partition + self.solidIndexing = ( + {} + ) # links between the solid solver indexing and the FSI indexing for the interface nodes + + self.nLocalFluidInterfaceNodes = 0 # number of nodes (halo nodes included) on the fluid interface, on each partition + self.nLocalFluidInterfaceHaloNode = ( + 0 # number of halo nodes on the fluid intrface, on each partition + ) + self.nLocalFluidInterfacePhysicalNodes = 0 # number of physical (= non halo) nodes on the fluid interface, on each partition + self.nFluidInterfaceNodes = np.array( + int(0) + ) # number of nodes on the fluid interface, sum over all the partitions + self.nFluidInterfacePhysicalNodes = np.array( + int(0) + ) # number of physical nodes on the fluid interface, sum over all partitions + + self.nLocalSolidInterfaceNodes = ( + 0 # number of physical nodes on the solid interface, on each partition + ) + self.nLocalSolidInterfaceHaloNode = ( + 0 # number of halo nodes on the solid intrface, on each partition + ) + self.nLocalSolidInterfacePhysicalNodes = 0 # number of physical (= non halo) nodes on the solid interface, on each partition + self.nSolidInterfaceNodes = np.array( + int(0) + ) # number of nodes on the solid interface, sum over all partitions + self.nSolidInterfacePhysicalNodes = np.array( + int(0) + ) # number of physical nodes on the solid interface, sum over all partitions + + if FSI_config["MATCHING_MESH"] == "NO" and ( + FSI_config["MESH_INTERP_METHOD"] == "RBF" + or FSI_config["MESH_INTERP_METHOD"] == "TPS" + ): + self.MappingMatrixA = None + self.MappingMatrixA_T = None + self.MappingMatrixB = None + self.MappingMatrixB_T = None + self.d_RBF = self.nDim + 1 + else: + self.MappingMatrix = ( + None # interpolation/mapping matrix for meshes interpolation/mapping + ) + self.MappingMatrix_T = None # transposed interpolation/mapping matrix for meshes interpolation/mapping + self.d_RBF = 0 + + self.localFluidInterface_array_X_init = None # initial fluid interface position on each partition (used for the meshes mapping) self.localFluidInterface_array_Y_init = None self.localFluidInterface_array_Z_init = None - self.localSolidInterface_array_X_init = None #initial solid interface position on each partition (used for mesh mapping) + self.localSolidInterface_array_X_init = None # initial solid interface position on each partition (used for mesh mapping) self.localSolidInterface_array_Y_init = None self.localSolidInterface_array_Z_init = None - self.solidInterface_array_DispX = None #solid interface displacement + self.solidInterface_array_DispX = None # solid interface displacement self.solidInterface_array_DispY = None self.solidInterface_array_DispZ = None - self.solidInterfaceResidual_array_X = None #solid interface position residual + self.solidInterfaceResidual_array_X = None # solid interface position residual self.solidInterfaceResidual_array_Y = None self.solidInterfaceResidual_array_Z = None - self.solidInterfaceResidualnM1_array_X = None #solid interface position residual at the previous BGS iteration + self.solidInterfaceResidualnM1_array_X = ( + None # solid interface position residual at the previous BGS iteration + ) self.solidInterfaceResidualnM1_array_Y = None self.solidInterfaceResidualnM1_array_Z = None - self.fluidInterface_array_DispX = None #fluid interface displacement + self.fluidInterface_array_DispX = None # fluid interface displacement self.fluidInterface_array_DispY = None self.fluidInterface_array_DispZ = None - self.fluidLoads_array_X = None #loads on the fluid side of the f/s interface + self.fluidLoads_array_X = None # loads on the fluid side of the f/s interface self.fluidLoads_array_Y = None self.fluidLoads_array_Z = None - self.solidLoads_array_X = None #loads on the solid side of the f/s interface + self.solidLoads_array_X = None # loads on the solid side of the f/s interface self.solidLoads_array_Y = None self.solidLoads_array_Z = None - self.aitkenParam = FSI_config['AITKEN_PARAM'] #relaxation parameter for the BGS method - self.FSIIter = 0 #current FSI iteration - self.unsteady = False #flag for steady or unsteady simulation (default is steady) - if FSI_config['IMPOSED_MOTION']=='YES': - self.ImposedMotion = True + self.aitkenParam = FSI_config[ + "AITKEN_PARAM" + ] # relaxation parameter for the BGS method + self.FSIIter = 0 # current FSI iteration + self.unsteady = ( + False # flag for steady or unsteady simulation (default is steady) + ) + if FSI_config["IMPOSED_MOTION"] == "YES": + self.ImposedMotion = True else: - self.ImposedMotion = False + self.ImposedMotion = False # ---Some screen output --- - self.MPIPrint('Fluid solver : SU2_CFD') - self.MPIPrint('Solid solver : {}'.format(FSI_config['CSD_SOLVER'])) - - if FSI_config['TIME_MARCHING'] == 'YES': - self.MPIPrint('Unsteady coupled simulation with physical time step : {} s'.format(FSI_config['UNST_TIMESTEP'])) - self.unsteady = True + self.MPIPrint("Fluid solver : SU2_CFD") + self.MPIPrint("Solid solver : {}".format(FSI_config["CSD_SOLVER"])) + + if FSI_config["TIME_MARCHING"] == "YES": + self.MPIPrint( + "Unsteady coupled simulation with physical time step : {} s".format( + FSI_config["UNST_TIMESTEP"] + ) + ) + self.unsteady = True else: - self.MPIPrint('Steady coupled simulation') + self.MPIPrint("Steady coupled simulation") - if FSI_config['MATCHING_MESH'] == 'YES': - self.MPIPrint('Matching fluid-solid interface') + if FSI_config["MATCHING_MESH"] == "YES": + self.MPIPrint("Matching fluid-solid interface") else: - if FSI_config['MESH_INTERP_METHOD'] == 'TPS': - self.MPIPrint('Non matching fluid-solid interface with Thin Plate Spline interpolation') - elif FSI_config['MESH_INTERP_METHOD'] == 'RBF': - self.MPIPrint('Non matching fluid-solid interface with Radial Basis Function interpolation') - self.RBF_rad = FSI_config['RBF_RADIUS'] - self.MPIPrint('Radius value : {}'.format(self.RBF_rad)) - else: - self.MPIPrint('Non matching fluid-solid interface with Nearest Neighboor interpolation') - - self.MPIPrint('Solid predictor : {}'.format(FSI_config['DISP_PRED'])) - - self.MPIPrint('Maximum number of FSI iterations : {}'.format(FSI_config['NB_FSI_ITER'])) - - self.MPIPrint('FSI tolerance : {}'.format(FSI_config['FSI_TOLERANCE'])) - - if FSI_config['AITKEN_RELAX'] == 'STATIC': - self.MPIPrint('Static Aitken under-relaxation with constant parameter {}'.format(FSI_config['AITKEN_PARAM'])) - elif FSI_config['AITKEN_RELAX'] == 'DYNAMIC': - self.MPIPrint('Dynamic Aitken under-relaxation with initial parameter {}'.format(FSI_config['AITKEN_PARAM'])) + if FSI_config["MESH_INTERP_METHOD"] == "TPS": + self.MPIPrint( + "Non matching fluid-solid interface with Thin Plate Spline interpolation" + ) + elif FSI_config["MESH_INTERP_METHOD"] == "RBF": + self.MPIPrint( + "Non matching fluid-solid interface with Radial Basis Function interpolation" + ) + self.RBF_rad = FSI_config["RBF_RADIUS"] + self.MPIPrint("Radius value : {}".format(self.RBF_rad)) + else: + self.MPIPrint( + "Non matching fluid-solid interface with Nearest Neighboor interpolation" + ) + + self.MPIPrint("Solid predictor : {}".format(FSI_config["DISP_PRED"])) + + self.MPIPrint( + "Maximum number of FSI iterations : {}".format(FSI_config["NB_FSI_ITER"]) + ) + + self.MPIPrint("FSI tolerance : {}".format(FSI_config["FSI_TOLERANCE"])) + + if FSI_config["AITKEN_RELAX"] == "STATIC": + self.MPIPrint( + "Static Aitken under-relaxation with constant parameter {}".format( + FSI_config["AITKEN_PARAM"] + ) + ) + elif FSI_config["AITKEN_RELAX"] == "DYNAMIC": + self.MPIPrint( + "Dynamic Aitken under-relaxation with initial parameter {}".format( + FSI_config["AITKEN_PARAM"] + ) + ) else: - self.MPIPrint('No Aitken under-relaxation') + self.MPIPrint("No Aitken under-relaxation") - self.MPIPrint('FSI interface is set') + self.MPIPrint("FSI interface is set") def MPIPrint(self, message): - """ - Print a message on screen only from the master process. - """ + """ + Print a message on screen only from the master process. + """ - if self.have_MPI: - myid = self.comm.Get_rank() - else: - myid = 0 + if self.have_MPI: + myid = self.comm.Get_rank() + else: + myid = 0 - if myid == self.rootProcess: - print(message) + if myid == self.rootProcess: + print(message) def MPIBarrier(self): - """ - Perform a synchronization barrier in case of parallel run with MPI. - """ + """ + Perform a synchronization barrier in case of parallel run with MPI. + """ - if self.have_MPI: - self.comm.barrier() + if self.have_MPI: + self.comm.barrier() def connect(self, FSI_config, FluidSolver, SolidSolver): """ @@ -215,115 +294,144 @@ def connect(self, FSI_config, FluidSolver, SolidSolver): Gets information about f/s interfaces from the two solvers. """ if self.have_MPI: - myid = self.comm.Get_rank() - MPIsize = self.comm.Get_size() + myid = self.comm.Get_rank() + MPIsize = self.comm.Get_size() else: - myid = 0 - MPIsize = 1 + myid = 0 + MPIsize = 1 # --- Identify the fluid and solid interfaces and store the number of nodes on both sides (and for each partition) --- self.fluidInterfaceIdentifier = None self.nLocalFluidInterfaceNodes = 0 if FluidSolver is not None: - print('Fluid solver is initialized on process {}'.format(myid)) + print("Fluid solver is initialized on process {}".format(myid)) self.haveFluidSolver = True - allMovingMarkersTags = FluidSolver.GetAllDeformMeshMarkersTag() - allMarkersID = FluidSolver.GetAllBoundaryMarkers() + allMovingMarkersTags = FluidSolver.GetDeformableMarkerTags() + allMarkersID = FluidSolver.GetMarkerTags() if not allMovingMarkersTags: - raise Exception('No interface for FSI was defined.') + raise Exception("No interface for FSI was defined.") else: if allMovingMarkersTags[0] in allMarkersID.keys(): - self.fluidInterfaceIdentifier = allMarkersID[allMovingMarkersTags[0]] + self.fluidInterfaceIdentifier = allMarkersID[ + allMovingMarkersTags[0] + ] if self.fluidInterfaceIdentifier is not None: - self.nLocalFluidInterfaceNodes = FluidSolver.GetNumberVertices(self.fluidInterfaceIdentifier) + self.nLocalFluidInterfaceNodes = FluidSolver.GetNumberMarkerNodes( + self.fluidInterfaceIdentifier + ) if self.nLocalFluidInterfaceNodes != 0: - self.haveFluidInterface = True - print('Number of interface fluid nodes (halo nodes included) on proccess {} : {}'.format(myid,self.nLocalFluidInterfaceNodes)) + self.haveFluidInterface = True + print( + "Number of interface fluid nodes (halo nodes included) on proccess {} : {}".format( + myid, self.nLocalFluidInterfaceNodes + ) + ) else: pass if SolidSolver is not None: - print('Solid solver is initialized on process {}'.format(myid)) + print("Solid solver is initialized on process {}".format(myid)) self.haveSolidSolver = True self.solidInterfaceIdentifier = SolidSolver.getFSIMarkerID() - self.nLocalSolidInterfaceNodes = SolidSolver.getNumberOfSolidInterfaceNodes(self.solidInterfaceIdentifier) + self.nLocalSolidInterfaceNodes = SolidSolver.getNumberOfSolidInterfaceNodes( + self.solidInterfaceIdentifier + ) if self.nLocalSolidInterfaceNodes != 0: - self.haveSolidInterface = True - print('Number of interface solid nodes (halo nodes included) on proccess {} : {}'.format(myid,self.nLocalSolidInterfaceNodes)) + self.haveSolidInterface = True + print( + "Number of interface solid nodes (halo nodes included) on proccess {} : {}".format( + myid, self.nLocalSolidInterfaceNodes + ) + ) else: pass # --- Exchange information about processors on which the solvers are defined and where the interface nodes are lying --- if self.have_MPI: - if self.haveFluidSolver: - sendBufFluid = np.array(int(1)) - else: - sendBufFluid = np.array(int(0)) - if self.haveSolidSolver: - sendBufSolid = np.array(int(1)) - else: - sendBufSolid = np.array(int(0)) - if self.haveFluidInterface: - sendBufFluidInterface = np.array(int(1)) - else: - sendBufFluidInterface = np.array(int(0)) - if self.haveSolidInterface: - sendBufSolidInterface = np.array(int(1)) - else: - sendBufSolidInterface = np.array(int(0)) - rcvBufFluid = np.zeros(MPIsize, dtype = int) - rcvBufSolid = np.zeros(MPIsize, dtype = int) - rcvBufFluidInterface = np.zeros(MPIsize, dtype = int) - rcvBufSolidInterface = np.zeros(MPIsize, dtype = int) - self.comm.Allgather(sendBufFluid, rcvBufFluid) - self.comm.Allgather(sendBufSolid, rcvBufSolid) - self.comm.Allgather(sendBufFluidInterface, rcvBufFluidInterface) - self.comm.Allgather(sendBufSolidInterface, rcvBufSolidInterface) - for iProc in range(MPIsize): - if rcvBufFluid[iProc] == 1: - self.fluidSolverProcessors.append(iProc) - if rcvBufSolid[iProc] == 1: - self.solidSolverProcessors.append(iProc) - if rcvBufFluidInterface[iProc] == 1: - self.fluidInterfaceProcessors.append(iProc) - if rcvBufSolidInterface[iProc] == 1: - self.solidInterfaceProcessors.append(iProc) - del sendBufFluid, sendBufSolid, rcvBufFluid, rcvBufSolid, sendBufFluidInterface, sendBufSolidInterface, rcvBufFluidInterface, rcvBufSolidInterface - else: - self.fluidSolverProcessors.append(0) - self.solidSolverProcessors.append(0) - self.fluidInterfaceProcessors.append(0) - self.solidInterfaceProcessors.append(0) + if self.haveFluidSolver: + sendBufFluid = np.array(int(1)) + else: + sendBufFluid = np.array(int(0)) + if self.haveSolidSolver: + sendBufSolid = np.array(int(1)) + else: + sendBufSolid = np.array(int(0)) + if self.haveFluidInterface: + sendBufFluidInterface = np.array(int(1)) + else: + sendBufFluidInterface = np.array(int(0)) + if self.haveSolidInterface: + sendBufSolidInterface = np.array(int(1)) + else: + sendBufSolidInterface = np.array(int(0)) + rcvBufFluid = np.zeros(MPIsize, dtype=int) + rcvBufSolid = np.zeros(MPIsize, dtype=int) + rcvBufFluidInterface = np.zeros(MPIsize, dtype=int) + rcvBufSolidInterface = np.zeros(MPIsize, dtype=int) + self.comm.Allgather(sendBufFluid, rcvBufFluid) + self.comm.Allgather(sendBufSolid, rcvBufSolid) + self.comm.Allgather(sendBufFluidInterface, rcvBufFluidInterface) + self.comm.Allgather(sendBufSolidInterface, rcvBufSolidInterface) + for iProc in range(MPIsize): + if rcvBufFluid[iProc] == 1: + self.fluidSolverProcessors.append(iProc) + if rcvBufSolid[iProc] == 1: + self.solidSolverProcessors.append(iProc) + if rcvBufFluidInterface[iProc] == 1: + self.fluidInterfaceProcessors.append(iProc) + if rcvBufSolidInterface[iProc] == 1: + self.solidInterfaceProcessors.append(iProc) + del ( + sendBufFluid, + sendBufSolid, + rcvBufFluid, + rcvBufSolid, + sendBufFluidInterface, + sendBufSolidInterface, + rcvBufFluidInterface, + rcvBufSolidInterface, + ) + else: + self.fluidSolverProcessors.append(0) + self.solidSolverProcessors.append(0) + self.fluidInterfaceProcessors.append(0) + self.solidInterfaceProcessors.append(0) self.MPIBarrier() # --- Calculate the total number of nodes at the fluid interface (sum over all the partitions) --- # Calculate the number of halo nodes on each partition self.nLocalFluidInterfaceHaloNode = 0 for iVertex in range(self.nLocalFluidInterfaceNodes): - if FluidSolver.IsAHaloNode(self.fluidInterfaceIdentifier, iVertex): - GlobalIndex = FluidSolver.GetVertexGlobalIndex(self.fluidInterfaceIdentifier, iVertex) - self.FluidHaloNodeList[GlobalIndex] = iVertex - self.nLocalFluidInterfaceHaloNode += 1 + iPoint = FluidSolver.GetMarkerNode(self.fluidInterfaceIdentifier, iVertex) + if not FluidSolver.GetNodeDomain(iPoint): + GlobalIndex = FluidSolver.GetNodeGlobalIndex(iPoint) + self.FluidHaloNodeList[GlobalIndex] = iVertex + self.nLocalFluidInterfaceHaloNode += 1 # Calculate the number of physical (= not halo) nodes on each partition - self.nLocalFluidInterfacePhysicalNodes = self.nLocalFluidInterfaceNodes - self.nLocalFluidInterfaceHaloNode + self.nLocalFluidInterfacePhysicalNodes = ( + self.nLocalFluidInterfaceNodes - self.nLocalFluidInterfaceHaloNode + ) if self.have_MPI: - self.FluidHaloNodeList = self.comm.allgather(self.FluidHaloNodeList) + self.FluidHaloNodeList = self.comm.allgather(self.FluidHaloNodeList) else: - self.FluidHaloNodeList = [{}] + self.FluidHaloNodeList = [{}] # Same thing for the solid part self.nLocalSolidInterfaceHaloNode = 0 for iVertex in range(self.nLocalSolidInterfaceNodes): if SolidSolver.IsAHaloNode(self.solidInterfaceIdentifier, iVertex): - GlobalIndex = SolidSolver.getVertexGlobalIndex(self.solidInterfaceIdentifier, iVertex) - self.SolidHaloNodeList[GlobalIndex] = iVertex - self.nLocalSolidInterfaceHaloNode += 1 - self.nLocalSolidInterfacePhysicalNodes = self.nLocalSolidInterfaceNodes - self.nLocalSolidInterfaceHaloNode + GlobalIndex = SolidSolver.getVertexGlobalIndex( + self.solidInterfaceIdentifier, iVertex + ) + self.SolidHaloNodeList[GlobalIndex] = iVertex + self.nLocalSolidInterfaceHaloNode += 1 + self.nLocalSolidInterfacePhysicalNodes = ( + self.nLocalSolidInterfaceNodes - self.nLocalSolidInterfaceHaloNode + ) if self.have_MPI: - self.SolidHaloNodeList = self.comm.allgather(self.SolidHaloNodeList) + self.SolidHaloNodeList = self.comm.allgather(self.SolidHaloNodeList) else: - self.SolidHaloNodeList = [{}] - + self.SolidHaloNodeList = [{}] # --- Calculate the total number of nodes (with and without halo) at the fluid interface (sum over all the partitions) and broadcast the number accross all processors --- sendBuffTotal = np.array(int(self.nLocalFluidInterfaceNodes)) @@ -331,12 +439,16 @@ def connect(self, FSI_config, FluidSolver, SolidSolver): rcvBuffTotal = np.zeros(1, dtype=int) rcvBuffPhysical = np.zeros(1, dtype=int) if self.have_MPI: - self.comm.barrier() - self.comm.Allreduce(sendBuffTotal, self.nFluidInterfaceNodes, op=self.MPI.SUM) - self.comm.Allreduce(sendBuffPhysical, self.nFluidInterfacePhysicalNodes, op=self.MPI.SUM) + self.comm.barrier() + self.comm.Allreduce( + sendBuffTotal, self.nFluidInterfaceNodes, op=self.MPI.SUM + ) + self.comm.Allreduce( + sendBuffPhysical, self.nFluidInterfacePhysicalNodes, op=self.MPI.SUM + ) else: - self.nFluidInterfaceNodes = np.copy(sendBuffTotal) - self.nFluidInterfacePhysicalNodes = np.copy(sendBuffPhysical) + self.nFluidInterfaceNodes = np.copy(sendBuffTotal) + self.nFluidInterfacePhysicalNodes = np.copy(sendBuffPhysical) del sendBuffTotal, rcvBuffTotal, sendBuffPhysical, rcvBuffPhysical # Same thing for the solid part @@ -345,111 +457,153 @@ def connect(self, FSI_config, FluidSolver, SolidSolver): rcvBuffTotal = np.zeros(1, dtype=int) rcvBuffPhysical = np.zeros(1, dtype=int) if self.have_MPI: - self.comm.barrier() - self.comm.Allreduce(sendBuffTotal, self.nSolidInterfaceNodes, op=self.MPI.SUM) - self.comm.Allreduce(sendBuffPhysical, self.nSolidInterfacePhysicalNodes, op=self.MPI.SUM) + self.comm.barrier() + self.comm.Allreduce( + sendBuffTotal, self.nSolidInterfaceNodes, op=self.MPI.SUM + ) + self.comm.Allreduce( + sendBuffPhysical, self.nSolidInterfacePhysicalNodes, op=self.MPI.SUM + ) else: - self.nSolidInterfaceNodes = np.copy(sendBuffTotal) - self.nSolidInterfacePhysicalNodes = np.copy(sendBuffPhysical) + self.nSolidInterfaceNodes = np.copy(sendBuffTotal) + self.nSolidInterfacePhysicalNodes = np.copy(sendBuffPhysical) del sendBuffTotal, rcvBuffTotal, sendBuffPhysical, rcvBuffPhysical # --- Store the number of physical interface nodes on each processor and allgather the information --- self.fluidPhysicalInterfaceNodesDistribution = np.zeros(MPIsize, dtype=int) if self.have_MPI: - sendBuffPhysical = np.array(int(self.nLocalFluidInterfacePhysicalNodes)) - self.comm.Allgather(sendBuffPhysical,self.fluidPhysicalInterfaceNodesDistribution) - del sendBuffPhysical + sendBuffPhysical = np.array(int(self.nLocalFluidInterfacePhysicalNodes)) + self.comm.Allgather( + sendBuffPhysical, self.fluidPhysicalInterfaceNodesDistribution + ) + del sendBuffPhysical else: - self.fluidPhysicalInterfaceNodesDistribution[0] = self.nFluidInterfacePhysicalNodes + self.fluidPhysicalInterfaceNodesDistribution[ + 0 + ] = self.nFluidInterfacePhysicalNodes # Same thing for the solid part self.solidPhysicalInterfaceNodesDistribution = np.zeros(MPIsize, dtype=int) if self.have_MPI: - sendBuffPhysical = np.array(int(self.nLocalSolidInterfacePhysicalNodes)) - self.comm.Allgather(sendBuffPhysical,self.solidPhysicalInterfaceNodesDistribution) - del sendBuffPhysical + sendBuffPhysical = np.array(int(self.nLocalSolidInterfacePhysicalNodes)) + self.comm.Allgather( + sendBuffPhysical, self.solidPhysicalInterfaceNodesDistribution + ) + del sendBuffPhysical else: - self.solidPhysicalInterfaceNodesDistribution[0] = self.nSolidInterfacePhysicalNodes + self.solidPhysicalInterfaceNodesDistribution[ + 0 + ] = self.nSolidInterfacePhysicalNodes # --- Calculate and store the global indexing of interface physical nodes on each processor and allgather the information --- if self.have_MPI: - if myid in self.fluidInterfaceProcessors: - globalIndexStart = 0 - for iProc in range(myid): - globalIndexStart += self.fluidPhysicalInterfaceNodesDistribution[iProc] - globalIndexStop = globalIndexStart + self.nLocalFluidInterfacePhysicalNodes-1 - else: - globalIndexStart = 0 - globalIndexStop = 0 - self.fluidGlobalIndexRange[myid] = [globalIndexStart,globalIndexStop] - self.fluidGlobalIndexRange = self.comm.allgather(self.fluidGlobalIndexRange) - else: - temp = {} - temp[0] = [0,self.nLocalFluidInterfacePhysicalNodes-1] - self.fluidGlobalIndexRange = list() - self.fluidGlobalIndexRange.append(temp) + if myid in self.fluidInterfaceProcessors: + globalIndexStart = 0 + for iProc in range(myid): + globalIndexStart += self.fluidPhysicalInterfaceNodesDistribution[ + iProc + ] + globalIndexStop = ( + globalIndexStart + self.nLocalFluidInterfacePhysicalNodes - 1 + ) + else: + globalIndexStart = 0 + globalIndexStop = 0 + self.fluidGlobalIndexRange[myid] = [globalIndexStart, globalIndexStop] + self.fluidGlobalIndexRange = self.comm.allgather(self.fluidGlobalIndexRange) + else: + temp = {} + temp[0] = [0, self.nLocalFluidInterfacePhysicalNodes - 1] + self.fluidGlobalIndexRange = list() + self.fluidGlobalIndexRange.append(temp) # Same thing for the solid part if self.have_MPI: - if myid in self.solidInterfaceProcessors: - globalIndexStart = 0 - for iProc in range(myid): - globalIndexStart += self.solidPhysicalInterfaceNodesDistribution[iProc] - globalIndexStop = globalIndexStart + self.nLocalSolidInterfacePhysicalNodes-1 - else: - globalIndexStart = 0 - globalIndexStop = 0 - self.solidGlobalIndexRange[myid] = [globalIndexStart,globalIndexStop] - self.solidGlobalIndexRange = self.comm.allgather(self.solidGlobalIndexRange) - else: - temp = {} - temp[0] = [0,self.nSolidInterfacePhysicalNodes-1] - self.solidGlobalIndexRange = list() - self.solidGlobalIndexRange.append(temp) - - self.MPIPrint('Total number of fluid interface nodes (halo nodes included) : {}'.format(self.nFluidInterfaceNodes)) - self.MPIPrint('Total number of solid interface nodes (halo nodes included) : {}'.format(self.nSolidInterfaceNodes)) - self.MPIPrint('Total number of fluid interface nodes : {}'.format(self.nFluidInterfacePhysicalNodes)) - self.MPIPrint('Total number of solid interface nodes : {}'.format(self.nSolidInterfacePhysicalNodes)) + if myid in self.solidInterfaceProcessors: + globalIndexStart = 0 + for iProc in range(myid): + globalIndexStart += self.solidPhysicalInterfaceNodesDistribution[ + iProc + ] + globalIndexStop = ( + globalIndexStart + self.nLocalSolidInterfacePhysicalNodes - 1 + ) + else: + globalIndexStart = 0 + globalIndexStop = 0 + self.solidGlobalIndexRange[myid] = [globalIndexStart, globalIndexStop] + self.solidGlobalIndexRange = self.comm.allgather(self.solidGlobalIndexRange) + else: + temp = {} + temp[0] = [0, self.nSolidInterfacePhysicalNodes - 1] + self.solidGlobalIndexRange = list() + self.solidGlobalIndexRange.append(temp) + + self.MPIPrint( + "Total number of fluid interface nodes (halo nodes included) : {}".format( + self.nFluidInterfaceNodes + ) + ) + self.MPIPrint( + "Total number of solid interface nodes (halo nodes included) : {}".format( + self.nSolidInterfaceNodes + ) + ) + self.MPIPrint( + "Total number of fluid interface nodes : {}".format( + self.nFluidInterfacePhysicalNodes + ) + ) + self.MPIPrint( + "Total number of solid interface nodes : {}".format( + self.nSolidInterfacePhysicalNodes + ) + ) self.MPIBarrier() # --- Create all the PETSc vectors required for parallel communication and parallel mesh mapping/interpolation (working for serial too) --- if self.have_MPI: - self.solidInterface_array_DispX = PETSc.Vec().create(self.comm) - self.solidInterface_array_DispY = PETSc.Vec().create(self.comm) - self.solidInterface_array_DispZ = PETSc.Vec().create(self.comm) - self.solidInterface_array_DispX.setType('mpi') - self.solidInterface_array_DispY.setType('mpi') - self.solidInterface_array_DispZ.setType('mpi') - else: - self.solidInterface_array_DispX = PETSc.Vec().create() - self.solidInterface_array_DispY = PETSc.Vec().create() - self.solidInterface_array_DispZ = PETSc.Vec().create() - self.solidInterface_array_DispX.setType('seq') - self.solidInterface_array_DispY.setType('seq') - self.solidInterface_array_DispZ.setType('seq') - self.solidInterface_array_DispX.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - self.solidInterface_array_DispY.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - self.solidInterface_array_DispZ.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) + self.solidInterface_array_DispX = PETSc.Vec().create(self.comm) + self.solidInterface_array_DispY = PETSc.Vec().create(self.comm) + self.solidInterface_array_DispZ = PETSc.Vec().create(self.comm) + self.solidInterface_array_DispX.setType("mpi") + self.solidInterface_array_DispY.setType("mpi") + self.solidInterface_array_DispZ.setType("mpi") + else: + self.solidInterface_array_DispX = PETSc.Vec().create() + self.solidInterface_array_DispY = PETSc.Vec().create() + self.solidInterface_array_DispZ = PETSc.Vec().create() + self.solidInterface_array_DispX.setType("seq") + self.solidInterface_array_DispY.setType("seq") + self.solidInterface_array_DispZ.setType("seq") + self.solidInterface_array_DispX.setSizes( + self.nSolidInterfacePhysicalNodes + self.d_RBF + ) + self.solidInterface_array_DispY.setSizes( + self.nSolidInterfacePhysicalNodes + self.d_RBF + ) + self.solidInterface_array_DispZ.setSizes( + self.nSolidInterfacePhysicalNodes + self.d_RBF + ) self.solidInterface_array_DispX.set(0.0) self.solidInterface_array_DispY.set(0.0) self.solidInterface_array_DispZ.set(0.0) if self.have_MPI: - self.fluidInterface_array_DispX = PETSc.Vec().create(self.comm) - self.fluidInterface_array_DispY = PETSc.Vec().create(self.comm) - self.fluidInterface_array_DispZ = PETSc.Vec().create(self.comm) - self.fluidInterface_array_DispX.setType('mpi') - self.fluidInterface_array_DispY.setType('mpi') - self.fluidInterface_array_DispZ.setType('mpi') - else: - self.fluidInterface_array_DispX = PETSc.Vec().create() - self.fluidInterface_array_DispY = PETSc.Vec().create() - self.fluidInterface_array_DispZ = PETSc.Vec().create() - self.fluidInterface_array_DispX.setType('seq') - self.fluidInterface_array_DispY.setType('seq') - self.fluidInterface_array_DispZ.setType('seq') + self.fluidInterface_array_DispX = PETSc.Vec().create(self.comm) + self.fluidInterface_array_DispY = PETSc.Vec().create(self.comm) + self.fluidInterface_array_DispZ = PETSc.Vec().create(self.comm) + self.fluidInterface_array_DispX.setType("mpi") + self.fluidInterface_array_DispY.setType("mpi") + self.fluidInterface_array_DispZ.setType("mpi") + else: + self.fluidInterface_array_DispX = PETSc.Vec().create() + self.fluidInterface_array_DispY = PETSc.Vec().create() + self.fluidInterface_array_DispZ = PETSc.Vec().create() + self.fluidInterface_array_DispX.setType("seq") + self.fluidInterface_array_DispY.setType("seq") + self.fluidInterface_array_DispZ.setType("seq") self.fluidInterface_array_DispX.setSizes(self.nFluidInterfacePhysicalNodes) self.fluidInterface_array_DispY.setSizes(self.nFluidInterfacePhysicalNodes) self.fluidInterface_array_DispZ.setSizes(self.nFluidInterfacePhysicalNodes) @@ -458,19 +612,19 @@ def connect(self, FSI_config, FluidSolver, SolidSolver): self.fluidInterface_array_DispZ.set(0.0) if self.have_MPI: - self.fluidLoads_array_X = PETSc.Vec().create(self.comm) - self.fluidLoads_array_Y = PETSc.Vec().create(self.comm) - self.fluidLoads_array_Z = PETSc.Vec().create(self.comm) - self.fluidLoads_array_X.setType('mpi') - self.fluidLoads_array_Y.setType('mpi') - self.fluidLoads_array_Z.setType('mpi') - else: - self.fluidLoads_array_X = PETSc.Vec().create() - self.fluidLoads_array_Y = PETSc.Vec().create() - self.fluidLoads_array_Z = PETSc.Vec().create() - self.fluidLoads_array_X.setType('seq') - self.fluidLoads_array_Y.setType('seq') - self.fluidLoads_array_Z.setType('seq') + self.fluidLoads_array_X = PETSc.Vec().create(self.comm) + self.fluidLoads_array_Y = PETSc.Vec().create(self.comm) + self.fluidLoads_array_Z = PETSc.Vec().create(self.comm) + self.fluidLoads_array_X.setType("mpi") + self.fluidLoads_array_Y.setType("mpi") + self.fluidLoads_array_Z.setType("mpi") + else: + self.fluidLoads_array_X = PETSc.Vec().create() + self.fluidLoads_array_Y = PETSc.Vec().create() + self.fluidLoads_array_Z = PETSc.Vec().create() + self.fluidLoads_array_X.setType("seq") + self.fluidLoads_array_Y.setType("seq") + self.fluidLoads_array_Z.setType("seq") self.fluidLoads_array_X.setSizes(self.nFluidInterfacePhysicalNodes) self.fluidLoads_array_Y.setSizes(self.nFluidInterfacePhysicalNodes) self.fluidLoads_array_Z.setSizes(self.nFluidInterfacePhysicalNodes) @@ -479,108 +633,133 @@ def connect(self, FSI_config, FluidSolver, SolidSolver): self.fluidLoads_array_Z.set(0.0) if self.have_MPI: - self.solidLoads_array_X = PETSc.Vec().create(self.comm) - self.solidLoads_array_Y = PETSc.Vec().create(self.comm) - self.solidLoads_array_Z = PETSc.Vec().create(self.comm) - self.solidLoads_array_X.setType('mpi') - self.solidLoads_array_Y.setType('mpi') - self.solidLoads_array_Z.setType('mpi') - else: - self.solidLoads_array_X = PETSc.Vec().create() - self.solidLoads_array_Y = PETSc.Vec().create() - self.solidLoads_array_Z = PETSc.Vec().create() - self.solidLoads_array_X.setType('seq') - self.solidLoads_array_Y.setType('seq') - self.solidLoads_array_Z.setType('seq') - self.solidLoads_array_X.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - self.solidLoads_array_Y.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - self.solidLoads_array_Z.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) + self.solidLoads_array_X = PETSc.Vec().create(self.comm) + self.solidLoads_array_Y = PETSc.Vec().create(self.comm) + self.solidLoads_array_Z = PETSc.Vec().create(self.comm) + self.solidLoads_array_X.setType("mpi") + self.solidLoads_array_Y.setType("mpi") + self.solidLoads_array_Z.setType("mpi") + else: + self.solidLoads_array_X = PETSc.Vec().create() + self.solidLoads_array_Y = PETSc.Vec().create() + self.solidLoads_array_Z = PETSc.Vec().create() + self.solidLoads_array_X.setType("seq") + self.solidLoads_array_Y.setType("seq") + self.solidLoads_array_Z.setType("seq") + self.solidLoads_array_X.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) + self.solidLoads_array_Y.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) + self.solidLoads_array_Z.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) self.solidLoads_array_X.set(0.0) self.solidLoads_array_Y.set(0.0) self.solidLoads_array_Z.set(0.0) # --- Create the PETSc vectors required for parallel relaxed BGS algo (working for serial too) --- if self.have_MPI: - self.solidInterfaceResidual_array_X = PETSc.Vec().create(self.comm) - self.solidInterfaceResidual_array_Y = PETSc.Vec().create(self.comm) - self.solidInterfaceResidual_array_Z = PETSc.Vec().create(self.comm) - self.solidInterfaceResidual_array_X.setType('mpi') - self.solidInterfaceResidual_array_Y.setType('mpi') - self.solidInterfaceResidual_array_Z.setType('mpi') - else: - self.solidInterfaceResidual_array_X = PETSc.Vec().create() - self.solidInterfaceResidual_array_Y = PETSc.Vec().create() - self.solidInterfaceResidual_array_Z = PETSc.Vec().create() - self.solidInterfaceResidual_array_X.setType('seq') - self.solidInterfaceResidual_array_Y.setType('seq') - self.solidInterfaceResidual_array_Z.setType('seq') - self.solidInterfaceResidual_array_X.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - self.solidInterfaceResidual_array_Y.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - self.solidInterfaceResidual_array_Z.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) + self.solidInterfaceResidual_array_X = PETSc.Vec().create(self.comm) + self.solidInterfaceResidual_array_Y = PETSc.Vec().create(self.comm) + self.solidInterfaceResidual_array_Z = PETSc.Vec().create(self.comm) + self.solidInterfaceResidual_array_X.setType("mpi") + self.solidInterfaceResidual_array_Y.setType("mpi") + self.solidInterfaceResidual_array_Z.setType("mpi") + else: + self.solidInterfaceResidual_array_X = PETSc.Vec().create() + self.solidInterfaceResidual_array_Y = PETSc.Vec().create() + self.solidInterfaceResidual_array_Z = PETSc.Vec().create() + self.solidInterfaceResidual_array_X.setType("seq") + self.solidInterfaceResidual_array_Y.setType("seq") + self.solidInterfaceResidual_array_Z.setType("seq") + self.solidInterfaceResidual_array_X.setSizes( + self.nSolidInterfacePhysicalNodes + self.d_RBF + ) + self.solidInterfaceResidual_array_Y.setSizes( + self.nSolidInterfacePhysicalNodes + self.d_RBF + ) + self.solidInterfaceResidual_array_Z.setSizes( + self.nSolidInterfacePhysicalNodes + self.d_RBF + ) self.solidInterfaceResidual_array_X.set(0.0) self.solidInterfaceResidual_array_Y.set(0.0) self.solidInterfaceResidual_array_Z.set(0.0) if self.have_MPI: - self.solidInterfaceResidualnM1_array_X = PETSc.Vec().create(self.comm) - self.solidInterfaceResidualnM1_array_Y = PETSc.Vec().create(self.comm) - self.solidInterfaceResidualnM1_array_Z = PETSc.Vec().create(self.comm) - self.solidInterfaceResidualnM1_array_X.setType('mpi') - self.solidInterfaceResidualnM1_array_Y.setType('mpi') - self.solidInterfaceResidualnM1_array_Z.setType('mpi') - else: - self.solidInterfaceResidualnM1_array_X = PETSc.Vec().create() - self.solidInterfaceResidualnM1_array_Y = PETSc.Vec().create() - self.solidInterfaceResidualnM1_array_Z = PETSc.Vec().create() - self.solidInterfaceResidualnM1_array_X.setType('seq') - self.solidInterfaceResidualnM1_array_Y.setType('seq') - self.solidInterfaceResidualnM1_array_Z.setType('seq') - self.solidInterfaceResidualnM1_array_X.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - self.solidInterfaceResidualnM1_array_Y.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - self.solidInterfaceResidualnM1_array_Z.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) + self.solidInterfaceResidualnM1_array_X = PETSc.Vec().create(self.comm) + self.solidInterfaceResidualnM1_array_Y = PETSc.Vec().create(self.comm) + self.solidInterfaceResidualnM1_array_Z = PETSc.Vec().create(self.comm) + self.solidInterfaceResidualnM1_array_X.setType("mpi") + self.solidInterfaceResidualnM1_array_Y.setType("mpi") + self.solidInterfaceResidualnM1_array_Z.setType("mpi") + else: + self.solidInterfaceResidualnM1_array_X = PETSc.Vec().create() + self.solidInterfaceResidualnM1_array_Y = PETSc.Vec().create() + self.solidInterfaceResidualnM1_array_Z = PETSc.Vec().create() + self.solidInterfaceResidualnM1_array_X.setType("seq") + self.solidInterfaceResidualnM1_array_Y.setType("seq") + self.solidInterfaceResidualnM1_array_Z.setType("seq") + self.solidInterfaceResidualnM1_array_X.setSizes( + self.nSolidInterfacePhysicalNodes + self.d_RBF + ) + self.solidInterfaceResidualnM1_array_Y.setSizes( + self.nSolidInterfacePhysicalNodes + self.d_RBF + ) + self.solidInterfaceResidualnM1_array_Z.setSizes( + self.nSolidInterfacePhysicalNodes + self.d_RBF + ) self.solidInterfaceResidualnM1_array_X.set(0.0) self.solidInterfaceResidualnM1_array_Y.set(0.0) self.solidInterfaceResidualnM1_array_Z.set(0.0) - def interfaceMapping(self,FluidSolver, SolidSolver, FSI_config): + def interfaceMapping(self, FluidSolver, SolidSolver, FSI_config): """ Creates the one-to-one mapping between interfaces in case of matching meshes. Creates the interpolation rules between interfaces in case of non-matching meshes. """ if self.have_MPI: - myid = self.comm.Get_rank() - MPIsize = self.comm.Get_size() + myid = self.comm.Get_rank() + MPIsize = self.comm.Get_size() else: - myid = 0 - MPIsize = 1 + myid = 0 + MPIsize = 1 # --- Get the fluid interface from fluid solver on each partition --- GlobalIndex = int() localIndex = 0 fluidIndexing_temp = {} - self.localFluidInterface_array_X_init = np.zeros((self.nLocalFluidInterfacePhysicalNodes)) - self.localFluidInterface_array_Y_init = np.zeros((self.nLocalFluidInterfacePhysicalNodes)) - self.localFluidInterface_array_Z_init = np.zeros((self.nLocalFluidInterfacePhysicalNodes)) + self.localFluidInterface_array_X_init = np.zeros( + (self.nLocalFluidInterfacePhysicalNodes) + ) + self.localFluidInterface_array_Y_init = np.zeros( + (self.nLocalFluidInterfacePhysicalNodes) + ) + self.localFluidInterface_array_Z_init = np.zeros( + (self.nLocalFluidInterfacePhysicalNodes) + ) for iVertex in range(self.nLocalFluidInterfaceNodes): # Note that the fluid solver is separated in more processors outside the python script # thus when, from a core, we request for the vertices on the interface, we only obtain # those in that core - GlobalIndex = FluidSolver.GetVertexGlobalIndex(self.fluidInterfaceIdentifier, iVertex) - posx, posy, posz = FluidSolver.GetInitialMeshCoord(self.fluidInterfaceIdentifier, iVertex) + iPoint = FluidSolver.GetMarkerNode(self.fluidInterfaceIdentifier, iVertex) + GlobalIndex = FluidSolver.GetNodeGlobalIndex(iPoint) + if self.nDim == 2: + posx, posy = FluidSolver.InitialCoordinates().Get(iPoint) + posz = 0 + else: + posx, posy, posz = FluidSolver.InitialCoordinates().Get(iPoint) if GlobalIndex not in self.FluidHaloNodeList[myid].keys(): - fluidIndexing_temp[GlobalIndex] = self.__getGlobalIndex('fluid', myid, localIndex) - self.localFluidInterface_array_X_init[localIndex] = posx - self.localFluidInterface_array_Y_init[localIndex] = posy - self.localFluidInterface_array_Z_init[localIndex] = posz - localIndex += 1 + fluidIndexing_temp[GlobalIndex] = self.__getGlobalIndex( + "fluid", myid, localIndex + ) + self.localFluidInterface_array_X_init[localIndex] = posx + self.localFluidInterface_array_Y_init[localIndex] = posy + self.localFluidInterface_array_Z_init[localIndex] = posz + localIndex += 1 if self.have_MPI: - fluidIndexing_temp = self.comm.allgather(fluidIndexing_temp) - for ii in range(len(fluidIndexing_temp)): - for key, value in fluidIndexing_temp[ii].items(): - # This contains the link between the global index in python and that in SU2 - self.fluidIndexing[key] = value + fluidIndexing_temp = self.comm.allgather(fluidIndexing_temp) + for ii in range(len(fluidIndexing_temp)): + for key, value in fluidIndexing_temp[ii].items(): + # This contains the link between the global index in python and that in SU2 + self.fluidIndexing[key] = value else: - self.fluidIndexing = fluidIndexing_temp.copy() + self.fluidIndexing = fluidIndexing_temp.copy() del fluidIndexing_temp # --- Get the solid interface from solid solver on each partition --- @@ -590,181 +769,332 @@ def interfaceMapping(self,FluidSolver, SolidSolver, FSI_config): self.localSolidInterface_array_Y_init = np.zeros(self.nLocalSolidInterfaceNodes) self.localSolidInterface_array_Z_init = np.zeros(self.nLocalSolidInterfaceNodes) for iVertex in range(self.nLocalSolidInterfaceNodes): - GlobalIndex = SolidSolver.getVertexGlobalIndex(self.solidInterfaceIdentifier, iVertex) - posx, posy, posz = SolidSolver.getInterfaceNodePosInit(self.solidInterfaceIdentifier, iVertex) - if GlobalIndex not in self.SolidHaloNodeList[myid].keys(): - solidIndexing_temp[GlobalIndex] = self.__getGlobalIndex('solid', myid, localIndex) - self.localSolidInterface_array_X_init[localIndex] = posx - self.localSolidInterface_array_Y_init[localIndex] = posy - self.localSolidInterface_array_Z_init[localIndex] = posz - localIndex += 1 + GlobalIndex = SolidSolver.getVertexGlobalIndex( + self.solidInterfaceIdentifier, iVertex + ) + posx, posy, posz = SolidSolver.getInterfaceNodePosInit( + self.solidInterfaceIdentifier, iVertex + ) + if GlobalIndex not in self.SolidHaloNodeList[myid].keys(): + solidIndexing_temp[GlobalIndex] = self.__getGlobalIndex( + "solid", myid, localIndex + ) + self.localSolidInterface_array_X_init[localIndex] = posx + self.localSolidInterface_array_Y_init[localIndex] = posy + self.localSolidInterface_array_Z_init[localIndex] = posz + localIndex += 1 if self.have_MPI: - solidIndexing_temp = self.comm.allgather(solidIndexing_temp) - for ii in range(len(solidIndexing_temp)): - for key, value in solidIndexing_temp[ii].items(): - self.solidIndexing[key] = value + solidIndexing_temp = self.comm.allgather(solidIndexing_temp) + for ii in range(len(solidIndexing_temp)): + for key, value in solidIndexing_temp[ii].items(): + self.solidIndexing[key] = value else: - self.solidIndexing = solidIndexing_temp.copy() + self.solidIndexing = solidIndexing_temp.copy() del solidIndexing_temp - # --- Create the PETSc parallel interpolation matrix --- - if FSI_config['MATCHING_MESH'] == 'NO' and (FSI_config['MESH_INTERP_METHOD'] == 'RBF' or FSI_config['MESH_INTERP_METHOD'] == 'TPS'): - if self.have_MPI: - self.MappingMatrixA = PETSc.Mat().create(self.comm) - self.MappingMatrixB = PETSc.Mat().create(self.comm) - self.MappingMatrixA_T = PETSc.Mat().create(self.comm) - self.MappingMatrixB_T = PETSc.Mat().create(self.comm) - if FSI_config['MESH_INTERP_METHOD'] == 'RBF' : - self.MappingMatrixA.setType('mpiaij') - self.MappingMatrixB.setType('mpiaij') - self.MappingMatrixA_T.setType('mpiaij') - self.MappingMatrixB_T.setType('mpiaij') + if FSI_config["MATCHING_MESH"] == "NO" and ( + FSI_config["MESH_INTERP_METHOD"] == "RBF" + or FSI_config["MESH_INTERP_METHOD"] == "TPS" + ): + if self.have_MPI: + self.MappingMatrixA = PETSc.Mat().create(self.comm) + self.MappingMatrixB = PETSc.Mat().create(self.comm) + self.MappingMatrixA_T = PETSc.Mat().create(self.comm) + self.MappingMatrixB_T = PETSc.Mat().create(self.comm) + if FSI_config["MESH_INTERP_METHOD"] == "RBF": + self.MappingMatrixA.setType("mpiaij") + self.MappingMatrixB.setType("mpiaij") + self.MappingMatrixA_T.setType("mpiaij") + self.MappingMatrixB_T.setType("mpiaij") + else: + self.MappingMatrixA.setType("mpiaij") + self.MappingMatrixB.setType("mpiaij") + self.MappingMatrixA_T.setType("mpiaij") + self.MappingMatrixB_T.setType("mpiaij") else: - self.MappingMatrixA.setType('mpiaij') - self.MappingMatrixB.setType('mpiaij') - self.MappingMatrixA_T.setType('mpiaij') - self.MappingMatrixB_T.setType('mpiaij') - else: - self.MappingMatrixA = PETSc.Mat().create() - self.MappingMatrixB = PETSc.Mat().create() - self.MappingMatrixA_T = PETSc.Mat().create() - self.MappingMatrixB_T = PETSc.Mat().create() - if FSI_config['MESH_INTERP_METHOD'] == 'RBF' : - self.MappingMatrixA.setType('aij') - self.MappingMatrixB.setType('aij') - self.MappingMatrixA_T.setType('aij') - self.MappingMatrixB_T.setType('aij') + self.MappingMatrixA = PETSc.Mat().create() + self.MappingMatrixB = PETSc.Mat().create() + self.MappingMatrixA_T = PETSc.Mat().create() + self.MappingMatrixB_T = PETSc.Mat().create() + if FSI_config["MESH_INTERP_METHOD"] == "RBF": + self.MappingMatrixA.setType("aij") + self.MappingMatrixB.setType("aij") + self.MappingMatrixA_T.setType("aij") + self.MappingMatrixB_T.setType("aij") + else: + self.MappingMatrixA.setType("aij") + self.MappingMatrixB.setType("aij") + self.MappingMatrixA_T.setType("aij") + self.MappingMatrixB_T.setType("aij") + self.MappingMatrixA.setSizes( + ( + self.nSolidInterfacePhysicalNodes + self.d_RBF, + self.nSolidInterfacePhysicalNodes + self.d_RBF, + ) + ) + self.MappingMatrixA.setUp() + self.MappingMatrixA.setOption( + PETSc.Mat().Option.NEW_NONZERO_ALLOCATION_ERR, False + ) + self.MappingMatrixB.setSizes( + ( + self.nFluidInterfacePhysicalNodes, + self.nSolidInterfacePhysicalNodes + self.d_RBF, + ) + ) + self.MappingMatrixB.setUp() + self.MappingMatrixB.setOption( + PETSc.Mat().Option.NEW_NONZERO_ALLOCATION_ERR, False + ) + self.MappingMatrixA_T.setSizes( + ( + self.nSolidInterfacePhysicalNodes + self.d_RBF, + self.nSolidInterfacePhysicalNodes + self.d_RBF, + ) + ) + self.MappingMatrixA_T.setUp() + self.MappingMatrixA_T.setOption( + PETSc.Mat().Option.NEW_NONZERO_ALLOCATION_ERR, False + ) + self.MappingMatrixB_T.setSizes( + ( + self.nSolidInterfacePhysicalNodes + self.d_RBF, + self.nFluidInterfacePhysicalNodes, + ) + ) + self.MappingMatrixB_T.setUp() + self.MappingMatrixB_T.setOption( + PETSc.Mat().Option.NEW_NONZERO_ALLOCATION_ERR, False + ) + else: + if self.have_MPI: + self.MappingMatrix = PETSc.Mat().create(self.comm) + self.MappingMatrix_T = PETSc.Mat().create(self.comm) + self.MappingMatrix.setType("mpiaij") + self.MappingMatrix_T.setType("mpiaij") else: - self.MappingMatrixA.setType('aij') - self.MappingMatrixB.setType('aij') - self.MappingMatrixA_T.setType('aij') - self.MappingMatrixB_T.setType('aij') - self.MappingMatrixA.setSizes((self.nSolidInterfacePhysicalNodes+self.d_RBF, self.nSolidInterfacePhysicalNodes+self.d_RBF)) - self.MappingMatrixA.setUp() - self.MappingMatrixA.setOption(PETSc.Mat().Option.NEW_NONZERO_ALLOCATION_ERR, False) - self.MappingMatrixB.setSizes((self.nFluidInterfacePhysicalNodes, self.nSolidInterfacePhysicalNodes+self.d_RBF)) - self.MappingMatrixB.setUp() - self.MappingMatrixB.setOption(PETSc.Mat().Option.NEW_NONZERO_ALLOCATION_ERR, False) - self.MappingMatrixA_T.setSizes((self.nSolidInterfacePhysicalNodes+self.d_RBF, self.nSolidInterfacePhysicalNodes+self.d_RBF)) - self.MappingMatrixA_T.setUp() - self.MappingMatrixA_T.setOption(PETSc.Mat().Option.NEW_NONZERO_ALLOCATION_ERR, False) - self.MappingMatrixB_T.setSizes((self.nSolidInterfacePhysicalNodes+self.d_RBF, self.nFluidInterfacePhysicalNodes)) - self.MappingMatrixB_T.setUp() - self.MappingMatrixB_T.setOption(PETSc.Mat().Option.NEW_NONZERO_ALLOCATION_ERR, False) - else: - if self.have_MPI: - self.MappingMatrix = PETSc.Mat().create(self.comm) - self.MappingMatrix_T = PETSc.Mat().create(self.comm) - self.MappingMatrix.setType('mpiaij') - self.MappingMatrix_T.setType('mpiaij') - else: - self.MappingMatrix = PETSc.Mat().create() - self.MappingMatrix_T = PETSc.Mat().create() - self.MappingMatrix.setType('aij') - self.MappingMatrix_T.setType('aij') - self.MappingMatrix.setSizes((self.nFluidInterfacePhysicalNodes, self.nSolidInterfacePhysicalNodes)) - self.MappingMatrix.setUp() - self.MappingMatrix.setOption(PETSc.Mat().Option.NEW_NONZERO_ALLOCATION_ERR, False) - self.MappingMatrix_T.setSizes((self.nSolidInterfacePhysicalNodes, self.nFluidInterfacePhysicalNodes)) - self.MappingMatrix_T.setUp() - self.MappingMatrix_T.setOption(PETSc.Mat().Option.NEW_NONZERO_ALLOCATION_ERR, False) - + self.MappingMatrix = PETSc.Mat().create() + self.MappingMatrix_T = PETSc.Mat().create() + self.MappingMatrix.setType("aij") + self.MappingMatrix_T.setType("aij") + self.MappingMatrix.setSizes( + (self.nFluidInterfacePhysicalNodes, self.nSolidInterfacePhysicalNodes) + ) + self.MappingMatrix.setUp() + self.MappingMatrix.setOption( + PETSc.Mat().Option.NEW_NONZERO_ALLOCATION_ERR, False + ) + self.MappingMatrix_T.setSizes( + (self.nSolidInterfacePhysicalNodes, self.nFluidInterfacePhysicalNodes) + ) + self.MappingMatrix_T.setUp() + self.MappingMatrix_T.setOption( + PETSc.Mat().Option.NEW_NONZERO_ALLOCATION_ERR, False + ) # --- Fill the interpolation matrix in parallel (working in serial too) --- - if FSI_config['MATCHING_MESH'] == 'NO' and (FSI_config['MESH_INTERP_METHOD'] == 'RBF' or FSI_config['MESH_INTERP_METHOD'] == 'TPS'): - self.MPIPrint('Building interpolation matrices...') - if self.have_MPI: - for iProc in self.solidInterfaceProcessors: - if myid == iProc: - for jProc in self.solidInterfaceProcessors: - if jProc != iProc: - self.comm.Send(self.localSolidInterface_array_X_init, dest=jProc, tag=1) - self.comm.Send(self.localSolidInterface_array_Y_init, dest=jProc, tag=2) - self.comm.Send(self.localSolidInterface_array_Z_init, dest=jProc, tag=3) - else: - solidInterfaceBuffRcv_X = np.copy(self.localSolidInterface_array_X_init) - solidInterfaceBuffRcv_Y = np.copy(self.localSolidInterface_array_Y_init) - solidInterfaceBuffRcv_Z = np.copy(self.localSolidInterface_array_Z_init) - if myid in self.solidInterfaceProcessors: - if myid != iProc: - sizeOfBuff = self.solidPhysicalInterfaceNodesDistribution[iProc] - solidInterfaceBuffRcv_X = np.empty(sizeOfBuff, dtype=np.float64) - solidInterfaceBuffRcv_Y = np.empty(sizeOfBuff, dtype=np.float64) - solidInterfaceBuffRcv_Z = np.empty(sizeOfBuff, dtype=np.float64) - self.comm.Recv(solidInterfaceBuffRcv_X, source=iProc, tag=1) - self.comm.Recv(solidInterfaceBuffRcv_Y, source=iProc, tag=2) - self.comm.Recv(solidInterfaceBuffRcv_Z, source=iProc, tag=3) - if FSI_config['MESH_INTERP_METHOD'] == 'RBF': - self.RBFMeshMapping_A(solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, solidInterfaceBuffRcv_Z, iProc, self.RBF_rad) - else: - self.TPSMeshMapping_A(solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, solidInterfaceBuffRcv_Z, iProc) - else: - if FSI_config['MESH_INTERP_METHOD'] == 'RBF': - self.RBFMeshMapping_A(self.localSolidInterface_array_X_init, self.localSolidInterface_array_Y_init, self.localSolidInterface_array_Z_init, 0, self.RBF_rad) + if FSI_config["MATCHING_MESH"] == "NO" and ( + FSI_config["MESH_INTERP_METHOD"] == "RBF" + or FSI_config["MESH_INTERP_METHOD"] == "TPS" + ): + self.MPIPrint("Building interpolation matrices...") + if self.have_MPI: + for iProc in self.solidInterfaceProcessors: + if myid == iProc: + for jProc in self.solidInterfaceProcessors: + if jProc != iProc: + self.comm.Send( + self.localSolidInterface_array_X_init, + dest=jProc, + tag=1, + ) + self.comm.Send( + self.localSolidInterface_array_Y_init, + dest=jProc, + tag=2, + ) + self.comm.Send( + self.localSolidInterface_array_Z_init, + dest=jProc, + tag=3, + ) + else: + solidInterfaceBuffRcv_X = np.copy( + self.localSolidInterface_array_X_init + ) + solidInterfaceBuffRcv_Y = np.copy( + self.localSolidInterface_array_Y_init + ) + solidInterfaceBuffRcv_Z = np.copy( + self.localSolidInterface_array_Z_init + ) + if myid in self.solidInterfaceProcessors: + if myid != iProc: + sizeOfBuff = self.solidPhysicalInterfaceNodesDistribution[ + iProc + ] + solidInterfaceBuffRcv_X = np.empty( + sizeOfBuff, dtype=np.float64 + ) + solidInterfaceBuffRcv_Y = np.empty( + sizeOfBuff, dtype=np.float64 + ) + solidInterfaceBuffRcv_Z = np.empty( + sizeOfBuff, dtype=np.float64 + ) + self.comm.Recv(solidInterfaceBuffRcv_X, source=iProc, tag=1) + self.comm.Recv(solidInterfaceBuffRcv_Y, source=iProc, tag=2) + self.comm.Recv(solidInterfaceBuffRcv_Z, source=iProc, tag=3) + if FSI_config["MESH_INTERP_METHOD"] == "RBF": + self.RBFMeshMapping_A( + solidInterfaceBuffRcv_X, + solidInterfaceBuffRcv_Y, + solidInterfaceBuffRcv_Z, + iProc, + self.RBF_rad, + ) + else: + self.TPSMeshMapping_A( + solidInterfaceBuffRcv_X, + solidInterfaceBuffRcv_Y, + solidInterfaceBuffRcv_Z, + iProc, + ) else: - self.TPSMeshMapping_A(self.localSolidInterface_array_X_init, self.localSolidInterface_array_Y_init, self.localSolidInterface_array_Z_init, 0) - self.MappingMatrixA.assemblyBegin() - self.MappingMatrixA.assemblyEnd() - self.MappingMatrixA_T.assemblyBegin() - self.MappingMatrixA_T.assemblyEnd() - self.MPIPrint('Matrix A is built.') - else: - self.MPIPrint("Building interpolation matrix...") + if FSI_config["MESH_INTERP_METHOD"] == "RBF": + self.RBFMeshMapping_A( + self.localSolidInterface_array_X_init, + self.localSolidInterface_array_Y_init, + self.localSolidInterface_array_Z_init, + 0, + self.RBF_rad, + ) + else: + self.TPSMeshMapping_A( + self.localSolidInterface_array_X_init, + self.localSolidInterface_array_Y_init, + self.localSolidInterface_array_Z_init, + 0, + ) + self.MappingMatrixA.assemblyBegin() + self.MappingMatrixA.assemblyEnd() + self.MappingMatrixA_T.assemblyBegin() + self.MappingMatrixA_T.assemblyEnd() + self.MPIPrint("Matrix A is built.") + else: + self.MPIPrint("Building interpolation matrix...") self.MPIBarrier() if self.have_MPI: - for iProc in self.solidInterfaceProcessors: - if myid == iProc: - for jProc in self.fluidInterfaceProcessors: - if jProc != iProc: - self.comm.Send(self.localSolidInterface_array_X_init, dest=jProc, tag=1) - self.comm.Send(self.localSolidInterface_array_Y_init, dest=jProc, tag=2) - self.comm.Send(self.localSolidInterface_array_Z_init, dest=jProc, tag=3) - else: - solidInterfaceBuffRcv_X = np.copy(self.localSolidInterface_array_X_init) - solidInterfaceBuffRcv_Y = np.copy(self.localSolidInterface_array_Y_init) - solidInterfaceBuffRcv_Z = np.copy(self.localSolidInterface_array_Z_init) - if myid in self.fluidInterfaceProcessors: - if myid != iProc: - sizeOfBuff = self.solidPhysicalInterfaceNodesDistribution[iProc] - solidInterfaceBuffRcv_X = np.empty(sizeOfBuff, dtype=np.float64) - solidInterfaceBuffRcv_Y = np.empty(sizeOfBuff, dtype=np.float64) - solidInterfaceBuffRcv_Z = np.empty(sizeOfBuff, dtype=np.float64) - self.comm.Recv(solidInterfaceBuffRcv_X, source=iProc, tag=1) - self.comm.Recv(solidInterfaceBuffRcv_Y, source=iProc, tag=2) - self.comm.Recv(solidInterfaceBuffRcv_Z, source=iProc, tag=3) - if FSI_config['MATCHING_MESH'] == 'NO': - if FSI_config['MESH_INTERP_METHOD'] == 'RBF': - self.RBFMeshMapping_B(solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, solidInterfaceBuffRcv_Z, iProc, self.RBF_rad) - elif FSI_config['MESH_INTERP_METHOD'] == 'TPS': - self.TPSMeshMapping_B(solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, solidInterfaceBuffRcv_Z, iProc) + for iProc in self.solidInterfaceProcessors: + if myid == iProc: + for jProc in self.fluidInterfaceProcessors: + if jProc != iProc: + self.comm.Send( + self.localSolidInterface_array_X_init, dest=jProc, tag=1 + ) + self.comm.Send( + self.localSolidInterface_array_Y_init, dest=jProc, tag=2 + ) + self.comm.Send( + self.localSolidInterface_array_Z_init, dest=jProc, tag=3 + ) + else: + solidInterfaceBuffRcv_X = np.copy( + self.localSolidInterface_array_X_init + ) + solidInterfaceBuffRcv_Y = np.copy( + self.localSolidInterface_array_Y_init + ) + solidInterfaceBuffRcv_Z = np.copy( + self.localSolidInterface_array_Z_init + ) + if myid in self.fluidInterfaceProcessors: + if myid != iProc: + sizeOfBuff = self.solidPhysicalInterfaceNodesDistribution[iProc] + solidInterfaceBuffRcv_X = np.empty(sizeOfBuff, dtype=np.float64) + solidInterfaceBuffRcv_Y = np.empty(sizeOfBuff, dtype=np.float64) + solidInterfaceBuffRcv_Z = np.empty(sizeOfBuff, dtype=np.float64) + self.comm.Recv(solidInterfaceBuffRcv_X, source=iProc, tag=1) + self.comm.Recv(solidInterfaceBuffRcv_Y, source=iProc, tag=2) + self.comm.Recv(solidInterfaceBuffRcv_Z, source=iProc, tag=3) + if FSI_config["MATCHING_MESH"] == "NO": + if FSI_config["MESH_INTERP_METHOD"] == "RBF": + self.RBFMeshMapping_B( + solidInterfaceBuffRcv_X, + solidInterfaceBuffRcv_Y, + solidInterfaceBuffRcv_Z, + iProc, + self.RBF_rad, + ) + elif FSI_config["MESH_INTERP_METHOD"] == "TPS": + self.TPSMeshMapping_B( + solidInterfaceBuffRcv_X, + solidInterfaceBuffRcv_Y, + solidInterfaceBuffRcv_Z, + iProc, + ) + else: + self.NearestNeighboorMeshMapping( + solidInterfaceBuffRcv_X, + solidInterfaceBuffRcv_Y, + solidInterfaceBuffRcv_Z, + iProc, + ) + else: + self.matchingMeshMapping( + solidInterfaceBuffRcv_X, + solidInterfaceBuffRcv_Y, + solidInterfaceBuffRcv_Z, + iProc, + ) + else: + if FSI_config["MATCHING_MESH"] == "NO": + if FSI_config["MESH_INTERP_METHOD"] == "RBF": + self.RBFMeshMapping_B( + self.localSolidInterface_array_X_init, + self.localSolidInterface_array_Y_init, + self.localSolidInterface_array_Z_init, + 0, + self.RBF_rad, + ) + elif FSI_config["MESH_INTERP_METHOD"] == "TPS": + self.TPSMeshMapping_B( + self.localSolidInterface_array_X_init, + self.localSolidInterface_array_Y_init, + self.localSolidInterface_array_Z_init, + 0, + ) else: - self.NearestNeighboorMeshMapping(solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, solidInterfaceBuffRcv_Z, iProc) - else: - self.matchingMeshMapping(solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, solidInterfaceBuffRcv_Z, iProc) - else: - if FSI_config['MATCHING_MESH'] == 'NO': - if FSI_config['MESH_INTERP_METHOD'] == 'RBF': - self.RBFMeshMapping_B(self.localSolidInterface_array_X_init, self.localSolidInterface_array_Y_init, self.localSolidInterface_array_Z_init, 0, self.RBF_rad) - elif FSI_config['MESH_INTERP_METHOD'] == 'TPS' : - self.TPSMeshMapping_B(self.localSolidInterface_array_X_init, self.localSolidInterface_array_Y_init, self.localSolidInterface_array_Z_init, 0) + self.NearestNeighboorMeshMapping( + self.localSolidInterface_array_X_init, + self.localSolidInterface_array_Y_init, + self.localSolidInterface_array_Z_init, + 0, + ) else: - self.NearestNeighboorMeshMapping(self.localSolidInterface_array_X_init, self.localSolidInterface_array_Y_init, self.localSolidInterface_array_Z_init, 0) - else: - self.matchingMeshMapping(self.localSolidInterface_array_X_init, self.localSolidInterface_array_Y_init, self.localSolidInterface_array_Z_init, 0) - - if FSI_config['MATCHING_MESH'] == 'NO' and (FSI_config['MESH_INTERP_METHOD'] == 'RBF' or FSI_config['MESH_INTERP_METHOD'] == 'TPS'): - self.MappingMatrixB.assemblyBegin() - self.MappingMatrixB.assemblyEnd() - self.MappingMatrixB_T.assemblyBegin() - self.MappingMatrixB_T.assemblyEnd() - self.MPIPrint('Matrix B is built.') - else: - self.MappingMatrix.assemblyBegin() - self.MappingMatrix.assemblyEnd() - self.MappingMatrix_T.assemblyBegin() - self.MappingMatrix_T.assemblyEnd() - self.MPIPrint("Interpolation matrix is built.") + self.matchingMeshMapping( + self.localSolidInterface_array_X_init, + self.localSolidInterface_array_Y_init, + self.localSolidInterface_array_Z_init, + 0, + ) + + if FSI_config["MATCHING_MESH"] == "NO" and ( + FSI_config["MESH_INTERP_METHOD"] == "RBF" + or FSI_config["MESH_INTERP_METHOD"] == "TPS" + ): + self.MappingMatrixB.assemblyBegin() + self.MappingMatrixB.assemblyEnd() + self.MappingMatrixB_T.assemblyBegin() + self.MappingMatrixB_T.assemblyEnd() + self.MPIPrint("Matrix B is built.") + else: + self.MappingMatrix.assemblyBegin() + self.MappingMatrix.assemblyEnd() + self.MappingMatrix_T.assemblyBegin() + self.MappingMatrix_T.assemblyEnd() + self.MPIPrint("Interpolation matrix is built.") self.MPIBarrier() @@ -775,14 +1105,20 @@ def interfaceMapping(self,FluidSolver, SolidSolver, FSI_config): del self.localFluidInterface_array_Y_init del self.localFluidInterface_array_Z_init - def matchingMeshMapping(self,solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, solidInterfaceBuffRcv_Z, iProc): + def matchingMeshMapping( + self, + solidInterfaceBuffRcv_X, + solidInterfaceBuffRcv_Y, + solidInterfaceBuffRcv_Z, + iProc, + ): """ Fill the mapping matrix in case of matching meshes at the f/s interface. """ if self.have_MPI: - myid = self.comm.Get_rank() + myid = self.comm.Get_rank() else: - myid = 0 + myid = 0 # --- Instantiate the spatial indexing --- prop_index = index.Property() @@ -792,39 +1128,65 @@ def matchingMeshMapping(self,solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, s nSolidNodes = solidInterfaceBuffRcv_X.shape[0] for jVertex in range(nSolidNodes): - posX = solidInterfaceBuffRcv_X[jVertex] - posY = solidInterfaceBuffRcv_Y[jVertex] - posZ = solidInterfaceBuffRcv_Z[jVertex] - if self.nDim == 2 : - SolidSpatialTree.add(jVertex, (posX, posY)) - else : - SolidSpatialTree.add(jVertex, (posX, posY, posZ)) + posX = solidInterfaceBuffRcv_X[jVertex] + posY = solidInterfaceBuffRcv_Y[jVertex] + posZ = solidInterfaceBuffRcv_Z[jVertex] + if self.nDim == 2: + SolidSpatialTree.add(jVertex, (posX, posY)) + else: + SolidSpatialTree.add(jVertex, (posX, posY, posZ)) if self.nFluidInterfacePhysicalNodes != self.nSolidInterfacePhysicalNodes: - raise Exception("Fluid and solid interface must have the same number of nodes for matching meshes ! ") + raise Exception( + "Fluid and solid interface must have the same number of nodes for matching meshes ! " + ) # --- For each fluid interface node, find the nearest solid interface node and fill the boolean mapping matrix --- for iVertexFluid in range(self.nLocalFluidInterfacePhysicalNodes): - posX = self.localFluidInterface_array_X_init[iVertexFluid] - posY = self.localFluidInterface_array_Y_init[iVertexFluid] - posZ = self.localFluidInterface_array_Z_init[iVertexFluid] - if self.nDim == 2: - neighboors = list(SolidSpatialTree.nearest((posX, posY),1)) - elif self.nDim == 3: - neighboors = list(SolidSpatialTree.nearest((posX, posY, posZ),1)) - jVertexSolid = neighboors[0] - # Check if the distance is small enough to ensure coincidence - NodeA = np.array([posX, posY, posZ]) - NodeB = np.array([solidInterfaceBuffRcv_X[jVertexSolid], solidInterfaceBuffRcv_Y[jVertexSolid], solidInterfaceBuffRcv_Z[jVertexSolid]]) - distance = spdist.euclidean(NodeA, NodeB) - iGlobalVertexFluid = self.__getGlobalIndex('fluid', myid, iVertexFluid) - jGlobalVertexSolid = self.__getGlobalIndex('solid', iProc, jVertexSolid) - if distance > 1e-6: - print("WARNING : Tolerance for matching meshes is not matched between node F{} and S{} : ({}, {}, {})<-->({}, {}, {}) , DISTANCE : {} !".format(iGlobalVertexFluid,jGlobalVertexSolid,posX, posY, posZ,solidInterfaceBuffRcv_X[jVertexSolid], solidInterfaceBuffRcv_Y[jVertexSolid], solidInterfaceBuffRcv_Z[jVertexSolid], distance)) - self.MappingMatrix.setValue(iGlobalVertexFluid,jGlobalVertexSolid,1.0) - self.MappingMatrix_T.setValue(jGlobalVertexSolid, iGlobalVertexFluid,1.0) - - def NearestNeighboorMeshMapping(self, solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, solidInterfaceBuffRcv_Z, iProc): + posX = self.localFluidInterface_array_X_init[iVertexFluid] + posY = self.localFluidInterface_array_Y_init[iVertexFluid] + posZ = self.localFluidInterface_array_Z_init[iVertexFluid] + if self.nDim == 2: + neighboors = list(SolidSpatialTree.nearest((posX, posY), 1)) + elif self.nDim == 3: + neighboors = list(SolidSpatialTree.nearest((posX, posY, posZ), 1)) + jVertexSolid = neighboors[0] + # Check if the distance is small enough to ensure coincidence + NodeA = np.array([posX, posY, posZ]) + NodeB = np.array( + [ + solidInterfaceBuffRcv_X[jVertexSolid], + solidInterfaceBuffRcv_Y[jVertexSolid], + solidInterfaceBuffRcv_Z[jVertexSolid], + ] + ) + distance = spdist.euclidean(NodeA, NodeB) + iGlobalVertexFluid = self.__getGlobalIndex("fluid", myid, iVertexFluid) + jGlobalVertexSolid = self.__getGlobalIndex("solid", iProc, jVertexSolid) + if distance > 1e-6: + print( + "WARNING : Tolerance for matching meshes is not matched between node F{} and S{} : ({}, {}, {})<-->({}, {}, {}) , DISTANCE : {} !".format( + iGlobalVertexFluid, + jGlobalVertexSolid, + posX, + posY, + posZ, + solidInterfaceBuffRcv_X[jVertexSolid], + solidInterfaceBuffRcv_Y[jVertexSolid], + solidInterfaceBuffRcv_Z[jVertexSolid], + distance, + ) + ) + self.MappingMatrix.setValue(iGlobalVertexFluid, jGlobalVertexSolid, 1.0) + self.MappingMatrix_T.setValue(jGlobalVertexSolid, iGlobalVertexFluid, 1.0) + + def NearestNeighboorMeshMapping( + self, + solidInterfaceBuffRcv_X, + solidInterfaceBuffRcv_Y, + solidInterfaceBuffRcv_Z, + iProc, + ): """ Interpolation based on the nearest neighboor. For each node, the mesh is scanned to find the closed node to the first @@ -832,9 +1194,9 @@ def NearestNeighboorMeshMapping(self, solidInterfaceBuffRcv_X, solidInterfaceBuf """ if self.have_MPI: - myid = self.comm.Get_rank() + myid = self.comm.Get_rank() else: - myid = 0 + myid = 0 # --- Instantiate the spatial indexing --- prop_index = index.Property() @@ -844,30 +1206,37 @@ def NearestNeighboorMeshMapping(self, solidInterfaceBuffRcv_X, solidInterfaceBuf nSolidNodes = solidInterfaceBuffRcv_X.shape[0] for jVertex in range(nSolidNodes): - posX = solidInterfaceBuffRcv_X[jVertex] - posY = solidInterfaceBuffRcv_Y[jVertex] - posZ = solidInterfaceBuffRcv_Z[jVertex] - if self.nDim == 2 : - SolidSpatialTree.add(jVertex, (posX, posY)) - else : - SolidSpatialTree.add(jVertex, (posX, posY, posZ)) + posX = solidInterfaceBuffRcv_X[jVertex] + posY = solidInterfaceBuffRcv_Y[jVertex] + posZ = solidInterfaceBuffRcv_Z[jVertex] + if self.nDim == 2: + SolidSpatialTree.add(jVertex, (posX, posY)) + else: + SolidSpatialTree.add(jVertex, (posX, posY, posZ)) # --- For each fluid interface node, find the nearest solid interface node and fill the boolean mapping matrix --- for iVertexFluid in range(self.nLocalFluidInterfacePhysicalNodes): - posX = self.localFluidInterface_array_X_init[iVertexFluid] - posY = self.localFluidInterface_array_Y_init[iVertexFluid] - posZ = self.localFluidInterface_array_Z_init[iVertexFluid] - if self.nDim == 2: - neighboors = list(SolidSpatialTree.nearest((posX, posY),1)) - elif self.nDim == 3: - neighboors = list(SolidSpatialTree.nearest((posX, posY, posZ),1)) - jVertexSolid = neighboors[0] - iGlobalVertexFluid = self.__getGlobalIndex('fluid', myid, iVertexFluid) - jGlobalVertexSolid = self.__getGlobalIndex('solid', iProc, jVertexSolid) - self.MappingMatrix.setValue(iGlobalVertexFluid,jGlobalVertexSolid,1.0) - self.MappingMatrix_T.setValue(jGlobalVertexSolid, iGlobalVertexFluid,1.0) - - def RBFMeshMapping_A(self, solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, solidInterfaceBuffRcv_Z, iProc, rad): + posX = self.localFluidInterface_array_X_init[iVertexFluid] + posY = self.localFluidInterface_array_Y_init[iVertexFluid] + posZ = self.localFluidInterface_array_Z_init[iVertexFluid] + if self.nDim == 2: + neighboors = list(SolidSpatialTree.nearest((posX, posY), 1)) + elif self.nDim == 3: + neighboors = list(SolidSpatialTree.nearest((posX, posY, posZ), 1)) + jVertexSolid = neighboors[0] + iGlobalVertexFluid = self.__getGlobalIndex("fluid", myid, iVertexFluid) + jGlobalVertexSolid = self.__getGlobalIndex("solid", iProc, jVertexSolid) + self.MappingMatrix.setValue(iGlobalVertexFluid, jGlobalVertexSolid, 1.0) + self.MappingMatrix_T.setValue(jGlobalVertexSolid, iGlobalVertexFluid, 1.0) + + def RBFMeshMapping_A( + self, + solidInterfaceBuffRcv_X, + solidInterfaceBuffRcv_Y, + solidInterfaceBuffRcv_Z, + iProc, + rad, + ): """ First part of the RBF mapping. This method provides the matrix required to obtain, from the structural displacements, the loadings of the kernel @@ -875,9 +1244,9 @@ def RBFMeshMapping_A(self, solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, sol """ if self.have_MPI: - myid = self.comm.Get_rank() + myid = self.comm.Get_rank() else: - myid = 0 + myid = 0 # --- Instantiate the spatial indexing --- prop_index = index.Property() @@ -887,52 +1256,86 @@ def RBFMeshMapping_A(self, solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, sol nSolidNodes = solidInterfaceBuffRcv_X.shape[0] for jVertex in range(nSolidNodes): - posX = solidInterfaceBuffRcv_X[jVertex] - posY = solidInterfaceBuffRcv_Y[jVertex] - posZ = solidInterfaceBuffRcv_Z[jVertex] - if self.nDim == 2 : - SolidSpatialTree.add(jVertex, (posX, posY)) - else : - SolidSpatialTree.add(jVertex, (posX, posY, posZ)) + posX = solidInterfaceBuffRcv_X[jVertex] + posY = solidInterfaceBuffRcv_Y[jVertex] + posZ = solidInterfaceBuffRcv_Z[jVertex] + if self.nDim == 2: + SolidSpatialTree.add(jVertex, (posX, posY)) + else: + SolidSpatialTree.add(jVertex, (posX, posY, posZ)) for iVertexSolid in range(self.nLocalSolidInterfacePhysicalNodes): - posX = self.localSolidInterface_array_X_init[iVertexSolid] - posY = self.localSolidInterface_array_Y_init[iVertexSolid] - posZ = self.localSolidInterface_array_Z_init[iVertexSolid] - NodeA = np.array([posX, posY, posZ]) - iGlobalVertexSolid = self.__getGlobalIndex('solid', myid, iVertexSolid) - if self.nDim == 2: - neighboors = list(SolidSpatialTree.intersection((posX-rad, posY-rad, posX+rad, posY+rad))) - elif self.nDim == 3: - neighboors = list(SolidSpatialTree.intersection((posX-rad, posY-rad, posZ-rad, posX+rad, posY+rad, posZ+rad))) - for jVertexSolid in neighboors: - NodeB = np.array([solidInterfaceBuffRcv_X[jVertexSolid], solidInterfaceBuffRcv_Y[jVertexSolid], solidInterfaceBuffRcv_Z[jVertexSolid]]) - distance = spdist.euclidean(NodeA, NodeB) - phi = self.__CPC2(distance, rad) - jGlobalVertexSolid = self.__getGlobalIndex('solid', iProc, jVertexSolid) - self.MappingMatrixA.setValue(iGlobalVertexSolid, jGlobalVertexSolid, phi) - self.MappingMatrixA_T.setValue(jGlobalVertexSolid, iGlobalVertexSolid, phi) - self.MappingMatrixA.setValue(iGlobalVertexSolid, nSolidNodes, 1.0) - self.MappingMatrixA.setValue(iGlobalVertexSolid, nSolidNodes+1, posX) - self.MappingMatrixA.setValue(iGlobalVertexSolid, nSolidNodes+2, posY) - if self.nDim == 3: - self.MappingMatrixA.setValue(iGlobalVertexSolid, nSolidNodes+3, posZ) - self.MappingMatrixA_T.setValue(nSolidNodes, iGlobalVertexSolid, 1.0) - self.MappingMatrixA_T.setValue(nSolidNodes+1, iGlobalVertexSolid, posX) - self.MappingMatrixA_T.setValue(nSolidNodes+2, iGlobalVertexSolid, posY) - if self.nDim == 3: - self.MappingMatrixA_T.setValue(nSolidNodes+3, iGlobalVertexSolid, posZ) - - def RBFMeshMapping_B(self, solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, solidInterfaceBuffRcv_Z, iProc, rad): + posX = self.localSolidInterface_array_X_init[iVertexSolid] + posY = self.localSolidInterface_array_Y_init[iVertexSolid] + posZ = self.localSolidInterface_array_Z_init[iVertexSolid] + NodeA = np.array([posX, posY, posZ]) + iGlobalVertexSolid = self.__getGlobalIndex("solid", myid, iVertexSolid) + if self.nDim == 2: + neighboors = list( + SolidSpatialTree.intersection( + (posX - rad, posY - rad, posX + rad, posY + rad) + ) + ) + elif self.nDim == 3: + neighboors = list( + SolidSpatialTree.intersection( + ( + posX - rad, + posY - rad, + posZ - rad, + posX + rad, + posY + rad, + posZ + rad, + ) + ) + ) + for jVertexSolid in neighboors: + NodeB = np.array( + [ + solidInterfaceBuffRcv_X[jVertexSolid], + solidInterfaceBuffRcv_Y[jVertexSolid], + solidInterfaceBuffRcv_Z[jVertexSolid], + ] + ) + distance = spdist.euclidean(NodeA, NodeB) + phi = self.__CPC2(distance, rad) + jGlobalVertexSolid = self.__getGlobalIndex("solid", iProc, jVertexSolid) + self.MappingMatrixA.setValue( + iGlobalVertexSolid, jGlobalVertexSolid, phi + ) + self.MappingMatrixA_T.setValue( + jGlobalVertexSolid, iGlobalVertexSolid, phi + ) + self.MappingMatrixA.setValue(iGlobalVertexSolid, nSolidNodes, 1.0) + self.MappingMatrixA.setValue(iGlobalVertexSolid, nSolidNodes + 1, posX) + self.MappingMatrixA.setValue(iGlobalVertexSolid, nSolidNodes + 2, posY) + if self.nDim == 3: + self.MappingMatrixA.setValue(iGlobalVertexSolid, nSolidNodes + 3, posZ) + self.MappingMatrixA_T.setValue(nSolidNodes, iGlobalVertexSolid, 1.0) + self.MappingMatrixA_T.setValue(nSolidNodes + 1, iGlobalVertexSolid, posX) + self.MappingMatrixA_T.setValue(nSolidNodes + 2, iGlobalVertexSolid, posY) + if self.nDim == 3: + self.MappingMatrixA_T.setValue( + nSolidNodes + 3, iGlobalVertexSolid, posZ + ) + + def RBFMeshMapping_B( + self, + solidInterfaceBuffRcv_X, + solidInterfaceBuffRcv_Y, + solidInterfaceBuffRcv_Z, + iProc, + rad, + ): """ Second part of the RBF mapping. This method provides the matrix required to obtain, from the kernel function loadings, the fluid nodes displacements. """ if self.have_MPI: - myid = self.comm.Get_rank() + myid = self.comm.Get_rank() else: - myid = 0 + myid = 0 # --- Instantiate the spatial indexing --- prop_index = index.Property() @@ -942,43 +1345,76 @@ def RBFMeshMapping_B(self, solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, sol nSolidNodes = solidInterfaceBuffRcv_X.shape[0] for jVertex in range(nSolidNodes): - posX = solidInterfaceBuffRcv_X[jVertex] - posY = solidInterfaceBuffRcv_Y[jVertex] - posZ = solidInterfaceBuffRcv_Z[jVertex] - if self.nDim == 2 : - SolidSpatialTree.add(jVertex, (posX, posY)) - else : - SolidSpatialTree.add(jVertex, (posX, posY, posZ)) + posX = solidInterfaceBuffRcv_X[jVertex] + posY = solidInterfaceBuffRcv_Y[jVertex] + posZ = solidInterfaceBuffRcv_Z[jVertex] + if self.nDim == 2: + SolidSpatialTree.add(jVertex, (posX, posY)) + else: + SolidSpatialTree.add(jVertex, (posX, posY, posZ)) for iVertexFluid in range(self.nLocalFluidInterfacePhysicalNodes): - posX = self.localFluidInterface_array_X_init[iVertexFluid] - posY = self.localFluidInterface_array_Y_init[iVertexFluid] - posZ = self.localFluidInterface_array_Z_init[iVertexFluid] - NodeA = np.array([posX, posY, posZ]) - iGlobalVertexFluid = self.__getGlobalIndex('fluid', myid, iVertexFluid) - if self.nDim == 2: - neighboors = list(SolidSpatialTree.intersection((posX-rad, posY-rad, posX+rad, posY+rad))) - elif self.nDim == 3: - neighboors = list(SolidSpatialTree.intersection((posX-rad, posY-rad, posZ-rad, posX+rad, posY+rad, posZ+rad))) - for jVertexSolid in neighboors: - NodeB = np.array([solidInterfaceBuffRcv_X[jVertexSolid], solidInterfaceBuffRcv_Y[jVertexSolid], solidInterfaceBuffRcv_Z[jVertexSolid]]) - distance = spdist.euclidean(NodeA, NodeB) - phi = self.__CPC2(distance, rad) - jGlobalVertexSolid = self.__getGlobalIndex('solid', iProc, jVertexSolid) - self.MappingMatrixB.setValue(iGlobalVertexFluid, jGlobalVertexSolid, phi) - self.MappingMatrixB_T.setValue(jGlobalVertexSolid, iGlobalVertexFluid, phi) - self.MappingMatrixB.setValue(iGlobalVertexFluid, nSolidNodes, 1.0) - self.MappingMatrixB.setValue(iGlobalVertexFluid, nSolidNodes+1, posX) - self.MappingMatrixB.setValue(iGlobalVertexFluid, nSolidNodes+2, posY) - if self.nDim == 3: - self.MappingMatrixB.setValue(iGlobalVertexFluid, nSolidNodes+3, posZ) - self.MappingMatrixB_T.setValue(nSolidNodes, iGlobalVertexFluid, 1.0) - self.MappingMatrixB_T.setValue(nSolidNodes+1, iGlobalVertexFluid, posX) - self.MappingMatrixB_T.setValue(nSolidNodes+2, iGlobalVertexFluid, posY) - if self.nDim == 3: - self.MappingMatrixB_T.setValue(nSolidNodes+3, iGlobalVertexFluid, posZ) - - def TPSMeshMapping_A(self, solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, solidInterfaceBuffRcv_Z, iProc): + posX = self.localFluidInterface_array_X_init[iVertexFluid] + posY = self.localFluidInterface_array_Y_init[iVertexFluid] + posZ = self.localFluidInterface_array_Z_init[iVertexFluid] + NodeA = np.array([posX, posY, posZ]) + iGlobalVertexFluid = self.__getGlobalIndex("fluid", myid, iVertexFluid) + if self.nDim == 2: + neighboors = list( + SolidSpatialTree.intersection( + (posX - rad, posY - rad, posX + rad, posY + rad) + ) + ) + elif self.nDim == 3: + neighboors = list( + SolidSpatialTree.intersection( + ( + posX - rad, + posY - rad, + posZ - rad, + posX + rad, + posY + rad, + posZ + rad, + ) + ) + ) + for jVertexSolid in neighboors: + NodeB = np.array( + [ + solidInterfaceBuffRcv_X[jVertexSolid], + solidInterfaceBuffRcv_Y[jVertexSolid], + solidInterfaceBuffRcv_Z[jVertexSolid], + ] + ) + distance = spdist.euclidean(NodeA, NodeB) + phi = self.__CPC2(distance, rad) + jGlobalVertexSolid = self.__getGlobalIndex("solid", iProc, jVertexSolid) + self.MappingMatrixB.setValue( + iGlobalVertexFluid, jGlobalVertexSolid, phi + ) + self.MappingMatrixB_T.setValue( + jGlobalVertexSolid, iGlobalVertexFluid, phi + ) + self.MappingMatrixB.setValue(iGlobalVertexFluid, nSolidNodes, 1.0) + self.MappingMatrixB.setValue(iGlobalVertexFluid, nSolidNodes + 1, posX) + self.MappingMatrixB.setValue(iGlobalVertexFluid, nSolidNodes + 2, posY) + if self.nDim == 3: + self.MappingMatrixB.setValue(iGlobalVertexFluid, nSolidNodes + 3, posZ) + self.MappingMatrixB_T.setValue(nSolidNodes, iGlobalVertexFluid, 1.0) + self.MappingMatrixB_T.setValue(nSolidNodes + 1, iGlobalVertexFluid, posX) + self.MappingMatrixB_T.setValue(nSolidNodes + 2, iGlobalVertexFluid, posY) + if self.nDim == 3: + self.MappingMatrixB_T.setValue( + nSolidNodes + 3, iGlobalVertexFluid, posZ + ) + + def TPSMeshMapping_A( + self, + solidInterfaceBuffRcv_X, + solidInterfaceBuffRcv_Y, + solidInterfaceBuffRcv_Z, + iProc, + ): """ First part of the RBF mapping. This method provides the matrix required to obtain, from the structural displacements, the loadings of the kernel @@ -986,73 +1422,102 @@ def TPSMeshMapping_A(self, solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, sol """ if self.have_MPI: - myid = self.comm.Get_rank() + myid = self.comm.Get_rank() else: - myid = 0 + myid = 0 nSolidNodes = solidInterfaceBuffRcv_X.shape[0] for iVertexSolid in range(self.nLocalSolidInterfacePhysicalNodes): - posX = self.localSolidInterface_array_X_init[iVertexSolid] - posY = self.localSolidInterface_array_Y_init[iVertexSolid] - posZ = self.localSolidInterface_array_Z_init[iVertexSolid] - NodeA = np.array([posX, posY, posZ]) - iGlobalVertexSolid = self.__getGlobalIndex('solid', myid, iVertexSolid) - for jVertexSolid in range(nSolidNodes): - NodeB = np.array([solidInterfaceBuffRcv_X[jVertexSolid], solidInterfaceBuffRcv_Y[jVertexSolid], solidInterfaceBuffRcv_Z[jVertexSolid]]) - distance = spdist.euclidean(NodeA, NodeB) - phi = self.__TPS(distance) - jGlobalVertexSolid = self.__getGlobalIndex('solid', iProc, jVertexSolid) - self.MappingMatrixA.setValue(iGlobalVertexSolid, jGlobalVertexSolid, phi) - self.MappingMatrixA_T.setValue(jGlobalVertexSolid, iGlobalVertexSolid, phi) - self.MappingMatrixA.setValue(iGlobalVertexSolid, nSolidNodes, 1.0) - self.MappingMatrixA.setValue(iGlobalVertexSolid, nSolidNodes+1, posX) - self.MappingMatrixA.setValue(iGlobalVertexSolid, nSolidNodes+2, posY) - if self.nDim == 3: - self.MappingMatrixA.setValue(iGlobalVertexSolid, nSolidNodes+3, posZ) - self.MappingMatrixA_T.setValue(nSolidNodes, iGlobalVertexSolid, 1.0) - self.MappingMatrixA_T.setValue(nSolidNodes+1, iGlobalVertexSolid, posX) - self.MappingMatrixA_T.setValue(nSolidNodes+2, iGlobalVertexSolid, posY) - if self.nDim == 3: - self.MappingMatrixA_T.setValue(nSolidNodes+3, iGlobalVertexSolid, posZ) - - def TPSMeshMapping_B(self, solidInterfaceBuffRcv_X, solidInterfaceBuffRcv_Y, solidInterfaceBuffRcv_Z, iProc): + posX = self.localSolidInterface_array_X_init[iVertexSolid] + posY = self.localSolidInterface_array_Y_init[iVertexSolid] + posZ = self.localSolidInterface_array_Z_init[iVertexSolid] + NodeA = np.array([posX, posY, posZ]) + iGlobalVertexSolid = self.__getGlobalIndex("solid", myid, iVertexSolid) + for jVertexSolid in range(nSolidNodes): + NodeB = np.array( + [ + solidInterfaceBuffRcv_X[jVertexSolid], + solidInterfaceBuffRcv_Y[jVertexSolid], + solidInterfaceBuffRcv_Z[jVertexSolid], + ] + ) + distance = spdist.euclidean(NodeA, NodeB) + phi = self.__TPS(distance) + jGlobalVertexSolid = self.__getGlobalIndex("solid", iProc, jVertexSolid) + self.MappingMatrixA.setValue( + iGlobalVertexSolid, jGlobalVertexSolid, phi + ) + self.MappingMatrixA_T.setValue( + jGlobalVertexSolid, iGlobalVertexSolid, phi + ) + self.MappingMatrixA.setValue(iGlobalVertexSolid, nSolidNodes, 1.0) + self.MappingMatrixA.setValue(iGlobalVertexSolid, nSolidNodes + 1, posX) + self.MappingMatrixA.setValue(iGlobalVertexSolid, nSolidNodes + 2, posY) + if self.nDim == 3: + self.MappingMatrixA.setValue(iGlobalVertexSolid, nSolidNodes + 3, posZ) + self.MappingMatrixA_T.setValue(nSolidNodes, iGlobalVertexSolid, 1.0) + self.MappingMatrixA_T.setValue(nSolidNodes + 1, iGlobalVertexSolid, posX) + self.MappingMatrixA_T.setValue(nSolidNodes + 2, iGlobalVertexSolid, posY) + if self.nDim == 3: + self.MappingMatrixA_T.setValue( + nSolidNodes + 3, iGlobalVertexSolid, posZ + ) + + def TPSMeshMapping_B( + self, + solidInterfaceBuffRcv_X, + solidInterfaceBuffRcv_Y, + solidInterfaceBuffRcv_Z, + iProc, + ): """ Second part of the TPS mapping. This method provides the matrix required to obtain, from the kernel function loadings, the fluid nodes displacements. """ if self.have_MPI: - myid = self.comm.Get_rank() + myid = self.comm.Get_rank() else: - myid = 0 + myid = 0 nSolidNodes = solidInterfaceBuffRcv_X.shape[0] for iVertexFluid in range(self.nLocalFluidInterfacePhysicalNodes): - posX = self.localFluidInterface_array_X_init[iVertexFluid] - posY = self.localFluidInterface_array_Y_init[iVertexFluid] - posZ = self.localFluidInterface_array_Z_init[iVertexFluid] - NodeA = np.array([posX, posY, posZ]) - iGlobalVertexFluid = self.__getGlobalIndex('fluid', myid, iVertexFluid) - for jVertexSolid in range(nSolidNodes): - NodeB = np.array([solidInterfaceBuffRcv_X[jVertexSolid], solidInterfaceBuffRcv_Y[jVertexSolid], solidInterfaceBuffRcv_Z[jVertexSolid]]) - distance = spdist.euclidean(NodeA, NodeB) - phi = self.__TPS(distance) - jGlobalVertexSolid = self.__getGlobalIndex('solid', iProc, jVertexSolid) - self.MappingMatrixB.setValue(iGlobalVertexFluid, jGlobalVertexSolid, phi) - self.MappingMatrixB_T.setValue(jGlobalVertexSolid, iGlobalVertexFluid, phi) - self.MappingMatrixB.setValue(iGlobalVertexFluid, nSolidNodes, 1.0) - self.MappingMatrixB.setValue(iGlobalVertexFluid, nSolidNodes+1, posX) - self.MappingMatrixB.setValue(iGlobalVertexFluid, nSolidNodes+2, posY) - if self.nDim == 3: - self.MappingMatrixB.setValue(iGlobalVertexFluid, nSolidNodes+3, posZ) - self.MappingMatrixB_T.setValue(nSolidNodes, iGlobalVertexFluid, 1.0) - self.MappingMatrixB_T.setValue(nSolidNodes+1, iGlobalVertexFluid, posX) - self.MappingMatrixB_T.setValue(nSolidNodes+2, iGlobalVertexFluid, posY) - if self.nDim == 3: - self.MappingMatrixB_T.setValue(nSolidNodes+3, iGlobalVertexFluid, posZ) - + posX = self.localFluidInterface_array_X_init[iVertexFluid] + posY = self.localFluidInterface_array_Y_init[iVertexFluid] + posZ = self.localFluidInterface_array_Z_init[iVertexFluid] + NodeA = np.array([posX, posY, posZ]) + iGlobalVertexFluid = self.__getGlobalIndex("fluid", myid, iVertexFluid) + for jVertexSolid in range(nSolidNodes): + NodeB = np.array( + [ + solidInterfaceBuffRcv_X[jVertexSolid], + solidInterfaceBuffRcv_Y[jVertexSolid], + solidInterfaceBuffRcv_Z[jVertexSolid], + ] + ) + distance = spdist.euclidean(NodeA, NodeB) + phi = self.__TPS(distance) + jGlobalVertexSolid = self.__getGlobalIndex("solid", iProc, jVertexSolid) + self.MappingMatrixB.setValue( + iGlobalVertexFluid, jGlobalVertexSolid, phi + ) + self.MappingMatrixB_T.setValue( + jGlobalVertexSolid, iGlobalVertexFluid, phi + ) + self.MappingMatrixB.setValue(iGlobalVertexFluid, nSolidNodes, 1.0) + self.MappingMatrixB.setValue(iGlobalVertexFluid, nSolidNodes + 1, posX) + self.MappingMatrixB.setValue(iGlobalVertexFluid, nSolidNodes + 2, posY) + if self.nDim == 3: + self.MappingMatrixB.setValue(iGlobalVertexFluid, nSolidNodes + 3, posZ) + self.MappingMatrixB_T.setValue(nSolidNodes, iGlobalVertexFluid, 1.0) + self.MappingMatrixB_T.setValue(nSolidNodes + 1, iGlobalVertexFluid, posX) + self.MappingMatrixB_T.setValue(nSolidNodes + 2, iGlobalVertexFluid, posY) + if self.nDim == 3: + self.MappingMatrixB_T.setValue( + nSolidNodes + 3, iGlobalVertexFluid, posZ + ) def __CPC2(self, distance, rad): """ @@ -1060,12 +1525,12 @@ def __CPC2(self, distance, rad): distance. The kernel function is the one used for RBF. """ phi = 0.0 - eps = distance/rad + eps = distance / rad if eps < 1: - phi = ((1.0-eps)**4)*(4.0*eps+1.0) + phi = ((1.0 - eps) ** 4) * (4.0 * eps + 1.0) else: - phi = 0.0 + phi = 0.0 return phi @@ -1077,75 +1542,84 @@ def __TPS(self, distance): phi = 0.0 if distance > 0.0: - phi = (distance**2)*np.log10(distance) + phi = (distance**2) * np.log10(distance) else: - phi = 0.0 + phi = 0.0 return phi - def interpolateSolidPositionOnFluidMesh(self, FSI_config): """ Applies the one-to-one mapping or the interpolaiton rules from solid to fluid mesh. """ if self.have_MPI: - myid = self.comm.Get_rank() - MPIsize = self.comm.Get_size() + myid = self.comm.Get_rank() + MPIsize = self.comm.Get_size() else: - myid = 0 - MPIsize = 1 - + myid = 0 + MPIsize = 1 # --- Interpolate (or map) in parallel the solid interface displacement on the fluid interface --- - if FSI_config['MATCHING_MESH'] == 'NO' and (FSI_config['MESH_INTERP_METHOD'] == 'RBF' or FSI_config['MESH_INTERP_METHOD'] == 'TPS'): - if self.have_MPI: - gamma_array_DispX = PETSc.Vec().create(self.comm) - gamma_array_DispY = PETSc.Vec().create(self.comm) - gamma_array_DispZ = PETSc.Vec().create(self.comm) - gamma_array_DispX.setType('mpi') - gamma_array_DispY.setType('mpi') - gamma_array_DispZ.setType('mpi') - KSP_solver = PETSc.KSP().create(self.comm) - else: - gamma_array_DispX = PETSc.Vec().create() - gamma_array_DispY = PETSc.Vec().create() - gamma_array_DispZ = PETSc.Vec().create() - gamma_array_DispX.setType('seq') - gamma_array_DispY.setType('seq') - gamma_array_DispZ.setType('seq') - KSP_solver = PETSc.KSP().create() - gamma_array_DispX.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - gamma_array_DispY.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - gamma_array_DispZ.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - gamma_array_DispX.set(0.0) - gamma_array_DispY.set(0.0) - gamma_array_DispZ.set(0.0) - KSP_solver.setType('fgmres') - KSP_solver.getPC().setType('jacobi') - KSP_solver.setOperators(self.MappingMatrixA) - KSP_solver.setFromOptions() - KSP_solver.setInitialGuessNonzero(True) - KSP_solver.solve(self.solidInterface_array_DispX, gamma_array_DispX) - KSP_solver.solve(self.solidInterface_array_DispY, gamma_array_DispY) - if self.nDim==3: - KSP_solver.solve(self.solidInterface_array_DispZ, gamma_array_DispZ) - self.MappingMatrixB.mult(gamma_array_DispX, self.fluidInterface_array_DispX) - self.MappingMatrixB.mult(gamma_array_DispY, self.fluidInterface_array_DispY) - if self.nDim==3: - self.MappingMatrixB.mult(gamma_array_DispZ, self.fluidInterface_array_DispZ) - gamma_array_DispX.destroy() - gamma_array_DispY.destroy() - gamma_array_DispZ.destroy() - KSP_solver.destroy() - del gamma_array_DispX - del gamma_array_DispY - del gamma_array_DispZ - del KSP_solver - else: - self.MappingMatrix.mult(self.solidInterface_array_DispX, self.fluidInterface_array_DispX) - self.MappingMatrix.mult(self.solidInterface_array_DispY, self.fluidInterface_array_DispY) - if self.nDim==3: - self.MappingMatrix.mult(self.solidInterface_array_DispZ, self.fluidInterface_array_DispZ) + if FSI_config["MATCHING_MESH"] == "NO" and ( + FSI_config["MESH_INTERP_METHOD"] == "RBF" + or FSI_config["MESH_INTERP_METHOD"] == "TPS" + ): + if self.have_MPI: + gamma_array_DispX = PETSc.Vec().create(self.comm) + gamma_array_DispY = PETSc.Vec().create(self.comm) + gamma_array_DispZ = PETSc.Vec().create(self.comm) + gamma_array_DispX.setType("mpi") + gamma_array_DispY.setType("mpi") + gamma_array_DispZ.setType("mpi") + KSP_solver = PETSc.KSP().create(self.comm) + else: + gamma_array_DispX = PETSc.Vec().create() + gamma_array_DispY = PETSc.Vec().create() + gamma_array_DispZ = PETSc.Vec().create() + gamma_array_DispX.setType("seq") + gamma_array_DispY.setType("seq") + gamma_array_DispZ.setType("seq") + KSP_solver = PETSc.KSP().create() + gamma_array_DispX.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) + gamma_array_DispY.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) + gamma_array_DispZ.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) + gamma_array_DispX.set(0.0) + gamma_array_DispY.set(0.0) + gamma_array_DispZ.set(0.0) + KSP_solver.setType("fgmres") + KSP_solver.getPC().setType("jacobi") + KSP_solver.setOperators(self.MappingMatrixA) + KSP_solver.setFromOptions() + KSP_solver.setInitialGuessNonzero(True) + KSP_solver.solve(self.solidInterface_array_DispX, gamma_array_DispX) + KSP_solver.solve(self.solidInterface_array_DispY, gamma_array_DispY) + if self.nDim == 3: + KSP_solver.solve(self.solidInterface_array_DispZ, gamma_array_DispZ) + self.MappingMatrixB.mult(gamma_array_DispX, self.fluidInterface_array_DispX) + self.MappingMatrixB.mult(gamma_array_DispY, self.fluidInterface_array_DispY) + if self.nDim == 3: + self.MappingMatrixB.mult( + gamma_array_DispZ, self.fluidInterface_array_DispZ + ) + gamma_array_DispX.destroy() + gamma_array_DispY.destroy() + gamma_array_DispZ.destroy() + KSP_solver.destroy() + del gamma_array_DispX + del gamma_array_DispY + del gamma_array_DispZ + del KSP_solver + else: + self.MappingMatrix.mult( + self.solidInterface_array_DispX, self.fluidInterface_array_DispX + ) + self.MappingMatrix.mult( + self.solidInterface_array_DispY, self.fluidInterface_array_DispY + ) + if self.nDim == 3: + self.MappingMatrix.mult( + self.solidInterface_array_DispZ, self.fluidInterface_array_DispZ + ) # --- Checking conservation --- WSX = self.solidLoads_array_X.dot(self.solidInterface_array_DispX) @@ -1157,105 +1631,169 @@ def interpolateSolidPositionOnFluidMesh(self, FSI_config): WFZ = self.fluidLoads_array_Z.dot(self.fluidInterface_array_DispZ) self.MPIPrint("Checking f/s interface conservation...") - self.MPIPrint('Solid side (Wx, Wy, Wz) = ({}, {}, {})'.format(WSX, WSY, WSZ)) - self.MPIPrint('Fluid side (Wx, Wy, Wz) = ({}, {}, {})'.format(WFX, WFY, WFZ)) - + self.MPIPrint("Solid side (Wx, Wy, Wz) = ({}, {}, {})".format(WSX, WSY, WSZ)) + self.MPIPrint("Fluid side (Wx, Wy, Wz) = ({}, {}, {})".format(WFX, WFY, WFZ)) # --- Redistribute the interpolated fluid interface according to the partitions that own the fluid interface --- # Gather the fluid interface on the master process # This is required because PETSc redistributes evenly in the cores, and does not use the same division # of SU2, thus we need to redistribute if self.have_MPI: - sendBuff_X = None - sendBuff_Y = None - sendBuff_Z = None - self.fluidInterface_array_DispX_recon = None - self.fluidInterface_array_DispY_recon = None - self.fluidInterface_array_DispZ_recon = None - - if myid == self.rootProcess: - self.fluidInterface_array_DispX_recon = np.zeros(self.nFluidInterfacePhysicalNodes) - self.fluidInterface_array_DispY_recon = np.zeros(self.nFluidInterfacePhysicalNodes) - self.fluidInterface_array_DispZ_recon = np.zeros(self.nFluidInterfacePhysicalNodes) - - myNumberOfNodes = self.fluidInterface_array_DispX.getArray().shape[0] - sendBuffNumber = np.array([myNumberOfNodes], dtype=int) - rcvBuffNumber = np.zeros(MPIsize, dtype=int) - self.comm.Allgather(sendBuffNumber, rcvBuffNumber) - - counts = tuple(rcvBuffNumber) - displ = np.zeros(MPIsize, dtype=int) - for ii in range(rcvBuffNumber.shape[0]): - displ[ii] = rcvBuffNumber[0:ii].sum() - displ = tuple(displ) - - del sendBuffNumber, rcvBuffNumber - - self.comm.Gatherv(self.fluidInterface_array_DispX.getArray(), [self.fluidInterface_array_DispX_recon, counts, displ, self.MPI.DOUBLE], root=self.rootProcess) - self.comm.Gatherv(self.fluidInterface_array_DispY.getArray(), [self.fluidInterface_array_DispY_recon, counts, displ, self.MPI.DOUBLE], root=self.rootProcess) - self.comm.Gatherv(self.fluidInterface_array_DispZ.getArray(), [self.fluidInterface_array_DispZ_recon, counts, displ, self.MPI.DOUBLE], root=self.rootProcess) - - # Send the partitioned interface to the right fluid partitions - if myid == self.rootProcess: - for iProc in self.fluidInterfaceProcessors: - sendBuff_X = np.empty(self.fluidPhysicalInterfaceNodesDistribution[iProc], dtype=np.float64) - sendBuff_Y = np.empty(self.fluidPhysicalInterfaceNodesDistribution[iProc], dtype=np.float64) - sendBuff_Z = np.empty(self.fluidPhysicalInterfaceNodesDistribution[iProc], dtype=np.float64) - globalIndex = self.__getGlobalIndex('fluid', iProc, 0) - for iVertex in range(self.fluidPhysicalInterfaceNodesDistribution[iProc]): - sendBuff_X[iVertex] = self.fluidInterface_array_DispX_recon[globalIndex] - sendBuff_Y[iVertex] = self.fluidInterface_array_DispY_recon[globalIndex] - sendBuff_Z[iVertex] = self.fluidInterface_array_DispZ_recon[globalIndex] - globalIndex += 1 - if iProc == self.rootProcess: - self.localFluidInterface_array_DispX = np.copy(sendBuff_X) - self.localFluidInterface_array_DispY = np.copy(sendBuff_Y) - self.localFluidInterface_array_DispZ = np.copy(sendBuff_Z) - else: - self.comm.Send(sendBuff_X, dest=iProc, tag = 1) - self.comm.Send(sendBuff_Y, dest=iProc, tag = 2) - self.comm.Send(sendBuff_Z, dest=iProc, tag = 3) - if myid in self.fluidInterfaceProcessors: - if myid != self.rootProcess: - self.localFluidInterface_array_DispX = np.empty(self.nLocalFluidInterfacePhysicalNodes, dtype=np.float64) - self.localFluidInterface_array_DispY = np.empty(self.nLocalFluidInterfacePhysicalNodes, dtype=np.float64) - self.localFluidInterface_array_DispZ = np.empty(self.nLocalFluidInterfacePhysicalNodes, dtype=np.float64) - self.comm.Recv(self.localFluidInterface_array_DispX, source=self.rootProcess, tag = 1) - self.comm.Recv(self.localFluidInterface_array_DispY, source=self.rootProcess, tag = 2) - self.comm.Recv(self.localFluidInterface_array_DispZ, source=self.rootProcess, tag = 3) - del sendBuff_X - del sendBuff_Y - del sendBuff_Z - self.comm.barrier() - else: - self.localFluidInterface_array_DispX = self.fluidInterface_array_DispX.getArray().copy() - self.localFluidInterface_array_DispY = self.fluidInterface_array_DispY.getArray().copy() - self.localFluidInterface_array_DispZ = self.fluidInterface_array_DispZ.getArray().copy() + sendBuff_X = None + sendBuff_Y = None + sendBuff_Z = None + self.fluidInterface_array_DispX_recon = None + self.fluidInterface_array_DispY_recon = None + self.fluidInterface_array_DispZ_recon = None + + if myid == self.rootProcess: + self.fluidInterface_array_DispX_recon = np.zeros( + self.nFluidInterfacePhysicalNodes + ) + self.fluidInterface_array_DispY_recon = np.zeros( + self.nFluidInterfacePhysicalNodes + ) + self.fluidInterface_array_DispZ_recon = np.zeros( + self.nFluidInterfacePhysicalNodes + ) + + myNumberOfNodes = self.fluidInterface_array_DispX.getArray().shape[0] + sendBuffNumber = np.array([myNumberOfNodes], dtype=int) + rcvBuffNumber = np.zeros(MPIsize, dtype=int) + self.comm.Allgather(sendBuffNumber, rcvBuffNumber) + + counts = tuple(rcvBuffNumber) + displ = np.zeros(MPIsize, dtype=int) + for ii in range(rcvBuffNumber.shape[0]): + displ[ii] = rcvBuffNumber[0:ii].sum() + displ = tuple(displ) + + del sendBuffNumber, rcvBuffNumber + + self.comm.Gatherv( + self.fluidInterface_array_DispX.getArray(), + [self.fluidInterface_array_DispX_recon, counts, displ, self.MPI.DOUBLE], + root=self.rootProcess, + ) + self.comm.Gatherv( + self.fluidInterface_array_DispY.getArray(), + [self.fluidInterface_array_DispY_recon, counts, displ, self.MPI.DOUBLE], + root=self.rootProcess, + ) + self.comm.Gatherv( + self.fluidInterface_array_DispZ.getArray(), + [self.fluidInterface_array_DispZ_recon, counts, displ, self.MPI.DOUBLE], + root=self.rootProcess, + ) + + # Send the partitioned interface to the right fluid partitions + if myid == self.rootProcess: + for iProc in self.fluidInterfaceProcessors: + sendBuff_X = np.empty( + self.fluidPhysicalInterfaceNodesDistribution[iProc], + dtype=np.float64, + ) + sendBuff_Y = np.empty( + self.fluidPhysicalInterfaceNodesDistribution[iProc], + dtype=np.float64, + ) + sendBuff_Z = np.empty( + self.fluidPhysicalInterfaceNodesDistribution[iProc], + dtype=np.float64, + ) + globalIndex = self.__getGlobalIndex("fluid", iProc, 0) + for iVertex in range( + self.fluidPhysicalInterfaceNodesDistribution[iProc] + ): + sendBuff_X[iVertex] = self.fluidInterface_array_DispX_recon[ + globalIndex + ] + sendBuff_Y[iVertex] = self.fluidInterface_array_DispY_recon[ + globalIndex + ] + sendBuff_Z[iVertex] = self.fluidInterface_array_DispZ_recon[ + globalIndex + ] + globalIndex += 1 + if iProc == self.rootProcess: + self.localFluidInterface_array_DispX = np.copy(sendBuff_X) + self.localFluidInterface_array_DispY = np.copy(sendBuff_Y) + self.localFluidInterface_array_DispZ = np.copy(sendBuff_Z) + else: + self.comm.Send(sendBuff_X, dest=iProc, tag=1) + self.comm.Send(sendBuff_Y, dest=iProc, tag=2) + self.comm.Send(sendBuff_Z, dest=iProc, tag=3) + if myid in self.fluidInterfaceProcessors: + if myid != self.rootProcess: + self.localFluidInterface_array_DispX = np.empty( + self.nLocalFluidInterfacePhysicalNodes, dtype=np.float64 + ) + self.localFluidInterface_array_DispY = np.empty( + self.nLocalFluidInterfacePhysicalNodes, dtype=np.float64 + ) + self.localFluidInterface_array_DispZ = np.empty( + self.nLocalFluidInterfacePhysicalNodes, dtype=np.float64 + ) + self.comm.Recv( + self.localFluidInterface_array_DispX, + source=self.rootProcess, + tag=1, + ) + self.comm.Recv( + self.localFluidInterface_array_DispY, + source=self.rootProcess, + tag=2, + ) + self.comm.Recv( + self.localFluidInterface_array_DispZ, + source=self.rootProcess, + tag=3, + ) + del sendBuff_X + del sendBuff_Y + del sendBuff_Z + self.comm.barrier() + else: + self.localFluidInterface_array_DispX = ( + self.fluidInterface_array_DispX.getArray().copy() + ) + self.localFluidInterface_array_DispY = ( + self.fluidInterface_array_DispY.getArray().copy() + ) + self.localFluidInterface_array_DispZ = ( + self.fluidInterface_array_DispZ.getArray().copy() + ) # Special treatment for the halo nodes on the fluid interface self.haloNodesDisplacements = {} sendBuff = {} if self.have_MPI: - if myid == self.rootProcess: - for iProc in self.fluidInterfaceProcessors: - sendBuff = {} - for key in self.FluidHaloNodeList[iProc].keys(): # The keys are the SU2 global IDs of the interface nodes - globalIndex = self.fluidIndexing[key] # These are the interface global IDs, not the SU2 global IDs - DispX = self.fluidInterface_array_DispX_recon[globalIndex] - DispY = self.fluidInterface_array_DispY_recon[globalIndex] - DispZ = self.fluidInterface_array_DispZ_recon[globalIndex] - sendBuff[key] = (DispX, DispY, DispZ) - if iProc == self.rootProcess: - self.haloNodesDisplacements = sendBuff - else: - self.comm.send(sendBuff, dest = iProc, tag=4) - if myid in self.fluidInterfaceProcessors: - if myid != self.rootProcess: - self.haloNodesDisplacements = self.comm.recv(source = self.rootProcess, tag = 4) - self.comm.barrier() - del self.fluidInterface_array_DispX_recon - del self.fluidInterface_array_DispY_recon - del self.fluidInterface_array_DispZ_recon + if myid == self.rootProcess: + for iProc in self.fluidInterfaceProcessors: + sendBuff = {} + for key in self.FluidHaloNodeList[ + iProc + ].keys(): # The keys are the SU2 global IDs of the interface nodes + globalIndex = self.fluidIndexing[ + key + ] # These are the interface global IDs, not the SU2 global IDs + DispX = self.fluidInterface_array_DispX_recon[globalIndex] + DispY = self.fluidInterface_array_DispY_recon[globalIndex] + DispZ = self.fluidInterface_array_DispZ_recon[globalIndex] + sendBuff[key] = (DispX, DispY, DispZ) + if iProc == self.rootProcess: + self.haloNodesDisplacements = sendBuff + else: + self.comm.send(sendBuff, dest=iProc, tag=4) + if myid in self.fluidInterfaceProcessors: + if myid != self.rootProcess: + self.haloNodesDisplacements = self.comm.recv( + source=self.rootProcess, tag=4 + ) + self.comm.barrier() + del self.fluidInterface_array_DispX_recon + del self.fluidInterface_array_DispY_recon + del self.fluidInterface_array_DispZ_recon del sendBuff def interpolateFluidLoadsOnSolidMesh(self, FSI_config): @@ -1263,154 +1801,200 @@ def interpolateFluidLoadsOnSolidMesh(self, FSI_config): Applies the one-to-one mapping or the interpolaiton rules from fluid to solid mesh. """ if self.have_MPI: - myid = self.comm.Get_rank() - MPIsize = self.comm.Get_size() + myid = self.comm.Get_rank() + MPIsize = self.comm.Get_size() else: - myid = 0 - MPIsize = 1 + myid = 0 + MPIsize = 1 # --- Interpolate (or map) in parallel the fluid interface loads on the solid interface --- - #self.MappingMatrix.transpose() - if FSI_config['MATCHING_MESH'] == 'NO' and (FSI_config['MESH_INTERP_METHOD'] == 'RBF' or FSI_config['MESH_INTERP_METHOD'] == 'TPS'): - if self.have_MPI: - gamma_array_LoadX = PETSc.Vec().create(self.comm) - gamma_array_LoadY = PETSc.Vec().create(self.comm) - gamma_array_LoadZ = PETSc.Vec().create(self.comm) - gamma_array_LoadX.setType('mpi') - gamma_array_LoadY.setType('mpi') - gamma_array_LoadZ.setType('mpi') - KSP_solver = PETSc.KSP().create(self.comm) - else: - gamma_array_LoadX = PETSc.Vec().create() - gamma_array_LoadY = PETSc.Vec().create() - gamma_array_LoadZ = PETSc.Vec().create() - gamma_array_LoadX.setType('seq') - gamma_array_LoadY.setType('seq') - gamma_array_LoadZ.setType('seq') - KSP_solver = PETSc.KSP().create() - gamma_array_LoadX.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - gamma_array_LoadY.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - gamma_array_LoadZ.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - gamma_array_LoadX.set(0.0) - gamma_array_LoadY.set(0.0) - gamma_array_LoadZ.set(0.0) - KSP_solver.setType('fgmres') - KSP_solver.getPC().setType('jacobi') - KSP_solver.setOperators(self.MappingMatrixA_T) - KSP_solver.setFromOptions() - self.MappingMatrixB_T.mult(self.fluidLoads_array_X, gamma_array_LoadX) - self.MappingMatrixB_T.mult(self.fluidLoads_array_Y, gamma_array_LoadY) - if self.nDim==3: - self.MappingMatrixB_T.mult(self.fluidLoads_array_Z, gamma_array_LoadZ) - KSP_solver.solve(gamma_array_LoadX, self.solidLoads_array_X) - KSP_solver.solve(gamma_array_LoadY, self.solidLoads_array_Y) - if self.nDim==3: - KSP_solver.solve(gamma_array_LoadZ, self.solidLoads_array_Z) - gamma_array_LoadX.destroy() - gamma_array_LoadY.destroy() - gamma_array_LoadZ.destroy() - KSP_solver.destroy() - del gamma_array_LoadX - del gamma_array_LoadY - del gamma_array_LoadZ - del KSP_solver - else: - self.MappingMatrix_T.mult(self.fluidLoads_array_X, self.solidLoads_array_X) - self.MappingMatrix_T.mult(self.fluidLoads_array_Y, self.solidLoads_array_Y) - if self.nDim==3: - self.MappingMatrix_T.mult(self.fluidLoads_array_Z, self.solidLoads_array_Z) + # self.MappingMatrix.transpose() + if FSI_config["MATCHING_MESH"] == "NO" and ( + FSI_config["MESH_INTERP_METHOD"] == "RBF" + or FSI_config["MESH_INTERP_METHOD"] == "TPS" + ): + if self.have_MPI: + gamma_array_LoadX = PETSc.Vec().create(self.comm) + gamma_array_LoadY = PETSc.Vec().create(self.comm) + gamma_array_LoadZ = PETSc.Vec().create(self.comm) + gamma_array_LoadX.setType("mpi") + gamma_array_LoadY.setType("mpi") + gamma_array_LoadZ.setType("mpi") + KSP_solver = PETSc.KSP().create(self.comm) + else: + gamma_array_LoadX = PETSc.Vec().create() + gamma_array_LoadY = PETSc.Vec().create() + gamma_array_LoadZ = PETSc.Vec().create() + gamma_array_LoadX.setType("seq") + gamma_array_LoadY.setType("seq") + gamma_array_LoadZ.setType("seq") + KSP_solver = PETSc.KSP().create() + gamma_array_LoadX.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) + gamma_array_LoadY.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) + gamma_array_LoadZ.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) + gamma_array_LoadX.set(0.0) + gamma_array_LoadY.set(0.0) + gamma_array_LoadZ.set(0.0) + KSP_solver.setType("fgmres") + KSP_solver.getPC().setType("jacobi") + KSP_solver.setOperators(self.MappingMatrixA_T) + KSP_solver.setFromOptions() + self.MappingMatrixB_T.mult(self.fluidLoads_array_X, gamma_array_LoadX) + self.MappingMatrixB_T.mult(self.fluidLoads_array_Y, gamma_array_LoadY) + if self.nDim == 3: + self.MappingMatrixB_T.mult(self.fluidLoads_array_Z, gamma_array_LoadZ) + KSP_solver.solve(gamma_array_LoadX, self.solidLoads_array_X) + KSP_solver.solve(gamma_array_LoadY, self.solidLoads_array_Y) + if self.nDim == 3: + KSP_solver.solve(gamma_array_LoadZ, self.solidLoads_array_Z) + gamma_array_LoadX.destroy() + gamma_array_LoadY.destroy() + gamma_array_LoadZ.destroy() + KSP_solver.destroy() + del gamma_array_LoadX + del gamma_array_LoadY + del gamma_array_LoadZ + del KSP_solver + else: + self.MappingMatrix_T.mult(self.fluidLoads_array_X, self.solidLoads_array_X) + self.MappingMatrix_T.mult(self.fluidLoads_array_Y, self.solidLoads_array_Y) + if self.nDim == 3: + self.MappingMatrix_T.mult( + self.fluidLoads_array_Z, self.solidLoads_array_Z + ) # --- Redistribute the interpolated solid loads according to the partitions that own the solid interface --- # Gather the solid loads on the master process if self.have_MPI: - sendBuff_X = None - sendBuff_Y = None - sendBuff_Z = None - self.solidLoads_array_X_recon = None - self.solidLoads_array_Y_recon = None - self.solidLoads_array_Z_recon = None - if myid == self.rootProcess: - self.solidLoads_array_X_recon = np.zeros(self.nSolidInterfacePhysicalNodes+self.d_RBF) - self.solidLoads_array_Y_recon = np.zeros(self.nSolidInterfacePhysicalNodes+self.d_RBF) - self.solidLoads_array_Z_recon = np.zeros(self.nSolidInterfacePhysicalNodes+self.d_RBF) - myNumberOfNodes = self.solidLoads_array_X.getArray().shape[0] - sendBuffNumber = np.array([myNumberOfNodes], dtype=int) - rcvBuffNumber = np.zeros(MPIsize, dtype=int) - self.comm.Allgather(sendBuffNumber, rcvBuffNumber) - - counts = tuple(rcvBuffNumber) - displ = np.zeros(MPIsize, dtype=int) - for ii in range(rcvBuffNumber.shape[0]): - displ[ii] = rcvBuffNumber[0:ii].sum() - displ = tuple(displ) - - del sendBuffNumber, rcvBuffNumber - - self.comm.Gatherv(self.solidLoads_array_X.getArray(), [self.solidLoads_array_X_recon, counts, displ, self.MPI.DOUBLE], root=self.rootProcess) - self.comm.Gatherv(self.solidLoads_array_Y.getArray(), [self.solidLoads_array_Y_recon, counts, displ, self.MPI.DOUBLE], root=self.rootProcess) - self.comm.Gatherv(self.solidLoads_array_Z.getArray(), [self.solidLoads_array_Z_recon, counts, displ, self.MPI.DOUBLE], root=self.rootProcess) - - # Send the partitioned loads to the right solid partitions - if myid == self.rootProcess: - for iProc in self.solidInterfaceProcessors: - sendBuff_X = np.empty(self.solidPhysicalInterfaceNodesDistribution[iProc], dtype=np.float64) - sendBuff_Y = np.empty(self.solidPhysicalInterfaceNodesDistribution[iProc], dtype=np.float64) - sendBuff_Z = np.empty(self.solidPhysicalInterfaceNodesDistribution[iProc], dtype=np.float64) - globalIndex = self.__getGlobalIndex('solid', iProc, 0) - for iVertex in range(self.solidPhysicalInterfaceNodesDistribution[iProc]): - sendBuff_X[iVertex] = self.solidLoads_array_X_recon[globalIndex] - sendBuff_Y[iVertex] = self.solidLoads_array_Y_recon[globalIndex] - sendBuff_Z[iVertex] = self.solidLoads_array_Z_recon[globalIndex] - globalIndex += 1 - if iProc != myid: - self.comm.Send(sendBuff_X, dest=iProc, tag = 1) - self.comm.Send(sendBuff_Y, dest=iProc, tag = 2) - self.comm.Send(sendBuff_Z, dest=iProc, tag = 3) - else: - self.localSolidLoads_array_X = np.copy(sendBuff_X) - self.localSolidLoads_array_Y = np.copy(sendBuff_Y) - self.localSolidLoads_array_Z = np.copy(sendBuff_Z) - if myid in self.solidInterfaceProcessors: - if myid != self.rootProcess: - self.localSolidLoads_array_X = np.empty(self.nLocalSolidInterfacePhysicalNodes, dtype=np.float64) - self.localSolidLoads_array_Y = np.empty(self.nLocalSolidInterfacePhysicalNodes, dtype=np.float64) - self.localSolidLoads_array_Z = np.empty(self.nLocalSolidInterfacePhysicalNodes, dtype=np.float64) - self.comm.Recv(self.localSolidLoads_array_X, source=self.rootProcess, tag = 1) - self.comm.Recv(self.localSolidLoads_array_Y, source=self.rootProcess, tag = 2) - self.comm.Recv(self.localSolidLoads_array_Z, source=self.rootProcess, tag = 3) - del sendBuff_X - del sendBuff_Y - del sendBuff_Z - self.comm.barrier() - else: - self.localSolidLoads_array_X = self.solidLoads_array_X.getArray().copy() - self.localSolidLoads_array_Y = self.solidLoads_array_Y.getArray().copy() - self.localSolidLoads_array_Z = self.solidLoads_array_Z.getArray().copy() + sendBuff_X = None + sendBuff_Y = None + sendBuff_Z = None + self.solidLoads_array_X_recon = None + self.solidLoads_array_Y_recon = None + self.solidLoads_array_Z_recon = None + if myid == self.rootProcess: + self.solidLoads_array_X_recon = np.zeros( + self.nSolidInterfacePhysicalNodes + self.d_RBF + ) + self.solidLoads_array_Y_recon = np.zeros( + self.nSolidInterfacePhysicalNodes + self.d_RBF + ) + self.solidLoads_array_Z_recon = np.zeros( + self.nSolidInterfacePhysicalNodes + self.d_RBF + ) + myNumberOfNodes = self.solidLoads_array_X.getArray().shape[0] + sendBuffNumber = np.array([myNumberOfNodes], dtype=int) + rcvBuffNumber = np.zeros(MPIsize, dtype=int) + self.comm.Allgather(sendBuffNumber, rcvBuffNumber) + + counts = tuple(rcvBuffNumber) + displ = np.zeros(MPIsize, dtype=int) + for ii in range(rcvBuffNumber.shape[0]): + displ[ii] = rcvBuffNumber[0:ii].sum() + displ = tuple(displ) + + del sendBuffNumber, rcvBuffNumber + + self.comm.Gatherv( + self.solidLoads_array_X.getArray(), + [self.solidLoads_array_X_recon, counts, displ, self.MPI.DOUBLE], + root=self.rootProcess, + ) + self.comm.Gatherv( + self.solidLoads_array_Y.getArray(), + [self.solidLoads_array_Y_recon, counts, displ, self.MPI.DOUBLE], + root=self.rootProcess, + ) + self.comm.Gatherv( + self.solidLoads_array_Z.getArray(), + [self.solidLoads_array_Z_recon, counts, displ, self.MPI.DOUBLE], + root=self.rootProcess, + ) + + # Send the partitioned loads to the right solid partitions + if myid == self.rootProcess: + for iProc in self.solidInterfaceProcessors: + sendBuff_X = np.empty( + self.solidPhysicalInterfaceNodesDistribution[iProc], + dtype=np.float64, + ) + sendBuff_Y = np.empty( + self.solidPhysicalInterfaceNodesDistribution[iProc], + dtype=np.float64, + ) + sendBuff_Z = np.empty( + self.solidPhysicalInterfaceNodesDistribution[iProc], + dtype=np.float64, + ) + globalIndex = self.__getGlobalIndex("solid", iProc, 0) + for iVertex in range( + self.solidPhysicalInterfaceNodesDistribution[iProc] + ): + sendBuff_X[iVertex] = self.solidLoads_array_X_recon[globalIndex] + sendBuff_Y[iVertex] = self.solidLoads_array_Y_recon[globalIndex] + sendBuff_Z[iVertex] = self.solidLoads_array_Z_recon[globalIndex] + globalIndex += 1 + if iProc != myid: + self.comm.Send(sendBuff_X, dest=iProc, tag=1) + self.comm.Send(sendBuff_Y, dest=iProc, tag=2) + self.comm.Send(sendBuff_Z, dest=iProc, tag=3) + else: + self.localSolidLoads_array_X = np.copy(sendBuff_X) + self.localSolidLoads_array_Y = np.copy(sendBuff_Y) + self.localSolidLoads_array_Z = np.copy(sendBuff_Z) + if myid in self.solidInterfaceProcessors: + if myid != self.rootProcess: + self.localSolidLoads_array_X = np.empty( + self.nLocalSolidInterfacePhysicalNodes, dtype=np.float64 + ) + self.localSolidLoads_array_Y = np.empty( + self.nLocalSolidInterfacePhysicalNodes, dtype=np.float64 + ) + self.localSolidLoads_array_Z = np.empty( + self.nLocalSolidInterfacePhysicalNodes, dtype=np.float64 + ) + self.comm.Recv( + self.localSolidLoads_array_X, source=self.rootProcess, tag=1 + ) + self.comm.Recv( + self.localSolidLoads_array_Y, source=self.rootProcess, tag=2 + ) + self.comm.Recv( + self.localSolidLoads_array_Z, source=self.rootProcess, tag=3 + ) + del sendBuff_X + del sendBuff_Y + del sendBuff_Z + self.comm.barrier() + else: + self.localSolidLoads_array_X = self.solidLoads_array_X.getArray().copy() + self.localSolidLoads_array_Y = self.solidLoads_array_Y.getArray().copy() + self.localSolidLoads_array_Z = self.solidLoads_array_Z.getArray().copy() # Special treatment for the halo nodes on the solid interface self.haloNodesLoads = {} sendBuff = {} if self.have_MPI: - if myid == self.rootProcess: - for iProc in self.solidInterfaceProcessors: - sendBuff = {} - for key in self.SolidHaloNodeList[iProc].keys(): - globalIndex = self.solidIndexing[key] - DispX = self.solidLoads_array_X_recon[globalIndex] - DispY = self.solidLoads_array_Y_recon[globalIndex] - DispZ = self.solidLoads_array_Z_recon[globalIndex] - sendBuff[key] = (DispX, DispY, DispZ) - if iProc == self.rootProcess: - self.haloNodesLoads = sendBuff - else: - self.comm.send(sendBuff, dest = iProc, tag=4) - if myid in self.solidInterfaceProcessors: - if myid != self.rootProcess: - self.haloNodesLoads = self.comm.recv(source = self.rootProcess, tag = 4) - self.comm.barrier() - del self.solidLoads_array_X_recon - del self.solidLoads_array_Y_recon - del self.solidLoads_array_Z_recon + if myid == self.rootProcess: + for iProc in self.solidInterfaceProcessors: + sendBuff = {} + for key in self.SolidHaloNodeList[iProc].keys(): + globalIndex = self.solidIndexing[key] + DispX = self.solidLoads_array_X_recon[globalIndex] + DispY = self.solidLoads_array_Y_recon[globalIndex] + DispZ = self.solidLoads_array_Z_recon[globalIndex] + sendBuff[key] = (DispX, DispY, DispZ) + if iProc == self.rootProcess: + self.haloNodesLoads = sendBuff + else: + self.comm.send(sendBuff, dest=iProc, tag=4) + if myid in self.solidInterfaceProcessors: + if myid != self.rootProcess: + self.haloNodesLoads = self.comm.recv(source=self.rootProcess, tag=4) + self.comm.barrier() + del self.solidLoads_array_X_recon + del self.solidLoads_array_Y_recon + del self.solidLoads_array_Z_recon del sendBuff def getSolidInterfaceDisplacement(self, SolidSolver): @@ -1418,22 +2002,26 @@ def getSolidInterfaceDisplacement(self, SolidSolver): Gets the current solid interface position from the solid solver. """ if self.have_MPI: - myid = self.comm.Get_rank() + myid = self.comm.Get_rank() else: - myid = 0 + myid = 0 # --- Get the solid interface position from the solid solver and directly fill the corresponding PETSc vector --- GlobalIndex = int() localIndex = 0 for iVertex in range(self.nLocalSolidInterfaceNodes): - GlobalIndex = SolidSolver.getVertexGlobalIndex(self.solidInterfaceIdentifier, iVertex) - if GlobalIndex not in self.SolidHaloNodeList[myid].keys(): - newDispx, newDispy, newDispz = SolidSolver.getInterfaceNodeDisp(self.solidInterfaceIdentifier, iVertex) - iGlobalVertex = self.__getGlobalIndex('solid', myid, localIndex) - self.solidInterface_array_DispX.setValues([iGlobalVertex],newDispx) - self.solidInterface_array_DispY.setValues([iGlobalVertex],newDispy) - self.solidInterface_array_DispZ.setValues([iGlobalVertex],newDispz) - localIndex += 1 + GlobalIndex = SolidSolver.getVertexGlobalIndex( + self.solidInterfaceIdentifier, iVertex + ) + if GlobalIndex not in self.SolidHaloNodeList[myid].keys(): + newDispx, newDispy, newDispz = SolidSolver.getInterfaceNodeDisp( + self.solidInterfaceIdentifier, iVertex + ) + iGlobalVertex = self.__getGlobalIndex("solid", myid, localIndex) + self.solidInterface_array_DispX.setValues([iGlobalVertex], newDispx) + self.solidInterface_array_DispY.setValues([iGlobalVertex], newDispy) + self.solidInterface_array_DispZ.setValues([iGlobalVertex], newDispz) + localIndex += 1 self.solidInterface_array_DispX.assemblyBegin() self.solidInterface_array_DispX.assemblyEnd() @@ -1447,23 +2035,29 @@ def getFluidInterfaceNodalForce(self, FSI_config, FluidSolver): Gets the fluid interface loads from the fluid solver. """ if self.have_MPI: - myid = self.comm.Get_rank() + myid = self.comm.Get_rank() else: - myid = 0 + myid = 0 GlobalIndex = int() localIndex = 0 # --- Get the fluid interface loads from the fluid solver and directly fill the corresponding PETSc vector --- for iVertex in range(self.nLocalFluidInterfaceNodes): - GlobalIndex = FluidSolver.GetVertexGlobalIndex(self.fluidInterfaceIdentifier, iVertex) + GlobalIndex = FluidSolver.GetNodeGlobalIndex( + FluidSolver.GetMarkerNode(self.fluidInterfaceIdentifier, iVertex) + ) if GlobalIndex not in self.FluidHaloNodeList[myid].keys(): - loadX, loadY, loadZ = FluidSolver.GetFlowLoad(self.fluidInterfaceIdentifier, iVertex) - iGlobalVertex = self.__getGlobalIndex('fluid', myid, localIndex) - self.fluidLoads_array_X.setValues([iGlobalVertex], loadX) - self.fluidLoads_array_Y.setValues([iGlobalVertex], loadY) - self.fluidLoads_array_Z.setValues([iGlobalVertex], loadZ) - localIndex += 1 + load = FluidSolver.GetMarkerFlowLoad( + self.fluidInterfaceIdentifier, iVertex + ) + iGlobalVertex = self.__getGlobalIndex("fluid", myid, localIndex) + self.fluidLoads_array_X.setValues([iGlobalVertex], load[0]) + self.fluidLoads_array_Y.setValues([iGlobalVertex], load[1]) + self.fluidLoads_array_Z.setValues( + [iGlobalVertex], load[2] if len(load) == 3 else 0.0 + ) + localIndex += 1 self.fluidLoads_array_X.assemblyBegin() self.fluidLoads_array_X.assemblyEnd() @@ -1472,31 +2066,39 @@ def getFluidInterfaceNodalForce(self, FSI_config, FluidSolver): self.fluidLoads_array_Z.assemblyBegin() self.fluidLoads_array_Z.assemblyEnd() - def setFluidInterfaceVarCoord(self, FluidSolver): """ Communicate the change of coordinates of the fluid interface to the fluid solver. Prepare the fluid solver for mesh deformation. """ if self.have_MPI: - myid = self.comm.Get_rank() + myid = self.comm.Get_rank() else: - myid = 0 + myid = 0 # --- Send the new fluid interface position to the fluid solver (on each partition, halo nodes included) --- localIndex = 0 for iVertex in range(self.nLocalFluidInterfaceNodes): - GlobalIndex = FluidSolver.GetVertexGlobalIndex(self.fluidInterfaceIdentifier, iVertex) + GlobalIndex = FluidSolver.GetNodeGlobalIndex( + FluidSolver.GetMarkerNode(self.fluidInterfaceIdentifier, iVertex) + ) if GlobalIndex in self.FluidHaloNodeList[myid].keys(): - DispX, DispY, DispZ = self.haloNodesDisplacements[GlobalIndex] - FluidSolver.SetMeshDisplacement(self.fluidInterfaceIdentifier, int(iVertex), DispX, DispY, DispZ) + DispX, DispY, DispZ = self.haloNodesDisplacements[GlobalIndex] + FluidSolver.SetMarkerCustomDisplacement( + self.fluidInterfaceIdentifier, + int(iVertex), + np.array([DispX, DispY, DispZ]), + ) else: - DispX = self.localFluidInterface_array_DispX[localIndex] - DispY = self.localFluidInterface_array_DispY[localIndex] - DispZ = self.localFluidInterface_array_DispZ[localIndex] - FluidSolver.SetMeshDisplacement(self.fluidInterfaceIdentifier, int(iVertex), DispX, DispY, DispZ) - localIndex += 1 - + DispX = self.localFluidInterface_array_DispX[localIndex] + DispY = self.localFluidInterface_array_DispY[localIndex] + DispZ = self.localFluidInterface_array_DispZ[localIndex] + FluidSolver.SetMarkerCustomDisplacement( + self.fluidInterfaceIdentifier, + int(iVertex), + np.array([DispX, DispY, DispZ]), + ) + localIndex += 1 def setSolidInterfaceLoads(self, SolidSolver, FSI_config): """ @@ -1504,17 +2106,17 @@ def setSolidInterfaceLoads(self, SolidSolver, FSI_config): Calculates the new resultant forces (lift, drag, ...). """ if self.have_MPI: - myid = self.comm.Get_rank() + myid = self.comm.Get_rank() else: - myid = 0 + myid = 0 FX = np.array(0.0, dtype=np.float64) - FY = np.array(0.0, dtype=np.float64) # solid-side resultant forces + FY = np.array(0.0, dtype=np.float64) # solid-side resultant forces FZ = np.array(0.0, dtype=np.float64) FXSendBuff = np.array(0.0, dtype=np.float64) FYSendBuff = np.array(0.0, dtype=np.float64) FZSendBuff = np.array(0.0, dtype=np.float64) - FFX = 0.0 # fluid-side resultant forces + FFX = 0.0 # fluid-side resultant forces FFY = 0.0 FFZ = 0.0 @@ -1524,40 +2126,42 @@ def setSolidInterfaceLoads(self, SolidSolver, FSI_config): FFZ = self.fluidLoads_array_Z.sum() for iVertex in range(self.nLocalSolidInterfacePhysicalNodes): - FXSendBuff += self.localSolidLoads_array_X[iVertex] - FYSendBuff += self.localSolidLoads_array_Y[iVertex] - FZSendBuff += self.localSolidLoads_array_Z[iVertex] + FXSendBuff += self.localSolidLoads_array_X[iVertex] + FYSendBuff += self.localSolidLoads_array_Y[iVertex] + FZSendBuff += self.localSolidLoads_array_Z[iVertex] if self.have_MPI: - self.comm.Allreduce(FXSendBuff, FX, op=self.MPI.SUM) - self.comm.Allreduce(FYSendBuff, FY, op=self.MPI.SUM) - self.comm.Allreduce(FZSendBuff, FZ, op=self.MPI.SUM) + self.comm.Allreduce(FXSendBuff, FX, op=self.MPI.SUM) + self.comm.Allreduce(FYSendBuff, FY, op=self.MPI.SUM) + self.comm.Allreduce(FZSendBuff, FZ, op=self.MPI.SUM) else: - FX = np.copy(FXSendBuff) - FY = np.copy(FYSendBuff) - FZ = np.copy(FZSendBuff) + FX = np.copy(FXSendBuff) + FY = np.copy(FYSendBuff) + FZ = np.copy(FZSendBuff) del FXSendBuff del FYSendBuff del FZSendBuff self.MPIPrint("Checking f/s interface total force...") - self.MPIPrint('Solid side (Fx, Fy, Fz) = ({}, {}, {})'.format(FX, FY, FZ)) - self.MPIPrint('Fluid side (Fx, Fy, Fz) = ({}, {}, {})'.format(FFX, FFY, FFZ)) + self.MPIPrint("Solid side (Fx, Fy, Fz) = ({}, {}, {})".format(FX, FY, FZ)) + self.MPIPrint("Fluid side (Fx, Fy, Fz) = ({}, {}, {})".format(FFX, FFY, FFZ)) # --- Send the new solid interface loads to the solid solver (on each partition, halo nodes included) --- GlobalIndex = int() localIndex = 0 for iVertex in range(self.nLocalSolidInterfaceNodes): - GlobalIndex = SolidSolver.getVertexGlobalIndex(self.solidInterfaceIdentifier, iVertex) - if GlobalIndex in self.SolidHaloNodeList[myid].keys(): - pass #TODO here, when the solid solver will run in parallel, we will need to pass the halo loads - else: - Fx = self.localSolidLoads_array_X[localIndex] - Fy = self.localSolidLoads_array_Y[localIndex] - Fz = self.localSolidLoads_array_Z[localIndex] - SolidSolver.applyload(iVertex, Fx, Fy, Fz) - localIndex += 1 + GlobalIndex = SolidSolver.getVertexGlobalIndex( + self.solidInterfaceIdentifier, iVertex + ) + if GlobalIndex in self.SolidHaloNodeList[myid].keys(): + pass # TODO here, when the solid solver will run in parallel, we will need to pass the halo loads + else: + Fx = self.localSolidLoads_array_X[localIndex] + Fy = self.localSolidLoads_array_Y[localIndex] + Fz = self.localSolidLoads_array_Z[localIndex] + SolidSolver.applyload(iVertex, Fx, Fy, Fz) + localIndex += 1 def computeSolidInterfaceResidual(self, SolidSolver): """ @@ -1565,40 +2169,42 @@ def computeSolidInterfaceResidual(self, SolidSolver): """ if self.have_MPI: - myid = self.comm.Get_rank() + myid = self.comm.Get_rank() else: - myid = 0 + myid = 0 normInterfaceResidualSquare = 0.0 # --- Create and fill the PETSc vector for the predicted solid interface position (predicted by the solid computation) --- if self.have_MPI: - predDisp_array_X = PETSc.Vec().create(self.comm) - predDisp_array_X.setType('mpi') - predDisp_array_Y = PETSc.Vec().create(self.comm) - predDisp_array_Y.setType('mpi') - predDisp_array_Z = PETSc.Vec().create(self.comm) - predDisp_array_Z.setType('mpi') - else: - predDisp_array_X = PETSc.Vec().create() - predDisp_array_X.setType('seq') - predDisp_array_Y = PETSc.Vec().create() - predDisp_array_Y.setType('seq') - predDisp_array_Z = PETSc.Vec().create() - predDisp_array_Z.setType('seq') - predDisp_array_X.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - predDisp_array_Y.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - predDisp_array_Z.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) + predDisp_array_X = PETSc.Vec().create(self.comm) + predDisp_array_X.setType("mpi") + predDisp_array_Y = PETSc.Vec().create(self.comm) + predDisp_array_Y.setType("mpi") + predDisp_array_Z = PETSc.Vec().create(self.comm) + predDisp_array_Z.setType("mpi") + else: + predDisp_array_X = PETSc.Vec().create() + predDisp_array_X.setType("seq") + predDisp_array_Y = PETSc.Vec().create() + predDisp_array_Y.setType("seq") + predDisp_array_Z = PETSc.Vec().create() + predDisp_array_Z.setType("seq") + predDisp_array_X.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) + predDisp_array_Y.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) + predDisp_array_Z.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) predDisp_array_X.set(0.0) predDisp_array_Y.set(0.0) predDisp_array_Z.set(0.0) for iVertex in range(self.nLocalSolidInterfaceNodes): - predDispx, predDispy, predDispz = SolidSolver.getInterfaceNodeDisp(self.solidInterfaceIdentifier, iVertex) - iGlobalVertex = self.__getGlobalIndex('solid', myid, iVertex) - predDisp_array_X.setValues([iGlobalVertex], predDispx) - predDisp_array_Y.setValues([iGlobalVertex], predDispy) - predDisp_array_Z.setValues([iGlobalVertex], predDispz) + predDispx, predDispy, predDispz = SolidSolver.getInterfaceNodeDisp( + self.solidInterfaceIdentifier, iVertex + ) + iGlobalVertex = self.__getGlobalIndex("solid", myid, iVertex) + predDisp_array_X.setValues([iGlobalVertex], predDispx) + predDisp_array_Y.setValues([iGlobalVertex], predDispy) + predDisp_array_Z.setValues([iGlobalVertex], predDispz) predDisp_array_X.assemblyBegin() predDisp_array_X.assemblyEnd() @@ -1608,15 +2214,25 @@ def computeSolidInterfaceResidual(self, SolidSolver): predDisp_array_Z.assemblyEnd() # --- Calculate the residual (vector and norm) --- - self.solidInterfaceResidual_array_X = predDisp_array_X - self.solidInterface_array_DispX - self.solidInterfaceResidual_array_Y = predDisp_array_Y - self.solidInterface_array_DispY - self.solidInterfaceResidual_array_Z = predDisp_array_Z - self.solidInterface_array_DispZ + self.solidInterfaceResidual_array_X = ( + predDisp_array_X - self.solidInterface_array_DispX + ) + self.solidInterfaceResidual_array_Y = ( + predDisp_array_Y - self.solidInterface_array_DispY + ) + self.solidInterfaceResidual_array_Z = ( + predDisp_array_Z - self.solidInterface_array_DispZ + ) normInterfaceResidual_X = self.solidInterfaceResidual_array_X.norm() normInterfaceResidual_Y = self.solidInterfaceResidual_array_Y.norm() normInterfaceResidual_Z = self.solidInterfaceResidual_array_Z.norm() - normInterfaceResidualSquare = normInterfaceResidual_X**2 + normInterfaceResidual_Y**2 + normInterfaceResidual_Z**2 + normInterfaceResidualSquare = ( + normInterfaceResidual_X**2 + + normInterfaceResidual_Y**2 + + normInterfaceResidual_Z**2 + ) predDisp_array_X.destroy() predDisp_array_Y.destroy() @@ -1627,30 +2243,37 @@ def computeSolidInterfaceResidual(self, SolidSolver): return sqrt(normInterfaceResidualSquare) - def relaxSolidPosition(self,FSI_config): + def relaxSolidPosition(self, FSI_config): """ Apply solid displacement under-relaxation. """ if self.have_MPI: - myid = self.comm.Get_rank() + myid = self.comm.Get_rank() else: - myid = 0 + myid = 0 # --- Set the Aitken coefficient for the relaxation --- - if FSI_config['AITKEN_RELAX'] == 'STATIC': - self.aitkenParam = FSI_config['AITKEN_PARAM'] - elif FSI_config['AITKEN_RELAX'] == 'DYNAMIC': + if FSI_config["AITKEN_RELAX"] == "STATIC": + self.aitkenParam = FSI_config["AITKEN_PARAM"] + elif FSI_config["AITKEN_RELAX"] == "DYNAMIC": self.setAitkenCoefficient(FSI_config) else: self.aitkenParam = 1.0 - self.MPIPrint('Aitken under-relaxation step with parameter {}'.format(self.aitkenParam)) + self.MPIPrint( + "Aitken under-relaxation step with parameter {}".format(self.aitkenParam) + ) # --- Relax the solid interface position --- - self.solidInterface_array_DispX += self.aitkenParam*self.solidInterfaceResidual_array_X - self.solidInterface_array_DispY += self.aitkenParam*self.solidInterfaceResidual_array_Y - self.solidInterface_array_DispZ += self.aitkenParam*self.solidInterfaceResidual_array_Z - + self.solidInterface_array_DispX += ( + self.aitkenParam * self.solidInterfaceResidual_array_X + ) + self.solidInterface_array_DispY += ( + self.aitkenParam * self.solidInterfaceResidual_array_Y + ) + self.solidInterface_array_DispZ += ( + self.aitkenParam * self.solidInterfaceResidual_array_Z + ) def setAitkenCoefficient(self, FSI_config): """ @@ -1662,22 +2285,22 @@ def setAitkenCoefficient(self, FSI_config): # --- Create the PETSc vector for the difference between the residuals (current and previous FSI iter) --- if self.FSIIter == 0: - self.aitkenParam = max(FSI_config['AITKEN_PARAM'], self.aitkenParam) + self.aitkenParam = max(FSI_config["AITKEN_PARAM"], self.aitkenParam) else: if self.have_MPI: - deltaResx_array_X = PETSc.Vec().create(self.comm) - deltaResx_array_X.setType('mpi') - deltaResx_array_Y = PETSc.Vec().create(self.comm) - deltaResx_array_Y.setType('mpi') - deltaResx_array_Z = PETSc.Vec().create(self.comm) - deltaResx_array_Z.setType('mpi') + deltaResx_array_X = PETSc.Vec().create(self.comm) + deltaResx_array_X.setType("mpi") + deltaResx_array_Y = PETSc.Vec().create(self.comm) + deltaResx_array_Y.setType("mpi") + deltaResx_array_Z = PETSc.Vec().create(self.comm) + deltaResx_array_Z.setType("mpi") else: - deltaResx_array_X = PETSc.Vec().create() - deltaResx_array_X.setType('seq') - deltaResx_array_Y = PETSc.Vec().create() - deltaResx_array_Y.setType('seq') - deltaResx_array_Z = PETSc.Vec().create() - deltaResx_array_Z.setType('seq') + deltaResx_array_X = PETSc.Vec().create() + deltaResx_array_X.setType("seq") + deltaResx_array_Y = PETSc.Vec().create() + deltaResx_array_Y.setType("seq") + deltaResx_array_Z = PETSc.Vec().create() + deltaResx_array_Z.setType("seq") deltaResx_array_X.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) deltaResx_array_X.set(0.0) deltaResx_array_Y.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) @@ -1686,21 +2309,38 @@ def setAitkenCoefficient(self, FSI_config): deltaResx_array_Z.set(0.0) # --- Compute the dynamic Aitken coefficient --- - deltaResx_array_X = self.solidInterfaceResidual_array_X - self.solidInterfaceResidualnM1_array_X - deltaResx_array_Y = self.solidInterfaceResidual_array_Y - self.solidInterfaceResidualnM1_array_Y - deltaResx_array_Z = self.solidInterfaceResidual_array_Z - self.solidInterfaceResidualnM1_array_Z - - prodScalRes_X = deltaResx_array_X.dot(self.solidInterfaceResidualnM1_array_X) - prodScalRes_Y = deltaResx_array_Y.dot(self.solidInterfaceResidualnM1_array_Y) - prodScalRes_Z = deltaResx_array_Z.dot(self.solidInterfaceResidualnM1_array_Z) + deltaResx_array_X = ( + self.solidInterfaceResidual_array_X + - self.solidInterfaceResidualnM1_array_X + ) + deltaResx_array_Y = ( + self.solidInterfaceResidual_array_Y + - self.solidInterfaceResidualnM1_array_Y + ) + deltaResx_array_Z = ( + self.solidInterfaceResidual_array_Z + - self.solidInterfaceResidualnM1_array_Z + ) + + prodScalRes_X = deltaResx_array_X.dot( + self.solidInterfaceResidualnM1_array_X + ) + prodScalRes_Y = deltaResx_array_Y.dot( + self.solidInterfaceResidualnM1_array_Y + ) + prodScalRes_Z = deltaResx_array_Z.dot( + self.solidInterfaceResidualnM1_array_Z + ) prodScalRes = prodScalRes_X + prodScalRes_Y + prodScalRes_Z - deltaResNormSquare_X = (deltaResx_array_X.norm())**2 - deltaResNormSquare_Y = (deltaResx_array_Y.norm())**2 - deltaResNormSquare_Z = (deltaResx_array_Z.norm())**2 - deltaResNormSquare = deltaResNormSquare_X + deltaResNormSquare_Y + deltaResNormSquare_Z + deltaResNormSquare_X = (deltaResx_array_X.norm()) ** 2 + deltaResNormSquare_Y = (deltaResx_array_Y.norm()) ** 2 + deltaResNormSquare_Z = (deltaResx_array_Z.norm()) ** 2 + deltaResNormSquare = ( + deltaResNormSquare_X + deltaResNormSquare_Y + deltaResNormSquare_Z + ) - self.aitkenParam *= -prodScalRes/deltaResNormSquare + self.aitkenParam *= -prodScalRes / deltaResNormSquare deltaResx_array_X.destroy() deltaResx_array_Y.destroy() @@ -1717,21 +2357,21 @@ def setAitkenCoefficient(self, FSI_config): self.solidInterfaceResidual_array_Y.copy(self.solidInterfaceResidualnM1_array_Y) self.solidInterfaceResidual_array_Z.copy(self.solidInterfaceResidualnM1_array_Z) - def displacementPredictor(self, FSI_config , SolidSolver, deltaT): + def displacementPredictor(self, FSI_config, SolidSolver, deltaT): """ Calculates a prediciton for the solid interface position for the next time step. """ if self.have_MPI: - myid = self.comm.Get_rank() + myid = self.comm.Get_rank() else: - myid = 0 + myid = 0 - if FSI_config['DISP_PRED'] == 'FIRST_ORDER': + if FSI_config["DISP_PRED"] == "FIRST_ORDER": self.MPIPrint("First order predictor") alpha_0 = 1.0 alpha_1 = 0.0 - elif FSI_config['DISP_PRED'] == 'SECOND_ORDER': + elif FSI_config["DISP_PRED"] == "SECOND_ORDER": self.MPIPrint("Second order predictor") alpha_0 = 1.0 alpha_1 = 0.5 @@ -1742,61 +2382,66 @@ def displacementPredictor(self, FSI_config , SolidSolver, deltaT): # --- Create the PETSc vectors to store the solid interface velocity --- if self.have_MPI: - Vel_array_X = PETSc.Vec().create(self.comm) - Vel_array_X.setType('mpi') - Vel_array_Y = PETSc.Vec().create(self.comm) - Vel_array_Y.setType('mpi') - Vel_array_Z = PETSc.Vec().create(self.comm) - Vel_array_Z.setType('mpi') - VelnM1_array_X = PETSc.Vec().create(self.comm) - VelnM1_array_X.setType('mpi') - VelnM1_array_Y = PETSc.Vec().create(self.comm) - VelnM1_array_Y.setType('mpi') - VelnM1_array_Z = PETSc.Vec().create(self.comm) - VelnM1_array_Z.setType('mpi') - else: - Vel_array_X = PETSc.Vec().create() - Vel_array_X.setType('seq') - Vel_array_Y = PETSc.Vec().create() - Vel_array_Y.setType('seq') - Vel_array_Z = PETSc.Vec().create() - Vel_array_Z.setType('seq') - VelnM1_array_X = PETSc.Vec().create() - VelnM1_array_X.setType('seq') - VelnM1_array_Y = PETSc.Vec().create() - VelnM1_array_Y.setType('seq') - VelnM1_array_Z = PETSc.Vec().create() - VelnM1_array_Z.setType('seq') - Vel_array_X.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - Vel_array_Y.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - Vel_array_Z.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) + Vel_array_X = PETSc.Vec().create(self.comm) + Vel_array_X.setType("mpi") + Vel_array_Y = PETSc.Vec().create(self.comm) + Vel_array_Y.setType("mpi") + Vel_array_Z = PETSc.Vec().create(self.comm) + Vel_array_Z.setType("mpi") + VelnM1_array_X = PETSc.Vec().create(self.comm) + VelnM1_array_X.setType("mpi") + VelnM1_array_Y = PETSc.Vec().create(self.comm) + VelnM1_array_Y.setType("mpi") + VelnM1_array_Z = PETSc.Vec().create(self.comm) + VelnM1_array_Z.setType("mpi") + else: + Vel_array_X = PETSc.Vec().create() + Vel_array_X.setType("seq") + Vel_array_Y = PETSc.Vec().create() + Vel_array_Y.setType("seq") + Vel_array_Z = PETSc.Vec().create() + Vel_array_Z.setType("seq") + VelnM1_array_X = PETSc.Vec().create() + VelnM1_array_X.setType("seq") + VelnM1_array_Y = PETSc.Vec().create() + VelnM1_array_Y.setType("seq") + VelnM1_array_Z = PETSc.Vec().create() + VelnM1_array_Z.setType("seq") + Vel_array_X.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) + Vel_array_Y.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) + Vel_array_Z.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) Vel_array_X.set(0.0) Vel_array_Y.set(0.0) Vel_array_Z.set(0.0) - VelnM1_array_X.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - VelnM1_array_Y.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) - VelnM1_array_Z.setSizes(self.nSolidInterfacePhysicalNodes+self.d_RBF) + VelnM1_array_X.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) + VelnM1_array_Y.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) + VelnM1_array_Z.setSizes(self.nSolidInterfacePhysicalNodes + self.d_RBF) VelnM1_array_X.set(0.0) VelnM1_array_Y.set(0.0) VelnM1_array_Z.set(0.0) - # --- Fill the PETSc vectors --- GlobalIndex = int() localIndex = 0 for iVertex in range(self.nLocalSolidInterfaceNodes): - GlobalIndex = SolidSolver.getVertexGlobalIndex(self.solidInterfaceIdentifier, iVertex) + GlobalIndex = SolidSolver.getVertexGlobalIndex( + self.solidInterfaceIdentifier, iVertex + ) if GlobalIndex not in self.SolidHaloNodeList[myid].keys(): - iGlobalVertex = self.__getGlobalIndex('solid', myid, localIndex) - velx, vely, velz = SolidSolver.getInterfaceNodeVel(self.solidInterfaceIdentifier, iVertex) - velxNm1, velyNm1, velzNm1 = SolidSolver.getInterfaceNodeVelNm1(self.solidInterfaceIdentifier, iVertex) - Vel_array_X.setValues([iGlobalVertex],velx) - Vel_array_Y.setValues([iGlobalVertex],vely) - Vel_array_Z.setValues([iGlobalVertex],velz) - VelnM1_array_X.setValues([iGlobalVertex],velxNm1) - VelnM1_array_Y.setValues([iGlobalVertex],velyNm1) - VelnM1_array_Z.setValues([iGlobalVertex],velzNm1) - localIndex += 1 + iGlobalVertex = self.__getGlobalIndex("solid", myid, localIndex) + velx, vely, velz = SolidSolver.getInterfaceNodeVel( + self.solidInterfaceIdentifier, iVertex + ) + velxNm1, velyNm1, velzNm1 = SolidSolver.getInterfaceNodeVelNm1( + self.solidInterfaceIdentifier, iVertex + ) + Vel_array_X.setValues([iGlobalVertex], velx) + Vel_array_Y.setValues([iGlobalVertex], vely) + Vel_array_Z.setValues([iGlobalVertex], velz) + VelnM1_array_X.setValues([iGlobalVertex], velxNm1) + VelnM1_array_Y.setValues([iGlobalVertex], velyNm1) + VelnM1_array_Z.setValues([iGlobalVertex], velzNm1) + localIndex += 1 Vel_array_X.assemblyBegin() Vel_array_X.assemblyEnd() @@ -1812,9 +2457,18 @@ def displacementPredictor(self, FSI_config , SolidSolver, deltaT): VelnM1_array_Z.assemblyEnd() # --- Predict the solid position for the next time step --- - self.solidInterface_array_DispX += alpha_0*deltaT*Vel_array_X + alpha_1*deltaT*(Vel_array_X - VelnM1_array_X) - self.solidInterface_array_DispY += alpha_0*deltaT*Vel_array_Y + alpha_1*deltaT*(Vel_array_Y - VelnM1_array_Y) - self.solidInterface_array_DispZ += alpha_0*deltaT*Vel_array_Z + alpha_1*deltaT*(Vel_array_Z - VelnM1_array_Z) + self.solidInterface_array_DispX += ( + alpha_0 * deltaT * Vel_array_X + + alpha_1 * deltaT * (Vel_array_X - VelnM1_array_X) + ) + self.solidInterface_array_DispY += ( + alpha_0 * deltaT * Vel_array_Y + + alpha_1 * deltaT * (Vel_array_Y - VelnM1_array_Y) + ) + self.solidInterface_array_DispZ += ( + alpha_0 * deltaT * Vel_array_Z + + alpha_1 * deltaT * (Vel_array_Z - VelnM1_array_Z) + ) Vel_array_X.destroy() Vel_array_Y.destroy() @@ -1831,31 +2485,48 @@ def writeFSIHistory(self, TimeIter, time, varCoordNorm, FSIConv): """ if self.have_MPI: - myid = self.comm.Get_rank() + myid = self.comm.Get_rank() else: - myid = 0 + myid = 0 if myid == self.rootProcess: - if self.unsteady: - if TimeIter == 0: - histFile = open('FSIhistory.dat', "w") - histFile.write("TimeIter\tTime\tFSIRes\tFSINbIter\n") - else: - histFile = open('FSIhistory.dat', "a") - if FSIConv: - histFile.write(str(TimeIter) + '\t' + str(time) + '\t' + str(varCoordNorm) + '\t' + str(self.FSIIter+1) + '\n') + if self.unsteady: + if TimeIter == 0: + histFile = open("FSIhistory.dat", "w") + histFile.write("TimeIter\tTime\tFSIRes\tFSINbIter\n") + else: + histFile = open("FSIhistory.dat", "a") + if FSIConv: + histFile.write( + str(TimeIter) + + "\t" + + str(time) + + "\t" + + str(varCoordNorm) + + "\t" + + str(self.FSIIter + 1) + + "\n" + ) + else: + histFile.write( + str(TimeIter) + + "\t" + + str(time) + + "\t" + + str(varCoordNorm) + + "\t" + + str(self.FSIIter) + + "\n" + ) + histFile.close() else: - histFile.write(str(TimeIter) + '\t' + str(time) + '\t' + str(varCoordNorm) + '\t' + str(self.FSIIter) + '\n') - histFile.close() - else: - if self.FSIIter == 0: - histFile = open('FSIhistory.dat', "w") - histFile.write("FSI Iter\tFSIRes\n") - else : - histFile = open('FSIhistory.dat', "a") - histFile.write(str(self.FSIIter) + '\t' + str(varCoordNorm) + '\n') - histFile.close() - + if self.FSIIter == 0: + histFile = open("FSIhistory.dat", "w") + histFile.write("FSI Iter\tFSIRes\n") + else: + histFile = open("FSIhistory.dat", "a") + histFile.write(str(self.FSIIter) + "\t" + str(varCoordNorm) + "\n") + histFile.close() self.MPIBarrier() @@ -1867,334 +2538,378 @@ def __getGlobalIndex(self, physics, iProc, iLocalVertex): interface. """ - if physics == 'fluid': - globalStartIndex = self.fluidGlobalIndexRange[iProc][iProc][0] - elif physics == 'solid': - globalStartIndex = self.solidGlobalIndexRange[iProc][iProc][0] + if physics == "fluid": + globalStartIndex = self.fluidGlobalIndexRange[iProc][iProc][0] + elif physics == "solid": + globalStartIndex = self.solidGlobalIndexRange[iProc][iProc][0] globalIndex = globalStartIndex + iLocalVertex return globalIndex + def UnsteadyFSI(self, FSI_config, FluidSolver, SolidSolver): + """ + Run the unsteady FSI computation by synchronizing the fluid and solid solvers. + F/s interface data are exchanged through interface mapping and interpolation (if non mathcing meshes). + """ - def UnsteadyFSI(self,FSI_config, FluidSolver, SolidSolver): - """ - Run the unsteady FSI computation by synchronizing the fluid and solid solvers. - F/s interface data are exchanged through interface mapping and interpolation (if non mathcing meshes). - """ - - if self.have_MPI: + if self.have_MPI: myid = self.comm.Get_rank() numberPart = self.comm.Get_size() - else: + else: myid = 0 numberPart = 1 - # --- Set some general variables for the unsteady computation --- # - deltaT = FSI_config['UNST_TIMESTEP'] # physical time step - totTime = FSI_config['UNST_TIME'] # physical simulation time - NbFSIIterMax = FSI_config['NB_FSI_ITER'] # maximum number of FSI iteration (for each time step) - FSITolerance = FSI_config['FSI_TOLERANCE'] # f/s interface tolerance - TimeIterTreshold = FSI_config['TIME_TRESHOLD'] # time iteration from which we allow the solid to deform - self.MPIPrint('The FSI coupling will start after {} iterations'.format(TimeIterTreshold)) - - if FSI_config['RESTART_SOL'] == 'YES': - NbTimeIter = ((totTime)/deltaT)-1 - time = (FSI_config['RESTART_ITER'])*deltaT - TimeIter = FSI_config['RESTART_ITER'] - else: - NbTimeIter = (totTime/deltaT)-1 # number of time iterations - time = 0.0 # initial time - TimeIter = 0 # initial time iteration - - NbTimeIter = int(NbTimeIter) # be sure that NbTimeIter is an integer - - varCoordNorm = 0.0 # FSI residual - FSIConv = False # FSI convergence flag - - self.MPIPrint('\n**********************************') - self.MPIPrint('* Begin unsteady FSI computation *') - self.MPIPrint('**********************************\n') - - # --- Initialize the coupled solution --- # - #If restart - if FSI_config['RESTART_SOL'] == 'YES': + # --- Set some general variables for the unsteady computation --- # + deltaT = FSI_config["UNST_TIMESTEP"] # physical time step + totTime = FSI_config["UNST_TIME"] # physical simulation time + NbFSIIterMax = FSI_config[ + "NB_FSI_ITER" + ] # maximum number of FSI iteration (for each time step) + FSITolerance = FSI_config["FSI_TOLERANCE"] # f/s interface tolerance + TimeIterTreshold = FSI_config[ + "TIME_TRESHOLD" + ] # time iteration from which we allow the solid to deform + self.MPIPrint( + "The FSI coupling will start after {} iterations".format(TimeIterTreshold) + ) + + if FSI_config["RESTART_SOL"] == "YES": + NbTimeIter = ((totTime) / deltaT) - 1 + time = (FSI_config["RESTART_ITER"]) * deltaT + TimeIter = FSI_config["RESTART_ITER"] + else: + NbTimeIter = (totTime / deltaT) - 1 # number of time iterations + time = 0.0 # initial time + TimeIter = 0 # initial time iteration + + NbTimeIter = int(NbTimeIter) # be sure that NbTimeIter is an integer + + varCoordNorm = 0.0 # FSI residual + FSIConv = False # FSI convergence flag + + self.MPIPrint("\n**********************************") + self.MPIPrint("* Begin unsteady FSI computation *") + self.MPIPrint("**********************************\n") + + # --- Initialize the coupled solution --- # + # If restart + if FSI_config["RESTART_SOL"] == "YES": self.getSolidInterfaceDisplacement(SolidSolver) self.displacementPredictor(FSI_config, SolidSolver, deltaT) if myid in self.solidSolverProcessors: - SolidSolver.updateSolution() - #If no restart - else: - self.MPIPrint('Setting FSI initial conditions') + SolidSolver.updateSolution() + # If no restart + else: + self.MPIPrint("Setting FSI initial conditions") if myid in self.solidSolverProcessors: - SolidSolver.setInitialDisplacements() + SolidSolver.setInitialDisplacements() self.getSolidInterfaceDisplacement(SolidSolver) self.interpolateSolidPositionOnFluidMesh(FSI_config) self.setFluidInterfaceVarCoord(FluidSolver) - self.MPIPrint('\nPerforming static mesh deformation (ALE) of initial mesh...\n') + self.MPIPrint( + "\nPerforming static mesh deformation (ALE) of initial mesh...\n" + ) if myid in self.fluidSolverProcessors: - FluidSolver.SetInitialMesh() # if there is an initial deformation in the solid, it has to be communicated to the fluid solver - self.MPIPrint('\nFSI initial conditions are set') - self.MPIPrint('Beginning time integration\n') + FluidSolver.SetInitialMesh() # if there is an initial deformation in the solid, it has to be communicated to the fluid solver + self.MPIPrint("\nFSI initial conditions are set") + self.MPIPrint("Beginning time integration\n") + + # --- External temporal loop --- # + while TimeIter <= NbTimeIter: + + if TimeIter > TimeIterTreshold: + NbFSIIter = NbFSIIterMax + self.MPIPrint("\n") + self.MPIPrint( + " Enter Block Gauss Seidel (BGS) method for strong coupling FSI on time iteration {} ".format( + TimeIter + ).center( + 80, "*" + ) + ) + else: + NbFSIIter = 1 - # --- External temporal loop --- # - while TimeIter <= NbTimeIter: + self.FSIIter = 0 + FSIConv = False - if TimeIter > TimeIterTreshold: - NbFSIIter = NbFSIIterMax - self.MPIPrint("\n") - self.MPIPrint(" Enter Block Gauss Seidel (BGS) method for strong coupling FSI on time iteration {} ".format(TimeIter).center(80,"*")) - else: - NbFSIIter = 1 - - self.FSIIter = 0 - FSIConv = False - - # --- Internal FSI loop --- # - while self.FSIIter <= (NbFSIIter-1): - - self.MPIPrint("\n>>>> Time iteration {} / FSI iteration {} <<<<".format(TimeIter,self.FSIIter)) - - # --- Mesh morphing step (displacements interpolation, displacements communication, and mesh morpher call) --- # - self.interpolateSolidPositionOnFluidMesh(FSI_config) - self.MPIPrint('\nPerforming dynamic mesh deformation (ALE)...\n') - self.setFluidInterfaceVarCoord(FluidSolver) - if myid in self.fluidSolverProcessors: - if self.FSIIter == 0: - FluidSolver.Preprocess(TimeIter) # set some parameters before temporal fluid iteration and dynamic mesh update - else: - FluidSolver.DynamicMeshUpdate(TimeIter) - # --- Fluid solver call for FSI subiteration --- # - self.MPIPrint('\nLaunching fluid solver for one single dual-time iteration...') - self.MPIBarrier() - if myid in self.fluidSolverProcessors: - FluidSolver.ResetConvergence() - FluidSolver.Run() - self.MPIBarrier() - FluidSolver.Postprocess() - self.MPIBarrier() - - # --- Surface fluid loads interpolation and communication --- # - if TimeIter > TimeIterTreshold: - if not self.ImposedMotion: - self.MPIPrint('\nProcessing interface fluid loads...\n') - self.MPIBarrier() - self.getFluidInterfaceNodalForce(FSI_config, FluidSolver) - self.MPIBarrier() - self.interpolateFluidLoadsOnSolidMesh(FSI_config) - self.setSolidInterfaceLoads(SolidSolver, FSI_config) - - # --- Solid solver call for FSI subiteration --- # - self.MPIPrint('\nLaunching solid solver for a single time iteration...\n') - if myid in self.solidSolverProcessors: - SolidSolver.run(time) - - # --- Compute and monitor the FSI residual --- # - varCoordNorm = self.computeSolidInterfaceResidual(SolidSolver) - self.MPIPrint('\nFSI displacement norm : {}\n'.format(varCoordNorm)) - if varCoordNorm < FSITolerance: - FSIConv = True - break - - # --- Relaxe the solid position --- # - self.MPIPrint('\nProcessing interface displacements...\n') - self.relaxSolidPosition(FSI_config) - - self.FSIIter += 1 - # --- End OF FSI loop --- # + # --- Internal FSI loop --- # + while self.FSIIter <= (NbFSIIter - 1): + + self.MPIPrint( + "\n>>>> Time iteration {} / FSI iteration {} <<<<".format( + TimeIter, self.FSIIter + ) + ) + # --- Mesh morphing step (displacements interpolation, displacements communication, and mesh morpher call) --- # + self.interpolateSolidPositionOnFluidMesh(FSI_config) + self.MPIPrint("\nPerforming dynamic mesh deformation (ALE)...\n") + self.setFluidInterfaceVarCoord(FluidSolver) + if myid in self.fluidSolverProcessors: + if self.FSIIter == 0: + FluidSolver.Preprocess( + TimeIter + ) # set some parameters before temporal fluid iteration and dynamic mesh update + else: + FluidSolver.DynamicMeshUpdate(TimeIter) + # --- Fluid solver call for FSI subiteration --- # + self.MPIPrint( + "\nLaunching fluid solver for one single dual-time iteration..." + ) self.MPIBarrier() + if myid in self.fluidSolverProcessors: + FluidSolver.Run() + self.MPIBarrier() + FluidSolver.Postprocess() + self.MPIBarrier() - # --- Update the FSI history file --- # + # --- Surface fluid loads interpolation and communication --- # if TimeIter > TimeIterTreshold: - self.MPIPrint('\nBGS is converged (strong coupling)') - self.writeFSIHistory(TimeIter, time, varCoordNorm, FSIConv) - - # --- Update, monitor and output the fluid solution before the next time step ---# - if myid in self.fluidSolverProcessors: - FluidSolver.Update() - FluidSolver.Monitor(TimeIter) - FluidSolver.Output(TimeIter) + if not self.ImposedMotion: + self.MPIPrint("\nProcessing interface fluid loads...\n") + self.MPIBarrier() + self.getFluidInterfaceNodalForce(FSI_config, FluidSolver) + self.MPIBarrier() + self.interpolateFluidLoadsOnSolidMesh(FSI_config) + self.setSolidInterfaceLoads(SolidSolver, FSI_config) + + # --- Solid solver call for FSI subiteration --- # + self.MPIPrint( + "\nLaunching solid solver for a single time iteration...\n" + ) + if myid in self.solidSolverProcessors: + SolidSolver.run(time) + + # --- Compute and monitor the FSI residual --- # + varCoordNorm = self.computeSolidInterfaceResidual(SolidSolver) + self.MPIPrint("\nFSI displacement norm : {}\n".format(varCoordNorm)) + if varCoordNorm < FSITolerance: + FSIConv = True + break + + # --- Relaxe the solid position --- # + self.MPIPrint("\nProcessing interface displacements...\n") + self.relaxSolidPosition(FSI_config) + + self.FSIIter += 1 + # --- End OF FSI loop --- # + + self.MPIBarrier() + + # --- Update the FSI history file --- # + if TimeIter > TimeIterTreshold: + self.MPIPrint("\nBGS is converged (strong coupling)") + self.writeFSIHistory(TimeIter, time, varCoordNorm, FSIConv) + + # --- Update, monitor and output the fluid solution before the next time step ---# + if myid in self.fluidSolverProcessors: + FluidSolver.Update() + FluidSolver.Monitor(TimeIter) + FluidSolver.Output(TimeIter) - if TimeIter >= TimeIterTreshold: - if myid in self.solidSolverProcessors: + if TimeIter >= TimeIterTreshold: + if myid in self.solidSolverProcessors: # --- Output the solid solution before thr next time step --- # SolidSolver.writeSolution(time, TimeIter, self.FSIIter) - if TimeIter > TimeIterTreshold: - # --- Displacement predictor for the next time step and update of the solid solution --- # - self.MPIPrint('\nSolid displacement prediction for next time step') - self.displacementPredictor(FSI_config, SolidSolver, deltaT) - if myid in self.solidSolverProcessors: + if TimeIter > TimeIterTreshold: + # --- Displacement predictor for the next time step and update of the solid solution --- # + self.MPIPrint("\nSolid displacement prediction for next time step") + self.displacementPredictor(FSI_config, SolidSolver, deltaT) + if myid in self.solidSolverProcessors: SolidSolver.updateSolution() - TimeIter += 1 - time += deltaT - #--- End of the temporal loop --- # + TimeIter += 1 + time += deltaT + # --- End of the temporal loop --- # - self.MPIBarrier() + self.MPIBarrier() - self.MPIPrint('\n*************************') - self.MPIPrint('* End FSI computation *') - self.MPIPrint('*************************\n') + self.MPIPrint("\n*************************") + self.MPIPrint("* End FSI computation *") + self.MPIPrint("*************************\n") - def SteadyFSI(self, FSI_config,FluidSolver, SolidSolver): - """ - Runs the steady FSI computation by synchronizing the fluid and solid solver with data exchange at the f/s interface. - """ + def SteadyFSI(self, FSI_config, FluidSolver, SolidSolver): + """ + Runs the steady FSI computation by synchronizing the fluid and solid solver with data exchange at the f/s interface. + """ - if self.have_MPI: + if self.have_MPI: myid = self.comm.Get_rank() numberPart = self.comm.Get_size() - else: + else: myid = 0 numberPart = 1 - # --- Set some general variables for the steady computation --- # - NbFSIIterMax = FSI_config['NB_FSI_ITER'] # maximum number of FSI iteration (for each time step) - FSITolerance = FSI_config['FSI_TOLERANCE'] # f/s interface tolerance - varCoordNorm = 0.0 - - self.MPIPrint('\n********************************') - self.MPIPrint('* Begin steady FSI computation *') - self.MPIPrint('********************************\n') - self.MPIPrint("\n") - self.MPIPrint(" Enter Block Gauss Seidel (BGS) method for strong coupling FSI ".center(80,"*")) - - self.MPIPrint('Setting initial deformed mesh') - if myid in self.solidSolverProcessors: - SolidSolver.setInitialDisplacements() - self.getSolidInterfaceDisplacement(SolidSolver) - self.interpolateSolidPositionOnFluidMesh(FSI_config) - self.setFluidInterfaceVarCoord(FluidSolver) - self.MPIPrint('\nFSI initial conditions are set') - - # --- External FSI loop --- # - self.FSIIter = 0 - while self.FSIIter < NbFSIIterMax: + # --- Set some general variables for the steady computation --- # + NbFSIIterMax = FSI_config[ + "NB_FSI_ITER" + ] # maximum number of FSI iteration (for each time step) + FSITolerance = FSI_config["FSI_TOLERANCE"] # f/s interface tolerance + varCoordNorm = 0.0 + + self.MPIPrint("\n********************************") + self.MPIPrint("* Begin steady FSI computation *") + self.MPIPrint("********************************\n") + self.MPIPrint("\n") + self.MPIPrint( + " Enter Block Gauss Seidel (BGS) method for strong coupling FSI ".center( + 80, "*" + ) + ) + + self.MPIPrint("Setting initial deformed mesh") + if myid in self.solidSolverProcessors: + SolidSolver.setInitialDisplacements() + self.getSolidInterfaceDisplacement(SolidSolver) + self.interpolateSolidPositionOnFluidMesh(FSI_config) + self.setFluidInterfaceVarCoord(FluidSolver) + self.MPIPrint("\nFSI initial conditions are set") + + # --- External FSI loop --- # + self.FSIIter = 0 + while self.FSIIter < NbFSIIterMax: self.MPIPrint("\n>>>> FSI iteration {} <<<<".format(self.FSIIter)) - self.MPIPrint('\nLaunching fluid solver for a steady computation...') + self.MPIPrint("\nLaunching fluid solver for a steady computation...") # --- Fluid solver call for FSI subiteration ---# if myid in self.fluidSolverProcessors: - FluidSolver.ResetConvergence() #This is setting to zero the convergence in the integrator, important to reset it. - # The mesh will be deformed in the context of the preprocessor, there is no need to set the initial - # mesh pushing back the solution to avoid spurious velocities, as the velocity is not computed at all - self.MPIPrint('\nPerforming static mesh deformation...\n') - FluidSolver.Preprocess(0)# This will attempt to always set the initial condition, but there is a flag on the unsteady computation that will avoid it - FluidSolver.Run() - FluidSolver.Postprocess() - FluidSolver.Monitor(0) #This is actually not needed, it only saves the fact that the fluid solver converged innerly or reached max iterations - FluidSolver.Output(0) + # The mesh will be deformed in the context of the preprocessor, there is no need to set the initial + # mesh pushing back the solution to avoid spurious velocities, as the velocity is not computed at all + self.MPIPrint("\nPerforming static mesh deformation...\n") + FluidSolver.Preprocess( + 0 + ) # This will attempt to always set the initial condition, but there is a flag on the unsteady computation that will avoid it + FluidSolver.Run() + FluidSolver.Postprocess() + FluidSolver.Monitor( + 0 + ) # This is actually not needed, it only saves the fact that the fluid solver converged innerly or reached max iterations + FluidSolver.Output(0) # --- Surface fluid loads interpolation and communication ---# if not self.ImposedMotion: - self.MPIPrint('\nProcessing interface fluid loads...\n') - self.MPIBarrier() - self.getFluidInterfaceNodalForce(FSI_config, FluidSolver) - self.MPIBarrier() - self.interpolateFluidLoadsOnSolidMesh(FSI_config) - self.setSolidInterfaceLoads(SolidSolver, FSI_config) - # --- Solid solver call for FSI subiteration --- # - self.MPIPrint('\nLaunching solid solver for a static computation...\n') - if myid in self.solidSolverProcessors: - SolidSolver.run(0.0) - SolidSolver.writeSolution(0.0, 0, self.FSIIter) + self.MPIPrint("\nProcessing interface fluid loads...\n") + self.MPIBarrier() + self.getFluidInterfaceNodalForce(FSI_config, FluidSolver) + self.MPIBarrier() + self.interpolateFluidLoadsOnSolidMesh(FSI_config) + self.setSolidInterfaceLoads(SolidSolver, FSI_config) + # --- Solid solver call for FSI subiteration --- # + self.MPIPrint("\nLaunching solid solver for a static computation...\n") + if myid in self.solidSolverProcessors: + SolidSolver.run(0.0) + SolidSolver.writeSolution(0.0, 0, self.FSIIter) # --- Compute and monitor the FSI residual --- # varCoordNorm = self.computeSolidInterfaceResidual(SolidSolver) - self.MPIPrint('\nFSI displacement norm : {}\n'.format(varCoordNorm)) + self.MPIPrint("\nFSI displacement norm : {}\n".format(varCoordNorm)) self.writeFSIHistory(0, 0.0, varCoordNorm, False) if varCoordNorm < FSITolerance: - break + break # --- Relaxe the solid displacement and update the solid solution --- # - self.MPIPrint('\nProcessing interface displacements...\n') + self.MPIPrint("\nProcessing interface displacements...\n") self.relaxSolidPosition(FSI_config) if myid in self.solidSolverProcessors: - SolidSolver.updateSolution() + SolidSolver.updateSolution() # --- Mesh morphing step (displacement interpolation, displacements communication, and mesh morpher call) --- # self.interpolateSolidPositionOnFluidMesh(FSI_config) self.setFluidInterfaceVarCoord(FluidSolver) self.FSIIter += 1 - self.MPIBarrier() + self.MPIBarrier() - self.MPIPrint('\nBGS is converged (strong coupling)') - self.MPIPrint(' ') - self.MPIPrint('*************************') - self.MPIPrint('* End FSI computation *') - self.MPIPrint('*************************') - self.MPIPrint(' ') + self.MPIPrint("\nBGS is converged (strong coupling)") + self.MPIPrint(" ") + self.MPIPrint("*************************") + self.MPIPrint("* End FSI computation *") + self.MPIPrint("*************************") + self.MPIPrint(" ") def MapModes(self, FSI_config, FluidSolver, SolidSolver): - """ - Runs nothing, just extract the structural modes mapped on the fluid mesh - """ - - if self.have_MPI: - myid = self.comm.Get_rank() - numberPart = self.comm.Get_size() - else: - myid = 0 - numberPart = 1 - - nodeNormals = {} - for iVertex in range(self.nLocalFluidInterfaceNodes): - nx, ny, nz = FluidSolver.GetVertexNormal(self.fluidInterfaceIdentifier, iVertex, False) - GlobalIndex = FluidSolver.GetVertexGlobalIndex(self.fluidInterfaceIdentifier, iVertex) - nodeNormals[GlobalIndex] = [nx, ny, nz] - - nodeNormals = self.comm.gather(nodeNormals, root=self.rootProcess) - if myid == self.rootProcess: - normalsToPrint = {} - for iDictionary in range(numberPart): - for key, value in nodeNormals[iDictionary].items(): - normalsToPrint[key] = value - normalsToPrint = dict(sorted(normalsToPrint.items())) - with open('Normals.csv', 'w') as f: - writer = csv.writer(f) - for key, value in normalsToPrint.items(): - writer.writerow([key, value]) - - - SurfaceFileName = FluidSolver.GetSurfaceFileName() - - self.MPIPrint('\n********************************') - self.MPIPrint('* Begin mapping the modes *') - self.MPIPrint('********************************\n') - self.MPIPrint("\n") - - if myid == self.rootProcess: # The root process contains the solid solver for sure - modesNumber = np.array(int(SolidSolver.getNumberOfModes())) - else: - modesNumber = np.empty(1, dtype=np.int) - - self.comm.Bcast(modesNumber, root=self.rootProcess) - - for mode in range(np.asscalar(modesNumber)): - self.MPIPrint("Setting mode {} active".format(mode)) - if myid in self.solidSolverProcessors: - SolidSolver.activateMode(mode) - self.MPIBarrier() - self.getSolidInterfaceDisplacement(SolidSolver) - self.interpolateSolidPositionOnFluidMesh(FSI_config) - self.setFluidInterfaceVarCoord(FluidSolver) + """ + Runs nothing, just extract the structural modes mapped on the fluid mesh + """ - self.MPIPrint('\nPerforming mesh deformation...\n') - FluidSolver.DynamicMeshUpdate(0) - FluidSolver.Output(0) - self.MPIBarrier() + if self.have_MPI: + myid = self.comm.Get_rank() + numberPart = self.comm.Get_size() + else: + myid = 0 + numberPart = 1 + nodeNormals = {} + for iVertex in range(self.nLocalFluidInterfaceNodes): + if self.nDim == 2: + nx, ny = FluidSolver.GetMarkerVertexNormals( + self.fluidInterfaceIdentifier, iVertex, False + ) + nz = 0 + else: + nx, ny, nz = FluidSolver.GetMarkerVertexNormals( + self.fluidInterfaceIdentifier, iVertex, False + ) + GlobalIndex = FluidSolver.GetNodeGlobalIndex( + FluidSolver.GetMarkerNode(self.fluidInterfaceIdentifier, iVertex) + ) + nodeNormals[GlobalIndex] = [nx, ny, nz] + + nodeNormals = self.comm.gather(nodeNormals, root=self.rootProcess) if myid == self.rootProcess: - AllFiles = os.listdir() - for FileNumber,FileName in enumerate(AllFiles): - if SurfaceFileName in FileName: - file = FileName.split(".")[0] - extension = FileName.split(".")[1] - os.rename(file+"."+extension,"Mode{}.".format(mode)+extension) - - self.MPIPrint('\n*************************') - self.MPIPrint('* Mapping completed *') - self.MPIPrint('*************************\n') + normalsToPrint = {} + for iDictionary in range(numberPart): + for key, value in nodeNormals[iDictionary].items(): + normalsToPrint[key] = value + normalsToPrint = dict(sorted(normalsToPrint.items())) + with open("Normals.csv", "w") as f: + writer = csv.writer(f) + for key, value in normalsToPrint.items(): + writer.writerow([key, value]) + + SurfaceFileName = FluidSolver.GetSurfaceFileName() + + self.MPIPrint("\n********************************") + self.MPIPrint("* Begin mapping the modes *") + self.MPIPrint("********************************\n") + self.MPIPrint("\n") + + if ( + myid == self.rootProcess + ): # The root process contains the solid solver for sure + modesNumber = np.array(int(SolidSolver.getNumberOfModes())) + else: + modesNumber = np.empty(1, dtype=np.int) + + self.comm.Bcast(modesNumber, root=self.rootProcess) + + for mode in range(np.asscalar(modesNumber)): + self.MPIPrint("Setting mode {} active".format(mode)) + if myid in self.solidSolverProcessors: + SolidSolver.activateMode(mode) + self.MPIBarrier() + self.getSolidInterfaceDisplacement(SolidSolver) + self.interpolateSolidPositionOnFluidMesh(FSI_config) + self.setFluidInterfaceVarCoord(FluidSolver) + + self.MPIPrint("\nPerforming mesh deformation...\n") + FluidSolver.DynamicMeshUpdate(0) + FluidSolver.Output(0) + self.MPIBarrier() + + if myid == self.rootProcess: + AllFiles = os.listdir() + for FileNumber, FileName in enumerate(AllFiles): + if SurfaceFileName in FileName: + file = FileName.split(".")[0] + extension = FileName.split(".")[1] + os.rename( + file + "." + extension, "Mode{}.".format(mode) + extension + ) + + self.MPIPrint("\n*************************") + self.MPIPrint("* Mapping completed *") + self.MPIPrint("*************************\n") diff --git a/SU2_PY/FSI_tools/FSI_config.py b/SU2_PY/FSI_tools/FSI_config.py index 2def017c750..12828d7721a 100644 --- a/SU2_PY/FSI_tools/FSI_config.py +++ b/SU2_PY/FSI_tools/FSI_config.py @@ -3,7 +3,7 @@ ## \file FSI_config.py # \brief Python class for handling configuration file for FSI computation. # \authors Nicola Fonzi, Vittorio Cavalieri based on the work of David Thomas -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -38,13 +38,14 @@ # FSI Configuration Class # ---------------------------------------------------------------------- + class FSIConfig: """ Class that contains all the parameters coming from the FSI configuration file. Read the file and store all the options into a dictionary. """ - def __init__(self,FileName,comm): + def __init__(self, FileName, comm): self.ConfigFileName = FileName self.comm = comm self._ConfigContent = {} @@ -54,10 +55,10 @@ def __init__(self,FileName,comm): def __str__(self): tempString = str() for key, value in self._ConfigContent.items(): - tempString += "{} = {}\n".format(key,value) + tempString += "{} = {}\n".format(key, value) return tempString - def __getitem__(self,key): + def __getitem__(self, key): return self._ConfigContent[key] def __setitem__(self, key, value): @@ -70,67 +71,91 @@ def readConfig(self): if not line: break # remove line returns - line = line.strip('\r\n') + line = line.strip("\r\n") # make sure it has useful data - if (not "=" in line) or (line[0] == '%'): + if (not "=" in line) or (line[0] == "%"): continue # split across equal sign - line = line.split("=",1) + line = line.split("=", 1) this_param = line[0].strip() this_value = line[1].strip() - #integer values - if (this_param == "NDIM") or \ - (this_param == "RESTART_ITER") or \ - (this_param == "TIME_TRESHOLD") or \ - (this_param == "NB_FSI_ITER") : + # integer values + if ( + (this_param == "NDIM") + or (this_param == "RESTART_ITER") + or (this_param == "TIME_TRESHOLD") + or (this_param == "NB_FSI_ITER") + ): self._ConfigContent[this_param] = int(this_value) - #float values - elif (this_param == "RBF_RADIUS") or \ - (this_param == "AITKEN_PARAM") or \ - (this_param == "UNST_TIMESTEP") or \ - (this_param == "UNST_TIME") or \ - (this_param == "FSI_TOLERANCE") : + # float values + elif ( + (this_param == "RBF_RADIUS") + or (this_param == "AITKEN_PARAM") + or (this_param == "UNST_TIMESTEP") + or (this_param == "UNST_TIME") + or (this_param == "FSI_TOLERANCE") + ): self._ConfigContent[this_param] = float(this_value) - #string values - elif (this_param == "CFD_CONFIG_FILE_NAME") or \ - (this_param == "CSD_SOLVER") or \ - (this_param == "CSD_CONFIG_FILE_NAME") or \ - (this_param == "RESTART_SOL") or \ - (this_param == "MATCHING_MESH") or \ - (this_param == "MESH_INTERP_METHOD") or \ - (this_param == "DISP_PRED") or \ - (this_param == "AITKEN_RELAX") or \ - (this_param == "TIME_MARCHING") or \ - (this_param == "IMPOSED_MOTION") or \ - (this_param == "MAPPING_MODES"): + # string values + elif ( + (this_param == "CFD_CONFIG_FILE_NAME") + or (this_param == "CSD_SOLVER") + or (this_param == "CSD_CONFIG_FILE_NAME") + or (this_param == "RESTART_SOL") + or (this_param == "MATCHING_MESH") + or (this_param == "MESH_INTERP_METHOD") + or (this_param == "DISP_PRED") + or (this_param == "AITKEN_RELAX") + or (this_param == "TIME_MARCHING") + or (this_param == "IMPOSED_MOTION") + or (this_param == "MAPPING_MODES") + ): self._ConfigContent[this_param] = this_value - else : - self.MPIPrint(this_param + " is an invalid option !",False) + else: + self.MPIPrint(this_param + " is an invalid option !", False) def applyDefaults(self): if "MAPPING_MODES" not in self._ConfigContent: self._ConfigContent["MAPPING_MODES"] = "NO" - self.MPIPrint("MAPPING_MODES keyword was not found in the configuration file of the interface, setting to NO",False) + self.MPIPrint( + "MAPPING_MODES keyword was not found in the configuration file of the interface, setting to NO", + False, + ) if "IMPOSED_MOTION" not in self._ConfigContent: self._ConfigContent["IMPOSED_MOTION"] = "NO" - self.MPIPrint("IMPOSED_MOTION keyword was not found in the configuration file of the interface, setting to NO",False) + self.MPIPrint( + "IMPOSED_MOTION keyword was not found in the configuration file of the interface, setting to NO", + False, + ) if self._ConfigContent["IMPOSED_MOTION"] == "YES": - if self._ConfigContent["AITKEN_RELAX"] != "STATIC" or self._ConfigContent["AITKEN_PARAM"] != 1.0: - self.MPIPrint("When imposing motion, the Aitken parameter must be static and equal to 1",True) + if ( + self._ConfigContent["AITKEN_RELAX"] != "STATIC" + or self._ConfigContent["AITKEN_PARAM"] != 1.0 + ): + self.MPIPrint( + "When imposing motion, the Aitken parameter must be static and equal to 1", + True, + ) if self._ConfigContent["RESTART_SOL"] == "YES": if self._ConfigContent["TIME_TRESHOLD"] != -1: - self.MPIPrint("When restarting a simulation, the time threshold must be -1 for immediate coupling",True) - - if self._ConfigContent["MAPPING_MODES"] == "YES" and self._ConfigContent["CSD_SOLVER"]!="NATIVE": - self.MPIPrint("Mapping modes only works with the native solver",True) + self.MPIPrint( + "When restarting a simulation, the time threshold must be -1 for immediate coupling", + True, + ) + + if ( + self._ConfigContent["MAPPING_MODES"] == "YES" + and self._ConfigContent["CSD_SOLVER"] != "NATIVE" + ): + self.MPIPrint("Mapping modes only works with the native solver", True) def MPIPrint(self, message, error): """ diff --git a/SU2_PY/Makefile.am b/SU2_PY/Makefile.am deleted file mode 100644 index 82985bf4202..00000000000 --- a/SU2_PY/Makefile.am +++ /dev/null @@ -1,89 +0,0 @@ -################################################################################ -# -# \file Makefile.am -# \brief Makefile for the SU2 Python framework -# \author M. Colonno, T. Economon, F. Palacios, T. Lukaczyk -# \version 7.5.1 "Blackbird" -# -# SU2 Project Website: https://su2code.github.io -# -# The SU2 Project is maintained by the SU2 Foundation -# (http://su2foundation.org) -# -# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) -# -# SU2 is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# SU2 is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with SU2. If not, see . -# -################################################################################ - -bin_SCRIPTS = \ - continuous_adjoint.py \ - compute_uncertainty.py \ - finite_differences.py \ - mesh_deformation.py \ - parallel_computation.py \ - parallel_computation_fsi.py \ - package_tests.py \ - shape_optimization.py \ - merge_solution.py \ - set_ffd_design_var.py \ - compute_polar.py \ - compute_multipoint.py \ - discrete_adjoint.py \ - direct_differentiation.py \ - fsi_computation.py \ - SU2_CFD.py - - -mypkgdir = $(prefix)/bin -nobase_dist_mypkg_DATA= \ - SU2/__init__.py \ - SU2/eval/design.py \ - SU2/eval/functions.py \ - SU2/eval/gradients.py \ - SU2/eval/__init__.py \ - SU2/io/config.py \ - SU2/io/config_options.py \ - SU2/io/data.py \ - SU2/io/filelock.py \ - SU2/io/redirect.py \ - SU2/io/state.py \ - SU2/io/tools.py \ - SU2/io/historyMap.py \ - SU2/io/__init__.py \ - SU2/opt/project.py \ - SU2/opt/scipy_tools.py \ - SU2/opt/__init__.py \ - SU2/run/adjoint.py \ - SU2/run/deform.py \ - SU2/run/direct.py \ - SU2/run/interface.py \ - SU2/run/merge.py \ - SU2/run/geometry.py \ - SU2/run/projection.py \ - SU2/run/__init__.py \ - SU2/util/bunch.py \ - SU2/util/filter_adjoint.py \ - SU2/util/lhc_unif.py \ - SU2/util/misc.py \ - SU2/util/mp_eval.py \ - SU2/util/ordered_bunch.py \ - SU2/util/ordered_dict.py \ - SU2/util/plot.py \ - SU2/util/polarSweepLib.py \ - SU2/util/switch.py \ - SU2/util/which.py \ - SU2/util/__init__.py - -EXTRA_DIST = $(bin_SCRIPTS) diff --git a/SU2_PY/OptimalPropeller.py b/SU2_PY/OptimalPropeller.py index ef22e7db419..fff4202c644 100644 --- a/SU2_PY/OptimalPropeller.py +++ b/SU2_PY/OptimalPropeller.py @@ -1,7 +1,7 @@ ## \file OptimalPropeller.py # \brief Python script for generating the ActuatorDisk.dat file. # \author E. Saetta, L. Russo, R. Tognaccini -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -48,83 +48,90 @@ ### Functions ### ########################## -def a_distribution (w0, Chi): + +def a_distribution(w0, Chi): """Function used to compute the value of the axial interference factor using the inviscid theory of the optimal propeller.""" - return (w0*pow(Chi,2))/(pow(Chi,2)+pow((1+(w0)),2)) + return (w0 * pow(Chi, 2)) / (pow(Chi, 2) + pow((1 + (w0)), 2)) def write_su2_config_file(): """Write the actuator disk configuration file""" - with open('ActuatorDisk.cfg', 'w') as f: - f.write('% Automatic generated actuator disk configuration file.\n') - f.write('%\n') - f.write('% The first two elements of MARKER_ACTDISK must be filled.\n') - f.write('% An example of this file can be found in the TestCases directory.\n') - f.write('%\n') - f.write('% Author: Ettore Saetta, Lorenzo Russo, Renato Tognaccini.\n') - f.write('% Theoretical and Applied Aerodynamic Research Group (TAARG),\n') - f.write('% University of Naples Federico II\n') - f.write('\n') - f.write('ACTDISK_TYPE = VARIABLE_LOAD\n') - f.write('ACTDISK_FILENAME = ActuatorDisk.dat\n') - f.write('MARKER_ACTDISK = ( , , 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)\n') + with open("ActuatorDisk.cfg", "w") as f: + f.write("% Automatic generated actuator disk configuration file.\n") + f.write("%\n") + f.write("% The first two elements of MARKER_ACTDISK must be filled.\n") + f.write("% An example of this file can be found in the TestCases directory.\n") + f.write("%\n") + f.write("% Author: Ettore Saetta, Lorenzo Russo, Renato Tognaccini.\n") + f.write("% Theoretical and Applied Aerodynamic Research Group (TAARG),\n") + f.write("% University of Naples Federico II\n") + f.write("\n") + f.write("ACTDISK_TYPE = VARIABLE_LOAD\n") + f.write("ACTDISK_FILENAME = ActuatorDisk.dat\n") + f.write("MARKER_ACTDISK = ( , , 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)\n") - print('SU2 file generated!') + print("SU2 file generated!") def write_external_file(CTrs, CPrs): """Function to write the actuator disk input data file""" - with open('ActuatorDisk.dat', 'w') as f: - f.write('# Automatic generated actuator disk input data file using the Optimal Propeller code.\n') - f.write('# Data file needed for the actuator disk VARIABLE_LOAD type.\n') - f.write('# The load distribution is obtained using the inviscid theory of the optimal propeller\n') - f.write('# using global data.\n') - f.write('#\n') - f.write('# The first three lines must be filled.\n') - f.write('# An example of this file can be found in the TestCases directory.\n') - f.write('#\n') - f.write('# Author: Ettore Saetta, Lorenzo Russo, Renato Tognaccini.\n') - f.write('# Theoretical and Applied Aerodynamic Research Group (TAARG),\n') - f.write('# University of Naples Federico II\n') - f.write('# -------------------------------------------------------------------------------------\n') - f.write('#\n') - f.write('MARKER_ACTDISK= \n') - f.write('CENTER= \n') - f.write('AXIS= \n') - f.write('RADIUS= '+str(R)+'\n') - f.write('ADV_RATIO= '+str(J)+'\n') - f.write('NROW= '+str(stations)+'\n') - f.write('# rs=r/R dCT/drs dCP/drs dCR/drs\n') + with open("ActuatorDisk.dat", "w") as f: + f.write( + "# Automatic generated actuator disk input data file using the Optimal Propeller code.\n" + ) + f.write("# Data file needed for the actuator disk VARIABLE_LOAD type.\n") + f.write( + "# The load distribution is obtained using the inviscid theory of the optimal propeller\n" + ) + f.write("# using global data.\n") + f.write("#\n") + f.write("# The first three lines must be filled.\n") + f.write("# An example of this file can be found in the TestCases directory.\n") + f.write("#\n") + f.write("# Author: Ettore Saetta, Lorenzo Russo, Renato Tognaccini.\n") + f.write("# Theoretical and Applied Aerodynamic Research Group (TAARG),\n") + f.write("# University of Naples Federico II\n") + f.write( + "# -------------------------------------------------------------------------------------\n" + ) + f.write("#\n") + f.write("MARKER_ACTDISK= \n") + f.write("CENTER= \n") + f.write("AXIS= \n") + f.write("RADIUS= " + str(R) + "\n") + f.write("ADV_RATIO= " + str(J) + "\n") + f.write("NROW= " + str(stations) + "\n") + f.write("# rs=r/R dCT/drs dCP/drs dCR/drs\n") for i in range(0, stations): - f.write(f' {r[i]:.7f} {CTrs[i]:.7f} {CPrs[i]:.7f} 0.0\n') + f.write(f" {r[i]:.7f} {CTrs[i]:.7f} {CPrs[i]:.7f} 0.0\n") ########################## ### Main ### ########################## -print('------------------ Optimal Propeller vsn 7.0.6 ------------------') -print('| Computation of the optimal dCT/dr and dCP/dr distributions. |') -print('| Based on the inviscid theory of the optimal propeller. |') -print('| |') -print('| This code is used to generate the actuator disk input data |') -print('| file needed for the VARIABLE_LOAD actuator disk type |') -print('| implemented in SU2 7.0.6. |') -print('| |') -print('| Author: Ettore Saetta, Lorenzo Russo, Renato Tognaccini. |') -print('| Theoretical and Applied Aerodynamic Research Group (TAARG), |') -print('| University of Naples Federico II. |') -print('-----------------------------------------------------------------') -print('') -print('Warning: present version requires input in SI units.') -print('') +print("------------------ Optimal Propeller vsn 7.0.6 ------------------") +print("| Computation of the optimal dCT/dr and dCP/dr distributions. |") +print("| Based on the inviscid theory of the optimal propeller. |") +print("| |") +print("| This code is used to generate the actuator disk input data |") +print("| file needed for the VARIABLE_LOAD actuator disk type |") +print("| implemented in SU2 7.0.6. |") +print("| |") +print("| Author: Ettore Saetta, Lorenzo Russo, Renato Tognaccini. |") +print("| Theoretical and Applied Aerodynamic Research Group (TAARG), |") +print("| University of Naples Federico II. |") +print("-----------------------------------------------------------------") +print("") +print("Warning: present version requires input in SI units.") +print("") # Number of radial stations in input. -stations = int(input('Number of radial stations: ')) +stations = int(input("Number of radial stations: ")) # Resize the vectors using the number of radial stations. r = np.empty(stations) @@ -136,26 +143,26 @@ def write_external_file(CTrs, CPrs): ap_optimal = np.empty(stations) # Thrust coefficient in input. -Ct = float(input('\nCT (Renard definition): ')) +Ct = float(input("\nCT (Renard definition): ")) # Propeller radius in input. -R = float(input('\nR (propeller radius [m]): ')) +R = float(input("\nR (propeller radius [m]): ")) # Hub radius in input. -rhub = float(input('\nr_hub (hub radius [m]): ')) +rhub = float(input("\nr_hub (hub radius [m]): ")) # Advance ratio in input. -J = float(input('\nJ (advance ratio): ')) +J = float(input("\nJ (advance ratio): ")) # Freestream velocity in input. -Vinf = float(input('\nVinf (m/s): ')) +Vinf = float(input("\nVinf (m/s): ")) # Asking if the tip loss Prandtl correction function needs to be used. -prandtl_input = input('\nUsing tip loss Prandtl correction? (/n): ') +prandtl_input = input("\nUsing tip loss Prandtl correction? (/n): ") -if prandtl_input.lower() in ['yes', 'y', '']: +if prandtl_input.lower() in ["yes", "y", ""]: # Number of propeller blades in input. - N = int(input('\nN (number of propeller blades): ')) + N = int(input("\nN (number of propeller blades): ")) prandtl_correction = True else: prandtl_correction = False @@ -164,47 +171,54 @@ def write_external_file(CTrs, CPrs): rs_hub = rhub / R # Computation of the non-dimensional radial stations. -for i in range(1, stations+1): - r[i-1] = i / float(stations) - if r[i-1] <= rs_hub: +for i in range(1, stations + 1): + r[i - 1] = i / float(stations) + if r[i - 1] <= rs_hub: i_hub = i - 1 # Computation of the propeller diameter. D = 2 * R # Computation of the propeller angular velocity (Rounds/s). -n = Vinf / (D*J) +n = Vinf / (D * J) # Computation of the propeller angular velocity (Rad/s). Omega = n * 2 * math.pi # Computation of the tip loss Prandtl correction function F. if prandtl_correction: - F = (2/math.pi)*np.arccos(np.exp(-0.5*N*(1-r)*np.sqrt(1+pow(Omega*R/Vinf,2)))) + F = (2 / math.pi) * np.arccos( + np.exp(-0.5 * N * (1 - r) * np.sqrt(1 + pow(Omega * R / Vinf, 2))) + ) else: F = np.ones((stations)) # Computation of the non-dimensional radius chi=Omega*r/Vinf. -chi = Omega*r*R/Vinf +chi = Omega * r * R / Vinf -eps = 5E-20 +eps = 5e-20 # Computation of the propeller radial stations spacing. -h = (1.0/stations) +h = 1.0 / stations # Computation of the first try induced velocity distribution. -w = (2/np.power(Vinf,2))*((-1/Vinf)+np.sqrt(1+((np.power(D,4)*(Ct)*np.power(n,2))/(np.power(Vinf,2)*np.pi*r)))) +w = (2 / np.power(Vinf, 2)) * ( + (-1 / Vinf) + + np.sqrt( + 1 + ((np.power(D, 4) * (Ct) * np.power(n, 2)) / (np.power(Vinf, 2) * np.pi * r)) + ) +) # Computation of the first try Lagrange moltiplicator. -w_0 = sum(w)/(Vinf*stations) +w_0 = sum(w) / (Vinf * stations) # Computation of the first try axial interference factor distribution. for i in range(0, stations): - a_0[i] = a_distribution(w_0*F[i],chi[i]) + a_0[i] = a_distribution(w_0 * F[i], chi[i]) # Computation of the thrust coefficient distribution -dCt_0 = math.pi*J**2*r*(1+a_0)*a_0 +dCt_0 = math.pi * J**2 * r * (1 + a_0) * a_0 # Computation of the total thrust coefficient. -Ct_0 = sum(h*dCt_0[i_hub:]) +Ct_0 = sum(h * dCt_0[i_hub:]) # Compute the error with respect to the thrust coefficient given in input. err_0 = Ct_0 - Ct @@ -216,13 +230,13 @@ def write_external_file(CTrs, CPrs): # Computation of the second try axial interference factor distribution. for i in range(0, stations): - a_old[i] = a_distribution(w_old*F[i],chi[i]) + a_old[i] = a_distribution(w_old * F[i], chi[i]) # Computation of the thrust coefficient distribution -dCt_old = math.pi*J**2*r*(1+a_old)*a_old +dCt_old = math.pi * J**2 * r * (1 + a_old) * a_old # Computation of the total thrust coefficient. -Ct_old = sum(h*dCt_old[i_hub:]) +Ct_old = sum(h * dCt_old[i_hub:]) # Compute the error with respect to the thrust coefficient given in input. err_old = Ct_old - Ct @@ -239,17 +253,17 @@ def write_external_file(CTrs, CPrs): iteration += 1 # Computation of the new Lagrange moltiplicator value based on the false position method. - w_new = (w_old*err_0 - w_0*err_old)/(err_0 - err_old) + w_new = (w_old * err_0 - w_0 * err_old) / (err_0 - err_old) # Computation of the new axial interference factor distribution. for i in range(0, stations): - a_new[i] = a_distribution(w_new*F[i],chi[i]) + a_new[i] = a_distribution(w_new * F[i], chi[i]) # Computation of the new thrust coefficient distribution. - dCt_new = math.pi*J**2*r*(1+a_new)*a_new + dCt_new = math.pi * J**2 * r * (1 + a_new) * a_new # Computation of the new total thrust coefficient. - Ct_new = sum(h*dCt_new[i_hub:]) + Ct_new = sum(h * dCt_new[i_hub:]) # Computation of the total thrust coefficient error with respect to the input value. err_new = Ct_new - Ct @@ -264,46 +278,55 @@ def write_external_file(CTrs, CPrs): # Computation of the correct axial and rotational interference factors (a and ap). for i in range(0, stations): - a_optimal[i] = a_distribution(w_new*F[i],chi[i]) - ap_optimal[i] = (w_new*F[i])*((1+w_new*F[i])/(chi[i]*chi[i]+math.pow(1+w_new*F[i],2))) + a_optimal[i] = a_distribution(w_new * F[i], chi[i]) + ap_optimal[i] = (w_new * F[i]) * ( + (1 + w_new * F[i]) / (chi[i] * chi[i] + math.pow(1 + w_new * F[i], 2)) + ) # Computation of the correct thrust coefficient distribution. -dCt_optimal = math.pi*J**2*r*(1+a_optimal)*a_optimal +dCt_optimal = math.pi * J**2 * r * (1 + a_optimal) * a_optimal # Computation of the correct power coefficient distribution. for i in range(0, stations): - dCp[i] = (R*4*math.pi/(math.pow(n,3)*math.pow(D,5)))*(math.pow(Vinf,3)*math.pow(1+a_optimal[i],2)*a_optimal[i]*r[i]*R+math.pow(Omega,2)*Vinf*(1+a_optimal[i])*math.pow(ap_optimal[i],2)*math.pow(r[i]*R,3)) + dCp[i] = (R * 4 * math.pi / (math.pow(n, 3) * math.pow(D, 5))) * ( + math.pow(Vinf, 3) * math.pow(1 + a_optimal[i], 2) * a_optimal[i] * r[i] * R + + math.pow(Omega, 2) + * Vinf + * (1 + a_optimal[i]) + * math.pow(ap_optimal[i], 2) + * math.pow(r[i] * R, 3) + ) ########################## ### Check Results ### ########################## # Computation of the total power coefficient. -Cp = sum(h*dCp[i_hub:]) +Cp = sum(h * dCp[i_hub:]) # Computation of the total thrust coefficient. -Ct_optimal = sum(h*dCt_optimal[i_hub:]) +Ct_optimal = sum(h * dCt_optimal[i_hub:]) # Computation of the static pressure jump distribution. -DeltaP = dCt_optimal*(2*Vinf**2)/(J**2*math.pi*r) +DeltaP = dCt_optimal * (2 * Vinf**2) / (J**2 * math.pi * r) # Computation of the thrust over density (T) using the static pressure jump distribution. -T = sum(2*math.pi*r[i_hub:]*math.pow(R,2)*h*DeltaP[i_hub:]) +T = sum(2 * math.pi * r[i_hub:] * math.pow(R, 2) * h * DeltaP[i_hub:]) # Computation of the thrust coefficient using T. -Ct_Renard = T / (math.pow(n,2)*math.pow(D,4)) +Ct_Renard = T / (math.pow(n, 2) * math.pow(D, 4)) # Computation of the efficiency. -eta = J * (Ct_optimal/Cp) +eta = J * (Ct_optimal / Cp) # Screen output used to check that everything worked correcty. -print('%%%%%%%%%%%%%%%%%%%%%%%%% CHECK OUTPUT VALUES %%%%%%%%%%%%%%%%%%%%%%%%%') -print(f' dCT distribution integral: {Ct_optimal:.4f}') -print(f' dCT computed using the static pressure jump: {Ct_Renard:.4f}') -print(f' dCP distribution integral: {Cp:.4f}') -print(f' Thrust over Density (T/rho): {T:.4f} [N*m^3/kg]') -print(f' Efficiency eta: {eta:.4f}') -print(f' w0/Vinf: {w_new:.4f}') -print('%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%') +print("%%%%%%%%%%%%%%%%%%%%%%%%% CHECK OUTPUT VALUES %%%%%%%%%%%%%%%%%%%%%%%%%") +print(f" dCT distribution integral: {Ct_optimal:.4f}") +print(f" dCT computed using the static pressure jump: {Ct_Renard:.4f}") +print(f" dCP distribution integral: {Cp:.4f}") +print(f" Thrust over Density (T/rho): {T:.4f} [N*m^3/kg]") +print(f" Efficiency eta: {eta:.4f}") +print(f" w0/Vinf: {w_new:.4f}") +print("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%") ########################## ### File Writing ### @@ -321,29 +344,29 @@ def write_external_file(CTrs, CPrs): # Automatically plot the computed propeller performance. pl.figure(1) -pl.plot(r, dCt_optimal, 'r', markersize=4, label='$\\frac{dCT}{d\overline{r}}$') -pl.plot(r, dCp, 'k', markersize=4, label='$\\frac{dCP}{d\overline{r}}$') +pl.plot(r, dCt_optimal, "r", markersize=4, label="$\\frac{dCT}{d\overline{r}}$") +pl.plot(r, dCp, "k", markersize=4, label="$\\frac{dCP}{d\overline{r}}$") pl.grid(True) pl.legend(numpoints=3) -pl.xlabel('$\overline{r}$') -pl.ylabel('') +pl.xlabel("$\overline{r}$") +pl.ylabel("") pl.title("Load Distribution") pl.figure(2) -pl.plot(chi, a_optimal, 'r', markersize=4, label='$a$') -pl.plot(chi, ap_optimal, 'k', markersize=4, label='$a^1$') +pl.plot(chi, a_optimal, "r", markersize=4, label="$a$") +pl.plot(chi, ap_optimal, "k", markersize=4, label="$a^1$") pl.grid(True) pl.legend(numpoints=3) -pl.xlabel('$\chi$') -pl.ylabel('') +pl.xlabel("$\chi$") +pl.ylabel("") pl.title("Interference Factors") if prandtl_correction: pl.figure(3) - pl.plot(r, F, 'k', markersize=4) + pl.plot(r, F, "k", markersize=4) pl.grid(True) - pl.xlabel('$\overline{r}$') - pl.ylabel('$F(\overline{r})$') + pl.xlabel("$\overline{r}$") + pl.ylabel("$F(\overline{r})$") pl.title("Tip Loss Prandtl Correction Function") pl.show() diff --git a/SU2_PY/SU2/__init__.py b/SU2_PY/SU2/__init__.py index 5bff3570f40..bfb81241707 100644 --- a/SU2_PY/SU2/__init__.py +++ b/SU2_PY/SU2/__init__.py @@ -1,7 +1,10 @@ # SU2/__init__.py + class EvaluationFailure(RuntimeError): pass + + class DivergenceFailure(EvaluationFailure): pass @@ -20,13 +23,10 @@ class DivergenceFailure(EvaluationFailure): try: import readline import rlcompleter - if readline.__doc__ and 'libedit' in readline.__doc__: + + if readline.__doc__ and "libedit" in readline.__doc__: readline.parse_and_bind("bind ^I rl_complete") else: readline.parse_and_bind("tab: complete") except: pass - - - - diff --git a/SU2_PY/SU2/eval/__init__.py b/SU2_PY/SU2/eval/__init__.py index 58cba7dfb55..5e718795af8 100644 --- a/SU2_PY/SU2/eval/__init__.py +++ b/SU2_PY/SU2/eval/__init__.py @@ -1,10 +1,15 @@ - from SU2.eval.functions import function as func from SU2.eval.functions import aerodynamics, geometry from SU2.eval.gradients import gradient as grad from SU2.eval.gradients import adjoint, findiff -from SU2.eval.design import (Design, - obj_f, obj_df, - con_ceq, con_dceq, - con_cieq, con_dcieq, - touch, skip) \ No newline at end of file +from SU2.eval.design import ( + Design, + obj_f, + obj_df, + con_ceq, + con_dceq, + con_cieq, + con_dcieq, + touch, + skip, +) diff --git a/SU2_PY/SU2/eval/design.py b/SU2_PY/SU2/eval/design.py index 82768dcd42f..fb7d61b4ad2 100644 --- a/SU2_PY/SU2/eval/design.py +++ b/SU2_PY/SU2/eval/design.py @@ -3,7 +3,7 @@ ## \file design.py # \brief python package for designs # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -30,9 +30,9 @@ # ---------------------------------------------------------------------- import os, copy -from .. import io as su2io -from . import func as su2func -from . import grad as su2grad +from .. import io as su2io +from . import func as su2func +from . import grad as su2grad from ..io import redirect_folder, save_data # todo: @@ -43,166 +43,171 @@ # Design Class # ---------------------------------------------------------------------- + class Design(object): - """ SU2.eval.Design(config,state=None,folder='DESIGNS/DSN_*') - - Starts a design class, which manages a config and state. - Will run design in folder, and with self indexing name if '*' is - included in the folder name. - Methods are wrappers for SU2.eval.func() and SU2.eval.grad() - - Attributes: - state - design state - config - design config - files - design files - folder - design folder - funcs - design function value bunch - grads - design gradient values bunch - - Methods: - Optimizer Interface - The following methods take a design vector for input - as a list (shape n) or numpy array (shape n or nx1 or 1xn). - Values are returned as floats or lists or lists of lists. - See SU2.eval.obj_f, etc for more detail. - - obj_f(dvs) - objective function : float - obj_df(dvs) - objective function derivatives : list - con_ceq(dvs) - equality constraints : list - con_dceq(dvs) - equality constraint derivatives : list[list] - con_cieq(dvs) - inequality constraints : list - con_dcieq(dvs) - inequality constraint gradients : list[list] - - Functional Interface - The following methods take an objective function name for input. - func(func_name) - function of specified name - grad(func_name,method='CONTINUOUS_ADJOINT') - gradient of specified name + """SU2.eval.Design(config,state=None,folder='DESIGNS/DSN_*') + + Starts a design class, which manages a config and state. + Will run design in folder, and with self indexing name if '*' is + included in the folder name. + Methods are wrappers for SU2.eval.func() and SU2.eval.grad() + + Attributes: + state - design state + config - design config + files - design files + folder - design folder + funcs - design function value bunch + grads - design gradient values bunch + + Methods: + Optimizer Interface + The following methods take a design vector for input + as a list (shape n) or numpy array (shape n or nx1 or 1xn). + Values are returned as floats or lists or lists of lists. + See SU2.eval.obj_f, etc for more detail. + + obj_f(dvs) - objective function : float + obj_df(dvs) - objective function derivatives : list + con_ceq(dvs) - equality constraints : list + con_dceq(dvs) - equality constraint derivatives : list[list] + con_cieq(dvs) - inequality constraints : list + con_dcieq(dvs) - inequality constraint gradients : list[list] + + Functional Interface + The following methods take an objective function name for input. + func(func_name) - function of specified name + grad(func_name,method='CONTINUOUS_ADJOINT') - gradient of specified name """ - def __init__(self, config, state=None, folder='DESIGNS/DSN_*'): - """ Initializes an SU2 Design """ + def __init__(self, config, state=None, folder="DESIGNS/DSN_*"): + """Initializes an SU2 Design""" ## ???: Move to Project, no next folder here - if '*' in folder: folder = su2io.next_folder(folder) + if "*" in folder: + folder = su2io.next_folder(folder) config = copy.deepcopy(config) - state = copy.deepcopy(state) - state = su2io.State(state) + state = copy.deepcopy(state) + state = su2io.State(state) state.find_files(config) self.config = config - self.state = state - self.files = state.FILES - self.funcs = state.FUNCTIONS - self.grads = state.GRADIENTS + self.state = state + self.files = state.FILES + self.funcs = state.FUNCTIONS + self.grads = state.GRADIENTS self.folder = folder - self.filename = 'design.pkl' + self.filename = "design.pkl" # initialize folder with files - pull,link = state.pullnlink(config) - with redirect_folder(folder,pull,link,force=True): + pull, link = state.pullnlink(config) + with redirect_folder(folder, pull, link, force=True): # save design, config - save_data(self.filename,self) - config.dump('config_DSN.cfg') + save_data(self.filename, self) + config.dump("config_DSN.cfg") - def _eval(self,eval_func,*args): - """ Evaluates an SU2 Design - always adds config and state to the inputs list + def _eval(self, eval_func, *args): + """Evaluates an SU2 Design + always adds config and state to the inputs list """ config = self.config - state = self.state - files = self.files + state = self.state + files = self.files folder = self.folder filename = self.filename # check folder - assert os.path.exists(folder) , 'cannot find design folder %s' % folder + assert os.path.exists(folder), "cannot find design folder %s" % folder konfig = copy.deepcopy(config) - ''' + """ If the time convergence criterion was activated, we have less time iterations. Store the changed values of TIME_ITER, ITER_AVERAGE_OBJ and UNST_ADJOINT_ITER in - state.WND_CAUCHY_DATA''' - if 'TIME_ITER' in state.WND_CAUCHY_DATA: # Use Convergence data, if we have already a direct run - konfig['TIME_ITER'] = state.WND_CAUCHY_DATA['TIME_ITER'] - konfig['ITER_AVERAGE_OBJ'] = state.WND_CAUCHY_DATA['ITER_AVERAGE_OBJ'] - konfig['UNST_ADJOINT_ITER'] = state.WND_CAUCHY_DATA['UNST_ADJOINT_ITER'] + state.WND_CAUCHY_DATA""" + if ( + "TIME_ITER" in state.WND_CAUCHY_DATA + ): # Use Convergence data, if we have already a direct run + konfig["TIME_ITER"] = state.WND_CAUCHY_DATA["TIME_ITER"] + konfig["ITER_AVERAGE_OBJ"] = state.WND_CAUCHY_DATA["ITER_AVERAGE_OBJ"] + konfig["UNST_ADJOINT_ITER"] = state.WND_CAUCHY_DATA["UNST_ADJOINT_ITER"] # list files to pull and link - pull,link = state.pullnlink(konfig) + pull, link = state.pullnlink(konfig) # output redirection, don't re-pull files - with redirect_folder(folder,pull,link,force=False) as push: + with redirect_folder(folder, pull, link, force=False) as push: # get timestamp timestamp = state.tic() # run - inputs = args + (config,state) + inputs = args + (config, state) vals = eval_func(*inputs) # save design if state.toc(timestamp): - save_data(filename,self) + save_data(filename, self) #: with redirect folder # update files - files.update(state['FILES']) + files.update(state["FILES"]) return vals - def obj_f(self,dvs): - """ Evaluates SU2 Design Objectives """ - return self._eval(obj_f,dvs) + def obj_f(self, dvs): + """Evaluates SU2 Design Objectives""" + return self._eval(obj_f, dvs) - def obj_df(self,dvs): - """ Evaluates SU2 Design Objective Gradients """ - return self._eval(obj_df,dvs) + def obj_df(self, dvs): + """Evaluates SU2 Design Objective Gradients""" + return self._eval(obj_df, dvs) - def con_ceq(self,dvs): - """ Evaluates SU2 Design Equality Constraints """ - return self._eval(con_ceq,dvs) + def con_ceq(self, dvs): + """Evaluates SU2 Design Equality Constraints""" + return self._eval(con_ceq, dvs) - def con_dceq(self,dvs): - """ Evaluates SU2 Design Equality Constraint Gradients """ - return self._eval(con_dceq,dvs) + def con_dceq(self, dvs): + """Evaluates SU2 Design Equality Constraint Gradients""" + return self._eval(con_dceq, dvs) - def con_cieq(self,dvs): - """ Evaluates SU2 Design Inequality Constraints """ - return self._eval(con_cieq,dvs) + def con_cieq(self, dvs): + """Evaluates SU2 Design Inequality Constraints""" + return self._eval(con_cieq, dvs) - def con_dcieq(self,dvs): - """ Evaluates SU2 Design Inequality Constraint Gradients """ - return self._eval(con_dcieq,dvs) + def con_dcieq(self, dvs): + """Evaluates SU2 Design Inequality Constraint Gradients""" + return self._eval(con_dcieq, dvs) - def func(self,func_name): - """ Evaluates SU2 Design Functions by Name """ - return self._eval(su2func,func_name) + def func(self, func_name): + """Evaluates SU2 Design Functions by Name""" + return self._eval(su2func, func_name) - def grad(self,func_name,method='CONTINUOUS_ADJOINT'): - """ Evaluates SU2 Design Gradients by Name """ - return self._eval(su2grad,func_name,method) + def grad(self, func_name, method="CONTINUOUS_ADJOINT"): + """Evaluates SU2 Design Gradients by Name""" + return self._eval(su2grad, func_name, method) def touch(self): return self._eval(touch) - def skip(self,*args,**kwarg): + def skip(self, *args, **kwarg): return self._eval(skip) - def __repr__(self): - return ' %s' % self.folder + return " %s" % self.folder + def __str__(self): output = self.__repr__() - output += '\n%s' % self.state + output += "\n%s" % self.state return output + #: class Design() @@ -210,178 +215,188 @@ def __str__(self): # Optimization Interface Functions # ---------------------------------------------------------------------- -def obj_f(dvs,config,state=None): - """ val = SU2.eval.obj_f(dvs,config,state=None) - Evaluates SU2 Objectives - Wraps SU2.eval.func() +def obj_f(dvs, config, state=None): + """val = SU2.eval.obj_f(dvs,config,state=None) + + Evaluates SU2 Objectives + Wraps SU2.eval.func() - Takes a design vector for input as a list (shape n) - or numpy array (shape n or nx1 or 1xn), a config - and optionally a state. + Takes a design vector for input as a list (shape n) + or numpy array (shape n or nx1 or 1xn), a config + and optionally a state. - Outputs a float. + Outputs a float. """ # unpack config and state config.unpack_dvs(dvs) state = su2io.State(state) - def_objs = config['OPT_OBJECTIVE'] + def_objs = config["OPT_OBJECTIVE"] objectives = def_objs.keys() # evaluate each objective vals_out = [] func = 0.0 - for i_obj,this_obj in enumerate(objectives): - scale = def_objs[this_obj]['SCALE'] - global_factor = float(config['OPT_GRADIENT_FACTOR']) - sign = su2io.get_objectiveSign(this_obj) + for i_obj, this_obj in enumerate(objectives): + scale = def_objs[this_obj]["SCALE"] + global_factor = float(config["OPT_GRADIENT_FACTOR"]) + sign = su2io.get_objectiveSign(this_obj) # Evaluate Objective Function scaling and sign # If default evaluate as normal, - if def_objs[this_obj]['OBJTYPE']=='DEFAULT': - func += su2func(this_obj,config,state) * sign * scale * global_factor + if def_objs[this_obj]["OBJTYPE"] == "DEFAULT": + func += su2func(this_obj, config, state) * sign * scale * global_factor # otherwise evaluate the penalty function (OBJTYPE = '>','<', or '=') else: - func += obj_p(config,state,this_obj,def_objs) * scale + func += obj_p(config, state, this_obj, def_objs) * scale vals_out.append(func) #: for each objective # If evaluating the combined function is desired, update it here. # This is only used when OPT_COMBINE_OBJECTIVE = YES - if 'COMBO' in state.FUNCTIONS: - state['FUNCTIONS']['COMBO'] = func + if "COMBO" in state.FUNCTIONS: + state["FUNCTIONS"]["COMBO"] = func return vals_out + #: def obj_f() -def obj_p(config,state,this_obj,def_objs): + +def obj_p(config, state, this_obj, def_objs): # Penalty function: square of the difference between value and limit # This function is used when a constraint-type term is added to OPT_OBJECTIVE # This code, and obj_dp, must be changed to use a non-quadratic penalty function - funcval = su2func(this_obj,config,state) - constraint = float(def_objs[this_obj]['VALUE']) + funcval = su2func(this_obj, config, state) + constraint = float(def_objs[this_obj]["VALUE"]) penalty = 0.0 - if (def_objs[this_obj]['OBJTYPE']=='=' or \ - (def_objs[this_obj]['OBJTYPE']=='>' and funcval < constraint) or \ - (def_objs[this_obj]['OBJTYPE']=='<' and funcval > constraint )): - penalty = (constraint - funcval)**2.0 + if ( + def_objs[this_obj]["OBJTYPE"] == "=" + or (def_objs[this_obj]["OBJTYPE"] == ">" and funcval < constraint) + or (def_objs[this_obj]["OBJTYPE"] == "<" and funcval > constraint) + ): + penalty = (constraint - funcval) ** 2.0 # If 'DEFAULT' objtype this returns the function value. - else: + elif def_objs[this_obj]["OBJTYPE"] == "DEFAULT": penalty = funcval return penalty + #: def obj_p() -def obj_dp(config,state,this_obj,def_objs): + +def obj_dp(config, state, this_obj, def_objs): # Partial Derivative of Penalty function: square of the difference between value and limit # This function is used when a constraint-type term is added to OPT_OBJECTIVE # This code, and obj_p, must be changed to use a non-quadratic penalty function - funcval = su2func(this_obj,config,state) - constraint = float(def_objs[this_obj]['VALUE']) - dpenalty=0.0 + funcval = su2func(this_obj, config, state) + constraint = float(def_objs[this_obj]["VALUE"]) + dpenalty = 0.0 # Inequalities will be 0 or a positive value - if ((def_objs[this_obj]['OBJTYPE']=='>' and funcval < constraint) or\ - (def_objs[this_obj]['OBJTYPE']=='<' and funcval > constraint )): - dpenalty=2.0*abs(constraint - funcval) + if (def_objs[this_obj]["OBJTYPE"] == ">" and funcval < constraint) or ( + def_objs[this_obj]["OBJTYPE"] == "<" and funcval > constraint + ): + dpenalty = 2.0 * abs(constraint - funcval) # Equalities dp will be positive if value>constraint, negative if value1): + if combine_obj and n_obj > 1: # Evaluate objectives all-at-once; for adjoint methods this results in a # single, combined objective. - scale = [1.0]*n_obj - obj_list=['DRAG']*n_obj - for i_obj,this_obj in enumerate(objectives): - obj_list[i_obj]=this_obj - scale[i_obj] = def_objs[this_obj]['SCALE'] - if def_objs[this_obj]['OBJTYPE']== 'DEFAULT': + scale = [1.0] * n_obj + obj_list = ["DRAG"] * n_obj + for i_obj, this_obj in enumerate(objectives): + obj_list[i_obj] = this_obj + scale[i_obj] = def_objs[this_obj]["SCALE"] + if def_objs[this_obj]["OBJTYPE"] == "DEFAULT": # Standard case sign = su2io.get_objectiveSign(this_obj) scale[i_obj] *= sign else: # For a penalty function, the term is scaled by the partial derivative # d p(j) / dx = (dj / dx) * ( dp / dj) - scale[i_obj]*=obj_dp(config, state, this_obj, def_objs) + scale[i_obj] *= obj_dp(config, state, this_obj, def_objs) - config['OBJECTIVE_WEIGHT']=','.join(map(str,scale)) - grad= su2grad(obj_list,grad_method,config,state) + config["OBJECTIVE_WEIGHT"] = ",".join(map(str, scale)) + grad = su2grad(obj_list, grad_method, config, state) # scaling : obj scale and sign are accounted for in combo gradient, dv scale now applied - global_factor = float(config['OPT_GRADIENT_FACTOR']) + global_factor = float(config["OPT_GRADIENT_FACTOR"]) k = 0 - for i_dv,dv_scl in enumerate(dv_scales): + for i_dv, dv_scl in enumerate(dv_scales): for i_grd in range(dv_size[i_dv]): - grad[k] = grad[k]*global_factor / dv_scl + grad[k] = grad[k] * global_factor / dv_scl k = k + 1 vals_out.append(grad) else: # Evaluate objectives one-by-one - marker_monitored = config['MARKER_MONITORING'] - for i_obj,this_obj in enumerate(objectives): + marker_monitored = config["MARKER_MONITORING"] + for i_obj, this_obj in enumerate(objectives): # For multiple objectives are evaluated one-by-one rather than combined # MARKER_MONITORING should be updated to only include the marker for i_obj # For single objectives, multiple markers can be used - if (n_obj>1): config['MARKER_MONITORING'] = marker_monitored[i_obj] - scale = def_objs[this_obj]['SCALE'] - global_factor = float(config['OPT_GRADIENT_FACTOR']) - sign = su2io.get_objectiveSign(this_obj) - if def_objs[this_obj]['OBJTYPE']!= 'DEFAULT': + if n_obj > 1: + config["MARKER_MONITORING"] = marker_monitored[i_obj] + scale = def_objs[this_obj]["SCALE"] + global_factor = float(config["OPT_GRADIENT_FACTOR"]) + sign = su2io.get_objectiveSign(this_obj) + if def_objs[this_obj]["OBJTYPE"] != "DEFAULT": # For a penalty function, the term is scaled by the partial derivative # and the sign is always positive # d p(j) / dx = (dj / dx) * ( dp / dj) - scale*=obj_dp(config, state, this_obj, def_objs) + scale *= obj_dp(config, state, this_obj, def_objs) sign = 1.0 # Evaluate Objective Gradient - grad = su2grad(this_obj,grad_method,config,state) + grad = su2grad(this_obj, grad_method, config, state) # scaling and sign k = 0 - for i_dv,dv_scl in enumerate(dv_scales): + for i_dv, dv_scl in enumerate(dv_scales): for i_grd in range(dv_size[i_dv]): grad[k] = grad[k] * sign * scale * global_factor / dv_scl k = k + 1 @@ -392,38 +407,40 @@ def obj_df(dvs,config,state=None): return vals_out + #: def obj_df() -def con_ceq(dvs,config,state=None): - """ vals = SU2.eval.con_ceq(dvs,config,state=None) - Evaluates SU2 Equality Constraints - Wraps SU2.eval.func() +def con_ceq(dvs, config, state=None): + """vals = SU2.eval.con_ceq(dvs,config,state=None) + + Evaluates SU2 Equality Constraints + Wraps SU2.eval.func() - Takes a design vector for input as a list (shape n) - or numpy array (shape n or nx1 or 1xn), a config - and optionally a state. + Takes a design vector for input as a list (shape n) + or numpy array (shape n or nx1 or 1xn), a config + and optionally a state. - Returns: a list of constraint values, ordered - by the OPT_CONSTRAINT config parameter. + Returns: a list of constraint values, ordered + by the OPT_CONSTRAINT config parameter. """ # unpack state and config config.unpack_dvs(dvs) state = su2io.State(state) - def_cons = config['OPT_CONSTRAINT']['EQUALITY'] + def_cons = config["OPT_CONSTRAINT"]["EQUALITY"] constraints = def_cons.keys() # evaluate each constraint vals_out = [] - for i_obj,this_con in enumerate(constraints): - global_factor = float(config['OPT_GRADIENT_FACTOR']) - push = def_cons[this_con]['SCALE'] - value = def_cons[this_con]['VALUE'] + for i_obj, this_con in enumerate(constraints): + global_factor = float(config["OPT_GRADIENT_FACTOR"]) + push = def_cons[this_con]["SCALE"] + value = def_cons[this_con]["VALUE"] # Evaluate Constraint Function - func = su2func(this_con,config,state) + func = su2func(this_con, config, state) # scaling and centering func = (func - value) * global_factor * push @@ -434,45 +451,47 @@ def con_ceq(dvs,config,state=None): return vals_out + #: def obj_ceq() -def con_dceq(dvs,config,state=None): - """ vals = SU2.eval.con_dceq(dvs,config,state=None) - Evaluates SU2 Equality Constraint Gradients - Wraps SU2.eval.grad() +def con_dceq(dvs, config, state=None): + """vals = SU2.eval.con_dceq(dvs,config,state=None) + + Evaluates SU2 Equality Constraint Gradients + Wraps SU2.eval.grad() - Takes a design vector for input as a list (shape n) - or numpy array (shape n or nx1 or 1xn), a config - and optionally a state. + Takes a design vector for input as a list (shape n) + or numpy array (shape n or nx1 or 1xn), a config + and optionally a state. - Returns a list of lists of constraint gradients, - ordered by the OPT_CONSTRAINT config parameter. + Returns a list of lists of constraint gradients, + ordered by the OPT_CONSTRAINT config parameter. """ # unpack state and config config.unpack_dvs(dvs) state = su2io.State(state) - grad_method = config.get('GRADIENT_METHOD','CONTINUOUS_ADJOINT') + grad_method = config.get("GRADIENT_METHOD", "CONTINUOUS_ADJOINT") - def_cons = config['OPT_CONSTRAINT']['EQUALITY'] + def_cons = config["OPT_CONSTRAINT"]["EQUALITY"] constraints = def_cons.keys() - dv_scales = config['DEFINITION_DV']['SCALE'] - dv_size = config['DEFINITION_DV']['SIZE'] + dv_scales = config["DEFINITION_DV"]["SCALE"] + dv_size = config["DEFINITION_DV"]["SIZE"] # evaluate each constraint vals_out = [] - for i_obj,this_con in enumerate(constraints): - global_factor = float(config['OPT_GRADIENT_FACTOR']) - value = def_cons[this_con]['VALUE'] + for i_obj, this_con in enumerate(constraints): + global_factor = float(config["OPT_GRADIENT_FACTOR"]) + value = def_cons[this_con]["VALUE"] # Evaluate Constraint Gradient - grad = su2grad(this_con,grad_method,config,state) + grad = su2grad(this_con, grad_method, config, state) # scaling k = 0 - for i_dv,dv_scl in enumerate(dv_scales): + for i_dv, dv_scl in enumerate(dv_scales): for i_grd in range(dv_size[i_dv]): grad[k] = grad[k] * global_factor / dv_scl k = k + 1 @@ -483,41 +502,43 @@ def con_dceq(dvs,config,state=None): return vals_out + #: def obj_dceq() -def con_cieq(dvs,config,state=None): - """ vals = SU2.eval.con_cieq(dvs,config,state=None) - Evaluates SU2 Inequality Constraints - Wraps SU2.eval.func() - Convention is con(x)<=0 +def con_cieq(dvs, config, state=None): + """vals = SU2.eval.con_cieq(dvs,config,state=None) - Takes a design vector for input as a list (shape n) - or numpy array (shape n or nx1 or 1xn), a config - and optionally a state. + Evaluates SU2 Inequality Constraints + Wraps SU2.eval.func() + Convention is con(x)<=0 - Returns a list of constraint gradients, ordered - by the OPT_CONSTRAINT config parameter. + Takes a design vector for input as a list (shape n) + or numpy array (shape n or nx1 or 1xn), a config + and optionally a state. + + Returns a list of constraint gradients, ordered + by the OPT_CONSTRAINT config parameter. """ # unpack state and config config.unpack_dvs(dvs) state = su2io.State(state) - def_cons = config['OPT_CONSTRAINT']['INEQUALITY'] + def_cons = config["OPT_CONSTRAINT"]["INEQUALITY"] constraints = def_cons.keys() # evaluate each constraint vals_out = [] - for i_obj,this_con in enumerate(constraints): - global_factor = float(config['OPT_GRADIENT_FACTOR']) - push = def_cons[this_con]['SCALE'] - value = def_cons[this_con]['VALUE'] - sign = def_cons[this_con]['SIGN'] - sign = su2io.get_constraintSign(sign) + for i_obj, this_con in enumerate(constraints): + global_factor = float(config["OPT_GRADIENT_FACTOR"]) + push = def_cons[this_con]["SCALE"] + value = def_cons[this_con]["VALUE"] + sign = def_cons[this_con]["SIGN"] + sign = su2io.get_constraintSign(sign) # Evaluate Constraint Function - func = su2func(this_con,config,state) + func = su2func(this_con, config, state) # scaling and centering func = (func - value) * sign * global_factor * push @@ -528,48 +549,50 @@ def con_cieq(dvs,config,state=None): return vals_out + #: def obj_cieq() -def con_dcieq(dvs,config,state=None): - """ vals = SU2.eval.con_dceq(dvs,config,state=None) - Evaluates SU2 Inequality Constraint Gradients - Wraps SU2.eval.grad() - Convention is con(x)<=0 +def con_dcieq(dvs, config, state=None): + """vals = SU2.eval.con_dceq(dvs,config,state=None) + + Evaluates SU2 Inequality Constraint Gradients + Wraps SU2.eval.grad() + Convention is con(x)<=0 - Takes a design vector for input as a list (shape n) - or numpy array (shape n or nx1 or 1xn), a config - and optionally a state. + Takes a design vector for input as a list (shape n) + or numpy array (shape n or nx1 or 1xn), a config + and optionally a state. - Returns a list of lists of constraint gradients, - ordered by the OPT_CONSTRAINT config parameter. + Returns a list of lists of constraint gradients, + ordered by the OPT_CONSTRAINT config parameter. """ # unpack state and config config.unpack_dvs(dvs) state = su2io.State(state) - grad_method = config.get('GRADIENT_METHOD','CONTINUOUS_ADJOINT') + grad_method = config.get("GRADIENT_METHOD", "CONTINUOUS_ADJOINT") - def_cons = config['OPT_CONSTRAINT']['INEQUALITY'] + def_cons = config["OPT_CONSTRAINT"]["INEQUALITY"] constraints = def_cons.keys() - dv_scales = config['DEFINITION_DV']['SCALE'] - dv_size = config['DEFINITION_DV']['SIZE'] + dv_scales = config["DEFINITION_DV"]["SCALE"] + dv_size = config["DEFINITION_DV"]["SIZE"] # evaluate each constraint vals_out = [] - for i_obj,this_con in enumerate(constraints): - global_factor = float(config['OPT_GRADIENT_FACTOR']) - value = def_cons[this_con]['VALUE'] - sign = def_cons[this_con]['SIGN'] - sign = su2io.get_constraintSign(sign) + for i_obj, this_con in enumerate(constraints): + global_factor = float(config["OPT_GRADIENT_FACTOR"]) + value = def_cons[this_con]["VALUE"] + sign = def_cons[this_con]["SIGN"] + sign = su2io.get_constraintSign(sign) # Evaluate Constraint Gradient - grad = su2grad(this_con,grad_method,config,state) + grad = su2grad(this_con, grad_method, config, state) # scaling and sign k = 0 - for i_dv,dv_scl in enumerate(dv_scales): + for i_dv, dv_scl in enumerate(dv_scales): for i_grd in range(dv_size[i_dv]): grad[k] = grad[k] * sign * global_factor / dv_scl k = k + 1 @@ -580,16 +603,19 @@ def con_dcieq(dvs,config,state=None): return vals_out + #: def obj_dcieq() -def touch(config,state): - """ SU2.eval.touch(config,state) - resets state timestamp + +def touch(config, state): + """SU2.eval.touch(config,state) + resets state timestamp """ state.set_timestamp() -def skip(config,state): - """ SU2.eval.skip(config,state) - does nothing + +def skip(config, state): + """SU2.eval.skip(config,state) + does nothing """ pass diff --git a/SU2_PY/SU2/eval/functions.py b/SU2_PY/SU2/eval/functions.py index 78bb2f190a2..c215a863426 100644 --- a/SU2_PY/SU2/eval/functions.py +++ b/SU2_PY/SU2/eval/functions.py @@ -3,7 +3,7 @@ ## \file functions.py # \brief python package for functions # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -30,8 +30,8 @@ # ---------------------------------------------------------------------- import os, sys, shutil, copy, time, subprocess -from .. import run as su2run -from .. import io as su2io +from .. import run as su2run +from .. import io as su2io from .. import util as su2util from ..io import redirect_folder, redirect_output @@ -40,93 +40,101 @@ # Main Function Interface # ---------------------------------------------------------------------- -def function( func_name, config, state=None ): - """ val = SU2.eval.func(func_name,config,state=None) - Evaluates the aerodynamics and geometry functions. +def function(func_name, config, state=None): + """val = SU2.eval.func(func_name,config,state=None) - Wraps: - SU2.eval.aerodynamics() - SU2.eval.geometry() + Evaluates the aerodynamics and geometry functions. - Assumptions: - Config is already setup for deformation. - Mesh need not be deformed. - Updates config and state by reference. - Redundancy if state.FUNCTIONS is not empty. + Wraps: + SU2.eval.aerodynamics() + SU2.eval.geometry() - Executes in: - ./DIRECT or ./GEOMETRY + Assumptions: + Config is already setup for deformation. + Mesh need not be deformed. + Updates config and state by reference. + Redundancy if state.FUNCTIONS is not empty. - Inputs: - func_name - SU2 objective function name or 'ALL' - config - an SU2 config - state - optional, an SU2 state + Executes in: + ./DIRECT or ./GEOMETRY - Outputs: - If func_name is 'ALL', returns a Bunch() of - functions with keys of objective function names - and values of objective function floats. - Otherwise returns a float. + Inputs: + func_name - SU2 objective function name or 'ALL' + config - an SU2 config + state - optional, an SU2 state + + Outputs: + If func_name is 'ALL', returns a Bunch() of + functions with keys of objective function names + and values of objective function floats. + Otherwise returns a float. """ # initialize state = su2io.State(state) # check for multiple objectives - multi_objective = (type(func_name)==list) + multi_objective = type(func_name) == list # func_name_string is only used to check whether the function has already been evaluated. func_name_string = func_name - if multi_objective: func_name_string = func_name[0] + if multi_objective: + func_name_string = func_name[0] # redundancy check - if not func_name_string in state['FUNCTIONS']: + if not func_name_string in state["FUNCTIONS"]: # Aerodynamics - if multi_objective or func_name == 'ALL': - aerodynamics( config, state ) + if multi_objective or func_name == "ALL": + aerodynamics(config, state) elif func_name in su2io.historyOutFields: - if su2io.historyOutFields[func_name]['TYPE'] == 'COEFFICIENT' or su2io.historyOutFields[func_name]['TYPE'] == 'D_COEFFICIENT': - aerodynamics( config, state ) + if ( + su2io.historyOutFields[func_name]["TYPE"] == "COEFFICIENT" + or su2io.historyOutFields[func_name]["TYPE"] == "D_COEFFICIENT" + ): + aerodynamics(config, state) # Stability elif func_name in su2io.optnames_stab: - stability( config, state ) + stability(config, state) # Multipoint elif func_name in su2io.optnames_multi: - multipoint( config, state ) + multipoint(config, state) # Geometry elif func_name in su2io.optnames_geo: - geometry( func_name, config, state ) + geometry(func_name, config, state) else: - raise Exception('unknown function name, %s. Please check config_template.cfg for updated list of function names' % func_name) + raise Exception( + "unknown function name, %s. Please check config_template.cfg for updated list of function names" + % func_name + ) #: if not redundant # prepare output - if func_name == 'ALL': - func_out = state['FUNCTIONS'] - elif (multi_objective): + if func_name == "ALL": + func_out = state["FUNCTIONS"] + elif multi_objective: # If combine_objective is true, use the 'combo' output. - func_out = state['FUNCTIONS']['COMBO'] + func_out = state["FUNCTIONS"]["COMBO"] else: - func_out = state['FUNCTIONS'][func_name] + func_out = state["FUNCTIONS"][func_name] - if func_name_string in config['OPT_OBJECTIVE']: - marker = config['OPT_OBJECTIVE'][func_name_string]['MARKER'] + if func_name_string in config["OPT_OBJECTIVE"]: + marker = config["OPT_OBJECTIVE"][func_name_string]["MARKER"] if func_name_string in su2io.per_surface_map: - name = su2io.per_surface_map[func_name_string]+'_'+marker - if name in state['FUNCTIONS']: - func_out = state['FUNCTIONS'][name] - + name = su2io.per_surface_map[func_name_string] + "_" + marker + if name in state["FUNCTIONS"]: + func_out = state["FUNCTIONS"][name] return copy.deepcopy(func_out) + #: def function() @@ -134,29 +142,30 @@ def function( func_name, config, state=None ): # Aerodynamic Functions # ---------------------------------------------------------------------- -def aerodynamics( config, state=None ): - """ vals = SU2.eval.aerodynamics(config,state=None) - Evaluates aerodynamics with the following: - SU2.run.deform() - SU2.run.direct() +def aerodynamics(config, state=None): + """vals = SU2.eval.aerodynamics(config,state=None) + + Evaluates aerodynamics with the following: + SU2.run.deform() + SU2.run.direct() - Assumptions: - Config is already setup for deformation. - Mesh may or may not be deformed. - Updates config and state by reference. - Redundancy if state.FUNCTIONS is not empty. + Assumptions: + Config is already setup for deformation. + Mesh may or may not be deformed. + Updates config and state by reference. + Redundancy if state.FUNCTIONS is not empty. - Executes in: - ./DIRECT + Executes in: + ./DIRECT - Inputs: - config - an SU2 config - state - optional, an SU2 state + Inputs: + config - an SU2 config + state - optional, an SU2 state - Outputs: - Bunch() of functions with keys of objective function names - and values of objective function floats. + Outputs: + Bunch() of functions with keys of objective function names + and values of objective function floats. """ # ---------------------------------------------------- @@ -167,16 +176,16 @@ def aerodynamics( config, state=None ): state = su2io.State(state) # Make sure to output aerodynamic coeff. - if not 'AERO_COEFF' in config['HISTORY_OUTPUT']: - config['HISTORY_OUTPUT'].append('AERO_COEFF') + if not "AERO_COEFF" in config["HISTORY_OUTPUT"]: + config["HISTORY_OUTPUT"].append("AERO_COEFF") - if not 'MESH' in state.FILES: - state.FILES.MESH = config['MESH_FILENAME'] + if not "MESH" in state.FILES: + state.FILES.MESH = config["MESH_FILENAME"] special_cases = su2io.get_specialCases(config) # console output - if config.get('CONSOLE','VERBOSE') in ['QUIET','CONCISE']: - log_direct = 'log_Direct.out' + if config.get("CONSOLE", "VERBOSE") in ["QUIET", "CONCISE"]: + log_direct = "log_Direct.out" else: log_direct = None @@ -185,13 +194,13 @@ def aerodynamics( config, state=None ): # ---------------------------------------------------- # does decomposition and deformation - info = update_mesh(config,state) + info = update_mesh(config, state) # ---------------------------------------------------- # Adaptation (not implemented) # ---------------------------------------------------- - #if not state.['ADAPTED_FUNC']: + # if not state.['ADAPTED_FUNC']: # config = su2run.adaptation(config) # state['ADAPTED_FUNC'] = True @@ -200,7 +209,7 @@ def aerodynamics( config, state=None ): # ---------------------------------------------------- opt_names = [] for key in su2io.historyOutFields: - if su2io.historyOutFields[key]['TYPE'] == 'COEFFICIENT': + if su2io.historyOutFields[key]["TYPE"] == "COEFFICIENT": opt_names.append(key) # redundancy check @@ -216,104 +225,108 @@ def aerodynamics( config, state=None ): # files to pull files = state.FILES - pull = []; link = [] + pull = [] + link = [] # files: mesh - name = files['MESH'] - name = su2io.expand_part(name,config) + name = files["MESH"] + name = su2io.expand_part(name, config) link.extend(name) - pull.extend(config.get('CONFIG_LIST',[])) + pull.extend(config.get("CONFIG_LIST", [])) # files: restarts - if config.get('TIME_DOMAIN', 'NO') == 'YES' and config.get('RESTART_SOL','NO') =='YES': - if 'RESTART_FILE_1' in files: # not the case for directdiff restart - name = files['RESTART_FILE_1'] + if ( + config.get("TIME_DOMAIN", "NO") == "YES" + and config.get("RESTART_SOL", "NO") == "YES" + ): + if "RESTART_FILE_1" in files: # not the case for directdiff restart + name = files["RESTART_FILE_1"] name = su2io.expand_part(name, config) link.extend(name) - if 'RESTART_FILE_2' in files: # not the case for 1st order time stepping - name = files['RESTART_FILE_2'] + if "RESTART_FILE_2" in files: # not the case for 1st order time stepping + name = files["RESTART_FILE_2"] name = su2io.expand_part(name, config) link.extend(name) - if 'FLOW_META' in files: - pull.append(files['FLOW_META']) + if "FLOW_META" in files: + pull.append(files["FLOW_META"]) # files: direct solution - if 'DIRECT' in files: - name = files['DIRECT'] + if "DIRECT" in files: + name = files["DIRECT"] name = su2io.expand_zones(name, config) - name = su2io.expand_time(name,config) - link.extend( name ) + name = su2io.expand_time(name, config) + link.extend(name) ##config['RESTART_SOL'] = 'YES' # don't override config file else: - if config.get('TIME_DOMAIN', 'NO') != 'YES': #rules out steady state optimization special cases. - config['RESTART_SOL'] = 'NO' #for shape optimization with restart files. + if ( + config.get("TIME_DOMAIN", "NO") != "YES" + ): # rules out steady state optimization special cases. + config["RESTART_SOL"] = "NO" # for shape optimization with restart files. # files: target equivarea distribution - if ( 'EQUIV_AREA' in special_cases and - 'TARGET_EA' in files ) : - pull.append( files['TARGET_EA'] ) + if "EQUIV_AREA" in special_cases and "TARGET_EA" in files: + pull.append(files["TARGET_EA"]) # files: target pressure distribution - if ( 'INV_DESIGN_CP' in special_cases and - 'TARGET_CP' in files ) : - pull.append( files['TARGET_CP'] ) + if "INV_DESIGN_CP" in special_cases and "TARGET_CP" in files: + pull.append(files["TARGET_CP"]) # files: target heat flux distribution - if ( 'INV_DESIGN_HEATFLUX' in special_cases and - 'TARGET_HEATFLUX' in files ) : - pull.append( files['TARGET_HEATFLUX'] ) - + if "INV_DESIGN_HEATFLUX" in special_cases and "TARGET_HEATFLUX" in files: + pull.append(files["TARGET_HEATFLUX"]) # output redirection - with redirect_folder( 'DIRECT', pull, link ) as push: + with redirect_folder("DIRECT", pull, link) as push: with redirect_output(log_direct): # # RUN DIRECT SOLUTION # # info = su2run.direct(config) - - konfig = copy.deepcopy(config) - ''' + """ If the time convergence criterion was activated, we have less time iterations. Store the changed values of TIME_ITER, ITER_AVERAGE_OBJ and UNST_ADJOINT_ITER in - info.WND_CAUCHY_DATA''' - if konfig.get('WINDOW_CAUCHY_CRIT', 'NO') == 'YES' and konfig.TIME_MARCHING != 'NO': # Tranfer Convergence Data, if necessary - konfig['TIME_ITER'] = info.WND_CAUCHY_DATA['TIME_ITER'] - konfig['ITER_AVERAGE_OBJ'] = info.WND_CAUCHY_DATA['ITER_AVERAGE_OBJ'] - konfig['UNST_ADJOINT_ITER'] = info.WND_CAUCHY_DATA['UNST_ADJOINT_ITER'] - - su2io.restart2solution(konfig,info) + info.WND_CAUCHY_DATA""" + if ( + konfig.get("WINDOW_CAUCHY_CRIT", "NO") == "YES" + and konfig.TIME_MARCHING != "NO" + ): # Tranfer Convergence Data, if necessary + konfig["TIME_ITER"] = info.WND_CAUCHY_DATA["TIME_ITER"] + konfig["ITER_AVERAGE_OBJ"] = info.WND_CAUCHY_DATA["ITER_AVERAGE_OBJ"] + konfig["UNST_ADJOINT_ITER"] = info.WND_CAUCHY_DATA["UNST_ADJOINT_ITER"] + + su2io.restart2solution(konfig, info) state.update(info) # direct files to push - name = info.FILES['DIRECT'] - name = su2io.expand_zones(name,konfig) - name = su2io.expand_time(name,konfig) + name = info.FILES["DIRECT"] + name = su2io.expand_zones(name, konfig) + name = su2io.expand_time(name, konfig) push.extend(name) # pressure files to push - if 'TARGET_CP' in info.FILES: - push.append(info.FILES['TARGET_CP']) + if "TARGET_CP" in info.FILES: + push.append(info.FILES["TARGET_CP"]) # heat flux files to push - if 'TARGET_HEATFLUX' in info.FILES: - push.append(info.FILES['TARGET_HEATFLUX']) + if "TARGET_HEATFLUX" in info.FILES: + push.append(info.FILES["TARGET_HEATFLUX"]) - if 'FLOW_META' in info.FILES: - push.append(info.FILES['FLOW_META']) + if "FLOW_META" in info.FILES: + push.append(info.FILES["FLOW_META"]) #: with output redirection - su2io.update_persurface(konfig,state) + su2io.update_persurface(konfig, state) # return output funcs = su2util.ordered_bunch() - for key in state['FUNCTIONS']: - funcs[key] = state['FUNCTIONS'][key] + for key in state["FUNCTIONS"]: + funcs[key] = state["FUNCTIONS"][key] return funcs + #: def aerodynamics() @@ -321,10 +334,10 @@ def aerodynamics( config, state=None ): # Stability Functions # ---------------------------------------------------------------------- -def stability( config, state=None, step=1e-2 ): +def stability(config, state=None, step=1e-2): - folder = 'STABILITY' # os.path.join('STABILITY',func_name) #STABILITY/D_MOMENT_Y_D_ALPHA/ + folder = "STABILITY" # os.path.join('STABILITY',func_name) #STABILITY/D_MOMENT_Y_D_ALPHA/ # ---------------------------------------------------- # Initialize @@ -332,13 +345,13 @@ def stability( config, state=None, step=1e-2 ): # initialize state = su2io.State(state) - if not 'MESH' in state.FILES: - state.FILES.MESH = config['MESH_FILENAME'] + if not "MESH" in state.FILES: + state.FILES.MESH = config["MESH_FILENAME"] special_cases = su2io.get_specialCases(config) # console output - if config.get('CONSOLE','VERBOSE') in ['QUIET','CONCISE']: - log_direct = 'log_Direct.out' + if config.get("CONSOLE", "VERBOSE") in ["QUIET", "CONCISE"]: + log_direct = "log_Direct.out" else: log_direct = None @@ -346,17 +359,15 @@ def stability( config, state=None, step=1e-2 ): # Update Mesh # ---------------------------------------------------- - # does decomposition and deformation - info = update_mesh(config,state) + info = update_mesh(config, state) # ---------------------------------------------------- # CENTRAL POINT # ---------------------------------------------------- # will run in DIRECT/ - func_0 = aerodynamics(config,state) - + func_0 = aerodynamics(config, state) # ---------------------------------------------------- # Run Forward Point @@ -364,59 +375,57 @@ def stability( config, state=None, step=1e-2 ): # files to pull files = state.FILES - pull = []; link = [] + pull = [] + link = [] # files: mesh - name = files['MESH'] - name = su2io.expand_part(name,config) + name = files["MESH"] + name = su2io.expand_part(name, config) link.extend(name) # files: direct solution - if 'DIRECT' in files: - name = files['DIRECT'] - name = su2io.expand_time(name,config) - link.extend( name ) + if "DIRECT" in files: + name = files["DIRECT"] + name = su2io.expand_time(name, config) + link.extend(name) ##config['RESTART_SOL'] = 'YES' # don't override config file else: - config['RESTART_SOL'] = 'NO' + config["RESTART_SOL"] = "NO" # files: target equivarea distribution - if ( 'EQUIV_AREA' in special_cases and - 'TARGET_EA' in files ) : - pull.append( files['TARGET_EA'] ) + if "EQUIV_AREA" in special_cases and "TARGET_EA" in files: + pull.append(files["TARGET_EA"]) # files: target pressure distribution - if ( 'INV_DESIGN_CP' in special_cases and - 'TARGET_CP' in files ) : - pull.append( files['TARGET_CP'] ) + if "INV_DESIGN_CP" in special_cases and "TARGET_CP" in files: + pull.append(files["TARGET_CP"]) # files: target heat flux distribution - if ( 'INV_DESIGN_HEATFLUX' in special_cases and - 'TARGET_HEATFLUX' in files ) : - pull.append( files['TARGET_HEATFLUX'] ) + if "INV_DESIGN_HEATFLUX" in special_cases and "TARGET_HEATFLUX" in files: + pull.append(files["TARGET_HEATFLUX"]) # pull needed files, start folder - with redirect_folder( folder, pull, link ) as push: + with redirect_folder(folder, pull, link) as push: with redirect_output(log_direct): konfig = copy.deepcopy(config) - ztate = copy.deepcopy(state) + ztate = copy.deepcopy(state) # TODO: GENERALIZE konfig.AOA = konfig.AOA + step ztate.FUNCTIONS.clear() - func_1 = aerodynamics(konfig,ztate) + func_1 = aerodynamics(konfig, ztate) ## direct files to store - #name = ztate.FILES['DIRECT'] - #if not 'STABILITY' in state.FILES: - #state.FILES.STABILITY = su2io.ordered_bunch() - #state.FILES.STABILITY['DIRECT'] = name + # name = ztate.FILES['DIRECT'] + # if not 'STABILITY' in state.FILES: + # state.FILES.STABILITY = su2io.ordered_bunch() + # state.FILES.STABILITY['DIRECT'] = name ## equivarea files to store - #if 'WEIGHT_NF' in ztate.FILES: - #state.FILES.STABILITY['WEIGHT_NF'] = ztate.FILES['WEIGHT_NF'] + # if 'WEIGHT_NF' in ztate.FILES: + # state.FILES.STABILITY['WEIGHT_NF'] = ztate.FILES['WEIGHT_NF'] # ---------------------------------------------------- # DIFFERENCING @@ -424,20 +433,20 @@ def stability( config, state=None, step=1e-2 ): for derv_name in su2io.optnames_stab: - matches = [ k for k in su2io.optnames_aero if k in derv_name ] - if not len(matches) == 1: continue + matches = [k for k in su2io.optnames_aero if k in derv_name] + if not len(matches) == 1: + continue func_name = matches[0] - obj_func = ( func_1[func_name] - func_0[func_name] ) / step + obj_func = (func_1[func_name] - func_0[func_name]) / step state.FUNCTIONS[derv_name] = obj_func - # return output funcs = su2util.ordered_bunch() for key in su2io.optnames_stab: - if key in state['FUNCTIONS']: - funcs[key] = state['FUNCTIONS'][key] + if key in state["FUNCTIONS"]: + funcs[key] = state["FUNCTIONS"][key] return funcs @@ -446,21 +455,47 @@ def stability( config, state=None, step=1e-2 ): # Multipoint Functions # ---------------------------------------------------------------------- -def multipoint( config, state=None, step=1e-2 ): - - mach_list = config['MULTIPOINT_MACH_NUMBER'].replace("(", "").replace(")", "").split(',') - reynolds_list = config['MULTIPOINT_REYNOLDS_NUMBER'].replace("(", "").replace(")", "").split(',') - freestream_temp_list = config['MULTIPOINT_FREESTREAM_TEMPERATURE'].replace("(", "").replace(")", "").split(',') - freestream_press_list = config['MULTIPOINT_FREESTREAM_PRESSURE'].replace("(", "").replace(")", "").split(',') - aoa_list = config['MULTIPOINT_AOA'].replace("(", "").replace(")", "").split(',') - sideslip_list = config['MULTIPOINT_SIDESLIP_ANGLE'].replace("(", "").replace(")", "").split(',') - target_cl_list = config['MULTIPOINT_TARGET_CL'].replace("(", "").replace(")", "").split(',') - weight_list = config['MULTIPOINT_WEIGHT'].replace("(", "").replace(")", "").split(',') - outlet_value_list = config['MULTIPOINT_OUTLET_VALUE'].replace("(", "").replace(")", "").split(',') + +def multipoint(config, state=None, step=1e-2): + + mach_list = ( + config["MULTIPOINT_MACH_NUMBER"].replace("(", "").replace(")", "").split(",") + ) + reynolds_list = ( + config["MULTIPOINT_REYNOLDS_NUMBER"] + .replace("(", "") + .replace(")", "") + .split(",") + ) + freestream_temp_list = ( + config["MULTIPOINT_FREESTREAM_TEMPERATURE"] + .replace("(", "") + .replace(")", "") + .split(",") + ) + freestream_press_list = ( + config["MULTIPOINT_FREESTREAM_PRESSURE"] + .replace("(", "") + .replace(")", "") + .split(",") + ) + aoa_list = config["MULTIPOINT_AOA"].replace("(", "").replace(")", "").split(",") + sideslip_list = ( + config["MULTIPOINT_SIDESLIP_ANGLE"].replace("(", "").replace(")", "").split(",") + ) + target_cl_list = ( + config["MULTIPOINT_TARGET_CL"].replace("(", "").replace(")", "").split(",") + ) + weight_list = ( + config["MULTIPOINT_WEIGHT"].replace("(", "").replace(")", "").split(",") + ) + outlet_value_list = ( + config["MULTIPOINT_OUTLET_VALUE"].replace("(", "").replace(")", "").split(",") + ) solution_flow_list = su2io.expand_multipoint(config.SOLUTION_FILENAME, config) - flow_meta_list = su2io.expand_multipoint('flow.meta', config) - restart_sol = config['RESTART_SOL'] - dv_value_old = config['DV_VALUE_OLD']; + flow_meta_list = su2io.expand_multipoint("flow.meta", config) + restart_sol = config["RESTART_SOL"] + dv_value_old = config["DV_VALUE_OLD"] func = [] folder = [] @@ -469,11 +504,11 @@ def multipoint( config, state=None, step=1e-2 ): folder.append(0) for i in range(len(weight_list)): - folder[i] = 'MULTIPOINT_' + str(i) + folder[i] = "MULTIPOINT_" + str(i) opt_names = [] for key in su2io.historyOutFields: - if su2io.historyOutFields[key]['TYPE'] == 'COEFFICIENT': + if su2io.historyOutFields[key]["TYPE"] == "COEFFICIENT": opt_names.append(key) # ---------------------------------------------------- @@ -482,13 +517,13 @@ def multipoint( config, state=None, step=1e-2 ): # initialize state = su2io.State(state) - if not 'MESH' in state.FILES: - state.FILES.MESH = config['MESH_FILENAME'] + if not "MESH" in state.FILES: + state.FILES.MESH = config["MESH_FILENAME"] special_cases = su2io.get_specialCases(config) # console output - if config.get('CONSOLE','VERBOSE') in ['QUIET','CONCISE']: - log_direct = 'log_Direct.out' + if config.get("CONSOLE", "VERBOSE") in ["QUIET", "CONCISE"]: + log_direct = "log_Direct.out" else: log_direct = None @@ -497,12 +532,12 @@ def multipoint( config, state=None, step=1e-2 ): # ---------------------------------------------------- # If multiple meshes specified, use relevant mesh - if 'MULTIPOINT_MESH_FILENAME' in state.FILES: + if "MULTIPOINT_MESH_FILENAME" in state.FILES: state.FILES.MESH = state.FILES.MULTIPOINT_MESH_FILENAME[0] config.MESH_FILENAME = state.FILES.MULTIPOINT_MESH_FILENAME[0] # does decomposition and deformation - info = update_mesh(config,state) + info = update_mesh(config, state) # ---------------------------------------------------- # FIRST POINT @@ -517,209 +552,223 @@ def multipoint( config, state=None, step=1e-2 ): config.FREESTREAM_TEMPERATURE = freestream_temp_list[0] config.FREESTREAM_PRESSURE = freestream_press_list[0] config.TARGET_CL = target_cl_list[0] - orig_marker_outlet = config['MARKER_OUTLET'] - orig_marker_outlet = orig_marker_outlet.replace("(", "").replace(")", "").split(',') + orig_marker_outlet = config["MARKER_OUTLET"] + orig_marker_outlet = orig_marker_outlet.replace("(", "").replace(")", "").split(",") new_marker_outlet = "(" + orig_marker_outlet[0] + "," + outlet_value_list[0] + ")" config.MARKER_OUTLET = new_marker_outlet config.SOLUTION_FILENAME = solution_flow_list[0] # If solution file for the first point is available, use it - if 'MULTIPOINT_DIRECT' in state.FILES and state.FILES.MULTIPOINT_DIRECT[0]: - state.FILES['DIRECT'] = state.FILES.MULTIPOINT_DIRECT[0] + if "MULTIPOINT_DIRECT" in state.FILES and state.FILES.MULTIPOINT_DIRECT[0]: + state.FILES["DIRECT"] = state.FILES.MULTIPOINT_DIRECT[0] # If flow.meta file for the first point is available, rename it before using it - if 'MULTIPOINT_FLOW_META' in state.FILES and state.FILES.MULTIPOINT_FLOW_META[0]: - os.rename(state.FILES.MULTIPOINT_FLOW_META[0], 'flow.meta') - state.FILES['FLOW_META'] = 'flow.meta' + if "MULTIPOINT_FLOW_META" in state.FILES and state.FILES.MULTIPOINT_FLOW_META[0]: + os.rename(state.FILES.MULTIPOINT_FLOW_META[0], "flow.meta") + state.FILES["FLOW_META"] = "flow.meta" - func[0] = aerodynamics(config,state) + func[0] = aerodynamics(config, state) # change name of flow.meta back to multipoint name - if os.path.exists('flow.meta'): - os.rename('flow.meta', flow_meta_list[0]) - state.FILES['FLOW_META'] = flow_meta_list[0] + if os.path.exists("flow.meta"): + os.rename("flow.meta", flow_meta_list[0]) + state.FILES["FLOW_META"] = flow_meta_list[0] src = os.getcwd() - src = os.path.abspath(src).rstrip('/')+'/DIRECT/' + src = os.path.abspath(src).rstrip("/") + "/DIRECT/" # files to pull files = state.FILES - pull = []; link = [] + pull = [] + link = [] # files: mesh - name = files['MESH'] - name = su2io.expand_part(name,config) + name = files["MESH"] + name = su2io.expand_part(name, config) link.extend(name) # files: direct solution - if 'DIRECT' in files: - name = files['DIRECT'] - name = su2io.expand_time(name,config) - link.extend( name ) + if "DIRECT" in files: + name = files["DIRECT"] + name = su2io.expand_time(name, config) + link.extend(name) else: - config['RESTART_SOL'] = 'NO' + config["RESTART_SOL"] = "NO" # files: meta data for the flow - if 'FLOW_META' in files: - pull.append(files['FLOW_META']) + if "FLOW_META" in files: + pull.append(files["FLOW_META"]) # files: target equivarea distribution - if ( 'EQUIV_AREA' in special_cases and - 'TARGET_EA' in files ) : - pull.append( files['TARGET_EA'] ) + if "EQUIV_AREA" in special_cases and "TARGET_EA" in files: + pull.append(files["TARGET_EA"]) # files: target pressure distribution - if ( 'INV_DESIGN_CP' in special_cases and - 'TARGET_CP' in files ) : - pull.append( files['TARGET_CP'] ) + if "INV_DESIGN_CP" in special_cases and "TARGET_CP" in files: + pull.append(files["TARGET_CP"]) # files: target heat flux distribution - if ( 'INV_DESIGN_HEATFLUX' in special_cases and - 'TARGET_HEATFLUX' in files ) : - pull.append( files['TARGET_HEATFLUX'] ) + if "INV_DESIGN_HEATFLUX" in special_cases and "TARGET_HEATFLUX" in files: + pull.append(files["TARGET_HEATFLUX"]) # pull needed files, start folder_0 - with redirect_folder( folder[0], pull, link ) as push: + with redirect_folder(folder[0], pull, link) as push: with redirect_output(log_direct): konfig = copy.deepcopy(config) - ztate = copy.deepcopy(state) + ztate = copy.deepcopy(state) # Reset restart to original value - konfig['RESTART_SOL'] = restart_sol + konfig["RESTART_SOL"] = restart_sol dst = os.getcwd() - dst = os.path.abspath(dst).rstrip('/')+'/'+'DIRECT' + dst = os.path.abspath(dst).rstrip("/") + "/" + "DIRECT" # make unix link string = "ln -s " + src + " " + dst stringlist = string.split() subprocess.Popen(stringlist) - for i in range(len(weight_list)-1): + for i in range(len(weight_list) - 1): konfig = copy.deepcopy(config) - ztate = copy.deepcopy(state) + ztate = copy.deepcopy(state) - konfig.SOLUTION_FILENAME = solution_flow_list[i+1] + konfig.SOLUTION_FILENAME = solution_flow_list[i + 1] # delete direct solution file from previous point - if 'DIRECT' in ztate.FILES: + if "DIRECT" in ztate.FILES: del ztate.FILES.DIRECT - if 'FLOW_META' in ztate.FILES: + if "FLOW_META" in ztate.FILES: del ztate.FILES.FLOW_META # use direct solution file from relevant point - if 'MULTIPOINT_DIRECT' in state.FILES and state.FILES.MULTIPOINT_DIRECT[i+1]: - ztate.FILES['DIRECT'] = state.FILES.MULTIPOINT_DIRECT[i+1] + if "MULTIPOINT_DIRECT" in state.FILES and state.FILES.MULTIPOINT_DIRECT[i + 1]: + ztate.FILES["DIRECT"] = state.FILES.MULTIPOINT_DIRECT[i + 1] # use flow.meta file from relevant point - if 'MULTIPOINT_FLOW_META' in state.FILES and state.FILES.MULTIPOINT_FLOW_META[i+1]: - ztate.FILES['FLOW_META'] = state.FILES.MULTIPOINT_FLOW_META[i+1] + if ( + "MULTIPOINT_FLOW_META" in state.FILES + and state.FILES.MULTIPOINT_FLOW_META[i + 1] + ): + ztate.FILES["FLOW_META"] = state.FILES.MULTIPOINT_FLOW_META[i + 1] # use mesh file from relevant point - if 'MULTIPOINT_MESH_FILENAME' in ztate.FILES: - ztate.FILES.MESH = ztate.FILES.MULTIPOINT_MESH_FILENAME[i+1] - konfig.MESH_FILENAME= ztate.FILES.MULTIPOINT_MESH_FILENAME[i+1] - konfig['DV_VALUE_OLD'] = dv_value_old + if "MULTIPOINT_MESH_FILENAME" in ztate.FILES: + ztate.FILES.MESH = ztate.FILES.MULTIPOINT_MESH_FILENAME[i + 1] + konfig.MESH_FILENAME = ztate.FILES.MULTIPOINT_MESH_FILENAME[i + 1] + konfig["DV_VALUE_OLD"] = dv_value_old files = ztate.FILES link = [] pull = [] # files: mesh - name = files['MESH'] - name = su2io.expand_part(name,konfig) + name = files["MESH"] + name = su2io.expand_part(name, konfig) link.extend(name) # files: direction solution - if 'DIRECT' in files: - name = files['DIRECT'] - name = su2io.expand_time(name,konfig) - link.extend( name ) + if "DIRECT" in files: + name = files["DIRECT"] + name = su2io.expand_time(name, konfig) + link.extend(name) else: - konfig['RESTART_SOL'] = 'NO' + konfig["RESTART_SOL"] = "NO" # files: meta data for the flow - if 'FLOW_META' in files: - pull.append(files['FLOW_META']) + if "FLOW_META" in files: + pull.append(files["FLOW_META"]) # pull needed files, start folder_1 - with redirect_folder( folder[i+1], pull, link ) as push: + with redirect_folder(folder[i + 1], pull, link) as push: with redirect_output(log_direct): # Perform deformation on multipoint mesh - if 'MULTIPOINT_MESH_FILENAME' in state.FILES: - info = update_mesh(konfig,ztate) + if "MULTIPOINT_MESH_FILENAME" in state.FILES: + info = update_mesh(konfig, ztate) # Update config values - konfig.AOA = aoa_list[i+1] - konfig.SIDESLIP_ANGLE = sideslip_list[i+1] - konfig.MACH_NUMBER = mach_list[i+1] - konfig.REYNOLDS_NUMBER = reynolds_list[i+1] - konfig.FREESTREAM_TEMPERATURE = freestream_temp_list[i+1] - konfig.FREESTREAM_PRESSURE = freestream_press_list[i+1] - konfig.TARGET_CL = target_cl_list[i+1] - orig_marker_outlet = config['MARKER_OUTLET'] - orig_marker_outlet = orig_marker_outlet.replace("(", "").replace(")", "").split(',') - new_marker_outlet = "(" + orig_marker_outlet[0] + "," + outlet_value_list[i+1] + ")" + konfig.AOA = aoa_list[i + 1] + konfig.SIDESLIP_ANGLE = sideslip_list[i + 1] + konfig.MACH_NUMBER = mach_list[i + 1] + konfig.REYNOLDS_NUMBER = reynolds_list[i + 1] + konfig.FREESTREAM_TEMPERATURE = freestream_temp_list[i + 1] + konfig.FREESTREAM_PRESSURE = freestream_press_list[i + 1] + konfig.TARGET_CL = target_cl_list[i + 1] + orig_marker_outlet = config["MARKER_OUTLET"] + orig_marker_outlet = ( + orig_marker_outlet.replace("(", "").replace(")", "").split(",") + ) + new_marker_outlet = ( + "(" + orig_marker_outlet[0] + "," + outlet_value_list[i + 1] + ")" + ) konfig.MARKER_OUTLET = new_marker_outlet ztate.FUNCTIONS.clear() # rename meta data to flow.meta - if 'FLOW_META' in ztate.FILES: - ztate.FILES['FLOW_META'] = 'flow.meta' - os.rename(ztate.FILES.MULTIPOINT_FLOW_META[i+1], 'flow.meta') + if "FLOW_META" in ztate.FILES: + ztate.FILES["FLOW_META"] = "flow.meta" + os.rename(ztate.FILES.MULTIPOINT_FLOW_META[i + 1], "flow.meta") - func[i+1] = aerodynamics(konfig,ztate) + func[i + 1] = aerodynamics(konfig, ztate) dst = os.getcwd() # revert name of flow.meta file to multipoint name - if os.path.exists('flow.meta'): - os.rename('flow.meta', flow_meta_list[i+1]) - ztate.FILES['FLOW_META'] = flow_meta_list[i+1] - dst_flow_meta = os.path.abspath(dst).rstrip('/')+'/'+ztate.FILES['FLOW_META'] - push.append(ztate.FILES['FLOW_META']) + if os.path.exists("flow.meta"): + os.rename("flow.meta", flow_meta_list[i + 1]) + ztate.FILES["FLOW_META"] = flow_meta_list[i + 1] + dst_flow_meta = ( + os.path.abspath(dst).rstrip("/") + + "/" + + ztate.FILES["FLOW_META"] + ) + push.append(ztate.FILES["FLOW_META"]) # direct files to push - dst_direct = os.path.abspath(dst).rstrip('/')+'/'+ztate.FILES['DIRECT'] - name = ztate.FILES['DIRECT'] - name = su2io.expand_zones(name,konfig) - name = su2io.expand_time(name,konfig) + dst_direct = ( + os.path.abspath(dst).rstrip("/") + "/" + ztate.FILES["DIRECT"] + ) + name = ztate.FILES["DIRECT"] + name = su2io.expand_zones(name, konfig) + name = su2io.expand_time(name, konfig) push.extend(name) - if 'MULTIPOINT_MESH_FILENAME' in state.FILES: + if "MULTIPOINT_MESH_FILENAME" in state.FILES: # Mesh files to push - dst_mesh = os.path.abspath(dst).rstrip('/')+'/'+ztate.FILES['MESH'] - name = ztate.FILES['MESH'] - name = su2io.expand_part(name,konfig) + dst_mesh = ( + os.path.abspath(dst).rstrip("/") + "/" + ztate.FILES["MESH"] + ) + name = ztate.FILES["MESH"] + name = su2io.expand_part(name, konfig) push.extend(name) - # Link direct solution to MULTIPOINT_# folder src = os.getcwd() - src_direct = os.path.abspath(src).rstrip('/')+'/'+ztate.FILES['DIRECT'] + src_direct = os.path.abspath(src).rstrip("/") + "/" + ztate.FILES["DIRECT"] # make unix link os.symlink(src_direct, dst_direct) # If the mesh doesn't already exist, link it - if 'MULTIPOINT_MESH_FILENAME' in state.FILES: - src_mesh = os.path.abspath(src).rstrip('/')+'/'+ztate.FILES['MESH'] + if "MULTIPOINT_MESH_FILENAME" in state.FILES: + src_mesh = os.path.abspath(src).rstrip("/") + "/" + ztate.FILES["MESH"] if not os.path.exists(src_mesh): os.symlink(src_mesh, dst_mesh) # link flow.meta - if 'MULTIPOINT_FLOW_META' in state.FILES: - src_flow_meta = os.path.abspath(src).rstrip('/')+'/'+ztate.FILES['FLOW_META'] + if "MULTIPOINT_FLOW_META" in state.FILES: + src_flow_meta = ( + os.path.abspath(src).rstrip("/") + "/" + ztate.FILES["FLOW_META"] + ) if not os.path.exists(src_flow_meta): os.symlink(src_flow_meta, dst_flow_meta) # Update MULTIPOINT_DIRECT in state.FILES state.FILES.MULTIPOINT_DIRECT = solution_flow_list - if 'FLOW_META' in state.FILES: + if "FLOW_META" in state.FILES: state.FILES.MULTIPOINT_FLOW_META = flow_meta_list # ---------------------------------------------------- @@ -727,20 +776,21 @@ def multipoint( config, state=None, step=1e-2 ): # ---------------------------------------------------- for derv_name in su2io.optnames_multi: - matches = [ k for k in opt_names if k in derv_name ] - if not len(matches) == 1: continue + matches = [k for k in opt_names if k in derv_name] + if not len(matches) == 1: + continue func_name = matches[0] obj_func = 0.0 for i in range(len(weight_list)): - obj_func = obj_func + float(weight_list[i])*func[i][func_name] + obj_func = obj_func + float(weight_list[i]) * func[i][func_name] state.FUNCTIONS[derv_name] = obj_func # return output funcs = su2util.ordered_bunch() for key in su2io.optnames_multi: - if key in state['FUNCTIONS']: - funcs[key] = state['FUNCTIONS'][key] + if key in state["FUNCTIONS"]: + funcs[key] = state["FUNCTIONS"][key] return funcs @@ -749,29 +799,30 @@ def multipoint( config, state=None, step=1e-2 ): # Geometric Functions # ---------------------------------------------------------------------- -def geometry( func_name, config, state=None ): - """ val = SU2.eval.geometry(config,state=None) - Evaluates geometry with the following: - SU2.run.deform() - SU2.run.geometry() +def geometry(func_name, config, state=None): + """val = SU2.eval.geometry(config,state=None) + + Evaluates geometry with the following: + SU2.run.deform() + SU2.run.geometry() - Assumptions: - Config is already setup for deformation. - Mesh may or may not be deformed. - Updates config and state by reference. - Redundancy if state.FUNCTIONS does not have func_name. + Assumptions: + Config is already setup for deformation. + Mesh may or may not be deformed. + Updates config and state by reference. + Redundancy if state.FUNCTIONS does not have func_name. - Executes in: - ./GEOMETRY + Executes in: + ./GEOMETRY - Inputs: - config - an SU2 config - state - optional, an SU2 state + Inputs: + config - an SU2 config + state - optional, an SU2 state - Outputs: - Bunch() of functions with keys of objective function names - and values of objective function floats. + Outputs: + Bunch() of functions with keys of objective function names + and values of objective function floats. """ # ---------------------------------------------------- @@ -780,13 +831,13 @@ def geometry( func_name, config, state=None ): # initialize state = su2io.State(state) - if not 'MESH' in state.FILES: - state.FILES.MESH = config['MESH_FILENAME'] + if not "MESH" in state.FILES: + state.FILES.MESH = config["MESH_FILENAME"] special_cases = su2io.get_specialCases(config) # console output - if config.get('CONSOLE','VERBOSE') in ['QUIET','CONCISE']: - log_geom = 'log_Geometry.out' + if config.get("CONSOLE", "VERBOSE") in ["QUIET", "CONCISE"]: + log_geom = "log_Geometry.out" else: log_geom = None @@ -795,8 +846,7 @@ def geometry( func_name, config, state=None ): # ---------------------------------------------------- # does decomposition and deformation - #info = update_mesh(config,state) - + # info = update_mesh(config,state) # ---------------------------------------------------- # Geometry Solution @@ -804,28 +854,29 @@ def geometry( func_name, config, state=None ): # redundancy check geometry_done = func_name in state.FUNCTIONS - #geometry_done = all([key in state.FUNCTIONS for key in su2io.optnames_geo]) + # geometry_done = all([key in state.FUNCTIONS for key in su2io.optnames_geo]) if not geometry_done: # files to pull files = state.FILES - pull = []; link = [] + pull = [] + link = [] # files: mesh - name = files['MESH'] - name = su2io.expand_part(name,config) + name = files["MESH"] + name = su2io.expand_part(name, config) link.extend(name) # update function name ## TODO # output redirection - with redirect_folder( 'GEOMETRY', pull, link ) as push: + with redirect_folder("GEOMETRY", pull, link) as push: with redirect_output(log_geom): # setup config config.GEO_PARAM = func_name - config.GEO_MODE = 'FUNCTION' + config.GEO_MODE = "FUNCTION" # # RUN GEOMETRY SOLUTION # # info = su2run.geometry(config) @@ -840,38 +891,37 @@ def geometry( func_name, config, state=None ): # return output funcs = su2util.ordered_bunch() for key in su2io.optnames_geo: - if key in state['FUNCTIONS']: - funcs[key] = state['FUNCTIONS'][key] + if key in state["FUNCTIONS"]: + funcs[key] = state["FUNCTIONS"][key] return funcs #: def geometry() +def update_mesh(config, state=None): + """SU2.eval.update_mesh(config,state=None) -def update_mesh(config,state=None): - """ SU2.eval.update_mesh(config,state=None) + updates mesh with the following: + SU2.run.deform() - updates mesh with the following: - SU2.run.deform() + Assumptions: + Config is already setup for deformation. + Mesh may or may not be deformed. + Updates config and state by reference. - Assumptions: - Config is already setup for deformation. - Mesh may or may not be deformed. - Updates config and state by reference. + Executes in: + ./DECOMP and ./DEFORM - Executes in: - ./DECOMP and ./DEFORM + Inputs: + config - an SU2 config + state - optional, an SU2 state - Inputs: - config - an SU2 config - state - optional, an SU2 state + Outputs: + nothing - Outputs: - nothing - - Modifies: - config and state by reference + Modifies: + config and state by reference """ # ---------------------------------------------------- @@ -880,37 +930,36 @@ def update_mesh(config,state=None): # initialize state = su2io.State(state) - if not 'MESH' in state.FILES: - state.FILES.MESH = config['MESH_FILENAME'] + if not "MESH" in state.FILES: + state.FILES.MESH = config["MESH_FILENAME"] special_cases = su2io.get_specialCases(config) # console output - if config.get('CONSOLE','VERBOSE') in ['QUIET','CONCISE']: - log_decomp = 'log_Decomp.out' - log_deform = 'log_Deform.out' + if config.get("CONSOLE", "VERBOSE") in ["QUIET", "CONCISE"]: + log_decomp = "log_Decomp.out" + log_deform = "log_Deform.out" else: log_decomp = None log_deform = None - # ---------------------------------------------------- # Deformation # ---------------------------------------------------- # redundancy check - deform_set = config['DV_KIND'] == config['DEFINITION_DV']['KIND'] - deform_todo = not config['DV_VALUE_NEW'] == config['DV_VALUE_OLD'] + deform_set = config["DV_KIND"] == config["DEFINITION_DV"]["KIND"] + deform_todo = not config["DV_VALUE_NEW"] == config["DV_VALUE_OLD"] if deform_set and deform_todo: # files to pull pull = [] - link = config['MESH_FILENAME'] - link = su2io.expand_part(link,config) + link = config["MESH_FILENAME"] + link = su2io.expand_part(link, config) - pull.extend(config.get('CONFIG_LIST',[])) + pull.extend(config.get("CONFIG_LIST", [])) # output redirection - with redirect_folder('DEFORM',pull,link) as push: + with redirect_folder("DEFORM", pull, link) as push: with redirect_output(log_deform): # # RUN DEFORMATION # # @@ -919,8 +968,8 @@ def update_mesh(config,state=None): # data to push meshname = info.FILES.MESH - names = su2io.expand_part( meshname , config ) - push.extend( names ) + names = su2io.expand_part(meshname, config) + push.extend(names) #: with redirect output @@ -930,4 +979,3 @@ def update_mesh(config,state=None): #: if not redundant return - diff --git a/SU2_PY/SU2/eval/gradients.py b/SU2_PY/SU2/eval/gradients.py index 739001f24e4..f768fa69e90 100644 --- a/SU2_PY/SU2/eval/gradients.py +++ b/SU2_PY/SU2/eval/gradients.py @@ -3,7 +3,7 @@ ## \file gradients.py # \brief python package for gradients # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -30,8 +30,8 @@ # ---------------------------------------------------------------------- import os, sys, shutil, copy, subprocess -from .. import run as su2run -from .. import io as su2io +from .. import run as su2run +from .. import io as su2io from .. import util as su2util from .functions import function, update_mesh from ..io import redirect_folder, redirect_output @@ -41,99 +41,101 @@ # Main Gradient Interface # ---------------------------------------------------------------------- -def gradient( func_name, method, config, state=None ): - """ val = SU2.eval.grad(func_name,method,config,state=None) - Evaluates the aerodynamic gradients. +def gradient(func_name, method, config, state=None): + """val = SU2.eval.grad(func_name,method,config,state=None) - Wraps: - SU2.eval.adjoint() - SU2.eval.findiff() + Evaluates the aerodynamic gradients. - Assumptions: - Config is already setup for deformation. - Mesh need not be deformed. - Updates config and state by reference. - Redundancy if state.GRADIENTS has the key func_name. + Wraps: + SU2.eval.adjoint() + SU2.eval.findiff() - Executes in: - ./ADJOINT_* or ./FINDIFF + Assumptions: + Config is already setup for deformation. + Mesh need not be deformed. + Updates config and state by reference. + Redundancy if state.GRADIENTS has the key func_name. - Inputs: - func_name - SU2 objective function name - method - 'CONTINUOUS_ADJOINT' or 'FINDIFF' or 'DISCRETE_ADJOINT' - config - an SU2 config - state - optional, an SU2 state + Executes in: + ./ADJOINT_* or ./FINDIFF - Outputs: - A list of floats of gradient values + Inputs: + func_name - SU2 objective function name + method - 'CONTINUOUS_ADJOINT' or 'FINDIFF' or 'DISCRETE_ADJOINT' + config - an SU2 config + state - optional, an SU2 state + + Outputs: + A list of floats of gradient values """ # Initialize grads = {} state = su2io.State(state) - if func_name == 'ALL': + if func_name == "ALL": raise Exception("func_name = 'ALL' not yet supported") func_output = func_name - if (type(func_name)==list): - if (config.OPT_COMBINE_OBJECTIVE=="YES"): - func_output = 'COMBO' + if type(func_name) == list: + if config.OPT_COMBINE_OBJECTIVE == "YES": + func_output = "COMBO" else: func_name = func_name[0] else: - config.OPT_COMBINE_OBJECTIVE="NO" + config.OPT_COMBINE_OBJECTIVE = "NO" config.OBJECTIVE_WEIGHT = "1.0" # redundancy check - if not func_output in state['GRADIENTS']: + if not func_output in state["GRADIENTS"]: # Adjoint Gradients - if any([method == 'CONTINUOUS_ADJOINT', method == 'DISCRETE_ADJOINT']): + if any([method == "CONTINUOUS_ADJOINT", method == "DISCRETE_ADJOINT"]): # Aerodynamics if func_output in su2io.historyOutFields: - if su2io.historyOutFields[func_output]['TYPE'] == 'COEFFICIENT': - grads = adjoint( func_name, config, state ) + if su2io.historyOutFields[func_output]["TYPE"] == "COEFFICIENT": + grads = adjoint(func_name, config, state) elif func_name in su2io.historyOutFields: - if su2io.historyOutFields[func_name]['TYPE'] == 'COEFFICIENT': - grads = adjoint( func_name, config, state ) + if su2io.historyOutFields[func_name]["TYPE"] == "COEFFICIENT": + grads = adjoint(func_name, config, state) # Stability elif func_output in su2io.optnames_stab: - grads = stability( func_name, config, state ) + grads = stability(func_name, config, state) # Multipoint elif func_output in su2io.optnames_multi: - grads = multipoint( func_name, config, state ) + grads = multipoint(func_name, config, state) # Geometry (actually a finite difference) elif func_output in su2io.optnames_geo: - grads = geometry( func_name, config, state ) + grads = geometry(func_name, config, state) else: - raise Exception('unknown function name: %s' % func_name) + raise Exception("unknown function name: %s" % func_name) # Finite Difference Gradients - elif method == 'FINDIFF': - grads = findiff( config, state ) + elif method == "FINDIFF": + grads = findiff(config, state) - elif method == 'DIRECTDIFF': - grad = directdiff (config , state ) + elif method == "DIRECTDIFF": + grad = directdiff(config, state) else: - raise Exception('unrecognized gradient method') + raise Exception("unrecognized gradient method") # store - state['GRADIENTS'].update(grads) + state["GRADIENTS"].update(grads) # if not redundant # prepare output - grads_out = state['GRADIENTS'][func_output] + grads_out = state["GRADIENTS"][func_output] return copy.deepcopy(grads_out) + #: def gradient() @@ -141,34 +143,35 @@ def gradient( func_name, method, config, state=None ): # Adjoint Gradients # ---------------------------------------------------------------------- -def adjoint( func_name, config, state=None ): - """ vals = SU2.eval.adjoint(func_name,config,state=None) - - Evaluates the aerodynamics gradients using the - adjoint methodology with: - SU2.eval.func() - SU2.run.deform() - SU2.run.direct() - SU2.run.adjoint() - - Assumptions: - Config is already setup for deformation. - Mesh may or may not be deformed. - Updates config and state by reference. - Adjoint Redundancy if state.GRADIENTS has key func_name. - Direct Redundancy if state.FUNCTIONS has key func_name. - - Executes in: - ./ADJOINT_ - - Inputs: - func_name - SU2 objective function name - config - an SU2 config - state - optional, an SU2 state - - Outputs: - A Bunch() with keys of objective function names - and values of list of floats of gradient values + +def adjoint(func_name, config, state=None): + """vals = SU2.eval.adjoint(func_name,config,state=None) + + Evaluates the aerodynamics gradients using the + adjoint methodology with: + SU2.eval.func() + SU2.run.deform() + SU2.run.direct() + SU2.run.adjoint() + + Assumptions: + Config is already setup for deformation. + Mesh may or may not be deformed. + Updates config and state by reference. + Adjoint Redundancy if state.GRADIENTS has key func_name. + Direct Redundancy if state.FUNCTIONS has key func_name. + + Executes in: + ./ADJOINT_ + + Inputs: + func_name - SU2 objective function name + config - an SU2 config + state - optional, an SU2 state + + Outputs: + A Bunch() with keys of objective function names + and values of list of floats of gradient values """ # ---------------------------------------------------- @@ -181,15 +184,16 @@ def adjoint( func_name, config, state=None ): # When a list of objectives is used, they are combined # and the output name is 'COMBO' - multi_objective = (type(func_name)==list) + multi_objective = type(func_name) == list func_output = func_name - if multi_objective: func_output = 'COMBO' + if multi_objective: + func_output = "COMBO" - ADJ_NAME = 'ADJOINT_'+func_output + ADJ_NAME = "ADJOINT_" + func_output # console output - if config.get('CONSOLE','VERBOSE') in ['QUIET','CONCISE']: - log_adjoint = 'log_Adjoint.out' + if config.get("CONSOLE", "VERBOSE") in ["QUIET", "CONCISE"]: + log_adjoint = "log_Adjoint.out" else: log_adjoint = None @@ -198,8 +202,8 @@ def adjoint( func_name, config, state=None ): # ---------------------------------------------------- # master redundancy check - if func_output in state['GRADIENTS']: - grads = state['GRADIENTS'] + if func_output in state["GRADIENTS"]: + grads = state["GRADIENTS"] return copy.deepcopy(grads) # ---------------------------------------------------- @@ -207,13 +211,13 @@ def adjoint( func_name, config, state=None ): # ---------------------------------------------------- # run (includes redundancy checks) - function( func_name, config, state ) + function(func_name, config, state) # ---------------------------------------------------- # Adaptation (not implemented) # ---------------------------------------------------- - #if not state.['ADAPTED_ADJOINT']: + # if not state.['ADAPTED_ADJOINT']: # config = su2run.adaptation(config) # state['ADAPTED_FUNC'] = True @@ -224,118 +228,132 @@ def adjoint( func_name, config, state=None ): konfig = copy.deepcopy(config) # Set correct starting time for reverse sweep - if 'TIME_ITER' in state.WND_CAUCHY_DATA: # Use Convergence data, if we have already a direct run - konfig['TIME_ITER'] = state.WND_CAUCHY_DATA['TIME_ITER'] - konfig['ITER_AVERAGE_OBJ'] = state.WND_CAUCHY_DATA['ITER_AVERAGE_OBJ'] - konfig['UNST_ADJOINT_ITER'] = state.WND_CAUCHY_DATA['UNST_ADJOINT_ITER'] - + if ( + "TIME_ITER" in state.WND_CAUCHY_DATA + ): # Use Convergence data, if we have already a direct run + konfig["TIME_ITER"] = state.WND_CAUCHY_DATA["TIME_ITER"] + konfig["ITER_AVERAGE_OBJ"] = state.WND_CAUCHY_DATA["ITER_AVERAGE_OBJ"] + konfig["UNST_ADJOINT_ITER"] = state.WND_CAUCHY_DATA["UNST_ADJOINT_ITER"] # files to pull - files = state['FILES'] - pull = []; link = [] + files = state["FILES"] + pull = [] + link = [] # files: mesh - name = files['MESH'] - name = su2io.expand_part(name,konfig) + name = files["MESH"] + name = su2io.expand_part(name, konfig) link.extend(name) # files: direct solution - name = files['DIRECT'] - name = su2io.expand_zones(name,konfig) - name = su2io.expand_time(name,konfig) + name = files["DIRECT"] + name = su2io.expand_zones(name, konfig) + name = su2io.expand_time(name, konfig) link.extend(name) # files restart - if config.get('TIME_DOMAIN', 'NO') == 'YES' and config.get('RESTART_SOL', 'NO') == 'YES': - if 'RESTART_FILE_1' in files: - name = files['RESTART_FILE_1'] - name = su2io.expand_part(name, config) - link.extend(name) - if 'RESTART_FILE_1' in files: # not the case for 1st order time stepping - name = files['RESTART_FILE_2'] - name = su2io.expand_part(name, config) - link.extend(name) - - if 'FLOW_META' in files: - pull.append(files['FLOW_META']) + if ( + config.get("TIME_DOMAIN", "NO") == "YES" + and config.get("RESTART_SOL", "NO") == "YES" + ): + if "RESTART_FILE_1" in files: + name = files["RESTART_FILE_1"] + name = su2io.expand_part(name, config) + link.extend(name) + if "RESTART_FILE_1" in files: # not the case for 1st order time stepping + name = files["RESTART_FILE_2"] + name = su2io.expand_part(name, config) + link.extend(name) + + if "FLOW_META" in files: + pull.append(files["FLOW_META"]) # files: adjoint solution if ADJ_NAME in files: name = files[ADJ_NAME] - name = su2io.expand_zones(name,konfig) - name = su2io.expand_time(name,konfig) + name = su2io.expand_zones(name, konfig) + name = su2io.expand_time(name, konfig) link.extend(name) else: - config['RESTART_SOL'] = 'NO' #Can this be deleted? - if config.get('TIME_DOMAIN', 'NO') != 'YES': # rules out steady state optimization special cases. - konfig['RESTART_SOL'] = 'NO' # for shape optimization with restart files. + config["RESTART_SOL"] = "NO" # Can this be deleted? + if ( + config.get("TIME_DOMAIN", "NO") != "YES" + ): # rules out steady state optimization special cases. + konfig["RESTART_SOL"] = "NO" # for shape optimization with restart files. # Restart solution gets handled just before solver starts for unsteady optimization # files: target equivarea adjoint weights - if 'EQUIV_AREA' in special_cases: - pull.append(files['TARGET_EA']) + if "EQUIV_AREA" in special_cases: + pull.append(files["TARGET_EA"]) # files: target pressure coefficient - if 'INV_DESIGN_CP' in special_cases: - pull.append(files['TARGET_CP']) + if "INV_DESIGN_CP" in special_cases: + pull.append(files["TARGET_CP"]) # files: target heat flux coefficient - if 'INV_DESIGN_HEATFLUX' in special_cases: - pull.append(files['TARGET_HEATFLUX']) - - if not 'OUTPUT_FILES' in config: - config['OUTPUT_FILES'] = ['RESTART'] + if "INV_DESIGN_HEATFLUX" in special_cases: + pull.append(files["TARGET_HEATFLUX"]) - if not 'SURFACE_CSV' in config['OUTPUT_FILES']: - config['OUTPUT_FILES'].append('SURFACE_CSV') + if not "OUTPUT_FILES" in config: + config["OUTPUT_FILES"] = ["RESTART"] + if not "SURFACE_CSV" in config["OUTPUT_FILES"]: + config["OUTPUT_FILES"].append("SURFACE_CSV") # output redirection - with redirect_folder( ADJ_NAME, pull, link ) as push: + with redirect_folder(ADJ_NAME, pull, link) as push: with redirect_output(log_adjoint): # Format objective list in config if multi_objective: - config['OBJECTIVE_FUNCTION'] = ", ".join(func_name) #Can this be deleted? - konfig['OBJECTIVE_FUNCTION'] = ", ".join(func_name) + config["OBJECTIVE_FUNCTION"] = ", ".join( + func_name + ) # Can this be deleted? + konfig["OBJECTIVE_FUNCTION"] = ", ".join(func_name) else: - config['OBJECTIVE_FUNCTION'] = func_name #Can this be deleted? - konfig['OBJECTIVE_FUNCTION'] = func_name + config["OBJECTIVE_FUNCTION"] = func_name # Can this be deleted? + konfig["OBJECTIVE_FUNCTION"] = func_name # # RUN ADJOINT SOLUTION # # # We do not want a restart in adjoint run, we want that the adjoint run computes only up to the restart iteration of the primal run. restart_sol_activated = False - if konfig.get('TIME_DOMAIN', 'NO') == 'YES' and konfig.get('RESTART_SOL', 'NO') == 'YES': + if ( + konfig.get("TIME_DOMAIN", "NO") == "YES" + and konfig.get("RESTART_SOL", "NO") == "YES" + ): restart_sol_activated = True - original_time_iter = konfig['TIME_ITER'] - konfig['TIME_ITER'] = konfig['TIME_ITER'] - int(konfig['RESTART_ITER']) - konfig.RESTART_SOL = 'NO' + original_time_iter = konfig["TIME_ITER"] + konfig["TIME_ITER"] = konfig["TIME_ITER"] - int(konfig["RESTART_ITER"]) + konfig.RESTART_SOL = "NO" info = su2run.adjoint(konfig) # Workaround, since expandTime relies on UNST_ADJOINT_ITER to determine number of solution files. if restart_sol_activated: - konfig['UNST_ADJOINT_ITER'] = original_time_iter - int(konfig['RESTART_ITER']) - su2io.restart2solution(konfig,info) + konfig["UNST_ADJOINT_ITER"] = original_time_iter - int( + konfig["RESTART_ITER"] + ) + su2io.restart2solution(konfig, info) state.update(info) # Gradient Projection - info = su2run.projection(konfig,state) + info = su2run.projection(konfig, state) state.update(info) # solution files to push name = state.FILES[ADJ_NAME] - name = su2io.expand_zones(name,konfig) - name = su2io.expand_time(name,konfig) + name = su2io.expand_zones(name, konfig) + name = su2io.expand_time(name, konfig) push.extend(name) #: with output redirection # return output grads = su2util.ordered_bunch() - grads[func_output] = state['GRADIENTS'][func_output] + grads[func_output] = state["GRADIENTS"][func_output] return grads + #: def adjoint() @@ -343,10 +361,10 @@ def adjoint( func_name, config, state=None ): # Stability Functions # ---------------------------------------------------------------------- -def stability( func_name, config, state=None, step=1e-2 ): +def stability(func_name, config, state=None, step=1e-2): - folder = 'STABILITY' # os.path.join('STABILITY',func_name) #STABILITY/D_MOMENT_Y_D_ALPHA/ + folder = "STABILITY" # os.path.join('STABILITY',func_name) #STABILITY/D_MOMENT_Y_D_ALPHA/ # ---------------------------------------------------- # Initialize @@ -354,21 +372,21 @@ def stability( func_name, config, state=None, step=1e-2 ): # initialize state = su2io.State(state) - if not 'MESH' in state.FILES: - state.FILES.MESH = config['MESH_FILENAME'] + if not "MESH" in state.FILES: + state.FILES.MESH = config["MESH_FILENAME"] special_cases = su2io.get_specialCases(config) # find base func name - matches = [ k for k in su2io.optnames_aero if k in func_name ] + matches = [k for k in su2io.optnames_aero if k in func_name] if not len(matches) == 1: - raise Exception('could not find stability function name') + raise Exception("could not find stability function name") base_name = matches[0] - ADJ_NAME = 'ADJOINT_'+base_name + ADJ_NAME = "ADJOINT_" + base_name # console output - if config.get('CONSOLE','VERBOSE') in ['QUIET','CONCISE']: - log_direct = 'log_Direct.out' + if config.get("CONSOLE", "VERBOSE") in ["QUIET", "CONCISE"]: + log_direct = "log_Direct.out" else: log_direct = None @@ -377,15 +395,14 @@ def stability( func_name, config, state=None, step=1e-2 ): # ---------------------------------------------------- # does decomposition and deformation - info = update_mesh(config,state) + info = update_mesh(config, state) # ---------------------------------------------------- # CENTRAL POINT # ---------------------------------------------------- # will run in ADJOINT/ - grads_0 = gradient(base_name,'CONTINUOUS_ADJOINT',config,state) - + grads_0 = gradient(base_name, "CONTINUOUS_ADJOINT", config, state) # ---------------------------------------------------- # Run Forward Point @@ -393,11 +410,12 @@ def stability( func_name, config, state=None, step=1e-2 ): # files to pull files = state.FILES - pull = []; link = [] + pull = [] + link = [] # files: mesh - name = files['MESH'] - name = su2io.expand_part(name,config) + name = files["MESH"] + name = su2io.expand_part(name, config) link.extend(name) # files: direct solution @@ -406,39 +424,36 @@ def stability( func_name, config, state=None, step=1e-2 ): # files: adjoint solution if ADJ_NAME in files: name = files[ADJ_NAME] - name = su2io.expand_time(name,config) + name = su2io.expand_time(name, config) link.extend(name) else: - config['RESTART_SOL'] = 'NO' + config["RESTART_SOL"] = "NO" # files: target equivarea adjoint weights ## DO NOT PULL EQUIVAREA WEIGHTS, use the one in STABILITY/ - # pull needed files, start folder - with redirect_folder( folder, pull, link ) as push: + with redirect_folder(folder, pull, link) as push: with redirect_output(log_direct): konfig = copy.deepcopy(config) - ztate = copy.deepcopy(state) + ztate = copy.deepcopy(state) # TODO: GENERALIZE konfig.AOA = konfig.AOA + step # let's start somethin somthin del ztate.GRADIENTS[base_name] - #ztate.find_files(konfig) + # ztate.find_files(konfig) # the gradient - grads_1 = gradient(base_name,'CONTINUOUS_ADJOINT',konfig,ztate) - + grads_1 = gradient(base_name, "CONTINUOUS_ADJOINT", konfig, ztate) # ---------------------------------------------------- # DIFFERENCING # ---------------------------------------------------- - grads = [ ( g_1 - g_0 ) / step - for g_1,g_0 in zip(grads_1,grads_0) ] + grads = [(g_1 - g_0) / step for g_1, g_0 in zip(grads_1, grads_0)] state.GRADIENTS[func_name] = grads grads_out = su2util.ordered_bunch() @@ -451,20 +466,44 @@ def stability( func_name, config, state=None, step=1e-2 ): # Multipoint Functions # ---------------------------------------------------------------------- -def multipoint( func_name, config, state=None, step=1e-2 ): - mach_list = config['MULTIPOINT_MACH_NUMBER'].replace("(", "").replace(")", "").split(',') - reynolds_list = config['MULTIPOINT_REYNOLDS_NUMBER'].replace("(", "").replace(")", "").split(',') - freestream_temp_list = config['MULTIPOINT_FREESTREAM_TEMPERATURE'].replace("(", "").replace(")", "").split(',') - freestream_press_list = config['MULTIPOINT_FREESTREAM_PRESSURE'].replace("(", "").replace(")", "").split(',') - aoa_list = config['MULTIPOINT_AOA'].replace("(", "").replace(")", "").split(',') - sideslip_list = config['MULTIPOINT_SIDESLIP_ANGLE'].replace("(", "").replace(")", "").split(',') - target_cl_list = config['MULTIPOINT_TARGET_CL'].replace("(", "").replace(")", "").split(',') - weight_list = config['MULTIPOINT_WEIGHT'].replace("(", "").replace(")", "").split(',') +def multipoint(func_name, config, state=None, step=1e-2): + + mach_list = ( + config["MULTIPOINT_MACH_NUMBER"].replace("(", "").replace(")", "").split(",") + ) + reynolds_list = ( + config["MULTIPOINT_REYNOLDS_NUMBER"] + .replace("(", "") + .replace(")", "") + .split(",") + ) + freestream_temp_list = ( + config["MULTIPOINT_FREESTREAM_TEMPERATURE"] + .replace("(", "") + .replace(")", "") + .split(",") + ) + freestream_press_list = ( + config["MULTIPOINT_FREESTREAM_PRESSURE"] + .replace("(", "") + .replace(")", "") + .split(",") + ) + aoa_list = config["MULTIPOINT_AOA"].replace("(", "").replace(")", "").split(",") + sideslip_list = ( + config["MULTIPOINT_SIDESLIP_ANGLE"].replace("(", "").replace(")", "").split(",") + ) + target_cl_list = ( + config["MULTIPOINT_TARGET_CL"].replace("(", "").replace(")", "").split(",") + ) + weight_list = ( + config["MULTIPOINT_WEIGHT"].replace("(", "").replace(")", "").split(",") + ) solution_flow_list = su2io.expand_multipoint(config.SOLUTION_FILENAME, config) solution_adj_list = su2io.expand_multipoint(config.SOLUTION_ADJ_FILENAME, config) - flow_meta_list = su2io.expand_multipoint('flow.meta', config) - restart_sol = config['RESTART_SOL'] + flow_meta_list = su2io.expand_multipoint("flow.meta", config) + restart_sol = config["RESTART_SOL"] grads = [] folder = [] for i in range(len(weight_list)): @@ -472,11 +511,11 @@ def multipoint( func_name, config, state=None, step=1e-2 ): folder.append(0) for i in range(len(weight_list)): - folder[i] = 'MULTIPOINT_' + str(i) + folder[i] = "MULTIPOINT_" + str(i) opt_names = [] for key in su2io.historyOutFields: - if su2io.historyOutFields[key]['TYPE'] == 'COEFFICIENT': + if su2io.historyOutFields[key]["TYPE"] == "COEFFICIENT": opt_names.append(key) # ---------------------------------------------------- @@ -485,31 +524,31 @@ def multipoint( func_name, config, state=None, step=1e-2 ): # initialize state = su2io.State(state) - if not 'MESH' in state.FILES: - state.FILES.MESH = config['MESH_FILENAME'] + if not "MESH" in state.FILES: + state.FILES.MESH = config["MESH_FILENAME"] special_cases = su2io.get_specialCases(config) # find base func name - matches = [ k for k in opt_names if k in func_name ] + matches = [k for k in opt_names if k in func_name] if not len(matches) == 1: - raise Exception('could not find multipoint function name') + raise Exception("could not find multipoint function name") base_name = matches[0] - ADJ_NAME = 'ADJOINT_' + base_name - MULTIPOINT_ADJ_NAME = 'MULTIPOINT_' + ADJ_NAME + ADJ_NAME = "ADJOINT_" + base_name + MULTIPOINT_ADJ_NAME = "MULTIPOINT_" + ADJ_NAME # console output - if config.get('CONSOLE','VERBOSE') in ['QUIET','CONCISE']: - log_direct = 'log_Direct.out' + if config.get("CONSOLE", "VERBOSE") in ["QUIET", "CONCISE"]: + log_direct = "log_Direct.out" else: log_direct = None -# # ---------------------------------------------------- -# # Update Mesh -# # ---------------------------------------------------- -# -# # does decomposition and deformation -# info = update_mesh(config,state) + # # ---------------------------------------------------- + # # Update Mesh + # # ---------------------------------------------------- + # + # # does decomposition and deformation + # info = update_mesh(config,state) # ---------------------------------------------------- # FIRST POINT @@ -531,18 +570,18 @@ def multipoint( func_name, config, state=None, step=1e-2 ): # If flow.meta file for the first point is available, rename it before using it if os.path.exists(flow_meta_list[0]): - os.rename(flow_meta_list[0], 'flow.meta') - state.FILES['FLOW_META'] = 'flow.meta' + os.rename(flow_meta_list[0], "flow.meta") + state.FILES["FLOW_META"] = "flow.meta" - grads[0] = gradient(base_name,'DISCRETE_ADJOINT',config,state) + grads[0] = gradient(base_name, "DISCRETE_ADJOINT", config, state) src = os.getcwd() - src = os.path.abspath(src).rstrip('/') + '/' + ADJ_NAME + '/' + src = os.path.abspath(src).rstrip("/") + "/" + ADJ_NAME + "/" # change name of flow.meta back to multipoint name - if os.path.exists('flow.meta'): - os.rename('flow.meta',flow_meta_list[0]) - state.FILES['FLOW_META'] = flow_meta_list[0] + if os.path.exists("flow.meta"): + os.rename("flow.meta", flow_meta_list[0]) + state.FILES["FLOW_META"] = flow_meta_list[0] # ---------------------------------------------------- # Run Multipoint @@ -550,11 +589,12 @@ def multipoint( func_name, config, state=None, step=1e-2 ): # files to pull files = state.FILES - pull = []; link = [] + pull = [] + link = [] # files: mesh - name = files['MESH'] - name = su2io.expand_part(name,config) + name = files["MESH"] + name = su2io.expand_part(name, config) link.extend(name) # files: direct solution @@ -563,127 +603,137 @@ def multipoint( func_name, config, state=None, step=1e-2 ): # files: adjoint solution if ADJ_NAME in files: name = files[ADJ_NAME] - name = su2io.expand_time(name,config) + name = su2io.expand_time(name, config) link.extend(name) solution_adj_list[0] = files[ADJ_NAME] else: - config['RESTART_SOL'] = 'NO' + config["RESTART_SOL"] = "NO" # files: target equivarea adjoint weights ## DO NOT PULL EQUIVAREA WEIGHTS, use the one in MULTIPOINT/ # pull needed files, start folder - with redirect_folder( folder[0], pull, link ) as push: + with redirect_folder(folder[0], pull, link) as push: with redirect_output(log_direct): konfig = copy.deepcopy(config) - ztate = copy.deepcopy(state) + ztate = copy.deepcopy(state) dst = os.getcwd() - dst = os.path.abspath(dst).rstrip('/')+'/' + dst = os.path.abspath(dst).rstrip("/") + "/" # make unix link string = "ln -s " + src + " " + dst string_list = string.split() subprocess.Popen(string_list) - for i in range(len(weight_list)-1): + for i in range(len(weight_list) - 1): konfig = copy.deepcopy(config) - ztate = copy.deepcopy(state) + ztate = copy.deepcopy(state) # Reset RESTART_SOL to original value - konfig['RESTART_SOL'] = restart_sol + konfig["RESTART_SOL"] = restart_sol # Set correct config option names - konfig.SOLUTION_FILENAME = solution_flow_list[i+1] - konfig.SOLUTION_ADJ_FILENAME = solution_adj_list[i+1] + konfig.SOLUTION_FILENAME = solution_flow_list[i + 1] + konfig.SOLUTION_ADJ_FILENAME = solution_adj_list[i + 1] # Delete file run in previous case if ADJ_NAME in ztate.FILES: del ztate.FILES[ADJ_NAME] # Update ADJOINT filename with MULTIPOINT_ADJOINT filename - if MULTIPOINT_ADJ_NAME in state.FILES and state.FILES[MULTIPOINT_ADJ_NAME][i+1]: - ztate.FILES[ADJ_NAME] = state.FILES[MULTIPOINT_ADJ_NAME][i+1] - - if 'MULTIPOINT_MESH_FILENAME' in ztate.FILES: - if 'deform' in ztate.FILES.MESH: - ztate.FILES.MESH = su2io.add_suffix(ztate.FILES.MULTIPOINT_MESH_FILENAME[i+1],'deform') - konfig.MESH_FILENAME= su2io.add_suffix(ztate.FILES.MULTIPOINT_MESH_FILENAME[i+1],'deform') + if ( + MULTIPOINT_ADJ_NAME in state.FILES + and state.FILES[MULTIPOINT_ADJ_NAME][i + 1] + ): + ztate.FILES[ADJ_NAME] = state.FILES[MULTIPOINT_ADJ_NAME][i + 1] + + if "MULTIPOINT_MESH_FILENAME" in ztate.FILES: + if "deform" in ztate.FILES.MESH: + ztate.FILES.MESH = su2io.add_suffix( + ztate.FILES.MULTIPOINT_MESH_FILENAME[i + 1], "deform" + ) + konfig.MESH_FILENAME = su2io.add_suffix( + ztate.FILES.MULTIPOINT_MESH_FILENAME[i + 1], "deform" + ) else: - ztate.FILES.MESH = ztate.FILES.MULTIPOINT_MESH_FILENAME[i+1] - konfig.MESH_FILENAME= ztate.FILES.MULTIPOINT_MESH_FILENAME[i+1] + ztate.FILES.MESH = ztate.FILES.MULTIPOINT_MESH_FILENAME[i + 1] + konfig.MESH_FILENAME = ztate.FILES.MULTIPOINT_MESH_FILENAME[i + 1] # use flow.meta file from relevant point - if 'MULTIPOINT_FLOW_META' in state.FILES and state.FILES.MULTIPOINT_FLOW_META[i+1]: - ztate.FILES['FLOW_META'] = state.FILES.MULTIPOINT_FLOW_META[i+1] + if ( + "MULTIPOINT_FLOW_META" in state.FILES + and state.FILES.MULTIPOINT_FLOW_META[i + 1] + ): + ztate.FILES["FLOW_META"] = state.FILES.MULTIPOINT_FLOW_META[i + 1] files = ztate.FILES link = [] - files['DIRECT'] = state.FILES.MULTIPOINT_DIRECT[i+1] + files["DIRECT"] = state.FILES.MULTIPOINT_DIRECT[i + 1] # files: mesh - name = files['MESH'] - name = su2io.expand_part(name,konfig) + name = files["MESH"] + name = su2io.expand_part(name, konfig) link.extend(name) # files: direct solution - if 'DIRECT' in files: - name = files['DIRECT'] - name = su2io.expand_time(name,konfig) - link.extend( name ) + if "DIRECT" in files: + name = files["DIRECT"] + name = su2io.expand_time(name, konfig) + link.extend(name) # files: adjoint solution if ADJ_NAME in files: name = files[ADJ_NAME] - name = su2io.expand_time(name,konfig) + name = su2io.expand_time(name, konfig) link.extend(name) else: - konfig['RESTART_SOL'] = 'NO' + konfig["RESTART_SOL"] = "NO" # files: meta data of solution - if 'FLOW_META' in files: - pull.append(files['FLOW_META']) + if "FLOW_META" in files: + pull.append(files["FLOW_META"]) # pull needed files, start folder - with redirect_folder( folder[i+1], pull, link ) as push: + with redirect_folder(folder[i + 1], pull, link) as push: with redirect_output(log_direct): # Set the multipoint options - konfig.AOA = aoa_list[i+1] - konfig.SIDESLIP_ANGLE = sideslip_list[i+1] - konfig.MACH_NUMBER = mach_list[i+1] - konfig.REYNOLDS_NUMBER = reynolds_list[i+1] - konfig.FREESTREAM_TEMPERATURE = freestream_temp_list[i+1] - konfig.FREESTREAM_PRESSURE = freestream_press_list[i+1] - konfig.TARGET_CL = target_cl_list[i+1] + konfig.AOA = aoa_list[i + 1] + konfig.SIDESLIP_ANGLE = sideslip_list[i + 1] + konfig.MACH_NUMBER = mach_list[i + 1] + konfig.REYNOLDS_NUMBER = reynolds_list[i + 1] + konfig.FREESTREAM_TEMPERATURE = freestream_temp_list[i + 1] + konfig.FREESTREAM_PRESSURE = freestream_press_list[i + 1] + konfig.TARGET_CL = target_cl_list[i + 1] # rename meta data to flow.meta - if 'FLOW_META' in ztate.FILES: - os.rename(ztate.FILES.MULTIPOINT_FLOW_META[i+1], 'flow.meta') - ztate.FILES['FLOW_META'] = 'flow.meta' + if "FLOW_META" in ztate.FILES: + os.rename(ztate.FILES.MULTIPOINT_FLOW_META[i + 1], "flow.meta") + ztate.FILES["FLOW_META"] = "flow.meta" # let's start somethin somthin ztate.GRADIENTS.clear() # the gradient - grads[i+1] = gradient(base_name,'DISCRETE_ADJOINT',konfig,ztate) + grads[i + 1] = gradient(base_name, "DISCRETE_ADJOINT", konfig, ztate) # rename meta data to multipoint name - if os.path.exists('flow.meta'): - os.rename('flow.meta', flow_meta_list[i+1]) + if os.path.exists("flow.meta"): + os.rename("flow.meta", flow_meta_list[i + 1]) # adjoint files to push dst = os.getcwd() - dst = os.path.abspath(dst).rstrip('/')+'/'+ztate.FILES[ADJ_NAME] + dst = os.path.abspath(dst).rstrip("/") + "/" + ztate.FILES[ADJ_NAME] name = ztate.FILES[ADJ_NAME] - solution_adj_list[i+1] = name - name = su2io.expand_zones(name,konfig) - name = su2io.expand_time(name,konfig) + solution_adj_list[i + 1] = name + name = su2io.expand_zones(name, konfig) + name = su2io.expand_time(name, konfig) push.extend(name) # Link adjoint solution to MULTIPOINT_# folder src = os.getcwd() - src = os.path.abspath(src).rstrip('/')+'/'+ztate.FILES[ADJ_NAME] + src = os.path.abspath(src).rstrip("/") + "/" + ztate.FILES[ADJ_NAME] # make unix link string = "ln -s " + src + " " + dst @@ -704,7 +754,9 @@ def multipoint( func_name, config, state=None, step=1e-2 ): for variable in range(len(grads[0])): grad[variable] = 0.0 for point in range(len(weight_list)): - grad[variable] = grad[variable] + float(weight_list[point])*grads[point][variable] + grad[variable] = ( + grad[variable] + float(weight_list[point]) * grads[point][variable] + ) state.GRADIENTS[func_name] = grad grads_out = su2util.ordered_bunch() @@ -717,32 +769,33 @@ def multipoint( func_name, config, state=None, step=1e-2 ): # Finite Difference Gradients # ---------------------------------------------------------------------- -def findiff( config, state=None ): - """ vals = SU2.eval.findiff(config,state=None) - Evaluates the aerodynamics gradients using - finite differencing with: - SU2.eval.func() - SU2.run.deform() - SU2.run.direct() +def findiff(config, state=None): + """vals = SU2.eval.findiff(config,state=None) + + Evaluates the aerodynamics gradients using + finite differencing with: + SU2.eval.func() + SU2.run.deform() + SU2.run.direct() - Assumptions: - Config is already setup for deformation. - Mesh may or may not be deformed. - Updates config and state by reference. - Gradient Redundancy if state.GRADIENTS has the key func_name. - Direct Redundancy if state.FUNCTIONS has key func_name. + Assumptions: + Config is already setup for deformation. + Mesh may or may not be deformed. + Updates config and state by reference. + Gradient Redundancy if state.GRADIENTS has the key func_name. + Direct Redundancy if state.FUNCTIONS has key func_name. - Executes in: - ./FINDIFF + Executes in: + ./FINDIFF - Inputs: - config - an SU2 config - state - optional, an SU2 state + Inputs: + config - an SU2 config + state - optional, an SU2 state - Outputs: - A Bunch() with keys of objective function names - and values of list of floats of gradient values + Outputs: + A Bunch() with keys of objective function names + and values of list of floats of gradient values """ # ---------------------------------------------------- @@ -752,28 +805,28 @@ def findiff( config, state=None ): # initialize state = su2io.State(state) special_cases = su2io.get_specialCases(config) - Definition_DV = config['DEFINITION_DV'] + Definition_DV = config["DEFINITION_DV"] # console output - if config.get('CONSOLE','VERBOSE') in ['QUIET','CONCISE']: - log_findiff = 'log_FinDiff.out' + if config.get("CONSOLE", "VERBOSE") in ["QUIET", "CONCISE"]: + log_findiff = "log_FinDiff.out" else: log_findiff = None # evaluate step length or set default value - if 'FIN_DIFF_STEP' in config: + if "FIN_DIFF_STEP" in config: step = float(config.FIN_DIFF_STEP) else: step = 0.001 opt_names = [] - for i in range(config['NZONES']): + for i in range(config["NZONES"]): for key in sorted(su2io.historyOutFields): - if su2io.historyOutFields[key]['TYPE'] == 'COEFFICIENT': - if (config['NZONES'] == 1): + if su2io.historyOutFields[key]["TYPE"] == "COEFFICIENT": + if config["NZONES"] == 1: opt_names.append(key) else: - opt_names.append(key + '[' + str(i) + ']') + opt_names.append(key + "[" + str(i) + "]") # ---------------------------------------------------- # Redundancy Check @@ -782,7 +835,7 @@ def findiff( config, state=None ): # master redundancy check findiff_todo = all([key in state.GRADIENTS for key in opt_names]) if findiff_todo: - grads = state['GRADIENTS'] + grads = state["GRADIENTS"] return copy.deepcopy(grads) # ---------------------------------------------------- @@ -790,17 +843,17 @@ def findiff( config, state=None ): # ---------------------------------------------------- # run - func_base = function( 'ALL', config, state ) + func_base = function("ALL", config, state) # ---------------------------------------------------- # Plot Setup # ---------------------------------------------------- - grad_filename = config['GRAD_OBJFUNC_FILENAME'] - grad_filename = os.path.splitext( grad_filename )[0] - output_format = config['TABULAR_FORMAT'] + grad_filename = config["GRAD_OBJFUNC_FILENAME"] + grad_filename = os.path.splitext(grad_filename)[0] + output_format = config["TABULAR_FORMAT"] plot_extension = su2io.get_extension(output_format) - grad_filename = grad_filename + '_findiff' + plot_extension + grad_filename = grad_filename + "_findiff" + plot_extension # ---------------------------------------------------- # Finite Difference Steps @@ -810,108 +863,109 @@ def findiff( config, state=None ): konfig = copy.deepcopy(config) # check deformation setup - n_dv = sum(Definition_DV['SIZE']) - deform_set = konfig['DV_KIND'] == Definition_DV['KIND'] + n_dv = sum(Definition_DV["SIZE"]) + deform_set = konfig["DV_KIND"] == Definition_DV["KIND"] if not deform_set: dvs_base = [0.0] * n_dv - konfig.unpack_dvs(dvs_base,dvs_base) + konfig.unpack_dvs(dvs_base, dvs_base) else: - dvs_base = konfig['DV_VALUE_NEW'] + dvs_base = konfig["DV_VALUE_NEW"] # initialize gradients - func_keys = ['VARIABLE'] + opt_names + ['FINDIFF_STEP'] + func_keys = ["VARIABLE"] + opt_names + ["FINDIFF_STEP"] grads = su2util.ordered_bunch.fromkeys(func_keys) - for key in grads.keys(): grads[key] = [] + for key in grads.keys(): + grads[key] = [] # step vector - if isinstance(step,list): - assert n_dv == len(step) , 'unexpected step vector length' + if isinstance(step, list): + assert n_dv == len(step), "unexpected step vector length" else: step = [step] * n_dv # files to pull - files = state['FILES'] - pull = []; link = [] - pull.extend(config.get('CONFIG_LIST',[])) + files = state["FILES"] + pull = [] + link = [] + pull.extend(config.get("CONFIG_LIST", [])) # files: mesh - name = files['MESH'] - name = su2io.expand_part(name,konfig) + name = files["MESH"] + name = su2io.expand_part(name, konfig) link.extend(name) # files: direct solution - if 'DIRECT' in files: - name = files['DIRECT'] - name = su2io.expand_time(name,config) + if "DIRECT" in files: + name = files["DIRECT"] + name = su2io.expand_time(name, config) link.extend(name) # files: restart solution for dual-time stepping first and second order - if 'RESTART_FILE_1' in files: - name = files['RESTART_FILE_1'] + if "RESTART_FILE_1" in files: + name = files["RESTART_FILE_1"] pull.append(name) - if 'RESTART_FILE_2' in files: - name = files['RESTART_FILE_2'] + if "RESTART_FILE_2" in files: + name = files["RESTART_FILE_2"] pull.append(name) # files: target equivarea distribution - if 'EQUIV_AREA' in special_cases and 'TARGET_EA' in files: - pull.append(files['TARGET_EA']) + if "EQUIV_AREA" in special_cases and "TARGET_EA" in files: + pull.append(files["TARGET_EA"]) # files: target pressure distribution - if 'INV_DESIGN_CP' in special_cases and 'TARGET_CP' in files: - pull.append(files['TARGET_CP']) + if "INV_DESIGN_CP" in special_cases and "TARGET_CP" in files: + pull.append(files["TARGET_CP"]) # files: target heat flux distribution - if 'INV_DESIGN_HEATFLUX' in special_cases and 'TARGET_HEATFLUX' in files: - pull.append(files['TARGET_HEATFLUX']) - + if "INV_DESIGN_HEATFLUX" in special_cases and "TARGET_HEATFLUX" in files: + pull.append(files["TARGET_HEATFLUX"]) # output redirection - with redirect_folder('FINDIFF',pull,link) as push: + with redirect_folder("FINDIFF", pull, link) as push: with redirect_output(log_findiff): # iterate each dv for i_dv in range(n_dv): this_step = step[i_dv] - temp_config_name = 'config_FINDIFF_%i.cfg' % i_dv + temp_config_name = "config_FINDIFF_%i.cfg" % i_dv - this_dvs = copy.deepcopy(dvs_base) + this_dvs = copy.deepcopy(dvs_base) this_konfig = copy.deepcopy(konfig) this_dvs[i_dv] = this_dvs[i_dv] + this_step this_state = su2io.State() - this_state.FILES = copy.deepcopy( state.FILES ) - this_konfig.unpack_dvs(this_dvs,dvs_base) + this_state.FILES = copy.deepcopy(state.FILES) + this_konfig.unpack_dvs(this_dvs, dvs_base) this_konfig.dump(temp_config_name) # Direct Solution, findiff step - func_step = function( 'ALL', this_konfig, this_state ) + func_step = function("ALL", this_konfig, this_state) # remove deform step files meshfiles = this_state.FILES.MESH - meshfiles = su2io.expand_part(meshfiles,this_konfig) - for name in meshfiles: os.remove(name) + meshfiles = su2io.expand_part(meshfiles, this_konfig) + for name in meshfiles: + os.remove(name) for key in grads.keys(): - if key == 'VARIABLE' or key == 'FINDIFF_STEP': + if key == "VARIABLE" or key == "FINDIFF_STEP": pass elif not key in func_step: del grads[key] # calc finite difference and store for key in grads.keys(): - if key == 'VARIABLE': + if key == "VARIABLE": grads[key].append(i_dv) - elif key == 'FINDIFF_STEP': + elif key == "FINDIFF_STEP": grads[key].append(this_step) else: - this_grad = ( func_step[key] - func_base[key] ) / this_step + this_grad = (func_step[key] - func_base[key]) / this_step grads[key].append(this_grad) - #: for each grad name - su2util.write_plot(grad_filename,output_format,grads) + su2util.write_plot(grad_filename, output_format, grads) os.remove(temp_config_name) #: for each dv @@ -919,14 +973,15 @@ def findiff( config, state=None ): #: with output redirection # remove plot items - del grads['VARIABLE'] - del grads['FINDIFF_STEP'] + del grads["VARIABLE"] + del grads["FINDIFF_STEP"] state.GRADIENTS.update(grads) # return results grads = copy.deepcopy(grads) return grads + #: def findiff() @@ -934,29 +989,30 @@ def findiff( config, state=None ): # Geometric Gradients # ---------------------------------------------------------------------- -def geometry( func_name, config, state=None ): - """ val = SU2.eval.geometry(config,state=None) - Evaluates geometry with the following: - SU2.run.deform() - SU2.run.geometry() +def geometry(func_name, config, state=None): + """val = SU2.eval.geometry(config,state=None) - Assumptions: - Config is already setup for deformation. - Mesh may or may not be deformed. - Updates config and state by reference. - Redundancy if state.FUNCTIONS does not have func_name. + Evaluates geometry with the following: + SU2.run.deform() + SU2.run.geometry() - Executes in: - ./GEOMETRY + Assumptions: + Config is already setup for deformation. + Mesh may or may not be deformed. + Updates config and state by reference. + Redundancy if state.FUNCTIONS does not have func_name. - Inputs: - config - an SU2 config - state - optional, an SU2 state + Executes in: + ./GEOMETRY - Outputs: - Bunch() of functions with keys of objective function names - and values of objective function floats. + Inputs: + config - an SU2 config + state - optional, an SU2 state + + Outputs: + Bunch() of functions with keys of objective function names + and values of objective function floats. """ # ---------------------------------------------------- @@ -965,13 +1021,13 @@ def geometry( func_name, config, state=None ): # initialize state = su2io.State(state) - if not 'MESH' in state.FILES: - state.FILES.MESH = config['MESH_FILENAME'] + if not "MESH" in state.FILES: + state.FILES.MESH = config["MESH_FILENAME"] special_cases = su2io.get_specialCases(config) # console output - if config.get('CONSOLE','VERBOSE') in ['QUIET','CONCISE']: - log_geom = 'log_Geometry.out' + if config.get("CONSOLE", "VERBOSE") in ["QUIET", "CONCISE"]: + log_geom = "log_Geometry.out" else: log_geom = None @@ -982,35 +1038,35 @@ def geometry( func_name, config, state=None ): # does decomposition and deformation # info = update_mesh(config,state) - # ---------------------------------------------------- # Geometry Solution # ---------------------------------------------------- # redundancy check geometry_done = func_name in state.GRADIENTS - #geometry_done = all([key in state.FUNCTIONS for key in su2io.optnames_geo]) + # geometry_done = all([key in state.FUNCTIONS for key in su2io.optnames_geo]) if not geometry_done: # files to pull files = state.FILES - pull = []; link = [] + pull = [] + link = [] # files: mesh - name = files['MESH'] - name = su2io.expand_part(name,config) + name = files["MESH"] + name = su2io.expand_part(name, config) link.extend(name) # update function name ## TODO # output redirection - with redirect_folder( 'GEOMETRY', pull, link ) as push: + with redirect_folder("GEOMETRY", pull, link) as push: with redirect_output(log_geom): # setup config config.GEO_PARAM = func_name - config.GEO_MODE = 'GRADIENT' + config.GEO_MODE = "GRADIENT" # # RUN GEOMETRY SOLUTION # # info = su2run.geometry(config) @@ -1022,14 +1078,14 @@ def geometry( func_name, config, state=None ): #: if not redundant - # return output grads = su2util.ordered_bunch() for key in su2io.optnames_geo: - if key in state['GRADIENTS']: - grads[key] = state['GRADIENTS'][key] + if key in state["GRADIENTS"]: + grads[key] = state["GRADIENTS"][key] return grads + #: def geometry() @@ -1037,34 +1093,35 @@ def geometry( func_name, config, state=None ): # Direct Differentiation Gradients # ---------------------------------------------------------------------- -def directdiff( config, state=None ): - """ vals = SU2.eval.directdiff(config,state=None) - - Evaluates the aerodynamics gradients using - direct differentiation with: - SU2.eval.func() - SU2.run.deform() - SU2.run.direct() - - Assumptions: - Config is already setup for deformation. - Mesh may or may not be deformed. - Updates config and state by reference. - Gradient Redundancy if state.GRADIENTS has the key func_name. - Direct Redundancy if state.FUNCTIONS has key func_name. - - Executes in: - ./DIRECTDIFF - - Inputs: - config - an SU2 config - state - optional, an SU2 state - step - finite difference step size, as a float or - list of floats of length n_DV - - Outputs: - A Bunch() with keys of objective function names - and values of list of floats of gradient values + +def directdiff(config, state=None): + """vals = SU2.eval.directdiff(config,state=None) + + Evaluates the aerodynamics gradients using + direct differentiation with: + SU2.eval.func() + SU2.run.deform() + SU2.run.direct() + + Assumptions: + Config is already setup for deformation. + Mesh may or may not be deformed. + Updates config and state by reference. + Gradient Redundancy if state.GRADIENTS has the key func_name. + Direct Redundancy if state.FUNCTIONS has key func_name. + + Executes in: + ./DIRECTDIFF + + Inputs: + config - an SU2 config + state - optional, an SU2 state + step - finite difference step size, as a float or + list of floats of length n_DV + + Outputs: + A Bunch() with keys of objective function names + and values of list of floats of gradient values """ # ---------------------------------------------------- @@ -1074,11 +1131,11 @@ def directdiff( config, state=None ): # initialize state = su2io.State(state) special_cases = su2io.get_specialCases(config) - Definition_DV = config['DEFINITION_DV'] + Definition_DV = config["DEFINITION_DV"] # console output - if config.get('CONSOLE','VERBOSE') in ['QUIET','CONCISE']: - log_directdiff = 'log_DirectDiff.out' + if config.get("CONSOLE", "VERBOSE") in ["QUIET", "CONCISE"]: + log_directdiff = "log_DirectDiff.out" else: log_directdiff = None @@ -1089,23 +1146,23 @@ def directdiff( config, state=None ): # master redundancy check opt_names = [] for key in sorted(su2io.historyOutFields): - if su2io.historyOutFields[key]['TYPE'] == 'COEFFICIENT': + if su2io.historyOutFields[key]["TYPE"] == "COEFFICIENT": opt_names.append(key) directdiff_todo = all([key in state.GRADIENTS for key in opt_names]) if directdiff_todo: - grads = state['GRADIENTS'] + grads = state["GRADIENTS"] return copy.deepcopy(grads) # ---------------------------------------------------- # Plot Setup # ---------------------------------------------------- - grad_filename = config['GRAD_OBJFUNC_FILENAME'] - grad_filename = os.path.splitext( grad_filename )[0] - output_format = config.get('TABULAR_FORMAT', 'CSV') + grad_filename = config["GRAD_OBJFUNC_FILENAME"] + grad_filename = os.path.splitext(grad_filename)[0] + output_format = config.get("TABULAR_FORMAT", "CSV") plot_extension = su2io.get_extension(output_format) - grad_filename = grad_filename + '_directdiff' + plot_extension + grad_filename = grad_filename + "_directdiff" + plot_extension # ---------------------------------------------------- # Direct Differentiation Evaluation @@ -1114,84 +1171,86 @@ def directdiff( config, state=None ): # local config konfig = copy.deepcopy(config) - n_dv = sum(Definition_DV['SIZE']) + n_dv = sum(Definition_DV["SIZE"]) # initialize gradients func_keys = opt_names - func_keys = ['VARIABLE'] + func_keys + func_keys = ["VARIABLE"] + func_keys grads = su2util.ordered_bunch.fromkeys(func_keys) - for key in grads.keys(): grads[key] = [] + for key in grads.keys(): + grads[key] = [] # files to pull - files = state['FILES'] - pull = []; link = [] + files = state["FILES"] + pull = [] + link = [] # files: mesh - name = files['MESH'] - name = su2io.expand_part(name,konfig) + name = files["MESH"] + name = su2io.expand_part(name, konfig) link.extend(name) - if 'FLOW_META' in files: - pull.append(files['FLOW_META']) + if "FLOW_META" in files: + pull.append(files["FLOW_META"]) # files: direct solution - if 'DIRECT' in files: - name = files['DIRECT'] - name = su2io.expand_time(name,config) + if "DIRECT" in files: + name = files["DIRECT"] + name = su2io.expand_time(name, config) link.extend(name) # files: target equivarea distribution - if 'EQUIV_AREA' in special_cases and 'TARGET_EA' in files: - pull.append(files['TARGET_EA']) + if "EQUIV_AREA" in special_cases and "TARGET_EA" in files: + pull.append(files["TARGET_EA"]) # files: target pressure distribution - if 'INV_DESIGN_CP' in special_cases and 'TARGET_CP' in files: - pull.append(files['TARGET_CP']) + if "INV_DESIGN_CP" in special_cases and "TARGET_CP" in files: + pull.append(files["TARGET_CP"]) # files: target heat flux distribution - if 'INV_DESIGN_HEATFLUX' in special_cases and 'TARGET_HEATFLUX' in files: - pull.append(files['TARGET_HEATFLUX']) + if "INV_DESIGN_HEATFLUX" in special_cases and "TARGET_HEATFLUX" in files: + pull.append(files["TARGET_HEATFLUX"]) # output redirection - with redirect_folder('DIRECTDIFF',pull,link) as push: + with redirect_folder("DIRECTDIFF", pull, link) as push: with redirect_output(log_directdiff): # iterate each dv for i_dv in range(n_dv): - temp_config_name = 'config_DIRECTDIFF_%i.cfg' % i_dv + temp_config_name = "config_DIRECTDIFF_%i.cfg" % i_dv this_konfig = copy.deepcopy(konfig) - this_dvs = [0.0]*n_dv + this_dvs = [0.0] * n_dv this_dvs[i_dv] = 1.0 - this_dvs_old = [0.0]*n_dv + this_dvs_old = [0.0] * n_dv this_dvs_old[i_dv] = 1.0 this_state = su2io.State() - this_state.FILES = copy.deepcopy( state.FILES ) + this_state.FILES = copy.deepcopy(state.FILES) this_konfig.unpack_dvs(this_dvs, this_dvs_old) this_konfig.dump(temp_config_name) # Direct Solution - func_step = function( 'ALL', this_konfig, this_state ) + func_step = function("ALL", this_konfig, this_state) # delete keys not returned by the solver for key in grads.keys(): - if key == 'VARIABLE': + if key == "VARIABLE": pass - elif not 'D_' + key in func_step: + elif not "D_" + key in func_step: del grads[key] # store for key in grads.keys(): - if key == 'VARIABLE': + if key == "VARIABLE": grads[key].append(i_dv) else: - this_grad = func_step['D_' + key] + this_grad = func_step["D_" + key] grads[key].append(this_grad) #: for each grad name - su2util.write_plot(grad_filename,output_format,grads) + su2util.write_plot(grad_filename, output_format, grads) os.remove(temp_config_name) #: for each dv @@ -1199,7 +1258,7 @@ def directdiff( config, state=None ): #: with output redirection # remove plot items - del grads['VARIABLE'] + del grads["VARIABLE"] state.GRADIENTS.update(grads) state.update(this_state) @@ -1207,5 +1266,5 @@ def directdiff( config, state=None ): grads = copy.deepcopy(grads) return grads -#: def directdiff() +#: def directdiff() diff --git a/SU2_PY/SU2/io/__init__.py b/SU2_PY/SU2/io/__init__.py index d79c0aa59c2..8b222a5d021 100644 --- a/SU2_PY/SU2/io/__init__.py +++ b/SU2_PY/SU2/io/__init__.py @@ -1,11 +1,11 @@ # SU2/io/__init__.py -from .tools import * +from .tools import * from .redirect import output as redirect_output from .redirect import folder as redirect_folder -from .data import load_data, save_data +from .data import load_data, save_data from .filelock import filelock -from .config import Config -from .state import State_Factory as State +from .config import Config +from .state import State_Factory as State from .historyMap import history_header_map as historyOutFields diff --git a/SU2_PY/SU2/io/config.py b/SU2_PY/SU2/io/config.py index 2376dcf0408..5768b0660f3 100755 --- a/SU2_PY/SU2/io/config.py +++ b/SU2_PY/SU2/io/config.py @@ -3,7 +3,7 @@ ## \file config.py # \brief python package for config # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -45,56 +45,57 @@ # Configuration Class # ---------------------------------------------------------------------- + class Config(ordered_bunch): - """ config = SU2.io.Config(filename="") - - Starts a config class, an extension of - ordered_bunch() - - use 1: initialize by reading config file - config = SU2.io.Config('filename') - use 2: initialize from dictionary or bunch - config = SU2.io.Config(param_dict) - use 3: initialize empty - config = SU2.io.Config() - - Parameters can be accessed by item or attribute - ie: config['MESH_FILENAME'] or config.MESH_FILENAME - - Methods: - read() - read from a config file - write() - write to a config file (requires existing file) - dump() - dump a raw config file - unpack_dvs() - unpack a design vector - diff() - returns the difference from another config - dist() - computes the distance from another config + """config = SU2.io.Config(filename="") + + Starts a config class, an extension of + ordered_bunch() + + use 1: initialize by reading config file + config = SU2.io.Config('filename') + use 2: initialize from dictionary or bunch + config = SU2.io.Config(param_dict) + use 3: initialize empty + config = SU2.io.Config() + + Parameters can be accessed by item or attribute + ie: config['MESH_FILENAME'] or config.MESH_FILENAME + + Methods: + read() - read from a config file + write() - write to a config file (requires existing file) + dump() - dump a raw config file + unpack_dvs() - unpack a design vector + diff() - returns the difference from another config + dist() - computes the distance from another config """ - _filename = 'config.cfg' + _filename = "config.cfg" - def __init__(self,*args,**kwarg): + def __init__(self, *args, **kwarg): # look for filename in inputs - if args and isinstance(args[0],str): + if args and isinstance(args[0], str): filename = args[0] args = args[1:] - elif 'filename' in kwarg: - filename = kwarg['filename'] - del kwarg['filename'] + elif "filename" in kwarg: + filename = kwarg["filename"] + del kwarg["filename"] else: - filename = '' + filename = "" # initialize ordered bunch - super(Config,self).__init__(*args,**kwarg) + super(Config, self).__init__(*args, **kwarg) # read config if it exists if filename: try: self.read(filename) except IOError: - print('Could not find config file: %s' % filename) + print("Could not find config file: %s" % filename) except: - print('Unexpected error: ', sys.exc_info()[0]) + print("Unexpected error: ", sys.exc_info()[0]) raise self._filename = filename @@ -104,81 +105,82 @@ def __init__(self,*args,**kwarg): diff_objective = self.get("OBJECTIVE_FUNCTION") constrFuncFields = self.get("OPT_CONSTRAINT") - #OPT_OBJECTIVES - if bool (objFuncsFields): + # OPT_OBJECTIVES + if bool(objFuncsFields): for key in objFuncsFields: tavg_keyGroup = "TAVG_" + historyOutFields[key]["GROUP"] - if not tavg_keyGroup in histFields: + if not tavg_keyGroup in histFields: histFields.append(tavg_keyGroup) dtavg_keyGroup = "D_TAVG_" + historyOutFields[key]["GROUP"] if not dtavg_keyGroup in histFields: histFields.append(dtavg_keyGroup) - #OPT_CONSTRAINTS - if bool (constrFuncFields): + # OPT_CONSTRAINTS + if bool(constrFuncFields): for key in constrFuncFields: eqIneqConstrFunc = constrFuncFields.get(key) for key_inner in eqIneqConstrFunc: tavg_keyGroup = "TAVG_" + historyOutFields[key_inner]["GROUP"] - if not tavg_keyGroup in histFields: + if not tavg_keyGroup in histFields: histFields.append(tavg_keyGroup) - #DIRECT_DIFF Field + # DIRECT_DIFF Field if diff_objective in historyOutFields: tavg_keyGroup = "TAVG_" + historyOutFields[diff_objective]["GROUP"] - if not tavg_keyGroup in histFields: + if not tavg_keyGroup in histFields: histFields.append(tavg_keyGroup) dtavg_keyGroup = "D_TAVG_" + historyOutFields[diff_objective]["GROUP"] if not dtavg_keyGroup in histFields: histFields.append(dtavg_keyGroup) - self["HISTORY_OUTPUT"]= histFields - + self["HISTORY_OUTPUT"] = histFields - def read(self,filename): - """ reads from a config file """ + def read(self, filename): + """reads from a config file""" konfig = read_config(filename) self.update(konfig) - def write(self,filename=''): - """ updates an existing config file """ - if not filename: filename = self._filename - assert os.path.exists(filename) , 'must write over an existing config file' - write_config(filename,self) + def write(self, filename=""): + """updates an existing config file""" + if not filename: + filename = self._filename + assert os.path.exists(filename), "must write over an existing config file" + write_config(filename, self) - def dump(self,filename=''): - """ dumps all items in the config bunch, without comments """ - if not filename: filename = self._filename - dump_config(filename,self) + def dump(self, filename=""): + """dumps all items in the config bunch, without comments""" + if not filename: + filename = self._filename + dump_config(filename, self) - def __getattr__(self,k): + def __getattr__(self, k): try: - return super(Config,self).__getattr__(k) + return super(Config, self).__getattr__(k) except AttributeError: - raise AttributeError('Config parameter not found') + raise AttributeError("Config parameter not found") - def __getitem__(self,k): + def __getitem__(self, k): try: - return super(Config,self).__getitem__(k) + return super(Config, self).__getitem__(k) except KeyError: - raise KeyError('Config parameter not found: %s' % k) + raise KeyError("Config parameter not found: %s" % k) - def unpack_dvs(self,dv_new,dv_old=None): - """ updates config with design variable vectors - will scale according to each DEFINITION_DV scale parameter + def unpack_dvs(self, dv_new, dv_old=None): + """updates config with design variable vectors + will scale according to each DEFINITION_DV scale parameter - Modifies: - DV_KIND - DV_MARKER - DV_PARAM - DV_VALUE_OLD - DV_VALUE_NEW + Modifies: + DV_KIND + DV_MARKER + DV_PARAM + DV_VALUE_OLD + DV_VALUE_NEW - Inputs: - dv_new - list or array of new dv values - dv_old - optional, list or array of old dv values, defaults to zeros + Inputs: + dv_new - list or array of new dv values + dv_old - optional, list or array of old dv values, defaults to zeros """ @@ -186,96 +188,95 @@ def unpack_dvs(self,dv_new,dv_old=None): dv_old = copy.deepcopy(dv_old) # handle unpacking cases - def_dv = self['DEFINITION_DV'] + def_dv = self["DEFINITION_DV"] - n_dv = sum(def_dv['SIZE']) + n_dv = sum(def_dv["SIZE"]) - if not dv_old: dv_old = [0.0]*n_dv - assert len(dv_new) == len(dv_old) , 'unexpected design vector length' + if not dv_old: + dv_old = [0.0] * n_dv + assert len(dv_new) == len(dv_old), "unexpected design vector length" # handle param - param_dv = self['DV_PARAM'] + param_dv = self["DV_PARAM"] # apply scale - dv_scales = def_dv['SCALE'] + dv_scales = def_dv["SCALE"] k = 0 for i, dv_scl in enumerate(dv_scales): - for j in range(def_dv['SIZE'][i]): - dv_new[k] = dv_new[k]*dv_scl; - dv_old[k] = dv_old[k]*dv_scl; + for j in range(def_dv["SIZE"][i]): + dv_new[k] = dv_new[k] * dv_scl + dv_old[k] = dv_old[k] * dv_scl k = k + 1 # Change the parameters of the design variables - self['DV_KIND'] = def_dv['KIND'] - param_dv['PARAM'] = def_dv['PARAM'] - param_dv['FFDTAG'] = def_dv['FFDTAG'] - param_dv['SIZE'] = def_dv['SIZE'] + self["DV_KIND"] = def_dv["KIND"] + param_dv["PARAM"] = def_dv["PARAM"] + param_dv["FFDTAG"] = def_dv["FFDTAG"] + param_dv["SIZE"] = def_dv["SIZE"] - self.update({ 'DV_VALUE_OLD' : dv_old , - 'DV_VALUE_NEW' : dv_new }) + self.update({"DV_VALUE_OLD": dv_old, "DV_VALUE_NEW": dv_new}) - def __eq__(self,konfig): - return super(Config,self).__eq__(konfig) - def __ne__(self,konfig): - return super(Config,self).__ne__(konfig) + def __eq__(self, konfig): + return super(Config, self).__eq__(konfig) + def __ne__(self, konfig): + return super(Config, self).__ne__(konfig) def local_files(self): - """ removes path prefix from all *_FILENAME params - """ + """removes path prefix from all *_FILENAME params""" for key, value in self.items(): - if key.split('_')[-1] == 'FILENAME': + if key.split("_")[-1] == "FILENAME": self[key] = os.path.basename(value) - def diff(self,konfig): - """ compares self to another config + def diff(self, konfig): + """compares self to another config - Inputs: - konfig - a second config + Inputs: + konfig - a second config - Outputs: - config_diff - a config containing only the differing - keys, each with values of a list of the different - config values. - for example: - config_diff.MATH_PROBLEM = ['DIRECT','CONTINUOUS_ADJOINT'] + Outputs: + config_diff - a config containing only the differing + keys, each with values of a list of the different + config values. + for example: + config_diff.MATH_PROBLEM = ['DIRECT','CONTINUOUS_ADJOINT'] """ keys = set([]) - keys.update( self.keys() ) - keys.update( konfig.keys() ) + keys.update(self.keys()) + keys.update(konfig.keys()) konfig_diff = Config() for key in keys: - value1 = self.get(key,None) - value2 = konfig.get(key,None) + value1 = self.get(key, None) + value2 = konfig.get(key, None) if not value1 == value2: - konfig_diff[key] = [value1,value2] + konfig_diff[key] = [value1, value2] return konfig_diff - def dist(self,konfig,keys_check='ALL'): - """ calculates a distance to another config + def dist(self, konfig, keys_check="ALL"): + """calculates a distance to another config - Inputs: - konfig - a second config - keys_check - optional, a list of keys to check + Inputs: + konfig - a second config + keys_check - optional, a list of keys to check - Outputs: - distance - a float + Outputs: + distance - a float - Currently only works for DV_VALUE_NEW and DV_VALUE_OLD - Returns a large value otherwise + Currently only works for DV_VALUE_NEW and DV_VALUE_OLD + Returns a large value otherwise """ konfig_diff = self.diff(konfig) - if keys_check == 'ALL': + if keys_check == "ALL": keys_check = konfig_diff.keys() distance = 0.0 @@ -286,14 +287,13 @@ def dist(self,konfig,keys_check='ALL'): val1 = konfig_diff[key][0] val2 = konfig_diff[key][1] - if key in ['DV_VALUE_NEW', - 'DV_VALUE_OLD']: - val1 = np.array( val1 ) - val2 = np.array( val2 ) - this_diff = np.sqrt( np.sum( (val1-val2)**2 ) ) + if key in ["DV_VALUE_NEW", "DV_VALUE_OLD"]: + val1 = np.array(val1) + val2 = np.array(val2) + this_diff = np.sqrt(np.sum((val1 - val2) ** 2)) else: - print('Warning, unexpected config difference') + print("Warning, unexpected config difference") this_diff = inf distance += this_diff @@ -304,28 +304,26 @@ def dist(self,konfig,keys_check='ALL'): return distance def __repr__(self): - #return ' %s' % self._filename + # return ' %s' % self._filename return self.__str__() def __str__(self): - output = 'Config: %s' % self._filename - for k,v in self.items(): - output += '\n %s= %s' % (k,v) + output = "Config: %s" % self._filename + for k, v in self.items(): + output += "\n %s= %s" % (k, v) return output -#: class Config - - - +#: class Config # ------------------------------------------------------------------- # Get SU2 Configuration Parameters # ------------------------------------------------------------------- + def read_config(filename): - """ reads a config file """ + """reads a config file""" # initialize output dictionary data_dict = OrderedDict() @@ -340,12 +338,12 @@ def read_config(filename): break # remove line returns - line = line.strip('\r\n').strip() + line = line.strip("\r\n").strip() - if (len(line) == 0): + if len(line) == 0: continue # make sure it has useful data - if (line[0] == '%'): + if line[0] == "%": continue # --- Check if there is a line continuation character at the @@ -354,34 +352,40 @@ def read_config(filename): # If there is a statement after a cont. char # throw an error. ---*/ - while(line[0].endswith('\\') or len(line.split('\\')) > 1): + while line[0].endswith("\\") or len(line.split("\\")) > 1: tmp_line = input_file.readline() tmp_line = tmp_line.strip() - assert len(tmp_line.split('=')) <= 1, ('Statement found after line ' - 'continuation character in config file %s' % tmp_line) - if (not tmp_line.startswith('%')): - line = line.split('\\')[0] - line += ' ' + tmp_line + assert len(tmp_line.split("=")) <= 1, ( + "Statement found after line " + "continuation character in config file %s" % tmp_line + ) + if not tmp_line.startswith("%"): + line = line.split("\\")[0] + line += " " + tmp_line # split across equals sign - line = line.split("=",1) + line = line.split("=", 1) this_param = line[0].strip() this_value = line[1].strip() - assert this_param not in data_dict, ('Config file has multiple specifications of %s' % this_param ) + assert this_param not in data_dict, ( + "Config file has multiple specifications of %s" % this_param + ) for case in switch(this_param): # comma delimited lists of strings with or without paren's - if case("MARKER_EULER") or\ - case("MARKER_FAR") or\ - case("MARKER_PLOTTING") or\ - case("MARKER_MONITORING") or\ - case("MARKER_SYM") or\ - case("DV_KIND") : + if ( + case("MARKER_EULER") + or case("MARKER_FAR") + or case("MARKER_PLOTTING") + or case("MARKER_MONITORING") + or case("MARKER_SYM") + or case("DV_KIND") + ): # remove white space - this_value = ''.join(this_value.split()) + this_value = "".join(this_value.split()) # remove parens - this_value = this_value.strip('()') + this_value = this_value.strip("()") # split by comma data_dict[this_param] = this_value.split(",") break @@ -389,80 +393,101 @@ def read_config(filename): # semicolon delimited lists of comma delimited lists of floats if case("DV_PARAM"): # remove white space - info_General = ''.join(this_value.split()) + info_General = "".join(this_value.split()) # split by semicolon - info_General = info_General.split(';') + info_General = info_General.split(";") # build list of dv params, convert string to float dv_Parameters = [] - dv_FFDTag = [] - dv_Size = [] + dv_FFDTag = [] + dv_Size = [] for this_dvParam in info_General: - this_dvParam = this_dvParam.strip('()') + this_dvParam = this_dvParam.strip("()") this_dvParam = this_dvParam.split(",") - this_dvSize = 1 + this_dvSize = 1 # if FFD change the first element to work with numbers and float(x) - if data_dict["DV_KIND"][0] in ['FFD_SETTING','FFD_ANGLE_OF_ATTACK','FFD_CONTROL_POINT','FFD_NACELLE','FFD_GULL','FFD_TWIST_2D','FFD_TWIST','FFD_ROTATION','FFD_CAMBER','FFD_THICKNESS','FFD_CONTROL_POINT_2D','FFD_CAMBER_2D','FFD_THICKNESS_2D']: + if data_dict["DV_KIND"][0] in [ + "FFD_SETTING", + "FFD_ANGLE_OF_ATTACK", + "FFD_CONTROL_POINT", + "FFD_NACELLE", + "FFD_GULL", + "FFD_TWIST", + "FFD_ROTATION", + "FFD_CAMBER", + "FFD_THICKNESS", + "FFD_CONTROL_POINT_2D", + "FFD_CAMBER_2D", + "FFD_THICKNESS_2D", + ]: this_dvFFDTag = this_dvParam[0] - this_dvParam[0] = '0' + this_dvParam[0] = "0" else: this_dvFFDTag = [] - if not data_dict["DV_KIND"][0] in ['NO_DEFORMATION']: - this_dvParam = [ float(x) for x in this_dvParam ] + if not data_dict["DV_KIND"][0] in ["NO_DEFORMATION"]: + this_dvParam = [float(x) for x in this_dvParam] - if data_dict["DV_KIND"][0] in ['FFD_CONTROL_POINT_2D']: + if data_dict["DV_KIND"][0] in ["FFD_CONTROL_POINT_2D"]: if this_dvParam[3] == 0 and this_dvParam[4] == 0: this_dvSize = 2 - if data_dict["DV_KIND"][0]in ['FFD_CONTROL_POINT']: - if this_dvParam[4] == 0 and this_dvParam[5] == 0 and this_dvParam[6] == 0: + if data_dict["DV_KIND"][0] in ["FFD_CONTROL_POINT"]: + if ( + this_dvParam[4] == 0 + and this_dvParam[5] == 0 + and this_dvParam[6] == 0 + ): this_dvSize = 3 - dv_FFDTag = dv_FFDTag + [this_dvFFDTag] + dv_FFDTag = dv_FFDTag + [this_dvFFDTag] dv_Parameters = dv_Parameters + [this_dvParam] - dv_Size = dv_Size + [this_dvSize] + dv_Size = dv_Size + [this_dvSize] - # store in a dictionary - dv_Definitions = { 'FFDTAG' : dv_FFDTag , - 'PARAM' : dv_Parameters , - 'SIZE' : dv_Size} + # store in a dictionary + dv_Definitions = { + "FFDTAG": dv_FFDTag, + "PARAM": dv_Parameters, + "SIZE": dv_Size, + } data_dict[this_param] = dv_Definitions break # comma delimited lists of floats - if case("DV_VALUE_OLD") or\ - case("DV_VALUE_NEW") or\ - case("DV_VALUE") : + if case("DV_VALUE_OLD") or case("DV_VALUE_NEW") or case("DV_VALUE"): # remove white space - this_value = ''.join(this_value.split()) + this_value = "".join(this_value.split()) # split by comma, map to float, store in dictionary - data_dict[this_param] = list(map(float,this_value.split(","))) + data_dict[this_param] = list(map(float, this_value.split(","))) break # float parameters - if case("MACH_NUMBER") or\ - case("AOA") or\ - case("FIN_DIFF_STEP") or\ - case("CFL_NUMBER") or\ - case("HB_PERIOD") or\ - case("WRT_SOL_FREQ") : + if ( + case("MACH_NUMBER") + or case("AOA") + or case("FIN_DIFF_STEP") + or case("CFL_NUMBER") + or case("HB_PERIOD") + or case("WRT_SOL_FREQ") + ): data_dict[this_param] = float(this_value) break # int parameters - if case("NUMBER_PART") or\ - case("AVAILABLE_PROC") or\ - case("ITER") or\ - case("TIME_INSTANCES") or\ - case("UNST_ADJOINT_ITER") or\ - case("ITER_AVERAGE_OBJ") or\ - case("INNER_ITER") or\ - case("OUTER_ITER") or\ - case("TIME_ITER") or\ - case("ADAPT_CYCLES") : + if ( + case("NUMBER_PART") + or case("AVAILABLE_PROC") + or case("ITER") + or case("TIME_INSTANCES") + or case("UNST_ADJOINT_ITER") + or case("ITER_AVERAGE_OBJ") + or case("INNER_ITER") + or case("OUTER_ITER") + or case("TIME_ITER") + or case("ADAPT_CYCLES") + ): data_dict[this_param] = int(this_value) break @@ -482,154 +507,198 @@ def read_config(filename): # unitary design variable definition if case("DEFINITION_DV"): # remove white space - this_value = ''.join(this_value.split()) + this_value = "".join(this_value.split()) # split into unitary definitions info_Unitary = this_value.split(";") # process each Design Variable - dv_Kind = [] - dv_Scale = [] - dv_Markers = [] - dv_FFDTag = [] + dv_Kind = [] + dv_Scale = [] + dv_Markers = [] + dv_FFDTag = [] dv_Parameters = [] - dv_Size = [] + dv_Size = [] for this_General in info_Unitary: - if not this_General: continue + if not this_General: + continue # split each unitary definition into one general definition - info_General = this_General.strip("()").split("|") # check for needed strip()? + info_General = this_General.strip("()").split( + "|" + ) # check for needed strip()? # split information for dv Kinds - info_Kind = info_General[0].split(",") + info_Kind = info_General[0].split(",") # pull processed dv values - this_dvKind = get_dvKind( int( info_Kind[0] ) ) - this_dvScale = float( info_Kind[1] ) - this_dvMarkers = info_General[1].split(",") - this_dvSize = 1 + this_dvKind = get_dvKind(int(info_Kind[0])) + this_dvScale = float(info_Kind[1]) + this_dvMarkers = info_General[1].split(",") + this_dvSize = 1 - if this_dvKind=='MACH_NUMBER' or this_dvKind=='AOA': + if this_dvKind == "MACH_NUMBER" or this_dvKind == "AOA": this_dvParameters = [] else: this_dvParameters = info_General[2].split(",") # if FFD change the first element to work with numbers and float(x), save also the tag - if this_dvKind in ['FFD_SETTING','FFD_ANGLE_OF_ATTACK','FFD_CONTROL_POINT','FFD_NACELLE','FFD_GULL','FFD_TWIST','FFD_TWIST_2D','FFD_TWIST_ANGLE','FFD_ROTATION','FFD_CAMBER','FFD_THICKNESS','FFD_CONTROL_POINT_2D','FFD_CAMBER_2D','FFD_THICKNESS_2D']: - this_dvFFDTag = this_dvParameters[0] - this_dvParameters[0] = '0' + if this_dvKind in [ + "FFD_SETTING", + "FFD_ANGLE_OF_ATTACK", + "FFD_CONTROL_POINT", + "FFD_NACELLE", + "FFD_GULL", + "FFD_TWIST", + "FFD_TWIST_ANGLE", + "FFD_ROTATION", + "FFD_CAMBER", + "FFD_THICKNESS", + "FFD_CONTROL_POINT_2D", + "FFD_CAMBER_2D", + "FFD_THICKNESS_2D", + ]: + this_dvFFDTag = this_dvParameters[0] + this_dvParameters[0] = "0" else: - this_dvFFDTag = [] + this_dvFFDTag = [] - this_dvParameters = [ float(x) for x in this_dvParameters ] + this_dvParameters = [float(x) for x in this_dvParameters] - if this_dvKind in ['FFD_CONTROL_POINT_2D']: + if this_dvKind in ["FFD_CONTROL_POINT_2D"]: if this_dvParameters[3] == 0 and this_dvParameters[4] == 0: this_dvSize = 2 - if this_dvKind in ['FFD_CONTROL_POINT']: - if this_dvParameters[4] == 0 and this_dvParameters[5] == 0 and this_dvParameters[6] == 0: + if this_dvKind in ["FFD_CONTROL_POINT"]: + if ( + this_dvParameters[4] == 0 + and this_dvParameters[5] == 0 + and this_dvParameters[6] == 0 + ): this_dvSize = 3 # add to lists - dv_Kind = dv_Kind + [this_dvKind] - dv_Scale = dv_Scale + [this_dvScale] - dv_Markers = dv_Markers + [this_dvMarkers] - dv_FFDTag = dv_FFDTag + [this_dvFFDTag] + dv_Kind = dv_Kind + [this_dvKind] + dv_Scale = dv_Scale + [this_dvScale] + dv_Markers = dv_Markers + [this_dvMarkers] + dv_FFDTag = dv_FFDTag + [this_dvFFDTag] dv_Parameters = dv_Parameters + [this_dvParameters] - dv_Size = dv_Size + [this_dvSize] + dv_Size = dv_Size + [this_dvSize] # store in a dictionary - dv_Definitions = { 'KIND' : dv_Kind , - 'SCALE' : dv_Scale , - 'MARKER' : dv_Markers , - 'FFDTAG' : dv_FFDTag , - 'PARAM' : dv_Parameters , - 'SIZE' : dv_Size} + dv_Definitions = { + "KIND": dv_Kind, + "SCALE": dv_Scale, + "MARKER": dv_Markers, + "FFDTAG": dv_FFDTag, + "PARAM": dv_Parameters, + "SIZE": dv_Size, + } # save to output dictionary data_dict[this_param] = dv_Definitions break # unitary objective definition - if case('OPT_OBJECTIVE'): + if case("OPT_OBJECTIVE"): # remove white space - this_value = ''.join(this_value.split()) - #split by ; - this_def=OrderedDict() + this_value = "".join(this_value.split()) + # split by ; + this_def = OrderedDict() this_value = this_value.split(";") - for this_obj in this_value: + for this_obj in this_value: # split by scale this_obj = this_obj.split("*") - this_name = this_obj[0] + this_name = this_obj[0] this_scale = 1.0 if len(this_obj) > 1: - this_scale = float( this_obj[1] ) + this_scale = float(this_obj[1]) # check for penalty-based constraint function - for this_sgn in ['<','>','=']: - if this_sgn in this_name: break - this_obj = this_name.strip('()').split(this_sgn) - if len(this_obj)>1: + for this_sgn in ["<", ">", "="]: + if this_sgn in this_name: + break + this_obj = this_name.strip("()").split(this_sgn) + if len(this_obj) > 1: this_type = this_sgn this_val = this_obj[1] else: - this_type = 'DEFAULT' - this_val = 0.0 + this_type = "DEFAULT" + this_val = 0.0 this_name = this_obj[0] # Print an error and exit if the same key appears twice - if (this_name in this_def): - raise SystemExit('Multiple occurrences of the same objective in the OPT_OBJECTIVE definition are not currently supported. To evaluate one objective over multiple surfaces, list the objective once.') + if this_name in this_def: + raise SystemExit( + "Multiple occurrences of the same objective in the OPT_OBJECTIVE definition are not currently supported. To evaluate one objective over multiple surfaces, list the objective once." + ) # Set up dict for objective, including scale, whether it is a penalty, and constraint value - this_def.update({ this_name : {'SCALE':this_scale, 'OBJTYPE':this_type, 'VALUE':this_val} }) + this_def.update( + { + this_name: { + "SCALE": this_scale, + "OBJTYPE": this_type, + "VALUE": this_val, + } + } + ) # OPT_OBJECTIVE has to appear after MARKER_MONITORING in the .cfg, maybe catch that here - if (len(data_dict['MARKER_MONITORING'])>1): - this_def[this_name]['MARKER'] = data_dict['MARKER_MONITORING'][len(this_def)-1] + if len(data_dict["MARKER_MONITORING"]) > 1: + this_def[this_name]["MARKER"] = data_dict["MARKER_MONITORING"][ + len(this_def) - 1 + ] else: - this_def[this_name]['MARKER'] = data_dict['MARKER_MONITORING'][0] + this_def[this_name]["MARKER"] = data_dict["MARKER_MONITORING"][ + 0 + ] # save to output dictionary data_dict[this_param] = this_def break # unitary constraint definition - if case('OPT_CONSTRAINT'): + if case("OPT_CONSTRAINT"): # remove white space - this_value = ''.join(this_value.split()) + this_value = "".join(this_value.split()) # check for none case - if this_value == 'NONE': - data_dict[this_param] = {'EQUALITY':OrderedDict(), 'INEQUALITY':OrderedDict()} + if this_value == "NONE": + data_dict[this_param] = { + "EQUALITY": OrderedDict(), + "INEQUALITY": OrderedDict(), + } break # split definitions - this_value = this_value.split(';') + this_value = this_value.split(";") this_def = OrderedDict() for this_con in this_value: - if not this_con: continue # if no definition + if not this_con: + continue # if no definition # defaults - this_obj = 'NONE' - this_sgn = '=' + this_obj = "NONE" + this_sgn = "=" this_scl = 1.0 this_val = 0.0 # split scale if present - this_con = this_con.split('*') + this_con = this_con.split("*") if len(this_con) > 1: - this_scl = float( this_con[1] ) + this_scl = float(this_con[1]) this_con = this_con[0] # find sign - for this_sgn in ['<','>','=']: - if this_sgn in this_con: break + for this_sgn in ["<", ">", "="]: + if this_sgn in this_con: + break # split sign, store objective and value - this_con = this_con.strip('()').split(this_sgn) - assert len(this_con) == 2 , 'incorrect constraint definition' + this_con = this_con.strip("()").split(this_sgn) + assert len(this_con) == 2, "incorrect constraint definition" this_obj = this_con[0] - this_val = float( this_con[1] ) + this_val = float(this_con[1]) # store in dictionary - this_def[this_obj] = { 'SIGN' : this_sgn , - 'VALUE' : this_val , - 'SCALE' : this_scl } + this_def[this_obj] = { + "SIGN": this_sgn, + "VALUE": this_val, + "SCALE": this_scl, + } #: for each constraint definition # sort constraints by type - this_sort = { 'EQUALITY' : OrderedDict() , - 'INEQUALITY' : OrderedDict() } - for key,value in this_def.items(): - if value['SIGN'] == '=': - this_sort['EQUALITY'][key] = value + this_sort = {"EQUALITY": OrderedDict(), "INEQUALITY": OrderedDict()} + for key, value in this_def.items(): + if value["SIGN"] == "=": + this_sort["EQUALITY"][key] = value else: - this_sort['INEQUALITY'][key] = value + this_sort["INEQUALITY"][key] = value #: for each definition # save to output dictionary data_dict[this_param] = this_sort @@ -647,198 +716,223 @@ def read_config(filename): #: for line - if 'OPT_CONSTRAINT' in data_dict: - if 'BUFFET' in data_dict['OPT_CONSTRAINT']['EQUALITY'] or 'BUFFET' in data_dict['OPT_CONSTRAINT']['INEQUALITY']: - data_dict['BUFFET_MONITORING'] = "YES" - - if 'OPT_OBJECTIVE' in data_dict: - if 'BUFFET' in data_dict['OPT_OBJECTIVE']: - data_dict['BUFFET_MONITORING'] = "YES" - - #hack - twl - if 'DV_VALUE_NEW' not in data_dict: - data_dict['DV_VALUE_NEW'] = [0] - if 'DV_VALUE_OLD' not in data_dict: - data_dict['DV_VALUE_OLD'] = [0] - if 'OPT_ITERATIONS' not in data_dict: - data_dict['OPT_ITERATIONS'] = 100 - if 'OPT_ACCURACY' not in data_dict: - data_dict['OPT_ACCURACY'] = 1e-10 - if 'OPT_RELAX_FACTOR' not in data_dict: - data_dict['OPT_RELAX_FACTOR'] = 1.0 - if 'OPT_GRADIENT_FACTOR' not in data_dict: - data_dict['OPT_GRADIENT_FACTOR'] = 1.0 - if 'OPT_BOUND_UPPER' not in data_dict: - data_dict['OPT_BOUND_UPPER'] = 1e10 - if 'OPT_BOUND_LOWER' not in data_dict: - data_dict['OPT_BOUND_LOWER'] = -1e10 - if 'OPT_COMBINE_OBJECTIVE' not in data_dict: - data_dict['OPT_COMBINE_OBJECTIVE'] = "NO" - if 'OPT_CONSTRAINT' not in data_dict: - data_dict['OPT_CONSTRAINT'] = {'INEQUALITY': OrderedDict(), 'EQUALITY': OrderedDict()} - if 'VALUE_OBJFUNC_FILENAME' not in data_dict: - data_dict['VALUE_OBJFUNC_FILENAME'] = 'of_eval.dat' - if 'GRAD_OBJFUNC_FILENAME' not in data_dict: - data_dict['GRAD_OBJFUNC_FILENAME'] = 'of_grad.dat' - if 'AOA' not in data_dict: - data_dict['AOA'] = 0.0 - if 'SIDESLIP_ANGLE' not in data_dict: - data_dict['SIDESLIP_ANGLE'] = 0.0 - if 'MACH_NUMBER' not in data_dict: - data_dict['MACH_NUMBER'] = 0.0 - if 'REYNOLDS_NUMBER' not in data_dict: - data_dict['REYNOLDS_NUMBER'] = 0.0 - if 'TARGET_CL' not in data_dict: - data_dict['TARGET_CL'] = 0.0 - if 'FREESTREAM_PRESSURE' not in data_dict: - data_dict['FREESTREAM_PRESSURE'] = 101325.0 - if 'FREESTREAM_TEMPERATURE' not in data_dict: - data_dict['FREESTREAM_TEMPERATURE'] = 288.15 - if 'MARKER_OUTLET' not in data_dict: - data_dict['MARKER_OUTLET'] = '(NONE)' + if "OPT_CONSTRAINT" in data_dict: + if ( + "BUFFET" in data_dict["OPT_CONSTRAINT"]["EQUALITY"] + or "BUFFET" in data_dict["OPT_CONSTRAINT"]["INEQUALITY"] + ): + data_dict["BUFFET_MONITORING"] = "YES" + + if "OPT_OBJECTIVE" in data_dict: + if "BUFFET" in data_dict["OPT_OBJECTIVE"]: + data_dict["BUFFET_MONITORING"] = "YES" + + # hack - twl + if "DV_VALUE_NEW" not in data_dict: + data_dict["DV_VALUE_NEW"] = [0] + if "DV_VALUE_OLD" not in data_dict: + data_dict["DV_VALUE_OLD"] = [0] + if "OPT_ITERATIONS" not in data_dict: + data_dict["OPT_ITERATIONS"] = 100 + if "OPT_ACCURACY" not in data_dict: + data_dict["OPT_ACCURACY"] = 1e-10 + if "OPT_RELAX_FACTOR" not in data_dict: + data_dict["OPT_RELAX_FACTOR"] = 1.0 + if "OPT_GRADIENT_FACTOR" not in data_dict: + data_dict["OPT_GRADIENT_FACTOR"] = 1.0 + if "OPT_BOUND_UPPER" not in data_dict: + data_dict["OPT_BOUND_UPPER"] = 1e10 + if "OPT_BOUND_LOWER" not in data_dict: + data_dict["OPT_BOUND_LOWER"] = -1e10 + if "OPT_COMBINE_OBJECTIVE" not in data_dict: + data_dict["OPT_COMBINE_OBJECTIVE"] = "NO" + if "OPT_CONSTRAINT" not in data_dict: + data_dict["OPT_CONSTRAINT"] = { + "INEQUALITY": OrderedDict(), + "EQUALITY": OrderedDict(), + } + if "VALUE_OBJFUNC_FILENAME" not in data_dict: + data_dict["VALUE_OBJFUNC_FILENAME"] = "of_eval.dat" + if "GRAD_OBJFUNC_FILENAME" not in data_dict: + data_dict["GRAD_OBJFUNC_FILENAME"] = "of_grad.dat" + if "AOA" not in data_dict: + data_dict["AOA"] = 0.0 + if "SIDESLIP_ANGLE" not in data_dict: + data_dict["SIDESLIP_ANGLE"] = 0.0 + if "MACH_NUMBER" not in data_dict: + data_dict["MACH_NUMBER"] = 0.0 + if "REYNOLDS_NUMBER" not in data_dict: + data_dict["REYNOLDS_NUMBER"] = 0.0 + if "TARGET_CL" not in data_dict: + data_dict["TARGET_CL"] = 0.0 + if "FREESTREAM_PRESSURE" not in data_dict: + data_dict["FREESTREAM_PRESSURE"] = 101325.0 + if "FREESTREAM_TEMPERATURE" not in data_dict: + data_dict["FREESTREAM_TEMPERATURE"] = 288.15 + if "MARKER_OUTLET" not in data_dict: + data_dict["MARKER_OUTLET"] = "(NONE)" # # Multipoints requires some particular default values # multipoints = 1 - if 'MULTIPOINT_WEIGHT' not in data_dict: - data_dict['MULTIPOINT_WEIGHT'] = "(1.0)" - multipoints = 1 + if "MULTIPOINT_WEIGHT" not in data_dict: + data_dict["MULTIPOINT_WEIGHT"] = "(1.0)" + multipoints = 1 else: - multipoints = len(data_dict['MULTIPOINT_WEIGHT'].replace("(", "").replace(")", "").split(',')) - - if 'MULTIPOINT_MACH_NUMBER' not in data_dict: - Mach_Value = data_dict['MACH_NUMBER'] - Mach_List = "(" - for i in range(multipoints): - if i != 0: Mach_List += ", " - Mach_List += str(Mach_Value) - Mach_List += ")" - data_dict['MULTIPOINT_MACH_NUMBER'] = Mach_List - - if 'MULTIPOINT_AOA' not in data_dict: - Alpha_Value = data_dict['AOA'] - Alpha_List = "(" - for i in range(multipoints): - if i != 0: Alpha_List += ", " - Alpha_List += str(Alpha_Value) - Alpha_List += ")" - data_dict['MULTIPOINT_AOA'] = Alpha_List - - if 'MULTIPOINT_SIDESLIP_ANGLE' not in data_dict: - Beta_Value = data_dict['SIDESLIP_ANGLE'] - Beta_List = "(" - for i in range(multipoints): - if i != 0: Beta_List += ", " - Beta_List += str(Beta_Value) - Beta_List += ")" - data_dict['MULTIPOINT_SIDESLIP_ANGLE'] = Beta_List - - if 'MULTIPOINT_REYNOLDS_NUMBER' not in data_dict: - Reynolds_Value = data_dict['REYNOLDS_NUMBER'] - Reynolds_List = "(" - for i in range(multipoints): - if i != 0: Reynolds_List += ", " - Reynolds_List += str(Reynolds_Value) - Reynolds_List += ")" - data_dict['MULTIPOINT_REYNOLDS_NUMBER'] = Reynolds_List - - if 'MULTIPOINT_TARGET_CL' not in data_dict: - TargetCLValue = data_dict['TARGET_CL'] - TargetCL_List = "(" - for i in range(multipoints): - if i != 0: TargetCL_List += ", " - TargetCL_List += str(TargetCLValue) - TargetCL_List += ")" - data_dict['MULTIPOINT_TARGET_CL'] = TargetCL_List - - if 'MULTIPOINT_FREESTREAM_PRESSURE' not in data_dict: - Pressure_Value = data_dict['FREESTREAM_PRESSURE'] - Pressure_List = "(" - for i in range(multipoints): - if i != 0: Pressure_List += ", " - Pressure_List += str(Pressure_Value) - Pressure_List += ")" - data_dict['MULTIPOINT_FREESTREAM_PRESSURE'] = Pressure_List - - if 'MULTIPOINT_FREESTREAM_TEMPERATURE' not in data_dict: - Temperature_Value = data_dict['FREESTREAM_TEMPERATURE'] - Temperature_List = "(" - for i in range(multipoints): - if i != 0: Temperature_List += ", " - Temperature_List += str(Temperature_Value) - Temperature_List += ")" - data_dict['MULTIPOINT_FREESTREAM_TEMPERATURE'] = Temperature_List - - if 'MULTIPOINT_OUTLET_VALUE' not in data_dict: - if 'NONE' in data_dict['MARKER_OUTLET']: - Outlet_Value = 0.0 - else: - Outlet_Value = data_dict['MARKER_OUTLET'].replace("(", "").replace(")", "").split(',')[1] - Outlet_Value_List = "(" - for i in range(multipoints): - if i != 0: Outlet_Value_List += ", " - Outlet_Value_List += str(Outlet_Value) - Outlet_Value_List += ")" - data_dict['MULTIPOINT_OUTLET_VALUE'] = Outlet_Value_List - - if 'MULTIPOINT_MESH_FILENAME' not in data_dict: - Mesh_Filename = data_dict['MESH_FILENAME'] - Mesh_List = "(" - for i in range(multipoints): - if i != 0: Mesh_List += ", " - Mesh_List += str(Mesh_Filename) - Mesh_List += ")" - data_dict['MULTIPOINT_MESH_FILENAME'] = Mesh_List - - if 'HISTORY_OUTPUT' not in data_dict: - data_dict['HISTORY_OUTPUT'] = ['ITER', 'RMS_RES'] + multipoints = len( + data_dict["MULTIPOINT_WEIGHT"].replace("(", "").replace(")", "").split(",") + ) + + if "MULTIPOINT_MACH_NUMBER" not in data_dict: + Mach_Value = data_dict["MACH_NUMBER"] + Mach_List = "(" + for i in range(multipoints): + if i != 0: + Mach_List += ", " + Mach_List += str(Mach_Value) + Mach_List += ")" + data_dict["MULTIPOINT_MACH_NUMBER"] = Mach_List + + if "MULTIPOINT_AOA" not in data_dict: + Alpha_Value = data_dict["AOA"] + Alpha_List = "(" + for i in range(multipoints): + if i != 0: + Alpha_List += ", " + Alpha_List += str(Alpha_Value) + Alpha_List += ")" + data_dict["MULTIPOINT_AOA"] = Alpha_List + + if "MULTIPOINT_SIDESLIP_ANGLE" not in data_dict: + Beta_Value = data_dict["SIDESLIP_ANGLE"] + Beta_List = "(" + for i in range(multipoints): + if i != 0: + Beta_List += ", " + Beta_List += str(Beta_Value) + Beta_List += ")" + data_dict["MULTIPOINT_SIDESLIP_ANGLE"] = Beta_List + + if "MULTIPOINT_REYNOLDS_NUMBER" not in data_dict: + Reynolds_Value = data_dict["REYNOLDS_NUMBER"] + Reynolds_List = "(" + for i in range(multipoints): + if i != 0: + Reynolds_List += ", " + Reynolds_List += str(Reynolds_Value) + Reynolds_List += ")" + data_dict["MULTIPOINT_REYNOLDS_NUMBER"] = Reynolds_List + + if "MULTIPOINT_TARGET_CL" not in data_dict: + TargetCLValue = data_dict["TARGET_CL"] + TargetCL_List = "(" + for i in range(multipoints): + if i != 0: + TargetCL_List += ", " + TargetCL_List += str(TargetCLValue) + TargetCL_List += ")" + data_dict["MULTIPOINT_TARGET_CL"] = TargetCL_List + + if "MULTIPOINT_FREESTREAM_PRESSURE" not in data_dict: + Pressure_Value = data_dict["FREESTREAM_PRESSURE"] + Pressure_List = "(" + for i in range(multipoints): + if i != 0: + Pressure_List += ", " + Pressure_List += str(Pressure_Value) + Pressure_List += ")" + data_dict["MULTIPOINT_FREESTREAM_PRESSURE"] = Pressure_List + + if "MULTIPOINT_FREESTREAM_TEMPERATURE" not in data_dict: + Temperature_Value = data_dict["FREESTREAM_TEMPERATURE"] + Temperature_List = "(" + for i in range(multipoints): + if i != 0: + Temperature_List += ", " + Temperature_List += str(Temperature_Value) + Temperature_List += ")" + data_dict["MULTIPOINT_FREESTREAM_TEMPERATURE"] = Temperature_List + + if "MULTIPOINT_OUTLET_VALUE" not in data_dict: + if "NONE" in data_dict["MARKER_OUTLET"]: + Outlet_Value = 0.0 + else: + Outlet_Value = ( + data_dict["MARKER_OUTLET"] + .replace("(", "") + .replace(")", "") + .split(",")[1] + ) + Outlet_Value_List = "(" + for i in range(multipoints): + if i != 0: + Outlet_Value_List += ", " + Outlet_Value_List += str(Outlet_Value) + Outlet_Value_List += ")" + data_dict["MULTIPOINT_OUTLET_VALUE"] = Outlet_Value_List + + if "MULTIPOINT_MESH_FILENAME" not in data_dict: + Mesh_Filename = data_dict["MESH_FILENAME"] + Mesh_List = "(" + for i in range(multipoints): + if i != 0: + Mesh_List += ", " + Mesh_List += str(Mesh_Filename) + Mesh_List += ")" + data_dict["MULTIPOINT_MESH_FILENAME"] = Mesh_List + + if "HISTORY_OUTPUT" not in data_dict: + data_dict["HISTORY_OUTPUT"] = ["ITER", "RMS_RES"] # # Default values for optimization parameters (needed for some eval functions # that can be called outside of an opt. context. # - if 'OBJECTIVE_FUNCTION' not in data_dict: - data_dict['OBJECTIVE_FUNCTION']='DRAG' - if 'DV_KIND' not in data_dict: - data_dict['DV_KIND']=['FFD_SETTING'] - if 'DV_PARAM' not in data_dict: - data_dict['DV_PARAM']={'FFDTAG': ['1'], 'PARAM': [[0.0, 0.5]], 'SIZE': [1]} - if 'DEFINITION_DV' not in data_dict: - data_dict['DEFINITION_DV']={'FFDTAG': [[]], - 'KIND': ['HICKS_HENNE'], - 'MARKER': [['WING']], - 'PARAM': [[0.0, 0.05]], - 'SCALE': [1.0], - 'SIZE': [1]} - if 'VALUE_OBJFUNC_FILENAME' not in data_dict: - data_dict['VALUE_OBJFUNC_FILENAME'] = 'of_eval.dat' - if 'GRAD_OBJFUNC_FILENAME' not in data_dict: - data_dict['GRAD_OBJFUNC_FILENAME'] = 'of_grad.dat' + if "OBJECTIVE_FUNCTION" not in data_dict: + data_dict["OBJECTIVE_FUNCTION"] = "DRAG" + if "DV_KIND" not in data_dict: + data_dict["DV_KIND"] = ["FFD_SETTING"] + if "DV_PARAM" not in data_dict: + data_dict["DV_PARAM"] = {"FFDTAG": ["1"], "PARAM": [[0.0, 0.5]], "SIZE": [1]} + if "DEFINITION_DV" not in data_dict: + data_dict["DEFINITION_DV"] = { + "FFDTAG": [[]], + "KIND": ["HICKS_HENNE"], + "MARKER": [["WING"]], + "PARAM": [[0.0, 0.05]], + "SCALE": [1.0], + "SIZE": [1], + } + if "VALUE_OBJFUNC_FILENAME" not in data_dict: + data_dict["VALUE_OBJFUNC_FILENAME"] = "of_eval.dat" + if "GRAD_OBJFUNC_FILENAME" not in data_dict: + data_dict["GRAD_OBJFUNC_FILENAME"] = "of_grad.dat" return data_dict -#: def read_config() +#: def read_config() # ------------------------------------------------------------------- # Set SU2 Configuration Parameters # ------------------------------------------------------------------- -def write_config(filename,param_dict): - """ updates an existing config file """ - temp_filename = filename+"_tmp" - shutil.copy(filename,temp_filename) - output_file = open(filename,"w") +def write_config(filename, param_dict): + """updates an existing config file""" + + temp_filename = filename + "_tmp" + shutil.copy(filename, temp_filename) + output_file = open(filename, "w") # break pointers param_dict = copy.deepcopy(param_dict) for raw_line in open(temp_filename): # remove line returns - line = raw_line.strip('\r\n') + line = raw_line.strip("\r\n") # make sure it has useful data if not "=" in line: @@ -848,7 +942,7 @@ def write_config(filename,param_dict): # split across equals sign line = line.split("=") this_param = line[0].strip() - old_value = line[1].strip() + old_value = line[1].strip() # skip if parameter unwanted if this_param not in param_dict: @@ -863,43 +957,52 @@ def write_config(filename,param_dict): for case in switch(this_param): # comma delimited list of floats - if case("DV_VALUE_NEW") : pass - if case("DV_VALUE_OLD") : pass - if case("DV_VALUE") : + if case("DV_VALUE_NEW"): + pass + if case("DV_VALUE_OLD"): + pass + if case("DV_VALUE"): n_lists = len(new_value) for i_value in range(n_lists): output_file.write("%s" % new_value[i_value]) - if i_value+1 < n_lists: + if i_value + 1 < n_lists: output_file.write(", ") break # comma delimited list of strings no paren's - if case("DV_KIND") : pass - if case("TASKS") : pass - if case("GRADIENTS") : - if not isinstance(new_value,list): - new_value = [ new_value ] + if case("DV_KIND"): + pass + if case("TASKS"): + pass + if case("GRADIENTS"): + if not isinstance(new_value, list): + new_value = [new_value] n_lists = len(new_value) for i_value in range(n_lists): output_file.write(new_value[i_value]) - if i_value+1 < n_lists: + if i_value + 1 < n_lists: output_file.write(", ") break # comma delimited list of strings inside paren's - if case("MARKER_EULER") : pass - if case("MARKER_FAR") : pass - if case("MARKER_PLOTTING") : pass - if case("MARKER_MONITORING") : pass - if case("MARKER_SYM") : pass - if case("DV_MARKER") : - if not isinstance(new_value,list): - new_value = [ new_value ] + if case("MARKER_EULER"): + pass + if case("MARKER_FAR"): + pass + if case("MARKER_PLOTTING"): + pass + if case("MARKER_MONITORING"): + pass + if case("MARKER_SYM"): + pass + if case("DV_MARKER"): + if not isinstance(new_value, list): + new_value = [new_value] output_file.write("( ") n_lists = len(new_value) for i_value in range(n_lists): output_file.write(new_value[i_value]) - if i_value+1 < n_lists: + if i_value + 1 < n_lists: output_file.write(", ") output_file.write(" )") break @@ -908,7 +1011,7 @@ def write_config(filename,param_dict): output_file.write("(") for i_value in range(n_lists): output_file.write(new_value[i_value]) - if i_value+1 < n_lists: + if i_value + 1 < n_lists: output_file.write(", ") output_file.write(")") break @@ -918,7 +1021,7 @@ def write_config(filename,param_dict): output_file.write("(") for i_value in range(n_lists): output_file.write(new_value[i_value]) - if i_value+1 < n_lists: + if i_value + 1 < n_lists: output_file.write(", ") output_file.write(")") break @@ -927,123 +1030,158 @@ def write_config(filename,param_dict): n_lists = len(new_value) for i_value in range(n_lists): output_file.write(new_value[i_value]) - if i_value+1 < n_lists: + if i_value + 1 < n_lists: output_file.write(", ") break # semicolon delimited lists of comma delimited lists - if case("DV_PARAM") : + if case("DV_PARAM"): - assert isinstance(new_value['PARAM'],list) , 'incorrect specification of DV_PARAM' - if not isinstance(new_value['PARAM'][0],list): new_value = [ new_value ] + assert isinstance( + new_value["PARAM"], list + ), "incorrect specification of DV_PARAM" + if not isinstance(new_value["PARAM"][0], list): + new_value = [new_value] - for i_value in range(len(new_value['PARAM'])): + for i_value in range(len(new_value["PARAM"])): output_file.write("( ") - this_param_list = new_value['PARAM'][i_value] - this_ffd_list = new_value['FFDTAG'][i_value] + this_param_list = new_value["PARAM"][i_value] + this_ffd_list = new_value["FFDTAG"][i_value] n_lists = len(this_param_list) if this_ffd_list != []: - output_file.write("%s, " % this_ffd_list) - for j_value in range(1,n_lists): - output_file.write("%s" % this_param_list[j_value]) - if j_value+1 < n_lists: - output_file.write(", ") + output_file.write("%s, " % this_ffd_list) + for j_value in range(1, n_lists): + output_file.write("%s" % this_param_list[j_value]) + if j_value + 1 < n_lists: + output_file.write(", ") else: - for j_value in range(n_lists): - output_file.write("%s" % this_param_list[j_value]) - if j_value+1 < n_lists: - output_file.write(", ") + for j_value in range(n_lists): + output_file.write("%s" % this_param_list[j_value]) + if j_value + 1 < n_lists: + output_file.write(", ") output_file.write(") ") - if i_value+1 < len(new_value['PARAM']): + if i_value + 1 < len(new_value["PARAM"]): output_file.write("; ") break # int parameters - if case("NUMBER_PART") : pass - if case("ADAPT_CYCLES") : pass - if case("TIME_INSTANCES") : pass - if case("AVAILABLE_PROC") : pass - if case("UNST_ADJOINT_ITER") : pass - if case("ITER") or\ - case("TIME_ITER") or\ - case("INNER_ITER") or\ - case("OUTER_ITER"): + if case("NUMBER_PART"): + pass + if case("ADAPT_CYCLES"): + pass + if case("TIME_INSTANCES"): + pass + if case("AVAILABLE_PROC"): + pass + if case("UNST_ADJOINT_ITER"): + pass + if ( + case("ITER") + or case("TIME_ITER") + or case("INNER_ITER") + or case("OUTER_ITER") + ): output_file.write("%i" % new_value) break - if case("DEFINITION_DV") : - n_dv = len(new_value['KIND']) + if case("DEFINITION_DV"): + n_dv = len(new_value["KIND"]) if not n_dv: output_file.write("NONE") for i_dv in range(n_dv): - this_kind = new_value['KIND'][i_dv] + this_kind = new_value["KIND"][i_dv] output_file.write("( ") - output_file.write("%i , " % get_dvID(this_kind) ) - output_file.write("%s " % new_value['SCALE'][i_dv]) + output_file.write("%i , " % get_dvID(this_kind)) + output_file.write("%s " % new_value["SCALE"][i_dv]) output_file.write("| ") # markers - n_mark = len(new_value['MARKER'][i_dv]) + n_mark = len(new_value["MARKER"][i_dv]) for i_mark in range(n_mark): - output_file.write("%s " % new_value['MARKER'][i_dv][i_mark]) - if i_mark+1 < n_mark: + output_file.write("%s " % new_value["MARKER"][i_dv][i_mark]) + if i_mark + 1 < n_mark: output_file.write(", ") #: for each marker - if not this_kind in ['AOA','MACH_NUMBER']: + if not this_kind in ["AOA", "MACH_NUMBER"]: output_file.write(" | ") # params - if this_kind in ['FFD_SETTING','FFD_ANGLE_OF_ATTACK','FFD_CONTROL_POINT','FFD_NACELLE','FFD_GULL','FFD_TWIST_ANGLE','FFD_TWIST','FFD_TWIST_2D','FFD_ROTATION','FFD_CAMBER','FFD_THICKNESS','FFD_CONTROL_POINT_2D','FFD_CAMBER_2D','FFD_THICKNESS_2D']: - n_param = len(new_value['PARAM'][i_dv]) - output_file.write("%s , " % new_value['FFDTAG'][i_dv]) - for i_param in range(1,n_param): - output_file.write("%s " % new_value['PARAM'][i_dv][i_param]) - if i_param+1 < n_param: + if this_kind in [ + "FFD_SETTING", + "FFD_ANGLE_OF_ATTACK", + "FFD_CONTROL_POINT", + "FFD_NACELLE", + "FFD_GULL", + "FFD_TWIST_ANGLE", + "FFD_TWIST", + "FFD_ROTATION", + "FFD_CAMBER", + "FFD_THICKNESS", + "FFD_CONTROL_POINT_2D", + "FFD_CAMBER_2D", + "FFD_THICKNESS_2D", + ]: + n_param = len(new_value["PARAM"][i_dv]) + output_file.write("%s , " % new_value["FFDTAG"][i_dv]) + for i_param in range(1, n_param): + output_file.write( + "%s " % new_value["PARAM"][i_dv][i_param] + ) + if i_param + 1 < n_param: output_file.write(", ") else: - n_param = len(new_value['PARAM'][i_dv]) + n_param = len(new_value["PARAM"][i_dv]) for i_param in range(n_param): - output_file.write("%s " % new_value['PARAM'][i_dv][i_param]) - if i_param+1 < n_param: + output_file.write( + "%s " % new_value["PARAM"][i_dv][i_param] + ) + if i_param + 1 < n_param: output_file.write(", ") #: for each param output_file.write(" )") - if i_dv+1 < n_dv: + if i_dv + 1 < n_dv: output_file.write("; ") #: for each dv break if case("OPT_OBJECTIVE"): n_obj = 0 - for name,value in new_value.items(): - if n_obj>0: output_file.write("; ") - if value['OBJTYPE']=='DEFAULT': - output_file.write( "%s * %s " % (name,value['SCALE']) ) + for name, value in new_value.items(): + if n_obj > 0: + output_file.write("; ") + if value["OBJTYPE"] == "DEFAULT": + output_file.write("%s * %s " % (name, value["SCALE"])) else: - output_file.write( "( %s %s %s ) * %s" - % (name, value['OBJTYPE'], value['VALUE'], value['SCALE']) ) + output_file.write( + "( %s %s %s ) * %s" + % (name, value["OBJTYPE"], value["VALUE"], value["SCALE"]) + ) n_obj += 1 break if case("OPT_CONSTRAINT"): i_con = 0 - for con_type in ['EQUALITY','INEQUALITY']: + for con_type in ["EQUALITY", "INEQUALITY"]: this_con = new_value[con_type] - for name,value in this_con.items(): - if i_con>0: output_file.write("; ") - output_file.write( "( %s %s %s ) * %s" - % (name, value['SIGN'], value['VALUE'], value['SCALE']) ) + for name, value in this_con.items(): + if i_con > 0: + output_file.write("; ") + output_file.write( + "( %s %s %s ) * %s" + % (name, value["SIGN"], value["VALUE"], value["SCALE"]) + ) i_con += 1 #: for each constraint #: for each constraint type - if not i_con: output_file.write("NONE") + if not i_con: + output_file.write("NONE") break # default, assume string, integer or unformatted float if case(): - output_file.write('%s' % new_value) + output_file.write("%s" % new_value) break #: for case @@ -1058,29 +1196,32 @@ def write_config(filename,param_dict): # check that all params were used for this_param in param_dict.keys(): - if not this_param in ['JOB_NUMBER']: - print('Warning: Parameter %s not found in config file and was not written' % (this_param)) + if not this_param in ["JOB_NUMBER"]: + print( + "Warning: Parameter %s not found in config file and was not written" + % (this_param) + ) output_file.close() os.remove(temp_filename) + #: def write_config() -def dump_config(filename,config): - ''' dumps a raw config file with all options in config - and no comments - ''' +def dump_config(filename, config): + """dumps a raw config file with all options in config + and no comments + """ # HACK - twl - if 'DV_VALUE_NEW' in config: + if "DV_VALUE_NEW" in config: config.DV_VALUE = config.DV_VALUE_NEW - config_file = open(filename,'w') + config_file = open(filename, "w") # write dummy file for key in config.keys(): - config_file.write( '%s= 0 \n' % key ) + config_file.write("%s= 0 \n" % key) config_file.close() # dump data - write_config(filename,config) - + write_config(filename, config) diff --git a/SU2_PY/SU2/io/config_options.py b/SU2_PY/SU2/io/config_options.py index 6423e8499d0..dce4261f427 100644 --- a/SU2_PY/SU2/io/config_options.py +++ b/SU2_PY/SU2/io/config_options.py @@ -1,7 +1,7 @@ # \file config_options.py # \brief python package for config # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -29,130 +29,137 @@ from ..util import ordered_bunch + class OptionError(Exception): pass -class Option(object): +class Option(object): def __init__(self): self.val = "" def __get__(self): return self.val - def __set__(self,newval): + def __set__(self, newval): self.val = newval + #: class Option -class MathProblem(Option): - def __init__(self,*args,**kwarg): - super(MathProblem,self).__init__(*args,**kwarg) - self.validoptions = ['DIRECT','CONTINUOUS_ADJOINT','LINEARIZED'] +class MathProblem(Option): + def __init__(self, *args, **kwarg): + super(MathProblem, self).__init__(*args, **kwarg) + self.validoptions = ["DIRECT", "CONTINUOUS_ADJOINT", "LINEARIZED"] - def __set__(self,newval): + def __set__(self, newval): if not self.newval in self.validoptions: - raise OptionError("Invalid option. Valid options are: %s"%self.validoptions) - super(MathProblem,self).__set__(newval) + raise OptionError( + "Invalid option. Valid options are: %s" % self.validoptions + ) + super(MathProblem, self).__set__(newval) + #: class MathProblem + class DEFINITION_DV(ordered_bunch): - """ SU2.io.config.DEFINITION_DV() - - List of design variables (Design variables are separated by semicolons) - 2D Design variables - -FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) - -FFD_CAMBER_2D ( 20, Scale | Mark. List | FFD_BoxTag, i_Ind ) - -FFD_THICKNESS_2D ( 21, Scale | Mark. List | FFD_BoxTag, i_Ind ) - -FFD_TWIST_2D ( 22, Scale | Mark. List | FFD_BoxTag, x_Orig, y_Orig ) - -HICKS_HENNE ( 30, Scale | Mark. List | Lower(0)/Upper(1) side, x_Loc ) - -ANGLE_OF_ATTACK ( 101, Scale | Mark. List | 1.0 ) - - 3D Design variables - -FFD_CONTROL_POINT ( 11, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Mov, y_Mov, z_Mov ) - -FFD_NACELLE ( 12, Scale | Mark. List | FFD_BoxTag, rho_Ind, theta_Ind, phi_Ind, rho_Mov, phi_Mov ) - -FFD_GULL ( 13, Scale | Mark. List | FFD_BoxTag, j_Ind ) - -FFD_CAMBER ( 14, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind ) - -FFD_TWIST ( 15, Scale | Mark. List | FFD_BoxTag, j_Ind, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) - -FFD_THICKNESS ( 16, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind ) - -FFD_ROTATION ( 18, Scale | Mark. List | FFD_BoxTag, x_Axis, y_Axis, z_Axis, x_Turn, y_Turn, z_Turn ) - -FFD_ANGLE_OF_ATTACK ( 24, Scale | Mark. List | FFD_BoxTag, 1.0 ) - - Global design variables - -TRANSLATION ( 1, Scale | Mark. List | x_Disp, y_Disp, z_Disp ) - -ROTATION ( 2, Scale | Mark. List | x_Axis, y_Axis, z_Axis, x_Turn, y_Turn, z_Turn ) + """SU2.io.config.DEFINITION_DV() + + List of design variables (Design variables are separated by semicolons) + 2D Design variables + -FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) + -FFD_CAMBER_2D ( 20, Scale | Mark. List | FFD_BoxTag, i_Ind ) + -FFD_THICKNESS_2D ( 21, Scale | Mark. List | FFD_BoxTag, i_Ind ) + -HICKS_HENNE ( 30, Scale | Mark. List | Lower(0)/Upper(1) side, x_Loc ) + -ANGLE_OF_ATTACK ( 101, Scale | Mark. List | 1.0 ) + + 3D Design variables + -FFD_CONTROL_POINT ( 11, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Mov, y_Mov, z_Mov ) + -FFD_NACELLE ( 12, Scale | Mark. List | FFD_BoxTag, rho_Ind, theta_Ind, phi_Ind, rho_Mov, phi_Mov ) + -FFD_GULL ( 13, Scale | Mark. List | FFD_BoxTag, j_Ind ) + -FFD_CAMBER ( 14, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind ) + -FFD_TWIST ( 15, Scale | Mark. List | FFD_BoxTag, j_Ind, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) + -FFD_THICKNESS ( 16, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind ) + -FFD_ROTATION ( 18, Scale | Mark. List | FFD_BoxTag, x_Axis, y_Axis, z_Axis, x_Turn, y_Turn, z_Turn ) + -FFD_ANGLE_OF_ATTACK ( 24, Scale | Mark. List | FFD_BoxTag, 1.0 ) + + Global design variables + -TRANSLATION ( 1, Scale | Mark. List | x_Disp, y_Disp, z_Disp ) + -ROTATION ( 2, Scale | Mark. List | x_Axis, y_Axis, z_Axis, x_Turn, y_Turn, z_Turn ) """ - def __init__(self,*args,**kwarg): + def __init__(self, *args, **kwarg): ordered_bunch.__init__(self) - self.KIND = [] - self.SCALE = [] + self.KIND = [] + self.SCALE = [] self.MARKER = [] self.FFDTAG = [] - self.PARAM = [] - self.update(ordered_bunch(*args,**kwarg)) - - def append(self,new_dv): - self.KIND. append(new_dv['KIND']) - self.SCALE. append(new_dv['SCALE']) - self.MARKER.append(new_dv['MARKER']) - self.FFDTAG.append(new_dv['FFDTAG']) - self.PARAM. append(new_dv['PARAM']) - - def extend(self,new_dvs): - assert isinstance(new_dvs,DEFINITION_DV) , 'input must be of type DEFINITION_DV' - self.KIND. extend(new_dvs['KIND']) - self.SCALE. extend(new_dvs['SCALE']) - self.MARKER.extend(new_dvs['MARKER']) - self.FFDTAG.extend(new_dvs['FFDTAG']) - self.PARAM. extend(new_dvs['PARAM']) + self.PARAM = [] + self.update(ordered_bunch(*args, **kwarg)) + + def append(self, new_dv): + self.KIND.append(new_dv["KIND"]) + self.SCALE.append(new_dv["SCALE"]) + self.MARKER.append(new_dv["MARKER"]) + self.FFDTAG.append(new_dv["FFDTAG"]) + self.PARAM.append(new_dv["PARAM"]) + + def extend(self, new_dvs): + assert isinstance(new_dvs, DEFINITION_DV), "input must be of type DEFINITION_DV" + self.KIND.extend(new_dvs["KIND"]) + self.SCALE.extend(new_dvs["SCALE"]) + self.MARKER.extend(new_dvs["MARKER"]) + self.FFDTAG.extend(new_dvs["FFDTAG"]) + self.PARAM.extend(new_dvs["PARAM"]) + #: class DEFINITION_DV + class DV_KIND(ordered_bunch): - """ SU2.io.config.DV_KIND() - - List of design variables (Design variables are separated by semicolons) - 2D Design variables - -FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) - -FFD_CAMBER_2D ( 20, Scale | Mark. List | FFD_BoxTag, i_Ind ) - -FFD_THICKNESS_2D ( 21, Scale | Mark. List | FFD_BoxTag, i_Ind ) - -FFD_TWIST_2D ( 22, Scale | Mark. List | FFD_BoxTag, x_Orig, y_Orig ) - -HICKS_HENNE ( 30, Scale | Mark. List | Lower(0)/Upper(1) side, x_Loc ) - -ANGLE_OF_ATTACK ( 101, Scale | Mark. List | 1.0 ) - - 3D Design variables - -FFD_CONTROL_POINT ( 11, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Mov, y_Mov, z_Mov ) - -FFD_NACELLE ( 12, Scale | Mark. List | FFD_BoxTag, rho_Ind, theta_Ind, phi_Ind, rho_Mov, phi_Mov ) - -FFD_GULL ( 13, Scale | Mark. List | FFD_BoxTag, j_Ind ) - -FFD_CAMBER ( 14, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind ) - -FFD_TWIST ( 15, Scale | Mark. List | FFD_BoxTag, j_Ind, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) - -FFD_THICKNESS ( 16, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind ) - -FFD_ROTATION ( 18, Scale | Mark. List | FFD_BoxTag, x_Axis, y_Axis, z_Axis, x_Turn, y_Turn, z_Turn ) - -FFD_ANGLE_OF_ATTACK ( 24, Scale | Mark. List | FFD_BoxTag, 1.0 ) - - Global design variables - -TRANSLATION ( 1, Scale | Mark. List | x_Disp, y_Disp, z_Disp ) - -ROTATION ( 2, Scale | Mark. List | x_Axis, y_Axis, z_Axis, x_Turn, y_Turn, z_Turn ) + """SU2.io.config.DV_KIND() + + List of design variables (Design variables are separated by semicolons) + 2D Design variables + -FFD_CONTROL_POINT_2D ( 19, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, x_Mov, y_Mov ) + -FFD_CAMBER_2D ( 20, Scale | Mark. List | FFD_BoxTag, i_Ind ) + -FFD_THICKNESS_2D ( 21, Scale | Mark. List | FFD_BoxTag, i_Ind ) + -HICKS_HENNE ( 30, Scale | Mark. List | Lower(0)/Upper(1) side, x_Loc ) + -ANGLE_OF_ATTACK ( 101, Scale | Mark. List | 1.0 ) + + 3D Design variables + -FFD_CONTROL_POINT ( 11, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Mov, y_Mov, z_Mov ) + -FFD_NACELLE ( 12, Scale | Mark. List | FFD_BoxTag, rho_Ind, theta_Ind, phi_Ind, rho_Mov, phi_Mov ) + -FFD_GULL ( 13, Scale | Mark. List | FFD_BoxTag, j_Ind ) + -FFD_CAMBER ( 14, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind ) + -FFD_TWIST ( 15, Scale | Mark. List | FFD_BoxTag, j_Ind, x_Orig, y_Orig, z_Orig, x_End, y_End, z_End ) + -FFD_THICKNESS ( 16, Scale | Mark. List | FFD_BoxTag, i_Ind, j_Ind ) + -FFD_ROTATION ( 18, Scale | Mark. List | FFD_BoxTag, x_Axis, y_Axis, z_Axis, x_Turn, y_Turn, z_Turn ) + -FFD_ANGLE_OF_ATTACK ( 24, Scale | Mark. List | FFD_BoxTag, 1.0 ) + + Global design variables + -TRANSLATION ( 1, Scale | Mark. List | x_Disp, y_Disp, z_Disp ) + -ROTATION ( 2, Scale | Mark. List | x_Axis, y_Axis, z_Axis, x_Turn, y_Turn, z_Turn ) """ - def __init__(self,*args,**kwarg): - ordered_bunch.__init__(self) - self.FFDTAG = [] - self.PARAM = [] - self.update(ordered_bunch(*args,**kwarg)) + def __init__(self, *args, **kwarg): + ordered_bunch.__init__(self) + self.FFDTAG = [] + self.PARAM = [] + self.update(ordered_bunch(*args, **kwarg)) + + def append(self, new_dv): + self.FFDTAG.append(new_dv["FFDTAG"]) + self.PARAM.append(new_dv["PARAM"]) - def append(self,new_dv): - self.FFDTAG.append(new_dv['FFDTAG']) - self.PARAM. append(new_dv['PARAM']) + def extend(self, new_dvs): + assert isinstance(new_dvs, DV_KIND), "input must be of type DV_KIND" + self.FFDTAG.extend(new_dvs["FFDTAG"]) + self.PARAM.extend(new_dvs["PARAM"]) - def extend(self,new_dvs): - assert isinstance(new_dvs,DV_KIND) , 'input must be of type DV_KIND' - self.FFDTAG.extend(new_dvs['FFDTAG']) - self.PARAM. extend(new_dvs['PARAM']) #: class DV_KIND diff --git a/SU2_PY/SU2/io/data.py b/SU2_PY/SU2/io/data.py index ee667f0d18d..850f3eb4eec 100644 --- a/SU2_PY/SU2/io/data.py +++ b/SU2_PY/SU2/io/data.py @@ -3,7 +3,7 @@ ## \file data.py # \brief python package for data utility functions # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -30,6 +30,7 @@ # ---------------------------------------------------------------------- import os, sys, shutil, copy + if sys.version_info[0] > 2: # Py3 pickle now manage both accelerated cPickle and pure python pickle # See https://docs.python.org/3/whatsnew/3.0.html#library-changes, 4th item. @@ -44,67 +45,69 @@ # Load a Dictionary of Data # ------------------------------------------------------------------- -def load_data( file_name, var_names=None , - file_format = 'infer' , - core_name = 'python_data' ): - """ data = load_data( file_name, var_names=None , - file_format = 'infer' , - core_name = 'python_data' ) - - loads dictionary of data from python pickle or matlab struct - - Inputs: - file_name - data file name - var_names - variable names to read - file_format - 'infer', 'pickle', or 'matlab' - core_name - data is stored under a dictionary with this name - - default looks for variable 'python_data' in file_name - file_format = pickle, will return any python object - file_format = matlab, will return strings or float lists and - requires scipy.io.loadmat - file_format = infer (default), will infer format from extention - ('.mat','.pkl') + +def load_data(file_name, var_names=None, file_format="infer", core_name="python_data"): + """data = load_data( file_name, var_names=None , + file_format = 'infer' , + core_name = 'python_data' ) + + loads dictionary of data from python pickle or matlab struct + + Inputs: + file_name - data file name + var_names - variable names to read + file_format - 'infer', 'pickle', or 'matlab' + core_name - data is stored under a dictionary with this name + + default looks for variable 'python_data' in file_name + file_format = pickle, will return any python object + file_format = matlab, will return strings or float lists and + requires scipy.io.loadmat + file_format = infer (default), will infer format from extention + ('.mat','.pkl') """ try: import scipy.io + scipy_loaded = True except ImportError: scipy_loaded = False if not os.path.exists(file_name): - raise Exception('File does not exist: %s' % file_name) + raise Exception("File does not exist: %s" % file_name) # process file format - if file_format == 'infer': - if os.path.splitext(file_name)[1] == '.mat': - file_format = 'matlab' - elif os.path.splitext(file_name)[1] == '.pkl': - file_format = 'pickle' - assert file_format in ['matlab','pickle'] , 'unsupported file format' + if file_format == "infer": + if os.path.splitext(file_name)[1] == ".mat": + file_format = "matlab" + elif os.path.splitext(file_name)[1] == ".pkl": + file_format = "pickle" + assert file_format in ["matlab", "pickle"], "unsupported file format" # get filelock with filelock(file_name): # LOAD MATLAB - if file_format == 'matlab' and scipy_loaded: - input_data = scipy.io.loadmat( file_name = file_name , - squeeze_me = False , - chars_as_strings = True , - struct_as_record = True ) + if file_format == "matlab" and scipy_loaded: + input_data = scipy.io.loadmat( + file_name=file_name, + squeeze_me=False, + chars_as_strings=True, + struct_as_record=True, + ) # pull core variable - assert (core_name in input_data) , 'core data not found' + assert core_name in input_data, "core data not found" input_data = input_data[core_name] # convert recarray to dictionary input_data = rec2dict(input_data) # LOAD PICKLE - elif file_format == 'pickle': + elif file_format == "pickle": input_data = load_pickle(file_name) # pull core variable - assert (core_name in input_data) , 'core data not found' + assert core_name in input_data, "core data not found" input_data = input_data[core_name] #: if file_format @@ -114,8 +117,10 @@ def load_data( file_name, var_names=None , # load specified varname into dictionary if var_names != None: # check for one item name array - if isinstance(var_names,str): - var_names = [var_names,] + if isinstance(var_names, str): + var_names = [ + var_names, + ] for key in input_data.keys(): if not key in var_names: del input_data[key] @@ -124,53 +129,55 @@ def load_data( file_name, var_names=None , return input_data -#: def load() +#: def load() # ------------------------------------------------------------------- # Save a Dictionary of Data # ------------------------------------------------------------------- -def save_data( file_name, data_dict, append=False , + +def save_data( + file_name, data_dict, append=False, file_format="infer", core_name="python_data" +): + """save_data( file_name, data_dict, append=False , file_format = 'infer' , core_name='python_data' ): - """ save_data( file_name, data_dict, append=False , - file_format = 'infer' , - core_name='python_data' ): - - Inputs: - file_name - data file name - data_dict - a dictionary or bunch to write - append - True/False to append existing data - file_format - 'infer', 'pickle', or 'matlab' - core_name - data is stored under a dictionary with this name - - file_format = pickle, will save any pickleable python object - file_format = matlab, will save strings or float lists and - requires scipy.io.loadmat - file_format = infer (default), will infer format from extention - ('.mat','.pkl') - - matlab format saves data file from matlab 5 and later - will save nested dictionaries into nested matlab structures - cannot save classes and modules - uses scipy.io.loadmat + + Inputs: + file_name - data file name + data_dict - a dictionary or bunch to write + append - True/False to append existing data + file_format - 'infer', 'pickle', or 'matlab' + core_name - data is stored under a dictionary with this name + + file_format = pickle, will save any pickleable python object + file_format = matlab, will save strings or float lists and + requires scipy.io.loadmat + file_format = infer (default), will infer format from extention + ('.mat','.pkl') + + matlab format saves data file from matlab 5 and later + will save nested dictionaries into nested matlab structures + cannot save classes and modules + uses scipy.io.loadmat """ try: import scipy.io + scipy_loaded = True except ImportError: scipy_loaded = False # process file format - if file_format == 'infer': - if os.path.splitext(file_name)[1] == '.mat': - file_format = 'matlab' - elif os.path.splitext(file_name)[1] == '.pkl': - file_format = 'pickle' - assert file_format in ['matlab','pickle'] , 'unsupported file format' + if file_format == "infer": + if os.path.splitext(file_name)[1] == ".mat": + file_format = "matlab" + elif os.path.splitext(file_name)[1] == ".pkl": + file_format = "pickle" + assert file_format in ["matlab", "pickle"], "unsupported file format" # get filelock with filelock(file_name): @@ -180,34 +187,38 @@ def save_data( file_name, data_dict, append=False , if append == True and os.path.exists(file_name): # check file exists if not os.path.exists(file_name): - raise Exception('Cannot append, file does not exist: %s' % file_name) + raise Exception("Cannot append, file does not exist: %s" % file_name) # load old data - data_dict_old = load( file_name = file_name , - var_names = None , - file_format = file_format , - core_name = core_name ) + data_dict_old = load( + file_name=file_name, + var_names=None, + file_format=file_format, + core_name=core_name, + ) # check for keys not in new data - for key,value in data_dict_old.iteritems(): - if not(key in data_dict): + for key, value in data_dict_old.iteritems(): + if not (key in data_dict): data_dict[key] = value #: for each dict item #: if append # save to core name - data_dict = {core_name : data_dict} + data_dict = {core_name: data_dict} # SAVE MATLAB - if file_format == 'matlab': + if file_format == "matlab": # bunch it data_dict = mat_bunch(data_dict) # save it - scipy.io.savemat( file_name = file_name , - mdict = data_dict, - format = '5', # matlab 5 .mat format - oned_as = 'column' ) - elif file_format == 'pickle': + scipy.io.savemat( + file_name=file_name, + mdict=data_dict, + format="5", # matlab 5 .mat format + oned_as="column", + ) + elif file_format == "pickle": # save it - save_pickle(file_name,data_dict) + save_pickle(file_name, data_dict) #: if file_format @@ -215,26 +226,27 @@ def save_data( file_name, data_dict, append=False , return -#: def save() +#: def save() # ------------------------------------------------------------------- # Load Pickle # ------------------------------------------------------------------- + def load_pickle(file_name): - """ data = load_pickle(file_name) - loads a pickle with core_data dictionaries - assumes first entry is a list of all following data names - returns dictionary of data + """data = load_pickle(file_name) + loads a pickle with core_data dictionaries + assumes first entry is a list of all following data names + returns dictionary of data """ - pkl_file = open(file_name,'rb') - #names = safe_unpickle.loadf(pkl_file) + pkl_file = open(file_name, "rb") + # names = safe_unpickle.loadf(pkl_file) names = pickle.load(pkl_file) - data_dict = dict.fromkeys(names,[]) + data_dict = dict.fromkeys(names, []) for key in names: - #data_dict[key] = safe_unpickle.loadf(pkl_file) + # data_dict[key] = safe_unpickle.loadf(pkl_file) data_dict[key] = pickle.load(pkl_file) pkl_file.close() return data_dict @@ -244,12 +256,13 @@ def load_pickle(file_name): # Save Pickle # ------------------------------------------------------------------- + def save_pickle(file_name, data_dict): - """ save_pickle(file_name, data_dict) - saves a core data dictionary - first pickle entry is a list of all following data names + """save_pickle(file_name, data_dict) + saves a core data dictionary + first pickle entry is a list of all following data names """ - pkl_file = open(file_name, 'wb') + pkl_file = open(file_name, "wb") names = list(data_dict.keys()) pickle.dump(names, pkl_file) for key in names: @@ -261,84 +274,84 @@ def save_pickle(file_name, data_dict): # Safe UnPickle # ------------------------------------------------------------------- -#class safe_unpickle(pickle.Unpickler): - #''' adds some safety to unpickling - #checks that only supported classes are loaded - #original source from http://nadiana.com/python-pickle-insecure#comment-144 - #''' - - ## modules : classes considered safe - #PICKLE_SAFE = { - #'copy_reg' : ['_reconstructor'] , - #'__builtin__' : ['object'] , - #'numpy' : ['dtype','ndarray'] , - #'numpy.core.multiarray' : ['scalar','_reconstruct'] , - #'collections' : ['OrderedDict'] , - #'SU2.io.state' : ['State'] , # SU2 Specific - #'SU2.io.config' : ['Config'] , - #'SU2.eval.design' : ['Design'] , - #'SU2.opt.project' : ['Project'] , - #'SU2.util.ordered_bunch' : ['OrderedBunch'] , - #'SU2.util.bunch' : ['Bunch'] , - #'tasks_general' : ['General_Task'] , - #'tasks_project' : ['Project','Job'] , - #'tasks_su2' : ['Decomp','Deform','Direct','Cont_Adjoint', - #'Multiple_Cont_Adjoint','Finite_Diff','Adapt'] , - #} - - ## make sets - #for key in PICKLE_SAFE.keys(): - #PICKLE_SAFE[key] = set(PICKLE_SAFE[key]) - - ## check for save module/class - #def find_class(self, module, name): - #if not module in self.PICKLE_SAFE: - #raise pickle.UnpicklingError( - #'Attempting to unpickle unsafe module %s' % module - #) - #__import__(module) - #mod = sys.modules[module] - #if not name in self.PICKLE_SAFE[module]: - #raise pickle.UnpicklingError( - #'Attempting to unpickle unsafe class %s' % name - #) - #klass = getattr(mod, name) - #return klass - - ## extend the load() and loads() methods - #@classmethod - #def loadf(self, pickle_file): # loads a file like pickle.load() - #return self(pickle_file).load() - #@classmethod - #def loads(self, pickle_string): #loads a string like pickle.loads() - #return self(StringIO.StringIO(pickle_string)).load() - +# class safe_unpickle(pickle.Unpickler): +#''' adds some safety to unpickling +# checks that only supported classes are loaded +# original source from http://nadiana.com/python-pickle-insecure#comment-144 +#''' + +## modules : classes considered safe +# PICKLE_SAFE = { +#'copy_reg' : ['_reconstructor'] , +#'__builtin__' : ['object'] , +#'numpy' : ['dtype','ndarray'] , +#'numpy.core.multiarray' : ['scalar','_reconstruct'] , +#'collections' : ['OrderedDict'] , +#'SU2.io.state' : ['State'] , # SU2 Specific +#'SU2.io.config' : ['Config'] , +#'SU2.eval.design' : ['Design'] , +#'SU2.opt.project' : ['Project'] , +#'SU2.util.ordered_bunch' : ['OrderedBunch'] , +#'SU2.util.bunch' : ['Bunch'] , +#'tasks_general' : ['General_Task'] , +#'tasks_project' : ['Project','Job'] , +#'tasks_su2' : ['Decomp','Deform','Direct','Cont_Adjoint', +#'Multiple_Cont_Adjoint','Finite_Diff','Adapt'] , +# } + +## make sets +# for key in PICKLE_SAFE.keys(): +# PICKLE_SAFE[key] = set(PICKLE_SAFE[key]) + +## check for save module/class +# def find_class(self, module, name): +# if not module in self.PICKLE_SAFE: +# raise pickle.UnpicklingError( +#'Attempting to unpickle unsafe module %s' % module +# ) +# __import__(module) +# mod = sys.modules[module] +# if not name in self.PICKLE_SAFE[module]: +# raise pickle.UnpicklingError( +#'Attempting to unpickle unsafe class %s' % name +# ) +# klass = getattr(mod, name) +# return klass + +## extend the load() and loads() methods +# @classmethod +# def loadf(self, pickle_file): # loads a file like pickle.load() +# return self(pickle_file).load() +# @classmethod +# def loads(self, pickle_string): #loads a string like pickle.loads() +# return self(StringIO.StringIO(pickle_string)).load() # ------------------------------------------------------------------- # Convert Record Array to Dictionary # ------------------------------------------------------------------- + def rec2dict(array_in): - """ converts numpy record array to dictionary of lists - needed for loading matlab data - assumes array comes from scipy.io.loadmat, with - squeeze_me = False and struct_as_record = True + """converts numpy record array to dictionary of lists + needed for loading matlab data + assumes array comes from scipy.io.loadmat, with + squeeze_me = False and struct_as_record = True """ import numpy - assert isinstance(array_in,numpy.ndarray) , 'input must be a numpy record array' + assert isinstance(array_in, numpy.ndarray), "input must be a numpy record array" # make sure it's not an object array - if array_in.dtype == numpy.dtype('object'): + if array_in.dtype == numpy.dtype("object"): array_in = array_in.tolist() # get record keys/names keys = array_in.dtype.names # start output dictionary - dataout = dict.fromkeys(keys,[]) + dataout = dict.fromkeys(keys, []) for key in keys: @@ -346,11 +359,11 @@ def rec2dict(array_in): value = array_in[key].tolist()[0][0] # convert string - if isinstance(value[0],unicode): + if isinstance(value[0], unicode): value = str(value[0]) # convert array - elif isinstance(value,numpy.ndarray): + elif isinstance(value, numpy.ndarray): # check for another struct level if value.dtype.names == None: value = value.tolist() @@ -363,6 +376,7 @@ def rec2dict(array_in): return dataout + #: def rec2dict() @@ -370,30 +384,31 @@ def rec2dict(array_in): # Flatten a List # ------------------------------------------------------------------- + def flatten_list(input_list): - ''' flatten an irregular list of lists of any depth - ''' + """flatten an irregular list of lists of any depth""" output_list = [] for value in input_list: - if isinstance(value,list): - output_list.extend( flatten_list(value) ) # telescope + if isinstance(value, list): + output_list.extend(flatten_list(value)) # telescope else: output_list.append(value) return output_list -#: def flatten_list() +#: def flatten_list() # ------------------------------------------------------------------- # Append Lists in a Nested Dictionary # ------------------------------------------------------------------- -def append_nestdict(base_dict,add_dict): - """ append_nestdict(base_dict,add_dict) - appends base_dict with add_dict, allowing for - updating nested dictionaries - will update base_dict in place + +def append_nestdict(base_dict, add_dict): + """append_nestdict(base_dict,add_dict) + appends base_dict with add_dict, allowing for + updating nested dictionaries + will update base_dict in place """ # break pointer @@ -404,18 +419,19 @@ def append_nestdict(base_dict,add_dict): # ensure base_dict key exists and is a list if not base_dict.has_key(key): - if isinstance( add_dict[key] , dict ): + if isinstance(add_dict[key], dict): base_dict[key] = {} else: base_dict[key] = [] - elif not ( isinstance( base_dict[key] , list ) - or isinstance( base_dict[key] , dict ) ): - assert not isinstance( add_dict[key] , dict ) , 'base[key] is not a dictionary while add[key] is' + elif not (isinstance(base_dict[key], list) or isinstance(base_dict[key], dict)): + assert not isinstance( + add_dict[key], dict + ), "base[key] is not a dictionary while add[key] is" base_dict[key] = [base_dict[key]] # append list or telescope - if isinstance( base_dict[key] , dict ): - append_nestdict(base_dict[key],add_dict[key]) # telescope + if isinstance(base_dict[key], dict): + append_nestdict(base_dict[key], add_dict[key]) # telescope else: base_dict[key].append(add_dict[key]) @@ -424,28 +440,27 @@ def append_nestdict(base_dict,add_dict): # base_dict will be updated through its pointer return -#: def append_nestdict() - - - - +#: def append_nestdict() # ------------------------------------------------------------------- # Matlab Bunch Class # ------------------------------------------------------------------- + class mat_bunch: - """ replicates dictionary functionality with class dot structure - for output of dictionaries to matlab + """replicates dictionary functionality with class dot structure + for output of dictionaries to matlab """ def __init__(self, d): for k, v in d.items(): if isinstance(v, dict): - if len(v): v = mat_bunch(v) - else: v = [] + if len(v): + v = mat_bunch(v) + else: + v = [] self.__dict__[k] = v def __dict__(self): @@ -454,27 +469,31 @@ def __dict__(self): # items def keys(self): return self.__dict__.keys() + def values(self): return self.__dict__.values() + def items(self): return self.__dict__.items() # dictionary get/set/etc - def __getitem__(self,k): + def __getitem__(self, k): return self.__dict__[k] - def __setitem__(self,k,v): + + def __setitem__(self, k, v): self.__dict__[k] = v - def __delitem__(self,k): + + def __delitem__(self, k): del self.__dict__[k] + def __str__(self): - print_format = '%s: %s' + print_format = "%s: %s" state = [] - for k,v in self.__dict__.items(): - if isinstance(v,mat_bunch): - v = '%i-item mat_bunch' % len(v.items()) - state.append(print_format % (k,v) ) - return '\n'.join(state) - -#: class mat_bunch + for k, v in self.__dict__.items(): + if isinstance(v, mat_bunch): + v = "%i-item mat_bunch" % len(v.items()) + state.append(print_format % (k, v)) + return "\n".join(state) +#: class mat_bunch diff --git a/SU2_PY/SU2/io/filelock.py b/SU2_PY/SU2/io/filelock.py index 87da207295f..0bdda9ae390 100644 --- a/SU2_PY/SU2/io/filelock.py +++ b/SU2_PY/SU2/io/filelock.py @@ -3,7 +3,7 @@ ## \file filelock.py # \brief python package for filelocking # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -32,27 +32,27 @@ # File Lock Class # ------------------------------------------------------------------- class filelock(object): - """ A file locking mechanism that has context-manager support so - you can use it in a with statement. - - Example: - with filelock("test.txt", timeout=2, delay=0.5): - print("Lock acquired.") - # Do something with the locked file - - Inputs: - file_name - filename to lock - timeout - default 10sec, maximum timeout to wait for lock - delay - default 0.05sec, delay between each attempt to lock - number incremented with a random perturbation - - original source: Evan Fosmark, BSD license - http://www.evanfosmark.com/2009/01/cross-platform-file-locking-support-in-python/ + """A file locking mechanism that has context-manager support so + you can use it in a with statement. + + Example: + with filelock("test.txt", timeout=2, delay=0.5): + print("Lock acquired.") + # Do something with the locked file + + Inputs: + file_name - filename to lock + timeout - default 10sec, maximum timeout to wait for lock + delay - default 0.05sec, delay between each attempt to lock + number incremented with a random perturbation + + original source: Evan Fosmark, BSD license + http://www.evanfosmark.com/2009/01/cross-platform-file-locking-support-in-python/ """ - def __init__(self, file_name, timeout=10, delay=.05): - """ Prepare the file locker. Specify the file to lock and optionally - the maximum timeout and the delay between each attempt to lock. + def __init__(self, file_name, timeout=10, delay=0.05): + """Prepare the file locker. Specify the file to lock and optionally + the maximum timeout and the delay between each attempt to lock. """ self.is_locked = False self.lockfile = os.path.join(os.getcwd(), "%s.lock" % file_name) @@ -60,63 +60,62 @@ def __init__(self, file_name, timeout=10, delay=.05): self.timeout = timeout self.delay = delay - def acquire(self): - """ Acquire the lock, if possible. If the lock is in use, it check again - every `wait` seconds. It does this until it either gets the lock or - exceeds `timeout` number of seconds, in which case it throws - an exception. + """Acquire the lock, if possible. If the lock is in use, it check again + every `wait` seconds. It does this until it either gets the lock or + exceeds `timeout` number of seconds, in which case it throws + an exception. """ start_time = time.time() while True: try: - self.fd = os.open(self.lockfile, os.O_CREAT|os.O_EXCL|os.O_RDWR) - break; + self.fd = os.open(self.lockfile, os.O_CREAT | os.O_EXCL | os.O_RDWR) + break except OSError as e: if e.errno != errno.EEXIST: raise if (time.time() - start_time) >= self.timeout: - raise FileLockException("FileLock timeout occured for %s" % self.lockfile) - delay = self.delay*( 1. + 0.2*random() ) + raise FileLockException( + "FileLock timeout occured for %s" % self.lockfile + ) + delay = self.delay * (1.0 + 0.2 * random()) time.sleep(delay) self.is_locked = True - def release(self): - """ Get rid of the lock by deleting the lockfile. - When working in a `with` statement, this gets automatically - called at the end. + """Get rid of the lock by deleting the lockfile. + When working in a `with` statement, this gets automatically + called at the end. """ if self.is_locked: os.close(self.fd) os.unlink(self.lockfile) self.is_locked = False - def __enter__(self): - """ Activated when used in the with statement. - Should automatically acquire a lock to be used in the with block. + """Activated when used in the with statement. + Should automatically acquire a lock to be used in the with block. """ if not self.is_locked: self.acquire() return self - def __exit__(self, type, value, traceback): - """ Activated at the end of the with statement. - It automatically releases the lock if it isn't locked. + """Activated at the end of the with statement. + It automatically releases the lock if it isn't locked. """ if self.is_locked: self.release() - def __del__(self): - """ Make sure that the FileLock instance doesn't leave a lockfile - lying around. + """Make sure that the FileLock instance doesn't leave a lockfile + lying around. """ self.release() + class FileLockException(Exception): pass + #: class filelock diff --git a/SU2_PY/SU2/io/historyMap.py b/SU2_PY/SU2/io/historyMap.py index 1e16597389c..a477478359c 100644 --- a/SU2_PY/SU2/io/historyMap.py +++ b/SU2_PY/SU2/io/historyMap.py @@ -1,1480 +1,2011 @@ -history_header_map = {'ADJOINT_DISP_X': {'DESCRIPTION': 'Root-mean square residual of the adjoint ' - 'of the X displacements.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[Ux_adj]', - 'TYPE': 'RESIDUAL'}, - 'ADJOINT_DISP_Y': {'DESCRIPTION': 'Root-mean square residual of the adjoint ' - 'of the Y displacements.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[Uy_adj]', - 'TYPE': 'RESIDUAL'}, - 'ADJOINT_DISP_Z': {'DESCRIPTION': 'Root-mean square residual of the adjoint ' - 'of the Z displacements.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[Uz_adj]', - 'TYPE': 'RESIDUAL'}, - 'ADJOINT_SOLEXTRA': {'DESCRIPTION': 'Adjoint value of the first extra ' - 'Solution.', - 'GROUP': 'ADJOINT_SOLEXTRA', - 'HEADER': 'Adjoint_SolExtra', - 'TYPE': 'COEFFICIENT'}, - 'AOA': {'DESCRIPTION': 'Angle of attack', - 'GROUP': 'AOA', - 'HEADER': 'AoA', - 'TYPE': 'DEFAULT'}, - 'AVG_CFL': {'DESCRIPTION': 'Current average of the local CFL numbers', - 'GROUP': 'CFL_NUMBER', - 'HEADER': 'Avg CFL', - 'TYPE': 'DEFAULT'}, - 'AVG_DENSITY': {'DESCRIPTION': 'Total average density on all markers set in ' - 'MARKER_ANALYZE', - 'GROUP': 'FLOW_COEFF', - 'HEADER': 'Avg_Density', - 'TYPE': 'COEFFICIENT'}, - 'AVG_ENTHALPY': {'DESCRIPTION': 'Total average enthalpy on all markers set in ' - 'MARKER_ANALYZE', - 'GROUP': 'FLOW_COEFF', - 'HEADER': 'Avg_Enthalpy', - 'TYPE': 'COEFFICIENT'}, - 'AVG_NORMALVEL': {'DESCRIPTION': 'Total average normal velocity on all ' - 'markers set in MARKER_ANALYZE', - 'GROUP': 'FLOW_COEFF', - 'HEADER': 'Avg_NormalVel', - 'TYPE': 'COEFFICIENT'}, - 'AVG_TEMPERATURE': {'DESCRIPTION': 'Average temperature on all surfaces ' - 'defined in MARKER_MONITORING', - 'GROUP': 'HEAT', - 'HEADER': 'AvgTemp', - 'TYPE': 'COEFFICIENT'}, - 'BGS_ADJ_DENSITY': {'DESCRIPTION': 'BGS residual of the adjoint density.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[A_Rho]', - 'TYPE': 'RESIDUAL'}, - 'BGS_ADJ_DISP_X': {'DESCRIPTION': 'BGS residual of the adjoint X ' - 'displacement.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[A_Ux]', - 'TYPE': 'RESIDUAL'}, - 'BGS_ADJ_DISP_Y': {'DESCRIPTION': 'BGS residual of the adjoint Y ' - 'displacement.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[A_Uy]', - 'TYPE': 'RESIDUAL'}, - 'BGS_ADJ_DISP_Z': {'DESCRIPTION': 'BGS residual of the adjoint Z ' - 'displacement.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[A_Uz]', - 'TYPE': 'RESIDUAL'}, - 'BGS_ADJ_DISSIPATION': {'DESCRIPTION': 'BGS residual of the adjoint ' - 'dissipation.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[A_w]', - 'TYPE': 'RESIDUAL'}, - 'BGS_ADJ_ENERGY': {'DESCRIPTION': 'BGS residual of the adjoint energy.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[A_E]', - 'TYPE': 'RESIDUAL'}, - 'BGS_ADJ_MOMENTUM-X': {'DESCRIPTION': 'BGS residual of the adjoint momentum ' - 'x-component', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[A_RhoU]', - 'TYPE': 'RESIDUAL'}, - 'BGS_ADJ_MOMENTUM-Y': {'DESCRIPTION': 'BGS residual of the adjoint momentum ' - 'y-component', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[A_RhoV]', - 'TYPE': 'RESIDUAL'}, - 'BGS_ADJ_MOMENTUM-Z': {'DESCRIPTION': 'BGS residual of the adjoint momentum ' - 'z-component', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[A_RhoW]', - 'TYPE': 'RESIDUAL'}, - 'BGS_ADJ_NU_TILDE': {'DESCRIPTION': 'BGS residual of the adjoint nu tilde.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[A_nu]', - 'TYPE': 'RESIDUAL'}, - 'BGS_ADJ_PRESSURE': {'DESCRIPTION': 'BGS residual of the adjoint Pressure.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[A_Rho]', - 'TYPE': 'RESIDUAL'}, - 'BGS_ADJ_RAD_ENERGY': {'DESCRIPTION': 'BGS residual of the P1 radiative ' - 'energy.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[A_P1]', - 'TYPE': 'RESIDUAL'}, - 'BGS_ADJ_SPECIES_" + std::to_string(iVar': {'DESCRIPTION': 'BGS residual of ' - 'the adjoint ' - 'transported ' - 'species.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[A_rho*Y_" + ' - 'std::to_string(iVar) + ' - '"]', - 'TYPE': 'RESIDUAL'}, - 'BGS_ADJ_TEMPERATURE': {'DESCRIPTION': 'BGS residual of the adjoint ' - 'temperature.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[A_T]', - 'TYPE': 'RESIDUAL'}, - 'BGS_ADJ_TKE': {'DESCRIPTION': 'BGS residual of the adjoint kinetic energy.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[A_k]', - 'TYPE': 'RESIDUAL'}, - 'BGS_ADJ_VELOCITY-X': {'DESCRIPTION': 'BGS residual of the adjoint Velocity ' - 'x-component', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[A_RhoU]', - 'TYPE': 'RESIDUAL'}, - 'BGS_ADJ_VELOCITY-Y': {'DESCRIPTION': 'BGS residual of the adjoint Velocity ' - 'y-component', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[A_RhoV]', - 'TYPE': 'RESIDUAL'}, - 'BGS_ADJ_VELOCITY-Z': {'DESCRIPTION': 'BGS residual of the adjoint Velocity ' - 'z-component', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[A_RhoW]', - 'TYPE': 'RESIDUAL'}, - 'BGS_DENSITY': {'DESCRIPTION': 'BGS residual of the density.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[Rho]', - 'TYPE': 'RESIDUAL'}, - 'BGS_DISP_X': {'DESCRIPTION': 'BGS residual of X displacement', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[DispX]', - 'TYPE': 'RESIDUAL'}, - 'BGS_DISP_Y': {'DESCRIPTION': 'BGS residual of Y displacement', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[DispY]', - 'TYPE': 'RESIDUAL'}, - 'BGS_DISP_Z': {'DESCRIPTION': 'BGS residual of Z displacement', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[DispZ]', - 'TYPE': 'RESIDUAL'}, - 'BGS_DISSIPATION': {'DESCRIPTION': 'BGS residual of dissipation (SST model).', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[w]', - 'TYPE': 'RESIDUAL'}, - 'BGS_ENERGY': {'DESCRIPTION': 'BGS residual of the energy.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[RhoE]', - 'TYPE': 'RESIDUAL'}, - 'BGS_MOMENTUM-X': {'DESCRIPTION': 'BGS residual of the momentum x-component.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[RhoU]', - 'TYPE': 'RESIDUAL'}, - 'BGS_MOMENTUM-Y': {'DESCRIPTION': 'BGS residual of the momentum y-component.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[RhoV]', - 'TYPE': 'RESIDUAL'}, - 'BGS_NU_TILDE': {'DESCRIPTION': 'BGS residual of nu tilde (SA model).', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[nu]', - 'TYPE': 'RESIDUAL'}, - 'BGS_PRESSURE': {'DESCRIPTION': 'BGS residual of the pressure.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[P]', - 'TYPE': 'RESIDUAL'}, - 'BGS_SPECIES_" + std::to_string(iVar': {'DESCRIPTION': 'BGS residual of ' - 'transported species.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[rho*Y_" + ' - 'std::to_string(iVar)+"]', - 'TYPE': 'RESIDUAL'}, - 'BGS_TEMPERATURE': {'DESCRIPTION': 'Block-Gauss-Seidel residual of the ' - 'temperature', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[T]', - 'TYPE': 'RESIDUAL'}, - 'BGS_TKE': {'DESCRIPTION': 'BGS residual of kinetic energy (SST model).', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[k]', - 'TYPE': 'RESIDUAL'}, - 'BGS_VELOCITY-X': {'DESCRIPTION': 'BGS residual of the velocity x-component.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[U]', - 'TYPE': 'RESIDUAL'}, - 'BGS_VELOCITY-Y': {'DESCRIPTION': 'BGS residual of the velocity y-component.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[V]', - 'TYPE': 'RESIDUAL'}, - 'BGS_VELOCITY-Z': {'DESCRIPTION': 'BGS residual of the velocity z-component.', - 'GROUP': 'BGS_RES', - 'HEADER': 'bgs[W]', - 'TYPE': 'RESIDUAL'}, - 'BUFFET': {'DESCRIPTION': 'Buffet sensor', - 'GROUP': 'AERO_COEFF', - 'HEADER': 'Buffet', - 'TYPE': 'COEFFICIENT'}, - 'CFL_NUMBER': {'DESCRIPTION': 'Current value of the CFL number', - 'GROUP': 'CFL_NUMBER', - 'HEADER': 'CFL number', - 'TYPE': 'DEFAULT'}, - 'CHANGE_IN_AOA': {'DESCRIPTION': 'Last change in Angle of Attack by Fixed CL ' - 'Driver', - 'GROUP': 'FIXED_CL', - 'HEADER': 'Change_in_AOA', - 'TYPE': 'RESIDUAL'}, - 'CL_DRIVER_COMMAND': {'DESCRIPTION': "CL Driver's control command", - 'GROUP': 'FIXED_CL', - 'HEADER': 'CL_Driver_Command', - 'TYPE': 'RESIDUAL'}, - 'COMBO': {'DESCRIPTION': 'Combined obj. function value.', - 'GROUP': 'COMBO', - 'HEADER': 'ComboObj', - 'TYPE': 'COEFFICIENT'}, - 'DEFORM_ITER': {'DESCRIPTION': 'Linear solver iterations for the mesh ' - 'deformation', - 'GROUP': 'DEFORM', - 'HEADER': 'DeformIter', - 'TYPE': 'DEFAULT'}, - 'DEFORM_MAX_VOLUME': {'DESCRIPTION': 'Maximum volume in the mesh', - 'GROUP': 'DEFORM', - 'HEADER': 'MaxVolume', - 'TYPE': 'DEFAULT'}, - 'DEFORM_MIN_VOLUME': {'DESCRIPTION': 'Minimum volume in the mesh', - 'GROUP': 'DEFORM', - 'HEADER': 'MinVolume', - 'TYPE': 'DEFAULT'}, - 'DEFORM_RESIDUAL': {'DESCRIPTION': 'Residual of the linear solver for the ' - 'mesh deformation', - 'GROUP': 'DEFORM', - 'HEADER': 'DeformRes', - 'TYPE': 'DEFAULT'}, - 'DELTA_CL': {'DESCRIPTION': 'Difference between Target CL and current CL', - 'GROUP': 'FIXED_CL', - 'HEADER': 'Delta_CL', - 'TYPE': 'COEFFICIENT'}, - 'DRAG': {'DESCRIPTION': 'Total drag coefficient on all surfaces set with ' - 'MARKER_MONITORING', - 'GROUP': 'AERO_COEFF', - 'HEADER': 'CD', - 'TYPE': 'COEFFICIENT'}, - 'D_ADJOINT_SOLEXTRA': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_ADJOINT_SOLEXTRA', - 'HEADER': 'd[Adjoint_SolExtra]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_AVG_DENSITY': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_FLOW_COEFF', - 'HEADER': 'd[Avg_Density]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_AVG_ENTHALPY': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_FLOW_COEFF', - 'HEADER': 'd[Avg_Enthalpy]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_AVG_NORMALVEL': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_FLOW_COEFF', - 'HEADER': 'd[Avg_NormalVel]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_AVG_TEMPERATURE': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_HEAT', - 'HEADER': 'd[AvgTemp]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_BUFFET': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_AERO_COEFF', - 'HEADER': 'd[Buffet]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_COMBO': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_COMBO', - 'HEADER': 'd[ComboObj]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_DELTA_CL': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_FIXED_CL', - 'HEADER': 'd[Delta_CL]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_DRAG': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_AERO_COEFF', - 'HEADER': 'd[CD]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_EFFICIENCY': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_AERO_COEFF', - 'HEADER': 'd[CEff]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_EQUIVALENT_AREA': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_EQUIVALENT_AREA', - 'HEADER': 'd[CEquiv_Area]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_FIGURE_OF_MERIT': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_ROTATING_FRAME', - 'HEADER': 'd[CMerit]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_FORCE_X': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_AERO_COEFF', - 'HEADER': 'd[CFx]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_FORCE_Y': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_AERO_COEFF', - 'HEADER': 'd[CFy]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_FORCE_Z': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_AERO_COEFF', - 'HEADER': 'd[CFz]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_INVERSE_DESIGN_PRESSURE': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_CP_DIFF', - 'HEADER': 'd[Cp_Diff]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_LIFT': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_AERO_COEFF', - 'HEADER': 'd[CL]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_MAXIMUM_HEATFLUX': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_HEAT', - 'HEADER': 'd[MaxHF]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_MOMENT_X': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_AERO_COEFF', - 'HEADER': 'd[CMx]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_MOMENT_Y': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_AERO_COEFF', - 'HEADER': 'd[CMy]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_MOMENT_Z': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_AERO_COEFF', - 'HEADER': 'd[CMz]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_REFERENCE_GEOMETRY': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_STRUCT_COEFF', - 'HEADER': 'd[RefGeom]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_REFERENCE_NODE': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_STRUCT_COEFF', - 'HEADER': 'd[RefNode]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SENS_AOA': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_SENSITIVITY', - 'HEADER': 'd[Sens_AoA]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SENS_GEO': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_SENSITIVITY', - 'HEADER': 'd[Sens_Geo]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SENS_MACH': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_SENSITIVITY', - 'HEADER': 'd[Sens_Mach]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SENS_PRESS': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_SENSITIVITY', - 'HEADER': 'd[Sens_Press]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SENS_PRESS_OUT': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_SENSITIVITY', - 'HEADER': 'd[Sens_Pout]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SENS_TEMP': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_SENSITIVITY', - 'HEADER': 'd[Sens_Temp]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SENS_VEL_IN': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_SENSITIVITY', - 'HEADER': 'd[Sens_Vin]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SIDEFORCE': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_AERO_COEFF', - 'HEADER': 'd[CSF]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_STRESS_PENALTY': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_STRUCT_COEFF', - 'HEADER': 'd[StressPen]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SURFACE_MACH': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_FLOW_COEFF', - 'HEADER': 'd[Avg_Mach]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SURFACE_MASSFLOW': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_FLOW_COEFF', - 'HEADER': 'd[Avg_Massflow]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SURFACE_MOM_DISTORTION': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_FLOW_COEFF', - 'HEADER': 'd[Momentum_Distortion]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SURFACE_PRESSURE_DROP': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_FLOW_COEFF', - 'HEADER': 'd[Pressure_Drop]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SURFACE_SECONDARY': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_FLOW_COEFF', - 'HEADER': 'd[Secondary_Strength]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SURFACE_SECOND_OVER_UNIFORM': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_FLOW_COEFF', - 'HEADER': 'd[Secondary_Over_Uniformity]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SURFACE_SPECIES_" + std::to_string(iVar': {'DESCRIPTION': 'Derivative ' - 'value', - 'GROUP': 'D_SPECIES_COEFF', - 'HEADER': 'd[Avg_Species_" + ' - 'std::to_string(iVar]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SURFACE_STATIC_PRESSURE': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_FLOW_COEFF', - 'HEADER': 'd[Avg_Press]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SURFACE_STATIC_TEMPERATURE': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_FLOW_COEFF', - 'HEADER': 'd[Avg_Temp]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SURFACE_TOTAL_PRESSURE': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_FLOW_COEFF', - 'HEADER': 'd[Avg_TotalPress]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SURFACE_TOTAL_TEMPERATURE': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_FLOW_COEFF', - 'HEADER': 'd[Avg_TotalTemp]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_SURFACE_UNIFORMITY': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_FLOW_COEFF', - 'HEADER': 'd[Uniformity]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_THRUST': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_ROTATING_FRAME', - 'HEADER': 'd[CT]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_TOPOL_COMPLIANCE': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_STRUCT_COEFF', - 'HEADER': 'd[TopComp]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_TOPOL_DISCRETENESS': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_STRUCT_COEFF', - 'HEADER': 'd[TopDisc]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_TORQUE': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_ROTATING_FRAME', - 'HEADER': 'd[CQ]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_TOTAL_HEATFLUX': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_HEAT', - 'HEADER': 'd[HF]', - 'TYPE': 'D_COEFFICIENT'}, - 'D_VOLUME_FRACTION': {'DESCRIPTION': 'Derivative value', - 'GROUP': 'D_STRUCT_COEFF', - 'HEADER': 'd[VolFrac]', - 'TYPE': 'D_COEFFICIENT'}, - 'EFFICIENCY': {'DESCRIPTION': 'Total lift-to-drag ratio on all surfaces set ' - 'with MARKER_MONITORING', - 'GROUP': 'AERO_COEFF', - 'HEADER': 'CEff', - 'TYPE': 'COEFFICIENT'}, - 'EQUIVALENT_AREA': {'DESCRIPTION': 'Equivalent area', - 'GROUP': 'EQUIVALENT_AREA', - 'HEADER': 'CEquiv_Area', - 'TYPE': 'COEFFICIENT'}, - 'FIGURE_OF_MERIT': {'DESCRIPTION': 'Thrust over torque', - 'GROUP': 'ROTATING_FRAME', - 'HEADER': 'CMerit', - 'TYPE': 'COEFFICIENT'}, - 'FORCE_X': {'DESCRIPTION': 'Total force x-component on all surfaces set with ' - 'MARKER_MONITORING', - 'GROUP': 'AERO_COEFF', - 'HEADER': 'CFx', - 'TYPE': 'COEFFICIENT'}, - 'FORCE_Y': {'DESCRIPTION': 'Total force y-component on all surfaces set with ' - 'MARKER_MONITORING', - 'GROUP': 'AERO_COEFF', - 'HEADER': 'CFy', - 'TYPE': 'COEFFICIENT'}, - 'FORCE_Z': {'DESCRIPTION': 'Total force z-component on all surfaces set with ' - 'MARKER_MONITORING', - 'GROUP': 'AERO_COEFF', - 'HEADER': 'CFz', - 'TYPE': 'COEFFICIENT'}, - 'INVERSE_DESIGN_PRESSURE': {'DESCRIPTION': 'Cp difference for inverse design', - 'GROUP': 'CP_DIFF', - 'HEADER': 'Cp_Diff', - 'TYPE': 'COEFFICIENT'}, - 'LIFT': {'DESCRIPTION': 'Total lift coefficient on all surfaces set with ' - 'MARKER_MONITORING', - 'GROUP': 'AERO_COEFF', - 'HEADER': 'CL', - 'TYPE': 'COEFFICIENT'}, - 'LINSOL_ITER': {'DESCRIPTION': 'Number of iterations of the linear solver.', - 'GROUP': 'LINSOL', - 'HEADER': 'LinSolIter', - 'TYPE': 'DEFAULT'}, - 'LINSOL_ITER_SPECIES': {'DESCRIPTION': 'Number of iterations of the linear ' - 'solver for species solver.', - 'GROUP': 'LINSOL', - 'HEADER': 'LinSolIterSpecies', - 'TYPE': 'DEFAULT'}, - 'LINSOL_ITER_TURB': {'DESCRIPTION': 'Number of iterations of the linear ' - 'solver for turbulence.', - 'GROUP': 'LINSOL', - 'HEADER': 'LinSolIterTurb', - 'TYPE': 'DEFAULT'}, - 'LINSOL_RESIDUAL': {'DESCRIPTION': 'Residual of the linear solver.', - 'GROUP': 'LINSOL', - 'HEADER': 'LinSolRes', - 'TYPE': 'DEFAULT'}, - 'LINSOL_RESIDUAL_SPECIES': {'DESCRIPTION': 'Residual of the linear solver for ' - 'species solver.', - 'GROUP': 'LINSOL', - 'HEADER': 'LinSolResSpecies', - 'TYPE': 'DEFAULT'}, - 'LINSOL_RESIDUAL_TURB': {'DESCRIPTION': 'Residual of the linear solver for ' - 'turbulence.', - 'GROUP': 'LINSOL', - 'HEADER': 'LinSolResTurb', - 'TYPE': 'DEFAULT'}, - 'LOAD_INCREMENT': {'DESCRIPTION': 'LOAD_INCREMENT', - 'GROUP': 'Percent of total load (incremental', - 'HEADER': 'Load[%]', - 'TYPE': 'DEFAULT'}, - 'LOAD_RAMP': {'DESCRIPTION': 'LOAD_RAMP', - 'GROUP': 'Fraction of total load (ramped', - 'HEADER': 'Load_Ramp', - 'TYPE': 'DEFAULT'}, - 'MAXIMUM_HEATFLUX': {'DESCRIPTION': 'Maximum heatflux on all surfaces defined ' - 'in MARKER_MONITORING', - 'GROUP': 'HEAT', - 'HEADER': 'MaxHF', - 'TYPE': 'COEFFICIENT'}, - 'MAX_ADJ_DENSITY': {'DESCRIPTION': 'Maximum residual of the adjoint density.', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[A_Rho]', - 'TYPE': 'RESIDUAL'}, - 'MAX_ADJ_DISSIPATION': {'DESCRIPTION': 'Maximum residual of the adjoint ' - 'dissipation.', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[A_w]', - 'TYPE': 'RESIDUAL'}, - 'MAX_ADJ_ENERGY': {'DESCRIPTION': 'Maximum residual of the adjoint energy.', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[A_E]', - 'TYPE': 'RESIDUAL'}, - 'MAX_ADJ_MOMENTUM-X': {'DESCRIPTION': 'Maximum residual of the adjoint ' - 'momentum x-component', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[A_RhoU]', - 'TYPE': 'RESIDUAL'}, - 'MAX_ADJ_MOMENTUM-Y': {'DESCRIPTION': 'Maximum residual of the adjoint ' - 'momentum y-component', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[A_RhoV]', - 'TYPE': 'RESIDUAL'}, - 'MAX_ADJ_MOMENTUM-Z': {'DESCRIPTION': 'Maximum residual of the adjoint ' - 'momentum z-component', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[A_RhoW]', - 'TYPE': 'RESIDUAL'}, - 'MAX_ADJ_NU_TILDE': {'DESCRIPTION': 'Maximum residual of the adjoint nu ' - 'tilde.', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[A_nu]', - 'TYPE': 'RESIDUAL'}, - 'MAX_ADJ_PRESSURE': {'DESCRIPTION': 'Maximum residual of the adjoint ' - 'Pressure.', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[A_Rho]', - 'TYPE': 'RESIDUAL'}, - 'MAX_ADJ_SPECIES_" + std::to_string(iVar': {'DESCRIPTION': 'Maximum residual ' - 'of the adjoint ' - 'transported ' - 'species.', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[A_rho*Y_" + ' - 'std::to_string(iVar) + ' - '"]', - 'TYPE': 'RESIDUAL'}, - 'MAX_ADJ_TEMPERATURE': {'DESCRIPTION': 'Maximum residual of the temperature.', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[A_T]', - 'TYPE': 'RESIDUAL'}, - 'MAX_ADJ_TKE': {'DESCRIPTION': 'Maximum residual of the adjoint kinetic ' - 'energy.', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[A_k]', - 'TYPE': 'RESIDUAL'}, - 'MAX_ADJ_VELOCITY-X': {'DESCRIPTION': 'Maximum residual of the adjoint ' - 'Velocity x-component', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[A_RhoU]', - 'TYPE': 'RESIDUAL'}, - 'MAX_ADJ_VELOCITY-Y': {'DESCRIPTION': 'Maximum residual of the adjoint ' - 'Velocity y-component', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[A_RhoV]', - 'TYPE': 'RESIDUAL'}, - 'MAX_ADJ_VELOCITY-Z': {'DESCRIPTION': 'Maximum residual of the adjoint ' - 'Velocity z-component', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[A_RhoW]', - 'TYPE': 'RESIDUAL'}, - 'MAX_CFL': {'DESCRIPTION': 'Current maximum of the local CFL numbers', - 'GROUP': 'CFL_NUMBER', - 'HEADER': 'Max CFL', - 'TYPE': 'DEFAULT'}, - 'MAX_DELTA_TIME': {'DESCRIPTION': 'Current maximum local time step', - 'GROUP': 'CFL_NUMBER', - 'HEADER': 'Max DT', - 'TYPE': 'DEFAULT'}, - 'MAX_DENSITY': {'DESCRIPTION': 'Maximum square residual of the density.', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[Rho]', - 'TYPE': 'RESIDUAL'}, - 'MAX_DISSIPATION': {'DESCRIPTION': 'Maximum residual of dissipation (SST ' - 'model).', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[w]', - 'TYPE': 'RESIDUAL'}, - 'MAX_ENERGY': {'DESCRIPTION': 'Maximum residual of the energy.', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[RhoE]', - 'TYPE': 'RESIDUAL'}, - 'MAX_MOMENTUM-X': {'DESCRIPTION': 'Maximum square residual of the momentum ' - 'x-component.', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[RhoU]', - 'TYPE': 'RESIDUAL'}, - 'MAX_MOMENTUM-Y': {'DESCRIPTION': 'Maximum square residual of the momentum ' - 'y-component.', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[RhoV]', - 'TYPE': 'RESIDUAL'}, - 'MAX_NU_TILDE': {'DESCRIPTION': 'Maximum residual of nu tilde (SA model).', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[nu]', - 'TYPE': 'RESIDUAL'}, - 'MAX_PRESSURE': {'DESCRIPTION': 'Maximum residual of the pressure.', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[P]', - 'TYPE': 'RESIDUAL'}, - 'MAX_SPECIES_" + std::to_string(iVar': {'DESCRIPTION': 'Maximum residual of ' - 'transported species.', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[rho*Y_" + ' - 'std::to_string(iVar)+"]', - 'TYPE': 'RESIDUAL'}, - 'MAX_TEMPERATURE': {'DESCRIPTION': 'Maximum residual of the temperature', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[T]', - 'TYPE': 'RESIDUAL'}, - 'MAX_TKE': {'DESCRIPTION': 'Maximum residual of kinetic energy (SST model).', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[k]', - 'TYPE': 'RESIDUAL'}, - 'MAX_VELOCITY-X': {'DESCRIPTION': 'Maximum residual of the velocity ' - 'x-component.', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[U]', - 'TYPE': 'RESIDUAL'}, - 'MAX_VELOCITY-Y': {'DESCRIPTION': 'Maximum residual of the velocity ' - 'y-component.', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[V]', - 'TYPE': 'RESIDUAL'}, - 'MAX_VELOCITY-Z': {'DESCRIPTION': 'Maximum residual of the velocity ' - 'z-component.', - 'GROUP': 'MAX_RES', - 'HEADER': 'max[W]', - 'TYPE': 'RESIDUAL'}, - 'MIN_CFL': {'DESCRIPTION': 'Current minimum of the local CFL numbers', - 'GROUP': 'CFL_NUMBER', - 'HEADER': 'Min CFL', - 'TYPE': 'DEFAULT'}, - 'MIN_DELTA_TIME': {'DESCRIPTION': 'Current minimum local time step', - 'GROUP': 'CFL_NUMBER', - 'HEADER': 'Min DT', - 'TYPE': 'DEFAULT'}, - 'MOMENT_X': {'DESCRIPTION': 'Total momentum x-component on all surfaces set ' - 'with MARKER_MONITORING', - 'GROUP': 'AERO_COEFF', - 'HEADER': 'CMx', - 'TYPE': 'COEFFICIENT'}, - 'MOMENT_Y': {'DESCRIPTION': 'Total momentum y-component on all surfaces set ' - 'with MARKER_MONITORING', - 'GROUP': 'AERO_COEFF', - 'HEADER': 'CMy', - 'TYPE': 'COEFFICIENT'}, - 'MOMENT_Z': {'DESCRIPTION': 'Total momentum z-component on all surfaces set ' - 'with MARKER_MONITORING', - 'GROUP': 'AERO_COEFF', - 'HEADER': 'CMz', - 'TYPE': 'COEFFICIENT'}, - 'PREV_AOA': {'DESCRIPTION': 'Angle of Attack at the previous iteration of the ' - 'Fixed CL driver', - 'GROUP': 'FIXED_CL', - 'HEADER': 'Previous_AOA', - 'TYPE': 'DEFAULT'}, - 'REFERENCE_GEOMETRY': {'DESCRIPTION': 'L2 norm of difference wrt reference ' - 'geometry', - 'GROUP': 'STRUCT_COEFF', - 'HEADER': 'RefGeom', - 'TYPE': 'COEFFICIENT'}, - 'REFERENCE_NODE': {'DESCRIPTION': 'Distance to reference node', - 'GROUP': 'STRUCT_COEFF', - 'HEADER': 'RefNode', - 'TYPE': 'COEFFICIENT'}, - 'RMS_ADJ_DENSITY': {'DESCRIPTION': 'Root-mean square residual of the adjoint ' - 'density.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[A_Rho]', - 'TYPE': 'RESIDUAL'}, - 'RMS_ADJ_DISSIPATION': {'DESCRIPTION': 'Root-mean square residual of the ' - 'adjoint dissipation.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[A_w]', - 'TYPE': 'RESIDUAL'}, - 'RMS_ADJ_ENERGY': {'DESCRIPTION': 'Root-mean square residual of the adjoint ' - 'energy.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[A_E]', - 'TYPE': 'RESIDUAL'}, - 'RMS_ADJ_MOMENTUM-X': {'DESCRIPTION': 'Root-mean square residual of the ' - 'adjoint momentum x-component.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[A_RhoU]', - 'TYPE': 'RESIDUAL'}, - 'RMS_ADJ_MOMENTUM-Y': {'DESCRIPTION': 'Root-mean square residual of the ' - 'adjoint momentum y-component.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[A_RhoV]', - 'TYPE': 'RESIDUAL'}, - 'RMS_ADJ_MOMENTUM-Z': {'DESCRIPTION': 'Root-mean square residual of the ' - 'adjoint momentum z-component.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[A_RhoW]', - 'TYPE': 'RESIDUAL'}, - 'RMS_ADJ_NU_TILDE': {'DESCRIPTION': 'Root-mean square residual of the adjoint ' - 'nu tilde.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[A_nu]', - 'TYPE': 'RESIDUAL'}, - 'RMS_ADJ_PRESSURE': {'DESCRIPTION': 'Root-mean square residual of the adjoint ' - 'Pressure.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[A_P]', - 'TYPE': 'RESIDUAL'}, - 'RMS_ADJ_RAD_ENERGY': {'DESCRIPTION': 'Root-mean square residual of the P1 ' - 'radiative energy.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[A_P1]', - 'TYPE': 'RESIDUAL'}, - 'RMS_ADJ_SPECIES_" + std::to_string(iVar': {'DESCRIPTION': 'Root-mean square ' - 'residual of the ' - 'adjoint ' - 'transported ' - 'species.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[A_rho*Y_" + ' - 'std::to_string(iVar) + ' - '"]', - 'TYPE': 'RESIDUAL'}, - 'RMS_ADJ_TEMPERATURE': {'DESCRIPTION': 'Root-mean square residual of the ' - 'adjoint temperature.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[A_T]', - 'TYPE': 'RESIDUAL'}, - 'RMS_ADJ_TKE': {'DESCRIPTION': 'Root-mean square residual of the adjoint ' - 'kinetic energy.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[A_k]', - 'TYPE': 'RESIDUAL'}, - 'RMS_ADJ_VELOCITY-X': {'DESCRIPTION': 'Root-mean square residual of the ' - 'adjoint Velocity x-component.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[A_U]', - 'TYPE': 'RESIDUAL'}, - 'RMS_ADJ_VELOCITY-Y': {'DESCRIPTION': 'Root-mean square residual of the ' - 'adjoint Velocity y-component.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[A_V]', - 'TYPE': 'RESIDUAL'}, - 'RMS_ADJ_VELOCITY-Z': {'DESCRIPTION': 'Root-mean square residual of the ' - 'adjoint Velocity z-component.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[A_W]', - 'TYPE': 'RESIDUAL'}, - 'RMS_DENSITY': {'DESCRIPTION': 'Root-mean square residual of the density.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[Rho]', - 'TYPE': 'RESIDUAL'}, - 'RMS_DISP_X': {'DESCRIPTION': 'Residual of X displacement', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[DispX]', - 'TYPE': 'RESIDUAL'}, - 'RMS_DISP_Y': {'DESCRIPTION': 'Residual of Y displacement', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[DispY]', - 'TYPE': 'RESIDUAL'}, - 'RMS_DISP_Z': {'DESCRIPTION': 'Residual of Z displacement', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[DispZ]', - 'TYPE': 'RESIDUAL'}, - 'RMS_DISSIPATION': {'DESCRIPTION': 'Root-mean square residual of dissipation ' - '(SST model).', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[w]', - 'TYPE': 'RESIDUAL'}, - 'RMS_ENERGY': {'DESCRIPTION': 'Root-mean square residual of the energy.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[RhoE]', - 'TYPE': 'RESIDUAL'}, - 'RMS_ETOL': {'DESCRIPTION': 'Norm of energy/work increment', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[E]', - 'TYPE': 'RESIDUAL'}, - 'RMS_MOMENTUM-X': {'DESCRIPTION': 'Root-mean square residual of the momentum ' - 'x-component.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[RhoU]', - 'TYPE': 'RESIDUAL'}, - 'RMS_MOMENTUM-Y': {'DESCRIPTION': 'Root-mean square residual of the momentum ' - 'y-component.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[RhoV]', - 'TYPE': 'RESIDUAL'}, - 'RMS_NU_TILDE': {'DESCRIPTION': 'Root-mean square residual of nu tilde (SA ' - 'model).', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[nu]', - 'TYPE': 'RESIDUAL'}, - 'RMS_PRESSURE': {'DESCRIPTION': 'Root-mean square residual of the pressure.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[P]', - 'TYPE': 'RESIDUAL'}, - 'RMS_RTOL': {'DESCRIPTION': 'Norm of residual', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[R]', - 'TYPE': 'RESIDUAL'}, - 'RMS_SPECIES_" + std::to_string(iVar': {'DESCRIPTION': 'Root-mean square ' - 'residual of ' - 'transported species.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[rho*Y_" + ' - 'std::to_string(iVar)+"]', - 'TYPE': 'RESIDUAL'}, - 'RMS_TEMPERATURE': {'DESCRIPTION': 'Root mean square residual of the ' - 'temperature', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[T]', - 'TYPE': 'RESIDUAL'}, - 'RMS_TKE': {'DESCRIPTION': 'Root-mean square residual of kinetic energy (SST ' - 'model).', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[k]', - 'TYPE': 'RESIDUAL'}, - 'RMS_UTOL': {'DESCRIPTION': 'Norm of displacement increment', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[U]', - 'TYPE': 'RESIDUAL'}, - 'RMS_VELOCITY-X': {'DESCRIPTION': 'Root-mean square residual of the velocity ' - 'x-component.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[U]', - 'TYPE': 'RESIDUAL'}, - 'RMS_VELOCITY-Y': {'DESCRIPTION': 'Root-mean square residual of the velocity ' - 'y-component.', - 'GROUP': 'RMS_RES', - 'HEADER': 'rms[V]', - 'TYPE': 'RESIDUAL'}, - 'SENS_AOA': {'DESCRIPTION': 'Sensitivity of the objective function with ' - 'respect to the angle of attack (only for ' - 'compressible solver).', - 'GROUP': 'SENSITIVITY', - 'HEADER': 'Sens_AoA', - 'TYPE': 'COEFFICIENT'}, - 'SENS_E': {'DESCRIPTION': 'd Objective / d Elasticity modulus', - 'GROUP': 'SENSITIVITY', - 'HEADER': 'Sens[E]', - 'TYPE': 'DEFAULT'}, - 'SENS_GEO': {'DESCRIPTION': 'Sum of the geometrical sensitivities on all ' - 'markers set in MARKER_MONITORING.', - 'GROUP': 'SENSITIVITY', - 'HEADER': 'Sens_Geo', - 'TYPE': 'COEFFICIENT'}, - 'SENS_MACH': {'DESCRIPTION': 'Sensitivity of the objective function with ' - 'respect to the Mach number (only of ' - 'compressible solver).', - 'GROUP': 'SENSITIVITY', - 'HEADER': 'Sens_Mach', - 'TYPE': 'COEFFICIENT'}, - 'SENS_NU': {'DESCRIPTION': 'd Objective / d Poisson ratio', - 'GROUP': 'SENSITIVITY', - 'HEADER': 'Sens[Nu]', - 'TYPE': 'DEFAULT'}, - 'SENS_PRESS': {'DESCRIPTION': 'Sensitivity of the objective function with ' - 'respect to the far-field pressure.', - 'GROUP': 'SENSITIVITY', - 'HEADER': 'Sens_Press', - 'TYPE': 'COEFFICIENT'}, - 'SENS_PRESS_OUT': {'DESCRIPTION': 'Sensitivity of the objective function with ' - 'respect to the outlet pressure.', - 'GROUP': 'SENSITIVITY', - 'HEADER': 'Sens_Pout', - 'TYPE': 'COEFFICIENT'}, - 'SENS_TEMP': {'DESCRIPTION': 'Sensitivity of the objective function with ' - 'respect to the far-field temperature.', - 'GROUP': 'SENSITIVITY', - 'HEADER': 'Sens_Temp', - 'TYPE': 'COEFFICIENT'}, - 'SENS_VEL_IN': {'DESCRIPTION': 'Sensitivity of the objective function with ' - 'respect to the inlet velocity.', - 'GROUP': 'SENSITIVITY', - 'HEADER': 'Sens_Vin', - 'TYPE': 'COEFFICIENT'}, - 'SIDEFORCE': {'DESCRIPTION': 'Total sideforce coefficient on all surfaces set ' - 'with MARKER_MONITORING', - 'GROUP': 'AERO_COEFF', - 'HEADER': 'CSF', - 'TYPE': 'COEFFICIENT'}, - 'STREAMWISE_DP': {'DESCRIPTION': 'Pressure drop in streamwise periodic flow', - 'GROUP': 'STREAMWISE_PERIODIC', - 'HEADER': 'SWDeltaP', - 'TYPE': 'DEFAULT'}, - 'STREAMWISE_HEAT': {'DESCRIPTION': 'Integrated heat for streamwise periodic ' - 'flow', - 'GROUP': 'STREAMWISE_PERIODIC', - 'HEADER': 'SWHeat', - 'TYPE': 'DEFAULT'}, - 'STREAMWISE_MASSFLOW': {'DESCRIPTION': 'Massflow in streamwise periodic flow', - 'GROUP': 'STREAMWISE_PERIODIC', - 'HEADER': 'SWMassflow', - 'TYPE': 'DEFAULT'}, - 'STRESS_PENALTY': {'DESCRIPTION': 'Aggregate stress penalty', - 'GROUP': 'STRUCT_COEFF', - 'HEADER': 'StressPen', - 'TYPE': 'COEFFICIENT'}, - 'SURFACE_MACH': {'DESCRIPTION': 'Total average mach number on all markers set ' - 'in MARKER_ANALYZE', - 'GROUP': 'FLOW_COEFF', - 'HEADER': 'Avg_Mach', - 'TYPE': 'COEFFICIENT'}, - 'SURFACE_MASSFLOW': {'DESCRIPTION': 'Total average mass flow on all markers ' - 'set in MARKER_ANALYZE', - 'GROUP': 'FLOW_COEFF', - 'HEADER': 'Avg_Massflow', - 'TYPE': 'COEFFICIENT'}, - 'SURFACE_MOM_DISTORTION': {'DESCRIPTION': 'Total momentum distortion on all ' - 'markers set in MARKER_ANALYZE', - 'GROUP': 'FLOW_COEFF', - 'HEADER': 'Momentum_Distortion', - 'TYPE': 'COEFFICIENT'}, - 'SURFACE_PRESSURE_DROP': {'DESCRIPTION': 'Total pressure drop on all markers ' - 'set in MARKER_ANALYZE', - 'GROUP': 'FLOW_COEFF', - 'HEADER': 'Pressure_Drop', - 'TYPE': 'COEFFICIENT'}, - 'SURFACE_SECONDARY': {'DESCRIPTION': 'Total secondary strength on all markers ' - 'set in MARKER_ANALYZE', - 'GROUP': 'FLOW_COEFF', - 'HEADER': 'Secondary_Strength', - 'TYPE': 'COEFFICIENT'}, - 'SURFACE_SECOND_OVER_UNIFORM': {'DESCRIPTION': 'Total secondary over ' - 'uniformity on all markers set ' - 'in MARKER_ANALYZE', - 'GROUP': 'FLOW_COEFF', - 'HEADER': 'Secondary_Over_Uniformity', - 'TYPE': 'COEFFICIENT'}, - 'SURFACE_SPECIES_" + std::to_string(iVar': {'DESCRIPTION': 'Total average ' - 'species " + ' - 'std::to_string(iVar) ' - '+ " on all ' - 'markers set in ' - 'MARKER_ANALYZE', - 'GROUP': 'SPECIES_COEFF', - 'HEADER': 'Avg_Species_" + ' - 'std::to_string(iVar', - 'TYPE': 'COEFFICIENT'}, - 'SURFACE_SPECIES_VARIANCE': {'DESCRIPTION': 'Total species variance', - 'GROUP': 'SPECIES_COEFF', - 'HEADER': 'Species_Variance', - 'TYPE': 'DEFAULT'}, - 'SURFACE_STATIC_PRESSURE': {'DESCRIPTION': 'Total average pressure on all ' - 'markers set in MARKER_ANALYZE', - 'GROUP': 'FLOW_COEFF', - 'HEADER': 'Avg_Press', - 'TYPE': 'COEFFICIENT'}, - 'SURFACE_STATIC_TEMPERATURE': {'DESCRIPTION': 'Total average temperature on ' - 'all markers set in ' - 'MARKER_ANALYZE', - 'GROUP': 'FLOW_COEFF', - 'HEADER': 'Avg_Temp', - 'TYPE': 'COEFFICIENT'}, - 'SURFACE_TOTAL_PRESSURE': {'DESCRIPTION': 'Total average total pressure on ' - 'all markers set in MARKER_ANALYZE', - 'GROUP': 'FLOW_COEFF', - 'HEADER': 'Avg_TotalPress', - 'TYPE': 'COEFFICIENT'}, - 'SURFACE_TOTAL_TEMPERATURE': {'DESCRIPTION': 'Total average total temperature ' - 'all markers set in ' - 'MARKER_ANALYZE', - 'GROUP': 'FLOW_COEFF', - 'HEADER': 'Avg_TotalTemp', - 'TYPE': 'COEFFICIENT'}, - 'SURFACE_UNIFORMITY': {'DESCRIPTION': 'Total flow uniformity on all markers ' - 'set in MARKER_ANALYZE', - 'GROUP': 'FLOW_COEFF', - 'HEADER': 'Uniformity', - 'TYPE': 'COEFFICIENT'}, - 'TAVG_ADJOINT_SOLEXTRA': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_ADJOINT_SOLEXTRA', - 'HEADER': 'tavg[Adjoint_SolExtra]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_AVG_DENSITY': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_FLOW_COEFF', - 'HEADER': 'tavg[Avg_Density]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_AVG_ENTHALPY': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_FLOW_COEFF', - 'HEADER': 'tavg[Avg_Enthalpy]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_AVG_NORMALVEL': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_FLOW_COEFF', - 'HEADER': 'tavg[Avg_NormalVel]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_AVG_TEMPERATURE': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_HEAT', - 'HEADER': 'tavg[AvgTemp]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_BUFFET': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_AERO_COEFF', - 'HEADER': 'tavg[Buffet]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_COMBO': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_COMBO', - 'HEADER': 'tavg[ComboObj]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_DELTA_CL': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_FIXED_CL', - 'HEADER': 'tavg[Delta_CL]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_DRAG': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_AERO_COEFF', - 'HEADER': 'tavg[CD]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_D_ADJOINT_SOLEXTRA': {'DESCRIPTION': 'weighted time average derivative ' - 'value', - 'GROUP': 'TAVG_D_ADJOINT_SOLEXTRA', - 'HEADER': 'dtavg[Adjoint_SolExtra]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_AVG_DENSITY': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_FLOW_COEFF', - 'HEADER': 'dtavg[Avg_Density]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_AVG_ENTHALPY': {'DESCRIPTION': 'weighted time average derivative ' - 'value', - 'GROUP': 'TAVG_D_FLOW_COEFF', - 'HEADER': 'dtavg[Avg_Enthalpy]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_AVG_NORMALVEL': {'DESCRIPTION': 'weighted time average derivative ' - 'value', - 'GROUP': 'TAVG_D_FLOW_COEFF', - 'HEADER': 'dtavg[Avg_NormalVel]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_AVG_TEMPERATURE': {'DESCRIPTION': 'weighted time average derivative ' - 'value', - 'GROUP': 'TAVG_D_HEAT', - 'HEADER': 'dtavg[AvgTemp]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_BUFFET': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_AERO_COEFF', - 'HEADER': 'dtavg[Buffet]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_COMBO': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_COMBO', - 'HEADER': 'dtavg[ComboObj]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_DELTA_CL': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_FIXED_CL', - 'HEADER': 'dtavg[Delta_CL]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_DRAG': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_AERO_COEFF', - 'HEADER': 'dtavg[CD]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_EFFICIENCY': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_AERO_COEFF', - 'HEADER': 'dtavg[CEff]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_EQUIVALENT_AREA': {'DESCRIPTION': 'weighted time average derivative ' - 'value', - 'GROUP': 'TAVG_D_EQUIVALENT_AREA', - 'HEADER': 'dtavg[CEquiv_Area]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_FIGURE_OF_MERIT': {'DESCRIPTION': 'weighted time average derivative ' - 'value', - 'GROUP': 'TAVG_D_ROTATING_FRAME', - 'HEADER': 'dtavg[CMerit]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_FORCE_X': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_AERO_COEFF', - 'HEADER': 'dtavg[CFx]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_FORCE_Y': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_AERO_COEFF', - 'HEADER': 'dtavg[CFy]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_FORCE_Z': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_AERO_COEFF', - 'HEADER': 'dtavg[CFz]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_INVERSE_DESIGN_PRESSURE': {'DESCRIPTION': 'weighted time average ' - 'derivative value', - 'GROUP': 'TAVG_D_CP_DIFF', - 'HEADER': 'dtavg[Cp_Diff]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_LIFT': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_AERO_COEFF', - 'HEADER': 'dtavg[CL]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_MAXIMUM_HEATFLUX': {'DESCRIPTION': 'weighted time average derivative ' - 'value', - 'GROUP': 'TAVG_D_HEAT', - 'HEADER': 'dtavg[MaxHF]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_MOMENT_X': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_AERO_COEFF', - 'HEADER': 'dtavg[CMx]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_MOMENT_Y': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_AERO_COEFF', - 'HEADER': 'dtavg[CMy]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_MOMENT_Z': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_AERO_COEFF', - 'HEADER': 'dtavg[CMz]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_REFERENCE_GEOMETRY': {'DESCRIPTION': 'weighted time average ' - 'derivative value', - 'GROUP': 'TAVG_D_STRUCT_COEFF', - 'HEADER': 'dtavg[RefGeom]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_REFERENCE_NODE': {'DESCRIPTION': 'weighted time average derivative ' - 'value', - 'GROUP': 'TAVG_D_STRUCT_COEFF', - 'HEADER': 'dtavg[RefNode]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SENS_AOA': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_SENSITIVITY', - 'HEADER': 'dtavg[Sens_AoA]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SENS_GEO': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_SENSITIVITY', - 'HEADER': 'dtavg[Sens_Geo]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SENS_MACH': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_SENSITIVITY', - 'HEADER': 'dtavg[Sens_Mach]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SENS_PRESS': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_SENSITIVITY', - 'HEADER': 'dtavg[Sens_Press]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SENS_PRESS_OUT': {'DESCRIPTION': 'weighted time average derivative ' - 'value', - 'GROUP': 'TAVG_D_SENSITIVITY', - 'HEADER': 'dtavg[Sens_Pout]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SENS_TEMP': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_SENSITIVITY', - 'HEADER': 'dtavg[Sens_Temp]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SENS_VEL_IN': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_SENSITIVITY', - 'HEADER': 'dtavg[Sens_Vin]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SIDEFORCE': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_AERO_COEFF', - 'HEADER': 'dtavg[CSF]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_STRESS_PENALTY': {'DESCRIPTION': 'weighted time average derivative ' - 'value', - 'GROUP': 'TAVG_D_STRUCT_COEFF', - 'HEADER': 'dtavg[StressPen]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SURFACE_MACH': {'DESCRIPTION': 'weighted time average derivative ' - 'value', - 'GROUP': 'TAVG_D_FLOW_COEFF', - 'HEADER': 'dtavg[Avg_Mach]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SURFACE_MASSFLOW': {'DESCRIPTION': 'weighted time average derivative ' - 'value', - 'GROUP': 'TAVG_D_FLOW_COEFF', - 'HEADER': 'dtavg[Avg_Massflow]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SURFACE_MOM_DISTORTION': {'DESCRIPTION': 'weighted time average ' - 'derivative value', - 'GROUP': 'TAVG_D_FLOW_COEFF', - 'HEADER': 'dtavg[Momentum_Distortion]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SURFACE_PRESSURE_DROP': {'DESCRIPTION': 'weighted time average ' - 'derivative value', - 'GROUP': 'TAVG_D_FLOW_COEFF', - 'HEADER': 'dtavg[Pressure_Drop]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SURFACE_SECONDARY': {'DESCRIPTION': 'weighted time average derivative ' - 'value', - 'GROUP': 'TAVG_D_FLOW_COEFF', - 'HEADER': 'dtavg[Secondary_Strength]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SURFACE_SECOND_OVER_UNIFORM': {'DESCRIPTION': 'weighted time average ' - 'derivative value', - 'GROUP': 'TAVG_D_FLOW_COEFF', - 'HEADER': 'dtavg[Secondary_Over_Uniformity]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SURFACE_SPECIES_" + std::to_string(iVar': {'DESCRIPTION': 'weighted ' - 'time ' - 'average ' - 'derivative ' - 'value', - 'GROUP': 'TAVG_D_SPECIES_COEFF', - 'HEADER': 'dtavg[Avg_Species_" ' - '+ ' - 'std::to_string(iVar]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SURFACE_STATIC_PRESSURE': {'DESCRIPTION': 'weighted time average ' - 'derivative value', - 'GROUP': 'TAVG_D_FLOW_COEFF', - 'HEADER': 'dtavg[Avg_Press]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SURFACE_STATIC_TEMPERATURE': {'DESCRIPTION': 'weighted time average ' - 'derivative value', - 'GROUP': 'TAVG_D_FLOW_COEFF', - 'HEADER': 'dtavg[Avg_Temp]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SURFACE_TOTAL_PRESSURE': {'DESCRIPTION': 'weighted time average ' - 'derivative value', - 'GROUP': 'TAVG_D_FLOW_COEFF', - 'HEADER': 'dtavg[Avg_TotalPress]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SURFACE_TOTAL_TEMPERATURE': {'DESCRIPTION': 'weighted time average ' - 'derivative value', - 'GROUP': 'TAVG_D_FLOW_COEFF', - 'HEADER': 'dtavg[Avg_TotalTemp]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_SURFACE_UNIFORMITY': {'DESCRIPTION': 'weighted time average ' - 'derivative value', - 'GROUP': 'TAVG_D_FLOW_COEFF', - 'HEADER': 'dtavg[Uniformity]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_THRUST': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_ROTATING_FRAME', - 'HEADER': 'dtavg[CT]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_TOPOL_COMPLIANCE': {'DESCRIPTION': 'weighted time average derivative ' - 'value', - 'GROUP': 'TAVG_D_STRUCT_COEFF', - 'HEADER': 'dtavg[TopComp]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_TOPOL_DISCRETENESS': {'DESCRIPTION': 'weighted time average ' - 'derivative value', - 'GROUP': 'TAVG_D_STRUCT_COEFF', - 'HEADER': 'dtavg[TopDisc]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_TORQUE': {'DESCRIPTION': 'weighted time average derivative value', - 'GROUP': 'TAVG_D_ROTATING_FRAME', - 'HEADER': 'dtavg[CQ]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_TOTAL_HEATFLUX': {'DESCRIPTION': 'weighted time average derivative ' - 'value', - 'GROUP': 'TAVG_D_HEAT', - 'HEADER': 'dtavg[HF]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_D_VOLUME_FRACTION': {'DESCRIPTION': 'weighted time average derivative ' - 'value', - 'GROUP': 'TAVG_D_STRUCT_COEFF', - 'HEADER': 'dtavg[VolFrac]', - 'TYPE': 'TAVG_D_COEFFICIENT'}, - 'TAVG_EFFICIENCY': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_AERO_COEFF', - 'HEADER': 'tavg[CEff]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_EQUIVALENT_AREA': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_EQUIVALENT_AREA', - 'HEADER': 'tavg[CEquiv_Area]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_FIGURE_OF_MERIT': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_ROTATING_FRAME', - 'HEADER': 'tavg[CMerit]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_FORCE_X': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_AERO_COEFF', - 'HEADER': 'tavg[CFx]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_FORCE_Y': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_AERO_COEFF', - 'HEADER': 'tavg[CFy]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_FORCE_Z': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_AERO_COEFF', - 'HEADER': 'tavg[CFz]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_INVERSE_DESIGN_PRESSURE': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_CP_DIFF', - 'HEADER': 'tavg[Cp_Diff]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_LIFT': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_AERO_COEFF', - 'HEADER': 'tavg[CL]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_MAXIMUM_HEATFLUX': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_HEAT', - 'HEADER': 'tavg[MaxHF]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_MOMENT_X': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_AERO_COEFF', - 'HEADER': 'tavg[CMx]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_MOMENT_Y': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_AERO_COEFF', - 'HEADER': 'tavg[CMy]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_MOMENT_Z': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_AERO_COEFF', - 'HEADER': 'tavg[CMz]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_REFERENCE_GEOMETRY': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_STRUCT_COEFF', - 'HEADER': 'tavg[RefGeom]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_REFERENCE_NODE': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_STRUCT_COEFF', - 'HEADER': 'tavg[RefNode]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SENS_AOA': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_SENSITIVITY', - 'HEADER': 'tavg[Sens_AoA]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SENS_GEO': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_SENSITIVITY', - 'HEADER': 'tavg[Sens_Geo]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SENS_MACH': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_SENSITIVITY', - 'HEADER': 'tavg[Sens_Mach]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SENS_PRESS': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_SENSITIVITY', - 'HEADER': 'tavg[Sens_Press]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SENS_PRESS_OUT': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_SENSITIVITY', - 'HEADER': 'tavg[Sens_Pout]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SENS_TEMP': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_SENSITIVITY', - 'HEADER': 'tavg[Sens_Temp]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SENS_VEL_IN': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_SENSITIVITY', - 'HEADER': 'tavg[Sens_Vin]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SIDEFORCE': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_AERO_COEFF', - 'HEADER': 'tavg[CSF]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_STRESS_PENALTY': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_STRUCT_COEFF', - 'HEADER': 'tavg[StressPen]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SURFACE_MACH': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_FLOW_COEFF', - 'HEADER': 'tavg[Avg_Mach]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SURFACE_MASSFLOW': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_FLOW_COEFF', - 'HEADER': 'tavg[Avg_Massflow]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SURFACE_MOM_DISTORTION': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_FLOW_COEFF', - 'HEADER': 'tavg[Momentum_Distortion]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SURFACE_PRESSURE_DROP': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_FLOW_COEFF', - 'HEADER': 'tavg[Pressure_Drop]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SURFACE_SECONDARY': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_FLOW_COEFF', - 'HEADER': 'tavg[Secondary_Strength]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SURFACE_SECOND_OVER_UNIFORM': {'DESCRIPTION': 'weighted time average ' - 'value', - 'GROUP': 'TAVG_FLOW_COEFF', - 'HEADER': 'tavg[Secondary_Over_Uniformity]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SURFACE_SPECIES_" + std::to_string(iVar': {'DESCRIPTION': 'weighted ' - 'time average ' - 'value', - 'GROUP': 'TAVG_SPECIES_COEFF', - 'HEADER': 'tavg[Avg_Species_" ' - '+ ' - 'std::to_string(iVar]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SURFACE_STATIC_PRESSURE': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_FLOW_COEFF', - 'HEADER': 'tavg[Avg_Press]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SURFACE_STATIC_TEMPERATURE': {'DESCRIPTION': 'weighted time average ' - 'value', - 'GROUP': 'TAVG_FLOW_COEFF', - 'HEADER': 'tavg[Avg_Temp]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SURFACE_TOTAL_PRESSURE': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_FLOW_COEFF', - 'HEADER': 'tavg[Avg_TotalPress]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SURFACE_TOTAL_TEMPERATURE': {'DESCRIPTION': 'weighted time average ' - 'value', - 'GROUP': 'TAVG_FLOW_COEFF', - 'HEADER': 'tavg[Avg_TotalTemp]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_SURFACE_UNIFORMITY': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_FLOW_COEFF', - 'HEADER': 'tavg[Uniformity]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_THRUST': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_ROTATING_FRAME', - 'HEADER': 'tavg[CT]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_TOPOL_COMPLIANCE': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_STRUCT_COEFF', - 'HEADER': 'tavg[TopComp]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_TOPOL_DISCRETENESS': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_STRUCT_COEFF', - 'HEADER': 'tavg[TopDisc]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_TORQUE': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_ROTATING_FRAME', - 'HEADER': 'tavg[CQ]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_TOTAL_HEATFLUX': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_HEAT', - 'HEADER': 'tavg[HF]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'TAVG_VOLUME_FRACTION': {'DESCRIPTION': 'weighted time average value', - 'GROUP': 'TAVG_STRUCT_COEFF', - 'HEADER': 'tavg[VolFrac]', - 'TYPE': 'TAVG_COEFFICIENT'}, - 'THRUST': {'DESCRIPTION': 'Thrust coefficient', - 'GROUP': 'ROTATING_FRAME', - 'HEADER': 'CT', - 'TYPE': 'COEFFICIENT'}, - 'TOPOL_COMPLIANCE': {'DESCRIPTION': 'Structural compliance', - 'GROUP': 'STRUCT_COEFF', - 'HEADER': 'TopComp', - 'TYPE': 'COEFFICIENT'}, - 'TOPOL_DISCRETENESS': {'DESCRIPTION': 'Discreteness of the material ' - 'distribution', - 'GROUP': 'STRUCT_COEFF', - 'HEADER': 'TopDisc', - 'TYPE': 'COEFFICIENT'}, - 'TORQUE': {'DESCRIPTION': 'Torque coefficient', - 'GROUP': 'ROTATING_FRAME', - 'HEADER': 'CQ', - 'TYPE': 'COEFFICIENT'}, - 'TOTAL_HEATFLUX': {'DESCRIPTION': 'Total heatflux on all surfaces defined in ' - 'MARKER_MONITORING', - 'GROUP': 'HEAT', - 'HEADER': 'HF', - 'TYPE': 'COEFFICIENT'}, - 'VMS': {'DESCRIPTION': 'VMS', - 'GROUP': 'Maximum Von-Misses stress', - 'HEADER': 'VonMises', - 'TYPE': 'DEFAULT'}, - 'VOLUME_FRACTION': {'DESCRIPTION': 'Fraction of solid material', - 'GROUP': 'STRUCT_COEFF', - 'HEADER': 'VolFrac', - 'TYPE': 'COEFFICIENT'}} +history_header_map = { + "ADJOINT_DISP_X": { + "DESCRIPTION": "Root-mean square residual of the adjoint " + "of the X displacements.", + "GROUP": "RMS_RES", + "HEADER": "rms[Ux_adj]", + "TYPE": "RESIDUAL", + }, + "ADJOINT_DISP_Y": { + "DESCRIPTION": "Root-mean square residual of the adjoint " + "of the Y displacements.", + "GROUP": "RMS_RES", + "HEADER": "rms[Uy_adj]", + "TYPE": "RESIDUAL", + }, + "ADJOINT_DISP_Z": { + "DESCRIPTION": "Root-mean square residual of the adjoint " + "of the Z displacements.", + "GROUP": "RMS_RES", + "HEADER": "rms[Uz_adj]", + "TYPE": "RESIDUAL", + }, + "ADJOINT_SOLEXTRA": { + "DESCRIPTION": "Adjoint value of the first extra " "Solution.", + "GROUP": "ADJOINT_SOLEXTRA", + "HEADER": "Adjoint_SolExtra", + "TYPE": "COEFFICIENT", + }, + "AOA": { + "DESCRIPTION": "Angle of attack", + "GROUP": "AOA", + "HEADER": "AoA", + "TYPE": "DEFAULT", + }, + "AVG_CFL": { + "DESCRIPTION": "Current average of the local CFL numbers", + "GROUP": "CFL_NUMBER", + "HEADER": "Avg CFL", + "TYPE": "DEFAULT", + }, + "AVG_DENSITY": { + "DESCRIPTION": "Total average density on all markers set in " "MARKER_ANALYZE", + "GROUP": "FLOW_COEFF", + "HEADER": "Avg_Density", + "TYPE": "COEFFICIENT", + }, + "AVG_ENTHALPY": { + "DESCRIPTION": "Total average enthalpy on all markers set in " "MARKER_ANALYZE", + "GROUP": "FLOW_COEFF", + "HEADER": "Avg_Enthalpy", + "TYPE": "COEFFICIENT", + }, + "AVG_NORMALVEL": { + "DESCRIPTION": "Total average normal velocity on all " + "markers set in MARKER_ANALYZE", + "GROUP": "FLOW_COEFF", + "HEADER": "Avg_NormalVel", + "TYPE": "COEFFICIENT", + }, + "AVG_TEMPERATURE": { + "DESCRIPTION": "Average temperature on all surfaces " + "defined in MARKER_MONITORING", + "GROUP": "HEAT", + "HEADER": "AvgTemp", + "TYPE": "COEFFICIENT", + }, + "BGS_ADJ_DENSITY": { + "DESCRIPTION": "BGS residual of the adjoint density.", + "GROUP": "BGS_RES", + "HEADER": "bgs[A_Rho]", + "TYPE": "RESIDUAL", + }, + "BGS_ADJ_DISP_X": { + "DESCRIPTION": "BGS residual of the adjoint X " "displacement.", + "GROUP": "BGS_RES", + "HEADER": "bgs[A_Ux]", + "TYPE": "RESIDUAL", + }, + "BGS_ADJ_DISP_Y": { + "DESCRIPTION": "BGS residual of the adjoint Y " "displacement.", + "GROUP": "BGS_RES", + "HEADER": "bgs[A_Uy]", + "TYPE": "RESIDUAL", + }, + "BGS_ADJ_DISP_Z": { + "DESCRIPTION": "BGS residual of the adjoint Z " "displacement.", + "GROUP": "BGS_RES", + "HEADER": "bgs[A_Uz]", + "TYPE": "RESIDUAL", + }, + "BGS_ADJ_DISSIPATION": { + "DESCRIPTION": "BGS residual of the adjoint " "dissipation.", + "GROUP": "BGS_RES", + "HEADER": "bgs[A_w]", + "TYPE": "RESIDUAL", + }, + "BGS_ADJ_ENERGY": { + "DESCRIPTION": "BGS residual of the adjoint energy.", + "GROUP": "BGS_RES", + "HEADER": "bgs[A_E]", + "TYPE": "RESIDUAL", + }, + "BGS_ADJ_MOMENTUM-X": { + "DESCRIPTION": "BGS residual of the adjoint momentum " "x-component", + "GROUP": "BGS_RES", + "HEADER": "bgs[A_RhoU]", + "TYPE": "RESIDUAL", + }, + "BGS_ADJ_MOMENTUM-Y": { + "DESCRIPTION": "BGS residual of the adjoint momentum " "y-component", + "GROUP": "BGS_RES", + "HEADER": "bgs[A_RhoV]", + "TYPE": "RESIDUAL", + }, + "BGS_ADJ_MOMENTUM-Z": { + "DESCRIPTION": "BGS residual of the adjoint momentum " "z-component", + "GROUP": "BGS_RES", + "HEADER": "bgs[A_RhoW]", + "TYPE": "RESIDUAL", + }, + "BGS_ADJ_NU_TILDE": { + "DESCRIPTION": "BGS residual of the adjoint nu tilde.", + "GROUP": "BGS_RES", + "HEADER": "bgs[A_nu]", + "TYPE": "RESIDUAL", + }, + "BGS_ADJ_PRESSURE": { + "DESCRIPTION": "BGS residual of the adjoint Pressure.", + "GROUP": "BGS_RES", + "HEADER": "bgs[A_Rho]", + "TYPE": "RESIDUAL", + }, + "BGS_ADJ_RAD_ENERGY": { + "DESCRIPTION": "BGS residual of the P1 radiative " "energy.", + "GROUP": "BGS_RES", + "HEADER": "bgs[A_P1]", + "TYPE": "RESIDUAL", + }, + 'BGS_ADJ_SPECIES_" + std::to_string(iVar': { + "DESCRIPTION": "BGS residual of " "the adjoint " "transported " "species.", + "GROUP": "BGS_RES", + "HEADER": 'bgs[A_rho*Y_" + ' "std::to_string(iVar) + " '"]', + "TYPE": "RESIDUAL", + }, + "BGS_ADJ_TEMPERATURE": { + "DESCRIPTION": "BGS residual of the adjoint " "temperature.", + "GROUP": "BGS_RES", + "HEADER": "bgs[A_T]", + "TYPE": "RESIDUAL", + }, + "BGS_ADJ_TKE": { + "DESCRIPTION": "BGS residual of the adjoint kinetic energy.", + "GROUP": "BGS_RES", + "HEADER": "bgs[A_k]", + "TYPE": "RESIDUAL", + }, + "BGS_ADJ_VELOCITY-X": { + "DESCRIPTION": "BGS residual of the adjoint Velocity " "x-component", + "GROUP": "BGS_RES", + "HEADER": "bgs[A_RhoU]", + "TYPE": "RESIDUAL", + }, + "BGS_ADJ_VELOCITY-Y": { + "DESCRIPTION": "BGS residual of the adjoint Velocity " "y-component", + "GROUP": "BGS_RES", + "HEADER": "bgs[A_RhoV]", + "TYPE": "RESIDUAL", + }, + "BGS_ADJ_VELOCITY-Z": { + "DESCRIPTION": "BGS residual of the adjoint Velocity " "z-component", + "GROUP": "BGS_RES", + "HEADER": "bgs[A_RhoW]", + "TYPE": "RESIDUAL", + }, + "BGS_DENSITY": { + "DESCRIPTION": "BGS residual of the density.", + "GROUP": "BGS_RES", + "HEADER": "bgs[Rho]", + "TYPE": "RESIDUAL", + }, + "BGS_DISP_X": { + "DESCRIPTION": "BGS residual of X displacement", + "GROUP": "BGS_RES", + "HEADER": "bgs[DispX]", + "TYPE": "RESIDUAL", + }, + "BGS_DISP_Y": { + "DESCRIPTION": "BGS residual of Y displacement", + "GROUP": "BGS_RES", + "HEADER": "bgs[DispY]", + "TYPE": "RESIDUAL", + }, + "BGS_DISP_Z": { + "DESCRIPTION": "BGS residual of Z displacement", + "GROUP": "BGS_RES", + "HEADER": "bgs[DispZ]", + "TYPE": "RESIDUAL", + }, + "BGS_DISSIPATION": { + "DESCRIPTION": "BGS residual of dissipation (SST model).", + "GROUP": "BGS_RES", + "HEADER": "bgs[w]", + "TYPE": "RESIDUAL", + }, + "BGS_ENERGY": { + "DESCRIPTION": "BGS residual of the energy.", + "GROUP": "BGS_RES", + "HEADER": "bgs[RhoE]", + "TYPE": "RESIDUAL", + }, + "BGS_MOMENTUM-X": { + "DESCRIPTION": "BGS residual of the momentum x-component.", + "GROUP": "BGS_RES", + "HEADER": "bgs[RhoU]", + "TYPE": "RESIDUAL", + }, + "BGS_MOMENTUM-Y": { + "DESCRIPTION": "BGS residual of the momentum y-component.", + "GROUP": "BGS_RES", + "HEADER": "bgs[RhoV]", + "TYPE": "RESIDUAL", + }, + "BGS_NU_TILDE": { + "DESCRIPTION": "BGS residual of nu tilde (SA model).", + "GROUP": "BGS_RES", + "HEADER": "bgs[nu]", + "TYPE": "RESIDUAL", + }, + "BGS_PRESSURE": { + "DESCRIPTION": "BGS residual of the pressure.", + "GROUP": "BGS_RES", + "HEADER": "bgs[P]", + "TYPE": "RESIDUAL", + }, + 'BGS_SPECIES_" + std::to_string(iVar': { + "DESCRIPTION": "BGS residual of " "transported species.", + "GROUP": "BGS_RES", + "HEADER": 'bgs[rho*Y_" + ' 'std::to_string(iVar)+"]', + "TYPE": "RESIDUAL", + }, + "BGS_TEMPERATURE": { + "DESCRIPTION": "Block-Gauss-Seidel residual of the " "temperature", + "GROUP": "BGS_RES", + "HEADER": "bgs[T]", + "TYPE": "RESIDUAL", + }, + "BGS_TKE": { + "DESCRIPTION": "BGS residual of kinetic energy (SST model).", + "GROUP": "BGS_RES", + "HEADER": "bgs[k]", + "TYPE": "RESIDUAL", + }, + "BGS_VELOCITY-X": { + "DESCRIPTION": "BGS residual of the velocity x-component.", + "GROUP": "BGS_RES", + "HEADER": "bgs[U]", + "TYPE": "RESIDUAL", + }, + "BGS_VELOCITY-Y": { + "DESCRIPTION": "BGS residual of the velocity y-component.", + "GROUP": "BGS_RES", + "HEADER": "bgs[V]", + "TYPE": "RESIDUAL", + }, + "BGS_VELOCITY-Z": { + "DESCRIPTION": "BGS residual of the velocity z-component.", + "GROUP": "BGS_RES", + "HEADER": "bgs[W]", + "TYPE": "RESIDUAL", + }, + "BUFFET": { + "DESCRIPTION": "Buffet sensor", + "GROUP": "AERO_COEFF", + "HEADER": "Buffet", + "TYPE": "COEFFICIENT", + }, + "CFL_NUMBER": { + "DESCRIPTION": "Current value of the CFL number", + "GROUP": "CFL_NUMBER", + "HEADER": "CFL number", + "TYPE": "DEFAULT", + }, + "CHANGE_IN_AOA": { + "DESCRIPTION": "Last change in Angle of Attack by Fixed CL " "Driver", + "GROUP": "FIXED_CL", + "HEADER": "Change_in_AOA", + "TYPE": "RESIDUAL", + }, + "CL_DRIVER_COMMAND": { + "DESCRIPTION": "CL Driver's control command", + "GROUP": "FIXED_CL", + "HEADER": "CL_Driver_Command", + "TYPE": "RESIDUAL", + }, + "COMBO": { + "DESCRIPTION": "Combined obj. function value.", + "GROUP": "COMBO", + "HEADER": "ComboObj", + "TYPE": "COEFFICIENT", + }, + "DEFORM_ITER": { + "DESCRIPTION": "Linear solver iterations for the mesh " "deformation", + "GROUP": "DEFORM", + "HEADER": "DeformIter", + "TYPE": "DEFAULT", + }, + "DEFORM_MAX_VOLUME": { + "DESCRIPTION": "Maximum volume in the mesh", + "GROUP": "DEFORM", + "HEADER": "MaxVolume", + "TYPE": "DEFAULT", + }, + "DEFORM_MIN_VOLUME": { + "DESCRIPTION": "Minimum volume in the mesh", + "GROUP": "DEFORM", + "HEADER": "MinVolume", + "TYPE": "DEFAULT", + }, + "DEFORM_RESIDUAL": { + "DESCRIPTION": "Residual of the linear solver for the " "mesh deformation", + "GROUP": "DEFORM", + "HEADER": "DeformRes", + "TYPE": "DEFAULT", + }, + "DELTA_CL": { + "DESCRIPTION": "Difference between Target CL and current CL", + "GROUP": "FIXED_CL", + "HEADER": "Delta_CL", + "TYPE": "COEFFICIENT", + }, + "DRAG": { + "DESCRIPTION": "Total drag coefficient on all surfaces set with " + "MARKER_MONITORING", + "GROUP": "AERO_COEFF", + "HEADER": "CD", + "TYPE": "COEFFICIENT", + }, + "D_ADJOINT_SOLEXTRA": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_ADJOINT_SOLEXTRA", + "HEADER": "d[Adjoint_SolExtra]", + "TYPE": "D_COEFFICIENT", + }, + "D_AVG_DENSITY": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_FLOW_COEFF", + "HEADER": "d[Avg_Density]", + "TYPE": "D_COEFFICIENT", + }, + "D_AVG_ENTHALPY": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_FLOW_COEFF", + "HEADER": "d[Avg_Enthalpy]", + "TYPE": "D_COEFFICIENT", + }, + "D_AVG_NORMALVEL": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_FLOW_COEFF", + "HEADER": "d[Avg_NormalVel]", + "TYPE": "D_COEFFICIENT", + }, + "D_AVG_TEMPERATURE": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_HEAT", + "HEADER": "d[AvgTemp]", + "TYPE": "D_COEFFICIENT", + }, + "D_BUFFET": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_AERO_COEFF", + "HEADER": "d[Buffet]", + "TYPE": "D_COEFFICIENT", + }, + "D_COMBO": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_COMBO", + "HEADER": "d[ComboObj]", + "TYPE": "D_COEFFICIENT", + }, + "D_DELTA_CL": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_FIXED_CL", + "HEADER": "d[Delta_CL]", + "TYPE": "D_COEFFICIENT", + }, + "D_DRAG": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_AERO_COEFF", + "HEADER": "d[CD]", + "TYPE": "D_COEFFICIENT", + }, + "D_EFFICIENCY": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_AERO_COEFF", + "HEADER": "d[CEff]", + "TYPE": "D_COEFFICIENT", + }, + "D_EQUIVALENT_AREA": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_EQUIVALENT_AREA", + "HEADER": "d[CEquiv_Area]", + "TYPE": "D_COEFFICIENT", + }, + "D_FIGURE_OF_MERIT": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_ROTATING_FRAME", + "HEADER": "d[CMerit]", + "TYPE": "D_COEFFICIENT", + }, + "D_FORCE_X": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_AERO_COEFF", + "HEADER": "d[CFx]", + "TYPE": "D_COEFFICIENT", + }, + "D_FORCE_Y": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_AERO_COEFF", + "HEADER": "d[CFy]", + "TYPE": "D_COEFFICIENT", + }, + "D_FORCE_Z": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_AERO_COEFF", + "HEADER": "d[CFz]", + "TYPE": "D_COEFFICIENT", + }, + "D_INVERSE_DESIGN_PRESSURE": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_CP_DIFF", + "HEADER": "d[Cp_Diff]", + "TYPE": "D_COEFFICIENT", + }, + "D_LIFT": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_AERO_COEFF", + "HEADER": "d[CL]", + "TYPE": "D_COEFFICIENT", + }, + "D_MAXIMUM_HEATFLUX": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_HEAT", + "HEADER": "d[MaxHF]", + "TYPE": "D_COEFFICIENT", + }, + "D_MOMENT_X": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_AERO_COEFF", + "HEADER": "d[CMx]", + "TYPE": "D_COEFFICIENT", + }, + "D_MOMENT_Y": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_AERO_COEFF", + "HEADER": "d[CMy]", + "TYPE": "D_COEFFICIENT", + }, + "D_MOMENT_Z": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_AERO_COEFF", + "HEADER": "d[CMz]", + "TYPE": "D_COEFFICIENT", + }, + "D_REFERENCE_GEOMETRY": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_STRUCT_COEFF", + "HEADER": "d[RefGeom]", + "TYPE": "D_COEFFICIENT", + }, + "D_REFERENCE_NODE": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_STRUCT_COEFF", + "HEADER": "d[RefNode]", + "TYPE": "D_COEFFICIENT", + }, + "D_SENS_AOA": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_SENSITIVITY", + "HEADER": "d[Sens_AoA]", + "TYPE": "D_COEFFICIENT", + }, + "D_SENS_GEO": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_SENSITIVITY", + "HEADER": "d[Sens_Geo]", + "TYPE": "D_COEFFICIENT", + }, + "D_SENS_MACH": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_SENSITIVITY", + "HEADER": "d[Sens_Mach]", + "TYPE": "D_COEFFICIENT", + }, + "D_SENS_PRESS": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_SENSITIVITY", + "HEADER": "d[Sens_Press]", + "TYPE": "D_COEFFICIENT", + }, + "D_SENS_PRESS_OUT": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_SENSITIVITY", + "HEADER": "d[Sens_Pout]", + "TYPE": "D_COEFFICIENT", + }, + "D_SENS_TEMP": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_SENSITIVITY", + "HEADER": "d[Sens_Temp]", + "TYPE": "D_COEFFICIENT", + }, + "D_SENS_VEL_IN": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_SENSITIVITY", + "HEADER": "d[Sens_Vin]", + "TYPE": "D_COEFFICIENT", + }, + "D_SIDEFORCE": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_AERO_COEFF", + "HEADER": "d[CSF]", + "TYPE": "D_COEFFICIENT", + }, + "D_STRESS_PENALTY": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_STRUCT_COEFF", + "HEADER": "d[StressPen]", + "TYPE": "D_COEFFICIENT", + }, + "D_SURFACE_MACH": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_FLOW_COEFF", + "HEADER": "d[Avg_Mach]", + "TYPE": "D_COEFFICIENT", + }, + "D_SURFACE_MASSFLOW": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_FLOW_COEFF", + "HEADER": "d[Avg_Massflow]", + "TYPE": "D_COEFFICIENT", + }, + "D_SURFACE_MOM_DISTORTION": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_FLOW_COEFF", + "HEADER": "d[Momentum_Distortion]", + "TYPE": "D_COEFFICIENT", + }, + "D_SURFACE_PRESSURE_DROP": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_FLOW_COEFF", + "HEADER": "d[Pressure_Drop]", + "TYPE": "D_COEFFICIENT", + }, + "D_SURFACE_SECONDARY": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_FLOW_COEFF", + "HEADER": "d[Secondary_Strength]", + "TYPE": "D_COEFFICIENT", + }, + "D_SURFACE_SECOND_OVER_UNIFORM": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_FLOW_COEFF", + "HEADER": "d[Secondary_Over_Uniformity]", + "TYPE": "D_COEFFICIENT", + }, + 'D_SURFACE_SPECIES_" + std::to_string(iVar': { + "DESCRIPTION": "Derivative " "value", + "GROUP": "D_SPECIES_COEFF", + "HEADER": 'd[Avg_Species_" + ' "std::to_string(iVar]", + "TYPE": "D_COEFFICIENT", + }, + "D_SURFACE_STATIC_PRESSURE": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_FLOW_COEFF", + "HEADER": "d[Avg_Press]", + "TYPE": "D_COEFFICIENT", + }, + "D_SURFACE_STATIC_TEMPERATURE": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_FLOW_COEFF", + "HEADER": "d[Avg_Temp]", + "TYPE": "D_COEFFICIENT", + }, + "D_SURFACE_TOTAL_PRESSURE": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_FLOW_COEFF", + "HEADER": "d[Avg_TotalPress]", + "TYPE": "D_COEFFICIENT", + }, + "D_SURFACE_TOTAL_TEMPERATURE": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_FLOW_COEFF", + "HEADER": "d[Avg_TotalTemp]", + "TYPE": "D_COEFFICIENT", + }, + "D_SURFACE_UNIFORMITY": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_FLOW_COEFF", + "HEADER": "d[Uniformity]", + "TYPE": "D_COEFFICIENT", + }, + "D_THRUST": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_ROTATING_FRAME", + "HEADER": "d[CT]", + "TYPE": "D_COEFFICIENT", + }, + "D_TOPOL_COMPLIANCE": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_STRUCT_COEFF", + "HEADER": "d[TopComp]", + "TYPE": "D_COEFFICIENT", + }, + "D_TOPOL_DISCRETENESS": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_STRUCT_COEFF", + "HEADER": "d[TopDisc]", + "TYPE": "D_COEFFICIENT", + }, + "D_TORQUE": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_ROTATING_FRAME", + "HEADER": "d[CQ]", + "TYPE": "D_COEFFICIENT", + }, + "D_TOTAL_HEATFLUX": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_HEAT", + "HEADER": "d[HF]", + "TYPE": "D_COEFFICIENT", + }, + "D_VOLUME_FRACTION": { + "DESCRIPTION": "Derivative value", + "GROUP": "D_STRUCT_COEFF", + "HEADER": "d[VolFrac]", + "TYPE": "D_COEFFICIENT", + }, + "EFFICIENCY": { + "DESCRIPTION": "Total lift-to-drag ratio on all surfaces set " + "with MARKER_MONITORING", + "GROUP": "AERO_COEFF", + "HEADER": "CEff", + "TYPE": "COEFFICIENT", + }, + "EQUIVALENT_AREA": { + "DESCRIPTION": "Equivalent area", + "GROUP": "EQUIVALENT_AREA", + "HEADER": "CEquiv_Area", + "TYPE": "COEFFICIENT", + }, + "FIGURE_OF_MERIT": { + "DESCRIPTION": "Thrust over torque", + "GROUP": "ROTATING_FRAME", + "HEADER": "CMerit", + "TYPE": "COEFFICIENT", + }, + "FORCE_X": { + "DESCRIPTION": "Total force x-component on all surfaces set with " + "MARKER_MONITORING", + "GROUP": "AERO_COEFF", + "HEADER": "CFx", + "TYPE": "COEFFICIENT", + }, + "FORCE_Y": { + "DESCRIPTION": "Total force y-component on all surfaces set with " + "MARKER_MONITORING", + "GROUP": "AERO_COEFF", + "HEADER": "CFy", + "TYPE": "COEFFICIENT", + }, + "FORCE_Z": { + "DESCRIPTION": "Total force z-component on all surfaces set with " + "MARKER_MONITORING", + "GROUP": "AERO_COEFF", + "HEADER": "CFz", + "TYPE": "COEFFICIENT", + }, + "INVERSE_DESIGN_PRESSURE": { + "DESCRIPTION": "Cp difference for inverse design", + "GROUP": "CP_DIFF", + "HEADER": "Cp_Diff", + "TYPE": "COEFFICIENT", + }, + "LIFT": { + "DESCRIPTION": "Total lift coefficient on all surfaces set with " + "MARKER_MONITORING", + "GROUP": "AERO_COEFF", + "HEADER": "CL", + "TYPE": "COEFFICIENT", + }, + "LINSOL_ITER": { + "DESCRIPTION": "Number of iterations of the linear solver.", + "GROUP": "LINSOL", + "HEADER": "LinSolIter", + "TYPE": "DEFAULT", + }, + "LINSOL_ITER_SPECIES": { + "DESCRIPTION": "Number of iterations of the linear " + "solver for species solver.", + "GROUP": "LINSOL", + "HEADER": "LinSolIterSpecies", + "TYPE": "DEFAULT", + }, + "LINSOL_ITER_TURB": { + "DESCRIPTION": "Number of iterations of the linear " "solver for turbulence.", + "GROUP": "LINSOL", + "HEADER": "LinSolIterTurb", + "TYPE": "DEFAULT", + }, + "LINSOL_RESIDUAL": { + "DESCRIPTION": "Residual of the linear solver.", + "GROUP": "LINSOL", + "HEADER": "LinSolRes", + "TYPE": "DEFAULT", + }, + "LINSOL_RESIDUAL_SPECIES": { + "DESCRIPTION": "Residual of the linear solver for " "species solver.", + "GROUP": "LINSOL", + "HEADER": "LinSolResSpecies", + "TYPE": "DEFAULT", + }, + "LINSOL_RESIDUAL_TURB": { + "DESCRIPTION": "Residual of the linear solver for " "turbulence.", + "GROUP": "LINSOL", + "HEADER": "LinSolResTurb", + "TYPE": "DEFAULT", + }, + "LOAD_INCREMENT": { + "DESCRIPTION": "LOAD_INCREMENT", + "GROUP": "Percent of total load (incremental", + "HEADER": "Load[%]", + "TYPE": "DEFAULT", + }, + "LOAD_RAMP": { + "DESCRIPTION": "LOAD_RAMP", + "GROUP": "Fraction of total load (ramped", + "HEADER": "Load_Ramp", + "TYPE": "DEFAULT", + }, + "MAXIMUM_HEATFLUX": { + "DESCRIPTION": "Maximum heatflux on all surfaces defined " + "in MARKER_MONITORING", + "GROUP": "HEAT", + "HEADER": "MaxHF", + "TYPE": "COEFFICIENT", + }, + "MAX_ADJ_DENSITY": { + "DESCRIPTION": "Maximum residual of the adjoint density.", + "GROUP": "MAX_RES", + "HEADER": "max[A_Rho]", + "TYPE": "RESIDUAL", + }, + "MAX_ADJ_DISSIPATION": { + "DESCRIPTION": "Maximum residual of the adjoint " "dissipation.", + "GROUP": "MAX_RES", + "HEADER": "max[A_w]", + "TYPE": "RESIDUAL", + }, + "MAX_ADJ_ENERGY": { + "DESCRIPTION": "Maximum residual of the adjoint energy.", + "GROUP": "MAX_RES", + "HEADER": "max[A_E]", + "TYPE": "RESIDUAL", + }, + "MAX_ADJ_MOMENTUM-X": { + "DESCRIPTION": "Maximum residual of the adjoint " "momentum x-component", + "GROUP": "MAX_RES", + "HEADER": "max[A_RhoU]", + "TYPE": "RESIDUAL", + }, + "MAX_ADJ_MOMENTUM-Y": { + "DESCRIPTION": "Maximum residual of the adjoint " "momentum y-component", + "GROUP": "MAX_RES", + "HEADER": "max[A_RhoV]", + "TYPE": "RESIDUAL", + }, + "MAX_ADJ_MOMENTUM-Z": { + "DESCRIPTION": "Maximum residual of the adjoint " "momentum z-component", + "GROUP": "MAX_RES", + "HEADER": "max[A_RhoW]", + "TYPE": "RESIDUAL", + }, + "MAX_ADJ_NU_TILDE": { + "DESCRIPTION": "Maximum residual of the adjoint nu " "tilde.", + "GROUP": "MAX_RES", + "HEADER": "max[A_nu]", + "TYPE": "RESIDUAL", + }, + "MAX_ADJ_PRESSURE": { + "DESCRIPTION": "Maximum residual of the adjoint " "Pressure.", + "GROUP": "MAX_RES", + "HEADER": "max[A_Rho]", + "TYPE": "RESIDUAL", + }, + 'MAX_ADJ_SPECIES_" + std::to_string(iVar': { + "DESCRIPTION": "Maximum residual " "of the adjoint " "transported " "species.", + "GROUP": "MAX_RES", + "HEADER": 'max[A_rho*Y_" + ' "std::to_string(iVar) + " '"]', + "TYPE": "RESIDUAL", + }, + "MAX_ADJ_TEMPERATURE": { + "DESCRIPTION": "Maximum residual of the temperature.", + "GROUP": "MAX_RES", + "HEADER": "max[A_T]", + "TYPE": "RESIDUAL", + }, + "MAX_ADJ_TKE": { + "DESCRIPTION": "Maximum residual of the adjoint kinetic " "energy.", + "GROUP": "MAX_RES", + "HEADER": "max[A_k]", + "TYPE": "RESIDUAL", + }, + "MAX_ADJ_VELOCITY-X": { + "DESCRIPTION": "Maximum residual of the adjoint " "Velocity x-component", + "GROUP": "MAX_RES", + "HEADER": "max[A_RhoU]", + "TYPE": "RESIDUAL", + }, + "MAX_ADJ_VELOCITY-Y": { + "DESCRIPTION": "Maximum residual of the adjoint " "Velocity y-component", + "GROUP": "MAX_RES", + "HEADER": "max[A_RhoV]", + "TYPE": "RESIDUAL", + }, + "MAX_ADJ_VELOCITY-Z": { + "DESCRIPTION": "Maximum residual of the adjoint " "Velocity z-component", + "GROUP": "MAX_RES", + "HEADER": "max[A_RhoW]", + "TYPE": "RESIDUAL", + }, + "MAX_CFL": { + "DESCRIPTION": "Current maximum of the local CFL numbers", + "GROUP": "CFL_NUMBER", + "HEADER": "Max CFL", + "TYPE": "DEFAULT", + }, + "MAX_DELTA_TIME": { + "DESCRIPTION": "Current maximum local time step", + "GROUP": "CFL_NUMBER", + "HEADER": "Max DT", + "TYPE": "DEFAULT", + }, + "MAX_DENSITY": { + "DESCRIPTION": "Maximum square residual of the density.", + "GROUP": "MAX_RES", + "HEADER": "max[Rho]", + "TYPE": "RESIDUAL", + }, + "MAX_DISSIPATION": { + "DESCRIPTION": "Maximum residual of dissipation (SST " "model).", + "GROUP": "MAX_RES", + "HEADER": "max[w]", + "TYPE": "RESIDUAL", + }, + "MAX_ENERGY": { + "DESCRIPTION": "Maximum residual of the energy.", + "GROUP": "MAX_RES", + "HEADER": "max[RhoE]", + "TYPE": "RESIDUAL", + }, + "MAX_MOMENTUM-X": { + "DESCRIPTION": "Maximum square residual of the momentum " "x-component.", + "GROUP": "MAX_RES", + "HEADER": "max[RhoU]", + "TYPE": "RESIDUAL", + }, + "MAX_MOMENTUM-Y": { + "DESCRIPTION": "Maximum square residual of the momentum " "y-component.", + "GROUP": "MAX_RES", + "HEADER": "max[RhoV]", + "TYPE": "RESIDUAL", + }, + "MAX_NU_TILDE": { + "DESCRIPTION": "Maximum residual of nu tilde (SA model).", + "GROUP": "MAX_RES", + "HEADER": "max[nu]", + "TYPE": "RESIDUAL", + }, + "MAX_PRESSURE": { + "DESCRIPTION": "Maximum residual of the pressure.", + "GROUP": "MAX_RES", + "HEADER": "max[P]", + "TYPE": "RESIDUAL", + }, + 'MAX_SPECIES_" + std::to_string(iVar': { + "DESCRIPTION": "Maximum residual of " "transported species.", + "GROUP": "MAX_RES", + "HEADER": 'max[rho*Y_" + ' 'std::to_string(iVar)+"]', + "TYPE": "RESIDUAL", + }, + "MAX_TEMPERATURE": { + "DESCRIPTION": "Maximum residual of the temperature", + "GROUP": "MAX_RES", + "HEADER": "max[T]", + "TYPE": "RESIDUAL", + }, + "MAX_TKE": { + "DESCRIPTION": "Maximum residual of kinetic energy (SST model).", + "GROUP": "MAX_RES", + "HEADER": "max[k]", + "TYPE": "RESIDUAL", + }, + "MAX_VELOCITY-X": { + "DESCRIPTION": "Maximum residual of the velocity " "x-component.", + "GROUP": "MAX_RES", + "HEADER": "max[U]", + "TYPE": "RESIDUAL", + }, + "MAX_VELOCITY-Y": { + "DESCRIPTION": "Maximum residual of the velocity " "y-component.", + "GROUP": "MAX_RES", + "HEADER": "max[V]", + "TYPE": "RESIDUAL", + }, + "MAX_VELOCITY-Z": { + "DESCRIPTION": "Maximum residual of the velocity " "z-component.", + "GROUP": "MAX_RES", + "HEADER": "max[W]", + "TYPE": "RESIDUAL", + }, + "MIN_CFL": { + "DESCRIPTION": "Current minimum of the local CFL numbers", + "GROUP": "CFL_NUMBER", + "HEADER": "Min CFL", + "TYPE": "DEFAULT", + }, + "MIN_DELTA_TIME": { + "DESCRIPTION": "Current minimum local time step", + "GROUP": "CFL_NUMBER", + "HEADER": "Min DT", + "TYPE": "DEFAULT", + }, + "MOMENT_X": { + "DESCRIPTION": "Total momentum x-component on all surfaces set " + "with MARKER_MONITORING", + "GROUP": "AERO_COEFF", + "HEADER": "CMx", + "TYPE": "COEFFICIENT", + }, + "MOMENT_Y": { + "DESCRIPTION": "Total momentum y-component on all surfaces set " + "with MARKER_MONITORING", + "GROUP": "AERO_COEFF", + "HEADER": "CMy", + "TYPE": "COEFFICIENT", + }, + "MOMENT_Z": { + "DESCRIPTION": "Total momentum z-component on all surfaces set " + "with MARKER_MONITORING", + "GROUP": "AERO_COEFF", + "HEADER": "CMz", + "TYPE": "COEFFICIENT", + }, + "PREV_AOA": { + "DESCRIPTION": "Angle of Attack at the previous iteration of the " + "Fixed CL driver", + "GROUP": "FIXED_CL", + "HEADER": "Previous_AOA", + "TYPE": "DEFAULT", + }, + "REFERENCE_GEOMETRY": { + "DESCRIPTION": "L2 norm of difference wrt reference " "geometry", + "GROUP": "STRUCT_COEFF", + "HEADER": "RefGeom", + "TYPE": "COEFFICIENT", + }, + "REFERENCE_NODE": { + "DESCRIPTION": "Distance to reference node", + "GROUP": "STRUCT_COEFF", + "HEADER": "RefNode", + "TYPE": "COEFFICIENT", + }, + "RMS_ADJ_DENSITY": { + "DESCRIPTION": "Root-mean square residual of the adjoint " "density.", + "GROUP": "RMS_RES", + "HEADER": "rms[A_Rho]", + "TYPE": "RESIDUAL", + }, + "RMS_ADJ_DISSIPATION": { + "DESCRIPTION": "Root-mean square residual of the " "adjoint dissipation.", + "GROUP": "RMS_RES", + "HEADER": "rms[A_w]", + "TYPE": "RESIDUAL", + }, + "RMS_ADJ_ENERGY": { + "DESCRIPTION": "Root-mean square residual of the adjoint " "energy.", + "GROUP": "RMS_RES", + "HEADER": "rms[A_E]", + "TYPE": "RESIDUAL", + }, + "RMS_ADJ_MOMENTUM-X": { + "DESCRIPTION": "Root-mean square residual of the " + "adjoint momentum x-component.", + "GROUP": "RMS_RES", + "HEADER": "rms[A_RhoU]", + "TYPE": "RESIDUAL", + }, + "RMS_ADJ_MOMENTUM-Y": { + "DESCRIPTION": "Root-mean square residual of the " + "adjoint momentum y-component.", + "GROUP": "RMS_RES", + "HEADER": "rms[A_RhoV]", + "TYPE": "RESIDUAL", + }, + "RMS_ADJ_MOMENTUM-Z": { + "DESCRIPTION": "Root-mean square residual of the " + "adjoint momentum z-component.", + "GROUP": "RMS_RES", + "HEADER": "rms[A_RhoW]", + "TYPE": "RESIDUAL", + }, + "RMS_ADJ_NU_TILDE": { + "DESCRIPTION": "Root-mean square residual of the adjoint " "nu tilde.", + "GROUP": "RMS_RES", + "HEADER": "rms[A_nu]", + "TYPE": "RESIDUAL", + }, + "RMS_ADJ_PRESSURE": { + "DESCRIPTION": "Root-mean square residual of the adjoint " "Pressure.", + "GROUP": "RMS_RES", + "HEADER": "rms[A_P]", + "TYPE": "RESIDUAL", + }, + "RMS_ADJ_RAD_ENERGY": { + "DESCRIPTION": "Root-mean square residual of the P1 " "radiative energy.", + "GROUP": "RMS_RES", + "HEADER": "rms[A_P1]", + "TYPE": "RESIDUAL", + }, + 'RMS_ADJ_SPECIES_" + std::to_string(iVar': { + "DESCRIPTION": "Root-mean square " + "residual of the " + "adjoint " + "transported " + "species.", + "GROUP": "RMS_RES", + "HEADER": 'rms[A_rho*Y_" + ' "std::to_string(iVar) + " '"]', + "TYPE": "RESIDUAL", + }, + "RMS_ADJ_TEMPERATURE": { + "DESCRIPTION": "Root-mean square residual of the " "adjoint temperature.", + "GROUP": "RMS_RES", + "HEADER": "rms[A_T]", + "TYPE": "RESIDUAL", + }, + "RMS_ADJ_TKE": { + "DESCRIPTION": "Root-mean square residual of the adjoint " "kinetic energy.", + "GROUP": "RMS_RES", + "HEADER": "rms[A_k]", + "TYPE": "RESIDUAL", + }, + "RMS_ADJ_VELOCITY-X": { + "DESCRIPTION": "Root-mean square residual of the " + "adjoint Velocity x-component.", + "GROUP": "RMS_RES", + "HEADER": "rms[A_U]", + "TYPE": "RESIDUAL", + }, + "RMS_ADJ_VELOCITY-Y": { + "DESCRIPTION": "Root-mean square residual of the " + "adjoint Velocity y-component.", + "GROUP": "RMS_RES", + "HEADER": "rms[A_V]", + "TYPE": "RESIDUAL", + }, + "RMS_ADJ_VELOCITY-Z": { + "DESCRIPTION": "Root-mean square residual of the " + "adjoint Velocity z-component.", + "GROUP": "RMS_RES", + "HEADER": "rms[A_W]", + "TYPE": "RESIDUAL", + }, + "RMS_DENSITY": { + "DESCRIPTION": "Root-mean square residual of the density.", + "GROUP": "RMS_RES", + "HEADER": "rms[Rho]", + "TYPE": "RESIDUAL", + }, + "RMS_DISP_X": { + "DESCRIPTION": "Residual of X displacement", + "GROUP": "RMS_RES", + "HEADER": "rms[DispX]", + "TYPE": "RESIDUAL", + }, + "RMS_DISP_Y": { + "DESCRIPTION": "Residual of Y displacement", + "GROUP": "RMS_RES", + "HEADER": "rms[DispY]", + "TYPE": "RESIDUAL", + }, + "RMS_DISP_Z": { + "DESCRIPTION": "Residual of Z displacement", + "GROUP": "RMS_RES", + "HEADER": "rms[DispZ]", + "TYPE": "RESIDUAL", + }, + "RMS_DISSIPATION": { + "DESCRIPTION": "Root-mean square residual of dissipation " "(SST model).", + "GROUP": "RMS_RES", + "HEADER": "rms[w]", + "TYPE": "RESIDUAL", + }, + "RMS_ENERGY": { + "DESCRIPTION": "Root-mean square residual of the energy.", + "GROUP": "RMS_RES", + "HEADER": "rms[RhoE]", + "TYPE": "RESIDUAL", + }, + "RMS_ETOL": { + "DESCRIPTION": "Norm of energy/work increment", + "GROUP": "RMS_RES", + "HEADER": "rms[E]", + "TYPE": "RESIDUAL", + }, + "RMS_MOMENTUM-X": { + "DESCRIPTION": "Root-mean square residual of the momentum " "x-component.", + "GROUP": "RMS_RES", + "HEADER": "rms[RhoU]", + "TYPE": "RESIDUAL", + }, + "RMS_MOMENTUM-Y": { + "DESCRIPTION": "Root-mean square residual of the momentum " "y-component.", + "GROUP": "RMS_RES", + "HEADER": "rms[RhoV]", + "TYPE": "RESIDUAL", + }, + "RMS_NU_TILDE": { + "DESCRIPTION": "Root-mean square residual of nu tilde (SA " "model).", + "GROUP": "RMS_RES", + "HEADER": "rms[nu]", + "TYPE": "RESIDUAL", + }, + "RMS_PRESSURE": { + "DESCRIPTION": "Root-mean square residual of the pressure.", + "GROUP": "RMS_RES", + "HEADER": "rms[P]", + "TYPE": "RESIDUAL", + }, + "RMS_RTOL": { + "DESCRIPTION": "Norm of residual", + "GROUP": "RMS_RES", + "HEADER": "rms[R]", + "TYPE": "RESIDUAL", + }, + 'RMS_SPECIES_" + std::to_string(iVar': { + "DESCRIPTION": "Root-mean square " "residual of " "transported species.", + "GROUP": "RMS_RES", + "HEADER": 'rms[rho*Y_" + ' 'std::to_string(iVar)+"]', + "TYPE": "RESIDUAL", + }, + "RMS_TEMPERATURE": { + "DESCRIPTION": "Root mean square residual of the " "temperature", + "GROUP": "RMS_RES", + "HEADER": "rms[T]", + "TYPE": "RESIDUAL", + }, + "RMS_TKE": { + "DESCRIPTION": "Root-mean square residual of kinetic energy (SST " "model).", + "GROUP": "RMS_RES", + "HEADER": "rms[k]", + "TYPE": "RESIDUAL", + }, + "RMS_UTOL": { + "DESCRIPTION": "Norm of displacement increment", + "GROUP": "RMS_RES", + "HEADER": "rms[U]", + "TYPE": "RESIDUAL", + }, + "RMS_VELOCITY-X": { + "DESCRIPTION": "Root-mean square residual of the velocity " "x-component.", + "GROUP": "RMS_RES", + "HEADER": "rms[U]", + "TYPE": "RESIDUAL", + }, + "RMS_VELOCITY-Y": { + "DESCRIPTION": "Root-mean square residual of the velocity " "y-component.", + "GROUP": "RMS_RES", + "HEADER": "rms[V]", + "TYPE": "RESIDUAL", + }, + "SENS_AOA": { + "DESCRIPTION": "Sensitivity of the objective function with " + "respect to the angle of attack (only for " + "compressible solver).", + "GROUP": "SENSITIVITY", + "HEADER": "Sens_AoA", + "TYPE": "COEFFICIENT", + }, + "SENS_E_0": { + "DESCRIPTION": "d Objective / d Elasticity modulus", + "GROUP": "SENSITIVITY", + "HEADER": "Sens[E_0]", + "TYPE": "DEFAULT", + }, + "SENS_GEO": { + "DESCRIPTION": "Sum of the geometrical sensitivities on all " + "markers set in MARKER_MONITORING.", + "GROUP": "SENSITIVITY", + "HEADER": "Sens_Geo", + "TYPE": "COEFFICIENT", + }, + "SENS_MACH": { + "DESCRIPTION": "Sensitivity of the objective function with " + "respect to the Mach number (only of " + "compressible solver).", + "GROUP": "SENSITIVITY", + "HEADER": "Sens_Mach", + "TYPE": "COEFFICIENT", + }, + "SENS_NU_0": { + "DESCRIPTION": "d Objective / d Poisson ratio", + "GROUP": "SENSITIVITY", + "HEADER": "Sens[Nu_0]", + "TYPE": "DEFAULT", + }, + "SENS_PRESS": { + "DESCRIPTION": "Sensitivity of the objective function with " + "respect to the far-field pressure.", + "GROUP": "SENSITIVITY", + "HEADER": "Sens_Press", + "TYPE": "COEFFICIENT", + }, + "SENS_PRESS_OUT": { + "DESCRIPTION": "Sensitivity of the objective function with " + "respect to the outlet pressure.", + "GROUP": "SENSITIVITY", + "HEADER": "Sens_Pout", + "TYPE": "COEFFICIENT", + }, + "SENS_TEMP": { + "DESCRIPTION": "Sensitivity of the objective function with " + "respect to the far-field temperature.", + "GROUP": "SENSITIVITY", + "HEADER": "Sens_Temp", + "TYPE": "COEFFICIENT", + }, + "SENS_VEL_IN": { + "DESCRIPTION": "Sensitivity of the objective function with " + "respect to the inlet velocity.", + "GROUP": "SENSITIVITY", + "HEADER": "Sens_Vin", + "TYPE": "COEFFICIENT", + }, + "SIDEFORCE": { + "DESCRIPTION": "Total sideforce coefficient on all surfaces set " + "with MARKER_MONITORING", + "GROUP": "AERO_COEFF", + "HEADER": "CSF", + "TYPE": "COEFFICIENT", + }, + "STREAMWISE_DP": { + "DESCRIPTION": "Pressure drop in streamwise periodic flow", + "GROUP": "STREAMWISE_PERIODIC", + "HEADER": "SWDeltaP", + "TYPE": "DEFAULT", + }, + "STREAMWISE_HEAT": { + "DESCRIPTION": "Integrated heat for streamwise periodic " "flow", + "GROUP": "STREAMWISE_PERIODIC", + "HEADER": "SWHeat", + "TYPE": "DEFAULT", + }, + "STREAMWISE_MASSFLOW": { + "DESCRIPTION": "Massflow in streamwise periodic flow", + "GROUP": "STREAMWISE_PERIODIC", + "HEADER": "SWMassflow", + "TYPE": "DEFAULT", + }, + "STRESS_PENALTY": { + "DESCRIPTION": "Aggregate stress penalty", + "GROUP": "STRUCT_COEFF", + "HEADER": "StressPen", + "TYPE": "COEFFICIENT", + }, + "SURFACE_MACH": { + "DESCRIPTION": "Total average mach number on all markers set " + "in MARKER_ANALYZE", + "GROUP": "FLOW_COEFF", + "HEADER": "Avg_Mach", + "TYPE": "COEFFICIENT", + }, + "SURFACE_MASSFLOW": { + "DESCRIPTION": "Total average mass flow on all markers " + "set in MARKER_ANALYZE", + "GROUP": "FLOW_COEFF", + "HEADER": "Avg_Massflow", + "TYPE": "COEFFICIENT", + }, + "SURFACE_MOM_DISTORTION": { + "DESCRIPTION": "Total momentum distortion on all " + "markers set in MARKER_ANALYZE", + "GROUP": "FLOW_COEFF", + "HEADER": "Momentum_Distortion", + "TYPE": "COEFFICIENT", + }, + "SURFACE_PRESSURE_DROP": { + "DESCRIPTION": "Total pressure drop on all markers " "set in MARKER_ANALYZE", + "GROUP": "FLOW_COEFF", + "HEADER": "Pressure_Drop", + "TYPE": "COEFFICIENT", + }, + "SURFACE_SECONDARY": { + "DESCRIPTION": "Total secondary strength on all markers " + "set in MARKER_ANALYZE", + "GROUP": "FLOW_COEFF", + "HEADER": "Secondary_Strength", + "TYPE": "COEFFICIENT", + }, + "SURFACE_SECOND_OVER_UNIFORM": { + "DESCRIPTION": "Total secondary over " + "uniformity on all markers set " + "in MARKER_ANALYZE", + "GROUP": "FLOW_COEFF", + "HEADER": "Secondary_Over_Uniformity", + "TYPE": "COEFFICIENT", + }, + 'SURFACE_SPECIES_" + std::to_string(iVar': { + "DESCRIPTION": "Total average " + 'species " + ' + "std::to_string(iVar) " + '+ " on all ' + "markers set in " + "MARKER_ANALYZE", + "GROUP": "SPECIES_COEFF", + "HEADER": 'Avg_Species_" + ' "std::to_string(iVar", + "TYPE": "COEFFICIENT", + }, + "SURFACE_SPECIES_VARIANCE": { + "DESCRIPTION": "Total species variance", + "GROUP": "SPECIES_COEFF", + "HEADER": "Species_Variance", + "TYPE": "DEFAULT", + }, + "SURFACE_STATIC_PRESSURE": { + "DESCRIPTION": "Total average pressure on all " "markers set in MARKER_ANALYZE", + "GROUP": "FLOW_COEFF", + "HEADER": "Avg_Press", + "TYPE": "COEFFICIENT", + }, + "SURFACE_STATIC_TEMPERATURE": { + "DESCRIPTION": "Total average temperature on " + "all markers set in " + "MARKER_ANALYZE", + "GROUP": "FLOW_COEFF", + "HEADER": "Avg_Temp", + "TYPE": "COEFFICIENT", + }, + "SURFACE_TOTAL_PRESSURE": { + "DESCRIPTION": "Total average total pressure on " + "all markers set in MARKER_ANALYZE", + "GROUP": "FLOW_COEFF", + "HEADER": "Avg_TotalPress", + "TYPE": "COEFFICIENT", + }, + "SURFACE_TOTAL_TEMPERATURE": { + "DESCRIPTION": "Total average total temperature " + "all markers set in " + "MARKER_ANALYZE", + "GROUP": "FLOW_COEFF", + "HEADER": "Avg_TotalTemp", + "TYPE": "COEFFICIENT", + }, + "SURFACE_UNIFORMITY": { + "DESCRIPTION": "Total flow uniformity on all markers " "set in MARKER_ANALYZE", + "GROUP": "FLOW_COEFF", + "HEADER": "Uniformity", + "TYPE": "COEFFICIENT", + }, + "TAVG_ADJOINT_SOLEXTRA": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_ADJOINT_SOLEXTRA", + "HEADER": "tavg[Adjoint_SolExtra]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_AVG_DENSITY": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_FLOW_COEFF", + "HEADER": "tavg[Avg_Density]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_AVG_ENTHALPY": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_FLOW_COEFF", + "HEADER": "tavg[Avg_Enthalpy]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_AVG_NORMALVEL": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_FLOW_COEFF", + "HEADER": "tavg[Avg_NormalVel]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_AVG_TEMPERATURE": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_HEAT", + "HEADER": "tavg[AvgTemp]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_BUFFET": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_AERO_COEFF", + "HEADER": "tavg[Buffet]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_COMBO": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_COMBO", + "HEADER": "tavg[ComboObj]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_DELTA_CL": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_FIXED_CL", + "HEADER": "tavg[Delta_CL]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_DRAG": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_AERO_COEFF", + "HEADER": "tavg[CD]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_D_ADJOINT_SOLEXTRA": { + "DESCRIPTION": "weighted time average derivative " "value", + "GROUP": "TAVG_D_ADJOINT_SOLEXTRA", + "HEADER": "dtavg[Adjoint_SolExtra]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_AVG_DENSITY": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_FLOW_COEFF", + "HEADER": "dtavg[Avg_Density]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_AVG_ENTHALPY": { + "DESCRIPTION": "weighted time average derivative " "value", + "GROUP": "TAVG_D_FLOW_COEFF", + "HEADER": "dtavg[Avg_Enthalpy]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_AVG_NORMALVEL": { + "DESCRIPTION": "weighted time average derivative " "value", + "GROUP": "TAVG_D_FLOW_COEFF", + "HEADER": "dtavg[Avg_NormalVel]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_AVG_TEMPERATURE": { + "DESCRIPTION": "weighted time average derivative " "value", + "GROUP": "TAVG_D_HEAT", + "HEADER": "dtavg[AvgTemp]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_BUFFET": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_AERO_COEFF", + "HEADER": "dtavg[Buffet]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_COMBO": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_COMBO", + "HEADER": "dtavg[ComboObj]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_DELTA_CL": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_FIXED_CL", + "HEADER": "dtavg[Delta_CL]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_DRAG": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_AERO_COEFF", + "HEADER": "dtavg[CD]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_EFFICIENCY": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_AERO_COEFF", + "HEADER": "dtavg[CEff]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_EQUIVALENT_AREA": { + "DESCRIPTION": "weighted time average derivative " "value", + "GROUP": "TAVG_D_EQUIVALENT_AREA", + "HEADER": "dtavg[CEquiv_Area]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_FIGURE_OF_MERIT": { + "DESCRIPTION": "weighted time average derivative " "value", + "GROUP": "TAVG_D_ROTATING_FRAME", + "HEADER": "dtavg[CMerit]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_FORCE_X": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_AERO_COEFF", + "HEADER": "dtavg[CFx]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_FORCE_Y": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_AERO_COEFF", + "HEADER": "dtavg[CFy]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_FORCE_Z": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_AERO_COEFF", + "HEADER": "dtavg[CFz]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_INVERSE_DESIGN_PRESSURE": { + "DESCRIPTION": "weighted time average " "derivative value", + "GROUP": "TAVG_D_CP_DIFF", + "HEADER": "dtavg[Cp_Diff]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_LIFT": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_AERO_COEFF", + "HEADER": "dtavg[CL]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_MAXIMUM_HEATFLUX": { + "DESCRIPTION": "weighted time average derivative " "value", + "GROUP": "TAVG_D_HEAT", + "HEADER": "dtavg[MaxHF]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_MOMENT_X": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_AERO_COEFF", + "HEADER": "dtavg[CMx]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_MOMENT_Y": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_AERO_COEFF", + "HEADER": "dtavg[CMy]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_MOMENT_Z": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_AERO_COEFF", + "HEADER": "dtavg[CMz]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_REFERENCE_GEOMETRY": { + "DESCRIPTION": "weighted time average " "derivative value", + "GROUP": "TAVG_D_STRUCT_COEFF", + "HEADER": "dtavg[RefGeom]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_REFERENCE_NODE": { + "DESCRIPTION": "weighted time average derivative " "value", + "GROUP": "TAVG_D_STRUCT_COEFF", + "HEADER": "dtavg[RefNode]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_SENS_AOA": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_SENSITIVITY", + "HEADER": "dtavg[Sens_AoA]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_SENS_GEO": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_SENSITIVITY", + "HEADER": "dtavg[Sens_Geo]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_SENS_MACH": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_SENSITIVITY", + "HEADER": "dtavg[Sens_Mach]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_SENS_PRESS": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_SENSITIVITY", + "HEADER": "dtavg[Sens_Press]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_SENS_PRESS_OUT": { + "DESCRIPTION": "weighted time average derivative " "value", + "GROUP": "TAVG_D_SENSITIVITY", + "HEADER": "dtavg[Sens_Pout]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_SENS_TEMP": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_SENSITIVITY", + "HEADER": "dtavg[Sens_Temp]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_SENS_VEL_IN": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_SENSITIVITY", + "HEADER": "dtavg[Sens_Vin]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_SIDEFORCE": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_AERO_COEFF", + "HEADER": "dtavg[CSF]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_STRESS_PENALTY": { + "DESCRIPTION": "weighted time average derivative " "value", + "GROUP": "TAVG_D_STRUCT_COEFF", + "HEADER": "dtavg[StressPen]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_SURFACE_MACH": { + "DESCRIPTION": "weighted time average derivative " "value", + "GROUP": "TAVG_D_FLOW_COEFF", + "HEADER": "dtavg[Avg_Mach]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_SURFACE_MASSFLOW": { + "DESCRIPTION": "weighted time average derivative " "value", + "GROUP": "TAVG_D_FLOW_COEFF", + "HEADER": "dtavg[Avg_Massflow]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_SURFACE_MOM_DISTORTION": { + "DESCRIPTION": "weighted time average " "derivative value", + "GROUP": "TAVG_D_FLOW_COEFF", + "HEADER": "dtavg[Momentum_Distortion]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_SURFACE_PRESSURE_DROP": { + "DESCRIPTION": "weighted time average " "derivative value", + "GROUP": "TAVG_D_FLOW_COEFF", + "HEADER": "dtavg[Pressure_Drop]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_SURFACE_SECONDARY": { + "DESCRIPTION": "weighted time average derivative " "value", + "GROUP": "TAVG_D_FLOW_COEFF", + "HEADER": "dtavg[Secondary_Strength]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_SURFACE_SECOND_OVER_UNIFORM": { + "DESCRIPTION": "weighted time average " "derivative value", + "GROUP": "TAVG_D_FLOW_COEFF", + "HEADER": "dtavg[Secondary_Over_Uniformity]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + 'TAVG_D_SURFACE_SPECIES_" + std::to_string(iVar': { + "DESCRIPTION": "weighted " "time " "average " "derivative " "value", + "GROUP": "TAVG_D_SPECIES_COEFF", + "HEADER": 'dtavg[Avg_Species_" ' "+ " "std::to_string(iVar]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_SURFACE_STATIC_PRESSURE": { + "DESCRIPTION": "weighted time average " "derivative value", + "GROUP": "TAVG_D_FLOW_COEFF", + "HEADER": "dtavg[Avg_Press]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_SURFACE_STATIC_TEMPERATURE": { + "DESCRIPTION": "weighted time average " "derivative value", + "GROUP": "TAVG_D_FLOW_COEFF", + "HEADER": "dtavg[Avg_Temp]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_SURFACE_TOTAL_PRESSURE": { + "DESCRIPTION": "weighted time average " "derivative value", + "GROUP": "TAVG_D_FLOW_COEFF", + "HEADER": "dtavg[Avg_TotalPress]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_SURFACE_TOTAL_TEMPERATURE": { + "DESCRIPTION": "weighted time average " "derivative value", + "GROUP": "TAVG_D_FLOW_COEFF", + "HEADER": "dtavg[Avg_TotalTemp]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_SURFACE_UNIFORMITY": { + "DESCRIPTION": "weighted time average " "derivative value", + "GROUP": "TAVG_D_FLOW_COEFF", + "HEADER": "dtavg[Uniformity]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_THRUST": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_ROTATING_FRAME", + "HEADER": "dtavg[CT]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_TOPOL_COMPLIANCE": { + "DESCRIPTION": "weighted time average derivative " "value", + "GROUP": "TAVG_D_STRUCT_COEFF", + "HEADER": "dtavg[TopComp]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_TOPOL_DISCRETENESS": { + "DESCRIPTION": "weighted time average " "derivative value", + "GROUP": "TAVG_D_STRUCT_COEFF", + "HEADER": "dtavg[TopDisc]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_TORQUE": { + "DESCRIPTION": "weighted time average derivative value", + "GROUP": "TAVG_D_ROTATING_FRAME", + "HEADER": "dtavg[CQ]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_TOTAL_HEATFLUX": { + "DESCRIPTION": "weighted time average derivative " "value", + "GROUP": "TAVG_D_HEAT", + "HEADER": "dtavg[HF]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_D_VOLUME_FRACTION": { + "DESCRIPTION": "weighted time average derivative " "value", + "GROUP": "TAVG_D_STRUCT_COEFF", + "HEADER": "dtavg[VolFrac]", + "TYPE": "TAVG_D_COEFFICIENT", + }, + "TAVG_EFFICIENCY": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_AERO_COEFF", + "HEADER": "tavg[CEff]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_EQUIVALENT_AREA": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_EQUIVALENT_AREA", + "HEADER": "tavg[CEquiv_Area]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_FIGURE_OF_MERIT": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_ROTATING_FRAME", + "HEADER": "tavg[CMerit]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_FORCE_X": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_AERO_COEFF", + "HEADER": "tavg[CFx]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_FORCE_Y": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_AERO_COEFF", + "HEADER": "tavg[CFy]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_FORCE_Z": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_AERO_COEFF", + "HEADER": "tavg[CFz]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_INVERSE_DESIGN_PRESSURE": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_CP_DIFF", + "HEADER": "tavg[Cp_Diff]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_LIFT": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_AERO_COEFF", + "HEADER": "tavg[CL]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_MAXIMUM_HEATFLUX": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_HEAT", + "HEADER": "tavg[MaxHF]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_MOMENT_X": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_AERO_COEFF", + "HEADER": "tavg[CMx]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_MOMENT_Y": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_AERO_COEFF", + "HEADER": "tavg[CMy]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_MOMENT_Z": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_AERO_COEFF", + "HEADER": "tavg[CMz]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_REFERENCE_GEOMETRY": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_STRUCT_COEFF", + "HEADER": "tavg[RefGeom]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_REFERENCE_NODE": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_STRUCT_COEFF", + "HEADER": "tavg[RefNode]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_SENS_AOA": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_SENSITIVITY", + "HEADER": "tavg[Sens_AoA]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_SENS_GEO": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_SENSITIVITY", + "HEADER": "tavg[Sens_Geo]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_SENS_MACH": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_SENSITIVITY", + "HEADER": "tavg[Sens_Mach]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_SENS_PRESS": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_SENSITIVITY", + "HEADER": "tavg[Sens_Press]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_SENS_PRESS_OUT": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_SENSITIVITY", + "HEADER": "tavg[Sens_Pout]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_SENS_TEMP": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_SENSITIVITY", + "HEADER": "tavg[Sens_Temp]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_SENS_VEL_IN": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_SENSITIVITY", + "HEADER": "tavg[Sens_Vin]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_SIDEFORCE": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_AERO_COEFF", + "HEADER": "tavg[CSF]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_STRESS_PENALTY": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_STRUCT_COEFF", + "HEADER": "tavg[StressPen]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_SURFACE_MACH": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_FLOW_COEFF", + "HEADER": "tavg[Avg_Mach]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_SURFACE_MASSFLOW": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_FLOW_COEFF", + "HEADER": "tavg[Avg_Massflow]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_SURFACE_MOM_DISTORTION": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_FLOW_COEFF", + "HEADER": "tavg[Momentum_Distortion]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_SURFACE_PRESSURE_DROP": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_FLOW_COEFF", + "HEADER": "tavg[Pressure_Drop]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_SURFACE_SECONDARY": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_FLOW_COEFF", + "HEADER": "tavg[Secondary_Strength]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_SURFACE_SECOND_OVER_UNIFORM": { + "DESCRIPTION": "weighted time average " "value", + "GROUP": "TAVG_FLOW_COEFF", + "HEADER": "tavg[Secondary_Over_Uniformity]", + "TYPE": "TAVG_COEFFICIENT", + }, + 'TAVG_SURFACE_SPECIES_" + std::to_string(iVar': { + "DESCRIPTION": "weighted " "time average " "value", + "GROUP": "TAVG_SPECIES_COEFF", + "HEADER": 'tavg[Avg_Species_" ' "+ " "std::to_string(iVar]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_SURFACE_STATIC_PRESSURE": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_FLOW_COEFF", + "HEADER": "tavg[Avg_Press]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_SURFACE_STATIC_TEMPERATURE": { + "DESCRIPTION": "weighted time average " "value", + "GROUP": "TAVG_FLOW_COEFF", + "HEADER": "tavg[Avg_Temp]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_SURFACE_TOTAL_PRESSURE": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_FLOW_COEFF", + "HEADER": "tavg[Avg_TotalPress]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_SURFACE_TOTAL_TEMPERATURE": { + "DESCRIPTION": "weighted time average " "value", + "GROUP": "TAVG_FLOW_COEFF", + "HEADER": "tavg[Avg_TotalTemp]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_SURFACE_UNIFORMITY": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_FLOW_COEFF", + "HEADER": "tavg[Uniformity]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_THRUST": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_ROTATING_FRAME", + "HEADER": "tavg[CT]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_TOPOL_COMPLIANCE": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_STRUCT_COEFF", + "HEADER": "tavg[TopComp]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_TOPOL_DISCRETENESS": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_STRUCT_COEFF", + "HEADER": "tavg[TopDisc]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_TORQUE": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_ROTATING_FRAME", + "HEADER": "tavg[CQ]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_TOTAL_HEATFLUX": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_HEAT", + "HEADER": "tavg[HF]", + "TYPE": "TAVG_COEFFICIENT", + }, + "TAVG_VOLUME_FRACTION": { + "DESCRIPTION": "weighted time average value", + "GROUP": "TAVG_STRUCT_COEFF", + "HEADER": "tavg[VolFrac]", + "TYPE": "TAVG_COEFFICIENT", + }, + "THRUST": { + "DESCRIPTION": "Thrust coefficient", + "GROUP": "ROTATING_FRAME", + "HEADER": "CT", + "TYPE": "COEFFICIENT", + }, + "TOPOL_COMPLIANCE": { + "DESCRIPTION": "Structural compliance", + "GROUP": "STRUCT_COEFF", + "HEADER": "TopComp", + "TYPE": "COEFFICIENT", + }, + "TOPOL_DISCRETENESS": { + "DESCRIPTION": "Discreteness of the material " "distribution", + "GROUP": "STRUCT_COEFF", + "HEADER": "TopDisc", + "TYPE": "COEFFICIENT", + }, + "TORQUE": { + "DESCRIPTION": "Torque coefficient", + "GROUP": "ROTATING_FRAME", + "HEADER": "CQ", + "TYPE": "COEFFICIENT", + }, + "TOTAL_HEATFLUX": { + "DESCRIPTION": "Total heatflux on all surfaces defined in " "MARKER_MONITORING", + "GROUP": "HEAT", + "HEADER": "HF", + "TYPE": "COEFFICIENT", + }, + "VMS": { + "DESCRIPTION": "VMS", + "GROUP": "Maximum Von-Misses stress", + "HEADER": "VonMises", + "TYPE": "DEFAULT", + }, + "VOLUME_FRACTION": { + "DESCRIPTION": "Fraction of solid material", + "GROUP": "STRUCT_COEFF", + "HEADER": "VolFrac", + "TYPE": "COEFFICIENT", + }, +} diff --git a/SU2_PY/SU2/io/redirect.py b/SU2_PY/SU2/io/redirect.py index 9f2d4e4f4ac..4cf248c7145 100644 --- a/SU2_PY/SU2/io/redirect.py +++ b/SU2_PY/SU2/io/redirect.py @@ -3,7 +3,7 @@ ## \file redirect.py # \brief python package for file redirection # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -37,34 +37,35 @@ # ------------------------------------------------------------------- # original source: http://stackoverflow.com/questions/6796492/python-temporarily-redirect-stdout-stderr class output(object): - ''' with SU2.io.redirect_output(stdout,stderr) + """with SU2.io.redirect_output(stdout,stderr) - Temporarily redirects sys.stdout and sys.stderr when used in - a 'with' contextmanager + Temporarily redirects sys.stdout and sys.stderr when used in + a 'with' contextmanager - Example: - with SU2.io.redirect_output('stdout.txt','stderr.txt'): - sys.stdout.write("standard out") - sys.stderr.write("stanrard error") - # code - #: with output redirection + Example: + with SU2.io.redirect_output('stdout.txt','stderr.txt'): + sys.stdout.write("standard out") + sys.stderr.write("stanrard error") + # code + #: with output redirection - Inputs: - stdout - None, a filename, or a file stream - stderr - None, a filename, or a file stream - None will not redirect outptu + Inputs: + stdout - None, a filename, or a file stream + stderr - None, a filename, or a file stream + None will not redirect outptu + + """ - ''' def __init__(self, stdout=None, stderr=None): _newout = False _newerr = False - if isinstance(stdout,str): - stdout = open(stdout,'a') + if isinstance(stdout, str): + stdout = open(stdout, "a") _newout = True - if isinstance(stderr,str): - stderr = open(stderr,'a') + if isinstance(stderr, str): + stderr = open(stderr, "a") _newerr = True self._stdout = stdout or sys.stdout @@ -74,11 +75,13 @@ def __init__(self, stdout=None, stderr=None): def __enter__(self): self.old_stdout, self.old_stderr = sys.stdout, sys.stderr - self.old_stdout.flush(); self.old_stderr.flush() + self.old_stdout.flush() + self.old_stderr.flush() sys.stdout, sys.stderr = self._stdout, self._stderr def __exit__(self, exc_type, exc_value, traceback): - self._stdout.flush(); self._stderr.flush() + self._stdout.flush() + self._stderr.flush() sys.stdout = self.old_stdout sys.stderr = self.old_stderr @@ -87,6 +90,7 @@ def __exit__(self, exc_type, exc_value, traceback): if self._newerr: self._stderr.close() + #: class output() @@ -94,83 +98,87 @@ def __exit__(self, exc_type, exc_value, traceback): # Folder Redirection # ------------------------------------------------------------------- class folder(object): - ''' with SU2.io.redirect_folder(folder,pull,link,force) as push - - Temporarily redirects to a working folder, pulling - and pushing needed files + """with SU2.io.redirect_folder(folder,pull,link,force) as push - Example: + Temporarily redirects to a working folder, pulling + and pushing needed files - folder = 'temp' - pull = ['file1.txt','file2.txt'] - link = ['file3.big'] - force = True + Example: - # original path - import os - print(os.getcwd()) + folder = 'temp' + pull = ['file1.txt','file2.txt'] + link = ['file3.big'] + force = True - # enter folder - with SU2.io.redirect_folder(folder,pull,link,force) as push: - print(os.getcwd()) - # code - push.append('file4.txt') - #: with folder redirection + # original path + import os + print(os.getcwd()) - # returned to original path + # enter folder + with SU2.io.redirect_folder(folder,pull,link,force) as push: print(os.getcwd()) - - Inputs: - folder - working folder, relative or absolute - pull - list of files to pull (copy to working folder) - link - list of files to link (symbolic link in working folder) - force - True/False overwrite existing files in working folder - - Targets: - push - list of files to push (copy to originating path) - - Notes: - push must be appended or extended, not overwritten - links in Windows not supported, will simply copy - ''' - - def __init__(self, folder, pull=None, link=None, force=True ): - ''' folder redirection initialization - see help( folder ) for more info - ''' - - if pull is None: pull = [] - if link is None: link = [] - - if not isinstance(pull,list) : pull = [pull] - if not isinstance(link,list) : link = [link] + # code + push.append('file4.txt') + #: with folder redirection + + # returned to original path + print(os.getcwd()) + + Inputs: + folder - working folder, relative or absolute + pull - list of files to pull (copy to working folder) + link - list of files to link (symbolic link in working folder) + force - True/False overwrite existing files in working folder + + Targets: + push - list of files to push (copy to originating path) + + Notes: + push must be appended or extended, not overwritten + links in Windows not supported, will simply copy + """ + + def __init__(self, folder, pull=None, link=None, force=True): + """folder redirection initialization + see help( folder ) for more info + """ + + if pull is None: + pull = [] + if link is None: + link = [] + + if not isinstance(pull, list): + pull = [pull] + if not isinstance(link, list): + link = [link] origin = os.getcwd() - origin = os.path.abspath(origin).rstrip('/')+'/' - folder = os.path.abspath(folder).rstrip('/')+'/' + origin = os.path.abspath(origin).rstrip("/") + "/" + folder = os.path.abspath(folder).rstrip("/") + "/" self.origin = origin self.folder = folder - self.pull = copy.deepcopy(pull) - self.push = [] - self.link = copy.deepcopy(link) - self.force = force + self.pull = copy.deepcopy(pull) + self.push = [] + self.link = copy.deepcopy(link) + self.force = force def __enter__(self): origin = self.origin # absolute path folder = self.folder # absolute path - pull = self.pull - push = self.push - link = self.link - force = self.force + pull = self.pull + push = self.push + link = self.link + force = self.force # check for no folder change if folder == origin: return [] # relative folder path - #relative = os.path.relpath(folder,origin) + # relative = os.path.relpath(folder,origin) # check, make folder if not os.path.exists(folder): @@ -180,23 +188,29 @@ def __enter__(self): for name in pull: old_name = os.path.abspath(name) new_name = os.path.split(name)[-1] - new_name = os.path.join(folder,new_name) - if old_name == new_name: continue - if os.path.exists( new_name ): - if force: os.remove( new_name ) - else: continue - shutil.copy(old_name,new_name) + new_name = os.path.join(folder, new_name) + if old_name == new_name: + continue + if os.path.exists(new_name): + if force: + os.remove(new_name) + else: + continue + shutil.copy(old_name, new_name) # make links for name in link: old_name = os.path.abspath(name) new_name = os.path.split(name)[-1] - new_name = os.path.join(folder,new_name) - if old_name == new_name: continue - if os.path.exists( new_name ): - if force: os.remove( new_name ) - else: continue - make_link(old_name,new_name) + new_name = os.path.join(folder, new_name) + if old_name == new_name: + continue + if os.path.exists(new_name): + if force: + os.remove(new_name) + else: + continue + make_link(old_name, new_name) # change directory os.chdir(folder) @@ -208,8 +222,8 @@ def __exit__(self, exc_type, exc_value, traceback): origin = self.origin folder = self.folder - push = self.push - force = self.force + push = self.push + force = self.force # check for no folder change if folder == origin: @@ -220,26 +234,33 @@ def __exit__(self, exc_type, exc_value, traceback): old_name = os.path.abspath(name) name = os.path.split(name)[-1] - new_name = os.path.join(origin,name) + new_name = os.path.join(origin, name) # links if os.path.islink(old_name): source = os.path.realpath(old_name) - if source == new_name: continue - if os.path.exists( new_name ): - if force: os.remove( new_name ) - else: continue - make_link(source,new_name) + if source == new_name: + continue + if os.path.exists(new_name): + if force: + os.remove(new_name) + else: + continue + make_link(source, new_name) # moves else: - if old_name == new_name: continue - if os.path.exists( new_name ): - if force: os.remove( new_name ) - else: continue - shutil.move(old_name,new_name) + if old_name == new_name: + continue + if os.path.exists(new_name): + if force: + os.remove(new_name) + else: + continue + shutil.move(old_name, new_name) # change directory os.chdir(origin) + #: class folder() diff --git a/SU2_PY/SU2/io/state.py b/SU2_PY/SU2/io/state.py index 5350df9fdbc..584f4ab1f28 100644 --- a/SU2_PY/SU2/io/state.py +++ b/SU2_PY/SU2/io/state.py @@ -3,7 +3,7 @@ ## \file state.py # \brief python package for state # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -30,8 +30,17 @@ # ---------------------------------------------------------------------- import os, sys, shutil, copy, time -from ..io import expand_part, expand_zones, expand_time, get_adjointSuffix, add_suffix, \ - get_specialCases, Config, expand_multipoint, optnames_multi +from ..io import ( + expand_part, + expand_zones, + expand_time, + get_adjointSuffix, + add_suffix, + get_specialCases, + Config, + expand_multipoint, + optnames_multi, +) from ..util import bunch from ..util import ordered_bunch @@ -40,82 +49,92 @@ # State Factory # ---------------------------------------------------------------------- -def State_Factory(state=None,config=None): - """ state = SU2.io.State() - - Starts a state class, an extension of ordered_bunch(). - Stores data generated while traversing SU2 tool chain - - Fields: - FUNCTIONS - ordered bunch of objective function values - GRADIENTS - ordered bunch of gradient value lists - VARIABLES - ordered bunch of variables - FILES - ordered bunch of file types - HISTORY - ordered bunch of history information - - Fields can be accessed by item or attribute - ie: state['FUNCTIONS'] or state.FUNCTIONS - - Methods: - update() - updates self with another state - pullnlink() - returns files to pull and link - design_vector() - vectorizes design variables - find_files() - finds existing mesh and solutions - - Example of a filled state: - FUNCTIONS: - LIFT: 0.2353065809 - DRAG: 0.042149736 - SIDEFORCE: 0.0 - MOMENT_X: 0.0 - MOMENT_Y: 0.0 - MOMENT_Z: 0.046370243 - FORCE_X: 0.0370065195 - FORCE_Y: 0.2361700759 - FORCE_Z: 0.0 - EFFICIENCY: 5.5826347517 - GRADIENTS: - DRAG: [0.133697, 0.41473, 0.698497, (...) - VARIABLES: - DV_VALUE_NEW: [0.002, 0.002, 0.002, (...) - FILES: - MESH: mesh.su2 - DIRECT: solution_flow.dat - ADJOINT_DRAG: solution_adj_cd.dat - FLOW_META: flow.meta - MULTIPOINT_DIRECT: [solution_flow_point0.dat solution_flow_point1.dat, ...] - MULTIPOINT_ADJOINT_DRAG: [solution_adj_point0_cd.dat solution_adj_point1_cd.dat, ...] - MULTIPOINT_MESH_FILENAME: [mesh_0.su2, mesh_1.su2, ... ] - MULTIPOINT_FLOW_META: [flow_point0.meta, flow_point1.meta, ...] - HISTORY: - DIRECT: {ITERATION=[1.0, 2.0, 3.0, (...) - ADJOINT_DRAG: {ITERATION=[1.0, 2.0, 3.0, (...) - WND_CAUCHY_DATA: - TIME_ITER - UNST_ADJOINT_ITER - ITER_AVERAGE_OBJ + +def State_Factory(state=None, config=None): + """state = SU2.io.State() + + Starts a state class, an extension of ordered_bunch(). + Stores data generated while traversing SU2 tool chain + + Fields: + FUNCTIONS - ordered bunch of objective function values + GRADIENTS - ordered bunch of gradient value lists + VARIABLES - ordered bunch of variables + FILES - ordered bunch of file types + HISTORY - ordered bunch of history information + + Fields can be accessed by item or attribute + ie: state['FUNCTIONS'] or state.FUNCTIONS + + Methods: + update() - updates self with another state + pullnlink() - returns files to pull and link + design_vector() - vectorizes design variables + find_files() - finds existing mesh and solutions + + Example of a filled state: + FUNCTIONS: + LIFT: 0.2353065809 + DRAG: 0.042149736 + SIDEFORCE: 0.0 + MOMENT_X: 0.0 + MOMENT_Y: 0.0 + MOMENT_Z: 0.046370243 + FORCE_X: 0.0370065195 + FORCE_Y: 0.2361700759 + FORCE_Z: 0.0 + EFFICIENCY: 5.5826347517 + GRADIENTS: + DRAG: [0.133697, 0.41473, 0.698497, (...) + VARIABLES: + DV_VALUE_NEW: [0.002, 0.002, 0.002, (...) + FILES: + MESH: mesh.su2 + DIRECT: solution_flow.dat + ADJOINT_DRAG: solution_adj_cd.dat + FLOW_META: flow.meta + MULTIPOINT_DIRECT: [solution_flow_point0.dat solution_flow_point1.dat, ...] + MULTIPOINT_ADJOINT_DRAG: [solution_adj_point0_cd.dat solution_adj_point1_cd.dat, ...] + MULTIPOINT_MESH_FILENAME: [mesh_0.su2, mesh_1.su2, ... ] + MULTIPOINT_FLOW_META: [flow_point0.meta, flow_point1.meta, ...] + HISTORY: + DIRECT: {ITERATION=[1.0, 2.0, 3.0, (...) + ADJOINT_DRAG: {ITERATION=[1.0, 2.0, 3.0, (...) + WND_CAUCHY_DATA: + TIME_ITER + UNST_ADJOINT_ITER + ITER_AVERAGE_OBJ """ - if isinstance(state,Config) and not config: + if isinstance(state, Config) and not config: config = state state = None if not state is None: - assert isinstance(state,State) , 'input is must be a state instance' + assert isinstance(state, State), "input is must be a state instance" return state NewClass = State() - for key in ['FUNCTIONS','GRADIENTS','VARIABLES','FILES','HISTORY','WND_CAUCHY_DATA']: + for key in [ + "FUNCTIONS", + "GRADIENTS", + "VARIABLES", + "FILES", + "HISTORY", + "WND_CAUCHY_DATA", + ]: NewClass[key] = ordered_bunch() if config: NewClass.find_files(config) # WND_Convergence Data - NewClass['WND_CAUCHY_DATA'] = {'TIME_ITER': config['TIME_ITER'], - 'UNST_ADJOINT_ITER': config['UNST_ADJOINT_ITER'], - 'ITER_AVERAGE_OBJ': config['ITER_AVERAGE_OBJ']} + NewClass["WND_CAUCHY_DATA"] = { + "TIME_ITER": config["TIME_ITER"], + "UNST_ADJOINT_ITER": config["UNST_ADJOINT_ITER"], + "ITER_AVERAGE_OBJ": config["ITER_AVERAGE_OBJ"], + } return NewClass @@ -124,155 +143,157 @@ def State_Factory(state=None,config=None): # State Class # ---------------------------------------------------------------------- + class State(ordered_bunch): - """ state = SU2.io.state.State() + """state = SU2.io.state.State() - This is the State class that should be generated with the - Factory Function SU2.io.state.State_Factory() + This is the State class that should be generated with the + Factory Function SU2.io.state.State_Factory() - Parameters: - none, should be loaded with State_Factory() + Parameters: + none, should be loaded with State_Factory() - Methods: - update() - updates self with another state - pullnlink() - returns files to pull and link - design_vector() - vectorizes design variables - find_files() - finds existing mesh and solutions + Methods: + update() - updates self with another state + pullnlink() - returns files to pull and link + design_vector() - vectorizes design variables + find_files() - finds existing mesh and solutions """ _timestamp = 0 - def update(self,ztate): - """ Updates self given another state - """ + def update(self, ztate): + """Updates self given another state""" - if not ztate: return - assert isinstance(ztate,State) , 'must update with another State-type' + if not ztate: + return + assert isinstance(ztate, State), "must update with another State-type" for key in self.keys(): - if isinstance(ztate[key],dict): - self[key].update( ztate[key] ) + if isinstance(ztate[key], dict): + self[key].update(ztate[key]) elif ztate[key]: self[key] = ztate[key] self.set_timestamp() - def __repr__(self): return self.__str__() def __str__(self): - output = 'STATE:' + output = "STATE:" for k1, v1 in self.items(): - output += '\n %s:' % k1 - if isinstance(v1,dict): + output += "\n %s:" % k1 + if isinstance(v1, dict): for k2, v2 in v1.items(): - output += '\n %s: %s' % (k2,v2) + output += "\n %s: %s" % (k2, v2) else: - output += '\n %s' % v1 + output += "\n %s" % v1 return output - def pullnlink(self,config): - """ pull,link = SU2.io.State.pullnlink(config) - returns lists pull and link of files for folder - redirection, based on a given config + def pullnlink(self, config): + """pull,link = SU2.io.State.pullnlink(config) + returns lists pull and link of files for folder + redirection, based on a given config """ - pull = []; link = [] + pull = [] + link = [] # choose files to pull and link for key, value in self.FILES.items(): # link big files - if key == 'MESH': + if key == "MESH": # mesh (merged or partitioned) - value = expand_part(value,config) + value = expand_part(value, config) link.extend(value) - elif key == 'DIRECT': + elif key == "DIRECT": # direct solution - value = expand_zones(value,config) - value = expand_time(value,config) + value = expand_zones(value, config) + value = expand_time(value, config) link.extend(value) - elif 'ADJOINT_' in key and (not 'MULTIPOINT' in key): + elif "ADJOINT_" in key and (not "MULTIPOINT" in key): # adjoint solution - value = expand_zones(value,config) - value = expand_time(value,config) + value = expand_zones(value, config) + value = expand_time(value, config) link.extend(value) - elif 'MULTIPOINT' in key: + elif "MULTIPOINT" in key: # multipoint files - if key != 'MULTIPOINT_MESH_FILENAME': + if key != "MULTIPOINT_MESH_FILENAME": # DIRECT and ADJOINT files - value = expand_zones(value,config) - value = expand_time(value,config) + value = expand_zones(value, config) + value = expand_time(value, config) for elem in value: if elem: link.append(elem) - #elif key == 'STABILITY': - #pass + # elif key == 'STABILITY': + # pass # copy all other files else: pull.append(value) #: for each filename - return pull,link + return pull, link def design_vector(self): - """ vectorizes State.VARIABLES - """ + """vectorizes State.VARIABLES""" vector = [] for value in self.VARIABLES.values(): - if isinstance(value,dict): + if isinstance(value, dict): for v in value.values(): vector.append(v) - elif not isinstance(value,list): + elif not isinstance(value, list): value = [value] vector.extend(value) return vector - def find_files(self,config): - """ SU2.io.State.find_files(config) - finds mesh and solution files for a given config. - updates state.FILES with filenames. - files already logged in state are not overridden. - will ignore solutions if config.RESTART_SOL == 'NO'. + def find_files(self, config): + """SU2.io.State.find_files(config) + finds mesh and solution files for a given config. + updates state.FILES with filenames. + files already logged in state are not overridden. + will ignore solutions if config.RESTART_SOL == 'NO'. """ files = self.FILES - mesh_name = config.MESH_FILENAME - if config.get('READ_BINARY_RESTART', 'YES') == 'NO': - if not 'RESTART_ASCII' in config.get('OUTPUT_FILES',['RESTART']): - print ('RESTART_ASCII must be in OUTPUT_FILES if READ_BINARY_RESTART is set to NO') + mesh_name = config.MESH_FILENAME + if config.get("READ_BINARY_RESTART", "YES") == "NO": + if not "RESTART_ASCII" in config.get("OUTPUT_FILES", ["RESTART"]): + print( + "RESTART_ASCII must be in OUTPUT_FILES if READ_BINARY_RESTART is set to NO" + ) sys.exit() - direct_name = config.SOLUTION_FILENAME - adjoint_name = config.SOLUTION_ADJ_FILENAME + direct_name = config.SOLUTION_FILENAME + adjoint_name = config.SOLUTION_ADJ_FILENAME - if 'RESTART_ASCII' in config.get('OUTPUT_FILES', ['RESTART']): - direct_name = direct_name.split('.')[0] + '.csv' - adjoint_name = adjoint_name.split('.')[0] + '.csv' + if "RESTART_ASCII" in config.get("OUTPUT_FILES", ["RESTART"]): + direct_name = direct_name.split(".")[0] + ".csv" + adjoint_name = adjoint_name.split(".")[0] + ".csv" else: - direct_name = direct_name.split('.')[0] + '.dat' - adjoint_name = adjoint_name.split('.')[0] + '.dat' + direct_name = direct_name.split(".")[0] + ".dat" + adjoint_name = adjoint_name.split(".")[0] + ".dat" - targetea_name = 'TargetEA.dat' - targetcp_name = 'TargetCp.dat' - targetheatflux_name = 'TargetHeatFlux.dat' + targetea_name = "TargetEA.dat" + targetcp_name = "TargetCp.dat" + targetheatflux_name = "TargetHeatFlux.dat" adj_map = get_adjointSuffix() - restart = config.RESTART_SOL == 'YES' + restart = config.RESTART_SOL == "YES" special_cases = get_specialCases(config) - if config.get('OPT_OBJECTIVE'): - def_objs = config['OPT_OBJECTIVE'] + if config.get("OPT_OBJECTIVE"): + def_objs = config["OPT_OBJECTIVE"] objectives = def_objs.keys() multipoint = any(elem in optnames_multi for elem in objectives) else: multipoint = False - def register_file(label,filename): + def register_file(label, filename): if not label in files: - if label.split('_')[0] in ['DIRECT', 'ADJOINT']: + if label.split("_")[0] in ["DIRECT", "ADJOINT"]: names = expand_zones(filename, config) found = False for name in names: @@ -284,107 +305,121 @@ def register_file(label,filename): if found: files[label] = filename - print('Found: %s' % filename) + print("Found: %s" % filename) - elif label.split('_')[0] in ['MULTIPOINT']: + elif label.split("_")[0] in ["MULTIPOINT"]: # if multipoint, list of files needs to be added - file_list= []; + file_list = [] for name in filename: if os.path.exists(name): file_list.append(name) - print('Found: %s' % name) + print("Found: %s" % name) else: # if file doesn't exist, enter empty string as placeholder - file_list.append('') - # If even one of the multipoint files is found, add the list + file_list.append("") + # If even one of the multipoint files is found, add the list if any(file for file in file_list): files[label] = file_list else: if os.path.exists(filename): files[label] = filename - print('Found: %s' % filename) + print("Found: %s" % filename) else: - if label.split("_")[0] in ['DIRECT', 'ADJOINT']: + if label.split("_")[0] in ["DIRECT", "ADJOINT"]: for name in expand_zones(files[label], config): - assert os.path.exists(name), 'state expected file: %s' % filename - elif label.split('_')[0] in ['MULTIPOINT']: + assert os.path.exists(name), ( + "state expected file: %s" % filename + ) + elif label.split("_")[0] in ["MULTIPOINT"]: for name in expand_zones(files[label], config): if name: if not os.path.exists(name): - raise AssertionError('state expected file: %s' % name) + raise AssertionError("state expected file: %s" % name) else: - assert os.path.exists(files[label]) , 'state expected file: %s' % filename + assert os.path.exists(files[label]), ( + "state expected file: %s" % filename + ) + #: register_file() # mesh if multipoint: - mesh_list = [elem.strip() for elem in config['MULTIPOINT_MESH_FILENAME'].replace("(", "").replace(")", "").split(',')] + mesh_list = [ + elem.strip() + for elem in config["MULTIPOINT_MESH_FILENAME"] + .replace("(", "") + .replace(")", "") + .split(",") + ] if len(set(mesh_list)) > 1: # Only register MULTIPOINT_MESH_FILENAME if multiple meshes are specified - register_file('MULTIPOINT_MESH_FILENAME', mesh_list) + register_file("MULTIPOINT_MESH_FILENAME", mesh_list) mesh_name = mesh_list[0] - register_file('MESH',mesh_name) + register_file("MESH", mesh_name) # old style restart - if not 'RESTART_FILE_1' in files.keys(): + if not "RESTART_FILE_1" in files.keys(): # direct solutions if restart: - register_file('DIRECT',direct_name) + register_file("DIRECT", direct_name) if multipoint: - name_list = expand_multipoint(direct_name,config) - name_list = expand_zones(name_list,config) - register_file('MULTIPOINT_DIRECT',name_list) + name_list = expand_multipoint(direct_name, config) + name_list = expand_zones(name_list, config) + register_file("MULTIPOINT_DIRECT", name_list) # flow meta data file if restart: - register_file('FLOW_META','flow.meta') + register_file("FLOW_META", "flow.meta") if multipoint: - name_list = expand_multipoint('flow.meta',config) - register_file('MULTIPOINT_FLOW_META',name_list) + name_list = expand_multipoint("flow.meta", config) + register_file("MULTIPOINT_FLOW_META", name_list) # adjoint solutions if restart: for obj, suff in adj_map.items(): - ADJ_LABEL = 'ADJOINT_' + obj - adjoint_name_suffixed = add_suffix(adjoint_name,suff) - register_file(ADJ_LABEL,adjoint_name_suffixed) + ADJ_LABEL = "ADJOINT_" + obj + adjoint_name_suffixed = add_suffix(adjoint_name, suff) + register_file(ADJ_LABEL, adjoint_name_suffixed) if multipoint: - name_list = expand_zones(add_suffix(expand_multipoint(adjoint_name,config), suff), config) - multipoint_adj_name = 'MULTIPOINT_' + ADJ_LABEL + name_list = expand_zones( + add_suffix(expand_multipoint(adjoint_name, config), suff), + config, + ) + multipoint_adj_name = "MULTIPOINT_" + ADJ_LABEL register_file(multipoint_adj_name, name_list) # equivalent area - if 'EQUIV_AREA' in special_cases: - register_file('TARGET_EA',targetea_name) + if "EQUIV_AREA" in special_cases: + register_file("TARGET_EA", targetea_name) # pressure inverse design - if 'INV_DESIGN_CP' in special_cases: - register_file('TARGET_CP',targetcp_name) + if "INV_DESIGN_CP" in special_cases: + register_file("TARGET_CP", targetcp_name) # heat flux inverse design - if 'INV_DESIGN_HEATFLUX' in special_cases: - register_file('TARGET_HEATFLUX',targetheatflux_name) + if "INV_DESIGN_HEATFLUX" in special_cases: + register_file("TARGET_HEATFLUX", targetheatflux_name) return - def __setitem__(self,k,v): + def __setitem__(self, k, v): if self._initialized: self.set_timestamp() - super(State,self).__setitem__(k,v) + super(State, self).__setitem__(k, v) def set_timestamp(self): self._timestamp = time.time() def tic(self): - """ timestamp = State.tic() - returns the time that this state was last modified + """timestamp = State.tic() + returns the time that this state was last modified """ return self._timestamp - def toc(self,timestamp): - """ updated = State.toc(timestamp) - returns True if state was modified since last timestamp + def toc(self, timestamp): + """updated = State.toc(timestamp) + returns True if state was modified since last timestamp """ return self._timestamp > timestamp diff --git a/SU2_PY/SU2/io/tools.py b/SU2_PY/SU2/io/tools.py index 00a52e16cd2..35a5d2ef45f 100755 --- a/SU2_PY/SU2/io/tools.py +++ b/SU2_PY/SU2/io/tools.py @@ -3,7 +3,7 @@ ## \file tools.py # \brief file i/o functions # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -38,9 +38,10 @@ # Read SU2_DOT Gradient Values # ------------------------------------------------------------------- -def read_gradients( Grad_filename , scale = 1.0): - """ reads the raw gradients from the gradient file - returns a list of floats + +def read_gradients(Grad_filename, scale=1.0): + """reads the raw gradients from the gradient file + returns a list of floats """ # open file and skip first line @@ -58,6 +59,7 @@ def read_gradients( Grad_filename , scale = 1.0): return grad_vals + #: def read_gradients() @@ -65,34 +67,36 @@ def read_gradients( Grad_filename , scale = 1.0): # Read All Data from a Plot File # ------------------------------------------------------------------- -def read_plot( filename ): - """ reads a plot file - returns an ordered bunch with the headers for keys - and a list of each header's floats for values. + +def read_plot(filename): + """reads a plot file + returns an ordered bunch with the headers for keys + and a list of each header's floats for values. """ - extension = os.path.splitext( filename )[1] + extension = os.path.splitext(filename)[1] # open history file plot_file = open(filename) # title? line = plot_file.readline() - if line.startswith('TITLE'): - title = line.split('=')[1] .strip() # not used right now + if line.startswith("TITLE"): + title = line.split("=")[1].strip() # not used right now line = plot_file.readline() - if line.startswith('VARIABLES'): - line = plot_file.readline() + if line.startswith("VARIABLES"): + line = plot_file.readline() line = line.split(",") - Variables = [ x.strip().strip('"') for x in line ] + Variables = [x.strip().strip('"') for x in line] n_Vars = len(Variables) # initialize plot data dictionary plot_data = ordered_bunch.fromkeys(Variables) # must default each value to avoid pointer problems - for key in plot_data.keys(): plot_data[key] = [] + for key in plot_data.keys(): + plot_data[key] = [] # zone list zones = [] @@ -104,26 +108,26 @@ def read_plot( filename ): if not line: break - #zone? - if line.startswith('ZONE'): - zone = line.split('=')[1].strip('" ') + # zone? + if line.startswith("ZONE"): + zone = line.split("=")[1].strip('" ') zones.append(zone) continue # split line - line_data = line.strip().split(',') - line_data = [ float(x.strip()) for x in line_data ] + line_data = line.strip().split(",") + line_data = [float(x.strip()) for x in line_data] # store to dictionary for i_Var in range(n_Vars): this_variable = Variables[i_Var] - plot_data[this_variable] = plot_data[this_variable] + [ line_data[i_Var] ] + plot_data[this_variable] = plot_data[this_variable] + [line_data[i_Var]] #: for each line # check for number of zones if len(zones) > 1: - raise IOError('multiple zones not supported') + raise IOError("multiple zones not supported") # done plot_file.close() @@ -134,18 +138,19 @@ def read_plot( filename ): # Read All Data from History File # ------------------------------------------------------------------- -def read_history( History_filename, nZones = 1): - """ reads a history file - returns an ordered bunch with the history file headers for keys - and a list of each header's floats for values. - if header is an optimization objective, its name is mapped to - the optimization name. - Iter and Time(min) headers are mapped to ITERATION and TIME - respectively. + +def read_history(History_filename, nZones=1): + """reads a history file + returns an ordered bunch with the history file headers for keys + and a list of each header's floats for values. + if header is an optimization objective, its name is mapped to + the optimization name. + Iter and Time(min) headers are mapped to ITERATION and TIME + respectively. """ # read plot file - plot_data = read_plot( History_filename ) + plot_data = read_plot(History_filename) # initialize history data dictionary history_data = ordered_bunch() @@ -155,39 +160,41 @@ def read_history( History_filename, nZones = 1): var = key for field in historyOutFields: - if key == historyOutFields[field]['HEADER'] and nZones == 1: + if key == historyOutFields[field]["HEADER"] and nZones == 1: var = field - if key.split('[')[0] == historyOutFields[field]['HEADER'] and nZones > 1: - var = field + '[' + key.split('[')[1] + if key.split("[")[0] == historyOutFields[field]["HEADER"] and nZones > 1: + var = field + "[" + key.split("[")[1] history_data[var] = plot_data[key] return history_data -#: def read_history() +#: def read_history() # ------------------------------------------------------------------- # Define Dictionary Map for Header Names # ------------------------------------------------------------------- -def get_headerMap(nZones = 1): + +def get_headerMap(nZones=1): headerMap = dict() for outputField in historyOutFields: - headerMap[outputField] = historyOutFields[outputField]['HEADER'] + headerMap[outputField] = historyOutFields[outputField]["HEADER"] return headerMap -def getTurboPerfIndex(nZones = 1): - if int(nZones) > 1: - index = int(nZones) + int(int(nZones)/2.0) + 1 - else: - index = 1 - return index +def getTurboPerfIndex(nZones=1): + + if int(nZones) > 1: + index = int(nZones) + int(int(nZones) / 2.0) + 1 + else: + index = 1 + return index #: def get_headerMap() @@ -199,66 +206,71 @@ def getTurboPerfIndex(nZones = 1): #: optnames_stab -optnames_stab = [ "D_LIFT_D_ALPHA" , - "D_DRAG_D_ALPHA" , - "D_SIDEFORCE_D_ALPHA" , - "D_MOMENT_X_D_ALPHA" , - "D_MOMENT_Y_D_ALPHA" , - "D_MOMENT_Z_D_ALPHA" , - ] +optnames_stab = [ + "D_LIFT_D_ALPHA", + "D_DRAG_D_ALPHA", + "D_SIDEFORCE_D_ALPHA", + "D_MOMENT_X_D_ALPHA", + "D_MOMENT_Y_D_ALPHA", + "D_MOMENT_Z_D_ALPHA", +] #: Multipoint Optimizer Function Names # optnames_multi = ['{}_{}'.format('MULTIPOINT', a) for a in optnames_aero] -optnames_multi = [ "MULTIPOINT_LIFT" , - "MULTIPOINT_DRAG" , - "MULTIPOINT_SIDEFORCE" , - "MULTIPOINT_MOMENT_X" , - "MULTIPOINT_MOMENT_Y" , - "MULTIPOINT_MOMENT_Z" , - "MULTIPOINT_CUSTOM_OBJFUNC"] +optnames_multi = [ + "MULTIPOINT_LIFT", + "MULTIPOINT_DRAG", + "MULTIPOINT_SIDEFORCE", + "MULTIPOINT_MOMENT_X", + "MULTIPOINT_MOMENT_Y", + "MULTIPOINT_MOMENT_Z", + "MULTIPOINT_CUSTOM_OBJFUNC", +] # Geometric Optimizer Function Names -optnames_geo = [ "AIRFOIL_AREA" , - "AIRFOIL_THICKNESS" , - "AIRFOIL_CHORD" , - "AIRFOIL_LE_RADIUS" , - "AIRFOIL_TOC" , - "AIRFOIL_ALPHA" , - "FUSELAGE_VOLUME" , - "FUSELAGE_WETTED_AREA" , - "FUSELAGE_MIN_WIDTH" , - "FUSELAGE_MAX_WIDTH" , - "FUSELAGE_MIN_WATERLINE_WIDTH" , - "FUSELAGE_MAX_WATERLINE_WIDTH" , - "FUSELAGE_MIN_HEIGHT" , - "FUSELAGE_MAX_HEIGHT" , - "FUSELAGE_MAX_CURVATURE" , - "WING_VOLUME" , - "WING_MIN_THICKNESS" , - "WING_MAX_THICKNESS" , - "WING_MIN_CHORD" , - "WING_MAX_CHORD" , - "WING_MIN_LE_RADIUS" , - "WING_MAX_LE_RADIUS" , - "WING_MIN_TOC" , - "WING_MAX_TOC" , - "WING_OBJFUN_MIN_TOC" , - "WING_MAX_TWIST" , - "WING_MAX_CURVATURE" , - "WING_MAX_DIHEDRAL" , - "NACELLE_VOLUME" , - "NACELLE_MIN_THICKNESS" , - "NACELLE_MAX_THICKNESS" , - "NACELLE_MIN_CHORD" , - "NACELLE_MAX_CHORD" , - "NACELLE_MIN_LE_RADIUS" , - "NACELLE_MAX_LE_RADIUS" , - "NACELLE_MIN_TOC" , - "NACELLE_MAX_TOC" , - "NACELLE_OBJFUN_MIN_TOC" , - "NACELLE_MAX_TWIST" ] +optnames_geo = [ + "AIRFOIL_AREA", + "AIRFOIL_THICKNESS", + "AIRFOIL_CHORD", + "AIRFOIL_LE_RADIUS", + "AIRFOIL_TOC", + "AIRFOIL_ALPHA", + "FUSELAGE_VOLUME", + "FUSELAGE_WETTED_AREA", + "FUSELAGE_MIN_WIDTH", + "FUSELAGE_MAX_WIDTH", + "FUSELAGE_MIN_WATERLINE_WIDTH", + "FUSELAGE_MAX_WATERLINE_WIDTH", + "FUSELAGE_MIN_HEIGHT", + "FUSELAGE_MAX_HEIGHT", + "FUSELAGE_MAX_CURVATURE", + "WING_VOLUME", + "WING_MIN_THICKNESS", + "WING_MAX_THICKNESS", + "WING_MIN_CHORD", + "WING_MAX_CHORD", + "WING_MIN_LE_RADIUS", + "WING_MAX_LE_RADIUS", + "WING_MIN_TOC", + "WING_MAX_TOC", + "WING_OBJFUN_MIN_TOC", + "WING_MAX_TWIST", + "WING_MAX_CURVATURE", + "WING_MAX_DIHEDRAL", + "NACELLE_VOLUME", + "NACELLE_MIN_THICKNESS", + "NACELLE_MAX_THICKNESS", + "NACELLE_MIN_CHORD", + "NACELLE_MAX_CHORD", + "NACELLE_MIN_LE_RADIUS", + "NACELLE_MAX_LE_RADIUS", + "NACELLE_MIN_TOC", + "NACELLE_MAX_TOC", + "NACELLE_OBJFUN_MIN_TOC", + "NACELLE_MAX_TWIST", +] PerStation = [] for i in range(20): @@ -278,16 +290,18 @@ def getTurboPerfIndex(nZones = 1): #: optnames_geo # per-surface functions -per_surface_map = {"LIFT" : "CL" , - "DRAG" : "CD" , - "SIDEFORCE" : "CSF" , - "MOMENT_X" : "CMx" , - "MOMENT_Y" : "CMy" , - "MOMENT_Z" : "CMz" , - "FORCE_X" : "CFx" , - "FORCE_Y" : "CFy" , - "FORCE_Z" : "CFz" , - "EFFICIENCY" : "CL/CD" } +per_surface_map = { + "LIFT": "CL", + "DRAG": "CD", + "SIDEFORCE": "CSF", + "MOMENT_X": "CMx", + "MOMENT_Y": "CMy", + "MOMENT_Z": "CMz", + "FORCE_X": "CFx", + "FORCE_Y": "CFy", + "FORCE_Z": "CFz", + "EFFICIENCY": "CL/CD", +} # ------------------------------------------------------------------- # Include per-surface output from History File @@ -297,29 +311,35 @@ def update_persurface(config, state): header_map = get_headerMap() for base in per_surface_map: base2 = per_surface_map[base] - for marker in config['MARKER_MONITORING']: - if not (base2+'_'+marker) in header_map: - header_map[base2+'_'+marker] = base2+'_'+marker + for marker in config["MARKER_MONITORING"]: + if not (base2 + "_" + marker) in header_map: + header_map[base2 + "_" + marker] = base2 + "_" + marker # Update the function values in state to include the per-surface quantities - if 'DIRECT' in state['HISTORY']: + if "DIRECT" in state["HISTORY"]: for base in per_surface_map: base2 = per_surface_map[base] - for marker in config['MARKER_MONITORING']: - if (base2+'_'+marker) in state['HISTORY']['DIRECT']: - state['FUNCTIONS'][base2+'_'+marker] = state['HISTORY']['DIRECT'][base2+'_'+marker][-1] + for marker in config["MARKER_MONITORING"]: + if (base2 + "_" + marker) in state["HISTORY"]["DIRECT"]: + state["FUNCTIONS"][base2 + "_" + marker] = state["HISTORY"][ + "DIRECT" + ][base2 + "_" + marker][-1] + # ------------------------------------------------------------------- # Read Aerodynamic Function Values from History File # ------------------------------------------------------------------- -def read_aerodynamics( History_filename , nZones = 1, special_cases=[], final_avg=0, wnd_fct = 'SQUARE' ): - """ values = read_aerodynamics(historyname, special_cases=[]) - read aerodynamic function values from history file - Outputs: - dictionary with function keys and thier values - if special cases has 'TIME_MARCHING', returns time averaged data - otherwise returns final value from history file +def read_aerodynamics( + History_filename, nZones=1, special_cases=[], final_avg=0, wnd_fct="SQUARE" +): + """values = read_aerodynamics(historyname, special_cases=[]) + read aerodynamic function values from history file + + Outputs: + dictionary with function keys and thier values + if special cases has 'TIME_MARCHING', returns time averaged data + otherwise returns final value from history file """ # read the history data @@ -330,69 +350,101 @@ def read_aerodynamics( History_filename , nZones = 1, special_cases=[], final_av for this_objfun in historyOutFields: if nZones == 1: if this_objfun in history_data: - if historyOutFields[this_objfun]['TYPE'] == 'COEFFICIENT' or historyOutFields[this_objfun]['TYPE'] == 'D_COEFFICIENT': + if ( + historyOutFields[this_objfun]["TYPE"] == "COEFFICIENT" + or historyOutFields[this_objfun]["TYPE"] == "D_COEFFICIENT" + ): Func_Values[this_objfun] = history_data[this_objfun] else: for iZone in range(nZones): - if this_objfun + '[' + str(iZone) + ']' in history_data: - if historyOutFields[this_objfun]['TYPE'] == 'COEFFICIENT' or historyOutFields[this_objfun]['TYPE'] == 'D_COEFFICIENT': - Func_Values[this_objfun + '[' + str(iZone) + ']'] = history_data[this_objfun + '[' + str(iZone) + ']'] - - if 'TIME_MARCHING' in special_cases: + if this_objfun + "[" + str(iZone) + "]" in history_data: + if ( + historyOutFields[this_objfun]["TYPE"] == "COEFFICIENT" + or historyOutFields[this_objfun]["TYPE"] == "D_COEFFICIENT" + ): + Func_Values[ + this_objfun + "[" + str(iZone) + "]" + ] = history_data[this_objfun + "[" + str(iZone) + "]"] + + if "TIME_MARCHING" in special_cases: # for unsteady cases, average time-accurate objective function values for key, value in Func_Values.items(): - if historyOutFields[key]['TYPE'] == 'COEFFICIENT': - if not history_data.get('TAVG_'+ key): - raise KeyError('Key ' + historyOutFields['TAVG_'+ key]['HEADER'] + ' was not found in history output.') - Func_Values[key] = history_data['TAVG_'+ key][-1] - elif historyOutFields[key]['TYPE'] == 'D_COEFFICIENT': - if not history_data.get('TAVG_' + key): - raise KeyError('Key ' + historyOutFields['TAVG_' + key]['HEADER'] + ' was not found in history output.') - Func_Values[key] = history_data['TAVG_' + key][-1] + if historyOutFields[key]["TYPE"] == "COEFFICIENT": + if not history_data.get("TAVG_" + key): + raise KeyError( + "Key " + + historyOutFields["TAVG_" + key]["HEADER"] + + " was not found in history output." + ) + Func_Values[key] = history_data["TAVG_" + key][-1] + elif historyOutFields[key]["TYPE"] == "D_COEFFICIENT": + if not history_data.get("TAVG_" + key): + raise KeyError( + "Key " + + historyOutFields["TAVG_" + key]["HEADER"] + + " was not found in history output." + ) + Func_Values[key] = history_data["TAVG_" + key][-1] else: # in steady cases take only last value. for key, value in Func_Values.iteritems(): if not history_data.get(key): - raise KeyError('Key ' + historyOutFields[key]['HEADER'] + ' was not found in history output.') + raise KeyError( + "Key " + + historyOutFields[key]["HEADER"] + + " was not found in history output." + ) Func_Values[key] = value[-1] return Func_Values + #: def read_aerodynamics() # ------------------------------------------------------------------- # Get Objective Function Sign # ------------------------------------------------------------------- -def get_objectiveSign( ObjFun_name ): - """ returns -1 for maximization problems: - LIFT - EFFICIENCY - THRUST - FIGURE_OF_MERIT - MASS_FLOW_RATE - SURFACE_TOTAL_PRESSURE - SURFACE_STATIC_PRESSURE - SURFACE_MASSFLOW - SURFACE_MACH - TOTAL_STATIC_EFFICIENCY - returns +1 otherwise + +def get_objectiveSign(ObjFun_name): + """returns -1 for maximization problems: + LIFT + EFFICIENCY + THRUST + FIGURE_OF_MERIT + MASS_FLOW_RATE + SURFACE_TOTAL_PRESSURE + SURFACE_STATIC_PRESSURE + SURFACE_MASSFLOW + SURFACE_MACH + TOTAL_STATIC_EFFICIENCY + returns +1 otherwise """ # flip sign for maximization problems - if ObjFun_name == "LIFT" : return -1.0 - if ObjFun_name == "EFFICIENCY" : return -1.0 - if ObjFun_name == "THRUST" : return -1.0 - if ObjFun_name == "FIGURE_OF_MERIT" : return -1.0 - if ObjFun_name == "SURFACE_TOTAL_PRESSURE" : return -1.0 - if ObjFun_name == "SURFACE_STATIC_PRESSURE" : return -1.0 - if ObjFun_name == "SURFACE_MASSFLOW" : return -1.0 - if ObjFun_name == "SURFACE_MACH" : return -1.0 - if ObjFun_name == "TOTAL_STATIC_EFFICIENCY" :return -1.0 + if ObjFun_name == "LIFT": + return -1.0 + if ObjFun_name == "EFFICIENCY": + return -1.0 + if ObjFun_name == "THRUST": + return -1.0 + if ObjFun_name == "FIGURE_OF_MERIT": + return -1.0 + if ObjFun_name == "SURFACE_TOTAL_PRESSURE": + return -1.0 + if ObjFun_name == "SURFACE_STATIC_PRESSURE": + return -1.0 + if ObjFun_name == "SURFACE_MASSFLOW": + return -1.0 + if ObjFun_name == "SURFACE_MACH": + return -1.0 + if ObjFun_name == "TOTAL_STATIC_EFFICIENCY": + return -1.0 # otherwise return 1.0 + #: def get_objectiveSign() @@ -400,16 +452,17 @@ def get_objectiveSign( ObjFun_name ): # Get Constraint Sign # ------------------------------------------------------------------- -def get_constraintSign( sign ): - """ gets +/-1 given a constraint sign < or > respectively - inequality constraint is posed as c(x) < 0 + +def get_constraintSign(sign): + """gets +/-1 given a constraint sign < or > respectively + inequality constraint is posed as c(x) < 0 """ - sign_map = { '>' : -1.0 , - '<' : +1.0 } - assert not sign=='=' , 'Sign "=" not valid' + sign_map = {">": -1.0, "<": +1.0} + assert not sign == "=", 'Sign "=" not valid' return sign_map[sign] + #: def get_constraintSign() @@ -417,68 +470,72 @@ def get_constraintSign( sign ): # Get Adjoint Filename Suffix # ------------------------------------------------------------------- + def get_adjointSuffix(objective_function=None): - """ gets the adjoint suffix given an objective function """ + """gets the adjoint suffix given an objective function""" # adjoint name map - name_map = { "DRAG" : "cd" , - "LIFT" : "cl" , - "SIDEFORCE" : "csf" , - "MOMENT_X" : "cmx" , - "MOMENT_Y" : "cmy" , - "MOMENT_Z" : "cmz" , - "FORCE_X" : "cfx" , - "FORCE_Y" : "cfy" , - "FORCE_Z" : "cfz" , - "EFFICIENCY" : "eff" , - "INVERSE_DESIGN_PRESSURE" : "invpress" , - "INVERSE_DESIGN_HEAT" : "invheat" , - "MAXIMUM_HEATFLUX" : "maxheat" , - "TOTAL_HEATFLUX" : "totheat" , - "EQUIVALENT_AREA" : "ea" , - "NEARFIELD_PRESSURE" : "nfp" , - "THRUST" : "ct" , - "TORQUE" : "cq" , - "FIGURE_OF_MERIT" : "merit" , - "BUFFET" : "buffet" , - "SURFACE_TOTAL_PRESSURE" : "pt" , - "SURFACE_STATIC_PRESSURE" : "pe" , - "SURFACE_MASSFLOW" : "mfr" , - "SURFACE_MACH" : "mach" , - "SURFACE_UNIFORMITY" : "uniform" , - "SURFACE_SECONDARY" : "second" , - "SURFACE_MOM_DISTORTION" : "distort" , - "SURFACE_SECOND_OVER_UNIFORM" : "sou" , - "SURFACE_PRESSURE_DROP" : "dp" , - "CUSTOM_OBJFUNC" : "custom" , - "KINETIC_ENERGY_LOSS" : "ke" , - "TOTAL_PRESSURE_LOSS" : "pl" , - "ENTROPY_GENERATION" : "entg" , - "EULERIAN_WORK" : "ew" , - "FLOW_ANGLE_OUT" : "fao" , - "FLOW_ANGLE_IN" : "fai" , - "MASS_FLOW_OUT" : "mfo" , - "MASS_FLOW_IN" : "mfi" , - "TOTAL_EFFICIENCY" : "teff" , - "TOTAL_STATIC_EFFICIENCY" : "tseff" , - "COMBO" : "combo"} + name_map = { + "DRAG": "cd", + "LIFT": "cl", + "SIDEFORCE": "csf", + "MOMENT_X": "cmx", + "MOMENT_Y": "cmy", + "MOMENT_Z": "cmz", + "FORCE_X": "cfx", + "FORCE_Y": "cfy", + "FORCE_Z": "cfz", + "EFFICIENCY": "eff", + "INVERSE_DESIGN_PRESSURE": "invpress", + "INVERSE_DESIGN_HEAT": "invheat", + "MAXIMUM_HEATFLUX": "maxheat", + "TOTAL_HEATFLUX": "totheat", + "EQUIVALENT_AREA": "ea", + "NEARFIELD_PRESSURE": "nfp", + "THRUST": "ct", + "TORQUE": "cq", + "FIGURE_OF_MERIT": "merit", + "BUFFET": "buffet", + "SURFACE_TOTAL_PRESSURE": "pt", + "SURFACE_STATIC_PRESSURE": "pe", + "SURFACE_MASSFLOW": "mfr", + "SURFACE_MACH": "mach", + "SURFACE_UNIFORMITY": "uniform", + "SURFACE_SECONDARY": "second", + "SURFACE_MOM_DISTORTION": "distort", + "SURFACE_SECOND_OVER_UNIFORM": "sou", + "SURFACE_PRESSURE_DROP": "dp", + "CUSTOM_OBJFUNC": "custom", + "KINETIC_ENERGY_LOSS": "ke", + "TOTAL_PRESSURE_LOSS": "pl", + "ENTROPY_GENERATION": "entg", + "EULERIAN_WORK": "ew", + "FLOW_ANGLE_OUT": "fao", + "FLOW_ANGLE_IN": "fai", + "MASS_FLOW_OUT": "mfo", + "MASS_FLOW_IN": "mfi", + "TOTAL_EFFICIENCY": "teff", + "TOTAL_STATIC_EFFICIENCY": "tseff", + "COMBO": "combo", + } # if none or false, return map if not objective_function: return name_map else: # remove white space - objective = ''.join(objective_function.split()) + objective = "".join(objective_function.split()) objective = objective.split(",") nObj = len(objective) - if (nObj>1): + if nObj > 1: return "combo" if objective[0] in name_map: return name_map[objective[0]] # otherwise... else: - raise Exception('Unrecognized adjoint function name') + raise Exception("Unrecognized adjoint function name") + #: def get_adjointSuffix() @@ -486,388 +543,482 @@ def get_adjointSuffix(objective_function=None): # Add a Suffix # ------------------------------------------------------------------- -def add_suffix(base_name,suffix): - """ suffix_name = add_suffix(base_name,suffix) - adds suffix to a filename, accounting for file type extension - example: - base_name = 'input.txt' - suffix = 'new' - suffix_name = 'input_new.txt' + +def add_suffix(base_name, suffix): + """suffix_name = add_suffix(base_name,suffix) + adds suffix to a filename, accounting for file type extension + example: + base_name = 'input.txt' + suffix = 'new' + suffix_name = 'input_new.txt' """ if isinstance(base_name, list): suffix_name = [] for name in base_name: name_split = os.path.splitext(name) - suffix_name.append(name_split[0] + '_' + suffix + name_split[1]) + suffix_name.append(name_split[0] + "_" + suffix + name_split[1]) else: base_name = os.path.splitext(base_name) - suffix_name = base_name[0] + '_' + suffix + base_name[1] + suffix_name = base_name[0] + "_" + suffix + base_name[1] return suffix_name -#: def add_suffix() +#: def add_suffix() # ------------------------------------------------------------------- # Get Design Variable ID Map # ------------------------------------------------------------------- + def get_dvMap(): - """ get dictionary that maps design variable - kind id number to name """ - dv_map = { 0 : "NO_DEFORMATION" , - 1 : "TRANSLATION" , - 2 : "ROTATION" , - 3 : "SCALE" , - 10 : "FFD_SETTING" , - 11 : "FFD_CONTROL_POINT" , - 12 : "FFD_NACELLE" , - 13 : "FFD_GULL" , - 14 : "FFD_CAMBER" , - 15 : "FFD_TWIST" , - 16 : "FFD_THICKNESS" , - 18 : "FFD_ROTATION" , - 19 : "FFD_CONTROL_POINT_2D" , - 20 : "FFD_CAMBER_2D" , - 21 : "FFD_THICKNESS_2D" , - 22 : "FFD_TWIST_2D" , - 23 : "FFD_CONTROL_SURFACE" , - 24 : "FFD_ANGLE_OF_ATTACK" , - 30 : "HICKS_HENNE" , - 31 : "PARABOLIC" , - 32 : "NACA_4DIGITS" , - 33 : "AIRFOIL" , - 34 : "CST" , - 35 : "SURFACE_BUMP" , - 36 : "SURFACE_FILE" , - 40 : "DV_EFIELD" , - 41 : "DV_YOUNG" , - 42 : "DV_POISSON" , - 43 : "DV_RHO" , - 44 : "DV_RHO_DL" , - 50 : "TRANSLATE_GRID" , - 51 : "ROTATE_GRID" , - 52 : "SCALE_GRID" , - 101 : "ANGLE_OF_ATTACK" } + """get dictionary that maps design variable + kind id number to name""" + dv_map = { + 0: "NO_DEFORMATION", + 1: "TRANSLATION", + 2: "ROTATION", + 3: "SCALE", + 10: "FFD_SETTING", + 11: "FFD_CONTROL_POINT", + 12: "FFD_NACELLE", + 13: "FFD_GULL", + 14: "FFD_CAMBER", + 15: "FFD_TWIST", + 16: "FFD_THICKNESS", + 18: "FFD_ROTATION", + 19: "FFD_CONTROL_POINT_2D", + 20: "FFD_CAMBER_2D", + 21: "FFD_THICKNESS_2D", + 23: "FFD_CONTROL_SURFACE", + 24: "FFD_ANGLE_OF_ATTACK", + 30: "HICKS_HENNE", + 31: "PARABOLIC", + 32: "NACA_4DIGITS", + 33: "AIRFOIL", + 34: "CST", + 35: "SURFACE_BUMP", + 36: "SURFACE_FILE", + 40: "DV_EFIELD", + 41: "DV_YOUNG", + 42: "DV_POISSON", + 43: "DV_RHO", + 44: "DV_RHO_DL", + 50: "TRANSLATE_GRID", + 51: "ROTATE_GRID", + 52: "SCALE_GRID", + 101: "ANGLE_OF_ATTACK", + } return dv_map + #: def get_dvMap() # ------------------------------------------------------------------- # Get Design Variable Kind Name from ID # ------------------------------------------------------------------- -def get_dvKind( kindID ): - """ get design variable kind name from id number """ +def get_dvKind(kindID): + """get design variable kind name from id number""" dv_map = get_dvMap() try: - return dv_map[ kindID ] + return dv_map[kindID] except KeyError: - raise Exception('Unrecognized Design Variable ID') + raise Exception("Unrecognized Design Variable ID") + + # def get_dvKind() # ------------------------------------------------------------------- # Get Design Variable Kind ID from Name # ------------------------------------------------------------------- -def get_dvID( kindName ): - """ get design variable kind id number from name """ +def get_dvID(kindName): + """get design variable kind id number from name""" dv_map = get_dvMap() - id_map = dict((v,k) for (k,v) in dv_map.items()) + id_map = dict((v, k) for (k, v) in dv_map.items()) try: - return id_map[ kindName ] + return id_map[kindName] except KeyError: - raise Exception('Unrecognized Design Variable Name: %s' , kindName) -#: def get_dvID() + raise Exception("Unrecognized Design Variable Name: %s", kindName) +#: def get_dvID() + # ------------------------------------------------------------------- # Get Gradient File Header # ------------------------------------------------------------------- -def get_gradFileFormat(grad_type,plot_format,kindID,special_cases=[]): + +def get_gradFileFormat(grad_type, plot_format, kindID, special_cases=[]): # start header, build a list of strings and join at the end - header = [] + header = [] write_format = [] # handle plot formating - if (plot_format == 'TECPLOT'): - header.append('VARIABLES=') - elif (plot_format == 'CSV'): + if plot_format == "TECPLOT": + header.append("VARIABLES=") + elif plot_format == "CSV": pass - else: raise Exception('output plot format not recognized') + else: + raise Exception("output plot format not recognized") # Case: continuous adjoint - if grad_type == 'CONTINUOUS_ADJOINT': + if grad_type == "CONTINUOUS_ADJOINT": header.append(r'"iVar","Gradient","FinDiff_Step"') - write_format.append(r'%4d, %.10f, %f') + write_format.append(r"%4d, %.10f, %f") # Case: finite difference - elif grad_type == 'FINITE_DIFFERENCE': - header.append(r'"iVar","Grad_CL","Grad_CD","Grad_CSF","Grad_CMx","Grad_CMy","Grad_CMz","Grad_CFx","Grad_CFy","Grad_CFz","Grad_CL/CD","Grad_Custom_ObjFunc","Grad_HeatFlux_Total","Grad_HeatFlux_Maximum","Grad_Temperature_Total"') - write_format.append(r'%4d, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f') + elif grad_type == "FINITE_DIFFERENCE": + header.append( + r'"iVar","Grad_CL","Grad_CD","Grad_CSF","Grad_CMx","Grad_CMy","Grad_CMz","Grad_CFx","Grad_CFy","Grad_CFz","Grad_CL/CD","Grad_Custom_ObjFunc","Grad_HeatFlux_Total","Grad_HeatFlux_Maximum","Grad_Temperature_Total"' + ) + write_format.append( + r"%4d, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f" + ) for key in special_cases: - if key == "ROTATING_FRAME" : + if key == "ROTATING_FRAME": header.append(r',"Grad_CMerit","Grad_CT","Grad_CQ"') write_format.append(", %.10f, %.10f, %.10f") - if key == "EQUIV_AREA" : + if key == "EQUIV_AREA": header.append(r',"Grad_CEquivArea","Grad_CNearFieldOF"') write_format.append(", %.10f, %.10f") - if key == "ENGINE" : - header.append(r',"Grad_AeroCDrag","Grad_SolidCDrag","Grad_Radial_Distortion","Grad_Circumferential_Distortion"') + if key == "ENGINE": + header.append( + r',"Grad_AeroCDrag","Grad_SolidCDrag","Grad_Radial_Distortion","Grad_Circumferential_Distortion"' + ) write_format.append(", %.10f, %.10f, %.10f, %.10f") - if key == "1D_OUTPUT" : - header.append(r',"Grad_Avg_TotalPress","Grad_Avg_Mach","Grad_Avg_Temperature","Grad_MassFlowRate","Grad_Avg_Pressure","Grad_Avg_Density","Grad_Avg_Velocity","Grad_Avg_Enthalpy"') - write_format.append(", %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f") - if key == "INV_DESIGN_CP" : + if key == "1D_OUTPUT": + header.append( + r',"Grad_Avg_TotalPress","Grad_Avg_Mach","Grad_Avg_Temperature","Grad_MassFlowRate","Grad_Avg_Pressure","Grad_Avg_Density","Grad_Avg_Velocity","Grad_Avg_Enthalpy"' + ) + write_format.append( + ", %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f" + ) + if key == "INV_DESIGN_CP": header.append(r',"Grad_Cp_Diff"') write_format.append(", %.10f") - if key == "INV_DESIGN_HEATFLUX" : + if key == "INV_DESIGN_HEATFLUX": header.append(r',"Grad_HeatFlux_Diff"') write_format.append(", %.10f") # otherwise... - else: raise Exception('Unrecognized Gradient Type') + else: + raise Exception("Unrecognized Gradient Type") # design variable parameters - if kindID == "FFD_CONTROL_POINT_2D" : + if kindID == "FFD_CONTROL_POINT_2D": header.append(r',"FFD_Box_ID","xIndex","yIndex","xAxis","yAxis"') - write_format.append(r', %s, %s, %s, %s, %s') - elif kindID == "FFD_CAMBER_2D" : + write_format.append(r", %s, %s, %s, %s, %s") + elif kindID == "FFD_CAMBER_2D": header.append(r',"FFD_Box_ID","xIndex"') - write_format.append(r', %s, %s') - elif kindID == "FFD_THICKNESS_2D" : + write_format.append(r", %s, %s") + elif kindID == "FFD_THICKNESS_2D": header.append(r',"FFD_Box_ID","xIndex"') - write_format.append(r', %s, %s') - elif kindID == "HICKS_HENNE" : + write_format.append(r", %s, %s") + elif kindID == "HICKS_HENNE": header.append(r',"Up/Down","Loc_Max"') - write_format.append(r', %s, %s') - elif kindID == "SURFACE_BUMP" : + write_format.append(r", %s, %s") + elif kindID == "SURFACE_BUMP": header.append(r',"Loc_Start","Loc_End","Loc_Max"') - write_format.append(r', %s, %s, %s') - elif kindID == "CST" : + write_format.append(r", %s, %s, %s") + elif kindID == "CST": header.append(r',"Up/Down","Kulfan number", "Total Kulfan numbers"') - write_format.append(r', %s, %s', '%s') - elif kindID == "FAIRING" : + write_format.append(r", %s, %s", "%s") + elif kindID == "FAIRING": header.append(r',"ControlPoint_Index","Theta_Disp","R_Disp"') - write_format.append(r', %s, %s, %s') - elif kindID == "NACA_4DIGITS" : + write_format.append(r", %s, %s, %s") + elif kindID == "NACA_4DIGITS": header.append(r',"1st_digit","2nd_digit","3rd&4th_digits"') - write_format.append(r', %s, %s, %s') - elif kindID == "TRANSLATION" : + write_format.append(r", %s, %s, %s") + elif kindID == "TRANSLATION": header.append(r',"x_Disp","y_Disp","z_Disp"') - write_format.append(r', %s, %s, %s') - elif kindID == "ROTATION" : + write_format.append(r", %s, %s, %s") + elif kindID == "ROTATION": header.append(r',"x_Orig","y_Orig","z_Orig","x_End","y_End","z_End"') - write_format.append(r', %s, %s, %s, %s, %s, %s') - elif kindID == "FFD_CONTROL_POINT" : - header.append(r',"FFD_Box_ID","xIndex","yIndex","zIndex","xAxis","yAxis","zAxis"') - write_format.append(r', %s, %s, %s, %s, %s, %s, %s') - elif kindID == "FFD_DIHEDRAL_ANGLE" : - header.append(r',"FFD_Box_ID","x_Orig","y_Orig","z_Orig","x_End","y_End","z_End"') - write_format.append(r', %s, %s, %s, %s, %s, %s, %s') - elif kindID == "FFD_TWIST_ANGLE" : - header.append(r',"FFD_Box_ID","x_Orig","y_Orig","z_Orig","x_End","y_End","z_End"') - write_format.append(r', %s, %s, %s, %s, %s, %s, %s') - elif kindID == "FFD_ROTATION" : - header.append(r',"FFD_Box_ID","x_Orig","y_Orig","z_Orig","x_End","y_End","z_End"') - write_format.append(r', %s, %s, %s, %s, %s, %s, %s') - elif kindID == "FFD_CAMBER" : + write_format.append(r", %s, %s, %s, %s, %s, %s") + elif kindID == "FFD_CONTROL_POINT": + header.append( + r',"FFD_Box_ID","xIndex","yIndex","zIndex","xAxis","yAxis","zAxis"' + ) + write_format.append(r", %s, %s, %s, %s, %s, %s, %s") + elif kindID == "FFD_DIHEDRAL_ANGLE": + header.append( + r',"FFD_Box_ID","x_Orig","y_Orig","z_Orig","x_End","y_End","z_End"' + ) + write_format.append(r", %s, %s, %s, %s, %s, %s, %s") + elif kindID == "FFD_TWIST_ANGLE": + header.append( + r',"FFD_Box_ID","x_Orig","y_Orig","z_Orig","x_End","y_End","z_End"' + ) + write_format.append(r", %s, %s, %s, %s, %s, %s, %s") + elif kindID == "FFD_ROTATION": + header.append( + r',"FFD_Box_ID","x_Orig","y_Orig","z_Orig","x_End","y_End","z_End"' + ) + write_format.append(r", %s, %s, %s, %s, %s, %s, %s") + elif kindID == "FFD_CAMBER": header.append(r',"FFD_Box_ID","xIndex","yIndex"') - write_format.append(r', %s, %s, %s') - elif kindID == "FFD_THICKNESS" : + write_format.append(r", %s, %s, %s") + elif kindID == "FFD_THICKNESS": header.append(r',"FFD_Box_ID","xIndex","yIndex"') - write_format.append(r', %s, %s, %s') - elif kindID == "ANGLE_OF_ATTACK" : pass - elif kindID == "FFD_ANGLE_OF_ATTACK" : pass + write_format.append(r", %s, %s, %s") + elif kindID == "ANGLE_OF_ATTACK": + pass + elif kindID == "FFD_ANGLE_OF_ATTACK": + pass # otherwise... - else: raise Exception('Unrecognized Design Variable Kind') + else: + raise Exception("Unrecognized Design Variable Kind") # finite difference step - if grad_type == 'FINITE_DIFFERENCE': + if grad_type == "FINITE_DIFFERENCE": header.append(r',"FinDiff_Step"') - write_format.append(r', %.10f') + write_format.append(r", %.10f") # finish format - header.append('\n') - write_format.append('\n') + header.append("\n") + write_format.append("\n") - header = ''.join(header) - write_format = ''.join(write_format) + header = "".join(header) + write_format = "".join(write_format) - return [header,write_format] + return [header, write_format] -#: def get_gradFileFormat() +#: def get_gradFileFormat() # ------------------------------------------------------------------- # Get Optimization File Header # ------------------------------------------------------------------- -def get_optFileFormat(plot_format,special_cases=None, nZones = 1): - if special_cases is None: special_cases = [] +def get_optFileFormat(plot_format, special_cases=None, nZones=1): + + if special_cases is None: + special_cases = [] # start header, build a list of strings and join at the end - header_list = [] - header_format = '' - write_format = [] + header_list = [] + header_format = "" + write_format = [] # handle plot formating - if (plot_format == 'TECPLOT'): - header_format = header_format + 'VARIABLES=' - elif (plot_format == 'CSV'): + if plot_format == "TECPLOT": + header_format = header_format + "VARIABLES=" + elif plot_format == "CSV": pass - else: raise Exception('output plot format not recognized') + else: + raise Exception("output plot format not recognized") # start header - header_list.extend(["Iteration","CL","CD","CSF","CMx","CMy","CMz","CFx","CFy","CFz","CL/CD","Custom_ObjFunc","HeatFlux_Total","HeatFlux_Maximum","Temperature_Total"]) - write_format.append(r'%4d, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f') + header_list.extend( + [ + "Iteration", + "CL", + "CD", + "CSF", + "CMx", + "CMy", + "CMz", + "CFx", + "CFy", + "CFz", + "CL/CD", + "Custom_ObjFunc", + "HeatFlux_Total", + "HeatFlux_Maximum", + "Temperature_Total", + ] + ) + write_format.append( + r"%4d, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f" + ) # special cases for key in special_cases: - if key == "ROTATING_FRAME" : - header_list.extend(["CMerit","CT","CQ"]) - write_format.append(r', %.10f, %.10f, %.10f') - if key == "EQUIV_AREA" : - header_list.extend(["CEquivArea","CNearFieldOF"]) - write_format.append(r', %.10f, %.10f') - if key == "ENGINE" : - header_list.extend(["AeroCDrag","SolidCDrag","Radial_Distortion","Circumferential_Distortion"]) - write_format.append(r', %.10f, %.10f, %.10f, %.10f') + if key == "ROTATING_FRAME": + header_list.extend(["CMerit", "CT", "CQ"]) + write_format.append(r", %.10f, %.10f, %.10f") + if key == "EQUIV_AREA": + header_list.extend(["CEquivArea", "CNearFieldOF"]) + write_format.append(r", %.10f, %.10f") + if key == "ENGINE": + header_list.extend( + [ + "AeroCDrag", + "SolidCDrag", + "Radial_Distortion", + "Circumferential_Distortion", + ] + ) + write_format.append(r", %.10f, %.10f, %.10f, %.10f") if key == "1D_OUTPUT": - header_list.extend(["AreaAvg_TotalPress","AreaAvg_Mach","AreaAvg_Temperature","MassFlowRate","Avg_Pressure","Avg_Density","Avg_Velocity","Avg_Enthalpy"]) - write_format.append(r', %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f') - if key == "INV_DESIGN_CP" : + header_list.extend( + [ + "AreaAvg_TotalPress", + "AreaAvg_Mach", + "AreaAvg_Temperature", + "MassFlowRate", + "Avg_Pressure", + "Avg_Density", + "Avg_Velocity", + "Avg_Enthalpy", + ] + ) + write_format.append( + r", %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f, %.10f" + ) + if key == "INV_DESIGN_CP": header_list.extend(["Cp_Diff"]) - write_format.append(r', %.10f') - if key == "INV_DESIGN_HEATFLUX" : + write_format.append(r", %.10f") + if key == "INV_DESIGN_HEATFLUX": header_list.extend(["HeatFlux_Diff"]) - write_format.append(r', %.10f') + write_format.append(r", %.10f") # finish formats - header_format = (header_format) + ('"') + ('","').join(header_list) + ('"') + (' \n') - write_format = ''.join(write_format) + ' \n' + header_format = ( + (header_format) + ('"') + ('","').join(header_list) + ('"') + (" \n") + ) + write_format = "".join(write_format) + " \n" # build list of objective function names header_vars = [] map_dict = get_headerMap(nZones) for variable in header_list: - assert variable in map_dict, 'unrecognized header variable' + assert variable in map_dict, "unrecognized header variable" header_vars.append(map_dict[variable]) # done - return [header_format,header_vars,write_format] + return [header_format, header_vars, write_format] -#: def get_optFileFormat() +#: def get_optFileFormat() # ------------------------------------------------------------------- # Get Extension Name # ------------------------------------------------------------------- + def get_extension(output_format): - if (output_format == "PARAVIEW") : return ".csv" - if (output_format == "PARAVIEW_BINARY") : return ".csv" - if (output_format == "TECPLOT") : return ".dat" - if (output_format == "TECPLOT_BINARY") : return ".szplt" - if (output_format == "SOLUTION") : return ".dat" - if (output_format == "RESTART") : return ".dat" - if (output_format == "CONFIG") : return ".cfg" - if (output_format == "CSV") : return ".csv" + if output_format == "PARAVIEW": + return ".csv" + if output_format == "PARAVIEW_BINARY": + return ".csv" + if output_format == "TECPLOT": + return ".dat" + if output_format == "TECPLOT_BINARY": + return ".szplt" + if output_format == "SOLUTION": + return ".dat" + if output_format == "RESTART": + return ".dat" + if output_format == "CONFIG": + return ".cfg" + if output_format == "CSV": + return ".csv" # otherwise raise Exception("Output Format Unknown") -#: def get_extension() +#: def get_extension() # ------------------------------------------------------------------- # Check Special Case # ------------------------------------------------------------------- def get_specialCases(config): - """ returns a list of special physical problems that were - specified in the config file, and set to 'yes' + """returns a list of special physical problems that were + specified in the config file, and set to 'yes' """ - all_special_cases = [ 'ROTATING_FRAME' , - 'EQUIV_AREA' , - '1D_OUTPUT' , - 'INV_DESIGN_CP' , - 'INV_DESIGN_HEATFLUX' ] + all_special_cases = [ + "ROTATING_FRAME", + "EQUIV_AREA", + "1D_OUTPUT", + "INV_DESIGN_CP", + "INV_DESIGN_HEATFLUX", + ] special_cases = [] for key in all_special_cases: - if key in config and config[key] == 'YES': + if key in config and config[key] == "YES": special_cases.append(key) - if 'SOLVER' in config and config['SOLVER'] == key: + if "SOLVER" in config and config["SOLVER"] == key: special_cases.append(key) - if config.get('TIME_MARCHING','NO') != 'NO': - special_cases.append('TIME_MARCHING') + if config.get("TIME_MARCHING", "NO") != "NO": + special_cases.append("TIME_MARCHING") # no support for more than one special case if len(special_cases) > 1: - error_str = 'Currently cannot support ' + ' and '.join(special_cases) + ' at once' + error_str = ( + "Currently cannot support " + " and ".join(special_cases) + " at once" + ) raise Exception(error_str) # Special case for harmonic balance - if 'TIME_MARCHING' in config and config['TIME_MARCHING'] == 'HARMONIC_BALANCE': - special_cases.append('HARMONIC_BALANCE') + if "TIME_MARCHING" in config and config["TIME_MARCHING"] == "HARMONIC_BALANCE": + special_cases.append("HARMONIC_BALANCE") # Special case for rotating frame - if 'GRID_MOVEMENT_KIND' in config and config['GRID_MOVEMENT_KIND'] == 'ROTATING_FRAME': - special_cases.append('ROTATING_FRAME') + if ( + "GRID_MOVEMENT_KIND" in config + and config["GRID_MOVEMENT_KIND"] == "ROTATING_FRAME" + ): + special_cases.append("ROTATING_FRAME") return special_cases + #: def get_specialCases() # ------------------------------------------------------------------- # Check Fluid Structure Interaction # ------------------------------------------------------------------- def get_multizone(config): - """ returns a list of special physical problems that were - specified in the config file, and set to 'yes' + """returns a list of special physical problems that were + specified in the config file, and set to 'yes' """ - all_multizone_problems = ['FLUID_STRUCTURE_INTERACTION'] + all_multizone_problems = ["FLUID_STRUCTURE_INTERACTION"] multizone = [] for key in all_multizone_problems: - if 'SOLVER' in config and config['SOLVER'] == key: + if "SOLVER" in config and config["SOLVER"] == key: multizone.append(key) return multizone + #: def get_multizone() -def next_folder(folder_format,num_format='%03d'): - """ folder = next_folder(folder_format,num_format='%03d') - finds the next folder with given format +def next_folder(folder_format, num_format="%03d"): + """folder = next_folder(folder_format,num_format='%03d') + finds the next folder with given format - Inputs: - folder_format - folder name with wild card (*) to mark expansion - num_format - %d formating to expand the wild card with + Inputs: + folder_format - folder name with wild card (*) to mark expansion + num_format - %d formating to expand the wild card with - Outputs: - folder - a folder with the next index number inserted in - the wild card, first index is 1 + Outputs: + folder - a folder with the next index number inserted in + the wild card, first index is 1 """ - assert '*' in folder_format , 'wildcard (*) missing in folder_format name' + assert "*" in folder_format, "wildcard (*) missing in folder_format name" folders = glob.glob(folder_format) - split = folder_format.split('*') - folder = folder_format.replace('*',num_format) + split = folder_format.split("*") + folder = folder_format.replace("*", num_format) if folders: # find folder number, could be done with regex... @@ -881,7 +1032,7 @@ def next_folder(folder_format,num_format='%03d'): max_i = int(max_folder) # increment folder number - folder = folder % (max_i+1) + folder = folder % (max_i + 1) else: # first folder, number 1 folder = folder % 1 @@ -889,23 +1040,27 @@ def next_folder(folder_format,num_format='%03d'): return folder -def expand_part(name,config): +def expand_part(name, config): names = [name] return names -def expand_time(name,config): - if 'TIME_MARCHING' in get_specialCases(config): - n_time = config['UNST_ADJOINT_ITER'] + +def expand_time(name, config): + if "TIME_MARCHING" in get_specialCases(config): + n_time = config["UNST_ADJOINT_ITER"] n_start_time = 0 - if config.get('TIME_DOMAIN', 'NO') == 'YES' and config.get('RESTART_SOL','NO') == 'YES': - n_start_time = int(config['RESTART_ITER']) + if ( + config.get("TIME_DOMAIN", "NO") == "YES" + and config.get("RESTART_SOL", "NO") == "YES" + ): + n_start_time = int(config["RESTART_ITER"]) if not isinstance(name, list): - name_pat = add_suffix(name,'%05d') - names = [name_pat%i for i in range(n_start_time, n_time)] + name_pat = add_suffix(name, "%05d") + names = [name_pat % i for i in range(n_start_time, n_time)] else: for n in range(len(name)): - name_pat = add_suffix(name[n], '%05d') - names = [name_pat%i for i in range(n_start_time, n_time)] + name_pat = add_suffix(name[n], "%05d") + names = [name_pat % i for i in range(n_start_time, n_time)] else: if not isinstance(name, list): names = [name] @@ -913,16 +1068,17 @@ def expand_time(name,config): names = name return names + def expand_zones(name, config): names = [] if int(config.NZONES) > 1: if not isinstance(name, list): - name_pat = add_suffix(name,'%d') - names = [name_pat%i for i in range(int(config.NZONES))] + name_pat = add_suffix(name, "%d") + names = [name_pat % i for i in range(int(config.NZONES))] else: for n in range(len(name)): - name_pat = add_suffix(name[n], '%d') - names.extend([name_pat%i for i in range(int(config.NZONES))]) + name_pat = add_suffix(name[n], "%d") + names.extend([name_pat % i for i in range(int(config.NZONES))]) else: if not isinstance(name, list): @@ -931,34 +1087,35 @@ def expand_zones(name, config): names = name return names -def expand_multipoint(name,config): - def_objs = config['OPT_OBJECTIVE'] + +def expand_multipoint(name, config): + def_objs = config["OPT_OBJECTIVE"] objectives = def_objs.keys() names = [] - n_multipoint = len(config['MULTIPOINT_WEIGHT'].split(',')) + n_multipoint = len(config["MULTIPOINT_WEIGHT"].split(",")) if any(elem in optnames_multi for elem in objectives): if not isinstance(name, list): - if '_point0' not in name: - name_pat = add_suffix(name,'point%d') - names = [name_pat%i for i in range(n_multipoint)] + if "_point0" not in name: + name_pat = add_suffix(name, "point%d") + names = [name_pat % i for i in range(n_multipoint)] else: - name_parts = name.split('_point0') + name_parts = name.split("_point0") name_base = name_parts[0] name_suff = name_parts[1] - name_pat = name_base + '_point%d' + name_suff - names = [name_pat%i for i in range(n_multipoint)] + name_pat = name_base + "_point%d" + name_suff + names = [name_pat % i for i in range(n_multipoint)] else: for n in range(len(name)): - if '_point0' not in name: - name_pat = add_suffix(name[n], 'point%d') - names.extend([name_pat%i for i in range(n_multipoint)]) + if "_point0" not in name: + name_pat = add_suffix(name[n], "point%d") + names.extend([name_pat % i for i in range(n_multipoint)]) else: - name_parts = name[n].split('_point0') + name_parts = name[n].split("_point0") name_base = name_parts[0] name_suff = name_parts[1] - name_pat = name_base + '_point%d' + name_suff - names.extend([name_pat%i for i in range(n_multipoint)]) + name_pat = name_base + "_point%d" + name_suff + names.extend([name_pat % i for i in range(n_multipoint)]) else: if not isinstance(name, list): names = [name] @@ -967,23 +1124,23 @@ def expand_multipoint(name,config): return names +def make_link(src, dst): + """make_link(src,dst) + makes a relative link + Inputs: + src - source file + dst - destination to place link -def make_link(src,dst): - """ make_link(src,dst) - makes a relative link - Inputs: - src - source file - dst - destination to place link - - Windows links currently unsupported, will copy file instead + Windows links currently unsupported, will copy file instead """ - if os.path.exists(src): # , 'source file does not exist \n%s' % src + if os.path.exists(src): # , 'source file does not exist \n%s' % src - if os.name == 'nt': + if os.name == "nt": # can't make a link in windows, need to look for other options - if os.path.exists(dst): os.remove(dst) - shutil.copy(src,dst) + if os.path.exists(dst): + os.remove(dst) + shutil.copy(src, dst) else: # find real file, incase source itself is a link @@ -994,91 +1151,99 @@ def make_link(src,dst): dst = os.path.normpath(dst) # check for self referencing - if src == dst: return + if src == dst: + return # find relative folder path - srcfolder = os.path.join( os.path.split(src)[0] ) + '/' - dstfolder = os.path.join( os.path.split(dst)[0] ) + '/' - srcfolder = os.path.relpath(srcfolder,dstfolder) - src = os.path.join( srcfolder, os.path.split(src)[1] ) + srcfolder = os.path.join(os.path.split(src)[0]) + "/" + dstfolder = os.path.join(os.path.split(dst)[0]) + "/" + srcfolder = os.path.relpath(srcfolder, dstfolder) + src = os.path.join(srcfolder, os.path.split(src)[1]) # make unix link - if os.path.exists(dst): os.remove(dst) - os.symlink(src,dst) - -def restart2solution(config,state={}): - """ restart2solution(config,state={}) - moves restart file to solution file, - optionally updates state - direct or adjoint is read from config - adjoint objective is read from config + if os.path.exists(dst): + os.remove(dst) + os.symlink(src, dst) + + +def restart2solution(config, state={}): + """restart2solution(config,state={}) + moves restart file to solution file, + optionally updates state + direct or adjoint is read from config + adjoint objective is read from config """ # direct solution - if config.MATH_PROBLEM == 'DIRECT': - restart = config.RESTART_FILENAME + if config.MATH_PROBLEM == "DIRECT": + restart = config.RESTART_FILENAME solution = config.SOLUTION_FILENAME - restart = restart.split('.')[0] - solution = solution.split('.')[0] + restart = restart.split(".")[0] + solution = solution.split(".")[0] - if 'RESTART_ASCII' in config.get('OUTPUT_FILES', ['RESTART_BINARY']): - restart += '.csv' - solution += '.csv' + if "RESTART_ASCII" in config.get("OUTPUT_FILES", ["RESTART_BINARY"]): + restart += ".csv" + solution += ".csv" else: - restart += '.dat' - solution += '.dat' + restart += ".dat" + solution += ".dat" # expand zones - restarts = expand_zones(restart,config) - solutions = expand_zones(solution,config) + restarts = expand_zones(restart, config) + solutions = expand_zones(solution, config) # expand unsteady time - restarts = expand_time(restarts,config) - solutions = expand_time(solutions,config) + restarts = expand_time(restarts, config) + solutions = expand_time(solutions, config) # move - for res,sol in zip(restarts,solutions): + for res, sol in zip(restarts, solutions): if os.path.exists(res): - shutil.move( res , sol ) + shutil.move(res, sol) # update state if state: state.FILES.DIRECT = solution - if os.path.exists('flow.meta'): - state.FILES.FLOW_META = 'flow.meta' + if os.path.exists("flow.meta"): + state.FILES.FLOW_META = "flow.meta" # adjoint solution - elif any([config.MATH_PROBLEM == 'CONTINUOUS_ADJOINT', config.MATH_PROBLEM == 'DISCRETE_ADJOINT']): - restart = config.RESTART_ADJ_FILENAME + elif any( + [ + config.MATH_PROBLEM == "CONTINUOUS_ADJOINT", + config.MATH_PROBLEM == "DISCRETE_ADJOINT", + ] + ): + restart = config.RESTART_ADJ_FILENAME solution = config.SOLUTION_ADJ_FILENAME - restart = restart.split('.')[0] - solution = solution.split('.')[0] + restart = restart.split(".")[0] + solution = solution.split(".")[0] - if 'RESTART_ASCII' in config.get('OUTPUT_FILES', ['RESTART_BINARY']): - restart += '.csv' - solution += '.csv' + if "RESTART_ASCII" in config.get("OUTPUT_FILES", ["RESTART_BINARY"]): + restart += ".csv" + solution += ".csv" else: - restart += '.dat' - solution += '.dat' + restart += ".dat" + solution += ".dat" # add suffix func_name = config.OBJECTIVE_FUNCTION - suffix = get_adjointSuffix(func_name) - restart = add_suffix(restart,suffix) - solution = add_suffix(solution,suffix) + suffix = get_adjointSuffix(func_name) + restart = add_suffix(restart, suffix) + solution = add_suffix(solution, suffix) # expand zones - restarts = expand_zones(restart,config) - solutions = expand_zones(solution,config) + restarts = expand_zones(restart, config) + solutions = expand_zones(solution, config) # expand unsteady time - restarts = expand_time(restarts,config) - solutions = expand_time(solutions,config) + restarts = expand_time(restarts, config) + solutions = expand_time(solutions, config) # move - for res,sol in zip(restarts,solutions): - shutil.move( res , sol ) + for res, sol in zip(restarts, solutions): + shutil.move(res, sol) # udpate state if "," in func_name: - func_name="COMBO" - ADJ_NAME = 'ADJOINT_' + func_name - if state: state.FILES[ADJ_NAME] = solution + func_name = "COMBO" + ADJ_NAME = "ADJOINT_" + func_name + if state: + state.FILES[ADJ_NAME] = solution else: - raise Exception('unknown math problem') - + raise Exception("unknown math problem") diff --git a/SU2_PY/SU2/opt/project.py b/SU2_PY/SU2/opt/project.py index f8cd6cd218e..5a26924f481 100644 --- a/SU2_PY/SU2/opt/project.py +++ b/SU2_PY/SU2/opt/project.py @@ -3,7 +3,7 @@ ## \file project.py # \brief package for optimization projects # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -34,13 +34,14 @@ import os, sys, shutil, copy, glob, time import numpy as np -from .. import io as su2io +from .. import io as su2io from .. import eval as su2eval from .. import util as su2util from ..io import redirect_folder from ..io import historyOutFields from warnings import warn, simplefilter -#simplefilter(Warning,'ignore') + +# simplefilter(Warning,'ignore') inf = 1.0e20 @@ -49,61 +50,61 @@ # Project Class # ------------------------------------------------------------------- + class Project(object): - """ project = SU2.opt.Project(self,config,state=None, - designs=[],folder='.') - - Starts a project class to manage multiple designs - - Runs multiple design classes, avoiding redundancy - Looks for closest design on restart - Currently only based on DV_VALUE_NEW - Exposes all methods of SU2.eval.design - - Attributes: - config - base config - state - base state - files - base files - designs - list of designs - folder - project working folder - results - project design results - - Methods: - Optimizer Interface - The following methods take a design vector for input - as a list (shape n) or numpy array (shape n or nx1 or 1xn). - Values are returned as floats or lists or lists of lists. - See SU2.eval.obj_f, etc for more detail. - - obj_f(dvs) - objective function : float - obj_df(dvs) - objective function derivatives : list - con_ceq(dvs) - equality constraints : list - con_dceq(dvs) - equality constraint derivatives : list[list] - con_cieq(dvs) - inequality constraints : list - con_dcieq(dvs) - inequality constraint gradients : list[list] - - Functional Interface - The following methods take an objective function name for input. - func(func_name,config) - function of specified name - grad(func_name,method,config) - gradient of specified name, - where method is 'CONTINUOUS_ADJOINT' or 'FINDIFF' - setup config for given dvs with - config = project.unpack_dvs(dvs) + """project = SU2.opt.Project(self,config,state=None, + designs=[],folder='.') + + Starts a project class to manage multiple designs + + Runs multiple design classes, avoiding redundancy + Looks for closest design on restart + Currently only based on DV_VALUE_NEW + Exposes all methods of SU2.eval.design + + Attributes: + config - base config + state - base state + files - base files + designs - list of designs + folder - project working folder + results - project design results + + Methods: + Optimizer Interface + The following methods take a design vector for input + as a list (shape n) or numpy array (shape n or nx1 or 1xn). + Values are returned as floats or lists or lists of lists. + See SU2.eval.obj_f, etc for more detail. + + obj_f(dvs) - objective function : float + obj_df(dvs) - objective function derivatives : list + con_ceq(dvs) - equality constraints : list + con_dceq(dvs) - equality constraint derivatives : list[list] + con_cieq(dvs) - inequality constraints : list + con_dcieq(dvs) - inequality constraint gradients : list[list] + + Functional Interface + The following methods take an objective function name for input. + func(func_name,config) - function of specified name + grad(func_name,method,config) - gradient of specified name, + where method is 'CONTINUOUS_ADJOINT' or 'FINDIFF' + setup config for given dvs with + config = project.unpack_dvs(dvs) """ - _design_folder = 'DESIGNS/DSN_*' - _design_number = '%03d' - + _design_folder = "DESIGNS/DSN_*" + _design_number = "%03d" - def __init__( self, config, state=None , - designs=None, folder='.' , - warn = True ): + def __init__(self, config, state=None, designs=None, folder=".", warn=True): - folder = folder.rstrip('/')+'/' - if '*' in folder: folder = su2io.next_folder(folder) - if designs is None: designs = [] + folder = folder.rstrip("/") + "/" + if "*" in folder: + folder = su2io.next_folder(folder) + if designs is None: + designs = [] - print('New Project: %s' % (folder)) + print("New Project: %s" % (folder)) # setup config config = copy.deepcopy(config) @@ -111,22 +112,22 @@ def __init__( self, config, state=None , # data_dict creation does not preserve the ordering of the config file. # This section ensures that the order of markers and objectives match # It is only needed when more than one objective is used. - def_objs = config['OPT_OBJECTIVE'] - if len(def_objs)>1: + def_objs = config["OPT_OBJECTIVE"] + if len(def_objs) > 1: objectives = def_objs.keys() marker_monitoring = [] weights = [] for i_obj, this_obj in enumerate(objectives): - marker_monitoring+=[def_objs[this_obj]['MARKER']] - weights+=[str(def_objs[this_obj]['SCALE'])] - config['MARKER_MONITORING'] = marker_monitoring - config['OBJECTIVE_WEIGHT'] = ",".join(weights) - config['OBJECTIVE_FUNCTION'] = ",".join(objectives) + marker_monitoring += [def_objs[this_obj]["MARKER"]] + weights += [str(def_objs[this_obj]["SCALE"])] + config["MARKER_MONITORING"] = marker_monitoring + config["OBJECTIVE_WEIGHT"] = ",".join(weights) + config["OBJECTIVE_FUNCTION"] = ",".join(objectives) for this_obj in def_objs: if this_obj in su2io.optnames_multi: - this_obj = this_obj.split('_')[1] - group = historyOutFields[this_obj]['GROUP'] + this_obj = this_obj.split("_")[1] + group = historyOutFields[this_obj]["GROUP"] if not group in config.HISTORY_OUTPUT: config.HISTORY_OUTPUT.append(group) @@ -134,76 +135,80 @@ def __init__( self, config, state=None , if state is None: state = su2io.State() else: - state = copy.deepcopy(state) - state = su2io.State(state) + state = copy.deepcopy(state) + state = su2io.State(state) state.find_files(config) - if 'MESH' not in state.FILES: - raise Exception('Could not find mesh file: %s' % config.MESH_FILENAME) + if "MESH" not in state.FILES: + raise Exception("Could not find mesh file: %s" % config.MESH_FILENAME) - self.config = config # base config - self.state = state # base state - self.files = state.FILES # base files - self.designs = designs # design list - self.folder = folder # project folder - self.results = su2util.ordered_bunch() # project design results + self.config = config # base config + self.state = state # base state + self.files = state.FILES # base files + self.designs = designs # design list + self.folder = folder # project folder + self.results = su2util.ordered_bunch() # project design results # output filenames - self.filename = 'project.pkl' - self.results_filename = 'results.pkl' + self.filename = "project.pkl" + self.results_filename = "results.pkl" # initialize folder with files - pull,link = state.pullnlink(config) + pull, link = state.pullnlink(config) - with redirect_folder(folder,pull,link,force=True): + with redirect_folder(folder, pull, link, force=True): # look for existing designs folders = glob.glob(self._design_folder) - if len(folders)>0: - sys.stdout.write('Removing old designs in 10s.') + if len(folders) > 0: + sys.stdout.write("Removing old designs in 10s.") sys.stdout.flush() - if warn: time.sleep(10) - sys.stdout.write(' Done!\n\n') - for f in folders: shutil.rmtree(f) + if warn: + time.sleep(10) + sys.stdout.write(" Done!\n\n") + for f in folders: + shutil.rmtree(f) #: if existing designs # save project - su2io.save_data(self.filename,self) + su2io.save_data(self.filename, self) return - def _eval(self,config,func,*args): - """ evalautes a config, checking for existing designs - """ + def _eval(self, config, func, *args): + """evalautes a config, checking for existing designs""" - konfig = copy.deepcopy(config) # design config - config = self.config # project config - state = self.state # project state - folder = self.folder # project folder + konfig = copy.deepcopy(config) # design config + config = self.config # project config + state = self.state # project state + folder = self.folder # project folder filename = self.filename # check folder - assert os.path.exists(folder) , 'cannot find project folder %s' % folder + assert os.path.exists(folder), "cannot find project folder %s" % folder # list project files to pull and link - pull,link = state.pullnlink(config) + pull, link = state.pullnlink(config) # project folder redirection, don't overwrite files - with redirect_folder(folder,pull,link,force=False) as push: + with redirect_folder(folder, pull, link, force=False) as push: # start design design = self.new_design(konfig) - if config.get('CONSOLE','VERBOSE') == 'VERBOSE': - print(os.path.join(self.folder,design.folder)) + if config.get("CONSOLE", "VERBOSE") == "VERBOSE": + print(os.path.join(self.folder, design.folder)) timestamp = design.state.tic() # set right option in design config. - if konfig.get('TIME_DOMAIN', 'NO') == 'YES' and konfig.get('RESTART_SOL', 'NO') == 'YES': - design.config['RESTART_SOL'] = 'YES' + if ( + konfig.get("TIME_DOMAIN", "NO") == "YES" + and konfig.get("RESTART_SOL", "NO") == "YES" + ): + design.config["RESTART_SOL"] = "YES" # run design+ - vals = design._eval(func,*args) + vals = design._eval(func, *args) # check for update if design.state.toc(timestamp): @@ -215,7 +220,7 @@ def _eval(self,config,func,*args): self.plot_results() # save data - su2io.save_data(filename,self) + su2io.save_data(filename, self) #: if updated @@ -224,157 +229,160 @@ def _eval(self,config,func,*args): # done, return output return vals - def unpack_dvs(self,dvs): + def unpack_dvs(self, dvs): dvs = copy.deepcopy(dvs) - konfig = copy.deepcopy( self.config ) - if isinstance(dvs, np.ndarray): dvs = dvs.tolist() + konfig = copy.deepcopy(self.config) + if isinstance(dvs, np.ndarray): + dvs = dvs.tolist() konfig.unpack_dvs(dvs) return konfig, dvs - def obj_f(self,dvs): + def obj_f(self, dvs): func = su2eval.obj_f - konfig,dvs = self.unpack_dvs(dvs) - return self._eval(konfig, func,dvs) + konfig, dvs = self.unpack_dvs(dvs) + return self._eval(konfig, func, dvs) - def obj_df(self,dvs): + def obj_df(self, dvs): func = su2eval.obj_df - konfig,dvs = self.unpack_dvs(dvs) - return self._eval(konfig, func,dvs) + konfig, dvs = self.unpack_dvs(dvs) + return self._eval(konfig, func, dvs) - def con_ceq(self,dvs): + def con_ceq(self, dvs): func = su2eval.con_ceq - konfig,dvs = self.unpack_dvs(dvs) - return self._eval(konfig, func,dvs) + konfig, dvs = self.unpack_dvs(dvs) + return self._eval(konfig, func, dvs) - def con_dceq(self,dvs): + def con_dceq(self, dvs): func = su2eval.con_dceq - konfig,dvs = self.unpack_dvs(dvs) - return self._eval(konfig, func,dvs) + konfig, dvs = self.unpack_dvs(dvs) + return self._eval(konfig, func, dvs) - def con_cieq(self,dvs): + def con_cieq(self, dvs): func = su2eval.con_cieq - konfig,dvs = self.unpack_dvs(dvs) - return self._eval(konfig, func,dvs) + konfig, dvs = self.unpack_dvs(dvs) + return self._eval(konfig, func, dvs) - def con_dcieq(self,dvs): + def con_dcieq(self, dvs): func = su2eval.con_dcieq - konfig,dvs = self.unpack_dvs(dvs) - return self._eval(konfig, func,dvs) + konfig, dvs = self.unpack_dvs(dvs) + return self._eval(konfig, func, dvs) - def func(self,func_name,config): + def func(self, func_name, config): func = su2eval.func konfig = copy.deepcopy(config) return self._eval(konfig, func, func_name) - def grad(self,func_name,method,config): + def grad(self, func_name, method, config): func = su2eval.grad konfig = copy.deepcopy(config) - return self._eval(konfig, func, func_name,method) + return self._eval(konfig, func, func_name, method) - def user(self,user_func,config,*args): + def user(self, user_func, config, *args): raise NotImplementedError - #return self._eval(config, user_func,*args) + # return self._eval(config, user_func,*args) - def add_design(self,config): - #func = su2eval.touch # hack - TWL + def add_design(self, config): + # func = su2eval.touch # hack - TWL func = su2eval.skip konfig = copy.deepcopy(config) return self._eval(konfig, func) - def new_design(self,config): - """ finds an existing design for given config - or starts a new design with a closest design - used for restart data + def new_design(self, config): + """finds an existing design for given config + or starts a new design with a closest design + used for restart data """ - # local konfig + # local konfig konfig = copy.deepcopy(config) # find closest design - closest,delta = self.closest_design(konfig) + closest, delta = self.closest_design(konfig) # found existing design if delta == 0.0 and closest: design = closest # start new design else: - design = self.init_design(konfig,closest) + design = self.init_design(konfig, closest) #: if new design return design - def get_design(self,config): + def get_design(self, config): konfig = copy.deepcopy(config) - closest,delta = self.closest_design(konfig) + closest, delta = self.closest_design(konfig) if delta == 0.0 and closest: design = closest else: - raise Exception('design not found for this config') + raise Exception("design not found for this config") return design - def closest_design(self,config): - """ looks for an existing or closest design - given a config + def closest_design(self, config): + """looks for an existing or closest design + given a config """ designs = self.designs - keys_check = ['DV_VALUE_NEW'] + keys_check = ["DV_VALUE_NEW"] if not designs: - return [] , inf + return [], inf diffs = [] for this_design in designs: this_config = this_design.config - distance = config.dist(this_config,keys_check) + distance = config.dist(this_config, keys_check) diffs.append(distance) #: for each design # pick closest design i_min = np.argmin(diffs) - delta = diffs[i_min] + delta = diffs[i_min] closest = designs[i_min] return closest, delta - def init_design(self,config,closest=None): - """ starts a new design - works in project folder + def init_design(self, config, closest=None): + """starts a new design + works in project folder """ konfig = copy.deepcopy(config) - ztate = copy.deepcopy(self.state) - if closest is None: closest = [] + ztate = copy.deepcopy(self.state) + if closest is None: + closest = [] # use closest design as seed if closest: # copy useful state info seed_folder = closest.folder - seed_files = closest.files + seed_files = closest.files for key in seed_files.keys(): # ignore mesh - if key == 'MESH': continue + if key == "MESH": + continue # build file path name = seed_files[key] - if isinstance(name,list): + if isinstance(name, list): built_name = [] for elem in name: - built_name.append(os.path.join(seed_folder,elem)) + built_name.append(os.path.join(seed_folder, elem)) ztate.FILES[key] = built_name else: - name = os.path.join(seed_folder,name) + name = os.path.join(seed_folder, name) # update pull files ztate.FILES[key] = name # name new folder - folder = self._design_folder.replace('*',self._design_number) + folder = self._design_folder.replace("*", self._design_number) folder = folder % (len(self.designs) + 1) # start new design (pulls files to folder) - design = su2eval.Design(konfig,ztate,folder) + design = su2eval.Design(konfig, ztate, folder) # update local state filenames ( ??? why not in Design() ) for key in design.files: name = design.files[key] - if isinstance(name,list): + if isinstance(name, list): built_name = [] for elem in name: built_name.append(os.path.split(elem)[-1]) @@ -388,22 +396,22 @@ def init_design(self,config,closest=None): return design - def compile_results(self,default=np.nan): - """ results = SU2.opt.Project.compile_results(default=np.nan) - builds a Bunch() of design results + def compile_results(self, default=np.nan): + """results = SU2.opt.Project.compile_results(default=np.nan) + builds a Bunch() of design results - Inputs: - default - value for missing values + Inputs: + default - value for missing values - Outputs: - results - state with items filled with list of - values ordered by each design iteration. + Outputs: + results - state with items filled with list of + values ordered by each design iteration. - results.VARIABLES - results.FUNCTIONS - results.GRADIENTS - results.HISTORY.DIRECT - results.HISTORY.ADJOINT_* + results.VARIABLES + results.FUNCTIONS + results.GRADIENTS + results.HISTORY.DIRECT + results.HISTORY.ADJOINT_* """ @@ -415,7 +423,7 @@ def compile_results(self,default=np.nan): n_dv = 0 # populate fields - for i,design in enumerate(self.designs): + for i, design in enumerate(self.designs): for key in design.state.FUNCTIONS.keys(): results.FUNCTIONS[key] = [] for key in design.state.GRADIENTS.keys(): @@ -425,20 +433,20 @@ def compile_results(self,default=np.nan): results.HISTORY[TYPE] = su2util.ordered_bunch() for key in design.state.HISTORY[TYPE].keys(): results.HISTORY[TYPE][key] = [] - this_ndv = len( design.state.design_vector() ) + this_ndv = len(design.state.design_vector()) # check design vectors are of same length if i == 0: n_dv = this_ndv else: if n_dv != this_ndv: - warn('different dv vector length during compile_results()') + warn("different dv vector length during compile_results()") #: for each design # populate results for design in self.designs: this_designvector = design.state.design_vector() - results.VARIABLES.append( this_designvector ) + results.VARIABLES.append(this_designvector) for key in results.FUNCTIONS.keys(): if key in design.state.FUNCTIONS: new_func = design.state.FUNCTIONS[key] @@ -449,14 +457,16 @@ def compile_results(self,default=np.nan): if key in design.state.GRADIENTS: new_grad = design.state.GRADIENTS[key] else: - new_grad = [default] * len( this_designvector ) + new_grad = [default] * len(this_designvector) results.GRADIENTS[key].append(new_grad) for TYPE in results.HISTORY.keys(): for key in results.HISTORY[TYPE].keys(): if key in results.FUNCTIONS.keys(): new_func = results.FUNCTIONS[key][-1] - elif ( TYPE in design.state.HISTORY.keys() and - key in design.state.HISTORY[TYPE].keys() ): + elif ( + TYPE in design.state.HISTORY.keys() + and key in design.state.HISTORY[TYPE].keys() + ): new_func = design.state.HISTORY[TYPE][key][-1] else: new_func = default @@ -465,52 +475,52 @@ def compile_results(self,default=np.nan): # save self.results = results - su2io.save_data(filename,results) + su2io.save_data(filename, results) return self.results def deep_compile(self): - """ Project.deep_compile() - recompiles project using design files saved in each design folder - useful if designs were run outside of project class + """Project.deep_compile() + recompiles project using design files saved in each design folder + useful if designs were run outside of project class """ project_folder = self.folder designs = self.designs with su2io.redirect_folder(project_folder): - for i_dsn,design in enumerate(designs): - design_filename = os.path.join(design.folder,design.filename) + for i_dsn, design in enumerate(designs): + design_filename = os.path.join(design.folder, design.filename) self.designs[i_dsn] = su2io.load_data(design_filename) self.compile_results() - su2io.save_data(self.filename,self) + su2io.save_data(self.filename, self) return def plot_results(self): - """ writes a tecplot file for plotting design results - """ + """writes a tecplot file for plotting design results""" output_format = self.config.TABULAR_FORMAT - functions = self.results.FUNCTIONS - history = self.results.HISTORY + functions = self.results.FUNCTIONS + history = self.results.HISTORY results_plot = su2util.ordered_bunch() - results_plot.EVALUATION = range(1,len(self.designs)+1) + results_plot.EVALUATION = range(1, len(self.designs) + 1) results_plot.update(functions) - results_plot.update(history.get('DIRECT',{})) + results_plot.update(history.get("DIRECT", {})) - if (output_format == 'CSV'): - su2util.write_plot('history_project.csv',output_format,results_plot) + if output_format == "CSV": + su2util.write_plot("history_project.csv", output_format, results_plot) else: - su2util.write_plot('history_project.dat',output_format,results_plot) + su2util.write_plot("history_project.dat", output_format, results_plot) def save(self): with su2io.redirect_folder(self.folder): - su2io.save_data(self.filename,self) + su2io.save_data(self.filename, self) def __repr__(self): - return ' with %i ' % len(self.designs) + return " with %i " % len(self.designs) + def __str__(self): output = self.__repr__() return output diff --git a/SU2_PY/SU2/opt/scipy_tools.py b/SU2_PY/SU2/opt/scipy_tools.py index 012d785e22d..1fdc5d81cca 100644 --- a/SU2_PY/SU2/opt/scipy_tools.py +++ b/SU2_PY/SU2/opt/scipy_tools.py @@ -3,7 +3,7 @@ ## \file scipy_tools.py # \brief tools for interfacing with scipy # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -39,442 +39,488 @@ # Scipy SLSQP # ------------------------------------------------------------------- -def scipy_slsqp(project,x0=None,xb=None,its=100,accu=1e-10,grads=True): - """ result = scipy_slsqp(project,x0=[],xb=[],its=100,accu=1e-10) - Runs the Scipy implementation of SLSQP with - an SU2 project +def scipy_slsqp(project, x0=None, xb=None, its=100, accu=1e-10, grads=True): + """result = scipy_slsqp(project,x0=[],xb=[],its=100,accu=1e-10) - Inputs: - project - an SU2 project - x0 - optional, initial guess - xb - optional, design variable bounds - its - max outer iterations, default 100 - accu - accuracy, default 1e-10 + Runs the Scipy implementation of SLSQP with + an SU2 project - Outputs: - result - the outputs from scipy.fmin_slsqp + Inputs: + project - an SU2 project + x0 - optional, initial guess + xb - optional, design variable bounds + its - max outer iterations, default 100 + accu - accuracy, default 1e-10 + + Outputs: + result - the outputs from scipy.fmin_slsqp """ # import scipy optimizer from scipy.optimize import fmin_slsqp # handle input cases - if x0 is None: x0 = [] - if xb is None: xb = [] + if x0 is None: + x0 = [] + if xb is None: + xb = [] # function handles - func = obj_f - f_eqcons = con_ceq - f_ieqcons = con_cieq + func = obj_f + f_eqcons = con_ceq + f_ieqcons = con_cieq # gradient handles - if project.config.get('GRADIENT_METHOD','NONE') == 'NONE': - fprime = None - fprime_eqcons = None + if project.config.get("GRADIENT_METHOD", "NONE") == "NONE": + fprime = None + fprime_eqcons = None fprime_ieqcons = None else: - fprime = obj_df - fprime_eqcons = con_dceq + fprime = obj_df + fprime_eqcons = con_dceq fprime_ieqcons = con_dcieq # number of design variables - dv_size = project.config['DEFINITION_DV']['SIZE'] - n_dv = sum( dv_size) + dv_size = project.config["DEFINITION_DV"]["SIZE"] + n_dv = sum(dv_size) project.n_dv = n_dv # Initial guess - if not x0: x0 = [0.0]*n_dv + if not x0: + x0 = [0.0] * n_dv # prescale x0 - dv_scales = project.config['DEFINITION_DV']['SCALE'] + dv_scales = project.config["DEFINITION_DV"]["SCALE"] k = 0 for i, dv_scl in enumerate(dv_scales): for j in range(dv_size[i]): - x0[k] =x0[k]/dv_scl; + x0[k] = x0[k] / dv_scl k = k + 1 # scale accuracy - obj = project.config['OPT_OBJECTIVE'] + obj = project.config["OPT_OBJECTIVE"] obj_scale = [] for this_obj in obj.keys(): - obj_scale = obj_scale + [obj[this_obj]['SCALE']] + obj_scale = obj_scale + [obj[this_obj]["SCALE"]] # Only scale the accuracy for single-objective problems: - if len(obj.keys())==1: - accu = accu*obj_scale[0] + if len(obj.keys()) == 1: + accu = accu * obj_scale[0] # scale accuracy eps = 1.0e-04 # optimizer summary - sys.stdout.write('Sequential Least SQuares Programming (SLSQP) parameters:\n') - sys.stdout.write('Number of design variables: ' + str(len(dv_size)) + ' ( ' + str(n_dv) + ' ) \n' ) - sys.stdout.write('Objective function scaling factor: ' + str(obj_scale) + '\n') - sys.stdout.write('Maximum number of iterations: ' + str(its) + '\n') - sys.stdout.write('Requested accuracy: ' + str(accu) + '\n') - sys.stdout.write('Initial guess for the independent variable(s): ' + str(x0) + '\n') - sys.stdout.write('Lower and upper bound for each independent variable: ' + str(xb) + '\n\n') + sys.stdout.write("Sequential Least SQuares Programming (SLSQP) parameters:\n") + sys.stdout.write( + "Number of design variables: " + str(len(dv_size)) + " ( " + str(n_dv) + " ) \n" + ) + sys.stdout.write("Objective function scaling factor: " + str(obj_scale) + "\n") + sys.stdout.write("Maximum number of iterations: " + str(its) + "\n") + sys.stdout.write("Requested accuracy: " + str(accu) + "\n") + sys.stdout.write("Initial guess for the independent variable(s): " + str(x0) + "\n") + sys.stdout.write( + "Lower and upper bound for each independent variable: " + str(xb) + "\n\n" + ) # Run Optimizer - outputs = fmin_slsqp( x0 = x0 , - func = func , - f_eqcons = f_eqcons , - f_ieqcons = f_ieqcons , - fprime = fprime , - fprime_eqcons = fprime_eqcons , - fprime_ieqcons = fprime_ieqcons , - args = (project,) , - bounds = xb , - iter = its , - iprint = 2 , - full_output = True , - acc = accu , - epsilon = eps ) + outputs = fmin_slsqp( + x0=x0, + func=func, + f_eqcons=f_eqcons, + f_ieqcons=f_ieqcons, + fprime=fprime, + fprime_eqcons=fprime_eqcons, + fprime_ieqcons=fprime_ieqcons, + args=(project,), + bounds=xb, + iter=its, + iprint=2, + full_output=True, + acc=accu, + epsilon=eps, + ) # Done return outputs + # ------------------------------------------------------------------- # Scipy CG # ------------------------------------------------------------------- -def scipy_cg(project,x0=None,xb=None,its=100,accu=1e-10,grads=True): - """ result = scipy_cg(project,x0=[],xb=[],its=100,accu=1e-10) - Runs the Scipy implementation of CG with - an SU2 project +def scipy_cg(project, x0=None, xb=None, its=100, accu=1e-10, grads=True): + """result = scipy_cg(project,x0=[],xb=[],its=100,accu=1e-10) + + Runs the Scipy implementation of CG with + an SU2 project - Inputs: - project - an SU2 project - x0 - optional, initial guess - xb - optional, design variable bounds - its - max outer iterations, default 100 - accu - accuracy, default 1e-10 + Inputs: + project - an SU2 project + x0 - optional, initial guess + xb - optional, design variable bounds + its - max outer iterations, default 100 + accu - accuracy, default 1e-10 - Outputs: - result - the outputs from scipy.fmin_slsqp + Outputs: + result - the outputs from scipy.fmin_slsqp """ # import scipy optimizer from scipy.optimize import fmin_cg # handle input cases - if x0 is None: x0 = [] - if xb is None: xb = [] + if x0 is None: + x0 = [] + if xb is None: + xb = [] # function handles - func = obj_f + func = obj_f # gradient handles - if project.config.get('GRADIENT_METHOD','NONE') == 'NONE': - fprime = None + if project.config.get("GRADIENT_METHOD", "NONE") == "NONE": + fprime = None else: - fprime = obj_df + fprime = obj_df # number of design variables - n_dv = len( project.config['DEFINITION_DV']['KIND'] ) + n_dv = len(project.config["DEFINITION_DV"]["KIND"]) project.n_dv = n_dv # Initial guess - if not x0: x0 = [0.0]*n_dv + if not x0: + x0 = [0.0] * n_dv # prescale x0 - dv_scales = project.config['DEFINITION_DV']['SCALE'] - x0 = [ x0[i]/dv_scl for i,dv_scl in enumerate(dv_scales) ] + dv_scales = project.config["DEFINITION_DV"]["SCALE"] + x0 = [x0[i] / dv_scl for i, dv_scl in enumerate(dv_scales)] # scale accuracy - obj = project.config['OPT_OBJECTIVE'] - obj_scale = obj[obj.keys()[0]]['SCALE'] - accu = accu*obj_scale + obj = project.config["OPT_OBJECTIVE"] + obj_scale = obj[obj.keys()[0]]["SCALE"] + accu = accu * obj_scale # scale accuracy eps = 1.0e-04 # optimizer summary - sys.stdout.write('Conjugate gradient (CG) parameters:\n') - sys.stdout.write('Number of design variables: ' + str(n_dv) + '\n') - sys.stdout.write('Objective function scaling factor: ' + str(obj_scale) + '\n') - sys.stdout.write('Maximum number of iterations: ' + str(its) + '\n') - sys.stdout.write('Requested accuracy: ' + str(accu) + '\n') - sys.stdout.write('Initial guess for the independent variable(s): ' + str(x0) + '\n') - sys.stdout.write('Lower and upper bound for each independent variable: ' + str(xb) + '\n\n') + sys.stdout.write("Conjugate gradient (CG) parameters:\n") + sys.stdout.write("Number of design variables: " + str(n_dv) + "\n") + sys.stdout.write("Objective function scaling factor: " + str(obj_scale) + "\n") + sys.stdout.write("Maximum number of iterations: " + str(its) + "\n") + sys.stdout.write("Requested accuracy: " + str(accu) + "\n") + sys.stdout.write("Initial guess for the independent variable(s): " + str(x0) + "\n") + sys.stdout.write( + "Lower and upper bound for each independent variable: " + str(xb) + "\n\n" + ) # Evaluate the objective function (only 1st iteration) - obj_f(x0,project) + obj_f(x0, project) # Run Optimizer - outputs = fmin_cg( x0 = x0 , - f = func , - fprime = fprime , - args = (project,) , - gtol = accu , - epsilon = eps , - maxiter = its , - full_output = True , - disp = True , - retall = True ) - + outputs = fmin_cg( + x0=x0, + f=func, + fprime=fprime, + args=(project,), + gtol=accu, + epsilon=eps, + maxiter=its, + full_output=True, + disp=True, + retall=True, + ) # Done return outputs + # ------------------------------------------------------------------- # Scipy BFGS # ------------------------------------------------------------------- -def scipy_bfgs(project,x0=None,xb=None,its=100,accu=1e-10,grads=True): - """ result = scipy_bfgs(project,x0=[],xb=[],its=100,accu=1e-10) - Runs the Scipy implementation of BFGS with - an SU2 project +def scipy_bfgs(project, x0=None, xb=None, its=100, accu=1e-10, grads=True): + """result = scipy_bfgs(project,x0=[],xb=[],its=100,accu=1e-10) - Inputs: - project - an SU2 project - x0 - optional, initial guess - xb - optional, design variable bounds - its - max outer iterations, default 100 - accu - accuracy, default 1e-10 + Runs the Scipy implementation of BFGS with + an SU2 project - Outputs: - result - the outputs from scipy.fmin_slsqp + Inputs: + project - an SU2 project + x0 - optional, initial guess + xb - optional, design variable bounds + its - max outer iterations, default 100 + accu - accuracy, default 1e-10 + + Outputs: + result - the outputs from scipy.fmin_slsqp """ # import scipy optimizer from scipy.optimize import fmin_bfgs # handle input cases - if x0 is None: x0 = [] - if xb is None: xb = [] + if x0 is None: + x0 = [] + if xb is None: + xb = [] # function handles - func = obj_f + func = obj_f # gradient handles - if project.config.get('GRADIENT_METHOD','NONE') == 'NONE': - fprime = None + if project.config.get("GRADIENT_METHOD", "NONE") == "NONE": + fprime = None else: - fprime = obj_df + fprime = obj_df # number of design variables - n_dv = len( project.config['DEFINITION_DV']['KIND'] ) + n_dv = len(project.config["DEFINITION_DV"]["KIND"]) project.n_dv = n_dv # Initial guess - if not x0: x0 = [0.0]*n_dv + if not x0: + x0 = [0.0] * n_dv # prescale x0 - dv_scales = project.config['DEFINITION_DV']['SCALE'] - x0 = [ x0[i]/dv_scl for i,dv_scl in enumerate(dv_scales) ] + dv_scales = project.config["DEFINITION_DV"]["SCALE"] + x0 = [x0[i] / dv_scl for i, dv_scl in enumerate(dv_scales)] # scale accuracy - obj = project.config['OPT_OBJECTIVE'] - obj_scale = obj[obj.keys()[0]]['SCALE'] - accu = accu*obj_scale + obj = project.config["OPT_OBJECTIVE"] + obj_scale = obj[obj.keys()[0]]["SCALE"] + accu = accu * obj_scale # scale accuracy eps = 1.0e-04 # optimizer summary - sys.stdout.write('Broyden-Fletcher-Goldfarb-Shanno (BFGS) parameters:\n') - sys.stdout.write('Number of design variables: ' + str(n_dv) + '\n') - sys.stdout.write('Objective function scaling factor: ' + str(obj_scale) + '\n') - sys.stdout.write('Maximum number of iterations: ' + str(its) + '\n') - sys.stdout.write('Requested accuracy: ' + str(accu) + '\n') - sys.stdout.write('Initial guess for the independent variable(s): ' + str(x0) + '\n') - sys.stdout.write('Lower and upper bound for each independent variable: ' + str(xb) + '\n\n') + sys.stdout.write("Broyden-Fletcher-Goldfarb-Shanno (BFGS) parameters:\n") + sys.stdout.write("Number of design variables: " + str(n_dv) + "\n") + sys.stdout.write("Objective function scaling factor: " + str(obj_scale) + "\n") + sys.stdout.write("Maximum number of iterations: " + str(its) + "\n") + sys.stdout.write("Requested accuracy: " + str(accu) + "\n") + sys.stdout.write("Initial guess for the independent variable(s): " + str(x0) + "\n") + sys.stdout.write( + "Lower and upper bound for each independent variable: " + str(xb) + "\n\n" + ) # Evaluate the objective function (only 1st iteration) - obj_f(x0,project) + obj_f(x0, project) # Run Optimizer - outputs = fmin_bfgs( x0 = x0 , - f = func , - fprime = fprime , - args = (project,) , - gtol = accu , - epsilon = eps , - maxiter = its , - full_output = True , - disp = True , - retall = True ) + outputs = fmin_bfgs( + x0=x0, + f=func, + fprime=fprime, + args=(project,), + gtol=accu, + epsilon=eps, + maxiter=its, + full_output=True, + disp=True, + retall=True, + ) # Done return outputs -def scipy_powell(project,x0=None,xb=None,its=100,accu=1e-10,grads=False): - """ result = scipy_powell(project,x0=[],xb=[],its=100,accu=1e-10) - Runs the Scipy implementation of Powell's method with - an SU2 project +def scipy_powell(project, x0=None, xb=None, its=100, accu=1e-10, grads=False): + """result = scipy_powell(project,x0=[],xb=[],its=100,accu=1e-10) + + Runs the Scipy implementation of Powell's method with + an SU2 project - Inputs: - project - an SU2 project - x0 - optional, initial guess - xb - optional, design variable bounds - its - max outer iterations, default 100 - accu - accuracy, default 1e-10 + Inputs: + project - an SU2 project + x0 - optional, initial guess + xb - optional, design variable bounds + its - max outer iterations, default 100 + accu - accuracy, default 1e-10 - Outputs: - result - the outputs from scipy.fmin_slsqp + Outputs: + result - the outputs from scipy.fmin_slsqp """ # import scipy optimizer from scipy.optimize import fmin_powell # handle input cases - if x0 is None: x0 = [] + if x0 is None: + x0 = [] # function handles - func = obj_f + func = obj_f # number of design variables - n_dv = len( project.config['DEFINITION_DV']['KIND'] ) + n_dv = len(project.config["DEFINITION_DV"]["KIND"]) project.n_dv = n_dv # Initial guess - if not x0: x0 = [0.0]*n_dv + if not x0: + x0 = [0.0] * n_dv # prescale x0 - dv_scales = project.config['DEFINITION_DV']['SCALE'] - x0 = [ x0[i]/dv_scl for i,dv_scl in enumerate(dv_scales) ] + dv_scales = project.config["DEFINITION_DV"]["SCALE"] + x0 = [x0[i] / dv_scl for i, dv_scl in enumerate(dv_scales)] # scale accuracy - obj = project.config['OPT_OBJECTIVE'] - obj_scale = obj[obj.keys()[0]]['SCALE'] - accu = accu*obj_scale + obj = project.config["OPT_OBJECTIVE"] + obj_scale = obj[obj.keys()[0]]["SCALE"] + accu = accu * obj_scale # scale accuracy eps = 1.0e-04 # optimizer summary - sys.stdout.write('Powells method parameters:\n') - sys.stdout.write('Number of design variables: ' + str(n_dv) + '\n') - sys.stdout.write('Objective function scaling factor: ' + str(obj_scale) + '\n') - sys.stdout.write('Maximum number of iterations: ' + str(its) + '\n') - sys.stdout.write('Requested accuracy: ' + str(accu) + '\n') + sys.stdout.write("Powells method parameters:\n") + sys.stdout.write("Number of design variables: " + str(n_dv) + "\n") + sys.stdout.write("Objective function scaling factor: " + str(obj_scale) + "\n") + sys.stdout.write("Maximum number of iterations: " + str(its) + "\n") + sys.stdout.write("Requested accuracy: " + str(accu) + "\n") # Evaluate the objective function (only 1st iteration) - obj_f(x0,project) + obj_f(x0, project) # Run Optimizer - outputs = fmin_powell( x0 = x0 , - func = func , - args = (project,) , - ftol = accu , - maxiter = its , - full_output = True , - disp = True , - retall = True ) + outputs = fmin_powell( + x0=x0, + func=func, + args=(project,), + ftol=accu, + maxiter=its, + full_output=True, + disp=True, + retall=True, + ) # Done return outputs -def obj_f(x,project): - """ obj = obj_f(x,project) - Objective Function - SU2 Project interface to scipy.fmin_slsqp +def obj_f(x, project): + """obj = obj_f(x,project) - su2: minimize f(x), list[nobj] - scipy_slsqp: minimize f(x), float + Objective Function + SU2 Project interface to scipy.fmin_slsqp + + su2: minimize f(x), list[nobj] + scipy_slsqp: minimize f(x), float """ obj_list = project.obj_f(x) obj = 0 for this_obj in obj_list: - obj = obj+this_obj + obj = obj + this_obj return obj -def obj_df(x,project): - """ dobj = obj_df(x,project) - Objective Function Gradients - SU2 Project interface to scipy.fmin_slsqp +def obj_df(x, project): + """dobj = obj_df(x,project) + + Objective Function Gradients + SU2 Project interface to scipy.fmin_slsqp - su2: df(x), list[nobj x dim] - scipy_slsqp: df(x), ndarray[dim] + su2: df(x), list[nobj x dim] + scipy_slsqp: df(x), ndarray[dim] """ dobj_list = project.obj_df(x) - dobj=[0.0]*len(dobj_list[0]) + dobj = [0.0] * len(dobj_list[0]) for this_dobj in dobj_list: - idv=0 + idv = 0 for this_dv_dobj in this_dobj: - dobj[idv] = dobj[idv]+this_dv_dobj; - idv+=1 - dobj = array( dobj ) + dobj[idv] = dobj[idv] + this_dv_dobj + idv += 1 + dobj = array(dobj) return dobj -def con_ceq(x,project): - """ cons = con_ceq(x,project) - Equality Constraint Functions - SU2 Project interface to scipy.fmin_slsqp +def con_ceq(x, project): + """cons = con_ceq(x,project) - su2: ceq(x) = 0.0, list[nceq] - scipy_slsqp: ceq(x) = 0.0, ndarray[nceq] + Equality Constraint Functions + SU2 Project interface to scipy.fmin_slsqp + + su2: ceq(x) = 0.0, list[nceq] + scipy_slsqp: ceq(x) = 0.0, ndarray[nceq] """ cons = project.con_ceq(x) - if cons: cons = array(cons) - else: cons = zeros([0]) + if cons: + cons = array(cons) + else: + cons = zeros([0]) return cons -def con_dceq(x,project): - """ dcons = con_dceq(x,project) - Equality Constraint Gradients - SU2 Project interface to scipy.fmin_slsqp +def con_dceq(x, project): + """dcons = con_dceq(x,project) - su2: dceq(x), list[nceq x dim] - scipy_slsqp: dceq(x), ndarray[nceq x dim] + Equality Constraint Gradients + SU2 Project interface to scipy.fmin_slsqp + + su2: dceq(x), list[nceq x dim] + scipy_slsqp: dceq(x), ndarray[nceq x dim] """ dcons = project.con_dceq(x) dim = project.n_dv - if dcons: dcons = array(dcons) - else: dcons = zeros([0,dim]) + if dcons: + dcons = array(dcons) + else: + dcons = zeros([0, dim]) return dcons -def con_cieq(x,project): - """ cons = con_cieq(x,project) - Inequality Constraints - SU2 Project interface to scipy.fmin_slsqp +def con_cieq(x, project): + """cons = con_cieq(x,project) - su2: cieq(x) < 0.0, list[ncieq] - scipy_slsqp: cieq(x) > 0.0, ndarray[ncieq] + Inequality Constraints + SU2 Project interface to scipy.fmin_slsqp + + su2: cieq(x) < 0.0, list[ncieq] + scipy_slsqp: cieq(x) > 0.0, ndarray[ncieq] """ cons = project.con_cieq(x) - if cons: cons = array(cons) - else: cons = zeros([0]) + if cons: + cons = array(cons) + else: + cons = zeros([0]) return -cons -def con_dcieq(x,project): - """ dcons = con_dcieq(x,project) - Inequality Constraint Gradients - SU2 Project interface to scipy.fmin_slsqp +def con_dcieq(x, project): + """dcons = con_dcieq(x,project) - su2: dcieq(x), list[ncieq x dim] - scipy_slsqp: dcieq(x), ndarray[ncieq x dim] + Inequality Constraint Gradients + SU2 Project interface to scipy.fmin_slsqp + + su2: dcieq(x), list[ncieq x dim] + scipy_slsqp: dcieq(x), ndarray[ncieq x dim] """ dcons = project.con_dcieq(x) dim = project.n_dv - if dcons: dcons = array(dcons) - else: dcons = zeros([0,dim]) + if dcons: + dcons = array(dcons) + else: + dcons = zeros([0, dim]) return -dcons diff --git a/SU2_PY/SU2/run/__init__.py b/SU2_PY/SU2/run/__init__.py index 0e092f51e71..7396a698fd1 100644 --- a/SU2_PY/SU2/run/__init__.py +++ b/SU2_PY/SU2/run/__init__.py @@ -1,17 +1,10 @@ # SU2/run/__init__.py -from .interface import ( - build_command , - run_command , - CFD , - DEF , - DOT , - SOL , - SOL_FSI) +from .interface import build_command, run_command, CFD, DEF, DOT, SOL, SOL_FSI -from .direct import direct -from .adjoint import adjoint +from .direct import direct +from .adjoint import adjoint from .projection import projection -from .deform import deform -from .geometry import geometry -from .merge import merge +from .deform import deform +from .geometry import geometry +from .merge import merge diff --git a/SU2_PY/SU2/run/adjoint.py b/SU2_PY/SU2/run/adjoint.py index 42a18d7b14e..394bbae7b94 100644 --- a/SU2_PY/SU2/run/adjoint.py +++ b/SU2_PY/SU2/run/adjoint.py @@ -3,7 +3,7 @@ ## \file adjoint.py # \brief python package for running adjoint problems # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -31,78 +31,83 @@ import copy -from .. import io as su2io -from .merge import merge as su2merge -from .interface import CFD as SU2_CFD +from .. import io as su2io +from .merge import merge as su2merge +from .interface import CFD as SU2_CFD # ---------------------------------------------------------------------- # Adjoint Simulation # ---------------------------------------------------------------------- -def adjoint( config ): - """ info = SU2.run.adjoint(config) - Runs an adjoint analysis with: - SU2.run.decomp() - SU2.run.CFD() - SU2.run.merge() +def adjoint(config): + """info = SU2.run.adjoint(config) - Assumptions: - Does not run Gradient Projection - Does not rename restart filename to solution filename - Adds 'adjoint' suffix to convergence filename + Runs an adjoint analysis with: + SU2.run.decomp() + SU2.run.CFD() + SU2.run.merge() - Outputs: - info - SU2 State with keys: - HISTORY.ADJOINT_NAME - FILES.ADJOINT_NAME + Assumptions: + Does not run Gradient Projection + Does not rename restart filename to solution filename + Adds 'adjoint' suffix to convergence filename - Updates: - config.MATH_PROBLEM + Outputs: + info - SU2 State with keys: + HISTORY.ADJOINT_NAME + FILES.ADJOINT_NAME - Executes in: - ./ + Updates: + config.MATH_PROBLEM + + Executes in: + ./ """ # local copy konfig = copy.deepcopy(config) # setup problem - if konfig.get('GRADIENT_METHOD', 'CONTINUOUS_ADJOINT') == 'DISCRETE_ADJOINT': - konfig['MATH_PROBLEM'] = 'DISCRETE_ADJOINT' + if konfig.get("GRADIENT_METHOD", "CONTINUOUS_ADJOINT") == "DISCRETE_ADJOINT": + konfig["MATH_PROBLEM"] = "DISCRETE_ADJOINT" else: - konfig['MATH_PROBLEM'] = 'CONTINUOUS_ADJOINT' + konfig["MATH_PROBLEM"] = "CONTINUOUS_ADJOINT" - konfig['CONV_FILENAME'] = konfig['CONV_FILENAME'] + '_adjoint' + konfig["CONV_FILENAME"] = konfig["CONV_FILENAME"] + "_adjoint" # Run Solution SU2_CFD(konfig) # merge - konfig['SOLUTION_ADJ_FILENAME'] = konfig['RESTART_ADJ_FILENAME'] + konfig["SOLUTION_ADJ_FILENAME"] = konfig["RESTART_ADJ_FILENAME"] su2merge(konfig) # filenames - plot_format = konfig.get('TABULAR_FORMAT', 'CSV') - plot_extension = su2io.get_extension(plot_format) - history_filename = konfig['CONV_FILENAME'] + plot_extension - special_cases = su2io.get_specialCases(konfig) + plot_format = konfig.get("TABULAR_FORMAT", "CSV") + plot_extension = su2io.get_extension(plot_format) + history_filename = konfig["CONV_FILENAME"] + plot_extension + special_cases = su2io.get_specialCases(konfig) # get history - history = su2io.read_history( history_filename, config.NZONES ) + history = su2io.read_history(history_filename, config.NZONES) # update super config - config.update({ 'MATH_PROBLEM' : konfig['MATH_PROBLEM'] , - 'OBJECTIVE_FUNCTION' : konfig['OBJECTIVE_FUNCTION'] }) + config.update( + { + "MATH_PROBLEM": konfig["MATH_PROBLEM"], + "OBJECTIVE_FUNCTION": konfig["OBJECTIVE_FUNCTION"], + } + ) # files out - objective = konfig['OBJECTIVE_FUNCTION'] + objective = konfig["OBJECTIVE_FUNCTION"] if "," in objective: - objective="COMBO" - adj_title = 'ADJOINT_' + objective - suffix = su2io.get_adjointSuffix(objective) - restart_name = konfig['RESTART_FILENAME'] - restart_name = su2io.add_suffix(restart_name,suffix) + objective = "COMBO" + adj_title = "ADJOINT_" + objective + suffix = su2io.get_adjointSuffix(objective) + restart_name = konfig["RESTART_FILENAME"] + restart_name = su2io.add_suffix(restart_name, suffix) # info out info = su2io.State() diff --git a/SU2_PY/SU2/run/deform.py b/SU2_PY/SU2/run/deform.py index 2c8de878a15..28b033621a1 100644 --- a/SU2_PY/SU2/run/deform.py +++ b/SU2_PY/SU2/run/deform.py @@ -3,7 +3,7 @@ ## \file deform.py # \brief python package for deforming meshes # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -31,7 +31,7 @@ import copy -from .. import io as su2io +from .. import io as su2io from .interface import DEF as SU2_DEF @@ -39,66 +39,75 @@ # Mesh Deformation # ---------------------------------------------------------------------- -def deform ( config, dv_new=None, dv_old=None ): - """ info = SU2.run.deform(config,dv_new=[],dv_old=[]) - Deforms mesh with: - SU2.run.decomp() - SU2.run.DEF() +def deform(config, dv_new=None, dv_old=None): + """info = SU2.run.deform(config,dv_new=[],dv_old=[]) - Assumptions: - If optional dv_new ommitted, config is setup for deformation - If using dv_old, must provide dv_new - Adds 'deform' suffix to mesh output name + Deforms mesh with: + SU2.run.decomp() + SU2.run.DEF() - Outputs: - info - SU2 State with keys: - HISTORY.ADJOINT_NAME - FILES.ADJOINT_NAME + Assumptions: + If optional dv_new ommitted, config is setup for deformation + If using dv_old, must provide dv_new + Adds 'deform' suffix to mesh output name - Updates: - config.MESH_FILENAME - config.DV_VALUE_OLD = config.DV_VALUE_NEW + Outputs: + info - SU2 State with keys: + HISTORY.ADJOINT_NAME + FILES.ADJOINT_NAME - Executes in: - ./ + Updates: + config.MESH_FILENAME + config.DV_VALUE_OLD = config.DV_VALUE_NEW + + Executes in: + ./ """ - if dv_new is None: dv_new = [] - if dv_old is None: dv_old = [] + if dv_new is None: + dv_new = [] + if dv_old is None: + dv_old = [] # error check - if dv_old and not dv_new: raise Exception('must provide dv_old with dv_new') + if dv_old and not dv_new: + raise Exception("must provide dv_old with dv_new") # local copy konfig = copy.deepcopy(config) # unpack design variables - if dv_new: konfig.unpack_dvs(dv_new,dv_old) + if dv_new: + konfig.unpack_dvs(dv_new, dv_old) # redundancy check - if konfig['DV_VALUE_NEW'] == konfig['DV_VALUE_OLD']: + if konfig["DV_VALUE_NEW"] == konfig["DV_VALUE_OLD"]: info = su2io.State() info.FILES.MESH = konfig.MESH_FILENAME info.VARIABLES.DV_VALUE_NEW = konfig.DV_VALUE_NEW return info # setup mesh name - suffix = 'deform' - mesh_name = konfig['MESH_FILENAME'] - meshname_suffixed = su2io.add_suffix( mesh_name , suffix ) - konfig['MESH_OUT_FILENAME'] = meshname_suffixed + suffix = "deform" + mesh_name = konfig["MESH_FILENAME"] + meshname_suffixed = su2io.add_suffix(mesh_name, suffix) + konfig["MESH_OUT_FILENAME"] = meshname_suffixed # Run Deformation SU2_DEF(konfig) # update super config - config.update({ 'MESH_FILENAME' : konfig['MESH_OUT_FILENAME'] , - 'DV_KIND' : konfig['DV_KIND'] , - 'DV_MARKER' : konfig['DV_MARKER'] , - 'DV_PARAM' : konfig['DV_PARAM'] , - 'DV_VALUE_OLD' : konfig['DV_VALUE_NEW'] , - 'DV_VALUE_NEW' : konfig['DV_VALUE_NEW'] }) + config.update( + { + "MESH_FILENAME": konfig["MESH_OUT_FILENAME"], + "DV_KIND": konfig["DV_KIND"], + "DV_MARKER": konfig["DV_MARKER"], + "DV_PARAM": konfig["DV_PARAM"], + "DV_VALUE_OLD": konfig["DV_VALUE_NEW"], + "DV_VALUE_NEW": konfig["DV_VALUE_NEW"], + } + ) # not modified: config['MESH_OUT_FILENAME'] # info out @@ -108,4 +117,5 @@ def deform ( config, dv_new=None, dv_old=None ): return info + #: def deform() diff --git a/SU2_PY/SU2/run/direct.py b/SU2_PY/SU2/run/direct.py index 6ce9dd050d9..98ef77ea4e6 100644 --- a/SU2_PY/SU2/run/direct.py +++ b/SU2_PY/SU2/run/direct.py @@ -3,7 +3,7 @@ ## \file direct.py # \brief python package for running direct solutions # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -31,47 +31,48 @@ import copy -from .. import io as su2io -from .merge import merge as su2merge -from .interface import CFD as SU2_CFD +from .. import io as su2io +from .merge import merge as su2merge +from .interface import CFD as SU2_CFD # ---------------------------------------------------------------------- # Direct Simulation # ---------------------------------------------------------------------- -def direct ( config ): - """ info = SU2.run.direct(config) - Runs an adjoint analysis with: - SU2.run.decomp() - SU2.run.CFD() - SU2.run.merge() +def direct(config): + """info = SU2.run.direct(config) - Assumptions: - Does not rename restart filename to solution filename - Adds 'direct' suffix to convergence filename + Runs an adjoint analysis with: + SU2.run.decomp() + SU2.run.CFD() + SU2.run.merge() - Outputs: - info - SU2 State with keys: - FUNCTIONS - HISTORY.DIRECT - FILES.DIRECT + Assumptions: + Does not rename restart filename to solution filename + Adds 'direct' suffix to convergence filename - Updates: - config.MATH_PROBLEM + Outputs: + info - SU2 State with keys: + FUNCTIONS + HISTORY.DIRECT + FILES.DIRECT - Executes in: - ./ + Updates: + config.MATH_PROBLEM + + Executes in: + ./ """ # local copy konfig = copy.deepcopy(config) # setup direct problem - konfig['MATH_PROBLEM'] = 'DIRECT' - konfig['CONV_FILENAME'] = konfig['CONV_FILENAME'] + '_direct' + konfig["MATH_PROBLEM"] = "DIRECT" + konfig["CONV_FILENAME"] = konfig["CONV_FILENAME"] + "_direct" - direct_diff = konfig.get('DIRECT_DIFF','NO') == "YES" + direct_diff = konfig.get("DIRECT_DIFF", "NO") == "YES" # Run Solution SU2_CFD(konfig) @@ -80,61 +81,73 @@ def direct ( config ): multizone_cases = su2io.get_multizone(konfig) # merge - konfig['SOLUTION_FILENAME'] = konfig['RESTART_FILENAME'] - if 'FLUID_STRUCTURE_INTERACTION' in multizone_cases: - konfig['SOLUTION_FILENAME'] = konfig['RESTART_FILENAME'] + konfig["SOLUTION_FILENAME"] = konfig["RESTART_FILENAME"] + if "FLUID_STRUCTURE_INTERACTION" in multizone_cases: + konfig["SOLUTION_FILENAME"] = konfig["RESTART_FILENAME"] # filenames - plot_format = konfig.get('TABULAR_FORMAT', 'CSV') - plot_extension = su2io.get_extension(plot_format) + plot_format = konfig.get("TABULAR_FORMAT", "CSV") + plot_extension = su2io.get_extension(plot_format) # adapt the history_filename, if a restart solution is chosen # check for 'RESTART_ITER' is to avoid forced restart situation in "compute_polar.py"... - if konfig.get('RESTART_SOL','NO') == 'YES' and konfig.get('RESTART_ITER',1) != 1: - if konfig.get('CONFIG_LIST',[]) != []: - konfig['CONV_FILENAME'] = 'config_CFD' # master cfg is always config_CFD. Hardcoded names are prob nt ideal. - restart_iter = '_'+str(konfig['RESTART_ITER']).zfill(5) - history_filename = konfig['CONV_FILENAME'] + restart_iter + plot_extension + if konfig.get("RESTART_SOL", "NO") == "YES" and konfig.get("RESTART_ITER", 1) != 1: + if konfig.get("CONFIG_LIST", []) != []: + konfig[ + "CONV_FILENAME" + ] = "config_CFD" # master cfg is always config_CFD. Hardcoded names are prob nt ideal. + restart_iter = "_" + str(konfig["RESTART_ITER"]).zfill(5) + history_filename = konfig["CONV_FILENAME"] + restart_iter + plot_extension else: - if konfig.get('CONFIG_LIST',[]) != []: - konfig['CONV_FILENAME'] = 'config_CFD' - history_filename = konfig['CONV_FILENAME'] + plot_extension - + if konfig.get("CONFIG_LIST", []) != []: + konfig["CONV_FILENAME"] = "config_CFD" + history_filename = konfig["CONV_FILENAME"] + plot_extension - special_cases = su2io.get_specialCases(konfig) + special_cases = su2io.get_specialCases(konfig) # averaging final iterations - final_avg = config.get('ITER_AVERAGE_OBJ',0) + final_avg = config.get("ITER_AVERAGE_OBJ", 0) # get chosen windowing function, default is square - wnd_fct = config.get('WINDOW_FUNCTION', 'SQUARE') + wnd_fct = config.get("WINDOW_FUNCTION", "SQUARE") # get history and objectives - history = su2io.read_history( history_filename , config.NZONES) - aerodynamics = su2io.read_aerodynamics( history_filename , config.NZONES, special_cases, final_avg, wnd_fct ) + history = su2io.read_history(history_filename, config.NZONES) + aerodynamics = su2io.read_aerodynamics( + history_filename, config.NZONES, special_cases, final_avg, wnd_fct + ) # update super config - config.update({ 'MATH_PROBLEM' : konfig['MATH_PROBLEM'] }) + config.update({"MATH_PROBLEM": konfig["MATH_PROBLEM"]}) # info out info = su2io.State() - info.FUNCTIONS.update( aerodynamics ) - info.FILES.DIRECT = konfig['RESTART_FILENAME'] - if 'INV_DESIGN_CP' in special_cases: - info.FILES.TARGET_CP = 'TargetCp.dat' - if 'INV_DESIGN_HEATFLUX' in special_cases: - info.FILES.TARGET_HEATFLUX = 'TargetHeatFlux.dat' + info.FUNCTIONS.update(aerodynamics) + info.FILES.DIRECT = konfig["RESTART_FILENAME"] + if "INV_DESIGN_CP" in special_cases: + info.FILES.TARGET_CP = "TargetCp.dat" + if "INV_DESIGN_HEATFLUX" in special_cases: + info.FILES.TARGET_HEATFLUX = "TargetHeatFlux.dat" info.HISTORY.DIRECT = history - '''If WINDOW_CAUCHY_CRIT is activated and the time marching converged before the final time has been reached, - store the information for the adjoint run''' - if config.get('WINDOW_CAUCHY_CRIT', 'NO') == 'YES' and config.TIME_MARCHING != 'NO': - konfig['TIME_ITER'] = int(info.HISTORY.DIRECT.Time_Iter[-1] + 1) # update the last iteration - if konfig['UNST_ADJOINT_ITER'] > konfig['TIME_ITER']: - konfig['ITER_AVERAGE_OBJ'] = max(0,konfig['ITER_AVERAGE_OBJ'] -(konfig['UNST_ADJOINT_ITER']-konfig['TIME_ITER'])) - konfig['UNST_ADJOINT_ITER'] = konfig['TIME_ITER'] - - info['WND_CAUCHY_DATA'] = {'TIME_ITER': konfig['TIME_ITER'], 'UNST_ADJOINT_ITER': konfig['UNST_ADJOINT_ITER'], - 'ITER_AVERAGE_OBJ': konfig['ITER_AVERAGE_OBJ']} + """If WINDOW_CAUCHY_CRIT is activated and the time marching converged before the final time has been reached, + store the information for the adjoint run""" + if config.get("WINDOW_CAUCHY_CRIT", "NO") == "YES" and config.TIME_MARCHING != "NO": + konfig["TIME_ITER"] = int( + info.HISTORY.DIRECT.Time_Iter[-1] + 1 + ) # update the last iteration + if konfig["UNST_ADJOINT_ITER"] > konfig["TIME_ITER"]: + konfig["ITER_AVERAGE_OBJ"] = max( + 0, + konfig["ITER_AVERAGE_OBJ"] + - (konfig["UNST_ADJOINT_ITER"] - konfig["TIME_ITER"]), + ) + konfig["UNST_ADJOINT_ITER"] = konfig["TIME_ITER"] + + info["WND_CAUCHY_DATA"] = { + "TIME_ITER": konfig["TIME_ITER"], + "UNST_ADJOINT_ITER": konfig["UNST_ADJOINT_ITER"], + "ITER_AVERAGE_OBJ": konfig["ITER_AVERAGE_OBJ"], + } su2merge(konfig) diff --git a/SU2_PY/SU2/run/geometry.py b/SU2_PY/SU2/run/geometry.py index 5180d6862b0..3257a332f10 100644 --- a/SU2_PY/SU2/run/geometry.py +++ b/SU2_PY/SU2/run/geometry.py @@ -3,7 +3,7 @@ ## \file geometry.py # \brief python package for running geometry analyses # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -31,66 +31,68 @@ import copy -from .. import io as su2io -from .interface import GEO as SU2_GEO +from .. import io as su2io +from .interface import GEO as SU2_GEO from ..util import ordered_bunch # ---------------------------------------------------------------------- # Direct Simulation # ---------------------------------------------------------------------- -def geometry ( config , step = 1e-3 ): - """ info = SU2.run.geometry(config) - Runs an geometry analysis with: - SU2.run.decomp() - SU2.run.GEO() +def geometry(config, step=1e-3): + """info = SU2.run.geometry(config) - Assumptions: - Performs both function and gradient analysis + Runs an geometry analysis with: + SU2.run.decomp() + SU2.run.GEO() - Inputs: - config - an SU2 configuration - step - gradient finite difference step if config.GEO_MODE=GRADIENT + Assumptions: + Performs both function and gradient analysis - Outputs: - info - SU2 State with keys: - FUNCTIONS - GRADIENTS + Inputs: + config - an SU2 configuration + step - gradient finite difference step if config.GEO_MODE=GRADIENT - Updates: + Outputs: + info - SU2 State with keys: + FUNCTIONS + GRADIENTS - Executes in: - ./ + Updates: + + Executes in: + ./ """ # local copy konfig = copy.deepcopy(config) # unpack - function_name = konfig['GEO_PARAM'] - tabular_format = konfig.get('TABULAR_FORMAT', 'CSV') - func_filename = konfig['VALUE_OBJFUNC_FILENAME'] - grad_filename = konfig['GRAD_OBJFUNC_FILENAME'] - - if tabular_format == 'CSV': - func_filename = func_filename.split('.')[0] + '.csv' - grad_filename = grad_filename.split('.')[0] + '.csv' + function_name = konfig["GEO_PARAM"] + tabular_format = konfig.get("TABULAR_FORMAT", "CSV") + func_filename = konfig["VALUE_OBJFUNC_FILENAME"] + grad_filename = konfig["GRAD_OBJFUNC_FILENAME"] + + if tabular_format == "CSV": + func_filename = func_filename.split(".")[0] + ".csv" + grad_filename = grad_filename.split(".")[0] + ".csv" else: - func_filename = func_filename.split('.')[0] + '.dat' - grad_filename = grad_filename.split('.')[0] + '.dat' - + func_filename = func_filename.split(".")[0] + ".dat" + grad_filename = grad_filename.split(".")[0] + ".dat" # choose dv values - Definition_DV = konfig['DEFINITION_DV'] - n_DV = len(Definition_DV['KIND']) - if isinstance(step,list): - assert len(step) == n_DV , 'unexpected step vector length' + Definition_DV = konfig["DEFINITION_DV"] + n_DV = len(Definition_DV["KIND"]) + if isinstance(step, list): + assert len(step) == n_DV, "unexpected step vector length" else: - step = [step]*n_DV - dv_old = [0.0]*n_DV # SU2_DOT input requirement, assumes linear superposition of design variables + step = [step] * n_DV + dv_old = [ + 0.0 + ] * n_DV # SU2_DOT input requirement, assumes linear superposition of design variables dv_new = step - konfig.unpack_dvs(dv_new,dv_old) + konfig.unpack_dvs(dv_new, dv_old) # Run Solution SU2_GEO(konfig) @@ -99,15 +101,15 @@ def geometry ( config , step = 1e-3 ): info = su2io.State() # get function values - if konfig.GEO_MODE == 'FUNCTION': + if konfig.GEO_MODE == "FUNCTION": functions = su2io.tools.read_plot(func_filename) - for key,value in functions.items(): + for key, value in functions.items(): functions[key] = value[0] - info.FUNCTIONS.update( functions ) + info.FUNCTIONS.update(functions) # get gradient_values - if konfig.GEO_MODE == 'GRADIENT': + if konfig.GEO_MODE == "GRADIENT": gradients = su2io.tools.read_plot(grad_filename) - info.GRADIENTS.update( gradients ) + info.GRADIENTS.update(gradients) return info diff --git a/SU2_PY/SU2/run/interface.py b/SU2_PY/SU2/run/interface.py index cf9df54768f..796c5977091 100644 --- a/SU2_PY/SU2/run/interface.py +++ b/SU2_PY/SU2/run/interface.py @@ -3,7 +3,7 @@ ## \file interface.py # \brief python package interfacing with the SU2 suite # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -38,196 +38,206 @@ # Setup # ------------------------------------------------------------ -SU2_RUN = os.environ['SU2_RUN'] -sys.path.append( SU2_RUN ) -quote = '"' if sys.platform == 'win32' else '' +SU2_RUN = os.environ["SU2_RUN"] +sys.path.append(SU2_RUN) +quote = '"' if sys.platform == "win32" else "" # SU2 suite run command template -base_Command = os.path.join(SU2_RUN, '%s') +base_Command = os.path.join(SU2_RUN, "%s") # check for slurm -slurm_job = 'SLURM_JOBID' in os.environ +slurm_job = "SLURM_JOBID" in os.environ # Check for custom mpi command -user_defined = 'SU2_MPI_COMMAND' in os.environ +user_defined = "SU2_MPI_COMMAND" in os.environ # set mpi command if user_defined: - mpi_Command = os.environ['SU2_MPI_COMMAND'] + mpi_Command = os.environ["SU2_MPI_COMMAND"] elif slurm_job: - mpi_Command = 'srun -n %i %s' -elif not which('mpirun') is None: - mpi_Command = 'mpirun -n %i %s' -elif not which('mpiexec') is None: - mpi_Command = 'mpiexec -n %i %s' + mpi_Command = "srun -n %i %s" +elif not which("mpirun") is None: + mpi_Command = "mpirun -n %i %s" +elif not which("mpiexec") is None: + mpi_Command = "mpiexec -n %i %s" else: - mpi_Command = '' + mpi_Command = "" from .. import EvaluationFailure, DivergenceFailure + return_code_map = { - 1 : EvaluationFailure , - 2 : DivergenceFailure , + 1: EvaluationFailure, + 2: DivergenceFailure, } # ------------------------------------------------------------ # SU2 Suite Interface Functions # ------------------------------------------------------------ + def CFD(config): - """ run SU2_CFD - partitions set by config.NUMBER_PART + """run SU2_CFD + partitions set by config.NUMBER_PART """ konfig = copy.deepcopy(config) - direct_diff = not konfig.get('DIRECT_DIFF',"") in ["NONE", ""] + direct_diff = not konfig.get("DIRECT_DIFF", "") in ["NONE", ""] - auto_diff = konfig.MATH_PROBLEM == 'DISCRETE_ADJOINT' + auto_diff = konfig.MATH_PROBLEM == "DISCRETE_ADJOINT" if direct_diff: - tempname = 'config_CFD_DIRECTDIFF.cfg' + tempname = "config_CFD_DIRECTDIFF.cfg" konfig.dump(tempname) - processes = konfig['NUMBER_PART'] + processes = konfig["NUMBER_PART"] - the_Command = 'SU2_CFD_DIRECTDIFF%s %s' % (quote, tempname) + the_Command = "SU2_CFD_DIRECTDIFF%s %s" % (quote, tempname) elif auto_diff: - tempname = 'config_CFD_AD.cfg' + tempname = "config_CFD_AD.cfg" konfig.dump(tempname) - processes = konfig['NUMBER_PART'] + processes = konfig["NUMBER_PART"] - the_Command = 'SU2_CFD_AD%s %s' % (quote, tempname) + the_Command = "SU2_CFD_AD%s %s" % (quote, tempname) else: - tempname = 'config_CFD.cfg' + tempname = "config_CFD.cfg" konfig.dump(tempname) - processes = konfig['NUMBER_PART'] + processes = konfig["NUMBER_PART"] - the_Command = 'SU2_CFD%s %s' % (quote, tempname) + the_Command = "SU2_CFD%s %s" % (quote, tempname) - the_Command = build_command( the_Command, processes ) - run_command( the_Command ) + the_Command = build_command(the_Command, processes) + run_command(the_Command) - #os.remove(tempname) + # os.remove(tempname) return + def DEF(config): - """ run SU2_DEF - partitions set by config.NUMBER_PART - forced to run in serial, expects merged mesh input + """run SU2_DEF + partitions set by config.NUMBER_PART + forced to run in serial, expects merged mesh input """ konfig = copy.deepcopy(config) - tempname = 'config_DEF.cfg' + tempname = "config_DEF.cfg" konfig.dump(tempname) # must run with rank 1 - processes = konfig['NUMBER_PART'] + processes = konfig["NUMBER_PART"] - the_Command = 'SU2_DEF%s %s' % (quote, tempname) - the_Command = build_command( the_Command, processes ) - run_command( the_Command ) + the_Command = "SU2_DEF%s %s" % (quote, tempname) + the_Command = build_command(the_Command, processes) + run_command(the_Command) - #os.remove(tempname) + # os.remove(tempname) return + def DOT(config): - """ run SU2_DOT - partitions set by config.NUMBER_PART + """run SU2_DOT + partitions set by config.NUMBER_PART """ konfig = copy.deepcopy(config) - auto_diff = konfig.MATH_PROBLEM == 'DISCRETE_ADJOINT' or konfig.get('AUTO_DIFF','NO') == 'YES' + auto_diff = ( + konfig.MATH_PROBLEM == "DISCRETE_ADJOINT" + or konfig.get("AUTO_DIFF", "NO") == "YES" + ) if auto_diff: - tempname = 'config_DOT_AD.cfg' + tempname = "config_DOT_AD.cfg" konfig.dump(tempname) - processes = konfig['NUMBER_PART'] + processes = konfig["NUMBER_PART"] - the_Command = 'SU2_DOT_AD%s %s' % (quote, tempname) + the_Command = "SU2_DOT_AD%s %s" % (quote, tempname) else: - tempname = 'config_DOT.cfg' + tempname = "config_DOT.cfg" konfig.dump(tempname) - processes = konfig['NUMBER_PART'] + processes = konfig["NUMBER_PART"] - the_Command = 'SU2_DOT%s %s' % (quote, tempname) + the_Command = "SU2_DOT%s %s" % (quote, tempname) - the_Command = build_command( the_Command, processes ) - run_command( the_Command ) + the_Command = build_command(the_Command, processes) + run_command(the_Command) - #os.remove(tempname) + # os.remove(tempname) return + def GEO(config): - """ run SU2_GEO - partitions set by config.NUMBER_PART - forced to run in serial + """run SU2_GEO + partitions set by config.NUMBER_PART + forced to run in serial """ konfig = copy.deepcopy(config) - tempname = 'config_GEO.cfg' + tempname = "config_GEO.cfg" konfig.dump(tempname) # must run with rank 1 - processes = konfig['NUMBER_PART'] + processes = konfig["NUMBER_PART"] - the_Command = 'SU2_GEO%s %s' % (quote, tempname) - the_Command = build_command( the_Command , processes ) - run_command( the_Command ) + the_Command = "SU2_GEO%s %s" % (quote, tempname) + the_Command = build_command(the_Command, processes) + run_command(the_Command) - #os.remove(tempname) + # os.remove(tempname) return + def SOL(config): - """ run SU2_SOL - partitions set by config.NUMBER_PART + """run SU2_SOL + partitions set by config.NUMBER_PART """ konfig = copy.deepcopy(config) - tempname = 'config_SOL.cfg' + tempname = "config_SOL.cfg" konfig.dump(tempname) # must run with rank 1 - processes = konfig['NUMBER_PART'] + processes = konfig["NUMBER_PART"] - the_Command = 'SU2_SOL%s %s' % (quote, tempname) - the_Command = build_command( the_Command , processes ) - run_command( the_Command ) + the_Command = "SU2_SOL%s %s" % (quote, tempname) + the_Command = build_command(the_Command, processes) + run_command(the_Command) - #os.remove(tempname) + # os.remove(tempname) return + def SOL_FSI(config): - """ run SU2_SOL for FSI problems - partitions set by config.NUMBER_PART + """run SU2_SOL for FSI problems + partitions set by config.NUMBER_PART """ konfig = copy.deepcopy(config) - tempname = 'config_SOL.cfg' + tempname = "config_SOL.cfg" konfig.dump(tempname) # must run with rank 1 - processes = konfig['NUMBER_PART'] + processes = konfig["NUMBER_PART"] - the_Command = 'SU2_SOL%s %s 2' % (quote, tempname) - the_Command = build_command( the_Command , processes ) - run_command( the_Command ) + the_Command = "SU2_SOL%s %s 2" % (quote, tempname) + the_Command = build_command(the_Command, processes) + run_command(the_Command) - #os.remove(tempname) + # os.remove(tempname) return @@ -236,33 +246,43 @@ def SOL_FSI(config): # Helper functions # ------------------------------------------------------------ -def build_command( the_Command , processes=0 ): - """ builds an mpi command for given number of processes """ + +def build_command(the_Command, processes=0): + """builds an mpi command for given number of processes""" the_Command = quote + (base_Command % the_Command) if processes > 1: if not mpi_Command: - raise RuntimeError('could not find an mpi interface') - the_Command = mpi_Command % (processes,the_Command) + raise RuntimeError("could not find an mpi interface") + the_Command = mpi_Command % (processes, the_Command) return the_Command -def run_command( Command ): - """ runs os command with subprocess - checks for errors from command + +def run_command(Command): + """runs os command with subprocess + checks for errors from command """ sys.stdout.flush() - proc = subprocess.Popen( Command, shell=True , - stdout=sys.stdout , - stderr=subprocess.PIPE ) + proc = subprocess.Popen( + Command, shell=True, stdout=sys.stdout, stderr=subprocess.PIPE + ) return_code = proc.wait() message = proc.stderr.read().decode() if return_code < 0: - message = "SU2 process was terminated by signal '%s'\n%s" % (-return_code,message) + message = "SU2 process was terminated by signal '%s'\n%s" % ( + -return_code, + message, + ) raise SystemExit(message) elif return_code > 0: - message = "Path = %s\nCommand = %s\nSU2 process returned error '%s'\n%s" % (os.path.abspath(','),Command,return_code,message) + message = "Path = %s\nCommand = %s\nSU2 process returned error '%s'\n%s" % ( + os.path.abspath(","), + Command, + return_code, + message, + ) if return_code in return_code_map.keys(): exception = return_code_map[return_code] else: @@ -272,4 +292,3 @@ def run_command( Command ): sys.stdout.write(message) return return_code - diff --git a/SU2_PY/SU2/run/merge.py b/SU2_PY/SU2/run/merge.py index e520df3b440..39b7a38e181 100644 --- a/SU2_PY/SU2/run/merge.py +++ b/SU2_PY/SU2/run/merge.py @@ -1,7 +1,7 @@ ## \file merge.py # \brief python package for merging meshes # \author T. Economon, T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -28,7 +28,7 @@ # ---------------------------------------------------------------------- import os, sys, shutil, copy -from .. import io as su2io +from .. import io as su2io from .interface import SOL as SU2_SOL from .interface import SOL_FSI as SU2_SOL_FSI @@ -36,32 +36,33 @@ # Merge Mesh # ---------------------------------------------------------------------- -def merge( config ): - """ info = SU2.run.merge(config) - Merges mesh with: - SU2.run.SOL() (volume merging) - internal scripts (surface merging) +def merge(config): + """info = SU2.run.merge(config) - Assumptions: - config.NUMBER_PART is set - Skip if config.NUMBER_PART > 1 + Merges mesh with: + SU2.run.SOL() (volume merging) + internal scripts (surface merging) - Inputs: - config - an SU2 config + Assumptions: + config.NUMBER_PART is set + Skip if config.NUMBER_PART > 1 - Ouputs: - info - an empty SU2 State + Inputs: + config - an SU2 config - Executes in: - ./ + Ouputs: + info - an empty SU2 State + + Executes in: + ./ """ # local copy konfig = copy.deepcopy(config) # check if needed - partitions = konfig['NUMBER_PART'] + partitions = konfig["NUMBER_PART"] if partitions <= 1: return su2io.State() @@ -72,10 +73,10 @@ def merge( config ): multizone_cases = su2io.get_multizone(konfig) # # MERGING # # - if 'FLUID_STRUCTURE_INTERACTION' in multizone_cases: + if "FLUID_STRUCTURE_INTERACTION" in multizone_cases: merge_multizone(konfig) else: - if 'WRT_UNSTEADY' in special_cases: + if "WRT_UNSTEADY" in special_cases: merge_unsteady(konfig) else: merge_solution(konfig) @@ -85,38 +86,45 @@ def merge( config ): return info + #: merge -def merge_unsteady( config, begintime=0, endtime=None ): + +def merge_unsteady(config, begintime=0, endtime=None): if not endtime: endtime = config.EXT_ITER # SU2_SOL handles unsteady volume merge - merge_solution( config ) + merge_solution(config) return + #: def merge_unsteady() -def merge_solution( config ): - """ SU2.io.merge.merge_solution(config) - general volume surface merging with SU2_SOL + +def merge_solution(config): + """SU2.io.merge.merge_solution(config) + general volume surface merging with SU2_SOL """ - SU2_SOL( config ) + SU2_SOL(config) return + #: merge_solution( config ) -def merge_multizone( config, begintime=0, endtime=None ): + +def merge_multizone(config, begintime=0, endtime=None): if not endtime: endtime = config.TIME_ITER - SU2_SOL_FSI( config ) + SU2_SOL_FSI(config) return + #: merge_solution( config ) diff --git a/SU2_PY/SU2/run/projection.py b/SU2_PY/SU2/run/projection.py index 6b4ced709bf..4afbc0d6884 100644 --- a/SU2_PY/SU2/run/projection.py +++ b/SU2_PY/SU2/run/projection.py @@ -3,7 +3,7 @@ ## \file projection.py # \brief python package for running gradient projection # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -31,7 +31,7 @@ import os, sys, shutil, copy -from .. import io as su2io +from .. import io as su2io from .. import util as su2util from .interface import DOT as SU2_DOT @@ -40,54 +40,59 @@ # Gradient Projection # ---------------------------------------------------------------------- -def projection( config, state={}, step = 1e-3 ): - """ info = SU2.run.projection(config,state,step=1e-3) - Runs an gradient projection with: - SU2.run.decomp() - SU2.run.DOT() +def projection(config, state={}, step=1e-3): + """info = SU2.run.projection(config,state,step=1e-3) - Assumptions: - Writes tecplot file of gradients - Adds objective suffix to gradient plot filename + Runs an gradient projection with: + SU2.run.decomp() + SU2.run.DOT() - Inputs: - config - an SU2 config - state - only required when using external custom DV - step - a float or list of floats for geometry sensitivity - finite difference step + Assumptions: + Writes tecplot file of gradients + Adds objective suffix to gradient plot filename - Outputs: - info - SU2 State with keys: - GRADIENTS. + Inputs: + config - an SU2 config + state - only required when using external custom DV + step - a float or list of floats for geometry sensitivity + finite difference step - Updates: - config.MATH_PROBLEM + Outputs: + info - SU2 State with keys: + GRADIENTS. - Executes in: - ./ + Updates: + config.MATH_PROBLEM + + Executes in: + ./ """ # local copy konfig = copy.deepcopy(config) # choose dv values - Definition_DV = konfig['DEFINITION_DV'] - n_DV = sum(Definition_DV['SIZE']) - if isinstance(step,list): - assert len(step) == n_DV , 'unexpected step vector length' + Definition_DV = konfig["DEFINITION_DV"] + n_DV = sum(Definition_DV["SIZE"]) + if isinstance(step, list): + assert len(step) == n_DV, "unexpected step vector length" else: - step = [step]*n_DV - dv_old = [0.0]*n_DV # SU2_DOT input requirement, assumes linear superposition of design variables + step = [step] * n_DV + dv_old = [ + 0.0 + ] * n_DV # SU2_DOT input requirement, assumes linear superposition of design variables dv_new = step - konfig.unpack_dvs(dv_new,dv_old) + konfig.unpack_dvs(dv_new, dv_old) # filenames - objective = konfig['OBJECTIVE_FUNCTION'] - grad_filename = konfig['GRAD_OBJFUNC_FILENAME'] - output_format = konfig.get('TABULAR_FORMAT', 'CSV') + objective = konfig["OBJECTIVE_FUNCTION"] + grad_filename = konfig["GRAD_OBJFUNC_FILENAME"] + output_format = konfig.get("TABULAR_FORMAT", "CSV") plot_extension = su2io.get_extension(output_format) - adj_suffix = su2io.get_adjointSuffix(objective) - grad_plotname = os.path.splitext(grad_filename)[0] + '_' + adj_suffix + plot_extension + adj_suffix = su2io.get_adjointSuffix(objective) + grad_plotname = ( + os.path.splitext(grad_filename)[0] + "_" + adj_suffix + plot_extension + ) # Run Projection SU2_DOT(konfig) @@ -100,19 +105,19 @@ def projection( config, state={}, step = 1e-3 ): # Write Gradients data_plot = su2util.ordered_bunch() - data_plot['VARIABLE'] = range(len(raw_gradients)) - data_plot['GRADIENT'] = raw_gradients - data_plot['FINDIFF_STEP'] = step - su2util.write_plot(grad_plotname,output_format,data_plot) + data_plot["VARIABLE"] = range(len(raw_gradients)) + data_plot["GRADIENT"] = raw_gradients + data_plot["FINDIFF_STEP"] = step + su2util.write_plot(grad_plotname, output_format, data_plot) # gradient output dictionary - objective = objective.split(',') - if (len(objective)>1 ): - objective = ['COMBO'] + objective = objective.split(",") + if len(objective) > 1: + objective = ["COMBO"] - gradients = { objective[0] : raw_gradients } + gradients = {objective[0]: raw_gradients} # info out - info.GRADIENTS.update( gradients ) + info.GRADIENTS.update(gradients) return info diff --git a/SU2_PY/SU2/util/__init__.py b/SU2_PY/SU2/util/__init__.py index 27184c17739..6819e27197f 100644 --- a/SU2_PY/SU2/util/__init__.py +++ b/SU2_PY/SU2/util/__init__.py @@ -1,8 +1,8 @@ -from .switch import switch -from .bunch import Bunch as bunch -from .ordered_dict import OrderedDict as ordered_dict +from .switch import switch +from .bunch import Bunch as bunch +from .ordered_dict import OrderedDict as ordered_dict from .ordered_bunch import OrderedBunch as ordered_bunch -from .plot import write_plot, tecplot, paraview -from .lhc_unif import lhc_unif -from .mp_eval import mp_eval -from .which import which +from .plot import write_plot, tecplot, paraview +from .lhc_unif import lhc_unif +from .mp_eval import mp_eval +from .which import which diff --git a/SU2_PY/SU2/util/bunch.py b/SU2_PY/SU2/util/bunch.py index 603671fed53..f2bf6f87824 100644 --- a/SU2_PY/SU2/util/bunch.py +++ b/SU2_PY/SU2/util/bunch.py @@ -1,7 +1,7 @@ #!/usr/bin/env python """ Bunch is a subclass of dict with attribute-style access. - + >>> b = Bunch() >>> b.hello = 'world' >>> b.hello @@ -14,99 +14,100 @@ True >>> b.foo is b['foo'] True - + It is safe to import * from this module: - + __all__ = ('Bunch', 'bunchify','unbunchify') - + un/bunchify provide dictionary conversion; Bunches can also be converted via Bunch.to/fromDict(). - + original source: https://pypi.python.org/pypi/bunch """ + class Bunch(dict): - """ A dictionary that provides attribute-style access. - - >>> b = Bunch() - >>> b.hello = 'world' - >>> b.hello - 'world' - >>> b['hello'] += "!" - >>> b.hello - 'world!' - >>> b.foo = Bunch(lol=True) - >>> b.foo.lol - True - >>> b.foo is b['foo'] - True - - A Bunch is a subclass of dict; it supports all the methods a dict does... - - >>> b.keys() - ['foo', 'hello'] - - Including update()... - - >>> b.update({ 'ponies': 'are pretty!' }, hello=42) - >>> print(repr(b)) - Bunch(foo=Bunch(lol=True), hello=42, ponies='are pretty!') - - As well as iteration... - - >>> [ (k,b[k]) for k in b ] - [('ponies', 'are pretty!'), ('foo', Bunch(lol=True)), ('hello', 42)] - - And "splats". - - >>> "The {knights} who say {ni}!".format(**Bunch(knights='lolcats', ni='can haz')) - 'The lolcats who say can haz!' - - See unbunchify/Bunch.toDict, bunchify/Bunch.fromDict for notes about conversion. + """A dictionary that provides attribute-style access. + + >>> b = Bunch() + >>> b.hello = 'world' + >>> b.hello + 'world' + >>> b['hello'] += "!" + >>> b.hello + 'world!' + >>> b.foo = Bunch(lol=True) + >>> b.foo.lol + True + >>> b.foo is b['foo'] + True + + A Bunch is a subclass of dict; it supports all the methods a dict does... + + >>> b.keys() + ['foo', 'hello'] + + Including update()... + + >>> b.update({ 'ponies': 'are pretty!' }, hello=42) + >>> print(repr(b)) + Bunch(foo=Bunch(lol=True), hello=42, ponies='are pretty!') + + As well as iteration... + + >>> [ (k,b[k]) for k in b ] + [('ponies', 'are pretty!'), ('foo', Bunch(lol=True)), ('hello', 42)] + + And "splats". + + >>> "The {knights} who say {ni}!".format(**Bunch(knights='lolcats', ni='can haz')) + 'The lolcats who say can haz!' + + See unbunchify/Bunch.toDict, bunchify/Bunch.fromDict for notes about conversion. """ - + def __contains__(self, k): - """ >>> b = Bunch(ponies='are pretty!') - >>> 'ponies' in b - True - >>> 'foo' in b - False - >>> b['foo'] = 42 - >>> 'foo' in b - True - >>> b.hello = 'hai' - >>> 'hello' in b - True + """>>> b = Bunch(ponies='are pretty!') + >>> 'ponies' in b + True + >>> 'foo' in b + False + >>> b['foo'] = 42 + >>> 'foo' in b + True + >>> b.hello = 'hai' + >>> 'hello' in b + True """ try: return hasattr(self, k) or dict.__contains__(self, k) except: return False - - # only called if k not found in normal places + + # only called if k not found in normal places def __getattr__(self, k): - """ Gets key if it exists, otherwise throws AttributeError. - - nb. __getattr__ is only called if key is not found in normal places. - - >>> b = Bunch(bar='baz', lol={}) - >>> b.foo - Traceback (most recent call last): - ... - AttributeError: foo - - >>> b.bar - 'baz' - >>> getattr(b, 'bar') - 'baz' - >>> b['bar'] - 'baz' - - >>> b.lol is b['lol'] - True - >>> b.lol is getattr(b, 'lol') - True + """Gets key if it exists, otherwise throws AttributeError. + + nb. __getattr__ is only called if key is not found in normal places. + + >>> b = Bunch(bar='baz', lol={}) + >>> b.foo + Traceback (most recent call last): + ... + AttributeError: foo + + >>> b.bar + 'baz' + >>> getattr(b, 'bar') + 'baz' + >>> b['bar'] + 'baz' + + >>> b.lol is b['lol'] + True + >>> b.lol is getattr(b, 'lol') + True """ try: # Throws exception if not in prototype chain @@ -116,22 +117,22 @@ def __getattr__(self, k): return self[k] except KeyError: raise AttributeError(k) - + def __setattr__(self, k, v): - """ Sets attribute k if it exists, otherwise sets key k. A KeyError - raised by set-item (only likely if you subclass Bunch) will - propagate as an AttributeError instead. - - >>> b = Bunch(foo='bar', this_is='useful when subclassing') - >>> b.values #doctest: +ELLIPSIS - - >>> b.values = 'uh oh' - >>> b.values - 'uh oh' - >>> b['values'] - Traceback (most recent call last): - ... - KeyError: 'values' + """Sets attribute k if it exists, otherwise sets key k. A KeyError + raised by set-item (only likely if you subclass Bunch) will + propagate as an AttributeError instead. + + >>> b = Bunch(foo='bar', this_is='useful when subclassing') + >>> b.values #doctest: +ELLIPSIS + + >>> b.values = 'uh oh' + >>> b.values + 'uh oh' + >>> b['values'] + Traceback (most recent call last): + ... + KeyError: 'values' """ try: # Throws exception if not in prototype chain @@ -143,22 +144,22 @@ def __setattr__(self, k, v): raise AttributeError(k) else: object.__setattr__(self, k, v) - + def __delattr__(self, k): - """ Deletes attribute k if it exists, otherwise deletes key k. A KeyError - raised by deleting the key--such as when the key is missing--will - propagate as an AttributeError instead. - - >>> b = Bunch(lol=42) - >>> del b.values - Traceback (most recent call last): - ... - AttributeError: 'Bunch' object attribute 'values' is read-only - >>> del b.lol - >>> b.lol - Traceback (most recent call last): - ... - AttributeError: lol + """Deletes attribute k if it exists, otherwise deletes key k. A KeyError + raised by deleting the key--such as when the key is missing--will + propagate as an AttributeError instead. + + >>> b = Bunch(lol=42) + >>> del b.values + Traceback (most recent call last): + ... + AttributeError: 'Bunch' object attribute 'values' is read-only + >>> del b.lol + >>> b.lol + Traceback (most recent call last): + ... + AttributeError: lol """ try: # Throws exception if not in prototype chain @@ -170,56 +171,54 @@ def __delattr__(self, k): raise AttributeError(k) else: object.__delattr__(self, k) - + def toDict(self): - """ Recursively converts a bunch back into a dictionary. - - >>> b = Bunch(foo=Bunch(lol=True), hello=42, ponies='are pretty!') - >>> b.toDict() - {'ponies': 'are pretty!', 'foo': {'lol': True}, 'hello': 42} - - See unbunchify for more info. + """Recursively converts a bunch back into a dictionary. + + >>> b = Bunch(foo=Bunch(lol=True), hello=42, ponies='are pretty!') + >>> b.toDict() + {'ponies': 'are pretty!', 'foo': {'lol': True}, 'hello': 42} + + See unbunchify for more info. """ return unbunchify(self) - + def __repr__(self): - """ Invertible* string-form of a Bunch. - - >>> b = Bunch(foo=Bunch(lol=True), hello=42, ponies='are pretty!') - >>> print(repr(b)) - Bunch(foo=Bunch(lol=True), hello=42, ponies='are pretty!') - >>> eval(repr(b)) - Bunch(foo=Bunch(lol=True), hello=42, ponies='are pretty!') - - (*) Invertible so long as collection contents are each repr-invertible. + """Invertible* string-form of a Bunch. + + >>> b = Bunch(foo=Bunch(lol=True), hello=42, ponies='are pretty!') + >>> print(repr(b)) + Bunch(foo=Bunch(lol=True), hello=42, ponies='are pretty!') + >>> eval(repr(b)) + Bunch(foo=Bunch(lol=True), hello=42, ponies='are pretty!') + + (*) Invertible so long as collection contents are each repr-invertible. """ keys = self.keys() keys.sort() - args = ', '.join(['%s=%r' % (key, self[key]) for key in keys]) - return '%s(%s)' % (self.__class__.__name__, args) - + args = ", ".join(["%s=%r" % (key, self[key]) for key in keys]) + return "%s(%s)" % (self.__class__.__name__, args) + def __str__(self): - """ String-form of a OrderedBunch. - """ + """String-form of a OrderedBunch.""" keys = self.keys() keys.sort() - args = ', '.join(['%s=%r' % (key, self[key]) for key in keys]) - return '{%s}' % args - + args = ", ".join(["%s=%r" % (key, self[key]) for key in keys]) + return "{%s}" % args + @staticmethod def fromDict(d): - """ Recursively transforms a dictionary into a Bunch via copy. - - >>> b = Bunch.fromDict({'urmom': {'sez': {'what': 'what'}}}) - >>> b.urmom.sez.what - 'what' - - See bunchify for more info. + """Recursively transforms a dictionary into a Bunch via copy. + + >>> b = Bunch.fromDict({'urmom': {'sez': {'what': 'what'}}}) + >>> b.urmom.sez.what + 'what' + + See bunchify for more info. """ return bunchify(d) - # While we could convert abstract types like Mapping or Iterable, I think # bunchify is more likely to "do what you mean" if it is conservative about # casting (ex: isinstance(str,Iterable) == True ). @@ -227,54 +226,56 @@ def fromDict(d): # Should you disagree, it is not difficult to duplicate this function with # more aggressive coercion to suit your own purposes. + def bunchify(x): - """ Recursively transforms a dictionary into a Bunch via copy. - - >>> b = bunchify({'urmom': {'sez': {'what': 'what'}}}) - >>> b.urmom.sez.what - 'what' - - bunchify can handle intermediary dicts, lists and tuples (as well as - their subclasses), but ymmv on custom datatypes. - - >>> b = bunchify({ 'lol': ('cats', {'hah':'i win again'}), - ... 'hello': [{'french':'salut', 'german':'hallo'}] }) - >>> b.hello[0].french - 'salut' - >>> b.lol[1].hah - 'i win again' - - nb. As dicts are not hashable, they cannot be nested in sets/frozensets. + """Recursively transforms a dictionary into a Bunch via copy. + + >>> b = bunchify({'urmom': {'sez': {'what': 'what'}}}) + >>> b.urmom.sez.what + 'what' + + bunchify can handle intermediary dicts, lists and tuples (as well as + their subclasses), but ymmv on custom datatypes. + + >>> b = bunchify({ 'lol': ('cats', {'hah':'i win again'}), + ... 'hello': [{'french':'salut', 'german':'hallo'}] }) + >>> b.hello[0].french + 'salut' + >>> b.lol[1].hah + 'i win again' + + nb. As dicts are not hashable, they cannot be nested in sets/frozensets. """ if isinstance(x, dict): - return Bunch( (k, bunchify(v)) for k,v in x.iteritems() ) + return Bunch((k, bunchify(v)) for k, v in x.iteritems()) elif isinstance(x, (list, tuple)): - return type(x)( bunchify(v) for v in x ) + return type(x)(bunchify(v) for v in x) else: return x + def unbunchify(x): - """ Recursively converts a Bunch into a dictionary. - - >>> b = Bunch(foo=Bunch(lol=True), hello=42, ponies='are pretty!') - >>> unbunchify(b) - {'ponies': 'are pretty!', 'foo': {'lol': True}, 'hello': 42} - - unbunchify will handle intermediary dicts, lists and tuples (as well as - their subclasses), but ymmv on custom datatypes. - - >>> b = Bunch(foo=['bar', Bunch(lol=True)], hello=42, - ... ponies=('are pretty!', Bunch(lies='are trouble!'))) - >>> unbunchify(b) #doctest: +NORMALIZE_WHITESPACE - {'ponies': ('are pretty!', {'lies': 'are trouble!'}), - 'foo': ['bar', {'lol': True}], 'hello': 42} - - nb. As dicts are not hashable, they cannot be nested in sets/frozensets. + """Recursively converts a Bunch into a dictionary. + + >>> b = Bunch(foo=Bunch(lol=True), hello=42, ponies='are pretty!') + >>> unbunchify(b) + {'ponies': 'are pretty!', 'foo': {'lol': True}, 'hello': 42} + + unbunchify will handle intermediary dicts, lists and tuples (as well as + their subclasses), but ymmv on custom datatypes. + + >>> b = Bunch(foo=['bar', Bunch(lol=True)], hello=42, + ... ponies=('are pretty!', Bunch(lies='are trouble!'))) + >>> unbunchify(b) #doctest: +NORMALIZE_WHITESPACE + {'ponies': ('are pretty!', {'lies': 'are trouble!'}), + 'foo': ['bar', {'lol': True}], 'hello': 42} + + nb. As dicts are not hashable, they cannot be nested in sets/frozensets. """ if isinstance(x, dict): - return dict( (k, unbunchify(v)) for k,v in x.iteritems() ) + return dict((k, unbunchify(v)) for k, v in x.iteritems()) elif isinstance(x, (list, tuple)): - return type(x)( unbunchify(v) for v in x ) + return type(x)(unbunchify(v) for v in x) else: return x @@ -286,116 +287,110 @@ def unbunchify(x): import json except ImportError: import simplejson as json - + def toJSON(self, **options): - """ Serializes this Bunch to JSON. Accepts the same keyword options as `json.dumps()`. - - >>> b = Bunch(foo=Bunch(lol=True), hello=42, ponies='are pretty!') - >>> json.dumps(b) - '{"ponies": "are pretty!", "foo": {"lol": true}, "hello": 42}' - >>> b.toJSON() - '{"ponies": "are pretty!", "foo": {"lol": true}, "hello": 42}' + """Serializes this Bunch to JSON. Accepts the same keyword options as `json.dumps()`. + + >>> b = Bunch(foo=Bunch(lol=True), hello=42, ponies='are pretty!') + >>> json.dumps(b) + '{"ponies": "are pretty!", "foo": {"lol": true}, "hello": 42}' + >>> b.toJSON() + '{"ponies": "are pretty!", "foo": {"lol": true}, "hello": 42}' """ return json.dumps(self, **options) - + Bunch.toJSON = toJSON - + except ImportError: pass - - try: # Attempt to register ourself with PyYAML as a representer import yaml from yaml.representer import Representer, SafeRepresenter - + def from_yaml(loader, node): - """ PyYAML support for Bunches using the tag `!bunch` and `!bunch.Bunch`. - - >>> import yaml - >>> yaml.load(''' - ... Flow style: !bunch.Bunch { Clark: Evans, Brian: Ingerson, Oren: Ben-Kiki } - ... Block style: !bunch - ... Clark : Evans - ... Brian : Ingerson - ... Oren : Ben-Kiki - ... ''') #doctest: +NORMALIZE_WHITESPACE - {'Flow style': Bunch(Brian='Ingerson', Clark='Evans', Oren='Ben-Kiki'), - 'Block style': Bunch(Brian='Ingerson', Clark='Evans', Oren='Ben-Kiki')} - - This module registers itself automatically to cover both Bunch and any - subclasses. Should you want to customize the representation of a subclass, - simply register it with PyYAML yourself. + """PyYAML support for Bunches using the tag `!bunch` and `!bunch.Bunch`. + + >>> import yaml + >>> yaml.load(''' + ... Flow style: !bunch.Bunch { Clark: Evans, Brian: Ingerson, Oren: Ben-Kiki } + ... Block style: !bunch + ... Clark : Evans + ... Brian : Ingerson + ... Oren : Ben-Kiki + ... ''') #doctest: +NORMALIZE_WHITESPACE + {'Flow style': Bunch(Brian='Ingerson', Clark='Evans', Oren='Ben-Kiki'), + 'Block style': Bunch(Brian='Ingerson', Clark='Evans', Oren='Ben-Kiki')} + + This module registers itself automatically to cover both Bunch and any + subclasses. Should you want to customize the representation of a subclass, + simply register it with PyYAML yourself. """ data = Bunch() yield data value = loader.construct_mapping(node) data.update(value) - - + def to_yaml_safe(dumper, data): - """ Converts Bunch to a normal mapping node, making it appear as a - dict in the YAML output. - - >>> b = Bunch(foo=['bar', Bunch(lol=True)], hello=42) - >>> import yaml - >>> yaml.safe_dump(b, default_flow_style=True) - '{foo: [bar, {lol: true}], hello: 42}\\n' + """Converts Bunch to a normal mapping node, making it appear as a + dict in the YAML output. + + >>> b = Bunch(foo=['bar', Bunch(lol=True)], hello=42) + >>> import yaml + >>> yaml.safe_dump(b, default_flow_style=True) + '{foo: [bar, {lol: true}], hello: 42}\\n' """ return dumper.represent_dict(data) - + def to_yaml(dumper, data): - """ Converts Bunch to a representation node. - - >>> b = Bunch(foo=['bar', Bunch(lol=True)], hello=42) - >>> import yaml - >>> yaml.dump(b, default_flow_style=True) - '!bunch.Bunch {foo: [bar, !bunch.Bunch {lol: true}], hello: 42}\\n' + """Converts Bunch to a representation node. + + >>> b = Bunch(foo=['bar', Bunch(lol=True)], hello=42) + >>> import yaml + >>> yaml.dump(b, default_flow_style=True) + '!bunch.Bunch {foo: [bar, !bunch.Bunch {lol: true}], hello: 42}\\n' """ - return dumper.represent_mapping(u'!bunch.Bunch', data) - - - yaml.add_constructor(u'!bunch', from_yaml) - yaml.add_constructor(u'!bunch.Bunch', from_yaml) - + return dumper.represent_mapping("!bunch.Bunch", data) + + yaml.add_constructor("!bunch", from_yaml) + yaml.add_constructor("!bunch.Bunch", from_yaml) + SafeRepresenter.add_representer(Bunch, to_yaml_safe) SafeRepresenter.add_multi_representer(Bunch, to_yaml_safe) - + Representer.add_representer(Bunch, to_yaml) Representer.add_multi_representer(Bunch, to_yaml) - - + # Instance methods for YAML conversion def toYAML(self, **options): - """ Serializes this Bunch to YAML, using `yaml.safe_dump()` if - no `Dumper` is provided. See the PyYAML documentation for more info. - - >>> b = Bunch(foo=['bar', Bunch(lol=True)], hello=42) - >>> import yaml - >>> yaml.safe_dump(b, default_flow_style=True) - '{foo: [bar, {lol: true}], hello: 42}\\n' - >>> b.toYAML(default_flow_style=True) - '{foo: [bar, {lol: true}], hello: 42}\\n' - >>> yaml.dump(b, default_flow_style=True) - '!bunch.Bunch {foo: [bar, !bunch.Bunch {lol: true}], hello: 42}\\n' - >>> b.toYAML(Dumper=yaml.Dumper, default_flow_style=True) - '!bunch.Bunch {foo: [bar, !bunch.Bunch {lol: true}], hello: 42}\\n' + """Serializes this Bunch to YAML, using `yaml.safe_dump()` if + no `Dumper` is provided. See the PyYAML documentation for more info. + + >>> b = Bunch(foo=['bar', Bunch(lol=True)], hello=42) + >>> import yaml + >>> yaml.safe_dump(b, default_flow_style=True) + '{foo: [bar, {lol: true}], hello: 42}\\n' + >>> b.toYAML(default_flow_style=True) + '{foo: [bar, {lol: true}], hello: 42}\\n' + >>> yaml.dump(b, default_flow_style=True) + '!bunch.Bunch {foo: [bar, !bunch.Bunch {lol: true}], hello: 42}\\n' + >>> b.toYAML(Dumper=yaml.Dumper, default_flow_style=True) + '!bunch.Bunch {foo: [bar, !bunch.Bunch {lol: true}], hello: 42}\\n' """ opts = dict(indent=4, default_flow_style=False) opts.update(options) - if 'Dumper' not in opts: + if "Dumper" not in opts: return yaml.safe_dump(self, **opts) else: return yaml.dump(self, **opts) - + def fromYAML(*args, **kwargs): - return bunchify( yaml.load(*args, **kwargs) ) - + return bunchify(yaml.load(*args, **kwargs)) + Bunch.toYAML = Bunch.__repr__ = toYAML Bunch.fromYAML = staticmethod(fromYAML) - + except ImportError: pass - diff --git a/SU2_PY/SU2/util/filter_adjoint.py b/SU2_PY/SU2/util/filter_adjoint.py index b59283535dd..226f505b6f5 100644 --- a/SU2_PY/SU2/util/filter_adjoint.py +++ b/SU2_PY/SU2/util/filter_adjoint.py @@ -3,7 +3,7 @@ ## \file filter_adjoint.py # \brief Applies various filters to the adjoint surface sensitivities of an airfoil # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -38,6 +38,7 @@ # plotting with matplotlib try: import pylab as plt + pylab_imported = True except ImportError: pylab_imported = False @@ -49,24 +50,43 @@ def main(): # Command Line Options - parser=OptionParser() - parser.add_option( "-f", "--file", dest="filename", - help="read config from FILE", metavar="FILE" ) - parser.add_option( "-t", "--type", dest="filter_type", default='LAPLACE', - help="apply filter TYPE", metavar="TYPE" ) - parser.add_option( "-m", "--marker", dest="marker_name", default='airfoil', - help="use marker named TAG", metavar="TAG" ) - parser.add_option( "-c", "--chord", dest="chord_length", default=1.0, - help="reference CHORD length", metavar="CHORD" ) - - (options, args)=parser.parse_args() - options.chord_length = float( options.chord_length ) + parser = OptionParser() + parser.add_option( + "-f", "--file", dest="filename", help="read config from FILE", metavar="FILE" + ) + parser.add_option( + "-t", + "--type", + dest="filter_type", + default="LAPLACE", + help="apply filter TYPE", + metavar="TYPE", + ) + parser.add_option( + "-m", + "--marker", + dest="marker_name", + default="airfoil", + help="use marker named TAG", + metavar="TAG", + ) + parser.add_option( + "-c", + "--chord", + dest="chord_length", + default=1.0, + help="reference CHORD length", + metavar="CHORD", + ) + + (options, args) = parser.parse_args() + options.chord_length = float(options.chord_length) # run filter - process_surface_adjoint( options.filename , - options.filter_type , - options.marker_name , - options.chord_length ) + process_surface_adjoint( + options.filename, options.filter_type, options.marker_name, options.chord_length + ) + #: def main() @@ -74,57 +94,55 @@ def main(): # ------------------------------------------------------------------- # PROCESS SURFACE ADJOINT # ------------------------------------------------------------------- -def process_surface_adjoint( config_filename , - filter_type='LAPLACE' , - marker_name='airfoil' , - chord_length=1.0 ): +def process_surface_adjoint( + config_filename, filter_type="LAPLACE", marker_name="airfoil", chord_length=1.0 +): - print('') - print('-------------------------------------------------------------------------') - print('| SU2 Suite (Process Surface Adjoint) |') - print('-------------------------------------------------------------------------') - print('') + print("") + print("-------------------------------------------------------------------------") + print("| SU2 Suite (Process Surface Adjoint) |") + print("-------------------------------------------------------------------------") + print("") # some other defaults - c_clip = 0.01 # percent chord to truncate - fft_copy = 5 # number of times to copy the fft signal - smth_len = 0.05 # percent chord smoothing window length - lapl_len = 1e-4 # laplace smoothing parameter + c_clip = 0.01 # percent chord to truncate + fft_copy = 5 # number of times to copy the fft signal + smth_len = 0.05 # percent chord smoothing window length + lapl_len = 1e-4 # laplace smoothing parameter # read config file config_data = libSU2.Get_ConfigParams(config_filename) - surface_filename = config_data['SURFACE_ADJ_FILENAME'] + '.csv' + surface_filename = config_data["SURFACE_ADJ_FILENAME"] + ".csv" print(surface_filename) - mesh_filename = config_data['MESH_FILENAME'] - gradient = config_data['OBJECTIVE_FUNCTION'] + mesh_filename = config_data["MESH_FILENAME"] + gradient = config_data["OBJECTIVE_FUNCTION"] - print('Config filename = %s' % config_filename) - print('Surface filename = %s' % surface_filename) - print('Filter Type = %s' % filter_type) + print("Config filename = %s" % config_filename) + print("Surface filename = %s" % surface_filename) + print("Filter Type = %s" % filter_type) # read adjoint data - adj_data = np.genfromtxt( surface_filename , - dtype = float , - delimiter = ',' , - skip_header = 1 ) + adj_data = np.genfromtxt( + surface_filename, dtype=float, delimiter=",", skip_header=1 + ) # read mesh data mesh_data = libSU2_mesh.Read_Mesh(mesh_filename) # proces adjoint data - P = map(int, adj_data[:,0] ) - X = adj_data[:,6].copy() - Y = adj_data[:,7].copy() - Sens = adj_data[:,1].copy() - PsiRho = adj_data[:,2].copy() - I = range(0,len(P)) # important - for unsorting durring write + P = map(int, adj_data[:, 0]) + X = adj_data[:, 6].copy() + Y = adj_data[:, 7].copy() + Sens = adj_data[:, 1].copy() + PsiRho = adj_data[:, 2].copy() + I = range(0, len(P)) # important - for unsorting durring write # store in dict by point index - adj_data_dict = dict( zip( P , zip(X,Y,Sens,PsiRho,I) ) ) + adj_data_dict = dict(zip(P, zip(X, Y, Sens, PsiRho, I))) # sort airfoil points - iP_sorted,_ = libSU2_mesh.sort_Airfoil(mesh_data,marker_name) - assert(len(iP_sorted) == len(P)) + iP_sorted, _ = libSU2_mesh.sort_Airfoil(mesh_data, marker_name) + assert len(iP_sorted) == len(P) # rebuild airfoil loop i = 0 @@ -132,56 +150,59 @@ def process_surface_adjoint( config_filename , # the adjoint data entry this_adj_data = adj_data_dict[this_P] # re-sort - P[i] = this_P - X[i] = this_adj_data[0] - Y[i] = this_adj_data[1] - Sens[i] = this_adj_data[2] + P[i] = this_P + X[i] = this_adj_data[0] + Y[i] = this_adj_data[1] + Sens[i] = this_adj_data[2] PsiRho[i] = this_adj_data[3] - I[i] = this_adj_data[4] + I[i] = this_adj_data[4] # next - i = i+1 + i = i + 1 #: for each point # calculate arc length - S = np.sqrt( np.diff(X)**2 + np.diff(Y)**2 ) / chord_length - S = np.cumsum( np.hstack([ 0 , S ]) ) + S = np.sqrt(np.diff(X) ** 2 + np.diff(Y) ** 2) / chord_length + S = np.cumsum(np.hstack([0, S])) # tail trucating, by arc length - I_clip_lo = S < S[0] + c_clip + I_clip_lo = S < S[0] + c_clip I_clip_hi = S > S[-1] - c_clip - S_clip = S.copy() + S_clip = S.copy() Sens_clip = Sens.copy() Sens_clip[I_clip_hi] = Sens_clip[I_clip_hi][0] Sens_clip[I_clip_lo] = Sens_clip[I_clip_lo][-1] - # some edge length statistics dS_clip = np.diff(S_clip) - min_dS = np.min ( dS_clip ) - mean_dS = np.mean( dS_clip ) - max_dS = np.max ( dS_clip ) - #print 'min_dS = %.4e ; mean_dS = %.4e ; max_dS = %.4e' % ( min_dS , mean_dS , max_dS ) + min_dS = np.min(dS_clip) + mean_dS = np.mean(dS_clip) + max_dS = np.max(dS_clip) + # print 'min_dS = %.4e ; mean_dS = %.4e ; max_dS = %.4e' % ( min_dS , mean_dS , max_dS ) # -------------------------------------------- # APPLY FILTER - if filter_type == 'FOURIER': - Freq_notch = [ 1/max_dS, np.inf ] # the notch frequencies - Sens_filter,Frequency,Power = fft_filter( S_clip,Sens_clip, Freq_notch, fft_copy ) - #Sens_filter = smooth(S_clip,Sens_filter, 0.03,'blackman') # post smoothing - - elif filter_type == 'WINDOW': - Sens_filter = window( S_clip, Sens_clip, smth_len, 'blackman' ) - - elif filter_type == 'LAPLACE': - Sens_filter = laplace( S_clip, Sens_clip, lapl_len ) - - elif filter_type == 'SHARPEN': - Sens_smooth = smooth( S_clip, Sens_clip , smth_len/5, 'blackman' ) # pre smoothing - Sens_smoother = smooth( S_clip, Sens_smooth, smth_len , 'blackman' ) - Sens_filter = Sens_smooth + (Sens_smooth - Sens_smoother) # sharpener + if filter_type == "FOURIER": + Freq_notch = [1 / max_dS, np.inf] # the notch frequencies + Sens_filter, Frequency, Power = fft_filter( + S_clip, Sens_clip, Freq_notch, fft_copy + ) + # Sens_filter = smooth(S_clip,Sens_filter, 0.03,'blackman') # post smoothing + + elif filter_type == "WINDOW": + Sens_filter = window(S_clip, Sens_clip, smth_len, "blackman") + + elif filter_type == "LAPLACE": + Sens_filter = laplace(S_clip, Sens_clip, lapl_len) + + elif filter_type == "SHARPEN": + Sens_smooth = smooth( + S_clip, Sens_clip, smth_len / 5, "blackman" + ) # pre smoothing + Sens_smoother = smooth(S_clip, Sens_smooth, smth_len, "blackman") + Sens_filter = Sens_smooth + (Sens_smooth - Sens_smoother) # sharpener else: - raise Exception('unknown filter type') + raise Exception("unknown filter type") # -------------------------------------------- # PLOTTING @@ -191,50 +212,50 @@ def process_surface_adjoint( config_filename , # start plot fig = plt.figure(gradient) plt.clf() - #if not fig.axes: # for comparing two filter calls - #plt.subplot(1,1,1) - #ax = fig.axes[0] - #if len(ax.lines) == 4: - #ax.lines.pop(0) - #ax.lines.pop(0) + # if not fig.axes: # for comparing two filter calls + # plt.subplot(1,1,1) + # ax = fig.axes[0] + # if len(ax.lines) == 4: + # ax.lines.pop(0) + # ax.lines.pop(0) # SENSITIVITY - plt.plot(S ,Sens ,color='b') # original - plt.plot(S_clip,Sens_filter,color='r') # filtered + plt.plot(S, Sens, color="b") # original + plt.plot(S_clip, Sens_filter, color="r") # filtered - plt.xlim(-0.1,2.1) - plt.ylim(-5,5) - plt.xlabel('Arc Length') - plt.ylabel('Surface Sensitivity') + plt.xlim(-0.1, 2.1) + plt.ylim(-5, 5) + plt.xlabel("Arc Length") + plt.ylabel("Surface Sensitivity") - #if len(ax.lines) == 4: - #seq = [2, 2, 7, 2] - #ax.lines[0].set_dashes(seq) - #ax.lines[1].set_dashes(seq) + # if len(ax.lines) == 4: + # seq = [2, 2, 7, 2] + # ax.lines[0].set_dashes(seq) + # ax.lines[1].set_dashes(seq) - plot_filename = os.path.splitext(surface_filename)[0] + '.png' - plt.savefig('Sens_'+plot_filename,dpi=300) + plot_filename = os.path.splitext(surface_filename)[0] + ".png" + plt.savefig("Sens_" + plot_filename, dpi=300) # zoom in - plt.ylim(-0.4,0.4) - plt.savefig('Sens_zoom_'+plot_filename,dpi=300) + plt.ylim(-0.4, 0.4) + plt.savefig("Sens_zoom_" + plot_filename, dpi=300) # SPECTRAL - if filter_type == 'FOURIER': + if filter_type == "FOURIER": - plt.figure('SPECTRAL') + plt.figure("SPECTRAL") plt.clf() - plt.plot(Frequency,Power) + plt.plot(Frequency, Power) - #plt.xlim(0,Freq_notch[0]+10) - plt.xlim(0,200) - plt.ylim(0,0.15) + # plt.xlim(0,Freq_notch[0]+10) + plt.xlim(0, 200) + plt.ylim(0, 0.15) - plt.xlabel('Frequency (1/C)') - plt.ylabel('Surface Sensitivity Spectal Power') + plt.xlabel("Frequency (1/C)") + plt.ylabel("Surface Sensitivity Spectal Power") - plt.savefig('Spectral_'+plot_filename,dpi=300) + plt.savefig("Spectral_" + plot_filename, dpi=300) #: if spectral plot @@ -244,12 +265,12 @@ def process_surface_adjoint( config_filename , # SAVE SURFACE FILE # reorder back to input surface points - Sens_out = np.zeros(len(S)) - Sens_out[I] = Sens_filter # left over from sort - adj_data[:,1] = Sens_out + Sens_out = np.zeros(len(S)) + Sens_out[I] = Sens_filter # left over from sort + adj_data[:, 1] = Sens_out # get surface header - surface_orig = open(surface_filename,'r') + surface_orig = open(surface_filename, "r") header = surface_orig.readline() surface_orig.close() @@ -258,31 +279,33 @@ def process_surface_adjoint( config_filename , prefix_names = prefix_names.values() # add filter prefix, before adjoint prefix - surface_filename_split = surface_filename.rstrip('.csv').split('_') + surface_filename_split = surface_filename.rstrip(".csv").split("_") if surface_filename_split[-1] in prefix_names: - surface_filename_split = surface_filename_split[0:-1] + ['filtered'] + [surface_filename_split[-1]] + surface_filename_split = ( + surface_filename_split[0:-1] + ["filtered"] + [surface_filename_split[-1]] + ) else: - surface_filename_split = surface_filename_split + ['filtered'] - surface_filename_new = '_'.join(surface_filename_split) + '.csv' + surface_filename_split = surface_filename_split + ["filtered"] + surface_filename_new = "_".join(surface_filename_split) + ".csv" # write filtered surface file (only updates Sensitivity) - surface_new = open(surface_filename_new,'w') + surface_new = open(surface_filename_new, "w") surface_new.write(header) for row in adj_data: - for i,value in enumerate(row): + for i, value in enumerate(row): if i > 0: - surface_new.write(', ') + surface_new.write(", ") if i == 0: - surface_new.write('%i' % value ) + surface_new.write("%i" % value) else: - surface_new.write('%.16e' % value ) - surface_new.write('\n') + surface_new.write("%.16e" % value) + surface_new.write("\n") surface_new.close() + print("") + print("----------------- Exit Success (Process Surface Adjoint) ----------------") + print("") - print('') - print('----------------- Exit Success (Process Surface Adjoint) ----------------') - print('') #: def process_surface_adjoint() @@ -291,45 +314,48 @@ def process_surface_adjoint( config_filename , # LAPLACIAN SMOOTHING # ------------------------------------------------------------------- -def laplace(t,x,e): - ''' Laplacian filter - input: - t - time sample vector - x - signal vector x(t) - e - smoother coefficient (e>0) - output: - y: smoothed signal at t - ''' +def laplace(t, x, e): + """Laplacian filter + input: + t - time sample vector + x - signal vector x(t) + e - smoother coefficient (e>0) + + output: + y: smoothed signal at t + """ n_x = len(x) # padding - t_1 = t[ 0] + t[-2]-t[-1] - t_2 = t[-1] + t[ 1]-t[ 0] - t_p = np.hstack([ t_1 , t , t_2 ]) - x_p = np.hstack([ x[0] , x , x[-1] ]) + t_1 = t[0] + t[-2] - t[-1] + t_2 = t[-1] + t[1] - t[0] + t_p = np.hstack([t_1, t, t_2]) + x_p = np.hstack([x[0], x, x[-1]]) # finite differencing - dt_f = t_p[2: ] - t_p[1:-1] + dt_f = t_p[2:] - t_p[1:-1] dt_b = t_p[1:-1] - t_p[0:-2] - dt_c = t_p[2: ] - t_p[0:-2] + dt_c = t_p[2:] - t_p[0:-2] # diagonal coefficients - Coeff = e * 2.0 / (dt_b*dt_f*dt_c) - diag_c = Coeff*dt_c - diag_f = -Coeff*dt_b - diag_b = -Coeff*dt_f + Coeff = e * 2.0 / (dt_b * dt_f * dt_c) + diag_c = Coeff * dt_c + diag_f = -Coeff * dt_b + diag_b = -Coeff * dt_f # system matrix - A = ( np.diag(diag_c , 0) + - np.diag(diag_f[0:-1], 1) + - np.diag(diag_b[1: ],-1) + - np.diag(np.ones(n_x), 0) ) + A = ( + np.diag(diag_c, 0) + + np.diag(diag_f[0:-1], 1) + + np.diag(diag_b[1:], -1) + + np.diag(np.ones(n_x), 0) + ) # periodic conditions - #A[1,-1] = dt_b[0] - #A[-1,1] = dt_f[-1] + # A[1,-1] = dt_b[0] + # A[-1,1] = dt_f[-1] # rhs b = np.array([x]).T @@ -338,26 +364,27 @@ def laplace(t,x,e): # signal start i_d = 0 - A[i_d,:] = 0.0 - A[i_d,i_d] = 1.0 # dirichlet - #A[i_d,i_d+1] = 1.0 # neuman - #A[i_d,i_d] = -1.0 - #b[i_d] = 0.0 #x[i_d+1]-x[i_d] + A[i_d, :] = 0.0 + A[i_d, i_d] = 1.0 # dirichlet + # A[i_d,i_d+1] = 1.0 # neuman + # A[i_d,i_d] = -1.0 + # b[i_d] = 0.0 #x[i_d+1]-x[i_d] # signal end - i_d = n_x-1 - A[i_d,:] = 0.0 - A[i_d,i_d] = 1.0 # dirichlet - #A[i_d,i_d] = 1.0 # neuman - #A[i_d,i_d-1] = -1.0 - #b[i_d] = 0.0 #x[i_d]-x[i_d-1] + i_d = n_x - 1 + A[i_d, :] = 0.0 + A[i_d, i_d] = 1.0 # dirichlet + # A[i_d,i_d] = 1.0 # neuman + # A[i_d,i_d-1] = -1.0 + # b[i_d] = 0.0 #x[i_d]-x[i_d-1] # solve - y = np.linalg.solve(A,b) - y = y[:,0] + y = np.linalg.solve(A, b) + y = y[:, 0] return y + #: def laplace @@ -365,54 +392,55 @@ def laplace(t,x,e): # FFT NOTCH FILTER # ------------------------------------------------------------------- -def fft_filter(t,x,n,c=1): - ''' Notch filter with Fast Fourier Transform - input: - t = input time vector - x = input signal vector - n = [low,high] frequency range to supress - c = number of times to duplicate signal - output: - y = smoothed signal at t +def fft_filter(t, x, n, c=1): + """Notch filter with Fast Fourier Transform + input: + t = input time vector + x = input signal vector + n = [low,high] frequency range to supress + c = number of times to duplicate signal - signal will be interpolated to constant spacing - ''' + output: + y = smoothed signal at t + + signal will be interpolated to constant spacing + """ - assert(c>0) + assert c > 0 # choose sampling frequency - min_dt = np.min( np.diff(t) ) - Ts = min_dt/2 - Fs = 1/Ts + min_dt = np.min(np.diff(t)) + Ts = min_dt / 2 + Fs = 1 / Ts # interpolate to constant spacing - nt_lin = int( t[-1]/Ts ) - t_lin = np.linspace(0,t[-1],nt_lin) - x_lin = np.interp(t_lin,t,x) + nt_lin = int(t[-1] / Ts) + t_lin = np.linspace(0, t[-1], nt_lin) + x_lin = np.interp(t_lin, t, x) # pad last index - t_lin = np.hstack([ t_lin , t_lin[0:10]+t_lin[-1] ]) - x_lin = np.hstack([ x_lin , np.ones(10)*x_lin[-1] ]) + t_lin = np.hstack([t_lin, t_lin[0:10] + t_lin[-1]]) + x_lin = np.hstack([x_lin, np.ones(10) * x_lin[-1]]) # copy signal - for ic in range(c-1): - t_lin = np.hstack([ t_lin[0:-2] , t_lin[1:]+t_lin[-1] ]) - x_lin = np.hstack([ x_lin[0:-2] , x_lin[1:] ]) + for ic in range(c - 1): + t_lin = np.hstack([t_lin[0:-2], t_lin[1:] + t_lin[-1]]) + x_lin = np.hstack([x_lin[0:-2], x_lin[1:]]) nt = len(t_lin) # perform fourier transform - nxtpow2 = int(math.log(nt, 2))+1 # next power of 2 - nfft = 2**nxtpow2 # fft efficiency - P = np.fft.rfft(x_lin,nfft) # the transform - a = np.angle(P) # complex - p = np.absolute(P) # complex - p = p/nt # normalize - p = 2*p[0:(nfft/2)] # symmetric - a = a[0:(nfft/2)] # symmetric + nxtpow2 = int(math.log(nt, 2)) + 1 # next power of 2 + nfft = 2**nxtpow2 # fft efficiency + P = np.fft.rfft(x_lin, nfft) # the transform + a = np.angle(P) # complex + p = np.absolute(P) # complex + p = p / nt # normalize + p = 2 * p[0 : (nfft / 2)] # symmetric + a = a[0 : (nfft / 2)] # symmetric # frequency domain - F = np.arange(0,nfft/2) * Fs/nfft + F = np.arange(0, nfft / 2) * Fs / nfft # for return Freq = F.copy() @@ -421,30 +449,31 @@ def fft_filter(t,x,n,c=1): # THE NOTCH FILTER # filter multiplier - k = np.ones(nfft/2) + k = np.ones(nfft / 2) # clip power within notch frequencies - I_fil = np.logical_and( F>n[0] , F n[0], F < n[1]) k[I_fil] = 0.0 # change the power spectrum - p = p*k + p = p * k # For Return Pow = p.copy() # untransform - p = p*nt/2. - p = np.hstack( [ p , p[::-1] ] ) - a = np.hstack( [ a , -a[::-1] ] ) - P = p*(np.cos(a) + 1j*np.sin(a)) - y_lin = np.fft.irfft(P,nfft) # the inverse transform + p = p * nt / 2.0 + p = np.hstack([p, p[::-1]]) + a = np.hstack([a, -a[::-1]]) + P = p * (np.cos(a) + 1j * np.sin(a)) + y_lin = np.fft.irfft(P, nfft) # the inverse transform y_lin = y_lin[0:nt] # interpolate back to given t - y = np.interp(t,t_lin,y_lin) + y = np.interp(t, t_lin, y_lin) + + return y, Freq, Pow - return y,Freq,Pow # def: fft_filter() @@ -453,7 +482,8 @@ def fft_filter(t,x,n,c=1): # WINDOWED SMOOTHING # ------------------------------------------------------------------- -def window(t,x,window_delta,window='hanning'): + +def window(t, x, window_delta, window="hanning"): """Smooth the data using a window with requested size and shape original source: @@ -474,39 +504,42 @@ def window(t,x,window_delta,window='hanning'): if x.ndim != 1: raise ValueError("smooth only accepts 1 dimension arrays.") - if window not in ['flat', 'hanning', 'hamming', 'bartlett', 'blackman']: - raise ValueError("Window is not of 'flat', 'hanning', 'hamming', 'bartlett', 'blackman'") + if window not in ["flat", "hanning", "hamming", "bartlett", "blackman"]: + raise ValueError( + "Window is not of 'flat', 'hanning', 'hamming', 'bartlett', 'blackman'" + ) # interpolate to constant time sample width - min_dt = np.min( np.diff(t) ) - Ts = min_dt/2 - nt_lin = int( t[-1]/Ts ) - t_lin = np.linspace(0,t[-1],nt_lin) - x_lin = np.interp(t_lin,t,x) + min_dt = np.min(np.diff(t)) + Ts = min_dt / 2 + nt_lin = int(t[-1] / Ts) + t_lin = np.linspace(0, t[-1], nt_lin) + x_lin = np.interp(t_lin, t, x) # window sample length - window_len = int( window_delta / Ts ) + window_len = int(window_delta / Ts) # padding - s=np.r_[x_lin[window_len-1:0:-1],x_lin,x_lin[-1:-window_len:-1]] + s = np.r_[x_lin[window_len - 1 : 0 : -1], x_lin, x_lin[-1:-window_len:-1]] # window template - if window == 'flat': #moving average - w=np.ones(window_len,'d') + if window == "flat": # moving average + w = np.ones(window_len, "d") else: - w=eval('np.'+window+'(window_len)') + w = eval("np." + window + "(window_len)") # the filter - y_lin = np.convolve(w/w.sum(),s,mode='valid') + y_lin = np.convolve(w / w.sum(), s, mode="valid") # remove padding - y_lin = y_lin[((window_len-1)/2):-(window_len/2)] + y_lin = y_lin[((window_len - 1) / 2) : -(window_len / 2)] # interpolate back to given t - y = np.interp(t,t_lin,y_lin) + y = np.interp(t, t_lin, y_lin) return y + #: def window() @@ -514,7 +547,5 @@ def window(t,x,window_delta,window='hanning'): # Run Main from Command Line # ----------------------------------------------------------------- -if __name__ == '__main__': +if __name__ == "__main__": main() - - diff --git a/SU2_PY/SU2/util/lhc_unif.py b/SU2_PY/SU2/util/lhc_unif.py index 6ede6ff694b..84cadb64543 100644 --- a/SU2_PY/SU2/util/lhc_unif.py +++ b/SU2_PY/SU2/util/lhc_unif.py @@ -1,89 +1,91 @@ import numpy as np -def lhc_unif(XB,NS,XI=None,maxits=10): - ''' XS = lhc_unif(XB,NS,XI=None,maxits=10): - - Latin Hypercube Sampling with uniform density - Iterates to maximize minimum L2 distance - Accepts an array of points to respect while sampling - - Inputs: - XB - ndim x 2 array of [lower,upper] bounds - NS - number of new points to sample - XI = None - ni x ndim array of initial points to respect - maxits = 10 - maximum number of iterations - - Outputs: - XS - ns x ndim array of sampled points - ''' - + +def lhc_unif(XB, NS, XI=None, maxits=10): + """XS = lhc_unif(XB,NS,XI=None,maxits=10): + + Latin Hypercube Sampling with uniform density + Iterates to maximize minimum L2 distance + Accepts an array of points to respect while sampling + + Inputs: + XB - ndim x 2 array of [lower,upper] bounds + NS - number of new points to sample + XI = None - ni x ndim array of initial points to respect + maxits = 10 - maximum number of iterations + + Outputs: + XS - ns x ndim array of sampled points + """ + # dimension XB = np.atleast_2d(XB) ND = XB.shape[0] - + # initial points to respect if XI is None: - XI = np.empty([0,ND]) + XI = np.empty([0, ND]) else: XI = np.atleast_2d(XI) - + # output points XO = [] - + # initialize - mindiff = 0; - + mindiff = 0 + # maximize minimum distance for it in range(maxits): - + # samples - S = np.zeros([NS,ND]) - + S = np.zeros([NS, ND]) + # populate samples for i_d in range(ND): - S[:,i_d] = ( np.random.random([1,NS]) + np.random.permutation(NS) ) / NS - XS = S*(XB[:,1]-XB[:,0]) + XB[:,0] - + S[:, i_d] = (np.random.random([1, NS]) + np.random.permutation(NS)) / NS + XS = S * (XB[:, 1] - XB[:, 0]) + XB[:, 0] + # add initial points - XX = np.vstack([ XI , XS ]) - + XX = np.vstack([XI, XS]) + # calc distances vecdiff = vec_dist(XX)[0] - + # update if vecdiff > mindiff: mindiff = vecdiff XO = XX - + #: for iterate - + return XO -def vec_dist(X,P=None): - ''' calculates distance between points in matrix X - with each other, or optionally to given point P - returns min, max and matrix/vector of distances - ''' - + +def vec_dist(X, P=None): + """calculates distance between points in matrix X + with each other, or optionally to given point P + returns min, max and matrix/vector of distances + """ + # distance matrix among X if P is None: - - nK,nD = X.shape - - d = np.zeros([nK,nK,nD]) + + nK, nD = X.shape + + d = np.zeros([nK, nK, nD]) for iD in range(nD): - d[:,:,iD] = np.array([X[:,iD]])-np.array([X[:,iD]]).T - D = np.sqrt( np.sum( d**2 , 2 ) ) - - diag_inf = np.diag( np.ones([nK])*np.inf ) - dmin = np.min(np.min( D + diag_inf )) - dmax = np.max(np.max( D )) - + d[:, :, iD] = np.array([X[:, iD]]) - np.array([X[:, iD]]).T + D = np.sqrt(np.sum(d**2, 2)) + + diag_inf = np.diag(np.ones([nK]) * np.inf) + dmin = np.min(np.min(D + diag_inf)) + dmax = np.max(np.max(D)) + # distance vector to P else: - assert P.shape[0] == 1 , 'P must be a horizontal vector' - D = np.array([ np.sqrt( np.sum( (X-P)**2 , 1 ) ) ]).T + assert P.shape[0] == 1, "P must be a horizontal vector" + D = np.array([np.sqrt(np.sum((X - P) ** 2, 1))]).T dmin = D.min() dmax = D.max() - - return (dmin,dmax,D) \ No newline at end of file + + return (dmin, dmax, D) diff --git a/SU2_PY/SU2/util/misc.py b/SU2_PY/SU2/util/misc.py index e90e901da33..aa5bbab5b0f 100644 --- a/SU2_PY/SU2/util/misc.py +++ b/SU2_PY/SU2/util/misc.py @@ -1,18 +1,17 @@ - import numpy as np -def check_array(A,oned_as='row'): - ''' ensures A is an array and at least of rank 2 - ''' - if not isinstance(A,np.ndarray): + +def check_array(A, oned_as="row"): + """ensures A is an array and at least of rank 2""" + if not isinstance(A, np.ndarray): A = np.array(A) if np.rank(A) < 2: A = np.array(np.matrix(A)) - if oned_as == 'row': + if oned_as == "row": pass - elif oned_as == 'col': + elif oned_as == "col": A = A.T else: raise Exception("oned_as must be 'row' or 'col' ") - - return A \ No newline at end of file + + return A diff --git a/SU2_PY/SU2/util/mp_eval.py b/SU2_PY/SU2/util/mp_eval.py index b97583d894e..2e9414d6928 100644 --- a/SU2_PY/SU2/util/mp_eval.py +++ b/SU2_PY/SU2/util/mp_eval.py @@ -7,123 +7,122 @@ # In Py3, range corresponds to Py2 xrange xrange = range + class mp_eval(object): - - def __init__(self,function,num_procs=None): - + def __init__(self, function, num_procs=None): + self.__name__ = function.__name__ - - tasks = mp.JoinableQueue() - results = mp.Queue() + + tasks = mp.JoinableQueue() + results = mp.Queue() function = TaskMaster(function) - + if num_procs is None: num_procs = mp.cpu_count() - - procs = [ QueueMaster( tasks, results, function ) - for i in xrange(num_procs) ] - - self.tasks = tasks - self.results = results + + procs = [QueueMaster(tasks, results, function) for i in xrange(num_procs)] + + self.tasks = tasks + self.results = results self.function = function - self.procs = procs - + self.procs = procs + return - - def __call__(self,inputs): - - tasks = self.tasks + + def __call__(self, inputs): + + tasks = self.tasks results = self.results - - if isinstance(inputs,np.ndarray): + + if isinstance(inputs, np.ndarray): n_inputs = inputs.shape[0] - elif isinstance(inputs,list): + elif isinstance(inputs, list): n_inputs = len(inputs) else: - raise Exception('unsupported input') - - for i_input,this_input in enumerate(inputs): - this_job = { 'index' : i_input , - 'input' : this_input , - 'result' : None } - tasks.put( this_job ) - #end + raise Exception("unsupported input") + + for i_input, this_input in enumerate(inputs): + this_job = {"index": i_input, "input": this_input, "result": None} + tasks.put(this_job) + # end # wait for tasks - tasks.join() - + tasks.join() + # pull results - result_list = [ [] ]*n_inputs + result_list = [[]] * n_inputs for i in xrange(n_inputs): result = results.get() - i_result = result['index'] - result_list[i_result] = result['result'] - + i_result = result["index"] + result_list[i_result] = result["result"] + return result_list def __del__(self): - + for proc in self.procs: self.tasks.put(None) - self.tasks.join() - + self.tasks.join() + return -class QueueMaster(mp.Process): - def __init__(self,task_queue,result_queue,task_class=None): +class QueueMaster(mp.Process): + def __init__(self, task_queue, result_queue, task_class=None): mp.Process.__init__(self) - self.task_queue = task_queue + self.task_queue = task_queue self.result_queue = result_queue - self.task_class = task_class - self.daemon = True + self.task_class = task_class + self.daemon = True self.start() def run(self): proc_name = self.name parentPID = os.getppid() - + while True: - + if os.getppid() != parentPID: - break # parent died + break # parent died this_job = self.task_queue.get() if this_job is None: self.task_queue.task_done() - break # kill signal - - this_input = this_job['input'] - this_task = self.task_class + break # kill signal + + this_input = this_job["input"] + this_task = self.task_class this_data = this_task(*this_input) - this_job['result'] = this_data + this_job["result"] = this_data self.result_queue.put(this_job) - + self.task_queue.task_done() - + #: while alive - + return + class TaskMaster(object): - def __init__(self, func): - self.func = func - def __call__(self, *arg, **kwarg): + self.func = func + + def __call__(self, *arg, **kwarg): # makes object callable result = self.func(*arg, **kwarg) return result + def __str__(self): - return '%s' % self.func + return "%s" % self.func # pickling - #def __getstate__(self): - #dict = self.__dict__.copy() - #data_dict = cloudpickle.dumps(dict) - #return data_dict - - #def __setstate__(self,data_dict): - #self.__dict__ = pickle.loads(data_dict) - #return + # def __getstate__(self): + # dict = self.__dict__.copy() + # data_dict = cloudpickle.dumps(dict) + # return data_dict + + # def __setstate__(self,data_dict): + # self.__dict__ = pickle.loads(data_dict) + # return diff --git a/SU2_PY/SU2/util/ordered_bunch.py b/SU2_PY/SU2/util/ordered_bunch.py index bc615ffdab0..e763bea6969 100644 --- a/SU2_PY/SU2/util/ordered_bunch.py +++ b/SU2_PY/SU2/util/ordered_bunch.py @@ -1,7 +1,7 @@ #!/usr/bin/env python """ OrderedBunch is a subclass of OrderedDict with attribute-style access. - + >>> b = OrderedBunch() >>> b.hello = 'world' >>> b.hello @@ -14,14 +14,14 @@ True >>> b.foo is b['foo'] True - + It is safe to import * from this module: - + __all__ = ('OrderedBunch', 'ordered_bunchify','ordered_unbunchify') - + ordered_un/bunchify provide dictionary conversion; Bunches can also be converted via OrderedBunch.to/fromOrderedDict(). - + original source: https://pypi.python.org/pypi/bunch """ @@ -29,101 +29,100 @@ from .ordered_dict import OrderedDict ## Compatability Issues... -#try: +# try: # from collections import OrderedDict -#except ImportError: +# except ImportError: # from ordered_dict import OrderedDict class OrderedBunch(OrderedDict): - """ A dictionary that provides attribute-style access. - - >>> b = OrderedBunch() - >>> b.hello = 'world' - >>> b.hello - 'world' - >>> b['hello'] += "!" - >>> b.hello - 'world!' - >>> b.foo = OrderedBunch(lol=True) - >>> b.foo.lol - True - >>> b.foo is b['foo'] - True - - A OrderedBunch is a subclass of dict; it supports all the methods a dict does... - - >>> b.keys() - ['foo', 'hello'] - - Including update()... - - >>> b.update({ 'ponies': 'are pretty!' }, hello=42) - >>> print(repr(b)) - OrderedBunch(foo=OrderedBunch(lol=True), hello=42, ponies='are pretty!') - - As well as iteration... - - >>> [ (k,b[k]) for k in b ] - [('ponies', 'are pretty!'), ('foo', OrderedBunch(lol=True)), ('hello', 42)] - - And "splats". - - >>> "The {knights} who say {ni}!".format(**OrderedBunch(knights='lolcats', ni='can haz')) - 'The lolcats who say can haz!' - - See ordered_unbunchify/OrderedBunch.toOrderedDict, ordered_bunchify/OrderedBunch.fromOrderedDict for notes about conversion. + """A dictionary that provides attribute-style access. + + >>> b = OrderedBunch() + >>> b.hello = 'world' + >>> b.hello + 'world' + >>> b['hello'] += "!" + >>> b.hello + 'world!' + >>> b.foo = OrderedBunch(lol=True) + >>> b.foo.lol + True + >>> b.foo is b['foo'] + True + + A OrderedBunch is a subclass of dict; it supports all the methods a dict does... + + >>> b.keys() + ['foo', 'hello'] + + Including update()... + + >>> b.update({ 'ponies': 'are pretty!' }, hello=42) + >>> print(repr(b)) + OrderedBunch(foo=OrderedBunch(lol=True), hello=42, ponies='are pretty!') + + As well as iteration... + + >>> [ (k,b[k]) for k in b ] + [('ponies', 'are pretty!'), ('foo', OrderedBunch(lol=True)), ('hello', 42)] + + And "splats". + + >>> "The {knights} who say {ni}!".format(**OrderedBunch(knights='lolcats', ni='can haz')) + 'The lolcats who say can haz!' + + See ordered_unbunchify/OrderedBunch.toOrderedDict, ordered_bunchify/OrderedBunch.fromOrderedDict for notes about conversion. """ - + _initialized = False - - def __init__(self,*args,**kwarg): - """ initializes the ordered dict - """ - super(OrderedBunch,self).__init__(*args,**kwarg) + + def __init__(self, *args, **kwarg): + """initializes the ordered dict""" + super(OrderedBunch, self).__init__(*args, **kwarg) self._initialized = True - + def __contains__(self, k): - """ >>> b = OrderedBunch(ponies='are pretty!') - >>> 'ponies' in b - True - >>> 'foo' in b - False - >>> b['foo'] = 42 - >>> 'foo' in b - True - >>> b.hello = 'hai' - >>> 'hello' in b - True + """>>> b = OrderedBunch(ponies='are pretty!') + >>> 'ponies' in b + True + >>> 'foo' in b + False + >>> b['foo'] = 42 + >>> 'foo' in b + True + >>> b.hello = 'hai' + >>> 'hello' in b + True """ try: return hasattr(self, k) or dict.__contains__(self, k) except: return False - - # only called if k not found in normal places + + # only called if k not found in normal places def __getattr__(self, k): - """ Gets key if it exists, otherwise throws AttributeError. - - nb. __getattr__ is only called if key is not found in normal places. - - >>> b = OrderedBunch(bar='baz', lol={}) - >>> b.foo - Traceback (most recent call last): - ... - AttributeError: foo - - >>> b.bar - 'baz' - >>> getattr(b, 'bar') - 'baz' - >>> b['bar'] - 'baz' - - >>> b.lol is b['lol'] - True - >>> b.lol is getattr(b, 'lol') - True + """Gets key if it exists, otherwise throws AttributeError. + + nb. __getattr__ is only called if key is not found in normal places. + + >>> b = OrderedBunch(bar='baz', lol={}) + >>> b.foo + Traceback (most recent call last): + ... + AttributeError: foo + + >>> b.bar + 'baz' + >>> getattr(b, 'bar') + 'baz' + >>> b['bar'] + 'baz' + + >>> b.lol is b['lol'] + True + >>> b.lol is getattr(b, 'lol') + True """ try: # Throws exception if not in prototype chain @@ -133,28 +132,28 @@ def __getattr__(self, k): return self[k] except KeyError: raise AttributeError(k) - + def __setattr__(self, k, v): - """ Sets attribute k if it exists, otherwise sets key k. A KeyError - raised by set-item (only likely if you subclass OrderedBunch) will - propagate as an AttributeError instead. - - >>> b = OrderedBunch(foo='bar', this_is='useful when subclassing') - >>> b.values #doctest: +ELLIPSIS - - >>> b.values = 'uh oh' - >>> b.values - 'uh oh' - >>> b['values'] - Traceback (most recent call last): - ... - KeyError: 'values' + """Sets attribute k if it exists, otherwise sets key k. A KeyError + raised by set-item (only likely if you subclass OrderedBunch) will + propagate as an AttributeError instead. + + >>> b = OrderedBunch(foo='bar', this_is='useful when subclassing') + >>> b.values #doctest: +ELLIPSIS + + >>> b.values = 'uh oh' + >>> b.values + 'uh oh' + >>> b['values'] + Traceback (most recent call last): + ... + KeyError: 'values' """ - + if not self._initialized: # for OrderedDict initialization return object.__setattr__(self, k, v) - + try: # Throws exception if not in prototype chain object.__getattribute__(self, k) @@ -165,22 +164,22 @@ def __setattr__(self, k, v): raise AttributeError(k) else: object.__setattr__(self, k, v) - + def __delattr__(self, k): - """ Deletes attribute k if it exists, otherwise deletes key k. A KeyError - raised by deleting the key--such as when the key is missing--will - propagate as an AttributeError instead. - - >>> b = OrderedBunch(lol=42) - >>> del b.values - Traceback (most recent call last): - ... - AttributeError: 'OrderedBunch' object attribute 'values' is read-only - >>> del b.lol - >>> b.lol - Traceback (most recent call last): - ... - AttributeError: lol + """Deletes attribute k if it exists, otherwise deletes key k. A KeyError + raised by deleting the key--such as when the key is missing--will + propagate as an AttributeError instead. + + >>> b = OrderedBunch(lol=42) + >>> del b.values + Traceback (most recent call last): + ... + AttributeError: 'OrderedBunch' object attribute 'values' is read-only + >>> del b.lol + >>> b.lol + Traceback (most recent call last): + ... + AttributeError: lol """ try: # Throws exception if not in prototype chain @@ -192,54 +191,52 @@ def __delattr__(self, k): raise AttributeError(k) else: object.__delattr__(self, k) - + def toOrderedDict(self): - """ Recursively converts a bunch back into a dictionary. - - >>> b = OrderedBunch(OrderedBunchunch(lol=True), hello=42, ponies='are pretty!') - >>> b.toOrderedDict() - {'ponies': 'are pretty!', 'foo': {'lol': True}, 'hello': 42} - - See ordered_unbunchify for more info. + """Recursively converts a bunch back into a dictionary. + + >>> b = OrderedBunch(OrderedBunchunch(lol=True), hello=42, ponies='are pretty!') + >>> b.toOrderedDict() + {'ponies': 'are pretty!', 'foo': {'lol': True}, 'hello': 42} + + See ordered_unbunchify for more info. """ return ordered_unbunchify(self) - + def __repr__(self): - """ Invertible* string-form of a OrderedBunch. - - >>> b = OrderedBunch(foo=OrderedBunch(lol=True), hello=42, ponies='are pretty!') - >>> print(repr(b)) - OrderedBunch(foo=OrderedBunch(lol=True), hello=42, ponies='are pretty!') - >>> eval(repr(b)) - OrderedBunch(foo=OrderedBunch(lol=True), hello=42, ponies='are pretty!') - - (*) Invertible so long as collection contents are each repr-invertible. + """Invertible* string-form of a OrderedBunch. + + >>> b = OrderedBunch(foo=OrderedBunch(lol=True), hello=42, ponies='are pretty!') + >>> print(repr(b)) + OrderedBunch(foo=OrderedBunch(lol=True), hello=42, ponies='are pretty!') + >>> eval(repr(b)) + OrderedBunch(foo=OrderedBunch(lol=True), hello=42, ponies='are pretty!') + + (*) Invertible so long as collection contents are each repr-invertible. """ keys = self.keys() - args = ', '.join(['%s=%r' % (key, self[key]) for key in keys]) - return '%s(%s)' % (self.__class__.__name__, args) - + args = ", ".join(["%s=%r" % (key, self[key]) for key in keys]) + return "%s(%s)" % (self.__class__.__name__, args) + def __str__(self): - """ String-form of a Bunch. - """ + """String-form of a Bunch.""" keys = self.keys() - args = ', '.join(['%s=%r' % (key, self[key]) for key in keys]) - return '{%s}' % args - + args = ", ".join(["%s=%r" % (key, self[key]) for key in keys]) + return "{%s}" % args + @staticmethod def fromOrderedDict(d): - """ Recursively transforms a dictionary into a OrderedBunch via copy. - - >>> b = OrderedBunch.fromOrderedDict({'urmom': {'sez': {'what': 'what'}}}) - >>> b.urmom.sez.what - 'what' - - See ordered_bunchify for more info. + """Recursively transforms a dictionary into a OrderedBunch via copy. + + >>> b = OrderedBunch.fromOrderedDict({'urmom': {'sez': {'what': 'what'}}}) + >>> b.urmom.sez.what + 'what' + + See ordered_bunchify for more info. """ return ordered_bunchify(d) - # While we could convert abstract types like Mapping or Iterable, I think # ordered_bunchify is more likely to "do what you mean" if it is conservative about # casting (ex: isinstance(str,Iterable) == True ). @@ -247,56 +244,58 @@ def fromOrderedDict(d): # Should you disagree, it is not difficult to duplicate this function with # more aggressive coercion to suit your own purposes. + def ordered_bunchify(x): - """ Recursively transforms a dictionary into a OrderedBunch via copy. - - >>> b = ordered_bunchify({'urmom': {'sez': {'what': 'what'}}}) - >>> b.urmom.sez.what - 'what' - - ordered_bunchify can handle intermediary dicts, lists and tuples (as well as - their subclasses), but ymmv on custom datatypes. - - >>> b = ordered_bunchify({ 'lol': ('cats', {'hah':'i win again'}), - ... 'hello': [{'french':'salut', 'german':'hallo'}] }) - >>> b.hello[0].french - 'salut' - >>> b.lol[1].hah - 'i win again' - - nb. As dicts are not hashable, they cannot be nested in sets/frozensets. + """Recursively transforms a dictionary into a OrderedBunch via copy. + + >>> b = ordered_bunchify({'urmom': {'sez': {'what': 'what'}}}) + >>> b.urmom.sez.what + 'what' + + ordered_bunchify can handle intermediary dicts, lists and tuples (as well as + their subclasses), but ymmv on custom datatypes. + + >>> b = ordered_bunchify({ 'lol': ('cats', {'hah':'i win again'}), + ... 'hello': [{'french':'salut', 'german':'hallo'}] }) + >>> b.hello[0].french + 'salut' + >>> b.lol[1].hah + 'i win again' + + nb. As dicts are not hashable, they cannot be nested in sets/frozensets. """ if isinstance(x, dict): - return OrderedBunch( (k, ordered_bunchify(v)) for k,v in x.iteritems() ) + return OrderedBunch((k, ordered_bunchify(v)) for k, v in x.iteritems()) elif isinstance(x, (list, tuple)): - return type(x)( ordered_bunchify(v) for v in x ) + return type(x)(ordered_bunchify(v) for v in x) else: return x + def ordered_unbunchify(x): - """ Recursively converts a OrderedBunch into a dictionary. - - >>> b = OrderedBunch(foo=OrderedBunch(lol=True), hello=42, ponies='are pretty!') - >>> ordered_unbunchify(b) - {'ponies': 'are pretty!', 'foo': {'lol': True}, 'hello': 42} - - ordered_unbunchify will handle intermediary dicts, lists and tuples (as well as - their subclasses), but ymmv on custom datatypes. - - >>> b = OrderedBunch(foo=['bar', OrderedBunch(lol=True)], hello=42, - ... ponies=('are pretty!', OrderedBunch(lies='are trouble!'))) - >>> ordered_unbunchify(b) #doctest: +NORMALIZE_WHITESPACE - {'ponies': ('are pretty!', {'lies': 'are trouble!'}), - 'foo': ['bar', {'lol': True}], 'hello': 42} - - nb. As dicts are not hashable, they cannot be nested in sets/frozensets. + """Recursively converts a OrderedBunch into a dictionary. + + >>> b = OrderedBunch(foo=OrderedBunch(lol=True), hello=42, ponies='are pretty!') + >>> ordered_unbunchify(b) + {'ponies': 'are pretty!', 'foo': {'lol': True}, 'hello': 42} + + ordered_unbunchify will handle intermediary dicts, lists and tuples (as well as + their subclasses), but ymmv on custom datatypes. + + >>> b = OrderedBunch(foo=['bar', OrderedBunch(lol=True)], hello=42, + ... ponies=('are pretty!', OrderedBunch(lies='are trouble!'))) + >>> ordered_unbunchify(b) #doctest: +NORMALIZE_WHITESPACE + {'ponies': ('are pretty!', {'lies': 'are trouble!'}), + 'foo': ['bar', {'lol': True}], 'hello': 42} + + nb. As dicts are not hashable, they cannot be nested in sets/frozensets. """ if isinstance(x, OrderedDict): - return OrderedDict( (k, ordered_unbunchify(v)) for k,v in x.iteritems() ) + return OrderedDict((k, ordered_unbunchify(v)) for k, v in x.iteritems()) elif isinstance(x, dict): - return dict( (k, ordered_unbunchify(v)) for k,v in x.iteritems() ) + return dict((k, ordered_unbunchify(v)) for k, v in x.iteritems()) elif isinstance(x, (list, tuple)): - return type(x)( ordered_unbunchify(v) for v in x ) + return type(x)(ordered_unbunchify(v) for v in x) else: return x @@ -308,115 +307,110 @@ def ordered_unbunchify(x): import json except ImportError: import simplejson as json - + def toJSON(self, **options): - """ Serializes this OrderedBunch to JSON. Accepts the same keyword options as `json.dumps()`. - - >>> b = OrderedBunch(foo=OrderedBunch(lol=True), hello=42, ponies='are pretty!') - >>> json.dumps(b) - '{"ponies": "are pretty!", "foo": {"lol": true}, "hello": 42}' - >>> b.toJSON() - '{"ponies": "are pretty!", "foo": {"lol": true}, "hello": 42}' + """Serializes this OrderedBunch to JSON. Accepts the same keyword options as `json.dumps()`. + + >>> b = OrderedBunch(foo=OrderedBunch(lol=True), hello=42, ponies='are pretty!') + >>> json.dumps(b) + '{"ponies": "are pretty!", "foo": {"lol": true}, "hello": 42}' + >>> b.toJSON() + '{"ponies": "are pretty!", "foo": {"lol": true}, "hello": 42}' """ return json.dumps(self, **options) - + OrderedBunch.toJSON = toJSON - + except ImportError: pass - - try: # Attempt to register ourself with PyYAML as a representer import yaml from yaml.representer import Representer, SafeRepresenter - + def from_yaml(loader, node): - """ PyYAML support for Bunches using the tag `!bunch` and `!bunch.OrderedBunch`. - - >>> import yaml - >>> yaml.load(''' - ... Flow style: !bunch.OrderedBunch { Clark: Evans, Brian: Ingerson, Oren: Ben-Kiki } - ... Block style: !bunch - ... Clark : Evans - ... Brian : Ingerson - ... Oren : Ben-Kiki - ... ''') #doctest: +NORMALIZE_WHITESPACE - {'Flow style': OrderedBunch(Brian='Ingerson', Clark='Evans', Oren='Ben-Kiki'), - 'Block style': OrderedBunch(Brian='Ingerson', Clark='Evans', Oren='Ben-Kiki')} - - This module registers itself automatically to cover both OrderedBunch and any - subclasses. Should you want to customize the representation of a subclass, - simply register it with PyYAML yourself. + """PyYAML support for Bunches using the tag `!bunch` and `!bunch.OrderedBunch`. + + >>> import yaml + >>> yaml.load(''' + ... Flow style: !bunch.OrderedBunch { Clark: Evans, Brian: Ingerson, Oren: Ben-Kiki } + ... Block style: !bunch + ... Clark : Evans + ... Brian : Ingerson + ... Oren : Ben-Kiki + ... ''') #doctest: +NORMALIZE_WHITESPACE + {'Flow style': OrderedBunch(Brian='Ingerson', Clark='Evans', Oren='Ben-Kiki'), + 'Block style': OrderedBunch(Brian='Ingerson', Clark='Evans', Oren='Ben-Kiki')} + + This module registers itself automatically to cover both OrderedBunch and any + subclasses. Should you want to customize the representation of a subclass, + simply register it with PyYAML yourself. """ data = OrderedBunch() yield data value = loader.construct_mapping(node) data.update(value) - - + def to_yaml_safe(dumper, data): - """ Converts OrderedBunch to a normal mapping node, making it appear as a - dict in the YAML output. - - >>> b = OrderedBunch(foo=['bar', OrderedBunch(lol=True)], hello=42) - >>> import yaml - >>> yaml.safe_dump(b, default_flow_style=True) - '{foo: [bar, {lol: true}], hello: 42}\\n' + """Converts OrderedBunch to a normal mapping node, making it appear as a + dict in the YAML output. + + >>> b = OrderedBunch(foo=['bar', OrderedBunch(lol=True)], hello=42) + >>> import yaml + >>> yaml.safe_dump(b, default_flow_style=True) + '{foo: [bar, {lol: true}], hello: 42}\\n' """ return dumper.represent_dict(data) - + def to_yaml(dumper, data): - """ Converts OrderedBunch to a representation node. - - >>> b = OrderedBunch(foo=['bar', OrderedBunch(lol=True)], hello=42) - >>> import yaml - >>> yaml.dump(b, default_flow_style=True) - '!bunch.OrderedBunch {foo: [bar, !bunch.OrderedBunch {lol: true}], hello: 42}\\n' + """Converts OrderedBunch to a representation node. + + >>> b = OrderedBunch(foo=['bar', OrderedBunch(lol=True)], hello=42) + >>> import yaml + >>> yaml.dump(b, default_flow_style=True) + '!bunch.OrderedBunch {foo: [bar, !bunch.OrderedBunch {lol: true}], hello: 42}\\n' """ - return dumper.represent_mapping(u'!orderedbunch.OrderedBunch', data) - - - yaml.add_constructor(u'!orderedbunch', from_yaml) - yaml.add_constructor(u'!orderedbunch.OrderedBunch', from_yaml) - + return dumper.represent_mapping("!orderedbunch.OrderedBunch", data) + + yaml.add_constructor("!orderedbunch", from_yaml) + yaml.add_constructor("!orderedbunch.OrderedBunch", from_yaml) + SafeRepresenter.add_representer(OrderedBunch, to_yaml_safe) SafeRepresenter.add_multi_representer(OrderedBunch, to_yaml_safe) - + Representer.add_representer(OrderedBunch, to_yaml) Representer.add_multi_representer(OrderedBunch, to_yaml) - - + # Instance methods for YAML conversion def toYAML(self, **options): - """ Serializes this OrderedBunch to YAML, using `yaml.safe_dump()` if - no `Dumper` is provided. See the PyYAML documentation for more info. - - >>> b = OrderedBunch(foo=['bar', OrderedBunch(lol=True)], hello=42) - >>> import yaml - >>> yaml.safe_dump(b, default_flow_style=True) - '{foo: [bar, {lol: true}], hello: 42}\\n' - >>> b.toYAML(default_flow_style=True) - '{foo: [bar, {lol: true}], hello: 42}\\n' - >>> yaml.dump(b, default_flow_style=True) - '!bunch.OrderedBunch {foo: [bar, !bunch.OrderedBunch {lol: true}], hello: 42}\\n' - >>> b.toYAML(Dumper=yaml.Dumper, default_flow_style=True) - '!bunch.OrderedBunch {foo: [bar, !bunch.OrderedBunch {lol: true}], hello: 42}\\n' + """Serializes this OrderedBunch to YAML, using `yaml.safe_dump()` if + no `Dumper` is provided. See the PyYAML documentation for more info. + + >>> b = OrderedBunch(foo=['bar', OrderedBunch(lol=True)], hello=42) + >>> import yaml + >>> yaml.safe_dump(b, default_flow_style=True) + '{foo: [bar, {lol: true}], hello: 42}\\n' + >>> b.toYAML(default_flow_style=True) + '{foo: [bar, {lol: true}], hello: 42}\\n' + >>> yaml.dump(b, default_flow_style=True) + '!bunch.OrderedBunch {foo: [bar, !bunch.OrderedBunch {lol: true}], hello: 42}\\n' + >>> b.toYAML(Dumper=yaml.Dumper, default_flow_style=True) + '!bunch.OrderedBunch {foo: [bar, !bunch.OrderedBunch {lol: true}], hello: 42}\\n' """ opts = dict(indent=4, default_flow_style=False) opts.update(options) - if 'Dumper' not in opts: + if "Dumper" not in opts: return yaml.safe_dump(self, **opts) else: return yaml.dump(self, **opts) - + def fromYAML(*args, **kwargs): - return ordered_bunchify( yaml.load(*args, **kwargs) ) - + return ordered_bunchify(yaml.load(*args, **kwargs)) + OrderedBunch.toYAML = OrderedBunch.__repr__ = toYAML OrderedBunch.fromYAML = staticmethod(fromYAML) - + except ImportError: pass diff --git a/SU2_PY/SU2/util/ordered_dict.py b/SU2_PY/SU2/util/ordered_dict.py index 0813b65a13a..c2d244f4b50 100644 --- a/SU2_PY/SU2/util/ordered_dict.py +++ b/SU2_PY/SU2/util/ordered_dict.py @@ -1,4 +1,3 @@ - """ Backport of OrderedDict() class that runs on Python 2.4, 2.5, 2.6, 2.7 and pypy. Passes Python2.7's test suite and incorporates all the latest updates. {{{ http://code.activestate.com/recipes/576693/ (r9) @@ -21,6 +20,7 @@ class OrderedDict(dict): """Dictionary that remembers insertion order""" + # An inherited dict maps keys to values. # The inherited dict provides __getitem__, __len__, __contains__, and get. # The remaining methods are order-aware. @@ -32,23 +32,23 @@ class OrderedDict(dict): # Each link is stored as a list of length three: [PREV, NEXT, KEY]. def __init__(self, *args, **kwds): - '''Initialize an ordered dictionary. Signature is the same as for + """Initialize an ordered dictionary. Signature is the same as for regular dictionaries, but keyword arguments are not recommended because their insertion order is arbitrary. - ''' + """ if len(args) > 1: - raise TypeError('expected at most 1 arguments, got %d' % len(args)) + raise TypeError("expected at most 1 arguments, got %d" % len(args)) try: self.__root except AttributeError: - self.__root = root = [] # sentinel node + self.__root = root = [] # sentinel node root[:] = [root, root, None] self.__map = {} self.__update(*args, **kwds) def __setitem__(self, key, value, dict_setitem=dict.__setitem__): - 'od.__setitem__(i, y) <==> od[i]=y' + "od.__setitem__(i, y) <==> od[i]=y" # Setting a new item creates a new link which goes at the end of the linked # list, and the inherited dictionary is updated with the new key/value pair. if key not in self: @@ -58,7 +58,7 @@ def __setitem__(self, key, value, dict_setitem=dict.__setitem__): dict_setitem(self, key, value) def __delitem__(self, key, dict_delitem=dict.__delitem__): - 'od.__delitem__(y) <==> del od[y]' + "od.__delitem__(y) <==> del od[y]" # Deleting an existing item uses self.__map to find the link which is # then removed by updating the links in the predecessor and successor nodes. dict_delitem(self, key) @@ -67,7 +67,7 @@ def __delitem__(self, key, dict_delitem=dict.__delitem__): link_next[0] = link_prev def __iter__(self): - 'od.__iter__() <==> iter(od)' + "od.__iter__() <==> iter(od)" root = self.__root curr = root[1] while curr is not root: @@ -75,7 +75,7 @@ def __iter__(self): curr = curr[1] def __reversed__(self): - 'od.__reversed__() <==> reversed(od)' + "od.__reversed__() <==> reversed(od)" root = self.__root curr = root[0] while curr is not root: @@ -83,7 +83,7 @@ def __reversed__(self): curr = curr[0] def clear(self): - 'od.clear() -> None. Remove all items from od.' + "od.clear() -> None. Remove all items from od." try: for node in self.__map.itervalues(): del node[:] @@ -95,12 +95,12 @@ def clear(self): dict.clear(self) def popitem(self, last=True): - '''od.popitem() -> (k, v), return and remove a (key, value) pair. + """od.popitem() -> (k, v), return and remove a (key, value) pair. Pairs are returned in LIFO order if last is true or FIFO order if false. - ''' + """ if not self: - raise KeyError('dictionary is empty') + raise KeyError("dictionary is empty") root = self.__root if last: link = root[0] @@ -120,45 +120,47 @@ def popitem(self, last=True): # -- the following methods do not depend on the internal structure -- def keys(self): - 'od.keys() -> list of keys in od' + "od.keys() -> list of keys in od" return list(self) def values(self): - 'od.values() -> list of values in od' + "od.values() -> list of values in od" return [self[key] for key in self] def items(self): - 'od.items() -> list of (key, value) pairs in od' + "od.items() -> list of (key, value) pairs in od" return [(key, self[key]) for key in self] def iterkeys(self): - 'od.iterkeys() -> an iterator over the keys in od' + "od.iterkeys() -> an iterator over the keys in od" return iter(self) def itervalues(self): - 'od.itervalues -> an iterator over the values in od' + "od.itervalues -> an iterator over the values in od" for k in self: yield self[k] def iteritems(self): - 'od.iteritems -> an iterator over the (key, value) items in od' + "od.iteritems -> an iterator over the (key, value) items in od" for k in self: yield (k, self[k]) def update(*args, **kwds): - '''od.update(E, **F) -> None. Update od from dict/iterable E and F. + """od.update(E, **F) -> None. Update od from dict/iterable E and F. If E is a dict instance, does: for k in E: od[k] = E[k] If E has a .keys() method, does: for k in E.keys(): od[k] = E[k] Or if E is an iterable of items, does: for k, v in E: od[k] = v In either case, this is followed by: for k, v in F.items(): od[k] = v - ''' + """ if len(args) > 2: - raise TypeError('update() takes at most 2 positional ' - 'arguments (%d given)' % (len(args),)) + raise TypeError( + "update() takes at most 2 positional " + "arguments (%d given)" % (len(args),) + ) elif not args: - raise TypeError('update() takes at least 1 argument (0 given)') + raise TypeError("update() takes at least 1 argument (0 given)") self = args[0] # Make progressively weaker assumptions about "other" other = () @@ -167,7 +169,7 @@ def update(*args, **kwds): if isinstance(other, dict): for key in other: self[key] = other[key] - elif hasattr(other, 'keys'): + elif hasattr(other, "keys"): for key in other.keys(): self[key] = other[key] else: @@ -181,10 +183,10 @@ def update(*args, **kwds): __marker = object() def pop(self, key, default=__marker): - '''od.pop(k[,d]) -> v, remove specified key and return the corresponding value. + """od.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised. - ''' + """ if key in self: result = self[key] del self[key] @@ -194,27 +196,27 @@ def pop(self, key, default=__marker): return default def setdefault(self, key, default=None): - 'od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od' + "od.setdefault(k[,d]) -> od.get(k,d), also set od[k]=d if k not in od" if key in self: return self[key] self[key] = default return default def __repr__(self, _repr_running={}): - 'od.__repr__() <==> repr(od)' + "od.__repr__() <==> repr(od)" call_key = id(self), _get_ident() if call_key in _repr_running: - return '...' + return "..." _repr_running[call_key] = 1 try: if not self: - return '%s()' % (self.__class__.__name__,) - return '%s(%r)' % (self.__class__.__name__, self.items()) + return "%s()" % (self.__class__.__name__,) + return "%s(%r)" % (self.__class__.__name__, self.items()) finally: del _repr_running[call_key] def __reduce__(self): - 'Return state information for pickling' + "Return state information for pickling" items = [[k, self[k]] for k in self] inst_dict = vars(self).copy() for k in vars(OrderedDict()): @@ -224,27 +226,27 @@ def __reduce__(self): return self.__class__, (items,) def copy(self): - 'od.copy() -> a shallow copy of od' + "od.copy() -> a shallow copy of od" return self.__class__(self) @classmethod def fromkeys(cls, iterable, value=None): - '''OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S + """OD.fromkeys(S[, v]) -> New ordered dictionary with keys from S and values equal to v (which defaults to None). - ''' + """ d = cls() for key in iterable: d[key] = value return d def __eq__(self, other): - '''od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive + """od.__eq__(y) <==> od==y. Comparison to another OD is order-sensitive while comparison to a regular mapping is order-insensitive. - ''' + """ if isinstance(other, OrderedDict): - return len(self)==len(other) and self.items() == other.items() + return len(self) == len(other) and self.items() == other.items() return dict.__eq__(self, other) def __ne__(self, other): @@ -263,4 +265,6 @@ def viewvalues(self): def viewitems(self): "od.viewitems() -> a set-like object providing a view on od's items" return ItemsView(self) + + ## end of http://code.activestate.com/recipes/576693/ }}} diff --git a/SU2_PY/SU2/util/plot.py b/SU2_PY/SU2/util/plot.py index d07a510f37d..0450f2a96ca 100644 --- a/SU2_PY/SU2/util/plot.py +++ b/SU2_PY/SU2/util/plot.py @@ -3,7 +3,7 @@ ## \file plot.py # \brief python package for plotting # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -26,67 +26,71 @@ # License along with SU2. If not, see . -def write_plot(filename,plot_format,data_plot,keys_plot=None): - """ write_plot(filename,plot_format,data_plot,keys_plot=[]) - writes a tecplot or paraview plot of dictionary data - data_plot is a dictionary of lists with equal length - if data_plot is an ordered dictionary, will output in order - otherwise use keys_plot to specify the order of output +def write_plot(filename, plot_format, data_plot, keys_plot=None): + """write_plot(filename,plot_format,data_plot,keys_plot=[]) + writes a tecplot or paraview plot of dictionary data + data_plot is a dictionary of lists with equal length + if data_plot is an ordered dictionary, will output in order + otherwise use keys_plot to specify the order of output """ default_spacing = 16 - indent_spacing = 0 + indent_spacing = 0 - if keys_plot is None: keys_plot = [] + if keys_plot is None: + keys_plot = [] if not keys_plot: keys_plot = data_plot.keys() - keys_print = [ '"'+key+'"' for key in keys_plot ] + keys_print = ['"' + key + '"' for key in keys_plot] keys_space = [default_spacing] * len(keys_plot) - header = '' - if (plot_format == 'TECPLOT'): - header = 'VARIABLES=' + header = "" + if plot_format == "TECPLOT": + header = "VARIABLES=" indent_spacing += 10 - indent_spacing = ' '*indent_spacing + indent_spacing = " " * indent_spacing n_lines = 0 - for i,key in enumerate(keys_plot): + for i, key in enumerate(keys_plot): # check vector lengths value = data_plot[key] if i == 0: n_lines = len(value) else: - assert n_lines == len(value) , 'unequal plot vector lengths' + assert n_lines == len(value), "unequal plot vector lengths" # check spacing if len(key) > keys_space[i]: keys_space[i] = len(key) keys_space[i] = "%-" + str(keys_space[i]) + "s" - plotfile = open(filename,'w') + plotfile = open(filename, "w") plotfile.write(header) - for i,key in enumerate(keys_print): - if i > 0: plotfile.write(", ") + for i, key in enumerate(keys_print): + if i > 0: + plotfile.write(", ") plotfile.write(keys_space[i] % key) - plotfile.write('\n') + plotfile.write("\n") for i_line in range(n_lines): plotfile.write(indent_spacing) - for j,key in enumerate(keys_plot): + for j, key in enumerate(keys_plot): value = data_plot[key] - if j > 0: plotfile.write(", ") + if j > 0: + plotfile.write(", ") plotfile.write(keys_space[j] % value[i_line]) - plotfile.write('\n') + plotfile.write("\n") plotfile.close() return -def tecplot(filename,data_plot,keys_plot=[]): - write_plot(filename,'TECPLOT',data_plot,keys_plot) -def paraview(filename,data_plot,keys_plot=[]): - write_plot(filename,'CSV',data_plot,keys_plot) +def tecplot(filename, data_plot, keys_plot=[]): + write_plot(filename, "TECPLOT", data_plot, keys_plot) + +def paraview(filename, data_plot, keys_plot=[]): + write_plot(filename, "CSV", data_plot, keys_plot) diff --git a/SU2_PY/SU2/util/polarSweepLib.py b/SU2_PY/SU2/util/polarSweepLib.py index 7d79f1b3dde..2114d8c9966 100755 --- a/SU2_PY/SU2/util/polarSweepLib.py +++ b/SU2_PY/SU2/util/polarSweepLib.py @@ -1,8 +1,7 @@ - # \file polarSweepLib.py # \brief Functions library for compute_polar.py script. # \author E Arad -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -28,979 +27,1188 @@ from numpy import * -def parLocator(keyWord,b,n,iDoNot,verbose): +def parLocator(keyWord, b, n, iDoNot, verbose): -#---- -- locate the relevant line in base input file -# --- do not select line iDoNot (unless it is -1) -# - keyWord=keyWord.lower() - iFocus=-1 + # ---- -- locate the relevant line in base input file + # --- do not select line iDoNot (unless it is -1) + # + keyWord = keyWord.lower() + iFocus = -1 icol = -1 for i in range(1, n): - lineString=str(b[i]).lower() -# check if : exist in line + lineString = str(b[i]).lower() + # check if : exist in line try: - icol=lineString.index(':') + icol = lineString.index(":") except ValueError: - pass # do nothing - if icol > -1 : -# verify that this line was not commented out + pass # do nothing + if icol > -1: + # verify that this line was not commented out try: - ii=lineString[:icol-1].index('#') - pass # do nothing + ii = lineString[: icol - 1].index("#") + pass # do nothing except ValueError: -# This line wasn't commented out + # This line wasn't commented out try: - ii=lineString.index(keyWord) + ii = lineString.index(keyWord) if i != iDoNot: -# string.index and not string.find is used here, since index raises -# exception when search is failed + # string.index and not string.find is used here, since index raises + # exception when search is failed if verbose: - print('parLocator: '+str(i)+' found: '+str(b[i])) - iFocus=i + print("parLocator: " + str(i) + " found: " + str(b[i])) + iFocus = i break else: - iFocus=-1 + iFocus = -1 except ValueError: - pass # do nothing + pass # do nothing if iFocus == -1: if verbose: - print('parLocator: Keyword ->'+str(keyWord)+'<- not found') + print("parLocator: Keyword ->" + str(keyWord) + "<- not found") return iFocus -def stringLocator(keyWord,b,n,verbose): -#---- -- locate the relevant line in a file -# - keyWord=keyWord.lower() - iFocus=-1 +def stringLocator(keyWord, b, n, verbose): + + # ---- -- locate the relevant line in a file + # + keyWord = keyWord.lower() + iFocus = -1 for i in range(1, n): - lineString=str(b[i]).lower() + lineString = str(b[i]).lower() try: - ii=lineString.index(keyWord) + ii = lineString.index(keyWord) if verbose: - print('parLocator: '+str(i)+' found: '+str(b[i])) - iFocus=i + print("parLocator: " + str(i) + " found: " + str(b[i])) + iFocus = i break except ValueError: - pass # do nothing + pass # do nothing if iFocus == -1: if verbose: - print('parLocator: Keyword ->'+str(keyWord)+'<- not found') + print("parLocator: Keyword ->" + str(keyWord) + "<- not found") return iFocus -def readList(dataFile,iLine,verbose): +def readList(dataFile, iLine, verbose): from numpy import size -# -#----read list from file to a local float list -# - listDataLine=dataFile[iLine] - icol=listDataLine.index(':') - Data=listDataLine[icol+1:] - lData=Data.split(',') - nData=size(lData) + + # + # ----read list from file to a local float list + # + listDataLine = dataFile[iLine] + icol = listDataLine.index(":") + Data = listDataLine[icol + 1 :] + lData = Data.split(",") + nData = size(lData) if verbose: - print('readList nData = '+str(nData)) - fData=map(float,lData) + print("readList nData = " + str(nData)) + fData = map(float, lData) return list(fData), nData -def readParameter(dataFile,nLines,keyWord,iDoNot,verbose): + +def readParameter(dataFile, nLines, keyWord, iDoNot, verbose): from numpy import size -# -#----read a parameter from a file-list -# - keyWord=keyWord.lower() - ipar = parLocator(keyWord,dataFile,nLines,iDoNot,verbose) + + # + # ----read a parameter from a file-list + # + keyWord = keyWord.lower() + ipar = parLocator(keyWord, dataFile, nLines, iDoNot, verbose) if ipar == -1: if verbose: - print(' failed to locate '+keyWord+' in base input file; Set value to 1') + print( + " failed to locate " + keyWord + " in base input file; Set value to 1" + ) paVal = 1 else: - paLine=dataFile[ipar] - icol=paLine.index(':') + paLine = dataFile[ipar] + icol = paLine.index(":") try: - iComment=paLine.index('#') - paVal=paLine[icol+1:iComment-1].lower() + iComment = paLine.index("#") + paVal = paLine[icol + 1 : iComment - 1].lower() except ValueError: - paVal=paLine[icol+1:].lower() + paVal = paLine[icol + 1 :].lower() if verbose: if ipar != -1: - print(keyWord + ' = ' + paVal) + print(keyWord + " = " + paVal) - return paVal,ipar + return paVal, ipar -def setContribution(dataFile,nLines,keyWord,iDoNot,verbose): + +def setContribution(dataFile, nLines, keyWord, iDoNot, verbose): from numpy import size import string -# -# default values -# - nameText='' + + # + # default values + # + nameText = "" removeContribution = False -# -#----Determine if a given amily contribute to force -# -# Start by locating lines setting contribution -# - keyWord=keyWord.lower() - ipar = parLocator(keyWord,dataFile,nLines,iDoNot,verbose) + # + # ----Determine if a given amily contribute to force + # + # Start by locating lines setting contribution + # + keyWord = keyWord.lower() + ipar = parLocator(keyWord, dataFile, nLines, iDoNot, verbose) if ipar == -1: if verbose: - print(' failed to locate '+keyWord+' in base input file; Set value to 1') + print( + " failed to locate " + keyWord + " in base input file; Set value to 1" + ) paVal = 1 else: - paLine=dataFile[ipar] - icol=paLine.index(':') + paLine = dataFile[ipar] + icol = paLine.index(":") -# Now identify the first part of this line + # Now identify the first part of this line firstPart = paLine[0:icol] -# now find out where the standard text ends - iBF=firstPart.lower().index('family')+6 - nameText=string.join( firstPart[iBF:].split(), "") + # now find out where the standard text ends + iBF = firstPart.lower().index("family") + 6 + nameText = string.join(firstPart[iBF:].split(), "") -# component name located. Now check about its contribution + # component name located. Now check about its contribution try: - iComment=paLine.index('#') - secondPart=paLine[icol+1:iComment-1].lower() + iComment = paLine.index("#") + secondPart = paLine[icol + 1 : iComment - 1].lower() except ValueError: - secondPart=paLine[icol+1:].lower() + secondPart = paLine[icol + 1 :].lower() -# find the second colon of this line - icol2=secondPart.index(':') + # find the second colon of this line + icol2 = secondPart.index(":") try: - iComment=secondPart.index('#') - yesNoText=secondPart[icol2+1:iComment-1].lower() + iComment = secondPart.index("#") + yesNoText = secondPart[icol2 + 1 : iComment - 1].lower() except ValueError: - yesNoText=secondPart[icol2+1:].lower() + yesNoText = secondPart[icol2 + 1 :].lower() try: - noFound=yesNoText.lower().index('no') + noFound = yesNoText.lower().index("no") removeContribution = True except ValueError: - removeContribution = False + removeContribution = False if verbose: if ipar != -1: - print(' part: '+nameText+' remove contribution: '+str(removeContribution)) + print( + " part: " + + nameText + + " remove contribution: " + + str(removeContribution) + ) - return nameText,removeContribution,ipar + return nameText, removeContribution, ipar -def setPolaraType(ctrl,nc,verbose): +def setPolaraType(ctrl, nc, verbose): -# scan the control file and determine polara type and angles -# Determine pitch direction from control file -# --------------------------------------------------- + # scan the control file and determine polara type and angles + # Determine pitch direction from control file + # --------------------------------------------------- - keyWordPitchAxis='pitch axis' - iPA = parLocator(keyWordPitchAxis,ctrl,nc,-1,verbose) + keyWordPitchAxis = "pitch axis" + iPA = parLocator(keyWordPitchAxis, ctrl, nc, -1, verbose) if iPA == -1: - PA='z' # This is the default + PA = "z" # This is the default else: - paLine=ctrl[iPA] - icol=paLine.index(':') - paVal=paLine[icol+1:].lower() - zFound = 'z' in paVal + paLine = ctrl[iPA] + icol = paLine.index(":") + paVal = paLine[icol + 1 :].lower() + zFound = "z" in paVal if zFound: - PA='z' + PA = "z" else: - yFound = 'y' in paVal + yFound = "y" in paVal if yFound: - PA='y' + PA = "y" else: - raise SystemExit('ERROR in control file: only Y or Z can be given for control keyWord ->'+keyWordPitchAxis+'<-') + raise SystemExit( + "ERROR in control file: only Y or Z can be given for control keyWord ->" + + keyWordPitchAxis + + "<-" + ) if verbose: - print('Pitch axis is '+PA.upper()) -# -# angles definitions: -# alpha ... angle of attack -# beta ... side-slip angle -# phi ... roll angle -# -# Note: Actually alpha here is the angle of rotation about the above-defined pitch axis -# Thus, by replacing the pitch-axis, all that is said here about alpha is actually for beta -# -# Several combinations of angles are possible: -#------------------------------------------------ -# 1. Polar-sweep in alpha per given phi ...... polarVar = aoa -# 2. Polar-sweep in alpha per given beta (side slip angle) ...... polarVar = aoa -# 3. Polar-sweep in phi per given alpha ...... polarVar = phi -# 4. Mach ramp (single values for alpha, phi or both permitted) ... polarVar = MachRampNumbers -# -# Note: Seting a list of both phi and beta is impossible -# For mach ramp you can specify alpha, phi (or both), but not a list of either of them -# -# Now let us find out which angles are specified in the control file, to figure out polarSweepType and polarVar -# - keyWordListAOA='angles of attack' - iListAOA = parLocator(keyWordListAOA,ctrl,nc,-1,verbose) - keyWordListPhi='roll angles' - iListPhi = parLocator(keyWordListPhi,ctrl,nc,-1,verbose) - keyWordListBeta='side slip angle' - iListBeta = parLocator(keyWordListBeta,ctrl,nc,-1,verbose) - keyWordListMRN='mach ramp numbers' - iListMRN = parLocator(keyWordListMRN,ctrl,nc,-1,verbose) - -# -# Check first if this is a Mach ramp session -# - if iListMRN > -1 : - polarSweepType=4 ; # This is a Mach rmp session - polarVar='MachRampNumbers' - MachList,nMach=readList(ctrl,iListMRN,verbose); -# -# Now check if any angle was specified -# - if iListBeta == -1 : - nBeta=0 ; beta=[ ]; - velDirOption = 1; # Velocity dirction vector v(alpha,phi). May be overwritten below - else: - beta,nBeta=readList(ctrl,iListBeta,verbose) - velDirOption = 2; # Velocity dirction vector v(alpha,beta) - if nBeta > 1 : - raise SystemExit('ERROR in control file: >>>>>>>> nBeta > 1 in a Mach Ramp session <<<<<<<<') - - if iListAOA == -1: - if velDirOption == 2 : - alpha = [0.0]; nAalpha =1; - else: - alpha =[ ] ; nAalpha=0; - velDirOption = 0; # No specification of Velocity dirction vector. May be overwritten below - else: - alpha,nAalpha=readList(ctrl,iListAOA,verbose) - if nAalpha > 1 : - raise SystemExit('ERROR in control file: >>>>>>>> nAlpha > 1 in a Mach Ramp session <<<<<<<<') - - if iListPhi == -1 : - if velDirOption != 1 : - phi = [ ] ; nPhi = 0; - else: - phi = [0.0] ; nPhi = 1; - else: - phi,nPhi=readList(ctrl,iListPhi,verbose); - if nPhi > 1 : - raise SystemExit('ERROR in control file: >>>>>>>> nPhi > 1 in a Mach Ramp session <<<<<<<<') - if velDirOption == 0 : - # if phi is specified, then this is a alpha,phi case, with alpha = 0 - velDirOption = 1; alpha = [0.0]; nAalpha =1; - - - - if nPhi + nBeta >= 2 : - raise SystemExit('ERROR in control file: >>>>>>>> Both phi and Beta specified (in a Mach Ramp session) <<<<<<<<') - - + print("Pitch axis is " + PA.upper()) + # + # angles definitions: + # alpha ... angle of attack + # beta ... side-slip angle + # phi ... roll angle + # + # Note: Actually alpha here is the angle of rotation about the above-defined pitch axis + # Thus, by replacing the pitch-axis, all that is said here about alpha is actually for beta + # + # Several combinations of angles are possible: + # ------------------------------------------------ + # 1. Polar-sweep in alpha per given phi ...... polarVar = aoa + # 2. Polar-sweep in alpha per given beta (side slip angle) ...... polarVar = aoa + # 3. Polar-sweep in phi per given alpha ...... polarVar = phi + # 4. Mach ramp (single values for alpha, phi or both permitted) ... polarVar = MachRampNumbers + # + # Note: Seting a list of both phi and beta is impossible + # For mach ramp you can specify alpha, phi (or both), but not a list of either of them + # + # Now let us find out which angles are specified in the control file, to figure out polarSweepType and polarVar + # + keyWordListAOA = "angles of attack" + iListAOA = parLocator(keyWordListAOA, ctrl, nc, -1, verbose) + keyWordListPhi = "roll angles" + iListPhi = parLocator(keyWordListPhi, ctrl, nc, -1, verbose) + keyWordListBeta = "side slip angle" + iListBeta = parLocator(keyWordListBeta, ctrl, nc, -1, verbose) + keyWordListMRN = "mach ramp numbers" + iListMRN = parLocator(keyWordListMRN, ctrl, nc, -1, verbose) + + # + # Check first if this is a Mach ramp session + # + if iListMRN > -1: + polarSweepType = 4 + # This is a Mach rmp session + polarVar = "MachRampNumbers" + MachList, nMach = readList(ctrl, iListMRN, verbose) + # + # Now check if any angle was specified + # + if iListBeta == -1: + nBeta = 0 + beta = [] + velDirOption = 1 + # Velocity dirction vector v(alpha,phi). May be overwritten below + else: + beta, nBeta = readList(ctrl, iListBeta, verbose) + velDirOption = 2 + # Velocity dirction vector v(alpha,beta) + if nBeta > 1: + raise SystemExit( + "ERROR in control file: >>>>>>>> nBeta > 1 in a Mach Ramp session <<<<<<<<" + ) + + if iListAOA == -1: + if velDirOption == 2: + alpha = [0.0] + nAalpha = 1 + else: + alpha = [] + nAalpha = 0 + velDirOption = 0 + # No specification of Velocity dirction vector. May be overwritten below + else: + alpha, nAalpha = readList(ctrl, iListAOA, verbose) + if nAalpha > 1: + raise SystemExit( + "ERROR in control file: >>>>>>>> nAlpha > 1 in a Mach Ramp session <<<<<<<<" + ) + + if iListPhi == -1: + if velDirOption != 1: + phi = [] + nPhi = 0 + else: + phi = [0.0] + nPhi = 1 + else: + phi, nPhi = readList(ctrl, iListPhi, verbose) + if nPhi > 1: + raise SystemExit( + "ERROR in control file: >>>>>>>> nPhi > 1 in a Mach Ramp session <<<<<<<<" + ) + if velDirOption == 0: + # if phi is specified, then this is a alpha,phi case, with alpha = 0 + velDirOption = 1 + alpha = [0.0] + nAalpha = 1 + + if nPhi + nBeta >= 2: + raise SystemExit( + "ERROR in control file: >>>>>>>> Both phi and Beta specified (in a Mach Ramp session) <<<<<<<<" + ) else: -# -# this is not a mach ramp - MachList=[ ]; nMach=0; -# -# So, this is a polar-sweep and not mach ramp. -# Now find out polarSweepType (1,2,or 3) -# - - if iListPhi == -1 : - if iListBeta == -1 : - polarSweepType=1 ; - polarVar='aoa' ; # phi/beta not found. Polar sweep in alpha for phi=beta=0 - velDirOption = 1; # Velocity dirction vector v(alpha,phi). - phi = [0.0] ; nPhi = 1; - nBeta=0 ; beta=[ ]; + # + # this is not a mach ramp + MachList = [] + nMach = 0 + # + # So, this is a polar-sweep and not mach ramp. + # Now find out polarSweepType (1,2,or 3) + # + + if iListPhi == -1: + if iListBeta == -1: + polarSweepType = 1 + polarVar = "aoa" + # phi/beta not found. Polar sweep in alpha for phi=beta=0 + velDirOption = 1 + # Velocity dirction vector v(alpha,phi). + phi = [0.0] + nPhi = 1 + nBeta = 0 + beta = [] else: -# beta was found in control file, phi is not there; check how about alpha - nPhi = 0 ; phi=[ ]; - polarSweepType=2 ; - polarVar='aoa' ; - velDirOption = 2; # Velocity dirction vector v(alpha,beta). - beta,nBeta=readList(ctrl,iListBeta,verbose) - if nBeta > 1 : - raise SystemExit('ERROR in control file: nBeta > 1. For polar sweep in beta exchange pitch-axis and use aoa') - - if iListAOA == -1 : - raise SystemExit('ERROR in control file: phi and alpha are missing. Polar sweep not defined') - - alpha,nAalpha=readList(ctrl,iListAOA,verbose) + # beta was found in control file, phi is not there; check how about alpha + nPhi = 0 + phi = [] + polarSweepType = 2 + polarVar = "aoa" + velDirOption = 2 + # Velocity dirction vector v(alpha,beta). + beta, nBeta = readList(ctrl, iListBeta, verbose) + if nBeta > 1: + raise SystemExit( + "ERROR in control file: nBeta > 1. For polar sweep in beta exchange pitch-axis and use aoa" + ) + + if iListAOA == -1: + raise SystemExit( + "ERROR in control file: phi and alpha are missing. Polar sweep not defined" + ) + + alpha, nAalpha = readList(ctrl, iListAOA, verbose) else: -# -# phi was found in control file, so beta must not be there -# + # + # phi was found in control file, so beta must not be there + # if iListBeta > -1: - raise SystemExit('ERROR in control file: both phi and beta specified. Polar sweep not defined ') - - nBeta=0 ; beta=[ ]; - velDirOption = 1; # Velocity dirction vector v(alpha,phi). -# -# Check now if alpha appears -# - if iListAOA == -1 : -# -# phi found in control file, but alpha is missing, so it is a polar-sweep in phi with alpha=0 -# - polarSweepType=3 ; - polarVar='phi' ; alpha =[0.0] ; nAalpha=1 + raise SystemExit( + "ERROR in control file: both phi and beta specified. Polar sweep not defined " + ) + + nBeta = 0 + beta = [] + velDirOption = 1 + # Velocity dirction vector v(alpha,phi). + # + # Check now if alpha appears + # + if iListAOA == -1: + # + # phi found in control file, but alpha is missing, so it is a polar-sweep in phi with alpha=0 + # + polarSweepType = 3 + polarVar = "phi" + alpha = [0.0] + nAalpha = 1 else: -# -# Both alpha and phi found in control file. Find out which one is a list -# - alpha,nAalpha=readList(ctrl,iListAOA,verbose) + # + # Both alpha and phi found in control file. Find out which one is a list + # + alpha, nAalpha = readList(ctrl, iListAOA, verbose) - phi,nPhi=readList(ctrl,iListPhi,verbose) + phi, nPhi = readList(ctrl, iListPhi, verbose) if nAalpha == 1: - if nPhi > 1 : - polarSweepType=3 - polarVar='phi' + if nPhi > 1: + polarSweepType = 3 + polarVar = "phi" else: - polarSweepType=1 - polarVar='aoa' + polarSweepType = 1 + polarVar = "aoa" - nBeta=0; beta=[ ]; + nBeta = 0 + beta = [] else: -# -#-----that is nAlpha > 1 -# - if nPhi > 1 : - raise SystemExit('ERROR in control file: read lists in both alpha and phi. Polar sweep not defined ') - - polarSweepType=1 ; - polarVar='aoa'; nBeta=0; beta=[ ]; - -# -# Here we end the long if cycle, refrring to Mach ramp or angle sweep - -#------------------------------------------------------------------------------------------- + # + # -----that is nAlpha > 1 + # + if nPhi > 1: + raise SystemExit( + "ERROR in control file: read lists in both alpha and phi. Polar sweep not defined " + ) + + polarSweepType = 1 + polarVar = "aoa" + nBeta = 0 + beta = [] + + # + # Here we end the long if cycle, refrring to Mach ramp or angle sweep + + # ------------------------------------------------------------------------------------------- if verbose: - if polarSweepType == 1 : - print('Sweep type: '+str(polarSweepType)+' in alpha. nAalpha = '+str(nAalpha)+' phi = '+str(phi)) - elif polarSweepType == 2 : - print('Sweep type: '+str(polarSweepType)+' in alpha. nAalpha = '+str(nAalpha)+' beta = '+str(beta)) - elif polarSweepType == 3 : - print('Sweep type: '+str(polarSweepType)+' in phi. nPhi = '+str(nPhi)+' alpha = ',str(alpha)) - elif polarSweepType == 4 : - print('Sweep type: '+str(polarSweepType)+' in Mach. nMach = '+str(nMach)) - - return PA,polarSweepType,velDirOption,nAalpha,nBeta,nPhi,nMach,alpha,beta,phi,MachList,polarVar - -def setVelDir(velDirOption,PA,alphar,phir,betar): - -# set the velocity direction - from numpy import sin,cos,tan,size - -# -# Check for alpha and if we are dealing with values greater than 88deg (near 90) -# In such cases cases change to sin cos formualtion -# - - a88=1.5359 # 88 degrees - if velDirOption == 2 : - - if PA == 'z': - if alphar < a88 : - dv1 = [cos(betar) for x in alphar] - dv2 = tan(alphar)*cos(betar) + if polarSweepType == 1: + print( + "Sweep type: " + + str(polarSweepType) + + " in alpha. nAalpha = " + + str(nAalpha) + + " phi = " + + str(phi) + ) + elif polarSweepType == 2: + print( + "Sweep type: " + + str(polarSweepType) + + " in alpha. nAalpha = " + + str(nAalpha) + + " beta = " + + str(beta) + ) + elif polarSweepType == 3: + print( + "Sweep type: " + + str(polarSweepType) + + " in phi. nPhi = " + + str(nPhi) + + " alpha = ", + str(alpha), + ) + elif polarSweepType == 4: + print( + "Sweep type: " + str(polarSweepType) + " in Mach. nMach = " + str(nMach) + ) + + return ( + PA, + polarSweepType, + velDirOption, + nAalpha, + nBeta, + nPhi, + nMach, + alpha, + beta, + phi, + MachList, + polarVar, + ) + + +def setVelDir(velDirOption, PA, alphar, phir, betar): + + # set the velocity direction + from numpy import sin, cos, tan, size + + # + # Check for alpha and if we are dealing with values greater than 88deg (near 90) + # In such cases cases change to sin cos formualtion + # + + a88 = 1.5359 # 88 degrees + if velDirOption == 2: + + if PA == "z": + if alphar < a88: + dv1 = [cos(betar) for x in alphar] + dv2 = tan(alphar) * cos(betar) dv3 = [sin(betar) for x in alphar] else: - dv1 = cos(betar)*cos(alphar) - dv2 = sin(alphar)*cos(betar) - dv3 = sin(betar)*cos(alphar) + dv1 = cos(betar) * cos(alphar) + dv2 = sin(alphar) * cos(betar) + dv3 = sin(betar) * cos(alphar) else: - if alphar < a88 : - dv1 = [cos(betar) for x in alphar] - dv2 = [sin(betar) for x in alphar] - dv3 = tan(alphar)*cos(betar) + if alphar < a88: + dv1 = [cos(betar) for x in alphar] + dv2 = [sin(betar) for x in alphar] + dv3 = tan(alphar) * cos(betar) else: - dv1 = cos(betar)*cos(alphar) - dv2 = sin(betar)*cos(alphar) - dv3 = sin(alphar)*cos(betar) + dv1 = cos(betar) * cos(alphar) + dv2 = sin(betar) * cos(alphar) + dv3 = sin(alphar) * cos(betar) else: - if size(alphar) > size(phir) : - dummyVec=alphar + if size(alphar) > size(phir): + dummyVec = alphar else: - dummyVec=phir + dummyVec = phir - if PA == 'z': - if alphar < a88 : - dv1=[1.0 for x in dummyVec ] - dv2=tan(alphar)*cos(phir) - dv3=tan(alphar)*sin(phir) + if PA == "z": + if alphar < a88: + dv1 = [1.0 for x in dummyVec] + dv2 = tan(alphar) * cos(phir) + dv3 = tan(alphar) * sin(phir) else: - if size(alphar) > 1 : - dv1= cos(alphar) + if size(alphar) > 1: + dv1 = cos(alphar) else: - dv1=[cos(alphar) for x in dummyVec ] + dv1 = [cos(alphar) for x in dummyVec] - dv2=sin(alphar)*cos(phir) - dv3=sin(alphar)*sin(phir) + dv2 = sin(alphar) * cos(phir) + dv3 = sin(alphar) * sin(phir) else: - if alphar < a88 : - dv1=[1.0 for x in dummyVec ] - dv2=tan(alphar)*sin(phir) - dv3=tan(alphar)*cos(phir) - else: - if size(alphar) > 1 : - dv1= cos(alphar) - else: - dv1=[cos(alphar) for x in dummyVec ] - dv2=sin(alphar)*sin(phir) - dv3=sin(alphar)*cos(phir) - - return dv1,dv2,dv3 - -def processAddAngle(addRunStr,nPolara,parAngle,angleEqualCriterion): -# -#--------------------------------------------------------------------- -# Process the list of interactively added angles. -# Note that parAngle can receive also MachList -#-------------------------------------------------------------------- + if alphar < a88: + dv1 = [1.0 for x in dummyVec] + dv2 = tan(alphar) * sin(phir) + dv3 = tan(alphar) * cos(phir) + else: + if size(alphar) > 1: + dv1 = cos(alphar) + else: + dv1 = [cos(alphar) for x in dummyVec] + dv2 = sin(alphar) * sin(phir) + dv3 = sin(alphar) * cos(phir) + + return dv1, dv2, dv3 -#------------ create a list out of entered angles +def processAddAngle(addRunStr, nPolara, parAngle, angleEqualCriterion): + # + # --------------------------------------------------------------------- + # Process the list of interactively added angles. + # Note that parAngle can receive also MachList + # -------------------------------------------------------------------- - addRunList=addRunStr.split(',') - fAddRunListRaw=map(float,addRunList) - fAddRunList=sort(fAddRunListRaw) - nAddRun=size(fAddRunList) + # ------------ create a list out of entered angles -#------- By default, do not compute the cases in input file, since they were computed already + addRunList = addRunStr.split(",") + fAddRunListRaw = map(float, addRunList) + fAddRunList = sort(fAddRunListRaw) + nAddRun = size(fAddRunList) - computeCase=[False for j in range(0,nPolara+nAddRun)] - rerunCase = [False for j in range(0,nPolara+nAddRun)] + # ------- By default, do not compute the cases in input file, since they were computed already + computeCase = [False for j in range(0, nPolara + nAddRun)] + rerunCase = [False for j in range(0, nPolara + nAddRun)] -#----- Now, for each new angle/Mach verify if it is a rerun or inserted new value + # ----- Now, for each new angle/Mach verify if it is a rerun or inserted new value - closestAngle=[0 for i in range(0,nAddRun)] - for i in range(0,nAddRun): + closestAngle = [0 for i in range(0, nAddRun)] + for i in range(0, nAddRun): - diff=[abs(fAddRunList[i]-x) for x in parAngle] - iClose=diff.index(min(diff)) - closestAngle[i]=parAngle[iClose] + diff = [abs(fAddRunList[i] - x) for x in parAngle] + iClose = diff.index(min(diff)) + closestAngle[i] = parAngle[iClose] if min(diff) < angleEqualCriterion: - computeCase[iClose]=True - rerunCase[iClose]=True + computeCase[iClose] = True + rerunCase[iClose] = True else: if fAddRunList[i] > closestAngle[i]: - ii=iClose+1 + ii = iClose + 1 else: - ii=iClose + ii = iClose - tmpAng1=parAngle[:ii] + tmpAng1 = parAngle[:ii] tmpAng1.append(fAddRunList[i]) - tmpAng2=parAngle[ii:] + tmpAng2 = parAngle[ii:] tmpAng1.extend(tmpAng2) - parAngle=tmpAng1 - nPolara=nPolara+1 - computeCase[ii]=True + parAngle = tmpAng1 + nPolara = nPolara + 1 + computeCase[ii] = True + return nPolara, parAngle, computeCase, rerunCase - return nPolara,parAngle,computeCase,rerunCase -def updatedControlFile(ctrl,nc,parAngle,ctrlFile,verbose): +def updatedControlFile(ctrl, nc, parAngle, ctrlFile, verbose): -# generate a modified control file for case with addRun options + # generate a modified control file for case with addRun options import os -# -#-- get a proper list of updated parameter-angle - st1=str(parAngle) - updatedAngleList=st1[1:-1] -# Now let us find out which angles are specified in the control file, to figure out polarSweepType and polarVar -# - keyWordListAOA='angles of attack' - iListAOA = parLocator(keyWordListAOA,ctrl,nc,-1,verbose) - keyWordListPhi='roll angles' - iListPhi = parLocator(keyWordListPhi,ctrl,nc,-1,verbose) - keyWordListBeta='side slip angle' - iListBeta = parLocator(keyWordListBeta,ctrl,nc,-1,verbose) - keyWordListMRN='mach ramp numbers' - iListMRN = parLocator(keyWordListMRN,ctrl,nc,-1,verbose) -# -# Check first if this is a Mach ramp session -# - if iListMRN > -1 : - polarSweepType=4 ; # This is a Mach rmp session - polarVar='MachRampNumbers' - MachList,nMach=readList(ctrl,iListMRN,verbose); -# -# Now check if any angle was specified -# - if iListBeta == -1 : - nBeta=0 ; beta=[ ]; - velDirOption = 1; # Velocity dirction vector v(alpha,phi). May be overwritten below - else: - beta,nBeta=readList(ctrl,iListBeta,verbose) - velDirOption = 2; # Velocity dirction vector v(alpha,beta) - if nBeta > 1 : - raise SystemExit('ERROR in control file: >>>>>>>> nBeta > 1 in a Mach Ramp session <<<<<<<<') - - if iListAOA == -1: - if velDirOption == 2 : - alpha = [0.0]; nAalpha =1; - else: - alpha =[ ] ; nAalpha=0; - velDirOption = 0; # No specification of Velocity dirction vector. May be overwritten below - else: - alpha,nAalpha=readList(ctrl,iListAOA,verbose) - if nAalpha > 1 : - raise SystemExit('ERROR in control file: >>>>>>>> nAlpha > 1 in a Mach Ramp session <<<<<<<<') - - if iListPhi == -1 : - if velDirOption != 1 : - phi = [ ] ; nPhi = 0; - else: - phi = [0.0] ; nPhi = 1; - else: - phi,nPhi=readList(ctrl,iListPhi,verbose); - if nPhi > 1 : - raise SystemExit('ERROR in control file: >>>>>>>> nPhi > 1 in a Mach Ramp session <<<<<<<<') - if velDirOption == 0 : -# if phi is specified, then this is a alpha,phi case, with alpha = 0 - velDirOption = 1; alpha = [0.0]; nAalpha =1; - - if nPhi + nBeta >= 2 : - raise SystemExit('ERROR in control file: >>>>>>>> Both phi and Beta specified (in a Mach Ramp session) <<<<<<<<') - - ctrl[iListMRN]=' Mach ramp numbers : '+updatedAngleList+'\n' - else: -# -# this is not a mach ramp - MachList=[ ]; nMach=0; - if iListPhi == -1 : - if iListBeta == -1 : - polarSweepType=1 ; - polarVar='aoa' ; # phi/beta not found. Polar sweep in alpha for phi=beta=0 - phi = [0.0] ; nPhi = 1; - nBeta=0 ; beta=[ ]; + # + # -- get a proper list of updated parameter-angle + st1 = str(parAngle) + updatedAngleList = st1[1:-1] + # Now let us find out which angles are specified in the control file, to figure out polarSweepType and polarVar + # + keyWordListAOA = "angles of attack" + iListAOA = parLocator(keyWordListAOA, ctrl, nc, -1, verbose) + keyWordListPhi = "roll angles" + iListPhi = parLocator(keyWordListPhi, ctrl, nc, -1, verbose) + keyWordListBeta = "side slip angle" + iListBeta = parLocator(keyWordListBeta, ctrl, nc, -1, verbose) + keyWordListMRN = "mach ramp numbers" + iListMRN = parLocator(keyWordListMRN, ctrl, nc, -1, verbose) + # + # Check first if this is a Mach ramp session + # + if iListMRN > -1: + polarSweepType = 4 + # This is a Mach rmp session + polarVar = "MachRampNumbers" + MachList, nMach = readList(ctrl, iListMRN, verbose) + # + # Now check if any angle was specified + # + if iListBeta == -1: + nBeta = 0 + beta = [] + velDirOption = 1 + # Velocity dirction vector v(alpha,phi). May be overwritten below + else: + beta, nBeta = readList(ctrl, iListBeta, verbose) + velDirOption = 2 + # Velocity dirction vector v(alpha,beta) + if nBeta > 1: + raise SystemExit( + "ERROR in control file: >>>>>>>> nBeta > 1 in a Mach Ramp session <<<<<<<<" + ) + + if iListAOA == -1: + if velDirOption == 2: + alpha = [0.0] + nAalpha = 1 else: -# beta was found in control file, phi is not there; check how about alpha - nPhi = 0 ; phi=[ ]; - polarSweepType=2 ; - polarVar='aoa' ; - beta,nBeta=readList(ctrl,iListBeta,verbose) - if nBeta > 1 : - raise SystemExit('ERROR in control file: nBeta > 1. For polar sweep in beta exchange pitch-axis and use aoa') - - if iListAOA == -1 : - raise SystemExit('ERROR in control file: phi and alpha are missing. Polar sweep not defined') + alpha = [] + nAalpha = 0 + velDirOption = 0 + # No specification of Velocity dirction vector. May be overwritten below + else: + alpha, nAalpha = readList(ctrl, iListAOA, verbose) + if nAalpha > 1: + raise SystemExit( + "ERROR in control file: >>>>>>>> nAlpha > 1 in a Mach Ramp session <<<<<<<<" + ) + + if iListPhi == -1: + if velDirOption != 1: + phi = [] + nPhi = 0 + else: + phi = [0.0] + nPhi = 1 + else: + phi, nPhi = readList(ctrl, iListPhi, verbose) + if nPhi > 1: + raise SystemExit( + "ERROR in control file: >>>>>>>> nPhi > 1 in a Mach Ramp session <<<<<<<<" + ) + if velDirOption == 0: + # if phi is specified, then this is a alpha,phi case, with alpha = 0 + velDirOption = 1 + alpha = [0.0] + nAalpha = 1 + + if nPhi + nBeta >= 2: + raise SystemExit( + "ERROR in control file: >>>>>>>> Both phi and Beta specified (in a Mach Ramp session) <<<<<<<<" + ) + + ctrl[iListMRN] = " Mach ramp numbers : " + updatedAngleList + "\n" - alpha,nAalpha=readList(ctrl,iListAOA,verbose) - ctrl[iListAOA]=' angles of attack : '+updatedAngleList+'\n' + else: + # + # this is not a mach ramp + MachList = [] + nMach = 0 + if iListPhi == -1: + if iListBeta == -1: + polarSweepType = 1 + polarVar = "aoa" + # phi/beta not found. Polar sweep in alpha for phi=beta=0 + phi = [0.0] + nPhi = 1 + nBeta = 0 + beta = [] + else: + # beta was found in control file, phi is not there; check how about alpha + nPhi = 0 + phi = [] + polarSweepType = 2 + polarVar = "aoa" + beta, nBeta = readList(ctrl, iListBeta, verbose) + if nBeta > 1: + raise SystemExit( + "ERROR in control file: nBeta > 1. For polar sweep in beta exchange pitch-axis and use aoa" + ) + + if iListAOA == -1: + raise SystemExit( + "ERROR in control file: phi and alpha are missing. Polar sweep not defined" + ) + + alpha, nAalpha = readList(ctrl, iListAOA, verbose) + ctrl[iListAOA] = " angles of attack : " + updatedAngleList + "\n" else: -# phi was found in control file, so beta must not be there + # phi was found in control file, so beta must not be there if iListBeta > -1: - raise SystemExit('ERROR in control file: both phi and beta specified. Polar sweep not defined ') - - nBeta=0 ; beta=[ ]; -# Check now if alpha appears - if iListAOA == -1 : -# phi found in control file, but alpha is missing, so it is a polar-sweep in phi with alpha=0 - polarSweepType=3 ; - polarVar='phi' ; alpha =[0.0] ; nAalpha=1 + raise SystemExit( + "ERROR in control file: both phi and beta specified. Polar sweep not defined " + ) + + nBeta = 0 + beta = [] + # Check now if alpha appears + if iListAOA == -1: + # phi found in control file, but alpha is missing, so it is a polar-sweep in phi with alpha=0 + polarSweepType = 3 + polarVar = "phi" + alpha = [0.0] + nAalpha = 1 else: -# -# Both alpha and phi found in control file. Find out which one is a list -# - alpha,nAalpha=readList(ctrl,iListAOA,verbose) - if nAalpha > 1 : - ctrl[iListAOA]=' angles of attack : '+updatedAngleList+'\n' - - phi,nPhi=readList(ctrl,iListPhi,verbose) + # + # Both alpha and phi found in control file. Find out which one is a list + # + alpha, nAalpha = readList(ctrl, iListAOA, verbose) + if nAalpha > 1: + ctrl[iListAOA] = " angles of attack : " + updatedAngleList + "\n" + + phi, nPhi = readList(ctrl, iListPhi, verbose) if nPhi > 1: - ctrl[iListPhi]=' roll angles : '+updatedAngleList+'\n' + ctrl[iListPhi] = " roll angles : " + updatedAngleList + "\n" -# Prepare a backup of control file + # Prepare a backup of control file - shutil.copy2(ctrlFile, ctrlFile+'.bck') -# -# --- Write down the updated file - fc=open(ctrlFile,'w') + shutil.copy2(ctrlFile, ctrlFile + ".bck") + # + # --- Write down the updated file + fc = open(ctrlFile, "w") fc.writelines(ctrl) fc.close() - print('More cases were added. Original ctrl file saved at '+ctrlFile+'.bck File '+ctrlFile+' updated') - + print( + "More cases were added. Original ctrl file saved at " + + ctrlFile + + ".bck File " + + ctrlFile + + " updated" + ) return -def retrievePhysicalData(b,n,polarSweepType,verbose): -# scan the control file and retrieve physical data parameters and their location -# Included are Mach and reynolds number (non-dim group) -# Pref, rho_ref, Tref (ref group) -# --------------------------------------------------- -# -# physical data, needed for Mach ramp -# - keyWord='mach for coefficients' - MachNumCoef,iparMcoeff=readParameter(b,n,keyWord,-1,verbose) - keyWord='mach' - MachNum,iprMach=readParameter(b,n,keyWord,iparMcoeff,verbose) # look for Mach, but avoid Mach for coefficients - keyWord='reynolds length (in meter)' - ReNumRefLength,iprDRe=readParameter(b,n,keyWord,-1,verbose) - keyWord='reynolds' - ReNum,iprRe=readParameter(b,n,keyWord,iprDRe,verbose) - sNonDimNum=[MachNum,MachNumCoef,ReNum,ReNumRefLength] - nonDimNum=map(float,sNonDimNum) - nonDimNumLoc=[iprMach,iparMcoeff,iprRe,iprDRe] -# -# the next set of parameters might, or might not appear in base input file -# If they appear, they should be updated in a Mach ramp. All 3 of them are needed. -# +def retrievePhysicalData(b, n, polarSweepType, verbose): + + # scan the control file and retrieve physical data parameters and their location + # Included are Mach and reynolds number (non-dim group) + # Pref, rho_ref, Tref (ref group) + # --------------------------------------------------- + # + # physical data, needed for Mach ramp + # + keyWord = "mach for coefficients" + MachNumCoef, iparMcoeff = readParameter(b, n, keyWord, -1, verbose) + keyWord = "mach" + MachNum, iprMach = readParameter( + b, n, keyWord, iparMcoeff, verbose + ) # look for Mach, but avoid Mach for coefficients + keyWord = "reynolds length (in meter)" + ReNumRefLength, iprDRe = readParameter(b, n, keyWord, -1, verbose) + keyWord = "reynolds" + ReNum, iprRe = readParameter(b, n, keyWord, iprDRe, verbose) + sNonDimNum = [MachNum, MachNumCoef, ReNum, ReNumRefLength] + nonDimNum = map(float, sNonDimNum) + nonDimNumLoc = [iprMach, iparMcoeff, iprRe, iprDRe] + # + # the next set of parameters might, or might not appear in base input file + # If they appear, they should be updated in a Mach ramp. All 3 of them are needed. + # refParNo = 0 - keyWord='Reference pressure (in Pa)' - pRef,iprPr=readParameter(b,n,keyWord,-1,verbose) - if iprPr > -1 : - refParNo =refParNo + 1; + keyWord = "Reference pressure (in Pa)" + pRef, iprPr = readParameter(b, n, keyWord, -1, verbose) + if iprPr > -1: + refParNo = refParNo + 1 - keyWord='Reference density (in kg/m^3)' - rhoRef,iprRho=readParameter(b,n,keyWord,-1,verbose) + keyWord = "Reference density (in kg/m^3)" + rhoRef, iprRho = readParameter(b, n, keyWord, -1, verbose) if iprRho > -1: - refParNo =refParNo + 1; + refParNo = refParNo + 1 - keyWord='Reference temperature (in K)' - TRef,iprT=readParameter(b,n,keyWord,-1,verbose) + keyWord = "Reference temperature (in K)" + TRef, iprT = readParameter(b, n, keyWord, -1, verbose) if iprT > -1: - refParNo =refParNo + 1; + refParNo = refParNo + 1 - if refParNo == 3 : + if refParNo == 3: refParExist = True - elif refParNo == 0 : + elif refParNo == 0: refParExist = False else: - if polarSweepType == 4 : - raise SystemExit('ERROR in control file: in Mach ramp, base file should include (Pr,rho_r,Tr) or none of them') + if polarSweepType == 4: + raise SystemExit( + "ERROR in control file: in Mach ramp, base file should include (Pr,rho_r,Tr) or none of them" + ) if refParExist: - sRefPar=[pRef,rhoRef,TRef] - refPar=map(float,sRefPar) - refParLoc=[iprPr,iprRho,iprT] -# -# Thermodynamic properties -# - keyWord='Constant specific heat ratio' - gamma,iprGamma=readParameter(b,n,keyWord,-1,verbose) - keyWord='Gas constant (J/(kg K))' - rGas,iprGasC=readParameter(b,n,keyWord,-1,verbose) - keyWord='Free stream temperature (in K)' - TFreeS,iprTFreeS=readParameter(b,n,keyWord,-1,verbose) - - sThermoPar=[gamma,rGas,TFreeS] - thermoPar=map(float,sThermoPar) - thermoParLoc=[iprGamma,iprGasC,iprTFreeS] + sRefPar = [pRef, rhoRef, TRef] + refPar = map(float, sRefPar) + refParLoc = [iprPr, iprRho, iprT] + # + # Thermodynamic properties + # + keyWord = "Constant specific heat ratio" + gamma, iprGamma = readParameter(b, n, keyWord, -1, verbose) + keyWord = "Gas constant (J/(kg K))" + rGas, iprGasC = readParameter(b, n, keyWord, -1, verbose) + keyWord = "Free stream temperature (in K)" + TFreeS, iprTFreeS = readParameter(b, n, keyWord, -1, verbose) + + sThermoPar = [gamma, rGas, TFreeS] + thermoPar = map(float, sThermoPar) + thermoParLoc = [iprGamma, iprGasC, iprTFreeS] if verbose: - print('base case parameters of Mach ramp') - print('---------------------------------') - print(' M = '+sNonDimNum[0]+' Reynolds = '+sNonDimNum[2]) + print("base case parameters of Mach ramp") + print("---------------------------------") + print(" M = " + sNonDimNum[0] + " Reynolds = " + sNonDimNum[2]) if refParExist: - print(' Pref = '+str(refPar[0])+' rhor = '+str(refPar[1])+' Tr = '+str(refPar[2])) - print(' gamma = '+str(thermoPar[0])+ ' Gas Const = '+str(thermoPar[1])+' T_freeStream = '+str(thermoPar[2])) - - - return nonDimNum,nonDimNumLoc,refParExist,refPar,refParLoc,thermoPar,thermoParLoc + print( + " Pref = " + + str(refPar[0]) + + " rhor = " + + str(refPar[1]) + + " Tr = " + + str(refPar[2]) + ) + print( + " gamma = " + + str(thermoPar[0]) + + " Gas Const = " + + str(thermoPar[1]) + + " T_freeStream = " + + str(thermoPar[2]) + ) + + return ( + nonDimNum, + nonDimNumLoc, + refParExist, + refPar, + refParLoc, + thermoPar, + thermoParLoc, + ) + + +def fMachIsentropic(Mach, Gamma): + + # Isentropic relation of Mach + # --------------------------------------------------- + # + fMach = 1.0 + (Gamma - 1.0) / 2.0 * Mach * Mach + return fMach -def fMachIsentropic(Mach,Gamma): -# Isentropic relation of Mach -# --------------------------------------------------- -# - fMach = 1.0 + (Gamma-1.0)/2.0*Mach*Mach; - return fMach # # -def extractUy(filename,outFile,inDepVar,depVar,verbose): +def extractUy(filename, outFile, inDepVar, depVar, verbose): import os import sys + # --------------- read the file -#--------------- read the file - - fc=open(filename,'r') - data=fc.readlines() - nc=size(data) + fc = open(filename, "r") + data = fc.readlines() + nc = size(data) fc.close() - print(str(nc)+' lines were written from file '+filename+'. File closed') + print(str(nc) + " lines were written from file " + filename + ". File closed") -# --------------Retreive the variables names in the Tecplot file + # --------------Retreive the variables names in the Tecplot file - ivb=stringLocator('VARIABLES',data,nc,verbose) + ivb = stringLocator("VARIABLES", data, nc, verbose) if ivb == -1: - raise SystemExit('ERROR: failed to trace VARIABLES list in input file') + raise SystemExit("ERROR: failed to trace VARIABLES list in input file") - izo=stringLocator('ZONE',data,nc,verbose) + izo = stringLocator("ZONE", data, nc, verbose) if izo == -1: - raise SystemExit('ERROR: failed to trace ZONE list in input file') + raise SystemExit("ERROR: failed to trace ZONE list in input file") - izo=izo-1 # last variables line - print('list of variables traced between lines '+str(ivb)+' and ',str(izo)) + izo = izo - 1 # last variables line + print("list of variables traced between lines " + str(ivb) + " and ", str(izo)) - varListLines=data[ivb:izo] - nV=len(varListLines) - varList=[] - iX=-1 - iY=-1 + varListLines = data[ivb:izo] + nV = len(varListLines) + varList = [] + iX = -1 + iY = -1 for i in range(0, nV): - i1=varListLines[i].index('"')+1 - i2=varListLines[i].rindex('"') + i1 = varListLines[i].index('"') + 1 + i2 = varListLines[i].rindex('"') varList.append(varListLines[i][i1:i2]) if iX == -1: try: - ifound= varList[i].index(inDepVar) - iX=i + ifound = varList[i].index(inDepVar) + iX = i except ValueError: - pass # do nothing + pass # do nothing if iY == -1: try: - ifound= varList[i].index(depVar) - iY=i + ifound = varList[i].index(depVar) + iY = i except ValueError: - pass # do nothing - - print('inDepVar: '+inDepVar+' : '+str(iX+1)+' . DepVar: '+depVar+' : '+str(iY+1)+' of '+str(nV)+' variables') - -# find out how many nodes - - inodes=stringLocator('Nodes',data,nc,verbose) + pass # do nothing + + print( + "inDepVar: " + + inDepVar + + " : " + + str(iX + 1) + + " . DepVar: " + + depVar + + " : " + + str(iY + 1) + + " of " + + str(nV) + + " variables" + ) + + # find out how many nodes + + inodes = stringLocator("Nodes", data, nc, verbose) if inodes == -1: - raise SystemExit('ERROR: failed to trace nodes in input file') - - i1=data[inodes].index('=')+1 - i2=data[inodes].index(',') - Nodes=int(data[inodes][i1:i2]) - print('Nodes = ',str(Nodes)) -# -# now map the whole matrix -# - i1=inodes+3 - i2=i1+Nodes - X=[]; Y=[] - for i in range(i1+1, i2): - ff=map(float,data[i][1:-1].split(' ')) + raise SystemExit("ERROR: failed to trace nodes in input file") + + i1 = data[inodes].index("=") + 1 + i2 = data[inodes].index(",") + Nodes = int(data[inodes][i1:i2]) + print("Nodes = ", str(Nodes)) + # + # now map the whole matrix + # + i1 = inodes + 3 + i2 = i1 + Nodes + X = [] + Y = [] + for i in range(i1 + 1, i2): + ff = map(float, data[i][1:-1].split(" ")) X.append(ff[iX]) Y.append(ff[iY]) - nP=len(X) + nP = len(X) -#------ sorting by X + # ------ sorting by X - ind = lexsort((Y,X)) - Xs=take(X,ind) - Ys=take(Y,ind) -# write down to a simple 2-columns file - foc=open(outFile,'w') - fileHeader = ' '+inDepVar+' '+depVar - foc.write('% '+fileHeader+' \n% -----------------------------------\n%\n') - for i in range(0,nP): - Line1= ' %10.5f %14.5g '%(Xs[i],Ys[i])+' \n' + ind = lexsort((Y, X)) + Xs = take(X, ind) + Ys = take(Y, ind) + # write down to a simple 2-columns file + foc = open(outFile, "w") + fileHeader = " " + inDepVar + " " + depVar + foc.write("% " + fileHeader + " \n% -----------------------------------\n%\n") + for i in range(0, nP): + Line1 = " %10.5f %14.5g " % (Xs[i], Ys[i]) + " \n" foc.write(Line1) foc.close() + # numpy.plot(Xs,Ys,"-b") # -def loadArray(Fin,nCol): -# -# load a polar-sweep file as an array -# - f=open(Fin,'r') - b=f.readlines() - n=size(b) +def loadArray(Fin, nCol): + # + # load a polar-sweep file as an array + # + f = open(Fin, "r") + b = f.readlines() + n = size(b) f.close() -# - data=[] - nd=0; - for i in range(0,n): - sline=b[i].replace(' ',' ').replace(' ',' ').replace(' ',' ').replace(' ',' ').strip().split(' ') - sv=size(sline) + # + data = [] + nd = 0 + for i in range(0, n): + sline = ( + b[i] + .replace(" ", " ") + .replace(" ", " ") + .replace(" ", " ") + .replace(" ", " ") + .strip() + .split(" ") + ) + sv = size(sline) if sv == nCol: try: - dd=map(float,sline) + dd = map(float, sline) data.append(dd) - nd=nd+1; + nd = nd + 1 except ValueError: - pass # do nothing - - return data,nd - -def locateSteps(d,nd,nCol): -# -# read polarsweep files and identify steps -# - eps=0.001 - nColD=nCol-2 # cxbase and quality are not checked - a=array(d) - dx=diff(a[:,0],n=1,axis=0) - nStairs=[] - for ic in range(1,nColD): - dy=diff(a[:,ic],n=1,axis=0) - dydx=dy/dx - adydx=abs(dydx) - madydx=adydx.mean(axis=0) - mmxadydx=max(adydx) - mmnadydx=min(adydx) - madydx2=(mmxadydx+mmnadydx)/2 - iic=where(adydx 0: - fst=open('stairs','w') - fst.write('% \n% Polara stairs report \n% \n') - fst.write('% Note that the identified number might be something between the correct number of stairs \n') - fst.write('% and 2X this number since since 2 criteria are added in the search script \n \n ') - Headers=['CX ','CY ','CZ ','Cmx','Cmy','Cmz'] - for ic in range(0,nColD-1): - refLine1= Headers[ic]+': Number of stairs identified: %i \n '%(nStairs[ic]) - fst.write(refLine1) + fst = open("stairs", "w") + fst.write("% \n% Polara stairs report \n% \n") + fst.write( + "% Note that the identified number might be something between the correct number of stairs \n" + ) + fst.write( + "% and 2X this number since since 2 criteria are added in the search script \n \n " + ) + Headers = ["CX ", "CY ", "CZ ", "Cmx", "Cmy", "Cmz"] + for ic in range(0, nColD - 1): + refLine1 = Headers[ic] + ": Number of stairs identified: %i \n " % ( + nStairs[ic] + ) + fst.write(refLine1) fst.close() - return nStairs,nStM + return nStairs, nStM + def find_index(ar, eps): -# -# locate array components that are > eps -# - ia=[] + # + # locate array components that are > eps + # + ia = [] for i, v in enumerate(ar): if v > eps: ia.append(i) return ia -def testComponentSum(cbdOutput,verbose): -# -# check cbd summation -# - coeffNames=['Cfx','Cfy','Cfz','Cmx','Cmy','Cmz'] +def testComponentSum(cbdOutput, verbose): + # + # check cbd summation + # + + coeffNames = ["Cfx", "Cfy", "Cfz", "Cmx", "Cmy", "Cmz"] try: - fd=open(cbdOutput,'r'); - d=fd.readlines() - nd=size(d) + fd = open(cbdOutput, "r") + d = fd.readlines() + nd = size(d) fd.close() if verbose: - print('CBD file '+cbdOutput+' loaded by testComponentSum') + print("CBD file " + cbdOutput + " loaded by testComponentSum") except IOError: - raise SystemExit('testComponentSum: Failed to find file '+cbdOutput) - -# now read the numerical values from the cdb file - - data,nd=loadArray(cbdOutput,6) -# transpose the array - td=zip(*data) -# now check correct som for each variable - eps=0.01 - errorA=[] - sumD=[] - for i in range(0,6): - fsumD=sum(td[i][:-1]) + raise SystemExit("testComponentSum: Failed to find file " + cbdOutput) + + # now read the numerical values from the cdb file + + data, nd = loadArray(cbdOutput, 6) + # transpose the array + td = zip(*data) + # now check correct som for each variable + eps = 0.01 + errorA = [] + sumD = [] + for i in range(0, 6): + fsumD = sum(td[i][:-1]) sumD.append(fsumD) - if abs(td[i][nd-1]) > eps: - error=abs((fsumD-td[i][nd-1])/td[i][nd-1]) + if abs(td[i][nd - 1]) > eps: + error = abs((fsumD - td[i][nd - 1]) / td[i][nd - 1]) else: - error=0 + error = 0 errorA.append(error) - iErr=find_index(errorA, 0.005) - nER=size(iErr) + iErr = find_index(errorA, 0.005) + nER = size(iErr) if nER > 0: - print('testComponentSum: Error is components sumation in file '+cbdOutput) - for i in range(0,nER): - print('Error found in '+coeffNames[iErr[i]]+' Error = '+str(100*errorA[iErr[i]])+' %') - - corrDataLine=' %12.5e %12.5e %12.5e %12.5e %12.5e %12.5e '%(sumD[0],sumD[1], - sumD[2],sumD[3],sumD[4],sumD[5]) + print("testComponentSum: Error is components sumation in file " + cbdOutput) + for i in range(0, nER): + print( + "Error found in " + + coeffNames[iErr[i]] + + " Error = " + + str(100 * errorA[iErr[i]]) + + " %" + ) + + corrDataLine = " %12.5e %12.5e %12.5e %12.5e %12.5e %12.5e " % ( + sumD[0], + sumD[1], + sumD[2], + sumD[3], + sumD[4], + sumD[5], + ) else: - corrDataLine=' ' - return nER,corrDataLine + corrDataLine = " " + return nER, corrDataLine + -def retreiveNumPar(ctrl,nc,keyWord,parType,verbose): +def retreiveNumPar(ctrl, nc, keyWord, parType, verbose): # get the parameter from the control file. Set it to unity if not found # parType: 1 -> integer 2 -> float -# - ipar = parLocator(keyWord,ctrl,nc,-1,verbose) + # + ipar = parLocator(keyWord, ctrl, nc, -1, verbose) if ipar == -1: - # default value + # default value if parType == 1: parVal = 1 else: parVal = 1.0 else: - PARLine=ctrl[ipar] - icol=PARLine.index(':') + PARLine = ctrl[ipar] + icol = PARLine.index(":") if parType == 1: - parVal= int(PARLine[icol+1:]) + parVal = int(PARLine[icol + 1 :]) else: - parVal=float(PARLine[icol+1:]) + parVal = float(PARLine[icol + 1 :]) return parVal + # ----------------------------------------------------- -def loadData(filename,delim): -# read a 2D data from a file, separated by delim -# (may be , (comma) or ' ' (space ) -# -# do array(dout) (in calling) to obtain result as an array (numpy imported) -# dout=loadData(filename,delim) -# v=array(dout) + +def loadData(filename, delim): + # read a 2D data from a file, separated by delim + # (may be , (comma) or ' ' (space ) + # + # do array(dout) (in calling) to obtain result as an array (numpy imported) + # dout=loadData(filename,delim) + # v=array(dout) import csv -# import numpy - data=[] - with open(filename, 'rb') as f: -#-avoid NULL error + # import numpy - reader = csv.reader((line.replace('\0','').replace(' ',' ').replace(' ',' ').strip() for line in f),delimiter=delim) + data = [] + with open(filename, "rb") as f: + # -avoid NULL error - data=[' '] + reader = csv.reader( + ( + line.replace("\0", "").replace(" ", " ").replace(" ", " ").strip() + for line in f + ), + delimiter=delim, + ) + + data = [" "] for row in reader: try: data.append(map(float, row)) except ValueError: - print('Line doesnt match map float: ') + print("Line doesnt match map float: ") print(row) # check square matrix - N1=len(data[0]) - dout=[] - for i in range(1,len(data)): + N1 = len(data[0]) + dout = [] + for i in range(1, len(data)): if N1 <= 1: - N1=len(data[i]) - if len(data[i]) != N1 : - print('WARNING: Line '+str(i)+': size does not match. Skipped') + N1 = len(data[i]) + if len(data[i]) != N1: + print("WARNING: Line " + str(i) + ": size does not match. Skipped") else: dout.append(data[i]) - #adout=array(dout) + # adout=array(dout) return dout - - - diff --git a/SU2_PY/SU2/util/switch.py b/SU2_PY/SU2/util/switch.py index b42eaf6e9dd..821b6568a67 100644 --- a/SU2_PY/SU2/util/switch.py +++ b/SU2_PY/SU2/util/switch.py @@ -1,35 +1,36 @@ # ------------------------------------------------------------------- # Switch Class -# ------------------------------------------------------------------- +# ------------------------------------------------------------------- # source: Brian Beck, PSF License, ActiveState Code # http://code.activestate.com/recipes/410692/ + class switch(object): - """ Readable switch construction - - Example: - - c = 'z' - for case in switch(c): - if case('a'): pass # only necessary if the rest of the suite is empty - if case('b'): pass - # ... - if case('y'): pass - if case('z'): - print("c is lowercase!") - break - if case('A'): pass - # ... - if case('Z'): - print("c is uppercase!") - break - if case(): # default - print("I dunno what c was!") - - source: Brian Beck, PSF License, ActiveState Code - http://code.activestate.com/recipes/410692/ + """Readable switch construction + + Example: + + c = 'z' + for case in switch(c): + if case('a'): pass # only necessary if the rest of the suite is empty + if case('b'): pass + # ... + if case('y'): pass + if case('z'): + print("c is lowercase!") + break + if case('A'): pass + # ... + if case('Z'): + print("c is uppercase!") + break + if case(): # default + print("I dunno what c was!") + + source: Brian Beck, PSF License, ActiveState Code + http://code.activestate.com/recipes/410692/ """ - + def __init__(self, value): self.value = value self.fall = False @@ -38,15 +39,16 @@ def __iter__(self): """Return the match method once, then stop""" yield self.match raise StopIteration - + def match(self, *args): """Indicate whether or not to enter a case suite""" if self.fall or not args: return True - elif self.value in args: + elif self.value in args: self.fall = True return True else: return False - + + #: class switch() diff --git a/SU2_PY/SU2/util/which.py b/SU2_PY/SU2/util/which.py index 512c7e954e1..e4bb84f889f 100644 --- a/SU2_PY/SU2/util/which.py +++ b/SU2_PY/SU2/util/which.py @@ -3,7 +3,7 @@ ## \file which.py # \brief looks for where a program is # \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -28,14 +28,15 @@ import os + def which(program): - """ which(program_name) - finds the location of the program_name if it is on PATH - returns None if program cannot be found - does not test for .exe extension on windows + """which(program_name) + finds the location of the program_name if it is on PATH + returns None if program cannot be found + does not test for .exe extension on windows - original source: - http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python + original source: + http://stackoverflow.com/questions/377017/test-if-executable-exists-in-python """ fpath, fname = os.path.split(program) @@ -45,15 +46,13 @@ def which(program): else: for path in os.environ["PATH"].split(os.pathsep): path = path.strip('"') - for ext in ['','.exe','.bat']: - exe_file = os.path.join(path, (program+ext)) + for ext in ["", ".exe", ".bat"]: + exe_file = os.path.join(path, (program + ext)) if is_exe(exe_file): return exe_file return None + def is_exe(fpath): return os.path.isfile(fpath) and os.access(fpath, os.X_OK) - - - diff --git a/SU2_PY/SU2_CFD.py b/SU2_PY/SU2_CFD.py index 22e58169db8..fe786936fea 100755 --- a/SU2_PY/SU2_CFD.py +++ b/SU2_PY/SU2_CFD.py @@ -3,7 +3,7 @@ ## \file SU2_CFD.py # \brief Python script to launch SU2_CFD through the Python Wrapper. # \author David Thomas -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -30,85 +30,147 @@ # ---------------------------------------------------------------------- from __future__ import division, print_function, absolute_import -from optparse import OptionParser # use a parser for configuration -import SU2 # imports SU2 python tools -import pysu2 # imports the SU2 wrapped module +from optparse import OptionParser # use a parser for configuration +import SU2 # imports SU2 python tools +import pysu2 # imports the SU2 wrapped module # ------------------------------------------------------------------- # Main # ------------------------------------------------------------------- + def main(): - # Command line options - parser=OptionParser() - parser.add_option("-f", "--file", dest="filename", help="Read config from FILE", metavar="FILE") - parser.add_option("--nDim", dest="nDim", default=2, help="Define the number of DIMENSIONS", - metavar="DIMENSIONS") - parser.add_option("--nZone", dest="nZone", default=1, help="Define the number of ZONES", metavar="NZONE") - parser.add_option("--parallel", action="store_true", - help="Specify if we need to initialize MPI", dest="with_MPI", default=False) - parser.add_option("--fsi", dest="fsi", default="False", help="Launch the FSI driver", metavar="FSI") - parser.add_option("--fem", dest="fem", default="False", help="Launch the FEM driver (General driver)", metavar="FEM") - parser.add_option("--harmonic_balance", dest="harmonic_balance", default="False", - help="Launch the Harmonic Balance (HB) driver", metavar="HB") - parser.add_option("--poisson_equation", dest="poisson_equation", default="False", - help="Launch the poisson equation driver (General driver)", metavar="POIS_EQ") - parser.add_option("--wave_equation", dest="wave_equation", default="False", - help="Launch the wave equation driver (General driver)", metavar="WAVE_EQ") - parser.add_option("--heat_equation", dest="heat_equation", default="False", - help="Launch the heat equation driver (General driver)", metavar="HEAT_EQ") - - (options, args) = parser.parse_args() - options.nDim = int( options.nDim ) - options.nZone = int( options.nZone ) - options.fsi = options.fsi.upper() == 'TRUE' - options.fem = options.fem.upper() == 'TRUE' - options.harmonic_balance = options.harmonic_balance.upper() == 'TRUE' - options.poisson_equation = options.poisson_equation.upper() == 'TRUE' - options.wave_equation = options.wave_equation.upper() == 'TRUE' - options.heat_equation = options.heat_equation.upper() == 'TRUE' - - if options.filename == None: - raise Exception("No config file provided. Use -f flag") - - if options.with_MPI == True: - from mpi4py import MPI # use mpi4py for parallel run (also valid for serial) - comm = MPI.COMM_WORLD - else: - comm = 0 - - # Initialize the corresponding driver of SU2, this includes solver preprocessing - try: - if (options.nZone == 1) and ( options.fem or options.poisson_equation or options.wave_equation or options.heat_equation ): - SU2Driver = pysu2.CSinglezoneDriver(options.filename, options.nZone, comm); - elif options.harmonic_balance: - SU2Driver = pysu2.CHBDriver(options.filename, options.nZone, comm); - elif (options.nZone >= 2): - SU2Driver = pysu2.CMultizoneDriver(options.filename, options.nZone, comm); - else: - SU2Driver = pysu2.CSinglezoneDriver(options.filename, options.nZone, comm); - except TypeError as exception: - print('A TypeError occured in pysu2.CDriver : ',exception) + # Command line options + parser = OptionParser() + parser.add_option( + "-f", "--file", dest="filename", help="Read config from FILE", metavar="FILE" + ) + parser.add_option( + "--nDim", + dest="nDim", + default=2, + help="Define the number of DIMENSIONS", + metavar="DIMENSIONS", + ) + parser.add_option( + "--nZone", + dest="nZone", + default=1, + help="Define the number of ZONES", + metavar="NZONE", + ) + parser.add_option( + "--parallel", + action="store_true", + help="Specify if we need to initialize MPI", + dest="with_MPI", + default=False, + ) + parser.add_option( + "--fsi", + dest="fsi", + default="False", + help="Launch the FSI driver", + metavar="FSI", + ) + parser.add_option( + "--fem", + dest="fem", + default="False", + help="Launch the FEM driver (General driver)", + metavar="FEM", + ) + parser.add_option( + "--harmonic_balance", + dest="harmonic_balance", + default="False", + help="Launch the Harmonic Balance (HB) driver", + metavar="HB", + ) + parser.add_option( + "--poisson_equation", + dest="poisson_equation", + default="False", + help="Launch the poisson equation driver (General driver)", + metavar="POIS_EQ", + ) + parser.add_option( + "--wave_equation", + dest="wave_equation", + default="False", + help="Launch the wave equation driver (General driver)", + metavar="WAVE_EQ", + ) + parser.add_option( + "--heat_equation", + dest="heat_equation", + default="False", + help="Launch the heat equation driver (General driver)", + metavar="HEAT_EQ", + ) + + (options, args) = parser.parse_args() + options.nDim = int(options.nDim) + options.nZone = int(options.nZone) + options.fsi = options.fsi.upper() == "TRUE" + options.fem = options.fem.upper() == "TRUE" + options.harmonic_balance = options.harmonic_balance.upper() == "TRUE" + options.poisson_equation = options.poisson_equation.upper() == "TRUE" + options.wave_equation = options.wave_equation.upper() == "TRUE" + options.heat_equation = options.heat_equation.upper() == "TRUE" + + if options.filename == None: + raise Exception("No config file provided. Use -f flag") + if options.with_MPI == True: - print('ERROR : You are trying to initialize MPI with a serial build of the wrapper. Please, remove the --parallel option that is incompatible with a serial build.') + from mpi4py import MPI # use mpi4py for parallel run (also valid for serial) + + comm = MPI.COMM_WORLD else: - print('ERROR : You are trying to launch a computation without initializing MPI but the wrapper has been built in parallel. Please add the --parallel option in order to initialize MPI for the wrapper.') - return + comm = 0 + + # Initialize the corresponding driver of SU2, this includes solver preprocessing + try: + if (options.nZone == 1) and ( + options.fem + or options.poisson_equation + or options.wave_equation + or options.heat_equation + ): + SU2Driver = pysu2.CSinglezoneDriver(options.filename, options.nZone, comm) + elif options.harmonic_balance: + SU2Driver = pysu2.CHBDriver(options.filename, options.nZone, comm) + elif options.nZone >= 2: + SU2Driver = pysu2.CMultizoneDriver(options.filename, options.nZone, comm) + else: + SU2Driver = pysu2.CSinglezoneDriver(options.filename, options.nZone, comm) + except TypeError as exception: + print("A TypeError occured in pysu2.CDriver : ", exception) + if options.with_MPI == True: + print( + "ERROR : You are trying to initialize MPI with a serial build of the wrapper. Please, remove the --parallel option that is incompatible with a serial build." + ) + else: + print( + "ERROR : You are trying to launch a computation without initializing MPI but the wrapper has been built in parallel. Please add the --parallel option in order to initialize MPI for the wrapper." + ) + return + + # Launch the solver for the entire computation + SU2Driver.StartSolver() - # Launch the solver for the entire computation - SU2Driver.StartSolver() + # Finalize the solver and exit cleanly + SU2Driver.Finalize() - # Postprocess the solver and exit cleanly - SU2Driver.Postprocessing() + if SU2Driver != None: + del SU2Driver - if SU2Driver != None: - del SU2Driver # ------------------------------------------------------------------- # Run Main Program # ------------------------------------------------------------------- # this is only accessed if running from command prompt -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/SU2_PY/SU2_Nastran/pysu2_nastran.py b/SU2_PY/SU2_Nastran/pysu2_nastran.py index 216bc22740f..b0d3b8c6965 100644 --- a/SU2_PY/SU2_Nastran/pysu2_nastran.py +++ b/SU2_PY/SU2_Nastran/pysu2_nastran.py @@ -3,7 +3,7 @@ ## \file pysu2_nastran.py # \brief Structural solver using Nastran models # \authors Nicola Fonzi, Vittorio Cavalieri, based on the work of David Thomas -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -37,1007 +37,1142 @@ # Config class # ---------------------------------------------------------------------- -class ImposedMotionClass: - - def __init__(self,time0,typeOfMotion,parameters,mode): - - self.time0 = time0 - self.typeOfMotion = typeOfMotion - self.mode = mode - - self.amplitude = parameters["AMPLITUDE"] - self.timeStart = parameters["TIME_START"] - if "TIME_STOP" in parameters.keys(): - self.timeStop = parameters["TIME_STOP"] - else: - self.timeStop = inf - - if self.typeOfMotion == "SINUSOIDAL": - self.bias = parameters["BIAS"] - self.frequency = parameters["FREQUENCY"] - - elif self.typeOfMotion == "BLENDED_STEP": - self.kmax = parameters["K_MAX"] - self.vinf = parameters["V_INF"] - self.lref = parameters["L_REF"] - self.tmax = 2*pi/self.kmax*self.lref/self.vinf - self.omega0 = 1/2*self.kmax - - else: - raise Exception('Imposed function {} not found, please implement it in pysu2_nastran.py'.format(self.tipo)) +class ImposedMotionClass: + def __init__(self, time0, typeOfMotion, parameters, mode): - def GetDispl(self,time): - time = time - self.time0 - self.timeStart - if self.typeOfMotion == "SINUSOIDAL": - if (time < 0.0) or (time > self.timeStop): - return 0.0 - return self.bias+self.amplitude*sin(2*pi*self.frequency*time) - - if self.typeOfMotion == "BLENDED_STEP": - if (time < 0.0) or (time > self.timeStop): - return 0.0 - if time < self.tmax: - return self.amplitude/2.0*(1.0-cos(self.omega0*time*self.vinf/self.lref)) - return self.amplitude - - - def GetVel(self,time): - time = time - self.time0 - self.timeStart - - if self.typeOfMotion == "SINUSOIDAL": - if (time < 0.0) or (time > self.timeStop): - return 0.0 - return self.amplitude*cos(2*pi*self.frequency*time)*2*pi*self.frequency + self.time0 = time0 + self.typeOfMotion = typeOfMotion + self.mode = mode - if self.typeOfMotion == "BLENDED_STEP": - if (time < 0.0) or (time > self.timeStop): - return 0.0 - if time < self.tmax: - return self.amplitude/2.0*sin(self.omega0*time*self.vinf/self.lref)*(self.omega0*self.vinf/self.lref) - return 0.0 + self.amplitude = parameters["AMPLITUDE"] + self.timeStart = parameters["TIME_START"] + if "TIME_STOP" in parameters.keys(): + self.timeStop = parameters["TIME_STOP"] + else: + self.timeStop = inf - def GetAcc(self,time): - time = time - self.time0 - self.timeStart + if self.typeOfMotion == "SINUSOIDAL": + self.bias = parameters["BIAS"] + self.frequency = parameters["FREQUENCY"] - if self.typeOfMotion == "SINUSOIDAL": - if (time < 0.0) or (time > self.timeStop): - return 0.0 - return -self.amplitude*sin(2*pi*self.frequency*time)*(2*pi*self.frequency)**2 + elif self.typeOfMotion == "BLENDED_STEP": + self.kmax = parameters["K_MAX"] + self.vinf = parameters["V_INF"] + self.lref = parameters["L_REF"] + self.tmax = 2 * pi / self.kmax * self.lref / self.vinf + self.omega0 = 1 / 2 * self.kmax - if self.typeOfMotion == "BLENDED_STEP": - if (time < 0.0) or (time > self.timeStop): - return 0.0 - if time < self.tmax: - return self.amplitude/2.0*cos(self.omega0*time*self.vinf/self.lref)*(self.omega0*self.vinf/self.lref)**2 - return 0.0 + else: + raise Exception( + "Imposed function {} not found, please implement it in pysu2_nastran.py".format( + self.tipo + ) + ) + + def GetDispl(self, time): + time = time - self.time0 - self.timeStart + if self.typeOfMotion == "SINUSOIDAL": + if (time < 0.0) or (time > self.timeStop): + return 0.0 + return self.bias + self.amplitude * sin(2 * pi * self.frequency * time) + + if self.typeOfMotion == "BLENDED_STEP": + if (time < 0.0) or (time > self.timeStop): + return 0.0 + if time < self.tmax: + return ( + self.amplitude + / 2.0 + * (1.0 - cos(self.omega0 * time * self.vinf / self.lref)) + ) + return self.amplitude + + def GetVel(self, time): + time = time - self.time0 - self.timeStart + + if self.typeOfMotion == "SINUSOIDAL": + if (time < 0.0) or (time > self.timeStop): + return 0.0 + return ( + self.amplitude + * cos(2 * pi * self.frequency * time) + * 2 + * pi + * self.frequency + ) + + if self.typeOfMotion == "BLENDED_STEP": + if (time < 0.0) or (time > self.timeStop): + return 0.0 + if time < self.tmax: + return ( + self.amplitude + / 2.0 + * sin(self.omega0 * time * self.vinf / self.lref) + * (self.omega0 * self.vinf / self.lref) + ) + return 0.0 + + def GetAcc(self, time): + time = time - self.time0 - self.timeStart + + if self.typeOfMotion == "SINUSOIDAL": + if (time < 0.0) or (time > self.timeStop): + return 0.0 + return ( + -self.amplitude + * sin(2 * pi * self.frequency * time) + * (2 * pi * self.frequency) ** 2 + ) + + if self.typeOfMotion == "BLENDED_STEP": + if (time < 0.0) or (time > self.timeStop): + return 0.0 + if time < self.tmax: + return ( + self.amplitude + / 2.0 + * cos(self.omega0 * time * self.vinf / self.lref) + * (self.omega0 * self.vinf / self.lref) ** 2 + ) + return 0.0 class RefSystem: + def __init__(self): + self.CID = 0 + self.RID = 0 + self.Origin = np.array([[0.0], [0.0], [0.0]]) + self.Rot = np.array([[0.0, 0.0, 0.0], [0.0, 0.0, 0.0], [0.0, 0.0, 0.0]]) - def __init__(self): - self.CID = 0 - self.RID = 0 - self.Origin = np.array([[0.],[0.],[0.]]) - self.Rot = np.array([[0.,0.,0.],[0.,0.,0.],[0.,0.,0.]]) + def SetOrigin(self, A): + AX, AY, AZ = A + self.Origin[0] = AX + self.Origin[1] = AY + self.Origin[2] = AZ - def SetOrigin(self,A): - AX , AY , AZ = A - self.Origin[0] = AX - self.Origin[1] = AY - self.Origin[2] = AZ + def SetRotMatrix(self, x, y, z): + self.Rot = np.array( + [[x[0], y[0], z[0]], [x[1], y[1], z[1]], [x[2], y[2], z[2]]] + ) - def SetRotMatrix(self,x,y,z): - self.Rot = np.array([[x[0],y[0],z[0]],[x[1],y[1],z[1]],[x[2],y[2],z[2]]]) + def SetCID(self, CID): + self.CID = CID - def SetCID(self,CID): - self.CID = CID + def SetRID(self, RID): + self.RID = RID - def SetRID(self,RID): - self.RID = RID + def GetOrigin(self): + return self.Origin - def GetOrigin(self): - return self.Origin + def GetRotMatrix(self): + return self.Rot - def GetRotMatrix(self): - return self.Rot + def GetRID(self): + return self.RID - def GetRID(self): - return self.RID + def GetCID(self): + return self.CID - def GetCID(self): - return self.CID class Point: - """ - Class containing data regarding all the structural nodes. - Coord0: Coordinates at the initial time iteration. - Coord: Coordinates at the current time iteration. - Coord_n: Coordinates at the previous time iteration. - Vel: Velocity at the current time iteration. - Vel_n: Velocity at the previous time iteration. - Force: Nodal force provided by the aerodynamics. - ID: ID of the node. - CP: Coordinate system definition of the position. - CD: Coordinate system definition of the output coming from Nastran. - """ - - def __init__(self): - self.Coord0 = np.zeros((3,1)) - self.Coord = np.zeros((3,1)) - self.Coord_n = np.zeros((3,1)) - self.Vel = np.zeros((3,1)) - self.Vel_n = np.zeros((3,1)) - self.Force = np.zeros((3,1)) - self.ID = 0 - self.CP = 0 - self.CD = 0 - - def GetCoord0(self): - return self.Coord0 - - def GetCoord(self): - return self.Coord - - def GetCoord_n(self): - return self.Coord_n - - def GetVel(self): - return self.Vel - - def GetVel_n(self): - return self.Vel_n - - def GetForce(self): - return self.Force - - def GetID(self): - return self.ID - - def GetCP(self): - return self.CP - - def GetCD(self): - return self.CD - - def SetCoord0(self, val_Coord): - x, y, z = val_Coord - self.Coord0[0] = x - self.Coord0[1] = y - self.Coord0[2] = z - - def SetCoord(self, val_Coord): - x, y, z = val_Coord - self.Coord[0] = x - self.Coord[1] = y - self.Coord[2] = z - - def SetCoord_n(self, val_Coord): - x, y, z = val_Coord - self.Coord_n[0] = x - self.Coord_n[1] = y - self.Coord_n[2] = z - - def SetVel(self, val_Vel): - vx, vy, vz = val_Vel - self.Vel[0] = vx - self.Vel[1] = vy - self.Vel[2] = vz - - def SetVel_n(self, val_Vel): - vx, vy, vz = val_Vel - self.Vel_n[0] = vx - self.Vel_n[1] = vy - self.Vel_n[2] = vz - - def SetForce(self, val_Force): - fx, fy, fz = val_Force - self.Force[0] = fx - self.Force[1] = fy - self.Force[2] = fz - - def SetID(self, ID): - self.ID = ID - - def SetCP(self,CP): - self.CP = CP - - def SetCD(self,CD): - self.CD = CD - - def updateCoordVel(self): - self.Coord_n = np.copy(self.Coord) - self.Vel_n = np.copy(self.Vel) - -class Solver: - """ - Structural solver main class. - It contains all the required methods for the coupling with SU2. - """ - - def __init__(self, config_fileName, ImposedMotion): """ - Constructor of the structural solver class. + Class containing data regarding all the structural nodes. + Coord0: Coordinates at the initial time iteration. + Coord: Coordinates at the current time iteration. + Coord_n: Coordinates at the previous time iteration. + Vel: Velocity at the current time iteration. + Vel_n: Velocity at the previous time iteration. + Force: Nodal force provided by the aerodynamics. + ID: ID of the node. + CP: Coordinate system definition of the position. + CD: Coordinate system definition of the output coming from Nastran. """ - self.Config_file = config_fileName - self.Config = {} - - print("\n") - print(" Configuring the structural tester solver for FSI simulation ".center(80,"-")) - self.__readConfig() - - self.Mesh_file = self.Config['MESH_FILE'] - self.Punch_file = self.Config['PUNCH_FILE'] - self.FSI_marker = self.Config['MOVING_MARKER'] - self.Unsteady = (self.Config['TIME_MARCHING']=="YES") - self.ImposedMotion = ImposedMotion - if self.Unsteady: - print('Dynamic computation.') - self.nDof = self.Config['NMODES'] - print("Reading number of modes from file") - - - # Structural properties - print("Reading the modal and stiffnes matrix from file") - self.ModalDamping = self.Config['MODAL_DAMPING'] - if self.ModalDamping == 0: - print("The structural model is undamped") - else: - print("Assuming {}% of modal damping".format(self.ModalDamping*100)) - - self.deltaT = self.Config['DELTA_T'] - self.rhoAlphaGen = self.Config['RHO'] - - self.nPoint = int() - self.nMarker = int() - self.nRefSys = int() - self.node = [] - self.markers = {} - self.refsystems = [] - self.ImposedMotionToSet = True - self.ImposedMotionFunction = [] - - print("\n") - print(" Reading the mesh ".center(80,"-")) - self.__readNastranMesh() - - print("\n") - print(" Creating the structural model ".center(80,"-")) - self.__setStructuralMatrices() - - print("\n") - print(" Setting the integration parameters ".center(80,"-")) - self.__setIntegrationParameters() - self.__setInitialConditions() - - # Prepare the output file - if self.Config["RESTART_SOL"]=="NO": - histFile = open('StructHistoryModal.dat', "w") - header = 'Time\t' + 'Time Iteration\t' + 'FSI Iteration\t' - for imode in range(self.nDof): - header = header + 'q' + str(imode+1) + '\t' + 'qdot' + str(imode+1) + '\t' + 'qddot' + str(imode+1) + '\t' - header = header + '\n' - histFile.write(header) - histFile.close() - else: - self.__setRestart() - - def __readConfig(self): - """ - This methods obtains the configuration options from the structural solver input - file. - """ - - with open(self.Config_file) as configfile: - while 1: - line = configfile.readline() - if not line: - break - - # remove line returns - line = line.strip('\r\n') - # make sure it has useful data - if (not "=" in line) or (line[0] == '%'): - continue - # split across equal sign - line = line.split("=",1) - this_param = line[0].strip() - this_value = line[1].strip() - - #integer values - if (this_param == "NMODES") or \ - (this_param == "RESTART_ITER"): - self.Config[this_param] = int(this_value) - - - #float values - elif (this_param == "DELTA_T") or \ - (this_param == "MODAL_DAMPING") or \ - (this_param == "RHO"): - self.Config[this_param] = float(this_value) - - - #string values - elif (this_param == "TIME_MARCHING") or \ - (this_param == "MESH_FILE") or \ - (this_param == "PUNCH_FILE") or \ - (this_param == "RESTART_SOL") or \ - (this_param == "MOVING_MARKER"): - self.Config[this_param] = this_value - - - #lists values - elif (this_param == "INITIAL_MODES") or \ - (this_param == "IMPOSED_MODES") or \ - (this_param == "IMPOSED_PARAMETERS"): - self.Config[this_param] = eval(this_value) + def __init__(self): + self.Coord0 = np.zeros((3, 1)) + self.Coord = np.zeros((3, 1)) + self.Coord_n = np.zeros((3, 1)) + self.Vel = np.zeros((3, 1)) + self.Vel_n = np.zeros((3, 1)) + self.Force = np.zeros((3, 1)) + self.ID = 0 + self.CP = 0 + self.CD = 0 + def GetCoord0(self): + return self.Coord0 - else: - raise Exception('{} is an invalid option !'.format(this_param)) - - - - def __readNastranMesh(self): - """ - This method reads the nastran 3D mesh. - """ - - def nastran_float(s): - if s.find('E') == -1: - s = s.replace('-','e-') - s = s.replace('+','e+') - if s[0] == 'e': - s = s[1:] - return float(s) - - self.nMarker = 0 - self.nPoint = 0 - self.nRefSys = 0 - - with open(self.Mesh_file,'r') as meshfile: - print('Opened mesh file ' + self.Mesh_file + '.') - while 1: - line = meshfile.readline() - if not line: - break - - pos = line.find('GRID') - if pos == 30: - line = line.strip('\r\n') - self.node.append(Point()) - line = line[30:] - ID = int(line[8:16]) - CP = self.__checkBlankField(line[16:24]) - x = nastran_float(line[24:32]) - y = nastran_float(line[32:40]) - z = nastran_float(line[40:48]) - if CP != 0: - for iRefSys in range(self.nRefSys): - if self.refsystems[iRefSys].GetCID()==CP: - break - if self.refsystems[iRefSys].GetCID()!=CP: - raise Exception('Definition reference {} system not found'.format(CP)) - DeltaPos = self.refsystems[iRefSys].GetOrigin() - RotatedPos = self.refsystems[iRefSys].GetRotMatrix().dot(np.array([[x],[y],[z]])) - x = RotatedPos[0]+DeltaPos[0] - y = RotatedPos[1]+DeltaPos[1] - z = RotatedPos[2]+DeltaPos[2] - CD = self.__checkBlankField(line[48:56]) - self.node[self.nPoint].SetCoord((x,y,z)) - self.node[self.nPoint].SetID(ID) - self.node[self.nPoint].SetCP(CP) - self.node[self.nPoint].SetCD(CD) - self.node[self.nPoint].SetCoord0((x,y,z)) - self.node[self.nPoint].SetCoord_n((x,y,z)) - self.nPoint += 1 - continue - - pos = line.find('CORD2R') - if pos == 30: - line = line.strip('\r\n') - self.refsystems.append(RefSystem()) - line = line[30:] - CID = int(line[8:16]) - self.refsystems[self.nRefSys].SetCID(CID) - RID = int(line[16:24]) - if RID!=0: - raise Exception('ERROR: Reference system {} must be defined with respect to global reference system'.format(CID)) - self.refsystems[self.nRefSys].SetRID(RID) - AX = nastran_float(line[24:32]) - AY = nastran_float(line[32:40]) - AZ = nastran_float(line[40:48]) - BX = nastran_float(line[48:56]) - BY = nastran_float(line[56:64]) - BZ = nastran_float(line[64:72]) - z_direction = np.array([BX-AX,BY-AY,BZ-AZ]) - z_direction = z_direction/linalg.norm(z_direction) - line = meshfile.readline() - line = line.strip('\r\n') - line = line[30:] - CX = nastran_float(line[8:16]) - CY = nastran_float(line[16:24]) - CZ = nastran_float(line[24:32]) - y_direction = np.cross(z_direction,[CX-AX,CY-AY,CZ-AZ]) - y_direction = y_direction/linalg.norm(y_direction) - x_direction = np.cross(y_direction,z_direction) - x_direction = x_direction/linalg.norm(x_direction) - self.refsystems[self.nRefSys].SetRotMatrix(x_direction,y_direction,z_direction) - self.refsystems[self.nRefSys].SetOrigin((AX,AY,AZ)) - self.nRefSys += 1 - continue - - pos = line.find("SET1") - if pos == 30: - line = line.strip('\r\n') - line = line[37:] - line = line.split() - existValue = True - markerTag = line.pop(0) - self.markers[markerTag] = [] - while existValue: - if line[0] == "+": - line = meshfile.readline() - line = line.strip('\r\n') - line = line[37:] - line = line.split() - ID = int(line.pop(0)) - for iPoint in range(self.nPoint): - if self.node[iPoint].GetID() == ID: - break - if (iPoint == (self.nPoint-1)) and (self.node[iPoint].GetID() != ID): - raise Exception("Point {} in the set {} was not found in the mesh".format(ID,markerTag)) - self.markers[markerTag].append(iPoint) - existValue = len(line)>=1 - self.nMarker += 1 - continue - - if not any(self.FSI_marker in key for key in self.markers.keys()): - raise Exception("The FSI marker was not found in the available sets") - - self.markers[self.FSI_marker].sort() - - print("Number of points: {}".format(self.nPoint)) - print("Number of markers: {}".format(self.nMarker)) - print("Number of reference systems: {}".format(self.nRefSys)) - print("Moving marker: {}".format(self.FSI_marker)) - print("Number of points in the moving marker".format(len(self.markers[self.FSI_marker]))) - - def __checkBlankField(self, string): - """ - This method considers that Nastran apply 0 when the reference system is not specified - """ - - if string == ' '*8: - return int(0) - return int(string) + def GetCoord(self): + return self.Coord + def GetCoord_n(self): + return self.Coord_n - def __setStructuralMatrices(self): - """ - This method reads the punch file and obtains the modal shapes and modal stiffnesses. - """ - - self.M = np.zeros((self.nDof, self.nDof)) - self.K = np.zeros((self.nDof, self.nDof)) - self.C = np.zeros((self.nDof, self.nDof)) - - self.q = np.zeros((self.nDof, 1)) - self.qdot = np.zeros((self.nDof, 1)) - self.qddot = np.zeros((self.nDof, 1)) - self.a = np.zeros((self.nDof, 1)) - - self.q_n = np.zeros((self.nDof, 1)) - self.qdot_n = np.zeros((self.nDof, 1)) - self.qddot_n = np.zeros((self.nDof, 1)) - self.a_n = np.zeros((self.nDof, 1)) - - self.F = np.zeros((self.nDof, 1)) - - self.Ux = np.zeros((self.nPoint,self.nDof)) - self.Uy = np.zeros((self.nPoint,self.nDof)) - self.Uz = np.zeros((self.nPoint,self.nDof)) - - with open(self.Punch_file,'r') as punchfile: - print('Opened punch file ' + self.Punch_file + '.') - while 1: - line = punchfile.readline() - if not line: - break - - pos = line.find('MODE ') - if pos != -1: - line = line.strip('\r\n').split() - n = int(line[5]) - imode = n-1 - k_i = float(line[2]) - self.M[imode][imode] = 1 - self.K[imode][imode] = k_i - w_i = sqrt(k_i) - self.C[imode][imode] = 2 * self.ModalDamping * w_i - iPoint = 0 - for indexIter in range(self.nPoint): - line = punchfile.readline() - line = line.strip('\r\n').split() - if line[1]=='G': - ux = float(line[2]) - uy = float(line[3]) - uz = float(line[4]) - if self.node[iPoint].GetCD()!=0: - for iRefSys in range(self.nRefSys): - if self.refsystems[iRefSys].GetCID()==self.node[iPoint].GetCD(): - break - if self.refsystems[iRefSys].GetCID()!=self.node[iPoint].GetCD(): - raise Exception('Output reference {} system not found'.format(self.node[iPoint].GetCD())) - RotatedOutput = self.refsystems[iRefSys].GetRotMatrix().dot(np.array([[ux],[uy],[uz]])) - ux = RotatedOutput[0] - uy = RotatedOutput[1] - uz = RotatedOutput[2] - self.Ux[iPoint][imode] = ux - self.Uy[iPoint][imode] = uy - self.Uz[iPoint][imode] = uz - iPoint = iPoint + 1 - line = punchfile.readline() - if line[1]=='S': - line = punchfile.readline() - - if n == self.nDof: - break - - self.__setNonDiagonalStructuralMatrices() - - self.UxT = self.Ux.transpose() - self.UyT = self.Uy.transpose() - self.UzT = self.Uz.transpose() - - if n= eps: - St = self.__TangentOperator() - Deltaq = -1*(linalg.solve(St,res)) - self.q += Deltaq - self.qdot += self.gammaPrime*Deltaq - self.qddot += self.betaPrime*Deltaq - res = self.__ComputeResidual() - - self.a += (1-self.alpha_f)/(1-self.alpha_m)*self.qddot - else: - if self.ImposedMotionToSet: + print("Assuming {}% of modal damping".format(self.ModalDamping * 100)) + + self.deltaT = self.Config["DELTA_T"] + self.rhoAlphaGen = self.Config["RHO"] + + self.nPoint = int() + self.nMarker = int() + self.nRefSys = int() + self.node = [] + self.markers = {} + self.refsystems = [] + self.ImposedMotionToSet = True + self.ImposedMotionFunction = [] + + print("\n") + print(" Reading the mesh ".center(80, "-")) + self.__readNastranMesh() + + print("\n") + print(" Creating the structural model ".center(80, "-")) + self.__setStructuralMatrices() + + print("\n") + print(" Setting the integration parameters ".center(80, "-")) + self.__setIntegrationParameters() + self.__setInitialConditions() + + # Prepare the output file if self.Config["RESTART_SOL"] == "NO": - # If yes we already set it in the __setRestart function - self.timeStartCoupling = time - iImposedFunc = 0 - for imode in self.Config["IMPOSED_MODES"].keys(): - for isuperposed in range(len(self.Config["IMPOSED_MODES"][imode])): - typeOfMotion = self.Config["IMPOSED_MODES"][imode][isuperposed] - parameters = self.Config["IMPOSED_PARAMETERS"][imode][isuperposed] - self.ImposedMotionFunction.append(ImposedMotionClass(self.timeStartCoupling, typeOfMotion, parameters, imode)) - iImposedFunc += 1 - self.ImposedMotionToSet = False - for iImposedFunc in range(len(self.ImposedMotionFunction)): - imode = self.ImposedMotionFunction[iImposedFunc].mode - self.q[imode] += self.ImposedMotionFunction[iImposedFunc].GetDispl(time) - self.qdot[imode] += self.ImposedMotionFunction[iImposedFunc].GetVel(time) - self.qddot[imode] += self.ImposedMotionFunction[iImposedFunc].GetAcc(time) - self.a = np.copy(self.qddot) - - - def __SetLoads(self): - """ - This method uses the nodal forces and the mode shapes to obtain the modal forces. - """ - nodeList = self.markers[self.FSI_marker] - FX = np.zeros((self.nPoint, 1)) - FY = np.zeros((self.nPoint, 1)) - FZ = np.zeros((self.nPoint, 1)) - for iPoint in nodeList: - Force = self.node[iPoint].GetForce() - FX[iPoint] = float(Force[0]) - FY[iPoint] = float(Force[1]) - FZ[iPoint] = float(Force[2]) - self.F = self.UxT.dot(FX) + self.UyT.dot(FY) + self.UzT.dot(FZ) - - def __ComputeResidual(self): - """ - This method computes the residual for integration. - """ - - res = self.M.dot(self.qddot) + self.C.dot(self.qdot) + self.K.dot(self.q) - self.F - - return res - - def __TangentOperator(self): - """ - This method computes the tangent operator for solution. - """ - - # The problem is linear, so the tangent operator is straightforward. - St = self.betaPrime*self.M + self.gammaPrime*self.C + self.K - - return St - - def exit(self): - """ - This method cleanly exits the structural solver. - """ - - print("\n**************** Exiting the structural tester solver ****************") - - def run(self,time): - """ - This method is the main function for advancing the solution of one time step. - """ - self.__temporalIteration(time) - header = 'Time\t' - for imode in range(min([self.nDof,5])): - header = header + 'q' + str(imode+1) + '\t' + 'qdot' + str(imode+1) + '\t' + 'qddot' + str(imode+1) + '\t' - header = header + '\n' - print(header) - line = '{:6.4f}'.format(time) + '\t' - for imode in range(min([self.nDof,5])): - line = line + '{:6.4f}'.format(float(self.q[imode])) + '\t' + '{:6.4f}'.format(float(self.qdot[imode])) + '\t' + '{:6.4f}'.format(float(self.qddot[imode])) + '\t' - line = line + '\n' - print(line) - self.__computeInterfacePosVel(False) - - def activateMode(self, iMode): - """ - This method is used to artificially set only one mode activated, thus - with non zero amplitude. - """ - self.__reset(self.q) - self.q[iMode] = 1.0 - self.__computeInterfacePosVel(True) - - def setInitialDisplacements(self): - """ - This method provides public access to the method __computeInterfacePosVel and - sets velocities for previous time steps. - """ - - self.__computeInterfacePosVel(True) - - def writeSolution(self, time, timeIter, FSIIter): - """ - This method is the main function for output. It writes the file StructHistoryModal.dat - """ - - # Modal History - histFile = open('StructHistoryModal.dat', "a") - line = str(time) + '\t' + str(timeIter) + '\t' + str(FSIIter) + '\t' - for imode in range(self.nDof): - line = line + str(float(self.q[imode])) + '\t' + str(float(self.qdot[imode])) + '\t' + str(float(self.qddot[imode])) + '\t' - line = line + '\n' - histFile.write(line) - histFile.close() - - def updateSolution(self): - """ - This method updates the solution. - """ - - self.q_n = np.copy(self.q) - self.qdot_n = np.copy(self.qdot) - self.qddot_n = np.copy(self.qddot) - self.a_n = np.copy(self.a) - self.__reset(self.q) - self.__reset(self.qdot) - self.__reset(self.qddot) - self.__reset(self.a) - - for iPoint in range(self.nPoint): - self.node[iPoint].updateCoordVel() - - - def applyload(self, iVertex, fx, fy, fz): - """ - This method can be accessed from outside to set the nodal forces. - """ - iPoint = self.getVertexGlobalIndex(self.FSI_marker, iVertex) - self.node[iPoint].SetForce((fx,fy,fz)) + histFile = open("StructHistoryModal.dat", "w") + header = "Time\t" + "Time Iteration\t" + "FSI Iteration\t" + for imode in range(self.nDof): + header = ( + header + + "q" + + str(imode + 1) + + "\t" + + "qdot" + + str(imode + 1) + + "\t" + + "qddot" + + str(imode + 1) + + "\t" + ) + header = header + "\n" + histFile.write(header) + histFile.close() + else: + self.__setRestart() + + def __readConfig(self): + """ + This methods obtains the configuration options from the structural solver input + file. + """ + + with open(self.Config_file) as configfile: + while 1: + line = configfile.readline() + if not line: + break - def getNumberOfModes(self): - """ - This method provides the number of degrees of freedom used in - the structural solver. - """ - return self.nDof + # remove line returns + line = line.strip("\r\n") + # make sure it has useful data + if (not "=" in line) or (line[0] == "%"): + continue + # split across equal sign + line = line.split("=", 1) + this_param = line[0].strip() + this_value = line[1].strip() + + # integer values + if (this_param == "NMODES") or (this_param == "RESTART_ITER"): + self.Config[this_param] = int(this_value) + + # float values + elif ( + (this_param == "DELTA_T") + or (this_param == "MODAL_DAMPING") + or (this_param == "RHO") + ): + self.Config[this_param] = float(this_value) + + # string values + elif ( + (this_param == "TIME_MARCHING") + or (this_param == "MESH_FILE") + or (this_param == "PUNCH_FILE") + or (this_param == "RESTART_SOL") + or (this_param == "MOVING_MARKER") + ): + self.Config[this_param] = this_value + + # lists values + elif ( + (this_param == "INITIAL_MODES") + or (this_param == "IMPOSED_MODES") + or (this_param == "IMPOSED_PARAMETERS") + ): + self.Config[this_param] = eval(this_value) + + else: + raise Exception("{} is an invalid option !".format(this_param)) + + def __readNastranMesh(self): + """ + This method reads the nastran 3D mesh. + """ + + def nastran_float(s): + if s.find("E") == -1: + s = s.replace("-", "e-") + s = s.replace("+", "e+") + if s[0] == "e": + s = s[1:] + return float(s) + + self.nMarker = 0 + self.nPoint = 0 + self.nRefSys = 0 + + with open(self.Mesh_file, "r") as meshfile: + print("Opened mesh file " + self.Mesh_file + ".") + while 1: + line = meshfile.readline() + if not line: + break - def getFSIMarkerID(self): - """ - This method provides the ID of the interface marker - """ - return self.FSI_marker + pos = line.find("GRID") + if pos == 30: + line = line.strip("\r\n") + self.node.append(Point()) + line = line[30:] + ID = int(line[8:16]) + CP = self.__checkBlankField(line[16:24]) + x = nastran_float(line[24:32]) + y = nastran_float(line[32:40]) + z = nastran_float(line[40:48]) + if CP != 0: + for iRefSys in range(self.nRefSys): + if self.refsystems[iRefSys].GetCID() == CP: + break + if self.refsystems[iRefSys].GetCID() != CP: + raise Exception( + "Definition reference {} system not found".format(CP) + ) + DeltaPos = self.refsystems[iRefSys].GetOrigin() + RotatedPos = ( + self.refsystems[iRefSys] + .GetRotMatrix() + .dot(np.array([[x], [y], [z]])) + ) + x = RotatedPos[0] + DeltaPos[0] + y = RotatedPos[1] + DeltaPos[1] + z = RotatedPos[2] + DeltaPos[2] + CD = self.__checkBlankField(line[48:56]) + self.node[self.nPoint].SetCoord((x, y, z)) + self.node[self.nPoint].SetID(ID) + self.node[self.nPoint].SetCP(CP) + self.node[self.nPoint].SetCD(CD) + self.node[self.nPoint].SetCoord0((x, y, z)) + self.node[self.nPoint].SetCoord_n((x, y, z)) + self.nPoint += 1 + continue + + pos = line.find("CORD2R") + if pos == 30: + line = line.strip("\r\n") + self.refsystems.append(RefSystem()) + line = line[30:] + CID = int(line[8:16]) + self.refsystems[self.nRefSys].SetCID(CID) + RID = int(line[16:24]) + if RID != 0: + raise Exception( + "ERROR: Reference system {} must be defined with respect to global reference system".format( + CID + ) + ) + self.refsystems[self.nRefSys].SetRID(RID) + AX = nastran_float(line[24:32]) + AY = nastran_float(line[32:40]) + AZ = nastran_float(line[40:48]) + BX = nastran_float(line[48:56]) + BY = nastran_float(line[56:64]) + BZ = nastran_float(line[64:72]) + z_direction = np.array([BX - AX, BY - AY, BZ - AZ]) + z_direction = z_direction / linalg.norm(z_direction) + line = meshfile.readline() + line = line.strip("\r\n") + line = line[30:] + CX = nastran_float(line[8:16]) + CY = nastran_float(line[16:24]) + CZ = nastran_float(line[24:32]) + y_direction = np.cross(z_direction, [CX - AX, CY - AY, CZ - AZ]) + y_direction = y_direction / linalg.norm(y_direction) + x_direction = np.cross(y_direction, z_direction) + x_direction = x_direction / linalg.norm(x_direction) + self.refsystems[self.nRefSys].SetRotMatrix( + x_direction, y_direction, z_direction + ) + self.refsystems[self.nRefSys].SetOrigin((AX, AY, AZ)) + self.nRefSys += 1 + continue + + pos = line.find("SET1") + if pos == 30: + line = line.strip("\r\n") + line = line[37:] + line = line.split() + existValue = True + markerTag = line.pop(0) + self.markers[markerTag] = [] + while existValue: + if line[0] == "+": + line = meshfile.readline() + line = line.strip("\r\n") + line = line[37:] + line = line.split() + ID = int(line.pop(0)) + for iPoint in range(self.nPoint): + if self.node[iPoint].GetID() == ID: + break + if (iPoint == (self.nPoint - 1)) and ( + self.node[iPoint].GetID() != ID + ): + raise Exception( + "Point {} in the set {} was not found in the mesh".format( + ID, markerTag + ) + ) + self.markers[markerTag].append(iPoint) + existValue = len(line) >= 1 + self.nMarker += 1 + continue + + if not any(self.FSI_marker in key for key in self.markers.keys()): + raise Exception("The FSI marker was not found in the available sets") + + self.markers[self.FSI_marker].sort() + + print("Number of points: {}".format(self.nPoint)) + print("Number of markers: {}".format(self.nMarker)) + print("Number of reference systems: {}".format(self.nRefSys)) + print("Moving marker: {}".format(self.FSI_marker)) + print( + "Number of points in the moving marker".format( + len(self.markers[self.FSI_marker]) + ) + ) + + def __checkBlankField(self, string): + """ + This method considers that Nastran apply 0 when the reference system is not specified + """ + + if string == " " * 8: + return int(0) + return int(string) + + def __setStructuralMatrices(self): + """ + This method reads the punch file and obtains the modal shapes and modal stiffnesses. + """ + + self.M = np.zeros((self.nDof, self.nDof)) + self.K = np.zeros((self.nDof, self.nDof)) + self.C = np.zeros((self.nDof, self.nDof)) + + self.q = np.zeros((self.nDof, 1)) + self.qdot = np.zeros((self.nDof, 1)) + self.qddot = np.zeros((self.nDof, 1)) + self.a = np.zeros((self.nDof, 1)) + + self.q_n = np.zeros((self.nDof, 1)) + self.qdot_n = np.zeros((self.nDof, 1)) + self.qddot_n = np.zeros((self.nDof, 1)) + self.a_n = np.zeros((self.nDof, 1)) + + self.F = np.zeros((self.nDof, 1)) + + self.Ux = np.zeros((self.nPoint, self.nDof)) + self.Uy = np.zeros((self.nPoint, self.nDof)) + self.Uz = np.zeros((self.nPoint, self.nDof)) + + with open(self.Punch_file, "r") as punchfile: + print("Opened punch file " + self.Punch_file + ".") + while 1: + line = punchfile.readline() + if not line: + break - def getNumberOfSolidInterfaceNodes(self, markerID): + pos = line.find("MODE ") + if pos != -1: + line = line.strip("\r\n").split() + n = int(line[5]) + imode = n - 1 + k_i = float(line[2]) + self.M[imode][imode] = 1 + self.K[imode][imode] = k_i + w_i = sqrt(k_i) + self.C[imode][imode] = 2 * self.ModalDamping * w_i + iPoint = 0 + for indexIter in range(self.nPoint): + line = punchfile.readline() + line = line.strip("\r\n").split() + if line[1] == "G": + ux = float(line[2]) + uy = float(line[3]) + uz = float(line[4]) + if self.node[iPoint].GetCD() != 0: + for iRefSys in range(self.nRefSys): + if ( + self.refsystems[iRefSys].GetCID() + == self.node[iPoint].GetCD() + ): + break + if ( + self.refsystems[iRefSys].GetCID() + != self.node[iPoint].GetCD() + ): + raise Exception( + "Output reference {} system not found".format( + self.node[iPoint].GetCD() + ) + ) + RotatedOutput = ( + self.refsystems[iRefSys] + .GetRotMatrix() + .dot(np.array([[ux], [uy], [uz]])) + ) + ux = RotatedOutput[0] + uy = RotatedOutput[1] + uz = RotatedOutput[2] + self.Ux[iPoint][imode] = ux + self.Uy[iPoint][imode] = uy + self.Uz[iPoint][imode] = uz + iPoint = iPoint + 1 + line = punchfile.readline() + if line[1] == "S": + line = punchfile.readline() + + if n == self.nDof: + break + + self.__setNonDiagonalStructuralMatrices() + + self.UxT = self.Ux.transpose() + self.UyT = self.Uy.transpose() + self.UzT = self.Uz.transpose() + + if n < self.nDof: + raise Exception( + "ERROR: available {} degrees of freedom instead of {} as requested".format( + n, self.nDof + ) + ) + else: + print("Using {} degrees of freedom".format(n)) + + def __setNonDiagonalStructuralMatrices(self): + """ + This method is part of an advanced feature of this solver that allows to set + nondiagonal matrices for the structural modes. + """ + + K_updated = self.__readNonDiagonalMatrix("NDK") + M_updated = self.__readNonDiagonalMatrix("NDM") + C_updated = self.__readNonDiagonalMatrix("NDC") + if K_updated and M_updated and (not C_updated): + print("Setting modal damping") + self.__setNonDiagonalDamping() + elif (not K_updated) and (not M_updated): + print("Modal stiffness and mass matrices are diagonal") + elif (not K_updated) and M_updated: + raise Exception("Non-Diagonal stiffness matrix is missing") + elif (not M_updated) and K_updated: + raise Exception("Non-Diagonal mass matrix is missing") + + def __readNonDiagonalMatrix(self, keyword): + """ + This method reads from the punch file the definition of nondiagonal structural + matrices. + """ + + matrixUpdated = False + + with open(self.Punch_file, "r") as punchfile: + + while 1: + line = punchfile.readline() + if not line: + break - return len(self.markers[markerID]) + pos = line.find(keyword) + if pos != -1: + while 1: + line = punchfile.readline() + line = line.strip("\r\n").split() + if line[0] != "-CONT-": + i = int(line[0]) - 1 + j = 0 + el = line[1:] + ne = len(el) + elif line[0] == "-CONT-": + el = line[1:] + ne = len(el) + if keyword == "NDK": + self.K[i][j : j + ne] = np.array(el) + elif keyword == "NDM": + self.M[i][j : j + ne] = np.array(el) + elif keyword == "NDC": + self.C[i][j : j + ne] = np.array(el) + j = j + ne + if i + 1 == self.nDof and j == self.nDof: + matrixUpdated = True + break + + return matrixUpdated + + def __setNonDiagonalDamping(self): + + D, V = linalg.eig(self.K, self.M) + D = D.real + D = np.sqrt(D) + Mmodal = ((V.transpose()).dot(self.M)).dot(V) + Mmodal = np.diag(Mmodal) + C = 2 * self.ModalDamping * np.multiply(D, Mmodal) + C = np.diag(C) + Vinv = linalg.inv(V) + C = C.dot(Vinv) + VinvT = Vinv.transpose() + self.C = VinvT.dot(C) + + def __setIntegrationParameters(self): + """ + This method uses the time step size to define the integration parameters. + """ + + self.alpha_m = (2.0 * self.rhoAlphaGen - 1.0) / (self.rhoAlphaGen + 1.0) + self.alpha_f = (self.rhoAlphaGen) / (self.rhoAlphaGen + 1.0) + self.gamma = 0.5 + self.alpha_f - self.alpha_m + self.beta = 0.25 * (self.gamma + 0.5) ** 2 + + self.gammaPrime = self.gamma / (self.deltaT * self.beta) + self.betaPrime = (1.0 - self.alpha_m) / ( + (self.deltaT**2) * self.beta * (1.0 - self.alpha_f) + ) + + print("Time integration with the alpha-generalized algorithm.") + print("rho : {}".format(self.rhoAlphaGen)) + print("alpha_m : {}".format(self.alpha_m)) + print("alpha_f : {}".format(self.alpha_f)) + print("gamma : {}".format(self.gamma)) + print("beta : {}".format(self.beta)) + print("gammaPrime : {}".format(self.gammaPrime)) + print("betaPrime : {}".format(self.betaPrime)) + + def __setInitialConditions(self): + """ + This method uses the list of initial modal amplitudes to set the initial conditions + """ + + print("Setting initial conditions.") + + print("Using modal amplitudes from config file") + for imode in range(self.nDof): + if imode in self.Config["INITIAL_MODES"].keys(): + self.q[imode] = float(self.Config["INITIAL_MODES"][imode]) + self.q_n[imode] = float(self.Config["INITIAL_MODES"][imode]) + + RHS = np.zeros((self.nDof, 1)) + RHS += self.F + RHS -= self.C.dot(self.qdot) + RHS -= self.K.dot(self.q) + self.qddot = linalg.solve(self.M, RHS) + self.qddot_n = np.copy(self.qddot) + self.a = np.copy(self.qddot) + self.a_n = np.copy(self.qddot) + + def __reset(self, vector): + """ + This method set to zero any vector. + """ + + for ii in range(vector.shape[0]): + vector[ii] = 0.0 + + def __computeInterfacePosVel(self, initialize): + """ + This method uses the mode shapes to compute, based on the modal velocities, the + nodal velocities at the interface. + """ + + # Multiply the modal matrices with modal amplitudes + X_vel = self.Ux.dot(self.qdot) + Y_vel = self.Uy.dot(self.qdot) + Z_vel = self.Uz.dot(self.qdot) + + X_disp = self.Ux.dot(self.q) + Y_disp = self.Uy.dot(self.q) + Z_disp = self.Uz.dot(self.q) + + for iPoint in range(self.nPoint): + coord0 = self.node[iPoint].GetCoord0() + self.node[iPoint].SetCoord( + ( + X_disp[iPoint] + coord0[0], + Y_disp[iPoint] + coord0[1], + Z_disp[iPoint] + coord0[2], + ) + ) + self.node[iPoint].SetVel((X_vel[iPoint], Y_vel[iPoint], Z_vel[iPoint])) + + if initialize: + self.node[iPoint].SetCoord_n( + ( + X_disp[iPoint] + coord0[0], + Y_disp[iPoint] + coord0[1], + Z_disp[iPoint] + coord0[2], + ) + ) + self.node[iPoint].SetVel_n( + (X_vel[iPoint], Y_vel[iPoint], Z_vel[iPoint]) + ) + + def __setRestart(self): + """ + This method sets all the variables needed for the correct restart. + """ + + # read the Structhistory to obtain the mode amplitudes + nM1Set = False + nSet = False + firstLineRead = False + couplingLineRead = False + + with open("StructHistoryModal.dat", "r") as file: + print("Opened history file StructHistoryModal.dat.") + line = file.readline() + while 1: + line = file.readline() + if not line: + break + line = line.strip("\r\n").split() + + # The old time_0 for imposed motion can either be the first line of the StructHistoryModal, if TimeIterTreshold was -1 (immediate coupling), or the second line. In the former case, time_0 is 0.0, so it is easy to recognize it + if not firstLineRead: + firstLineRead = True + if float(line[0]) == 0.0: + couplingLineRead = True + self.timeStartCoupling = 0.0 + else: + if couplingLineRead: + pass + else: + self.timeStartCoupling = float(line[0]) + couplingLineRead = True + + if int(line[1]) == (self.Config["RESTART_ITER"] - 2): + index = 0 + for index_mode in range(self.nDof): + self.q[index_mode] = float(line[index + 3]) + self.qdot[index_mode] = float(line[index + 4]) + self.qddot[index_mode] = float(line[index + 5]) + index += 3 + del index + # push back the mode amplitudes velocities and accelerations + self.__computeInterfacePosVel(True) + self.q_n = np.copy(self.q) + self.qdot_n = np.copy(self.qdot) + self.qddot_n = np.copy(self.qddot) + self.a_n = np.copy(self.a) + nM1Set = True + if int(line[1]) == (self.Config["RESTART_ITER"] - 1): + index = 0 + for index_mode in range(self.nDof): + self.q[index_mode] = float(line[index + 3]) + self.qdot[index_mode] = float(line[index + 4]) + self.qddot[index_mode] = float(line[index + 5]) + index += 3 + del index + self.__computeInterfacePosVel(False) + nSet = True + break - def getVertexGlobalIndex(self, markerID, iVertex): + if (not nM1Set) or (not nSet): + raise Exception( + "The restart iteration was not found in the structural history" + ) - # This solver is serial, thus global=local - return self.markers[markerID][iVertex] + def __temporalIteration(self, time): + """ + This method integrates in time the solution. + """ - def getInterfaceNodePosInit(self, markerID, iVertex): + self.__reset(self.q) + self.__reset(self.qdot) + self.__reset(self.qddot) + self.__reset(self.a) - iPoint = self.markers[markerID][iVertex] - Coord0 = self.node[iPoint].GetCoord0() - return Coord0 + if not self.ImposedMotion: + eps = 1e-6 - def getInterfaceNodeDisp(self, markerID, iVertex): + self.__SetLoads() - iPoint = self.markers[markerID][iVertex] - Coord = self.node[iPoint].GetCoord() - Coord0 = self.node[iPoint].GetCoord0() - return (Coord-Coord0) + # Prediction step - def getInterfaceNodeVel(self, markerID, iVertex): + self.a += (self.alpha_f) / (1 - self.alpha_m) * self.qddot_n + self.a -= (self.alpha_m) / (1 - self.alpha_m) * self.a_n - iPoint = self.markers[markerID][iVertex] - Vel = self.node[iPoint].GetVel() - return Vel + self.q = np.copy(self.q_n) + self.q += self.deltaT * self.qdot_n + self.q += (0.5 - self.beta) * self.deltaT * self.deltaT * self.a_n + self.q += self.deltaT * self.deltaT * self.beta * self.a - def getInterfaceNodeVelNm1(self, markerID, iVertex): + self.qdot = np.copy(self.qdot_n) + self.qdot += (1 - self.gamma) * self.deltaT * self.a_n + self.qdot += self.deltaT * self.gamma * self.a - iPoint = self.markers[markerID][iVertex] - Vel = self.node[iPoint].GetVel_n() - return Vel + # Correction step + res = self.__ComputeResidual() - def IsAHaloNode(self, markerID, iVertex): + while linalg.norm(res) >= eps: + St = self.__TangentOperator() + Deltaq = -1 * (linalg.solve(St, res)) + self.q += Deltaq + self.qdot += self.gammaPrime * Deltaq + self.qddot += self.betaPrime * Deltaq + res = self.__ComputeResidual() - # There are no halo nodes in this solver as it is serial - iPoint = self.markers[markerID][iVertex] - halo = False - return halo + self.a += (1 - self.alpha_f) / (1 - self.alpha_m) * self.qddot + else: + if self.ImposedMotionToSet: + if self.Config["RESTART_SOL"] == "NO": + # If yes we already set it in the __setRestart function + self.timeStartCoupling = time + iImposedFunc = 0 + for imode in self.Config["IMPOSED_MODES"].keys(): + for isuperposed in range(len(self.Config["IMPOSED_MODES"][imode])): + typeOfMotion = self.Config["IMPOSED_MODES"][imode][isuperposed] + parameters = self.Config["IMPOSED_PARAMETERS"][imode][ + isuperposed + ] + self.ImposedMotionFunction.append( + ImposedMotionClass( + self.timeStartCoupling, typeOfMotion, parameters, imode + ) + ) + iImposedFunc += 1 + self.ImposedMotionToSet = False + for iImposedFunc in range(len(self.ImposedMotionFunction)): + imode = self.ImposedMotionFunction[iImposedFunc].mode + self.q[imode] += self.ImposedMotionFunction[iImposedFunc].GetDispl(time) + self.qdot[imode] += self.ImposedMotionFunction[iImposedFunc].GetVel( + time + ) + self.qddot[imode] += self.ImposedMotionFunction[iImposedFunc].GetAcc( + time + ) + self.a = np.copy(self.qddot) + + def __SetLoads(self): + """ + This method uses the nodal forces and the mode shapes to obtain the modal forces. + """ + nodeList = self.markers[self.FSI_marker] + FX = np.zeros((self.nPoint, 1)) + FY = np.zeros((self.nPoint, 1)) + FZ = np.zeros((self.nPoint, 1)) + for iPoint in nodeList: + Force = self.node[iPoint].GetForce() + FX[iPoint] = float(Force[0]) + FY[iPoint] = float(Force[1]) + FZ[iPoint] = float(Force[2]) + self.F = self.UxT.dot(FX) + self.UyT.dot(FY) + self.UzT.dot(FZ) + + def __ComputeResidual(self): + """ + This method computes the residual for integration. + """ + + res = ( + self.M.dot(self.qddot) + self.C.dot(self.qdot) + self.K.dot(self.q) - self.F + ) + + return res + + def __TangentOperator(self): + """ + This method computes the tangent operator for solution. + """ + + # The problem is linear, so the tangent operator is straightforward. + St = self.betaPrime * self.M + self.gammaPrime * self.C + self.K + + return St + + def exit(self): + """ + This method cleanly exits the structural solver. + """ + + print( + "\n**************** Exiting the structural tester solver ****************" + ) + + def run(self, time): + """ + This method is the main function for advancing the solution of one time step. + """ + self.__temporalIteration(time) + header = "Time\t" + for imode in range(min([self.nDof, 5])): + header = ( + header + + "q" + + str(imode + 1) + + "\t" + + "qdot" + + str(imode + 1) + + "\t" + + "qddot" + + str(imode + 1) + + "\t" + ) + header = header + "\n" + print(header) + line = "{:6.4f}".format(time) + "\t" + for imode in range(min([self.nDof, 5])): + line = ( + line + + "{:6.4f}".format(float(self.q[imode])) + + "\t" + + "{:6.4f}".format(float(self.qdot[imode])) + + "\t" + + "{:6.4f}".format(float(self.qddot[imode])) + + "\t" + ) + line = line + "\n" + print(line) + self.__computeInterfacePosVel(False) + + def activateMode(self, iMode): + """ + This method is used to artificially set only one mode activated, thus + with non zero amplitude. + """ + self.__reset(self.q) + self.q[iMode] = 1.0 + self.__computeInterfacePosVel(True) + + def setInitialDisplacements(self): + """ + This method provides public access to the method __computeInterfacePosVel and + sets velocities for previous time steps. + """ + + self.__computeInterfacePosVel(True) + + def writeSolution(self, time, timeIter, FSIIter): + """ + This method is the main function for output. It writes the file StructHistoryModal.dat + """ + + # Modal History + histFile = open("StructHistoryModal.dat", "a") + line = str(time) + "\t" + str(timeIter) + "\t" + str(FSIIter) + "\t" + for imode in range(self.nDof): + line = ( + line + + str(float(self.q[imode])) + + "\t" + + str(float(self.qdot[imode])) + + "\t" + + str(float(self.qddot[imode])) + + "\t" + ) + line = line + "\n" + histFile.write(line) + histFile.close() + + def updateSolution(self): + """ + This method updates the solution. + """ + + self.q_n = np.copy(self.q) + self.qdot_n = np.copy(self.qdot) + self.qddot_n = np.copy(self.qddot) + self.a_n = np.copy(self.a) + self.__reset(self.q) + self.__reset(self.qdot) + self.__reset(self.qddot) + self.__reset(self.a) + + for iPoint in range(self.nPoint): + self.node[iPoint].updateCoordVel() + + def applyload(self, iVertex, fx, fy, fz): + """ + This method can be accessed from outside to set the nodal forces. + """ + iPoint = self.getVertexGlobalIndex(self.FSI_marker, iVertex) + self.node[iPoint].SetForce((fx, fy, fz)) + + def getNumberOfModes(self): + """ + This method provides the number of degrees of freedom used in + the structural solver. + """ + return self.nDof + + def getFSIMarkerID(self): + """ + This method provides the ID of the interface marker + """ + return self.FSI_marker + + def getNumberOfSolidInterfaceNodes(self, markerID): + + return len(self.markers[markerID]) + + def getVertexGlobalIndex(self, markerID, iVertex): + + # This solver is serial, thus global=local + return self.markers[markerID][iVertex] + + def getInterfaceNodePosInit(self, markerID, iVertex): + + iPoint = self.markers[markerID][iVertex] + Coord0 = self.node[iPoint].GetCoord0() + return Coord0 + + def getInterfaceNodeDisp(self, markerID, iVertex): + + iPoint = self.markers[markerID][iVertex] + Coord = self.node[iPoint].GetCoord() + Coord0 = self.node[iPoint].GetCoord0() + return Coord - Coord0 + + def getInterfaceNodeVel(self, markerID, iVertex): + + iPoint = self.markers[markerID][iVertex] + Vel = self.node[iPoint].GetVel() + return Vel + + def getInterfaceNodeVelNm1(self, markerID, iVertex): + + iPoint = self.markers[markerID][iVertex] + Vel = self.node[iPoint].GetVel_n() + return Vel + + def IsAHaloNode(self, markerID, iVertex): + + # There are no halo nodes in this solver as it is serial + iPoint = self.markers[markerID][iVertex] + halo = False + return halo diff --git a/SU2_PY/change_version_number.py b/SU2_PY/change_version_number.py index e08811e006b..e6358c8b73e 100755 --- a/SU2_PY/change_version_number.py +++ b/SU2_PY/change_version_number.py @@ -3,7 +3,7 @@ ## \file change_version_number.py # \brief Python script for updating the version number of the SU2 suite. # \author A. Aranake -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -28,37 +28,50 @@ # make print(*args) function available in PY2.6+, does'nt work on PY < 2.6 from __future__ import print_function from optparse import OptionParser + # Run the script from the base directory (ie $SU2HOME). Grep will search directories recursively for matches in version number -import os,sys +import os, sys parser = OptionParser() -parser.add_option("-v", "--version", dest="version", - help="the new version number", metavar="VERSION") -parser.add_option("-r", "--releasename", dest="releasename", - help="Name of the new release", metavar="RELEASENAME") -parser.add_option("-y", action="store_true", dest="yes", help="Answer yes to all questions", metavar="YES") -(options, args)=parser.parse_args() +parser.add_option( + "-v", "--version", dest="version", help="the new version number", metavar="VERSION" +) +parser.add_option( + "-r", + "--releasename", + dest="releasename", + help="Name of the new release", + metavar="RELEASENAME", +) +parser.add_option( + "-y", + action="store_true", + dest="yes", + help="Answer yes to all questions", + metavar="YES", +) +(options, args) = parser.parse_args() if not options.version: parser.error("new version number must be provided with -v option") -oldvers = '7.5.1 "Blackbird"' -oldvers_q= r'7.5.1 \"Blackbird\"' -newvers = str(options.version) + ' "' + str(options.releasename) + '"' -newvers_q= str(options.version) + ' \\"' + str(options.releasename) + '\\"' -#oldvers = 'Copyright 2012-2023, SU2' -#oldvers_q = oldvers -#newvers = 'Copyright 2012-2023, SU2' -#newvers_q = newvers +oldvers = '8.0.0 "Harrier"' +oldvers_q = r"8.0.0 \"Harrier\"" +newvers = str(options.version) + ' "' + str(options.releasename) + '"' +newvers_q = str(options.version) + ' \\"' + str(options.releasename) + '\\"' +# oldvers = 'Copyright 2012-2023, SU2' +# oldvers_q = oldvers +# newvers = 'Copyright 2012-2023, SU2' +# newvers_q = newvers if sys.version_info[0] > 2: - # In PY3, raw_input is replaced with input. - # For original input behaviour, just write eval(input()) - raw_input = input + # In PY3, raw_input is replaced with input. + # For original input behaviour, just write eval(input()) + raw_input = input -if os.path.exists('version.txt'): - os.remove('version.txt') +if os.path.exists("version.txt"): + os.remove("version.txt") # Grep flag cheatsheet: # -I : Ignore binary files @@ -67,35 +80,47 @@ # -r : search directory recursively # -v : Omit search string (.svn omitted, line containing ISC is CGNS related) -#TODO: replace with portable instructions. This works only on unix systems -os.system("grep -IFwr '%s' *|grep -vF '.svn' |grep -v ISC > version.txt"%oldvers) -os.system("grep -IFwr '%s' --exclude='version.txt' *|grep -vF '.svn' |grep -v ISC >> version.txt"%oldvers_q) +# TODO: replace with portable instructions. This works only on unix systems +os.system("grep -IFwr '%s' *|grep -vF '.svn' |grep -v ISC > version.txt" % oldvers) +os.system( + "grep -IFwr '%s' --exclude='version.txt' *|grep -vF '.svn' |grep -v ISC >> version.txt" + % oldvers_q +) # Create a list of files to adjust filelist = [] -f = open('version.txt','r') +f = open("version.txt", "r") for line in f.readlines(): - candidate = line.split(':')[0] - if not candidate in filelist: - filelist.append(candidate) + candidate = line.split(":")[0] + if not candidate in filelist: + filelist.append(candidate) f.close() print(filelist) # Prompt user before continuing -yorn = '' -while(not yorn.lower()=='y' and not options.yes): - yorn = raw_input('Replace %s with %s and %s with %s in the listed files? [Y/N]: '%(oldvers,newvers, oldvers_q, newvers_q)) - if yorn.lower()=='n': - print('The file version.txt contains matches of oldvers') - sys.exit() +yorn = "" +while not yorn.lower() == "y" and not options.yes: + yorn = raw_input( + "Replace %s with %s and %s with %s in the listed files? [Y/N]: " + % (oldvers, newvers, oldvers_q, newvers_q) + ) + if yorn.lower() == "n": + print("The file version.txt contains matches of oldvers") + sys.exit() # Loop through and correct all files for fname in filelist: - s = open(fname,'r').read() - s_new = s.replace(oldvers,newvers) - s_new = s_new.replace(oldvers_q, newvers_q) - f = open(fname,'w') - f.write(s_new) - f.close() + with open(fname, "r") as f: + lines = f.readlines() + for i, line in enumerate(lines): + for old, new in zip((oldvers, oldvers_q), (newvers, newvers_q)): + # Avoid breaking the formating of some headers + if old + " " in line: + n = len(new) - len(old) + lines[i] = line.replace(old + " " * max(0, n), new + " " * max(0, -n)) + elif old in line: + lines[i] = line.replace(old, new) + with open(fname, "w") as f: + f.writelines(lines) -os.system('rm -rf version.txt') +os.system("rm -rf version.txt") diff --git a/SU2_PY/compute_multipoint.py b/SU2_PY/compute_multipoint.py deleted file mode 100755 index d4e41067a3d..00000000000 --- a/SU2_PY/compute_multipoint.py +++ /dev/null @@ -1,59 +0,0 @@ -#!/usr/bin/env python - -## \file Compute_multipoint.py -# \brief Python script for performing a multipoint design. -# \author Indiana Stokes -# \version 7.5.1 "Blackbird" -# -# SU2 Project Website: https://su2code.github.io -# -# The SU2 Project is maintained by the SU2 Foundation -# (http://su2foundation.org) -# -# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) -# -# SU2 is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# SU2 is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with SU2. If not, see . - -# imports -import numpy as np -from optparse import OptionParser -import os, sys, shutil, copy -import SU2 - -# Command Line Options -parser = OptionParser() -parser.add_option("-f", "--file", dest="filename", - help="read config from FILE", metavar="FILE") -parser.add_option("-n", "--partitions", dest="partitions", default=2, - help="number of PARTITIONS", metavar="PARTITIONS") - -(options, args)=parser.parse_args() -options.partitions = int( options.partitions ) - -# load config, start state -config = SU2.io.Config(options.filename) -state = SU2.io.State() - -# prepare config -config.NUMBER_PART = options.partitions - -# find solution files if they exist -state.find_files(config) - -# run su2 -multipoint_drag = SU2.eval.func('MULTIPOINT_DRAG',config,state) -grad_multipoint_drag= SU2.eval.grad('MULTIPOINT_DRAG','CONTINUOUS_ADJOINT',config,state) - -print('MULTIPOINT_DRAG =', multipoint_drag) -print('GRADIENT MULTIPOINT_DRAG =', grad_multipoint_drag) diff --git a/SU2_PY/compute_polar.py b/SU2_PY/compute_polar.py index af8562caaf7..102a5eb8bdb 100755 --- a/SU2_PY/compute_polar.py +++ b/SU2_PY/compute_polar.py @@ -3,7 +3,7 @@ ## \file Compute_polar.py # \brief Python script for performing polar sweep. # \author E Arad (based on T. Lukaczyk and F. Palacios script) -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -27,7 +27,7 @@ # # # Several combinations of angles are possible: -#------------------------------------------------ +# ------------------------------------------------ # 1. Polar-sweep in alpha per given phi ...... polarVar = aoa # 2. Polar-sweep in alpha per given beta (side slip angle) ...... polarVar = aoa # 3. Polar-sweep in phi per given alpha ...... polarVar = phi @@ -42,113 +42,197 @@ # imports import os, sys, shutil from optparse import OptionParser -sys.path.append(os.environ['SU2_RUN']) + +sys.path.append(os.environ["SU2_RUN"]) import SU2 import SU2.util.polarSweepLib as psl import copy import numpy as np + def main(): # Command Line Options parser = OptionParser() - parser.add_option("-c", "--ctrl", dest="ctrlFile", - help="reads polar control parameters from FILE (default:polarCtrl.in) ", - metavar="FILE", default="polarCtrl.in") - parser.add_option("-n", "--partitions", dest="partitions", default=2, - help="number of PARTITIONS", metavar="PARTITIONS") - parser.add_option("-i", "--iterations", dest="iterations", default=-1, - help="number of ITERATIONS", metavar="ITERATIONS") - parser.add_option("-d", "--dimension", dest="geomDim", default=2, - help="Geometry dimension (2 or 3)", metavar="geomDim") - parser.add_option("-w", "--Wind", action="store_true", dest="Wind", default=False, - help=" Wind system (default is body system)") - parser.add_option("-v", "--Verbose", action="store_true", dest="verbose", default=False, - help=" Verbose printout (if activated)") + parser.add_option( + "-c", + "--ctrl", + dest="ctrlFile", + help="reads polar control parameters from FILE (default:polarCtrl.in) ", + metavar="FILE", + default="polarCtrl.in", + ) + parser.add_option( + "-n", + "--partitions", + dest="partitions", + default=2, + help="number of PARTITIONS", + metavar="PARTITIONS", + ) + parser.add_option( + "-i", + "--iterations", + dest="iterations", + default=-1, + help="number of ITERATIONS", + metavar="ITERATIONS", + ) + parser.add_option( + "-d", + "--dimension", + dest="geomDim", + default=2, + help="Geometry dimension (2 or 3)", + metavar="geomDim", + ) + parser.add_option( + "-w", + "--Wind", + action="store_true", + dest="Wind", + default=False, + help=" Wind system (default is body system)", + ) + parser.add_option( + "-v", + "--Verbose", + action="store_true", + dest="verbose", + default=False, + help=" Verbose printout (if activated)", + ) (options, args) = parser.parse_args() options.partitions = int(options.partitions) options.iterations = int(options.iterations) options.geomDim = int(options.geomDim) - d2r = np.pi/180 + d2r = np.pi / 180 # sweepOption = [] - sweepOption.append(' Polar sweep type: 1. Sweep in AOA per given roll angle') - sweepOption.append(' Polar sweep type: 2. Sweep in AOA per given sideslip-angle') - sweepOption.append(' Polar sweep type: 3. Sweep in phi per given AOA') - sweepOption.append(' Polar sweep type: 4. Mach ramp (single- value AOA and sideslip-angle') + sweepOption.append(" Polar sweep type: 1. Sweep in AOA per given roll angle") + sweepOption.append(" Polar sweep type: 2. Sweep in AOA per given sideslip-angle") + sweepOption.append(" Polar sweep type: 3. Sweep in phi per given AOA") + sweepOption.append( + " Polar sweep type: 4. Mach ramp (single- value AOA and sideslip-angle" + ) # - #--------------- now read the parameters control file and parse it + # --------------- now read the parameters control file and parse it - fc = open(options.ctrlFile, 'r') + fc = open(options.ctrlFile, "r") ctrl = fc.readlines() nc = np.size(ctrl) fc.close() - print(str(nc)+" lines read from control file: "+options.ctrlFile) - - PA, polarSweepType, velDirOption, nAlpha, nBeta, nPhi, nMach, \ - alpha, beta, phi, MachList, polarVar = \ - psl.setPolaraType(ctrl, nc, options.verbose) + print(str(nc) + " lines read from control file: " + options.ctrlFile) + + ( + PA, + polarSweepType, + velDirOption, + nAlpha, + nBeta, + nPhi, + nMach, + alpha, + beta, + phi, + MachList, + polarVar, + ) = psl.setPolaraType(ctrl, nc, options.verbose) if options.verbose: - velDirOptionLegend = ['V(alpha,phi)', 'V(alpha,beta)'] - print('>>> Control file details: Pitch axis is '+\ - PA+'. Polar sweep type is '+str(polarSweepType)+\ - '; polarVar = '+polarVar) - print('>>> Velocity definiton: '+velDirOptionLegend[velDirOption-1]) - print('>>> nAalpha = '+str(nAlpha)+'; nBeta = '+str(nBeta)+\ - '; nPhi = '+str(nPhi)+'; nMach = '+str(nMach)) + velDirOptionLegend = ["V(alpha,phi)", "V(alpha,beta)"] + print( + ">>> Control file details: Pitch axis is " + + PA + + ". Polar sweep type is " + + str(polarSweepType) + + "; polarVar = " + + polarVar + ) + print(">>> Velocity definiton: " + velDirOptionLegend[velDirOption - 1]) + print( + ">>> nAalpha = " + + str(nAlpha) + + "; nBeta = " + + str(nBeta) + + "; nPhi = " + + str(nPhi) + + "; nMach = " + + str(nMach) + ) if polarSweepType < 4: nPolara = max(nAlpha, nPhi) else: nPolara = nMach - #-------------Configuration base file ---------------------- - inputbaseFileString = 'input base file' + # -------------Configuration base file ---------------------- + inputbaseFileString = "input base file" keyWordInputbaseFile = inputbaseFileString.lower() iBaseInputF = psl.parLocator(keyWordInputbaseFile, ctrl, nc, -1, options.verbose) bIFLine = ctrl[iBaseInputF] - icol = bIFLine.index(':') - sBIF = bIFLine[icol+1:] - inputbaseFile = sBIF.strip(' ') - inputbaseFile = inputbaseFile.strip('\n') - - print(' ') - print('--------------------------------------------------------------------------------------') - print(' ') - print('Configuration file: ' + inputbaseFile) - print('PolarSweepType = '+str(polarSweepType)+' Polar sweep in '+polarVar+' using '+\ - str(nPolara)+' angles/Mach No ') - print(' ') - print('--------------------------------------------------------------------------------------') - print(' ') + icol = bIFLine.index(":") + sBIF = bIFLine[icol + 1 :] + inputbaseFile = sBIF.strip(" ") + inputbaseFile = inputbaseFile.strip("\n") + + print(" ") + print( + "--------------------------------------------------------------------------------------" + ) + print(" ") + print("Configuration file: " + inputbaseFile) + print( + "PolarSweepType = " + + str(polarSweepType) + + " Polar sweep in " + + polarVar + + " using " + + str(nPolara) + + " angles/Mach No " + ) + print(" ") + print( + "--------------------------------------------------------------------------------------" + ) + print(" ") if polarSweepType == 4: - nPolara = 1 # prevent angles inner loop + nPolara = 1 # prevent angles inner loop if options.geomDim not in [2, 3]: - raise SystemExit('ERROR: dimension can be either 2 or 3 (-d parameter) ') + raise SystemExit("ERROR: dimension can be either 2 or 3 (-d parameter) ") if options.Wind: - outSystem = 'Wind' + outSystem = "Wind" else: - outSystem = 'Body' + outSystem = "Body" print(" ") - print("===============================================================================") - print(" Polar sweep in "+str(options.geomDim)+"D ; output in "+outSystem+" system") - print("===============================================================================") + print( + "===============================================================================" + ) + print( + " Polar sweep in " + + str(options.geomDim) + + "D ; output in " + + outSystem + + " system" + ) + print( + "===============================================================================" + ) print(" ") # load config, start state config = SU2.io.Config(inputbaseFile) state = SU2.io.State() # Set SU2 defaults units, if definitions are not included in the cfg file - if 'SYSTEM_MEASUREMENTS' not in config: - config.SYSTEM_MEASUREMENTS = 'SI' - if config.SOLVER == 'NAVIER_STOKES': - if 'REYNOLDS_LENGTH' not in config: + if "SYSTEM_MEASUREMENTS" not in config: + config.SYSTEM_MEASUREMENTS = "SI" + if config.SOLVER == "NAVIER_STOKES": + if "REYNOLDS_LENGTH" not in config: config.REYNOLDS_LENGTH = 1.0 # prepare config @@ -164,14 +248,14 @@ def main(): results = SU2.util.bunch() if nMach == 0: - if 'MACH_NUMBER' in config: + if "MACH_NUMBER" in config: MachList.append(config.MACH_NUMBER) else: MachList.append(0.5) nMach = 1 if nAlpha == 0: - if 'AOA' in config: + if "AOA" in config: alpha.append(config.AOA) else: alpha.append(0.0) @@ -186,30 +270,30 @@ def main(): if nBeta == 0: if noPhi_in_CTRL: - if 'SIDESLIP_ANGLE' in config: + if "SIDESLIP_ANGLE" in config: beta.append(config.SIDESLIP_ANGLE) else: beta.append(0.0) nBeta = 1 else: if polarSweepType < 4: # alpha sweep with phi set - tAlpha = [np.tan(d2r*x) for x in alpha] - tPhi = [np.tan(d2r*x) for x in phi] - tb = [x*y for y in tAlpha for x in tPhi] - beta = [np.arctan(x)/d2r for x in tb] + tAlpha = [np.tan(d2r * x) for x in alpha] + tPhi = [np.tan(d2r * x) for x in phi] + tb = [x * y for y in tAlpha for x in tPhi] + beta = [np.arctan(x) / d2r for x in tb] nBeta = np.size(beta) - else: # Mach ramp - if 'SIDESLIP_ANGLE' in config: + else: # Mach ramp + if "SIDESLIP_ANGLE" in config: beta.append(config.SIDESLIP_ANGLE) else: beta.append(0.0) nBeta = 1 if options.verbose: - print('>>> alpha: '+str(alpha)) - print('>>> beta: '+str(beta)) - print('>>> phi: '+str(phi)) - print('>>> Mach '+str(MachList)) + print(">>> alpha: " + str(alpha)) + print(">>> beta: " + str(beta)) + print(">>> phi: " + str(phi)) + print(">>> Mach " + str(MachList)) results.AOA = alpha results.MACH = MachList @@ -232,96 +316,104 @@ def main(): results.MOMENT_Z = [] if polarSweepType == 4: - outFile = 'machRamp_aoa' + str(alpha[0]) + '.dat' + outFile = "machRamp_aoa" + str(alpha[0]) + ".dat" else: - outFile = 'Polar_M' + str(MachList[0]) + '.dat' + outFile = "Polar_M" + str(MachList[0]) + ".dat" bufsize = 12 # - #----------- Prepare output header --------------- + # ----------- Prepare output header --------------- # - if config.SYSTEM_MEASUREMENTS == 'SI': - length_dimension = 'm' + if config.SYSTEM_MEASUREMENTS == "SI": + length_dimension = "m" else: - length_dimension = 'in' - f = open(outFile, 'w', bufsize) + length_dimension = "in" + f = open(outFile, "w", bufsize) if options.verbose: - print('Opening polar sweep file: ' + outFile) - f.write('% \n% Main coefficients for a polar sweep \n% \n% ') - f.write(sweepOption[polarSweepType-1]) + print("Opening polar sweep file: " + outFile) + f.write("% \n% Main coefficients for a polar sweep \n% \n% ") + f.write(sweepOption[polarSweepType - 1]) if polarSweepType == 1: - satxt = ' ; Roll angle = %7.2f '%(phi[0]) + satxt = " ; Roll angle = %7.2f " % (phi[0]) elif polarSweepType == 2: - satxt = ' ; Sideslip angle = %7.2f '%(beta[0]) + satxt = " ; Sideslip angle = %7.2f " % (beta[0]) elif polarSweepType == 3: - satxt = ' ; AOA = %7.2f '%(alpha[0]) + satxt = " ; AOA = %7.2f " % (alpha[0]) elif polarSweepType == 4: - satxt = ' ; AOA = %7.2f Side slip angle = %7.2f ; '%(alpha[0], beta[0]) + satxt = " ; AOA = %7.2f Side slip angle = %7.2f ; " % (alpha[0], beta[0]) f.write(satxt) - f.write('\n% \n') - f.write('% ================== Reference parameteres ======================\n%\n') + f.write("\n% \n") + f.write("% ================== Reference parameteres ======================\n%\n") XR = config.REF_ORIGIN_MOMENT_X YR = config.REF_ORIGIN_MOMENT_Y ZR = config.REF_ORIGIN_MOMENT_Z - f.write('% Reference point for moments : [ ') - line_text = '%s , %s , %s ] [ %s ] '%(XR, YR, ZR, length_dimension) + f.write("% Reference point for moments : [ ") + line_text = "%s , %s , %s ] [ %s ] " % (XR, YR, ZR, length_dimension) f.write(line_text) - f.write('\n') - f.write('% Reference area and length: ') - line_text = 'Aref : %s Lref : %s [ %s ] '%(config.REF_AREA, config.REF_AREA, length_dimension) + f.write("\n") + f.write("% Reference area and length: ") + line_text = "Aref : %s Lref : %s [ %s ] " % ( + config.REF_AREA, + config.REF_AREA, + length_dimension, + ) f.write(line_text) - f.write('\n% ') - line_text = 'Mach : %7.2f , '%(config.MACH_NUMBER) + f.write("\n% ") + line_text = "Mach : %7.2f , " % (config.MACH_NUMBER) f.write(line_text) - if config.SOLVER == 'NAVIER_STOKES': - line_text = 'Reynolds Number : %s '%(config.REYNOLDS_NUMBER) + if config.SOLVER == "NAVIER_STOKES": + line_text = "Reynolds Number : %s " % (config.REYNOLDS_NUMBER) f.write(line_text) - line_text = 'Reynolds length : %s [ %s ] '%(config.REYNOLDS_LENGTH, length_dimension) + line_text = "Reynolds length : %s [ %s ] " % ( + config.REYNOLDS_LENGTH, + length_dimension, + ) else: - line_text = 'Physical problem : %s '%( config.SOLVER) + line_text = "Physical problem : %s " % (config.SOLVER) f.write(line_text) - f.write('\n% ') - rho = float(config.FREESTREAM_PRESSURE)/\ - (float(config.GAS_CONSTANT)*float(config.FREESTREAM_TEMPERATURE)) - line_text = 'Reference pressure : %s ,'%(config.FREESTREAM_PRESSURE) + f.write("\n% ") + rho = float(config.FREESTREAM_PRESSURE) / ( + float(config.GAS_CONSTANT) * float(config.FREESTREAM_TEMPERATURE) + ) + line_text = "Reference pressure : %s ," % (config.FREESTREAM_PRESSURE) f.write(line_text) - line_text = ' Reference density : %7.4f , '%(rho) + line_text = " Reference density : %7.4f , " % (rho) f.write(line_text) - line_text = ' Reference Temperature : %s '%(config.FREESTREAM_TEMPERATURE) + line_text = " Reference Temperature : %s " % (config.FREESTREAM_TEMPERATURE) f.write(line_text) - f.write('\n% ') - line_text = 'Constant specific heat ratio : %s , '%(config.GAMMA_VALUE) + f.write("\n% ") + line_text = "Constant specific heat ratio : %s , " % (config.GAMMA_VALUE) f.write(line_text) - line_text = 'Gas constant : %s '%(config.GAS_CONSTANT) + line_text = "Gas constant : %s " % (config.GAS_CONSTANT) f.write(line_text) - f.write('\n% ') - line_text = 'Grid file : %s '%(config.MESH_FILENAME) + f.write("\n% ") + line_text = "Grid file : %s " % (config.MESH_FILENAME) f.write(line_text) - f.write('\n% ') + f.write("\n% ") symmmetry_exists = False - if 'MARKER_SYM' in config: - if config.MARKER_SYM != 'NONE': + if "MARKER_SYM" in config: + if config.MARKER_SYM != "NONE": symmmetry_exists = True if symmmetry_exists: - line_text = 'Symmetry surface : yes' + line_text = "Symmetry surface : yes" else: - line_text = 'Symmetry surface : no' + line_text = "Symmetry surface : no" f.write(line_text) - f.write('\n% \n') + f.write("\n% \n") # ----------------- end reference parameter section -------------- if options.Wind: - f.write('% AOA, Mach, CL, CD, ') + f.write("% AOA, Mach, CL, CD, ") if options.geomDim == 3: - f.write('CY, ') + f.write("CY, ") else: if options.geomDim == 2: - f.write('% AOA, Mach, CX, CY, ') + f.write("% AOA, Mach, CX, CY, ") else: - f.write('% AOA, Mach, CX, CZ, CY, ') + f.write("% AOA, Mach, CX, CZ, CY, ") if options.geomDim == 3: - f.write('Cmx, Cmz, Cmy \n') + f.write("Cmx, Cmz, Cmy \n") else: - f.write(' Cmz \n') + f.write(" Cmz \n") firstSweepPoint = True # iterate mach @@ -340,35 +432,39 @@ def main(): SIDESLIP_ANGLE = beta[0] if options.verbose: - print('Sweep step '+str(j)+': Mach = '+str(MachNumber)+\ - ', aoa = ', str(AngleAttack)+', beta = '+str(SIDESLIP_ANGLE)) + print( + "Sweep step " + str(j) + ": Mach = " + str(MachNumber) + ", aoa = ", + str(AngleAttack) + ", beta = " + str(SIDESLIP_ANGLE), + ) # local config and state konfig = copy.deepcopy(config) # enable restart in polar sweep - konfig.DISCARD_INFILES = 'YES' + konfig.DISCARD_INFILES = "YES" ztate = copy.deepcopy(state) # # The eval functions below requires definition of various optimization # variables, though we are handling here only a direct solution. # So, if they are missing in the cfg file (and only then), some dummy values are # introduced here - if 'OBJECTIVE_FUNCTION' not in konfig: - konfig.OBJECTIVE_FUNCTION = 'DRAG' - if 'DV_KIND' not in konfig: - konfig.DV_KIND = ['FFD_SETTING'] - if 'DV_PARAM' not in konfig: - konfig.DV_PARAM = {'FFDTAG': ['1'], 'PARAM': [[0.0, 0.5]], 'SIZE': [1]} - if 'DEFINITION_DV' not in konfig: - konfig.DEFINITION_DV = {'FFDTAG': [[]], - 'KIND': ['HICKS_HENNE'], - 'MARKER': [['WING']], - 'PARAM': [[0.0, 0.05]], - 'SCALE': [1.0], - 'SIZE': [1]} - if 'OPT_OBJECTIVE' not in konfig: + if "OBJECTIVE_FUNCTION" not in konfig: + konfig.OBJECTIVE_FUNCTION = "DRAG" + if "DV_KIND" not in konfig: + konfig.DV_KIND = ["FFD_SETTING"] + if "DV_PARAM" not in konfig: + konfig.DV_PARAM = {"FFDTAG": ["1"], "PARAM": [[0.0, 0.5]], "SIZE": [1]} + if "DEFINITION_DV" not in konfig: + konfig.DEFINITION_DV = { + "FFDTAG": [[]], + "KIND": ["HICKS_HENNE"], + "MARKER": [["WING"]], + "PARAM": [[0.0, 0.05]], + "SCALE": [1.0], + "SIZE": [1], + } + if "OPT_OBJECTIVE" not in konfig: obj = {} - obj['DRAG'] = {'SCALE':1.e-2, 'OBJTYPE':'DEFAULT', 'MARKER': 'None'} + obj["DRAG"] = {"SCALE": 1.0e-2, "OBJTYPE": "DEFAULT", "MARKER": "None"} konfig.OPT_OBJECTIVE = obj # # --------- end of dummy optimization variables definition section --------- @@ -378,42 +474,42 @@ def main(): konfig.AOA = AngleAttack konfig.SIDESLIP_ANGLE = SIDESLIP_ANGLE konfig.MACH_NUMBER = MachNumber - caseName = 'DIRECT_M_' + str(MachNumber) + '_AOA_' + str(AngleAttack) - print('Mach = ', konfig.MACH_NUMBER, 'AOA = ', konfig.AOA) - print('case :' + caseName) + caseName = "DIRECT_M_" + str(MachNumber) + "_AOA_" + str(AngleAttack) + print("Mach = ", konfig.MACH_NUMBER, "AOA = ", konfig.AOA) + print("case :" + caseName) if firstSweepPoint: # if caseName exists copy the restart file from it for run continuation # Continue from previous sweep point if this is not he first if os.path.isdir(caseName): - command = 'cp '+caseName+'/'+config.SOLUTION_FILENAME+' .' + command = "cp " + caseName + "/" + config.SOLUTION_FILENAME + " ." if options.verbose: print(command) - shutil.copy2(caseName+'/'+config.SOLUTION_FILENAME, os.getcwd()) - konfig.RESTART_SOL = 'YES' + shutil.copy2(caseName + "/" + config.SOLUTION_FILENAME, os.getcwd()) + konfig.RESTART_SOL = "YES" else: - konfig.RESTART_SOL = 'NO' + konfig.RESTART_SOL = "NO" firstSweepPoint = False else: - konfig.RESTART_SOL = 'YES' - if konfig.RESTART_SOL == 'YES': + konfig.RESTART_SOL = "YES" + if konfig.RESTART_SOL == "YES": ztate.FILES.DIRECT = config.SOLUTION_FILENAME # run su2 if options.Wind: - drag = SU2.eval.func('DRAG', konfig, ztate) - lift = SU2.eval.func('LIFT', konfig, ztate) + drag = SU2.eval.func("DRAG", konfig, ztate) + lift = SU2.eval.func("LIFT", konfig, ztate) if options.geomDim == 3: - sideforce = SU2.eval.func('SIDEFORCE', konfig, ztate) + sideforce = SU2.eval.func("SIDEFORCE", konfig, ztate) else: - force_x = SU2.eval.func('FORCE_X', konfig, ztate) - force_y = SU2.eval.func('FORCE_Y', konfig, ztate) + force_x = SU2.eval.func("FORCE_X", konfig, ztate) + force_y = SU2.eval.func("FORCE_Y", konfig, ztate) if options.geomDim == 3: - force_z = SU2.eval.func('FORCE_Z', konfig, ztate) + force_z = SU2.eval.func("FORCE_Z", konfig, ztate) - momentz = SU2.eval.func('MOMENT_Z', konfig, ztate) + momentz = SU2.eval.func("MOMENT_Z", konfig, ztate) if options.geomDim == 3: - momentx = SU2.eval.func('MOMENT_X', konfig, ztate) - momenty = SU2.eval.func('MOMENT_Y', konfig, ztate) + momentx = SU2.eval.func("MOMENT_X", konfig, ztate) + momenty = SU2.eval.func("MOMENT_Y", konfig, ztate) # append results @@ -433,64 +529,73 @@ def main(): results.MOMENT_X.append(momentx) results.MOMENT_Y.append(momenty) - output = ' ' + str(AngleAttack) + ", "+str(MachNumber)+", " + output = " " + str(AngleAttack) + ", " + str(MachNumber) + ", " if options.Wind: - output = output+ str(lift) + ", " + str(drag) + output = output + str(lift) + ", " + str(drag) if options.geomDim == 3: - output = output+", "+str(sideforce) + output = output + ", " + str(sideforce) else: if options.geomDim == 2: - output = output+ str(force_x) + ", " + str(force_y) + output = output + str(force_x) + ", " + str(force_y) else: - output = output + str(force_x) + ", " + str(force_z) + ", " + str(force_y) + output = ( + output + + str(force_x) + + ", " + + str(force_z) + + ", " + + str(force_y) + ) if options.geomDim == 3: output = output + ", " + str(momentx) + ", " + str(momentz) + ", " output = output + str(momenty) + " \n" else: - output = output+", "+str(momentz)+" \n" + output = output + ", " + str(momentz) + " \n" f.write(output) # save data - SU2.io.save_data('results.pkl', results) - shutil.copy2('results.pkl', 'DIRECT') - shutil.copy2(config.SOLUTION_FILENAME, 'DIRECT') + SU2.io.save_data("results.pkl", results) + shutil.copy2("results.pkl", "DIRECT") + shutil.copy2(config.SOLUTION_FILENAME, "DIRECT") if os.path.isdir(caseName): - command = 'cat '+caseName+\ - '/history_direct.dat DIRECT/history_direct.dat > tmp && mv tmp '+\ - 'DIRECT/history_direct.dat' + command = ( + "cat " + + caseName + + "/history_direct.dat DIRECT/history_direct.dat > tmp && mv tmp " + + "DIRECT/history_direct.dat" + ) if options.verbose: print(command) os.system(command) shutil.rmtree(caseName) - command = 'cp -p -R DIRECT '+caseName + command = "cp -p -R DIRECT " + caseName if options.verbose: print(command) - shutil.copytree('DIRECT', caseName) + shutil.copytree("DIRECT", caseName) # Close open file f.close() - if os.path.isdir('DIRECT'): - shutil.rmtree('DIRECT') + if os.path.isdir("DIRECT"): + shutil.rmtree("DIRECT") if os.path.isfile(config.SOLUTION_FILENAME): os.remove(config.SOLUTION_FILENAME) - if os.path.isfile('results.pkl'): - os.remove('results.pkl') - print('Post sweep cleanup completed') + if os.path.isfile("results.pkl"): + os.remove("results.pkl") + print("Post sweep cleanup completed") # sys.exit(0) - #----------------------------------------------------------# + # ----------------------------------------------------------# #: for each angle # plotting - #plt.figure() - #plt.plot( results.MACH_NUMBER, results.AOA , results.LIFT , results.DRAG ) - #plt.show() - + # plt.figure() + # plt.plot( results.MACH_NUMBER, results.AOA , results.LIFT , results.DRAG ) + # plt.show() if __name__ == "__main__": diff --git a/SU2_PY/compute_stability.py b/SU2_PY/compute_stability.py deleted file mode 100755 index d2284274df0..00000000000 --- a/SU2_PY/compute_stability.py +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python - -## \file compute_stability.py -# \brief Python script for performing the shape optimization. -# \author T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" -# -# SU2 Project Website: https://su2code.github.io -# -# The SU2 Project is maintained by the SU2 Foundation -# (http://su2foundation.org) -# -# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) -# -# SU2 is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# SU2 is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with SU2. If not, see . - -# make print(*args) function available in PY2.6+, does'nt work on PY < 2.6 -from __future__ import print_function - -# imports -from optparse import OptionParser -import SU2 - -# Command Line Options -parser = OptionParser() -parser.add_option("-f", "--file", dest="filename", - help="read config from FILE", metavar="FILE") -parser.add_option("-n", "--partitions", dest="partitions", default=2, - help="number of PARTITIONS", metavar="PARTITIONS") -parser.add_option("-i", "--iterations", dest="iterations", default=99999, - help="number of ITERATIONS", metavar="ITERATIONS") - -(options, args)=parser.parse_args() -options.partitions = int( options.partitions ) -options.iterations = int( options.iterations ) - -# load config, start state -config = SU2.io.Config(options.filename) -state = SU2.io.State() - -# prepare config -config.NUMBER_PART = options.partitions -config.EXT_ITER = options.iterations - -# find solution files if they exist -state.find_files(config) - -# run su2 -drag_alpha = SU2.eval.func('D_DRAG_D_ALPHA',config,state) -moment_y_alpha= SU2.eval.func('D_MOMENT_Z_D_ALPHA',config,state) - -grad_moment_y_alpha= SU2.eval.grad('D_MOMENT_Z_D_ALPHA','CONTINUOUS_ADJOINT',config,state) - -print('D_DRAG_D_ALPHA =' , drag_alpha) -print('D_MOMENT_Y_D_ALPHA =' , moment_y_alpha) - -print('DD_MOMENT_Y_D_ALPHA_D_X =', grad_moment_y_alpha) diff --git a/SU2_PY/compute_uncertainty.py b/SU2_PY/compute_uncertainty.py index 3d2f0905aeb..57fb9b3e598 100755 --- a/SU2_PY/compute_uncertainty.py +++ b/SU2_PY/compute_uncertainty.py @@ -3,7 +3,7 @@ ## \file compute_uncertainty.py # \brief Python script for performing model-form UQ for SST turbulence model # \author J. Mukhopadhaya -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -32,57 +32,81 @@ import shutil import copy import os.path -sys.path.append(os.environ['SU2_RUN']) + +sys.path.append(os.environ["SU2_RUN"]) import SU2 + def main(): -# Command Line Options + # Command Line Options parser = OptionParser() - parser.add_option("-f", "--file", dest="filename", - help="read config from FILE", metavar="FILE") - parser.add_option("-n", "--partitions", dest="partitions", default=1, - help="number of PARTITIONS", metavar="PARTITIONS") - parser.add_option("-u", "--underRelaxation", dest="uq_urlx", default=0.1, - help="under relaxation factor", metavar="UQ_URLX") - parser.add_option("-b", "--deltaB", dest="uq_delta_b", default=1.0, - help="magnitude of perturbation", metavar="UQ_DELTA_B") - - (options, args)=parser.parse_args() - options.partitions = int( options.partitions ) + parser.add_option( + "-f", "--file", dest="filename", help="read config from FILE", metavar="FILE" + ) + parser.add_option( + "-n", + "--partitions", + dest="partitions", + default=1, + help="number of PARTITIONS", + metavar="PARTITIONS", + ) + parser.add_option( + "-u", + "--underRelaxation", + dest="uq_urlx", + default=0.1, + help="under relaxation factor", + metavar="UQ_URLX", + ) + parser.add_option( + "-b", + "--deltaB", + dest="uq_delta_b", + default=1.0, + help="magnitude of perturbation", + metavar="UQ_DELTA_B", + ) + + (options, args) = parser.parse_args() + options.partitions = int(options.partitions) # check the typecasting - options.beta_delta = float( options.uq_delta_b ) + options.beta_delta = float(options.uq_delta_b) options.urlx = float(options.uq_urlx) # load config, start state config = SU2.io.Config(options.filename) - state = SU2.io.State() + state = SU2.io.State() # find solution files if they exist state.find_files(config) # prepare config config.NUMBER_PART = options.partitions - config.SST_OPTIONS = 'UQ' + config.SST_OPTIONS = "UQ" config.UQ_DELTA_B = options.beta_delta config.UQ_URLX = options.urlx - config.UQ_PERMUTE = 'NO' - + config.UQ_PERMUTE = "NO" # perform eigenvalue perturbations - for comp in range(1,4): - print('\n\n =================== Performing ' + str(comp) + ' Component Perturbation =================== \n\n') + for comp in range(1, 4): + print( + "\n\n =================== Performing " + + str(comp) + + " Component Perturbation =================== \n\n" + ) # make copies konfig = copy.deepcopy(config) - ztate = copy.deepcopy(state) + ztate = copy.deepcopy(state) # set componentality konfig.UQ_COMPONENT = comp # send output to a folder - folderName = str(comp)+'c/' + folderName = str(comp) + "c/" if os.path.isdir(folderName): - shutil.rmtree(folderName) + shutil.rmtree(folderName) os.mkdir(folderName) sendOutputFiles(konfig, folderName) @@ -95,19 +119,20 @@ def main(): info = SU2.run.merge(konfig) ztate.update(info) - - print('\n\n =================== Performing p1c1 Component Perturbation =================== \n\n') + print( + "\n\n =================== Performing p1c1 Component Perturbation =================== \n\n" + ) # make copies konfig = copy.deepcopy(config) - ztate = copy.deepcopy(state) + ztate = copy.deepcopy(state) # set componentality konfig.UQ_COMPONENT = 1 - konfig.UQ_PERMUTE = 'YES' + konfig.UQ_PERMUTE = "YES" # send output to a folder - folderName = 'p1c1/' + folderName = "p1c1/" if os.path.isdir(folderName): shutil.rmtree(folderName) os.mkdir(folderName) @@ -122,18 +147,20 @@ def main(): info = SU2.run.merge(konfig) state.update(info) - print('\n\n =================== Performing p1c2 Component Perturbation =================== \n\n') + print( + "\n\n =================== Performing p1c2 Component Perturbation =================== \n\n" + ) # make copies konfig = copy.deepcopy(config) - ztate = copy.deepcopy(state) + ztate = copy.deepcopy(state) # set componentality konfig.UQ_COMPONENT = 2 - konfig.UQ_PERMUTE = 'YES' + konfig.UQ_PERMUTE = "YES" # send output to a folder - folderName = 'p1c2/' + folderName = "p1c2/" if os.path.isdir(folderName): shutil.rmtree(folderName) os.mkdir(folderName) @@ -148,9 +175,10 @@ def main(): info = SU2.run.merge(konfig) ztate.update(info) -def sendOutputFiles( config, folderName = ''): + +def sendOutputFiles(config, folderName=""): config.CONV_FILENAME = folderName + config.CONV_FILENAME - #config.BREAKDOWN_FILENAME = folderName + config.BREAKDOWN_FILENAME + # config.BREAKDOWN_FILENAME = folderName + config.BREAKDOWN_FILENAME config.RESTART_FILENAME = folderName + config.RESTART_FILENAME config.VOLUME_FILENAME = folderName + config.VOLUME_FILENAME config.SURFACE_FILENAME = folderName + config.SURFACE_FILENAME diff --git a/SU2_PY/config_gui.py b/SU2_PY/config_gui.py deleted file mode 100755 index 3cf13878c7a..00000000000 --- a/SU2_PY/config_gui.py +++ /dev/null @@ -1,319 +0,0 @@ -#!/usr/bin/env python - -## \file config_gui.py -# \brief _____________. -# \author A. Aranake -# \version 7.5.1 "Blackbird" -# -# SU2 Project Website: https://su2code.github.io -# -# The SU2 Project is maintained by the SU2 Foundation -# (http://su2foundation.org) -# -# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) -# -# SU2 is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# SU2 is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with SU2. If not, see . - -# make print(*args) function available in PY2.6+, does'nt work on PY < 2.6 -from __future__ import print_function - -from parse_config import * -import wx, sys -import wx.lib.scrolledpanel as sp - - -# ctrldict is a dictionary -# keys of ctrldict are option categories -# Values of ctrldict are lists (optlist) of lists (option_data) -# option_data takes the form [option_name, option_value, StaticText,Control] - -class YesNoBox(wx.CheckBox): - '''The regular checkbox returns True or False, this one returns YES or NO to match the SU2 config format.''' - - def __init__(self, parent, *args, **kwargs): - wx.CheckBox.__init__(self, parent, *args, **kwargs) - - def GetValue(self): - if self.Value: - return "YES" - else: - return "NO" - - def SetValue(self,stringval): - if stringval=="YES": - self.Value=True - else: - self.Value=False - -class LabeledComboBox(): - '''Wrap a StaticText and TextCtrl into a single object''' - - def __init__(self,parent,option_name,txtlabel,option_default,option_values,option_type,option_description): - self.label = wx.StaticText(parent,label=txtlabel+", "+option_type) - self.option_name = option_name - self.control = wx.ComboBox(parent,value=option_default,choices=option_values) - self.control.SetSize((400,20)) - self.sizer = wx.BoxSizer(wx.HORIZONTAL) - self.sizer.Add(self.label,wx.EXPAND) - self.sizer.AddSpacer(20) - self.sizer.Add(self.control,wx.EXPAND) - self.sizer.SetMinSize((400,20)) - - self.option_default = option_default - self.option_type = option_type - self.option_description = option_description - - def GetSizer(self): - return self.sizer - - def GetValue(self): - return self.control.GetValue() - - def SetValue(self,val): - self.control.SetValue(val) - - def SetDefaultValue(self): - self.control.SetValue(self.option_default) - - def GetCtrl(self): - return self.control - -class LabeledTextCtrl(): - '''Wrap a StaticText and TextCtrl into a single object''' - - def __init__(self,parent,option_name,txtlabel,option_default,option_type): - self.label = wx.StaticText(parent,label=txtlabel+", "+option_type) - self.option_name = option_name - self.control = wx.TextCtrl(parent,value=option_default) - self.control.SetSize((400,20)) - self.sizer = wx.BoxSizer(wx.HORIZONTAL) - self.sizer.Add(self.label,wx.EXPAND) - self.sizer.AddSpacer(20) - self.sizer.Add(self.control,wx.EXPAND) - self.sizer.SetMinSize((400,20)) - - self.option_default = option_default - self.option_type = option_type - - def GetSizer(self): - return self.sizer - - def GetValue(self): - return self.control.GetValue() - - def SetValue(self,val): - self.control.SetValue(val) - - def SetDefaultValue(self): - self.control.SetValue(self.option_default) - - def GetCtrl(self): - return self.control - -class config_gui(wx.Frame): - def __init__(self,option_data): - - # wx Initialization - wx.Frame.__init__(self, None, title="SU2 config file editor") - - # Define the main sizers - self.frame_sizer = wx.BoxSizer(wx.HORIZONTAL) - self.main_sizer = wx.BoxSizer(wx.HORIZONTAL) - self.left_sizer = wx.BoxSizer(wx.VERTICAL) - self.right_sizer = wx.BoxSizer(wx.VERTICAL) - - # Use a scrolled panel on the right side - self.main_panel = wx.Panel(self) - self.scroll_sizer = wx.BoxSizer(wx.VERTICAL) - self.right_panel = sp.ScrolledPanel(self.main_panel,size=(500,500)) - self.right_panel.SetupScrolling() - - # Left side - list of option categories - self.list_ctrl = wx.ListCtrl(self.main_panel,style=wx.LC_REPORT|wx.BORDER_SUNKEN,size=(300,600)) - self.list_ctrl.InsertColumn(0, 'Option Category') - - bigfont = wx.Font(20,wx.MODERN,wx.NORMAL,wx.BOLD) - - # Read the option_data and build controls - self.ctrldict = {} - self.optlabels = {} - for j,category in enumerate(option_data): - - self.list_ctrl.InsertStringItem(j, category) # Add category to left size list - - self.optlabels[category] = wx.StaticText(self.right_panel,label=category) - self.optlabels[category].SetFont(bigfont) - - if j>0: - self.scroll_sizer.AddSpacer(20) - self.scroll_sizer.Add(self.optlabels[category],wx.EXPAND) - - self.ctrldict[category] = [] - yctr = 0 - for j,opt in enumerate(option_data[category]): - if opt.option_type in ["EnumOption","MathProblem","SpecialOption","ConvectOption"]: - self.ctrldict[category].append(LabeledComboBox(self.right_panel,opt.option_name,opt.option_name,opt.option_default,opt.option_values,opt.option_type,opt.option_description)) - else: - self.ctrldict[category].append(LabeledTextCtrl(self.right_panel,opt.option_name,opt.option_name,opt.option_default,opt.option_type)) - - for control in self.ctrldict[category]: - self.scroll_sizer.Add(control.GetSizer(),wx.EXPAND) # Add each control to the sizer - self.lastctrl = control.GetCtrl() - - # Set right_panel to scroll vertically - self.right_panel.SetSizer(self.scroll_sizer) - - # Set up menu - menuBar = wx.MenuBar() - m_file = wx.Menu() - m_save = m_file.Append(wx.ID_SAVE, "&Save", "Save an SU2 .cfg file") - m_open = m_file.Append(wx.ID_OPEN, "&Open", "Load an SU2 .cfg file") - m_exit = m_file.Append(wx.ID_EXIT, "E&xit", "Close window and exit program.") - - menuBar.Append(m_file, "&File") - self.SetMenuBar(menuBar) - self.CreateStatusBar() - - # Specify which functions to call when stuff is changed - self.Bind(wx.EVT_LIST_ITEM_SELECTED, self.list_click, self.list_ctrl) - self.Bind(wx.EVT_MENU, self.OnSave, m_save) - self.Bind(wx.EVT_MENU, self.OnOpen, m_open) - self.Bind(wx.EVT_SIZE, self.OnResize) - self.right_panel.SetAutoLayout(1) - - # Add it all to the panel and draw - self.left_sizer.SetMinSize((300,600)) - self.right_sizer.SetMinSize((300,600)) - self.list_ctrl.SetColumnWidth(0,500) - - self.left_sizer.Add(self.list_ctrl,0,wx.EXPAND) - self.right_sizer.Add(self.right_panel,0,wx.EXPAND) - self.main_sizer.Add(self.left_sizer,0,wx.EXPAND) - self.main_sizer.Add(self.right_sizer,0,wx.EXPAND) - self.frame_sizer.Add(self.main_sizer,0,wx.EXPAND) - - self.main_panel.SetSizer(self.main_sizer) - self.SetSizer(self.frame_sizer) - self.SetInitialSize() - - def OnCheck(self,event): - print(event) - print(dir(event)) - print(event.GetEventObject()) - print(event.GetEventObject().GetValue()) - - def OnResize(self,event): - # There is surely a better way to do this.... - framesize = self.GetSize() - self.main_panel.SetSize(framesize) - self.list_ctrl.SetSize((300,framesize[1]-50)) - self.right_panel.SetSize((framesize[0]-300,framesize[1]-50)) - - - def OnSave(self,event): - - # Dialog to set output filename - SaveDialog = wx.FileDialog(self,style=wx.FD_SAVE,wildcard='*.cfg') - SaveDialog.ShowModal() - outfile = SaveDialog.GetPath() - - f = open(outfile,'w') - - for category,optlist in self.ctrldict.items(): - f.write('%% %s \n'%category) - for option in optlist: - value = option.GetValue() - if not value=="": - f.write('%s=%s\n'%(option.option_name,option.GetValue())) - f.close() - - def OnOpen(self,event): - - # Dialog to select file - OpenDialog = wx.FileDialog(self,wildcard='*.cfg') - OpenDialog.ShowModal() - infile = OpenDialog.GetPath() - - # Open file, Load values into a dictionary - cfgfile = open(infile,'r') - infiledict = {} - lines = cfgfile.readlines() - for line in lines: - if (line[0]=='%' or line.find('=')==-1): # Skip lines w/o = sign - continue - else: # Get value - key,val=[text.strip() for text in line.split('=')] - key = key.upper() # AoA should work as well as AOA - infiledict[key] = val - - # Loop through controls and set them to the new values - for category,optlist in self.ctrldict.items(): - for option in optlist: - if option.option_name in infiledict: - option.SetValue(infiledict[option.option_name]) - else: - option.SetValue("") - - def OnClose(self,event): - sys.exit(1) - - def OnAbout(self,event): - print("OnAbout") - - def list_click(self, event): - - category = event.GetText() - - self.right_panel.ScrollChildIntoView(self.lastctrl) - self.right_panel.ScrollChildIntoView(self.optlabels[category]) - - -def prepare_data(): - """ Method to get configuration data from source files. - Outputs a dictionary of categories as keys and lists of config_options as values - """ - - # These variables should point to the configuration files - su2_basedir = os.environ['SU2_HOME'] - config_cpp = os.path.join(su2_basedir,'Common/src/config_structure.cpp') - config_hpp = os.path.join(su2_basedir,'Common/include/option_structure.hpp') - - # Check that files exist - if not os.path.isfile(config_cpp): - sys.exit('Could not find cpp file, please check that su2_basedir is set correctly in config_gui.py') - if not os.path.isfile(config_hpp): - sys.exit('Could not find hpp file, please check that su2_basedir is set correctly in config_gui.py') - - # Run the parser - option_list = parse_config(config_cpp, config_hpp) - - # Organize data into dictionary with categories as keys - option_data = {} - for opt in option_list: - if not opt.option_category in option_data: - option_data[opt.option_category] = [] - option_data[opt.option_category].append(opt) - - return option_data - -if __name__=="__main__": - - # Read source files, get option data - option_data = prepare_data() - - # Launch GUI - app = wx.App(None) - frame = config_gui(option_data) - frame.Show() - app.MainLoop() diff --git a/SU2_PY/continuous_adjoint.py b/SU2_PY/continuous_adjoint.py index 071f4b9a4ea..8ec95d2ad31 100755 --- a/SU2_PY/continuous_adjoint.py +++ b/SU2_PY/continuous_adjoint.py @@ -3,7 +3,7 @@ ## \file continuous_adjoint.py # \brief Python script for continuous adjoint computation using the SU2 suite. # \author F. Palacios, T. Economon, T. Lukaczyk -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -27,39 +27,69 @@ import os, sys from optparse import OptionParser -sys.path.append(os.environ['SU2_RUN']) + +sys.path.append(os.environ["SU2_RUN"]) import SU2 # ------------------------------------------------------------------- # Main # ------------------------------------------------------------------- + def main(): # Command Line Options - parser=OptionParser() - parser.add_option("-f", "--file", dest="filename", - help="read config from FILE", metavar="FILE") - parser.add_option("-n", "--partitions", dest="partitions", default=1, - help="number of PARTITIONS", metavar="PARTITIONS") - parser.add_option("-c", "--compute", dest="compute", default="True", - help="COMPUTE direct and adjoint problem", metavar="COMPUTE") - parser.add_option("-s", "--step", dest="step", default=1E-4, - help="DOT finite difference STEP", metavar="STEP") - parser.add_option("-z", "--zones", dest="nzones", default="1", - help="Number of Zones", metavar="ZONES") - - (options, args)=parser.parse_args() - options.partitions = int( options.partitions ) - options.step = float( options.step ) - options.compute = options.compute.upper() == 'TRUE' - options.nzones = int( options.nzones ) - - continuous_adjoint( options.filename , - options.partitions , - options.compute , - options.step , - options.nzones ) + parser = OptionParser() + parser.add_option( + "-f", "--file", dest="filename", help="read config from FILE", metavar="FILE" + ) + parser.add_option( + "-n", + "--partitions", + dest="partitions", + default=1, + help="number of PARTITIONS", + metavar="PARTITIONS", + ) + parser.add_option( + "-c", + "--compute", + dest="compute", + default="True", + help="COMPUTE direct and adjoint problem", + metavar="COMPUTE", + ) + parser.add_option( + "-s", + "--step", + dest="step", + default=1e-4, + help="DOT finite difference STEP", + metavar="STEP", + ) + parser.add_option( + "-z", + "--zones", + dest="nzones", + default="1", + help="Number of Zones", + metavar="ZONES", + ) + + (options, args) = parser.parse_args() + options.partitions = int(options.partitions) + options.step = float(options.step) + options.compute = options.compute.upper() == "TRUE" + options.nzones = int(options.nzones) + + continuous_adjoint( + options.filename, + options.partitions, + options.compute, + options.step, + options.nzones, + ) + #: def main() @@ -68,31 +98,28 @@ def main(): # Continuous Adjoint # ------------------------------------------------------------------- -def continuous_adjoint( filename , - partitions = 0 , - compute = True , - step = 1e-4 , - nzones = 1 ): + +def continuous_adjoint(filename, partitions=0, compute=True, step=1e-4, nzones=1): # Config config = SU2.io.Config(filename) config.NUMBER_PART = partitions - config.NZONES = int( nzones ) + config.NZONES = int(nzones) # State state = SU2.io.State() # Force CSV output in order to compute gradients - if not 'OUTPUT_FILES' in config: - config['OUTPUT_FILES'] = ['RESTART'] + if not "OUTPUT_FILES" in config: + config["OUTPUT_FILES"] = ["RESTART"] - if not 'SURFACE_CSV' in config['OUTPUT_FILES']: - config['OUTPUT_FILES'].append('SURFACE_CSV') + if not "SURFACE_CSV" in config["OUTPUT_FILES"]: + config["OUTPUT_FILES"].append("SURFACE_CSV") # check for existing files if not compute: - config.RESTART_SOL = 'YES' + config.RESTART_SOL = "YES" state.find_files(config) else: state.FILES.MESH = config.MESH_FILENAME @@ -101,7 +128,7 @@ def continuous_adjoint( filename , if compute: info = SU2.run.direct(config) state.update(info) - SU2.io.restart2solution(config,state) + SU2.io.restart2solution(config, state) # Adjoint Solution @@ -109,21 +136,20 @@ def continuous_adjoint( filename , if compute: info = SU2.run.adjoint(config) state.update(info) - info = SU2.run.projection(config,state, step) + info = SU2.run.projection(config, state, step) state.update(info) return state + #: continuous_adjoint() # ------------------------------------------------------------------- # Alternate Forumulation # ------------------------------------------------------------------- -def continuous_design( filename , - partitions = 0 , - compute = True , - step = 1e-4 ): + +def continuous_design(filename, partitions=0, compute=True, step=1e-4): # TODO: # step @@ -144,7 +170,7 @@ def continuous_design( filename , state.FILES.MESH = config.MESH_FILENAME # Adjoint Gradient - grads = SU2.eval.grad( ADJ_NAME, 'CONTINUOUS_ADJOINT', config, state ) + grads = SU2.eval.grad(ADJ_NAME, "CONTINUOUS_ADJOINT", config, state) return state @@ -154,6 +180,5 @@ def continuous_design( filename , # ------------------------------------------------------------------- # this is only accessed if running from command prompt -if __name__ == '__main__': +if __name__ == "__main__": main() - diff --git a/SU2_PY/convert_to_csv.py b/SU2_PY/convert_to_csv.py deleted file mode 100755 index c3811b6627e..00000000000 --- a/SU2_PY/convert_to_csv.py +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env python - -## \file convert_to_csv.py -# \brief This script converts SU2 ASCII restart files generated with a version prior v7 to the CSV format -# \author T. Albring -# \version 7.5.1 "Blackbird" -# -# SU2 Project Website: https://su2code.github.io -# -# The SU2 Project is maintained by the SU2 Foundation -# (http://su2foundation.org) -# -# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) -# -# SU2 is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# SU2 is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with SU2. If not, see . - -from optparse import OptionParser -import os - -parser = OptionParser(usage = "%prog -i INPUT_FILE", - description = 'This script converts SU2 ASCII restart files generated with a version prior v7 to the CSV format') -parser.add_option("-i", "--inputfile", dest="infile", - help="ASCII restart file (*.dat)", metavar="INPUT_FILE") -(options, args)=parser.parse_args() - - -infile = open(options.infile, "r") -out_name = options.infile.split('.')[0] + ".csv" -if (os.path.isfile(out_name)): - print('File ' + out_name + ' already exists.') - exit(1) -outfile = open(out_name, "w") - -while 1: - line = infile.readline() - if not line: - break - - line = line.split() - for i, val in enumerate(line): - outfile.write(val.strip()) - if i != len(line)-1: - outfile.write(', ') - outfile.write('\n') - -print('Converted ' + options.infile + ' to ' + out_name) diff --git a/SU2_PY/copy_directory.py b/SU2_PY/copy_directory.py new file mode 100755 index 00000000000..aa42e27cc61 --- /dev/null +++ b/SU2_PY/copy_directory.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python +# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) + +import sys +import os +import shutil + +if __name__ == "__main__": + src = os.path.abspath(sys.argv[1]) + dst = os.path.abspath(sys.argv[2]) + shutil.copytree(src, dst) diff --git a/SU2_PY/direct_differentiation.py b/SU2_PY/direct_differentiation.py index c885a58eaec..e5d458ae582 100755 --- a/SU2_PY/direct_differentiation.py +++ b/SU2_PY/direct_differentiation.py @@ -3,7 +3,7 @@ ## \file direct_differentiation.py # \brief Python script for doing the direct differentiation computation using the SU2 suite. # \author F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -28,34 +28,56 @@ from __future__ import division, print_function, absolute_import import os, sys, shutil from optparse import OptionParser -sys.path.append(os.environ['SU2_RUN']) + +sys.path.append(os.environ["SU2_RUN"]) import SU2 # ------------------------------------------------------------------- # Main # ------------------------------------------------------------------- + def main(): parser = OptionParser() - parser.add_option("-f", "--file", dest="filename", - help="read config from FILE", metavar="FILE") - parser.add_option("-n", "--partitions", dest="partitions", default=1, - help="number of PARTITIONS", metavar="PARTITIONS") - parser.add_option("-q", "--quiet", dest="quiet", default='False', - help="output QUIET to log files", metavar="QUIET") - parser.add_option("-z", "--zones", dest="nzones", default="1", - help="Number of Zones", metavar="ZONES") - - (options, args)=parser.parse_args() - options.partitions = int( options.partitions ) - options.quiet = options.quiet.upper() == 'TRUE' - options.nzones = int( options.nzones ) - - direct_differentiation( options.filename , - options.partitions , - options.quiet , - options.nzones ) + parser.add_option( + "-f", "--file", dest="filename", help="read config from FILE", metavar="FILE" + ) + parser.add_option( + "-n", + "--partitions", + dest="partitions", + default=1, + help="number of PARTITIONS", + metavar="PARTITIONS", + ) + parser.add_option( + "-q", + "--quiet", + dest="quiet", + default="False", + help="output QUIET to log files", + metavar="QUIET", + ) + parser.add_option( + "-z", + "--zones", + dest="nzones", + default="1", + help="Number of Zones", + metavar="ZONES", + ) + + (options, args) = parser.parse_args() + options.partitions = int(options.partitions) + options.quiet = options.quiet.upper() == "TRUE" + options.nzones = int(options.nzones) + + direct_differentiation( + options.filename, options.partitions, options.quiet, options.nzones + ) + + #: def main() @@ -63,18 +85,16 @@ def main(): # Direct Differentation Function # ------------------------------------------------------------------- -def direct_differentiation( filename , - partitions = 0 , - quiet = False , - nzones = 1 ): + +def direct_differentiation(filename, partitions=0, quiet=False, nzones=1): # Config config = SU2.io.Config(filename) config.NUMBER_PART = partitions - config.NZONES = int(nzones) - config["DIRECT_DIFF"] = 'DESIGN_VARIABLES' + config.NZONES = int(nzones) + config["DIRECT_DIFF"] = "DESIGN_VARIABLES" if quiet: - config.CONSOLE = 'CONCISE' + config.CONSOLE = "CONCISE" # State state = SU2.io.State() @@ -82,44 +102,59 @@ def direct_differentiation( filename , foundDerivativeField = False for fields in SU2.io.historyOutFields: - group = SU2.io.historyOutFields[fields]['GROUP'] + group = SU2.io.historyOutFields[fields]["GROUP"] if group in config.HISTORY_OUTPUT: - if SU2.io.historyOutFields[fields]['TYPE'] == 'D_COEFFICIENT': + if SU2.io.historyOutFields[fields]["TYPE"] == "D_COEFFICIENT": foundDerivativeField = True if not foundDerivativeField: - sys.exit('No derivative field found in HISTORY_OUTPUT') + sys.exit("No derivative field found in HISTORY_OUTPUT") # link restart files to subfolder DIRECTDIFF, if restart solution is selected - if config.get('TIME_DOMAIN', 'NO') == 'YES' and config.get('RESTART_SOL', 'NO') == 'YES': + if ( + config.get("TIME_DOMAIN", "NO") == "YES" + and config.get("RESTART_SOL", "NO") == "YES" + ): # check if directory DIRECTDIFF/DIRECT exists, if not, create - if not os.path.isdir('DIRECTDIFF/DIRECT'): - if not os.path.isdir('DIRECTDIFF'): - os.mkdir('DIRECTDIFF') - os.mkdir('DIRECTDIFF/DIRECT') - - restart_name = config['RESTART_FILENAME'].split('.')[0] - restart_filename = restart_name + '_' + str(int(config['RESTART_ITER']) - 1).zfill(5) + '.dat' - if not os.path.isfile('DIRECTDIFF/DIRECT/' + restart_filename): - #throw, if restart file does not exist + if not os.path.isdir("DIRECTDIFF/DIRECT"): + if not os.path.isdir("DIRECTDIFF"): + os.mkdir("DIRECTDIFF") + os.mkdir("DIRECTDIFF/DIRECT") + + restart_name = config["RESTART_FILENAME"].split(".")[0] + restart_filename = ( + restart_name + "_" + str(int(config["RESTART_ITER"]) - 1).zfill(5) + ".dat" + ) + if not os.path.isfile("DIRECTDIFF/DIRECT/" + restart_filename): + # throw, if restart file does not exist if not os.path.isfile(restart_filename): - sys.exit("Error: Restart file <" + restart_filename + "> not found." ) - shutil.copyfile(restart_filename, 'DIRECTDIFF/DIRECT/' + restart_filename) + sys.exit("Error: Restart file <" + restart_filename + "> not found.") + shutil.copyfile(restart_filename, "DIRECTDIFF/DIRECT/" + restart_filename) # use only, if time integration is second order - if config.get('TIME_MARCHING', 'NO') == 'DUAL_TIME_STEPPING-2ND_ORDER': - restart_filename = restart_name + '_' + str(int(config['RESTART_ITER']) - 2).zfill(5) + '.dat' - if not os.path.isfile('DIRECTDIFF/DIRECT/' + restart_filename): + if config.get("TIME_MARCHING", "NO") == "DUAL_TIME_STEPPING-2ND_ORDER": + restart_filename = ( + restart_name + + "_" + + str(int(config["RESTART_ITER"]) - 2).zfill(5) + + ".dat" + ) + if not os.path.isfile("DIRECTDIFF/DIRECT/" + restart_filename): # throw, if restart file does not exist if not os.path.isfile(restart_filename): - sys.exit("Error: Restart file <" + restart_filename + "> not found.") - shutil.copyfile(restart_filename, 'DIRECTDIFF/DIRECT/' + restart_filename) + sys.exit( + "Error: Restart file <" + restart_filename + "> not found." + ) + shutil.copyfile( + restart_filename, "DIRECTDIFF/DIRECT/" + restart_filename + ) # Direct Differentiation Gradients - SU2.eval.gradients.directdiff(config,state) + SU2.eval.gradients.directdiff(config, state) return state + #: finite_differences() @@ -128,5 +163,5 @@ def direct_differentiation( filename , # ------------------------------------------------------------------- # this is only accessed if running from command prompt -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/SU2_PY/discrete_adjoint.py b/SU2_PY/discrete_adjoint.py index 816e3a1d68c..30f07747df4 100755 --- a/SU2_PY/discrete_adjoint.py +++ b/SU2_PY/discrete_adjoint.py @@ -3,7 +3,7 @@ ## \file discrete_adjoint.py # \brief Python script for doing the discrete adjoint computation using the SU2 suite. # \author F. Palacios, T. Economon, T. Lukaczyk -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -27,44 +27,76 @@ import os, sys, copy from optparse import OptionParser -sys.path.append(os.environ['SU2_RUN']) + +sys.path.append(os.environ["SU2_RUN"]) import SU2 # ------------------------------------------------------------------- # Main # ------------------------------------------------------------------- + def main(): # Command Line Options - parser=OptionParser() - parser.add_option("-f", "--file", dest="filename", - help="read config from FILE", metavar="FILE") - parser.add_option("-n", "--partitions", dest="partitions", default=1, - help="number of PARTITIONS", metavar="PARTITIONS") - parser.add_option("-s", "--step", dest="step", default=1E-4, - help="DOT finite difference STEP", metavar="STEP") - parser.add_option("-v", "--validate", dest="validate", default="False", - help="Validate the gradient using direct diff. mode", metavar="VALIDATION") - parser.add_option("-z", "--zones", dest="nzones", default="1", - help="Number of Zones", metavar="ZONES") - parser.add_option("-m", "--mode", dest="mode", default="all", - help="Determine the calculation mode \n : compute primal & adjoint problem & gradient (DEFAULT) \n : compute adjoint (with primal restart) & gradient \n : compute gradient (with primal and adjoint restarts)", metavar="MODE") - - (options, args)=parser.parse_args() - options.partitions = int( options.partitions ) - options.step = float( options.step ) - options.validate = options.validate.upper() == 'TRUE' - options.nzones = int( options.nzones ) + parser = OptionParser() + parser.add_option( + "-f", "--file", dest="filename", help="read config from FILE", metavar="FILE" + ) + parser.add_option( + "-n", + "--partitions", + dest="partitions", + default=1, + help="number of PARTITIONS", + metavar="PARTITIONS", + ) + parser.add_option( + "-s", + "--step", + dest="step", + default=1e-4, + help="DOT finite difference STEP", + metavar="STEP", + ) + parser.add_option( + "-v", + "--validate", + dest="validate", + default="False", + help="Validate the gradient using direct diff. mode", + metavar="VALIDATION", + ) + parser.add_option( + "-z", + "--zones", + dest="nzones", + default="1", + help="Number of Zones", + metavar="ZONES", + ) + parser.add_option( + "-m", + "--mode", + dest="mode", + default="all", + help="Determine the calculation mode \n : compute primal & adjoint problem & gradient (DEFAULT) \n : compute adjoint (with primal restart) & gradient \n : compute gradient (with primal and adjoint restarts)", + metavar="MODE", + ) + + (options, args) = parser.parse_args() + options.partitions = int(options.partitions) + options.step = float(options.step) + options.validate = options.validate.upper() == "TRUE" + options.nzones = int(options.nzones) if options.mode != "all" and options.mode != "adj" and options.mode != "grad": - sys.exit('Infeasible input for --mode. Use --help for more information') + sys.exit("Infeasible input for --mode. Use --help for more information") + + discrete_adjoint( + options.filename, options.partitions, options.step, options.nzones, options.mode + ) - discrete_adjoint( options.filename , - options.partitions , - options.step , - options.nzones , - options.mode) #: def main() @@ -73,24 +105,21 @@ def main(): # Discrete Adjoint # ------------------------------------------------------------------- -def discrete_adjoint( filename , - partitions = 0 , - step = 1e-4 , - nzones = 1, - mode = "all"): + +def discrete_adjoint(filename, partitions=0, step=1e-4, nzones=1, mode="all"): # Config config = SU2.io.Config(filename) config.NUMBER_PART = partitions - config.NZONES = int( nzones ) + config.NZONES = int(nzones) # State state = SU2.io.State() - config['GRADIENT_METHOD'] = 'DISCRETE_ADJOINT' + config["GRADIENT_METHOD"] = "DISCRETE_ADJOINT" # check for existing files if mode == "grad": - config.RESTART_SOL = 'YES' + config.RESTART_SOL = "YES" state.find_files(config) else: state.FILES.MESH = config.MESH_FILENAME @@ -105,48 +134,54 @@ def discrete_adjoint( filename , # Update konfig konfig = copy.deepcopy(config) - if konfig.get('WINDOW_CAUCHY_CRIT', 'NO') == 'YES' and konfig.TIME_MARCHING != 'NO': - konfig['TIME_ITER'] = info.WND_CAUCHY_DATA['TIME_ITER'] - konfig['ITER_AVERAGE_OBJ'] = info.WND_CAUCHY_DATA['ITER_AVERAGE_OBJ'] - konfig['UNST_ADJOINT_ITER'] = info.WND_CAUCHY_DATA['UNST_ADJOINT_ITER'] + if ( + konfig.get("WINDOW_CAUCHY_CRIT", "NO") == "YES" + and konfig.TIME_MARCHING != "NO" + ): + konfig["TIME_ITER"] = info.WND_CAUCHY_DATA["TIME_ITER"] + konfig["ITER_AVERAGE_OBJ"] = info.WND_CAUCHY_DATA["ITER_AVERAGE_OBJ"] + konfig["UNST_ADJOINT_ITER"] = info.WND_CAUCHY_DATA["UNST_ADJOINT_ITER"] - SU2.io.restart2solution(konfig,state) + SU2.io.restart2solution(konfig, state) # Adjoint Solution # Run all-at-once if mode == "all" or mode == "adj": restart_sol_activated = False - if konfig.get('TIME_DOMAIN','NO') == 'YES' and konfig.get('RESTART_SOL','NO') == 'YES': + if ( + konfig.get("TIME_DOMAIN", "NO") == "YES" + and konfig.get("RESTART_SOL", "NO") == "YES" + ): restart_sol_activated = True - original_time_iter = konfig['TIME_ITER'] - konfig['TIME_ITER'] = konfig['TIME_ITER'] - int(konfig['RESTART_ITER']) - konfig.RESTART_SOL = 'NO' + original_time_iter = konfig["TIME_ITER"] + konfig["TIME_ITER"] = konfig["TIME_ITER"] - int(konfig["RESTART_ITER"]) + konfig.RESTART_SOL = "NO" info = SU2.run.adjoint(konfig) state.update(info) # Workaround, since expandTime relies on UNST_ADJOINT_ITER to determine number of solution files. if restart_sol_activated: - konfig['UNST_ADJOINT_ITER'] = original_time_iter - int(konfig['RESTART_ITER']) - SU2.io.restart2solution(konfig,state) + konfig["UNST_ADJOINT_ITER"] = original_time_iter - int( + konfig["RESTART_ITER"] + ) + SU2.io.restart2solution(konfig, state) # reset changed time-iter values for the remaining program to original values # Gradient Projection - info = SU2.run.projection(konfig,step) + info = SU2.run.projection(konfig, step) state.update(info) return state + #: continuous_adjoint() # ------------------------------------------------------------------- # Alternate Formulation # ------------------------------------------------------------------- -def discrete_design( filename , - partitions = 0 , - compute = True , - step = 1e-4 , - validation = False): + +def discrete_design(filename, partitions=0, compute=True, step=1e-4, validation=False): # TODO: # step @@ -155,7 +190,7 @@ def discrete_design( filename , config = SU2.io.Config(filename) config.NUMBER_PART = partitions - config['GRADIENT_METHOD'] = 'DISCRETE_ADJOINT' + config["GRADIENT_METHOD"] = "DISCRETE_ADJOINT" ADJ_NAME = config.OBJECTIVE_FUNCTION @@ -166,49 +201,45 @@ def discrete_design( filename , grads_directdiff = [] -# if validation: -# state_directdiff.find_files(config) -# konfig = copy.deepcopy(config) -# konfig['DIRECT_DIFF'] = "DESIGN_VARIABLES" -# grad_directdiff = SU2.eval.gradients.directdiff(konfig,state_directdiff) -# state['FILES']['DIRECT'] = 'DIRECTDIFF/' + state_directdiff['FILES']['DIRECT'] -# state['FUNCTIONS'] = state_directdiff['FUNCTIONS'] + # if validation: + # state_directdiff.find_files(config) + # konfig = copy.deepcopy(config) + # konfig['DIRECT_DIFF'] = "DESIGN_VARIABLES" + # grad_directdiff = SU2.eval.gradients.directdiff(konfig,state_directdiff) + # state['FILES']['DIRECT'] = 'DIRECTDIFF/' + state_directdiff['FILES']['DIRECT'] + # state['FUNCTIONS'] = state_directdiff['FUNCTIONS'] # check for existing files - if any([not compute, validation]) : + if any([not compute, validation]): state.find_files(config) else: state.FILES.MESH = config.MESH_FILENAME # Adjoint Gradient - grads = SU2.eval.grad( ADJ_NAME, config['GRADIENT_METHOD'], config, state ) - -# if validation: -# Definition_DV = config['DEFINITION_DV'] -# n_dv = len(Definition_DV['KIND']) -# grads_dd = grad_directdiff[ADJ_NAME] -# print("Validation Summary") -# print("--------------------------") -# print("VARIABLE " + "DISCRETE ADJOINT" + " DIRECT DIFFERENTIATION" + " ERROR (%)") -# for idv in range(n_dv): -# if abs(grads[idv]) > abs(grads_dd[idv]): -# this_err = abs(grads[idv]/grads_dd[idv]) -# else: -# this_err = abs(grads_dd[idv]/grads[idv]) - -# print(str(idv) + " " + str(grads[idv]) + " " + str(grads_dd[idv]) + " " + str((this_err-1)*100) + ' %') - + grads = SU2.eval.grad(ADJ_NAME, config["GRADIENT_METHOD"], config, state) + + # if validation: + # Definition_DV = config['DEFINITION_DV'] + # n_dv = len(Definition_DV['KIND']) + # grads_dd = grad_directdiff[ADJ_NAME] + # print("Validation Summary") + # print("--------------------------") + # print("VARIABLE " + "DISCRETE ADJOINT" + " DIRECT DIFFERENTIATION" + " ERROR (%)") + # for idv in range(n_dv): + # if abs(grads[idv]) > abs(grads_dd[idv]): + # this_err = abs(grads[idv]/grads_dd[idv]) + # else: + # this_err = abs(grads_dd[idv]/grads[idv]) + + # print(str(idv) + " " + str(grads[idv]) + " " + str(grads_dd[idv]) + " " + str((this_err-1)*100) + ' %') return state - - # ------------------------------------------------------------------- # Run Main Program # ------------------------------------------------------------------- # this is only accessed if running from command prompt -if __name__ == '__main__': +if __name__ == "__main__": main() - diff --git a/SU2_PY/documentation.txt b/SU2_PY/documentation.txt index 70cb6ba69e5..d4ef8e157fb 100644 --- a/SU2_PY/documentation.txt +++ b/SU2_PY/documentation.txt @@ -1,4 +1,4 @@ -goals - +goals - cascading levels of functionality lower levels stand on their own, and provide usefulness to higher levels when asked @@ -43,7 +43,7 @@ SU2.run.deform(config,dv_new=[]) pointer updated config 'MESH_FILENAME' = 'MESH_FILENAME'+'_deform' 'DV_VALUE_OLD' = 'DV_VALUE_NEW' - + SU2.run.direct(config) checks decomp ensures config: @@ -56,12 +56,12 @@ SU2.run.direct(config) 'FUNCTIONS' - dict of function:value 'HISTORY' - dict of col_header:iteration history 'FILES' - dict of useful file names - + SU2.run.adjoint(config) checks decomp ensures config: 'MATH_PROBLEM' = 'CONTINUOUS_ADJOINT' - 'CONV_FILENAME' = 'CONFIG_FILENAME' + '_adjoint' + 'CONV_FILENAME' = 'CONFIG_FILENAME' + '_adjoint' run CFD read history does not move restart to solution @@ -69,7 +69,7 @@ SU2.run.adjoint(config) returns dictionary 'info' with keys: 'HISTORY' - dict of col_header:iteration history 'FILES' - dict of useful file names - + SU2.run.projection(config,step=1e-4) assumes linear superposition of design variables checks decomp @@ -85,7 +85,7 @@ SU2.run.projection(config,step=1e-4) level2 - objective and gradient analysis, redundancy protection upstream pointer update of config and state config - controls SU2 -state - stores design information +state - stores design information STATE FILES @@ -107,7 +107,7 @@ STATE LIFT DRAG MOMENT_Z - + SU2.eval.functions.function() aliased to SU2.eval.func() runs the aerodynamics and geometry control functions @@ -121,11 +121,11 @@ SU2.eval.functions.aerodynamics() direct solution evaluates each step in its own folder, returning state.FILES to the super folder updates config and state by pointer - + SU2.eval.functions.geometry() todo ... - + SU2.eval.gradients.gradient() aliased to SU2.eval.grad() @@ -136,17 +136,17 @@ SU2.eval.gradients.adjoint() adjoint solution evaluates each step in its own folder, returning state.FILES to the super folder updates config and state by pointer - - + + SU2.eval.gradients.findiff() runs with redundancy protection (using state): functions() decom, deform, direct finite difference evaluation of functions() - finite difference steps performed in the FINDIFF folder, removed when completed + finite difference steps performed in the FINDIFF folder, removed when completed updates config and state by pointer - + level3 - design management major assumption - one design, one config, one state start a new design if a new config is needed @@ -167,8 +167,8 @@ SU2.eval.design(config,state,folder) con_dceq() equality constraint derivatives con_cieq() inequality constraints con_dcieq() inequality constraint gradients - - + + level4 - project managent SU2.opt.project(config,state,folder) runs multiple design classes, again avoiding redundancy @@ -179,7 +179,7 @@ SU2.opt.project(config,state,folder) level5 - optimization SU2.opt.scipy_slsqp(project) sets up and runs a scipy slsqp optimization - + FILE IO level0 - in/out/mod @@ -192,14 +192,14 @@ class SU2.io.config(dict) config.unpack_dvs(dv_new.dv_old) config.__diff__(konfig) config.__eq__(konfig) - + config.read_history() config.read_aerodynamics() config.rename_restart() - + SU2.io.read_history( name ) SU2.io.read_aerodynamics( hist_name, special_cases ) - + level1 - files translate,modify,plotting SU2.io.add_suffix(name,suffix) @@ -207,15 +207,3 @@ SU2.io.resurrect_restart(config,state) SU2.io.plot.adjoint_gradient(config,grad_dict) SU2.io.plot.findiff_gradient(config,grad_dict) - - - - - - - - - - - - diff --git a/SU2_PY/finite_differences.py b/SU2_PY/finite_differences.py index 6777d50e068..589905f7ccc 100755 --- a/SU2_PY/finite_differences.py +++ b/SU2_PY/finite_differences.py @@ -3,7 +3,7 @@ ## \file finite_differences.py # \brief Python script for doing the finite differences computation using the SU2 suite. # \author F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -27,34 +27,56 @@ import os, sys from optparse import OptionParser -sys.path.append(os.environ['SU2_RUN']) + +sys.path.append(os.environ["SU2_RUN"]) import SU2 # ------------------------------------------------------------------- # Main # ------------------------------------------------------------------- + def main(): parser = OptionParser() - parser.add_option("-f", "--file", dest="filename", - help="read config from FILE", metavar="FILE") - parser.add_option("-n", "--partitions", dest="partitions", default=1, - help="number of PARTITIONS", metavar="PARTITIONS") - parser.add_option("-q", "--quiet", dest="quiet", default='False', - help="output QUIET to log files", metavar="QUIET") - parser.add_option("-z", "--zones", dest="nzones", default="1", - help="Number of Zones", metavar="ZONES") - - (options, args)=parser.parse_args() - options.partitions = int( options.partitions ) - options.quiet = options.quiet.upper() == 'TRUE' - options.nzones = int( options.nzones ) - - finite_differences( options.filename , - options.partitions , - options.quiet , - options.nzones ) + parser.add_option( + "-f", "--file", dest="filename", help="read config from FILE", metavar="FILE" + ) + parser.add_option( + "-n", + "--partitions", + dest="partitions", + default=1, + help="number of PARTITIONS", + metavar="PARTITIONS", + ) + parser.add_option( + "-q", + "--quiet", + dest="quiet", + default="False", + help="output QUIET to log files", + metavar="QUIET", + ) + parser.add_option( + "-z", + "--zones", + dest="nzones", + default="1", + help="Number of Zones", + metavar="ZONES", + ) + + (options, args) = parser.parse_args() + options.partitions = int(options.partitions) + options.quiet = options.quiet.upper() == "TRUE" + options.nzones = int(options.nzones) + + finite_differences( + options.filename, options.partitions, options.quiet, options.nzones + ) + + #: def main() @@ -62,42 +84,55 @@ def main(): # Finite Differences Function # ------------------------------------------------------------------- -def finite_differences( filename , - partitions = 0 , - quiet = False , - nzones = 1 ): + +def finite_differences(filename, partitions=0, quiet=False, nzones=1): # Config config = SU2.io.Config(filename) config.NUMBER_PART = partitions - config.NZONES = int( nzones ) + config.NZONES = int(nzones) if quiet: - config.CONSOLE = 'CONCISE' + config.CONSOLE = "CONCISE" # State state = SU2.io.State() state.find_files(config) # add restart files to state.FILES - if config.get('TIME_DOMAIN', 'NO') == 'YES' and config.get('RESTART_SOL', 'NO') == 'YES': - restart_name = config['RESTART_FILENAME'].split('.')[0] - restart_filename = restart_name + '_' + str(int(config['RESTART_ITER'])-1).zfill(5) + '.dat' - if not os.path.isfile(restart_filename): # throw, if restart files does not exist + if ( + config.get("TIME_DOMAIN", "NO") == "YES" + and config.get("RESTART_SOL", "NO") == "YES" + ): + restart_name = config["RESTART_FILENAME"].split(".")[0] + restart_filename = ( + restart_name + "_" + str(int(config["RESTART_ITER"]) - 1).zfill(5) + ".dat" + ) + if not os.path.isfile( + restart_filename + ): # throw, if restart files does not exist sys.exit("Error: Restart file <" + restart_filename + "> not found.") - state['FILES']['RESTART_FILE_1'] = restart_filename + state["FILES"]["RESTART_FILE_1"] = restart_filename # use only, if time integration is second order - if config.get('TIME_MARCHING', 'NO') == 'DUAL_TIME_STEPPING-2ND_ORDER': - restart_filename = restart_name + '_' + str(int(config['RESTART_ITER'])-2).zfill(5) + '.dat' - if not os.path.isfile(restart_filename): # throw, if restart files does not exist + if config.get("TIME_MARCHING", "NO") == "DUAL_TIME_STEPPING-2ND_ORDER": + restart_filename = ( + restart_name + + "_" + + str(int(config["RESTART_ITER"]) - 2).zfill(5) + + ".dat" + ) + if not os.path.isfile( + restart_filename + ): # throw, if restart files does not exist sys.exit("Error: Restart file <" + restart_filename + "> not found.") - state['FILES']['RESTART_FILE_2'] =restart_filename + state["FILES"]["RESTART_FILE_2"] = restart_filename # Finite Difference Gradients - SU2.eval.gradients.findiff(config,state) + SU2.eval.gradients.findiff(config, state) return state + #: finite_differences() @@ -106,5 +141,5 @@ def finite_differences( filename , # ------------------------------------------------------------------- # this is only accessed if running from command prompt -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/SU2_PY/fsi_computation.py b/SU2_PY/fsi_computation.py old mode 100644 new mode 100755 index 0735485a18f..4f497290332 --- a/SU2_PY/fsi_computation.py +++ b/SU2_PY/fsi_computation.py @@ -3,7 +3,7 @@ ## \file fsi_computation.py # \brief Python wrapper code for FSI computation by coupling a third-party structural solver to SU2. # \authors Nicola Fonzi, Vittorio Cavalieri based on the work of David Thomas -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -34,194 +34,226 @@ import shutil import copy import time as timer -from math import * # use mathematical expressions -from optparse import OptionParser # use a parser for configuration +from math import * # use mathematical expressions +from optparse import OptionParser # use a parser for configuration # imports the CFD (SU2) module for FSI computation import pysu2 -import FSI_tools as FSI # imports FSI python tools +import FSI_tools as FSI # imports FSI python tools # ------------------------------------------------------------------- # Main # ------------------------------------------------------------------- + def main(): - # --- Get the FSI conig file name form the command line options --- # - parser=OptionParser() - parser.add_option("-f", "--file", dest="filename", - help="read config from FILE", metavar="FILE") - parser.add_option("--parallel", action="store_true", - help="Specify if we need to initialize MPI", dest="with_MPI", default=False) - - (options, args)=parser.parse_args() - - if options.with_MPI: - from mpi4py import MPI # MPI is initialized from now by python and can be continued in C++ - comm = MPI.COMM_WORLD - myid = comm.Get_rank() - numberPart = comm.Get_size() - have_MPI = True - else: - comm = 0 - myid = 0 - numberPart = 1 - have_MPI = False - - rootProcess = 0 - - # --- Set the working directory --- # - if myid == rootProcess: - if os.getcwd() not in sys.path: - sys.path.append(os.getcwd()) - print("Setting working directory : {}".format(os.getcwd())) - else: - print("Working directory is set to {}".format(os.getcwd())) - - if have_MPI: - comm.barrier() - - # starts timer - start = timer.time() - - confFile = str(options.filename) - - FSI_config = FSI.FSIConfig(confFile, comm) # FSI configuration file - CFD_ConFile = FSI_config['CFD_CONFIG_FILE_NAME'] # CFD configuration file - CSD_ConFile = FSI_config['CSD_CONFIG_FILE_NAME'] # CSD configuration file - - CSD_Solver = FSI_config['CSD_SOLVER'] # CSD solver - - if have_MPI: - comm.barrier() - - # --- Initialize the fluid solver --- # - if myid == rootProcess: - print("\n") - print(" Initializing fluid solver ".center(80,"*")) - try: - FluidSolver = pysu2.CSinglezoneDriver(CFD_ConFile, 1, comm) - except TypeError as exception: - print('A TypeError occured in pysu2.CSinglezoneDriver : ',exception) - if have_MPI: - print('ERROR : You are trying to initialize MPI with a serial build of the wrapper. Please, remove the --parallel option that is incompatible with a serial build.') + # --- Get the FSI conig file name form the command line options --- # + parser = OptionParser() + parser.add_option( + "-f", "--file", dest="filename", help="read config from FILE", metavar="FILE" + ) + parser.add_option( + "--parallel", + action="store_true", + help="Specify if we need to initialize MPI", + dest="with_MPI", + default=False, + ) + + (options, args) = parser.parse_args() + + if options.with_MPI: + from mpi4py import ( + MPI, + ) # MPI is initialized from now by python and can be continued in C++ + + comm = MPI.COMM_WORLD + myid = comm.Get_rank() + numberPart = comm.Get_size() + have_MPI = True else: - print('ERROR : You are trying to launch a computation without initializing MPI but the wrapper has been built in parallel. Please add the --parallel option in order to initialize MPI for the wrapper.') - return + comm = 0 + myid = 0 + numberPart = 1 + have_MPI = False - if have_MPI: - comm.barrier() + rootProcess = 0 - # --- Initialize the solid solver --- # - # Serial solvers - if CSD_Solver in ["NATIVE"]: + # --- Set the working directory --- # if myid == rootProcess: - print("\n") - print(" Initializing solid solver ".center(80,"*")) - if CSD_Solver == 'NATIVE': - from SU2_Nastran import pysu2_nastran - if FSI_config["IMPOSED_MOTION"] == "NO": - SolidSolver = pysu2_nastran.Solver(CSD_ConFile,False) + if os.getcwd() not in sys.path: + sys.path.append(os.getcwd()) + print("Setting working directory : {}".format(os.getcwd())) else: - SolidSolver = pysu2_nastran.Solver(CSD_ConFile,True) - else: - SolidSolver = None - # Parallel solvers - # For now we are only using serial solvers - else: - raise Exception('\n Invalid solid solver option') - - if have_MPI: - comm.barrier() - - # --- Initialize and set the FSI interface (coupling environement) --- # - if myid == rootProcess: - print("\n") - print(" Initializing FSI interface ".center(80,"*")) - if have_MPI: - comm.barrier() - FSIInterface = FSI.Interface(FSI_config, FluidSolver, SolidSolver, have_MPI) - - if myid == rootProcess: - print("\n") - print(" Connect fluid and solid solvers ".center(80,"*")) - if have_MPI: - comm.barrier() - FSIInterface.connect(FSI_config, FluidSolver, SolidSolver) - - if myid == rootProcess: - print("\n") - print(" Mapping fluid-solid interfaces ".center(80,"*")) - if have_MPI: - comm.barrier() - FSIInterface.interfaceMapping(FluidSolver, SolidSolver, FSI_config) - - if have_MPI: - comm.barrier() - - if FSI_config["MAPPING_MODES"] == "NO": - # --- Launch a steady or unsteady FSI computation --- # - if FSI_config['TIME_MARCHING'] == "YES": - try: - FSIInterface.UnsteadyFSI(FSI_config, FluidSolver, SolidSolver) - except NameError as exception: - if myid == rootProcess: - print('An NameError occured in FSIInterface.UnsteadyFSI : ',exception) - except TypeError as exception: - if myid == rootProcess: - print('A TypeError occured in FSIInterface.UnsteadyFSI : ',exception) - except KeyboardInterrupt as exception : - if myid == rootProcess: - print('A KeyboardInterrupt occured in FSIInterface.UnsteadyFSI : ',exception) - else: - try: - FSIInterface.SteadyFSI(FSI_config, FluidSolver, SolidSolver) - except NameError as exception: - if myid == rootProcess: - print('An NameError occured in FSIInterface.SteadyFSI : ',exception) - except TypeError as exception: - if myid == rootProcess: - print('A TypeError occured in FSIInterface.SteadyFSI : ',exception) - except KeyboardInterrupt as exception : - if myid == rootProcess: - print('A KeyboardInterrupt occured in FSIInterface.SteadyFSI : ',exception) - else: + print("Working directory is set to {}".format(os.getcwd())) + + if have_MPI: + comm.barrier() + + # starts timer + start = timer.time() + + confFile = str(options.filename) + + FSI_config = FSI.FSIConfig(confFile, comm) # FSI configuration file + CFD_ConFile = FSI_config["CFD_CONFIG_FILE_NAME"] # CFD configuration file + CSD_ConFile = FSI_config["CSD_CONFIG_FILE_NAME"] # CSD configuration file + + CSD_Solver = FSI_config["CSD_SOLVER"] # CSD solver + + if have_MPI: + comm.barrier() + + # --- Initialize the fluid solver --- # + if myid == rootProcess: + print("\n") + print(" Initializing fluid solver ".center(80, "*")) try: - FSIInterface.MapModes(FSI_config, FluidSolver, SolidSolver) - except NameError as exception: - if myid == rootProcess: - print('An NameError occured in FSIInterface.MapModes : ',exception) + FluidSolver = pysu2.CSinglezoneDriver(CFD_ConFile, 1, comm) except TypeError as exception: - if myid == rootProcess: - print('A TypeError occured in FSIInterface.MapModes : ',exception) - except KeyboardInterrupt as exception : - if myid == rootProcess: - print('A KeyboardInterrupt occured in FSIInterface.MapModes : ',exception) + print("A TypeError occured in pysu2.CSinglezoneDriver : ", exception) + if have_MPI: + print( + "ERROR : You are trying to initialize MPI with a serial build of the wrapper. Please, remove the --parallel option that is incompatible with a serial build." + ) + else: + print( + "ERROR : You are trying to launch a computation without initializing MPI but the wrapper has been built in parallel. Please add the --parallel option in order to initialize MPI for the wrapper." + ) + return - if have_MPI: - comm.barrier() + if have_MPI: + comm.barrier() - # --- Exit cleanly the fluid and solid solvers --- # - FluidSolver.Postprocessing() - if myid == rootProcess: - SolidSolver.exit() + # --- Initialize the solid solver --- # + # Serial solvers + if CSD_Solver in ["NATIVE"]: + if myid == rootProcess: + print("\n") + print(" Initializing solid solver ".center(80, "*")) + if CSD_Solver == "NATIVE": + from SU2_Nastran import pysu2_nastran + + if FSI_config["IMPOSED_MOTION"] == "NO": + SolidSolver = pysu2_nastran.Solver(CSD_ConFile, False) + else: + SolidSolver = pysu2_nastran.Solver(CSD_ConFile, True) + else: + SolidSolver = None + # Parallel solvers + # For now we are only using serial solvers + else: + raise Exception("\n Invalid solid solver option") + + if have_MPI: + comm.barrier() + + # --- Initialize and set the FSI interface (coupling environement) --- # + if myid == rootProcess: + print("\n") + print(" Initializing FSI interface ".center(80, "*")) + if have_MPI: + comm.barrier() + FSIInterface = FSI.Interface(FSI_config, FluidSolver, SolidSolver, have_MPI) + + if myid == rootProcess: + print("\n") + print(" Connect fluid and solid solvers ".center(80, "*")) + if have_MPI: + comm.barrier() + FSIInterface.connect(FSI_config, FluidSolver, SolidSolver) + + if myid == rootProcess: + print("\n") + print(" Mapping fluid-solid interfaces ".center(80, "*")) + if have_MPI: + comm.barrier() + FSIInterface.interfaceMapping(FluidSolver, SolidSolver, FSI_config) - if have_MPI: - comm.barrier() + if have_MPI: + comm.barrier() + + if FSI_config["MAPPING_MODES"] == "NO": + # --- Launch a steady or unsteady FSI computation --- # + if FSI_config["TIME_MARCHING"] == "YES": + try: + FSIInterface.UnsteadyFSI(FSI_config, FluidSolver, SolidSolver) + except NameError as exception: + if myid == rootProcess: + print( + "An NameError occured in FSIInterface.UnsteadyFSI : ", exception + ) + except TypeError as exception: + if myid == rootProcess: + print( + "A TypeError occured in FSIInterface.UnsteadyFSI : ", exception + ) + except KeyboardInterrupt as exception: + if myid == rootProcess: + print( + "A KeyboardInterrupt occured in FSIInterface.UnsteadyFSI : ", + exception, + ) + else: + try: + FSIInterface.SteadyFSI(FSI_config, FluidSolver, SolidSolver) + except NameError as exception: + if myid == rootProcess: + print( + "An NameError occured in FSIInterface.SteadyFSI : ", exception + ) + except TypeError as exception: + if myid == rootProcess: + print("A TypeError occured in FSIInterface.SteadyFSI : ", exception) + except KeyboardInterrupt as exception: + if myid == rootProcess: + print( + "A KeyboardInterrupt occured in FSIInterface.SteadyFSI : ", + exception, + ) + else: + try: + FSIInterface.MapModes(FSI_config, FluidSolver, SolidSolver) + except NameError as exception: + if myid == rootProcess: + print("An NameError occured in FSIInterface.MapModes : ", exception) + except TypeError as exception: + if myid == rootProcess: + print("A TypeError occured in FSIInterface.MapModes : ", exception) + except KeyboardInterrupt as exception: + if myid == rootProcess: + print( + "A KeyboardInterrupt occured in FSIInterface.MapModes : ", exception + ) + + if have_MPI: + comm.barrier() + + # --- Exit cleanly the fluid and solid solvers --- # + FluidSolver.Finalize() + if myid == rootProcess: + SolidSolver.exit() + + if have_MPI: + comm.barrier() - # stops timer - stop = timer.time() - elapsedTime = stop-start + # stops timer + stop = timer.time() + elapsedTime = stop - start - if myid == rootProcess: - print("\n Computation successfully performed in {} seconds.".format(elapsedTime)) + if myid == rootProcess: + print( + "\n Computation successfully performed in {} seconds.".format(elapsedTime) + ) + + return - return # ------------------------------------------------------------------- # Run Main Program # ------------------------------------------------------------------- # --- This is only accessed if running from command prompt --- # -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/SU2_PY/merge_solution.py b/SU2_PY/merge_solution.py index e7a0c3954e5..94c4ec9ffbb 100755 --- a/SU2_PY/merge_solution.py +++ b/SU2_PY/merge_solution.py @@ -3,7 +3,7 @@ ## \file merge_solution.py # \brief Python script for merging of the solution files. # \author F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -32,36 +32,44 @@ # Main # ------------------------------------------------------------------- + def main(): parser = OptionParser() - parser.add_option("-f", "--file", dest="filename", - help="read config from FILE", metavar="FILE") - parser.add_option("-n", "--partitions", dest="partitions", default=-1, - help="number of PARTITIONS", metavar="PARTITIONS") + parser.add_option( + "-f", "--file", dest="filename", help="read config from FILE", metavar="FILE" + ) + parser.add_option( + "-n", + "--partitions", + dest="partitions", + default=-1, + help="number of PARTITIONS", + metavar="PARTITIONS", + ) - (options, args)=parser.parse_args() + (options, args) = parser.parse_args() options.partitions = int(options.partitions) - merge_solution( options.filename , - options.partitions ) + merge_solution(options.filename, options.partitions) # ------------------------------------------------------------------- # MERGE SOLUTION # ------------------------------------------------------------------- -def merge_solution( filename , - partitions = -1 ): + +def merge_solution(filename, partitions=-1): config = SU2.io.Config(filename) - if partitions > -1 : + if partitions > -1: config.NUMBER_PART = partitions SU2.run.merge(config) + #: def merge_solution() -if __name__ == '__main__': +if __name__ == "__main__": main() diff --git a/SU2_PY/mesh_deformation.py b/SU2_PY/mesh_deformation.py index 37eecb19544..5420a6b62c2 100755 --- a/SU2_PY/mesh_deformation.py +++ b/SU2_PY/mesh_deformation.py @@ -3,7 +3,7 @@ ## \file mesh_deformation.py # \brief Python script for doing the parallel deformation using SU2_DEF. # \author F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -27,28 +27,38 @@ import os, sys from optparse import OptionParser -sys.path.append(os.environ['SU2_RUN']) + +sys.path.append(os.environ["SU2_RUN"]) import SU2 # ------------------------------------------------------------------- # Main # ------------------------------------------------------------------- + def main(): # Command Line Options parser = OptionParser() - parser.add_option("-f", "--file", dest="filename", - help="read config from FILE", metavar="FILE") - parser.add_option("-n", "--partitions", dest="partitions", default=2, - help="number of PARTITIONS", metavar="PARTITIONS") - - (options, args)=parser.parse_args() - options.partitions = int( options.partitions ) + parser.add_option( + "-f", "--file", dest="filename", help="read config from FILE", metavar="FILE" + ) + parser.add_option( + "-n", + "--partitions", + dest="partitions", + default=2, + help="number of PARTITIONS", + metavar="PARTITIONS", + ) + + (options, args) = parser.parse_args() + options.partitions = int(options.partitions) # Run Parallel Comutation - mesh_deformation ( options.filename , - options.partitions ) + mesh_deformation(options.filename, options.partitions) + + #: def main() @@ -56,8 +66,8 @@ def main(): # Parallel Computation Function # ------------------------------------------------------------------- -def mesh_deformation( filename , - partitions = 2 ): + +def mesh_deformation(filename, partitions=2): # Config config = SU2.io.Config(filename) @@ -75,6 +85,7 @@ def mesh_deformation( filename , return state + #: mesh_deformation() @@ -83,7 +94,5 @@ def mesh_deformation( filename , # ------------------------------------------------------------------- # this is only accessed if running from command prompt -if __name__ == '__main__': +if __name__ == "__main__": main() - - diff --git a/SU2_PY/meson.build b/SU2_PY/meson.build index 38136b25db9..85ae325f3f0 100644 --- a/SU2_PY/meson.build +++ b/SU2_PY/meson.build @@ -4,12 +4,10 @@ install_data(['continuous_adjoint.py', 'mesh_deformation.py', 'parallel_computation.py', 'parallel_computation_fsi.py', - 'package_tests.py', 'shape_optimization.py', 'merge_solution.py', 'set_ffd_design_var.py', 'compute_polar.py', - 'compute_multipoint.py', 'discrete_adjoint.py', 'direct_differentiation.py', 'fsi_computation.py', diff --git a/SU2_PY/package_tests.py b/SU2_PY/package_tests.py deleted file mode 100755 index b15f475b408..00000000000 --- a/SU2_PY/package_tests.py +++ /dev/null @@ -1,308 +0,0 @@ -#!/usr/bin/env python - -## \file package_tests.py -# \brief _____________. -# \author T. Lukaczyk -# \version 7.5.1 "Blackbird" -# -# SU2 Project Website: https://su2code.github.io -# -# The SU2 Project is maintained by the SU2 Foundation -# (http://su2foundation.org) -# -# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) -# -# SU2 is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# SU2 is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with SU2. If not, see . - -# make print(*args) function available in PY2.6+, does'nt work on PY < 2.6 -from __future__ import print_function - -import os, sys, copy -sys.path.append(os.environ['SU2_RUN']) -import SU2 - -from collections import OrderedDict - -# todo: -# verify command line interface -# commenting -# verify optimization, gradients, flow solutions -# verbosity -# plotting -# verbose redirection -# pyopt optimizers - - -# needed config options -# OPT_CONSTRAINT -# OPT_OBJECTIVE -# CONSOLE - -# OUTPUT_WEIGHT -# FINDIFF_STEP -# DOT_FINDIFF_STEP -# GRADIENT_METHOD= FINITE_DIFFERENCING, CONTINUOUS_ADJOINT, DISCRETE_ADJOINT -# ADAPTATION= DIRECT, ADJOINT - - -def main(): - - #io0() # working - #io1() - #level0() # working - #level1() # working - #level2() # working - #level3() # working - #level4() # working - #level5() # working - - print('DONE!') - -def io0(): - folder='test_io0'; pull='config_NACA0012.cfg'; link='mesh_NACA0012.su2' - with SU2.io.redirect_folder(folder,pull,link): - - config_name = 'config_NACA0012.cfg' - config = SU2.io.Config(filename=config_name) - - print(config) - - - config.ADAPT_CYCLES - config['ADAPT_CYCLES'] - - config.dump('out.cfg') - - konfig = copy.deepcopy(config) - konfig['TASKS'] = ['TEST'] - konfig['NUMBER_PART'] = 0 - - config_diff = config.diff(konfig) - - print(config_diff) - - - wait = 0 - -def io1(): - - option = SU2.io.config.MathProblem() - - option = 'DIRECT' - - wait = 0 - -def level0(): - folder='test_level0'; pull='config_NACA0012.cfg'; link='mesh_NACA0012.su2' - with SU2.io.redirect_folder(folder,pull,link): - - # Setup - config_name = 'config_NACA0012.cfg' - config = SU2.io.Config(config_name) - config.EXT_ITER = 9 - config.NUMBER_PART = 2 - - SU2.run.CFD(config) - -def level1(): - folder='test_level1'; pull='config_NACA0012.cfg'; link='mesh_NACA0012.su2' - with SU2.io.redirect_folder(folder,pull,link): - - # Setup - config_name = 'config_NACA0012.cfg' - config = SU2.io.Config(config_name) - config['NUMBER_PART'] = 2 - config['EXT_ITER'] = 9 - - state = SU2.io.State() - - # Deformation - dv_new = [0.002]*38 - info = SU2.run.deform(config,dv_new) - state.update(info) - - # Direct Solution - info = SU2.run.direct(config) - state.update(info) - SU2.io.restart2solution(config,state) - - # Adjoint Solution - info = SU2.run.adjoint(config) - state.update(info) - SU2.io.restart2solution(config,state) - - # Gradient Projection - info = SU2.run.projection(config) - state.update(info) - - print(state) - - SU2.io.save_data('state.pkl',state) - data = SU2.io.load_data('state.pkl') - - SU2.io.save_data('config.pkl',config) - data = SU2.io.load_data('config.pkl') - - wait = 0 - -def level2(): - folder='test_level2'; pull='config_NACA0012.cfg'; link='mesh_NACA0012.su2' - with SU2.io.redirect_folder(folder,pull,link): - - # Setup - config_name = 'config_NACA0012.cfg' - config = SU2.io.Config(config_name) - config['NUMBER_PART'] = 2 - config['EXT_ITER'] = 9 - dv_new = [0.0]*38 - #dv_new[10] = 0.05 - config.unpack_dvs(dv_new) - - state = SU2.io.State() - - #with SU2.io.redirect.folder(folder='JOB_001',link='mesh_NACA0012.su2'): - # grad = SU2.eval.grad( 'DRAG', 'FINDIFF', config, state ) - - with SU2.io.redirect_folder(folder='JOB_001',link='mesh_NACA0012.su2'): - func = SU2.eval.func( 'LIFT', config, state ) - grads = SU2.eval.grad( 'LIFT', 'CONTINUOUS_ADJOINT', config, state ) - - with SU2.io.redirect_folder(folder='JOB_001',link='mesh_NACA0012.su2'): - func = SU2.eval.func( 'DRAG', config, state ) # will not run direct - grads = SU2.eval.grad( 'LIFT', 'CONTINUOUS_ADJOINT', config, state ) # will not run adjoint - grads = SU2.eval.grad( 'DRAG', 'CONTINUOUS_ADJOINT', config, state ) # will run adjoint - - wait = 0 - -def level3(): - folder='test_level3'; pull='config_NACA0012.cfg'; link='mesh_NACA0012.su2' - with SU2.io.redirect_folder(folder,pull,link): - - # Setup - config_name = 'config_NACA0012.cfg' - config = SU2.io.Config(config_name) - config['NUMBER_PART'] = 2 - config['EXT_ITER'] = 9 - - # initialize design state - state = SU2.io.State() - state.find_files(config) - - # start design - design = SU2.eval.Design(config,state) - - # run design with dv change - dv_new = [0.0]*38 - vals = design.obj_f(dv_new) - vals = design.obj_df(dv_new) - vals = design.con_ceq(dv_new) - vals = design.con_dceq(dv_new) - vals = design.con_cieq(dv_new) - vals = design.con_dcieq(dv_new) - vals = design.func('LIFT') - vals = design.grad('LIFT','CONTINUOUS_ADJOINT') - - SU2.io.save_data('design.pkl',design) - data = SU2.io.load_data('design.pkl') - - wait = 0 - -def level4(): - folder='test_level4'; pull='config_NACA0012.cfg'; link='mesh_NACA0012.su2' - with SU2.io.redirect_folder(folder,pull,link): - - # Setup - config_name = 'config_NACA0012.cfg' - config = SU2.io.Config(config_name) - config['NUMBER_PART'] = 2 - config['EXT_ITER'] = 9 - config.CONSOLE = 'QUIET' - - # initialize design state - state = SU2.io.State() - state.find_files(config) - - # initialize project - project = SU2.opt.Project(config,state) - - # run project with dv changes - dv_new = [0.0]*38 - vals = project.obj_f(dv_new) - vals = project.obj_df(dv_new) - - dv_new = [-0.005]*38 - vals = project.obj_f(dv_new) - - dv_new = [0.0]*38 - dv_new[9] = -0.02 - vals = project.obj_f(dv_new) - - dv_new = [0.005]*38 - vals = project.obj_f(dv_new) # will not rerun solutions - - SU2.io.save_data('project.pkl',project) - data = SU2.io.load_data('project.pkl') - - data = project.data - - wait = 0 - print("Done!") - -def level5(): - folder='test_level5'; pull='config_NACA0012.cfg'; link='mesh_NACA0012.su2' - with SU2.io.redirect_folder(folder,pull,link): - - # Setup - config_name = 'config_NACA0012.cfg' - config = SU2.io.Config(config_name) - config['NUMBER_PART'] = 2 - config['EXT_ITER'] = 9 - config['CONSOLE'] = 'CONCISE' - - # set optimization problem - obj = {} - obj['DRAG'] = {'SCALE':1.e-2} - - cons = {} - cons['EQUALITY'] = {} - cons['INEQUALITY'] = {} - cons['INEQUALITY']['LIFT'] = {'SIGN':'>','VALUE':0.328188,'SCALE':1e-1} - cons['INEQUALITY']['MOMENT_Z'] = {'SIGN':'>','VALUE':0.034068,'SCALE':1e-2} - - def_dv = config.DEFINITION_DV - n_dv = sum(def_dv['KIND']) - def_dv['SCALE'] = [1.e0]*n_dv - - config.OPT_OBJECTIVE = obj - config.OPT_CONSTRAINT = cons - - # initialize design state - state = SU2.io.State() - state.find_files(config) - - # initialize project - project = SU2.opt.Project(config,state) - - # optimization setup - x0 = [0.0]*n_dv - xb = [] #[[-0.02,0.02]]*n_dv - its = 20 - - # optimize - SU2.opt.SLSQP(project,x0,xb,its) - - wait = 0 - -if __name__ == '__main__': - main() diff --git a/SU2_PY/parallel_computation.py b/SU2_PY/parallel_computation.py index 001ce0c5eba..0aaa7825c70 100755 --- a/SU2_PY/parallel_computation.py +++ b/SU2_PY/parallel_computation.py @@ -3,7 +3,7 @@ ## \file parallel_computation.py # \brief Python script for doing the continuous adjoint computation using the SU2 suite. # \author T. Economon, T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -27,34 +27,48 @@ import os, sys from optparse import OptionParser -sys.path.append(os.environ['SU2_RUN']) + +sys.path.append(os.environ["SU2_RUN"]) import SU2 # ------------------------------------------------------------------- # Main # ------------------------------------------------------------------- + def main(): # Command Line Options - parser=OptionParser() - parser.add_option("-f", "--file", dest="filename", - help="read config from FILE", metavar="FILE") - parser.add_option("-n", "--partitions", dest="partitions", default=2, - help="number of PARTITIONS", metavar="PARTITIONS") - parser.add_option("-c", "--compute", dest="compute", default="True", - help="COMPUTE direct and adjoint problem", metavar="COMPUTE") - - (options, args)=parser.parse_args() - options.partitions = int( options.partitions ) - options.compute = options.compute.upper() == 'TRUE' + parser = OptionParser() + parser.add_option( + "-f", "--file", dest="filename", help="read config from FILE", metavar="FILE" + ) + parser.add_option( + "-n", + "--partitions", + dest="partitions", + default=2, + help="number of PARTITIONS", + metavar="PARTITIONS", + ) + parser.add_option( + "-c", + "--compute", + dest="compute", + default="True", + help="COMPUTE direct and adjoint problem", + metavar="COMPUTE", + ) + + (options, args) = parser.parse_args() + options.partitions = int(options.partitions) + options.compute = options.compute.upper() == "TRUE" if options.filename == None: raise Exception("No config file provided. Use -f flag") - parallel_computation( options.filename , - options.partitions , - options.compute ) + parallel_computation(options.filename, options.partitions, options.compute) + #: def main() @@ -63,9 +77,8 @@ def main(): # CFD Solution # ------------------------------------------------------------------- -def parallel_computation( filename , - partitions = 0 , - compute = True ): + +def parallel_computation(filename, partitions=0, compute=True): # Config config = SU2.io.Config(filename) @@ -89,15 +102,16 @@ def parallel_computation( filename , state.update(info) # Solution merging - if config.MATH_PROBLEM == 'DIRECT': + if config.MATH_PROBLEM == "DIRECT": config.SOLUTION_FILENAME = config.RESTART_FILENAME - elif config.MATH_PROBLEM in ['CONTINUOUS_ADJOINT', 'DISCRETE_ADJOINT']: + elif config.MATH_PROBLEM in ["CONTINUOUS_ADJOINT", "DISCRETE_ADJOINT"]: config.SOLUTION_ADJ_FILENAME = config.RESTART_ADJ_FILENAME info = SU2.run.merge(config) state.update(info) return state + #: parallel_computation() @@ -106,6 +120,5 @@ def parallel_computation( filename , # ------------------------------------------------------------------- # this is only accessed if running from command prompt -if __name__ == '__main__': +if __name__ == "__main__": main() - diff --git a/SU2_PY/parallel_computation_fsi.py b/SU2_PY/parallel_computation_fsi.py index e0983038149..e81a32d7ba3 100755 --- a/SU2_PY/parallel_computation_fsi.py +++ b/SU2_PY/parallel_computation_fsi.py @@ -3,7 +3,7 @@ ## \file parallel_computation_fsi.py # \brief Python script for running FSI simulations using the SU2 suite. # \author T. Economon, T. Lukaczyk, F. Palacios, H. Kline, R. Sanchez -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -27,34 +27,48 @@ import os, sys, shutil, copy from optparse import OptionParser -sys.path.append(os.environ['SU2_RUN']) + +sys.path.append(os.environ["SU2_RUN"]) import SU2 # ------------------------------------------------------------------- # Main # ------------------------------------------------------------------- + def main(): # Command Line Options - parser=OptionParser() - parser.add_option("-f", "--file", dest="filename", - help="read config from FILE", metavar="FILE") - parser.add_option("-n", "--partitions", dest="partitions", default=2, - help="number of PARTITIONS", metavar="PARTITIONS") - parser.add_option("-c", "--compute", dest="compute", default="True", - help="COMPUTE direct and adjoint problem", metavar="COMPUTE") - - (options, args)=parser.parse_args() - options.partitions = int( options.partitions ) - options.compute = options.compute.upper() == 'TRUE' + parser = OptionParser() + parser.add_option( + "-f", "--file", dest="filename", help="read config from FILE", metavar="FILE" + ) + parser.add_option( + "-n", + "--partitions", + dest="partitions", + default=2, + help="number of PARTITIONS", + metavar="PARTITIONS", + ) + parser.add_option( + "-c", + "--compute", + dest="compute", + default="True", + help="COMPUTE direct and adjoint problem", + metavar="COMPUTE", + ) + + (options, args) = parser.parse_args() + options.partitions = int(options.partitions) + options.compute = options.compute.upper() == "TRUE" if options.filename == None: raise Exception("No config file provided. Use -f flag") - parallel_computation( options.filename , - options.partitions , - options.compute ) + parallel_computation(options.filename, options.partitions, options.compute) + #: def main() @@ -63,9 +77,8 @@ def main(): # CFD Solution # ------------------------------------------------------------------- -def parallel_computation( filename , - partitions = 0 , - compute = True ): + +def parallel_computation(filename, partitions=0, compute=True): # Config config = SU2.io.Config(filename) @@ -85,9 +98,9 @@ def parallel_computation( filename , state.update(info) # Solution merging - if config.SOLVER == 'FEM_ELASTICITY': + if config.SOLVER == "FEM_ELASTICITY": config.SOLUTION_FILENAME = config.RESTART_FILENAME - elif config.SOLVER == 'FLUID_STRUCTURE_INTERACTION': + elif config.SOLVER == "FLUID_STRUCTURE_INTERACTION": config.SOLUTION_FILENAME = config.RESTART_FILENAME config.SOLUTION_FILENAME = config.RESTART_FILENAME @@ -96,6 +109,7 @@ def parallel_computation( filename , return state + #: parallel_computation() @@ -104,6 +118,5 @@ def parallel_computation( filename , # ------------------------------------------------------------------- # this is only accessed if running from command prompt -if __name__ == '__main__': +if __name__ == "__main__": main() - diff --git a/SU2_PY/parse_config.py b/SU2_PY/parse_config.py index 66d386d68f2..6157d3985b2 100755 --- a/SU2_PY/parse_config.py +++ b/SU2_PY/parse_config.py @@ -3,7 +3,7 @@ ## \file parse_config.py # \brief Builds a worksheet of all SU2.cpp options # \author A. Aranake, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -28,226 +28,275 @@ # make print(*args) function available in PY2.6+, does'nt work on PY < 2.6 from __future__ import print_function -import os,sys,xlwt +import os, sys, xlwt # note: requires xlwt for spreadsheet output # http://pypi.python.org/pypi/xlwt -class config_option: - option_name = "" - option_type = "" - option_category = "" - option_values = [] - option_default = "" - option_description = "" - - def __init__(self,name,otype,category,values,default,description): - self.option_name = name - self.option_type = otype - self.option_category = category - self.option_values = values - self.option_default = default - self.option_description = description - - def print_data(self): - print('Option Name: %s '% self.option_name) - print('Option Type: %s '% self.option_type) - print('Option Category: %s '% self.option_category) - print('Option values: ', self.option_values) - print('Option default: %s'% self.option_default) - print('Option description: %s '% self.option_description) - print('') - -def parse_config(config_cpp, config_hpp): - - # List of option types - option_types = ['AddEnumOption', 'AddMathProblem', 'AddSpecialOption', 'AddScalarOption', 'AddMarkerOption', 'AddMarkerPeriodic', 'AddMarkerDirichlet', 'AddMarkerInlet', 'AddMarkerOutlet', 'AddMarkerDisplacement', 'AddMarkerLoad', 'AddMarkerFlowLoad', 'AddArrayOption', 'AddListOption', 'AddConvectOption', 'AddEnumListOption', 'AddDVParamOption'] - - # Build a dictionary of enum options from hpp file - enum_options = {} - f = open(config_hpp,'r') - while(1): # Find beginning of enum definitions - s = f.readline() - if s.find('BEGIN_CONFIG_ENUMS') >-1: - break - while(1): - s = f.readline() - if s.find('END_CONFIG_ENUMS')>-1: - break # Reached end - - if s.find('CCreateMap')>-1: - dict_key = (s.split('=')[0]).split('>')[1].strip() - dict_val = [] - while(1): - s2 = f.readline() - thisval = s2.split('"')[1] - dict_val.append(thisval) - if s2.find(';')>-1: - break; - enum_options[dict_key] = dict_val - f.close() - - # Temporary: For now, build a list of all of the schemes - scheme_list = enum_options['Upwind_Map'] - scheme_list.extend(enum_options['Centered_Map'][1:]) - # Read the Options section of config_structure.cpp into a list of strings - lines = [] - f = open(config_cpp,'r') - while(1): - s = f.readline() - if s.find('BEGIN_CONFIG_OPTIONS')>-1: - break - while(1): - s = f.readline() - # Check if we've reached the end - if s.find('END_CONFIG_OPTIONS')>-1: - break - lines.append(s) - f.close() - - option_list = [] - present_category = "None" - #----- Main text parsing loop ----- - for j,line in enumerate(lines): - - # Check for a category description - if line.find('CONFIG_CATEGORY')>-1: - present_category = line.split(':')[1].strip().strip('*/').strip() - print(present_category) - - # Check for an option type - for option_type in option_types: - if line.find(option_type)>-1: # Found an option - # Get option name - name = line.split('"')[1] - - # Permitted values - values = ['YES','NO'] - if option_type=='AddEnumOption': - try: - enum_mapname = line.split(',')[2].strip() - values = enum_options[enum_mapname] - except KeyError: - print("KeyError, key=%s"%enum_mapname) - print("enum_options: ",enum_options) - sys.exit(1) - except TypeError: - print("TypeError, key=%s"%enum_mapname) - print("enum_options: ",enum_options) - sys.exit(1) - elif option_type=='AddMathProblem': - values = ['DIRECT','CONTINUOUS_ADJOINT','LINEARIZED'] - elif option_type=='AddScalarOption': - values = ['A scalar constant'] - elif option_type in ('AddMarkerOption', 'AddMarkerPeriodic', 'AddMarkerDirichlet', 'AddMarkerInlet', 'AddMarkerOutlet', 'AddMarkerDisplacement', 'AddMarkerLoad', 'AddMarkerFlowLoad'): - values = ['Valid marker name from grid file'] - elif option_type == 'AddArrayOption': - values = ['Array'] - elif option_type == 'AddListOption': - values = ['List'] - elif option_type == 'AddConvectOption': - values = scheme_list - print("Convect Option: ", name) - elif option_type == 'AddEnumListOption': - values = ['Enum list'] - elif option_type == 'AddDVParamOption': - values = ['DV Param'] - - # A first pass at finding the default value (Check the last item in parenthesis) - jdefault = j - while(lines[jdefault].find(';')==-1): - jdefault = jdefault+1 - default = lines[jdefault].strip().strip(');').split(',')[-1].strip().strip('"') - - # A whole bunch of corrections for what the default should be... - if default.find('string("')==0: - default = default.split('"')[1] - if default=="default_vec_3d": - default = '(1.0, 100.0, 1.0)' - if default=="default_vec_6d": - default = '( -1E15, -1E15, -1E15, 1E15, 1E15, 1E15 )' - if option_type == "AddMathProblem": - default = 'DIRECT' - if option_type == "AddConvectOption": - default = 'ROE-1ST_ORDER' - if default == 'RK_Alpha_Step': - default = '( 0.66667, 0.66667, 1.000000 )' - if default == 'RK_Beta_Step': - default = '( 1.00000, 0.00000, 0.00000 )' - - if default=='false': - default='NO' - elif default=='true': - default='YES' - - # Check for a description tag - description = "No description" - if lines[j-1].find('DESCRIPTION')>-1: - description = lines[j-1].split(':')[1].strip().strip('*/').strip() - - # Add a new option - option_list.append(config_option(name,option_type[3:],present_category,values,default,description)) - - break - - return option_list - -def print_all(option_list): - # Dumps the option list to screen - for option in option_list: - option.print_data() - -def make_spreadsheet(filename, option_list): - - wbk = xlwt.Workbook() - sheet_name = "" - jp = 0 - for j,opt in enumerate(option_list): - jp = jp+1 - if not sheet_name==opt.option_category: - # Create new sheet for new category - sheet_name = opt.option_category - sheet = wbk.add_sheet(sheet_name[:31].replace('/','-')) - - # Write spreadsheet header - sheet.write(0,0,'Option Name') - sheet.write(0,1,'Option Type') - sheet.write(0,2,'Option Category') - sheet.write(0,3,'Option Values') - sheet.write(0,4,'Option Default') - sheet.write(0,5,'Option Description') - jp = 1 - - - sheet.write(jp,0,opt.option_name) - sheet.write(jp,1,opt.option_type) - sheet.write(jp,2,opt.option_category) - sheet.write(jp,3,(',').join(opt.option_values)) - sheet.write(jp,4,opt.option_default) - sheet.write(jp,5,opt.option_description) - - wbk.save(filename) +class config_option: + option_name = "" + option_type = "" + option_category = "" + option_values = [] + option_default = "" + option_description = "" + + def __init__(self, name, otype, category, values, default, description): + self.option_name = name + self.option_type = otype + self.option_category = category + self.option_values = values + self.option_default = default + self.option_description = description + + def print_data(self): + print("Option Name: %s " % self.option_name) + print("Option Type: %s " % self.option_type) + print("Option Category: %s " % self.option_category) + print("Option values: ", self.option_values) + print("Option default: %s" % self.option_default) + print("Option description: %s " % self.option_description) + print("") +def parse_config(config_cpp, config_hpp): -if __name__=="__main__": + # List of option types + option_types = [ + "AddEnumOption", + "AddMathProblem", + "AddSpecialOption", + "AddScalarOption", + "AddMarkerOption", + "AddMarkerPeriodic", + "AddMarkerDirichlet", + "AddMarkerInlet", + "AddMarkerOutlet", + "AddMarkerDisplacement", + "AddMarkerLoad", + "AddMarkerFlowLoad", + "AddArrayOption", + "AddListOption", + "AddConvectOption", + "AddEnumListOption", + "AddDVParamOption", + ] + + # Build a dictionary of enum options from hpp file + enum_options = {} + f = open(config_hpp, "r") + while 1: # Find beginning of enum definitions + s = f.readline() + if s.find("BEGIN_CONFIG_ENUMS") > -1: + break + while 1: + s = f.readline() + if s.find("END_CONFIG_ENUMS") > -1: + break # Reached end + + if s.find("CCreateMap") > -1: + dict_key = (s.split("=")[0]).split(">")[1].strip() + dict_val = [] + while 1: + s2 = f.readline() + thisval = s2.split('"')[1] + dict_val.append(thisval) + if s2.find(";") > -1: + break + enum_options[dict_key] = dict_val + f.close() + + # Temporary: For now, build a list of all of the schemes + scheme_list = enum_options["Upwind_Map"] + scheme_list.extend(enum_options["Centered_Map"][1:]) + # Read the Options section of config_structure.cpp into a list of strings + lines = [] + f = open(config_cpp, "r") + while 1: + s = f.readline() + if s.find("BEGIN_CONFIG_OPTIONS") > -1: + break + while 1: + s = f.readline() + # Check if we've reached the end + if s.find("END_CONFIG_OPTIONS") > -1: + break + lines.append(s) + f.close() + + option_list = [] + present_category = "None" + # ----- Main text parsing loop ----- + for j, line in enumerate(lines): + + # Check for a category description + if line.find("CONFIG_CATEGORY") > -1: + present_category = line.split(":")[1].strip().strip("*/").strip() + print(present_category) + + # Check for an option type + for option_type in option_types: + if line.find(option_type) > -1: # Found an option + # Get option name + name = line.split('"')[1] + + # Permitted values + values = ["YES", "NO"] + if option_type == "AddEnumOption": + try: + enum_mapname = line.split(",")[2].strip() + values = enum_options[enum_mapname] + except KeyError: + print("KeyError, key=%s" % enum_mapname) + print("enum_options: ", enum_options) + sys.exit(1) + except TypeError: + print("TypeError, key=%s" % enum_mapname) + print("enum_options: ", enum_options) + sys.exit(1) + elif option_type == "AddMathProblem": + values = ["DIRECT", "CONTINUOUS_ADJOINT", "LINEARIZED"] + elif option_type == "AddScalarOption": + values = ["A scalar constant"] + elif option_type in ( + "AddMarkerOption", + "AddMarkerPeriodic", + "AddMarkerDirichlet", + "AddMarkerInlet", + "AddMarkerOutlet", + "AddMarkerDisplacement", + "AddMarkerLoad", + "AddMarkerFlowLoad", + ): + values = ["Valid marker name from grid file"] + elif option_type == "AddArrayOption": + values = ["Array"] + elif option_type == "AddListOption": + values = ["List"] + elif option_type == "AddConvectOption": + values = scheme_list + print("Convect Option: ", name) + elif option_type == "AddEnumListOption": + values = ["Enum list"] + elif option_type == "AddDVParamOption": + values = ["DV Param"] + + # A first pass at finding the default value (Check the last item in parenthesis) + jdefault = j + while lines[jdefault].find(";") == -1: + jdefault = jdefault + 1 + default = ( + lines[jdefault] + .strip() + .strip(");") + .split(",")[-1] + .strip() + .strip('"') + ) + + # A whole bunch of corrections for what the default should be... + if default.find('string("') == 0: + default = default.split('"')[1] + if default == "default_vec_3d": + default = "(1.0, 100.0, 1.0)" + if default == "default_vec_6d": + default = "( -1E15, -1E15, -1E15, 1E15, 1E15, 1E15 )" + if option_type == "AddMathProblem": + default = "DIRECT" + if option_type == "AddConvectOption": + default = "ROE-1ST_ORDER" + if default == "RK_Alpha_Step": + default = "( 0.66667, 0.66667, 1.000000 )" + if default == "RK_Beta_Step": + default = "( 1.00000, 0.00000, 0.00000 )" + + if default == "false": + default = "NO" + elif default == "true": + default = "YES" + + # Check for a description tag + description = "No description" + if lines[j - 1].find("DESCRIPTION") > -1: + description = lines[j - 1].split(":")[1].strip().strip("*/").strip() + + # Add a new option + option_list.append( + config_option( + name, + option_type[3:], + present_category, + values, + default, + description, + ) + ) + + break + + return option_list - # These variables should point to the configuration files - su2_home = os.environ['SU2_HOME'] - config_cpp = os.path.join(su2_home,'Common/src/config_structure.cpp') - config_hpp = os.path.join(su2_home,'Common/include/option_structure.hpp') - # Check that files exist - if not os.path.isfile(config_cpp): - sys.exit('Could not find cpp file, please check that su2_basedir is set correctly in parse_config.py') - if not os.path.isfile(config_hpp): - sys.exit('Could not find hpp file, please check that su2_basedir is set correctly in parse_config.py') +def print_all(option_list): + # Dumps the option list to screen + for option in option_list: + option.print_data() - # Run the parser - option_list = parse_config(config_cpp, config_hpp) - # Dump parsed data to screen - print_all(option_list) +def make_spreadsheet(filename, option_list): - #make_spreadsheet('out.xls',option_list) + wbk = xlwt.Workbook() + + sheet_name = "" + jp = 0 + for j, opt in enumerate(option_list): + jp = jp + 1 + if not sheet_name == opt.option_category: + # Create new sheet for new category + sheet_name = opt.option_category + sheet = wbk.add_sheet(sheet_name[:31].replace("/", "-")) + + # Write spreadsheet header + sheet.write(0, 0, "Option Name") + sheet.write(0, 1, "Option Type") + sheet.write(0, 2, "Option Category") + sheet.write(0, 3, "Option Values") + sheet.write(0, 4, "Option Default") + sheet.write(0, 5, "Option Description") + jp = 1 + + sheet.write(jp, 0, opt.option_name) + sheet.write(jp, 1, opt.option_type) + sheet.write(jp, 2, opt.option_category) + sheet.write(jp, 3, (",").join(opt.option_values)) + sheet.write(jp, 4, opt.option_default) + sheet.write(jp, 5, opt.option_description) + + wbk.save(filename) + + +if __name__ == "__main__": + + # These variables should point to the configuration files + su2_home = os.environ["SU2_HOME"] + config_cpp = os.path.join(su2_home, "Common/src/config_structure.cpp") + config_hpp = os.path.join(su2_home, "Common/include/option_structure.hpp") + + # Check that files exist + if not os.path.isfile(config_cpp): + sys.exit( + "Could not find cpp file, please check that su2_basedir is set correctly in parse_config.py" + ) + if not os.path.isfile(config_hpp): + sys.exit( + "Could not find hpp file, please check that su2_basedir is set correctly in parse_config.py" + ) + + # Run the parser + option_list = parse_config(config_cpp, config_hpp) + + # Dump parsed data to screen + print_all(option_list) + + # make_spreadsheet('out.xls',option_list) diff --git a/SU2_PY/profiling.py b/SU2_PY/profiling.py index d257257f520..b14382db8ca 100755 --- a/SU2_PY/profiling.py +++ b/SU2_PY/profiling.py @@ -3,7 +3,7 @@ ## \file profiling.py # \brief Python script for postprocessing the SU2 custom profiling (profiling.csv) # \author T. Economon -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -32,69 +32,82 @@ from matplotlib import mlab parser = OptionParser() -parser.add_option("-f", "--file", dest="file", - help="profiling CSV file", metavar="FILE") -(options, args)=parser.parse_args() +parser.add_option( + "-f", "--file", dest="file", help="profiling CSV file", metavar="FILE" +) +(options, args) = parser.parse_args() # Store the file name filename = options.file # Load the csv file with the profiling data -profile = mlab.csv2rec(filename, comments='#', skiprows=0, checkrows=0) +profile = mlab.csv2rec(filename, comments="#", skiprows=0, checkrows=0) # Get total number of groups maxID = 0 for val in range(len(profile.function_name)): - if profile.function_id[val] > maxID: - maxID = profile.function_id[val] + if profile.function_id[val] > maxID: + maxID = profile.function_id[val] # Get some arrays for sorting out the groups -labels = [[] for i in range(maxID)] -fracs = [[] for i in range(maxID)] +labels = [[] for i in range(maxID)] +fracs = [[] for i in range(maxID)] explode = [[] for i in range(maxID)] -calls = [[] for i in range(maxID)] +calls = [[] for i in range(maxID)] # Process the profiling data into group IDs for val in range(len(profile.function_name)): - labels[profile.function_id[val]-1].append(profile.function_name[val]) - fracs[profile.function_id[val]-1].append(profile.avg_total_time[val]) - explode[profile.function_id[val]-1].append(0) - calls[profile.function_id[val]-1].append(profile.n_calls[val]) + labels[profile.function_id[val] - 1].append(profile.function_name[val]) + fracs[profile.function_id[val] - 1].append(profile.avg_total_time[val]) + explode[profile.function_id[val] - 1].append(0) + calls[profile.function_id[val] - 1].append(profile.n_calls[val]) # Loop over each of the group IDs and make figures for val in range(maxID): - #Create a Pie chart to see the time spent in each subroutine - fig = plt.figure(figsize=[18, 8]) - ax = fig.add_subplot(121) - ax.set_title("Total Time Spent in Each Function"); - - # Sort the pieces to make it pretty - fracs[val], labels[val],calls[val] = (list(x) for x in zip(*sorted(zip(fracs[val], labels[val], calls[val])))) - - # Call to make the pie chart - pie_wedge_collection = ax.pie(fracs[val], explode=explode[val], labels=labels[val],labeldistance=1.05, autopct='%1.1f%%', shadow=False, startangle=0); - for pie_wedge in pie_wedge_collection[0]: - pie_wedge.set_edgecolor('white') - - # Sort the number of calls again for the bar chart - calls[val], labels[val] = (list(x) for x in zip(*sorted(zip(calls[val], labels[val])))) - - # Create a bar chart for the number of function calls - ax = fig.add_subplot(122) - ax.set_title("Number of Function Calls"); - width = 0.35 - ax.bar(range(len(calls[val])), calls[val], width=width) - ax.set_xticks(np.arange(len(calls[val])) + width/2) - ax.set_xticklabels(labels[val]) - ax.set_xlabel('Function') - ax.set_ylabel('Calls') - fig.autofmt_xdate() - fig.subplots_adjust(wspace=0.5) - - # Save a figure for this group - filename = 'profile_group_' + str(val) + '.png' - fig.savefig(filename,format='png') - - # Uncomment the next line to open the plots on the screen - show() + # Create a Pie chart to see the time spent in each subroutine + fig = plt.figure(figsize=[18, 8]) + ax = fig.add_subplot(121) + ax.set_title("Total Time Spent in Each Function") + + # Sort the pieces to make it pretty + fracs[val], labels[val], calls[val] = ( + list(x) for x in zip(*sorted(zip(fracs[val], labels[val], calls[val]))) + ) + + # Call to make the pie chart + pie_wedge_collection = ax.pie( + fracs[val], + explode=explode[val], + labels=labels[val], + labeldistance=1.05, + autopct="%1.1f%%", + shadow=False, + startangle=0, + ) + for pie_wedge in pie_wedge_collection[0]: + pie_wedge.set_edgecolor("white") + + # Sort the number of calls again for the bar chart + calls[val], labels[val] = ( + list(x) for x in zip(*sorted(zip(calls[val], labels[val]))) + ) + + # Create a bar chart for the number of function calls + ax = fig.add_subplot(122) + ax.set_title("Number of Function Calls") + width = 0.35 + ax.bar(range(len(calls[val])), calls[val], width=width) + ax.set_xticks(np.arange(len(calls[val])) + width / 2) + ax.set_xticklabels(labels[val]) + ax.set_xlabel("Function") + ax.set_ylabel("Calls") + fig.autofmt_xdate() + fig.subplots_adjust(wspace=0.5) + + # Save a figure for this group + filename = "profile_group_" + str(val) + ".png" + fig.savefig(filename, format="png") + + # Uncomment the next line to open the plots on the screen + show() diff --git a/SU2_PY/pySU2/Makefile.am b/SU2_PY/pySU2/Makefile.am deleted file mode 100644 index febedbc98b6..00000000000 --- a/SU2_PY/pySU2/Makefile.am +++ /dev/null @@ -1,135 +0,0 @@ -################################################################################ -# -# \file Makefile.am -# \brief Makefile for the SU2 Python wrapper. -# \author D. Thomas -# \version 7.5.1 "Blackbird" -# -# SU2 Project Website: https://su2code.github.io -# -# The SU2 Project is maintained by the SU2 Foundation -# (http://su2foundation.org) -# -# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) -# -# SU2 is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# SU2 is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with SU2. If not, see . -# -################################################################################ - - -CURRENT_DIR = ${abs_top_builddir}/SU2_PY/pySU2 - -SO_EXT=so - -if BUILD_NORMAL - SWIG_SRC = ${abs_top_srcdir}/SU2_PY/pySU2/pySU2.i - SWIG_WRAP_REAL = SU2_APIPYTHON_wrap - SWIG_SO_REAL = _pysu2.${SO_EXT} -endif - -if BUILD_REVERSE - SWIG_SRC = ${abs_top_srcdir}/SU2_PY/pySU2/pySU2ad.i - SWIG_WRAP_REAL = SU2_APIPYTHON_wrap_AD - SWIG_SO_REAL = _pysu2ad.${SO_EXT} -endif - -PYTHON_SITE_PACKAGES=$(shell python -c "import site; print(site.getsitepackages()[0])") -#NUMPY_INCLUDE = /usr/lib/python2.7/dist-packages/numpy/core/include -MPI4PY_INCLUDE = ${HOME}/.local/lib/python2.7/site-packages/mpi4py/include \ - -I${PYTHON_SITE_PACKAGES}/mpi4py/include \ - -I/Library/Python/2.7/site-packages/mpi4py/include - -SWIG = swig - -pySU2_INCLUDE = -I${abs_top_builddir}/Common/include \ - -I${abs_top_builddir}/SU2_CFD/include - -PY_INCLUDE = ${PYTHON_INCLUDE} -I${MPI4PY_INCLUDE} - -PY_LIB = ${PYTHON_LIBS} \ - -L${PYTHON_EXEC_PREFIX}/lib \ - -L/usr/lib \ - -L/usr/lib/x86_64-linux-gnu - - -SWIG_INCLUDE = ${PY_INCLUDE} - -SUBDIR_EXEC = ${bindir} - -all: - ${MAKE} real; - -# List the dependencies -real: ${SWIG_SO_REAL} - -if BUILD_NORMAL - EXTRA_CC_FLAGS = -fPIC -O3 -std=c++11 -endif - -if BUILD_REVERSE - EXTRA_CC_FLAGS = -fPIC -O3 -std=c++11 -DCODI_REVERSE_TYPE -I$(top_srcdir)/externals/codi/include -I$(top_srcdir)/externals/medi/include -# EXTRA_CC_FLAGS = -fPIC -g3 -std=c++11 -DCODI_REVERSE_TYPE -I$(top_srcdir)/externals/codi/include -I$(top_srcdir)/externals/medi/include -endif - -#SU2_BASE lib -if BUILD_NORMAL - SU2SOLVER_LIB = ${abs_top_builddir}/SU2_CFD/obj/libSU2Core.a \ - ${abs_top_builddir}/Common/lib/libSU2.a - PYLIB = pysu2.py - SOLIB = _pysu2.so -endif - -#SU2_AD lib -if BUILD_REVERSE - SU2SOLVER_LIB = ${abs_top_builddir}/SU2_CFD/obj/libSU2Core_AD.a \ - ${abs_top_builddir}/Common/lib/libSU2_AD.a - PYLIB = pysu2ad.py - SOLIB = _pysu2ad.so -endif - -# Set the linking flags to use -pySU2_LD_FLAGS = ${SU2SOLVER_LIB} @su2_externals_LIBS@ ${PY_LIB} - -# Set the command line flags to use for compilation -pySU2_CC_FLAGS = ${CPPFLAGS} ${EXTRA_CC_FLAGS} @su2_externals_INCLUDES@ ${pySU2_INCLUDE} - -SO_LINK_FLAGS= -fPIC -shared - -# Default rule for creating the _wrap.cxx file from the .i file -${SWIG_WRAP_REAL}.cxx: ${SU2SOLVER_LIB} ${SWIG_SRC} - ${SWIG} ${CPPFLAGS} -Wall ${SWIG_INCLUDE} -outdir ./ -o ${SWIG_WRAP_REAL}.cxx -c++ -python ${SWIG_SRC} - -#Default rule for compiling the .o files -${SWIG_WRAP_REAL}.o: ${SWIG_WRAP_REAL}.cxx - ${CXX} ${pySU2_CC_FLAGS} ${PY_INCLUDE} -c ${SWIG_WRAP_REAL}.cxx -o ${SWIG_WRAP_REAL}.o - -#_%.${SO_EXT}: %.o -# ${CXX} ${SO_LINK_FLAGS} -o _$*.${SO_EXT} $*_wrap.o ${pySU2_LD_FLAGS} - -${SWIG_SO_REAL}: ${SWIG_WRAP_REAL}.o - ${CXX} ${SO_LINK_FLAGS} -o ${SWIG_SO_REAL} ${SWIG_WRAP_REAL}.o ${pySU2_LD_FLAGS} - -.SECONDARY: - -clean: - rm -f ${CURRENT_DIR}/*.cxx - rm -f ${CURRENT_DIR}/*.${SO_EXT} - rm -f ${CURRENT_DIR}/*.o - rm -f ${CURRENT_DIR}/*.h - rm -f ${CURRENT_DIR}/*.py - -install: all - ${INSTALL} ${PYLIB} ${bindir} - ${INSTALL} ${SOLIB} ${bindir} - diff --git a/SU2_PY/pySU2/meson.build b/SU2_PY/pySU2/meson.build index a71e6e307b9..3d9abc747ec 100644 --- a/SU2_PY/pySU2/meson.build +++ b/SU2_PY/pySU2/meson.build @@ -37,7 +37,10 @@ if get_option('enable-normal') '_pysu2', cpp_source, dependencies: [wrapper_deps, common_dep, su2_deps], - objects: su2_cfd_lib.extract_all_objects(), + objects: [ + su2_cfd_lib.extract_all_objects(), + su2_def_lib.extract_objects('drivers/CDeformationDriver.cpp') + ], install: true, include_directories : mpi4py_include, cpp_args : [default_warning_flags,su2_cpp_args], @@ -53,7 +56,10 @@ if get_option('enable-autodiff') '_pysu2ad', cpp_source, dependencies: [wrapper_deps, commonAD_dep, su2_deps, codi_dep], - objects: su2_cfd_lib_ad.extract_all_objects(), + objects: [ + su2_cfd_lib_ad.extract_all_objects(), + su2_def_lib_ad.extract_objects('drivers/CDiscAdjDeformationDriver.cpp') + ], install: true, include_directories : mpi4py_include, cpp_args : [default_warning_flags, su2_cpp_args, codi_rev_args], diff --git a/SU2_PY/pySU2/numpy.i b/SU2_PY/pySU2/numpy.i index e86dfc47137..b8fdaeb1f0c 100644 --- a/SU2_PY/pySU2/numpy.i +++ b/SU2_PY/pySU2/numpy.i @@ -3164,4 +3164,3 @@ #endif #endif /* SWIGPYTHON */ - diff --git a/SU2_PY/pySU2/pySU2.i b/SU2_PY/pySU2/pySU2.i index 69384d70f3d..2fb6e2b058f 100644 --- a/SU2_PY/pySU2/pySU2.i +++ b/SU2_PY/pySU2/pySU2.i @@ -4,7 +4,7 @@ # \file pySU2.i # \brief Configuration file for the Swig compilation of the Python wrapper. # \author D. Thomas -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -37,20 +37,23 @@ directors="1", threads="1" ) pysu2 %{ - +#include "../../Common/include/containers/CPyWrapperMatrixView.hpp" +#include "../../SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp" #include "../../SU2_CFD/include/drivers/CDriver.hpp" -#include "../../SU2_CFD/include/drivers/CSinglezoneDriver.hpp" +#include "../../SU2_CFD/include/drivers/CDriverBase.hpp" #include "../../SU2_CFD/include/drivers/CMultizoneDriver.hpp" -#include "../../SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp" - +#include "../../SU2_CFD/include/drivers/CSinglezoneDriver.hpp" +#include "../../SU2_DEF/include/drivers/CDeformationDriver.hpp" %} // ----------- USED MODULES ------------ %import "../../Common/include/code_config.hpp" %import "../../Common/include/basic_types/datatype_structure.hpp" %import "../../Common/include/parallelization/mpi_structure.hpp" + %include "std_string.i" %include "std_vector.i" +%include "std_pair.i" %include "std_map.i" %include "typemaps.i" //%include "numpy.i" @@ -60,11 +63,14 @@ threads="1" #endif namespace std { - %template() vector; + %template() vector; + %template() vector; + %template() vector; %template() vector; %template() vector; - %template() map; + %template() map; %template() map; + %template() pair; } // ----------- API CLASSES ---------------- @@ -86,8 +92,10 @@ const unsigned int MESH_1 = 1; /*!< \brief Definition of the finest grid level. const unsigned int ZONE_0 = 0; /*!< \brief Definition of the first grid domain. */ const unsigned int ZONE_1 = 1; /*!< \brief Definition of the first grid domain. */ -// CDriver class +%include "../../Common/include/containers/CPyWrapperMatrixView.hpp" +%include "../../SU2_CFD/include/drivers/CDriverBase.hpp" %include "../../SU2_CFD/include/drivers/CDriver.hpp" %include "../../SU2_CFD/include/drivers/CSinglezoneDriver.hpp" %include "../../SU2_CFD/include/drivers/CMultizoneDriver.hpp" %include "../../SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp" +%include "../../SU2_DEF/include/drivers/CDeformationDriver.hpp" diff --git a/SU2_PY/pySU2/pySU2ad.i b/SU2_PY/pySU2/pySU2ad.i index fe329e7ab8b..67ce17d7669 100644 --- a/SU2_PY/pySU2/pySU2ad.i +++ b/SU2_PY/pySU2/pySU2ad.i @@ -4,7 +4,7 @@ # \file pySU2ad.i # \brief Configuration file for the Swig compilation of the Python wrapper. # \author D. Thomas, R. Sanchez -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -37,20 +37,23 @@ directors="1", threads="1" ) pysu2ad %{ - +#include "../../Common/include/containers/CPyWrapperMatrixView.hpp" +#include "../../SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp" #include "../../SU2_CFD/include/drivers/CDriver.hpp" -#include "../../SU2_CFD/include/drivers/CSinglezoneDriver.hpp" +#include "../../SU2_CFD/include/drivers/CDriverBase.hpp" #include "../../SU2_CFD/include/drivers/CMultizoneDriver.hpp" -#include "../../SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp" - +#include "../../SU2_CFD/include/drivers/CSinglezoneDriver.hpp" +#include "../../SU2_DEF/include/drivers/CDiscAdjDeformationDriver.hpp" %} // ----------- USED MODULES ------------ %import "../../Common/include/code_config.hpp" %import "../../Common/include/basic_types/datatype_structure.hpp" %import "../../Common/include/parallelization/mpi_structure.hpp" + %include "std_string.i" %include "std_vector.i" +%include "std_pair.i" %include "std_map.i" %include "typemaps.i" //%include "numpy.i" @@ -60,11 +63,14 @@ threads="1" #endif namespace std { - %template() vector; + %template() vector; + %template() vector; + %template() vector; %template() vector; %template() vector; - %template() map; + %template() map; %template() map; + %template() pair; } // ----------- API CLASSES ---------------- @@ -86,8 +92,10 @@ const unsigned int MESH_1 = 1; /*!< \brief Definition of the finest grid level. const unsigned int ZONE_0 = 0; /*!< \brief Definition of the first grid domain. */ const unsigned int ZONE_1 = 1; /*!< \brief Definition of the first grid domain. */ -// CDriver class +%include "../../Common/include/containers/CPyWrapperMatrixView.hpp" +%include "../../SU2_CFD/include/drivers/CDriverBase.hpp" %include "../../SU2_CFD/include/drivers/CDriver.hpp" %include "../../SU2_CFD/include/drivers/CSinglezoneDriver.hpp" %include "../../SU2_CFD/include/drivers/CMultizoneDriver.hpp" %include "../../SU2_CFD/include/drivers/CDiscAdjSinglezoneDriver.hpp" +%include "../../SU2_DEF/include/drivers/CDiscAdjDeformationDriver.hpp" diff --git a/SU2_PY/set_ffd_design_var.py b/SU2_PY/set_ffd_design_var.py index d9cef1d8387..ec343c0e75c 100755 --- a/SU2_PY/set_ffd_design_var.py +++ b/SU2_PY/set_ffd_design_var.py @@ -3,7 +3,7 @@ ## \file set_ffd_design_var.py # \brief Python script for automatically generating a list of FFD variables. # \author T. Economon, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -32,217 +32,391 @@ from numpy import * parser = OptionParser() -parser.add_option("-i", "--iDegree", dest="iDegree", default=4, - help="i degree of the FFD box", metavar="IDEGREE") -parser.add_option("-j", "--jDegree", dest="jDegree", default=4, - help="j degree of the FFD box", metavar="JDEGREE") -parser.add_option("-k", "--kDegree", dest="kDegree", default=1, - help="k degree of the FFD box", metavar="KDEGREE") -parser.add_option("-b", "--ffdid", dest="ffd_id", default=0, - help="ID of the FFD box", metavar="FFD_ID") -parser.add_option("-m", "--marker", dest="marker", - help="marker name of the design surface", metavar="MARKER") -parser.add_option("-a", "--axis", dest="axis", - help="axis to define twist 'x_Orig, y_Orig, z_Orig, x_End, y_End, z_End'", metavar="AXIS") -parser.add_option("-s", "--scale", dest="scale", default=1.0, - help="scale factor for the bump functions", metavar="SCALE") -parser.add_option("-d", "--dimension", dest="dimension", default=3.0, - help="dimension of the problem", metavar="DIMENSION") - -(options, args)=parser.parse_args() +parser.add_option( + "-i", + "--iDegree", + dest="iDegree", + default=4, + help="i degree of the FFD box", + metavar="IDEGREE", +) +parser.add_option( + "-j", + "--jDegree", + dest="jDegree", + default=4, + help="j degree of the FFD box", + metavar="JDEGREE", +) +parser.add_option( + "-k", + "--kDegree", + dest="kDegree", + default=1, + help="k degree of the FFD box", + metavar="KDEGREE", +) +parser.add_option( + "-b", + "--ffdid", + dest="ffd_id", + default=0, + help="ID of the FFD box", + metavar="FFD_ID", +) +parser.add_option( + "-m", + "--marker", + dest="marker", + help="marker name of the design surface", + metavar="MARKER", +) +parser.add_option( + "-a", + "--axis", + dest="axis", + help="axis to define twist 'x_Orig, y_Orig, z_Orig, x_End, y_End, z_End'", + metavar="AXIS", +) +parser.add_option( + "-s", + "--scale", + dest="scale", + default=1.0, + help="scale factor for the bump functions", + metavar="SCALE", +) +parser.add_option( + "-d", + "--dimension", + dest="dimension", + default=3.0, + help="dimension of the problem", + metavar="DIMENSION", +) + +(options, args) = parser.parse_args() # Process options -options.iOrder = int(options.iDegree) + 1 -options.jOrder = int(options.jDegree) + 1 -options.kOrder = int(options.kDegree) + 1 -options.ffd_id = str(options.ffd_id) +options.iOrder = int(options.iDegree) + 1 +options.jOrder = int(options.jDegree) + 1 +options.kOrder = int(options.kDegree) + 1 +options.ffd_id = str(options.ffd_id) options.marker = str(options.marker) options.axis = str(options.axis) -options.scale = float(options.scale) -options.dim = int(options.dimension) +options.scale = float(options.scale) +options.dim = int(options.dimension) if options.dim == 3: - print(" ") - print("% FFD_CONTROL_POINT (X)") - - iVariable = 0 - dvList = "DEFINITION_DV= " - for kIndex in range(options.kOrder): + print(" ") + print("% FFD_CONTROL_POINT (X)") + + iVariable = 0 + dvList = "DEFINITION_DV= " + for kIndex in range(options.kOrder): + for jIndex in range(options.jOrder): + for iIndex in range(options.iOrder): + iVariable = iVariable + 1 + dvList = ( + dvList + + "( 11, " + + str(options.scale) + + " | " + + options.marker + + " | " + ) + dvList = ( + dvList + + options.ffd_id + + ", " + + str(iIndex) + + ", " + + str(jIndex) + + ", " + + str(kIndex) + + ", 1.0, 0.0, 0.0 )" + ) + if iVariable < (options.iOrder * (options.jOrder) * options.kOrder): + dvList = dvList + "; " + + print(dvList) + + print(" ") + print("% FFD_CONTROL_POINT (Y)") + + iVariable = 0 + dvList = "DEFINITION_DV= " + for kIndex in range(options.kOrder): + for jIndex in range(options.jOrder): + for iIndex in range(options.iOrder): + iVariable = iVariable + 1 + dvList = ( + dvList + + "( 11, " + + str(options.scale) + + " | " + + options.marker + + " | " + ) + dvList = ( + dvList + + options.ffd_id + + ", " + + str(iIndex) + + ", " + + str(jIndex) + + ", " + + str(kIndex) + + ", 0.0, 1.0, 0.0 )" + ) + if iVariable < (options.iOrder * (options.jOrder) * options.kOrder): + dvList = dvList + "; " + + print(dvList) + + print(" ") + print("% FFD_CONTROL_POINT (Z)") + + iVariable = 0 + dvList = "DEFINITION_DV= " + for kIndex in range(options.kOrder): + for jIndex in range(options.jOrder): + for iIndex in range(options.iOrder): + iVariable = iVariable + 1 + dvList = ( + dvList + + "( 11, " + + str(options.scale) + + " | " + + options.marker + + " | " + ) + dvList = ( + dvList + + options.ffd_id + + ", " + + str(iIndex) + + ", " + + str(jIndex) + + ", " + + str(kIndex) + + ", 0.0, 0.0, 1.0 )" + ) + if iVariable < (options.iOrder * (options.jOrder) * options.kOrder): + dvList = dvList + "; " + + print(dvList) + + print(" ") + print("% FFD_NACELLE (RHO)") + + iVariable = 0 + dvList = "DEFINITION_DV= " + for kIndex in range(options.kOrder): + for jIndex in range(1 + options.jOrder / 2): + for iIndex in range(options.iOrder): + iVariable = iVariable + 1 + dvList = ( + dvList + + "( 12, " + + str(options.scale) + + " | " + + options.marker + + " | " + ) + dvList = ( + dvList + + options.ffd_id + + ", " + + str(iIndex) + + ", " + + str(jIndex) + + ", " + + str(kIndex) + + ", 1.0, 0.0 )" + ) + if iVariable < ( + options.iOrder * (1 + options.jOrder / 2) * options.kOrder + ): + dvList = dvList + "; " + + print(dvList) + + print(" ") + print("% FFD_NACELLE (PHI)") + + iVariable = 0 + dvList = "DEFINITION_DV= " + for kIndex in range(options.kOrder): + for jIndex in range(1 + options.jOrder / 2): + for iIndex in range(options.iOrder): + iVariable = iVariable + 1 + dvList = ( + dvList + + "( 12, " + + str(options.scale) + + " | " + + options.marker + + " | " + ) + dvList = ( + dvList + + options.ffd_id + + ", " + + str(iIndex) + + ", " + + str(jIndex) + + ", " + + str(kIndex) + + ", 0.0, 1.0 )" + ) + if iVariable < ( + options.iOrder * (1 + options.jOrder / 2) * options.kOrder + ): + dvList = dvList + "; " + + print(dvList) + + print(" ") + print("% FFD_CONTROL_POINT (Z) (MULTIPLE INTERSECTIONS)") + + iVariable = 0 + dvList = "DEFINITION_DV= " + for kIndex in range(options.kOrder - 4): + for jIndex in range(options.jOrder - 4): + for iIndex in range(options.iOrder - 4): + iVariable = iVariable + 1 + dvList = ( + dvList + + "( 11, " + + str(options.scale) + + " | " + + options.marker + + " | " + ) + dvList = ( + dvList + + options.ffd_id + + ", " + + str(iIndex + 2) + + ", " + + str(jIndex + 2) + + ", " + + str(kIndex + 2) + + ", 0.0, 0.0, 1.0 )" + ) + if iVariable < (options.iOrder * (options.jOrder) * options.kOrder): + dvList = dvList + "; " + + print(dvList) + + print(" ") + print("% FFD_CAMBER, FFD_TWIST, FFD_THICKNESS") + + iVariable = 0 + dvList = "DEFINITION_DV= " for jIndex in range(options.jOrder): - for iIndex in range(options.iOrder): - iVariable = iVariable + 1 - dvList = dvList + "( 11, " + str(options.scale) + " | " + options.marker + " | " - dvList = dvList + options.ffd_id + ", " + str(iIndex) + ", " + str(jIndex) + ", " + str(kIndex) + ", 1.0, 0.0, 0.0 )" - if iVariable < (options.iOrder*(options.jOrder)*options.kOrder): - dvList = dvList + "; " - - - print(dvList) - - print(" ") - print("% FFD_CONTROL_POINT (Y)") - - iVariable = 0 - dvList = "DEFINITION_DV= " - for kIndex in range(options.kOrder): + for iIndex in range(options.iOrder): + iVariable = iVariable + 1 + dvList = ( + dvList + "( 14, " + str(options.scale) + " | " + options.marker + " | " + ) + dvList = ( + dvList + options.ffd_id + ", " + str(iIndex) + ", " + str(jIndex) + " )" + ) + dvList = dvList + "; " + iVariable = 0 for jIndex in range(options.jOrder): - for iIndex in range(options.iOrder): iVariable = iVariable + 1 - dvList = dvList + "( 11, " + str(options.scale) + " | " + options.marker + " | " - dvList = dvList + options.ffd_id + ", " + str(iIndex) + ", " + str(jIndex) + ", " + str(kIndex) + ", 0.0, 1.0, 0.0 )" - if iVariable < (options.iOrder*(options.jOrder)*options.kOrder): - dvList = dvList + "; " - - - print(dvList) - - print(" ") - print("% FFD_CONTROL_POINT (Z)") - - iVariable = 0 - dvList = "DEFINITION_DV= " - for kIndex in range(options.kOrder): + dvList = dvList + "( 15, " + str(options.scale) + " | " + options.marker + " | " + dvList = ( + dvList + options.ffd_id + ", " + str(jIndex) + ", " + options.axis + " )" + ) + if iVariable < (options.jOrder): + dvList = dvList + "; " + iVariable = 0 for jIndex in range(options.jOrder): - for iIndex in range(options.iOrder): - iVariable = iVariable + 1 - dvList = dvList + "( 11, " + str(options.scale) + " | " + options.marker + " | " - dvList = dvList + options.ffd_id + ", " + str(iIndex) + ", " + str(jIndex) + ", " + str(kIndex) + ", 0.0, 0.0, 1.0 )" - if iVariable < (options.iOrder*(options.jOrder)*options.kOrder): - dvList = dvList + "; " - - - print(dvList) - - print(" ") - print("% FFD_NACELLE (RHO)") - - iVariable = 0 - dvList = "DEFINITION_DV= " - for kIndex in range(options.kOrder): - for jIndex in range(1+options.jOrder/2): - for iIndex in range(options.iOrder): - iVariable = iVariable + 1 - dvList = dvList + "( 12, " + str(options.scale) + " | " + options.marker + " | " - dvList = dvList + options.ffd_id + ", " + str(iIndex) + ", " + str(jIndex) + ", " + str(kIndex) + ", 1.0, 0.0 )" - if iVariable < (options.iOrder*(1+options.jOrder/2)*options.kOrder): - dvList = dvList + "; " - - - print(dvList) - - print(" ") - print("% FFD_NACELLE (PHI)") - - iVariable = 0 - dvList = "DEFINITION_DV= " - for kIndex in range(options.kOrder): - for jIndex in range(1+options.jOrder/2): - for iIndex in range(options.iOrder): - iVariable = iVariable + 1 - dvList = dvList + "( 12, " + str(options.scale) + " | " + options.marker + " | " - dvList = dvList + options.ffd_id + ", " + str(iIndex) + ", " + str(jIndex) + ", " + str(kIndex) + ", 0.0, 1.0 )" - if iVariable < (options.iOrder*(1+options.jOrder/2)*options.kOrder): - dvList = dvList + "; " - - - print(dvList) - - print(" ") - print("% FFD_CONTROL_POINT (Z) (MULTIPLE INTERSECTIONS)") - - iVariable = 0 - dvList = "DEFINITION_DV= " - for kIndex in range(options.kOrder-4): - for jIndex in range(options.jOrder-4): - for iIndex in range(options.iOrder-4): - iVariable = iVariable + 1 - dvList = dvList + "( 11, " + str(options.scale) + " | " + options.marker + " | " - dvList = dvList + options.ffd_id + ", " + str(iIndex+2) + ", " + str(jIndex+2) + ", " + str(kIndex+2) + ", 0.0, 0.0, 1.0 )" - if iVariable < (options.iOrder*(options.jOrder)*options.kOrder): - dvList = dvList + "; " - - - print(dvList) - - print(" ") - print("% FFD_CAMBER, FFD_TWIST, FFD_THICKNESS") - - iVariable = 0 - dvList = "DEFINITION_DV= " - for jIndex in range(options.jOrder): - for iIndex in range(options.iOrder): - iVariable = iVariable + 1 - dvList = dvList + "( 14, " + str(options.scale) + " | " + options.marker + " | " - dvList = dvList + options.ffd_id + ", " + str(iIndex) + ", " + str(jIndex) + " )" - dvList = dvList + "; " - iVariable = 0 - for jIndex in range(options.jOrder): - iVariable = iVariable + 1 - dvList = dvList + "( 15, " + str(options.scale) + " | " + options.marker + " | " - dvList = dvList + options.ffd_id + ", " + str(jIndex) + ", " + options.axis + " )" - if iVariable < (options.jOrder): - dvList = dvList + "; " - iVariable = 0 - for jIndex in range(options.jOrder): - for iIndex in range(options.iOrder): - iVariable = iVariable + 1 - dvList = dvList + "( 16, " + str(options.scale) + " | " + options.marker + " | " - dvList = dvList + options.ffd_id + ", " + str(iIndex) + ", " + str(jIndex) + " )" - dvList = dvList + "; " - - - - print(dvList) + for iIndex in range(options.iOrder): + iVariable = iVariable + 1 + dvList = ( + dvList + "( 16, " + str(options.scale) + " | " + options.marker + " | " + ) + dvList = ( + dvList + options.ffd_id + ", " + str(iIndex) + ", " + str(jIndex) + " )" + ) + dvList = dvList + "; " + + print(dvList) if options.dim == 2: - print(" ") - print("% FFD_CONTROL_POINT_2D (X)") + print(" ") + print("% FFD_CONTROL_POINT_2D (X)") - iVariable = 0 - dvList = "DEFINITION_DV= " - for jIndex in range(options.jOrder): + iVariable = 0 + dvList = "DEFINITION_DV= " + for jIndex in range(options.jOrder): + for iIndex in range(options.iOrder): + iVariable = iVariable + 1 + dvList = ( + dvList + "( 19, " + str(options.scale) + " | " + options.marker + " | " + ) + dvList = ( + dvList + + options.ffd_id + + ", " + + str(iIndex) + + ", " + + str(jIndex) + + ", 1.0, 0.0 )" + ) + if iVariable < (options.iOrder * options.jOrder): + dvList = dvList + "; " + + print(dvList) + + print(" ") + print("% FFD_CONTROL_POINT_2D (Y)") + + iVariable = 0 + dvList = "DEFINITION_DV= " + for jIndex in range(options.jOrder): + for iIndex in range(options.iOrder): + iVariable = iVariable + 1 + dvList = ( + dvList + "( 19, " + str(options.scale) + " | " + options.marker + " | " + ) + dvList = ( + dvList + + options.ffd_id + + ", " + + str(iIndex) + + ", " + + str(jIndex) + + ", 0.0, 1.0 )" + ) + if iVariable < (options.iOrder * options.jOrder): + dvList = dvList + "; " + + print(dvList) + + print(" ") + print("FFD_CAMBER_2D & FFD_THICKNESS_2D") + + iVariable = 0 + dvList = "DEFINITION_DV= " for iIndex in range(options.iOrder): - iVariable = iVariable + 1 - dvList = dvList + "( 19, " + str(options.scale) + " | " + options.marker + " | " - dvList = dvList + options.ffd_id + ", " + str(iIndex) + ", " + str(jIndex) + ", 1.0, 0.0 )" - if iVariable < (options.iOrder*options.jOrder): + iVariable = iVariable + 1 + dvList = dvList + "( 20, " + str(options.scale) + " | " + options.marker + " | " + dvList = dvList + options.ffd_id + ", " + str(iIndex) + " )" dvList = dvList + "; " - - print(dvList) - - print(" ") - print("% FFD_CONTROL_POINT_2D (Y)") - - iVariable = 0 - dvList = "DEFINITION_DV= " - for jIndex in range(options.jOrder): + iVariable = 0 for iIndex in range(options.iOrder): - iVariable = iVariable + 1 - dvList = dvList + "( 19, " + str(options.scale) + " | " + options.marker + " | " - dvList = dvList + options.ffd_id + ", " + str(iIndex) + ", " + str(jIndex) + ", 0.0, 1.0 )" - if iVariable < (options.iOrder*options.jOrder): - dvList = dvList + "; " + iVariable = iVariable + 1 + dvList = dvList + "( 21, " + str(options.scale) + " | " + options.marker + " | " + dvList = dvList + options.ffd_id + ", " + str(iIndex) + " )" + if iVariable < (options.iOrder): + dvList = dvList + "; " - print(dvList) - - print(" ") - print("FFD_CAMBER_2D & FFD_THICKNESS_2D") - - iVariable = 0 - dvList = "DEFINITION_DV= " - for iIndex in range(options.iOrder): - iVariable = iVariable + 1 - dvList = dvList + "( 20, " + str(options.scale) + " | " + options.marker + " | " - dvList = dvList + options.ffd_id + ", " + str(iIndex) + " )" - dvList = dvList + "; " - iVariable = 0 - for iIndex in range(options.iOrder): - iVariable = iVariable + 1 - dvList = dvList + "( 21, " + str(options.scale) + " | " + options.marker + " | " - dvList = dvList + options.ffd_id + ", " + str(iIndex) + " )" - if iVariable < (options.iOrder): - dvList = dvList + "; " - - print(dvList) + print(dvList) diff --git a/SU2_PY/shape_optimization.py b/SU2_PY/shape_optimization.py index 34397c4e708..c5edaa09b7d 100755 --- a/SU2_PY/shape_optimization.py +++ b/SU2_PY/shape_optimization.py @@ -3,7 +3,7 @@ ## \file shape_optimization.py # \brief Python script for performing the shape optimization. # \author T. Economon, T. Lukaczyk, F. Palacios -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -27,124 +27,247 @@ import os, sys, shutil from optparse import OptionParser -sys.path.append(os.environ['SU2_RUN']) + +sys.path.append(os.environ["SU2_RUN"]) import SU2 # ------------------------------------------------------------------- # Main # ------------------------------------------------------------------- + def main(): - parser=OptionParser() - parser.add_option("-f", "--file", dest="filename", - help="read config from FILE", metavar="FILE") - parser.add_option("-r", "--name", dest="projectname", default='', - help="try to restart from project file NAME", metavar="NAME") - parser.add_option("-n", "--partitions", dest="partitions", default=1, - help="number of PARTITIONS", metavar="PARTITIONS") - parser.add_option("-g", "--gradient", dest="gradient", default="DISCRETE_ADJOINT", - help="Method for computing the GRADIENT (CONTINUOUS_ADJOINT, DISCRETE_ADJOINT, FINDIFF, NONE)", metavar="GRADIENT") - parser.add_option("-o", "--optimization", dest="optimization", default="SLSQP", - help="OPTIMIZATION techique (SLSQP, CG, BFGS, POWELL)", metavar="OPTIMIZATION") - parser.add_option("-q", "--quiet", dest="quiet", default="True", - help="True/False Quiet all SU2 output (optimizer output only)", metavar="QUIET") - parser.add_option("-z", "--zones", dest="nzones", default="1", - help="Number of Zones", metavar="ZONES") - - - (options, args)=parser.parse_args() + parser = OptionParser() + parser.add_option( + "-f", "--file", dest="filename", help="read config from FILE", metavar="FILE" + ) + parser.add_option( + "-r", + "--name", + dest="projectname", + default="", + help="try to restart from project file NAME", + metavar="NAME", + ) + parser.add_option( + "-n", + "--partitions", + dest="partitions", + default=1, + help="number of PARTITIONS", + metavar="PARTITIONS", + ) + parser.add_option( + "-g", + "--gradient", + dest="gradient", + default="DISCRETE_ADJOINT", + help="Method for computing the GRADIENT (CONTINUOUS_ADJOINT, DISCRETE_ADJOINT, FINDIFF, NONE)", + metavar="GRADIENT", + ) + parser.add_option( + "-o", + "--optimization", + dest="optimization", + default="SLSQP", + help="OPTIMIZATION techique (SLSQP, CG, BFGS, POWELL)", + metavar="OPTIMIZATION", + ) + parser.add_option( + "-q", + "--quiet", + dest="quiet", + default="True", + help="True/False Quiet all SU2 output (optimizer output only)", + metavar="QUIET", + ) + parser.add_option( + "-z", + "--zones", + dest="nzones", + default="1", + help="Number of Zones", + metavar="ZONES", + ) + + (options, args) = parser.parse_args() # process inputs - options.partitions = int( options.partitions ) - options.quiet = options.quiet.upper() == 'TRUE' - options.gradient = options.gradient.upper() - options.nzones = int( options.nzones ) - - sys.stdout.write('\n-------------------------------------------------------------------------\n') - sys.stdout.write('| ___ _ _ ___ |\n') - sys.stdout.write('| / __| | | |_ ) Release 7.5.1 \"Blackbird\" |\n') - sys.stdout.write('| \\__ \\ |_| |/ / |\n') - sys.stdout.write('| |___/\\___//___| Aerodynamic Shape Optimization Script |\n') - sys.stdout.write('| |\n') - sys.stdout.write('-------------------------------------------------------------------------\n') - sys.stdout.write('| SU2 Project Website: https://su2code.github.io |\n') - sys.stdout.write('| |\n') - sys.stdout.write('| The SU2 Project is maintained by the SU2 Foundation |\n') - sys.stdout.write('| (http://su2foundation.org) |\n') - sys.stdout.write('-------------------------------------------------------------------------\n') - sys.stdout.write('| Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) |\n') - sys.stdout.write('| |\n') - sys.stdout.write('| SU2 is free software; you can redistribute it and/or |\n') - sys.stdout.write('| modify it under the terms of the GNU Lesser General Public |\n') - sys.stdout.write('| License as published by the Free Software Foundation; either |\n') - sys.stdout.write('| version 2.1 of the License, or (at your option) any later version. |\n') - sys.stdout.write('| |\n') - sys.stdout.write('| SU2 is distributed in the hope that it will be useful, |\n') - sys.stdout.write('| but WITHOUT ANY WARRANTY; without even the implied warranty of |\n') - sys.stdout.write('| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |\n') - sys.stdout.write('| Lesser General Public License for more details. |\n') - sys.stdout.write('| |\n') - sys.stdout.write('| You should have received a copy of the GNU Lesser General Public |\n') - sys.stdout.write('| License along with SU2. If not, see . |\n') - sys.stdout.write('-------------------------------------------------------------------------\n') - - shape_optimization( options.filename , - options.projectname , - options.partitions , - options.gradient , - options.optimization , - options.quiet , - options.nzones ) + options.partitions = int(options.partitions) + options.quiet = options.quiet.upper() == "TRUE" + options.gradient = options.gradient.upper() + options.nzones = int(options.nzones) + + sys.stdout.write( + "\n-------------------------------------------------------------------------\n" + ) + sys.stdout.write( + "| ___ _ _ ___ |\n" + ) + sys.stdout.write( + '| / __| | | |_ ) Release 8.0.0 "Harrier" |\n' + ) + sys.stdout.write( + "| \\__ \\ |_| |/ / |\n" + ) + sys.stdout.write( + "| |___/\\___//___| Aerodynamic Shape Optimization Script |\n" + ) + sys.stdout.write( + "| |\n" + ) + sys.stdout.write( + "-------------------------------------------------------------------------\n" + ) + sys.stdout.write( + "| SU2 Project Website: https://su2code.github.io |\n" + ) + sys.stdout.write( + "| |\n" + ) + sys.stdout.write( + "| The SU2 Project is maintained by the SU2 Foundation |\n" + ) + sys.stdout.write( + "| (http://su2foundation.org) |\n" + ) + sys.stdout.write( + "-------------------------------------------------------------------------\n" + ) + sys.stdout.write( + "| Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) |\n" + ) + sys.stdout.write( + "| |\n" + ) + sys.stdout.write( + "| SU2 is free software; you can redistribute it and/or |\n" + ) + sys.stdout.write( + "| modify it under the terms of the GNU Lesser General Public |\n" + ) + sys.stdout.write( + "| License as published by the Free Software Foundation; either |\n" + ) + sys.stdout.write( + "| version 2.1 of the License, or (at your option) any later version. |\n" + ) + sys.stdout.write( + "| |\n" + ) + sys.stdout.write( + "| SU2 is distributed in the hope that it will be useful, |\n" + ) + sys.stdout.write( + "| but WITHOUT ANY WARRANTY; without even the implied warranty of |\n" + ) + sys.stdout.write( + "| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |\n" + ) + sys.stdout.write( + "| Lesser General Public License for more details. |\n" + ) + sys.stdout.write( + "| |\n" + ) + sys.stdout.write( + "| You should have received a copy of the GNU Lesser General Public |\n" + ) + sys.stdout.write( + "| License along with SU2. If not, see . |\n" + ) + sys.stdout.write( + "-------------------------------------------------------------------------\n" + ) + + shape_optimization( + options.filename, + options.projectname, + options.partitions, + options.gradient, + options.optimization, + options.quiet, + options.nzones, + ) + #: main() -def shape_optimization( filename , - projectname = '' , - partitions = 0 , - gradient = 'CONTINUOUS_ADJOINT' , - optimization = 'SLSQP' , - quiet = False , - nzones = 1 ): + +def shape_optimization( + filename, + projectname="", + partitions=0, + gradient="CONTINUOUS_ADJOINT", + optimization="SLSQP", + quiet=False, + nzones=1, +): # Config config = SU2.io.Config(filename) config.NUMBER_PART = partitions - config.NZONES = int( nzones ) - if quiet: config.CONSOLE = 'CONCISE' + config.NZONES = int(nzones) + if quiet: + config.CONSOLE = "CONCISE" config.GRADIENT_METHOD = gradient - its = int ( config.OPT_ITERATIONS ) # number of opt iterations - bound_upper = float ( config.OPT_BOUND_UPPER ) # variable bound to be scaled by the line search - bound_lower = float ( config.OPT_BOUND_LOWER ) # variable bound to be scaled by the line search - relax_factor = float ( config.OPT_RELAX_FACTOR ) # line search scale - gradient_factor = float ( config.OPT_GRADIENT_FACTOR ) # objective function and gradient scale - def_dv = config.DEFINITION_DV # complete definition of the desing variable - n_dv = sum(def_dv['SIZE']) # number of design variables - accu = float ( config.OPT_ACCURACY ) * gradient_factor # optimizer accuracy - x0 = [0.0]*n_dv # initial design - xb_low = [float(bound_lower)/float(relax_factor)]*n_dv # lower dv bound it includes the line search acceleration factor - xb_up = [float(bound_upper)/float(relax_factor)]*n_dv # upper dv bound it includes the line search acceleration fa - xb = list(zip(xb_low, xb_up)) # design bounds + its = int(config.OPT_ITERATIONS) # number of opt iterations + bound_upper = float( + config.OPT_BOUND_UPPER + ) # variable bound to be scaled by the line search + bound_lower = float( + config.OPT_BOUND_LOWER + ) # variable bound to be scaled by the line search + relax_factor = float(config.OPT_RELAX_FACTOR) # line search scale + gradient_factor = float( + config.OPT_GRADIENT_FACTOR + ) # objective function and gradient scale + def_dv = config.DEFINITION_DV # complete definition of the desing variable + n_dv = sum(def_dv["SIZE"]) # number of design variables + accu = float(config.OPT_ACCURACY) * gradient_factor # optimizer accuracy + x0 = [0.0] * n_dv # initial design + xb_low = [ + float(bound_lower) / float(relax_factor) + ] * n_dv # lower dv bound it includes the line search acceleration factor + xb_up = [ + float(bound_upper) / float(relax_factor) + ] * n_dv # upper dv bound it includes the line search acceleration fa + xb = list(zip(xb_low, xb_up)) # design bounds # State state = SU2.io.State() state.find_files(config) # add restart files to state.FILES - if config.get('TIME_DOMAIN', 'NO') == 'YES' and config.get('RESTART_SOL', 'NO') == 'YES' and gradient != 'CONTINUOUS_ADJOINT': - restart_name = config['RESTART_FILENAME'].split('.')[0] - restart_filename = restart_name + '_' + str(int(config['RESTART_ITER'])-1).zfill(5) + '.dat' - if not os.path.isfile(restart_filename): # throw, if restart files does not exist + if ( + config.get("TIME_DOMAIN", "NO") == "YES" + and config.get("RESTART_SOL", "NO") == "YES" + and gradient != "CONTINUOUS_ADJOINT" + ): + restart_name = config["RESTART_FILENAME"].split(".")[0] + restart_filename = ( + restart_name + "_" + str(int(config["RESTART_ITER"]) - 1).zfill(5) + ".dat" + ) + if not os.path.isfile( + restart_filename + ): # throw, if restart files does not exist sys.exit("Error: Restart file <" + restart_filename + "> not found.") - state['FILES']['RESTART_FILE_1'] = restart_filename + state["FILES"]["RESTART_FILE_1"] = restart_filename # use only, if time integration is second order - if config.get('TIME_MARCHING', 'NO') == 'DUAL_TIME_STEPPING-2ND_ORDER': - restart_filename = restart_name + '_' + str(int(config['RESTART_ITER'])-2).zfill(5) + '.dat' - if not os.path.isfile(restart_filename): # throw, if restart files does not exist + if config.get("TIME_MARCHING", "NO") == "DUAL_TIME_STEPPING-2ND_ORDER": + restart_filename = ( + restart_name + + "_" + + str(int(config["RESTART_ITER"]) - 2).zfill(5) + + ".dat" + ) + if not os.path.isfile( + restart_filename + ): # throw, if restart files does not exist sys.exit("Error: Restart file <" + restart_filename + "> not found.") - state['FILES']['RESTART_FILE_2'] =restart_filename - + state["FILES"]["RESTART_FILE_2"] = restart_filename # Project @@ -152,25 +275,25 @@ def shape_optimization( filename , project = SU2.io.load_data(projectname) project.config = config else: - project = SU2.opt.Project(config,state) + project = SU2.opt.Project(config, state) # Optimize - if optimization == 'SLSQP': - SU2.opt.SLSQP(project,x0,xb,its,accu) - if optimization == 'CG': - SU2.opt.CG(project,x0,xb,its,accu) - if optimization == 'BFGS': - SU2.opt.BFGS(project,x0,xb,its,accu) - if optimization == 'POWELL': - SU2.opt.POWELL(project,x0,xb,its,accu) - + if optimization == "SLSQP": + SU2.opt.SLSQP(project, x0, xb, its, accu) + if optimization == "CG": + SU2.opt.CG(project, x0, xb, its, accu) + if optimization == "BFGS": + SU2.opt.BFGS(project, x0, xb, its, accu) + if optimization == "POWELL": + SU2.opt.POWELL(project, x0, xb, its, accu) # rename project file if projectname: - shutil.move('project.pkl',projectname) + shutil.move("project.pkl", projectname) return project + #: shape_optimization() @@ -179,6 +302,5 @@ def shape_optimization( filename , # ------------------------------------------------------------------- # this is only accessed if running from command prompt -if __name__ == '__main__': +if __name__ == "__main__": main() - diff --git a/SU2_PY/topology_optimization.py b/SU2_PY/topology_optimization.py index c8b211c93e6..f8fcfd38885 100755 --- a/SU2_PY/topology_optimization.py +++ b/SU2_PY/topology_optimization.py @@ -2,7 +2,7 @@ ## \file topology_optimization.py # \brief Python script to drive SU2 in topology optimization. -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -45,26 +45,26 @@ ####### SETUP ####### -obj_scale = 1/1.25e-3 # scale the objective so that it starts at 1-4 -con_scale = 1/0.5 # 1 over upper bound (e.g. max volume) -var_scale = 1.0 # variable scale +obj_scale = 1 / 1.25e-3 # scale the objective so that it starts at 1-4 +con_scale = 1 / 0.5 # 1 over upper bound (e.g. max volume) +var_scale = 1.0 # variable scale # maximum number of iterations maxJev_t = 1000 # max iters for gray initialization, i.e. soft filter settings maxJev_i = 200 # num iters between updates of the filter settings and constraint penalty factor -nJev_u = 40 +nJev_u = 40 # tolerances -ftol_u = 1e-5 # during updates -ftol_f = 1e-7 # final iteration +ftol_u = 1e-5 # during updates +ftol_f = 1e-7 # final iteration # the exterior penalty method is used to impose the constraint, # this is the maximum constraint violation, below it the penalty factor is not increased -htol = 5e-3 +htol = 5e-3 # general options for L-BFGS-B -options={'disp': True, 'maxcor': 10, 'ftol': ftol_u, 'gtol': 1e-18} +options = {"disp": True, "maxcor": 10, "ftol": ftol_u, "gtol": 1e-18} # these are the commands for the direct and adjoint runs, modify to run parallel commands = ["SU2_CFD ", "SU2_CFD_AD "] @@ -85,344 +85,409 @@ ####### SU2 Driver ####### + class Driver: - def __init__(self,commands,inputFile,configFiles,outputFiles): - self._inputFile = inputFile - self._objValFile = "history.csv" - self._objDerFile = outputFiles[0] - self._conValFile = "history.csv" - self._conDerFile = outputFiles[1] - self._objValCommand = commands[0]+configFiles[0]+" > objval.stdout" - self._objDerCommand = commands[1]+configFiles[1]+" > objder.stdout" - self._conDerCommand = commands[1]+configFiles[2]+" > conval.stdout" - #end - - def _assert_isfinite(self,val): - if math.isinf(val) or math.isnan(val): - raise ValueError - #end - - def _write_input(self,x): - fid = open(self._inputFile,"w") - lines = ["\n"] - for val in x: - lines.append("0 0 0 0 0 "+str(val/var_scale)+"\n") - #end - fid.writelines(lines) - fid.close() - #end - - def obj_val(self,x): - # write inputs - self._write_input(x) - - # clear previous output and run direct solver - try: os.remove(self._objValFile) - except: pass - - try: - sp.call(self._objValCommand,shell=True) - with open(self._objValFile,"r") as fid: - lines = fid.readlines() - for col,name in enumerate(lines[0].split(",")): - if "TopComp" in name: - val = float(lines[1].split(",")[col]) - break - # the return code of mpirun is useless, we test the value of the function - self._assert_isfinite(val) - except: - raise RuntimeError("Objective function evaluation failed") - #end - - return val*obj_scale - #end - - def obj_der(self,x): - # inputs written in obj_val_driver - - # clear previous output and run direct solver - try: os.remove(self._objDerFile) - except: pass - N = x.shape[0] - y = np.ndarray((N,)) - - try: - # main command - sp.call(self._objDerCommand,shell=True) - - fid = open(self._objDerFile,"r"); lines = fid.readlines(); fid.close() - for i in range(N): - val = float(lines[i][0:-1]) - self._assert_isfinite(val) - y[i] = val*obj_scale/var_scale - #end - except: - raise RuntimeError("Objective gradient evaluation failed") - #end - - return y - #end - - def con_val(self,x): - # inputs written in obj_val_driver - - try: - with open(self._conValFile,"r") as fid: - lines = fid.readlines() - for col,name in enumerate(lines[0].split(",")): - if "VolFrac" in name: - val = float(lines[1].split(",")[col]) - break - self._assert_isfinite(val) - except: - raise RuntimeError("Constraint function evaluation failed") - #end - - return val*con_scale-1 - #end - - def con_der(self,x): - # inputs written in obj_val_driver - - # clear previous output and run solver - try: os.remove(self._conDerFile) - except: pass - N = x.shape[0] - y = np.ndarray((N,)) - - # read result - try: - sp.call(self._conDerCommand,shell=True) - - fid = open(self._conDerFile,"r"); lines = fid.readlines(); fid.close() - for i in range(N): - val = float(lines[i][0:-1]) - self._assert_isfinite(val) - y[i] = val*con_scale/var_scale - #end - except: - raise RuntimeError("Constraint function evaluation failed") - #end - - return y - #end -#end + def __init__(self, commands, inputFile, configFiles, outputFiles): + self._inputFile = inputFile + self._objValFile = "history.csv" + self._objDerFile = outputFiles[0] + self._conValFile = "history.csv" + self._conDerFile = outputFiles[1] + self._objValCommand = commands[0] + configFiles[0] + " > objval.stdout" + self._objDerCommand = commands[1] + configFiles[1] + " > objder.stdout" + self._conDerCommand = commands[1] + configFiles[2] + " > conval.stdout" + + # end + + def _assert_isfinite(self, val): + if math.isinf(val) or math.isnan(val): + raise ValueError + + # end + + def _write_input(self, x): + fid = open(self._inputFile, "w") + lines = ["\n"] + for val in x: + lines.append("0 0 0 0 0 " + str(val / var_scale) + "\n") + # end + fid.writelines(lines) + fid.close() + + # end + + def obj_val(self, x): + # write inputs + self._write_input(x) + + # clear previous output and run direct solver + try: + os.remove(self._objValFile) + except: + pass + + try: + sp.call(self._objValCommand, shell=True) + with open(self._objValFile, "r") as fid: + lines = fid.readlines() + for col, name in enumerate(lines[0].split(",")): + if "TopComp" in name: + val = float(lines[1].split(",")[col]) + break + # the return code of mpirun is useless, we test the value of the function + self._assert_isfinite(val) + except: + raise RuntimeError("Objective function evaluation failed") + # end + + return val * obj_scale + + # end + + def obj_der(self, x): + # inputs written in obj_val_driver + + # clear previous output and run direct solver + try: + os.remove(self._objDerFile) + except: + pass + N = x.shape[0] + y = np.ndarray((N,)) + + try: + # main command + sp.call(self._objDerCommand, shell=True) + + fid = open(self._objDerFile, "r") + lines = fid.readlines() + fid.close() + for i in range(N): + val = float(lines[i][0:-1]) + self._assert_isfinite(val) + y[i] = val * obj_scale / var_scale + # end + except: + raise RuntimeError("Objective gradient evaluation failed") + # end + + return y + + # end + + def con_val(self, x): + # inputs written in obj_val_driver + + try: + with open(self._conValFile, "r") as fid: + lines = fid.readlines() + for col, name in enumerate(lines[0].split(",")): + if "VolFrac" in name: + val = float(lines[1].split(",")[col]) + break + self._assert_isfinite(val) + except: + raise RuntimeError("Constraint function evaluation failed") + # end + + return val * con_scale - 1 + + # end + + def con_der(self, x): + # inputs written in obj_val_driver + + # clear previous output and run solver + try: + os.remove(self._conDerFile) + except: + pass + N = x.shape[0] + y = np.ndarray((N,)) + + # read result + try: + sp.call(self._conDerCommand, shell=True) + + fid = open(self._conDerFile, "r") + lines = fid.readlines() + fid.close() + for i in range(N): + val = float(lines[i][0:-1]) + self._assert_isfinite(val) + y[i] = val * con_scale / var_scale + # end + except: + raise RuntimeError("Constraint function evaluation failed") + # end + + return y + + # end + + +# end ####### Helpers ####### # updates the parameters in the config files -def update_settings(fnames,params): - for fname in fnames: - fid = open(fname,"r"); lines = fid.readlines(); fid.close() +def update_settings(fnames, params): + for fname in fnames: + fid = open(fname, "r") + lines = fid.readlines() + fid.close() - for param in params: - for i in range(len(lines)): - if lines[i].startswith(param.name()): - lines[i] = param.name()+"= "+repr(param.value())+"\n" - break - #end - #end - #end + for param in params: + for i in range(len(lines)): + if lines[i].startswith(param.name()): + lines[i] = param.name() + "= " + repr(param.value()) + "\n" + break + # end + # end + # end - fid = open(fname,"w"); fid.writelines(lines); fid.close() - #end -#end + fid = open(fname, "w") + fid.writelines(lines) + fid.close() + # end + + +# end # use a list as a function class ValueList: - def __init__(self,values): - self._values = values - self._ub = len(values)-1 - def val(self,idx): - return self._values[min(idx,self._ub)] -#end + def __init__(self, values): + self._values = values + self._ub = len(values) - 1 + + def val(self, idx): + return self._values[min(idx, self._ub)] + + +# end # helper class to hold parameters that are ramped class IncrParam: - def __init__(self,name,init,incr,maxi,func=None): - self._name = name - self._init = init - self._incr = incr - self._maxi = maxi - self._func = func - self._value = 0 - self.reset() - #end - - def name(self): - return self._name - - def reset(self): - self._value = self._init - - def update(self): - self._value = min(self._value+self._incr,self._maxi) - - def finished(self): - return self._value == self._maxi - - def value(self): - if self._func == None: - return self._value - else: - return self._func(self._value) - #end - #end -#end + def __init__(self, name, init, incr, maxi, func=None): + self._name = name + self._init = init + self._incr = incr + self._maxi = maxi + self._func = func + self._value = 0 + self.reset() + + # end + + def name(self): + return self._name + + def reset(self): + self._value = self._init + + def update(self): + self._value = min(self._value + self._incr, self._maxi) + + def finished(self): + return self._value == self._maxi + + def value(self): + if self._func == None: + return self._value + else: + return self._func(self._value) + # end + + # end + + +# end # Exterior penalty method wrapper class ExteriorPenaltyMethod: - def __init__(self,driver,r0=8,rmax=1024,c=2): - self._driver = driver - self._r = r0 - self._c = c - self._rmax = rmax - self._fval = 0 - self._hval = 0 - # timers - self._funTime = 0 - self._jacTime = 0 - #end - - def fun(self,x): - self._funTime -= time.time() - f = self._driver.obj_val(x) - h = self._driver.con_val(x) - self._funTime += time.time() - self._fval = f - self._hval = h - return f+self._r*max(0.0,h)*h - #end - - def jac(self,x): - self._jacTime -= time.time() - df = self._driver.obj_der(x) - dh = self._driver.con_der(x) - self._jacTime += time.time() - - # log current values of f and h - hisfile.write(repr(self._fval)+" "+repr(self._hval)+"\n") - hisfile.flush() - - return df+2*self._r*max(0.0,self._hval)*dh - #end - - def update(self): - self._r = min(self._r*self._c,self._rmax) - #end -#end + def __init__(self, driver, r0=8, rmax=1024, c=2): + self._driver = driver + self._r = r0 + self._c = c + self._rmax = rmax + self._fval = 0 + self._hval = 0 + # timers + self._funTime = 0 + self._jacTime = 0 + + # end + + def fun(self, x): + self._funTime -= time.time() + f = self._driver.obj_val(x) + h = self._driver.con_val(x) + self._funTime += time.time() + self._fval = f + self._hval = h + return f + self._r * max(0.0, h) * h + + # end + + def jac(self, x): + self._jacTime -= time.time() + df = self._driver.obj_der(x) + dh = self._driver.con_der(x) + self._jacTime += time.time() + + # log current values of f and h + hisfile.write(repr(self._fval) + " " + repr(self._hval) + "\n") + hisfile.flush() + + return df + 2 * self._r * max(0.0, self._hval) * dh + + # end + + def update(self): + self._r = min(self._r * self._c, self._rmax) + + # end + + +# end ####### RUN OPTIMIZATION ####### paramValues = ValueList(filterParam) -params = [IncrParam("TOPOL_OPTIM_KERNEL_PARAM",0,1,len(filterParam)-1,paramValues.val)] +params = [ + IncrParam("TOPOL_OPTIM_KERNEL_PARAM", 0, 1, len(filterParam) - 1, paramValues.val) +] -obj = ExteriorPenaltyMethod(Driver(commands,inputFile,fnames,outputFiles)) +obj = ExteriorPenaltyMethod(Driver(commands, inputFile, fnames, outputFiles)) -logfile = open("optimization.log","w") -hisfile = open("optimization.his","w") +logfile = open("optimization.log", "w") +hisfile = open("optimization.his", "w") line = "### Optimization Started ###\n" -print(line); logfile.write(line+"\n"); logfile.flush() +print(line) +logfile.write(line + "\n") +logfile.flush() totTime = -time.time() -nJacEval = 0; nFunEval = 0; itCount = 0; +nJacEval = 0 +nFunEval = 0 +itCount = 0 # initial values and bounds -fid = open(inputFile,"r"); N = len(fid.readlines())-1; fid.close() -x = np.ones((N,))*var_scale/con_scale +fid = open(inputFile, "r") +N = len(fid.readlines()) - 1 +fid.close() +x = np.ones((N,)) * var_scale / con_scale lb = np.zeros((N,)) -ub = np.ones((N,))*var_scale -bounds = np.array((lb,ub),float).transpose() +ub = np.ones((N,)) * var_scale +bounds = np.array((lb, ub), float).transpose() ## 1st Phase: Run with "gray" filter settings ## # get the constraint and function within some tolerance line = "1: Gray filter (initialization)" -print(line); logfile.write(line+"\n"); logfile.flush() +print(line) +logfile.write(line + "\n") +logfile.flush() -update_settings(fnames,params) +update_settings(fnames, params) success = False while nJacEval < maxJev_i: - options["maxiter"] = min(nJev_u,maxJev_i-nJacEval) - - optimum = scipy.optimize.minimize(obj.fun, x, method="L-BFGS-B", jac=obj.jac, - bounds=bounds, options=options) - itCount += 1 - x = optimum.x - nJacEval += optimum.nit - nFunEval += optimum.nfev - - line = " Iter {:d}: f= {:f} h= {:e} r= {:f} nfev= {:d} njev= {:d}".\ - format(itCount, obj._fval, obj._hval, obj._r, optimum.nfev, optimum.nit) - print(line); logfile.write(line+"\n"); logfile.flush() - - if obj._hval > htol: # increase penalty - obj.update() - elif optimum.success: # check convergence - success = True - break - else: # continue until convergence or maxJev_i - pass - #end -#end + options["maxiter"] = min(nJev_u, maxJev_i - nJacEval) + + optimum = scipy.optimize.minimize( + obj.fun, x, method="L-BFGS-B", jac=obj.jac, bounds=bounds, options=options + ) + itCount += 1 + x = optimum.x + nJacEval += optimum.nit + nFunEval += optimum.nfev + + line = " Iter {:d}: f= {:f} h= {:e} r= {:f} nfev= {:d} njev= {:d}".format( + itCount, obj._fval, obj._hval, obj._r, optimum.nfev, optimum.nit + ) + print(line) + logfile.write(line + "\n") + logfile.flush() + + if obj._hval > htol: # increase penalty + obj.update() + elif optimum.success: # check convergence + success = True + break + else: # continue until convergence or maxJev_i + pass + # end +# end tmp = inputFile.split(".") -shutil.copy(inputFile,tmp[0]+"_gray."+tmp[1]) +shutil.copy(inputFile, tmp[0] + "_gray." + tmp[1]) -if not(success): - line = " Initialization did not converge to desired tolerances" - print(line); logfile.write(line+"\n"); logfile.flush() -#end +if not (success): + line = " Initialization did not converge to desired tolerances" + print(line) + logfile.write(line + "\n") + logfile.flush() +# end ## 2nd Phase: Make filter more "black-white" ## line = "\n2: Black-White filter" -print(line); logfile.write(line+"\n"); logfile.flush() +print(line) +logfile.write(line + "\n") +logfile.flush() options["maxiter"] = nJev_u finalIter = False -while nJacEval < maxJev_t and not(finalIter): - finalIter = True - for i in range(len(params)): - params[i].update() - finalIter &= params[i].finished() - #end - update_settings(fnames,params) - if obj._hval > htol: obj.update() - - options["ftol"] = (ftol_u,ftol_f)[int(finalIter)] - options["maxiter"] = max(nJev_u,(maxJev_t-nJacEval)*int(finalIter)) - - optimum = scipy.optimize.minimize(obj.fun, x, method="L-BFGS-B", jac=obj.jac, - bounds=bounds, options=options) - itCount += 1 - x = optimum.x - nJacEval += optimum.nit - nFunEval += optimum.nfev - - line = " Iter {:d}: f= {:f} h= {:e} r= {:f} nfev= {:d} njev= {:d}".\ - format(itCount, obj._fval, obj._hval, obj._r, optimum.nfev, optimum.nit) - print(line); logfile.write(line+"\n"); logfile.flush() -#end +while nJacEval < maxJev_t and not (finalIter): + finalIter = True + for i in range(len(params)): + params[i].update() + finalIter &= params[i].finished() + # end + update_settings(fnames, params) + if obj._hval > htol: + obj.update() + + options["ftol"] = (ftol_u, ftol_f)[int(finalIter)] + options["maxiter"] = max(nJev_u, (maxJev_t - nJacEval) * int(finalIter)) + + optimum = scipy.optimize.minimize( + obj.fun, x, method="L-BFGS-B", jac=obj.jac, bounds=bounds, options=options + ) + itCount += 1 + x = optimum.x + nJacEval += optimum.nit + nFunEval += optimum.nfev + + line = " Iter {:d}: f= {:f} h= {:e} r= {:f} nfev= {:d} njev= {:d}".format( + itCount, obj._fval, obj._hval, obj._r, optimum.nfev, optimum.nit + ) + print(line) + logfile.write(line + "\n") + logfile.flush() +# end tmp = inputFile.split(".") -shutil.copy(inputFile,tmp[0]+"_bw."+tmp[1]) +shutil.copy(inputFile, tmp[0] + "_bw." + tmp[1]) success = finalIter and obj._hval < htol and optimum.success totTime += time.time() -line = "\n### Optimization Finished ###\n"+\ - "Summary: "+("Failure\n","Success\n")[int(success)]+\ - " fval: {:f} hval: {:e}\n".format(obj._fval,obj._hval)+\ - "Details:\n"+\ - " iter: {:d} ttot: {:f}s\n".format(itCount,totTime)+\ - " nfev: {:d} tfev: {:f}s\n".format(nFunEval,obj._funTime)+\ - " njev: {:d} tjev: {:f}s\n".format(nJacEval,obj._jacTime) -print(line); logfile.write(line+"\n") +line = ( + "\n### Optimization Finished ###\n" + + "Summary: " + + ("Failure\n", "Success\n")[int(success)] + + " fval: {:f} hval: {:e}\n".format(obj._fval, obj._hval) + + "Details:\n" + + " iter: {:d} ttot: {:f}s\n".format(itCount, totTime) + + " nfev: {:d} tfev: {:f}s\n".format(nFunEval, obj._funTime) + + " njev: {:d} tjev: {:f}s\n".format(nJacEval, obj._jacTime) +) +print(line) +logfile.write(line + "\n") logfile.close() hisfile.close() - diff --git a/SU2_PY/updateHistoryMap.py b/SU2_PY/updateHistoryMap.py index 8f4dca9972e..ffd29019261 100644 --- a/SU2_PY/updateHistoryMap.py +++ b/SU2_PY/updateHistoryMap.py @@ -3,7 +3,7 @@ ## \file updateHistoryMap.py # \brief Python script for updating the historyMap.py file. # \author T. Albring -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -26,79 +26,82 @@ # License along with SU2. If not, see . import os, pprint -su2_home = os.environ['SU2_HOME'] +su2_home = os.environ["SU2_HOME"] -fileList = ['CFlowOutput.cpp', -'CFlowIncOutput.cpp', -'CFlowCompOutput.cpp', -'CHeatOutput.cpp', -'CFlowCompFEMOutput.cpp', -'CElasticityOutput.cpp', -'CAdjFlowOutput.cpp', -'CAdjHeatOutput.cpp', -'CAdjFlowIncOutput.cpp', -'CAdjFlowCompOutput.cpp', -'CAdjElasticityOutput.cpp'] +fileList = [ + "CFlowOutput.cpp", + "CFlowIncOutput.cpp", + "CFlowCompOutput.cpp", + "CHeatOutput.cpp", + "CFlowCompFEMOutput.cpp", + "CElasticityOutput.cpp", + "CAdjFlowOutput.cpp", + "CAdjHeatOutput.cpp", + "CAdjFlowIncOutput.cpp", + "CAdjFlowCompOutput.cpp", + "CAdjElasticityOutput.cpp", +] + +fileList = [os.path.join(su2_home, "SU2_CFD/src/output/" + i) for i in fileList] -fileList = [os.path.join(su2_home, 'SU2_CFD/src/output/' + i) for i in fileList] def parse_output(files): outputFields = dict() for file in files: - print('Parsing ' + file) - f = open(file,'r') - while(1): - s = f.readline().strip(' ') + print("Parsing " + file) + f = open(file, "r") + while 1: + s = f.readline().strip(" ") if not s: break - if s.startswith('AddHistoryOutput('): - s = s.replace('AddHistoryOutput', '').strip('()').split(',') + if s.startswith("AddHistoryOutput("): + s = s.replace("AddHistoryOutput", "").strip("()").split(",") curOutputField = dict() name = s[0].strip(' ()"\n;') - curOutputField['HEADER'] = s[1].strip(' ()"\n;') - curOutputField['GROUP'] = s[3].strip(' ()"\n;') - curOutputField['DESCRIPTION'] = s[4].strip(' ()"\n;') + curOutputField["HEADER"] = s[1].strip(' ()"\n;') + curOutputField["GROUP"] = s[3].strip(' ()"\n;') + curOutputField["DESCRIPTION"] = s[4].strip(' ()"\n;') if len(s) == 6: - curOutputField['TYPE'] = s[5].strip(' ()"\n;').split('::')[1] + curOutputField["TYPE"] = s[5].strip(' ()"\n;').split("::")[1] else: - curOutputField['TYPE'] = 'DEFAULT' + curOutputField["TYPE"] = "DEFAULT" outputFields[name] = curOutputField f.close() addedOutputFields = dict() for field in outputFields: - if outputFields[field]['TYPE'] == 'COEFFICIENT': + if outputFields[field]["TYPE"] == "COEFFICIENT": curOutputField = dict() - name = 'D_' + field - curOutputField['HEADER'] = 'd[' + outputFields[field]['HEADER'] + ']' - curOutputField['GROUP'] = 'D_' + outputFields[field]['GROUP'] - curOutputField['TYPE'] = 'D_COEFFICIENT' - curOutputField['DESCRIPTION'] = 'Derivative value' + name = "D_" + field + curOutputField["HEADER"] = "d[" + outputFields[field]["HEADER"] + "]" + curOutputField["GROUP"] = "D_" + outputFields[field]["GROUP"] + curOutputField["TYPE"] = "D_COEFFICIENT" + curOutputField["DESCRIPTION"] = "Derivative value" addedOutputFields[name] = curOutputField - name = 'TAVG_' + field + name = "TAVG_" + field curOutputField = dict() - curOutputField['HEADER'] = 'tavg[' + outputFields[field]['HEADER'] + ']' - curOutputField['GROUP'] = 'TAVG_' + outputFields[field]['GROUP'] - curOutputField['TYPE'] = 'TAVG_COEFFICIENT' - curOutputField['DESCRIPTION'] = 'weighted time average value' + curOutputField["HEADER"] = "tavg[" + outputFields[field]["HEADER"] + "]" + curOutputField["GROUP"] = "TAVG_" + outputFields[field]["GROUP"] + curOutputField["TYPE"] = "TAVG_COEFFICIENT" + curOutputField["DESCRIPTION"] = "weighted time average value" addedOutputFields[name] = curOutputField - name = 'TAVG_D_' + field + name = "TAVG_D_" + field curOutputField = dict() - curOutputField['HEADER'] = 'dtavg[' + outputFields[field]['HEADER'] + ']' - curOutputField['GROUP'] = 'TAVG_D_' + outputFields[field]['GROUP'] - curOutputField['TYPE'] = 'TAVG_D_COEFFICIENT' - curOutputField['DESCRIPTION'] = 'weighted time average derivative value' + curOutputField["HEADER"] = "dtavg[" + outputFields[field]["HEADER"] + "]" + curOutputField["GROUP"] = "TAVG_D_" + outputFields[field]["GROUP"] + curOutputField["TYPE"] = "TAVG_D_COEFFICIENT" + curOutputField["DESCRIPTION"] = "weighted time average derivative value" addedOutputFields[name] = curOutputField - outputFields.update(addedOutputFields) - f = open(os.path.join(su2_home, 'SU2_PY/SU2/io/historyMap.py'), 'w') - f.write('history_header_map = ') + f = open(os.path.join(su2_home, "SU2_PY/SU2/io/historyMap.py"), "w") + f.write("history_header_map = ") pprint.pprint(outputFields, f) f.close() + parse_output(fileList) diff --git a/SU2_SOL/bin/.gitignore b/SU2_SOL/bin/.gitignore deleted file mode 100644 index fe891329eff..00000000000 --- a/SU2_SOL/bin/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Do not track compiled execuatables -SU2* diff --git a/SU2_SOL/include/SU2_SOL.hpp b/SU2_SOL/include/SU2_SOL.hpp index 8be627e7f17..5097dea4154 100644 --- a/SU2_SOL/include/SU2_SOL.hpp +++ b/SU2_SOL/include/SU2_SOL.hpp @@ -3,7 +3,7 @@ * \brief Headers of the main subroutines of the code SU2_SOL. * The subroutines and functions are in the SU2_SOL.cpp file. * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -26,7 +26,6 @@ * License along with SU2. If not, see . */ - #pragma once #include "../../Common/include/parallelization/mpi_structure.hpp" @@ -37,7 +36,7 @@ #include "../../Common/include/geometry/CPhysicalGeometry.hpp" #include "../../Common/include/CConfig.hpp" - -void WriteFiles(CConfig *config, CGeometry* geometry, CSolver** solver_container, COutput* output, unsigned long TimeIter); +void WriteFiles(CConfig* config, CGeometry* geometry, CSolver** solver_container, COutput* output, + unsigned long TimeIter); using namespace std; diff --git a/SU2_SOL/obj/Makefile.am b/SU2_SOL/obj/Makefile.am deleted file mode 100644 index 980499b9a53..00000000000 --- a/SU2_SOL/obj/Makefile.am +++ /dev/null @@ -1,52 +0,0 @@ -################################################################################ -# -# \file Makefile.am -# \brief Makefile for SU2_SOL -# \author M. Colonno, T. Economon, F. Palacios -# \version 7.5.1 "Blackbird" -# -# SU2 Project Website: https://su2code.github.io -# -# The SU2 Project is maintained by the SU2 Foundation -# (http://su2foundation.org) -# -# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) -# -# SU2 is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2.1 of the License, or (at your option) any later version. -# -# SU2 is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with SU2. If not, see . -# -################################################################################ - -AUTOMAKE_OPTIONS = subdir-objects -ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS} - -bin_PROGRAMS = ../bin/SU2_SOL - -___bin_SU2_SOL_SOURCES = \ - ../include/SU2_SOL.hpp \ - ../src/SU2_SOL.cpp - -___bin_SU2_SOL_CXXFLAGS = -___bin_SU2_SOL_LDADD = \ - ../../SU2_CFD/obj/libSU2Core.a \ - ../../Common/lib/libSU2.a - -# always link to built dependencies from ./externals -___bin_SU2_SOL_CXXFLAGS += @su2_externals_INCLUDES@ -___bin_SU2_SOL_LDADD += @su2_externals_LIBS@ -___bin_SU2_SOL_LDADD += @su2_externals_LIBPTHREAD@ - -# if BUILD_MUTATIONPP -___bin_SU2_SOL_CXXFLAGS += @MUTATIONPP_CXX@ -___bin_SU2_SOL_LDADD += @MUTATIONPP_LD@ -# endif diff --git a/SU2_SOL/src/SU2_SOL.cpp b/SU2_SOL/src/SU2_SOL.cpp index cf71364744e..4d26b1a4844 100644 --- a/SU2_SOL/src/SU2_SOL.cpp +++ b/SU2_SOL/src/SU2_SOL.cpp @@ -2,7 +2,7 @@ * \file SU2_SOL.cpp * \brief Main file for the solution export/conversion code (SU2_SOL). * \author F. Palacios, T. Economon - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -25,13 +25,11 @@ * License along with SU2. If not, see . */ - #include "../include/SU2_SOL.hpp" using namespace std; -int main(int argc, char *argv[]) { - +int main(int argc, char* argv[]) { unsigned short iZone, iInst; su2double StartTime = 0.0, StopTime = 0.0, UsedTime = 0.0; @@ -39,7 +37,7 @@ int main(int argc, char *argv[]) { /*--- MPI initialization ---*/ - SU2_MPI::Init(&argc,&argv); + SU2_MPI::Init(&argc, &argv); SU2_MPI::Comm MPICommunicator = SU2_MPI::GetComm(); const int rank = SU2_MPI::GetRank(); @@ -47,32 +45,35 @@ int main(int argc, char *argv[]) { /*--- Pointer to different structures that will be used throughout the entire code ---*/ - COutput **output = nullptr; - CGeometry ***geometry_container = nullptr; - CSolver ***solver_container = nullptr; - CConfig **config_container = nullptr; - CConfig *driver_config = nullptr; - unsigned short *nInst = nullptr; + COutput** output = nullptr; + CGeometry*** geometry_container = nullptr; + CSolver*** solver_container = nullptr; + CConfig** config_container = nullptr; + CConfig* driver_config = nullptr; + unsigned short* nInst = nullptr; /*--- Load in the number of zones and spatial dimensions in the mesh file (if no config file is specified, default.cfg is used) ---*/ - if (argc == 2 || argc == 3) { strcpy(config_file_name,argv[1]); } - else { strcpy(config_file_name, "default.cfg"); } + if (argc == 2 || argc == 3) { + strcpy(config_file_name, argv[1]); + } else { + strcpy(config_file_name, "default.cfg"); + } - CConfig *config = nullptr; + CConfig* config = nullptr; config = new CConfig(config_file_name, SU2_COMPONENT::SU2_SOL); const auto nZone = config->GetnZone(); /*--- Definition of the containers per zones ---*/ - solver_container = new CSolver**[nZone] (); - config_container = new CConfig*[nZone] (); - geometry_container = new CGeometry**[nZone] (); + solver_container = new CSolver**[nZone](); + config_container = new CConfig*[nZone](); + geometry_container = new CGeometry**[nZone](); nInst = new unsigned short[nZone]; driver_config = nullptr; - output = new COutput*[nZone] (); + output = new COutput*[nZone](); for (iZone = 0; iZone < nZone; iZone++) { nInst[iZone] = 1; @@ -92,21 +93,19 @@ int main(int argc, char *argv[]) { differential equation on a single block, unstructured mesh. ---*/ for (iZone = 0; iZone < nZone; iZone++) { - /*--- Definition of the configuration option class for all zones. In this constructor, the input configuration file is parsed and all options are read and stored. ---*/ - if (driver_config->GetnConfigFiles() > 0){ + if (driver_config->GetnConfigFiles() > 0) { strcpy(zone_file_name, driver_config->GetConfigFilename(iZone).c_str()); config_container[iZone] = new CConfig(driver_config, zone_file_name, SU2_COMPONENT::SU2_SOL, iZone, nZone, true); - } - else{ - config_container[iZone] = new CConfig(driver_config, config_file_name, SU2_COMPONENT::SU2_SOL, iZone, nZone, true); + } else { + config_container[iZone] = + new CConfig(driver_config, config_file_name, SU2_COMPONENT::SU2_SOL, iZone, nZone, true); } config_container[iZone]->SetMPICommunicator(MPICommunicator); - } /*--- Set the multizone part of the problem. ---*/ @@ -119,7 +118,6 @@ int main(int argc, char *argv[]) { /*--- Read the geometry for each zone ---*/ for (iZone = 0; iZone < nZone; iZone++) { - /*--- Determine whether or not the FEM solver is used, which decides the type of geometry classes that are instantiated. ---*/ const bool fem_solver = config_container[iZone]->GetFEMSolver(); @@ -131,8 +129,7 @@ int main(int argc, char *argv[]) { geometry_container[iZone] = new CGeometry*[nInst[iZone]]; solver_container[iZone] = new CSolver*[nInst[iZone]]; - for (iInst = 0; iInst < nInst[iZone]; iInst++){ - + for (iInst = 0; iInst < nInst[iZone]; iInst++) { /*--- Allocate solver. ---*/ solver_container[iZone][iInst] = nullptr; @@ -140,7 +137,7 @@ int main(int argc, char *argv[]) { /*--- Definition of the geometry class to store the primal grid in the partitioning process. ---*/ - CGeometry *geometry_aux = nullptr; + CGeometry* geometry_aux = nullptr; /*--- All ranks process the grid and call ParMETIS for partitioning ---*/ @@ -148,8 +145,10 @@ int main(int argc, char *argv[]) { /*--- Color the initial grid and set the send-receive domains (ParMETIS) ---*/ - if ( fem_solver ) geometry_aux->SetColorFEMGrid_Parallel(config_container[iZone]); - else geometry_aux->SetColorGrid_Parallel(config_container[iZone]); + if (fem_solver) + geometry_aux->SetColorFEMGrid_Parallel(config_container[iZone]); + else + geometry_aux->SetColorGrid_Parallel(config_container[iZone]); /*--- Allocate the memory of the current domain, and divide the grid between the nodes ---*/ @@ -157,15 +156,14 @@ int main(int argc, char *argv[]) { /*--- Build the grid data structures using the ParMETIS coloring. ---*/ - if( fem_solver ) { - switch( config_container[iZone]->GetKind_FEM_Flow() ) { + if (fem_solver) { + switch (config_container[iZone]->GetKind_FEM_Flow()) { case DG: { geometry_container[iZone][iInst] = new CMeshFEM_DG(geometry_aux, config_container[iZone]); break; } } - } - else { + } else { geometry_container[iZone][iInst] = new CPhysicalGeometry(geometry_aux, config_container[iZone]); } @@ -183,7 +181,7 @@ int main(int argc, char *argv[]) { /*--- Create the vertex structure (required for MPI) ---*/ - if (rank == MASTER_NODE) cout << "Identify vertices." <SetVertex(config_container[iZone]); /*--- Store the global to local mapping after preprocessing. ---*/ @@ -193,15 +191,15 @@ int main(int argc, char *argv[]) { /*--- Create the point-to-point MPI communication structures for the fvm solver. ---*/ - if (!fem_solver) geometry_container[iZone][iInst]->PreprocessP2PComms(geometry_container[iZone][iInst], config_container[iZone]); + if (!fem_solver) + geometry_container[iZone][iInst]->PreprocessP2PComms(geometry_container[iZone][iInst], config_container[iZone]); /* Test for a fem solver, because some more work must be done. */ if (fem_solver) { - /*--- Carry out a dynamic cast to CMeshFEM_DG, such that it is not needed to define all virtual functions in the base class CGeometry. ---*/ - CMeshFEM_DG *DGMesh = dynamic_cast(geometry_container[iZone][iInst]); + auto* DGMesh = dynamic_cast(geometry_container[iZone][iInst]); /*--- Determine the standard elements for the volume elements. ---*/ if (rank == MASTER_NODE) cout << "Creating standard volume elements." << endl; @@ -213,7 +211,6 @@ int main(int argc, char *argv[]) { DGMesh->CreateFaces(config_container[iZone]); } } - } const bool fsi = config_container[ZONE_0]->GetFSI_Simulation(); @@ -224,17 +221,15 @@ int main(int argc, char *argv[]) { StartTime = SU2_MPI::Wtime(); if (rank == MASTER_NODE) - cout << endl <<"------------------------- Solution Postprocessing -----------------------" << endl; + cout << endl << "------------------------- Solution Postprocessing -----------------------" << endl; /*--- Check whether this is an FSI, fluid unsteady, harmonic balance or structural dynamic simulation and call the solution merging routines accordingly.---*/ if (multizone) { - bool TimeDomain = driver_config->GetTime_Domain(); - if (TimeDomain){ - + if (TimeDomain) { su2double Physical_dt, Physical_t; unsigned long TimeIter = 0; bool StopCalc = false; @@ -243,83 +238,81 @@ int main(int argc, char *argv[]) { Physical_dt = driver_config->GetTime_Step(); /*--- Check for an unsteady restart. Update TimeIter if necessary. ---*/ - if (driver_config->GetRestart()){ + if (driver_config->GetRestart()) { TimeIter = driver_config->GetRestart_Iter(); } /*--- Instantiate the solvers for each zone. ---*/ - for (iZone = 0; iZone < nZone; iZone++){ + for (iZone = 0; iZone < nZone; iZone++) { config_container[iZone]->SetiInst(INST_0); config_container[iZone]->SetTimeIter(TimeIter); - solver_container[iZone][INST_0] = new CBaselineSolver(geometry_container[iZone][INST_0], config_container[iZone]); + solver_container[iZone][INST_0] = + new CBaselineSolver(geometry_container[iZone][INST_0], config_container[iZone]); - output[iZone] = new CBaselineOutput(config_container[iZone], geometry_container[iZone][INST_0]->GetnDim(), solver_container[iZone][INST_0]); + output[iZone] = new CBaselineOutput(config_container[iZone], geometry_container[iZone][INST_0]->GetnDim(), + solver_container[iZone][INST_0]); output[iZone]->PreprocessVolumeOutput(config_container[iZone]); output[iZone]->PreprocessHistoryOutput(config_container[iZone], false); - } /*--- Loop over the whole time domain ---*/ while (TimeIter < driver_config->GetnTime_Iter()) { - /*--- Check if the maximum time has been surpassed. ---*/ - Physical_t = (TimeIter+1)*Physical_dt; - if (Physical_t >= driver_config->GetMax_Time()) - StopCalc = true; - - if ((TimeIter+1 == driver_config->GetnTime_Iter()) || // The last time iteration - (StopCalc) || // We have surpassed the requested time - ((TimeIter == 0) || (TimeIter % config_container[ZONE_0]->GetVolumeOutputFrequency(0) == 0)) // The iteration has been requested - ){ - if (rank == MASTER_NODE) cout << "Writing the volume solution for time step " << TimeIter << ", t = " << Physical_t << " s ." << endl; + Physical_t = (TimeIter + 1) * Physical_dt; + if (Physical_t >= driver_config->GetMax_Time()) StopCalc = true; + + if ((TimeIter + 1 == driver_config->GetnTime_Iter()) || // The last time iteration + (StopCalc) || // We have surpassed the requested time + ((TimeIter == 0) || (TimeIter % config_container[ZONE_0]->GetVolumeOutputFrequency(0) == + 0)) // The iteration has been requested + ) { + if (rank == MASTER_NODE) + cout << "Writing the volume solution for time step " << TimeIter << ", t = " << Physical_t << " s ." + << endl; /*--- Load the restart for all the zones. ---*/ - for (iZone = 0; iZone < nZone; iZone++){ - + for (iZone = 0; iZone < nZone; iZone++) { /*--- Set the current iteration number in the config class. ---*/ config_container[iZone]->SetTimeIter(TimeIter); /*--- So far, only enabled for single-instance problems ---*/ config_container[iZone]->SetiInst(INST_0); - solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], TimeIter, true); + solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], + config_container[iZone], TimeIter, true); } - - for (iZone = 0; iZone < nZone; iZone++){ - - WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], output[iZone], TimeIter); - + for (iZone = 0; iZone < nZone; iZone++) { + WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], + output[iZone], TimeIter); } } TimeIter++; if (StopCalc) break; } - } - else { - + } else { /*--- Steady simulation: merge the solution files for each zone. ---*/ for (iZone = 0; iZone < nZone; iZone++) { config_container[iZone]->SetiInst(INST_0); /*--- Definition of the solution class ---*/ - solver_container[iZone][INST_0] = new CBaselineSolver(geometry_container[iZone][INST_0], config_container[iZone]); - solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], 0, true); - output[iZone] = new CBaselineOutput(config_container[iZone], geometry_container[iZone][INST_0]->GetnDim(), solver_container[iZone][INST_0]); + solver_container[iZone][INST_0] = + new CBaselineSolver(geometry_container[iZone][INST_0], config_container[iZone]); + solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], + config_container[iZone], 0, true); + output[iZone] = new CBaselineOutput(config_container[iZone], geometry_container[iZone][INST_0]->GetnDim(), + solver_container[iZone][INST_0]); output[iZone]->PreprocessVolumeOutput(config_container[iZone]); output[iZone]->PreprocessHistoryOutput(config_container[iZone], false); - } - for (iZone = 0; iZone < nZone; iZone++){ - - WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], output[iZone], 0); - + for (iZone = 0; iZone < nZone; iZone++) { + WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], + output[iZone], 0); } } - } - else if (fsi){ - - if (nZone < 2){ - SU2_MPI::Error("For multizone computations, please add the number of zones as a second argument for SU2_SOL.", CURRENT_FUNCTION); + } else if (fsi) { + if (nZone < 2) { + SU2_MPI::Error("For multizone computations, please add the number of zones as a second argument for SU2_SOL.", + CURRENT_FUNCTION); } su2double Physical_dt, Physical_t; @@ -328,32 +321,28 @@ int main(int argc, char *argv[]) { bool SolutionInstantiatedFlow = false, SolutionInstantiatedFEM = false; /*--- Check for an unsteady restart. Update ExtIter if necessary. ---*/ - if (config_container[ZONE_0]->GetRestart()){ + if (config_container[ZONE_0]->GetRestart()) { TimeIterFlow = config_container[ZONE_0]->GetRestart_Iter(); TimeIterFEM = config_container[ZONE_1]->GetRestart_Iter(); if (TimeIterFlow != TimeIterFEM) { - SU2_MPI::Error("For multizone computations, please add the number of zones as a second argument for SU2_SOL.", CURRENT_FUNCTION); - } - else { + SU2_MPI::Error("For multizone computations, please add the number of zones as a second argument for SU2_SOL.", + CURRENT_FUNCTION); + } else { TimeIter = TimeIterFlow; } } - while (TimeIter < config_container[ZONE_0]->GetnTime_Iter()) { - /*--- Check several conditions in order to merge the correct time step files. ---*/ Physical_dt = config_container[ZONE_0]->GetDelta_UnstTime(); - Physical_t = (TimeIter+1)*Physical_dt; - if (Physical_t >= config_container[ZONE_0]->GetTotal_UnstTime()) - StopCalc = true; + Physical_t = (TimeIter + 1) * Physical_dt; + if (Physical_t >= config_container[ZONE_0]->GetTotal_UnstTime()) StopCalc = true; - if ( - ((TimeIter+1 == config_container[ZONE_0]->GetnTime_Iter()) || + if (((TimeIter + 1 == config_container[ZONE_0]->GetnTime_Iter()) || ((TimeIter % config_container[ZONE_0]->GetVolumeOutputFrequency(0) == 0) && (TimeIter != 0) && - !((config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || - (config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND))) || + (config_container[ZONE_0]->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_1ST) && + (config_container[ZONE_0]->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_2ND)) || (StopCalc) || (((config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || (config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)) && @@ -361,13 +350,11 @@ int main(int argc, char *argv[]) { && - ((TimeIter+1 == config_container[ZONE_1]->GetnTime_Iter()) || - (StopCalc) || + ((TimeIter + 1 == config_container[ZONE_1]->GetnTime_Iter()) || (StopCalc) || ((config_container[ZONE_1]->GetTime_Domain()) && ((TimeIter == 0) || (TimeIter % config_container[ZONE_1]->GetVolumeOutputFrequency(0) == 0)))) - ){ - + ) { /*--- Set the current iteration number in the config class. ---*/ config_container[ZONE_0]->SetTimeIter(TimeIter); config_container[ZONE_1]->SetTimeIter(TimeIter); @@ -376,39 +363,47 @@ int main(int argc, char *argv[]) { /*--- For the fluid zone (ZONE_0) ---*/ /*--- Either instantiate the solution class or load a restart file. ---*/ - if (SolutionInstantiatedFlow == false && - (TimeIter == 0 || ((config_container[ZONE_0]->GetRestart() && (SU2_TYPE::Int(TimeIter) == SU2_TYPE::Int(config_container[ZONE_0]->GetRestart_Iter()))) || - TimeIter % config_container[ZONE_0]->GetVolumeOutputFrequency(0) == 0 || - TimeIter+1 == config_container[ZONE_0]->GetnTime_Iter()))) { - solver_container[ZONE_0][INST_0] = new CBaselineSolver(geometry_container[ZONE_0][INST_0], config_container[ZONE_0]); - output[ZONE_0] = new CBaselineOutput(config_container[ZONE_0], geometry_container[ZONE_0][INST_0]->GetnDim(), solver_container[ZONE_0][INST_0]); + if (!SolutionInstantiatedFlow && + (TimeIter == 0 || + ((config_container[ZONE_0]->GetRestart() && + (SU2_TYPE::Int(TimeIter) == SU2_TYPE::Int(config_container[ZONE_0]->GetRestart_Iter()))) || + TimeIter % config_container[ZONE_0]->GetVolumeOutputFrequency(0) == 0 || + TimeIter + 1 == config_container[ZONE_0]->GetnTime_Iter()))) { + solver_container[ZONE_0][INST_0] = + new CBaselineSolver(geometry_container[ZONE_0][INST_0], config_container[ZONE_0]); + output[ZONE_0] = new CBaselineOutput(config_container[ZONE_0], geometry_container[ZONE_0][INST_0]->GetnDim(), + solver_container[ZONE_0][INST_0]); output[ZONE_0]->PreprocessVolumeOutput(config_container[ZONE_0]); output[ZONE_0]->PreprocessHistoryOutput(config_container[ZONE_0], false); SolutionInstantiatedFlow = true; } - solver_container[ZONE_0][INST_0]->LoadRestart_FSI(geometry_container[ZONE_0][INST_0], config_container[ZONE_0], TimeIter); - + solver_container[ZONE_0][INST_0]->LoadRestart_FSI(geometry_container[ZONE_0][INST_0], config_container[ZONE_0], + TimeIter); /*--- For the structural zone (ZONE_1) ---*/ /*--- Either instantiate the solution class or load a restart file. ---*/ /*--- Either instantiate the solution class or load a restart file. ---*/ - if (SolutionInstantiatedFEM == false && - (TimeIter == 0 || ((config_container[ZONE_1]->GetRestart() && (SU2_TYPE::Int(TimeIter) == SU2_TYPE::Int(config_container[ZONE_1]->GetRestart_Iter()))) || - TimeIter % config_container[ZONE_1]->GetVolumeOutputFrequency(0) == 0 || - TimeIter+1 == config_container[ZONE_1]->GetnTime_Iter()))) { - solver_container[ZONE_1][INST_0] = new CBaselineSolver(geometry_container[ZONE_1][INST_0], config_container[ZONE_1]); - output[ZONE_1] = new CBaselineOutput(config_container[ZONE_1], geometry_container[ZONE_1][INST_0]->GetnDim(), solver_container[ZONE_1][INST_0]); + if (!SolutionInstantiatedFEM && + (TimeIter == 0 || + ((config_container[ZONE_1]->GetRestart() && + (SU2_TYPE::Int(TimeIter) == SU2_TYPE::Int(config_container[ZONE_1]->GetRestart_Iter()))) || + TimeIter % config_container[ZONE_1]->GetVolumeOutputFrequency(0) == 0 || + TimeIter + 1 == config_container[ZONE_1]->GetnTime_Iter()))) { + solver_container[ZONE_1][INST_0] = + new CBaselineSolver(geometry_container[ZONE_1][INST_0], config_container[ZONE_1]); + output[ZONE_1] = new CBaselineOutput(config_container[ZONE_1], geometry_container[ZONE_1][INST_0]->GetnDim(), + solver_container[ZONE_1][INST_0]); output[ZONE_1]->PreprocessVolumeOutput(config_container[ZONE_1]); SolutionInstantiatedFEM = true; } - solver_container[ZONE_1][INST_0]->LoadRestart_FSI(geometry_container[ZONE_1][INST_0], config_container[ZONE_1], TimeIter); + solver_container[ZONE_1][INST_0]->LoadRestart_FSI(geometry_container[ZONE_1][INST_0], config_container[ZONE_1], + TimeIter); if (rank == MASTER_NODE) cout << "Writing the volume solution for time step " << TimeIter << "." << endl; - for (iZone = 0; iZone < nZone; iZone++){ - - WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], output[iZone], TimeIter); - + for (iZone = 0; iZone < nZone; iZone++) { + WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], + output[iZone], TimeIter); } } @@ -417,70 +412,63 @@ int main(int argc, char *argv[]) { } } else if (fem_solver) { - if (config->GetTime_Domain()) { - /*--- Unsteady DG simulation: merge all unsteady time steps. First, find the frequency and total number of files to write. ---*/ su2double Physical_dt, Physical_t; unsigned long TimeIter = 0; bool StopCalc = false; - bool *SolutionInstantiated = new bool[nZone]; + bool* SolutionInstantiated = new bool[nZone]; - for (iZone = 0; iZone < nZone; iZone++) - SolutionInstantiated[iZone] = false; + for (iZone = 0; iZone < nZone; iZone++) SolutionInstantiated[iZone] = false; /*--- Check for an unsteady restart. Update ExtIter if necessary. ---*/ if (config_container[ZONE_0]->GetTime_Domain() && config_container[ZONE_0]->GetRestart()) TimeIter = config_container[ZONE_0]->GetRestart_Iter(); while (TimeIter < config_container[ZONE_0]->GetnTime_Iter()) { - /*--- Check several conditions in order to merge the correct time step files. ---*/ Physical_dt = config_container[ZONE_0]->GetDelta_UnstTime(); - Physical_t = (TimeIter+1)*Physical_dt; - if (Physical_t >= config_container[ZONE_0]->GetTotal_UnstTime()) - StopCalc = true; + Physical_t = (TimeIter + 1) * Physical_dt; + if (Physical_t >= config_container[ZONE_0]->GetTotal_UnstTime()) StopCalc = true; - if ((TimeIter+1 == config_container[ZONE_0]->GetnTime_Iter()) || + if ((TimeIter + 1 == config_container[ZONE_0]->GetnTime_Iter()) || ((TimeIter % config_container[ZONE_0]->GetVolumeOutputFrequency(0) == 0) && (TimeIter != 0) && !(config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING)) || (StopCalc) || ((config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::TIME_STEPPING) && ((TimeIter == 0) || (TimeIter % config_container[ZONE_0]->GetVolumeOutputFrequency(0) == 0)))) { + /*--- Read in the restart file for this time step ---*/ + for (iZone = 0; iZone < nZone; iZone++) { + /*--- Set the current iteration number in the config class. ---*/ + config_container[iZone]->SetTimeIter(TimeIter); - /*--- Read in the restart file for this time step ---*/ - for (iZone = 0; iZone < nZone; iZone++) { - - /*--- Set the current iteration number in the config class. ---*/ - config_container[iZone]->SetTimeIter(TimeIter); - - /*--- Either instantiate the solution class or load a restart file. ---*/ - if (SolutionInstantiated[iZone] == false && - (TimeIter == 0 || - (config_container[ZONE_0]->GetRestart() && ((long)TimeIter == SU2_TYPE::Int(config_container[ZONE_0]->GetRestart_Iter()) || - TimeIter % config_container[ZONE_0]->GetVolumeOutputFrequency(0) == 0 || - TimeIter+1 == config_container[ZONE_0]->GetnTime_Iter())))) { - - solver_container[iZone][INST_0] = new CBaselineSolver_FEM(geometry_container[iZone][INST_0], config_container[iZone]); - output[iZone] = new CBaselineOutput(config_container[ZONE_0], geometry_container[ZONE_0][INST_0]->GetnDim(), solver_container[ZONE_0][INST_0]); - output[iZone]->PreprocessVolumeOutput(config_container[ZONE_0]); - output[iZone]->PreprocessHistoryOutput(config_container[ZONE_0], false); - SolutionInstantiated[iZone] = true; - } - solver_container[iZone][INST_0]->LoadRestart(&geometry_container[iZone][INST_0], &solver_container[iZone], - config_container[iZone], (int)TimeIter, true); - } - - if (rank == MASTER_NODE) - cout << "Writing the volume solution for time step " << TimeIter << "." << endl; - - for (iZone = 0; iZone < nZone; iZone++){ + /*--- Either instantiate the solution class or load a restart file. ---*/ + if (!SolutionInstantiated[iZone] && + (TimeIter == 0 || (config_container[ZONE_0]->GetRestart() && + ((long)TimeIter == SU2_TYPE::Int(config_container[ZONE_0]->GetRestart_Iter()) || + TimeIter % config_container[ZONE_0]->GetVolumeOutputFrequency(0) == 0 || + TimeIter + 1 == config_container[ZONE_0]->GetnTime_Iter())))) { + solver_container[iZone][INST_0] = + new CBaselineSolver_FEM(geometry_container[iZone][INST_0], config_container[iZone]); + output[iZone] = + new CBaselineOutput(config_container[ZONE_0], geometry_container[ZONE_0][INST_0]->GetnDim(), + solver_container[ZONE_0][INST_0]); + output[iZone]->PreprocessVolumeOutput(config_container[ZONE_0]); + output[iZone]->PreprocessHistoryOutput(config_container[ZONE_0], false); + SolutionInstantiated[iZone] = true; + } + solver_container[iZone][INST_0]->LoadRestart(&geometry_container[iZone][INST_0], &solver_container[iZone], + config_container[iZone], (int)TimeIter, true); + } - WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], output[iZone], TimeIter); + if (rank == MASTER_NODE) cout << "Writing the volume solution for time step " << TimeIter << "." << endl; - } + for (iZone = 0; iZone < nZone; iZone++) { + WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], + output[iZone], TimeIter); + } } TimeIter++; @@ -488,97 +476,88 @@ int main(int argc, char *argv[]) { } } else { + /*--- Steady simulation: merge the single solution file. ---*/ - /*--- Steady simulation: merge the single solution file. ---*/ - - for (iZone = 0; iZone < nZone; iZone++) { - /*--- Definition of the solution class ---*/ - - solver_container[iZone][INST_0] = new CBaselineSolver_FEM(geometry_container[iZone][INST_0], config_container[iZone]); - output[iZone] = new CBaselineOutput(config_container[ZONE_0], geometry_container[ZONE_0][INST_0]->GetnDim(), solver_container[ZONE_0][INST_0]); - output[iZone]->PreprocessVolumeOutput(config_container[ZONE_0]); - output[iZone]->PreprocessHistoryOutput(config_container[ZONE_0], false); - solver_container[iZone][INST_0]->LoadRestart(&geometry_container[iZone][INST_0], &solver_container[iZone], config_container[iZone], 0, true); - } - - for (iZone = 0; iZone < nZone; iZone++){ + for (iZone = 0; iZone < nZone; iZone++) { + /*--- Definition of the solution class ---*/ - WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], output[iZone], 0); + solver_container[iZone][INST_0] = + new CBaselineSolver_FEM(geometry_container[iZone][INST_0], config_container[iZone]); + output[iZone] = new CBaselineOutput(config_container[ZONE_0], geometry_container[ZONE_0][INST_0]->GetnDim(), + solver_container[ZONE_0][INST_0]); + output[iZone]->PreprocessVolumeOutput(config_container[ZONE_0]); + output[iZone]->PreprocessHistoryOutput(config_container[ZONE_0], false); + solver_container[iZone][INST_0]->LoadRestart(&geometry_container[iZone][INST_0], &solver_container[iZone], + config_container[iZone], 0, true); + } + for (iZone = 0; iZone < nZone; iZone++) { + WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], + output[iZone], 0); + } } - } - - } - else { + } else { if (config_container[ZONE_0]->GetTime_Domain()) { - /*--- Unsteady simulation: merge all unsteady time steps. First, find the frequency and total number of files to write. ---*/ su2double Physical_dt, Physical_t; unsigned long TimeIter = 0; bool StopCalc = false; - bool *SolutionInstantiated = new bool[nZone]; + bool* SolutionInstantiated = new bool[nZone]; - for (iZone = 0; iZone < nZone; iZone++) - SolutionInstantiated[iZone] = false; + for (iZone = 0; iZone < nZone; iZone++) SolutionInstantiated[iZone] = false; /*--- Check for an unsteady restart. Update ExtIter if necessary. ---*/ if (config_container[ZONE_0]->GetTime_Domain() && config_container[ZONE_0]->GetRestart()) TimeIter = config_container[ZONE_0]->GetRestart_Iter(); while (TimeIter < config_container[ZONE_0]->GetnTime_Iter()) { - /*--- Check several conditions in order to merge the correct time step files. ---*/ Physical_dt = config_container[ZONE_0]->GetTime_Step(); - Physical_t = (TimeIter+1)*Physical_dt; - if (Physical_t >= config_container[ZONE_0]->GetMax_Time()) - StopCalc = true; + Physical_t = (TimeIter + 1) * Physical_dt; + if (Physical_t >= config_container[ZONE_0]->GetMax_Time()) StopCalc = true; - if ((TimeIter+1 == config_container[ZONE_0]->GetnTime_Iter()) || + if ((TimeIter + 1 == config_container[ZONE_0]->GetnTime_Iter()) || ((TimeIter % config_container[ZONE_0]->GetVolumeOutputFrequency(0) == 0) && (TimeIter != 0) && - !((config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || - (config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND))) || + (config_container[ZONE_0]->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_1ST) && + (config_container[ZONE_0]->GetTime_Marching() != TIME_MARCHING::DT_STEPPING_2ND)) || (StopCalc) || (((config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_1ST) || (config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::DT_STEPPING_2ND)) && ((TimeIter == 0) || (TimeIter % config_container[ZONE_0]->GetVolumeOutputFrequency(0) == 0)))) { + /*--- Read in the restart file for this time step ---*/ + for (iZone = 0; iZone < nZone; iZone++) { + /*--- Set the current iteration number in the config class. ---*/ + config_container[iZone]->SetTimeIter(TimeIter); + /*--- Either instantiate the solution class or load a restart file. ---*/ + if (!SolutionInstantiated[iZone] && + (TimeIter == 0 || (config_container[ZONE_0]->GetRestart() && + ((long)TimeIter == SU2_TYPE::Int(config_container[ZONE_0]->GetRestart_Iter()) || + TimeIter % config_container[ZONE_0]->GetVolumeOutputFrequency(0) == 0 || + TimeIter + 1 == config_container[ZONE_0]->GetnTime_Iter())))) { + solver_container[iZone][INST_0] = + new CBaselineSolver(geometry_container[iZone][INST_0], config_container[iZone]); + output[iZone] = new CBaselineOutput(config_container[iZone], geometry_container[iZone][INST_0]->GetnDim(), + solver_container[iZone][INST_0]); + output[iZone]->PreprocessVolumeOutput(config_container[iZone]); + output[iZone]->PreprocessHistoryOutput(config_container[iZone], false); + + SolutionInstantiated[iZone] = true; + } + config_container[iZone]->SetiInst(INST_0); + solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], + config_container[iZone], TimeIter, true); + } + if (rank == MASTER_NODE) cout << "Writing the volume solution for time step " << TimeIter << "." << endl; - /*--- Read in the restart file for this time step ---*/ - for (iZone = 0; iZone < nZone; iZone++) { - - /*--- Set the current iteration number in the config class. ---*/ - config_container[iZone]->SetTimeIter(TimeIter); - - /*--- Either instantiate the solution class or load a restart file. ---*/ - if (SolutionInstantiated[iZone] == false && - (TimeIter == 0 || (config_container[ZONE_0]->GetRestart() && ((long)TimeIter == SU2_TYPE::Int(config_container[ZONE_0]->GetRestart_Iter()) || - TimeIter % config_container[ZONE_0]->GetVolumeOutputFrequency(0) == 0 || - TimeIter+1 == config_container[ZONE_0]->GetnTime_Iter())))) { - solver_container[iZone][INST_0] = new CBaselineSolver(geometry_container[iZone][INST_0], config_container[iZone]); - output[iZone] = new CBaselineOutput(config_container[iZone], geometry_container[iZone][INST_0]->GetnDim(), solver_container[iZone][INST_0]); - output[iZone]->PreprocessVolumeOutput(config_container[iZone]); - output[iZone]->PreprocessHistoryOutput(config_container[iZone], false); - - SolutionInstantiated[iZone] = true; - } - config_container[iZone]->SetiInst(INST_0); - solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], TimeIter, true); - } - - if (rank == MASTER_NODE) - cout << "Writing the volume solution for time step " << TimeIter << "." << endl; - - for (iZone = 0; iZone < nZone; iZone++){ - - WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], output[iZone], TimeIter); - - } - - + for (iZone = 0; iZone < nZone; iZone++) { + WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], + output[iZone], TimeIter); + } } TimeIter++; @@ -588,19 +567,19 @@ int main(int argc, char *argv[]) { } else if (config_container[ZONE_0]->GetTime_Marching() == TIME_MARCHING::HARMONIC_BALANCE) { - /*--- Read in the restart file for this time step ---*/ for (iZone = 0; iZone < nZone; iZone++) { - - for (iInst = 0; iInst < nInst[iZone]; iInst++){ - + for (iInst = 0; iInst < nInst[iZone]; iInst++) { config_container[iZone]->SetiInst(iInst); config_container[iZone]->SetTimeIter(iInst); /*--- Either instantiate the solution class or load a restart file. ---*/ - solver_container[iZone][iInst] = new CBaselineSolver(geometry_container[iZone][iInst], config_container[iZone]); - solver_container[iZone][iInst]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], iInst, true); - output[iZone] = new CBaselineOutput(config_container[iZone], geometry_container[iZone][iInst]->GetnDim(), solver_container[iZone][iInst]); + solver_container[iZone][iInst] = + new CBaselineSolver(geometry_container[iZone][iInst], config_container[iZone]); + solver_container[iZone][iInst]->LoadRestart(geometry_container[iZone], &solver_container[iZone], + config_container[iZone], iInst, true); + output[iZone] = new CBaselineOutput(config_container[iZone], geometry_container[iZone][iInst]->GetnDim(), + solver_container[iZone][iInst]); output[iZone]->PreprocessVolumeOutput(config_container[iZone]); output[iZone]->PreprocessHistoryOutput(config_container[iZone], false); @@ -609,17 +588,14 @@ int main(int argc, char *argv[]) { cout << "Storing the volume solution for time instance " << iInst << "." << endl; } - WriteFiles(config_container[iZone], geometry_container[iZone][iInst], &solver_container[iZone][iInst], output[iZone], iInst); - + WriteFiles(config_container[iZone], geometry_container[iZone][iInst], &solver_container[iZone][iInst], + output[iZone], iInst); } - } - } - else if (config_container[ZONE_0]->GetTime_Domain()){ - + else if (config_container[ZONE_0]->GetTime_Domain()) { /*--- Dynamic simulation: merge all unsteady time steps. First, find the frequency and total number of files to write. ---*/ @@ -628,117 +604,112 @@ int main(int argc, char *argv[]) { bool StopCalc = false; bool SolutionInstantiated = false; - /*--- Check for an dynamic restart (structural analysis). Update ExtIter if necessary. ---*/ - if (config_container[ZONE_0]->GetKind_Solver() == MAIN_SOLVER::FEM_ELASTICITY && config_container[ZONE_0]->GetRestart()) + if (config_container[ZONE_0]->GetKind_Solver() == MAIN_SOLVER::FEM_ELASTICITY && + config_container[ZONE_0]->GetRestart()) TimeIter = config_container[ZONE_0]->GetRestart_Iter(); while (TimeIter < config_container[ZONE_0]->GetnTime_Iter()) { - /*--- Check several conditions in order to merge the correct time step files. ---*/ /*--- If the solver is structural, the total and delta_t are obtained from different functions. ---*/ Physical_dt = config_container[ZONE_0]->GetTime_Step(); - Physical_t = (TimeIter+1)*Physical_dt; - if (Physical_t >= config_container[ZONE_0]->GetMax_Time()) - StopCalc = true; + Physical_t = (TimeIter + 1) * Physical_dt; + if (Physical_t >= config_container[ZONE_0]->GetMax_Time()) StopCalc = true; - if ((TimeIter+1 == config_container[ZONE_0]->GetnTime_Iter()) || - (StopCalc) || + if ((TimeIter + 1 == config_container[ZONE_0]->GetnTime_Iter()) || (StopCalc) || ((config_container[ZONE_0]->GetTime_Domain()) && ((TimeIter == 0) || (TimeIter % config_container[ZONE_0]->GetVolumeOutputFrequency(0) == 0)))) { + /*--- Set the current iteration number in the config class. ---*/ + config_container[ZONE_0]->SetTimeIter(TimeIter); + + /*--- Read in the restart file for this time step ---*/ + for (iZone = 0; iZone < nZone; iZone++) { + /*--- Either instantiate the solution class or load a restart file. ---*/ + if (!SolutionInstantiated && + (TimeIter == 0 || + ((config_container[ZONE_0]->GetRestart() && + (SU2_TYPE::Int(TimeIter) == SU2_TYPE::Int(config_container[ZONE_0]->GetRestart_Iter()))) || + TimeIter % config_container[ZONE_0]->GetVolumeOutputFrequency(0) == 0 || + TimeIter + 1 == config_container[ZONE_0]->GetnTime_Iter()))) { + solver_container[iZone][INST_0] = + new CBaselineSolver(geometry_container[iZone][INST_0], config_container[iZone]); + output[iZone] = new CBaselineOutput(config_container[iZone], geometry_container[iZone][INST_0]->GetnDim(), + solver_container[iZone][INST_0]); + output[iZone]->PreprocessVolumeOutput(config_container[iZone]); + output[iZone]->PreprocessHistoryOutput(config_container[iZone], false); + + SolutionInstantiated = true; + } + config_container[iZone]->SetiInst(INST_0); + solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], + config_container[iZone], TimeIter, true); + } - /*--- Set the current iteration number in the config class. ---*/ - config_container[ZONE_0]->SetTimeIter(TimeIter); - - /*--- Read in the restart file for this time step ---*/ - for (iZone = 0; iZone < nZone; iZone++) { - - /*--- Either instantiate the solution class or load a restart file. ---*/ - if (SolutionInstantiated == false && - (TimeIter == 0 || ((config_container[ZONE_0]->GetRestart() && (SU2_TYPE::Int(TimeIter) == SU2_TYPE::Int(config_container[ZONE_0]->GetRestart_Iter()))) || - TimeIter % config_container[ZONE_0]->GetVolumeOutputFrequency(0) == 0 || - TimeIter+1 == config_container[ZONE_0]->GetnTime_Iter()))) { - solver_container[iZone][INST_0] = new CBaselineSolver(geometry_container[iZone][INST_0], config_container[iZone]); - output[iZone] = new CBaselineOutput(config_container[iZone], geometry_container[iZone][INST_0]->GetnDim(), solver_container[iZone][INST_0]); - output[iZone]->PreprocessVolumeOutput(config_container[iZone]); - output[iZone]->PreprocessHistoryOutput(config_container[iZone], false); - - SolutionInstantiated = true; - } - config_container[iZone]->SetiInst(INST_0); - solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], TimeIter, true); - } - - if (rank == MASTER_NODE) - cout << "Writing the volume solution for time step " << TimeIter << "." << endl; - for (iZone = 0; iZone < nZone; iZone++){ - - WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], output[iZone], TimeIter); - - } + if (rank == MASTER_NODE) cout << "Writing the volume solution for time step " << TimeIter << "." << endl; + for (iZone = 0; iZone < nZone; iZone++) { + WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], + output[iZone], TimeIter); + } } TimeIter++; if (StopCalc) break; } - } + } else { - /*--- Steady simulation: merge the single solution file. ---*/ for (iZone = 0; iZone < nZone; iZone++) { config_container[iZone]->SetiInst(INST_0); /*--- Definition of the solution class ---*/ - solver_container[iZone][INST_0] = new CBaselineSolver(geometry_container[iZone][INST_0], config_container[iZone]); - solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], config_container[iZone], 0, true); - output[iZone] = new CBaselineOutput(config_container[iZone], geometry_container[iZone][INST_0]->GetnDim(), solver_container[iZone][INST_0]); + solver_container[iZone][INST_0] = + new CBaselineSolver(geometry_container[iZone][INST_0], config_container[iZone]); + solver_container[iZone][INST_0]->LoadRestart(geometry_container[iZone], &solver_container[iZone], + config_container[iZone], 0, true); + output[iZone] = new CBaselineOutput(config_container[iZone], geometry_container[iZone][INST_0]->GetnDim(), + solver_container[iZone][INST_0]); output[iZone]->PreprocessVolumeOutput(config_container[iZone]); output[iZone]->PreprocessHistoryOutput(config_container[iZone], false); - } - for (iZone = 0; iZone < nZone; iZone++){ - - WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], output[iZone], 0); - + for (iZone = 0; iZone < nZone; iZone++) { + WriteFiles(config_container[iZone], geometry_container[iZone][INST_0], &solver_container[iZone][INST_0], + output[iZone], 0); } } - } delete config; config = nullptr; if (rank == MASTER_NODE) - cout << endl <<"------------------------- Solver Postprocessing -------------------------" << endl; + cout << endl << "------------------------- Finalize Solver -------------------------" << endl; if (geometry_container != nullptr) { for (iZone = 0; iZone < nZone; iZone++) { - for (iInst = 0; iInst < nInst[iZone]; iInst++){ + for (iInst = 0; iInst < nInst[iZone]; iInst++) { if (geometry_container[iZone][iInst] != nullptr) { delete geometry_container[iZone][iInst]; } } - if (geometry_container[iZone] != nullptr) - delete [] geometry_container[iZone]; + if (geometry_container[iZone] != nullptr) delete[] geometry_container[iZone]; } - delete [] geometry_container; + delete[] geometry_container; } if (rank == MASTER_NODE) cout << "Deleted CGeometry container." << endl; if (solver_container != nullptr) { for (iZone = 0; iZone < nZone; iZone++) { - for (iInst = 0; iInst < nInst[iZone]; iInst++){ + for (iInst = 0; iInst < nInst[iZone]; iInst++) { if (solver_container[iZone][iInst] != nullptr) { delete solver_container[iZone][iInst]; } } - if (solver_container[iZone] != nullptr) - delete [] solver_container[iZone]; + if (solver_container[iZone] != nullptr) delete[] solver_container[iZone]; } - delete [] solver_container; + delete[] solver_container; } if (rank == MASTER_NODE) cout << "Deleted CSolver class." << endl; @@ -748,7 +719,7 @@ int main(int argc, char *argv[]) { delete config_container[iZone]; } } - delete [] config_container; + delete[] config_container; } if (rank == MASTER_NODE) cout << "Deleted CConfig container." << endl; @@ -758,7 +729,7 @@ int main(int argc, char *argv[]) { delete output[iZone]; } } - delete [] output; + delete[] output; } if (rank == MASTER_NODE) cout << "Deleted COutput class." << endl; @@ -769,16 +740,19 @@ int main(int argc, char *argv[]) { /*--- Compute/print the total time for performance benchmarking. ---*/ - UsedTime = StopTime-StartTime; + UsedTime = StopTime - StartTime; if (rank == MASTER_NODE) { - cout << "\nCompleted in " << fixed << UsedTime << " seconds on "<< size; - if (size == 1) cout << " core." << endl; else cout << " cores." << endl; + cout << "\nCompleted in " << fixed << UsedTime << " seconds on " << size; + if (size == 1) + cout << " core." << endl; + else + cout << " cores." << endl; } /*--- Exit the solver cleanly ---*/ if (rank == MASTER_NODE) - cout << endl <<"------------------------- Exit Success (SU2_SOL) ------------------------" << endl << endl; + cout << endl << "------------------------- Exit Success (SU2_SOL) ------------------------" << endl << endl; /*--- Finalize MPI parallelization ---*/ SU2_MPI::Finalize(); @@ -786,28 +760,26 @@ int main(int argc, char *argv[]) { return EXIT_SUCCESS; } -void WriteFiles(CConfig *config, CGeometry* geometry, CSolver** solver_container, COutput *output, unsigned long TimeIter){ - +void WriteFiles(CConfig* config, CGeometry* geometry, CSolver** solver_container, COutput* output, + unsigned long TimeIter) { /*--- Load history data (volume output might require some values) --- */ - output->SetHistory_Output(geometry, solver_container, config, TimeIter, 0, 0); + output->SetHistoryOutput(geometry, solver_container, config, TimeIter, 0, 0); /*--- Load the data --- */ - output->Load_Data(geometry, config, solver_container); + output->LoadData(geometry, config, solver_container); /*--- Set the filenames ---*/ - output->SetVolume_Filename(config->GetVolume_FileName()); + output->SetVolumeFilename(config->GetVolume_FileName()); - output->SetSurface_Filename(config->GetSurfCoeff_FileName()); + output->SetSurfaceFilename(config->GetSurfCoeff_FileName()); - for (unsigned short iFile = 0; iFile < config->GetnVolumeOutputFiles(); iFile++){ + for (unsigned short iFile = 0; iFile < config->GetnVolumeOutputFiles(); iFile++) { auto FileFormat = config->GetVolumeOutputFiles(); - if (FileFormat[iFile] != OUTPUT_TYPE::RESTART_ASCII && - FileFormat[iFile] != OUTPUT_TYPE::RESTART_BINARY && + if (FileFormat[iFile] != OUTPUT_TYPE::RESTART_ASCII && FileFormat[iFile] != OUTPUT_TYPE::RESTART_BINARY && FileFormat[iFile] != OUTPUT_TYPE::CSV) output->WriteToFile(config, geometry, FileFormat[iFile]); } - } diff --git a/TestCases/.gitignore b/TestCases/.gitignore index 315ff14f09e..a63f2d78d23 100644 --- a/TestCases/.gitignore +++ b/TestCases/.gitignore @@ -29,3 +29,6 @@ config_*.cfg *.tgz COPYING *.eqn + +# dragon files for flamelet models +*.drg diff --git a/TestCases/TestCase.py b/TestCases/TestCase.py index e1b8f70cacb..488865bc936 100644 --- a/TestCases/TestCase.py +++ b/TestCases/TestCase.py @@ -3,7 +3,7 @@ ## \file TestCase.py # \brief Python class for automated regression testing of SU2 examples # \author A. Aranake, A. Campos, T. Economon, T. Lukaczyk, S. Padron -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -28,12 +28,24 @@ import time, os, subprocess, datetime, sys import difflib import platform +import argparse def print_vals(vals, name="Values"): """Print an array of floats.""" print(name + ': ' + ', '.join('{:f}'.format(v) for v in vals)) +def is_float(test_string): + try: + float(test_string) + return True + except ValueError: + return False + +def parse_args(description: str): + parser = argparse.ArgumentParser(description=description) + parser.add_argument('--tsan', action='store_true', help='Run thread sanitizer tests. Requires a tsan-enabled SU2 build.') + return parser.parse_args() class TestCase: @@ -101,18 +113,21 @@ def __init__(self,tag_in): self.test_vals_aarch64 = [] self.cpu_arch = platform.processor() self.enabled_on_cpu_arch = ["x86_64", "aarch64"] + self.enabled_with_tsan = True self.command = self.Command() self.timeout = 0 self.tol = 0.0 + self.tol_file_percent = 0.0 + self.comp_threshold = 0.0 # Options for file-comparison tests self.reference_file = "of_grad.dat.ref" self.reference_file_aarch64 = "" self.test_file = "of_grad.dat" - def run_test(self): + def run_test(self, running_with_tsan=False): - if not self.is_enabled(): + if not self.is_enabled(running_with_tsan): return True print('==================== Start Test: %s ===================='%self.tag) @@ -127,7 +142,7 @@ def run_test(self): # Adjust the number of iterations in the config file if len(self.test_vals) != 0: - self.adjust_iter() + self.adjust_iter(running_with_tsan) # Check for disabling the restart if self.no_restart: @@ -168,54 +183,56 @@ def run_test(self): timed_out = True passed = False - # Examine the output - f = open(logfilename,'r') - output = f.readlines() delta_vals = [] sim_vals = [] - if not timed_out and len(self.test_vals) != 0: - start_solver = False - for line in output: - if not start_solver: # Don't bother parsing anything before --Start solver --- - if line.find('Begin Solver') > -1: - start_solver=True - else: # Found the --Begin solver --- line; parse the input - if self.new_output or self.multizone: - raw_data = line.strip() # Strip removes whitespaces head-tail - raw_data = raw_data[1:-1].split('|') # Remove heat-tail bars before splitting - else: - raw_data = line.split() - try: - iter_number = int(raw_data[0]) - if self.unsteady and not self.multizone and not self.new_output: - iter_number = int(raw_data[1]) - data = raw_data[len(raw_data) - len(self.test_vals):] - except ValueError: - continue - except IndexError: - continue - if iter_number == self.test_iter: # Found the iteration number we're checking for - iter_missing = False - if not len(self.test_vals)==len(data): # something went wrong... probably bad input - print("Error in test_vals!") - passed = False + if not running_with_tsan: # tsan findings result in non-zero return code, no need to examine the output + # Examine the output + f = open(logfilename,'r') + output = f.readlines() + if not timed_out and len(self.test_vals) != 0: + start_solver = False + for line in output: + if not start_solver: # Don't bother parsing anything before --Start solver --- + if line.find('Begin Solver') > -1: + start_solver=True + else: # Found the --Begin solver --- line; parse the input + if self.new_output or self.multizone: + raw_data = line.strip() # Strip removes whitespaces head-tail + raw_data = raw_data[1:-1].split('|') # Remove heat-tail bars before splitting + else: + raw_data = line.split() + try: + iter_number = int(raw_data[0]) + if self.unsteady and not self.multizone and not self.new_output: + iter_number = int(raw_data[1]) + data = raw_data[len(raw_data) - len(self.test_vals):] + except ValueError: + continue + except IndexError: + continue + + if iter_number == self.test_iter: # Found the iteration number we're checking for + iter_missing = False + if not len(self.test_vals)==len(data): # something went wrong... probably bad input + print("Error in test_vals!") + passed = False + break + for j in range(len(data)): + sim_vals.append( float(data[j]) ) + delta_vals.append( abs(float(data[j])-self.test_vals[j]) ) + if delta_vals[j] > self.tol: + exceed_tol = True + passed = False break - for j in range(len(data)): - sim_vals.append( float(data[j]) ) - delta_vals.append( abs(float(data[j])-self.test_vals[j]) ) - if delta_vals[j] > self.tol: - exceed_tol = True - passed = False - break - else: - iter_missing = True + else: + iter_missing = True - if not start_solver: - passed = False + if not start_solver: + passed = False - if iter_missing: - passed = False + if iter_missing: + passed = False # Write the test results #for j in output: @@ -243,7 +260,7 @@ def run_test(self): if not start_solver: print('ERROR: The code was not able to get to the "Begin solver" section.') - if iter_missing: + if not running_with_tsan and iter_missing: print('ERROR: The iteration number %d could not be found.'%self.test_iter) print('CPU architecture=%s' % self.cpu_arch) @@ -264,9 +281,9 @@ def run_test(self): os.chdir(workdir) return passed - def run_filediff(self): + def run_filediff(self, running_with_tsan=False): - if not self.is_enabled(): + if not self.is_enabled(running_with_tsan): return True print('==================== Start Test: %s ===================='%self.tag) @@ -274,7 +291,7 @@ def run_filediff(self): timed_out = False # Adjust the number of iterations in the config file - self.adjust_iter() + self.adjust_iter(running_with_tsan) self.adjust_test_data() @@ -313,44 +330,138 @@ def run_filediff(self): print("Output from the failed case:") subprocess.call(["cat", logfilename]) - if not timed_out and passed: - # Compare files - fromfile = self.reference_file - tofile = self.test_file - # Initial value s.t. will fail if it does not get to diff step - diff = '' - try: - fromdate = time.ctime(os.stat(fromfile).st_mtime) - fromlines = open(fromfile, 'U').readlines() + if not running_with_tsan: # thread sanitizer tests only check the return code, no need to compare outputs + diff_time_start = datetime.datetime.now() + if not timed_out and passed: + # Compare files + fromfile = self.reference_file + tofile = self.test_file + # Initial value s.t. will fail if it does not get to diff step + diff = '' try: - todate = time.ctime(os.stat(tofile).st_mtime) - tolines = open(tofile, 'U').readlines() - diff = list(difflib.unified_diff(fromlines, tolines, fromfile, tofile, fromdate, todate)) + fromdate = time.ctime(os.stat(fromfile).st_mtime) + fromlines = open(fromfile, 'U').readlines() + try: + todate = time.ctime(os.stat(tofile).st_mtime) + tolines = open(tofile, 'U').readlines() + + # If file tolerance is set to 0, make regular diff + if self.tol_file_percent == 0.0: + diff = list(difflib.unified_diff(fromlines, tolines, fromfile, tofile, fromdate, todate)) + + # Else test word by word with given tolerance + else: + + diff = [] + max_delta = 0 + compare_counter = 0 + ignore_counter = 0 + + # Assert that both files have the same number of lines + if len(fromlines) != len(tolines): + diff = ["ERROR: Number of lines in " + fromfile + " and " + tofile + " differ."] + passed = False + + # Loop through all lines + for i_line in range(0, len(fromlines)): + + if passed == False: break + + # Extract next line and split it + from_line = fromlines[i_line].split() + to_line = tolines[i_line].split() + + # Assert that both lines have the same number of words + if len(from_line) != len(to_line): + diff = ["ERROR: Number of words in line " + str(i_line+1) + " differ."] + passed = False + break + + # Loop through all words of one line + for i_word in range(0, len(from_line)): + + # Extract next word and strip whitespace and commas + from_word = from_line[i_word].strip().strip(',') + to_word = to_line[i_word].strip().strip(',') + + # Assert that words are either both numeric or both non-numeric + from_isfloat = is_float(from_word) + to_isfloat = is_float(to_word) + if from_isfloat != to_isfloat: + diff = ["ERROR: File entries '" + from_word + "' and '" + to_word + "' in line " + str(i_line+1) + ", word " + str(i_word+1) + " differ."] + passed = False + delta = 0.0 + max_delta = "Not applicable" + break + + # Make actual comparison + # Compare floats + if from_isfloat: + try: + # Only do a relative comparison when the threshold is met. + # This is to prevent large relative differences for very small numbers. + if (abs(float(from_word)) > self.comp_threshold): + delta = abs( (float(from_word) - float(to_word)) / float(from_word) ) * 100 + compare_counter += 1 + else: + delta = 0.0 + ignore_counter += 1 + + max_delta = max(max_delta, delta) + + except ZeroDivisionError: + ignore_counter += 1 + continue + + # Compare non-floats + else: + delta = 0.0 + compare_counter += 1 + if from_word != to_word: + diff = ["ERROR: File entries '" + from_word + "' and '" + to_word + "' in line " + str(i_line+1) + ", word " + str(i_word+1) + " differ."] + passed = False + max_delta = "Not applicable" + break + + if delta > self.tol_file_percent: + diff = ["ERROR: File entries '" + from_word + "' and '" + to_word + "' in line " + str(i_line+1) + ", word " + str(i_word+1) + " differ."] + passed = False + break + + except OSError: + print("OS error, most likely from missing reference file:", fromfile) + print("Current working directory contents:") + print(os.listdir(".")) except OSError: print("OS error, most likely from missing reference file:", fromfile) print("Current working directory contents:") print(os.listdir(".")) - except OSError: - print("OS error, most likely from missing reference file:", fromfile) - print("Current working directory contents:") - print(os.listdir(".")) + if (diff==[]): + passed=True + else: + for line in diff: + print(line[:-1]) + passed=False + else: + passed = False + # Report results + diff_time_stop = datetime.datetime.now() + diff_time = (diff_time_stop - diff_time_start).microseconds + print('CPU architecture: %s'%self.cpu_arch) + print('Test duration: %.2f min'%(running_time/60.0)) + print('Diff duration: %.2f sec'%(diff_time/1e6)) + print('Specified tolerance: ' + str(self.tol_file_percent) + '%') + print('Specified threshold: ' + str(self.comp_threshold)) - if (diff==[]): - passed=True - else: - for line in diff: - print(line[:-1]) - passed=False + if self.tol_file_percent != 0.0: + print('Compared entries: ' + str(compare_counter)) + print('Ignored entries: ' + str(ignore_counter)) + print('Maximum difference: ' + str(max_delta) + '%') - else: - passed = False - - print('CPU architecture=%s'%self.cpu_arch) - print('test duration: %.2f min'%(running_time/60.0)) print('==================== End Test: %s ====================\n'%self.tag) sys.stdout.flush() @@ -654,7 +765,7 @@ def run_def(self): except AttributeError: # popen.kill apparently fails on some versions of subprocess... the killall command should take care of things! pass timed_out = True - passed = False + passed = False # Examine the output f = open(logfilename,'r') @@ -688,7 +799,7 @@ def run_def(self): delta_vals.append( abs(float(data[j])-self.test_vals[j]) ) if delta_vals[j] > self.tol: exceed_tol = True - passed = False + passed = False break else: iter_missing = True @@ -739,7 +850,7 @@ def run_def(self): os.chdir(workdir) return passed - def adjust_iter(self): + def adjust_iter(self, running_with_tsan=False): # Read the cfg file workdir = os.getcwd() @@ -748,11 +859,25 @@ def adjust_iter(self): lines = file_in.readlines() file_in.close() + new_iter = self.test_iter + 1 + + if running_with_tsan: + + # detect restart + restart_iter = 0 + for line in lines: + if line.strip().split("=")[0].strip() == "RESTART_ITER": + restart_iter = int(line.strip().split("=")[1].strip()) + break + + if new_iter > restart_iter + 2: + new_iter = restart_iter + 2 + # Rewrite the file with a .autotest extension self.cfg_file = "%s.autotest"%self.cfg_file file_out = open(self.cfg_file,'w') file_out.write('% This file automatically generated by the regression script\n') - file_out.write('%% Number of iterations changed to %d\n'%(self.test_iter+1)) + file_out.write('%% Number of iterations changed to %d\n'%(new_iter)) if (self.multizone or self.new_output) and self.unsteady: adjust_string = "TIME_ITER" elif self.multizone: @@ -763,7 +888,7 @@ def adjust_iter(self): if not line.strip().split("=")[0].strip() == adjust_string: file_out.write(line) else: - file_out.write(adjust_string+"=%d\n"%(self.test_iter+1)) + file_out.write(adjust_string+"=%d\n"%(new_iter)) file_out.close() os.chdir(workdir) @@ -817,13 +942,18 @@ def disable_restart(self): return - def is_enabled(self): - is_enabled = self.cpu_arch in self.enabled_on_cpu_arch + def is_enabled(self, running_with_tsan=False): + is_enabled_on_arch = self.cpu_arch in self.enabled_on_cpu_arch - if not is_enabled: + if not is_enabled_on_arch: print('Ignoring test "%s" because it is not enabled for the current CPU architecture: %s' % (self.tag, self.cpu_arch)) - return is_enabled + tsan_compatible = not running_with_tsan or self.enabled_with_tsan + + if not tsan_compatible: + print('Ignoring test "%s" because it is not enabled to run with the thread sanitizer.' % self.tag) + + return is_enabled_on_arch and tsan_compatible def adjust_test_data(self): diff --git a/TestCases/aeroelastic/aeroelastic_NACA64A010.cfg b/TestCases/aeroelastic/aeroelastic_NACA64A010.cfg index 944406b2c93..883979e23e0 100644 --- a/TestCases/aeroelastic/aeroelastic_NACA64A010.cfg +++ b/TestCases/aeroelastic/aeroelastic_NACA64A010.cfg @@ -5,7 +5,7 @@ % Author: Santiago Padron % % Institution: Stanford University % % Date: 07-09-15 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -122,8 +122,6 @@ MG_DAMP_PROLONGATION= 0.75 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN ENTROPY_FIX_COEFF= 0.001 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -157,5 +155,5 @@ RESTART_FILENAME= restart_flow.dat VOLUME_FILENAME= flow SURFACE_FILENAME= surface_flow OUTPUT_WRT_FREQ= 1000 -SCREEN_OUTPUT= (TIME_ITER, INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG_ON_SURFACE, PLUNGE, PITCH) +SCREEN_OUTPUT= (TIME_ITER, INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG_ON_SURFACE, PLUNGE, PITCH) OUTPUT_FILES= (RESTART_ASCII) \ No newline at end of file diff --git a/TestCases/axisymmetric_rans/air_nozzle/air_nozzle_restart.cfg b/TestCases/axisymmetric_rans/air_nozzle/air_nozzle_restart.cfg index 0ba7296c7ef..bc6bd05fc6e 100644 --- a/TestCases/axisymmetric_rans/air_nozzle/air_nozzle_restart.cfg +++ b/TestCases/axisymmetric_rans/air_nozzle/air_nozzle_restart.cfg @@ -4,7 +4,7 @@ % Case description: Axisymmetric supersonic converging-diverging air nozzle % % Author: Florian Dittmann % % Date: 2021.12.02 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % @@ -93,4 +93,4 @@ SOLUTION_FILENAME= solution_flow.dat RESTART_FILENAME= restart_flow.dat OUTPUT_WRT_FREQ= 1000 SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_ENERGY, RMS_TKE, RMS_DISSIPATION, TOTAL_HEATFLUX, \ - RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, RMS_ADJ_TKE, RMS_ADJ_DISSIPATION, SENS_AOA, SENS_MACH) + RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, RMS_ADJ_TKE, RMS_ADJ_DISSIPATION) diff --git a/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg b/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg index faac3cd114f..96f0ea2e43d 100644 --- a/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg +++ b/TestCases/cont_adj_euler/naca0012/inv_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.02 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -70,9 +70,6 @@ MG_DAMP_PROLONGATION= 1.0 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN -VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -128,7 +125,7 @@ GRAD_OBJFUNC_FILENAME= of_grad.dat SURFACE_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint OUTPUT_WRT_FREQ= 250 -SCREEN_OUTPUT = (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_GEO, SENS_AOA, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) +SCREEN_OUTPUT = (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_GEO, SENS_AOA, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) HISTORY_OUTPUT= (ITER, RMS_RES, AERO_COEFF, SENSITIVITY) VOLUME_OUTPUT= (COORDINATES, SOLUTION, PRESSURE, TEMPERATURE, SENSITIVITY) OUTPUT_FILES=(RESTART_ASCII, PARAVIEW, SURFACE_CSV) diff --git a/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg b/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg index 7be820a3240..1a9bc3ac798 100644 --- a/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg +++ b/TestCases/cont_adj_euler/naca0012/inv_NACA0012_FD.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.02 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -69,9 +69,6 @@ MG_DAMP_PROLONGATION= 1.0 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN -VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -135,4 +132,4 @@ OUTPUT_FILES=(RESTART_ASCII, PARAVIEW) % OPT_OBJECTIVE= DRAG * 0.001 OPT_CONSTRAINT= ( LIFT > 0.327 ) * 0.001; ( MOMENT_Z > 0.0 ) * 0.001; ( AIRFOIL_THICKNESS > 0.12 ) * 0.001 -DEFINITION_DV= ( 30, 1.0 | airfoil | 0, 0.05 ); ( 30, 1.0 | airfoil | 0, 0.10 ); ( 30, 1.0 | airfoil | 0, 0.15 ); +DEFINITION_DV= ( 30, 1.0 | airfoil | 0, 0.05 ); ( 30, 1.0 | airfoil | 0, 0.10 ); ( 30, 1.0 | airfoil | 0, 0.15 ); diff --git a/TestCases/cont_adj_euler/naca0012/inv_NACA0012_discadj.cfg b/TestCases/cont_adj_euler/naca0012/inv_NACA0012_discadj.cfg index 49bda853bcd..e6b16f0575e 100644 --- a/TestCases/cont_adj_euler/naca0012/inv_NACA0012_discadj.cfg +++ b/TestCases/cont_adj_euler/naca0012/inv_NACA0012_discadj.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.02 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -51,9 +51,6 @@ ITER= 150 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN -VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT diff --git a/TestCases/cont_adj_euler/oneram6/inv_ONERAM6.cfg b/TestCases/cont_adj_euler/oneram6/inv_ONERAM6.cfg index d1d287831e9..087457f061c 100644 --- a/TestCases/cont_adj_euler/oneram6/inv_ONERAM6.cfg +++ b/TestCases/cont_adj_euler/oneram6/inv_ONERAM6.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2015.08.25 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -79,16 +79,12 @@ MG_DAMP_PROLONGATION= 0.9 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= NONE JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT % ---------------- ADJOINT-FLOW NUMERICAL METHOD DEFINITION -------------------% % CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_JST_SENSOR_COEFF= ( 0.0, 0.02 ) CFL_REDUCTION_ADJFLOW= 0.5 TIME_DISCRE_ADJFLOW= EULER_IMPLICIT diff --git a/TestCases/cont_adj_euler/wedge/inv_wedge_ROE.cfg b/TestCases/cont_adj_euler/wedge/inv_wedge_ROE.cfg index a3f3e9e2ecb..ea2d11081a4 100644 --- a/TestCases/cont_adj_euler/wedge/inv_wedge_ROE.cfg +++ b/TestCases/cont_adj_euler/wedge/inv_wedge_ROE.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2012.10.07 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -107,7 +107,7 @@ GRAD_OBJFUNC_FILENAME= of_grad.dat SURFACE_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint OUTPUT_WRT_FREQ= 250 -SCREEN_OUTPUT = (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_GEO, SENS_AOA) +SCREEN_OUTPUT = (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_GEO, SENS_AOA) OUTPUT_FILES=(RESTART_ASCII) % -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% diff --git a/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg b/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg index 40c8ba5ccee..d31759e32ca 100644 --- a/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg +++ b/TestCases/cont_adj_euler/wedge/inv_wedge_ROE_multiobj.cfg @@ -6,7 +6,7 @@ % Author: H.L. Kline, modified from inviscid wedge by Thomas D. Economon % % Institution: Stanford University % % Date: 2018.01.07 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/cont_adj_navierstokes/cylinder/lam_cylinder.cfg b/TestCases/cont_adj_navierstokes/cylinder/lam_cylinder.cfg index 067f9fd25bc..8ed53e331ac 100644 --- a/TestCases/cont_adj_navierstokes/cylinder/lam_cylinder.cfg +++ b/TestCases/cont_adj_navierstokes/cylinder/lam_cylinder.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.03.01 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/cont_adj_navierstokes/naca0012_sub/lam_NACA0012.cfg b/TestCases/cont_adj_navierstokes/naca0012_sub/lam_NACA0012.cfg index 7c0ac2cf859..674af9042f3 100644 --- a/TestCases/cont_adj_navierstokes/naca0012_sub/lam_NACA0012.cfg +++ b/TestCases/cont_adj_navierstokes/naca0012_sub/lam_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: Jul 18th, 2014 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/cont_adj_navierstokes/naca0012_trans/lam_NACA0012.cfg b/TestCases/cont_adj_navierstokes/naca0012_trans/lam_NACA0012.cfg index 919e841ad46..d2f99966354 100644 --- a/TestCases/cont_adj_navierstokes/naca0012_trans/lam_NACA0012.cfg +++ b/TestCases/cont_adj_navierstokes/naca0012_trans/lam_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: Jul 18th, 2014 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/cont_adj_rans/naca0012/turb_nasa.cfg b/TestCases/cont_adj_rans/naca0012/turb_nasa.cfg index 7b30c1faadc..92b3b7189b7 100644 --- a/TestCases/cont_adj_rans/naca0012/turb_nasa.cfg +++ b/TestCases/cont_adj_rans/naca0012/turb_nasa.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.03.01 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -58,9 +58,6 @@ LINEAR_SOLVER_ITER= 20 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN -VENKAT_LIMITER_COEFF= 0.01 JST_SENSOR_COEFF= ( 0.5, 0.005 ) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -75,8 +72,6 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % OBJECTIVE_FUNCTION= DRAG CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_SHARP_LIMITER_COEFF= 3.0 ADJ_JST_SENSOR_COEFF= ( 0.0, 0.002 ) CFL_REDUCTION_ADJFLOW= 0.25 diff --git a/TestCases/cont_adj_rans/naca0012/turb_nasa_binary.cfg b/TestCases/cont_adj_rans/naca0012/turb_nasa_binary.cfg index f1eca8847fa..46be0b5f825 100644 --- a/TestCases/cont_adj_rans/naca0012/turb_nasa_binary.cfg +++ b/TestCases/cont_adj_rans/naca0012/turb_nasa_binary.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.03.01 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -59,9 +59,6 @@ LINEAR_SOLVER_ITER= 20 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN -VENKAT_LIMITER_COEFF= 0.01 JST_SENSOR_COEFF= ( 0.5, 0.005 ) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -76,8 +73,6 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % OBJECTIVE_FUNCTION= DRAG CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_SHARP_LIMITER_COEFF= 3.0 ADJ_JST_SENSOR_COEFF= ( 0.0, 0.002 ) CFL_REDUCTION_ADJFLOW= 0.25 diff --git a/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg b/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg index 706099e9e7b..b82dcf516ca 100644 --- a/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg +++ b/TestCases/cont_adj_rans/oneram6/turb_ONERAM6.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.03.01 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -70,9 +70,6 @@ MG_DAMP_PROLONGATION= 0.7 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN -VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT diff --git a/TestCases/cont_adj_rans/rae2822/turb_SA_RAE2822.cfg b/TestCases/cont_adj_rans/rae2822/turb_SA_RAE2822.cfg index acb177feb6d..e7cad06fd8d 100644 --- a/TestCases/cont_adj_rans/rae2822/turb_SA_RAE2822.cfg +++ b/TestCases/cont_adj_rans/rae2822/turb_SA_RAE2822.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/control_surface/inv_ONERAM6_moving.cfg b/TestCases/control_surface/inv_ONERAM6_moving.cfg index bb09bb3f21b..b698bf27689 100644 --- a/TestCases/control_surface/inv_ONERAM6_moving.cfg +++ b/TestCases/control_surface/inv_ONERAM6_moving.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 09.07.2011 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -70,9 +70,6 @@ MG_DAMP_PROLONGATION= 0.9 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN -VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.04 ) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -80,8 +77,6 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % OBJECTIVE_FUNCTION= DRAG CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_SHARP_LIMITER_COEFF= 3.0 ADJ_JST_SENSOR_COEFF= ( 0.0, 0.04 ) CFL_REDUCTION_ADJFLOW= 0.5 diff --git a/TestCases/control_surface/inv_ONERAM6_setting.cfg b/TestCases/control_surface/inv_ONERAM6_setting.cfg index 1cbf9a9bfbc..c48c32c31e0 100644 --- a/TestCases/control_surface/inv_ONERAM6_setting.cfg +++ b/TestCases/control_surface/inv_ONERAM6_setting.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 09.07.2011 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -70,9 +70,6 @@ MG_DAMP_PROLONGATION= 0.9 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN -VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.04 ) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -80,8 +77,6 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % OBJECTIVE_FUNCTION= DRAG CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_SHARP_LIMITER_COEFF= 3.0 ADJ_JST_SENSOR_COEFF= ( 0.0, 0.04 ) CFL_REDUCTION_ADJFLOW= 0.5 diff --git a/TestCases/coupled_cht/comp_2d/cht_2d_3cylinders.cfg b/TestCases/coupled_cht/comp_2d/cht_2d_3cylinders.cfg index 01bdcc333fa..a81a7cea3c8 100644 --- a/TestCases/coupled_cht/comp_2d/cht_2d_3cylinders.cfg +++ b/TestCases/coupled_cht/comp_2d/cht_2d_3cylinders.cfg @@ -5,7 +5,7 @@ % Author: O. Burghardt % % Institution: Chair for Scientific Computing, TU Kaiserslautern % % Date: January 6, 2020 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/coupled_cht/comp_2d/flow_cylinder.cfg b/TestCases/coupled_cht/comp_2d/flow_cylinder.cfg index 3b7870d310b..218cc7fa470 100644 --- a/TestCases/coupled_cht/comp_2d/flow_cylinder.cfg +++ b/TestCases/coupled_cht/comp_2d/flow_cylinder.cfg @@ -49,8 +49,6 @@ LINEAR_SOLVER_ITER= 5 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= NONE TIME_DISCRE_FLOW= EULER_IMPLICIT % --------------------------- CONVERGENCE PARAMETERS --------------------------% diff --git a/TestCases/coupled_cht/disc_adj_incomp_2d/cht_2d_3cylinders.cfg b/TestCases/coupled_cht/disc_adj_incomp_2d/cht_2d_3cylinders.cfg index 38eb52af3e8..5c9455c03d4 100644 --- a/TestCases/coupled_cht/disc_adj_incomp_2d/cht_2d_3cylinders.cfg +++ b/TestCases/coupled_cht/disc_adj_incomp_2d/cht_2d_3cylinders.cfg @@ -5,7 +5,7 @@ % Author: O. Burghardt, T. Economon % % Institution: Chair for Scientific Computing, TU Kaiserslautern % % Date: August 8, 2019 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/coupled_cht/incomp_2d/cht_2d_3cylinders.cfg b/TestCases/coupled_cht/incomp_2d/cht_2d_3cylinders.cfg index 0db56062790..71f1d1f2ed0 100644 --- a/TestCases/coupled_cht/incomp_2d/cht_2d_3cylinders.cfg +++ b/TestCases/coupled_cht/incomp_2d/cht_2d_3cylinders.cfg @@ -5,7 +5,7 @@ % Author: O. Burghardt, T. Economon % % Institution: Chair for Scientific Computing, TU Kaiserslautern % % Date: August 8, 2019 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/coupled_cht/incomp_2d_unsteady/cht_2d_3cylinders.cfg b/TestCases/coupled_cht/incomp_2d_unsteady/cht_2d_3cylinders.cfg index bb06f67b7ee..f7192c82a64 100644 --- a/TestCases/coupled_cht/incomp_2d_unsteady/cht_2d_3cylinders.cfg +++ b/TestCases/coupled_cht/incomp_2d_unsteady/cht_2d_3cylinders.cfg @@ -5,7 +5,7 @@ % Author: O. Burghardt, T. Economon % % Institution: Chair for Scientific Computing, TU Kaiserslautern % % Date: August 8, 2019 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/ddes/flatplate/ddes_flatplate.cfg b/TestCases/ddes/flatplate/ddes_flatplate.cfg index 2e6c36b00a5..4fba06c6542 100644 --- a/TestCases/ddes/flatplate/ddes_flatplate.cfg +++ b/TestCases/ddes/flatplate/ddes_flatplate.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.10 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/deformation/brick_hex/def_brick_hex.cfg b/TestCases/deformation/brick_hex/def_brick_hex.cfg index 788b7289a06..6b7fd09138b 100755 --- a/TestCases/deformation/brick_hex/def_brick_hex.cfg +++ b/TestCases/deformation/brick_hex/def_brick_hex.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2016.05.31 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/deformation/brick_hex_rans/def_brick_hex_rans.cfg b/TestCases/deformation/brick_hex_rans/def_brick_hex_rans.cfg index b84e80b680d..ff84232a6d2 100755 --- a/TestCases/deformation/brick_hex_rans/def_brick_hex_rans.cfg +++ b/TestCases/deformation/brick_hex_rans/def_brick_hex_rans.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2016.05.31 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/deformation/brick_prism/def_brick_prism.cfg b/TestCases/deformation/brick_prism/def_brick_prism.cfg index 3f7d78b7d49..9399ba8f391 100755 --- a/TestCases/deformation/brick_prism/def_brick_prism.cfg +++ b/TestCases/deformation/brick_prism/def_brick_prism.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2016.05.31 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/deformation/brick_prism_rans/def_brick_prism_rans.cfg b/TestCases/deformation/brick_prism_rans/def_brick_prism_rans.cfg index bfd58255343..cf7a28e8dab 100755 --- a/TestCases/deformation/brick_prism_rans/def_brick_prism_rans.cfg +++ b/TestCases/deformation/brick_prism_rans/def_brick_prism_rans.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2016.05.31 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/deformation/brick_pyra/def_brick_pyra.cfg b/TestCases/deformation/brick_pyra/def_brick_pyra.cfg index 0deda077948..00061ed7a40 100755 --- a/TestCases/deformation/brick_pyra/def_brick_pyra.cfg +++ b/TestCases/deformation/brick_pyra/def_brick_pyra.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2016.05.31 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/deformation/brick_tets/def_brick_tets.cfg b/TestCases/deformation/brick_tets/def_brick_tets.cfg index 20a95629777..48c8017aa8f 100755 --- a/TestCases/deformation/brick_tets/def_brick_tets.cfg +++ b/TestCases/deformation/brick_tets/def_brick_tets.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2016.05.31 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/deformation/cylindrical_ffd/def_cylindrical.cfg b/TestCases/deformation/cylindrical_ffd/def_cylindrical.cfg index 26f700d59e4..129c7ca8761 100644 --- a/TestCases/deformation/cylindrical_ffd/def_cylindrical.cfg +++ b/TestCases/deformation/cylindrical_ffd/def_cylindrical.cfg @@ -5,13 +5,47 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% +% +FFD_TOLERANCE= 1E-10 +FFD_ITERATIONS= 1000 +% The definition of the box is in cartesian coordinates, the first face +% (first 4 points) is extruded along the x axis to connect it with the +% second face. The x-y plane marks theta = 0 and x-z marks theta = pi/2. +% Angles above pi/2 (negative y coord) are subtracted 2*pi which allows +% creating a ~360 degree box as shown here. +FFD_DEFINITION= (CYLINDER_BOX,\ + 0.6, -0.1, 1.5,\ + 0.6, -0.1, 0.5,\ + 0.6, 0.1, 0.5,\ + 0.6, 0.1, 1.5,\ + -0.6, -0.1, 1.5,\ + -0.6, -0.1, 0.5,\ + -0.6, 0.1, 0.5,\ + -0.6, 0.1, 1.5) +% Abovew We start by changing Z, which changes the radius and thus the cylindrical +% "i" is the radius, then we change Y, which changes the angle and thus "j" is for +% theta. Finally we change X and thus "k" is for the axial coordinate. +FFD_DEGREE= (1, 9, 4) +FFD_CONTINUITY= 1ST_DERIVATIVE +FFD_COORD_SYSTEM= CYLINDRICAL +% This is the origin of axis, the direction is always x. +FFD_AXIS= (0.0, 0.0, 0.0) + +% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% +% +DV_KIND= FFD_CONTROL_POINT +DV_MARKER= ( CYLINDER ) +DV_PARAM= ( CYLINDER_BOX, 0, 3, 2, 1.0, 0.0, 0.0 ) +DV_VALUE= 1.0 + % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % -SOLVER= EULER +SOLVER= EULER MATH_PROBLEM= DIRECT RESTART_SOL= NO SYSTEM_MEASUREMENTS= US @@ -22,7 +56,7 @@ MACH_NUMBER= 0.8 AOA= 0.0 SIDESLIP_ANGLE= 0.0 FREESTREAM_TEMPERATURE= 518.67 -FREESTREAM_PRESSURE= 2116.216 +FREESTREAM_PRESSURE= 2116.216 % ---------------------- REFERENCE VALUE DEFINITION ---------------------------% % @@ -46,7 +80,7 @@ MARKER_DESIGNING = ( CYLINDER ) % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % -NUM_METHOD_GRAD= GREEN_GAUSS +NUM_METHOD_GRAD= GREEN_GAUSS CFL_NUMBER= 1.0 CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.0, 1.0, 1.0, 10.0 ) @@ -72,13 +106,6 @@ MUSCL_FLOW= YES SLOPE_LIMITER_FLOW= VENKATAKRISHNAN TIME_DISCRE_FLOW= EULER_IMPLICIT -% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% -% -DV_KIND= FFD_CONTROL_POINT -DV_MARKER= ( CYLINDER ) -DV_PARAM= ( CYLINDER_BOX, 0, 3, 2, 1.0, 0.0, 0.0 ) -DV_VALUE= 1.0 - % ------------------------ GRID DEFORMATION PARAMETERS ------------------------% % DEFORM_LINEAR_SOLVER= FGMRES @@ -88,16 +115,6 @@ DEFORM_CONSOLE_OUTPUT= YES DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME DEFORM_LINEAR_SOLVER_ERROR= 1E-14 -% -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% -% -FFD_TOLERANCE= 1E-10 -FFD_ITERATIONS= 1000 -FFD_DEFINITION= (CYLINDER_BOX, -0.6, -0.1, 1.5, -0.6, -0.1, 0.5, -0.6, 0.1, 0.5, -0.6, 0.1, 1.5, 0.6, -0.1, 1.5, 0.6, -0.1, 0.5, 0.6, 0.1, 0.5, 0.6, 0.1, 1.5) -FFD_DEGREE= (1, 9, 4) -FFD_CONTINUITY= 1ST_DERIVATIVE -FFD_COORD_SYSTEM= CYLINDRICAL -FFD_AXIS= (0.0, 0.0, 0.0) - % --------------------------- CONVERGENCE PARAMETERS --------------------------% % ITER= 5 diff --git a/TestCases/deformation/intersection_prevention/def_intersect.cfg b/TestCases/deformation/intersection_prevention/def_intersect.cfg index 8cc980b6792..6df45ec5ce7 100644 --- a/TestCases/deformation/intersection_prevention/def_intersect.cfg +++ b/TestCases/deformation/intersection_prevention/def_intersect.cfg @@ -15,7 +15,7 @@ % Institution: % % Technische Universiteit Eindhoven % % Date: 2021.01.08 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% diff --git a/TestCases/deformation/naca0012/def_NACA0012.cfg b/TestCases/deformation/naca0012/def_NACA0012.cfg index 73834aa2ee6..e6675bba06b 100644 --- a/TestCases/deformation/naca0012/def_NACA0012.cfg +++ b/TestCases/deformation/naca0012/def_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -74,23 +74,19 @@ MG_DAMP_PROLONGATION= 1.0 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT % ---------------- ADJOINT-FLOW NUMERICAL METHOD DEFINITION -------------------% % CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_JST_SENSOR_COEFF= ( 0.5, 0.02 ) CFL_REDUCTION_ADJFLOW= 0.5 TIME_DISCRE_ADJFLOW= EULER_IMPLICIT % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % -DV_KIND= HICKS_HENNE +DV_KIND= HICKS_HENNE DV_MARKER= ( airfoil ) DV_PARAM= ( 1, 0.5 ) DV_VALUE= 0.1 diff --git a/TestCases/deformation/naca0012/surface_file_NACA0012.cfg b/TestCases/deformation/naca0012/surface_file_NACA0012.cfg index 18a61153927..b4b8b07f1db 100644 --- a/TestCases/deformation/naca0012/surface_file_NACA0012.cfg +++ b/TestCases/deformation/naca0012/surface_file_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -74,16 +74,12 @@ MG_DAMP_PROLONGATION= 1.0 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT % ---------------- ADJOINT-FLOW NUMERICAL METHOD DEFINITION -------------------% % CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_JST_SENSOR_COEFF= ( 0.5, 0.02 ) CFL_REDUCTION_ADJFLOW= 0.5 TIME_DISCRE_ADJFLOW= EULER_IMPLICIT diff --git a/TestCases/deformation/naca4412/def_NACA4412.cfg b/TestCases/deformation/naca4412/def_NACA4412.cfg index 6ad7b0cc33b..a1ceac5ca8b 100644 --- a/TestCases/deformation/naca4412/def_NACA4412.cfg +++ b/TestCases/deformation/naca4412/def_NACA4412.cfg @@ -6,7 +6,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2016.05.06 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/deformation/rae2822/def_RAE2822.cfg b/TestCases/deformation/rae2822/def_RAE2822.cfg index 831a14a2ee6..85bb3f0997c 100644 --- a/TestCases/deformation/rae2822/def_RAE2822.cfg +++ b/TestCases/deformation/rae2822/def_RAE2822.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/deformation/spherical_ffd/def_spherical.cfg b/TestCases/deformation/spherical_ffd/def_spherical.cfg index d8ee5fdb74d..e959c7026bf 100644 --- a/TestCases/deformation/spherical_ffd/def_spherical.cfg +++ b/TestCases/deformation/spherical_ffd/def_spherical.cfg @@ -5,13 +5,13 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % -SOLVER= EULER +SOLVER= EULER MATH_PROBLEM= DIRECT RESTART_SOL= NO SYSTEM_MEASUREMENTS= US @@ -22,7 +22,7 @@ MACH_NUMBER= 0.8 AOA= 0.0 SIDESLIP_ANGLE= 0.0 FREESTREAM_TEMPERATURE= 518.67 -FREESTREAM_PRESSURE= 2116.216 +FREESTREAM_PRESSURE= 2116.216 % ---------------------- REFERENCE VALUE DEFINITION ---------------------------% % @@ -46,7 +46,7 @@ MARKER_DESIGNING = ( SPHERE ) % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % -NUM_METHOD_GRAD= GREEN_GAUSS +NUM_METHOD_GRAD= GREEN_GAUSS CFL_NUMBER= 1.0 CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.0, 1.0, 1.0, 10.0 ) @@ -74,10 +74,10 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % -DV_KIND= FFD_CONTROL_POINT +DV_KIND= FFD_CONTROL_POINT DV_MARKER= ( SPHERE ) DV_PARAM= ( SPHERE_BOX, 0, 3, 2, 1.0, 0.0, 0.0 ) -DV_VALUE= 0.1 +DV_VALUE= 0.1 % ------------------------ GRID DEFORMATION PARAMETERS ------------------------% % @@ -108,7 +108,7 @@ CONV_STARTITER= 10 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % MESH_FILENAME= spherical.su2 -MESH_FORMAT= SU2 +MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 SOLUTION_FILENAME= solution_flow.dat SOLUTION_ADJ_FILENAME= solution_adj.dat diff --git a/TestCases/deformation/spherical_ffd/def_spherical_bspline.cfg b/TestCases/deformation/spherical_ffd/def_spherical_bspline.cfg index 2a1d1285d64..f1b1b02ca7f 100644 --- a/TestCases/deformation/spherical_ffd/def_spherical_bspline.cfg +++ b/TestCases/deformation/spherical_ffd/def_spherical_bspline.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg b/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg index 0adc1f99fef..9a1aacfe9db 100644 --- a/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg +++ b/TestCases/disc_adj_euler/arina2k/Arina2KRS.cfg @@ -6,7 +6,7 @@ % Author: Jairo Paes Cavalcante Filho [Based on T. Economon & M. Pini work] % % Institution: University of São Paulo % % Date: 8-JUL-2018 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -20,7 +20,7 @@ RESTART_SOL= NO DISCARD_INFILES= NO SYSTEM_MEASUREMENTS= SI -% -------------------- COMPRESSIBLE FREE-STREAM +% -------------------- COMPRESSIBLE FREE-STREAM % MACH_NUMBER= 0.2395 AOA= 0.0 @@ -94,21 +94,8 @@ OBJECTIVE_WEIGHT = 1.0 % ----------- SLOPE LIMITER AND DISSIPATION SENSOR DEFINITION -----------------% % -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN -MUSCL_TURB= NO -SLOPE_LIMITER_TURB= VENKATAKRISHNAN -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= VENKATAKRISHNAN -MUSCL_ADJTURB= NO -SLOPE_LIMITER_ADJTURB= VENKATAKRISHNAN -VENKAT_LIMITER_COEFF= 0.05 -ADJ_SHARP_LIMITER_COEFF= 3.0 -LIMITER_ITER= 999999 LAX_SENSOR_COEFF= 0.15 JST_SENSOR_COEFF= ( 0.5, 0.02 ) -ADJ_LAX_SENSOR_COEFF= 0.15 -ADJ_JST_SENSOR_COEFF= ( 0.5, 0.02 ) % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % diff --git a/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg b/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg index 6490cb0e66a..b1846a409dc 100644 --- a/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg +++ b/TestCases/disc_adj_euler/cylinder3D/inv_cylinder3D.cfg @@ -5,7 +5,7 @@ % Author: ___________________________________________________________________ % % Institution: ______________________________________________________________ % % Date: __________ % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -17,7 +17,7 @@ MATH_PROBLEM= DISCRETE_ADJOINT RESTART_SOL= NO DISCARD_INFILES= NO SYSTEM_MEASUREMENTS= SI -REORIENT_ELEMENTS= NO +REORIENT_ELEMENTS= NO HISTORY_OUTPUT= (ITER, RMS_RES, SENSITIVITY) % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% @@ -38,7 +38,7 @@ REF_DIMENSIONALIZATION= FREESTREAM_PRESS_EQ_ONE % -------------------- BOUNDARY CONDITION DEFINITION --------------------------% % MARKER_EULER= (CYLINDER_DOWN, CYLINDER_UP, SIDE, WALL) -INLET_TYPE= MASS_FLOW +INLET_TYPE= MASS_FLOW MARKER_INLET= ( IN, 1.22498, 102.089, 1.0, 0.0, 0.0 ) MARKER_OUTLET= ( OUT, 101325 ) @@ -48,7 +48,7 @@ MARKER_PLOTTING = ( CYLINDER_DOWN, CYLINDER_UP ) MARKER_MONITORING = ( CYLINDER_DOWN, CYLINDER_UP ) MARKER_DESIGNING = ( CYLINDER_DOWN, CYLINDER_UP ) MARKER_ANALYZE = ( IN, OUT ) -MARKER_ANALYZE_AVERAGE = AREA +MARKER_ANALYZE_AVERAGE = AREA % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % @@ -56,25 +56,12 @@ NUM_METHOD_GRAD= GREEN_GAUSS CFL_NUMBER= 10.0 CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.25, 50.0 ) -OBJECTIVE_FUNCTION= LIFT +OBJECTIVE_FUNCTION= LIFT % ----------- SLOPE LIMITER AND DISSIPATION SENSOR DEFINITION -----------------% % -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN -MUSCL_TURB= NO -SLOPE_LIMITER_TURB= VENKATAKRISHNAN -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= VENKATAKRISHNAN -MUSCL_ADJTURB= NO -SLOPE_LIMITER_ADJTURB= VENKATAKRISHNAN -VENKAT_LIMITER_COEFF= 0.05 -ADJ_SHARP_LIMITER_COEFF= 3.0 -LIMITER_ITER= 999999 LAX_SENSOR_COEFF= 0.15 JST_SENSOR_COEFF= ( 0.5, 0.02 ) -ADJ_LAX_SENSOR_COEFF= 0.15 -ADJ_JST_SENSOR_COEFF= ( 0.5, 0.02 ) % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % diff --git a/TestCases/disc_adj_euler/oneram6/inv_ONERAM6.cfg b/TestCases/disc_adj_euler/oneram6/inv_ONERAM6.cfg index 2d587524e59..fb67eb36588 100644 --- a/TestCases/disc_adj_euler/oneram6/inv_ONERAM6.cfg +++ b/TestCases/disc_adj_euler/oneram6/inv_ONERAM6.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios, Heather Kline % % Institution: Stanford University % % Date: 01.17.2017 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_fea/configAD_fem.cfg b/TestCases/disc_adj_fea/configAD_fem.cfg index 328e37ebb6b..0303c08aa0b 100644 --- a/TestCases/disc_adj_fea/configAD_fem.cfg +++ b/TestCases/disc_adj_fea/configAD_fem.cfg @@ -4,7 +4,7 @@ % Author: R.Sanchez % % Institution: Imperial College London % % Date: 2017.11.29 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SOLVER= ELASTICITY diff --git a/TestCases/disc_adj_fsi/Airfoil_2d/config.cfg b/TestCases/disc_adj_fsi/Airfoil_2d/config.cfg index 6b58ea8e026..c35de2da263 100755 --- a/TestCases/disc_adj_fsi/Airfoil_2d/config.cfg +++ b/TestCases/disc_adj_fsi/Airfoil_2d/config.cfg @@ -13,6 +13,6 @@ MESH_FILENAME= mesh.su2 OBJECTIVE_FUNCTION= CUSTOM_OBJFUNC -SCREEN_OUTPUT= OUTER_ITER, AVG_BGS_RES[0], AVG_BGS_RES[1], LINSOL_RESIDUAL[0], SENS_E[1], SENS_NU[1] +SCREEN_OUTPUT= OUTER_ITER, AVG_BGS_RES[0], AVG_BGS_RES[1], LINSOL_RESIDUAL[0], sens_e[1], SENS_NU_0[1] %WRT_ZONE_CONV=YES diff --git a/TestCases/disc_adj_fsi/Airfoil_2d/configFEA.cfg b/TestCases/disc_adj_fsi/Airfoil_2d/configFEA.cfg index 625809928eb..80502871ff2 100755 --- a/TestCases/disc_adj_fsi/Airfoil_2d/configFEA.cfg +++ b/TestCases/disc_adj_fsi/Airfoil_2d/configFEA.cfg @@ -7,7 +7,7 @@ REFERENCE_NODE= 234 REFERENCE_NODE_DISPLACEMENT= (0.0, 0.0) REFERENCE_NODE_PENALTY= 1.0 DESIGN_VARIABLE_FEA= YOUNG_MODULUS -CUSTOM_OBJFUNC= '1e2 * (1e3 * REFERENCE_NODE + TOPOL_COMPLIANCE)' +CUSTOM_OBJFUNC= '1e2 * (ref_node + TOPOL_COMPLIANCE)' % Solid properties ----------------------------------------------------- % MATERIAL_MODEL= NEO_HOOKEAN @@ -41,7 +41,10 @@ INCREMENTAL_LOAD= YES % In\Out --------------------------------------------------------------- % MESH_FILENAME= mesh.su2 MESH_FORMAT= SU2 - +% Scale SENS_E_0 to avoid a very small value in the regression test. +% Test using custom outputs for the adjoint and primal solver. +CUSTOM_OUTPUTS= 'sens_e : Function{1e8 * SENS_E_0};\ + ref_node : Function{1e3 * REFERENCE_NODE}' RESTART_SOL= NO SOLUTION_FILENAME= solution_solid.dat SOLUTION_ADJ_FILENAME= adjoint_solid.dat diff --git a/TestCases/disc_adj_fsi/config.cfg b/TestCases/disc_adj_fsi/config.cfg index 35cf049125d..044f409302c 100644 --- a/TestCases/disc_adj_fsi/config.cfg +++ b/TestCases/disc_adj_fsi/config.cfg @@ -9,6 +9,6 @@ MESH_FILENAME= mesh.su2 OBJECTIVE_FUNCTION = REFERENCE_GEOMETRY -SCREEN_OUTPUT= OUTER_ITER, AVG_BGS_RES[0], RMS_ADJ_DENSITY[0], SENS_E[1], SENS_NU[1] +SCREEN_OUTPUT= OUTER_ITER, AVG_BGS_RES[0], RMS_ADJ_DENSITY[0], SENS_E_0[1], SENS_NU_0[1] %WRT_ZONE_CONV= YES diff --git a/TestCases/disc_adj_fsi/configFEA.cfg b/TestCases/disc_adj_fsi/configFEA.cfg index 12d8a8e5db1..5a81e020ea5 100644 --- a/TestCases/disc_adj_fsi/configFEA.cfg +++ b/TestCases/disc_adj_fsi/configFEA.cfg @@ -4,7 +4,7 @@ % Author: R.Sanchez % % Institution: Imperial College London % % Date: 2017.11.29 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SOLVER= ELASTICITY diff --git a/TestCases/disc_adj_fsi/configFlow.cfg b/TestCases/disc_adj_fsi/configFlow.cfg index d0269c61ab0..682e7d2a108 100644 --- a/TestCases/disc_adj_fsi/configFlow.cfg +++ b/TestCases/disc_adj_fsi/configFlow.cfg @@ -4,7 +4,7 @@ % Author: R.Sanchez % % Institution: Imperial College London % % Date: 2017.11.29 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SOLVER= NAVIER_STOKES diff --git a/TestCases/disc_adj_fsi/dyn_fsi/grad_dv.opt.ref b/TestCases/disc_adj_fsi/dyn_fsi/grad_dv.opt.ref index 0bab88b33d0..b2e428bed5a 100644 --- a/TestCases/disc_adj_fsi/dyn_fsi/grad_dv.opt.ref +++ b/TestCases/disc_adj_fsi/dyn_fsi/grad_dv.opt.ref @@ -1,9 +1,9 @@ INDEX GRAD -0 -3.461460630332286e-03 -1 -1.841786279602490e-03 -2 -7.915536035493717e-04 -3 -2.739622003666185e-04 -4 -2.734869244046031e-04 -5 -7.881162775931060e-04 -6 -1.828978353197476e-03 -7 -3.427219493292633e-03 +0 -3.461460667601000e-03 +1 -1.841786311588663e-03 +2 -7.915536257748967e-04 +3 -2.739622082729717e-04 +4 -2.734869133461104e-04 +5 -7.881162428890206e-04 +6 -1.828978290516677e-03 +7 -3.427219398258316e-03 diff --git a/TestCases/disc_adj_fsi/dyn_fsi/grad_dv_aarch64.opt.ref b/TestCases/disc_adj_fsi/dyn_fsi/grad_dv_aarch64.opt.ref index 7b1a574aae0..28353aa54bd 100644 --- a/TestCases/disc_adj_fsi/dyn_fsi/grad_dv_aarch64.opt.ref +++ b/TestCases/disc_adj_fsi/dyn_fsi/grad_dv_aarch64.opt.ref @@ -1,9 +1,9 @@ INDEX GRAD -0 -3.461461010189737e-03 -1 -1.841786479954763e-03 -2 -7.915536887423713e-04 -3 -2.739622314151781e-04 -4 -2.734869609160976e-04 -5 -7.881163788847894e-04 -6 -1.828978579462100e-03 -7 -3.427219908218581e-03 +0 -3.461460506635121e-03 +1 -1.841786208967458e-03 +2 -7.915535677936552e-04 +3 -2.739621839525785e-04 +4 -2.734869125125620e-04 +5 -7.881162552527191e-04 +6 -1.828978304797359e-03 +7 -3.427219401431795e-03 diff --git a/TestCases/disc_adj_heat/disc_adj_heat.cfg b/TestCases/disc_adj_heat/disc_adj_heat.cfg index a2509c72d08..e4989879349 100644 --- a/TestCases/disc_adj_heat/disc_adj_heat.cfg +++ b/TestCases/disc_adj_heat/disc_adj_heat.cfg @@ -6,7 +6,7 @@ % Author: Ole Burghardt % % Institution: Chair for Scientific Computing, TU Kaiserslautern % % Date: November 26th, 2018 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -107,8 +107,6 @@ LINEAR_SOLVER_ITER= 10 CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES - JST_SENSOR_COEFF= ( 0.5, 0.05 ) TIME_DISCRE_FLOW= EULER_IMPLICIT diff --git a/TestCases/disc_adj_heat/primal.cfg b/TestCases/disc_adj_heat/primal.cfg index 4fb1d63fbd4..6ada129211c 100644 --- a/TestCases/disc_adj_heat/primal.cfg +++ b/TestCases/disc_adj_heat/primal.cfg @@ -5,7 +5,7 @@ % Author: Ole Burghardt % % Institution: Chair for Scientific Computing, TU Kaiserslautern % % Date: November 26th, 2018 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_incomp_euler/naca0012/incomp_NACA0012_disc.cfg b/TestCases/disc_adj_incomp_euler/naca0012/incomp_NACA0012_disc.cfg index 879ca518d47..d92f2bc75db 100644 --- a/TestCases/disc_adj_incomp_euler/naca0012/incomp_NACA0012_disc.cfg +++ b/TestCases/disc_adj_incomp_euler/naca0012/incomp_NACA0012_disc.cfg @@ -4,7 +4,7 @@ % Case description: Subsonic incompressible inviscid flow around a NACA0012 % % Author: Thomas D. Economon % % Date: 2018.10.30 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -60,8 +60,6 @@ MG_DAMP_PROLONGATION= 1.0 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= NONE VENKAT_LIMITER_COEFF= 0.001 JST_SENSOR_COEFF= ( 0.0, 0.01 ) TIME_DISCRE_FLOW= EULER_IMPLICIT diff --git a/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg b/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg index d61038a3126..dc328c88f05 100644 --- a/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg +++ b/TestCases/disc_adj_incomp_navierstokes/cylinder/heated_cylinder.cfg @@ -4,7 +4,7 @@ % Case description: Steady incompressible laminar flow past a heated cylinder % % Author: Thomas D. Economon % % Date: 2018.06.10 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg index 82523aefc64..56cb3331551 100755 --- a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg +++ b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sa.cfg @@ -5,7 +5,7 @@ % http://turbmodels.larc.nasa.gov/naca0012_val_sa.html % % Author: Thomas D. Economon & Francisco Palacios % % Date: 2018.06.10 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg index cca9e34bef1..aea7942ecef 100755 --- a/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg +++ b/TestCases/disc_adj_incomp_rans/naca0012/turb_naca0012_sst.cfg @@ -5,7 +5,7 @@ % http://turbmodels.larc.nasa.gov/naca0012_val_sst.html % % Author: Thomas D. Economon & Francisco Palacios % % Date: 2018.06.10 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -13,7 +13,6 @@ % SOLVER= INC_RANS KIND_TURB_MODEL= SST -MATH_PROBLEM= DISCRETE_ADJOINT RESTART_SOL= NO % -------------------- INCOMPRESSIBLE FREE-STREAM DEFINITION ------------------% @@ -45,11 +44,9 @@ MARKER_MONITORING= ( airfoil ) % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % NUM_METHOD_GRAD= GREEN_GAUSS -CFL_NUMBER= 25.0 +CFL_NUMBER= 1500.0 CFL_ADAPT= NO -CFL_ADAPT_PARAM= ( 1.5, 0.5, 25.0, 10000.0 ) -MAX_DELTA_TIME= 1E6 -RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) +QUASI_NEWTON_NUM_SAMPLES= 30 ITER= 99999 OBJECTIVE_FUNCTION= DRAG OBJECTIVE_WEIGHT = 1.0 @@ -67,7 +64,7 @@ LINEAR_SOLVER= FGMRES LINEAR_SOLVER_PREC= ILU LINEAR_SOLVER_ILU_FILL_IN= 0 LINEAR_SOLVER_ERROR= 1E-10 -LINEAR_SOLVER_ITER= 10 +LINEAR_SOLVER_ITER= 15 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % @@ -115,7 +112,7 @@ GRAD_OBJFUNC_FILENAME= of_grad.dat SURFACE_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint OUTPUT_WRT_FREQ= 250 -SCREEN_OUTPUT= (INNER_ITER, RMS_ADJ_PRESSURE, RMS_ADJ_TKE, RMS_ADJ_DISSIPATION, SENS_PRESS, SENS_AOA) +SCREEN_OUTPUT= (INNER_ITER, RMS_ADJ_PRESSURE, RMS_ADJ_TKE, RMS_ADJ_DISSIPATION, SENS_PRESS, SENS_AOA, LINSOL_RESIDUAL) % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% % diff --git a/TestCases/disc_adj_rans/cylinder/cylinder.cfg b/TestCases/disc_adj_rans/cylinder/cylinder.cfg index 1d3980c9769..b2d4ca0848b 100644 --- a/TestCases/disc_adj_rans/cylinder/cylinder.cfg +++ b/TestCases/disc_adj_rans/cylinder/cylinder.cfg @@ -5,7 +5,7 @@ % Author: Tim Albring % % Institution: TU Kaiserslautern % % Date: 2016.06.14 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_rans/cylinder/cylinder_Windowing.cfg b/TestCases/disc_adj_rans/cylinder/cylinder_Windowing.cfg index dcf0e520307..d89c9e75498 100644 --- a/TestCases/disc_adj_rans/cylinder/cylinder_Windowing.cfg +++ b/TestCases/disc_adj_rans/cylinder/cylinder_Windowing.cfg @@ -5,7 +5,7 @@ % Author: Tim Albring % % Institution: TU Kaiserslautern % % Date: 2016.06.14 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_rans/cylinder/cylinder_Windowing_AD.cfg b/TestCases/disc_adj_rans/cylinder/cylinder_Windowing_AD.cfg index afb023abc94..7ae2770e6f2 100644 --- a/TestCases/disc_adj_rans/cylinder/cylinder_Windowing_AD.cfg +++ b/TestCases/disc_adj_rans/cylinder/cylinder_Windowing_AD.cfg @@ -5,7 +5,7 @@ % Author: Tim Albring % % Institution: TU Kaiserslautern % % Date: 2016.06.14 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_rans/cylinder_DT_1ST/cylinder.cfg b/TestCases/disc_adj_rans/cylinder_DT_1ST/cylinder.cfg index 1d27a5a3022..b204d5b8f4b 100644 --- a/TestCases/disc_adj_rans/cylinder_DT_1ST/cylinder.cfg +++ b/TestCases/disc_adj_rans/cylinder_DT_1ST/cylinder.cfg @@ -5,7 +5,7 @@ % Author: Tim Albring % % Institution: TU Kaiserslautern % % Date: 2016.06.14 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_rans/naca0012/naca0012.cfg b/TestCases/disc_adj_rans/naca0012/naca0012.cfg index 26318392aff..c83765fdd28 100644 --- a/TestCases/disc_adj_rans/naca0012/naca0012.cfg +++ b/TestCases/disc_adj_rans/naca0012/naca0012.cfg @@ -5,7 +5,7 @@ % Author: Steffen Schotthöfer % % Institution: TU Kaiserslautern % % Date: Mar 16, 2017 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_rans/naca0012/turb_NACA0012_sa.cfg b/TestCases/disc_adj_rans/naca0012/turb_NACA0012_sa.cfg index f8f151f9777..a1b710cb933 100644 --- a/TestCases/disc_adj_rans/naca0012/turb_NACA0012_sa.cfg +++ b/TestCases/disc_adj_rans/naca0012/turb_NACA0012_sa.cfg @@ -6,7 +6,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: Feb 18th, 2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_rans/naca0012/turb_NACA0012_sst.cfg b/TestCases/disc_adj_rans/naca0012/turb_NACA0012_sst.cfg index c9aff3eeea5..7134a4de925 100644 --- a/TestCases/disc_adj_rans/naca0012/turb_NACA0012_sst.cfg +++ b/TestCases/disc_adj_rans/naca0012/turb_NACA0012_sst.cfg @@ -6,7 +6,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: Feb 18th, 2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/disc_adj_turbomachinery/transonic_stator_2D/transonic_stator.cfg b/TestCases/disc_adj_turbomachinery/transonic_stator_2D/transonic_stator.cfg index 459e7763771..0afb824397b 100644 --- a/TestCases/disc_adj_turbomachinery/transonic_stator_2D/transonic_stator.cfg +++ b/TestCases/disc_adj_turbomachinery/transonic_stator_2D/transonic_stator.cfg @@ -5,7 +5,7 @@ % Author: S. Vitale % % Institution: Delft University of Technology % % Date: 2017.03.01 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -14,10 +14,9 @@ % SOLVER= RANS KIND_TURB_MODEL= SST -MATH_PROBLEM= DISCRETE_ADJOINT +SST_OPTIONS= V1994m RESTART_SOL= NO NZONES= 1 -SINGLEZONE_DRIVER=NO % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% % @@ -87,6 +86,7 @@ AVERAGE_MACH_LIMIT= 0.03 % MARKER_PLOTTING= (airfoil) MARKER_MONITORING= (airfoil) +MARKER_ANALYZE= (outflow, inflow) % ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% % @@ -152,13 +152,13 @@ FFD_CONTINUITY= 2ND_DERIVATIVE % DEFINITION_DV= ( 19, 1.0 | airfoil | MAIN_BOX, 0, 0, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 1, 0, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 2, 0, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 3, 0, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 4, 0, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 0, 1, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 1, 1, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 2, 1, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 3, 1, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 4, 1, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 0, 2, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 1, 2, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 2, 2, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 3, 2, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 4, 2, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 0, 3, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 1, 3, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 2, 3, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 3, 3, 0.0, 0.0 ); ( 19, 1.0 | airfoil | MAIN_BOX, 4, 3, 0.0, 0.0 ) OPT_CONSTRAINT= ( FLOW_ANGLE_OUT < -74.0 ) * 0.001 -OPT_OBJECTIVE= ENTROPY_GENERATION* 0.0001 +OPT_OBJECTIVE= SURFACE_PRESSURE_DROP* 0.0001 OPT_ITERATIONS= 19 OPT_ACCURACY= 1E-10 % --------------------- OBJECTIVE FUNCTION DEFINITION -----------------------% % -OBJECTIVE_FUNCTION= ENTROPY_GENERATION +OBJECTIVE_FUNCTION= SURFACE_PRESSURE_DROP % --------------------------- CONVERGENCE PARAMETERS --------------------------% % @@ -185,4 +185,4 @@ GRAD_OBJFUNC_FILENAME= of_grad.dat SURFACE_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint OUTPUT_WRT_FREQ= 500 -SCREEN_OUTPUT=(INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_TKE) +SCREEN_OUTPUT=(INNER_ITER, RMS_RES) diff --git a/TestCases/euler/CRM/inv_CRM_JST.cfg b/TestCases/euler/CRM/inv_CRM_JST.cfg index b7e48db4b5f..5472813ad1e 100644 --- a/TestCases/euler/CRM/inv_CRM_JST.cfg +++ b/TestCases/euler/CRM/inv_CRM_JST.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2012.10.07 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -65,8 +65,6 @@ MG_DAMP_PROLONGATION= 0.9 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.04 ) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -75,8 +73,6 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % OBJECTIVE_FUNCTION= DRAG CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_SHARP_LIMITER_COEFF= 3.0 ADJ_JST_SENSOR_COEFF= ( 0.0, 0.04 ) CFL_REDUCTION_ADJFLOW= 0.5 diff --git a/TestCases/euler/biparabolic/BIPARABOLIC.cfg b/TestCases/euler/biparabolic/BIPARABOLIC.cfg index 86368ceaa21..7506bdb98b1 100644 --- a/TestCases/euler/biparabolic/BIPARABOLIC.cfg +++ b/TestCases/euler/biparabolic/BIPARABOLIC.cfg @@ -5,7 +5,7 @@ % Author: Trent W. Lukaczyk % % Institution: Stanford University % % Date: 2012.08.16 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -54,7 +54,7 @@ EXT_ITER= 99999999 % -------------------------- MULTIGRID PARAMETERS -----------------------------% % -MGLEVEL= 3 +MGLEVEL= 3 MGCYCLE= V_CYCLE MG_PRE_SMOOTH= ( 1, 2, 3, 3 ) MG_POST_SMOOTH= ( 0, 0, 0, 0 ) @@ -65,8 +65,6 @@ MG_DAMP_PROLONGATION= 0.95 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -75,8 +73,6 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % OBJECTIVE_FUNCTION= EQUIVALENT_AREA CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_SHARP_LIMITER_COEFF= 3.0 ADJ_JST_SENSOR_COEFF= ( 0.0, 0.02 ) CFL_REDUCTION_ADJFLOW= 0.8 diff --git a/TestCases/euler/bluntbody/blunt.cfg b/TestCases/euler/bluntbody/blunt.cfg index dbb4926dc28..c16188707a0 100644 --- a/TestCases/euler/bluntbody/blunt.cfg +++ b/TestCases/euler/bluntbody/blunt.cfg @@ -5,7 +5,7 @@ % Author: Amit Sachdeva % % Institution: ADSG-VSSC % % Date: 2019.01.23 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/euler/channel/inv_channel.cfg b/TestCases/euler/channel/inv_channel.cfg index 279bbacdf65..ae7ab80cbc1 100644 --- a/TestCases/euler/channel/inv_channel.cfg +++ b/TestCases/euler/channel/inv_channel.cfg @@ -5,12 +5,12 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2012.09.29 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% -% +% SOLVER= EULER MATH_PROBLEM= DIRECT RESTART_SOL= NO @@ -73,8 +73,6 @@ MG_DAMP_PROLONGATION= 0.9 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT diff --git a/TestCases/euler/channel/inv_channel_RK.cfg b/TestCases/euler/channel/inv_channel_RK.cfg index 6a4b2731bdb..2a7c72c77f7 100644 --- a/TestCases/euler/channel/inv_channel_RK.cfg +++ b/TestCases/euler/channel/inv_channel_RK.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2012.10.07 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -66,8 +66,6 @@ MG_DAMP_PROLONGATION= 0.9 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= RUNGE-KUTTA_EXPLICIT diff --git a/TestCases/euler/naca0012/inv_NACA0012.cfg b/TestCases/euler/naca0012/inv_NACA0012.cfg index 607879da57d..a57ff4e4e4d 100644 --- a/TestCases/euler/naca0012/inv_NACA0012.cfg +++ b/TestCases/euler/naca0012/inv_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -71,23 +71,19 @@ MG_DAMP_PROLONGATION= 1.0 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT % ---------------- ADJOINT-FLOW NUMERICAL METHOD DEFINITION -------------------% % CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_JST_SENSOR_COEFF= ( 0.5, 0.02 ) CFL_REDUCTION_ADJFLOW= 0.5 TIME_DISCRE_ADJFLOW= EULER_IMPLICIT % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % -DV_KIND= HICKS_HENNE +DV_KIND= HICKS_HENNE DV_MARKER= ( airfoil ) DV_PARAM= ( 1, 0.5 ) DV_VALUE= 0.01 diff --git a/TestCases/euler/naca0012/inv_NACA0012_Roe.cfg b/TestCases/euler/naca0012/inv_NACA0012_Roe.cfg index cb5098afa2c..4df2ca7e453 100644 --- a/TestCases/euler/naca0012/inv_NACA0012_Roe.cfg +++ b/TestCases/euler/naca0012/inv_NACA0012_Roe.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2012.10.07 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/euler/oneram6/inv_ONERAM6.cfg b/TestCases/euler/oneram6/inv_ONERAM6.cfg index ec5e0f93aa0..f8a5ed2228c 100644 --- a/TestCases/euler/oneram6/inv_ONERAM6.cfg +++ b/TestCases/euler/oneram6/inv_ONERAM6.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2015.08.25 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -79,16 +79,12 @@ MG_DAMP_PROLONGATION= 0.9 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= NONE JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT % ---------------- ADJOINT-FLOW NUMERICAL METHOD DEFINITION -------------------% % CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_JST_SENSOR_COEFF= ( 0.0, 0.02 ) CFL_REDUCTION_ADJFLOW= 0.5 TIME_DISCRE_ADJFLOW= EULER_IMPLICIT diff --git a/TestCases/euler/ramp/inv_ramp.cfg b/TestCases/euler/ramp/inv_ramp.cfg new file mode 100644 index 00000000000..2f27ee85973 --- /dev/null +++ b/TestCases/euler/ramp/inv_ramp.cfg @@ -0,0 +1,90 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Supersonic flow over a ramp in a channel (regression) % +% Author: Thomas D. Economon, Amit Sachdeva % +% Institution: Stanford University % +% Date: 2023.04.08 % +% File Version 8.0.0 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= EULER +MATH_PROBLEM= DIRECT +RESTART_SOL= YES + +% ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% +% +MACH_NUMBER= 2.0 +AOA= 0.0 +SIDESLIP_ANGLE= 0.0 +FREESTREAM_PRESSURE= 100000.0 +FREESTREAM_TEMPERATURE= 300.0 + +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% +% +REF_ORIGIN_MOMENT_X = 0.25 +REF_ORIGIN_MOMENT_Y = 0.00 +REF_ORIGIN_MOMENT_Z = 0.00 +REF_LENGTH= 1.0 +REF_AREA= 1.0 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_EULER= ( upper, lower ) +MARKER_SUPERSONIC_INLET= ( inlet, 300.0, 100000.0, 695.4290761824674, 0.0, 0.0 ) +MARKER_OUTLET= ( outlet, 10000.0 ) +MARKER_PLOTTING= ( lower ) +MARKER_MONITORING= ( upper, lower ) + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +CFL_NUMBER= 1.0 +CFL_ADAPT= YES +CFL_ADAPT_PARAM= ( 0.9, 1.1, 1.0, 100.0, 0.8) +ITER= 500 +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_ERROR= 1E-6 +LINEAR_SOLVER_ITER= 3 +NEWTON_KRYLOV= YES +NEWTON_KRYLOV_IPARAM= (0, 1, 1) % n0, np, ft +NEWTON_KRYLOV_DPARAM= (0.0, 1e-20, -2.0, 1e-5) % r0, tp, rf, e +MGLEVEL= 0 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= AUSMPLUSUP +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW= NISHIKAWA_R5 +VENKAT_LIMITER_COEFF= 0.5 +TIME_DISCRE_FLOW= EULER_IMPLICIT + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_RESIDUAL_MINVAL= -13 +CONV_STARTITER= 10 +CONV_CAUCHY_ELEMS= 100 +CONV_CAUCHY_EPS= 1E-10 + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +MESH_FILENAME= ramp_unst.su2 +MESH_FORMAT= SU2 +MESH_OUT_FILENAME= mesh_out.su2 +SOLUTION_FILENAME= restart_flow.dat +SOLUTION_ADJ_FILENAME= solution_adj.dat +TABULAR_FORMAT= CSV +CONV_FILENAME= history +RESTART_FILENAME= restart_flowrun.dat +RESTART_ADJ_FILENAME= restart_adj.dat +VOLUME_FILENAME= flow +VOLUME_ADJ_FILENAME= adjoint +GRAD_OBJFUNC_FILENAME= of_grad.dat +SURFACE_FILENAME= surface_flow +SURFACE_ADJ_FILENAME= surface_adjoint +OUTPUT_WRT_FREQ= 250 +SCREEN_OUTPUT = (INNER_ITER, RMS_DENSITY, RMS_ENERGY, LIFT, DRAG) + diff --git a/TestCases/euler/wedge/inv_wedge_HLLC.cfg b/TestCases/euler/wedge/inv_wedge_HLLC.cfg index 453ae608577..ebbafb0f624 100644 --- a/TestCases/euler/wedge/inv_wedge_HLLC.cfg +++ b/TestCases/euler/wedge/inv_wedge_HLLC.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2012.10.07 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/fea_fsi/Airfoil_RBF/config.cfg b/TestCases/fea_fsi/Airfoil_RBF/config.cfg index eebdfa3d60d..9039bd4519e 100755 --- a/TestCases/fea_fsi/Airfoil_RBF/config.cfg +++ b/TestCases/fea_fsi/Airfoil_RBF/config.cfg @@ -3,7 +3,7 @@ % Case description: 2D airfoil FSI with radial basis function interp. % % Institution: Imperial College London % % Date: 2015.08.12 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SOLVER = MULTIPHYSICS diff --git a/TestCases/fea_fsi/Airfoil_RBF/configFEA.cfg b/TestCases/fea_fsi/Airfoil_RBF/configFEA.cfg index 51966af7064..ba53a5cc31a 100644 --- a/TestCases/fea_fsi/Airfoil_RBF/configFEA.cfg +++ b/TestCases/fea_fsi/Airfoil_RBF/configFEA.cfg @@ -2,7 +2,7 @@ % SU2 configuration file % % Case description: 2D airfoil FSI with radial basis function interp. % % Institution: Imperial College London % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Interface options ---------------------------------------------------- % diff --git a/TestCases/fea_fsi/Airfoil_RBF/configFlow.cfg b/TestCases/fea_fsi/Airfoil_RBF/configFlow.cfg index 9ff342e7b3a..9e2032c5a08 100644 --- a/TestCases/fea_fsi/Airfoil_RBF/configFlow.cfg +++ b/TestCases/fea_fsi/Airfoil_RBF/configFlow.cfg @@ -2,7 +2,7 @@ % SU2 configuration file % % Case description: 2D airfoil FSI with radial basis function interp. % % Institution: Imperial College London % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Interface options ---------------------------------------------------- % diff --git a/TestCases/fea_fsi/DynBeam_2d/configBeam_2d.cfg b/TestCases/fea_fsi/DynBeam_2d/configBeam_2d.cfg index c4181d6339d..3b9e5f955dd 100644 --- a/TestCases/fea_fsi/DynBeam_2d/configBeam_2d.cfg +++ b/TestCases/fea_fsi/DynBeam_2d/configBeam_2d.cfg @@ -4,9 +4,9 @@ % Author: Ruben Sanchez Fernandez % % Institution: Imperial College London % % Date: 2016.02.01 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - + SOLVER= ELASTICITY MATH_PROBLEM= DIRECT GEOMETRIC_CONDITIONS= LARGE_DEFORMATIONS @@ -18,7 +18,7 @@ RESTART_ITER= 1 ELASTICITY_MODULUS=3E7 POISSON_RATIO=0.3 MATERIAL_DENSITY=7854 -FORMULATION_ELASTICITY_2D = PLANE_STRESS +FORMULATION_ELASTICITY_2D= PLANE_STRESS TIME_DOMAIN=YES TIME_STEP=0.01 MAX_TIME= 0.1 @@ -27,17 +27,17 @@ TIME_ITER=7 TIME_DISCRE_FEA= NEWMARK_IMPLICIT NEWMARK_BETA=0.2601 NEWMARK_GAMMA=0.52 -MARKER_CLAMPED = ( left , right ) -MARKER_PRESSURE= ( lower, 0) -MARKER_LOAD= ( upper, 1, 1000, 0, -1, 0) -LINEAR_SOLVER= FGMRES -LINEAR_SOLVER_PREC= LU_SGS -LINEAR_SOLVER_ERROR= 1E-8 -LINEAR_SOLVER_ITER= 1000 +MARKER_CLAMPED= ( left , right ) +MARKER_PRESSURE= ( lower, 0 ) +MARKER_LOAD= ( upper, 1, 1000, 0, -1, 0 ) +LINEAR_SOLVER= CONJUGATE_GRADIENT +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-6 +LINEAR_SOLVER_ITER= 100 MESH_FORMAT= SU2 TABULAR_FORMAT= CSV VOLUME_FILENAME= beam RESTART_FILENAME= restart_beam.dat SOLUTION_FILENAME= solution_beam.dat OUTPUT_WRT_FREQ= 1 -OUTPUT_FILES= (RESTART_ASCII) +OUTPUT_FILES= RESTART_ASCII, PARAVIEW diff --git a/TestCases/fea_fsi/MixElemsKnowles/config.cfg b/TestCases/fea_fsi/MixElemsKnowles/config.cfg index 94e5328e4b9..53f943ca738 100644 --- a/TestCases/fea_fsi/MixElemsKnowles/config.cfg +++ b/TestCases/fea_fsi/MixElemsKnowles/config.cfg @@ -4,14 +4,13 @@ % Case description: Tip-loaded 3D cantilever beam, mix of element types, % % nonlinear elasticity with Knowles material model. % % Institution: Imperial College London % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Physics SOLVER= ELASTICITY MATH_PROBLEM= DIRECT -DYNAMIC_ANALYSIS= NO % % Optimization OBJECTIVE_FUNCTION= REFERENCE_NODE diff --git a/TestCases/fea_fsi/SquareCyl_Beam/config.cfg b/TestCases/fea_fsi/SquareCyl_Beam/config.cfg index ab740fe4255..361e6a4e5ed 100644 --- a/TestCases/fea_fsi/SquareCyl_Beam/config.cfg +++ b/TestCases/fea_fsi/SquareCyl_Beam/config.cfg @@ -5,7 +5,7 @@ % Author: Ruben Sanchez Fernandez % % Institution: Imperial College London % % Date: 2016.06.01 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -67,7 +67,7 @@ NONLINEAR_FEM_INT_ITER = 20 % -------------------------- DYNAMIC SIMULATION -------------------------------% % -DYNAMIC_ANALYSIS= YES +TIME_DOMAIN= YES TIME_DISCRE_FEA= NEWMARK_IMPLICIT NEWMARK_BETA=0.2601 NEWMARK_GAMMA=0.52 diff --git a/TestCases/fea_fsi/StatBeam_3d/configBeam_3d.cfg b/TestCases/fea_fsi/StatBeam_3d/configBeam_3d.cfg index 1aee4275ed5..c2cc8594e51 100644 --- a/TestCases/fea_fsi/StatBeam_3d/configBeam_3d.cfg +++ b/TestCases/fea_fsi/StatBeam_3d/configBeam_3d.cfg @@ -4,9 +4,9 @@ % Author: Ruben Sanchez Fernandez % % Institution: Imperial College London % % Date: 2016.02.01 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - + SOLVER= ELASTICITY MATH_PROBLEM= DIRECT GEOMETRIC_CONDITIONS= SMALL_DEFORMATIONS @@ -15,7 +15,6 @@ MESH_FILENAME= meshBeam_3d.su2 ELASTICITY_MODULUS=3E7 POISSON_RATIO=0.3 MATERIAL_DENSITY=7854 -DYNAMIC_ANALYSIS= NO MARKER_CLAMPED = ( left , right ) MARKER_PRESSURE= ( lower, 0 , symleft, 0, symright, 0) MARKER_LOAD= ( upper, 1, 1000, 0, -1, 0) diff --git a/TestCases/fea_fsi/stat_fsi/configFEA.cfg b/TestCases/fea_fsi/stat_fsi/configFEA.cfg index 3ce2b13322c..0f4e66ad1f7 100755 --- a/TestCases/fea_fsi/stat_fsi/configFEA.cfg +++ b/TestCases/fea_fsi/stat_fsi/configFEA.cfg @@ -59,7 +59,7 @@ FORMULATION_ELASTICITY_2D = PLANE_STRAIN POISSON_RATIO=0.4 % -------------------------- DYNAMIC SIMULATION -------------------------------% -DYNAMIC_ANALYSIS= NO +TIME_DOMAIN= NO TIME_DISCRE_FEA= NEWMARK_IMPLICIT % -------------------------- STRUCTURAL SOLVER --------------------------------% diff --git a/TestCases/fea_topology/config.cfg b/TestCases/fea_topology/config.cfg index cf12a17353a..a1d6fe63e98 100644 --- a/TestCases/fea_topology/config.cfg +++ b/TestCases/fea_topology/config.cfg @@ -2,7 +2,7 @@ % SU2 configuration file % % Case description: 4 by 1 cantilever optim. for stiff. @ 50% material % % Institution: Imperial College London % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Optimization @@ -66,7 +66,6 @@ ITER=1 % Physics SOLVER= ELASTICITY MATH_PROBLEM= DISCRETE_ADJOINT -DYNAMIC_ANALYSIS= NO RESTART_SOL= NO % SOLUTION_FILENAME=solution_structure.dat diff --git a/TestCases/fea_topology/quick_start/settings.cfg b/TestCases/fea_topology/quick_start/settings.cfg index 44d8b3eafaf..8a0edb1041a 100644 --- a/TestCases/fea_topology/quick_start/settings.cfg +++ b/TestCases/fea_topology/quick_start/settings.cfg @@ -1,7 +1,6 @@ % Physics SOLVER= ELASTICITY MATH_PROBLEM= DIRECT -DYNAMIC_ANALYSIS= NO % ITER= 1 % diff --git a/TestCases/fea_topology/quick_start/settings_compliance.cfg b/TestCases/fea_topology/quick_start/settings_compliance.cfg index d9cf275df75..57241e0615f 100644 --- a/TestCases/fea_topology/quick_start/settings_compliance.cfg +++ b/TestCases/fea_topology/quick_start/settings_compliance.cfg @@ -1,7 +1,6 @@ % Physics SOLVER= ELASTICITY MATH_PROBLEM= DISCRETE_ADJOINT -DYNAMIC_ANALYSIS= NO % ITER= 1 % diff --git a/TestCases/fea_topology/quick_start/settings_volfrac.cfg b/TestCases/fea_topology/quick_start/settings_volfrac.cfg index a3ec2ebc3cb..c7da2fe14f5 100644 --- a/TestCases/fea_topology/quick_start/settings_volfrac.cfg +++ b/TestCases/fea_topology/quick_start/settings_volfrac.cfg @@ -1,7 +1,6 @@ % Physics SOLVER= ELASTICITY MATH_PROBLEM= DISCRETE_ADJOINT -DYNAMIC_ANALYSIS= NO % ITER= 1 % diff --git a/TestCases/fixed_cl/naca0012/inv_NACA0012.cfg b/TestCases/fixed_cl/naca0012/inv_NACA0012.cfg index 8d7b8c46ae7..8b42d149a35 100644 --- a/TestCases/fixed_cl/naca0012/inv_NACA0012.cfg +++ b/TestCases/fixed_cl/naca0012/inv_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -78,23 +78,19 @@ MG_DAMP_PROLONGATION= 1.0 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT % ---------------- ADJOINT-FLOW NUMERICAL METHOD DEFINITION -------------------% % CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_JST_SENSOR_COEFF= ( 0.5, 0.02 ) CFL_REDUCTION_ADJFLOW= 0.5 TIME_DISCRE_ADJFLOW= EULER_IMPLICIT % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % -DV_KIND= HICKS_HENNE +DV_KIND= HICKS_HENNE DV_MARKER= ( airfoil ) DV_PARAM= ( 1, 0.5 ) DV_VALUE= 0.01 diff --git a/TestCases/fixed_cl/naca0012/inv_NACA0012_ContAdj.cfg b/TestCases/fixed_cl/naca0012/inv_NACA0012_ContAdj.cfg index df4c8cb355d..eecbe2141e1 100644 --- a/TestCases/fixed_cl/naca0012/inv_NACA0012_ContAdj.cfg +++ b/TestCases/fixed_cl/naca0012/inv_NACA0012_ContAdj.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -79,23 +79,19 @@ MG_DAMP_PROLONGATION= 1.0 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT % ---------------- ADJOINT-FLOW NUMERICAL METHOD DEFINITION -------------------% % CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_JST_SENSOR_COEFF= ( 0.5, 0.02 ) CFL_REDUCTION_ADJFLOW= 0.5 TIME_DISCRE_ADJFLOW= EULER_IMPLICIT % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % -DV_KIND= HICKS_HENNE +DV_KIND= HICKS_HENNE DV_MARKER= ( airfoil ) DV_PARAM= ( 1, 0.5 ) DV_VALUE= 0.01 @@ -132,7 +128,7 @@ GRAD_OBJFUNC_FILENAME= of_grad.dat SURFACE_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint OUTPUT_WRT_FREQ= 250 -SCREEN_OUTPUT = (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_GEO, SENS_AOA) +SCREEN_OUTPUT = (INNER_ITER, RMS_ADJ_DENSITY, RMS_ADJ_ENERGY, SENS_GEO, SENS_AOA) OUTPUT_FILES= (RESTART_ASCII) % --------------------- OPTIMAL SHAPE DESIGN DEFINITION -----------------------% diff --git a/TestCases/flamelet/01_laminar_premixed_ch4_flame_cfd/lam_prem_ch4_cfd.cfg b/TestCases/flamelet/01_laminar_premixed_ch4_flame_cfd/lam_prem_ch4_cfd.cfg new file mode 100644 index 00000000000..d218369f9f7 --- /dev/null +++ b/TestCases/flamelet/01_laminar_premixed_ch4_flame_cfd/lam_prem_ch4_cfd.cfg @@ -0,0 +1,137 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% SU2 configuration file % +% Case description: Laminar premixed flame stabilized on isothermal burner % +% Author: Nijso Beishuizen % +% Institution: Bosch Thermotechnology % +% Date: 08/09/2021 % +% File Version 8.0.0 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER = INC_NAVIER_STOKES +KIND_TURB_MODEL= NONE +MATH_PROBLEM= DIRECT +RESTART_SOL = YES +% +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +INC_DENSITY_MODEL= FLAMELET +INC_ENERGY_EQUATION = YES +INC_DENSITY_INIT= 1.00 +INC_VELOCITY_INIT= (0.5, 0.0, 0.0 ) +INC_TEMPERATURE_INIT= 300.0 +INC_NONDIM= DIMENSIONAL +% +% -------------------- FLUID MODEL --------------------------------------- % +% +FLUID_MODEL= FLUID_FLAMELET +FILENAMES_INTERPOLATOR= (fgm_ch4.drg) +CONTROLLING_VARIABLE_NAMES= (ProgressVariable, EnthalpyTot) +CONTROLLING_VARIABLE_SOURCE_NAMES = (ProdRateTot_PV, NULL) +% +% -------------------- SCALAR TRANSPORT ---------------------------------------% +% +KIND_SCALAR_MODEL= FLAMELET +DIFFUSIVITY_MODEL= FLAMELET +VISCOSITY_MODEL= FLAMELET +CONDUCTIVITY_MODEL= FLAMELET +FLAME_INIT= (0.0032, 0.00, 0.00, 1.0, 0.1, 0.0, 1.0e-3, 0.1) +% # progvar, enthalpy +SPECIES_INIT = (0.0, -210000, 0.0, 0.0) +CONV_NUM_METHOD_SPECIES= SCALAR_UPWIND +MUSCL_SPECIES= YES +SLOPE_LIMITER_SPECIES= NONE +TIME_DISCRE_SPECIES= EULER_IMPLICIT +% SCALAR CLIPPING +SPECIES_CLIPPING= YES +SPECIES_CLIPPING_MIN= 0 -2e6 0 0 +SPECIES_CLIPPING_MAX= 1 2e6 1 1 +% +MARKER_INLET_SPECIES = (inlet, 0, -193600.0, 0.0, 0.0) +CFL_REDUCTION_SPECIES= 1.0 +MARKER_SPECIES_STRONG_BC= (inlet, outlet, wall) +LOOKUP_NAMES = (MolarWeightMix, Conductivity, Cp, HeatRelease, Diffusivity) +USER_SCALAR_NAMES= (CO, NOx) +USER_SOURCE_NAMES = ( \ + ProdRatePos_Y-CO, ProdRateNegScaled_Y-CO ,\ + ProdRateTot_Y-NOx, NULL +) +% +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% +% +REF_ORIGIN_MOMENT_X = 0.25 +REF_ORIGIN_MOMENT_Y = 0.00 +REF_ORIGIN_MOMENT_Z = 0.00 +REF_LENGTH= 1.0 +REF_AREA= 1.0 +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_ISOTHERMAL= (wall, 450) +MARKER_SYM= (symmetry, symmetry_2-part-fluid) +INC_INLET_TYPE= VELOCITY_INLET +MARKER_INLET = (inlet, 300.0, 0.20, 1.0, 0.0, 0.0) +INC_OUTLET_TYPE= PRESSURE_OUTLET +%INC_INLET_DAMPING = 0.05 +%INC_OUTLET_DAMPING = 0.05 +MARKER_OUTLET= (outlet, 0.0) +MARKER_PLOTTING= ( wall ) +MARKER_MONITORING= ( wall ) +MARKER_ANALYZE= ( inlet,outlet ) +MARKER_ANALYZE_AVERAGE = AREA +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +CFL_NUMBER= 350 +CFL_ADAPT= NO +ITER= 100 +OUTPUT_WRT_FREQ= 100 +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-03 +LINEAR_SOLVER_ITER= 10 +% +% -------------------------- MULTIGRID PARAMETERS -----------------------------% +% +MGLEVEL= 0 +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= FDS +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW = NONE +TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_RESIDUAL_MINVAL= -15 +CONV_STARTITER= 10 +CONV_CAUCHY_ELEMS= 100 +CONV_CAUCHY_EPS= 1E-6 +SCREEN_OUTPUT = INNER_ITER RMS_VELOCITY-X RMS_VELOCITY-Y RMS_PRESSURE RMS_ProgressVariable RMS_EnthalpyTot RMS_CO RMS_NOx +HISTORY_OUTPUT = RMS_RES AERO_COEFF FLOW_COEFF FLOW_COEFF_SURF +VOLUME_OUTPUT = SOLUTION PRIMITIVE SOURCE RESIDUAL SENSITIVITY LOOKUP TIMESTEP +CONV_FIELD = RMS_PRESSURE +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +MESH_FORMAT= CGNS +MESH_FILENAME = mesh_structured.cgns +MESH_OUT_FILENAME= mesh_out.su2 +SOLUTION_FILENAME= solution +RESTART_FILENAME= restart +%OUTPUT_FILES = (RESTART,PARAVIEW,PARAVIEW_MULTIBLOCK) +OUTPUT_FILES = (RESTART) +TABULAR_FORMAT = CSV +CONV_FILENAME= history +VOLUME_FILENAME= ch4_flame_cfd +SURFACE_FILENAME= surface_flow +WRT_PERFORMANCE = NO +SCREEN_WRT_FREQ_INNER = 1 +SCREEN_WRT_FREQ_OUTER = 1 diff --git a/TestCases/flamelet/02_laminar_premixed_ch4_flame_hx_ad/lam_prem_ch4_hx_ad.cfg b/TestCases/flamelet/02_laminar_premixed_ch4_flame_hx_ad/lam_prem_ch4_hx_ad.cfg new file mode 100644 index 00000000000..0d9ad8f0331 --- /dev/null +++ b/TestCases/flamelet/02_laminar_premixed_ch4_flame_hx_ad/lam_prem_ch4_hx_ad.cfg @@ -0,0 +1,144 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Laminar premixed flame stabilized on isothermal burner % +% with cold wall (hx) downstream of the flame (adjoint run) % +% % +% Author a: Daniel Mayer % +% Institution a: Robert Bosch LLC % +% % +% Author b: Nijso Beishuizen % +% Institution b: Bosch Thermotechnology % +% % +% Date: 02/21/2023 % +% File Version 8.0.0 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= INC_NAVIER_STOKES +KIND_TURB_MODEL= NONE +% +OBJECTIVE_FUNCTION= CUSTOM_OBJFUNC +OBJECTIVE_WEIGHT= 1.0 +CUSTOM_OBJFUNC= avg_NOx +CUSTOM_OUTPUTS= 'avg_NOx : MassFlowAvg{SPECIES[3]}[outlet]' +% +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +INC_DENSITY_MODEL= FLAMELET +INC_DENSITY_INIT= 1.1766 +INC_VELOCITY_INIT= ( 0.2, 0, 0 ) +INC_ENERGY_EQUATION= YES +INC_TEMPERATURE_INIT= 300.0 +INC_NONDIM= DIMENSIONAL +% +% -------------------- FLUID PROPERTIES ------------------------------------- % +% +FLUID_MODEL= FLUID_FLAMELET +FILENAMES_INTERPOLATOR= (fgm_ch4.drg) +CONTROLLING_VARIABLE_NAMES= (ProgressVariable, EnthalpyTot) +CONTROLLING_VARIABLE_SOURCE_NAMES= (ProdRateTot_PV, NULL) + +CONDUCTIVITY_MODEL= FLAMELET +DIFFUSIVITY_MODEL= FLAMELET +KIND_SCALAR_MODEL= FLAMELET +VISCOSITY_MODEL= FLAMELET +% +FLAME_INIT= (0.0035, 0, 0, 3.0, 2.0, 0.0, 5.0e-4, 1.0) +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_ISOTHERMAL= ( wall_burner, 450, wall_hx, 900 ) +MARKER_SYM= ( axis, symmetry_xm, symmetry_xp ) +% +INC_INLET_TYPE= VELOCITY_INLET +MARKER_INLET= (inlet, 300.0, 0.20, 1.0, 0.0, 0.0) +MARKER_INLET_SPECIES= (inlet, 0.0, 0.0, 0.0, 0.0) +MARKER_SPECIES_STRONG_BC= (inlet, wall_burner, wall_hx) + +% +INC_OUTLET_TYPE= PRESSURE_OUTLET +MARKER_OUTLET= ( outlet, 0.0 ) +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +CFL_NUMBER= 50 +CFL_REDUCTION_SPECIES= 1.0 +ITER= 7000 +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-03 +LINEAR_SOLVER_ITER= 10 +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= FDS +MUSCL_FLOW= NO +SLOPE_LIMITER_FLOW= NONE +TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% -------------------- SCALAR TRANSPORT ---------------------------------------% +% +USER_SCALAR_NAMES= (Y-CO, Y-NOx_tot) + +USER_SOURCE_NAMES= ( \ + ProdRatePos_Y-CO, ProdRateNegScaled_Y-CO ,\ + ProdRateTot_Y-NOx, zero) + +DIFFUSIVITY_CONSTANT= 0.00001 +% +CONV_NUM_METHOD_SPECIES= BOUNDED_SCALAR +MUSCL_SPECIES= NO +SLOPE_LIMITER_SPECIES= NONE +% +TIME_DISCRE_SPECIES= EULER_IMPLICIT +% +SPECIES_INIT= (0, 0, 0, 0) +SPECIES_CLIPPING= NO +LOOKUP_NAMES= (MolarWeightMix, Conductivity, HeatRelease, Diffusivity, \ + ProdRatePos_Y-CO, ProdRateNegScaled_Y-CO ,\ + ProdRateTot_Y-NOx) + +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_FIELD= RMS_PRESSURE, RMS_VELOCITY-X, RMS_VELOCITY-Y +CONV_RESIDUAL_MINVAL= -18 +CONV_STARTITER= 10 +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +MESH_FILENAME= mesh_unstructured_hx.su2 +% +SCREEN_OUTPUT= INNER_ITER WALL_TIME RMS_ADJ_PRESSURE RMS_ADJ_VELOCITY-X RMS_ADJ_VELOCITY-Y RMS_ADJ_ProgressVariable RMS_ADJ_EnthalpyTot RMS_ADJ_Y-NOx_tot RMS_ADJ_Y-CO +SCREEN_WRT_FREQ_INNER= 1 +% +HISTORY_OUTPUT= ITER RMS_RES LINSOL FLOW_COEFF_SURF CUSTOM COMBO +CONV_FILENAME= history +MARKER_ANALYZE= outlet +MARKER_ANALYZE_AVERAGE= MASSFLUX +% +%OUTPUT_FILES= RESTART, PARAVIEW, PARAVIEW_MULTIBLOCK +OUTPUT_FILES= RESTART, RESTART_ASCII, PARAVIEW +VOLUME_OUTPUT= RESIDUAL, PRIMITIVE +VOLUME_ADJ_FILENAME= ch4_flame_hx_ad + +OUTPUT_WRT_FREQ= 100 +% +GRAD_OBJFUNC_FILENAME= of_grad.csv +% +RESTART_SOL= YES +READ_BINARY_RESTART= NO +RESTART_FILENAME= restart +RESTART_ADJ_FILENAME= restart_adj +SOLUTION_FILENAME= solution +SOLUTION_ADJ_FILENAME= solution_adj +% +WRT_PERFORMANCE= YES +OUTPUT_PRECISION= 16 diff --git a/TestCases/flamelet/02_laminar_premixed_ch4_flame_hx_ad/lam_prem_ch4_hx_dot.cfg b/TestCases/flamelet/02_laminar_premixed_ch4_flame_hx_ad/lam_prem_ch4_hx_dot.cfg new file mode 100644 index 00000000000..e24fba9b935 --- /dev/null +++ b/TestCases/flamelet/02_laminar_premixed_ch4_flame_hx_ad/lam_prem_ch4_hx_dot.cfg @@ -0,0 +1,253 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Laminar premixed flame stabilized on isothermal burner % +% with cold wall (hx) downstream of the flame (adjoint run) % +% % +% Author a: Daniel Mayer % +% Institution a: Robert Bosch LLC % +% % +% Author b: Nijso Beishuizen % +% Institution b: Bosch Thermotechnology % +% % +% Date: 02/21/2023 % +% File Version 8.0.0 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= INC_NAVIER_STOKES +KIND_TURB_MODEL= NONE +% +OBJECTIVE_FUNCTION= CUSTOM_OBJFUNC +OBJECTIVE_WEIGHT= 1.0 +CUSTOM_OBJFUNC= avg_NOx +CUSTOM_OUTPUTS= 'avg_NOx : MassFlowAvg{SPECIES[3]}[outlet]' + +% +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +INC_DENSITY_MODEL= FLAMELET +INC_DENSITY_INIT= 1.1766 +INC_VELOCITY_INIT= ( 0.2, 0, 0 ) +INC_ENERGY_EQUATION= YES +INC_TEMPERATURE_INIT= 300.0 +INC_NONDIM= DIMENSIONAL +% +% -------------------- FLUID PROPERTIES ------------------------------------- % +% +FLUID_MODEL= FLUID_FLAMELET +FILENAMES_INTERPOLATOR= (fgm_ch4.drg) +CONTROLLING_VARIABLE_NAMES= (ProgressVariable, EnthalpyTot) +CONTROLLING_VARIABLE_SOURCE_NAMES= (ProdRateTot_PV, NULL) +CONDUCTIVITY_MODEL= FLAMELET +DIFFUSIVITY_MODEL= FLAMELET +KIND_SCALAR_MODEL= FLAMELET +VISCOSITY_MODEL= FLAMELET +% +FLAME_INIT= (0.0035, 0, 0, 3, 2, 0, 5.0e-4, 1.0) +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_ISOTHERMAL= ( wall_burner, 450, wall_hx, 900 ) +MARKER_SYM= ( axis, symmetry_xm, symmetry_xp, outlet ) +% +INC_INLET_TYPE= VELOCITY_INLET +MARKER_INLET= (inlet, 300.0, 0.20, 1.0, 0.0, 0.0) +MARKER_INLET_SPECIES= (inlet, 0.0, 0.0, 0.0, 0.0) +MARKER_SPECIES_STRONG_BC= (inlet, wall_burner, wall_hx) +% +% INC_OUTLET_TYPE= PRESSURE_OUTLET +% MARKER_OUTLET= ( outlet, 0.0 ) +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +CFL_NUMBER= 100 +CFL_REDUCTION_SPECIES= 1.0 +ITER= 11 +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-03 +LINEAR_SOLVER_ITER= 10 +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= FDS +MUSCL_FLOW= NO +SLOPE_LIMITER_FLOW= NONE +TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% -------------------- SCALAR TRANSPORT ---------------------------------------% +% +USER_SCALAR_NAMES= (Y-CO, Y-NOx_tot) + +USER_SOURCE_NAMES= ( \ + ProdRatePos_Y-CO, ProdRateNegScaled_Y-CO ,\ + ProdRateTot_Y-NOx, zero) + +DIFFUSIVITY_CONSTANT= 0.00001 +% +CONV_NUM_METHOD_SPECIES= BOUNDED_SCALAR +MUSCL_SPECIES= NO +SLOPE_LIMITER_SPECIES= NONE +% +TIME_DISCRE_SPECIES= EULER_IMPLICIT +% +SPECIES_INIT= (0, 0, 0, 0) +SPECIES_CLIPPING= NO +LOOKUP_NAMES= (MolarWeightMix, Conductivity, HeatRelease, Diffusivity, \ + ProdRatePos_Y-CO, ProdRateNegScaled_Y-CO ,\ + ProdRateTot_Y-NOx) + +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_FIELD= RMS_PRESSURE, RMS_VELOCITY-X, RMS_VELOCITY-Y +CONV_RESIDUAL_MINVAL= -18 +CONV_STARTITER= 10 +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +MESH_FILENAME= mesh_unstructured_hx.su2 +% +SCREEN_OUTPUT= INNER_ITER WALL_TIME RMS_ADJ_PRESSURE RMS_ADJ_VELOCITY-X RMS_ADJ_VELOCITY-Y RMS_ADJ_ProgressVariable RMS_ADJ_EnthalpyTot RMS_ADJ_Y-NOx_tot RMS_ADJ_Y-CO +SCREEN_WRT_FREQ_INNER= 1 +% +HISTORY_OUTPUT= ITER RMS_RES LINSOL FLOW_COEFF_SURF +CONV_FILENAME= history +MARKER_ANALYZE= outlet +MARKER_ANALYZE_AVERAGE= MASSFLUX +% +%OUTPUT_FILES= RESTART, PARAVIEW, PARAVIEW_MULTIBLOCK +OUTPUT_FILES= RESTART +VOLUME_OUTPUT= RESIDUAL, PRIMITIVE +VOLUME_ADJ_FILENAME= ch4_flame_hx_ad + +OUTPUT_WRT_FREQ= 100 +% +GRAD_OBJFUNC_FILENAME= of_grad.csv +% +RESTART_SOL= YES +READ_BINARY_RESTART= NO +RESTART_FILENAME= restart +RESTART_ADJ_FILENAME= restart_adj +SOLUTION_FILENAME= solution +SOLUTION_ADJ_FILENAME= restart_adj +% +WRT_PERFORMANCE= YES +OUTPUT_PRECISION= 16 +% +% -------------------- FREE-FORM DEFORMATION PARAMETERS -----------------------% +% +% Tolerance of the Free-Form Deformation point inversion +FFD_TOLERANCE= 1E-10 +% +% Maximum number of iterations in the Free-Form Deformation point inversion +FFD_ITERATIONS= 500 +% +% FFD box definition: 3D case (FFD_BoxTag, X1, Y1, Z1, X2, Y2, Z2, X3, Y3, Z3, X4, Y4, Z4, +% X5, Y5, Z5, X6, Y6, Z6, X7, Y7, Z7, X8, Y8, Z8) +% 2D case (FFD_BoxTag, X1, Y1, 0.0, X2, Y2, 0.0, X3, Y3, 0.0, X4, Y4, 0.0, +% 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) +% Start at the lowest leftest corner and turn counter-clockwise +FFD_DEFINITION= (BOX, \ +0.065, 0.01, 0.0, \ +0.15, 0.01, 0.0 \ +0.15, 0.02, 0.0, \ +0.065, 0.02, 0.0, \ +0.0, 0.0 ,0.0, \ +0.0 ,0.0, 0.0, \ +0.0, 0.0, 0.0, \ +0.0, 0.0, 0.0 ) +% +% FFD box degree: 3D case (i_degree, j_degree, k_degree) +% 2D case (i_degree, j_degree, 0) +FFD_DEGREE= (6, 1, 0) +% +% Surface grid continuity at the intersection with the faces of the FFD boxes. +% To keep a particular level of surface continuity, SU2 automatically freezes the right +% number of control point planes (NO_DERIVATIVE, 1ST_DERIVATIVE, 2ND_DERIVATIVE, USER_INPUT) +FFD_CONTINUITY= USER_INPUT +% +% Definition of the FFD planes to be frozen in the FFD (x,y,z). +% Value from 0 FFD degree in that direction. Pick a value larger than degree if you do not want to fix any plane. +%FFD_FIX_I= (0,2,3) +%FFD_FIX_J= (0,2,3) +%FFD_FIX_K= (0,2,3) + +% ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% +% + +DV_KIND= \ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D + +% +% Marker of the surface in which we are going apply the shape deformation +% NOTE: for deformation the outlet should be a MARKER_SYM to hinder the mesh being ripped apart. +DV_MARKER= ( wall_hx ) +% +% Parameters of the shape deformation +% - FFD_SETTING ( 1.0 ) +% - FFD_CONTROL_POINT ( FFD_BoxTag, i_Ind, j_Ind, k_Ind, x_Disp, y_Disp, z_Disp ) + +DV_PARAM= (BOX, 1, 0, 0, 1.0); \ +(BOX, 2, 0, 0, 1.0); \ +(BOX, 3, 0, 0, 1.0); \ +(BOX, 4, 0, 0, 1.0); \ +(BOX, 5, 0, 0, 1.0); \ +(BOX, 1, 1, 0, 1.0); \ +(BOX, 2, 1, 0, 1.0); \ +(BOX, 3, 1, 0, 1.0); \ +(BOX, 4, 1, 0, 1.0); \ +(BOX, 5, 1, 0, 1.0) + +DEFINITION_DV= ( 19, 1.0 | wall_hx | BOX, 0, 0, 1.0, 0.0 ) + +DV_VALUE= 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 + +% +% ------------------------ GRID DEFORMATION PARAMETERS ------------------------% +% +% Linear solver or smoother for implicit formulations (FGMRES, RESTARTED_FGMRES, BCGSTAB) +DEFORM_LINEAR_SOLVER= FGMRES +% +% Preconditioner of the Krylov linear solver (ILU, LU_SGS, JACOBI) +DEFORM_LINEAR_SOLVER_PREC= ILU +% +% Number of smoothing iterations for mesh deformation +DEFORM_LINEAR_SOLVER_ITER= 1000 +% +% Number of nonlinear deformation iterations (surface deformation increments) +DEFORM_NONLINEAR_ITER= 1 +% +% Minimum residual criteria for the linear solver convergence of grid deformation +DEFORM_LINEAR_SOLVER_ERROR= 1E-14 +% +% Print the residuals during mesh deformation to the console (YES, NO) +DEFORM_CONSOLE_OUTPUT= YES +% +% Deformation coefficient (linear elasticity limits from -1.0 to 0.5, a larger +% value is also possible) +DEFORM_COEFF = 0.0 +% +% Type of element stiffness imposed for FEA mesh deformation (INVERSE_VOLUME, +% WALL_DISTANCE, CONSTANT_STIFFNESS) +DEFORM_STIFFNESS_TYPE= WALL_DISTANCE +% +% Deform the grid only close to the surface. It is possible to specify how much +% of the volumetric grid is going to be deformed in meters or inches (1E6 by default) +DEFORM_LIMIT = 1E6 diff --git a/TestCases/flamelet/03_laminar_premixed_ch4_flame_cht_cfd/lam_prem_ch4_cht_cfd_fluid.cfg b/TestCases/flamelet/03_laminar_premixed_ch4_flame_cht_cfd/lam_prem_ch4_cht_cfd_fluid.cfg new file mode 100644 index 00000000000..e0828cc4d44 --- /dev/null +++ b/TestCases/flamelet/03_laminar_premixed_ch4_flame_cht_cfd/lam_prem_ch4_cht_cfd_fluid.cfg @@ -0,0 +1,111 @@ + + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% + +SOLVER= INC_NAVIER_STOKES +KIND_TURB_MODEL= NONE + +MARKER_ANALYZE= (outlet) +MARKER_ANALYZE_AVERAGE= AREA + +MARKER_MONITORING= ( NONE ) +MARKER_PLOTTING= ( NONE ) + +WRT_ZONE_HIST= YES + +SCREEN_OUTPUT= INNER_ITER WALL_TIME RMS_PRESSURE RMS_ProgressVariable + +HISTORY_OUTPUT= RMS_RES AERO_COEFF FLOW_COEFF FLOW_COEFF_SURF + +VOLUME_OUTPUT= SOLUTION PRIMITIVE SOURCE RESIDUAL LOOKUP + +OUTPUT_FILES= (RESTART_ASCII) + +INNER_ITER= 1 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% + +MARKER_SYM= ( symmetry_ym, symmetry_yp ) + +MARKER_ISOTHERMAL= ( wall_burner, 450.0 ) + +INLET_MATCHING_TOLERANCE= 1e-5 + +INC_INLET_TYPE= VELOCITY_INLET + +MARKER_INLET= (inlet, 300.0, 0.4, 1.0, 0.0, 0.0) +MARKER_INLET_SPECIES= (inlet, 0.0, 0.0, 0.0, 0.0) + +INC_OUTLET_TYPE= PRESSURE_OUTLET +MARKER_OUTLET= (outlet, 0.0) +MARKER_SPECIES_STRONG_BC= (inlet, outlet, wall_burner) + +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% + +INC_DENSITY_MODEL= FLAMELET +INC_DENSITY_INIT= 1.1766 +INC_VELOCITY_INIT= ( 0.2, 0, 0 ) +INC_ENERGY_EQUATION= YES +INC_TEMPERATURE_INIT= 300.0 +INC_NONDIM= DIMENSIONAL + +% -------------------- FLUID MODEL --------------------------------------- % + +FLUID_MODEL= FLUID_FLAMELET +FILENAMES_INTERPOLATOR= (fgm_ch4.drg) +CONTROLLING_VARIABLE_NAMES= (ProgressVariable, EnthalpyTot) +CONTROLLING_VARIABLE_SOURCE_NAMES= (ProdRateTot_PV, NULL) +FLAME_INIT= (0.004, 0.0, 0.0, 1.0, 0.0, 0.0, 0.2e-3, 1.0) + +% -------------------- SPECIES TRANSPORT ---------------------------------------% + +USER_SCALAR_NAMES= (Y-CO, Y-NOx_tot) + +USER_SOURCE_NAMES= ( \ + ProdRatePos_Y-CO, ProdRateNegScaled_Y-CO ,\ + ProdRateTot_Y-NOx, zero) + +DIFFUSIVITY_CONSTANT= 0.00001 + +CONV_NUM_METHOD_SPECIES= BOUNDED_SCALAR +MUSCL_SPECIES= NO +SLOPE_LIMITER_SPECIES= NONE + +TIME_DISCRE_SPECIES= EULER_IMPLICIT + +SPECIES_INIT= (0, 0, 0, 0) +SPECIES_CLIPPING= NO +LOOKUP_NAMES= (MolarWeightMix, Conductivity, HeatRelease, Diffusivity, \ + ProdRatePos_Y-CO, ProdRateNegScaled_Y-CO ,\ + ProdRateTot_Y-NOx) + +% --------------------------- VISCOSITY MODEL ---------------------------------% + +CONDUCTIVITY_MODEL= FLAMELET +DIFFUSIVITY_MODEL= FLAMELET +KIND_SCALAR_MODEL= FLAMELET +VISCOSITY_MODEL= FLAMELET + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% + +%NUM_METHOD_GRAD= GREEN_GAUSS +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES + +CFL_NUMBER= 25 +CFL_ADAPT= NO + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% + +LINEAR_SOLVER= BCGSTAB +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-10 +LINEAR_SOLVER_ITER= 20 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% + +CONV_NUM_METHOD_FLOW= FDS +MUSCL_FLOW= NO +SLOPE_LIMITER_FLOW= NONE +VENKAT_LIMITER_COEFF= 10.0 +JST_SENSOR_COEFF= ( 0.5, 0.02 ) +TIME_DISCRE_FLOW= EULER_IMPLICIT diff --git a/TestCases/flamelet/03_laminar_premixed_ch4_flame_cht_cfd/lam_prem_ch4_cht_cfd_master.cfg b/TestCases/flamelet/03_laminar_premixed_ch4_flame_cht_cfd/lam_prem_ch4_cht_cfd_master.cfg new file mode 100644 index 00000000000..1ca70ab9d79 --- /dev/null +++ b/TestCases/flamelet/03_laminar_premixed_ch4_flame_cht_cfd/lam_prem_ch4_cht_cfd_master.cfg @@ -0,0 +1,55 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: flow through a heat exchanger, CHT setup % +% Author: Nijso Beishuizen, Ole Burghardt % +% Institution: Bosch Thermotechniek BV, Technical University of Kaiserslautern % +% Date: 24/11/2020 % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +SOLVER= MULTIPHYSICS + +CONFIG_LIST= ( lam_prem_ch4_cht_cfd_fluid.cfg, lam_prem_ch4_cht_cfd_solid.cfg ) + +%%%%%%%%%%%%%%%%%% +% Mesh stuff % +%%%%%%%%%%%%%%%%%% + +MESH_FORMAT= SU2 +MULTIZONE_MESH= YES + +% Restart flow input file +SOLUTION_FILENAME= solution + +% define the interface between the zones +MARKER_ZONE_INTERFACE= ( cht_interface_fluid, cht_interface_solid ) +MARKER_CHT_INTERFACE= ( cht_interface_fluid, cht_interface_solid ) + +CHT_COUPLING_METHOD= DIRECT_TEMPERATURE_ROBIN_HEATFLUX + +READ_BINARY_RESTART= NO +RESTART_SOL= YES + +RESTART_FILENAME= restart +RESTART_ADJ_FILENAME= restart_adj + +TIME_DOMAIN= NO +OUTER_ITER= 10 + +OUTPUT_WRT_FREQ= 500 +SCREEN_WRT_FREQ_INNER= 1 +SCREEN_WRT_FREQ_OUTER= 1 + +WRT_VOLUME_OVERWRITE= YES + +WRT_ZONE_CONV= YES +CONV_RESIDUAL_MINVAL= -20 + +VOLUME_FILENAME= fluid + +CONV_FILENAME= history + +% --------------------------- Optimization Parameters --------------------------% + +MESH_FILENAME= mesh_unstructured_cht.su2 diff --git a/TestCases/flamelet/03_laminar_premixed_ch4_flame_cht_cfd/lam_prem_ch4_cht_cfd_solid.cfg b/TestCases/flamelet/03_laminar_premixed_ch4_flame_cht_cfd/lam_prem_ch4_cht_cfd_solid.cfg new file mode 100644 index 00000000000..197980c4899 --- /dev/null +++ b/TestCases/flamelet/03_laminar_premixed_ch4_flame_cht_cfd/lam_prem_ch4_cht_cfd_solid.cfg @@ -0,0 +1,57 @@ + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% + +SOLVER= HEAT_EQUATION + +MARKER_PLOTTING= ( NONE ) +MARKER_MONITORING= ( NONE ) + +WRT_ZONE_HIST= YES +OUTPUT_FILES= ( RESTART_ASCII ) + +INC_NONDIM= DIMENSIONAL + +INNER_ITER= 1 + +% ---------------- (SOLIDS) CONDUCTION CONDITION DEFINITION -------------------% + +FREESTREAM_TEMPERATURE= 450.0 + +MATERIAL_DENSITY= 2700 + +THERMAL_CONDUCTIVITY_CONSTANT=200 + +SPECIFIC_HEAT_CP= 900 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% + +MARKER_ISOTHERMAL= ( wall_water, 350.0 ) + +% -------------------- HEAT NUMERICAL METHOD DEFINITION -----------------------% + +TIME_DISCRE_HEAT= EULER_IMPLICIT + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% + +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +CFL_NUMBER= 250 +CFL_ADAPT= NO + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% + +LINEAR_SOLVER= BCGSTAB +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1e-16 +LINEAR_SOLVER_ITER= 100 + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% + +TABULAR_FORMAT= CSV +CONV_FILENAME= history +VOLUME_FILENAME= solid +VOLUME_ADJ_FILENAME= adjoint +VALUE_OBJFUNC_FILENAME= of_eval.dat +SURFACE_FILENAME= surface_solid +SURFACE_ADJ_FILENAME= surface_adjoint + + diff --git a/TestCases/flamelet/04_laminar_premixed_ch4_flame_cht_ad/lam_prem_ch4_cht_ad_fluid.cfg b/TestCases/flamelet/04_laminar_premixed_ch4_flame_cht_ad/lam_prem_ch4_cht_ad_fluid.cfg new file mode 100644 index 00000000000..7824d6780fd --- /dev/null +++ b/TestCases/flamelet/04_laminar_premixed_ch4_flame_cht_ad/lam_prem_ch4_cht_ad_fluid.cfg @@ -0,0 +1,112 @@ + + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% + +SOLVER= INC_NAVIER_STOKES +KIND_TURB_MODEL= NONE + +MARKER_ANALYZE= (outlet) +MARKER_ANALYZE_AVERAGE= AREA + +MARKER_MONITORING= ( NONE ) +MARKER_PLOTTING= ( NONE ) + +WRT_ZONE_HIST= YES + +%SCREEN_OUTPUT= INNER_ITER WALL_TIME RMS_PRESSURE RMS_VELOCITY-X RMS_VELOCITY-Y RMS_TKE RMS_DISSIPATION LINSOL_ITER LINSOL_RESIDUAL RMS_ADJ_PRESSURE RMS_ADJ_VELOCITY-X RMS_ADJ_VELOCITY-Y + +SCREEN_OUTPUT= INNER_ITER WALL_TIME RMS_ADJ_PRESSURE RMS_ADJ_VELOCITY-X RMS_ADJ_VELOCITY-Y RMS_ADJ_ProgressVariable RMS_ADJ_EnthalpyTot RMS_ADJ_Y-CO RMS_ADJ_Y-NOx_tot + +HISTORY_OUTPUT= RMS_RES AERO_COEFF FLOW_COEFF FLOW_COEFF_SURF + +VOLUME_OUTPUT= SOLUTION PRIMITIVE SOURCE RESIDUAL LOOKUP + +OUTPUT_FILES= ( RESTART_ASCII) + +INNER_ITER= 1 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% + +MARKER_SYM= ( symmetry_ym, symmetry_yp ) + +MARKER_ISOTHERMAL= ( wall_burner, 450.0 ) + +INLET_MATCHING_TOLERANCE= 1e-5 + +INC_INLET_TYPE= VELOCITY_INLET + +MARKER_INLET= (inlet, 300.0, 0.4, 1.0, 0.0, 0.0) +MARKER_INLET_SPECIES= (inlet, 0.0, 0.0, 0.0, 0.0) + +INC_OUTLET_TYPE= PRESSURE_OUTLET +MARKER_OUTLET= (outlet, 0.0) +MARKER_SPECIES_STRONG_BC= (inlet, wall_burner) + +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% + +INC_DENSITY_MODEL= FLAMELET +INC_DENSITY_INIT= 1.1766 +INC_VELOCITY_INIT= ( 0.2, 0, 0 ) +INC_ENERGY_EQUATION= YES +INC_TEMPERATURE_INIT= 300.0 +INC_NONDIM= DIMENSIONAL + +% -------------------- FLUID MODEL --------------------------------------- % + +FLUID_MODEL= FLUID_FLAMELET +FILENAMES_INTERPOLATOR= (fgm_ch4.drg) +CONTROLLING_VARIABLE_NAMES= (ProgressVariable, EnthalpyTot) +CONTROLLING_VARIABLE_SOURCE_NAMES= (ProdRateTot_PV, NULL) +FLAME_INIT= (0.004, 0.0, 0.0, 1, 0, 0, 0.2e-3, 1) + +% -------------------- SPECIES TRANSPORT ---------------------------------------% + +USER_SCALAR_NAMES= (Y-CO, Y-NOx_tot) + +USER_SOURCE_NAMES= ( \ + ProdRatePos_Y-CO, ProdRateNegScaled_Y-CO ,\ + ProdRateTot_Y-NOx, zero) + +DIFFUSIVITY_CONSTANT= 0.00001 + +CONV_NUM_METHOD_SPECIES= BOUNDED_SCALAR +MUSCL_SPECIES= NO +SLOPE_LIMITER_SPECIES= NONE + +TIME_DISCRE_SPECIES= EULER_IMPLICIT + +SPECIES_INIT= (0, 0, 0, 0) +SPECIES_CLIPPING= NO +LOOKUP_NAMES= (MolarWeightMix, Conductivity, HeatRelease, Diffusivity, \ + ProdRatePos_Y-CO, ProdRateNegScaled_Y-CO ,\ + ProdRateTot_Y-NOx) + +% --------------------------- VISCOSITY MODEL ---------------------------------% + +CONDUCTIVITY_MODEL= FLAMELET +DIFFUSIVITY_MODEL= FLAMELET +KIND_SCALAR_MODEL= FLAMELET +VISCOSITY_MODEL= FLAMELET + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% + +%NUM_METHOD_GRAD= GREEN_GAUSS +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +CFL_NUMBER= 25 +CFL_ADAPT= NO + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% + +LINEAR_SOLVER= BCGSTAB +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-10 +LINEAR_SOLVER_ITER= 20 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% + +CONV_NUM_METHOD_FLOW= FDS +MUSCL_FLOW= NO +SLOPE_LIMITER_FLOW= NONE +VENKAT_LIMITER_COEFF= 10.0 +JST_SENSOR_COEFF= ( 0.5, 0.02 ) +TIME_DISCRE_FLOW= EULER_IMPLICIT diff --git a/TestCases/flamelet/04_laminar_premixed_ch4_flame_cht_ad/lam_prem_ch4_cht_ad_master.cfg b/TestCases/flamelet/04_laminar_premixed_ch4_flame_cht_ad/lam_prem_ch4_cht_ad_master.cfg new file mode 100644 index 00000000000..e3e9a0597c1 --- /dev/null +++ b/TestCases/flamelet/04_laminar_premixed_ch4_flame_cht_ad/lam_prem_ch4_cht_ad_master.cfg @@ -0,0 +1,97 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: flow through a heat exchanger, CHT setup % +% Author: Nijso Beishuizen, Ole Burghardt % +% Institution: Bosch Thermotechniek BV, Technical University of Kaiserslautern % +% Date: 24/11/2020 % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +SOLVER= MULTIPHYSICS + +CONFIG_LIST= ( lam_prem_ch4_cht_ad_fluid.cfg, lam_prem_ch4_cht_ad_solid.cfg ) + + +%%%%%%%%%%%%%%%%%% +% Mesh stuff % +%%%%%%%%%%%%%%%%%% + + +MESH_FILENAME= mesh_unstructured_cht.su2 +% MESH_OUT_FILENAME= mesh_def.su2 + +MESH_FORMAT= SU2 +MULTIZONE_MESH= YES + +% Restart flow input file +SOLUTION_FILENAME= solution +READ_BINARY_RESTART= NO +RESTART_SOL= YES +RESTART_FILENAME= restart +RESTART_ADJ_FILENAME= restart_adj +SOLUTION_ADJ_FILENAME= solution_adj + +% define the interface between the zones +MARKER_ZONE_INTERFACE= ( cht_interface_fluid, cht_interface_solid ) +MARKER_CHT_INTERFACE= ( cht_interface_fluid, cht_interface_solid ) + +CHT_COUPLING_METHOD= DIRECT_TEMPERATURE_ROBIN_HEATFLUX + +TIME_DOMAIN= NO +OUTER_ITER = 1100 + +OUTPUT_WRT_FREQ= 50 +SCREEN_WRT_FREQ_INNER= 1 +SCREEN_WRT_FREQ_OUTER= 1 + +WRT_VOLUME_OVERWRITE= YES + +WRT_ZONE_CONV= YES +CONV_RESIDUAL_MINVAL= -20 + +VOLUME_FILENAME= fluid + +CONV_FILENAME= history + +% --------------------------- Optimization Parameters --------------------------% + +GRAD_OBJFUNC_FILENAME= of_grad.csv + +OBJECTIVE_FUNCTION= SURFACE_STATIC_TEMPERATURE +OBJECTIVE_WEIGHT= 1.0 + +DV_KIND= \ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D + +DV_MARKER= ( cht_interface_fluid, cht_interface_solid ) + +DV_PARAM= \ + (BOX, 0, 0, 1.0, 1.0); \ + (BOX, 2, 0, 1.0, 1.0); \ + (BOX, 2, 2, 1.0, 1.0); \ + (BOX, 0, 2, 1.0, 1.0); \ +% + (BOX, 1, 0, 0.0, 1.0); \ + (BOX, 2, 1, 1.0, 0.0); \ + (BOX, 1, 2, 0.0, 1.0); \ + (BOX, 0, 1, 1.0, 0.0) + +FFD_DEFINITION= (BOX, 0.0089, 0.0006, 0.0, 0.018, 0.0006, 0.0, 0.018, 0.0018, 0.0, 0.0089, 0.0018, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) +FFD_DEGREE= ( 2, 1, 0) +FFD_CONTINUITY= 1ST_DERIVATIVE +FFD_FIX_I= (100) +FFD_FIX_J= (100) +FFD_ITERATIONS= 1000 +FFD_TOLERANCE= 1E-10 + +DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME + +DV_VALUE=0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 diff --git a/TestCases/flamelet/04_laminar_premixed_ch4_flame_cht_ad/lam_prem_ch4_cht_ad_solid.cfg b/TestCases/flamelet/04_laminar_premixed_ch4_flame_cht_ad/lam_prem_ch4_cht_ad_solid.cfg new file mode 100644 index 00000000000..197980c4899 --- /dev/null +++ b/TestCases/flamelet/04_laminar_premixed_ch4_flame_cht_ad/lam_prem_ch4_cht_ad_solid.cfg @@ -0,0 +1,57 @@ + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% + +SOLVER= HEAT_EQUATION + +MARKER_PLOTTING= ( NONE ) +MARKER_MONITORING= ( NONE ) + +WRT_ZONE_HIST= YES +OUTPUT_FILES= ( RESTART_ASCII ) + +INC_NONDIM= DIMENSIONAL + +INNER_ITER= 1 + +% ---------------- (SOLIDS) CONDUCTION CONDITION DEFINITION -------------------% + +FREESTREAM_TEMPERATURE= 450.0 + +MATERIAL_DENSITY= 2700 + +THERMAL_CONDUCTIVITY_CONSTANT=200 + +SPECIFIC_HEAT_CP= 900 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% + +MARKER_ISOTHERMAL= ( wall_water, 350.0 ) + +% -------------------- HEAT NUMERICAL METHOD DEFINITION -----------------------% + +TIME_DISCRE_HEAT= EULER_IMPLICIT + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% + +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +CFL_NUMBER= 250 +CFL_ADAPT= NO + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% + +LINEAR_SOLVER= BCGSTAB +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1e-16 +LINEAR_SOLVER_ITER= 100 + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% + +TABULAR_FORMAT= CSV +CONV_FILENAME= history +VOLUME_FILENAME= solid +VOLUME_ADJ_FILENAME= adjoint +VALUE_OBJFUNC_FILENAME= of_eval.dat +SURFACE_FILENAME= surface_solid +SURFACE_ADJ_FILENAME= surface_adjoint + + diff --git a/TestCases/flamelet/04_laminar_premixed_ch4_flame_cht_ad/lam_prem_ch4_cht_dot_master.cfg b/TestCases/flamelet/04_laminar_premixed_ch4_flame_cht_ad/lam_prem_ch4_cht_dot_master.cfg new file mode 100644 index 00000000000..4a3e831b6c6 --- /dev/null +++ b/TestCases/flamelet/04_laminar_premixed_ch4_flame_cht_ad/lam_prem_ch4_cht_dot_master.cfg @@ -0,0 +1,97 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: flow through a heat exchanger, CHT setup % +% Author: Nijso Beishuizen, Ole Burghardt % +% Institution: Bosch Thermotechniek BV, Technical University of Kaiserslautern % +% Date: 24/11/2020 % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +SOLVER= MULTIPHYSICS + +CONFIG_LIST= ( lam_prem_ch4_cht_ad_fluid.cfg, lam_prem_ch4_cht_ad_solid.cfg ) + + +%%%%%%%%%%%%%%%%%% +% Mesh stuff % +%%%%%%%%%%%%%%%%%% + + +MESH_FILENAME= mesh_unstructured_cht.su2 +% MESH_OUT_FILENAME= mesh_def.su2 + +MESH_FORMAT= SU2 +MULTIZONE_MESH= YES + +% Restart flow input file +SOLUTION_FILENAME= solution +READ_BINARY_RESTART= NO +RESTART_SOL= YES +RESTART_FILENAME= restart +RESTART_ADJ_FILENAME= restart_adj +SOLUTION_ADJ_FILENAME= restart_adj + +% define the interface between the zones +MARKER_ZONE_INTERFACE= ( cht_interface_fluid, cht_interface_solid ) +MARKER_CHT_INTERFACE= ( cht_interface_fluid, cht_interface_solid ) + +CHT_COUPLING_METHOD= DIRECT_TEMPERATURE_ROBIN_HEATFLUX + +TIME_DOMAIN= NO +OUTER_ITER = 11 + +OUTPUT_WRT_FREQ= 500 +SCREEN_WRT_FREQ_INNER= 1 +SCREEN_WRT_FREQ_OUTER= 1 + +WRT_VOLUME_OVERWRITE= YES + +WRT_ZONE_CONV= YES +CONV_RESIDUAL_MINVAL= -20 + +VOLUME_FILENAME= fluid + +CONV_FILENAME= history + +% --------------------------- Optimization Parameters --------------------------% + +GRAD_OBJFUNC_FILENAME= of_grad.csv + +OBJECTIVE_FUNCTION= SURFACE_STATIC_TEMPERATURE +OBJECTIVE_WEIGHT= 1.0 + +DV_KIND= \ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D,\ +FFD_CONTROL_POINT_2D + +DV_MARKER= ( cht_interface_fluid, cht_interface_solid ) + +DV_PARAM= \ + (BOX, 0, 0, 1.0, 1.0); \ + (BOX, 2, 0, 1.0, 1.0); \ + (BOX, 2, 2, 1.0, 1.0); \ + (BOX, 0, 2, 1.0, 1.0); \ +% + (BOX, 1, 0, 0.0, 1.0); \ + (BOX, 2, 1, 1.0, 0.0); \ + (BOX, 1, 2, 0.0, 1.0); \ + (BOX, 0, 1, 1.0, 0.0) + +FFD_DEFINITION= (BOX, 0.0089, 0.0006, 0.0, 0.018, 0.0006, 0.0, 0.018, 0.0018, 0.0, 0.0089, 0.0018, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0) +FFD_DEGREE= ( 2, 1, 0) +FFD_CONTINUITY= 1ST_DERIVATIVE +FFD_FIX_I= (100) +FFD_FIX_J= (100) +FFD_ITERATIONS= 1000 +FFD_TOLERANCE= 1E-10 + +DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME + +DV_VALUE=0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0 diff --git a/TestCases/flamelet/05_laminar_premixed_ch4_flame_cfd_axi/lam_prem_ch4_cfd_axi.cfg b/TestCases/flamelet/05_laminar_premixed_ch4_flame_cfd_axi/lam_prem_ch4_cfd_axi.cfg new file mode 100644 index 00000000000..d2750fcae1d --- /dev/null +++ b/TestCases/flamelet/05_laminar_premixed_ch4_flame_cfd_axi/lam_prem_ch4_cfd_axi.cfg @@ -0,0 +1,138 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% SU2 configuration file % +% Case description: Laminar premixed flame stabilized on isothermal burner % +% axisymmetric setup % +% Author: Nijso Beishuizen % +% Institution: Bosch Thermotechnology % +% Date: 08/09/2021 % +% File Version 8.0.0 "Harrier", % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= INC_NAVIER_STOKES +KIND_TURB_MODEL= NONE +MATH_PROBLEM= DIRECT +RESTART_SOL= YES +% +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +INC_DENSITY_MODEL= FLAMELET +INC_ENERGY_EQUATION= YES +INC_DENSITY_INIT= 1.00 +INC_VELOCITY_INIT= (0.5, 0.0, 0.0 ) +INC_TEMPERATURE_INIT= 300.0 +INC_NONDIM= DIMENSIONAL +% +% +AXISYMMETRIC= YES +% -------------------- FLUID MODEL --------------------------------------- % +% +FLUID_MODEL= FLUID_FLAMELET +FILENAMES_INTERPOLATOR= (fgm_ch4.drg) +CONTROLLING_VARIABLE_NAMES= (ProgressVariable, EnthalpyTot) +CONTROLLING_VARIABLE_SOURCE_NAMES= (ProdRateTot_PV, NULL) +% +% -------------------- SCALAR TRANSPORT ---------------------------------------% +% +KIND_SCALAR_MODEL= FLAMELET +DIFFUSIVITY_MODEL= FLAMELET +VISCOSITY_MODEL= FLAMELET +CONDUCTIVITY_MODEL= FLAMELET +FLAME_INIT= (0.0032, 0.0, 0.0, 1, 0.1, 0, 1e-3, 0.1) +% # progvar, enthalpy +SPECIES_INIT= (0.0, -210000, 0.0, 0.0) +CONV_NUM_METHOD_SPECIES= BOUNDED_SCALAR +%CONV_NUM_METHOD_SPECIES= SCALAR_UPWIND +MUSCL_SPECIES= YES +SLOPE_LIMITER_SPECIES= NONE +TIME_DISCRE_SPECIES= EULER_IMPLICIT +% SCALAR CLIPPING +SPECIES_CLIPPING= YES +SPECIES_CLIPPING_MIN= 0 -2e6 0 0 +SPECIES_CLIPPING_MAX= 1 2e6 1 1 +% +MARKER_INLET_SPECIES= (inlet, 0, -193600.0, 0.0, 0.0) +CFL_REDUCTION_SPECIES= 1.0 +MARKER_SPECIES_STRONG_BC= (inlet, outlet, wall) +LOOKUP_NAMES= (MolarWeightMix, Conductivity, Cp, HeatRelease, Diffusivity) +USER_SCALAR_NAMES= (CO, NOx) +USER_SOURCE_NAMES= ( \ + ProdRatePos_Y-CO, ProdRateNegScaled_Y-CO ,\ + ProdRateTot_Y-NOx, NULL ) +% +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% +% +REF_ORIGIN_MOMENT_X= 0.25 +REF_ORIGIN_MOMENT_Y= 0.00 +REF_ORIGIN_MOMENT_Z= 0.00 +REF_LENGTH= 1.0 +REF_AREA= 1.0 +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_ISOTHERMAL= (wall, 450) +MARKER_SYM= (symmetry, symmetry_2-part-fluid) +INC_INLET_TYPE= VELOCITY_INLET +MARKER_INLET= (inlet, 300.0, 0.20, 1.0, 0.0, 0.0) +INC_OUTLET_TYPE= PRESSURE_OUTLET +MARKER_OUTLET= (outlet, 0.0) +MARKER_PLOTTING= ( wall ) +MARKER_MONITORING= ( wall ) +MARKER_ANALYZE= ( inlet,outlet ) +MARKER_ANALYZE_AVERAGE= AREA +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +CFL_NUMBER= 20 +CFL_ADAPT= NO +ITER= 10000 +OUTPUT_WRT_FREQ= 100 +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-10 +LINEAR_SOLVER_ITER= 25 +% +% -------------------------- MULTIGRID PARAMETERS -----------------------------% +% +MGLEVEL= 0 +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= FDS +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW= NONE +TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_RESIDUAL_MINVAL= -15 +CONV_STARTITER= 10 +CONV_CAUCHY_ELEMS= 100 +CONV_CAUCHY_EPS= 1E-6 +SCREEN_OUTPUT= INNER_ITER WALL_TIME RMS_VELOCITY-X RMS_VELOCITY-Y RMS_PRESSURE RMS_ProgressVariable RMS_EnthalpyTot +HISTORY_OUTPUT= RMS_RES AERO_COEFF FLOW_COEFF FLOW_COEFF_SURF +VOLUME_OUTPUT= SOLUTION PRIMITIVE SOURCE RESIDUAL SENSITIVITY LOOKUP TIMESTEP +CONV_FIELD= RMS_PRESSURE +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +MESH_FORMAT= SU2 +MESH_FILENAME= mesh_axi.su2 +MESH_OUT_FILENAME= mesh_out.su2 +SOLUTION_FILENAME= solution +RESTART_FILENAME= restart +%OUTPUT_FILES= (RESTART,PARAVIEW,PARAVIEW_MULTIBLOCK) +OUTPUT_FILES= (RESTART) +TABULAR_FORMAT= CSV +CONV_FILENAME= history +VOLUME_FILENAME= flow +SURFACE_FILENAME= surface_flow +WRT_PERFORMANCE= NO +SCREEN_WRT_FREQ_INNER= 1 +SCREEN_WRT_FREQ_OUTER= 1 diff --git a/TestCases/flamelet/06_laminar_partial_premixed_ch4_flame_cfd/lam_partial_prem_ch4_cfd.cfg b/TestCases/flamelet/06_laminar_partial_premixed_ch4_flame_cfd/lam_partial_prem_ch4_cfd.cfg new file mode 100644 index 00000000000..1ac7c1ebf67 --- /dev/null +++ b/TestCases/flamelet/06_laminar_partial_premixed_ch4_flame_cfd/lam_partial_prem_ch4_cfd.cfg @@ -0,0 +1,141 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% SU2 configuration file % +% Case description: Laminar premixed flame stabilized on isothermal burner % +% Author: Nijso Beishuizen % +% Institution: Bosch Thermotechnology % +% Date: 16/06/2023 % +% File Version 8.0.0 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER = INC_NAVIER_STOKES +KIND_TURB_MODEL= NONE +MATH_PROBLEM= DIRECT +RESTART_SOL= YES +% +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +INC_DENSITY_MODEL= VARIABLE +INC_ENERGY_EQUATION = YES +INC_DENSITY_INIT= 1.00 +INC_VELOCITY_INIT= (0.7, 0.0, 0.0 ) +INC_TEMPERATURE_INIT= 300.0 +INC_NONDIM= DIMENSIONAL +% +% -------------------- FLUID MODEL --------------------------------------- % +% +FLUID_MODEL= FLUID_FLAMELET +FILENAMES_INTERPOLATOR= (LUT_methane_3D.drg) +% FGM controlling variable names (must include mixture fraction for partial +% premixed cases) +CONTROLLING_VARIABLE_NAMES=(ProgressVariable,EnthalpyTot,MixtureFraction) + +CONTROLLING_VARIABLE_SOURCE_NAMES=(ProdRateTot_PV,NULL,NULL) +% -------------------- SCALAR TRANSPORT ---------------------------------------% +% +KIND_SCALAR_MODEL= FLAMELET +DIFFUSIVITY_MODEL= FLAMELET +VISCOSITY_MODEL= FLAMELET +CONDUCTIVITY_MODEL= FLAMELET +FLAME_INIT= (0.003, 0.00, 0.00, 1.0, 0.0, 0.0, 1e-4, 1.0) +% # progvar, enthalpy, mixture fraction, Y-CO, Y-CO2 +SPECIES_INIT = (0.0, -253498.718914723, 0.05, 0.0, 0.0) +CONV_NUM_METHOD_SPECIES= BOUNDED_SCALAR +MUSCL_SPECIES= YES +SLOPE_LIMITER_SPECIES= NONE +TIME_DISCRE_SPECIES= EULER_IMPLICIT +% SCALAR CLIPPING +SPECIES_CLIPPING= YES +SPECIES_CLIPPING_MIN= 0 -3.0e6 0 0 0 +SPECIES_CLIPPING_MAX= 0.3 2e6 1 1 1 +% +MARKER_INLET_SPECIES = (inlet_rich, 0.0, -253498.718914723, 0.06, 0.0, 0.0,\ + inlet_lean, 0.0, -253498.718914723, 0.04, 0.0, 0.0) +CFL_REDUCTION_SPECIES= 1.0 +MARKER_SPECIES_STRONG_BC= (inlet_rich,inlet_lean, burner_wall, hex_wall) +LOOKUP_NAMES = (MolarWeightMix, Conductivity, Cp, ProdRateTot_PV) +USER_SCALAR_NAMES= (CO, CO2) +USER_SOURCE_NAMES = ( \ + ProdRateTot_Y-CO, NULL ,\ + ProdRateTot_Y-CO2, NULL +) +% +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% +% +REF_ORIGIN_MOMENT_X = 0.25 +REF_ORIGIN_MOMENT_Y = 0.00 +REF_ORIGIN_MOMENT_Z = 0.00 +REF_LENGTH= 1.0 +REF_AREA= 1.0 +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_ISOTHERMAL= (burner_wall, 400, hex_wall, 500) +MARKER_HEATFLUX= (mixing_edge, 0.0) +MARKER_SYM= (sides) +INC_INLET_TYPE= VELOCITY_INLET,VELOCITY_INLET +MARKER_INLET = (inlet_rich, 300.000, 0.3, 1.0, 0.0, 0.0,\ + inlet_lean, 300.000, 0.25, 1.0, 0.0, 0.0) +INC_OUTLET_TYPE= PRESSURE_OUTLET +INC_INLET_DAMPING = 0.05 +INC_OUTLET_DAMPING = 0.05 +MARKER_OUTLET= (outlet, 0.0) +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +CFL_NUMBER= 20 +CFL_ADAPT= NO +ITER= 10 +OUTPUT_WRT_FREQ= 20 +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-03 +LINEAR_SOLVER_ITER= 10 +% +% -------------------------- MULTIGRID PARAMETERS -----------------------------% +% +MGLEVEL= 0 +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= FDS +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW = NONE +TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_RESIDUAL_MINVAL= -15 +CONV_STARTITER= 10 +CONV_CAUCHY_ELEMS= 100 +CONV_CAUCHY_EPS= 1E-6 +SCREEN_OUTPUT = INNER_ITER RMS_VELOCITY-X RMS_VELOCITY-Y RMS_PRESSURE RMS_ProgressVariable RMS_EnthalpyTot RMS_MixtureFraction RMS_CO2 +HISTORY_OUTPUT = RMS_RES AERO_COEFF FLOW_COEFF FLOW_COEFF_SURF +VOLUME_OUTPUT = SOLUTION PRIMITIVE SOURCE RESIDUAL SENSITIVITY LOOKUP TIMESTEP +CONV_FIELD = RMS_PRESSURE +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +OUTPUT_PRECISION= 16 +MESH_FORMAT= SU2 +MESH_FILENAME= mesh_unstructured.su2 +MESH_OUT_FILENAME= mesh_out.su2 +SOLUTION_FILENAME= solution +RESTART_FILENAME= restart +%OUTPUT_FILES = (RESTART,PARAVIEW,PARAVIEW_MULTIBLOCK) +OUTPUT_FILES = (RESTART,PARAVIEW) +TABULAR_FORMAT = CSV +CONV_FILENAME= history +VOLUME_FILENAME= ch4_flame_cfd +SURFACE_FILENAME= surface_flow +WRT_PERFORMANCE = NO +SCREEN_WRT_FREQ_INNER = 1 +SCREEN_WRT_FREQ_OUTER = 1 + + diff --git a/TestCases/flamelet/README.md b/TestCases/flamelet/README.md new file mode 100644 index 00000000000..5ae4def7851 --- /dev/null +++ b/TestCases/flamelet/README.md @@ -0,0 +1,9 @@ +# Flamelet regression cases + +## laminar_premixed_flame +1. A laminar premixed flame stabilized on an isothermal burner with a fixed wall temperature using a low resolution look-up table for all thermo-chemical quantities. +2. A laminar premixed flame including a heat exchanger, AD test. +3. A laminar premixed flame including a heat exchanger (Conjugate Heat Transfer). +4. A laminar premixed flame including a heat exchanger (Conjugate Heat Transfer), AD test. +5. An axisymmetric laminar premixed flame. +6. A laminar, partially premixed flame including a heat exchanger. \ No newline at end of file diff --git a/TestCases/grad_smooth/naca0012/inv_NACA0012_gradsmooth.cfg b/TestCases/grad_smooth/naca0012/inv_NACA0012_gradsmooth.cfg index 902aeab7030..ce3989662c2 100644 --- a/TestCases/grad_smooth/naca0012/inv_NACA0012_gradsmooth.cfg +++ b/TestCases/grad_smooth/naca0012/inv_NACA0012_gradsmooth.cfg @@ -4,7 +4,7 @@ % Case description: Sobolev smoothing for gradient on the NACA 0012 airfoil % % Author: Thomas Dick (TU Kaiserslautern) % % Date: 11.11.2021 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/grad_smooth/oneram6/ONERAM6_gradsmooth.cfg b/TestCases/grad_smooth/oneram6/ONERAM6_gradsmooth.cfg index 0b720e65c58..354c0681020 100644 --- a/TestCases/grad_smooth/oneram6/ONERAM6_gradsmooth.cfg +++ b/TestCases/grad_smooth/oneram6/ONERAM6_gradsmooth.cfg @@ -4,7 +4,7 @@ % Case description: Sobolev smoothing for gradient on the ONERA M6 wing % % Author: Thomas Dick (TU Kaiserslautern) % % Date: 11.11.2021 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/gust/cosine_gust_zdir.cfg b/TestCases/gust/cosine_gust_zdir.cfg new file mode 100644 index 00000000000..402bd5ca232 --- /dev/null +++ b/TestCases/gust/cosine_gust_zdir.cfg @@ -0,0 +1,111 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Cosine gust in z-direction of a 3D mesh % +% Author: Arne Voß % +% Institution: DLR % +% Date: 25.05.2023 % +% File Version 8.0.0 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= EULER +MATH_PROBLEM= DIRECT +% +RESTART_SOL= YES +RESTART_ITER= 72 +% +% ------------------------------- SOLVER CONTROL ------------------------------% +% +INNER_ITER= 30 +CONV_RESIDUAL_MINVAL= -6 +CONV_STARTITER= 0 +% +% ------------------------- UNSTEADY SIMULATION -------------------------------% +% +TIME_DOMAIN=YES +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER +TIME_STEP= 0.001 +TIME_ITER= 80 +% +% --------------------------- GUST SIMULATION ---------------------------------% +% +% The gust simulation requires the GRID_MOVEMENT flag to be set to YES. +% and the GRID_MOVEMENT_KIND to be set to GUST or any of the other options. +% Apply a wind gust (NO, YES) +GRID_MOVEMENT=GUST +WIND_GUST= YES +GUST_TYPE= ONE_M_COSINE +GUST_DIR= Z_DIR +GUST_WAVELENGTH= 5.0 +GUST_PERIODS= 1.0 +% Gust amplitude corresponds to ~2.0 deg AoA +GUST_AMPL= 2.37 +% +GUST_BEGIN_TIME= 0.0 +% Gust is placed 5m ahead of the wing +GUST_BEGIN_LOC=-10.0 +% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% +% +MACH_NUMBER= 0.2 +AOA= 0.0 +SIDESLIP_ANGLE= 0.0 +FREESTREAM_OPTION= DENSITY_FS +FREESTREAM_PRESSURE= 101325.0 +FREESTREAM_DENSITY= 1.225 +FREESTREAM_TEMPERATURE= 288.15 +% +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% +% +REF_ORIGIN_MOMENT_X = 0.25 +REF_ORIGIN_MOMENT_Y = 0.00 +REF_ORIGIN_MOMENT_Z = 0.00 +REF_LENGTH= 1.0 +REF_AREA= 3.0 +SEMI_SPAN= 1.5 +REF_DIMENSIONALIZATION= DIMENSIONAL + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_EULER= ( wing, tip) +MARKER_FAR= ( far_away ) + +% ------------------------ SURFACES IDENTIFICATION ----------------------------% +% +MARKER_PLOTTING = ( wing, tip ) +MARKER_MONITORING = ( wing, tip ) + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +CFL_NUMBER= 1000.0 +CFL_ADAPT= YES +% +% -------------------------- MULTIGRID PARAMETERS -----------------------------% +% +MGLEVEL= 3 +MGCYCLE= W_CYCLE + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= JST +LINEAR_SOLVER_ITER= 20 +% +% ------------------------- SCREEN/HISTORY VOLUME OUTPUT --------------------------% +% +SCREEN_OUTPUT= (TIME_ITER, INNER_ITER, RMS_DENSITY, LIFT, MOMENT_X, MOMENT_Y, MOMENT_Z) +HISTORY_OUTPUT= (ITER, RMS_RES, AERO_COEFF, CAUCHY, WALL_TIME) +% +% ------------------------- INPUT/OUTPUT FILE INFORMATION --------------------------% +% +MESH_FILENAME= mesh_rectangular_wing.su2 +MESH_FORMAT= SU2 +SOLUTION_FILENAME= restart_gust.dat +RESTART_FILENAME= restart_gust.dat +SURFACE_FILENAME= surface_gust +VOLUME_FILENAME= volume_gust +CONV_FILENAME= history_gust +TABULAR_FORMAT= CSV +OUTPUT_FILES= (RESTART, RESTART_ASCII) +% \ No newline at end of file diff --git a/TestCases/gust/gust_with_mesh_deformation.cfg b/TestCases/gust/gust_with_mesh_deformation.cfg new file mode 100644 index 00000000000..b9b956d7721 --- /dev/null +++ b/TestCases/gust/gust_with_mesh_deformation.cfg @@ -0,0 +1,122 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Cosine gust combined with mesh deformation % +% Author: Arne Voß % +% Institution: DLR % +% Date: 25.05.2023 % +% File Version 8.0.0 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= EULER +MATH_PROBLEM= DIRECT +% ------------------------------- SOLVER CONTROL ------------------------------% +% +INNER_ITER= 100 +CONV_RESIDUAL_MINVAL= -6 +CONV_STARTITER= 0 +% +% ------------------------- UNSTEADY SIMULATION -------------------------------% +% +TIME_DOMAIN=YES +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER +TIME_STEP= 0.001 +TIME_ITER= 7 +% +% --------------------------- GUST SIMULATION ---------------------------------% +% +% The gust simulation requires the GRID_MOVEMENT flag to be set to YES. +% and the GRID_MOVEMENT_KIND to be set to GUST or any of the other options. +% Apply a wind gust (NO, YES) +GRID_MOVEMENT=GUST +WIND_GUST= YES +GUST_TYPE= ONE_M_COSINE +GUST_DIR= Y_DIR +GUST_WAVELENGTH= 5.0 +GUST_PERIODS= 1.0 +GUST_AMPL= 1.0 +GUST_BEGIN_TIME= 0.0 +GUST_BEGIN_LOC=-5.0 +% +% --------------------------- MESH DEFORMATION--------------------------------% +% Type of dynamic surface movement (NONE, DEFORMING, MOVING_WALL, +% AEROELASTIC, AEROELASTIC_RIGID_MOTION EXTERNAL, EXTERNAL_ROTATION) +SURFACE_MOVEMENT= DEFORMING +% +% Moving wall boundary marker(s) (NONE = no marker, ignored for RIGID_MOTION) +MARKER_MOVING= ( airfoil ) +% +% Plunging angular freq. (rad/s) in x, y, & z directions +SURFACE_PLUNGING_OMEGA= 0.0 125.6 0.0 +% +% Plunging amplitude (m or ft) in x, y, & z directions +SURFACE_PLUNGING_AMPL= 0.0 0.0001 0.0 +% +% Move Motion Origin for marker moving (1 or 0) +MOVE_MOTION_ORIGIN = 0 +% +% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% +% +MACH_NUMBER= 0.2 +AOA= 0.0 +SIDESLIP_ANGLE= 0.0 +FREESTREAM_OPTION= DENSITY_FS +FREESTREAM_PRESSURE= 101325.0 +FREESTREAM_DENSITY= 1.225 +FREESTREAM_TEMPERATURE= 288.15 +% +% ---------------------- REFERENCE VALUE DEFINITION ---------------------------% +% +REF_ORIGIN_MOMENT_X = 0.25 +REF_ORIGIN_MOMENT_Y = 0.00 +REF_ORIGIN_MOMENT_Z = 0.00 +REF_LENGTH= 1.0 +REF_AREA= 1.0 +SEMI_SPAN= 1.0 +REF_DIMENSIONALIZATION= DIMENSIONAL +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_EULER= ( airfoil ) +MARKER_FAR= ( farfield ) +% +% ------------------------ SURFACES IDENTIFICATION ----------------------------% +% +MARKER_PLOTTING = ( airfoil ) +MARKER_MONITORING = ( airfoil ) +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +CFL_NUMBER= 100.0 +CFL_ADAPT= YES +% +% -------------------------- MULTIGRID PARAMETERS -----------------------------% +% +MGLEVEL= 3 +MGCYCLE= W_CYCLE +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= JST +LINEAR_SOLVER_ITER= 20 +% +% ------------------------- SCREEN/HISTORY VOLUME OUTPUT --------------------------% +% +SCREEN_OUTPUT= (TIME_ITER, INNER_ITER, RMS_DENSITY, LIFT, MOMENT_Z) +HISTORY_OUTPUT= (ITER, RMS_RES, AERO_COEFF, CAUCHY, WALL_TIME) +% +% ------------------------- INPUT/OUTPUT FILE INFORMATION --------------------------% +% +MESH_FILENAME= mesh_NACA0012_inv.su2 +MESH_FORMAT= SU2 +SOLUTION_FILENAME= restart_gust.dat +RESTART_FILENAME= restart_gust.dat +SURFACE_FILENAME= surface_gust +VOLUME_FILENAME= volume_gust +CONV_FILENAME= history_gust +TABULAR_FORMAT= CSV +OUTPUT_FILES= (NONE) +% \ No newline at end of file diff --git a/TestCases/gust/inv_gust_NACA0012.cfg b/TestCases/gust/inv_gust_NACA0012.cfg index 4cf8daa5f62..f91ffedf7ab 100644 --- a/TestCases/gust/inv_gust_NACA0012.cfg +++ b/TestCases/gust/inv_gust_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Santiago Padron % % Institution: Stanford University % % Date: 06-26-2015 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -46,7 +46,7 @@ MACH_MOTION= 0.2 % --------------------------- GUST SIMULATION ---------------------------------% % % The gust simulation requires the GRID_MOVEMENT flag to be set to YES. -% and the GRID_MOVEMENT_KIND to be set to GUST or any of the other options. +% and the GRID_MOVEMENT_KIND to be set to GUST or any of the other options. % Apply a wind gust (NO, YES) WIND_GUST = YES GUST_TYPE = SINE @@ -102,8 +102,6 @@ MG_DAMP_PROLONGATION= 0.75 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN ENTROPY_FIX_COEFF= 0.001 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT diff --git a/TestCases/harmonic_balance/HB.cfg b/TestCases/harmonic_balance/HB.cfg index a8cc80f3495..57b4bd0b9a1 100644 --- a/TestCases/harmonic_balance/HB.cfg +++ b/TestCases/harmonic_balance/HB.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2016.20.09 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -27,7 +27,7 @@ GRID_MOVEMENT= RIGID_MOTION MOTION_ORIGIN= ( 0.248 0.0 0.0 ) PITCHING_OMEGA= ( 0.0 0.0 106.69842) PITCHING_AMPL= ( 0.0 0.0 1.01 ) - + % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % MACH_NUMBER= 0.796 @@ -55,7 +55,7 @@ CFL_NUMBER= 1.0 CFL_ADAPT= NO CFL_ADAPT_PARAM= ( 1.5, 0.5, 1.0, 100.0 ) RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) -ITER= 70000 +ITER= 30 % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % @@ -67,8 +67,6 @@ LINEAR_SOLVER_ITER= 5 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= NONE VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -77,8 +75,6 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % OBJECTIVE_FUNCTION= DRAG CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_SHARP_LIMITER_COEFF= 3.0 ADJ_JST_SENSOR_COEFF= ( 0.0, 0.02 ) CFL_REDUCTION_ADJFLOW= 0.6 @@ -109,6 +105,7 @@ CONV_CAUCHY_EPS= 1E-6 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % +SCREEN_OUTPUT= INNER_ITER, RMS_RES MESH_FILENAME= mesh_NACA64A010_inv.su2 MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 @@ -129,4 +126,4 @@ OUTPUT_WRT_FREQ= 500 % OPT_OBJECTIVE= DRAG * 0.001 OPT_CONSTRAINT= NONE -DEFINITION_DV= ( 30, 1.0 | airfoil | 1, 0.75 ) +DEFINITION_DV= ( 30, 1.0 | airfoil | 1, 0.75 ) diff --git a/TestCases/harmonic_balance/hb_rans_preconditioning/davis.cfg b/TestCases/harmonic_balance/hb_rans_preconditioning/davis.cfg index 9ab79f61443..bd52f939081 100644 --- a/TestCases/harmonic_balance/hb_rans_preconditioning/davis.cfg +++ b/TestCases/harmonic_balance/hb_rans_preconditioning/davis.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2016.20.09 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -67,16 +67,10 @@ LINEAR_SOLVER_PREC= LU_SGS LINEAR_SOLVER_ERROR= 1E-4 LINEAR_SOLVER_ITER= 5 -% ----------- SLOPE LIMITER AND DISSIPATION SENSOR DEFINITION -----------------% -% -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN -VENKAT_LIMITER_COEFF= 0.05 -JST_SENSOR_COEFF= ( 0.5, 0.02 ) - % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST +JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT % -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% @@ -95,6 +89,7 @@ CONV_CAUCHY_EPS= 1E-6 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % +SCREEN_OUTPUT= INNER_ITER, RMS_RES MESH_FILENAME= n64a010_turb.su2 MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 diff --git a/TestCases/hom_euler/NACA0012_3D_Hybrid_4thOrder/fem_NACA0012.cfg b/TestCases/hom_euler/NACA0012_3D_Hybrid_4thOrder/fem_NACA0012.cfg index c3f156a8aa3..16c0e1dc2c2 100644 --- a/TestCases/hom_euler/NACA0012_3D_Hybrid_4thOrder/fem_NACA0012.cfg +++ b/TestCases/hom_euler/NACA0012_3D_Hybrid_4thOrder/fem_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012.cfg b/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012.cfg index 2ad8def0d80..a52f55b7bdb 100644 --- a/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012.cfg +++ b/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012_reg.cfg b/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012_reg.cfg index 6cdbad80c93..4308de0c36a 100644 --- a/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012_reg.cfg +++ b/TestCases/hom_euler/NACA0012_5thOrder/fem_NACA0012_reg.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/Sphere_4thOrder_Hexa/fem_Sphere.cfg b/TestCases/hom_euler/Sphere_4thOrder_Hexa/fem_Sphere.cfg index 367294e3daf..9967a7f393b 100644 --- a/TestCases/hom_euler/Sphere_4thOrder_Hexa/fem_Sphere.cfg +++ b/TestCases/hom_euler/Sphere_4thOrder_Hexa/fem_Sphere.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/Sphere_4thOrder_Tet/fem_Sphere.cfg b/TestCases/hom_euler/Sphere_4thOrder_Tet/fem_Sphere.cfg index 75bbfae2904..00ec7aa99ea 100644 --- a/TestCases/hom_euler/Sphere_4thOrder_Tet/fem_Sphere.cfg +++ b/TestCases/hom_euler/Sphere_4thOrder_Tet/fem_Sphere.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel.cfg b/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel.cfg index 64fb4339e6f..29dadb14954 100644 --- a/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel.cfg +++ b/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel_Farfield.cfg b/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel_Farfield.cfg index cfbfa411984..8748d28aa55 100644 --- a/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel_Farfield.cfg +++ b/TestCases/hom_euler/SubsonicChannel/nPoly1/fem_SubsonicChannel_Farfield.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel.cfg b/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel.cfg index 6671d3b91c2..b7401a2720f 100644 --- a/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel.cfg +++ b/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel_Farfield.cfg b/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel_Farfield.cfg index 3eb44dab96a..2c53edb7869 100644 --- a/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel_Farfield.cfg +++ b/TestCases/hom_euler/SubsonicChannel/nPoly2/fem_SubsonicChannel_Farfield.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel.cfg b/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel.cfg index 0107f92a250..a5dcaac6a8e 100644 --- a/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel.cfg +++ b/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel_Farfield.cfg b/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel_Farfield.cfg index 4a129d7a239..9d19fc688b6 100644 --- a/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel_Farfield.cfg +++ b/TestCases/hom_euler/SubsonicChannel/nPoly4/fem_SubsonicChannel_Farfield.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_navierstokes/CylinderViscous/nPoly3/fem_Cylinder_reg.cfg b/TestCases/hom_navierstokes/CylinderViscous/nPoly3/fem_Cylinder_reg.cfg index c8495d99c34..2c430c8989c 100644 --- a/TestCases/hom_navierstokes/CylinderViscous/nPoly3/fem_Cylinder_reg.cfg +++ b/TestCases/hom_navierstokes/CylinderViscous/nPoly3/fem_Cylinder_reg.cfg @@ -5,7 +5,7 @@ % Author: Edwin van der Weide % % Institution: University of Twente % % Date: 2016.07.15 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_navierstokes/FlatPlate/nPoly4/lam_flatplate_reg.cfg b/TestCases/hom_navierstokes/FlatPlate/nPoly4/lam_flatplate_reg.cfg index 39f8ddc2f72..99260564e78 100644 --- a/TestCases/hom_navierstokes/FlatPlate/nPoly4/lam_flatplate_reg.cfg +++ b/TestCases/hom_navierstokes/FlatPlate/nPoly4/lam_flatplate_reg.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.09.30 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg.cfg b/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg.cfg index d8daab40b6d..01c13c309dd 100644 --- a/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg.cfg +++ b/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg.cfg @@ -5,7 +5,7 @@ % Author: Edwin van der Weide % % Institution: University of Twente % % Date: 2016.07.15 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg_ADER.cfg b/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg_ADER.cfg index 8f88fd7ff3a..724ed5bedc1 100644 --- a/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg_ADER.cfg +++ b/TestCases/hom_navierstokes/SphereViscous/nPoly3_QuadDominant/fem_Sphere_reg_ADER.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder.cfg b/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder.cfg index a121fcb53cb..5f0fb601fca 100644 --- a/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder.cfg +++ b/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder_ADER.cfg b/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder_ADER.cfg index 19c4b24d69a..9bec3e9366c 100644 --- a/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder_ADER.cfg +++ b/TestCases/hom_navierstokes/UnsteadyCylinder/nPoly4/fem_unst_cylinder_ADER.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/hybrid_regression.py b/TestCases/hybrid_regression.py index 4e2094b56f6..801ca167f31 100644 --- a/TestCases/hybrid_regression.py +++ b/TestCases/hybrid_regression.py @@ -3,7 +3,7 @@ ## \file hybrid_regression.py # \brief Python script for automated regression testing of SU2 examples # \author A. Aranake, A. Campos, T. Economon, T. Lukaczyk, S. Padron -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -30,12 +30,15 @@ import sys from TestCase import TestCase +from TestCase import parse_args def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. ''' + args = parse_args('Hybrid Regression Tests') + test_list = [] file_diff_list = [] @@ -100,7 +103,7 @@ def main(): flatplate.cfg_dir = "navierstokes/flatplate" flatplate.cfg_file = "lam_flatplate.cfg" flatplate.test_iter = 100 - flatplate.test_vals = [-9.154121, -3.663180, 0.001112, 0.036277, 2.361500, -2.325300, -2.278800, -2.278800] + flatplate.test_vals = [-9.154123, -3.663185, 0.001112, 0.036277, 2.361500, -2.325300, -2.278800, -2.278800] flatplate.test_vals_aarch64 = [-9.154130, -3.663197, 0.001112, 0.036277, 2.361500, -2.325300, -2.278800, -2.278800] test_list.append(flatplate) @@ -109,7 +112,7 @@ def main(): cylinder.cfg_dir = "navierstokes/cylinder" cylinder.cfg_file = "lam_cylinder.cfg" cylinder.test_iter = 25 - cylinder.test_vals = [-6.765429, -1.297425, 0.019571, 0.310230, 0.123270] + cylinder.test_vals = [-6.765429, -1.297425, 0.019571, 0.310233, 0.123270] cylinder.test_vals_aarch64 = [-6.765429, -1.297425, 0.019571, 0.310231, 0.123270] test_list.append(cylinder) @@ -118,7 +121,7 @@ def main(): cylinder_lowmach.cfg_dir = "navierstokes/cylinder" cylinder_lowmach.cfg_file = "cylinder_lowmach.cfg" cylinder_lowmach.test_iter = 25 - cylinder_lowmach.test_vals = [-6.850130, -1.388096, -0.056036, 108.140806, 0.007988] + cylinder_lowmach.test_vals = [-6.850130, -1.388096, -0.056036, 108.140809, 0.007988] cylinder_lowmach.test_vals_aarch64 = [-6.850130, -1.388096, -0.056036, 108.140813, 0.007988] test_list.append(cylinder_lowmach) @@ -137,7 +140,7 @@ def main(): poiseuille_profile.cfg_file = "profile_poiseuille.cfg" poiseuille_profile.test_iter = 10 poiseuille_profile.test_vals = [-12.494728, -7.712546, -0.000000, 2.085796] - poiseuille_profile.test_vals_aarch64 = [-12.494692, -7.710648, -0.000000, 2.085796] + poiseuille_profile.test_vals_aarch64 = [-12.494717, -7.711274, -0.000000, 2.085796] test_list.append(poiseuille_profile) # 2D Rotational Periodic @@ -158,7 +161,7 @@ def main(): rae2822_sa.cfg_dir = "rans/rae2822" rae2822_sa.cfg_file = "turb_SA_RAE2822.cfg" rae2822_sa.test_iter = 20 - rae2822_sa.test_vals = [-2.020123, -5.269330, 0.807147, 0.060499, -80603.000000] + rae2822_sa.test_vals = [-2.020123, -5.269324, 0.807147, 0.060499, -80602.000000] test_list.append(rae2822_sa) # RAE2822 SST @@ -166,7 +169,7 @@ def main(): rae2822_sst.cfg_dir = "rans/rae2822" rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg" rae2822_sst.test_iter = 20 - rae2822_sst.test_vals = [-0.510634, 4.869669, 0.811906, 0.061614, -82395.000000] + rae2822_sst.test_vals = [-0.510363, 4.872736, 0.815617, 0.060920, -73391.000000] test_list.append(rae2822_sst) # RAE2822 SST_SUST @@ -174,7 +177,7 @@ def main(): rae2822_sst_sust.cfg_dir = "rans/rae2822" rae2822_sst_sust.cfg_file = "turb_SST_SUST_RAE2822.cfg" rae2822_sst_sust.test_iter = 20 - rae2822_sst_sust.test_vals = [-2.420843, 4.869669, 0.811906, 0.061614] + rae2822_sst_sust.test_vals = [-2.535141, 4.872736, 0.815617, 0.060920] test_list.append(rae2822_sst_sust) # Flat plate @@ -182,7 +185,7 @@ def main(): turb_flatplate.cfg_dir = "rans/flatplate" turb_flatplate.cfg_file = "turb_SA_flatplate.cfg" turb_flatplate.test_iter = 20 - turb_flatplate.test_vals = [-4.157169, -6.737133, -0.176253, 0.057446] + turb_flatplate.test_vals = [-4.157358, -6.736289, -0.176258, 0.057431] test_list.append(turb_flatplate) # ONERA M6 Wing @@ -190,16 +193,16 @@ def main(): turb_oneram6.cfg_dir = "rans/oneram6" turb_oneram6.cfg_file = "turb_ONERAM6.cfg" turb_oneram6.test_iter = 10 - turb_oneram6.test_vals = [-2.388836, -6.689414, 0.230320, 0.157640, -32539.000000] + turb_oneram6.test_vals = [-2.388836, -6.689426, 0.230320, 0.157640, -32539.000000] test_list.append(turb_oneram6) # NACA0012 (SA, FUN3D finest grid results: CL=1.0983, CD=0.01242) turb_naca0012_sa = TestCase('turb_naca0012_sa') turb_naca0012_sa.cfg_dir = "rans/naca0012" turb_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" - turb_naca0012_sa.test_iter = 10 - turb_naca0012_sa.test_vals = [-8.627052, -10.377936, 1.064491, 0.019710, 20.000000, -1.763092, 20.000000, -4.794204, -46.506000] - turb_naca0012_sa.test_vals_aarch64 = [-8.627052, -10.377936, 1.064491, 0.019710, 20.000000, -1.763093, 20.000000, -4.794073, -46.506000] + turb_naca0012_sa.test_iter = 5 + turb_naca0012_sa.test_vals = [-10.451625, -13.859808, 1.057622, 0.022916, 20.000000, -1.358306, 20.000000, -2.512316, -44.540000] + turb_naca0012_sa.test_vals_aarch64 = [-10.451625, -13.859809, 1.057622, 0.022916, 20.000000, -1.358307, 20.000000, -2.512316, -44.540000] test_list.append(turb_naca0012_sa) # NACA0012 (SST, FUN3D finest grid results: CL=1.0840, CD=0.01253) @@ -207,8 +210,7 @@ def main(): turb_naca0012_sst.cfg_dir = "rans/naca0012" turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" turb_naca0012_sst.test_iter = 10 - turb_naca0012_sst.test_vals = [-11.418415, -12.801780, -5.864804, 1.049990, 0.019163, -1.669899, -38.695000] - turb_naca0012_sst.test_vals_aarch64 = [-11.450473, -12.797872, -5.863655, 1.049989, 0.019163, -1.856266, -38.694000] + turb_naca0012_sst.test_vals = [-12.216989, -14.439370, -7.108639, 1.050109, 0.019148, -1.483537, -38.510000] test_list.append(turb_naca0012_sst) # NACA0012 (SST_SUST, FUN3D finest grid results: CL=1.0840, CD=0.01253) @@ -216,8 +218,7 @@ def main(): turb_naca0012_sst_sust.cfg_dir = "rans/naca0012" turb_naca0012_sst_sust.cfg_file = "turb_NACA0012_sst_sust.cfg" turb_naca0012_sst_sust.test_iter = 10 - turb_naca0012_sst_sust.test_vals = [-11.361657, -12.642245, -5.747099, 1.005234, 0.019017, -1.573783] - turb_naca0012_sst_sust.test_vals_aarch64 = [-11.367052, -12.640670, -5.746919, 1.005233, 0.019017, -1.913907] + turb_naca0012_sst_sust.test_vals = [-12.148204, -14.755890, -6.342986, 1.001189, 0.019384, -1.432333] test_list.append(turb_naca0012_sst_sust) # NACA0012 (SST, fixed values for turbulence quantities) @@ -225,8 +226,8 @@ def main(): turb_naca0012_sst_fixedvalues.cfg_dir = "rans/naca0012" turb_naca0012_sst_fixedvalues.cfg_file = "turb_NACA0012_sst_fixedvalues.cfg" turb_naca0012_sst_fixedvalues.test_iter = 10 - turb_naca0012_sst_fixedvalues.test_vals = [-5.192502, -9.575351, -1.568269, 1.022571, 0.040527, -2.384334] - turb_naca0012_sst_fixedvalues.test_vals_aarch64 = [-5.192501, -9.575897, -1.568269, 1.022571, 0.040527, -2.384327] + turb_naca0012_sst_fixedvalues.test_vals = [-5.192598, -10.042489, -1.617721, 1.022073, 0.040198, -2.381138] + turb_naca0012_sst_fixedvalues.test_vals_aarch64 = [-5.192599, -10.042490, -1.617720, 1.022073, 0.040198, -2.381138] test_list.append(turb_naca0012_sst_fixedvalues) # NACA0012 (SST, explicit Euler for flow and turbulence equations) @@ -234,7 +235,7 @@ def main(): turb_naca0012_sst_expliciteuler.cfg_dir = "rans/naca0012" turb_naca0012_sst_expliciteuler.cfg_file = "turb_NACA0012_sst_expliciteuler.cfg" turb_naca0012_sst_expliciteuler.test_iter = 10 - turb_naca0012_sst_expliciteuler.test_vals = [-3.532228, -3.157766, 3.364025, 1.124824, 0.501717, -float("inf")] + turb_naca0012_sst_expliciteuler.test_vals = [-3.532289, -3.157766, 3.364024, 1.122901, 0.500798, -float("inf")] test_list.append(turb_naca0012_sst_expliciteuler) # PROPELLER @@ -242,7 +243,7 @@ def main(): propeller.cfg_dir = "rans/propeller" propeller.cfg_file = "propeller.cfg" propeller.test_iter = 10 - propeller.test_vals = [-3.389575, -8.409529, 0.000048, 0.056329] + propeller.test_vals = [-3.389575, -8.409251, 0.000048, 0.056329] test_list.append(propeller) ####################################### @@ -254,8 +255,7 @@ def main(): axi_rans_air_nozzle_restart.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 - axi_rans_air_nozzle_restart.test_vals = [-12.085749, -7.439410, -8.772091, -4.045091, -1924.800000] - axi_rans_air_nozzle_restart.test_vals_aarch64 = [-12.093539, -6.630357, -8.798732, -2.399130, -1938.200000] + axi_rans_air_nozzle_restart.test_vals = [-12.060634, -6.992273, -8.808757, -4.097753, -2019.800000] test_list.append(axi_rans_air_nozzle_restart) ################################# @@ -268,7 +268,7 @@ def main(): turb_naca0012_sst_restart_mg.cfg_file = "turb_NACA0012_sst_multigrid_restart.cfg" turb_naca0012_sst_restart_mg.test_iter = 20 turb_naca0012_sst_restart_mg.ntest_vals = 5 - turb_naca0012_sst_restart_mg.test_vals = [-7.652987, -7.729472, -1.981061, -0.000015, 0.079061] + turb_naca0012_sst_restart_mg.test_vals = [-7.644702, -7.433663, -1.918163, -0.000003, 0.079111] test_list.append(turb_naca0012_sst_restart_mg) ############################# @@ -280,8 +280,8 @@ def main(): turb_naca0012_1c.cfg_dir = "rans_uq/naca0012" turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg" turb_naca0012_1c.test_iter = 10 - turb_naca0012_1c.test_vals = [-4.980749, 1.139261, 0.244644, -0.112857] - turb_naca0012_1c.test_vals_aarch64 = [-4.981149, 1.139192, 0.244886, -0.112789] + turb_naca0012_1c.test_vals = [-4.980878, 1.138865, 0.247731, -0.117335] + turb_naca0012_1c.test_vals_aarch64 = [-4.981105, 1.138873, 0.248013, -0.117248] test_list.append(turb_naca0012_1c) # NACA0012 2c @@ -289,8 +289,8 @@ def main(): turb_naca0012_2c.cfg_dir = "rans_uq/naca0012" turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg" turb_naca0012_2c.test_iter = 10 - turb_naca0012_2c.test_vals = [-5.483318, 0.968892, 0.212994, -0.120007] - turb_naca0012_2c.test_vals_aarch64 = [-5.483350, 0.968882, 0.212493, -0.120171] + turb_naca0012_2c.test_vals = [-5.483313, 0.968731, 0.215420, -0.124767] + turb_naca0012_2c.test_vals_aarch64 = [-5.483345, 0.968720, 0.214914, -0.124932] test_list.append(turb_naca0012_2c) # NACA0012 3c @@ -298,8 +298,8 @@ def main(): turb_naca0012_3c.cfg_dir = "rans_uq/naca0012" turb_naca0012_3c.cfg_file = "turb_NACA0012_uq_3c.cfg" turb_naca0012_3c.test_iter = 10 - turb_naca0012_3c.test_vals = [-5.584300, 0.931383, 0.205114, -0.120892] - turb_naca0012_3c.test_vals_aarch64 = [-5.584300, 0.931383, 0.205116, -0.120891] + turb_naca0012_3c.test_vals = [-5.584300, 0.931293, 0.207446, -0.125692] + turb_naca0012_3c.test_vals_aarch64 = [-5.584300, 0.931293, 0.207447, -0.125691] test_list.append(turb_naca0012_3c) # NACA0012 p1c1 @@ -307,8 +307,8 @@ def main(): turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg" turb_naca0012_p1c1.test_iter = 10 - turb_naca0012_p1c1.test_vals = [-5.132760, 1.075858, 0.333412, -0.078553] - turb_naca0012_p1c1.test_vals_aarch64 = [-5.132731, 1.075863, 0.333419, -0.078553] + turb_naca0012_p1c1.test_vals = [-5.132363, 1.075634, 0.337251, -0.082829] + turb_naca0012_p1c1.test_vals_aarch64 = [-5.132358, 1.075658, 0.337268, -0.082827] test_list.append(turb_naca0012_p1c1) # NACA0012 p1c2 @@ -316,8 +316,8 @@ def main(): turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg" turb_naca0012_p1c2.test_iter = 10 - turb_naca0012_p1c2.test_vals = [-5.554392, 0.943810, 0.226719, -0.116439] - turb_naca0012_p1c2.test_vals_aarch64 = [-5.554433, 0.943787, 0.226530, -0.116503] + turb_naca0012_p1c2.test_vals = [-5.554392, 0.943703, 0.229483, -0.121058] + turb_naca0012_p1c2.test_vals_aarch64 = [-5.554425, 0.943683, 0.229293, -0.121125] test_list.append(turb_naca0012_p1c2) ###################################### @@ -329,8 +329,7 @@ def main(): harmonic_balance.cfg_dir = "harmonic_balance" harmonic_balance.cfg_file = "HB.cfg" harmonic_balance.test_iter = 25 - harmonic_balance.test_vals = [-1.589740, 3.922578, 0.006703, 0.099632] - harmonic_balance.new_output = False + harmonic_balance.test_vals = [-1.589740, 0.790168, 0.937052, 3.922578] test_list.append(harmonic_balance) # Turbulent pitching NACA 64a010 airfoil @@ -338,8 +337,7 @@ def main(): hb_rans_preconditioning.cfg_dir = "harmonic_balance/hb_rans_preconditioning" hb_rans_preconditioning.cfg_file = "davis.cfg" hb_rans_preconditioning.test_iter = 25 - hb_rans_preconditioning.test_vals = [-1.902111, -5.949288, 0.007768, 0.128060] - hb_rans_preconditioning.new_output = False + hb_rans_preconditioning.test_vals = [-1.902111, 0.484080, 0.601469, 3.608991, -5.949373] test_list.append(hb_rans_preconditioning) ############################# @@ -352,7 +350,6 @@ def main(): inc_euler_naca0012.cfg_file = "incomp_NACA0012.cfg" inc_euler_naca0012.test_iter = 20 inc_euler_naca0012.test_vals = [-4.858287, -3.810487, 0.491850, 0.007002] - inc_euler_naca0012.new_output = True test_list.append(inc_euler_naca0012) # C-D nozzle with pressure inlet and mass flow outlet @@ -362,7 +359,6 @@ def main(): inc_nozzle.test_iter = 20 inc_nozzle.test_vals = [-5.971249, -4.910844, -0.000196, 0.121635] inc_nozzle.test_vals_aarch64 = [-5.971248, -4.910844, -0.000196, 0.121635] - inc_nozzle.new_output = True test_list.append(inc_nozzle) ############################# @@ -375,7 +371,6 @@ def main(): inc_lam_cylinder.cfg_file = "incomp_cylinder.cfg" inc_lam_cylinder.test_iter = 10 inc_lam_cylinder.test_vals = [-4.004277, -3.227956, 0.003851, 7.626583] - inc_lam_cylinder.new_output = True test_list.append(inc_lam_cylinder) # Buoyancy-driven cavity @@ -384,7 +379,6 @@ def main(): inc_buoyancy.cfg_file = "lam_buoyancy_cavity.cfg" inc_buoyancy.test_iter = 20 inc_buoyancy.test_vals = [-4.432484, 0.507522, 0.000000, 0.000000] - inc_buoyancy.new_output = True test_list.append(inc_buoyancy) # Laminar heated cylinder with polynomial fluid model @@ -394,7 +388,6 @@ def main(): inc_poly_cylinder.test_iter = 20 inc_poly_cylinder.test_vals = [-7.851512, -2.093420, 0.029974, 1.921595, -175.300000] inc_poly_cylinder.test_vals_aarch64 = [-7.851510, -2.093419, 0.029974, 1.921595, -175.300000] - inc_poly_cylinder.new_output = True test_list.append(inc_poly_cylinder) # X-coarse laminar bend as a mixed element CGNS test @@ -415,8 +408,7 @@ def main(): inc_turb_naca0012.cfg_dir = "incomp_rans/naca0012" inc_turb_naca0012.cfg_file = "naca0012.cfg" inc_turb_naca0012.test_iter = 20 - inc_turb_naca0012.test_vals = [-4.788405, -11.040493, 0.000008, 0.309506] - inc_turb_naca0012.new_output = True + inc_turb_naca0012.test_vals = [-4.788405, -11.039465, 0.000008, 0.309490] test_list.append(inc_turb_naca0012) # NACA0012, SST_SUST @@ -424,7 +416,7 @@ def main(): inc_turb_naca0012_sst_sust.cfg_dir = "incomp_rans/naca0012" inc_turb_naca0012_sst_sust.cfg_file = "naca0012_SST_SUST.cfg" inc_turb_naca0012_sst_sust.test_iter = 20 - inc_turb_naca0012_sst_sust.test_vals = [-7.274028, 0.145888, 0.000002, 0.312014] + inc_turb_naca0012_sst_sust.test_vals = [-7.270637, 0.018416, 0.000004, 0.307678] test_list.append(inc_turb_naca0012_sst_sust) # Weakly coupled heat equation @@ -432,7 +424,7 @@ def main(): inc_weakly_coupled.cfg_dir = "disc_adj_heat" inc_weakly_coupled.cfg_file = "primal.cfg" inc_weakly_coupled.test_iter = 10 - inc_weakly_coupled.test_vals = [-17.240436, -16.184455, -16.069131, -17.230730, -18.350601, -13.768070, 5.545700] + inc_weakly_coupled.test_vals = [-16.498562, -15.335587, -15.570565, -12.867787, -18.185331, -13.071436, 5.545800] test_list.append(inc_weakly_coupled) ###################################### @@ -444,7 +436,7 @@ def main(): cavity.cfg_dir = "moving_wall/cavity" cavity.cfg_file = "lam_cavity.cfg" cavity.test_iter = 25 - cavity.test_vals = [-5.627934, -0.164469, 0.052000, 2.547062] + cavity.test_vals = [-5.627934, -0.164469, 0.052000, 2.547063] test_list.append(cavity) # Spinning cylinder @@ -452,7 +444,7 @@ def main(): spinning_cylinder.cfg_dir = "moving_wall/spinning_cylinder" spinning_cylinder.cfg_file = "spinning_cylinder.cfg" spinning_cylinder.test_iter = 25 - spinning_cylinder.test_vals = [-8.001290, -2.607958, 1.501321, 1.488559] + spinning_cylinder.test_vals = [-8.001291, -2.607959, 1.501321, 1.488559] spinning_cylinder.test_vals_aarch64 = [-8.001291, -2.607959, 1.501321, 1.488559] test_list.append(spinning_cylinder) @@ -465,8 +457,8 @@ def main(): square_cylinder.cfg_dir = "unsteady/square_cylinder" square_cylinder.cfg_file = "turb_square.cfg" square_cylinder.test_iter = 3 - square_cylinder.test_vals = [-2.558128, -1.158062, 0.067932, 1.399788, 2.220402, 1.399743, 2.218603, -0.453110] - square_cylinder.test_vals_aarch64 = [-2.558106, -1.162563, 0.066386, 1.399788, 2.220402, 1.399743, 2.218603, -0.453110] + square_cylinder.test_vals = [-2.557949, -1.173575, 0.058030, 1.399794, 2.220402, 1.399748, 2.218603, -0.453270] + square_cylinder.test_vals_aarch64 = [-2.557902, -1.173574, 0.058050, 1.399794, 2.220402, 1.399748, 2.218604, -0.453270] square_cylinder.unsteady = True test_list.append(square_cylinder) @@ -479,15 +471,36 @@ def main(): sine_gust.unsteady = True test_list.append(sine_gust) + # Cosine gust in z-direction + cosine_gust = TestCase('cosine_gust_zdir') + cosine_gust.cfg_dir = "gust" + cosine_gust.cfg_file = "cosine_gust_zdir.cfg" + cosine_gust.test_iter = 79 + cosine_gust.test_vals = [-2.418813, 0.004650, -0.001878, -0.000637, -0.000271] + cosine_gust.unsteady = True + cosine_gust.enabled_with_tsan = False + test_list.append(cosine_gust) + + # Gust with mesh deformation + gust_mesh_defo = TestCase('gust_with_mesh_deformation') + gust_mesh_defo.cfg_dir = "gust" + gust_mesh_defo.cfg_file = "gust_with_mesh_deformation.cfg" + gust_mesh_defo.test_iter = 6 + gust_mesh_defo.test_vals = [-1.844778, 0.000846, -0.000408] + gust_mesh_defo.unsteady = True + gust_mesh_defo.enabled_with_tsan = False + test_list.append(gust_mesh_defo) + # Aeroelastic aeroelastic = TestCase('aeroelastic') aeroelastic.cfg_dir = "aeroelastic" aeroelastic.cfg_file = "aeroelastic_NACA64A010.cfg" aeroelastic.test_iter = 2 - aeroelastic.test_vals = [0.074433, 0.033108, -0.001650, -0.000127] + aeroelastic.test_vals = [0.074432, 0.033108, -0.001650, -0.000127] aeroelastic.test_vals_aarch64 = [0.074836, 0.033102, -0.001650, -0.000127] aeroelastic.unsteady = True aeroelastic.enabled_on_cpu_arch = ["x86_64"] # Requires AVX-capable architecture + aeroelastic.enabled_with_tsan = False test_list.append(aeroelastic) # Delayed Detached Eddy Simulation @@ -495,7 +508,7 @@ def main(): ddes_flatplate.cfg_dir = "ddes/flatplate" ddes_flatplate.cfg_file = "ddes_flatplate.cfg" ddes_flatplate.test_iter = 10 - ddes_flatplate.test_vals = [-2.714758, -5.883004, -0.215005, 0.023783, -618.160000] + ddes_flatplate.test_vals = [-2.714757, -5.882779, -0.215005, 0.023783, -618.130000] ddes_flatplate.unsteady = True test_list.append(ddes_flatplate) @@ -504,7 +517,7 @@ def main(): unst_inc_turb_naca0015_sa.cfg_dir = "unsteady/pitching_naca0015_rans_inc" unst_inc_turb_naca0015_sa.cfg_file = "config_incomp_turb_sa.cfg" unst_inc_turb_naca0015_sa.test_iter = 1 - unst_inc_turb_naca0015_sa.test_vals = [-3.008629, -6.888974, 1.435193, 0.433537] + unst_inc_turb_naca0015_sa.test_vals = [-3.008629, -6.888963, 1.435186, 0.433529] unst_inc_turb_naca0015_sa.unsteady = True test_list.append(unst_inc_turb_naca0015_sa) @@ -513,8 +526,9 @@ def main(): unst_deforming_naca0012.cfg_dir = "disc_adj_euler/naca0012_pitching_def" unst_deforming_naca0012.cfg_file = "inv_NACA0012_pitching_deform.cfg" unst_deforming_naca0012.test_iter = 5 - unst_deforming_naca0012.test_vals = [-3.665120, -3.793643, -3.716518, -3.148310] + unst_deforming_naca0012.test_vals = [-3.665126, -3.793497, -3.716496, -3.148290] unst_deforming_naca0012.unsteady = True + unst_deforming_naca0012.enabled_with_tsan = False test_list.append(unst_deforming_naca0012) ###################################### @@ -526,7 +540,7 @@ def main(): edge_VW.cfg_dir = "nicf/edge" edge_VW.cfg_file = "edge_VW.cfg" edge_VW.test_iter = 100 - edge_VW.test_vals = [-5.040287, 1.124488, -0.000009, 0.000000] + edge_VW.test_vals = [-5.040246, 1.124521, -0.000009, 0.000000] test_list.append(edge_VW) # Rarefaction shock wave edge_PPR @@ -534,7 +548,7 @@ def main(): edge_PPR.cfg_dir = "nicf/edge" edge_PPR.cfg_file = "edge_PPR.cfg" edge_PPR.test_iter = 100 - edge_PPR.test_vals = [-5.401597, 0.738210, -0.000035, 0.000000] + edge_PPR.test_vals = [-5.401604, 0.738202, -0.000035, 0.000000] edge_PPR.test_vals_aarch64 = [-5.401642, 0.738164, -0.000035, 0.000000] test_list.append(edge_PPR) @@ -547,8 +561,7 @@ def main(): Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger" Jones_tc_restart.cfg_file = "Jones_restart.cfg" Jones_tc_restart.test_iter = 5 - Jones_tc_restart.test_vals = [-10.691521, -7.643723, 85.827890, 2.277151] - Jones_tc_restart.new_output = False + Jones_tc_restart.test_vals = [-6.604542, -2.792279, -14.328530, -8.769313, -11.371439, -5.845633, 73273.000000, 73273.000000] test_list.append(Jones_tc_restart) # 2D axial stage @@ -556,9 +569,7 @@ def main(): axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D" axial_stage2D.cfg_file = "Axial_stage2D.cfg" axial_stage2D.test_iter = 20 - axial_stage2D.test_vals = [-1.937003, 5.338805, 73.357170, 0.915734] - axial_stage2D.test_vals_aarch64 = [-1.933115, 5.365583, 73.354510, 0.925902] - axial_stage2D.new_output = False + axial_stage2D.test_vals = [0.974788, 1.534326, -2.897693, 2.599374, -2.418314, 3.087291, 106380.000000, 106380.000000] test_list.append(axial_stage2D) # 2D transonic stator restart @@ -566,9 +577,7 @@ def main(): transonic_stator_restart.cfg_dir = "turbomachinery/transonic_stator_2D" transonic_stator_restart.cfg_file = "transonic_stator_restart.cfg" transonic_stator_restart.test_iter = 20 - transonic_stator_restart.test_vals = [-6.796363, -0.743837, 5.003453, 0.002946] - transonic_stator_restart.test_vals_aarch64 = [-6.619122, -0.615705, 5.002986, 0.002951] - transonic_stator_restart.new_output = False + transonic_stator_restart.test_vals = [-5.346503, -3.510597, -3.156830, 0.752511, -3.834382, 1.816610, -471690] test_list.append(transonic_stator_restart) ###################################### @@ -604,6 +613,7 @@ def main(): channel_3D.test_vals_aarch64 = [2.000000, 0.000000, 0.620189, 0.505311, 0.415246] channel_3D.unsteady = True channel_3D.multizone = True + channel_3D.enabled_with_tsan = False test_list.append(channel_3D) # Pipe @@ -641,7 +651,7 @@ def main(): bars_SST_2D.cfg_dir = "sliding_interface/bars_SST_2D" bars_SST_2D.cfg_file = "bars.cfg" bars_SST_2D.test_iter = 13 - bars_SST_2D.test_vals = [13.000000, -0.604409, -1.523885] + bars_SST_2D.test_vals = [13.000000, -0.773513, -1.700012] bars_SST_2D.multizone = True test_list.append(bars_SST_2D) @@ -673,7 +683,7 @@ def main(): dynbeam2d.cfg_dir = "fea_fsi/DynBeam_2d" dynbeam2d.cfg_file = "configBeam_2d.cfg" dynbeam2d.test_iter = 6 - dynbeam2d.test_vals = [-3.240015, 2.895057, -0.353146, 66127.000000] + dynbeam2d.test_vals = [-3.240016, 2.895057, -0.353147, 66127.000000] dynbeam2d.unsteady = True test_list.append(dynbeam2d) @@ -685,6 +695,7 @@ def main(): fsi2d.test_vals = [4.000000, 0.000000, -3.743227, -4.133479] fsi2d.multizone= True fsi2d.unsteady = True + fsi2d.enabled_with_tsan = False test_list.append(fsi2d) # FSI, Static, 2D, new mesh solver @@ -761,8 +772,22 @@ def main(): pywrapper_translating_naca0012.reference_file_aarch64 = "forces_0_aarch64.csv.ref" pywrapper_translating_naca0012.test_file = "forces_0.csv" pywrapper_translating_naca0012.enabled_on_cpu_arch = ["x86_64"] + pywrapper_translating_naca0012.enabled_with_tsan = False file_diff_list.append(pywrapper_translating_naca0012) + # NACA0012 with updated moving frame + pywrapper_updated_moving_frame_naca0012 = TestCase('pywrapper_updated_moving_frame_naca0012') + pywrapper_updated_moving_frame_naca0012.cfg_dir = "py_wrapper/updated_moving_frame_NACA12" + pywrapper_updated_moving_frame_naca0012.cfg_file = "config.cfg" + pywrapper_updated_moving_frame_naca0012.command = TestCase.Command(exec = "python", param = "run_su2.py") + pywrapper_updated_moving_frame_naca0012.timeout = 60 + pywrapper_updated_moving_frame_naca0012.reference_file = "forces_0.csv.ref" + pywrapper_updated_moving_frame_naca0012.reference_file_aarch64 = "forces_0_aarch64.csv.ref" + pywrapper_updated_moving_frame_naca0012.test_file = "forces_0.csv" + pywrapper_updated_moving_frame_naca0012.enabled_on_cpu_arch = ["x86_64"] + pywrapper_updated_moving_frame_naca0012.enabled_with_tsan = False + file_diff_list.append(pywrapper_updated_moving_frame_naca0012) + ###################################### ### RUN TESTS ### ###################################### @@ -773,8 +798,8 @@ def main(): test.tol = 1e-4 #end - pass_list = [ test.run_test() for test in test_list ] - pass_list += [ test.run_filediff() for test in file_diff_list ] + pass_list = [ test.run_test(args.tsan) for test in test_list ] + pass_list += [ test.run_filediff(args.tsan) for test in file_diff_list ] # Tests summary print('==================================================================') diff --git a/TestCases/hybrid_regression_AD.py b/TestCases/hybrid_regression_AD.py index 65e3ab57b24..a2243e14e24 100644 --- a/TestCases/hybrid_regression_AD.py +++ b/TestCases/hybrid_regression_AD.py @@ -3,7 +3,7 @@ ## \file hybrid_regression_AD.py # \brief Python script for automated regression testing of SU2 examples # \author A. Aranake, A. Campos, T. Economon, T. Lukaczyk, S. Padron -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -30,12 +30,15 @@ import sys from TestCase import TestCase +from TestCase import parse_args def main(): '''This program runs SU2 and ensures that the output matches specified values. This will be used to do checks when code is pushed to github to make sure nothing is broken. ''' + args = parse_args('Hybrid Regression AD Tests') + test_list = [] ##################################### @@ -75,8 +78,7 @@ def main(): discadj_rans_naca0012_sa.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" discadj_rans_naca0012_sa.test_iter = 10 - discadj_rans_naca0012_sa.test_vals = [-2.230631, 0.644953, 0.177890, -0.000016, 5.000000, -3.007652, 5.000000, -7.631910] - discadj_rans_naca0012_sa.test_vals_aarch64 = [-2.230631, 0.644954, 0.177890, -0.000016, 5.000000, -3.007651, 5.000000, -7.631909] + discadj_rans_naca0012_sa.test_vals = [-2.230621, 0.644162, 0.177890, -0.000016, 5.000000, -3.007652, 5.000000, -7.728093] test_list.append(discadj_rans_naca0012_sa) # Adjoint turbulent NACA0012 SST @@ -84,7 +86,7 @@ def main(): discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 - discadj_rans_naca0012_sst.test_vals = [-2.221793, -0.491367, 0.182000, -0.000018] + discadj_rans_naca0012_sst.test_vals = [-2.221846, -0.491928, 0.182000, -0.000018] test_list.append(discadj_rans_naca0012_sst) ####################################### @@ -129,7 +131,7 @@ def main(): discadj_incomp_turb_NACA0012_sst.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sst.cfg_file = "turb_naca0012_sst.cfg" discadj_incomp_turb_NACA0012_sst.test_iter = 10 - discadj_incomp_turb_NACA0012_sst.test_vals = [-3.845593, -2.414026, -8.420194, 0.000000] + discadj_incomp_turb_NACA0012_sst.test_vals = [-4.029282, -2.181911, -7.734686, 0.000000, -0.939944] test_list.append(discadj_incomp_turb_NACA0012_sst) ####################################################### @@ -143,6 +145,7 @@ def main(): discadj_cylinder.test_iter = 9 discadj_cylinder.test_vals = [3.746907, -1.544882, -0.008321, 0.000014] discadj_cylinder.unsteady = True + discadj_cylinder.enabled_with_tsan = False test_list.append(discadj_cylinder) ############################################################## @@ -156,6 +159,7 @@ def main(): discadj_cylinder.test_iter = 9 discadj_cylinder.test_vals = [3.004402] discadj_cylinder.unsteady = True + discadj_cylinder.enabled_with_tsan = False test_list.append(discadj_cylinder) ########################################################################## @@ -169,6 +173,7 @@ def main(): discadj_DT_1ST_cylinder.test_iter = 9 discadj_DT_1ST_cylinder.test_vals = [3.698167, -1.607051, -0.002159, 0.000028] discadj_DT_1ST_cylinder.unsteady = True + discadj_DT_1ST_cylinder.enabled_with_tsan = False test_list.append(discadj_DT_1ST_cylinder) ###################################################### @@ -182,6 +187,7 @@ def main(): discadj_pitchingNACA0012.test_iter = 4 discadj_pitchingNACA0012.test_vals = [-1.219713, -1.645717, -0.007513, 0.000013] discadj_pitchingNACA0012.unsteady = True + discadj_pitchingNACA0012.enabled_with_tsan = False test_list.append(discadj_pitchingNACA0012) ####################################################### @@ -193,8 +199,9 @@ def main(): discadj_trans_stator.cfg_dir = "disc_adj_turbomachinery/transonic_stator_2D" discadj_trans_stator.cfg_file = "transonic_stator.cfg" discadj_trans_stator.test_iter = 79 - discadj_trans_stator.test_vals = [79.000000, -1.938803, -1.981888] - discadj_trans_stator.test_vals_aarch64 = [79.000000, -1.938809, -1.995540] + discadj_trans_stator.test_vals = [79, 0.770065, 0.383137, 0.472153, -0.996484, 2.153296, -4.444301] + discadj_trans_stator.test_vals_aarch64 = [79, 0.769987, 0.383135, 0.472391, -0.996504, 2.153296, -4.444301] + discadj_trans_stator.enabled_with_tsan = False test_list.append(discadj_trans_stator) ################################### @@ -207,7 +214,7 @@ def main(): discadj_fea.cfg_file = "configAD_fem.cfg" discadj_fea.test_iter = 4 discadj_fea.test_vals = [1.774569, 1.928023, -0.000364, -8.690300] - discadj_fea.test_vals_aarch64 = [2.216938, 2.129429, -0.000365, -8.782500] + discadj_fea.test_vals_aarch64 = [1.939275, 1.989717, -0.000364, -8.708200] test_list.append(discadj_fea) ###################################### @@ -220,7 +227,42 @@ def main(): test.tol = 1e-4 #end - pass_list = [ test.run_test() for test in test_list ] + pass_list = [ test.run_test(args.tsan) for test in test_list ] + + ################################### + ### Python Wrapper ### + ################################### + + # FEA AD Flow Load Sensitivity + pywrapper_FEA_AD_FlowLoad = TestCase('pywrapper_FEA_AD_FlowLoad') + pywrapper_FEA_AD_FlowLoad.cfg_dir = "py_wrapper/disc_adj_fea/flow_load_sens" + pywrapper_FEA_AD_FlowLoad.cfg_file = "configAD_fem.cfg" + pywrapper_FEA_AD_FlowLoad.test_iter = 100 + pywrapper_FEA_AD_FlowLoad.test_vals = [-0.131742, -0.553318, -0.000364, -0.003101] #last 4 columns + pywrapper_FEA_AD_FlowLoad.test_vals_aarch64 = [-0.131745, -0.553214, -0.000364, -0.003101] + pywrapper_FEA_AD_FlowLoad.command = TestCase.Command(exec = "python", param = "run_adjoint.py --parallel -f") + pywrapper_FEA_AD_FlowLoad.timeout = 1600 + pywrapper_FEA_AD_FlowLoad.tol = 1e-4 + pywrapper_FEA_AD_FlowLoad.new_output = False + pywrapper_FEA_AD_FlowLoad.enabled_with_tsan = False + test_list.append(pywrapper_FEA_AD_FlowLoad) + pass_list.append(pywrapper_FEA_AD_FlowLoad.run_test(args.tsan)) + + # Flow AD Mesh Displacement Sensitivity + pywrapper_CFD_AD_MeshDisp = TestCase('pywrapper_CFD_AD_MeshDisp') + pywrapper_CFD_AD_MeshDisp.cfg_dir = "py_wrapper/disc_adj_flow/mesh_disp_sens" + pywrapper_CFD_AD_MeshDisp.cfg_file = "configAD_flow.cfg" + pywrapper_CFD_AD_MeshDisp.test_iter = 1000 + pywrapper_CFD_AD_MeshDisp.test_vals = [30.000000, -2.520967, 1.375188, 0.000000] #last 4 columns + pywrapper_CFD_AD_MeshDisp.test_vals_aarch64 = [30.000000, -2.516536, 1.386443, 0.000000] + pywrapper_CFD_AD_MeshDisp.command = TestCase.Command(exec = "python", param = "run_adjoint.py --parallel -f") + pywrapper_CFD_AD_MeshDisp.timeout = 1600 + pywrapper_CFD_AD_MeshDisp.tol = 1e-4 + pywrapper_CFD_AD_MeshDisp.new_output = False + pywrapper_CFD_AD_MeshDisp.enabled_with_tsan = False + test_list.append(pywrapper_CFD_AD_MeshDisp) + pass_list.append(pywrapper_CFD_AD_MeshDisp.run_test(args.tsan)) + # Tests summary print('==================================================================') diff --git a/TestCases/incomp_euler/naca0012/incomp_NACA0012.cfg b/TestCases/incomp_euler/naca0012/incomp_NACA0012.cfg index 398e621ca92..216a1881a31 100644 --- a/TestCases/incomp_euler/naca0012/incomp_NACA0012.cfg +++ b/TestCases/incomp_euler/naca0012/incomp_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 09/18/2011 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/incomp_euler/nozzle/inv_nozzle.cfg b/TestCases/incomp_euler/nozzle/inv_nozzle.cfg index b29e9bfdc51..314311408e6 100644 --- a/TestCases/incomp_euler/nozzle/inv_nozzle.cfg +++ b/TestCases/incomp_euler/nozzle/inv_nozzle.cfg @@ -4,7 +4,7 @@ % Case description: Inv. inc. nozzle with pressure inlet and mass flow outlet % % Author: Thomas D. Economon % % Date: 2018.11.30 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg b/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg index 578b8127f81..96bcd92712b 100644 --- a/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg +++ b/TestCases/incomp_navierstokes/buoyancy_cavity/lam_buoyancy_cavity.cfg @@ -4,7 +4,7 @@ % Case description: Buoyancy-driven flow inside a cavity % % Author: Thomas D. Economon % % Date: 2018.06.10 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/incomp_navierstokes/cylinder/incomp_cylinder.cfg b/TestCases/incomp_navierstokes/cylinder/incomp_cylinder.cfg index f292836c8e7..416c10715c5 100644 --- a/TestCases/incomp_navierstokes/cylinder/incomp_cylinder.cfg +++ b/TestCases/incomp_navierstokes/cylinder/incomp_cylinder.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 2012.03.14 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg b/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg index 24bfb194c01..7e12b59731f 100644 --- a/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg +++ b/TestCases/incomp_navierstokes/cylinder/poly_cylinder.cfg @@ -5,7 +5,7 @@ % custom fluid using polynomial fluid models. % % Author: Thomas D. Economon % % Date: 2018.12.02 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/BC_HeatTransfer.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/BC_HeatTransfer.cfg index 5005fbaccef..accd40e479a 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/BC_HeatTransfer.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/BC_HeatTransfer.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.15 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg index fb41015dfb7..959a904fd69 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/DA_configMaster.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.15 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg index 42aea7ba914..6fecd5e600a 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/FD_configMaster.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.15 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg index d2cc26c56f6..23a368fe73d 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configFluid.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.15 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg index 3803a89e9b6..04f77424365 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configMaster.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.15 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % @@ -69,7 +69,7 @@ DEFORM_LINEAR_SOLVER_PREC= ILU DEFORM_LINEAR_SOLVER_ERROR= 1E-14 % DEFORM_NONLINEAR_ITER= 1 -DEFORM_LINEAR_SOLVER_ITER= 1000 +DEFORM_LINEAR_SOLVER_ITER= 10 % DEFORM_CONSOLE_OUTPUT= YES DEFORM_STIFFNESS_TYPE= WALL_DISTANCE diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg index 8c4a3a1ded4..07f3733229d 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/configSolid.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.15 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref index 82730a5fe1e..f959a481490 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_2d/of_grad_findiff.csv.ref @@ -1,2 +1,2 @@ "VARIABLE" , "AVG_DENSITY[0]", "AVG_ENTHALPY[0]", "AVG_NORMALVEL[0]", "DRAG[0]" , "EFFICIENCY[0]" , "FORCE_X[0]" , "FORCE_Y[0]" , "FORCE_Z[0]" , "LIFT[0]" , "MOMENT_X[0]" , "MOMENT_Y[0]" , "MOMENT_Z[0]" , "SIDEFORCE[0]" , "SURFACE_MACH[0]", "SURFACE_MASSFLOW[0]", "SURFACE_MOM_DISTORTION[0]", "SURFACE_PRESSURE_DROP[0]", "SURFACE_SECONDARY[0]", "SURFACE_SECOND_OVER_UNIFORM[0]", "SURFACE_STATIC_PRESSURE[0]", "SURFACE_STATIC_TEMPERATURE[0]", "SURFACE_TOTAL_PRESSURE[0]", "SURFACE_TOTAL_TEMPERATURE[0]", "SURFACE_UNIFORMITY[0]", "AVG_TEMPERATURE[1]", "MAXIMUM_HEATFLUX[1]", "TOTAL_HEATFLUX[1]", "FINDIFF_STEP" -0 , 0.0 , -100000.01639127731, -1.1103000000496327e-08, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -0.0399999991462785, 3.3309999998872306e-08, -2.1099999997220564 , 0.0 , 2.1799999999627673 , 3.8000000007754053 , 319.9999980552093 , -39.999997625272954 , 318.0000007318995 , -39.999997625272954 , -1.400000004814217 , -139.99999737279722, 0.0 , -540.0000077315781, 1e-08 +0 , 0.0 , -199999.9862164259, -5.551100000002363e-08, 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , -0.02000000026702864, 5.550999999230055e-08, -0.6560000001543109 , 0.0 , 0.6520000012111282 , 1.1399999999550658 , 319.9999980552093 , -39.999997625272954 , 260.999999568412 , -39.999997625272954 , -0.4999999969612645 , -269.99999818144715, 0.0 , -560.0000008598727, 1e-08 diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg index b8d003a4eca..e6b53711cf2 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configFluid.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 07.06.2019 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg index 6fcbc300a41..e4b01538e7e 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configMaster.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.15 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg index 6c78fb026ed..8db23aa8353 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/chtPinArray_3d/configSolid.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 07.06.2019 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/dp-adjoint_chtPinArray_2d/configFluid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/dp-adjoint_chtPinArray_2d/configFluid.cfg index c640520534e..41c4c40e07f 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/dp-adjoint_chtPinArray_2d/configFluid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/dp-adjoint_chtPinArray_2d/configFluid.cfg @@ -4,7 +4,7 @@ % Case description: Unit Cell flow around pin array (fluid) % % Author: T. Kattmann % % Date: 2022.02.10 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/dp-adjoint_chtPinArray_2d/configMaster.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/dp-adjoint_chtPinArray_2d/configMaster.cfg index 71fb7a2d777..84d81a2b70b 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/dp-adjoint_chtPinArray_2d/configMaster.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/dp-adjoint_chtPinArray_2d/configMaster.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: None % % Date: 2022.02.10 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/dp-adjoint_chtPinArray_2d/configSolid.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/dp-adjoint_chtPinArray_2d/configSolid.cfg index 3802e0318e9..20d3b009eb5 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/dp-adjoint_chtPinArray_2d/configSolid.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/dp-adjoint_chtPinArray_2d/configSolid.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: None % % Date: 2022.02.10 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg b/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg index b0b2366cf45..5b80170d3f7 100644 --- a/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg +++ b/TestCases/incomp_navierstokes/streamwise_periodic/pipeSlice_3d/sp_pipeSlice_3d_dp_hf_tp.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Robert Bosch GmbH % % Date: 2020.12.14 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/incomp_rans/naca0012/naca0012.cfg b/TestCases/incomp_rans/naca0012/naca0012.cfg index 7798637c2c4..49bb44fde10 100644 --- a/TestCases/incomp_rans/naca0012/naca0012.cfg +++ b/TestCases/incomp_rans/naca0012/naca0012.cfg @@ -6,7 +6,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: Feb 18th, 2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/incomp_rans/naca0012/naca0012_SST_SUST.cfg b/TestCases/incomp_rans/naca0012/naca0012_SST_SUST.cfg index d5f52a64047..c351edbd375 100644 --- a/TestCases/incomp_rans/naca0012/naca0012_SST_SUST.cfg +++ b/TestCases/incomp_rans/naca0012/naca0012_SST_SUST.cfg @@ -6,7 +6,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: Feb 18th, 2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/incomp_rans/rough_flatplate/rough_flatplate_incomp.cfg b/TestCases/incomp_rans/rough_flatplate/rough_flatplate_incomp.cfg index af9ecc8f023..46d029f7e6d 100644 --- a/TestCases/incomp_rans/rough_flatplate/rough_flatplate_incomp.cfg +++ b/TestCases/incomp_rans/rough_flatplate/rough_flatplate_incomp.cfg @@ -5,7 +5,7 @@ % pressure gradient % % Author: Akshay Koodly % % Date: 2020.07.07 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/mms/dg_ringleb/ringleb_dg.cfg b/TestCases/mms/dg_ringleb/ringleb_dg.cfg index 4d9d5108678..f25a4f2d4b3 100644 --- a/TestCases/mms/dg_ringleb/ringleb_dg.cfg +++ b/TestCases/mms/dg_ringleb/ringleb_dg.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg b/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg index 47f57c8a91a..0ca4f269eae 100755 --- a/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg +++ b/TestCases/mms/fvm_incomp_euler/inv_mms_jst.cfg @@ -4,7 +4,7 @@ % Case description: Incompressible inviscid MMS test case % % Author: Thomas D. Economon % % Date: 2019.04.09 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg b/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg index 4bac9270cdc..1e77e3c1574 100755 --- a/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg +++ b/TestCases/mms/fvm_incomp_navierstokes/lam_mms_fds.cfg @@ -4,7 +4,7 @@ % Case description: Incompressible laminar MMS test case % % Author: Thomas D. Economon % % Date: 2019.04.09 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg b/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg index 0dfab26bf2f..139e6a4a84e 100755 --- a/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg +++ b/TestCases/mms/fvm_navierstokes/lam_mms_roe.cfg @@ -4,7 +4,7 @@ % Case description: Compressible laminar MMS test case % % Author: Thomas D. Economon % % Date: 2019.04.09 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/moving_wall/cavity/lam_cavity.cfg b/TestCases/moving_wall/cavity/lam_cavity.cfg index 31a541946d6..2fd187e65da 100644 --- a/TestCases/moving_wall/cavity/lam_cavity.cfg +++ b/TestCases/moving_wall/cavity/lam_cavity.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.10.01 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg b/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg index 194a46064dd..b28ce99bdc9 100644 --- a/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg +++ b/TestCases/moving_wall/spinning_cylinder/spinning_cylinder.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.08.21 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/multiple_ffd/naca0012/inv_NACA0012_ffd.cfg b/TestCases/multiple_ffd/naca0012/inv_NACA0012_ffd.cfg index 8ddf2fd572f..848ecf88acb 100644 --- a/TestCases/multiple_ffd/naca0012/inv_NACA0012_ffd.cfg +++ b/TestCases/multiple_ffd/naca0012/inv_NACA0012_ffd.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios, Charanya Venkatesan-Crome % % Institution: Stanford University % % Date: 2018.07.23 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/navierstokes/cylinder/cylinder_lowmach.cfg b/TestCases/navierstokes/cylinder/cylinder_lowmach.cfg index 942f29e8248..ce01b555f79 100644 --- a/TestCases/navierstokes/cylinder/cylinder_lowmach.cfg +++ b/TestCases/navierstokes/cylinder/cylinder_lowmach.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.09.30 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/navierstokes/cylinder/lam_cylinder.cfg b/TestCases/navierstokes/cylinder/lam_cylinder.cfg index e69570d421e..1079748199e 100644 --- a/TestCases/navierstokes/cylinder/lam_cylinder.cfg +++ b/TestCases/navierstokes/cylinder/lam_cylinder.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.09.30 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/navierstokes/flatplate/lam_flatplate.cfg b/TestCases/navierstokes/flatplate/lam_flatplate.cfg index fe83f857a37..13f3b7db032 100644 --- a/TestCases/navierstokes/flatplate/lam_flatplate.cfg +++ b/TestCases/navierstokes/flatplate/lam_flatplate.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.09.30 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/navierstokes/flatplate/lam_flatplate_unst.cfg b/TestCases/navierstokes/flatplate/lam_flatplate_unst.cfg index 26bae83a2f8..89050e0104c 100644 --- a/TestCases/navierstokes/flatplate/lam_flatplate_unst.cfg +++ b/TestCases/navierstokes/flatplate/lam_flatplate_unst.cfg @@ -2,7 +2,7 @@ % % % SU2 configuration file % % Case description: Test interp. restart, and auto time-step for dual-time % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/navierstokes/naca0012/lam_NACA0012.cfg b/TestCases/navierstokes/naca0012/lam_NACA0012.cfg index f64c2ff3956..1c31a0db257 100644 --- a/TestCases/navierstokes/naca0012/lam_NACA0012.cfg +++ b/TestCases/navierstokes/naca0012/lam_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: Sep 28, 2012 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg b/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg index 73459ec133e..ba79d7445f6 100644 --- a/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg +++ b/TestCases/navierstokes/poiseuille/lam_poiseuille.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2017.02.27 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/navierstokes/poiseuille/profile_poiseuille.cfg b/TestCases/navierstokes/poiseuille/profile_poiseuille.cfg index 2bc398301d7..d68a89741a1 100644 --- a/TestCases/navierstokes/poiseuille/profile_poiseuille.cfg +++ b/TestCases/navierstokes/poiseuille/profile_poiseuille.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Robert Bosch LLC % % Date: 2018.03.19 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nicf/LS89/turb_SA_PR.cfg b/TestCases/nicf/LS89/turb_SA_PR.cfg index 4897151ae09..737fdb2f467 100644 --- a/TestCases/nicf/LS89/turb_SA_PR.cfg +++ b/TestCases/nicf/LS89/turb_SA_PR.cfg @@ -5,7 +5,7 @@ % Author: M. Pini, S. Vitale % % Institution: Delft University of Technology % % Date: Feb 18th, 2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nicf/LS89/turb_SST_PR.cfg b/TestCases/nicf/LS89/turb_SST_PR.cfg index e5d6ad55fb1..ff9d057c34c 100644 --- a/TestCases/nicf/LS89/turb_SST_PR.cfg +++ b/TestCases/nicf/LS89/turb_SST_PR.cfg @@ -5,7 +5,7 @@ % Author: M. Pini, S. Vitale % % Institution: Delft University of Technology % % Date: Feb 18th, 2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nicf/coolprop/fluidModel.cfg b/TestCases/nicf/coolprop/fluidModel.cfg index 44df7a39118..89d0c98e03c 100644 --- a/TestCases/nicf/coolprop/fluidModel.cfg +++ b/TestCases/nicf/coolprop/fluidModel.cfg @@ -6,7 +6,7 @@ % Author: Peng Yan, Alberto Guardone % % Institution: Politecnico di Milano % % Date: 2022.10.8 % -% File Version 7.5.0 Blackbird % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nicf/coolprop/transportModel.cfg b/TestCases/nicf/coolprop/transportModel.cfg index 491073a2734..1e731406a5d 100644 --- a/TestCases/nicf/coolprop/transportModel.cfg +++ b/TestCases/nicf/coolprop/transportModel.cfg @@ -6,7 +6,7 @@ % Author: Peng Yan, Alberto Guardone % % Institution: Politecnico di Milano % % Date: 2022.11.26 % -% File Version 7.5.0 Blackbird % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nicf/datadriven/MLP_air.mlp b/TestCases/nicf/datadriven/MLP_air.mlp new file mode 100644 index 00000000000..e28657819cf --- /dev/null +++ b/TestCases/nicf/datadriven/MLP_air.mlp @@ -0,0 +1,138 @@ +
+ +[number of layers] +4 + +[neurons per layer] +2 +50 +30 +6 + +[activation function] +linear +swish +swish +linear + +[input names] +Density +Energy + +[input normalization] ++2.8103800000000001e-01 +2.7297899999999998e+01 ++1.7995600000000000e+05 +4.4831800000000000e+05 + +[output names] +s +dsde_rho +dsdrho_e +d2sde2 +d2sdedrho +d2sdrho2 + +[output normalization] ++5.7472900000000000e+03 +7.7785200000000004e+03 ++1.6686100000000001e-03 +4.0000000000000001e-03 +-1.0563199999999999e+03 -1.0714800000000000e+01 +-2.1545900000000001e-08 -3.5737000000000002e-09 +-4.2049399999999996e-06 -4.9376699999999998e-07 ++3.9691700000000002e-01 +3.7578600000000001e+03 + +
+ +[weights per layer] + +-8.7661929428577423e-03 -3.4266726970672607e+00 -1.1285322718322277e-02 -4.4609041213989258e+00 -6.2620453536510468e-03 -8.7659519910812378e-01 +8.1317527219653130e-03 +1.0037513971328735e+00 +5.1442968845367432e-01 -3.8515377044677734e+01 +3.0268053524196148e-03 -3.5439160466194153e-01 -5.6422060728073120e-01 -8.2498639822006226e-03 -1.1617618612945080e-02 +9.0869655832648277e-03 -9.9546900019049644e-03 +1.6827103495597839e-01 -2.7841054916381836e+01 -8.8479537516832352e-03 -3.9593321084976196e-01 +9.5181297510862350e-03 -2.3468191921710968e-01 -8.5755866020917892e-03 -9.0520847588777542e-03 +6.8784481287002563e-01 -3.5454284667968750e+01 -3.9844226837158203e+00 +4.1778454184532166e-01 -1.3072727015241981e-03 -1.0021785274147987e-02 -8.5394643247127533e-03 -2.2426181793212891e+01 -6.7269902229309082e+00 -2.2461936473846436e+00 +1.0424779728055000e-02 -2.1550936698913574e+00 +1.0762871503829956e+00 -5.4205872118473053e-02 +1.0137343406677246e+00 +1.0054445825517178e-02 +8.3967143297195435e-01 -3.2765858173370361e+00 -9.6592950820922852e-01 +7.5265145860612392e-03 +1.7908766865730286e-02 -1.0453859567642212e+00 +5.1517069339752197e-01 +1.0649362578988075e-02 -1.4490582466125488e+01 +-3.2857151236385107e-03 +5.9187543392181396e-01 -2.7645176742225885e-03 -5.6996935606002808e-01 +2.6538472156971693e-03 -2.7195680141448975e+00 +3.0651132110506296e-03 +8.6517339944839478e-01 +4.3157178163528442e-01 +1.4268080890178680e-01 +3.5014057066291571e-03 +5.3483609110116959e-02 -6.2381106615066528e-01 -2.6864213868975639e-03 -3.6386675201356411e-03 +3.2822357024997473e-03 -6.2203389825299382e-04 +5.6492674350738525e-01 -4.0196239948272705e-02 -3.2206296455115080e-03 -1.3066108226776123e+00 +3.2423695083707571e-03 -4.7114229202270508e-01 -3.1998909544199705e-03 -3.4287294838577509e-03 -7.1377158164978027e-01 -3.3232133835554123e-02 +4.1278833150863647e-01 -6.1671531200408936e-01 +8.1366943195462227e-03 -2.5733003858476877e-03 -4.1674333624541759e-03 +2.6167348027229309e-01 +2.3013504222035408e-02 -3.9804546833038330e+00 +3.2503411639481783e-03 -4.1613835096359253e-01 +8.3258646726608276e-01 -4.6460423469543457e+00 -6.7755001783370972e-01 +2.0869453437626362e-03 -1.2752885818481445e+00 +3.7751388549804688e-01 +7.4102884531021118e-01 +2.5022702757269144e-03 -3.5920643806457520e+00 +4.4666483998298645e-01 +6.7768990993499756e-01 +3.8648282643407583e-03 -6.6180028021335602e-02 + + ++2.2392576560378075e-02 +7.9600289463996887e-03 +3.5748567897826433e-03 -9.0584503486752510e-03 +1.2166848406195641e-02 -2.5937089230865240e-03 -3.1598001718521118e-02 -1.0288016637787223e-03 +5.8472803793847561e-03 +9.6058771014213562e-03 +1.1490470496937633e-03 +1.1987331090494990e-03 -1.4139647595584393e-02 +5.7148635387420654e-03 -1.3746656477451324e-02 -1.1688595404848456e-03 -6.0691782273352146e-03 +1.2217802926898003e-02 +4.9242796376347542e-04 -3.5094288177788258e-03 -1.1753068974940106e-04 +1.0253794491291046e-02 -4.4527775608003139e-03 -9.4327889382839203e-03 +5.4327612742781639e-03 +1.4921743422746658e-02 -4.8628062941133976e-03 +2.6123812422156334e-03 -2.4538778234273195e-03 +1.0964288376271725e-03 ++3.6110359430313110e-01 +9.8026596009731293e-02 +4.6404144167900085e-01 +6.0216322541236877e-02 -8.0096580088138580e-02 +1.2656687200069427e-01 +1.0300234556198120e+00 +2.5322940945625305e-01 -1.1969280242919922e-01 +7.5731530785560608e-02 +2.5466546416282654e-01 +4.0801015496253967e-01 +1.0507564246654510e-01 +1.8800427019596100e-01 -6.6708527505397797e-02 -2.8555359691381454e-02 +1.5476048924028873e-02 -2.9614616185426712e-02 +3.6750924587249756e-01 +2.5943362712860107e-01 -1.8100416660308838e-01 +8.2749044895172119e-01 -3.2592689990997314e-01 -1.8920606374740601e-01 +3.0292451381683350e-01 +1.6076701879501343e-01 +4.3490141630172729e-01 +1.1568275690078735e+00 +4.0298035740852356e-01 +4.5640733838081360e-01 ++2.8654664754867554e-02 -5.1102931611239910e-03 -5.0179590471088886e-03 +2.9692562296986580e-02 -2.5242846459150314e-02 -1.0584304109215736e-02 -8.6143769323825836e-02 -1.2718157377094030e-03 -1.6436820151284337e-03 -6.0880156233906746e-03 +6.4149782992899418e-03 +7.7689094468951225e-03 -8.7809944525361061e-03 +4.9446863122284412e-03 +1.4842073433101177e-02 -1.3596132630482316e-03 -4.6914261765778065e-03 -5.8191916905343533e-03 +5.3516036132350564e-05 -2.4235600139945745e-03 +1.3130043633282185e-02 +1.2955116108059883e-02 +7.5448508141562343e-05 -2.3631529882550240e-02 -7.2855874896049500e-03 -1.2934653786942363e-03 -3.2870728522539139e-02 -7.9475715756416321e-03 -1.0526617552386597e-04 +6.6794380545616150e-03 ++1.0183042287826538e+00 +9.4328612089157104e-02 +1.5826278924942017e-01 +1.0882979631423950e+00 +2.0344227552413940e-02 +1.0282444208860397e-01 +2.0774064064025879e+00 +2.3161085322499275e-02 -2.3039284348487854e-01 -1.1217297054827213e-02 +1.8896563351154327e-01 +5.7233422994613647e-01 +8.3293038606643677e-01 +1.4052432775497437e+00 +3.1595088541507721e-02 -4.9777433276176453e-02 +6.8844801187515259e-01 -5.7788652181625366e-01 +1.2352354079484940e-01 +6.8365705013275146e-01 +5.9540993534028530e-03 +1.2188625335693359e+00 +2.3281562328338623e-01 +1.4437642097473145e+00 +3.4375214576721191e-01 +2.4806845188140869e-01 +6.3897532224655151e-01 +1.4015979766845703e+00 +4.7642663121223450e-02 +8.3598303794860840e-01 +-7.1249902248382568e-02 +7.3736738413572311e-03 -6.5115123987197876e-02 +1.7532150447368622e-01 -1.6516063362360001e-02 -2.2883811965584755e-02 -2.8121235966682434e-01 +1.7733649583533406e-03 +1.3607916422188282e-02 +5.1674195565283298e-03 +2.4119220674037933e-02 +2.7576148509979248e-02 -1.2013184279203415e-01 +8.2866497337818146e-02 -4.9877990968525410e-03 -1.4383967965841293e-02 -1.5938781201839447e-02 -1.2918220460414886e-01 +3.9603719487786293e-03 +7.1034422144293785e-03 +2.2393852472305298e-02 +1.2858656700700521e-03 -1.4535012654960155e-02 -1.7607294023036957e-01 -3.1297340989112854e-02 +3.4883134067058563e-02 -2.8218910098075867e-01 -1.9953873753547668e-01 +1.9713912159204483e-02 +2.8901921585202217e-02 ++4.0369346737861633e-01 +2.9731053113937378e-01 +2.4753858149051666e-01 +8.8224422931671143e-01 -1.6348542273044586e-01 -9.0610712766647339e-02 +1.9077446460723877e+00 +4.6216920018196106e-01 +2.5316935498267412e-03 -9.5464952290058136e-02 +2.1605189889669418e-02 -3.3519038558006287e-01 +1.2772579193115234e+00 +1.1152528971433640e-01 -1.6712199151515961e-01 +5.5418047122657299e-04 +1.9669297337532043e-01 +9.5107990503311157e-01 -2.9479548335075378e-01 +1.0238968133926392e+00 +9.9080967903137207e-01 +1.0320177078247070e+00 +4.5898649096488953e-01 +2.5367140769958496e-01 +1.8751852512359619e+00 +9.4264733791351318e-01 +3.9391773939132690e-01 +1.5431394577026367e+00 +3.1736749410629272e-01 +6.5486781299114227e-02 +-1.8551195040345192e-02 -7.2722234763205051e-03 -1.1413882020860910e-03 +5.5114943534135818e-03 -1.3809083029627800e-02 +1.5010851202532649e-03 +2.1325828507542610e-02 +9.0782874030992389e-04 -3.4422297030687332e-03 -9.2107634991407394e-03 +2.1454272791743279e-03 -1.9363844767212868e-03 +1.5615450218319893e-02 -7.0545747876167297e-03 +1.5504360198974609e-02 +6.2023132340982556e-04 +9.1641666367650032e-03 -2.5680776685476303e-02 -3.0705684912391007e-04 +1.5729337465018034e-03 +4.7629857435822487e-03 -7.7615403570234776e-03 +3.7197743076831102e-03 +8.1001278012990952e-03 -5.9072612784802914e-03 -9.1548021882772446e-03 -8.5639227181673050e-03 -4.2250481783412397e-04 +2.3268302902579308e-03 -1.4017717912793159e-03 +-2.3385837674140930e-01 -2.0700454711914062e-01 +5.0028526782989502e-01 -8.4764569997787476e-02 +2.3447500169277191e-01 -2.8759571909904480e-01 -1.1670864820480347e+00 +2.5192543864250183e-01 -2.3637959361076355e-01 -1.8615426123142242e-01 -7.5147911906242371e-02 -4.2479848861694336e-01 +1.0016661137342453e-01 -1.5444077551364899e-01 +2.9203984141349792e-01 -1.6324970871210098e-02 +1.4786723256111145e-01 -2.1885683760046959e-02 -3.8148441910743713e-01 -5.9453976154327393e-01 -2.6424989104270935e-01 -8.0739200115203857e-01 -4.9984103441238403e-01 -1.9075922667980194e-01 +2.6735782623291016e-01 +2.4672958254814148e-01 -1.6150070726871490e-01 -1.3906221389770508e+00 +3.6920774728059769e-03 -3.1305900216102600e-01 ++5.3976573050022125e-02 +2.2428610920906067e-01 +7.5511598587036133e-01 +2.2359265387058258e-01 +1.4866603910923004e-01 -1.9589638710021973e-01 -9.5226556062698364e-01 +2.3839950561523438e-01 +3.1497514247894287e-01 +2.2922165691852570e-01 -1.8898980319499969e-01 +3.0267661809921265e-01 +2.0260135829448700e-01 -3.4200616180896759e-02 -2.2988453507423401e-01 +3.7760379910469055e-01 +2.7023553848266602e-01 +5.1056051254272461e-01 -2.6908892393112183e-01 -7.1504056453704834e-02 +3.2599738240242004e-01 -6.3871419429779053e-01 +1.2145425193011761e-02 +3.0939784646034241e-01 +5.7983940839767456e-01 +5.5183309316635132e-01 +8.7424121797084808e-02 -7.2706693410873413e-01 +1.6143250465393066e-01 -3.0804461240768433e-01 ++5.4388680458068848e+00 -4.8211678862571716e-02 +1.3934879302978516e+00 -3.8359767198562622e-01 -7.1386933326721191e-02 -9.7167646884918213e-01 +7.1207904815673828e+00 -1.8979947268962860e-01 +9.0723522007465363e-03 -3.0877865850925446e-02 -2.2286973893642426e-02 +1.9570294022560120e-01 -2.9662413522601128e-02 +3.3544573783874512e+00 +8.1466563045978546e-02 +1.7743223905563354e-01 +4.0210589766502380e-01 -1.2413966655731201e+00 -1.0203550010919571e-01 -2.0565536022186279e+00 +2.2479303181171417e-01 +2.5490016937255859e+00 +1.2534368038177490e-01 -1.4018478989601135e-01 +3.3276398181915283e+00 -1.6095693111419678e+00 +7.6436616480350494e-02 +2.7643635272979736e+00 +9.4836199283599854e-01 +6.8442809581756592e-01 +-8.9177824556827545e-02 +6.5167476423084736e-03 -2.8235929086804390e-02 +9.8510220646858215e-02 +5.0358367152512074e-03 +4.5349965803325176e-03 -4.3019449710845947e-01 +1.5286672860383987e-03 -1.6081217676401138e-02 +2.3365607485175133e-02 +4.6824812889099121e-02 +2.7973545715212822e-02 -8.8929399847984314e-02 +1.1491440981626511e-01 +3.1452793627977371e-02 -1.0596839711070061e-03 -2.1337373182177544e-02 -7.5179286301136017e-02 -1.6686336603015661e-03 -1.3744756579399109e-01 -1.4291884005069733e-01 +9.9394628778100014e-03 +9.0381503105163574e-04 -2.5926785543560982e-02 -3.5228424239903688e-03 +1.5739551186561584e-01 +2.9531730338931084e-02 -2.9179224371910095e-01 -2.9110519681125879e-03 +4.2410619556903839e-02 ++2.0986029505729675e-01 -3.2014039158821106e-01 +6.4531847834587097e-02 +3.5717433691024780e-01 -1.0694514960050583e-01 +1.5922227501869202e-01 +1.8404359817504883e+00 -7.0013843476772308e-02 +1.0977050662040710e-01 -1.9438337534666061e-02 +3.0386874079704285e-01 -2.5890406966209412e-01 +2.3401951789855957e-01 -1.9390870630741119e-01 +2.1952521800994873e-01 +3.0579257011413574e-01 -4.1737759113311768e-01 +1.3158984482288361e-01 -2.5674876570701599e-01 -2.0747114717960358e-01 -1.3071627356112003e-02 +8.8095277547836304e-01 +4.7186973690986633e-01 -4.3130216002464294e-01 +2.2180753946304321e-01 +2.1879050135612488e-01 +8.7652452290058136e-02 +1.4542431831359863e+00 -1.7569498717784882e-01 -4.2115136981010437e-02 ++3.1454294919967651e-02 -1.2935942411422729e-01 +5.0012981891632080e-01 -2.2237123921513557e-02 +3.2395929098129272e-02 -1.2856999039649963e-01 +1.0422532558441162e+00 +5.9094369411468506e-02 +1.6329297423362732e-01 -1.5968561172485352e-02 +3.5146292299032211e-02 +2.5358462333679199e-01 +6.9700509309768677e-01 +3.7190999835729599e-02 -3.1922256946563721e-01 +9.9820084869861603e-03 -2.1194377914071083e-02 +6.2019509077072144e-01 +4.1183158755302429e-01 +8.9281946420669556e-02 +4.3999701738357544e-01 +9.0066611766815186e-01 -3.1003439426422119e-01 -1.1288642138242722e-01 +4.2092651128768921e-01 +4.0025594830513000e-01 +7.1255147457122803e-01 +1.4434016942977905e+00 -5.5304080247879028e-01 -1.7932089045643806e-02 ++2.7572058141231537e-02 +8.2171997055411339e-03 +9.4498787075281143e-04 -2.0359544083476067e-02 +6.9288755767047405e-03 -2.4946043267846107e-03 -3.6368090659379959e-02 -1.2999128084629774e-03 +5.0133448094129562e-03 +1.2948354706168175e-02 -1.0674160439521074e-03 +8.6972565623000264e-04 +6.6573929507285357e-04 +2.8723340947180986e-03 -1.4617691747844219e-02 -1.5716382768005133e-03 -3.3463290892541409e-03 +3.7084981799125671e-02 +7.2192674269899726e-04 -1.9076513126492500e-03 +4.3147504329681396e-02 +7.8640561550855637e-03 -4.3465071357786655e-03 -1.2246314436197281e-02 +3.7610607687383890e-03 +1.2747735716402531e-02 +5.3343186154961586e-03 +2.3305744398385286e-03 -2.1638954058289528e-03 +1.8606630619615316e-03 ++1.1653236113488674e-02 +8.3067623199895024e-04 -2.0229928195476532e-02 +4.6623736619949341e-02 -2.3877365514636040e-02 -9.5734903588891029e-03 -7.6195552945137024e-02 -1.3526364928111434e-03 -4.4793300330638885e-03 -1.8764500273391604e-03 +1.9989397376775742e-02 +1.0507276281714439e-02 -2.7843827381730080e-02 +1.7238724976778030e-02 +3.0009781476110220e-03 -1.7600433202460408e-03 -9.1034341603517532e-03 -1.0331550613045692e-02 +2.0209257490932941e-04 +9.8309172317385674e-03 +1.8703460693359375e-02 +9.5323780551552773e-03 -1.1899343226104975e-03 -3.2162051647901535e-02 -4.5783161185681820e-03 +1.0196280200034380e-03 -4.6069648116827011e-02 -1.8225667998194695e-02 +3.3020708360709250e-04 +9.3011017888784409e-03 +-1.8872637301683426e-02 -6.0376455076038837e-03 -4.1067937854677439e-04 +1.3683103956282139e-02 -1.1682632379233837e-02 +1.4379398198798299e-03 +3.2982267439365387e-02 +1.0437252931296825e-03 -4.7897922922857106e-04 -9.3664173036813736e-03 -7.5457541970536113e-04 -1.7994442023336887e-03 +1.1769735254347324e-02 -7.3857572861015797e-03 +8.5298512130975723e-03 +8.7231909856200218e-04 +6.8040224723517895e-03 -1.7418755218386650e-02 -4.4098650687374175e-04 +3.2832606229931116e-03 -7.0642125792801380e-03 -5.5945846252143383e-03 +4.4170590117573738e-03 +9.8447855561971664e-03 -5.4901787079870701e-03 -1.9048498943448067e-02 -4.0401788428425789e-03 +1.0774898109957576e-03 +2.8382160235196352e-03 -2.2717663086950779e-03 +-3.0968807637691498e-02 +3.4293960779905319e-03 -4.5778378844261169e-02 +1.2099603563547134e-01 -2.1703146398067474e-02 -2.6458010077476501e-02 -1.4596630632877350e-01 +1.8748512957245111e-04 +4.1643748991191387e-03 +6.9636721163988113e-03 +2.0675826817750931e-02 +9.0420674532651901e-03 -9.0069174766540527e-02 +3.9218366146087646e-02 +1.8253201851621270e-03 -6.5851653926074505e-03 -3.5960872191935778e-03 -6.4441464841365814e-02 +1.1426685377955437e-03 -5.2756820805370808e-03 -1.7345602810382843e-01 +3.9035785943269730e-02 -3.0535785481333733e-03 -7.2163030505180359e-02 -1.5704572200775146e-02 -1.9623422995209694e-02 -1.1985094845294952e-01 -9.9167406558990479e-02 +4.9744793213903904e-03 +1.4784702099859715e-02 ++1.8654450774192810e-01 +1.4119601249694824e-01 -2.2252102196216583e-01 +9.6041089296340942e-01 -1.6173821687698364e-01 +5.8522284030914307e-02 +1.7320021390914917e+00 +4.7821000218391418e-02 +4.3808248639106750e-01 -1.2928076088428497e-01 -1.5165460109710693e-01 -2.3914944380521774e-02 +1.4819781780242920e+00 -1.5836881101131439e-01 +1.4562886953353882e-01 -2.1183432638645172e-01 +1.6852976754307747e-02 +4.6025195717811584e-01 -1.3624036312103271e-01 +8.7582886219024658e-01 +9.4384902715682983e-01 +8.5495972633361816e-01 +6.4013659954071045e-01 +1.7367276549339294e-01 +9.5168566703796387e-01 +4.0076676011085510e-01 +4.8677390813827515e-01 +1.7919195890426636e+00 -3.0221998691558838e-01 -3.9657318592071533e-01 ++4.8854022026062012e+00 -7.3605217039585114e-02 +4.5121341943740845e-02 +9.2635381221771240e-01 -6.6728584468364716e-02 +3.6604961752891541e-01 +1.1934051513671875e+01 +8.6639933288097382e-02 +6.0030452907085419e-02 -7.9747047275304794e-03 -1.4038564264774323e-01 +5.0605779886245728e-01 -1.8718546628952026e-01 +2.2427473068237305e+00 +9.9341079592704773e-02 -2.6597088575363159e-01 +3.6095491051673889e-01 +2.1646662056446075e-01 +5.4312353022396564e-03 +1.1021225452423096e+00 +1.6586470603942871e-01 +2.1038167476654053e+00 -2.7163031697273254e-01 +5.9570664167404175e-01 +2.1361887454986572e+00 +1.4068026542663574e+00 -4.3007794022560120e-01 +3.7596609592437744e+00 +6.4098358154296875e-01 +5.3141951560974121e-01 ++2.4275714531540871e-02 +8.0193914473056793e-03 +2.7947551570832729e-03 -1.0994555428624153e-02 +1.1617438867688179e-02 -2.9287489596754313e-03 -3.3954977989196777e-02 -1.1213655816391110e-03 +6.6085052676498890e-03 +1.0182109661400318e-02 +9.9353352561593056e-04 +9.4423000700771809e-04 -1.1731697246432304e-02 +4.6814437955617905e-03 -1.4674077741801739e-02 -1.2527407379820943e-03 -5.2128336392343044e-03 +2.1108357235789299e-02 +5.0052808364853263e-04 -2.9256476555019617e-03 +7.6805154094472528e-04 +1.1561916209757328e-02 -3.8946189451962709e-03 -9.9965883418917656e-03 +4.8208623193204403e-03 +1.0596007108688354e-02 +7.9873314825817943e-04 +3.5245600156486034e-03 -2.2933133877813816e-03 +1.2488393113017082e-03 ++1.6016787290573120e-01 +7.7209278941154480e-02 +1.7114375531673431e-01 +4.3050479143857956e-02 +5.7305462658405304e-02 +1.5422140061855316e-01 +6.1659538745880127e-01 +9.0307667851448059e-03 +3.5114419460296631e-01 +3.5721026360988617e-02 -2.3983967304229736e-01 +2.1818891167640686e-01 +1.8132917582988739e-01 -9.6874050796031952e-02 -4.7828834503889084e-02 +4.4671192765235901e-01 -2.1089844405651093e-01 -3.9429506659507751e-01 +1.2285838127136230e+00 +4.7332602739334106e-01 -3.4942340850830078e-01 +5.0397449731826782e-01 +5.4826319217681885e-01 -4.1917493939399719e-01 -5.1285572350025177e-02 -1.0766799002885818e-01 +2.0650914311408997e-01 +1.2224029302597046e+00 -5.6231819093227386e-02 +1.1693327128887177e-01 +-2.2527543827891350e-02 -1.0194590315222740e-02 -1.7490637255832553e-03 +1.1888316832482815e-02 -9.6026370301842690e-03 +2.3832642473280430e-03 +3.6170259118080139e-02 +1.0733433300629258e-03 -3.5343344788998365e-03 -9.4599602743983269e-03 +3.5193939693272114e-03 -1.1839274084195495e-03 +9.5982411876320839e-03 -5.3506642580032349e-03 +1.2060887180268764e-02 +8.7261211592704058e-04 +4.8638777807354927e-03 -2.6349717751145363e-02 -3.5703508183360100e-04 +3.2163087744265795e-03 +7.4916356243193150e-03 -6.1825853772461414e-03 +3.4973602741956711e-03 +1.0307240299880505e-02 -4.4109360314905643e-03 -1.2619192712008953e-03 +1.4225110644474626e-03 -2.7125081978738308e-03 +2.7898952830582857e-03 -1.7149281920865178e-03 ++2.2116163372993469e-01 +3.2759135961532593e-01 +8.7951850891113281e-01 +7.3240935802459717e-01 -9.7584985196590424e-02 +2.2130407392978668e-01 +1.3648532629013062e+00 -1.0221759974956512e-01 +1.7253969563171268e-03 -3.2343029975891113e-01 +3.4902298450469971e-01 -1.9911876006517559e-04 +8.9159053564071655e-01 -6.0936197638511658e-02 +2.5235185027122498e-01 +3.5128825902938843e-01 +1.9840463995933533e-01 +7.5175738334655762e-01 +2.7205696702003479e-01 +8.6356562376022339e-01 +4.3659573793411255e-01 +9.8762542009353638e-01 +5.3135689347982407e-02 +1.4561730623245239e-01 +1.1676498651504517e+00 +9.6018069982528687e-01 +3.7918668985366821e-01 +1.7153657674789429e+00 +7.4393503367900848e-02 -2.3986081779003143e-01 ++1.8529502674937248e-02 +1.2471674941480160e-02 -3.4637285862118006e-03 -1.5456212684512138e-02 +5.7575823739171028e-03 -6.6754622384905815e-03 -4.0383581072092056e-02 -1.2936701532453299e-03 +8.4897894412279129e-03 +8.8328812271356583e-03 +7.7898991294205189e-03 +4.1505205444991589e-03 -1.0132861323654652e-02 +7.9530533403158188e-03 -6.9545153528451920e-03 -2.2615678608417511e-03 -7.9146688804030418e-03 +5.0236810930073261e-03 +8.9906400535255671e-04 +1.6654084902256727e-03 +1.3985021039843559e-02 +1.5896828845143318e-02 -5.7941824197769165e-03 -2.2503504529595375e-02 +1.4351443387567997e-03 +1.0629719123244286e-02 -1.8404109403491020e-02 -9.9081424996256828e-03 +2.8386365738697350e-04 +4.6008829958736897e-03 ++2.2111453115940094e-02 +8.2840332761406898e-03 +5.1666749641299248e-03 -1.1102426797151566e-02 +1.2924573384225368e-02 -1.9009257666766644e-03 -3.2805427908897400e-02 -1.1316227028146386e-03 +5.4512554779648781e-03 +1.0801286436617374e-02 -1.1930909240618348e-03 +1.1684393975883722e-03 -1.5875825658440590e-02 +5.5907550267875195e-03 -1.3301973231136799e-02 -9.4381708186119795e-04 -5.1597617566585541e-03 +1.6487410292029381e-02 +3.9696216117590666e-04 -3.2301587052643299e-03 -9.8162807989865541e-04 +4.2292084544897079e-03 -4.3733813799917698e-03 -1.0548825375735760e-02 +5.0795632414519787e-03 +1.9577415660023689e-02 +1.5869616763666272e-03 +2.4348013103008270e-03 -3.0362205579876900e-03 +1.3995966874063015e-03 +-2.0789991319179535e-01 -3.1365436315536499e-01 -2.1224570274353027e-01 +2.7200996875762939e-01 -1.8354667723178864e-01 +1.7508347332477570e-01 -1.6252928972244263e-01 -5.5214416980743408e-01 +2.9524454474449158e-01 +4.8238866031169891e-02 -8.3344601094722748e-02 -2.6718851923942566e-01 +1.2276823818683624e-01 -4.1695365309715271e-01 +1.6769100725650787e-01 +4.9431991577148438e-01 +2.9209960252046585e-02 +2.5150081515312195e-01 +1.5908457338809967e-02 -1.4371997117996216e-01 +3.2890480756759644e-01 -2.6231148838996887e-01 -3.8024280220270157e-02 -6.4148157835006714e-02 +9.4589143991470337e-01 +2.1765588223934174e-01 -1.0722817853093147e-02 -6.3435238599777222e-01 +4.1574063897132874e-01 -4.2805054783821106e-01 ++7.2712225914001465e+00 +1.2700730562210083e-01 +5.3292846679687500e-01 +5.1340532302856445e-01 +6.9889031350612640e-02 -5.0969070196151733e-01 +1.3058687210083008e+01 +1.3733775913715363e-01 +2.7870317921042442e-02 +3.8505170494318008e-02 +1.0009362548589706e-01 -7.5890056788921356e-02 +3.3805650472640991e-01 +3.3654196262359619e+00 -1.4968556165695190e-01 -8.6031705141067505e-02 -3.7358690053224564e-02 +7.2901225090026855e-01 +8.7380141019821167e-02 -6.5669131278991699e-01 -3.9542964100837708e-01 +3.0369405746459961e+00 +1.0485937446355820e-01 +2.9783341288566589e-01 +3.0435004234313965e+00 -4.4410625100135803e-01 +1.7786826193332672e-01 +4.1729598045349121e+00 +1.1803784370422363e+00 +5.1697224378585815e-01 ++7.2361037135124207e-02 +1.0434747487306595e-01 +2.5478628277778625e-01 -3.1980383396148682e-01 +1.0744347237050533e-03 +1.5667042462155223e-03 +8.4402757883071899e-01 -1.6111811995506287e-01 -3.9067182689905167e-02 -1.2757842242717743e-01 +3.7187714129686356e-02 +5.8204048871994019e-01 +9.9003091454505920e-03 +4.8570826649665833e-01 -1.2334727682173252e-02 +1.4479886740446091e-02 +3.3324141055345535e-02 +1.0832691937685013e-01 -1.8778277933597565e-01 -6.4557157456874847e-02 -4.2752179503440857e-01 +7.4300664663314819e-01 -2.9012808203697205e-01 +1.8560871481895447e-01 -4.8793795704841614e-01 +5.2122825384140015e-01 +2.1336844563484192e-01 +6.3208365440368652e-01 +5.4360829293727875e-02 +4.0972760319709778e-01 ++3.5012421011924744e-01 +6.9923810660839081e-02 +4.0716433525085449e-01 +5.3995728492736816e-01 -2.3399001359939575e-01 -4.0856763720512390e-02 +2.8955936431884766e-01 -5.1727855205535889e-01 +2.3481069505214691e-01 -1.3956817984580994e-01 +1.4436457306146622e-02 -2.6022922992706299e-01 -6.6649812459945679e-01 +9.2143051326274872e-02 +2.6337483897805214e-02 +1.1338828504085541e-01 +1.5185187757015228e-01 +1.6408857703208923e-01 +1.0436477512121201e-01 +1.8627494573593140e-01 +3.0829069018363953e-01 +2.7388930320739746e-01 +6.8136763572692871e-01 -3.1408968567848206e-01 +8.7798923254013062e-01 +3.5235232114791870e-01 +1.5354498289525509e-02 +7.3805421590805054e-01 +1.2355228513479233e-01 -2.4989223480224609e-01 +-3.2276257872581482e-01 -1.0486289113759995e-01 +2.3173089325428009e-01 +2.1661554276943207e-01 +2.9786330461502075e-01 +6.6890522837638855e-02 -1.1054642200469971e+00 -1.1351974681019783e-02 -1.3273781538009644e-01 +2.4014513194561005e-01 +1.0007199645042419e-01 +4.7196555882692337e-02 -9.3297913670539856e-02 +2.9942387342453003e-01 -1.6772331297397614e-01 +1.9559809938073158e-02 -1.5826578019186854e-03 +3.4687739610671997e-01 -1.0238303802907467e-02 -2.1310466527938843e-01 -9.4791159033775330e-02 -7.1938371658325195e-01 -3.5081151872873306e-03 -6.3778846524655819e-03 -7.6994225382804871e-02 +6.0040992498397827e-01 +3.3398607373237610e-01 -7.7061820030212402e-01 -3.3901266753673553e-02 +1.0806512832641602e-01 ++8.2691572606563568e-03 +8.9024257613345981e-04 -2.1341597661375999e-02 +8.3748750388622284e-02 -2.5057313963770866e-02 -1.5810465440154076e-02 -1.3286414742469788e-01 -1.2695635668933392e-03 -2.1033026278018951e-03 +1.5939393779262900e-03 +1.9721014425158501e-02 +1.3928753323853016e-02 -5.3723499178886414e-02 +2.5143200531601906e-02 +1.7632738454267383e-03 -4.5787091366946697e-03 -6.5327701158821583e-03 -4.9782957881689072e-02 +1.1645258637145162e-03 +3.8044687244109809e-04 +5.3891308605670929e-02 +1.2177241034805775e-02 -6.7768176086246967e-03 -6.0138739645481110e-02 -1.2698988430202007e-02 +5.8310475200414658e-02 -1.2028193473815918e-01 -5.1947850733995438e-02 +2.7508037164807320e-03 +1.2942352332174778e-02 +-3.4236672945553437e-05 -2.8759775683283806e-02 -2.9006756842136383e-02 -1.3310307636857033e-02 -3.6137101706117392e-03 -9.4494642689824104e-03 -2.1286444738507271e-02 -1.3164381962269545e-03 -1.9364116713404655e-02 -1.3604124076664448e-02 +1.1144751682877541e-02 +3.2778438180685043e-03 -1.2264763936400414e-02 +1.7550691962242126e-02 +4.1497065685689449e-03 +9.7439253295306116e-05 -1.4168939553201199e-02 -6.9460864178836346e-03 -2.2605271078646183e-04 -2.3730602115392685e-03 -1.8942527822218835e-04 +1.2368117459118366e-02 -4.3640783987939358e-03 -6.2440014444291592e-03 +4.2781820520758629e-03 +2.2261872887611389e-02 +1.2400990817695856e-03 -1.3751769438385963e-02 -5.9892060235142708e-03 +2.1073534153401852e-03 ++8.5913372039794922e-01 +2.3073198273777962e-02 -2.1961748600006104e-01 -4.3026676774024963e-01 +3.0936915427446365e-02 +4.3308371305465698e-01 +4.0976762771606445e+00 +3.9217900484800339e-02 -2.6484379172325134e-01 +6.8370722234249115e-02 -3.0703976750373840e-02 +5.6450337171554565e-02 -9.6004538238048553e-02 -2.2072274982929230e-01 -4.1375476866960526e-03 +1.6725915670394897e-01 +2.3670588433742523e-01 -3.7519767880439758e-01 +5.9574068291112781e-04 +2.0866191387176514e+00 +1.7037096619606018e-01 +6.5619558095932007e-01 +2.0581054687500000e-01 -4.1148620843887329e-01 +1.2755781412124634e-01 +9.5241892337799072e-01 +1.2518359422683716e+00 +1.0952361822128296e+00 -8.9960135519504547e-02 -5.0880756229162216e-02 ++9.0228390693664551e-01 -1.0823003202676773e-01 +1.5816891193389893e-01 -6.4109116792678833e-01 +4.2200352996587753e-02 +1.3504280149936676e-01 +2.2318611145019531e+00 +1.4964121580123901e-01 +5.6394997984170914e-02 -2.2471547126770020e-03 -2.9191595315933228e-01 +5.1329350471496582e-01 -8.0748385190963745e-01 +2.5235477089881897e-01 +1.4373315870761871e-01 -1.6342315822839737e-02 +7.2524732351303101e-01 -7.5963836908340454e-01 -6.2272511422634125e-02 -1.7983757257461548e+00 +9.6288102865219116e-01 +7.4859458208084106e-01 +2.2991824150085449e-01 -1.7653387039899826e-03 +1.1102116107940674e+00 -9.5934426784515381e-01 +8.5379183292388916e-01 +1.7208693027496338e+00 +3.3490353822708130e-01 +3.5197514295578003e-01 ++5.6387966871261597e-01 +4.0609989315271378e-02 +5.8700656890869141e-01 +1.1989215612411499e+00 +2.0690809190273285e-01 +1.4520037174224854e-01 +1.7833678722381592e+00 +2.4562267586588860e-02 -1.5529439551755786e-03 +1.5156769752502441e-01 -2.2962193191051483e-01 -4.5012792944908142e-01 +9.7887712717056274e-01 +6.1935609579086304e-01 -5.1285469532012939e-01 -5.6241933256387711e-02 +4.2846706509590149e-01 +5.6083625555038452e-01 -1.8052670359611511e-01 +9.5499169826507568e-01 +1.0722625255584717e+00 +8.5608100891113281e-01 +4.9229997396469116e-01 +3.4569552540779114e-01 +1.6449652910232544e+00 +3.1636464595794678e-01 +1.5552981197834015e-01 +1.5618047714233398e+00 +2.4557434022426605e-01 -2.7909988164901733e-01 +-2.5227408856153488e-02 +6.7925280891358852e-03 -8.5221873596310616e-03 -4.6783997095189989e-04 +2.1475488319993019e-02 +2.8867835644632578e-03 +4.2210184037685394e-02 +6.4291694434359670e-04 +1.3722287490963936e-02 -4.5590819790959358e-03 -6.5302308648824692e-03 -2.2286348976194859e-03 -7.3106321506202221e-03 -5.5026537738740444e-03 -2.3869426921010017e-02 -1.5804014401510358e-03 +9.4235930591821671e-03 -5.0292089581489563e-03 +9.9515949841588736e-04 +6.5869204699993134e-03 +2.0632037892937660e-02 -9.1606361092999578e-04 -4.2537762783467770e-03 -8.0395229160785675e-03 -3.9589703083038330e-03 +2.2554711904376745e-04 -4.8205000348389149e-03 -9.0945875272154808e-03 +5.4113185033202171e-03 +1.1075953952968121e-03 ++1.7417770624160767e-01 -4.0229223668575287e-02 +4.6047145128250122e-01 -9.1004621982574463e-01 -7.4416518211364746e-02 +2.3426543176174164e-01 +1.5793747901916504e+00 -1.2237736582756042e-01 +1.4910872280597687e-01 +4.5358218252658844e-02 -2.5151076912879944e-01 +2.8184050321578979e-01 -5.1158499717712402e-01 +3.7776541709899902e-01 -3.1885482370853424e-02 -3.3769153058528900e-02 -7.2127304971218109e-02 +8.8425815105438232e-01 +2.0678674802184105e-02 -1.3104153871536255e+00 -2.1792354062199593e-02 +1.5569976568222046e+00 +4.3220180273056030e-01 -1.3016904592514038e+00 -3.0009365081787109e-01 +3.2529893517494202e-01 +3.1526025384664536e-02 +9.4456905126571655e-01 -1.4266319572925568e-01 +4.8495379090309143e-01 +-4.9574843049049377e-01 +2.6691950857639313e-02 -4.0789869427680969e-01 -4.5558023452758789e-01 -2.1639565005898476e-02 -4.0469595789909363e-01 -1.5745351314544678e+00 +8.0675952136516571e-02 +1.5461166203022003e-01 +6.0930907726287842e-02 +1.0698282718658447e-01 -5.2611881494522095e-01 -1.6550740599632263e-01 -5.6813292205333710e-02 -2.1225520968437195e-01 -4.4593742489814758e-01 -1.3828843832015991e-01 -1.1011983454227448e-01 -9.6598960459232330e-02 -6.5178626775741577e-01 -1.6192813217639923e-01 -9.2766767740249634e-01 -2.7915176749229431e-01 -3.2323712110519409e-01 -1.9982039928436279e-02 -3.3703488111495972e-01 -6.5649084746837616e-02 -2.0218217372894287e+00 -2.9219651222229004e-01 -1.3018406927585602e-01 ++4.9251103401184082e-01 -8.7121725082397461e-02 +8.5130169987678528e-02 +9.6962526440620422e-02 +7.9782120883464813e-02 -3.4045062959194183e-02 +1.6377160549163818e+00 +1.9997876882553101e-01 +2.2851370275020599e-01 -8.0786406993865967e-02 -1.0590063035488129e-01 +7.6197758316993713e-02 -8.7243348360061646e-02 -4.5814581215381622e-02 +1.4000245928764343e-01 -2.1818161010742188e-01 -8.0201119184494019e-02 +8.5532791912555695e-02 +1.2365285307168961e-01 -7.4288614094257355e-02 +2.4353055655956268e-01 +2.4158811569213867e-01 +1.2290992736816406e+00 +3.0012336373329163e-01 +9.2908658087253571e-02 +1.4172053337097168e-01 -3.7198325991630554e-01 +2.7218204736709595e-01 -7.7823422849178314e-02 -9.6637226641178131e-02 +-4.6841818094253540e-01 +1.7005908489227295e-01 -5.4296755790710449e-01 +2.2754096984863281e-01 -1.5194181352853775e-02 -4.9939686059951782e-01 -1.4728440046310425e+00 -9.5285558700561523e-01 -1.8690270371735096e-04 +1.3434211723506451e-02 +8.6971007287502289e-02 -3.0161961913108826e-01 +3.5969528555870056e-01 -4.8469176888465881e-01 -1.3120765984058380e-01 +2.3883371055126190e-01 -4.5547321438789368e-01 +2.6230758428573608e-01 +2.7766993641853333e-01 -3.4189659357070923e-01 -4.4736310839653015e-01 -1.3306137323379517e+00 -1.3333316147327423e-01 -2.4263903498649597e-01 -9.9412500858306885e-02 +4.4701001048088074e-01 -3.5031038522720337e-01 -2.7213785648345947e+00 -2.1192440390586853e-01 -8.4427821636199951e-01 +-3.3448636531829834e-02 +8.9835692197084427e-03 -6.5952339209616184e-03 -5.3455894812941551e-03 +1.6410067677497864e-02 +6.5088388510048389e-03 +6.6855318844318390e-02 +9.3841814668849111e-04 -9.7151109948754311e-03 +4.0276134386658669e-03 -9.5740901306271553e-03 -4.9032061360776424e-03 +7.4591850861907005e-03 -5.8736867504194379e-04 +3.2730080420151353e-04 +7.5981480767950416e-04 +6.9340672343969345e-03 -1.0156388161703944e-03 -5.9065539971925318e-05 +3.3496976830065250e-03 -5.7697235606610775e-03 -1.4045382849872112e-02 +2.2680233232676983e-03 +1.1603409424424171e-02 +3.8276310078799725e-03 -3.0227122828364372e-02 +9.1359596699476242e-03 -2.9817569884471595e-04 -1.2338858505245298e-04 -3.5347316879779100e-03 ++3.1464809179306030e-01 -4.8857383430004120e-02 -2.1987538039684296e-01 -2.6111778616905212e-01 +1.8091994524002075e-01 -1.8209226429462433e-01 +7.4240036308765411e-02 -2.7146503329277039e-01 -3.0029293149709702e-02 -1.1482884734869003e-01 -7.5120501220226288e-02 -1.1809055507183075e-01 +2.6831731200218201e-01 +5.8739922940731049e-02 +1.4310979843139648e-01 +5.0606024265289307e-01 -1.2150792032480240e-01 +2.1435607969760895e-01 +5.5021792650222778e-01 -6.3730580732226372e-03 +2.7586728334426880e-01 -4.5122686028480530e-01 +7.9343646764755249e-02 -2.3562739789485931e-01 -4.5495156198740005e-02 -3.2746738195419312e-01 +1.7539262771606445e-02 -4.2562082409858704e-01 +4.5706573128700256e-01 -1.4218541979789734e-01 ++3.6496931314468384e-01 -2.0537619292736053e-01 +2.5819087028503418e-01 +7.1379441022872925e-01 +6.7814722657203674e-02 +3.7629532814025879e-01 +8.0760020017623901e-01 +1.6809834539890289e-01 +1.7543268622830510e-03 +2.1190480887889862e-01 -1.1153786629438400e-01 +8.6404174566268921e-01 +9.1552518308162689e-02 +9.2499452829360962e-01 -1.4293928444385529e-01 -2.1640296280384064e-01 +3.5960590839385986e-01 -2.9521626234054565e-01 -2.4126714468002319e-01 +1.3970802724361420e-01 -1.4264649152755737e-01 +9.9740475416183472e-01 -5.0068593025207520e-01 +6.7435383796691895e-01 -7.3690897226333618e-01 -1.4745153486728668e-01 +1.5310531482100487e-02 +1.2325330972671509e+00 +4.5714557170867920e-02 +4.6030706167221069e-01 ++9.2886157333850861e-02 -1.1922582238912582e-01 -4.9895313382148743e-01 -1.9985504448413849e-01 -6.1947335489094257e-03 +5.7205015420913696e-01 +7.8876090049743652e-01 +2.5913164019584656e-01 +3.1355875730514526e-01 -3.6606261134147644e-01 +2.5535365939140320e-01 +1.5164694190025330e-01 -1.8307344615459442e-01 +2.6586732268333435e-01 +1.4935271441936493e-01 -3.5986623167991638e-01 +3.0458036065101624e-01 -1.0690507292747498e-01 -3.5260570049285889e-01 +3.0534574389457703e-01 -1.0010030865669250e-01 +8.1395524740219116e-01 -2.1038036048412323e-01 -5.3777214139699936e-02 -4.8050814867019653e-01 +9.1335386037826538e-02 +2.8668665885925293e-01 +1.5066503286361694e+00 -4.2691496014595032e-01 +5.3858321905136108e-01 +-1.4088123105466366e-02 -6.1492775566875935e-03 +2.2522946528624743e-04 +8.8410768657922745e-03 -1.2607325799763203e-02 +5.5126682855188847e-03 +1.9818911328911781e-02 +8.5534679237753153e-04 -4.3872273527085781e-03 -1.3753470964729786e-02 -2.8280979022383690e-03 -2.1627312526106834e-03 +1.1933071538805962e-02 -1.0548267513513565e-02 +9.0234223753213882e-03 +4.5409213635139167e-04 +1.1314689181745052e-02 -1.1020600795745850e-02 -1.0142030077986419e-04 +1.7749603139236569e-03 +2.2967137396335602e-02 -6.7487834021449089e-03 +3.0444024596363306e-03 +1.1188144795596600e-02 -4.2400173842906952e-03 -2.6354703586548567e-03 -2.3605523165315390e-03 +1.0621706023812294e-02 +2.6744541246443987e-03 -1.5434531960636377e-03 +-2.0672981441020966e-01 +8.2184910774230957e-02 +1.7402394115924835e-01 -3.4167635440826416e-01 -5.4828312247991562e-02 -3.7911307066679001e-02 +5.0929081439971924e-01 +3.1625594943761826e-02 -3.5400679707527161e-01 +1.3837477564811707e-01 +1.2615914642810822e-01 +1.0758785530924797e-02 -2.2367040812969208e-01 +4.0047321468591690e-02 -1.8446820974349976e-01 -1.9697667658329010e-01 -6.0867007821798325e-02 +4.4389382004737854e-02 +5.1984351873397827e-01 +7.6414972543716431e-02 +1.9797277636826038e-03 -7.1104906499385834e-02 +2.0175647735595703e+00 +6.9345474243164062e-01 +5.1039654761552811e-02 -3.1801525503396988e-02 -2.4907366931438446e-01 +1.2399928271770477e-01 +4.0570212877355516e-04 -3.4516483545303345e-02 ++1.2012437731027603e-01 +2.9090836644172668e-01 -4.8961594700813293e-01 +2.8930142521858215e-01 +1.5402483940124512e-01 +1.5638862550258636e-01 +1.3026195764541626e+00 +1.0790649056434631e-01 +9.6289940178394318e-02 +1.3474942743778229e-01 -3.8193273544311523e-01 +2.0716269314289093e-01 +1.8367521464824677e-01 -4.2812656611204147e-02 -4.8012584447860718e-03 +1.8278571963310242e-01 -1.8782964348793030e-01 +3.0191963911056519e-01 -3.6237433552742004e-01 -4.5970830321311951e-01 -1.9458299875259399e-01 +1.3021967411041260e+00 -1.8262360990047455e-01 -6.5785437822341919e-01 -2.7622979879379272e-01 -5.7803769595921040e-03 -2.9666721820831299e-01 +1.4283515214920044e+00 +9.6987641882151365e-05 +1.9939766824245453e-01 +-1.7304770648479462e-01 -2.0138850808143616e-01 +2.6076278090476990e-01 +4.4358954764902592e-03 -2.7871212363243103e-01 -1.9396860897541046e-01 -5.0468033552169800e-01 -3.2618436962366104e-02 +4.5539047569036484e-02 +3.5546250641345978e-02 -4.9949545413255692e-02 -8.9463062584400177e-02 -8.0656096339225769e-02 -2.6377370953559875e-01 +1.0322146117687225e-02 -2.1701647341251373e-01 -9.3095647171139717e-03 +1.1115838587284088e-01 -5.3583115339279175e-01 +1.4199742674827576e-01 -6.1459654569625854e-01 -2.5085407495498657e-01 +9.7282171249389648e-02 -2.7957832813262939e-01 +5.2655935287475586e-02 +1.7640849947929382e-01 +3.8416877388954163e-01 -7.9046171903610229e-01 +3.1108902767300606e-02 -1.1552833020687103e-01 +-7.5884438119828701e-03 -6.2733283266425133e-04 +1.2744986452162266e-02 -4.3244853615760803e-02 +1.1466627940535545e-02 +1.5220566652715206e-02 +6.8379670381546021e-02 +9.7049679607152939e-04 +8.3337293472141027e-04 -7.1498188190162182e-03 -1.3829435221850872e-02 -8.1339543685317039e-03 +1.9301829859614372e-02 -1.7021007835865021e-02 -7.5892051681876183e-03 +9.9351792596280575e-04 +1.1096559464931488e-02 -1.0808402672410011e-02 +2.6915257330983877e-04 -3.3895706292241812e-03 +3.9948940277099609e-02 -1.2528277002274990e-02 -1.9773361273109913e-03 +2.9426328837871552e-02 +5.4721562191843987e-03 +5.1665484905242920e-02 +4.6823285520076752e-02 +2.3768465965986252e-02 +1.6680307453498244e-04 -5.3364355117082596e-03 ++2.5939819812774658e+00 +7.1734778583049774e-02 +2.7827683091163635e-01 -2.9755944013595581e-01 -5.6231677532196045e-02 +6.6687077283859253e-01 +5.3504238128662109e+00 +3.4579738974571228e-02 +9.3228295445442200e-02 -2.3696100339293480e-02 +1.0725089162588120e-01 +1.5156050920486450e+00 +1.7533695697784424e-01 +1.4719903469085693e+00 -5.9924624860286713e-02 -2.6424646377563477e-02 +1.4910707473754883e+00 +5.3463923931121826e-01 -2.4285372346639633e-02 +3.6803019046783447e-01 -4.2189949750900269e-01 +1.9239125251770020e+00 +2.6969047263264656e-02 +2.4070377647876740e-01 +1.4325764179229736e+00 -4.3420797586441040e-01 -8.4287077188491821e-02 +1.4134492874145508e+00 +8.2153409719467163e-01 +1.4257271289825439e+00 + + ++4.8718269914388657e-02 +5.1280397921800613e-02 -1.0515274107456207e-01 -5.7251038961112499e-03 +2.5530014187097549e-02 +2.5280538201332092e-01 +-1.7855012789368629e-02 -2.7597448788583279e-03 +1.8528614193201065e-02 +8.4048081189393997e-03 +4.8878509551286697e-03 -1.1067137122154236e-02 +-2.5306174159049988e-01 -4.5542544126510620e-01 -3.0863013863563538e-01 +1.2230248749256134e-01 -8.1740982830524445e-02 -7.6324820518493652e-02 ++1.5791025757789612e-01 -8.2615852355957031e-02 -3.9199030399322510e-01 -1.9035328924655914e-01 -3.2966196537017822e-01 -4.5959230512380600e-02 ++1.6459969803690910e-02 +5.4764654487371445e-03 -1.3240806758403778e-02 +3.6613764241337776e-03 -4.5153261162340641e-03 +1.1981657706201077e-02 ++2.5032436847686768e-01 +5.1723390817642212e-02 -1.1523335427045822e-01 -3.0775105580687523e-02 -1.1508050374686718e-02 -3.3497687429189682e-02 ++1.4080987311899662e-02 +9.5595102757215500e-03 -4.3282680213451385e-02 +4.8981801228364930e-05 +3.4974352456629276e-03 +1.0934604704380035e-01 ++3.1958758831024170e-01 -4.1242790222167969e-01 +1.3835957506671548e-03 +1.9787399470806122e-01 +1.4436250925064087e-01 -4.1318999137729406e-05 +-7.8926365822553635e-03 -2.8869228437542915e-02 -2.7689326088875532e-04 -3.7490714341402054e-02 +2.5341248139739037e-02 +5.5105990031734109e-04 +-8.6267190054059029e-03 +7.9606911167502403e-03 +8.0507192760705948e-03 +2.3239757865667343e-02 -6.9461385719478130e-03 +8.9885730994865298e-04 +-1.4945676084607840e-03 -2.9469688888639212e-03 +7.0819971151649952e-03 +5.3441328927874565e-03 +2.1633794531226158e-02 +5.0463057123124599e-03 ++1.1373555660247803e-01 +1.5678133070468903e-01 -3.2501840591430664e-01 -4.5751754194498062e-02 -1.9446562975645065e-02 +1.3406214118003845e-01 +-4.5630955696105957e-01 +6.9369770586490631e-02 -5.3695875406265259e-01 -4.0482807159423828e-01 -1.6789759695529938e-01 +2.3414686322212219e-01 ++2.8184825554490089e-02 +6.4447857439517975e-02 -1.0469113290309906e-01 -1.0360312880948186e-03 +4.6972345560789108e-02 +2.5881844758987427e-01 ++8.7771462276577950e-03 -2.5288416072726250e-03 -1.0541239753365517e-02 -1.9384928047657013e-02 -9.8785466980189085e-04 -3.1314610969275236e-03 +-2.2836768627166748e-01 +6.8491512537002563e-01 -1.2317761778831482e-02 -3.4806674718856812e-01 -1.8174758553504944e-01 +5.6523042730987072e-03 +-1.0423558205366135e-01 +8.1715196371078491e-02 -1.7303641140460968e-01 +4.0340252220630646e-02 +1.1804384738206863e-01 -8.3986530080437660e-03 +-3.3341920375823975e-01 -1.5960222482681274e-01 +2.2913898527622223e-01 -2.2243657708168030e-01 -4.4431155920028687e-01 +2.0166225731372833e-01 +-1.2163001298904419e-01 +6.0135596990585327e-01 +4.5694648288190365e-03 -8.2382899522781372e-01 -9.0038329362869263e-01 -4.9839001148939133e-03 +-3.1503716111183167e-01 -1.2468872219324112e-01 +1.5327152609825134e-01 +8.3698056638240814e-02 +3.9292898029088974e-02 +3.4749239683151245e-02 +-3.2114735245704651e-01 +2.2985550761222839e-01 -3.4883531928062439e-01 -4.5440492033958435e-01 -3.7103876471519470e-01 -3.3910289406776428e-01 +-1.5751658380031586e-01 -3.1974539160728455e-01 +1.6715502366423607e-02 +3.3349316567182541e-02 -2.0118977129459381e-01 -2.7216572314500809e-02 ++1.1766321258619428e-03 +7.2402417659759521e-02 +9.2022772878408432e-03 -1.8883422017097473e-01 -2.7701869606971741e-01 -2.8931684792041779e-03 +-8.4980977699160576e-03 -1.5197299420833588e-01 -5.1791906356811523e-02 -5.4501686245203018e-02 -3.5542692989110947e-02 -3.5902922973036766e-03 ++6.3685655593872070e-01 +9.4508506357669830e-02 -2.7333220839500427e-01 -5.2644416689872742e-02 -5.5399943143129349e-02 -3.7951543927192688e-01 +-2.9785081744194031e-01 -2.1770578622817993e-01 -2.7142554521560669e-01 -3.5189813375473022e-01 -2.1658948063850403e-01 -9.4562992453575134e-02 +-3.8083154708147049e-02 -2.4195717647671700e-02 -2.1490247920155525e-02 -2.4765911698341370e-01 -6.1096609570086002e-03 +1.3527723029255867e-02 +-5.6719094514846802e-01 -1.8840165436267853e-01 +7.2667652368545532e-01 +3.5026542842388153e-02 +5.1972195506095886e-03 -9.4628494977951050e-01 +-2.2089238464832306e-01 -7.9360559582710266e-02 -4.5122358947992325e-02 -4.8103030771017075e-02 -1.0051660239696503e-01 +1.7232533544301987e-02 ++2.8489297628402710e-01 -2.5881674885749817e-01 -3.7712398171424866e-01 +3.2797567546367645e-02 -1.4035736024379730e-01 +3.1092634797096252e-01 + + +[biases per layer] ++0.0000000000000000e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 ++5.7850396260619164e-03 -5.4800868034362793e-01 +7.0601208135485649e-03 +4.4343668222427368e-01 +9.5969978719949722e-03 -1.8918423652648926e+00 -5.9042316861450672e-03 -7.0072931051254272e-01 -3.7168869376182556e-01 +2.7316311374306679e-02 +9.8313717171549797e-03 -4.3344125151634216e-02 +3.4073707461357117e-01 +6.2903217040002346e-03 +6.4147775992751122e-03 -5.8323685079813004e-03 +6.0578244738280773e-03 -4.7514703869819641e-01 +1.3792721927165985e-01 +5.8732479810714722e-03 +4.2972606420516968e-01 -5.8087822981178761e-03 +6.9927662611007690e-02 +6.5745734609663486e-03 +5.7183597236871719e-03 -2.0756023004651070e-02 +8.2162462174892426e-02 -3.1270492076873779e-01 -4.9186524003744125e-02 +1.0777912102639675e-02 +7.7938484027981758e-03 +4.5307301916182041e-03 -2.4378831684589386e-01 -2.6500603184103966e-02 -3.5185754299163818e+00 -5.5729215964674950e-03 +2.8386363387107849e-01 -5.9977006912231445e-01 -3.2172240316867828e-02 +2.8363862633705139e-01 -7.1090161800384521e-03 +1.9982965663075447e-02 -2.2212673723697662e-01 -4.8118641972541809e-01 -6.8406895734369755e-03 +2.1139304339885712e-01 -3.5522702336311340e-01 -4.7585010528564453e-01 -6.0312664136290550e-03 +3.3170813322067261e-01 +-3.7559503316879272e-01 +5.0203863531351089e-02 -6.7103123664855957e-01 -9.5661211013793945e-01 -3.7905260920524597e-02 -8.4884636104106903e-02 -1.4869323968887329e+00 -1.1877594888210297e-01 +9.2768125236034393e-02 -4.6068467199802399e-02 -4.6287722885608673e-02 +2.1052359044551849e-01 -1.0061993598937988e+00 -2.6615330949425697e-02 +2.9844671487808228e-02 -1.6860149800777435e-01 +4.1984126437455416e-04 -1.1137908697128296e+00 -3.0047450214624405e-02 -1.0990808010101318e+00 -9.0412914752960205e-01 -1.0024057626724243e+00 -5.0296580791473389e-01 -3.8795295357704163e-01 -1.4703199863433838e+00 -1.0035289525985718e+00 -6.4480721950531006e-01 -1.5599024295806885e+00 -1.0307478904724121e-01 +1.0781782865524292e-01 ++1.0000430047512054e-01 +1.5528109669685364e-01 +1.9897127151489258e-01 +1.2465928494930267e-01 +1.2603196501731873e-01 +1.1598975211381912e-01 diff --git a/TestCases/nicf/datadriven/datadriven_nozzle.cfg b/TestCases/nicf/datadriven/datadriven_nozzle.cfg new file mode 100644 index 00000000000..65051295b75 --- /dev/null +++ b/TestCases/nicf/datadriven/datadriven_nozzle.cfg @@ -0,0 +1,127 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Non-ideal compressible fluid flow in a converging- % +% diverging supersonic nozzle using a multi-layer perceptron % +% for thermodynamic state calculations. % +% Author: Evert Bunschoten % +% Institution: Delft University of Technology % +% Date: 2022.10.8 % +% File Version 8.0.0 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +SOLVER= RANS +KIND_TURB_MODEL= SST +MATH_PROBLEM= DIRECT +RESTART_SOL= NO +SYSTEM_MEASUREMENTS= SI +% +% -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% +% +% Mach number (non-dimensional, based on the free-stream values) +MACH_NUMBER= 1E-9 +AOA= 0.0 +SIDESLIP_ANGLE= 0.0 +INIT_OPTION= TD_CONDITIONS +FREESTREAM_OPTION= TEMPERATURE_FS +FREESTREAM_PRESSURE= 250000.0 +% +% Free-stream temperature (288.15 K, 518.67 R by default) +FREESTREAM_TEMPERATURE= 400.0 +FREESTREAM_DENSITY= 2.0 +REF_DIMENSIONALIZATION= DIMENSIONAL + +% ---- DATADRIVEN FLUID MODEL DEFINITION -------% +% +FLUID_MODEL = DATADRIVEN_FLUID +INTERPOLATION_METHOD = MLP +FILENAMES_INTERPOLATOR = (MLP_air.mlp) +DATADRIVEN_NEWTON_RELAXATION = 0.8 + +% --------------------------- VISCOSITY MODEL ---------------------------------% +VISCOSITY_MODEL= CONSTANT_VISCOSITY +MU_CONSTANT= 1.21409E-05 + +% --------------------------- THERMAL CONDUCTIVITY MODEL ----------------------% +CONDUCTIVITY_MODEL= CONSTANT_CONDUCTIVITY +THERMAL_CONDUCTIVITY_CONSTANT= 0.030542828 + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +MARKER_SYM= ( SYMMETRY, WALL ) +MARKER_RIEMANN= ( INFLOW, TOTAL_CONDITIONS_PT, 904388, 542.13, 1.0, 0.0, 0.0, OUTFLOW, STATIC_PRESSURE, 200000.0, 0.0, 0.0, 0.0, 0.0 ) + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +NUM_METHOD_GRAD= GREEN_GAUSS +CFL_NUMBER= 10.0 +CFL_ADAPT= YES +CFL_ADAPT_PARAM= ( 0.1, 2.0, 10.0, 1000.0 ) +MAX_DELTA_TIME= 1E6 + +% ----------- SLOPE LIMITER AND DISSIPATION SENSOR DEFINITION -----------------% +MUSCL_FLOW= NO +SLOPE_LIMITER_FLOW= NONE +MUSCL_TURB= NO + +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ILU_FILL_IN= 0 +LINEAR_SOLVER_ERROR= 1E-6 +LINEAR_SOLVER_ITER= 10 + +% -------------------------- MULTIGRID PARAMETERS -----------------------------% +% +% Multi-grid levels (0 = no multi-grid) +MGLEVEL= 0 + +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +CONV_NUM_METHOD_FLOW= ROE +ENTROPY_FIX_COEFF= 0.1 +TIME_DISCRE_FLOW= EULER_IMPLICIT + +% -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% +CONV_NUM_METHOD_TURB= SCALAR_UPWIND +TIME_DISCRE_TURB= EULER_IMPLICIT +CFL_REDUCTION_TURB= 1.0 + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +% Number of total iterations +ITER= 10 +CONV_RESIDUAL_MINVAL= -24 +CONV_STARTITER= 10 + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +% Mesh input file +MESH_FILENAME= ../coolprop/coolprop_nozzle.su2 +% +% Mesh input file format (SU2, CGNS) +MESH_FORMAT= SU2 +% +% Mesh output file +MESH_OUT_FILENAME= mesh_out.su2 +% +% Restart flow input file +SOLUTION_FILENAME= solution_flow.dat +TABULAR_FORMAT= CSV +% +% Output file convergence history (w/o extension) +CONV_FILENAME= history +% +% Output file restart flow +RESTART_FILENAME= restart_flow.dat +% +% Output file flow (w/o extension) variables +VOLUME_FILENAME= flow +% +% Output file surface flow coefficient (w/o extension) +SURFACE_FILENAME= surface_flow +% +% Writing solution file frequency +OUTPUT_WRT_FREQ= 500 +% +% Screen output +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY, RMS_TKE, RMS_DISSIPATION, LIFT, DRAG) diff --git a/TestCases/nicf/edge/edge_PPR.cfg b/TestCases/nicf/edge/edge_PPR.cfg index 1da2049b479..06a3c9c7193 100644 --- a/TestCases/nicf/edge/edge_PPR.cfg +++ b/TestCases/nicf/edge/edge_PPR.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2012.09.29 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nicf/edge/edge_VW.cfg b/TestCases/nicf/edge/edge_VW.cfg index 48513627b34..91e8803278a 100644 --- a/TestCases/nicf/edge/edge_VW.cfg +++ b/TestCases/nicf/edge/edge_VW.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2012.09.29 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nonequilibrium/invwedge/invwedge_ausm.cfg b/TestCases/nonequilibrium/invwedge/invwedge_ausm.cfg index 2a549afcf4e..fcf606ccdf9 100644 --- a/TestCases/nonequilibrium/invwedge/invwedge_ausm.cfg +++ b/TestCases/nonequilibrium/invwedge/invwedge_ausm.cfg @@ -5,7 +5,7 @@ % Author: C. Garbacz % % Institution: Strathclyde University % % Date: 2020.11.01 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nonequilibrium/invwedge/invwedge_ausmplusup2.cfg b/TestCases/nonequilibrium/invwedge/invwedge_ausmplusup2.cfg index d0c09a92926..48399a94fab 100644 --- a/TestCases/nonequilibrium/invwedge/invwedge_ausmplusup2.cfg +++ b/TestCases/nonequilibrium/invwedge/invwedge_ausmplusup2.cfg @@ -2,7 +2,7 @@ % % % SU2 configuration file % % Case description: Mach 5 inviscid flow over a 10deg wedge- AUSM+-Up2 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nonequilibrium/invwedge/invwedge_lax.cfg b/TestCases/nonequilibrium/invwedge/invwedge_lax.cfg index 0ca7867ae3d..2c5627fc9a2 100644 --- a/TestCases/nonequilibrium/invwedge/invwedge_lax.cfg +++ b/TestCases/nonequilibrium/invwedge/invwedge_lax.cfg @@ -2,7 +2,7 @@ % % % SU2 configuration file % % Case description: Mach 5 inviscid flow over a 10deg wedge-LAX % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -47,9 +47,6 @@ LINEAR_SOLVER_ITER= 5 % -----------------------------------------------------------------------% % CONV_NUM_METHOD_FLOW= LAX-FRIEDRICH -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN -VENKAT_LIMITER_COEFF= 0.05 TIME_DISCRE_FLOW= EULER_IMPLICIT % --------------------------- CONVERGENCE PARAMETERS --------------------------% @@ -63,11 +60,11 @@ CONV_CAUCHY_EPS= 1E-10 % MESH_FILENAME= invwedge.su2 MESH_FORMAT= SU2 -SOLUTION_FILENAME= restart_flow.dat -TABULAR_FORMAT= TECPLOT +SOLUTION_FILENAME= restart_flow.dat +TABULAR_FORMAT= TECPLOT CONV_FILENAME= convergence RESTART_FILENAME= restart_flow.dat VOLUME_FILENAME= soln_volume -SURFACE_FILENAME= soln_surface +SURFACE_FILENAME= soln_surface OUTPUT_WRT_FREQ= 100 OUTPUT_FILES= (RESTART_ASCII, PARAVIEW_ASCII) diff --git a/TestCases/nonequilibrium/invwedge/invwedge_msw.cfg b/TestCases/nonequilibrium/invwedge/invwedge_msw.cfg index 73585488a5f..39a7e051035 100644 --- a/TestCases/nonequilibrium/invwedge/invwedge_msw.cfg +++ b/TestCases/nonequilibrium/invwedge/invwedge_msw.cfg @@ -2,7 +2,7 @@ % % % SU2 configuration file % % Case description: Mach 5 inviscid flow over a 10deg wedge-MSW % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nonequilibrium/invwedge/invwedge_roe.cfg b/TestCases/nonequilibrium/invwedge/invwedge_roe.cfg index 6f871316deb..7264f767422 100644 --- a/TestCases/nonequilibrium/invwedge/invwedge_roe.cfg +++ b/TestCases/nonequilibrium/invwedge/invwedge_roe.cfg @@ -2,7 +2,7 @@ % % % SU2 configuration file % % Case description: Mach 5 inviscid flow over a 10deg wedge-ROE % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nonequilibrium/invwedge/invwedge_ss_inlet.cfg b/TestCases/nonequilibrium/invwedge/invwedge_ss_inlet.cfg index 44efe8a4c61..1d9d94eb0c1 100644 --- a/TestCases/nonequilibrium/invwedge/invwedge_ss_inlet.cfg +++ b/TestCases/nonequilibrium/invwedge/invwedge_ss_inlet.cfg @@ -5,7 +5,7 @@ % Author: J. Needels % % Institution: Stanford University % % Date: 2022.1.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nonequilibrium/thermalbath/finitechemistry/thermalbath.cfg b/TestCases/nonequilibrium/thermalbath/finitechemistry/thermalbath.cfg index 171b4ba1140..10d2be9ffa2 100644 --- a/TestCases/nonequilibrium/thermalbath/finitechemistry/thermalbath.cfg +++ b/TestCases/nonequilibrium/thermalbath/finitechemistry/thermalbath.cfg @@ -7,7 +7,7 @@ % Author: C. Garbacz % % Institution: Strathclyde University % % Date: 2019.04.10 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nonequilibrium/thermalbath/frozen/thermalbath_frozen.cfg b/TestCases/nonequilibrium/thermalbath/frozen/thermalbath_frozen.cfg index c2f0cf8e9aa..65e1ae94997 100644 --- a/TestCases/nonequilibrium/thermalbath/frozen/thermalbath_frozen.cfg +++ b/TestCases/nonequilibrium/thermalbath/frozen/thermalbath_frozen.cfg @@ -6,7 +6,7 @@ % Author: C. Garbacz % % Institution: Strathclyde University % % Date: 2019.04.10 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nonequilibrium/visc_cylinder/cyl_ion_gy.cfg b/TestCases/nonequilibrium/visc_cylinder/cyl_ion_gy.cfg new file mode 100644 index 00000000000..80adfcc7941 --- /dev/null +++ b/TestCases/nonequilibrium/visc_cylinder/cyl_ion_gy.cfg @@ -0,0 +1,74 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: Mach 15 viscous, ionized flow over a cylinder % +% using the Gupta-Yos transport model. % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= NEMO_NAVIER_STOKES +MATH_PROBLEM= DIRECT +RESTART_SOL= YES +AXISYMMETRIC= YES + +% ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% +% +MACH_NUMBER=15 +AOA= 0.0 +SIDESLIP_ANGLE= 0.0 +FREESTREAM_PRESSURE= 21.96 +FREESTREAM_TEMPERATURE= 246.87 +FREESTREAM_TEMPERATURE_VE= 246.87 +INIT_OPTION=TD_CONDITIONS + +% ---- NONEQUILIBRIUM GAS, IDEAL GAS, POLYTROPIC, VAN DER WAALS AND PENG ROBINSON CONSTANTS -------% +% +FLUID_MODEL= SU2_NONEQ +GAS_MODEL= AIR-7 +GAS_COMPOSITION= (5E-13, 0.767, 0.23, 0.001, 0.001, 0.000999999999, 5E-13) +TRANSPORT_COEFF_MODEL= GUPTA-YOS + +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_ISOTHERMAL=(wall, 300.0) +MARKER_FAR= (far, exit) +MARKER_SYM= (symm) +MARKER_PLOTTING= (wall) +MARKER_MONITORING= (wall) + +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +CFL_NUMBER= 3.0 +ITER= 11 +LINEAR_SOLVER= BCGSTAB +LINEAR_SOLVER_ERROR= 1E-6 +LINEAR_SOLVER_ITER= 5 + +% -----------------------------------------------------------------------% +% +CONV_NUM_METHOD_FLOW= AUSM +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW= VENKATAKRISHNAN +VENKAT_LIMITER_COEFF= 0.05 +TIME_DISCRE_FLOW= EULER_IMPLICIT + +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_RESIDUAL_MINVAL= -10 +CONV_STARTITER= 10 + +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +MESH_FILENAME= visc_cyl.su2 +MESH_FORMAT= SU2 +SOLUTION_FILENAME= restart_flow_gy.dat +RESTART_FILENAME= restart_flow_gy.dat +TABULAR_FORMAT= TECPLOT +CONV_FILENAME= convergence +VOLUME_FILENAME= soln_volume +SURFACE_FILENAME= soln_surface +OUTPUT_WRT_FREQ= 2500 +SCREEN_OUTPUT= (INNER_ITER, RMS_DENSITY_0, RMS_DENSITY_1, RMS_DENSITY_2, RMS_DENSITY_3, RMS_DENSITY_4, RMS_DENSITY_5, RMS_DENSITY_6, RMS_ENERGY, RMS_ENERGY_VE, LIFT, DRAG, TOTAL_HEATFLUX \ No newline at end of file diff --git a/TestCases/nonequilibrium/viscous/axi_visccone.cfg b/TestCases/nonequilibrium/visc_wedge/axi_visccone.cfg similarity index 97% rename from TestCases/nonequilibrium/viscous/axi_visccone.cfg rename to TestCases/nonequilibrium/visc_wedge/axi_visccone.cfg index e9ea9d6d366..9487af19964 100644 --- a/TestCases/nonequilibrium/viscous/axi_visccone.cfg +++ b/TestCases/nonequilibrium/visc_wedge/axi_visccone.cfg @@ -4,7 +4,7 @@ % Case description: Mach 5 viscous flow over a 10deg axisymmetric cone % % Author: C. Garbacz % % Institution: Strathclyde University % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nonequilibrium/viscous/partial_cat.cfg b/TestCases/nonequilibrium/visc_wedge/partial_cat.cfg similarity index 97% rename from TestCases/nonequilibrium/viscous/partial_cat.cfg rename to TestCases/nonequilibrium/visc_wedge/partial_cat.cfg index a9677444f83..f139137c5ef 100644 --- a/TestCases/nonequilibrium/viscous/partial_cat.cfg +++ b/TestCases/nonequilibrium/visc_wedge/partial_cat.cfg @@ -5,7 +5,7 @@ % catalytic walls - gamma model, effeciency = 0.2 % % Author: J. Needels % % Institution: Stanford University % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nonequilibrium/viscous/super_cat.cfg b/TestCases/nonequilibrium/visc_wedge/super_cat.cfg similarity index 97% rename from TestCases/nonequilibrium/viscous/super_cat.cfg rename to TestCases/nonequilibrium/visc_wedge/super_cat.cfg index cde3c619d0b..a169763992c 100644 --- a/TestCases/nonequilibrium/viscous/super_cat.cfg +++ b/TestCases/nonequilibrium/visc_wedge/super_cat.cfg @@ -5,7 +5,7 @@ % catalytic walls - gamma model, effeciency = 0.2 % % Author: J. Needels % % Institution: Stanford University % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/nonequilibrium/viscwedge_mpp/viscwedge_mpp.cfg b/TestCases/nonequilibrium/viscwedge_mpp/viscwedge_mpp.cfg index fb0b3169eb9..0e8a2c5e2c6 100644 --- a/TestCases/nonequilibrium/viscwedge_mpp/viscwedge_mpp.cfg +++ b/TestCases/nonequilibrium/viscwedge_mpp/viscwedge_mpp.cfg @@ -5,7 +5,7 @@ % Author: C. Garbacz % % Institution: Strathclyde University % % Date: 2020.11.01 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/equivalentarea_naca64206/NACA64206.cfg b/TestCases/optimization_euler/equivalentarea_naca64206/NACA64206.cfg index 0f61123ecba..429ea9fa6ea 100644 --- a/TestCases/optimization_euler/equivalentarea_naca64206/NACA64206.cfg +++ b/TestCases/optimization_euler/equivalentarea_naca64206/NACA64206.cfg @@ -5,7 +5,7 @@ % Author: Yuki Utsumi % % Institution: Individual % % Date: 2021.08.07 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg index d00a1493bc2..96bdf7ba4bf 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_2surf_1obj.cfg @@ -7,7 +7,7 @@ % Author: H.L. Kline, modified from inviscid wedge by Thomas D. Economon % % Institution: Stanford University % % Date: 2018.01.07 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg index a87cfdbdc3a..97dc0cc3f0d 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj.cfg @@ -8,7 +8,7 @@ % Author: H.L. Kline, modified from inviscid wedge by Thomas D. Economon % % Institution: Stanford University % % Date: 2018.01.07 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg index 07f45eb5b0f..af75dd2f1e6 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_1surf.cfg @@ -8,7 +8,7 @@ % Author: H.L. Kline, modified from inviscid wedge by Thomas D. Economon % % Institution: Stanford University % % Date: 2018.01.07 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg index 462d3935872..d36e9cdca3e 100644 --- a/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg +++ b/TestCases/optimization_euler/multiobjective_wedge/inv_wedge_ROE_multiobj_combo.cfg @@ -2,15 +2,15 @@ % % % SU2 configuration file % % Case description: Multi-objective optimization for outflow averaged pressure % -% and a quadratic penalty function on a surface drag constraint, using % -% combined evaluation of the gradient rather than separate gradient % +% and a quadratic penalty function on a surface drag constraint, using % +% combined evaluation of the gradient rather than separate gradient % % evaluations for each function. % % For the definition of the penalty function see 'obj_p' method defined in % % SU2/SU2_PY/SU2/eval/designs.py % % Author: H.L. Kline, modified from inviscid wedge by Thomas D. Economon % % Institution: Stanford University % % Date: 2018.01.07 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/multipoint_naca0012/inv_NACA0012_multipoint.cfg b/TestCases/optimization_euler/multipoint_naca0012/inv_NACA0012_multipoint.cfg index 0774fc5c5e3..1cd29ecab6e 100644 --- a/TestCases/optimization_euler/multipoint_naca0012/inv_NACA0012_multipoint.cfg +++ b/TestCases/optimization_euler/multipoint_naca0012/inv_NACA0012_multipoint.cfg @@ -5,7 +5,7 @@ % Author: Indiana Stokes % % Institution: % % Date: 2017.07.03 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg b/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg index d8aab437132..b48aa059677 100644 --- a/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg +++ b/TestCases/optimization_euler/pitching_naca64a010/pitching_NACA64A010.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.02 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -41,7 +41,7 @@ PITCHING_OMEGA_Z= 106.69842 PITCHING_AMPL_X= 0.0 PITCHING_AMPL_Y= 0.0 PITCHING_AMPL_Z= 1.01 - + % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % MACH_NUMBER= 0.796 @@ -97,8 +97,6 @@ MG_DAMP_PROLONGATION= 0.9 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN VENKAT_LIMITER_COEFF= 0.1 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -107,8 +105,6 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % OBJECTIVE_FUNCTION= DRAG CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_JST_SENSOR_COEFF= ( 0.0, 0.02 ) CFL_REDUCTION_ADJFLOW= 0.5 TIME_DISCRE_ADJFLOW= EULER_IMPLICIT diff --git a/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg b/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg index 5ef926bb5d8..5bc53860c7c 100644 --- a/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg +++ b/TestCases/optimization_euler/pitching_oneram6/pitching_ONERAM6.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 09.07.2011 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -90,8 +90,6 @@ MG_DAMP_PROLONGATION= 0.9 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -99,8 +97,6 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % ---------------- ADJOINT-FLOW NUMERICAL METHOD DEFINITION -------------------% % CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_SHARP_LIMITER_COEFF= 3.0 ADJ_JST_SENSOR_COEFF= ( 0.5, 0.02 ) CFL_REDUCTION_ADJFLOW= 0.25 @@ -144,7 +140,7 @@ OUTPUT_WRT_FREQ= 1 % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % -DV_KIND= FFD_SETTING +DV_KIND= FFD_SETTING DV_MARKER= ( UPPER_SIDE, LOWER_SIDE, TIP ) DV_PARAM= ( 0, 1, 0, 0, 0.0, 0.0, 1.0 ) DV_VALUE= 0.0 diff --git a/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg b/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg index 4464ff2da1c..e1e8aa5de38 100644 --- a/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg +++ b/TestCases/optimization_euler/rotating_naca0012/rotating_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.03.06 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/steady_inverse_design/inv_NACA0012.cfg b/TestCases/optimization_euler/steady_inverse_design/inv_NACA0012.cfg index 1095bbd5948..13019e42b2c 100644 --- a/TestCases/optimization_euler/steady_inverse_design/inv_NACA0012.cfg +++ b/TestCases/optimization_euler/steady_inverse_design/inv_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -74,23 +74,19 @@ MG_DAMP_PROLONGATION= 1.0 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT % ---------------- ADJOINT-FLOW NUMERICAL METHOD DEFINITION -------------------% % CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_JST_SENSOR_COEFF= ( 0.5, 0.02 ) CFL_REDUCTION_ADJFLOW= 0.5 TIME_DISCRE_ADJFLOW= EULER_IMPLICIT % ----------------------- DESIGN VARIABLE PARAMETERS --------------------------% % -DV_KIND= HICKS_HENNE +DV_KIND= HICKS_HENNE DV_MARKER= ( airfoil ) DV_PARAM= ( 1, 0.5 ) DV_VALUE= 0.01 diff --git a/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_adv.cfg b/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_adv.cfg index 78250835802..ab5620cc9eb 100644 --- a/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_adv.cfg +++ b/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_adv.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 2013.09.29 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_basic.cfg b/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_basic.cfg index 933786afaa1..8d733763b2e 100644 --- a/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_basic.cfg +++ b/TestCases/optimization_euler/steady_naca0012/inv_NACA0012_basic.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 2013.09.29 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_adv.cfg b/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_adv.cfg index a0c55da8aed..04c72351cae 100644 --- a/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_adv.cfg +++ b/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_adv.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios, Heather Kline % % Institution: Stanford University % % Date: 01.17.2017 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_basic.cfg b/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_basic.cfg index b2dd3ee5e0f..0a7ac7a1953 100644 --- a/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_basic.cfg +++ b/TestCases/optimization_euler/steady_oneram6/inv_ONERAM6_basic.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios, Heather Kline % % Institution: Stanford University % % Date: 01.17.2017 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_rans/naca0012/naca0012.cfg b/TestCases/optimization_rans/naca0012/naca0012.cfg index ffa7267f40c..e9304f8f4ee 100644 --- a/TestCases/optimization_rans/naca0012/naca0012.cfg +++ b/TestCases/optimization_rans/naca0012/naca0012.cfg @@ -5,7 +5,7 @@ % Author: Steffen Schotthöfer % % Institution: TU Kaiserslautern % % Date: Mar 16, 2017 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/optimization_rans/pitching_naca64a010/turb_NACA64A010.cfg b/TestCases/optimization_rans/pitching_naca64a010/turb_NACA64A010.cfg index 854a28c9699..389b2793a40 100644 --- a/TestCases/optimization_rans/pitching_naca64a010/turb_NACA64A010.cfg +++ b/TestCases/optimization_rans/pitching_naca64a010/turb_NACA64A010.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.02 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -32,7 +32,7 @@ MACH_MOTION= 0.796 MOTION_ORIGIN= 0.248 0.0 0.0 PITCHING_OMEGA= 0.0 0.0 106.69842 PITCHING_AMPL= 0.0 0.0 1.01 - + % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % MACH_NUMBER= 0.796 @@ -89,8 +89,6 @@ MG_DAMP_PROLONGATION= 0.7 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -106,8 +104,6 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % OBJECTIVE_FUNCTION= DRAG CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_SHARP_LIMITER_COEFF= 3.0 ADJ_JST_SENSOR_COEFF= ( 0.0, 0.01 ) CFL_REDUCTION_ADJFLOW= 0.9 diff --git a/TestCases/optimization_rans/pitching_oneram6/turb_ONERAM6.cfg b/TestCases/optimization_rans/pitching_oneram6/turb_ONERAM6.cfg index d943deff183..1ef6403d4ec 100644 --- a/TestCases/optimization_rans/pitching_oneram6/turb_ONERAM6.cfg +++ b/TestCases/optimization_rans/pitching_oneram6/turb_ONERAM6.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.02 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -88,8 +88,6 @@ MG_DAMP_PROLONGATION= 0.7 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -105,8 +103,6 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % OBJECTIVE_FUNCTION= DRAG CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_SHARP_LIMITER_COEFF= 3.0 ADJ_JST_SENSOR_COEFF= ( 0.0, 0.02 ) TIME_DISCRE_ADJFLOW= EULER_IMPLICIT diff --git a/TestCases/optimization_rans/steady_oneram6/turb_ONERAM6.cfg b/TestCases/optimization_rans/steady_oneram6/turb_ONERAM6.cfg index 259e678ec14..3c625996b40 100644 --- a/TestCases/optimization_rans/steady_oneram6/turb_ONERAM6.cfg +++ b/TestCases/optimization_rans/steady_oneram6/turb_ONERAM6.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 2011.11.02 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -70,8 +70,6 @@ MG_DAMP_PROLONGATION= 0.7 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT diff --git a/TestCases/optimization_rans/steady_rae2822/turb_SA_RAE2822.cfg b/TestCases/optimization_rans/steady_rae2822/turb_SA_RAE2822.cfg index 3e3baaa6fc9..57cd64ad136 100644 --- a/TestCases/optimization_rans/steady_rae2822/turb_SA_RAE2822.cfg +++ b/TestCases/optimization_rans/steady_rae2822/turb_SA_RAE2822.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/parallel_regression.py b/TestCases/parallel_regression.py index e0fad895d88..41eb39ba981 100644 --- a/TestCases/parallel_regression.py +++ b/TestCases/parallel_regression.py @@ -3,7 +3,7 @@ ## \file parallel_regression.py # \brief Python script for automated regression testing of SU2 examples # \author A. Aranake, A. Campos, T. Economon, T. Lukaczyk, S. Padron -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -38,6 +38,37 @@ def main(): test_list = [] + ####################### + ### Flamelet solver ### + ####################### + + # 2D planar laminar premixed methane flame on isothermal burner (restart) + cfd_flamelet_ch4 = TestCase('cfd_flamelet_ch4') + cfd_flamelet_ch4.cfg_dir = "flamelet/01_laminar_premixed_ch4_flame_cfd" + cfd_flamelet_ch4.cfg_file = "lam_prem_ch4_cfd.cfg" + cfd_flamelet_ch4.test_iter = 10 + cfd_flamelet_ch4.test_vals = [-15.313265, -15.180884, -15.291808, -8.488238, -15.010141, -15.920950] + cfd_flamelet_ch4.new_output = True + test_list.append(cfd_flamelet_ch4) + + # axisymmetric 2D planar laminar premixed methane flame on isothermal burner (restart) + cfd_flamelet_ch4_axi = TestCase('cfd_flamelet_ch4_axi') + cfd_flamelet_ch4_axi.cfg_dir = "flamelet/05_laminar_premixed_ch4_flame_cfd_axi" + cfd_flamelet_ch4_axi.cfg_file = "lam_prem_ch4_cfd_axi.cfg" + cfd_flamelet_ch4_axi.test_iter = 10 + cfd_flamelet_ch4_axi.test_vals = [-11.054149, -12.276393, -11.299388, -13.877670, -6.291548] + cfd_flamelet_ch4_axi.new_output = True + test_list.append(cfd_flamelet_ch4_axi) + + # 2D planar laminar partially premixed flame on isothermal burner and heat exchanger (restart) + cfd_flamelet_ch4_partial_premix = TestCase('cfd_flamelet_ch4_partial_premix') + cfd_flamelet_ch4_partial_premix.cfg_dir = "flamelet/06_laminar_partial_premixed_ch4_flame_cfd" + cfd_flamelet_ch4_partial_premix.cfg_file = "lam_partial_prem_ch4_cfd.cfg" + cfd_flamelet_ch4_partial_premix.test_iter = 10 + cfd_flamelet_ch4_partial_premix.test_vals = [-10.072805, -11.301138, -4.658971, -13.158224, -11.087511] + cfd_flamelet_ch4_partial_premix.new_output = True + test_list.append(cfd_flamelet_ch4_partial_premix) + ######################### ## NEMO solver ### ######################### @@ -48,7 +79,6 @@ def main(): thermalbath.cfg_file = "thermalbath.cfg" thermalbath.test_iter = 10 thermalbath.test_vals = [0.945997, 0.945997, -12.039262, -12.171767, -32.000000, 10.013239] - thermalbath.new_output = True test_list.append(thermalbath) # Adiabatic thermal bath @@ -58,7 +88,6 @@ def main(): ionized.test_iter = 10 ionized.test_vals = [-29.806157, -11.130797, -11.337264, -17.235059, -17.578729, -15.190274, -25.013626, -32.000000, -5.174887, 0.000000, 0.000000] ionized.test_vals_aarch64 = [-29.816386, -10.729986, -11.720016, -17.484469, -18.237891, -15.241605, -24.956918, -32.000000, -5.727244, 0.000000, 0.000000] - ionized.new_output = True test_list.append(ionized) # Adiabatic frozen thermal bath @@ -67,7 +96,6 @@ def main(): thermalbath_frozen.cfg_file = "thermalbath_frozen.cfg" thermalbath_frozen.test_iter = 10 thermalbath_frozen.test_vals = [-32.000000, -32.000000, -11.962477, -11.962477, -32.000000, 10.013545] - thermalbath_frozen.new_output = True test_list.append(thermalbath_frozen) # Inviscid single wedge, ausm, implicit @@ -76,8 +104,7 @@ def main(): invwedge_a.cfg_file = "invwedge_ausm.cfg" invwedge_a.test_iter = 10 invwedge_a.test_vals = [-1.042842, -1.567605, -18.301264, -18.628631, -18.574668, 2.275192, 1.879772, 5.319421, 0.873699] - invwedge_a.test_vals_aarch64 = [-1.042842, -1.567605, -18.301264, -18.628631, -18.574668, 2.275192, 1.879772, 5.319421, 0.873699] - invwedge_a.new_output = True + invwedge_a.test_vals_aarch64 = [-1.042842, -1.567605, -18.301374, -18.628734, -18.574780, 2.275192, 1.879772, 5.319421, 0.873699] test_list.append(invwedge_a) # Inviscid single wedge, ausm+-up2, implicit @@ -87,7 +114,6 @@ def main(): invwedge_ap2.test_iter = 10 invwedge_ap2.test_vals = [-0.952589, -1.477352, -16.736014, -17.064021, -17.009120, 2.387086, 1.287286, 5.403046, 0.956402] invwedge_ap2.test_vals_aarch64 = [-0.952589, -1.477352, -16.736014, -17.064021, -17.009120, 2.387086, 1.287286, 5.403046, 0.956402] - invwedge_ap2.new_output = True test_list.append(invwedge_ap2) # Inviscid single wedge, msw, implicit @@ -96,8 +122,7 @@ def main(): invwedge_msw.cfg_file = "invwedge_msw.cfg" invwedge_msw.test_iter = 10 invwedge_msw.test_vals = [-1.165957, -1.690720, -18.298756, -18.626164, -18.572159, 2.151638, 1.721236, 5.193813, 0.751584] - invwedge_msw.test_vals_aarch64 = [-1.165957, -1.690720, -18.298756, -18.626164, -18.572159, 2.151638, 1.721236, 5.193813, 0.751584] - invwedge_msw.new_output = True + invwedge_msw.test_vals_aarch64 = [-1.165957, -1.690720, -18.301301, -18.628685, -18.574704, 2.151638, 1.721236, 5.193813, 0.751584] test_list.append(invwedge_msw) # Inviscid single wedge, roe, implicit @@ -106,8 +131,7 @@ def main(): invwedge_roe.cfg_file = "invwedge_roe.cfg" invwedge_roe.test_iter = 10 invwedge_roe.test_vals = [-1.038582, -1.563344, -18.300307, -18.627706, -18.573706, 2.278987, 1.861307, 5.323753, 0.874900] - invwedge_roe.test_vals_aarch64 = [-1.038582, -1.563344, -18.300307, -18.627706, -18.573706, 2.278987, 1.861307, 5.323753, 0.874900] - invwedge_roe.new_output = True + invwedge_roe.test_vals_aarch64 = [-1.038582, -1.563344, -18.299879, -18.627263, -18.573276, 2.278987, 1.861307, 5.323753, 0.874900] test_list.append(invwedge_roe) # Inviscid single wedge, lax, implicit @@ -117,7 +141,6 @@ def main(): invwedge_lax.test_iter = 10 invwedge_lax.test_vals = [-1.075662, -1.600425, -32.000000, -32.000000, -24.972431, 2.252952, 1.725158, 5.282140, 0.848823] invwedge_lax.test_vals_aarch64 = [-1.075662, -1.600425, -32.000000, -32.000000, -24.972431, 2.252952, 1.725158, 5.282140, 0.848823] - invwedge_lax.new_output = True test_list.append(invwedge_lax) # Inviscid single wedge, implicit, AUSM+M scheme @@ -125,9 +148,8 @@ def main(): invwedge_ausm_m.cfg_dir = "nonequilibrium/invwedge" invwedge_ausm_m.cfg_file = "invwedge_am.cfg" invwedge_ausm_m.test_iter = 10 - invwedge_ausm_m.test_vals = [-1.055083, -1.579845, -16.739725, -17.063618, -17.012831, 2.265430, 1.797602, 5.302740, 0.85654] - invwedge_ausm_m.test_vals_aarch64 = [-1.055083, -1.579845, -16.739725, -17.063618, -17.012831, 2.265430, 1.797602, 5.302740, 0.85654] - invwedge_ausm_m.new_output = True + invwedge_ausm_m.test_vals = [-1.055083, -1.579845, -16.739725, -17.063618, -17.012831, 2.265430, 1.797602, 5.302740, 0.856548] + invwedge_ausm_m.test_vals_aarch64 = [-1.055079, -1.579842, -16.739725, -17.063618, -17.012831, 2.265433, 1.797600, 5.302743, 0.856551] test_list.append(invwedge_ausm_m) # Inviscid single wedge, implicit, NEMO supersonic inlet @@ -137,17 +159,15 @@ def main(): invwedge_ss_inlet.test_iter = 10 invwedge_ss_inlet.test_vals = [-1.042718, -1.567481, -18.250175, -18.579516, -18.523248, 2.275305, 1.880068, 5.319548, 0.873821] invwedge_ss_inlet.test_vals_aarch64 = [-1.042718, -1.567481, -18.250175, -18.579516, -18.523248, 2.275305, 1.880068, 5.319548, 0.873821] - invwedge_ss_inlet.new_output = True test_list.append(invwedge_ss_inlet) # Viscous single cone - axisymmetric visc_cone = TestCase('visc_cone') - visc_cone.cfg_dir = "nonequilibrium/viscous" + visc_cone.cfg_dir = "nonequilibrium/visc_wedge" visc_cone.cfg_file = "axi_visccone.cfg" visc_cone.test_iter = 10 - visc_cone.test_vals = [-5.222212, -5.746462, -20.569425, -20.633786, -20.547642, 1.255865, -3.208363, -0.016006, 0.093455, 32633.000000] - visc_cone.test_vals_aarch64 = [-5.222212, -5.746462, -20.569425, -20.633786, -20.547642, 1.255865, -3.208363, -0.016006, 0.093455, 32633.000000] - visc_cone.new_output = True + visc_cone.test_vals = [-5.222212, -5.746462, -20.559802, -20.510196, -20.439814, 1.255865, -3.208363, -0.016006, 0.093455, 32633.000000] + visc_cone.test_vals_aarch64 = [-5.222267, -5.746522, -20.559799, -20.510195, -20.440311, 1.255761, -3.208360, -0.016014, 0.093462, 32634.000000] test_list.append(visc_cone) # Viscous single wedge with Mutation++ @@ -156,33 +176,32 @@ def main(): #viscwedge_mpp.cfg_file = "viscwedge_mpp.cfg" #viscwedge_mpp.test_iter = 10 #viscwedge_mpp.test_vals = [-20.608474, -20.586446,-20.707524, -5.171304,-5.696067,-1.548350,-2.071211,2.231054,-2.545494] - #viscwedge_mpp.new_output = True #test_list.append(viscwedge_mpp) # Viscous single wedge - super catalytic walls super_cat = TestCase('super_cat') - super_cat.cfg_dir = "nonequilibrium/viscous" + super_cat.cfg_dir = "nonequilibrium/visc_wedge" super_cat.cfg_file = "super_cat.cfg" super_cat.test_iter = 10 - super_cat.test_vals = [-5.232590, -5.757884, -20.727046, -20.748136, -20.564044, 1.246889, -3.205235, -0.028406, 0.250857, 3.2459e+04] - super_cat.su2_exec = "mpirun -n 2 SU2_CFD" - super_cat.timeout = 1600 - super_cat.new_output = True - super_cat.tol = 0.00001 + super_cat.test_vals = [-5.232590, -5.757884, -20.641547, -20.640244, -20.539243, 1.246889, -3.205235, -0.028406, 0.250857, 32459.000000] test_list.append(super_cat) # Viscous single wedge - partially catalytic walls partial_cat = TestCase('partial_cat') - partial_cat.cfg_dir = "nonequilibrium/viscous" + partial_cat.cfg_dir = "nonequilibrium/visc_wedge" partial_cat.cfg_file = "partial_cat.cfg" partial_cat.test_iter = 10 - partial_cat.test_vals = [-5.210300, -5.735063, -20.880374, -20.825890, -23.475263, 1.806281, -2.813924, -0.078469, 0.496017, 2.9021e+04] - partial_cat.su2_exec = "mpirun -n 2 SU2_CFD" - partial_cat.timeout = 1600 - partial_cat.new_output = True - partial_cat.tol = 0.00001 + partial_cat.test_vals = [-5.210300, -5.735063, -20.880374, -20.825890, -23.475263, 1.806281, -2.813924, -0.078469, 0.496017, 29021.000000] test_list.append(partial_cat) + # Viscous cylinder, ionization, Gupta-Yos + ion_gy = TestCase('ion_gy') + ion_gy.cfg_dir = "nonequilibrium/visc_cylinder" + ion_gy.cfg_file = "cyl_ion_gy.cfg" + ion_gy.test_iter = 10 + ion_gy.test_vals = [-11.629873, -4.165563, -4.702662, -4.950351, -5.146155, -4.993878, -6.893332, 5.990109, 5.990004, -0.014849, 0.000000, 90090.000000] + test_list.append(ion_gy) + ########################## ### Compressible Euler ### ########################## @@ -235,8 +254,10 @@ def main(): polar_naca0012.polar = True polar_naca0012.test_iter = 10 polar_naca0012.test_vals = [-1.217981, 4.256386, 0.009084, 0.016823] - polar_naca0012.test_vals_aarch64 = [-2.936433, 2.478784, 0.005113, 0.008684] + polar_naca0012.test_vals_aarch64 = [-1.718925, 3.711429, 0.009217, 0.007784] polar_naca0012.command = TestCase.Command(exec = "compute_polar.py", param = "-i 11") + # flaky test on arm64 + polar_naca0012.enabled_on_cpu_arch = ["x86_64"] test_list.append(polar_naca0012) # HYPERSONIC FLOW PAST BLUNT BODY @@ -244,7 +265,7 @@ def main(): bluntbody.cfg_dir = "euler/bluntbody" bluntbody.cfg_file = "blunt.cfg" bluntbody.test_iter = 20 - bluntbody.test_vals = [0.540009, 6.916653, 0.000000, 1.868976] #last 4 columns + bluntbody.test_vals = [0.540009, 6.916653, 0.000000, 1.868976] test_list.append(bluntbody) # Equivalent area NACA64-206 @@ -252,9 +273,18 @@ def main(): ea_naca64206.cfg_dir = "optimization_euler/equivalentarea_naca64206" ea_naca64206.cfg_file = "NACA64206.cfg" ea_naca64206.test_iter = 10 - ea_naca64206.test_vals = [-1.076215, -0.391987, -0.000701, 67775.0] + ea_naca64206.test_vals = [-1.076215, -0.391987, -0.000701, 67775.000000] test_list.append(ea_naca64206) + # SUPERSONIC FLOW PAST A RAMP IN A CHANNEL + ramp = TestCase('ramp') + ramp.cfg_dir = "euler/ramp" + ramp.cfg_file = "inv_ramp.cfg" + ramp.test_iter = 10 + ramp.test_vals = [-13.399623, -7.788893, -0.081064, 0.056474] + ramp.test_vals_aarch64 = [-13.398422, -7.786461, -0.081064, 0.056474] + test_list.append(ramp) + ########################## ### Compressible N-S ### ########################## @@ -272,7 +302,7 @@ def main(): flatplate_udobj.cfg_dir = "user_defined_functions" flatplate_udobj.cfg_file = "lam_flatplate.cfg" flatplate_udobj.test_iter = 20 - flatplate_udobj.test_vals = [-6.653802, -1.181430, -0.794887, 0.000611, -0.000369, 0.000736, -0.001104, 596.690000, 299.800000, 296.890000, 21.492000, 0.563990, 37.148, 2.278700] + flatplate_udobj.test_vals = [-6.653802, -1.181430, -0.794887, 0.000611, -0.000369, 0.000736, -0.001104, 596.690000, 299.800000, 296.890000, 21.492000, 0.563990, 37.148000, 2.278700] test_list.append(flatplate_udobj) # Laminar cylinder (steady) @@ -306,7 +336,7 @@ def main(): poiseuille_profile.cfg_file = "profile_poiseuille.cfg" poiseuille_profile.test_iter = 10 poiseuille_profile.test_vals = [-12.492939, -7.672950, -0.000000, 2.085796] - poiseuille_profile.test_vals_aarch64 = [-12.492842, -7.672800, -0.000000, 2.085796] + poiseuille_profile.test_vals_aarch64 = [-12.492864, -7.671632, -0.000000, 2.085796] test_list.append(poiseuille_profile) ########################## @@ -318,7 +348,7 @@ def main(): rae2822_sa.cfg_dir = "rans/rae2822" rae2822_sa.cfg_file = "turb_SA_RAE2822.cfg" rae2822_sa.test_iter = 20 - rae2822_sa.test_vals = [-2.004689, -5.265793, 0.809463, 0.062016, -80577.000000] + rae2822_sa.test_vals = [-2.004689, -5.265782, 0.809463, 0.062016, -80576.000000] test_list.append(rae2822_sa) # RAE2822 SST @@ -326,7 +356,7 @@ def main(): rae2822_sst.cfg_dir = "rans/rae2822" rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg" rae2822_sst.test_iter = 20 - rae2822_sst.test_vals = [-0.510640, 4.868654, 0.813724, 0.062439, -80115.000000] + rae2822_sst.test_vals = [-0.510369, 4.870643, 0.816647, 0.061833, -71779.000000] test_list.append(rae2822_sst) # RAE2822 SST_SUST @@ -334,7 +364,7 @@ def main(): rae2822_sst_sust.cfg_dir = "rans/rae2822" rae2822_sst_sust.cfg_file = "turb_SST_SUST_RAE2822.cfg" rae2822_sst_sust.test_iter = 20 - rae2822_sst_sust.test_vals = [-2.425725, 4.868653, 0.813724, 0.062438] + rae2822_sst_sust.test_vals = [-2.537339, 4.870643, 0.816647, 0.061833] test_list.append(rae2822_sst_sust) # Flat plate @@ -342,7 +372,7 @@ def main(): turb_flatplate.cfg_dir = "rans/flatplate" turb_flatplate.cfg_file = "turb_SA_flatplate.cfg" turb_flatplate.test_iter = 20 - turb_flatplate.test_vals = [-4.147548, -6.729213, -0.176227, 0.057731] + turb_flatplate.test_vals = [-4.147727, -6.728308, -0.176232, 0.057717] test_list.append(turb_flatplate) # Flat plate (compressible) with species inlet @@ -350,7 +380,7 @@ def main(): turb_flatplate_species.cfg_dir = "rans/flatplate" turb_flatplate_species.cfg_file = "turb_SA_flatplate_species.cfg" turb_flatplate_species.test_iter = 20 - turb_flatplate_species.test_vals = [-4.147548, -0.634735, -1.770801, 1.335176, -3.250308, 9, -6.700992, 5, -6.999234, 10, -6.033847, 0.996033, 0.996033] + turb_flatplate_species.test_vals = [-4.147727, -0.634899, -1.770894, 1.334987, -3.250340, 9.000000, -6.700853, 5.000000, -6.991055, 10.000000, -6.033829, 0.996033, 0.996033] test_list.append(turb_flatplate_species) # ONERA M6 Wing @@ -358,7 +388,7 @@ def main(): turb_oneram6.cfg_dir = "rans/oneram6" turb_oneram6.cfg_file = "turb_ONERAM6.cfg" turb_oneram6.test_iter = 10 - turb_oneram6.test_vals = [-2.388839, -6.689413, 0.230321, 0.157640, -32539.000000] + turb_oneram6.test_vals = [-2.388839, -6.689426, 0.230321, 0.157640, -32539.000000] turb_oneram6.timeout = 3200 test_list.append(turb_oneram6) @@ -367,7 +397,7 @@ def main(): turb_oneram6_vc.cfg_dir = "rans/oneram6" turb_oneram6_vc.cfg_file = "turb_ONERAM6_vc.cfg" turb_oneram6_vc.test_iter = 15 - turb_oneram6_vc.test_vals = [-2.262387, -6.626467, 0.228393, 0.140799, -2.7107e+04] + turb_oneram6_vc.test_vals = [-2.262387, -6.626454, 0.228392, 0.140799, -27107.000000] turb_oneram6_vc.timeout = 3200 test_list.append(turb_oneram6_vc) @@ -376,7 +406,7 @@ def main(): turb_oneram6_nk.cfg_dir = "rans/oneram6" turb_oneram6_nk.cfg_file = "turb_ONERAM6_nk.cfg" turb_oneram6_nk.test_iter = 20 - turb_oneram6_nk.test_vals = [-4.892253, -4.514006, -11.432312, 0.221026, 0.045570, 2.000000, -0.899460, 31.384000] + turb_oneram6_nk.test_vals = [-4.892252, -4.514006, -11.432306, 0.221025, 0.045570, 2.000000, -0.899460, 31.384000] turb_oneram6_nk.timeout = 600 turb_oneram6_nk.tol = 0.0001 test_list.append(turb_oneram6_nk) @@ -385,8 +415,8 @@ def main(): turb_naca0012_sa = TestCase('turb_naca0012_sa') turb_naca0012_sa.cfg_dir = "rans/naca0012" turb_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" - turb_naca0012_sa.test_iter = 10 - turb_naca0012_sa.test_vals = [-8.621456, -10.378269, 1.064502, 0.019710, 20.000000, -1.811700, 20.000000, -5.171326, -46.506000] + turb_naca0012_sa.test_iter = 5 + turb_naca0012_sa.test_vals = [-10.453509, -13.866376, 1.057622, 0.022916, 20.000000, -1.867547, 20.000000, -3.632893, -44.540000] turb_naca0012_sa.timeout = 3200 test_list.append(turb_naca0012_sa) @@ -395,7 +425,8 @@ def main(): turb_naca0012_sst.cfg_dir = "rans/naca0012" turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" turb_naca0012_sst.test_iter = 10 - turb_naca0012_sst.test_vals = [-11.422619, -12.803419, -5.867375, 1.049989, 0.019163, -1.827695, -38.695000] + turb_naca0012_sst.test_vals = [-12.219694, -14.440925, -7.107551, 1.050109, 0.019148, -1.601287, -38.510000] + turb_naca0012_sst.test_vals_aarch64 = [-12.219735, -14.440925, -7.107550, 1.050109, 0.019148, -1.601262, -38.510000] turb_naca0012_sst.timeout = 3200 test_list.append(turb_naca0012_sst) @@ -404,7 +435,8 @@ def main(): turb_naca0012_sst_sust.cfg_dir = "rans/naca0012" turb_naca0012_sst_sust.cfg_file = "turb_NACA0012_sst_sust.cfg" turb_naca0012_sst_sust.test_iter = 10 - turb_naca0012_sst_sust.test_vals = [-11.366100, -12.643576, -5.749377, 1.005234, 0.019017, -1.818746] + turb_naca0012_sst_sust.test_vals = [-12.148637, -14.756583, -6.342201, 1.001189, 0.019384, -1.579100] + turb_naca0012_sst_sust.test_vals_aarch64 = [-12.148716, -14.756582, -6.342200, 1.001189, 0.019384, -1.579104] turb_naca0012_sst_sust.timeout = 3200 test_list.append(turb_naca0012_sst_sust) @@ -413,7 +445,7 @@ def main(): turb_naca0012_sst_2003_Vm.cfg_dir = "rans/naca0012" turb_naca0012_sst_2003_Vm.cfg_file = "turb_NACA0012_sst_2003-Vm.cfg" turb_naca0012_sst_2003_Vm.test_iter = 10 - turb_naca0012_sst_2003_Vm.test_vals = [-7.672926, -10.025010, -3.365892, 1.048735, 0.019723, -2.052543] + turb_naca0012_sst_2003_Vm.test_vals = [-7.664806, -10.014760, -3.358584, 1.048643, 0.019718, -2.067883] turb_naca0012_sst_2003_Vm.timeout = 3200 test_list.append(turb_naca0012_sst_2003_Vm) @@ -422,7 +454,7 @@ def main(): turb_naca0012_sst_1994_KLm.cfg_dir = "rans/naca0012" turb_naca0012_sst_1994_KLm.cfg_file = "turb_NACA0012_sst_1994-KLm.cfg" turb_naca0012_sst_1994_KLm.test_iter = 10 - turb_naca0012_sst_1994_KLm.test_vals = [-8.567222, -10.798741, -3.990574, 1.049274, 0.019199, -1.809143] + turb_naca0012_sst_1994_KLm.test_vals = [-8.570837, -10.805211, -3.997146, 1.049397, 0.019183, -1.805750] turb_naca0012_sst_1994_KLm.timeout = 3200 test_list.append(turb_naca0012_sst_1994_KLm) @@ -432,7 +464,7 @@ def main(): turb_naca0012_sst_fixedvalues.cfg_dir = "rans/naca0012" turb_naca0012_sst_fixedvalues.cfg_file = "turb_NACA0012_sst_fixedvalues.cfg" turb_naca0012_sst_fixedvalues.test_iter = 10 - turb_naca0012_sst_fixedvalues.test_vals = [-5.216685, -9.561914, -1.565777, 1.022393, 0.040542, -3.729635] + turb_naca0012_sst_fixedvalues.test_vals = [-5.216737, -10.025507, -1.615166, 1.021891, 0.040213, -3.731060] turb_naca0012_sst_fixedvalues.timeout = 3200 test_list.append(turb_naca0012_sst_fixedvalues) @@ -441,7 +473,7 @@ def main(): turb_naca0012_sst_expliciteuler.cfg_dir = "rans/naca0012" turb_naca0012_sst_expliciteuler.cfg_file = "turb_NACA0012_sst_expliciteuler.cfg" turb_naca0012_sst_expliciteuler.test_iter = 10 - turb_naca0012_sst_expliciteuler.test_vals = [-3.532228, -3.157766, 3.364025, 1.124824, 0.501717, -float("inf")] + turb_naca0012_sst_expliciteuler.test_vals = [-3.532289, -3.157766, 3.364024, 1.122901, 0.500798, -float("inf")] turb_naca0012_sst_expliciteuler.timeout = 3200 test_list.append(turb_naca0012_sst_expliciteuler) @@ -450,7 +482,7 @@ def main(): propeller.cfg_dir = "rans/propeller" propeller.cfg_file = "propeller.cfg" propeller.test_iter = 10 - propeller.test_vals = [-3.389575, -8.409529, 0.000048, 0.056329] #last 4 columns + propeller.test_vals = [-3.389575, -8.409251, 0.000048, 0.056329] propeller.timeout = 3200 test_list.append(propeller) @@ -463,7 +495,7 @@ def main(): axi_rans_air_nozzle_restart.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 - axi_rans_air_nozzle_restart.test_vals = [-12.089268, -7.493381, -8.716391, -4.021218, -1924.800000] + axi_rans_air_nozzle_restart.test_vals = [-12.063597, -7.006585, -8.702557, -4.039824, -2019.8] axi_rans_air_nozzle_restart.tol = 0.0001 test_list.append(axi_rans_air_nozzle_restart) @@ -477,7 +509,7 @@ def main(): turb_naca0012_sst_restart_mg.cfg_file = "turb_NACA0012_sst_multigrid_restart.cfg" turb_naca0012_sst_restart_mg.test_iter = 20 turb_naca0012_sst_restart_mg.ntest_vals = 5 - turb_naca0012_sst_restart_mg.test_vals = [-7.619889, -7.729499, -1.981039, -0.000016, 0.079062] + turb_naca0012_sst_restart_mg.test_vals = [-7.612353, -7.432347, -1.918249, -0.000013, 0.079110] turb_naca0012_sst_restart_mg.timeout = 3200 turb_naca0012_sst_restart_mg.tol = 0.000001 test_list.append(turb_naca0012_sst_restart_mg) @@ -543,7 +575,7 @@ def main(): sp_pipeSlice_3d_dp_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/pipeSlice_3d" sp_pipeSlice_3d_dp_hf_tp.cfg_file = "sp_pipeSlice_3d_dp_hf_tp.cfg" sp_pipeSlice_3d_dp_hf_tp.test_iter = 10 - sp_pipeSlice_3d_dp_hf_tp.test_vals = [-11.119796, -11.234737, -8.694310, -0.000023] #last 4 lines + sp_pipeSlice_3d_dp_hf_tp.test_vals = [-11.119796, -11.234737, -8.694310, -0.000023] test_list.append(sp_pipeSlice_3d_dp_hf_tp) # 2D pin array with heat transfer BC on pin surfaces @@ -551,7 +583,7 @@ def main(): inc_heatTransfer_BC.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" inc_heatTransfer_BC.cfg_file = "BC_HeatTransfer.cfg" inc_heatTransfer_BC.test_iter = 50 - inc_heatTransfer_BC.test_vals = [-8.242651, -7.341179, -7.407346, -0.152603, -1667.300000] #last 5 lines + inc_heatTransfer_BC.test_vals = [-8.242651, -7.341179, -7.407346, -0.152603, -1667.300000] test_list.append(inc_heatTransfer_BC) ############################ @@ -563,7 +595,7 @@ def main(): inc_turb_naca0012.cfg_dir = "incomp_rans/naca0012" inc_turb_naca0012.cfg_file = "naca0012.cfg" inc_turb_naca0012.test_iter = 20 - inc_turb_naca0012.test_vals = [-4.788595, -11.040557, -0.000002, 0.309519] + inc_turb_naca0012.test_vals = [-4.788596, -11.039529, -0.000002, 0.309504] test_list.append(inc_turb_naca0012) # NACA0012, SST_SUST @@ -571,7 +603,7 @@ def main(): inc_turb_naca0012_sst_sust.cfg_dir = "incomp_rans/naca0012" inc_turb_naca0012_sst_sust.cfg_file = "naca0012_SST_SUST.cfg" inc_turb_naca0012_sst_sust.test_iter = 20 - inc_turb_naca0012_sst_sust.test_vals = [-7.274050, 0.145887, -0.000001, 0.312023] + inc_turb_naca0012_sst_sust.test_vals = [-7.270578, 0.018403, -0.000001, 0.307688] test_list.append(inc_turb_naca0012_sst_sust) #################### @@ -583,7 +615,7 @@ def main(): fem_euler_naca0012.cfg_dir = "hom_euler/NACA0012_5thOrder" fem_euler_naca0012.cfg_file = "fem_NACA0012_reg.cfg" fem_euler_naca0012.test_iter = 10 - fem_euler_naca0012.test_vals = [-6.519946,-5.976944,0.255551,0.000028] #last 4 columns + fem_euler_naca0012.test_vals = [-6.519946, -5.976944, 0.255551, 0.000028] test_list.append(fem_euler_naca0012) ############################ @@ -595,7 +627,7 @@ def main(): fem_ns_flatplate.cfg_dir = "hom_navierstokes/FlatPlate/nPoly4" fem_ns_flatplate.cfg_file = "lam_flatplate_reg.cfg" fem_ns_flatplate.test_iter = 25 - fem_ns_flatplate.test_vals = [1.383727,3.175247,0.058387,0.257951] #last 4 columns + fem_ns_flatplate.test_vals = [1.383727, 3.175247, 0.058387, 0.257951] test_list.append(fem_ns_flatplate) # Steady cylinder @@ -603,7 +635,7 @@ def main(): fem_ns_cylinder.cfg_dir = "hom_navierstokes/CylinderViscous/nPoly3" fem_ns_cylinder.cfg_file = "fem_Cylinder_reg.cfg" fem_ns_cylinder.test_iter = 10 - fem_ns_cylinder.test_vals = [0.454960,0.979123,-0.000028,79.984799] #last 4 columns + fem_ns_cylinder.test_vals = [0.454960, 0.979123, -0.000028, 79.984799] test_list.append(fem_ns_cylinder) # Steady sphere @@ -611,8 +643,7 @@ def main(): fem_ns_sphere.cfg_dir = "hom_navierstokes/SphereViscous/nPoly3_QuadDominant" fem_ns_sphere.cfg_file = "fem_Sphere_reg.cfg" fem_ns_sphere.test_iter = 10 - fem_ns_sphere.test_vals = [-0.288121,0.240324,0.000258,21.797363] #last 4 columns - fem_ns_sphere.command = TestCase.Command(exec = "SU2_CFD") + fem_ns_sphere.test_vals = [-0.288121, 0.240324, 0.000258, 21.797363] test_list.append(fem_ns_sphere) # Unsteady sphere ADER @@ -620,8 +651,7 @@ def main(): fem_ns_sphere_ader.cfg_dir = "hom_navierstokes/SphereViscous/nPoly3_QuadDominant" fem_ns_sphere_ader.cfg_file = "fem_Sphere_reg_ADER.cfg" fem_ns_sphere_ader.test_iter = 10 - fem_ns_sphere_ader.test_vals = [-35.000000,-35.000000,0.000047,31.110911] #last 4 columns - fem_ns_sphere_ader.command = TestCase.Command(exec = "SU2_CFD") + fem_ns_sphere_ader.test_vals = [-35.000000, -35.000000, 0.000047, 31.110911] test_list.append(fem_ns_sphere_ader) # Unsteady cylinder @@ -629,8 +659,7 @@ def main(): fem_ns_unsteady_cylinder.cfg_dir = "hom_navierstokes/UnsteadyCylinder/nPoly4" fem_ns_unsteady_cylinder.cfg_file = "fem_unst_cylinder.cfg" fem_ns_unsteady_cylinder.test_iter = 11 - fem_ns_unsteady_cylinder.test_vals = [-3.558582,-3.014464,-0.038927,1.383983] #last 4 columns - fem_ns_unsteady_cylinder.command = TestCase.Command(exec = "SU2_CFD") + fem_ns_unsteady_cylinder.test_vals = [-3.558582, -3.014464, -0.038927, 1.383983] fem_ns_unsteady_cylinder.unsteady = True test_list.append(fem_ns_unsteady_cylinder) @@ -639,8 +668,7 @@ def main(): fem_ns_unsteady_cylinder_ader.cfg_dir = "hom_navierstokes/UnsteadyCylinder/nPoly4" fem_ns_unsteady_cylinder_ader.cfg_file = "fem_unst_cylinder_ADER.cfg" fem_ns_unsteady_cylinder_ader.test_iter = 11 - fem_ns_unsteady_cylinder_ader.test_vals = [-35.000000,-35.000000,-0.041003,1.391339] #last 4 columns - fem_ns_unsteady_cylinder_ader.command = TestCase.Command(exec = "SU2_CFD") + fem_ns_unsteady_cylinder_ader.test_vals = [-35.000000, -35.000000, -0.041003, 1.391339] fem_ns_unsteady_cylinder_ader.unsteady = True test_list.append(fem_ns_unsteady_cylinder_ader) @@ -653,8 +681,7 @@ def main(): turbmod_sa_bsl_rae2822.cfg_dir = "turbulence_models/sa/rae2822" turbmod_sa_bsl_rae2822.cfg_file = "turb_SA_BSL_RAE2822.cfg" turbmod_sa_bsl_rae2822.test_iter = 20 - turbmod_sa_bsl_rae2822.test_vals = [-2.004689, 0.742306, 0.497308, -5.265793, 0.809463, 0.062016] - turbmod_sa_bsl_rae2822.new_output = True + turbmod_sa_bsl_rae2822.test_vals = [-2.004689, 0.742306, 0.497308, -5.265782, 0.809463, 0.062016] test_list.append(turbmod_sa_bsl_rae2822) # SA Negative @@ -662,9 +689,8 @@ def main(): turbmod_sa_neg_rae2822.cfg_dir = "turbulence_models/sa/rae2822" turbmod_sa_neg_rae2822.cfg_file = "turb_SA_NEG_RAE2822.cfg" turbmod_sa_neg_rae2822.test_iter = 10 - turbmod_sa_neg_rae2822.test_vals = [-1.374695, 1.976506, 1.898195, 4.831133, 1.187310, 0.426019, -86764] - turbmod_sa_neg_rae2822.test_vals_aarch64 = [-1.347530, 1.439078, 1.306846, -1.928774, 1.480543, 0.571601, -91503] - turbmod_sa_neg_rae2822.new_output = True + turbmod_sa_neg_rae2822.test_vals = [-1.466238, 3.169232, 2.756518, 4.722767, 1.120253, 0.378675, -83444.000000] + turbmod_sa_neg_rae2822.test_vals_aarch64 = [-1.359612, 1.493629, 1.218367, -1.441703, 1.248499, 0.457987, -86467.000000] test_list.append(turbmod_sa_neg_rae2822) # SA Compressibility Correction @@ -672,8 +698,7 @@ def main(): turbmod_sa_comp_rae2822.cfg_dir = "turbulence_models/sa/rae2822" turbmod_sa_comp_rae2822.cfg_file = "turb_SA_COMP_RAE2822.cfg" turbmod_sa_comp_rae2822.test_iter = 20 - turbmod_sa_comp_rae2822.test_vals = [-2.004687, 0.742304, 0.497309, -5.266081, 0.809467, 0.062029] - turbmod_sa_comp_rae2822.new_output = True + turbmod_sa_comp_rae2822.test_vals = [-2.004687, 0.742304, 0.497309, -5.266067, 0.809467, 0.062029] test_list.append(turbmod_sa_comp_rae2822) # SA Edwards @@ -682,7 +707,6 @@ def main(): turbmod_sa_edw_rae2822.cfg_file = "turb_SA_EDW_RAE2822.cfg" turbmod_sa_edw_rae2822.test_iter = 20 turbmod_sa_edw_rae2822.test_vals = [-2.004687, 0.742306, 0.497310, -5.290769, 0.809485, 0.062036] - turbmod_sa_edw_rae2822.new_output = True test_list.append(turbmod_sa_edw_rae2822) # SA Compressibility and Edwards @@ -691,7 +715,6 @@ def main(): turbmod_sa_comp_edw_rae2822.cfg_file = "turb_SA_COMP_EDW_RAE2822.cfg" turbmod_sa_comp_edw_rae2822.test_iter = 20 turbmod_sa_comp_edw_rae2822.test_vals = [-2.004685, 0.742307, 0.497311, -5.290750, 0.809487, 0.062045] - turbmod_sa_comp_edw_rae2822.new_output = True test_list.append(turbmod_sa_comp_edw_rae2822) # SA QCR @@ -699,8 +722,7 @@ def main(): turbmod_sa_qcr_rae2822.cfg_dir = "turbulence_models/sa/rae2822" turbmod_sa_qcr_rae2822.cfg_file = "turb_SA_QCR_RAE2822.cfg" turbmod_sa_qcr_rae2822.test_iter = 20 - turbmod_sa_qcr_rae2822.test_vals = [-2.004793, 0.742353, 0.497315, -5.265974, 0.807841, 0.062027] - turbmod_sa_qcr_rae2822.new_output = True + turbmod_sa_qcr_rae2822.test_vals = [-2.004793, 0.742353, 0.497315, -5.265962, 0.807841, 0.062027] test_list.append(turbmod_sa_qcr_rae2822) ############################ @@ -724,7 +746,7 @@ def main(): contadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" contadj_naca0012.cfg_file = "inv_NACA0012.cfg" contadj_naca0012.test_iter = 5 - contadj_naca0012.test_vals = [-9.300815, -14.587362, 0.300920, 0.019552] + contadj_naca0012.test_vals = [-9.300816, -14.587365, 0.300920, 0.019552] test_list.append(contadj_naca0012) # Inviscid ONERA M6 @@ -740,7 +762,7 @@ def main(): contadj_wedge.cfg_dir = "cont_adj_euler/wedge" contadj_wedge.cfg_file = "inv_wedge_ROE.cfg" contadj_wedge.test_iter = 10 - contadj_wedge.test_vals = [2.872691, -2.755572, 853010.000000, 0.000000] #last 4 columns + contadj_wedge.test_vals = [2.872691, -2.755572, 853010.000000, -0.000000] test_list.append(contadj_wedge) # Inviscid fixed CL NACA0012 @@ -768,7 +790,7 @@ def main(): contadj_ns_naca0012_sub.cfg_dir = "cont_adj_navierstokes/naca0012_sub" contadj_ns_naca0012_sub.cfg_file = "lam_NACA0012.cfg" contadj_ns_naca0012_sub.test_iter = 20 - contadj_ns_naca0012_sub.test_vals = [-2.743268, -8.215193, 0.518810, 0.001210] #last 4 columns + contadj_ns_naca0012_sub.test_vals = [-2.743268, -8.215193, 0.518810, 0.001210] test_list.append(contadj_ns_naca0012_sub) # Adjoint laminar naca0012 transonic @@ -776,7 +798,7 @@ def main(): contadj_ns_naca0012_trans.cfg_dir = "cont_adj_navierstokes/naca0012_trans" contadj_ns_naca0012_trans.cfg_file = "lam_NACA0012.cfg" contadj_ns_naca0012_trans.test_iter = 20 - contadj_ns_naca0012_trans.test_vals = [ -1.039664, -6.575019, 1.772300, 0.012495] #last 4 columns + contadj_ns_naca0012_trans.test_vals = [-1.039664, -6.575019, 1.772300, 0.012495] test_list.append(contadj_ns_naca0012_trans) ####################################################### @@ -788,7 +810,7 @@ def main(): contadj_rans_naca0012.cfg_dir = "cont_adj_rans/naca0012" contadj_rans_naca0012.cfg_file = "turb_nasa.cfg" contadj_rans_naca0012.test_iter = 20 - contadj_rans_naca0012.test_vals = [-0.794162, -5.761722, 19.214000, -0.000000] #last 4 columns + contadj_rans_naca0012.test_vals = [-0.794162, -5.761722, 19.214000, -0.000000] test_list.append(contadj_rans_naca0012) # Adjoint turbulent NACA0012 with binary restarts @@ -796,7 +818,7 @@ def main(): contadj_rans_naca0012_bin.cfg_dir = "cont_adj_rans/naca0012" contadj_rans_naca0012_bin.cfg_file = "turb_nasa_binary.cfg" contadj_rans_naca0012_bin.test_iter = 18 - contadj_rans_naca0012_bin.test_vals = [-0.794169, -5.761671, 19.214000, -0.000000] #last 4 columns + contadj_rans_naca0012_bin.test_vals = [-0.794169, -5.761671, 19.214000, -0.000000] test_list.append(contadj_rans_naca0012_bin) # Adjoint turbulent RAE2822 @@ -816,8 +838,8 @@ def main(): turb_naca0012_1c.cfg_dir = "rans_uq/naca0012" turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg" turb_naca0012_1c.test_iter = 10 - turb_naca0012_1c.test_vals = [-4.976246, 1.141479, 0.459999, -0.078853] - turb_naca0012_1c.test_vals_aarch64 = [-4.983548, 1.138789, 0.456805, -0.079667] + turb_naca0012_1c.test_vals = [-4.976284, 1.141136, 0.463115, -0.083307] + turb_naca0012_1c.test_vals_aarch64 = [-4.983453, 1.138491, 0.459947, -0.084114] test_list.append(turb_naca0012_1c) # NACA0012 2c @@ -825,8 +847,8 @@ def main(): turb_naca0012_2c.cfg_dir = "rans_uq/naca0012" turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg" turb_naca0012_2c.test_iter = 10 - turb_naca0012_2c.test_vals = [-5.483323, 0.968820, 0.304757, -0.113468] - turb_naca0012_2c.test_vals_aarch64 = [-5.483345, 0.968812, 0.305213, -0.113317] + turb_naca0012_2c.test_vals = [-5.483317, 0.968654, 0.307611, -0.118062] + turb_naca0012_2c.test_vals_aarch64 = [-5.483338, 0.968646, 0.308055, -0.117915] test_list.append(turb_naca0012_2c) # NACA0012 3c @@ -834,7 +856,7 @@ def main(): turb_naca0012_3c.cfg_dir = "rans_uq/naca0012" turb_naca0012_3c.cfg_file = "turb_NACA0012_uq_3c.cfg" turb_naca0012_3c.test_iter = 10 - turb_naca0012_3c.test_vals = [-5.584310, 0.931348, 0.279056, -0.113209] + turb_naca0012_3c.test_vals = [-5.584309, 0.931259, 0.281831, -0.117821] test_list.append(turb_naca0012_3c) # NACA0012 p1c1 @@ -842,8 +864,8 @@ def main(): turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg" turb_naca0012_p1c1.test_iter = 10 - turb_naca0012_p1c1.test_vals = [-5.128867, 1.077141, 0.586532, -0.047632] - turb_naca0012_p1c1.test_vals_aarch64 = [-5.130279, 1.076643, 0.587076, -0.047445] + turb_naca0012_p1c1.test_vals = [-5.128887, 1.076846, 0.589839, -0.051939] + turb_naca0012_p1c1.test_vals_aarch64 = [-5.128883, 1.076873, 0.590376, -0.051754] test_list.append(turb_naca0012_p1c1) # NACA0012 p1c2 @@ -851,8 +873,8 @@ def main(): turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg" turb_naca0012_p1c2.test_iter = 10 - turb_naca0012_p1c2.test_vals = [-5.554659, 0.943705, 0.399234, -0.095799] - turb_naca0012_p1c2.test_vals_aarch64 = [-5.554645, 0.943709, 0.398620, -0.096021] + turb_naca0012_p1c2.test_vals = [-5.554633, 0.943626, 0.402263, -0.100275] + turb_naca0012_p1c2.test_vals_aarch64 = [-5.554636, 0.943621, 0.401650, -0.100495] test_list.append(turb_naca0012_p1c2) ###################################### @@ -864,8 +886,7 @@ def main(): harmonic_balance.cfg_dir = "harmonic_balance" harmonic_balance.cfg_file = "HB.cfg" harmonic_balance.test_iter = 25 - harmonic_balance.test_vals = [-1.589739, 3.922579, 0.006702, 0.099632] - harmonic_balance.new_output = False + harmonic_balance.test_vals = [-1.589739, 0.790169, 0.937053, 3.922579] test_list.append(harmonic_balance) # Turbulent pitching NACA 64a010 airfoil @@ -873,8 +894,8 @@ def main(): hb_rans_preconditioning.cfg_dir = "harmonic_balance/hb_rans_preconditioning" hb_rans_preconditioning.cfg_file = "davis.cfg" hb_rans_preconditioning.test_iter = 25 - hb_rans_preconditioning.test_vals = [-1.902098, -5.949275, 0.007768, 0.128061] - hb_rans_preconditioning.new_output = False + hb_rans_preconditioning.tol = 0.00001 + hb_rans_preconditioning.test_vals = [-1.902098, 0.484070, 0.601481, 3.609002, -5.949360] test_list.append(hb_rans_preconditioning) ###################################### @@ -914,7 +935,7 @@ def main(): square_cylinder.cfg_dir = "unsteady/square_cylinder" square_cylinder.cfg_file = "turb_square.cfg" square_cylinder.test_iter = 3 - square_cylinder.test_vals = [-1.158117, 0.067945, 1.399789, 2.220404, 1.399743, 2.218605, -0.453170] + square_cylinder.test_vals = [-1.173603, 0.058045, 1.399795, 2.220404, 1.399749, 2.218605, -0.453330] square_cylinder.unsteady = True test_list.append(square_cylinder) @@ -941,7 +962,7 @@ def main(): ddes_flatplate.cfg_dir = "ddes/flatplate" ddes_flatplate.cfg_file = "ddes_flatplate.cfg" ddes_flatplate.test_iter = 10 - ddes_flatplate.test_vals = [-2.714758, -5.883004, -0.215005, 0.023783, -618.160000] + ddes_flatplate.test_vals = [-2.714757, -5.882779, -0.215005, 0.023783, -618.130000] ddes_flatplate.unsteady = True test_list.append(ddes_flatplate) @@ -950,7 +971,7 @@ def main(): unst_inc_turb_naca0015_sa.cfg_dir = "unsteady/pitching_naca0015_rans_inc" unst_inc_turb_naca0015_sa.cfg_file = "config_incomp_turb_sa.cfg" unst_inc_turb_naca0015_sa.test_iter = 1 - unst_inc_turb_naca0015_sa.test_vals = [-3.004011, -6.876230, 1.487888, 0.421869] + unst_inc_turb_naca0015_sa.test_vals = [-3.004012, -6.876220, 1.487882, 0.421861] unst_inc_turb_naca0015_sa.unsteady = True test_list.append(unst_inc_turb_naca0015_sa) @@ -988,7 +1009,8 @@ def main(): coolprop_fluidModel.cfg_dir = "nicf/coolprop" coolprop_fluidModel.cfg_file = "fluidModel.cfg" coolprop_fluidModel.test_iter = 5 - coolprop_fluidModel.test_vals = [-4.525458, -1.578441, 3.439057, 0.000000, 0.000000] + coolprop_fluidModel.test_vals = [-4.525459, -1.578697, 3.443116, 0.000000, 0.000000] + coolprop_fluidModel.enabled_on_cpu_arch = ["x86_64"] test_list.append(coolprop_fluidModel) # Rarefaction Q1D nozzle, include CoolProp transport model @@ -996,9 +1018,18 @@ def main(): coolprop_transportModel.cfg_dir = "nicf/coolprop" coolprop_transportModel.cfg_file = "transportModel.cfg" coolprop_transportModel.test_iter = 5 - coolprop_transportModel.test_vals = [-4.527922, -1.308741, 4.630469, 0.000000, 0.000000] + coolprop_transportModel.test_vals = [-4.527922, -1.308648, 4.630717, 0.000000, 0.000000] + coolprop_transportModel.enabled_on_cpu_arch = ["x86_64"] test_list.append(coolprop_transportModel) + # Rarefaction Q1D nozzle, include data-driven fluid model + datadriven_fluidModel = TestCase('datadriven_fluidModel') + datadriven_fluidModel.cfg_dir = "nicf/datadriven" + datadriven_fluidModel.cfg_file = "datadriven_nozzle.cfg" + datadriven_fluidModel.test_iter = 50 + datadriven_fluidModel.test_vals = [-2.623890, 0.145236, 4.688439, 0.000000, 0.000000] + test_list.append(datadriven_fluidModel) + ###################################### ### Turbomachinery ### ###################################### @@ -1008,8 +1039,7 @@ def main(): Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger" Jones_tc_restart.cfg_file = "Jones_restart.cfg" Jones_tc_restart.test_iter = 5 - Jones_tc_restart.test_vals = [-10.691504, -7.643703, 85.827890, 2.277151] - Jones_tc_restart.new_output = False + Jones_tc_restart.test_vals = [-6.604542, -2.792281, -14.328530, -8.769313, -11.371439, -5.845632, 73273, 73273] test_list.append(Jones_tc_restart) # 2D axial stage @@ -1017,8 +1047,7 @@ def main(): axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D" axial_stage2D.cfg_file = "Axial_stage2D.cfg" axial_stage2D.test_iter = 20 - axial_stage2D.test_vals = [-1.937007, 5.338943, 73.357200, 0.915725] - axial_stage2D.new_output = False + axial_stage2D.test_vals = [0.974805, 1.534447, -2.897694, 2.599376, -2.418379, 3.087219, 106380.000000, 106380.000000] test_list.append(axial_stage2D) # 2D transonic stator restart @@ -1026,8 +1055,7 @@ def main(): transonic_stator_restart.cfg_dir = "turbomachinery/transonic_stator_2D" transonic_stator_restart.cfg_file = "transonic_stator_restart.cfg" transonic_stator_restart.test_iter = 20 - transonic_stator_restart.test_vals = [-6.801911, -0.746307, 5.003453, 0.002946] - transonic_stator_restart.new_output = False + transonic_stator_restart.test_vals = [-5.354418, -3.509964, -3.163206, 0.744733, -3.846691, 1.805587, -471690] test_list.append(transonic_stator_restart) ###################################### @@ -1102,8 +1130,7 @@ def main(): bars_SST_2D.cfg_dir = "sliding_interface/bars_SST_2D" bars_SST_2D.cfg_file = "bars.cfg" bars_SST_2D.test_iter = 13 - bars_SST_2D.test_vals = [13.000000, -0.604409, -1.523885] - bars_SST_2D.command = TestCase.Command(exec = "SU2_CFD") + bars_SST_2D.test_vals = [13.000000, -0.773513, -1.700012] bars_SST_2D.multizone = True test_list.append(bars_SST_2D) @@ -1112,8 +1139,7 @@ def main(): slinc_steady.cfg_dir = "sliding_interface/incompressible_steady" slinc_steady.cfg_file = "config.cfg" slinc_steady.test_iter = 19 - slinc_steady.test_vals = [19.000000, -1.803732, -2.108492] #last 3 columns - slinc_steady.command = TestCase.Command(exec = "SU2_CFD") + slinc_steady.test_vals = [19.000000, -1.778863, -2.040209] slinc_steady.timeout = 100 slinc_steady.tol = 0.00002 slinc_steady.multizone = True @@ -1139,7 +1165,7 @@ def main(): statbeam3d.cfg_dir = "fea_fsi/StatBeam_3d" statbeam3d.cfg_file = "configBeam_3d.cfg" statbeam3d.test_iter = 0 - statbeam3d.test_vals = [-8.396797, -8.162206, -8.156102, 64095.0] #last 4 columns + statbeam3d.test_vals = [-8.396797, -8.162206, -8.156102, 64095.000000] statbeam3d.test_vals_aarch64 = [-8.396793, -8.162255, -8.156118, 64095.0] #last 4 columns statbeam3d.command = TestCase.Command(exec = "parallel_computation_fsi.py", param = "-f") test_list.append(statbeam3d) @@ -1149,7 +1175,7 @@ def main(): dynbeam2d.cfg_dir = "fea_fsi/DynBeam_2d" dynbeam2d.cfg_file = "configBeam_2d.cfg" dynbeam2d.test_iter = 6 - dynbeam2d.test_vals = [-3.240015, 2.895057, -0.353146, 6.6127e+04] #last 4 columns + dynbeam2d.test_vals = [-3.240015, 2.895057, -0.353146, 66127.000000] dynbeam2d.unsteady = True test_list.append(dynbeam2d) @@ -1158,7 +1184,7 @@ def main(): fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" fsi2d.cfg_file = "configFSI.cfg" fsi2d.test_iter = 4 - fsi2d.test_vals = [4, 0, -3.743210, -4.133483] #last 4 columns + fsi2d.test_vals = [4.000000, 0.000000, -3.743210, -4.133483] fsi2d.command = TestCase.Command(exec = "parallel_computation_fsi.py", param = "-f") fsi2d.multizone= True fsi2d.unsteady = True @@ -1169,7 +1195,7 @@ def main(): stat_fsi.cfg_dir = "fea_fsi/stat_fsi" stat_fsi.cfg_file = "config.cfg" stat_fsi.test_iter = 7 - stat_fsi.test_vals = [-3.296605, -4.934646, 0.000000, 7.000000] #last 4 columns + stat_fsi.test_vals = [-3.296605, -4.934646, 0.000000, 7.000000] stat_fsi.multizone = True test_list.append(stat_fsi) @@ -1188,7 +1214,7 @@ def main(): stat_fsi_restart.cfg_dir = "fea_fsi/stat_fsi" stat_fsi_restart.cfg_file = "config_restart.cfg" stat_fsi_restart.test_iter = 1 - stat_fsi_restart.test_vals = [-3.435926, -4.264912, 0.000000, 28.000000] #last 4 columns + stat_fsi_restart.test_vals = [-3.435926, -4.264912, 0.000000, 28.000000] stat_fsi_restart.multizone = True test_list.append(stat_fsi_restart) @@ -1200,7 +1226,6 @@ def main(): p1rad = TestCase('p1rad') p1rad.cfg_dir = "radiation/p1model" p1rad.cfg_file = "configp1.cfg" - p1rad.new_output= True p1rad.test_iter = 100 p1rad.test_vals = [-7.743666, -7.921411, -2.111848, 0.098302, -45.023000] test_list.append(p1rad) @@ -1215,8 +1240,8 @@ def main(): solid_periodic_pins.cfg_dir = "solid_heat_conduction/periodic_pins" solid_periodic_pins.cfg_file = "configSolid.cfg" solid_periodic_pins.test_iter = 750 - solid_periodic_pins.test_vals = [-15.878977, -14.569206, 300.900000, 425.320000, 0.000000, 5.000000, -1.672737] #last 7 lines - solid_periodic_pins.test_vals_aarch64 = [-15.879010, -14.569206, 300.900000, 425.320000, 0.000000, 5.000000, -1.672630] #last 7 lines + solid_periodic_pins.test_vals = [-15.878977, -14.569206, 300.900000, 425.320000, 0.000000, 5.000000, -1.672737] + solid_periodic_pins.test_vals_aarch64 = [-15.879016, -14.569206, 300.900000, 425.320000, 0.000000, 5.000000, -1.672666] test_list.append(solid_periodic_pins) # ############################### @@ -1228,8 +1253,7 @@ def main(): cht_incompressible.cfg_dir = "coupled_cht/incomp_2d" cht_incompressible.cfg_file = "cht_2d_3cylinders.cfg" cht_incompressible.test_iter = 10 - cht_incompressible.test_vals = [-2.128826, -0.588813, -0.588813, -0.588813] #last 4 columns - cht_incompressible.command = TestCase.Command(exec = "SU2_CFD") + cht_incompressible.test_vals = [-2.128827, -0.588812, -0.588812, -0.588812] cht_incompressible.multizone = True test_list.append(cht_incompressible) @@ -1238,8 +1262,7 @@ def main(): cht_compressible.cfg_dir = "coupled_cht/comp_2d" cht_compressible.cfg_file = "cht_2d_3cylinders.cfg" cht_compressible.test_iter = 10 - cht_compressible.test_vals = [-4.256032, -0.532728, -0.532729, -0.532728] - cht_compressible.command = TestCase.Command(exec = "SU2_CFD") + cht_compressible.test_vals = [-4.256053, -0.532725, -0.532725, -0.532726] cht_compressible.multizone = True test_list.append(cht_compressible) @@ -1248,7 +1271,7 @@ def main(): sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" sp_pinArray_cht_2d_dp_hf.cfg_file = "configMaster.cfg" sp_pinArray_cht_2d_dp_hf.test_iter = 100 - sp_pinArray_cht_2d_dp_hf.test_vals = [0.255546, -0.778969, -0.964351, -0.752492, 208.023676, 351.010000, -0.000000, -0.752490, 0.752490] + sp_pinArray_cht_2d_dp_hf.test_vals = [0.104306, -1.005859, -1.028870, -0.753282, 208.023676, 353.490000, -0.000000, -0.753280, 0.753280] sp_pinArray_cht_2d_dp_hf.multizone = True test_list.append(sp_pinArray_cht_2d_dp_hf) @@ -1257,8 +1280,8 @@ def main(): sp_pinArray_3d_cht_mf_hf_tp.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_3d" sp_pinArray_3d_cht_mf_hf_tp.cfg_file = "configMaster.cfg" sp_pinArray_3d_cht_mf_hf_tp.test_iter = 30 - sp_pinArray_3d_cht_mf_hf_tp.test_vals = [-3.773085, -4.220555, -4.811282, -0.009675, 99.879858, 419.200000, 0.000000] - sp_pinArray_3d_cht_mf_hf_tp.test_vals_aarch64 = [-13.400623, -7.476945, -7.025285, -0.009675, 99.879812, 419.200000, 0.0] + sp_pinArray_3d_cht_mf_hf_tp.test_vals = [-5.128577, -5.425081, -6.788413, -0.009675, 104.655438, 419.210000, 0.0] + sp_pinArray_3d_cht_mf_hf_tp.test_vals_aarch64 = [-5.128577, -5.425081, -6.788413, -0.009675, 104.655438, 419.210000, 0.0] sp_pinArray_3d_cht_mf_hf_tp.multizone = True test_list.append(sp_pinArray_3d_cht_mf_hf_tp) @@ -1271,7 +1294,7 @@ def main(): pywrapper_naca0012.cfg_dir = "euler/naca0012" pywrapper_naca0012.cfg_file = "inv_NACA0012_Roe.cfg" pywrapper_naca0012.test_iter = 100 - pywrapper_naca0012.test_vals = [-6.747210, -6.149915, 0.333445, 0.021241] #last 4 columns + pywrapper_naca0012.test_vals = [-6.747210, -6.149915, 0.333445, 0.021241] pywrapper_naca0012.command = TestCase.Command("mpirun -np 2", "SU2_CFD.py", "--parallel -f") test_list.append(pywrapper_naca0012) @@ -1280,7 +1303,8 @@ def main(): pywrapper_turb_naca0012_sst.cfg_dir = "rans/naca0012" pywrapper_turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" pywrapper_turb_naca0012_sst.test_iter = 10 - pywrapper_turb_naca0012_sst.test_vals = [-11.422619, -12.803419, -5.867375, 1.049989, 0.019163, -1.827695, -38.695000] + pywrapper_turb_naca0012_sst.test_vals = [-12.219694, -14.440925, -7.107551, 1.050109, 0.019148, -1.601287, -38.510000] + pywrapper_turb_naca0012_sst.test_vals_aarch64 = [-12.219735, -14.440925, -7.107550, 1.050109, 0.019148, -1.601262, -38.510000] pywrapper_turb_naca0012_sst.command = TestCase.Command("mpirun -np 2", "SU2_CFD.py", "--parallel -f") pywrapper_turb_naca0012_sst.timeout = 3200 test_list.append(pywrapper_turb_naca0012_sst) @@ -1290,7 +1314,8 @@ def main(): pywrapper_square_cylinder.cfg_dir = "unsteady/square_cylinder" pywrapper_square_cylinder.cfg_file = "turb_square.cfg" pywrapper_square_cylinder.test_iter = 10 - pywrapper_square_cylinder.test_vals = [-1.136553, -0.347305, 1.407915, 2.358881, 1.404192, 2.301559, -0.348120] + pywrapper_square_cylinder.test_vals = [-1.175619, -0.352238, 1.408450, 2.360729, 1.404693, 2.302284, -0.347980] + pywrapper_square_cylinder.test_vals_aarch64 = [-1.175617, -0.352079, 1.408450, 2.360729, 1.404693, 2.302284, -0.347980] pywrapper_square_cylinder.command = TestCase.Command("mpirun -np 2", "SU2_CFD.py", "--parallel -f") pywrapper_square_cylinder.unsteady = True test_list.append(pywrapper_square_cylinder) @@ -1305,26 +1330,46 @@ def main(): pywrapper_aeroelastic.unsteady = True test_list.append(pywrapper_aeroelastic) + # Custom FEA load + pywrapper_custom_fea_load = TestCase('pywrapper_custom_fea_load') + pywrapper_custom_fea_load.cfg_dir = "py_wrapper/custom_load_fea" + pywrapper_custom_fea_load.cfg_file = "config.cfg" + pywrapper_custom_fea_load.test_iter = 13 + pywrapper_custom_fea_load.test_vals = [-7.263559, -4.946814, -14.165142, 34.000000, -6.380144, 320.580000] + pywrapper_custom_fea_load.test_vals_aarch64 = [-7.263558, -4.946814, -14.165142, 35.000000, -6.802790, 320.580000] + pywrapper_custom_fea_load.command = TestCase.Command("mpirun -np 2", "python", "run.py") + test_list.append(pywrapper_custom_fea_load) + # FSI, 2d pywrapper_fsi2d = TestCase('pywrapper_fsi2d') pywrapper_fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" pywrapper_fsi2d.cfg_file = "configFSI.cfg" pywrapper_fsi2d.test_iter = 4 - pywrapper_fsi2d.test_vals = [4, 0, -3.743210, -4.133483] #last 4 columns + pywrapper_fsi2d.test_vals = [4.000000, 0.000000, -3.743210, -4.133483] pywrapper_fsi2d.command = TestCase.Command("mpirun -np 2", "SU2_CFD.py", "--nZone 2 --fsi True --parallel -f") pywrapper_fsi2d.unsteady = True pywrapper_fsi2d.multizone = True test_list.append(pywrapper_fsi2d) + # Unsteady FSI with custom load + pywrapper_unsteadyFSI = TestCase('pywrapper_unsteadyFSI') + pywrapper_unsteadyFSI.cfg_dir = "py_wrapper/dyn_fsi" + pywrapper_unsteadyFSI.cfg_file = "config.cfg" + pywrapper_unsteadyFSI.test_iter = 4 + pywrapper_unsteadyFSI.test_vals = [0, 31, 5, 58, -1.756780, -2.828276, -7.652558, -6.863929, 1.5618e-04] + pywrapper_unsteadyFSI.command = TestCase.Command("mpirun -np 2", "python", "run.py") + pywrapper_unsteadyFSI.unsteady = True + pywrapper_unsteadyFSI.multizone = True + test_list.append(pywrapper_unsteadyFSI) + # Unsteady CHT pywrapper_unsteadyCHT = TestCase('pywrapper_unsteadyCHT') pywrapper_unsteadyCHT.cfg_dir = "py_wrapper/flatPlate_unsteady_CHT" pywrapper_unsteadyCHT.cfg_file = "unsteady_CHT_FlatPlate_Conf.cfg" pywrapper_unsteadyCHT.test_iter = 5 - pywrapper_unsteadyCHT.test_vals = [-1.614167, 2.245725, -0.001241, 0.175713] + pywrapper_unsteadyCHT.test_vals = [-1.614167, 2.240663, -0.001316, 0.177491] pywrapper_unsteadyCHT.command = TestCase.Command("mpirun -np 2", "python", "launch_unsteady_CHT_FlatPlate.py --parallel -f") pywrapper_unsteadyCHT.unsteady = True - pywrapper_unsteadyCHT.new_output = True test_list.append(pywrapper_unsteadyCHT) # Rigid motion @@ -1332,11 +1377,21 @@ def main(): pywrapper_rigidMotion.cfg_dir = "py_wrapper/flatPlate_rigidMotion" pywrapper_rigidMotion.cfg_file = "flatPlate_rigidMotion_Conf.cfg" pywrapper_rigidMotion.test_iter = 5 - pywrapper_rigidMotion.test_vals = [-1.614170, 2.242953, 0.350037, 0.093116] + pywrapper_rigidMotion.test_vals = [-1.614165, 2.238591, 0.349970, 0.095593] pywrapper_rigidMotion.command = TestCase.Command("mpirun -np 2", "python", "launch_flatPlate_rigidMotion.py --parallel -f") pywrapper_rigidMotion.unsteady = True test_list.append(pywrapper_rigidMotion) + # Deforming Bump in Channel + pywrapper_deformingBump = TestCase('pywrapper_deformingBump') + pywrapper_deformingBump.cfg_dir = "py_wrapper/deforming_bump_in_channel" + pywrapper_deformingBump.cfg_file = "config.cfg" + pywrapper_deformingBump.test_iter = 1 + pywrapper_deformingBump.test_vals = [0.500000, 0.000000, -2.554360, -1.084594, -0.024882, 2.907803, 8.785498, -0.363585] + pywrapper_deformingBump.command = TestCase.Command("mpirun -np 2", "python", "run.py") + pywrapper_deformingBump.unsteady = True + test_list.append(pywrapper_deformingBump) + ############################################## ### Method of Manufactured Solutions (MMS) ### ############################################## @@ -1346,7 +1401,7 @@ def main(): mms_fvm_ns.cfg_dir = "mms/fvm_navierstokes" mms_fvm_ns.cfg_file = "lam_mms_roe.cfg" mms_fvm_ns.test_iter = 20 - mms_fvm_ns.test_vals = [-2.851428, 2.192348, 0.000000, 0.000000] #last 4 columns + mms_fvm_ns.test_vals = [-2.851428, 2.192348, 0.000000, 0.000000] mms_fvm_ns.tol = 0.0001 test_list.append(mms_fvm_ns) @@ -1355,7 +1410,7 @@ def main(): mms_fvm_inc_euler.cfg_dir = "mms/fvm_incomp_euler" mms_fvm_inc_euler.cfg_file = "inv_mms_jst.cfg" mms_fvm_inc_euler.test_iter = 20 - mms_fvm_inc_euler.test_vals = [-9.128660, -9.441806, 0.000000, 0.000000] #last 4 columns + mms_fvm_inc_euler.test_vals = [-9.128660, -9.441806, 0.000000, 0.000000] mms_fvm_inc_euler.tol = 0.0001 test_list.append(mms_fvm_inc_euler) @@ -1364,7 +1419,7 @@ def main(): mms_fvm_inc_ns.cfg_dir = "mms/fvm_incomp_navierstokes" mms_fvm_inc_ns.cfg_file = "lam_mms_fds.cfg" mms_fvm_inc_ns.test_iter = 20 - mms_fvm_inc_ns.test_vals = [-7.414944, -7.631546, 0.000000, 0.000000] #last 4 columns + mms_fvm_inc_ns.test_vals = [-7.414944, -7.631546, 0.000000, 0.000000] mms_fvm_inc_ns.tol = 0.0001 test_list.append(mms_fvm_inc_ns) @@ -1373,8 +1428,7 @@ def main(): ringleb_dg_euler.cfg_dir = "mms/dg_ringleb" ringleb_dg_euler.cfg_file = "ringleb_dg.cfg" ringleb_dg_euler.test_iter = 100 - ringleb_dg_euler.test_vals = [-5.136652, -4.724941, 0.000000, 0.000000] #last 4 columns - ringleb_dg_euler.command = TestCase.Command(exec = "SU2_CFD") + ringleb_dg_euler.test_vals = [-5.136652, -4.724941, 0.000000, 0.000000] ringleb_dg_euler.tol = 0.0001 test_list.append(ringleb_dg_euler) @@ -1383,8 +1437,7 @@ def main(): mms_dg_ns.cfg_dir = "mms/dg_navierstokes" mms_dg_ns.cfg_file = "lam_mms_dg.cfg" mms_dg_ns.test_iter = 100 - mms_dg_ns.test_vals = [-1.845393, 3.520699, 0.000000, 0.000000] #last 4 columns - mms_dg_ns.command = TestCase.Command(exec = "SU2_CFD") + mms_dg_ns.test_vals = [-1.845393, 3.520699, 0.000000, 0.000000] mms_dg_ns.tol = 0.0001 test_list.append(mms_dg_ns) @@ -1393,8 +1446,7 @@ def main(): mms_dg_ns_3d.cfg_dir = "mms/dg_navierstokes_3d" mms_dg_ns_3d.cfg_file = "lam_mms_dg_3d.cfg" mms_dg_ns_3d.test_iter = 100 - mms_dg_ns_3d.test_vals = [-0.146826, 5.356413, 0.000000, 0.000000] #last 4 columns - mms_dg_ns_3d.command = TestCase.Command(exec = "SU2_CFD") + mms_dg_ns_3d.test_vals = [-0.146826, 5.356413, 0.000000, 0.000000] mms_dg_ns_3d.tol = 0.0001 test_list.append(mms_dg_ns_3d) @@ -1407,8 +1459,7 @@ def main(): species2_primitiveVenturi_mixingmodel.cfg_dir = "species_transport/venturi_primitive_3species" species2_primitiveVenturi_mixingmodel.cfg_file = "species2_primitiveVenturi_mixingmodel.cfg" species2_primitiveVenturi_mixingmodel.test_iter = 50 - species2_primitiveVenturi_mixingmodel.test_vals = [-5.477236, -4.589782, -4.582531, -5.690416, -0.068943, -5.631254, 5.000000, -1.668303, 5.000000, -4.866978, 5.000000, -1.168368, 0.000425, 0.000404, 0.000021, 0.000000] - species2_primitiveVenturi_mixingmodel.new_output = True + species2_primitiveVenturi_mixingmodel.test_vals = [-5.359429, -4.504612, -4.480004, -5.629196, -0.059934, -5.596051, 5.000000, -1.870943, 5.000000, -4.915279, 5.000000, -1.183531, 0.000429, 0.000393, 0.000036, 0.000000] test_list.append(species2_primitiveVenturi_mixingmodel) # 2 species (1 eq) primitive venturi mixing using mixing model and bounded scalar transport @@ -1416,17 +1467,15 @@ def main(): species2_primitiveVenturi_mixingmodel_boundedscalar.cfg_dir = "species_transport/venturi_primitive_3species" species2_primitiveVenturi_mixingmodel_boundedscalar.cfg_file = "species2_primitiveVenturi_mixingmodel_boundedscalar.cfg" species2_primitiveVenturi_mixingmodel_boundedscalar.test_iter = 50 - species2_primitiveVenturi_mixingmodel_boundedscalar.test_vals = [-5.419823, -4.490921, -4.496340, -5.724950, -0.120331, -5.693224, 5.000000, -1.766882, 5.000000, -4.958487, 5.000000, -2.150247, 0.000300, 0.000300, 0.000000, 0.000000] - species2_primitiveVenturi_mixingmodel_boundedscalar.new_output = True + species2_primitiveVenturi_mixingmodel_boundedscalar.test_vals = [-5.336209, -4.445047, -4.432074, -5.785385, -0.127631, -5.672217, 5.000000, -1.944369, 5.000000, -4.878272, 5.000000, -1.806657, 0.000272, 0.000272, 0.000000, 0.000000] test_list.append(species2_primitiveVenturi_mixingmodel_boundedscalar) - # 2 species (1 eq) primitive venturi mixing using mixing model including viscosity and thermal conductivity + # 2 species (1 eq) primitive venturi mixing using mixing model including viscosity, thermal conductivity and inlet markers for SA turbulence model species2_primitiveVenturi_mixingmodel_viscosity = TestCase('species2_primitiveVenturi_mixingmodel_viscosity') species2_primitiveVenturi_mixingmodel_viscosity.cfg_dir = "species_transport/venturi_primitive_3species" species2_primitiveVenturi_mixingmodel_viscosity.cfg_file = "species2_primitiveVenturi_mixingmodel_viscosity.cfg" species2_primitiveVenturi_mixingmodel_viscosity.test_iter = 50 - species2_primitiveVenturi_mixingmodel_viscosity.test_vals = [-4.738778, -4.325766, -4.610914, -5.834431, 0.521730, -4.934375, 5.000000, -1.887191, 5.000000, -5.499917, 5.000000, -1.770845, 2.292904, 0.971941, 0.608500, 0.712464] - species2_primitiveVenturi_mixingmodel_viscosity.new_output = True + species2_primitiveVenturi_mixingmodel_viscosity.test_vals = [-4.843481, -3.585988, -3.486593, -7.560545, -5.094245, 5.000000, -1.898097, 5.000000, -3.328995, 5.000000, -2.113241, 2.482221, 0.974142, 0.607219, 0.900860] test_list.append(species2_primitiveVenturi_mixingmodel_viscosity) # 2 species (1 eq) primitive venturi mixing using mixing model including heat capacity and mass diffusivity @@ -1434,11 +1483,7 @@ def main(): species2_primitiveVenturi_mixingmodel_heatcapacity_H2.cfg_dir = "species_transport/venturi_primitive_3species" species2_primitiveVenturi_mixingmodel_heatcapacity_H2.cfg_file = "species2_primitiveVenturi_mixingmodel_heatcapacity_H2.cfg" species2_primitiveVenturi_mixingmodel_heatcapacity_H2.test_iter = 50 - species2_primitiveVenturi_mixingmodel_heatcapacity_H2.test_vals = [-6.105905, -4.979417, -4.870704, -7.338344, 2.435662, -5.621107, 30.000000, -5.737172, 12.000000, -8.148164, 9.000000, -8.040415, 2.084589, 1.000000, 0.600000, 0.484589] - species2_primitiveVenturi_mixingmodel_heatcapacity_H2.su2_exec = "mpirun -n 2 SU2_CFD" - species2_primitiveVenturi_mixingmodel_heatcapacity_H2.timeout = 1600 - species2_primitiveVenturi_mixingmodel_heatcapacity_H2.new_output = True - species2_primitiveVenturi_mixingmodel_heatcapacity_H2.tol = 0.00001 + species2_primitiveVenturi_mixingmodel_heatcapacity_H2.test_vals = [-6.118333, -4.985699, -4.918326, -7.249080, 2.445213, -5.624080, 30.000000, -5.681895, 12.000000, -8.186475, 10.000000, -8.853067, 2.083524, 1.000000, 0.600000, 0.483524] test_list.append(species2_primitiveVenturi_mixingmodel_heatcapacity_H2) # 2 species (1 eq) primitive venturi mixing using mixing model including heat capacity and mass diffusivity NonDimensional case @@ -1446,11 +1491,7 @@ def main(): species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.cfg_dir = "species_transport/venturi_primitive_3species" species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.cfg_file = "species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.cfg" species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.test_iter = 50 - species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.test_vals = [-5.711760, -5.284237, -5.175532, -8.342082, 2.130839, -5.226944, 30.000000, -5.737157, 12.000000, -8.148020, 9.000000, -8.040460, 2.084591, 1.000000, 0.600000, 0.484591] - species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.su2_exec = "mpirun -n 2 SU2_CFD" - species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.timeout = 1600 - species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.new_output = True - species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.tol = 0.00001 + species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.test_vals = [-5.724191, -5.290524, -5.223195, -8.252900, 2.140394, -5.229908, 30.000000, -5.681850, 12.000000, -8.186296, 10.000000, -8.852858, 2.083526, 1.000000, 0.600000, 0.483526] test_list.append(species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND) # 2 species (1 eq) primitive venturi mixing @@ -1458,8 +1499,7 @@ def main(): species2_primitiveVenturi.cfg_dir = "species_transport/venturi_primitive_3species" species2_primitiveVenturi.cfg_file = "species2_primitiveVenturi.cfg" species2_primitiveVenturi.test_iter = 50 - species2_primitiveVenturi.test_vals = [-6.004340, -5.236017, -5.080329, -5.888785, -1.554476, -6.076144, 5.000000, -0.808416, 5.000000, -2.325030, 5.000000, -0.238222, 0.000089, 0.000088, 0.000001, 0.000000] - species2_primitiveVenturi.new_output = True + species2_primitiveVenturi.test_vals = [-5.641112, -4.724266, -4.677148, -5.470711, -1.121455, -5.713132, 5.000000, -0.830412, 5.000000, -2.668654, 5.000000, -0.454161, 0.000092, 0.000091, 0.000001, 0.000000] test_list.append(species2_primitiveVenturi) # 2 species (1 eq) primitive venturi mixing with bounded scalar transport @@ -1467,8 +1507,7 @@ def main(): species_primitiveVenturi_boundedscalar.cfg_dir = "species_transport/venturi_primitive_3species" species_primitiveVenturi_boundedscalar.cfg_file = "species2_primitiveVenturi_boundedscalar.cfg" species_primitiveVenturi_boundedscalar.test_iter = 50 - species_primitiveVenturi_boundedscalar.test_vals = [-5.297585, -4.397797, -4.377086, -5.593131, -1.011782, -5.623540, 5.000000, -1.775123, 5.000000, -4.086339, 5.000000, -2.080187, 0.000424, 0.000424, 0.000000, 0.000000] - species_primitiveVenturi_boundedscalar.new_output = True + species_primitiveVenturi_boundedscalar.test_vals = [-5.278467, -4.368236, -4.350556, -5.693359, -0.978845, -5.618393, 5.000000, -1.804015, 5.000000, -4.057089, 5.000000, -2.003816, 0.000415, 0.000415, 0.000000, 0.000000] test_list.append(species_primitiveVenturi_boundedscalar) # 2 species (1 eq) primitive venturi mixing using mixing model including inlet markers for turbulent intensity and viscosity ratios @@ -1476,11 +1515,7 @@ def main(): species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.cfg_dir = "species_transport/venturi_primitive_3species" species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.cfg_file = "species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.cfg" species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.test_iter = 50 - species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.test_vals = [-4.019621, -1.652733, -1.414138, -0.971744, 1.590456, -3.762843, 23.000000, -5.066221, 12.000000, -5.359931, 4.000000, -6.078888, 2.000000, 1.000000, 0.000000, 1.000000] - species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.su2_exec = "mpirun -n 2 SU2_CFD" - species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.timeout = 1600 - species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.new_output = True - species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.tol = 0.00001 + species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.test_vals = [-4.026294, -1.649804, -1.404882, -0.746005, 1.609256, -3.767237, 23.000000, -5.082019, 10.000000, -5.056739, 4.000000, -6.480965, 2.000000, 1.000000, 0.000000, 1.000000] test_list.append(species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS) # 3 species (2 eq) primitive venturi mixing with inlet files. @@ -1489,8 +1524,7 @@ def main(): species3_primitiveVenturi_inletFile.cfg_dir = "species_transport/venturi_primitive_3species" species3_primitiveVenturi_inletFile.cfg_file = "species3_primitiveVenturi_inletFile.cfg" species3_primitiveVenturi_inletFile.test_iter = 50 - species3_primitiveVenturi_inletFile.test_vals = [-6.074971, -5.306648, -5.150960, -5.959416, -1.625107, -6.343704, -6.460033, 5.000000, -0.808413, 5.000000, -2.325029, 5.000000, -0.274923] - species3_primitiveVenturi_inletFile.new_output = True + species3_primitiveVenturi_inletFile.test_vals = [-5.711734, -4.794814, -4.747694, -5.541323, -1.192017, -5.951964, -6.096677, 5.000000, -0.830172, 5.000000, -2.668819, 5.000000, -0.516308] test_list.append(species3_primitiveVenturi_inletFile) # rectangle passive transport validation @@ -1500,7 +1534,6 @@ def main(): species_passive_val.test_iter = 50 species_passive_val.test_vals = [-16.559189, -16.315116, -16.908670, -4.257599, 10, -4.523292, 8, -5.19335, 0.18661, 0] species_passive_val.test_vals_aarch64 = [-16.538551, -16.312552, -16.882823, -4.257599, 10, -4.585464, 8, -5.19335, 0.18661, 0] - species_passive_val.new_output = True test_list.append(species_passive_val) # species transport, 3 species with multizone (2 fluid regions) @@ -1508,8 +1541,7 @@ def main(): species3_multizone_restart.cfg_dir = "species_transport/multizone" species3_multizone_restart.cfg_file = "configMaster.cfg" species3_multizone_restart.test_iter = 5 - species3_multizone_restart.test_vals = [-7.169637, -6.381576] - species3_multizone_restart.new_output = True + species3_multizone_restart.test_vals = [-6.175178, -5.763030] species3_multizone_restart.multizone = True test_list.append(species3_multizone_restart) @@ -1531,6 +1563,25 @@ def main(): pass_list = [ test.run_test() for test in test_list ] + ###################################### + ### RUN CHT TEST WITH FILEDIFF ### + ###################################### + + # 2D planar laminar premixed methane flame on isothermal burner with conjugate heat transfer in cooling fin (restart) + cfd_flamelet_ch4_cht = TestCase('cfd_flamelet_ch4_cht') + cfd_flamelet_ch4_cht.cfg_dir = "flamelet/03_laminar_premixed_ch4_flame_cht_cfd" + cfd_flamelet_ch4_cht.cfg_file = "lam_prem_ch4_cht_cfd_master.cfg" + cfd_flamelet_ch4_cht.test_iter = 10 + cfd_flamelet_ch4_cht.command = TestCase.Command("mpirun -n 2", "SU2_CFD") + cfd_flamelet_ch4_cht.timeout = 1600 + cfd_flamelet_ch4_cht.reference_file = "restart_0.csv.ref" + cfd_flamelet_ch4_cht.test_file = "restart_0.csv" + cfd_flamelet_ch4_cht.multizone = True + cfd_flamelet_ch4_cht.comp_threshold = 1e-6 + cfd_flamelet_ch4_cht.tol_file_percent = 0.1 + pass_list.append(cfd_flamelet_ch4_cht.run_filediff()) + test_list.append(cfd_flamelet_ch4_cht) + ###################################### ### RUN SU2_SOL TESTS ### ###################################### diff --git a/TestCases/parallel_regression_AD.py b/TestCases/parallel_regression_AD.py index 16051fe71fc..10a28c974e1 100644 --- a/TestCases/parallel_regression_AD.py +++ b/TestCases/parallel_regression_AD.py @@ -3,7 +3,7 @@ ## \file parallel_regression.py # \brief Python script for automated regression testing of SU2 examples # \author A. Aranake, A. Campos, T. Economon, T. Lukaczyk, S. Padron -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -83,7 +83,7 @@ def main(): discadj_rans_naca0012_sa.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" discadj_rans_naca0012_sa.test_iter = 10 - discadj_rans_naca0012_sa.test_vals = [-2.230578, 0.645001, 0.181590, -0.000018, 5.000000, -3.421214, 5.000000, -6.769609] + discadj_rans_naca0012_sa.test_vals = [-2.230568, 0.644202, 0.181590, -0.000018, 5.000000, -3.421717, 5.000000, -6.769530] test_list.append(discadj_rans_naca0012_sa) # Adjoint turbulent NACA0012 SST @@ -91,8 +91,8 @@ def main(): discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 - discadj_rans_naca0012_sst.test_vals = [-2.221792, -0.491538, 0.182010, -0.000018] - discadj_rans_naca0012_sst.test_vals_aarch64 = [-2.221795, -0.491538, 0.182010, -0.000018] + discadj_rans_naca0012_sst.test_vals = [-2.221848, -0.502430, 0.182000, -0.000018] + discadj_rans_naca0012_sst.test_vals_aarch64 = [-2.221848, -0.502430, 0.182000, -0.000018] test_list.append(discadj_rans_naca0012_sst) ####################################### @@ -137,8 +137,8 @@ def main(): discadj_incomp_turb_NACA0012_sst.cfg_dir = "disc_adj_incomp_rans/naca0012" discadj_incomp_turb_NACA0012_sst.cfg_file = "turb_naca0012_sst.cfg" discadj_incomp_turb_NACA0012_sst.test_iter = 10 - discadj_incomp_turb_NACA0012_sst.test_vals = [-3.845593, -2.413098, -8.419991, 0.000000] - discadj_incomp_turb_NACA0012_sst.test_vals_aarch64 = [-3.845595, -2.413099, -8.419992, 0.000000] + discadj_incomp_turb_NACA0012_sst.test_vals = [-4.183391, -2.287284, -7.892044, 0, -1.230919] + discadj_incomp_turb_NACA0012_sst.test_vals_aarch64 = [-4.183391, -2.287284, -7.892044, 0, -1.230919] test_list.append(discadj_incomp_turb_NACA0012_sst) #################################################################### @@ -150,7 +150,7 @@ def main(): discadj_axisymmetric_rans_nozzle.cfg_dir = "axisymmetric_rans/air_nozzle" discadj_axisymmetric_rans_nozzle.cfg_file = "air_nozzle_restart.cfg" discadj_axisymmetric_rans_nozzle.test_iter = 10 - discadj_axisymmetric_rans_nozzle.test_vals = [9.523445, 5.023948, 7.509000, 2.841876, 0.000000, -246139999999999992659968.000000] + discadj_axisymmetric_rans_nozzle.test_vals = [9.516464, 5.022130, 7.370705, 2.744551] discadj_axisymmetric_rans_nozzle.no_restart = True test_list.append(discadj_axisymmetric_rans_nozzle) @@ -230,7 +230,8 @@ def main(): discadj_trans_stator.cfg_dir = "disc_adj_turbomachinery/transonic_stator_2D" discadj_trans_stator.cfg_file = "transonic_stator.cfg" discadj_trans_stator.test_iter = 79 - discadj_trans_stator.test_vals = [79.000000, -1.941681, -1.984570] + discadj_trans_stator.test_vals = [79, 0.769972, 0.374328, 0.474458, -0.996522, 2.154079, -4.446062] + discadj_trans_stator.test_vals_aarch64 = [79.000000, 0.769908, 0.374328, 0.474687, -0.996522, 2.154079, -4.446062] test_list.append(discadj_trans_stator) ################################### @@ -242,8 +243,8 @@ def main(): discadj_fea.cfg_dir = "disc_adj_fea" discadj_fea.cfg_file = "configAD_fem.cfg" discadj_fea.test_iter = 4 - discadj_fea.test_vals = [-2.849774, -3.238669, -0.000364, -8.708700] #last 4 columns - discadj_fea.test_vals_aarch64 = [-2.849726, -3.238594, -0.000364, -8.708700] #last 4 columns + discadj_fea.test_vals = [-2.849453, -3.238429, -0.000364, -8.708700] #last 4 columns + discadj_fea.test_vals_aarch64 = [-2.849573, -3.238516, -0.000364, -8.708700] #last 4 columns test_list.append(discadj_fea) ################################### @@ -255,8 +256,8 @@ def main(): discadj_heat.cfg_dir = "disc_adj_heat" discadj_heat.cfg_file = "disc_adj_heat.cfg" discadj_heat.test_iter = 10 - discadj_heat.test_vals = [-2.226525, 0.603989, 0.000000, -6.256200] - discadj_heat.test_vals_aarch64 = [-2.226525, 0.603989, 0.000000, -6.256200] + discadj_heat.test_vals = [-2.226539, 0.605868, 0.000000, -6.256400] + discadj_heat.test_vals_aarch64 = [-2.226539, 0.605868, 0.000000, -6.256400] test_list.append(discadj_heat) ################################### @@ -268,7 +269,7 @@ def main(): discadj_fsi.cfg_dir = "disc_adj_fsi" discadj_fsi.cfg_file = "config.cfg" discadj_fsi.test_iter = 6 - discadj_fsi.test_vals = [6.000000, -1.559957, -3.080711, 0.000440, -1.063100] + discadj_fsi.test_vals = [6.000000, -1.949946, -3.080711, 0.000440, -1.063100] test_list.append(discadj_fsi) # Multi physics framework @@ -276,9 +277,9 @@ def main(): discadj_fsi2.cfg_dir = "disc_adj_fsi/Airfoil_2d" discadj_fsi2.cfg_file = "config.cfg" discadj_fsi2.test_iter = 8 - discadj_fsi2.test_vals = [-3.479484, 0.127482, -1.303589, 7.5407e-09, 2.3244] - discadj_fsi2.test_vals_aarch64 = [-3.479505, 0.127953, -1.303589, 7.5407e-09, 2.3244] - discadj_fsi2.tol = 1e-16 + discadj_fsi2.test_vals = [-4.349377, 0.192713, -1.303589, 0.75407, 2.3244] + discadj_fsi2.test_vals_aarch64 = [-4.349372, 0.190601, -1.303589, 0.754070, 2.324400] + discadj_fsi2.tol = 0.00001 test_list.append(discadj_fsi2) ################################### @@ -290,7 +291,7 @@ def main(): discadj_cht.cfg_dir = "coupled_cht/disc_adj_incomp_2d" discadj_cht.cfg_file = "cht_2d_3cylinders.cfg" discadj_cht.test_iter = 10 - discadj_cht.test_vals = [-2.364408, -3.085549, -3.085516, -3.085511] + discadj_cht.test_vals = [-2.955510, -3.085549, -3.085516, -3.085511] test_list.append(discadj_cht) # 2D DA cht streamwise periodic case, 2 zones, avg temp objective @@ -298,7 +299,7 @@ def main(): da_sp_pinArray_cht_2d_dp_hf.cfg_dir = "incomp_navierstokes/streamwise_periodic/chtPinArray_2d" da_sp_pinArray_cht_2d_dp_hf.cfg_file = "DA_configMaster.cfg" da_sp_pinArray_cht_2d_dp_hf.test_iter = 100 - da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.800597, -4.065541, -4.137339] + da_sp_pinArray_cht_2d_dp_hf.test_vals = [-4.743218, -4.059800, -4.138231] da_sp_pinArray_cht_2d_dp_hf.multizone = True test_list.append(da_sp_pinArray_cht_2d_dp_hf) @@ -307,7 +308,7 @@ def main(): da_sp_pinArray_cht_2d_mf.cfg_dir = "incomp_navierstokes/streamwise_periodic/dp-adjoint_chtPinArray_2d" da_sp_pinArray_cht_2d_mf.cfg_file = "configMaster.cfg" da_sp_pinArray_cht_2d_mf.test_iter = 100 - da_sp_pinArray_cht_2d_mf.test_vals = [-4.609362, -1.273845, -1.502739, -18.503852, -0.834361, -5.813325, -19.074376, -48.287501] + da_sp_pinArray_cht_2d_mf.test_vals = [-4.611237, -1.290668, -1.453678, -18.507826, -0.859013, -5.755971, -19.067984, -47.993931] da_sp_pinArray_cht_2d_mf.multizone = True test_list.append(da_sp_pinArray_cht_2d_mf) @@ -340,6 +341,77 @@ def main(): pass_list = [ test.run_test() for test in test_list ] + ################################## + ### Disc. adj. flamelet solver ### + ################################## + + # 2D planar laminar premixed flame on isothermal burner (restart) + discadj_flamelet_ch4_hx = TestCase('discadj_flamelet_ch4_hx') + discadj_flamelet_ch4_hx.command = TestCase.Command("mpirun -n 2", "SU2_CFD_AD") + discadj_flamelet_ch4_hx.cfg_dir = "flamelet/02_laminar_premixed_ch4_flame_hx_ad" + discadj_flamelet_ch4_hx.cfg_file = "lam_prem_ch4_hx_ad.cfg" + discadj_flamelet_ch4_hx.multizone = False + discadj_flamelet_ch4_hx.test_iter = 10 + discadj_flamelet_ch4_hx.timeout = 20000 + discadj_flamelet_ch4_hx.reference_file = "restart_adj_custom.csv.ref" + discadj_flamelet_ch4_hx.test_file = "restart_adj_custom.csv" + discadj_flamelet_ch4_hx.comp_threshold = 1e-6 + discadj_flamelet_ch4_hx.tol_file_percent = 0.1 + pass_list.append(discadj_flamelet_ch4_hx.run_filediff()) + test_list.append(discadj_flamelet_ch4_hx) + + # 2D planar laminar premixed flame on isothermal burner with conjugate heat transfer (restart) + discadj_flamelet_ch4_cht = TestCase('discadj_flamelet_ch4_cht') + discadj_flamelet_ch4_cht.command = TestCase.Command("mpirun -n 2", "SU2_CFD_AD") + discadj_flamelet_ch4_cht.cfg_dir = "flamelet/04_laminar_premixed_ch4_flame_cht_ad" + discadj_flamelet_ch4_cht.cfg_file = "lam_prem_ch4_cht_ad_master.cfg" + discadj_flamelet_ch4_cht.multizone = True + discadj_flamelet_ch4_cht.test_iter = 5 + discadj_flamelet_ch4_cht.reference_file = "restart_adj_T_0.csv.ref" + discadj_flamelet_ch4_cht.test_file = "restart_adj_T_0.csv" + discadj_flamelet_ch4_cht.comp_threshold = 1e-6 + discadj_flamelet_ch4_cht.tol_file_percent = 0.1 + discadj_flamelet_ch4_cht.timeout = 20000 + pass_list.append(discadj_flamelet_ch4_cht.run_filediff()) + test_list.append(discadj_flamelet_ch4_cht) + + ################################################ + ### Gradient check (dot) for flamelet solver ### + ################################################ + + # 2D planar laminar premixed flame on isothermal burner (restart) + # This test restarts on the output of test discadj_flamelet_ch4_hx and + # will only pass if test discadj_flamelet_ch4_hx passes. + dot_flamelet_ch4_hx = TestCase('dot_flamelet_ch4_hx') + dot_flamelet_ch4_hx.cfg_dir = "flamelet/02_laminar_premixed_ch4_flame_hx_ad" + dot_flamelet_ch4_hx.cfg_file = "lam_prem_ch4_hx_dot.cfg" + dot_flamelet_ch4_hx.test_iter = 10 + dot_flamelet_ch4_hx.command = TestCase.Command("mpirun -n 2", "SU2_DOT_AD") + dot_flamelet_ch4_hx.timeout = 20000 + dot_flamelet_ch4_hx.reference_file = "of_grad.csv.ref" + dot_flamelet_ch4_hx.test_file = "of_grad.csv" + dot_flamelet_ch4_hx.comp_threshold = 1e-6 + dot_flamelet_ch4_hx.tol_file_percent = 0.1 + pass_list.append(dot_flamelet_ch4_hx.run_filediff()) + test_list.append(dot_flamelet_ch4_hx) + + # 2D planar laminar premixed flame on isothermal burner with conjugate heat transfer (restart) + # This test restarts on the output of test discadj_flamelet_ch4_cht and + # will only pass if test discadj_flamelet_ch4_cht passes. + dot_flamelet_ch4_cht = TestCase('dot_flamelet_ch4_cht') + dot_flamelet_ch4_cht.cfg_dir = "flamelet/04_laminar_premixed_ch4_flame_cht_ad" + dot_flamelet_ch4_cht.cfg_file = "lam_prem_ch4_cht_dot_master.cfg" + dot_flamelet_ch4_cht.multizone = True + dot_flamelet_ch4_cht.test_iter = 10 + dot_flamelet_ch4_cht.command = TestCase.Command("mpirun -n 2", "SU2_DOT_AD") + dot_flamelet_ch4_cht.timeout = 20000 + dot_flamelet_ch4_cht.reference_file = "of_grad.csv.ref" + dot_flamelet_ch4_cht.test_file = "of_grad.csv" + dot_flamelet_ch4_cht.comp_threshold = 1e-6 + dot_flamelet_ch4_cht.tol_file_percent = 0.1 + pass_list.append(dot_flamelet_ch4_cht.run_filediff()) + test_list.append(dot_flamelet_ch4_cht) + ################################################## ### Structural Adjoint - Topology Optimization ### ################################################## @@ -391,6 +463,75 @@ def main(): pass_list.append(unsteady_naca0012.run_filediff()) test_list.append(unsteady_naca0012) + #################################################################### + ### Python Wrapper ### + #################################################################### + + # FEA AD Flow Load Sensitivity + pywrapper_FEA_AD_FlowLoad = TestCase('pywrapper_FEA_AD_FlowLoad') + pywrapper_FEA_AD_FlowLoad.cfg_dir = "py_wrapper/disc_adj_fea/flow_load_sens" + pywrapper_FEA_AD_FlowLoad.cfg_file = "configAD_fem.cfg" + pywrapper_FEA_AD_FlowLoad.test_iter = 100 + pywrapper_FEA_AD_FlowLoad.test_vals = [-0.13945587401785386, -0.5859858866132448, -0.00036377840086080694, -0.0031005670174756366] #last 4 columns + pywrapper_FEA_AD_FlowLoad.command = TestCase.Command("mpirun -n 2", "python", "run_adjoint.py --parallel -f") + pywrapper_FEA_AD_FlowLoad.timeout = 1600 + pywrapper_FEA_AD_FlowLoad.tol = 0.000001 + pywrapper_FEA_AD_FlowLoad.new_output = False + test_list.append(pywrapper_FEA_AD_FlowLoad) + pass_list.append(pywrapper_FEA_AD_FlowLoad.run_test()) + + # FEA unsteady AD Load Sensitivity + pywrapper_Unst_FEA_AD = TestCase('pywrapper_Unst_FEA_AD') + pywrapper_Unst_FEA_AD.cfg_dir = "py_wrapper/custom_load_fea" + pywrapper_Unst_FEA_AD.cfg_file = "config.cfg" + pywrapper_Unst_FEA_AD.test_iter = 100 + pywrapper_Unst_FEA_AD.test_vals = [0.256684, 0.256684, 0.319877, 0.320149, -0.184491, -0.184509] + pywrapper_Unst_FEA_AD.command = TestCase.Command("mpirun -n 2", "python", "run_ad.py") + pywrapper_Unst_FEA_AD.timeout = 1600 + pywrapper_Unst_FEA_AD.tol = 0.00001 + pywrapper_Unst_FEA_AD.new_output = False + test_list.append(pywrapper_Unst_FEA_AD) + pass_list.append(pywrapper_Unst_FEA_AD.run_test()) + + # Heat solver unsteady AD + pywrapper_Unst_Heat_AD = TestCase('pywrapper_Unst_Heat_AD') + pywrapper_Unst_Heat_AD.cfg_dir = "py_wrapper/custom_heat_flux" + pywrapper_Unst_Heat_AD.cfg_file = "run_ad.py" + pywrapper_Unst_Heat_AD.test_iter = 100 + pywrapper_Unst_Heat_AD.test_vals = [0.776365, 0.776430, 1.000003] + pywrapper_Unst_Heat_AD.command = TestCase.Command("mpirun -n 2", "python", "run_ad.py") + pywrapper_Unst_Heat_AD.timeout = 1600 + pywrapper_Unst_Heat_AD.tol = 0.00001 + pywrapper_Unst_Heat_AD.new_output = False + test_list.append(pywrapper_Unst_Heat_AD) + pass_list.append(pywrapper_Unst_Heat_AD.run_test()) + + # Flow AD Mesh Displacement Sensitivity + pywrapper_CFD_AD_MeshDisp = TestCase('pywrapper_CFD_AD_MeshDisp') + pywrapper_CFD_AD_MeshDisp.cfg_dir = "py_wrapper/disc_adj_flow/mesh_disp_sens" + pywrapper_CFD_AD_MeshDisp.cfg_file = "configAD_flow.cfg" + pywrapper_CFD_AD_MeshDisp.test_iter = 1000 + pywrapper_CFD_AD_MeshDisp.test_vals = [30.000000, -2.520972485907894, 1.3848377455328362, 0.000000] #last 4 columns + pywrapper_CFD_AD_MeshDisp.command = TestCase.Command("mpirun -n 2", "python", "run_adjoint.py --parallel -f") + pywrapper_CFD_AD_MeshDisp.timeout = 1600 + pywrapper_CFD_AD_MeshDisp.tol = 0.000001 + pywrapper_CFD_AD_MeshDisp.new_output = False + test_list.append(pywrapper_CFD_AD_MeshDisp) + pass_list.append(pywrapper_CFD_AD_MeshDisp.run_test()) + + # Flow AD Mesh Displacement and Initial Coordinates Sensitivity + pywrapper_wavy_wall_steady = TestCase('pywrapper_wavy_wall_steady') + pywrapper_wavy_wall_steady.cfg_dir = "py_wrapper/wavy_wall" + pywrapper_wavy_wall_steady.cfg_file = "run_steady.py" + pywrapper_wavy_wall_steady.test_iter = 100 + pywrapper_wavy_wall_steady.test_vals = [-1.360044, 2.580709, -2.892473] + pywrapper_wavy_wall_steady.command = TestCase.Command("mpirun -n 2", "python", "run_steady.py") + pywrapper_wavy_wall_steady.timeout = 1600 + pywrapper_wavy_wall_steady.tol = 0.00001 + pywrapper_wavy_wall_steady.new_output = False + test_list.append(pywrapper_wavy_wall_steady) + pass_list.append(pywrapper_wavy_wall_steady.run_test()) + #################################################################### ### Unsteady Disc. adj. compressible RANS restart optimization ### #################################################################### diff --git a/TestCases/pastix_support/config.cfg b/TestCases/pastix_support/config.cfg index 7c19a368716..a715bf34e94 100644 --- a/TestCases/pastix_support/config.cfg +++ b/TestCases/pastix_support/config.cfg @@ -2,7 +2,7 @@ % SU2 configuration file % % PaStiX options (http://pastix.gforge.inria.fr/files/README-txt.html) % % Institution: Imperial College London % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Intro: diff --git a/TestCases/pastix_support/readme.txt b/TestCases/pastix_support/readme.txt index 96736aeba43..a4eb59a2d3a 100644 --- a/TestCases/pastix_support/readme.txt +++ b/TestCases/pastix_support/readme.txt @@ -2,7 +2,7 @@ % SU2 configuration file % % PaStiX support build instructions. % % Institution: Imperial College London % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % 1 - Download diff --git a/TestCases/polar/naca0012/inv_NACA0012.cfg b/TestCases/polar/naca0012/inv_NACA0012.cfg index 663f763adfa..1a9275c6ba2 100644 --- a/TestCases/polar/naca0012/inv_NACA0012.cfg +++ b/TestCases/polar/naca0012/inv_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.11 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -75,15 +75,11 @@ MG_DAMP_PROLONGATION= 1.0 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT % ---------------- ADJOINT-FLOW NUMERICAL METHOD DEFINITION -------------------% CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_JST_SENSOR_COEFF= ( 0.5, 0.02 ) CFL_REDUCTION_ADJFLOW= 0.5 TIME_DISCRE_ADJFLOW= EULER_IMPLICIT diff --git a/TestCases/py_wrapper/custom_heat_flux/run_ad.py b/TestCases/py_wrapper/custom_heat_flux/run_ad.py new file mode 100644 index 00000000000..7985e4ff5a2 --- /dev/null +++ b/TestCases/py_wrapper/custom_heat_flux/run_ad.py @@ -0,0 +1,252 @@ +#!/usr/bin/env python + +## \file run.py +# \brief Unsteady adjoint heat transfer case with custom heat flux. +# \version 8.0.0 "Harrier" +# +# SU2 Project Website: https://su2code.github.io +# +# The SU2 Project is maintained by the SU2 Foundation +# (http://su2foundation.org) +# +# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) +# +# SU2 is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# SU2 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with SU2. If not, see . + +import pysu2ad +from mpi4py import MPI + +common_settings = """ +SOLVER= HEAT_EQUATION +INC_NONDIM= DIMENSIONAL + +TIME_DOMAIN= YES +TIME_STEP= 0.05 +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER + +FREESTREAM_TEMPERATURE= 345 +MATERIAL_DENSITY= 2700 +SPECIFIC_HEAT_CP = 870 +% Very high value to make the case more interesting. +THERMAL_CONDUCTIVITY_CONSTANT= 1000 + +MARKER_HEATFLUX= ( x_minus, 0, x_plus, 0, y_minus, 0, y_plus, 0 ) +MARKER_PYTHON_CUSTOM= ( x_minus, x_plus, y_minus, y_plus ) +MARKER_MONITORING= ( x_minus, x_plus, y_minus, y_plus ) + +NUM_METHOD_GRAD= GREEN_GAUSS +CFL_NUMBER= 1e8 + +LINEAR_SOLVER= CONJUGATE_GRADIENT +DISCADJ_LIN_SOLVER= CONJUGATE_GRADIENT +LINEAR_SOLVER_PREC= ILU +DISCADJ_LIN_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-5 +LINEAR_SOLVER_ITER= 100 + +MESH_FORMAT= RECTANGLE +MESH_BOX_SIZE= ( 33, 33, 0 ) +MESH_BOX_LENGTH= ( __SIZE__, __SIZE__, 0 ) + +OUTPUT_FILES= RESTART, PARAVIEW +OUTPUT_WRT_FREQ= 1 +OBJECTIVE_FUNCTION= AVG_TEMPERATURE + +INNER_ITER= 20 +CONV_RESIDUAL_MINVAL= -4 +CONV_STARTITER= 2 +MAX_TIME= 2.0 +TIME_ITER= 41 +""" + +primal_settings = """ +MATH_PROBLEM= DIRECT +SCREEN_OUTPUT= TIME_ITER, CUR_TIME, INNER_ITER, RMS_RES, LINSOL, AVG_TEMPERATURE, TAVG_AVG_TEMPERATURE +HISTORY_OUTPUT= ITER, RMS_RES, HEAT, TAVG_HEAT +""" + +adjoint_settings = """ +MATH_PROBLEM= DISCRETE_ADJOINT +SCREEN_OUTPUT= TIME_ITER, CUR_TIME, INNER_ITER, RMS_RES, LINSOL +UNST_ADJOINT_ITER= 41 +% Only interested in the final value of the objective. +ITER_AVERAGE_OBJ= 1 +SOLUTION_FILENAME= restart.dat +VOLUME_OUTPUT= SOLUTION, SENSITIVITY, SENSITIVITY_N +""" + + +def ApplyHeatFlux(time, driver, marker_ids): + """Applies a heat flux on all boundaries for a period of time and then removes it.""" + for marker_id in marker_ids: + if marker_id < 0: + continue + hf = (-1 * 2700 * 870, 0)[time > 0.2] + for i_vertex in range(driver.GetNumberMarkerNodes(marker_id)): + driver.SetMarkerCustomNormalHeatFlux(marker_id, i_vertex, hf) + + +def RunPrimal(size): + """ + Run the heat solver with a custom heat (function of time) flux on all boundaries. + Returns the final average boundary temperature. + """ + comm = MPI.COMM_WORLD + rank = comm.Get_rank() + + if rank == 0: + with open('config_unsteady.cfg', 'w') as f: + f.write(common_settings.replace('__SIZE__', str(size)) + primal_settings) + comm.Barrier() + + # Initialize the primal driver of SU2, this includes solver preprocessing. + try: + driver = pysu2ad.CSinglezoneDriver('config_unsteady.cfg', 1, comm) + except TypeError as exception: + print('A TypeError occured in pysu2ad.CSinglezoneDriver : ', exception) + raise + + # Get the ID of the markers where the heat flux is applied. + all_marker_ids = driver.GetMarkerIndices() + marker_names = ['x_minus', 'x_plus', 'y_minus', 'y_plus'] + marker_ids = [] + for name in marker_names: + marker_ids.append(all_marker_ids[name] if name in all_marker_ids else -1) + + # Run the time loop in python to vary the heat flux. + dt = driver.GetUnsteadyTimeStep() + + for time_iter in range(driver.GetNumberTimeIter()): + # Custom heat flux. + ApplyHeatFlux(time_iter * dt, driver, marker_ids) + + driver.Preprocess(time_iter) + + # Run one time iteration. + driver.Run() + driver.Postprocess() + driver.Update() + + # Monitor the solver and output solution to file if required. + driver.Monitor(time_iter) + driver.Output(time_iter) + + # Get the final average temperature. + avg_temperature = driver.GetOutputValue('AVG_TEMPERATURE') + + # Finalize the solver and exit cleanly. + driver.Finalize() + + return avg_temperature + + +def RunAdjoint(size): + """ + Runs the adjoint heat solver and returns the sensitivity of the objective function to + size of the domain and to the initial temperature. + """ + comm = MPI.COMM_WORLD + rank = comm.Get_rank() + + if rank == 0: + with open('config_unsteady_ad.cfg', 'w') as f: + f.write(common_settings.replace('__SIZE__', str(size)) + adjoint_settings) + comm.Barrier() + + # Initialize the adjoint driver of SU2, this includes solver preprocessing. + try: + driver = pysu2ad.CDiscAdjSinglezoneDriver('config_unsteady_ad.cfg', 1, comm) + except TypeError as exception: + print('A TypeError occured in pysu2ad.CDiscAdjSinglezoneDriver : ', exception) + raise + + # Get the ID of the markers where the heat flux is applied. + all_marker_ids = driver.GetMarkerIndices() + marker_names = ['x_minus', 'x_plus', 'y_minus', 'y_plus'] + marker_ids = [] + for name in marker_names: + marker_ids.append(all_marker_ids[name] if name in all_marker_ids else -1) + + # Run the time loop in python to vary the heat flux. + dt = driver.GetUnsteadyTimeStep() + + # Run the time loop in python to extract sensitivities at each step. + for time_iter in range(driver.GetNumberTimeIter()): + # Note that time runs in reverse for the adjoint solver. + ApplyHeatFlux((driver.GetNumberTimeIter() - time_iter - 1) * dt, driver, marker_ids) + + # Preprocess adjoint iteration (AD recording). + driver.Preprocess(time_iter) + + # Run one time iteration. + driver.Run() + driver.Postprocess() + driver.Update() + + # Monitor the solver and output solution to file if required. + driver.Monitor(time_iter) + driver.Output(time_iter) + + size_sens = 0.0 + temp_sens = 0.0 + sensitivity = driver.Sensitivity(driver.GetSolverIndices()['ADJ.HEAT']) + sens_n = driver.SolutionTimeN(driver.GetSolverIndices()['ADJ.HEAT']) + sens_n1 = driver.SolutionTimeN1(driver.GetSolverIndices()['ADJ.HEAT']) + coords = driver.Coordinates() + + for i_node in range(driver.GetNumberNodes() - driver.GetNumberHaloNodes()): + x, y = coords.Get(i_node) + dx_ds = x / size + dy_ds = y / size + size_sens += dx_ds * sensitivity(i_node, 0) + dy_ds * sensitivity(i_node, 1) + # For 2nd order BDF the initial conditions apply to time n and n-1, + # hence we combine the two sensitivities. n-1 is multiplied by 2 because + # the initial conditions are used as the n-1 solution twice (in the 1st and + # second iterations). However, note that this is an approximation, the + # correct value would be sens_n_t0 + sens_n1_t0 + sens_n1_t1 (we approximate + # sens_n1 at t1 as sens_n1 at t0). + temp_sens += sens_n(i_node, 0) + 2 * sens_n1(i_node, 0) + + # Finalize the solver and exit cleanly. + driver.Finalize() + + return comm.allreduce(size_sens), comm.allreduce(temp_sens) + + +def main(): + comm = MPI.COMM_WORLD + rank = comm.Get_rank() + + obj_pert_size = RunPrimal(0.100005) + obj = RunPrimal(0.1) + sens_size_fd = (obj_pert_size - obj) / 0.000005 + + sens_size, sens_temp = RunAdjoint(0.1) + + if rank == 0: + print(" Finite Differences\tDiscrete Adjoint") + print(f"Size {sens_size_fd}\t{sens_size}") + + assert abs(sens_size / sens_size_fd - 1) < 1e-4, "Error in geometric derivatives." + # We expect the final average temperature to be directly proportional to the initial + # temperature since the applied heat flux is not a function of temperature. + assert abs(sens_temp - 1) < 1e-5, "Error in initial condition derivatives." + + # Print results for the regression script to check. + if rank == 0: + print("\n------------------------------ Begin Solver -----------------------------") + print(100, 100, sens_size_fd / 100, sens_size / 100, sens_temp) + +if __name__ == '__main__': + main() diff --git a/TestCases/py_wrapper/custom_load_fea/config.cfg b/TestCases/py_wrapper/custom_load_fea/config.cfg new file mode 100644 index 00000000000..45d6ef0e2b8 --- /dev/null +++ b/TestCases/py_wrapper/custom_load_fea/config.cfg @@ -0,0 +1,32 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% SU2 configuration file % +% Case description: 2D Beam with custom load via Python wrapper % +% File Version 8.0.0 "Harrier" % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +SOLVER= ELASTICITY +GEOMETRIC_CONDITIONS= LARGE_DEFORMATIONS +FORMULATION_ELASTICITY_2D= PLANE_STRESS + +MATERIAL_MODEL= NEO_HOOKEAN +ELASTICITY_MODULUS= 10000 +POISSON_RATIO= 0.3 + +MARKER_CLAMPED= ( x_minus ) +MARKER_FLUID_LOAD= ( x_plus, y_minus, y_plus ) + +LINEAR_SOLVER= CONJUGATE_GRADIENT +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-6 +LINEAR_SOLVER_ITER= 100 + +MESH_FORMAT= RECTANGLE +MESH_BOX_SIZE= ( 17, 5, 0 ) +MESH_BOX_LENGTH= ( 0.5, 0.05, 0 ) + +OUTPUT_FILES= RESTART_ASCII, PARAVIEW +SCREEN_OUTPUT= INNER_ITER, RMS_RES, LINSOL, VMS + +INNER_ITER= 20 +CONV_FIELD= REL_RMS_RTOL +CONV_RESIDUAL_MINVAL= -6 diff --git a/TestCases/py_wrapper/custom_load_fea/run.py b/TestCases/py_wrapper/custom_load_fea/run.py new file mode 100755 index 00000000000..50567ddfc73 --- /dev/null +++ b/TestCases/py_wrapper/custom_load_fea/run.py @@ -0,0 +1,93 @@ +#!/usr/bin/env python + +## \file run.py +# \brief FEA case with custom load. +# \version 8.0.0 "Harrier" +# +# SU2 Project Website: https://su2code.github.io +# +# The SU2 Project is maintained by the SU2 Foundation +# (http://su2foundation.org) +# +# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) +# +# SU2 is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# SU2 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with SU2. If not, see . + +import pysu2 +from mpi4py import MPI + +def main(): + comm = MPI.COMM_WORLD + + # Initialize the corresponding driver of SU2, this includes solver preprocessing. + try: + SU2Driver = pysu2.CSinglezoneDriver('config.cfg', 1, comm) + except TypeError as exception: + print('A TypeError occured in pysu2.CDriver : ', exception) + raise + + # Get the ID of the marker we want to deform. + AllMarkerIDs = SU2Driver.GetMarkerIndices() + MarkerName = 'y_minus' + MarkerID = AllMarkerIDs[MarkerName] if MarkerName in AllMarkerIDs else -1 + + # Number of vertices on the specified marker (per rank). + nVertex = SU2Driver.GetNumberMarkerNodes(MarkerID) if MarkerID >= 0 else 0 + + # Apply a load based on the coordinates. + if nVertex > 0: + MarkerCoords = SU2Driver.MarkerCoordinates(MarkerID) + L = 0.5 + dx = L / 16 # known from mesh settings in this case. + for iVertex in range(nVertex): + x = MarkerCoords(iVertex, 0) + nodalForce = (2 * x / L) * dx + # Half load due to half dx on first and last node. + if abs(x) < 1e-6 or abs(x - L) < 1e-6: + nodalForce = nodalForce / 2 + SU2Driver.SetMarkerCustomFEALoad(MarkerID, iVertex, (0, nodalForce)) + + # Solve. + SU2Driver.StartSolver() + + # Find the tip displacement. + MarkerName = 'x_plus' + MarkerID = AllMarkerIDs[MarkerName] if MarkerName in AllMarkerIDs else -1 + nVertex = SU2Driver.GetNumberMarkerNodes(MarkerID) if MarkerID >= 0 else 0 + Disp = 0 + NodeFound = False + + if nVertex > 0: + MarkerCoords = SU2Driver.MarkerCoordinates(MarkerID) + SolverID = SU2Driver.GetSolverIndices()["FEA"] + Solution = SU2Driver.MarkerSolution(SolverID, MarkerID) + DispID = SU2Driver.GetFEASolutionIndices()["DISPLACEMENT_Y"] + + for iVertex in range(nVertex): + y = MarkerCoords(iVertex, 1) + if abs(y - 0.025) < 1e-6: + Disp = Solution(iVertex, DispID) + NodeFound = True + + if NodeFound: + print(f"Vertical displacement of tip: {Disp}") + # Test the value against expected. + assert abs(Disp / 0.095439 - 1) < 1e-5, "Test FAILED" + + # Finalize the solver and exit cleanly. + SU2Driver.Finalize() + + +if __name__ == '__main__': + main() diff --git a/TestCases/py_wrapper/custom_load_fea/run_ad.py b/TestCases/py_wrapper/custom_load_fea/run_ad.py new file mode 100644 index 00000000000..907264b39fd --- /dev/null +++ b/TestCases/py_wrapper/custom_load_fea/run_ad.py @@ -0,0 +1,256 @@ +#!/usr/bin/env python + +## \file run.py +# \brief Unsteady adjoint FEA case with custom load. +# \version 8.0.0 "Harrier" +# +# SU2 Project Website: https://su2code.github.io +# +# The SU2 Project is maintained by the SU2 Foundation +# (http://su2foundation.org) +# +# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) +# +# SU2 is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# SU2 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with SU2. If not, see . + +import pysu2ad +from mpi4py import MPI + +common_settings = """ +SOLVER= ELASTICITY +GEOMETRIC_CONDITIONS= LARGE_DEFORMATIONS +FORMULATION_ELASTICITY_2D= PLANE_STRESS + +TIME_DOMAIN= YES +TIME_STEP=0.01 +TIME_DISCRE_FEA= NEWMARK_IMPLICIT +NEWMARK_GAMMA= 0.5 +NEWMARK_BETA= 0.25 + +MATERIAL_MODEL= NEO_HOOKEAN +ELASTICITY_MODULUS= 10000 +POISSON_RATIO= 0.3 +MATERIAL_DENSITY= __DENSITY__ + +MARKER_CLAMPED= ( x_minus ) +MARKER_FLUID_LOAD= ( x_plus, y_minus, y_plus ) + +LINEAR_SOLVER= CONJUGATE_GRADIENT +DISCADJ_LIN_SOLVER= CONJUGATE_GRADIENT +LINEAR_SOLVER_PREC= ILU +DISCADJ_LIN_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-5 +LINEAR_SOLVER_ITER= 100 + +MESH_FORMAT= RECTANGLE +MESH_BOX_SIZE= ( 17, 5, 0 ) +MESH_BOX_LENGTH= ( 0.5, __HEIGHT__, 0 ) + +OUTPUT_FILES= RESTART, PARAVIEW +OUTPUT_WRT_FREQ= 1 +OBJECTIVE_FUNCTION= STRESS_PENALTY +STRESS_PENALTY_PARAM= ( 500, 20 ) + +INNER_ITER= 20 +CONV_RESIDUAL_MINVAL= -4 +CONV_STARTITER= 5 +MAX_TIME= 0.2 +TIME_ITER= 21 +""" + +primal_settings = """ +MATH_PROBLEM= DIRECT +SCREEN_OUTPUT= TIME_ITER, CUR_TIME, INNER_ITER, RMS_RES, LINSOL, VMS, STRESS_PENALTY, TAVG_STRESS_PENALTY +HISTORY_OUTPUT= ITER, RMS_RES, STRUCT_COEFF, TAVG_STRUCT_COEFF +CONV_FIELD= REL_RMS_RTOL +""" + +adjoint_settings = """ +MATH_PROBLEM= DISCRETE_ADJOINT +SCREEN_OUTPUT= TIME_ITER, CUR_TIME, INNER_ITER, ADJOINT_DISP_X, ADJOINT_DISP_Y, LINSOL, SENSITIVITY +CONV_FIELD= ADJOINT_DISP_X, ADJOINT_DISP_Y +FEA_ADVANCED_MODE= YES +UNST_ADJOINT_ITER= 21 +ITER_AVERAGE_OBJ= 0 +SOLUTION_FILENAME= restart.dat +VOLUME_OUTPUT= SOLUTION, SENSITIVITY, SENSITIVITY_N +""" + + +def ApplyLoad(driver, marker_id, peak_load): + """ + Apply a load based on the coordinates and return the derivatives + of the nodal forces with respect to the peak load. + """ + derivatives = [] + if marker_id < 0: return derivatives + + marker_coords = driver.MarkerCoordinates(marker_id) + l = 0.5 + dx = l / 16 # known from mesh settings in this case. + for i_vertex in range(driver.GetNumberMarkerNodes(marker_id)): + x = marker_coords(i_vertex, 0) + nodal_force = (peak_load * x / l) * dx + # Half load due to half dx on first and last node. + if abs(x) < 1e-6 or abs(x - l) < 1e-6: + nodal_force = nodal_force / 2 + driver.SetMarkerCustomFEALoad(marker_id, i_vertex, (0, nodal_force)) + derivatives.append(nodal_force / peak_load) + + return derivatives + + +def RunPrimal(density, peak_load, height): + """ + Runs the primal solver for a given density, peak load, and beam height. + Returns the time average objective function. + """ + comm = MPI.COMM_WORLD + rank = comm.Get_rank() + + if rank == 0: + with open('config_unsteady.cfg', 'w') as f: + f.write(common_settings.replace('__DENSITY__', str(density)).replace('__HEIGHT__', str(height)) + + primal_settings) + comm.Barrier() + + # Initialize the primal driver of SU2, this includes solver preprocessing. + try: + driver = pysu2ad.CSinglezoneDriver('config_unsteady.cfg', 1, comm) + except TypeError as exception: + print('A TypeError occured in pysu2ad.CSinglezoneDriver : ', exception) + raise + + # Get the ID of the marker where the load is applied. + all_marker_ids = driver.GetMarkerIndices() + marker_name = 'y_minus' + marker_id = all_marker_ids[marker_name] if marker_name in all_marker_ids else -1 + + # Apply a load based on the coordinates. + ApplyLoad(driver, marker_id, peak_load) + + # Solve. + driver.StartSolver() + + # Get the time average + tavg_stress_penalty = driver.GetOutputValue('TAVG_STRESS_PENALTY') + + # Finalize the solver and exit cleanly. + driver.Finalize() + + return tavg_stress_penalty + + +def RunAdjoint(density, peak_load, height): + """ + Runs the adjoint solver and returns the sensitivity of the objective function to the peak + load, to the material density, and to the beam height. + """ + comm = MPI.COMM_WORLD + rank = comm.Get_rank() + + if rank == 0: + with open('config_unsteady_ad.cfg', 'w') as f: + f.write(common_settings.replace('__DENSITY__', str(density)).replace('__HEIGHT__', str(height)) + + adjoint_settings) + comm.Barrier() + + # Initialize the adjoint driver of SU2, this includes solver preprocessing. + try: + driver = pysu2ad.CDiscAdjSinglezoneDriver('config_unsteady_ad.cfg', 1, comm) + except TypeError as exception: + print('A TypeError occured in pysu2ad.CDiscAdjSinglezoneDriver : ', exception) + raise + + # Get the ID of the marker where the load is applied. + all_marker_ids = driver.GetMarkerIndices() + marker_name = 'y_minus' + marker_id = all_marker_ids[marker_name] if marker_name in all_marker_ids else -1 + + # Apply the same load that was used in the primal problem. + derivatives = ApplyLoad(driver, marker_id, peak_load) + + n_vertex = driver.GetNumberMarkerNodes(marker_id) if marker_id >= 0 else 0 + load_sens = 0.0 + + # Run the time loop in python to extract sensitivities at each step. + for time_iter in range(driver.GetNumberTimeIter()): + # Preprocess adjoint iteration (AD recording). + driver.Preprocess(time_iter) + + # Run one time iteration. + driver.Run() + driver.Postprocess() + driver.Update() + + # Accumulate load sensitivies (the solver doesn't accumulate + # these for when they are used for FSI adjoints). + for i_vertex in range(n_vertex): + load_sens += derivatives[i_vertex] * driver.GetMarkerFEALoadSensitivity(marker_id, i_vertex)[1] + + # Monitor the solver and output solution to file if required. + driver.Monitor(time_iter) + driver.Output(time_iter) + + rho_sens = driver.GetOutputValue('SENS_RHO_0') + + height_sens = 0.0 + sensitivity = driver.Sensitivity(driver.GetSolverIndices()['ADJ.FEA']) + coords = driver.Coordinates() + + for i_node in range(driver.GetNumberNodes() - driver.GetNumberHaloNodes()): + y = coords(i_node, 1) + dy_dh = y / height + height_sens += dy_dh * sensitivity(i_node, 1) + + # Finalize the solver and exit cleanly. + driver.Finalize() + + return comm.allreduce(load_sens), rho_sens, comm.allreduce(height_sens) + + +def main(): + comm = MPI.COMM_WORLD + rank = comm.Get_rank() + + # Run the primal with 2 loads to compute the sensitivity via finite differences. + obj_pert_height = RunPrimal(1, 2, 0.05001) + obj_pert_load = RunPrimal(1, 2.002, 0.05) + obj_pert_rho = RunPrimal(1.0001, 2, 0.05) + # Run the un-perturbed last to use the restarts for the adjoint. + obj = RunPrimal(1, 2, 0.05) + sens_height_fd = (obj_pert_height - obj) / 0.00001 + sens_load_fd = (obj_pert_load - obj) / 0.002 + sens_rho_fd = (obj_pert_rho - obj) / 0.0001 + + sens_load, sens_rho, sens_height = RunAdjoint(1, 2, 0.05) + + if rank == 0: + print(" Finite Differences\tDiscrete Adjoint") + print(f"Height {sens_height_fd}\t{sens_height}") + print(f"Load {sens_load_fd}\t{sens_load}") + print(f"Rho {sens_rho_fd}\t{sens_rho}") + + assert abs(sens_height / sens_height_fd - 1) < 1e-4, "Error in geometric derivatives." + assert abs(sens_load / sens_load_fd - 1) < 1e-4, "Error in load derivative." + assert abs(sens_rho / sens_rho_fd - 1) < 1e-3, "Error in material derivative." + + # Print results for the regression script to check. + if rank == 0: + print("\n") + print(100, 100, sens_load_fd, sens_load, sens_rho_fd * 10, sens_rho * 10, sens_height_fd / 100, sens_height / 100) + + +if __name__ == '__main__': + main() diff --git a/TestCases/py_wrapper/deforming_bump_in_channel/config.cfg b/TestCases/py_wrapper/deforming_bump_in_channel/config.cfg new file mode 100644 index 00000000000..fcbb9a27710 --- /dev/null +++ b/TestCases/py_wrapper/deforming_bump_in_channel/config.cfg @@ -0,0 +1,72 @@ +% ------------------------------- SOLVER -------------------------------- % +% +SOLVER= EULER +% +% ----------------------------- FREESTREAM ------------------------------ % +% +MACH_NUMBER= 0.02 +AOA= 0.0 +FREESTREAM_OPTION= TEMPERATURE_FS +FREESTREAM_PRESSURE= 101325.0 +FREESTREAM_TEMPERATURE= 288.15 +% +% ------------------------- UNSTEADY SIMULATION ------------------------- % +% +TIME_DOMAIN= YES +TIME_MARCHING= DUAL_TIME_STEPPING-1ST_ORDER +% The time step is ~50x too large to obtain a quasi-steady solution for +% testing. +TIME_STEP= 0.5 +MAX_TIME= 5.0 +INNER_ITER= 500 +TIME_ITER= 2 +% +% ------------------------- BOUNDARY CONDITIONS ------------------------- % +% +MARKER_EULER= ( top, slip_bottom, bottom_front, interface, bottom_rear ) +MARKER_INLET= ( inlet, 288.6, 101400.0, 1.0, 0.0, 0.0 ) +MARKER_OUTLET= ( outlet, 101100.0 ) +MARKER_PLOTTING= ( interface ) +MARKER_MONITORING= ( interface ) +% +% -------------------------- MESH DEFORMATION --------------------------- % +% +DEFORM_MESH= YES +MARKER_DEFORM_MESH = ( interface ) +DEFORM_STIFFNESS_TYPE= INVERSE_VOLUME +DEFORM_LINEAR_SOLVER= CONJUGATE_GRADIENT +DEFORM_LINEAR_SOLVER_PREC= ILU +DEFORM_LINEAR_SOLVER_ITER= 200 +DEFORM_LINEAR_SOLVER_ERROR= 1e-9 +% DEFORM_CONSOLE_OUTPUT= YES +% +% ----------------------- SPATIAL DISCRETIZATION ------------------------ % +% +NUM_METHOD_GRAD= GREEN_GAUSS +CONV_NUM_METHOD_FLOW= ROE +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW= NONE +% +% ---------- PSEUDOTIME INTEGRATION / CONVERGENCE ACCELERATION ---------- % +% +TIME_DISCRE_FLOW= EULER_IMPLICIT +CFL_NUMBER= 500 +MGLEVEL= 0 +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 0.1 +LINEAR_SOLVER_ITER= 10 +% +% ------------------------ CONVERGENCE CRITERIA ------------------------- % +% +CONV_FIELD= RMS_DENSITY +CONV_RESIDUAL_MINVAL= -8 +% +% --------------------------- INPUT / OUTPUT ---------------------------- % +% +RESTART_SOL= NO +SCREEN_OUTPUT= ( TIME_ITER, CUR_TIME, INNER_ITER, RMS_RES, LIFT, DRAG ) +MESH_FILENAME= mesh.su2 +MESH_FORMAT= SU2 +OUTPUT_WRT_FREQ= (5) + diff --git a/TestCases/py_wrapper/deforming_bump_in_channel/run.py b/TestCases/py_wrapper/deforming_bump_in_channel/run.py new file mode 100755 index 00000000000..45c6e53b7d3 --- /dev/null +++ b/TestCases/py_wrapper/deforming_bump_in_channel/run.py @@ -0,0 +1,110 @@ +#!/usr/bin/env python + +## \file run.py +# \brief Deforming bump in channel. +# \version 8.0.0 "Harrier" +# +# SU2 Project Website: https://su2code.github.io +# +# The SU2 Project is maintained by the SU2 Foundation +# (http://su2foundation.org) +# +# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) +# +# SU2 is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# SU2 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with SU2. If not, see . + +import pysu2 +from mpi4py import MPI +import numpy as np + +def main(): + comm = MPI.COMM_WORLD + rank = comm.Get_rank() + + # Initialize the corresponding driver of SU2, this includes solver preprocessing. + try: + SU2Driver = pysu2.CSinglezoneDriver('config.cfg', 1, comm) + except TypeError as exception: + print('A TypeError occured in pysu2.CDriver : ', exception) + raise + + # Get the ID of the marker we want to deform. + AllMarkerIDs = SU2Driver.GetMarkerIndices() + MarkerName = 'interface' + MarkerID = AllMarkerIDs[MarkerName] if MarkerName in AllMarkerIDs else -1 + + # Number of vertices on the specified marker (per rank). + nVertex = SU2Driver.GetNumberMarkerNodes(MarkerID) if MarkerID >= 0 else 0 + + # Retrieve some control parameters from the driver. + deltaT = SU2Driver.GetUnsteadyTimeStep() + TimeIter = SU2Driver.GetTimeIter() + nTimeIter = SU2Driver.GetNumberTimeIter() + time = TimeIter * deltaT + + # Extract the initial position of each node on the moving marker. + CoordX = np.zeros(nVertex) + CoordY = np.zeros(nVertex) + for iVertex in range(nVertex): + CoordX[iVertex], CoordY[iVertex] = SU2Driver.MarkerInitialCoordinates(MarkerID).Get(iVertex) + + if rank == 0: + print("\n------------------------------ Begin Solver -----------------------------\n") + + # The time loop is defined in Python so that we have acces to SU2 functionalities at each time step. + while (TimeIter < nTimeIter): + # Apply the surface deformation. + for iVertex in range(nVertex): + dy = np.real(DeformFunction(CoordX[iVertex] - 0.9, time)) + SU2Driver.SetMarkerCustomDisplacement(MarkerID, iVertex, (0.0, dy)) + + # Time iteration preprocessing. + SU2Driver.Preprocess(TimeIter) + + # Run one time iteration (e.g. dual-time). + SU2Driver.Run() + SU2Driver.Postprocess() + SU2Driver.Update() + + # Monitor the solver and output solution to file if required. + stopCalc = SU2Driver.Monitor(TimeIter) + SU2Driver.Output(TimeIter) + + if (stopCalc == True): + break + + # Update control parameters + TimeIter += 1 + time += deltaT + + # Check the value of an output to cover the functionality in a regression test. + assert 'DRAG' in SU2Driver.GetOutputNames() + assert abs(SU2Driver.GetOutputValue('DRAG') - + SU2Driver.GetMarkerMonitoringOutputValue('DRAG_ON_SURFACE', MarkerName)) < np.finfo(float).eps + + # Finalize the solver and exit cleanly + SU2Driver.Finalize() + + +# Imposed deformation +def DeformFunction(x,t): + A1 = 0.016 + L = 1.0 + k1 = 4.730/L + return A1*(np.cosh(k1*x) - np.cos(k1*x) + ((np.cosh(k1*L)-np.cos(k1*L))*(np.sin(k1*x)-np.sinh(k1*x)))/(np.sinh(k1*L) - np.sin(k1*L)))*(np.exp(1j*t*2) + np.exp(-1j*t*2)) + + +if __name__ == '__main__': + main() + diff --git a/TestCases/py_wrapper/disc_adj_fea/flow_load_sens/run_adjoint.py b/TestCases/py_wrapper/disc_adj_fea/flow_load_sens/run_adjoint.py index 49d0194410a..fbdafc0e1ec 100755 --- a/TestCases/py_wrapper/disc_adj_fea/flow_load_sens/run_adjoint.py +++ b/TestCases/py_wrapper/disc_adj_fea/flow_load_sens/run_adjoint.py @@ -3,7 +3,7 @@ ## \file run_adjoint.py # \brief Python script to launch SU2_CFD_AD and compute the sensitivity of the FEA problem respect to flow loads. # \author Ruben Sanchez -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -56,10 +56,8 @@ def main(): if options.with_MPI == True: from mpi4py import MPI comm = MPI.COMM_WORLD - rank = comm.Get_rank() else: comm = 0 - rank = 0 # Initialize the corresponding driver of SU2, this includes solver preprocessing SU2Driver = pysu2.CDiscAdjSinglezoneDriver(options.filename, options.nZone, comm); @@ -68,24 +66,28 @@ def main(): MarkerName = 'RightBeamS' # Specified by the user # Get all the boundary tags - MarkerList = SU2Driver.GetAllBoundaryMarkersTag() + MarkerList = SU2Driver.GetMarkerTags() # Get all the markers defined on this rank and their associated indices. - allMarkerIDs = SU2Driver.GetAllBoundaryMarkers() + allMarkerIDs = SU2Driver.GetMarkerIndices() #Check if the specified marker exists and if it belongs to this rank. if MarkerName in MarkerList and MarkerName in allMarkerIDs.keys(): MarkerID = allMarkerIDs[MarkerName] + # Only print on the rank to which the marker belongs. + # WARNING: We only do this for the regression test, there is no guarantee that a marker will only belong to one rank. + # Time loop is defined in Python so that we have acces to SU2 functionalities at each time step - if rank == 0: + if MarkerID != None: print("\n------------------------------ Begin Solver -----------------------------\n") sys.stdout.flush() if options.with_MPI == True: comm.Barrier() # Define the load at the target vertex - SU2Driver.SetFEA_Loads(MarkerID,5,0,-0.005,0) + if MarkerID != None: + SU2Driver.SetMarkerCustomFEALoad(MarkerID, 5, (0, -0.005, 0)) # Time iteration preprocessing SU2Driver.Preprocess(0) @@ -102,20 +104,22 @@ def main(): # Output the solution to file SU2Driver.Output(0) - sens=[] - disp=[] - # Recover the sensitivity - sens.append(SU2Driver.GetFlowLoad_Sensitivity(MarkerID,5)) - disp.append(SU2Driver.GetFEA_Displacements(MarkerID,5)) + if MarkerID != None: + sens=[] + disp=[] + + # Recover the sensitivity + sens.append(SU2Driver.GetMarkerFEALoadSensitivity(MarkerID, 5)) - print("Sens[0]\tSens[1]\tDisp[0]\tDisp[1]\t") - print(100, 100, sens[0][0], sens[0][1], disp[0][0], disp[0][1]) + fea_sol = SU2Driver.GetSolverIndices()["FEA"] + marker_disp = SU2Driver.MarkerSolution(fea_sol, MarkerID) + disp.append(marker_disp.Get(5)) - # Postprocess the solver and exit cleanly - SU2Driver.Postprocessing() + print("Sens[0]\tSens[1]\tDisp[0]\tDisp[1]\t") + print(100, 100, sens[0][0], sens[0][1], disp[0][0], disp[0][1]) - if SU2Driver != None: - del SU2Driver + # Finalize the solver and exit cleanly + SU2Driver.Finalize() diff --git a/TestCases/py_wrapper/disc_adj_flow/mesh_disp_sens/run_adjoint.py b/TestCases/py_wrapper/disc_adj_flow/mesh_disp_sens/run_adjoint.py index 8a236c4ba6a..49c8977a504 100755 --- a/TestCases/py_wrapper/disc_adj_flow/mesh_disp_sens/run_adjoint.py +++ b/TestCases/py_wrapper/disc_adj_flow/mesh_disp_sens/run_adjoint.py @@ -3,7 +3,7 @@ ## \file run_adjoint.py # \brief Python script to launch SU2_CFD_AD # \author Ruben Sanchez -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -67,12 +67,12 @@ def main(): MarkerName = 'wallF' # Specified by the user # Get all the boundary tags - MarkerList = SU2Driver.GetAllBoundaryMarkersTag() + MarkerList = SU2Driver.GetMarkerTags() # Get all the markers defined on this rank and their associated indices. - allMarkerIDs = SU2Driver.GetAllBoundaryMarkers() + allMarkerIDs = SU2Driver.GetMarkerIndices() - #Check if the specified marker exists and if it belongs to this rank. + # Check if the specified marker exists and if it belongs to this rank. if MarkerName in MarkerList and MarkerName in allMarkerIDs.keys(): MarkerID = allMarkerIDs[MarkerName] @@ -80,7 +80,7 @@ def main(): nVertex_Marker = 0 #total number of vertices (physical + halo) if MarkerID != None: - nVertex_Marker = SU2Driver.GetNumberVertices(MarkerID) + nVertex_Marker = SU2Driver.GetNumberMarkerNodes(MarkerID) # Time loop is defined in Python so that we have acces to SU2 functionalities at each time step if rank == 0: @@ -110,16 +110,13 @@ def main(): # Sensitivities of the marker print("\n------------------------------ Sensitivities -----------------------------\n") for iVertex in range(nVertex_Marker): - sensX, sensY, sensZ = SU2Driver.GetMeshDisp_Sensitivity(MarkerID, iVertex) + sensX, sensY = SU2Driver.GetMarkerDisplacementSensitivity(MarkerID, iVertex) - if (iVertex == 30): - print(1000,1000,iVertex, sensX, sensY, sensZ) + if (iVertex == 30) and rank == 0: + print(1000, 1000, iVertex, sensX, sensY, 0.0) - # Postprocess the solver and exit cleanly - SU2Driver.Postprocessing() - - if SU2Driver != None: - del SU2Driver + # Finalize the solver and exit cleanly + SU2Driver.Finalize() diff --git a/TestCases/py_wrapper/dyn_fsi/config.cfg b/TestCases/py_wrapper/dyn_fsi/config.cfg new file mode 100644 index 00000000000..28bafc8fccc --- /dev/null +++ b/TestCases/py_wrapper/dyn_fsi/config.cfg @@ -0,0 +1,31 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% SU2 configuration file % +% Case description: Fluid Structure Interaction - Wall in channel % +% Author: R.Sanchez % +% Institution: Imperial College London % +% Date: 2016.02.01 % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +SOLVER= MULTIPHYSICS + +CONFIG_LIST= (configFlow.cfg, configFEA.cfg) + +MARKER_ZONE_INTERFACE= (wallUpperF, wallUpperS, wallUpwF, wallUpwS, wallDownF, wallDownS) + +MULTIZONE_MESH= NO + +TIME_DOMAIN= YES +TIME_ITER= 5 +TIME_STEP= 0.002 +SCREEN_OUTPUT= (TIME_ITER, OUTER_ITER, INNER_ITER[0], INNER_ITER[1], DEFORM_ITER[0],\ + BGS_DENSITY[0], AVG_BGS_RES[1], RMS_DENSITY[0], RMS_UTOL[1], REFERENCE_NODE[1]) +RESTART_SOL= NO +RESTART_ITER= 2 + +OUTER_ITER= 10 +CONV_FIELD= BGS_DENSITY[0], AVG_BGS_RES[1] +CONV_RESIDUAL_MINVAL= -5 + +OUTPUT_FILES= RESTART, PARAVIEW +OUTPUT_WRT_FREQ= 1 +WRT_ZONE_HIST= YES diff --git a/TestCases/py_wrapper/dyn_fsi/configFEA.cfg b/TestCases/py_wrapper/dyn_fsi/configFEA.cfg new file mode 100644 index 00000000000..d782e3a1003 --- /dev/null +++ b/TestCases/py_wrapper/dyn_fsi/configFEA.cfg @@ -0,0 +1,54 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% SU2 configuration file % +% Case description: Fluid Structure Interaction - Wall in channel % +% Author: R.Sanchez % +% Institution: Imperial College London % +% Date: 2016.02.01 % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +SOLVER= ELASTICITY + +OBJECTIVE_FUNCTION= REFERENCE_NODE +REFERENCE_NODE= 3 +REFERENCE_NODE_DISPLACEMENT= (0.0, 0.0) +REFERENCE_NODE_PENALTY= 1.0 + +GEOMETRIC_CONDITIONS= LARGE_DEFORMATIONS +MATERIAL_MODEL= NEO_HOOKEAN +ELASTICITY_MODULUS= 1.5E5 +MATERIAL_DENSITY= 50 +FORMULATION_ELASTICITY_2D= PLANE_STRESS +POISSON_RATIO= 0.3 + +MARKER_CLAMPED= ( clamped ) +MARKER_FLUID_LOAD= ( wallDownS, wallUpperS, wallUpwS, internal ) + +BGS_RELAXATION= FIXED_PARAMETER +STAT_RELAX_PARAMETER= 0.5 + +LINEAR_SOLVER= CONJUGATE_GRADIENT +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-6 +LINEAR_SOLVER_ITER= 1000 + +TIME_DISCRE_FEA= NEWMARK_IMPLICIT +NEWMARK_BETA= 0.25 +NEWMARK_GAMMA= 0.5 + +PREDICTOR= YES +RELAXATION= YES + +INNER_ITER= 10 +CONV_FIELD= REL_RMS_UTOL +CONV_RESIDUAL_MINVAL= -5 + +SCREEN_WRT_FREQ_INNER= 100 + +MESH_FORMAT= SU2 +MESH_FILENAME= meshFEA.su2 + +VOLUME_FILENAME= results_wall +RESTART_FILENAME= restart_wall.dat +SOLUTION_FILENAME= solution_wall.dat + +HISTORY_OUTPUT= ITER, RMS_RES, STRUCT_COEFF, TAVG_STRUCT_COEFF diff --git a/TestCases/py_wrapper/dyn_fsi/configFlow.cfg b/TestCases/py_wrapper/dyn_fsi/configFlow.cfg new file mode 100644 index 00000000000..6b1df89cc7f --- /dev/null +++ b/TestCases/py_wrapper/dyn_fsi/configFlow.cfg @@ -0,0 +1,80 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% SU2 configuration file % +% Case description: Fluid Structure Interaction - Wall in channel % +% Author: R.Sanchez % +% Institution: Imperial College London % +% Date: 2016.02.01 % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +SOLVER= NAVIER_STOKES +KIND_TURB_MODEL= NONE +DEFORM_MESH= YES + +MATH_PROBLEM= DIRECT + +AOA= 0.0 +REYNOLDS_NUMBER= 100 +REYNOLDS_LENGTH= 0.016 +MACH_NUMBER= 0.05 +MACH_MOTION= 0.2 + +INIT_OPTION= TD_CONDITIONS +FREESTREAM_OPTION= DENSITY_FS +FREESTREAM_DENSITY= 1.0 +FREESTREAM_PRESSURE= 17.85714286 +FREESTREAM_TEMPERATURE= 0.062207438 + +VISCOSITY_MODEL= CONSTANT_VISCOSITY +MU_CONSTANT= 1.6E-2 + +REF_ORIGIN_MOMENT_X= 0 +REF_ORIGIN_MOMENT_Y= 0 +REF_ORIGIN_MOMENT_Z= 0 +REF_LENGTH= 0.016 +REF_AREA= 0.016 + +MARKER_INLET= ( inlet, 0.062207438, 23.36216288, 1.0, 0.0, 0.0 ) +MARKER_OUTLET= ( outlet, 17.85714286) +MARKER_EULER= ( upper, lower ) + +MARKER_HEATFLUX= ( wallUpwF, 0.0, wallDownF, 0.0, wallUpperF, 0.0 ) +MARKER_DEFORM_MESH= ( wallUpwF, wallDownF, wallUpperF ) +MARKER_DEFORM_MESH_SYM_PLANE= ( upper ) + +MARKER_PLOTTING= ( wallUpwF, wallDownF, wallUpperF ) +MARKER_MONITORING= ( wallUpwF, wallDownF, wallUpperF ) + +TIME_DISCRE_FLOW= EULER_IMPLICIT +CFL_NUMBER= 1000 +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 0.05 +LINEAR_SOLVER_ITER= 6 + +TIME_MARCHING= DUAL_TIME_STEPPING-2ND_ORDER +CONV_NUM_METHOD_FLOW= ROE +MUSCL_FLOW= YES +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +SLOPE_LIMITER_FLOW= NONE + +DEFORM_LINEAR_SOLVER= CONJUGATE_GRADIENT +DEFORM_LINEAR_SOLVER_PREC= ILU +DEFORM_LINEAR_SOLVER_ERROR= 1E-9 +DEFORM_LINEAR_SOLVER_ITER= 100 +DEFORM_STIFFNESS_TYPE= WALL_DISTANCE + +INNER_ITER= 50 +CONV_FIELD= REL_RMS_DENSITY +CONV_RESIDUAL_MINVAL= -3 +CONV_STARTITER= 5 + +SCREEN_WRT_FREQ_INNER= 100 + +MESH_FORMAT= SU2 +MESH_FILENAME= meshFlow.su2 + +VOLUME_FILENAME= results_flow +RESTART_FILENAME= restart_flow.dat +SOLUTION_FILENAME= solution_flow.dat + +HISTORY_OUTPUT= ITER, RMS_RES, AERO_COEFF, TAVG_AERO_COEFF diff --git a/TestCases/py_wrapper/dyn_fsi/run.py b/TestCases/py_wrapper/dyn_fsi/run.py new file mode 100644 index 00000000000..19dce3c8b5a --- /dev/null +++ b/TestCases/py_wrapper/dyn_fsi/run.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python + +## \file run.py +# \brief Unsteady FSI case with custom load. +# \version 8.0.0 "Harrier" +# +# SU2 Project Website: https://su2code.github.io +# +# The SU2 Project is maintained by the SU2 Foundation +# (http://su2foundation.org) +# +# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) +# +# SU2 is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# SU2 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with SU2. If not, see . + +import sys +import pysu2 +import math +from mpi4py import MPI + +def main(): + comm = MPI.COMM_WORLD + rank = comm.Get_rank() + + # Initialize the corresponding driver of SU2, this includes solver preprocessing. + try: + driver = pysu2.CMultizoneDriver('config.cfg', 2, comm) + except TypeError as exception: + print('A TypeError occured in pysu2.CDriver : ', exception) + raise + + # By default the first zone is selected (flow in the case). + # Select the structural zone (second zone) to work with the FEA solver. + driver.SelectZone(1) + + # Get the ID of the marker where we will apply a force. + # This marker cannot be used by the fluid-solid interface otherwise the imposed + # load will be cleared when interpolating forces. + all_marker_ids = driver.GetMarkerIndices() + ctrl_id = all_marker_ids['internal'] if 'internal' in all_marker_ids else -1 + + # Number of vertices on the specified markers (per rank). + n_vertex_ctrl = driver.GetNumberMarkerNodes(ctrl_id) if ctrl_id >= 0 else 0 + + if rank == 0: + print("\n------------------------------ Begin Solver -----------------------------") + sys.stdout.flush() + + for time_iter in range(driver.GetNumberTimeIter()): + # Apply a custom load and then solve the time step. + time = time_iter * driver.GetUnsteadyTimeStep() + for i_vertex in range(n_vertex_ctrl): + i_point = driver.GetMarkerNode(ctrl_id, i_vertex) + if driver.GetNodeDomain(i_point): + driver.SetMarkerCustomFEALoad(ctrl_id, i_vertex, (-0.002 + 0.002 * math.cos(2 * math.pi * time / 0.02), 0)) + + driver.Preprocess(time_iter) + + driver.Run() + driver.Postprocess() + driver.Update() + + stop = driver.Monitor(time_iter) + driver.Output(time_iter) + if stop: break + + # Finalize the solver and exit cleanly. + driver.Finalize() + + +if __name__ == '__main__': + main() diff --git a/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg b/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg index 175e61c56a5..8577b5a87ab 100644 --- a/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg +++ b/TestCases/py_wrapper/flatPlate_rigidMotion/flatPlate_rigidMotion_Conf.cfg @@ -5,7 +5,7 @@ % Author: ___________________________________________________________________ % % Institution: ______________________________________________________________ % % Date: __________ % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py b/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py index da2ecb28433..4fa464f8d44 100755 --- a/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py +++ b/TestCases/py_wrapper/flatPlate_rigidMotion/launch_flatPlate_rigidMotion.py @@ -3,7 +3,7 @@ ## \file flatPlate_rigidMotion.py # \brief Python script to launch SU2_CFD with customized unsteady boundary conditions using the Python wrapper. # \author David Thomas -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -76,10 +76,10 @@ def main(): MovingMarker = 'plate' #specified by the user # Get all the tags with the moving option - MovingMarkerList = SU2Driver.GetAllDeformMeshMarkersTag() + MovingMarkerList = SU2Driver.GetMarkerTags() # Get all the markers defined on this rank and their associated indices. - allMarkerIDs = SU2Driver.GetAllBoundaryMarkers() + allMarkerIDs = SU2Driver.GetMarkerIndices() # Check if the specified marker has a moving option and if it exists on this rank. if MovingMarker in MovingMarkerList and MovingMarker in allMarkerIDs.keys(): @@ -87,26 +87,21 @@ def main(): # Number of vertices on the specified marker (per rank) nVertex_MovingMarker = 0 #total number of vertices (physical + halo) - nVertex_MovingMarker_HALO = 0 #number of halo vertices - nVertex_MovingMarker_PHYS = 0 #number of physical vertices if MovingMarkerID != None: - nVertex_MovingMarker = SU2Driver.GetNumberVertices(MovingMarkerID) - nVertex_MovingMarker_HALO = SU2Driver.GetNumberHaloVertices(MovingMarkerID) - nVertex_MovingMarker_PHYS = nVertex_MovingMarker - nVertex_MovingMarker_HALO + nVertex_MovingMarker = SU2Driver.GetNumberMarkerNodes(MovingMarkerID)\ # Retrieve some control parameters from the driver - deltaT = SU2Driver.GetUnsteady_TimeStep() - TimeIter = SU2Driver.GetTime_Iter() - nTimeIter = SU2Driver.GetnTimeIter() + deltaT = SU2Driver.GetUnsteadyTimeStep() + TimeIter = SU2Driver.GetTimeIter() + nTimeIter = SU2Driver.GetNumberTimeIter() time = TimeIter*deltaT # Extract the initial position of each node on the moving marker CoordX = np.zeros(nVertex_MovingMarker) CoordY = np.zeros(nVertex_MovingMarker) - CoordZ = np.zeros(nVertex_MovingMarker) for iVertex in range(nVertex_MovingMarker): - CoordX[iVertex], CoordY[iVertex], CoordZ[iVertex] = SU2Driver.GetInitialMeshCoord(MovingMarkerID, iVertex) + CoordX[iVertex], CoordY[iVertex] = SU2Driver.MarkerInitialCoordinates(MovingMarkerID).Get(iVertex) # Time loop is defined in Python so that we have acces to SU2 functionalities at each time step if rank == 0: @@ -117,9 +112,11 @@ def main(): while (TimeIter < nTimeIter): # Define the rigid body displacement and set the new coords of each node on the marker - d_y = 0.0175*sin(2*pi*time) + value = 0.0, 0.0175*sin(2*pi*time) + for iVertex in range(nVertex_MovingMarker): - SU2Driver.SetMeshDisplacement(MovingMarkerID, int(iVertex), 0.0, d_y, 0.0) + SU2Driver.SetMarkerCustomDisplacement(MovingMarkerID, int(iVertex), value) + # Time iteration preprocessing SU2Driver.Preprocess(TimeIter) # Run one time iteration (e.g. dual-time) @@ -137,11 +134,9 @@ def main(): TimeIter += 1 time += deltaT - # Postprocess the solver and exit cleanly - SU2Driver.Postprocessing() + # Finalize the solver and exit cleanly + SU2Driver.Finalize() - if SU2Driver != None: - del SU2Driver # ------------------------------------------------------------------- # Run Main Program diff --git a/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py b/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py index 34007a95eb8..276e37fa520 100755 --- a/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py +++ b/TestCases/py_wrapper/flatPlate_unsteady_CHT/launch_unsteady_CHT_FlatPlate.py @@ -3,7 +3,7 @@ ## \file launch_unsteady_CHT_FlatPlate.py # \brief Python script to launch SU2_CFD with customized unsteady boundary conditions using the Python wrapper. # \author David Thomas -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -75,29 +75,25 @@ def main(): CHTMarker = 'plate' # Specified by the user # Get all the tags with the CHT option - CHTMarkerList = SU2Driver.GetAllCHTMarkersTag() + CHTMarkerList = SU2Driver.GetCHTMarkerTags() # Get all the markers defined on this rank and their associated indices. - allMarkerIDs = SU2Driver.GetAllBoundaryMarkers() + allMarkerIDs = SU2Driver.GetMarkerIndices() #Check if the specified marker has a CHT option and if it exists on this rank. if CHTMarker in CHTMarkerList and CHTMarker in allMarkerIDs.keys(): CHTMarkerID = allMarkerIDs[CHTMarker] # Number of vertices on the specified marker (per rank) - nVertex_CHTMarker = 0 #total number of vertices (physical + halo) - nVertex_CHTMarker_HALO = 0 #number of halo vertices - nVertex_CHTMarker_PHYS = 0 #number of physical vertices + nVertex_CHTMarker = 0 # total number of vertices (physical + halo) if CHTMarkerID != None: - nVertex_CHTMarker = SU2Driver.GetNumberVertices(CHTMarkerID) - nVertex_CHTMarker_HALO = SU2Driver.GetNumberHaloVertices(CHTMarkerID) - nVertex_CHTMarker_PHYS = nVertex_CHTMarker - nVertex_CHTMarker_HALO + nVertex_CHTMarker = SU2Driver.GetNumberMarkerNodes(CHTMarkerID) # Retrieve some control parameters from the driver - deltaT = SU2Driver.GetUnsteady_TimeStep() - TimeIter = SU2Driver.GetTime_Iter() - nTimeIter = SU2Driver.GetnTimeIter() + deltaT = SU2Driver.GetUnsteadyTimeStep() + TimeIter = SU2Driver.GetTimeIter() + nTimeIter = SU2Driver.GetNumberTimeIter() time = TimeIter*deltaT # Time loop is defined in Python so that we have acces to SU2 functionalities at each time step @@ -114,7 +110,8 @@ def main(): WallTemp = 293.0 + 57.0*sin(2*pi*time) # Set this temperature to all the vertices on the specified CHT marker for iVertex in range(nVertex_CHTMarker): - SU2Driver.SetVertexTemperature(CHTMarkerID, iVertex, WallTemp) + SU2Driver.SetMarkerCustomTemperature(CHTMarkerID, iVertex, WallTemp) + # Tell the SU2 drive to update the boundary conditions SU2Driver.BoundaryConditionsUpdate() # Run one time iteration (e.g. dual-time) @@ -132,8 +129,6 @@ def main(): TimeIter += 1 time += deltaT - if SU2Driver != None: - del SU2Driver # ------------------------------------------------------------------- # Run Main Program diff --git a/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg b/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg index 481b6bea1d4..f7b504e96a7 100644 --- a/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg +++ b/TestCases/py_wrapper/flatPlate_unsteady_CHT/unsteady_CHT_FlatPlate_Conf.cfg @@ -5,7 +5,7 @@ % Author: David THOMAS % % Institution: University of Liège % % Date: 12/12/2017 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -115,21 +115,8 @@ SENS_REMOVE_SHARP= NO % ----------- SLOPE LIMITER AND DISSIPATION SENSOR DEFINITION -----------------% % -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN -MUSCL_TURB= NO -SLOPE_LIMITER_TURB= VENKATAKRISHNAN -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= VENKATAKRISHNAN -MUSCL_ADJTURB= NO -SLOPE_LIMITER_ADJTURB= VENKATAKRISHNAN -VENKAT_LIMITER_COEFF= 0.05 -ADJ_SHARP_LIMITER_COEFF= 3.0 -LIMITER_ITER= 999999 LAX_SENSOR_COEFF= 0.15 JST_SENSOR_COEFF= ( 0.5, 0.02 ) -ADJ_LAX_SENSOR_COEFF= 0.15 -ADJ_JST_SENSOR_COEFF= ( 0.5, 0.02 ) % ------------------------ LINEAR SOLVER DEFINITION ---------------------------% % diff --git a/TestCases/py_wrapper/translating_NACA0012/run_su2.py b/TestCases/py_wrapper/translating_NACA0012/run_su2.py index 731c109184d..f6fffc21c55 100644 --- a/TestCases/py_wrapper/translating_NACA0012/run_su2.py +++ b/TestCases/py_wrapper/translating_NACA0012/run_su2.py @@ -30,27 +30,29 @@ def run_solver(self): self.FluidSolver.Run() self.FluidSolver.Postprocess() # write outputs - self.FluidSolver.Monitor(0) + self.FluidSolver.Monitor(0) self.FluidSolver.Output(0) self.comm.barrier() def save_forces(self): - solver_all_moving_markers = np.array(self.FluidSolver.GetAllDeformMeshMarkersTag()) - solver_marker_ids = self.FluidSolver.GetAllBoundaryMarkers() + solver_all_moving_markers = np.array(self.FluidSolver.GetDeformableMarkerTags()) + solver_markers = self.FluidSolver.GetMarkerTags() + solver_marker_ids = self.FluidSolver.GetMarkerIndices() # The surface marker and the partitioning of the solver usually don't agree. # Thus, it is necessary to figure out if the partition of the current mpi process has # a node that belongs to a moving surface marker. - has_moving_marker = [marker in solver_marker_ids.keys() for marker in solver_all_moving_markers] + has_moving_marker = [marker in solver_markers for marker in solver_all_moving_markers] f = open('forces_'+str(self.myid)+'.csv','w') for marker in solver_all_moving_markers[has_moving_marker]: solver_marker_id = solver_marker_ids[marker] - n_vertices = self.FluidSolver.GetNumberVertices(solver_marker_id) + n_vertices = self.FluidSolver.GetNumberMarkerNodes(solver_marker_id) for i_vertex in range(n_vertices): - fxyz = self.FluidSolver.GetFlowLoad(solver_marker_id, i_vertex) - GlobalIndex = self.FluidSolver.GetVertexGlobalIndex(solver_marker_id, i_vertex) - f.write('{}, {:.2f}, {:.2f}, {:.2f}\n'.format(GlobalIndex, fxyz[0], fxyz[1], fxyz[2])) + fxyz = self.FluidSolver.GetMarkerFlowLoad(solver_marker_id, i_vertex) + iPoint = self.FluidSolver.GetMarkerNode(solver_marker_id, i_vertex) + GlobalIndex = self.FluidSolver.GetNodeGlobalIndex(iPoint) + f.write('{}, {:.2f}, {:.2f}, {:.2f}\n'.format(GlobalIndex, fxyz[0], fxyz[1], 0.0)) f.close() cfd_interface = SU2Interface('config.cfg') diff --git a/TestCases/py_wrapper/updated_moving_frame_NACA12/config.cfg b/TestCases/py_wrapper/updated_moving_frame_NACA12/config.cfg new file mode 100644 index 00000000000..449248bf169 --- /dev/null +++ b/TestCases/py_wrapper/updated_moving_frame_NACA12/config.cfg @@ -0,0 +1,75 @@ +% PROBLEM DEFINITION +% +SOLVER= EULER +REF_DIMENSIONALIZATION= FREESTREAM_VEL_EQ_MACH +MATH_PROBLEM= DIRECT +RESTART_SOL= NO + +% FREE-STREAM DEFINITION +% +% We are translating the domain instead of having farfield velocity. +% Note: The rotating frame is intended for 3D cases. To use the feature in a 2D case, +% care must be taken with respect to the axes, e.g. to obtain a pitching motion, a +% rotation about the z-axis can be used. +GRID_MOVEMENT= ROTATING_FRAME +MOTION_ORIGIN= 0.0, 0.0, 0.0 +ROTATION_RATE= 0.0, 0.0, 0.0 +TRANSLATION_RATE= -265.05707641411146, 0.0, 0.0 +MACH_NUMBER= 0.0 +FREESTREAM_PRESSURE= 101325.0 +FREESTREAM_TEMPERATURE= 273.15 + +% REFERENCE VALUES +% +% The AOA is only needed to compute CD and CL, it should match the translation rate. +AOA= 0.0 +% Same for the Mach number of the motion. +MACH_MOTION= 0.8 +REF_ORIGIN_MOMENT_X= 0.00 +REF_ORIGIN_MOMENT_Y= 0.00 +REF_ORIGIN_MOMENT_Z= 0.00 +REF_LENGTH= 1.0 +REF_AREA= 1.0 + +% BOUNDARY CONDITIONS +% +MARKER_EULER= ( airfoil ) +MARKER_FAR= ( farfield ) +MARKER_PLOTTING= ( airfoil ) +MARKER_MONITORING= ( airfoil ) +% We are specifying this marker to have an easy way to access it in python. +MARKER_DEFORM_MESH= ( airfoil ) + +% DISCRETIZATION METHODS +% +CONV_NUM_METHOD_FLOW= ROE +MUSCL_FLOW= YES +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +SLOPE_LIMITER_FLOW= VENKATAKRISHNAN_WANG +VENKAT_LIMITER_COEFF= 0.1 + +% SOLUTION ACCELERATION +% +CFL_NUMBER= 1e3 +CFL_ADAPT= NO +% +MGLEVEL= 3 +MGCYCLE= W_CYCLE +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 0.1 +LINEAR_SOLVER_ITER= 10 + +% CONVERGENCE PARAMETERS +% +ITER= 250 +CONV_FIELD= RMS_DENSITY +CONV_RESIDUAL_MINVAL= -9 + +% INPUT/OUTPUT +% +MESH_FILENAME= ../../euler/naca0012/mesh_NACA0012_inv.su2 +MESH_FORMAT= SU2 +SCREEN_OUTPUT= (INNER_ITER, RMS_RES, FORCE_X, FORCE_Y, FORCE_Z, MOMENT_X, MOMENT_Y, MOMENT_Z) +HISTORY_OUTPUT= (INNER_ITER, RMS_RES, AERO_COEFF) diff --git a/TestCases/py_wrapper/updated_moving_frame_NACA12/forces_0.csv.ref b/TestCases/py_wrapper/updated_moving_frame_NACA12/forces_0.csv.ref new file mode 100644 index 00000000000..de783b9af84 --- /dev/null +++ b/TestCases/py_wrapper/updated_moving_frame_NACA12/forces_0.csv.ref @@ -0,0 +1,200 @@ +199, -1.02, -0.00, 0.00 +0, -2.05, 14.11, 0.00 +1, -3.63, 25.02, 0.00 +2, -4.85, 33.50, 0.00 +3, -5.88, 40.69, 0.00 +4, -6.73, 46.67, 0.00 +5, -7.41, 51.56, 0.00 +6, -7.97, 55.71, 0.00 +7, -8.40, 58.99, 0.00 +8, -8.71, 61.49, 0.00 +9, -8.90, 63.22, 0.00 +10, -8.98, 64.25, 0.00 +11, -8.98, 64.66, 0.00 +12, -8.87, 64.38, 0.00 +13, -8.68, 63.48, 0.00 +14, -8.39, 61.96, 0.00 +15, -8.03, 59.85, 0.00 +16, -7.61, 57.27, 0.00 +17, -7.12, 54.13, 0.00 +18, -6.57, 50.50, 0.00 +19, -5.97, 46.39, 0.00 +20, -5.32, 41.81, 0.00 +21, -4.63, 36.81, 0.00 +22, -3.90, 31.39, 0.00 +23, -3.13, 25.55, 0.00 +24, -2.34, 19.36, 0.00 +25, -1.53, 12.80, 0.00 +26, -0.69, 5.88, 0.00 +27, 0.16, -1.35, 0.00 +28, 1.02, -8.91, 0.00 +29, 1.88, -16.75, 0.00 +30, 2.74, -24.86, 0.00 +31, 3.61, -33.24, 0.00 +32, 4.46, -41.89, 0.00 +33, 5.31, -50.77, 0.00 +34, 6.14, -59.83, 0.00 +35, 6.95, -69.11, 0.00 +36, 7.73, -78.56, 0.00 +37, 8.48, -88.13, 0.00 +38, 9.19, -97.82, 0.00 +39, 9.86, -107.57, 0.00 +40, 10.47, -117.28, 0.00 +41, 11.01, -126.92, 0.00 +42, 11.49, -136.42, 0.00 +43, 11.87, -145.62, 0.00 +44, 12.15, -154.31, 0.00 +45, 12.30, -162.22, 0.00 +46, 12.31, -169.04, 0.00 +47, 12.11, -173.89, 0.00 +48, 11.66, -175.88, 0.00 +49, 11.13, -177.08, 0.00 +50, 10.20, -172.29, 0.00 +51, 6.86, -123.94, 0.00 +52, 5.97, -116.29, 0.00 +53, 21.77, -461.42, 0.00 +54, 26.12, -610.78, 0.00 +55, 21.89, -573.85, 0.00 +56, 18.71, -561.76, 0.00 +57, 15.72, -557.10, 0.00 +58, 12.57, -549.52, 0.00 +59, 9.33, -540.36, 0.00 +60, 6.04, -530.05, 0.00 +61, 2.71, -518.89, 0.00 +62, -0.62, -506.43, 0.00 +63, -3.95, -492.74, 0.00 +64, -7.24, -478.42, 0.00 +65, -10.47, -463.16, 0.00 +66, -13.60, -446.83, 0.00 +67, -16.63, -429.81, 0.00 +68, -19.50, -411.99, 0.00 +69, -22.22, -393.60, 0.00 +70, -24.75, -374.77, 0.00 +71, -27.06, -355.42, 0.00 +72, -29.14, -335.60, 0.00 +73, -30.94, -315.27, 0.00 +74, -32.45, -294.65, 0.00 +75, -33.65, -273.85, 0.00 +76, -34.49, -252.64, 0.00 +77, -34.95, -231.28, 0.00 +78, -35.02, -209.98, 0.00 +79, -34.64, -188.53, 0.00 +80, -33.79, -167.17, 0.00 +81, -32.42, -145.88, 0.00 +82, -30.48, -124.69, 0.00 +83, -27.91, -103.76, 0.00 +84, -24.63, -83.06, 0.00 +85, -20.55, -62.73, 0.00 +86, -15.56, -42.84, 0.00 +87, -9.50, -23.48, 0.00 +88, -2.17, -4.79, 0.00 +89, 6.62, 12.94, 0.00 +90, 17.16, 29.44, 0.00 +91, 29.73, 44.19, 0.00 +92, 44.58, 56.46, 0.00 +93, 61.71, 65.06, 0.00 +94, 81.10, 68.89, 0.00 +95, 101.88, 66.36, 0.00 +96, 122.09, 55.96, 0.00 +97, 139.13, 37.65, 0.00 +98, 108.84, 14.60, 0.00 +99, 71.28, -0.00, 0.00 +100, 106.29, -14.26, 0.00 +101, 130.33, -35.27, 0.00 +102, 108.14, -49.57, 0.00 +103, 84.37, -54.95, 0.00 +104, 61.43, -52.19, 0.00 +105, 40.94, -43.16, 0.00 +106, 23.22, -29.41, 0.00 +107, 8.42, -12.52, 0.00 +108, -3.78, 6.48, 0.00 +109, -13.76, 26.90, 0.00 +110, -21.85, 48.23, 0.00 +111, -28.39, 70.19, 0.00 +112, -33.65, 92.65, 0.00 +113, -37.82, 115.44, 0.00 +114, -41.08, 138.55, 0.00 +115, -43.55, 161.90, 0.00 +116, -45.31, 185.37, 0.00 +117, -46.46, 209.03, 0.00 +118, -47.03, 232.69, 0.00 +119, -47.10, 256.34, 0.00 +120, -46.71, 280.06, 0.00 +121, -45.86, 303.51, 0.00 +122, -44.63, 326.98, 0.00 +123, -43.04, 350.21, 0.00 +124, -41.06, 372.86, 0.00 +125, -38.81, 395.46, 0.00 +126, -36.30, 418.02, 0.00 +127, -33.51, 440.10, 0.00 +128, -30.48, 461.60, 0.00 +129, -27.23, 482.42, 0.00 +130, -23.80, 502.74, 0.00 +131, -20.21, 522.54, 0.00 +132, -16.49, 541.62, 0.00 +133, -12.66, 560.14, 0.00 +134, -8.74, 577.66, 0.00 +135, -4.77, 594.37, 0.00 +136, -0.75, 610.64, 0.00 +137, 3.27, 625.80, 0.00 +138, 7.29, 639.80, 0.00 +139, 11.28, 653.28, 0.00 +140, 15.23, 665.78, 0.00 +141, 19.09, 676.85, 0.00 +142, 22.88, 687.16, 0.00 +143, 26.58, 696.67, 0.00 +144, 30.15, 704.91, 0.00 +145, 33.58, 711.87, 0.00 +146, 36.88, 717.99, 0.00 +147, 40.04, 723.07, 0.00 +148, 43.03, 726.92, 0.00 +149, 45.86, 729.95, 0.00 +150, 48.47, 730.99, 0.00 +151, 50.57, 726.34, 0.00 +152, 54.71, 751.52, 0.00 +153, 52.81, 696.43, 0.00 +154, 5.64, 71.68, 0.00 +155, -0.65, -7.95, 0.00 +156, 3.46, 41.08, 0.00 +157, 3.63, 41.77, 0.00 +158, 4.01, 44.95, 0.00 +159, 4.28, 46.74, 0.00 +160, 4.32, 46.00, 0.00 +161, 4.21, 43.77, 0.00 +162, 3.98, 40.43, 0.00 +163, 3.64, 36.21, 0.00 +164, 3.22, 31.35, 0.00 +165, 2.72, 26.01, 0.00 +166, 2.16, 20.31, 0.00 +167, 1.56, 14.37, 0.00 +168, 0.92, 8.30, 0.00 +169, 0.24, 2.16, 0.00 +170, -0.45, -3.98, 0.00 +171, -1.16, -10.05, 0.00 +172, -1.88, -15.99, 0.00 +173, -2.60, -21.79, 0.00 +174, -3.31, -27.36, 0.00 +175, -4.00, -32.68, 0.00 +176, -4.69, -37.76, 0.00 +177, -5.34, -42.49, 0.00 +178, -5.96, -46.87, 0.00 +179, -6.55, -50.90, 0.00 +180, -7.09, -54.49, 0.00 +181, -7.59, -57.67, 0.00 +182, -8.03, -60.38, 0.00 +183, -8.40, -62.58, 0.00 +184, -8.72, -64.34, 0.00 +185, -8.96, -65.53, 0.00 +186, -9.11, -66.13, 0.00 +187, -9.18, -66.13, 0.00 +188, -9.15, -65.46, 0.00 +189, -9.04, -64.19, 0.00 +190, -8.81, -62.24, 0.00 +191, -8.48, -59.55, 0.00 +192, -8.02, -56.09, 0.00 +193, -7.44, -51.78, 0.00 +194, -6.74, -46.74, 0.00 +195, -5.87, -40.64, 0.00 +196, -4.83, -33.31, 0.00 +197, -3.59, -24.74, 0.00 +198, -1.96, -13.51, 0.00 diff --git a/TestCases/py_wrapper/updated_moving_frame_NACA12/run_su2.py b/TestCases/py_wrapper/updated_moving_frame_NACA12/run_su2.py new file mode 100644 index 00000000000..bb0e5379830 --- /dev/null +++ b/TestCases/py_wrapper/updated_moving_frame_NACA12/run_su2.py @@ -0,0 +1,79 @@ +import sys +import numpy as np +from mpi4py import MPI +import pysu2 + +""" +This test case updates the translation and rotation rates given in the config file via the python wrapper +using the python functions SetTranslationRate() and SetRotationRate(). +Expected results: + | Inner_Iter| rms[Rho]| rms[RhoU]| rms[RhoV]| rms[RhoE]| CFx| CFy| CFz| CMx| CMy| CMz| +A0A=0.0 deg: no lift and moments for the symmetrical airfoil (for reference) + | 51| -9.205443| -9.406638| -9.542742| -8.868505| 0.008431| -0.000001| 0.000000| 0.000000| 0.000000| -0.000037| +AoA=0.5 deg: increase in lift (CFy), small pitching moment (CMz) because origin at the leading edge + | 65| -9.016705| -9.182525| -9.424299| -8.656815| 0.009455| 0.133624| 0.000000| 0.000000| 0.000000| 0.045316| +AoA=0.5 deg and rot_z=-30 deg/s: small increase in pitching moment (CMz) and with the origin at the leading edge, the pitch rate adds a little lift (CFy) + | 50| -9.031666| -9.303253| -9.288828| -8.652367| 0.009733| 0.153685| 0.000000| 0.000000| 0.000000| 0.053223| +Thus, a check of the final surface forces is an indicator that the update of the moving frame worked properly. +""" + +def setup_mpi(): + if 'mpi4py.MPI' in sys.modules: + have_mpi = True + comm = MPI.COMM_WORLD + status = MPI.Status() + myid = comm.Get_rank() + else: + have_mpi = False + comm = None + status = None + myid = 0 + return have_mpi, comm, status, myid + + +class SU2Interface: + def __init__(self, config_filename): + self.have_mpi, self.comm, self.status, self.myid = setup_mpi() + self.FluidSolver = pysu2.CSinglezoneDriver(config_filename, 1, self.comm) + + def run_solver(self): + self.comm.barrier() + # run solver + self.FluidSolver.Preprocess(0) + self.FluidSolver.Run() + self.FluidSolver.Postprocess() + # write outputs + self.FluidSolver.Monitor(0) + self.FluidSolver.Output(0) + self.comm.barrier() + + def update_moving_frame(self): + # Reduce AoA from 0.0 to 0.5 deg + self.FluidSolver.SetTranslationRate(xDot=-265.0469838528219, yDot=-2.3130299864229564, zDot=0.0) + # Add a pitch rate (in the 2D case, nose up pitch is a negative rotation about the z-axis) + self.FluidSolver.SetRotationRate(rot_x=0.0, rot_y=0.0, rot_z=-30.0/180.0*np.pi) + + def save_forces(self): + solver_all_moving_markers = np.array(self.FluidSolver.GetDeformableMarkerTags()) + solver_markers = self.FluidSolver.GetMarkerTags() + solver_marker_ids = self.FluidSolver.GetMarkerIndices() + # The surface marker and the partitioning of the solver usually don't agree. + # Thus, it is necessary to figure out if the partition of the current mpi process has + # a node that belongs to a moving surface marker. + has_moving_marker = [marker in solver_markers for marker in solver_all_moving_markers] + + with open('forces_'+str(self.myid)+'.csv','w') as f: + for marker in solver_all_moving_markers[has_moving_marker]: + solver_marker_id = solver_marker_ids[marker] + n_vertices = self.FluidSolver.GetNumberMarkerNodes(solver_marker_id) + for i_vertex in range(n_vertices): + fxyz = self.FluidSolver.GetMarkerFlowLoad(solver_marker_id, i_vertex) + iPoint = self.FluidSolver.GetMarkerNode(solver_marker_id, i_vertex) + GlobalIndex = self.FluidSolver.GetNodeGlobalIndex(iPoint) + f.write('{}, {:.2f}, {:.2f}, {:.2f}\n'.format(GlobalIndex, fxyz[0], fxyz[1], 0.0)) + +cfd_interface = SU2Interface('config.cfg') +cfd_interface.update_moving_frame() +cfd_interface.run_solver() +cfd_interface.save_forces() + diff --git a/TestCases/py_wrapper/wavy_wall/run_steady.py b/TestCases/py_wrapper/wavy_wall/run_steady.py new file mode 100644 index 00000000000..07090c6790b --- /dev/null +++ b/TestCases/py_wrapper/wavy_wall/run_steady.py @@ -0,0 +1,321 @@ +#!/usr/bin/env python + +## \file run.py +# \brief Channel with wave-like motion on walls (steady state version). +# \version 8.0.0 "Harrier" +# +# SU2 Project Website: https://su2code.github.io +# +# The SU2 Project is maintained by the SU2 Foundation +# (http://su2foundation.org) +# +# Copyright 2012-2023, SU2 Contributors (cf. AUTHORS.md) +# +# SU2 is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# SU2 is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with SU2. If not, see . + +import pysu2ad as pysu2 +from mpi4py import MPI +import numpy as np + +common_settings = """ +SOLVER= NAVIER_STOKES + +FLUID_MODEL= IDEAL_GAS +GAMMA_VALUE= 1.4 +GAS_CONSTANT= 287.87 + +MACH_NUMBER= 0.034 +INIT_OPTION= TD_CONDITIONS +FREESTREAM_OPTION= TEMPERATURE_FS +FREESTREAM_TEMPERATURE= 299.99 +FREESTREAM_PRESSURE= 98750 +REYNOLDS_NUMBER= 2000 +REYNOLDS_LENGTH= 0.055 + +VISCOSITY_MODEL= CONSTANT_VISCOSITY +MU_CONSTANT= 0.0005 + +MARKER_HEATFLUX= ( y_minus, 0, y_plus, 0 ) +MARKER_INLET= ( x_minus, 300, 100000, 1, 0, 0 ) +MARKER_FAR= ( x_plus ) + +MARKER_MONITORING= ( y_minus, y_plus ) +MARKER_PLOTTING= ( x_minus, x_plus, y_minus, y_plus ) + +DEFORM_MESH= YES +MARKER_DEFORM_MESH= ( y_minus, y_plus ) +DEFORM_CONSOLE_OUTPUT= YES +DEFORM_LINEAR_SOLVER= CONJUGATE_GRADIENT +DEFORM_LINEAR_SOLVER_PREC= ILU +DEFORM_LINEAR_SOLVER_ERROR= 1e-12 +DEFORM_LINEAR_SOLVER_ITER= 1000 +DEFORM_STIFFNESS_TYPE= CONSTANT_STIFFNESS +DEFORM_POISSONS_RATIO= 0.35 + +CONV_NUM_METHOD_FLOW= ROE +ENTROPY_FIX_COEFF= 1e-5 +MUSCL_FLOW= YES +SLOPE_LIMITER_FLOW= NONE +NUM_METHOD_GRAD= GREEN_GAUSS + +MESH_FORMAT= RECTANGLE +MESH_BOX_SIZE= ( 193, 33, 0 ) +MESH_BOX_LENGTH= ( 0.75, __WIDTH__, 0 ) + +CUSTOM_OUTPUTS= 'p_tot : Macro{PRESSURE + 0.5 * DENSITY * (pow(VELOCITY_X, 2) + pow(VELOCITY_Y, 2))};\ + p_in : MassFlowAvg{$p_tot}[x_minus];\ + p_out : MassFlowAvg{$p_tot}[x_plus];\ + p_drop : Function{p_out - p_in}' + +CUSTOM_OBJFUNC= 'p_drop' +OBJECTIVE_FUNCTION= CUSTOM_OBJFUNC + +SOLUTION_FILENAME= restart.dat +OUTPUT_FILES= RESTART, PARAVIEW_MULTIBLOCK +OUTPUT_WRT_FREQ= 9999 +SCREEN_WRT_FREQ_INNER= 10 + +INNER_ITER= 3000 +CONV_STARTITER= 10 +""" + +primal_settings = """ +MATH_PROBLEM= DIRECT +RESTART_SOL= YES + +CFL_NUMBER= 1000 +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 0.1 +LINEAR_SOLVER_ITER= 20 + +SCREEN_OUTPUT= INNER_ITER, RMS_RES, LINSOL, p_drop +HISTORY_OUTPUT= ITER, RMS_RES, CUSTOM +VOLUME_OUTPUT= PRIMITIVE, VORTEX_IDENTIFICATION + +CONV_RESIDUAL_MINVAL= -13 +CONV_FIELD= RMS_DENSITY +""" + +adjoint_settings = """ +MATH_PROBLEM= DISCRETE_ADJOINT + +CFL_NUMBER= 1000 +DISCADJ_LIN_SOLVER= FGMRES +DISCADJ_LIN_PREC= ILU +LINEAR_SOLVER_ERROR= 0.001 +LINEAR_SOLVER_ITER= 20 + +SCREEN_OUTPUT= INNER_ITER, RMS_RES, LINSOL +HISTORY_OUTPUT= ITER, RMS_RES, SENSITIVITY + +QUASI_NEWTON_NUM_SAMPLES= 20 + +CONV_RESIDUAL_MINVAL= -8 +CONV_FIELD= REL_RMS_ADJ_DENSITY +""" + + +def GetMarkerIds(driver): + """Get the ID of the markers where the deformation is applied.""" + all_marker_ids = driver.GetMarkerIndices() + marker_names = ['y_minus', 'y_plus'] + marker_ids = [] + for name in marker_names: + marker_ids.append(all_marker_ids[name] if name in all_marker_ids else -1) + return marker_ids + + +def RunPrimal(channel_width, deform_amplitude): + """ + Runs the primal solver for a given amplitude of the deformation. + Returns the objective function. + """ + comm = MPI.COMM_WORLD + rank = comm.Get_rank() + + if rank == 0: + with open('config.cfg', 'w') as f: + f.write(common_settings.replace('__WIDTH__', str(channel_width)) + primal_settings) + comm.Barrier() + + # Initialize the corresponding driver of SU2, this includes solver preprocessing. + try: + driver = pysu2.CSinglezoneDriver('config.cfg', 1, comm) + except TypeError as exception: + print('A TypeError occured in pysu2.CSinglezoneDriver : ', exception) + raise + + marker_ids = GetMarkerIds(driver) + + for marker_id in marker_ids: + Deformation(0, deform_amplitude, marker_id, driver) + + driver.StartSolver() + avg_p_drop = driver.GetOutputValue('p_drop') + + # Finalize the solver and exit cleanly + driver.Finalize() + + return avg_p_drop + + +def RunAdjoint(channel_width, deform_amplitude): + """ + Runs the adjoint solver for a given amplitude of the deformation, and channel width. + Returns the sensitivity of the objective function to the amplitude and width. + """ + comm = MPI.COMM_WORLD + rank = comm.Get_rank() + + if rank == 0: + with open('config_ad.cfg', 'w') as f: + f.write(common_settings.replace('__WIDTH__', str(channel_width)) + adjoint_settings) + comm.Barrier() + + # Initialize the corresponding driver of SU2, this includes solver preprocessing. + try: + driver = pysu2.CDiscAdjSinglezoneDriver('config_ad.cfg', 1, comm) + except TypeError as exception: + print('A TypeError occured in pysu2.CDiscAdjSinglezoneDriver : ', exception) + raise + + marker_ids = GetMarkerIds(driver) + + # Preprocess adjoint to load the primal solution. + driver.Preprocess(0) + + # Check the surface deformation is the expected from loading the primal results. + for marker_id in marker_ids: + Deformation(0, deform_amplitude, marker_id, driver, True) + + driver.Run() + driver.Postprocess() + driver.Update() + + # Accumulate the sensitivity to the deformation amplitude. + sens = 0 + for marker_id in marker_ids: + sens += SumSensitivity(0, marker_id, driver) + + driver.Monitor(0) + driver.Output(0) + + size_sens = 0.0 + sensitivity = driver.Sensitivity(driver.GetSolverIndices()['ADJ.FLOW']) + coords = driver.InitialCoordinates() + + for i_node in range(driver.GetNumberNodes() - driver.GetNumberHaloNodes()): + y = coords.Get(i_node, 1) + dy_dw = y / channel_width + size_sens += dy_dw * sensitivity(i_node, 1) + + # Finalize the solver and exit cleanly + driver.Finalize() + + return comm.allreduce(size_sens), comm.allreduce(sens) + + +def Phase(t): + # 10 cycles per second + return 10 * 2 * np.pi * t + + +def DeformationBottom(x, phase): + # Deformation between 0.1 and 0.4. + if x < 0.1 or x > 0.4: + return 0 + t = (x - 0.1) / 0.3 * 2 * np.pi + ampl = (1 - np.cos(t)) / 2 + + # Shape parameter, makes the peaks narrower or wider. + N = 1 + + p = N * (t - phase) + denom = N * 2 * np.pi + n = round(p / denom) + p -= n * denom + wave = (1 - np.cos(min(max(0, p + np.pi), 2 * np.pi))) / 2 + + return ampl * wave + + +def DeformationTop(x, phase): + # Top deforms downward with a phase shift. + return -DeformationBottom(x, phase + np.pi) + + +def Deformation(t, amplitude, marker_id, driver, check = False): + """ + Applies the deformation to the marker or checks that the current mesh + coordinates (loaded by the adjoint solver) match the expected for the time. + """ + if marker_id < 0: + return + ini_coords = driver.MarkerInitialCoordinates(marker_id) + coords = driver.MarkerCoordinates(marker_id) + phase = Phase(t) + + for i_vertex in range(ini_coords.Shape()[0]): + x, y = ini_coords.Get(i_vertex) + if (y > 1e-3): + dy = DeformationTop(x, phase) + else: + dy = DeformationBottom(x, phase) + if not check: + driver.SetMarkerCustomDisplacement(marker_id, i_vertex, (0.0, amplitude * dy)) + else: + assert abs((coords(i_vertex, 1) - y) / amplitude - dy) < 1e-9 + + +def SumSensitivity(t, marker_id, driver): + """Integrates the sensitivity with respect to the amplitude of the deformation.""" + if marker_id < 0: + return 0.0 + ini_coords = driver.MarkerInitialCoordinates(marker_id) + phase = Phase(t) + sens = 0 + + for i_vertex in range(ini_coords.Shape()[0]): + i_point = driver.GetMarkerNode(marker_id, i_vertex) + if not driver.GetNodeDomain(i_point): + continue + + x, y = ini_coords.Get(i_vertex) + if (y > 1e-3): + dy = DeformationTop(x, phase) + else: + dy = DeformationBottom(x, phase) + sens_x, sens_y = driver.GetMarkerDisplacementSensitivity(marker_id, i_vertex) + sens += sens_y * dy + + return sens + + +def main(): + comm = MPI.COMM_WORLD + rank = comm.Get_rank() + + p_drop = RunPrimal(0.055, 0.045) + w_sens, a_sens = RunAdjoint(0.055, 0.045) + + # Print results for the regression script to check. + # The derivates were verified with finite difference steps of 5e-5. + if rank == 0: + print("\n------------------------------ Begin Solver -----------------------------\n") + print(100, 100, p_drop / 1000, w_sens / 100000, a_sens / 100000, '\n') + + +if __name__ == '__main__': + main() diff --git a/TestCases/radiation/p1adjoint/configp1adjoint.cfg b/TestCases/radiation/p1adjoint/configp1adjoint.cfg index cb7178a2aee..bc71c6fdfd3 100644 --- a/TestCases/radiation/p1adjoint/configp1adjoint.cfg +++ b/TestCases/radiation/p1adjoint/configp1adjoint.cfg @@ -4,7 +4,7 @@ % Case description: Coupled CFD-RHT adjoint problem % % Author: Ruben Sanchez (TU Kaiserslautern) % % Date: 2020-02-13 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/radiation/p1model/configp1.cfg b/TestCases/radiation/p1model/configp1.cfg index f03ab47fe66..49c24ef4813 100644 --- a/TestCases/radiation/p1model/configp1.cfg +++ b/TestCases/radiation/p1model/configp1.cfg @@ -5,7 +5,7 @@ % Author: Ruben Sanchez % % Institution: Chair for Scientific Computing, TU Kaiserslautern % % Date: 2019-01-29 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/actuatordisk_variable_load/propeller_variable_load.cfg b/TestCases/rans/actuatordisk_variable_load/propeller_variable_load.cfg index 8fc5c9737e7..6fbd652d6c1 100644 --- a/TestCases/rans/actuatordisk_variable_load/propeller_variable_load.cfg +++ b/TestCases/rans/actuatordisk_variable_load/propeller_variable_load.cfg @@ -8,7 +8,7 @@ % Comments: Grid file and propeller data courtesy of Mauro Minervino, % % Centro Italiano Ricerche Aerospaziali (CIRA) % % Date: 07/08/2020 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/flatplate/turb_SA_flatplate.cfg b/TestCases/rans/flatplate/turb_SA_flatplate.cfg index eed7ca2f152..668de90324a 100644 --- a/TestCases/rans/flatplate/turb_SA_flatplate.cfg +++ b/TestCases/rans/flatplate/turb_SA_flatplate.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.10 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/flatplate/turb_SA_flatplate_species.cfg b/TestCases/rans/flatplate/turb_SA_flatplate_species.cfg index e09fe245164..bcf1c84c107 100644 --- a/TestCases/rans/flatplate/turb_SA_flatplate_species.cfg +++ b/TestCases/rans/flatplate/turb_SA_flatplate_species.cfg @@ -6,7 +6,7 @@ % Author: T. Kattmann % % Institution: Bosch Thermotechmniek B.V. % % Date: 2021.11.30 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/flatplate/turb_SST_flatplate.cfg b/TestCases/rans/flatplate/turb_SST_flatplate.cfg index 0758224d3d2..c0286b69232 100644 --- a/TestCases/rans/flatplate/turb_SST_flatplate.cfg +++ b/TestCases/rans/flatplate/turb_SST_flatplate.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.10 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/naca0012/turb_NACA0012_sa.cfg b/TestCases/rans/naca0012/turb_NACA0012_sa.cfg index aceafbc305c..738a8bec2d2 100644 --- a/TestCases/rans/naca0012/turb_NACA0012_sa.cfg +++ b/TestCases/rans/naca0012/turb_NACA0012_sa.cfg @@ -6,7 +6,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: Feb 18th, 2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -67,7 +67,6 @@ LINEAR_SOLVER_ITER= 20 % CONV_NUM_METHOD_FLOW= ROE MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= NONE JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT diff --git a/TestCases/rans/naca0012/turb_NACA0012_sst.cfg b/TestCases/rans/naca0012/turb_NACA0012_sst.cfg index 5bf963e82aa..a36eb3b5b4e 100644 --- a/TestCases/rans/naca0012/turb_NACA0012_sst.cfg +++ b/TestCases/rans/naca0012/turb_NACA0012_sst.cfg @@ -6,7 +6,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: Feb 18th, 2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -14,6 +14,7 @@ % SOLVER= RANS KIND_TURB_MODEL= SST +SST_OPTIONS= V1994m MATH_PROBLEM= DIRECT RESTART_SOL= YES READ_BINARY_RESTART= NO diff --git a/TestCases/rans/naca0012/turb_NACA0012_sst_1994-KLm.cfg b/TestCases/rans/naca0012/turb_NACA0012_sst_1994-KLm.cfg index 42e5ae174c0..1411fd2c953 100644 --- a/TestCases/rans/naca0012/turb_NACA0012_sst_1994-KLm.cfg +++ b/TestCases/rans/naca0012/turb_NACA0012_sst_1994-KLm.cfg @@ -3,7 +3,7 @@ % SU2 configuration file % % Case description: 2D NACA 0012 Airfoil Validation Case (compressible) % % SST-1994-KLm implementation % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/naca0012/turb_NACA0012_sst_2003-Vm.cfg b/TestCases/rans/naca0012/turb_NACA0012_sst_2003-Vm.cfg index c0909cb317e..2dce5941829 100644 --- a/TestCases/rans/naca0012/turb_NACA0012_sst_2003-Vm.cfg +++ b/TestCases/rans/naca0012/turb_NACA0012_sst_2003-Vm.cfg @@ -3,7 +3,7 @@ % SU2 configuration file % % Case description: 2D NACA 0012 Airfoil Validation Case (compressible) % % SST-2003-Vm implementation % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/naca0012/turb_NACA0012_sst_2003m.cfg b/TestCases/rans/naca0012/turb_NACA0012_sst_2003m.cfg index c37bee5d16a..6f056773a76 100644 --- a/TestCases/rans/naca0012/turb_NACA0012_sst_2003m.cfg +++ b/TestCases/rans/naca0012/turb_NACA0012_sst_2003m.cfg @@ -1,7 +1,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % % SU2 configuration file, NACA0012 RANS SST-2003m % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/naca0012/turb_NACA0012_sst_expliciteuler.cfg b/TestCases/rans/naca0012/turb_NACA0012_sst_expliciteuler.cfg index e0043632254..6540e1ae5bb 100644 --- a/TestCases/rans/naca0012/turb_NACA0012_sst_expliciteuler.cfg +++ b/TestCases/rans/naca0012/turb_NACA0012_sst_expliciteuler.cfg @@ -5,7 +5,7 @@ % Author: Max Aehle % % Institution: TU Kaiserslautern % % Date: Nov 17th, 2021 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/naca0012/turb_NACA0012_sst_fixedvalues.cfg b/TestCases/rans/naca0012/turb_NACA0012_sst_fixedvalues.cfg index e461badd1e7..7ff516e2f63 100644 --- a/TestCases/rans/naca0012/turb_NACA0012_sst_fixedvalues.cfg +++ b/TestCases/rans/naca0012/turb_NACA0012_sst_fixedvalues.cfg @@ -5,7 +5,7 @@ % Author: Max Aehle % % Institution: TU Kaiserslautern % % Date: Mar 17th, 2021 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/naca0012/turb_NACA0012_sst_multigrid_restart.cfg b/TestCases/rans/naca0012/turb_NACA0012_sst_multigrid_restart.cfg index 294e470fc32..89e1eb1d810 100644 --- a/TestCases/rans/naca0012/turb_NACA0012_sst_multigrid_restart.cfg +++ b/TestCases/rans/naca0012/turb_NACA0012_sst_multigrid_restart.cfg @@ -6,7 +6,7 @@ % Author: David E. Manosalvas % % Institution: Stanford University % % Date: 02.14.2017 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -105,8 +105,6 @@ MG_DAMP_PROLONGATION= 0.8 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN ENTROPY_FIX_COEFF= 0.0 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -121,8 +119,6 @@ CFL_REDUCTION_TURB= 1.0 % ---------------- ADJOINT-FLOW NUMERICAL METHOD DEFINITION -------------------% CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_ADJFLOW= EULER_IMPLICIT CFL_REDUCTION_ADJFLOW= 0.8 diff --git a/TestCases/rans/naca0012/turb_NACA0012_sst_sust.cfg b/TestCases/rans/naca0012/turb_NACA0012_sst_sust.cfg index 96f1c5a672e..7d0e6ce7092 100644 --- a/TestCases/rans/naca0012/turb_NACA0012_sst_sust.cfg +++ b/TestCases/rans/naca0012/turb_NACA0012_sst_sust.cfg @@ -6,7 +6,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: Feb 18th, 2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/oneram6/turb_ONERAM6.cfg b/TestCases/rans/oneram6/turb_ONERAM6.cfg index ebf2c93d89a..120cb1ca510 100644 --- a/TestCases/rans/oneram6/turb_ONERAM6.cfg +++ b/TestCases/rans/oneram6/turb_ONERAM6.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.14 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/oneram6/turb_ONERAM6_nk.cfg b/TestCases/rans/oneram6/turb_ONERAM6_nk.cfg index acd93ebaff7..106487e4170 100644 --- a/TestCases/rans/oneram6/turb_ONERAM6_nk.cfg +++ b/TestCases/rans/oneram6/turb_ONERAM6_nk.cfg @@ -2,7 +2,7 @@ % % % SU2 configuration file % % Case description: Turbulent flow, ONERA M6, Newton-Krylov solver % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/oneram6/turb_ONERAM6_vc.cfg b/TestCases/rans/oneram6/turb_ONERAM6_vc.cfg index bb084427e36..9a1beb75842 100644 --- a/TestCases/rans/oneram6/turb_ONERAM6_vc.cfg +++ b/TestCases/rans/oneram6/turb_ONERAM6_vc.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2014.06.14 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/propeller/propeller.cfg b/TestCases/rans/propeller/propeller.cfg index 2bf449c916a..588c7f5fb1e 100644 --- a/TestCases/rans/propeller/propeller.cfg +++ b/TestCases/rans/propeller/propeller.cfg @@ -5,7 +5,7 @@ % Author: % % Institution: % % Date: % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/rae2822/turb_SA_RAE2822.cfg b/TestCases/rans/rae2822/turb_SA_RAE2822.cfg index 33c811fc61f..799744ef8cd 100644 --- a/TestCases/rans/rae2822/turb_SA_RAE2822.cfg +++ b/TestCases/rans/rae2822/turb_SA_RAE2822.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -62,8 +62,6 @@ MG_DAMP_PROLONGATION= 0.95 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -77,8 +75,6 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % ---------------- ADJOINT-FLOW NUMERICAL METHOD DEFINITION -------------------% OBJECTIVE_FUNCTION= DRAG CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_SHARP_LIMITER_COEFF= 3.0 ADJ_JST_SENSOR_COEFF= ( 0.0, 0.01 ) CFL_REDUCTION_ADJFLOW= 0.75 diff --git a/TestCases/rans/rae2822/turb_SST_RAE2822.cfg b/TestCases/rans/rae2822/turb_SST_RAE2822.cfg index 6ff0416c4ab..235d69197b5 100644 --- a/TestCases/rans/rae2822/turb_SST_RAE2822.cfg +++ b/TestCases/rans/rae2822/turb_SST_RAE2822.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -66,8 +66,6 @@ MG_DAMP_PROLONGATION= 0.95 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= NONE VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT diff --git a/TestCases/rans/rae2822/turb_SST_SUST_RAE2822.cfg b/TestCases/rans/rae2822/turb_SST_SUST_RAE2822.cfg index 6c25dd63049..18cea09288e 100644 --- a/TestCases/rans/rae2822/turb_SST_SUST_RAE2822.cfg +++ b/TestCases/rans/rae2822/turb_SST_SUST_RAE2822.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -67,8 +67,6 @@ MG_DAMP_PROLONGATION= 0.95 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= NONE VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT diff --git a/TestCases/rans/restart_directdiff_naca/naca0012.cfg b/TestCases/rans/restart_directdiff_naca/naca0012.cfg index 35d4d38bec5..78d355bd28a 100644 --- a/TestCases/rans/restart_directdiff_naca/naca0012.cfg +++ b/TestCases/rans/restart_directdiff_naca/naca0012.cfg @@ -5,7 +5,7 @@ % Author: Steffen Schotthöfer % % Institution: TU Kaiserslautern % % Date: Mar 16, 2017 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/s809/trans_s809.cfg b/TestCases/rans/s809/trans_s809.cfg index 60ef01253e6..c5e60357c06 100644 --- a/TestCases/rans/s809/trans_s809.cfg +++ b/TestCases/rans/s809/trans_s809.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -66,8 +66,6 @@ MG_DAMP_PROLONGATION= 0.95 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= NONE VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT diff --git a/TestCases/rans/s809/turb_S809.cfg b/TestCases/rans/s809/turb_S809.cfg index cef80f37f0d..ab0bf685b8b 100644 --- a/TestCases/rans/s809/turb_S809.cfg +++ b/TestCases/rans/s809/turb_S809.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios % % Institution: Stanford University % % Date: 5/15/2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans/vki_turbine/turb_vki.cfg b/TestCases/rans/vki_turbine/turb_vki.cfg index 94a68ccacd1..c8c3230da57 100644 --- a/TestCases/rans/vki_turbine/turb_vki.cfg +++ b/TestCases/rans/vki_turbine/turb_vki.cfg @@ -5,7 +5,7 @@ % Author: Francisco Palacios, Thomas D. Economon % % Institution: Stanford University % % Date: Feb 18th, 2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans_uq/naca0012/turb_NACA0012_uq.cfg b/TestCases/rans_uq/naca0012/turb_NACA0012_uq.cfg index 07cff339ab3..27901dc69af 100644 --- a/TestCases/rans_uq/naca0012/turb_NACA0012_uq.cfg +++ b/TestCases/rans_uq/naca0012/turb_NACA0012_uq.cfg @@ -6,7 +6,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: Feb 18th, 2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_1c.cfg b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_1c.cfg index e4a2d92ae6f..5cef3fb5437 100644 --- a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_1c.cfg +++ b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_1c.cfg @@ -6,7 +6,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: Feb 18th, 2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_2c.cfg b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_2c.cfg index e3ed070d761..96cb46e5a0a 100644 --- a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_2c.cfg +++ b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_2c.cfg @@ -6,7 +6,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: Feb 18th, 2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_3c.cfg b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_3c.cfg index 9a09a1d30b6..f6d157f2d8e 100644 --- a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_3c.cfg +++ b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_3c.cfg @@ -6,7 +6,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: Feb 18th, 2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_p1c1.cfg b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_p1c1.cfg index d3a0ab603c9..c707ebf78ed 100644 --- a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_p1c1.cfg +++ b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_p1c1.cfg @@ -6,7 +6,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: Feb 18th, 2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_p1c2.cfg b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_p1c2.cfg index 2dc0002cf58..3a0dafa99c2 100644 --- a/TestCases/rans_uq/naca0012/turb_NACA0012_uq_p1c2.cfg +++ b/TestCases/rans_uq/naca0012/turb_NACA0012_uq_p1c2.cfg @@ -6,7 +6,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: Feb 18th, 2013 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/rotating/caradonna_tung/rot_caradonna_tung.cfg b/TestCases/rotating/caradonna_tung/rot_caradonna_tung.cfg index 1ab945c73a6..a84b6b28812 100644 --- a/TestCases/rotating/caradonna_tung/rot_caradonna_tung.cfg +++ b/TestCases/rotating/caradonna_tung/rot_caradonna_tung.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2020.05.24 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -76,8 +76,6 @@ MG_DAMP_PROLONGATION= 0.9 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT diff --git a/TestCases/rotating/naca0012/rot_NACA0012.cfg b/TestCases/rotating/naca0012/rot_NACA0012.cfg index 26c1ad79747..c90d00bc954 100644 --- a/TestCases/rotating/naca0012/rot_NACA0012.cfg +++ b/TestCases/rotating/naca0012/rot_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2020.06.06 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -78,8 +78,6 @@ MG_DAMP_PROLONGATION= 0.95 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -88,8 +86,6 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % OBJECTIVE_FUNCTION= DRAG CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_SHARP_LIMITER_COEFF= 3.0 ADJ_JST_SENSOR_COEFF= ( 0.0, 0.02 ) TIME_DISCRE_ADJFLOW= EULER_IMPLICIT diff --git a/TestCases/serial_regression.py b/TestCases/serial_regression.py index fdd27f140ae..a8486bc11ea 100644 --- a/TestCases/serial_regression.py +++ b/TestCases/serial_regression.py @@ -3,7 +3,7 @@ ## \file serial_regression.py # \brief Python script for automated regression testing of SU2 examples # \author A. Aranake, A. Campos, T. Economon, T. Lukaczyk, S. Padron -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -46,7 +46,6 @@ def main(): thermalbath.cfg_file = "thermalbath.cfg" thermalbath.test_iter = 10 thermalbath.test_vals = [0.945997, 0.945997, -12.018025, -12.217291, -32.000000, 10.013239] - thermalbath.new_output = True test_list.append(thermalbath) # Adiabatic frozen thermal bath @@ -55,7 +54,6 @@ def main(): thermalbath_frozen.cfg_file = "thermalbath_frozen.cfg" thermalbath_frozen.test_iter = 10 thermalbath_frozen.test_vals = [-32.000000, -32.000000, -12.018022, -11.978730, -32.000000, 10.013545] - thermalbath_frozen.new_output = True test_list.append(thermalbath_frozen) # Inviscid single wedge, implicit @@ -64,18 +62,16 @@ def main(): invwedge.cfg_file = "invwedge_ausm.cfg" invwedge.test_iter = 10 invwedge.test_vals = [-1.046323, -1.571086, -18.301251, -18.628639, -18.574676, 2.271778, 1.875687, 5.315769, 0.870008] - invwedge.test_vals_aarch64 = [-1.046323, -1.571086, -18.300667, -18.628064, -18.574092, 2.271778, 1.875687, 5.315769, 0.870008] - invwedge.new_output = True + invwedge.test_vals_aarch64 = [-1.046323, -1.571086, -18.301361, -18.628744, -18.574788, 2.271778, 1.875687, 5.315769, 0.870008] test_list.append(invwedge) # Viscous single cone - axisymmetric visc_cone = TestCase('visc_cone') - visc_cone.cfg_dir = "nonequilibrium/viscous" + visc_cone.cfg_dir = "nonequilibrium/visc_wedge" visc_cone.cfg_file = "axi_visccone.cfg" visc_cone.test_iter = 10 - visc_cone.test_vals = [-5.215229, -5.739368, -20.545048, -20.618699, -20.502531, 1.262784, -3.205454, -0.015696, 0.093207, 32656.000000] - visc_cone.test_vals_aarch64 = [-5.215229, -5.739368, -20.545048, -20.618699, -20.502531, 1.262784, -3.205454, -0.015696, 0.093207, 32656.000000] - visc_cone.new_output = True + visc_cone.test_vals = [-5.215236, -5.739371, -20.556662, -20.517023, -20.436970, 1.262783, -3.205463, -0.015695, 0.093205, 32656.000000] + visc_cone.test_vals_aarch64 = [-5.215229, -5.739368, -20.556662, -20.517022, -20.437459, 1.262784, -3.205455, -0.015696, 0.093207, 32656.000000] test_list.append(visc_cone) ######################### @@ -95,7 +91,6 @@ def main(): channel.cfg_file = "inv_channel_RK.cfg" channel.test_iter = 10 channel.test_vals = [-2.475872, 3.046370, -0.203974, 0.036018] - channel.new_output = True test_list.append(channel) # NACA0012 @@ -103,8 +98,7 @@ def main(): naca0012.cfg_dir = "euler/naca0012" naca0012.cfg_file = "inv_NACA0012_Roe.cfg" naca0012.test_iter = 20 - naca0012.test_vals = [-4.023999, -3.515034, 0.339426, 0.022217] #last 4 columns - naca0012.new_output= True + naca0012.test_vals = [-4.023999, -3.515034, 0.339426, 0.022217] test_list.append(naca0012) # Supersonic wedge @@ -112,8 +106,7 @@ def main(): wedge.cfg_dir = "euler/wedge" wedge.cfg_file = "inv_wedge_HLLC.cfg" wedge.test_iter = 20 - wedge.test_vals = [-0.942862, 4.784581, -0.208106, 0.036665] #last 4 columns - wedge.new_output= True + wedge.test_vals = [-0.942862, 4.784581, -0.208106, 0.036665] test_list.append(wedge) # ONERA M6 Wing @@ -123,7 +116,6 @@ def main(): oneram6.test_iter = 10 oneram6.test_vals = [-9.279396, -8.697739, 0.281703, 0.011821] oneram6.timeout = 9600 - oneram6.new_output = True test_list.append(oneram6) # Fixed CL NACA0012 @@ -132,7 +124,6 @@ def main(): fixedCL_naca0012.cfg_file = "inv_NACA0012.cfg" fixedCL_naca0012.test_iter = 10 fixedCL_naca0012.test_vals = [-7.382410, -1.879887, 0.300000, 0.019471] - fixedCL_naca0012.new_output = True test_list.append(fixedCL_naca0012) # Polar sweep of the inviscid NACA0012 @@ -140,20 +131,20 @@ def main(): polar_naca0012.cfg_dir = "polar/naca0012" polar_naca0012.cfg_file = "inv_NACA0012.cfg" polar_naca0012.polar = True - polar_naca0012.new_output= True polar_naca0012.test_iter = 10 polar_naca0012.test_vals = [-1.243326, 4.224483, 0.016432, 0.016145] - polar_naca0012.test_vals_aarch64 = [-3.148445, 2.270143, 0.003666, 0.008682] + polar_naca0012.test_vals_aarch64 = [-1.811046, 3.612379, 0.012330, 0.009194] polar_naca0012.command = TestCase.Command(exec = "compute_polar.py", param = "-n 1 -i 11") + # flaky test on arm64 + polar_naca0012.enabled_on_cpu_arch = ["x86_64"] test_list.append(polar_naca0012) # HYPERSONIC FLOW PAST BLUNT BODY bluntbody = TestCase('bluntbody') bluntbody.cfg_dir = "euler/bluntbody" bluntbody.cfg_file = "blunt.cfg" - bluntbody.new_output = True bluntbody.test_iter = 20 - bluntbody.test_vals = [0.540009, 6.916653, -0.000000, 1.868975] #last 4 columns + bluntbody.test_vals = [0.540009, 6.916653, -0.000000, 1.868975] test_list.append(bluntbody) ########################## @@ -173,7 +164,6 @@ def main(): flatplate.cfg_file = "lam_flatplate.cfg" flatplate.test_iter = 100 flatplate.test_vals = [-9.856258, -4.371983, 0.001112, 0.036277, 2.361500, -2.325300, -2.279500, -2.279500] - flatplate.new_output = True test_list.append(flatplate) # Laminar cylinder (steady) @@ -181,8 +171,7 @@ def main(): cylinder.cfg_dir = "navierstokes/cylinder" cylinder.cfg_file = "lam_cylinder.cfg" cylinder.test_iter = 25 - cylinder.test_vals = [-6.765430, -1.297426, 0.019508, 0.310015, 1.2325e-01] - cylinder.new_output = True + cylinder.test_vals = [-6.765430, -1.297426, 0.019508, 0.310015, 0.123250] test_list.append(cylinder) # Laminar cylinder (low Mach correction) @@ -191,7 +180,6 @@ def main(): cylinder_lowmach.cfg_file = "cylinder_lowmach.cfg" cylinder_lowmach.test_iter = 25 cylinder_lowmach.test_vals = [-6.850123, -1.388088, -0.056090, 108.140176, 0.007983] - cylinder_lowmach.new_output = True test_list.append(cylinder_lowmach) # 2D Poiseuille flow (body force driven with periodic inlet / outlet) @@ -200,7 +188,6 @@ def main(): poiseuille.cfg_file = "lam_poiseuille.cfg" poiseuille.test_iter = 10 poiseuille.test_vals = [-5.050732, 0.648355, 0.012273, 13.643219, -2.047100] - poiseuille.new_output = True test_list.append(poiseuille) # 2D Poiseuille flow (inlet profile file) @@ -208,9 +195,8 @@ def main(): poiseuille_profile.cfg_dir = "navierstokes/poiseuille" poiseuille_profile.cfg_file = "profile_poiseuille.cfg" poiseuille_profile.test_iter = 10 - poiseuille_profile.test_vals = [-12.494681, -7.711642, -0.000000, 2.085796] #last 4 columns - poiseuille_profile.test_vals_aarch64 = [-12.494705, -7.711332, -0.000000, 2.085796] #last 4 columns - poiseuille_profile.new_output = True + poiseuille_profile.test_vals = [-12.494681, -7.711642, -0.000000, 2.085796] + poiseuille_profile.test_vals_aarch64 = [-12.494684, -7.711379, -0.000000, 2.085796] #last 4 columns test_list.append(poiseuille_profile) ########################## @@ -229,8 +215,7 @@ def main(): rae2822_sa.cfg_dir = "rans/rae2822" rae2822_sa.cfg_file = "turb_SA_RAE2822.cfg" rae2822_sa.test_iter = 20 - rae2822_sa.test_vals = [-2.020123, -5.269330, 0.807147, 0.060499, -80603.000000] - rae2822_sa.new_output = True + rae2822_sa.test_vals = [-2.020123, -5.269324, 0.807147, 0.060499, -80602.000000] test_list.append(rae2822_sa) # RAE2822 SST @@ -238,8 +223,7 @@ def main(): rae2822_sst.cfg_dir = "rans/rae2822" rae2822_sst.cfg_file = "turb_SST_RAE2822.cfg" rae2822_sst.test_iter = 20 - rae2822_sst.test_vals = [-0.510638, 4.870901, 0.812661, 0.061095, -80192.000000] - rae2822_sst.new_output = True + rae2822_sst.test_vals = [-0.510376, 4.873617, 0.816197, 0.060504, -71886.000000] test_list.append(rae2822_sst) # RAE2822 SST_SUST @@ -247,7 +231,7 @@ def main(): rae2822_sst_sust.cfg_dir = "rans/rae2822" rae2822_sst_sust.cfg_file = "turb_SST_SUST_RAE2822.cfg" rae2822_sst_sust.test_iter = 20 - rae2822_sst_sust.test_vals = [-2.422024, 4.870900, 0.812660, 0.061095] + rae2822_sst_sust.test_vals = [-2.536121, 4.873617, 0.816197, 0.060504] test_list.append(rae2822_sst_sust) # Flat plate @@ -255,8 +239,7 @@ def main(): turb_flatplate.cfg_dir = "rans/flatplate" turb_flatplate.cfg_file = "turb_SA_flatplate.cfg" turb_flatplate.test_iter = 20 - turb_flatplate.test_vals = [-4.157169, -6.737133, -0.176253, 0.057446] #last 4 columns - turb_flatplate.new_output = True + turb_flatplate.test_vals = [-4.157358, -6.736289, -0.176258, 0.057431] test_list.append(turb_flatplate) # FLAT PLATE, WALL FUNCTIONS, COMPRESSIBLE SST @@ -264,7 +247,7 @@ def main(): turb_wallfunction_flatplate_sst.cfg_dir = "wallfunctions/flatplate/compressible_SST" turb_wallfunction_flatplate_sst.cfg_file = "turb_SST_flatplate.cfg" turb_wallfunction_flatplate_sst.test_iter = 10 - turb_wallfunction_flatplate_sst.test_vals = [-4.229999, -1.930714, -1.998514, 1.250334, -1.635256, 1.474343, 10.000000, -2.152260, 0.072873, 0.002514] #last 10 columns + turb_wallfunction_flatplate_sst.test_vals = [-4.181412, -1.864638, -1.966031, 1.259921, -1.487159, 1.544166, 10.000000, -2.130777, 0.073950, 0.002971] test_list.append(turb_wallfunction_flatplate_sst) # FLAT PLATE, WALL FUNCTIONS, COMPRESSIBLE SA @@ -272,7 +255,7 @@ def main(): turb_wallfunction_flatplate_sa.cfg_dir = "wallfunctions/flatplate/compressible_SA" turb_wallfunction_flatplate_sa.cfg_file = "turb_SA_flatplate.cfg" turb_wallfunction_flatplate_sa.test_iter = 10 - turb_wallfunction_flatplate_sa.test_vals = [-4.436048, -2.044706, -2.114644, 0.979771, -5.393729, 10, -1.589465, 0.069744, 0.002686] #last 9 columns + turb_wallfunction_flatplate_sa.test_vals = [-4.435719, -2.044696, -2.114266, 0.980115, -5.393813, 10.000000, -1.589802, 0.069744, 0.002686] test_list.append(turb_wallfunction_flatplate_sa) # ONERA M6 Wing @@ -280,8 +263,7 @@ def main(): turb_oneram6.cfg_dir = "rans/oneram6" turb_oneram6.cfg_file = "turb_ONERAM6.cfg" turb_oneram6.test_iter = 10 - turb_oneram6.test_vals = [-2.388841, -6.689414, 0.230321, 0.157640, -32539.000000] - turb_oneram6.new_output = True + turb_oneram6.test_vals = [-2.388841, -6.689427, 0.230321, 0.157640, -32539.000000] turb_oneram6.timeout = 3200 test_list.append(turb_oneram6) @@ -289,9 +271,8 @@ def main(): turb_naca0012_sa = TestCase('turb_naca0012_sa') turb_naca0012_sa.cfg_dir = "rans/naca0012" turb_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" - turb_naca0012_sa.test_iter = 10 - turb_naca0012_sa.test_vals = [-8.629583, -10.377793, 1.064488, 0.019711, 20.000000, -2.173971, 20.000000, -5.213344, -46.50600] - turb_naca0012_sa.new_output = True + turb_naca0012_sa.test_iter = 5 + turb_naca0012_sa.test_vals = [-10.451742, -13.864841, 1.057622, 0.022916, 20.000000, -1.588482, 20.000000, -2.963093, -44.540000] turb_naca0012_sa.timeout = 3200 test_list.append(turb_naca0012_sa) @@ -300,9 +281,8 @@ def main(): turb_naca0012_sst.cfg_dir = "rans/naca0012" turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" turb_naca0012_sst.test_iter = 10 - turb_naca0012_sst.test_vals = [-11.421948, -12.801962, -5.865325, 1.049990, 0.019163, -1.939735, -38.695000] - turb_naca0012_sst.test_vals_aarch64 = [-11.451008, -12.798258, -5.863895, 1.049989, 0.019163, -1.925030, -38.694000] - turb_naca0012_sst.new_output = True + turb_naca0012_sst.test_vals = [-12.213755, -14.439873, -7.108062, 1.050109, 0.019148, -1.875539, -38.510000] + turb_naca0012_sst.test_vals_aarch64 = [-12.213728, -14.439873, -7.108062, 1.050109, 0.019148, -1.875538, -38.510000] turb_naca0012_sst.timeout = 3200 test_list.append(turb_naca0012_sst) @@ -311,8 +291,7 @@ def main(): turb_naca0012_sst_2003m.cfg_dir = "rans/naca0012" turb_naca0012_sst_2003m.cfg_file = "turb_NACA0012_sst_2003m.cfg" turb_naca0012_sst_2003m.test_iter = 10 - turb_naca0012_sst_2003m.test_vals = [-7.698427, -10.060122, -3.421605, 1.049413, 0.019691, -2.193374, -45.178000] - turb_naca0012_sst_2003m.new_output = True + turb_naca0012_sst_2003m.test_vals = [-7.690803, -10.049843, -3.414020, 1.049314, 0.019686, -2.207421, -45.199000] turb_naca0012_sst_2003m.timeout = 3200 test_list.append(turb_naca0012_sst_2003m) @@ -321,7 +300,8 @@ def main(): turb_naca0012_sst_sust_restart.cfg_dir = "rans/naca0012" turb_naca0012_sst_sust_restart.cfg_file = "turb_NACA0012_sst_sust.cfg" turb_naca0012_sst_sust_restart.test_iter = 10 - turb_naca0012_sst_sust_restart.test_vals = [-11.364741, -12.642741, -5.748040, 1.005234, 0.019017, -1.895891] + turb_naca0012_sst_sust_restart.test_vals = [-12.153015, -14.756601, -6.342509, 1.001189, 0.019384, -1.820009] + turb_naca0012_sst_sust_restart.test_vals_aarch64 = [-12.153059, -14.756601, -6.342509, 1.001189, 0.019384, -1.819999] turb_naca0012_sst_sust_restart.timeout = 3200 test_list.append(turb_naca0012_sst_sust_restart) @@ -330,7 +310,7 @@ def main(): turb_naca0012_sst_fixedvalues.cfg_dir = "rans/naca0012" turb_naca0012_sst_fixedvalues.cfg_file = "turb_NACA0012_sst_fixedvalues.cfg" turb_naca0012_sst_fixedvalues.test_iter = 10 - turb_naca0012_sst_fixedvalues.test_vals = [-5.206744, -9.561900, -1.566602, 1.022029, 0.040549, -3.483578] + turb_naca0012_sst_fixedvalues.test_vals = [-5.206797, -10.023481, -1.616002, 1.021528, 0.040220, -3.480532] turb_naca0012_sst_fixedvalues.timeout = 3200 test_list.append(turb_naca0012_sst_fixedvalues) @@ -339,8 +319,7 @@ def main(): propeller.cfg_dir = "rans/propeller" propeller.cfg_file = "propeller.cfg" propeller.test_iter = 10 - propeller.test_vals = [-3.389575, -8.409529, 0.000048, 0.056329] #last 4 columns - propeller.new_output = True + propeller.test_vals = [-3.389575, -8.409251, 0.000048, 0.056329] propeller.timeout = 3200 test_list.append(propeller) @@ -353,7 +332,8 @@ def main(): axi_rans_air_nozzle_restart.cfg_dir = "axisymmetric_rans/air_nozzle" axi_rans_air_nozzle_restart.cfg_file = "air_nozzle_restart.cfg" axi_rans_air_nozzle_restart.test_iter = 10 - axi_rans_air_nozzle_restart.test_vals = [-12.088204, -7.497812, -8.714688, -4.019578, -1924.800000] + axi_rans_air_nozzle_restart.test_vals = [-12.063377, -7.005051, -8.705733, -4.036815, -2019.8] + axi_rans_air_nozzle_restart.test_vals_aarch64 = [-12.063354, -7.004772, -8.705740, -4.036824, -2019.800000] axi_rans_air_nozzle_restart.tol = 0.0001 test_list.append(axi_rans_air_nozzle_restart) @@ -367,8 +347,7 @@ def main(): turb_naca0012_sst_restart_mg.cfg_file = "turb_NACA0012_sst_multigrid_restart.cfg" turb_naca0012_sst_restart_mg.test_iter = 50 turb_naca0012_sst_restart_mg.ntest_vals = 5 - turb_naca0012_sst_restart_mg.test_vals = [-7.653236, -7.729549, -1.981855, -0.000015, 0.079062] - turb_naca0012_sst_restart_mg.new_output = True + turb_naca0012_sst_restart_mg.test_vals = [-7.639702, -7.441853, -1.895004, 0.000001, 0.079178] turb_naca0012_sst_restart_mg.timeout = 3200 turb_naca0012_sst_restart_mg.tol = 0.000001 test_list.append(turb_naca0012_sst_restart_mg) @@ -389,8 +368,7 @@ def main(): inc_euler_naca0012.cfg_dir = "incomp_euler/naca0012" inc_euler_naca0012.cfg_file = "incomp_NACA0012.cfg" inc_euler_naca0012.test_iter = 20 - inc_euler_naca0012.test_vals = [-4.858287, -3.810487, 0.491850, 0.007002] #last 4 columns - inc_euler_naca0012.new_output = True + inc_euler_naca0012.test_vals = [-4.858287, -3.810487, 0.491850, 0.007002] test_list.append(inc_euler_naca0012) # C-D nozzle with pressure inlet and mass flow outlet @@ -398,8 +376,7 @@ def main(): inc_nozzle.cfg_dir = "incomp_euler/nozzle" inc_nozzle.cfg_file = "inv_nozzle.cfg" inc_nozzle.test_iter = 20 - inc_nozzle.test_vals = [-5.971283, -4.911145, -0.000201, 0.121631] #last 4 columns - inc_nozzle.new_output = True + inc_nozzle.test_vals = [-5.971283, -4.911145, -0.000201, 0.121631] test_list.append(inc_nozzle) ############################# @@ -418,8 +395,7 @@ def main(): inc_lam_cylinder.cfg_dir = "incomp_navierstokes/cylinder" inc_lam_cylinder.cfg_file = "incomp_cylinder.cfg" inc_lam_cylinder.test_iter = 10 - inc_lam_cylinder.test_vals = [-4.004277, -3.227956, 0.003852, 7.626578] #last 4 columns - inc_lam_cylinder.new_output = True + inc_lam_cylinder.test_vals = [-4.004277, -3.227956, 0.003852, 7.626578] test_list.append(inc_lam_cylinder) # Buoyancy-driven cavity @@ -427,8 +403,7 @@ def main(): inc_buoyancy.cfg_dir = "incomp_navierstokes/buoyancy_cavity" inc_buoyancy.cfg_file = "lam_buoyancy_cavity.cfg" inc_buoyancy.test_iter = 20 - inc_buoyancy.test_vals = [-4.436657, 0.507847, 0.000000, 0.000000] #last 4 columns - inc_buoyancy.new_output = True + inc_buoyancy.test_vals = [-4.436657, 0.507847, 0.000000, 0.000000] test_list.append(inc_buoyancy) # Laminar heated cylinder with polynomial fluid model @@ -437,7 +412,6 @@ def main(): inc_poly_cylinder.cfg_file = "poly_cylinder.cfg" inc_poly_cylinder.test_iter = 20 inc_poly_cylinder.test_vals = [-8.106741, -2.160042, 0.019225, 1.902421, -172.750000] - inc_poly_cylinder.new_output = True test_list.append(inc_poly_cylinder) # X-coarse laminar bend as a mixed element CGNS test @@ -445,7 +419,7 @@ def main(): inc_lam_bend.cfg_dir = "incomp_navierstokes/bend" inc_lam_bend.cfg_file = "lam_bend.cfg" inc_lam_bend.test_iter = 10 - inc_lam_bend.test_vals = [-3.455147, -3.082194, -0.018579, 1.169947] #last 4 columns + inc_lam_bend.test_vals = [-3.455147, -3.082194, -0.018579, 1.169947] test_list.append(inc_lam_bend) ############################ @@ -464,8 +438,7 @@ def main(): inc_turb_naca0012.cfg_dir = "incomp_rans/naca0012" inc_turb_naca0012.cfg_file = "naca0012.cfg" inc_turb_naca0012.test_iter = 20 - inc_turb_naca0012.test_vals = [-4.788495, -11.040511, 0.000023, 0.309503] #last 4 columns - inc_turb_naca0012.new_output = True + inc_turb_naca0012.test_vals = [-4.788496, -11.039482, 0.000023, 0.309488] test_list.append(inc_turb_naca0012) # NACA0012, SST_SUST @@ -473,7 +446,7 @@ def main(): inc_turb_naca0012_sst_sust.cfg_dir = "incomp_rans/naca0012" inc_turb_naca0012_sst_sust.cfg_file = "naca0012_SST_SUST.cfg" inc_turb_naca0012_sst_sust.test_iter = 20 - inc_turb_naca0012_sst_sust.test_vals = [-7.273895, 0.145922, 0.000021, 0.312007] #last 4 columns + inc_turb_naca0012_sst_sust.test_vals = [-7.270375, 0.018431, 0.000021, 0.307673] test_list.append(inc_turb_naca0012_sst_sust) # FLAT PLATE, WALL FUNCTIONS, INCOMPRESSIBLE SST @@ -481,7 +454,7 @@ def main(): inc_turb_wallfunction_flatplate_sst.cfg_dir = "wallfunctions/flatplate/incompressible_SST" inc_turb_wallfunction_flatplate_sst.cfg_file = "turb_SST_flatplate.cfg" inc_turb_wallfunction_flatplate_sst.test_iter = 10 - inc_turb_wallfunction_flatplate_sst.test_vals = [-6.561451, -5.730262, -6.306047, -4.230307, -7.164384, -2.047277, 10.000000, -2.941826, 0.000974, 0.003195, 0.206290] + inc_turb_wallfunction_flatplate_sst.test_vals = [-6.560775, -5.700721, -6.304284, -4.230488, -7.179831, -1.956057, 10.000000, -2.918240, 0.000887, 0.003680, 0.518450] test_list.append(inc_turb_wallfunction_flatplate_sst) # FLAT PLATE, WALL FUNCTIONS, INCOMPRESSIBLE SA @@ -489,7 +462,7 @@ def main(): inc_turb_wallfunction_flatplate_sa.cfg_dir = "wallfunctions/flatplate/incompressible_SA" inc_turb_wallfunction_flatplate_sa.cfg_file = "turb_SA_flatplate.cfg" inc_turb_wallfunction_flatplate_sa.test_iter = 10 - inc_turb_wallfunction_flatplate_sa.test_vals = [-6.561303, -5.718581, -6.306403, -4.230225, -9.586904, 10, -2.927392, 0.000858, 0.003792 ] #last 9 columns + inc_turb_wallfunction_flatplate_sa.test_vals = [-6.561303, -5.718581, -6.306403, -4.230225, -9.586904, 10.000000, -2.927392, 0.000858, 0.003792] test_list.append(inc_turb_wallfunction_flatplate_sa) #################### @@ -508,8 +481,7 @@ def main(): fem_euler_naca0012.cfg_dir = "hom_euler/NACA0012_5thOrder" fem_euler_naca0012.cfg_file = "fem_NACA0012_reg.cfg" fem_euler_naca0012.test_iter = 10 - fem_euler_naca0012.test_vals = [-6.519946,-5.976944,0.255551,0.000028] #last 4 columns - fem_euler_naca0012.new_output = True + fem_euler_naca0012.test_vals = [-6.519946, -5.976944, 0.255551, 0.000028] test_list.append(fem_euler_naca0012) ############################ @@ -528,8 +500,7 @@ def main(): fem_ns_flatplate.cfg_dir = "hom_navierstokes/FlatPlate/nPoly4" fem_ns_flatplate.cfg_file = "lam_flatplate_reg.cfg" fem_ns_flatplate.test_iter = 25 - fem_ns_flatplate.test_vals = [1.383727,3.175247,0.058387,0.257951] #last 4 columns - fem_ns_flatplate.new_output = True + fem_ns_flatplate.test_vals = [1.383727, 3.175247, 0.058387, 0.257951] test_list.append(fem_ns_flatplate) # Steady cylinder @@ -537,8 +508,7 @@ def main(): fem_ns_cylinder.cfg_dir = "hom_navierstokes/CylinderViscous/nPoly3" fem_ns_cylinder.cfg_file = "fem_Cylinder_reg.cfg" fem_ns_cylinder.test_iter = 10 - fem_ns_cylinder.test_vals = [0.454960,0.979123,-0.000028,79.984799] #last 4 columns - fem_ns_cylinder.new_output = True + fem_ns_cylinder.test_vals = [0.454960, 0.979123, -0.000028, 79.984799] test_list.append(fem_ns_cylinder) # Steady sphere @@ -546,8 +516,7 @@ def main(): fem_ns_sphere.cfg_dir = "hom_navierstokes/SphereViscous/nPoly3_QuadDominant" fem_ns_sphere.cfg_file = "fem_Sphere_reg.cfg" fem_ns_sphere.test_iter = 10 - fem_ns_sphere.test_vals = [-0.288121,0.240324,0.000258,21.797363] #last 4 columns - fem_ns_sphere.new_output = True + fem_ns_sphere.test_vals = [-0.288121, 0.240324, 0.000258, 21.797363] test_list.append(fem_ns_sphere) # Unsteady sphere ADER @@ -555,8 +524,7 @@ def main(): fem_ns_sphere_ader.cfg_dir = "hom_navierstokes/SphereViscous/nPoly3_QuadDominant" fem_ns_sphere_ader.cfg_file = "fem_Sphere_reg_ADER.cfg" fem_ns_sphere_ader.test_iter = 10 - fem_ns_sphere_ader.test_vals = [-35.000000,-35.000000,0.000047,31.110911] #last 4 columns - fem_ns_sphere_ader.new_output = True + fem_ns_sphere_ader.test_vals = [-35.000000, -35.000000, 0.000047, 31.110911] fem_ns_sphere_ader.unsteady = True test_list.append(fem_ns_sphere_ader) @@ -565,8 +533,7 @@ def main(): fem_ns_unsteady_cylinder.cfg_dir = "hom_navierstokes/UnsteadyCylinder/nPoly4" fem_ns_unsteady_cylinder.cfg_file = "fem_unst_cylinder.cfg" fem_ns_unsteady_cylinder.test_iter = 11 - fem_ns_unsteady_cylinder.test_vals = [-3.558582,-3.014464,-0.038927,1.383983] #last 4 columns - fem_ns_unsteady_cylinder.new_output = True + fem_ns_unsteady_cylinder.test_vals = [-3.558582, -3.014464, -0.038927, 1.383983] fem_ns_unsteady_cylinder.unsteady = True test_list.append(fem_ns_unsteady_cylinder) @@ -575,8 +542,7 @@ def main(): fem_ns_unsteady_cylinder_ader.cfg_dir = "hom_navierstokes/UnsteadyCylinder/nPoly4" fem_ns_unsteady_cylinder_ader.cfg_file = "fem_unst_cylinder_ADER.cfg" fem_ns_unsteady_cylinder_ader.test_iter = 11 - fem_ns_unsteady_cylinder_ader.test_vals = [-35.000000,-35.000000,-0.041003,1.391339] #last 4 columns - fem_ns_unsteady_cylinder_ader.new_output = True + fem_ns_unsteady_cylinder_ader.test_vals = [-35.000000, -35.000000, -0.041003, 1.391339] fem_ns_unsteady_cylinder_ader.unsteady = True test_list.append(fem_ns_unsteady_cylinder_ader) @@ -589,8 +555,7 @@ def main(): schubauer_klebanoff_transition.cfg_dir = "transition/Schubauer_Klebanoff" schubauer_klebanoff_transition.cfg_file = "transitional_BC_model_ConfigFile.cfg" schubauer_klebanoff_transition.test_iter = 10 - schubauer_klebanoff_transition.new_output = True - schubauer_klebanoff_transition.test_vals = [-8.029786, -13.240213, 0.000053, 0.007986] #last 4 columns + schubauer_klebanoff_transition.test_vals = [-8.029786, -13.240213, 0.000053, 0.007986] test_list.append(schubauer_klebanoff_transition) ##################################### @@ -609,8 +574,7 @@ def main(): contadj_naca0012.cfg_dir = "cont_adj_euler/naca0012" contadj_naca0012.cfg_file = "inv_NACA0012.cfg" contadj_naca0012.test_iter = 5 - contadj_naca0012.test_vals = [-9.289565, -14.563861, 0.300920, 0.019552] #last 4 columns - contadj_naca0012.new_output = True + contadj_naca0012.test_vals = [-9.289565, -14.563859, 0.300920, 0.019552] contadj_naca0012.tol = 0.001 test_list.append(contadj_naca0012) @@ -619,8 +583,7 @@ def main(): contadj_oneram6.cfg_dir = "cont_adj_euler/oneram6" contadj_oneram6.cfg_file = "inv_ONERAM6.cfg" contadj_oneram6.test_iter = 10 - contadj_oneram6.test_vals = [-12.133160, -12.706697, 0.685900, 0.007594] #last 4 columns - contadj_oneram6.new_output = True + contadj_oneram6.test_vals = [-12.133160, -12.706697, 0.685900, 0.007594] test_list.append(contadj_oneram6) # Inviscid WEDGE: tests averaged outflow total pressure adjoint @@ -628,8 +591,7 @@ def main(): contadj_wedge.cfg_dir = "cont_adj_euler/wedge" contadj_wedge.cfg_file = "inv_wedge_ROE.cfg" contadj_wedge.test_iter = 10 - contadj_wedge.test_vals = [2.872691, -2.755572, 853000.000000, 0.000000] #last 4 columns - contadj_wedge.new_output = True + contadj_wedge.test_vals = [2.872691, -2.755572, 853000.000000, 0.000000] test_list.append(contadj_wedge) # Inviscid fixed CL NACA0012 @@ -638,7 +600,6 @@ def main(): contadj_fixedCL_naca0012.cfg_file = "inv_NACA0012_ContAdj.cfg" contadj_fixedCL_naca0012.test_iter = 100 contadj_fixedCL_naca0012.test_vals = [0.293213, -5.201710, 0.360590, -0.000022] - contadj_fixedCL_naca0012.new_output= True test_list.append(contadj_fixedCL_naca0012) ################################### @@ -657,8 +618,7 @@ def main(): contadj_ns_cylinder.cfg_dir = "cont_adj_navierstokes/cylinder" contadj_ns_cylinder.cfg_file = "lam_cylinder.cfg" contadj_ns_cylinder.test_iter = 20 - contadj_ns_cylinder.test_vals = [ -3.665848, -9.132055, 2.056700, -0.000000] #last 4 columns - contadj_ns_cylinder.new_output = True + contadj_ns_cylinder.test_vals = [-3.665842, -9.132048, 2.056700, -0.000000] test_list.append(contadj_ns_cylinder) # Adjoint laminar naca0012 subsonic @@ -666,8 +626,7 @@ def main(): contadj_ns_naca0012_sub.cfg_dir = "cont_adj_navierstokes/naca0012_sub" contadj_ns_naca0012_sub.cfg_file = "lam_NACA0012.cfg" contadj_ns_naca0012_sub.test_iter = 20 - contadj_ns_naca0012_sub.test_vals = [-2.743268, -8.215193, 0.518810, 0.001210] #last 4 columns - contadj_ns_naca0012_sub.new_output =True + contadj_ns_naca0012_sub.test_vals = [-2.743268, -8.215193, 0.518810, 0.001210] test_list.append(contadj_ns_naca0012_sub) # Adjoint laminar naca0012 transonic @@ -675,8 +634,7 @@ def main(): contadj_ns_naca0012_trans.cfg_dir = "cont_adj_navierstokes/naca0012_trans" contadj_ns_naca0012_trans.cfg_file = "lam_NACA0012.cfg" contadj_ns_naca0012_trans.test_iter = 20 - contadj_ns_naca0012_trans.test_vals = [-1.039664, -6.575019, 1.772300, 0.012495] #last 4 columns - contadj_ns_naca0012_trans.new_output = True + contadj_ns_naca0012_trans.test_vals = [-1.039664, -6.575019, 1.772300, 0.012495] test_list.append(contadj_ns_naca0012_trans) ####################################################### @@ -688,8 +646,7 @@ def main(): contadj_rans_naca0012.cfg_dir = "cont_adj_rans/naca0012" contadj_rans_naca0012.cfg_file = "turb_nasa.cfg" contadj_rans_naca0012.test_iter = 20 - contadj_rans_naca0012.test_vals = [ -0.794162, -5.761722, 19.214000, -0.000000] #last 4 columns - contadj_rans_naca0012.new_output = True + contadj_rans_naca0012.test_vals = [-0.794162, -5.761722, 19.214000, -0.000000] test_list.append(contadj_rans_naca0012) # Adjoint turbulent NACA0012 with binary restarts @@ -697,8 +654,7 @@ def main(): contadj_rans_naca0012_bin.cfg_dir = "cont_adj_rans/naca0012" contadj_rans_naca0012_bin.cfg_file = "turb_nasa_binary.cfg" contadj_rans_naca0012_bin.test_iter = 18 - contadj_rans_naca0012_bin.test_vals = [-0.794169, -5.761671, 19.214000, -0.000000] #last 4 columns - contadj_rans_naca0012_bin.new_output = True + contadj_rans_naca0012_bin.test_vals = [-0.794169, -5.761671, 19.214000, -0.000000] test_list.append(contadj_rans_naca0012_bin) # Adjoint turbulent RAE2822 @@ -707,7 +663,6 @@ def main(): contadj_rans_rae2822.cfg_file = "turb_SA_RAE2822.cfg" contadj_rans_rae2822.test_iter = 20 contadj_rans_rae2822.test_vals = [-5.369688, -10.872211, -0.212470, 0.005448] - contadj_rans_rae2822.new_output = True test_list.append(contadj_rans_rae2822) ############################# @@ -719,9 +674,8 @@ def main(): turb_naca0012_1c.cfg_dir = "rans_uq/naca0012" turb_naca0012_1c.cfg_file = "turb_NACA0012_uq_1c.cfg" turb_naca0012_1c.test_iter = 10 - turb_naca0012_1c.test_vals = [-4.985899, 1.137425, 0.375986, -0.078795] - turb_naca0012_1c.test_vals_aarch64 = [-4.985900, 1.137455, 0.376000, -0.078781] - turb_naca0012_1c.new_output = True + turb_naca0012_1c.test_vals = [-4.986094, 1.137009, 0.378604, -0.083526] + turb_naca0012_1c.test_vals_aarch64 = [-4.986054, 1.137073, 0.378618, -0.083513] test_list.append(turb_naca0012_1c) # NACA0012 2c @@ -729,9 +683,8 @@ def main(): turb_naca0012_2c.cfg_dir = "rans_uq/naca0012" turb_naca0012_2c.cfg_file = "turb_NACA0012_uq_2c.cfg" turb_naca0012_2c.test_iter = 10 - turb_naca0012_2c.test_vals = [-5.483297, 0.968867, 0.255779, -0.109417] #last 4 columns - turb_naca0012_2c.test_vals_aarch64 = [-5.483310, 0.968862, 0.255650, -0.109464] #last 4 columns - turb_naca0012_2c.new_output = True + turb_naca0012_2c.test_vals = [-5.483291, 0.968701, 0.258168, -0.114217] + turb_naca0012_2c.test_vals_aarch64 = [-5.483307, 0.968694, 0.258049, -0.114260] #last 4 columns test_list.append(turb_naca0012_2c) # NACA0012 3c @@ -739,8 +692,7 @@ def main(): turb_naca0012_3c.cfg_dir = "rans_uq/naca0012" turb_naca0012_3c.cfg_file = "turb_NACA0012_uq_3c.cfg" turb_naca0012_3c.test_iter = 10 - turb_naca0012_3c.test_vals = [-5.584300, 0.931352, 0.248990, -0.109405] #last 4 columns - turb_naca0012_3c.new_output = True + turb_naca0012_3c.test_vals = [-5.584299, 0.931258, 0.251298, -0.114232] test_list.append(turb_naca0012_3c) # NACA0012 p1c1 @@ -748,9 +700,8 @@ def main(): turb_naca0012_p1c1.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c1.cfg_file = "turb_NACA0012_uq_p1c1.cfg" turb_naca0012_p1c1.test_iter = 10 - turb_naca0012_p1c1.test_vals = [-5.127470, 1.077450, 0.544081, -0.018573] #last 4 columns - turb_naca0012_p1c1.test_vals_aarch64 = [-5.127512, 1.077345, 0.544130, -0.018555] #last 4 columns - turb_naca0012_p1c1.new_output = True + turb_naca0012_p1c1.test_vals = [-5.127497, 1.077175, 0.546823, -0.023191] + turb_naca0012_p1c1.test_vals_aarch64 = [-5.127510, 1.077107, 0.546893, -0.023166] #last 4 columns test_list.append(turb_naca0012_p1c1) # NACA0012 p1c2 @@ -758,9 +709,8 @@ def main(): turb_naca0012_p1c2.cfg_dir = "rans_uq/naca0012" turb_naca0012_p1c2.cfg_file = "turb_NACA0012_uq_p1c2.cfg" turb_naca0012_p1c2.test_iter = 10 - turb_naca0012_p1c2.test_vals = [-5.554427, 0.943668, 0.320426, -0.091140] #last 4 columns - turb_naca0012_p1c2.test_vals_aarch64 = [-5.554391, 0.943687, 0.320285, -0.091188] #last 4 columns - turb_naca0012_p1c2.new_output = True + turb_naca0012_p1c2.test_vals = [-5.554412, 0.943562, 0.322803, -0.095946] + turb_naca0012_p1c2.test_vals_aarch64 = [-5.554381, 0.943577, 0.322676, -0.095989] #last 4 columns test_list.append(turb_naca0012_p1c2) ###################################### @@ -772,8 +722,7 @@ def main(): harmonic_balance.cfg_dir = "harmonic_balance" harmonic_balance.cfg_file = "HB.cfg" harmonic_balance.test_iter = 25 - harmonic_balance.test_vals = [-1.589739, 3.922579, 0.006702, 0.099632] - harmonic_balance.new_output = False + harmonic_balance.test_vals = [-1.589739, 0.790169, 0.937053, 3.922579] test_list.append(harmonic_balance) # Turbulent pitching NACA 64a010 airfoil @@ -781,8 +730,7 @@ def main(): hb_rans_preconditioning.cfg_dir = "harmonic_balance/hb_rans_preconditioning" hb_rans_preconditioning.cfg_file = "davis.cfg" hb_rans_preconditioning.test_iter = 25 - hb_rans_preconditioning.test_vals = [-1.902098, -5.949277, 0.007768, 0.128061] - hb_rans_preconditioning.new_output= False + hb_rans_preconditioning.test_vals = [-1.902097, 0.484069, 0.601483, 3.609005, -5.949359] test_list.append(hb_rans_preconditioning) ###################################### @@ -803,7 +751,6 @@ def main(): cavity.cfg_file = "lam_cavity.cfg" cavity.test_iter = 25 cavity.test_vals = [-5.627934, -0.164470, 0.051972, 2.547039] - cavity.new_output = True test_list.append(cavity) # Spinning cylinder @@ -811,8 +758,7 @@ def main(): spinning_cylinder.cfg_dir = "moving_wall/spinning_cylinder" spinning_cylinder.cfg_file = "spinning_cylinder.cfg" spinning_cylinder.test_iter = 25 - spinning_cylinder.test_vals = [-7.889994, -2.469385, 1.708162, 1.670039] #last 4 columns - spinning_cylinder.new_output = True + spinning_cylinder.test_vals = [-7.889994, -2.469385, 1.708162, 1.670039] test_list.append(spinning_cylinder) ###################################### @@ -824,9 +770,8 @@ def main(): square_cylinder.cfg_dir = "unsteady/square_cylinder" square_cylinder.cfg_file = "turb_square.cfg" square_cylinder.test_iter = 3 - square_cylinder.test_vals = [-2.557820, -1.158056, 0.067984, 1.399788, 2.220411, 1.399743, 2.218612, -0.453170] + square_cylinder.test_vals = [-2.557884, -1.173573, 0.058052, 1.399794, 2.220411, 1.399748, 2.218612, -0.453340] square_cylinder.unsteady = True - square_cylinder.new_output = True test_list.append(square_cylinder) # Gust @@ -836,7 +781,6 @@ def main(): sine_gust.test_iter = 5 sine_gust.test_vals = [-1.977520, 3.481804, -0.012277, -0.007309] sine_gust.unsteady = True - sine_gust.new_output = True test_list.append(sine_gust) # Aeroelastic @@ -846,7 +790,6 @@ def main(): aeroelastic.test_iter = 2 aeroelastic.test_vals = [0.074836, 0.033102, -0.001650, -0.000127] aeroelastic.unsteady = True - aeroelastic.new_output = True test_list.append(aeroelastic) # Delayed Detached Eddy Simulation @@ -854,9 +797,8 @@ def main(): ddes_flatplate.cfg_dir = "ddes/flatplate" ddes_flatplate.cfg_file = "ddes_flatplate.cfg" ddes_flatplate.test_iter = 10 - ddes_flatplate.test_vals = [-2.714758, -5.883004, -0.215005, 0.023783, -618.160000] + ddes_flatplate.test_vals = [-2.714757, -5.882779, -0.215005, 0.023783, -618.130000] ddes_flatplate.unsteady = True - ddes_flatplate.new_output = True test_list.append(ddes_flatplate) # unsteady pitching NACA0015, SA @@ -864,7 +806,7 @@ def main(): unst_inc_turb_naca0015_sa.cfg_dir = "unsteady/pitching_naca0015_rans_inc" unst_inc_turb_naca0015_sa.cfg_file = "config_incomp_turb_sa.cfg" unst_inc_turb_naca0015_sa.test_iter = 1 - unst_inc_turb_naca0015_sa.test_vals = [-3.007635, -6.879789, 1.445300, 0.419281] #last 4 columns + unst_inc_turb_naca0015_sa.test_vals = [-3.007635, -6.879778, 1.445293, 0.419274] unst_inc_turb_naca0015_sa.unsteady = True test_list.append(unst_inc_turb_naca0015_sa) @@ -873,7 +815,7 @@ def main(): unst_deforming_naca0012.cfg_dir = "disc_adj_euler/naca0012_pitching_def" unst_deforming_naca0012.cfg_file = "inv_NACA0012_pitching_deform.cfg" unst_deforming_naca0012.test_iter = 5 - unst_deforming_naca0012.test_vals = [-3.665128, -3.793593, -3.716506, -3.148308] #last 4 columns + unst_deforming_naca0012.test_vals = [-3.665129, -3.793590, -3.716505, -3.148308] unst_deforming_naca0012.unsteady = True test_list.append(unst_deforming_naca0012) @@ -886,8 +828,7 @@ def main(): ls89_sa.cfg_dir = "nicf/LS89" ls89_sa.cfg_file = "turb_SA_PR.cfg" ls89_sa.test_iter = 20 - ls89_sa.test_vals = [-5.050483, -13.389547, 0.174939, 0.430757] #last 4 columns - ls89_sa.new_output= True + ls89_sa.test_vals = [-5.050483, -13.371791, 0.174939, 0.430757] test_list.append(ls89_sa) # Rarefaction shock wave edge_VW @@ -895,8 +836,7 @@ def main(): edge_VW.cfg_dir = "nicf/edge" edge_VW.cfg_file = "edge_VW.cfg" edge_VW.test_iter = 20 - edge_VW.test_vals = [-0.711552, 5.490479, -0.000975, 0.000000] #last 4 columns - edge_VW.new_output = True + edge_VW.test_vals = [-0.711552, 5.490479, -0.000975, 0.000000] test_list.append(edge_VW) # Rarefaction shock wave edge_PPR @@ -904,8 +844,7 @@ def main(): edge_PPR.cfg_dir = "nicf/edge" edge_PPR.cfg_file = "edge_PPR.cfg" edge_PPR.test_iter = 20 - edge_PPR.test_vals = [-1.670439, 4.522842, 0.001027, 0.000000] #last 4 columns - edge_PPR.new_output = True + edge_PPR.test_vals = [-1.670439, 4.522842, 0.001027, 0.000000] test_list.append(edge_PPR) @@ -918,8 +857,7 @@ def main(): Jones_tc_restart.cfg_dir = "turbomachinery/APU_turbocharger" Jones_tc_restart.cfg_file = "Jones_restart.cfg" Jones_tc_restart.test_iter = 5 - Jones_tc_restart.test_vals = [-10.691501, -7.643699, 85.827890, 2.277151] #last 4 columns - Jones_tc_restart.new_output = False + Jones_tc_restart.test_vals = [-6.604538, -2.792279, -14.328534, -8.769317, -11.371438, -5.845632, 73273.000000, 73273.000000] Jones_tc_restart.tol = 0.0001 test_list.append(Jones_tc_restart) @@ -928,8 +866,7 @@ def main(): axial_stage2D.cfg_dir = "turbomachinery/axial_stage_2D" axial_stage2D.cfg_file = "Axial_stage2D.cfg" axial_stage2D.test_iter = 20 - axial_stage2D.test_vals = [-1.937012, 5.338671, 73.357200, 0.915728] #last 4 columns - axial_stage2D.new_output = False + axial_stage2D.test_vals = [0.974801, 1.534472, -2.897692, 2.599377, -2.418396, 3.087203, 106380.000000, 106380.000000] test_list.append(axial_stage2D) # 2D transonic stator restart @@ -937,8 +874,7 @@ def main(): transonic_stator_restart.cfg_dir = "turbomachinery/transonic_stator_2D" transonic_stator_restart.cfg_file = "transonic_stator_restart.cfg" transonic_stator_restart.test_iter = 20 - transonic_stator_restart.test_vals = [-6.765890, -0.742094, 5.003454, 0.002946] #last 4 columns - transonic_stator_restart.new_output = False + transonic_stator_restart.test_vals = [-5.345491, -3.512311, -3.153972, 0.753530, -3.835478, 1.808296, -471690] test_list.append(transonic_stator_restart) @@ -958,7 +894,7 @@ def main(): uniform_flow.cfg_dir = "sliding_interface/uniform_flow" uniform_flow.cfg_file = "uniform_NN.cfg" uniform_flow.test_iter = 2 - uniform_flow.test_vals = [2.000000, 0.000000, -0.205134, -13.251542] #last 4 columns + uniform_flow.test_vals = [2.000000, 0.000000, -0.205134, -13.251542] uniform_flow.test_vals_aarch64 = [2.000000, 0.000000, -0.205134, -13.250720] #last 4 columns uniform_flow.tol = 0.000001 uniform_flow.unsteady = True @@ -970,7 +906,7 @@ def main(): channel_2D.cfg_dir = "sliding_interface/channel_2D" channel_2D.cfg_file = "channel_2D_WA.cfg" channel_2D.test_iter = 2 - channel_2D.test_vals = [2.000000, 0.000000, 0.397995, 0.352789, 0.405474] #last 5 columns + channel_2D.test_vals = [2.000000, 0.000000, 0.397995, 0.352789, 0.405474] channel_2D.test_vals_aarch64 = [2.000000, 0.000000, 0.398053, 0.352788, 0.405474] #last 5 columns channel_2D.timeout = 100 channel_2D.unsteady = True @@ -982,7 +918,7 @@ def main(): channel_3D.cfg_dir = "sliding_interface/channel_3D" channel_3D.cfg_file = "channel_3D_WA.cfg" channel_3D.test_iter = 1 - channel_3D.test_vals = [1.000000, 0.000000, 0.661408, 0.769988, 0.696033] #last 5 columns + channel_3D.test_vals = [1.000000, 0.000000, 0.661408, 0.769988, 0.696033] channel_3D.test_vals_aarch64 = [1.000000, 0.000000, 0.661408, 0.769902, 0.695663] #last 5 columns channel_3D.unsteady = True channel_3D.multizone = True @@ -993,7 +929,7 @@ def main(): pipe.cfg_dir = "sliding_interface/pipe" pipe.cfg_file = "pipe_NN.cfg" pipe.test_iter = 2 - pipe.test_vals = [0.491954, 0.677756, 0.963981, 1.006936] #last 4 columns + pipe.test_vals = [0.491954, 0.677756, 0.963981, 1.006936] pipe.unsteady = True pipe.multizone = True test_list.append(pipe) @@ -1003,7 +939,7 @@ def main(): rotating_cylinders.cfg_dir = "sliding_interface/rotating_cylinders" rotating_cylinders.cfg_file = "rot_cylinders_WA.cfg" rotating_cylinders.test_iter = 3 - rotating_cylinders.test_vals = [3.000000, 0.000000, 0.777574, 1.134794, 1.224127] #last 4 columns + rotating_cylinders.test_vals = [3.000000, 0.000000, 0.777574, 1.134794, 1.224127] rotating_cylinders.unsteady = True rotating_cylinders.multizone = True test_list.append(rotating_cylinders) @@ -1013,7 +949,7 @@ def main(): supersonic_vortex_shedding.cfg_dir = "sliding_interface/supersonic_vortex_shedding" supersonic_vortex_shedding.cfg_file = "sup_vor_shed_WA.cfg" supersonic_vortex_shedding.test_iter = 5 - supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 1.214364, 1.663910] #last 4 columns + supersonic_vortex_shedding.test_vals = [5.000000, 0.000000, 1.214359, 1.663910] supersonic_vortex_shedding.unsteady = True supersonic_vortex_shedding.multizone = True test_list.append(supersonic_vortex_shedding) @@ -1023,7 +959,7 @@ def main(): bars_SST_2D.cfg_dir = "sliding_interface/bars_SST_2D" bars_SST_2D.cfg_file = "bars.cfg" bars_SST_2D.test_iter = 13 - bars_SST_2D.test_vals = [13.000000, -0.604409, -1.523885] + bars_SST_2D.test_vals = [13.000000, -0.773513, -1.700012] bars_SST_2D.multizone = True test_list.append(bars_SST_2D) @@ -1032,7 +968,7 @@ def main(): slinc_steady.cfg_dir = "sliding_interface/incompressible_steady" slinc_steady.cfg_file = "config.cfg" slinc_steady.test_iter = 19 - slinc_steady.test_vals = [19.000000, -1.803732, -2.108492] #last 3 columns + slinc_steady.test_vals = [19.000000, -1.803732, -2.108492] slinc_steady.timeout = 100 slinc_steady.multizone = True test_list.append(slinc_steady) @@ -1062,9 +998,8 @@ def main(): statbeam3d = TestCase('statbeam3d') statbeam3d.cfg_dir = "fea_fsi/StatBeam_3d" statbeam3d.cfg_file = "configBeam_3d.cfg" - statbeam3d.new_output= True statbeam3d.test_iter = 0 - statbeam3d.test_vals = [-8.498245, -8.230816, -8.123810, 64095.0] #last 4 columns + statbeam3d.test_vals = [-8.498245, -8.230816, -8.123810, 64095.000000] statbeam3d.test_vals_aarch64 = [-8.498254, -8.230683, -8.123819, 64095.0] #last 4 columns test_list.append(statbeam3d) @@ -1073,7 +1008,7 @@ def main(): knowlesbeam.cfg_dir = "fea_fsi/MixElemsKnowles" knowlesbeam.cfg_file = "config.cfg" knowlesbeam.test_iter = 0 - knowlesbeam.test_vals = [-14.513600, -13.57735, -28.126420, 0.44503, 9.7306] #last 5 columns + knowlesbeam.test_vals = [-14.513598, -13.577350, -28.126416, 0.445030, 9.730600] knowlesbeam.test_vals_aarch64 = [-14.475326, -13.54641, -28.057487, 0.44503, 9.7306] #last 5 columns knowlesbeam.tol = 0.0001 test_list.append(knowlesbeam) @@ -1083,9 +1018,8 @@ def main(): dynbeam2d.cfg_dir = "fea_fsi/DynBeam_2d" dynbeam2d.cfg_file = "configBeam_2d.cfg" dynbeam2d.unsteady = True - dynbeam2d.new_output= True dynbeam2d.test_iter = 6 - dynbeam2d.test_vals = [-3.240015, 2.895057, -0.353146, 6.6127e+04] #last 4 columns + dynbeam2d.test_vals = [-3.240015, 2.895057, -0.353146, 66127.000000] test_list.append(dynbeam2d) # # FSI, 2d @@ -1093,7 +1027,7 @@ def main(): fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" fsi2d.cfg_file = "configFSI.cfg" fsi2d.test_iter = 4 - fsi2d.test_vals = [4, 0, -3.743214, -4.133482] #last 4 columns + fsi2d.test_vals = [4.000000, 0.000000, -3.743214, -4.133482] fsi2d.multizone = True fsi2d.unsteady = True test_list.append(fsi2d) @@ -1103,7 +1037,7 @@ def main(): stat_fsi.cfg_dir = "fea_fsi/stat_fsi" stat_fsi.cfg_file = "config.cfg" stat_fsi.test_iter = 7 - stat_fsi.test_vals = [-3.326934, -4.981505, 0.000000, 7.000000] #last 5 columns + stat_fsi.test_vals = [-3.326934, -4.981505, 0.000000, 7.000000] stat_fsi.multizone = True test_list.append(stat_fsi) @@ -1112,7 +1046,7 @@ def main(): stat_fsi_restart.cfg_dir = "fea_fsi/stat_fsi" stat_fsi_restart.cfg_file = "config_restart.cfg" stat_fsi_restart.test_iter = 1 - stat_fsi_restart.test_vals = [-3.407486, -4.339837, 0.000000, 27.000000] #last 5 columns + stat_fsi_restart.test_vals = [-3.407486, -4.339837, 0.000000, 27.000000] stat_fsi_restart.multizone = True test_list.append(stat_fsi_restart) @@ -1121,7 +1055,7 @@ def main(): dyn_fsi.cfg_dir = "fea_fsi/dyn_fsi" dyn_fsi.cfg_file = "config.cfg" dyn_fsi.test_iter = 4 - dyn_fsi.test_vals = [-4.355809, -4.060588, 0.000000, 87.000000] #last 4 columns + dyn_fsi.test_vals = [-4.355809, -4.060588, 0.000000, 87.000000] dyn_fsi.test_vals_aarch64 = [-4.355809, -4.060588, 0.000000, 86.000000] #last 4 columns dyn_fsi.multizone = True dyn_fsi.unsteady = True @@ -1144,7 +1078,6 @@ def main(): p1rad = TestCase('p1rad') p1rad.cfg_dir = "radiation/p1model" p1rad.cfg_file = "configp1.cfg" - p1rad.new_output= True p1rad.test_iter = 100 p1rad.test_vals = [-7.751309, -7.923059, -2.119084, 0.091733, -44.537000] test_list.append(p1rad) @@ -1165,7 +1098,7 @@ def main(): cht_incompressible.cfg_dir = "coupled_cht/incomp_2d" cht_incompressible.cfg_file = "cht_2d_3cylinders.cfg" cht_incompressible.test_iter = 10 - cht_incompressible.test_vals = [-2.128826, -0.588813, -0.588813, -0.588813] #last 4 columns + cht_incompressible.test_vals = [-2.128826, -0.588813, -0.588813, -0.588813] cht_incompressible.multizone = True test_list.append(cht_incompressible) @@ -1187,7 +1120,7 @@ def main(): mms_fvm_ns.cfg_dir = "mms/fvm_navierstokes" mms_fvm_ns.cfg_file = "lam_mms_roe.cfg" mms_fvm_ns.test_iter = 20 - mms_fvm_ns.test_vals = [-2.851428, 2.192348, 0.000000, 0.000000] #last 4 columns + mms_fvm_ns.test_vals = [-2.851428, 2.192348, 0.000000, 0.000000] mms_fvm_ns.tol = 0.0001 test_list.append(mms_fvm_ns) @@ -1196,7 +1129,7 @@ def main(): mms_fvm_inc_euler.cfg_dir = "mms/fvm_incomp_euler" mms_fvm_inc_euler.cfg_file = "inv_mms_jst.cfg" mms_fvm_inc_euler.test_iter = 20 - mms_fvm_inc_euler.test_vals = [-9.128345, -9.441741, 0.000000, 0.000000] #last 4 columns + mms_fvm_inc_euler.test_vals = [-9.128345, -9.441741, 0.000000, 0.000000] mms_fvm_inc_euler.tol = 0.0001 test_list.append(mms_fvm_inc_euler) @@ -1205,7 +1138,7 @@ def main(): mms_fvm_inc_ns.cfg_dir = "mms/fvm_incomp_navierstokes" mms_fvm_inc_ns.cfg_file = "lam_mms_fds.cfg" mms_fvm_inc_ns.test_iter = 20 - mms_fvm_inc_ns.test_vals = [-7.414944, -7.631546, 0.000000, 0.000000] #last 4 columns + mms_fvm_inc_ns.test_vals = [-7.414944, -7.631546, 0.000000, 0.000000] mms_fvm_inc_ns.tol = 0.0001 test_list.append(mms_fvm_inc_ns) @@ -1214,7 +1147,7 @@ def main(): ringleb_dg_euler.cfg_dir = "mms/dg_ringleb" ringleb_dg_euler.cfg_file = "ringleb_dg.cfg" ringleb_dg_euler.test_iter = 100 - ringleb_dg_euler.test_vals = [-5.136652, -4.724941, 0.000000, 0.000000] #last 4 columns + ringleb_dg_euler.test_vals = [-5.136652, -4.724941, 0.000000, 0.000000] ringleb_dg_euler.tol = 0.0001 test_list.append(ringleb_dg_euler) @@ -1223,7 +1156,7 @@ def main(): mms_dg_ns.cfg_dir = "mms/dg_navierstokes" mms_dg_ns.cfg_file = "lam_mms_dg.cfg" mms_dg_ns.test_iter = 100 - mms_dg_ns.test_vals = [-1.845393, 3.520699, 0.000000, 0.000000] #last 4 columns + mms_dg_ns.test_vals = [-1.845393, 3.520699, 0.000000, 0.000000] mms_dg_ns.tol = 0.0001 test_list.append(mms_dg_ns) @@ -1232,7 +1165,7 @@ def main(): mms_dg_ns_3d.cfg_dir = "mms/dg_navierstokes_3d" mms_dg_ns_3d.cfg_file = "lam_mms_dg_3d.cfg" mms_dg_ns_3d.test_iter = 100 - mms_dg_ns_3d.test_vals = [-0.146826, 5.356413, 0.000000, 0.000000] #last 4 columns + mms_dg_ns_3d.test_vals = [-0.146826, 5.356413, 0.000000, 0.000000] mms_dg_ns_3d.tol = 0.0001 test_list.append(mms_dg_ns_3d) @@ -1469,7 +1402,6 @@ def main(): contadj_euler_py.timeout = 1600 contadj_euler_py.reference_file = "of_grad_cd.dat.ref" contadj_euler_py.test_file = "of_grad_cd.dat" - contadj_euler_py.new_output = True pass_list.append(contadj_euler_py.run_filediff()) test_list.append(contadj_euler_py) @@ -1481,7 +1413,6 @@ def main(): shape_opt_euler_py.test_vals = [1, 1, 2.134974E-05, 0.003847] #last 4 columns shape_opt_euler_py.command = TestCase.Command(exec = "shape_optimization.py", param = "-g CONTINUOUS_ADJOINT -f") shape_opt_euler_py.timeout = 1600 - shape_opt_euler_py.new_output = True shape_opt_euler_py.tol = 0.00001 pass_list.append(shape_opt_euler_py.run_opt()) test_list.append(shape_opt_euler_py) @@ -1493,7 +1424,6 @@ def main(): contadj_multi_py.test_iter = 10 contadj_multi_py.command = TestCase.Command(exec = "continuous_adjoint.py", param = "-f") contadj_multi_py.timeout = 1600 - contadj_multi_py.new_output = True contadj_multi_py.reference_file = "of_grad_combo.dat.ref" contadj_multi_py.test_file = "of_grad_combo.dat" pass_list.append(contadj_multi_py.run_filediff()) @@ -1530,7 +1460,7 @@ def main(): opt_multiobj1surf_py.cfg_dir = "optimization_euler/multiobjective_wedge" opt_multiobj1surf_py.cfg_file = "inv_wedge_ROE_multiobj_1surf.cfg" opt_multiobj1surf_py.test_iter = 1 - opt_multiobj1surf_py.test_vals = [1.000000, 1.000000, 30.428280, 2.039416] #last 4 columns + opt_multiobj1surf_py.test_vals = [1.000000, 1.000000, 30.428280, 2.039416] opt_multiobj1surf_py.command = TestCase.Command(exec = "shape_optimization.py", param = "-g CONTINUOUS_ADJOINT -f") opt_multiobj1surf_py.timeout = 1600 opt_multiobj1surf_py.tol = 0.00001 @@ -1542,7 +1472,7 @@ def main(): opt_2surf1obj_py.cfg_dir = "optimization_euler/multiobjective_wedge" opt_2surf1obj_py.cfg_file = "inv_wedge_ROE_2surf_1obj.cfg" opt_2surf1obj_py.test_iter = 1 - opt_2surf1obj_py.test_vals = [1.000000, 1.000000, 2.005694, 0.000185] #last 4 columns + opt_2surf1obj_py.test_vals = [1.000000, 1.000000, 2.005694, 0.000185] opt_2surf1obj_py.command = TestCase.Command(exec = "shape_optimization.py", param = "-g CONTINUOUS_ADJOINT -f") opt_2surf1obj_py.timeout = 1600 opt_2surf1obj_py.tol = 0.00001 @@ -1558,9 +1488,8 @@ def main(): pywrapper_naca0012.cfg_dir = "euler/naca0012" pywrapper_naca0012.cfg_file = "inv_NACA0012_Roe.cfg" pywrapper_naca0012.test_iter = 20 - pywrapper_naca0012.test_vals = [-4.023999, -3.515034, 0.339426, 0.022217] #last 4 columns + pywrapper_naca0012.test_vals = [-4.023999, -3.515034, 0.339426, 0.022217] pywrapper_naca0012.command = TestCase.Command(exec = "SU2_CFD.py", param = "-f") - pywrapper_naca0012.new_output = True pywrapper_naca0012.timeout = 1600 pywrapper_naca0012.tol = 0.00001 test_list.append(pywrapper_naca0012) @@ -1571,10 +1500,9 @@ def main(): pywrapper_turb_naca0012_sst.cfg_dir = "rans/naca0012" pywrapper_turb_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" pywrapper_turb_naca0012_sst.test_iter = 10 - pywrapper_turb_naca0012_sst.test_vals = [-11.421948, -12.801962, -5.865325, 1.049990, 0.019163, -1.939735, -38.695000] - pywrapper_turb_naca0012_sst.test_vals_aarch64 = [-11.451014, -12.798258, -5.863895, 1.049989, 0.019163, -1.925032, -38.694000] + pywrapper_turb_naca0012_sst.test_vals = [-12.213755, -14.439873, -7.108062, 1.050109, 0.019148, -1.875539, -38.510000] + pywrapper_turb_naca0012_sst.test_vals_aarch64 = [-12.213728, -14.439873, -7.108062, 1.050109, 0.019148, -1.875538, -38.510000] pywrapper_turb_naca0012_sst.command = TestCase.Command(exec = "SU2_CFD.py", param = "-f") - pywrapper_turb_naca0012_sst.new_output = True pywrapper_turb_naca0012_sst.timeout = 3200 pywrapper_turb_naca0012_sst.tol = 0.00001 test_list.append(pywrapper_turb_naca0012_sst) @@ -1585,7 +1513,7 @@ def main(): pywrapper_square_cylinder.cfg_dir = "unsteady/square_cylinder" pywrapper_square_cylinder.cfg_file = "turb_square.cfg" pywrapper_square_cylinder.test_iter = 3 - pywrapper_square_cylinder.test_vals = [-2.557820, -1.158056, 0.067984, 1.399788, 2.220411, 1.399743, 2.218612, -0.453170] + pywrapper_square_cylinder.test_vals = [-2.557884, -1.173573, 0.058052, 1.399794, 2.220411, 1.399748, 2.218612, -0.453340] pywrapper_square_cylinder.command = TestCase.Command(exec = "SU2_CFD.py", param = "-f") pywrapper_square_cylinder.timeout = 1600 pywrapper_square_cylinder.tol = 0.00001 @@ -1600,7 +1528,6 @@ def main(): pywrapper_aeroelastic.test_iter = 2 pywrapper_aeroelastic.test_vals = [0.074836, 0.033102, -0.001650, -0.000127] pywrapper_aeroelastic.command = TestCase.Command(exec = "SU2_CFD.py", param = "-f") - pywrapper_aeroelastic.new_output = True pywrapper_aeroelastic.timeout = 1600 pywrapper_aeroelastic.tol = 0.00001 pywrapper_aeroelastic.unsteady = True @@ -1612,9 +1539,8 @@ def main(): pywrapper_fsi2d.cfg_dir = "fea_fsi/WallChannel_2d" pywrapper_fsi2d.cfg_file = "configFSI.cfg" pywrapper_fsi2d.test_iter = 4 - pywrapper_fsi2d.test_vals = [4, 0, -3.743214, -4.133482] #last 4 columns + pywrapper_fsi2d.test_vals = [4.000000, 0.000000, -3.743214, -4.133482] pywrapper_fsi2d.command = TestCase.Command(exec = "SU2_CFD.py", param = "--nZone 2 --fsi True -f") - pywrapper_fsi2d.new_output = True pywrapper_fsi2d.unsteady = True pywrapper_fsi2d.multizone = True pywrapper_fsi2d.timeout = 1600 @@ -1627,10 +1553,9 @@ def main(): pywrapper_unsteadyCHT.cfg_dir = "py_wrapper/flatPlate_unsteady_CHT" pywrapper_unsteadyCHT.cfg_file = "unsteady_CHT_FlatPlate_Conf.cfg" pywrapper_unsteadyCHT.test_iter = 5 - pywrapper_unsteadyCHT.test_vals = [-1.614167, 2.245716, 0.000766, 0.175719] + pywrapper_unsteadyCHT.test_vals = [-1.614167, 2.240658, 0.000772, 0.177467] pywrapper_unsteadyCHT.command = TestCase.Command(exec = "python", param = "launch_unsteady_CHT_FlatPlate.py -f") pywrapper_unsteadyCHT.timeout = 1600 - pywrapper_unsteadyCHT.new_output = True pywrapper_unsteadyCHT.tol = 0.00001 pywrapper_unsteadyCHT.unsteady = True test_list.append(pywrapper_unsteadyCHT) @@ -1641,9 +1566,8 @@ def main(): pywrapper_rigidMotion.cfg_dir = "py_wrapper/flatPlate_rigidMotion" pywrapper_rigidMotion.cfg_file = "flatPlate_rigidMotion_Conf.cfg" pywrapper_rigidMotion.test_iter = 5 - pywrapper_rigidMotion.test_vals = [-1.614170, 2.242953, 0.350050, 0.093116] + pywrapper_rigidMotion.test_vals = [-1.614165, 2.238592, 0.349984, 0.095593] pywrapper_rigidMotion.command = TestCase.Command(exec = "python", param = "launch_flatPlate_rigidMotion.py -f") - pywrapper_rigidMotion.new_output = True pywrapper_rigidMotion.timeout = 1600 pywrapper_rigidMotion.tol = 0.00001 pywrapper_rigidMotion.unsteady = True diff --git a/TestCases/serial_regression_AD.py b/TestCases/serial_regression_AD.py index edebb37e0d1..e8300572518 100644 --- a/TestCases/serial_regression_AD.py +++ b/TestCases/serial_regression_AD.py @@ -3,7 +3,7 @@ ## \file serial_regression.py # \brief Python script for automated regression testing of SU2 examples # \author A. Aranake, A. Campos, T. Economon, T. Lukaczyk, S. Padron -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -75,7 +75,7 @@ def main(): discadj_rans_naca0012_sa.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sa.cfg_file = "turb_NACA0012_sa.cfg" discadj_rans_naca0012_sa.test_iter = 10 - discadj_rans_naca0012_sa.test_vals = [-2.230555, 0.645023, 0.180740, -0.000018, 5.000000, -4.275184, 5.000000, -8.892454] #last 8 columns + discadj_rans_naca0012_sa.test_vals = [-2.230545, 0.644224, 0.180740, -0.000018, 5.000000, -4.275182, 5.000000, -10.051224] test_list.append(discadj_rans_naca0012_sa) # Adjoint turbulent NACA0012 SST @@ -83,7 +83,7 @@ def main(): discadj_rans_naca0012_sst.cfg_dir = "disc_adj_rans/naca0012" discadj_rans_naca0012_sst.cfg_file = "turb_NACA0012_sst.cfg" discadj_rans_naca0012_sst.test_iter = 10 - discadj_rans_naca0012_sst.test_vals = [-2.221792, -0.491367, 0.182010, -0.000018] + discadj_rans_naca0012_sst.test_vals = [-2.221845, -0.491927, 0.182000, -0.000018] test_list.append(discadj_rans_naca0012_sst) ####################################### @@ -110,26 +110,6 @@ def main(): discadj_incomp_cylinder.test_vals = [20.000000, -2.373367, -2.368305, 0.000000] #last 4 columns test_list.append(discadj_incomp_cylinder) - ###################################### - ### Disc. adj. incompressible RANS ### - ###################################### - - # Adjoint Incompressible Turbulent NACA 0012 SA - discadj_incomp_turb_NACA0012_sa = TestCase('discadj_incomp_turb_NACA0012_sa') - discadj_incomp_turb_NACA0012_sa.cfg_dir = "disc_adj_incomp_rans/naca0012" - discadj_incomp_turb_NACA0012_sa.cfg_file = "turb_naca0012_sa.cfg" - discadj_incomp_turb_NACA0012_sa.test_iter = 10 - discadj_incomp_turb_NACA0012_sa.test_vals = [10.000000, -3.845979, -1.031095, 0.000000] #last 4 columns - test_list.append(discadj_incomp_turb_NACA0012_sa) - - # Adjoint Incompressible Turbulent NACA 0012 SST - discadj_incomp_turb_NACA0012_sst = TestCase('discadj_incomp_turb_NACA0012_sst') - discadj_incomp_turb_NACA0012_sst.cfg_dir = "disc_adj_incomp_rans/naca0012" - discadj_incomp_turb_NACA0012_sst.cfg_file = "turb_naca0012_sst.cfg" - discadj_incomp_turb_NACA0012_sst.test_iter = 10 - discadj_incomp_turb_NACA0012_sst.test_vals = [-3.845577, -2.414021, -8.420183, 0.000000] #last 4 columns - test_list.append(discadj_incomp_turb_NACA0012_sst) - ####################################################### ### Unsteady Disc. adj. compressible RANS ### ####################################################### @@ -187,8 +167,8 @@ def main(): discadj_fea.cfg_dir = "disc_adj_fea" discadj_fea.cfg_file = "configAD_fem.cfg" discadj_fea.test_iter = 4 - discadj_fea.test_vals = [-2.849531, -3.238474, -3.6413e-04, -8.7087] #last 4 columns - discadj_fea.test_vals_aarch64 = [-2.849570, -3.238519, -3.6413e-04, -8.7087] #last 4 columns + discadj_fea.test_vals = [-2.849781, -3.238667, -0.000364, -8.708700] + discadj_fea.tol = 0.00007 test_list.append(discadj_fea) ################################### @@ -200,7 +180,7 @@ def main(): discadj_heat.cfg_dir = "disc_adj_heat" discadj_heat.cfg_file = "disc_adj_heat.cfg" discadj_heat.test_iter = 10 - discadj_heat.test_vals = [-2.227518, 0.576043, 0.000000, -7.753900] #last 4 columns + discadj_heat.test_vals = [-2.227530, 0.577932, 0.000000, -7.754000] test_list.append(discadj_heat) ################################### @@ -212,7 +192,7 @@ def main(): discadj_fsi.cfg_dir = "disc_adj_fsi" discadj_fsi.cfg_file = "config.cfg" discadj_fsi.test_iter = 6 - discadj_fsi.test_vals = [6, -1.572702, -3.084381, 4.3990e-04, -1.0631] #last 5 columns + discadj_fsi.test_vals = [6.000000, -1.965877, -3.084381, 0.000440, -1.063100] #last 5 columns test_list.append(discadj_fsi) ################################### @@ -224,7 +204,7 @@ def main(): discadj_cht.cfg_dir = "coupled_cht/disc_adj_incomp_2d" discadj_cht.cfg_file = "cht_2d_3cylinders.cfg" discadj_cht.test_iter = 10 - discadj_cht.test_vals = [-2.364405, -3.085551, -3.085518, -3.085513] #last 4 columns + discadj_cht.test_vals = [-2.955506, -3.085551, -3.085518, -3.085513] #last 4 columns test_list.append(discadj_cht) ###################################### @@ -344,17 +324,17 @@ def main(): pass_list.append(pywrapper_FEA_AD_FlowLoad.run_test()) # Flow AD Mesh Displacement Sensitivity - pywrapper_FEA_AD_FlowLoad = TestCase('pywrapper_CFD_AD_MeshDisp') - pywrapper_FEA_AD_FlowLoad.cfg_dir = "py_wrapper/disc_adj_flow/mesh_disp_sens" - pywrapper_FEA_AD_FlowLoad.cfg_file = "configAD_flow.cfg" - pywrapper_FEA_AD_FlowLoad.test_iter = 1000 - pywrapper_FEA_AD_FlowLoad.test_vals = [30.000000, -2.518695, 1.390150, 0.000000] #last 4 columns - pywrapper_FEA_AD_FlowLoad.command = TestCase.Command(exec = "python", param = "run_adjoint.py -f") - pywrapper_FEA_AD_FlowLoad.timeout = 1600 - pywrapper_FEA_AD_FlowLoad.tol = 0.000001 - pywrapper_FEA_AD_FlowLoad.new_output = False - test_list.append(pywrapper_FEA_AD_FlowLoad) - pass_list.append(pywrapper_FEA_AD_FlowLoad.run_test()) + pywrapper_CFD_AD_MeshDisp = TestCase('pywrapper_CFD_AD_MeshDisp') + pywrapper_CFD_AD_MeshDisp.cfg_dir = "py_wrapper/disc_adj_flow/mesh_disp_sens" + pywrapper_CFD_AD_MeshDisp.cfg_file = "configAD_flow.cfg" + pywrapper_CFD_AD_MeshDisp.test_iter = 1000 + pywrapper_CFD_AD_MeshDisp.test_vals = [30.000000, -2.518695, 1.390150, 0.000000] #last 4 columns + pywrapper_CFD_AD_MeshDisp.command = TestCase.Command(exec = "python", param = "run_adjoint.py -f") + pywrapper_CFD_AD_MeshDisp.timeout = 1600 + pywrapper_CFD_AD_MeshDisp.tol = 0.000001 + pywrapper_CFD_AD_MeshDisp.new_output = False + test_list.append(pywrapper_CFD_AD_MeshDisp) + pass_list.append(pywrapper_CFD_AD_MeshDisp.run_test()) ################################### diff --git a/TestCases/sliding_interface/bars_SST_2D/bars.cfg b/TestCases/sliding_interface/bars_SST_2D/bars.cfg index 02c1183f074..bc43e495803 100644 --- a/TestCases/sliding_interface/bars_SST_2D/bars.cfg +++ b/TestCases/sliding_interface/bars_SST_2D/bars.cfg @@ -5,7 +5,7 @@ % Author: A. Rubino % % Institution: Delft University of Technology % % Date: Feb 27th, 2017 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % @@ -102,8 +102,6 @@ MG_DAMP_PROLONGATION= 0.75 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= NONE VENKAT_LIMITER_COEFF= 0.02 TIME_DISCRE_FLOW= EULER_IMPLICIT diff --git a/TestCases/sliding_interface/bars_SST_2D/zone_1.cfg b/TestCases/sliding_interface/bars_SST_2D/zone_1.cfg index c1a65e2f854..7a20c9c665e 100644 --- a/TestCases/sliding_interface/bars_SST_2D/zone_1.cfg +++ b/TestCases/sliding_interface/bars_SST_2D/zone_1.cfg @@ -5,7 +5,7 @@ % Author: A. Rubino % % Institution: Delft University of Technology % % Date: Feb 27th, 2017 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/bars_SST_2D/zone_2.cfg b/TestCases/sliding_interface/bars_SST_2D/zone_2.cfg index 85af3fd372d..10a4e2936c5 100644 --- a/TestCases/sliding_interface/bars_SST_2D/zone_2.cfg +++ b/TestCases/sliding_interface/bars_SST_2D/zone_2.cfg @@ -5,7 +5,7 @@ % Author: A. Rubino % % Institution: Delft University of Technology % % Date: Feb 27th, 2017 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/sliding_interface/bars_SST_2D/zone_3.cfg b/TestCases/sliding_interface/bars_SST_2D/zone_3.cfg index bd7e75c4d8d..8f184e207e2 100644 --- a/TestCases/sliding_interface/bars_SST_2D/zone_3.cfg +++ b/TestCases/sliding_interface/bars_SST_2D/zone_3.cfg @@ -5,7 +5,7 @@ % Author: A. Rubino % % Institution: Delft University of Technology % % Date: Feb 27th, 2017 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/channel_2D/channel_2D_NN.cfg b/TestCases/sliding_interface/channel_2D/channel_2D_NN.cfg index e546995168e..c2eb991a72e 100644 --- a/TestCases/sliding_interface/channel_2D/channel_2D_NN.cfg +++ b/TestCases/sliding_interface/channel_2D/channel_2D_NN.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/channel_2D/channel_2D_WA.cfg b/TestCases/sliding_interface/channel_2D/channel_2D_WA.cfg index 7c38f87366c..2f1dc19dcf7 100644 --- a/TestCases/sliding_interface/channel_2D/channel_2D_WA.cfg +++ b/TestCases/sliding_interface/channel_2D/channel_2D_WA.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/channel_2D/zone_2.cfg b/TestCases/sliding_interface/channel_2D/zone_2.cfg index 81fd7b5a632..6040c078bcf 100644 --- a/TestCases/sliding_interface/channel_2D/zone_2.cfg +++ b/TestCases/sliding_interface/channel_2D/zone_2.cfg @@ -5,7 +5,7 @@ % Author: A. Rubino % % Institution: Delft University of Technology % % Date: Feb 27th, 2017 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/sliding_interface/channel_2D/zone_3.cfg b/TestCases/sliding_interface/channel_2D/zone_3.cfg index bd7e75c4d8d..8f184e207e2 100644 --- a/TestCases/sliding_interface/channel_2D/zone_3.cfg +++ b/TestCases/sliding_interface/channel_2D/zone_3.cfg @@ -5,7 +5,7 @@ % Author: A. Rubino % % Institution: Delft University of Technology % % Date: Feb 27th, 2017 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/channel_3D/channel_3D_NN.cfg b/TestCases/sliding_interface/channel_3D/channel_3D_NN.cfg index ff4f2a2c47f..836e18b052e 100644 --- a/TestCases/sliding_interface/channel_3D/channel_3D_NN.cfg +++ b/TestCases/sliding_interface/channel_3D/channel_3D_NN.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/channel_3D/channel_3D_WA.cfg b/TestCases/sliding_interface/channel_3D/channel_3D_WA.cfg index c45d7e5b6ab..6e89041dc95 100644 --- a/TestCases/sliding_interface/channel_3D/channel_3D_WA.cfg +++ b/TestCases/sliding_interface/channel_3D/channel_3D_WA.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/channel_3D/zone_1.cfg b/TestCases/sliding_interface/channel_3D/zone_1.cfg index 58bf4da96e9..f0863a91ad2 100644 --- a/TestCases/sliding_interface/channel_3D/zone_1.cfg +++ b/TestCases/sliding_interface/channel_3D/zone_1.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/channel_3D/zone_2.cfg b/TestCases/sliding_interface/channel_3D/zone_2.cfg index 63c195e9d21..7fd28d0e8a4 100644 --- a/TestCases/sliding_interface/channel_3D/zone_2.cfg +++ b/TestCases/sliding_interface/channel_3D/zone_2.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/sliding_interface/channel_3D/zone_3.cfg b/TestCases/sliding_interface/channel_3D/zone_3.cfg index 27e586baa60..761a126c09d 100644 --- a/TestCases/sliding_interface/channel_3D/zone_3.cfg +++ b/TestCases/sliding_interface/channel_3D/zone_3.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/sliding_interface/incompressible_steady/config.cfg b/TestCases/sliding_interface/incompressible_steady/config.cfg index 0abe97efa10..cc19cc09a15 100644 --- a/TestCases/sliding_interface/incompressible_steady/config.cfg +++ b/TestCases/sliding_interface/incompressible_steady/config.cfg @@ -5,7 +5,7 @@ % Author: Ruben Sanchez % % Institution: Chair for Scientific Computing, TU Kaiserslautern % % Date: January 28th, 2018 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/sliding_interface/incompressible_steady/configCircle.cfg b/TestCases/sliding_interface/incompressible_steady/configCircle.cfg index 82943af7b81..757f2469edc 100644 --- a/TestCases/sliding_interface/incompressible_steady/configCircle.cfg +++ b/TestCases/sliding_interface/incompressible_steady/configCircle.cfg @@ -5,7 +5,7 @@ % Author: Ruben Sanchez % % Institution: Chair for Scientific Computing, TU Kaiserslautern % % Date: January 28th, 2018 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/sliding_interface/incompressible_steady/configOut.cfg b/TestCases/sliding_interface/incompressible_steady/configOut.cfg index d19fb2e702c..f9523435cce 100644 --- a/TestCases/sliding_interface/incompressible_steady/configOut.cfg +++ b/TestCases/sliding_interface/incompressible_steady/configOut.cfg @@ -5,7 +5,7 @@ % Author: Ruben Sanchez % % Institution: Chair for Scientific Computing, TU Kaiserslautern % % Date: January 28th, 2018 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/sliding_interface/incompressible_unsteady/config.cfg b/TestCases/sliding_interface/incompressible_unsteady/config.cfg index 4c3221eff70..ea76fd46db9 100644 --- a/TestCases/sliding_interface/incompressible_unsteady/config.cfg +++ b/TestCases/sliding_interface/incompressible_unsteady/config.cfg @@ -5,7 +5,7 @@ % Author: Ruben Sanchez % % Institution: Chair for Scientific Computing, TU Kaiserslautern % % Date: January 28th, 2018 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/sliding_interface/incompressible_unsteady/configCircle.cfg b/TestCases/sliding_interface/incompressible_unsteady/configCircle.cfg index 9bc21717854..6640fda6613 100644 --- a/TestCases/sliding_interface/incompressible_unsteady/configCircle.cfg +++ b/TestCases/sliding_interface/incompressible_unsteady/configCircle.cfg @@ -5,7 +5,7 @@ % Author: Ruben Sanchez % % Institution: Chair for Scientific Computing, TU Kaiserslautern % % Date: January 28th, 2018 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/sliding_interface/incompressible_unsteady/configOut.cfg b/TestCases/sliding_interface/incompressible_unsteady/configOut.cfg index 29941635096..7885a977b1e 100644 --- a/TestCases/sliding_interface/incompressible_unsteady/configOut.cfg +++ b/TestCases/sliding_interface/incompressible_unsteady/configOut.cfg @@ -5,7 +5,7 @@ % Author: Ruben Sanchez % % Institution: Chair for Scientific Computing, TU Kaiserslautern % % Date: January 28th, 2018 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/sliding_interface/pipe/pipe_NN.cfg b/TestCases/sliding_interface/pipe/pipe_NN.cfg index 3913e6b54d9..d7b7b982336 100644 --- a/TestCases/sliding_interface/pipe/pipe_NN.cfg +++ b/TestCases/sliding_interface/pipe/pipe_NN.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/pipe/pipe_WA.cfg b/TestCases/sliding_interface/pipe/pipe_WA.cfg index f7ec3b6e11d..307ada6e126 100644 --- a/TestCases/sliding_interface/pipe/pipe_WA.cfg +++ b/TestCases/sliding_interface/pipe/pipe_WA.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/pipe/zone_1.cfg b/TestCases/sliding_interface/pipe/zone_1.cfg index a5e3c809779..487b236174a 100644 --- a/TestCases/sliding_interface/pipe/zone_1.cfg +++ b/TestCases/sliding_interface/pipe/zone_1.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/pipe/zone_2.cfg b/TestCases/sliding_interface/pipe/zone_2.cfg index eecb43bb74d..29e2f7de0d0 100644 --- a/TestCases/sliding_interface/pipe/zone_2.cfg +++ b/TestCases/sliding_interface/pipe/zone_2.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/pipe/zone_3.cfg b/TestCases/sliding_interface/pipe/zone_3.cfg index e820acd1080..102d9e56724 100644 --- a/TestCases/sliding_interface/pipe/zone_3.cfg +++ b/TestCases/sliding_interface/pipe/zone_3.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/pipe/zone_4.cfg b/TestCases/sliding_interface/pipe/zone_4.cfg index fcb17f1306e..6aff37ad147 100644 --- a/TestCases/sliding_interface/pipe/zone_4.cfg +++ b/TestCases/sliding_interface/pipe/zone_4.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/pipe/zone_5.cfg b/TestCases/sliding_interface/pipe/zone_5.cfg index eecb43bb74d..29e2f7de0d0 100644 --- a/TestCases/sliding_interface/pipe/zone_5.cfg +++ b/TestCases/sliding_interface/pipe/zone_5.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_NN.cfg b/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_NN.cfg index d87a7ca0380..fde950d8301 100644 --- a/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_NN.cfg +++ b/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_NN.cfg @@ -5,7 +5,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_WA.cfg b/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_WA.cfg index 4175de10251..a41e54fc9df 100644 --- a/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_WA.cfg +++ b/TestCases/sliding_interface/rotating_cylinders/rot_cylinders_WA.cfg @@ -5,7 +5,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/single_stage/single_stage_NN.cfg b/TestCases/sliding_interface/single_stage/single_stage_NN.cfg index 27cd9e3f2ac..ec60565c35c 100644 --- a/TestCases/sliding_interface/single_stage/single_stage_NN.cfg +++ b/TestCases/sliding_interface/single_stage/single_stage_NN.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/single_stage/single_stage_WA.cfg b/TestCases/sliding_interface/single_stage/single_stage_WA.cfg index db325d42231..01ac60458d8 100644 --- a/TestCases/sliding_interface/single_stage/single_stage_WA.cfg +++ b/TestCases/sliding_interface/single_stage/single_stage_WA.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/single_stage/zone_1.cfg b/TestCases/sliding_interface/single_stage/zone_1.cfg index d9e3562d2f8..2b5a41feccb 100644 --- a/TestCases/sliding_interface/single_stage/zone_1.cfg +++ b/TestCases/sliding_interface/single_stage/zone_1.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/single_stage/zone_2.cfg b/TestCases/sliding_interface/single_stage/zone_2.cfg index a1f8e39705f..22481326908 100644 --- a/TestCases/sliding_interface/single_stage/zone_2.cfg +++ b/TestCases/sliding_interface/single_stage/zone_2.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_NN.cfg b/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_NN.cfg index 63142b86007..157a43a7124 100644 --- a/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_NN.cfg +++ b/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_NN.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_WA.cfg b/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_WA.cfg index 5c5a27cdef5..9e3729a2ade 100644 --- a/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_WA.cfg +++ b/TestCases/sliding_interface/supersonic_vortex_shedding/sup_vor_shed_WA.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/supersonic_vortex_shedding/zone_1.cfg b/TestCases/sliding_interface/supersonic_vortex_shedding/zone_1.cfg index eaec56b6f9d..ef3679f63e4 100644 --- a/TestCases/sliding_interface/supersonic_vortex_shedding/zone_1.cfg +++ b/TestCases/sliding_interface/supersonic_vortex_shedding/zone_1.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/sliding_interface/supersonic_vortex_shedding/zone_2.cfg b/TestCases/sliding_interface/supersonic_vortex_shedding/zone_2.cfg index 66b6fc00f87..5d9e8b2bbaa 100644 --- a/TestCases/sliding_interface/supersonic_vortex_shedding/zone_2.cfg +++ b/TestCases/sliding_interface/supersonic_vortex_shedding/zone_2.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/sliding_interface/uniform_flow/uniform_NN.cfg b/TestCases/sliding_interface/uniform_flow/uniform_NN.cfg index a6235e7dfae..2b3c84f7dd5 100644 --- a/TestCases/sliding_interface/uniform_flow/uniform_NN.cfg +++ b/TestCases/sliding_interface/uniform_flow/uniform_NN.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/uniform_flow/uniform_WA.cfg b/TestCases/sliding_interface/uniform_flow/uniform_WA.cfg index 55a7a8c2fe4..3dd8981de59 100644 --- a/TestCases/sliding_interface/uniform_flow/uniform_WA.cfg +++ b/TestCases/sliding_interface/uniform_flow/uniform_WA.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/sliding_interface/uniform_flow/zone_1.cfg b/TestCases/sliding_interface/uniform_flow/zone_1.cfg index 2caae2c2b18..a49ac681c71 100644 --- a/TestCases/sliding_interface/uniform_flow/zone_1.cfg +++ b/TestCases/sliding_interface/uniform_flow/zone_1.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/sliding_interface/uniform_flow/zone_2.cfg b/TestCases/sliding_interface/uniform_flow/zone_2.cfg index 60da4c4a95d..d4b7417f236 100644 --- a/TestCases/sliding_interface/uniform_flow/zone_2.cfg +++ b/TestCases/sliding_interface/uniform_flow/zone_2.cfg @@ -6,7 +6,7 @@ % Author: G. Gori % % Institution: Politecnico di Milano % % Date: Oct 5th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/solid_heat_conduction/periodic_pins/configSolid.cfg b/TestCases/solid_heat_conduction/periodic_pins/configSolid.cfg index 2db8bed2736..f96249130fe 100644 --- a/TestCases/solid_heat_conduction/periodic_pins/configSolid.cfg +++ b/TestCases/solid_heat_conduction/periodic_pins/configSolid.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Bosch Thermotechniek B.V. % % Date: 2021.09.27 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/species_transport/multizone/configMaster.cfg b/TestCases/species_transport/multizone/configMaster.cfg index 4f4f1ca2cae..6a7c2ba8b2b 100644 --- a/TestCases/species_transport/multizone/configMaster.cfg +++ b/TestCases/species_transport/multizone/configMaster.cfg @@ -5,7 +5,7 @@ % Author: N. Beishuizen % % Institution: Technische Universiteit Eindhoven % % Date: November 1, 2022 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/species_transport/multizone/zone1.cfg b/TestCases/species_transport/multizone/zone1.cfg index 50c6e455e4c..c18f0565b1e 100644 --- a/TestCases/species_transport/multizone/zone1.cfg +++ b/TestCases/species_transport/multizone/zone1.cfg @@ -19,7 +19,6 @@ INLET_FILENAME= inlet_venturi.dat INC_INLET_TYPE= VELOCITY_INLET VELOCITY_INLET MARKER_INLET= ( gas_inlet1, 300.0, 1.0, 1.0, 0.0, 0.0,\ air_axial_inlet1, 305.0, 1.0, 0.0 -1.0, 0.0 ) -SPECIES_USE_STRONG_BC= NO MARKER_INLET_SPECIES= (gas_inlet1, 0.5, 0.5,\ air_axial_inlet1, 0.6, 0.0 ) MARKER_PLOTTING= (NONE) diff --git a/TestCases/species_transport/multizone/zone2.cfg b/TestCases/species_transport/multizone/zone2.cfg index 622685ab51f..2ad80c3dd58 100644 --- a/TestCases/species_transport/multizone/zone2.cfg +++ b/TestCases/species_transport/multizone/zone2.cfg @@ -18,7 +18,6 @@ SPECIFIED_INLET_PROFILE= NO INLET_FILENAME= inlet_venturi.dat INC_INLET_TYPE= VELOCITY_INLET MARKER_INLET= ( air_axial_inlet2, 310.0, 1.2, 0.0 -1.0, 0.0 ) -SPECIES_USE_STRONG_BC= NO MARKER_INLET_SPECIES= (air_axial_inlet2, 0.6, 0.0 ) INC_OUTLET_TYPE= PRESSURE_OUTLET MARKER_OUTLET= ( outlet2, 0.0 ) diff --git a/TestCases/species_transport/passive_transport_validation/passive_transport.cfg b/TestCases/species_transport/passive_transport_validation/passive_transport.cfg index 09c870157d6..fa8becb14b7 100644 --- a/TestCases/species_transport/passive_transport_validation/passive_transport.cfg +++ b/TestCases/species_transport/passive_transport_validation/passive_transport.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Bosch Thermotechniek B.V % % Date: 2021.10.02 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -52,7 +52,7 @@ MARKER_SYM= ( top, bottom ) INC_INLET_TYPE= VELOCITY_INLET, VELOCITY_INLET MARKER_INLET= ( gas_inlet, 300, 1, 1.0, 0.0, 0.0, air_inlet, 300, 1, 1.0, 0.0, 0.0 ) % -SPECIES_USE_STRONG_BC= YES +MARKER_SPECIES_STRONG_BC= (gas_inlet, air_inlet, outlet) MARKER_INLET_SPECIES = (gas_inlet, 1.0, air_inlet, 0.0 ) % INC_OUTLET_TYPE= PRESSURE_OUTLET diff --git a/TestCases/species_transport/venturi_primitive_3species/DAspecies3_primitiveVenturi.cfg b/TestCases/species_transport/venturi_primitive_3species/DAspecies3_primitiveVenturi.cfg deleted file mode 100644 index f7c31afcc12..00000000000 --- a/TestCases/species_transport/venturi_primitive_3species/DAspecies3_primitiveVenturi.cfg +++ /dev/null @@ -1,141 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file % -% Case description: Discrete Adjiont Species mixing with 3 species % -% Author: T. Kattmann % -% Institution: Bosch Thermotechniek B.V. % -% Date: 2021/10/14 % -% File Version 7.5.1 "Blackbird" % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% -% -SOLVER= INC_RANS -KIND_TURB_MODEL= SST -% -OBJECTIVE_FUNCTION= SURFACE_SPECIES_VARIANCE -OBJECTIVE_WEIGHT= 1.0 -% -% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% -% -INC_DENSITY_MODEL= CONSTANT -INC_DENSITY_INIT= 1.1766 -% -INC_VELOCITY_INIT= ( 1.00, 0.0, 0.0 ) -% -INC_ENERGY_EQUATION= YES -INC_TEMPERATURE_INIT= 300.0 -% -INC_NONDIM= INITIAL_VALUES -% -% -------------------- FLUID PROPERTIES ------------------------------------- % -% -FLUID_MODEL= CONSTANT_DENSITY -% -CONDUCTIVITY_MODEL= CONSTANT_CONDUCTIVITY -THERMAL_CONDUCTIVITY_CONSTANT= 0.0357 -% -PRANDTL_LAM= 0.72 -TURBULENT_CONDUCTIVITY_MODEL= NONE -PRANDTL_TURB= 0.90 -% -VISCOSITY_MODEL= CONSTANT_VISCOSITY -MU_CONSTANT= 1.716E-5 -% -% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% -% -MARKER_HEATFLUX= ( wall, 0.0 ) -MARKER_SYM= ( axis ) -% -SPECIFIED_INLET_PROFILE= NO -INLET_FILENAME= inlet_venturi.dat -INC_INLET_TYPE= VELOCITY_INLET VELOCITY_INLET -MARKER_INLET= ( gas_inlet, 300, 1.0, 1.0, 0.0, 0.0,\ - air_axial_inlet, 300, 1.0, 0.0, -1.0, 0.0 ) -SPECIES_USE_STRONG_BC= YES -MARKER_INLET_SPECIES= (gas_inlet, 0.5, 0.5,\ - air_axial_inlet, 0.6, 0.0 ) -% -INC_OUTLET_TYPE= PRESSURE_OUTLET -MARKER_OUTLET= ( outlet, 0.0 ) -% -% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% -% -NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES -% -% Note that the CFL-Number was dramatically reduced compared to the primal. -% This was necessary to ensure proper convergence. It is not necessary to do -% this for a reasonably accurate gradient validation though. -CFL_NUMBER= 500 -CFL_REDUCTION_SPECIES= 1.0 -CFL_REDUCTION_TURB= 1.0 -% -% Run commented Iter for good results -ITER= 50 -% -% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% -% -LINEAR_SOLVER= FGMRES -LINEAR_SOLVER_PREC= ILU -LINEAR_SOLVER_ERROR= 1E-8 -LINEAR_SOLVER_ITER= 20 -% -% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% -% -CONV_NUM_METHOD_FLOW= FDS -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW = NONE -TIME_DISCRE_FLOW= EULER_IMPLICIT -% -% -------------------- SCALAR TRANSPORT ---------------------------------------% -% -KIND_SCALAR_MODEL= SPECIES_TRANSPORT -DIFFUSIVITY_MODEL= CONSTANT_DIFFUSIVITY -DIFFUSIVITY_CONSTANT= 0.001 -% -CONV_NUM_METHOD_SPECIES= SCALAR_UPWIND -MUSCL_SPECIES= NO -SLOPE_LIMITER_SPECIES = NONE -% -TIME_DISCRE_SPECIES= EULER_IMPLICIT -% -SPECIES_INIT= 1.0, 0.0 -SPECIES_CLIPPING= YES -SPECIES_CLIPPING_MIN= 0.0, 0.0 -SPECIES_CLIPPING_MAX= 1.0, 1.0 -% -% -------------------- TURBULENT TRANSPORT ---------------------------------------% -% -CONV_NUM_METHOD_TURB= SCALAR_UPWIND -MUSCL_TURB= NO -% -% --------------------------- CONVERGENCE PARAMETERS --------------------------% -% -CONV_FIELD= RMS_PRESSURE, RMS_VELOCITY-X, RMS_VELOCITY-Y, RMS_TKE, RMS_SPECIES -CONV_RESIDUAL_MINVAL= -18 -CONV_STARTITER= 10 -% -% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% -% -MESH_FILENAME= primitiveVenturi.su2 -SCREEN_OUTPUT= INNER_ITER WALL_TIME RMS_ADJ_PRESSURE RMS_ADJ_VELOCITY-X RMS_ADJ_VELOCITY-Y RMS_ADJ_TKE RMS_ADJ_DISSIPATION RMS_ADJ_SPECIES_0 RMS_ADJ_SPECIES_1 -SCREEN_WRT_FREQ_INNER= 10 -% -HISTORY_OUTPUT= ITER RMS_RES LINSOL -CONV_FILENAME= history -MARKER_ANALYZE= outlet -MARKER_ANALYZE_AVERAGE= MASSFLUX -% -OUTPUT_FILES= RESTART_ASCII, PARAVIEW -VOLUME_OUTPUT= RESIDUAL, PRIMITIVE -OUTPUT_WRT_FREQ= 1000 -% -GRAD_OBJFUNC_FILENAME= of_grad.csv -% -RESTART_SOL= NO -READ_BINARY_RESTART= NO -RESTART_FILENAME= restart -SOLUTION_FILENAME= solution -% -WRT_PERFORMANCE= YES diff --git a/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi.cfg b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi.cfg index 6a223174a54..1b71c6a547c 100644 --- a/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi.cfg +++ b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Bosch Thermotechniek B.V. % % Date: 2021/10/14 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -48,7 +48,6 @@ MARKER_SYM= ( axis ) INC_INLET_TYPE= VELOCITY_INLET VELOCITY_INLET MARKER_INLET= ( gas_inlet, 300, 1.0, 1.0, 0.0, 0.0,\ air_axial_inlet, 300, 1.0, 0.0, -1.0, 0.0 ) -SPECIES_USE_STRONG_BC= NO MARKER_INLET_SPECIES= (gas_inlet, 1.0,\ air_axial_inlet, 0.6 ) % diff --git a/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_boundedscalar.cfg b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_boundedscalar.cfg index b38b3390754..203761d77b7 100644 --- a/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_boundedscalar.cfg +++ b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_boundedscalar.cfg @@ -5,7 +5,7 @@ % Author: T. Kattmann % % Institution: Bosch Thermotechniek B.V. % % Date: 2021/10/14 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -48,7 +48,6 @@ MARKER_SYM= ( axis ) INC_INLET_TYPE= VELOCITY_INLET VELOCITY_INLET MARKER_INLET= ( gas_inlet, 300, 1.0, 1.0, 0.0, 0.0,\ air_axial_inlet, 300, 1.0, 0.0, -1.0, 0.0 ) -SPECIES_USE_STRONG_BC= NO MARKER_INLET_SPECIES= (gas_inlet, 1.0,\ air_axial_inlet, 0.6 ) % diff --git a/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel.cfg b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel.cfg index 7b022511d86..92d226acb9a 100644 --- a/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel.cfg +++ b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel.cfg @@ -7,7 +7,7 @@ % Author: Cristopher Morales Ubal % % Institution: Eindhoven University of Technology % % Date: 2022/06/15 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -60,7 +60,6 @@ INLET_FILENAME= inlet_venturi.dat INC_INLET_TYPE= VELOCITY_INLET VELOCITY_INLET MARKER_INLET= ( gas_inlet, 300, 1.0, 1.0, 0.0, 0.0,\ air_axial_inlet, 300, 1.0, 0.0, -1.0, 0.0 ) -SPECIES_USE_STRONG_BC= NO MARKER_INLET_SPECIES= (gas_inlet, 1.0,\ air_axial_inlet, 0.6) % diff --git a/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.cfg b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.cfg index 7bef8d8c329..370cba307fd 100644 --- a/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.cfg +++ b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_TURBULENT_MARKERS.cfg @@ -8,7 +8,7 @@ % Author: Cristopher Morales Ubal % % Institution: Eindhoven University of Technology % % Date: 2022/12/05 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -64,7 +64,7 @@ INLET_FILENAME= inlet_venturi.dat INC_INLET_TYPE= VELOCITY_INLET VELOCITY_INLET MARKER_INLET= ( gas_inlet, 300, 15.0, 1.0, 0.0, 0.0,\ air_axial_inlet, 300, 10.0, 0.0, -1.0, 0.0 ) -SPECIES_USE_STRONG_BC= YES +MARKER_SPECIES_STRONG_BC= (gas-inlet, air_axial_inlet, wall, outlet) MARKER_INLET_SPECIES= (gas_inlet, 1.0, \ air_axial_inlet, 0.0) % @@ -104,7 +104,7 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT KIND_SCALAR_MODEL= SPECIES_TRANSPORT % DIFFUSIVITY_MODEL = CONSTANT_LEWIS -CONSTANT_LEWIS_NUMBER = 0.365 +CONSTANT_LEWIS_NUMBER = 0.365, 0.96 % CONV_NUM_METHOD_SPECIES= BOUNDED_SCALAR MUSCL_SPECIES= NO diff --git a/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_boundedscalar.cfg b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_boundedscalar.cfg index 8a4c8d6a40d..7ecc9f86d17 100644 --- a/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_boundedscalar.cfg +++ b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_boundedscalar.cfg @@ -7,7 +7,7 @@ % Author: Cristopher Morales Ubal % % Institution: Eindhoven University of Technology % % Date: 2022/06/15 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -60,7 +60,6 @@ INLET_FILENAME= inlet_venturi.dat INC_INLET_TYPE= VELOCITY_INLET VELOCITY_INLET MARKER_INLET= ( gas_inlet, 300, 1.0, 1.0, 0.0, 0.0,\ air_axial_inlet, 300, 1.0, 0.0, -1.0, 0.0 ) -SPECIES_USE_STRONG_BC= NO MARKER_INLET_SPECIES= (gas_inlet, 1.0,\ air_axial_inlet, 0.6) % diff --git a/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_heatcapacity_H2.cfg b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_heatcapacity_H2.cfg index e208b15fa59..d9d8a07ed19 100644 --- a/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_heatcapacity_H2.cfg +++ b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_heatcapacity_H2.cfg @@ -8,7 +8,7 @@ % Author: Cristopher Morales Ubal % % Institution: Eindhoven University of Technology % % Date: 2022/09/12 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -70,7 +70,7 @@ INLET_FILENAME= inlet_venturi.dat INC_INLET_TYPE= VELOCITY_INLET VELOCITY_INLET MARKER_INLET= ( gas_inlet, 400, 5.0, 1.0, 0.0, 0.0,\ air_axial_inlet, 300, 5.0, 0.0, -1.0, 0.0 ) -SPECIES_USE_STRONG_BC= YES +MARKER_SPECIES_STRONG_BC= (gas_inlet, air_axial_inlet, wall, outlet) MARKER_INLET_SPECIES= (gas_inlet, 1.0, \ air_axial_inlet, 0.6) % diff --git a/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.cfg b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.cfg index d941f96705f..d8c4b002f53 100644 --- a/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.cfg +++ b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_heatcapacity_H2_ND.cfg @@ -9,7 +9,7 @@ % Author: Cristopher Morales Ubal % % Institution: Eindhoven University of Technology % % Date: 2022/10/12 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -71,7 +71,7 @@ INLET_FILENAME= inlet_venturi.dat INC_INLET_TYPE= VELOCITY_INLET VELOCITY_INLET MARKER_INLET= ( gas_inlet, 400, 5.0, 1.0, 0.0, 0.0,\ air_axial_inlet, 300, 5.0, 0.0, -1.0, 0.0 ) -SPECIES_USE_STRONG_BC= YES +MARKER_SPECIES_STRONG_BC= (gas_inlet, air_axial_inlet, wall, outlet) MARKER_INLET_SPECIES= (gas_inlet, 1.0, \ air_axial_inlet, 0.6) % diff --git a/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_viscosity.cfg b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_viscosity.cfg index 3be5d7a6962..22fc0fcb07a 100644 --- a/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_viscosity.cfg +++ b/TestCases/species_transport/venturi_primitive_3species/species2_primitiveVenturi_mixingmodel_viscosity.cfg @@ -3,27 +3,28 @@ % SU2 configuration file % % Case description: Species mixing with 2 species, i.e. 1 transport equations % % Including mixture dependent density, viscosity, thermal % -% conductivity % +% conductivity and different viscosity ratios at the inlets % +% for the SA turbulent model. % % Author: Cristopher Morales Ubal % % Institution: Eindhoven University of Technology % % Date: 2022/06/27 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% % SOLVER= INC_RANS -KIND_TURB_MODEL= SST +KIND_TURB_MODEL= SA % % ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% % INC_DENSITY_MODEL= VARIABLE INC_DENSITY_INIT= 1.1766 % -INC_VELOCITY_INIT= ( 1.00, 0.0, 0.0 ) +INC_VELOCITY_INIT= ( 5.00, 0.0, 0.0 ) % -INC_ENERGY_EQUATION= YES +INC_ENERGY_EQUATION= NO INC_TEMPERATURE_INIT= 300.0 % INC_NONDIM= DIMENSIONAL @@ -62,11 +63,14 @@ MARKER_SYM= ( axis ) SPECIFIED_INLET_PROFILE= NO INLET_FILENAME= inlet_venturi.dat INC_INLET_TYPE= VELOCITY_INLET VELOCITY_INLET -MARKER_INLET= ( gas_inlet, 400, 1.0, 1.0, 0.0, 0.0,\ - air_axial_inlet, 300, 1.0, 0.0, -1.0, 0.0 ) -SPECIES_USE_STRONG_BC= NO +MARKER_INLET= ( gas_inlet, 300, 5.0, 1.0, 0.0, 0.0,\ + air_axial_inlet, 300, 3.0, 0.0, -1.0, 0.0 ) MARKER_INLET_SPECIES= (gas_inlet, 1.0, \ - air_axial_inlet, 0.6) + air_axial_inlet, 0.6) +% +% +MARKER_INLET_TURBULENT= (gas_inlet, 5.0, \ + air_axial_inlet, 3.0) % INC_OUTLET_TYPE= PRESSURE_OUTLET MARKER_OUTLET= ( outlet, 0.0 ) @@ -128,7 +132,7 @@ CONV_STARTITER= 10 % MESH_FILENAME= primitiveVenturi.su2 SCREEN_OUTPUT= INNER_ITER WALL_TIME \ - RMS_PRESSURE RMS_VELOCITY-X RMS_VELOCITY-Y RMS_TKE RMS_DISSIPATION RMS_SPECIES_0 RMS_SPECIES_1 \ + RMS_RES \ LINSOL_ITER LINSOL_RESIDUAL \ LINSOL_ITER_TURB LINSOL_RESIDUAL_TURB \ LINSOL_ITER_SPECIES LINSOL_RESIDUAL_SPECIES \ diff --git a/TestCases/species_transport/venturi_primitive_3species/species3_primitiveVenturi.cfg b/TestCases/species_transport/venturi_primitive_3species/species3_primitiveVenturi.cfg deleted file mode 100644 index 7237f760404..00000000000 --- a/TestCases/species_transport/venturi_primitive_3species/species3_primitiveVenturi.cfg +++ /dev/null @@ -1,138 +0,0 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% % -% SU2 configuration file % -% Case description: Species mixing with 3 species, i.e. 2 transport equations % -% Author: T. Kattmann % -% Institution: Bosch Thermotechniek B.V. % -% Date: 2021/10/14 % -% File Version 7.5.1 "Blackbird" % -% % -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% -% -SOLVER= INC_RANS -KIND_TURB_MODEL= SST -% -% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% -% -INC_DENSITY_MODEL= CONSTANT -INC_DENSITY_INIT= 1.1766 -% -INC_VELOCITY_INIT= ( 1.00, 0.0, 0.0 ) -% -INC_ENERGY_EQUATION= YES -INC_TEMPERATURE_INIT= 300.0 -% -INC_NONDIM= INITIAL_VALUES -% -% -------------------- FLUID PROPERTIES ------------------------------------- % -% -FLUID_MODEL= CONSTANT_DENSITY -% -CONDUCTIVITY_MODEL= CONSTANT_CONDUCTIVITY -THERMAL_CONDUCTIVITY_CONSTANT= 0.0357 -% -PRANDTL_LAM= 0.72 -TURBULENT_CONDUCTIVITY_MODEL= NONE -PRANDTL_TURB= 0.90 -% -VISCOSITY_MODEL= CONSTANT_VISCOSITY -MU_CONSTANT= 1.716E-5 -% -% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% -% -MARKER_HEATFLUX= ( wall, 0.0 ) -MARKER_SYM= ( axis ) -% -SPECIFIED_INLET_PROFILE= NO -INLET_FILENAME= inlet_venturi.dat -INC_INLET_TYPE= VELOCITY_INLET VELOCITY_INLET -MARKER_INLET= ( gas_inlet, 300, 1.0, 1.0, 0.0, 0.0,\ - air_axial_inlet, 300, 1.0, 0.0, -1.0, 0.0 ) -SPECIES_USE_STRONG_BC= NO -MARKER_INLET_SPECIES= (gas_inlet, 0.5, 0.5,\ - air_axial_inlet, 0.6, 0.0 ) -% -INC_OUTLET_TYPE= PRESSURE_OUTLET -MARKER_OUTLET= ( outlet, 0.0 ) -% -% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% -% -NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES -% -CFL_NUMBER= 2000 -CFL_REDUCTION_SPECIES= 1.0 -CFL_REDUCTION_TURB= 1.0 -% -% Run commented Iter for good results -ITER= 1000 -% -% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% -% -LINEAR_SOLVER= FGMRES -LINEAR_SOLVER_PREC= ILU -LINEAR_SOLVER_ERROR= 1E-8 -LINEAR_SOLVER_ITER= 5 -% -% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% -% -CONV_NUM_METHOD_FLOW= FDS -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW = NONE -TIME_DISCRE_FLOW= EULER_IMPLICIT -% -% -------------------- SCALAR TRANSPORT ---------------------------------------% -% -KIND_SCALAR_MODEL= SPECIES_TRANSPORT -DIFFUSIVITY_MODEL= CONSTANT_DIFFUSIVITY -DIFFUSIVITY_CONSTANT= 0.001 -% -CONV_NUM_METHOD_SPECIES= SCALAR_UPWIND -MUSCL_SPECIES= NO -SLOPE_LIMITER_SPECIES = NONE -% -TIME_DISCRE_SPECIES= EULER_IMPLICIT -% -SPECIES_INIT= 1.0, 0.0 -SPECIES_CLIPPING= YES -SPECIES_CLIPPING_MIN= 0.0, 0.0 -SPECIES_CLIPPING_MAX= 1.0, 1.0 -% -% -------------------- TURBULENT TRANSPORT ---------------------------------------% -% -CONV_NUM_METHOD_TURB= SCALAR_UPWIND -MUSCL_TURB= NO -% -% --------------------------- CONVERGENCE PARAMETERS --------------------------% -% -CONV_FIELD= RMS_PRESSURE, RMS_VELOCITY-X, RMS_VELOCITY-Y, RMS_TKE, RMS_SPECIES -CONV_RESIDUAL_MINVAL= -18 -CONV_STARTITER= 10 -% -% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% -% -MESH_FILENAME= primitiveVenturi.su2 -SCREEN_OUTPUT= INNER_ITER WALL_TIME \ - RMS_PRESSURE RMS_VELOCITY-X RMS_VELOCITY-Y RMS_TKE RMS_DISSIPATION RMS_SPECIES_0 RMS_SPECIES_1 \ - LINSOL_ITER LINSOL_RESIDUAL \ - LINSOL_ITER_TURB LINSOL_RESIDUAL_TURB \ - LINSOL_ITER_SPECIES LINSOL_RESIDUAL_SPECIES \ - SURFACE_SPECIES_0 -SCREEN_WRT_FREQ_INNER= 10 -% -HISTORY_OUTPUT= ITER RMS_RES LINSOL SPECIES_COEFF SPECIES_COEFF_SURF -CONV_FILENAME= history -MARKER_ANALYZE= gas_inlet, air_axial_inlet, outlet -MARKER_ANALYZE_AVERAGE= AREA -% -OUTPUT_FILES= RESTART_ASCII, PARAVIEW_MULTIBLOCK -VOLUME_OUTPUT= RESIDUAL, PRIMITIVE -OUTPUT_WRT_FREQ= 1000 -% -RESTART_SOL= NO -READ_BINARY_RESTART= NO -RESTART_FILENAME= restart -SOLUTION_FILENAME= solution -% -WRT_PERFORMANCE= YES diff --git a/TestCases/species_transport/venturi_primitive_3species/species3_primitiveVenturi_inletFile.cfg b/TestCases/species_transport/venturi_primitive_3species/species3_primitiveVenturi_inletFile.cfg index 6de6854f3ee..17488e3af0e 100644 --- a/TestCases/species_transport/venturi_primitive_3species/species3_primitiveVenturi_inletFile.cfg +++ b/TestCases/species_transport/venturi_primitive_3species/species3_primitiveVenturi_inletFile.cfg @@ -6,7 +6,7 @@ % Author: T. Kattmann % % Institution: Bosch Thermotechniek B.V. % % Date: 2021/10/14 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -51,7 +51,6 @@ INLET_FILENAME= inlet_venturi.dat INC_INLET_TYPE= VELOCITY_INLET VELOCITY_INLET MARKER_INLET= ( gas_inlet, 300, 1.0, 1.0, 0.0, 0.0,\ air_axial_inlet, 300, 1.0, 0.0, -1.0, 0.0 ) -SPECIES_USE_STRONG_BC= NO MARKER_INLET_SPECIES= (gas_inlet, 0.5, 0.5,\ air_axial_inlet, 0.6, 0.0 ) % diff --git a/TestCases/transition/E387_Airfoil/transitional_BC_model_ConfigFile.cfg b/TestCases/transition/E387_Airfoil/transitional_BC_model_ConfigFile.cfg index c721656a127..7127bdc0915 100644 --- a/TestCases/transition/E387_Airfoil/transitional_BC_model_ConfigFile.cfg +++ b/TestCases/transition/E387_Airfoil/transitional_BC_model_ConfigFile.cfg @@ -6,7 +6,7 @@ % Institution: TOBB University of Economics and Technology % % TAI-TUSAS Turkish Aerospace Industries % % Date: Oct 10th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/transition/Schubauer_Klebanoff/transitional_BC_model_ConfigFile.cfg b/TestCases/transition/Schubauer_Klebanoff/transitional_BC_model_ConfigFile.cfg index 9a3769a39b4..3ce91fc9f73 100644 --- a/TestCases/transition/Schubauer_Klebanoff/transitional_BC_model_ConfigFile.cfg +++ b/TestCases/transition/Schubauer_Klebanoff/transitional_BC_model_ConfigFile.cfg @@ -6,7 +6,7 @@ % Institution: TOBB University of Economics and Technology % % TAI-TUSAS Turkish Aerospace Industries % % Date: Oct 10th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/transition/T3A_FlatPlate/transitional_BC_model_ConfigFile.cfg b/TestCases/transition/T3A_FlatPlate/transitional_BC_model_ConfigFile.cfg index ca01fc108d8..f3ae1289e26 100644 --- a/TestCases/transition/T3A_FlatPlate/transitional_BC_model_ConfigFile.cfg +++ b/TestCases/transition/T3A_FlatPlate/transitional_BC_model_ConfigFile.cfg @@ -6,7 +6,7 @@ % Institution: TOBB University of Economics and Technology % % TAI-TUSAS Turkish Aerospace Industries % % Date: Oct 10th, 2016 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/turbomachinery/APU_turbocharger/Jones_restart.cfg b/TestCases/turbomachinery/APU_turbocharger/Jones_restart.cfg index 8a4c24a0850..c1a9dec3889 100755 --- a/TestCases/turbomachinery/APU_turbocharger/Jones_restart.cfg +++ b/TestCases/turbomachinery/APU_turbocharger/Jones_restart.cfg @@ -5,7 +5,7 @@ % Author: S. Vitale % % Institution: Delft University of Technology % % Date: Jun 28th, 2017 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % @@ -66,6 +66,7 @@ MARKER_PERIODIC= (PER1, PER2, 0.0, 0.0, 0.0, 0.0, 0.0, 18.947368421, 0.0, 0.0, 0 %-------- INFLOW/OUTFLOW BOUNDARY CONDITION SPECIFIC FOR TURBOMACHINERY --------% % MARKER_TURBOMACHINERY= (INFLOW, OUTMIX, INMIX, OUTFLOW) +MARKER_ANALYZE= (OUTFLOW) MARKER_MIXINGPLANE_INTERFACE= (OUTMIX, INMIX) MARKER_GILES= (INFLOW, TOTAL_CONDITIONS_PT, 413.6E+03, 477.6, 1.0, 0.0, 0.0, 1.0, 0.0, OUTMIX, MIXING_OUT, 0.0, 0.0, 0.0, 0.0, 0.0, 0.3, 0.0, INMIX, MIXING_IN, 0.0, 0.0, 0.0, 0.0, 0.0, 0.3, 0.0, OUTFLOW, STATIC_PRESSURE_1D, 67.46E+03, 0.0, 0.0, 0.0, 0.0 , 1.0, 0.0) GILES_EXTRA_RELAXFACTOR= (0.05, 0.05) @@ -136,6 +137,7 @@ CONV_CAUCHY_EPS= 1E-6 % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % +SCREEN_OUTPUT= OUTER_ITER, AVG_BGS_RES[0], AVG_BGS_RES[1], RMS_DENSITY[0], RMS_ENERGY[0], RMS_DENSITY[1], RMS_ENERGY[1], SURFACE_TOTAL_PRESSURE[1] MESH_FILENAME= mesh_jones_turbine.su2 MESH_FORMAT= SU2 MESH_OUT_FILENAME= meshout.su2 @@ -150,4 +152,4 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat SURFACE_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint -OUTPUT_WRT_FREQ= 100 \ No newline at end of file +OUTPUT_WRT_FREQ= 100 diff --git a/TestCases/turbomachinery/axial_stage_2D/Axial_stage2D.cfg b/TestCases/turbomachinery/axial_stage_2D/Axial_stage2D.cfg index 38c0a560488..583ec2849eb 100755 --- a/TestCases/turbomachinery/axial_stage_2D/Axial_stage2D.cfg +++ b/TestCases/turbomachinery/axial_stage_2D/Axial_stage2D.cfg @@ -5,7 +5,7 @@ % Author: S. Vitale % % Institution: Delft University of Technology % % Date: Feb 28th, 2017 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % @@ -67,6 +67,7 @@ MARKER_PERIODIC= ( periodic1, periodic2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.04 % % Inflow and Outflow markers must be specified, for each blade (zone), following the natural groth of the machine (i.e, from the first blade to the last) MARKER_TURBOMACHINERY= (inflow, outmix, inmix, outflow) +MARKER_ANALYZE= (outflow) % % Mixing-plane interface markers must be specified to activate the transfer of information between zones MARKER_MIXINGPLANE_INTERFACE= (outmix, inmix) @@ -138,6 +139,7 @@ CONV_CAUCHY_EPS= 1E-6 % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % +SCREEN_OUTPUT= OUTER_ITER, AVG_BGS_RES[0], AVG_BGS_RES[1], RMS_DENSITY[0], RMS_ENERGY[0], RMS_DENSITY[1], RMS_ENERGY[1], SURFACE_TOTAL_PRESSURE[1] MESH_FILENAME= mesh_axial_stage_2d_turb.su2 MESH_FORMAT= SU2 MESH_OUT_FILENAME= meshout.su2 diff --git a/TestCases/turbomachinery/axial_stage_2D/zone_1.cfg b/TestCases/turbomachinery/axial_stage_2D/zone_1.cfg index 5104dbd1dd7..7f4bdb57fbe 100644 --- a/TestCases/turbomachinery/axial_stage_2D/zone_1.cfg +++ b/TestCases/turbomachinery/axial_stage_2D/zone_1.cfg @@ -5,7 +5,7 @@ % Author: S. Vitale % % Institution: Delft University of Technology % % Date: Feb 28th, 2017 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/turbomachinery/axial_stage_2D/zone_2.cfg b/TestCases/turbomachinery/axial_stage_2D/zone_2.cfg index f8e8677c2d2..2fe06969028 100644 --- a/TestCases/turbomachinery/axial_stage_2D/zone_2.cfg +++ b/TestCases/turbomachinery/axial_stage_2D/zone_2.cfg @@ -5,7 +5,7 @@ % Author: S. Vitale % % Institution: Delft University of Technology % % Date: Feb 28th, 2017 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/turbomachinery/centrifugal_blade/centrifugal_blade.cfg b/TestCases/turbomachinery/centrifugal_blade/centrifugal_blade.cfg index c50f217363e..cd0716b7021 100755 --- a/TestCases/turbomachinery/centrifugal_blade/centrifugal_blade.cfg +++ b/TestCases/turbomachinery/centrifugal_blade/centrifugal_blade.cfg @@ -5,7 +5,7 @@ % Author:S. Vitale % % Institution: Delft University of Technology % % Date: Oct 26th, 2015 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/turbomachinery/centrifugal_stage/centrifugal_stage.cfg b/TestCases/turbomachinery/centrifugal_stage/centrifugal_stage.cfg index 8c4f5ebc038..d3571d77a9b 100755 --- a/TestCases/turbomachinery/centrifugal_stage/centrifugal_stage.cfg +++ b/TestCases/turbomachinery/centrifugal_stage/centrifugal_stage.cfg @@ -5,7 +5,7 @@ % Author: S. Vitale % % Institution: Delft University of Technology % % Date: Oct 28th, 2015 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/turbomachinery/transonic_stator_2D/transonic_stator_restart.cfg b/TestCases/turbomachinery/transonic_stator_2D/transonic_stator_restart.cfg index 34f5e0d12a9..4d2097fc80f 100644 --- a/TestCases/turbomachinery/transonic_stator_2D/transonic_stator_restart.cfg +++ b/TestCases/turbomachinery/transonic_stator_2D/transonic_stator_restart.cfg @@ -5,7 +5,7 @@ % Author: S. Vitale % % Institution: Delft University of Technology % % Date: 2017.03.01 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % @@ -68,6 +68,7 @@ MARKER_PERIODIC= ( periodic_1, periodic_2, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0. %-------- INFLOW/OUTFLOW BOUNDARY CONDITION SPECIFIC FOR TURBOMACHINERY --------% % MARKER_TURBOMACHINERY= (inflow, outflow) +MARKER_ANALYZE= (inflow, outflow) MARKER_GILES= (inflow, TOTAL_CONDITIONS_PT, 13.8686E+05, 592.295, 1.0, 0.0, 0.0, 1.0, 1.0, outflow, STATIC_PRESSURE, 9.00E+05, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0) SPATIAL_FOURIER= YES % @@ -137,6 +138,7 @@ CONV_CAUCHY_EPS= 1E-6 % % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% % +SCREEN_OUTPUT= INNER_ITER, RMS_RES, SURFACE_PRESSURE_DROP MESH_FILENAME= mesh_stator_turb.su2 MESH_FORMAT= SU2 MESH_OUT_FILENAME= su2mesh_per.su2 @@ -151,4 +153,4 @@ VOLUME_ADJ_FILENAME= adjoint GRAD_OBJFUNC_FILENAME= of_grad.dat SURFACE_FILENAME= surface_flow SURFACE_ADJ_FILENAME= surface_adjoint -OUTPUT_WRT_FREQ= 500 \ No newline at end of file +OUTPUT_WRT_FREQ= 500 diff --git a/TestCases/tutorials.py b/TestCases/tutorials.py index e256a94c71f..71c4319b65c 100644 --- a/TestCases/tutorials.py +++ b/TestCases/tutorials.py @@ -3,7 +3,7 @@ ## \file parallel_regression.py # \brief Python script for automated regression testing of SU2 examples # \author A. Aranake, A. Campos, T. Economon, T. Lukaczyk, S. Padron -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -71,7 +71,7 @@ def main(): sp_pinArray_2d_mf_hf.cfg_dir = "../Tutorials/incompressible_flow/Inc_Streamwise_Periodic" sp_pinArray_2d_mf_hf.cfg_file = "sp_pinArray_2d_mf_hf.cfg" sp_pinArray_2d_mf_hf.test_iter = 25 - sp_pinArray_2d_mf_hf.test_vals = [-4.626243, 1.444608, -0.750995, 241.756998] #last 4 lines + sp_pinArray_2d_mf_hf.test_vals = [-4.625757, 1.445108, -0.750969, 241.762883] test_list.append(sp_pinArray_2d_mf_hf) # 2D pin case pressure drop periodic with heatflux BC and temperature periodicity @@ -79,7 +79,7 @@ def main(): sp_pinArray_2d_dp_hf_tp.cfg_dir = "../Tutorials/incompressible_flow/Inc_Streamwise_Periodic" sp_pinArray_2d_dp_hf_tp.cfg_file = "sp_pinArray_2d_dp_hf_tp.cfg" sp_pinArray_2d_dp_hf_tp.test_iter = 25 - sp_pinArray_2d_dp_hf_tp.test_vals = [-4.666992, 1.395929, -0.709333, 208.023676] #last 4 lines + sp_pinArray_2d_dp_hf_tp.test_vals = [-4.666547, 1.396426, -0.709267, 208.023676] test_list.append(sp_pinArray_2d_dp_hf_tp) ### Species Transport @@ -89,20 +89,17 @@ def main(): species3_primitiveVenturi.cfg_dir = "../Tutorials/incompressible_flow/Inc_Species_Transport" species3_primitiveVenturi.cfg_file = "species3_primitiveVenturi.cfg" species3_primitiveVenturi.test_iter = 50 - species3_primitiveVenturi.test_vals = [-6.074971, -5.306648, -5.150960, -5.959416, -1.625107, -6.343704, -6.460033, 5.000000, -0.808413, 5.000000, -2.325029, 5.000000, -0.274923, 1.646091, 0.499028, 0.601019, 0.546044] - species3_primitiveVenturi.new_output = True + species3_primitiveVenturi.test_vals = [-6.082040, -5.293756, -5.131970, -5.933415, -1.606563, -6.274241, -6.408477, 5.000000, -0.811535, 5.000000, -2.344697, 5.000000, -0.388358, 1.647440, 0.499101, 0.600978, 0.547361] test_list.append(species3_primitiveVenturi) - # 3 species (2 eq) primitive venturi mixing DAspecies3_primitiveVenturi = TestCase('DAspecies3_primitiveVenturi') DAspecies3_primitiveVenturi.cfg_dir = "../Tutorials/incompressible_flow/Inc_Species_Transport" DAspecies3_primitiveVenturi.cfg_file = "DAspecies3_primitiveVenturi.cfg" DAspecies3_primitiveVenturi.test_iter = 50 - DAspecies3_primitiveVenturi.test_vals = [-8.528844, -7.799649, -7.783477, -7.482502, -12.140092, -12.250169, -11.455523] - DAspecies3_primitiveVenturi.test_vals_aarch64 = [-8.528880, -7.799682, -7.783516, -7.482532, -12.140123, -12.250169, -11.455523] + DAspecies3_primitiveVenturi.test_vals = [-8.443103, -7.715615, -7.706589, -7.428740, -12.067471, -12.205189, -11.368995] + DAspecies3_primitiveVenturi.test_vals_aarch64 = [-8.443103, -7.715615, -7.706589, -7.428740, -12.067471, -12.205189, -11.368995] DAspecies3_primitiveVenturi.command = TestCase.Command("mpirun -n 2", "SU2_CFD_AD") - DAspecies3_primitiveVenturi.new_output = True test_list.append(DAspecies3_primitiveVenturi) # 2 species (1 eq) kenics static mixer for composition-dependent model @@ -110,9 +107,8 @@ def main(): kenics_mixer_tutorial.cfg_dir = "../Tutorials/incompressible_flow/Inc_Species_Transport_Composition_Dependent_Model" kenics_mixer_tutorial.cfg_file = "kenics_mixer_tutorial.cfg" kenics_mixer_tutorial.test_iter = 10 - kenics_mixer_tutorial.test_vals = [-7.489841, -6.823474, -6.838069, -5.157396, -7.902273, -3.174235, -7.448166, 5.000000, -1.862000, 4.000000, -5.173789, 3.000000, -6.373917, 0.025135, 0.000000, 0.025135, 0.000000, 64.095000, 8.479500, 48.089000, 7.526700] + kenics_mixer_tutorial.test_vals = [-7.489796, -6.823473, -6.838032, -5.157793, -7.911512, -3.166212, -7.447901, 5.000000, -1.862212, 4.000000, -5.131048, 3.000000, -6.380193, 0.025472, 0.000000, 0.025472, 0.000000, 64.105000, 8.479200, 48.099000, 7.526700] kenics_mixer_tutorial.command = TestCase.Command("mpirun -n 2", "SU2_CFD") - kenics_mixer_tutorial.new_output = True test_list.append(kenics_mixer_tutorial) # 90 degree pipe bend with wall functions from the experiments of Sudo et al. @@ -122,7 +118,6 @@ def main(): sudo_tutorial.test_iter = 10 sudo_tutorial.test_vals = [-13.618610, -12.647974, -12.296537, -11.658760, -13.136523, -9.550829, 15.000000, -2.369703] sudo_tutorial.command = TestCase.Command("mpirun -n 2", "SU2_CFD") - sudo_tutorial.new_output = True test_list.append(sudo_tutorial) ### Compressible Flow @@ -133,7 +128,6 @@ def main(): tutorial_inv_bump.cfg_file = "inv_channel.cfg" tutorial_inv_bump.test_iter = 0 tutorial_inv_bump.test_vals = [-1.437425, 4.075857, 0.005439, 0.012998] - tutorial_inv_bump.no_restart = True test_list.append(tutorial_inv_bump) # Inviscid Wedge @@ -177,7 +171,7 @@ def main(): tutorial_turb_flatplate.cfg_dir = "../Tutorials/compressible_flow/Turbulent_Flat_Plate" tutorial_turb_flatplate.cfg_file = "turb_SA_flatplate.cfg" tutorial_turb_flatplate.test_iter = 0 - tutorial_turb_flatplate.test_vals = [-2.258584, -4.899502, -0.429375, 0.201236] + tutorial_turb_flatplate.test_vals = [-2.258584, -4.901015, -0.429375, 0.201236] tutorial_turb_flatplate.no_restart = True test_list.append(tutorial_turb_flatplate) @@ -195,7 +189,8 @@ def main(): tutorial_trans_flatplate_T3A.cfg_dir = "../Tutorials/compressible_flow/Transitional_Flat_Plate/Langtry_and_Menter/T3A" tutorial_trans_flatplate_T3A.cfg_file = "transitional_LM_model_ConfigFile.cfg" tutorial_trans_flatplate_T3A.test_iter = 20 - tutorial_trans_flatplate_T3A.test_vals = [-5.837191, -2.092249, -3.982626, -0.302018, -1.916974, 1.668678, -3.496294, 0.391531] + tutorial_trans_flatplate_T3A.test_vals = [-5.837186, -2.092246, -3.982633, -0.302219, -1.921235, 1.667190, -3.496277, 0.391605] + tutorial_trans_flatplate_T3A.test_vals_aarch64 = [-5.837191, -2.092246, -3.982640, -0.302224, -1.922554, 1.667190, -3.496277, 0.391605] tutorial_trans_flatplate_T3A.no_restart = True test_list.append(tutorial_trans_flatplate_T3A) @@ -204,7 +199,8 @@ def main(): tutorial_trans_flatplate_T3Am.cfg_dir = "../Tutorials/compressible_flow/Transitional_Flat_Plate/Langtry_and_Menter/T3A-" tutorial_trans_flatplate_T3Am.cfg_file = "transitional_LM_model_ConfigFile.cfg" tutorial_trans_flatplate_T3Am.test_iter = 20 - tutorial_trans_flatplate_T3Am.test_vals = [-6.063550, -1.945057, -3.946359, -0.549026, -3.863798, 2.664577, -2.517606, 1.112977] + tutorial_trans_flatplate_T3Am.test_vals = [-6.063600, -1.945057, -3.946760, -0.549063, -3.863792, 2.664453, -2.517606, 1.112979] + tutorial_trans_flatplate_T3Am.test_vals_aarch64 = [-6.063598, -1.945057, -3.946744, -0.549062, -3.863792, 2.664453, -2.517606, 1.112979] tutorial_trans_flatplate_T3Am.no_restart = True test_list.append(tutorial_trans_flatplate_T3Am) @@ -213,7 +209,7 @@ def main(): tutorial_trans_e387_sa.cfg_dir = "../Tutorials/compressible_flow/Transitional_Airfoil/Langtry_and_Menter/E387" tutorial_trans_e387_sa.cfg_file = "transitional_SA_LM_model_ConfigFile.cfg" tutorial_trans_e387_sa.test_iter = 20 - tutorial_trans_e387_sa.test_vals = [-6.527027, -5.081543, -0.795267, 1.022557, 0.150240, 2, -9.580670] + tutorial_trans_e387_sa.test_vals = [-6.527027, -5.081560, -0.795267, 1.022556, 0.150189, 2.000000, -9.580669] tutorial_trans_e387_sa.no_restart = True test_list.append(tutorial_trans_e387_sa) @@ -222,7 +218,7 @@ def main(): tutorial_trans_e387_sst.cfg_dir = "../Tutorials/compressible_flow/Transitional_Airfoil/Langtry_and_Menter/E387" tutorial_trans_e387_sst.cfg_file = "transitional_SST_LM_model_ConfigFile.cfg" tutorial_trans_e387_sst.test_iter = 20 - tutorial_trans_e387_sst.test_vals = [-6.532421, -5.085785, -0.789723, 1.078391, 0.188263, 2, -9.567014] + tutorial_trans_e387_sst.test_vals = [-6.532424, -5.085816, -0.789725, 1.078014, 0.188274, 2.000000, -9.567012] tutorial_trans_e387_sst.no_restart = True test_list.append(tutorial_trans_e387_sst) @@ -231,7 +227,7 @@ def main(): tutorial_turb_oneram6.cfg_dir = "../Tutorials/compressible_flow/Turbulent_ONERAM6" tutorial_turb_oneram6.cfg_file = "turb_ONERAM6.cfg" tutorial_turb_oneram6.test_iter = 0 - tutorial_turb_oneram6.test_vals = [-4.564441, -11.524277, 0.327954, 0.097349] + tutorial_turb_oneram6.test_vals = [-4.564441, -11.524476, 0.327954, 0.097349] test_list.append(tutorial_turb_oneram6) # NICD Nozzle @@ -239,7 +235,7 @@ def main(): tutorial_nicfd_nozzle.cfg_dir = "../Tutorials/compressible_flow/NICFD_nozzle" tutorial_nicfd_nozzle.cfg_file = "NICFD_nozzle.cfg" tutorial_nicfd_nozzle.test_iter = 20 - tutorial_nicfd_nozzle.test_vals = [-2.187397, -2.338536, 3.613629, 0.000000, 0.000000] + tutorial_nicfd_nozzle.test_vals = [-2.187397, -2.338457, 3.617301, 0.000000, 0.000000] tutorial_nicfd_nozzle.no_restart = True test_list.append(tutorial_nicfd_nozzle) @@ -248,8 +244,8 @@ def main(): tutorial_unst_naca0012.cfg_dir = "../Tutorials/compressible_flow/Unsteady_NACA0012" tutorial_unst_naca0012.cfg_file = "unsteady_naca0012.cfg" tutorial_unst_naca0012.test_iter = 520 - tutorial_unst_naca0012.test_vals = [520, 0, -5.297585, 0, 0.297416, 0.770060, 0.003308, 0.014647] - tutorial_unst_naca0012.test_vals_aarch64 = [520, 0, -5.296968, 0, 0.312131, 0.801193, 0.002868, 0.014303] + tutorial_unst_naca0012.test_vals = [520.000000, 0.000000, -5.291711, 0.000000, 0.305248, 0.810326, 0.001814, 0.006573] + tutorial_unst_naca0012.test_vals_aarch64 = [520.000000, 0.000000, -5.298777, 0.000000, 0.288956, 0.736706, 0.002419, 0.007134] tutorial_unst_naca0012.unsteady = True test_list.append(tutorial_unst_naca0012) @@ -258,7 +254,7 @@ def main(): propeller_var_load.cfg_dir = "../Tutorials/compressible_flow/ActuatorDisk_VariableLoad" propeller_var_load.cfg_file = "propeller_variable_load.cfg" propeller_var_load.test_iter = 20 - propeller_var_load.test_vals = [-1.830252, -4.535038, -0.000323, 0.171648] + propeller_var_load.test_vals = [-1.830276, -4.535127, -0.000323, 0.171623] propeller_var_load.timeout = 3200 test_list.append(propeller_var_load) @@ -278,7 +274,7 @@ def main(): tutorial_design_turb_rae2822.cfg_dir = "../Tutorials/design/Turbulent_2D_Constrained_RAE2822" tutorial_design_turb_rae2822.cfg_file = "turb_SA_RAE2822.cfg" tutorial_design_turb_rae2822.test_iter = 0 - tutorial_design_turb_rae2822.test_vals = [-1.700114, -4.941305, 0.218348, 0.190357] + tutorial_design_turb_rae2822.test_vals = [-1.700114, -4.941834, 0.218348, 0.190357] tutorial_design_turb_rae2822.no_restart = True test_list.append(tutorial_design_turb_rae2822) diff --git a/TestCases/unsteady/pitching_naca0015_rans_inc/config_incomp_turb_sa.cfg b/TestCases/unsteady/pitching_naca0015_rans_inc/config_incomp_turb_sa.cfg index ee33ca1ee9c..0f84217b43d 100644 --- a/TestCases/unsteady/pitching_naca0015_rans_inc/config_incomp_turb_sa.cfg +++ b/TestCases/unsteady/pitching_naca0015_rans_inc/config_incomp_turb_sa.cfg @@ -67,10 +67,7 @@ LIMITER_ITER= 99999 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= NONE TIME_DISCRE_FLOW= EULER_IMPLICIT -RK_ALPHA_COEFF= ( 0.66667, 0.66667, 1.000000 ) % -------------------- TURBULENT NUMERICAL METHOD DEFINITION ------------------% % diff --git a/TestCases/unsteady/pitching_naca64a010_euler/pitching_NACA64A010.cfg b/TestCases/unsteady/pitching_naca64a010_euler/pitching_NACA64A010.cfg index 90f3e25f814..0585043774b 100644 --- a/TestCases/unsteady/pitching_naca64a010_euler/pitching_NACA64A010.cfg +++ b/TestCases/unsteady/pitching_naca64a010_euler/pitching_NACA64A010.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.02 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -93,8 +93,6 @@ MG_DAMP_PROLONGATION= 0.9 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN VENKAT_LIMITER_COEFF= 0.1 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -103,8 +101,6 @@ TIME_DISCRE_FLOW= EULER_IMPLICIT % OBJECTIVE_FUNCTION= DRAG CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_JST_SENSOR_COEFF= ( 0.0, 0.02 ) CFL_REDUCTION_ADJFLOW= 0.5 TIME_DISCRE_ADJFLOW= EULER_IMPLICIT diff --git a/TestCases/unsteady/pitching_naca64a010_rans/turb_NACA64A010.cfg b/TestCases/unsteady/pitching_naca64a010_rans/turb_NACA64A010.cfg index ac34070b960..83b3e0c46a6 100644 --- a/TestCases/unsteady/pitching_naca64a010_rans/turb_NACA64A010.cfg +++ b/TestCases/unsteady/pitching_naca64a010_rans/turb_NACA64A010.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2011.11.02 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -34,7 +34,7 @@ MACH_MOTION= 0.796 MOTION_ORIGIN= 0.248 0.0 0.0 PITCHING_OMEGA= 0.0 0.0 106.69842 PITCHING_AMPL= 0.0 0.0 1.01 - + % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% % MACH_NUMBER= 0.796 @@ -91,8 +91,6 @@ MG_DAMP_PROLONGATION= 0.7 % -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% % CONV_NUM_METHOD_FLOW= JST -MUSCL_FLOW= YES -SLOPE_LIMITER_FLOW= VENKATAKRISHNAN VENKAT_LIMITER_COEFF= 0.03 JST_SENSOR_COEFF= ( 0.5, 0.02 ) TIME_DISCRE_FLOW= EULER_IMPLICIT @@ -108,8 +106,6 @@ TIME_DISCRE_TURB= EULER_IMPLICIT % OBJECTIVE_FUNCTION= DRAG CONV_NUM_METHOD_ADJFLOW= JST -MUSCL_ADJFLOW= YES -SLOPE_LIMITER_ADJFLOW= NONE ADJ_SHARP_LIMITER_COEFF= 3.0 ADJ_JST_SENSOR_COEFF= ( 0.0, 0.01 ) CFL_REDUCTION_ADJFLOW= 0.9 diff --git a/TestCases/unsteady/plunging_naca0012/plunging_NACA0012.cfg b/TestCases/unsteady/plunging_naca0012/plunging_NACA0012.cfg index c43c14882e5..b1136ad91a0 100644 --- a/TestCases/unsteady/plunging_naca0012/plunging_NACA0012.cfg +++ b/TestCases/unsteady/plunging_naca0012/plunging_NACA0012.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: Jun 12, 2014 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/unsteady/square_cylinder/turb_square.cfg b/TestCases/unsteady/square_cylinder/turb_square.cfg index da3ca2f261f..7b94e4227cc 100644 --- a/TestCases/unsteady/square_cylinder/turb_square.cfg +++ b/TestCases/unsteady/square_cylinder/turb_square.cfg @@ -5,7 +5,7 @@ % Author: Thomas D. Economon % % Institution: Stanford University % % Date: 2013.02.25 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/TestCases/user_defined_functions/lam_flatplate.cfg b/TestCases/user_defined_functions/lam_flatplate.cfg index c2544a6851e..3f96723da55 100644 --- a/TestCases/user_defined_functions/lam_flatplate.cfg +++ b/TestCases/user_defined_functions/lam_flatplate.cfg @@ -4,7 +4,7 @@ % Case description: Test custom outputs and objective function. % % Author: P. Gomes % % Date: 5th Jan 2022 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % @@ -37,7 +37,7 @@ CUSTOM_OUTPUTS= 'velocity : Macro{sqrt(pow(VELOCITY_X, 2) + pow(VELOCITY_Y, 2) + probe1 : Probe{$velocity}[0.005, 0.005, 0.05]' % % "COMBO" is the name and group of the output for the objective function -% (regardless of definition). "CUSTOM" is the group for all custom outpus. +% (regardless of definition). "CUSTOM" is the group for all custom outputs. SCREEN_OUTPUT= INNER_ITER, RMS_DENSITY, RMS_ENERGY, LINSOL_RESIDUAL, FORCE_Z,\ SURFACE_MASSFLOW, SURFACE_TOTAL_TEMPERATURE, avg_vel, dev_vel, probe1, COMBO HISTORY_OUTPUT = ITER, AERO_COEFF, FLOW_COEFF, FLOW_COEFF_SURF, CUSTOM, COMBO diff --git a/TestCases/vandv.py b/TestCases/vandv.py index 15056dd64e3..adcf295916f 100644 --- a/TestCases/vandv.py +++ b/TestCases/vandv.py @@ -6,7 +6,7 @@ # - Use the SU2 --dry_run mode for configs of large tests. # - Restart from converged results for medium problems. # - Run small cases (<20s) to convergence. -# \version 7.5.1 "Blackbird" +# \version 8.0.0 "Harrier" # # SU2 Project Website: https://su2code.github.io # @@ -45,8 +45,8 @@ def main(): p30n30.cfg_dir = "vandv/rans/30p30n" p30n30.cfg_file = "config.cfg" p30n30.test_iter = 20 - p30n30.test_vals = [-10.639125, -10.302345, -10.493880, -10.249452, -13.517221, 0.050962, 2.828563, 1.317849, -0.217586] - p30n30.test_vals_aarch64 = [-10.636663, -10.298256, -10.479415, -10.246700, -13.517161, 0.050962, 2.828563, 1.317849, -0.209200] + p30n30.test_vals = [-10.806343, -10.326374, -10.559106, -10.432754, -13.517105, 0.050962, 2.828563, 1.317849, -0.228843] + p30n30.test_vals_aarch64 = [-10.801521, -10.325747, -10.557163, -10.427274, -13.517118, 0.050962, 2.828563, 1.317849, -0.207763] test_list.append(p30n30) # flat plate - sst-v1994m @@ -54,8 +54,8 @@ def main(): flatplate_sst1994m.cfg_dir = "vandv/rans/flatplate" flatplate_sst1994m.cfg_file = "turb_flatplate_sst.cfg" flatplate_sst1994m.test_iter = 5 - flatplate_sst1994m.test_vals = [-13.022266, -9.782360, -10.951053, -7.775218, -10.035041, -5.141447, 0.002809] - flatplate_sst1994m.test_vals_aarch64 = [-13.044282, -9.682503, -10.712657, -7.519027, -9.742878, -5.374663, 0.002809] + flatplate_sst1994m.test_vals = [-13.023358, -9.956752, -11.099910, -7.933220, -10.206577, -5.132343, 0.002808] + flatplate_sst1994m.test_vals_aarch64 = [-13.022835, -9.956652, -11.102384, -7.928197, -10.206580, -5.132317, 0.002808] test_list.append(flatplate_sst1994m) # bump in channel - sst-v1994m @@ -63,18 +63,20 @@ def main(): bump_sst1994m.cfg_dir = "vandv/rans/bump_in_channel" bump_sst1994m.cfg_file = "turb_bump_sst.cfg" bump_sst1994m.test_iter = 5 - bump_sst1994m.test_vals = [-13.048445, -9.929559, -10.602530, -7.593266, -10.323567, -5.548893, 0.004967] - bump_sst1994m.test_vals_aarch64 = [-13.005103, -9.889383, -10.555402, -7.584122, -10.312935, -5.470352, 0.004967] + bump_sst1994m.test_vals = [-12.986182, -10.719941, -10.556276, -7.606531, -10.774915, -5.605156, 0.004972] + bump_sst1994m.test_vals_aarch64 = [-13.039365, -10.729085, -10.609923, -7.682911, -10.774915, -5.605087, 0.004972] test_list.append(bump_sst1994m) # SWBLI SA swbli_sa = TestCase('swbli_sa') swbli_sa.cfg_dir = "vandv/rans/swbli" swbli_sa.cfg_file = "config_sa.cfg" - swbli_sa.test_iter = 20 - swbli_sa.test_vals = [-11.029255, -10.511982, -11.400926, -10.128471, -14.536798, 0.002233, -2.608466, 2.786] + swbli_sa.test_iter = 5 + swbli_sa.test_vals = [-11.530796, -10.915564, -12.034495, -10.538719, -15.922522, 0.002233, -3.359164, 1.340100] + swbli_sa.test_vals_aarch64 = [-11.530796, -10.915564, -12.034495, -10.538719, -15.922522, 0.002233, -3.359164, 1.340100] test_list.append(swbli_sa) + # SWBLI - sst-v2003m swbli_sst = TestCase('swbli_sst') swbli_sst.cfg_dir = "vandv/rans/swbli" @@ -83,6 +85,19 @@ def main(): swbli_sst.test_vals = [-11.527743, -11.150388, -11.944923, -10.750834, -11.116769, -4.030059, 0.002339, -2.730391, -4.067274, 1.276300] test_list.append(swbli_sst) + ########################## + ### Incompressible RANS ### + ########################## + + # Sandia jet - sst-v2003m + sandiajet_sst = TestCase('sandiajet_sst') + sandiajet_sst.cfg_dir = "vandv/species_transport/sandia_jet" + sandiajet_sst.cfg_file = "validation.cfg" + sandiajet_sst.test_iter = 5 + sandiajet_sst.test_vals = [-16.249917, -13.835991, -14.303372, -13.276035, -10.074262, -14.027223, 5, -1.672359, 5, -4.938477, 5, -3.462217, 2.5859e-04, 2.8215e-32, 4.5010e-68, 2.5859e-04, 4.0474e+03, 3.9468e+03, 4.9170e+01, 5.1441e+01] + sandiajet_sst.test_vals_aarch64 = [-16.249289, -13.833785, -14.303058, -13.276559, -10.267928, -14.027240, 5, -1.676412, 5, -4.815216, 5, -3.462247, 0.000259, 0, 0, 0.000259, 4047.4, 3946.8, 49.17, 51.441] + test_list.append(sandiajet_sst) + ################# ### RUN TESTS ### ################# diff --git a/TestCases/vandv/rans/bump_in_channel/turb_bump_sst.cfg b/TestCases/vandv/rans/bump_in_channel/turb_bump_sst.cfg index e556bf970cb..b30ea280f10 100644 --- a/TestCases/vandv/rans/bump_in_channel/turb_bump_sst.cfg +++ b/TestCases/vandv/rans/bump_in_channel/turb_bump_sst.cfg @@ -1,7 +1,7 @@ % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% SOLVER= RANS KIND_TURB_MODEL= SST -%SST_OPTIONS= V2003m +SST_OPTIONS= V1994m RESTART_SOL= YES % -------------------- COMPRESSIBLE FREE-STREAM DEFINITION --------------------% MACH_NUMBER= 0.2 diff --git a/TestCases/vandv/rans/flatplate/turb_flatplate_sst.cfg b/TestCases/vandv/rans/flatplate/turb_flatplate_sst.cfg index d7e0813a0b5..2b53ee86d71 100644 --- a/TestCases/vandv/rans/flatplate/turb_flatplate_sst.cfg +++ b/TestCases/vandv/rans/flatplate/turb_flatplate_sst.cfg @@ -1,7 +1,7 @@ % ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% SOLVER= RANS KIND_TURB_MODEL= SST -%SST_OPTIONS= V2003m +SST_OPTIONS= V1994m RESTART_SOL= YES % ----------- COMPRESSIBLE AND INCOMPRESSIBLE FREE-STREAM DEFINITION ----------% MACH_NUMBER= 0.2 @@ -55,7 +55,7 @@ TIME_DISCRE_TURB= EULER_IMPLICIT CONV_FIELD= RMS_DENSITY CONV_RESIDUAL_MINVAL= -13 % ------------------------- INPUT/OUTPUT INFORMATION --------------------------% -MESH_FILENAME= mesh_flatplate_turb_035x025.su2 +MESH_FILENAME= mesh_flatplate_turb_035x025.su2 MESH_FORMAT= SU2 MESH_OUT_FILENAME= mesh_out.su2 SOLUTION_FILENAME= solution_flow.dat diff --git a/TestCases/vandv/species_transport/sandia_jet/validation.cfg b/TestCases/vandv/species_transport/sandia_jet/validation.cfg new file mode 100644 index 00000000000..6ca77c4ca66 --- /dev/null +++ b/TestCases/vandv/species_transport/sandia_jet/validation.cfg @@ -0,0 +1,151 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% % +% SU2 configuration file % +% Case description: V&V Composition-dependent model Sandia's turbulent jet % +% Author: S.J.H. Bosmans % +% Institution: TU Eindhoven (TU/e) % +% Date: 2023/05/04 % +% File Version 8.0.0 "Harrier" % +% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% ------------- DIRECT, ADJOINT, AND LINEARIZED PROBLEM DEFINITION ------------% +% +SOLVER= INC_RANS +KIND_TURB_MODEL= SST +SST_OPTIONS= V2003m +RESTART_SOL= YES +% +% ---------------- INCOMPRESSIBLE FLOW CONDITION DEFINITION -------------------% +% +INC_DENSITY_MODEL= VARIABLE +INC_DENSITY_INIT= 1.828 +% +INC_VELOCITY_INIT= ( 53.0, 0.0, 0.0 ) +% +INC_ENERGY_EQUATION= NO +INC_TEMPERATURE_INIT= 294.0 +% +INC_NONDIM= DIMENSIONAL +% +% -------------------- FLUID PROPERTIES ------------------------------------- % +% +FLUID_MODEL= FLUID_MIXTURE +% +MOLECULAR_WEIGHT= 44.097, 28.960 +THERMODYNAMIC_PRESSURE = 101325.0 +% +SPECIFIC_HEAT_CP = 1680.0, 1009.39 +% +CONDUCTIVITY_MODEL= CONSTANT_CONDUCTIVITY +THERMAL_CONDUCTIVITY_CONSTANT= 0.0179, 0.0258 +% +PRANDTL_LAM= 0.72, 0.72 +TURBULENT_CONDUCTIVITY_MODEL= CONSTANT_PRANDTL_TURB +PRANDTL_TURB= 0.90, 0.90 +% +% --------------------------- VISCOSITY MODEL ---------------------------------% +% +VISCOSITY_MODEL= CONSTANT_VISCOSITY +% +MU_CONSTANT= 8.04E-06, 1.8551E-05 +% +MIXING_VISCOSITY_MODEL = WILKE +% +% -------------------- BOUNDARY CONDITION DEFINITION --------------------------% +% +MARKER_HEATFLUX= ( wall, 0.0 ) +AXISYMMETRIC= YES +MARKER_SYM= ( symmetry ) +MARKER_EULER= ( top_wall ) +MARKER_INLET_TURBULENT= ( inlet_gas, 0.04, 5, inlet_air, 0.004, 1 ) +% +INC_INLET_TYPE= VELOCITY_INLET VELOCITY_INLET +SPECIFIED_INLET_PROFILE= NO +%INLET_FILENAME= inlet_jet.dat +%INLET_MATCHING_TOLERANCE= 1.2E-06 +% +MARKER_INLET= ( inlet_gas, 294, 53.0, 1.0, 0.0 0.0, inlet_air, 294, 9.2, 1.0, 0.0, 0.0 ) +MARKER_INLET_SPECIES= ( inlet_gas, 1.0, inlet_air, 0.0 ) +% +INC_OUTLET_TYPE= PRESSURE_OUTLET +MARKER_OUTLET= ( outlet, 0.0 ) +% +% ------------- COMMON PARAMETERS DEFINING THE NUMERICAL METHOD ---------------% +% +NUM_METHOD_GRAD= WEIGHTED_LEAST_SQUARES +% +CFL_NUMBER= 200.0 +CFL_ADAPT= NO +CFL_REDUCTION_SPECIES= 1.0 +CFL_REDUCTION_TURB= 0.5 +% +ITER= 9999 +% +% ------------------------ LINEAR SOLVER DEFINITION ---------------------------% +% +LINEAR_SOLVER= FGMRES +LINEAR_SOLVER_PREC= ILU +LINEAR_SOLVER_ERROR= 1E-5 +LINEAR_SOLVER_ITER= 5 +% +% -------------------- FLOW NUMERICAL METHOD DEFINITION -----------------------% +% +CONV_NUM_METHOD_FLOW= FDS +MUSCL_FLOW= NO +SLOPE_LIMITER_FLOW = NONE +TIME_DISCRE_FLOW= EULER_IMPLICIT +% +% -------------------- SCALAR TRANSPORT ---------------------------------------% +% +KIND_SCALAR_MODEL= SPECIES_TRANSPORT +% +DIFFUSIVITY_MODEL= UNITY_LEWIS +% +SCHMIDT_NUMBER_TURBULENT= 0.7 +% +CONV_NUM_METHOD_SPECIES= BOUNDED_SCALAR +MUSCL_SPECIES= NO +SLOPE_LIMITER_SPECIES = NONE +% +TIME_DISCRE_SPECIES= EULER_IMPLICIT +% +SPECIES_INIT= 0.05 +SPECIES_CLIPPING= NO +SPECIES_CLIPPING_MIN= 0.0 +SPECIES_CLIPPING_MAX= 1.0 +% +% -------------------- TURBULENT TRANSPORT ---------------------------------------% +% +CONV_NUM_METHOD_TURB= BOUNDED_SCALAR +MUSCL_TURB= NO +% +% --------------------------- CONVERGENCE PARAMETERS --------------------------% +% +CONV_FIELD= RMS_PRESSURE, RMS_VELOCITY-X, RMS_VELOCITY-Y, RMS_TKE, RMS_SPECIES +CONV_RESIDUAL_MINVAL= -14.0 +CONV_CAUCHY_ELEMS= 100 +CONV_CAUCHY_EPS= 1E-6 +% +% ------------------------- INPUT/OUTPUT INFORMATION --------------------------% +% +MESH_FILENAME= MESH_validation.su2 +% +SCREEN_OUTPUT= INNER_ITER WALL_TIME RMS_RES LINSOL_ITER LINSOL_RESIDUAL LINSOL_ITER_TURB LINSOL_RESIDUAL_TURB LINSOL_ITER_SPECIES LINSOL_RESIDUAL_SPECIES SURFACE_SPECIES_VARIANCE SURFACE_TOTAL_PRESSURE +SCREEN_WRT_FREQ_INNER= 10 +% +HISTORY_OUTPUT= ITER RMS_RES LINSOL SPECIES_COEFF SPECIES_COEFF_SURF SURFACE_TOTAL_PRESSURE +CONV_FILENAME= history +MARKER_ANALYZE= inlet_gas,inlet_air, outlet +MARKER_ANALYZE_AVERAGE= AREA +% +OUTPUT_FILES= RESTART_ASCII, PARAVIEW_MULTIBLOCK +VOLUME_OUTPUT= RESIDUAL, PRIMITIVE +OUTPUT_WRT_FREQ= 100 +% +READ_BINARY_RESTART= NO +RESTART_FILENAME= restart.csv +SOLUTION_FILENAME= solution.csv +% +WRT_PERFORMANCE= YES +OUTPUT_PRECISION= 16 diff --git a/TestCases/wallfunctions/flatplate/compressible_SA/turb_SA_flatplate.cfg b/TestCases/wallfunctions/flatplate/compressible_SA/turb_SA_flatplate.cfg index 8d1932d0170..4e437f579a1 100644 --- a/TestCases/wallfunctions/flatplate/compressible_SA/turb_SA_flatplate.cfg +++ b/TestCases/wallfunctions/flatplate/compressible_SA/turb_SA_flatplate.cfg @@ -6,7 +6,7 @@ % Author: Nijso Beishuizen, T. Kattmann % % Institution: Bosch Thermotechnology % % Date: 2021.09.01 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/wallfunctions/flatplate/compressible_SST/turb_SST_flatplate.cfg b/TestCases/wallfunctions/flatplate/compressible_SST/turb_SST_flatplate.cfg index 258e11c6081..7565572d097 100644 --- a/TestCases/wallfunctions/flatplate/compressible_SST/turb_SST_flatplate.cfg +++ b/TestCases/wallfunctions/flatplate/compressible_SST/turb_SST_flatplate.cfg @@ -6,7 +6,7 @@ % Author: Nijso Beishuizen, T. Kattmann % % Institution: Bosch Thermotechnology % % Date: 2021.09.01 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/wallfunctions/flatplate/incompressible_SA/turb_SA_flatplate.cfg b/TestCases/wallfunctions/flatplate/incompressible_SA/turb_SA_flatplate.cfg index 00ec3704293..6a63d1febd2 100644 --- a/TestCases/wallfunctions/flatplate/incompressible_SA/turb_SA_flatplate.cfg +++ b/TestCases/wallfunctions/flatplate/incompressible_SA/turb_SA_flatplate.cfg @@ -6,7 +6,7 @@ % Author: Nijso Beishuizen, T. Kattmann % % Institution: Bosch Thermotechnology % % Date: 2021.09.01 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/TestCases/wallfunctions/flatplate/incompressible_SST/turb_SST_flatplate.cfg b/TestCases/wallfunctions/flatplate/incompressible_SST/turb_SST_flatplate.cfg index aa0e928ac5e..0492f2222a6 100644 --- a/TestCases/wallfunctions/flatplate/incompressible_SST/turb_SST_flatplate.cfg +++ b/TestCases/wallfunctions/flatplate/incompressible_SST/turb_SST_flatplate.cfg @@ -6,7 +6,7 @@ % Author: Nijso Beishuizen, T. Kattmann % % Institution: Bosch Thermotechnology % % Date: 2021.09.01 % -% File Version 7.5.1 "Blackbird" % +% File Version 8.0.0 "Harrier" % % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % diff --git a/UnitTests/Common/containers/CLookupTable_tests.cpp b/UnitTests/Common/containers/CLookupTable_tests.cpp index 658e7951392..5e63f60b149 100644 --- a/UnitTests/Common/containers/CLookupTable_tests.cpp +++ b/UnitTests/Common/containers/CLookupTable_tests.cpp @@ -2,7 +2,7 @@ * \file CLookupTable_tests.cpp * \brief Unit tests for the lookup table. * \author N. Beishuizen - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -35,25 +35,23 @@ #include "../../../Common/include/containers/CLookUpTable.hpp" #include "../../../Common/include/containers/CFileReaderLUT.hpp" - TEST_CASE("LUTreader", "[tabulated chemistry]") { - /*--- smaller and trivial lookup table ---*/ - CLookUpTable look_up_table("src/SU2/UnitTests/Common/containers/lookuptable.drg","ProgressVariable","EnthalpyTot"); + CLookUpTable look_up_table("src/SU2/UnitTests/Common/containers/lookuptable.drg", "ProgressVariable", "EnthalpyTot"); /*--- string names of the controlling variables ---*/ string name_CV1 = "ProgressVariable"; string name_CV2 = "EnthalpyTot"; - /*--- look up a single value for density ---*/ + /*--- look up a single value for density ---*/ su2double prog = 0.55; su2double enth = -0.5; string look_up_tag = "Density"; su2double look_up_dat; - look_up_table.LookUp_ProgEnth(look_up_tag, &look_up_dat, prog, enth, name_CV1, name_CV2); + look_up_table.LookUp_XY(look_up_tag, &look_up_dat, prog, enth); CHECK(look_up_dat == Approx(1.02)); /*--- look up a single value for viscosity ---*/ @@ -61,26 +59,74 @@ TEST_CASE("LUTreader", "[tabulated chemistry]") { prog = 0.6; enth = 0.9; look_up_tag = "Viscosity"; - look_up_table.LookUp_ProgEnth(look_up_tag, &look_up_dat, prog, enth, name_CV1, name_CV2); + look_up_table.LookUp_XY(look_up_tag, &look_up_dat, prog, enth); CHECK(look_up_dat == Approx(0.0000674286)); /* find the table limits */ - auto limitsEnth = look_up_table.GetTableLimitsEnth(); - CHECK(limitsEnth.first == Approx(-1.0)); - CHECK(limitsEnth.second == Approx(1.0)); + auto limitsEnth = look_up_table.GetTableLimitsY(); + CHECK(SU2_TYPE::GetValue(*limitsEnth.first) == Approx(-1.0)); + CHECK(SU2_TYPE::GetValue(*limitsEnth.second) == Approx(1.0)); - auto limitsProgvar = look_up_table.GetTableLimitsProg(); - CHECK(limitsProgvar.first == Approx(0.0)); - CHECK(limitsProgvar.second == Approx(1.0)); + auto limitsProgvar = look_up_table.GetTableLimitsX(); + CHECK(SU2_TYPE::GetValue(*limitsProgvar.first) == Approx(0.0)); + CHECK(SU2_TYPE::GetValue(*limitsProgvar.second) == Approx(1.0)); /* lookup value outside of lookup table */ prog = 1.10; enth = 1.1; look_up_tag = "Density"; - look_up_table.LookUp_ProgEnth(look_up_tag, &look_up_dat, prog, enth, name_CV1, name_CV2); - CHECK(look_up_dat == Approx(1.2)); - + look_up_table.LookUp_XY(look_up_tag, &look_up_dat, prog, enth); + CHECK(look_up_dat == Approx(1.1738796125)); } +TEST_CASE("LUTreader_3D", "[tabulated chemistry]") { + /*--- smaller and trivial lookup table ---*/ + + CLookUpTable look_up_table("src/SU2/UnitTests/Common/containers/lookuptable_3D.drg", "ProgressVariable", + "EnthalpyTot"); + + /*--- string names of the controlling variables ---*/ + + string name_CV1 = "ProgressVariable"; + string name_CV2 = "EnthalpyTot"; + + /*--- look up a single value for density ---*/ + + su2double prog = 0.55; + su2double enth = -0.5; + su2double mfrac = 0.5; + string look_up_tag = "Density"; + su2double look_up_dat; + look_up_table.LookUp_XYZ(look_up_tag, &look_up_dat, prog, enth, mfrac); + CHECK(look_up_dat == Approx(1.02)); + + /*--- look up a single value for viscosity ---*/ + + prog = 0.6; + enth = 0.9; + mfrac = 0.8; + look_up_tag = "Viscosity"; + look_up_table.LookUp_XYZ(look_up_tag, &look_up_dat, prog, enth, mfrac); + CHECK(look_up_dat == Approx(0.0000674286)); + + /* find the table limits */ + + auto limitsEnth = look_up_table.GetTableLimitsY(); + CHECK(SU2_TYPE::GetValue(*limitsEnth.first) == Approx(-1.0)); + CHECK(SU2_TYPE::GetValue(*limitsEnth.second) == Approx(1.0)); + + auto limitsProgvar = look_up_table.GetTableLimitsX(); + CHECK(SU2_TYPE::GetValue(*limitsProgvar.first) == Approx(0.0)); + CHECK(SU2_TYPE::GetValue(*limitsProgvar.second) == Approx(1.0)); + + /* lookup value outside of lookup table */ + + prog = 1.10; + enth = 1.1; + mfrac = 2.0; + look_up_tag = "Density"; + look_up_table.LookUp_XYZ(look_up_tag, &look_up_dat, prog, enth, mfrac); + CHECK(look_up_dat == Approx(1.1738796125)); +} diff --git a/UnitTests/Common/containers/lookuptable_3D.drg b/UnitTests/Common/containers/lookuptable_3D.drg new file mode 100644 index 00000000000..2bfb4e3cc93 --- /dev/null +++ b/UnitTests/Common/containers/lookuptable_3D.drg @@ -0,0 +1,135 @@ +Dragon library + +
+[Version] +1.1.0 + +[Number of table levels] +2 + +[Number of points] +12 +12 + +[Number of triangles] +14 +14 + +[Number of hull points] +8 +8 + +[Progress variable definition] +prog var = 1*Y-CH4 + +[Progress variable range] +0.0 | 1.0 +0.0 | 1.0 + +[Enthalpy range] +-1.0 | 1.0 +-1.0 | 1.0 + +[Table levels] +0.0 +1.0 + +[Number of variables] +4 + +[Variable names] +1:ProgressVariable +2:EnthalpyTot +3:Density +4:Viscosity + +
+ + + +0.0 -1.0 1.0 1.0e-5 +0.3 -1.0 1.0 1.2e-5 +0.6 -1.0 1.0 1.4e-5 +1.0 -1.0 1.0 1.6e-5 +0.5 0.25 1.05 2.0e-5 +0.75 0.25 1.05 3.0e-5 +0.3 0.5 1.1 3.0e-5 +0.6 0.5 1.1 4.0e-5 +1.0 0.5 1.1 5.0e-5 +0.0 1.0 1.2 6.0e-5 +0.3 1.0 1.2 7.0e-5 +1.0 1.0 1.2 8.0e-5 + + +0.0 -1.0 1.0 1.0e-5 +0.3 -1.0 1.0 1.2e-5 +0.6 -1.0 1.0 1.4e-5 +1.0 -1.0 1.0 1.6e-5 +0.5 0.25 1.05 2.0e-5 +0.75 0.25 1.05 3.0e-5 +0.3 0.5 1.1 3.0e-5 +0.6 0.5 1.1 4.0e-5 +1.0 0.5 1.1 5.0e-5 +0.0 1.0 1.2 6.0e-5 +0.3 1.0 1.2 7.0e-5 +1.0 1.0 1.2 8.0e-5 + + + + + +1 2 7 +1 7 11 +1 11 10 +2 5 7 +2 3 5 +3 8 5 +5 8 7 +7 8 11 +3 6 8 +3 4 6 +4 9 6 +6 9 8 +8 9 12 +8 12 11 + + +1 2 7 +1 7 11 +1 11 10 +2 5 7 +2 3 5 +3 8 5 +5 8 7 +7 8 11 +3 6 8 +3 4 6 +4 9 6 +6 9 8 +8 9 12 +8 12 11 + + + + + +1 +2 +3 +4 +9 +12 +11 +10 + + +1 +2 +3 +4 +9 +12 +11 +10 + + diff --git a/UnitTests/Common/geometry/CGeometry_test.cpp b/UnitTests/Common/geometry/CGeometry_test.cpp index be8992699c1..6bd2dd583df 100644 --- a/UnitTests/Common/geometry/CGeometry_test.cpp +++ b/UnitTests/Common/geometry/CGeometry_test.cpp @@ -2,7 +2,7 @@ * \file CGeometry_tests.cpp * \brief Unit tests for CGeometry. * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -30,44 +30,41 @@ std::unique_ptr TestCase; -TEST_CASE("Geometry constructor", "[Geometry]"){ - +TEST_CASE("Geometry constructor", "[Geometry]") { cout.rdbuf(nullptr); TestCase = std::unique_ptr(new UnitQuadTestCase()); TestCase->InitConfig(); - auto aux_geometry = std::unique_ptr(new CPhysicalGeometry(TestCase->config.get(), 0, 1)); + auto aux_geometry = std::unique_ptr(new CPhysicalGeometry(TestCase->config.get(), 0, 1)); - CHECK(aux_geometry->GetnPoint() == 125); - CHECK(aux_geometry->GetnElem() == 64); + CHECK(aux_geometry->GetnPoint() == 125); + CHECK(aux_geometry->GetnElem() == 64); CHECK(aux_geometry->GetnElemHexa() == 64); - CHECK(aux_geometry->GetnEdge() == 0); + CHECK(aux_geometry->GetnEdge() == 0); CHECK(aux_geometry->GetnElem_Bound(0) == 16); CHECK(aux_geometry->GetnElem_Bound(5) == 16); TestCase->geometry = std::unique_ptr(new CPhysicalGeometry(aux_geometry.get(), TestCase->config.get())); - CHECK(TestCase->geometry->GetnPoint() == 125); - CHECK(TestCase->geometry->GetnElem() == 64); + CHECK(TestCase->geometry->GetnPoint() == 125); + CHECK(TestCase->geometry->GetnElem() == 64); CHECK(TestCase->geometry->GetnElemHexa() == 64); - CHECK(TestCase->geometry->GetnEdge() == 0); + CHECK(TestCase->geometry->GetnEdge() == 0); CHECK(TestCase->geometry->GetnElem_Bound(0) == 16); CHECK(TestCase->geometry->GetnElem_Bound(5) == 16); cout.rdbuf(TestCase->orig_buf); - } -TEST_CASE("Set Send/Recv", "[Geometry]"){ +TEST_CASE("Set Send/Recv", "[Geometry]") { TestCase->geometry->SetSendReceive(TestCase->config.get()); /*---- No check yet, since unit tests run in serial at the moment ---*/ } -TEST_CASE("Set Boundaries", "[Geometry]"){ - +TEST_CASE("Set Boundaries", "[Geometry]") { TestCase->geometry->SetBoundaries(TestCase->config.get()); CHECK(TestCase->config->GetMarker_All_KindBC(0) == CUSTOM_BOUNDARY); @@ -76,75 +73,63 @@ TEST_CASE("Set Boundaries", "[Geometry]"){ CHECK(TestCase->config->GetSolid_Wall(3)); } -TEST_CASE("Set Point Connectivity", "[Geometry]"){ - +TEST_CASE("Set Point Connectivity", "[Geometry]") { TestCase->geometry->SetPoint_Connectivity(); - CHECK(TestCase->geometry->nodes->GetnElem(55) == 4); - CHECK(TestCase->geometry->nodes->GetElem(30, 2) == 16); - CHECK(TestCase->geometry->nodes->GetnNeighbor(3) == 4); - CHECK(TestCase->geometry->nodes->GetPoint(99, 2) == 98); + CHECK(TestCase->geometry->nodes->GetnElem(55) == 4); + CHECK(TestCase->geometry->nodes->GetElem(30, 2) == 16); + CHECK(TestCase->geometry->nodes->GetnNeighbor(3) == 4); + CHECK(TestCase->geometry->nodes->GetPoint(99, 2) == 98); } -TEST_CASE("Set elem connectivity", "[Geometry]"){ - +TEST_CASE("Set elem connectivity", "[Geometry]") { TestCase->geometry->SetElement_Connectivity(); CHECK(TestCase->geometry->elem[14]->GetnFaces() == 6); CHECK(TestCase->geometry->elem[14]->GetNeighbor_Elements(1) == 15); - } -TEST_CASE("Set bound volume", "[Geometry]"){ - +TEST_CASE("Set bound volume", "[Geometry]") { TestCase->geometry->SetBoundVolume(); CHECK(TestCase->geometry->bound[0][10]->GetDomainElement() == 40); CHECK(TestCase->geometry->bound[4][10]->GetDomainElement() == 10); - } -TEST_CASE("Set Edges", "[Geometry]"){ - +TEST_CASE("Set Edges", "[Geometry]") { TestCase->geometry->SetEdges(); CHECK(TestCase->geometry->edges->GetnNodes() == 2); - CHECK(TestCase->geometry->edges->GetNode(42,0) == 15); - CHECK(TestCase->geometry->edges->GetNode(87,1) == 57); - + CHECK(TestCase->geometry->edges->GetNode(42, 0) == 15); + CHECK(TestCase->geometry->edges->GetNode(87, 1) == 57); } -TEST_CASE("Set vertex", "[Geometry]"){ - +TEST_CASE("Set vertex", "[Geometry]") { TestCase->geometry->SetVertex(TestCase->config.get()); CHECK(TestCase->geometry->GetnVertex(0) == 25); CHECK(TestCase->geometry->vertex[0][20]->GetNode() == 100); CHECK(TestCase->geometry->nodes->GetVertex(100, 0) == 20); CHECK(TestCase->geometry->nodes->GetVertex(1, 0) == -1); - } -TEST_CASE("Set control volume", "[Geometry]"){ - +TEST_CASE("Set control volume", "[Geometry]") { TestCase->geometry->SetControlVolume(TestCase->config.get(), ALLOCATE); CHECK(TestCase->geometry->elem[42]->GetCG(0) == 0.625); - CHECK(TestCase->geometry->elem[3]->GetCG(1) == 0.125); + CHECK(TestCase->geometry->elem[3]->GetCG(1) == 0.125); CHECK(TestCase->geometry->elem[25]->GetCG(2) == 0.375); CHECK(TestCase->geometry->nodes->GetVolume(42) == Approx(0.015625)); CHECK(TestCase->geometry->edges->GetNormal(32)[0] == 0.03125); - CHECK(TestCase->geometry->edges->GetNormal(5)[1] == 0.0); + CHECK(TestCase->geometry->edges->GetNormal(5)[1] == 0.0); CHECK(TestCase->geometry->edges->GetNormal(10)[2] == 0.03125); CHECK(TestCase->config->GetDomainVolume() == Approx(1.0)); - } -TEST_CASE("Set bound control volume", "[Geometry]"){ - +TEST_CASE("Set bound control volume", "[Geometry]") { TestCase->geometry->SetBoundControlVolume(TestCase->config.get(), ALLOCATE); CHECK(TestCase->geometry->bound[1][4]->GetCG(0) == 1.0); @@ -153,6 +138,5 @@ TEST_CASE("Set bound control volume", "[Geometry]"){ CHECK(TestCase->geometry->vertex[0][4]->GetNormal()[0] == -0.0625); CHECK(TestCase->geometry->vertex[3][2]->GetNormal()[1] == -0.0625); - CHECK(TestCase->geometry->vertex[5][3]->GetNormal()[2] == 0.03125); - + CHECK(TestCase->geometry->vertex[5][3]->GetNormal()[2] == 0.03125); } diff --git a/UnitTests/Common/geometry/dual_grid/CDualGrid_tests.cpp b/UnitTests/Common/geometry/dual_grid/CDualGrid_tests.cpp index a0eb34f1a22..0f6dbc38ae8 100644 --- a/UnitTests/Common/geometry/dual_grid/CDualGrid_tests.cpp +++ b/UnitTests/Common/geometry/dual_grid/CDualGrid_tests.cpp @@ -2,7 +2,7 @@ * \file CDualGrid_tests.cpp * \brief Unit tests for the dual grid classes * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -32,41 +32,47 @@ #include "../../../Common/include/geometry/dual_grid/CVertex.hpp" TEST_CASE("Volume Computation", "[Dual Grid]") { - su2double Coord_FaceiPoint[3]; su2double Coord_FaceElem_CG[3]; su2double Coord_Elem_CG[3]; su2double Coord_Edge_CG[3]; su2double scaling = 100; - Coord_FaceiPoint[0] = scaling*0.664995; Coord_FaceiPoint[1] = scaling*1.1462; Coord_FaceiPoint[2] = scaling*0.00926223; - Coord_FaceElem_CG[0] = scaling*0.655997; Coord_FaceElem_CG[1] = scaling*1.13054; Coord_FaceElem_CG[2] = scaling*0.00945181; - Coord_Elem_CG[0] = scaling*0.653846; Coord_Elem_CG[1] = scaling*1.12927; Coord_Elem_CG[2] = scaling*0.00835789; - Coord_Edge_CG[0] = scaling*0.664943; Coord_Edge_CG[1] = scaling*1.14623; Coord_Edge_CG[2] = scaling*0.00935524; + Coord_FaceiPoint[0] = scaling * 0.664995; + Coord_FaceiPoint[1] = scaling * 1.1462; + Coord_FaceiPoint[2] = scaling * 0.00926223; + Coord_FaceElem_CG[0] = scaling * 0.655997; + Coord_FaceElem_CG[1] = scaling * 1.13054; + Coord_FaceElem_CG[2] = scaling * 0.00945181; + Coord_Elem_CG[0] = scaling * 0.653846; + Coord_Elem_CG[1] = scaling * 1.12927; + Coord_Elem_CG[2] = scaling * 0.00835789; + Coord_Edge_CG[0] = scaling * 0.664943; + Coord_Edge_CG[1] = scaling * 1.14623; + Coord_Edge_CG[2] = scaling * 0.00935524; - SECTION("2D Edge"){ + SECTION("2D Edge") { su2double volume = CEdge::GetVolume(Coord_FaceiPoint, Coord_Edge_CG, Coord_Elem_CG); REQUIRE(volume == Approx(0.00607415)); } - SECTION("3D Edge"){ + SECTION("3D Edge") { su2double volume = CEdge::GetVolume(Coord_FaceiPoint, Coord_Edge_CG, Coord_FaceElem_CG, Coord_Elem_CG); REQUIRE(volume == Approx(0.000546832)); } CVertex vertex2d(0, 2); - SECTION("2D Vertex"){ + SECTION("2D Vertex") { vertex2d.SetNodes_Coord(Coord_Edge_CG, Coord_Elem_CG); REQUIRE(vertex2d.GetNormal()[0] == Approx(-1.696)); REQUIRE(vertex2d.GetNormal()[1] == Approx(1.1097)); } CVertex vertex3d(0, 3); - SECTION("3D Vertex"){ + SECTION("3D Vertex") { vertex3d.SetNodes_Coord(Coord_Edge_CG, Coord_FaceElem_CG, Coord_Elem_CG); REQUIRE(vertex3d.GetNormal()[0] == Approx(-0.0864312)); REQUIRE(vertex3d.GetNormal()[1] == Approx(0.0499696)); REQUIRE(vertex3d.GetNormal()[2] == Approx(0.111938)); } - } diff --git a/UnitTests/Common/geometry/primal_grid/CPrimalGrid_tests.cpp b/UnitTests/Common/geometry/primal_grid/CPrimalGrid_tests.cpp index e8282665a60..0c6596b067a 100644 --- a/UnitTests/Common/geometry/primal_grid/CPrimalGrid_tests.cpp +++ b/UnitTests/Common/geometry/primal_grid/CPrimalGrid_tests.cpp @@ -2,7 +2,7 @@ * \file CPrimalGrid_tests.cpp * \brief Unit tests for the primal grid classes * \author T. Albring - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -31,36 +31,50 @@ #include "../../../Common/include/geometry/primal_grid/CHexahedron.hpp" TEST_CASE("Center of gravity computation", "[Primal Grid]") { - const int nDim = 3; - su2double **coordinates = new su2double*[8]; - for (int i = 0; i < 8; i++){ + su2double** coordinates = new su2double*[8]; + for (int i = 0; i < 8; i++) { coordinates[i] = new su2double[nDim]; } - coordinates[0][0] = 7.946516948817000e-01; coordinates[0][1] = 0.000000000000000e+00; coordinates[0][2] = -1.530741281331000e-03; - coordinates[1][0] = 7.946538480939001e-01; coordinates[1][1] = 0.000000000000000e+00; coordinates[1][2] = -1.554823763559000e-03; - coordinates[2][0] = 4.613089666440000e-01; coordinates[2][1] = 0.000000000000000e+00; coordinates[2][2] = -3.089699212314000e-03; - coordinates[3][0] = 7.831152624057000e-01; coordinates[3][1] = 0.000000000000000e+00; coordinates[3][2] = -1.530741281331000e-03; - coordinates[4][0] = 8.322953467911001e-01; coordinates[4][1] = 1.324931278110000e-01; coordinates[4][2] = -1.456502113362000e-03; - coordinates[5][0] = 8.322984569865000e-01; coordinates[5][1] = 1.336230857244000e-01; coordinates[5][2] = -1.480923128397000e-03; - coordinates[6][0] = 8.213630099601000e-01; coordinates[6][1] = 1.326360771765000e-01; coordinates[6][2] = -2.941176615903000e-03; - coordinates[7][0] = 8.213597801418000e-01; coordinates[7][1] = 1.326371537826000e-01; coordinates[7][2] = -2.916814216089000e-03; + coordinates[0][0] = 7.946516948817000e-01; + coordinates[0][1] = 0.000000000000000e+00; + coordinates[0][2] = -1.530741281331000e-03; + coordinates[1][0] = 7.946538480939001e-01; + coordinates[1][1] = 0.000000000000000e+00; + coordinates[1][2] = -1.554823763559000e-03; + coordinates[2][0] = 4.613089666440000e-01; + coordinates[2][1] = 0.000000000000000e+00; + coordinates[2][2] = -3.089699212314000e-03; + coordinates[3][0] = 7.831152624057000e-01; + coordinates[3][1] = 0.000000000000000e+00; + coordinates[3][2] = -1.530741281331000e-03; + coordinates[4][0] = 8.322953467911001e-01; + coordinates[4][1] = 1.324931278110000e-01; + coordinates[4][2] = -1.456502113362000e-03; + coordinates[5][0] = 8.322984569865000e-01; + coordinates[5][1] = 1.336230857244000e-01; + coordinates[5][2] = -1.480923128397000e-03; + coordinates[6][0] = 8.213630099601000e-01; + coordinates[6][1] = 1.326360771765000e-01; + coordinates[6][2] = -2.941176615903000e-03; + coordinates[7][0] = 8.213597801418000e-01; + coordinates[7][1] = 1.326371537826000e-01; + coordinates[7][2] = -2.916814216089000e-03; -#define REQUIRE_CG(name, x, y, z) \ - name.SetCoord_CG(nDim, coordinates); \ +#define REQUIRE_CG(name, x, y, z) \ + name.SetCoord_CG(nDim, coordinates); \ REQUIRE(name.GetCG(0) == Approx(x)); \ REQUIRE(name.GetCG(1) == Approx(y)); \ REQUIRE(name.GetCG(2) == Approx(z)); // It is sufficient to test the CG computation for Hexahedron. // Routine is the same for all elements (impl. in CPrimalGrid) - CHexahedron hexa(0,1,2,3,4,5,6,7); + CHexahedron hexa(0, 1, 2, 3, 4, 5, 6, 7); REQUIRE_CG(hexa, 0.7676307957, 0.0664236806, -0.0020626777); - for (int i = 0; i < 8; i++){ - delete [] coordinates[i]; + for (int i = 0; i < 8; i++) { + delete[] coordinates[i]; } - delete [] coordinates; - + delete[] coordinates; } diff --git a/UnitTests/Common/simple_ad_test.cpp b/UnitTests/Common/simple_ad_test.cpp index 3fc3dc0da29..23dbed55476 100644 --- a/UnitTests/Common/simple_ad_test.cpp +++ b/UnitTests/Common/simple_ad_test.cpp @@ -4,7 +4,7 @@ * basic functionality, this also serves as a regression test * to make sure that AD works within unit testing. * \author C. Pederson - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -31,9 +31,7 @@ #include "../../Common/include/basic_types/datatype_structure.hpp" -su2double func(const su2double& x) { - return x * x * x; -} +su2double func(const su2double& x) { return x * x * x; } /*--- * This test case is based off of Tutorial 2 in the CoDiPack @@ -42,7 +40,6 @@ su2double func(const su2double& x) { * SU2 wrapper functions have been substituted for the CoDiPack calls. * ---*/ TEST_CASE("Simple AD Test", "[AD tests]") { - su2double x = 4.0; AD::StartRecording(); diff --git a/UnitTests/Common/simple_directdiff_test.cpp b/UnitTests/Common/simple_directdiff_test.cpp index 8cc0772d624..f6c7411e97f 100644 --- a/UnitTests/Common/simple_directdiff_test.cpp +++ b/UnitTests/Common/simple_directdiff_test.cpp @@ -4,7 +4,7 @@ * basic functionality, this also serves as a regression test * to make sure that DD works within unit testing. * \author C. Pederson - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -31,9 +31,7 @@ #include "../../Common/include/basic_types/datatype_structure.hpp" -su2double func(const su2double& x) { - return x * x * x; -} +su2double func(const su2double& x) { return x * x * x; } /*--- * This test case is based off of Tutorial 1 in the CoDiPack diff --git a/UnitTests/Common/toolboxes/C1DInterpolation_tests.cpp b/UnitTests/Common/toolboxes/C1DInterpolation_tests.cpp index 379c653d7ae..b229bd939c8 100644 --- a/UnitTests/Common/toolboxes/C1DInterpolation_tests.cpp +++ b/UnitTests/Common/toolboxes/C1DInterpolation_tests.cpp @@ -2,7 +2,7 @@ * \file C1DInterpolation_tests.cpp * \brief Unit tests for splines and what not. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -31,24 +31,23 @@ #include #include "../../../Common/include/toolboxes/C1DInterpolation.hpp" -su2double myPoly(su2double x) { return 1 + x*(-1 + x*(-1 + x)); } +su2double myPoly(su2double x) { return 1 + x * (-1 + x * (-1 + x)); } TEST_CASE("C1DInterpolation", "[Toolboxes]") { - std::vector x{{-1.5, -1.0, -0.8, -0.6, -0.4, -0.2, 0, 0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 2.0}}, y; for (auto v : x) y.push_back(myPoly(v)); /*--- piece-wise linear ---*/ - CLinearInterpolation L(x,y); + CLinearInterpolation L(x, y); /*--- natural spline ---*/ - CCubicSpline S0(x,y); + CCubicSpline S0(x, y); /*--- analytical end conditions ---*/ - CCubicSpline S1(x,y, CCubicSpline::SECOND, -11.0, CCubicSpline::FIRST, 7.0); + CCubicSpline S1(x, y, CCubicSpline::SECOND, -11.0, CCubicSpline::FIRST, 7.0); - CCubicSpline S2(x,y, CCubicSpline::FIRST, 8.75, CCubicSpline::SECOND, 10.0); + CCubicSpline S2(x, y, CCubicSpline::FIRST, 8.75, CCubicSpline::SECOND, 10.0); /*--- at the knots ---*/ for (auto v : x) { @@ -59,7 +58,7 @@ TEST_CASE("C1DInterpolation", "[Toolboxes]") { } /*--- away from the knots ---*/ - for (auto& v : x) v = std::min(v+0.1, 2.0); + for (auto& v : x) v = std::min(v + 0.1, 2.0); for (auto v : x) { auto ref = myPoly(v); @@ -69,8 +68,7 @@ TEST_CASE("C1DInterpolation", "[Toolboxes]") { } /*--- Checks that intervals are mapped correctly ---*/ - for (size_t i = 1; i < x.size()-2; ++i) { - CHECK(L(x[i]) == Approx(0.5*(y[i]+y[i+1]))); + for (size_t i = 1; i < x.size() - 2; ++i) { + CHECK(L(x[i]) == Approx(0.5 * (y[i] + y[i + 1]))); } } - diff --git a/UnitTests/Common/toolboxes/CQuasiNewtonInvLeastSquares_tests.cpp b/UnitTests/Common/toolboxes/CQuasiNewtonInvLeastSquares_tests.cpp index d27e55cfd20..a3e62a932ab 100644 --- a/UnitTests/Common/toolboxes/CQuasiNewtonInvLeastSquares_tests.cpp +++ b/UnitTests/Common/toolboxes/CQuasiNewtonInvLeastSquares_tests.cpp @@ -3,7 +3,7 @@ * \brief Unit tests for the CQuasiNewtonInvLeastSquares class. * Which should find the root of a n-d linear problem in n+1 iterations. * \author P. Gomes - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -33,48 +33,40 @@ struct Problem { static constexpr int N = 4; - const passivedouble coeffs[N][N] = {{0.5, -0.7, 0.2, 3.0}, - {1.0, -0.2, -0.6, 0.0}, - {0.1, 0.2, 3.14, -1.0}, - {-1.0, -0.4, 0.0, 1.6}}; + const passivedouble coeffs[N][N] = { + {0.5, -0.7, 0.2, 3.0}, {1.0, -0.2, -0.6, 0.0}, {0.1, 0.2, 3.14, -1.0}, {-1.0, -0.4, 0.0, 1.6}}; /*--- Row sum, sol should be {1.0}. ---*/ const passivedouble rhs[N] = {3.0, 0.2, 2.44, 0.2}; passivedouble sol[N] = {0.0}; - template + template void iterate(const T& x) { - for(int i=0; i +template void iterate(P& p, Q& q) { p.iterate(q); - for(int i=0; i qnils(Problem::N+1, Problem::N, 1); + CQuasiNewtonInvLeastSquares qnils(Problem::N + 1, Problem::N, 1); /*--- Solve ---*/ - for(int i=0; i<=Problem::N; ++i) - iterate(p, qnils); + for (int i = 0; i <= Problem::N; ++i) iterate(p, qnils); /*--- Check we solved in N+1 iterations. ---*/ - for(int i=0; i. + */ + +#include "catch.hpp" +#include "../../../../Common/include/CConfig.hpp" +#if defined(HAVE_MLPCPP) +#include "../../../../subprojects/MLPCpp/include/CLookUp_ANN.hpp" +#define USE_MLPCPP +#endif +#include + +#ifdef USE_MLPCPP +TEST_CASE("LookUp ANN test", "[LookUpANN]") { + std::string MLP_input_files[] = {"src/SU2/UnitTests/Common/toolboxes/multilayer_perceptron/simple_mlp.mlp"}; + unsigned short n_MLPs = 1; + MLPToolbox::CLookUp_ANN ANN(n_MLPs, MLP_input_files); + std::vector MLP_input_names, MLP_output_names; + std::vector MLP_inputs; + std::vector MLP_outputs; + su2double x, y, z; + + /*--- Define MLP inputs and outputs ---*/ + MLP_input_names.resize(2); + MLP_input_names[0] = "x"; + MLP_input_names[1] = "y"; + MLP_inputs.resize(2); + + MLP_outputs.resize(1); + MLP_output_names.resize(1); + MLP_output_names[0] = "z"; + MLP_outputs[0] = &z; + + /*--- Generate input-output map ---*/ + MLPToolbox::CIOMap iomap(MLP_input_names, MLP_output_names); + ANN.PairVariableswithMLPs(iomap); + /*--- MLP evaluation on point in the middle of the training data range ---*/ + x = 1.0; + y = -0.5; + + MLP_inputs[0] = x; + MLP_inputs[1] = y; + ANN.PredictANN(&iomap, MLP_inputs, MLP_outputs); + CHECK(z == Approx(0.344829)); + + /*--- MLP evaluation on point outside the training data range ---*/ + x = 3.0; + y = -10; + MLP_inputs[0] = x; + MLP_inputs[1] = y; + ANN.PredictANN(&iomap, MLP_inputs, MLP_outputs); + CHECK(z == Approx(0.012737)); +} +#endif diff --git a/UnitTests/Common/toolboxes/multilayer_perceptron/simple_mlp.mlp b/UnitTests/Common/toolboxes/multilayer_perceptron/simple_mlp.mlp new file mode 100644 index 00000000000..5336c8d6047 --- /dev/null +++ b/UnitTests/Common/toolboxes/multilayer_perceptron/simple_mlp.mlp @@ -0,0 +1,47 @@ +
+ +[number of layers] +3 + +[neurons per layer] +2 +4 +1 + +[activation function] +linear +elu +linear + +[input names] +x +y + +[input normalization] ++0.0000000000000000e+00 +2.0000000000000000e+00 +-1.0000000000000000e+00 +0.0000000000000000e+00 + +[output names] +z + +[output normalization] +-1.0000000000000000e+00 +9.9998769302960888e-01 + +
+ +[weights per layer] + +-4.1729342937469482e-01 -2.2465672492980957e+00 +1.1258139610290527e+00 -7.0158332586288452e-01 ++1.1477893590927124e+00 +2.5089375674724579e-02 +2.6767715811729431e-01 +1.0031684637069702e+00 + + ++2.5062826275825500e-01 +-6.2471812963485718e-01 +-2.0578651130199432e-01 ++2.6085931062698364e-01 + + +[biases per layer] ++0.0000000000000000e+00 +0.0000000000000000e+00 +0.0000000000000000e+00 ++7.5714819133281708e-02 +7.7316933870315552e-01 -4.4279521703720093e-01 +4.1041103005409241e-01 ++2.8878501057624817e-01 diff --git a/UnitTests/Common/toolboxes/ndflattener_tests.cpp b/UnitTests/Common/toolboxes/ndflattener_tests.cpp index 7393443db59..87d3b1f9e29 100644 --- a/UnitTests/Common/toolboxes/ndflattener_tests.cpp +++ b/UnitTests/Common/toolboxes/ndflattener_tests.cpp @@ -2,7 +2,7 @@ * \file ndflattener_tests.cpp * \brief Unit tests for NdFlattener template classes. * \author M. Aehle - * \version 7.5.1 "Blackbird" + * \version 8.0.0 "Harrier" * * SU2 Project Website: https://su2code.github.io * @@ -28,24 +28,24 @@ #include "catch.hpp" #include "../../Common/include/toolboxes/ndflattener.hpp" -TEST_CASE("NdFlattener Test", "[NdFlattener]"){ - - int rank_; SU2_MPI::Comm_rank(SU2_MPI::GetComm(), &rank_); - int size_; SU2_MPI::Comm_size(SU2_MPI::GetComm(), &size_); +TEST_CASE("NdFlattener Test", "[NdFlattener]") { + int rank_; + SU2_MPI::Comm_rank(SU2_MPI::GetComm(), &rank_); + int size_; + SU2_MPI::Comm_size(SU2_MPI::GetComm(), &size_); const size_t rank = rank_, size = size_; /*-- Provide non-flat array --*/ su2double** A = new su2double*[2]; - A[0] = new su2double[2]; A[0][0] = 0.0; A[0][1] = 1.0; - A[1] = new su2double[3+rank]; - for(size_t i=0; i<3+rank; i++) - A[1][i] = 2.0 + rank + i; + A[0] = new su2double[2]; + A[0][0] = 0.0; + A[0][1] = 1.0; + A[1] = new su2double[3 + rank]; + for (size_t i = 0; i < 3 + rank; i++) A[1][i] = 2.0 + rank + i; /*-- Accessor --*/ - auto f = std::make_pair( (size_t)2, [rank,A](int i) { - return std::make_pair( (size_t)(i==0?2:(3+rank)), [rank,A,i](int j){ - return A[i][j]; - }); + auto f = std::make_pair((size_t)2, [rank, A](int i) { + return std::make_pair((size_t)(i == 0 ? 2 : (3 + rank)), [rank, A, i](int j) { return A[i][j]; }); }); /*-- Read into flattening structure --*/ @@ -56,12 +56,12 @@ TEST_CASE("NdFlattener Test", "[NdFlattener]"){ A[0][0] = 0.5; /*-- Check structure --*/ - REQUIRE( nd2.size() == 2 ); - REQUIRE( nd2[0][0] == 0.0 ); - REQUIRE( nd2[0][1] == 1.0 ); - REQUIRE( nd2[1].size() == 3 + rank ); - for(size_t i=0; i<3+rank; i++){ - REQUIRE( nd2[1][i] == 2.0 + rank + i ); + REQUIRE(nd2.size() == 2); + REQUIRE(nd2[0][0] == 0.0); + REQUIRE(nd2[0][1] == 1.0); + REQUIRE(nd2[1].size() == 3 + rank); + for (size_t i = 0; i < 3 + rank; i++) { + REQUIRE(nd2[1][i] == 2.0 + rank + i); } /*-- Modify structure. --*/ @@ -72,70 +72,68 @@ TEST_CASE("NdFlattener Test", "[NdFlattener]"){ NdFlattener<3> nd3(Nd_MPI_Environment(), nd2); /*-- Check gathered structure, non-const look-up. --*/ - REQUIRE( nd3.size() == size ); - for(size_t r=0; r& nd3_const = nd3; - REQUIRE( nd3_const.size() == size ); - for(size_t r=0; r a1( - std::make_pair( (size_t)(3+rank), [rank,A](int i) { - return (unsigned long)(2+rank+i); - }) - ); + NdFlattener<1, unsigned long> a1( + std::make_pair((size_t)(3 + rank), [rank, A](int i) { return (unsigned long)(2 + rank + i); })); const NdFlattener<1, unsigned long>& a1_const = a1; - REQUIRE( a1.size() == 3 + rank ); - for(size_t i=0; i<3+rank; i++){ - REQUIRE( a1[i] == 2 + rank + i ); - REQUIRE( a1_const[i] == 2 + rank + i ); + REQUIRE(a1.size() == 3 + rank); + for (size_t i = 0; i < 3 + rank; i++) { + REQUIRE(a1[i] == 2 + rank + i); + REQUIRE(a1_const[i] == 2 + rank + i); } a1[0] = 1; - REQUIRE( a1_const.data()[0] == 1 ); + REQUIRE(a1_const.data()[0] == 1); a1.data()[0] = 2 + rank; - REQUIRE( a1_const[0] == 2 + rank ); + REQUIRE(a1_const[0] == 2 + rank); const NdFlattener<2, unsigned long> a2_const(Nd_MPI_Environment(MPI_UNSIGNED_LONG), a1); - REQUIRE( a2_const.size() == size ); - for(size_t r=0; r +template struct arithmeticFun { - static T f(T A, T B, T C, T D, U x, U y) { - return pow( (A+B-x*C)/y + pow(A*x-C/D, y), D); - } + static T f(T A, T B, T C, T D, U x, U y) { return pow((A + B - x * C) / y + pow(A * x - C / D, y), D); } }; -template +template struct logicFun { static T f(T A, T B, T C, T D, U x, U y) { // (B < A || B >= C) && ... - return fmax(B < A, B >= fmin(C,-D)) * (abs(A) == abs(x)) * (abs(C) != abs(y)); + return fmax(B < A, B >= fmin(C, -D)) * (abs(A) == abs(x)) * (abs(C) != abs(y)); } }; -template class Fun, class T, class U> +template